From a1c8543f2acd7086d412cb794b32f96794b00659 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 24 Dec 2007 18:27:28 +0000 Subject: Step 3 for the initial commits for 2.5: removing src/ and python, adding new windowmanager module, and the first bits of new editors module. --- source/blender/src/.BCkey | 1 - source/blender/src/B.blend.c | 3076 ------ source/blender/src/Bfont.c | 139 - source/blender/src/CMakeLists.txt | 85 - source/blender/src/Makefile | 149 - source/blender/src/SConscript | 82 - source/blender/src/bfont.ttf.c | 5992 ------------ source/blender/src/blenderbuttons.c | 2020 ---- source/blender/src/booleanops.c | 566 -- source/blender/src/booleanops_mesh.c | 296 - source/blender/src/butspace.c | 801 -- source/blender/src/buttons_editing.c | 6153 ------------ source/blender/src/buttons_logic.c | 2814 ------ source/blender/src/buttons_object.c | 4749 --------- source/blender/src/buttons_scene.c | 2082 ---- source/blender/src/buttons_script.c | 384 - source/blender/src/buttons_shading.c | 4372 --------- source/blender/src/cmap.tga.c | 92 - source/blender/src/cmovie.tga.c | 205 - source/blender/src/cre/license.jpeg.c | 38 - source/blender/src/cre/license_key.c | 197 - source/blender/src/cursors.c | 840 -- source/blender/src/drawaction.c | 1294 --- source/blender/src/drawarmature.c | 2279 ----- source/blender/src/drawdeps.c | 316 - source/blender/src/drawimage.c | 2721 ------ source/blender/src/drawimasel.c | 735 -- source/blender/src/drawipo.c | 2730 ------ source/blender/src/drawmesh.c | 1222 --- source/blender/src/drawnla.c | 862 -- source/blender/src/drawnode.c | 2886 ------ source/blender/src/drawobject.c | 5555 ----------- source/blender/src/drawoops.c | 521 - source/blender/src/drawscene.c | 135 - source/blender/src/drawscript.c | 153 - source/blender/src/drawseq.c | 1482 --- source/blender/src/drawsound.c | 240 - source/blender/src/drawtext.c | 2230 ----- source/blender/src/drawtime.c | 454 - source/blender/src/drawview.c | 3633 ------- source/blender/src/edit.c | 1936 ---- source/blender/src/editaction.c | 3097 ------ source/blender/src/editarmature.c | 4770 --------- source/blender/src/editconstraint.c | 1103 --- source/blender/src/editcurve.c | 4632 --------- source/blender/src/editdeform.c | 944 -- source/blender/src/editface.c | 1437 --- source/blender/src/editfont.c | 1291 --- source/blender/src/editgroup.c | 186 - source/blender/src/editimasel.c | 1156 --- source/blender/src/editipo.c | 5790 ----------- source/blender/src/editipo_lib.c | 401 - source/blender/src/editipo_mods.c | 1403 --- source/blender/src/editkey.c | 777 -- source/blender/src/editlattice.c | 323 - source/blender/src/editmball.c | 544 -- source/blender/src/editmesh.c | 2205 ----- source/blender/src/editmesh_add.c | 1349 --- source/blender/src/editmesh_lib.c | 2239 ----- source/blender/src/editmesh_loop.c | 954 -- source/blender/src/editmesh_mods.c | 4139 -------- source/blender/src/editmesh_tools.c | 6800 ------------- source/blender/src/editmode_undo.c | 348 - source/blender/src/editnla.c | 2054 ---- source/blender/src/editnode.c | 2244 ----- source/blender/src/editobject.c | 5620 ----------- source/blender/src/editoops.c | 675 -- source/blender/src/editparticle.c | 3141 ------ source/blender/src/editscreen.c | 3818 -------- source/blender/src/editseq.c | 3705 ------- source/blender/src/editsima.c | 2436 ----- source/blender/src/editsound.c | 1063 -- source/blender/src/edittime.c | 1008 -- source/blender/src/editview.c | 2777 ------ source/blender/src/eventdebug.c | 195 - source/blender/src/filelist.c | 1135 --- source/blender/src/filesel.c | 2611 ----- source/blender/src/fluidsim.c | 1147 --- source/blender/src/fsmenu.c | 257 - source/blender/src/ghostwinlay.c | 835 -- source/blender/src/glutil.c | 695 -- source/blender/src/hddaudio.c | 577 -- source/blender/src/header_action.c | 1285 --- source/blender/src/header_buttonswin.c | 729 -- source/blender/src/header_filesel.c | 194 - source/blender/src/header_image.c | 1305 --- source/blender/src/header_imasel.c | 211 - source/blender/src/header_info.c | 2181 ----- source/blender/src/header_ipo.c | 1408 --- source/blender/src/header_nla.c | 566 -- source/blender/src/header_node.c | 673 -- source/blender/src/header_oops.c | 578 -- source/blender/src/header_script.c | 280 - source/blender/src/header_seq.c | 729 -- source/blender/src/header_sound.c | 444 - source/blender/src/header_text.c | 847 -- source/blender/src/header_time.c | 539 -- source/blender/src/header_view3d.c | 5489 ----------- source/blender/src/headerbuttons.c | 2091 ---- source/blender/src/imagepaint.c | 790 -- source/blender/src/imasel.c | 85 - source/blender/src/interface.c | 6699 ------------- source/blender/src/interface_draw.c | 2467 ----- source/blender/src/interface_icons.c | 1074 --- source/blender/src/interface_panel.c | 1957 ---- source/blender/src/keyval.c | 354 - source/blender/src/language.c | 453 - source/blender/src/lorem.c | 516 - source/blender/src/mainqueue.c | 102 - source/blender/src/meshlaplacian.c | 1891 ---- source/blender/src/meshtools.c | 1132 --- source/blender/src/multires-firstlevel.c | 410 - source/blender/src/multires.c | 1650 ---- source/blender/src/mywindow.c | 744 -- source/blender/src/oops.c | 1104 --- source/blender/src/outliner.c | 3640 ------- source/blender/src/parametrizer.c | 4200 -------- source/blender/src/parametrizer.h | 85 - source/blender/src/parametrizer_intern.h | 192 - source/blender/src/playanim.c | 813 -- source/blender/src/poseobject.c | 1258 --- source/blender/src/preview.blend.c | 13901 --------------------------- source/blender/src/previewrender.c | 912 -- source/blender/src/prvicons.c | 436 - source/blender/src/pub/license_key.c | 447 - source/blender/src/reeb.c | 1923 ---- source/blender/src/renderwin.c | 1449 --- source/blender/src/resources.c | 923 -- source/blender/src/retopo.c | 921 -- source/blender/src/scrarea.c | 69 - source/blender/src/screendump.c | 161 - source/blender/src/sculptmode-stroke.c | 279 - source/blender/src/sculptmode.c | 2267 ----- source/blender/src/seqaudio.c | 553 -- source/blender/src/seqeffects.c | 3032 ------ source/blender/src/seqscopes.c | 340 - source/blender/src/sequence.c | 1776 ---- source/blender/src/space.c | 6678 ------------- source/blender/src/spacetypes.c | 161 - source/blender/src/splash.jpg.c | 2483 ----- source/blender/src/swapbuffers.c | 289 - source/blender/src/toets.c | 983 -- source/blender/src/toolbox.c | 2245 ----- source/blender/src/transform.c | 4115 -------- source/blender/src/transform_constraints.c | 1046 -- source/blender/src/transform_conversions.c | 3616 ------- source/blender/src/transform_generics.c | 1061 -- source/blender/src/transform_manipulator.c | 1720 ---- source/blender/src/transform_numinput.c | 247 - source/blender/src/transform_snap.c | 712 -- source/blender/src/unwrapper.c | 480 - source/blender/src/usiblender.c | 1050 -- source/blender/src/verse_common.c | 298 - source/blender/src/verse_image.c | 343 - source/blender/src/verse_mesh.c | 1629 ---- source/blender/src/verse_object.c | 600 -- source/blender/src/view.c | 1863 ---- source/blender/src/vpaint.c | 1621 ---- source/blender/src/winlay.h | 88 - source/blender/src/writeavicodec.c | 835 -- source/blender/src/writeimage.c | 243 - source/blender/src/writemovie.c | 502 - 162 files changed, 263860 deletions(-) delete mode 100644 source/blender/src/.BCkey delete mode 100644 source/blender/src/B.blend.c delete mode 100644 source/blender/src/Bfont.c delete mode 100644 source/blender/src/CMakeLists.txt delete mode 100644 source/blender/src/Makefile delete mode 100644 source/blender/src/SConscript delete mode 100644 source/blender/src/bfont.ttf.c delete mode 100644 source/blender/src/blenderbuttons.c delete mode 100644 source/blender/src/booleanops.c delete mode 100644 source/blender/src/booleanops_mesh.c delete mode 100644 source/blender/src/butspace.c delete mode 100644 source/blender/src/buttons_editing.c delete mode 100644 source/blender/src/buttons_logic.c delete mode 100644 source/blender/src/buttons_object.c delete mode 100644 source/blender/src/buttons_scene.c delete mode 100644 source/blender/src/buttons_script.c delete mode 100644 source/blender/src/buttons_shading.c delete mode 100644 source/blender/src/cmap.tga.c delete mode 100644 source/blender/src/cmovie.tga.c delete mode 100644 source/blender/src/cre/license.jpeg.c delete mode 100644 source/blender/src/cre/license_key.c delete mode 100644 source/blender/src/cursors.c delete mode 100644 source/blender/src/drawaction.c delete mode 100644 source/blender/src/drawarmature.c delete mode 100644 source/blender/src/drawdeps.c delete mode 100644 source/blender/src/drawimage.c delete mode 100644 source/blender/src/drawimasel.c delete mode 100644 source/blender/src/drawipo.c delete mode 100644 source/blender/src/drawmesh.c delete mode 100644 source/blender/src/drawnla.c delete mode 100644 source/blender/src/drawnode.c delete mode 100644 source/blender/src/drawobject.c delete mode 100644 source/blender/src/drawoops.c delete mode 100644 source/blender/src/drawscene.c delete mode 100644 source/blender/src/drawscript.c delete mode 100644 source/blender/src/drawseq.c delete mode 100644 source/blender/src/drawsound.c delete mode 100644 source/blender/src/drawtext.c delete mode 100644 source/blender/src/drawtime.c delete mode 100644 source/blender/src/drawview.c delete mode 100644 source/blender/src/edit.c delete mode 100644 source/blender/src/editaction.c delete mode 100644 source/blender/src/editarmature.c delete mode 100644 source/blender/src/editconstraint.c delete mode 100644 source/blender/src/editcurve.c delete mode 100644 source/blender/src/editdeform.c delete mode 100644 source/blender/src/editface.c delete mode 100644 source/blender/src/editfont.c delete mode 100644 source/blender/src/editgroup.c delete mode 100644 source/blender/src/editimasel.c delete mode 100644 source/blender/src/editipo.c delete mode 100644 source/blender/src/editipo_lib.c delete mode 100644 source/blender/src/editipo_mods.c delete mode 100644 source/blender/src/editkey.c delete mode 100644 source/blender/src/editlattice.c delete mode 100644 source/blender/src/editmball.c delete mode 100644 source/blender/src/editmesh.c delete mode 100644 source/blender/src/editmesh_add.c delete mode 100644 source/blender/src/editmesh_lib.c delete mode 100644 source/blender/src/editmesh_loop.c delete mode 100644 source/blender/src/editmesh_mods.c delete mode 100644 source/blender/src/editmesh_tools.c delete mode 100644 source/blender/src/editmode_undo.c delete mode 100644 source/blender/src/editnla.c delete mode 100644 source/blender/src/editnode.c delete mode 100644 source/blender/src/editobject.c delete mode 100644 source/blender/src/editoops.c delete mode 100644 source/blender/src/editparticle.c delete mode 100644 source/blender/src/editscreen.c delete mode 100644 source/blender/src/editseq.c delete mode 100644 source/blender/src/editsima.c delete mode 100644 source/blender/src/editsound.c delete mode 100644 source/blender/src/edittime.c delete mode 100644 source/blender/src/editview.c delete mode 100644 source/blender/src/eventdebug.c delete mode 100644 source/blender/src/filelist.c delete mode 100644 source/blender/src/filesel.c delete mode 100644 source/blender/src/fluidsim.c delete mode 100644 source/blender/src/fsmenu.c delete mode 100644 source/blender/src/ghostwinlay.c delete mode 100644 source/blender/src/glutil.c delete mode 100644 source/blender/src/hddaudio.c delete mode 100644 source/blender/src/header_action.c delete mode 100644 source/blender/src/header_buttonswin.c delete mode 100644 source/blender/src/header_filesel.c delete mode 100644 source/blender/src/header_image.c delete mode 100644 source/blender/src/header_imasel.c delete mode 100644 source/blender/src/header_info.c delete mode 100644 source/blender/src/header_ipo.c delete mode 100644 source/blender/src/header_nla.c delete mode 100644 source/blender/src/header_node.c delete mode 100644 source/blender/src/header_oops.c delete mode 100644 source/blender/src/header_script.c delete mode 100644 source/blender/src/header_seq.c delete mode 100644 source/blender/src/header_sound.c delete mode 100644 source/blender/src/header_text.c delete mode 100644 source/blender/src/header_time.c delete mode 100644 source/blender/src/header_view3d.c delete mode 100644 source/blender/src/headerbuttons.c delete mode 100644 source/blender/src/imagepaint.c delete mode 100644 source/blender/src/imasel.c delete mode 100644 source/blender/src/interface.c delete mode 100644 source/blender/src/interface_draw.c delete mode 100644 source/blender/src/interface_icons.c delete mode 100644 source/blender/src/interface_panel.c delete mode 100644 source/blender/src/keyval.c delete mode 100644 source/blender/src/language.c delete mode 100644 source/blender/src/lorem.c delete mode 100644 source/blender/src/mainqueue.c delete mode 100644 source/blender/src/meshlaplacian.c delete mode 100644 source/blender/src/meshtools.c delete mode 100644 source/blender/src/multires-firstlevel.c delete mode 100644 source/blender/src/multires.c delete mode 100644 source/blender/src/mywindow.c delete mode 100644 source/blender/src/oops.c delete mode 100644 source/blender/src/outliner.c delete mode 100644 source/blender/src/parametrizer.c delete mode 100644 source/blender/src/parametrizer.h delete mode 100644 source/blender/src/parametrizer_intern.h delete mode 100644 source/blender/src/playanim.c delete mode 100644 source/blender/src/poseobject.c delete mode 100644 source/blender/src/preview.blend.c delete mode 100644 source/blender/src/previewrender.c delete mode 100644 source/blender/src/prvicons.c delete mode 100644 source/blender/src/pub/license_key.c delete mode 100644 source/blender/src/reeb.c delete mode 100644 source/blender/src/renderwin.c delete mode 100644 source/blender/src/resources.c delete mode 100644 source/blender/src/retopo.c delete mode 100644 source/blender/src/scrarea.c delete mode 100644 source/blender/src/screendump.c delete mode 100644 source/blender/src/sculptmode-stroke.c delete mode 100644 source/blender/src/sculptmode.c delete mode 100644 source/blender/src/seqaudio.c delete mode 100644 source/blender/src/seqeffects.c delete mode 100644 source/blender/src/seqscopes.c delete mode 100644 source/blender/src/sequence.c delete mode 100644 source/blender/src/space.c delete mode 100644 source/blender/src/spacetypes.c delete mode 100644 source/blender/src/splash.jpg.c delete mode 100644 source/blender/src/swapbuffers.c delete mode 100644 source/blender/src/toets.c delete mode 100644 source/blender/src/toolbox.c delete mode 100644 source/blender/src/transform.c delete mode 100644 source/blender/src/transform_constraints.c delete mode 100644 source/blender/src/transform_conversions.c delete mode 100644 source/blender/src/transform_generics.c delete mode 100644 source/blender/src/transform_manipulator.c delete mode 100644 source/blender/src/transform_numinput.c delete mode 100644 source/blender/src/transform_snap.c delete mode 100644 source/blender/src/unwrapper.c delete mode 100644 source/blender/src/usiblender.c delete mode 100644 source/blender/src/verse_common.c delete mode 100644 source/blender/src/verse_image.c delete mode 100644 source/blender/src/verse_mesh.c delete mode 100644 source/blender/src/verse_object.c delete mode 100644 source/blender/src/view.c delete mode 100644 source/blender/src/vpaint.c delete mode 100644 source/blender/src/winlay.h delete mode 100644 source/blender/src/writeavicodec.c delete mode 100644 source/blender/src/writeimage.c delete mode 100644 source/blender/src/writemovie.c (limited to 'source/blender/src') diff --git a/source/blender/src/.BCkey b/source/blender/src/.BCkey deleted file mode 100644 index a0fd5e817d4..00000000000 --- a/source/blender/src/.BCkey +++ /dev/null @@ -1 +0,0 @@ -0xffffffff 0xfffffff0 fffffffe diff --git a/source/blender/src/B.blend.c b/source/blender/src/B.blend.c deleted file mode 100644 index 0a33fc99013..00000000000 --- a/source/blender/src/B.blend.c +++ /dev/null @@ -1,3076 +0,0 @@ -/* DataToC output of file */ - -int datatoc_B_blend_size= 98212; -char datatoc_B_blend[]= { - 66, 76, 69, 78, - 68, 69, 82, 95,118, 50, 52, 49, 82, 69, 78, 68, 32, 0, 0, 0,144,240,255,191, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -250, 0, 0, 0, 83, 99,101,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 83, 82, 0, 0, -116, 0, 0, 0, 8,237,195, 8,109, 0, 0, 0, 1, 0, 0, 0, 96, 40,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 82, 49, 45, 65,110,105,109, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -232,150,192, 8,168,240,195, 8,232,240,195, 8, 24,247,195, 8, 96,247,195, 8,152, 31,196, 8,136,251,196, 8, 0, 0,231, 3, -143, 1,174, 4,232, 3, 32, 3, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,150,192, 8,110, 0, 0, 0, 1, 0, 0, 0,168,237,195, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,237,195, 8,110, 0, 0, 0, 1, 0, 0, 0, -232,237,195, 8,232,150,192, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,237,195, 8, -110, 0, 0, 0, 1, 0, 0, 0, 40,238,195, 8,168,237,195, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, - 20, 0, 0, 0, 40,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,238,195, 8,232,237,195, 8, 0, 0, 0, 0,232, 3, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,238,195, 8, 40,238,195, 8, - 0, 0, 0, 0,232, 3,248, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,238,195, 8,110, 0, 0, 0, 1, 0, 0, 0, -232,238,195, 8,104,238,195, 8, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,238,195, 8, -110, 0, 0, 0, 1, 0, 0, 0, 40,239,195, 8,168,238,195, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, - 20, 0, 0, 0, 40,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,239,195, 8,232,238,195, 8, 0, 0, 0, 0,160, 2,248, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,239,195, 8, 40,239,195, 8, - 0, 0, 0, 0,160, 2, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,239,195, 8,110, 0, 0, 0, 1, 0, 0, 0, -232,239,195, 8,104,239,195, 8, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,232,239,195, 8, -110, 0, 0, 0, 1, 0, 0, 0, 40,240,195, 8,168,239,195, 8, 0, 0, 0, 0,232, 3,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 20, 0, 0, 0, 40,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0,104,240,195, 8,232,239,195, 8, 0, 0, 0, 0,204, 0,248, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0,168,240,195, 8, 40,240,195, 8, - 0, 0, 0, 0,204, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,168,240,195, 8,110, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0,104,240,195, 8, 0, 0, 0, 0,204, 0,188, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,232,240,195, 8, -111, 0, 0, 0, 1, 0, 0, 0, 48,241,195, 8, 0, 0, 0, 0,168,237,195, 8,232,237,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 48,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0,120,241,195, 8,232,240,195, 8,232,150,192, 8, - 40,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,120,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0, -192,241,195, 8, 48,241,195, 8,168,237,195, 8,168,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -192,241,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 8,242,195, 8,120,241,195, 8,232,237,195, 8,232,238,195, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,242,195, 8,192,241,195, 8, -168,238,195, 8,232,238,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,242,195, 8,111, 0, 0, 0, - 1, 0, 0, 0,152,242,195, 8, 8,242,195, 8,104,238,195, 8, 40,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,152,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0,224,242,195, 8, 80,242,195, 8,232,238,195, 8,104,239,195, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,242,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 40,243,195, 8, -152,242,195, 8, 40,239,195, 8,104,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 40,243,195, 8, -111, 0, 0, 0, 1, 0, 0, 0,112,243,195, 8,224,242,195, 8,104,238,195, 8,232,238,195, 8, 1, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,112,243,195, 8,111, 0, 0, 0, 1, 0, 0, 0,184,243,195, 8, 40,243,195, 8,232,150,192, 8, -168,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,243,195, 8,111, 0, 0, 0, 1, 0, 0, 0, - 0,244,195, 8,112,243,195, 8,104,238,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, - 0,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 72,244,195, 8,184,243,195, 8, 40,238,195, 8,232,239,195, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 72,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0,144,244,195, 8, 0,244,195, 8, -168,239,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,244,195, 8,111, 0, 0, 0, - 1, 0, 0, 0,216,244,195, 8, 72,244,195, 8, 40,239,195, 8, 40,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,216,244,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 32,245,195, 8,144,244,195, 8,168,238,195, 8,104,240,195, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 32,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0,104,245,195, 8, -216,244,195, 8,104,239,195, 8,104,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104,245,195, 8, -111, 0, 0, 0, 1, 0, 0, 0,176,245,195, 8, 32,245,195, 8, 40,240,195, 8,104,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,176,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0,248,245,195, 8,104,245,195, 8,168,239,195, 8, -168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,245,195, 8,111, 0, 0, 0, 1, 0, 0, 0, - 64,246,195, 8,176,245,195, 8,232,239,195, 8,168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, - 64,246,195, 8,111, 0, 0, 0, 1, 0, 0, 0,136,246,195, 8,248,245,195, 8,104,238,195, 8, 40,240,195, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,136,246,195, 8,111, 0, 0, 0, 1, 0, 0, 0,208,246,195, 8, 64,246,195, 8, - 40,240,195, 8,168,240,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,246,195, 8,111, 0, 0, 0, - 1, 0, 0, 0, 24,247,195, 8,136,246,195, 8,168,238,195, 8,168,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0, 24,247,195, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,208,246,195, 8,104,240,195, 8,168,240,195, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 96,247,195, 8,113, 0, 0, 0, 1, 0, 0, 0,104, 5,196, 8, - 0, 0, 0, 0,232,150,192, 8,168,239,195, 8,232,239,195, 8, 40,238,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, - 0, 0, 0, 0,187, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,161, 0, 0, 0,187, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, - 0, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,233, 3,161, 0, 3, 0, 3, 0, 79, 1, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 2,196, 8,232, 3,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 88,248,195, 8, 24, 2,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 88,248,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 40,249,195, 8, - 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 40,249,195, 8,112, 0, 0, 0, 1, 0, 0, 0,248,249,195, 8, 88,248,195, 8, 77,101,115,104, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116, -105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -248,249,195, 8,112, 0, 0, 0, 1, 0, 0, 0,200,250,195, 8, 40,249,195, 8, 65,110,105,109, 32,115,101,116,116,105,110,103, -115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200,250,195, 8,112, 0, 0, 0, - 1, 0, 0, 0,152,251,195, 8,248,249,195, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,152,251,195, 8,112, 0, 0, 0, 1, 0, 0, 0,104,252,195, 8, -200,250,195, 8, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,104,252,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 56,253,195, 8,152,251,195, 8, 69,102,102,101, - 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, - 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, -162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, - 56,253,195, 8,112, 0, 0, 0, 1, 0, 0, 0, 8,254,195, 8,104,252,195, 8, 72,111,111,107,115, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200,250,195, 8, 68, 65, 84, 65,164, 0, 0, 0, 8,254,195, 8,112, 0, 0, 0, - 1, 0, 0, 0,216,254,195, 8, 56,253,195, 8, 80, 97,114,116,105, 99,108,101, 32, 73,110,116,101,114, 97, 99,116,105,111,110, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,152,251,195, 8, 68, 65, 84, 65,164, 0, 0, 0,216,254,195, 8,112, 0, 0, 0, 1, 0, 0, 0,168,255,195, 8, - 8,254,195, 8, 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,251,195, 8, - 68, 65, 84, 65,164, 0, 0, 0,168,255,195, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 0,196, 8,216,254,195, 8, 79,117,116,112, -117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -120, 0,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 72, 1,196, 8,168,255,195, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 1,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 24, 2,196, 8,120, 0,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 24, 2,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 72, 1,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,212, 0, 0, 0,232, 2,196, 8, 94, 0, 0, 0, 1, 0, 0, 0,232, 3,196, 8, 0, 0, 0, 0, 4, 0, 0, 0, - 51, 51, 51, 63, 1, 86,141, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0,193, 0, 64,212, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,145,133,185, 68, 0, 0, 0,193, 0, 0,104, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, - 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,161, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,232, 3,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -232, 2,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,141, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,104, 5,196, 8,113, 0, 0, 0, - 1, 0, 0, 0, 96, 6,196, 8, 96,247,195, 8,168,238,195, 8,168,237,195, 8,232,237,195, 8,232,238,195, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, - 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1, -196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 96, 6,196, 8,113, 0, 0, 0, - 1, 0, 0, 0, 88, 13,196, 8,104, 5,196, 8, 40,240,195, 8,104,240,195, 8,104,239,195, 8, 40,239,195, 8, 0, 0, 0, 0, - 71,187,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,205, 0, 0, 0,159, 2, 0, 0,249, 0, 0, 0, 19, 1, 0, 0, -205, 0, 0, 0,159, 2, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,211, 1,242, 1, 1, 0, 3, 0, -251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,248, 8,196, 8,216, 11,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 88, 7,196, 8, 40, 8,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 88, 7,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 40, 8,196, 8, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 40, 8,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 88, 7,196, 8, 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,180, 2, 0, 0,248, 8,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,216, 11,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, - 51, 51, 51, 63, 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,178, 13, 32, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 71,187,204, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, -111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, -205,204,204, 61, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 0, 1, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,221,162, 77, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,162, 77, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,216, 11,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -248, 8,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,156, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 88, 13,196, 8,113, 0, 0, 0, - 1, 0, 0, 0,240, 24,196, 8, 96, 6,196, 8, 40,239,195, 8,104,239,195, 8,232,238,195, 8,104,238,195, 8, 0, 0, 0, 0, - 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0, -161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 5, 3, 0, 0,161, 2, 0, 0,232, 3, 0, 0,249, 0, 0, 0, 19, 1, 0, 0, -161, 2, 0, 0,232, 3, 0, 0, 20, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 72, 1,242, 1, 3, 0, 3, 0, -203, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 15,196, 8,112, 23,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 14,196, 8, 80, 14,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80, 14,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 32, 15,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,120, 16,196, 8, - 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, - 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 7, 1, 0, 0, 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60, - 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189, -205,204,140, 63, 68, 65, 84, 65,196, 0, 0, 0,120, 16,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,104, 17,196, 8, 32, 15,196, 8, - 3, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, -124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -160, 0, 0, 0,104, 17,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 56, 18,196, 8,120, 16,196, 8, 11, 0, 0, 0, 51, 51, 51, 63, - 1, 86,160, 92, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, - 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, - 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0, 56, 18,196, 8,100, 0, 0, 0, - 1, 0, 0, 0,224, 18,196, 8,104, 17,196, 8, 9, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,240, 3,197, 8, 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, - 17, 0, 0, 0,114, 1, 0, 0,116, 1, 0, 0, 5, 0, 0, 0, 17, 0, 0, 0, 2, 0, 0, 0,116, 1, 0, 0, 68, 65, 84, 65, -164, 0, 0, 0,224, 18,196, 8, 99, 0, 0, 0, 1, 0, 0, 0,176, 19,196, 8, 56, 18,196, 8, 13, 0, 0, 0, 51, 51, 51, 63, - 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0, 0, 0,182, 67,108, 1, 0, 0, -124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 0, -108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,122, 68,205,204,204, 61, - 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0,176, 19,196, 8, -177, 0, 0, 0, 1, 0, 0, 0,144, 20,196, 8,224, 18,196, 8, 12, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67, 0, 0, 0,191, - 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 14, 2, 0, 0,128, 0, 0, 0, -108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, -144, 20,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,112, 23,196, 8,176, 19,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,160, 92, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 1,184,157, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, - 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 33,195, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194, - 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 84, 1, 0, 0,112, 23,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,144, 20,196, 8, 5, 0, 0, 0, - 51, 51, 51, 63, 1, 86,160, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,240, 24,196, 8,113, 0, 0, 0, 1, 0, 0, 0,152, 31,196, 8, - 88, 13,196, 8,168,240,195, 8, 40,240,195, 8,104,238,195, 8,232,239,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0, -189, 0, 0, 0,247, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0,189, 0, 0, 0,215, 0, 0, 0,205, 0, 0, 0,232, 3, 0, 0, -216, 0, 0, 0,247, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15, 28, 3, 32, 0, 3, 0, 3, 0,192, 2, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,136, 27,196, 8, 24, 30,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, -232, 25,196, 8,184, 26,196, 8, 68, 65, 84, 65,164, 0, 0, 0,232, 25,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 26,196, 8, - 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,184, 26,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,232, 25,196, 8, 77,101,115,104, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116, -105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0, -136, 27,196, 8,102, 0, 0, 0, 1, 0, 0, 0, 72, 28,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, - 0, 0,128,192, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 16, 66,123, 10, 4,194,181,186,152, 67, 0, 0, 0, 0, 0, 0, 16, 66, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 28, 3, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0, 16, 66, 0, 0,250, 70, 0, 0, 16, 66, -205,204,204, 61, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 68, 65, 84, 65,160, 0, 0, 0, 72, 28,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 24, 29,196, 8,136, 27,196, 8, 11, 0, 0, 0, - 51, 51, 51, 63, 1, 86,170, 76, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, - 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 36, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67, - 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 24, 29,196, 8, - 94, 0, 0, 0, 1, 0, 0, 0, 24, 30,196, 8, 72, 28,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,170, 76, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0, 0, 35, 68, 0, 0, 0,193, - 0, 0,104, 67,135, 22, 0,193,178, 16, 96, 68,112, 74,103, 67, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, - 1, 0, 1, 0,251, 4, 1, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 84, 1, 0, 0, 24, 30,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 24, 29,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, - 1, 86,170, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,152, 31,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240, 24,196, 8, -168,239,195, 8,168,238,195, 8,104,240,195, 8,168,240,195, 8, 0, 0, 0, 0,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, - 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0, - 5, 3, 0, 0, 0, 0, 0, 0,203, 0, 0, 0,189, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0,203, 0, 0, 0,216, 0, 0, 0, - 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3,204, 0, 46, 2, 3, 0, 3, 0,145, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 34,196, 8,224, 38,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,144, 32,196, 8, - 96, 33,196, 8, 68, 65, 84, 65,164, 0, 0, 0,144, 32,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 96, 33,196, 8, 0, 0, 0, 0, - 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -164, 0, 0, 0, 96, 33,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,144, 32,196, 8, 51, 68, 32, 86,105,101,119,112, -111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 0, 62, 1,204, 0, - 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,196, 0, 0, 0, 48, 34,196, 8, - 97, 0, 0, 0, 1, 0, 0, 0, 0, 36,196, 8, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 67, 0, 0,190,194, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 60, 67, 0,128, 11,196, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 46, 2, 0, 0, 0, 0,192,194, - 0,128, 11,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,188, 0, 46, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 35,196, 8, 1, 0, 0, 0, 1, 0, 0, 0, 68, 65, 84, 65, 12, 0, 0, 0, 32, 35,196, 8,128, 0, 0, 0, 1, 0, 0, 0, - 10, 0, 0, 0, 10, 0, 0, 0, 88, 35,196, 8, 68, 65, 84, 65,120, 0, 0, 0, 88, 35,196, 8,127, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0,136,251,196, 8, 0, 0, 0, 0, 1, 0, 1, 0,160, 2,197, 8, 0, 0, 0, 0, 1, 0, 1, 0, - 72, 12,197, 8, 0, 0, 0, 0, 1, 0, 1, 0, 24, 22,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,184, 18,197, 8, 0, 0, 0, 0, - 1, 0, 1, 0, 8, 21,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,152, 15,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,120, 1,197, 8, - 0, 0, 0, 0, 1, 0, 1, 0, 40, 9,197, 8, 0, 0, 0, 0, 1, 0, 1, 0,216, 0,197, 8, 68, 65, 84, 65,180, 2, 0, 0, - 0, 36,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,224, 38,196, 8, 48, 34,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 89, 2, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,233,234, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,159,125, 11, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0, 7, 0,175, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88,134, 55, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 84, 1, 0, 0,224, 38,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 36,196, 8, 5, 0, 0, 0, - 51, 51, 51, 63, 1, 89, 2, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0, 96, 40,196, 8,109, 0, 0, 0, 1, 0, 0, 0,192, 99,196, 8, - 8,237,195, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 50, 45, 77,111,100,101,108, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 41,196, 8,192, 42,196, 8, 0, 43,196, 8,136, 45,196, 8,208, 45,196, 8, -144, 86,196, 8,136,251,196, 8, 1, 0, 0, 5,254,255,253, 3, 0, 5, 0, 4, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 8, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 0, 41,196, 8,110, 0, 0, 0, - 1, 0, 0, 0, 64, 41,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, - 64, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0,128, 41,196, 8, 0, 41,196, 8, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,128, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0,192, 41,196, 8, 64, 41,196, 8, 0, 0, 0, 0, - 0, 5, 0, 4, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,192, 41,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 42,196, 8, -128, 41,196, 8, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 0, 42,196, 8,110, 0, 0, 0, - 1, 0, 0, 0, 64, 42,196, 8,192, 41,196, 8, 0, 0, 0, 0, 0, 0,236, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, - 64, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0,128, 42,196, 8, 0, 42,196, 8, 0, 0, 0, 0, 0, 5,236, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,128, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0,192, 42,196, 8, 64, 42,196, 8, 0, 0, 0, 0, - 0, 0,224, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,192, 42,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -128, 42,196, 8, 0, 0, 0, 0, 0, 5,224, 3, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 0, 43,196, 8,111, 0, 0, 0, - 1, 0, 0, 0, 72, 43,196, 8, 0, 0, 0, 0, 64, 41,196, 8,128, 41,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0, 72, 43,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144, 43,196, 8, 0, 43,196, 8, 0, 41,196, 8,192, 41,196, 8, - 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144, 43,196, 8,111, 0, 0, 0, 1, 0, 0, 0,216, 43,196, 8, - 72, 43,196, 8, 0, 41,196, 8, 0, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,216, 43,196, 8, -111, 0, 0, 0, 1, 0, 0, 0, 32, 44,196, 8,144, 43,196, 8,192, 41,196, 8, 64, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 32, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0,104, 44,196, 8,216, 43,196, 8, 0, 42,196, 8, - 64, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -176, 44,196, 8, 32, 44,196, 8, 64, 41,196, 8,128, 42,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -176, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248, 44,196, 8,104, 44,196, 8,128, 41,196, 8,192, 42,196, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248, 44,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 64, 45,196, 8,176, 44,196, 8, -128, 42,196, 8,192, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 64, 45,196, 8,111, 0, 0, 0, - 1, 0, 0, 0,136, 45,196, 8,248, 44,196, 8, 0, 42,196, 8,128, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,136, 45,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 45,196, 8, 64, 42,196, 8,192, 42,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,208, 45,196, 8,113, 0, 0, 0, 1, 0, 0, 0,152, 85,196, 8, - 0, 0, 0, 0, 0, 41,196, 8, 0, 42,196, 8, 64, 42,196, 8,192, 41,196, 8, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,209, 0, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 0,208, 0, 0, 0, 5, 0, 4, 0, 2, 0, 4, 4, 1, 5,209, 0, 1, 1, 1, 0, 79, 1, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 79,196, 8, 24, 84,196, 8, 56,189,193, 8,112,188,195, 8, -200, 46,196, 8,144,165,193, 8, 68, 65, 84, 65,164, 0, 0, 0,200, 46,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 47,196, 8, - 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,152, 47,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 48,196, 8,200, 46,196, 8, 76, 97,109,112, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -104, 48,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 49,196, 8,152, 47,196, 8, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 49,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 8, 50,196, 8,104, 48,196, 8, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8, 50,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 50,196, 8, - 56, 49,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 49,196, 8, - 68, 65, 84, 65,164, 0, 0, 0,216, 50,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 51,196, 8, 8, 50,196, 8, 80,114,101,118, -105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101, -114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -168, 51,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 52,196, 8,216, 50,196, 8, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120, 52,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 72, 53,196, 8,168, 51,196, 8, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 53,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24, 54,196, 8, -120, 52,196, 8, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 24, 54,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232, 54,196, 8, 72, 53,196, 8, 77,105,115,116, - 32, 83,116, 97,114,115, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -232, 54,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 55,196, 8, 24, 54,196, 8, 84,101,120,116,117,114,101, 32, 97,110,100, 32, - 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184, 55,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,136, 56,196, 8,232, 54,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,232, 54,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 56,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 57,196, 8, -184, 55,196, 8, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 88, 57,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40, 58,196, 8,136, 56,196, 8, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, - 40, 58,196, 8,112, 0, 0, 0, 1, 0, 0, 0,248, 58,196, 8, 88, 57,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,248, 58,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,200, 59,196, 8, 40, 58,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200, 59,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 60,196, 8, -248, 58,196, 8, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,152, 60,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 61,196, 8,200, 59,196, 8, 77,101,115,104, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116, -105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -104, 61,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 62,196, 8,152, 60,196, 8, 77,101,115,104, 32, 84,111,111,108,115, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 62,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 8, 63,196, 8,104, 61,196, 8, 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8, 63,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 63,196, 8, - 56, 62,196, 8, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,216, 63,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 64,196, 8, 8, 63,196, 8, 83,104, 97,100, -101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101, -114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 76,196, 8, 68, 65, 84, 65,164, 0, 0, 0, -168, 64,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 65,196, 8,216, 63,196, 8, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120, 65,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 72, 66,196, 8,168, 64,196, 8, 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 72, 66,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24, 67,196, 8, -120, 65,196, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 24, 67,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232, 67,196, 8, 72, 66,196, 8, 67,111,110,115, -116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, - 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -232, 67,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184, 68,196, 8, 24, 67,196, 8, 83, 99,114,105,112,116,108,105,110,107,115, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184, 68,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,136, 69,196, 8,232, 67,196, 8, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24, 67,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 69,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 70,196, 8, -184, 68,196, 8, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 64,196, 8, - 68, 65, 84, 65,164, 0, 0, 0, 88, 70,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40, 71,196, 8,136, 69,196, 8, 77, 97,112, 32, - 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101, -114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 64,196, 8, 68, 65, 84, 65,164, 0, 0, 0, - 40, 71,196, 8,112, 0, 0, 0, 1, 0, 0, 0,248, 71,196, 8, 88, 70,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,248, 71,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,200, 72,196, 8, 40, 71,196, 8, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,200, 72,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152, 73,196, 8, -248, 71,196, 8, 76,105,115,116,101,110,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 83,111,117,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,152, 73,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104, 74,196, 8,200, 72,196, 8, 83,101,113,117, -101,110, 99,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,111,117,110, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -104, 74,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 56, 75,196, 8,152, 73,196, 8, 65,114,109, 97,116,117,114,101, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56, 75,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 8, 76,196, 8,104, 74,196, 8, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,168, 51,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 8, 76,196, 8,112, 0, 0, 0, 1, 0, 0, 0,216, 76,196, 8, - 56, 75,196, 8, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,216, 76,196, 8,112, 0, 0, 0, 1, 0, 0, 0,168, 77,196, 8, 8, 76,196, 8, 77,105,115,116, - 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108, -100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -168, 77,196, 8,112, 0, 0, 0, 1, 0, 0, 0,120, 78,196, 8,216, 76,196, 8, 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 76,196, 8, 68, 65, 84, 65,164, 0, 0, 0,120, 78,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 8,158,193, 8,168, 77,196, 8, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 8,158,193, 8,112, 0, 0, 0, 1, 0, 0, 0,144,165,193, 8, -120, 78,196, 8, 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,144,165,193, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8,158,193, 8, 83,104, 97,112, -101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116, -105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, - 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 8,158,193, 8, 68, 65, 84, 65,212, 0, 0, 0, - 72, 79,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 72, 80,196, 8, 0, 0, 0, 0, 4, 0, 0, 0, 51, 51, 51, 63,208, 45,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0,192,202, 68, - 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193, 40,224,182, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, - 0, 0, 1, 0, 1, 0, 1, 0, 1, 5,209, 0, 0, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0, 24, 22,197, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,141, 0, 0, 0, 0, 0,109, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,180, 2, 0, 0, 72, 80,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 40, 83,196, 8, 72, 79,196, 8, 1, 0, 0, 0, - 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,196, 0, 0, 0, 40, 83,196, 8, 97, 0, 0, 0, 1, 0, 0, 0, 24, 84,196, 8, - 72, 80,196, 8, 3, 0, 0, 0, 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,192,192, 0, 0,160, 64, 0, 0, 0, 0,205,204,140, 65,201, 82, 5,194,124,171, 30, 66, 49,238,226, 64,140,108,168, 65, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0,245, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67, - 10,215, 35, 60, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 84, 1, 0, 0, 24, 84,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40, 83,196, 8, 5, 0, 0, 0, - 51, 51, 51, 63,208, 45,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,152, 85,196, 8,113, 0, 0, 0, 1, 0, 0, 0,144, 86,196, 8, -208, 45,196, 8,128, 42,196, 8, 64, 41,196, 8,128, 41,196, 8,192, 42,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, -225, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,225, 3, 0, 0,251, 3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, -252, 3, 0, 0, 0, 4, 0, 0, 7, 0, 6, 0, 1, 0, 7, 7, 1, 5, 5, 0, 1, 1, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 27,194, 8,176,231,195, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,144, 86,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -152, 85,196, 8, 0, 42,196, 8,128, 42,196, 8,192, 42,196, 8, 64, 42,196, 8, 0, 0, 0, 0,184,119,162, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -111, 18,131,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, 0, 5, 0, 0, -237, 0, 0, 0,223, 3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0,237, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, - 8, 1, 0, 0,223, 3, 0, 0, 9, 0, 8, 0, 1, 0, 1, 1, 1, 5,216, 2, 1, 0, 1, 0, 5, 3, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 89,196, 8, 64, 98,196, 8,104,176,195, 8,104,176,195, 8, -136, 87,196, 8, 88, 88,196, 8, 68, 65, 84, 65,164, 0, 0, 0,136, 87,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88, 88,196, 8, - 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 44, 0, 21, 2, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 88, 88,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136, 87,196, 8, 86,105,101,119, - 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, - 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 1, 8, 0, - 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, - 40, 89,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 8, 92,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,123,176, 73, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 62,229, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,121,195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,184,119,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,183,240, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18,131,187, 0, 0, 0, 0, - 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -123,176, 73, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 3, 0,251,255, 8, 8, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63,189, 57,161, 60,205,204,204, 61, 0, 0,250, 67, - 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128,193, 55,143, 63, 0,174,255,192, 88, 23,141,191, 60, 0, 1, 0, 7, 0,175, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 3, 0,255,255,170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,170,239,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 1, 0, 0, 8, 92,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, 96, 93,196, 8, 40, 89,196, 8, 2, 0, 0, 0, - 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 16, 0, 0, 0,168, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, - 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65, -196, 0, 0, 0, 96, 93,196, 8, 97, 0, 0, 0, 1, 0, 0, 0, 96, 96,196, 8, 8, 92,196, 8, 3, 0, 0, 0, 51, 51, 51, 63, -144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,246, 24,167, 65,102,102,174,193, -122, 20,238, 65, 75, 95,116,194, 75, 95,116, 66, 51, 51, 9,194, 51, 51, 9, 66, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, - 50, 2, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67, 10,215, 35, 60, 0, 0, 0, 64, 0, 0, 0, 0, - 1, 0, 0, 0,233, 3, 50, 2, 0, 0, 0, 0, 80, 94,196, 8, 8, 96,196, 8, 0, 0,143, 3, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 80, 94,196, 8, -129, 0, 0, 0, 1, 0, 0, 0,168, 94,196, 8, 0, 0, 0, 0, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 61, 10,192, - 0, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,168, 94,196, 8, -129, 0, 0, 0, 1, 0, 0, 0, 0, 95,196, 8, 80, 94,196, 8, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0,192, 64,205,204,124, 65, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 0, 95,196, 8, -129, 0, 0, 0, 1, 0, 0, 0, 88, 95,196, 8,168, 94,196, 8, 65, 77, 5, 0, 0, 0, 0, 0,235, 49,126, 65, 98, 62,200, 65, - 0, 0, 0, 0, 0, 0, 0, 0,184, 18,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 88, 95,196, 8, -129, 0, 0, 0, 1, 0, 0, 0,176, 95,196, 8, 0, 95,196, 8, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 65, - 0, 0, 0, 0, 0, 0, 0, 0,152, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,176, 95,196, 8, -129, 0, 0, 0, 1, 0, 0, 0, 8, 96,196, 8, 88, 95,196, 8, 66, 79, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65, - 0, 0, 0, 0, 0, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 8, 96,196, 8, -129, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176, 95,196, 8, 67, 83, 0, 0, 0, 0, 0, 0, 0, 0,192, 64,102,102,174,193, - 0, 0, 0, 0, 0, 0, 0, 0,136,251,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 0, 0, 0, 96, 96,196, 8, -177, 0, 0, 0, 1, 0, 0, 0, 64, 97,196, 8, 96, 93,196, 8, 12, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, - 0, 0,130, 66, 0, 0, 0, 0, 0,128, 8, 68,217, 3, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 50, 2, 0, 0,128, 0, 0, 0, -217, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,217, 3, 0, 0, 16, 0, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, - 64, 97,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 64, 98,196, 8, 96, 96,196, 8, 4, 0, 0, 0, 51, 51, 51, 63,144, 86,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, - 0, 0,160,193, 0, 0,100, 67,246, 56,165, 67, 26, 29,110, 68, 13,102,183,193,246, 25,161, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, - 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 84, 1, 0, 0, 64, 98,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 97,196, 8, 5, 0, 0, 0, - 51, 51, 51, 63,144, 86,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, - 83, 97,118,101, 32, 70,105,108,101, 0, 78, 84, 0, 32, 80, 73, 67, 84, 85, 82, 69, 83, 0, 0, 47, 85,115,101,114,115, 47,116, -111,110, 47, 68,101,115,107,116,111,112, 47, 0,117,109,112, 98,117,103, 32, 70,111,108,100,101,114, 47, 0,101,110,100,101,114, - 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, - 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 11, 0, 1, 0, 0, 0,251, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0,192, 99,196, 8,109, 0, 0, 0, 1, 0, 0, 0,232,163,196, 8, - 96, 40,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 51, 45, 77, 97,116,101,114,105, 97,108, 0,111,100,101,108, 32, 83,105, -110,103, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,100,196, 8,160,103,196, 8,224,103,196, 8, 16,110,196, 8, 88,110,196, 8, - 56,156,196, 8,136,251,196, 8, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,100,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,160,100,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -160,100,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,100,196, 8, 96,100,196, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,224,100,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,101,196, 8,160,100,196, 8, 0, 0, 0, 0, -232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,101,196, 8, -224,100,196, 8, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,101,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,160,101,196, 8, 32,101,196, 8, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -160,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,101,196, 8, 96,101,196, 8, 0, 0, 0, 0,232, 3, 60, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,224,101,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,102,196, 8,160,101,196, 8, 0, 0, 0, 0, - 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,102,196, 8, -224,101,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,102,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,160,102,196, 8, 32,102,196, 8, 0, 0, 0, 0, 44, 3, 60, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -160,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0,224,102,196, 8, 96,102,196, 8, 0, 0, 0, 0, 44, 3, 6, 3, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,224,102,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 32,103,196, 8,160,102,196, 8, 0, 0, 0, 0, - 0, 0,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32,103,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 96,103,196, 8, -224,102,196, 8, 0, 0, 0, 0, 44, 3,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 96,103,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,160,103,196, 8, 32,103,196, 8, 0, 0, 0, 0,164, 1,176, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -160,103,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,103,196, 8, 0, 0, 0, 0,164, 1, 6, 3, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,224,103,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 40,104,196, 8, 0, 0, 0, 0,160,100,196, 8, -224,100,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 40,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -112,104,196, 8,224,103,196, 8, 96,100,196, 8, 32,101,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -112,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0,184,104,196, 8, 40,104,196, 8, 96,100,196, 8, 96,101,196, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,104,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0,105,196, 8,112,104,196, 8, - 32,101,196, 8,160,101,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 0,105,196, 8,111, 0, 0, 0, - 1, 0, 0, 0, 72,105,196, 8,184,104,196, 8, 96,101,196, 8,160,101,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0, 72,105,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144,105,196, 8, 0,105,196, 8,160,100,196, 8,224,101,196, 8, - 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,105,196, 8,111, 0, 0, 0, 1, 0, 0, 0,216,105,196, 8, - 72,105,196, 8,224,100,196, 8, 32,102,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,216,105,196, 8, -111, 0, 0, 0, 1, 0, 0, 0, 32,106,196, 8,144,105,196, 8,224,101,196, 8, 32,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 32,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0,104,106,196, 8,216,105,196, 8,160,101,196, 8, - 32,102,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,104,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -176,106,196, 8, 32,106,196, 8, 96,101,196, 8, 96,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -176,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248,106,196, 8,104,106,196, 8,160,101,196, 8, 96,102,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,106,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 64,107,196, 8,176,106,196, 8, - 32,102,196, 8,160,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 64,107,196, 8,111, 0, 0, 0, - 1, 0, 0, 0,136,107,196, 8,248,106,196, 8, 96,102,196, 8,160,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,136,107,196, 8,111, 0, 0, 0, 1, 0, 0, 0,208,107,196, 8, 64,107,196, 8, 96,101,196, 8,224,102,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,107,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 24,108,196, 8, -136,107,196, 8,224,101,196, 8,224,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 24,108,196, 8, -111, 0, 0, 0, 1, 0, 0, 0, 96,108,196, 8,208,107,196, 8,160,102,196, 8, 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 96,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0,168,108,196, 8, 24,108,196, 8, 96,102,196, 8, - 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,168,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -240,108,196, 8, 96,108,196, 8,224,102,196, 8, 32,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -240,108,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 56,109,196, 8,168,108,196, 8,224,102,196, 8, 96,103,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 56,109,196, 8,111, 0, 0, 0, 1, 0, 0, 0,128,109,196, 8,240,108,196, 8, - 32,103,196, 8, 96,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,128,109,196, 8,111, 0, 0, 0, - 1, 0, 0, 0,200,109,196, 8, 56,109,196, 8,224,101,196, 8,160,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,200,109,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 16,110,196, 8,128,109,196, 8,160,102,196, 8,160,103,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 16,110,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -200,109,196, 8, 96,103,196, 8,160,103,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, 88,110,196, 8, -113, 0, 0, 0, 1, 0, 0, 0,112,122,196, 8, 0, 0, 0, 0, 96,100,196, 8, 96,101,196, 8,160,101,196, 8, 32,101,196, 8, - 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,226,215,163,188, - 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 27, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 33, 0, - 1, 1, 1, 0,192, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,114,196, 8, -240,120,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 80,111,196, 8,192,113,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80,111,196, 8, -112, 0, 0, 0, 1, 0, 0, 0, 32,112,196, 8, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 32,112,196, 8,112, 0, 0, 0, 1, 0, 0, 0, -240,112,196, 8, 80,111,196, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,240,112,196, 8,112, 0, 0, 0, 1, 0, 0, 0,192,113,196, 8, 32,112,196, 8, - 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -164, 0, 0, 0,192,113,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240,112,196, 8, 70,111,114,109, 97,116, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0,144,114,196, 8, -102, 0, 0, 0, 1, 0, 0, 0, 80,115,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0,128,192, - 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -233, 3, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0,128, 63, 0, 0, 16, 65, 0, 0,250, 70, 0, 0, 16, 65,205,204,204, 61, - 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65, -160, 0, 0, 0, 80,115,196, 8,166, 0, 0, 0, 1, 0, 0, 0, 32,116,196, 8,144,114,196, 8, 11, 0, 0, 0, 51, 51, 51, 63, - 1, 86,239, 92, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, - 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, 9, 0, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, - 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 32,116,196, 8, 94, 0, 0, 0, - 1, 0, 0, 0, 32,117,196, 8, 80,115,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67, - 63, 0, 0,193,172, 3,182, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, -251, 4,209, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,109, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, - 32,117,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 0,120,196, 8, 32,116,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,183, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, - 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 99, 15, 51, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29,254,249,195,125,254, 71,194, - 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 1, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,196, 0, 0, 0, 0,120,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,240,120,196, 8, 32,117,196, 8, 3, 0, 0, 0, - 51, 51, 51, 63, 1, 86,239, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,192, 0, 0,160, 64, - 0, 0, 0, 0,205,204,140, 65,201, 82, 5,194,124,171, 30, 66, 49,238,226, 64,140,108,168, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0, - 0, 0, 0, 0,245, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,160, 67, 0, 0,160, 67, 10,215, 35, 60, 0, 0, 0, 64, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, -240,120,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,120,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,239, 92, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,204, 0, 0, 0,112,122,196, 8,113, 0, 0, 0, 1, 0, 0, 0,104,123,196, 8, 88,110,196, 8,224,101,196, 8, -160,100,196, 8,224,100,196, 8, 32,102,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, - 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, - 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 1, 1, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,204, 0, 0, 0,104,123,196, 8,113, 0, 0, 0, 1, 0, 0, 0,216,140,196, 8,112,122,196, 8, 96,102,196, 8, -160,102,196, 8, 32,102,196, 8,160,101,196, 8, 0, 0, 0, 0,255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,255,255,139, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, - 0, 0, 0,128, 0, 0, 0,128, 74,215, 76,190, 0, 0, 0,128, 45, 3, 0, 0,232, 3, 0, 0, 61, 0, 0, 0, 5, 3, 0, 0, - 45, 3, 0, 0,232, 3, 0, 0, 61, 0, 0, 0, 87, 0, 0, 0, 45, 3, 0, 0,232, 3, 0, 0, 88, 0, 0, 0, 5, 3, 0, 0, - 0, 0, 0, 0, 1, 0, 4, 4,188, 0,174, 2, 1, 1, 1, 0,179, 1,126, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32,134,196, 8, 88,139,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 96,124,196, 8, 80,133,196, 8, - 68, 65, 84, 65,164, 0, 0, 0, 96,124,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 48,125,196, 8, 0, 0, 0, 0, 79,117,116,112, -117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, - 48,125,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0,126,196, 8, 96,124,196, 8, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 0,126,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,208,126,196, 8, 48,125,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,208,126,196, 8,112, 0, 0, 0, 1, 0, 0, 0,160,127,196, 8, - 0,126,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,160,127,196, 8,112, 0, 0, 0, 1, 0, 0, 0,112,128,196, 8,208,126,196, 8, 80,114,101,118, -105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101, -114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -112,128,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 64,129,196, 8,160,127,196, 8, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 64,129,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 16,130,196, 8,112,128,196, 8, 83,104, 97,100,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 16,130,196, 8,112, 0, 0, 0, 1, 0, 0, 0,224,130,196, 8, - 64,129,196, 8, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 68,252, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,224,130,196, 8,112, 0, 0, 0, 1, 0, 0, 0,176,131,196, 8, 16,130,196, 8, 77, 97,112, 32, - 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101, -114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,251, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -176,131,196, 8,112, 0, 0, 0, 1, 0, 0, 0,128,132,196, 8,224,130,196, 8, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, 4, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,128,132,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 80,133,196, 8,176,131,196, 8, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112,128,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 80,133,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -128,132,196, 8, 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,212, 0, 0, 0, 32,134,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 32,135,196, 8, 0, 0, 0, 0, 4, 0, 0, 0, - 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0,193, 0, 0,163, 67, 0,128,148,196, 0, 0,104, 67, 0, 0, 0,193, 0, 0,163, 67,170,175,118,196,255,255,103, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, - 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,188, 0,174, 2, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,141, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 32,135,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 0,138,196, 8, - 32,134,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,200, 80, 98,190, 0, 0, 0, 0, -239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,122,166,182,193, 0, 0,128, 63, -186, 74,140, 62, 35,120,117, 63,254,220,151, 61, 0, 0, 0, 0,160,194, 72,191,131,105, 54, 62, 30, 40, 24, 63, 0, 0, 0, 0, - 32,132, 14, 63,190, 80, 98,190, 94,255, 76, 63, 0, 0, 0, 0, 92,160, 70, 65,162, 28,188,192,224, 17,146, 65, 0, 0,128, 63, -197, 52, 91, 63,228,148, 91,191,186,146, 14,191, 33,132, 14,191,223,197, 63, 64,106,131, 71, 62,246,103, 98, 62,200, 80, 98, 62, - 52, 73,109, 62,225,107, 38, 63, 93, 20, 77,191, 94,255, 76,191,240, 60, 48, 64,130, 29,156,189,128, 31,181, 65,122,166,182, 65, -252,146,179, 61,173, 25,157, 62, 75, 99,194, 60, 0, 0,165, 50,214,141, 55,191,192,199, 38, 62,176, 28, 11, 63, 0,128, 24,181, -167, 58,120,194,184, 22,235, 65, 49,140,182,194, 27,247,159,192, 5, 26,118, 66, 44,106,233,193,230, 4,181, 66,126, 7,160, 64, -255,255, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,139, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 13,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 74,215, 76,190, 0, 0, 0,128, -188, 74,140, 62,166,194, 72,191, 33,132, 14, 63, 0, 0, 0, 0, 41,120,117, 63,135,105, 54, 62,200, 80, 98,190, 0, 0, 0, 0, -239,220,151, 61, 31, 40, 24, 63, 94,255, 76, 63, 0, 0, 0, 0,175,149, 97, 63,230,187,142,189,122,166,182,193, 0, 0,128, 63, -218, 31, 64, 63, 36, 17,139,190,182,154, 36,190,156,165, 20,191,221, 79,187, 65, 1, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 0,138,196, 8, 93, 0, 0, 0, - 1, 0, 0, 0, 88,139,196, 8, 32,135,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, - 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 88,139,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0,138,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 86,249,156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47,117,115,114, 47,104,111,109,101, 47,105,110,116,114,114, 47, 98,108,101,110,100,101,114, 47, 98,108,101,110, -100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 24, 0, 1, 0, 0, 0,203, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,216,140,196, 8, -113, 0, 0, 0, 1, 0, 0, 0,136,148,196, 8,104,123,196, 8, 96,101,196, 8,224,102,196, 8, 32,103,196, 8, 96,102,196, 8, - 0, 0, 0, 0, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,237,119,206, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 43, 3, 0, 0, 61, 0, 0, 0, - 87, 0, 0, 0, 0, 0, 0, 0, 43, 3, 0, 0, 88, 0, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 44, 3, 88, 1, - 1, 0, 1, 0,251, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,141,196, 8, - 8,147,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,208,141,196, 8, - 89, 0, 0, 0, 1, 0, 0, 0,176,144,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63, -106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30,191, -106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0,202, 25,217, 60, -235, 76,145, 61, 70,151,128,186, 0, 0,128, 63,172, 79,187, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1,181, 30, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,255,255,249,195, 0, 0, 0, 0,103,217, 30,191, -106, 40, 52,191,116, 39,251,190, 0, 0,128, 63, 85,240, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -237,119,206, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,104,217, 30, 63, -106, 40, 52, 63,116, 39,251, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,172, 79,187, 65, - 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, - 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63, -106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 1, 0, 7, 0,175, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,104,138, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,104,138, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -212, 0, 0, 0,176,144,196, 8, 94, 0, 0, 0, 1, 0, 0, 0,176,145,196, 8,208,141,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, - 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63, -225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,176,145,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, 8,147,196, 8,176,144,196, 8, - 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, - 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, - 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 84, 1, 0, 0, 8,147,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176,145,196, 8, 5, 0, 0, 0, - 51, 51, 51, 63, 1, 87, 7,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116, -111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, - 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,136,148,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 56,156,196, 8, -216,140,196, 8, 96,103,196, 8,160,103,196, 8,160,102,196, 8, 32,103,196, 8, 0, 0, 0, 0,173,101,182, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -154, 65,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128,165, 1, 0, 0, 43, 3, 0, 0, -177, 1, 0, 0, 5, 3, 0, 0,165, 1, 0, 0, 43, 3, 0, 0,177, 1, 0, 0,177, 1, 0, 0,165, 1, 0, 0, 43, 3, 0, 0, -177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,135, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,149,196, 8,184,154,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0,128,149,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 96,152,196, 8, - 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0, -191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63, -223,149, 47, 63, 55, 70, 58, 63,192, 56, 49,188, 0, 0, 0, 0, 87,126,162,190,228,251,159, 62, 56, 53,101, 63, 0, 0, 0, 0, - 7,165, 39, 63,150, 84, 28,191, 50,247,227, 62, 0, 0, 0, 0,110,101,239, 64,151, 62,208,192, 77,255,170, 64, 0, 0,128, 63, -144, 52,122, 63, 39,192, 4,191,244,250, 39,191, 8,165, 39,191,228,183,132, 63, 75,179, 2, 63,180,164, 28, 63,149, 84, 28, 63, -118,137,124,188,232, 64,187, 63, 8,108,228,190, 50,247,227,190, 18,188,246,190,141,144, 29,191,216, 49, 49, 65,152, 9, 52, 65, -116,112,246, 62,142,184, 2, 63, 64,191,248,187, 0, 0,144,179, 64,230, 70,190,226,211, 67, 62,254, 71, 12, 63, 0, 0, 0, 52, -211,120, 21,194,144, 5, 2, 66, 7,136,213,193,193,214,159,192,219, 38, 19, 66,196,173,255,193,155,101,210, 65,173, 40,160, 64, -173,101,182, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 36,209, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,154, 65,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128, 72, 1, 77,190, 0, 0, 0,128, -221,149, 47, 63, 85,126,162,190, 8,165, 39, 63, 0, 0, 0, 0, 51, 70, 58, 63,225,251,159, 62,149, 84, 28,191, 0, 0, 0, 0, -191, 56, 49,188, 54, 53,101, 63, 50,247,227, 62, 0, 0, 0, 0, 90, 38,173,190,254,221,192,190,152, 9, 52,193, 0, 0,128, 63, -241, 22, 72, 63, 78,162,246,190, 44, 8, 90,190, 3, 35,171,190,221, 79,187, 65, 2, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, 0, 0,250, 67,104,217, 30, 63,106, 40, 52, 63,116, 39,251, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,221,224, 65, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,221,224, 65, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 96,152,196, 8, 94, 0, 0, 0, - 1, 0, 0, 0, 96,153,196, 8,128,149,196, 8, 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67, -172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, - 96,153,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,184,154,196, 8, 96,152,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, - 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,184,154,196, 8, - 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,153,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 12,124, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, -100,101,114, 47, 98,108,101,110,100, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, - 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -204, 0, 0, 0, 56,156,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,148,196, 8,224,102,196, 8,224,101,196, 8, -160,103,196, 8, 96,103,196, 8, 0, 0, 0, 0,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 43,186, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, -163, 1, 0, 0,177, 1, 0, 0,177, 1, 0, 0, 0, 0, 0, 0,163, 1, 0, 0,177, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1,164, 1, 85, 1, 3, 0, 1, 0, 83, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 48,157,196, 8,104,162,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -180, 2, 0, 0, 48,157,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 16,160,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, - 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128, - 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51, - 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,107, 40, 52,191, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 1, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,128,191,176, 2, 19, 51, - 0, 0, 0, 0, 59,248, 30, 64,107, 40, 52,191, 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80,209, 85, 49,110, 18, 3, 59, 0, 0, 0, 0, 0, 0, 0, 0, 6, 43,186, 61,234,137,150,174, - 0, 0, 0, 0,195,184, 59,190,143, 90,179,190, 79,123,184, 58, 0, 0,128, 63, 74,202, 88, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 53, 0, 0,128, 52, 85, 3, 48, 65, 0, 0, 0, 0, 0, 0,128,171, 1, 0,250, 67,160,144,143,183, - 0, 0, 0, 0, 59,248, 30, 64,106, 40, 52,191, 48,161,118, 64, 0, 0,128, 63,152, 38,151, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 43,186, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, - 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0,128, - 0, 0, 0, 0, 0, 0, 0,128,174, 2, 19, 51,255,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,255,127, 63,174, 2, 19, 51, - 0, 0, 0, 0, 58,248, 30,192, 45,161,118,192,107, 40, 52,191, 0, 0,128, 63,243, 4, 53, 63,243, 4, 53,191, 0, 0, 0, 0, - 0, 0, 0, 0, 73,202, 88, 65, 0, 0, 1, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 3, 0, 10, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, - 0, 0,250, 67, 58,248, 30,192,106, 40, 52, 63, 46,161,118,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 2, 0, - 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,162,217,154, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 16,160,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 16,161,196, 8, 48,157,196, 8, - 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0,224,159, 68, 0, 0, 0, 0, 0, 0,100, 67,172, 62, 57, 67, 44,184,136, 68,169,101, 28,195, - 16,147,173, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, - 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0, 16,161,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, -104,162,196, 8, 16,160,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, - 0, 0,122, 67, 0, 0, 32,193, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, - 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,104,162,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 16,161,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 17, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 0, 0, 0, 83, 65, 86, 69, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,100,101,114, 47, 98,108,101,110,100, 47, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -117,110,116,105,116,108,101,100, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0,203, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 0, 0,116, 0, 0, 0,232,163,196, 8,109, 0, 0, 0, - 1, 0, 0, 0,136,207,196, 8,192, 99,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 83, 82, 52, 45, 83,101,113,117,101,110, 99,101, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,164,196, 8,200,167,196, 8, 8,168,196, 8, -168,173,196, 8,240,173,196, 8, 96,201,196, 8,136,251,196, 8, 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 4, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -136,164,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,164,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,200,164,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,165,196, 8,136,164,196, 8, 0, 0, 0, 0, - 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,165,196, 8, -200,164,196, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,165,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,136,165,196, 8, 8,165,196, 8, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -136,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,165,196, 8, 72,165,196, 8, 0, 0, 0, 0, 0, 0,200, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,200,165,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,166,196, 8,136,165,196, 8, 0, 0, 0, 0, -232, 3,200, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,166,196, 8, -200,165,196, 8, 0, 0, 0, 0, 0, 0, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,166,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,136,166,196, 8, 8,166,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -136,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,166,196, 8, 72,166,196, 8, 0, 0, 0, 0, 0, 0,244, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,200,166,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 8,167,196, 8,136,166,196, 8, 0, 0, 0, 0, -232, 3,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 8,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 72,167,196, 8, -200,166,196, 8, 0, 0, 0, 0, 84, 2,244, 1, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 72,167,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,136,167,196, 8, 8,167,196, 8, 0, 0, 0, 0, 84, 2, 6, 3, 1, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -136,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0,200,167,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,200,167,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,136,167,196, 8, 0, 0, 0, 0, -232, 3, 4, 1, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,168,196, 8, - 0, 0, 0, 0,200,164,196, 8, 8,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,168,196, 8, -111, 0, 0, 0, 1, 0, 0, 0,152,168,196, 8, 8,168,196, 8,136,164,196, 8, 72,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,152,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0,224,168,196, 8, 80,168,196, 8,136,164,196, 8, -136,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,168,196, 8,111, 0, 0, 0, 1, 0, 0, 0, - 40,169,196, 8,152,168,196, 8, 72,165,196, 8,200,165,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, - 40,169,196, 8,111, 0, 0, 0, 1, 0, 0, 0,112,169,196, 8,224,168,196, 8,136,165,196, 8,200,165,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,112,169,196, 8,111, 0, 0, 0, 1, 0, 0, 0,184,169,196, 8, 40,169,196, 8, -200,164,196, 8, 8,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,184,169,196, 8,111, 0, 0, 0, - 1, 0, 0, 0, 0,170,196, 8,112,169,196, 8, 8,165,196, 8, 72,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0, 0,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 72,170,196, 8,184,169,196, 8, 8,166,196, 8, 72,166,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 72,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0,144,170,196, 8, - 0,170,196, 8, 8,166,196, 8,136,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,144,170,196, 8, -111, 0, 0, 0, 1, 0, 0, 0,216,170,196, 8, 72,170,196, 8, 72,166,196, 8,200,166,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,216,170,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 32,171,196, 8,144,170,196, 8,136,166,196, 8, -200,166,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 32,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -104,171,196, 8,216,170,196, 8,136,166,196, 8, 8,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -104,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0,176,171,196, 8, 32,171,196, 8,200,166,196, 8, 8,167,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,176,171,196, 8,111, 0, 0, 0, 1, 0, 0, 0,248,171,196, 8,104,171,196, 8, - 8,166,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,248,171,196, 8,111, 0, 0, 0, - 1, 0, 0, 0, 64,172,196, 8,176,171,196, 8, 72,166,196, 8, 72,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0, 64,172,196, 8,111, 0, 0, 0, 1, 0, 0, 0,136,172,196, 8,248,171,196, 8, 8,167,196, 8, 72,167,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,136,172,196, 8,111, 0, 0, 0, 1, 0, 0, 0,208,172,196, 8, - 64,172,196, 8,136,165,196, 8,136,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,208,172,196, 8, -111, 0, 0, 0, 1, 0, 0, 0, 24,173,196, 8,136,172,196, 8,136,166,196, 8,136,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 24,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 96,173,196, 8,208,172,196, 8,200,166,196, 8, -200,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 96,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -168,173,196, 8, 24,173,196, 8,200,165,196, 8,200,167,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -168,173,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 96,173,196, 8,136,167,196, 8,200,167,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,240,173,196, 8,113, 0, 0, 0, 1, 0, 0, 0,168,180,196, 8, 0, 0, 0, 0, -136,164,196, 8,136,165,196, 8,200,165,196, 8, 72,165,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, -199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,173, 0, 0, 0,199, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, -172, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,233, 3,173, 0, 1, 0, 1, 1,139, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40,178,196, 8, 40,179,196, 8, 0, 0, 0, 0, 0, 0, 0, 0,232,174,196, 8, - 88,177,196, 8, 68, 65, 84, 65,164, 0, 0, 0,232,174,196, 8,112, 0, 0, 0, 1, 0, 0, 0,184,175,196, 8, 0, 0, 0, 0, - 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -164, 0, 0, 0,184,175,196, 8,112, 0, 0, 0, 1, 0, 0, 0,136,176,196, 8,232,174,196, 8, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,136,176,196, 8, -112, 0, 0, 0, 1, 0, 0, 0, 88,177,196, 8,184,175,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 88,177,196, 8,112, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0,136,176,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,212, 0, 0, 0, 40,178,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 40,179,196, 8, 0, 0, 0, 0, - 4, 0, 0, 0, 51, 51, 51, 63, 1, 87, 30,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0,193, 0, 0,163, 68, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193,118,149,172, 68, 0, 0, 0,193, - 0, 0,104, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, - 0, 0,225, 67, 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,173, 0, 0, 0, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 40,179,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 40,178,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 30,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,168,180,196, 8, -113, 0, 0, 0, 1, 0, 0, 0,160,181,196, 8,240,173,196, 8, 8,166,196, 8,200,164,196, 8, 8,165,196, 8, 72,166,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, - 33, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, - 1, 0, 1, 1,196, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,160,181,196, 8, -113, 0, 0, 0, 1, 0, 0, 0,136,188,196, 8,168,180,196, 8,136,165,196, 8,136,167,196, 8,200,167,196, 8,200,165,196, 8, - 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, - 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,201, 0, 0, 0, -227, 0, 0, 0, 0, 0, 0, 0,232, 3, 0, 0,228, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 1, 0, 15, 15,233, 3, 32, 0, - 1, 0, 1, 1,192, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,182,196, 8, - 8,187,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,148, 0, 0, 0,152,182,196, 8, -102, 0, 0, 0, 1, 0, 0, 0, 88,183,196, 8, 0, 0, 0, 0, 15, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188, 0, 0,128,192, - 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0,128,192, 0, 0,126, 67, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -233, 3, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 66, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, - 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 68, 65, 84, 65, -164, 0, 0, 0, 88,183,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 40,184,196, 8,152,182,196, 8, 8, 0, 0, 0, 51, 51, 51, 63, - 1, 87, 38,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, - 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 32, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0, - 32, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 40,184,196, 8, - 89, 0, 0, 0, 1, 0, 0, 0, 8,187,196, 8, 88,183,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 38,188, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -185,206,105, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 38,140, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, - 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, - 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 84, 1, 0, 0, 8,187,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40,184,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, - 1, 87, 38,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69, - 32, 84, 65, 82, 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46, 98,108,101,110,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,136,188,196, 8,113, 0, 0, 0, 1, 0, 0, 0,176,194,196, 8,160,181,196, 8, - 8,167,196, 8, 72,167,196, 8, 72,166,196, 8,200,166,196, 8, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, - 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0, - 5, 3, 0, 0, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0,245, 1, 0, 0, 85, 2, 0, 0,232, 3, 0, 0,245, 1, 0, 0, - 5, 3, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8,148, 1, 17, 1, 3, 0, 1, 1, 9, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,189,196, 8, 48,193,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,128,189,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 80,190,196, 8, 0, 0, 0, 0, - 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 49, 1, 0, 0, 17, 0, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0, -124, 2, 0, 0, 17, 0, 0, 0, 49, 1, 0, 0, 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, - 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, -180, 2, 0, 0, 80,190,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 48,193,196, 8,128,189,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, - 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,191, 72, 20, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 42,251,220, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, - 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 48,193,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 80,190,196, 8, - 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 42,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82, 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46, - 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,176,194,196, 8,113, 0, 0, 0, 1, 0, 0, 0, - 96,201,196, 8,136,188,196, 8,136,166,196, 8, 8,166,196, 8, 72,167,196, 8, 8,167,196, 8, 0, 0, 0, 0,228, 56,142, 61, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,220, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0, - 83, 2, 0, 0,245, 1, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0,245, 1, 0, 0, 15, 2, 0, 0, 0, 0, 0, 0, - 83, 2, 0, 0, 16, 2, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 84, 2,246, 0, 1, 0, 1, 0,203, 1, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168,195,196, 8,224,199,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 1, 0, 0,168,195,196, 8, 93, 0, 0, 0, 1, 0, 0, 0, - 0,197,196, 8, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66,205,204,204,189,205,204,140, 63, 0, 0,160,192, - 0, 0,210, 66,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,246, 0, 0, 0, 16, 0, 0, 0, - 19, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, 19, 2, 0, 0, 16, 0, 0, 0,246, 0, 0, 0, 10,215, 35, 60, - 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 83, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,192, 0, 0,210, 66, -205,204,204,189,205,204,140, 63, 68, 65, 84, 65,180, 2, 0, 0, 0,197,196, 8, 89, 0, 0, 0, 1, 0, 0, 0,224,199,196, 8, -168,195,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,220, 29, 62, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,179,146,207, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0,224,199,196, 8, 96, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0,197,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 46, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 79, 65, 68, 32, 70, 73, 76, 69, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, - 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0, - 96,201,196, 8,113, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,176,194,196, 8,136,167,196, 8,136,166,196, 8,200,166,196, 8, -200,167,196, 8, 0, 0, 0, 0,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128, - 0, 0, 0,128, 0, 0,128, 63, 0, 0, 0, 0,232, 3, 0, 0, 5, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, - 5, 1, 0, 0, 31, 1, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 32, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 0, 1, 0, 8, 8, -233, 3,212, 0, 1, 0, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88,202,196, 8, 8,206,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, - 88,202,196, 8, 95, 0, 0, 0, 1, 0, 0, 0, 40,203,196, 8, 0, 0, 0, 0, 8, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, - 0, 0, 0, 0, 0, 0,122, 67, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,212, 0, 0, 0, - 16, 0, 0, 0,233, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,233, 3, 0, 0, 16, 0, 0, 0,212, 0, 0, 0, - 0, 0, 32, 65, 0, 0,128, 64, 0, 0,250, 70, 0, 0, 0, 66,205,204,204, 61, 0, 0, 32, 65, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,180, 2, 0, 0, 40,203,196, 8, 89, 0, 0, 0, - 1, 0, 0, 0, 8,206,196, 8, 88,202,196, 8, 1, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63,228, 56,142, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,185,206,105, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63,102,102,102, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 38,140, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,102,102, 65, 0, 0, 7, 0, - 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, - 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, - 8,206,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40,203,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 87, 49,172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 65, 86, 69, 32, 84, 65, 82, - 71, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 49, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 2, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 82, 0, 0,116, 0, 0, 0,136,207,196, 8,109, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,232,163,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 83, 82, 53, 45, 83, 99,114,105,112,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 40,208,196, 8,104,210,196, 8,168,210,196, 8,152,214,196, 8,224,214,196, 8,176,236,196, 8,136,251,196, 8, - 0, 0,231, 3,143, 1,174, 4,232, 3, 32, 3, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,208,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,208,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,168,208,196, 8, 40,208,196, 8, 0, 0, 0, 0, 0, 0, 32, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -168,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0,232,208,196, 8,104,208,196, 8, 0, 0, 0, 0,232, 3, 32, 3, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,232,208,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 40,209,196, 8,168,208,196, 8, 0, 0, 0, 0, -232, 3, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,209,196, 8, -232,208,196, 8, 0, 0, 0, 0, 0, 0,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,209,196, 8,110, 0, 0, 0, - 1, 0, 0, 0,168,209,196, 8, 40,209,196, 8, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, -168,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0,232,209,196, 8,104,209,196, 8, 0, 0, 0, 0,232, 3, 6, 3, 0, 0, 0, 0, - 68, 65, 84, 65, 20, 0, 0, 0,232,209,196, 8,110, 0, 0, 0, 1, 0, 0, 0, 40,210,196, 8,168,209,196, 8, 0, 0, 0, 0, -156, 1,212, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 40,210,196, 8,110, 0, 0, 0, 1, 0, 0, 0,104,210,196, 8, -232,209,196, 8, 0, 0, 0, 0,156, 1, 6, 3, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,104,210,196, 8,110, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 40,210,196, 8, 0, 0, 0, 0,156, 1, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -168,210,196, 8,111, 0, 0, 0, 1, 0, 0, 0,240,210,196, 8, 0, 0, 0, 0,104,208,196, 8,168,208,196, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,240,210,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 56,211,196, 8,168,210,196, 8, -104,208,196, 8,104,209,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 56,211,196, 8,111, 0, 0, 0, - 1, 0, 0, 0,128,211,196, 8,240,210,196, 8,168,208,196, 8,168,209,196, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,128,211,196, 8,111, 0, 0, 0, 1, 0, 0, 0,200,211,196, 8, 56,211,196, 8,104,209,196, 8,168,209,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,200,211,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 16,212,196, 8, -128,211,196, 8, 40,209,196, 8,232,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 16,212,196, 8, -111, 0, 0, 0, 1, 0, 0, 0, 88,212,196, 8,200,211,196, 8,104,209,196, 8, 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0, 88,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0,160,212,196, 8, 16,212,196, 8,168,209,196, 8, - 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,160,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0, -232,212,196, 8, 88,212,196, 8,232,209,196, 8, 40,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -232,212,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 48,213,196, 8,160,212,196, 8, 40,209,196, 8,104,209,196, 8, 1, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 48,213,196, 8,111, 0, 0, 0, 1, 0, 0, 0,120,213,196, 8,232,212,196, 8, - 40,208,196, 8, 40,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,120,213,196, 8,111, 0, 0, 0, - 1, 0, 0, 0,192,213,196, 8, 48,213,196, 8, 40,208,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 24, 0, 0, 0,192,213,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 8,214,196, 8,120,213,196, 8,232,208,196, 8,104,210,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 8,214,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 80,214,196, 8, -192,213,196, 8,232,209,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 80,214,196, 8, -111, 0, 0, 0, 1, 0, 0, 0,152,214,196, 8, 8,214,196, 8, 40,210,196, 8,104,210,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,152,214,196, 8,111, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 80,214,196, 8,232,208,196, 8, -168,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,224,214,196, 8,113, 0, 0, 0, 1, 0, 0, 0, -216,215,196, 8, 0, 0, 0, 0,104,209,196, 8,104,208,196, 8,168,208,196, 8,168,209,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -232, 3, 0, 0, 7, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0,232, 3, 0, 0, 7, 3, 0, 0, 33, 3, 0, 0, 0, 0, 0, 0, -232, 3, 0, 0, 32, 3, 0, 0, 32, 3, 0, 0, 0, 0, 0, 0, 1, 0, 7, 7,233, 3, 1, 0, 3, 0, 3, 1,196, 2, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,216,215,196, 8,113, 0, 0, 0, 1, 0, 0, 0, -208,222,196, 8,224,214,196, 8, 40,209,196, 8,104,209,196, 8, 40,210,196, 8,232,209,196, 8, 0, 0, 0, 0,122,214,248, 61, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, - 0, 0, 0,128,111, 18, 3,187, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, -155, 1, 0, 0,213, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,213, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 0, -155, 1, 0, 0,240, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1,156, 1, 22, 2, 1, 0, 3, 0,251, 2, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,218,196, 8, 80,221,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0,208,216,196, 8,160,217,196, 8, 68, 65, 84, 65,164, 0, 0, 0,208,216,196, 8,112, 0, 0, 0, 1, 0, 0, 0, -160,217,196, 8, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,140, 0,210, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,160,217,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,208,216,196, 8, - 51, 68, 32, 86,105,101,119,112,111,114,116, 32,112,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 8, 0, 62, 1,204, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -180, 2, 0, 0,112,218,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 80,221,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, - 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 18, 3,187, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 38,175, 3, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,148,173, 42, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255,249,195, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,122,214,248, 61, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,186,252,191, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,128,111, 18, 3,187, - 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,148,173, 42, 65, 0, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 8, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,205,204,204, 61, - 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 1, 0, - 7, 0,175, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,197, 63, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 80,221,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,112,218,196, 8, - 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 46,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,208,222,196, 8,113, 0, 0, 0, 1, 0, 0, 0, -176,236,196, 8,216,215,196, 8,104,210,196, 8, 40,210,196, 8,168,209,196, 8,232,208,196, 8, 0, 0, 0, 0, 1,184,157, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,225,215,163,188, 0, 0, 0, 0,157, 1, 0, 0, -232, 3, 0, 0, 0, 0, 0, 0, 5, 3, 0, 0,157, 1, 0, 0,232, 3, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0,157, 1, 0, 0, -232, 3, 0, 0, 27, 0, 0, 0, 5, 3, 0, 0, 0, 0, 0, 0, 1, 0, 9, 9, 76, 2,235, 2, 3, 0, 3, 0,165, 2, 0, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,152,224,196, 8, 48,235,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0,200,223,196, 8,200,223,196, 8, 68, 65, 84, 65,164, 0, 0, 0,200,223,196, 8,112, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0,152,224,196, 8,100, 0, 0, 0, 1, 0, 0, 0, 64,225,196, 8, 0, 0, 0, 0, - 9, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 3,197, 8, - 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,225, 2, 0, 0,227, 2, 0, 0, - 5, 0, 0, 0, 17, 0, 0, 0,207, 2, 0, 0,227, 2, 0, 0, 68, 65, 84, 65,184, 0, 0, 0, 64,225,196, 8, 98, 0, 0, 0, - 1, 0, 0, 0, 40,226,196, 8,152,224,196, 8, 6, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, 0, 0,120,190, 0, 0,159, 63, - 0, 0,242,190, 0,128,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 40, 1, 0, 0, 40,226,196, 8, 93, 0, 0, 0, 1, 0, 0, 0,128,227,196, 8, 64,225,196, 8, 2, 0, 0, 0, 51, 51, 51, 63, - 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0, 0, 0, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, 16, 0, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0, - 59, 1, 0, 0, 16, 0, 0, 0,242, 1, 0, 0, 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, - 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65,196, 0, 0, 0, -128,227,196, 8, 97, 0, 0, 0, 1, 0, 0, 0,208,229,196, 8, 40,226,196, 8, 3, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, - 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0, -108, 1,124, 1, 0, 0, 0, 0,112,228,196, 8,120,229,196, 8, 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,112,228,196, 8,129, 0, 0, 0, - 1, 0, 0, 0,200,228,196, 8, 0, 0, 0, 0, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 65, 0, 0, 0, 0, - 0, 0, 0, 0,152, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,200,228,196, 8,129, 0, 0, 0, - 1, 0, 0, 0, 32,229,196, 8,112,228,196, 8, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164,112, 61, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0, 32,229,196, 8,129, 0, 0, 0, - 1, 0, 0, 0,120,229,196, 8,200,228,196, 8, 66, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,113, 61, 10,192, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 44, 0, 0, 0,120,229,196, 8,129, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 32,229,196, 8, 69, 77, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,174,143, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,208,229,196, 8,166, 0, 0, 0, - 1, 0, 0, 0,160,230,196, 8,128,227,196, 8, 11, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0,128,192, 0, 0,122, 67, - 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, - 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,160,230,196, 8, 99, 0, 0, 0, 1, 0, 0, 0,112,231,196, 8,208,229,196, 8, - 13, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0, - 0, 0,182, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68, - 0, 0,122, 68,205,204,204, 61, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -176, 0, 0, 0,112,231,196, 8,177, 0, 0, 0, 1, 0, 0, 0, 80,232,196, 8,160,230,196, 8, 12, 0, 0, 0, 51, 51, 51, 63, - 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193, - 0, 0,247, 67, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,128,193, 0, 0,247, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, - 14, 2, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0, - 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,180, 2, 0, 0, 80,232,196, 8, 89, 0, 0, 0, 1, 0, 0, 0, 48,235,196, 8,112,231,196, 8, 1, 0, 0, 0, - 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,193, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63, 1,184,157, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1,128,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0,184,175, 31, 65, 0, 0, 32, 65, 33,195, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,161, 14,106, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29,254,249,195,125,254, 71,194, 0, 0, 0, 0, 0, 0, 0, 0,173,128,249, 67,138, 0, 72, 66, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 1, 0, 7, 0, 40, 9,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 24, 0, 0, 12, 66, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 48,235,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 80,232,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 47,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 0, 0, 0,176,236,196, 8,113, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0,208,222,196, 8, 40,208,196, 8, 40,209,196, 8,232,209,196, 8,104,210,196, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 0,155, 1, 0, 0,185, 0, 0, 0,211, 0, 0, 0, - 0, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4,156, 1,185, 0, 3, 0, 3, 0, - 79, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,249,196, 8, 8,250,196, 8, - 0, 0, 0, 0, 0, 0, 0, 0,168,237,196, 8, 56,248,196, 8, 68, 65, 84, 65,164, 0, 0, 0,168,237,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,120,238,196, 8, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,120,238,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 72,239,196, 8, -168,237,196, 8, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0, 72,239,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 24,240,196, 8,120,238,196, 8, 65,110,105,109, - 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, - 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, - 24,240,196, 8,112, 0, 0, 0, 1, 0, 0, 0,232,240,196, 8, 72,239,196, 8, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,232,240,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,184,241,196, 8, 24,240,196, 8, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,184,241,196, 8,112, 0, 0, 0, 1, 0, 0, 0,136,242,196, 8, -232,240,196, 8, 69,102,102,101, 99,116,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,210, 3, 0, 0,162, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,136,242,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 88,243,196, 8,184,241,196, 8, 72,111,111,107, -115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, - 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0, - 88,243,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 40,244,196, 8,136,242,196, 8, 80, 97,114,116,105, 99,108,101, 32, 73,110,116, -101,114, 97, 99,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0, 40,244,196, 8,112, 0, 0, 0, - 1, 0, 0, 0,248,244,196, 8, 88,243,196, 8, 83,111,102,116, 98,111,100,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,232,240,196, 8, 68, 65, 84, 65,164, 0, 0, 0,248,244,196, 8,112, 0, 0, 0, 1, 0, 0, 0,200,245,196, 8, - 40,244,196, 8, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,164, 0, 0, 0,200,245,196, 8,112, 0, 0, 0, 1, 0, 0, 0,152,246,196, 8,248,244,196, 8, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100, -101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, - 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, -152,246,196, 8,112, 0, 0, 0, 1, 0, 0, 0,104,247,196, 8,200,245,196, 8, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0,104,247,196, 8,112, 0, 0, 0, - 1, 0, 0, 0, 56,248,196, 8,152,246,196, 8, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,164, 0, 0, 0, 56,248,196, 8,112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -104,247,196, 8, 83, 99,114,105,112,116,108,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 83, 99,114,105,112,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,212, 0, 0, 0, 8,249,196, 8, 94, 0, 0, 0, 1, 0, 0, 0, 8,250,196, 8, 0, 0, 0, 0, 4, 0, 0, 0, - 51, 51, 51, 63, 1, 89, 48,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0,193, 0, 0,163, 67, 0, 0, 0,193, 0, 0,104, 67, 0, 0, 0,193, 35,159, 3, 68, 0, 0, 0,193, 0, 0,104, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0,200, 68, 0, 0,225, 67, - 0, 0, 0, 63,225,122,180, 63, 0, 0, 1, 0, 1, 0, 1, 0,156, 1,185, 0, 0, 0, 0, 0, 5, 0,255,255, 0, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 84, 1, 0, 0, 8,250,196, 8, 96, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 8,249,196, 8, 5, 0, 0, 0, 51, 51, 51, 63, 1, 89, 48,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 57, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0,244, 3, 0, 0,136,251,196, 8, 87, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 83, 99,101,110,101, 0,116, 97,103,101, - 0, 97,105,110, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 40, 9,197, 8,160, 2,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0,168,255,196, 8, 56, 0,197, 8,168,255,196, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0,128, 0,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 49,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, -250, 0,100, 0,100, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 2,224, 1, 60, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0,100, 0,141, 0, 32, 3, 88, 2, -100, 0,100, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 4, 0, 0, 0, 90, 0, 16, 0, 23, 0, 1, 0, 0, 0,128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 0, 25, 0, 10, 0, 0, 0, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,205,204, 76, 63,102,102,102, 63, 0, 0,128, 63, 0, 0,128, 64, - 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 47, 98, 97, 99,107, 98,117,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 47,102,116,121,112,101, 0, 64, 38, 35, 0, 0, 0, 0, 0, 64, 94, 0, 0, 64, 38, 94, 0, 0, 0, 35, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,226,187, 8, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 28, 0, 0, 0, -168,255,196, 8, 79, 0, 0, 0, 1, 0, 0, 0,240,255,196, 8, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -128, 2,108, 1, 72, 12,197, 8, 68, 65, 84, 65, 28, 0, 0, 0,240,255,196, 8, 79, 0, 0, 0, 1, 0, 0, 0, 56, 0,197, 8, -168,255,196, 8, 1, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 78, 3,159, 1,152, 15,197, 8, 68, 65, 84, 65, 28, 0, 0, 0, - 56, 0,197, 8, 79, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,240,255,196, 8, 1, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, -251, 3, 33, 0, 40, 9,197, 8, 68, 65, 84, 65, 40, 0, 0, 0,128, 0,197, 8, 78, 0, 0, 0, 1, 0, 0, 0, 44, 1, 0, 0, - 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 1, 0,244, 1,200, 0,100, 0, 20, 0, 16, 39, 0, 0,205,204,204, 61, 0, 0,240, 65, - 0, 0, 0, 64, 68, 65, 84, 65, 28, 0, 0, 0, 48, 49,197, 8, 86, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 90, 0, 9, 0, - 1, 0, 0, 0, 0, 0,128, 63,111, 18,131, 58, 32, 0, 32, 0, 32, 0, 0, 0, 67, 65, 0, 0,116, 0, 0, 0,216, 0,197, 8, - 23, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 67, 97,109,101,114, 97, - 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0,205,204, 76, 62, - 0, 0, 0, 0,205,204,204, 61, 0, 0,200, 66, 0, 0, 12, 66,161, 14,234, 64, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0, -252, 0, 0, 0,120, 1,197, 8, 31, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 32, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,247,255,239, 65, - 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 64, 11, 3, 0, 46, 26,128, 63, 25, 4,240, 65, - 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 0, 0, 32, 1, 0, 0,160, 2,197, 8, 77, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,174,103, 61,112, 29, 98, 62, -205,204,204, 62, 0, 0, 0, 0,205,204,204, 61,205,204,204, 61,205,204,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -205,204, 28, 65, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84, 88, 0, 0,100, 0, 0, 0,240, 3,197, 8, 21, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0,128, 4,197, 8,128, 4,197, 8,128, 4,197, 8,128, 4,197, 8, - 0, 0, 0, 0, 0, 0, 0, 0,248, 4,197, 8,255,255,255,255, 0, 4, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, -128, 4,197, 8, 20, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 4,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, - 69, 69, 82, 70, 68, 65, 84, 65, 4, 0, 0, 0,200, 4,197, 8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 79, 66, 0, 0, -244, 2, 0, 0, 40, 9,197, 8, 71, 0, 0, 0, 1, 0, 0, 0, 72, 12,197, 8, 0, 0, 0, 0, 1, 89, 70,108, 0, 0, 0, 0, - 79, 66, 67, 97,109,101,114, 97, 0, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,216, 0,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 42,254,141, 63,192, 57, 49, 60, 34,159, 80, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,222,149, 47, 63, - 53, 70, 58, 63,222, 56, 49,188, 0, 0, 0, 0, 86,126,162,190,227,251,159, 62, 55, 53,101, 63, 0, 0, 0, 0, 7,165, 39, 63, -149, 84, 28,191, 51,247,227, 62, 0, 0, 0, 0,110,101,239, 64,150, 62,208,192, 78,255,170, 64, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, -157,190,215, 49,167,170, 4, 52, 0, 0, 0,128,129,116,157,178, 1, 0,128, 63, 33, 69, 15, 51, 0, 0, 0,128, 73,254, 67, 51, -243, 97,106, 49, 0, 0,128, 63, 0, 0, 0,128, 3, 0, 64, 52,183,164,157, 39, 0, 0,128, 53, 0, 0,128, 63, 1, 0, 0, 0, - 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,100, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 6, 41,100, 63, 0, 0,128, 63,205,204,204, 62, 0, 0, 0, 0, 6, 41,100, 63, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0,244, 2, 0, 0, 72, 12,197, 8, 71, 0, 0, 0, 1, 0, 0, 0,152, 15,197, 8, 40, 9,197, 8, - 1, 89,123, 92, 0, 0, 0, 0, 79, 66, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 22,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 15,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63,222,149, 47, 63, 52, 70, 58, 63,179, 56, 49,188, 0, 0, 0,128, 86,126,162,190,227,251,159, 62, 56, 53,101, 63, - 0, 0, 0,128, 7,165, 39, 63,149, 84, 28,191, 50,247,227, 62, 0, 0, 0,128,110,101,239, 64,151, 62,208,192, 77,255,170, 64, - 0, 0,128, 63, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62, - 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24,218,193, 8,200, 29,197, 8, 68, 65, 84, 65, 4, 0, 0, 0,104, 15,197, 8, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0,244, 2, 0, 0,152, 15,197, 8, 71, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 72, 12,197, 8, - 1, 89,121, 92, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120, 1,197, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,123, 38, 63, 87, 43, 98, 61,229,229,238, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 54,236,148,190, 25,134,116, 63,236, 13, 98,189, 0, 0, 0, 0,221,102, 69,191, 57,174, 76,190, 34,194, 26, 63, - 0, 0, 0, 0, 37,255, 16, 63,241,161, 95, 62,164,111, 75, 63, 0, 0, 0, 0,154,112,130, 64,183,178,128, 63,112,236,188, 64, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 53,236,148,190,222,102, 69,191, 37,255, 16, 63, 0, 0, 0,128, 24,134,116, 63, 57,174, 76,190,240,161, 95, 62, - 0, 0, 0,128,235, 13, 98,189, 34,194, 26, 63,166,111, 75, 63, 0, 0, 0,128,208, 19, 13, 63,234, 65,102,190, 10, 10,231,192, - 0, 0,128, 63, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0,100, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62, - 0, 0, 0, 0,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0,156, 1, 0, 0,184, 18,197, 8, 33, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, - 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, - 0, 0, 0, 0, 2, 0, 2, 0, 50, 0, 0, 6, 3, 0, 1, 3, 0, 0, 0, 0, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63, -205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 1, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63,128, 20,197, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 88, 0, 0, 0,128, 20,197, 8, 25, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 21,197, 8, - 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63, -205,204, 76, 62, 0, 0, 0, 0, 84, 69, 0, 0,228, 0, 0, 0, 8, 21,197, 8, 30, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 1, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 69, 0, 0,188, 0, 0, 0, 24, 22,197, 8, 46, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 69, 67,117, 98,101, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0,232, 31,194, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23,197, 8, 88, 0,194, 8, - 0, 0, 0, 0, 0, 0, 0, 0,216, 21,194, 8,120, 28,194, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180, - 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 0, 68, 65, 84, 65, 4, 0, 0, 0, 0, 23,197, 8, 0, 0, 0, 0, - 1, 0, 0, 0,184, 18,197, 8, 68, 65, 84, 65,160, 0, 0, 0,216, 21,194, 8, 51, 0, 0, 0, 8, 0, 0, 0, 0, 0,128, 63, -255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182, 3,255, 0, 0,128, 63, 0, 0,128,191, 0, 0,128,191,230, 73, 26,182, - 26,182, 3,255, 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, 26,182, 3,255,250,255,127,191, 3, 0,128, 63, - 0, 0,128,191, 26,182,230, 73, 26,182, 3,255, 4, 0,128, 63,247,255,127, 63, 0, 0,128, 63,230, 73,230, 73,230, 73, 3,255, -245,255,127, 63, 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 3,255, 3, 0,128,191,250,255,127,191, 0, 0,128, 63, - 26,182, 26,182,230, 73, 3,255,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, 26,182,230, 73,230, 73, 3,255, 68, 65, 84, 65, -144, 0, 0, 0,120, 28,194, 8, 48, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, - 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 35, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, - 68, 65, 84, 65,120, 0, 0, 0, 88, 0,194, 8, 47, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, - 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 2, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 71, 76, 79, 66, 24, 0, 0, 0,160,240,255,191,114, 0, 0, 0, 1, 0, 0, 0, - 96, 40,196, 8,136,251,196, 8, 1, 0, 0, 1, 0, 0, 0, 0,128, 32, 4, 0, 0, 0, 0, 0, 85, 83, 69, 82,168, 7, 0, 0, -224,226,172, 8,108, 0, 0, 0, 1, 0, 0, 0, 33, 24, 0, 0, 63, 2, 0, 0, 5, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 85,115,101,114,115, - 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 45,112,111,119,101,114,112, 99, 47, 98,105,110, 47, 98,108,101,110,100, -101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 48, 52, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 64, 0, - 5, 0, 2, 0, 0,104, 97,108,107, 98,111, 97,114,100, 46,116,116,102, 0, 55, 46, 53, 46, 48, 45,112,111,119,101,114,112, 99, - 47, 98,105,110, 47, 98,108,101,110,100,101,114, 46, 97,112,112, 47, 67,111,110,116,101,110,116,115, 47, 82,101,115,111,117,114, - 99,101,115, 47, 46, 98,102,111,110,116, 46,116,116,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,200, 32,197, 8,216, 40,197, 8, 32, 0, 0, 0, 5, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63, -205,204, 76, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 30, 90,100,191, -154,153,153, 62,102,102,102, 63, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 31,250,254, 62, 9, 0, 0, 63,156,153, 25, 63, - 0, 0, 0, 0,205,204, 76, 62,205,204, 76, 62,205,204, 76, 62, 0, 0,128, 63, 44,135, 22, 63, 32,133,235, 62,184,243,125, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,195, 73, 76, 63, 42,135, 86, 63, 0, 0,128, 63, 0, 0, 0, 0, 1, 43,135, 61, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 16, 47, 93, 62, 58,180,200,190, 24, 47, 93,190, 0, 0, 0, 0, 14, 0, 0, 0, - 25, 0, 15, 0,120, 0, 0, 0, 60, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,224, 7, 0, 0,200, 32,197, 8, -106, 0, 0, 0, 1, 0, 0, 0,216, 40,197, 8, 0, 0, 0, 0, 68,101,102, 97,117,108,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,160,160,255,160,160,160,255,173,160,147,255,138,158,161,255, -161,161,174,255,161,153,167,255,144,144,144,255,144,144,144,255,198,119,119,255,160,160,160,255, 0, 0, 0,255,255,255,255,255, -210,210,210,255,218,218,218,255,127,127,127,255, 0, 0, 0,255,255,255,255,255, 1, 0, 0, 0,180,180,180,255, 0, 0, 0,255, -255,255,255,255,195,195,195,255,255,255,255, 40,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255, -255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255, -230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -115,115,115,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, - 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, - 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255, -200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,160,160,160,100, -127,112,112,100,160,160,208,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255, -255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60, -255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,120,120,120,255, 0, 0, 0,255,255,255,255,255,195,195,195,255, -255,255,255,150,172,172,172,100,112,112,112,100, 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40, -255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, - 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255, -255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255, -255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255, -230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,173,173,173,255,127,112,112,100, 0, 0, 0, 0, -140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, - 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255, -200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255,165,165,165,127,172,172,172,255, - 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255, -255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255,166,166,166,255,200,100,200, 60, -255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116,116,116,255, 0, 0, 0,255,255,255,255,255,182,182,182,255, -165,165,165,127,172,172,172,255, 84, 44, 31,100, 17, 27, 60,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40, -255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, - 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80,228,156,198,255,255,255,170,255, - 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,115,115,115,255, 0, 0, 0,255, -255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255, -255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255, -230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 53, 53,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, - 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, - 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 40,200,100,200, 80,255,138, 48,255, 34,221,221,255, -200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,110,110,110,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,170,170,186,255, -127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255, -255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60, -255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255, -165,165,165,127,143,143,143,255,198,119,119,255,255, 0, 0,255, 92, 92, 92,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40, -255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, - 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 4, 0, 0,100, 0, 0,255, 0, 0,200,255,128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255,153,153,153,255, 0, 0, 0,255, -255,255,255,255,195,195,195,255,165,165,165,127,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 92, 92, 92,255, 0, 0, 0,255, -255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,176,176, 48,255, -230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -153,153,153,255, 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,127,173,173,173,255,127,112,112,100, 0, 0, 0, 0, -140,140,140,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 40,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, - 0, 0, 0,255,176,176, 48,255,230,150, 50,255, 75, 75, 75,255, 0, 50,150, 30,200,100,200, 60,255,138, 48,255, 34,221,221,255, -200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,224, 7, 0, 0,216, 40,197, 8,106, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -200, 32,197, 8, 82,111,117,110,100,101,100, 0, 0,101,119, 32, 85,115,101,114, 32, 84,104,101,109,101, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,176,176,176,255,107,107,107,255,177,177,177,255,178,178,178,255,143,143,143,255,143,143,143,255, -107,107,107,255,198,119,119,255,143,143,143,255, 0, 0, 0,255,255,255,255,255, 0, 0, 0,111, 0, 0, 33, 83,255,130, 0,255, -255,255,255,255, 0, 0, 0,255, 2, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,175,175,175, 51, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, -255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30, -200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255, -107,107,107,255, 0, 0, 0, 51,160,160,160,100,127,112,112,100, 0, 0, 0, 0,143,143,143,255, 0, 0, 0,255,217,217,217,255, - 0, 0, 0, 40,255,255,255,255,255,130, 0,255, 0, 0, 0,255,255,130, 0,255, 0, 0, 0,255,255,255,255,255,230,150, 50,255, - 0, 0, 0, 0,255,255,255, 10,255,130, 0, 60,255,138, 48,255, 34,221,221,255,200,200,200,255, 80,200,255, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, - 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,160,160,160,100,127,112,112,100,255,130, 0,255, 88, 88, 88,255, - 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255, -144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,107,107,107,150,107,107,107,100,143,143,143,100, - 96,192, 64,255, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,255,255,255, -255,130, 0,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, -255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30, -200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255, -158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255, - 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, - 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150,107,107,107,255,178,178,178,100,255,130, 0,100, 94, 94, 94,255, - 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255, -144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0,143,143,143,255,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,143,143,143,255,165,165,165,150,107,107,107,255,178,178,178,100, -255,130, 0,100, 94, 94, 94,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255, -255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228,156,198,255,255,255,170,255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, -255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30, -200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 53, 53,255, 0, 0, 0,255,255,255,255,255, -195,195,195,255,165,165,165,150,160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, - 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,107,107,255, - 0, 0, 0,255,255,255,255,255,195,195,195,255,165,165,165,150,143,143,143,255,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, - 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255, -144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,153,153,153,255, 0, 0, 0,255,255,255,255,255,153,153,153,255,165,165,165,150,143,143,143,255,198,119,119,255, -255, 0, 0,255, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255, -255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,100, 0, 0,255, 0, 0,200,255, -128, 0, 80,255, 95, 95, 0,255, 0,100, 50,255,107,107,107,255, 0, 0, 0,255,255,255,255,255,107,107,107,255,165,165,165,150, -160,160,160,100,127,112,112,100, 0, 0, 0, 0, 88, 88, 88,255, 0, 0, 0,255,255,136,255,255, 0, 0, 0, 0,255,187,255,255, -255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,150, 30, -200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,158,158,255, 0, 0, 0,255,255,255,255,255, -158,158,158,255,165,165,165,150,140,140,140,255,127,112,112,100, 0, 0, 0, 0,112,112, 96,255, 0, 0, 0,255,255,136,255,255, - 0, 0, 0, 0,255,187,255,255,255,255,255,255,255,112,255,255,255,255,112,255, 0, 0, 0,255,144,144, 48,255, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 50,150, 30,200,100,200, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 78, 65, 49, - 60,100, 0, 0, 16,170,197, 8, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69,196, 5, 0, 0, 42,110,101,120, -116, 0, 42,112,114,101,118, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, 0,122, 0,119, 0,120,109,105, -110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109, -101, 91, 50, 52, 93, 0,117,115, 0,102,108, 97,103, 0,112, 97,100, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102, -105,108,101,100, 97,116, 97, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0,116,111,116, 0, 99,117,114,118,101, 0, 99,117,114, 0, - 98,108,111, 99,107,116,121,112,101, 0,115,104,111,119,107,101,121, 0,112,111,115, 0, 99,117,114,118, 97,108, 0,116,121,112, -101, 0, 97,100,114, 99,111,100,101, 0,116,111,116,101,108,101,109, 0, 42,100, 97,116, 97, 0, 42,119,101,105,103,104,116,115, - 0,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105,110, 0,115, -108,105,100,101,114,109, 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0,101,108,101, -109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, 0,115,108, -117,114,112,104, 0, 42, 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112,116, 0,116, -111,116,115, 99,114,105,112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0,108,101,110, 0, 98,108,101,110, 0, - 42,110, 97,109,101, 0,102,108, 97,103,115, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42, -115,101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111, -115, 0,117,110,100,111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,115,105,122,101, 0,115,101,101,107, 0,112, - 97,115,115,101,112, 97,114,116, 97,108,112,104, 97, 0,112, 97,100, 49, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101, -110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0, 89, 70, 95, -100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117,114,101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89, - 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114,111,116, 0,115, 99,114,105,112,116,108,105,110,107, 0, 42, - 97,110,105,109, 0, 42,105, 98,117,102, 0, 42,109,105,112,109, 97,112, 91, 49, 48, 93, 0,111,107, 0,108, 97,115,116,102,114, - 97,109,101, 0,108, 97,115,116,113,117, 97,108,105,116,121, 0,116,112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110, -100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101, - 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100,102,105,108,101, 0,108, 97,115,116,117,112,100, 97,116,101, - 0,108, 97,115,116,117,115,101,100, 0, 97,110,105,109,115,112,101,101,100, 0,114,101,115,101,114,118,101,100, 49, 0,114,101, -115,101,114,118,101,100, 50, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97,112,116,111,110,101,103, 0, 98,108,101, -110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,112,114,111,106,120, 0,112,114,111,106,121, 0, -112,114,111,106,122, 0,109, 97,112,112,105,110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120, -102,108, 97,103, 0, 99,111,108,111,114,109,111,100,101,108, 0,114, 0,103, 0, 98, 0,107, 0,100,101,102, 95,118, 97,114, 0, - 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105,115,112,102, 97, 99, 0,119, 97,114, -112,102, 97, 99, 0, 42,104, 97,110,100,108,101, 0, 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121, -112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114,115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, - 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, 99,107, 41, 40, 41, 0, -118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0,100, 97,116, 97, 91, 49, 54, 93, 0, 42,105,109, 97, 0, - 42, 99,117, 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,115,116,121,112,101, 0,110,111,116,108, 97,121, - 0, 99,117, 98,101,114,101,115, 0,100,101,112,116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110, -111,105,115,101,115,105,122,101, 0,116,117,114, 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0, -114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109, -103, 95,108, 97, 99,117,110, 97,114,105,116,121, 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101, -116, 0,109,103, 95,103, 97,105,110, 0,100,105,115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108, -101, 0,118,110, 95,119, 49, 0,118,110, 95,119, 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120, -112, 0,118,110, 95,100,105,115,116,109, 0,118,110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, - 0,110,111,105,115,101,116,121,112,101, 0,110,111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, - 50, 0,105,109, 97,102,108, 97,103, 0, 99,114,111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112, -120,109, 97,120, 0, 99,114,111,112,121,109, 97,120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120, -116,101,110,100, 0, 99,104,101, 99,107,101,114,100,105,115,116, 0,110, 97, 98,108, 97, 0,102,114, 97,109,101,115, 0,111,102, -102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, - 42,101,110,118, 0,102,114, 97,100,117,114, 91, 52, 93, 91, 50, 93, 0,109,111,100,101, 0,116,111,116,101,120, 0,101,110,101, -114,103,121, 0,100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110, -116, 0, 97,116,116, 49, 0, 97,116,116, 50, 0, 98,117,102,115,105,122,101, 0,115, 97,109,112, 0,115,104, 97,100,115,112,111, -116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109, -112,121, 0,114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95, -115,104, 97,112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95, -115,105,122,101,122, 0,116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0, 89, 70, 95,110,117,109, -112,104,111,116,111,110,115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116,104, 0, - 89, 70, 95,117,115,101,113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, 95, 99, - 97,117,115,116,105, 99, 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119,105,110, -116, 0, 89, 70, 95,103,108,111,119,111,102,115, 0, 89, 70, 95,112, 97,100, 51, 0, 89, 70, 95,103,108,111,119,116,121,112,101, - 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, 91, 49, 48, 93, 0,108, 97,121, 0,115,112,101, 99,114, 0,115,112,101, - 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, - 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110,103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95, -109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115,112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0, -116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110,101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, - 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, - 0,102,105,108,116,101,114, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, 97, 0, -104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,109,111,100,101, 50, 0,102,108, 97,114,101, 99, 0,115,116, 97, -114, 99, 0,108,105,110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0, -115,117, 98,115,105,122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116, -114, 97,110,100, 95,101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,114,103, 98,115,101,108, 0,112,114, 95,116, -121,112,101, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, 0,115,101,112,116,101,120, 0,112, 97,100, 52, 0, -112, 97,100, 53, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,112,101, 99, 95,115,104, 97,100,101,114, 0,114,111,117, -103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, 93, 0,114,109,115, 0,100, 97,114,107,110, -101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,112, 95,115,112,101, 99, 0,114, 97,109,112,105,110, 95, - 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,109,112, 98,108,101,110,100, 95, 99,111,108, 0,114, 97, -109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,115,104,111,119, 0,112, 97,100, 51, 0,114, 97,109,112, -102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0,102,114,105, 99,116,105,111,110, 0,102,104, - 0,114,101,102,108,101, 99,116, 0,102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101, - 0,112, 97,100, 50, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100,115, 99, 97,108, -101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,101,116, 0, 89, 70, 95,100, -106,105,116, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99, 97,108,101, 0, 42, 98, 98, 0,105, 49, 0,106, 49, 0,107, 49, - 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, 97,116, 91, 52, - 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, 42,109, 97,116, - 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42, 42,109, 97,116, 0,116,111,116, 99,111,108, 0,108, -111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101, - 0,116,104,114,101,115,104, 0,118,101, 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,104, 49, - 0,104, 50, 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0, -112,110,116,115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117, - 0,111,114,100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111, -116,115,118, 0, 42, 98,112, 0, 42, 98,101,122,116, 0, 99,104, 97,114,105,100,120, 0,107,101,114,110, 0,104, 0,110,117,114, - 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,106, 0, 42,116,101,120,116,111,110, 99,117,114,118,101, - 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, 97,116,104,108,101,110, 0, 98,101,118,114,101,115,111,108, - 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105, -110,103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99, -101, 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100, -116,104, 0, 42,115,116,114, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116, - 98, 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,111,116, 98,111, -120, 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116, -114,105,110,102,111, 0, 99,117,114,105,110,102,111, 0, 42,111, 98, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0,109, 97,120,114, - 99,116, 0,116,111,116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120, -116,114, 97,112, 0,114,116, 0, 98,105,116,109, 97,115,107, 0, 42,100,114,105,118,101,114, 0, 42,116,112, 97,103,101, 0,117, -118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116,114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97, -112, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,116,102, 97, 99,101, 0, 42,100,102, 97, 99,101, 0, 42,109, -118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116,105, 99,107, -121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,111, 99, 0, 42,115,117,109,111,104, 97,110,100,108,101, 0,116,111,116, -101,100,103,101, 0,116,111,116,102, 97, 99,101, 0, 99,117, 98,101,109, 97,112,115,105,122,101, 0,115,109,111,111,116,104,114, -101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0,118, - 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, 99,111,100,101, 0, 99,114,101, 97,115,101, 0,100,101,102, 95,110,114, 0, - 42,100,119, 0,116,111,116,119,101,105,103,104,116, 0, 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0, 99,111, 91, 50, 93, 0, - 42,101,114,114,111,114, 0,109,111,100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112,101, 0,108,101,118,101,108, -115, 0,114,101,110,100,101,114, 76,101,118,101,108,115, 0, 42,101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0, -115,116, 97,114,116, 0,108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, 97,120,105,115, - 0,116,111,108,101,114, 97,110, 99,101, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,115,116, 97, -114,116,120, 0,115,116, 97,114,116,121, 0,104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, - 97,109,112, 0,116,105,109,101,111,102,102,115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, - 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0,102, 97,108,108,111,102,102, - 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,101, 0,111,112,101,114, 97,116,105, -111,110, 0,112,110,116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121, -112,101,117, 0,116,121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100, -119, 0, 42,100,101,102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,100,118,101, 99, 91, 51, 93, 0,109, 97,120, 0, 42, 42,111, - 98, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97,114, 51, 0,112, 97,114,115,117, 98,115, -116,114, 91, 51, 50, 93, 0, 42,112, 97,114,100, 97,116, 97, 0, 42,112, 97,114,101,110,116, 0, 42,116,114, 97, 99,107, 0, 42, - 97, 99,116,105,111,110, 0, 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0, -110,101,116,119,111,114,107, 0,100,101,102, 98, 97,115,101, 0,109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51, - 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,100,113,117, 97,116, - 91, 52, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110,115,102,108, 97, -103, 0,105,112,111,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110,108, 97,102,108, - 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97,103, 0,115, 99, - 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112,111,102,102, 0, -100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, 0, 99,116,105,109,101, 0,109, 97,115,115, 0,100, 97,109,112, -105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,115,111,102,116,116,105,109,101, 0, -114,100, 97,109,112,105,110,103, 0,115,105,122,101,102, 97, 99, 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,112, -114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111,114, -115, 0, 98, 98,115,105,122,101, 91, 51, 93, 0,100,102,114, 97,115, 0, 97, 99,116,100,101,102, 0,103, 97,109,101,102,108, 97, -103, 0,103, 97,109,101,102,108, 97,103, 50, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115,111,116,114,111,112,105, 99, - 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110,108, 97,115,116,114,105,112, -115, 0,104,111,111,107,115, 0, 42,112,100, 0, 42,115,111,102,116, 0, 42,108,105,102,101, 0,108, 98,117,102, 0,112,111,114, -116, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103, - 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100,101,114,105,118,101,100, 68,101,102,111,114, -109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,117,114,105,110,100, -101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0,102,111,114, 99,101,102,105,101,108,100, 0,112,100,101, -102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0,112,100,101,102, 95,112,101,114,109, 0,102, 95,115,116, -114,101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,109, 97,120,100,105,115,116, 0,112,100,101,102, 95,115, 98,100, 97, -109,112, 0,112,100,101,102, 95,115, 98,105,102,116, 0,112,100,101,102, 95,115, 98,111,102,116, 0,116,111,116,112,111,105,110, -116, 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,110,111,100, -101,109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112,104, -121,115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99,116, - 0,109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114,111, -117,112, 0,105,110,115,112,114,105,110,103, 0,105,110,102,114,105, 99,116, 0,101,102,114, 97, 0,105,110,116,101,114,118, 97, -108, 0, 42, 42,107,101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,104,111,119, 95, 97,100,118, 97,110, 99, -101,100,111,112,116,105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114, -101,115,120,121,122, 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101, -110,100,101,114, 68,105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118, -105,115, 99,111,115,105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103, -114, 97,118,120, 0,103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69, -110,100, 0,103,115,116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101, -108,121, 0,105,110,105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, - 0, 42,109,101,115,104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97, -114,116, 91, 51, 93, 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111,114, -103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, 0, - 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, 0, -108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66,111, -120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,109,105, -115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114,114, - 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97,114, -109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100,111, -102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115,116, - 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111,100, -101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 42, 97,111,115,112,104,101,114,101, - 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, 97,119,116,121,112,101, 0,115,117, 98,115,104,111, -111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108,105,109, 0,109, 97,120,115,117, 98,108, 97,109,112, - 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109,105, 0,109, 97,120,110,111,100,101, 0, 99,111,110, -118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109,109, 97, 0,115,101,108, 99,111,108, 0,115,120, 0, -115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114,109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, 99, - 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, 97,110,100,108,101,114, 0,100,119, 75,101,121, 70, -114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, 0,100,119, 66,121,116,101,115, 80,101,114, 83,101, - 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101,114,108,101, 97,118,101, 69,118,101,114,121, 0, 97, -118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99,100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, 99, -100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0,109,105,120,114, 97,116,101, 0,109, - 97,105,110, 0,112, 97,100, 91, 51, 93, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, - 99,100, 97,116, 97, 0, 99,102,114, 97, 0,105,109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,102,114, 97,109,101, -108,101,110, 0, 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117, -108,108,115, 99,114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116, -116,114,105, 98, 0,114,116, 49, 0,114,116, 50, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111, -110,115,112,114,101,115,101,116, 0,102,105,108,116,101,114,116,121,112,101, 0,109, 97,120,105,109,115,105,122,101, 0,120,115, - 99,104, 0,121,115, 99,104, 0,120, 97,115,112, 0,121, 97,115,112, 0,120,112, 97,114,116,115, 0,121,112, 97,114,116,115, 0, -115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121, -112,101, 0, 98,117,102,102,108, 97,103, 0,113,117, 97,108,105,116,121, 0,115, 99,101,109,111,100,101, 0,114,101,110,100,101, -114,101,114, 0,111, 99,114,101,115, 0,114,112, 97,100, 91, 50, 93, 0, 97,108,112,104, 97,109,111,100,101, 0,100,111,103, 97, -109,109, 97, 0,111,115, 97, 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,109,101, 95,109, 97,116, - 95,114,101,100,117,120, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0,112,111,115,116,103, 97,109,109, 97, 0,112, -111,115,116, 97,100,100, 0,112,111,115,116,105,103, 97,109,109, 97, 0,112,111,115,116,104,117,101, 0,112,111,115,116,115, 97, -116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0,122,109,105,110, 0,102,111, 99,117,115, 0,122,103, - 97,109,109, 97, 0,122,115,105,103,109, 97, 0,122, 98,108,117,114, 0, 71, 73,113,117, 97,108,105,116,121, 0, 71, 73, 99, 97, - 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, 71, 73,112,104,111,116,111,110,115, 0, 71, 73,100,105,114,101, 99,116, 0, - 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114,116,120,109,108, 0, 89, 70, 95,110,111, 98,117,109,112, 0, 89, 70, 95, 99, -108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, 49, 0, 71, 73,100,101,112,116,104, 0, 71, 73, 99, 97,117,115,100,101,112, -116,104, 0, 71, 73,112,105,120,101,108,115,112,101,114,115, 97,109,112,108,101, 0, 71, 73,112,104,111,116,111,110, 99,111,117, -110,116, 0, 71, 73,109,105,120,112,104,111,116,111,110,115, 0, 71, 73,112,104,111,116,111,110,114, 97,100,105,117,115, 0, 89, - 70, 95,110,117,109,112,114,111, 99,115, 0, 89, 70, 95,114, 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115, -101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108,101,115, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108,105,116,121, 0, - 71, 73,114,101,102,105,110,101,109,101,110,116, 0, 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114,112,111,119,101, -114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, 98,105, 97, -115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115,105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111,108,100, 0, - 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0,112,105, 99, 91, 49, 54, 48, 93, 0,102,116,121,112,101, 91, 49, 54, 48, 93, - 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97,109,101, 91, 54, 52, 93, 0, 99,111,114,110,101,114,116,121,112, -101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,100,101,103,114, 0,115,116,101,112, 0,116,117,114,110, 0,101,120,116, -114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,115,101,103,109,101,110,116,115, 0,114,105,110,103,115, 0, -118,101,114,116,105, 99,101,115, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, 0, 42,115,101,116, 0, 98, 97,115, -101, 0, 42, 98, 97,115, 97, 99,116, 0, 42,103,114,111,117,112, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99,101,110, -116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,115,101,108,101, 99,116,109,111,100, -101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112,114,111,112, 95,109,111,100,101, 0,101,100,105,116, 98,117,116, -115,105,122,101, 0, 42,101,100, 0, 42,114, 97,100,105,111, 0,102,114, 97,109,105,110,103, 0, 42,116,111,111,108,115,101,116, -116,105,110,103,115, 0, 97,117,100,105,111, 0,109, 97,114,107,101,114,115, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105, -115,118, 97,108,105,100, 0,100, 97,103,102,108, 97,103,115, 0,100,105,114,116,121, 0,122,111,111,109, 0, 98,108,101,110,100, - 0,120,105,109, 0,121,105,109, 0, 42,114,101, 99,116, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, 99,107,115, 99, - 97,108,101, 0, 42, 97,114,101, 97, 0, 98,108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,118,105,101,119,109, 97, -116, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93, - 91, 52, 93, 0,112,101,114,115,105,110,118, 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0, -118,105,101,119,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,112,101,114,115,112, - 0,118,105,101,119, 0, 42, 98,103,112,105, 99, 0, 42,108,111, 99, 97,108,118,100, 0,108,111, 99, 97,108,118,105,101,119, 0, -108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99,107, 0, 97,114,111,117,110,100, 0, 99, 97,109,122,111,111,109, 0, -103,114,105,100, 0,103,114,105,100,118,105,101,119, 0,112,105,120,115,105,122,101, 0,110,101, 97,114, 0,102, 97,114, 0,103, -114,105,100,108,105,110,101,115, 0,118,105,101,119, 98,117,116, 0,103,114,105,100,102,108, 97,103, 0,109,111,100,101,115,101, -108,101, 99,116, 0,109,101,110,117,110,114, 0,116,101,120,110,114, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0, -116,119,102,108, 97,103, 0,116,119,100,114, 97,119,102,108, 97,103, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108, -105,112, 91, 52, 93, 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0, -120,114, 97,121, 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, - 0,109,105,110,122,111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,107,101,101,112,116,111,116, 0, -107,101,101,112, 97,115,112,101, 99,116, 0,107,101,101,112,122,111,111,109, 0,111,108,100,119,105,110,120, 0,111,108,100,119, -105,110,121, 0,114,111,119, 98,117,116, 0,118, 50,100, 0, 42,101,100,105,116,105,112,111, 0,105,112,111,107,101,121, 0, 97, - 99,116,110, 97,109,101, 91, 51, 50, 93, 0, 99,111,110,115,116,110, 97,109,101, 91, 51, 50, 93, 0,116,111,116,105,112,111, 0, -112,105,110, 0, 98,117,116,111,102,115, 0, 99,104, 97,110,110,101,108, 0,108,111, 99,107, 0,109,101,100,105, 97,110, 91, 51, - 93, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0, 97,108,105,103,110, 0,116, 97, 98,111, 0,109, 97,105,110, - 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120,102,114,111,109, 0,115,104,111,119,103, -114,111,117,112, 0,114,101, 99,116,120, 0,114,101, 99,116,121, 0, 99,117,114,121, 0,109,111,100,101,108,116,121,112,101, 0, -115, 99,114,105,112,116, 98,108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115, - 0,116, 97, 98, 91, 55, 93, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,108,101, 0,116,105,116,108,101, 91, - 50, 52, 93, 0,100,105,114, 91, 49, 54, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,102,115, 0,115,111,114,116, 0,109, - 97,120,110, 97,109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0, 42,108,105, 98,102,105,108,101,100, 97,116, 97, 0,114, -101,116,118, 97,108, 0,109,101,110,117, 0, 97, 99,116, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 42, -109,101,110,117,112, 0,111,111,112,115, 0,118,105,115,105,102,108, 97,103, 0,116,114,101,101, 0, 42,116,114,101,101,115,116, -111,114,101, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,101,112,115, 95,102,108, - 97,103,115, 0, 42,105,109, 97,103,101, 0,105,109, 97,110,114, 0, 99,117,114,116,105,108,101, 0, 42,116,101,120,116, 0,116, -111,112, 0,118,105,101,119,108,105,110,101,115, 0,102,111,110,116, 95,105,100, 0,108,104,101,105,103,104,116, 0,108,101,102, -116, 0,115,104,111,119,108,105,110,101,110,114,115, 0,116, 97, 98,110,117,109, 98,101,114, 0, 99,117,114,114,116, 97, 98, 95, -115,101,116, 0,115,104,111,119,115,121,110,116, 97,120, 0,117,110,117,115,101,100, 95,112, 97,100,100, 0,112,105,120, 95,112, -101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114,111,108,108, 0,116,120,116, 98, 97,114, 0, 42,115, 99,114,105,112,116, - 0,114,101,100,114, 97,119,115, 0,116,105,116,108,101, 91, 50, 56, 93, 0,102, 97,115,101, 0,115,117, 98,102, 97,115,101, 0, -109,111,117,115,101, 95,109,111,118,101, 95,114,101,100,114, 97,119, 0,105,109, 97,102, 97,115,101, 0,109,120, 0,109,121, 0, -100,105,114,115,108,105, 0,100,105,114,115,108,105, 95,108,105,110,101,115, 0,100,105,114,115,108,105, 95,115,120, 0,100,105, -114,115,108,105, 95,101,121, 0,100,105,114,115,108,105, 95,101,120, 0,100,105,114,115,108,105, 95,104, 0,105,109, 97,115,108, -105, 0,102,105,108,101,115,101,108,109,101,110,117,105,116,101,109, 0,105,109, 97,115,108,105, 95,115,120, 0,105,109, 97,115, -108,105, 95,101,121, 0,105,109, 97,115,108,105, 95,101,120, 0,105,109, 97,115,108,105, 95,104, 0,100,115,115,120, 0,100,115, -115,121, 0,100,115,101,120, 0,100,115,101,121, 0,100,101,115,120, 0,100,101,115,121, 0,100,101,101,120, 0,100,101,101,121, - 0,102,115,115,120, 0,102,115,115,121, 0,102,115,101,120, 0,102,115,101,121, 0,100,115,100,104, 0,102,115,100,104, 0,102, -101,115,120, 0,102,101,115,121, 0,102,101,101,120, 0,102,101,101,121, 0,105,110,102,115,120, 0,105,110,102,115,121, 0,105, -110,102,101,120, 0,105,110,102,101,121, 0,100,110,115,120, 0,100,110,115,121, 0,100,110,119, 0,100,110,104, 0,102,110,115, -120, 0,102,110,115,121, 0,102,110,119, 0,102,110,104, 0,102,111,108,101, 91, 49, 50, 56, 93, 0,100,111,114, 91, 49, 50, 56, - 93, 0,102,105,108,101, 91, 49, 50, 56, 93, 0,100,105,114, 91, 49, 50, 56, 93, 0, 42,102,105,114,115,116,100,105,114, 0, 42, -102,105,114,115,116,102,105,108,101, 0,116,111,112,100,105,114, 0,116,111,116, 97,108,100,105,114,115, 0,104,105,108,105,116, -101, 0,116,111,112,102,105,108,101, 0,116,111,116, 97,108,102,105,108,101,115, 0,105,109, 97,103,101, 95,115,108,105,100,101, -114, 0,115,108,105,100,101,114, 95,104,101,105,103,104,116, 0,115,108,105,100,101,114, 95,115,112, 97, 99,101, 0,116,111,112, -105,109, 97, 0,116,111,116, 97,108,105,109, 97, 0, 99,117,114,105,109, 97,120, 0, 99,117,114,105,109, 97,121, 0, 42,102,105, -114,115,116, 95,115,101,108, 95,105,109, 97, 0, 42,104,105,108,105,116,101, 95,105,109, 97, 0,116,111,116, 97,108, 95,115,101, -108,101, 99,116,101,100, 0,105,109, 97, 95,114,101,100,114, 97,119, 0, 42, 99,109, 97,112, 0, 42, 97,114,103, 49, 0,111,117, -116,108,105,110,101, 91, 52, 93, 0,110,101,117,116,114, 97,108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101, -116,116,105,110,103, 91, 52, 93, 0,115,101,116,116,105,110,103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93, - 0,110,117,109, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104, -105, 91, 52, 93, 0,112,111,112,117,112, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93, - 0,109,101,110,117, 95, 98, 97, 99,107, 91, 52, 93, 0,109,101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95, -104,105,108,105,116,101, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, - 95,104,105, 91, 52, 93, 0, 98,117,116, 95,100,114, 97,119,116,121,112,101, 0,112, 97,100, 49, 91, 51, 93, 0, 98, 97, 99,107, - 91, 52, 93, 0,104,101, 97,100,101,114, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, - 0,115,104, 97,100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114, -101, 91, 52, 93, 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, - 0,116,114, 97,110,115,102,111,114,109, 91, 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115, -101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0, -101,100,103,101, 95,115,101, 97,109, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0,102, 97, 99, -101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, 52, 93, 0, -110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95,112,111,115, -101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, 0,118,101, -114,116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, 93, 0,115, -121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, 52, 93, 0, -115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,116,117,105, 0,116, 98,117,116,115, 0, -116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116,115,110,100, 0,116, 97, 99,116, 0, -116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97,115,101,108, 0,116,101,120,116, 0,116,111,111,112, -115, 0,116,116,105,109,101, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, - 0,116,101,109,112,100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,100,101, -114,100,105,114, 91, 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,120,100, -105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,100,105, -114, 91, 49, 54, 48, 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,105,114, - 91, 49, 54, 48, 93, 0,118,101,114,115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, -115, 0,119,104,101,101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103, -101, 0,117,115,101,114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,108,101, 95, 98,117,102,102, -101,114, 0, 99,111,110,115,111,108,101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101, 0,102,111,110,116,115,105, -122,101, 0,101,110, 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104, -111,108,100, 49, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110, 97,109,101, 91, 50, 53, 54, - 93, 0,116,104,101,109,101,115, 0,117,110,100,111,115,116,101,112,115, 0, 99,117,114,115,115,105,122,101, 0,116, 98, 95,108, -101,102,116,109,111,117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0, -116,119, 95,104,111,116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, - 0,116,119, 95,115,105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97, -116,101, 0,111, 98, 99,101,110,116,101,114, 95,100,105, 97, 0,118,101,114,116, 98, 97,115,101, 0,101,100,103,101, 98, 97,115, -101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,115, 99,101,110,101, 0,101,110,100,120, 0,101,110,100,121, 0,115,105,122,101, -120, 0,115,105,122,101,121, 0,115, 99,101,110,101,110,114, 0,115, 99,114,101,101,110,110,114, 0,102,117,108,108, 0,109, 97, -105,110,119,105,110, 0,119,105,110, 97,107,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110,101,119,118, 0,118,101, - 99, 0, 42,118, 49, 0, 42,118, 50, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, 98,110, 97,109,101, 91, - 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, 0, 99,111,110,116,114,111,108, 0,111,108,100, 95,111,102,115,120, 0,111, -108,100, 95,111,102,115,121, 0,115,111,114,116, 99,111,117,110,116,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42,118, - 51, 0, 42,118, 52, 0, 42,102,117,108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,104,101, 97,100,114, 99,116, - 0,119,105,110,114, 99,116, 0,104,101, 97,100,119,105,110, 0,119,105,110, 0,104,101, 97,100,101,114,116,121,112,101, 0, 98, -117,116,115,112, 97, 99,101,116,121,112,101, 0,119,105,110,120, 0,119,105,110,121, 0,104,101, 97,100, 95,115,119, 97,112, 0, -104,101, 97,100, 95,101,113,117, 97,108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,110, 95,101,113,117, 97,108, 0,104,101, - 97,100, 98,117,116,108,101,110, 0,104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,114,115,111,114, 0,115,112, 97, 99,101, -100, 97,116, 97, 0,117,105, 98,108,111, 99,107,115, 0,112, 97,110,101,108,115, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, - 42, 99,117,114,115, 99,101,110,101, 0,100,105,115,112,108, 97,121,109,111,100,101, 0,102,105,108,101,102,108, 97,103,115, 0, -103,108,111, 98, 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0, -110,114, 0,100,111,110,101, 0, 42,115,116,114,105,112,100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42,110,101,119,115, -101,113, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,115,116, 97,114,116,115,116,105,108,108, 0,101,110, -100,115,116,105,108,108, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115,112, 0,101,110,100,100,105,115,112, - 0,109,117,108, 0,104, 97,110,100,115,105,122,101, 0, 42,115,116,114,105,112, 0, 42, 99,117,114,101,108,101,109, 0,102, 97, - 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, - 97,115,101, 0, 42,115,111,117,110,100, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117,114,112,111,115, 0,115,116,114,111, - 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, - 0, 42,115,101,113, 98, 97,115,101,112, 0,109,101,116, 97,115,116, 97, 99,107, 0,101,100,103,101, 87,105,100,116,104, 0, 97, -110,103,108,101, 0,102,111,114,119, 97,114,100, 0,119,105,112,101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97, -109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0,100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, - 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, 97, 0,101,110,100, 0,116,111,116,112, 97,114,116, - 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100,102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97, -110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99,116,115,105,122,101, 0,100,101,102,118,101, 99, 91, - 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108,105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, - 52, 93, 0,116,101,120,109, 97,112, 0, 99,117,114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97, -116, 0,116,105,109,101,116,101,120, 0,115,112,101,101,100,116,101,120, 0,102,108, 97,103, 50, 0,102,108, 97,103, 50,110,101, -103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111,117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114, -111,117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121,115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0, - 42,105,100, 0,117,115,101,100,101,108,101,109, 0,100,120, 0,100,121, 0,108,105,110,107, 0,111,116,121,112,101, 0,100, 97, -116, 97, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116,100,105,115,116, 0, -108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0,116, 97,114,103,101, -116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97,108,117,101, 91, 51, - 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,116,101,114,105, 97,108, 78, 97,109,101, 91, 51, 50, 93, - 0,100, 97,109,112,116,105,109,101,114, 0,100,101,108, 97,121, 0,112,114,111,112,110, 97,109,101, 91, 51, 50, 93, 0,109, 97, -116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106,101, 99,116, 0,115, -117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102,114,101,113, 0,116, -111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,105,110,118,101,114,116, 0,102,114,101,113, 50, 0, 97,120,105, -115,102, 0, 98,117,116,116,111,110, 0, 98,117,116,116,111,110,102, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105, -115,105,111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115, -108,105,110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108, 0,118, 97,108,111, 0,116,105,109,101, 0, 42, 97, 99, -116, 0, 98,108,101,110,100,105,110, 0,112,114,105,111,114,105,116,121, 0,115,116,114,105,100,101,108,101,110,103,116,104, 0, -115,116,114,105,100,101, 97,120,105,115, 0,114,101,115,101,114,118,101,100, 51, 0,115,110,100,110,114, 0,109, 97,107,101, 99, -111,112,121, 0, 99,111,112,121,109, 97,100,101, 0,112, 97,100, 91, 49, 93, 0,116,114, 97, 99,107, 0,118,111,108,117,109,101, - 0, 42,109,101, 0,108,105,110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,102,111, -114, 99,101,108,111, 99, 91, 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, - 99,105,116,121, 91, 51, 93, 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,100,100,101,100, -108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 97,110,111,116,104,101,114,112, 97,100, 91, 52, 93, 0, - 98,117,116,115,116, 97, 0, 98,117,116,101,110,100, 0,109,105,110, 0,102, 97, 99, 0,118,105,115,105,102, 97, 99, 0,115,108, -111,119, 0,109,105,110,108,111, 99, 91, 51, 93, 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, - 0,109, 97,120,114,111,116, 91, 51, 93, 0,100,105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,103, 95, - 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0,102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95, 97,114, -103, 95, 50, 0,116,111, 80,114,111,112, 78, 97,109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,111,100, -121, 84,121,112,101, 0,102,105,108,101,110, 97,109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101, 91, 54, - 52, 93, 0,103,111, 0, 97, 99, 99,101,108,108,101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120, -114,111,116,115,112,101,101,100, 0,109, 97,120,116,105,108,116,115,112,101,101,100, 0,114,111,116,100, 97,109,112, 0,116,105, -108,116,100, 97,109,112, 0,115,112,101,101,100,100, 97,109,112, 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109, - 0, 42,110,101,119,112, 97, 99,107,101,100,102,105,108,101, 0, 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105, -110,103, 0, 97,116,116,101,110,117, 97,116,105,111,110, 0,112,105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97, -120, 95,103, 97,105,110, 0,100,105,115,116, 97,110, 99,101, 0,115,116,114,101, 97,109,108,101,110, 0,108,111,111,112,115,116, - 97,114,116, 0,108,111,111,112,101,110,100, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,112,114,105,111, 0,112, 97, -100, 91, 49, 48, 93, 0,103, 97,105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,100,111,112,112,108,101,114, -118,101,108,111, 99,105,116,121, 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114, 0,110,117,109,115,111,117, -110,100,115,103, 97,109,101,101,110,103,105,110,101, 0, 42,103,107,101,121, 0,112, 97,100,102, 0,111,107,101,121, 0,103,111, - 98,106,101, 99,116, 0,103,107,101,121, 0, 42, 97, 99,116,105,118,101, 0, 99,104,105,108,100, 98, 97,115,101, 0,114,111,108, -108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, 98,111,110,101, 95,109, 97,116, 91, 51, 93, 91, 51, 93, - 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116, - 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104, 0,122,119,105,100,116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, - 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108, 0, 98,111,110,101, 99,108, 97,115,115, 0, 98,111,110, -101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122, -101, 0, 99,111,110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0, 42, 98,111,110,101, 0, 42, 99,104,105,108,100, 0, -105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 99,104, 97,110, 95,109, 97,116, 91, 52, 93, 91, - 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, 91, 51, 93, 0,112, -111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109,105,116,109, 97,120, - 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, 99,104, 97,110, 98, - 97,115,101, 0,115,116,114,105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 97, 99,116,110,114, 0,116,105,109,101,115, -108,105,100,101, 0,110, 97,109,101, 91, 51, 48, 93, 0,101,110,102,111,114, 99,101, 0, 42,116, 97,114, 0,105,116,101,114, 97, -116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,111,114,105, -101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,109,105,110,109, 97,120,102,108, - 97,103, 0,115,116,105, 99,107,121, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, 0,108,111, 99, 97,108, 0,108, -111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,111,102,102,115,101,116, 91, 51, 93, 0,122,109, 97, -120, 0,118,111,108,109,111,100,101, 0,112,108, 97,110,101, 0,111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0, -115,116,114,105,100,101, 95, 97,120,105,115, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0,115,116,114,105, -100,101,108,101,110, 0,114,101,112,101, 97,116, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100,101, 99,104, 97,110, -110,101,108, 91, 51, 50, 93, 0, 84, 89, 80, 69,219, 0, 0, 0, 99,104, 97,114, 0,117, 99,104, 97,114, 0,115,104,111,114,116, - 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, 0,117,108,111,110,103, 0,102,108,111, 97,116, 0,100,111,117, - 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105,115,116, 66, 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99, - 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118,101, 99, 51,105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, - 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, 52,100, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 0, - 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101, -121, 0, 83, 99,114,105,112,116, 76,105,110,107, 0, 84,101,120,116, 76,105,110,101, 0, 84,101,120,116, 0, 80, 97, 99,107,101, -100, 70,105,108,101, 0, 67, 97,109,101,114, 97, 0, 73,109, 97,103,101, 0, 97,110,105,109, 0, 73,109, 66,117,102, 0, 77, 84, -101,120, 0, 79, 98,106,101, 99,116, 0, 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, 67, 66, 68, 97,116, 97, 0, 67, -111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 76, 97,109,112, 0, 87, 97,118,101, 0, 77, 97,116,101,114,105, - 97,108, 0, 86, 70,111,110,116, 0, 86, 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110, -100, 66,111,120, 0, 77,101,116, 97, 66, 97,108,108, 0, 66,101,122, 84,114,105,112,108,101, 0, 66, 80,111,105,110,116, 0, 78, -117,114, 98, 0, 67,104, 97,114, 73,110,102,111, 0, 84,101,120,116, 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0, - 73,112,111, 68,114,105,118,101,114, 0, 73,112,111, 67,117,114,118,101, 0, 84, 70, 97, 99,101, 0, 77,101,115,104, 0, 77, 70, - 97, 99,101, 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, - 0, 77, 83,116,105, 99,107,121, 0, 79, 99, 73,110,102,111, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104,116, 0, 77,111, -100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98,115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, - 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114, - 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111,114, 77,111,100, -105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 87, - 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114,101, 77,111,100,105,102,105,101,114, - 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,111,102,116, 98,111,100,121, 77,111, -100,105,102,105,101,114, 68, 97,116, 97, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, - 97,116,116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 76, 66,117,102, 0, 98, 65, 99,116,105,111,110, - 0, 98, 80,111,115,101, 0, 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 76,105,102,101, - 0, 70,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 68,101,114,105,118,101,100, 77,101,115,104, 0, 79, 98, - 72,111,111,107, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, 66,111,100,121, 83,112,114,105, -110,103, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, - 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, 82,101, -110,100,101,114, 68, 97,116, 97, 0, 71, 97,109,101, 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, - 84,111,111,108, 83,101,116,116,105,110,103,115, 0, 83, 99,101,110,101, 0, 71,114,111,117,112, 0, 68, 97,103, 70,111,114,101, -115,116, 0, 66, 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0, 83,112, 97, 99,101, 76,105,110,107, 0, 83, 99,114, 65,114,101, - 97, 0, 86,105,101,119, 50, 68, 0, 83,112, 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 83,112, 97, 99, -101, 66,117,116,115, 0, 83,112, 97, 99,101, 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0,100,105,114,101,110,116,114, -121, 0, 66,108,101,110,100, 72, 97,110,100,108,101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114, -101, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101,120,116, 0, - 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, 83,112, 97, - 99,101, 73,109, 97, 83,101,108, 0, 73,109, 97, 68,105,114, 0, 79,110,101, 83,101,108,101, 99,116, 97, 98,108,101, 73,109, 97, - 0, 84,104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, - 76,105,103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99, -114, 69,100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, - 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,117,101,110, 99,101, 0, 98, 83,111,117,110,100, - 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 69,100,105,116,105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, - 86, 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114, -116,105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 84,114,101,101, 83,116,111,114,101, 69,108,101,109, 0, 79,111,112,115, - 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97,114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110, -115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111,114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, - 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111,114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111, -114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97, -121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103,101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, - 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121,115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114, -101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116,104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, - 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97, -116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98, - 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111, -114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97, -116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111,114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, - 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116,117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97, -116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, - 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97,116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99, -116,117, 97,116,111,114, 0, 70,114,101,101, 67, 97,109,101,114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, - 76,105,115,116,101,110,101,114, 0, 83,112, 97, 99,101, 83,111,117,110,100, 0, 71,114,111,117,112, 75,101,121, 0, 79, 98,106, -101, 99,116, 75,101,121, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109, 97,116,117,114, -101, 0, 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 83,112, - 97, 99,101, 65, 99,116,105,111,110, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111, -110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84, -114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111,110,115, -116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 77,105, -110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, - 0, 98, 76,111, 99,107, 84,114, 97, 99,107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116, -104, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 68,105,115,116, 97,110, 99,101, 76,105,109,105,116, 67,111,110,115,116,114, - 97,105,110,116, 0, 98, 82,111,116, 97,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,116,114,101,116, 99, -104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 83,116,114,105,112, 0, 0, 84, 76, 69, 78, - 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, 8, 0, 8, 0, 4, 0, 8, 0, 8, 0, 16, 0, - 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 48, 0,224, 0, 0, 0, 80, 0,104, 0,116, 0, 16, 0, 24, 0, -100, 0, 20, 0,116, 0, 48, 1, 0, 0, 0, 0, 88, 0,244, 2,228, 0, 80, 1, 24, 0,136, 1,128, 0,252, 0, 52, 0,156, 1, - 64, 1, 0, 0,108, 0, 96, 0,132, 0, 56, 0, 28, 0, 56, 0, 8, 0, 16, 0, 44, 1, 0, 0,140, 0, 84, 0, 60, 0,188, 0, - 20, 0, 20, 0, 12, 0, 12, 0, 4, 0, 8, 0, 24, 0, 8, 0, 52, 0, 68, 0, 88, 0, 88, 0, 68, 0, 60, 0, 60, 0, 92, 0, - 64, 0,180, 0, 52, 0, 64, 0,108, 0, 40, 0, 12, 0, 56, 0, 24, 0, 44, 0, 92, 0, 0, 0, 84, 1, 0, 0,208, 0, 16, 0, - 0, 0, 0, 0, 32, 1, 40, 0, 28, 0,176, 0,144, 0, 16, 0, 16, 3, 16, 0, 80, 0, 28, 0,244, 3, 68, 0, 0, 0, 36, 0, -180, 2, 36, 0,204, 0,120, 0, 36, 0, 40, 1,212, 0,164, 0, 84, 1, 0, 0, 0, 0,196, 0, 12, 0,184, 0,164, 0,120, 0, - 32, 0, 0, 0,148, 0,224, 2, 0, 0, 0, 0, 72, 0,136, 0,224, 7, 56, 0,168, 7,116, 0, 20, 0, 24, 0,164, 0, 24, 0, -104, 0,188, 0,160, 1,172, 0, 32, 1, 16, 0, 28, 0, 12, 0, 24, 0, 16, 0, 24, 0,236, 0, 0, 0, 56, 0, 12, 0, 44, 0, - 64, 0, 48, 0, 8, 0, 44, 0, 72, 0,104, 0, 72, 0, 44, 0, 40, 0,108, 0, 68, 0, 76, 0, 80, 0, 64, 0,128, 0, 4, 0, - 60, 0, 12, 0, 60, 0, 20, 0, 16, 0, 64, 0, 16, 0, 76, 0,120, 0, 48, 0, 28, 0, 56, 0, 52, 0, 56, 0,108, 0,136, 0, - 4, 0, 40, 0, 0, 0, 64, 0,160, 0, 48, 0,112, 1, 20, 0, 4, 1, 80, 0, 68, 1, 60, 0,176, 0, 44, 0, 52, 0, 76, 0, - 44, 0, 44, 0, 44, 0, 60, 0, 56, 0, 44, 0, 20, 0, 60, 0, 24, 0, 52, 0, 88, 0, 0, 0, 83, 84, 82, 67,192, 0, 0, 0, - 10, 0, 2, 0, 10, 0, 0, 0, 10, 0, 1, 0, 11, 0, 2, 0, 9, 0, 2, 0, 9, 0, 3, 0, 12, 0, 2, 0, 2, 0, 4, 0, - 2, 0, 5, 0, 13, 0, 2, 0, 4, 0, 4, 0, 4, 0, 5, 0, 14, 0, 2, 0, 7, 0, 4, 0, 7, 0, 5, 0, 15, 0, 2, 0, - 8, 0, 4, 0, 8, 0, 5, 0, 16, 0, 3, 0, 4, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 17, 0, 3, 0, 7, 0, 4, 0, - 7, 0, 5, 0, 7, 0, 6, 0, 18, 0, 3, 0, 8, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 19, 0, 4, 0, 4, 0, 4, 0, - 4, 0, 5, 0, 4, 0, 6, 0, 4, 0, 7, 0, 20, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, - 21, 0, 4, 0, 8, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 22, 0, 4, 0, 4, 0, 8, 0, 4, 0, 9, 0, - 4, 0, 10, 0, 4, 0, 11, 0, 23, 0, 4, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 24, 0, 8, 0, - 9, 0, 0, 0, 9, 0, 1, 0, 24, 0, 12, 0, 25, 0, 13, 0, 0, 0, 14, 0, 2, 0, 15, 0, 2, 0, 16, 0, 4, 0, 17, 0, - 25, 0, 6, 0, 24, 0, 18, 0, 24, 0, 19, 0, 26, 0, 20, 0, 0, 0, 21, 0, 4, 0, 22, 0, 4, 0, 17, 0, 27, 0, 6, 0, - 24, 0, 18, 0, 11, 0, 23, 0, 23, 0, 24, 0, 2, 0, 25, 0, 2, 0, 26, 0, 4, 0, 17, 0, 28, 0, 13, 0, 28, 0, 0, 0, - 28, 0, 1, 0, 7, 0, 27, 0, 7, 0, 28, 0, 2, 0, 29, 0, 2, 0, 30, 0, 4, 0, 31, 0, 9, 0, 32, 0, 7, 0, 33, 0, - 0, 0, 34, 0, 0, 0, 35, 0, 7, 0, 36, 0, 7, 0, 37, 0, 29, 0, 12, 0, 24, 0, 18, 0, 28, 0, 38, 0, 0, 0, 39, 0, - 4, 0, 40, 0, 7, 0, 28, 0, 11, 0, 41, 0, 27, 0, 42, 0, 24, 0, 43, 0, 2, 0, 29, 0, 2, 0, 44, 0, 2, 0, 45, 0, - 2, 0, 16, 0, 30, 0, 5, 0, 24, 0, 46, 0, 2, 0, 47, 0, 2, 0, 48, 0, 2, 0, 49, 0, 4, 0, 17, 0, 31, 0, 6, 0, - 31, 0, 0, 0, 31, 0, 1, 0, 0, 0, 50, 0, 0, 0, 51, 0, 4, 0, 52, 0, 4, 0, 53, 0, 32, 0, 13, 0, 24, 0, 18, 0, - 0, 0, 54, 0, 4, 0, 55, 0, 4, 0, 56, 0, 11, 0, 57, 0, 31, 0, 58, 0, 31, 0, 59, 0, 4, 0, 60, 0, 4, 0, 61, 0, - 0, 0, 62, 0, 4, 0, 63, 0, 4, 0, 64, 0, 9, 0, 65, 0, 33, 0, 5, 0, 4, 0, 66, 0, 4, 0, 67, 0, 4, 0, 55, 0, - 4, 0, 17, 0, 9, 0, 32, 0, 34, 0, 17, 0, 24, 0, 18, 0, 2, 0, 29, 0, 2, 0, 16, 0, 7, 0, 68, 0, 7, 0, 69, 0, - 7, 0, 70, 0, 7, 0, 71, 0, 7, 0, 72, 0, 7, 0, 73, 0, 7, 0, 74, 0, 7, 0, 75, 0, 7, 0, 76, 0, 2, 0, 77, 0, - 2, 0, 78, 0, 7, 0, 79, 0, 27, 0, 42, 0, 30, 0, 80, 0, 35, 0, 23, 0, 24, 0, 18, 0, 0, 0, 21, 0, 36, 0, 81, 0, - 37, 0, 82, 0, 37, 0, 83, 0, 2, 0, 84, 0, 2, 0, 16, 0, 2, 0, 85, 0, 2, 0, 86, 0, 2, 0, 87, 0, 2, 0, 88, 0, - 2, 0, 89, 0, 2, 0, 90, 0, 2, 0, 91, 0, 2, 0, 92, 0, 4, 0, 93, 0, 4, 0, 94, 0, 33, 0, 95, 0, 7, 0, 96, 0, - 4, 0, 97, 0, 2, 0, 98, 0, 2, 0, 99, 0, 4, 0,100, 0, 38, 0, 24, 0, 2, 0,101, 0, 2, 0,102, 0, 2, 0,103, 0, - 2, 0,104, 0, 39, 0,105, 0, 40, 0,106, 0, 0, 0,107, 0, 0, 0,108, 0, 0, 0,109, 0, 0, 0,110, 0, 7, 0,111, 0, - 7, 0,112, 0, 2, 0,113, 0, 2, 0,114, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,118, 0, 7, 0,119, 0, - 7, 0,120, 0, 7, 0,121, 0, 7, 0,122, 0, 7, 0,123, 0, 7, 0,124, 0, 41, 0, 14, 0, 0, 0, 21, 0, 9, 0,125, 0, - 0, 0,126, 0, 0, 0,127, 0, 4, 0,128, 0, 4, 0,129, 0, 9, 0,130, 0, 7, 0,131, 0, 7, 0,132, 0, 7, 0,133, 0, - 4, 0,134, 0, 9, 0,135, 0, 4, 0,136, 0, 4, 0, 17, 0, 42, 0, 6, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, - 7, 0,137, 0, 7, 0, 27, 0, 4, 0, 24, 0, 43, 0, 5, 0, 2, 0, 16, 0, 2, 0, 22, 0, 2, 0, 24, 0, 2, 0,138, 0, - 42, 0,139, 0, 44, 0, 16, 0, 39, 0,105, 0, 35, 0,140, 0, 35, 0,141, 0, 7, 0,142, 0, 2, 0, 29, 0, 2, 0,143, 0, - 7, 0, 70, 0, 7, 0, 71, 0, 4, 0,144, 0, 2, 0,145, 0, 2, 0,146, 0, 2, 0, 84, 0, 2, 0, 85, 0, 2, 0,147, 0, - 2, 0,148, 0, 4, 0, 69, 0, 40, 0, 52, 0, 24, 0, 18, 0, 7, 0,149, 0, 7, 0,150, 0, 7, 0,151, 0, 7, 0,152, 0, - 7, 0,153, 0, 7, 0,154, 0, 7, 0,155, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, - 7, 0,161, 0, 7, 0,162, 0, 7, 0,163, 0, 7, 0,164, 0, 7, 0,165, 0, 7, 0,166, 0, 7, 0,167, 0, 7, 0,168, 0, - 2, 0,169, 0, 2, 0,170, 0, 2, 0,171, 0, 2, 0,172, 0, 2, 0,173, 0, 2, 0,174, 0, 2, 0,175, 0, 2, 0, 16, 0, - 2, 0, 29, 0, 2, 0,143, 0, 7, 0,176, 0, 7, 0,177, 0, 7, 0,178, 0, 7, 0,179, 0, 2, 0,180, 0, 2, 0,181, 0, - 2, 0,182, 0, 2, 0, 52, 0, 7, 0,183, 0, 7, 0,184, 0, 2, 0,185, 0, 2, 0,186, 0, 2, 0,187, 0, 2, 0,188, 0, - 7, 0,121, 0, 27, 0, 42, 0, 35, 0,140, 0, 41, 0,189, 0, 43, 0,190, 0, 44, 0,191, 0, 2, 0,192, 0, 45, 0, 50, 0, - 24, 0, 18, 0, 2, 0, 29, 0, 2, 0,193, 0, 2, 0,114, 0, 2, 0,194, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, - 7, 0,118, 0, 7, 0,195, 0, 7, 0,196, 0, 7, 0,197, 0, 7, 0,198, 0, 7, 0,199, 0, 7, 0,200, 0, 7, 0,201, 0, - 2, 0,202, 0, 2, 0,203, 0, 7, 0, 70, 0, 7, 0, 71, 0, 7, 0,204, 0, 7, 0,205, 0, 7, 0,206, 0, 2, 0,207, 0, - 2, 0,208, 0, 2, 0,209, 0, 2, 0,210, 0, 2, 0,211, 0, 2, 0, 17, 0, 7, 0,212, 0, 7, 0,213, 0, 7, 0,214, 0, - 2, 0,215, 0, 2, 0,216, 0, 4, 0,217, 0, 4, 0,218, 0, 2, 0,219, 0, 2, 0,220, 0, 2, 0,221, 0, 2, 0,222, 0, - 7, 0,223, 0, 7, 0,224, 0, 7, 0,225, 0, 7, 0,226, 0, 7, 0,227, 0, 2, 0,228, 0, 2, 0,229, 0, 38, 0,230, 0, - 27, 0, 42, 0, 30, 0, 80, 0, 46, 0, 2, 0, 24, 0, 18, 0, 27, 0, 42, 0, 47, 0, 95, 0, 24, 0, 18, 0, 2, 0,114, 0, - 2, 0,231, 0, 7, 0,115, 0, 7, 0,116, 0, 7, 0,117, 0, 7, 0,232, 0, 7, 0,233, 0, 7, 0,234, 0, 7, 0,235, 0, - 7, 0,236, 0, 7, 0,237, 0, 7, 0,238, 0, 7, 0,239, 0, 7, 0,240, 0, 7, 0,241, 0, 7, 0,242, 0, 7, 0,243, 0, - 7, 0,244, 0, 7, 0,245, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248, 0, 7, 0,249, 0, 7, 0,250, 0, 7, 0,251, 0, - 7, 0,252, 0, 7, 0,253, 0, 7, 0,254, 0, 7, 0,255, 0, 7, 0, 0, 1, 2, 0, 1, 1, 2, 0, 2, 1, 2, 0, 3, 1, - 0, 0, 4, 1, 0, 0, 5, 1, 4, 0,193, 0, 4, 0, 6, 1, 2, 0, 7, 1, 2, 0, 8, 1, 2, 0, 9, 1, 2, 0, 10, 1, - 7, 0, 11, 1, 7, 0, 12, 1, 7, 0, 13, 1, 7, 0, 14, 1, 7, 0, 15, 1, 7, 0, 16, 1, 7, 0, 17, 1, 0, 0, 18, 1, - 0, 0,215, 0, 0, 0, 19, 1, 0, 0, 17, 0, 2, 0, 20, 1, 2, 0, 21, 1, 2, 0, 22, 1, 2, 0, 23, 1, 4, 0, 24, 1, - 2, 0, 25, 1, 2, 0, 26, 1, 7, 0, 27, 1, 7, 0, 28, 1, 7, 0, 29, 1, 7, 0, 30, 1, 7, 0, 31, 1, 2, 0,101, 0, - 2, 0,102, 0, 43, 0, 32, 1, 43, 0, 33, 1, 0, 0, 34, 1, 0, 0, 35, 1, 0, 0, 36, 1, 0, 0, 37, 1, 2, 0, 38, 1, - 2, 0, 39, 1, 7, 0, 40, 1, 7, 0, 41, 1, 38, 0,230, 0, 27, 0, 42, 0, 7, 0, 42, 1, 7, 0, 43, 1, 7, 0, 44, 1, - 7, 0, 45, 1, 7, 0, 46, 1, 2, 0, 47, 1, 2, 0, 48, 1, 7, 0, 49, 1, 7, 0, 50, 1, 7, 0, 51, 1, 7, 0, 52, 1, - 7, 0, 53, 1, 4, 0, 54, 1, 4, 0, 55, 1, 4, 0, 56, 1, 30, 0, 80, 0, 48, 0, 6, 0, 24, 0, 18, 0, 0, 0, 57, 1, - 7, 0, 58, 1, 7, 0, 17, 0, 49, 0, 32, 0, 33, 0, 95, 0, 50, 0, 26, 0, 50, 0, 0, 0, 50, 0, 1, 0, 51, 0, 59, 1, - 4, 0, 60, 1, 4, 0, 61, 1, 4, 0, 62, 1, 4, 0, 63, 1, 4, 0, 64, 1, 4, 0, 65, 1, 2, 0, 29, 0, 2, 0, 16, 0, - 2, 0, 66, 1, 2, 0, 67, 1, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 68, 1, 7, 0, 69, 1, 7, 0, 70, 1, - 7, 0, 71, 1, 7, 0, 72, 1, 7, 0, 73, 1, 7, 0, 74, 1, 7, 0, 52, 0, 7, 0, 75, 1, 7, 0, 76, 1, 52, 0, 15, 0, - 24, 0, 18, 0, 51, 0, 59, 1, 11, 0, 77, 1, 11, 0, 78, 1, 27, 0, 42, 0, 47, 0, 79, 1, 2, 0, 16, 0, 2, 0, 80, 1, - 4, 0,113, 0, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1, 7, 0, 83, 1, 7, 0, 84, 1, 7, 0, 85, 1, 53, 0, 10, 0, - 7, 0, 86, 1, 7, 0, 87, 1, 7, 0, 88, 1, 7, 0, 17, 0, 2, 0, 89, 1, 2, 0, 90, 1, 0, 0, 91, 1, 0, 0, 92, 1, - 0, 0, 93, 1, 0, 0, 94, 1, 54, 0, 5, 0, 7, 0, 95, 1, 7, 0, 87, 1, 7, 0, 88, 1, 2, 0, 91, 1, 2, 0, 94, 1, - 55, 0, 20, 0, 55, 0, 0, 0, 55, 0, 1, 0, 2, 0, 29, 0, 2, 0, 96, 1, 2, 0, 94, 1, 2, 0, 16, 0, 2, 0, 97, 1, - 2, 0, 98, 1, 2, 0, 99, 1, 2, 0,100, 1, 2, 0,101, 1, 2, 0,102, 1, 2, 0,103, 1, 2, 0,104, 1, 7, 0,105, 1, - 7, 0,106, 1, 54, 0,107, 1, 53, 0,108, 1, 4, 0,109, 1, 4, 0, 17, 0, 56, 0, 5, 0, 2, 0,110, 1, 2, 0, 96, 1, - 0, 0, 16, 0, 0, 0, 17, 0, 2, 0, 48, 1, 57, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 7, 0, 7, 0,111, 1, - 58, 0, 54, 0, 24, 0, 18, 0, 51, 0, 59, 1, 11, 0,112, 1, 11, 0, 78, 1, 39, 0,113, 1, 39, 0,114, 1, 39, 0,115, 1, - 27, 0, 42, 0, 59, 0,116, 1, 29, 0,117, 1, 47, 0, 79, 1, 11, 0,118, 1, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1, - 4, 0,113, 0, 2, 0,119, 1, 2, 0, 80, 1, 2, 0, 16, 0, 2, 0,120, 1, 7, 0,121, 1, 7, 0,122, 1, 7, 0,123, 1, - 2, 0, 99, 1, 2, 0,100, 1, 2, 0, 52, 0, 2, 0, 57, 0, 2, 0, 27, 0, 2, 0,124, 1, 7, 0,125, 1, 7, 0,126, 1, - 7, 0,127, 1, 7, 0,128, 1, 7, 0,129, 1, 7, 0,130, 1, 7, 0,131, 1, 7, 0,132, 1, 7, 0,133, 1, 7, 0,134, 1, - 0, 0,135, 1, 0, 0,136, 1, 48, 0,137, 1, 48, 0,138, 1, 48, 0,139, 1, 48, 0,140, 1, 4, 0,141, 1, 4, 0,142, 1, - 4, 0,143, 1, 4, 0, 17, 0, 57, 0,144, 1, 4, 0,145, 1, 4, 0,146, 1, 56, 0,147, 1, 56, 0,148, 1, 60, 0, 6, 0, - 39, 0,149, 1, 2, 0, 25, 0, 2, 0, 30, 0, 2, 0, 29, 0, 2, 0, 16, 0, 0, 0,150, 1, 61, 0, 19, 0, 61, 0, 0, 0, - 61, 0, 1, 0, 54, 0,107, 1, 53, 0,108, 1, 23, 0,151, 1, 23, 0,152, 1, 2, 0, 25, 0, 2, 0, 30, 0, 2, 0,153, 1, - 2, 0,154, 1, 2, 0,155, 1, 2, 0,156, 1, 2, 0, 16, 0, 2, 0,157, 1, 7, 0, 10, 0, 7, 0, 11, 0, 4, 0,158, 1, - 7, 0, 28, 0, 60, 0,159, 1, 62, 0, 8, 0, 9, 0,160, 1, 7, 0,161, 1, 4, 0,162, 1, 0, 0, 16, 0, 0, 0,163, 1, - 2, 0,193, 0, 2, 0,164, 1, 2, 0,165, 1, 63, 0, 32, 0, 24, 0, 18, 0, 51, 0, 59, 1, 11, 0,166, 1, 27, 0, 42, 0, - 29, 0,117, 1, 47, 0, 79, 1, 64, 0,167, 1, 62, 0,168, 1, 9, 0,169, 1, 65, 0,170, 1, 66, 0,171, 1, 67, 0,172, 1, - 68, 0,173, 1, 69, 0,174, 1, 63, 0,175, 1, 70, 0,176, 1, 9, 0,177, 1, 4, 0,154, 1, 4, 0,178, 1, 4, 0,179, 1, - 4, 0,113, 0, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 82, 1, 7, 0,180, 1, 7, 0, 17, 0, 2, 0,181, 1, 2, 0, 16, 0, - 2, 0,182, 1, 2, 0,183, 1, 2, 0, 80, 1, 2, 0,184, 1, 64, 0, 8, 0, 4, 0,185, 1, 4, 0,186, 1, 4, 0,187, 1, - 4, 0,188, 1, 0, 0, 17, 0, 0, 0, 96, 1, 0, 0,189, 1, 0, 0, 16, 0, 66, 0, 5, 0, 4, 0,185, 1, 4, 0,186, 1, - 0, 0,190, 1, 0, 0, 17, 0, 2, 0, 16, 0, 71, 0, 2, 0, 4, 0,191, 1, 7, 0, 88, 1, 67, 0, 3, 0, 71, 0,192, 1, - 4, 0,193, 1, 4, 0, 16, 0, 65, 0, 4, 0, 7, 0,194, 1, 2, 0,195, 1, 0, 0, 16, 0, 0, 0, 96, 1, 68, 0, 4, 0, - 0, 0,137, 0, 0, 0,115, 0, 0, 0,116, 0, 0, 0,117, 0, 69, 0, 1, 0, 7, 0,196, 1, 72, 0, 6, 0, 72, 0, 0, 0, - 72, 0, 1, 0, 4, 0, 29, 0, 4, 0,193, 0, 0, 0, 34, 0, 0, 0,197, 1, 73, 0, 7, 0, 72, 0,198, 1, 2, 0,199, 1, - 2, 0,200, 1, 2, 0,201, 1, 2, 0, 55, 0, 9, 0,202, 1, 9, 0,203, 1, 74, 0, 3, 0, 72, 0,198, 1, 39, 0,105, 0, - 0, 0, 34, 0, 75, 0, 3, 0, 72, 0,198, 1, 39, 0,105, 0, 0, 0, 34, 0, 76, 0, 5, 0, 72, 0,198, 1, 7, 0,204, 1, - 7, 0,205, 1, 4, 0,206, 1, 4, 0,207, 1, 77, 0, 4, 0, 72, 0,198, 1, 2, 0,208, 1, 2, 0, 16, 0, 7, 0,209, 1, - 78, 0, 3, 0, 72, 0,198, 1, 7, 0,210, 1, 4, 0,211, 1, 79, 0, 12, 0, 72, 0,198, 1, 2, 0, 16, 0, 2, 0, 17, 0, - 7, 0,212, 1, 7, 0,213, 1, 7, 0,214, 1, 7, 0,121, 1, 7, 0,215, 1, 7, 0,216, 1, 7, 0,217, 1, 7, 0,218, 1, - 7, 0,219, 1, 80, 0, 5, 0, 72, 0,198, 1, 2, 0,220, 1, 2, 0, 69, 0, 4, 0, 48, 1, 39, 0,105, 0, 81, 0, 9, 0, - 72, 0,198, 1, 39, 0,105, 0, 7, 0,221, 1, 7, 0,222, 1, 7, 0,223, 1, 4, 0,224, 1, 4, 0,225, 1, 7, 0,226, 1, - 0, 0, 34, 0, 82, 0, 1, 0, 72, 0,198, 1, 83, 0, 4, 0, 72, 0,198, 1, 39, 0,105, 0, 4, 0,227, 1, 4, 0, 17, 0, - 84, 0, 23, 0, 24, 0, 18, 0, 2, 0, 97, 1, 2, 0, 98, 1, 2, 0,228, 1, 2, 0, 16, 0, 2, 0,229, 1, 2, 0,230, 1, - 2, 0,231, 1, 2, 0, 48, 1, 0, 0,232, 1, 0, 0,233, 1, 0, 0,234, 1, 0, 0, 29, 0, 4, 0, 17, 0, 7, 0,235, 1, - 7, 0,236, 1, 7, 0,237, 1, 7, 0,238, 1, 7, 0,239, 1, 7, 0,240, 1, 54, 0,241, 1, 27, 0, 42, 0, 29, 0,117, 1, - 85, 0, 3, 0, 85, 0, 0, 0, 85, 0, 1, 0, 0, 0, 34, 0, 51, 0, 1, 0, 7, 0,242, 1, 70, 0, 2, 0, 7, 0,243, 1, - 7, 0,112, 0, 86, 0, 4, 0, 2, 0, 22, 0, 2, 0,244, 1, 4, 0, 17, 0, 39, 0,245, 1, 39, 0, 95, 0, 24, 0, 18, 0, - 2, 0, 29, 0, 2, 0,246, 1, 4, 0,247, 1, 4, 0,248, 1, 4, 0,249, 1, 0, 0,250, 1, 9, 0,251, 1, 39, 0,252, 1, - 39, 0,253, 1, 27, 0, 42, 0, 59, 0,116, 1, 51, 0, 59, 1, 87, 0,254, 1, 88, 0,255, 1, 9, 0, 32, 0, 11, 0, 0, 2, - 11, 0,166, 1, 11, 0, 1, 2, 11, 0, 78, 1, 11, 0, 2, 2, 11, 0, 3, 2, 47, 0, 79, 1, 7, 0, 81, 1, 7, 0, 4, 2, - 7, 0, 5, 2, 7, 0,112, 0, 7, 0, 6, 2, 7, 0, 82, 1, 7, 0, 7, 2, 7, 0, 68, 1, 7, 0, 8, 2, 7, 0, 9, 2, - 7, 0,221, 1, 7, 0,142, 0, 4, 0,231, 0, 2, 0, 16, 0, 2, 0, 10, 2, 2, 0, 11, 2, 2, 0, 12, 2, 2, 0, 13, 2, - 2, 0, 14, 2, 2, 0, 15, 2, 2, 0, 16, 2, 2, 0, 17, 2, 2, 0, 18, 2, 2, 0, 19, 2, 2, 0, 20, 2, 2, 0, 21, 2, - 2, 0, 22, 2, 2, 0, 23, 2, 2, 0, 24, 2, 7, 0, 25, 2, 7, 0, 26, 2, 7, 0, 27, 2, 7, 0, 28, 2, 7, 0, 29, 2, - 7, 0, 30, 2, 7, 0, 31, 2, 7, 0, 32, 2, 7, 0, 33, 2, 0, 0, 34, 2, 0, 0, 35, 2, 0, 0, 80, 1, 0, 0, 36, 2, - 30, 0, 80, 0, 11, 0, 37, 2, 11, 0, 38, 2, 11, 0, 39, 2, 11, 0, 40, 2, 9, 0,177, 1, 7, 0, 41, 2, 2, 0, 42, 2, - 2, 0, 43, 2, 7, 0,162, 1, 4, 0, 44, 2, 4, 0, 45, 2, 2, 0, 46, 2, 2, 0,147, 0, 7, 0, 47, 2, 11, 0, 48, 2, - 11, 0, 49, 2, 11, 0, 50, 2, 89, 0, 51, 2, 90, 0, 52, 2, 91, 0, 53, 2, 86, 0, 54, 2, 86, 0, 55, 2, 2, 0, 56, 2, - 0, 0, 57, 2, 0, 0, 58, 2, 7, 0,181, 1, 92, 0, 59, 2, 93, 0, 60, 2, 93, 0, 61, 2, 94, 0, 14, 0, 94, 0, 0, 0, - 94, 0, 1, 0, 39, 0,252, 1, 7, 0,221, 1, 7, 0, 62, 2, 7, 0,222, 1, 7, 0,223, 1, 0, 0, 34, 0, 4, 0,224, 1, - 4, 0,225, 1, 4, 0, 63, 2, 2, 0, 29, 0, 2, 0, 64, 2, 7, 0,226, 1, 89, 0, 13, 0, 2, 0, 65, 2, 2, 0, 66, 2, - 2, 0, 16, 0, 2, 0, 17, 0, 7, 0, 67, 2, 7, 0, 68, 2, 7, 0, 69, 2, 7, 0, 70, 2, 7, 0, 71, 2, 7, 0, 72, 2, - 7, 0, 73, 2, 7, 0, 74, 2, 7, 0, 75, 2, 95, 0, 1, 0, 7, 0, 95, 1, 90, 0, 26, 0, 4, 0, 76, 2, 4, 0, 77, 2, - 96, 0, 78, 2, 97, 0, 79, 2, 7, 0, 26, 2, 7, 0, 80, 2, 7, 0, 81, 2, 7, 0, 82, 2, 7, 0, 83, 2, 7, 0, 84, 2, - 7, 0, 85, 2, 7, 0, 86, 2, 7, 0, 87, 2, 7, 0, 88, 2, 7, 0, 89, 2, 2, 0, 90, 2, 2, 0, 69, 0, 7, 0, 91, 2, - 7, 0, 92, 2, 2, 0,187, 0, 2, 0, 93, 2, 2, 0, 94, 2, 2, 0, 48, 1, 95, 0, 95, 2, 4, 0, 96, 2, 4, 0, 44, 0, - 92, 0, 26, 0, 2, 0, 29, 0, 2, 0, 97, 2, 2, 0, 98, 2, 2, 0, 99, 2, 7, 0,100, 2, 2, 0,101, 2, 2, 0,102, 2, - 7, 0,103, 2, 2, 0,104, 2, 2, 0,105, 2, 7, 0,106, 2, 7, 0,107, 2, 7, 0,108, 2, 7, 0,109, 2, 7, 0,110, 2, - 7, 0,111, 2, 4, 0,112, 2, 7, 0,113, 2, 7, 0,114, 2, 7, 0,115, 2, 63, 0,116, 2, 63, 0,117, 2, 63, 0,118, 2, - 0, 0,119, 2, 7, 0,120, 2, 7, 0,121, 2, 98, 0, 56, 0, 24, 0, 18, 0, 2, 0,114, 0, 2, 0,194, 0, 2, 0,215, 0, - 2, 0,122, 2, 7, 0,123, 2, 7, 0,124, 2, 7, 0,125, 2, 7, 0,126, 2, 7, 0,127, 2, 7, 0,128, 2, 7, 0,129, 2, - 7, 0,130, 2, 7, 0,238, 0, 7, 0,240, 0, 7, 0,239, 0, 7, 0,131, 2, 4, 0,132, 2, 7, 0,133, 2, 7, 0,134, 2, - 7, 0,135, 2, 7, 0,136, 2, 7, 0,137, 2, 7, 0,138, 2, 7, 0,139, 2, 2, 0,140, 2, 2, 0,193, 0, 4, 0,141, 2, - 7, 0,142, 2, 7, 0,143, 2, 7, 0,144, 2, 7, 0,145, 2, 7, 0,146, 2, 7, 0,147, 2, 7, 0,148, 2, 7, 0,149, 2, - 7, 0,150, 2, 7, 0,151, 2, 7, 0,152, 2, 7, 0,153, 2, 2, 0,154, 2, 2, 0,155, 2, 2, 0,156, 2, 2, 0,157, 2, - 7, 0,158, 2, 7, 0,159, 2, 7, 0,160, 2, 7, 0,161, 2, 2, 0,162, 2, 2, 0,163, 2, 2, 0,164, 2, 2, 0,165, 2, - 7, 0,166, 2, 27, 0, 42, 0, 38, 0,230, 0, 30, 0, 80, 0, 99, 0, 16, 0, 2, 0,167, 2, 2, 0,168, 2, 2, 0,169, 2, - 2, 0, 16, 0, 2, 0,170, 2, 2, 0,171, 2, 2, 0,172, 2, 2, 0,173, 2, 2, 0,174, 2, 2, 0,175, 2, 2, 0,176, 2, - 2, 0,177, 2, 4, 0,178, 2, 7, 0,179, 2, 7, 0,180, 2, 7, 0,181, 2,100, 0, 8, 0,100, 0, 0, 0,100, 0, 1, 0, - 4, 0,231, 0, 4, 0,182, 2, 4, 0, 16, 0, 2, 0,183, 2, 2, 0,184, 2, 39, 0,105, 0,101, 0, 13, 0, 9, 0,185, 2, - 9, 0,186, 2, 4, 0,187, 2, 4, 0,188, 2, 4, 0,189, 2, 4, 0,190, 2, 4, 0,191, 2, 4, 0,192, 2, 4, 0,193, 2, - 4, 0,194, 2, 4, 0,195, 2, 4, 0, 17, 0, 0, 0,196, 2,102, 0, 5, 0, 9, 0,197, 2, 9, 0,198, 2, 4, 0,199, 2, - 4, 0, 48, 1, 0, 0,200, 2,103, 0, 4, 0, 4, 0,201, 2, 7, 0,202, 2, 2, 0, 16, 0, 2, 0,203, 2,104, 0, 98, 0, -101, 0,204, 2,102, 0,205, 2, 2, 0,206, 2, 2, 0,187, 0, 2, 0, 93, 2, 2, 0,207, 2, 2, 0,208, 2, 2, 0, 16, 0, - 7, 0, 26, 2, 7, 0,209, 2, 7, 0,210, 2, 7, 0,211, 2, 7, 0,212, 2, 7, 0,213, 2, 2, 0,214, 2, 2, 0,215, 2, - 2, 0,216, 2, 2, 0,217, 2, 2, 0,146, 0, 2, 0,218, 2, 2, 0,219, 2, 2, 0,220, 2, 2, 0,221, 2, 2, 0,222, 2, - 2, 0,223, 2, 2, 0, 17, 0, 2, 0, 66, 0, 2, 0,224, 2, 2, 0,225, 2, 2, 0,226, 2, 2, 0,227, 2, 2, 0,228, 2, - 2, 0,229, 2, 2, 0,230, 2, 23, 0,231, 2, 23, 0,232, 2, 2, 0,233, 2, 2, 0,234, 2, 2, 0,235, 2, 2, 0,236, 2, - 2, 0,237, 2, 2, 0,238, 2, 4, 0,193, 0, 2, 0,239, 2, 2, 0,240, 2, 2, 0,241, 2, 2, 0,242, 2, 2, 0,243, 2, - 2, 0,244, 2, 2, 0,245, 2, 2, 0,246, 2, 2, 0,247, 2, 7, 0,181, 2, 7, 0,248, 2, 7, 0,249, 2, 7, 0,250, 2, - 7, 0,251, 2, 7, 0,252, 2, 7, 0,253, 2, 7, 0,254, 2, 7, 0,255, 2, 7, 0, 0, 3, 7, 0, 1, 3, 7, 0, 2, 3, - 7, 0, 3, 3, 7, 0, 4, 3, 2, 0, 5, 3, 2, 0, 6, 3, 2, 0, 7, 3, 2, 0, 8, 3, 2, 0, 9, 3, 2, 0, 10, 3, - 2, 0, 11, 3, 2, 0, 12, 3, 2, 0, 13, 3, 2, 0, 14, 3, 4, 0, 15, 3, 4, 0, 16, 3, 4, 0, 17, 3, 4, 0, 18, 3, - 4, 0, 19, 3, 7, 0, 20, 3, 4, 0, 21, 3, 4, 0, 22, 3, 4, 0, 23, 3, 4, 0, 24, 3, 7, 0, 25, 3, 7, 0, 26, 3, - 7, 0, 27, 3, 7, 0, 28, 3, 7, 0, 29, 3, 7, 0, 30, 3, 7, 0, 31, 3, 7, 0, 32, 3, 7, 0, 33, 3, 0, 0, 34, 3, - 0, 0, 35, 3, 0, 0, 36, 3,105, 0, 5, 0, 7, 0, 37, 3, 0, 0, 29, 0, 0, 0, 69, 0, 0, 0, 48, 1, 0, 0, 39, 1, -106, 0, 5, 0,106, 0, 0, 0,106, 0, 1, 0, 4, 0, 38, 3, 0, 0, 39, 3, 4, 0, 16, 0,107, 0, 13, 0, 2, 0, 40, 3, - 2, 0, 41, 3, 2, 0, 42, 3, 2, 0, 43, 3, 2, 0, 44, 3, 2, 0, 69, 0, 7, 0, 45, 3, 7, 0, 46, 3, 2, 0, 47, 3, - 2, 0, 48, 3, 2, 0, 49, 3, 0, 0, 48, 1, 0, 0, 39, 1,108, 0, 31, 0, 24, 0, 18, 0, 39, 0, 50, 3, 98, 0, 51, 3, -108, 0, 52, 3, 35, 0,140, 0, 11, 0, 53, 3,100, 0, 54, 3,109, 0, 55, 3, 7, 0, 56, 3, 7, 0, 57, 3, 7, 0, 58, 3, - 7, 0, 59, 3, 4, 0,231, 0, 2, 0, 60, 3, 2, 0, 17, 0, 2, 0, 61, 3, 2, 0, 62, 3, 7, 0, 63, 3, 9, 0, 64, 3, - 99, 0, 65, 3, 9, 0,177, 1,105, 0, 66, 3,107, 0, 67, 3,104, 0,115, 0,103, 0, 68, 3, 30, 0, 80, 0, 11, 0, 69, 3, -110, 0, 70, 3, 2, 0, 71, 3, 2, 0, 72, 3, 4, 0, 73, 3,111, 0, 10, 0, 35, 0,140, 0, 40, 0,106, 0, 7, 0,132, 1, - 7, 0,133, 1, 7, 0, 66, 0, 7, 0, 74, 3, 7, 0, 75, 3, 2, 0, 76, 3, 2, 0, 77, 3, 4, 0, 78, 3,112, 0, 53, 0, -113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 7, 0, 83, 3, 7, 0, 84, 3, - 7, 0, 85, 3, 7, 0, 86, 3, 7, 0, 87, 3, 7, 0, 88, 3, 7, 0, 89, 3, 7, 0,196, 0, 2, 0, 90, 3, 2, 0, 91, 3, - 39, 0, 50, 3,111, 0, 92, 3,112, 0, 93, 3, 2, 0,169, 2, 2, 0, 94, 3, 4, 0,231, 0, 4, 0, 95, 3, 2, 0, 96, 3, - 2, 0, 97, 3, 2, 0, 98, 3, 2, 0, 16, 0, 7, 0, 72, 0, 7, 0, 99, 3, 7, 0,100, 3, 7, 0,101, 3, 7, 0,102, 3, - 7, 0,103, 3, 7, 0,111, 0, 7, 0, 56, 3, 2, 0,104, 3, 2, 0,105, 3, 2, 0,106, 3, 2, 0,107, 3, 2, 0,108, 3, - 2, 0,109, 3, 2, 0,110, 3, 2, 0,111, 3, 2, 0,112, 3, 2, 0,113, 3, 7, 0,114, 3, 7, 0,115, 3, 51, 0,116, 3, - 11, 0,117, 3, 2, 0,118, 3, 2, 0,163, 1, 2, 0,119, 3, 2, 0, 48, 1,115, 0, 16, 0, 23, 0, 22, 0, 23, 0, 24, 0, - 22, 0,120, 3, 22, 0,121, 3, 22, 0,122, 3, 7, 0,123, 3, 7, 0,124, 3, 7, 0,125, 3, 7, 0,126, 3, 2, 0,127, 3, - 2, 0,128, 3, 2, 0,129, 3, 2, 0,130, 3, 2, 0,131, 3, 2, 0,132, 3, 4, 0, 16, 0,113, 0, 6, 0,113, 0, 0, 0, -113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,116, 0, 6, 0,113, 0, 0, 0,113, 0, 1, 0, - 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,117, 0, 26, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, - 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 4, 0,133, 3, 4, 0, 48, 1,115, 0,134, 3, 9, 0,135, 3, 11, 0,136, 3, - 27, 0, 42, 0, 24, 0, 43, 0, 0, 0,137, 3, 0, 0,138, 3, 2, 0,139, 3, 2, 0,140, 3, 2, 0,141, 3, 2, 0,142, 3, - 2, 0, 26, 0, 2, 0, 25, 0, 2, 0,108, 3, 2, 0,143, 3, 4, 0, 16, 0, 7, 0,144, 3, 23, 0, 22, 0,118, 0, 31, 0, -113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 2, 0,145, 3, 2, 0,146, 3, - 2, 0,147, 3, 2, 0,148, 3,115, 0,134, 3, 2, 0,149, 3, 2, 0,108, 3, 2, 0,140, 3, 2, 0,150, 3, 9, 0,151, 3, - 2, 0,109, 3, 0, 0,152, 3, 0, 0,153, 3, 2, 0,154, 3, 2, 0,155, 3, 4, 0, 78, 3, 2, 0,156, 3, 2, 0,157, 3, - 2, 0,158, 3, 2, 0, 18, 2, 2, 0,159, 3, 2, 0, 69, 0, 4, 0,160, 3, 0, 0,215, 0, 0, 0,161, 3,119, 0, 10, 0, -113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 2, 0,149, 3, - 2, 0, 74, 3, 4, 0, 48, 1,120, 0, 24, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, - 2, 0, 82, 3,121, 0,162, 3, 4, 0,163, 3, 0, 0,164, 3, 0, 0,165, 3, 0, 0,166, 3, 2, 0, 29, 0, 2, 0,167, 3, - 2, 0, 16, 0, 2, 0,168, 3, 2, 0,169, 3, 2, 0,170, 3,122, 0,171, 3, 2, 0,172, 3, 2, 0,138, 0, 2, 0,173, 3, - 2, 0,174, 3, 9, 0,175, 3, 2, 0,176, 3,123, 0, 19, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3, -114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 11, 0,177, 3, 2, 0,140, 3, 2, 0,178, 3, 2, 0, 16, 0, 2, 0,157, 1, - 9, 0,151, 3, 11, 0,179, 3,124, 0,180, 3, 2, 0, 29, 0, 2, 0,181, 3, 2, 0,182, 3, 2, 0,183, 3,125, 0, 17, 0, -113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 35, 0,184, 3, - 7, 0, 74, 3, 2, 0,193, 0, 2, 0,108, 3, 2, 0,185, 3, 2, 0,186, 3, 7, 0,132, 1, 7, 0,133, 1, 2, 0, 16, 0, - 2, 0,143, 3,126, 0, 10, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, - 2, 0,108, 3, 2, 0,143, 3, 4, 0, 17, 0,115, 0,134, 3,127, 0, 22, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, - 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3, 32, 0,187, 3, 4, 0,188, 3, 4, 0,189, 3, 2, 0, 55, 0, 2, 0,108, 3, - 4, 0,190, 3, 4, 0,191, 3, 4, 0,192, 3, 4, 0,193, 3, 4, 0,194, 3, 4, 0,195, 3, 4, 0,196, 3, 4, 0,197, 3, - 7, 0,198, 3, 22, 0,199, 3, 22, 0,200, 3,128, 0, 9, 0,113, 0, 0, 0,113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3, -114, 0, 81, 3,129, 0,201, 3, 4, 0, 48, 1, 2, 0, 55, 0, 2, 0,108, 3,130, 0, 8, 0,113, 0, 0, 0,113, 0, 1, 0, - 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3,115, 0,134, 3, 4, 0, 16, 0, 4, 0,202, 3,131, 0, 81, 0,113, 0, 0, 0, -113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 0, 0,203, 3, 4, 0,204, 3, 2, 0,193, 0, 2, 0,205, 3, - 2, 0,206, 3, 2, 0,207, 3, 2, 0,208, 3, 2, 0,209, 3, 2, 0,210, 3, 2, 0,211, 3, 2, 0,212, 3, 2, 0,213, 3, - 2, 0,214, 3, 2, 0,215, 3, 2, 0,216, 3, 2, 0,217, 3, 2, 0,218, 3, 2, 0,219, 3, 2, 0,220, 3, 2, 0,221, 3, - 2, 0,222, 3, 2, 0,223, 3, 2, 0,224, 3, 2, 0,225, 3, 2, 0,226, 3, 2, 0,227, 3, 2, 0,228, 3, 2, 0,229, 3, - 2, 0,230, 3, 2, 0,231, 3, 2, 0,232, 3, 2, 0,233, 3, 2, 0,234, 3, 2, 0,235, 3, 2, 0,236, 3, 2, 0,237, 3, - 2, 0,238, 3, 2, 0,239, 3, 2, 0,240, 3, 2, 0,241, 3, 2, 0,242, 3, 2, 0,243, 3, 2, 0,244, 3, 2, 0,245, 3, - 2, 0,246, 3, 2, 0,247, 3, 2, 0,248, 3, 2, 0,249, 3, 2, 0,250, 3, 2, 0,251, 3, 0, 0,252, 3, 0, 0,253, 3, - 0, 0,254, 3, 0, 0,255, 3,132, 0, 0, 4,132, 0, 1, 4, 4, 0, 2, 4, 4, 0, 3, 4, 4, 0, 4, 4, 4, 0, 5, 4, - 4, 0, 6, 4, 7, 0, 7, 4, 7, 0, 8, 4, 7, 0, 9, 4, 2, 0, 10, 4, 2, 0, 11, 4, 2, 0, 12, 4, 2, 0, 13, 4, -133, 0, 14, 4,133, 0, 15, 4, 2, 0, 16, 4, 2, 0, 17, 4, 4, 0, 48, 1, 37, 0, 18, 4, 9, 0,175, 3, 9, 0, 19, 4, -134, 0, 19, 0, 0, 0, 20, 4, 0, 0, 21, 4, 0, 0, 22, 4, 0, 0, 23, 4, 0, 0, 24, 4, 0, 0, 25, 4, 0, 0, 26, 4, - 0, 0, 27, 4, 0, 0, 28, 4, 0, 0, 29, 4, 0, 0, 30, 4, 0, 0, 31, 4, 0, 0, 32, 4, 0, 0, 33, 4, 0, 0, 34, 4, - 0, 0, 35, 4, 0, 0, 36, 4, 0, 0, 37, 4, 0, 0, 38, 4,135, 0, 36, 0, 0, 0, 39, 4, 0, 0, 30, 4, 0, 0, 31, 4, - 0, 0, 40, 4, 0, 0, 41, 4, 0, 0, 42, 4, 0, 0, 43, 4, 0, 0, 44, 4, 0, 0, 45, 4, 0, 0, 46, 4, 0, 0, 47, 4, - 0, 0, 48, 4, 0, 0, 49, 4, 0, 0, 50, 4, 0, 0, 51, 4, 0, 0, 52, 4, 0, 0, 53, 4, 0, 0, 54, 4, 0, 0, 55, 4, - 0, 0, 56, 4, 0, 0, 57, 4, 0, 0, 58, 4, 0, 0, 59, 4, 0, 0, 60, 4, 0, 0, 61, 4, 0, 0, 62, 4, 0, 0, 63, 4, - 0, 0, 64, 4, 0, 0, 65, 4, 0, 0, 66, 4, 0, 0, 67, 4, 0, 0, 68, 4, 0, 0, 69, 4, 0, 0, 70, 4, 0, 0, 71, 4, - 0, 0, 72, 4,136, 0, 18, 0,136, 0, 0, 0,136, 0, 1, 0, 0, 0, 34, 0,134, 0, 73, 4,135, 0, 74, 4,135, 0, 75, 4, -135, 0, 76, 4,135, 0, 77, 4,135, 0, 78, 4,135, 0, 79, 4,135, 0, 80, 4,135, 0, 81, 4,135, 0, 82, 4,135, 0, 83, 4, -135, 0, 84, 4,135, 0, 85, 4,135, 0, 86, 4,135, 0, 87, 4,137, 0, 5, 0, 4, 0, 16, 0, 4, 0, 17, 0, 7, 0,162, 1, - 7, 0, 88, 4, 7, 0, 95, 1,138, 0, 45, 0, 4, 0, 16, 0, 4, 0, 89, 4, 4, 0, 90, 4, 0, 0, 91, 4, 0, 0, 92, 4, - 0, 0, 93, 4, 0, 0, 94, 4, 0, 0, 95, 4, 0, 0, 96, 4, 0, 0, 97, 4, 0, 0, 98, 4, 0, 0, 99, 4, 2, 0,100, 4, - 2, 0,101, 4, 4, 0,102, 4, 4, 0,103, 4, 4, 0,104, 4, 4, 0,105, 4, 2, 0,106, 4, 2, 0,107, 4, 2, 0,108, 4, - 2, 0,109, 4, 4, 0,110, 4, 4, 0,111, 4, 2, 0,112, 4, 2, 0,113, 4, 2, 0,114, 4, 2, 0,115, 4, 0, 0,116, 4, - 11, 0,117, 4, 2, 0,118, 4, 2, 0,119, 4, 2, 0,120, 4, 2, 0,121, 4,137, 0,122, 4, 2, 0,123, 4, 2, 0,124, 4, - 2, 0,125, 4, 2, 0,126, 4, 4, 0,127, 4, 4, 0,128, 4, 2, 0,129, 4, 2, 0, 69, 0, 2, 0, 48, 1, 2, 0, 39, 1, -139, 0, 18, 0, 24, 0, 18, 0, 11, 0,130, 4, 11, 0,131, 4, 11, 0,132, 4,108, 0,133, 4, 2, 0,212, 1, 2, 0,134, 4, - 2, 0,213, 1, 2, 0,135, 4, 2, 0,136, 4, 2, 0,137, 4, 2, 0,138, 4, 2, 0,139, 4, 2, 0,140, 4, 2, 0, 17, 0, - 2, 0,141, 4, 2, 0,142, 4, 2, 0,143, 4,140, 0, 5, 0,140, 0, 0, 0,140, 0, 1, 0,140, 0,144, 4, 12, 0,145, 4, - 4, 0, 16, 0,141, 0, 7, 0,141, 0, 0, 0,141, 0, 1, 0,140, 0,146, 4,140, 0,147, 4, 2, 0,232, 2, 2, 0, 16, 0, - 4, 0, 17, 0,142, 0, 16, 0,142, 0, 0, 0,142, 0, 1, 0, 0, 0,148, 4, 0, 0,149, 4, 2, 0,150, 4, 2, 0,151, 4, - 2, 0,136, 4, 2, 0,137, 4, 2, 0, 16, 0, 2, 0, 64, 2, 2, 0,152, 4, 2, 0, 17, 0, 2, 0,153, 4, 2, 0,154, 4, - 4, 0,155, 4,142, 0,156, 4,114, 0, 30, 0,114, 0, 0, 0,114, 0, 1, 0,140, 0,146, 4,140, 0,147, 4,140, 0,157, 4, -140, 0,158, 4,139, 0,159, 4, 7, 0,160, 4, 22, 0,152, 1, 22, 0,161, 4, 22, 0,162, 4, 2, 0,163, 4, 2, 0,164, 4, - 2, 0,165, 4, 0, 0, 79, 3, 0, 0,166, 4, 2, 0,167, 4, 2, 0,168, 4, 0, 0,169, 4, 0, 0,170, 4, 0, 0,171, 4, - 0, 0,172, 4, 2, 0,173, 4, 2, 0,174, 4, 2, 0,175, 4, 2, 0, 16, 0, 30, 0, 80, 0, 11, 0,176, 4, 11, 0,177, 4, - 11, 0,178, 4,143, 0, 7, 0, 9, 0,179, 4, 9, 0,180, 4, 2, 0,181, 4, 2, 0,233, 2, 4, 0,182, 4, 4, 0,183, 4, - 4, 0, 17, 0,144, 0, 8, 0, 0, 0,184, 4, 37, 0, 82, 0,144, 0,185, 4,144, 0,186, 4,144, 0,187, 4, 2, 0, 84, 0, - 2, 0,188, 4, 4, 0, 17, 0,145, 0, 11, 0,145, 0, 0, 0,145, 0, 1, 0, 2, 0,157, 1, 2, 0, 52, 0, 2, 0, 15, 0, - 2, 0,189, 4,144, 0,190, 4, 0, 0,165, 3, 2, 0,191, 4, 2, 0,192, 4, 4, 0, 17, 0,146, 0, 10, 0, 0, 0, 57, 1, - 9, 0,125, 0, 0, 0,126, 0, 4, 0,129, 0, 4, 0,136, 0, 9, 0,130, 0, 7, 0,132, 0, 7, 0,133, 0, 9, 0,134, 0, - 9, 0,135, 0,147, 0, 38, 0,147, 0, 0, 0,147, 0, 1, 0,147, 0,193, 4, 9, 0, 13, 0, 0, 0, 14, 0, 2, 0, 16, 0, - 2, 0, 29, 0, 4, 0, 52, 0, 4, 0,204, 1, 4, 0,194, 4, 4, 0,195, 4, 4, 0,196, 4, 4, 0,197, 4, 4, 0,198, 4, - 4, 0,146, 0, 4, 0,199, 4, 4, 0,200, 4, 7, 0,201, 4, 7, 0,202, 4, 4, 0,187, 0,145, 0,203, 4,144, 0,204, 4, - 27, 0, 42, 0,108, 0,133, 4, 36, 0, 81, 0, 7, 0,205, 4, 7, 0,206, 4,146, 0,189, 0,147, 0,207, 4,147, 0,208, 4, -147, 0,209, 4, 11, 0,210, 4,148, 0,211, 4, 7, 0,212, 4, 7, 0,213, 4, 4, 0,214, 4, 7, 0,215, 4, 9, 0,216, 4, -149, 0, 4, 0,149, 0, 0, 0,149, 0, 1, 0, 11, 0,217, 4,147, 0,218, 4,150, 0, 6, 0, 11, 0,219, 4, 11, 0,210, 4, - 11, 0,220, 4, 2, 0, 16, 0, 2, 0,157, 1, 4, 0, 17, 0,151, 0, 4, 0, 7, 0,221, 4, 7, 0,222, 4, 2, 0,223, 4, - 2, 0,224, 4,152, 0, 6, 0, 7, 0,225, 4, 7, 0,226, 4, 7, 0,227, 4, 7, 0,228, 4, 4, 0,229, 4, 4, 0,230, 4, -153, 0, 6, 0,153, 0, 0, 0,153, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,157, 1,154, 0, 8, 0, -154, 0, 0, 0,154, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,157, 1, 7, 0, 52, 0, 7, 0,187, 0, -155, 0, 41, 0,155, 0, 0, 0,155, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, 2, 0,143, 0, 2, 0, 90, 2, - 2, 0,232, 4, 7, 0,233, 4, 7, 0,234, 4, 7, 0,219, 1, 4, 0,235, 4, 4, 0, 44, 0, 4, 0,207, 1, 7, 0,236, 4, - 7, 0,237, 4, 7, 0,238, 4, 7, 0,239, 4, 7, 0,240, 4, 7, 0,241, 4, 7, 0,217, 1, 7, 0,184, 0, 7, 0,242, 4, - 7, 0,243, 4, 7, 0,244, 4, 7, 0,245, 4, 2, 0,246, 4, 2, 0,247, 4, 2, 0,248, 4, 2, 0,249, 4, 2, 0,250, 4, - 2, 0,251, 4, 2, 0,252, 4, 2, 0,253, 4, 2, 0,254, 4, 2, 0,255, 4, 2, 0, 78, 1, 2, 0, 0, 5, 0, 0, 1, 5, - 0, 0, 2, 5,156, 0, 3, 5,157, 0, 16, 0,157, 0, 0, 0,157, 0, 1, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,231, 4, - 2, 0,143, 0, 7, 0,212, 1, 7, 0,213, 1, 7, 0,214, 1, 7, 0,121, 1, 7, 0,215, 1, 7, 0,216, 1, 7, 0, 4, 5, - 7, 0,217, 1, 7, 0,218, 1, 7, 0,219, 1,158, 0, 5, 0, 2, 0, 29, 0, 2, 0,188, 4, 2, 0, 16, 0, 2, 0, 5, 5, - 24, 0, 6, 5,124, 0, 3, 0, 4, 0, 31, 0, 4, 0, 7, 5,158, 0, 32, 0,159, 0, 12, 0,159, 0, 0, 0,159, 0, 1, 0, - 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 34, 2, 2, 0, 94, 1, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 8, 5, 7, 0, 9, 5, - 24, 0, 6, 5, 11, 0, 10, 5,160, 0, 11, 0,160, 0, 0, 0,160, 0, 1, 0, 0, 0, 34, 0, 2, 0, 29, 0, 2, 0, 11, 5, - 4, 0, 12, 5, 4, 0, 13, 5, 2, 0, 16, 0, 2, 0, 17, 0, 9, 0, 14, 5, 9, 0, 15, 5,161, 0, 5, 0, 0, 0, 34, 0, - 7, 0,196, 0, 7, 0, 16, 5, 4, 0, 17, 5, 4, 0, 17, 0,162, 0, 4, 0, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 69, 0, - 2, 0, 48, 1,163, 0, 4, 0, 0, 0, 34, 0, 47, 0, 18, 5, 7, 0,196, 0, 7, 0, 17, 0,164, 0, 6, 0, 2, 0, 19, 5, - 2, 0, 20, 5, 2, 0, 29, 0, 2, 0, 21, 5, 0, 0, 22, 5, 0, 0, 23, 5,165, 0, 5, 0, 4, 0, 29, 0, 4, 0, 17, 0, - 0, 0, 34, 0, 0, 0, 24, 5, 0, 0, 25, 5,166, 0, 6, 0, 0, 0, 34, 0, 0, 0, 26, 5, 2, 0, 27, 5, 2, 0,217, 1, - 2, 0,193, 0, 2, 0, 48, 1,167, 0, 5, 0, 0, 0, 34, 0, 7, 0,222, 4, 7, 0,135, 2, 2, 0, 16, 0, 2, 0,208, 1, -168, 0, 3, 0, 0, 0, 34, 0, 4, 0,207, 1, 4, 0, 28, 5,169, 0, 7, 0, 0, 0, 34, 0, 7, 0,135, 2, 0, 0, 29, 5, - 0, 0, 30, 5, 2, 0,193, 0, 2, 0, 69, 0, 4, 0, 31, 5,170, 0, 3, 0, 39, 0, 32, 5, 0, 0, 33, 5, 0, 0, 34, 5, -171, 0, 17, 0,171, 0, 0, 0,171, 0, 1, 0, 2, 0, 29, 0, 2, 0, 11, 5, 2, 0, 16, 0, 2, 0, 35, 5, 2, 0, 36, 5, - 2, 0, 37, 5, 2, 0, 69, 0, 2, 0, 48, 1, 0, 0, 34, 0, 9, 0, 32, 0,172, 0, 38, 5, 39, 0,149, 1, 2, 0, 39, 5, - 2, 0, 40, 5, 4, 0, 17, 0,173, 0, 10, 0, 0, 0, 34, 0, 2, 0, 29, 0, 2, 0, 17, 0, 4, 0,208, 1, 4, 0, 41, 5, - 4, 0, 42, 5, 4, 0, 43, 5, 4, 0, 44, 5, 4, 0, 45, 5, 4, 0, 46, 5,174, 0, 1, 0, 0, 0, 47, 5,175, 0, 1, 0, - 32, 0,187, 3,172, 0, 18, 0,172, 0, 0, 0,172, 0, 1, 0,172, 0, 48, 5, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0, 49, 5, - 2, 0, 37, 5, 2, 0, 11, 5, 2, 0, 50, 5, 2, 0, 48, 1, 2, 0, 39, 1, 0, 0, 34, 0, 9, 0, 32, 0,176, 0, 38, 5, -171, 0, 51, 5, 2, 0, 52, 5, 2, 0, 53, 5, 4, 0, 24, 1,177, 0, 3, 0, 4, 0, 54, 5, 4, 0, 17, 0, 39, 0,149, 1, -178, 0, 13, 0, 87, 0, 55, 5, 2, 0, 29, 0, 2, 0, 16, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 34, 0, 2, 0, 56, 5, - 2, 0, 57, 5, 7, 0, 58, 5, 2, 0, 59, 5, 2, 0, 99, 0, 2, 0,100, 0, 2, 0, 60, 5,179, 0, 9, 0, 2, 0, 16, 0, - 2, 0, 61, 5, 2, 0,233, 4, 2, 0,234, 4,148, 0,211, 4, 2, 0, 29, 0, 2, 0, 62, 5, 2, 0, 63, 5, 2, 0, 64, 5, -180, 0, 7, 0, 2, 0, 16, 0, 2, 0, 61, 5, 2, 0,233, 4, 2, 0,234, 4, 2, 0, 29, 0, 2, 0, 65, 5, 7, 0, 66, 5, -181, 0, 9, 0, 4, 0, 54, 5, 2, 0, 29, 0, 2, 0, 16, 0, 39, 0,149, 1, 63, 0, 67, 5, 0, 0, 34, 0, 7, 0, 68, 5, - 2, 0, 69, 5, 2, 0, 17, 0,182, 0, 5, 0, 2, 0, 29, 0, 2, 0, 16, 0, 4, 0, 17, 0,108, 0,133, 4, 39, 0, 50, 3, -183, 0, 5, 0, 4, 0, 16, 0, 4, 0, 29, 0, 0, 0, 34, 0, 0, 0, 24, 5, 39, 0,149, 1,184, 0, 12, 0, 4, 0, 16, 0, - 4, 0, 29, 0, 7, 0, 70, 5, 7, 0, 71, 5, 7, 0, 81, 1, 7, 0, 82, 1, 7, 0, 4, 2, 7, 0, 7, 2, 7, 0, 72, 5, - 7, 0, 73, 5, 7, 0, 74, 5, 0, 0, 75, 5,185, 0, 9, 0, 2, 0, 16, 0, 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4, - 0, 0, 34, 0, 2, 0, 69, 0, 2, 0, 24, 0, 2, 0, 76, 5, 2, 0, 77, 5,186, 0, 8, 0, 39, 0,149, 1, 7, 0,214, 1, - 7, 0, 78, 5, 7, 0,244, 1, 7, 0, 79, 5, 2, 0, 16, 0, 2, 0,208, 1, 7, 0, 80, 5,187, 0, 7, 0, 2, 0, 16, 0, - 2, 0,217, 1, 7, 0, 81, 5, 7, 0, 82, 5, 7, 0, 83, 5, 7, 0, 84, 5, 7, 0, 85, 5,188, 0, 10, 0, 2, 0, 16, 0, - 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 34, 0, 2, 0, 69, 0, 2, 0, 24, 0, 2, 0, 76, 5, 2, 0, 77, 5, -109, 0, 55, 3,189, 0, 7, 0, 4, 0,207, 1, 4, 0, 86, 5, 4, 0, 87, 5, 4, 0, 88, 5, 7, 0, 89, 5, 7, 0, 90, 5, - 0, 0, 29, 5,190, 0, 7, 0, 0, 0, 91, 5, 39, 0, 92, 5, 0, 0, 33, 5, 2, 0, 93, 5, 2, 0, 69, 0, 4, 0, 48, 1, - 0, 0, 34, 5,191, 0, 6, 0, 2, 0, 16, 0, 2, 0, 29, 0, 2, 0,233, 4, 2, 0,234, 4, 0, 0, 94, 5, 0, 0, 95, 5, -192, 0, 1, 0, 4, 0, 16, 0,176, 0, 10, 0,176, 0, 0, 0,176, 0, 1, 0,176, 0, 48, 5, 2, 0, 29, 0, 2, 0, 16, 0, - 2, 0, 11, 5, 2, 0, 96, 5, 0, 0, 34, 0, 9, 0, 32, 0, 39, 0,149, 1,193, 0, 10, 0, 7, 0, 27, 2, 7, 0, 97, 5, - 7, 0, 98, 5, 7, 0, 99, 5, 7, 0,100, 5, 4, 0, 16, 0, 7, 0,101, 5, 7, 0,102, 5, 7, 0,103, 5, 7, 0, 17, 0, -148, 0, 22, 0, 24, 0, 18, 0, 0, 0, 21, 0,194, 0,104, 5, 9, 0,105, 5, 33, 0, 95, 0, 33, 0,106, 5, 9, 0,107, 5, - 27, 0, 42, 0, 7, 0, 66, 5, 7, 0,108, 5, 7, 0,109, 5, 7, 0,110, 5, 7, 0,111, 5, 7, 0,112, 5, 7, 0,113, 5, - 4, 0, 55, 0, 4, 0,114, 5, 4, 0,115, 5, 4, 0,116, 5, 0, 0,117, 5, 0, 0,118, 5, 0, 0,119, 5,195, 0, 6, 0, - 24, 0, 18, 0, 7, 0,120, 5, 7, 0,121, 5, 7, 0,122, 5, 2, 0,123, 5, 2, 0,124, 5,196, 0, 14, 0,113, 0, 0, 0, -113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3,115, 0,134, 3,148, 0,211, 4, 2, 0,193, 0, 2, 0, 61, 5, - 2, 0,132, 1, 2, 0,133, 1, 2, 0, 16, 0, 2, 0,143, 3, 4, 0, 48, 1,197, 0, 6, 0,197, 0, 0, 0,197, 0, 1, 0, - 2, 0,187, 0, 2, 0, 93, 2, 7, 0,206, 2, 0, 0, 34, 0,198, 0, 31, 0,198, 0, 0, 0,198, 0, 1, 0,197, 0,125, 5, - 2, 0,246, 1, 2, 0, 17, 0, 4, 0,247, 1, 4, 0,248, 1, 4, 0,249, 1, 39, 0,252, 1, 39, 0,253, 1, 27, 0, 42, 0, - 7, 0, 81, 1, 7, 0, 4, 2, 7, 0, 5, 2, 7, 0,112, 0, 7, 0, 6, 2, 7, 0, 82, 1, 7, 0, 7, 2, 7, 0, 68, 1, - 7, 0, 8, 2, 7, 0, 9, 2, 7, 0,221, 1, 7, 0,142, 0, 4, 0,231, 0, 0, 0, 11, 2, 0, 0, 12, 2, 0, 0, 13, 2, - 0, 0, 14, 2, 7, 0, 25, 2, 7, 0, 26, 2, 7, 0,126, 5,199, 0, 4, 0,199, 0, 0, 0,199, 0, 1, 0, 39, 0,149, 1, - 11, 0,127, 5,109, 0, 4, 0, 24, 0, 18, 0, 11, 0,128, 5, 11, 0,129, 5,197, 0,130, 5,200, 0, 25, 0,200, 0, 0, 0, -200, 0, 1, 0,200, 0,252, 1, 11, 0,131, 5, 0, 0, 34, 0, 7, 0,132, 5, 7, 0,133, 5, 7, 0,134, 5, 7, 0,135, 5, - 4, 0, 16, 0, 7, 0,136, 5, 7, 0,137, 5, 7, 0,138, 5, 7, 0,196, 0, 7, 0, 88, 1, 7, 0,139, 5, 7, 0,205, 1, - 7, 0,140, 5, 7, 0,141, 5, 7, 0,142, 5, 7, 0,143, 5, 7, 0,144, 5, 7, 0,112, 0, 2, 0,145, 5, 2, 0, 47, 3, -201, 0, 8, 0, 24, 0, 18, 0, 11, 0,146, 5, 11, 0,147, 5, 4, 0, 16, 0, 4, 0,169, 2, 4, 0,220, 1, 2, 0,148, 5, - 2, 0,149, 5,202, 0, 29, 0,202, 0, 0, 0,202, 0, 1, 0, 11, 0, 48, 2, 0, 0, 34, 0, 2, 0, 16, 0, 2, 0,150, 5, - 2, 0,151, 5, 2, 0,119, 1, 2, 0, 16, 2, 2, 0, 17, 0, 2, 0, 69, 0, 2, 0, 48, 1,200, 0,152, 5,202, 0,252, 1, -202, 0,153, 5, 11, 0,154, 5, 9, 0,155, 5, 7, 0, 81, 1, 7, 0,112, 0, 7, 0, 68, 1, 7, 0,156, 5, 7, 0,157, 5, - 7, 0,158, 5, 7, 0,159, 5, 7, 0,160, 5, 7, 0,161, 5, 7, 0,162, 5, 7, 0,163, 5, 7, 0,116, 1, 88, 0, 3, 0, - 11, 0,164, 5, 4, 0, 16, 0, 7, 0,165, 5,203, 0, 7, 0,203, 0, 0, 0,203, 0, 1, 0, 27, 0, 42, 0, 11, 0, 0, 2, - 4, 0, 16, 0, 0, 0, 34, 0, 4, 0, 99, 0, 87, 0, 2, 0, 24, 0, 18, 0, 11, 0,164, 5,204, 0, 14, 0,113, 0, 0, 0, -113, 0, 1, 0, 4, 0, 79, 3, 7, 0, 80, 3,114, 0, 81, 3, 2, 0, 82, 3,115, 0,134, 3, 87, 0,254, 1, 4, 0, 16, 0, - 2, 0,140, 3, 2, 0,166, 5, 2, 0,143, 3, 2, 0, 17, 0, 7, 0,167, 5,205, 0, 5, 0,205, 0, 0, 0,205, 0, 1, 0, - 27, 0, 42, 0, 2, 0, 16, 0, 0, 0,168, 5,206, 0, 8, 0,206, 0, 0, 0,206, 0, 1, 0, 9, 0, 32, 0, 2, 0, 29, 0, - 2, 0, 16, 0, 2, 0, 99, 0, 0, 0,168, 5, 7, 0,169, 5,207, 0, 11, 0, 39, 0,170, 5, 7, 0,209, 1, 2, 0,171, 5, - 2, 0, 16, 0, 4, 0,172, 5, 4, 0, 17, 0, 0, 0,173, 5, 7, 0, 88, 1, 7, 0,174, 5, 7, 0,175, 5, 7, 0, 48, 1, -208, 0, 4, 0, 39, 0,170, 5, 4, 0, 99, 0, 4, 0,100, 0, 0, 0,173, 5,209, 0, 4, 0, 39, 0,170, 5, 4, 0, 16, 0, - 4, 0, 99, 0, 0, 0,173, 5,210, 0, 4, 0, 39, 0,170, 5, 4, 0, 16, 0, 4, 0, 99, 0, 0, 0,173, 5,211, 0, 7, 0, - 39, 0,170, 5, 4, 0,176, 5, 7, 0,186, 0, 2, 0,177, 5, 2, 0,178, 5, 7, 0,179, 5, 0, 0,173, 5,212, 0, 9, 0, - 39, 0,170, 5, 2, 0, 29, 0, 2, 0,180, 5, 2, 0,204, 1, 2, 0,234, 4, 7, 0, 78, 5, 7, 0,244, 1, 87, 0, 55, 5, - 0, 0,173, 5,213, 0, 4, 0, 39, 0,170, 5, 4, 0, 13, 2, 4, 0,181, 5, 0, 0,173, 5,214, 0, 5, 0, 39, 0,170, 5, - 7, 0,186, 0, 4, 0,182, 5, 4, 0, 13, 2, 4, 0, 14, 2,215, 0, 6, 0, 39, 0,170, 5, 0, 0,173, 5, 7, 0, 69, 0, - 7, 0, 48, 1, 7, 0,113, 5, 7, 0,183, 5,216, 0, 6, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, - 7, 0, 0, 3, 7, 0,184, 5,217, 0, 6, 0, 39, 0,170, 5, 4, 0,185, 5, 4, 0,186, 5, 7, 0,187, 5, 7, 0,188, 5, - 0, 0,173, 5,218, 0, 17, 0,218, 0, 0, 0,218, 0, 1, 0, 2, 0, 16, 0, 2, 0,193, 0, 2, 0,189, 5, 2, 0, 17, 0, - 27, 0, 42, 0, 87, 0, 55, 5, 7, 0,204, 1, 7, 0,234, 4, 7, 0,190, 5, 7, 0,191, 5, 7, 0,192, 5, 7, 0,193, 5, - 7, 0, 56, 5, 7, 0,194, 5, 0, 0,195, 5, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - diff --git a/source/blender/src/Bfont.c b/source/blender/src/Bfont.c deleted file mode 100644 index 2d442e2cf73..00000000000 --- a/source/blender/src/Bfont.c +++ /dev/null @@ -1,139 +0,0 @@ -/* DataToC output of file */ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - - -int datatoc_Bfont_size= 25181; -char datatoc_Bfont[]= {"\x80\x01\xe4\x01\x00\x00\x25\x21\x50\x53\x2d\x41\x64\x6f\x62\x65\x46\x6f\x6e\x74\x2d\x31\x2e\x30\x3a\x20\x42\x66\x6f\x6e\x74\x20\x30\x30\x31\x2e\x30\x30\x31\x0a\x31\x31\x20\x64\x69\x63\x74\x20\x62\x65\x67\x69\x6e\x0a\x2f\x46\x6f\x6e\x74\x49\x6e\x66\x6f\x20\x31\x30\x20\x64\x69\x63\x74\x20\x64\x75\x70\x20\x62\x65\x67\x69\x6e\x0a\x2f\x76\x65\x72\x73\x69\x6f\x6e\x20\x28" \ -"\x30\x30\x31\x2e\x30\x30\x31\x29\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x2f\x46\x75\x6c\x6c\x4e\x61\x6d\x65\x20\x28\x42\x66\x6f\x6e\x74\x29\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x2f\x46\x61\x6d\x69\x6c\x79\x4e\x61\x6d\x65\x20\x28\x42\x66\x6f\x6e\x74\x29\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x2f\x57\x65\x69\x67\x68\x74\x20\x28\x52\x65\x67\x75\x6c\x61\x72\x29\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x2f\x49\x74\x61\x6c\x69\x63\x41\x6e\x67\x6c\x65\x20\x30\x20\x64\x65\x66\x0a\x2f\x69\x73\x46\x69\x78\x65\x64\x50\x69\x74\x63\x68\x20\x66\x61\x6c\x73\x65\x20\x64\x65\x66\x0a\x2f\x55\x6e\x64\x65\x72\x6c\x69\x6e\x65\x50\x6f\x73\x69\x74\x69\x6f\x6e\x20\x2d\x31\x30\x30\x20\x64\x65\x66\x0a\x2f\x55\x6e\x64\x65\x72\x6c\x69\x6e\x65\x54\x68\x69\x63\x6b\x6e\x65\x73\x73\x20\x35\x30\x20\x64\x65\x66\x0a\x65\x6e\x64\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x2f\x46\x6f\x6e\x74\x4e\x61\x6d\x65\x20\x2f\x42\x66\x6f\x6e\x74\x20\x64\x65\x66\x0a\x2f\x45\x6e" \ -"\x63\x6f\x64\x69\x6e\x67\x20\x53\x74\x61\x6e\x64\x61\x72\x64\x45\x6e\x63\x6f\x64\x69\x6e\x67\x20\x64\x65\x66\x0a\x2f\x50\x61\x69\x6e\x74\x54\x79\x70\x65\x20\x30\x20\x64\x65\x66\x0a\x2f\x46\x6f\x6e\x74\x54\x79\x70\x65\x20\x31\x20\x64\x65\x66\x0a\x2f\x46\x6f\x6e\x74\x4d\x61\x74\x72\x69\x78\x20\x5b\x30\x2e\x30\x30\x31\x20\x30\x20\x30\x20\x30\x2e\x30\x30\x31\x20\x30\x20\x30\x5d\x20\x72\x65\x61\x64\x6f\x6e\x6c\x79\x20\x64\x65\x66\x0a\x63\x75\x72\x72\x65\x6e\x74\x64\x69\x63\x74\x20\x65\x6e\x64\x0a\x63\x75\x72\x72\x65\x6e\x74\x66\x69\x6c\x65\x20\x65\x65\x78\x65\x63\x0a\x80\x02\x92\x5e\x00\x00\xd9\xd6\x6f\x63\x3b\x84\x6a\x98\x9b\x99\x74\xb0\x17\x9f\xc6\xcc\x44\x5b\xc2\xc0\x31\x03\xc6\x85\x70\xa7\xb3\x54\xa4\xa2\x80\xae\x6f\xbf\x7f\x98\xf7\x5a\x84\xba\xce\x2d\x03\x6a\x6b\x51\xb8\x48\x49\x31\x59\x1d\x92\xe5\x06\x9e\x62\x26\xd5\xad\xcc\x5d\xe4\xf8\x10\x7a\xa6\x9a\x35\xb5\x5f\x6a\x9b\x4b\x4f\x93\xc5\x6c\x23\xbc\xc6\x1d\xd7\xbf\x8f\x32\xf2\x1d\x58\xe4\x1a\x5f\x79\x0c\xee\x2f\x02\xaf\x49\x86\x95\xe9\x0c\x1d\x0b\xd2\x59\xe7" \ -"\x5b\x02\x19\x30\x0b\x0f\x69\x2c\x33\x77\x9c\x2a\xa6\x7a\xe8\x51\x7a\xbe\x12\x30\x08\x45\x22\x4a\xf6\xad\x5d\xa9\xdb\x9a\x1a\x3a\x40\xfb\x06\xb3\x6a\x9c\xcd\x69\x12\x55\x07\xfc\x2d\xe9\xd0\x41\x84\xc7\x60\x42\xf0\x3f\xcf\xd1\x53\x84\x00\x23\x97\x2a\x81\x2a\xb9\xb3\xcb\x56\x70\xc1\xce\x27\x59\x71\x1c\x75\x29\x42\x62\xd6\xf2\x91\xaf\x9b\x7c\x76\x07\x1e\xda\x7e\x7a\xd0\x26\x21\x62\x32\x22\xb9\x36\x08\x7a\xb2\x7f\xfe\x5f\x07\x86\x47\x06\x65\x92\x18\x3d\xc3\x47\xae\x92\xe6\xbf\x56\xb1\x7b\xed\xce\x13\x68\x46\xf6\xa2\xa3\x76\xab\x8c\x0b\xc0\xff\x4e\x34\x7d\x20\xfd\x0e\xc7\x7e\xfa\xb1\xf0\x63\x31\x00\x14\x8d\x2a\x7d\x2f\xd2\x1f\x12\x5a\xaa\xcd\x8f\xdb\x99\x79\x83\x2b\x67\x0d\x8a\xaa\x76\xd2\x12\xba\xb5\x61\x46\x19\x90\x96\x0c\x35\x6e\xb8\xd8\xe9\xf3\xc6\x5d\x9d\xfe\x7f\x8c\x2c\x8a\x7b\x2b\xe9\x9e\x63\xff\x6c\x86\x88\x3c\x1d\xe5\x07\x8d\xa3\xb9\x1e\x03\xe4\x84\x0d\xdd\x6d\x30\xe3\x3c\xe3\x87\x75\xdc\x80\x43\xc3\x93\x20\x76\x47\xbe\x83\x0b\xf5\xc8\x5d\x1e\xe2\x20\x72\x1a\x27\xe8\x8a\x21\x6d\xe8\x01\x0b\xe9\xd4\x4e\xdd" \ -"\x58\x9e\x87\x5f\x9f\x0e\x26\x1f\x0c\x6a\xff\x33\x93\x2a\x8b\xfe\xd2\x77\x06\x60\xdd\xe2\x8c\xb7\xd5\xde\x05\xcd\x0d\x8c\xfd\xd6\x7d\x67\xe3\x34\x3c\x66\x1f\xfa\xa3\x93\xe4\xa7\x3a\xcf\x9c\x44\xa6\x96\xa7\xa9\x74\x53\xc2\x96\x68\x98\x1f\x07\x9d\x26\x4c\x1d\x0a\xf7\x3f\x39\xc2\x6a\xe6\xb7\x78\x87\xbb\xc9\xd3\x52\xea\xa8\xb6\xa7\x5a\x38\x25\x6d\xa0\x90\x0d\x30\xcc\xbe\x0e\xa9\x67\x7f\x88\x66\x18\x51\x3d\x20\xe9\xe4\x9e\x12\xeb\xbd\x1c\x00\xde\x43\x11\x6e\x8f\x47\xdf\xb5\x21\x11\x42\x51\xd2\x07\x17\xba\xf5\xe5\xc6\x8f\x3e\x71\x21\x50\xec\x57\x94\x41\x2a\x1b\x6f\x80\xdf\xc4\x8c\x2d\x20\x5b\x7b\x9e\x88\x99\xa6\x90\x7e\x73\x85\xdc\xfe\xea\xc0\x7b\x0e\xef\x4b\xc7\x74\x1c\xf1\x19\x1e\x42\xe2\xf8\x9f\x8e\x2e\x29\x0a\xed\x6f\xcd\x1f\xe6\x48\xc4\x31\xc8\x32\x1d\x73\x99\x8d\xc6\xe1\xda\x9d\x56\x38\x43\xf9\x63\x32\x19\x97\x0e\xc8\x23\xba\xfa\xcc\x97\xbb\xd1\x33\x81\xa1\x44\x76\x82\x1f\x19\x86\xff\x4b\xaa\xf0\xe1\x71\x90\x05\xb2\x85\x2d\x55\xf2\x42\x0a\x0a\x41\x8a\x5d\x93\x48\xd2\xfa\xd1\x7b\x94\x87\x0c\x9c\x5e\x0d\xfa\x1f" \ -"\xd3\x9d\x52\x80\x84\x8f\x0b\x9b\x2f\xd3\x97\xe8\x8e\xfd\x52\x68\xea\xe7\xbe\xa9\x4e\x20\x5a\x02\x29\xc9\x7a\x8e\xcd\x90\xea\xcc\xc6\xe3\x38\x39\x06\x3f\x08\xed\x59\xc7\x1e\xe2\xa9\x30\xc6\xbf\x26\x72\x57\x87\xbd\x62\xfb\xe0\xd2\x9a\x3a\x57\x1a\x38\x29\xdb\x77\x7c\x6d\x53\xb6\xa9\xa6\x7b\xff\xbe\x23\x79\xb1\x25\x5c\x80\xf2\xf7\x84\xda\x95\x8c\x74\xb8\xa3\x0d\xf8\x8a\x44\x7c\xe5\xd3\x59\xd2\x65\xac\x95\xdd\xb6\x71\x24\xb6\x2e\x05\x8d\x7f\x93\x36\x76\x43\x6b\x69\xbb\x28\x35\xd0\xaa\x19\x2d\x71\xd8\x6e\x87\x38\x07\x1a\x0e\xe1\x3d\x4f\xe4\x48\x1e\x27\xdc\xc3\xe3\xe5\x99\xc4\x1c\x06\x6b\xf0\x36\x43\x06\x5e\x8f\x00\x22\xb4\x31\x0e\x29\x6f\x09\x29\x5e\xcb\xb8\x8b\x8e\x22\x8c\x8a\x5a\x19\xd8\x59\xfc\x2d\x2e\x84\xa9\x9a\xe6\x83\x0f\x14\x64\x63\xeb\x6a\x49\xb9\x59\x06\x42\xe6\xab\xca\x16\xd5\xe3\xb7\x20\x8a\x74\xfd\xd0\xe6\x79\x10\x3f\xee\x84\x45\x1c\x87\x58\x73\x12\x15\x0b\x66\xac\xc8\x25\xde\xff\x64\xdd\x50\xad\xda\x35\xd2\xfa\x94\xd3\xf1\x61\x96\xb9\x2b\xfa\x8a\x0e\x7a\x85\x1e\xbf\x36\x9e\x76\x16\x0c\xe8\x19\xe4\x3c" \ -"\x65\xce\x77\x1d\x39\x0c\x63\x24\xa7\xb6\x99\x56\xc3\x15\x46\x9a\x66\x6a\x2d\xec\x46\x97\x8f\xb9\xcf\xfc\x6a\x2e\xa8\x50\xd8\xce\x9d\xab\x76\x4d\x52\x99\x18\x36\xa5\x80\xa0\x1b\xc3\x75\xf1\x8d\x5d\x97\xe9\xef\xf4\x49\x7b\x85\x2a\x8a\x7b\x44\x9f\xe1\xd1\xab\xf2\x46\xd4\x06\xa8\x13\x74\xe4\x00\x0e\x94\xbf\x84\x0a\xfe\x53\x7d\x14\x11\x47\x7e\x8e\x38\x50\x37\x30\x7d\xb8\xac\x9c\xa3\xa1\x48\xf9\x69\xcc\xcf\xb3\xd9\x73\xb1\x02\x52\xdc\x8e\x0e\xb4\x8a\xfe\x53\x8b\x24\x46\xcb\x5b\x51\x52\xe5\x14\xfd\x4e\x84\xd5\x40\x9a\xa3\x3b\x5d\xf5\xa8\x26\x94\x30\xe4\x0d\xba\xcc\x5f\x8c\xb8\x76\x16\x82\x6f\x1b\x26\x8b\x7f\x6a\xac\xa1\xfe\x88\xbb\xa6\x30\xa2\x98\x7c\x45\x1b\xba\x32\x7e\x07\x90\x2b\x4b\xb0\x91\x9f\xca\xf4\x07\x4e\xcb\xfa\x20\x2a\xc3\x47\xba\x5a\x5c\xa2\x7e\x62\x2c\xc3\xa3\x2f\x58\x7c\x2b\xb1\x7a\xfb\xfe\x1d\xa1\x46\x62\xeb\x85\x34\x0c\x1c\xb8\x43\x91\x49\x58\x63\x45\x3c\xe3\x8e\x0f\xda\x52\xa7\x39\xe1\xe6\xda\x83\xfb\xab\x0b\x3f\xbf\x41\xec\xb2\x3f\x9f\xd5\xd3\x72\x40\xc8\x55\x49\x28\x5e\x7b\x6c\xab\x59\xa9\xce\x63" \ -"\xc4\x1f\x0f\x98\x8a\x4d\x89\xd2\xc5\xe4\xff\x49\x7e\x78\xf9\xd6\xaa\xd4\xa8\x49\x36\x7d\x71\x4e\xe2\x25\x89\xf9\xbc\xef\x21\xe7\xf4\x7d\x74\x89\x7e\xbb\x1f\xc1\xc2\x76\x79\x13\x50\xfa\x57\x30\x50\x3e\xf6\x1d\x79\xf7\x87\xc6\xc1\xfd\x94\xd3\x11\xd2\x11\xf7\x2c\xcd\x5b\x01\xbe\xc3\xec\x42\x5f\x90\x3a\xeb\x02\x2a\x4f\x19\x52\xa4\xa7\xf4\x72\xbc\xc0\x65\x17\x37\x45\x8d\xa8\x1c\x59\x3c\x74\x5b\xa2\x79\x1c\x7b\x60\xfc\xa5\xb4\x45\x38\xe8\x36\x7a\x8a\xdf\x9e\x83\x5e\xab\x52\x04\x70\x0d\xa0\x75\xaa\x92\x1c\xf1\x9a\xd3\x77\x10\xe9\x8d\x60\x5e\xa7\x0d\x25\x76\x69\x49\xd3\x61\x6d\x94\x83\xbe\x77\x2d\x7c\xd0\xe1\x27\x5e\x30\x3e\x21\xbc\xf8\x9a\xe9\x2e\x9e\x07\x90\x01\x79\x00\xeb\x47\x19\x34\x0d\x2e\x01\x19\xab\x1b\xb3\xaa\xa4\xe7\x02\x19\xb6\xe2\xfa\x60\xc0\x17\xb9\xda\xda\x10\x8c\x24\xb4\xd8\x3b\x5f\x31\xa5\xa2\x86\xfc\x2f\xa8\x41\xf2\xb2\xd3\x3e\x0a\xef\x99\x41\xdb\xf7\x48\x11\x69\x31\xfe\x55\x88\xd3\x75\xf0\xda\x4d\xdd\xa6\x29\x91\xc6\x04\x68\x88\xf1\x30\x00\x9e\xd2\xec\xcf\x1a\x91\x8c\x5f\xa4\x75\xc6\x00\xb7\x68\xa1" \ -"\x3b\x09\xbd\x08\x20\x2c\x1a\xff\x9d\x77\xf5\xfa\x31\xb0\x9c\xe3\x66\xe4\x69\x53\x18\x99\x55\xc4\x81\x85\x80\xd0\x81\xca\x3e\xcc\xad\x89\x5b\xdf\x70\xd0\xf3\x57\xb4\x6d\x52\x8d\x38\xef\xd2\x28\x56\xc8\xad\x1f\x20\xe6\x8c\xca\x3d\xdc\xb0\x5c\x6c\xcf\xb1\xd5\xa9\xee\xac\x9e\xfe\x26\xf2\x8d\x06\x73\xd9\xc1\x86\xa6\xe3\x24\xd0\x77\x56\x2c\x22\xc3\x47\x77\x5e\xea\xf1\x7a\x4f\xa9\xad\x24\xdd\x78\x44\x17\x03\x2c\x7d\x26\x4e\x48\xe6\x19\x3e\x12\xcd\xce\x42\x8c\x4f\x7d\xe5\xdf\x00\x5c\x19\x76\xfd\xa1\xdb\x33\xe4\xe5\xd4\x0d\x9b\x1a\x32\x36\x69\x36\x26\x55\x98\x31\x96\xe9\x58\xbf\x6f\x00\x7a\x93\x5f\xd7\x32\x21\xb0\xd1\x4d\x88\xc6\x06\x47\x61\x64\x98\x00\x9f\x5e\x5b\xca\x07\x94\x7d\xfe\x3a\x26\x6b\x31\x65\x0e\xc2\xa3\x0c\x4f\xfd\x99\x96\x36\x1e\x25\x8c\xbd\xf1\x8d\x2f\x39\x8b\x91\x4a\x58\x0f\xb2\xb3\x3f\xf1\x5b\x81\x1e\x4f\x13\x68\x48\x38\xd7\x25\x7c\xf2\x4d\x51\x6d\x9b\x00\xe9\x7a\xba\x6b\x5b\x91\x5c\xa2\x5a\x04\x71\xaa\x54\xd3\x84\x8e\x40\x1b\x5d\x98\xf8\x6b\x5e\x5d\xa0\x6d\xf9\xf1\xfb\x66\x82\x42\x60\x33\x70\x8c\xf5" \ -"\x97\x41\x2d\xbd\x9d\x75\xbc\x5b\x61\x31\x8a\x6b\x6a\x87\xcc\xcb\x26\x77\x21\x95\x57\x7a\x9e\xc6\x08\x8e\xda\x03\x38\xf9\x50\x56\xfd\x52\xf6\xcb\xe7\x39\xa0\x32\x34\xbb\x18\x6c\x82\xfd\xc1\x18\x33\xc9\x32\x03\x43\xb0\xbb\x7c\xa5\xac\x8e\xfc\x9c\x9b\xdc\xfc\x33\xed\x69\x5e\x30\x2c\xe9\xbb\xbc\x7b\x64\xda\xdf\x24\x72\x36\xdb\xdf\x27\x9c\x70\xce\x2e\x13\x0a\xd5\x8b\x45\x0c\x8a\x86\x2c\x82\x5e\x88\x04\x6f\x4d\x15\x73\xe1\xa2\x0f\x26\x9f\xda\x8a\x66\xab\x02\x8e\x30\x9e\x39\x5e\x3b\xb6\x11\x7f\xbe\xdf\xc4\x42\xee\x6b\x32\x9a\x02\x8e\xa7\x98\x12\x19\xe2\x01\xfd\xfb\x11\x66\x14\x6f\x1c\x61\x88\x0f\x3c\x41\xe6\x27\x31\x19\xa6\x1f\x12\x36\x04\x18\x59\xd3\xe2\xfa\x4a\xe2\xb9\x43\x8a\x1d\x12\x55\x9c\x7c\x91\x54\x11\xaf\xa7\x33\x0d\x36\x52\x61\x40\xce\xc9\x6f\xc7\xd6\xd2\xeb\x94\x37\xb5\xf1\x88\x56\xfe\xdb\x7a\x40\x67\xb3\x4f\x71\xa3\x7e\x4b\x6b\x4f\x66\xf4\x15\x93\xc6\xd2\xfb\x23\x88\x49\x0f\x20\x2d\x96\x86\xfd\x71\x53\x6f\xa1\x6e\xd4\xf2\x21\x0c\x0c\x10\x8f\xc2\xc7\x25\xe4\xfb\x6e\x07\xd5\xc6\x37\x50\x20\xd1\x8c\x22\x2f" \ -"\x66\xf9\xd9\xa6\x76\x1f\x6a\x02\x12\x6a\x2e\x92\x94\x7d\x00\xd0\x59\xd1\xf7\x37\x8f\xb1\x13\xb7\x7f\x47\x76\x14\x88\x03\xe9\x6d\x77\xb5\x73\xdf\x6e\x8b\xb6\xab\x6d\x68\x48\x3e\x98\x8f\x0e\x9d\x52\x9a\xfd\x8e\xd7\x3b\x01\x0b\x62\x6b\x8c\x0c\xf0\x90\x38\x26\x0e\xdc\xed\x9a\xae\x97\xb3\xcf\x68\xea\xde\x54\x7e\x9d\x5a\x34\x76\x7e\x60\x17\xcb\x87\x86\x29\x10\xc4\xd2\x2c\x7d\x44\x91\xe8\xec\x34\xde\x66\x83\x50\x65\xed\xda\xf4\xd7\xcd\x5f\x3a\x60\x12\x42\xd5\x5b\xf7\x3a\x2c\x39\x96\xc1\x8b\x87\x24\x8f\xec\x5e\xd1\xec\xd5\xe3\x2a\xb0\xad\xce\x57\x97\xf0\x91\xb9\x2d\xd1\xb1\xc9\x7b\x20\xc4\x2c\x9e\x53\xcb\xca\x06\x6a\x36\x5d\x2b\xd1\x0c\x72\x4c\x64\xf2\x68\xa5\x8a\x0f\x8f\x05\x21\xe4\xc3\xf3\x6f\x51\xf9\xae\x0f\xa7\x28\xa5\x33\x61\xb9\xd7\x96\x76\xfd\x16\x67\x09\x15\xb9\xee\xbd\x5e\x31\x68\x64\x62\xa5\xc4\x1f\x94\x70\x7d\xc7\x2e\x67\xfc\x4f\x64\xa5\x70\x68\x52\xf9\xdb\xcd\x22\xc6\x1f\xc6\xbf\xb5\x48\xd4\xb6\x3e\x57\x0d\x35\xab\x54\xde\x9c\x83\xc9\xa2\xad\x2f\x2c\xbb\x69\x77\x84\x2f\xe4\xb8\x24\x55\xda\x0b\xfb\xf2\x7c" \ -"\xcd\xa8\xfc\x18\xf5\x31\x54\xa1\x6b\xd3\x15\x3f\xdb\x59\x0f\x74\xc0\x12\xd0\x56\x5f\x4b\x47\xef\xf7\x69\x7c\x55\xae\x90\xdc\x18\xbc\x5e\x28\xd1\x84\xea\xe1\x35\x45\xf0\x2a\x2f\x5c\x12\xf0\x78\xd2\x8c\xa8\xda\x69\x3c\xf6\xf7\xee\xbc\xf7\x0a\xa2\x18\x88\xe2\x5b\x6b\x9d\xa8\x33\xba\x0f\x4f\x44\x9a\xe1\x34\x29\xe4\x7f\x23\x29\xe0\x61\xe1\x2c\x55\x10\xe1\x63\xc6\x30\xb6\x62\xeb\xff\xb2\x18\xd2\x3a\x0e\xc8\x54\x12\x84\x89\x23\xab\x3f\xc3\xee\xc3\xa7\xa7\x08\xcf\xe8\xd6\x64\x5b\xc3\x5a\xe9\x56\x62\xcf\xb9\xe5\xc4\x8c\xfd\xec\xdb\x96\x3e\x3e\x02\x0f\x33\xe8\x9d\x2c\xea\x6b\xbc\xdc\xd6\xd1\x2a\xa5\x12\x5e\x8f\xeb\xf1\xc0\xfe\x6a\x9b\x30\xf6\xef\x7b\x11\x8c\x0c\x65\xfb\x66\x9c\x7e\x82\x02\x26\x3e\xff\x1b\x86\xb6\x78\x17\x9e\x67\x04\x30\x9a\x4e\xec\x0e\xfe\xde\xef\x2a\xe4\xe0\x8a\x57\xd3\xec\x4e\xd4\x01\x6b\x8b\x51\x05\xee\xb9\x54\xcd\x33\x53\x43\x34\x2a\x87\xff\xf4\x7b\x9d\xb9\x74\x72\xa0\x74\xf6\x1e\x93\x7f\x81\x9c\x33\xe5\x27\x7a\x02\x7a\x91\xe5\x19\x7a\x02\x97\x07\x7d\xf6\x4c\x81\xd1\x6e\x8a\xf6\xd3\x21\xb7\x3c\xc0" \ -"\x6c\xa7\xa1\x9d\xad\xbc\x86\xc0\xb3\xcb\xc3\x88\x54\x29\x6e\xc1\x7a\x83\x0b\x4b\x7c\x53\x8b\x50\x0c\x47\x5d\xd6\xb3\x2b\x46\x8b\x5b\x35\xe4\x61\x69\x43\xe6\x76\x5c\xb7\x83\x72\xe7\x4a\x8c\x30\x87\xb4\x0a\xb8\x94\x2e\x4b\xb6\xcd\x53\x2f\x97\xce\x54\xf3\xe8\xe9\x7e\x8e\x1e\x0b\x71\xdb\xfc\x99\x12\x10\xd7\xee\x79\x9b\xff\x15\xd6\x59\x06\xc4\x03\xc9\x83\x30\xbb\x9f\xeb\x0e\x1b\x9b\xf5\x4d\xe5\x82\x70\xa8\xa4\xfd\x45\x17\xfd\xf2\xaf\x13\xe8\x9b\xa1\x1b\x9e\x5f\xa0\x5a\x4f\x6d\x85\xcb\x2a\x46\xb5\x78\xf7\xf4\x55\xbf\xa7\xff\x24\xfb\x73\x36\xbf\x4e\xd3\xb6\xfc\x05\x0c\x64\x20\x30\xc8\x1a\xea\x7b\x19\xa1\xfd\x86\xa8\x3c\x0f\xbb\x3e\x18\xef\xb1\x62\x5c\x6d\xc3\x70\x4e\xf2\xa1\xfa\xe0\xd2\x5e\x6f\x22\x64\xc4\x47\x67\x4a\x7b\xd8\xd9\xb4\xa0\x21\x40\x69\x7b\xb7\x7d\x54\x4d\x50\x63\x6d\xf7\xad\xa8\xef\x7a\x58\xe9\x75\xed\x94\x2b\x90\xc3\xff\xde\x7c\xd6\x85\x9c\x75\xf4\x07\x49\x0d\x64\xa4\x44\xaf\xbf\x5d\xe1\xfc\x80\x60\x4d\xe7\xc4\x96\xdf\x78\x38\x17\x65\x5e\x17\x32\x4c\x26\x1b\x59\xb8\x5d\x8c\x25\x4f\xf9\x42\xc7\x1b\xdc" \ -"\xe6\x72\xb0\xb3\xe4\xc9\x0c\x38\x71\x01\x19\xcf\x68\xb1\xbf\x4f\xed\x8f\xe2\x68\x5c\x15\xf9\x62\xcd\x16\x69\xd7\xb8\x8e\xb2\x6b\x08\xc2\x0d\x20\x9c\x54\x6d\x92\x98\x39\xf1\x48\x3e\x4a\x7a\xd4\x58\xb3\x39\x17\xba\x4a\x49\x52\x25\x50\xb6\xa5\x28\x59\x1e\xf4\xd1\x6e\xa3\x18\xb6\xc9\x8b\x91\xe1\x94\xdb\xb8\x01\x6d\x63\x9c\x25\xf7\xb1\x6f\x32\xd1\xdd\xd0\x4e\x00\x48\x06\xec\x4c\x4f\x3f\x84\x1a\xe3\x48\x8e\xe5\xf8\x78\xa0\x94\x9b\x5b\x33\x3d\x28\x16\xc0\x60\x8b\xc1\xc0\x29\x74\x4f\x8c\x74\x9e\xf8\x40\xa8\xe3\xae\x38\x72\x5c\xa0\x1f\xc8\x5e\x52\x63\x8b\x43\x5f\x2f\x4c\xb4\x98\x2b\x83\x95\xb1\x04\xd4\x38\xd1\xbe\xd1\x66\x7a\xe0\x48\xea\xf4\x6f\xaf\x8a\x78\x17\xcb\x09\x92\xea\xef\x5e\xf1\x1c\x15\xaa\x33\x02\xb0\x7d\xb3\xd9\x63\x53\x11\x10\x71\x7b\x6f\x44\x5e\x9c\xc8\x5a\x75\x1e\xae\x83\x2a\xa1\x5b\x4c\x55\xc7\x2c\x4b\xc7\x00\x9f\x6f\x9e\xec\x3f\xfc\x49\x43\xdc\x71\xa9\x9e\x4a\x07\x51\xd6\x95\x9b\xde\x81\x5b\x3f\xa9\xc4\xa8\xd0\xe6\x53\xa8\x04\x13\x1b\xb0\x9d\x92\x38\x2a\xfe\x8f\xab\x77\x3c\x7f\x39\x25\x6b\x54\xff\xf6" \ -"\x4c\x9f\x26\xb0\xe9\x0d\x61\x6b\x40\x37\xce\xc9\xcc\xda\x03\x8b\x7b\x96\x97\x6e\x1c\xc6\x63\xf7\xa7\x9b\x25\xb8\xfd\xd6\x15\xfd\xfa\xb3\x1a\xe9\x62\xcd\x75\x6d\x5e\xde\x0f\x97\xb8\x77\xdb\x9f\x1a\x34\xea\x37\x42\x64\x6c\xaf\xae\x11\x6f\x87\xbd\xf4\xee\xad\x17\x11\xf1\x88\x4e\x7c\x4b\xcb\x72\x87\xe4\xdd\x4f\xf4\xb4\x54\xd7\x78\x3a\xc1\xea\x11\x15\x84\x6e\x0a\x5d\x5d\x00\xb7\xf5\x86\x3d\x5f\x44\xbf\x8d\xed\x5f\x7e\x57\x3a\x95\x86\xd5\x6e\x74\xd8\xc0\x0a\x70\x26\xe8\x32\x23\x78\x39\x2d\xac\xe8\x25\x4d\xe2\x99\x6e\x83\xfd\xd2\xa8\xb4\x53\x38\x33\x38\xbd\xde\x61\xc1\x88\x8a\x2a\x94\x32\x6f\x18\x13\xfe\xb1\x6d\x2a\x04\x41\xac\x60\xfb\xa0\x36\x3a\xa5\xca\x40\x4b\x26\x3a\x4b\xb0\xd8\x62\x92\x7d\x76\xf8\x0e\x6a\xe4\xe2\x51\xf1\xfb\x7f\x1b\x17\x5c\x9d\x8c\x0c\x3b\x56\xfc\x7a\x0d\x80\x0e\xb8\x37\x9b\x2c\xfd\x1d\x2f\x7b\xbf\xb9\x9a\xa3\x72\xfa\xd8\x30\xda\x18\x29\x89\xba\xc8\xd1\x93\x56\xea\x0b\xfb\x2a\x38\xb5\xf3\xee\xa6\x87\x5c\x97\x56\xae\x59\x4f\x47\x0e\x18\x05\xb3\x57\x83\x87\x66\x3b\xba\x42\x01\x06\x48\x05\x1c\x4f" \ -"\x31\xba\xc2\x3e\xb3\x35\xba\x1f\x8f\x0f\x69\x20\xfb\xbc\x8a\x0b\xf4\x24\x64\x65\x50\xbb\xfd\x35\x5a\x9a\xd4\xb5\x7e\xd1\x3a\x0a\x37\xa8\x1b\xec\x73\x65\xe0\xc1\x67\xe7\xe7\x4c\x82\xa9\x40\xf7\x8f\xa0\x06\x0c\xbb\x3e\x73\x55\x85\x61\x83\x9d\xa4\x05\x12\x33\x45\x35\xe2\xaa\x20\xf8\x85\xc2\x3a\x72\xf3\x9c\x35\xdb\xe4\x25\x33\x96\xf0\xe3\x4a\x64\x42\x8c\x73\x64\x67\x2f\xa0\x91\x27\xa0\x4b\xde\xda\x1c\x6c\xe8\x6b\x5b\x00\x39\xfa\x88\x06\x21\x76\x73\x67\xb3\xdd\x6c\x28\x8e\xaf\xb9\x02\x0c\xc0\x42\xd5\x98\x29\xe9\xdf\x29\xd4\x55\x11\x34\x3a\xd3\xb5\x2e\xd3\xce\xbd\x1a\x08\x5a\x73\xe0\x97\xc3\xe0\xd5\x22\xa2\xbd\xde\xda\x9b\x4e\xc9\x65\xf2\x09\x38\xd7\x98\xef\xf7\x79\x03\x10\xdd\x38\x2d\x23\xf3\x92\x80\x2c\x72\xd7\x84\x65\xdc\xe9\xb4\x02\x1d\x57\xcb\xb9\x90\x10\x25\x71\x3c\xf4\xd6\x8c\xbf\x18\xc0\x25\xff\xa1\x93\xd8\x1e\x28\x9b\x58\x3c\xba\x87\x0b\x17\xe4\x2b\x9d\xcb\x66\xc4\xc5\x01\x01\x57\xda\x7e\x50\x4c\x1e\xb6\xcf\x99\x87\xf8\x06\xb5\xd7\x4d\x80\xc8\x0a\x13\x6b\x8a\xca\x54\x78\xbf\x8c\x75\x32\x20\x1b\x69\xae\xe0" \ -"\xaa\x7b\x35\x4c\x30\xd2\x06\xe3\xc3\x72\xeb\x57\x91\x96\x1a\x15\x11\xd6\xc6\xf5\x7d\x6d\x9c\xaa\xcc\x8f\xe4\x3e\xc4\x80\x15\xf3\x99\x5b\x47\xa4\x71\xa4\xff\x30\x24\xee\x69\xdc\xa3\x5d\x03\x21\x2f\x96\xf1\xd3\xbe\x6f\x9d\xea\xbd\x19\x3a\xf7\x4b\x76\xf7\xa7\xab\x76\xdf\x01\xb4\x62\x53\x00\x02\x6d\x11\xff\x74\xf4\x6b\x65\xdc\x64\x46\x15\x85\xb3\x5a\xd2\x74\x20\xc5\x18\x52\x72\x78\xda\x0e\x93\x50\xc2\x50\x45\x4e\xdf\x9d\xb7\x82\x31\x8b\xa2\x22\x0c\xb0\x2d\xf2\x67\xe8\x80\x44\x58\xe1\xb5\x95\x03\xd2\x14\x26\x9b\x06\xce\x88\x16\xaa\x5c\x9c\xa5\x74\x8e\xfa\x48\xcb\xeb\xc1\x74\xf4\x04\xd1\x37\xba\x1d\x08\x21\xc1\xdd\x49\x1b\xd4\xcc\x16\xc5\xb3\x08\x7a\x86\x08\xff\x60\x33\x02\xa9\xc1\x60\x80\xb2\x6d\x8f\x83\x32\xdb\xd0\x3a\x9f\x67\xe9\x64\x1a\x02\xb1\x81\x7a\xa8\x78\x47\x27\x73\xe4\x6c\x72\xa1\xf3\x18\x0a\xdd\x69\x00\x20\xe6\x4b\xd0\xe9\x04\x46\xf9\x62\x25\x2e\x57\x9e\x91\x3c\x55\xe5\xc7\xec\x7e\x50\xb7\xb5\x0c\x44\x03\x0f\x17\x24\x5c\x92\x6d\x3d\x18\x80\x4e\xef\x58\xe6\xd7\xcc\x5a\x93\x76\xab\x33\xa8\x5f\x5d\x17\x5a" \ -"\xf4\xa4\xac\xc9\xde\x70\x8f\xc1\xd1\x82\xc9\xcf\x76\xaf\x33\x03\x53\x90\x35\x07\x02\xdf\x92\x32\x65\xa8\x9f\x85\x1c\x42\x1d\x40\xe9\x4c\xb6\x85\xac\x44\xdf\x72\xfe\xec\x6f\x1e\x49\x89\x82\xa4\x83\xc4\xbd\x6f\x9b\x93\xd9\x40\xc2\x73\x8f\xc9\x4d\x16\x99\xe4\x53\xbf\x35\xd2\x57\xea\x15\x22\xbb\xb8\x1c\x3f\xb3\xd6\x53\x0e\x70\x20\xa9\x9f\x85\xcf\x13\xa9\xbc\x93\x6f\xba\x72\x2b\x76\x98\x19\x47\xb8\xf7\xef\x3e\x27\x7d\x08\xb0\x5b\x2e\x7f\x25\xa9\xf7\xba\xaa\xe7\x6a\x7c\x5d\x52\xcb\x87\x32\xb1\x55\x4a\x73\xdb\x4c\x60\xad\x2c\xf2\x26\xa3\xab\x0e\x00\x5f\x4c\x63\x4b\x0e\x27\xd5\x74\xb6\x48\x02\xea\xb0\x41\x62\x96\x24\x46\x56\x89\x97\xda\xf5\x8d\x11\x18\xe9\x29\xb9\x3a\xb2\x38\x36\x7a\x94\xe7\x97\x29\xd6\x60\x04\xf3\x2e\x3f\xc8\xe9\x80\xa1\x5f\x8a\xf4\xb7\x8d\x91\x0e\x19\x5b\xc5\x46\x03\xe3\xbb\xcb\xdf\x30\x78\x71\x07\x00\x82\xc1\xa0\x43\x6c\xb9\x47\xed\xab\x65\x9f\x60\x62\x22\x04\x8e\x72\x9b\xa0\x93\xc1\xaa\x30\x73\xfd\xac\xf5\x3b\x91\xb0\x37\xcb\xf5\x3c\x18\xf7\xeb\x4f\x0c\x75\x4a\x12\x97\x0e\xd0\x07\xe3\xe6\x8a\xb6" \ -"\x6b\x21\xac\xd3\xe8\xf4\x5b\x56\x50\xed\x37\x9a\xaf\x20\xdd\x11\x97\x4f\x68\xee\x19\xe2\x4c\x9b\x48\x27\x5a\xd1\x5d\x77\x36\x11\x09\xde\x3e\x12\x88\x19\x0f\x3b\xc2\xcb\x39\x96\x00\x34\x7a\x68\x54\xc7\x68\xb4\x9a\xb4\xb1\x8d\xad\xa9\x9a\x71\x23\x4b\xc6\x9d\x96\x50\x2c\xd4\xf8\xae\xe8\xfb\x8c\x4a\xd6\xbd\x29\x78\x71\x9c\x41\x10\x0f\xc9\x12\x2d\x10\xd2\x68\xf7\x26\x21\x28\xf9\x3d\x77\x99\xb3\x48\x58\x7a\x6d\xd0\x5b\xba\xe7\xf6\xc9\x9a\x1a\x24\x73\x7e\xd9\x2c\xc2\x8c\x67\xe5\x0f\xfa\xe3\x8c\x6a\xcc\x76\xa9\x9d\x54\x96\x1f\x80\xc2\xfe\x90\xdd\x54\x4f\xd3\x94\x21\x3c\x6b\xd3\xaa\x9f\xf8\x69\x3f\x72\x00\x17\xea\x5c\xe6\xf0\x76\x06\xfa\xb5\xb8\xe3\x40\xba\x28\x5e\x43\xe1\x85\x59\x0f\x10\xae\x90\xa5\x3b\x06\x49\x0d\x12\x1d\x0a\x2e\xed\x17\x33\x21\x1b\xc1\xd4\x3f\xc2\x05\x4f\x42\xb1\x51\xc8\x54\xfe\xe1\x24\x6e\xd0\xe1\xca\xd5\x59\xd6\x8c\x8e\xe3\xdf\x3c\xd6\x13\x91\x5c\x5c\xa4\xcf\xde\x9e\xfa\x0c\x92\x96\x43\xcc\x78\xd3\x6d\x5f\xba\x28\xa7\xb2\x5a\x22\x2e\xea\x1c\x6d\xab\xb6\x53\xc5\x24\x33\x45\x98\xa8\x79\x30\x47\xb3" \ -"\x16\xda\xa8\xb6\xa0\x93\xc3\xb1\xb0\xc9\xea\xd5\xd1\x87\xde\x09\x01\x9d\xaa\xf0\xaf\xf6\xda\xff\x5c\x35\x66\xab\x16\xeb\xb4\xf8\x76\x0a\x55\x0e\x18\xda\xb8\x84\xbf\xe1\x70\x42\x03\xe7\x24\xeb\x22\xd6\xb5\x39\x68\x97\x4c\x45\x65\x53\x14\x27\xaa\x6c\xa1\xef\xec\x7e\x09\x90\x1b\x75\xd1\xae\xad\x5c\x10\xb9\x19\x08\x41\x1d\x86\x43\x01\xf8\x3e\xdd\xef\x86\x0c\x0f\xfc\xcb\x8c\xb3\x34\xf7\x03\xe6\x22\xb8\x66\x52\x76\x4c\xda\xfe\xf2\x18\x73\x16\x77\x5a\x04\x95\xec\xb0\x74\x44\x4d\x7b\xc9\xc0\xff\xbc\x6b\xc3\x03\xd9\xb8\x6a\xdb\x74\x51\xcf\xc1\xe3\x65\x29\x1d\xe8\x48\x55\xec\x97\x4a\x5d\x96\xa6\xab\x9b\x51\x83\x51\x6d\xab\xb8\x25\xbe\x72\x6a\x71\x90\xea\x4c\x8f\x5c\x62\xbe\x70\x97\xc6\x97\xb5\x63\x07\xb6\x32\xbe\x9d\x8d\x11\xc7\x94\xe6\x0e\xf0\x5f\xee\x8b\xa1\x60\x55\x89\x9a\x4f\x43\xa8\x65\xfd\x7e\x17\xa5\x8f\x2f\x21\x9d\x64\x06\x82\xfd\xbc\x42\x15\xcd\xf3\x74\x3e\xf1\xa1\xb1\xc7\xea\x3d\x87\x37\x71\x19\x99\x1b\x81\x95\xbd\x8c\x70\xd3\x31\xb0\x26\x2c\x6e\x1d\x87\xb2\x7a\xe9\x03\xa6\x61\xaf\x3d\x9f\x62\x3d\x36\x2e\x3e" \ -"\xf6\x89\x11\x96\xf9\xa5\x63\xd3\xac\x4c\x07\x68\x27\x6a\x77\xdd\x9f\xd2\x60\x21\xec\x57\xa4\x70\x2f\xe2\xf7\xec\x8c\xb9\xb6\x14\xc9\x33\x58\x61\x34\xc6\x46\x31\xf8\x60\x33\x52\x73\xa9\x4e\x49\x70\x7b\x6a\x78\x71\xb8\x5d\xc2\xe0\x44\xd3\xc8\xed\xd1\x29\xa0\x7f\x59\xa3\x37\x09\x1b\xfc\x4e\x5d\x93\x8d\x0c\x9c\x2c\xe2\x6a\x7e\x9f\xb5\x6a\x54\x19\x27\xdc\x29\x86\xb8\xad\x45\x8d\x80\xdd\x39\xc2\x38\x29\x94\x6b\xf2\xf1\xae\x81\x98\x7b\x51\x65\x01\xcc\x09\x6d\x9a\x61\xa9\x3f\xa7\x34\x60\xef\x3f\x74\xa3\x7a\x9e\x5e\xdd\x23\x5a\xb8\x45\xba\xdc\x9b\xcd\x41\xbf\x1f\xd1\x3e\x78\x9c\x4d\x9a\xd4\x3a\xa5\xd0\xfe\x41\xcc\x94\xc8\x79\x4e\x81\x4f\x79\x27\x22\x03\xa9\x76\x78\x34\x23\x77\x8e\x1d\x0f\x90\x9c\x5a\x86\x65\x69\x0b\x70\x20\x4a\x00\xdb\x9f\x84\x64\x07\x6a\x58\x8e\x2a\x9f\x9f\x85\x0b\xaf\x5c\x58\x90\x0c\x37\xb9\x2f\x8e\x1f\x2b\x27\x10\x53\x7a\x36\x07\x96\x9e\xd7\x0e\x8f\x88\x93\x8d\xe7\x9d\x43\x98\x77\xa4\x72\x9f\x47\xd2\x90\x62\x7f\x2c\x84\xda\xaa\xb7\x06\xb9\xd2\x5e\x5f\x63\xf0\x74\x1e\x7e\x4c\x73\xd4\xf6\x66\x5c\x60" \ -"\x9f\xfc\xb1\xad\xee\x57\x91\x78\xef\x53\x67\x94\x6f\xc1\xc8\x9d\xc7\x54\xf5\xa7\x44\x2b\x09\x45\x37\x53\xa4\x6d\x5a\x2e\x65\xd7\x24\x17\x4a\xaa\x49\x1f\x97\x3f\x0d\xe9\x97\x6b\xf8\x1c\x5c\x23\x46\x05\xeb\x55\xdb\x14\xd5\x99\x9d\xf9\xb0\x25\xff\xbf\x31\xdd\xc3\xf3\xcd\x96\xee\xea\xa8\x89\x99\xc9\xde\xcd\xc7\xa2\x77\x92\x29\x59\x69\x72\x90\x1b\xc2\xa7\x0f\x11\x66\x9b\x51\x14\x40\x19\xeb\xd9\x3f\x9a\xf2\xe1\x0d\x21\xb6\x26\x74\x2f\x6b\x32\xcf\x6e\x1d\x88\x37\x21\x8b\x88\xd6\x3f\x5c\x7d\x5a\x76\xca\x07\x0d\x2d\x2b\xa2\x6a\x35\x8f\x0d\xbe\xab\xe2\xc4\x90\x11\x31\x88\x78\xf6\x63\x1c\xdb\xb8\xab\x91\xe8\xf2\xe1\x56\xd8\x1d\xfb\xf9\x29\xf4\x90\x6f\x02\x0d\x43\x45\x61\x3b\xca\x5c\xfe\x47\xbd\x06\x77\xb4\xba\xcb\x22\x12\x55\x73\x67\xb2\x0f\x8b\x2a\x9a\x27\x18\x00\x13\x16\xf0\xff\xfc\x5d\xd9\x97\x76\x59\x4c\xe4\x75\xc8\x89\x0d\xbe\xf7\xff\x18\xfd\xa2\x18\xb8\x14\x46\xad\xf2\x41\xff\x0e\x55\xeb\x63\x67\x83\xb5\x54\x50\x3f\x9c\xb8\xcc\xbf\x3d\x9c\xfc\x3b\x25\x6d\xe5\x66\x8b\x5e\xb2\xb2\xa4\xe7\x31\x9b\x23\x38\xc4\x0f\xa9" \ -"\x90\xfb\xd7\x59\x81\xe6\x48\xdb\x8b\xc5\x4e\x6d\x66\x19\x30\x2c\x7b\xd3\xd8\x6a\xb9\xed\x7c\x85\x27\x25\xa2\x14\xd3\x86\x9b\xa8\x0b\xde\x98\x8f\xd3\x70\x85\x88\x15\xa9\x59\xbb\x5c\x3d\x90\x7e\x8e\xa5\x5b\x40\x2d\x29\x38\xa4\x6c\x31\xf1\x89\x63\x2c\xbf\x64\x0b\xe1\xa6\xf4\xb7\x0e\x45\x8d\xb8\xc1\xdc\x48\xd3\x43\xdf\x10\x2b\xe3\x22\x57\x5b\x20\xe5\x54\xa2\x71\xfb\x7d\xda\x76\x1f\xfe\x10\x21\xaa\xc9\xd1\x31\x1e\x71\x68\xc1\xd4\x52\x40\x50\xd6\x20\x95\xd9\xf4\xed\xc1\xdf\x68\x4d\x80\xe4\x8c\x37\xfc\xcc\xe5\xbb\x24\x63\x99\xf1\x8a\x87\xab\xa9\x3e\xfa\xb8\x3f\xa7\x8b\xb7\x39\xaa\x24\xd9\xc9\x81\xa9\xde\x4e\x99\x41\x99\xc3\xd3\xe5\x9f\xbf\x00\x91\x0c\xd1\x19\xf7\x7a\x13\x6c\xad\xa3\xbb\xeb\xfe\x57\x50\x19\x6e\xb3\x9e\x30\xe8\x14\x8a\x51\xc6\x4e\x12\x2c\x4b\xb5\x12\xee\x60\x3d\xf7\xe5\xfe\x02\x37\xa9\x20\xb4\x88\xb1\xa1\xd5\x84\x80\x6c\x5d\x9f\xc9\xd4\xee\xdf\xe9\xba\xf3\x04\xf8\x05\x21\xd6\xc1\xd6\x5f\x33\x8d\x3c\x48\x3f\x8e\xb8\x25\x7a\x76\x88\x61\x5d\x8e\xf5\x08\x93\xe0\x7e\x43\x5d\xaa\x69\x79\xe7\xab\x55\x69\xbf" \ -"\x7e\x58\x39\x2a\xfd\xb3\x55\xfb\xc1\xa3\x70\x47\x1c\x89\x68\xc7\x79\x0d\x7a\x3a\xe7\xa0\xb0\x32\xc8\x50\x41\x63\x19\x43\x81\x5b\x61\xb2\x83\xc3\x6f\x94\x86\x47\x39\x91\x71\xd1\xb1\x33\x9a\x1d\x1c\xb4\x4a\x0d\x45\x93\x60\xd2\x6c\xb0\x59\xf8\xee\x40\x8c\x55\xc4\xa9\x14\xfb\xee\xc2\x29\x38\x27\x3b\xe2\xbd\x82\xb2\x5a\xb0\xe2\x2e\x6c\x9c\xcc\xae\x55\x76\xa5\x89\xb8\xa0\x85\x59\xaa\xb8\x25\x30\x41\xf1\xe0\x75\xa4\xf8\xd5\x70\x8f\x80\x17\x82\x85\xd8\x42\xbe\x3f\xee\xb3\x54\x47\x1b\x32\x53\xc7\x5b\x7e\xa4\xc0\x4c\x6b\x64\xe5\x06\x19\xa4\x59\xeb\x75\xf7\x3d\x6d\xcd\x4c\x80\xe6\x29\xf3\x55\x3a\xbd\x80\xd8\x15\x35\x44\x50\x01\x19\xab\xcb\x47\xb0\x2e\x06\x54\x23\x96\x5f\x90\x90\xfd\xd2\x4e\x0a\x1f\xda\xb3\xf8\x5f\x51\xf4\x4f\xd7\x3f\xc4\x64\xa5\x78\x36\x0e\xb4\x7d\x98\x6a\xad\x7d\x0e\x6c\xd3\xa1\x83\xe5\x72\x38\xfc\x10\xdd\x10\xf2\x4a\x57\xa8\x79\x7f\xf7\xd4\xc8\x47\xcc\x74\xf6\xff\x9a\x18\x89\x7f\x2d\xb1\xd4\x11\xd4\x66\xec\x1d\x58\xb1\xa6\x87\x6b\xd2\xe6\xdb\x7c\x47\x62\x32\xe6\x6b\xde\x4f\xde\xbe\x25\xf1\xf2\xa7\x1b" \ -"\x75\xfd\xc9\x4c\xfb\xba\x12\x87\x60\xbf\xcf\x0f\x6b\x43\x92\xfb\x69\x66\x19\xc8\x47\xd1\xa5\x7d\xc0\x12\xe4\xa2\xee\xd6\xdd\x8a\x31\x28\x64\x7a\xf9\x14\x79\x39\xc7\x0b\x00\xf3\x4c\x39\x17\xd3\x6e\xd4\xfa\xda\x5f\x9a\x91\xb3\xad\x2d\xe9\x9b\xf6\x43\x23\xcb\x5d\x05\x02\x5b\x79\x74\x5d\x40\x45\x1f\xb6\xb3\x4a\x3b\xc6\x29\x13\x66\x33\x4c\x7e\xe0\x99\x41\xfe\xba\x5a\x10\x5b\xdc\x9a\x82\x14\xbb\x67\x8d\xf8\xbc\xf5\xfa\x8b\xbf\x30\x8a\x28\xc7\xc9\x9b\x93\x53\x3e\xfe\x50\x03\x6b\x68\x24\x67\xba\x5e\xba\xe1\x6b\xa7\x76\xe6\xc7\x55\xf1\xdb\x8b\x14\x1c\xe9\x05\x83\x90\x65\x15\xe4\xec\xf9\x73\x52\x3e\x93\xaf\xfb\xae\x80\xb0\xff\xf8\x8e\xef\x71\xa5\xfe\xee\x16\x63\xa2\xca\x6c\x4f\xeb\xf6\x20\xdc\x0b\x33\xef\x6d\x04\xcc\xb3\xd4\x56\x26\x05\xe8\xaa\x4c\x97\x83\xa5\xce\x7a\x69\x7c\x6b\x1c\x89\xc4\x63\xc2\x06\x7a\x1d\x4b\xb2\x1a\xe8\x46\x21\xe7\x18\x49\x21\xbb\xb5\xf0\x4b\x16\x72\xa3\x62\x72\x06\x5d\x02\x20\x10\x4f\x5d\x77\xdb\x99\x0f\xb6\x81\x7b\xf2\xa2\xb6\x98\xc8\x18\x0e\x5f\x30\x23\x3c\xed\x47\xb7\x98\x5c\x86\x1f\x52\xae" \ -"\x35\x9b\xaa\x60\xdd\x5d\x89\x5a\x1f\x80\x14\x83\x0f\x56\x9a\x5d\xbe\xb2\x7c\xd6\x82\x2b\x40\x86\xf9\x00\x30\xd7\x5c\xec\xca\x18\x2f\x3c\xe8\xbe\x7c\x03\x47\x91\xb7\xd7\xf0\x01\x64\xeb\xcb\xb9\xcd\x7a\xde\x29\xc7\x7f\x04\x4a\x39\x5c\x50\xe3\x6d\x51\xc5\x20\x26\x23\x35\x5e\xf5\x09\x8d\xf5\xdf\xdf\x5f\x2a\xaf\x9d\xd1\xd7\x5a\x40\x00\xf8\xf4\xf6\x19\x3c\x07\xa9\x8a\xf6\xb8\x60\x9b\x44\x5e\x9b\x16\x0f\xf1\xa9\x14\x31\xd7\xd1\x6f\xef\xc8\x90\x05\x21\x99\x8e\xef\x94\x6e\x75\x6d\xf8\x43\x62\x6d\x9d\xbb\xac\xa0\xa9\x55\x36\x00\x99\x81\xd9\x96\x43\x7c\x97\x65\x6a\x83\xcf\x86\x05\xff\x8b\x92\xc0\x00\x73\x5b\x06\x81\x3a\x3c\x67\x6a\xdf\x34\xd3\x66\xfc\x99\x07\x24\x22\x20\x88\x6f\x18\xe7\xda\x65\x72\x31\x80\xb9\x3a\xeb\x1a\x6c\x94\xd8\x02\x6d\x7f\x4c\xaa\xe6\xa7\x4d\xe6\x90\x78\xea\xb7\x4e\xf6\xcc\xe4\x86\xf9\x58\x64\xc4\xc6\xa8\x71\xd8\x2a\x23\xc1\xea\x22\xc3\x98\x7d\x4f\x4f\x18\xa1\xad\x10\xae\x2e\x43\xaa\x83\x9c\xe8\x56\x59\xad\x1e\x27\xd1\xb1\x32\x89\x54\x6d\xcb\x19\xb3\x69\x2a\x97\x8d\x38\x2f\x92\x6d\xaf\xe1\xf3\xd2" \ -"\xce\x51\xc4\xed\x9f\xc9\xa5\x37\xb5\x99\x45\x99\x75\x76\xd9\x82\x41\x8b\x44\x76\x3b\xc9\xca\x52\x81\xa2\x17\x66\x3d\x9b\x6d\xce\x7d\x29\x6f\x8b\x53\xae\x85\xf2\x2c\x02\xeb\xba\x3a\xf7\x63\x88\xad\x6a\xfa\xf8\x22\x98\x85\x03\xd0\xaa\x81\x17\x3c\x49\xd4\x2e\xbf\xbe\x58\xcf\xdd\xa4\xb2\x2d\xd7\x83\xcc\xe1\x75\xad\x8a\xb4\x03\x00\x0f\x0e\xdd\x49\xb8\x16\xa7\x53\xd8\x1f\x89\xfe\x6c\x5a\x15\xeb\x05\x44\x8f\xec\xda\xb1\xaa\xef\xb4\x08\xa8\x8c\xe2\xbd\x10\x91\x3e\xa3\xe1\x5d\xcd\x25\x78\x62\x81\xf9\x81\xfd\xd5\xae\xc8\x13\x8f\x8c\x09\xb1\x32\x69\x86\x45\x71\xf4\x85\x06\x78\x19\x9b\x84\xfe\xe2\xcf\x2b\x38\xa8\x45\xa9\x5f\x53\xa6\x22\x45\xd5\xbb\x62\xf3\x77\x8f\x79\xf9\x77\x81\xa5\x67\x92\x8c\x0d\x88\xee\xa0\xaa\xfd\xab\xd4\x62\xef\xac\xc3\xf9\x44\xcf\x3c\x18\x82\x80\xa7\xa3\xb2\x82\xdc\x06\x8b\xc6\xc9\x6e\x1a\x5b\x9b\x90\x8f\xd4\x55\x6a\x32\xc6\x4a\xd2\xa8\x92\xe8\xac\x1e\x98\xce\x45\x2c\x2f\x58\xa5\xb4\xdd\x2d\xfc\xf8\x2f\x1a\x21\x8e\xbd\x4d\x4d\x14\xb9\xf7\xf9\x58\x43\x75\xf9\x97\x76\x39\x12\x89\x80\xbd\x86\x94\x55" \ -"\x07\x2f\x3c\x8e\x6e\x69\xfc\x2d\xa5\xbb\x86\x32\xff\xb4\x38\x82\x89\x4c\xbd\xda\x98\x2e\x94\x2c\x01\xef\x2f\x48\xc0\x46\x0e\x4a\x5a\x88\xf5\x23\x28\xab\x1d\x11\x61\x4d\xb8\x20\x26\x26\xfc\x0c\x00\xe2\x0b\xde\x84\xb7\x79\xd1\x53\x03\xa4\xf3\x20\x6f\x6d\x91\xcb\x39\xf1\xc0\x05\x6b\xa4\x80\x03\xda\x45\xb2\xc8\xde\x2d\x41\x69\x6e\x73\xb8\x4b\xf3\xdd\x31\xe2\xaa\xbd\x31\xf6\x81\x21\x96\x26\xcb\x03\xd6\x6f\xce\x96\xa8\x89\xa2\xe4\x03\x60\x69\xb8\x1b\x6a\x51\x20\x93\xe6\x3c\xdb\xc7\xb0\x4a\x64\x12\x50\x8c\x46\x80\x73\x77\x6f\x52\xac\x08\x06\xa8\xbc\x38\xc5\x70\x9f\xa9\xd8\xc8\x5a\xfb\x68\x70\x13\xb3\x47\x3b\xb5\x8a\xe0\x9e\xfc\x94\x32\x41\x37\x21\x78\x8e\x89\x6c\x14\x8e\xec\x90\x59\xc5\xbe\xbc\x13\x66\xe3\xf0\x26\xaa\x81\x7b\x45\x7b\xc1\x0d\x25\x85\x2c\xa7\xd2\x8d\xac\x9a\xd0\x2a\x9c\x23\x7e\xb0\x01\x62\xc1\x87\x66\xeb\xe5\x16\x22\xbb\x12\x6f\x40\x53\x6b\x11\x9d\xf1\x75\x3b\x08\xd3\x3c\xc8\x57\xb8\x59\x84\xf9\x3c\x12\x51\xed\xe1\x35\xdd\x83\xff\xda\x40\xef\xc2\x07\xb5\x28\x03\x2e\x6c\xdc\x34\x6c\x3e\xfe\x8c\x25\x74" \ -"\x0f\x28\xa9\x5a\x2f\x88\x66\xfd\x07\xdf\x84\xcf\x3c\xea\x15\x86\x9b\x3f\x70\x25\x48\xde\x37\x3b\x14\x22\xa7\x47\xde\xdd\xa4\xa1\x5c\x83\xf4\xeb\xf3\xed\xb8\x81\x4d\xa5\xa0\x8b\xab\xea\xea\x45\x71\x80\x5d\xd7\x09\x54\x29\xd5\x23\xa4\x18\x78\xcc\xb4\xb2\x99\x2f\xf5\x39\x16\xaf\xce\x0c\xaf\xcb\x81\x27\x5d\x7f\x12\x0c\x37\x2b\x24\xfc\x01\x68\x74\x3b\x87\xc1\x91\xb7\x29\x3e\x4e\xa5\xbd\xe8\x80\xe0\x0b\x8e\xff\x02\xdf\x5f\x50\xdb\x57\xf9\x79\x1f\xb5\x32\xf1\x1f\x7f\xae\x63\xee\xb0\x74\x41\xdc\xa0\xbd\x19\xcc\x67\x14\xe7\x2a\xc3\x22\xb4\x69\x79\x6e\x63\x95\x8b\x01\xdd\x7c\x43\xac\x2f\xbd\xcf\x0e\xe5\x4f\x9e\xbb\xcb\x7e\xec\x0e\x35\x79\xf3\x84\x4e\x27\x48\x07\xa5\x16\x4e\x29\x65\x80\x14\xa8\x88\xc6\x6d\xe2\x20\x87\xa8\x68\x9b\x73\x39\x32\x42\x11\x48\xf5\x7c\x46\xbc\xc2\x90\x59\x8c\x55\x08\x0a\x81\xe3\xa7\x0f\x0f\xc9\x36\xef\xc2\x9a\xcc\x81\x1b\xbe\xf5\x66\xa6\xb2\xc9\x07\xc5\x4e\x95\x45\xf5\x04\x8f\x04\x54\x0d\xd9\x3b\xf2\xdf\xe2\xc7\xe7\x76\xbc\x37\x73\x38\x0f\xd9\x03\x00\xb5\xbe\x03\xa2\x7f\x78\xce\xb5\x08\xe1\x9b" \ -"\x94\xca\x75\x46\x60\x51\xf6\xa5\xfd\x73\x94\xd9\x8a\x2c\xcb\x24\x2c\xdd\x3b\x7a\x44\xaa\xf8\xeb\x58\xf2\xd1\x2a\x47\x1f\x75\x05\x95\xdd\xd8\x9a\x74\x29\xe7\x8a\x7b\x55\x80\x47\x6d\x6f\x11\x48\xa3\xe1\x6d\x07\x28\x85\x4a\x4c\x9b\x6b\x22\xc1\x72\xf0\x3d\x1f\x18\x2e\xd7\xc5\x60\x72\xd5\x12\xd6\x39\x77\x32\x12\x05\xaf\xfe\x15\xf6\x40\x91\xab\xd9\xf3\x9f\xfa\xe7\xe4\x40\xa4\x61\x3d\x96\x09\xe6\x0b\x8a\x84\x5f\xd1\x8a\x61\x57\x8b\xbe\xab\x87\x9e\xaa\x63\xc6\x12\x7f\x2c\x66\x01\xec\x5a\x49\xd6\x87\x74\x6b\xf7\xaf\x2e\xee\x33\x4f\xa3\xf9\x05\x89\x91\x5c\x8a\x17\xcf\x9e\x32\x6d\x83\x54\x3d\xb8\xfc\xe8\x14\x43\x6b\xbd\x3d\xc6\x1b\x06\xbd\x77\x22\xec\x5e\x69\x41\x8c\xb5\xf8\x20\x0c\x77\x7e\x00\x0e\xe2\x4e\x07\x79\x6f\x2f\x1e\x31\xce\xbb\x7d\xf7\xeb\x06\xe5\x22\xa1\xae\x48\x9a\x25\x5e\x08\x58\x7d\x36\xb6\x64\x2e\x54\x90\xd5\xfb\x3e\x47\xb1\x78\xff\xc2\x0e\x69\xce\x97\xb3\x90\x8c\xbf\xa7\xf8\x2c\x46\xe3\x9a\x8e\x20\xae\x9f\xc7\x9a\x4e\xa5\x44\x60\x49\x08\x0d\xf6\xa2\x9b\x30\x07\x79\x5a\xad\x28\xe2\xa6\xbd\x23\x57\xe1\x2d" \ -"\xd1\xdc\x46\x16\x9c\xd8\x27\x7e\x54\x8e\xcf\x64\xdb\x9b\xa6\x2b\xfd\xa1\xff\x8f\x94\x5d\x11\x07\x6d\xb0\x70\x0e\x57\x93\xba\x7b\x20\x9f\xfc\x53\x6f\xb6\xfa\x1c\xef\xcf\x5c\x40\x11\x1a\xd8\x00\x29\x18\x8e\xf6\x13\xac\x20\x89\xea\x45\x93\xfb\xea\xcf\x5f\x06\x71\xd1\x6b\x45\x7a\xc6\x94\x0d\x12\x1c\xee\xbf\xa8\xcd\x90\xea\xb5\xf7\xc0\x97\xb0\x5f\x9d\x3c\xe0\x1a\x78\x18\x10\x42\x66\x33\xb9\x6f\x27\x06\xcd\xbb\x10\x01\x8d\x2d\xea\x30\x90\x1a\x5c\x9b\xd5\xda\x58\x97\x00\x6f\x6d\x1c\x2c\xac\x18\xd7\xcd\xba\x2a\x77\x7c\x30\x29\xc7\x55\x51\xf4\x18\xaa\x47\x9c\x8d\xf9\xea\xc1\xae\x4d\xb8\x2f\x6b\x70\xeb\x7c\xfe\x07\xa3\x9c\x47\x3b\x7a\xe0\xc4\xd7\x47\x51\x91\xcf\xb2\x61\x76\x2d\x9a\x6d\xbe\x8f\x3f\x53\x87\x6e\xa6\xae\x2f\xc3\x21\x00\xea\xd4\xdf\x0b\xf8\xd2\x9e\x11\x8b\xef\x0f\x39\x85\xb9\x98\x47\x38\x02\x3e\x0a\x67\xf3\xf7\xb6\x51\x0a\x26\x31\x07\x83\x0a\xca\xb8\x4f\x95\x54\xd5\x7a\x85\xd0\x18\x8d\x84\x0c\xf4\xfb\xa0\x29\x38\xdb\x7b\x78\x17\xf0\x28\x1d\x20\xd5\xde\x24\x31\xad\xb0\x0b\xd1\x91\x68\x9a\x9a\xb6\xb7\x05\x3c" \ -"\x83\x46\xe0\x2f\x7d\x6e\x2f\xf6\xb4\xde\x7d\xf3\xfb\x37\x19\x93\x4d\xa4\x74\xda\x98\xbf\xf4\x2f\xc7\x44\xd0\xd1\x31\x5a\xc5\xb0\x02\xbf\x7f\xc6\x30\x10\xa8\xf3\x29\xc3\x32\xaf\x21\xac\x5c\xb9\xfe\x60\xdd\x41\x18\x24\xbb\x0a\x68\xf2\x65\xb9\xb0\xce\xd7\xa6\x52\xbd\xf5\xd0\x3e\x26\xcf\x61\xc0\x2d\x2e\x62\x42\xc9\x45\x5f\xce\xd3\xcc\xe1\x89\xcc\x64\x6e\x3a\x54\x1d\x70\x90\x33\x0f\x01\xaa\x4f\x29\xef\x4d\x01\xd0\xd1\x50\xd0\xd6\x1b\xa8\x99\xe5\xbc\x28\xfa\x0d\xf0\x17\x60\x36\xeb\x17\xca\xa5\xd7\x6d\x8f\xa3\xa1\x88\x65\x6d\x62\x66\x36\xe7\x8d\x9d\x16\x05\xc9\x59\x0a\xf1\x71\xe1\xb9\xea\x80\xd4\xce\xba\x3b\x72\x4f\x45\x2b\xab\xd0\xdb\x3f\xdb\x70\x36\x4d\x9c\x74\x96\x8c\x71\xba\x4f\x83\x6d\xe7\xcd\xaa\xfd\x83\x61\x8d\x6b\xf2\x05\xee\xa7\x20\x87\xc2\x8f\x97\x47\x16\x51\xfe\x54\x78\x67\x83\x3d\x56\x7e\x42\x33\xc9\x00\xaa\x46\x12\x26\x98\xe1\x03\x75\x62\x64\x8d\x72\x27\xa1\xbd\x92\x94\x2b\x37\xbd\x12\x9d\xb5\xb9\x07\x75\x4d\x38\xe5\x5b\x50\xe9\x4f\xa5\x8c\x18\x62\xc5\x82\x32\x46\x2c\x6f\xe6\xf1\x5c\xcc\xf6\x4e\x13\x12" \ -"\xe7\xdb\xc9\xcf\x54\xcd\x89\x8a\x71\x2d\x04\x48\x91\xcc\x03\x56\xe6\xc8\xd0\xa6\xda\xb7\xd9\x15\x59\x17\x28\x6b\xa1\x44\xe6\x60\xec\x5b\x6a\x0f\x26\xff\x84\x0d\xf8\x62\x6a\xb1\xdf\x36\xf7\x72\x52\x93\xa1\x2a\x2b\x0a\xc0\x0c\x5e\xc8\xf8\xc8\x55\xe7\xf7\xf6\xc9\xdd\xb4\xd9\x71\x0c\xde\x58\x35\x15\x06\x1a\xd6\xdc\x98\xfd\x5c\x38\x9e\x11\xe9\xda\x5f\xea\x5b\x61\x47\x94\x0b\x03\xe2\xc7\xfa\xc9\x84\x5c\xf4\x12\xd2\xf8\xd4\x59\xb6\x60\x49\x79\xfa\xde\x3b\x79\x76\x13\x1c\xdd\x7e\x30\x77\xbe\xd9\x48\xc2\x5b\x04\xd5\x11\x89\x22\xf6\x07\x06\x8f\xf5\x61\xc0\xfc\x37\x91\x52\x0a\x4d\x6f\x1f\x50\x4a\x9c\x0e\x44\x6f\x52\x4c\xa8\xcb\x09\xdc\x36\xe9\xaf\xba\xa9\x68\xf3\x02\x8f\x6d\xd5\xf7\xa3\xc4\xb5\x25\x10\x32\xda\x1c\x81\x76\xa2\xbb\x62\xca\xe2\xf4\x27\x1b\x5a\xff\xeb\x7d\x62\xce\x9b\xb3\xd3\x3a\x87\x50\x61\xdc\x20\x88\x12\xe2\x3c\xfb\x33\xaa\xa5\x2f\x04\x3f\xa0\x29\x69\x55\x17\x7a\x20\x91\x45\x55\x9f\x93\x49\xd1\xc9\xa9\x19\xe1\xa4\x06\x97\x5c\x09\xdf\x37\x89\xca\x43\xdd\x64\xa1\xf8\x0a\xd1\xc3\x1b\x92\x04\xdb\xe3\xbe\xcb" \ -"\x86\xe4\x0a\xa0\x22\xdd\xfa\x6e\xcb\x21\xba\x3c\x88\xb9\xeb\x48\x2d\x69\xb0\xa1\x24\xa9\xb9\xae\xa8\x92\x17\x39\x80\xc6\xa2\xc2\xc5\x3e\xfe\x66\xc8\x9a\x8c\x62\x28\xd0\x80\x5f\x97\x4d\x28\xbe\x58\x4b\x9c\x2f\xcf\xdc\x0b\x7d\x9f\x18\x59\x8e\x3c\x02\x9c\x19\x2c\xcb\x27\xde\xa6\x7a\x5d\xd7\x5b\x57\x39\xc7\x45\xd3\xf4\x8c\xf1\x6a\x2b\xc1\x0a\x96\x41\xe2\xa3\xca\xa5\x9b\x5d\xdb\xcf\x1c\xae\x9d\xc9\xc7\xa9\xae\x1c\x24\x75\x6a\x9b\x57\xd1\xdf\xab\x68\x48\x4c\xb4\x65\xc4\xf8\xa3\xfc\x96\x21\xe0\x76\x80\x82\x91\xd3\x1c\x50\x11\xae\x21\x9c\x6c\x8b\x78\xe1\x6f\x09\x2e\xe4\x4f\x70\x79\x23\xb5\xaa\x0c\x83\xad\xa9\x04\x28\x08\x65\x22\x9a\xe3\xc8\x39\x32\x76\xdc\x80\x15\xd0\x3e\x83\x44\xc1\x34\xa3\x23\x60\x2d\xe1\x1a\xdb\x32\xc2\x2c\x16\xb5\x53\x15\x52\x23\x64\x0a\xf1\xda\x0c\x68\xf0\xfe\xbe\x36\x30\xd5\x57\x41\xb7\x1b\xe8\x17\xf6\xa9\xb3\xa4\x37\x42\x46\xdb\x07\xd6\x80\x3a\xf4\x78\x34\xff\xd5\xaa\x51\xeb\x10\x2e\x12\xe5\xba\x8b\x76\x7f\x0c\x4a\xad\x6a\xab\xa1\x03\x6c\x03\x71\xd3\x02\x58\x5a\xe3\xca\xc4\xc3\x45\x58\xa8\x28" \ -"\x57\xf7\xd2\x05\x1a\x75\x9f\x2a\x03\x49\x94\xf7\xec\x6e\x10\xec\xa9\xb3\x16\xc6\x20\x4f\x8a\x60\x46\x06\xa1\x1b\x47\x9b\xf1\x70\x3c\xbc\x33\x86\x9a\x00\xcf\xcb\x2b\x66\x58\xb4\x8b\xef\x48\x1a\x2e\xae\x4c\x41\x0e\x87\xca\xd3\x7c\xc9\x04\xe3\x28\x77\x2e\x66\x17\x47\x8f\xa7\xa4\x4d\xc0\x87\x10\x1b\x94\x7f\x7b\xbf\xd1\xa0\x31\x5d\x8a\x5e\xa1\xb5\xcd\x50\x50\x21\x49\xcb\x2d\x24\xc2\xad\x56\x07\xea\xc8\x8a\x14\x3e\x14\x6e\x54\x10\xee\xcf\x7b\xaf\xe9\x28\x87\x33\x55\x88\x40\xcc\xc6\xcf\x97\xa2\x85\xcf\x3a\xf6\xbb\xc9\x5b\xb9\x4c\x2e\xd1\xad\x99\x47\x9e\xf1\x6d\x42\x81\x6d\x13\x46\x1e\xba\x4c\xf9\x7d\xc5\xf3\xdf\xdb\x10\x5d\x86\xe8\x3b\xbc\x2a\x04\x9b\x81\xec\x91\xa6\xf4\xde\x67\x03\xa6\x91\x96\x39\x81\x13\xfd\x9d\xf2\x42\x61\xa5\x6b\x57\xb4\xf5\xf7\x2f\x13\x22\x87\xdb\x5e\x4c\x76\x9c\xf7\x94\x2c\x8e\xa4\x14\xb8\x60\xb3\x8a\x36\x27\xd4\xeb\x60\xd7\x27\x2d\x33\xd7\x27\x2f\x77\x78\x16\xc5\xa6\x9e\x1a\x73\x15\x10\x6e\x17\xa6\x84\xd1\xe8\x67\xf8\xc8\x85\xee\xe0\x0d\x32\x6e\x21\xd3\x9a\x05\xef\x89\xe2\x57\x83\x98\xe1\x3b" \ -"\xd0\x31\xcc\xed\x51\x95\x22\xa7\x2e\xb5\x79\x6e\x1f\x6c\xe2\x0a\x50\x06\x2f\x54\xb4\xb0\x56\x46\xab\xdd\x55\x8f\xac\xe3\x78\xe5\x4b\x8c\x85\xc3\xb0\xad\x5c\x52\xb3\x61\x73\x74\xec\xe0\x46\x2c\xa6\xce\x17\x63\x00\xd5\x2f\xcb\x99\xdd\xb2\xf6\xc4\x1e\x4a\xd0\x64\xf5\x55\x88\x84\x06\xd5\x49\xc7\xf8\x3d\xce\x8d\x4a\x3d\x64\xb5\x9d\x33\x83\x5f\x74\xd9\xda\xa2\x20\x88\x0a\x73\xdd\x41\x10\xdf\x13\xa3\xac\x49\x8c\x61\x45\x43\xc7\x74\x89\xfb\xbc\x6a\x44\x4e\x19\xe1\xca\x28\x75\xa1\x72\x0a\xd0\x1d\x30\xd9\x52\xea\x4b\x86\x9c\x09\xfd\xf1\x90\x16\xba\x8b\x65\x6f\x25\x48\x5f\x21\xb1\x14\xf6\xd2\x84\x01\xff\x54\x99\xab\x8c\xde\x39\x56\x22\xb5\xe4\x27\x0d\x9e\x23\x39\x71\x10\x3d\x61\x6f\x27\x30\xc0\x58\x66\xc9\x53\x49\x71\xe3\x74\x14\x49\xa9\x87\x6b\x08\x60\xfa\x17\x19\xf2\x33\xa6\x1d\xa0\xa9\x2b\xef\x5a\xfe\xc6\xd1\x36\xf9\x1f\xd9\x17\x76\x39\xc0\x14\x45\x4d\x32\x18\x22\xbe\xa6\x1c\xb5\x31\x7e\xde\x85\xab\x00\x55\xd4\xe2\x5e\x23\x0b\xba\xfd\x2a\xa2\xe7\x6f\x29\x35\x15\x00\xc4\xd3\x11\x49\xb4\xd3\x2b\x0a\x0b\xa9\x2a\xd9\x64" \ -"\xdc\x6a\xd3\x08\x44\x2c\x41\x7c\xd6\x67\xc6\x1e\xbf\x19\x47\x36\xaf\x26\xb3\xc7\x46\x8a\x61\x6c\xff\x8a\x7d\x28\xe3\xa1\x4c\xed\x89\xb5\x97\x82\xc7\x93\x32\xca\x3f\xcc\xc9\xd2\xb0\x60\x22\x38\x43\x7b\xb7\x01\x4c\x9a\xeb\xb3\xd8\x0c\x75\xbc\x2e\x9c\xfc\x71\xa0\xe9\xc5\x55\x88\x1e\xf8\x8c\x0c\x5e\x86\x41\x56\xc3\xea\xf6\x5b\xa9\x16\xf6\xb3\x32\x09\x72\xdd\xb5\x75\x4b\xf8\xfa\xb2\x0d\x1b\x11\xfd\xf2\x2e\xd9\x26\xad\x29\xc7\x1d\x4a\x28\x23\x44\xd2\xd0\x3a\xb4\x85\xf4\x8a\x71\xcf\x22\xe1\x7a\x5c\x6f\xdd\xb7\x18\x96\x31\x07\x15\x42\x38\x3a\xa5\x72\x53\x1b\x1f\x30\x0e\x06\xa0\x42\x2d\x40\x57\xb8\x07\x1d\x7b\xf8\xe7\x4c\x01\x85\x52\x7a\x36\xc6\x2b\x8f\x87\x05\xad\x5a\xea\xc1\x0b\x0d\x9e\xc8\xd2\xeb\x22\x10\x93\x22\x0c\xa2\x7d\x11\x2a\x78\xb2\xfe\x46\xf7\x62\xef\xfd\x79\x06\xe4\x88\x8e\xe0\x54\xb5\xf4\x7a\x82\xa5\xf7\x1a\x28\x07\xc2\x4b\x45\x6d\x9a\x08\x45\x49\x13\xbb\x5d\x8d\x85\xa3\x8e\x66\xe6\xa7\x40\x3c\x52\x8c\x49\xcd\xdd\x2c\x8b\x6a\x43\x4b\xe8\xc0\xc9\xc7\xc6\x03\x8a\xe4\x8c\xa1\xd4\x39\x37\x33\x5e\x26\x59\xe1" \ -"\x5c\x25\xef\x38\x23\x32\xcb\x7b\x91\x8c\x3e\x25\x4e\x11\xdf\xec\xd3\x03\x98\x30\xc8\x49\x12\xca\xcb\x64\xb9\xab\x33\xfe\x8f\x27\x8d\x7d\x1c\xec\xb3\x2d\xea\x7e\x14\x41\xae\x61\xf1\xf2\x2d\x3f\x31\x0a\x89\xea\x89\xba\xe1\x84\x24\x36\xc3\xad\x15\xb9\xa3\x76\x7d\xf4\x42\xac\x91\x7c\xf2\x05\x15\xe6\x33\xa5\x18\x47\x9d\x74\xac\xb7\x93\xb0\x94\x88\x58\x54\x0a\x53\x16\xad\x43\xe4\x11\x25\x88\xf8\xea\x4d\xe9\x91\x6f\xfd\x1f\x4d\xd4\x6f\xde\xd7\x2e\x4d\x1d\x0a\xc0\x79\x11\xad\x46\xfc\x35\x88\x10\xb1\xa2\x1c\x71\x7c\xb5\x92\xeb\xf8\x50\x50\xf2\x5e\x15\xc0\xa2\xec\x15\xa3\xf4\xd9\x0f\xa7\x54\xc3\x2b\xd8\xdc\xb1\x45\x63\x23\x3a\xd9\xfc\xc3\x66\x0d\xc4\x69\x06\xd9\x30\xd1\xc7\x8f\x8b\x33\xe3\xb4\x50\x94\xce\xb7\x99\x1f\xf5\x3c\xb6\xcd\xc7\x99\xf4\xe8\xfb\xd1\xa9\x2a\xa3\x43\xd9\xb5\x1b\x39\x73\x6b\x4e\xc0\xfe\xec\xb7\xe6\x72\x2a\x9b\x13\x8e\x53\xcf\xac\x35\x14\xfa\x02\x96\x25\xd6\xba\x23\x08\xb3\xaa\x5a\xd6\xa0\xda\xfb\x82\xc5\x18\xbf\x17\xec\xe3\x9d\x03\x60\x20\xa8\xad\xf8\xd7\x29\x0e\x0e\x50\x86\x22\x41\x6c\x6a\x2e\xc3" \ -"\x96\x96\x7b\x67\x38\x79\xca\xd5\x6b\xf5\xbf\x81\xc0\x28\x5a\x05\x1e\x64\x77\x9c\xd0\x16\xce\x77\x30\x45\x36\x16\xe6\xd9\x61\xa7\x72\x69\x9b\xbc\x4e\x03\xaa\xe2\xd1\xa7\x93\x9a\x5a\x7e\xc1\x0c\xfd\xe4\xa5\x03\x1f\x66\x6a\x02\xeb\x12\x27\x98\xad\xb6\xc2\x7e\xb7\x72\xca\xd1\x20\x44\x62\x63\xb9\x37\x15\x74\x59\xe0\x4f\xa0\xa6\xab\x27\xb3\xad\x92\x4f\xa7\x24\x4b\xc3\x16\xf8\xb1\x61\x7a\x0e\x56\xea\x63\x14\x8a\xfc\x02\x1f\x2f\xbf\xbb\x88\xe0\xe9\xac\x1c\x3b\x4d\xe7\x7c\x56\x43\x19\x09\xde\x77\x9d\x1d\x1e\xa6\x6f\x6b\x8a\x99\xfe\x1a\x69\xf3\x5b\xd0\x02\xf9\xbc\x28\x22\x8a\x5b\x20\xab\xf6\x40\x39\x07\x91\xf3\x9b\x5d\xe4\xe4\x9e\x5e\xb9\x95\x3f\xec\xb0\xba\x23\x91\xab\xd1\xd5\xd6\x01\x9e\x8f\xb9\x21\xf8\x54\x01\x5b\xc9\x00\xae\x70\x34\xa5\xca\x18\x14\xea\x7d\xff\x8e\x23\x8a\x15\x57\x9d\x28\x57\x96\xde\xe2\x72\x77\x7f\xbe\x7b\x19\x0a\xaf\x14\x42\x23\x08\xfd\xcb\x11\x4f\xef\x4f\x31\x5c\x6f\x3e\x40\x5e\x96\x5f\x32\xf6\x13\x4e\x59\xf7\x04\x19\x92\x8e\xc9\x65\x89\x24\xb3\x5d\x50\x9e\x90\x22\xf8\xad\x14\xf5\xb4\x1e\x84\xf1" \ -"\x0a\x78\xcd\x0a\xc8\x77\xc3\xc1\x30\xcd\x8f\x30\x35\x9b\xf2\x32\x63\xb5\x9a\xb6\x2c\xf3\x05\x12\x79\x8c\x3c\x38\x8d\xd5\x9c\x9e\x7a\x1c\x7d\x2a\x98\x53\x2f\x84\x10\x36\xf6\xa4\x7b\x44\xed\x97\x14\xa1\x80\x18\xfb\x99\x24\x09\x64\xe3\xeb\x0f\xcc\x21\x45\x5a\xaf\x47\xc8\xd7\x18\x1c\x88\x7b\xe0\x70\xcd\xb7\xab\x82\x77\x9d\x57\x9b\x37\x59\x32\x79\x8f\x0c\x76\x33\x83\x6d\x6f\x27\xc2\xce\x77\x96\x59\x09\xc7\x56\x58\xcf\x20\xf1\x8d\x6a\x0b\x13\xf1\x8c\x4a\x13\xf1\x74\xba\xe0\xd8\x8b\x53\x23\xba\xbd\x7a\x40\xa8\x79\x3f\xb6\x65\xe8\x98\x60\x04\xa2\xbf\x98\x49\x0c\xf0\x37\x33\x70\xda\xd8\x81\x1e\x27\x31\xd1\x84\x18\x8c\x16\x11\xd8\xda\x78\xdd\xf8\x28\xa9\x18\x4e\xc6\xdb\x63\x56\xe1\xe9\xff\xef\x76\x0d\x2c\xbe\x91\x98\xcf\x65\x66\xa8\xcc\xd4\xb3\x6d\x36\x65\x30\x9b\x5b\xaa\x0a\x57\x83\x31\x5f\xa5\xc7\x3e\xa2\xbb\xef\xba\x07\xe1\x80\xb2\xc9\x27\xdf\xd5\xc2\xca\x41\xd8\xbc\xcc\xa1\x35\x67\xc8\x6c\x38\x77\xcd\x98\xe3\x69\x08\x37\x63\x64\xe2\xe3\xce\x68\xac\xf9\x7e\x27\xb9\x01\xf3\x86\xe2\x68\x24\xb0\xf2\x33\x1b\x53\xfc\xfa" \ -"\xdb\x02\xc9\xc5\x40\x9c\x66\xab\xac\x3b\x23\x3c\x9a\x70\x20\x0e\xfc\x4e\x5b\xa2\x36\x8b\xdf\x9a\x61\x9d\xec\x31\x21\xfd\x43\x3c\x64\x7f\xcc\x53\xeb\x07\xd9\xd7\x88\x55\x4c\xac\xa1\xb4\x36\x3d\x2b\xbb\xcf\x7d\x32\x9d\xf6\x60\x9f\xcb\x11\x3d\x1a\xb8\xce\xce\xe8\x49\x20\xde\xfc\x40\x9c\x4e\x8c\x29\x79\x49\xde\x85\x48\x62\x2d\xa1\xac\x2a\xe6\xa4\xf8\x8b\xff\x8c\x54\x05\xf4\x83\x9e\xb9\xb1\x05\x1b\xc9\x44\x45\x25\x20\x0b\x4f\x0f\xda\xc9\x29\x3d\xdc\x52\x66\x8f\x89\x5d\xa1\x5d\xb8\x85\x8c\x09\x76\xdc\xd9\xb8\x9d\xe3\xb8\x01\xdb\x23\xb7\xb7\x9a\xc3\x7b\x3b\x7c\xa6\xfb\x97\xf8\x53\xc7\x9e\xa3\xce\x04\x83\x20\x45\x89\x5d\x34\xd5\x54\xdb\xe1\x55\x92\x1a\x15\x7a\x8a\x6c\xbd\x5d\x1d\x24\x13\x7f\xb9\xfb\xba\x86\x01\x8b\x82\x94\x18\x93\x71\x99\x12\x9c\x71\xdc\x88\x63\xcf\x10\xe0\x76\x05\x7d\xf7\xdf\xbb\xff\xb0\x2d\xe1\x64\x41\xe6\x5e\xf7\x6a\xec\x8b\x30\xaa\x87\xbc\x6e\x48\xf5\x4d\xe5\x77\x79\xdd\x75\x50\xa1\x0b\x53\x6f\x68\x07\x10\xd7\xc8\x4c\x46\x1e\xeb\x6d\xff\x6c\x33\x16\x27\x76\xa6\xb9\x0a\xc9\x19\x87\x8b\x7b\x2f\xe7" \ -"\x5e\xed\x2c\xcd\xe0\x65\x9f\xdb\x34\x4b\xdb\x75\x7f\x5e\x25\x62\xa6\x1a\xda\xb6\x87\x4f\x61\x80\x2f\x50\x0b\x81\xe8\xc7\x49\xee\x14\x60\x49\x08\x0d\xf6\x96\x71\x10\x5d\x1d\x3f\x63\xb8\x7f\x30\xb8\x0f\xc9\x29\x08\x49\x14\xfe\xba\xbe\x55\x39\x6a\xdb\x32\xde\xf5\x13\x01\xe0\x7e\xcc\xb0\xd4\x2e\xca\xfd\xf6\x8b\x8b\x9d\xa5\xe0\x64\x10\x30\x32\x92\x92\xbd\xd7\x69\xfa\xdb\x07\x69\x1b\xc3\x3a\xb9\xdf\x18\x84\xc7\x79\xb7\x1c\x0f\xf2\xaa\xc4\x78\x74\x10\xc5\xd1\xe2\x39\xdd\x06\x14\x9a\x62\x32\x64\xd1\x44\x23\x39\x4d\xa8\x8b\x65\xb3\x49\xb6\x9e\xed\x36\x8c\x27\xb5\x6c\x9a\x8b\x70\xb9\x70\x58\x33\x7d\x5d\x1a\xca\x4d\x9d\x30\x58\x42\x4a\x40\x37\x99\x4e\x7b\x9c\xab\x3b\x2b\x0b\x8e\xf9\x89\x19\x88\xdb\xf4\xd2\x75\x2c\x9c\x88\x50\xe0\xec\xd5\xbe\x47\xfc\x87\x25\x5f\x07\x05\x1c\xac\xf1\x1b\xd9\x8c\x13\x2a\x8a\x6b\x47\x0c\x4b\xb3\x70\x1d\x81\xbf\x09\x8d\xb3\xff\x01\xa2\x07\x76\x69\x2f\x31\x69\x2c\x14\x56\xb9\x02\x7d\x92\xf1\x9f\x69\xb0\xdd\x73\xd5\x0e\x42\xca\x5f\xfa\xd5\x2b\xf8\xb0\x04\x2e\x27\x54\x13\xba\x50\xf2\x35\xb6\x9c" \ -"\x03\x2b\x08\x4f\x58\x9c\x7f\x0b\xf7\xb3\xc7\xd0\xfb\x25\xd9\x16\xcf\xbf\x80\x35\xa0\x10\x9f\xc5\x13\xd6\xf0\x1d\xc1\xd4\x49\xbf\xf4\x1b\xbd\xe5\x63\xfb\xfe\x32\x2a\xbf\xc7\x0f\x95\x8d\x51\x3c\x19\x87\x78\xe7\x28\x54\x7f\x3b\x96\x7f\x2d\x9a\x87\x7c\x6d\xfc\xba\xcc\x62\x94\xa2\x85\x0a\xea\xe8\x98\x58\xd8\x36\xf2\xce\x4e\xa0\x0c\x4e\x0a\xe4\x02\xee\x32\x09\xe6\x74\xcc\xce\xa0\x09\xc7\x0c\x0c\xe0\x0d\x99\x51\x33\xfd\x8c\xc5\x94\x2f\xc0\x0e\xbb\xff\xd8\x6e\x8d\xc6\x23\xd4\xf4\x43\x4d\x30\x57\x2e\x2e\x71\xcd\xdc\x51\x69\x6d\x09\xf8\xc2\x64\x47\xbb\xa0\x09\xdd\xb2\xb0\x77\xc4\x24\x88\x0c\x44\x22\x71\xdd\xfa\xfa\x04\xfb\x14\x89\x46\xf1\xac\xb2\xb9\xd6\x17\x37\xc4\x1f\xa0\x4c\xd6\xe6\x8b\xc0\x90\x78\xbc\xe1\xd7\x84\x21\x69\xb2\x53\x45\x5c\xc0\x70\x7b\xdd\x22\x07\x49\x91\xe9\x38\x0c\x43\x6a\x98\x4d\x8f\x4d\xd9\x66\x06\xc7\x35\x0e\xa2\x0c\x86\x5b\x3b\xa9\xb5\x12\x2f\x0b\xce\x45\x41\x42\x1b\xa0\x62\x95\x16\x18\x35\xc4\x77\xe7\x54\xd3\xf6\xe7\xda\x63\x78\xc5\x97\x1e\x99\xc0\x78\xfd\x46\xea\xfd\xef\x22\x4a\x06\xe9\x95\x9b" \ -"\xd6\x0c\x7f\x39\x5c\xe1\xc9\xe9\x74\x30\xe2\x5e\x9f\xd4\x4e\xde\x63\x74\x1d\xbb\x03\x3b\xa7\x44\x6c\xa2\x92\x7d\x06\xb2\xe6\x3c\x9e\x3c\x55\x5e\x71\x5d\x02\x4b\xc3\xea\x42\xc8\x94\x80\x32\x38\x3a\xcd\x4f\xe2\x0b\xbd\xbd\x58\x20\x43\x53\x54\xbc\x1f\xb4\x4f\xfc\x09\xb1\xc7\x35\xa3\x42\x36\x6e\xf5\xae\x71\xe1\xcc\xb4\x95\x06\x8d\x12\xfa\x96\xa8\xe5\x63\x6b\x6e\x6c\x3f\x46\x2b\x92\xd8\x40\x2a\x03\xe3\x92\xdf\xe9\x06\x8c\x6c\xee\x15\xf5\x46\x0e\x98\x5c\x6d\x8a\x68\xc8\xc3\xf8\x7d\xe6\x08\x04\x8a\x7d\xe4\xdd\xe1\x62\x92\xe6\x5b\xe1\xf7\xcf\x1d\x70\xb9\xca\x9d\xda\x12\xc1\x2d\x36\x2f\xd7\xa2\x1d\x5c\x5f\x0d\x58\x28\x81\x01\x96\x6a\xcb\x75\x4c\xb0\x9d\xa9\x3d\x2d\xc9\x43\x23\xee\x95\x15\xae\x32\xa2\x96\x78\x16\x90\xc3\xbb\xd6\xef\xb2\xe7\xa5\xc8\xa7\xaa\x6b\x62\xf2\xcd\x48\x71\xa6\xa3\x06\xc5\x39\xd2\x6a\xe7\xc0\x11\x70\x4d\x53\xab\xd8\x7f\x49\x8f\xb6\xe0\x6f\x68\x89\x7b\x77\x34\x99\x2a\xcd\xa1\x91\xae\xa7\x26\x75\x82\x52\x1f\xe4\x66\xea\x1e\xc7\xc2\xcf\x49\x6d\x40\xe7\x37\xdd\x41\xe1\xcb\x1c\x71\x02\x78\xc9\x16\x7d" \ -"\xd3\x4c\x52\x3a\x4b\xb5\x21\x79\xbd\x8a\x46\x7a\x9b\xfc\x85\x33\x23\xf1\xc1\x79\x94\x30\x2c\x9b\x7b\xf0\x09\xa9\x91\x0f\x4f\xd5\xb4\xa0\x1e\xc6\xe1\xd1\xba\x7c\xba\x35\xf0\xf6\x0d\xbc\x34\xd3\xdd\xb5\xd4\x8c\x8f\xbb\xb2\x0b\xb5\xca\x4e\x32\x37\x77\xe4\x71\x78\xe7\xb8\xa5\x7a\x79\x5e\xb5\xde\xf8\xe1\xcc\xf5\xae\xcd\x3f\xdb\xc0\xf6\x52\x65\x6d\x73\xa0\x99\x52\x83\x26\xdb\xe5\x3a\x72\xcd\x8a\x8d\x89\xed\x59\x5e\xf5\x54\xb1\xa6\x00\x26\x10\xad\x38\xf8\x43\x37\x72\xfc\x59\xfb\x92\x5d\x18\x68\x71\xb5\x25\xa4\x25\x9e\x60\x89\xbf\xd6\x15\x33\xd7\x3a\x7b\x6f\xa1\x74\x9d\x70\xd3\xbc\xd2\x34\x69\xdb\x5b\xd5\xbf\x85\xab\x2f\x66\xae\x33\xaa\xb4\x0a\x1e\xb5\x11\x2b\x4c\x0d\xf2\x88\x29\x2d\x9b\x18\x2d\x4f\x92\xda\x06\x6b\x2f\x8e\x20\x8d\x5e\xa5\x0c\x95\x54\xaa\x7a\xca\x43\x82\x7e\x27\x81\xf4\xbb\x13\xe3\x16\x6c\xea\x5e\x62\x3d\x9b\xfb\xe4\xd4\x2b\x25\xfe\x51\xde\x29\x43\x05\xe1\x7c\x35\xcb\x6f\x18\xd4\x40\x11\x55\xc2\xff\x38\xbe\x73\xc0\xcb\x37\xaa\x98\xbb\xa6\x74\x55\x42\xa7\xd5\xf7\x81\x0f\x76\x56\x68\xe0\xc3\x6c\x6d\x06" \ -"\xc8\xbf\x22\x8a\x75\x4a\xb6\xd1\x12\xcc\xb6\x8b\xb8\x1b\x6b\xaf\x0e\x91\x9b\xc5\xfb\x35\x8d\xd1\x62\x82\xe6\x02\x5b\x5b\x5a\xfe\x83\xfc\x5b\x55\x27\xd4\x49\x5a\x39\xb8\x90\x1a\xa3\x06\x20\xf3\xea\xa2\xea\xec\xa7\xea\x49\x71\x32\x4d\xa5\x81\x7a\xd3\x06\x22\xc2\xb8\x1d\x87\xe2\x5b\x72\x0e\x60\xf6\xf3\x16\xc8\xf2\xdc\xae\xe3\xf4\xa8\xc7\xc5\x37\x72\x3e\xd7\xac\x3a\x3c\x52\x29\xcd\x08\x6b\xfd\x3e\x6c\x7a\xf9\x4e\x89\x27\xa7\x0e\x23\x99\x88\x3e\xc1\xd3\x78\x31\xed\xe8\x16\xd7\xbe\x84\xa1\xfa\xf9\xae\xfd\x5a\x5d\xd2\x23\xde\x23\x3e\x3c\xcc\x6b\x3f\xc6\x79\x93\x44\xd5\x4b\x31\x32\x03\x05\x4a\x1e\x5c\x77\x0b\xdf\x85\xde\x1d\xe9\xf8\x5d\x57\xc2\x8b\x54\x34\xd6\x2c\x92\x13\xf1\x52\xcc\xa3\x9a\xfd\x82\x9f\x58\x94\x74\xcf\x1d\x72\x75\x96\x9a\x18\x51\x4e\x5f\x01\xd0\x54\xc5\xac\x8d\x03\x6b\x12\xc0\x78\xc4\x5b\x1e\x52\x5a\xe8\xa3\x0a\x8e\x60\xc6\x3e\x7e\xd4\x99\x64\xcf\x92\x7a\xe9\x5c\xbc\x93\x1b\x09\x66\xcc\x77\xd1\xf2\x47\xde\x6c\x72\xf9\xad\x3b\x0e\x43\x1a\x68\xf0\x88\xc7\x46\x83\x27\x86\x12\x01\x98\x4f\xe0\x82\x68\xc3" \ -"\xb3\xd7\x5a\xba\xf4\xee\x0c\x5a\xb5\x91\x4b\xee\x54\x9e\x6f\x3f\xbb\x79\x98\x84\xa7\x96\x8a\x3e\xcb\x28\x46\x8a\x9a\xd2\x25\x32\xe2\x45\xfd\x8f\x1a\x00\xf3\x83\x05\x8b\x4f\x30\x30\x73\x7a\x3d\x47\x29\x01\xe8\xef\x04\x60\x4a\xd1\xfd\x80\xe0\xde\x9e\x61\x96\x10\x1e\x84\xf0\xc7\xc5\x76\x0d\x47\x38\xa0\xbe\x23\xd7\x6e\xa5\xfe\x1a\x45\x2b\xc3\xa3\x1e\xf5\x8a\x30\x50\x8c\xf5\x59\x53\xa5\x41\x27\x14\x53\x73\x77\x6f\x5a\xca\x65\xac\x5b\xb2\x23\x11\x78\x2d\x76\x5b\x3c\xbd\xb4\x85\x22\x13\x89\x98\x8f\x10\xba\xd6\x04\x2e\xf2\x17\xb3\xe5\xcc\x37\xda\x16\xbc\x05\xde\x8c\x45\xc3\x2b\x1f\x22\x9f\x83\x35\x1c\x53\xd0\x9e\x70\xa3\x10\x3d\xaf\x03\x45\x71\x86\xae\x15\x7d\xa2\x5b\xb6\xfb\x78\x11\x5e\x64\xfc\xc7\x76\x23\xf8\x40\xce\xb3\x26\x79\xb0\x54\xc5\x09\x02\x2d\x6f\xf4\xa1\xfa\xc7\x82\xd0\xa7\xfa\x00\x9b\x39\x00\x5f\x27\xce\xed\x05\x17\x3a\x8e\x89\x4d\xa4\x98\xdb\x5e\x39\xed\x10\xdb\x77\x39\x3a\x65\xbd\x68\xcd\xe4\x1c\xed\x77\x8f\x63\xf1\x05\xa0\x73\x5b\xd7\xf6\xc6\x99\x3c\xba\x40\xf8\x7e\x43\x38\x9b\xb3\x37\x66\x03\x2f\x44" \ -"\x91\x29\xd1\x2d\x94\x6a\x0b\x47\xbf\xab\xf5\x21\x06\x85\xd8\x01\x6d\x80\x38\x78\xf7\x11\xa9\x96\xad\x3d\x6f\x00\x41\x02\x5f\xe5\x3f\x3b\xb9\x94\xd5\x95\x8c\xbe\x39\x97\xa3\x49\x09\xe7\xfa\x4c\x7e\xd3\x0c\xaf\x0e\x26\x92\x1e\x66\x16\x7c\x3a\x89\xef\xb5\x63\xb0\x02\xb8\x30\xc4\x84\xf8\x8c\x5a\xc2\x5f\x06\x5a\xf2\xab\xfe\xbd\xeb\x08\x44\xf4\x73\x59\xd9\x0a\x3d\xac\xfc\x4b\xba\x75\xd4\xd8\x3e\xfd\x62\x9c\xe9\x60\x8b\x37\x5b\xfb\xa8\xdd\x43\xe7\x12\x8c\xfa\x26\xe8\x8f\x41\xdc\xea\x81\x6a\xb8\x3f\xab\x77\x60\x20\x09\x2d\x97\x4a\x47\x51\xa2\x6d\x3a\xc2\x7d\xbf\xa9\xf4\x09\xbe\x25\x26\x62\x24\xee\xb0\x26\x96\x1e\xe3\x00\xbf\x3c\xbd\x00\x04\xb2\xc4\xee\xb6\xe9\x08\x7e\x0e\xec\x49\x64\x10\x96\x31\x1a\x68\x98\xc5\x84\x35\xe5\x64\xc4\xce\x07\x4a\x5b\x8f\x17\xce\x78\xfc\x34\x49\xa1\x94\x29\xa0\x89\x1d\xcf\xde\x0d\x80\x90\xbf\xa2\x3c\x18\xe2\xbb\xfa\x49\x4c\xf6\xf0\x1f\xfe\x6d\x90\x66\xf8\xcf\xd7\x2c\xb6\x1d\xca\x36\x8d\x6b\x7c\xef\xcd\xf3\x36\x9e\x00\x94\xca\x62\x41\xe9\xc9\x3c\xa9\x22\x40\x51\x3e\xcd\xe1\xe4\xe9\xfa\x17" \ -"\x92\x35\x68\x78\x44\x47\xb3\x1a\x9c\xe6\x19\xe1\xeb\x8a\x14\xc4\xdf\x48\xb0\xed\x43\x6b\xca\xd3\x20\x1f\xb8\x1a\xb2\x40\x86\xe1\x73\x08\xe3\x09\xc8\x21\x1f\x1f\x3a\x52\xfb\xf9\x36\x2e\x3c\x0c\xe9\x42\xde\x90\xf3\x6f\x6e\x19\x75\x4d\x6c\xdf\xd3\xd1\x17\x4e\xa2\x9a\x4d\x54\xfb\xa6\x59\xcf\x2d\x4e\x33\x55\x12\x33\x0e\x38\x09\x83\xba\x6f\xe5\xe6\x0b\xc5\xc4\xc9\xb8\x86\x93\x34\x0e\xb9\x91\x0e\x09\xa4\x9d\x52\x03\xfc\x2a\xf4\x8c\xcf\xbd\x4d\x0d\xe8\xf8\x8b\x0a\x89\x1e\xbd\x5b\x5c\xca\x3f\xf9\x61\xd4\x8b\x27\x9b\xfb\xfd\x0a\xf9\x0d\x73\xee\xcb\x70\x93\xba\xb9\x2e\xef\x33\x8f\x94\xfb\xa3\xd0\xfe\x79\xf0\xf3\x16\xa2\x2f\xc4\x2c\xf9\x00\x3b\x7f\x90\x52\x0b\x45\x7c\x4c\x83\xe7\xec\xa9\x61\xac\xa8\x9d\x18\x11\x3d\x6c\xe5\xb6\x99\x00\xc4\x17\x76\x28\x46\xa7\xb2\x4f\x2f\x71\x4b\x5d\x2e\x87\x94\x79\x39\x14\x96\x1c\x42\xd2\x8d\x8e\x5b\x83\x70\xef\xbc\x23\x05\xb5\x80\x02\x3b\x78\x06\xe4\xce\x82\x84\x68\x1e\xdb\x93\x52\x0c\x30\x09\x62\x33\x22\xc4\x87\xec\x73\xb2\x0a\x19\x08\xcd\x1c\xe7\x8c\xc7\xe0\xe0\xa2\x7b\x58\xc2\xca\xda" \ -"\x74\x31\xe9\x89\x70\x48\xeb\x9d\x7d\x89\x4a\x84\x31\x45\xe8\xf9\xf7\xf1\x2f\x08\x70\x05\x48\x8a\x95\x79\x02\x94\xcc\x5d\xe7\x2c\x81\x8c\x95\xce\x68\x25\xd0\xb5\x56\x43\x7a\xa7\x72\xa6\xc8\x86\xb4\xb3\x8b\x78\x10\x6a\xab\x5d\x3a\xb3\xaf\xb3\xf4\x94\x24\x53\xab\x9d\xb6\x92\x6f\x16\x00\x90\x6e\x69\x2f\x5a\xec\xb1\x2f\x2c\x23\xfa\xed\x6f\x8d\x59\x06\xba\x16\xc4\x20\xa6\x17\x8f\x11\x60\x7f\x3a\x8b\x89\x1d\xfa\xa4\x34\x8d\x01\x0d\x75\x52\x5d\xf1\xfe\x78\x8b\xa5\x01\x72\x69\x07\x87\xb4\x39\xfc\xca\xe9\x45\xfd\x26\x0b\x58\xdf\x11\xcb\x40\xa2\xaa\x7f\x3b\xa3\x5a\x08\x3a\x95\x14\xd6\x9f\x1a\xa0\x78\xf4\x7b\x5b\xcb\x1f\x56\xed\x14\xf2\x42\x0e\xb6\xce\x7f\x36\x77\x24\xb6\x29\x81\x80\xc1\x51\x13\xb6\x78\x55\x17\xd2\xdc\xb1\xca\xcc\x66\x8f\x51\xf3\xe9\x0f\x43\xb7\x9d\x60\x7a\x78\x82\x4f\x9a\x76\x24\x4e\x98\x18\x7b\x5a\x56\xa9\xc8\x14\x1d\x39\xd2\x85\x10\x34\x18\xca\x14\xad\x65\xe6\x3d\x2f\x69\x5e\xf4\x2f\xd9\xcf\x57\x57\x5d\xcc\x8a\x6e\x08\x96\xc8\xf8\x81\x8b\x86\xe1\x22\x22\x96\xf7\x46\xc2\x90\xa7\x15\x62\xa1\x07\x26\x4e" \ -"\x03\x24\x2a\x86\xa1\x9d\xcb\x57\x22\xab\x1c\xc7\x40\xba\x82\xdf\x67\x79\x58\x82\x32\xae\x0a\x32\x4f\x0d\x5c\xa2\x63\x01\x55\xa8\x7a\x3d\x84\x50\x55\x70\xee\x06\xb3\xcf\xa2\x35\x10\xc6\xfa\xda\xce\xca\xf2\xf8\x1f\x4a\x56\xc5\x85\xc1\x24\x63\x85\xa0\xdf\x37\x24\x99\x65\xa5\xbc\xb8\xb3\xbd\x24\xc6\xfe\x33\xc7\x0d\x74\x18\x0a\x87\x65\xd0\xa6\x36\x6b\x01\xa6\x61\x26\xc9\x2d\x56\xda\x2c\xa3\x3c\xad\x81\x45\x11\xcc\x37\x55\x8d\x50\x64\x58\x7f\x6c\xcd\x41\x49\x9f\xcc\xd8\xfa\xf0\x11\x79\xc4\xc4\x79\x2e\x40\x19\xd7\x58\x66\xdd\xf4\x23\xf8\x60\x72\x42\x7d\x86\x07\x53\x61\x00\x50\xa6\xe0\xd8\x16\xd5\x12\x2a\xf2\x7e\xb6\x51\xe0\x0a\x25\xc1\x2b\xae\x4a\x9f\x93\x3a\x41\xd9\x93\x6e\xd6\x5f\x7a\xae\x7d\x79\x4a\x42\x90\x4a\x63\x34\x84\x68\x69\x8b\xe1\x80\x3e\x01\xbc\x07\x2b\xb9\xde\x86\x06\xd8\x34\xd3\xd5\x53\x6d\xb0\xa6\x98\xa1\x30\xd3\x7c\xc6\xf1\x34\xed\x8b\x9b\x14\xe9\x8c\x37\x93\x44\x4d\xa6\x6a\x51\xd5\xfa\x4a\x7d\xa5\xd5\x41\x93\x5c\x1f\xd0\xf2\xa9\x5a\x1e\xef\xa5\x8f\xc4\x55\xf7\x79\x93\x26\xb5\xaa\x4b\x1e\xe0\x69\x79" \ -"\x1b\xc5\xf6\xac\x27\x6d\x06\xd1\x2a\xd0\x0d\x94\x99\x61\xf7\x26\xa8\xb9\x4c\x2a\x66\x91\xa6\x1b\xf2\x25\x88\x2d\xf5\x20\xc8\xb1\xe1\xf8\x9a\x75\xac\xb8\x25\x9c\xd0\x64\x97\x40\x10\xc1\xfe\xd5\xcd\x8c\xcf\x99\x40\x9b\x39\x2f\xed\x3b\xe7\x0a\x82\xcc\x48\x1e\x11\x3c\x4c\x73\xa1\xed\x68\x05\x26\xfe\x5a\x98\xd0\x31\xc2\xa0\xf3\x6a\x4e\x29\xfb\x8f\x68\x82\xb4\xf1\x62\xd3\xee\xc2\xe0\x24\xf2\x27\x6d\xb4\x43\x82\xd2\x2c\x08\xa2\x96\x10\x4c\x53\x28\x56\x61\x57\xbb\x2a\x32\x3f\x23\x62\xc0\x17\x8a\xec\x5a\x03\x9d\x13\x05\xfc\xe4\xd3\xef\x01\x55\xbe\x36\x90\xda\xdd\xb8\x13\x59\x4b\x8a\x35\x73\xce\x1f\x64\x63\xbb\x50\xa2\xde\x86\xa7\xee\x75\x54\x24\x3e\xb2\xe0\x93\x77\xa0\x41\xf4\xf5\x9d\xbc\xb8\xde\x2a\x35\xbc\x54\x33\x05\x16\xd6\xe5\x5c\xf9\x11\x4e\x06\x4f\x91\x5c\xc9\x35\x3a\x2d\x57\x5a\x13\xc2\xfd\x12\x44\x57\x3a\x30\xce\x55\xf1\xad\x28\x00\x26\x4b\xd2\xe3\xfe\x96\x75\xa8\x58\x29\xb4\x1f\x4d\xef\x88\x25\x6a\xde\x21\x3f\xef\xd9\xf5\x1d\x0b\xff\x5e\xb5\x84\x5b\x50\x98\x0f\xe0\xfd\xbb\x68\xbf\x5f\xb4\x37\x6c\x18\x41\x20" \ -"\x1b\x93\xc9\x66\x66\x40\xf5\x0e\xc4\x9a\xa9\x85\xbf\x75\x31\x6c\x4b\x85\x48\x5f\x30\x7e\x01\xa6\xbb\x81\xdf\x5e\x60\x27\xe1\xde\xc4\xd2\x81\x23\x18\xba\x91\x06\xad\x52\x43\x82\x61\xa7\x8a\xa7\x39\xb5\xe4\xf9\xf7\x2c\x1d\x09\x8c\xf5\x31\xa4\xd2\x77\x5b\xb0\x0f\x1f\xce\x58\xe5\x9b\x17\x48\x72\xe0\xed\xbe\xc2\x93\x85\xe9\xaa\x16\x40\xf1\xa2\xcc\x34\xd0\x8a\x9f\x1d\x5e\x19\x75\x67\x84\xe8\x41\xc6\x5a\xb7\x71\x06\x4c\x34\x8d\xc7\xa6\xaa\x80\xc7\xfb\x3c\x89\x56\x4e\x34\x10\x48\x40\x70\xae\x43\x36\x49\x3f\x37\xb7\x1e\x0b\x30\x83\x07\x5e\x97\x11\xa6\x73\x3e\x05\xdd\x47\x1e\x89\x23\xb5\xfa\xbb\x44\x1a\xbb\x33\xca\xf9\x4c\xa2\x3f\x0a\x90\x7b\x77\xd9\x9b\x0f\xd6\xd4\x34\x27\xd0\x6d\xd2\xce\xe6\xf2\xba\xfe\xaa\x8a\x34\x28\x82\x07\x66\x43\x1c\x26\x6a\x98\x7a\xac\xb8\xa6\x51\x1e\xec\x95\xd5\xec\xae\x82\x8c\x2c\x8f\xc7\x09\x76\x3a\x0b\x1e\x7e\x8b\x27\x80\x5c\x53\xf2\xcf\xc8\x9d\xf5\x93\x54\xcf\x8c\x78\x3b\x38\xe4\x91\xb1\x82\x30\x8b\x4e\x65\x7c\x2a\xe4\x81\xac\x0e\xf8\x90\x8e\xbd\x26\x9e\x3a\x55\x54\x4b\x88\xb4\xaf\x0d\xb8" \ -"\x00\x1a\x80\xea\x97\xa7\x28\x06\xa3\x08\x17\x39\x45\x2a\x59\xae\x32\x00\xd8\xba\xa6\x07\x8f\x7b\x5f\x17\x1a\x86\x7f\x7d\xc7\x75\x1a\xd7\x81\xd4\x77\x53\x02\x42\x60\xf7\x7e\xf1\x31\xab\xba\xde\x92\xea\x73\xc7\x7b\x70\x4f\x93\x35\xd2\x5f\xc0\xa6\x31\x89\xf5\x50\x78\x0e\xb8\xf2\xed\x83\x1b\x8d\x64\xb2\xb9\x36\xf5\x98\x37\xf3\x58\x2d\x7a\x30\xe5\xd6\x37\x76\x69\xde\x1a\xbd\x44\x2a\x15\x22\x39\xa5\xf6\x6d\x23\x54\x2d\x4c\xc4\x74\x7f\x58\xb4\x0a\xb3\x67\xe2\xd0\x21\x5b\x6f\x0c\xe7\xdd\xa6\x40\xc7\x5d\x57\x3a\xa4\x6c\x17\x7e\xa9\xd8\x77\x44\x68\x18\x33\x9c\x47\xaf\xb5\x5d\xb8\x7c\xab\x22\x48\x73\x5f\x94\x48\xa6\xf1\xb2\xdf\x24\x0a\x0c\xdb\x32\xac\x8b\x98\x1a\xe8\xb9\xf9\x5f\xf9\x08\xf4\x14\x4e\x88\x8d\x91\xa9\xa8\x02\xd0\x09\x1e\x25\x32\x95\x2f\x32\x11\x40\xd6\xa8\x20\x17\xe4\xe8\x1f\x4e\xdb\x4d\x08\x50\xfd\x29\x4f\x08\x7b\x41\xea\x24\x4e\x97\x17\x44\x12\x46\x0a\x09\x09\x21\x8e\x81\x73\x8f\xbf\x7f\xd1\x8d\xca\xbd\x37\x78\x10\x94\xb8\x7a\xb2\x4d\x0a\x95\x12\x1e\x06\x65\x35\x5a\x9b\xef\xfd\x52\x39\x0b\x7d\x54\x07\xaf" \ -"\x74\x3e\xd2\xe8\x70\x82\xfd\x69\x99\xcb\x1f\x78\xfb\xf1\x2d\x29\x7f\x60\x92\x0b\xbb\xb4\x73\x15\x3f\xb6\xd5\xc4\xaf\xff\xa2\x1f\xe9\x41\xc5\x6e\x2a\x88\x36\x76\xea\xb0\x03\xfc\x53\x04\x6b\x85\x13\xe2\x22\xa3\xe8\x1f\x27\xab\xb2\xf2\x24\x45\x40\x21\xa7\x8b\x51\xb8\xa0\xcf\x77\x25\x89\x28\xa5\x32\xa7\xf3\xbc\x52\x8e\x5b\x02\x00\xd1\x10\xa6\x98\x86\x71\xb9\xec\xfd\xa1\x78\x5a\x5e\xbd\x51\xc9\xe0\x3c\x42\x52\x17\x0c\xc7\xc5\x56\xc6\x10\x36\xae\xed\x79\xba\xf4\x8d\x32\x1a\x98\x78\x4e\x34\x47\x73\x28\x5e\x9c\x16\xa2\xf1\xdb\x5a\xd4\xec\x15\x99\xaa\x8e\x14\xc8\xfb\x31\x62\xc0\xad\x0e\xa7\xc7\xa7\xb0\xeb\x6f\x3d\xf3\x1e\xd7\x23\x71\x7f\x7a\xfa\x4f\xa2\x28\x82\x51\x1f\x33\xb1\xf0\x09\x1f\xc0\xd2\x97\xab\x4e\xc9\x32\x66\xe3\x4b\xc4\xef\xe8\xaf\xf0\x77\xcd\xbf\xb4\xd1\x44\x7b\x56\xf4\x72\xf4\xd1\x07\x23\x11\x10\x59\x85\x59\x2a\x09\x12\x7c\x15\xfc\x65\xf4\x58\x4f\xd6\xea\x91\x8c\x34\x76\x2f\x2c\x79\x2b\x0e\x06\x9d\x1a\x10\xac\xfc\x55\x5e\x54\x3b\x86\x13\x77\x0a\x46\x5b\x9d\xf6\x08\x4a\x20\x0f\x17\xe6\x02\xcd\xbc\x67\xed" \ -"\x5c\x13\x58\x15\x93\x87\x75\x7c\x6b\x8c\x27\x98\x33\x38\xf6\x7a\x99\xae\x6a\x91\x8c\x92\x4e\xb4\xf3\xd4\x3e\x2e\x03\x83\x89\x4e\x38\x4f\xa0\xfc\x75\x54\x7e\xc7\xc2\xf0\xe3\x17\xbc\x28\xce\x48\x44\x28\x3a\x5b\xb7\x50\x28\x1f\x41\x09\x46\x17\x22\x40\xc7\xd5\x8a\x50\x8c\x3a\xca\xd7\x73\xdf\x5c\xb5\xda\x74\xfc\xd2\xbe\xd2\x36\xa6\xf1\x42\x84\x3e\x62\x6d\x9e\x33\x34\x59\x45\x18\xab\xb0\xeb\x74\xaf\x12\x6f\x50\xa7\xd1\xaa\x96\xc2\x98\x17\x60\xa2\x29\xf4\xe8\x50\x55\x4c\xe2\x7e\xf0\xc4\xd6\x51\x28\xb7\xe1\x66\x0a\xa6\x39\xe7\xe6\xe8\x95\xa4\x74\x70\x7a\x00\xb6\x35\xc7\xfc\x37\x32\x6f\xf3\xc8\x40\xbf\x1d\xf0\x56\xbb\x7e\x85\x79\xf9\xf9\x25\x3a\xae\xd1\x27\x98\x67\x97\x83\x7f\xcf\x9a\x0e\xbc\xef\x1c\x6b\x21\x0a\x39\x52\x9e\x74\x3f\xe1\x1d\x67\x50\x86\x54\xf5\x25\x0d\x01\x46\x5f\xb4\x52\xbf\x00\x43\xf3\x43\xda\x94\x1e\xf8\xa0\x85\x5c\x53\xbe\xc5\xfb\x96\x75\x1c\xb2\x79\x11\x10\xd1\x04\xbc\x9b\x37\x52\x86\x80\x03\x68\x8e\x84\x90\x20\x65\x00\xdf\xa6\x4f\x31\x6c\x40\xe7\xa2\x06\x1b\x5e\x74\x44\xeb\xa8\x24\x73\x27\xbf\x97" \ -"\x1c\xca\xe4\x23\x5a\x35\xac\xaa\xad\x97\xec\xae\xc5\x13\x55\xd8\xc0\x9e\x80\x23\x06\x58\x15\x19\x9e\x5c\x12\xd5\x16\x88\x77\x95\x7c\xd5\x67\xc5\x06\xce\xae\x24\xc4\xc7\xd0\x44\x39\x54\x1c\xda\xfb\xd6\x4b\x9d\xfe\x2e\x3d\xe4\xbc\x57\x5d\x7d\x9b\x26\xaf\x04\x24\xa0\x1f\xb1\x46\xde\xf5\x55\xf6\x45\x6d\x2d\x4d\x97\xaf\xca\x17\x11\x8b\x42\x4d\xa6\x9b\xfb\x52\x9c\x0b\x4d\x66\xde\x14\xaa\xff\xe8\xa2\x29\x49\x1a\x59\x76\x3a\x7e\xd4\xcf\x6c\x37\x05\x88\x96\xf0\xdf\xb9\x67\xe7\x73\xb6\xbd\x27\xa4\xa2\xb6\x70\x71\x0b\x5d\xfa\x6c\xf7\xe7\x8f\xac\x43\xdf\xdd\xe0\x18\x74\x80\x77\xe8\x8f\x5a\x1b\x95\x31\xe2\xc3\xee\x42\xe9\x0f\x61\x89\xaa\x9b\xec\x7c\xb9\x5f\xc0\x79\x24\x52\x4c\xf9\x1f\x2e\x66\xb9\x0e\xf3\x1e\xf4\xd9\xb8\x9c\x9c\xcf\x23\x26\x59\x6b\xd4\x8b\x4b\xa1\x10\x4e\xe8\x4c\xd1\x07\x5c\x5e\x50\x9f\x3a\xa2\x8a\xd8\xce\xe7\x5d\x55\xc6\x8c\x5a\xc8\xaa\x4f\x76\x1a\x34\xa8\x6f\xa5\xe0\x5b\x2d\x55\x2a\xa2\x8e\x37\x00\x13\xa7\x8e\x56\x4a\xeb\x2b\xe6\x03\xa2\x5d\x21\xef\x2b\xb5\xfd\x9b\x6a\x1c\x30\x96\x2b\xea\x66\xbb\xf7\xbb" \ -"\x28\x2b\x9e\x21\x30\xf2\xd6\x5f\xb6\x7e\x03\x19\xda\x2f\xa3\x8c\xd9\x06\xdd\xc7\x39\x4c\xb6\xf4\x6e\x31\xa8\xf0\x81\x1f\xe2\xb9\x23\x12\xb9\xbd\x02\x11\xbe\x86\x89\x1d\x4c\x76\x30\xd8\x21\xbc\x67\xa0\x42\x8f\x17\xe6\xff\x18\xee\x06\x6f\x12\xd6\xa3\xf4\x1e\x24\x04\xd8\x1f\xa2\x3c\x7f\xeb\xcb\x43\x22\x45\x14\xe3\xdc\x38\x6b\x4e\x51\x0a\xa0\xa9\x13\xff\xd3\x7e\x2e\x4d\x2e\x98\x2e\x72\x87\x8b\x17\x03\xac\x34\x50\x56\x0b\x05\xbe\x33\x56\xbe\x43\x00\x4b\x11\xa0\xe5\x0c\xfe\x98\xdd\x03\xd5\xdc\xd5\xf4\x33\x9d\x49\xfb\xce\xd5\x2b\x71\xf7\xf5\xbd\x34\xe2\xfa\x6d\xd4\x04\xa8\x84\x18\x89\xa0\xaf\xdb\xcc\x9c\x20\xfd\x79\x08\xd1\xc8\x60\x58\x5d\x42\xf3\x54\x4c\x94\x8e\xe5\x56\x1f\x6a\x0a\x17\x88\xc8\x84\x98\x96\x33\x7d\xca\x0d\xca\x3f\x6e\x26\x7d\x0c\x71\x11\xa2\x5c\xd9\x18\x6c\xeb\xd1\x51\x41\xca\xb3\x3c\xb0\x0b\x5b\x3e\x2d\x7e\x60\x09\x42\x99\x86\x0b\x28\xe7\xcd\x42\x05\xf9\x5c\x63\x77\xce\x69\x6c\xcf\x4f\x2c\x3d\x0a\xb3\x12\x07\x21\x0f\x44\xcc\x28\xd6\xab\xdf\xb1\x62\x5e\xb0\xf3\xa5\x98\xe7\x9a\x01\x43\xe2\xec\x6d\x89" \ -"\xca\x48\xea\xf3\x17\x9c\x29\x69\x76\x28\x48\x70\x93\x35\x4c\x7e\x9e\xff\x91\xd5\xd6\x2b\xf1\xc2\x7d\xe3\x68\xf1\xc4\xf4\xed\x8c\xd6\x3e\xd2\xf9\xcf\x8f\x3a\x6a\xb6\x0a\x4b\xf7\x72\x13\x7f\xd2\xd9\x66\xbe\xc8\x95\x24\x3b\x89\xcc\xde\xdf\x7b\x3f\xd7\x54\xf9\x31\x95\x53\x89\xcd\xe0\xc0\x2c\xa6\x65\x6d\xb5\x62\xdb\x11\xa9\xba\x23\x0b\x6c\x83\x4b\xb9\xdc\x3a\xd6\x81\x43\x0f\x6a\xdc\x43\x4c\x07\xf7\x9a\xc9\x92\x19\xe0\x33\xa9\xb4\x3d\x49\xa9\xd8\xa3\x40\xb3\x90\x3d\xb8\xa3\xa3\x08\x71\x28\x2a\x35\x2e\x50\x32\xc7\x9c\x06\x8a\x2c\x56\x82\x0c\xc3\xfb\xbf\x63\x7a\x7f\x74\x9b\xf8\xcd\x56\xac\x31\xc5\x84\x65\x7c\x20\x17\xe1\x4e\xfc\x17\xb6\x1b\x0a\x5d\x87\xdc\x62\xf6\x3e\x9d\x86\x66\x01\x71\xf4\x41\x27\x03\x6a\xa8\x16\x8e\x10\x40\x8c\x0f\x50\x63\x23\x16\xb3\xa5\xa6\x55\x64\xe9\x5a\xe5\x12\x4e\x5c\xcc\xff\xda\xe0\x79\xda\x95\x92\x65\x5a\xed\xd1\x8d\xac\x47\xc1\x5a\xaf\xbd\xa5\xa9\x58\x1b\x0f\xc5\xe1\x84\x20\x7a\xd7\x59\x5c\x82\xaf\xa0\xba\xc9\x14\x3d\x40\xa2\x85\x03\x2b\xf2\x01\xfd\xfc\xb5\x88\xfd\xda\xa3\x82\x6f\x24\x0e" \ -"\x85\x07\xdb\xcc\x91\x22\x20\xaa\xc1\xec\x97\x4a\x4a\x93\x4c\x8a\x6b\x79\x7a\x75\x9e\x1c\xf6\x32\xff\x87\x8a\xa4\x11\x26\xa4\xd2\x4b\xae\x74\xd0\x92\x91\xa3\x36\xa1\x8e\x68\xf2\xfd\x4c\x61\xba\x5c\x83\x45\xbd\xd9\xf1\xe1\x9d\x4e\x25\x4e\x60\xdc\xc2\x03\xf6\xd6\x79\xb2\x5d\x1a\x2e\xa5\x89\x04\xdf\x61\x0e\x5e\x32\x34\xea\x32\x56\x45\x8d\xa5\x79\xca\x98\x25\x55\x16\x87\xd4\xe9\x1e\x6a\xd0\x98\x0a\xc4\x17\x90\x02\xc7\x12\x2b\x2f\xec\x53\x1e\x36\xf9\x07\x91\x74\xef\x24\xbf\x73\xab\x65\x4d\x27\x66\xa7\xf9\x98\xea\xc1\x8d\x18\x8f\xfe\x84\xf1\x31\xdd\xdf\xbd\x67\x0c\xf5\x14\xf0\xd5\x79\x98\x52\x45\xb3\xc0\xba\x06\x42\x38\x16\x16\x90\xf0\x7d\x57\x0d\xf8\x5d\x6c\xe5\xf5\x94\x0e\x3e\x83\x2d\x64\xc9\x3f\x44\x76\xf9\x42\x62\x84\x8d\x4a\x8c\x14\xdc\x51\x86\x8d\xac\xbe\xc7\x95\xcd\x5d\x39\x2d\x71\xf0\x0f\xa1\x04\x7a\xe4\x1c\x96\xdc\xb7\x58\xe2\x33\x75\x06\x6b\x7a\x27\xa5\x19\x0f\xc5\xc7\x95\x9d\x83\xd6\x2c\xfd\xf0\xf7\xf1\x8b\xe5\xe8\xd4\xda\x71\x17\xbc\x84\x93\xfa\xfc\x0e\x91\x07\xf6\x65\x1b\xbe\x9b\x1b\xe0\x14\x25\x3f\x02" \ -"\x36\x26\x05\x22\xba\x02\x6b\xdd\xa1\x42\xf8\xd9\x3f\x4f\xca\x53\x35\xfd\x7f\x57\xfc\x6c\x85\xaf\x0e\x52\x8c\x84\x96\x5e\xea\x78\x78\xd6\x20\xea\x35\x51\x3c\x6b\xff\xa6\xbc\x59\x99\x09\xad\xea\x55\xf4\x0b\x4c\xd9\xbe\x16\x10\x93\x50\x17\x71\x7e\xf1\x54\x39\x86\x54\x98\x2a\x61\x9e\xb0\xf7\x8a\xf9\x36\x6e\x67\x70\xaa\x34\xee\x6d\x1b\x83\x89\x54\x25\x35\xa2\x2d\x0c\x87\xe4\xb3\xc5\x2c\xa3\x8f\x21\x00\x7d\xc6\x2d\x7a\x5d\xfc\x94\xd0\xa3\xf2\x63\x7e\xc3\x7a\xf7\x67\x8d\x16\xd0\x94\x71\xec\xd2\xdf\x39\xf1\x80\x09\x28\x69\xcf\x6d\x45\xe5\xcc\xee\x62\x7c\x64\xe3\x11\xb9\xe2\x12\x77\xc0\x32\x18\x62\xc4\xbb\xe6\xe0\x3c\xbf\x9d\x29\xb3\x5f\x4c\x99\x06\xd9\xe8\x5d\x02\x6e\x29\x94\x8c\xcb\x09\x9c\xe1\xae\x1a\x10\x01\xb6\x14\xf2\xdd\x72\x48\x15\x8d\xe2\xd5\xc8\x11\xc6\x10\x64\xb0\xd8\x49\xf0\x4c\x06\xed\x4e\xc8\x77\x4d\x27\xf0\x9e\x1f\x94\x83\xbb\x3f\xe8\xd2\x40\xb3\xfa\xe8\x35\x4e\x28\x12\x59\x21\x27\x8c\xd1\x38\x70\xf9\x92\xde\x07\x7f\xa1\x41\x92\x21\x92\x7f\x38\x72\x20\x54\x50\x18\x70\xe5\xe6\xd5\x5e\x5b\x94\xf4\x6d\x0d" \ -"\x9d\x6f\x33\xc9\xad\xad\x42\x88\x96\x06\x6f\x6f\x9a\x0b\x11\x74\x0d\x1b\xd1\xf2\x3b\x63\x15\xa9\xde\x44\x48\xde\xa4\x3d\xd9\xc9\x35\xcd\x21\x0f\x8d\x0a\x50\x0a\xd7\x52\x7d\x2b\xa5\x36\xb8\x1a\x97\x47\xcb\xce\x32\x3a\x39\xa1\x34\xa8\x16\xf2\xb3\x7d\x6f\x2b\x5b\x57\x03\x07\x7e\xb1\x36\xa3\x94\x5d\xff\x37\x7c\x2b\x8d\x48\xa6\x22\x93\xa3\x87\x00\x32\x7e\x98\xa5\x01\xf4\x76\x5f\x60\x50\x04\xbb\xce\x6e\xef\xd6\xb7\xd1\x7d\xfc\x28\xb6\x7e\x86\x02\x2d\xb6\x8a\xb3\x02\x66\x8a\x65\x13\x5c\x86\x27\x45\x78\x39\xbe\x39\x82\xf5\x49\xdd\x17\xae\xb7\x5d\x1c\x9d\x2a\xe7\xd9\xce\x8b\x73\x26\xbc\x81\x7c\x0c\x6e\x59\x6c\x84\x33\x8e\xf4\x87\xf5\xfb\x44\x80\x38\xda\x1a\xf8\x81\x22\x9d\xa7\x54\x8a\xf5\x5f\x40\xac\x4a\x09\xfc\x11\xbc\x49\x6e\xe5\x4e\xe6\x99\xe7\x2c\xbf\x2e\x7e\x27\xf1\x7b\xdf\x2e\x2f\x27\x45\x8b\x76\x07\xb8\xb7\xa6\xab\x3d\x70\xc8\x6f\xc4\x3d\x7b\xd9\xbc\xc1\x66\xd4\x69\x5c\x00\x9f\x1b\xb0\x4a\x32\xfa\x6b\x44\x1a\xc4\xcb\xef\x00\x2a\xb8\x23\x8f\x0e\x6a\xac\x4c\x93\x70\x64\x19\xd7\x29\xaa\x7e\x5f\x6c\xda\x52\x24\x09" \ -"\x74\xb1\xb6\x7b\xfe\xbe\x38\x35\x7d\xef\x42\xf3\x91\x0a\x3d\x66\x39\x6d\xc5\x50\x9f\x61\xfd\x78\x30\xf9\x61\xb1\x02\xb9\x99\x0e\xc9\x79\xa5\x6b\x85\x76\xf8\xdc\x44\xce\x60\x89\x9a\x79\xd7\xd9\xbd\x4a\x4c\xcc\xde\x23\xde\xe3\x53\x34\x4d\xb4\x7a\x7b\xb8\xf9\xd4\xf0\x16\xc8\x88\xc2\xce\x6f\x78\xa2\xfd\xba\x9b\xd5\x95\x27\x61\xfc\x84\x5f\x46\xf1\x2f\x36\x13\x8f\xbc\x95\x94\xee\xa1\xc2\x79\x11\x5d\x6f\x85\xf2\xc9\xd4\xb7\x8a\x98\xb2\x25\xe6\x8c\x6b\x89\x7a\xa3\x4b\x05\x87\xe1\xba\x20\x32\x83\x68\xc5\x10\x57\xa3\xb4\xfb\xaa\x1b\xb5\xf1\x55\xb3\x7e\x74\xdb\xce\x4f\xf2\x05\x65\x29\xa5\x50\xdf\x42\x20\x44\x47\x58\x35\x75\xd8\xd1\xac\x70\xd4\x81\x98\x31\x6d\x3d\xec\x4f\xde\x9c\x0b\xef\x1f\xca\x3d\x7b\xcd\x3a\x80\x07\x5f\x1b\x8b\x87\x5b\x77\xc0\xbb\x0d\x63\xa5\x67\xfe\x8c\xc3\xea\x64\x4f\xe7\x9a\xb0\xe9\x52\xd6\xbf\x3c\xc1\x35\x8f\xd5\xfa\x83\x5b\x28\x91\xe1\xd4\x6a\x4d\xc9\x6a\xb9\x78\x8d\xe1\xc3\x05\x6e\x84\xeb\xbd\x5f\x2a\x5a\x37\xc2\x74\xde\x93\x5b\xac\xaf\xdc\xe8\x17\x5f\xc9\x04\x96\x66\xfa\x17\xc4\x56\x78\x1c\x2a" \ -"\xbc\x30\x2e\x90\x42\x55\x7c\x2a\xbb\x89\xd4\xc4\xe6\xf5\x6f\x93\xcc\xa1\x3f\x23\x64\x16\x90\xe8\xd0\x58\x65\x97\x0a\x1f\xd2\x5a\x01\x04\xca\x87\x78\x66\x51\x79\xbd\xc9\x2c\xde\xd1\x30\xbc\x98\x6c\xfa\x41\xad\x0d\xf0\x01\x7b\x6d\x24\xa3\x89\xac\x45\xfa\xa2\x0a\x4b\x59\x39\x66\x93\x4d\x12\x5d\x04\x68\xd8\xe1\xcf\xe5\x18\x39\xbb\xe4\x63\xda\xcc\x3a\x73\x2c\x78\xd1\x63\xc8\xd6\x9c\xdd\x8b\x11\x83\x9f\xa4\xe9\xa0\x06\x02\x1b\x0f\x3c\xcc\xdb\x12\xbe\xa4\xd2\xcb\xbc\x22\x74\x24\x86\x65\xc1\x4b\x58\xbd\xde\xf5\xae\xcb\x00\xc7\xa1\x39\x16\x04\xdb\x4d\x18\x24\x8d\x46\xd7\xdb\x1f\x5c\x69\x0a\x46\x66\xa9\xf4\xd7\xe6\xa9\x58\xf0\x9d\xbe\x05\x82\xba\xe8\x4c\x75\x2d\xe6\xb5\x73\x43\x23\xac\x0f\xa5\x1e\x7d\xb4\x39\xf5\x19\x61\xf4\xaa\xb6\xb4\x6b\x18\xe7\xc3\x8c\x61\x32\xdc\xdc\xc1\xc4\x90\x31\x20\x5a\x3e\xce\x6d\x55\x23\x87\xdc\xf9\xff\x4e\x67\xcf\x62\x9c\xe4\xd5\xfe\x16\xe7\xf7\xbf\x98\xfa\x25\x08\xac\xcc\x88\xb5\x1e\x4b\x09\xae\xe2\xaf\xac\xee\xed\x6b\x1b\xe6\x2e\xc5\xf0\x8c\xa2\xe1\x41\xa5\xf9\xd1\x31\x98\x13\x66\x60\x60" \ -"\xce\x91\x28\x27\x9b\x44\x08\xe4\xb0\x00\x70\x06\x1b\xa4\x0c\xdc\xb9\x8c\x5f\x47\xca\x7d\xea\x0f\xf6\x34\xce\x05\x67\xc6\x06\x41\x0c\xd1\x57\xdf\x79\xef\x7c\x78\x80\x9c\xc2\xfa\xef\x85\xf7\xe3\x4c\x6b\x49\x26\xe4\xf1\x21\x13\x3d\x8a\x46\x25\x2d\x3a\xef\x0d\xb0\x1b\x11\x29\xca\xe9\x3e\xdf\xaf\x9d\x24\xea\xc0\x17\xb4\x40\x3d\xe7\x67\xad\x53\xa9\xf1\x33\xc9\x51\x43\xd9\x4f\xf6\xcb\xf7\xe9\x75\xfd\x99\xfc\x32\x36\xfb\x78\xfe\xd7\x69\xa8\x2f\x80\x3d\x8b\xf3\x5b\x8e\xa6\xb3\x1a\x61\x41\xab\xa7\xf4\x72\xbc\xc0\x65\x17\x37\x73\xcd\xde\xd1\x3b\x6f\x53\x93\xbc\x1a\xa3\x7b\xf4\xfc\x62\x94\x68\x6e\x51\x1b\xa7\x43\xc8\x55\xfb\x50\xa3\x75\x24\x4e\x89\x5f\x22\x3b\xa3\xac\xa4\x59\xf7\x48\x40\xb5\x29\x56\xff\xb8\x9e\xee\xb9\xe2\x46\x70\x7b\xb3\x03\x49\x01\x6f\x6e\xa1\x31\x1d\x70\x7c\xf4\x6e\xee\xf7\x0e\x0e\x4c\xc7\x9f\xc5\xb3\xfa\xf4\xf7\x55\xac\x38\x62\x46\xe8\x63\xcc\xe2\x4b\x79\x49\xef\xcd\xbf\xd2\x4a\x5c\x04\x00\xea\xc1\xc4\xc2\xad\x44\x2c\x0f\x28\x9b\xa6\xcd\xc5\x34\xcf\xa9\x7b\x8f\x05\xb3\xea\x1f\xca\x56\x38\x18\xe9\x3e" \ -"\x79\xd3\x85\x13\xd1\x58\x20\x9e\x55\x46\x55\xf8\xf9\x30\xe1\x2f\x56\x0d\x80\x06\x8c\x24\x1f\x80\x3a\xd7\xb0\x51\x81\x7d\xac\xe0\xd1\xcf\xf6\xad\xcf\xc1\x16\x61\x3c\xad\xb7\x4d\xfd\x9b\x12\xb2\x24\x71\xba\xd8\x46\x35\x2f\xb0\xb0\x6e\x58\x86\x51\xda\xa4\xe6\x2d\xf1\x1b\x50\x64\x61\x07\xf1\x76\x48\xc8\xa5\xbb\x9b\xbe\x5e\x28\x1e\xcd\x99\x47\x68\x8d\x0f\xdc\x0f\x99\xb1\xc8\x9b\xef\x78\x65\x88\x11\x99\xff\x58\xa3\xb9\xdd\xc7\xd8\x62\x45\x5f\x3b\xaf\xa4\xe9\xfd\x85\xe1\x02\x9c\x79\x5d\xe9\x0b\xac\xa4\xfc\x42\x19\x3b\x8d\xc3\x72\x83\xe0\x32\x8b\xe3\x87\xf0\x04\xab\x0e\xce\x8c\xcf\x37\xd3\x9f\x87\x08\xc1\xef\xe9\xcf\x35\xf4\xee\x54\x13\x49\x01\x5e\x68\x2a\x94\x1a\x03\x65\xc6\x99\xef\xef\x22\xe6\xfd\x6c\x06\x36\x3b\x36\xfc\x31\x56\x43\x5a\xae\xc4\x8c\xef\xb5\x40\x55\x0b\x2c\x09\xe5\xf9\x88\x48\x7d\xc7\xbf\xf2\x9c\x91\x51\x46\xc1\x2c\xb5\x85\x24\xd3\xf2\x1e\x90\xf4\x07\x59\x61\x62\xf4\x3d\xb8\x03\xae\x65\xad\xdd\xef\x91\xa6\xe1\xb6\x52\xca\x4c\x4c\x96\xc6\x5d\x78\x64\xfe\x2f\x15\xa8\x3d\x26\xa5\x30\x1f\x4c\x3b\x25\x59" \ -"\x6a\x57\xcb\xb3\xf8\x9c\xa2\x40\x32\x4c\x05\x7b\x71\x09\xd7\xe2\x17\xcd\x2c\xf5\x75\xb3\xfb\xa0\x6a\xcd\x82\xbb\xfd\x97\xe0\x18\x20\x6b\xd2\xdd\x3e\x09\x85\xc0\x77\x8f\xe8\x45\xcc\x62\x05\x56\x79\x11\xf5\xb4\xf9\xe9\x30\xb9\x38\x3e\x14\xd7\x8c\x06\xdc\x8b\x2c\x2e\xb4\xec\xd7\xfa\x51\xc3\xfe\x65\x87\x28\x87\xeb\x8d\x16\xb7\x01\x1f\x03\x59\xfc\x57\xcf\x3a\x18\xa1\xe1\x1c\xd9\xae\x7a\x47\x2e\x64\x19\x55\xbd\xb1\x2d\xb9\x35\xd2\x6d\xde\xf0\xf4\x52\x4b\xbc\x11\xbf\x2d\xb8\xdc\x84\x69\x4b\x97\x0c\x05\xec\x94\x96\x0a\x16\xc7\x1a\x8f\x8e\x9f\x89\x57\x8e\x46\xf1\x43\x05\x0f\xeb\x57\x14\xe0\xcf\xd2\x26\x3c\xf5\x22\xee\x6c\xc1\xcc\xc2\xb3\x07\x83\x9e\x3f\xf5\xff\x5f\x22\xf7\x3f\x64\x27\x55\x33\xb6\xdc\x45\x7d\x58\xdf\x27\xa0\xb0\x73\x64\xe8\x96\x14\x28\xcd\x84\xe7\xc9\x61\x28\x42\xcf\x35\xc3\x27\x3b\x04\xbf\x8c\xd2\x42\x2e\x68\xc4\x40\x23\x16\x97\xd2\x58\xdc\x6c\x60\x5f\xaf\x61\x46\x19\x5a\x6f\x70\x7b\x6a\xcc\x16\x3b\x6a\xf8\xe8\xb2\x95\x20\x24\x10\xfe\xbf\xca\x5f\xb1\xb1\x74\x5f\xd5\xcd\xaa\xfe\x60\xb8\xe9\xa6\x0a\x9c" \ -"\x5f\xfe\x69\xcd\x37\x9e\x3d\x81\xd7\x62\xe6\x6b\x03\x3f\x9d\x9b\xcf\xf7\x9d\x4f\xfe\x8a\xbd\x5e\xf8\xf4\x98\xa7\x6f\x10\xca\xea\x51\x26\xfd\x01\xb4\xd2\x18\x59\xb8\xfc\x55\x06\x23\xdf\x09\x22\x53\xfe\xe0\x45\x8a\xc7\x25\x5a\x18\x15\x88\x0f\x33\x32\x1e\x36\xd8\xe3\x9c\x75\xf2\x64\x34\xa3\x59\x21\xa4\x62\x11\x59\xb0\x15\x9b\x0f\x92\xd8\x56\x75\xa8\x03\x79\x4b\xfc\x74\x50\xc7\xa2\xd7\x4a\x04\x1f\x76\xba\xce\xf9\x74\xdd\x63\x41\x36\x21\x0d\x4e\xd2\x23\xd2\x35\x7a\xbe\xc6\xdd\xb7\x86\xcc\x4f\x08\x19\xd2\xbc\xfd\x55\xc9\x2e\xfa\x03\xe8\xd0\x25\x0c\xdf\x48\x97\x94\xee\xa8\xcc\xfc\x1f\x01\x1c\x76\xf8\xaa\x95\x49\x3b\x20\xca\x65\x97\x0f\x08\xbd\xa3\xd9\x8d\x96\x74\x41\x81\xa6\x93\x36\x01\x42\xd6\xe4\x4d\x4c\x0c\x69\x01\x52\x81\x7b\x1c\x32\x6a\xef\x73\xbd\x51\xa5\x59\x40\xa2\x48\xad\xa2\x0c\x8f\xa1\x2a\xc3\x34\x31\x4f\x82\xe7\xcf\x7d\x71\x15\x2b\xb8\x78\x61\x4f\xa2\x24\x7d\xcc\xfd\x17\xeb\x16\x57\xfa\x81\x2e\x33\x8c\xb8\x7a\x05\xb0\x5b\x4d\x79\x63\x5e\xf6\xd9\xf7\xb5\x64\xbe\x51\x2b\x47\x61\xd8\x52\x90\x32\xd7\x48\x58" \ -"\x88\xca\xa7\x92\x14\x6c\x6f\x30\x08\x80\x4d\x3b\xb3\xe3\x74\x66\x6a\xaa\x7b\xb7\x96\x0f\x14\xe2\xb1\xf4\xc7\xd2\xe1\x60\x0b\xe8\xe6\x6b\xe6\x5c\x58\x07\xc8\xfa\xa2\x8f\xf5\xd7\xc2\xae\x7e\x1f\x91\xd3\x9e\xd2\x7d\xde\x56\x50\x69\xcf\x60\xc5\xf0\x10\x79\xe5\x10\x2b\x20\x12\x61\x74\xf9\x69\x35\x0a\x6d\xa3\xe2\x5a\x2b\xcd\x1b\xbe\x14\x4b\x05\x77\x61\x51\x64\xec\x1e\x0d\x2a\x1e\x94\xed\xe1\x95\x23\x11\x11\x05\x8e\x23\xfa\xd7\xc5\x9b\x11\x6f\x91\x81\x35\x39\x00\xc8\xf9\x59\xb0\xbd\x01\x74\x24\x0f\x8c\xb6\x5f\xd6\x8f\x74\xeb\x52\xa5\x35\xc0\xb5\xb7\x83\x6a\x05\x8e\x23\x1f\xeb\xb1\x5a\xcb\x79\xa7\xd8\xa5\x21\x2f\xe1\x15\xe3\xde\xeb\x52\x4a\xc3\xc5\xd7\x4f\xcd\x6c\x91\xb9\x58\xe0\xcf\xb9\x2b\x94\xc7\x37\xce\x37\x35\x24\x53\xe4\x0f\x9b\xf0\x34\x8b\x24\xa9\xca\x8c\x0b\x94\xc9\x64\x74\x05\x04\x5d\xd1\xff\x0e\x68\x1b\x1e\x8a\xe0\xb6\x88\x44\x1b\x12\x7f\x3d\xe7\x0d\x4f\xd3\x81\xaa\x53\x85\x79\x2a\xc9\x5b\xa1\x9d\x5d\x5c\xe4\xe6\x55\x2a\x48\xfc\x8e\x55\x31\x31\x5a\xf8\x69\x40\x65\x11\xb7\x68\x47\x42\x58\xe7\xf3\xb9\x7f\x6d" \ -"\x60\x10\x90\x43\x89\x8e\x33\x0f\xb0\xe5\xc3\xf4\x79\xe1\xeb\x01\x2f\x1a\xbb\xc7\x1d\x54\x2a\xd1\xc0\x17\x18\x42\x8b\x69\x3b\x2a\x62\x2a\x3b\x79\x2a\x13\xfc\xd8\x53\xaa\x0f\x99\xe3\xd1\xf2\xc0\x54\x7f\xe1\x07\x6a\x34\x7a\x0b\xc5\x0d\x72\xc4\xc2\x43\xd9\x6a\xc9\x09\x21\xbc\x2c\x50\x9c\x8a\x0d\xea\xbd\x1d\xf0\xbe\xf7\xe7\xc2\x71\x91\xb6\x3f\xb8\x51\xcb\x58\xad\x2b\x94\x7e\x3f\x37\x1e\xb3\xa9\x08\x04\xd3\x07\x49\x30\x98\xa9\x41\x8b\xef\x27\x2a\x42\x43\xd1\x04\x14\x66\xc1\x3a\x16\x9b\xe5\xf8\xe9\x63\xee\x3e\xad\x47\x38\x2b\x99\x81\xfd\xa1\x45\x57\x5e\x32\x35\x01\x12\xa7\xb3\xfd\xe8\x05\xf4\xb4\x49\xca\xce\xc7\xb1\x9c\xa8\x90\x9c\x70\xf7\xbb\x5d\x79\xe9\x95\x10\x50\x91\x43\xaf\x39\xfc\xb9\xda\x38\x0d\x00\xa4\xa0\x54\x13\x44\xa8\x0e\x59\x4d\xe1\x02\x0e\x53\x7c\x38\x37\xa2\xe5\x27\xc4\xf9\x1b\xf0\x5a\x85\xf1\xed\x4f\xa9\xe9\xad\x8f\xff\x24\xf9\xa6\x74\x74\xb1\xd8\x95\xe0\x1a\x40\x2c\xb1\x19\x05\xfd\x0d\x32\x41\xed\x0f\x8a\x2b\x5f\x6c\x14\x81\xb8\x8a\x79\x6e\xf0\x5b\x0c\x66\xbb\xb7\xe8\xc4\xfd\x8c\x5a\xae\xab\x09\x96" \ -"\x9f\x58\x61\x38\xe3\x9e\x5c\xe3\xd1\xe3\x89\xf8\xf8\xb6\xa7\xe5\x6e\xbc\x55\x1e\x4a\x07\x48\x63\x6a\xb2\xb5\x5a\xf8\x65\x3b\xb8\x40\x1a\xbc\x01\x4c\x91\xbf\x76\x4e\xa1\x5a\x9d\x6c\x79\xeb\x9a\x5a\x70\xec\xcc\xe2\x43\xc1\xcc\x88\x54\xe0\x2f\xa5\x00\x2c\x2e\xe2\x90\x71\x92\x85\x49\x49\x65\x3d\x31\xb7\x2d\x88\xd1\x0a\xb9\xcf\x18\xf1\xfd\x86\x71\xf8\xe9\x71\x4b\xa1\xb1\x02\x42\xd8\x3e\xb0\x3b\x04\xa3\x5a\xaf\x60\xee\xf3\xc3\x3e\x20\x3d\xe1\x4b\xb2\x7e\x60\x6d\x7a\xe7\xef\xb4\xc4\xcb\x14\xc1\x00\xcb\x31\x92\x22\x7f\xfa\xc0\xcc\x59\xff\x56\x09\x9b\x78\xa1\xed\x40\x94\x32\x36\x78\x5f\xbe\x79\x5d\x41\x7d\xbf\xca\xbe\x10\x70\xbf\x4d\x1c\x7d\x5a\x54\x80\x07\xda\xfb\xb1\x47\x90\xa2\x3c\x2b\xd9\xff\x31\x35\x65\x83\x2a\xc0\x40\x7b\xbc\x21\xd9\x93\xf8\x3f\x4b\x3d\x45\x95\xf8\x5a\x70\x94\x84\x0f\x72\x72\x42\xeb\xc6\xde\xa6\x6c\x8c\xac\xf8\x0e\xfc\x3f\x9e\x99\x91\x3d\x73\xa0\xc2\x1e\xca\x22\x12\x9e\x8b\x84\xaf\x49\x4d\x24\x0a\x55\x9c\xb4\x2c\x5c\xf5\x43\x7c\x15\x37\x03\xb5\xd0\x10\x4e\x90\x2d\x96\x99\xab\x63\xcb\x78\x66\x90" \ -"\xcd\x95\x10\xa8\xf5\x3c\x43\xab\x69\xa3\x4a\x65\xc5\xf3\x4d\xce\xbb\x4f\x7d\x36\xe8\x32\x63\x3c\xd1\x15\xe0\xcb\xf0\x36\x05\x40\xbe\x71\x34\x2b\x72\x99\x39\x18\xf6\xf9\x43\x05\x74\x6c\xa7\x18\x98\x9d\x91\x91\xb8\x87\x09\x15\x13\x28\xd0\x57\xfe\x30\xf9\xff\xa2\x27\x4b\x77\x14\xbc\xf5\xa6\x17\x86\x45\x40\x07\xf2\xb8\x59\x11\xa6\x24\x9e\x4c\x69\xeb\xd4\x4b\x0e\xb3\xa8\x33\xcc\x2a\x32\xbb\x05\x76\x4c\xad\x3a\x9b\xac\xc3\xa8\x2c\x1c\x81\x09\xbc\x08\x72\x4f\x39\xe9\x96\xaf\x24\xd5\x3b\xb0\xcf\x19\x0a\x94\x50\x03\x74\x0e\x78\xa1\xe9\xfa\x24\xd4\x74\x1a\xcb\x25\x81\x2a\x18\x41\xbe\x9d\x41\xc1\x84\xc3\xb5\x1b\x7d\xa1\xed\x11\x35\xcb\x20\x1d\x86\x78\xda\x78\x54\x8b\x27\x79\xf4\xbe\xa7\xb3\xa5\x71\xa9\xdb\x1f\x89\x56\x0f\x2b\xed\x63\x47\x2b\x97\xa7\xdd\xb6\x70\x9d\x6f\x28\x5b\x85\x11\x57\xde\x53\xdd\x27\xbc\x95\x33\x2d\x87\x68\x1b\x94\xf6\xf8\x1c\xa0\xdb\x7d\xc6\x29\x97\xce\x1a\xa7\xa7\x5e\x29\x69\xfb\x04\x23\xfb\xa6\x01\x6f\x9c\xd1\x7e\x27\x5d\x69\xea\xc5\x40\xb9\xb1\x30\xb6\x99\x63\x22\x1b\x6d\x7e\xc0\xb7\x14\x75\x83" \ -"\xd1\x5d\x25\x47\x60\x57\x04\xb7\x34\x10\x04\x7d\x0c\x35\x09\x4c\x68\x97\xaa\x09\xba\x4a\x98\x8c\xad\xe7\x34\x71\x0b\x73\x06\x4b\x3e\xd0\xc0\x66\x47\x70\xcc\x4a\xce\x14\x52\x05\x99\x10\xc2\xba\xb3\xbe\xaa\xdb\xfb\x6d\x18\x58\xdf\x89\xb9\xbe\xd9\xa8\x50\x65\xd2\x69\xdf\x73\x7c\x47\x5b\xc0\x30\x2a\xce\xdc\x0e\x30\x03\xe8\x63\x33\xf7\x27\x92\x97\x94\xe6\x5c\x71\x7b\xb8\x7c\xa9\x37\x05\xf9\xe2\x9c\x56\x51\xa7\x90\xa4\xa9\x49\xf1\x3d\x38\x14\xf7\x74\xac\x93\xaa\x03\x06\x50\xbd\x03\xdc\x0b\x3e\x38\x81\xb3\x91\xcd\x5b\x2e\x41\x1d\x72\xb8\xd0\x76\xef\x67\x21\xe0\xb1\x6d\x96\x13\x13\x64\x88\xa6\x61\x65\xa8\x09\x07\x1d\x8f\xa9\x5d\xba\x4c\x17\x03\xe3\x5d\xf0\xeb\x5e\xc3\x02\x2e\xbc\x4b\x25\xfc\x3c\x3e\xba\xfa\x8f\x85\x60\x7f\xd0\x7f\x37\xb0\xf7\xe8\x63\xc4\x63\xc5\x6b\xa2\xea\x2f\x6d\x1b\x79\x42\x49\xa0\x01\x34\x1d\x48\x59\xfc\xe7\x41\xec\xfa\xc6\xba\x81\x15\x66\x62\x39\x14\xb8\xdd\xae\x30\x25\x0b\xb9\x7b\xbb\x66\x4e\x5c\x03\x45\xa1\xde\x21\x96\xfa\x75\x55\x76\x6f\x04\x91\xf2\x3e\xff\x1b\x30\x48\x57\xfd\x20\x9d\x82\x44" \ -"\x3f\xe0\xdf\xe3\x1d\xd9\xb1\xad\x3d\xce\x22\x0e\xcd\x46\xa1\xe0\x1c\x83\xc5\xcb\x69\x21\xb2\x83\x90\xba\x93\x77\xa7\xac\x07\x74\x34\xd6\x34\xbf\x10\x14\x8a\xf1\x96\x3c\x11\x1e\x5a\x16\x90\xbb\xe3\xa3\x86\xb0\x42\x79\x0e\x01\xe8\x63\x5d\x39\x19\x71\xb1\xf3\x7e\x2e\x31\x00\x43\xcf\xc6\xff\x26\xa4\x34\xdd\x34\xdc\x5a\xc4\xbf\x49\x21\x88\x63\x4a\xc3\x1f\xe7\xc2\xc7\xb6\x8c\x52\x9d\xbc\x08\x0c\x51\x54\x6b\x02\x02\x23\x59\xa8\x3a\x82\x10\x3c\x58\xa3\xd4\x57\x84\xc2\xc2\x3f\xbb\x62\xf3\x73\x40\xf5\xaf\x09\xda\x00\x20\xd2\xc5\x28\xa6\x2c\x0f\xea\xee\x21\x99\xe0\xfa\x78\x33\x00\xe3\x78\xdb\x2c\x1e\x56\x40\x68\xea\xab\x89\x4e\x7d\xcc\xfd\x3c\x86\xd3\xda\x2f\x0f\x91\x32\xe7\x6c\x8f\x7e\x63\x50\x6d\xf2\xd3\x92\x8e\x53\x16\xea\x96\x30\x7b\xe3\x34\xd0\xd5\x89\x53\xd9\x52\x2b\x9b\xd4\xe6\xa2\x8b\x6b\xf3\xdc\x2d\xfd\xdc\xfa\x61\x67\xef\x36\x0e\x16\x83\x4a\xab\x63\xdb\x62\x28\xd8\xb0\x9e\x52\xfa\x6a\xfe\x02\x63\x31\x38\xa8\x77\xb8\x8c\xb6\x74\xba\x1d\x67\xdf\x14\x09\x5f\x06\x24\x1c\x86\x5a\x08\x39\x41\x9e\x21\xee\x9b\x3d\xd2" \ -"\xec\x7e\x6d\x90\xfc\xde\x2c\x68\x6a\xd4\x8c\xc3\x1f\xde\x8d\x83\x37\x01\xa0\xec\x34\x9b\xaa\xad\x9a\x55\xee\x06\x9a\x5d\xf4\xac\x14\xcf\x03\xf9\x8f\x34\x16\x4d\x64\x0e\xe3\xfe\x23\x42\x1b\x25\xde\x62\x07\x16\x91\xca\xd6\x74\xd6\x21\xde\x8a\x20\x9a\x33\x56\x68\x77\x1c\x6b\x44\x0d\xd9\x9b\xc4\xdf\xcd\xb4\x5e\x16\x95\x9c\xa7\xca\x2d\x7d\x25\x69\xcf\x91\x1a\xa2\x9b\xa7\x07\x9b\x33\xc9\x03\x48\xb6\x9a\xd1\x0e\xc5\xd7\x8c\x72\xba\x79\xac\x5e\x4d\x10\x8e\x00\x67\xb8\x17\x1d\x37\x65\xd3\x3c\xe5\x36\x4e\x79\xf6\x4f\xd4\x60\xef\x34\xb6\x84\x2a\xd6\xd0\x1c\x30\xfc\x4f\x71\x91\x5a\x6e\x2e\x91\xbe\x50\x3f\xa6\xd2\x4d\x22\x6f\x7d\x33\x66\x0a\x03\xc2\xd1\x09\xa0\x0f\x9b\x24\xeb\x8e\xfc\x7d\xae\x2c\xba\x4e\xab\x36\x3e\x0e\xe3\xbf\xc0\xea\x2b\x54\x63\x60\xc9\x01\x0c\x65\x62\xed\x0c\xf9\xba\x94\xdd\x11\xd1\x0b\xb5\x94\xa6\xb1\x2c\xa2\x10\x55\x23\xd6\x55\x72\x64\xf9\x4c\x52\x4a\x46\x1e\x92\x63\xe6\x0f\x9d\x75\x9a\xdb\x83\xa3\xc1\xaf\xd8\x1e\x93\xb0\xe0\x74\x52\x90\xe0\x83\xf9\x32\xf7\xc4\xed\x41\xb2\x66\x69\xfc\x14\x1f\xa6\x11" \ -"\xd9\xcf\x8c\xd8\xfe\x7b\x3b\x4d\x11\x6f\x62\xa8\xd2\xed\x4c\x6e\x6b\x10\x64\x28\x2e\xd0\x51\xc9\xa0\x34\x89\x19\xb4\x88\x25\xd6\xad\xac\x5f\x71\xd2\xc3\x5f\xde\xac\x76\x77\xbd\x62\xfd\x7b\x6b\x12\x62\x6f\xc9\xe0\xc5\x6d\x88\x96\x95\x05\x57\x7c\xbc\x25\xc9\x49\xc6\x1a\x06\x3e\x86\xbc\x88\xce\x7e\x65\x2e\xea\x11\xca\x2f\x87\xdf\x39\x3b\x35\x72\x26\x59\x1f\x01\x4c\x4c\xee\x8f\x0b\xbe\x1e\x4c\xe6\x2e\xa2\x33\x00\xba\xcf\x7e\x6b\xdb\x9c\x12\x68\xf7\x9e\xf4\x91\x14\x54\x1f\x44\x8d\x37\xbe\xdd\x69\x66\x38\x51\x9a\x7d\x47\x7b\x7e\xec\xb3\x51\xe7\xdc\xa7\x77\xce\x73\x6a\x3b\xa6\xa6\x03\x89\x2b\x38\x20\x05\x2d\xd7\x91\xa2\x2f\x94\xea\x72\x12\x03\xa6\xf8\xd1\x75\xc0\x67\x23\x53\x4f\x13\xd4\xe6\x0c\x80\xd6\x8e\x94\xad\xea\xd4\x3e\x4e\x90\x08\x8d\x3f\xfc\xff\xbc\x1b\xbf\x84\x35\xd7\xdc\x13\xbf\x4b\xfd\x91\xe6\x7a\x9c\x73\xfa\x49\xab\xd2\x16\xe9\xf4\x5b\x3a\x2f\x4b\x44\x74\xb6\x62\xb6\x4b\x42\x24\x9f\x40\xcd\xb0\x66\x32\xed\x26\x6b\x94\x3a\x3d\x40\x01\xf9\x44\x4b\xeb\x68\x19\xe4\x93\xe9\x2e\x19\xbe\x76\xc4\x22\x27\x01\x3c" \ -"\xc9\x43\x4d\x40\x09\x2b\x00\x96\x29\x49\x39\xfe\xd3\x60\x5d\x81\xe7\x3f\x0c\xb1\x6a\xee\x46\x49\x57\xfb\x07\xfe\x33\xd4\x22\x22\x89\x7f\xd1\xcf\x46\x3c\x44\x47\x4a\xd0\x77\xd3\x99\x64\xad\x15\xb2\x5f\x71\x06\x67\xf4\xcc\xc8\x8d\x3a\x9c\x0d\x15\x6d\xa9\xd7\xce\xb8\x0a\xf8\xd6\xdb\x02\x16\x6c\x25\xf7\x9d\x66\xa7\xfd\x8e\x8b\xb1\x3e\xf3\x3b\x93\x45\xe7\x96\x7b\xb1\xe7\xe0\x21\x1d\x4b\xb8\x73\x8f\xda\x04\x0a\x7d\x23\x32\xc9\x8f\x2c\xaf\x6c\xce\xf7\x98\x51\xf9\x87\xdd\x17\x84\x50\x68\x18\x06\x0a\xd0\x9b\x61\x2d\x09\x34\x1d\xe8\x98\xb0\x4b\xf2\xf1\x6f\x80\x7f\x90\x60\x9f\xab\x49\xfa\x34\xa3\x2b\x9e\xe8\x59\xe3\x41\xdb\x97\x99\xe3\x3d\x2e\xe8\xb1\xaa\xcb\xed\x09\xfd\xe1\xde\xe0\xc8\x56\x92\xb4\x68\x08\x0f\xbd\xb8\x5e\xb1\x24\x39\xaa\xce\x3e\x2f\x98\x43\x4d\x6a\x0a\x1a\xb4\x2c\x7c\xaf\x05\x51\x60\xd7\x8f\x8e\x98\x3d\x02\x51\xd8\x42\x8e\xd8\x47\x08\xaf\xf5\x33\x90\xba\xa6\x1c\xe6\x40\x9f\x96\x5a\xf9\x41\x97\x0a\x88\x5b\x26\x92\x01\xf3\x17\x8d\xe0\x7d\x6c\x04\xa6\xba\xf1\x37\x0a\xca\xfb\xe6\x60\xfc\xf8\xc5\x30\x1d\xef" \ -"\x81\xcc\xb8\x0f\x0a\x59\x82\xaf\x90\x3b\x9b\x21\xab\x79\x20\x13\xfc\x6d\xdc\xbf\x73\xed\x25\xf3\xe9\x79\x7a\x5a\xfa\x42\x8e\x2c\x23\xcb\xda\x91\xf3\x8c\x1c\xa1\xd5\x99\xe7\x4c\x8a\x4c\xfb\x97\x07\x0b\x40\xc1\x49\xe6\xbf\xc4\x99\x53\x05\x5e\x6b\x68\x01\x41\xcb\x95\x99\xd1\x4c\x52\x3c\x00\x15\x99\x3f\xac\x77\x6a\xdf\x33\xd4\xf4\x90\x19\x19\x7e\xd8\x09\x5d\x2a\x2e\xbc\x86\x9a\xc3\x54\x2e\x7e\x80\x88\x6f\x15\x5a\x67\xdb\xc6\x27\xa1\x35\xff\x97\xd5\x69\x87\x73\xe2\x5e\x1c\x30\xfc\x50\x21\x3c\xd5\xce\xf7\xbf\xaf\xc3\xe3\x76\x36\xb9\xcd\xc3\xf8\x0b\xee\xca\x0d\xec\x26\xb6\x01\x01\x33\x6f\xbe\xea\xf9\x57\xbd\xea\x23\x94\xe2\x48\x83\x4d\xf9\xd6\x30\x24\x74\x3a\xe4\x4d\xa8\xde\xbe\x73\xc1\x9d\xae\xd5\x69\x78\x17\x62\x86\x16\xcd\x96\xc0\xca\x80\x41\x80\x55\xfe\x63\x87\xe3\xaa\x50\x60\xea\xe1\xad\xac\x9c\xb3\xea\x51\xb9\x22\xe3\x9b\x29\xf2\xf4\x8a\x94\x3a\xff\xe8\x3f\x92\xb8\xe9\x9d\x69\xce\xb5\x35\x2a\xa5\x3b\x4d\x47\xce\xdb\xa9\xa8\xf6\x3d\x72\xab\x93\x16\x65\xda\x5c\x5d\x3a\x67\x50\xf0\x98\x50\x89\xb3\xb5\xaf\xcb\xf5" \ -"\x6f\xe7\x04\x29\x9e\x5e\xe0\xbd\xac\x7a\x61\x5c\x5d\x7e\x2f\xe5\xef\x34\xe1\x66\x26\x19\x3d\xc4\x79\xe3\x5e\x1b\x94\x85\x3d\x62\xf7\x07\x52\xbb\x9f\x6a\x4a\x33\xf5\xab\x2a\x45\xbc\xe3\x22\xb2\x88\xd2\x89\x3e\x56\x65\x08\xcc\x6a\x06\xea\x69\x85\x33\x45\x32\xa4\x54\xb6\x49\x5e\x6b\x0a\x86\x13\xa5\x6f\xbf\x91\xee\x00\x08\xbc\x39\x7b\xb9\x84\x09\xa9\x2b\xd7\x5c\x4a\x6c\xb0\xdb\x58\x1a\xe3\xff\xac\xc6\xaf\x28\x6a\x78\xe3\x94\x18\x97\xc3\x79\xb6\x46\xb1\xfb\x69\x1b\xa8\x10\x8e\xcf\xb0\x4a\x2f\xd9\xa1\x8b\x1c\x3c\xe4\xc4\xf6\xe9\xf9\xb8\xd4\x24\xc4\x60\x7d\x4f\xc5\x25\x11\x85\xfb\x59\xe2\xbb\xe8\x26\xee\x9e\xb7\x5c\x60\x23\x03\x1c\xf7\x44\x6f\x67\xae\x6e\x51\xa4\x92\xa5\xc3\xdb\x72\x1b\xcf\x53\xff\xfd\x7e\x58\xf2\xc6\x6f\x66\xda\xf9\x72\x09\x99\xdd\xdf\xb0\xbc\x58\x11\xd0\x2e\xb2\xee\x24\xfd\x6d\xe0\xde\x4f\x9a\x7d\x12\xc8\x65\x74\x39\x01\x81\x61\xc9\x97\x6f\xb7\xde\x8c\x87\x72\x9c\x5f\x54\xb2\xf1\x9f\xb1\x70\x3e\x19\x7d\x73\xe8\x66\xfb\x3e\xcb\x0e\x05\x96\x5c\x63\xf1\xdb\x35\xfa\x45\x30\x41\x8d\xf3\x82\x7c\xe1\x1e" \ -"\xb0\x3b\x11\xaf\x91\xfe\x31\xf1\xeb\x89\xe2\x88\x2a\x00\xfb\xa0\xcd\x9c\xc0\x0a\x09\x55\x37\x0e\x3b\x26\xac\xc0\x18\xdd\x42\x36\xed\xee\x93\x5a\xe4\xbd\x16\x09\xdc\xa4\x64\xda\x4c\xb0\x80\xb8\x88\x98\xfc\x43\xa2\xe3\x77\x85\x05\x0f\x6c\x82\xa5\xd3\x18\x13\x22\x4a\xea\xd1\xce\xcb\x05\xe8\x05\x85\x5c\xfb\x6f\xf2\x51\x39\x64\x0c\x74\x8b\xbd\x71\xa7\x8d\xb5\xae\x2f\x0a\x69\xed\x0a\xaa\xc3\x8c\xf5\xb8\xce\x2c\x07\xaf\xb6\x94\x9f\xd1\xef\x8d\xc0\xc2\x07\xbd\xe1\x5d\x25\xa1\x5a\x51\xa7\x61\x20\xa1\x0c\x93\x6e\x51\x80\x0e\x4e\x92\xfc\x13\xfc\xdd\x39\xc4\xe9\x62\xc0\xa6\x31\xc7\x96\x60\x1e\xf7\xa9\xb7\xfc\xd2\xc9\xe2\x17\x72\xc1\xe5\x7b\xfb\x5d\xbb\xbf\x2c\xc3\xd6\xde\xf3\x09\xb4\xd7\x22\x59\x43\xdc\xa2\xc3\xc8\x43\x7e\xf7\x3b\x8e\x23\x52\xee\x80\x19\x33\x87\x98\xee\x64\x34\x3b\x76\x98\x93\x6f\x85\x8a\x29\xc4\xd2\x18\xf1\x0a\x23\x49\xa3\x5e\x61\xb5\x20\x90\x18\xac\xbf\xcd\x0c\x19\xe6\x6c\x82\x8a\xf8\xa4\x62\x8d\x5c\x63\x38\xb4\xc0\x37\x3f\x46\xad\xa4\x39\x1a\x5f\x87\xf3\xff\x9f\xd3\xa3\x2f\x80\x47\x9b\x62\xbb\x51\x9f" \ -"\xbf\x01\x37\xe1\xf1\x10\xae\xf0\xa8\x7a\x25\x28\x61\xcf\x9d\x9d\xb0\x07\xfc\x51\x85\xd6\x80\x53\xf9\x21\x48\x8f\x04\x57\x08\xc5\xe7\x15\xde\x4a\x8a\x84\x95\x6c\x66\x18\xdd\x9a\x53\xbb\x50\x1f\x07\x3f\x74\xb4\xa9\x54\xca\x12\xbc\x0e\x76\x62\xa6\x4b\xf4\x0a\x01\xdb\x4f\x69\xa3\x00\xf9\xfd\x60\x56\xc9\x27\x61\x53\x53\xae\x30\xf9\x49\x27\xbf\xd0\xa8\x22\x43\x97\xfe\x10\x12\x87\x5c\x9d\xe0\xe1\x29\xfe\x2d\xcb\x29\xc5\xd8\x8d\x0f\xd2\x21\xdb\x43\xbd\xdc\x45\x32\x13\x4f\x2b\x4b\x7a\x01\x5d\x2c\x41\xc5\x0f\x1d\xea\x27\xaf\xe9\x88\x05\x41\x7b\x74\x6d\x88\x3f\x5c\x3b\x1f\x9e\x01\x28\xdb\x9e\x5e\x27\xec\xcf\xc6\x7c\xf7\xd1\x96\xa8\x92\x1b\xa4\x50\x6d\xfb\xdc\x65\x96\x1d\x8e\x2c\xc7\x47\xe8\x1b\x24\x76\x45\xe6\x54\x1a\xac\xfc\xe3\x2e\x13\x23\xa8\xef\x05\x0f\xdc\x80\x5f\xd4\x6a\xcd\xf2\x38\x80\x09\x14\x1c\x18\x21\x0b\xb1\xf4\x6e\xed\x83\xe9\xb7\xdf\x79\x73\x5a\xe1\xdf\xa0\x53\x42\x88\x46\x3a\x99\x0d\x68\x88\xcf\x27\xea\x81\x8c\xf7\xdb\xb0\x48\x78\xd3\xb9\x85\x76\x83\xd4\x3b\xba\xb2\xc7\xe4\x36\xe7\x61\xbb\xe0\x61\xed\xce" \ -"\xd7\x09\x16\x0c\x0c\x93\x15\x26\xa5\x4e\x95\xf5\x91\x76\x67\xf5\x81\x78\x05\x8e\x31\x00\xd3\xe0\xef\x4d\x72\x30\xac\x9e\xab\x13\xe0\xc9\x52\xda\x4e\xa8\x5b\x86\x0f\x28\xbb\x72\x2a\x1a\x08\x8e\xd3\x3d\xe9\x08\x9b\xb1\x93\x95\xe8\xa0\x01\xb1\x87\xf5\x90\x45\x16\x9d\x9c\xc8\x6d\x85\xc9\x9d\xd4\xfe\x86\xd5\xbf\xff\x65\xff\x14\xeb\x69\x3e\xdd\xd2\x9f\x40\xf6\x88\xb5\x3c\x29\x95\x81\xe0\x2e\x4f\xad\x88\x69\x7d\xc0\xf4\x10\xec\xac\xc2\xf7\x88\xa0\xbf\xdb\x18\x65\x97\xcc\xbd\xfe\x45\xa0\x4f\x54\x95\x2b\x6c\x5a\x41\x10\x4b\x31\xb6\x1d\xd3\xbc\x87\x91\x83\x6c\x8f\x61\x5f\x26\x26\xf4\x75\x5c\x9d\x5b\x26\x76\x76\x86\x6c\x7b\x53\xd7\xef\xe4\xba\x2d\x70\xca\xa6\x7f\xc7\x50\xb7\xfb\x70\x71\xed\x31\x94\x5c\x1f\x36\xf2\xd0\x0c\x2f\x65\x4a\x4f\x13\x4e\x7a\x3c\x7d\x55\x85\x03\x34\x7b\xec\x3c\x3e\xb2\x65\x6f\x5b\x59\xe4\x3f\x3e\x74\x35\x94\x47\x2e\x99\x85\xf4\x3b\x57\x75\xab\x43\xb6\x77\x03\xcc\xd7\xcd\x80\xf8\x0b\x3b\x22\x0f\x73\xf9\xb1\xf0\xc6\x3a\x34\x17\x65\x84\x76\x27\xb5\xc7\x31\x27\x62\xc4\x17\xb3\xc7\x3e\x41\xa5\xf6\xda" \ -"\xa1\x96\xa3\xfd\x5e\x7c\xd7\x0a\xf5\x47\x87\xa8\x3b\xfb\xe5\x9d\x27\x4b\xb3\xd3\x53\x21\xac\x51\x02\x1e\xde\xae\x42\x50\x0b\xc4\xbb\x7b\xff\x7f\xbb\xd0\xec\x6a\x58\x36\x5d\xfd\x25\x21\x9b\x52\x1a\x9c\x39\x57\x94\x82\x2c\x54\xcf\xab\xc8\x83\x52\x1c\x3d\x7a\x9b\x72\xa0\xfd\x1d\xb1\x32\xa8\x64\x49\x12\x84\x5c\x88\x43\x18\x9c\x95\xa4\x78\x6d\x82\xaa\x9c\xa4\xf8\x68\x53\x98\xe7\xd3\x64\x4e\x3b\xaa\x93\x65\x56\xfe\x7f\x8f\x7c\xb2\xe8\x23\x23\xf3\x03\xdc\xc6\xb6\x92\x47\xfa\x32\x3d\x98\xfd\x65\xdb\xdb\x9f\x3a\x22\xef\x6f\x90\x1d\x08\x63\x18\xd4\x7b\xb0\xab\x00\x84\xfd\x23\x8c\xa6\x9d\x44\xd7\xd9\x69\x4e\xe0\x12\x76\xd8\x4f\xe3\x65\x3b\x99\x1b\xd9\xf3\xfa\xc1\xd5\x64\xb8\x45\x4e\xe5\x07\x90\x6b\x05\xd6\xdf\x8b\x7b\x2c\x8c\xa5\x83\xd7\x41\x4d\xb5\x8f\x65\xda\xc6\x57\x2f\xbf\x0a\x66\xe7\x00\xef\x17\x80\x53\x0b\xda\x3e\x68\xb9\x49\xd3\xd8\x28\x46\xe7\x5c\xbb\xac\xff\x42\x9f\x5d\x9c\x23\xac\x7b\x02\xe6\x7b\xec\xf1\x9a\x58\x88\xb3\x93\xae\x59\x32\x05\x9e\xa9\x80\x7f\xd7\xe7\x52\x53\x9f\x42\xf1\xcd\x67\x8f\x14\xf8\xef\x8f" \ -"\x1f\xd2\xf9\x27\x19\x08\x08\xf2\x6f\x6f\xbc\x23\xbe\xfb\x11\x72\xa4\x31\x18\x71\x9f\x32\x73\x38\xbe\xb4\x5b\x7d\xed\x63\x74\xd3\x24\xd0\x73\x0c\x49\x3d\x63\x6e\x51\x40\x53\xa3\x83\x9a\xd3\x09\xa5\x0b\x1e\xb1\xb1\x2b\xf1\x07\x6c\xcb\xe0\x4b\x19\xf6\xa0\x21\x94\x20\x83\xb7\xbe\x00\xdb\x1c\xd0\xf2\x86\xae\x5b\x5c\x33\x24\xf0\x2b\x8b\x93\x65\xb7\x33\xd8\xf9\x2a\xa6\x34\x85\x73\xf9\x06\xf0\x17\x1b\x17\x4d\xb4\x28\xaf\xf0\xad\x68\x46\x89\x53\x52\xab\x9b\xd7\x88\x83\x04\xac\x13\x64\xff\x92\xa0\xc7\x80\xb1\x82\xa3\x38\x68\x6b\x66\x2c\xb2\xc4\xbb\x00\x26\x35\xe6\xbf\x94\xda\xcf\x69\x42\x6a\x67\x34\xf1\x77\xe9\x3f\x3f\xb6\x2d\x65\x3d\xd2\x59\xaf\x65\x62\x59\xac\xfc\xec\x24\x36\x8f\x83\x37\x23\xbd\x80\x39\x49\x22\xe5\xfa\xce\xfd\x2b\x25\x35\x88\xac\x49\xdd\x1b\xcd\xcf\x15\x78\x5c\x06\xdc\xa6\x42\x5f\x2d\xf1\xd1\x70\x48\x16\x1f\xdd\xe8\xdc\x9d\xf8\x4e\x69\xd6\xe6\x29\xc1\xd3\x2e\xf9\x1a\x0b\xf2\x2a\xe1\x74\xcf\xa6\x8d\x74\xb9\xdf\x56\xda\xbe\xff\xb9\xfa\xc7\xb5\x38\xbc\x84\x25\x1b\x55\xf8\x70\xa1\xb6\xa4\x99\x81\x28\x25" \ -"\x0d\x08\x43\xec\x24\xb6\x97\x82\x60\x83\x41\x1a\x67\xef\x41\xf3\xea\xa2\x07\x5a\xed\x18\x63\x91\x2f\xb5\x63\x41\x26\x24\x70\x9d\xef\xe1\x7f\xa1\xa8\x06\x42\xe7\xfc\x8e\x9a\xe1\x8a\xbd\xf3\x42\x8e\x47\x3d\xef\x37\xe6\x3b\x28\xe0\x86\x68\x64\xbd\xa6\xf9\x42\x5b\x92\x9a\x1c\x43\x4e\x8a\x28\x72\x47\xac\x03\xa8\xe9\x09\x6a\xe4\x8f\x38\xc1\xe3\xf3\x90\x33\xde\x5e\xe0\x2b\x4f\x95\xd4\xf5\x34\x44\xc8\x11\xeb\x2d\xa4\x93\x3e\x76\x34\xd8\xc3\x4e\x0d\x42\xbe\xbc\xf1\x8e\xea\xb6\x55\x30\x94\xd6\x7b\x39\xdf\xbc\xe5\x77\xa9\xb4\xc1\x46\xfa\xd7\xf9\x1d\x58\x7b\x58\xe2\xd2\xab\xaa\x20\x50\x55\x03\x1a\xdb\x6d\x61\x86\x0b\x60\x76\x47\x82\x56\xb6\x4d\x74\x89\xd6\x1c\x8c\xf2\xe3\xb2\xa7\xc8\xd6\xaf\x6b\x60\x84\x21\x28\x40\x5d\xce\x5a\x81\x84\xdd\xaa\xf2\x71\xeb\xfb\xac\xc1\x23\x3a\x55\x46\x09\x4b\x68\x47\xa1\x63\xd6\x06\x21\xcc\xfa\xac\xc7\x21\xb7\xf6\xfa\x6d\xfb\x32\x6a\x72\x10\x86\x96\x13\xdb\x15\x3c\x3f\xfb\xcc\x9d\x2d\x6a\xe9\x85\x9a\x91\x87\xc9\x4d\x3b\xb2\xb0\xd9\x6d\xec\x13\x13\xc8\x05\xa5\xeb\x51\x0e\x2a\x99\x28\xbd\x56" \ -"\x5c\x5a\xef\x4d\x35\x88\x41\x70\x5e\x82\x68\x47\x37\x4f\x16\xfa\x22\xb2\x0e\x5b\x18\x91\xfa\x04\xc5\x60\x48\x76\x8e\x1f\x53\x89\x0e\x39\x73\x24\xca\x90\x0a\x13\x7b\xb0\x17\x5d\x23\x5a\x91\x49\xa3\x7c\x42\x9c\x08\x52\xf3\x16\xcc\x3b\x4d\x31\xde\x01\xf6\x07\x4b\x0f\xea\x6e\x09\xe8\x1d\x9c\xef\xfa\x58\x18\xf4\x7b\x0f\xa9\x42\xb4\xfe\xd2\xe9\x86\x1b\x64\xa2\x67\x9e\xdf\x95\xe2\xa7\x8c\x35\x22\x39\x69\xdd\x70\x74\x48\xcf\xa9\x62\xc8\xbd\x21\x48\xb5\xa2\xa6\x04\x1d\x62\x9d\xb8\xf4\xbc\x7f\xba\x23\xba\xca\x18\x15\xb9\xa0\x3f\x11\x70\x4e\x60\x31\x57\x3c\x9a\xd7\x31\xc4\xb3\x7a\x3c\xfd\x9a\x56\xb1\xe3\x46\x01\x50\xcd\x3a\x42\x67\x92\xaa\x6c\x22\x86\x95\x86\xa0\xe1\x98\x3f\x12\xc7\x65\x9e\xc7\xeb\x7c\x62\x69\x08\x3e\x64\x5c\xf8\x51\x3b\x6c\xbe\x9c\xd8\x6a\x67\x5a\x45\xc7\xa0\x15\x42\xcb\x7d\x9d\xbd\x08\x73\x0f\x9e\x4d\x69\x7c\xab\xb4\xe3\x86\x32\xd0\xf5\xfe\x23\xe7\xd7\xe7\xc1\xda\xd8\x44\xcc\xe5\xe9\x5f\x78\xb1\x69\x6c\x5c\x09\xb5\x77\xc4\x13\x61\x05\x91\xfe\x70\x9c\x46\x09\x44\x27\x54\x21\x50\x02\x15\xe4\xb8\x91\xda" \ -"\x13\xca\xe7\x90\x03\x1d\x16\x0e\x92\xc1\x5a\xd8\x3f\x5f\xc5\x46\xc6\x44\xeb\x84\x10\x1f\x64\xb3\x13\x69\x13\xb2\xd2\xde\x76\x94\x25\xca\x32\xde\x54\xf6\x59\x24\x19\xb7\x50\xaf\x4f\x9a\x26\x77\x59\x7d\x85\x38\x15\x3d\xbb\x7b\x50\xe0\xbb\x0f\x54\x2e\x13\x01\x18\xf6\xfa\x20\xe2\xc1\x31\x76\xfc\x01\x2f\xac\xa1\xaf\x3c\x71\x38\xf8\xc6\x64\x75\x4e\x8a\x9a\x28\xe7\x76\x78\x17\xdf\x08\xef\x91\x33\x2b\x52\x92\x53\x81\x2b\x92\x4b\xab\x14\xba\x9d\xae\x89\xcd\xbb\xc6\x25\x0a\x6c\x41\x9a\xd4\xcf\x3f\xb2\x0b\x33\x05\x3e\xac\x7a\xdb\x93\x10\xdf\xf3\x86\x92\xa1\xad\x76\x71\xb9\xd4\xc7\x1d\x53\x05\xf1\x2a\x36\xa0\x39\x64\x74\x6f\xda\xc1\x27\x42\x43\x8d\xa1\xb3\x8d\x36\x57\x10\x2b\x0f\x5d\x29\xf0\x3e\x42\xe7\x3b\x2a\x30\x2e\xcf\x8d\x1b\xa0\x9c\xf7\x8a\x81\x82\x44\x22\x42\x45\xb1\x2d\x6c\x1a\x24\x32\x6d\x2e\xee\x52\xbb\xdb\xa6\xe1\x73\xcc\x79\xe4\x7a\x5c\x41\x43\x45\xa2\x68\x0a\x75\x11\x21\x71\x6e\x0a\x09\x02\x29\x18\xe3\xad\x31\x0a\x02\x93\x73\xc5\x5d\x85\x8b\x56\x26\x8a\x66\x5c\x11\x5e\x73\x4a\x65\x05\x0c\xde\xba\xe5\x10\x7e" \ -"\x10\xea\x69\xbf\xb8\xb6\x1b\x3b\x98\x76\xb3\x72\x4e\x41\x0f\x15\x2b\xd7\x07\xd7\x6e\xcf\x98\x80\x0e\x6a\xbc\x49\xe6\xb7\x17\x65\x5c\x5f\xfa\x73\xf5\x28\x3a\xa7\x9d\xc9\x01\xe5\xe9\x27\xf3\x67\xfd\x68\x87\xf8\xdb\x4a\x7f\x5b\x87\xe0\xf0\x2a\x06\x46\x46\x30\x17\x34\x4e\x0c\xd4\xcb\x37\x86\x6c\x6b\xb9\xed\x81\x78\xea\x36\xf3\xfc\xe7\x13\xbe\xbe\x2e\x30\x73\xc8\x91\x77\xc3\x8c\x7a\x15\x55\x78\xbd\x21\xd0\x3b\x27\xb5\x39\x37\x80\x90\x95\x78\x41\x4d\x71\x4b\xcb\xc2\xfb\xd9\x4d\x6e\x38\x36\x5d\xf0\x65\xdb\x34\xae\xa3\x99\xc1\x18\x10\x70\x67\xb2\xfc\x39\x02\x07\x37\xb8\x50\xb0\xf8\x80\xec\x49\xfa\x42\xda\x3f\x10\xe6\x95\x20\x95\xed\xc7\xa8\x51\x93\x3f\xd3\xfb\x70\xdf\x3e\x5c\x3c\x72\x9c\xcb\x0c\xe1\xe8\xfa\xa6\x7b\xc2\xe3\x38\x52\x04\x68\xa8\xaa\x26\x5d\x7a\xe8\xcf\xe4\x44\x3a\xf7\xa2\x60\x80\x14\xf9\x72\x5d\x25\xc7\xe5\x98\x86\xa8\x0e\xd4\x99\x89\x1f\xf1\xbd\xa3\xdf\xf7\xc4\x16\x43\x1b\x69\x0a\xeb\x1c\x18\xb1\xf9\xe6\x13\xf7\x91\xe4\x97\xc3\x11\xc9\x5d\xe2\xa7\x4c\xe3\x55\xcf\xc8\x8b\x25\x94\x28\xf3\xd6\x3c\x37\xf1" \ -"\xb7\x7e\xa0\x61\x06\x81\x68\xb6\xcf\xfa\x4d\x7b\xeb\xd3\x9e\xab\x34\xab\xba\x35\x79\x18\x89\x69\xa4\xf7\xac\x84\xc9\x1f\x87\x7b\x00\xa4\xa4\xeb\xa7\x67\x3f\x28\x36\x66\x2e\xc5\xb9\xc2\x0e\xc3\x9f\xb6\x78\x04\x24\x0e\xc2\xdb\x9b\x17\xe9\x94\xa9\x71\x9e\x5c\x67\x44\xf7\x85\xd6\xfc\x09\xdc\x32\xc6\xfb\x4b\x22\x0a\x73\xd1\xac\x93\xa8\xb9\x51\x46\xae\x9b\x50\x6f\xf6\x4e\xc7\x9b\xc0\x02\xf1\xa2\x7b\x7b\x4d\xe4\x65\x16\xf1\x59\xf5\x3f\x03\xeb\x4c\xa2\x14\x0c\x51\xe4\xfe\x32\x92\x4c\x95\x70\xe2\x58\xe7\xa7\xe5\x1b\xfa\x15\x62\x54\xeb\xfb\xd5\xee\xd1\x6f\x22\x90\xb5\xbe\x16\x3c\x70\xf4\x62\xf1\x13\x33\xa3\x04\xc6\x08\x32\xc2\xc8\xf1\x9b\xc0\x61\x5f\xad\x31\x5e\xa9\x70\x15\x57\x17\xe5\xe2\x4b\x3c\x86\x7e\x15\x0a\x56\x54\xee\x71\x13\x4d\xcd\x03\x9e\x69\xf1\x62\x56\xed\xe9\xbe\x61\x88\xca\xea\x93\x79\xfd\x9c\xb0\xee\xde\x47\x23\xb9\x7f\xd4\xd3\x00\x56\x81\x83\x5d\x6f\xa7\x79\x8a\x45\xfb\x04\x5a\xe5\x2b\x30\x90\x8a\x00\x30\xf9\xca\xcb\x2e\x75\xaf\x1b\x60\xe6\x77\x5d\x9c\x81\xba\x7a\x85\x72\xa0\xc4\x32\x51\x61\x3f\x0d\xbc" \ -"\x92\x3f\x04\xdc\xde\xa5\x09\xec\x7c\x75\x91\x5b\xf4\xba\xe9\x23\x4e\xf1\x2d\x26\x7f\xb3\xa5\x14\xfd\x83\xab\x29\xe6\x9e\xa2\x53\x32\x13\x17\x53\x80\x79\x43\xf8\x11\x91\x62\x70\xbe\xfa\xed\xf3\xf8\x40\x92\x29\x10\x2c\x9a\x21\x3c\xa2\xa1\x9c\xe5\xb0\xac\x31\x2a\xf0\xeb\x55\x5a\xa2\x97\xaa\xb7\x1b\x15\xb7\x28\x86\xbb\xc1\x4b\xb7\x4c\x3f\xeb\x1b\x5a\x85\x1a\x8a\x53\x96\x4d\xce\xe9\xa6\xcc\x5a\x7d\xd3\x85\xe5\x0a\xa6\x0c\x92\xb8\x98\x6b\xf2\xf5\x34\x91\x9a\x22\xf9\x0d\x66\xfd\xd1\x14\x03\xe1\x58\x9c\x89\x1e\xb6\xce\xd3\xff\x95\x27\x40\x85\x10\x7d\x05\x73\xdc\x33\x7a\xf2\x79\xde\xd4\xef\xed\xd0\x1f\x48\x62\x24\x83\xb9\x09\x7c\x0e\x37\xec\xc4\x26\x44\x52\x11\xc5\xff\xa8\xc7\x9e\x5e\x34\x3a\x7e\x64\x39\x76\xb8\xd6\x2a\x41\xf9\x9c\x80\x52\x8b\xea\x3f\x77\x37\x59\x6c\xcf\xd1\xe2\x22\xc6\x86\x36\x83\x9a\x57\x60\x1f\x0b\xf1\x01\x0b\x61\x3d\xa7\x14\xdf\xbc\xa3\x1f\xfa\xbd\x0d\x1d\xc4\xd1\xda\x77\x66\x0d\xac\x95\x95\xdb\xfb\x40\xee\xd3\xd4\x88\x52\xed\x96\x8c\xbc\xc9\x7b\xbf\x53\x85\xc1\xfd\x19\x1b\xf6\x48\x3c\xd4\xe3\xf1" \ -"\xd1\xce\x8e\x1d\x0b\x0b\x92\xb6\xcb\xd6\x19\xc0\xec\xc5\xb0\x06\xd8\x69\x91\xbf\x73\xa1\x6b\xaa\xc2\x79\x94\xcd\x41\x74\x9d\x60\xad\xd9\x1e\x60\xae\xef\xb2\x97\x79\x2e\x03\x56\x41\x20\x78\xc3\x42\x56\x90\xce\x5b\x24\x94\x2a\xd8\xd0\xa4\xcb\x95\x45\xe6\x31\x4e\xe0\xb1\x17\xaf\x67\xbf\x6f\xb5\x82\xff\xd7\xbd\xad\x86\xbd\x40\x24\xe2\x86\x59\x74\x8a\x5c\x51\xf6\xca\x0a\xf3\x15\x51\xa5\xd2\xeb\x31\x63\xd9\x13\xb8\x36\x47\x66\x84\x31\x87\xe4\x9c\x43\xaa\x26\xad\xc8\xef\xf4\xff\x41\xd3\x64\xa1\x76\x6f\xda\xdb\x57\x17\x39\x09\xf6\x66\xfc\x9d\xcd\x62\x0c\x61\xc6\xb7\x8d\xdf\x9a\x17\xb4\x7b\x50\x9c\x90\xe7\x5f\x2a\x87\x1f\xf4\xa4\x79\x8a\x74\x9a\xcf\xde\x8a\x20\x54\xb9\x38\x72\x09\xf4\x0b\xd5\xed\xa6\x5b\x1f\xd9\x14\xb3\xa8\x79\x8b\xed\xb5\xdd\x5a\xae\x02\xb0\x22\xd2\x82\xf1\x82\xf0\xb2\x59\xb0\x82\xb9\xf3\x34\x65\x74\x70\x06\x3c\x54\x06\x6e\x1d\xf6\x42\x0a\xa4\x82\x2e\x4b\xa3\xb3\x2d\xfa\x20\x39\x30\x4a\xa9\x85\x2c\xa7\xf1\x67\x1f\x77\xf3\x4a\xd0\x04\xa2\x11\x0b\x48\x7e\x0a\x51\x75\xbc\x67\xde\xa3\x4e\xce\x48\xd8\x49" \ -"\x02\xdd\xe6\x7a\x6b\x8d\x7e\x01\xec\x3f\x33\xa9\xa0\x0e\xa5\xd0\xae\x09\x5b\x4a\xfc\x92\xc6\x4f\xee\xaf\x27\x66\x4b\x96\x28\x6d\x8f\x75\x4d\x99\xea\x52\x26\xa2\x17\xf2\x6b\x7c\xd9\x0d\x33\x37\x5c\x01\x1c\x8a\x3e\xd1\x45\xde\x3f\x3e\x96\xdd\x4a\xe8\xdc\xb5\x15\x24\xcb\xb6\xc1\xb7\xad\x71\x9d\xf1\xd0\x83\xac\x00\xb0\x37\xe5\x3f\x36\x54\xc5\x69\xc4\x9a\x3c\x34\x32\xbf\xe6\xca\x81\x55\xeb\x4b\xf5\xac\x3a\xe6\x00\xfb\xfa\x68\x7b\xf7\xe0\x78\x76\x1e\x32\xdf\x90\xe9\xf3\xd5\x3a\xe4\x7c\x18\xa8\xc2\x18\xc0\x04\x3f\x6b\x27\x37\xca\xc4\xfe\x95\x8d\xbd\x88\xda\x6c\xcb\x64\xc6\x79\xf0\xfc\xd0\xc8\xe6\xb2\x75\xc7\x02\x37\xa5\xd6\xd2\xf6\x8e\xb2\x3f\x56\xf9\x9c\x64\xac\xca\xc5\x94\xde\x4c\xb9\xdd\xf8\x47\x07\xe7\xe0\x9e\xec\x1b\x2c\x35\x3a\xb5\x41\xb0\x92\xdf\xfe\x05\xf9\xcf\xda\xa0\xd4\xf5\x0e\x72\xf6\x99\x8b\x37\xe6\x59\x8f\x7d\x85\x67\xf9\x7b\x5b\xe5\xc3\xd6\x41\xfb\xdb\x0b\x30\xa7\x48\x09\x83\x6e\xcf\xf4\xc5\x9f\x17\x33\xa1\x87\xfb\xdc\x34\xf2\x7a\xc7\x15\xe7\x22\xb9\x54\x8c\x70\x03\xa4\xe7\x40\xa2\xc0\x67\xb6\xa2\x70" \ -"\x02\x8e\x16\x94\x3e\x47\x4f\xe8\x55\x26\x0f\x57\xe6\xe8\x70\xcb\x5e\xe6\xac\xe9\xdb\x9e\xf6\x57\x3d\x9b\x16\x0e\x9d\x17\x3d\x63\xc4\x61\x46\xd8\xad\xec\xd3\x78\xc5\x1c\xe7\x2f\xd7\x42\x47\x2e\x42\x1c\x1d\xdf\x4d\xad\x90\x52\xdc\xde\x63\xe5\x4a\x35\x58\x74\x7b\xa2\xf0\xa8\xd8\x8e\xcd\x90\xb7\x7f\x87\x04\xa2\x5b\xb0\x4e\x1a\xb2\xf9\x68\xc3\x4c\x69\xce\x8f\x14\x9e\xdc\x16\x43\xc9\xed\x4e\xf1\x38\x6f\x3f\xa0\xf0\xa8\x83\xfd\x3e\x08\x33\x58\x2b\xae\xd9\xeb\xf3\x47\x32\xd2\x07\xeb\x38\x3f\x80\x6f\x20\xf4\xbb\xd9\xaa\x4d\x98\x41\x07\xc8\x1e\x2f\x53\x7e\x8b\xaa\x8e\xdb\xb8\x9c\x36\x66\xf9\x5e\x20\x02\xcc\xce\x4d\xe6\x3c\xb8\x8f\xa7\x6e\xf1\xcb\x3c\x2c\xae\x80\x96\xba\xd7\xda\xbd\x57\x6b\xd8\x54\x4c\xa6\xab\x5b\x17\x10\xd0\xd3\xb5\xea\x3d\xcb\xe0\xac\x80\x81\x42\x07\xf9\x00\x4b\x9d\xeb\x31\xf4\x9a\x9d\x6b\xcd\x46\x92\x26\xbc\x06\xda\x85\xe7\xcc\xa8\xea\x85\x11\xf5\x55\xfd\xa3\xf2\xa8\x38\x09\x63\x8e\xec\xed\x43\x14\xe2\x3c\x04\x56\x53\xd0\xf3\x13\x7f\xa8\x06\x9c\x43\xb3\x42\xaa\xf2\xd3\xaa\xc7\xbc\x47\xe7\xbf\x43\x2a" \ -"\x6d\x25\x75\x9a\xe7\x74\x3f\xe8\xce\x6b\x8d\x11\x7f\x8f\x4f\xf7\xa0\x3e\x97\xea\x74\x7e\x0e\xdf\x08\x05\x34\x52\x08\x63\x11\x09\x07\x04\xd0\x6a\x0b\xd0\x9c\x9d\x55\x33\xec\x80\x29\x42\x63\xf3\xdc\x99\x83\x6f\x4e\xbd\x5f\xdb\x33\x64\x29\x96\xbc\xda\x23\x25\xb0\x1f\x7a\xfc\xcf\xde\xd6\x8e\x5f\x13\x88\x9f\xc3\xd1\x27\xb6\x13\x61\xb9\x48\x53\xa5\xd0\xf9\x53\x04\xf4\xe6\x1e\x07\x0d\xa1\x5a\xc8\x79\x8a\x43\x97\xfc\xc5\xa5\x2c\xd7\x09\x51\x76\xb3\x9f\x0f\x03\x9c\x69\x97\x68\x6d\xa1\xca\x8f\xc7\x29\xbb\xac\x9a\x40\x69\x45\x43\xad\xe2\x22\xea\x6f\x45\xf4\x2d\xe6\x31\x0b\x12\x9e\x38\xb8\x37\x7c\x2e\xfc\xd7\x6d\xec\x7c\x9c\xac\x94\x9f\x2c\x93\x81\x32\x31\xe6\x80\xd5\x89\xa1\x7d\x8c\xde\x24\x5a\x75\xdf\x92\xed\x7a\x27\x76\xbc\x5d\x0b\x28\x31\x72\xe6\x50\x1f\xdd\x3a\xc7\xae\xc0\x70\x1f\xec\x62\x38\x4c\x1b\xc7\x4e\x1c\x30\x3e\xf6\xcf\x1e\x55\x32\x1f\x04\x8f\x3a\xf1\x83\x53\xcb\x46\xf1\x7c\x96\xa0\x58\x1e\xe3\xb1\xd5\x4b\x8b\x7a\x53\x53\x29\x61\x8c\x4e\x9d\xbc\xac\x55\x34\xca\x4c\x2f\x91\x4c\x7e\x90\xe4\x31\xef\x67\xc4\x95" \ -"\xcb\x85\x9f\xc9\xd7\xf1\x47\xf5\x72\x31\x7d\xe4\x16\xc0\xeb\xe6\xf6\xf7\x64\x6e\x4c\x4a\xd6\xe2\xdd\x78\x8c\xfa\x6c\x09\xcb\x28\x5c\x13\xb8\x88\x56\x4c\xfa\xb1\x40\x4c\xd6\x4f\xbe\x56\x08\x83\xb2\x00\xc8\xab\xf5\x90\x5e\x02\xec\x0b\xbb\x77\xa5\x53\x82\xfc\x31\x7e\xfe\x83\x26\x2b\xf5\xaa\x35\x07\xb7\xcd\x54\x47\x10\x7f\x56\xf9\x1f\xa9\x41\x21\xcf\x92\x6f\x9b\x2b\x91\x55\xfa\xd8\x26\x5f\x12\x81\xba\x0e\x03\x9e\x2b\xb7\x2c\xcd\x5a\x25\x8d\x1b\x82\x73\x04\x79\x43\x71\x2b\x6d\xfb\x47\x67\x20\x81\xa3\x49\x74\xfc\x20\x95\x11\x96\x75\xa8\xda\x38\xa3\xad\x7d\x54\x67\x88\xc3\x59\x2e\x1b\x2d\x99\x06\xb8\x51\x5d\x83\x1c\x2a\xab\x57\xb1\x87\x6d\x18\x4e\x50\x67\x6e\xa8\x03\xfb\xa5\x8b\xab\x19\x4d\xa6\xfa\xc1\xa6\xa8\xc3\xa0\x0c\x19\x6e\x24\x00\x84\xf7\xc7\xc3\x1e\xb1\x0e\xb0\xc5\x3a\x8e\x5d\x2b\x97\x7e\x1c\xb8\xe7\xb3\x71\xe3\x1a\xa5\x62\xb4\xb7\xda\xb6\x96\x7d\xe7\x66\xe7\xce\x27\x39\x79\xc1\x2b\x0b\xfe\xad\x1d\xfb\x2d\xab\x6a\x57\x72\x26\x3a\x99\x48\x54\xc1\x24\x02\x8e\xd7\x79\x93\xa0\x0b\x25\xf3\xd5\xd9\xb5\x98\x70\xbf" \ -"\x9b\xd9\x88\x75\xaf\xb6\x7d\x86\xda\x3a\xd4\xef\x27\xfa\x77\xdc\x71\xd6\x8f\xcc\x7c\x0b\x99\xc8\x9e\xd7\xfd\x28\x23\x11\xe8\x2d\xd9\x2f\xbf\x9f\xc7\x52\x29\x6a\x9e\xf4\xde\xfe\x85\x6d\x97\x2b\xbb\xcb\xa5\x3d\xa3\xcd\x07\xd9\x0c\xfc\x7b\x5a\xff\xff\x58\xdd\x7a\x4c\xad\xb9\x55\xb9\x21\xe4\xe2\xa1\x48\xd9\x22\xc5\x8c\xbe\x12\x07\x8e\xb1\xcb\x31\x5d\x5b\x0c\x0c\x1d\x23\x64\x88\x3a\x16\xae\x31\x47\xd1\xda\xc7\x7d\x33\x6e\x75\x2d\xcd\x8d\x51\xc0\x94\xd3\xee\xda\x54\xe3\xbf\xa0\x31\x6e\xcf\xbe\x08\x9c\xb8\xa7\x94\xe4\x45\x13\x27\x03\xd2\xcc\xc4\xe6\x7b\x40\x7b\x85\x73\x21\x55\x0f\x2d\x90\xda\x1f\xc0\x22\x3c\xd0\xa6\x71\x97\x7a\xf9\xab\xcf\x08\xa4\xcf\x8a\xf6\xd9\xfb\x22\x1b\x91\x90\x39\x3c\xa5\xcb\x75\xc7\x50\x8d\xda\x24\x41\x18\x73\x21\x98\x8b\x98\x22\x48\x63\xc0\xdb\x31\x41\xbb\xd9\x0e\xd0\x38\x3e\x8f\x0c\x33\xe1\xbb\x26\x13\x72\x53\x76\x75\x11\xf9\xe0\xb9\xe1\xed\x47\x4f\x43\x4b\x33\x00\x5c\x7b\x9b\x7a\x9a\x69\x65\xeb\x11\xa0\x23\x98\x6c\x2d\x97\x9a\x5c\x95\x3f\xff\x4d\x99\x68\x62\xd0\xfb\x70\xbd\x26\x66\xcd\x75" \ -"\xff\xe8\x96\x6d\x33\x46\x05\x0b\xe0\x29\x8d\xc8\xe3\xaa\x01\xdc\x22\x67\x70\xb9\xa9\xcf\x8d\xb7\xac\x3d\x81\x71\x7e\xc8\x3b\xc5\x5d\xf5\xf0\x3a\xe8\x28\x5a\x7d\x25\x86\xd2\x52\x76\xea\xc8\x73\xa9\x7c\xbc\x01\xac\xec\x1f\x4f\xd3\xd5\x92\xc3\xce\x69\x39\xf1\x3b\xed\x91\x20\x06\x18\xfd\x17\x3c\xd3\x02\x5e\x2a\xbe\xb4\xd5\xb1\x17\xa7\x68\x03\xe2\xab\xd0\x5f\x60\x39\x35\x8d\x73\x58\xae\x0a\xce\xea\x96\xb6\x9d\xf2\x5d\x61\x50\x09\x9a\x98\xa6\x5e\x8d\xee\xd4\x44\xe7\xf4\x00\x24\xa7\x02\x09\xa9\x10\x97\xaa\x21\x33\x01\x69\xd2\xc2\xe0\x92\xdd\xe3\x89\x3f\x90\x0e\x05\x8c\x1e\xc1\xcb\x2f\x5a\x14\xe9\xa9\x42\xc0\x5b\xfc\xa1\x8c\x43\xca\x0c\x18\xbe\xf2\x2e\xd0\x79\x08\xc2\xa4\xa4\x7d\xd8\xc2\xf2\x7d\x83\x23\x05\x2d\x12\x98\x9d\xf0\x23\x38\xf6\x90\xaf\x02\x07\x7b\x0d\x9e\xa8\x73\xdd\xc3\x36\xec\x23\x84\xf6\x07\x64\x6c\x78\x11\x17\xd2\x3d\xee\x26\x49\x95\x1c\xf9\x1d\x05\xe8\x1c\x83\x54\x4f\x9b\x1a\x52\x60\x96\xdb\x7a\xa7\xe7\x38\xe9\xb0\x9a\xd5\x7e\x0e\x9b\x0d\x44\x9d\x19\xec\xf4\x40\x7d\x4a\xf7\xf1\x7b\xb1\x66\x2b\xf4\x7a" \ -"\xad\x4b\x84\xf4\xf8\xec\xf6\xa1\x8a\x44\x56\x02\x34\x79\xe8\x60\x64\xcf\xee\xdb\x40\xc5\xa2\x08\x61\x90\x59\x79\x42\x92\xa6\xe9\x07\x91\xd9\xdf\x33\xfe\x80\x01\xd3\x01\x00\x00\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30" \ -"\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0a\x63\x6c\x65\x61\x72\x74\x6f\x6d\x61\x72\x6b\x0a\x80" \ -"\x03"}; diff --git a/source/blender/src/CMakeLists.txt b/source/blender/src/CMakeLists.txt deleted file mode 100644 index 176ec036ada..00000000000 --- a/source/blender/src/CMakeLists.txt +++ /dev/null @@ -1,85 +0,0 @@ -# $Id$ -# ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. The Blender -# Foundation also sells licenses for use in proprietary software under -# the Blender License. See http://www.blender.org/BL/ for information -# about this. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# The Original Code is Copyright (C) 2006, Blender Foundation -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL/BL DUAL LICENSE BLOCK ***** - -FILE(GLOB SRC *.c) - -SET(INC - ../../../intern/guardedalloc ../../../intern/memutil - ../blenlib ../makesdna ../blenkernel - ../include ../../../intern/bmfont ../imbuf ../render/extern/include - ../../../intern/bsp/extern ../radiosity/extern/include - ../../../intern/decimation/extern ../blenloader ../python - ../../kernel/gen_system ../../../intern/SoundSystem ../readstreamglue - ../quicktime ../../../intern/elbeem/extern - ../../../intern/ghost ../../../intern/opennl/extern - ../nodes - ${PYTHON_INC} - ${SDL_INC} -) - -IF(WITH_INTERNATIONAL) - SET(INC ${INC} ../ftfont) - ADD_DEFINITIONS(-DINTERNATIONAL) - ADD_DEFINITIONS(-DFTGL_STATIC_LIBRARY) -ENDIF(WITH_INTERNATIONAL) - -IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) -ENDIF(WITH_OPENEXR) - -IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) -ENDIF(WITH_QUICKTIME) - -IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) -ENDIF(WITH_FFMPEG) - -IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) -ENDIF(WIN32) - -IF(WITH_VERSE) - SET(INC ${INC} ${VERSE_INC}) - ADD_DEFINITIONS(-DWITH_VERSE) -ENDIF(WITH_VERSE) - -# TODO buildinfo -IF(BF_BUILDINFO) - ADD_DEFINITIONS(-DNAN_BUILDINFO) -ENDIF(BF_BUILDINFO) - -BLENDERLIB_NOLIST(src "${SRC}" "${INC}") - -IF(WITH_VERSE) - ADD_DEPENDENCIES(src mkprot verse) -ENDIF(WITH_VERSE) - diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile deleted file mode 100644 index 5038c294bc6..00000000000 --- a/source/blender/src/Makefile +++ /dev/null @@ -1,149 +0,0 @@ -# -# $Id$ -# -# ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. The Blender -# Foundation also sells licenses for use in proprietary software under -# the Blender License. See http://www.blender.org/BL/ for information -# about this. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -# All rights reserved. -# -# The Original Code is: all of this file. -# -# Contributor(s): none yet. -# -# ***** END GPL/BL DUAL LICENSE BLOCK ***** -# -# - -ORGLIBNAME = src -LIBNAME ?= $(ORGLIBNAME) -DIR ?= $(OCGDIR)/blender/$(ORGLIBNAME) - -CSRCS ?= $(wildcard *.c) -PUB_CSRCS ?= $(CSRCS) -CRE_CSRCS ?= $(CSRCS) $(wildcard cre/*.c) - -OBJS = $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)DNA.o - -ALLTARGETS = publisher - -include nan_compile.mk - -# Cflags stuff ------------------------------------------ - -CFLAGS += $(LEVEL_1_C_WARNINGS) -#CFLAGS += $(LEVEL_1_C_WARNINGS) -diag_error 1196 - -# PreProcessor stuff ------------------------------------------ - -CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -CPPFLAGS += -I$(NAN_GHOST)/include -CPPFLAGS += -I$(NAN_BMFONT)/include -CPPFLAGS += -I$(NAN_ELBEEM)/include -CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include $(NAN_SDLCFLAGS) - -# External interfaces of modules: -CPPFLAGS += -I../render/extern/include -CPPFLAGS += -I../blenkernel -CPPFLAGS += -I../blenlib -CPPFLAGS += -I../nodes -CPPFLAGS += -I../python -CPPFLAGS += -I../makesdna -CPPFLAGS += -I../imbuf -CPPFLAGS += -I../blenloader -CPPFLAGS += -I.. -CPPFLAGS += -I../../kernel/gen_system -CPPFLAGS += -I../../gameengine/SoundSystem -CPPFLAGS += -I../ftfont - -# Only used by py_demo.c !!! -CPPFLAGS += -I../radiosity/extern/include - -CPPFLAGS += -I$(SRCHOME)/gameengine/Physics/Sumo/include -CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include -CPPFLAGS += -I$(NAN_MEMUTIL)/include - -CPPFLAGS += -I$(NAN_DECIMATION)/include -CPPFLAGS += -I$(NAN_BSP)/include -CPPFLAGS += -I$(NAN_OPENNL)/include - -CPPFLAGS += -I../readstreamglue -CPPFLAGS += -I../include - -ifdef NAN_BUILDINFO - CPPFLAGS += -DNAN_BUILDINFO -endif - -ifeq ($(OS),linux) - ifeq ($(CPU),alpha) - CPPFLAGS += -I$(NAN_MESA)/include - endif - ifeq ($(CPU),i386) - CPPFLAGS += -I$(NAN_MESA)/include - endif - ifeq ($(CPU),powerpc) - CPPFLAGS += -I/usr/src/MesaCVS/include - endif -endif - -ifeq ($(WITH_QUICKTIME),true) - CPPFLAGS += -I../quicktime - CPPFLAGS += -DWITH_QUICKTIME -endif - -ifeq ($(WITH_ICONV), true) - CPPFLAGS += -DWITH_ICONV - CPPFLAGS += $(NAN_ICONV_INC) -endif - -ifeq ($(WITH_FFMPEG),true) - CPPFLAGS += -DWITH_FFMPEG - CPPFLAGS += $(NAN_FFMPEGCFLAGS) -endif - -ifdef NAN_PTHREADS - CPPFLAGS += -I$(NAN_PTHREADS)/include -endif - -ifeq ($(WITH_OPENEXR),true) - CPPFLAGS += -DWITH_OPENEXR -endif - -ifeq ($(WITH_DDS),true) - CPPFLAGS += -DWITH_DDS -endif - -ifeq ($(INTERNATIONAL), true) - CPPFLAGS += -DINTERNATIONAL -endif - -ifeq ($(WITH_VERSE), true) - CPPFLAGS += -DWITH_VERSE - CPPFLAGS += -I$(NAN_VERSE)/include - # print some other debug information - ifeq ($(VERSE_DEBUG_PRINT), true) - CPPFLAGS += -DVERSE_DEBUG_PRINT - endif -endif - -ifeq ($(NAN_TWEAK_MODE), true) - CPPFLAGS += -DTWEAK_MODE -endif - -CPPFLAGS += -I$(OPENGL_HEADERS) diff --git a/source/blender/src/SConscript b/source/blender/src/SConscript deleted file mode 100644 index f466798c40c..00000000000 --- a/source/blender/src/SConscript +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/python -Import ('env') - -# TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS']) - -sources = env.Glob('*.c') - -if env['BF_SPLIT_SRC'] == 1: - numobj = len(sources) - maxobj = 30 - - numlibs = numobj / maxobj - if (numobj % maxobj): - numlibs = numlibs + 1 - subsources = [] - - if (env['OURPLATFORM'] == 'win32-mingw'): - for i in range(numlibs - 1): - subsources.append(sources[i*maxobj:(i+1)*maxobj]) - subsources.append(sources[(numlibs-1)*maxobj:]) - -incs = ' #/intern/guardedalloc #/intern/memutil' -incs += ' ../blenlib ../makesdna ../blenkernel' -incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include' -incs += ' #/intern/bsp/extern ../radiosity/extern/include' -incs += ' #/intern/decimation/extern ../blenloader ../python' -incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue ../nodes' -incs += ' ../quicktime #/intern/elbeem/extern' -incs += ' #/intern/ghost #/intern/opennl/extern' - - -incs += ' ' + env['BF_PYTHON_INC'] -incs += ' ' + env['BF_SDL_INC'] -incs += ' ' + env['BF_OPENGL_INC'] - -defs = [] - -if env['BF_TWEAK_MODE'] == 1: - defs.append('TWEAK_MODE') - -if env['WITH_BF_YAFRAY'] == 0: - defs.append('DISABLE_YAFRAY') - -if env['WITH_BF_INTERNATIONAL'] == 1: - incs += ' ../ftfont' - defs.append('INTERNATIONAL') - defs.append('FTGL_STATIC_LIBRARY') - -if env['WITH_BF_OPENEXR'] == 1: - defs.append('WITH_OPENEXR') - -if env['WITH_BF_DDS'] == 1: - defs.append('WITH_DDS') - -if env['WITH_BF_QUICKTIME']==1: - incs += ' ' + env['BF_QUICKTIME_INC'] - defs.append('WITH_QUICKTIME') - -if env['WITH_BF_ICONV'] == 1: - incs += ' ' + env['BF_ICONV_INC'] - defs.append('WITH_ICONV') - -if env['WITH_BF_FFMPEG'] == 1: - defs.append('WITH_FFMPEG') - incs += ' ' + env['BF_FFMPEG_INC'] - -if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): - incs += ' ' + env['BF_PTHREADS_INC'] - -if env['WITH_BF_VERSE']: - defs.append('WITH_VERSE') - incs += ' ' + env['BF_VERSE_INCLUDE'] - -# TODO buildinfo -if env['BF_BUILDINFO'] == 1: - defs.append('NAN_BUILDINFO') - -if (env['BF_SPLIT_SRC'] == 1) and (env['OURPLATFORM'] == 'win32-mingw'): - for i in range(numlibs): - env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] ) -else: - env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] ) diff --git a/source/blender/src/bfont.ttf.c b/source/blender/src/bfont.ttf.c deleted file mode 100644 index a52d6ded28a..00000000000 --- a/source/blender/src/bfont.ttf.c +++ /dev/null @@ -1,5992 +0,0 @@ -/* DataToC output of file */ - -int datatoc_bfont_ttf_size= 191532; -char datatoc_bfont_ttf[]= { - 0, 1, 0, 0, 0, 17, 1, 0, 0, 4, 0, 16, - 79, 83, 47, 50,150,230,175, 11, 0, 0, 1,152, 0, 0, 0, 86, 99,109, 97,112, 83, 13, 80,227, 0, 0, 28, 64, 0, 0, 3,138, - 99,118,116, 32, 0,105, 29, 57, 0, 0, 37,224, 0, 0, 1,254,102,101, 97,116,128, 29, 10, 57, 0, 2,233,124, 0, 0, 0, 80, -102,112,103,109,113, 52,118,106, 0, 0, 31,204, 0, 0, 0,171,103,108,121,102, 31, 47,248,201, 0, 0, 53, 40, 0, 1,229,240, -104,101, 97,100,232, 93,169,219, 0, 0, 1, 28, 0, 0, 0, 54,104,104,101, 97, 12,184, 14,241, 0, 0, 1, 84, 0, 0, 0, 36, -104,109,116,120,203, 81,215, 70, 0, 0, 1,240, 0, 0, 26, 78,107,101,114,110,239,172, 97,238, 0, 2, 27, 24, 0, 0, 60, 6, -108,111, 99, 97,253, 73,117,214, 0, 0, 39,224, 0, 0, 13, 72,109, 97,120,112, 10,234, 6,122, 0, 0, 1,120, 0, 0, 0, 32, -109,111,114,120,223,111, 12,226, 0, 2,213, 8, 0, 0, 20,116,110, 97,109,101,179,203,190,182, 0, 2, 87, 32, 0, 0, 65, 55, -112,111,115,116, 15, 42,244, 94, 0, 2,152, 88, 0, 0, 60,174,112,114,101,112, 59, 7,241, 0, 0, 0, 32,120, 0, 0, 5,104, -112,114,111,112, 68,181,210, 32, 0, 2,233,204, 0, 0, 2, 96, 0, 1, 0, 0, 0, 2,204,204, 16,228, 33, 70, 95, 15, 60,245, - 2, 27, 8, 0, 0, 0, 0, 0,192,243, 73,110, 0, 0, 0, 0,192,243, 73,110,247,214,252,235, 13,114, 8, 75, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 7,109,254, 29, 0, 0, 13,226,247,214,252,109, 13,114, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,132, 0, 1, 0, 0, 6,163, 0, 93, 0, 9, 0,112, 0, 8, 0, 2, 0, 16, 0, 64, - 0, 8, 0, 0, 4, 21, 5,104, 0, 8, 0, 3, 0, 1, 4, 14, 1,144, 0, 5, 0, 0, 5, 51, 5,153, 0, 0, 3,215, 5, 51, - 5,153, 0, 0, 0, 0, 0,102, 2, 18, 0, 0, 2, 11, 6, 3, 3, 8, 4, 2, 2, 4,224, 0, 38,255, 64, 0, 4,255, 0, 4, - 0, 32, 0, 0, 0, 0, 80,102, 69,100, 0, 64, 0, 13,255,253, 6, 20,254, 20, 1,154, 7,109, 1,227, 96, 0, 1,255,191,255, - 0, 0, 0, 0, 4,205, 0,102, 0, 0, 0, 0, 2,170, 0, 0, 2,139, 0, 0, 3, 53, 1, 53, 3,174, 0,197, 6,180, 0,158, - 5, 23, 0,170, 7,154, 0,113, 6, 61, 0,129, 2, 51, 0,197, 3, 31, 0,176, 3, 31, 0,164, 4, 0, 0, 61, 6,180, 0,217, - 2,139, 0,158, 2,227, 0,100, 2,139, 0,219, 2,178, 0, 0, 5, 23, 0,135, 5, 23, 0,225, 5, 23, 0,150, 5, 23, 0,156, - 5, 23, 0,100, 5, 23, 0,158, 5, 23, 0,143, 5, 23, 0,168, 5, 23, 0,139, 5, 23, 0,129, 2,178, 0,240, 2,178, 0,158, - 6,180, 0,217, 6,180, 0,217, 6,180, 0,217, 4, 63, 0,147, 8, 0, 0,135, 5,121, 0, 16, 5,125, 0,201, 5,150, 0,115, - 6, 41, 0,201, 5, 14, 0,201, 4,154, 0,201, 6, 51, 0,115, 6, 4, 0,201, 2, 92, 0,201, 2, 92,255,150, 5, 63, 0,201, - 4,117, 0,201, 6,231, 0,201, 5,252, 0,201, 6, 76, 0,115, 4,211, 0,201, 6, 76, 0,115, 5,143, 0,201, 5, 20, 0,135, - 4,227,255,250, 5,219, 0,178, 5,121, 0, 16, 7,233, 0, 68, 5,123, 0, 61, 4,227,255,252, 5,123, 0, 92, 3, 31, 0,176, - 2,178, 0, 0, 3, 31, 0,199, 6,180, 0,217, 4, 0,255,236, 4, 0, 0,170, 4,231, 0,123, 5, 20, 0,186, 4,102, 0,113, - 5, 20, 0,113, 4,236, 0,113, 2,209, 0, 47, 5, 20, 0,113, 5, 18, 0,186, 2, 57, 0,193, 2, 57,255,219, 4,162, 0,186, - 2, 57, 0,193, 7,203, 0,186, 5, 18, 0,186, 4,229, 0,113, 5, 20, 0,186, 5, 20, 0,113, 3, 74, 0,186, 4, 43, 0,111, - 3, 35, 0, 55, 5, 18, 0,174, 4,188, 0, 61, 6,139, 0, 86, 4,188, 0, 59, 4,188, 0, 61, 4, 51, 0, 88, 5, 23, 1, 0, - 2,178, 1, 4, 5, 23, 1, 0, 6,180, 0,217, 5, 23, 0, 0, 3, 53, 1, 53, 5, 23, 0,172, 5, 23, 0,129, 5, 23, 0, 94, - 5, 23, 0, 82, 2,178, 1, 4, 4, 0, 0, 92, 4, 0, 0,215, 8, 0, 1, 27, 3,197, 0,115, 4,229, 0,158, 6,180, 0,217, - 2,227, 0,100, 8, 0, 1, 27, 4, 0, 0,213, 4, 0, 0,195, 6,180, 0,217, 3, 53, 0, 94, 3, 53, 0, 98, 4, 0, 1,115, - 5, 23, 0,174, 5, 23, 0,158, 2,139, 0,219, 4, 0, 1, 35, 3, 53, 0,137, 3,197, 0, 96, 4,229, 0,193, 7,193, 0,137, - 7,193, 0,137, 7,193, 0, 98, 4, 63, 0,143, 5,121, 0, 16, 5,121, 0, 16, 5,121, 0, 16, 5,121, 0, 16, 5,121, 0, 16, - 5,121, 0, 16, 7,203, 0, 8, 5,150, 0,115, 5, 14, 0,201, 5, 14, 0,201, 5, 14, 0,201, 5, 14, 0,201, 2, 92, 0,201, - 2, 92, 0,201, 2, 92, 0,201, 2, 92, 0,201, 6, 51, 0, 10, 5,252, 0,201, 6, 76, 0,115, 6, 76, 0,115, 6, 76, 0,115, - 6, 76, 0,115, 6, 76, 0,115, 6,180, 1, 25, 6, 76, 0,102, 5,219, 0,178, 5,219, 0,178, 5,219, 0,178, 5,219, 0,178, - 4,227,255,252, 4,215, 0,201, 5, 10, 0,186, 4,231, 0,123, 4,231, 0,123, 4,231, 0,123, 4,231, 0,123, 4,231, 0,123, - 4,231, 0,123, 7,219, 0,123, 4,102, 0,113, 4,236, 0,113, 4,236, 0,113, 4,236, 0,113, 4,236, 0,113, 2, 57,255,199, - 2, 57, 0,144, 2, 57,255,222, 2, 57,255,244, 4,229, 0,113, 5, 18, 0,186, 4,229, 0,113, 4,229, 0,113, 4,229, 0,113, - 4,229, 0,113, 4,229, 0,113, 6,180, 0,217, 4,229, 0, 72, 5, 18, 0,174, 5, 18, 0,174, 5, 18, 0,174, 5, 18, 0,174, - 4,188, 0, 61, 5, 20, 0,186, 4,188, 0, 61, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, - 4,231, 0,123, 5,150, 0,115, 4,102, 0,113, 5,150, 0,115, 4,102, 0,113, 5,150, 0,115, 4,102, 0,113, 5,150, 0,115, - 4,102, 0,113, 6, 41, 0,201, 5, 20, 0,113, 6, 51, 0, 10, 5, 20, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, - 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 6, 51, 0,115, - 5, 20, 0,113, 6, 51, 0,115, 5, 20, 0,113, 6, 51, 0,115, 5, 20, 0,113, 6, 51, 0,115, 5, 20, 0,113, 6, 4, 0,201, - 5, 18, 0,186, 7, 84, 0,201, 5,143, 0,120, 2, 92, 0,201, 2, 57,255,211, 2, 92, 0, 3, 2, 57,255,242, 2, 92, 0,201, - 2, 57,255,228, 2, 92, 0,176, 2, 57, 0,150, 2, 92, 0,201, 2, 57, 0,193, 4,184, 0,201, 4,114, 0,193, 2, 92,255,150, - 2, 57,255,219, 5, 63, 0,201, 4,162, 0,186, 4,162, 0,186, 4,117, 0,201, 2, 88, 0,193, 4,117, 0,201, 2, 57, 0,136, - 4,117, 0,201, 3, 0, 0,193, 4,117, 0,201, 2,188, 0,193, 4,127,255,242, 2, 70, 0, 2, 5,252, 0,201, 5, 18, 0,186, - 5,252, 0,201, 5, 18, 0,186, 5,252, 0,201, 5, 18, 0,186, 6,130, 0,205, 5,252, 0,213, 5, 18, 0,186, 6, 76, 0,115, - 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 8,143, 0,115, 8, 47, 0,113, 5,143, 0,201, - 3, 74, 0,186, 5,143, 0,201, 3, 74, 0,130, 5,143, 0,201, 3, 74, 0,186, 5, 20, 0,135, 4, 43, 0,111, 5, 20, 0,135, - 4, 43, 0,111, 5, 20, 0,135, 4, 43, 0,111, 5, 20, 0,135, 4, 43, 0,111, 4,227,255,250, 3, 35, 0, 55, 4,227,255,250, - 3, 35, 0, 55, 4,227,255,250, 3, 35, 0, 55, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, - 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 7,233, 0, 68, - 6,139, 0, 86, 4,227,255,252, 4,188, 0, 61, 4,227,255,252, 5,123, 0, 92, 4, 51, 0, 88, 5,123, 0, 92, 4, 51, 0, 88, - 5,123, 0, 92, 4, 51, 0, 88, 2,209, 0, 47, 5, 20, 0, 32, 5,225,255,151, 5,125, 0,201, 5, 20, 0,186, 5,125, 0, 0, - 5, 20, 0, 0, 5,160, 0,115, 5,150, 0,115, 4,102, 0,113, 6, 51, 0, 10, 6,141,255,151, 5,125, 0,201, 5, 20, 0,113, - 4,229, 0,113, 5, 14, 0,131, 6, 76, 0,117, 4,234, 0,164, 4,154,255,150, 2,209,255,127, 6, 51, 0,115, 5,126, 0, 8, - 7,180, 0,186, 2,212, 0,201, 2, 92, 0, 10, 5,133, 0,201, 4,162, 0,185, 2, 57, 0, 10, 4,188, 0, 61, 7,203, 0,178, - 5,252,255,150, 5, 18, 0,186, 6, 76, 0,115, 7, 78, 0,103, 4,229, 0,118, 7,151, 0,115, 6, 19, 0,113, 5, 55,255,151, - 5, 20, 0,184, 4,215, 0,201, 5, 20, 0, 69, 4, 43, 0,100, 5, 14, 0,201, 2,176,254,242, 3, 35, 0, 55, 4,227, 0, 24, - 3, 35, 0, 55, 4,227,255,250, 6,221, 0,173, 5, 18, 0,176, 6, 29, 0, 78, 5,196, 0,201, 5,145,255,252, 6,112, 0, 61, - 5,123, 0, 92, 4, 51, 0, 88, 5, 84, 0,160, 5, 84, 0, 92, 4,159, 0,104, 4, 51, 0,113, 5, 23, 0,150, 5, 84, 0, 93, - 4,159, 0,104, 4, 21, 0, 88, 5, 20, 0,186, 2, 92, 0,201, 3,240, 0,201, 3,172, 0, 20, 2, 93, 0,201, 11, 96, 0,201, - 10,100, 0,201, 9, 60, 0,113, 6,175, 0,201, 6, 75, 0,201, 3,167, 0,193, 7,115, 0,201, 7,100, 0,201, 6, 97, 0,186, - 5,121, 0, 16, 4,231, 0,123, 2, 92, 0,201, 2, 57,255,224, 6, 76, 0,115, 4,229, 0,113, 5,219, 0,178, 5, 18, 0,174, - 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, - 4,236, 0, 0, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 7,203, 0, 8, 7,219, 0,123, 6, 51, 0,115, - 5, 20, 0,113, 6, 51, 0,115, 5, 20, 0,113, 5, 63, 0,201, 4,162, 0,186, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, - 4,229, 0,113, 5, 84, 0,160, 4,159, 0,220, 2, 57,255,219, 11, 96, 0,201, 10,100, 0,201, 9, 60, 0,113, 6, 51, 0,115, - 5, 20, 0,113, 8,231, 0,201, 5,117, 0,201, 5,252, 0,201, 5, 18, 0,186, 5,121, 0, 16, 4,231, 0,123, 7,203, 0, 8, - 7,219, 0,123, 6, 76, 0,102, 4,229, 0, 72, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5, 14, 0,201, - 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 2, 92, 0,201, 2, 57,255,195, 2, 92, 0,201, 2, 57,255,228, 6, 76, 0,115, - 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 5,143, 0,201, 3, 74, 0,130, 5,143, 0,201, 3, 74, 0,186, 5,219, 0,178, - 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5, 20, 0,135, 4, 43, 0,111, 4,227,255,250, 3, 35, 0, 55, 5, 4, 0,156, - 4, 44, 0, 71, 6, 4, 0,201, 5, 18, 0,186, 5,226, 0,201, 6,180, 0,113, 5,150, 0,113, 4,226, 0,113, 5,123, 0, 92, - 4, 51, 0, 88, 5,121, 0, 16, 4,231, 0,123, 5, 14, 0,201, 4,236, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, - 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 4,227,255,252, 4,188, 0, 61, 3,204, 0,138, - 6,190, 0,186, 3,209, 0, 55, 2, 57,255,219, 7,252, 0,113, 7,252, 0,113, 5,121,255,253, 5,150, 0, 11, 4,102, 0, 9, - 4,117, 0, 10, 4,227,255,178, 4, 43, 0,111, 4, 51, 0, 88, 4,211, 0, 80, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, - 8, 0, 0, 0, 8, 0, 0, 0, 3, 60, 0,117, 3, 49, 0,117, 1,102,255,233, 2, 18, 0,117, 2, 93, 0, 71, 2, 94, 0, 71, - 3, 8, 0, 32, 4, 31, 0, 54, 2,251, 0, 38, 2, 51, 0,197, 3,174, 0,197, 2,139, 0,174, 2,139, 0,178, 2,139, 0,196, - 2,117, 0,117, 2,117, 0,117, 2,245, 0,117, 2,245, 0,117, 4, 0, 1, 11, 4, 0, 1, 11, 4, 0, 0,193, 4, 0, 0,193, - 4, 0, 0,193, 4, 0, 0,193, 2, 51, 0,214, 4, 0, 0,213, 4, 0, 1,115, 4, 0, 0,170, 2, 51, 0,214, 4, 0, 0,213, - 4, 0, 0,170, 4, 0, 1,115, 2,178, 0,111, 2,178, 0,111, 2,117, 0,117, 2,117, 0,117, 4, 0, 1, 31, 4, 0, 1, 31, - 3, 77, 0,193, 4, 0, 1, 31, 4, 0, 0,199, 4, 0, 1,154, 4, 0, 0,238, 4, 0, 1, 76, 4, 0, 0,182, 4, 0, 0,240, - 2,134,255,255, 4, 0, 0,239, 3,104, 0,117, 1, 84, 0,121, 2,252, 0,117, 3,141, 0,117, 2,245, 0,117, 3,242, 0,214, - 3,242, 0,214, 3,242, 0,214, 3,242, 0,214, 3,242, 0,214, 4, 0, 0,193, 4, 0, 0,213, 4, 0, 1, 21, 4, 0, 0,238, - 4, 0, 0,182, 0, 0,252,168, 0, 0,253,113, 0, 0,252,191, 0, 0,252,180, 0, 0,252,217, 0, 0,251,236, 0, 0,252,191, - 0, 0,253,164, 0, 0,252,213, 0, 0,253, 55, 0, 0,252,236, 0, 0,252,244, 0, 0,252,197, 0, 0,253,188, 0, 0,252,240, - 0, 0,252, 93, 0, 0,252,191, 0, 0,252,191, 0, 0,254, 31, 0, 0,253,144, 0, 0,253,144, 0, 0,255,121, 0, 0,252,168, - 0, 0,253,113, 0, 0,253, 12, 0, 0,253,188, 0, 0,254, 85, 0, 0,254,240, 0, 0,253,129, 0, 0,253, 11, 0, 0,253, 11, - 0, 0,253, 11, 0, 0,253, 11, 0, 0,253,122, 0, 0,253,119, 0, 0,253,154, 0, 0,252,213, 0, 0,252,236, 0, 0,253,106, - 0, 0,253, 35, 0, 0,253, 76, 0, 0,253,188, 0, 0,252,240, 0, 0,252, 99, 0, 0,252,197, 0, 0,252,191, 0, 0,252,191, - 0, 0,252,191, 0, 0,252,180, 0, 0,252,217, 0, 0,251,236, 0, 0,251,236, 0, 0,251,140, 0, 0,253,120, 0, 0,250,237, - 0, 0,251,104, 0, 0,250, 18, 0, 0,253,249, 0, 0,252,241, 0, 0,252,240, 0, 0,252, 99, 0, 0,253, 43, 0, 0,254, 6, - 0, 0,251,236, 0, 0,252,168, 0, 0,253,113, 0, 0,252,180, 0, 0,253,133, 0, 0,252,231, 0, 0,253,198, 0, 0,252,213, - 0, 0,253, 31, 0, 0,253, 21, 0, 0,253, 31, 0, 0,252,182, 0, 0,253, 72, 0, 0, 0, 0, 0, 0,252, 99, 0, 0,253, 51, - 0, 0,253,120, 0, 0,252,191, 0, 0,253, 43, 0, 0,253,120, 0, 0,255, 46, 0, 0,252,112, 0, 0,252,112, 0, 0,253, 42, - 0, 0,252,112, 0, 0,252,119, 2, 58, 0,160, 2, 58, 0,160, 4, 0, 1,182, 2,178, 0,158, 4, 0, 1,115, 4, 0, 0,215, - 5,138, 0, 16, 2,139, 0,219, 5,248,255,231, 6,248,255,243, 3, 68,255,237, 6,128,255,242, 6,153,255,225, 6,155,255,219, - 2,181, 0, 5, 5,121, 0, 16, 5,125, 0,201, 4,117, 0,201, 5,121, 0, 16, 5, 14, 0,201, 5,123, 0, 92, 6, 4, 0,201, - 6, 76, 0,115, 2, 92, 0,201, 5, 63, 0,201, 5,121, 0, 16, 6,231, 0,201, 5,252, 0,201, 5, 14, 0,201, 6, 76, 0,115, - 6, 4, 0,201, 4,211, 0,201, 5, 14, 0,201, 4,227,255,250, 4,227,255,252, 6, 76, 0,115, 5,123, 0, 61, 6, 76, 0,115, - 6, 29, 0, 78, 2, 92, 0,201, 4,227,255,252, 5, 70, 0,113, 4, 99, 0,133, 5, 60, 0,186, 2,181, 0,166, 4,161, 0,149, - 5, 70, 0,113, 5, 27, 0,191, 4,188, 0, 32, 4,229, 0,113, 4, 83, 0,133, 4, 90, 0,107, 5, 18, 0,186, 4,229, 0,113, - 2,181, 0,166, 4,183, 0,191, 4,188, 0, 61, 5, 23, 0,174, 4,120, 0, 74, 4,118, 0,107, 4,229, 0,113, 4,209, 0, 74, - 5, 20, 0,186, 4,178, 0,113, 5, 18, 0,113, 4,209, 0,100, 4,161, 0,149, 5, 71, 0,111, 4,159, 0, 59, 5, 71, 0,112, - 6,179, 0,135, 2,181, 0, 5, 4,161, 0,149, 4,229, 0,113, 4,161, 0,149, 6,179, 0,135, 4,234, 0,166, 4,244, 0,112, - 5,151, 0, 87, 6,189,255,225, 5,151, 0, 87, 5, 71, 0,112, 6,179, 0, 65, 5, 79, 0,111, 6, 76, 0,115, 4,229, 0,113, - 5, 48, 0,139, 4,178, 0,113, 4,154, 0,201, 3,171,255, 64, 5, 71, 0,179, 5, 71, 0,191, 6,236, 0,114, 5, 5, 0,119, - 7,120, 0,115, 6,179, 0,135, 6, 17, 0,115, 5, 70, 0,113, 6, 85, 0,201, 4,235, 0, 45, 5,126, 0, 79, 4,219, 0,100, - 6, 36, 0,115, 5, 0, 0, 54, 5,152, 0,115, 4,229, 0,113, 4,227, 0, 44, 4, 74, 0, 55, 5, 79, 0,111, 5, 20, 0,183, - 4,102, 0,113, 2, 57,255,219, 6, 76, 0,115, 4,236, 0,113, 4,236, 0,196, 4,215, 0,201, 5, 20, 0,186, 5,150, 0,115, - 6,231, 0,201, 5, 53, 0,127, 5, 20, 0, 85, 5,160, 0,115, 5,150, 0,115, 5,160, 0,115, 5, 14, 0,201, 5, 14, 0,201, - 6, 74,255,250, 4,117, 0,201, 5,150, 0,115, 5, 20, 0,135, 2, 92, 0,201, 2, 92, 0,201, 2, 92,255,150, 8,192, 0, 54, - 8, 92, 0,201, 6, 74,255,250, 5, 63, 0,201, 5,252, 0,201, 4,224, 0, 35, 6, 4, 0,201, 5,121, 0, 16, 5,125, 0,201, - 5,125, 0,201, 4,117, 0,201, 6, 54, 0, 49, 5, 14, 0,201, 6,232, 0, 59, 5, 23, 0,156, 5,252, 0,201, 5,252, 0,201, - 5, 63, 0,201, 6, 4, 0, 54, 6,231, 0,201, 6, 4, 0,201, 6, 76, 0,115, 6, 4, 0,201, 4,211, 0,201, 5,150, 0,115, - 4,227,255,250, 4,224, 0, 35, 6, 76, 0,115, 5,123, 0, 61, 6, 54, 0,201, 5,124, 0,175, 8, 6, 0,201, 8, 52, 0,201, - 6,169, 0, 50, 7, 15, 0,201, 5,125, 0,201, 5,150, 0,111, 8, 63, 0,211, 5,143, 0, 59, 4,231, 0,123, 4,229, 0,113, - 4,176, 0,186, 3,238, 0,186, 5, 96, 0, 50, 4,236, 0,113, 5,222, 0, 50, 4, 83, 0,133, 5, 65, 0,193, 5, 65, 0,193, - 4,213, 0,191, 5, 29, 0, 46, 6, 9, 0,193, 5, 73, 0,193, 4,229, 0,113, 5, 71, 0,193, 5, 20, 0,186, 4,102, 0,113, - 4, 59, 0, 5, 4,188, 0, 61, 7, 85, 0,113, 4,188, 0, 59, 5,114, 0,193, 4,186, 0,150, 6,251, 0,193, 7, 36, 0,193, - 5,160, 0, 42, 6, 31, 0,193, 4,183, 0,193, 4,100, 0,113, 6,128, 0,193, 4,208, 0, 50, 4,236, 0,113, 4,236, 0,113, - 5, 39, 0, 40, 3,238, 0,186, 4,100, 0,113, 4, 43, 0,111, 2, 57, 0,193, 2, 57,255,244, 2, 57,255,219, 7, 48, 0, 46, - 7, 34, 0,193, 5, 25, 0, 40, 4,213, 0,191, 5, 65, 0,193, 4,188, 0, 61, 5, 76, 0,193, 7,120, 0,115, 6,179, 0,135, - 5,125, 0, 33, 4,183, 0, 58, 7,138, 0,211, 5,254, 0,193, 7, 9, 0, 16, 6, 68, 0, 51, 9, 71, 0,201, 8, 3, 0,193, - 6, 76, 0,115, 4,229, 0,107, 8, 55, 0,201, 6,152, 0,193, 5, 23, 0,115, 4, 83, 0, 91, 6, 76, 0,115, 5, 71, 0,112, - 6, 76, 0,115, 4,229, 0,113, 6, 64, 0, 16, 5, 82, 0, 50, 6, 64, 0, 16, 5, 82, 0, 50, 5,150, 0,113, 4,226, 0,113, - 7,160, 0,115, 6, 17, 0,113, 7,120, 0,115, 6,179, 0,135, 7,120, 0,115, 6,179, 0,135, 5,150, 0,115, 4,102, 0,113, - 4,192, 0, 50, 0, 0,251,218, 0, 0,251,247, 0, 0,252, 34, 0, 0,252, 34, 3, 88,247,214, 3, 88,248, 88, 6, 46, 0,201, - 5,106, 0,193, 5,125, 0, 33, 4,183, 0, 38, 4,211, 0,201, 5, 20, 0,186, 4,117, 0,201, 3,238, 0,186, 4,117, 0, 71, - 3,238, 0, 56, 4,254, 0,201, 4, 61, 0,186, 6,232, 0, 59, 5,222, 0, 50, 5, 23, 0,156, 4, 83, 0,133, 5, 63, 0,201, - 4,213, 0,191, 5, 63, 0,201, 4,213, 0,191, 5, 63, 0, 33, 4,162, 0, 61, 6,107, 0, 50, 5,191, 0, 42, 6, 4, 0,201, - 5, 73, 0,193, 8, 29, 0,201, 7, 4, 0,193, 8,166, 0,201, 7, 83, 0,193, 6, 94, 0,115, 5, 54, 0,113, 5,150, 0,115, - 4,102, 0,113, 4,227,255,250, 4, 59, 0, 5, 4,227,255,252, 4,188, 0, 61, 4,227,255,252, 4,188, 0, 61, 5,123, 0, 61, - 4,188, 0, 59, 7,121,255,250, 6,116, 0, 5, 5,124, 0,175, 4,186, 0,150, 5,124, 0,175, 4,186, 0,150, 5,124, 0,175, - 5, 18, 0,186, 7,135, 0, 20, 5,211, 0, 15, 7,135, 0, 20, 5,211, 0, 15, 2, 57, 0,193, 6,232, 0, 59, 5,222, 0, 50, - 5, 63, 0,201, 4,213, 0,191, 6, 53, 0, 54, 5, 93, 0, 46, 6, 4, 0,201, 5, 73, 0,193, 6, 54, 0,201, 5,114, 0,193, - 5,124, 0,175, 4,186, 0,150, 7, 26, 0,201, 6, 50, 0,193, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, - 7,203, 0, 8, 7,219, 0,123, 5, 14, 0,201, 4,236, 0,113, 6, 76, 0,117, 4,236, 0, 0, 6, 76, 0,117, 4,236, 1, 43, - 6,232, 0, 59, 5,222, 0, 50, 5, 23, 0,156, 4, 83, 0,133, 5, 84, 0,160, 4,159, 0, 0, 5,252, 0,201, 5, 65, 0,193, - 5,252, 0,201, 5, 65, 0,193, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0, 0, 6, 76, 0,115, 4,229, 1, 74, - 5,150, 0,111, 4,100, 0,113, 4,224, 0, 35, 4,188, 0, 61, 4,224, 0, 35, 4,188, 0, 61, 4,224, 0, 35, 4,188, 0, 61, - 5,124, 0,175, 4,186, 0,150, 4,117, 0,201, 3,238, 0,186, 7, 15, 0,201, 6, 31, 0,193, 5,125, 0,145, 4,183, 0,113, - 8, 12, 0,145, 7, 45, 0,113, 7,204, 0,201, 6,244, 0,171, 5,110, 0,201, 4,181, 0,171, 8,147, 0, 54, 7,168, 0, 46, - 8,148, 0,201, 7,189, 0,193, 6, 51, 0,115, 5, 71, 0, 0, 6, 47,255,250, 5,176, 0, 5, 6,239, 0,178, 5,219, 0,178, - 7, 15, 0,178, 7, 15, 0,178, 5,219, 0,178, 5, 38, 0,155, 5,219, 0,178, 5,219, 0,178, 6,206, 0,178, 7, 15, 0,178, - 5,219, 0,178, 5, 8, 0,178, 6,151, 0,178, 7,228, 0, 65, 5,219, 0,178, 5,168, 0,178, 5, 38, 0,143, 7, 15, 0,178, - 6, 55, 0, 92, 7, 15, 0,178, 5,219, 0,140, 6,185, 0, 92, 5,219, 0,178, 5,219, 0,178, 5,219, 0,178, 6, 83, 0,178, - 5, 38, 0,155, 7, 15, 0,178, 5,219, 0,178, 7, 15, 0,178, 5, 20, 0,135, 5,219, 0,178, 5,219, 0,140, 6,101, 0,178, - 6, 76, 0,115, 6, 82, 0, 92, 6, 76, 0,115, 5, 20, 0,135, 2,117, 0,117, 2,139, 0,178, 4, 0, 0, 94, 4, 0, 0,120, - 3, 34, 0,158, 4, 54, 0, 94, 4, 0, 0, 90, 7,203, 0,186, 5, 18, 0,186, 5,147, 0,113, 5,157, 0,186, 5, 18, 0,174, - 5,147, 0,113, 4, 68, 0,174, 5, 18, 0,186, 5,154, 0,186, 5,147, 0,113, 5, 18, 0,186, 3, 59, 0,193, 7,189, 0,186, - 5, 32, 0,113, 5, 18, 0,174, 5, 18, 0,186, 5, 20, 0,113, 5,157, 0,186, 5, 18, 0,174, 5, 70, 0,174, 2, 57,255,219, - 6, 20, 0, 49, 4, 32, 0,159, 5, 18, 0,186, 3,159, 0, 70, 7,203, 0, 0, 4, 32, 0,159, 5, 18, 0,186, 5, 18, 0,174, - 5,145, 0,174, 7,202, 0,174, 5, 18, 0,186, 5, 20, 0,113, 3, 59, 0,193, 7,202, 0,174, 5, 47, 0, 0, 4,229, 0,113, - 5, 8, 0,122, 6, 26, 0,174, 2,178, 0,240, 3,119, 0, 96, 2,149, 0,219, 5,121, 0, 16, 4,231, 0,123, 5,125, 0,201, - 5, 20, 0,186, 5,125, 0,201, 5, 20, 0,186, 5,125, 0,201, 5, 20, 0,186, 5,150, 0,115, 4,102, 0,113, 6, 41, 0,201, - 5, 20, 0,113, 6, 41, 0,201, 5, 20, 0,113, 6, 41, 0,201, 5, 20, 0,113, 6, 41, 0,201, 5, 20, 0,113, 6, 41, 0,201, - 5, 20, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, - 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 4,154, 0,201, 2,209, 0, 47, 6, 51, 0,115, 5, 20, 0,113, 6, 4, 0,201, - 5, 18, 0,186, 6, 4, 0,201, 5, 18, 0,186, 6, 4, 0,201, 5, 18,255,235, 6, 4, 0, 17, 5, 18, 0, 2, 6, 4, 0,201, - 5, 18, 0,186, 2, 92, 0, 0, 2, 57, 0, 39, 2, 92, 0,201, 2, 57, 0,193, 5, 63, 0,201, 4,162, 0,186, 5, 63, 0,201, - 4,162, 0,186, 5, 63, 0,201, 4,162, 0,186, 4,117, 0,201, 2, 57, 0,182, 4,117, 0, 3, 2, 57,255,242, 4,117, 0,201, - 2, 57, 0, 39, 4,117, 0,201, 2, 57,255,222, 6,231, 0,201, 7,203, 0,186, 6,231, 0,201, 7,203, 0,186, 6,231, 0,201, - 7,203, 0,186, 5,252, 0,201, 5, 18, 0,186, 5,252, 0,201, 5, 18, 0,186, 5,252, 0,201, 5, 18, 0,186, 5,252, 0,201, - 5, 18, 0,186, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, - 4,229, 0,113, 4,211, 0,201, 5, 20, 0,186, 4,211, 0,201, 5, 20, 0,186, 5,143, 0,201, 3, 74, 0,186, 5,143, 0,201, - 3, 74, 0,186, 5,143, 0,201, 3, 74, 0,186, 5,143, 0,201, 3, 74, 0, 84, 5, 20, 0,135, 4, 43, 0,111, 5, 20, 0,135, - 4, 43, 0,111, 5, 20, 0,135, 4, 43, 0,111, 5, 20, 0,135, 4, 43, 0,111, 5, 20, 0,135, 4, 43, 0,111, 4,227,255,250, - 3, 35, 0, 55, 4,227,255,250, 3, 35, 0, 55, 4,227,255,250, 3, 35, 0, 55, 4,227,255,250, 3, 35, 0, 55, 5,219, 0,178, - 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, - 5, 18, 0,174, 5,121, 0, 16, 4,188, 0, 61, 5,121, 0, 16, 4,188, 0, 61, 7,233, 0, 68, 6,139, 0, 86, 7,233, 0, 68, - 6,139, 0, 86, 7,233, 0, 68, 6,139, 0, 86, 7,233, 0, 68, 6,139, 0, 86, 7,233, 0, 68, 6,139, 0, 86, 5,123, 0, 61, - 4,188, 0, 59, 5,123, 0, 61, 4,188, 0, 59, 4,227,255,252, 4,188, 0, 61, 5,123, 0, 92, 4, 51, 0, 88, 5,123, 0, 92, - 4, 51, 0, 88, 5,123, 0, 92, 4, 51, 0, 88, 5, 18, 0,186, 3, 35, 0, 4, 6,139, 0, 86, 4,188, 0, 61, 4,231, 0,123, - 2,209, 0, 47, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, - 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, - 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, 4,231, 0,123, 5,121, 0, 16, - 4,231, 0,123, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, - 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, 4,236, 0,113, 5, 14, 0,201, - 4,236, 0,113, 2, 92, 0, 90, 2, 57, 0, 68, 2, 92, 0,200, 2, 57, 0,183, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, - 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 6, 76, 0,115, - 4,229, 0,113, 6, 76, 0,115, 4,229, 0,113, 7, 78, 0,103, 4,229, 0,118, 7, 78, 0,103, 4,229, 0,118, 7, 78, 0,103, - 4,229, 0,118, 7, 78, 0,103, 4,229, 0,118, 7, 78, 0,103, 4,229, 0,118, 5,219, 0,178, 5, 18, 0,174, 5,219, 0,178, - 5, 18, 0,174, 6,221, 0,173, 5, 18, 0,176, 6,221, 0,173, 5, 18, 0,176, 6,221, 0,173, 5, 18, 0,176, 6,221, 0,173, - 5, 18, 0,176, 6,221, 0,173, 5, 18, 0,176, 4,227,255,252, 4,188, 0, 61, 4,227,255,252, 4,188, 0, 61, 4,227,255,252, - 4,188, 0, 61, 4,227,255,252, 4,188, 0, 61, 4, 0, 1,134, 4, 0, 1,115, 4, 0, 1,134, 4, 0, 0, 0, 8, 0, 0, 0, - 4, 0, 0, 0, 8, 0, 0, 0, 2,163, 0, 0, 2, 0, 0, 0, 1, 86, 0, 0, 5, 23, 0, 0, 2,139, 0, 0, 1,153, 0, 0, - 0,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,227, 0,100, 2,227, 0,100, - 4, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 4, 0, 1, 4, 4, 0,255,236, 2,139, 0,174, 2,139, 0,178, - 2,139, 0,174, 2,139, 0,178, 4, 37, 0,174, 4, 37, 0,174, 4, 37, 0,174, 4, 37, 0,174, 4, 0, 0, 57, 4, 0, 0, 57, - 4,184, 1, 51, 4,184, 1, 51, 2,173, 0,236, 5, 87, 0,236, 8, 0, 0,236, 2,139, 0,220, 10,188, 0,113, 13,226, 0,113, - 1,209, 0, 40, 2,253, 0, 40, 4, 41, 0, 40, 1,209, 0, 40, 2,253, 0, 40, 4, 41, 0, 40, 2,182, 0, 11, 3, 51, 0,158, - 3, 51, 0,193, 6,180, 0,195, 3,226, 0,147, 4, 63, 0,147, 4, 0,255,236, 6,110,255,167, 6,110,255,167, 2, 0,255,170, - 8, 0, 0, 61, 4, 0, 0,221, 1, 86,254,137, 3, 31, 0,176, 3, 31, 0,176, 7, 96, 0, 73, 5,221, 0,147, 5,221, 0,147, - 3,240, 0,111, 5, 23, 0,236, 4, 0, 0,216, 4, 0, 0,216, 4, 0, 0, 61, 2,178, 1, 29, 6,110,255,167, 4, 0, 0, 61, - 3,153, 0,145, 6,180, 0,217, 6,110,255,167, 6,180, 1, 56, 4,176, 0,250, 5, 78, 0, 40, 6,180, 1,102, 6,180, 1,102, - 2,139, 0,219, 6, 97, 0,100, 6,180, 0,112, 2,139, 0,219, 2,139, 0,219, 3, 53, 0, 87, 1,110, 0,121, 3, 53, 0, 63, - 3, 53, 0,102, 3, 53, 0, 92, 3, 53, 0,108, 3, 53, 0, 89, 3, 53, 0, 83, 4, 57, 0,137, 4, 57, 0,137, 4, 57, 0,137, - 1,247, 0,111, 1,247, 0,103, 3, 49, 0,117, 3, 53, 0, 87, 3, 53, 0,137, 3, 53, 0, 94, 3, 53, 0, 98, 3, 53, 0, 63, - 3, 53, 0,102, 3, 53, 0, 92, 3, 53, 0,108, 3, 53, 0, 89, 3, 53, 0, 83, 4, 57, 0,137, 4, 57, 0,137, 4, 57, 0,137, - 1,247, 0,111, 1,247, 0,103, 7, 4, 0, 86, 5, 23, 0,115, 5, 23, 0, 96, 5, 23, 0,133, 5, 23, 0,129, 7,203, 0,186, - 5,252, 0,117, 10, 46, 0,201, 8,151, 0,201, 7,233, 0, 59, 6, 70, 0, 95, 5, 23, 0,129, 5, 23, 0, 0, 5, 23, 0, 40, - 5, 23, 0, 20, 8,117, 0, 27, 5, 23, 0, 68, 6, 49, 0,117, 5, 33, 0,170, 0, 0,252, 61, 0, 0,252, 61, 8, 38, 0, 67, - 8,252, 0,195, 5, 35,255,214, 8, 38, 0, 60, 8,137, 0, 60, 7,157, 0,195, 5, 18, 0, 72, 5, 18, 0, 34, 5,148, 0,106, - 3, 78,255,228, 9, 81, 0,201, 8, 0, 1, 27, 5,148, 0,110, 6,131, 0, 83, 6, 87, 0,118, 7, 44, 0,169, 8, 40, 1, 3, - 8,152,255,252, 8, 0, 1, 39, 6, 29, 0, 78, 6, 29, 0, 78, 5, 63, 0,201, 5,121, 0, 16, 6,214, 0,125, 4,154, 0,201, - 3,178, 0,104, 5,246, 0,103, 9,141, 0,151, 6, 61, 0, 59, 7,193, 0,137, 7,193, 0, 94, 7,193, 0,137, 7,193, 0, 94, - 7,193, 0, 98, 7,193, 0, 63, 7,193, 0,137, 7,193, 0,102, 7,193, 0,137, 7,193, 0, 98, 7,193, 0,102, 7,193, 0,108, - 4,139, 0,137, 2, 92, 0,201, 3,240, 0,201, 5,132, 0,201, 7, 98, 0,201, 5,121, 0, 16, 7, 97, 0, 16, 8,245, 0, 16, - 10,137, 0, 16, 7, 87, 0,201, 5,123, 0, 61, 7,119, 0, 61, 9, 13, 0, 61, 4,117, 0,201, 5,150, 0,115, 6, 41, 0,201, - 6,231, 0,201, 2, 57, 0,193, 3,169, 0,193, 5, 25, 0,193, 6,126, 0,193, 4,188, 0, 61, 6,125, 0, 61, 7,237, 0, 61, - 9, 93, 0, 61, 6,141, 0,193, 4,188, 0, 59, 6,148, 0, 59, 8, 4, 0, 59, 2, 57, 0,193, 4,102, 0,113, 5, 20, 0,113, - 7,203, 0,186, 9,246, 0,121, 6, 41, 0,201, 9,246, 0,121, 5,160, 0,115, 6,180, 0,100, 6,180, 1,163, 6,180, 0,117, - 6,180, 1,163, 6,180, 0,100, 6,180, 1,163, 6,180, 1, 32, 6,180, 1, 32, 6,180, 1, 32, 6,180, 1, 32, 6,180, 0,100, - 6,180, 0,217, 6,180, 0,217, 6,180, 0,217, 1, 86,254,137, 5, 24, 1,138, 5, 2, 0,190, 5, 2, 1, 68, 2,139, 0,219, - 5, 25, 0, 61, 5, 25, 0, 61, 5, 25, 0, 61, 5,106, 0,221, 6,170, 0,221, 8, 0, 0,247, 6,180, 0,217, 8, 0, 0,172, - 3, 31, 0,183, 3, 31, 0,164, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, - 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,152, 7, 44, 0,170, 5, 30, 0,170, 5,220, 0, 0, 5,131, 0, 47, - 5, 10, 0, 47, 5, 10, 0, 47, 7,188, 0, 47, 7,188, 0, 47, 5,125, 0, 47, 6,227, 0,111, 9,157, 0,170, 9,157, 0,174, - 9,145, 0,174, 9,125, 0,174, 12, 60, 0,174, 8, 52, 0, 30, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 28, - 0, 1, 0, 0, 0, 0, 2,132, 0, 3, 0, 1, 0, 0, 0, 28, 0, 4, 2,104, 0, 0, 0,150, 0,128, 0, 6, 0, 22, 0, 0, - 0,126, 2, 65, 2, 89, 2, 98, 2,112, 2,117, 2,146, 2,233, 2,238, 2,243, 2,247, 3, 78, 3, 83, 3, 88, 3, 93, 3, 98, - 3,117, 3,122, 3,126, 3,138, 3,140, 3,161, 3,206, 4,134, 4,206, 4,249, 5, 15, 5, 86, 5, 95, 5,135, 5,138, 6, 12, - 30,155, 30,249, 31,191, 31,254, 32, 39, 32, 94, 32,113, 32,142, 32,175, 32,177, 32,181, 32,215, 33, 0, 33, 6, 33, 9, 33, 15, - 33, 17, 33, 19, 33, 24, 33, 30, 33, 34, 33, 39, 33, 43, 33, 46, 33, 50, 33, 53, 33, 59, 33, 75, 33,131, 33,153, 33,181, 34, 30, - 35, 25, 35, 37, 35, 42, 36,105, 38,177, 40, 0,251, 6,251, 23,255,253,255,255, 0, 0, 0, 0, 0, 32, 0,160, 2, 89, 2, 98, - 2,112, 2,117, 2,146, 2,176, 2,236, 2,243, 2,247, 3, 0, 3, 81, 3, 87, 3, 92, 3, 96, 3,116, 3,122, 3,126, 3,132, - 3,140, 3,142, 3,163, 3,208, 4,136, 4,208, 5, 0, 5, 49, 5, 89, 5, 97, 5,137, 6, 12, 30, 0, 30,160, 31,191, 31,253, - 32, 0, 32, 48, 32,112, 32,116, 32,160, 32,177, 32,180, 32,214, 33, 0, 33, 3, 33, 9, 33, 14, 33, 17, 33, 19, 33, 22, 33, 28, - 33, 32, 33, 38, 33, 42, 33, 46, 33, 50, 33, 52, 33, 59, 33, 75, 33, 83, 33,144, 33,181, 34, 18, 35, 24, 35, 37, 35, 41, 36, 96, - 38,176, 40, 0,251, 0,251, 19,255,253,255,255, 0, 0,255,227,255,194,255,171,255,163,255,150,255,146,255,118,255, 89,255, 87, -255, 83,255, 80,255, 72,255, 70,255, 67,255, 64,255, 62,255, 45,255, 41,255, 38,255, 33,255, 32,255, 31,255, 30,255, 29,255, 28, -255, 27,255, 21,254,244,254,242,254,241,254,240,254,111,230,124,230,120,229,179,229,118,229,117,229,109,229, 92,229, 90,229, 73, -229, 72,229, 70,229, 38,228,254,228,252,228,250,228,246,228,245,228,244,228,242,228,239,228,238,228,235,228,233,228,231,228,228, -228,227,228,222,228,207,228,200,228,188,228,161,228, 69,227, 76,227, 65,227, 62,226, 9,223,195,222,117, 11,118, 11,106, 6,133, - 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 0,134,135, -137,139,147,152,158,163,162,164,166,165,167,169,171,170,172,173,175,174,176,177,179,181,180,182,184,183,188,187,189,190, 0,114, -100,101,105, 0,120,161,112,107, 0,118,106, 0,136,154, 0,115, 0, 0,103,119, 0, 0, 0, 0, 0,108,124, 0,168,186,129, 99, -110, 0, 0, 0, 0,109,125, 0, 98,130,133,151, 0, 0, 0, 0, 0, 0, 0, 0,185, 0,193, 0, 0, 0, 0, 0, 0, 0, 0,121, - 0, 0, 0,132,140,131,141,138,143,144,145,142,149,150, 0,148,156,157,155, 0, 0, 0,113, 0, 0, 0,122, 0, 0, 0, 0, 0, -183, 7, 6, 5, 4, 3, 2, 1, 0, 44, 32, 16,176, 2, 37, 73,100,176, 64, 81, 88, 32,200, 89, 33, 45, 44,176, 2, 37, 73,100, -176, 64, 81, 88, 32,200, 89, 33, 45, 44, 32, 16, 7, 32,176, 0, 80,176, 13,121, 32,184,255,255, 80, 88, 4, 27, 5, 89,176, 5, - 28,176, 3, 37, 8,176, 4, 37, 35,225, 32,176, 0, 80,176, 13,121, 32,184,255,255, 80, 88, 4, 27, 5, 89,176, 5, 28,176, 3, - 37, 8,225, 45, 44, 75, 80, 88, 32,176,253, 69, 68, 89, 33, 45, 44,176, 2, 37, 69, 96, 68, 45, 44, 75, 83, 88,176, 2, 37,176, - 2, 37, 69, 68, 89, 33, 33, 45, 44, 69, 68, 45, 44,176, 2, 37,176, 2, 37, 73,176, 5, 37,176, 5, 37, 73, 96,176, 32, 99,104, - 32,138, 16,138, 35, 58,138, 16,101, 58, 45, 0,184, 2,128, 64,255,251,254, 3,250, 20, 3,249, 37, 3,248, 50, 3,247,150, 3, -246, 14, 3,245,254, 3,244,254, 3,243, 37, 3,242, 14, 3,241,150, 3,240, 37, 3,239,138, 65, 5,239,254, 3,238,150, 3,237, -150, 3,236,250, 3,235,250, 3,234,254, 3,233, 58, 3,232, 66, 3,231,254, 3,230, 50, 3,229,228, 83, 5,229,150, 3,228,138, - 65, 5,228, 83, 3,227,226, 47, 5,227,250, 3,226, 47, 3,225,254, 3,224,254, 3,223, 50, 3,222, 20, 3,221,150, 3,220,254, - 3,219, 18, 3,218,125, 3,217,187, 3,216,254, 3,214,138, 65, 5,214,125, 3,213,212, 71, 5,213,125, 3,212, 71, 3,211,210, - 27, 5,211,254, 3,210, 27, 3,209,254, 3,208,254, 3,207,254, 3,206,254, 3,205,150, 3,204,203, 30, 5,204,254, 3,203, 30, - 3,202, 50, 3,201,254, 3,198,133, 17, 5,198, 28, 3,197, 22, 3,196,254, 3,195,254, 3,194,254, 3,193,254, 3,192,254, 3, -191,254, 3,190,254, 3,189,254, 3,188,254, 3,187,254, 3,186, 17, 3,185,134, 37, 5,185,254, 3,184,183,187, 5,184,254, 3, -183,182, 93, 5,183,187, 3,183,128, 4,182,181, 37, 5,182, 93, 64,255, 3,182, 64, 4,181, 37, 3,180,254, 3,179,150, 3,178, -254, 3,177,254, 3,176,254, 3,175,254, 3,174,100, 3,173, 14, 3,172,171, 37, 5,172,100, 3,171,170, 18, 5,171, 37, 3,170, - 18, 3,169,138, 65, 5,169,250, 3,168,254, 3,167,254, 3,166,254, 3,165, 18, 3,164,254, 3,163,162, 14, 5,163, 50, 3,162, - 14, 3,161,100, 3,160,138, 65, 5,160,150, 3,159,254, 3,158,157, 12, 5,158,254, 3,157, 12, 3,156,155, 25, 5,156,100, 3, -155,154, 16, 5,155, 25, 3,154, 16, 3,153, 10, 3,152,254, 3,151,150, 13, 5,151,254, 3,150, 13, 3,149,138, 65, 5,149,150, - 3,148,147, 14, 5,148, 40, 3,147, 14, 3,146,250, 3,145,144,187, 5,145,254, 3,144,143, 93, 5,144,187, 3,144,128, 4,143, -142, 37, 5,143, 93, 3,143, 64, 4,142, 37, 3,141,254, 3,140,139, 46, 5,140,254, 3,139, 46, 3,138,134, 37, 5,138, 65, 3, -137,136, 11, 5,137, 20, 3,136, 11, 3,135,134, 37, 5,135,100, 3,134,133, 17, 5,134, 37, 3,133, 17, 3,132,254, 3,131,130, - 17, 5,131,254, 3,130, 17, 3,129,254, 3,128,254, 3,127,254, 3, 64,255,126,125,125, 5,126,254, 3,125,125, 3,124,100, 3, -123, 84, 21, 5,123, 37, 3,122,254, 3,121,254, 3,120, 14, 3,119, 12, 3,118, 10, 3,117,254, 3,116,250, 3,115,250, 3,114, -250, 3,113,250, 3,112,254, 3,111,254, 3,110,254, 3,108, 33, 3,107,254, 3,106, 17, 66, 5,106, 83, 3,105,254, 3,104,125, - 3,103, 17, 66, 5,102,254, 3,101,254, 3,100,254, 3, 99,254, 3, 98,254, 3, 97, 58, 3, 96,250, 3, 94, 12, 3, 93,254, 3, - 91,254, 3, 90,254, 3, 89, 88, 10, 5, 89,250, 3, 88, 10, 3, 87, 22, 25, 5, 87, 50, 3, 86,254, 3, 85, 84, 21, 5, 85, 66, - 3, 84, 21, 3, 83, 1, 16, 5, 83, 24, 3, 82, 20, 3, 81, 74, 19, 5, 81,254, 3, 80, 11, 3, 79,254, 3, 78, 77, 16, 5, 78, -254, 3, 77, 16, 3, 76,254, 3, 75, 74, 19, 5, 75,254, 3, 74, 73, 16, 5, 74, 19, 3, 73, 29, 13, 5, 73, 16, 3, 72, 13, 3, - 71,254, 3, 70,150, 3, 69,150, 3, 68,254, 3, 67, 2, 45, 5, 67,250, 3, 66,187, 3, 65, 75, 3, 64,254, 3, 63,254, 3, 62, - 61, 18, 5, 62, 20, 3, 61, 60, 15, 5, 61, 18, 3, 60, 59, 13, 5, 60, 64,255, 15, 3, 59, 13, 3, 58,254, 3, 57,254, 3, 56, - 55, 20, 5, 56,250, 3, 55, 54, 16, 5, 55, 20, 3, 54, 53, 11, 5, 54, 16, 3, 53, 11, 3, 52, 30, 3, 51, 13, 3, 50, 49, 11, - 5, 50,254, 3, 49, 11, 3, 48, 47, 11, 5, 48, 13, 3, 47, 11, 3, 46, 45, 9, 5, 46, 16, 3, 45, 9, 3, 44, 50, 3, 43, 42, - 37, 5, 43,100, 3, 42, 41, 18, 5, 42, 37, 3, 41, 18, 3, 40, 39, 37, 5, 40, 65, 3, 39, 37, 3, 38, 37, 11, 5, 38, 15, 3, - 37, 11, 3, 36,254, 3, 35,254, 3, 34, 15, 3, 33, 1, 16, 5, 33, 18, 3, 32,100, 3, 31,250, 3, 30, 29, 13, 5, 30,100, 3, - 29, 13, 3, 28, 17, 66, 5, 28,254, 3, 27,250, 3, 26, 66, 3, 25, 17, 66, 5, 25,254, 3, 24,100, 3, 23, 22, 25, 5, 23,254, - 3, 22, 1, 16, 5, 22, 25, 3, 21,254, 3, 20,254, 3, 19,254, 3, 18, 17, 66, 5, 18,254, 3, 17, 2, 45, 5, 17, 66, 3, 16, -125, 3, 15,100, 3, 14,254, 3, 13, 12, 22, 5, 13,254, 3, 12, 1, 16, 5, 12, 22, 3, 11,254, 3, 10, 16, 3, 9,254, 3, 8, - 2, 45, 5, 8,254, 3, 7, 20, 3, 6,100, 3, 4, 1, 16, 5, 4,254, 3, 64, 21, 3, 2, 45, 5, 3,254, 3, 2, 1, 16, 5, - 2, 45, 3, 1, 16, 3, 0,254, 3, 1,184, 1,100,133,141, 1, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 0, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 29, 1, 53, 0,184, 0,203, 0,203, 0,193, 0,170, - 0,156, 1,166, 0,184, 0,102, 0, 0, 0,113, 0,203, 0,160, 2,178, 0,133, 0,117, 0,184, 0,195, 1,203, 1,137, 2, 45, - 0,203, 0,166, 0,240, 0,211, 0,170, 0,135, 0,203, 3,170, 4, 0, 1, 74, 0, 51, 0,203, 0, 0, 0,217, 5, 2, 0,244, - 1, 84, 0,180, 0,156, 1, 57, 1, 20, 1, 57, 7, 6, 4, 0, 4, 78, 4,180, 4, 82, 4,184, 4,231, 4,205, 0, 55, 4,115, - 4,205, 4, 96, 4,115, 1, 51, 3,162, 5, 86, 5,166, 5, 86, 5, 57, 3,197, 2, 18, 0,201, 0, 31, 0,184, 1,223, 0,115, - 0,186, 3,233, 3, 51, 3,188, 4, 68, 4, 14, 0,223, 3,205, 3,170, 0,229, 3,170, 4, 4, 0, 0, 0,203, 0,143, 0,164, - 0,123, 0,184, 0, 20, 1,111, 0,127, 2,123, 2, 82, 0,143, 0,199, 5,205, 0,154, 0,154, 0,111, 0,203, 0,205, 1,158, - 1,211, 0,240, 0,186, 1,131, 0,213, 0,152, 3, 4, 2, 72, 0,158, 1,213, 0,193, 0,203, 0,246, 0,131, 3, 84, 2,127, - 0, 0, 3, 51, 2,102, 0,211, 0,199, 0,164, 0,205, 0,143, 0,154, 0,115, 4, 0, 5,213, 1, 10, 0,254, 2, 43, 0,164, - 0,180, 0,156, 0, 0, 0, 98, 0,156, 0, 0, 0, 29, 3, 45, 5,213, 5,213, 5,213, 5,240, 0,127, 0,123, 0, 84, 0,164, - 6,184, 6, 20, 7, 35, 1,211, 0,184, 0,203, 0,166, 1,195, 1,236, 6,147, 0,160, 0,211, 3, 92, 3,113, 3,219, 1,133, - 4, 35, 4,168, 4, 72, 0,143, 1, 57, 1, 20, 1, 57, 3, 96, 0,143, 5,213, 1,154, 6, 20, 7, 35, 6,102, 1,121, 4, 96, - 4, 96, 4, 96, 4,123, 0,156, 0, 0, 2,119, 4, 96, 1,170, 0,233, 4, 96, 7, 98, 0,123, 0,197, 0,127, 2,123, 0, 0, - 0,180, 2, 82, 5,205, 0,102, 0,188, 0,102, 0,119, 6, 16, 0,205, 1, 59, 1,133, 3,137, 0,143, 0,123, 0, 0, 0, 29, - 0,205, 7, 74, 4, 47, 0,156, 0,156, 0, 0, 7,125, 0,111, 0, 0, 0,111, 3, 53, 0,106, 0,111, 0,123, 0,174, 0,178, - 0, 45, 3,150, 0,143, 2,123, 0,246, 0,131, 3, 84, 6, 55, 5,246, 0,143, 0,156, 4,225, 2,102, 0,143, 1,141, 2,246, - 0,205, 3, 68, 0, 41, 0,102, 4,238, 0,115, 0, 0, 20, 0, 0,150, 0, 0, 0, 0, 0, 34, 0, 34, 0, 34, 0, 34, 0, 84, - 0,138, 0,246, 1,162, 2, 54, 3,106, 3,148, 3,204, 3,248, 4, 70, 4,112, 4,140, 4,162, 4,182, 4,220, 5, 30, 5, 86, - 5,212, 6, 72, 6,166, 7, 6, 7,114, 7,184, 8, 34, 8,140, 8,172, 8,212, 9, 16, 9, 50, 9,110, 9,218, 10,154, 11, 20, - 11,108, 11,184, 11,248, 12, 40, 12, 82, 12,166, 12,212, 12,248, 13, 48, 13,196, 13,230, 14,100, 14,184, 14,254, 15, 62, 15,164, - 16, 46, 16,170, 16,226, 17, 36, 17,148, 18,114, 18,196, 19, 38, 19,134, 19,182, 19,220, 20, 6, 20, 40, 20, 62, 20,102, 20,252, - 21, 72, 21,148, 21,224, 22, 74, 22,150, 22,250, 23, 54, 23, 94, 23,156, 24, 20, 24, 50, 24,148, 24,208, 25, 34, 25,114, 25,194, - 25,250, 26,170, 26,232, 27, 36, 27,182, 28,200, 29,138, 30,112, 30,214, 31, 68, 31, 92, 31,210, 32, 20, 32, 20, 32, 92, 32,194, - 33, 30, 33,170, 34, 60, 34, 96, 35, 4, 35, 96, 35,242, 36, 96, 36,198, 36,226, 36,248, 37,158, 37,196, 38, 0, 38, 56, 38,136, - 38,230, 39, 14, 39,104, 39,150, 39,172, 39,220, 40, 8, 40, 76, 40,180, 40,196, 40,212, 40,228, 41, 96, 41,108, 41,120, 41,142, - 41,166, 41,190, 42, 94, 42,202, 42,214, 42,226, 42,238, 43, 0, 43, 18, 43, 30, 43, 42, 43, 60, 43, 78, 43,180, 43,204, 43,216, - 43,228, 43,250, 44, 20, 44, 44, 44,144, 45, 44, 45, 56, 45, 68, 45, 92, 45,120, 45,132, 45,200, 46, 92, 46,110, 46,128, 46,144, - 46,166, 46,194, 46,226, 47,192, 47,204, 47,216, 47,228, 47,246, 48, 8, 48, 20, 48, 32, 48, 50, 48, 68, 49, 28, 49, 40, 49, 52, - 49, 64, 49, 80, 49,102, 49,124, 49,170, 50,100, 50,112, 50,124, 50,140, 50,164, 50,176, 51, 0, 51, 24, 51, 46, 51, 66, 51, 88, - 51,104, 51,116, 51,128, 51,140, 51,152, 51,170, 51,182, 51,194, 51,206, 51,224, 51,236, 51,248, 52, 12, 52, 20, 52,114, 52,126, - 52,144, 52,162, 52,180, 52,192, 52,204, 52,216, 52,228, 52,246, 53, 12, 53, 30, 53, 48, 53, 60, 53, 72, 53, 90, 53,102, 53,114, - 53,126, 53,150, 53,184, 53,252, 54, 70, 54, 88, 54,106, 54,124, 54,142, 54,160, 54,178, 54,190, 54,202, 54,226, 55, 0, 55, 18, - 55, 36, 55, 54, 55, 72, 55, 84, 55, 96, 55,216, 55,228, 56, 0, 56, 12, 56, 30, 56, 42, 56, 60, 56, 72, 56, 98, 56,160, 56,232, - 56,250, 57, 12, 57, 24, 57, 36, 57, 60, 57, 82, 57, 94, 57,166, 57,244, 58, 10, 58, 26, 58, 48, 58, 64, 58, 76, 58, 88, 58,168, - 59, 60, 59, 72, 59, 84, 59, 96, 59,108, 59,126, 59,146, 59,158, 59,170, 59,190, 59,208, 59,220, 59,232, 59,252, 60, 14, 60, 26, - 60, 38, 60, 60, 60, 78, 60,144, 60,220, 60,242, 61, 4, 61, 28, 61, 46, 61, 68, 61, 86, 61,104, 61,122, 61,134, 61,146, 61,158, - 61,170, 61,188, 61,206, 61,224, 61,240, 62, 2, 62, 14, 62, 26, 62, 38, 62, 50, 62, 62, 62, 82, 62,126, 62,228, 63, 72, 63, 80, - 63,170, 63,240, 64, 68, 64,140, 64,202, 65, 0, 65, 8, 65, 82, 65,144, 65,192, 66, 8, 66, 54, 66,142, 66,234, 67, 42, 67,134, - 67,234, 68,116, 68,212, 69, 2, 69, 58, 69, 98, 69,230, 70, 22, 70, 58, 70,112, 70,216, 70,224, 71, 48, 71, 60, 71, 72, 71,130, - 71,184, 72, 4, 72,102, 72,164, 72,226, 73,134, 73,142, 73,196, 73,240, 74, 56, 74,134, 74,204, 74,216, 74,228, 75, 58, 75,106, - 75,142, 75,186, 75,222, 76, 2, 76, 62, 76,122, 76,180, 76,234, 77, 32, 77, 96, 77,156, 77,214, 78, 0, 78, 14, 78, 26, 78, 60, - 78, 68, 78, 80, 78, 92, 78,104, 78,116, 78,128, 78,140, 78,152, 78,164, 78,176, 78,192, 78,208, 78,228, 78,248, 79, 4, 79, 20, - 79, 36, 79, 54, 79, 66, 79, 78, 79, 90, 79,102, 79,114, 79,126, 79,138, 79,150, 79,158, 79,170, 79,182, 79,194, 79,206, 79,218, - 79,230, 80, 38, 80,118, 80,140, 80,152, 80,164, 80,198, 80,210, 80,222, 80,234, 80,246, 81, 2, 81, 14, 81, 34, 81, 46, 81, 58, - 81, 70, 81, 84, 81, 96, 81,146, 81,190, 81,202, 81,214, 81,226, 81,238, 81,250, 82, 6, 82, 18, 82, 30, 82, 42, 82, 54, 82, 66, - 82, 78, 82, 90, 82,102, 82,114, 82,126, 82,138, 82,150, 82,162, 82,174, 82,186, 82,198, 82,210, 82,222, 82,234, 82,246, 83, 2, - 83, 14, 83, 26, 83, 38, 83, 50, 83, 62, 83, 74, 83, 86, 83, 98, 83,110, 83,186, 84, 8, 84, 20, 84, 54, 84, 94, 84,176, 85, 10, - 85, 92, 85,130, 85,168, 85,180, 85,192, 85,204, 85,216, 85,228, 85,240, 85,252, 86, 8, 86, 20, 86, 32, 86, 44, 86, 56, 86, 68, - 86, 80, 86,122, 86,188, 86,240, 87, 34, 87,112, 87,190, 87,246, 88, 62, 88,128, 88,154, 88,194, 89, 22, 89, 66, 89,108, 89,108, - 89,108, 89,108, 89,108, 89,108, 89,166, 89,238, 90, 30, 90, 78, 90,116, 90,166, 90,220, 90,248, 91, 26, 91, 34, 91, 42, 91, 50, - 91, 58, 91, 76, 91,104, 91,134, 91,180, 91,228, 91,248, 92, 12, 92, 32, 92, 52, 92, 98, 92,144, 92,168, 92,176, 92,190, 92,206, - 92,230, 92,240, 93, 0, 93, 14, 93, 34, 93, 48, 93, 58, 93, 68, 93, 86, 93,104, 93,126, 93,140, 93,210, 93,234, 94, 32, 94, 80, - 94,176, 94,230, 95, 2, 95, 28, 95, 70, 95, 90, 95,166, 95,194, 95,242, 96, 12, 96, 50, 96, 82, 96,120, 96,146, 96,156, 96,168, - 96,188, 96,198, 96,244, 96,254, 97, 8, 97, 18, 97, 28, 97, 38, 97, 48, 97, 58, 97, 68, 97, 78, 97,136, 97,146, 97,156, 97,166, - 97,180, 97,194, 97,216, 97,230, 97,240, 98, 4, 98, 24, 98, 42, 98, 56, 98, 66, 98, 76, 98, 94, 98,112, 98,128, 98,186, 98,214, - 98,232, 98,250, 99, 16, 99, 30, 99, 54, 99, 78, 99, 88, 99, 98, 99,108, 99,126, 99,136, 99,146, 99,160, 99,178, 99,214, 99,224, - 99,234, 99,244, 99,254,100, 8,100, 18,100, 28,100, 38,100, 84,100, 98,100,112,100,128,100,144,100,154,100,164,100,186,100,222, -100,248,101, 40,101, 54,101, 64,101, 74,101, 84,101, 94,101,104,101,114,101,132,101,152,101,172,101,188,101,250,102, 14,102, 26, -102, 54,102, 74,102,106,102,118,102,128,102,160,102,170,102,180,102,190,102,248,103, 2,103, 22,103, 46,103, 70,103, 96,103,104, -103,144,103,168,103,180,103,188,103,202,103,216,103,230,103,242,104, 0,104, 12,104, 24,104, 32,104, 40,104, 68,104,122,104,130, -104,138,104,146,104,234,104,242,104,250,105, 44,105, 52,105, 60,105,108,105,116,105,124,105,132,105,194,105,202,105,210,105,218, -105,226,106, 44,106,132,106,150,106,168,106,180,106,192,106,204,106,216,106,228,107,144,107,228,108, 36,108,150,108,254,109, 80, -109,142,109,234,110, 18,110, 82,110,148,110,156,110,228,111, 66,111, 74,111,136,111,210,112, 40,112,116,112,164,112,234,113, 78, -113,184,114, 2,114, 80,114, 92,114,104,114,116,114,128,114,140,114,228,115, 40,115, 92,115,106,115,118,115,218,116, 16,116, 96, -116,150,116,200,117, 2,117, 56,117, 64,117,118,117,164,117,186,117,248,118, 38,118,134,118,200,118,252,119, 40,119,102,119,218, -120, 22,120, 78,120,168,121, 2,121, 76,121,152,121,182,121,210,122, 26,122, 80,122, 88,122, 96,122,154,122,210,123, 8,123, 16, -123, 24,123, 32,123, 62,123, 92,123,148,123,156,123,168,123,180,123,192,123,204,123,250,124, 6,124, 96,124,104,124,112,124,130, -124,138,124,196,124,246,125, 26,125, 38,125, 50,125, 62,125, 86,125, 94,125,158,125,166,125,194,126, 10,126, 18,126,118,126,126, -126,212,126,224,126,232,127, 26,127, 34,127, 42,127, 50,127, 86,127, 94,127,102,127,110,127,178,128, 18,128, 26,128, 70,128,118, -128,162,128,216,129, 24,129, 44,129,102,129,192,130, 32,130,116,130,124,130,234,131, 64,131, 92,131,162,131,170,132, 14,132,116, -132,172,132,184,132,246,133, 40,133,108,133,152,133,160,133,200,133,208,133,216,133,254,134, 6,134,142,134,150,134,194,134,242, -135, 30,135, 84,135,150,135,170,135,230,136, 22,136,110,136,200,136,212,136,224,137, 26,137, 38,137,114,137,122,137,130,137,148, -137,156,137,214,138, 10,138, 56,138, 68,138, 80,138, 92,138,116,138,196,138,204,138,212,139, 8,139, 80,139,136,139,172,139,208, -140, 0,140, 48,140,100,140,152,140,214,141, 18,141,124,141,240,141,248,142, 0,142, 66,142,132,142,172,143,114,143,170,143,182, -143,190,143,198,144, 66,144,184,144,196,144,208,145, 50,145,118,145,164,145,206,146, 0,146, 76,146,108,146,126,146,144,146,190, -147, 28,147, 58,147,108,147,156,147,208,147,254,148, 58,148, 90,148,122,148,148,148,174,148,218,149, 10,149, 58,149,106,149,118, -149,130,149,162,149,192,149,230,150, 10,150, 46,150, 82,150,114,150,144,150,174,150,204,150,232,151, 4,151, 52,151,102,151,200, -152, 38,152, 50,152, 62,152, 86,152,110,152,118,152,142,152,174,152,206,152,242,153, 22,153, 52,153, 82,153,118,153,154,153,194, -153,232,154, 8,154, 16,154, 88,154,156,154,168,154,180,154,188,154,206,154,224,155, 14,155, 64,155,102,155,144,155,182,155,218, -155,248,156, 22,156, 58,156, 94,156,132,156,170,156,192,156,208,156,232,157, 4,157, 12,157, 20,157, 38,157, 56,157, 64,157, 72, -157, 84,157, 96,157,114,157,126,157,138,157,150,157,158,157,166,157,178,157,190,157,202,157,214,157,238,158, 4,158, 12,158, 20, -158, 32,158, 44,158, 56,158, 68,158, 80,158, 92,158,104,158,116,158,128,158,140,158,152,158,164,158,186,158,208,158,220,158,232, -159, 18,159, 60,159,136,159,206,160, 30,160,108,160,170,160,232,161, 32,161, 86,161, 94,161,140,161,148,161,156,161,198,161,240, -162, 36,162, 86,162,150,162,200,162,250,163, 64,163,110,163,160,163,244,164, 52,164, 86,164,116,164,162,164,240,165, 18,165, 54, -165,144,165,192,166, 2,166, 52,166,120,166,170,166,226,167, 4,167, 60,167,102,167,174,167,224,167,232,168, 24,168, 32,168, 66, -168,154,168,190,168,198,169, 30,169, 38,169,114,169,122,169,130,169,144,169,176,169,184,169,222,169,240,170, 88,170,158,170,242, -171, 54,171,128,171,210,172, 10,172, 76,172,200,173, 22,173, 82,173,114,173,226,174, 92,174,154,174,162,175, 34,175,100,175,218, -176, 58,176, 66,176,154,176,250,177, 2,177,104,177,112,177,228,178, 70,178, 78,178,144,178,252,179, 58,179, 66,179, 96,179,206, -180, 50,180, 58,180,204,181, 12,181, 44,181, 70,181, 86,181, 98,181,110,181,122,181,134,181,146,181,158,181,170,181,182,181,196, -181,208,181,220,181,232,181,244,182, 0,182, 12,182, 24,182, 36,182, 48,182, 60,182, 72,182, 84,182, 96,182,108,182,120,182,132, -182,144,182,156,182,168,182,186,182,202,182,214,182,226,182,238,182,250,183, 6,183, 18,183, 30,183, 42,183, 54,183, 66,183, 78, -183, 90,183,102,183,114,183,126,183,140,183,152,183,164,183,178,183,190,183,202,183,214,183,226,183,238,183,250,184, 6,184, 22, -184, 34,184, 46,184, 60,184, 72,184, 84,184, 98,184,110,184,122,184,134,184,146,184,158,184,170,184,182,184,194,184,206,184,218, -184,230,184,242,184,254,185, 10,185, 22,185, 34,185, 50,185, 62,185, 74,185, 86,185, 98,185,112,185,124,185,136,185,148,185,160, -185,172,185,184,185,196,185,210,185,222,185,234,185,246,186, 2,186, 14,186, 26,186, 38,186, 56,186, 72,186, 84,186, 96,186,108, -186,120,186,132,186,144,186,156,186,168,186,180,186,194,186,206,186,218,186,230,186,242,186,254,187, 10,187, 22,187, 34,187, 46, -187, 58,187, 70,187, 82,187, 94,187,106,187,118,187,130,187,142,187,154,187,166,187,178,187,190,187,202,187,214,187,226,187,238, -187,250,188, 6,188, 18,188, 30,188, 42,188, 54,188, 66,188, 80,188, 92,188,104,188,116,188,128,188,140,188,152,188,164,188,176, -188,188,188,200,188,212,188,224,188,236,188,248,189, 4,189, 16,189, 28,189, 40,189, 52,189, 64,189, 76,189, 88,189,100,189,112, -189,124,189,136,189,148,189,160,189,172,189,184,189,196,189,208,189,220,189,232,189,244,190, 0,190, 12,190, 24,190, 36,190, 50, -190, 62,190, 74,190, 86,190, 98,190,110,190,122,190,134,190,146,190,158,190,170,190,186,190,198,190,210,190,222,190,234,190,246, -191, 2,191, 14,191, 26,191, 38,191, 50,191, 62,191, 74,191, 86,191, 98,191,110,191,122,191,134,191,150,191,162,191,174,191,186, -191,198,191,210,191,222,191,234,191,246,192, 2,192, 14,192, 26,192, 38,192, 50,192, 62,192, 74,192, 86,192, 98,192,110,192,122, -192,134,192,146,192,158,192,170,192,182,192,194,192,206,192,218,192,230,192,242,192,254,193, 12,193, 24,193, 80,193, 88,193,142, -193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142,193,142, -193,164,193,172,193,194,193,216,193,236,194, 0,194, 12,194, 24,194, 54,194, 84,194,112,194,130,194,176,194,222,195, 12,195, 38, -195, 82,195,148,195,180,195,194,195,206,195,224,196, 10,196, 22,196,220,197,100,197,116,197,128,197,144,197,158,197,170,197,186, -197,204,198, 4,198, 62,198, 86,198,100,198,162,198,172,198,220,199, 12,199, 34,199, 52,199, 64,199,100,199,124,199,148,199,160, -199,172,199,186,199,220,199,248,200, 16,200, 40,200, 50,200, 72,200, 84,200, 98,200,116,200,124,200,134,200,176,200,202,200,222, -200,254,201, 36,201, 54,201, 84,201,134,201,158,201,188,201,230,202, 8,202,142,202,192,203, 8,203, 28,203,116,203,186,203,212, -203,226,203,246,204, 18,204, 48,204,106,204,116,204,126,204,136,204,146,204,156,204,166,204,176,204,186,204,196,204,206,204,216, -204,226,204,236,204,246,205, 0,205, 58,205,146,205,218,205,250,206, 46,206,112,206,178,207, 36,207,140,207,226,208, 20,208, 32, -208,250,209, 30,209, 74,209,174,209,250,210, 74,210,148,210,168,210,188,211, 28,211, 42,211,190,212, 12,212, 88,212,100,212,146, -212,198,213, 16,213, 80,213, 92,213,176,214, 10,214,136,214,222,215,106,215,186,215,234,216, 48,216, 56,216,112,216,120,216,128, -216,196,216,218,217, 4,217, 88,217,154,217,232,217,248,218, 8,218, 24,218, 40,218, 56,218, 72,218, 88,218,104,218,120,218,136, -218,152,218,168,218,180,218,188,218,200,218,216,218,228,218,236,218,248,219, 8,219, 28,219, 40,219, 48,219, 60,219, 76,219, 84, -219, 92,219,100,219,108,219,116,219,128,219,144,219,156,219,164,219,176,219,192,219,212,219,224,219,232,219,244,220, 4,220, 12, -220, 20,220, 28,220, 36,220,102,221, 36,221,146,221,154,221,242,222, 74,222,162,222,250,223,138,224, 28,224, 52,224, 76,224,100, -224,124,224,152,224,174,224,204,225, 22,225, 58,225, 68,225, 78,225, 88,225,110,225,158,225,170,225,182,225,242,226,184,227, 54, -227, 72,227,100,227,120,227,140,228, 68,229, 70,230,142,231, 86,232, 92,233,142,234, 74,235,200,236,252,238, 50,238, 74,238,126, -238,126,238,214,239, 32,239, 96,239,208,240, 48,240,112,240,236,241, 84,241,168,241,246,242, 78,242,178,242,248,242,248,242,248, -242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248, -242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248,242,248, 0, 2, 0,102, -254,150, 4,102, 5,164, 0, 3, 0, 7, 0, 26, 64, 12, 4,251, 0, 6,251, 1, 8, 5,127, 2, 4, 0, 47,196,212,236, 49, 0, - 16,212,236,212,236, 48, 19, 17, 33, 17, 37, 33, 17, 33,102, 4, 0,252,115, 3, 27,252,229,254,150, 7, 14,248,242,114, 6, 41, - 0, 2, 1, 53, 0, 0, 2, 0, 5,213, 0, 3, 0, 9, 0, 53, 64, 15, 7, 0,131, 4,129, 2, 8, 7, 5, 1, 3, 4, 0, 0, - 10, 16,252, 75,176, 11, 84, 88,185, 0, 0,255,192, 56, 89, 60,236, 50, 57, 57, 49, 0, 47,228,252,204, 48, 1,182, 0, 11, 32, - 11, 80, 11, 3, 93, 37, 51, 21, 35, 17, 51, 17, 3, 35, 3, 1, 53,203,203,203, 20,162, 21,254,254, 5,213,253,113,254,155, 1, -101, 0, 0, 0, 0, 2, 0,197, 3,170, 2,233, 5,213, 0, 3, 0, 7, 0, 66, 64, 15, 5, 1,132, 4, 0,129, 8, 4, 5, 6, - 0, 5, 2, 4, 8, 16,252, 75,176, 18, 84, 75,176, 19, 84, 91, 88,185, 0, 2,255,192, 56, 89,252,220,236, 49, 0, 16,244, 60, -236, 50, 48, 1, 64, 15, 48, 9, 64, 9, 80, 9, 96, 9,112, 9,160, 9,191, 9, 7, 93, 1, 17, 35, 17, 33, 17, 35, 17, 1,111, -170, 2, 36,170, 5,213,253,213, 2, 43,253,213, 2, 43, 0, 0, 0, 2, 0,158, 0, 0, 6, 23, 5,190, 0, 3, 0, 31, 0, 96, - 64, 49, 27, 11, 0,135, 7, 4, 29, 9, 5, 25, 13, 2,135, 23, 19, 15, 21, 17, 31, 30, 28, 27, 26, 23, 22, 21, 20, 19, 18, 17, - 16, 14, 13, 12, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 26, 10, 24, 6, 32, 16,252,204, 23, 57, 49, 0, 47, 60,212, 60, 60,252, - 60, 60,212, 60, 60,196, 50,236, 50, 50, 48, 64, 17, 11, 1, 11, 2, 11, 12, 11, 13, 20, 4, 26, 17, 26, 18, 20, 31, 8, 1, 93, - 1, 33, 3, 33, 11, 1, 33, 19, 51, 3, 33, 21, 33, 3, 33, 21, 33, 3, 35, 19, 33, 3, 35, 19, 33, 53, 33, 19, 33, 53, 33, 19, - 4, 23,254,221, 84, 1, 37, 68,104, 1, 36,105,160,103, 1, 56,254,161, 82, 1, 62,254,155,104,160,103,254,219,103,161,104,254, -197, 1, 96, 84,254,190, 1,105,102, 3,133,254,178, 3,135,254, 97, 1,159,254, 97,154,254,178,153,254, 98, 1,158,254, 98, 1, -158,153, 1, 78,154, 1,159, 0, 0, 3, 0,170,254,211, 4,109, 6, 20, 0, 33, 0, 40, 0, 47, 0,189, 64, 85, 34, 2, 10, 11, - 10, 39, 1, 38, 40, 2, 11, 11, 10, 29, 1, 30, 28, 2, 47, 41, 47, 27, 2, 41, 41, 47, 66, 19, 17, 16, 34, 10, 27, 41, 4, 23, - 6, 9, 42, 33, 5, 2, 23,134, 22, 6,134, 5, 17, 35, 26,138, 22,137, 16, 0, 42,138, 5,137, 2, 45, 8, 22, 10, 30, 7, 41, - 26, 18, 3, 0, 9, 34, 16, 9, 3, 1, 7, 38, 8, 13, 5, 6, 48, 16,252, 75,176, 9, 84, 88,185, 0, 5,255,192, 56, 89, 75, -176, 12, 84, 75,176, 16, 84, 91, 75,176, 15, 84, 91, 88,185, 0, 5, 0, 64, 56, 89, 60,236,244, 23, 60,252, 23, 60,244,228,236, - 49, 0, 47,228,236,196,212,228,236, 50,196, 16,238, 16,238, 17, 18, 57, 17, 57, 17, 18, 23, 57, 17, 18, 57, 48, 75, 83, 88, 7, - 16, 4,237, 7, 16, 14,237, 17, 23, 57, 7, 16, 14,237, 17, 23, 57, 7, 16, 4,237, 89, 34, 1, 35, 3, 46, 1, 39, 53, 30, 1, - 23, 17, 46, 1, 53, 52, 54, 55, 53, 51, 21, 30, 1, 23, 21, 46, 1, 39, 17, 30, 1, 21, 20, 6, 7, 3, 17, 14, 1, 21, 20, 22, - 23, 17, 62, 1, 53, 52, 38, 2,180,100, 1,105,210,106,102,209,111,221,201,218,204,100, 93,174, 83, 83,175, 92,227,214,227,214, -100,116,122,113,225,127,129,123,254,211, 1, 45, 2, 45, 45,180, 64, 65, 1, 1,200, 36,172,150,163,188, 14,235,232, 4, 31, 27, -175, 42, 46, 4,254, 85, 35,180,156,169,195, 15, 3, 0, 1,154, 13,106, 88, 86, 96,213,254, 79, 17,110, 90, 88,104, 0, 0, 0, - 0, 5, 0,113,255,227, 7, 41, 5,240, 0, 11, 0, 23, 0, 35, 0, 39, 0, 51, 0,137, 64, 54, 36, 15, 37, 38, 37, 38, 15, 39, - 36, 39, 66, 0,146, 12, 30,146, 46,141, 24,146, 36, 6,146, 12,141, 38, 18,140, 40, 36,145, 52, 39, 33, 27, 37, 9, 3, 13, 21, - 14, 9, 13, 15, 33, 13, 43, 14, 27, 13, 15, 49, 11, 52, 16,252, 75,176, 9, 84, 75,176, 11, 84, 91, 75,176, 12, 84, 91, 75,176, - 20, 84, 91, 75,176, 14, 84, 91, 75,176, 13, 84, 91, 88,185, 0, 49,255,192, 56, 89,196,236,244,236, 16,238,246,238, 17, 57, 17, - 18, 57, 49, 0, 16,228, 50,244, 60,228,236, 16,238,246,238, 16,238, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, 34, 1, - 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 39, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 1, 34, 6, 21, 20, 22, 51, 50, 54, - 53, 52, 38, 37, 51, 1, 35, 19, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 5,209, 87, 99, 99, 87, 85, 99, 99, 85,158,186,187, -157,160,186,187,252,151, 86, 99, 98, 87, 87, 99,100, 3, 49,160,252, 90,160, 31,158,188,187,159,159,185,186, 2,145,148,132,130, -149,149,130,131,149,127,220,187,187,219,219,187,188,219, 2, 97,149,130,132,148,148,132,129,150,127,249,243, 6, 13,219,187,189, -218,219,188,186,220, 0, 0, 0, 0, 2, 0,129,255,227, 5,254, 5,240, 0, 9, 0, 48, 1,205, 64,150, 13, 1, 14, 12,134, 17, - 18, 17, 11,134, 10, 11, 18, 18, 17, 9,134, 0, 9, 21, 22, 21, 7, 1, 6, 8,134, 22, 22, 21, 2, 1, 3, 1,134, 29, 30, 29, - 0,134, 9, 0, 30, 30, 29, 32, 31, 2, 33, 30, 17, 10, 19, 10, 23, 22, 21, 3, 24, 20, 17, 19, 10, 7, 8, 2, 6, 9, 17, 19, - 19, 10, 2, 1, 2, 3, 0, 17, 10, 19, 10, 23, 22, 2, 24, 21, 17, 19, 10, 20, 17, 19, 19, 10, 66, 18, 11, 9, 3, 6, 0, 10, - 30, 3, 40, 21, 14, 6, 40, 39, 6,149, 24, 43,149, 39,148, 36,145, 24,140, 14, 19, 10, 46, 11, 14, 9, 0, 46, 18, 21, 39, 14, - 30, 3, 46, 18, 39, 33, 14, 17, 15, 19, 33, 3, 18, 27, 16, 49, 16,252,236,196,212,212,236, 16,198,238, 17, 57, 17, 18, 57, 57, - 17, 57, 57, 17, 57, 17, 57, 49, 0, 47,198,228,246,230,238, 16,238, 16,198, 17, 18, 57, 17, 23, 57, 17, 23, 57, 48, 75, 83, 88, - 7, 16, 5,237, 7, 5,237, 17, 23, 57, 7, 16, 5,237, 17, 23, 57, 7, 16, 5,237, 17, 23, 57, 7, 5,237, 17, 23, 57, 7, 16, - 5,237, 17, 23, 57, 7, 16, 8,237, 7, 16, 14,237, 17, 23, 57, 7, 16, 14,237, 17, 23, 57, 7, 16, 8,237, 7, 16, 8,237, 7, - 16, 14,237, 17, 23, 57, 89, 34,178, 15, 50, 1, 1, 93, 64,178, 7, 11, 5, 34, 9, 41, 28, 0, 28, 1, 31, 2, 23, 11, 42, 0, - 42, 1, 38, 18, 58, 0, 52, 18, 68, 11, 94, 0, 89, 1, 90, 10, 85, 18, 90, 26, 90, 31, 89, 48,103, 30,123, 0,155, 0,154, 1, -153, 2,151, 8,149, 11,147, 21,149, 22,149, 34,153, 45, 31, 9, 11, 9, 12, 8, 17, 12, 39, 12, 40, 24, 2, 27, 9, 25, 11, 25, - 12, 25, 17, 28, 20, 28, 21, 22, 29, 31, 50, 39, 0, 39, 1, 41, 9, 35, 18, 42, 19, 42, 20, 40, 21, 47, 50, 59, 9, 52, 18, 57, - 19, 63, 50, 74, 9, 76, 20, 75, 21, 70, 25, 79, 50, 86, 1, 90, 9, 89, 12, 85, 18, 89, 19, 92, 31, 95, 50,106, 12,105, 17, 96, - 50,117, 1,121, 12,122, 17,147, 0,147, 1,151, 2,149, 5,156, 7,156, 8,159, 8,154, 9,155, 11,154, 12,144, 50,160, 50,176, - 50, 57, 93, 0, 93, 1, 14, 1, 21, 20, 22, 51, 50, 54, 55, 9, 1, 62, 1, 55, 51, 6, 2, 7, 1, 35, 39, 14, 1, 35, 34, 0, - 53, 52, 54, 55, 46, 1, 53, 52, 54, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 1,242, 91, 85,212,160, 95,166, 73,254, -123, 1,252, 59, 66, 6,186, 12,104, 93, 1, 23,252,143,104,228,131,241,254,206,134,134, 48, 50,222,184, 83,165, 85, 87,158, 68, -105,131, 59, 3, 35, 81,161, 88,146,194, 63, 64, 2,143,253,248, 89,203,114,132,254,254,126,254,227,147, 89, 87, 1, 19,215,128, -225, 99, 63,125, 60,162,197, 36, 36,182, 47, 49,111, 88, 51,103, 0, 1, 0,197, 3,170, 1,111, 5,213, 0, 3, 0, 55, 64, 10, - 1,132, 0,129, 4, 0, 5, 2, 4, 4, 16,252, 75,176, 18, 84, 75,176, 19, 84, 91, 88,185, 0, 2,255,192, 56, 89,236, 49, 0, - 16,244,236, 48, 1, 64, 13, 64, 5, 80, 5, 96, 5,112, 5,144, 5,160, 5, 6, 93, 1, 17, 35, 17, 1,111,170, 5,213,253,213, - 2, 43, 0, 0, 0, 1, 0,176,254,242, 2,123, 6, 18, 0, 13, 0, 55, 64, 15, 6,152, 0,151, 14, 13, 7, 0, 3, 18, 6, 0, - 19, 10, 14, 16,220, 75,176, 19, 84, 88,185, 0, 10,255,192, 56, 89, 75,176, 15, 84, 88,185, 0, 10, 0, 64, 56, 89,228, 50,236, - 17, 57, 57, 49, 0, 16,252,236, 48, 1, 6, 2, 21, 20, 18, 23, 35, 38, 2, 53, 52, 18, 55, 2,123,134,130,131,133,160,150,149, -148,151, 6, 18,230,254, 62,231,231,254, 59,229,235, 1,198,224,223, 1,196,236, 0, 1, 0,164,254,242, 2,111, 6, 18, 0, 13, - 0, 31, 64, 15, 7,152, 0,151, 14, 7, 1, 0, 11, 18, 4, 19, 8, 0, 14, 16,220, 60,244,236, 17, 57, 57, 49, 0, 16,252,236, - 48, 19, 51, 22, 18, 21, 20, 2, 7, 35, 54, 18, 53, 52, 2,164,160,150,149,149,150,160,133,131,131, 6, 18,236,254, 60,223,224, -254, 58,235,229, 1,197,231,231, 1,194, 0, 0, 0, 1, 0, 61, 2, 74, 3,195, 5,240, 0, 17, 0, 78, 64, 44, 16, 13, 11, 0, - 4, 12, 9, 7, 4, 2, 4, 8, 3,153, 5, 17, 12,153, 10, 1, 14,145, 18, 8, 12, 10, 3, 9, 6, 17, 3, 1, 3, 2, 0, 20, - 15, 4, 11, 9, 20, 13, 6, 18, 16,212, 60,228, 50,220, 60,228, 50, 23, 57, 17, 18, 23, 57, 49, 0, 16,244,212, 60,236, 50,196, -236, 50, 23, 57, 18, 23, 57, 48, 1, 13, 1, 7, 37, 17, 35, 17, 5, 39, 45, 1, 55, 5, 17, 51, 17, 37, 3,195,254,153, 1,103, - 58,254,176,114,254,176, 58, 1,103,254,153, 58, 1, 80,114, 1, 80, 4,223,194,195, 98,203,254,135, 1,121,203, 98,195,194, 99, -203, 1,121,254,135,203, 0, 0, 0, 1, 0,217, 0, 0, 5,219, 5, 4, 0, 11, 0, 35, 64, 17, 0, 9, 1,156, 7, 3, 5, 2, - 21, 4, 0, 23, 10, 6, 21, 8, 12, 16,220,252, 60,252, 60,236, 49, 0, 47,212, 60,252, 60,196, 48, 1, 17, 33, 21, 33, 17, 35, - 17, 33, 53, 33, 17, 3,174, 2, 45,253,211,168,253,211, 2, 45, 5, 4,253,211,170,253,211, 2, 45,170, 2, 45, 0, 1, 0,158, -255, 18, 1,195, 0,254, 0, 5, 0, 25, 64, 12, 3,158, 0,131, 6, 3, 4, 1, 25, 0, 24, 6, 16,252,236,212,204, 49, 0, 16, -252,236, 48, 55, 51, 21, 3, 35, 19,240,211,164,129, 82,254,172,254,192, 1, 64, 0, 1, 0,100, 1,223, 2,127, 2,131, 0, 3, - 0, 17,182, 0,156, 2, 4, 1, 0, 4, 16,220,204, 49, 0, 16,212,236, 48, 19, 33, 21, 33,100, 2, 27,253,229, 2,131,164, 0, - 0, 1, 0,219, 0, 0, 1,174, 0,254, 0, 3, 0, 17,183, 0,131, 2, 1, 25, 0, 24, 4, 16,252,236, 49, 0, 47,236, 48, 55, - 51, 21, 35,219,211,211,254,254, 0, 1, 0, 0,255, 66, 2,178, 5,213, 0, 3, 0, 45, 64, 20, 0, 26, 1, 2, 1, 2, 26, 3, - 0, 3, 66, 2,159, 0,129, 4, 2, 0, 1, 3, 47,196, 57, 57, 49, 0, 16,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5, -237, 89, 34, 1, 51, 1, 35, 2, 8,170,253,248,170, 5,213,249,109, 0, 0, 0, 0, 2, 0,135,255,227, 4,143, 5,240, 0, 11, - 0, 23, 0, 35, 64, 19, 6,160, 18, 0,160, 12,145, 18,140, 24, 9, 28, 15, 30, 3, 28, 21, 27, 24, 16,252,236,244,236, 49, 0, - 16,228,244,236, 16,238, 48, 1, 34, 2, 17, 16, 18, 51, 50, 18, 17, 16, 2, 39, 50, 0, 17, 16, 0, 35, 34, 0, 17, 16, 0, 2, -139,156,157,157,156,157,157,157,157,251, 1, 9,254,247,251,251,254,247, 1, 9, 5, 80,254,205,254,204,254,205,254,205, 1, 51, - 1, 51, 1, 52, 1, 51,160,254,115,254,134,254,135,254,115, 1,141, 1,121, 1,122, 1,141, 0, 0, 1, 0,225, 0, 0, 4, 90, - 5,213, 0, 10, 0, 64, 64, 21, 66, 3,160, 4, 2,160, 5,129, 7, 0,160, 9, 8, 31, 6, 28, 3, 0, 31, 1, 11, 16,212, 75, -176, 15, 84, 88,185, 0, 1, 0, 64, 56, 89,236,196,252,236, 49, 0, 47,236, 50,244,236,212,236, 48, 75, 83, 88, 89, 34, 1,180, - 15, 3, 15, 4, 2, 93, 55, 33, 17, 5, 53, 37, 51, 17, 33, 21, 33,254, 1, 74,254,153, 1,101,202, 1, 74,252,164,170, 4,115, - 72,184, 72,250,213,170, 0, 0, 0, 1, 0,150, 0, 0, 4, 74, 5,240, 0, 28, 0,154, 64, 39, 25, 26, 27, 3, 24, 28, 17, 5, - 4, 0, 17, 5, 5, 4, 66, 16,161, 17,148, 13,160, 20,145, 4, 0,160, 2, 0, 16, 10, 2, 1, 10, 28, 23, 16, 3, 6, 29, 16, -252, 75,176, 21, 84, 75,176, 22, 84, 91, 75,176, 20, 84, 91, 88,185, 0, 3,255,192, 56, 89,196,212,236,192,192, 17, 18, 57, 49, - 0, 47,236, 50,244,236,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 5,237, 17, 23, 57, 89, 34, 1, 64, 50, 85, 4, 86, 5, 86, - 7,122, 4,122, 5,118, 27,135, 25, 7, 4, 0, 4, 25, 4, 26, 4, 27, 5, 28,116, 0,118, 6,117, 26,115, 27,116, 28,130, 0, -134, 25,130, 26,130, 27,130, 28,168, 0,168, 27, 17, 93, 0, 93, 37, 33, 21, 33, 53, 54, 0, 55, 62, 1, 53, 52, 38, 35, 34, 6, - 7, 53, 62, 1, 51, 50, 4, 21, 20, 6, 7, 6, 0, 1,137, 2,193,252, 76,115, 1,141, 51, 97, 77,167,134, 95,211,120,122,212, - 88,232, 1, 20, 69, 91, 25,254,244,170,170,170,119, 1,145, 58,109,151, 73,119,150, 66, 67,204, 49, 50,232,194, 92,165,112, 29, -254,235, 0, 0, 0, 1, 0,156,255,227, 4,115, 5,240, 0, 40, 0,112, 64, 46, 0, 21, 19, 10,134, 9, 31,134, 32, 19,160, 21, - 13,160, 9,147, 6, 28,160, 32,147, 35,145, 6,140, 21,163, 41, 22, 28, 19, 0, 3, 20, 25, 28, 38, 32, 16, 28, 3, 20, 31, 9, - 6, 41, 16,252, 75,176, 22, 84, 75,176, 20, 84, 91, 88,185, 0, 9,255,192, 56, 89,196,196,212,236,244,236, 17, 23, 57, 57, 49, - 0, 16,236,228,244,228,236, 16,230,238, 16,238, 16,238, 16,238, 17, 18, 57, 48, 1, 64, 9,100, 30, 97, 31, 97, 32,100, 33, 4, - 0, 93, 1, 30, 1, 21, 20, 4, 33, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 43, 1, 53, 51, 50, 54, 53, 52, 38, 35, 34, - 6, 7, 53, 62, 1, 51, 50, 4, 21, 20, 6, 3, 63,145,163,254,208,254,232, 94,199,106, 84,200,109,190,199,185,165,174,182,149, -158,163,152, 83,190,114,115,201, 89,230, 1, 12,142, 3, 37, 31,196,144,221,242, 37, 37,195, 49, 50,150,143,132,149,166,119,112, -115,123, 36, 38,180, 32, 32,209,178,124,171, 0, 0, 2, 0,100, 0, 0, 4,164, 5,213, 0, 2, 0, 13, 0,129, 64, 29, 1, 13, - 3, 13, 0, 3, 3, 13, 66, 0, 3, 11, 7,160, 5, 1, 3,129, 9, 1, 12, 10, 0, 28, 6, 8, 4, 12, 14, 16,220, 75,176, 11, - 84, 75,176, 13, 84, 91, 88,185, 0, 12,255,192, 56, 89,212, 60,196,236, 50, 17, 57, 49, 0, 47,228,212, 60,236, 50, 18, 57, 48, - 75, 83, 88, 7, 16, 4,201, 7, 16, 5,201, 89, 34, 1, 64, 42, 11, 0, 42, 0, 72, 0, 89, 0,105, 0,119, 0,138, 0, 7, 22, - 1, 43, 0, 38, 1, 43, 3, 54, 1, 78, 1, 79, 12, 79, 13, 86, 1,102, 1,117, 1,122, 3,133, 1, 13, 93, 0, 93, 9, 1, 33, - 3, 51, 17, 51, 21, 35, 17, 35, 17, 33, 53, 3, 6,254, 2, 1,254, 53,254,213,213,201,253, 94, 5, 37,252,227, 3,205,252, 51, -168,254,160, 1, 96,195, 0, 0, 0, 1, 0,158,255,227, 4,100, 5,213, 0, 29, 0, 94, 64, 35, 4, 26, 7, 17,134, 16, 29, 26, -160, 7, 20,160, 16,137, 13, 2,160, 0,129, 13,140, 7,164, 30, 23, 28, 1, 10, 3, 28, 0, 10, 16, 6, 30, 16,252, 1, 75,176, - 22, 84, 75,176, 20, 84, 91, 88,185, 0, 16,255,192, 56, 89, 75,176, 15, 84, 88,185, 0, 16, 0, 64, 56, 89,196,212,236, 16,196, -238, 49, 0, 16,228,228,244,236, 16,230,238, 16,254,196, 16,238, 17, 18, 57, 48, 19, 33, 21, 33, 17, 62, 1, 51, 50, 0, 21, 20, - 0, 33, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 35, 34, 6, 7,221, 3, 25,253,160, 44, 88, 44,250, 1, 36,254,212,254, -239, 94,195,104, 90,192,107,173,202,202,173, 81,161, 84, 5,213,170,254,146, 15, 15,254,238,234,241,254,245, 32, 32,203, 49, 48, -182,156,156,182, 36, 38, 0, 0, 0, 2, 0,143,255,227, 4,150, 5,240, 0, 11, 0, 36, 0, 88, 64, 36, 19, 6, 0, 13,134, 12, - 0,160, 22, 6,160, 28, 22,165, 16,160, 12,137, 34,145, 28,140, 37, 12, 34, 9, 28, 25, 30, 19, 28, 3, 33, 31, 27, 37, 16,252, -236,236,244,236,228, 49, 0, 16,228,244,228,252,228, 16,238, 16,238, 16,238, 17, 18, 57, 48, 64, 20,203, 0,203, 1,205, 2,205, - 3,205, 4,203, 5,203, 6, 7,164, 30,178, 30, 2, 93, 1, 93, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 1, 21, 46, 1, - 35, 34, 2, 3, 62, 1, 51, 50, 0, 21, 20, 0, 35, 32, 0, 17, 16, 0, 33, 50, 22, 2,164,136,159,159,136,136,159,159, 1, 9, - 76,155, 76,200,211, 15, 59,178,107,225, 1, 5,254,240,226,254,253,254,238, 1, 80, 1, 27, 76,155, 3, 59,186,162,161,187,187, -161,162,186, 2,121,184, 36, 38,254,242,254,239, 87, 93,254,239,235,230,254,234, 1,141, 1,121, 1, 98, 1,165, 30, 0, 0, 0, - 0, 1, 0,168, 0, 0, 4,104, 5,213, 0, 6, 0, 99, 64, 24, 5, 17, 2, 3, 2, 3, 17, 4, 5, 4, 66, 5,160, 0,129, 3, - 5, 3, 1, 4, 1, 0, 6, 7, 16,252,204,196, 17, 57, 57, 49, 0, 47,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, - 89, 34, 1, 75,176, 22, 84, 88,189, 0, 7, 0, 64, 0, 1, 0, 7, 0, 7,255,192, 56, 17, 55, 56, 89, 64, 18, 88, 2, 1, 6, - 3, 26, 5, 57, 5, 72, 5,103, 3,176, 0,176, 6, 7, 93, 0, 93, 19, 33, 21, 1, 35, 1, 33,168, 3,192,253,226,211, 1,254, -253, 51, 5,213, 86,250,129, 5, 43, 0, 0, 0, 0, 3, 0,139,255,227, 4,139, 5,240, 0, 11, 0, 35, 0, 47, 0, 67, 64, 37, - 24, 12, 0,160, 39, 6,160, 30, 45,160, 18,145, 30,140, 39,163, 48, 24, 12, 36, 42, 28, 21, 36, 28, 15, 9, 28, 21, 27, 30, 3, - 28, 15, 33, 27, 48, 16,252,196,236,244,196,236, 16,238, 16,238, 17, 57, 57, 49, 0, 16,236,228,244,236, 16,238, 16,238, 57, 57, - 48, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 37, 46, 1, 53, 52, 36, 51, 50, 22, 21, 20, 6, 7, 30, 1, 21, 20, 4, 35, - 34, 36, 53, 52, 54, 19, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, 6, 2,139,144,165,165,144,144,166,165,254,165,130,145, 0,255, -222,223,254,145,129,146,163,254,247,247,247,254,247,164, 72,145,131,130,147,147,130,131,145, 2,197,154,135,135,154,155,134,135, -154, 86, 32,178,128,179,208,208,179,128,178, 32, 34,198,143,217,232,232,217,143,198, 1, 97,116,130,130,116,116,130,130, 0, 0, - 0, 2, 0,129,255,227, 4,135, 5,240, 0, 24, 0, 36, 0, 88, 64, 35, 7, 31, 25, 1,134, 0, 25,160, 10,165, 4,160, 0,137, - 22, 31,160, 16,145, 22,140, 37, 7, 28, 28, 33, 19, 30, 0, 34, 34, 28, 13, 27, 37, 16,252,236,228,244,236,236, 49, 0, 16,228, -244,236, 16,230,254,245,238, 16,238, 17, 18, 57, 48, 64, 22,196, 25,194, 26,192, 27,192, 28,192, 29,194, 30,196, 31, 7,170, 18, -188, 18,233, 18, 3, 93, 1, 93, 55, 53, 30, 1, 51, 50, 18, 19, 14, 1, 35, 34, 0, 53, 52, 0, 51, 32, 0, 17, 16, 0, 33, 34, - 38, 1, 50, 54, 53, 52, 38, 35, 34, 6, 21, 20, 22,225, 76,156, 75,200,211, 15, 58,178,108,224,254,251, 1, 16,226, 1, 3, 1, - 17,254,177,254,229, 76,156, 1, 62,136,159,159,136,136,159,159, 31,184, 36, 38, 1, 13, 1, 18, 86, 92, 1, 15,235,230, 1, 22, -254,115,254,134,254,159,254, 91, 30, 2,151,186,162,161,187,187,161,162,186, 0, 0, 2, 0,240, 0, 0, 1,195, 4, 35, 0, 3, - 0, 7, 0, 28, 64, 14, 6,131, 4,166, 0,131, 2, 5, 1, 3, 4, 0, 24, 8, 16,252, 60,236, 50, 49, 0, 47,236,244,236, 48, - 55, 51, 21, 35, 17, 51, 21, 35,240,211,211,211,211,254,254, 4, 35,254, 0, 0, 0, 2, 0,158,255, 18, 1,195, 4, 35, 0, 3, - 0, 9, 0, 37, 64, 19, 2,131, 0, 7,158, 4,131, 0,166, 10, 7, 8, 5, 1, 25, 4, 0, 24, 10, 16,252, 60,236, 50,212,204, - 49, 0, 16,228,252,236, 16,238, 48, 19, 51, 21, 35, 17, 51, 21, 3, 35, 19,240,211,211,211,164,129, 82, 4, 35,254,253,217,172, -254,192, 1, 64, 0, 1, 0,217, 0, 94, 5,219, 4,166, 0, 6, 0, 77, 64, 42, 2,156, 3, 4, 3, 1,156, 0, 1, 4, 4, 3, - 1,156, 2, 1, 5, 6, 5, 0,156, 6, 5, 66, 5, 4, 2, 1, 0, 5, 3,168, 6,167, 7, 1, 2, 0, 36, 4, 35, 7, 16,252, -236, 50, 57, 49, 0, 16,244,236, 23, 57, 48, 75, 83, 88, 7, 4,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 4,237, 89, 34, 9, - 2, 21, 1, 53, 1, 5,219,251,248, 4, 8,250,254, 5, 2, 3,240,254,145,254,147,182, 1,209,166, 1,209, 0, 0, 2, 0,217, - 1, 96, 5,219, 3,162, 0, 3, 0, 7, 0, 28, 64, 13, 0,156, 2, 6,156, 4, 8, 5, 1, 4, 0, 35, 8, 16,252, 60,196, 50, - 49, 0, 16,212,236,212,236, 48, 19, 33, 21, 33, 21, 33, 21, 33,217, 5, 2,250,254, 5, 2,250,254, 3,162,168,240,170, 0, 0, - 0, 1, 0,217, 0, 94, 5,219, 4,166, 0, 6, 0, 79, 64, 43, 6,156, 0, 6, 3, 4, 3, 5,156, 4, 4, 3, 0,156, 1, 2, - 1, 6,156, 5, 6, 2, 2, 1, 66, 6, 5, 3, 2, 0, 5, 4,168, 1,167, 7, 6, 2, 36, 4, 0, 35, 7, 16,252, 60,236, 57, - 49, 0, 16,244,236, 23, 57, 48, 75, 83, 88, 7, 16, 8,237, 7, 16, 4,237, 7, 16, 4,237, 7, 16, 8,237, 89, 34, 19, 53, 1, - 21, 1, 53, 1,217, 5, 2,250,254, 4, 6, 3,240,182,254, 47,166,254, 47,182, 1,109, 0, 0, 0, 2, 0,147, 0, 0, 3,176, - 5,240, 0, 3, 0, 36, 0,101, 64, 43, 36, 30, 9, 6, 4, 10, 29, 19, 4, 0, 20,134, 19,136, 16,149, 23,145, 0,131, 2, 29, - 26, 13, 9, 5, 4, 10, 30, 1, 13, 28, 26, 4, 28, 5, 1, 3, 0, 38, 26, 19, 37, 16,220, 75,176, 12, 84, 88,185, 0, 19,255, -192, 56, 89,196,252,236,212,236, 16,238, 17, 57, 57, 17, 18, 57, 17, 18, 57, 49, 0, 47,238,246,254,244,238, 16,205, 17, 57, 57, - 23, 57, 48, 1,182,121, 9,122, 10,122, 32, 3, 93, 37, 51, 21, 35, 19, 35, 53, 52, 54, 63, 1, 62, 1, 53, 52, 38, 35, 34, 6, - 7, 53, 62, 1, 51, 50, 22, 21, 20, 6, 15, 1, 14, 1, 7, 14, 1, 21, 1,135,203,203,197,191, 56, 90, 90, 57, 51,131,108, 79, -179, 97, 94,193,103,184,223, 72, 90, 88, 47, 39, 8, 6, 6,254,254, 1,145,154,101,130, 86, 89, 53, 94, 49, 89,110, 70, 67,188, - 57, 56,194,159, 76,137, 86, 86, 47, 53, 25, 21, 60, 52, 0, 0, 0, 2, 0,135,254,156, 7,113, 5,162, 0, 11, 0, 76, 0,149, - 64, 50, 24, 12, 3, 9,169, 25, 21, 27, 3,169, 76, 15, 52, 51, 15,172, 48,169, 55, 21,172, 36,169, 55, 67, 77, 51, 52, 30, 26, - 0, 40, 18, 6, 24, 12, 40, 26, 43, 30, 40, 73, 18, 43, 42, 40, 73, 44, 61, 77, 16,220,236,252,236, 16,254,253,254, 60,198, 16, -238, 17, 18, 57, 57, 49, 0, 16,212,196,252,236, 16,254,237,212,198, 16,197,238, 50, 16,196,238, 17, 57, 57, 48, 0, 75,176, 9, - 84, 75,176, 12, 84, 91, 75,176, 16, 84, 91, 75,176, 19, 84, 91, 75,176, 20, 84, 91, 88,189, 0, 77,255,192, 0, 1, 0, 77, 0, - 77, 0, 64, 56, 17, 55, 56, 89, 64, 9, 15, 78, 31, 78, 47, 78, 63, 78, 4, 1, 93, 1, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, - 6, 1, 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 23, 53, 51, 17, 62, 1, 53, 52, 38, 39, 38, 36, 35, 34, 6, 7, 6, 2, 21, - 20, 18, 23, 22, 4, 51, 50, 54, 55, 23, 6, 4, 35, 34, 36, 39, 38, 2, 53, 52, 18, 55, 54, 36, 51, 50, 4, 23, 30, 1, 21, 16, - 0, 5, 2,250,142,124,123,141,144,122,121,143, 2, 33, 60,155,103,172,215,216,171,103,156, 59,143,146,165, 63, 64,104,254,213, -176,123,226, 96,157,177,115,109,105, 1, 20,157,129,249,104, 90,125,254,217,152,185,254,184,128,128,134,136,126,129, 1, 82,189, -212, 1,107,123, 75, 79,254,194,254,232, 2, 25,143,163,164,142,140,165,164,254, 72, 77, 73,249,200,200,250, 75, 76,131,253, 32, - 22,223,177,107,188, 80,131,139, 65, 64,102,254,181,193,159,254,234,106,104,109, 87, 81,111, 97,103,131,125,125, 1, 73,189,182, - 1, 74,125,127,135,174,160, 98,230,123,254,249,254,208, 6, 0, 0, 2, 0, 16, 0, 0, 5,104, 5,213, 0, 2, 0, 10, 0,186, - 64, 65, 0, 17, 1, 0, 4, 5, 4, 2, 17, 5, 5, 4, 1, 17, 10, 3, 10, 0, 17, 2, 0, 3, 3, 10, 7, 17, 5, 4, 6, 17, - 5, 5, 4, 9, 17, 3, 10, 8, 17, 10, 3, 10, 66, 0, 3, 7,149, 1, 3,129, 9, 5, 9, 8, 7, 6, 4, 3, 2, 1, 0, 9, - 5, 10, 11, 16,212,196, 23, 57, 49, 0, 47, 60,228,212,236, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 5,237, 7, 16, 5,237, - 7, 5,237, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 8,237, 89, 34,178, 32, 12, 1, 1, 93, 64, 58, 15, 0, 88, - 0,118, 0,112, 0,140, 0, 5, 7, 1, 8, 2, 6, 3, 9, 4, 22, 1, 25, 2, 86, 1, 88, 2, 80, 12,103, 1,104, 2,120, 1, -118, 2,124, 3,114, 4,119, 7,120, 8,135, 1,136, 2,128, 12,152, 2,153, 3,150, 4, 23, 93, 0, 93, 9, 1, 33, 1, 51, 1, - 35, 3, 33, 3, 35, 2,188,254,238, 2, 37,254,123,229, 2, 57,210,136,253, 95,136,213, 5, 14,253, 25, 3,174,250, 43, 1,127, -254,129, 0, 0, 0, 3, 0,201, 0, 0, 4,236, 5,213, 0, 8, 0, 17, 0, 32, 0, 67, 64, 35, 25, 0,149, 10, 9,149, 18,129, - 1,149, 10,173, 31, 17, 11, 8, 2, 19, 25, 31, 5, 0, 14, 28, 22, 5, 25, 28, 46, 9, 0, 28, 18, 4, 33, 16,252,236, 50,252, -236,212,236, 17, 23, 57, 57, 57, 49, 0, 47,236,236,244,236, 16,238, 57, 48,178, 15, 34, 1, 1, 93, 1, 17, 33, 50, 54, 53, 52, - 38, 35, 1, 17, 33, 50, 54, 53, 52, 38, 35, 37, 33, 50, 22, 21, 20, 6, 7, 30, 1, 21, 20, 4, 35, 33, 1,147, 1, 68,163,157, -157,163,254,188, 1, 43,148,145,145,148,254, 11, 2, 4,231,250,128,124,149,165,254,240,251,253,232, 2,201,253,221,135,139,140, -133, 2,102,254, 62,111,114,113,112,166,192,177,137,162, 20, 32,203,152,200,218, 0, 1, 0,115,255,227, 5, 39, 5,240, 0, 25, - 0, 54, 64, 26, 13,161, 14,174, 10,149, 17, 1,161, 0,174, 4,149, 23,145, 17,140, 26, 7, 25, 13, 0, 48, 20, 16, 26, 16,252, -236, 50,236, 49, 0, 16,228,244,236,244,236, 16,238,246,238, 48,180, 15, 27, 31, 27, 2, 1, 93, 1, 21, 46, 1, 35, 32, 0, 17, - 16, 0, 33, 50, 54, 55, 21, 14, 1, 35, 32, 0, 17, 16, 0, 33, 50, 22, 5, 39,102,231,130,255, 0,254,240, 1, 16, 1, 0,130, -231,102,106,237,132,254,173,254,122, 1,134, 1, 83,134,237, 5, 98,213, 95, 94,254,199,254,216,254,217,254,199, 94, 95,211, 72, - 72, 1,159, 1,103, 1,104, 1,159, 71, 0, 0, 0, 2, 0,201, 0, 0, 5,176, 5,213, 0, 8, 0, 17, 0, 46, 64, 21, 0,149, - 9,129, 1,149, 16, 8, 2, 16, 10, 0, 5, 25, 13, 50, 0, 28, 9, 4, 18, 16,252,236,244,236, 17, 57, 57, 57, 57, 49, 0, 47, -236,244,236, 48,178, 96, 19, 1, 1, 93, 1, 17, 51, 32, 0, 17, 16, 0, 33, 37, 33, 32, 0, 17, 16, 0, 41, 1, 1,147,244, 1, - 53, 1, 31,254,225,254,203,254, 66, 1,159, 1,178, 1,150,254,104,254, 80,254, 97, 5, 47,251,119, 1, 24, 1, 46, 1, 44, 1, - 23,166,254,151,254,128,254,126,254,150, 0, 0, 0, 1, 0,201, 0, 0, 4,139, 5,213, 0, 11, 0, 46, 64, 21, 6,149, 4, 2, -149, 0,129, 8,149, 4,173, 10, 5, 1, 9, 7, 3, 28, 0, 4, 12, 16,252,236, 50,212,196,196, 49, 0, 47,236,236,244,236, 16, -238, 48,178, 31, 13, 1, 1, 93, 19, 33, 21, 33, 17, 33, 21, 33, 17, 33, 21, 33,201, 3,176,253, 26, 2,199,253, 57, 2,248,252, - 62, 5,213,170,254, 70,170,253,227,170, 0, 0, 0, 1, 0,201, 0, 0, 4, 35, 5,213, 0, 9, 0, 41, 64, 18, 6,149, 4, 2, -149, 0,129, 4,173, 8, 5, 1, 7, 3, 28, 0, 4, 10, 16,252,236, 50,212,196, 49, 0, 47,236,244,236, 16,238, 48,178, 15, 11, - 1, 1, 93, 19, 33, 21, 33, 17, 33, 21, 33, 17, 35,201, 3, 90,253,112, 2, 80,253,176,202, 5,213,170,254, 72,170,253, 55, 0, - 0, 1, 0,115,255,227, 5,139, 5,240, 0, 29, 0, 57, 64, 32, 0, 5, 27, 1,149, 3, 27,149, 8, 18,161, 17,174, 21,149, 14, -145, 8,140, 30, 2, 0, 28, 17, 52, 4, 51, 24, 25, 11, 16, 30, 16,252,236,252,228,252,196, 49, 0, 16,228,244,236,244,236, 16, -254,212,238, 17, 57, 57, 48, 37, 17, 33, 53, 33, 17, 6, 4, 35, 32, 0, 17, 16, 0, 33, 50, 4, 23, 21, 46, 1, 35, 32, 0, 17, - 16, 0, 33, 50, 54, 4,195,254,182, 2, 18,117,254,230,160,254,162,254,117, 1,139, 1, 94,146, 1, 7,111,112,252,139,254,238, -254,237, 1, 19, 1, 18,107,168,213, 1,145,166,253,127, 83, 85, 1,153, 1,109, 1,110, 1,153, 72, 70,215, 95, 96,254,206,254, -209,254,210,254,206, 37, 0, 0, 0, 1, 0,201, 0, 0, 5, 59, 5,213, 0, 11, 0, 44, 64, 20, 8,149, 2,173, 4, 0,129, 10, - 6, 7, 3, 28, 5, 56, 9, 1, 28, 0, 4, 12, 16,252,236, 50,252,236, 50, 49, 0, 47, 60,228, 50,252,236, 48,178, 80, 13, 1, - 1, 93, 19, 51, 17, 33, 17, 51, 17, 35, 17, 33, 17, 35,201,202, 2,222,202,202,253, 34,202, 5,213,253,156, 2,100,250, 43, 2, -199,253, 57, 0, 0, 1, 0,201, 0, 0, 1,147, 5,213, 0, 3, 0, 46,183, 0,175, 2, 1, 28, 0, 4, 4, 16,252, 75,176, 16, - 84, 88,185, 0, 0, 0, 64, 56, 89,236, 49, 0, 47,236, 48, 1, 64, 13, 48, 5, 64, 5, 80, 5, 96, 5,143, 5,159, 5, 6, 93, - 19, 51, 17, 35,201,202,202, 5,213,250, 43, 0, 0, 1,255,150,254,102, 1,147, 5,213, 0, 11, 0, 66, 64, 19, 11, 2, 0, 7, -149, 5,176, 0,129, 12, 5, 8, 6, 57, 1, 28, 0, 4, 12, 16,252, 75,176, 16, 84, 88,185, 0, 0, 0, 64, 56, 89,236,228, 57, - 57, 49, 0, 16,228,252,236, 17, 57, 57, 48, 1, 64, 13, 48, 13, 64, 13, 80, 13, 96, 13,143, 13,159, 13, 6, 93, 19, 51, 17, 16, - 6, 43, 1, 53, 51, 50, 54, 53,201,202,205,227, 77, 63,134,110, 5,213,250,147,254,242,244,170,150,194, 0, 0, 0, 1, 0,201, - 0, 0, 5,106, 5,213, 0, 10, 0,239, 64, 40, 8, 17, 5, 6, 5, 7, 17, 6, 6, 5, 3, 17, 4, 5, 4, 2, 17, 5, 5, 4, - 66, 8, 5, 2, 3, 3, 0,175, 9, 6, 5, 1, 4, 6, 8, 1, 28, 0, 4, 11, 16,252,236, 50,212,196, 17, 57, 49, 0, 47, 60, -236, 50, 23, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 4,237, 89, 34,178, 8, 3, 1, 1, 93, - 64,146, 20, 2, 1, 4, 2, 9, 8, 22, 2, 40, 5, 40, 8, 55, 2, 54, 5, 52, 8, 71, 2, 70, 5, 67, 8, 85, 2,103, 2,118, - 2,119, 5,131, 2,136, 5,143, 8,148, 2,155, 8,231, 2, 21, 6, 3, 9, 5, 9, 6, 27, 3, 25, 7, 5, 10, 3, 10, 7, 24, - 3, 40, 5, 43, 6, 42, 7, 54, 4, 54, 5, 54, 6, 53, 7, 48, 12, 65, 3, 64, 4, 69, 5, 64, 6, 64, 7, 64, 12, 98, 3, 96, - 4,104, 5,103, 7,119, 5,112, 12,139, 3,139, 5,142, 6,143, 7,143, 12,154, 3,157, 6,157, 7,182, 3,181, 7,197, 3,197, - 7,215, 3,214, 7,232, 3,233, 4,232, 5,234, 6,247, 3,248, 5,249, 6, 44, 93,113, 0, 93,113, 19, 51, 17, 1, 33, 9, 1, - 33, 1, 17, 35,201,202, 2,158, 1, 4,253, 27, 3, 26,254,246,253, 51,202, 5,213,253,137, 2,119,253, 72,252,227, 2,207,253, - 49, 0, 0, 0, 0, 1, 0,201, 0, 0, 4,106, 5,213, 0, 5, 0, 37, 64, 12, 2,149, 0,129, 4, 1, 28, 3, 58, 0, 4, 6, - 16,252,236,236, 49, 0, 47,228,236, 48, 64, 9, 48, 7, 80, 7,128, 3,128, 4, 4, 1, 93, 19, 51, 17, 33, 21, 33,201,202, 2, -215,252, 95, 5,213,250,213,170, 0, 1, 0,201, 0, 0, 6, 31, 5,213, 0, 12, 0,191, 64, 52, 3, 17, 7, 8, 7, 2, 17, 1, - 2, 8, 8, 7, 2, 17, 3, 2, 9, 10, 9, 1, 17, 10, 10, 9, 66, 10, 7, 2, 3, 8, 3, 0,175, 8, 11, 5, 9, 8, 3, 2, - 1, 5, 10, 6, 28, 4, 62, 10, 28, 0, 4, 13, 16,252,236,252,236, 17, 23, 57, 49, 0, 47, 60,196,236, 50, 17, 23, 57, 48, 75, - 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34,178,112, 14, 1, 1, 93, 64, 86, 3, 7, 15, 8, - 15, 9, 2, 10, 21, 2, 20, 7, 19, 10, 38, 2, 38, 7, 32, 7, 38, 10, 32, 10, 52, 7, 53, 10,105, 2,124, 2,123, 7,121, 10, -128, 2,130, 7,130, 10,144, 2, 22, 4, 1, 11, 3, 19, 1, 27, 3, 35, 1, 44, 3, 39, 8, 40, 9, 52, 1, 60, 3, 86, 8, 89, - 9,101, 8,106, 9,118, 8,121, 9,129, 1,141, 3,149, 1,155, 3, 20, 93, 0, 93, 19, 33, 9, 1, 33, 17, 35, 17, 1, 35, 1, - 17, 35,201, 1, 45, 1,125, 1,127, 1, 45,197,254,127,203,254,127,196, 5,213,252, 8, 3,248,250, 43, 5, 31,252, 0, 4, 0, -250,225, 0, 0, 0, 1, 0,201, 0, 0, 5, 51, 5,213, 0, 9, 0,121, 64, 30, 7, 17, 1, 2, 1, 2, 17, 6, 7, 6, 66, 7, - 2, 3, 0,175, 8, 5, 6, 1, 7, 2, 28, 4, 54, 7, 28, 0, 4, 10, 16,252,236,252,236, 17, 57, 57, 49, 0, 47, 60,236, 50, - 57, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 4,237, 89, 34,178, 31, 11, 1, 1, 93, 64, 48, 54, 2, 56, 7, 72, 2, 71, 7, -105, 2,102, 7,128, 2, 7, 6, 1, 9, 6, 21, 1, 26, 6, 70, 1, 73, 6, 87, 1, 88, 6,101, 1,105, 6,121, 6,133, 1,138, - 6,149, 1,154, 6,159, 11, 16, 93, 0, 93, 19, 33, 1, 17, 51, 17, 33, 1, 17, 35,201, 1, 16, 2,150,196,254,240,253,106,196, - 5,213,251, 31, 4,225,250, 43, 4,225,251, 31, 0, 2, 0,115,255,227, 5,217, 5,240, 0, 11, 0, 23, 0, 35, 64, 19, 6,149, - 18, 0,149, 12,145, 18,140, 24, 9, 25, 15, 51, 3, 25, 21, 16, 24, 16,252,236,252,236, 49, 0, 16,228,244,236, 16,238, 48, 1, - 34, 0, 17, 16, 0, 51, 50, 0, 17, 16, 0, 39, 32, 0, 17, 16, 0, 33, 32, 0, 17, 16, 0, 3, 39,220,254,253, 1, 3,220,220, - 1, 1,254,255,220, 1, 58, 1,120,254,136,254,198,254,197,254,135, 1,121, 5, 76,254,184,254,229,254,230,254,184, 1, 72, 1, - 26, 1, 27, 1, 72,164,254, 91,254,158,254,159,254, 91, 1,164, 1, 98, 1, 98, 1,165, 0, 0, 0, 2, 0,201, 0, 0, 4,141, - 5,213, 0, 8, 0, 19, 0, 58, 64, 24, 1,149, 16, 0,149, 9,129, 18, 16, 10, 8, 2, 4, 0, 5, 25, 13, 63, 17, 0, 28, 9, - 4, 20, 16,252,236, 50,252,236, 17, 23, 57, 49, 0, 47,244,236,212,236, 48, 64, 11, 15, 21, 31, 21, 63, 21, 95, 21,175, 21, 5, - 1, 93, 1, 17, 51, 50, 54, 53, 52, 38, 35, 37, 33, 50, 4, 21, 20, 4, 43, 1, 17, 35, 1,147,254,141,154,154,141,254, 56, 1, -200,251, 1, 1,254,255,251,254,202, 5, 47,253,207,146,135,134,146,166,227,219,221,226,253,168, 0, 2, 0,115,254,248, 5,217, - 5,240, 0, 11, 0, 29, 0, 82, 64, 42, 17, 16, 2, 15, 1, 12, 13, 12, 14, 1, 13, 13, 12, 66, 15, 30, 12, 6,149, 18, 0,149, - 24,145, 18,140, 13, 30, 13, 27, 15, 12, 3, 9, 25, 27, 51, 3, 25, 21, 16, 30, 16,252,236,252,236, 17, 57, 57, 17, 57, 49, 0, - 16,196,228,244,236, 16,238, 57, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 23, 57, 89, 34, 1, 34, 0, 17, 16, 0, - 51, 50, 0, 17, 16, 0, 19, 1, 35, 39, 14, 1, 35, 32, 0, 17, 16, 0, 33, 32, 0, 17, 16, 2, 3, 39,220,254,253, 1, 3,220, -220, 1, 1,254,255, 63, 1, 10,244,221, 33, 35, 16,254,197,254,135, 1,121, 1, 59, 1, 58, 1,120,209, 5, 76,254,184,254,229, -254,230,254,184, 1, 72, 1, 26, 1, 27, 1, 72,250,207,254,221,239, 2, 2, 1,165, 1, 97, 1, 98, 1,165,254, 91,254,158,254, -252,254,142, 0, 0, 2, 0,201, 0, 0, 5, 84, 5,213, 0, 19, 0, 28, 0,177, 64, 53, 9, 8, 7, 3, 10, 6, 17, 3, 4, 3, - 5, 17, 4, 4, 3, 66, 6, 4, 0, 21, 3, 4, 21,149, 9, 20,149, 13,129, 11, 4, 5, 6, 3, 17, 9, 0, 28, 22, 14, 5, 10, - 25, 25, 4, 17, 63, 20, 10, 28, 12, 4, 29, 16,252,236, 50,252,196,236, 17, 23, 57, 17, 57, 57, 57, 49, 0, 47, 60,244,236,212, -236, 18, 57, 18, 57, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 17, 23, 57, 89, 34,178, 64, 30, 1, 1, 93, 64, 66, -122, 19, 1, 5, 0, 5, 1, 5, 2, 6, 3, 7, 4, 21, 0, 21, 1, 20, 2, 22, 3, 23, 4, 37, 0, 37, 1, 37, 2, 38, 3, 39, - 6, 38, 7, 38, 8, 38, 9, 32, 30, 54, 1, 54, 2, 70, 1, 70, 2,104, 5,117, 4,117, 5,119, 19,136, 6,136, 7,152, 6,152, - 7, 31, 93, 0, 93, 1, 30, 1, 23, 19, 35, 3, 46, 1, 43, 1, 17, 35, 17, 33, 32, 22, 21, 20, 6, 1, 17, 51, 50, 54, 53, 52, - 38, 35, 3,141, 65,123, 62,205,217,191, 74,139,120,220,202, 1,200, 1, 0,252,131,253,137,254,146,149,149,146, 2,188, 22,144, -126,254,104, 1,127,150, 98,253,137, 5,213,214,216,141,186, 2, 79,253,238,135,131,131,133, 0, 0, 1, 0,135,255,227, 4,162, - 5,240, 0, 39, 0,126, 64, 60, 13, 12, 2, 14, 11, 2, 30, 31, 30, 8, 9, 2, 7, 10, 2, 31, 31, 30, 66, 10, 11, 30, 31, 4, - 21, 1, 0, 21,161, 20,148, 24,149, 17, 4,149, 0,148, 37,145, 17,140, 40, 30, 10, 11, 31, 27, 7, 0, 34, 27, 25, 14, 45, 7, - 25, 20, 34, 40, 16,220,196,236,252,236,228, 17, 18, 57, 57, 57, 57, 49, 0, 16,228,244,228,236, 16,238,246,238, 16,198, 17, 23, - 57, 48, 75, 83, 88, 7, 16, 14,237, 17, 23, 57, 7, 16, 14,237, 17, 23, 57, 89, 34,178, 15, 41, 1, 1, 93,182, 31, 41, 47, 41, - 79, 41, 3, 93, 1, 21, 46, 1, 35, 34, 6, 21, 20, 22, 31, 1, 30, 1, 21, 20, 4, 33, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, - 52, 38, 47, 1, 46, 1, 53, 52, 36, 51, 50, 22, 4, 72,115,204, 95,165,179,119,166,122,226,215,254,221,254,231,106,239,128,123, -236,114,173,188,135,154,123,226,202, 1, 23,245,105,218, 5,164,197, 55, 54,128,118, 99,101, 31, 25, 43,217,182,217,224, 48, 47, -208, 69, 70,136,126,110,124, 31, 24, 45,192,171,198,228, 38, 0, 0, 1,255,250, 0, 0, 4,233, 5,213, 0, 7, 0, 74, 64, 14, - 6, 2,149, 0,129, 4, 1, 64, 3, 28, 0, 64, 5, 8, 16,212,228,252,228, 49, 0, 47,244,236, 50, 48, 1, 75,176, 10, 84, 88, -189, 0, 8, 0, 64, 0, 1, 0, 8, 0, 8,255,192, 56, 17, 55, 56, 89, 64, 19, 0, 9, 31, 0, 16, 1, 16, 2, 31, 7, 16, 9, - 64, 9,112, 9,159, 9, 9, 93, 3, 33, 21, 33, 17, 35, 17, 33, 6, 4,239,253,238,203,253,238, 5,213,170,250,213, 5, 43, 0, - 0, 1, 0,178,255,227, 5, 41, 5,213, 0, 17, 0, 64, 64, 22, 8, 2, 17, 11, 0, 5,149, 14,140, 9, 0,129, 18, 8, 28, 10, - 56, 1, 28, 0, 65, 18, 16,252, 75,176, 16, 84, 88,185, 0, 0,255,192, 56, 89,236,252,236, 49, 0, 16,228, 50,244,236, 17, 57, - 57, 57, 57, 48, 1,182, 31, 19,143, 19,159, 19, 3, 93, 19, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 16, 0, 33, 32, 0, 17, -178,203,174,195,194,174,203,254,223,254,230,254,229,254,223, 5,213,252,117,240,211,211,240, 3,139,252, 92,254,220,254,214, 1, - 42, 1, 36, 0, 0, 1, 0, 16, 0, 0, 5,104, 5,213, 0, 6, 0,183, 64, 39, 4, 17, 5, 6, 5, 3, 17, 2, 3, 6, 6, 5, - 3, 17, 4, 3, 0, 1, 0, 2, 17, 1, 1, 0, 66, 3, 4, 1,175, 0, 6, 4, 3, 2, 0, 5, 5, 1, 7, 16,212,196, 23, 57, - 49, 0, 47,236, 50, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34,178, 80, 8, 1, - 1, 93, 64, 98, 0, 3, 42, 3, 71, 4, 71, 5, 90, 3,125, 3,131, 3, 7, 6, 0, 7, 2, 8, 4, 9, 6, 21, 1, 20, 2, 26, - 4, 26, 5, 42, 0, 38, 1, 38, 2, 41, 4, 41, 5, 37, 6, 32, 8, 56, 0, 51, 1, 51, 2, 60, 4, 60, 5, 55, 6, 72, 0, 69, - 1, 69, 2, 73, 4, 73, 5, 71, 6, 89, 0, 86, 6,102, 2,105, 4,105, 5,122, 0,118, 1,118, 2,121, 4,121, 5,117, 6,128, - 8,152, 0,151, 6, 41, 93, 0, 93, 33, 1, 51, 9, 1, 51, 1, 2, 74,253,198,211, 1,217, 1,218,210,253,199, 5,213,251, 23, - 4,233,250, 43, 0, 1, 0, 68, 0, 0, 7,166, 5,213, 0, 12, 1,123, 64, 73, 5, 26, 6, 5, 9, 10, 9, 4, 26, 10, 9, 3, - 26, 10, 11, 10, 2, 26, 1, 2, 11, 11, 10, 6, 17, 7, 8, 7, 5, 17, 4, 5, 8, 8, 7, 2, 17, 3, 2, 12, 0, 12, 1, 17, - 0, 0, 12, 66, 10, 5, 2, 3, 6, 3, 0,175, 11, 8, 12, 11, 10, 9, 8, 6, 5, 4, 3, 2, 1, 11, 7, 0, 13, 16,212,204, - 23, 57, 49, 0, 47, 60,236, 50, 50, 23, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 7, - 16, 8,237, 7, 16, 5,237, 7, 5,237, 7, 16, 8,237, 89, 34,178, 0, 14, 1, 1, 93, 64,242, 6, 2, 6, 5, 2, 10, 0, 10, - 0, 10, 18, 10, 40, 5, 36, 10, 32, 10, 62, 2, 62, 5, 52, 10, 48, 10, 76, 2, 77, 5, 66, 10, 64, 10, 89, 2,106, 2,107, 5, -103, 10, 96, 10,123, 2,127, 2,124, 5,127, 5,128, 10,150, 2,149, 5, 29, 7, 0, 9, 2, 8, 3, 0, 4, 6, 5, 0, 5, 0, - 6, 1, 7, 4, 8, 0, 8, 7, 9, 0, 9, 4, 10, 10, 12, 0, 14, 26, 3, 21, 4, 21, 8, 25, 12, 16, 14, 32, 4, 33, 5, 32, - 6, 32, 7, 32, 8, 35, 9, 36, 10, 37, 11, 32, 14, 32, 14, 60, 2, 58, 3, 53, 4, 51, 5, 48, 8, 54, 9, 57, 11, 63, 12, 48, - 14, 70, 0, 70, 1, 74, 2, 64, 4, 69, 5, 64, 5, 66, 6, 66, 7, 66, 8, 64, 8, 64, 9, 68, 10, 77, 12, 64, 14, 64, 14, 88, - 2, 86, 8, 89, 12, 80, 14,102, 2,103, 3, 97, 4, 98, 5, 96, 6, 96, 7, 96, 8,100, 9,100, 10,100, 11,119, 0,118, 1,123, - 2,120, 3,119, 4,116, 5,121, 6,121, 7,119, 8,112, 8,120, 12,127, 12,127, 14,134, 2,135, 3,136, 4,137, 5,133, 9,138, - 11,143, 14,151, 4,159, 14,175, 14, 91, 93, 0, 93, 19, 51, 9, 1, 51, 9, 1, 51, 1, 35, 9, 1, 35, 68,204, 1, 58, 1, 57, -227, 1, 58, 1, 57,205,254,137,254,254,197,254,194,254, 5,213,251, 18, 4,238,251, 18, 4,238,250, 43, 5, 16,250,240, 0, 0, - 0, 1, 0, 61, 0, 0, 5, 59, 5,213, 0, 11, 0,102, 64, 6, 13, 4, 6, 0, 10, 12, 16,212,196,220,196,196, 49,180,128, 0, -127, 10, 2, 93, 0, 64, 5, 3, 0,175, 9, 6, 47, 60,236, 50, 48, 75,176, 66, 80, 88, 64, 20, 7, 17, 6, 6, 5, 9, 17, 10, - 11, 10, 3, 17, 4, 5, 4, 1, 17, 0, 11, 0, 5, 7, 16,236, 7, 16,236, 7, 16,236, 7, 16,236, 64, 20, 11, 10, 3, 7, 0, - 8, 9, 4, 7, 0, 5, 9, 4, 6, 1, 2, 10, 3, 6, 1, 15, 15, 15, 15, 89, 19, 51, 9, 1, 51, 9, 1, 35, 9, 1, 35, 1, -129,217, 1,115, 1,117,217,254, 32, 2, 0,217,254, 92,254, 89,218, 2, 21, 5,213,253,213, 2, 43,253, 51,252,248, 2,123,253, -133, 3, 29, 0, 0, 1,255,252, 0, 0, 4,231, 5,213, 0, 8, 0,148, 64, 40, 3, 17, 4, 5, 4, 2, 17, 1, 2, 5, 5, 4, - 2, 17, 3, 2, 8, 0, 8, 1, 17, 0, 0, 8, 66, 2, 3, 0,175, 6, 2, 7, 4, 64, 5, 28, 0, 64, 7, 9, 16,212,228,252, -228, 18, 57, 49, 0, 47,236, 50, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34,178, - 0, 10, 1, 1, 93, 64, 60, 5, 2, 20, 2, 53, 2, 48, 2, 48, 5, 48, 8, 70, 2, 64, 2, 64, 5, 64, 8, 81, 2, 81, 5, 81, - 8,101, 2,132, 2,147, 2, 16, 22, 1, 26, 3, 31, 10, 38, 1, 41, 3, 55, 1, 56, 3, 64, 10,103, 1,104, 3,120, 3,112, 10, -159, 10, 13, 93, 0, 93, 3, 51, 9, 1, 51, 1, 17, 35, 17, 4,217, 1,158, 1,155,217,253,240,203, 5,213,253,154, 2,102,252, -242,253, 57, 2,199, 0, 0, 0, 0, 1, 0, 92, 0, 0, 5, 31, 5,213, 0, 9, 0,144, 64, 27, 3, 17, 7, 8, 7, 8, 17, 2, - 3, 2, 66, 8,149, 0,129, 3,149, 5, 8, 3, 0, 1, 66, 4, 0, 6, 10, 16,220, 75,176, 9, 84, 75,176, 10, 84, 91, 88,185, - 0, 6,255,192, 56, 89,196,212,228, 17, 57, 57, 49, 0, 47,236,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, 34, - 1, 64, 64, 5, 2, 10, 7, 24, 7, 41, 2, 38, 7, 56, 7, 72, 2, 71, 7, 72, 8, 9, 5, 3, 11, 8, 0, 11, 22, 3, 26, 8, - 16, 11, 47, 11, 53, 3, 57, 8, 63, 11, 71, 3, 74, 8, 79, 11, 85, 3, 89, 8,102, 3,105, 8,111, 11,119, 3,120, 8,127, 11, -159, 11, 22, 93, 0, 93, 19, 33, 21, 1, 33, 21, 33, 53, 1, 33,115, 4,149,252, 80, 3,199,251, 61, 3,176,252,103, 5,213,154, -251,111,170,154, 4,145, 0, 0, 0, 1, 0,176,254,242, 2, 88, 6, 20, 0, 7, 0, 59, 64, 15, 4,169, 6,178, 2,169, 0,177, - 8, 5, 1, 3, 67, 0, 8, 16,220, 75,176, 12, 84, 88,185, 0, 0, 0, 64, 56, 89, 75,176, 18, 84, 75,176, 19, 84, 91, 88,185, - 0, 0,255,192, 56, 89,252,204, 50, 49, 0, 16,252,236,244,236, 48, 19, 33, 21, 35, 17, 51, 21, 33,176, 1,168,240,240,254, 88, - 6, 20,143,249,252,143, 0, 0, 0, 1, 0, 0,255, 66, 2,178, 5,213, 0, 3, 0, 45, 64, 20, 2, 26, 1, 1, 0, 0, 26, 3, - 3, 2, 66, 1,159, 0,129, 4, 2, 0, 1, 3, 47,196, 57, 57, 49, 0, 16,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5, -237, 89, 34, 19, 1, 35, 1,170, 2, 8,170,253,248, 5,213,249,109, 6,147, 0, 0, 1, 0,199,254,242, 2,111, 6, 20, 0, 7, - 0, 48, 64, 16, 3,169, 1,178, 5,169, 0,177, 8, 0, 67, 4, 6, 2, 4, 8, 16,252, 75,176, 15, 84, 75,176, 16, 84, 91, 88, -185, 0, 2, 0, 64, 56, 89, 60,220,236, 49, 0, 16,252,236,244,236, 48, 1, 17, 33, 53, 51, 17, 35, 53, 2,111,254, 88,239,239, - 6, 20,248,222,143, 6, 4,143, 0, 1, 0,217, 3,168, 5,219, 5,213, 0, 6, 0, 24, 64, 10, 3, 4, 1, 0,129, 7, 3, 1, - 5, 7, 16,220,204, 57, 49, 0, 16,244,204, 50, 57, 48, 9, 1, 35, 9, 1, 35, 1, 3,188, 2, 31,201,254, 72,254, 72,201, 2, - 31, 5,213,253,211, 1,139,254,117, 2, 45, 0, 0, 1,255,236,254, 29, 4, 20,254,172, 0, 3, 0, 15,181, 0,169, 1, 0, 2, - 4, 16,196,196, 49, 0,212,236, 48, 1, 21, 33, 53, 4, 20,251,216,254,172,143,143, 0, 0, 0, 0, 1, 0,170, 4,240, 2,137, - 6,102, 0, 3, 0, 49, 64, 9, 1,180, 0,179, 4, 3, 68, 1, 4, 16,220,236, 49, 0, 16,244,236, 48, 0, 75,176, 9, 84, 75, -176, 14, 84, 91, 88,189, 0, 4,255,192, 0, 1, 0, 4, 0, 4, 0, 64, 56, 17, 55, 56, 89, 9, 1, 35, 1, 1,111, 1, 26,153, -254,186, 6,102,254,138, 1,118, 0, 2, 0,123,255,227, 4, 45, 4,123, 0, 10, 0, 37, 0,188, 64, 39, 25, 31, 11, 23, 9, 14, - 0,169, 23, 6,185, 14, 17, 32,134, 31,186, 28,185, 35,184, 17,140, 23, 12, 0, 23, 3, 24, 13, 9, 8, 11, 31, 3, 8, 20, 69, - 38, 16,252,236,204,212,236, 50, 50, 17, 57, 57, 49, 0, 47,196,228,244,252,244,236, 16,198,238, 16,238, 17, 57, 17, 57, 18, 57, - 48, 64,110, 48, 29, 48, 30, 48, 31, 48, 32, 48, 33, 48, 34, 63, 39, 64, 29, 64, 30, 64, 31, 64, 32, 64, 33, 64, 34, 80, 29, 80, - 30, 80, 31, 80, 32, 80, 33, 80, 34, 80, 39,112, 39,133, 29,135, 30,135, 31,135, 32,135, 33,133, 34,144, 39,160, 39,240, 39, 30, - 48, 30, 48, 31, 48, 32, 48, 33, 64, 30, 64, 31, 64, 32, 64, 33, 80, 30, 80, 31, 80, 32, 80, 33, 96, 30, 96, 31, 96, 32, 96, 33, -112, 30,112, 31,112, 32,112, 33,128, 30,128, 31,128, 32,128, 33, 24, 93, 1, 93, 1, 34, 6, 21, 20, 22, 51, 50, 54, 61, 1, 55, - 17, 35, 53, 14, 1, 35, 34, 38, 53, 52, 54, 51, 33, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 2,190,223,172,129,111, -153,185,184,184, 63,188,136,172,203,253,251, 1, 2,167,151, 96,182, 84,101,190, 90,243,240, 2, 51,102,123, 98,115,217,180, 41, - 76,253,129,170,102, 97,193,162,189,192, 18,127,139, 46, 46,170, 39, 39,252, 0, 0, 2, 0,186,255,227, 4,164, 6, 20, 0, 11, - 0, 28, 0, 56, 64, 25, 3,185, 12, 15, 9,185, 24, 21,140, 15,184, 27,151, 25, 0, 18, 18, 71, 24, 12, 6, 8, 26, 70, 29, 16, -252,236, 50, 50,244,236, 49, 0, 47,236,228,244,196,236, 16,198,238, 48,182, 96, 30,128, 30,160, 30, 3, 1, 93, 1, 52, 38, 35, - 34, 6, 21, 20, 22, 51, 50, 54, 1, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 39, 21, 35, 17, 51, 3,229,167,146,146,167,167, -146,146,167,253,142, 58,177,123,204, 0,255,255,204,123,177, 58,185,185, 2, 47,203,231,231,203,203,231,231, 2, 82,100, 97,254, -188,254,248,254,248,254,188, 97,100,168, 6, 20, 0, 1, 0,113,255,227, 3,231, 4,123, 0, 25, 0, 63, 64, 27, 0,134, 1,136, - 4, 14,134, 13,136, 10,185, 17, 4,185, 23,184, 17,140, 26, 7, 18, 13, 0, 72, 20, 69, 26, 16,252,228, 50,236, 49, 0, 16,228, -244,236, 16,254,244,238, 16,245,238, 48, 64, 11, 15, 27, 16, 27,128, 27,144, 27,160, 27, 5, 1, 93, 1, 21, 46, 1, 35, 34, 6, - 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 0, 17, 16, 0, 33, 50, 22, 3,231, 78,157, 80,179,198,198,179, 80,157, 78, 77, -165, 93,253,254,214, 1, 45, 1, 6, 85,162, 4, 53,172, 43, 43,227,205,205,227, 43, 43,170, 36, 36, 1, 62, 1, 14, 1, 18, 1, - 58, 35, 0, 0, 0, 2, 0,113,255,227, 4, 90, 6, 20, 0, 16, 0, 28, 0, 56, 64, 25, 26,185, 0, 14, 20,185, 5, 8,140, 14, -184, 1,151, 3, 23, 4, 0, 8, 2, 71, 17, 18, 11, 69, 29, 16,252,236,244,236, 50, 50, 49, 0, 47,236,228,244,196,236, 16,196, -238, 48,182, 96, 30,128, 30,160, 30, 3, 1, 93, 1, 17, 51, 17, 35, 53, 14, 1, 35, 34, 2, 17, 16, 0, 51, 50, 22, 1, 20, 22, - 51, 50, 54, 53, 52, 38, 35, 34, 6, 3,162,184,184, 58,177,124,203,255, 0,255,203,124,177,253,199,167,146,146,168,168,146,146, -167, 3,182, 2, 94,249,236,168,100, 97, 1, 68, 1, 8, 1, 8, 1, 68, 97,254, 21,203,231,231,203,203,231,231, 0, 2, 0,113, -255,227, 4,127, 4,123, 0, 20, 0, 27, 0,112, 64, 36, 0, 21, 1, 9,134, 8,136, 5, 21,169, 1, 5,185, 12, 1,187, 24,185, - 18,184, 12,140, 28, 27, 21, 2, 8, 21, 8, 0, 75, 2, 18, 15, 69, 28, 16,252,236,244,236,196, 17, 18, 57, 49, 0, 16,228,244, -236,228, 16,238, 16,238, 16,244,238, 17, 18, 57, 48, 64, 41, 63, 29,112, 29,160, 29,208, 29,240, 29, 5, 63, 0, 63, 1, 63, 2, - 63, 21, 63, 27, 5, 44, 7, 47, 8, 47, 9, 44, 10,111, 0,111, 1,111, 2,111, 21,111, 27, 9, 93,113, 1, 93, 1, 21, 33, 30, - 1, 51, 50, 54, 55, 21, 14, 1, 35, 32, 0, 17, 16, 0, 51, 50, 0, 7, 46, 1, 35, 34, 6, 7, 4,127,252,178, 12,205,183,106, -199, 98, 99,208,107,254,244,254,199, 1, 41,252,226, 1, 7,184, 2,165,136,154,185, 14, 2, 94, 90,190,199, 52, 52,174, 42, 44, - 1, 56, 1, 10, 1, 19, 1, 67,254,221,196,151,180,174,158, 0, 0, 1, 0, 47, 0, 0, 2,248, 6, 20, 0, 19, 0, 89, 64, 28, - 5, 16, 1, 12, 8,169, 6, 1,135, 0,151, 14, 6,188, 10, 2, 19, 7, 0, 7, 9, 5, 8, 13, 15, 11, 76, 20, 16,252, 75,176, - 10, 84, 88,185, 0, 11, 0, 64, 56, 89, 75,176, 14, 84, 88,185, 0, 11,255,192, 56, 89, 60,196,252, 60,196,196, 18, 57, 57, 49, - 0, 47,228, 50,252,236, 16,238, 50, 18, 57, 57, 48, 1,182, 64, 21, 80, 21,160, 21, 3, 93, 1, 21, 35, 34, 6, 29, 1, 33, 21, - 33, 17, 35, 17, 35, 53, 51, 53, 52, 54, 51, 2,248,176, 99, 77, 1, 47,254,209,185,176,176,174,189, 6, 20,153, 80,104, 99,143, -252, 47, 3,209,143, 78,187,171, 0, 2, 0,113,254, 86, 4, 90, 4,123, 0, 11, 0, 40, 0, 74, 64, 35, 25, 12, 29, 9, 18,134, - 19, 22,185, 15, 3,185, 38, 35,184, 39,188, 9,185, 15,189, 26, 29, 38, 25, 0, 8, 12, 71, 6, 18, 18, 32, 69, 41, 16,252,196, -236,244,236, 50, 50, 49, 0, 47,196,228,236,228,244,196,236, 16,254,213,238, 17, 18, 57, 57, 48,182, 96, 42,128, 42,160, 42, 3, - 1, 93, 1, 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, 54, 23, 16, 2, 33, 34, 38, 39, 53, 30, 1, 51, 50, 54, 61, 1, 14, 1, 35, - 34, 2, 17, 16, 18, 51, 50, 22, 23, 53, 51, 3,162,165,149,148,165,165,148,149,165,184,254,254,250, 97,172, 81, 81,158, 82,181, -180, 57,178,124,206,252,252,206,124,178, 57,184, 2, 61,200,220,220,200,199,220,220,235,254,226,254,233, 29, 30,179, 44, 42,189, -191, 91, 99, 98, 1, 58, 1, 3, 1, 4, 1, 58, 98, 99,170, 0, 0, 1, 0,186, 0, 0, 4,100, 6, 20, 0, 19, 0, 52, 64, 25, - 3, 9, 0, 3, 14, 1, 6,135, 14, 17,184, 12,151, 10, 1, 2, 8, 0, 78, 13, 9, 8, 11, 70, 20, 16,252,236, 50,244,236, 49, - 0, 47, 60,236,244,196,236, 17, 18, 23, 57, 48,178, 96, 21, 1, 1, 93, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, - 17, 62, 1, 51, 50, 22, 4,100,184,124,124,149,172,185,185, 66,179,117,193,198, 2,164,253, 92, 2,158,159,158,190,164,253,135, - 6, 20,253,158,101,100,239, 0, 0, 2, 0,193, 0, 0, 1,121, 6, 20, 0, 3, 0, 7, 0, 43, 64, 14, 6,190, 4,177, 0,188, - 2, 5, 1, 8, 4, 0, 70, 8, 16,252, 60,236, 50, 49, 0, 47,228,252,236, 48, 64, 11, 16, 9, 64, 9, 80, 9, 96, 9,112, 9, - 5, 1, 93, 19, 51, 17, 35, 17, 51, 21, 35,193,184,184,184,184, 4, 96,251,160, 6, 20,233, 0, 0, 2,255,219,254, 86, 1,121, - 6, 20, 0, 11, 0, 15, 0, 68, 64, 28, 11, 2, 7, 0, 14,190, 12, 7,135, 5,189, 0,188, 12,177, 16, 8, 16, 5, 6, 79, 13, - 1, 8, 12, 0, 70, 16, 16,252, 60,236, 50,228, 57, 18, 57, 49, 0, 16,236,228,244,236, 16,238, 17, 18, 57, 57, 48, 64, 11, 16, - 17, 64, 17, 80, 17, 96, 17,112, 17, 5, 1, 93, 19, 51, 17, 20, 6, 43, 1, 53, 51, 50, 54, 53, 17, 51, 21, 35,193,184,163,181, - 70, 49,105, 76,184,184, 4, 96,251,140,214,192,156, 97,153, 6, 40,233, 0, 0, 0, 1, 0,186, 0, 0, 4,156, 6, 20, 0, 10, - 0,188, 64, 41, 8, 17, 5, 6, 5, 7, 17, 6, 6, 5, 3, 17, 4, 5, 4, 2, 17, 5, 5, 4, 66, 8, 5, 2, 3, 3,188, 0, -151, 9, 6, 5, 1, 4, 6, 8, 1, 8, 0, 70, 11, 16,252,236, 50,212,196, 17, 57, 49, 0, 47, 60,236,228, 23, 57, 48, 75, 83, - 88, 7, 16, 4,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 4,237, 89, 34,178, 16, 12, 1, 1, 93, 64, 95, 4, 2, 10, 8, 22, - 2, 39, 2, 41, 5, 43, 8, 86, 2,102, 2,103, 8,115, 2,119, 5,130, 2,137, 5,142, 8,147, 2,150, 5,151, 8,163, 2, 18, - 9, 5, 9, 6, 2, 11, 3, 10, 7, 40, 3, 39, 4, 40, 5, 43, 6, 43, 7, 64, 12,104, 3, 96, 12,137, 3,133, 4,137, 5,141, - 6,143, 7,154, 3,151, 7,170, 3,167, 5,182, 7,197, 7,214, 7,247, 3,240, 3,247, 4,240, 4, 26, 93,113, 0, 93, 19, 51, - 17, 1, 51, 9, 1, 35, 1, 17, 35,186,185, 2, 37,235,253,174, 2,107,240,253,199,185, 6, 20,252,105, 1,227,253,244,253,172, - 2, 35,253,221, 0, 1, 0,193, 0, 0, 1,121, 6, 20, 0, 3, 0, 34,183, 0,151, 2, 1, 8, 0, 70, 4, 16,252,236, 49, 0, - 47,236, 48, 64, 13, 16, 5, 64, 5, 80, 5, 96, 5,112, 5,240, 5, 6, 1, 93, 19, 51, 17, 35,193,184,184, 6, 20,249,236, 0, - 0, 1, 0,186, 0, 0, 7, 29, 4,123, 0, 34, 0, 90, 64, 38, 6, 18, 9, 24, 15, 0, 6, 29, 7, 21, 12,135, 29, 32, 3,184, - 27,188, 25, 16, 7, 0, 17, 15, 8, 8, 6, 80, 17, 8, 15, 80, 28, 24, 8, 26, 70, 35, 16,252,236, 50,252,252,252,236, 17, 18, - 57, 49, 0, 47, 60, 60,228,244, 60,196,236, 50, 17, 18, 23, 57, 48, 64, 19, 48, 36, 80, 36,112, 36,144, 36,160, 36,160, 36,191, - 36,223, 36,255, 36, 9, 1, 93, 1, 62, 1, 51, 50, 22, 21, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 52, 38, 35, 34, 6, - 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 4, 41, 69,192,130,175,190,185,114,117,143,166,185,114,119,141,166,185,185, 63,176, -121,122,171, 3,137,124,118,245,226,253, 92, 2,158,161,156,190,164,253,135, 2,158,162,155,191,163,253,135, 4, 96,174,103, 98, -124, 0, 0, 0, 0, 1, 0,186, 0, 0, 4,100, 4,123, 0, 19, 0, 54, 64, 25, 3, 9, 0, 3, 14, 1, 6,135, 14, 17,184, 12, -188, 10, 1, 2, 8, 0, 78, 13, 9, 8, 11, 70, 20, 16,252,236, 50,244,236, 49, 0, 47, 60,228,244,196,236, 17, 18, 23, 57, 48, -180, 96, 21,207, 21, 2, 1, 93, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 4,100,184,124, -124,149,172,185,185, 66,179,117,193,198, 2,164,253, 92, 2,158,159,158,190,164,253,135, 4, 96,174,101,100,239, 0, 2, 0,113, -255,227, 4,117, 4,123, 0, 11, 0, 23, 0, 74, 64, 19, 6,185, 18, 0,185, 12,184, 18,140, 24, 9, 18, 15, 81, 3, 18, 21, 69, - 24, 16,252,236,244,236, 49, 0, 16,228,244,236, 16,238, 48, 64, 35, 63, 25,123, 0,123, 6,127, 7,127, 8,127, 9,127, 10,127, - 11,123, 12,127, 13,127, 14,127, 15,127, 16,127, 17,123, 18,160, 25,240, 25, 17, 1, 93, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, - 52, 38, 39, 50, 0, 17, 16, 0, 35, 34, 0, 17, 16, 0, 2,115,148,172,171,149,147,172,172,147,240, 1, 18,254,238,240,241,254, -239, 1, 17, 3,223,231,201,201,231,232,200,199,233,156,254,200,254,236,254,237,254,199, 1, 57, 1, 19, 1, 20, 1, 56, 0, 0, - 0, 2, 0,186,254, 86, 4,164, 4,123, 0, 16, 0, 28, 0, 62, 64, 27, 26,185, 0, 14, 20,185, 5, 8,184, 14,140, 1,189, 3, -188, 29, 17, 18, 11, 71, 23, 4, 0, 8, 2, 70, 29, 16,252,236, 50, 50,244,236, 49, 0, 16,228,228,228,244,196,236, 16,196,238, - 48, 64, 9, 96, 30,128, 30,160, 30,224, 30, 4, 1, 93, 37, 17, 35, 17, 51, 21, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 1, - 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, 54, 1,115,185,185, 58,177,123,204, 0,255,255,204,123,177, 2, 56,167,146,146,167,167, -146,146,167,168,253,174, 6, 10,170,100, 97,254,188,254,248,254,248,254,188, 97, 1,235,203,231,231,203,203,231,231, 0, 0, 0, - 0, 2, 0,113,254, 86, 4, 90, 4,123, 0, 11, 0, 28, 0, 62, 64, 27, 3,185, 12, 15, 9,185, 24, 21,184, 15,140, 27,189, 25, -188, 29, 24, 12, 6, 8, 26, 71, 0, 18, 18, 69, 29, 16,252,236,244,236, 50, 50, 49, 0, 16,228,228,228,244,196,236, 16,198,238, - 48, 64, 9, 96, 30,128, 30,160, 30,224, 30, 4, 1, 93, 1, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, 6, 1, 14, 1, 35, 34, 2, - 17, 16, 0, 51, 50, 22, 23, 53, 51, 17, 35, 1, 47,167,146,146,168,168,146,146,167, 2,115, 58,177,124,203,255, 0,255,203,124, -177, 58,184,184, 2, 47,203,231,231,203,203,231,231,253,174,100, 97, 1, 68, 1, 8, 1, 8, 1, 68, 97,100,170,249,246, 0, 0, - 0, 1, 0,186, 0, 0, 3, 74, 4,123, 0, 17, 0, 48, 64, 20, 6, 11, 7, 0, 17, 11, 3,135, 14,184, 9,188, 7, 10, 6, 8, - 0, 8, 70, 18, 16,252,196,236, 50, 49, 0, 47,228,244,236,196,212,204, 17, 18, 57, 48,180, 80, 19,159, 19, 2, 1, 93, 1, 46, - 1, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 23, 3, 74, 31, 73, 44,156,167,185,185, 58,186,133, 19, 46, 28, 3, -180, 18, 17,203,190,253,178, 4, 96,174,102, 99, 5, 5, 0, 0, 0, 1, 0,111,255,227, 3,199, 4,123, 0, 39, 0,231, 64, 60, - 13, 12, 2, 14, 11, 83, 31, 30, 8, 9, 2, 7, 10, 83, 30, 31, 30, 66, 10, 11, 30, 31, 4, 21, 0,134, 1,137, 4, 20,134, 21, -137, 24,185, 17, 4,185, 37,184, 17,140, 40, 30, 10, 11, 31, 27, 7, 0, 82, 27, 8, 14, 7, 8, 20, 34, 69, 40, 16,252,196,236, -212,236,228, 17, 18, 57, 57, 57, 57, 49, 0, 16,228,244,236, 16,254,245,238, 16,245,238, 18, 23, 57, 48, 75, 83, 88, 7, 16, 14, -237, 17, 23, 57, 7, 14,237, 17, 23, 57, 89, 34,178, 0, 39, 1, 1, 93, 64,109, 28, 10, 28, 11, 28, 12, 46, 9, 44, 10, 44, 11, - 44, 12, 59, 9, 59, 10, 59, 11, 59, 12, 11, 32, 0, 32, 1, 36, 2, 40, 10, 40, 11, 42, 19, 47, 20, 47, 21, 42, 22, 40, 30, 40, - 31, 41, 32, 41, 33, 36, 39,134, 10,134, 11,134, 12,134, 13, 18, 0, 0, 0, 1, 2, 2, 6, 10, 6, 11, 3, 12, 3, 13, 3, 14, - 3, 15, 3, 16, 3, 25, 3, 26, 3, 27, 3, 28, 4, 29, 9, 39, 47, 41, 63, 41, 95, 41,127, 41,128, 41,144, 41,160, 41,240, 41, - 24, 93, 0, 93,113, 1, 21, 46, 1, 35, 34, 6, 21, 20, 22, 31, 1, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, - 53, 52, 38, 47, 1, 46, 1, 53, 52, 54, 51, 50, 22, 3,139, 78,168, 90,137,137, 98,148, 63,196,165,247,216, 90,195,108,102,198, - 97,130,140,101,171, 64,171,152,224,206,102,180, 4, 63,174, 40, 40, 84, 84, 64, 73, 33, 14, 42,153,137,156,182, 35, 35,190, 53, - 53, 89, 81, 75, 80, 37, 15, 36,149,130,158,172, 30, 0, 0, 0, 0, 1, 0, 55, 0, 0, 2,242, 5,158, 0, 19, 0, 56, 64, 25, - 14, 5, 8, 15, 3,169, 0, 17, 1,188, 8,135, 10, 11, 8, 9, 2, 4, 0, 8, 16, 18, 14, 70, 20, 16,252, 60,196,252, 60,196, - 50, 57, 57, 49, 0, 47,236,244, 60,196,236, 50, 17, 57, 57, 48,178,175, 21, 1, 1, 93, 1, 17, 33, 21, 33, 17, 20, 22, 59, 1, - 21, 35, 34, 38, 53, 17, 35, 53, 51, 17, 1,119, 1,123,254,133, 75,115,189,189,213,162,135,135, 5,158,254,194,143,253,160,137, - 78,154,159,210, 2, 96,143, 1, 62, 0, 0, 0, 0, 1, 0,174,255,227, 4, 88, 4, 96, 0, 19, 0, 54, 64, 25, 3, 9, 0, 3, - 14, 1, 6,135, 14, 17,140, 10, 1,188, 12, 13, 9, 8, 11, 78, 2, 8, 0, 70, 20, 16,252,236,244,236, 50, 49, 0, 47,228, 50, -244,196,236, 17, 18, 23, 57, 48,180, 96, 21,207, 21, 2, 1, 93, 19, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, - 1, 35, 34, 38,174,184,124,124,149,173,184,184, 67,177,117,193,200, 1,186, 2,166,253, 97,159,159,190,164, 2,123,251,160,172, -102, 99,240, 0, 0, 1, 0, 61, 0, 0, 4,127, 4, 96, 0, 6, 0,251, 64, 39, 3, 17, 4, 5, 4, 2, 17, 1, 2, 5, 5, 4, - 2, 17, 3, 2, 6, 0, 6, 1, 17, 0, 0, 6, 66, 2, 3, 0,191, 5, 6, 5, 3, 2, 1, 5, 4, 0, 7, 16,212, 75,176, 10, - 84, 88,185, 0, 0, 0, 64, 56, 89, 75,176, 20, 84, 75,176, 21, 84, 91, 88,185, 0, 0,255,192, 56, 89,196, 23, 57, 49, 0, 47, -236, 50, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34, 1, 64,142, 72, 2,106, 2, -123, 2,127, 2,134, 2,128, 2,145, 2,164, 2, 8, 6, 0, 6, 1, 9, 3, 9, 4, 21, 0, 21, 1, 26, 3, 26, 4, 38, 0, 38, - 1, 41, 3, 41, 4, 32, 8, 53, 0, 53, 1, 58, 3, 58, 4, 48, 8, 70, 0, 70, 1, 73, 3, 73, 4, 70, 5, 72, 6, 64, 8, 86, - 0, 86, 1, 89, 3, 89, 4, 80, 8,102, 0,102, 1,105, 3,105, 4,103, 5,104, 6, 96, 8,117, 0,116, 1,123, 3,123, 4,117, - 5,122, 6,133, 0,133, 1,137, 3,137, 4,137, 5,134, 6,150, 0,150, 1,151, 2,154, 3,152, 4,152, 5,151, 6,168, 5,167, - 6,176, 8,192, 8,223, 8,255, 8, 62, 93, 0, 93, 19, 51, 9, 1, 51, 1, 35, 61,195, 1, 94, 1, 94,195,254, 92,250, 4, 96, -252, 84, 3,172,251,160, 0, 0, 0, 1, 0, 86, 0, 0, 6, 53, 4, 96, 0, 12, 1,235, 64, 73, 5, 85, 6, 5, 9, 10, 9, 4, - 85, 10, 9, 3, 85, 10, 11, 10, 2, 85, 1, 2, 11, 11, 10, 6, 17, 7, 8, 7, 5, 17, 4, 5, 8, 8, 7, 2, 17, 3, 2, 12, - 0, 12, 1, 17, 0, 0, 12, 66, 10, 5, 2, 3, 6, 3, 0,191, 11, 8, 12, 11, 10, 9, 8, 6, 5, 4, 3, 2, 1, 11, 7, 0, - 13, 16,212, 75,176, 10, 84, 75,176, 17, 84, 91, 75,176, 18, 84, 91, 75,176, 19, 84, 91, 75,176, 11, 84, 91, 88,185, 0, 0, 0, - 64, 56, 89, 1, 75,176, 12, 84, 75,176, 13, 84, 91, 75,176, 16, 84, 91, 88,185, 0, 0,255,192, 56, 89,204, 23, 57, 49, 0, 47, - 60,236, 50, 50, 23, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 8,237, 7, 16, - 5,237, 7, 5,237, 7, 16, 8,237, 89, 34, 1, 64,255, 5, 2, 22, 2, 22, 5, 34, 10, 53, 10, 73, 2, 73, 5, 70, 10, 64, 10, - 91, 2, 91, 5, 85, 10, 80, 10,110, 2,110, 5,102, 10,121, 2,127, 2,121, 5,127, 5,135, 2,153, 2,152, 5,148, 10,188, 2, -188, 5,206, 2,199, 3,207, 5, 29, 5, 2, 9, 3, 6, 4, 11, 5, 10, 8, 11, 9, 4, 11, 5, 12, 21, 2, 25, 3, 22, 4, 26, - 5, 27, 8, 27, 9, 20, 11, 21, 12, 37, 0, 37, 1, 35, 2, 39, 3, 33, 4, 37, 5, 34, 6, 34, 7, 37, 8, 39, 9, 36, 10, 33, - 11, 35, 12, 57, 3, 54, 4, 54, 8, 57, 12, 48, 14, 70, 2, 72, 3, 70, 4, 64, 4, 66, 5, 64, 6, 64, 7, 64, 8, 68, 9, 68, - 10, 68, 11, 64, 14, 64, 14, 86, 0, 86, 1, 86, 2, 80, 4, 81, 5, 82, 6, 82, 7, 80, 8, 83, 9, 84, 10, 85, 11, 99, 0,100, - 1,101, 2,106, 3,101, 4,106, 5,106, 6,106, 7,110, 9, 97, 11,103, 12,111, 14,117, 0,117, 1,121, 2,125, 3,120, 4,125, - 5,122, 6,127, 6,122, 7,127, 7,120, 8,121, 9,127, 9,123, 10,118, 11,125, 12,135, 2,136, 5,143, 14,151, 0,151, 1,148, - 2,147, 3,156, 4,155, 5,152, 6,152, 7,153, 8, 64, 47,150, 12,159, 14,166, 0,166, 1,164, 2,164, 3,171, 4,171, 5,169, - 6,169, 7,171, 8,164, 12,175, 14,181, 2,177, 3,189, 4,187, 5,184, 9,191, 14,196, 2,195, 3,204, 4,202, 5,121, 93, 0, - 93, 19, 51, 27, 1, 51, 27, 1, 51, 1, 35, 11, 1, 35, 86,184,230,229,217,230,229,184,254,219,217,241,242,217, 4, 96,252,150, - 3,106,252,150, 3,106,251,160, 3,150,252,106, 0, 1, 0, 59, 0, 0, 4,121, 4, 96, 0, 11, 1, 67, 64, 70, 5, 17, 6, 7, - 6, 4, 17, 3, 4, 7, 7, 6, 4, 17, 5, 4, 1, 2, 1, 3, 17, 2, 2, 1, 11, 17, 0, 1, 0, 10, 17, 9, 10, 1, 1, 0, - 10, 17, 11, 10, 7, 8, 7, 9, 17, 8, 8, 7, 66, 10, 7, 4, 1, 4, 8, 0,191, 5, 2, 10, 7, 4, 1, 4, 8, 0, 2, 8, - 6, 12, 16,212, 75,176, 10, 84, 75,176, 15, 84, 91, 75,176, 16, 84, 91, 75,176, 17, 84, 91, 88,185, 0, 6, 0, 64, 56, 89, 75, -176, 20, 84, 88,185, 0, 6,255,192, 56, 89,196,212,196, 17, 23, 57, 49, 0, 47, 60,236, 50, 23, 57, 48, 75, 83, 88, 7, 16, 5, -237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34, 1, - 64,152, 10, 4, 4, 10, 26, 4, 21, 10, 38, 10, 61, 4, 49, 10, 85, 4, 87, 7, 88, 10,102, 10,118, 1,122, 4,118, 7,116, 10, -141, 4,130, 10,153, 4,159, 4,151, 7,146, 10,144, 10,166, 1,169, 4,175, 4,165, 7,163, 10,160, 10, 28, 10, 3, 4, 5, 5, - 9, 10, 11, 26, 3, 21, 5, 21, 9, 26, 11, 41, 3, 38, 5, 37, 9, 42, 11, 32, 13, 58, 1, 57, 3, 55, 5, 52, 7, 54, 9, 57, - 11, 48, 13, 73, 3, 70, 5, 69, 9, 74, 11, 64, 13, 89, 0, 86, 1, 89, 2, 89, 3, 87, 5, 86, 6, 89, 7, 86, 8, 86, 9, 89, - 11, 80, 13,111, 13,120, 1,127, 13,155, 1,148, 7,171, 1,164, 7,176, 13,207, 13,223, 13,255, 13, 47, 93, 0, 93, 9, 2, 35, - 9, 1, 35, 9, 1, 51, 9, 1, 4,100,254,107, 1,170,217,254,186,254,186,217, 1,179,254,114,217, 1, 41, 1, 41, 4, 96,253, -223,253,193, 1,184,254, 72, 2, 74, 2, 22,254,113, 1,143, 0, 0, 1, 0, 61,254, 86, 4,127, 4, 96, 0, 15, 1,139, 64, 67, - 7, 8, 2, 9, 17, 0, 15, 10, 17, 11, 10, 0, 0, 15, 14, 17, 15, 0, 15, 13, 17, 12, 13, 0, 0, 15, 13, 17, 14, 13, 10, 11, - 10, 12, 17, 11, 11, 10, 66, 13, 11, 9, 16, 0, 11, 5,135, 3,189, 14, 11,188, 16, 14, 13, 12, 10, 9, 6, 3, 0, 8, 15, 4, - 15, 11, 16, 16,212, 75,176, 10, 84, 75,176, 8, 84, 91, 88,185, 0, 11, 0, 64, 56, 89, 75,176, 20, 84, 88,185, 0, 11,255,192, - 56, 89,196,196, 17, 23, 57, 49, 0, 16,228, 50,244,236, 17, 57, 17, 57, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, - 7, 16, 8,237, 7, 16, 5,237, 7, 16, 8,237, 7, 5,237, 23, 50, 89, 34, 1, 64,240, 6, 0, 5, 8, 6, 9, 3, 13, 22, 10, - 23, 13, 16, 13, 35, 13, 53, 13, 73, 10, 79, 10, 78, 13, 90, 9, 90, 10,106, 10,135, 13,128, 13,147, 13, 18, 10, 0, 10, 9, 6, - 11, 5, 12, 11, 14, 11, 15, 23, 1, 21, 2, 16, 4, 16, 5, 23, 10, 20, 11, 20, 12, 26, 14, 26, 15, 39, 0, 36, 1, 36, 2, 32, - 4, 32, 5, 41, 8, 40, 9, 37, 10, 36, 11, 36, 12, 39, 13, 42, 14, 42, 15, 32, 17, 55, 0, 53, 1, 53, 2, 48, 4, 48, 5, 56, - 10, 54, 11, 54, 12, 56, 13, 57, 14, 57, 15, 48, 17, 65, 0, 64, 1, 64, 2, 64, 3, 64, 4, 64, 5, 64, 6, 64, 7, 64, 8, 66, - 9, 69, 10, 71, 13, 73, 14, 73, 15, 64, 17, 84, 0, 81, 1, 81, 2, 85, 3, 80, 4, 80, 5, 86, 6, 85, 7, 86, 8, 87, 9, 87, - 10, 85, 11, 85, 12, 89, 14, 89, 15, 80, 17,102, 1,102, 2,104, 10,105, 14,105, 15, 96, 17,123, 8,120, 14,120, 15,137, 0,138, - 9,133, 11,133, 12,137, 13,137, 14,137, 15,153, 9,149, 11,149, 12,154, 14,154, 15,164, 11,164, 12,171, 14,171, 15,176, 17,207, - 17,223, 17,255, 17,101, 93, 0, 93, 5, 14, 1, 43, 1, 53, 51, 50, 54, 63, 1, 1, 51, 9, 1, 51, 2,147, 78,148,124,147,108, - 76, 84, 51, 33,254, 59,195, 1, 94, 1, 94,195,104,200,122,154, 72,134, 84, 4, 78,252,148, 3,108, 0, 0, 0, 0, 1, 0, 88, - 0, 0, 3,219, 4, 96, 0, 9, 0,157, 64, 26, 8, 17, 2, 3, 2, 3, 17, 7, 8, 7, 66, 8,169, 0,188, 3,169, 5, 8, 3, - 1, 0, 4, 1, 6, 10, 16,220, 75,176, 11, 84, 75,176, 12, 84, 91, 88,185, 0, 6,255,192, 56, 89, 75,176, 19, 84, 88,185, 0, - 6, 0, 64, 56, 89,196, 50,196, 17, 57, 57, 49, 0, 47,236,244,236, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, 34, 1, - 64, 66, 5, 2, 22, 2, 38, 2, 71, 2, 73, 7, 5, 11, 8, 15, 11, 24, 3, 27, 8, 43, 8, 32, 11, 54, 3, 57, 8, 48, 11, 64, - 1, 64, 2, 69, 3, 64, 4, 64, 5, 67, 8, 87, 3, 89, 8, 95, 11, 96, 1, 96, 2,102, 3, 96, 4, 96, 5, 98, 8,127, 11,128, - 11,175, 11, 27, 93, 0, 93, 19, 33, 21, 1, 33, 21, 33, 53, 1, 33,113, 3,106,253, 76, 2,180,252,125, 2,180,253,101, 4, 96, -168,252,219,147,168, 3, 37, 0, 0, 1, 1, 0,254,178, 4, 23, 6, 20, 0, 36, 0,119, 64, 52, 25, 15, 21, 11, 6, 37, 9, 26, - 16, 21, 29, 11, 5, 32, 33, 3, 0, 11,169, 9, 0,169, 1,192, 9, 21,169, 19,177, 37, 12, 9, 10, 5, 36, 22, 25, 0, 29, 10, - 5, 19, 2, 20, 0, 32, 25, 67, 10, 15, 5, 37, 16,212, 75,176, 12, 84, 88,185, 0, 5, 0, 64, 56, 89, 60,196,252, 60,196, 50, - 57, 57, 17, 18, 57, 17, 18, 57, 57, 17, 18, 57, 57, 49, 0, 16,252,236,196,244,236, 16,238, 18, 23, 57, 18, 57, 17, 57, 57, 17, - 18, 57, 17, 18, 57, 57, 48, 1,178, 0, 38, 1, 93, 5, 21, 35, 34, 38, 61, 1, 52, 38, 43, 1, 53, 51, 50, 54, 61, 1, 52, 54, - 59, 1, 21, 35, 34, 6, 29, 1, 20, 6, 7, 30, 1, 29, 1, 20, 22, 51, 4, 23, 62,249,169,108,142, 61, 61,143,107,169,249, 62, - 68,141, 86, 91,110,111, 90, 86,141,190,144,148,221,239,151,116,143,115,149,240,221,147,143, 88,141,248,157,142, 25, 27,142,156, -248,141, 88, 0, 0, 1, 1, 4,254, 29, 1,174, 6, 29, 0, 3, 0, 18,183, 1, 0,177, 4, 0, 5, 2, 4, 16,212,236, 49, 0, - 16,252,204, 48, 1, 17, 35, 17, 1,174,170, 6, 29,248, 0, 8, 0, 0, 0, 0, 0, 1, 1, 0,254,178, 4, 23, 6, 20, 0, 36, - 0,135, 64, 54, 31, 37, 27, 22, 12, 15, 8, 27, 11, 21, 25, 15, 4, 5, 32, 3, 0, 25,169, 27, 0,169, 35,192, 27, 15,169, 17, -177, 37, 28, 25, 26, 21, 15, 1, 4, 0, 8, 26, 21, 35, 18, 4, 0, 26, 31, 21, 67, 16, 0, 11, 4, 37, 16,212, 75,176, 10, 84, - 88,185, 0, 4,255,192, 56, 89, 75,176, 14, 84, 88,185, 0, 4, 0, 64, 56, 89, 60,196, 50,252, 60,196, 17, 18, 57, 57, 17, 18, - 57, 17, 18, 57, 57, 17, 18, 57, 57, 49, 0, 16,252,236,196,244,236, 16,238, 18, 23, 57, 17, 18, 57, 57, 17, 57, 17, 57, 57, 17, - 18, 57, 48, 1,178, 0, 38, 1, 93, 5, 51, 50, 54, 61, 1, 52, 54, 55, 46, 1, 61, 1, 52, 38, 43, 1, 53, 51, 50, 22, 29, 1, - 20, 22, 59, 1, 21, 35, 34, 6, 29, 1, 20, 6, 43, 1, 1, 0, 70,140, 85, 90,111,111, 90, 85,140, 70, 63,249,167,108,142, 62, - 62,142,108,167,249, 63,190, 86,143,248,156,142, 27, 25,142,157,248,142, 87,143,147,221,240,149,115,143,116,151,239,221,148, 0, - 0, 1, 0,217, 1,211, 5,219, 3, 49, 0, 29, 0, 35, 64, 16, 1, 16, 27, 12, 0, 19, 4,156, 27, 19,156, 12, 30, 0, 15, 30, - 16,212,196, 49, 0, 16,212,252,212,236, 16,192, 17, 18, 57, 57, 48, 1, 21, 14, 1, 35, 34, 39, 38, 39, 38, 39, 38, 35, 34, 6, - 7, 53, 62, 1, 51, 50, 23, 22, 23, 22, 23, 22, 51, 50, 54, 5,219,105,179, 97,110,146, 11, 5, 7, 15,155, 94, 88,172, 98,105, -179, 97,110,147, 10, 5, 8, 14,155, 94, 86,169, 3, 49,178, 79, 68, 59, 4, 2, 3, 5, 62, 77, 83,178, 79, 69, 60, 4, 2, 3, - 5, 62, 76, 0, 0, 2, 1, 53, 0, 0, 2, 0, 5,213, 0, 3, 0, 9, 0, 98, 64, 15, 7, 0,131, 2,129, 4, 8, 7, 4, 0, - 3, 5, 1, 0, 10, 16,252, 60,236, 50, 57, 57, 49, 0, 47,244,252,204, 48, 1, 75,176, 11, 84, 88,189, 0, 10, 0, 64, 0, 1, - 0, 10, 0, 10,255,192, 56, 17, 55, 56, 89, 1, 75,176, 15, 84, 75,176, 16, 84, 91, 75,176, 19, 84, 91, 88,189, 0, 10,255,192, - 0, 1, 0, 10, 0, 10, 0, 64, 56, 17, 55, 56, 89,182, 0, 11, 32, 11, 80, 11, 3, 93, 1, 35, 53, 51, 17, 35, 17, 19, 51, 19, - 2, 0,203,203,203, 21,162, 20, 4,215,254,250, 43, 2,143, 1,101,254,155, 0, 0, 2, 0,172,254,199, 4, 35, 5,152, 0, 6, - 0, 33, 0, 81, 64, 43, 19, 22, 20, 0, 15, 12, 1, 11, 7,134, 8,136, 11, 16,134, 15,136, 12,185, 20, 22, 11,185, 29, 31, 28, -184, 22,140, 34, 28, 21, 0, 9, 30, 19, 11, 15, 7, 4, 18, 25, 34, 16,220,236,212, 60,212, 60, 60,236, 50, 50, 49, 0, 16,228, -244, 60,196,236, 16,196,254,244,238, 16,245,238, 18, 57, 17, 18, 57, 17, 18, 57, 48, 37, 17, 14, 1, 21, 20, 22, 1, 21, 46, 1, - 39, 3, 62, 1, 55, 21, 14, 1, 7, 17, 35, 17, 38, 0, 17, 16, 0, 55, 17, 51, 19, 30, 1, 2,166,147,164,164, 2, 16, 74,136, - 68, 1, 70,137, 72, 65,137, 77,102,241,254,247, 1, 9,241,102, 1, 73,137,131, 3, 88, 18,226,184,185,226, 3,161,172, 41, 42, - 3,252,160, 5, 42, 39,170, 30, 35, 7,254,228, 1, 32, 20, 1, 51, 1, 1, 1, 2, 1, 50, 22, 1, 31,254,225, 4, 33, 0, 0, - 0, 1, 0,129, 0, 0, 4, 98, 5,240, 0, 27, 0, 96, 64, 33, 7, 22, 8, 1,134, 0, 18, 10,169, 20, 8, 12, 4,160, 0,148, - 25,145, 16, 12,160, 14, 0, 13, 9, 11, 7, 28, 19, 15, 21, 17, 28, 16,220, 60,204,204,252, 60,196,212,196, 49, 0, 47,236, 50, -244,228,236, 16,212, 60,238, 50, 16,238, 17, 57, 57, 48, 1, 75,176, 12, 84, 88,189, 0, 28,255,192, 0, 1, 0, 28, 0, 28, 0, - 64, 56, 17, 55, 56, 89,180, 54, 1, 54, 2, 2, 0, 93, 1, 21, 46, 1, 35, 34, 6, 29, 1, 33, 21, 33, 17, 33, 21, 33, 53, 51, - 17, 35, 53, 51, 53, 16, 54, 51, 50, 22, 4, 78, 76,136, 61,148,116, 1,135,254,121, 2, 45,252, 31,236,199,199,214,232, 61,151, - 5,180,182, 41, 41,155,212,215,143,254, 47,170,170, 1,209,143,238, 1, 5,243, 31, 0, 0, 0, 0, 2, 0, 94, 0, 82, 4,188, - 4,178, 0, 35, 0, 47, 0,131, 64, 73, 3, 9, 27, 21, 4, 45, 30, 0, 39, 28, 2, 33, 29, 12, 18, 45, 20, 11, 10, 3, 19, 15, - 1, 29, 45,185, 19,235, 15,236, 39,185, 29,235, 33, 48, 30, 12, 0, 18, 4, 42, 36, 20, 48, 28, 21, 27, 42, 29, 19, 28, 24, 9, - 3, 36, 11, 10, 1, 3, 2, 36, 40, 2,115, 6,116, 42, 40, 28,115, 24, 48, 16,220,228,236,244,228,236, 18, 23, 57, 18, 57, 57, - 17, 18, 57, 57, 18, 57, 57, 17, 18, 57, 17, 18, 23, 57, 49, 0, 16,212,228,236,244,228,236, 16,192, 17, 18, 23, 57, 18, 57, 57, - 17, 18, 57, 57, 17, 57, 57, 18, 23, 57, 48, 1, 55, 23, 7, 30, 1, 21, 20, 6, 7, 23, 7, 39, 14, 1, 35, 34, 38, 39, 7, 39, - 55, 46, 1, 53, 52, 54, 55, 39, 55, 23, 62, 1, 51, 50, 22, 19, 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, 54, 3,123,207,114,206, - 37, 36, 38, 40,209,114,207, 59,116, 61, 58,120, 61,207,113,207, 37, 37, 38, 38,207,115,207, 55,116, 64, 60,117, 92,155,114,112, -158,157,113,113,156, 3,225,209,115,206, 59,119, 62, 63,115, 57,207,113,207, 40, 38, 37, 37,207,115,206, 62,118, 58, 64,116, 56, -206,115,207, 39, 37, 36,254,124,112,154,154,112,114,156,157, 0, 0, 1, 0, 82, 0, 0, 4,195, 5,213, 0, 24, 0,198, 64, 70, - 16, 2, 17, 22, 17, 15, 2, 14, 15, 22, 22, 17, 15, 2, 16, 15, 8, 13, 8, 14, 2, 13, 13, 8, 66, 15, 11, 9, 4, 0,211, 23, - 6, 18, 11,211, 20, 9, 16, 13,129, 2, 12, 9, 14, 3, 5, 22, 15, 3, 21, 18, 16, 3, 0, 17,102, 19, 0,101, 1, 28, 13,102, - 10, 5,101, 7, 3, 25, 16,212, 60,236, 50,236,252,236, 50,236, 18, 23, 57, 18, 57, 57, 17, 23, 57, 49, 0, 47,228, 50,212, 60, -236, 50,212, 60,236, 50, 17, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 5,237, 89, 34, 1, - 75,176, 12, 84, 88,189, 0, 25,255,192, 0, 1, 0, 25, 0, 25, 0, 64, 56, 17, 55, 56, 89, 64, 40,134, 15,144, 15,166, 15,160, - 15,181, 15, 5, 39, 12, 39, 13, 39, 14, 41, 16, 40, 17, 40, 18, 55, 14, 57, 16,135, 12,136, 18,166, 13,165, 14,170, 16,169, 17, - 14, 93, 0, 93, 1, 33, 17, 35, 17, 33, 53, 33, 53, 39, 33, 53, 33, 1, 51, 9, 1, 51, 1, 33, 21, 33, 7, 21, 33, 4,141,254, - 99,201,254, 96, 1,160, 84,254,180, 1, 8,254,195,190, 1,123, 1,121,191,254,194, 1, 8,254,181, 84, 1,159, 1,199,254, 57, - 1,199,123, 51,155,123, 2, 74,253, 68, 2,188,253,182,123,155, 51, 0, 0, 0, 0, 2, 1, 4,254,162, 1,174, 5,152, 0, 3, - 0, 7, 0, 28, 64, 13, 1,245, 0, 4,245, 5, 8, 4, 0, 5, 6, 2, 8, 16,220, 60,236, 50, 49, 0, 16,212,236,212,236, 48, - 1, 17, 35, 17, 19, 17, 35, 17, 1,174,170,170,170, 1,152,253, 10, 2,246, 4, 0,253, 10, 2,246, 0, 0, 0, 0, 2, 0, 92, -255, 61, 3,162, 5,240, 0, 11, 0, 62, 0,145, 64, 60, 47, 48, 42, 6, 0, 23, 29, 48, 54, 4, 13, 39,138, 38, 13,138, 12, 42, -198, 38,197, 35, 16,198, 12,197, 60,145, 35, 63, 47, 6, 0, 23, 48, 4, 19, 29, 45, 9, 54, 3, 19, 87, 57, 45, 87, 32, 9, 87, - 12, 34, 26, 57, 38, 34, 3, 87, 51, 63, 16,220,236,228,196,212,228,236,212,236, 16,238, 17, 57, 17, 18, 57, 17, 23, 57, 57, 49, - 0, 16,196,244,228,236, 16,230,238, 16,238, 16,238, 17, 23, 57, 57, 57, 17, 18, 57, 48, 1, 75,176, 10, 84, 75,176, 11, 84, 91, - 75,176, 12, 84, 91, 75,176, 14, 84, 91, 88,189, 0, 63, 0, 64, 0, 1, 0, 63, 0, 63,255,192, 56, 17, 55, 56, 89, 1, 14, 1, - 21, 20, 22, 23, 62, 1, 53, 52, 38, 19, 21, 46, 1, 35, 34, 6, 21, 20, 23, 22, 23, 30, 1, 21, 20, 6, 7, 30, 1, 21, 20, 6, - 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 47, 1, 46, 1, 53, 52, 54, 55, 46, 1, 53, 52, 54, 51, 50, 22, 1,123, 63, 62, -139,250, 63, 62,143,204, 83,143, 56, 97,108,206, 26, 14,211,131, 92, 93, 62, 57,204,173, 73,154, 88, 87,148, 58,102,113,221, 25, -214,128, 93, 91, 59, 59,200,166, 73,153, 3,168, 46, 90, 46, 76,133,135, 45, 91, 46, 75,136, 2,147,164, 39, 39, 80, 71, 90,115, - 15, 8,119,154,101, 90,140, 53, 52,109, 64,142,168, 29, 29,164, 39, 39, 84, 76,102,123, 14,120,153,102, 91,143, 49, 44,112, 69, -130,159, 29, 0, 0, 2, 0,215, 5, 70, 3, 41, 6, 16, 0, 3, 0, 7, 0,146, 64, 14, 6, 2,206, 4, 0,205, 8, 1,100, 0, - 5,100, 4, 8, 16,220,252,212,236, 49, 0, 16,252, 60,236, 50, 48, 0, 75,176, 10, 84, 75,176, 13, 84, 91, 88,189, 0, 8, 0, - 64, 0, 1, 0, 8, 0, 8,255,192, 56, 17, 55, 56, 89, 1, 75,176, 12, 84, 75,176, 13, 84, 91, 75,176, 14, 84, 91, 75,176, 23, - 84, 91, 88,189, 0, 8,255,192, 0, 1, 0, 8, 0, 8, 0, 64, 56, 17, 55, 56, 89, 1, 75,176, 15, 84, 75,176, 25, 84, 91, 88, -189, 0, 8, 0, 64, 0, 1, 0, 8, 0, 8,255,192, 56, 17, 55, 56, 89, 64, 17, 96, 1, 96, 2, 96, 5, 96, 6,112, 1,112, 2, -112, 5,112, 6, 8, 93, 1, 51, 21, 35, 37, 51, 21, 35, 2, 94,203,203,254,121,203,203, 6, 16,202,202,202, 0, 0, 3, 1, 27, - 0, 0, 6,229, 5,205, 0, 23, 0, 47, 0, 73, 0, 67, 64, 38, 61,203, 62, 58,204, 65,202, 36, 49,203, 48, 52,204, 71,202, 24, -201, 0,200, 36,201, 12, 55, 97, 68, 61, 48, 94, 42, 9, 6, 68, 94, 30, 9, 6, 18, 74, 16,220,204,252,236, 16,254,237, 50, 16, -238, 49, 0, 47,238,246,254,253,238,214,238, 16,253,238,214,238, 48, 1, 50, 4, 23, 22, 18, 21, 20, 2, 7, 6, 4, 35, 34, 36, - 39, 38, 2, 53, 52, 18, 55, 54, 36, 23, 34, 6, 7, 14, 1, 21, 20, 22, 23, 30, 1, 51, 50, 54, 55, 62, 1, 53, 52, 38, 39, 46, - 1, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 4, 0,152, 1, 7, -109,109,108,108,109,109,254,249,152,152,254,249,109,109,108,108,109,109, 1, 7,152,131,226, 94, 94, 96, 96, 94, 94,226,131,132, -227, 94, 93, 93, 94, 92, 94,227,167, 66,130, 66,149,167,171,155, 64,122, 66, 67,137, 70,216,251,251,216, 73,136, 5,205,110,109, -109,254,250,154,152,254,251,109,109,110,110,109,109, 1, 5,152,154, 1, 6,109,109,110,103, 94, 94, 94,229,130,129,227, 94, 94, - 95, 95, 94, 93,226,131,133,227, 93, 94, 94,245,129, 33, 32,175,157,159,174, 31, 34,127, 29, 28,244,208,209,242, 28, 0, 0, 0, - 0, 3, 0,115, 1,213, 3, 59, 5,240, 0, 3, 0, 30, 0, 41, 0, 95, 64, 51, 40, 7, 37, 4, 31, 18, 24, 16, 2,227, 0, 31, -221, 16, 0,225, 37,221, 5, 10, 25,223, 24,222, 21,221, 10,224, 28,145, 42, 0, 24, 13, 31, 16, 34, 6, 2, 1, 40, 17, 6,107, - 4,108, 24, 34,107, 13, 42, 16,220,236,204,252,236, 50, 50,192,192, 17, 18, 57, 57, 17, 18, 57, 49, 0, 16,244,228,252,244,236, - 16,196,238,237,214,238, 16,238, 17, 18, 57, 18, 57, 17, 57, 57, 48, 19, 33, 21, 33, 1, 17, 35, 53, 14, 1, 35, 34, 38, 53, 52, - 54, 59, 1, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 5, 34, 6, 21, 20, 22, 51, 50, 54, 61, 1,139, 2,176,253, 80, - 2,174,149, 44,144, 93,128,152,191,188,182,117,117, 62,136, 68, 73,145, 69,183,179,254,236,161,126, 98, 82,104,130, 2, 80,123, - 2,184,254, 64,112, 63, 68,135,113,135,138, 4, 91, 91, 34, 34,127, 28, 28,176,240, 67, 79, 64, 77,144,114, 29, 0, 2, 0,158, - 0,141, 4, 37, 4, 35, 0, 6, 0, 13, 0,134, 64, 73, 3,232, 4, 5, 4, 2,232, 1, 2, 5, 5, 4, 2,232, 3, 2, 6, 0, - 6, 1,232, 0, 0, 6, 10,232, 11, 12, 11, 9,232, 8, 9, 12, 12, 11, 9,232, 10, 9, 13, 7, 13, 8,232, 7, 7, 13, 66, 9, - 2, 11, 4,231, 7, 0,166, 14, 9, 12, 5, 2, 7, 3, 0,111, 5, 10, 7,111, 12,110, 14, 16,252,252, 60,212,236, 50, 17, 57, - 17, 18, 57, 49, 0, 16,244, 60,236, 50, 57, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 4,237, - 7, 16, 4,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 4,237, 89, 34, 1, 21, 9, 1, 21, 1, 53, 19, 21, 9, 1, 21, 1, 53, - 4, 37,254,211, 1, 45,254, 43, 35,254,211, 1, 45,254, 43, 4, 35,191,254,244,254,244,191, 1,162, 82, 1,162,191,254,244,254, -244,191, 1,162, 82, 0, 0, 0, 0, 1, 0,217, 1, 31, 5,219, 3, 94, 0, 5, 0, 23, 64, 10, 4,156, 2, 0, 6, 3, 23, 1, - 0, 6, 16,220,212,236, 49, 0, 16,212,196,236, 48, 19, 33, 17, 35, 17, 33,217, 5, 2,168,251,166, 3, 94,253,193, 1,149, 0, - 0, 1, 0,100, 1,223, 2,127, 2,131, 0, 3, 0, 17,182, 0,156, 2, 4, 1, 0, 4, 16,220,204, 49, 0, 16,212,236, 48, 19, - 33, 21, 33,100, 2, 27,253,229, 2,131,164, 0, 0, 4, 1, 27, 0, 0, 6,229, 5,205, 0, 23, 0, 47, 0, 56, 0, 76, 0, 96, - 64, 54, 69, 66, 67, 63, 50,201, 72, 48,201, 57, 74, 67,202, 12, 57,202, 0,201, 24,200, 12,201, 36, 72, 69, 51, 48, 4, 49, 66, - 60, 63, 57, 54, 73, 49, 96, 75, 54, 96, 67, 60, 94, 18, 9, 30, 75, 94, 6, 9, 30, 95, 42, 77, 16,220,228,252,236, 16,254,253, -196,238, 16,238, 50, 17, 57, 57, 18, 57, 18, 23, 57, 49, 0, 47,238,246,254,237, 16,237, 50, 16,238,214,238, 57, 18, 57, 57, 48, - 1, 34, 6, 7, 14, 1, 21, 20, 22, 23, 30, 1, 51, 50, 54, 55, 62, 1, 53, 52, 38, 39, 46, 1, 39, 50, 4, 23, 22, 18, 21, 20, - 2, 7, 6, 4, 35, 34, 36, 39, 38, 2, 53, 52, 18, 55, 54, 36, 19, 35, 17, 51, 50, 54, 53, 52, 38, 39, 50, 22, 21, 20, 6, 7, - 30, 1, 31, 1, 35, 39, 46, 1, 43, 1, 17, 35, 17, 4, 0,131,226, 94, 94, 96, 96, 94, 94,226,131,132,227, 94, 93, 93, 94, 92, - 94,227,132,152, 1, 7,109,109,108,108,109,109,254,249,152,152,254,249,109,109,108,108,109,109, 1, 7,125,123,123,110, 87, 88, -102,176,174,105, 96, 24, 67, 46,137,172,129, 59, 73, 54, 66,155, 5,102, 94, 94, 94,229,130,129,227, 94, 94, 95, 95, 94, 93,226, -131,133,227, 93, 94, 94,103,110,109,109,254,250,154,152,254,251,109,109,110,110,109,109, 1, 5,152,154, 1, 6,109,109,110,254, - 98,254,236, 62, 75, 76, 63,103,119,121, 86,112, 17, 8, 77, 73,223,209, 96, 51,254,156, 3, 68, 0, 1, 0,213, 5, 98, 3, 43, - 5,246, 0, 3, 0, 47,183, 2,239, 0,238, 4, 1, 0, 4, 16,212,204, 49, 0, 16,252,236, 48, 0, 75,176, 9, 84, 75,176, 14, - 84, 91, 88,189, 0, 4,255,192, 0, 1, 0, 4, 0, 4, 0, 64, 56, 17, 55, 56, 89, 19, 33, 21, 33,213, 2, 86,253,170, 5,246, -148, 0, 0, 0, 0, 2, 0,195, 3,117, 3, 61, 5,240, 0, 11, 0, 26, 0, 32, 64, 17, 6,195, 21,196, 0,195, 12,145, 27, 9, - 90, 18, 91, 3, 90, 24, 27, 16,220,236,252,236, 49, 0, 16,244,236,252,236, 48, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, - 39, 50, 22, 23, 30, 1, 21, 20, 6, 35, 34, 38, 53, 52, 54, 2, 0, 80,110,110, 80, 80,110,111, 79, 64,118, 43, 46, 46,185,134, -135,180,184, 5,111,111, 80, 79,109,109, 79, 79,112,129, 49, 46, 45,114, 66,132,183,180,135,134,186, 0, 0, 0, 0, 2, 0,217, - 0, 0, 5,219, 5, 4, 0, 11, 0, 15, 0, 46, 64, 24, 5,208, 7, 3,156, 0,208, 9, 1, 12,156, 14, 13, 2, 21, 4, 0, 23, - 12, 8, 21, 10, 6, 16, 16,212, 60,236, 50,252, 60,236, 50, 49, 0, 47,236,212, 60,236,252, 60,236, 48, 1, 17, 33, 21, 33, 17, - 35, 17, 33, 53, 33, 17, 1, 33, 21, 33, 3,174, 2, 45,253,211,168,253,211, 2, 45,253,211, 5, 2,250,254, 5, 4,254,125,170, -254,125, 1,131,170, 1,131,251,166,170, 0, 0, 0, 1, 0, 94, 2,156, 2,180, 5,240, 0, 24, 0, 74, 64, 36, 0,125, 6, 4, - 0, 23,125, 6, 6, 4, 66, 4, 2, 0, 14,221, 15, 0,221, 2,247, 11,221, 15, 18,145, 25, 0, 14, 8,126, 1, 21, 14, 3, 25, - 16,220,196,212,196,236, 17, 57, 49, 0, 16,244,196,236,252,236, 16,238, 17, 18, 57, 48, 75, 83, 88, 7, 16, 5,237, 23, 50, 7, - 5,237, 89, 34, 1, 33, 21, 33, 53, 54, 55, 0, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 21, 20, 1, 6, 1, 12, 1, -168,253,170, 34, 63, 1, 88,104, 85, 52,122, 72, 77,133, 57,145,174,254,181, 56, 3, 14,114,110, 31, 56, 1, 49, 94, 66, 81, 35, - 35,123, 28, 28,132,108,139,254,228, 48, 0, 0, 0, 1, 0, 98, 2,141, 2,205, 5,240, 0, 40, 0, 72, 64, 39, 0, 21, 19, 10, -221, 9, 31,221, 32, 19,221, 21, 13,221, 9,248, 6,247, 28,221, 32,248, 35,145, 41, 22, 19, 0, 20, 25,126, 38, 16,126, 3, 20, - 31, 9, 41, 16,220,196,196,212,236,212,236, 17, 57, 57, 57, 49, 0, 16,244,228,236,252,228,236,212,236, 16,238, 16,238, 17, 18, - 57, 48, 1, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 43, 1, 53, 51, 50, 54, 53, 52, 38, 35, 34, - 6, 7, 53, 62, 1, 51, 50, 22, 21, 20, 6, 2, 12, 92,101,190,177, 57,125, 70, 52,119, 67,109,120,111,108, 86, 94, 94, 97,100, - 95, 40,102, 81, 73,128, 55,144,169, 90, 4, 96, 18,109, 82,124,134, 21, 20,121, 27, 26, 79, 70, 74, 76,108, 63, 60, 58, 61, 18, - 23,115, 17, 18,118, 99, 69, 96, 0, 1, 1,115, 4,238, 3, 82, 6,102, 0, 3, 0, 49, 64, 9, 2,180, 0,179, 4, 3, 68, 1, - 4, 16,212,236, 49, 0, 16,244,236, 48, 0, 75,176, 9, 84, 75,176, 14, 84, 91, 88,189, 0, 4,255,192, 0, 1, 0, 4, 0, 4, - 0, 64, 56, 17, 55, 56, 89, 1, 51, 1, 35, 2,139,199,254,186,153, 6,102,254,136, 0, 0, 0, 0, 1, 0,174,254, 86, 4,229, - 4, 96, 0, 32, 0, 77, 64, 37, 19, 25, 31, 3, 22, 6, 3, 9, 12, 3, 1, 18, 15, 6,135, 28, 22,140, 10, 1,188, 0,189, 33, - 25, 9, 18, 9, 8, 11, 78, 31, 2, 8, 0, 70, 33, 16,252,236, 50,244,236,196, 18, 57, 49, 0, 16,228,228, 50,244, 60,236,220, -196, 17, 23, 57, 17, 18, 23, 57, 48,182, 31, 34, 96, 34,207, 34, 3, 1, 93, 19, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, - 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 39, 14, 1, 35, 34, 38, 39, 17,174,184,138,135,148,149,184, 35, 37, 9, 32, 28, - 41, 73, 35, 69, 82, 15, 50,145, 98,102,143, 42,254, 86, 6, 10,253, 72,145,148,168,168, 2,141,252,162, 60, 57, 11, 12,148, 23, - 22, 78, 80, 79, 79, 78, 78,253,215, 0, 0, 0, 0, 1, 0,158,255, 59, 4, 57, 5,213, 0, 13, 0, 37, 64, 18, 8, 2, 4,193, - 0,129, 6, 2, 14, 0, 7, 93, 5, 3, 93, 1, 11, 14, 16,212,212,252,220,236, 57, 49, 0, 16,196, 50,244,236, 17, 57, 48, 1, - 33, 17, 35, 17, 35, 17, 35, 17, 46, 1, 53, 52, 36, 2,121, 1,192,141,190,142,215,235, 1, 4, 5,213,249,102, 6, 31,249,225, - 3, 78, 17,221,184,190,232, 0, 0, 1, 0,219, 2, 72, 1,174, 3, 70, 0, 3, 0, 18,183, 2,131, 0, 4, 1, 25, 0, 4, 16, -212,236, 49, 0, 16,212,236, 48, 19, 51, 21, 35,219,211,211, 3, 70,254, 0, 0, 0, 1, 1, 35,254,117, 2,193, 0, 0, 0, 19, - 0, 31, 64, 14, 9, 6, 10, 13,243, 6, 0, 19, 0, 16, 39, 3, 9, 20, 16,220,212,236,212,204, 49, 0, 47,212,252,196, 18, 57, - 48, 33, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 39, 2, 84, 55, 54,120,118, 46, 87, 43, 34, 74, - 47, 59, 60, 43, 45, 62,105, 48, 89, 91, 12, 12,131, 17, 15, 48, 46, 30, 87, 61, 0, 1, 0,137, 2,156, 2,197, 5,223, 0, 10, - 0, 44, 64, 24, 7, 0,221, 9, 3,221, 4, 2,221, 9,247, 5,145, 11, 8,124, 6, 93, 3,124, 1,124, 0, 11, 16,220,244,228, -252,228, 49, 0, 16,244,236,236,212,236, 16,238, 50, 48, 19, 51, 17, 7, 53, 55, 51, 17, 51, 21, 33,156,204,223,230,137,205,253, -215, 3, 10, 2, 99, 41,116, 39,253, 43,110, 0, 0, 3, 0, 96, 1,213, 3,100, 5,240, 0, 3, 0, 15, 0, 27, 0, 46, 64, 25, - 2,227, 0,225, 22,221, 10,224, 16,221, 4,145, 28, 0, 19, 13, 1, 25,107, 7,108, 19,107, 13, 28, 16,220,236,252,236, 57, 17, - 18, 57, 49, 0, 16,244,236,244,236,252,236, 48, 19, 33, 21, 33, 1, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 23, 34, 6, 21, - 20, 22, 51, 50, 54, 53, 52, 38,139, 2,176,253, 80, 1, 88,179,206,206,179,179,208,208,179,105,126,127,104,105,125,124, 2, 80, -123, 4, 27,221,191,191,219,220,190,191,221,115,161,136,133,160,160,133,137,160, 0, 2, 0,193, 0,141, 4, 72, 4, 35, 0, 6, - 0, 13, 0,134, 64, 73, 12,232, 13, 12, 9, 10, 9, 11,232, 10, 10, 9, 13,232, 7, 8, 7, 12,232, 11, 12, 8, 8, 7, 5,232, - 6, 5, 2, 3, 2, 4,232, 3, 3, 2, 6,232, 0, 1, 0, 5,232, 4, 5, 1, 1, 0, 66, 12, 5, 10, 3,231, 7, 0,166, 14, - 12, 8, 1, 5, 0, 8,111, 10, 7, 1,111, 3, 0,112, 14, 16,252, 60,252,212, 60,236, 18, 57, 17, 18, 57, 49, 0, 16,244, 60, -236, 50, 57, 57, 48, 75, 83, 88, 7, 16, 8,237, 7, 16, 4,237, 7, 16, 4,237, 7, 16, 8,237, 7, 16, 8,237, 7, 16, 4,237, - 7, 16, 4,237, 7, 16, 8,237, 89, 34, 19, 1, 21, 1, 53, 9, 1, 37, 1, 21, 1, 53, 9, 1,193, 1,213,254, 43, 1, 45,254, -211, 1,178, 1,213,254, 43, 1, 45,254,211, 4, 35,254, 94, 82,254, 94,191, 1, 12, 1, 12,191,254, 94, 82,254, 94,191, 1, 12, - 1, 12, 0, 0,255,255, 0,137,255,227, 7,127, 5,240, 16, 39, 5,206, 4,139,253,100, 16, 38, 0,123, 0, 0, 16, 7, 6, 90, - 3, 53, 0, 0,255,255, 0,137,255,227, 7, 63, 5,240, 16, 38, 0,123, 0, 0, 16, 39, 6, 90, 3, 53, 0, 0, 16, 7, 0,116, - 4,139,253,100,255,255, 0, 98,255,227, 7,127, 5,240, 16, 39, 5,206, 4,139,253,100, 16, 38, 0,117, 0, 0, 16, 7, 6, 90, - 3, 53, 0, 0, 0, 2, 0,143,255,227, 3,172, 5,213, 0, 32, 0, 36, 0,134, 64, 47, 32, 26, 5, 2, 4, 6, 25, 0, 16,134, - 15,136, 12, 0, 33,131, 35, 12,149, 19,140, 35,129, 37, 6, 34, 25, 22, 9, 5, 1, 0, 26, 34, 9, 0, 28, 1, 34, 28, 33, 38, - 15, 9, 28, 22, 37, 16,220,236,212,252,236,212,236, 17, 18, 57, 17, 18, 57, 17, 18, 57, 18, 57, 49, 0, 16,228,244,236, 16,254, -205, 16,244,238, 18, 57, 57, 23, 57, 48, 1, 75,176, 16, 84, 75,176, 18, 84, 91, 75,176, 19, 84, 91, 88,189, 0, 37,255,192, 0, - 1, 0, 37, 0, 37, 0, 64, 56, 17, 55, 56, 89, 64, 11,116, 4,116, 5,116, 6,116, 7,118, 28, 5, 93, 1, 51, 21, 20, 6, 15, - 1, 14, 1, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 52, 54, 63, 1, 62, 1, 55, 62, 1, 53, 19, 35, 53, 51, 1, -244,190, 55, 90, 90, 58, 51,131,109, 78,180, 96, 94,192,103,184,224, 73, 89, 88, 48, 38, 8, 7, 6,196,202,202, 4, 68,156,101, -130, 87, 88, 53, 94, 49, 89,110, 70, 67,188, 57, 56,194,159, 76,137, 86, 86, 47, 53, 25, 21, 60, 54, 1, 14,254,255,255, 0, 16, - 0, 0, 5,104, 5,213, 18, 38, 0, 36, 0, 0, 16, 7, 6,135, 4,188, 1,117,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 38, - 0, 36, 0, 0, 16, 7, 6,133, 4,188, 1,117,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 38, 0, 36, 0, 0, 17, 7, 6,136, - 4,188, 1,117, 0, 16,180, 5, 13, 17, 10, 7, 43, 64, 5, 15, 13, 0, 17, 2, 93, 49, 0, 0,255,255, 0, 16, 0, 0, 5,104, - 5,213, 18, 38, 0, 36, 0, 0, 17, 7, 6,134, 4,188, 1,117, 0, 20,180, 10, 20, 35, 5, 7, 43, 64, 9, 64, 20, 79, 35, 32, - 20, 47, 35, 4, 93, 49, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 38, 0, 36, 0, 0, 17, 7, 6,132, 4,188, 1,117, - 0, 20,180, 10, 18, 13, 5, 7, 43, 64, 9, 48, 18, 63, 13, 0, 18, 15, 13, 4, 93, 49, 0, 0, 0, 3, 0, 16, 0, 0, 5,104, - 7,109, 0, 11, 0, 14, 0, 33, 0,203, 64, 84, 12, 17, 13, 12, 27, 28, 27, 14, 17, 28, 27, 30, 17, 28, 27, 29, 17, 28, 28, 27, - 13, 17, 33, 15, 33, 12, 17, 14, 12, 15, 15, 33, 32, 17, 15, 33, 31, 17, 33, 15, 33, 66, 12, 27, 15, 13, 9, 3,193, 21, 9, 30, -149, 13, 9,142, 32, 28, 30, 29, 28, 24, 32, 31, 33, 13, 18, 6, 14, 24, 12, 6, 27, 0, 86, 24, 28, 15, 6, 86, 18, 28, 33, 34, - 16,212,196,212,236, 50, 16,212,238, 50, 17, 57, 17, 57, 17, 18, 57, 17, 57, 57, 17, 18, 57, 57, 49, 0, 47, 60,230,214,238, 16, -212,238, 17, 18, 57, 57, 57, 48, 75, 83, 88, 7, 16, 5,237, 7, 5,237, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 5,237, 7, 5, -237, 7, 5,237, 7, 16, 8,237, 89, 34,178, 32, 35, 1, 1, 93, 64, 32, 26, 12,115, 12,155, 12, 3, 7, 15, 8, 27, 80, 35,102, - 13,105, 14,117, 13,123, 14,121, 28,121, 29,118, 32,118, 33,128, 35, 12, 93, 0, 93, 1, 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, - 54, 3, 1, 33, 1, 46, 1, 53, 52, 54, 51, 50, 22, 21, 20, 6, 7, 1, 35, 3, 33, 3, 35, 3, 84, 89, 63, 64, 87, 88, 63, 63, - 89,152,254,240, 2, 33,254, 88, 61, 62,159,115,114,161, 63, 60, 2, 20,210,136,253, 95,136,213, 6, 90, 63, 89, 87, 65, 63, 88, - 88,254,243,253, 25, 3, 78, 41,115, 73,115,160,161,114, 70,118, 41,250,139, 1,127,254,129, 0, 0, 2, 0, 8, 0, 0, 7, 72, - 5,213, 0, 15, 0, 19, 0,135, 64, 57, 17, 17, 14, 15, 14, 16, 17, 15, 15, 14, 13, 17, 15, 14, 12, 17, 14, 15, 14, 66, 5,149, - 3, 11,149, 17, 1,149, 16,149, 0,129, 17, 7,149, 3,173, 13, 9, 17, 16, 15, 13, 12, 5, 14, 10, 0, 4, 8, 6, 2, 28, 18, - 10, 14, 20, 16,212,212, 60,236, 50,212,196,196, 17, 18, 23, 57, 49, 0, 47, 60,236,236,196,244,236,236, 16,238, 16,238, 48, 75, - 83, 88, 7, 16, 5,237, 7, 5,237, 7, 16, 5,237, 7, 16, 5,237, 89, 34,178,128, 21, 1, 1, 93, 64, 19,103, 17,119, 16,119, - 17,134, 12,133, 16,150, 17,144, 21,160, 21,191, 21, 9, 93, 1, 21, 33, 17, 33, 21, 33, 17, 33, 21, 33, 17, 33, 3, 35, 1, 23, - 1, 33, 17, 7, 53,253, 27, 2,199,253, 57, 2,248,252, 61,253,240,160,205, 2,113,139,254,182, 1,203, 5,213,170,254, 70,170, -253,227,170, 1,127,254,129, 5,213,158,252,240, 3, 16, 0, 0,255,255, 0,115,254,117, 5, 39, 5,240, 18, 38, 0, 38, 0, 0, - 16, 7, 0,122, 1, 45, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 38, 0, 40, 0, 0, 16, 7, 6,135, 4,158, 1,117, -255,255, 0,201, 0, 0, 4,139, 5,213, 18, 38, 0, 40, 0, 0, 16, 7, 6,133, 4,158, 1,117,255,255, 0,201, 0, 0, 4,139, - 5,213, 18, 38, 0, 40, 0, 0, 17, 7, 6,136, 4,158, 1,117, 0, 7, 64, 3, 64, 12, 1, 93, 49, 0, 0, 0,255,255, 0,201, - 0, 0, 4,139, 5,213, 18, 38, 0, 40, 0, 0, 17, 7, 6,132, 4,158, 1,117, 0, 9, 64, 5, 64, 12, 64, 16, 2, 93, 49, 0, -255,255, 0,201, 0, 0, 1,147, 5,213, 18, 38, 0, 44, 0, 0, 16, 7, 6,135, 3, 47, 1,117,255,255, 0,201, 0, 0, 1,147, - 5,213, 18, 38, 0, 44, 0, 0, 16, 7, 6,133, 3, 47, 1,117,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 38, 0, 44, 0, 0, - 17, 7, 6,136, 3, 47, 1,117, 0, 8,180, 1, 6, 10, 0, 7, 43, 49, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 38, - 0, 44, 0, 0, 17, 7, 6,132, 3, 47, 1,117, 0, 8,180, 0, 10, 7, 1, 7, 43, 49, 0, 0, 0, 2, 0, 10, 0, 0, 5,186, - 5,213, 0, 12, 0, 25, 0,103, 64, 32, 16, 9,169, 11, 13,149, 0,129, 18,149, 14, 11, 7, 7, 1, 25, 19, 4, 15, 13, 22, 25, - 4, 50, 10, 17, 13, 28, 8, 0,121, 26, 16,244, 60,236, 50,196,244,236, 16,196, 23, 57, 49, 0, 47,198, 50,238,246,238, 16,238, - 50, 48, 64, 40, 32, 27,127, 27,176, 27, 3,159, 9,159, 10,159, 11,159, 12,159, 14,159, 15,159, 16,159, 17,191, 9,191, 10,191, - 11,191, 12,191, 14,191, 15,191, 16,191, 17, 16, 93, 1, 93, 19, 33, 32, 0, 17, 16, 0, 41, 1, 17, 35, 53, 51, 19, 17, 33, 21, - 33, 17, 51, 32, 0, 17, 16, 0, 33,211, 1,160, 1,177, 1,150,254,105,254, 80,254, 96,201,201,203, 1, 80,254,176,243, 1, 53, - 1, 31,254,225,254,203, 5,213,254,151,254,128,254,126,254,150, 2,188,144, 1,227,254, 29,144,253,234, 1, 24, 1, 46, 1, 44, - 1, 23, 0, 0,255,255, 0,201, 0, 0, 5, 51, 5,213, 18, 38, 0, 49, 0, 0, 17, 7, 6,134, 4,254, 1,117, 0, 20,180, 0, - 19, 34, 4, 7, 43, 64, 9, 48, 19, 63, 34, 16, 19, 31, 34, 4, 93, 49, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, - 0, 50, 0, 0, 16, 7, 6,135, 5, 39, 1,117,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 0, 50, 0, 0, 16, 7, 6,133, - 5, 39, 1,117,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 0, 50, 0, 0, 17, 7, 6,136, 5, 39, 1,117, 0, 16,180, 15, - 26, 30, 21, 7, 43, 64, 5, 31, 26, 16, 30, 2, 93, 49, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 0, 50, 0, 0, - 17, 7, 6,134, 5, 39, 1,117, 0, 24,180, 3, 33, 48, 9, 7, 43, 64, 13, 48, 33, 63, 48, 32, 33, 47, 48, 16, 33, 31, 48, 6, - 93, 49, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 0, 50, 0, 0, 17, 7, 6,132, 5, 39, 1,117, 0, 20,180, 3, - 31, 26, 9, 7, 43, 64, 9, 64, 31, 79, 26, 16, 31, 31, 26, 4, 93, 49, 0, 0, 0, 1, 1, 25, 0, 63, 5,156, 4,197, 0, 11, - 0,133, 64, 77, 10,156, 11, 10, 7, 8, 7, 9,156, 8, 8, 7, 4,156, 3, 4, 7, 7, 6, 5,156, 6, 7, 6, 4,156, 5, 4, - 1, 2, 1, 3,156, 2, 2, 1, 11,156, 0, 1, 0, 10,156, 9, 10, 1, 1, 0, 66, 10, 8, 7, 6, 4, 2, 1, 0, 8, 5, 3, - 11, 9, 12, 11, 10, 9, 7, 5, 4, 3, 1, 8, 2, 0, 8, 6, 12, 16,212, 60,204, 50, 23, 57, 49, 0, 16,212, 60,204, 50, 23, - 57, 48, 75, 83, 88, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 5,237, 7, 16, 8,237, 7, 16, 5, -237, 7, 16, 8,237, 89, 34, 9, 2, 7, 9, 1, 39, 9, 1, 55, 9, 1, 5,156,254, 55, 1,201,119,254, 53,254, 53,118, 1,200, -254, 56,118, 1,203, 1,203, 4, 76,254, 53,254, 55,121, 1,203,254, 53,121, 1,201, 1,203,121,254, 53, 1,203, 0, 3, 0,102, -255,186, 5,229, 6, 23, 0, 9, 0, 19, 0, 43, 0,158, 64, 60, 29, 31, 26, 13, 43, 44, 19, 10, 1, 0, 4, 13, 41, 38, 32, 20, - 13, 4, 42, 38, 30, 26, 4,149, 38, 13,149, 26,145, 38,140, 44, 43, 44, 42, 20, 23, 16, 32, 30, 35, 19, 10, 1, 0, 4, 29, 41, - 16, 7, 31, 7, 25, 35, 51, 16, 25, 23, 16, 44, 16,252,236,252,236,192, 17, 18, 57, 57, 23, 57, 18, 57, 57, 17, 18, 57, 57, 17, - 57, 49, 0, 16,228,244,236, 16,238, 16,192, 16,192, 17, 18, 57, 57, 18, 57, 18, 23, 57, 18, 57, 17, 18, 57, 57, 48, 64, 42, 87, - 0, 90, 21, 87, 25, 85, 33,106, 21,101, 33,123, 21,118, 28,117, 33, 9, 70, 19, 89, 0, 86, 19,106, 0,100, 19,100, 28,106, 40, -124, 0,115, 19,118, 28,122, 40, 11, 93, 1, 93, 9, 1, 30, 1, 51, 50, 0, 17, 52, 38, 39, 46, 1, 35, 34, 0, 17, 20, 22, 23, - 7, 38, 2, 53, 16, 0, 33, 50, 22, 23, 55, 23, 7, 22, 18, 21, 16, 0, 33, 34, 38, 39, 7, 39, 4,182,253, 51, 62,161, 95,220, - 1, 1, 39,121, 61,161, 95,220,254,253, 39, 39,134, 78, 79, 1,121, 1, 59,130,221, 87,162,102,170, 78, 80,254,136,254,198,128, -221, 91,162,103, 4, 88,252,178, 64, 67, 1, 72, 1, 26,112,184,184, 64, 67,254,184,254,229,112,188, 68,158,102, 1, 8,160, 1, - 98, 1,165, 77, 75,191, 89,198,103,254,246,158,254,159,254, 91, 75, 75,191, 88,255,255, 0,178,255,227, 5, 41, 5,213, 18, 38, - 0, 56, 0, 0, 16, 7, 6,135, 4,238, 1,117,255,255, 0,178,255,227, 5, 41, 5,213, 18, 38, 0, 56, 0, 0, 16, 7, 6,133, - 4,238, 1,117,255,255, 0,178,255,227, 5, 41, 5,213, 18, 38, 0, 56, 0, 0, 17, 7, 6,136, 4,238, 1,117, 0, 20,180, 10, - 20, 24, 0, 7, 43, 64, 9, 47, 20, 32, 24, 31, 20, 16, 24, 4, 93, 49, 0, 0,255,255, 0,178,255,227, 5, 41, 5,213, 18, 38, - 0, 56, 0, 0, 17, 7, 6,132, 4,238, 1,117, 0, 28,180, 1, 25, 20, 9, 7, 43, 64, 17, 80, 25, 95, 20, 64, 25, 79, 20, 32, - 25, 47, 20, 16, 25, 31, 20, 8, 93, 49, 0, 0,255,255,255,252, 0, 0, 4,231, 5,213, 18, 38, 0, 60, 0, 0, 16, 7, 6,133, - 4,115, 1,117, 0, 2, 0,201, 0, 0, 4,141, 5,213, 0, 12, 0, 21, 0, 61, 64, 27, 14,149, 9, 13,149, 2,246, 0,129, 11, - 21, 15, 9, 3, 4, 1, 18, 25, 6, 63, 13, 10, 1, 28, 0, 4, 22, 16,252,236, 50, 50,252,236, 17, 23, 57, 49, 0, 47,244,252, -236,212,236, 48, 64, 9, 15, 23, 31, 23, 63, 23, 95, 23, 4, 1, 93, 19, 51, 17, 51, 50, 4, 21, 20, 4, 43, 1, 17, 35, 19, 17, - 51, 50, 54, 53, 52, 38, 35,201,202,254,251, 1, 1,254,255,251,254,202,202,254,141,154,153,142, 5,213,254,248,225,220,220,226, -254,174, 4, 39,253,209,146,134,134,145, 0, 0, 0, 1, 0,186,255,227, 4,172, 6, 20, 0, 47, 0,154, 64, 48, 45, 39, 33, 12, - 4, 6, 13, 32, 0, 4, 42, 22,134, 23, 26,185, 19, 42,185, 3,151, 19,140, 46, 12, 9, 13, 29, 32, 33, 39, 9, 8, 36, 39, 8, - 6, 29, 8, 36, 16, 22, 45, 8, 16, 0, 70, 48, 16,252,196,252,204, 16,198,238,212,238, 16,238, 17, 57, 57, 18, 57, 18, 57, 49, - 0, 47,228,254,238, 16,254,213,238, 18, 23, 57, 23, 57, 48, 64, 64, 15, 5, 15, 6, 15, 7, 15, 39, 15, 40,138, 12,138, 13, 7, - 10, 6, 10, 7, 10, 11, 10, 12, 10, 13, 10, 31, 13, 32, 10, 33, 12, 34, 4, 38, 25, 13, 25, 31, 25, 32, 58, 32, 58, 33, 77, 31, - 77, 32, 73, 33, 73, 34,106, 31,106, 32,165, 6,165, 7,166, 32, 24, 93, 1, 93, 19, 52, 54, 51, 50, 22, 23, 14, 1, 21, 20, 22, - 31, 1, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 47, 1, 46, 1, 53, 52, 54, 55, 46, 1, 35, 34, - 6, 21, 17, 35,186,239,218,208,219, 3,151,168, 58, 65, 57,166, 96,225,211, 64,136, 73, 80,140, 65,116,120, 59,101, 92, 96, 87, -167,151, 8,131,113,130,136,187, 4,113,200,219,232,224, 8,115, 96, 47, 81, 42, 37,106,142,100,172,183, 25, 24,164, 30, 29, 95, - 91, 63, 84, 62, 55, 59,135, 91,127,172, 29,103,112,139,131,251,147, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 6,102, 18, 38, - 0, 68, 0, 0, 17, 6, 0, 67, 82, 0, 0, 11, 64, 7, 63, 38, 47, 38, 31, 38, 3, 93, 49, 0,255,255, 0,123,255,227, 4, 45, - 6,102, 18, 38, 0, 68, 0, 0, 17, 6, 0,118, 82, 0, 0, 11, 64, 7, 63, 38, 47, 38, 31, 38, 3, 93, 49, 0,255,255, 0,123, -255,227, 4, 45, 6,102, 18, 38, 0, 68, 0, 0, 17, 6, 2, 31, 82, 0, 0, 8,180, 11, 40, 44, 20, 7, 43, 49,255,255, 0,123, -255,227, 4, 45, 6, 55, 18, 38, 0, 68, 0, 0, 17, 6, 2, 53, 82, 0, 0, 20,180, 20, 46, 60, 11, 7, 43, 64, 9, 32, 46, 47, - 60, 16, 46, 31, 60, 4, 93, 49,255,255, 0,123,255,227, 4, 45, 6, 16, 18, 38, 0, 68, 0, 0, 17, 6, 0,106, 82, 0, 0, 32, -180, 20, 45, 40, 11, 7, 43, 64, 21,127, 40,111, 40, 80, 45, 95, 40, 64, 45, 79, 40, 48, 45, 63, 40, 0, 45, 15, 40, 10, 93, 49, -255,255, 0,123,255,227, 4, 45, 7, 6, 18, 38, 0, 68, 0, 0, 17, 6, 2, 51, 82, 0, 0, 37, 64, 14, 38, 44, 20, 44, 38, 11, - 7, 50, 56, 20, 56, 50, 11, 7, 43, 16,196, 43, 16,196, 49, 0, 64, 9, 63, 53, 63, 47, 15, 53, 15, 47, 4, 93, 48, 0, 0, 0, - 0, 3, 0,123,255,227, 7,111, 4,123, 0, 6, 0, 51, 0, 62, 1, 3, 64, 67, 39, 45, 37, 61, 14, 13, 0, 52,169, 37, 22,134, - 21,136, 18, 0,169, 14, 58, 18,185, 28, 25, 46,134, 45,186, 42, 3,185, 14,187, 7, 49, 10,184, 31, 25,140, 37, 63, 52, 55, 38, - 6, 15, 0, 37, 55, 28, 7, 38, 15, 21, 0, 8, 13, 61, 38, 8, 15, 45, 55, 8, 34, 69, 63, 16,252,236,204,212,252, 60,212,236, -196, 17, 18, 57, 57, 17, 57, 17, 18, 57, 17, 18, 57, 49, 0, 16,196,228, 50,244, 60,196,228,252, 60,244,236, 16,196,238, 50, 16, -238, 16,244,238, 16,238, 17, 57, 17, 57, 17, 18, 57, 48, 64,129, 48, 43, 48, 44, 48, 45, 48, 46, 48, 47, 48, 48, 64, 43, 64, 44, - 64, 45, 64, 46, 64, 47, 64, 48, 80, 43, 80, 44, 80, 45, 80, 46, 80, 47, 80, 48,133, 43,133, 48,128, 64,144, 64,160, 64,176, 64, -192, 64,208, 64,224, 64,224, 64,240, 64, 29, 63, 0, 63, 6, 63, 13, 63, 14, 63, 15, 5, 48, 44, 48, 45, 48, 46, 48, 47, 64, 44, - 64, 45, 64, 46, 64, 47, 80, 44, 80, 45, 80, 46, 80, 47,111, 0,111, 6,111, 13,111, 14,111, 15, 96, 44, 96, 45, 96, 46, 96, 47, -112, 44,112, 45,112, 46,112, 47,128, 44,128, 45,128, 46,128, 47, 29, 93,113, 1, 93, 1, 46, 1, 35, 34, 6, 7, 3, 62, 1, 51, - 50, 0, 29, 1, 33, 30, 1, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 39, 14, 1, 35, 34, 38, 53, 52, 54, 51, 33, 53, 52, 38, 35, - 34, 6, 7, 53, 62, 1, 51, 50, 22, 3, 34, 6, 21, 20, 22, 51, 50, 54, 61, 1, 6,182, 1,165,137,153,185, 14, 68, 74,212,132, -226, 1, 8,252,178, 12,204,183,104,200,100,100,208,106,167,248, 77, 73,216,143,189,210,253,251, 1, 2,167,151, 96,182, 84,101, -190, 90,142,213,239,223,172,129,111,153,185, 2,148,151,180,174,158, 1, 48, 90, 94,254,221,250, 90,191,200, 53, 53,174, 42, 44, -121,119,120,120,187,168,189,192, 18,127,139, 46, 46,170, 39, 39, 96,254, 24,102,123, 98,115,217,180, 41, 0, 0,255,255, 0,113, -254,117, 3,231, 4,123, 18, 38, 0, 70, 0, 0, 16, 7, 0,122, 0,143, 0, 0,255,255, 0,113,255,227, 4,127, 6,102, 18, 38, - 0, 72, 0, 0, 16, 7, 0, 67, 0,139, 0, 0,255,255, 0,113,255,227, 4,127, 6,102, 18, 38, 0, 72, 0, 0, 16, 7, 0,118, - 0,139, 0, 0,255,255, 0,113,255,227, 4,127, 6,102, 18, 38, 0, 72, 0, 0, 17, 7, 2, 31, 0,139, 0, 0, 0, 8,180, 21, - 30, 34, 27, 7, 43, 49, 0, 0,255,255, 0,113,255,227, 4,127, 6, 16, 18, 38, 0, 72, 0, 0, 17, 7, 0,106, 0,139, 0, 0, - 0, 7, 64, 3, 64, 32, 1, 93, 49, 0, 0, 0,255,255,255,199, 0, 0, 1,166, 6,102, 18, 38, 0,243, 0, 0, 16, 7, 0, 67, -255, 29, 0, 0,255,255, 0,144, 0, 0, 2,111, 6,102, 18, 38, 0,243, 0, 0, 16, 7, 0,118,255, 29, 0, 0,255,255,255,222, - 0, 0, 2, 92, 6,102, 18, 38, 0,243, 0, 0, 17, 7, 2, 31,255, 29, 0, 0, 0, 8,180, 1, 6, 10, 0, 7, 43, 49, 0, 0, -255,255,255,244, 0, 0, 2, 70, 6, 16, 18, 38, 0,243, 0, 0, 17, 7, 0,106,255, 29, 0, 0, 0, 8,180, 0, 10, 7, 1, 7, - 43, 49, 0, 0, 0, 2, 0,113,255,227, 4,117, 6, 20, 0, 14, 0, 40, 1, 39, 64, 94, 37,123, 38, 37, 30, 35, 30, 36,123, 35, - 35, 30, 15,123, 35, 30, 40,123, 39, 40, 30, 35, 30, 38, 39, 40, 39, 37, 36, 37, 40, 40, 39, 34, 35, 34, 31, 32, 31, 33, 32, 32, - 31, 66, 40, 39, 38, 37, 34, 33, 32, 31, 8, 35, 30, 3, 15, 35, 3,185, 27, 9,185, 21,140, 27, 35,177, 41, 38, 39, 18, 12, 33, - 32, 24, 40, 37, 35, 34, 31, 5, 30, 15, 6, 12, 18, 18, 81, 6, 18, 24, 69, 41, 16,252,236,244,236, 17, 57, 57, 23, 57, 18, 57, - 57, 17, 18, 57, 57, 49, 0, 16,236,196,244,236, 16,238, 18, 57, 18, 57, 18, 23, 57, 48, 75, 83, 88, 7, 16, 14,201, 7, 16, 8, -201, 7, 16, 8,201, 7, 16, 14,201, 7, 16, 8,237, 7, 14,237, 7, 16, 5,237, 7, 16, 8,237, 89, 34,178, 63, 42, 1, 1, 93, - 64,118, 22, 37, 43, 31, 40, 34, 47, 35, 47, 36, 41, 37, 45, 38, 45, 39, 42, 40, 54, 37, 70, 37, 88, 32, 88, 33, 96, 32, 96, 33, -102, 34,117, 32,117, 33,117, 34, 19, 37, 35, 37, 36, 38, 38, 38, 39, 39, 40, 54, 36, 54, 37, 70, 36, 69, 37, 90, 32, 90, 33, 98, - 32, 98, 33,127, 0,127, 1,127, 2,122, 3,123, 9,127, 10,127, 11,127, 12,127, 13,127, 14,127, 15,127, 16,127, 17,127, 18,127, - 19,127, 20,123, 21,122, 27,122, 28,127, 29,127, 30,118, 32,118, 33,120, 34,160, 42,240, 42, 39, 93, 0, 93, 1, 46, 1, 35, 34, - 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 19, 22, 18, 21, 20, 0, 35, 34, 0, 17, 52, 0, 51, 50, 22, 23, 39, 5, 39, 37, 39, 51, - 23, 37, 23, 5, 3, 70, 50, 88, 41,167,185,174,146,145,174, 54, 9,126,114,254,228,230,231,254,229, 1, 20,221, 18, 52, 42,159, -254,193, 33, 1, 25,181,228,127, 1, 77, 33,254,217, 3,147, 17, 16,216,195,188,222,222,188,122,188, 1, 38,143,254,224,173,255, -254,201, 1, 55, 0,255,250, 1, 55, 5, 5,180,107, 99, 92,204,145,111, 97, 98,255,255, 0,186, 0, 0, 4,100, 6, 55, 18, 38, - 0, 81, 0, 0, 16, 7, 2, 53, 0,152, 0, 0,255,255, 0,113,255,227, 4,117, 6,102, 18, 38, 0, 82, 0, 0, 16, 6, 0, 67, -115, 0, 0, 0,255,255, 0,113,255,227, 4,117, 6,102, 18, 38, 0, 82, 0, 0, 16, 6, 0,118,115, 0, 0, 0,255,255, 0,113, -255,227, 4,117, 6,102, 18, 38, 0, 82, 0, 0, 17, 6, 2, 31,115, 0, 0, 8,180, 15, 26, 30, 21, 7, 43, 49,255,255, 0,113, -255,227, 4,117, 6, 55, 18, 38, 0, 82, 0, 0, 17, 6, 2, 53,115, 0, 0, 20,180, 21, 32, 46, 15, 7, 43, 64, 9, 32, 32, 47, - 46, 16, 32, 31, 46, 4, 93, 49,255,255, 0,113,255,227, 4,117, 6, 16, 18, 38, 0, 82, 0, 0, 17, 6, 0,106,115, 0, 0, 20, -180, 3, 31, 26, 9, 7, 43, 64, 9, 64, 31, 79, 26, 48, 31, 63, 26, 4, 93, 49, 0, 3, 0,217, 0,150, 5,219, 4,111, 0, 3, - 0, 7, 0, 11, 0, 41, 64, 20, 0,234, 2, 6,234, 4, 2, 8,156, 4, 10, 12, 9, 5, 1,114, 4, 0, 8, 12, 16,220,212, 60, -252, 60,196, 49, 0, 16,212,196,252,196, 16,238, 16,238, 48, 1, 51, 21, 35, 17, 51, 21, 35, 1, 33, 21, 33, 2,223,246,246,246, -246,253,250, 5, 2,250,254, 4,111,246,254, 18,245, 2, 65,170, 0, 3, 0, 72,255,162, 4,156, 4,188, 0, 9, 0, 19, 0, 43, - 0,228, 64, 60, 43, 44, 38, 31, 29, 26, 19, 10, 1, 0, 4, 13, 41, 38, 32, 20, 13, 4, 42, 38, 30, 26, 4,185, 38, 13,185, 26, -184, 38,140, 44, 43, 44, 42, 20, 23, 16, 32, 30, 35, 19, 10, 1, 0, 4, 16, 7, 31, 29, 7, 18, 35, 81, 41, 16, 18, 23, 69, 44, - 16,252,236, 50,244,236, 50,192, 17, 18, 23, 57, 18, 57, 57, 17, 18, 57, 57, 17, 57, 49, 0, 16,228,244,236, 16,238, 16,192, 16, -192, 17, 18, 57, 57, 18, 57, 18, 23, 57, 17, 57, 57, 17, 18, 57, 48, 64,112, 40, 1, 63, 45, 89, 20, 86, 28, 85, 29, 86, 32,106, - 21,102, 33,127, 0,123, 4,127, 5,127, 6,127, 7,127, 8,127, 9,127, 10,127, 11,127, 12,123, 13,122, 21,123, 26,127, 27,127, - 28,127, 29,127, 30,127, 31,127, 32,123, 33,127, 34,127, 35,127, 36,127, 37,123, 38,155, 25,149, 37,168, 25,160, 45,240, 45, 38, - 89, 0, 86, 19, 85, 29, 90, 40,105, 0,102, 19,101, 28,106, 40,122, 0,116, 19,118, 28,122, 40,137, 30,149, 24,154, 36,162, 24, -173, 36, 17, 93, 1, 93, 9, 1, 30, 1, 51, 50, 54, 53, 52, 38, 39, 46, 1, 35, 34, 6, 21, 20, 22, 23, 7, 46, 1, 53, 16, 0, - 51, 50, 22, 23, 55, 23, 7, 30, 1, 21, 16, 0, 35, 34, 38, 39, 7, 39, 3,137,254, 25, 41,103, 65,147,172, 20, 92, 42,103, 62, -151,169, 19, 20,125, 54, 54, 1, 17,241, 93,159, 67,139, 95,146, 53, 54,254,238,240, 96,161, 63,139, 96, 3, 33,253,176, 42, 40, -232,200, 79,117,154, 41, 41,235,211, 72,110, 46,151, 77,197,119, 1, 20, 1, 56, 51, 52,168, 79,179, 77,198,120,254,237,254,199, - 52, 51,168, 78,255,255, 0,174,255,227, 4, 88, 6,102, 18, 38, 0, 88, 0, 0, 16, 6, 0, 67,123, 0, 0, 0,255,255, 0,174, -255,227, 4, 88, 6,102, 18, 38, 0, 88, 0, 0, 16, 6, 0,118,123, 0, 0, 0,255,255, 0,174,255,227, 4, 88, 6,102, 18, 38, - 0, 88, 0, 0, 17, 6, 2, 31,123, 0, 0, 8,180, 11, 22, 26, 1, 7, 43, 49,255,255, 0,174,255,227, 4, 88, 6, 16, 18, 38, - 0, 88, 0, 0, 17, 6, 0,106,123, 0, 0, 24,180, 2, 26, 23, 10, 7, 43, 64, 13, 64, 26, 79, 23, 48, 26, 63, 23, 0, 26, 15, - 23, 6, 93, 49,255,255, 0, 61,254, 86, 4,127, 6,102, 18, 38, 0, 92, 0, 0, 16, 6, 0,118, 94, 0, 0, 0, 0, 2, 0,186, -254, 86, 4,164, 6, 20, 0, 16, 0, 28, 0, 62, 64, 27, 20,185, 5, 8, 26,185, 0, 14,140, 8,184, 1,189, 3,151, 29, 17, 18, - 11, 71, 23, 4, 0, 8, 2, 70, 29, 16,252,236, 50, 50,244,236, 49, 0, 16,236,228,228,244,196,236, 16,198,238, 48, 64, 9, 96, - 30,128, 30,160, 30,224, 30, 4, 1, 93, 37, 17, 35, 17, 51, 17, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 1, 52, 38, 35, 34, - 6, 21, 20, 22, 51, 50, 54, 1,115,185,185, 58,177,123,204, 0,255,255,204,123,177, 2, 56,167,146,146,167,167,146,146,167,168, -253,174, 7,190,253,162,100, 97,254,188,254,248,254,248,254,188, 97, 1,235,203,231,231,203,203,231,231, 0, 0,255,255, 0, 61, -254, 86, 4,127, 6, 16, 18, 38, 0, 92, 0, 0, 17, 6, 0,106, 94, 0, 0, 22,180, 24, 23, 18, 25, 7, 43, 64, 11, 48, 23, 63, - 18, 32, 23, 47, 18, 31, 18, 5, 93, 49, 0, 0,255,255, 0, 16, 0, 0, 5,104, 7, 49, 16, 39, 0,113, 0,188, 1, 59, 19, 6, - 0, 36, 0, 0, 0, 16,180, 14, 3, 2, 9, 7, 43, 64, 5, 64, 3, 79, 2, 2, 93, 49, 0, 0,255,255, 0,123,255,227, 4, 45, - 5,246, 16, 38, 0,113, 74, 0, 19, 6, 0, 68, 0, 0, 0, 16,180, 24, 3, 2, 15, 7, 43, 64, 5,111, 2,127, 3, 2, 93, 49, -255,255, 0, 16, 0, 0, 5,104, 7,146, 16, 39, 2, 49, 0,206, 1, 74, 19, 6, 0, 36, 0, 0, 0, 18,180, 24, 0, 8, 19, 7, - 43, 49, 0, 64, 5,111, 0,111, 8, 2, 93, 48,255,255, 0,123,255,227, 4, 45, 6, 31, 16, 38, 2, 49, 79,215, 19, 6, 0, 68, - 0, 0, 0, 8,180, 34, 0, 8, 25, 7, 43, 49,255,255, 0, 16,254,117, 5,165, 5,213, 16, 39, 2, 52, 2,228, 0, 0, 18, 6, - 0, 36, 0, 0,255,255, 0,123,254,117, 4,128, 4,123, 16, 39, 2, 52, 1,191, 0, 0, 18, 6, 0, 68, 0, 0,255,255, 0,115, -255,227, 5, 39, 5,240, 18, 38, 0, 38, 0, 0, 16, 7, 6,133, 5, 45, 1,117,255,255, 0,113,255,227, 3,231, 6,102, 18, 38, - 0, 70, 0, 0, 16, 7, 0,118, 0,137, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 16, 39, 6,136, 5, 76, 1,117, 19, 6, - 0, 38, 0, 0, 0, 9,178, 4, 4, 30, 16, 60, 61, 47, 49, 0,255,255, 0,113,255,227, 3,231, 6,102, 16, 39, 2, 31, 0,164, - 0, 0, 18, 6, 0, 70, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 16, 39, 6,140, 5, 76, 1,117, 18, 6, 0, 38, 0, 0, -255,255, 0,113,255,227, 3,231, 6, 16, 16, 39, 2, 50, 0,164, 0, 0, 18, 6, 0, 70, 0, 0,255,255, 0,115,255,227, 5, 39, - 5,240, 18, 38, 0, 38, 0, 0, 17, 7, 6,137, 5, 45, 1,117, 0, 7, 64, 3, 31, 29, 1, 93, 49, 0, 0, 0,255,255, 0,113, -255,227, 3,231, 6,102, 18, 38, 0, 70, 0, 0, 16, 7, 2, 32, 0,137, 0, 0,255,255, 0,201, 0, 0, 5,176, 5,213, 16, 38, - 0, 39, 0, 0, 16, 7, 6,137, 4,236, 1,137,255,255, 0,113,255,227, 4, 90, 6, 20, 18, 38, 0, 71, 0, 0, 17, 7, 6,131, - 5, 20, 0, 0, 0, 11, 64, 7, 95, 29, 63, 29, 31, 29, 3, 93, 49, 0, 0, 0,255,255, 0, 10, 0, 0, 5,186, 5,213, 16, 6, - 0,146, 0, 0, 0, 2, 0,113,255,227, 4,244, 6, 20, 0, 24, 0, 36, 0, 74, 64, 36, 7, 3,211, 9, 1,249, 34,185, 0, 22, - 28,185, 13, 16,140, 22,184, 5,151, 11, 2, 31, 12, 4, 3, 0, 8, 8, 10, 6, 71, 25, 18, 19, 69, 37, 16,252,236,244, 60,196, -252, 23, 60,196, 49, 0, 47,236,228,244,196,236, 16,196,238,253, 60,238, 50, 48,182, 96, 38,128, 38,160, 38, 3, 1, 93, 1, 17, - 33, 53, 33, 53, 51, 21, 51, 21, 35, 17, 35, 53, 14, 1, 35, 34, 2, 17, 16, 0, 51, 50, 22, 1, 20, 22, 51, 50, 54, 53, 52, 38, - 35, 34, 6, 3,162,254,186, 1, 70,184,154,154,184, 58,177,124,203,255, 0,255,203,124,177,253,199,167,146,146,168,168,146,146, -167, 3,182, 1, 78,125,147,147,125,250,252,168,100, 97, 1, 68, 1, 8, 1, 8, 1, 68, 97,254, 21,203,231,231,203,203,231,231, -255,255, 0,201, 0, 0, 4,139, 7, 51, 16, 39, 0,113, 0,161, 1, 61, 18, 6, 0, 40, 0, 0,255,255, 0,113,255,227, 4,127, - 5,246, 16, 39, 0,113, 0,150, 0, 0, 19, 6, 0, 72, 0, 0, 0, 7, 64, 3,112, 0, 1, 93, 49, 0, 0, 0,255,255, 0,201, - 0, 0, 4,139, 5,213, 16, 39, 6,139, 4,161, 1,117, 19, 6, 0, 40, 0, 0, 0, 7, 64, 3, 64, 0, 1, 93, 49, 0, 0, 0, -255,255, 0,113,255,227, 4,127, 6, 72, 16, 39, 2, 49, 0,150, 0, 0, 19, 6, 0, 72, 0, 0, 0, 7, 64, 3,112, 0, 1, 93, - 49, 0, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 16, 39, 6,140, 4,161, 1,117, 18, 6, 0, 40, 0, 0,255,255, 0,113, -255,227, 4,127, 6, 16, 16, 39, 2, 50, 0,150, 0, 0, 18, 6, 0, 72, 0, 0,255,255, 0,201,254,117, 4,141, 5,213, 16, 39, - 2, 52, 1,204, 0, 0, 18, 6, 0, 40, 0, 0,255,255, 0,113,254,117, 4,127, 4,123, 16, 39, 2, 52, 1,120, 0, 0, 18, 6, - 0, 72, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 38, 0, 40, 0, 0, 17, 7, 6,137, 4,166, 1,111, 0, 7, 64, 3, - 64, 12, 1, 93, 49, 0, 0, 0,255,255, 0,113,255,227, 4,127, 6, 97, 18, 38, 0, 72, 0, 0, 17, 7, 2, 32, 0,148,255,251, - 0, 16,180, 0, 33, 29, 15, 7, 43, 64, 5, 15, 33, 0, 29, 2, 93, 49, 0, 0,255,255, 0,115,255,227, 5,139, 5,240, 16, 39, - 6,136, 5, 92, 1,117, 19, 6, 0, 42, 0, 0, 0, 9,178, 4, 4, 21, 16, 60, 61, 47, 49, 0,255,255, 0,113,254, 86, 4, 90, - 6,102, 16, 38, 2, 31,104, 0, 19, 6, 0, 74, 0, 0, 0, 9,178, 4, 4, 10, 16, 60, 61, 47, 49, 0, 0, 0,255,255, 0,115, -255,227, 5,139, 5,240, 18, 38, 0, 42, 0, 0, 16, 7, 6,139, 5, 27, 1,117,255,255, 0,113,254, 86, 4, 90, 6, 72, 18, 38, - 0, 74, 0, 0, 16, 7, 2, 49, 0,139, 0, 0,255,255, 0,115,255,227, 5,139, 5,240, 16, 39, 6,140, 5, 92, 1,117, 19, 6, - 0, 42, 0, 0, 0, 8, 0, 64, 3, 63, 0, 1, 93, 48, 0, 0,255,255, 0,113,254, 86, 4, 90, 6, 16, 16, 38, 2, 50,104, 0, - 18, 6, 0, 74, 0, 0, 0, 0,255,255, 0,115,254, 1, 5,139, 5,240, 16, 39, 2,110, 5, 94,255,237, 18, 6, 0, 42, 0, 0, -255,255, 0,113,254, 86, 4, 90, 6, 52, 16, 39, 2, 90, 3,224, 1, 12, 18, 6, 0, 74, 0, 0,255,255, 0,201, 0, 0, 5, 59, - 5,213, 16, 39, 6,136, 5, 2, 1,117, 19, 6, 0, 43, 0, 0, 0, 20,180, 12, 2, 6, 7, 7, 43, 64, 9, 47, 2, 32, 6, 31, - 2, 16, 6, 4, 93, 49, 0, 0,255,255, 0,186, 0, 0, 4,100, 6, 20, 16, 39, 6,136, 3, 22, 1,117, 19, 6, 0, 75, 0, 0, - 0, 42,180, 20, 2, 6, 19, 7, 43, 49, 0, 75,176, 14, 81, 88,187, 0, 20,255,192, 0, 19,255,192, 56, 56, 89, 64, 13,144, 20, -144, 19,128, 20,128, 19, 64, 20, 64, 19, 6, 93, 0, 2, 0,201, 0, 0, 6,139, 5,213, 0, 19, 0, 23, 0, 58, 64, 30, 6, 2, - 18,149, 9, 20, 17, 12,149, 21,173, 4, 0,129, 14, 10, 7, 12, 23, 4, 28, 5, 56, 18, 13, 20, 1, 28, 0, 24, 16,220,236, 50, - 50,204,252,236, 50, 50,204, 49, 0, 47, 60,228, 50,252,236,220, 50, 50,236, 50, 50, 48, 1, 51, 21, 33, 53, 51, 21, 51, 21, 35, - 17, 35, 17, 33, 17, 35, 17, 35, 53, 51, 23, 21, 33, 53, 1,113,202, 2,222,202,168,168,202,253, 34,202,168,168,202, 2,222, 5, -213,224,224,224,164,251,175, 2,199,253, 57, 4, 81,164,164,224,224, 0, 0, 0, 0, 1, 0,120, 0, 0, 4,159, 6, 20, 0, 27, - 0, 62, 64, 33, 3, 9, 0, 3, 22, 1, 14, 18,135, 13, 21, 6,135, 22, 25,184, 16,151, 10, 1, 2, 8, 0, 78, 19, 14, 17, 21, - 9, 8, 16, 11, 28, 16,220, 50,236, 50, 50,204,204,244,236, 49, 0, 47, 60,236,244,196,236,220, 50,236, 50, 17, 18, 23, 57, 48, - 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 35, 53, 51, 53, 51, 21, 33, 21, 33, 17, 62, 1, 51, 50, 22, 4,159,184,124, -124,149,172,185,125,125,185, 1, 96,254,160, 66,179,117,193,198, 2,164,253, 92, 2,158,159,158,190,164,253,135, 4,246,164,122, -122,164,254,188,101,100,239, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 16, 39, 6,134, 3, 46, 1,117, 19, 6, 0, 44, 0, 0, - 0, 8,180, 30, 9, 24, 31, 7, 43, 49, 0, 0,255,255,255,211, 0, 0, 2,103, 6, 55, 16, 39, 2, 53,255, 29, 0, 0, 19, 6, - 0,243, 0, 0, 0, 8,180, 28, 8, 22, 29, 7, 43, 49, 0, 0,255,255, 0, 3, 0, 0, 2, 89, 7, 49, 16, 39, 0,113,255, 46, - 1, 59, 19, 6, 0, 44, 0, 0, 0, 8,180, 4, 3, 2, 5, 7, 43, 49, 0, 0,255,255,255,242, 0, 0, 2, 72, 5,245, 16, 39, - 0,113,255, 29,255,255, 19, 6, 0,243, 0, 0, 0, 8,180, 4, 3, 2, 5, 7, 43, 49, 0, 0,255,255, 0,201, 0, 0, 1,147, - 5,213, 16, 39, 6,139, 3, 46, 1,117, 19, 6, 0, 44, 0, 0, 0, 8,180, 14, 0, 8, 15, 7, 43, 49, 0, 0,255,255,255,228, - 0, 0, 2, 86, 6, 72, 16, 39, 2, 49,255, 29, 0, 0, 19, 6, 0,243, 0, 0, 0, 8,180, 14, 0, 8, 15, 7, 43, 49, 0, 0, -255,255, 0,176,254,117, 2, 37, 5,213, 16, 39, 2, 52,255,100, 0, 0, 18, 6, 0, 44, 0, 0,255,255, 0,150,254,117, 2, 11, - 6, 20, 16, 39, 2, 52,255, 74, 0, 0, 18, 6, 0, 76, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 38, 0, 44, 0, 0, - 17, 7, 6,140, 3, 47, 1,117, 0, 19,179, 6, 1, 7, 0, 16, 60, 16, 60, 49, 0,180, 63, 7, 63, 6, 2, 93, 48, 0, 0, 0, - 0, 1, 0,193, 0, 0, 1,121, 4, 96, 0, 3, 0, 32,183, 0,191, 2, 1, 8, 0, 70, 4, 16,252,236, 49, 0, 47,236, 48, 64, - 11, 16, 5, 64, 5, 80, 5, 96, 5,112, 5, 5, 1, 93, 19, 51, 17, 35,193,184,184, 4, 96,251,160, 0, 0, 0,255,255, 0,201, -254,102, 3,239, 5,213, 16, 39, 0, 45, 2, 92, 0, 0, 17, 6, 0, 44, 0, 0, 0, 8, 64, 3, 17, 4, 1, 16,236, 49, 0, 0, -255,255, 0,193,254, 86, 3,177, 6, 20, 16, 39, 0, 77, 2, 56, 0, 0, 17, 6, 0, 76, 0, 0, 0, 8, 64, 3, 25, 70, 1, 16, -236, 49, 0, 0,255,255,255,150,254,102, 1,147, 5,213, 16, 39, 6,136, 3, 46, 1,117, 19, 6, 0, 45, 0, 0, 0, 8,180, 8, - 2, 6, 7, 7, 43, 49, 0, 0,255,255,255,219,254, 86, 2, 92, 6,102, 16, 39, 2, 31,255, 29, 0, 0, 19, 6, 1,249, 0, 0, - 0, 8,180, 8, 2, 6, 7, 7, 43, 49, 0, 0,255,255, 0,201,254, 30, 5,106, 5,213, 16, 39, 2,110, 5, 27, 0, 10, 18, 6, - 0, 46, 0, 0,255,255, 0,186,254, 30, 4,156, 6, 20, 16, 39, 2,110, 4,172, 0, 10, 18, 6, 0, 78, 0, 0, 0, 1, 0,186, - 0, 0, 4,156, 4, 96, 0, 10, 0,187, 64, 40, 8, 17, 5, 6, 5, 7, 17, 6, 6, 5, 3, 17, 4, 5, 4, 2, 17, 5, 5, 4, - 66, 8, 5, 2, 3, 3, 0,188, 9, 6, 5, 1, 4, 6, 8, 1, 8, 0, 70, 11, 16,252,236, 50,212,196, 17, 57, 49, 0, 47, 60, -236, 50, 23, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, 4,237, 89, 34,178, 16, 12, 1, 1, 93, - 64, 95, 4, 2, 10, 8, 22, 2, 39, 2, 41, 5, 43, 8, 86, 2,102, 2,103, 8,115, 2,119, 5,130, 2,137, 5,142, 8,147, 2, -150, 5,151, 8,163, 2, 18, 9, 5, 9, 6, 2, 11, 3, 10, 7, 40, 3, 39, 4, 40, 5, 43, 6, 43, 7, 64, 12,104, 3, 96, 12, -137, 3,133, 4,137, 5,141, 6,143, 7,154, 3,151, 7,170, 3,167, 5,182, 7,197, 7,214, 7,247, 3,240, 3,247, 4,240, 4, - 26, 93,113, 0, 93, 19, 51, 17, 1, 51, 9, 1, 35, 1, 17, 35,186,185, 2, 37,235,253,174, 2,107,240,253,199,185, 4, 96,254, - 27, 1,229,253,242,253,174, 2, 33,253,223, 0,255,255, 0,201, 0, 0, 4,106, 5,213, 16, 39, 6,133, 3,110, 1,118, 18, 6, - 0, 47, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 16, 39, 6,133, 3, 90, 1,118, 19, 6, 0, 79, 0, 0, 0, 30,177, 3, - 4, 16, 60, 49, 0, 75,176, 14, 81, 88,185, 0, 0, 0, 64, 56, 89, 64, 7,159, 0,143, 0, 79, 0, 3, 93, 48,255,255, 0,201, -254, 30, 4,106, 5,213, 16, 39, 2,110, 4,155, 0, 10, 18, 6, 0, 47, 0, 0,255,255, 0,136,254, 30, 1,174, 6, 20, 16, 39, - 2,110, 3, 30, 0, 10, 19, 6, 0, 79, 0, 0, 0, 7, 64, 3, 64, 0, 1, 93, 49, 0, 0, 0,255,255, 0,201, 0, 0, 4,106, - 5,213, 16, 39, 6,131, 2,159,255,195, 18, 6, 0, 47, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 16, 39, 6,131, 2, 57, - 0, 2, 17, 6, 0, 79, 0, 0, 0, 9, 64, 5,143, 0, 31, 0, 2, 93, 49, 0,255,255, 0,201, 0, 0, 4,106, 5,213, 16, 39, - 0,121, 2, 49, 0,119, 18, 6, 0, 47, 0, 0,255,255, 0,193, 0, 0, 2,132, 6, 20, 16, 39, 0,121, 0,214, 0,115, 17, 6, - 0, 79, 0, 0, 0, 23, 75,176, 13, 81, 75,176, 17, 83, 75,176, 24, 81, 90, 91, 88,185, 0, 0, 0, 64, 56, 89, 49, 0, 0, 0, - 0, 1,255,242, 0, 0, 4,117, 5,213, 0, 13, 0, 63, 64, 30, 12, 11, 10, 4, 3, 2, 6, 0, 6,149, 0,129, 8, 3, 4, 1, - 11, 14, 0, 4, 5, 1, 28, 12, 7, 58, 9, 0,121, 14, 16,244, 60,236,196,252, 60,196, 17, 18, 57, 17, 18, 57, 49, 0, 47,228, -236, 17, 23, 57, 48,180, 48, 15, 80, 15, 2, 1, 93, 19, 51, 17, 37, 23, 1, 17, 33, 21, 33, 17, 7, 39, 55,211,203, 1, 57, 80, -254,119, 2,215,252, 94,148, 77,225, 5,213,253,152,219,111,254,238,253,227,170, 2, 59,106,110,158, 0, 0, 0, 0, 1, 0, 2, - 0, 0, 2, 72, 6, 20, 0, 11, 0, 94, 64, 26, 10, 9, 8, 4, 3, 2, 6, 0,151, 6, 3, 4, 1, 9, 10, 0, 4,122, 5, 1, - 8, 10,122, 7, 0, 12, 16,212, 60,228,252, 60,228, 17, 18, 57, 17, 18, 57, 49, 0, 47,236, 23, 57, 48, 1, 75,176, 16, 84, 88, -189, 0, 12, 0, 64, 0, 1, 0, 12, 0, 12,255,192, 56, 17, 55, 56, 89, 64, 19, 16, 13, 64, 13, 80, 13, 96, 13,115, 4,122, 10, -112, 13,224, 13,240, 13, 9, 93, 19, 51, 17, 55, 23, 7, 17, 35, 17, 7, 39, 55,199,184,125, 76,201,184,123, 74,197, 6, 20,253, -166, 90,106,141,252,227, 2,154, 88,106,141, 0,255,255, 0,201, 0, 0, 5, 51, 5,213, 16, 39, 6,133, 4,197, 1,118, 19, 6, - 0, 49, 0, 0, 0, 7, 64, 3, 79, 0, 1, 93, 49, 0, 0, 0,255,255, 0,186, 0, 0, 4,100, 6,109, 16, 38, 0,118, 66, 7, - 19, 6, 0, 81, 0, 0, 0, 9, 64, 5, 63, 0, 79, 0, 2, 93, 49, 0, 0, 0,255,255, 0,201,254, 30, 5, 51, 5,213, 16, 39, - 2,110, 5, 0, 0, 10, 18, 6, 0, 49, 0, 0,255,255, 0,186,254, 30, 4,100, 4,123, 16, 39, 2,110, 4,144, 0, 10, 18, 6, - 0, 81, 0, 0,255,255, 0,201, 0, 0, 5, 51, 5,213, 18, 38, 0, 49, 0, 0, 17, 7, 6,137, 4,245, 1,103, 0, 20,180, 4, - 15, 11, 0, 7, 43, 64, 9, 47, 15, 32, 11, 31, 15, 16, 11, 4, 93, 49, 0, 0,255,255, 0,186, 0, 0, 4,100, 6,102, 18, 38, - 0, 81, 0, 0, 17, 7, 2, 32, 0,141, 0, 0, 0, 16,180, 0, 25, 21, 12, 7, 43, 64, 5, 15, 25, 0, 21, 2, 93, 49, 0, 0, -255,255, 0,205, 0, 0, 5,185, 5,213, 16, 39, 0, 81, 1, 85, 0, 0, 16, 6, 2, 21, 27, 0, 0, 1, 0,213,254, 86, 5, 39, - 5,213, 0, 19, 0, 74, 64, 33, 17, 17, 1, 2, 1, 2, 17, 16, 17, 16, 66, 11,149, 10, 17, 2, 3, 0,175, 16, 19, 11, 16, 1, - 17, 2, 28, 4, 54, 17, 28, 0, 20, 16,220,236,252,236, 17, 57, 57,204, 49, 0, 47, 60,236, 50, 57, 57,220,236, 48, 75, 83, 88, - 7, 16, 4,237, 7, 16, 4,237, 89, 34,178, 31, 21, 1, 1, 93, 19, 51, 1, 17, 51, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, - 53, 1, 17, 35,213,184, 2,226,184, 82, 81,181,254,233,105, 38, 38,253, 30,184, 5,213,251,131, 4,125,250, 23,214, 96, 96,156, - 48, 49,173, 4,125,251,131, 0, 0, 1, 0,186,254, 86, 4,100, 4,123, 0, 31, 0, 59, 64, 28, 13, 19, 0, 3, 24, 21, 7,135, - 6, 16,135, 24, 28,184, 22,188, 21, 7, 13, 8, 0, 78, 19, 23, 8, 22, 70, 32, 16,252,236, 50,244,236,196, 49, 0, 47,228,244, -196,236,212,236, 17, 18, 23, 57, 48,180, 96, 33,207, 33, 2, 1, 93, 1, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, - 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 54, 55, 54, 51, 50, 23, 22, 4,100, 82, 81,181,254,233,105, 38, 38,124,124,149,172,185, -185, 66, 89, 90,117,193, 99, 99, 2,164,253, 72,214, 96, 96,156, 48, 49,153, 2,178,159,158,190,164,253,135, 4, 96,174,101, 50, - 50,119,120, 0,255,255, 0,115,255,227, 5,217, 7, 49, 16, 39, 0,113, 1, 39, 1, 59, 19, 6, 0, 50, 0, 0, 0, 16,180, 13, - 2, 3, 7, 7, 43, 64, 5, 31, 2, 16, 3, 2, 93, 49, 0, 0,255,255, 0,113,255,227, 4,117, 5,245, 16, 38, 0,113,115,255, - 19, 6, 0, 82, 0, 0, 0, 8,180, 19, 2, 3, 25, 7, 43, 49,255,255, 0,115,255,227, 5,217, 5,240, 16, 39, 6,139, 5, 39, - 1,117, 19, 6, 0, 50, 0, 0, 0, 16,180, 17, 0, 8, 23, 7, 43, 64, 5, 16, 0, 31, 8, 2, 93, 49, 0, 0,255,255, 0,113, -255,227, 4,117, 6, 72, 16, 38, 2, 49,115, 0, 19, 6, 0, 82, 0, 0, 0, 8,180, 29, 8, 0, 35, 7, 43, 49,255,255, 0,115, -255,227, 5,217, 5,240, 16, 39, 6,141, 5, 39, 1,117, 18, 6, 0, 50, 0, 0,255,255, 0,113,255,227, 4,117, 6,102, 16, 39, - 2, 54, 0,160, 0, 0, 18, 6, 0, 82, 0, 0, 0, 2, 0,115, 0, 0, 8, 12, 5,213, 0, 16, 0, 25, 0, 59, 64, 31, 5,149, - 3, 17, 1,149, 0,129, 24, 7,149, 3,173, 9, 24, 18, 16, 10, 21, 6, 2, 28, 17, 0, 4, 8, 21, 25, 13, 16, 26, 16,252,236, -212,196,196,212,236, 50, 18, 57, 57, 57, 57, 49, 0, 47,236,236, 50,244,236, 50, 16,238, 48, 1, 21, 33, 17, 33, 21, 33, 17, 33, - 21, 33, 32, 0, 17, 16, 0, 33, 23, 35, 32, 0, 17, 16, 0, 33, 51, 7,250,253, 26, 2,199,253, 57, 2,248,251,215,254, 79,254, - 65, 1,191, 1,177,103,129,254,191,254,192, 1, 64, 1, 65,129, 5,213,170,254, 70,170,253,227,170, 1,124, 1,112, 1,109, 1, -124,170,254,225,254,224,254,223,254,223, 0, 0, 0, 3, 0,113,255,227, 7,195, 4,123, 0, 6, 0, 39, 0, 51, 0,132, 64, 49, - 7, 8, 0, 16,134, 15,136, 12, 0,169, 8, 46, 12,185, 22, 19, 40, 3,185, 8,187, 34, 37, 31,184, 25, 19,140, 52, 6, 0, 22, - 34, 49, 9, 15, 0, 8, 7, 75, 49, 18, 9, 81, 43, 18, 28, 69, 52, 16,252,236,244,252,244,236,196, 17, 18, 57, 57, 18, 57, 49, - 0, 16,228, 50,244, 60,196,228,236, 50, 16,196,238, 50, 16,238, 16,244,238, 17, 18, 57, 48, 64, 37, 63, 53, 95, 53,112, 53,159, - 53,207, 53,208, 53,240, 53, 7, 63, 0, 63, 6, 63, 7, 63, 8, 63, 9, 5,111, 0,111, 6,111, 7,111, 8,111, 9, 5, 93,113, - 1, 93, 1, 46, 1, 35, 34, 6, 7, 5, 21, 33, 30, 1, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 39, 14, 1, 35, 34, 0, 17, 16, - 0, 51, 50, 22, 23, 62, 1, 51, 50, 0, 37, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 7, 10, 2,164,137,153,185, 14, 3, 72, -252,178, 12,204,183,106,200, 98,100,208,106,160,242, 81, 71,209,140,241,254,239, 1, 17,241,140,211, 66, 78,232,143,226, 1, 8, -250,176,148,172,171,149,147,172,172, 2,148,152,179,174,158, 53, 90,190,199, 52, 52,174, 42, 44,110,109,110,109, 1, 57, 1, 19, - 1, 20, 1, 56,111,108,107,112,254,221,135,231,201,201,231,232,200,199,233, 0,255,255, 0,201, 0, 0, 5, 84, 5,213, 16, 39, - 6,133, 4,149, 1,118, 18, 6, 0, 53, 0, 0,255,255, 0,186, 0, 0, 3,149, 6,109, 16, 38, 0,118, 66, 7, 18, 6, 0, 85, - 0, 0, 0, 0,255,255, 0,201,254, 30, 5, 84, 5,213, 16, 39, 2,110, 5, 16, 0, 10, 18, 6, 0, 53, 0, 0,255,255, 0,130, -254, 30, 3, 74, 4,123, 16, 39, 2,110, 3, 24, 0, 10, 18, 6, 0, 85, 0, 0,255,255, 0,201, 0, 0, 5, 84, 5,213, 18, 38, - 0, 53, 0, 0, 17, 7, 6,137, 4,125, 1,103, 0, 8, 0, 64, 3, 95, 29, 1, 93, 48, 0, 0,255,255, 0,186, 0, 0, 3, 90, - 6,102, 18, 38, 0, 85, 0, 0, 17, 6, 2, 32, 27, 0, 0, 16,180, 17, 23, 19, 9, 7, 43, 64, 5, 15, 23, 0, 19, 2, 93, 49, -255,255, 0,135,255,227, 4,162, 5,240, 16, 39, 6,133, 4,149, 1,118, 18, 6, 0, 54, 0, 0,255,255, 0,111,255,227, 3,199, - 6,109, 16, 38, 0,118, 66, 7, 18, 6, 0, 86, 0, 0, 0, 0,255,255, 0,135,255,227, 4,162, 5,240, 16, 39, 6,136, 4,147, - 1,117, 19, 6, 0, 54, 0, 0, 0, 11,180, 4, 32, 21, 41, 41, 16, 73, 99, 58, 49, 0, 0, 0,255,255, 0,111,255,227, 3,199, - 6,102, 16, 38, 2, 31, 37, 0, 19, 6, 0, 86, 0, 0, 0, 11,180, 4, 32, 21, 41, 41, 16, 73, 99, 58, 49, 0,255,255, 0,135, -254,117, 4,162, 5,240, 18, 38, 0, 54, 0, 0, 16, 7, 0,122, 0,139, 0, 0,255,255, 0,111,254,117, 3,199, 4,123, 18, 38, - 0, 86, 0, 0, 16, 6, 0,122, 23, 0, 0, 0,255,255, 0,135,255,227, 4,162, 5,240, 18, 38, 0, 54, 0, 0, 17, 7, 6,137, - 4,139, 1,117, 0, 11,180, 43, 32, 14, 34, 34, 16, 73, 99, 58, 49, 0, 0, 0,255,255, 0,111,255,227, 3,199, 6,102, 18, 38, - 0, 86, 0, 0, 17, 6, 2, 32, 23, 0, 0, 11,180, 43, 32, 14, 34, 34, 16, 73, 99, 58, 49, 0,255,255,255,250,254,117, 4,233, - 5,213, 16, 38, 0,122, 80, 0, 18, 6, 0, 55, 0, 0, 0, 0,255,255, 0, 55,254,117, 2,242, 5,158, 16, 38, 0,122,225, 0, - 18, 6, 0, 87, 0, 0, 0, 0,255,255,255,250, 0, 0, 4,233, 5,213, 18, 38, 0, 55, 0, 0, 17, 7, 6,137, 4,115, 1,103, - 0, 16,180, 1, 13, 9, 0, 7, 43, 49, 0, 64, 3, 95, 8, 1, 93, 48, 0, 0,255,255, 0, 55, 0, 0, 2,242, 5,158, 18, 38, - 0, 87, 0, 0, 17, 7, 6,131, 2, 55, 0,112, 0, 7, 64, 3,143, 20, 1, 93, 49, 0, 0, 0, 0, 1,255,250, 0, 0, 4,233, - 5,213, 0, 15, 0, 70, 64, 24, 7, 11,149, 4, 12, 9, 3, 15,149, 0,129, 9, 5, 1, 64, 7, 3, 28, 12, 0, 64, 10, 14, 16, - 16,212, 60,228,204,252, 60,228,204, 49, 0, 47,244,236, 50, 16,212, 60,236, 50, 48, 1, 64, 19, 0, 17, 31, 0, 16, 1, 16, 2, - 31, 15, 16, 17, 64, 17,112, 17,159, 17, 9, 93, 3, 33, 21, 33, 17, 33, 21, 33, 17, 35, 17, 33, 53, 33, 17, 33, 6, 4,239,253, -238, 1, 9,254,247,203,254,247, 1, 9,253,238, 5,213,170,253,192,170,253,191, 2, 65,170, 2, 64, 0, 0, 0, 0, 1, 0, 55, - 0, 0, 2,242, 5,158, 0, 29, 0, 67, 64, 31, 8, 22,169, 5, 23, 4, 26,169, 0, 1, 27,188, 13,135, 16, 16, 13, 14, 2, 6, - 8, 4, 0, 8, 23, 27, 21, 25, 29, 70, 30, 16,252, 60, 60,196, 50,252, 60, 60,196,196, 50, 57, 57, 49, 0, 47,236,244, 60,196, -252, 60,220, 60,236, 50, 48,178,175, 31, 1, 1, 93, 1, 17, 33, 21, 33, 21, 51, 21, 35, 21, 20, 23, 22, 59, 1, 21, 35, 34, 39, - 38, 61, 1, 35, 53, 51, 53, 35, 53, 51, 17, 1,119, 1,123,254,133,190,190, 37, 38,115,189,189,213, 81, 81,135,135,135,135, 5, -158,254,194,143,233,142,233,137, 39, 39,154, 80, 79,210,233,142,233,143, 1, 62,255,255, 0,178,255,227, 5, 41, 5,213, 16, 39, - 6,134, 4,238, 1,117, 19, 6, 0, 56, 0, 0, 0, 16,180, 31, 9, 24, 39, 7, 43, 64, 5, 16, 9, 31, 24, 2, 93, 49, 0, 0, -255,255, 0,174,255,227, 4, 88, 6, 55, 16, 39, 2, 53, 0,131, 0, 0, 19, 6, 0, 88, 0, 0, 0, 8,180, 30, 8, 22, 38, 7, - 43, 49, 0, 0,255,255, 0,178,255,227, 5, 41, 7, 49, 16, 39, 0,113, 0,238, 1, 59, 19, 6, 0, 56, 0, 0, 0, 20,180, 5, - 3, 2, 13, 7, 43, 64, 9, 47, 2, 32, 3, 31, 2, 16, 3, 4, 93, 49, 0, 0,255,255, 0,174,255,227, 4, 88, 5,245, 16, 39, - 0,113, 0,131,255,255, 19, 6, 0, 88, 0, 0, 0, 8,180, 6, 3, 2, 14, 7, 43, 49, 0, 0,255,255, 0,178,255,227, 5, 41, - 5,213, 16, 39, 6,139, 4,238, 1,117, 19, 6, 0, 56, 0, 0, 0, 16,180, 15, 0, 8, 23, 7, 43, 64, 5, 16, 0, 31, 8, 2, - 93, 49, 0, 0,255,255, 0,174,255,227, 4, 88, 6, 72, 16, 39, 2, 49, 0,131, 0, 0, 19, 6, 0, 88, 0, 0, 0, 8,180, 16, - 0, 8, 24, 7, 43, 49, 0, 0,255,255, 0,178,255,227, 5, 41, 8, 75, 18, 38, 0, 56, 0, 0, 17, 7, 2, 51, 0,240, 1, 69, - 0, 9, 64, 5, 64, 30, 64, 18, 2, 93, 49, 0,255,255, 0,174,255,227, 4, 88, 6,202, 18, 38, 0, 88, 0, 0, 17, 6, 2, 51, -124,196, 0, 9, 64, 5, 64, 20, 64, 32, 2, 93, 49, 0, 0, 0,255,255, 0,178,255,227, 5, 41, 5,213, 16, 39, 6,141, 4,238, - 1,117, 18, 6, 0, 56, 0, 0,255,255, 0,174,255,227, 4, 94, 6,102, 16, 39, 2, 54, 0,176, 0, 0, 18, 6, 0, 88, 0, 0, -255,255, 0,178,254,101, 5, 41, 5,213, 18, 38, 0, 56, 0, 0, 16, 7, 2, 52, 0,250,255,240,255,255, 0,174,254,117, 4,232, - 4, 96, 18, 38, 0, 88, 0, 0, 16, 7, 2, 52, 2, 39, 0, 0,255,255, 0, 68, 0, 0, 7,166, 5,213, 16, 39, 6,136, 5,245, - 1,124, 19, 6, 0, 58, 0, 0, 0, 8,180, 21, 2, 6, 20, 7, 43, 49, 0, 0,255,255, 0, 86, 0, 0, 6, 53, 6,109, 16, 39, - 2, 31, 1, 69, 0, 7, 19, 6, 0, 90, 0, 0, 0, 8,180, 21, 2, 6, 20, 7, 43, 49, 0, 0,255,255,255,252, 0, 0, 4,231, - 5,213, 16, 39, 6,136, 4,114, 1,124, 19, 6, 0, 60, 0, 0, 0, 8,180, 11, 2, 6, 7, 7, 43, 49, 0, 0,255,255, 0, 61, -254, 86, 4,127, 6,109, 16, 38, 2, 31, 94, 7, 19, 6, 0, 92, 0, 0, 0, 8,180, 24, 2, 6, 23, 7, 43, 49,255,255,255,252, - 0, 0, 4,231, 5,213, 18, 38, 0, 60, 0, 0, 17, 7, 6,132, 4,115, 1,117, 0, 8,180, 0, 16, 11, 4, 7, 43, 49, 0, 0, -255,255, 0, 92, 0, 0, 5, 31, 5,213, 16, 39, 6,133, 4,149, 1,118, 18, 6, 0, 61, 0, 0,255,255, 0, 88, 0, 0, 3,219, - 6,109, 16, 38, 0,118, 66, 7, 18, 6, 0, 93, 0, 0, 0, 0,255,255, 0, 92, 0, 0, 5, 31, 5,213, 16, 39, 6,140, 4,168, - 1, 98, 18, 6, 0, 61, 0, 0,255,255, 0, 88, 0, 0, 3,219, 6, 16, 16, 38, 2, 50, 0, 0, 18, 6, 0, 93, 0, 0, 0, 0, -255,255, 0, 92, 0, 0, 5, 31, 5,213, 18, 38, 0, 61, 0, 0, 16, 7, 6,137, 4,190, 1,117,255,255, 0, 88, 0, 0, 3,219, - 6,102, 18, 38, 0, 93, 0, 0, 17, 6, 2, 32, 27, 0, 0, 16,180, 1, 15, 11, 0, 7, 43, 64, 5, 15, 15, 0, 11, 2, 93, 49, - 0, 1, 0, 47, 0, 0, 2,248, 6, 20, 0, 16, 0, 35, 64, 18, 11,135, 10,151, 1, 2,169, 5,188, 1, 10, 16, 8, 4, 6, 2, - 76, 17, 16,252, 60,204,252,204, 49, 0, 47,244,236, 16,244,236, 48, 33, 35, 17, 35, 53, 51, 53, 52, 54, 59, 1, 21, 35, 34, 7, - 6, 21, 1,152,185,176,176,174,189,174,176, 99, 39, 38, 3,209,143, 78,187,171,153, 40, 41,103, 0, 2, 0, 32,255,227, 4,164, - 6, 20, 0, 15, 0, 44, 0, 68, 64, 37, 4,185, 16, 20, 12,185, 32, 28,140, 20,184, 34, 41, 37,169, 44, 36, 39,151, 34, 46, 69, - 0, 18, 24, 71, 42, 32, 6, 44, 40, 8, 37, 35, 39, 70, 45, 16,252, 60,204,236, 50, 50, 50,204,244,236,236, 49, 0, 47,244,220, - 60,236, 50, 16,228,244,196,236, 16,198,238, 48, 1, 52, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 54, 1, 54, 55, 54, - 51, 50, 23, 22, 17, 16, 7, 6, 35, 34, 39, 38, 39, 21, 35, 17, 35, 53, 51, 53, 51, 21, 33, 21, 33, 3,229, 83, 84,146,146, 84, - 83, 83, 84,146,146, 84, 83,253,142, 58, 89, 88,123,204,127,128,128,127,204,123, 88, 89, 58,185,154,154,185, 1, 69,254,187, 2, - 47,203,116,115,115,116,203,203,116,115,115,116, 2, 82,100, 48, 49,162,162,254,248,254,248,162,162, 49, 48,100,168, 5, 4,125, -147,147,125, 0, 0, 3,255,151, 0, 0, 5, 80, 5,213, 0, 8, 0, 17, 0, 41, 0, 67, 64, 35, 25, 0,149, 10, 9,149, 18,129, - 1,149, 10,173, 31, 17, 11, 8, 2, 19, 25, 31, 5, 0, 14, 28, 22, 5, 25, 28, 46, 9, 0, 28, 18, 4, 42, 16,252,236, 50,252, -236,212,236, 17, 23, 57, 57, 57, 49, 0, 47,236,236,244,236, 16,238, 57, 48,178, 15, 34, 1, 1, 93, 1, 17, 33, 50, 54, 53, 52, - 38, 35, 1, 17, 33, 50, 54, 53, 52, 38, 35, 37, 33, 50, 22, 21, 20, 6, 7, 30, 1, 21, 20, 4, 35, 33, 17, 34, 6, 29, 1, 35, - 53, 52, 54, 1,247, 1, 68,163,157,157,163,254,188, 1, 43,148,145,145,148,254, 11, 2, 4,231,250,128,124,149,165,254,240,251, -253,232,132,118,156,192, 2,201,253,221,135,139,140,133, 2,102,254, 62,111,114,113,112,166,192,177,137,162, 20, 32,203,152,200, -218, 5, 48, 95,105, 49, 70,181,163, 0, 0, 0,255,255, 0,201, 0, 0, 4,236, 5,213, 18, 6, 3, 46, 0, 0, 0, 2, 0,186, -255,227, 4,164, 6, 20, 0, 22, 0, 38, 0, 56, 64, 31, 27,185, 0, 4, 35,185, 16, 12,140, 4,184, 18, 22,169, 19,151, 18, 40, - 69, 20, 23, 18, 8, 71, 16, 31, 22, 8, 19, 70, 39, 16,252,236, 50, 50,244,236,196,236, 49, 0, 47,244,236, 16,228,244,196,236, - 16,198,238, 48, 1, 54, 55, 54, 51, 50, 23, 22, 17, 16, 7, 6, 35, 34, 39, 38, 39, 21, 35, 17, 33, 21, 37, 1, 52, 39, 38, 35, - 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 54, 1,115, 58, 89, 88,123,204,127,128,128,127,204,123, 88, 89, 58,185, 3, 78,253,107, - 2,114, 83, 84,146,146, 84, 83, 83, 84,146,146, 84, 83, 3,182,100, 48, 49,162,162,254,248,254,248,162,162, 49, 48,100,168, 6, - 20,166, 1,252,192,203,116,115,115,116,203,203,116,115,115,116, 0, 2, 0, 0, 0, 0, 4,236, 5,213, 0, 10, 0, 23, 0, 51, - 64, 12, 23, 11, 25, 0, 25, 16, 46, 5, 11, 28, 21, 22, 47,220,236, 50,252,236,196, 16,204, 49, 64, 9, 5,149, 12,173, 11,129, - 6,149, 20, 0, 47,236,228,244,236,179, 21, 21, 11, 20, 17, 18, 57, 47, 48, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1, 17, - 33, 50, 4, 21, 20, 4, 35, 33, 17, 35, 1, 4, 23, 79, 78,163,254,188, 1, 68,163, 78, 79,253,124, 1, 78,251, 1, 16,254,240, -251,253,232,201, 1, 56, 1,183,139, 68, 67,253,221, 68, 67, 4,168,253,154,218,222,221,218, 4, 68, 1,145, 0, 0, 2, 0, 0, -255,227, 4,164, 6, 21, 0, 18, 0, 30, 0, 62, 64, 13, 17, 18, 32, 19, 18, 6, 71, 13, 25, 18, 8, 15, 16, 47,220,236, 50, 50, -244,236,196, 16,204, 49, 64, 14, 0, 22,185, 3,184, 14, 12, 28,185, 9,140, 17,151, 14, 0, 47,228,244,236,196, 16,244,236,196, -179, 15, 15, 17, 14, 17, 18, 57, 47, 48, 1, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 39, 21, 35, 17, 35, 1, 51, 1, 52, 38, - 35, 34, 6, 21, 20, 22, 51, 50, 54, 1,115, 58,177,123,204, 0,255,255,204,123,177, 58,185,186, 1, 34, 81, 2,114,167,146,146, -167,167,146,146,167, 3,182,100, 97,254,188,254,248,254,248,254,188, 97,100,168, 4, 68, 1,209,252, 26,203,231,231,203,203,231, -231, 0, 0, 0, 0, 1, 0,115,255,227, 5, 39, 5,240, 0, 25, 0, 48, 64, 27, 25,134, 0,136, 22,149, 3,145, 26, 13,134, 12, -136, 16,149, 9,140, 26, 27, 16, 19, 25, 6, 48, 13, 0, 26, 16,220, 60,244,236,236, 49, 0, 16,244,236,244,236, 16,244,236,244, -236, 48, 19, 62, 1, 51, 32, 0, 17, 16, 0, 33, 34, 38, 39, 53, 30, 1, 51, 32, 0, 17, 16, 0, 33, 34, 6, 7,115,104,237,134, - 1, 83, 1,134,254,122,254,173,132,237,106,102,231,130, 1, 0, 1, 16,254,240,255, 0,130,231,102, 5, 98, 71, 71,254, 97,254, -152,254,153,254, 97, 72, 72,211, 95, 94, 1, 57, 1, 39, 1, 40, 1, 57, 94, 95, 0, 1, 0,115,255,227, 6, 90, 7,100, 0, 36, - 0, 0, 1, 54, 55, 54, 59, 1, 21, 35, 34, 6, 29, 1, 46, 1, 35, 32, 0, 17, 16, 0, 33, 50, 54, 55, 21, 14, 1, 35, 32, 0, - 17, 16, 0, 33, 50, 23, 22, 4, 97, 16, 83,102,227, 77, 63,134,110,102,231,130,255, 0,254,240, 1, 16, 1, 0,130,231,102,106, -237,132,254,173,254,122, 1,134, 1, 83,134,118, 13, 5,197,195, 98,122,170,150,194,213, 95, 94,254,199,254,216,254,217,254,199, - 94, 95,211, 72, 72, 1,159, 1,103, 1,104, 1,159, 36, 3, 0, 0, 1, 0,113,255,227, 4,205, 5,203, 0, 33, 0, 0, 1, 54, - 55, 54, 59, 1, 21, 35, 34, 6, 29, 1, 46, 1, 35, 34, 6, 16, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 0, 17, 16, 0, 33, 50, - 3, 49, 9, 70, 82,181, 70, 49,105, 76, 78,157, 80,179,198,198,179, 80,157, 78, 77,165, 93,253,254,214, 1, 45, 1, 6, 72, 4, -111,169, 83, 96,156, 97,153,172, 43, 43,227,254,102,227, 43, 43,170, 36, 36, 1, 62, 1, 14, 1, 18, 1, 58, 0,255,255, 0, 10, - 0, 0, 5,186, 5,213, 16, 6, 0,146, 0, 0, 0, 2,255,151, 0, 0, 6, 20, 5,213, 0, 8, 0, 26, 0, 46, 64, 21, 0,149, - 9,129, 1,149, 16, 8, 2, 16, 10, 0, 5, 25, 13, 50, 0, 28, 9, 4, 27, 16,252,236,244,236, 17, 57, 57, 57, 57, 49, 0, 47, -236,244,236, 48,178, 96, 19, 1, 1, 93, 1, 17, 51, 32, 0, 17, 16, 0, 33, 37, 33, 32, 0, 17, 16, 0, 41, 1, 17, 34, 6, 29, - 1, 35, 53, 52, 54, 1,247,244, 1, 53, 1, 31,254,225,254,203,254, 66, 1,159, 1,178, 1,150,254,104,254, 80,254, 97,132,118, -156,192, 5, 47,251,119, 1, 24, 1, 46, 1, 44, 1, 23,166,254,151,254,128,254,126,254,150, 5, 48, 95,105, 49, 70,181,163, 0, - 0, 2, 0,201, 0, 0, 4,236, 5,213, 0, 7, 0, 20, 0, 46, 64, 12, 22, 8, 4, 19, 28, 10, 46, 0, 25, 14, 16, 21, 16,252, -236,244,236, 50,196,196, 49, 64, 12, 19,149, 9,129, 10, 4,149, 18,173, 3,149, 10, 0, 47,236,244,236, 16,244,236, 48, 1, 16, - 41, 1, 17, 33, 34, 6, 17, 33, 17, 33, 34, 36, 53, 52, 36, 51, 33, 17, 33, 1,158, 1, 64, 1, 68,254,188,163,157, 3, 78,253, -232,251,254,240, 1, 16,251, 1, 78,253,124, 1,183,254,239, 2, 35,135, 3,147,250, 43,218,222,221,218, 1,192, 0, 2, 0,113, -255,227, 4, 90, 6, 20, 0, 17, 0, 25, 0, 0, 1, 17, 5, 53, 33, 17, 35, 53, 14, 1, 35, 34, 2, 16, 0, 51, 50, 22, 0, 16, - 22, 32, 54, 16, 38, 32, 3,162,253,107, 3, 77,184, 58,177,123,204,255, 0,255,204,123,177,253,200,167, 1, 36,167,167,254,220, - 3,182, 1,185, 1,166,249,236,168,100, 97, 1, 68, 2, 16, 1, 68, 97,254,224,254,106,231,231, 1,150,231, 0, 0, 2, 0,113, -254, 86, 4,117, 4, 99, 0, 28, 0, 45, 0, 0, 23, 22, 51, 50, 53, 52, 37, 38, 39, 38, 17, 16, 55, 54, 51, 50, 23, 22, 17, 20, - 7, 6, 7, 22, 21, 16, 33, 34, 39, 1, 54, 55, 54, 53, 52, 39, 38, 35, 34, 6, 21, 20, 23, 22, 23, 22,250,102,239,253,254,248, -208,117,142,137,137,240,239,138,137,137, 53, 75,156,254, 71,221,120, 1,232, 68, 55, 86, 85, 86,149,147,172, 91, 97,126, 64,203, - 70,117, 92, 48, 37,112,135, 1, 21, 1, 9,156,157,157,156,254,237,204,165, 64, 36, 79,141,254,240, 70, 1,216, 29, 73,113,204, -203,114,115,232,190,199, 96,103, 11, 6, 0, 0, 0, 1, 0,131, 0, 0, 4, 69, 5,213, 0, 11, 0, 43, 64, 9, 13, 5, 9, 28, - 0, 11, 7, 2, 12, 16,220,196,196,212,236, 50,196, 49, 64, 12, 10,149, 11,129, 2, 6,149, 7,173, 3,149, 2, 0, 47,236,244, -236, 16,244,236, 48, 1, 17, 33, 53, 33, 17, 33, 53, 33, 17, 33, 53, 4, 69,252, 62, 2,248,253, 57, 2,199,253, 26, 5,213,250, - 43,170, 2, 29,170, 1,186,170, 0, 2, 0,117,255,227, 5,217, 5,240, 0, 19, 0, 26, 0, 68, 64, 38, 1, 20, 0, 8,161, 7, -174, 4, 0,149, 20, 23,149, 17, 0,149, 20,173, 4,149, 11,145, 17,140, 27, 1, 20, 26, 26, 25, 15, 51, 20, 25, 7, 0, 16, 27, - 16,252,196,236,244,236, 17, 18, 57, 49, 0, 16,228,244,236,244,228, 16,238, 16,238, 16,244,238, 17, 18, 57, 48, 19, 33, 16, 0, - 33, 34, 6, 7, 53, 54, 36, 51, 32, 0, 17, 16, 0, 33, 32, 0, 55, 22, 0, 51, 50, 0, 55,117, 4,143,254,237,254,238,139,252, -112,111, 1, 7,146, 1, 94, 1,139,254,136,254,198,254,183,254,151,220, 13, 0,255,202,202, 0,255, 13, 3, 12, 1, 12, 1, 50, - 96, 95,215, 70, 72,254,103,254,146,254,159,254, 91, 1,183,204,195,254,228, 1, 28,195, 0, 0, 0, 1, 0,164,255,227, 4,123, - 5,240, 0, 40, 0, 64, 64, 36, 10,134, 9,136, 13,149, 6,145, 41, 0, 22,149, 19,173, 41, 31,134, 32,136, 28,149, 35,140, 41, - 42, 20, 9, 31, 16, 25, 3, 25, 25, 38, 16, 41, 16,252,236,212,236,212,196,196,204, 49, 0, 16,244,236,244,236, 16,244,236, 57, - 16,244,236,244,236, 48, 1, 46, 1, 53, 52, 36, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 59, 1, 21, 35, 34, 6, 21, - 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 32, 36, 53, 52, 54, 1,216,131,142, 1, 12,230, 89,201,115,114,190, 83,152,163,158,149, -182,174,165,185,199,190,109,200, 84,106,199, 94,254,232,254,208,163, 3, 37, 33,171,124,178,209, 32, 32,180, 38, 36,123,115,112, -119,166,149,132,143,150, 50, 49,195, 37, 37,242,221,144,196, 0, 0, 1,255,150,254,102, 4, 35, 5,213, 0, 17, 0, 65, 64, 31, - 17, 8, 18, 13,149, 12,176, 18, 6,149, 4, 2,149, 0,129, 4,173, 18, 17, 8, 0, 7, 12, 5, 1, 7, 3, 28, 0, 4, 18, 16, -252,236, 50,212,196,196, 17, 18, 57, 57, 49, 0, 16,236,244,236, 16,238, 16,244,236, 16, 57, 57, 48,178, 15, 11, 1, 1, 93, 19, - 33, 21, 33, 17, 33, 21, 33, 17, 16, 6, 43, 1, 53, 51, 50, 54, 53,201, 3, 90,253,112, 2, 80,253,176,205,227, 77, 63,134,110, - 5,213,170,254, 72,170,253,159,254,242,244,170,150,194, 0, 0, 0, 1,255,127,254, 86, 2,248, 6, 20, 0, 27, 0,101, 64, 35, - 19, 10, 15,135, 13,189, 29, 5, 24, 1, 20, 8,169, 6, 1,135, 0,151, 22, 6,188, 28, 2, 27, 7, 0, 7, 9, 5, 8, 21, 23, - 19, 76, 28, 16,252, 75,176, 10, 84, 88,185, 0, 19, 0, 64, 56, 89, 75,176, 22, 84, 88,185, 0, 19,255,192, 56, 89, 60,196,252, - 60,196,196, 18, 57, 57, 49, 0, 16,228, 50,252,236, 16,238, 50, 18, 57, 57, 16,244,236, 57, 57, 48, 1,182, 64, 29, 80, 29,160, - 29, 3, 93, 1, 21, 35, 34, 6, 29, 1, 33, 21, 33, 17, 20, 6, 43, 1, 53, 51, 50, 54, 53, 17, 35, 53, 51, 53, 52, 54, 51, 2, -248,176, 99, 77, 1, 47,254,209,174,189,174,176, 99, 77,176,176,174,189, 6, 20,153, 80,104, 99,143,251,235,187,171,153, 80,104, - 4, 42,143, 78,187,171, 0, 0, 0, 1, 0,115,255,227, 6,151, 7,100, 0, 38, 0, 70, 64, 39, 22,149, 21, 39, 0, 5, 36, 1, -149, 3, 36,149, 8, 26,161, 27, 30,149, 14,145, 8,140, 39, 21, 2, 0, 28, 4, 17, 28, 26, 52, 4, 51, 33, 25, 11, 70, 39, 16, -252,236,252,244,236, 16,252,196,196, 49, 0, 16,228,244,252,244,204, 16,254,212,238, 17, 57, 57, 16,220,236, 48, 37, 17, 33, 53, - 33, 17, 6, 4, 35, 32, 0, 17, 16, 0, 33, 50, 22, 23, 52, 54, 59, 1, 21, 35, 34, 6, 29, 1, 46, 1, 35, 32, 0, 17, 16, 0, - 33, 50, 54, 4,195,254,182, 2, 18,117,254,230,160,254,162,254,117, 1,139, 1, 94, 91,163, 68,201,227, 77, 63,134,110,112,252, -139,254,238,254,237, 1, 19, 1, 18,107,168,213, 1,145,166,253,127, 83, 85, 1,153, 1,109, 1,110, 1,153, 25, 25,188,234,170, -150,194,215, 95, 96,254,206,254,209,254,210,254,206, 37, 0, 0, 0, 2, 0, 8,254, 82, 5,118, 5,213, 0, 15, 0, 37, 0,149, - 64, 13, 39, 80, 18, 1, 18, 4, 25, 23, 12, 25, 31, 36, 38, 16,212,212,236,212,236,212, 93,196,181, 16, 8, 0, 3, 4, 12, 17, - 18, 23, 57, 49, 64, 10, 0,149, 27,189, 17, 37, 18, 36,129, 38, 0, 16,228, 50, 50, 50,244,236,179, 31, 23, 8, 27, 17, 18, 57, - 57, 48, 64, 12, 19, 17, 17, 18, 18, 8, 35, 37, 17, 36, 36, 8, 7, 5, 16,236, 60, 7, 16,236, 60,182, 19, 17, 8, 18, 8, 36, - 8, 7, 8, 16,236,182, 35, 17, 8, 36, 8, 18, 8, 7, 8, 16,236,180, 16, 37, 19, 17, 35, 15, 64, 16, 22, 21, 20, 3, 23, 19, - 36, 8, 34, 33, 32, 3, 31, 35, 18, 8, 4, 7, 17, 18, 23, 57, 7, 17, 18, 23, 57, 1, 50, 55, 54, 53, 52, 39, 38, 39, 6, 7, - 6, 21, 20, 23, 22, 19, 1, 51, 1, 22, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 53, 52, 55, 54, 55, 1, 51, 2,191, 54, 44, 28, - 31, 51, 44, 44, 51, 31, 28, 44, 54, 1,217,222,253,186,104, 67, 46, 75,100,155,155,100, 75, 46, 67,104,253,186,222,254,253, 32, - 20, 66, 57, 73,121, 92, 92,121, 73, 57, 66, 20, 32, 3,122, 3, 94,251,207,200,174,119, 66,139, 65, 87, 87, 65,139, 66,119,174, -200, 4, 49, 0, 0, 1, 0,186, 0, 0, 7, 71, 6, 20, 0, 67, 0, 0, 1, 52, 38, 35, 34, 6, 7, 17, 35, 17, 51, 17, 52, 54, - 51, 50, 22, 21, 17, 20, 23, 22, 59, 1, 50, 63, 1, 53, 51, 63, 2, 53, 51, 55, 53, 51, 53, 55, 51, 53, 63, 2, 54, 53, 52, 39, - 38, 39, 33, 22, 23, 22, 23, 22, 23, 22, 21, 20, 7, 6, 35, 7, 6, 39, 38, 53, 4,100,198,193,117,179, 66,185,185,172,149,124, -124, 81, 82,181, 70,225,142, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 30, 66, 54, 56,114,254,190, 46, 76, 77, 55, 15, 24, - 66, 88, 88,144, 51,103, 40, 38, 2,164,232,239,100,101, 2, 98,249,236, 2,121,164,190,158,156,254,245,214, 96, 96,146, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 42, 47,119,161,136,110,113,100, 12, 44, 45, 72, 21, 36,100,146,158, 98, 97, 1, 2, 50, - 49,153, 0, 0, 0, 1, 0,201, 0, 0, 2,198, 5,213, 0, 11, 0, 46, 64, 16, 11, 2, 0, 6,149, 0,129, 7, 5, 8, 6, 1, - 28, 0, 4, 12, 16,252, 75,176, 16, 84, 88,185, 0, 0, 0, 64, 56, 89,236,196, 57, 57, 49, 0, 47,228,236, 17, 57, 57, 48, 1, - 19, 51, 17, 20, 22, 59, 1, 21, 35, 34, 38, 17,201,202,110,134, 63, 77,227,205, 5,213,252, 45,194,150,170,244, 1, 14, 0, 0, - 0, 1, 0, 10, 0, 0, 2, 82, 5,213, 0, 11, 0, 69, 64, 17, 2, 11,149, 5, 8, 0,175, 6, 3, 5, 1, 28, 10, 8, 0, 4, - 12, 16,252, 60,196, 75,176, 16, 84, 88,187, 0, 8, 0, 64, 0, 0, 0, 64, 56, 56, 89,236, 50,196, 49, 0, 47,236,220, 60,244, - 50, 48, 1, 64, 13, 48, 13, 64, 13, 80, 13, 96, 13,143, 13,159, 13, 6, 93, 19, 51, 17, 51, 21, 35, 17, 35, 17, 35, 53, 51,201, -202,191,191,202,191,191, 5,213,253, 22,170,253,191, 2, 65,170, 0, 1, 0,201, 0, 0, 5,221, 5,222, 0, 18, 0, 0, 1, 54, - 31, 1, 55, 39, 38, 7, 6, 7, 1, 17, 35, 17, 51, 17, 1, 33, 1, 4, 80, 62, 58,172,105,237, 96, 76, 53, 71,253,203,202,202, - 2,205, 1, 10,252,230, 4,254, 59, 33,141,116,176, 72, 39, 27, 67,253,236, 2,119,250, 43, 2,207,253, 49, 3, 29, 0, 0, 0, - 0, 1, 0,185, 0, 0, 4,156, 6, 20, 0, 18, 0,193, 64, 44, 16, 17, 13, 14, 13, 15, 17, 14, 14, 13, 11, 17, 12, 13, 12, 10, - 17, 13, 13, 12, 66, 16, 13, 10, 3, 6,149, 3,151, 11,188, 17, 14, 4, 13, 9, 12, 14, 16, 9, 8, 0, 70, 19, 16,252,236, 50, -212,196, 17, 57,196, 49, 0, 47, 60,228,252,228, 23, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 5,237, 7, 16, 5,237, 7, 16, - 4,237, 89, 34,178, 16, 12, 1, 1, 93, 64, 95, 4, 10, 10, 16, 22, 10, 39, 10, 41, 13, 43, 16, 86, 10,102, 10,103, 16,115, 10, -119, 13,130, 10,137, 13,142, 16,147, 10,150, 13,151, 16,163, 10, 18, 17, 5, 17, 6, 10, 11, 11, 10, 15, 40, 11, 39, 12, 40, 13, - 43, 14, 43, 15, 64, 20,104, 11, 96, 20,137, 11,133, 12,137, 13,141, 14,143, 15,154, 11,151, 15,170, 11,167, 13,182, 15,197, 15, -214, 15,247, 11,240, 11,247, 12,240, 12, 26, 93,113, 0, 93, 19, 52, 54, 59, 1, 21, 35, 34, 6, 21, 17, 1, 51, 9, 1, 35, 1, - 17, 35,185,163,181,191,168,105, 76, 2, 37,235,253,174, 2,107,240,253,199,185, 4,126,214,192,156, 97,153,253,255, 1,227,253, -244,253,172, 2, 35,253,221, 0, 0, 1, 0, 10, 0, 0, 2, 42, 6, 20, 0, 11, 0, 50, 64, 7, 5, 1, 8, 8, 0, 70, 12, 16, -252, 60,236, 50, 49, 0, 64, 8, 2, 11,169, 5, 8, 0,151, 6, 47,236,212, 60,236, 50, 48, 64, 13, 16, 13, 64, 13, 80, 13, 96, - 13,112, 13,240, 13, 6, 1, 93, 19, 51, 17, 51, 21, 35, 17, 35, 17, 35, 53, 51,193,184,177,177,184,183,183, 6, 20,253, 56,144, -253, 68, 2,188,144, 0, 0, 0, 0, 1, 0, 61, 0, 0, 4,127, 6, 20, 0, 15, 0, 0, 51, 1, 39, 5, 39, 37, 39, 51, 23, 37, - 23, 5, 1, 35, 9, 1, 61, 1,235, 71,254,212, 33, 1, 41, 75,200, 52, 1, 58, 33,254,201, 1,237,195,254,198,254,126, 4, 50, -188,101, 99, 99,197,138,104, 97,104,250,215, 3, 60,252,196, 0, 0, 1, 0,178,255,227, 7, 39, 5,213, 0, 35, 0, 0, 37, 14, - 1, 35, 34, 38, 53, 17, 51, 17, 20, 23, 22, 51, 50, 54, 53, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, - 34, 38, 3,166, 69,192,130,175,190,203, 39, 57,117,143,166,203,114,119,123,166,203,203, 63,176,121,122,171,213,124,118,245,226, - 4, 27,251,239,186, 53, 78,190,164, 3,236,251,239,162,155,191,163, 3,236,250, 41,174,103, 98,124, 0, 0, 0, 0, 1,255,150, -254,102, 5, 51, 5,213, 0, 17, 0,140, 64, 41, 7, 17, 1, 2, 1, 2, 17, 6, 7, 6, 66, 8, 17, 0, 13,149, 12,176, 18, 7, - 2, 3, 0,175, 5, 6, 1, 7, 2, 28, 4, 54, 11, 14, 12, 57, 7, 28, 0, 4, 18, 16,252,236,228, 57, 57,252,236, 17, 57, 57, - 49, 0, 47,236, 50, 57, 57, 16,252,236, 17, 57, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, 4,237, 89, 34,178, 31, 11, 1, 1, - 93, 64, 48, 54, 2, 56, 7, 72, 2, 71, 7,105, 2,102, 7,128, 2, 7, 6, 1, 9, 6, 21, 1, 26, 6, 70, 1, 73, 6, 87, 1, - 88, 6,101, 1,105, 6,121, 6,133, 1,138, 6,149, 1,154, 6,159, 19, 16, 93, 0, 93, 19, 33, 1, 17, 51, 17, 33, 1, 17, 16, - 6, 43, 1, 53, 51, 50, 54, 53,201, 1, 16, 2,150,196,254,240,253,106,205,227, 71, 63,134,110, 5,213,251, 31, 4,225,250, 43, - 4,225,251,135,254,242,244,170,150,194, 0, 0,255,255, 0,186,254, 86, 4,100, 4,123, 16, 6, 2,213, 0, 0, 0, 3, 0,115, -255,227, 5,217, 5,240, 0, 11, 0, 18, 0, 25, 0, 47, 64, 11, 25, 16, 25, 6, 51, 15, 19, 25, 0, 16, 26, 16,252,236, 50,244, -236, 50, 49, 0, 64, 14, 22,149, 9, 15,149, 19,173, 12,149, 3,145, 9,140, 26, 16,228,244,236,244,228, 16,236, 48, 19, 16, 0, - 33, 32, 0, 17, 16, 0, 33, 32, 0, 1, 34, 2, 7, 33, 38, 2, 1, 22, 0, 51, 50, 0, 55,115, 1,121, 1, 59, 1, 58, 1,120, -254,136,254,198,254,197,254,135, 2,180,232,239, 6, 3,186, 6,239,253, 66, 13, 0,255,202,202, 0,255, 13, 2,233, 1, 98, 1, -165,254, 91,254,158,254,159,254, 91, 1,164, 3,197,254,172,236,236, 1, 84,253, 26,195,254,228, 1, 28,195, 0,255,255, 0,103, -255,227, 6,195, 5,240, 16, 38, 0, 50,244, 0, 16, 7, 2, 99, 6, 72, 0, 11,255,255, 0,118,255,227, 4,211, 4,235, 16, 39, - 2, 99, 4, 88, 0, 11, 16, 6, 0, 82, 5, 0, 0, 2, 0,115,255,227, 6,207, 5,240, 0, 10, 0, 30, 0, 0, 1, 34, 0, 17, - 16, 0, 51, 50, 55, 17, 38, 1, 17, 52, 38, 35, 17, 6, 33, 32, 0, 16, 0, 33, 50, 23, 33, 50, 22, 25, 1, 3, 39,220,254,253, - 1, 3,220,175,128,138, 2, 57,110,122,188,254,198,254,197,254,135, 1,121, 1, 59,112, 97, 1, 39,227,205, 5, 76,254,184,254, -229,254,230,254,184,164, 3,125,164,250,180, 3,211,194,150,251,139,211, 1,164, 2,196, 1,165, 27,244,254,242,252, 45, 0, 0, - 0, 2, 0,113,254, 86, 5, 89, 4,123, 0, 9, 0, 30, 0, 0, 1, 38, 7, 6, 16, 22, 32, 55, 17, 38, 1, 17, 52, 38, 35, 17, - 6, 35, 34, 0, 17, 16, 0, 51, 50, 23, 51, 50, 22, 21, 17, 2,115,147, 87, 86,171, 1, 42, 44, 44, 1,153, 76,105,137,240,241, -254,239, 1, 17,241,100, 82,216,181,163, 3,223, 2,117,116,254,110,231, 89, 2,168, 95,250,119, 4,116,153, 97,252,188,157, 1, - 57, 1, 19, 1, 20, 1, 56, 27,192,214,251,140, 0, 2,255,151, 0, 0, 4,241, 5,213, 0, 8, 0, 28, 0, 58, 64, 24, 1,149, - 16, 0,149, 9,129, 18, 16, 10, 8, 2, 4, 0, 5, 25, 13, 63, 17, 0, 28, 9, 4, 29, 16,252,236, 50,252,236, 17, 23, 57, 49, - 0, 47,244,236,212,236, 48, 64, 11, 15, 21, 31, 21, 63, 21, 95, 21,175, 21, 5, 1, 93, 1, 17, 51, 50, 54, 53, 52, 38, 35, 37, - 33, 50, 4, 21, 20, 4, 43, 1, 17, 35, 17, 34, 6, 29, 1, 35, 53, 52, 54, 1,247,254,141,154,154,141,254, 56, 1,200,251, 1, - 1,254,255,251,254,202,132,118,156,192, 5, 47,253,207,146,135,134,146,166,227,219,221,226,253,168, 5, 48, 95,105, 49, 70,181, -163, 0, 0, 0, 0, 2, 0,184,254, 86, 4,164, 6, 20, 0, 24, 0, 36, 0, 79, 64, 36, 35,185, 0, 23, 29,185, 14, 17,184, 23, -140, 1,189, 37, 3, 12, 9,169, 6,151, 37, 26, 18, 20, 71, 6, 9, 3, 7, 32, 12, 0, 8, 2, 70, 37, 16,252,236, 50, 50,204, - 17, 57, 57,244,236, 49, 0, 16,244,236, 57, 57, 16,228,228,244,196,236, 16,196,238, 48, 64, 9, 96, 39,128, 39,160, 39,224, 39, - 4, 1, 93, 37, 17, 35, 3, 52, 54, 59, 1, 21, 35, 34, 6, 29, 1, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 1, 52, 38, 35, - 34, 6, 21, 20, 22, 51, 50, 54, 1,115,185, 1,163,181,254,231,105, 76, 58,177,123,204, 0,255,255,204,123,177, 2, 56,167,146, -146,167,167,146,146,167,168,253,174, 6, 40,214,192,156, 97,153,200,100, 97,254,188,254,248,254,248,254,188, 97, 1,235,203,231, -231,203,203,231,231, 0, 0, 0, 0, 2, 0,201,254, 86, 4,166, 5,213, 0, 29, 0, 38, 0, 0, 19, 51, 17, 51, 50, 4, 16, 7, - 6, 7, 22, 23, 19, 22, 23, 22, 59, 1, 21, 35, 34, 39, 38, 39, 3, 38, 43, 1, 17, 35, 1, 51, 50, 54, 16, 38, 43, 1, 17,201, -202,254,251, 1, 1,129,101,178, 10, 9,144, 54, 39, 42, 76, 59, 98,127, 71, 74, 78,153, 21, 46,119,202, 1, 2,198,141,154,153, -142,254, 5,213,254,248,225,254, 72,113, 89, 19, 20, 23,254,146,136, 34, 36,154, 61, 63,198, 1,133, 53,254,174, 1,248,146, 1, - 12,145,253,209, 0, 1, 0, 69,255,227, 4, 96, 5,240, 0, 39, 0, 0, 19, 62, 1, 51, 50, 4, 21, 20, 6, 15, 1, 14, 1, 21, - 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 32, 36, 53, 52, 54, 63, 1, 62, 1, 53, 52, 38, 35, 34, 6, 7,159,114,218,105,245, 1, - 23,202,226,123,154,135,188,173,114,236,123,128,239,106,254,231,254,221,215,226,122,166,119,179,165, 95,204,115, 5,164, 38, 38, -228,198,171,192, 45, 24, 31,124,110,126,136, 70, 69,208, 47, 48,224,217,182,217, 43, 25, 31,101, 99,118,128, 54, 55, 0, 0, 0, - 0, 1, 0,100,255,227, 3,188, 4,123, 0, 39, 0,207, 64, 17, 10, 30, 29, 9, 13, 33, 20, 33, 8, 6, 13, 8, 0, 82, 26, 69, - 40, 16,252,228,236,212,236,196, 17, 18, 57, 57, 57, 57, 49, 64, 25, 30, 29, 10, 9, 4, 19, 0,134, 39,137, 36, 20,134, 19,137, - 16,185, 23, 36,185, 3,184, 23,140, 40, 0, 16,228,244,236, 16,254,245,238, 16,245,238, 18, 23, 57, 48, 64, 18, 27, 28, 2, 26, - 29, 83, 9, 10, 32, 31, 2, 33, 30, 83, 10, 10, 9, 66, 75, 83, 88, 7, 16, 14,237, 17, 23, 57, 7, 14,237, 17, 23, 57, 89, 34, -178, 0, 1, 1, 1, 93, 64, 17, 47, 41, 63, 41, 95, 41,127, 41,128, 41,144, 41,160, 41,240, 41, 8, 93, 64, 37, 32, 0, 32, 39, - 36, 38, 40, 30, 40, 29, 42, 21, 47, 20, 47, 19, 42, 18, 40, 10, 40, 9, 41, 8, 41, 7, 36, 1,134, 30,134, 29,134, 28,134, 27, - 18, 0, 93, 64, 23, 28, 30, 28, 29, 28, 28, 46, 31, 44, 30, 44, 29, 44, 28, 59, 31, 59, 30, 59, 29, 59, 28, 11,113, 19, 62, 1, - 51, 50, 22, 21, 20, 6, 15, 1, 14, 1, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 52, 54, 63, 1, 62, 1, 53, 52, - 38, 35, 34, 6, 7,160, 76,180,102,206,224,152,171, 64,171,101,140,130, 97,198,102,108,195, 90,216,247,165,196, 63,148, 98,137, -137, 90,168, 78, 4, 63, 30, 30,172,158,130,149, 36, 15, 37, 80, 75, 81, 89, 53, 53,190, 35, 35,182,156,137,153, 42, 14, 33, 73, - 64, 84, 84, 40, 40, 0, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 16, 6, 2,193, 0, 0, 0, 2,254,242,254, 86, 2,215, - 6, 20, 0, 8, 0, 33, 0, 0, 19, 38, 39, 38, 35, 34, 7, 6, 51, 5, 3, 20, 23, 22, 59, 1, 21, 35, 34, 39, 38, 53, 17, 35, - 32, 53, 52, 33, 50, 23, 22, 23, 51, 21,180, 7, 18, 33,110,124, 3, 3,119, 1,120, 2, 39, 37,100,176,174,195, 81, 87,190,254, -242, 1, 47,181, 82, 53, 18,191, 5, 4, 45, 23, 48, 65, 51,154,251, 61,103, 41, 40,153, 86, 92,180, 4,174,210,216, 96, 64,111, -155, 0, 0, 0, 0, 1, 0, 55,254, 86, 2,242, 5,158, 0, 29, 0, 0, 1, 17, 33, 21, 33, 17, 20, 22, 59, 1, 21, 20, 6, 43, - 1, 53, 51, 50, 54, 61, 1, 35, 34, 38, 53, 17, 35, 53, 51, 17, 1,119, 1,123,254,133, 75,115,189,164,180, 70, 48,106, 76, 5, -213,162,135,135, 5,158,254,194,143,253,160,137, 78,174,214,192,156, 97,153, 20,159,210, 2, 96,143, 1, 62, 0, 0, 1, 0, 24, - 0, 0, 4,233, 5,213, 0, 15, 0, 88, 64, 21, 13, 10, 12, 6, 2,149, 0,129, 4, 0, 7, 1, 64, 3, 28, 5, 11, 28, 13, 5, - 16, 16,212,212,236, 16,252,228, 57, 57, 49, 0, 47,244,236, 50,196, 57, 57, 48, 1, 75,176, 10, 84, 88,189, 0, 16, 0, 64, 0, - 1, 0, 16, 0, 16,255,192, 56, 17, 55, 56, 89, 64, 19, 0, 17, 31, 0, 16, 1, 16, 2, 31, 7, 16, 17, 64, 17,112, 17,159, 17, - 9, 93, 1, 33, 21, 33, 17, 35, 17, 35, 34, 6, 29, 1, 35, 53, 52, 54, 1,174, 3, 59,253,238,203, 94,132,118,156,192, 5,213, -170,250,213, 5, 43, 90,105, 49, 70,181,163, 0, 0, 1, 0, 55, 0, 0, 2,242, 6, 20, 0, 27, 0, 73, 64, 16, 25, 22, 11, 8, - 4, 23, 9, 2, 4, 0, 8, 16, 19, 14, 70, 28, 16,252, 60,196,252, 60,196, 50, 50, 23, 57, 49, 0, 64, 19, 19, 0, 25,135, 22, -151, 10, 14, 5, 8, 15, 3,169, 17, 1,188, 8,135, 10, 47,236,244, 60,236, 50, 17, 57, 57, 16,244,236, 57, 57, 48,178,175, 21, - 1, 1, 93, 1, 21, 33, 21, 33, 17, 20, 22, 59, 1, 21, 35, 34, 38, 53, 17, 35, 53, 51, 53, 52, 54, 59, 1, 21, 35, 34, 6, 1, -119, 1,123,254,133, 75,115,189,189,213,162,135,135,174,189,174,176, 99, 77, 4,195, 99,143,253,160,137, 78,154,159,210, 2, 96, -143, 78,187,171,153, 81, 0, 0, 0, 1,255,250,254,102, 4,233, 5,213, 0, 15, 0, 84, 64, 20, 7,149, 10,189, 16, 14, 2,149, - 0,129, 16, 8, 1, 64, 3, 28, 0, 64, 13, 16, 16,212,228,252,228,196, 49, 0, 16,244,236, 50, 16,244,236, 48, 1, 75,176, 10, - 84, 88,189, 0, 16, 0, 64, 0, 1, 0, 16, 0, 16,255,192, 56, 17, 55, 56, 89, 64, 19, 0, 17, 31, 0, 16, 1, 16, 2, 31, 15, - 16, 17, 64, 17,112, 17,159, 17, 17, 93, 3, 33, 21, 33, 17, 20, 22, 59, 1, 21, 35, 34, 38, 25, 1, 33, 6, 4,239,253,238,110, -134, 63, 78,227,205,253,238, 5,213,170,251, 61,194,150,170,244, 1, 14, 4,195,255,255, 0,173,255,247, 6, 95, 5,233, 16, 38, - 0, 56,251, 20, 16, 7, 2, 99, 5,228, 0, 11,255,255, 0,176,255,227, 5,105, 4,235, 16, 39, 2, 99, 4,238, 0, 11, 16, 6, - 0, 88, 2, 0, 0, 1, 0, 78,255,227, 5,207, 5,202, 0, 31, 0, 58, 64, 16, 3, 6, 25, 40, 16, 0, 28, 51, 22, 15, 12, 25, - 18, 22, 16, 32, 16,252,196,252,196, 16,244,196,236,252,196, 49, 0, 64, 14, 19, 15, 31, 3,149, 2, 16,129, 32, 9,149, 25,140, - 32, 16,244,236, 16,252, 60,236, 50, 50, 50, 48, 1, 53, 33, 21, 22, 18, 21, 20, 0, 35, 34, 0, 53, 52, 18, 55, 53, 33, 21, 33, - 6, 2, 21, 16, 0, 33, 32, 0, 17, 52, 2, 39, 5,207,253,168,177,198,254,248,216,216,254,247,199,178,253,168, 1, 63,158,145, - 1,127, 1, 49, 1, 47, 1,129,142,161, 5, 24,178,178, 97,254,180,202,240,254,222, 1, 35,239,202, 1, 76, 97,178,178,139,254, -214,184,254,194,254,118, 1,137, 1, 53,194, 1, 40,141, 0, 0, 0, 1, 0,201,255,254, 5,118, 5,213, 0, 26, 0, 0, 37, 35, - 34, 38, 53, 17, 35, 17, 16, 23, 22, 31, 1, 32, 0, 17, 52, 2, 47, 1, 21, 22, 23, 22, 21, 20, 0, 2,198, 63,134,110,202,103, - 97,232, 77, 1, 47, 1,129,142,161,179,110, 65, 99,254,248,170,150,194, 3,211,252, 45,254,242,122,116, 6, 2, 1,137, 1, 53, -194, 1, 40,141, 1, 68, 87,109,166,202,240,254,222, 0, 0, 0, 0, 1,255,252, 0, 0, 5,220, 5,237, 0, 16, 0, 0, 9, 1, - 54, 55, 54, 23, 5, 7, 39, 6, 7, 1, 17, 35, 17, 1, 51, 2,115, 1, 72, 52, 49, 66,109, 1, 13, 78,198, 85, 38,254,138,203, -253,240,217, 3,111, 1,235, 78, 40, 54, 49,122,135,101, 6, 57,253,205,253, 57, 2,199, 3, 14, 0, 1, 0, 61,254, 86, 5,150, - 4,112, 0, 23, 0, 0, 5, 14, 1, 43, 1, 53, 51, 50, 54, 63, 1, 1, 51, 9, 1, 54, 55, 54, 31, 1, 7, 39, 38, 7, 2,147, - 78,148,124,147,108, 76, 84, 51, 33,254, 59,195, 1, 94, 1, 23, 50, 81, 97,101,215, 53,195, 81, 28,104,200,122,154, 72,134, 84, - 4, 78,252,148, 2,187,126, 41, 50, 48,101,147, 94, 39, 69, 0, 0, 1, 0, 92, 0, 0, 5, 31, 5,213, 0, 17, 0, 0, 19, 33, - 21, 1, 33, 21, 33, 1, 33, 21, 33, 53, 1, 33, 53, 33, 1, 33,115, 4,149,254,112, 1, 25,254,115,254, 84, 3,199,251, 61, 1, -185,254,213, 1,159, 1,131,252,103, 5,213,154,254, 17,144,253,238,170,154, 2, 34,144, 1,223, 0, 1, 0, 88, 0, 0, 3,219, - 4, 96, 0, 17, 0, 0, 19, 33, 21, 3, 51, 21, 33, 1, 33, 21, 33, 53, 1, 35, 53, 33, 1, 33,113, 3,106,251,194,254,194,254, -195, 2,180,252,125, 1, 43,212, 1, 80, 1, 13,253,101, 4, 96,168,254,220,144,254,143,147,168, 1, 92,144, 1, 57, 0, 0, 0, - 0, 1, 0,160,255,193, 4,248, 5,213, 0, 37, 0, 0, 37, 50, 55, 54, 53, 52, 39, 38, 43, 1, 53, 1, 33, 53, 33, 21, 1, 50, - 23, 22, 23, 22, 21, 20, 15, 1, 6, 7, 6, 33, 34, 39, 38, 39, 53, 22, 23, 22, 2,168,192, 99,100, 92, 93,165,174, 1,129,252, -252, 4, 0,254,101,106,128, 98, 86, 81, 59, 28, 20, 45,152,254,232,119,125,126,134,106,127,126,107, 75, 75,143,134, 73, 74,166, - 1,220,170,168,254, 36, 56, 42,109,104,138,151, 85, 41, 29, 36,121, 19, 18, 37,195, 49, 25, 25, 0, 1, 0, 92,255,193, 4,180, - 5,213, 0, 37, 0, 0, 37, 50, 55, 54, 55, 21, 6, 7, 6, 35, 32, 39, 38, 47, 1, 38, 53, 52, 55, 54, 55, 54, 51, 1, 53, 33, - 21, 33, 1, 21, 35, 34, 7, 6, 21, 20, 23, 22, 2,172,137,126,127,106,134,126,125,119,254,232,152, 45, 20, 28, 59, 81, 86, 98, -128,106,254,101, 4, 0,252,252, 1,129,174,165, 93, 92,100, 99,107, 25, 25, 49,195, 37, 18, 19,121, 36, 29, 41, 85,151,138,104, -109, 42, 56, 1,220,168,170,254, 36,166, 74, 73,134,143, 75, 75, 0, 1, 0,104,254, 76, 4, 63, 4, 96, 0, 36, 0, 0, 1, 34, - 7, 6, 7, 6, 21, 20, 31, 1, 22, 23, 22, 33, 50, 55, 54, 55, 53, 14, 1, 35, 34, 39, 38, 53, 52, 55, 54, 59, 1, 53, 1, 33, - 53, 33, 21, 2, 91,106,128, 98, 86, 81, 59, 28, 28, 37,152, 1, 24, 94, 99,100,106, 84,200,109,190, 99,100, 92, 93,165,174,254, - 82, 2,155,252,150, 1,220, 56, 42,109,104,138,138, 98, 41, 36, 29,121, 18, 19, 37,195, 49, 50, 75, 75,143,132, 75, 74,166, 1, -243,147,168, 0, 0, 1, 0,113,254, 86, 3,232, 4, 96, 0, 31, 0, 0, 1, 50, 55, 54, 55, 21, 6, 7, 6, 35, 32, 17, 52, 37, - 36, 53, 52, 35, 33, 1, 33, 53, 33, 21, 1, 32, 21, 16, 5, 6, 21, 20, 2,127, 84, 77, 79, 81, 87, 80, 86, 97,254, 32, 1,150, - 1, 28,235,254,222, 1,229,253,101, 3,106,254,158, 1,111,254, 48,226,254,238, 21, 21, 44,179, 32, 13, 14, 1, 25,238, 53, 37, - 98,124, 2, 56,147,168,254,100,229,254,236, 49, 24, 97,139, 0, 0, 1, 0,150, 0, 0, 4, 74, 5,240, 0, 34, 0, 0, 37, 33, - 21, 33, 53, 1, 55, 33, 53, 33, 54, 55, 54, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 4, 21, 20, 7, 6, 7, 51, 21, 35, - 7, 1,137, 2,193,252, 76, 1, 58,115,254,167, 1,226, 95, 37, 39,167,134, 95,211,120,122,212, 88,232, 1, 20, 34, 31, 74,104, -236, 48,170,170,170, 1, 64,117,144,109, 72, 76, 73,119,150, 66, 67,204, 49, 50,232,194, 92, 82, 73, 96,144, 49, 0, 1, 0, 93, -255,193, 4,249, 5,213, 0, 40, 0, 0, 1, 50, 23, 22, 23, 22, 21, 20, 15, 1, 6, 7, 6, 33, 32, 39, 38, 47, 1, 38, 53, 51, - 20, 23, 22, 32, 55, 54, 53, 52, 39, 38, 35, 33, 21, 35, 17, 33, 21, 33, 17, 3, 6,104,130, 99, 85, 81, 59, 28, 20, 45,152,254, -232,254,220,152, 45, 20, 28, 59,201,100, 99, 1,124, 99,100, 92, 93,165,254,193,202, 3,161,253, 41, 3, 81, 56, 43,108,104,138, -151, 85, 41, 29, 36,121,121, 36, 29, 41, 85,151,143, 75, 75, 75, 75,143,134, 73, 74, 1, 3, 45,170,254, 37, 0, 0, 1, 0,104, -254, 76, 4, 63, 4, 96, 0, 37, 0, 0, 1, 50, 23, 22, 23, 22, 21, 20, 15, 1, 6, 7, 6, 33, 34, 39, 38, 39, 53, 30, 1, 51, - 50, 55, 54, 53, 52, 39, 38, 35, 33, 53, 51, 19, 33, 21, 33, 3, 2, 76,105,129, 99, 85, 81, 59, 28, 20, 45,152,254,232, 94, 99, -100,106, 84,200,109,190, 99,100, 92, 93,165,254,158, 1, 3, 3, 22,253,162, 3, 1,220, 56, 43,108,104,138,151, 85, 41, 29, 36, -121, 18, 19, 37,195, 49, 50, 75, 75,143,134, 73, 74,168, 2,132,170,254, 38, 0, 0, 1, 0, 88,255,227, 3,165, 5,158, 0, 36, - 0, 0, 1, 7, 22, 23, 22, 21, 20, 7, 6, 33, 34, 39, 38, 39, 53, 22, 23, 22, 51, 50, 55, 54, 55, 52, 39, 38, 43, 1, 19, 35, - 53, 51, 17, 51, 17, 51, 21, 2, 33, 2,170,112,108,110,137,254,237, 85, 81, 81, 76, 73, 84, 78, 80,179, 99, 57, 1, 58, 86,192, - 62, 2,229,229,202,231, 3,230,125, 30,119,115,170,186,125,157, 18, 17, 35,172, 40, 24, 22,114, 65,133, 98, 76,114, 1, 15,164, - 1, 20,254,236,164, 0, 0, 0, 0, 2, 0,186,254, 86, 4,164, 4,123, 0, 14, 0, 23, 0, 0, 5, 17, 35, 17, 51, 21, 54, 55, - 54, 51, 50, 23, 22, 21, 16, 1, 0, 53, 52, 39, 38, 35, 34, 7, 1,115,185,185, 52,135, 81,210,184, 77, 78,252,207, 2,114, 57, - 56,120,220,173,122,254,208, 6, 10,170, 66, 82, 49,112,113,153,254, 87,254,228, 1,144,249,133, 66, 65,239, 0, 0, 1, 0,201, -254, 86, 1,147, 5,213, 0, 3, 0, 0, 19, 51, 17, 35,201,202,202, 5,213,248,129, 0, 0, 0,255,255, 0,201,254, 86, 3, 39, - 5,213, 16, 39, 1,130, 1,148, 0, 0, 16, 6, 1,130, 0, 0, 0, 1, 0, 20,254, 86, 3,156, 5,213, 0, 19, 0, 0, 1, 51, - 17, 33, 21, 33, 21, 33, 21, 33, 17, 35, 17, 33, 53, 33, 53, 33, 53, 33, 1,115,202, 1, 95,254,161, 1, 95,254,161,202,254,161, - 1, 95,254,161, 1, 95, 5,213,253,151,168,240,170,253, 44, 2,212,170,240,168,255,255, 0,201, 0, 0, 1,148, 5,213, 16, 6, - 0, 4,148, 0,255,255, 0,201, 0, 0, 10,208, 5,213, 16, 39, 1, 63, 5,177, 0, 0, 16, 6, 0, 39, 0, 0,255,255, 0,201, - 0, 0, 9,176, 6,102, 16, 39, 1, 64, 5,213, 0, 0, 16, 6, 0, 39, 0, 0,255,255, 0,113,255,227, 8,145, 6,102, 16, 39, - 1, 64, 4,182, 0, 0, 16, 6, 0, 71, 0, 0,255,255, 0,201,254,102, 6, 36, 5,213, 16, 39, 0, 45, 4,145, 0, 0, 16, 6, - 0, 47, 0, 0,255,255, 0,201,254, 86, 5,222, 6, 20, 16, 39, 0, 77, 4,101, 0, 0, 16, 6, 0, 47, 0, 0,255,255, 0,193, -254, 86, 2,239, 6, 20, 16, 39, 0, 77, 1,118, 0, 0, 16, 6, 0, 79, 0, 0,255,255, 0,201,254,102, 6,242, 5,213, 16, 39, - 0, 45, 5, 95, 0, 0, 16, 6, 0, 49, 0, 0,255,255, 0,201,254, 86, 6,183, 6, 20, 16, 39, 0, 77, 5, 62, 0, 0, 16, 6, - 0, 49, 0, 0,255,255, 0,186,254, 86, 5,222, 6, 20, 16, 39, 0, 77, 4,101, 0, 0, 16, 6, 0, 81, 0, 0,255,255, 0, 16, - 0, 0, 5,104, 5,213, 18, 38, 0, 36, 0, 0, 17, 7, 6,137, 4,190, 1,117, 0, 6,177, 14, 0, 16, 60, 49,255,255, 0,123, -255,227, 4, 45, 6,102, 18, 38, 0, 68, 0, 0, 17, 6, 2, 32, 90, 0, 0, 8,180, 11, 43, 39, 20, 7, 43, 49,255,255, 0,201, - 0, 0, 1,147, 5,213, 18, 38, 0, 44, 0, 0, 17, 7, 6,137, 3, 47, 1,117, 0, 11,180, 7, 32, 1, 0, 0, 16, 73, 99, 58, - 49, 0, 0, 0,255,255,255,224, 0, 0, 2, 94, 6,102, 18, 38, 0,243, 0, 0, 17, 7, 2, 32,255, 31, 0, 0, 0, 11,180, 7, - 32, 1, 0, 0, 16, 73, 99, 58, 49, 0, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 0, 50, 0, 0, 16, 7, 6,137, - 5, 39, 1,117,255,255, 0,113,255,227, 4,117, 6,102, 18, 38, 0, 82, 0, 0, 17, 6, 2, 32,118, 0, 0, 6,177, 27, 12, 16, - 60, 49, 0, 0,255,255, 0,178,255,227, 5, 41, 5,213, 18, 38, 0, 56, 0, 0, 17, 7, 6,137, 4,246, 1,117, 0, 6,177, 21, - 5, 16, 60, 49,255,255, 0,174,255,227, 4, 88, 6,102, 18, 38, 0, 88, 0, 0, 17, 6, 2, 32,118, 0, 0, 11,180, 23, 32, 11, - 1, 1, 16, 73, 99, 58, 49, 0,255,255, 0,178,255,227, 5, 41, 5,213, 16, 38, 6,143, 48, 0, 18, 2, 0, 56, 0, 0, 0, 0, -255,255, 0,174,255,227, 4, 88, 7, 49, 16, 39, 0,113, 0,123, 1, 59, 18, 6, 0,190, 0, 0,255,255, 0,178,255,227, 5, 41, - 5,213, 16, 38, 0, 56, 0, 0, 16, 6, 6,146, 54, 0, 0, 0,255,255, 0,174,255,227, 4, 88, 4, 96, 16, 38, 0, 88, 0, 0, - 16, 7, 6,146,255,190,254,200,255,255, 0,178,255,227, 5, 41, 5,213, 16, 38, 0, 56, 0, 0, 16, 6, 6,151, 48, 0, 0, 0, -255,255, 0,174,255,227, 4, 88, 4, 96, 16, 38, 0, 88, 0, 0, 16, 7, 6,151,255,196,254,200,255,255, 0,178,255,227, 5, 41, - 5,213, 16, 38, 0, 56, 0, 0, 16, 6, 6,147, 48, 6, 0, 0,255,255, 0,174,255,227, 4, 88, 4, 96, 16, 38, 0, 88, 0, 0, - 16, 7, 6,147,255,190,254,200,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 16, 6, 2, 4, 0, 0,255,255, 0, 16, 0, 0, 5,104, - 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,143, 0, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 7, 49, 18, 38, 0,166, 0, 0, - 16, 7, 0,113, 0, 82, 1, 59,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,145, 0, 0, 0, 0, -255,255, 0,123,255,227, 4, 45, 4,123, 18, 34, 0, 68, 0, 0, 16, 7, 6,145,255,147,254,193,255,255, 0, 8, 0, 0, 7, 72, - 7, 52, 16, 39, 0,113, 2,215, 1, 62, 18, 6, 0,136, 0, 0,255,255, 0,123,255,227, 7,111, 5,242, 16, 39, 0,113, 1,232, -255,252, 18, 6, 0,168, 0, 0, 0, 1, 0,115,255,227, 6, 4, 5,240, 0, 37, 0, 0, 1, 21, 6, 4, 35, 32, 0, 17, 16, 0, - 33, 50, 4, 23, 21, 46, 1, 35, 32, 0, 17, 16, 0, 33, 50, 54, 55, 53, 35, 53, 51, 53, 33, 53, 33, 17, 51, 21, 5,139,117,254, -230,160,254,162,254,117, 1,139, 1, 94,146, 1, 7,111,112,252,139,254,238,254,237, 1, 19, 1, 18,107,168, 67,253,253,254,182, - 2, 18,121, 1,138,255, 83, 85, 1,153, 1,109, 1,110, 1,153, 72, 70,215, 95, 96,254,206,254,209,254,210,254,206, 37, 39,181, - 88,132,166,254,214, 88, 0, 0, 0, 2, 0,113,254, 86, 4,250, 4,123, 0, 11, 0, 52, 0, 0, 1, 52, 38, 35, 34, 6, 21, 20, - 22, 51, 50, 54, 3, 54, 61, 1, 14, 1, 35, 34, 2, 17, 16, 18, 51, 50, 22, 23, 53, 51, 17, 20, 7, 51, 21, 35, 6, 7, 6, 33, - 34, 38, 39, 53, 30, 1, 51, 50, 55, 54, 55, 5, 53, 3,162,165,149,148,165,165,148,149,165, 22, 22, 57,178,124,206,252,252,206, -124,178, 57,184, 19,179,198, 31, 58,127,254,250, 97,172, 81, 81,158, 82,181, 90, 21, 17,253,132, 2, 61,200,220,220,200,199,220, -220,254, 79, 71, 94, 91, 99, 98, 1, 58, 1, 3, 1, 4, 1, 58, 98, 99,170,252, 43,110, 88, 70, 93, 64,140, 29, 30,179, 44, 42, - 95, 23, 28, 1, 70, 0, 0, 0,255,255, 0,115,255,227, 5,139, 5,240, 18, 34, 0, 42, 0, 0, 17, 7, 6,137, 5, 74, 1,117, - 0, 16,177, 33, 14, 16, 60, 64, 7,148, 33, 84, 33, 36, 33, 3, 93, 49, 0, 0,255,255, 0,113,254, 86, 4, 90, 6, 99, 16, 34, - 2, 32, 74,253, 18, 2, 0, 74, 0, 0, 0, 0,255,255, 0,201, 0, 0, 5,106, 5,213, 16, 39, 6,137, 4,162, 1,117, 18, 2, - 0, 46, 0, 0,255,255, 0,186, 0, 0, 4,156, 6, 20, 18, 34, 0, 78, 0, 0, 17, 7, 6,137, 3, 26, 1,117, 0, 42,180, 1, - 16, 12, 0, 7, 43, 49, 0, 75,176, 14, 81, 88,187, 0, 1,255,192, 0, 0,255,192, 56, 56, 89, 64, 13,144, 1,144, 0,128, 1, -128, 0, 64, 1, 64, 0, 6, 93,255,255, 0,115,254,101, 5,217, 5,240, 16, 39, 2, 52, 1, 52,255,240, 18, 6, 0, 50, 0, 0, -255,255, 0,113,254,101, 4,117, 4,123, 16, 39, 2, 52, 0,128,255,240, 18, 6, 0, 82, 0, 0,255,255, 0,115,254,101, 5,217, - 7, 49, 16, 39, 0,113, 1, 39, 1, 59, 18, 6, 1,172, 0, 0,255,255, 0,113,254,101, 4,117, 5,245, 16, 38, 0,113,115,255, - 18, 6, 1,173, 0, 0, 0, 0,255,255, 0,160,255,193, 4,248, 5,213, 16, 39, 6,137, 4,190, 1,117, 18, 2, 1,121, 0, 0, -255,255, 0,220, 4,238, 3, 90, 6,102, 16, 38, 2, 32, 27, 0, 16, 6, 2, 8, 0, 0, 0, 0,255,255,255,219,254, 86, 2,100, - 6,102, 16, 39, 2, 32,255, 37, 0, 0, 17, 6, 1,249, 0, 0, 0, 11,180, 3, 32, 8, 7, 7, 16, 73, 99, 58, 49, 0, 0, 0, -255,255, 0,201, 0, 0, 10,208, 5,213, 16, 39, 0, 61, 5,177, 0, 0, 16, 6, 0, 39, 0, 0,255,255, 0,201, 0, 0, 9,176, - 5,213, 16, 39, 0, 93, 5,213, 0, 0, 16, 6, 0, 39, 0, 0,255,255, 0,113,255,227, 8,145, 6, 20, 16, 39, 0, 93, 4,182, - 0, 0, 16, 6, 0, 71, 0, 0,255,255, 0,115,255,227, 5,139, 7,107, 18, 34, 0, 42, 0, 0, 16, 67, 0,118, 1, 22, 2,240, - 64, 0, 44,204,255,255, 0,113,254, 86, 4, 90, 6, 99, 18, 34, 0, 74, 0, 0, 16, 2, 0,118, 27,253, 0, 0, 0, 1, 0,201, -255,227, 8, 45, 5,213, 0, 29, 0, 0, 1, 17, 20, 7, 6, 33, 32, 39, 38, 53, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, 20, - 23, 22, 23, 50, 55, 54, 53, 17, 8, 45,100, 96,254,230,254,237,103,100,253, 34,202,202, 2,222,202, 62, 61,153,148, 66, 62, 4, - 96,253, 90,223,128,120,120,118,233, 1, 13,253, 57, 5,213,253,156, 2,100,251,236,159, 80, 78, 1, 79, 75,164, 2,159, 0, 0, - 0, 2, 0,201,254, 86, 5, 2, 5,240, 0, 14, 0, 23, 0, 0, 37, 17, 35, 17, 51, 21, 54, 55, 54, 51, 50, 23, 22, 21, 16, 1, - 0, 17, 52, 39, 38, 35, 34, 3, 1,147,202,202, 56,145, 87,226,198, 83, 84,252,145, 2,161, 61, 60,129,237,186,156,253,186, 7, -127,185, 72, 87, 53,120,122,164,254, 55,254,206, 1,174, 1, 12,143, 71, 70,254,255, 0, 0, 0,255,255, 0,201, 0, 0, 5, 51, - 5,213, 16, 39, 6,135, 5, 30, 1,117, 18, 2, 0, 49, 0, 0,255,255, 0,186, 0, 0, 4,100, 6,100, 18, 34, 0, 81, 0, 0, - 16, 3, 0, 67, 1, 24,255,254,255,255, 0, 16, 0, 0, 5,104, 7,109, 16, 34, 0,135, 0, 0, 16, 7, 6,133, 6, 92, 1,125, -255,255, 0,123,255,227, 4, 45, 7, 6, 16, 34, 0,167, 0, 0, 16, 7, 6,133, 5,236, 1,125,255,255, 0, 8, 0, 0, 7, 72, - 5,213, 16, 39, 6,133, 6, 92, 1,118, 18, 2, 0,136, 0, 0,255,255, 0,123,255,227, 7,111, 6, 99, 18, 34, 0,168, 0, 0, - 16, 3, 0,118, 1,101,255,253,255,255, 0,102,255,186, 5,229, 6, 23, 16, 39, 6,133, 4,254, 1,118, 18, 2, 0,154, 0, 0, -255,255, 0, 72,255,162, 4,156, 6, 99, 18, 34, 0,186, 0, 0, 16, 2, 0,118, 28,253, 0, 0,255,255, 0, 16, 0, 0, 5,104, - 5,213, 18, 34, 0, 36, 0, 0, 16, 7, 6,142, 4,229, 1,122,255,255, 0,123,255,227, 4, 45, 6,100, 16, 35, 2, 87, 4,152, -255,254, 18, 2, 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 7, 6,138, 4,188, 1, 62, -255,255, 0,123,255,227, 4, 45, 6, 72, 16, 35, 2, 89, 4,101, 0, 0, 18, 6, 0, 68, 0, 0,255,255, 0,201, 0, 0, 4,139, - 5,213, 18, 34, 0, 40, 0, 0, 16, 7, 6,142, 4,165, 1,122,255,255, 0,113,255,227, 4,127, 6, 99, 16, 35, 2, 87, 4,186, -255,253, 18, 2, 0, 72, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 7, 6,138, 4,166, 1, 62, -255,255, 0,113,255,227, 4,127, 6, 72, 16, 35, 2, 89, 4,169, 0, 0, 18, 2, 0, 72, 0, 0,255,255, 0,201, 0, 0, 1,147, - 5,213, 18, 34, 0, 44, 0, 0, 16, 7, 6,142, 3, 89, 1,122,255,255,255,195, 0, 0, 2,129, 6, 99, 16, 35, 2, 87, 3,102, -255,253, 18, 2, 0,243, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 34, 0, 44, 0, 0, 16, 7, 6,138, 3, 62, 1, 62, -255,255,255,227, 0, 0, 2, 86, 6, 72, 16, 35, 2, 89, 3, 36, 0, 0, 18, 2, 0,243, 0, 0,255,255, 0,115,255,227, 5,217, - 5,240, 18, 34, 0, 50, 0, 0, 16, 7, 6,142, 5, 65, 1,122,255,255, 0,113,255,227, 4,117, 6,100, 16, 35, 2, 87, 4,159, -255,254, 18, 2, 0, 82, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 7, 6,138, 5, 28, 1, 62, -255,255, 0,113,255,227, 4,117, 6, 72, 16, 35, 2, 89, 4,152, 0, 0, 18, 2, 0, 82, 0, 0,255,255, 0,201, 0, 0, 5, 84, - 5,213, 18, 34, 0, 53, 0, 0, 16, 7, 6,142, 4,121, 1,122,255,255, 0,130, 0, 0, 3, 74, 6, 99, 16, 35, 2, 87, 4, 37, -255,253, 18, 2, 0, 85, 0, 0,255,255, 0,201, 0, 0, 5, 84, 5,213, 18, 34, 0, 53, 0, 0, 16, 7, 6,138, 4,128, 1, 62, -255,255, 0,186, 0, 0, 3, 94, 6, 72, 16, 35, 2, 89, 4, 45, 0, 0, 18, 2, 0, 85, 0, 0,255,255, 0,178,255,227, 5, 41, - 5,213, 18, 34, 0, 56, 0, 0, 16, 7, 6,142, 5, 21, 1,122,255,255, 0,174,255,227, 4, 88, 6,100, 16, 35, 2, 87, 4,212, -255,254, 18, 2, 0, 88, 0, 0,255,255, 0,178,255,227, 5, 41, 5,213, 18, 34, 0, 56, 0, 0, 16, 7, 6,138, 4,236, 1, 62, -255,255, 0,174,255,227, 4, 88, 6, 72, 16, 35, 2, 89, 4,171, 0, 0, 18, 2, 0, 88, 0, 0,255,255, 0,135,254, 20, 4,162, - 5,240, 16, 39, 2,110, 4,118, 0, 0, 18, 6, 0, 54, 0, 0,255,255, 0,111,254, 20, 3,199, 4,123, 16, 39, 2,110, 4, 44, - 0, 0, 18, 6, 0, 86, 0, 0,255,255,255,250,254, 20, 4,233, 5,213, 16, 39, 2,110, 4, 83, 0, 0, 18, 6, 0, 55, 0, 0, -255,255, 0, 55,254, 20, 2,242, 5,158, 16, 39, 2,110, 4, 0, 0, 0, 18, 6, 0, 87, 0, 0, 0, 1, 0,156,254, 82, 4,115, - 5,240, 0, 49, 0, 0, 19, 54, 55, 54, 55, 54, 53, 52, 38, 35, 34, 15, 1, 53, 55, 54, 55, 54, 53, 52, 39, 38, 7, 34, 7, 6, - 7, 53, 54, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 7, 6, 5, 6, 7,156,199,194,165,126, 98,146, 91, - 63, 70,240,248,142,106, 79, 81, 95, 99,105,113, 89,120,119, 96,129,101,192,132,134, 71, 82,120,138, 81, 89,150,130,254,208,218, -181,254,242, 64, 88, 75,121, 94,142,113,134, 31,106,171,106, 61,118, 88,144,123, 53, 63, 1, 58, 46, 80,190, 66, 42, 56,104,105, -178,170, 99,113, 77, 19,109,119,113,218,142,123,129, 92, 40, 0, 0, 1, 0, 71,254, 79, 3,188, 4,123, 0, 50, 0, 0, 19, 54, - 55, 54, 55, 54, 53, 52, 39, 38, 35, 34, 15, 1, 53, 55, 54, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7, 53, 54, 55, 54, 51, 50, - 23, 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 7, 6, 5, 6, 7, 71,178,176,148,114, 88, 66, 65, 82, 57, 63,216,223,124, 99, - 71, 73, 78, 96, 92,104, 79,109, 96, 98,115, 91,171,121,120, 64, 73,108,124, 73, 80,135,120,254,241,196,163,254,209, 51, 72, 60, - 99, 76,115, 91, 55, 54, 25, 86,139, 85, 47, 99, 71,116, 96, 47, 50, 47, 35, 67,154, 48, 39, 46, 85, 85,144,137, 81, 91, 63, 15, - 88, 97, 91,177,115,102,102, 74, 33, 0, 0, 0,255,255, 0,201, 0, 0, 5, 59, 5,213, 16, 39, 6,137, 5, 4, 1,117, 18, 2, - 0, 43, 0, 0,255,255, 0,186, 0, 0, 4,100, 6, 20, 16, 39, 6,137, 3, 33, 1,117, 19, 2, 0, 75, 0, 0, 0, 42,180, 20, - 5, 1, 19, 7, 43, 49, 0, 75,176, 14, 81, 88,187, 0, 20,255,192, 0, 19,255,192, 56, 56, 89, 64, 13,144, 20,144, 19,128, 20, -128, 19, 64, 20, 64, 19, 6, 93, 0, 1, 0,201,254, 86, 5, 25, 5,240, 0, 23, 0, 0, 1, 17, 35, 17, 52, 39, 38, 35, 34, 7, - 6, 21, 17, 35, 17, 51, 21, 54, 55, 54, 51, 50, 23, 22, 5, 25,201, 78, 76,153,179,109,106,202,202, 78,105,105,154,227,116,117, - 3,125,250,217, 5, 41,212,109,107,129,126,222,252,178, 5,213,241,135, 66, 67,159,159, 0, 0, 0, 3, 0,113,255,112, 6, 68, - 6, 20, 0, 7, 0, 40, 0, 52, 0, 0, 37, 22, 51, 50, 53, 52, 39, 34, 7, 54, 51, 50, 21, 16, 33, 34, 39, 6, 7, 35, 54, 55, - 38, 53, 6, 7, 6, 35, 34, 39, 38, 16, 55, 54, 51, 50, 23, 22, 23, 17, 51, 0, 16, 23, 22, 32, 55, 54, 16, 39, 38, 32, 7, 4, -182, 17, 37,160, 52, 52,202,110,136,244,254,170, 73, 53, 34, 24,196, 29, 67, 48, 58, 88, 89,124,203,128,127,127,128,203,124, 89, - 88, 58,184,252,213, 83, 84, 1, 36, 84, 84, 84, 84,254,220, 84,130, 5,175, 45, 1, 32,184,206,254,191, 15, 72, 58, 69,147, 60, - 36,100, 48, 49,162,162, 2, 16,162,162, 49, 48,100, 2, 94,252,230,254,106,116,115,115,116, 1,150,116,115,115, 0, 2, 0,113, -255,227, 5, 37, 5,240, 0, 12, 0, 59, 0, 0, 1, 34, 7, 6, 16, 23, 22, 32, 55, 54, 53, 52, 38, 3, 14, 1, 21, 20, 23, 22, - 51, 50, 55, 54, 53, 52, 39, 38, 39, 53, 50, 23, 22, 21, 20, 6, 7, 22, 23, 22, 21, 20, 7, 6, 32, 39, 38, 53, 52, 55, 54, 55, - 38, 39, 38, 53, 52, 55, 54, 33, 2,203,184,106,107,107,106, 1,112,107,107,212,244,130,170, 95, 59,204,168, 95, 96, 76,109,130, -228,150,139,170,152,172, 95, 96,156,155,253,186,155,156, 96, 97,171,171, 67, 85,130,116, 1, 1, 2,197, 77, 77,254,242, 77, 77, - 77, 78,134,135,154, 2, 39, 3,124, 79, 69, 72, 45, 65, 65,136,158, 43, 77, 8,100,104, 97,186,128,178, 32, 34, 99, 99,143,217, -116,116,116,116,217,143, 99, 99, 34, 31, 70, 89, 88,130, 83, 74, 0, 2, 0,113,255,227, 4,113, 5, 47, 0, 13, 0, 52, 0, 0, - 1, 34, 7, 6, 16, 23, 22, 32, 55, 54, 53, 52, 39, 38, 19, 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 7, 6, 32, 39, 38, 53, - 52, 54, 55, 38, 39, 38, 53, 52, 55, 23, 6, 20, 23, 22, 51, 50, 55, 54, 53, 52, 39, 2,113,144, 83, 82, 82, 83, 1, 32, 83, 83, - 83, 82,254, 58, 52, 73,129,146, 82, 81,133,132,254, 18,132,133,164,146,142, 61, 52, 63,161, 43, 73, 72,131,130, 73, 74, 44, 2, -197, 77, 77,254,242, 77, 77, 77, 78,134,135, 77, 77, 2,106, 82,112,153, 64, 89, 32, 34, 99, 99,143,217,116,116,116,116,217,143, -198, 34, 35, 86, 75,142,106, 88, 32, 65,232, 65, 65, 65, 65,116,119, 62, 0, 0, 0, 1, 0, 92,254, 86, 5, 31, 5,213, 0, 21, - 0, 0, 5, 16, 7, 6, 43, 1, 53, 51, 50, 55, 54, 61, 1, 33, 53, 1, 33, 53, 33, 21, 1, 33, 5, 31,158, 72,114,254,233,105, - 38, 38,251,245, 3,176,252,103, 4,149,252, 80, 3,199, 20,254,223, 80, 37,156, 48, 49,153, 20,154, 4,145,170,154,251,111, 0, - 0, 1, 0, 88,254, 86, 3,219, 4, 96, 0, 21, 0, 0, 5, 16, 7, 6, 43, 1, 53, 51, 50, 55, 54, 61, 1, 33, 53, 1, 33, 53, - 33, 21, 1, 33, 3,219,158, 72,114,254,233,105, 38, 38,253, 53, 2,180,253,101, 3,106,253, 76, 2,180, 20,254,223, 80, 37,156, - 48, 49,153, 20,168, 3, 37,147,168,252,219, 0,255,255, 0, 16, 0, 0, 5,104, 7, 80, 18, 34, 0, 36, 0, 0, 16, 3, 2, 50, - 0,196, 1, 64,255,255, 0,123,255,227, 4, 45, 6, 18, 18, 34, 0, 68, 0, 0, 16, 2, 2, 50, 95, 2, 0, 0,255,255, 0,201, -254,117, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 3, 0,122, 0,162, 0, 0,255,255, 0,113,254,117, 4,127, 4,123, 18, 34, - 0, 72, 0, 0, 16, 2, 0,122,123, 0, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,143, - 98, 0, 0, 0,255,255, 0,113,255,227, 4,117, 7, 49, 18, 38, 0,184, 0, 0, 16, 7, 0,113, 0,115, 1, 59,255,255, 0,115, -255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,150,105, 0, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 16, 38, - 0, 82, 0, 0, 16, 7, 6,150,255,181,254,182,255,255, 0,115,255,227, 5,217, 5,240, 16, 39, 6,140, 5, 39, 1,116, 18, 6, - 0, 50, 0, 0,255,255, 0,113,255,227, 4,117, 6, 16, 16, 38, 2, 50,115, 0, 18, 6, 0, 82, 0, 0, 0, 0,255,255, 0,115, -255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,145,106, 0, 0, 0,255,255, 0,113,255,227, 4,117, 7, 49, 18, 38, - 1,241, 0, 0, 16, 7, 0,113, 0,115, 1, 59,255,255,255,252, 0, 0, 4,231, 7, 49, 16, 39, 0,113, 0,114, 1, 59, 18, 6, - 0, 60, 0, 0,255,255, 0, 61,254, 86, 4,127, 5,245, 16, 38, 0,113, 94,255, 18, 6, 0, 92, 0, 0, 0, 0, 0, 2, 0,138, -255,112, 3, 92, 6, 14, 0, 7, 0, 25, 0, 0, 37, 22, 51, 50, 53, 52, 39, 34, 7, 54, 51, 50, 21, 16, 33, 34, 39, 6, 7, 35, - 54, 55, 38, 55, 17, 51, 1,206, 17, 37,160, 52, 52,202,110,136,244,254,170, 73, 53, 34, 24,196, 29, 67, 49, 1,184,130, 5,175, - 45, 1, 32,184,206,254,191, 15, 72, 58, 69,147, 60, 90, 5, 48, 0, 2, 0,186,255,112, 6, 78, 4,123, 0, 7, 0, 43, 0, 0, - 37, 22, 51, 50, 53, 52, 39, 34, 7, 54, 51, 50, 21, 16, 33, 34, 39, 6, 7, 35, 54, 55, 38, 55, 17, 52, 38, 35, 34, 6, 21, 17, - 35, 17, 51, 21, 54, 55, 54, 51, 50, 23, 22, 21, 4,192, 17, 37,160, 52, 52,202,110,136,244,254,170, 73, 53, 34, 24,196, 29, 67, - 49, 1,124,124,149,172,185,185, 66, 89, 90,117,193, 99, 99,130, 5,175, 45, 1, 32,184,206,254,191, 15, 72, 58, 69,147, 60, 90, - 1,192,159,158,190,164,253,135, 4, 96,174,101, 50, 50,119,120,232, 0, 0, 0, 0, 2, 0, 55,255,112, 3, 97, 5,158, 0, 7, - 0, 33, 0, 0, 37, 22, 51, 50, 53, 52, 39, 34, 7, 54, 51, 50, 21, 16, 33, 34, 39, 6, 7, 35, 54, 55, 38, 53, 17, 35, 53, 51, - 17, 51, 17, 33, 21, 33, 1,211, 17, 37,160, 52, 52,202,110,136,244,254,170, 73, 54, 33, 24,196, 29, 67, 49,135,135,185, 1,123, -254,133,130, 5,175, 45, 1, 32,184,206,254,191, 15, 72, 58, 69,147, 60, 90, 2,243,143, 1, 62,254,194,143, 0, 0, 1,255,219, -254, 86, 1,121, 4, 96, 0, 11, 0, 56, 64, 21, 11, 2, 7, 0, 7,135, 5,189, 0,188, 12, 8, 12, 5, 6, 79, 1, 8, 0, 70, - 12, 16,252,236,228, 57, 18, 57, 49, 0, 16,228,244,236, 17, 18, 57, 57, 48, 64, 11, 16, 13, 64, 13, 80, 13, 96, 13,112, 13, 5, - 1, 93, 19, 51, 17, 20, 6, 43, 1, 53, 51, 50, 54, 53,193,184,163,181, 70, 49,105, 76, 4, 96,251,140,214,192,156, 97,153, 0, - 0, 3, 0,113,255,227, 7,140, 6, 20, 0, 7, 0, 37, 0, 45, 0, 0, 0, 16, 22, 32, 54, 16, 38, 32, 5, 62, 1, 51, 50, 0, - 16, 2, 35, 34, 38, 39, 21, 43, 1, 53, 14, 1, 35, 34, 2, 16, 0, 51, 50, 22, 23, 17, 59, 1, 0, 16, 38, 32, 6, 16, 22, 32, - 1, 47,167, 1, 36,168,168,254,220, 2,133, 58,177,123,204, 0,255,255,204,123,177, 58, 1,184, 58,177,124,203,255, 0,255,203, -124,177, 58,184, 1, 2,114,167,254,220,167,167, 1, 36, 2,250,254,106,231,231, 1,150,231, 43,100, 97,254,188,253,240,254,188, - 97,100,168,168,100, 97, 1, 68, 2, 16, 1, 68, 97,100, 2, 94,251, 80, 1,150,231,231,254,106,231, 0, 0, 0, 0, 3, 0,113, -254, 86, 7,140, 4,123, 0, 7, 0, 37, 0, 45, 0, 0, 0, 16, 38, 32, 6, 16, 22, 32, 37, 17, 43, 1, 17, 14, 1, 35, 34, 2, - 16, 0, 51, 50, 22, 23, 53, 59, 1, 21, 62, 1, 51, 50, 0, 16, 2, 35, 34, 38, 0, 16, 22, 32, 54, 16, 38, 32, 6,205,167,254, -220,167,167, 1, 36,254, 53, 1,184, 58,177,124,203,255, 0,255,203,124,177, 58,184, 1, 58,177,123,204, 0,255,255,204,123,177, -252,154,167, 1, 36,168,168,254,220, 1,100, 1,150,231,231,254,106,231, 43,253,174, 2, 82,100, 97, 1, 68, 2, 16, 1, 68, 97, -100,170,170,100, 97,254,188,253,240,254,188, 97, 2,182,254,106,231,231, 1,150,231, 0, 0, 0, 0, 3,255,253,255,186, 5,124, - 6, 23, 0, 18, 0, 22, 0, 25, 0, 0, 1, 51, 19, 1, 23, 9, 1, 35, 3, 33, 15, 1, 35, 7, 39, 35, 55, 39, 55, 9, 1, 51, - 1, 3, 33, 3, 2, 74,229,134, 1, 97,102,254,112, 1,124,210,136,253,214,205, 50, 70, 59, 82, 2, 1, 20, 47, 2,144,254,238, - 22, 1,111,189, 1, 93,106, 5,213,254,161, 1,161, 89,254, 39,252, 27, 1,127,241,142, 70, 70, 1, 17, 56, 4,196,253, 25, 1, -177,254, 79, 1, 31, 0, 0, 0, 0, 2, 0, 11,255,186, 5,139, 6, 23, 0, 31, 0, 40, 0, 0, 23, 39, 19, 38, 17, 16, 0, 33, - 50, 23, 22, 23, 55, 23, 7, 21, 38, 39, 1, 22, 23, 22, 33, 50, 54, 55, 21, 14, 1, 35, 32, 39, 19, 1, 35, 38, 35, 32, 0, 17, - 20,114,102,220,117, 1,134, 1, 83,134,118, 61, 58,101,102, 99, 46, 49,252,244, 9, 11,136, 1, 0,130,231,102,106,237,132,254, -180,194, 57, 2,216, 1,116,130,255, 0,254,240, 70, 88, 1, 5,187, 1, 23, 1,104, 1,159, 36, 18, 27,120, 89,118,187, 43, 33, -252,102, 13, 12,157, 94, 95,211, 72, 72,199, 1, 21, 3, 92, 47,254,199,254,216,173, 0, 0, 0, 0, 2, 0, 9,255,162, 4, 93, - 4,188, 0, 31, 0, 39, 0, 0, 23, 39, 55, 38, 53, 16, 0, 33, 50, 23, 22, 23, 55, 23, 7, 21, 38, 39, 1, 22, 23, 22, 51, 50, - 54, 55, 21, 14, 1, 35, 34, 39, 19, 1, 38, 35, 34, 6, 21, 20,105, 96,189, 85, 1, 45, 1, 6, 85, 81, 46, 45, 89, 95,118, 25, - 24,253,211, 7, 6, 99,179, 80,157, 78, 77,165, 93,240,147, 55, 1,238, 71, 71,179,198, 94, 78,230,141,204, 1, 18, 1, 58, 17, - 10, 16,108, 79,143, 85, 14, 11,253, 94, 8, 8,113, 43, 43,170, 36, 36,144, 1, 5, 2, 86, 17,227,205,103, 0, 0, 1, 0, 10, - 0, 0, 4,106, 5,213, 0, 13, 0, 0, 19, 51, 17, 51, 21, 35, 17, 33, 21, 33, 17, 35, 53, 51,201,202,191,191, 2,215,252, 95, -191,191, 5,213,253,119,144,253,238,170, 2,188,144, 0, 0, 0, 0, 2,255,178,255,186, 5, 49, 6, 23, 0, 15, 0, 18, 0, 0, - 3, 39, 55, 23, 33, 21, 33, 17, 1, 7, 1, 17, 35, 17, 1, 35, 1, 17, 33, 6, 72,102, 56, 4,153,253,238, 2, 90,103,254, 13, -203,254, 34, 52, 2, 18,254,212, 5,105, 85, 89, 66,170,253,174,253, 57, 88, 2, 77,253,249, 2,247, 2, 52,254,158, 1, 98, 0, - 0, 1, 0,111,254, 16, 4, 25, 4,123, 0, 55, 0, 0, 1, 52, 38, 47, 1, 46, 1, 53, 52, 54, 51, 50, 22, 23, 21, 46, 1, 35, - 34, 6, 21, 20, 22, 31, 1, 22, 23, 22, 21, 20, 7, 6, 7, 31, 1, 22, 51, 21, 35, 34, 39, 38, 47, 1, 38, 39, 38, 39, 38, 39, - 53, 30, 1, 51, 50, 54, 3, 10,101,171, 64,171,152,224,206,102,180, 76, 78,168, 90,137,137, 98,148, 63,198, 80, 83,123, 87,132, -159,147, 42, 76, 39, 84,114, 71, 89,237, 30, 36, 16, 17, 97,108,102,198, 97,130,140, 1, 39, 75, 80, 37, 15, 36,149,130,158,172, - 30, 30,174, 40, 40, 84, 84, 64, 73, 33, 14, 44, 75, 76,137,156, 91, 64, 19,159,126, 36,154, 61, 38, 91,243, 30, 16, 3, 2, 18, - 35,190, 53, 53, 89, 0, 0, 0, 0, 1, 0, 88,254, 16, 4, 51, 4, 96, 0, 24, 0, 0, 19, 33, 21, 1, 22, 23, 1, 23, 22, 59, - 1, 21, 35, 34, 39, 38, 47, 1, 38, 43, 1, 61, 1, 1, 33,113, 3,106,253, 78, 92, 49, 1, 8,147, 42, 76,108,147, 84,114, 71, - 89,237, 61, 90, 94, 2,180,253,101, 4, 96,168,252,221, 16, 49,254,248,126, 36,154, 61, 38, 91,243, 63,156, 12, 3, 37, 0, 0, - 0, 1, 0, 80, 0, 0, 4,141, 5,213, 0, 25, 0, 0, 1, 51, 50, 54, 16, 38, 43, 1, 34, 7, 6, 7, 53, 54, 55, 54, 59, 1, - 50, 4, 16, 4, 43, 1, 17, 35, 1,160,241,141,154,153,142,254, 69, 90, 86, 78, 76, 81, 81, 85,254,251, 1, 1,254,255,251, 39, -202, 3, 0,146, 1, 12,145, 22, 21, 43,182, 35, 17, 18,225,254, 72,226,253,166, 0, 1, 0,117, 2,156, 2,197, 6, 4, 0, 19, - 0, 48, 64, 7, 21, 0, 3, 14, 10, 11, 20, 16,212,220, 60, 47,204,204, 75,176, 13, 81, 88,177, 21, 64, 56, 89, 49,178,127, 21, - 1, 93, 0, 64, 6, 6, 17, 12, 2, 11, 20, 16,212, 60,196,212,204, 48, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, - 17, 62, 1, 51, 50, 22, 2,196,116, 78, 78, 94,108,117,117, 41,113, 74,121,125, 4, 23,254,133, 1,119, 89, 89,107, 92,254,158, - 3,103,254,171, 56, 56,134, 0, 0, 1, 0,117, 2,156, 2,197, 6, 4, 0, 27, 0, 59, 64, 8, 29, 0, 3, 16, 22, 10, 11, 28, - 16,212,220, 60,204, 47,204,204, 75,176, 13, 81, 88,177, 29, 64, 56, 89, 49,178,127, 29, 1, 93, 0, 64, 7, 6, 25, 17, 15, 2, - 11, 28, 16,212, 60,212,204,212,204,180, 13,131, 25,131, 6, 93, 48, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 52, 54, - 59, 1, 21, 35, 34, 6, 29, 1, 62, 1, 51, 50, 22, 2,196,116, 78, 78, 94,108,117,103,114,160,146, 66, 48, 41,113, 74,121,125, - 4, 23,254,133, 1,119, 89, 89,107, 92,254,158, 2,132,120,107, 87, 54, 86,114, 56, 56,134, 0, 0, 2,255,233, 1,173, 0,238, - 6, 3, 0, 13, 0, 17, 0, 35, 64, 7, 19, 15, 1, 8, 14, 0, 18, 16,220, 60,204,220, 60,204, 49, 0, 64, 7, 14, 17, 0, 8, - 7, 0, 18, 16,212,212,204, 16,220,204, 48, 19, 51, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 51, 21, 35,122,116, 52, - 51,114, 44, 31, 66, 24, 24,116,116, 5, 15,253,130,120, 54, 54, 88, 27, 27, 86, 3,114,130, 0, 0, 1, 0,117, 2,156, 2, 19, - 5, 31, 0, 17, 0, 31, 64, 5, 17, 11, 7, 8, 18, 16,220,204, 0,204, 49, 0, 64, 7, 0, 17, 7, 3, 14, 9, 8, 47,196,212, -204, 16,212,204, 48, 1, 46, 1, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 23, 2, 18, 19, 46, 28, 98,105,117,117, - 36,117, 84, 12, 29, 18, 4,175, 10, 9,113,107,254,182, 2,115, 97, 57, 55, 2, 3, 0, 0, 0, 0, 1, 0, 71, 2,141, 1,228, - 5, 15, 0, 21, 0, 0, 19, 22, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 35, 53, 6, 7, 6, 35, 34, 39, 38, 39, 71, 20, 23, 23, - 27, 99, 52, 53,116,116, 37, 58, 59, 84, 12, 14, 15, 17, 2,252, 10, 5, 4, 57, 56,107, 1, 74,253,141, 97, 57, 27, 28, 1, 2, - 2, 0, 0, 0, 0, 1, 0, 71, 1,173, 2,117, 5, 15, 0, 32, 0, 0, 19, 22, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 21, 20, - 22, 59, 1, 21, 35, 34, 38, 61, 1, 35, 53, 6, 7, 6, 35, 34, 39, 38, 39, 71, 20, 23, 23, 27, 99, 52, 53,116, 48, 66, 31, 44, -114,102, 1, 37, 58, 60, 83, 12, 14, 15, 17, 2,252, 10, 5, 4, 57, 56,107, 1, 74,253,141, 11, 86, 54, 88,108,120, 11, 97, 57, - 27, 28, 1, 2, 2, 0, 0, 0, 0, 2, 0, 32, 2,156, 2,143, 5, 15, 0, 22, 0, 33, 0, 0, 1, 30, 1, 21, 20, 7, 6, 43, - 1, 17, 51, 17, 51, 50, 55, 54, 63, 1, 51, 7, 6, 7, 6, 1, 51, 50, 55, 54, 53, 52, 39, 38, 43, 1, 1,155, 67, 70, 67, 68, -137,244,116,107, 61, 37, 37, 40,102,123,110, 33, 33, 34,254,215,125, 75, 39, 41, 41, 39, 75,125, 3,233, 15, 78, 59, 91, 45, 45, - 2,115,254,247, 21, 20, 63,161,171, 53, 30, 30,255, 0, 23, 24, 47, 46, 24, 25, 0, 1, 0, 54, 2,156, 3,233, 5, 15, 0, 12, - 0, 0, 19, 51, 27, 1, 51, 27, 1, 51, 3, 35, 11, 1, 35, 54,116,145,144,137,145,144,116,185,136,152,153,136, 5, 15,254, 23, - 1,233,254, 23, 1,233,253,141, 2, 2,253,254, 0, 1, 0, 38, 1,173, 2,213, 5, 15, 0, 17, 0, 0, 1, 6, 7, 6, 43, 1, - 53, 51, 50, 55, 54, 63, 1, 1, 51, 27, 1, 51, 1,159, 49, 47, 46, 78, 93, 68, 48, 26, 27, 32, 21,254,226,123,221,220,123, 2, - 98,112, 34, 35, 87, 20, 20, 75, 47, 2,105,254, 22, 1,234, 0,255,255, 0,197, 3,170, 1,111, 5,213, 18, 2, 0, 10, 0, 0, -255,255, 0,197, 3,170, 2,233, 5,213, 18, 2, 0, 5, 0, 0,255,255, 0,174, 3,233, 1,211, 5,213, 16, 6, 5,141, 0, 0, -255,255, 0,178, 3,254, 1,215, 5,213, 16, 6, 5,142, 0, 0, 0, 1, 0,196, 4,238, 1,233, 6,218, 0, 5, 0, 0, 1, 21, - 19, 35, 3, 53, 1,151, 82,129,164, 6,218,172,254,192, 1, 64,172, 0, 0, 0, 0, 1, 0,117, 3,239, 1,135, 6, 20, 0, 16, - 0, 0, 19, 52, 53, 50, 54, 53, 52, 38, 35, 52, 53, 50, 23, 22, 20, 7, 6,117, 64, 88, 88, 64,115, 80, 79, 79, 80, 3,239, 61, - 62, 88, 64, 63, 88, 61, 62, 80, 79,230, 80, 80, 0, 1, 0,117, 3,239, 1,135, 6, 20, 0, 16, 0, 0, 1, 34, 39, 38, 52, 55, - 54, 51, 20, 21, 34, 6, 21, 20, 22, 51, 20, 1,135,115, 80, 79, 79, 80,115, 64, 88, 88, 64, 3,239, 80, 80,230, 79, 80, 62, 61, - 88, 63, 64, 88, 62, 0, 0, 0, 0, 1, 0,117, 2,156, 2,137, 6, 2, 0, 28, 0, 0, 1, 51, 50, 55, 54, 53, 38, 39, 38, 35, - 34, 7, 6, 7, 53, 54, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 7, 17, 35, 1, 20, 39,121, 55, 36, 1, 35, 63,113, 50, 50, 49, - 49, 48, 51, 51, 53,174, 87, 68, 68, 70,107,128, 4, 91, 64, 42, 55, 75, 36, 64, 12, 12, 24, 96, 20, 9, 10, 88, 70,104, 95, 64, - 67, 17,254,147, 0, 1, 0,117, 2,156, 2,137, 6, 2, 0, 28, 0, 0, 1, 17, 35, 17, 38, 39, 38, 53, 52, 55, 54, 51, 50, 23, - 22, 23, 21, 38, 39, 38, 35, 34, 7, 6, 7, 20, 23, 22, 51, 1,234,127,107, 71, 68, 69, 87,173, 53, 51, 51, 48, 49, 50, 49, 50, -113, 62, 36, 1, 37, 54,121, 4, 91,254, 65, 1,109, 17, 67, 64, 95,104, 70, 88, 10, 9, 20, 96, 24, 12, 12, 64, 36, 75, 55, 42, - 64, 0, 0, 0, 0, 1, 1, 11, 4, 50, 2,245, 6,176, 0, 6, 0, 0, 1, 37, 21, 13, 1, 21, 37, 1, 11, 1,234,254,153, 1, -103,254, 22, 5,187,245,139,180,180,139,245, 0, 0, 1, 1, 11, 4, 50, 2,245, 6,176, 0, 6, 0, 0, 1, 5, 53, 45, 1, 53, - 5, 2,245,254, 22, 1,103,254,153, 1,234, 5, 39,245,139,180,180,139,245, 0, 0, 1, 0,193, 4,124, 3, 63, 6,102, 0, 6, - 0, 0, 1, 3, 51, 27, 1, 51, 3, 1,182,245,139,180,180,139,245, 4,124, 1,234,254,153, 1,103,254, 22, 0, 0, 1, 0,193, - 4,124, 3, 63, 6,102, 0, 6, 0, 0, 1, 51, 19, 35, 11, 1, 35, 1,182,148,245,139,180,180,139, 6,102,254, 22, 1,103,254, -153, 0, 0, 0, 0, 1, 0,193, 4,238, 3, 63, 6,102, 0, 6, 0, 55, 64, 12, 4, 5, 2,180, 0,179, 7, 4, 2,117, 6, 7, - 16,220,236, 57, 49, 0, 16,244,236, 50, 57, 48, 0, 75,176, 9, 84, 75,176, 14, 84, 91, 88,189, 0, 7,255,192, 0, 1, 0, 7, - 0, 7, 0, 64, 56, 17, 55, 56, 89, 1, 51, 19, 35, 39, 7, 35, 1,182,148,245,139,180,180,139, 6,102,254,136,245,245, 0, 0, - 0, 1, 0,193, 4,238, 3, 63, 6,102, 0, 6, 0, 55, 64, 12, 3, 0,180, 4, 1,179, 7, 3, 5,117, 1, 7, 16,220,236, 57, - 49, 0, 16,244, 60,236, 57, 48, 0, 75,176, 9, 84, 75,176, 14, 84, 91, 88,189, 0, 7,255,192, 0, 1, 0, 7, 0, 7, 0, 64, - 56, 17, 55, 56, 89, 1, 3, 51, 23, 55, 51, 3, 1,182,245,139,180,180,139,245, 4,238, 1,120,245,245,254,136, 0, 1, 0,214, - 3,231, 1, 94, 6, 18, 0, 3, 0, 19, 64, 4, 5, 0, 3, 4, 16,220,220,204, 49, 0, 64, 2, 3, 2, 47,196, 48, 1, 17, 35, - 17, 1, 94,136, 6, 18,253,213, 2, 43, 0, 0,255,255, 0,213, 5, 98, 3, 43, 5,246, 16, 6, 0,113, 0, 0, 0, 1, 1,115, - 4,238, 3, 82, 6,102, 0, 3, 0, 0, 1, 51, 1, 35, 2,139,199,254,186,153, 6,102,254,136, 0, 1, 0,170, 4,240, 2,137, - 6,102, 0, 3, 0, 0, 9, 1, 35, 1, 1,111, 1, 26,153,254,186, 6,102,254,138, 1,118, 0, 0, 1, 0,214,254,209, 1, 94, - 0,252, 0, 3, 0, 19, 64, 4, 5, 0, 3, 4, 16,220,220,204, 49, 0, 64, 2, 3, 2, 47,196, 48, 37, 17, 35, 17, 1, 94,136, -252,253,213, 2, 43, 0, 0, 0,255,255, 0,213,254,192, 3, 43,255, 84, 16, 7, 0,113, 0, 0,249, 94, 0, 0, 0, 1, 0,170, -254, 28, 2,137,255,146, 0, 3, 0, 0, 5, 1, 35, 1, 1,111, 1, 26,153,254,186,110,254,138, 1,118, 0, 0, 0, 1, 1,115, -254, 28, 3, 82,255,148, 0, 3, 0, 0, 5, 51, 1, 35, 2,139,199,254,186,153,108,254,136, 0, 0, 2, 0,111, 0, 0, 1,212, - 4, 35, 0, 2, 0, 5, 0, 0, 1, 3, 33, 3, 19, 33, 1, 33,178, 1,101,179,179,254,155, 2,217, 1, 74,253, 39,254,182, 0, - 0, 1, 0,111, 2,216, 1,212, 4, 35, 0, 2, 0, 0, 1, 3, 33, 1, 33,178, 1,101, 2,217, 1, 74, 0, 0,255,255, 0,117, - 1,254, 1,135, 4, 35, 16, 7, 2, 23, 0, 0,254, 15, 0, 0,255,255, 0,117, 1,254, 1,135, 4, 35, 16, 7, 2, 24, 0, 0, -254, 15, 0, 0, 0, 1, 1, 31, 1,212, 2,225, 3,150, 0, 7, 0, 0, 1, 21, 33, 53, 51, 17, 51, 17, 2,225,254, 62,150,150, - 2,106,150,150, 1, 44,254,212, 0, 1, 1, 31, 1,212, 2,225, 3,150, 0, 7, 0, 0, 1, 53, 33, 21, 35, 17, 35, 17, 1, 31, - 1,194,150,150, 3, 0,150,150,254,212, 1, 44, 0, 1, 0,193, 1,137, 3, 23, 3,223, 0, 11, 0, 0, 1, 53, 51, 21, 51, 21, - 35, 21, 35, 53, 35, 53, 1,162,148,225,225,148,225, 2,254,225,225,148,225,225,148, 0, 0, 0, 0, 1, 1, 31, 2,106, 2,225, - 3, 0, 0, 3, 0, 0, 1, 33, 53, 33, 2,225,254, 62, 1,194, 2,106,150, 0, 0, 1, 0,199, 5, 41, 3, 57, 6, 72, 0, 13, - 0, 87, 64, 14, 11,240, 4, 7, 0,179, 14, 7, 86, 8, 1, 86, 0, 14, 16,220,236,212,236, 49, 0, 16,244, 60,212,236, 48, 0, - 75,176, 9, 84, 88,189, 0, 14,255,192, 0, 1, 0, 14, 0, 14, 0, 64, 56, 17, 55, 56, 89, 0, 75,176, 15, 84, 75,176, 16, 84, - 91, 75,176, 17, 84, 91, 88,189, 0, 14, 0, 64, 0, 1, 0, 14, 0, 14,255,192, 56, 17, 55, 56, 89, 19, 51, 30, 1, 51, 50, 54, - 55, 51, 14, 1, 35, 34, 38,199,118, 11, 97, 87, 86, 96, 13,118, 10,158,145,145,158, 6, 72, 75, 75, 74, 76,143,144,144, 0, 0, - 0, 1, 1,154, 5, 68, 2,102, 6, 16, 0, 3, 0, 21, 64, 9, 2,131, 0,205, 4, 1, 25, 0, 4, 16,212,236, 49, 0, 16,252, -236, 48, 0, 1, 51, 21, 35, 1,154,204,204, 6, 16,204, 0, 0, 0, 2, 0,238, 4,225, 3, 18, 7, 6, 0, 11, 0, 23, 0, 32, - 64, 17, 3,193, 21,242, 9,193, 15,241, 24, 0, 86, 12,120, 6, 86, 18, 24, 16,212,236,244,236, 49, 0, 16,244,236,244,236, 48, - 1, 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, 54, 55, 20, 6, 35, 34, 38, 53, 52, 54, 51, 50, 22, 2,152, 88, 64, 65, 87, 87, 65, - 64, 88,122,159,115,115,159,159,115,115,159, 5,244, 63, 88, 87, 64, 65, 87, 88, 64,115,160,160,115,115,159,159, 0, 1, 1, 76, -254,117, 2,193, 0, 0, 0, 19, 0, 32, 64, 15, 11, 14, 10, 7,243, 14,244, 0, 1, 0, 10, 4, 39, 17, 20, 16,212,236,196,212, -204, 49, 0, 47,252,252,196, 18, 57, 48, 33, 51, 14, 1, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 52, 54, 1,184, -119, 45, 43, 55, 54, 32, 62, 31, 38, 68, 30,122,115, 53, 61, 88, 31, 46, 46, 15, 15,133, 10, 10, 87, 93, 48,105, 0, 1, 0,182, - 5, 29, 3, 74, 6, 55, 0, 27, 0, 99, 64, 36, 0, 18, 7, 14, 11, 4, 1, 18, 7, 15, 11, 4, 18,195, 25, 7, 4,195, 21, 11, -237, 28, 15, 1, 14, 0, 7, 21, 86, 22,119, 7, 86, 8,118, 28, 16,244,236,252,236, 17, 57, 57, 57, 57, 49, 0, 16,252, 60,252, -212, 60,236, 17, 18, 57, 17, 18, 57, 17, 18, 57, 17, 18, 57, 48, 0, 75,176, 9, 84, 75,176, 12, 84, 91, 88,189, 0, 28,255,192, - 0, 1, 0, 28, 0, 28, 0, 64, 56, 17, 55, 56, 89, 1, 39, 46, 1, 35, 34, 6, 7, 35, 62, 1, 51, 50, 22, 31, 1, 30, 1, 51, - 50, 54, 55, 51, 14, 1, 35, 34, 38, 1,252, 57, 22, 33, 13, 38, 36, 2,125, 2,102, 91, 38, 64, 37, 57, 22, 33, 13, 38, 36, 2, -125, 2,102, 91, 38, 64, 5, 90, 55, 20, 19, 73, 82,135,147, 28, 33, 55, 20, 19, 73, 82,135,147, 28, 0, 0, 0, 0, 2, 0,240, - 4,238, 3,174, 6,102, 0, 3, 0, 7, 0, 66, 64, 17, 6, 2,180, 4, 0,179, 8, 4, 7, 3, 0, 5, 1, 3, 5, 7, 8, 16, -212,220,212,204, 17, 57, 17, 18, 57, 49, 0, 16,244, 60,236, 50, 48, 0, 75,176, 9, 84, 75,176, 14, 84, 91, 88,189, 0, 8,255, -192, 0, 1, 0, 8, 0, 8, 0, 64, 56, 17, 55, 56, 89, 1, 51, 3, 35, 3, 51, 3, 35, 2,252,178,248,135,129,170,223,137, 6, -102,254,136, 1,120,254,136, 0, 0, 1,255,255, 1,222, 2,173, 4, 8, 0, 15, 0, 0, 3, 37, 51, 21, 20, 23, 22, 59, 1, 21, - 35, 34, 39, 38, 53, 5, 1, 1, 22,184, 38, 38,105, 43, 64,175, 87, 82,254,235, 3,100,164,148,153, 49, 48,156, 96, 90,200,162, - 0, 1, 0,239, 4,238, 3, 16, 6,102, 0, 11, 0, 0, 1, 39, 7, 35, 55, 39, 51, 23, 55, 51, 7, 23, 2, 92, 92, 93,180,181, -181,180, 93, 92,180,182,182, 4,238, 97, 97,187,189, 96, 96,189,187, 0, 0, 0, 0, 2, 0,117, 1,170, 2,253, 5, 15, 0, 13, - 0, 21, 0, 0, 1, 22, 21, 20, 7, 4, 39, 38, 55, 3, 51, 23, 55, 51, 1, 6, 23, 22, 51, 50, 55, 52, 2, 5,178,242,254,246, - 1, 1,182,250,137,191,183,137,254,188,140, 3, 2,134,128, 1, 3,220,249,180,129, 3, 3,135,192,241, 1, 47,224,224,254,138, -174,152, 77, 77,140, 0, 0, 0, 0, 1, 0,121, 2,156, 0,238, 6, 4, 0, 3, 0, 13,177, 2, 3, 47,204, 49, 0,177, 0, 3, - 47,196, 48, 19, 51, 17, 35,122,116,116, 6, 3,252,153, 0, 0, 0, 1, 0,117, 2,156, 2,144, 5, 47, 0, 50, 0, 0, 1, 21, - 38, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 31, 1, 22, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 39, 53, 22, 23, 22, 51, 50, 54, - 53, 52, 39, 38, 47, 1, 38, 39, 38, 53, 52, 55, 54, 51, 50, 23, 22, 2,106, 49, 53, 52, 57, 87, 43, 43, 31, 31, 93, 40,125, 50, - 52, 78, 77,136, 57, 62, 61, 68, 64, 63, 62, 61, 82, 88, 32, 28,111, 40,108, 48, 48, 71, 70,130, 64, 57, 57, 5, 13, 97, 22, 11, - 11, 23, 24, 47, 36, 20, 21, 18, 8, 24, 42, 43, 77, 87, 51, 51, 10, 10, 19,107, 30, 15, 15, 50, 45, 42, 23, 20, 23, 8, 21, 41, - 42, 73, 88, 48, 49, 9, 8, 0, 0, 1, 0,117, 2,156, 3, 33, 5, 15, 0, 11, 0, 0, 1, 3, 1, 35, 39, 7, 35, 1, 3, 51, - 23, 55, 3, 20,255, 1, 12,137,205,205,137, 1, 18,251,137,187,187, 5, 15,254,207,254,190,246,246, 1, 72, 1, 43,223,223, 0, - 0, 1, 0,117, 2,156, 2,137, 6, 2, 0, 28, 0, 0, 1, 17, 35, 17, 38, 39, 38, 53, 52, 55, 54, 51, 50, 23, 22, 23, 21, 38, - 39, 38, 35, 34, 7, 6, 7, 20, 23, 22, 51, 1,234,127,107, 71, 68, 69, 87,173, 53, 51, 51, 48, 49, 50, 49, 50,113, 62, 36, 1, - 37, 54,121, 4, 91,254, 65, 1,109, 17, 67, 64, 95,104, 70, 88, 10, 9, 20, 96, 24, 12, 12, 64, 36, 75, 55, 42, 64, 0, 0, 0, - 0, 1, 0,214, 0, 0, 3, 29, 5, 88, 0, 5, 0, 21, 64, 9, 1,169, 3, 0, 0, 8, 4, 2, 6, 16,196,212,236, 49, 0, 47, -212,236, 48, 33, 17, 33, 53, 33, 17, 2,149,254, 65, 2, 71, 4,208,136,250,168, 0, 1, 0,214, 0, 0, 3, 29, 5, 88, 0, 7, - 0, 39, 64, 24, 63, 4, 63, 1, 47, 4, 47, 1, 31, 4, 31, 1, 6, 1,169, 4, 5, 0, 0, 4, 8, 6, 2, 8, 16,196,212,236, - 50, 49, 0, 47,212,220,236, 93, 48, 33, 17, 33, 53, 33, 17, 51, 17, 2,149,254, 65, 1,191,136, 3,156,136, 1, 52,250,168, 0, - 0, 1, 0,214, 0, 0, 3, 29, 5, 88, 0, 7, 0, 25, 64, 11, 1,169, 4, 5, 0, 0, 4, 8, 6, 2, 8, 16,196,212,236, 50, - 49, 0, 47,212,220,236, 48, 33, 17, 33, 53, 33, 17, 51, 17, 2,149,254, 65, 1,191,136, 2,104,136, 2,104,250,168, 0, 0, 0, - 0, 1, 0,214, 0, 0, 3, 29, 5, 88, 0, 7, 0, 39, 64, 24,112, 4,112, 1, 48, 4, 48, 1, 16, 4, 16, 1, 6, 4,169, 1, - 5, 0, 0, 4, 8, 6, 2, 8, 16,196,212,236, 50, 49, 0, 47,212,220,236, 93, 48, 33, 17, 33, 53, 33, 17, 51, 17, 2,149,254, - 65, 1,191,136, 1, 52,136, 3,156,250,168, 0, 0, 1, 0,214, 0, 0, 3, 29, 5, 88, 0, 5, 0, 21, 64, 9, 1, 0,169, 4, - 0, 8, 2, 4, 6, 16,196,212,236, 49, 0, 47,236,196, 48, 37, 17, 51, 17, 33, 53, 2,149,136,253,185,136, 4,208,250,168,136, -255,255, 0,193,253,236, 3, 63,255,214, 16, 3, 2, 29, 0, 0,249,112, 0, 0,255,255, 0,213, 4,226, 3, 43, 6,118, 18, 35, - 0,113, 0, 0, 0,128, 18, 2, 0,113, 0,128, 0, 2, 1, 21, 4,238, 2,235, 6,102, 0, 3, 0, 7, 0, 0, 1, 51, 17, 35, - 1, 51, 17, 35, 1, 21,150,150, 1, 64,150,150, 6,102,254,136, 1,120,254,136,255,255, 0,238,253, 46, 3, 18,255, 83, 16, 7, - 2, 51, 0, 0,248, 77, 0, 0, 0, 1, 0,182,254,118, 3, 74,255,144, 0, 27, 0, 0, 1, 39, 46, 1, 35, 34, 6, 7, 35, 62, - 1, 51, 50, 22, 31, 1, 30, 1, 51, 50, 54, 55, 51, 14, 1, 35, 34, 38, 1,252, 57, 22, 33, 13, 38, 36, 2,125, 2,102, 91, 38, - 64, 37, 57, 22, 33, 13, 38, 36, 2,125, 2,102, 91, 38, 64,254,179, 55, 20, 19, 73, 82,135,147, 28, 33, 55, 20, 19, 73, 82,135, -147, 28, 0, 0,255,255,252,168, 4,240,254,135, 6,102, 16, 7, 0, 67,251,254, 0, 0, 0, 0,255,255,253,113, 4,238,255, 80, - 6,102, 16, 7, 0,118,251,254, 0, 0, 0, 0,255,255,252,191, 4,238,255, 61, 6,102, 16, 7, 2, 31,251,254, 0, 0, 0, 0, -255,255,252,180, 5, 29,255, 72, 6, 55, 16, 7, 2, 53,251,254, 0, 0, 0, 0,255,255,252,217, 5, 98,255, 47, 5,246, 16, 7, - 0,113,252, 4, 0, 0, 0, 0,255,255,251,236, 5,124, 0, 20, 6, 11, 16, 7, 5,171,252, 0, 0, 0, 0, 0,255,255,252,191, - 5, 41,255, 49, 6, 72, 16, 7, 2, 49,251,248, 0, 0, 0, 0,255,255,253,164, 5, 68,254,112, 6, 16, 16, 7, 2, 50,252, 10, - 0, 0, 0, 0,255,255,252,213, 5, 70,255, 39, 6, 16, 16, 7, 0,106,251,254, 0, 0, 0, 0, 0, 1,253, 55, 4,242,254,247, - 6,123, 0, 25, 0, 34, 64, 9, 20, 86, 64, 5,128, 12, 86, 25, 13, 47,204,236, 26,220, 26,236, 49, 0, 64, 6, 23,193, 64, 2, -192, 13, 47, 26,220, 26,236, 48, 1, 54, 51, 50, 22, 21, 20, 15, 1, 6, 7, 6, 21, 35, 53, 52, 54, 63, 1, 54, 53, 52, 38, 35, - 34, 7,253, 55,112,105,104,127, 88, 44, 35, 4, 7,119, 30, 51, 45, 46, 62, 71, 90,100, 6, 72, 51, 85, 67, 61, 65, 32, 26, 9, - 16, 32, 12, 40, 54, 37, 34, 34, 40, 21, 36, 52,255,255,252,236, 4,225,255, 16, 7, 6, 16, 7, 2, 51,251,254, 0, 0, 0, 0, -255,255,252,244, 4,238,255,178, 6,102, 16, 7, 2, 54,252, 4, 0, 0, 0, 0,255,255,252,197, 4,238,255, 67, 6,102, 16, 7, - 2, 32,252, 4, 0, 0, 0, 0, 0, 1,253,188, 4,236,254, 68, 6,168, 0, 3, 0, 0, 1, 17, 35, 17,254, 68,136, 6,168,254, - 68, 1,188, 0,255,255,252,240, 4,236,255, 16, 6,168, 16, 39, 2, 85,255, 52, 0, 0, 16, 7, 2, 85, 0,204, 0, 0, 0, 0, - 0, 2,252, 93, 4,238,255, 27, 6,102, 0, 3, 0, 7, 0, 0, 1, 19, 35, 3, 33, 19, 35, 3,253, 15,205,135,248, 2, 0,190, -137,223, 6,102,254,136, 1,120,254,136, 1,120,255,255,252,191, 5, 41,255, 49, 6,214, 16, 39, 2, 50,252, 4, 0,198, 16, 7, - 2, 49,251,248, 0, 0, 0, 0,255,255,252,191, 5, 41,255, 49, 6, 72, 16, 15, 2, 49,255,248, 11,113,192, 0, 0, 1,254, 31, - 3,233,255, 68, 5, 40, 0, 3, 0, 10, 64, 3, 2, 1, 4, 0, 16,212,204, 48, 1, 35, 19, 51,254,242,211,164,129, 3,233, 1, - 63, 0, 0, 0, 0, 1,253,144, 4,194,254,130, 6,193, 0, 8, 0, 0, 1, 16, 35, 53, 22, 53, 35, 53, 51,254,130,242,112,112, -242, 5,195,254,255,123, 3,137,254, 0, 0, 0, 0, 1,253,144, 4,194,254,130, 6,193, 0, 8, 0, 0, 1, 53, 51, 21, 35, 20, - 55, 21, 34,253,144,241,111,112,242, 5,195,254,254,137, 3,123, 0, 1,255,121, 4,154, 0,135, 6, 18, 0, 3, 0, 0, 3, 51, - 3, 35, 64,199,117,153, 6, 18,254,136, 0, 0,255,255,252,168,253,223,254,135,255, 85, 16, 7, 0, 67,251,254,248,239, 0, 0, -255,255,253,113,253,221,255, 80,255, 85, 16, 7, 0,118,251,254,248,239, 0, 0, 0, 1,253, 12,253, 38,254, 68,255, 16, 0, 7, - 0, 0, 1, 53, 51, 17, 35, 53, 35, 53,253,188,136,136,176,254, 95,177,254, 22,177,136, 0, 0, 0, 1,253,188,253, 38,254,244, -255, 16, 0, 7, 0, 0, 1, 51, 21, 35, 21, 35, 17, 51,254, 68,176,176,136,136,254, 95,136,177, 1,234, 0, 0, 0, 1,254, 85, - 5,134, 0, 63, 7,112, 0, 5, 0, 0, 3, 33, 53, 33, 17, 35, 73,254,158, 1,234,136, 6,232,136,254, 22, 0, 0, 1,254,240, - 3,107, 0,123, 4,224, 0, 19, 0, 49, 64, 6, 7, 86, 14, 4, 17, 0, 47, 75,176, 12, 84, 75,176, 13, 84, 91, 75,176, 14, 84, - 91, 88,185, 0, 0, 0, 64, 56, 89,220, 50,220,236, 49, 0, 64, 5, 10, 4,193, 0, 17, 47,196,252,204, 48, 1, 53, 30, 1, 51, - 50, 54, 53, 52, 38, 39, 51, 30, 1, 21, 20, 6, 35, 34, 38,254,240, 61, 88, 31, 46, 46, 15, 15,133, 10, 10, 87, 93, 48,105, 3, -215,119, 45, 43, 55, 54, 32, 62, 31, 38, 68, 30,122,115, 53, 0, 0, 1,253,129,252,235,254,147,255, 16, 0, 16, 0, 0, 5, 20, - 21, 34, 6, 21, 20, 22, 51, 20, 21, 34, 39, 38, 52, 55, 54,254,147, 64, 88, 88, 64,115, 80, 79, 79, 80,240, 62, 61, 88, 64, 63, - 88, 62, 61, 79, 80,230, 80, 80, 0, 1,253, 11,253,215,254,245,255, 16, 0, 7, 0, 0, 1, 51, 21, 33, 53, 51, 53, 51,254, 68, -177,254, 22,177,136,254, 95,136,136,177, 0, 0, 0, 1,253, 11,253,215,254,245,255, 16, 0, 7, 0, 0, 1, 35, 53, 33, 21, 35, - 21, 35,253,188,177, 1,234,177,136,254,136,136,136,177, 0, 0, 0, 1,253, 11,253, 38,254,245,255, 16, 0, 11, 0, 0, 1, 35, - 53, 51, 53, 51, 21, 51, 21, 35, 21, 35,253,188,177,177,136,177,177,136,253,215,136,177,177,136,177, 0, 0, 0, 0, 1,253, 11, -254,136,254,245,255, 16, 0, 3, 0, 0, 1, 53, 33, 21,253, 11, 1,234,254,136,136,136, 0, 0, 0, 1,253,122,254, 86,255,208, - 0,128, 0, 13, 0, 0, 39, 21, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 61, 1, 48, 82, 81,181,254,233,105, 38, 38,128,148,214, - 96, 96,156, 48, 49,153,148, 0, 0, 1,253,119,254, 86,255,205, 0,128, 0, 13, 0, 0, 37, 51, 21, 20, 23, 22, 59, 1, 21, 35, - 34, 39, 38, 53,253,119,184, 38, 38,105,233,254,181, 81, 82,128,148,153, 49, 48,156, 96, 96,214,255,255,253,154,254,135,254,102, -255, 83, 16, 7, 2, 50,252, 0,249, 67, 0, 0,255,255,252,213,254,137,255, 39,255, 83, 16, 7, 0,106,251,254,249, 67, 0, 0, -255,255,252,236,253, 46,255, 16,255, 83, 16, 7, 2, 51,251,254,248, 77, 0, 0, 0, 1,253,106,254, 20,254,143,255, 84, 0, 3, - 0, 10, 64, 3, 3, 0, 4, 0, 16,212,204, 48, 5, 51, 3, 35,253,188,211,164,129,172,254,192,255,255,253, 35,254,117,254,193, - 0, 0, 16, 7, 0,122,252, 0, 0, 0, 0, 0,255,255,253, 76,254,117,254,193, 0, 0, 16, 7, 2, 52,252, 0, 0, 0, 0, 0, - 0, 1,253,188,253,152,254, 68,255, 84, 0, 3, 0, 0, 5, 17, 35, 17,254, 68,136,172,254, 68, 1,188, 0, 0, 0, 1,252,240, -254, 10,255, 23,255, 84, 0, 7, 0, 0, 7, 17, 35, 53, 33, 21, 35, 17,233,137,254,235,137,172,254,182,194,194, 1, 74, 0, 0, - 0, 1,252, 99,254, 57,255,152,255, 88, 0, 20, 0, 0, 1, 6, 35, 34, 3, 52, 53, 51, 22, 51, 50, 55, 51, 22, 23, 50, 55, 51, - 2, 7, 34,253,254, 60,116,218, 17,117, 14,104,101, 15,118, 12,105,102, 15,118, 15,220,116,254,139, 82, 1, 26, 2, 3,150,150, -149, 1,150,254,226, 1, 0, 0,255,255,252,197,253,218,255, 67,255, 82, 16, 7, 2, 32,252, 4,248,236, 0, 0,255,255,252,191, -253,221,255, 61,255, 85, 16, 7, 2, 31,251,254,248,239, 0, 0,255,255,252,191,254, 57,255, 49,255, 88, 16, 7, 2, 49,251,248, -249, 16, 0, 0,255,255,252,191,254, 54,255, 49,255, 85, 16, 15, 2, 49,255,248, 4,126,192, 0,255,255,252,180,254, 57,255, 72, -255, 83, 16, 7, 2, 53,251,254,249, 28, 0, 0,255,255,252,217,254,192,255, 47,255, 84, 16, 7, 2, 38,252, 4, 0, 0, 0, 0, -255,255,251,236,254, 29, 0, 20,254,172, 16, 7, 0, 66,252, 0, 0, 0, 0, 0,255,255,251,236,254, 29, 0, 20,255,238, 16, 7, - 5,140,252, 0, 0, 0, 0, 0, 0, 1,251,140, 1,236,255,173, 3, 12, 0, 27, 0, 0, 3, 21, 14, 1, 35, 34, 39, 38, 39, 46, - 1, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 23, 22, 23, 22, 51, 50, 54, 83, 75,143, 79, 90,113, 22, 11, 77,103, 51, 79,141, 73, - 78,146, 83, 53,100, 74, 12, 21,116, 93, 70,137, 3, 12,174, 59, 55, 51, 10, 4, 33, 24, 59, 63,174, 60, 54, 22, 31, 5, 10, 55, - 61, 0, 0, 0, 0, 1,253,119, 1,196,255,136, 2,104, 0, 3, 0, 0, 3, 21, 33, 53,120,253,240, 2,104,164,164, 0, 0, 0, - 0, 1,250,237, 1,196,255,255, 2,104, 0, 3, 0, 0, 1, 53, 33, 21,250,237, 5, 18, 1,196,164,164, 0, 0, 0, 1,251,104, -255,162,255,188, 4,188, 0, 3, 0, 0, 5, 39, 1, 23,251,200, 96, 3,245, 95, 94, 78, 4,204, 79, 0, 0, 0, 0, 1,250, 18, -255,186,255,145, 6, 23, 0, 3, 0, 0, 5, 39, 1, 23,250,121,103, 5, 25,102, 70, 88, 6, 5, 89, 0, 0, 0,255,255,253,249, -253, 59,255, 11,255, 96, 16, 15, 2,100,252,140,252, 75,192, 0,255,255,252,241,254, 91,255, 24,255,165, 16, 15, 2,114,252, 8, -253,175,192, 0, 0, 2,252,240,253, 46,255, 23,255, 84, 0, 3, 0, 7, 0, 0, 7, 17, 33, 17, 1, 17, 33, 17,233,253,217, 1, -158,254,235,172,253,218, 2, 38,254, 98, 1, 22,254,234, 0, 0, 0, 1,252, 99,254, 57,255,152,255, 88, 0, 20, 0, 0, 5, 54, - 51, 50, 19, 20, 21, 35, 38, 35, 34, 7, 35, 38, 39, 34, 7, 35, 18, 55, 50,253,254, 59,116,218, 17,118, 13,103,102, 16,118, 11, -105,102, 15,118, 15,220,116,250, 82,254,230, 2, 3,150,150,149, 1,150, 1, 30, 1, 0, 0, 0, 0, 1,253, 42, 4,242,254,230, - 6,174, 0, 11, 0, 0, 1, 7, 39, 55, 39, 55, 23, 55, 23, 7, 23, 7,254, 8,125, 96,125,125, 96,125,125, 96,125,125, 96, 5, -112,125, 96,125,125, 96,125,125, 96,125,125, 96, 0, 1,254, 6, 4,194,255, 32, 6,210, 0, 29, 0, 0, 1, 46, 1, 53, 52, 54, - 55, 21, 14, 1, 21, 20, 23, 22, 31, 1, 30, 1, 21, 20, 6, 7, 53, 62, 1, 53, 52, 39, 38, 39,254, 67, 33, 28,147,135, 82, 73, - 9, 12, 18, 55, 33, 28,147,135, 82, 73, 9, 12, 18, 5,199, 28, 48, 28, 80, 81, 2,110, 2, 27, 28, 10, 12, 15, 14, 43, 28, 48, - 28, 80, 81, 2,110, 2, 27, 28, 10, 12, 15, 14,255,255,251,236, 4, 58, 0, 20, 6, 11, 16, 39, 5,171,252, 0, 0, 0, 16, 7, - 5,171,252, 0,254,190, 0, 0,255,255,252,168, 4,240,254,135, 6,102, 16, 7, 0, 67,251,254, 0, 0, 0, 0,255,255,253,113, - 4,238,255, 80, 6,102, 16, 7, 0,118,251,254, 0, 0, 0, 0,255,255,252,180, 5, 29,255, 72, 6, 55, 16, 7, 2, 53,251,254, - 0, 0, 0, 0,255,255,253,132, 4,194,254,118, 6, 97, 16, 7, 5,114,251,254, 0, 0, 0, 0,255,255,252,231, 5, 70,255, 98, - 7,210, 16, 7, 2,166,252, 16, 0, 0, 0, 0,255,255,253,198,254, 86,254,162,255,164, 16, 7, 2,163,252, 16, 0, 0, 0, 0, - 0, 1,252,213, 5, 29,255, 43, 6, 73, 0, 7, 0, 0, 3, 35, 53, 33, 21, 35, 17, 33,213,150,254,214,150, 2, 86, 5, 29,150, -150, 1, 44, 0, 0, 2,253, 31,254, 50,254,225,255,184, 0, 3, 0, 7, 0, 0, 1, 33, 53, 33, 53, 33, 53, 33,254,225,254, 62, - 1,194,254, 62, 1,194,254, 50,120,150,120, 0, 0, 2,253, 21,254, 20,254,235,255,140, 0, 3, 0, 7, 0, 0, 5, 51, 17, 35, - 1, 51, 17, 35,253, 21,150,150, 1, 64,150,150,116,254,136, 1,120,254,136, 0, 0, 1,253, 31,254, 20,254,225,255,214, 0, 5, - 0, 0, 5, 33, 17, 35, 17, 33,253, 31, 1,194,150,254,212, 42,254, 62, 1, 44, 0, 1,252,182, 4,238,255, 74, 6,102, 0, 39, - 0, 0, 1, 55, 51, 7, 22, 23, 22, 51, 50, 55, 54, 55, 51, 6, 7, 6, 35, 34, 39, 38, 39, 7, 35, 55, 38, 39, 38, 35, 34, 7, - 6, 7, 35, 54, 55, 54, 51, 50, 23, 22,253,255, 66,109,107, 11, 22, 16, 13, 38, 18, 18, 2,125, 2, 51, 51, 91, 38, 32, 30, 33, - 66,110,107, 13, 20, 16, 13, 38, 18, 18, 2,125, 2, 51, 51, 91, 38, 32, 30, 5,255,103,169, 9, 14, 10, 36, 37, 82,135, 74, 73, - 14, 13, 29,103,168, 11, 13, 10, 36, 37, 82,135, 74, 73, 14, 13, 0, 2,253, 72, 4,137,254,176, 6,204, 0, 3, 0, 7, 0, 0, - 1, 51, 21, 35, 19, 51, 21, 35,253, 72,150,150,210,150,150, 5, 31,150, 2, 67,150, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 34, 6,134, 0,183, 16, 3, 6,134, 0, 0, 0,167, 0, 1,252, 99,254, 40,255,157,255,194, 0, 13, 0, 0, 1, 55, - 33, 23, 35, 39, 55, 51, 7, 33, 39, 51, 23, 7,254,112,132,254, 25,132,127,175,175,127,132, 1,231,132,126,175,175,254, 40,155, -155,205,205,155,155,205,205, 0, 0, 1,253, 51,254, 20,254,205,255,164, 0, 8, 0, 0, 1, 35, 53, 7, 53, 55, 23, 21, 39,254, - 50,100,155,205,205,155,254, 20,231,132,126,175,175,126,132, 0, 0, 1,253,120, 4,225,254,136, 7, 6, 0, 16, 0, 0, 1, 6, - 7, 6, 21, 20, 23, 22, 23, 21, 38, 39, 38, 52, 55, 54, 55,254,136, 64, 42, 44, 44, 42, 64,114, 78, 80, 80, 78,114, 6,139, 1, - 42, 44, 64, 65, 43, 43, 1,123, 1, 79, 80,230, 80, 78, 1, 0,255,255,252,191, 5, 41,255, 49, 6,216, 16, 39, 2, 89, 0, 0, - 0,144, 16, 6, 2, 79, 0,229,255,255,253, 42,253, 84,254,230,255, 16, 16, 7, 2,133, 0, 0,248, 98, 0, 0, 0, 1,253,120, - 4,225,254,136, 7, 6, 0, 16, 0, 0, 1, 53, 22, 23, 22, 20, 7, 6, 7, 53, 54, 55, 54, 53, 52, 39, 38,253,120,114, 78, 80, - 80, 78,114, 64, 42, 44, 44, 42, 6,139,123, 1, 78, 80,230, 80, 79, 1,123, 1, 43, 43, 65, 64, 44, 42, 0, 0,255,255,255, 46, - 5, 68,255,250, 6, 16, 16, 7, 2, 50,253,148, 0, 0, 0, 0,255,255,252,112,254, 27, 3,144,255,133, 16, 7, 5,172,252,201, - 0, 0, 0, 0,255,255,252,112, 6,107, 3,144, 7,213, 16, 7, 5,172,252,201, 8, 80, 0, 0, 0, 1,253, 42, 5, 29, 2,214, - 6, 55, 0, 35, 0, 0, 3, 39, 38, 39, 38, 35, 34, 7, 6, 7, 35, 54, 55, 54, 51, 50, 23, 22, 31, 1, 22, 23, 22, 51, 50, 55, - 54, 55, 51, 6, 7, 6, 35, 34, 39, 38, 4,144, 28, 79, 44, 36,101, 53, 70, 5,162, 4,113,112,200, 91, 63, 57, 90,144, 28, 79, - 44, 36, 97, 57, 71, 4,162, 4,113,112,200, 91, 63, 57, 5, 90, 55, 11, 18, 10, 36, 48, 71,135, 74, 73, 14, 13, 34, 55, 11, 18, - 10, 36, 44, 75,135, 74, 73, 14, 13, 0, 0, 0,255,255,252,112, 6, 4, 3,144, 7,110, 16, 7, 5,173,252,201, 0, 0, 0, 0, - 0, 1,252,119,254, 40, 3,147,255,194, 0, 8, 0, 0, 1, 53, 33, 39, 51, 23, 7, 35, 55,252,119, 6,115,132,126,175,175,126, -132,254,195,100,155,205,205,155, 0, 1, 0,160, 4,116, 1,159, 6,102, 0, 3, 0, 17, 64, 6, 1, 0, 4, 2, 0, 4, 16,212, -204, 49, 0, 16,212,204, 48, 27, 1, 51, 3,160, 65,190,110, 4,116, 1,242,254, 14, 0, 0, 0, 0, 1, 0,160,254, 86, 1,159, - 0, 72, 0, 3, 0, 17, 64, 6, 2, 3, 4, 0, 2, 4, 16,212,204, 49, 0, 16,212,204, 48, 37, 3, 35, 19, 1,159, 65,190,110, - 72,254, 14, 1,242, 0, 0, 0, 0, 1, 1,182,254, 86, 2,146,255,164, 0, 13, 0, 0, 1, 35, 34, 39, 38, 61, 1, 51, 21, 20, - 23, 22, 59, 1, 2,146,148, 26, 26, 20,149, 10, 12, 14, 35,254, 86, 33, 26, 46,229,229, 14, 12, 13, 0, 0, 0,255,255, 0,158, -255, 18, 1,195, 4, 35, 18, 6, 0, 30, 0, 0, 0, 1, 1,115, 4,238, 3, 82, 6,102, 0, 3, 0, 49, 64, 9, 2,180, 0,179, - 4, 3, 68, 1, 4, 16,212,236, 49, 0, 16,244,236, 48, 0, 75,176, 9, 84, 75,176, 14, 84, 91, 88,189, 0, 4,255,192, 0, 1, - 0, 4, 0, 4, 0, 64, 56, 17, 55, 56, 89, 1, 51, 1, 35, 2,139,199,254,186,153, 6,102,254,136, 0, 0, 0,255,255, 0,215, - 5, 70, 3, 82, 7,210, 18, 38, 0,106, 0, 0, 17, 7, 2,165, 0, 0, 1,108, 0, 20, 0, 64, 7,175, 8,159, 8, 95, 8, 3, - 93, 64, 5, 95, 8, 15, 8, 2,113, 48, 0, 0,255,255, 0, 16, 0, 0, 5,104, 6,102, 16, 39, 2,165,254,218, 0, 0, 16, 6, - 2,176, 0, 0,255,255, 0,219, 2, 72, 1,174, 3, 70, 18, 6, 0,121, 0, 0,255,255,255,231, 0, 0, 5,117, 6,102, 16, 39, - 2,165,254,116, 0, 0, 16, 7, 2,180, 0,234, 0, 0, 0, 0,255,255,255,243, 0, 0, 6, 31, 6,102, 16, 39, 2,165,254,128, - 0, 0, 16, 7, 2,182, 0,228, 0, 0, 0, 0,255,255,255,237, 0, 0, 2,125, 6,102, 16, 39, 2,165,254,122, 0, 0, 16, 7, - 2,184, 0,234, 0, 0, 0, 0,255,255,255,242,255,227, 6, 1, 6,102, 16, 39, 2,165,254,127, 0, 0, 16, 6, 2,190, 40, 0, -255,255,255,225, 0, 0, 6,145, 6,102, 16, 39, 2,165,254,110, 0, 0, 16, 7, 2,195, 1,170, 0, 0, 0, 0,255,255,255,219, - 0, 0, 6, 5, 6,102, 16, 39, 2,165,254,104, 0, 0, 16, 6, 2,199, 54, 0,255,255, 0, 5, 0, 0, 2,128, 7,210, 16, 39, - 2,166,255, 46, 0, 0, 18, 6, 2,215, 15, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 6, 0, 36, 0, 0,255,255, 0,201, - 0, 0, 4,236, 5,213, 18, 6, 0, 37, 0, 0, 0, 1, 0,201, 0, 0, 4,106, 5,213, 0, 5, 0, 25, 64, 12, 4,149, 1,129, - 0, 7, 2, 4, 28, 1, 4, 6, 16,252,252,204,196, 49, 0, 47,244,236, 48, 51, 17, 33, 21, 33, 17,201, 3,161,253, 41, 5,213, -170,250,213, 0, 0, 2, 0, 16, 0, 0, 5,104, 5,213, 0, 2, 0, 6, 0, 61, 64, 12, 66, 0,149, 4,129, 1,149, 3, 8, 6, - 3, 7, 16,212,196,196, 49, 0, 47,236,244,236, 48, 75, 83, 88, 64, 18, 0, 17, 5, 4, 3, 2, 17, 6, 6, 5, 0, 17, 4, 1, - 17, 3, 3, 4, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 89, 9, 1, 33, 5, 1, 51, 1, 2,188,254,102, 3, 53,251,185, - 2, 58,229, 2, 57, 5, 14,251,154,168, 5,213,250, 43, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 6, 0, 40, 0, 0, -255,255, 0, 92, 0, 0, 5, 31, 5,213, 18, 6, 0, 61, 0, 0,255,255, 0,201, 0, 0, 5, 59, 5,213, 18, 6, 0, 43, 0, 0, - 0, 3, 0,115,255,227, 5,217, 5,240, 0, 3, 0, 18, 0, 33, 0, 50, 64, 28, 4,149, 19,145, 34, 3,149, 0,173, 34, 11,149, - 26,140, 34, 35, 16, 1, 15, 25, 22, 51, 0, 8, 25, 30, 16, 34, 16,252,236,196,244,236,196,236, 49, 0, 16,244,236, 16,244,236, - 16,244,236, 48, 1, 33, 21, 33, 1, 34, 7, 6, 17, 16, 0, 51, 50, 55, 54, 17, 16, 39, 38, 39, 32, 0, 17, 16, 7, 6, 33, 32, - 39, 38, 17, 16, 55, 54, 1,197, 2,194,253, 62, 1, 98,220,129,130, 1, 3,220,220,129,128,128,129,220, 1, 58, 1,120,188,188, -254,198,254,197,188,189,189,188, 3,112,170, 2,134,164,164,254,229,254,230,254,184,164,164, 1, 26, 1, 27,164,164,164,254, 91, -254,158,254,159,210,211,210,210, 1, 98, 1, 98,211,210, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 6, 0, 44, 0, 0, -255,255, 0,201, 0, 0, 5,106, 5,213, 18, 6, 0, 46, 0, 0, 0, 1, 0, 16, 0, 0, 5,104, 5,213, 0, 6, 0, 60, 64, 11, - 66, 6,149, 2,129, 5, 1, 8, 4, 1, 7, 16,212,196,196, 49, 0, 47, 60,244,236, 48, 75, 83, 88, 64, 18, 6, 17, 3, 2, 1, - 5, 17, 4, 4, 3, 6, 17, 2, 0, 17, 1, 1, 2, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 89, 51, 35, 1, 51, 1, 35, - 1,229,213, 2, 58,229, 2, 57,210,254, 38, 5,213,250, 43, 5, 14, 0, 0, 0,255,255, 0,201, 0, 0, 6, 31, 5,213, 18, 6, - 0, 48, 0, 0,255,255, 0,201, 0, 0, 5, 51, 5,213, 18, 6, 0, 49, 0, 0, 0, 3, 0,201, 0, 0, 4, 98, 5,213, 0, 3, - 0, 7, 0, 11, 0, 42, 64, 22, 7,149, 4,129, 11, 3,149, 0,173, 8,149, 11, 13, 4, 1, 9, 5, 0, 8, 4, 4, 12, 16,252, - 60,196,212, 60,196,236, 49, 0, 47,236,244,236, 16,244,236, 48, 1, 33, 21, 33, 3, 33, 21, 33, 17, 33, 21, 33, 1, 50, 2,199, -253, 57,105, 3,153,252,103, 3,153,252,103, 3,113,170, 3, 14,170,251,127,170,255,255, 0,115,255,227, 5,217, 5,240, 18, 6, - 0, 50, 0, 0,255,255, 0,201, 0, 0, 5, 59, 5,213, 18, 6, 3, 60, 0, 0,255,255, 0,201, 0, 0, 4,141, 5,213, 18, 6, - 0, 51, 0, 0, 0, 1, 0,201, 0, 0, 4,139, 5,213, 0, 11, 0, 70, 64, 17, 66, 10, 6,149, 7,129, 0, 4,149, 3, 13, 1, - 8, 4, 7, 4, 12, 16,252, 60,212, 60,204, 49, 0, 47,236, 50,244,236, 50, 48, 75, 83, 88, 64, 18, 11, 17, 5, 5, 4, 10, 17, - 6, 6, 5, 11, 17, 5, 0, 17, 4, 5, 4, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 89, 37, 33, 21, 33, 53, 9, 1, 53, - 33, 21, 33, 1, 1,177, 2,218,252, 62, 1,223,254, 33, 3,176,253, 56, 1,223,170,170,170, 2,112, 2, 17,170,170,253,243, 0, -255,255,255,250, 0, 0, 4,233, 5,213, 18, 6, 0, 55, 0, 0,255,255,255,252, 0, 0, 4,231, 5,213, 18, 6, 0, 60, 0, 0, -255,255, 0,115, 0, 0, 5,217, 5,213, 18, 6, 3, 65, 0, 0,255,255, 0, 61, 0, 0, 5, 59, 5,213, 18, 6, 0, 59, 0, 0, - 0, 1, 0,115, 0, 0, 5,219, 5,213, 0, 29, 0, 46, 64, 23, 16, 13,149, 27, 2, 21, 14, 7,129, 0, 31, 21, 28, 22, 2, 14, - 28, 27, 15, 8, 28, 7, 30, 16,220,236,212, 60,252, 60,212,236,204, 49, 0, 47,228, 50, 50,220, 60,236, 50, 48, 33, 54, 39, 34, - 39, 38, 3, 17, 51, 17, 16, 23, 22, 23, 17, 51, 17, 54, 55, 54, 25, 1, 51, 17, 2, 7, 6, 35, 6, 23, 2,194, 1, 1,214,188, -184, 5,213,130,110,138,202,138,110,130,213, 5,184,188,214, 1, 1,134,176,210,204, 1,104, 1,153,254,103,254,230,164,140, 14, - 3,241,252, 15, 14,140,164, 1, 26, 1,153,254,103,254,152,204,210, 72,238, 0, 0, 1, 0, 78, 0, 0, 5,207, 5,231, 0, 38, - 0, 51, 64, 27, 11,149, 30,145, 38, 3, 18, 21,149, 2, 20, 3, 7, 25, 40, 16, 0, 34, 51, 26, 18, 14, 25, 21, 26, 16, 39, 16, -252,196,252,196, 16,244,196,236,252,196, 49, 0, 47, 60,236, 50, 50, 50,244,236, 48, 37, 21, 33, 53, 54, 55, 54, 53, 52, 39, 38, - 35, 34, 0, 21, 20, 23, 22, 23, 21, 33, 53, 33, 38, 39, 38, 53, 16, 55, 54, 33, 32, 23, 22, 17, 20, 7, 6, 7, 5,207,253,168, -177, 99, 99,132,132,216,216,254,247, 99,100,178,253,168, 1, 63,158, 73, 72,192,191, 1, 49, 1, 47,193,192, 71, 71,161,178,178, -178, 97,166,166,202,240,145,145,254,221,239,202,166,166, 97,178,178,139,149,149,184, 1, 62,197,197,197,196,254,203,194,148,148, -141, 0, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 16, 39, 6,132, 3, 47, 1,117, 19, 6, 2,184, 0, 0, 0, 8,180, 9, - 3, 6, 8, 7, 43, 49, 0, 0,255,255,255,252, 0, 0, 4,231, 5,213, 16, 39, 6,132, 4,113, 1,117, 19, 6, 2,195, 0, 0, - 0, 8,180, 12, 2, 7, 8, 7, 43, 49, 0, 0,255,255, 0,113,255,230, 4,229, 6,102, 18, 38, 2,207, 0, 0, 16, 6, 2,165, -110, 0, 0, 0,255,255, 0,133,255,227, 3,200, 6,102, 16, 38, 2,165, 80, 0, 18, 6, 2,211, 0, 0, 0, 0,255,255, 0,186, -254, 86, 4,100, 6,102, 16, 39, 2,165, 0,198, 0, 0, 18, 6, 2,213, 0, 0,255,255, 0,166, 0, 0, 2,152, 6,102, 18, 38, - 2,215, 0, 0, 16, 7, 2,165,255, 70, 0, 0,255,255, 0,149,255,226, 4, 42, 7,210, 18, 38, 2,227, 0, 0, 16, 6, 2,166, - 27, 0, 0, 0, 0, 2, 0,113,255,230, 4,229, 4,122, 0, 13, 0, 42, 0,200, 64, 11, 18, 17, 7, 44, 16, 23, 7, 18, 37, 69, - 43, 16,252,236,212,196,196, 18, 57, 57, 64, 10, 63, 16, 47, 16, 31, 16, 3,143, 16, 1, 93,113, 0, 64, 17, 18, 17, 11, 3,185, - 41,184, 25, 11,185, 33,140, 15,188, 22,135, 25, 47,236,228,244,236, 16,244,236, 17, 57, 57, 5, 64, 20, 29, 17, 0, 17, 14, 17, - 18, 17, 17, 16, 15, 17, 14, 17, 0, 17, 29, 17, 17, 16, 7, 16, 60,236,236,236, 8, 7, 16, 60,236,236, 49, 48, 1, 64, 11,132, - 18,134, 17,136, 1,137, 13,128, 16, 5, 93, 64, 19, 73, 19, 73, 18, 73, 28, 74, 29, 78, 13, 76, 0, 78, 1, 73, 14, 75, 17, 9, - 93, 64, 17, 58, 14, 57, 18, 58, 17, 56, 29, 56, 17, 63, 13, 60, 0, 62, 1, 8, 93, 64, 11, 43, 13, 43, 1, 42, 0, 41, 14, 41, - 17, 5, 93, 64, 13, 25, 15, 24, 14, 27, 13, 27, 1, 26, 0, 25, 17, 6, 93, 0, 64, 5, 43, 30, 43, 31, 2, 93, 1, 39, 38, 39, - 38, 7, 6, 21, 20, 23, 22, 51, 50, 55, 27, 1, 51, 3, 23, 22, 23, 22, 59, 1, 21, 35, 34, 39, 38, 39, 6, 7, 6, 39, 38, 39, - 38, 17, 16, 55, 54, 55, 36, 3, 78, 44, 45,178,134, 61, 77, 75, 76,121,134, 72,164, 99,164,205, 40, 9, 35, 41, 32, 88,110, 94, - 84, 41, 17, 44, 96, 44,143,234,115,117,127,141,198, 1, 55, 2, 9,231,236, 1, 1,111,137,183,220,105,107,213, 1,231, 1, 37, -253,161,219, 49, 41, 48,156, 84, 42, 88,107, 91, 42, 1, 2,150,156, 1, 20, 1, 41,135,151, 3, 5, 0, 0, 0, 0, 2, 0,191, -254, 86, 4,137, 6, 33, 0, 14, 0, 28, 0, 55, 64, 15, 24, 18, 7, 30, 69, 19, 18, 11, 22, 0, 28, 8, 3, 70, 29, 16,252,236, - 50,196,212,236,228,212,236, 49, 0, 64, 14, 26,185, 5, 9, 21,185, 22, 17,185, 13,140, 2,189, 29, 16,236,244,236,212,252, 57, -212,236, 48, 37, 17, 35, 17, 16, 33, 32, 19, 18, 7, 4, 19, 18, 37, 38, 3, 22, 55, 32, 17, 16, 5, 53, 4, 17, 52, 7, 32, 17, - 1,121,185, 1,170, 1,176, 2, 3,175, 1, 23, 1, 2,254, 28,212, 89,111,197, 1, 32,254, 48, 1,107,234,254,251, 69,254, 17, - 6, 3, 1,200,254,127,254,238,100, 90,254,245,254, 37, 1, 1, 1, 73,174, 1, 1, 58, 1, 26, 22,170, 6, 1, 70,220, 1,254, -200, 0, 0, 0, 0, 1, 0, 32,254, 86, 4,127, 4, 96, 0, 14, 0, 64, 64, 7, 16, 3, 7, 8, 4, 12, 15, 16,212,212,252,212, -196, 49, 0, 64, 7, 2, 12,191, 6,189, 4, 7, 47, 60,236,228, 50, 48, 5, 64, 18, 1, 17, 8, 7, 2, 17, 3, 4, 3, 14, 13, - 1, 17, 0, 17, 7, 8, 7, 7, 16,236,236, 57, 57, 7, 16,236, 8,236, 1, 19, 1, 51, 1, 17, 35, 17, 1, 38, 43, 1, 53, 51, - 50, 1,105,245, 1, 94,195,254, 59,184,254,218, 44, 95, 49, 70,197, 3,176,253, 76, 3,100,251,160,254, 86, 1,170, 3, 68,126, -158, 0, 0, 0, 0, 2, 0,113,255,227, 4,117, 5,240, 0, 28, 0, 45, 0, 84, 64, 20, 6, 5, 40, 4, 47, 69, 28, 40, 18, 10, - 81, 18, 4, 18, 24, 33, 18, 18, 69, 46, 16,252,236,212,236, 16,244,178,127, 10, 1, 93,236,196,236, 17, 18, 57, 57, 0, 64, 14, - 6, 5, 37, 2, 28, 0, 2,185, 26, 37,185, 14,140, 46, 16,244,236,212,252,212,204, 17, 18, 57, 57, 64, 6, 22, 29, 83, 5, 6, - 5, 7, 14, 16,236, 57, 49, 48, 1, 38, 35, 34, 21, 20, 5, 22, 23, 22, 17, 16, 7, 6, 35, 34, 39, 38, 17, 52, 55, 54, 55, 38, - 53, 16, 33, 50, 23, 1, 6, 7, 6, 21, 20, 23, 22, 51, 50, 54, 53, 52, 39, 38, 39, 38, 3,236,102,239,253, 1, 8,208,117,142, -137,137,240,239,138,137,137, 53, 75,156, 1,185,221,120,254, 24, 68, 55, 86, 85, 86,149,147,172, 91, 97,126, 64, 5, 17, 70,117, - 92, 48, 37,112,135,254,235,254,247,156,157,157,156, 1, 19,204,165, 64, 36, 79,141, 1, 16, 70,254, 40, 29, 73,113,204,203,114, -115,232,190,199, 96,103, 11, 6, 0, 1, 0,133,255,227, 3,200, 4,124, 0, 50, 0, 61, 64, 34, 12,134, 11,136, 16,185, 8,184, - 51, 27,169, 24, 51, 39,134, 40,136, 35,185, 44,140, 51, 52, 25, 11, 39, 20, 8, 4, 31, 8, 48, 69, 51, 16,252,236,212,236,212, -196,196,196, 49, 0, 16,244,236,244,236, 16,212,236, 16,244,236,244,236, 48, 1, 38, 39, 38, 53, 52, 55, 54, 51, 50, 22, 23, 21, - 38, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 59, 1, 21, 35, 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 54, 55, 21, 6, 7, 6, 35, - 34, 39, 38, 53, 52, 54, 1,139,112, 60, 60,114,113,196, 76,170, 98, 97, 80, 81, 71,119, 69, 70, 68, 67,116,155,148,137, 72, 78, - 84, 85,151, 93, 85, 85, 71, 90, 84, 85, 80,238,129,129,138, 2, 92, 24, 65, 64, 93,141, 79, 78, 24, 24,167, 29, 13, 13, 46, 46, - 64, 70, 45, 44,152, 51, 56, 88, 90, 56, 56, 18, 19, 37,171, 28, 14, 14, 91, 91,173,108,146, 0, 0, 1, 0,107,254, 82, 3,248, - 6, 20, 0, 29, 0, 62, 64, 11, 10, 14, 18, 31, 4, 25, 24, 28, 18, 20, 30, 16,212,236,212,212,212,196,252,204, 75,176, 16, 81, - 88,185, 0, 22, 0, 64, 56, 89, 49, 0, 64, 14, 8,185, 10, 0,185, 18,140, 30, 26, 23,135, 24,151, 30, 16,244,236, 50, 16,244, -236,220,236, 48, 37, 22, 23, 22, 21, 20, 7, 6, 35, 52, 53, 22, 55, 54, 53, 52, 39, 38, 35, 32, 3, 16, 1, 33, 53, 33, 21, 0, - 17, 16, 2,202,132, 79, 84, 74, 80,163, 69, 42, 32, 32, 31, 58,253,162, 1, 2, 59,253,236, 3,102,253, 44,127, 1, 75, 79,120, -115, 80, 87, 75, 76, 5, 44, 35, 37, 53, 44, 42, 2, 51, 1,236, 1, 89,185,185,254,148,254, 39,254,105, 0, 0, 0, 1, 0,186, -254, 86, 4,100, 4,123, 0, 21, 0, 49, 64, 22, 6,135, 14, 18,184, 12,188, 2,189, 11, 23, 70, 3, 8, 0, 78, 9, 13, 8, 12, - 70, 22, 16,252,236, 50,244,236,236, 49, 0, 47,236,228,244,196,236, 48, 64, 5,160, 23,128, 23, 2, 1, 93, 1, 17, 35, 17, 52, - 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 54, 55, 54, 51, 50, 23, 22, 4,100,184,124,124,149,172,185,185, 66, 89, 90,117,193, 99, - 99, 2,164,251,178, 4, 72,159,158,190,164,253,135, 4, 96,174,101, 50, 50,119,120, 0, 0, 0, 0, 3, 0,113,255,233, 4,117, - 6, 36, 0, 8, 0, 17, 0, 33, 0, 63, 64, 27, 13,185, 18,151, 34, 1,149, 17, 34, 5,185, 26,140, 34, 35, 69, 0, 9, 18, 22, - 81, 1, 17, 18, 30, 69, 34, 16,252,236, 50,244,178,127, 22, 1, 93,236, 50,236, 49, 0, 16,244,236, 16,212,236, 16,244,236, 48, - 64, 5,160, 35,128, 35, 2, 1, 93, 1, 33, 18, 23, 22, 51, 50, 55, 54, 19, 2, 39, 38, 35, 34, 7, 6, 3, 1, 50, 23, 22, 17, - 16, 7, 6, 35, 34, 39, 38, 17, 16, 55, 54, 3,177,253,131, 15, 69, 86,149,150, 83, 73, 9, 28, 54, 86,147,153, 81, 64, 19, 1, - 61,240,137,137,137,137,240,241,136,137,137,136, 2,198,254,213,127,156,157,138, 1,201, 1, 28,100,158,156,126,254,252, 2,180, -212,211,254,138,254,139,212,213,213,212, 1,117, 1,118,211,212, 0, 1, 0,166, 0, 0, 2,110, 4, 96, 0, 13, 0, 27, 64, 7, - 15, 6, 0, 8, 13, 70, 14, 16,252,252,212,196, 49, 0, 64, 5, 13,188, 5,135, 8, 47,236,228, 48, 1, 17, 20, 23, 22, 59, 1, - 21, 35, 34, 39, 38, 53, 3, 1, 99, 34, 36,108, 89,111,180, 82, 82, 1, 4, 96,253, 43,145, 46, 48,156, 96, 98,212, 2,202, 0, - 0, 1, 0,191, 0, 0, 4,133, 4, 96, 0, 11, 0, 73, 64, 9, 13, 6, 4, 9, 1, 8, 11, 70, 12, 16,252,236, 50,196,212,196, - 49, 0, 64, 5, 3, 0,188, 7, 11, 47, 60,228, 50, 48, 64, 22, 8, 17, 9, 4, 5, 7, 17, 6, 6, 5, 8, 5, 9, 4, 3, 17, - 4, 2, 17, 9, 9, 4, 7, 16, 4,236, 16, 5,236, 9, 60, 60, 7, 16, 5,236, 16, 8,236, 19, 51, 17, 1, 51, 9, 1, 35, 1, - 7, 17, 35,191,190, 1,227,224,254, 71, 1,254,225,254, 98,137,190, 4, 96,254, 47, 1,209,254, 90,253, 70, 2, 66,129,254, 63, - 0, 1, 0, 61, 0, 0, 4,127, 6, 21, 0, 13, 0, 70, 64, 5, 15, 1, 11, 5, 14, 16,212,196,212,196, 49, 0, 64, 6, 10,135, - 11,151, 2, 5, 47, 60,244,236, 48, 64, 24, 3, 17, 1, 0, 6, 4, 17, 5, 6, 5, 7, 17, 6, 17, 3, 17, 1, 0, 0, 2, 17, - 0, 1, 0, 7, 16, 5,236, 16, 9,236,236, 5,236, 7, 16, 5,236, 16, 8,236, 9, 1, 35, 9, 1, 35, 1, 39, 38, 43, 1, 53, - 23, 22, 2,122, 2, 5,195,254,198,254,126,195, 1,235, 74, 47,107, 96,117,226, 5,101,250,155, 3, 60,252,196, 4, 50,198,126, -158, 2, 3, 0,255,255, 0,174,254, 86, 4,229, 4, 96, 16, 6, 0,119, 0, 0, 0, 1, 0, 74, 0, 0, 4, 24, 4, 96, 0, 21, - 0, 65, 64, 7, 23, 7, 18, 17, 0, 1, 22, 16,212,196,212,236,196, 49, 64, 4, 11, 1,188, 0, 0, 47,228, 50, 48, 64, 21, 20, - 19, 18, 17, 21, 17, 6, 5, 4, 3, 7, 3, 17, 1, 0, 0, 2, 17, 1, 1, 0, 7, 16, 5,236, 16, 9,236, 18, 23, 57, 5,236, - 18, 23, 57, 33, 1, 51, 1, 54, 55, 54, 55, 54, 39, 38, 39, 51, 49, 22, 23, 22, 21, 20, 7, 6, 7, 1,160,254,170,198, 1, 33, -120,100, 76, 4, 2, 24, 28,106,186, 69, 46, 42,136,177,123, 4, 96,252, 84,124,172,129,112, 53,100,119,131, 89,124,114, 78,196, -175,228,116, 0, 0, 1, 0,107,254, 82, 4, 1, 6, 20, 0, 38, 0, 64, 64, 15, 10, 14, 18, 40, 4, 34, 29, 28, 32, 18, 24, 37, - 18, 20, 39, 16,212,236,212,236,212,212,196,212,196,252,204, 49, 64, 18, 8,185, 10, 0,185, 18,140, 39, 22, 35,135, 34, 30, 27, -135, 28,151, 39, 0, 16,244,252, 60,212,236, 57, 16,244,236,220,236, 48, 37, 22, 23, 22, 21, 20, 7, 6, 35, 52, 53, 22, 55, 54, - 53, 52, 39, 38, 35, 32, 17, 16, 37, 36, 17, 52, 55, 35, 53, 33, 21, 32, 17, 20, 5, 21, 36, 19, 18, 2,218,132, 79, 84, 74, 80, -163, 69, 42, 32, 32, 31, 58,253,145, 1, 77,254,232,220,208, 3, 21,253,139, 2, 16,253,198, 2, 1,127, 1, 75, 79,120,115, 80, - 87, 75, 76, 5, 44, 35, 37, 53, 44, 42, 1,181, 1, 44, 88, 36, 1, 4,197, 82,185,185,254,221,191, 9,170, 22,254,188,254,241, -255,255, 0,113,255,227, 4,117, 4,123, 18, 6, 0, 82, 0, 0, 0, 1, 0, 74,255,217, 4,152, 4, 96, 0, 23, 0, 47, 64, 11, - 25, 10, 1, 18, 8, 3, 19, 8, 0, 22, 24, 16,220,196,236,212,236,196,196,204, 49, 64, 12, 7,135, 14,140, 21, 3, 19, 23,135, - 0,188, 21, 0, 47,244,236, 50, 50, 16,244,236, 48, 19, 33, 21, 35, 17, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 17, - 33, 17, 35, 17, 35, 74, 4, 49,141, 49, 55, 15, 44, 7, 35, 74, 37,120, 92,254, 99,188,143, 4, 96,184,253, 80, 72, 63, 5, 1, -133, 13, 12,131,176, 2,156,252, 88, 3,168, 0, 0, 2, 0,186,254, 86, 4,164, 4,123, 0, 17, 0, 29, 0, 49, 64, 25, 21,185, - 4,184, 30, 27,185, 10,140, 15,189, 30, 31, 69, 18, 18, 7, 81, 13, 8, 24, 18, 16, 70, 30, 16,252,236,236,244,178,127, 7, 1, - 93,236,236, 49, 0, 16,236,244,236, 16,244,236, 48, 1, 54, 55, 54, 51, 50, 0, 17, 16, 2, 35, 34, 38, 39, 17, 35, 17, 52, 5, - 52, 38, 35, 34, 6, 21, 20, 22, 51, 50, 54, 1, 20, 61,151, 59,182,204, 0,255,255,204,123,177, 58,185, 3, 43,167,146,146,167, -167,146,146,167, 3,152,102, 90, 35,254,188,254,248,254,248,254,188, 97,100,253,174, 3,207,231,221,203,231,231,203,203,231,231, - 0, 1, 0,113,254, 82, 3,231, 4,123, 0, 36, 0, 54, 64, 12, 29, 33, 18, 23, 38, 9, 72, 16, 18, 3, 69, 37, 16,252,236,244, -204,212,252,196, 49, 64, 17, 27,185, 29, 19,185, 0,140, 37, 9,134, 10,136, 13,185, 6,184, 37, 0, 16,244,252,244,236, 16,244, -236,220,236, 48, 5, 32, 0, 17, 16, 0, 33, 50, 22, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 51, 50, 23, 22, 21, 20, 7, 6, 35, - 52, 53, 22, 55, 54, 53, 52, 39, 38, 2,168,254,243,254,214, 1, 45, 1, 6, 85,162, 76, 78,157, 80,179,198,198,175,131, 80, 84, - 74, 80,163, 69, 42, 32, 32, 31, 29, 1, 62, 1, 14, 1, 18, 1, 58, 35, 35,172, 43, 43,227,205,205,227, 76, 79,120,115, 80, 87, - 75, 76, 5, 44, 35, 37, 53, 44, 42, 0, 0, 0, 0, 2, 0,113,255,227, 4,214, 4, 98, 0, 13, 0, 30, 0, 49, 64, 11, 32, 15, - 10, 18, 19, 81, 4, 18, 27, 69, 31, 16,252,236,244,178,127, 19, 1, 93,236,212,196, 49, 64, 12, 7,185, 23,140, 31, 17,135, 0, -185, 14,188, 31, 0, 16,244,236,236, 16,244,236, 48, 1, 34, 7, 6, 21, 20, 22, 51, 50, 54, 53, 52, 39, 38, 39, 5, 21, 35, 22, - 21, 16, 7, 6, 35, 34, 39, 38, 17, 16, 55, 54, 2,115,152, 82, 86,171,149,147,172, 86, 79,154, 2, 99,206,109,137,137,240,241, -136,137,137,114, 3,206,110,115,190,201,231,232,200,183,122,110,147, 1,184,156,221,254,237,156,157,157,156, 1, 19, 1, 20,156, -130, 0, 0, 0, 0, 1, 0,100, 0, 0, 4,109, 4, 96, 0, 17, 0, 35, 64, 8, 19, 13, 3, 15, 8, 12, 10, 18, 16,212,196,252, -196,196,196, 49, 0, 64, 8, 15, 11,135, 12,188, 2,185, 5, 47,236,244,236, 50, 48, 37, 22, 59, 1, 21, 35, 34, 39, 38, 53, 17, - 33, 53, 33, 21, 33, 17, 20, 2,230, 36,108, 89,111,180, 82, 82,254, 92, 4, 9,254, 87,204, 48,156, 96, 98,212, 2, 18,184,184, -253,227,145, 0, 0, 1, 0,149,255,226, 4, 42, 4, 96, 0, 28, 0, 43, 64, 10, 30, 69, 9, 18, 19, 0, 8, 28, 70, 29, 16,252, -236,212,236,228, 64, 7, 63, 30, 63, 9, 63, 19, 3, 93, 49, 0, 64, 6, 13, 28,188, 5,185, 23, 47,236,244, 60, 48, 1, 17, 20, - 23, 22, 51, 50, 55, 54, 55, 54, 39, 38, 39, 51, 49, 22, 23, 22, 21, 20, 7, 6, 39, 34, 39, 38, 53, 3, 1, 82, 50, 55,107,150, -105, 59, 15, 8, 30, 28,106,186, 70, 45, 42,128,156,254,179,101, 98, 1, 4, 96,253, 43,135, 64, 69,208,118,187,102,128,119,131, - 90,123,115,154,253,187,228, 1,120,118,197, 2,202, 0, 0, 0, 0, 2, 0,111,254, 86, 4,210, 4,104, 0, 10, 0, 41, 0, 61, - 64, 16, 43, 69, 7, 18, 15, 19, 2, 8, 30, 22, 40, 35, 18, 26, 69, 42, 16,252,236,212, 60,204,252, 60,212,236,236, 49, 0, 64, - 16, 0, 31,185, 11, 30,184, 42, 3, 39,135, 19, 22,140, 21,189, 42, 16,236,244, 60,236, 50, 16,244, 60,236, 50, 48, 1, 34, 21, - 17, 50, 55, 54, 39, 38, 39, 38, 39, 50, 23, 22, 19, 18, 7, 6, 35, 17, 35, 17, 34, 39, 38, 17, 2, 55, 54, 55, 21, 6, 7, 6, - 23, 22, 23, 22, 51, 17, 16, 3, 61, 65, 94, 96, 86, 1, 1, 85, 70, 54,144,123,133, 4, 4,141,133,199,183,199,134,136, 1,137, -104,164, 66, 58, 87, 1, 1, 85, 76,113, 3,203,145,253, 82,104, 93,223,208,112, 91,157,132,141,254,217,254,241,161,152,254,110, - 1,145,153,156, 1, 19, 1, 30,146,109, 28,163, 23, 78,115,190,202,115,103, 2,175, 1, 46, 0, 0, 1, 0, 59,254, 85, 4,100, - 4, 97, 0, 23, 0,118, 64, 12, 17, 16, 5, 4, 4, 9, 25, 20, 15, 3, 9, 24, 16,212,196,212,196,196, 18, 23, 57, 0, 64, 18, - 17, 16, 5, 4, 4, 19, 8,135, 14, 9,188, 24, 19,135, 22, 3,189, 24, 16,244, 60,236, 16,244, 60,236, 17, 23, 57, 5, 64, 20, - 14, 17, 15, 16, 15, 12, 17, 5, 5, 4, 2, 17, 3, 4, 3, 0, 17, 17, 17, 16, 7, 16,236, 7, 16,236, 7, 16,236, 7, 16,236, - 64, 20, 16, 17, 12, 15, 2, 13, 17, 12, 14, 3, 4, 14, 3, 5, 0, 1, 15, 2, 5, 0, 15, 15, 15, 15, 49, 48, 5, 3, 1, 35, - 1, 3, 38, 43, 1, 53, 23, 4, 23, 19, 1, 51, 1, 19, 22, 59, 1, 21, 39, 36, 2,220,149,254,205,217, 1,178,182, 49,154, 49, - 70, 1, 2, 65,148, 1, 51,217,254, 78,182, 49,154, 49, 70,254,254,250, 1,127,253,208, 3, 24, 1,215,126,158, 2, 7,167,254, -129, 2, 48,252,232,254, 41,126,158, 2, 7, 0, 0, 1, 0,112,254, 86, 4,209, 4, 96, 0, 27, 0, 54, 64, 13, 29, 19, 8, 20, - 25, 13, 8, 0, 12, 6, 8, 5, 28, 16,220,236,212, 60,252, 60,212,236,204, 49, 0, 64, 14, 19, 12, 5,188, 28, 14, 11,135, 25, - 0,140, 27,189, 28, 16,236,244, 60,236, 50, 16,244, 60, 60, 48, 5, 38, 39, 38, 53, 17, 51, 17, 20, 23, 22, 23, 17, 51, 17, 54, - 55, 54, 53, 17, 51, 17, 20, 7, 6, 7, 17, 35, 2, 69,231,107,131,186, 85, 74,124,183,131, 67, 85,186,131,118,220,183, 25, 37, - 97,119,243, 2,137,253,126,183, 76, 66, 14, 3,213,252, 44, 14, 66, 84,175, 2,129,253,120,252,110, 99, 35,254,110, 0, 0, 0, - 0, 1, 0,135,255,226, 6, 40, 4, 96, 0, 26, 0, 56, 64, 20, 18, 18, 19, 28, 69, 16, 18, 21, 11, 8, 12, 7, 18, 2, 5, 18, - 4, 2, 69, 27, 16,252,220,236, 16,236,212,252,212,236,236,220,236, 49, 0, 64, 9, 11, 18, 4,188, 14, 9,135, 23, 0, 47, 60, -236, 50,244, 60,196, 48, 5, 32, 17, 52, 19, 51, 2, 21, 2, 51, 50, 3, 51, 2, 55, 54, 17, 52, 3, 51, 18, 21, 18, 37, 36, 3, - 2, 2, 38,254, 97,155,198,143, 1,223,207, 4,170, 4,207,222,143,198,155, 2,254, 95,254,241, 34, 41, 29, 2, 82,235, 1, 64, -254,192,240,254, 79, 2, 26,253,227, 3, 2, 1,175,240, 1, 64,254,192,235,253,173, 1, 1, 1, 42,254,213, 0,255,255, 0, 5, - 0, 0, 2,125, 6, 16, 18, 38, 2,215, 15, 0, 16, 7, 0,106,255, 46, 0, 0,255,255, 0,149,255,226, 4, 42, 6, 16, 16, 38, - 0,106, 29, 0, 18, 6, 2,227, 0, 0, 0, 0,255,255, 0,113,255,227, 4,117, 6,102, 16, 38, 2,165,125, 0, 18, 6, 2,221, - 0, 0, 0, 0,255,255, 0,149,255,226, 4, 42, 6,102, 16, 38, 2,165, 34, 0, 18, 6, 2,227, 0, 0, 0, 0,255,255, 0,135, -255,226, 6, 40, 6,102, 18, 38, 2,231, 0, 0, 16, 7, 2,165, 1, 89, 0, 0, 0, 3, 0,166,255,233, 4, 77, 6, 36, 0, 13, - 0, 37, 0, 53, 0, 0, 1, 50, 55, 54, 55, 54, 53, 52, 39, 38, 39, 38, 7, 6, 1, 22, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, - 3, 2, 55, 54, 23, 22, 23, 22, 23, 22, 7, 6, 7, 6, 7, 6, 35, 16, 23, 22, 51, 50, 55, 54, 55, 52, 39, 38, 1,105, 80, 84, -119, 68,121, 36, 50,117,122, 93, 54, 1,238, 96, 59, 91, 59,126,246,252,139,111, 1, 1,120,134,210,164,107,111, 1, 1, 55, 38, -251, 67, 93, 74, 78, 58, 80,174,143, 87, 24, 1, 79, 94, 3,112, 1, 3, 61,108,147, 87, 53, 73, 9, 10,196,112,254,203, 65, 75, -117,143,130, 95,213,213,168, 1,161, 1,139,190,213, 1, 1,111,115,155,128,107, 75,150, 15, 3, 2,254,234,128,176,156, 45, 86, -123, 72, 86, 0, 0, 2, 0,112,255,233, 4,118, 6, 36, 0, 11, 0, 40, 0, 0, 1, 54, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, - 5, 4, 39, 38, 17, 52, 55, 54, 51, 50, 23, 22, 3, 2, 7, 6, 35, 34, 39, 38, 19, 23, 2, 23, 22, 51, 50, 55, 54, 3,174, 6, - 55, 75,140, 83, 64, 56,121, 74, 1, 19,254,204,131,211,104,104,175,209,135,128, 9, 9,128,137,240,237,140,149, 12,195, 33,117, - 85,150,144, 89, 95, 3,112,246,126,170, 71, 66, 90,153,107, 65,160, 9, 74,120, 1, 39,160,110,112,212,200,254,127,254,125,198, -213,213,225, 1,210, 1,254,130,215,155,156,166, 0, 1, 0, 87, 0, 0, 5, 81, 5,223, 0, 27, 0, 0, 1, 6, 3, 6, 21, 17, - 35, 17, 52, 39, 2, 39, 38, 7, 53, 54, 23, 4, 19, 18, 37, 54, 23, 22, 7, 6, 39, 38, 4, 70,160, 82, 42,203, 42, 82,160,116, -120, 67,160, 1, 67, 72,107, 1, 31,111, 64,120, 54, 33,117, 86, 5, 17, 72,254,243,141,165,253,118, 2,138,165,141, 1, 13, 72, - 52, 26,170, 21, 24, 48,254,114, 1,123, 67, 26, 49, 93,150, 86, 26, 18, 0, 0,255,255,255,225, 0, 0, 6,161, 6,102, 16, 39, - 2,165,254,110, 0, 0, 16, 7, 2,239, 1, 80, 0, 0, 0, 0,255,255, 0, 87, 0, 0, 5, 81, 5,223, 16, 39, 6,132, 4,197, - 1,117, 18, 6, 2,239, 0, 0, 0, 3, 0,112,254, 86, 4,209, 6, 20, 0, 21, 0, 30, 0, 39, 0, 65, 64, 16, 41, 26, 18, 6, - 9, 1, 30, 8, 12, 20, 32, 36, 18, 16, 69, 40, 16,252,236,212, 60, 60,252, 60, 60,212,236,196, 49, 64, 18, 30, 32,135, 1, 20, -184, 40, 22, 31,135, 9, 12,140, 21,151, 11,189, 40, 0, 16,236,228,244, 60,252, 60, 16,244, 60,252, 60, 48, 1, 17, 50, 23, 22, - 17, 16, 7, 6, 35, 17, 35, 17, 34, 39, 38, 17, 16, 55, 54, 51, 17, 19, 50, 55, 54, 55, 54, 39, 38, 35, 3, 17, 34, 7, 6, 23, - 22, 23, 22, 2,252,199,133,137,137,133,199,183,199,134,136,136,134,199,183,113, 77, 84, 1, 1, 86, 77,113,183,113, 76, 87, 1, - 1, 85, 76, 6, 20,254, 99,153,156,254,237,254,237,156,153,254,111, 1,145,153,156, 1, 19, 1, 19,156,153, 1,157,250,119,103, -115,202,200,117,103,252,184, 3, 72,103,117,200,202,115,103, 0, 0, 2, 0, 65,255,226, 6,109, 4, 96, 0, 16, 0, 30, 0, 0, - 19, 53, 33, 21, 35, 22, 21, 16, 37, 36, 3, 2, 33, 32, 17, 52, 55, 41, 1, 6, 21, 16, 51, 50, 3, 51, 2, 55, 54, 17, 52, 65, - 6, 44,147, 77,254, 97,254,241, 34, 41,254,248,254, 97, 77, 4, 58,252,146, 71,222,207, 4,170, 4,207,222, 3,168,184,184,207, -164,253,173, 1, 1, 1, 42,254,213, 2, 82,164,207,209,167,254, 79, 2, 26,253,227, 3, 3, 1,174,167, 0, 0, 0, 1, 0,111, -254, 91, 4,206, 4,103, 0, 47, 0, 0, 5, 38, 39, 38, 55, 7, 2, 7, 6, 39, 38, 55, 54, 55, 54, 39, 38, 35, 34, 7, 53, 54, - 23, 22, 23, 22, 7, 55, 18, 55, 54, 23, 22, 7, 6, 7, 6, 23, 22, 51, 50, 55, 2, 7, 6, 39, 53, 4, 3,249,246, 33, 21, 24, -189, 96,200,141, 3, 1, 61, 96,136, 91, 43, 26,142, 57, 91, 82,126,246, 33, 19, 42,189, 96,200,141, 3, 1, 61, 96,136, 91, 43, - 26,142, 57, 91, 38,205,152,173, 1, 55, 10, 32,240,156, 99,108,254,247,124, 89,145, 68, 84,132,124,203,169,104,108,224, 61, 17, - 34,238,140,112,108, 1, 9,124, 89,145, 68, 84,132,124,203,169,104,108,253,224,102, 77, 90,160,160, 0, 0, 0, 0, 2, 0,115, -254, 88, 5,217, 5,240, 0, 15, 0, 25, 0, 0, 5, 17, 35, 17, 38, 39, 38, 16, 0, 33, 32, 0, 17, 16, 7, 6, 2, 32, 0, 17, - 16, 0, 32, 0, 17, 16, 3,132,184,252,160,189, 1,121, 1, 59, 1, 58, 1,120,188,159,123,254, 72,254,253, 1, 3, 1,184, 1, - 1, 24,254,112, 1,144, 26,179,210, 2,196, 1,165,254, 91,254,158,254,159,210,179, 5, 73,254,184,254,229,254,230,254,184, 1, - 72, 1, 26, 1, 27, 0, 0, 0, 0, 2, 0,113,254, 86, 4,117, 4,123, 0, 10, 0, 27, 0, 0, 1, 34, 6, 16, 22, 51, 50, 54, - 53, 52, 38, 3, 17, 35, 17, 38, 39, 38, 17, 16, 0, 51, 50, 0, 17, 16, 7, 6, 2,115,148,172,171,149,147,172,172, 57,170,190, -107,137, 1, 17,241,240, 1, 18,137,106, 3,223,231,254,110,231,232,200,199,233,252, 9,254,110, 1,146, 27,125,156, 1, 19, 1, - 20, 1, 56,254,200,254,236,254,237,156,123, 0, 0, 1, 0,139,254, 82, 4,171, 5,213, 0, 36, 0, 0, 1, 32, 7, 6, 17, 16, - 23, 22, 51, 50, 23, 22, 21, 20, 7, 6, 35, 52, 53, 22, 55, 54, 53, 52, 39, 38, 35, 32, 39, 38, 17, 16, 55, 54, 41, 1, 21, 3, - 70,254,243, 96,123, 91,109,200,122, 89, 84, 74, 80,163, 69, 42, 32, 32, 31, 58,254,192,142,149,185,138, 1,120, 1,101, 5, 43, -119,152,254,205,254,181,127,152, 84, 79,120,115, 80, 87, 75, 76, 5, 44, 35, 37, 53, 44, 42,203,214, 1,101, 1, 78,237,177,170, - 0, 1, 0,113,254, 82, 4, 81, 4, 97, 0, 34, 0, 0, 1, 34, 7, 6, 21, 20, 22, 51, 50, 23, 22, 21, 20, 7, 6, 35, 52, 53, - 22, 55, 54, 53, 52, 39, 38, 35, 34, 0, 17, 52, 55, 54, 5, 33, 21, 2,172,216, 62, 99,198,110,131, 80, 84, 74, 80,163, 69, 42, - 32, 32, 32, 57,204,254,214,151,104, 1, 52, 1,173, 3,168, 72,113,192,205,227, 76, 79,120,115, 80, 87, 75, 76, 5, 44, 35, 37, - 53, 44, 42, 1, 62, 1, 14,243,188,131, 1,184,255,255, 0,201, 0, 0, 4, 35, 5,213, 18, 6, 0, 41, 0, 0, 0, 1,255, 64, -254, 86, 3, 70, 6, 20, 0, 35, 0, 0, 51, 17, 52, 55, 54, 51, 50, 22, 23, 21, 46, 1, 35, 34, 7, 6, 21, 17, 33, 21, 33, 17, - 20, 7, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 55, 54,238,136, 96,169, 49, 99, 51, 36, 82, 44,120, 58, 75, 1, 65,254,191,139, - 98,173, 57,102, 46, 49,100, 48, 87, 64, 82, 4,130,160,142,100, 18, 18,164, 28, 29, 62, 81,111,254,201,143,253, 63,146,165,115, - 21, 22,164, 31, 33, 75, 95, 0, 0, 1, 0,179,255,252, 4,212, 5,213, 0, 23, 0, 0, 1, 3, 1, 3, 6, 23, 22, 55, 21, 34, - 39, 38, 55, 19, 1, 19, 54, 39, 38, 7, 53, 50, 23, 22, 2, 54,110, 3, 12,234, 39, 27, 66,131,230, 81, 95, 19,154,253, 6,172, - 39, 27, 66,131,230, 81, 95, 4,135,254, 91, 1,126,253, 44, 96, 42,108, 35,189, 70, 82,182, 1,218,254,145, 2,144, 96, 42,108, - 35,189, 70, 82, 0, 1, 0,191, 0, 0, 4,136, 6, 19, 0, 7, 0, 0, 9, 1, 35, 19, 33, 1, 51, 3, 4,136,254,231,184,226, -253, 38, 1, 25,184,226, 3,112,252,144, 2,198, 3, 77,253, 93, 0, 1, 0,114,254, 86, 6, 96, 5,241, 0, 33, 0, 0, 1, 17, - 35, 17, 6, 7, 53, 54, 5, 4, 19, 18, 17, 16, 3, 35, 0, 17, 16, 39, 6, 7, 6, 23, 17, 35, 54, 17, 52, 63, 1, 38, 37, 38, - 2, 81,170,205,104,208, 1,130, 1,217,237,214,246,225, 1, 4, 82, 56,121, 69, 5,205, 2,182,187,208,254,164, 48, 5, 58,253, -140, 2, 73, 75,105,198,215, 8, 10,254,216,254,241,253,189,254, 88,254,146, 1, 76, 1,202, 1,209,125, 32, 92, 52,208,253,198, - 33, 2, 20,247,143,141,249, 11, 1, 0, 0, 0, 0, 1, 0,119,254,144, 4,150, 4,120, 0, 22, 0, 0, 1, 3, 35, 1, 38, 39, - 1, 35, 1, 38, 39, 38, 35, 53, 32, 23, 22, 19, 18, 17, 35, 16, 39, 3,110,239,185, 1,100, 14, 50,254, 70,185, 2, 31, 98, 46, -188,211, 1, 45,242,224,172,116,168, 96, 1, 52,254,204, 1,192, 35, 77,253,208, 2,176,127, 33,132,164,216,200,254, 80,254,223, -254,137, 1, 94,246, 0, 0, 0, 0, 1, 0,115,254, 75, 7, 5, 5,213, 0, 61, 0, 0, 1, 52, 3, 38, 39, 35, 22, 19, 22, 21, - 16, 7, 6, 35, 34, 39, 38, 61, 1, 35, 21, 20, 7, 6, 35, 34, 39, 38, 17, 52, 55, 18, 55, 35, 6, 7, 2, 21, 16, 23, 22, 51, - 50, 55, 54, 55, 22, 23, 22, 23, 6, 7, 6, 7, 23, 54, 55, 36, 55, 54, 55, 54, 7, 5,100, 56, 95,250, 84,135, 67, 71, 65,134, -116, 70, 70,199, 71, 72,114,125, 73, 72, 67,135, 84,249, 93, 59,100,123,121,211,146,101,100, 39, 39,100, 68,103,164,205,121,138, - 97,140,118, 1, 20,180,219, 68, 61, 2,224,194, 1, 21,156,130, 70,254,191,159,183,254,217,119,109,105,104,198,241,241,198,104, -105,109,107, 1, 51,183,159, 1, 65, 70,127,159,254,242,201,254,104,180,177, 94, 94,173,173, 94, 65, 23,128, 81, 48, 24,133, 23, - 42,100,136,166,230,203, 0, 0, 0, 1, 0,135,254, 85, 6, 40, 4, 96, 0, 37, 0, 0, 33, 36, 3, 2, 33, 32, 17, 52, 19, 51, - 2, 21, 2, 23, 22, 3, 51, 2, 55, 54, 17, 52, 3, 51, 18, 21, 22, 7, 6, 7, 6, 7, 6, 7, 39, 54, 55, 54, 4,136,254,237, - 30, 35,254,242,254, 97,135,218,143, 1,223,208, 5,170, 3,206,222,143,218,135, 1, 57,105,197,154,210,107,112, 91, 81,139,199, - 1, 1, 13,254,242, 2, 53,235, 1, 64,254,192,240,254,151, 1, 1, 1,212,254, 43, 2, 2, 1,104,240, 1, 64,254,192,235,209, -132,244,158,123, 73, 37, 16,108, 11, 43, 63, 0, 0, 1, 0,115,254, 86, 5, 72, 5,240, 0, 29, 0, 0, 1, 6, 7, 6, 17, 20, - 23, 22, 51, 50, 55, 54, 25, 1, 51, 17, 35, 17, 6, 7, 6, 35, 32, 39, 38, 17, 16, 19, 54, 37, 2,236,180, 96,133,110, 98,195, -196, 98, 99,217,217, 68,104,104,170,255, 0,156,162,186,151, 1, 40, 5, 74, 18,132,185,254,238,249,171,152,152,153, 1, 11, 2, -236,248,129, 2,144,132, 64, 63,213,221, 1, 71, 1, 54, 1, 8,213, 1, 0, 0, 0, 1, 0,113,254, 86, 4,140, 4,123, 0, 26, - 0, 0, 1, 6, 7, 6, 21, 20, 23, 22, 32, 54, 53, 17, 51, 17, 35, 17, 14, 1, 35, 34, 39, 38, 53, 52, 55, 54, 51, 2,139,154, - 80,114, 94, 83, 1, 76,168,184,184, 58,177,144,218,133,137,158,127,253, 3,253, 14, 99,141,208,189,129,116,231,203, 2, 49,249, -246, 2, 82,100, 97,162,168,248,236,200,162, 0, 0, 1, 0,201,254, 75, 5,226, 5,213, 0, 37, 0, 0, 1, 32, 23, 22, 17, 20, - 7, 6, 7, 6, 7, 6, 7, 39, 54, 55, 54, 55, 54, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 21, 17, 35, 17, 51, 17, 54, 55, 54, - 3, 76, 1, 39,177,190, 60, 67,170,195,241,185, 73, 97,134,125,217,152,136, 44, 54,126,115,205,203,115,113,202,202, 78,105,105, - 4,123,179,194,254,253,204,161,178,128,147, 69, 53, 12,133, 22, 50, 87,122,109,104,127,192,157,150,134,129,126,222,254, 39, 5, -213,253,154,135, 66, 67, 0, 0, 0, 2, 0, 45,255,227, 4,146, 4,154, 0, 23, 0, 77, 0, 0, 1, 38, 35, 34, 7, 6, 7, 6, - 7, 6, 21, 20, 23, 22, 23, 22, 23, 22, 51, 50, 55, 54, 55, 54, 37, 22, 21, 20, 7, 6, 33, 34, 39, 38, 35, 34, 7, 39, 54, 51, - 50, 23, 22, 51, 50, 55, 54, 53, 52, 39, 6, 7, 6, 7, 6, 39, 38, 39, 38, 39, 38, 39, 38, 53, 52, 55, 54, 55, 54, 55, 54, 51, - 50, 23, 54, 55, 23, 6, 3, 44,127,141, 31, 55, 29, 37, 29, 16, 14, 12, 15, 24, 26, 35, 32, 30, 25, 71, 59, 73, 36, 1, 11,108, -127,111,254,247,141, 99, 75, 53, 65, 81, 84,135, 95,130, 82, 63, 91,157, 79, 75, 49, 27, 31, 70,117,102, 71, 41, 72, 50, 64, 48, - 41, 30, 29, 31, 46, 62, 80,101, 94,210,144, 56, 42,136, 55, 3, 68,152, 22, 11, 33, 26, 32, 27, 33, 32, 21, 28, 17, 20, 6, 5, - 25, 20, 49, 24, 50,192,212,176,156,136, 46, 35, 65,147, 76, 46, 35, 94, 89,127,140,113, 25, 23, 52, 43, 38, 2, 1, 10, 7, 34, - 26, 72, 52, 66, 59, 59, 61, 47, 63, 34, 43,159, 86,104, 80,146, 0, 1, 0, 79,254, 86, 5, 11, 5,246, 0, 33, 0, 0, 5, 4, - 33, 32, 1, 0, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7, 35, 54, 55, 54, 33, 32, 23, 22, 21, 20, 7, 0, 1, 22, 51, 32, 55, - 4,250,255, 0,254,237,254,175,254,185, 2,186,179,108,108, 99,164,180, 94, 35, 24,240, 44, 86,163, 1, 24, 1, 19,161,162,162, -254,247,254, 24,156,213, 1, 41,232,236,190, 1,163, 1,241,219,132,156,141,101, 93,146, 54, 63,161,102,194,144,145,241,216,182, -254,242,254,133,181,179, 0, 0, 0, 1, 0,100,254, 86, 4,106, 4,123, 0, 32, 0, 0, 1, 6, 35, 32, 1, 0, 55, 54, 53, 52, - 39, 38, 35, 34, 7, 6, 7, 35, 54, 55, 54, 51, 50, 4, 21, 20, 7, 6, 1, 22, 51, 50, 55, 4, 92,218,234,254,238,254,222, 2, - 66,167, 92, 92, 84,139,153, 80, 30, 20,204, 37, 73,139,238,232, 1, 20,138,175,254, 47,145,169,253,197,254,239,153, 1,121, 1, - 89,194,107,125,111, 83, 75,117, 44, 50,129, 82,156,232,194,164,156,197,254,224,186,144, 0, 0, 0, 2, 0,115, 0, 0, 5,182, - 5,239, 0, 2, 0, 53, 0, 0, 37, 33, 9, 3, 38, 39, 38, 35, 34, 15, 1, 53, 54, 55, 54, 51, 50, 23, 22, 23, 9, 1, 54, 55, - 54, 51, 50, 23, 22, 23, 21, 39, 38, 35, 34, 7, 6, 7, 9, 1, 22, 23, 22, 59, 1, 21, 33, 53, 51, 50, 55, 54, 1,218, 2,110, -254,205,254, 20, 1,128,254,220, 19, 26, 34, 63, 25, 22, 69, 33, 32, 31, 28,114, 75, 44, 47, 1, 2, 1, 9, 52, 39, 75,114, 29, - 30, 32, 33, 68, 23, 24, 60, 38, 19, 26,254,210, 1,116, 6, 7, 29, 69, 71,250,195, 71, 72, 26, 12,170, 1,202,254,104, 2, 61, - 1,187, 29, 26, 34, 4, 10,187, 11, 5, 5, 67, 40, 70,254,129, 1,127, 75, 35, 67, 5, 5, 11,187, 10, 4, 34, 17, 38,254, 69, -253,195, 9, 8, 33,170,170, 33, 15, 0, 0, 0, 0, 3, 0, 54, 0, 0, 4,203, 4,123, 0, 0, 0, 3, 0, 54, 0, 0, 37, 41, - 1, 3, 9, 1, 3, 38, 39, 38, 35, 34, 15, 1, 53, 54, 55, 54, 51, 50, 23, 22, 23, 27, 1, 54, 55, 54, 51, 50, 23, 22, 23, 21, - 39, 38, 35, 34, 7, 6, 7, 3, 1, 22, 23, 22, 59, 1, 21, 33, 53, 51, 50, 55, 54, 4,203,252,207, 1,204,228,254, 91, 1, 57, -239, 21, 17, 29, 54, 21, 19, 58, 28, 27, 26, 24,131, 64, 37, 40,197,197, 40, 37, 64,131, 24, 26, 27, 28, 58, 19, 21, 54, 29, 17, - 21,246, 1, 45, 6, 5, 25, 58, 73,251,107, 73, 58, 25, 5,158, 1, 56,254,238, 1,164, 1, 61, 28, 14, 25, 3, 7,141, 8, 4, - 4, 51, 30, 53,254,250, 1, 6, 53, 30, 51, 4, 4, 8,141, 7, 3, 25, 14, 28,254,184,254,103, 8, 5, 25,158,158, 25, 5, 0, - 0, 2, 0,115,255,227, 5, 37, 6, 16, 0, 29, 0, 43, 0, 0, 1, 36, 7, 6, 7, 54, 55, 54, 51, 50, 0, 16, 0, 33, 32, 39, - 38, 17, 16, 55, 54, 33, 50, 55, 54, 55, 21, 6, 7, 6, 18, 16, 38, 35, 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 3, 42,254,214, - 87, 56, 22, 81, 85,123,130,245, 1, 50,254,206,254,249,254,206,164,163,139,124, 1,176,115,149,160, 75, 94,151,108,142,200,186, -188,104,105,105,101,191,188, 98, 5, 45, 2,115, 74,160, 86, 34, 49,254,188,253,240,254,188,156,155, 1, 80, 1,222,210,187, 10, - 10, 39,177, 36, 8, 6,252, 65, 1,130,230,115,116,192,189,120,115,115, 0, 0, 0, 2, 0,113,255,227, 4, 91, 6, 16, 0, 31, - 0, 47, 0, 0, 1, 38, 7, 6, 7, 54, 55, 54, 51, 50, 23, 22, 16, 7, 6, 35, 34, 39, 38, 17, 16, 55, 54, 33, 50, 55, 54, 55, - 21, 6, 7, 6, 19, 52, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 54, 2,155,227, 73, 44, 20, 41,101, 91,120,204,127, -128,128,127,219,255,137,136,116,103, 1, 79, 95, 92, 83, 71, 93, 69, 90,168, 83, 84,146,149, 86, 88, 88, 84,151,148, 82, 83, 5, - 55, 2,120, 74,169, 70, 54, 49,162,162,253,240,162,162,156,155, 1, 80, 1,222,210,187, 10, 10, 39,167, 39, 5, 6,252,248,205, -114,115,115,116,203,199,120,115,115,116, 0, 0, 0, 1, 0, 44,254, 86, 4,183, 5,213, 0, 15, 0, 0, 1, 17, 35, 53, 33, 17, - 35, 17, 33, 21, 35, 17, 33, 17, 51, 17, 4,183,203,254,235,203,254,235,203, 1,224,203, 4, 96,254,242,100,250,160, 5, 96,100, - 1, 14, 1,117,254,139, 0, 0, 0, 1, 0, 55,254, 85, 4, 20, 5,207, 0, 15, 0, 0, 1, 17, 35, 53, 35, 17, 35, 17, 35, 21, - 35, 17, 33, 17, 51, 17, 4, 20,173,229,185,229,173, 1,146,185, 4, 95,255, 0,112,250,134, 5,122,112, 1, 0, 1,112,254,144, - 0, 1, 0,111,255,242, 4,206, 4,103, 0, 43, 0, 0, 1, 2, 7, 6, 39, 38, 55, 54, 55, 54, 39, 38, 35, 34, 7, 53, 54, 23, - 22, 23, 22, 7, 55, 18, 55, 54, 23, 22, 7, 6, 7, 6, 23, 22, 51, 50, 55, 21, 6, 39, 38, 39, 38, 55, 2, 40, 96,200,141, 3, - 1, 61, 96,136, 91, 43, 26,142, 57, 91, 82,126,246, 33, 19, 42,189, 96,200,141, 3, 1, 61, 96,136, 91, 43, 26,142, 57, 91, 82, -126,246, 33, 19, 42, 1,153,254,247,124, 89,145, 68, 84,132,124,203,169,104,108,224, 61, 17, 32,240,140,112,108, 1, 9,124, 89, -145, 68, 84,132,124,203,169,104,108,224, 61, 17, 32,240,140,112, 0, 2, 0,183,254, 86, 4,164, 4,123, 0, 21, 0, 29, 0, 0, - 19, 54, 55, 54, 55, 54, 51, 50, 0, 16, 2, 35, 34, 38, 39, 18, 41, 1, 21, 33, 32, 19, 36, 16, 38, 32, 6, 16, 22, 32,186, 2, - 88, 61,151, 59,182,204, 0,255,255,204,123,177, 58, 5, 1, 32, 1,244,254, 28,254, 10, 6, 3, 45,167,254,220,167,167, 1, 36, - 2, 37,204,167,102, 90, 35,254,188,253,240,254,188, 97,100,254, 88,170, 2,218, 52, 1,150,231,231,254,106,231,255,255, 0,113, -255,227, 3,231, 4,123, 18, 6, 0, 70, 0, 0,255,255,255,219,254, 86, 1,121, 6, 20, 18, 6, 0, 77, 0, 0, 0, 3, 0,115, -255,227, 5,217, 5,240, 0, 7, 0, 15, 0, 26, 0, 0, 1, 33, 18, 23, 22, 32, 55, 54, 19, 38, 39, 38, 32, 7, 6, 7, 1, 32, - 0, 17, 16, 0, 33, 32, 0, 16, 0, 5, 3,252, 69, 8,122,129, 1,184,129,119, 1, 22, 98,129,254, 72,129, 96, 25, 1,214, 1, - 58, 1,120,254,136,254,198,254,197,254,135, 1,121, 2,198,254,255,154,164,164,153, 1,172,186,126,164,164,121,191, 2,128,254, - 91,254,158,254,159,254, 91, 1,164, 2,196, 1,165, 0, 0, 0, 0, 1, 0,113,255,227, 3,216, 4,123, 0, 33, 0, 0, 1, 38, - 39, 38, 35, 34, 7, 6, 7, 33, 21, 33, 22, 23, 22, 51, 50, 63, 1, 21, 7, 6, 35, 32, 39, 38, 16, 55, 54, 33, 50, 23, 22, 23, - 3,216, 37, 37, 99,106,183,102, 95, 18, 2,165,253, 91, 18, 95,102,183,128, 77, 74, 79,104,107,254,244,156,157,157,156, 1, 12, -101,110, 40, 39, 3,174, 13, 10, 26, 99, 92,169,144,169, 92, 99, 26, 25,167, 18, 22,156,156, 2, 40,156,156, 22, 8, 12, 0, 0, - 0, 1, 0,196,255,227, 4, 43, 4,123, 0, 33, 0, 0, 19, 53, 54, 55, 54, 51, 32, 23, 22, 16, 7, 6, 33, 34, 47, 1, 53, 23, - 22, 51, 50, 55, 54, 55, 33, 53, 33, 38, 39, 38, 35, 34, 7, 6,196, 39, 40,110,101, 1, 12,156,157,157,156,254,244,107,104, 79, - 74, 77,128,183,102, 95, 18,253, 91, 2,165, 18, 95,102,183,106, 99, 37, 3,174,163, 12, 8, 22,156,156,253,216,156,156, 22, 18, -167, 25, 26, 99, 92,169,144,169, 92, 99, 26, 10,255,255, 0,201, 0, 0, 4,141, 5,213, 18, 6, 0,160, 0, 0,255,255, 0,186, -254, 86, 4,164, 6, 20, 18, 6, 0,192, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 18, 6, 0, 38, 0, 0, 0, 1, 0,201, - 0, 0, 6, 31, 5,213, 0, 12, 0, 0, 19, 33, 9, 1, 33, 17, 35, 17, 1, 35, 1, 17, 35,201, 1, 45, 1,125, 1,127, 1, 45, -197,254,127,203,254,127,196, 5,213,254, 33, 1,223,250, 43, 5, 31,254, 25, 1,231,250,225, 0, 0, 1, 0,127,254, 86, 4,179, - 4, 96, 0, 12, 0, 0, 19, 33, 19, 1, 33, 17, 35, 17, 1, 35, 1, 17, 35,127, 1, 27,254, 1, 0, 1, 27,185,254,236,153,254, -235,185, 4, 96,254,123, 1,133,251,160, 3,178,254, 96, 1,160,250,164, 0, 0, 0, 2, 0, 85,254, 86, 4,164, 4,123, 0, 24, - 0, 32, 0, 0, 23, 17, 52, 55, 54, 55, 54, 51, 50, 0, 16, 2, 35, 34, 38, 39, 17, 33, 21, 33, 21, 35, 53, 35, 53, 0, 16, 38, - 32, 6, 16, 22, 32,186, 90, 61,151, 59,182,204, 0,255,255,204,123,177, 58, 1,229,254, 27,185,101, 3,144,167,254,220,167,167, - 1, 36,144, 2,181,231,140,102, 90, 35,254,188,253,240,254,188, 97,100,254,200,170,112,112,170, 1,244, 1,150,231,231,254,106, -231, 0, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 18, 6, 1, 72, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 18, 38, - 3, 22, 0, 0, 16, 7, 0,121, 2, 51, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 16, 39, 0,121, 0,228, 0, 0, 18, 6, - 3, 26, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 38, 3, 50, 0, 0, 16, 7, 6,135, 4,238, 1,117,255,255, 0,201, - 0, 0, 4,139, 5,213, 18, 38, 3, 50, 0, 0, 16, 7, 6,132, 4,229, 1,117, 0, 1,255,250,254,102, 5,172, 5,213, 0, 29, - 0, 0, 37, 16, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 38, 35, 33, 17, 35, 17, 33, 53, 33, 21, 33, 17, 33, 50, 23, 22, 21, - 5,172,204,228, 76, 62,134, 56, 55,124,124,254,136,203,254, 82, 4,139,253,238, 1,161,186,113,109,104,254,242,244,170, 75, 75, -194, 1, 34,159,158,253, 57, 5, 43,170,170,254, 70,119,114,238,255,255, 0,201, 0, 0, 4,106, 5,213, 18, 38, 3, 48, 0, 0, - 16, 7, 6,133, 4,174, 1,117, 0, 1, 0,115,255,227, 5, 39, 5,240, 0, 36, 0, 58, 64, 32, 36,149, 35,173, 37, 26,161, 25, -174, 30,149, 21,145, 37, 8,161, 9,174, 4,149, 13,140, 37, 38, 35, 25, 8, 34, 0, 25, 17, 37, 16,220,236, 50,212, 60,204,204, - 49, 0, 16,244,236,244,236, 16,244,236,244,236, 16,244,236, 48, 1, 18, 23, 22, 33, 50, 55, 54, 55, 21, 6, 7, 6, 35, 32, 39, - 38, 17, 16, 55, 54, 33, 50, 23, 22, 23, 21, 38, 39, 38, 35, 32, 7, 6, 7, 33, 21, 1, 72, 7,129,136, 1, 0,130,116,115,102, -106,119,118,132,254,173,195,195,195,195, 1, 83,134,118,119,104,102,115,116,130,255, 0,136,103, 25, 2,178, 2,199,254,242,147, -157, 47, 47, 95,211, 72, 36, 36,207,208, 1,103, 1,104,207,208, 36, 35, 71,213, 95, 47, 47,156,119,198,170, 0,255,255, 0,135, -255,227, 4,162, 5,240, 18, 6, 0, 54, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 6, 0, 44, 0, 0,255,255, 0,201, - 0, 0, 1,147, 5,213, 18, 38, 3, 35, 0, 0, 17, 7, 6,132, 3, 47, 1,117, 0, 8,180, 0, 10, 7, 1, 7, 43, 49, 0, 0, -255,255,255,150,254,102, 1,147, 5,213, 18, 6, 0, 45, 0, 0, 0, 2, 0, 54,255,227, 8, 47, 5,213, 0, 22, 0, 33, 0, 0, - 1, 33, 21, 16, 3, 6, 5, 53, 54, 55, 18, 25, 1, 33, 17, 51, 50, 4, 21, 20, 4, 35, 33, 1, 52, 39, 38, 43, 1, 17, 51, 50, - 55, 54, 4,112,254, 27,132, 98,254,145,212, 67,117, 3,120,234,251, 1, 16,254,240,251,254, 76, 2,234, 79, 78,163,224,224,161, - 80, 79, 5, 43,213,254, 24,254,170,253, 56,167, 46,168, 1, 37, 2, 53, 1, 27,253,154,218,222,221,218, 1,183,139, 68, 67,253, -221, 68, 67, 0, 0, 2, 0,201, 0, 0, 7,204, 5,213, 0, 18, 0, 29, 0, 0, 33, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, - 51, 50, 4, 21, 20, 4, 35, 1, 52, 39, 38, 43, 1, 17, 51, 50, 55, 54, 4, 13,253,134,202,202, 2,122,202,234,251, 1, 16,254, -240,251, 1, 54, 79, 78,163,224,224,161, 80, 79, 2,199,253, 57, 5,213,253,156, 2,100,253,154,218,222,221,218, 1,183,139, 68, - 67,253,221, 68, 67, 0, 0, 0, 0, 1,255,250, 0, 0, 5,172, 5,213, 0, 20, 0, 0, 1, 50, 23, 22, 21, 17, 35, 17, 52, 38, - 35, 33, 17, 35, 17, 33, 53, 33, 21, 33, 17, 4, 20,186,113,109,201,124,124,254,136,203,254, 82, 4,139,253,238, 3,113,119,114, -238,254,102, 1,138,159,158,253, 57, 5, 43,170,170,254, 70, 0,255,255, 0,201, 0, 0, 5,106, 5,213, 18, 38, 3, 55, 0, 0, - 16, 7, 6,133, 4,238, 1,117,255,255, 0,201, 0, 0, 5, 51, 5,213, 18, 38, 3, 53, 0, 0, 16, 7, 6,135, 4,229, 1,117, -255,255, 0, 35,255,227, 4,189, 5,213, 16, 39, 6,139, 4,114, 1,117, 18, 6, 3, 64, 0, 0, 0, 1, 0,201,254, 86, 5, 59, - 5,213, 0, 11, 0, 0, 41, 1, 17, 51, 17, 33, 17, 51, 17, 33, 17, 35, 2,188,254, 13,202, 2,222,202,254, 74,201, 5,213,250, -213, 5, 43,250, 43,254, 86, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 6, 0, 36, 0, 0, 0, 2, 0,201, 0, 0, 4,236, - 5,213, 0, 10, 0, 23, 0, 44, 64, 24, 13,149, 23,129, 22, 5,149, 14,173, 6,149, 22, 25, 11, 0, 25, 18, 46, 5, 13, 28, 23, - 4, 24, 16,252,236, 50,244,236,196,204, 49, 0, 47,236,244,236, 16,244,236, 48, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 17, - 21, 33, 17, 33, 50, 4, 21, 20, 4, 35, 33, 17, 4, 23, 79, 78,163,254,188, 1, 68,163, 78, 79,253,124, 1, 78,251, 1, 16,254, -240,251,253,232, 1,183,139, 68, 67,253,221, 68, 67, 4,168,166,254, 64,218,222,221,218, 5,213,255,255, 0,201, 0, 0, 4,236, - 5,213, 18, 6, 0, 37, 0, 0, 0, 1, 0,201, 0, 0, 4,106, 5,213, 0, 5, 0, 25, 64, 12, 4,149, 1,129, 0, 7, 2, 4, - 28, 1, 4, 6, 16,252,252,204,196, 49, 0, 47,244,236, 48, 51, 17, 33, 21, 33, 17,201, 3,161,253, 41, 5,213,170,250,213, 0, - 0, 2, 0, 49,254, 86, 6, 3, 5,213, 0, 7, 0, 23, 0, 53, 64, 15, 2, 28, 14, 25, 19, 28, 16, 23, 3, 28, 13, 20, 28, 23, - 24, 16,220,236,212,236, 16,212,236,204,212,236, 49, 0, 64, 12, 3,149, 13,129, 18, 22,189, 15, 0, 23,149, 20, 47,236, 50, 50, -236, 50,244,236, 48, 37, 33, 17, 33, 21, 16, 3, 6, 5, 54, 55, 18, 25, 1, 33, 17, 51, 17, 35, 17, 33, 17, 35, 17, 1,200, 2, -168,254, 27,132, 24,254,168,132, 50,117, 3,120,201,201,251,192,201,170, 4,129,212,254, 17,254,177, 61, 50, 57,126, 1, 37, 2, - 53, 1, 26,250,213,253,172, 1,170,254, 86, 2, 84, 0, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 6, 0, 40, 0, 0, - 0, 1, 0, 59, 0, 0, 6,173, 5,213, 0, 21, 0,110, 64, 22, 66, 2, 20, 16,129, 14, 8, 12,149, 0, 18,173, 6, 10, 14, 23, - 8, 21, 28, 11, 20, 22, 16,212, 60,252, 60,196, 49, 0, 47, 60, 60,244, 60,236, 50, 16,244, 60, 60, 48, 75, 83, 88, 64, 36, 4, - 17, 7, 2, 1, 5, 17, 6, 7, 6, 4, 17, 1, 3, 17, 2, 2, 1, 15, 17, 18, 13, 12, 16, 17, 17, 18, 17, 15, 17, 12, 14, 17, - 13, 13, 12, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 89, 1, 51, 1, 51, - 9, 1, 35, 1, 35, 17, 35, 17, 35, 1, 35, 9, 1, 51, 1, 51, 17, 51, 3,217,149, 1, 52,217,254,162, 1,144,217,254,155,150, -202,150,254,155,217, 1,144,254,162,217, 1, 52,149,202, 3,113, 2,100,253, 71,252,228, 2,199,253, 57, 2,199,253, 57, 3, 28, - 2,185,253,156, 2,100, 0, 0,255,255, 0,156,255,227, 4,115, 5,240, 18, 6, 0, 22, 0, 0, 0, 1, 0,201, 0, 0, 5, 51, - 5,213, 0, 9, 0,121, 64, 30, 3, 17, 9, 9, 8, 8, 17, 4, 4, 3, 66, 8, 3, 9, 6,175, 2, 5, 9, 4, 7, 3, 28, 0, - 54, 7, 28, 6, 4, 10, 16,252,236,252,236, 17, 57, 57, 49, 0, 47, 60,236, 50, 57, 57, 48, 75, 83, 88, 7, 16, 4,237, 7, 16, - 4,237, 89, 34,178, 31, 11, 1, 1, 93, 64, 48, 54, 8, 56, 3, 72, 8, 71, 3,105, 8,102, 3,128, 8, 7, 6, 4, 9, 9, 21, - 4, 26, 9, 70, 4, 73, 9, 87, 4, 88, 9,101, 4,105, 9,121, 9,133, 4,138, 9,149, 4,154, 9,159, 11, 16, 93, 0, 93, 1, - 17, 35, 17, 1, 33, 17, 51, 17, 1, 5, 51,196,253,106,254,240,196, 2,150, 5,213,250, 43, 4,225,251, 31, 5,213,251, 31, 4, -225, 0, 0, 0,255,255, 0,201, 0, 0, 5, 51, 5,213, 16, 39, 6,139, 4,245, 1,117, 18, 6, 3, 53, 0, 0,255,255, 0,201, - 0, 0, 5,106, 5,213, 18, 6, 0, 46, 0, 0, 0, 1, 0, 54,255,228, 5, 58, 5,213, 0, 15, 0, 38, 64, 20, 11,149, 6,129, - 9, 1,149, 0,140, 9, 17, 4, 10, 28, 7, 11, 28, 6, 1, 16, 16,212,212,236,212,236,236, 49, 0, 47,244,236, 16,244,236, 48, - 23, 53, 54, 55, 18, 25, 1, 33, 17, 35, 17, 33, 21, 16, 3, 6, 54,212, 67,117, 3,120,202,254, 27,132, 98, 28,167, 46,168, 1, - 37, 2, 53, 1, 26,250, 43, 5, 43,212,254, 24,254,170,253, 0,255,255, 0,201, 0, 0, 6, 31, 5,213, 18, 6, 0, 48, 0, 0, -255,255, 0,201, 0, 0, 5, 59, 5,213, 18, 6, 0, 43, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 6, 0, 50, 0, 0, - 0, 1, 0,201, 0, 0, 5, 59, 5,213, 0, 7, 0, 31, 64, 16, 4,149, 7,129, 2, 6, 9, 4, 3, 28, 0, 4, 28, 7, 4, 8, - 16,252,236,212,236,236, 49, 0, 47, 60,244,236, 48, 1, 17, 35, 17, 33, 17, 35, 17, 5, 59,202,253, 34,202, 5,213,250, 43, 5, - 43,250,213, 5,213, 0, 0, 0,255,255, 0,201, 0, 0, 4,141, 5,213, 18, 6, 0, 51, 0, 0,255,255, 0,115,255,227, 5, 39, - 5,240, 18, 6, 0, 38, 0, 0,255,255,255,250, 0, 0, 4,233, 5,213, 18, 6, 0, 55, 0, 0, 0, 1, 0, 35,255,227, 4,189, - 5,213, 0, 17, 0, 65, 64, 14, 66, 6,149, 5,140, 16, 13,129, 18, 19, 17, 6, 13, 18, 16,212,196,212,196, 49, 0, 16,228, 50, -244,236, 48, 75, 83, 88, 64, 18, 15, 17, 0, 13, 12, 16, 17, 17, 17, 0, 15, 17, 12, 14, 17, 13, 13, 12, 5, 7, 16,236, 16,236, - 7, 16,236, 8, 16,236, 89, 37, 6, 7, 6, 43, 1, 53, 51, 50, 55, 54, 63, 1, 1, 51, 9, 1, 51, 2,143, 22, 31,103,227, 77, - 63,140, 49, 14, 8, 45,254, 33,217, 1,115, 1,117,217,181, 51, 37,122,170, 75, 22, 18,106, 4,107,252,148, 3,108, 0, 0, 0, - 0, 3, 0,115, 0, 0, 5,217, 5,213, 0, 8, 0, 17, 0, 39, 0, 59, 64, 31, 17, 0,149, 29, 26, 27,129, 39, 9, 8,149, 37, - 18, 39, 41, 16, 13, 25, 33, 18, 0, 27, 28, 37, 17, 28, 4, 25, 22, 16, 40, 16,252,236,212, 60, 60,252, 60, 60,212,236,236, 49, - 0, 47,220, 60,236, 50, 16,244,220, 60,236, 50, 48, 1, 6, 7, 6, 21, 20, 23, 22, 23, 51, 54, 55, 54, 53, 52, 39, 38, 39, 3, - 38, 39, 38, 17, 16, 55, 54, 55, 53, 51, 21, 22, 23, 22, 17, 16, 7, 6, 7, 21, 35, 2,194,150, 98,130,130, 98,150,202,150, 98, -128,128, 98,150,202,244,158,189,189,157,245,202,244,157,188,188,157,244,202, 4,142, 21, 87,115,198,197,115, 87, 21, 21, 87,115, -197,198,115, 87, 21,252, 16, 22,134,160, 1, 15, 1, 15,161,135, 22,159,159, 23,134,161,254,241,254,242,161,134, 23,157, 0, 0, -255,255, 0, 61, 0, 0, 5, 59, 5,213, 18, 6, 0, 59, 0, 0, 0, 1, 0,201,254, 86, 6, 4, 5,213, 0, 11, 0, 40, 64, 21, - 6, 2,129, 11,189, 8, 4,149, 1, 13, 0, 28, 9, 6, 28, 7, 3, 28, 2, 4, 12, 16,252,236,212,236,212,236,204, 49, 0, 47, -236, 50,236,244, 60, 48, 41, 1, 17, 51, 17, 33, 17, 51, 17, 51, 17, 35, 5, 59,251,142,202, 2,222,202,201,201, 5,213,250,213, - 5, 43,250,213,253,172, 0, 0, 0, 1, 0,175, 0, 0, 4,179, 5,213, 0, 16, 0, 35, 64, 18, 2,149, 12,173, 14, 7,129, 0, - 18, 4, 1, 14, 28, 15, 8, 28, 7, 17, 16,220,236,212,236, 50,236, 49, 0, 47,228, 50,244,236, 48, 33, 17, 33, 34, 39, 38, 53, - 17, 51, 17, 20, 22, 51, 33, 17, 51, 17, 3,232,254, 95,186,113,109,201,124,124, 1,120,203, 2,199,119,114,238, 1, 55,254,217, -159,158, 2,100,250, 43, 0, 0, 0, 1, 0,201, 0, 0, 7, 57, 5,213, 0, 11, 0, 40, 64, 21, 10, 2, 6,129, 0, 8,149, 5, - 13, 4, 2, 28, 3, 10, 28, 11, 7, 28, 6, 4, 12, 16,252,236,212,252,212,236,236, 49, 0, 47,236, 50,244, 60,196, 48, 37, 33, - 17, 51, 17, 33, 17, 51, 17, 33, 17, 51, 4,102, 2, 9,202,249,144,202, 2, 9,202,170, 5, 43,250, 43, 5,213,250,213, 4,221, - 0, 1, 0,201,254, 86, 8, 2, 5,213, 0, 15, 0, 49, 64, 26, 6, 10, 2,129, 15,189, 12, 8, 4,149, 1, 17, 0, 28, 13, 10, - 28, 11, 6, 28, 7, 3, 28, 2, 4, 16, 16,252,236,212,252,212,236,212,236,204, 49, 0, 47,236, 50, 50,236,244, 60,196, 48, 41, - 1, 17, 51, 17, 33, 17, 51, 17, 33, 17, 51, 17, 51, 17, 35, 7, 57,249,144,202, 2, 9,202, 2, 9,202,201,201, 5,213,250,213, - 4,221,251, 35, 5, 43,250,213,253,172, 0, 0, 0, 2, 0, 50, 0, 0, 6, 24, 5,213, 0, 12, 0, 23, 0, 42, 64, 22, 2,149, - 3,129, 0, 18,149, 5,173, 19,149, 0, 16, 13, 25, 9, 18, 4, 28, 1, 3, 24, 16,204,220,236, 50,212,236,204, 49, 0, 47,236, -244,236, 16,244,236, 48, 33, 17, 33, 53, 33, 17, 33, 50, 4, 21, 20, 4, 35, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1,245, -254, 61, 2,141, 1, 78,251, 1, 16,254,240,251, 1, 54, 79, 78,163,254,188, 1, 68,161, 80, 79, 5, 43,170,253,154,218,222,221, -218, 1,183,139, 68, 67,253,221, 68, 67, 0, 0,255,255, 0,201, 0, 0, 6, 70, 5,213, 16, 39, 0, 44, 4,179, 0, 0, 17, 6, - 3, 73, 0, 0, 0, 13, 64, 6, 27, 4, 1, 28, 0, 21, 16,220,252,236, 49, 0, 0, 2, 0,201, 0, 0, 4,236, 5,213, 0, 10, - 0, 21, 0, 36, 64, 19, 5,149, 13,173, 11,129, 6,149, 21, 23, 0, 25, 17, 5, 12, 28, 11, 4, 22, 16,252,236, 50,212,236,204, - 49, 0, 47,236,228,244,236, 48, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1, 51, 17, 33, 50, 4, 21, 20, 4, 35, 33, 4, 23, - 79, 78,163,254,188, 1, 68,163, 78, 79,252,178,202, 1, 78,251, 1, 16,254,240,251,253,232, 1,183,139, 68, 67,253,221, 68, 67, - 4,168,253,154,218,222,221,218, 0, 1, 0,111,255,227, 5, 35, 5,240, 0, 36, 0, 58, 64, 32, 1,149, 2,173, 37, 11,161, 12, -174, 7,149, 16,145, 37, 29,161, 28,174, 33,149, 24,140, 37, 38, 0, 3, 25, 20, 2, 29, 12, 37, 16,220, 60,204,212,236, 50,204, - 49, 0, 16,244,236,244,236, 16,244,236,244,236, 16,244,236, 48, 1, 33, 53, 33, 38, 39, 38, 33, 34, 7, 6, 7, 53, 54, 55, 54, - 51, 32, 23, 22, 17, 16, 7, 6, 33, 34, 39, 38, 39, 53, 22, 23, 22, 51, 32, 55, 54, 4, 78,253, 70, 2,178, 25,103,136,255, 0, -130,116,115,102,104,119,118,134, 1, 83,195,195,195,195,254,173,132,118,119,106,102,115,116,130, 1, 0,136,129, 2,199,170,198, -119,156, 47, 47, 95,213, 71, 35, 36,208,207,254,152,254,153,208,207, 36, 36, 72,211, 95, 47, 47,157,147, 0, 0, 0, 2, 0,211, -255,227, 7,204, 5,240, 0, 15, 0, 38, 0, 56, 64, 31, 0,149, 20,145, 39, 8,149, 28,140, 39, 33,149, 38,173, 36,129, 35, 40, - 12, 25, 24, 4, 25, 32, 16, 33, 37, 28, 36, 4, 39, 16,252,236, 50,212, 60,236,212,236,204, 49, 0, 47,228,244,236, 16,244,236, - 16,244,236, 48, 1, 34, 7, 6, 17, 16, 23, 22, 51, 50, 55, 54, 17, 16, 39, 38, 1, 18, 55, 54, 33, 32, 23, 22, 17, 16, 7, 6, - 33, 32, 39, 38, 3, 35, 17, 35, 17, 51, 17, 5, 26,220,130,129,129,130,220,220,128,129,129,128,252,119, 30,151,189, 1, 59, 1, - 58,188,188,188,188,254,198,254,197,189,179, 9,201,202,202, 5, 76,164,164,254,229,254,230,164,164,164,164, 1, 26, 1, 27,164, -164,254, 37, 1, 5,168,210,210,211,254,158,254,159,210,211,210,200, 1, 74,253, 57, 5,213,253,156, 0, 0, 0, 0, 2, 0, 59, - 0, 0, 4,198, 5,213, 0, 19, 0, 28, 0, 69, 64, 22, 66, 21,149, 6,129, 16, 11,149, 27,173, 9, 16, 30, 4, 10, 20, 28, 7, - 24, 25, 3, 29, 16,212,236,212,236, 50,236, 49, 0, 47, 60,244,236, 16,244,236, 48, 75, 83, 88, 64, 13, 13, 12, 11, 3, 10, 14, - 17, 17, 15, 17, 16, 17, 16, 5, 7, 16,236, 16,236, 17, 23, 57, 89, 1, 46, 1, 53, 52, 54, 41, 1, 17, 35, 17, 35, 34, 6, 7, - 3, 35, 19, 62, 1, 1, 35, 34, 6, 21, 20, 22, 59, 1, 2, 2,125,131,252, 1, 0, 1,200,202,220,120,139, 74,191,217,205, 62, -123, 2, 59,254,146,149,149,146,254, 2,188, 36,186,141,216,214,250, 43, 2,119, 98,150,254,129, 1,152,126,144, 2,137,133,131, -131,135, 0, 0,255,255, 0,123,255,227, 4, 45, 4,123, 18, 6, 0, 68, 0, 0, 0, 2, 0,113,255,227, 4,117, 5,240, 0, 28, - 0, 45, 0, 73, 64, 40, 29, 22, 44,185, 6, 46, 0,134, 28,136, 2,185, 26, 46, 37,185, 14,140, 46, 29, 40, 22, 33, 4, 47, 69, - 28, 40, 18, 10, 81, 18, 4, 18, 24, 33, 18, 18, 69, 46, 16,252,236,212,236, 16,244,236,196,236, 17, 18, 57, 18, 57, 49, 0, 16, -244,236, 16,212,236,244,236, 16,212,236, 57, 57, 48, 1, 38, 35, 34, 21, 20, 5, 22, 23, 22, 17, 16, 7, 6, 35, 34, 39, 38, 17, - 52, 55, 54, 55, 38, 53, 16, 33, 50, 23, 1, 6, 7, 6, 21, 20, 23, 22, 51, 50, 54, 53, 52, 39, 38, 39, 38, 3,236,102,239,253, - 1, 8,208,117,142,137,137,240,239,138,137,137, 53, 75,156, 1,185,221,120,254, 24, 68, 55, 86, 85, 86,149,147,172, 91, 97,126, - 64, 5, 17, 70,117, 92, 48, 37,112,135,254,235,254,247,156,157,157,156, 1, 19,204,165, 64, 36, 79,141, 1, 16, 70,254, 40, 29, - 73,113,204,203,114,115,232,190,199, 96,103, 11, 6, 0, 0, 0, 0, 3, 0,186, 0, 0, 4, 62, 4, 96, 0, 10, 0, 21, 0, 38, - 0, 45, 64, 24, 0,169, 12, 38, 11,169, 22,188, 1,169, 38, 17, 18, 26, 40, 6, 18, 33, 0, 11, 8, 22, 70, 39, 16,252,236, 50, -212,236,204,212,236, 49, 0, 47,236,244,236, 16,212,236, 48, 1, 17, 33, 50, 55, 54, 53, 52, 39, 38, 35, 1, 17, 51, 50, 55, 54, - 53, 52, 39, 38, 35, 37, 33, 50, 22, 21, 20, 7, 6, 7, 30, 1, 21, 20, 7, 6, 35, 33, 1,114, 1, 6,129, 66, 63, 63, 69,126, -254,250,242,117, 61, 58, 58, 61,117,254, 86, 1,182,197,212, 54, 54,106,127,140,116,115,214,254, 57, 2, 2,254,151, 46, 44, 91, - 94, 41, 45, 1,197,254,218, 38, 36, 75, 72, 36, 37,153,144,133,103, 60, 61, 15, 24,152,114,150, 82, 82, 0, 0, 0, 1, 0,186, - 0, 0, 3,208, 4, 96, 0, 5, 0, 25, 64, 12, 4,169, 1,188, 0, 7, 2, 4, 8, 1, 70, 6, 16,252,252,204,196, 49, 0, 47, -244,236, 48, 51, 17, 33, 21, 33, 17,186, 3, 22,253,162, 4, 96,170,252, 74, 0, 0, 2, 0, 50,254, 86, 5, 46, 4, 96, 0, 7, - 0, 23, 0, 53, 64, 15, 2, 8, 14, 25, 19, 8, 16, 23, 3, 8, 13, 20, 8, 23, 24, 16,220,236,212,236, 16,212,236,204,212,236, - 49, 0, 64, 12, 3,169, 13,188, 18, 22,189, 15, 0, 23,169, 20, 47,236, 50, 50,236, 50,244,236, 48, 37, 33, 17, 33, 21, 16, 7, - 6, 5, 54, 55, 54, 17, 53, 33, 17, 51, 17, 35, 17, 33, 17, 35, 17, 1,166, 2, 24,254,123,118, 20,254,237, 91, 40, 98, 2,245, -184,184,252,116,184,153, 3, 46,134,254,109,223, 17, 37, 40, 85,211, 1,163,212,252, 57,253,189, 1,170,254, 86, 2, 67, 0, 0, -255,255, 0,113,255,227, 4,127, 4,123, 18, 6, 0, 72, 0, 0, 0, 1, 0, 50, 0, 0, 5,173, 4, 96, 0, 21, 0,109, 64, 21, - 66, 2, 20, 16,188, 14, 8, 12,169, 0, 18, 6, 10, 14, 23, 8, 21, 8, 11, 20, 22, 16,212, 60,252, 60,196, 49, 0, 47, 60, 60, -212, 60,236, 50, 16,244, 60, 60, 48, 75, 83, 88, 64, 36, 4, 17, 7, 2, 1, 5, 17, 6, 7, 6, 4, 17, 1, 3, 17, 2, 2, 1, - 15, 17, 18, 13, 12, 16, 17, 17, 18, 17, 15, 17, 12, 14, 17, 13, 13, 12, 5, 7, 16,236, 16,236, 7, 16,236, 8, 16,236, 5, 7, - 16,236, 16,236, 7, 16,236, 8, 16,236, 89, 1, 51, 1, 51, 9, 1, 35, 1, 35, 17, 35, 17, 35, 1, 35, 9, 1, 51, 1, 51, 17, - 51, 3, 75,113, 1, 2,196,254,215, 1, 84,197,254,213,114,183,114,254,213,197, 1, 84,254,215,196, 1, 2,113,183, 2,161, 1, -191,253,245,253,171, 2, 9,253,247, 2, 9,253,247, 2, 85, 2, 11,254, 65, 1,191, 0, 0, 0, 0, 1, 0,133,255,227, 3,200, - 4,124, 0, 49, 0, 60, 64, 33, 38,134, 39,136, 34,185, 42,184, 50, 24,169, 25, 50, 11,134, 10,136, 15,185, 6,140, 50, 30, 18, - 46, 51, 19, 18, 3, 25, 39, 11, 50, 16,220,196,196,212,236,204,212,236, 49, 0, 16,244,236,252,236, 16,212,236, 16,244,236,252, -236, 48, 1, 30, 1, 21, 20, 4, 35, 34, 39, 38, 39, 53, 22, 23, 22, 51, 50, 55, 54, 53, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, - 53, 52, 39, 38, 35, 34, 7, 6, 7, 53, 62, 1, 51, 50, 23, 22, 21, 20, 7, 6, 2,194,124,138,254,254,238, 80, 85, 84, 90, 71, - 85, 85, 93,151, 85, 84, 78, 72,137,148,155,116, 67, 68, 70, 69,119, 71, 81, 80, 97, 98,170, 76,196,113,114, 60, 60, 2, 92, 24, -146,108,173,182, 14, 14, 28,171, 37, 19, 18, 56, 56, 90, 88, 56, 51,152, 44, 45, 70, 64, 46, 46, 13, 13, 29,167, 24, 24, 78, 79, -141, 93, 64, 65, 0, 1, 0,193, 0, 0, 4,128, 4, 96, 0, 9, 0, 63, 64, 21, 66, 8, 3, 9, 6,188, 2, 5, 11, 70, 9, 4, - 7, 3, 8, 0, 7, 8, 6, 70, 10, 16,252,236,212,236, 17, 57, 57,236, 49, 0, 47, 60,228, 50, 57, 57, 48, 75, 83, 88, 64, 10, - 3, 17, 9, 9, 8, 8, 17, 4, 4, 3, 7, 16,236, 7, 16,236, 89, 1, 17, 35, 17, 1, 35, 17, 51, 17, 1, 4,128,183,253,228, -236,183, 2, 27, 4, 96,251,160, 3,131,252,125, 4, 96,252,127, 3,129, 0, 0,255,255, 0,193, 0, 0, 4,128, 6, 20, 16, 39, - 2, 49, 0,160,255,204, 18, 6, 3, 85, 0, 0, 0, 1, 0,191, 0, 0, 4,161, 4, 96, 0, 10, 0, 70, 64, 17, 66, 3, 0,188, - 7, 10, 12, 5, 1, 4, 6, 8, 1, 8, 0, 70, 11, 16,252,236, 50,212,196, 17, 57,196, 49, 0, 47, 60,228, 50, 48, 75, 83, 88, - 64, 16, 7, 17, 6, 8, 17, 5, 6, 5, 2, 17, 5, 3, 17, 4, 5, 4, 5, 7, 16,236, 4, 16,236, 7, 16,236, 5, 16,236, 89, - 19, 51, 17, 1, 51, 9, 1, 35, 1, 17, 35,191,185, 2, 37,235,253,174, 2,107,240,253,199,185, 4, 96,254, 29, 1,227,253,244, -253,172, 2, 35,253,221, 0, 0, 0, 1, 0, 46,255,227, 4,115, 4, 96, 0, 15, 0, 38, 64, 20, 11,169, 6,188, 9, 1,169, 0, -140, 9, 17, 70, 10, 8, 7, 11, 8, 6, 1, 16, 16,212,212,236,212,236,236, 49, 0, 47,244,236, 16,244,236, 48, 23, 53, 54, 55, - 54, 17, 53, 33, 17, 35, 17, 33, 21, 16, 3, 6, 46,179, 59, 98, 2,245,184,254,123,118, 94, 29,153, 27,127,207, 1,167,212,251, -160, 3,199,134,254,146,254,252,207, 0, 0, 0, 0, 1, 0,193, 0, 0, 5, 72, 4, 96, 0, 12, 0, 77, 64, 22, 66, 10, 7, 2, - 3, 8, 3, 0,188, 9, 6, 12, 14, 70, 7, 8, 4, 10, 8, 0, 70, 13, 16,252,236,220,236,236, 49, 0, 47, 60,196,236, 50, 17, - 23, 57, 48, 75, 83, 88, 64, 18, 2, 17, 8, 10, 9, 3, 17, 7, 8, 7, 2, 17, 9, 1, 17, 10, 10, 9, 5, 7, 16,237, 16,237, - 7, 16,237, 8, 16,237, 89, 19, 33, 9, 1, 33, 17, 35, 17, 1, 35, 1, 17, 35,193, 1, 6, 1, 62, 1, 63, 1, 4,178,254,203, -184,254,202,178, 4, 96,253, 18, 2,238,251,160, 3,176,253, 39, 2,217,252, 80, 0, 1, 0,193, 0, 0, 4,136, 4, 96, 0, 11, - 0, 39, 64, 20, 9,169, 2, 4, 0,188, 7, 11, 13, 70, 8, 4, 8, 5, 9, 1, 8, 0, 70, 12, 16,252,236, 50,220,236, 50,236, - 49, 0, 47, 60,228, 50,220,236, 48, 19, 51, 17, 33, 17, 51, 17, 35, 17, 33, 17, 35,193,184, 2, 87,184,184,253,169,184, 4, 96, -254, 51, 1,205,251,160, 2, 4,253,252, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 18, 6, 0, 82, 0, 0, 0, 1, 0,193, - 0, 0, 4,136, 4, 96, 0, 7, 0, 40, 64, 16, 4,169, 7,188, 2, 6, 3, 8, 9, 70, 0, 4, 8, 7, 70, 8, 16,252,236,212, -236,236, 49, 0, 47, 60,244,236, 48, 64, 5,160, 9,128, 9, 2, 1, 93, 1, 17, 35, 17, 33, 17, 35, 17, 4,136,184,253,169,184, - 4, 96,251,160, 3,198,252, 58, 4, 96, 0, 0,255,255, 0,186,254, 86, 4,164, 4,123, 18, 6, 0, 83, 0, 0,255,255, 0,113, -255,227, 3,231, 4,123, 18, 6, 0, 70, 0, 0, 0, 1, 0, 5, 0, 0, 4, 54, 4, 96, 0, 7, 0, 37, 64, 13, 3, 7,169, 0, -188, 5, 9, 1, 3, 8, 0, 6, 8, 16,212,204,252,204,204, 49, 0, 47,244,236, 50, 48, 64, 5,160, 9,128, 9, 2, 1, 93, 19, - 33, 21, 33, 17, 35, 17, 33, 5, 4, 49,254, 66,181,254, 66, 4, 96,170,252, 74, 3,182, 0, 0,255,255, 0, 61,254, 86, 4,127, - 4, 96, 18, 6, 0, 92, 0, 0, 0, 3, 0,113,254, 86, 6,228, 5,213, 0, 15, 0, 52, 0, 67, 0, 64, 64, 35, 57, 12,185, 39, - 28,184, 33,151, 68, 64, 4,185, 47, 21,140, 16,189, 68, 69, 69, 53, 18, 43, 17, 8, 33, 8, 51, 61, 34, 0, 18, 25, 69, 68, 16, -252,236,212, 60, 60,252, 60, 60,212,236,236, 49, 0, 16,236,244, 60,236, 50, 16,228,244, 60,236, 50, 48, 1, 20, 23, 22, 51, 50, - 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 1, 17, 6, 7, 6, 35, 34, 39, 38, 17, 16, 18, 51, 50, 23, 22, 23, 17, 51, 17, 54, 55, - 54, 51, 50, 23, 22, 17, 16, 7, 6, 35, 34, 39, 38, 39, 17, 1, 52, 39, 38, 35, 34, 7, 6, 21, 20, 22, 51, 50, 55, 54, 1, 52, - 68, 67,133,133, 69, 68, 68, 69,133,133, 67, 68, 2, 26, 45, 77, 76,101,201,116,117,232,202,100, 77, 76, 46,185, 46, 77, 76,100, -203,115,116,116,116,202,102, 76, 77, 44, 2, 28, 67, 68,133,134, 69, 69,138,134,133, 68, 67, 2, 47,214,109,109,109,110,213,213, -110,109,109,109,251, 81, 2, 57, 83, 44, 45,155,156, 1, 17, 1, 22, 1, 58, 43, 44, 83, 2, 4,253,252, 83, 44, 43,157,157,254, -234,254,239,156,155, 43, 44, 83,253,201, 3,217,214,109,109,109,110,213,212,220,109,109, 0, 0,255,255, 0, 59, 0, 0, 4,121, - 4, 96, 18, 6, 0, 91, 0, 0, 0, 1, 0,193,254, 86, 5, 64, 4, 96, 0, 11, 0, 40, 64, 21, 6, 2,188, 11,189, 8, 4,169, - 1, 13, 0, 8, 9, 6, 8, 7, 3, 8, 2, 70, 12, 16,252,236,212,236,212,236,204, 49, 0, 47,236, 50,236,244, 60, 48, 41, 1, - 17, 51, 17, 33, 17, 51, 17, 51, 17, 35, 4,136,252, 57,184, 2, 87,184,184,184, 4, 96,252, 57, 3,199,252, 57,253,189, 0, 0, - 0, 1, 0,150, 0, 0, 4, 0, 4, 96, 0, 17, 0, 34, 64, 17, 2,169, 13, 15, 7,188, 0, 19, 70, 1, 15, 8, 16, 8, 8, 7, - 18, 16,220,236,212,236, 50,236, 49, 0, 47,228, 50,212,236, 48, 33, 17, 33, 34, 39, 38, 61, 1, 51, 21, 20, 23, 22, 51, 33, 17, - 51, 17, 3, 72,254,169,153,102, 92,184, 52, 53,104, 1, 41,184, 2, 9, 95, 86,184,234,211,117, 59, 59, 1,190,251,160, 0, 0, - 0, 1, 0,193, 0, 0, 6, 58, 4, 96, 0, 11, 0, 40, 64, 21, 10, 2, 6,188, 0, 8,169, 5, 13, 70, 2, 8, 3, 10, 8, 11, - 7, 8, 6, 70, 12, 16,252,236,212,252,212,236,236, 49, 0, 47,236, 50,244, 60,196, 48, 37, 33, 17, 51, 17, 33, 17, 51, 17, 33, - 17, 51, 3,217, 1,169,184,250,135,184, 1,168,184,153, 3,199,251,160, 4, 96,252, 57, 3,140, 0, 1, 0,193,254, 86, 6,242, - 4, 96, 0, 15, 0, 49, 64, 26, 6, 10, 2,188, 15,189, 12, 8, 4,169, 1, 17, 0, 8, 13, 10, 8, 11, 6, 8, 7, 3, 8, 2, - 70, 16, 16,252,236,212,252,212,236,212,236,204, 49, 0, 47,236, 50, 50,236,244, 60,196, 48, 41, 1, 17, 51, 17, 33, 17, 51, 17, - 33, 17, 51, 17, 51, 17, 35, 6, 58,250,135,184, 1,168,184, 1,169,184,184,184, 4, 96,252, 57, 3,140,252,116, 3,199,252, 57, -253,189, 0, 0, 0, 2, 0, 42, 0, 0, 5, 46, 4, 96, 0, 10, 0, 25, 0, 42, 64, 22, 12,169, 13,188, 25, 5,169, 15, 6,169, - 25, 27, 69, 0, 18, 20, 5, 14, 8, 11, 13, 26, 16,204,220,236, 50,212,236,236, 49, 0, 47,236,212,236, 16,244,236, 48, 1, 52, - 39, 38, 35, 33, 17, 33, 50, 55, 54, 1, 33, 53, 33, 17, 33, 50, 23, 22, 21, 20, 7, 6, 35, 33, 4,106, 62, 67,128,254,249, 1, - 7,129, 66, 62,253, 64,254,128, 2, 56, 1, 15,208,121,116,116,115,214,254, 57, 1, 76, 94, 42, 46,254,151, 46, 43, 2,212,154, -254, 59, 85, 82,168,168, 82, 82,255,255, 0,193, 0, 0, 5,105, 4, 96, 16, 38, 3,105, 0, 0, 17, 7, 0,243, 3,240, 0, 0, - 0, 13, 64, 6, 29, 70, 25, 8, 24, 18, 16,220,252,236, 49, 0, 0, 2, 0,193, 0, 0, 4, 69, 4, 96, 0, 10, 0, 23, 0, 36, - 64, 19, 5,169, 13, 11,188, 6,169, 23, 25, 69, 0, 18, 18, 5, 12, 8, 11, 70, 24, 16,252,236, 50,212,236,236, 49, 0, 47,236, -228,212,236, 48, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1, 51, 17, 33, 50, 23, 22, 21, 20, 7, 6, 35, 33, 3,129, 62, 67, -128,254,249, 1, 7,129, 66, 62,253, 64,184, 1, 15,208,121,116,116,115,214,254, 57, 1, 76, 94, 42, 46,254,151, 46, 43, 3,110, -254, 59, 85, 82,168,168, 82, 82, 0, 1, 0,113,255,227, 3,231, 4,123, 0, 28, 0, 0, 1, 34, 7, 21, 54, 51, 50, 23, 22, 23, - 33, 21, 33, 6, 7, 6, 35, 34, 39, 21, 22, 51, 32, 55, 54, 17, 16, 39, 38, 1,180,166,157,161,154,230, 92, 34, 12,254, 52, 1, -212, 13,158, 85,120,157,158,147,189, 1, 11,148,135,151,148, 4,123, 70,172, 86,180, 65, 87,143,244, 94, 51, 86,170, 72,172,157, - 1, 3, 1, 17,157,158, 0, 0, 0, 2, 0,193,255,227, 6, 16, 4,123, 0, 14, 0, 36, 0, 56, 64, 31, 0,185, 19,184, 37, 8, -185, 26,140, 37, 31,169, 36, 34,188, 33, 38, 69, 11, 18, 22, 4, 18, 30, 15, 31, 35, 8, 34, 70, 37, 16,252,236, 50,212, 60,236, -212,236,236, 49, 0, 47,228,212,236, 16,244,236, 16,244,236, 48, 1, 34, 7, 6, 21, 20, 23, 22, 51, 50, 54, 53, 52, 39, 38, 1, - 54, 55, 54, 51, 50, 0, 17, 16, 7, 6, 35, 34, 39, 38, 39, 35, 17, 35, 17, 51, 17, 4, 14,148, 86, 86, 85, 86,149,147,172, 86, - 86,253,113, 19,112,137,240,240, 1, 18,137,137,240,241,136,127, 9,148,184,184, 3,223,115,116,201,201,116,115,232,200,199,116, -117,254,194,190,128,156,254,200,254,236,254,237,156,157,157,145,248,253,247, 4, 96,254, 65, 0, 0, 2, 0, 50, 0, 0, 4, 15, - 4, 96, 0, 22, 0, 33, 0, 68, 64, 21, 66, 24,169, 7,188, 18, 12,169, 32, 10, 18, 35, 70, 11, 23, 8, 8, 28, 18, 3, 34, 16, -212,236,212,236, 50,236, 49, 0, 47, 60,212,236, 16,244,236, 48, 75, 83, 88, 64, 13, 15, 14, 13, 3, 12, 16, 17, 19, 17, 17, 18, - 19, 18, 5, 7, 16,236, 16,236, 17, 23, 57, 89, 1, 46, 1, 53, 52, 55, 54, 51, 33, 17, 35, 17, 35, 34, 7, 6, 7, 3, 35, 19, - 54, 55, 54, 1, 35, 34, 7, 6, 21, 20, 23, 22, 59, 1, 1,181,106,112,107,108,217, 1,132,185,169, 97, 59, 59, 63,162,195,174, - 53, 52, 53, 1,216,198,119, 63, 64, 64, 63,119,198, 2, 13, 27,140,105,162, 81, 80,251,160, 1,217, 37, 36,113,254,225, 1, 50, - 94, 54, 54, 1,201, 42, 42, 84, 83, 43, 43, 0,255,255, 0,113,255,227, 4,127, 6,107, 16, 38, 0, 67, 90, 5, 18, 6, 3, 82, - 0, 0, 0, 0,255,255, 0,113,255,227, 4,127, 6, 16, 16, 39, 0,106, 0,150, 0, 0, 18, 6, 3, 82, 0, 0, 0, 1, 0, 40, -254, 86, 4,107, 6, 20, 0, 40, 0, 0, 19, 35, 53, 51, 53, 51, 21, 33, 21, 33, 17, 54, 55, 54, 51, 50, 23, 22, 21, 17, 20, 7, - 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 38, 35, 34, 7, 6, 21, 17, 35,193,153,153,185, 1, 70,254,186, 66, 89, 90,117,185, -107, 99, 82, 81,181, 70, 49,110, 33, 38,124,124,154, 81, 86,185, 5, 4,125,147,147,125,254, 87,101, 50, 50,119,110,242,253,159, -214, 96, 96,156, 48, 55,147, 2, 91,159,158, 95,101,158,253,222,255,255, 0,186, 0, 0, 3,216, 6,109, 16, 39, 0,118, 0,134, - 0, 7, 18, 6, 3, 80, 0, 0, 0, 1, 0,113,255,227, 3,231, 4,123, 0, 28, 0, 58, 64, 33, 2,134, 3,136, 5, 19,134, 18, -136, 16,185, 21, 10,169, 11,187, 5,185, 0,184, 21,140, 29, 10, 12, 9, 18, 18, 2, 72, 25, 69, 29, 16,252,228, 50,252, 50,204, - 49, 0, 16,228,244,236,244,238, 16,254,244,238, 16,245,238, 48, 1, 50, 23, 21, 38, 35, 34, 7, 6, 7, 33, 21, 33, 22, 23, 22, - 51, 50, 55, 21, 6, 35, 32, 39, 38, 17, 16, 55, 54, 2,164,166,157,161,154,230, 92, 34, 12, 1,204,254, 44, 13,158, 85,120,157, -158,147,188,254,243,148,134,151,149, 4,123, 70,172, 86,180, 65, 87,143,244, 94, 51, 86,170, 72,173,157, 1, 2, 1, 17,157,158, -255,255, 0,111,255,227, 3,199, 4,123, 18, 6, 0, 86, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 18, 6, 0, 76, 0, 0, -255,255,255,244, 0, 0, 2, 70, 6, 16, 18, 38, 0,243, 0, 0, 17, 7, 0,106,255, 29, 0, 0, 0, 8,180, 0, 10, 7, 1, 7, - 43, 49, 0, 0,255,255,255,219,254, 86, 1,121, 6, 20, 18, 6, 0, 77, 0, 0, 0, 2, 0, 46,255,227, 6,190, 4, 96, 0, 23, - 0, 34, 0, 0, 1, 33, 21, 16, 3, 6, 5, 53, 54, 55, 54, 17, 53, 33, 17, 51, 50, 23, 22, 16, 7, 6, 35, 33, 1, 52, 39, 38, - 43, 1, 17, 51, 50, 55, 54, 3,158,254,152,118, 94,254,204,179, 59, 98, 2,216,171,208,121,116,116,115,214,254,157, 2, 92, 62, - 67,128,163,163,129, 66, 62, 3,199,134,254,146,254,252,207, 29,153, 27,127,207, 1,167,212,254, 59, 85, 82,254,176, 82, 82, 1, - 76, 94, 42, 46,254,151, 46, 43, 0, 2, 0,193, 0, 0, 6,188, 4, 96, 0, 10, 0, 30, 0, 0, 1, 52, 39, 38, 43, 1, 17, 51, - 50, 55, 54, 5, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, 51, 50, 23, 22, 16, 7, 6, 35, 5,248, 62, 66,129,163,163,129, 66, - 62,253,164,253,221,184,184, 2, 35,184,171,208,121,116,116,115,214, 1, 76, 95, 42, 45,254,151, 46, 43,242, 2, 2,253,254, 4, - 96,254, 59, 1,197,254, 59, 85, 82,254,176, 82, 82, 0, 0, 0, 0, 1, 0, 40, 0, 0, 4,107, 6, 20, 0, 30, 0, 0, 19, 35, - 53, 51, 53, 51, 21, 33, 21, 33, 17, 54, 55, 54, 51, 50, 23, 22, 21, 17, 35, 17, 52, 38, 35, 34, 7, 6, 21, 17, 35,193,153,153, -185, 1, 70,254,186, 66, 89, 90,117,189,103, 99,184,124,124,152, 83, 86,185, 5, 4,125,147,147,125,254, 87,101, 50, 50,119,115, -237,253,179, 2, 71,159,158, 95, 98,161,253,222,255,255, 0,191, 0, 0, 4,161, 6,109, 16, 39, 0,118, 0,228, 0, 7, 18, 6, - 3, 87, 0, 0,255,255, 0,193, 0, 0, 4,128, 6,107, 16, 38, 0, 67,100, 5, 18, 6, 3, 85, 0, 0, 0, 0,255,255, 0, 61, -254, 86, 4,127, 6, 20, 16, 38, 2, 49, 94,204, 18, 6, 3, 96, 0, 0, 0, 0, 0, 1, 0,193,254, 86, 4,136, 4, 96, 0, 11, - 0, 0, 33, 17, 35, 17, 33, 17, 51, 17, 33, 17, 51, 17, 2,255,184,254,122,184, 2, 87,184,254, 86, 1,170, 4, 96,252, 58, 3, -198,251,160, 0, 0, 1, 0,115,255,227, 7, 5, 5,213, 0, 52, 0, 0, 1, 22, 51, 50, 55, 54, 61, 1, 51, 21, 20, 23, 22, 51, - 50, 55, 54, 17, 52, 39, 2, 39, 51, 22, 23, 18, 21, 16, 7, 6, 35, 34, 39, 38, 39, 6, 7, 6, 35, 34, 39, 38, 17, 52, 19, 54, - 55, 51, 6, 3, 6, 21, 16, 1,146, 73,125,114, 72, 71,199, 70, 70,116,134, 65, 71, 67,135, 84,250, 95, 56,100,123,123,209,146, -101,100, 39, 39,100,101,146,211,121,123,100, 59, 93,249, 84,135, 67, 1, 90,109,105,104,198,241,241,198,104,105,109,119, 1, 39, -183,159, 1, 65, 70,130,156,254,231,190,254,102,178,177, 94, 94,173,173, 94, 94,177,180, 1,152,201, 1, 14,159,127, 70,254,191, -159,183,254,205,255,255, 0,135,255,226, 6, 40, 4, 96, 16, 2, 2,231, 0, 0,255,255, 0, 33, 0, 0, 4,236, 5,213, 16, 2, - 3,168, 0, 0, 0, 2, 0, 58, 0, 0, 4, 69, 5,213, 0, 19, 0, 30, 0, 0, 1, 17, 33, 50, 23, 22, 16, 7, 6, 35, 33, 17, - 35, 53, 51, 17, 51, 17, 51, 21, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1,121, 1, 15,208,121,116,116,115,214,254, 57,135, -135,184,175, 1, 89, 62, 67,128,254,249, 1, 7,129, 66, 62, 3,209,254,202, 85, 82,254,176, 82, 82, 3,209,143, 1,117,254,139, -143,253,123, 94, 42, 46,254,151, 46, 43, 0, 0, 0, 1, 0,211,255,227, 7, 27, 5,240, 0, 43, 0, 0, 1, 17, 35, 17, 51, 17, - 51, 18, 55, 54, 33, 50, 23, 22, 23, 21, 38, 39, 38, 35, 32, 7, 6, 7, 33, 21, 33, 18, 23, 22, 33, 50, 55, 54, 55, 21, 6, 7, - 6, 35, 32, 39, 38, 3, 1,157,202,202,210, 30,157,195, 1, 83,134,118,119,104,102,115,116,130,255, 0,136,103, 25, 2,178,253, - 70, 7,129,137, 0,255,130,116,115,102,106,119,118,132,254,173,195,186, 9, 2,199,253, 57, 5,213,253,156, 1, 8,167,208, 36, - 35, 71,213, 95, 47, 47,156,119,198,170,254,243,148,157, 47, 47, 95,211, 72, 36, 36,207,198, 1, 79, 0, 0, 0, 0, 1, 0,193, -255,227, 5,129, 4,123, 0, 35, 0, 0, 1, 50, 23, 21, 38, 35, 34, 7, 6, 7, 33, 21, 33, 22, 23, 22, 51, 50, 55, 21, 6, 35, - 32, 39, 38, 39, 35, 17, 35, 17, 51, 17, 51, 54, 55, 54, 4, 62,166,157,161,154,230, 92, 34, 12, 1,204,254, 44, 13,158, 85,120, -157,158,147,188,254,243,148,123, 10,147,184,184,152, 23,122,151, 4,123, 70,172, 86,180, 65, 87,143,244, 94, 51, 86,170, 72,173, -144,228,253,252, 4, 96,254, 51,202,128,158, 0, 0, 2, 0, 16, 0, 0, 6,248, 5,213, 0, 3, 0, 15, 0, 0, 1, 11, 1, 31, - 1, 17, 35, 17, 39, 1, 35, 1, 51, 1, 35, 1, 4,106,230,231,231,102,202,222,254,175,225, 3, 2,229, 3, 1,225,254,175, 3, - 63, 1,192,254, 64,119,172,253,228, 2, 27,114,253,115, 5,213,250, 43, 2,142, 0, 2, 0, 51, 0, 0, 6, 17, 4, 96, 0, 3, - 0, 15, 0, 0, 1, 11, 1, 31, 1, 17, 35, 17, 39, 1, 35, 1, 51, 1, 35, 1, 3,226,192,192,192, 93,184,179,254,226,195, 2, -142,195, 2,141,195,254,226, 2,112, 1, 74,254,182, 87,131,254,106, 1,149, 81,254, 26, 4, 96,251,160, 1,231, 0, 2, 0,201, - 0, 0, 9, 20, 5,213, 0, 3, 0, 23, 0, 0, 1, 11, 1, 23, 5, 33, 17, 35, 17, 51, 17, 33, 1, 51, 1, 35, 1, 7, 17, 35, - 17, 39, 1, 35, 6,134,230,231,231,253,251,253,248,202,202, 2, 95, 1, 60,229, 3, 1,225,254,175,220,202,222,254,175,225, 3, - 63, 1,192,254, 64,119, 1,253, 57, 5,213,253,156, 2,100,250, 43, 2,142,114,253,228, 2, 27,114,253,115, 0, 0, 2, 0,193, - 0, 0, 7,208, 4, 96, 0, 3, 0, 23, 0, 0, 1, 11, 1, 23, 5, 33, 17, 35, 17, 51, 17, 33, 1, 51, 1, 35, 1, 7, 17, 35, - 17, 39, 1, 35, 5,161,192,192,192,254, 45,254,107,184,184, 1,233, 1, 30,195, 2,141,195,254,226,177,184,179,254,226,195, 2, -112, 1, 74,254,182, 87, 50,254, 25, 4, 96,254, 23, 1,233,251,160, 1,231, 81,254,106, 1,149, 81,254, 26, 0, 0, 2, 0,115, - 0, 0, 5,217, 5,213, 0, 23, 0, 26, 0, 0, 1, 17, 35, 17, 6, 7, 6, 17, 35, 16, 55, 54, 55, 1, 33, 1, 22, 23, 22, 17, - 35, 16, 39, 38, 39, 1, 33, 3,139,202,147,100,130,213,189,120,170,254, 81, 5, 18,254, 80,164,116,188,213,128, 96,248, 1, 62, -253,131, 2, 89,253,167, 2, 89, 28,126,164,254,229, 1, 98,210,134, 49, 2,234,253, 19, 50,130,210,254,158, 1, 30,161,122,202, - 2, 40, 0, 0, 0, 2, 0,107, 0, 0, 4,123, 4, 96, 0, 2, 0, 26, 0, 0, 1, 33, 19, 9, 1, 22, 23, 22, 17, 35, 52, 39, - 38, 39, 17, 35, 17, 6, 7, 6, 21, 35, 16, 55, 54, 55, 1, 3, 69,254, 93,209, 2, 8,254,187,107, 75,137,195, 86, 58, 86,184, - 83, 56, 86,194,137, 74,108,254,187, 3,182,254,150, 2, 20,253,204, 38, 86,156,254,236,199,116, 79, 26,254, 92, 1,162, 26, 75, -116,201, 1, 20,156, 85, 39, 2, 52, 0, 0, 0, 0, 2, 0,201, 0, 0, 7,196, 5,213, 0, 30, 0, 33, 0, 0, 9, 1, 33, 1, - 22, 23, 22, 17, 35, 16, 39, 38, 39, 17, 35, 17, 6, 7, 6, 17, 35, 16, 55, 54, 55, 33, 17, 35, 17, 51, 17, 5, 1, 33, 3,239, -254,159, 5, 18,254, 80,164,116,188,213,128, 96,153,202,147,100,130,213,189, 85,110,253,181,202,202, 3,132, 1, 62,253,131, 3, -113, 2,100,253, 19, 50,130,210,254,158, 1, 30,161,122, 32,253,167, 2, 89, 28,126,164,254,229, 1, 98,210, 95, 52,253, 57, 5, -213,253,156,110, 2, 40, 0, 0, 0, 2, 0,193, 0, 0, 6, 46, 4, 96, 0, 30, 0, 33, 0, 0, 9, 1, 33, 1, 22, 23, 22, 17, - 35, 52, 39, 38, 39, 17, 35, 17, 6, 7, 6, 21, 35, 16, 55, 54, 55, 33, 17, 35, 17, 51, 17, 1, 33, 19, 3, 55,254,231, 4, 16, -254,187,107, 75,137,195, 86, 58, 86,184, 83, 56, 86,194,137, 27, 31,254,146,184,184, 3,127,254, 93,209, 2,119, 1,233,253,204, - 38, 86,156,254,236,199,116, 79, 26,254, 92, 1,162, 26, 75,116,201, 1, 20,156, 31, 24,254, 25, 4, 96,254, 23, 1, 63,254,150, - 0, 1, 0,115,254, 86, 4,115, 5,240, 0, 75, 0, 0, 5, 50, 23, 22, 23, 21, 38, 39, 38, 35, 32, 39, 38, 53, 52, 55, 54, 51, - 50, 23, 22, 51, 50, 55, 54, 53, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 6, 7, 53, 54, 55, 54, 51, 50, - 23, 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 2,187, 60, 91, 96, 86, - 71,103,134, 25,254,205,114,163, 63, 71, 99, 46,132, 73,100, 91, 85, 63, 92, 91,167,174,182,149, 79, 79, 81, 82,152, 83,190,114, -115,100,101, 89,230,134,134, 71, 71,131,147, 80, 81,115,152,198, 86, 76, 85, 42, 40, 32, 24,117, 94,209, 6, 6, 38,167, 41, 8, - 10, 67, 96,147,144, 72, 81, 45, 25, 90, 65,121,122, 74, 73,166, 59, 60,112,115, 61, 62, 36, 38,180, 32, 16, 16,104,105,178,124, - 85, 86, 33, 31, 96, 98,134,208,102,136, 36, 42, 36, 27, 67, 87, 39, 32, 0, 0, 0, 2, 0, 91,254,116, 3,200, 6,102, 0, 73, - 0, 80, 0, 0, 37, 50, 55, 54, 53, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7, 53, 62, 1, 51, - 50, 23, 22, 21, 20, 7, 6, 7, 30, 1, 21, 20, 6, 39, 38, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 51, 50, 23, 22, 23, 21, 38, - 39, 38, 35, 32, 39, 38, 53, 52, 55, 54, 51, 50, 23, 22, 11, 1, 51, 23, 55, 51, 3, 2, 75, 87, 59, 54, 78, 72,137,148,155,116, - 67, 68, 70, 69,119, 71, 81, 80, 97, 98,170, 76,196,113,114, 60, 60,112,124,138,238,168, 78, 59, 75, 32, 36, 25, 19, 98,106,140, - 82, 46, 93, 59, 59, 88,132, 1,254,254, 96,137, 52, 58, 86, 51,103, 62, 62,245,139,180,180,139,245,153, 49, 45, 91, 76, 56, 51, -152, 44, 45, 70, 64, 46, 46, 13, 13, 29,167, 24, 24, 78, 79,141, 93, 64, 65, 24, 24,146, 96,161,182, 5, 2, 28, 35, 30, 23, 76, - 99, 25, 27, 5, 11, 26,139, 34, 6, 9, 56, 81,152,141, 59, 68, 36, 21, 4, 85, 1,120,245,245,254,136, 0, 0,255,255, 0,115, - 0, 0, 5,219, 5,213, 18, 2, 2,198, 0, 0,255,255, 0,112,254, 86, 4,209, 4, 96, 18, 2, 2,230, 0, 0, 0, 3, 0,115, -255,227, 5,217, 5,240, 0, 9, 0, 20, 0, 35, 0, 0, 1, 5, 39, 5, 18, 23, 22, 32, 55, 54, 17, 38, 39, 38, 35, 34, 7, 6, - 7, 37, 23, 3, 32, 23, 22, 17, 16, 7, 6, 33, 32, 39, 38, 16, 55, 54, 5, 4,254,104,230,254,194, 8,122,129, 1,184,129,120, - 25, 95,129,220,218,131, 98, 24, 1,144,230,159, 1, 58,188,188,188,188,254,198,254,197,188,189,189,188, 2,199,110,200, 90,254, -255,155,164,164,152, 1,174,189,122,164,164,123,188,110,200, 2,217,210,211,254,158,254,159,210,211,210,210, 2,196,211,210, 0, - 0, 3, 0,113,255,227, 4,117, 4,123, 0, 10, 0, 21, 0, 36, 0, 0, 1, 37, 23, 55, 38, 39, 38, 35, 34, 7, 6, 3, 22, 23, - 22, 51, 50, 55, 54, 55, 5, 39, 19, 50, 0, 17, 16, 7, 6, 35, 34, 39, 38, 17, 16, 55, 54, 1, 57, 1, 7,150,213, 17, 62, 86, -147,149, 85, 63, 22, 8, 76, 86,149,147, 86, 76, 9,254,243,150,101,240, 1, 18,137,137,240,241,136,137,137,136, 2,148, 70,120, - 50,129, 85,117,115, 85,254,237,173,101,115,116,103,170, 70,130, 2, 59,254,200,254,236,254,237,156,157,157,156, 1, 19, 1, 20, -156,156, 0, 0, 0, 1, 0, 16, 0, 0, 6, 39, 5,240, 0, 20, 0, 0, 33, 35, 1, 51, 9, 1, 18, 55, 54, 51, 50, 22, 23, 21, - 39, 38, 35, 34, 7, 6, 7, 3, 47,229,253,198,211, 1,217, 1, 56,115, 96, 78,148, 31, 62, 33, 68, 22, 25, 73, 34, 71, 84, 5, -213,251, 23, 3, 61, 1, 50, 82, 67, 10, 11,187, 10, 4, 34, 67,221, 0, 0, 0, 0, 1, 0, 50, 0, 0, 5, 31, 4,123, 0, 21, - 1, 56, 64, 5, 23, 8, 4, 19, 22, 16, 75,176, 10, 84, 88,185, 0, 19, 0, 64, 56, 89, 75,176, 20, 84, 75,176, 21, 84, 91, 88, -185, 0, 19,255,192, 56, 89,212,212,196,196,180, 21, 17, 18, 4, 19, 17, 18, 57, 57, 57, 49, 64, 10, 9,134, 8, 12,185, 4,184, - 19,188, 18, 0, 47,228,244,228,212,236, 48,182, 21, 17, 20, 17, 19, 19, 18, 7, 5, 16,236, 4,236,183, 3, 2, 1, 0, 17, 16, - 16, 17, 7, 5, 16,236, 50, 50, 50, 64, 26, 12, 15, 15, 9, 15, 8, 11, 16, 10, 3, 10, 2, 12, 1, 10, 0, 8, 21, 9, 17, 8, - 18, 8, 20, 7, 19, 64, 16, 25, 16, 25, 0, 31, 22, 26, 17, 29, 18, 28, 21, 29, 20, 29, 19, 64, 12, 43, 1, 41, 16, 41, 0, 40, - 21, 38, 20, 38, 19, 64, 18, 51, 15, 52, 1, 50, 16, 51, 0, 54, 21, 54, 20, 54, 19, 55, 17, 52, 18, 64, 24, 74, 2, 74, 16, 74, - 0, 77, 1, 72, 21, 70, 19, 70, 20, 70, 17, 74, 18, 79, 9, 79, 8, 79, 23, 64, 28, 90, 2, 92, 1, 91, 16, 91, 0, 95, 22, 93, - 21, 94, 20, 95, 19, 94, 18, 90, 17, 90, 15, 95, 23, 95, 9, 95, 8, 64, 26,107, 15,107, 2,105, 1,111, 1,106, 16,106, 0,105, - 21,102, 20,102, 19,105, 18,111, 9,111, 8,111, 23, 64, 18,124, 2,127, 1,122, 16,122, 21,122, 0,119, 17,124, 18,117, 20,118, - 19,176, 84, 1, 93, 64, 17, 6, 21, 25, 21, 39, 21, 54, 21, 74, 21, 91, 21,106, 21,127, 21, 8, 0, 93, 1, 54, 55, 54, 51, 50, - 23, 22, 23, 21, 39, 38, 35, 34, 7, 6, 7, 1, 35, 1, 51, 1, 3, 59, 80,102, 66,129, 26, 26, 27, 28, 58, 19, 21, 54, 29, 65, - 61,254,228,250,254, 92,195, 1, 94, 3, 36,213, 79, 51, 4, 4, 8,141, 7, 3, 25, 55,162,253, 10, 4, 96,252, 84, 0, 0, 0, - 0, 3, 0, 16, 0, 0, 6, 39, 7,108, 0, 3, 0, 7, 0, 28, 0, 0, 1, 19, 35, 3, 37, 19, 35, 3, 19, 35, 1, 51, 9, 1, - 18, 55, 54, 51, 50, 22, 23, 21, 39, 38, 35, 34, 7, 6, 7, 1,253,144,135,174, 1,238,134,137,157,137,229,253,198,211, 1,217, - 1, 56,115, 96, 78,148, 31, 62, 33, 68, 22, 25, 73, 34, 71, 84, 7,107,254,248, 1, 8, 1,254,247, 1, 9,248,148, 5,213,251, - 23, 3, 61, 1, 50, 82, 67, 10, 11,187, 10, 4, 34, 67,221, 0,255,255, 0, 50, 0, 0, 5, 31, 6,102, 16, 35, 2, 87, 4,194, - 0, 0, 18, 2, 3,146, 0, 0,255,255, 0,113,255,227, 5, 37, 5,240, 16, 2, 1,228, 0, 0,255,255, 0,113,255,227, 4,113, - 5, 47, 16, 2, 1,229, 0, 0, 0, 2, 0,115,255,227, 7, 45, 5,240, 0, 41, 0, 82, 0, 0, 37, 51, 50, 55, 54, 53, 52, 39, - 38, 43, 1, 6, 7, 6, 7, 6, 34, 39, 38, 39, 38, 39, 35, 34, 7, 6, 21, 20, 23, 22, 59, 1, 54, 55, 54, 55, 54, 50, 23, 22, - 23, 22, 7, 35, 32, 39, 38, 16, 55, 54, 33, 51, 54, 55, 54, 55, 54, 50, 23, 22, 23, 22, 23, 51, 32, 23, 22, 17, 16, 7, 6, 33, - 35, 6, 7, 6, 7, 6, 34, 39, 38, 39, 38, 4, 93, 30,235,114,128,128,114,235, 30, 11, 15, 22, 27, 26, 62, 26, 27, 22, 16, 10, - 46,235,114,130,130,114,235, 46, 10, 16, 22, 27, 26, 62, 26, 27, 22, 16,254, 46,254,161,152,189,189,152, 1, 95, 45, 11, 16, 22, - 27, 26, 62, 26, 31, 18, 16, 11, 29, 1, 94,152,188,188,152,254,162, 29, 10, 17, 22, 27, 26, 62, 26, 31, 18, 16,194,145,164,242, -243,164,145, 20, 14, 21, 12, 11, 11, 12, 21, 16, 18,145,164,243,242,164,145, 18, 16, 21, 12, 11, 11, 12, 21, 16,161,170,210, 2, -116,211,170, 21, 15, 21, 12, 11, 11, 14, 19, 17, 19,170,211,254,198,254,199,210,171, 19, 17, 21, 12, 11, 11, 14, 19, 17, 0, 0, - 0, 2, 0,113,255,227, 5,161, 4,123, 0, 38, 0, 80, 0, 0, 37, 51, 50, 55, 54, 53, 52, 39, 38, 43, 1, 6, 7, 14, 1, 34, - 38, 39, 38, 39, 35, 34, 7, 6, 21, 20, 23, 22, 59, 1, 54, 55, 62, 1, 50, 23, 22, 23, 22, 7, 35, 32, 39, 38, 53, 52, 55, 54, - 33, 51, 54, 55, 54, 55, 54, 50, 23, 22, 23, 22, 23, 51, 32, 23, 22, 21, 20, 7, 6, 33, 35, 6, 7, 6, 7, 6, 34, 39, 38, 39, - 38, 3,114, 45,161, 72, 86, 86, 63,170, 45, 7, 10, 18, 44, 52, 44, 18, 10, 7, 45,163, 71, 86, 85, 72,163, 45, 7, 10, 18, 44, - 52, 22, 27, 13, 9,201, 46,254,255,120,137,137,116, 1, 5, 46, 7, 9, 13, 27, 22, 52, 22, 27, 13, 9, 7, 46, 1, 2,119,137, -137,116,254,251, 46, 7, 9, 13, 27, 22, 52, 22, 27, 13, 9,164, 96,116,183,167,131, 97, 11, 10, 17, 20, 20, 17, 10, 11, 95,116, -184,188,112, 95, 11, 10, 17, 20, 10, 12, 15, 10,147,137,156,238,233,162,136, 10, 10, 15, 12, 10, 10, 12, 15, 10, 10,136,156,239, -232,162,137, 10, 10, 15, 12, 10, 10, 12, 15, 10,255,255, 0,115,255,227, 7, 5, 7,183, 16, 35, 3,160, 6, 44, 1, 61, 16, 2, - 3,125, 0, 0,255,255, 0,135,255,226, 6, 40, 6,100, 16, 35, 3,160, 5,196,255,234, 16, 2, 3,126, 0, 0, 0, 2, 0,115, -255,227, 7, 5, 7, 51, 0, 11, 0, 64, 0, 0, 1, 7, 35, 39, 35, 7, 35, 39, 35, 7, 35, 39, 3, 22, 51, 50, 55, 54, 61, 1, - 51, 21, 20, 23, 22, 51, 50, 55, 54, 17, 52, 39, 2, 39, 51, 22, 23, 18, 21, 16, 7, 6, 35, 34, 39, 38, 39, 6, 7, 6, 35, 34, - 39, 38, 17, 52, 19, 54, 55, 51, 6, 3, 6, 21, 16, 5,126,100, 50, 50,175, 50, 50, 50,175, 50, 50,100,104, 73,125,114, 72, 71, -199, 70, 70,116,134, 65, 71, 67,135, 84,250, 95, 56,100,123,123,209,146,101,100, 39, 39,100,101,146,211,121,123,100, 59, 93,249, - 84,135, 67, 7, 51,200,100,100,100,100,200,250, 39,109,105,104,198,241,241,198,104,105,109,119, 1, 39,183,159, 1, 65, 70,130, -156,254,231,190,254,102,178,177, 94, 94,173,173, 94, 94,177,180, 1,152,201, 1, 14,159,127, 70,254,191,159,183,254,205, 0, 0, - 0, 2, 0,135,255,226, 6, 40, 5,224, 0, 11, 0, 38, 0, 0, 1, 7, 35, 39, 35, 7, 35, 39, 35, 7, 35, 39, 19, 32, 17, 52, - 19, 51, 2, 21, 2, 51, 50, 3, 51, 2, 55, 54, 17, 52, 3, 51, 18, 21, 18, 37, 36, 3, 2, 5, 27,100, 50, 50,175, 50, 50, 50, -175, 50, 50,100,143,254, 97,155,198,143, 1,223,207, 4,170, 4,207,222,143,198,155, 2,254, 95,254,241, 34, 41, 5,224,200,100, -100,100,100,200,250, 3, 2, 82,235, 1, 64,254,192,240,254, 79, 2, 26,253,227, 3, 2, 1,175,240, 1, 64,254,192,235,253,173, - 1, 1, 1, 42,254,213, 0, 0, 0, 1, 0,115,254, 86, 5, 39, 5,240, 0, 25, 0, 0, 33, 35, 32, 39, 38, 17, 16, 0, 33, 50, - 22, 23, 21, 46, 1, 35, 32, 0, 17, 16, 23, 22, 51, 33, 17, 35, 3,250,174,254,165,187,195, 1,134, 1, 83,134,237,104,102,231, -130,255, 0,254,240,136,152,240, 1,107,201,198,208, 1, 83, 1,104, 1,159, 71, 71,213, 95, 94,254,199,254,216,254,211,130,148, -253,176, 0, 0, 0, 1, 0,113,254, 86, 3,231, 4,123, 0, 24, 0, 0, 33, 32, 39, 38, 53, 16, 0, 33, 50, 22, 23, 21, 46, 1, - 35, 34, 6, 21, 20, 22, 59, 1, 17, 35, 17, 2,152,254,251,141,149, 1, 45, 1, 6, 85,162, 76, 78,157, 80,179,198,198,179,245, -201,150,159,250, 1, 18, 1, 58, 35, 35,172, 43, 43,227,205,185,227,253,195, 1,170, 0, 0, 0, 0, 1, 0, 50, 0, 52, 4,142, - 5,188, 0, 27, 0, 0, 1, 55, 39, 55, 23, 55, 23, 7, 23, 7, 39, 7, 23, 7, 39, 7, 23, 7, 39, 7, 39, 55, 39, 55, 23, 55, - 39, 55, 2, 59,105,216,100,216,125,174,125,216,100,216,105,216,100,216,105,216,100,216,125,174,125,216,100,216,105,216,100, 3, -129,181,125,174,125,216,100,216,125,174,125,181,125,174,125,181,125,174,125,216,100,216,125,174,125,181,125,174, 0, 1,251,218, - 4,222,255, 66, 6,122, 0, 47, 0, 0, 1, 33, 20, 7, 6, 7, 6, 7, 6, 34, 39, 38, 39, 38, 39, 38, 53, 52, 55, 54, 55, 54, - 55, 54, 51, 33, 52, 55, 54, 55, 54, 55, 54, 50, 23, 22, 23, 22, 23, 22, 21, 20, 7, 6, 7, 6, 7, 6,254,185,254, 51, 10, 11, - 19, 20, 25, 24, 56, 24, 25, 20, 19, 11, 10, 10, 11, 19, 20, 25, 24, 28, 1,205, 10, 11, 19, 20, 25, 24, 56, 24, 25, 20, 20, 10, - 10, 10, 11, 19, 20, 25, 24, 5,103, 27, 25, 27, 18, 19, 11, 10, 10, 11, 19, 18, 27, 25, 27, 28, 25, 27, 18, 19, 11, 10, 27, 25, - 27, 18, 19, 11, 10, 10, 11, 19, 21, 24, 25, 28, 27, 25, 27, 18, 19, 11, 10, 0, 0, 1,251,247, 5, 41,254,249, 6, 77, 0, 17, - 0, 0, 1, 54, 51, 50, 23, 22, 23, 51, 38, 39, 38, 35, 34, 7, 6, 7, 21, 54,253, 18, 93, 91, 70, 56, 48, 11,118, 10, 79, 86, -138,124,120, 72,141,138, 5,149, 47, 42, 36, 77,143, 72, 77, 67, 41, 40,134, 23, 0, 1,252, 34, 4,227,254,248, 6,117, 0, 7, - 0, 0, 1, 21, 33, 21, 35, 17, 51, 21,254,248,253,192,150,150, 5,247,150,126, 1,146,126, 0, 0, 1,252, 34, 4,227,254,248, - 6,117, 0, 7, 0, 0, 1, 33, 53, 51, 17, 35, 53, 33,252, 34, 2, 64,150,150,253,192, 5,247,126,254,110,126,255,255,247,214, -254,144, 3, 70, 7, 96, 16, 43, 2, 49,255,142, 4,216,192, 0, 16, 43, 2, 49,251, 15, 8,177,192, 0, 16, 43, 2, 49, 4, 13, - 8,177,192, 0, 16, 43, 2, 49,252, 96, 5,249,192, 0, 16, 43, 2, 49, 2,188, 5,249,192, 0, 16, 43, 2, 49,252, 96, 11,105, -192, 0, 16, 43, 2, 49, 2,188, 11,105,192, 0, 16, 11, 2, 49,255,142, 12,137,192, 0, 0, 0, 0, 8,248, 88,253,195, 2,194, - 8, 45, 0, 5, 0, 11, 0, 17, 0, 23, 0, 29, 0, 35, 0, 41, 0, 47, 0, 0, 39, 55, 23, 19, 7, 3, 1, 7, 39, 3, 55, 19, - 1, 39, 55, 37, 23, 5, 1, 23, 7, 5, 39, 37, 1, 53, 51, 5, 21, 45, 1, 21, 35, 37, 53, 5, 1, 35, 53, 19, 51, 11, 1, 51, - 21, 3, 35, 19,107,150,121,111, 92,169,251,119,150,121,111, 92,169, 5, 31,150,122, 1, 86, 92,254,227,250, 76,149,121,254,169, - 91, 1, 28, 6, 96,172, 1, 64,254,192,248,194,172,254,192, 1, 64, 4, 95,211,164,129, 82,211,211,164,129, 82, 90,150,121,254, -169, 92, 1, 29, 5,181,150,121, 1, 87, 92,254,227,254,241,149,122,110, 91,169,251,119,150,121,111, 92,168, 2, 24,212,164,130, - 82,212,212,164,130, 82, 2,223,172, 1, 64,254,192,248,194,172,254,192, 1, 64, 0, 1, 0,201,254, 86, 5,252, 5,213, 0, 14, - 0, 0, 33, 35, 17, 1, 33, 17, 51, 17, 1, 33, 17, 51, 21, 1, 35, 5, 51,196,253,106,254,240,196, 2,150, 1, 16,201,254,146, -134, 4,225,251, 31, 5,213,251, 31, 4,225,250,213,170,254, 86, 0, 2, 0,193,254, 86, 5, 56, 6, 20, 0, 14, 0, 28, 0, 0, - 33, 35, 17, 1, 35, 17, 51, 17, 1, 51, 17, 51, 21, 1, 35, 1, 51, 30, 1, 51, 50, 54, 55, 51, 14, 1, 35, 34, 38, 4,128,183, -253,228,236,183, 2, 27,237,184,254,222,123,253,205,118, 10, 98, 86, 86, 96, 14,118, 10,158,146,144,158, 3,131,252,125, 4, 96, -252,127, 3,129,252, 57,153,254, 86, 7,190, 75, 75, 74, 76,143,144,144, 0, 0, 0, 2, 0, 33, 0, 0, 4,236, 5,213, 0, 18, - 0, 29, 0, 0, 1, 21, 33, 50, 4, 21, 20, 4, 35, 33, 17, 35, 53, 51, 53, 51, 21, 51, 21, 1, 52, 39, 38, 35, 33, 17, 33, 50, - 55, 54, 1,147, 1, 78,251, 1, 16,254,240,251,253,232,168,168,202,168, 1,220, 79, 78,163,254,188, 1, 68,163, 78, 79, 4, 81, -226,218,222,221,218, 4, 81,164,224,224,164,253,102,139, 68, 67,253,221, 68, 67, 0, 2, 0, 38, 0, 0, 4, 69, 5,158, 0, 10, - 0, 30, 0, 0, 1, 52, 39, 38, 35, 33, 17, 33, 50, 55, 54, 1, 17, 33, 50, 23, 22, 16, 7, 6, 35, 33, 17, 35, 53, 51, 17, 51, - 17, 51, 21, 3,129, 62, 67,128,254,249, 1, 7,129, 66, 62,253,248, 1, 15,208,121,116,116,115,214,254, 57,155,155,184,157, 1, - 76, 94, 42, 46,254,151, 46, 43, 2,223,254,202, 85, 82,254,176, 82, 82, 3,209,143, 1, 62,254,194,143, 0, 0, 0, 2, 0,201, - 0, 0, 4,225, 5,213, 0, 14, 0, 27, 0, 0, 1, 23, 7, 39, 6, 43, 1, 17, 35, 17, 33, 50, 4, 21, 20, 39, 54, 55, 52, 38, - 43, 1, 17, 51, 50, 55, 39, 55, 4, 85,140,106,146,126,214,254,202, 1,200,251, 1, 1,226, 12, 1,154,141,254,254,114, 71,215, -106, 3, 35,117,126,123, 83,253,168, 5,213,227,219,146, 45, 44, 57,134,146,253,207, 47,180,126, 0, 2, 0,186,254, 86, 4,164, - 4,123, 0, 13, 0, 35, 0, 0, 37, 39, 55, 23, 54, 53, 52, 38, 32, 6, 16, 22, 51, 50, 5, 23, 7, 39, 6, 35, 34, 38, 39, 17, - 35, 17, 51, 21, 62, 1, 51, 50, 0, 16, 7, 6, 3, 42,140,110,138, 79,167,254,220,167,167,146, 70, 1, 27,147,111,149, 87,108, -123,177, 58,185,185, 58,177,123,204, 0,255,128, 12,152,167, 93,165,115,197,203,231,231,254,106,231, 20,174, 93,179, 46, 97,100, -253,174, 6, 10,170,100, 97,254,188,253,240,162, 15, 0, 0, 0, 0, 1, 0,201, 0, 0, 4,106, 7, 7, 0, 7, 0, 27, 64, 13, - 3, 6,149, 1,129, 0, 3, 4, 6, 28, 1, 4, 8, 16,252,252,220,204, 49, 0, 47,244,236,204, 48, 51, 17, 33, 17, 51, 17, 33, - 17,201, 2,216,201,253, 41, 5,213, 1, 50,254, 36,250,213, 0, 0, 1, 0,186, 0, 0, 3,208, 5,154, 0, 7, 0, 27, 64, 13, - 3, 6,169, 1,188, 0, 3, 4, 6, 8, 1, 70, 8, 16,252,252,220,204, 49, 0, 47,244,236,204, 48, 51, 17, 33, 17, 51, 17, 33, - 17,186, 2, 94,184,253,162, 4, 96, 1, 58,254, 28,252, 74, 0, 0, 1, 0, 71, 0, 0, 4,106, 5,213, 0, 13, 0, 0, 19, 51, - 17, 33, 21, 33, 17, 33, 21, 33, 17, 35, 17, 35, 71,130, 3,161,253, 41, 2, 35,253,221,202,130, 3,232, 1,237,170,254,189,170, -252,194, 3, 62, 0, 1, 0, 56, 0, 0, 3,208, 4, 96, 0, 13, 0, 0, 51, 17, 35, 53, 51, 17, 33, 21, 33, 17, 33, 21, 33, 17, -186,130,130, 3, 22,253,162, 1,160,254, 96, 1,244,170, 1,194,170,254,232,170,254, 12, 0, 0, 0, 1, 0,201,254,102, 4,204, - 5,213, 0, 27, 0, 0, 1, 17, 35, 17, 33, 21, 33, 17, 33, 50, 23, 22, 21, 17, 16, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, - 38, 35, 1,147,202, 3,161,253, 41, 1,161,186,113,109,204,228, 76, 62,134, 56, 55,124,124, 2,199,253, 57, 5,213,170,254, 70, -119,114,238,254,206,254,242,244,170, 75, 75,194, 1, 34,159,158, 0, 1, 0,186,254, 86, 4, 11, 4, 96, 0, 29, 0, 0, 1, 17, - 35, 17, 33, 21, 33, 17, 51, 32, 23, 22, 21, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 39, 38, 35, 1,114,184, 3, - 22,253,162,250, 1, 7, 70, 82, 82, 81,181,193,172,110, 33, 38, 38, 49,134, 1,231,254, 25, 4, 96,170,254,193, 71, 81,229,254, -242,214, 96, 96,156, 48, 55,147, 1, 8,170, 32, 41, 0, 0, 0, 0, 1, 0, 59,254, 86, 6,194, 5,213, 0, 25, 0, 0, 37, 51, - 17, 35, 17, 35, 1, 35, 17, 35, 17, 35, 1, 35, 9, 1, 51, 1, 51, 17, 51, 17, 51, 1, 51, 1, 6, 87,107,197, 41,254,155,150, -202,150,254,155,217, 1,144,254,162,217, 1, 52,149,202,149, 1, 52,217,254,162,170,253,172, 1,170, 2,199,253, 57, 2,199,253, - 57, 3, 28, 2,185,253,156, 2,100,253,156, 2,100,253, 71, 0, 0, 1, 0, 50,254, 86, 5,193, 4, 96, 0, 25, 0, 0, 37, 51, - 17, 35, 17, 35, 1, 35, 17, 35, 17, 35, 1, 35, 9, 1, 51, 1, 51, 17, 51, 17, 51, 1, 51, 1, 5, 85,108,184, 33,254,213,114, -183,114,254,213,197, 1, 84,254,215,196, 1, 2,113,183,113, 1, 2,196,254,215,153,253,189, 1,170, 2, 9,253,247, 2, 9,253, -247, 2, 85, 2, 11,254, 65, 1,191,254, 65, 1,191,253,245, 0,255,255, 0,156,254,117, 4,115, 5,240, 16, 38, 0,122, 57, 0, - 16, 6, 3, 52, 0, 0, 0, 0,255,255, 0,133,254,117, 3,200, 4,124, 16, 38, 0,122,206, 0, 16, 6, 3, 84, 0, 0, 0, 0, - 0, 1, 0,201,254, 86, 5,106, 5,213, 0, 14, 0, 0, 37, 51, 17, 35, 17, 35, 1, 17, 35, 17, 51, 17, 1, 33, 1, 4,193,169, -197, 69,253, 51,202,202, 2,158, 1, 4,253, 27,170,253,172, 1,170, 2,207,253, 49, 5,213,253,137, 2,119,253, 72, 0, 0, 0, - 0, 1, 0,191,254, 86, 4,161, 4, 96, 0, 14, 0, 0, 37, 51, 17, 35, 17, 35, 1, 17, 35, 17, 51, 17, 1, 51, 1, 4, 2,159, -184, 56,253,199,185,185, 2, 37,235,253,174,153,253,189, 1,170, 2, 35,253,221, 4, 96,254, 29, 1,227,253,244, 0, 1, 0,201, - 0, 0, 5,106, 5,213, 0, 18, 0, 0, 1, 39, 17, 35, 17, 51, 17, 55, 17, 51, 21, 1, 33, 9, 1, 33, 1, 21, 35, 1,224, 77, -202,202, 77,100, 1,237, 1, 4,253, 27, 3, 26,254,246,253,228,100, 2,130, 77,253, 49, 5,213,253,137, 73, 1, 81,243, 1,208, -253, 72,252,227, 2, 30,248, 0, 0, 1, 0,191, 0, 0, 4,161, 4, 96, 0, 18, 0, 0, 1, 21, 35, 53, 39, 17, 35, 17, 51, 17, - 55, 53, 55, 21, 1, 51, 9, 1, 35, 2, 29,101, 64,185,185, 64,101, 1,128,235,253,174, 2,107,240, 1,132,138,235, 62,253,221, - 4, 96,254, 29, 56,217, 2,130, 1, 82,253,244,253,172, 0, 0, 0, 1, 0, 33, 0, 0, 5,106, 5,213, 0, 18, 0, 0, 19, 35, - 53, 51, 53, 51, 21, 51, 21, 35, 21, 1, 33, 9, 1, 33, 1, 17, 35,201,168,168,202,168,168, 2,158, 1, 4,253, 27, 3, 26,254, -246,253, 51,202, 4, 81,164,224,224,164,243, 2,119,253, 72,252,227, 2,207,253, 49, 0, 0, 0, 0, 1, 0, 61, 0, 0, 4,156, - 6, 20, 0, 18, 0, 0, 1, 17, 1, 51, 9, 1, 35, 1, 17, 35, 17, 35, 53, 51, 53, 51, 21, 33, 21, 1,115, 2, 37,235,253,174, - 2,107,240,253,199,185,125,125,185, 1, 96, 4,246,253,135, 1,227,253,244,253,172, 2, 35,253,221, 4,246,164,122,122,164, 0, - 0, 1, 0, 50, 0, 0, 6,150, 5,213, 0, 12, 0, 0, 1, 33, 53, 33, 17, 1, 33, 9, 1, 33, 1, 17, 35, 1,245,254, 61, 2, -141, 2,158, 1, 4,253, 27, 3, 26,254,246,253, 51,202, 5, 43,170,253,137, 2,119,253, 72,252,227, 2,207,253, 49, 0, 0, 0, - 0, 1, 0, 42, 0, 0, 5,139, 4, 96, 0, 12, 0, 0, 1, 33, 53, 33, 17, 1, 51, 9, 1, 35, 1, 17, 35, 1,169,254,129, 2, - 56, 2, 37,235,253,174, 2,107,240,253,199,185, 3,198,154,254, 29, 1,227,253,244,253,172, 2, 35,253,221, 0, 0, 1, 0,201, -254, 86, 6, 4, 5,213, 0, 15, 0, 0, 33, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, 51, 17, 35, 17, 4,113,253, 34,202,202, - 2,222,202,201,201, 2,199,253, 57, 5,213,253,156, 2,100,250,213,253,172, 1,170, 0, 0, 0, 0, 1, 0,193,254, 86, 5, 64, - 4, 96, 0, 15, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 4,136,184,184,184,253,169,184,184, 2, - 87,184,153,253,189, 1,170, 2, 4,253,252, 4, 96,254, 51, 1,205, 0, 0, 0, 0, 1, 0,201, 0, 0, 8, 18, 5,213, 0, 13, - 0, 0, 1, 17, 35, 17, 33, 17, 35, 17, 51, 17, 33, 17, 33, 21, 5, 59,202,253, 34,202,202, 2,222, 3,161, 5, 43,250,213, 2, -199,253, 57, 5,213,253,156, 2,100,170, 0, 0, 0, 1, 0,193, 0, 0, 6,230, 4, 96, 0, 13, 0, 0, 1, 17, 35, 17, 33, 17, - 35, 17, 51, 17, 33, 17, 33, 21, 4,136,184,253,169,184,184, 2, 87, 3, 22, 3,182,252, 74, 2, 4,253,252, 4, 96,254, 51, 1, -205,170, 0, 0, 0, 1, 0,201,254,102, 8,116, 5,213, 0, 29, 0, 0, 1, 17, 35, 17, 33, 17, 35, 17, 33, 17, 33, 50, 23, 22, - 21, 17, 16, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 38, 35, 5, 59,202,253, 34,202, 4,114, 1,161,186,113,109,204,228, 76, - 62,134, 56, 55,124,124, 2,199,253, 57, 5, 43,250,213, 5,213,253,156,119,114,238,254,206,254,242,244,170, 75, 75,194, 1, 34, -159,158, 0, 0, 0, 1, 0,193,254, 86, 7, 33, 4, 96, 0, 31, 0, 0, 1, 17, 35, 17, 33, 17, 35, 17, 33, 17, 51, 32, 23, 22, - 21, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 39, 38, 7, 4,136,184,253,169,184, 3,199,250, 1, 7, 70, 82, 82, - 81,181,193,172,110, 33, 38, 38, 49,134, 1,231,254, 25, 3,198,252, 58, 4, 96,254, 23, 71, 81,229,254,242,214, 96, 96,156, 48, - 55,147, 1, 8,164, 38, 46, 5, 0, 2, 0,115,255, 45, 6, 39, 5,240, 0, 50, 0, 64, 0, 0, 37, 38, 17, 52, 55, 54, 51, 50, - 22, 21, 20, 7, 6, 7, 22, 51, 50, 55, 21, 6, 35, 4, 39, 6, 35, 36, 39, 38, 17, 16, 55, 54, 33, 50, 23, 22, 23, 21, 38, 39, - 38, 35, 32, 7, 6, 17, 16, 23, 22, 51, 50, 55, 54, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 21, 16, 3, 69,100, 96, 95,169,168, -192,102, 74,120,117,142, 84, 71, 73, 82,254,233,190, 68, 76,254,197,188,189,195,195, 1, 83,117,135,129, 94, 92,125,125,121,255, - 0,136,136,130,129,220, 15,217, 73, 48, 97, 43, 43, 73, 74, 43, 43,136,185, 1, 19,220,125,125,250,220,214,157,115, 63, 93, 24, -166, 22, 1,192, 10, 1,209,210, 1, 98, 1,104,207,208, 36, 34, 62,183, 55, 47, 47,156,157,254,216,254,232,166,164, 46, 36, 63, -127,214,120, 69, 71, 69, 70,121,254,228, 0, 0, 0, 2, 0,113,255, 82, 5, 4, 4,123, 0, 12, 0, 63, 0, 0, 37, 54, 55, 54, - 53, 52, 38, 35, 34, 7, 6, 21, 20, 7, 38, 53, 52, 55, 54, 51, 22, 23, 22, 21, 20, 7, 6, 7, 22, 51, 50, 55, 21, 6, 35, 34, - 39, 6, 35, 32, 39, 38, 17, 16, 55, 54, 33, 50, 23, 22, 23, 21, 38, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 51, 3, 87, 33, 22, - 86, 48, 41, 44, 24, 27,143, 51, 77, 78,131,132, 78, 77,137, 39, 56, 72,101, 90, 62, 70, 82,235,137, 53, 60,254,253,138,137,151, -150, 1, 6, 85, 81, 81, 76, 67, 90, 73, 85,179, 99, 99, 85, 84,171,173, 21, 29,113,135, 72, 84, 42, 46, 78,179,155,133,194,155, - 87, 88, 1, 88, 87,165,181,154, 44, 30, 52, 20,158, 18,151, 6,157,156, 1, 19, 1, 18,157,157, 17, 18, 35,152, 25, 22, 19,113, -114,205,201,116,115, 0, 0, 0,255,255, 0,115,254,117, 5, 39, 5,240, 16, 39, 0,122, 1, 45, 0, 0, 16, 6, 3, 62, 0, 0, -255,255, 0,113,254,117, 3,231, 4,123, 16, 39, 0,122, 0,143, 0, 0, 16, 6, 3, 94, 0, 0, 0, 1,255,250,254, 86, 4,233, - 5,213, 0, 11, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 53, 33, 21, 33, 2,215,201,201,203,253,238, 4,239,253,238,170,253,172, - 1,170, 5, 43,170,170, 0, 0, 0, 1, 0, 5,254, 86, 4, 54, 4, 96, 0, 11, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 53, 33, - 21, 33, 2,120,184,184,181,254, 66, 4, 49,254, 66,153,253,189, 1,170, 3,182,170,170, 0, 0,255,255,255,252, 0, 0, 4,231, - 5,213, 18, 6, 0, 60, 0, 0, 0, 1, 0, 61,254, 86, 4,127, 4, 96, 0, 8, 0, 0, 37, 17, 35, 17, 1, 51, 9, 1, 51, 2, -197,195,254, 59,195, 1, 94, 1, 94,195, 18,254, 68, 1,188, 4, 78,252,148, 3,108, 0, 0, 0, 0, 1,255,252, 0, 0, 4,231, - 5,213, 0, 14, 0, 0, 9, 1, 51, 9, 1, 51, 1, 33, 21, 33, 17, 35, 17, 33, 53, 2, 12,253,240,217, 1,158, 1,155,217,253, -240, 2, 12,253,244,203,253,244, 2,199, 3, 14,253,154, 2,102,252,242,170,253,227, 2, 29,170, 0, 1, 0, 61,254, 86, 4,127, - 4, 96, 0, 14, 0, 0, 5, 17, 35, 17, 33, 53, 33, 1, 51, 9, 1, 51, 1, 33, 21, 2,197,195,254, 59, 1,197,254, 59,195, 1, - 94, 1, 94,195,254, 70, 1,186,124,254,210, 1, 46,142, 4, 78,252,148, 3,108,251,178,142, 0, 0, 1, 0, 61,254, 86, 5, 59, - 5,213, 0, 15, 0, 0, 37, 51, 17, 35, 17, 35, 9, 1, 35, 9, 1, 51, 9, 1, 51, 1, 4,203,112,197, 20,254, 92,254, 89,218, - 2, 21,254, 47,217, 1,115, 1,117,217,254, 32,170,253,172, 1,170, 2,123,253,133, 3, 29, 2,184,253,213, 2, 43,253, 51, 0, - 0, 1, 0, 59,254, 86, 4,121, 4, 96, 0, 15, 0, 0, 37, 51, 17, 35, 17, 35, 9, 1, 35, 9, 1, 51, 9, 1, 51, 1, 4, 8, -113,184, 33,254,186,254,186,217, 1,179,254,114,217, 1, 41, 1, 41,217,254,107,153,253,189, 1,170, 1,184,254, 72, 2, 74, 2, - 22,254,113, 1,143,253,223, 0, 0, 1,255,250,254, 86, 7, 71, 5,213, 0, 15, 0, 0, 37, 33, 17, 51, 17, 51, 17, 35, 17, 33, - 17, 33, 53, 33, 21, 33, 2,214, 2,222,202,201,201,251,142,253,238, 4,239,253,238,170, 5, 43,250,213,253,172, 1,170, 5, 43, -170,170, 0, 0, 0, 1, 0, 5,254, 86, 6, 66, 4, 96, 0, 15, 0, 0, 37, 33, 17, 51, 17, 51, 17, 35, 17, 33, 17, 33, 53, 33, - 21, 33, 2,120, 2, 90,184,184,184,252, 57,254, 66, 4, 49,254, 66,153, 3,199,252, 57,253,189, 1,170, 3,182,170,170, 0, 0, - 0, 1, 0,175,254, 86, 5,124, 5,213, 0, 20, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 34, 39, 38, 53, 17, 51, 17, 20, 22, 51, - 33, 17, 51, 4,179,201,201,203,254, 95,186,113,109,201,124,124, 1,120,203,170,253,172, 1,170, 2,199,119,114,238, 1, 55,254, -217,159,158, 2,100, 0, 0, 0, 0, 1, 0,150,254, 86, 4,184, 4, 96, 0, 21, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 34, 39, - 38, 61, 1, 51, 21, 20, 23, 22, 51, 33, 17, 51, 4, 0,184,184,184,254,169,153,102, 92,184, 52, 53,104, 1, 41,184,153,253,189, - 1,170, 2, 9, 95, 86,184,234,211,117, 59, 59, 1,190, 0, 0, 0, 1, 0,175, 0, 0, 4,179, 5,213, 0, 24, 0, 0, 1, 35, - 34, 39, 38, 53, 17, 51, 17, 20, 22, 59, 1, 17, 51, 17, 51, 17, 51, 17, 35, 17, 35, 17, 35, 2,130, 59,186,113,109,201,124,124, - 18,144,214,203,203,214,144, 2,199,119,114,238, 1, 55,254,217,159,158, 1, 57,254,199, 2,100,250, 43, 2,199,254,207, 0, 0, - 0, 1, 0,150, 0, 0, 4, 0, 4, 96, 0, 24, 0, 0, 1, 53, 51, 21, 51, 17, 51, 17, 35, 17, 35, 21, 35, 53, 35, 34, 39, 38, - 61, 1, 51, 21, 20, 23, 22, 1,249,160,175,184,184,175,160, 8,153,102, 92,184, 52, 43, 2,164,194,196, 1,190,251,160, 2, 9, -196,196, 95, 86,184,234,211,117, 59, 48, 0, 0, 0, 1, 0,175, 0, 0, 4,179, 5,213, 0, 16, 0, 0, 1, 17, 33, 50, 23, 22, - 21, 17, 35, 17, 52, 38, 35, 33, 17, 35, 17, 1,122, 1,161,186,113,109,201,124,124,254,136,203, 5,213,253,156,119,114,238,254, -102, 1,138,159,158,253, 57, 5,213, 0, 0, 0,255,255, 0,186, 0, 0, 4,100, 6, 20, 16, 6, 0, 75, 0, 0, 0, 2, 0, 20, -255,227, 7, 20, 5,240, 0, 33, 0, 41, 0, 0, 1, 18, 55, 54, 33, 32, 23, 22, 19, 33, 16, 0, 33, 50, 54, 55, 21, 6, 4, 35, - 32, 39, 38, 3, 6, 39, 38, 61, 1, 51, 21, 20, 23, 22, 37, 33, 38, 39, 38, 32, 7, 6, 1,178, 34,150,188, 1, 58, 1, 67,181, -187, 1,251,112, 1, 18, 1, 18,139,252,112,111,254,249,146,254,162,197,188, 10,170,118,122,170, 75, 66, 1, 64, 3,173, 24, 98, -130,254, 72,128, 97, 3,109, 1, 7,170,210,210,219,254,132,254,244,254,206, 96, 95,215, 70, 72,205,194, 1, 85, 1,103,107,223, - 76, 62,157, 68, 57, 2,191,124,164,164,124, 0, 0, 2, 0, 15,255,226, 5,102, 4,123, 0, 34, 0, 41, 0, 0, 1, 34, 39, 38, - 61, 1, 51, 21, 20, 23, 22, 51, 54, 55, 54, 33, 50, 0, 29, 1, 33, 30, 1, 51, 50, 54, 55, 21, 6, 7, 6, 39, 36, 39, 38, 1, - 46, 1, 35, 34, 6, 7, 1, 88,144, 89, 96,156, 48, 57, 74, 26,116,146, 0,255,226, 1, 7,252,178, 12,205,183,106,199, 98, 99, -104,110,101,254,243,156,148, 3, 78, 2,165,136,154,185, 14, 2, 4, 82, 90,172, 70, 49,151, 33, 38,197,130,161,254,221,250, 90, -190,199, 52, 52,174, 42, 22, 23, 1, 5,151,144, 1,133,151,180,174,158, 0, 0,255,255, 0, 20,254,117, 7, 20, 5,240, 16, 39, - 2, 52, 2,188, 0, 0, 16, 6, 3,216, 0, 0,255,255, 0, 15,254,117, 5,102, 4,123, 16, 39, 2, 52, 1,231, 0, 0, 16, 6, - 3,217, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 16, 6, 0, 79, 0, 0,255,255, 0, 59, 0, 0, 6,173, 5,213, 16, 39, - 6,139, 5,116, 1,117, 17, 6, 3, 51, 0, 0, 0, 8,180, 34, 0, 8, 35, 7, 43, 49, 0, 0,255,255, 0, 50, 0, 0, 5,173, - 6, 72, 16, 39, 2, 49, 0,240, 0, 0, 19, 6, 3, 83, 0, 0, 0, 8,180, 34, 0, 8, 35, 7, 43, 49, 0, 0, 0, 1, 0,201, -254,102, 5, 53, 5,213, 0, 28, 0, 0, 1, 51, 50, 23, 22, 21, 17, 16, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 38, 35, 33, - 17, 35, 17, 51, 17, 1, 33, 2,169,139,186,113,109,204,228, 76, 62,134, 56, 55,124,124,254,136,202,202, 2,158, 1, 4, 3,113, -119,114,238,254,206,254,242,244,170, 75, 75,194, 1, 34,159,158,253, 57, 5,213,253,137, 2,119, 0, 1, 0,191,254, 86, 4,136, - 4, 96, 0, 30, 0, 0, 1, 51, 32, 23, 22, 21, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 53, 17, 52, 39, 38, 35, 33, 17, 35, - 17, 51, 17, 1, 51, 2, 94, 20, 1, 5, 72, 82, 82, 81,181,193,172,110, 33, 38, 38, 44,139,254,252,185,185, 2, 37,235, 2,119, - 71, 81,229,254,242,214, 96, 96,156, 48, 55,147, 1, 8,166, 36, 41,254, 25, 4, 96,254, 29, 1,227, 0, 0, 0, 0, 1, 0, 54, -254, 86, 6, 3, 5,213, 0, 20, 0, 0, 33, 35, 17, 33, 21, 16, 3, 6, 5, 53, 54, 55, 18, 25, 1, 33, 17, 51, 21, 1, 35, 5, - 58,202,254, 27,132, 98,254,145,212, 67,117, 3,120,201,254,146,134, 5, 43,212,254, 24,254,170,253, 56,167, 46,168, 1, 37, 2, - 53, 1, 26,250,213,170,254, 86, 0, 2, 0, 46,254, 86, 5, 43, 4, 96, 0, 0, 0, 21, 0, 0, 9, 1, 51, 21, 1, 35, 19, 35, - 17, 33, 21, 16, 3, 6, 5, 53, 54, 55, 54, 17, 53, 33,253,180, 6,191,184,254,222,123,229,184,254,123,118, 94,254,204,179, 59, - 98, 2,245, 8, 0,248,153,153,254, 86, 1,170, 3,199,134,254,146,254,252,207, 29,153, 27,127,207, 1,167,212, 0, 1, 0,201, -254,102, 5, 59, 5,213, 0, 21, 0, 0, 37, 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, 16, 7, 6, 43, 1, 53, 51, 50, 55, 54, - 4,113,253, 34,202,202, 2,222,202,103,103,227, 76, 62,134, 56, 55,104, 2, 95,253, 57, 5,213,253,156, 2,100,250,147,254,242, -122,122,170, 75, 75, 0, 0, 0, 0, 1, 0,193,254, 86, 4,136, 4, 96, 0, 21, 0, 0, 5, 17, 33, 17, 35, 17, 51, 17, 33, 17, - 51, 17, 20, 7, 6, 43, 1, 53, 51, 50, 55, 54, 3,208,253,169,184,184, 2, 87,184, 82, 81,181,193,172,110, 33, 38, 20, 2, 24, -253,252, 4, 96,254, 51, 1,205,251,140,214, 96, 96,156, 48, 55, 0, 1, 0,201,254, 86, 6, 4, 5,213, 0, 16, 0, 0, 33, 35, - 17, 33, 17, 35, 17, 51, 17, 33, 17, 51, 17, 51, 21, 1, 35, 5, 59,202,253, 34,202,202, 2,222,202,201,254,146,134, 2,199,253, - 57, 5,213,253,156, 2,100,250,213,170,254, 86, 0, 1, 0,193,254, 86, 5, 64, 4, 96, 0, 16, 0, 0, 33, 35, 17, 33, 17, 35, - 17, 51, 17, 33, 17, 51, 17, 51, 21, 1, 35, 4,136,184,253,169,184,184, 2, 87,184,184,254,222,123, 2, 4,253,252, 4, 96,254, - 51, 1,205,252, 57,153,254, 86, 0, 1, 0,175,254, 86, 4,179, 5,213, 0, 20, 0, 0, 37, 17, 33, 34, 39, 38, 53, 17, 51, 17, - 20, 22, 51, 33, 17, 51, 17, 35, 17, 35, 17, 3,232,254, 95,186,113,109,201,124,124, 1,120,203,203,201,170, 2, 29,119,114,238, - 1, 55,254,217,159,158, 2,100,250, 43,254, 86, 2, 84, 0, 0, 0, 1, 0,150,254, 86, 4, 0, 4, 96, 0, 21, 0, 0, 37, 17, - 33, 34, 39, 38, 61, 1, 51, 21, 20, 23, 22, 51, 33, 17, 51, 17, 35, 17, 35, 17, 3, 72,254,169,153,102, 92,184, 52, 53,104, 1, - 41,184,184,184,153, 1,112, 95, 86,184,234,211,117, 59, 59, 1,190,251,160,254, 86, 2, 67, 0, 0, 1, 0,201,254, 86, 6,232, - 5,213, 0, 17, 0, 0, 37, 51, 21, 1, 35, 1, 35, 17, 1, 35, 1, 17, 35, 17, 33, 9, 1, 33, 6, 31,201,254,146,134, 1, 43, -197,254,127,203,254,127,196, 1, 45, 1,125, 1,127, 1, 45,170,170,254, 86, 1,170, 5, 31,252, 0, 4, 0,250,225, 5,213,252, - 8, 3,248, 0, 0, 1, 0,193,254, 86, 6, 0, 4, 96, 0, 17, 0, 0, 37, 51, 21, 1, 35, 19, 35, 17, 1, 35, 1, 17, 35, 17, - 33, 9, 1, 33, 5, 72,184,254,222,123,229,178,254,203,184,254,202,178, 1, 6, 1, 62, 1, 63, 1, 4,153,153,254, 86, 1,170, - 3,176,253, 39, 2,217,252, 80, 4, 96,253, 18, 2,238, 0, 0,255,255, 0, 16, 0, 0, 5,104, 7,146, 16, 39, 2, 49, 0,206, - 1, 74, 17, 6, 3, 45, 0, 0, 0, 18,180, 24, 0, 8, 19, 7, 43, 49, 0, 64, 5,111, 0,111, 8, 2, 93, 48,255,255, 0,123, -255,227, 4, 45, 6, 31, 16, 38, 2, 49, 79,215, 19, 6, 3, 77, 0, 0, 0, 8,180, 34, 0, 8, 25, 7, 43, 49,255,255, 0, 16, - 0, 0, 5,104, 5,213, 16, 38, 3, 45, 0, 0, 17, 7, 6,132, 4,188, 1,117, 0, 20,180, 10, 18, 13, 5, 7, 43, 64, 9, 48, - 18, 63, 13, 0, 18, 15, 13, 4, 93, 49, 0, 0,255,255, 0,123,255,227, 4, 45, 6, 16, 18, 38, 3, 77, 0, 0, 17, 6, 0,106, - 82, 0, 0, 32,180, 20, 45, 40, 11, 7, 43, 64, 21,127, 40,111, 40, 80, 45, 95, 40, 64, 45, 79, 40, 48, 45, 63, 40, 0, 45, 15, - 40, 10, 93, 49,255,255, 0, 8, 0, 0, 7, 72, 5,213, 18, 6, 0,136, 0, 0,255,255, 0,123,255,227, 7,111, 4,123, 18, 6, - 0,168, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 16, 39, 6,139, 4,161, 1,117, 17, 6, 3, 50, 0, 0, 0, 7, 64, 3, - 64, 0, 1, 93, 49, 0, 0, 0,255,255, 0,113,255,227, 4,127, 6, 72, 16, 39, 2, 49, 0,150, 0, 0, 19, 6, 3, 82, 0, 0, - 0, 7, 64, 3,112, 0, 1, 93, 49, 0, 0, 0,255,255, 0,117,255,227, 5,217, 5,240, 16, 6, 1, 81, 0, 0,255,255, 0, 0, - 0, 0, 0, 0, 0, 0, 16, 6, 2, 4, 0, 0,255,255, 0,117,255,227, 5,217, 5,240, 16, 39, 6,132, 5, 32, 1,117, 16, 6, - 3,243, 0, 0,255,255, 1, 43, 5, 70, 3,125, 6, 16, 16, 38, 0,106, 84, 0, 16, 6, 3,244, 0, 0, 0, 0,255,255, 0, 59, - 0, 0, 6,173, 5,213, 16, 39, 6,132, 5,116, 1,117, 17, 6, 3, 51, 0, 0, 0, 8,180, 28, 7, 2, 29, 7, 43, 49, 0, 0, -255,255, 0, 50, 0, 0, 5,173, 6, 16, 16, 39, 0,106, 0,240, 0, 0, 18, 6, 3, 83, 0, 0,255,255, 0,156,255,227, 4,115, - 5,240, 16, 39, 6,132, 4,135, 1,117, 16, 6, 3, 52, 0, 0,255,255, 0,133,255,227, 3,200, 6, 16, 16, 38, 0,106, 58, 0, - 16, 6, 3, 84, 0, 0, 0, 0,255,255, 0,160,255,193, 4,248, 5,213, 16, 6, 1,121, 0, 0,255,255, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 6, 2, 8, 0, 0,255,255, 0,201, 0, 0, 5, 51, 7, 49, 16, 39, 0,113, 0,245, 1, 59, 16, 6, 3, 53, 0, 0, -255,255, 0,193, 0, 0, 4,128, 5,245, 16, 39, 0,113, 0,137,255,255, 16, 6, 3, 85, 0, 0,255,255, 0,201, 0, 0, 5, 51, - 5,213, 16, 39, 6,132, 4,245, 1,117, 16, 6, 3, 53, 0, 0,255,255, 0,193, 0, 0, 4,128, 6, 16, 16, 39, 0,106, 0,137, - 0, 0, 16, 6, 3, 85, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 16, 38, 3, 59, 0, 0, 17, 7, 6,132, 5, 39, 1,117, - 0, 20,180, 3, 31, 26, 9, 7, 43, 64, 9, 64, 31, 79, 26, 16, 31, 31, 26, 4, 93, 49, 0, 0,255,255, 0,113,255,227, 4,117, - 6, 16, 18, 38, 3, 91, 0, 0, 17, 6, 0,106,115, 0, 0, 20,180, 3, 31, 26, 9, 7, 43, 64, 9, 64, 31, 79, 26, 48, 31, 63, - 26, 4, 93, 49,255,255, 0,115,255,227, 5,217, 5,240, 16, 6, 3, 17, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 16, 6, - 2, 7, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 38, 4, 3, 0, 0, 16, 7, 6,132, 5, 39, 1,117,255,255, 1, 74, - 5, 70, 3,156, 6, 16, 18, 38, 4, 4, 0, 0, 16, 6, 0,106,115, 0, 0, 0,255,255, 0,111,255,227, 5, 35, 5,240, 16, 39, - 6,132, 4,103, 1,117, 16, 6, 3, 74, 0, 0,255,255, 0,113,255,227, 3,231, 6, 16, 16, 38, 0,106,226, 0, 16, 6, 3,106, - 0, 0, 0, 0,255,255, 0, 35,255,227, 4,189, 7, 49, 16, 39, 0,113, 0,114, 1, 59, 16, 6, 3, 64, 0, 0,255,255, 0, 61, -254, 86, 4,127, 5,245, 16, 38, 0,113, 94,255, 16, 6, 3, 96, 0, 0, 0, 0,255,255, 0, 35,255,227, 4,189, 5,213, 16, 39, - 6,132, 4,114, 1,117, 16, 6, 3, 64, 0, 0,255,255, 0, 61,254, 86, 4,127, 6, 16, 16, 38, 0,106, 94, 0, 16, 6, 3, 96, - 0, 0, 0, 0,255,255, 0, 35,255,227, 4,189, 5,213, 16, 39, 6,141, 4,114, 1,117, 16, 6, 3, 64, 0, 0,255,255, 0, 61, -254, 86, 4,127, 6,102, 16, 38, 2, 54, 94, 0, 16, 6, 3, 96, 0, 0, 0, 0,255,255, 0,175, 0, 0, 4,179, 5,213, 16, 39, - 6,132, 4,204, 1,117, 16, 6, 3, 68, 0, 0,255,255, 0,150, 0, 0, 4, 0, 6, 16, 16, 38, 0,106, 94, 0, 16, 6, 3,100, - 0, 0, 0, 0, 0, 1, 0,201,254, 86, 4,106, 5,213, 0, 9, 0, 0, 37, 51, 17, 35, 17, 35, 17, 33, 21, 33, 1,147,201,201, -202, 3,161,253, 41,170,253,172, 1,170, 5,213,170, 0, 0, 0, 0, 1, 0,186,254, 86, 3,208, 4, 96, 0, 9, 0, 0, 37, 51, - 17, 35, 17, 35, 17, 33, 21, 33, 1,114,184,184,184, 3, 22,253,162,153,253,189, 1,170, 4, 96,170, 0, 0, 0,255,255, 0,201, - 0, 0, 6, 70, 5,213, 18, 38, 3, 72, 0, 0, 16, 7, 6,132, 5,183, 1,117,255,255, 0,193, 0, 0, 5,105, 6, 16, 16, 38, - 3,104, 0, 0, 16, 7, 0,106, 1, 8, 0, 0, 0, 2, 0,145, 0, 0, 4,180, 5,213, 0, 10, 0, 21, 0, 0, 1, 20, 23, 22, - 51, 33, 17, 33, 34, 7, 6, 1, 17, 33, 34, 36, 53, 52, 36, 51, 33, 17, 1,102, 79, 78,163, 1, 68,254,188,163, 78, 79, 3, 78, -253,232,251,254,240, 1, 16,251, 1, 78, 1,183,138, 67, 68, 2, 35, 67, 68, 3,147,250, 43,218,221,222,218, 2,102, 0, 0, 0, - 0, 2, 0,113, 0, 0, 3,245, 4, 96, 0, 10, 0, 22, 0, 0, 1, 20, 23, 22, 51, 33, 17, 33, 34, 7, 6, 1, 17, 33, 34, 39, - 38, 16, 55, 54, 51, 33, 17, 1, 53, 62, 66,129, 1, 7,254,249,128, 67, 62, 2,192,254, 57,214,115,116,116,121,208, 1, 15, 1, - 76, 90, 43, 46, 1,105, 46, 42, 2,182,251,160, 82, 82, 1, 80, 82, 85, 1,197, 0, 2, 0,145,255,227, 7, 67, 5,213, 0, 12, - 0, 48, 0, 0, 1, 33, 34, 7, 6, 16, 23, 22, 51, 50, 55, 54, 53, 19, 6, 7, 6, 7, 6, 35, 34, 39, 38, 53, 52, 36, 51, 33, - 17, 51, 3, 20, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 3,234,254,188,163, 78, 79, 79, 95,129,180, - 75, 86, 33, 12, 14, 51,106, 94,110,238,129,136, 1, 16,251, 1, 78,202, 1, 63, 52,112,105, 59, 63,202,110,104,215,217,102, 49, - 2,201, 67, 68,254,234, 80, 95,109,125,159,254,221, 29, 28, 96, 54, 49,129,137,202,222,218, 2,102,251,236,143, 91, 74, 74, 79, -155, 2,159,253, 90,224,127,120,120, 57, 0, 0, 0, 2, 0,113,255,227, 6,115, 4, 96, 0, 12, 0, 46, 0, 0, 1, 33, 34, 7, - 6, 21, 20, 22, 51, 50, 55, 54, 53, 19, 6, 7, 6, 35, 34, 38, 53, 52, 55, 54, 51, 33, 17, 51, 17, 20, 23, 22, 51, 50, 55, 54, - 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 3, 61,254,249,128, 67, 62,129,106,148, 92, 45, 49, 67, 93, 94,136,172,203,116,121, -208, 1, 15,184, 62, 60,106,104, 60, 62,184,100,104,206,211,100, 31, 2, 2, 46, 42, 94, 92,115,109, 52,156,254,246,108, 48, 49, -193,166,170, 82, 85, 1,197,253, 97,159, 80, 79, 79, 82,157, 1, 65,254,184,236,115,120,120, 37, 0, 1, 0,201,255,227, 7, 3, - 5,240, 0, 55, 0, 0, 1, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 6, 7, 53, 54, 55, 54, 51, 50, 23, - 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 39, 38, 3,170, - 92, 93,165,174,182,149, 79, 79, 81, 82,152, 83,190,114,115,100,101, 89,230,134,134, 71, 71,131,145, 82, 81, 63, 52,112,105, 59, - 63,202,110,104,215,217,102, 48, 28, 33, 1,178,132, 74, 75,166, 59, 60,112,115, 61, 62, 36, 38,180, 32, 16, 16,104,105,178,124, - 85, 86, 33, 31, 98, 98,144,128, 91, 74, 74, 79,155, 2,159,253, 90,224,127,120,120, 56, 80, 97, 0, 1, 0,171,255,227, 6, 70, - 4,124, 0, 53, 0, 0, 1, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7, 53, 62, 1, 51, 50, 23, - 22, 21, 20, 7, 6, 7, 22, 23, 22, 21, 20, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 3, 19, 78, 72, -137,148,155,116, 67, 68, 70, 69,119, 71, 81, 80, 97, 98,170, 76,196,113,114, 60, 60,112,129, 64, 69, 62, 61,105,104, 60, 62,184, -100,104,206,199,112, 98, 1, 56,102, 56, 51,152, 44, 45, 70, 64, 46, 46, 13, 13, 29,167, 24, 24, 78, 79,141, 93, 64, 65, 24, 25, - 72, 79, 72, 88, 68, 69, 79, 82,157, 1, 65,254,184,236,115,120,117,101, 0, 0, 0, 1, 0,201,254, 86, 5, 60, 5,240, 0, 41, - 0, 0, 33, 35, 17, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 6, 7, 53, 54, 55, 54, 51, 50, 23, 22, 21, - 20, 7, 6, 7, 22, 23, 22, 21, 17, 51, 17, 35, 4,115,201, 92, 93,165,174,182,149, 79, 79, 81, 82,152, 83,190,114,115,100,101, - 89,230,134,134, 71, 71,131,145, 82, 81,201,201, 1,177,133, 74, 75,166, 59, 60,112,115, 61, 62, 36, 38,180, 32, 16, 16,104,105, -178,124, 85, 86, 33, 31, 98, 97,146,254,249,253,172, 0, 0, 0, 0, 1, 0,171,254, 86, 4,131, 4,124, 0, 41, 0, 0, 37, 51, - 17, 35, 17, 35, 17, 52, 39, 38, 43, 1, 53, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7, 53, 62, 1, 51, 50, 23, 22, 21, - 20, 7, 6, 7, 22, 23, 22, 21, 3,200,187,184,184, 78, 72,137,148,155,116, 67, 68, 70, 69,119, 71, 81, 80, 97, 98,170, 76,196, -113,114, 60, 60,112,126, 67, 69,153,253,189, 1,170, 1, 70, 88, 56, 51,152, 44, 45, 70, 64, 46, 46, 13, 13, 29,167, 24, 24, 78, - 79,141, 93, 64, 65, 24, 24, 73, 75,106, 0, 0, 0, 1, 0, 54,255,227, 7,202, 5,213, 0, 33, 0, 0, 1, 17, 20, 23, 22, 51, - 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 53, 17, 33, 21, 16, 3, 6, 5, 53, 54, 55, 18, 25, 1, 5, 58, 63, 52, -112,105, 59, 63,202,110,104,215,214,105,110,254, 27,132, 98,254,145,212, 67,117, 5,213,251,236,143, 91, 74, 74, 79,155, 2,159, -253, 90,224,127,120,120,125,226, 3,113,212,254, 24,254,170,253, 56,167, 46,168, 1, 37, 2, 53, 1, 26, 0, 0, 0, 1, 0, 46, -255,227, 6,238, 4, 96, 0, 32, 0, 0, 1, 17, 20, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 53, 17, 33, - 21, 16, 3, 6, 5, 53, 54, 55, 54, 17, 53, 4,115,122,103,104, 60, 62,184,100,104,206,199,112, 98,254,123,118, 94,254,204,179, - 59, 98, 4, 96,253, 4, 87,138, 79, 82,157, 1, 65,254,184,236,115,120,117,101,123, 2,143,134,254,146,254,252,207, 29,153, 27, -127,207, 1,167,212, 0, 0, 0,255,255, 0,201,255,227, 8, 45, 5,213, 16, 2, 1,184, 0, 0, 0, 1, 0,193,255,227, 7, 3, - 4, 96, 0, 28, 0, 0, 1, 17, 20, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 61, 1, 33, 17, 35, 17, 51, - 17, 33, 17, 4,136,122,103,104, 60, 62,184,100,104,206,199,112, 98,253,169,184,184, 2, 87, 4, 96,253, 4, 87,138, 79, 82,157, - 1, 65,254,184,236,115,120,117,101,123,204,253,252, 4, 96,254, 51, 1,205, 0,255,255, 0,115,255,227, 5,139, 5,240, 16, 2, - 0, 42, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 16, 2, 2, 5, 0, 0, 0, 1,255,250,255,227, 5,102, 5,213, 0, 25, - 0, 0, 1, 17, 20, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 53, 17, 33, 53, 33, 21, 2,215, 63, 52, -111,105, 59, 63,202,110,104,215,214,105,110,253,238, 4,239, 5, 43,252,150,143, 91, 74, 74, 79,155, 2,159,253, 90,224,127,120, -120,125,226, 3,113,170,170, 0, 0, 1, 0, 5,255,227, 4,246, 4, 96, 0, 25, 0, 0, 1, 17, 20, 23, 22, 51, 50, 55, 54, 53, - 17, 51, 17, 20, 7, 6, 35, 34, 39, 38, 53, 17, 33, 53, 33, 21, 2,120, 62, 61,105,104, 60, 62,184,100,104,206,199,112, 98,254, - 66, 4, 49, 3,182,253,174, 86, 70, 69, 79, 82,157, 1, 65,254,184,236,115,120,117,101,123, 2,126,170,170, 0, 0, 1, 0,178, -255,227, 6,160, 5,213, 0, 33, 0, 0, 37, 6, 7, 6, 33, 32, 0, 25, 1, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 20, 7, - 51, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 4,239, 42, 45,144,254,230,254,229,254,223,203,174,195,194,174,203, 9, 44,148, - 96, 96,156, 48, 55, 81,248, 82, 46,149, 1, 42, 1, 36, 3,164,252,117,240,211,211,240, 3,139,252, 92, 71, 67, 91, 91,171, 70, - 49,108, 42, 49, 0, 1, 0,178, 0, 0, 5, 41, 5,242, 0, 32, 0, 0, 33, 35, 17, 16, 0, 33, 32, 23, 22, 17, 21, 35, 53, 52, - 38, 35, 34, 6, 29, 1, 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, 1,125,203, 1, 33, 1, 27, 1, 23,147,145,203,174, -194,195,174, 2, 88,149, 95, 96,156, 48, 55, 81,253,168, 3,164, 1, 36, 1, 42,149,146,254,217, 57, 32,240,211,211,240,157, 91, - 91,171, 70, 49,108, 42, 49, 0, 0, 2, 0,178, 0, 0, 6,196, 5,242, 0, 28, 0, 40, 0, 0, 1, 51, 50, 23, 22, 29, 1, 35, - 53, 52, 39, 38, 43, 1, 17, 35, 17, 33, 34, 39, 38, 53, 52, 55, 54, 33, 32, 0, 17, 3, 17, 52, 38, 35, 34, 6, 21, 20, 23, 22, - 51, 5, 41, 71,149, 95, 96,156, 48, 55, 81, 71,203,254, 42,201,159,110,144,152, 1, 19, 1, 27, 1, 33,203,174,195,194,174, 53, - 90,166, 2,114, 91, 91,171, 70, 49,108, 42, 49,254, 61, 1,195,179,124,224,253,142,149,254,214,254,220,254,206, 1, 25,240,211, -211,175,149, 73,124, 0, 0, 0, 0, 1, 0,178, 0, 0, 6,196, 5,242, 0, 32, 0, 0, 1, 51, 50, 23, 22, 29, 1, 35, 53, 52, - 39, 38, 43, 1, 17, 35, 17, 52, 38, 35, 34, 7, 6, 29, 1, 35, 53, 16, 0, 33, 32, 23, 22, 5, 23, 89,149, 95, 96,156, 48, 55, - 81, 71,203,174,194,195, 87, 87,203, 1, 33, 1, 27, 1, 26,144, 90, 4, 96, 91, 91,171, 70, 49,108, 42, 49,252, 79, 3,139,240, -211,106,106,239, 32, 57, 1, 36, 1, 42,149, 92, 0, 1, 0,178,255,227, 5, 41, 5,213, 0, 32, 0, 0, 19, 16, 0, 33, 32, 55, - 54, 61, 1, 35, 21, 20, 6, 35, 34, 38, 53, 17, 33, 50, 23, 22, 29, 1, 51, 53, 52, 39, 38, 35, 33, 17, 35,178, 1, 33, 1, 27, - 1, 23,147,145,203,174,194,195,174, 2, 88, 81, 55, 48,156, 96, 95,149,253,168,203, 2, 49,254,220,254,214,149,146,227, 57, 32, -172,211,211,240, 1,103, 49, 42,108, 49, 70,171, 91, 91, 1,117, 0, 2, 0,155,255, 8, 4,186, 5,240, 0, 33, 0, 43, 0, 0, - 37, 33, 54, 55, 6, 7, 6, 35, 34, 0, 53, 52, 0, 51, 32, 23, 22, 3, 2, 3, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, - 17, 51, 18, 32, 54, 53, 52, 38, 32, 6, 21, 20, 1,102, 1, 15,232, 60, 48, 28, 73,124,224,254,251, 1, 16,226, 1, 8,131,155, - 58, 52,231,149, 95, 96,156, 48, 55, 81,253, 53,203,167, 1, 16,159,159,254,240,159,175,225,208, 39, 17, 46, 1, 15,235,230, 1, - 22,198,234,254,169,254,207,254,247, 91, 91,171, 70, 49,108, 42, 49, 1, 76, 1, 76,186,162,161,187,187,161,162, 0, 1, 0,178, -255, 8, 5, 41, 5,213, 0, 29, 0, 0, 37, 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, 17, 51, 17, 33, 50, 23, 22, 29, - 1, 35, 53, 52, 39, 38, 35, 33, 1,125, 1,133,149, 95, 96,156, 48, 55, 81,253,176,203, 2, 88,149, 95, 96,156, 48, 55, 81,253, -168,175, 91, 91,171, 70, 49,108, 42, 49, 5,213,254,139, 91, 91,171, 70, 49,108, 42, 49, 0, 0, 0, 1, 0,178,255, 8, 5, 41, - 5,242, 0, 31, 0, 0, 51, 17, 16, 0, 33, 32, 23, 22, 17, 21, 35, 53, 52, 38, 35, 34, 7, 6, 21, 17, 33, 50, 23, 22, 29, 1, - 35, 53, 52, 39, 38, 35,178, 1, 33, 1, 27, 1, 19,151,145,203,174,194,197, 85, 87, 2, 88,149, 95, 96,156, 48, 55, 81, 3,164, - 1, 36, 1, 42,149,142,254,213, 57, 32,240,211,106,108,237,253, 36, 91, 91,171, 70, 49,108, 42, 49, 0, 0, 0, 0, 2, 0,178, - 0, 0, 6,142, 5,242, 0, 43, 0, 56, 0, 0, 1, 35, 21, 20, 7, 6, 7, 6, 39, 38, 39, 38, 55, 54, 51, 33, 38, 39, 38, 35, - 34, 6, 21, 17, 35, 17, 16, 0, 33, 32, 23, 22, 23, 51, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 33, 35, 34, 21, 20, 23, 22, 51, - 50, 55, 54, 53, 52, 5, 58, 17,103,105,152,146,109,130, 2, 1, 73, 78, 75, 1, 40, 22, 42, 87,194,195,174,203, 1, 33, 1, 27, - 1, 19,151, 92, 33, 37,149, 95, 96,156, 48, 53,254,208,187,153, 57, 58, 69, 53, 58, 46, 3,177, 32,223,114,115, 10, 10, 84,102, -189,147, 76, 81, 82, 50,106,211,240,252,117, 3,164, 1, 36, 1, 42,149, 91,162, 91, 91,171, 70, 49,106, 44, 49,135,105, 45, 45, - 81, 64,147, 17, 0, 2, 0,178, 0, 0, 6,196, 5,242, 0, 28, 0, 40, 0, 0, 1, 35, 17, 16, 0, 33, 32, 39, 38, 17, 52, 55, - 54, 51, 33, 17, 51, 17, 51, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 41, 1, 34, 7, 6, 21, 20, 22, 51, 50, 54, 53, 5,112, 71, -254,223,254,229,254,237,152,144,110,159,201, 1,214,203, 71,149, 95, 96,156, 48, 55,254,157,254, 84,166, 90, 53,174,194,195,174, - 3,177,254,157,254,220,254,214,149,142, 1, 46,224,124,179, 1,146,254,110, 91, 91,171, 70, 49,108, 42, 49,125, 72,149,224,211, -211,240, 0, 0, 0, 1, 0,178, 0, 0, 5, 41, 5,213, 0, 20, 0, 0, 19, 51, 17, 54, 51, 32, 23, 22, 17, 21, 35, 53, 52, 38, - 35, 34, 7, 6, 21, 17, 35,178,203,160,209, 1, 19,151,145,203,174,194,193, 89, 87,203, 5,213,254, 59,100,149,142,254,213, 75, - 50,240,211,106,103,242,253,243, 0, 1, 0,178,255, 8, 4, 86, 5,213, 0, 15, 0, 0, 1, 17, 33, 50, 23, 22, 29, 1, 35, 53, - 52, 39, 38, 35, 33, 17, 1,125, 1,133,149, 95, 96,156, 48, 55, 81,253,176, 5,213,250,218, 91, 91,171, 70, 49,108, 42, 49, 5, -213, 0, 0, 0, 0, 1, 0,178,255,227, 5,231, 5,213, 0, 27, 0, 0, 1, 17, 16, 23, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, - 7, 6, 35, 34, 39, 38, 25, 1, 33, 17, 35, 17, 51, 17, 3,124, 37, 51,120,129, 42, 37,203,113, 88,210,198,100,113,254,204,203, -203, 4, 96,253,215,254,229, 62, 87, 87, 75,135, 2,176,253, 55,213,125, 98, 98,112, 1,105, 1,147,252, 79, 5,213,254,139, 0, - 0, 2, 0, 65,255,227, 7,153, 6,205, 0, 34, 0, 47, 0, 0, 1, 22, 17, 16, 0, 33, 32, 0, 17, 16, 55, 35, 6, 39, 38, 61, - 1, 51, 21, 20, 23, 22, 51, 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 37, 34, 7, 6, 17, 16, 0, 32, 0, 17, 16, 39, 38, - 5,214,201,254,136,254,198,254,197,254,135,195,103,148, 96, 96,156, 48, 55, 81, 4,176,149, 95, 96,156, 48, 55, 81,253,168,225, -124,130, 1, 3, 1,184, 1, 1,128,121, 5, 38,225,254,164,254,159,254, 91, 1,164, 1, 98, 1, 99,218, 1, 92, 91,171, 70, 49, -108, 42, 49, 91, 91,171, 70, 49,108, 42, 49, 32,158,164,254,229,254,230,254,184, 1, 72, 1, 26, 1, 22,169,158, 0, 1, 0,178, - 0, 0, 5, 41, 5,213, 0, 20, 0, 0, 33, 35, 17, 6, 35, 32, 39, 38, 25, 1, 51, 17, 20, 22, 51, 50, 55, 54, 61, 1, 51, 5, - 41,203,160,209,254,237,152,144,203,174,194,193, 89, 87,203, 1,197,100,149,142, 1, 43, 2, 38,253,243,240,211,105,104,242,152, - 0, 1, 0,178,255, 8, 5, 41, 5,213, 0, 18, 0, 0, 9, 2, 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, 53, 9, 1, - 3,117, 1,119,252,201, 2, 32,149, 95, 96,156, 48, 55, 81,252,221, 3, 49,254,107, 5,213,254,174,252, 44, 91, 91,171, 70, 49, -108, 42, 49,175, 3,192, 1,102, 0, 3, 0,143,255,210, 4,201, 5,240, 0, 38, 0, 44, 0, 54, 0, 0, 37, 6, 35, 34, 39, 38, - 55, 54, 51, 50, 23, 54, 55, 6, 7, 6, 35, 34, 0, 53, 52, 0, 51, 32, 23, 22, 3, 2, 7, 6, 7, 22, 55, 54, 55, 21, 6, 7, - 6, 37, 38, 7, 6, 23, 22, 18, 32, 54, 53, 52, 38, 32, 6, 21, 20, 2,174,110, 86,172, 73,103, 2, 5,201,178,148,131,114, 48, - 28, 73,124,224,254,251, 1, 16,226, 1, 8,131,155, 58, 55,190, 32, 36, 84, 46,129,126,103,152,154,254,206, 93, 42, 86, 31, 24, -181, 1, 16,159,159,254,240,159, 28, 64, 35, 50,110,245,154,119,239, 39, 17, 46, 1, 15,235,230, 1, 22,198,234,254,169,254,191, -204, 34, 37, 22, 3, 7,100,192, 89, 1, 3,198, 81, 4, 8, 60, 45, 2, 38,186,162,161,187,187,161,162, 0, 0, 0, 1, 0,178, -255, 8, 6,196, 5,242, 0, 30, 0, 0, 33, 17, 52, 38, 35, 34, 7, 6, 29, 1, 35, 53, 16, 0, 33, 32, 0, 25, 1, 51, 50, 23, - 22, 29, 1, 35, 53, 52, 39, 38, 35, 4, 94,174,194,197, 85, 87,203, 1, 33, 1, 27, 1, 26, 1, 33, 71,149, 95, 96,156, 48, 55, - 81, 3,139,240,211,106,106,239, 32, 57, 1, 36, 1, 42,254,214,254,220,253, 11, 91, 91,171, 70, 49,108, 42, 49, 0, 2, 0, 92, -255,226, 5,133, 5,213, 0, 13, 0, 43, 0, 0, 1, 17, 20, 22, 51, 50, 55, 54, 61, 1, 52, 39, 38, 35, 33, 35, 53, 51, 53, 52, - 55, 54, 51, 33, 21, 33, 34, 7, 6, 21, 33, 50, 23, 22, 21, 17, 35, 53, 6, 35, 32, 39, 38, 17, 1,217,174,194,193, 89, 87, 48, - 55, 81,253, 12,178,178, 96, 95,149, 3, 35,253, 12, 81, 55, 48, 2, 88,149, 95, 96,203,160,209,254,231,146,144, 3,177,254,152, -240,211,106,103,242,161,108, 42, 49,175, 20,171, 91, 91,175, 49, 42,107, 91, 91,171,253, 1, 70,100,149,148, 1, 37, 0, 0, 0, - 0, 1, 0,178,255,227, 6,196, 5,213, 0, 29, 0, 0, 1, 17, 16, 0, 33, 32, 0, 25, 1, 51, 17, 20, 22, 51, 50, 54, 53, 17, - 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 5, 41,254,223,254,230,254,229,254,223,203,174,195,194,174, 1, 18,149, 95, 96, -156, 48, 55, 81, 5, 38,253, 11,254,220,254,214, 1, 42, 1, 36, 3,164,252,117,240,211,211,240, 3,139, 91, 91,171, 70, 49,108, - 42, 49, 0, 0, 0, 1, 0,140,255,227, 5, 83, 5,242, 0, 44, 0, 0, 19, 52, 55, 54, 33, 32, 23, 22, 21, 20, 7, 6, 7, 30, - 1, 21, 20, 4, 32, 36, 53, 51, 20, 23, 22, 32, 54, 53, 52, 38, 35, 33, 53, 33, 50, 54, 53, 52, 39, 38, 35, 34, 7, 6, 7,173, -155,144, 1, 23, 1, 20,147,155, 73, 73,129,146,163,254,247,253, 74,254,248,202, 82, 83, 1,232,166,165,245,253,191, 2, 65,230, -147, 99, 97,181,181, 97, 87, 11, 4,171,143, 96, 88, 88, 96,143,128, 91, 89, 32, 34,198,175,245,232,231,246,162, 78, 77,155,162, -167,154,159,130,116, 89, 49, 48, 48, 43, 74, 0, 0, 1, 0, 92,255,227, 6,110, 6,205, 0, 30, 0, 0, 1, 17, 20, 22, 51, 50, - 55, 54, 61, 1, 51, 21, 16, 0, 33, 32, 0, 25, 1, 35, 34, 39, 38, 61, 1, 51, 21, 20, 23, 22, 51, 2,194,174,194,197, 85, 87, -203,254,223,254,229,254,230,254,223, 71,149, 95, 96,156, 48, 55, 81, 5,213,252,117,240,211,105,107,239, 32, 57,254,220,254,214, - 1, 42, 1, 36, 2,245, 91, 91,171, 70, 49,108, 42, 49, 0, 0, 0, 1, 0,178,255,225, 5, 41, 6,147, 0, 32, 0, 0, 1, 20, - 23, 22, 51, 50, 55, 54, 61, 1, 51, 21, 16, 7, 6, 37, 36, 39, 38, 53, 16, 55, 54, 37, 55, 37, 53, 5, 21, 5, 4, 7, 6, 1, -122, 90, 91,190,195, 87, 87,203,145,159,254,244,254,208,123,144, 61,129, 1,115,150,253, 57, 4, 17,254,164,254,153, 87, 47, 2, - 7,175,104,105,105,107,239, 32, 57,254,220,149,165, 16, 18,131,155,234, 1, 38,100,224,161, 65,140,190,190,190,156,161,158, 85, - 0, 1, 0,178, 0, 0, 5, 41, 5,242, 0, 17, 0, 0, 51, 17, 16, 0, 33, 32, 0, 25, 1, 35, 17, 52, 38, 35, 34, 6, 21, 17, -178, 1, 33, 1, 27, 1, 26, 1, 33,203,174,194,195,174, 3,164, 1, 36, 1, 42,254,214,254,220,252, 92, 3,139,240,211,211,240, -252,117, 0, 0, 0, 1, 0,178,255, 66, 5, 41, 5,244, 0, 32, 0, 0, 1, 52, 39, 38, 35, 34, 7, 6, 29, 1, 35, 53, 16, 55, - 54, 5, 4, 23, 22, 21, 16, 7, 6, 5, 7, 5, 21, 37, 53, 37, 36, 55, 54, 4, 97, 90, 91,190,195, 87, 87,203,144,160, 1, 12, - 1, 48,122,145, 61,129,254,141,150, 2,199,251,239, 1, 92, 1,103, 87, 47, 3,206,175,103,106,106,106,239, 32, 57, 1, 36,149, -165, 16, 18,131,155,234,254,218,100,224,161, 65,140,190,190,190,156,161,158, 85, 0, 1, 0,178, 0, 0, 5,161, 5,242, 0, 24, - 0, 0, 1, 17, 35, 17, 6, 7, 6, 29, 1, 35, 53, 16, 55, 54, 33, 32, 23, 22, 25, 1, 35, 17, 52, 39, 38, 3,144,203,136, 75, -117,203,174,145, 1, 57, 1, 41,159,175,203,117, 66, 5, 71,252,148, 3,108, 19, 80,124,221, 32, 57, 1, 5,180,149,149,163,254, -234,252, 92, 3,139,204,141, 80, 0, 2, 0,155,255, 8, 4,186, 5,240, 0, 29, 0, 43, 0, 0, 37, 38, 39, 38, 17, 52, 0, 51, - 32, 23, 22, 3, 2, 3, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, 17, 51, 21, 33, 55, 54, 55, 54, 39, 38, 39, 38, 32, 6, - 21, 20, 23, 22, 2,162, 69,240,202, 1, 16,226, 1, 8,131,155, 58, 52,231,149, 95, 96,156, 48, 55, 81,253, 53,203, 1, 20,171, -101, 15, 63, 28, 25, 55, 79,254,240,159,151,163,220,220,170,142, 1, 4,230, 1, 22,198,234,254,169,254,207,254,247, 91, 91,171, - 70, 49,108, 42, 49, 1, 76,157,195,194, 44,189,215,190, 64, 94,187,161,170,116,126, 0, 0, 0, 0, 1, 0,178, 0, 0, 6,196, - 5,242, 0, 31, 0, 0, 1, 51, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 43, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, - 16, 0, 33, 32, 23, 22, 5, 23, 89,149, 95, 96,156, 48, 55, 81, 71,203,174,194,195,174,203, 1, 33, 1, 27, 1, 26,144, 90, 4, - 96, 91, 91,171, 70, 49,108, 42, 49,252, 79, 3,139,240,211,211,240,252,117, 3,164, 1, 36, 1, 42,149, 92, 0,255,255, 0,178, -255,227, 5, 41, 5,213, 18, 6, 0, 56, 0, 0, 0, 1, 0,178,255, 8, 6,196, 5,213, 0, 32, 0, 0, 41, 1, 50, 23, 22, 29, - 1, 51, 53, 52, 39, 38, 43, 1, 17, 35, 17, 20, 7, 6, 35, 34, 38, 61, 1, 35, 21, 16, 23, 22, 33, 50, 55, 4, 94, 1, 18, 81, - 55, 48,156, 96, 95,149, 71,203, 87, 89,193,194,174,203,144,152, 1, 19,209,160, 49, 42,108, 49, 70,171, 91, 91, 5, 38,253,243, -242,104,105,211,240,152,177,254,215,144,149,100,255,255, 0,135,255,227, 4,162, 5,240, 18, 6, 0, 54, 0, 0, 0, 1, 0,178, - 0, 0, 5, 41, 5,242, 0, 18, 0, 0, 51, 17, 16, 0, 33, 32, 23, 22, 17, 21, 35, 53, 52, 38, 35, 34, 6, 21, 17,178, 1, 33, - 1, 27, 1, 19,151,145,203,174,194,195,174, 3,164, 1, 36, 1, 42,149,142,254,213, 57, 32,240,211,211,240,252,117, 0, 0, 0, - 0, 2, 0,140,255,227, 5, 83, 5,242, 0, 43, 0, 57, 0, 0, 1, 30, 1, 21, 20, 4, 32, 36, 53, 51, 20, 23, 22, 32, 54, 53, - 52, 38, 35, 34, 7, 6, 7, 34, 35, 54, 55, 54, 55, 38, 39, 38, 53, 52, 55, 54, 33, 32, 23, 22, 21, 20, 7, 6, 1, 34, 7, 6, - 21, 20, 22, 51, 50, 54, 53, 52, 39, 38, 4, 30,146,163,254,247,253, 74,254,248,202, 82, 83, 1,232,166,165,245,226,101, 31, 5, -102,103, 3, 35, 82,146,129, 72, 74,155,147, 1, 19, 1, 20,147,155, 73, 73,254, 80,180, 97, 99,147,229,230,147, 99, 97, 3, 87, - 34,198,175,245,232,231,246,162, 78, 77,155,162,167,154, 77, 28, 12, 28, 42, 99, 34, 32, 89, 91,128,143, 96, 88, 88, 94,145,128, - 91, 89, 1,217, 48, 49, 89,116,130,130,116, 89, 49, 48, 0, 0, 0, 1, 0,178, 0, 0, 6, 12, 5,213, 0, 21, 0, 0, 1, 53, - 52, 38, 35, 34, 7, 6, 21, 17, 35, 17, 51, 17, 54, 51, 32, 23, 22, 23, 51, 21, 4, 94,174,194,193, 89, 87,203,203,160,209, 1, - 19,151,117, 24,231, 1,219, 50,240,211,106,103,242,253,243, 5,213,254, 59,100,149,115,226,175,255,255, 0,115, 0, 0, 5,217, - 5,213, 18, 6, 2,196, 0, 0, 0, 2, 0, 92, 0, 0, 5,227, 5,242, 0, 44, 0, 60, 0, 0, 1, 17, 52, 55, 54, 51, 50, 23, - 22, 21, 20, 7, 6, 35, 34, 39, 21, 33, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 35, 33, 17, 35, 17, 35, 34, 39, 38, 61, 1, 51, - 21, 20, 23, 22, 51, 1, 6, 7, 6, 21, 20, 23, 22, 23, 22, 55, 54, 53, 52, 39, 38, 1,208,146,141,235,244,132,145,145,132,244, -246, 73, 1,244,149, 95, 96,156, 48, 55, 81,254, 12,203, 32,149, 95, 96,156, 48, 55, 81, 2, 42,138, 93, 87, 87, 93,138,136, 95, - 87, 87, 95, 2,114, 2, 8,149,115,112,112,122,144,149,122,112, 83,218, 91, 91,171, 70, 49,108, 42, 49,254, 61, 1,195, 91, 91, -171, 70, 49,108, 42, 49, 2,220, 1, 65, 62, 84, 93, 61, 66, 1, 1, 68, 61, 91, 86, 62, 67, 0,255,255, 0,115,255,227, 5,217, - 5,240, 18, 6, 0, 50, 0, 0, 0, 3, 0,135,255,227, 4,162, 5,240, 0, 8, 0, 19, 0, 46, 0, 0, 1, 17, 54, 55, 54, 53, - 52, 39, 38, 1, 17, 52, 39, 34, 7, 6, 21, 20, 23, 22, 5, 23, 30, 1, 21, 20, 4, 33, 34, 38, 39, 53, 22, 23, 22, 23, 17, 38, - 39, 38, 53, 52, 55, 54, 51, 50, 21, 2,185,113, 71, 94, 67, 67,254,188, 57, 53, 43, 26, 60, 38, 1, 5, 48,226,215,254,221,254, -231,106,239,128,123,118, 69, 66,190, 91,101, 75, 91,165,231, 2,148,253,248, 11, 52, 68,126,110, 62, 61, 1, 18, 1,132, 62, 2, - 64, 37,145, 99, 51, 31, 65, 10, 43,217,182,217,224, 48, 47,208, 69, 35, 20, 10, 2, 44, 44, 87, 96,171,215, 97,114,201, 0, 0, -255,255, 0,117, 3,239, 1,135, 6, 20, 16, 6, 2, 24, 0, 0,255,255, 0,178, 3,254, 1,215, 5,213, 16, 6, 2, 21, 0, 0, - 0, 1, 0, 94, 4,241, 3,169, 6,194, 0, 3, 0, 0, 1, 35, 1, 51, 1, 51,213, 2,118,213, 4,241, 1,209, 0, 1, 0,120, - 4,241, 3,134, 7, 37, 0, 17, 0, 0, 1, 34, 7, 6, 21, 35, 52, 55, 54, 51, 50, 55, 54, 53, 51, 20, 7, 6, 1,255, 91, 82, - 66,152,104,106,181, 91, 82, 66,152,104,106, 5,205, 84, 68, 68,130,106,108, 84, 68, 68,130,106,108, 0, 0, 0,255,255, 0,158, - 4,240, 2,125, 6,102, 16, 6, 0, 67,244, 0, 0, 1, 0, 94, 4,229, 3,189, 7, 55, 0, 21, 0, 0, 19, 35, 52, 55, 18, 33, - 32, 23, 18, 33, 34, 17, 51, 20, 51, 50, 39, 38, 39, 38, 7, 6,252,158, 32,113, 1, 51, 1, 85, 55, 75,254,193,251,152, 97,121, - 38, 34,205,206, 57, 25, 4,241,211, 83, 1, 32,252,254,170, 1, 8,122,158,140, 2, 1,179, 78, 0, 1, 0, 90, 4,241, 3,178, - 7, 37, 0, 5, 0, 0, 27, 1, 51, 3, 33, 21, 90,170,170,125, 2,129, 4,241, 2, 52,254, 98,150, 0, 0, 0, 0, 1, 0,186, -255,230, 7, 29, 4, 98, 0, 38, 0, 94, 64, 17, 0, 18, 20, 30, 27, 8, 29, 80, 18, 8, 20, 80, 10, 8, 8, 70, 39, 16,252,236, -252,252,252,252, 60, 17, 18, 57, 49, 64, 22, 7, 20, 10, 26, 17, 0, 6, 31, 8, 13, 23,135, 31, 4, 35,140, 29, 27, 18, 8,188, - 29, 0, 47,244, 60, 60, 16,244, 60,196,236, 50, 17, 18, 23, 57, 48, 64, 19, 48, 40, 80, 40,112, 40,144, 40,160, 40,160, 40,191, - 40,223, 40,255, 40, 9, 1, 93, 37, 6, 7, 6, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 55, 54, 53, 17, 51, 17, 20, 22, 51, - 50, 54, 53, 17, 51, 17, 35, 53, 6, 7, 6, 35, 34, 39, 38, 3,174, 69, 96, 96,130,175,190,185,114,117,143, 83, 83,185,114,119, -141,166,185,185, 63, 88, 88,121,122, 86, 85,216,124, 58, 60,246,226, 2,164,253, 98,162,156, 96, 94,164, 2,122,253, 98,162,156, -192,162, 2,122,251,160,174,104, 48, 50, 62, 62, 0, 1, 0,186,254, 86, 4,100, 4,123, 0, 23, 0, 63, 64, 30, 1, 7, 22, 3, - 16, 10, 4,135, 16, 19,184, 14,188, 10, 23, 9,169, 10, 0, 8, 9, 22, 78, 11, 15, 7, 8, 13, 70, 24, 16,252,236, 50, 50,244, - 60,236, 49, 0, 47,252,204, 16,228,244,196,236, 17, 18, 23, 57, 48,180, 96, 25,207, 25, 2, 1, 93, 1, 17, 52, 38, 35, 34, 6, - 21, 17, 33, 21, 33, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 21, 17, 3,172,124,124,149,172, 2,241,253, 15,185,185, 66,179,117, -193,198, 1, 44, 1,114,159,158,190,164,254, 54,175,254, 86, 6, 10,174,101,100,239,232,254,136, 0, 2, 0,113,254, 86, 5, 47, - 4,123, 0, 11, 0, 32, 0, 60, 64, 14, 34, 30, 26, 14, 6, 8, 12, 28, 71, 0, 18, 20, 69, 33, 16,252,236,244, 60,236, 50, 50, -220,212, 49, 64, 18, 3,185, 14, 17, 9,185, 26, 23,184, 17,140, 30,169, 12,189, 27,188, 33, 0, 16,228,228,236,228,244,196,236, - 16,198,238, 48, 1, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, 6, 1, 35, 17, 14, 1, 35, 34, 2, 17, 16, 0, 51, 50, 22, 23, 53, - 51, 17, 51, 21, 35, 1, 47,167,146,146,168,168,146,146,167, 3, 43,184, 58,177,124,203,255, 0,255,203,124,177, 58,184,213,213, - 2, 47,203,231,231,203,203,231,231,251, 92, 2, 82,100, 97, 1, 68, 1, 8, 1, 8, 1, 68, 97,100,170,252, 79,175, 0, 0, 0, - 0, 1, 0,186,254, 86, 5, 57, 4,123, 0, 23, 0, 61, 64, 13, 25, 22, 3, 8, 0, 21, 78, 9, 13, 8, 12, 70, 24, 16,252,236, - 50,244, 60,236,220,196, 49, 64, 13, 6,135, 14, 17,184, 12,188, 2,189, 21,169, 11, 0, 0, 47, 60,236,236,228,244,196,236,181, - 9, 3, 20, 3, 14, 10, 17, 18, 23, 57, 48, 33, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 21, - 17, 51, 21, 4,100,184,124,124,149,172,185,185, 66,179,117,193,198,213,254, 86, 4, 72,159,158,190,164,253,135, 4, 96,174,101, -100,239,232,254, 11,175, 0, 0, 0, 1, 0,174,255,227, 4, 88, 6, 20, 0, 26, 0, 63, 64, 30, 7, 15, 0, 3, 20, 3, 11,135, - 20, 23,140, 18, 17, 5,169, 4,188, 18, 19, 15, 8, 4, 17, 78, 6, 2, 8, 0, 70, 27, 16,252,236, 50,244, 60,236, 50, 49, 0, - 47,244,252,204, 16,244,196,236, 17, 18, 23, 57, 48,180, 96, 28,207, 28, 2, 1, 93, 19, 17, 51, 17, 33, 21, 33, 17, 20, 23, 22, - 51, 50, 55, 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 39, 38,174,184, 2,242,253, 14, 62, 62,124,152, 84, 86,184,184, 67,177, -117,193,100,100, 1,186, 4, 90,254, 76,170,254, 11,159, 80, 79, 95, 98,161, 1, 59,252,224,172,102, 99,120,120, 0, 2, 0,113, -254, 86, 5, 47, 4,123, 0, 18, 0, 30, 0, 60, 64, 13, 32, 1, 16, 4, 25, 8, 18, 71, 19, 18, 10, 69, 31, 16,252,236,244,236, - 50, 50,220,212, 49, 64, 19, 22,185, 4, 7, 28,185, 16, 13,184, 7,140, 31, 1,169, 2,189, 17,188, 31, 0, 16,228,244,236, 16, -228,244,196,236, 16,198,238, 48, 1, 51, 21, 33, 17, 14, 1, 35, 34, 2, 17, 16, 0, 51, 50, 22, 23, 53, 51, 1, 20, 22, 51, 50, - 54, 53, 52, 38, 35, 34, 6, 4, 90,213,254,115, 58,177,124,203,255, 0,255,203,124,177, 58,184,252,213,167,146,146,168,168,146, -146,167,254,248,162, 2, 82,100, 97, 1, 68, 1, 8, 1, 8, 1, 68, 97,100,170,253,207,203,231,231,203,203,231,231, 0, 0, 0, - 0, 1, 0,174,255, 26, 3,224, 6, 20, 0, 19, 0, 44, 64, 12, 21, 5, 15, 18, 14, 5, 8, 3, 8, 1, 70, 20, 16,252,252, 60, -220,212,236, 16,196, 49, 64, 10, 7,169, 4,188, 14, 9,169, 2,151, 1, 0, 47,228,236,204,244,236, 48, 41, 1, 17, 51, 17, 33, - 21, 33, 17, 51, 50, 23, 22, 29, 1, 35, 53, 52, 39, 38, 2, 83,254, 91,184, 2,122,253,134,237,152, 77, 96,156, 48, 49, 6, 20, -254, 76,170,252,249, 73, 91,171, 70, 49,105, 38, 38, 0, 0, 0, 0, 1, 0,186,254, 86, 4,100, 4,123, 0, 21, 0, 62, 64, 30, - 1, 7, 20, 3, 14, 21, 4,135, 14, 17,184, 12,188, 21, 9,169, 10,189, 21, 0, 8, 9, 20, 78, 13, 7, 8, 11, 70, 22, 16,252, -236, 50,244, 60,236, 49, 0, 47,252,236, 16,228,244,196,236, 17, 18, 23, 57, 48,180, 96, 23,207, 23, 2, 1, 93, 33, 17, 52, 38, - 35, 34, 6, 21, 17, 33, 21, 33, 17, 51, 21, 62, 1, 51, 50, 22, 21, 17, 3,172,124,124,149,172, 2,241,252, 86,185, 66,179,117, -193,198, 2,158,159,158,190,164,252,140,175, 6, 10,174,101,100,239,232,253, 92, 0, 2, 0,186,254, 86, 5, 54, 4,123, 0, 32, - 0, 41, 0,117, 64, 12, 43, 19, 1, 18, 18, 71, 7, 11, 8, 9, 70, 42, 16,252,236, 50,244,236,220,196,179, 36, 18, 29, 7, 16, -220,252,179, 33, 18, 21, 18, 16,212,236,178, 0, 33, 36, 73, 83, 88,179, 29, 9, 36, 7, 16, 60, 16, 60, 89, 49, 64, 15, 38,185, - 25,140, 42, 4,185, 12, 15,184, 11,188, 9,189, 42, 0, 16,236,228,244,196,236, 16,244,236, 64, 6, 18, 1,169, 21, 33, 38, 16, -220, 60,252, 60,178, 0, 4, 1, 73, 83, 88,181, 18, 1,169, 21, 33, 38, 16, 60, 60,252, 60, 89, 48, 1, 51, 52, 38, 35, 34, 6, - 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 0, 17, 51, 21, 35, 6, 7, 6, 7, 6, 39, 38, 53, 52, 55, 54, 5, 35, 34, 23, 22, 51, - 50, 55, 54, 3, 35,194,167,146,146,167,185,185, 58,177,123,204, 0,255,146,162, 29, 53, 96,172,160, 52,120, 66,100, 1, 66,152, -159, 5, 5,139, 74, 52, 28, 2, 47,203,231,231,203,252, 39, 6, 10,170,100, 97,254,188,254,248,175,161, 90,161, 1, 2, 43,104, -124,123, 78,118,175,144,113,113, 60, 0, 0, 0, 0, 2, 0,113,255,227, 5, 47, 6, 20, 0, 12, 0, 31, 0, 52, 64, 13, 33, 30, - 0, 27, 8, 13, 29, 71, 5, 18, 21, 69, 32, 16,252,236,244, 60,236, 50,220,196, 49, 64, 14, 8,185, 18,140, 32, 31, 0,169, 26, - 29,188, 28,151, 32, 0, 16,228,244, 60,252, 60, 16,244,236, 48, 1, 33, 34, 7, 6, 21, 20, 22, 51, 50, 55, 54, 53, 19, 17, 16, - 5, 6, 35, 34, 2, 17, 52, 55, 54, 51, 33, 17, 51, 17, 51, 21, 3,162,254,198,136, 98, 79,167,146,154, 77, 83,184,254,236, 75, -149,246,255,127,125,249, 1, 60,184,213, 3,182,122, 97,172,203,231,107,115,212, 1,135,254, 67,254,175,154, 43, 1, 68, 1, 8, -223,171,167, 1,180,254, 76,170, 0, 1, 0,186,254, 86, 4,100, 6, 20, 0, 19, 0, 53, 64, 26, 3, 9, 0, 3, 14, 1, 6,135, - 14, 17,184, 12,151, 10,189, 1, 2, 8, 0, 78, 13, 9, 8, 11, 70, 20, 16,252,236, 50,244,236, 49, 0, 47,236,236,244,196,236, - 17, 18, 23, 57, 48,178, 96, 21, 1, 1, 93, 1, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, 17, 62, 1, 51, 50, 22, 4, -100,184,124,124,149,172,185,185, 66,179,117,193,198, 2,164,253, 92, 2,158,159,158,190,164,251,221, 7,190,253,158,101,100,239, - 0, 1, 0,193,254, 86, 2,215, 4, 96, 0, 5, 0, 32, 64, 7, 7, 1, 5, 8, 3, 70, 6, 16,252,252,212,196, 49, 0, 64, 8, - 4,188, 6, 0,169, 3,189, 6, 16,244,228, 16,228, 48, 1, 33, 21, 33, 17, 51, 1,121, 1, 94,253,234,184,254,248,162, 6, 10, - 0, 1, 0,186,254, 86, 7, 28, 6, 20, 0, 40, 0,105, 64, 15, 32, 29, 8, 31, 80, 40, 8, 20, 80, 8, 11, 8, 9, 70, 41, 16, -252,236, 50,244,252,244,252, 60, 49, 64, 18, 4,135, 12, 16,184, 31, 25,135, 33, 36,140, 29,188, 10,151, 8,189, 31, 0, 47,236, -228,228,244,196,236, 16,244,196,236,181, 40, 21, 28, 3, 33, 29, 17, 18, 23, 57,181, 20, 0, 7, 3, 12, 32, 17, 18, 23, 57, 48, - 64, 19, 48, 41, 80, 41,112, 41,144, 41,160, 41,160, 41,191, 41,223, 41,255, 41, 9, 1, 93, 1, 52, 39, 38, 35, 34, 6, 21, 17, - 35, 17, 51, 17, 54, 55, 54, 51, 50, 23, 22, 29, 1, 20, 23, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 39, 38, 53, - 3,143, 62, 62,124,120,172,185,185, 99, 38, 89,107,193, 99, 99, 62, 56,110,140,173,184,184, 67,177,108,175, 98,100, 2,158,159, - 79, 79,190,164,251,221, 7,190,253,158,129, 22, 50,119,120,232,227,151, 88, 79,190,164, 2,123,251,160,172,102, 99,120,123,228, - 0, 2, 0,113,255,226, 4,188, 6, 20, 0, 14, 0, 48, 0, 92, 64, 11, 50, 32, 12, 18, 36, 71, 5, 18, 44, 69, 49, 16,252,236, -244,236,220,196,180, 18, 18, 27, 23, 44, 16,220,220,236, 49, 64, 17, 1, 32,169, 48, 31,188, 49, 24,169, 23,151, 49, 8,185, 40, -140, 49, 0, 16,244,236, 16,244,236, 16,244, 60,252, 60, 48,180, 33, 30, 34, 29, 34, 5, 7, 16, 60, 60,181, 0, 17, 33, 15, 17, - 30, 16,236, 16,236,178, 14, 16, 0, 16, 60, 60, 1, 35, 34, 7, 6, 21, 20, 22, 51, 50, 55, 54, 55, 54, 39, 1, 39, 38, 53, 52, - 55, 54, 59, 1, 21, 35, 38, 23, 22, 31, 1, 33, 21, 33, 19, 22, 21, 20, 7, 6, 39, 38, 39, 38, 17, 52, 55, 54, 51, 2,195, 91, -165, 65, 83,167,146,173, 93, 46, 3, 2, 23,254,221, 83, 22, 68, 56, 49,147, 78, 47, 1, 1, 15, 86, 1,144,254,201,174, 33,133, -135,226,247,127,127,127,113,218, 3,182, 90,115,186,203,231,150, 73, 82, 92, 43, 2, 43,152, 40, 86, 76, 45, 37,175, 1, 41, 36, - 27,158,170,254,182, 63,137,166,141,143, 1, 1,161,162, 1, 8,235,174,152, 0, 0, 1, 0,174,254, 86, 4, 88, 6, 20, 0, 19, - 0, 58, 64, 28, 3, 9, 0, 3, 14, 10, 6,135, 14, 17,140, 1,151, 10,188, 12,189, 20, 13, 9, 8, 11, 78, 2, 8, 0, 70, 20, - 16,252,236,244,236, 50, 49, 0, 16,236,228,228,244,196,236, 17, 18, 23, 57, 48,180, 96, 21,207, 21, 2, 1, 93, 19, 17, 51, 17, - 20, 22, 51, 50, 54, 53, 17, 51, 17, 35, 17, 14, 1, 35, 34, 38,174,184,124,124,149,173,184,184, 67,177,117,193,200, 1,186, 4, - 90,251,173,159,159,190,164, 2,123,249,246, 2, 86,102, 99,240,255,255, 0,186, 0, 0, 4,100, 6, 20, 18, 6, 0, 75, 0, 0, - 0, 2, 0,113,255,227, 4, 90, 6, 20, 0, 11, 0, 52, 0,101, 64, 10, 18, 6, 8, 16, 71, 0, 18, 25, 69, 53, 16,252,236,244, -252, 60, 64, 13, 40, 18, 39, 39, 42, 37, 37, 18, 42, 30, 18, 51, 16, 16,220,252,212,236, 17, 18, 57, 47,236,178, 12, 16, 28, 17, - 18, 57, 49, 64, 16, 46,169, 32, 9,185, 28,184, 18, 3,185, 19, 22,140, 39,151, 18, 0, 47,228,244,196,236, 16,244,236,220,236, -178, 12, 9, 28, 17, 18, 57, 48, 64, 9, 96, 54,128, 54,160, 54,224, 54, 4, 1, 93, 1, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, - 6, 1, 22, 23, 22, 25, 1, 35, 53, 14, 1, 35, 34, 2, 17, 16, 0, 51, 50, 53, 38, 43, 1, 34, 39, 38, 53, 52, 55, 51, 6, 21, - 20, 23, 22, 59, 1, 50, 23, 22, 21, 20, 1, 47,167,146,146,168,168,146,146,167, 1,233,110, 68,144,184, 58,177,124,203,255, 1, - 0,202, 87, 1, 67,118, 62, 31, 30, 33,184, 37, 8, 17, 26,147, 55, 41, 29, 2, 47,203,231,231,203,203,231,231, 1,107, 29, 80, -168,254,219,253,213,168,100, 97, 1, 68, 1, 8, 1, 8, 1, 69, 60, 54, 29, 29,112, 71, 53, 80, 48, 14, 7, 15, 44, 33, 75, 55, - 0, 1, 0,186,254, 86, 5, 57, 4,123, 0, 21, 0, 59, 64, 12, 23, 0, 3, 8, 21, 78, 9, 13, 8, 12, 70, 22, 16,252,236, 50, -244,236,220,196, 49, 64, 13, 6,135, 14, 17,184, 12,188, 11, 0,169, 2,189, 11, 0, 47,252,236, 16,228,244,196,236,181, 9, 3, - 20, 3, 14, 10, 17, 18, 23, 57, 48, 1, 21, 33, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 21, 17, 5, - 57,254,115,124,124,149,172,185,185, 66,179,117,193,198,254,248,162, 4, 72,159,158,190,164,253,135, 4, 96,174,101,100,239,232, -252, 84, 0, 0, 0, 2, 0,174,255,227, 4, 88, 6, 20, 0, 29, 0, 45, 0, 98, 64, 12, 2, 40, 8, 20, 0, 78, 32, 8, 14, 10, - 70, 46, 16,252, 60,236,244, 60,236, 50,182, 16, 13, 45, 26, 4, 0, 14, 17, 18, 23, 57,183, 25, 8, 16, 30, 8, 13, 16, 13, 7, - 16,236, 16,236, 1,176, 13, 47, 49, 64, 18, 37,135, 3, 6,140, 1, 30, 14,169, 25, 15,188, 1, 21,134, 20,151, 1, 0, 47,244, -236, 16,244, 60,252, 60, 16,244,196,236,181, 33, 10, 40, 3, 15, 3, 17, 18, 23, 57, 48, 1, 17, 35, 53, 14, 1, 35, 34, 39, 38, - 61, 1, 52, 55, 35, 53, 51, 54, 55, 36, 55, 21, 6, 7, 6, 7, 51, 50, 23, 22, 37, 6, 29, 1, 20, 23, 22, 51, 50, 54, 61, 1, - 52, 39, 38, 35, 4, 88,184, 67,177,117,195, 98,100,122,122,218,112,152, 1, 27,173,141,221, 62, 66,105,176,130, 79,253,152,138, - 62, 65,121,149,173, 26, 99, 87, 2, 32,253,224,172,102, 99,120,123,228, 73,233,202,170,128, 96,174, 38,175, 36,132, 37, 56,195, -118,143,198,229, 74,162, 77, 79,190,164, 59,207, 41,158, 0, 0, 0, 1, 0,174,255,227, 5, 10, 6, 20, 0, 43, 0, 63, 64, 15, - 45, 23, 17, 18, 28, 37, 9, 8, 36, 78, 2, 8, 0, 70, 44, 16,252,236,244,236, 50,220,236,220,196, 49, 64, 19, 0, 3, 9, 3, - 38, 1, 23,169, 22,151, 36, 6,135, 38, 41,140, 1,188, 36, 0, 47,228,244,196,236, 16,244,236, 17, 18, 23, 57, 48, 19, 17, 51, - 17, 20, 22, 51, 50, 54, 53, 17, 52, 39, 38, 47, 1, 38, 55, 54, 55, 54, 59, 1, 21, 35, 34, 7, 6, 21, 20, 31, 1, 22, 23, 22, - 21, 17, 35, 53, 14, 1, 35, 34, 38,174,184,124,124,149,173, 3, 3, 10, 77, 46, 1, 4, 61, 60,139,236,236, 40, 21, 24, 17, 96, - 19, 4, 7,184, 67,177,117,193,200, 1,186, 2,166,253, 97,159,159,190,164, 1,151, 19, 22, 32, 23,188,112, 48,129, 46, 45,175, - 9, 11, 23, 31, 42,243, 47, 23, 40, 20,252,132,172,102, 99,240,255,255,255,219,254, 86, 1,121, 4, 96, 18, 6, 1,249, 0, 0, - 0, 1, 0, 49,255,227, 5, 90, 6, 20, 0, 35, 0, 71, 64, 15, 37, 14, 11, 8, 12, 78, 3, 8, 22, 27, 33, 0, 18, 27, 36, 16, -212,252,204, 16,220,236,244,236, 50,196, 49, 64, 23, 10, 4, 21, 3, 15, 12, 33,169, 32,151, 13, 22,169, 3, 12,188, 13, 7,135, - 15, 18,140, 13, 0, 47,244,196,236, 16,244, 60,236, 16,244,236, 17, 18, 23, 57, 48, 19, 20, 59, 1, 17, 20, 22, 51, 50, 54, 53, - 17, 51, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 35, 34, 39, 38, 55, 54, 55, 54, 59, 1, 21, 35, 34,242,131,243,124,124,149,173, -184,184, 67,177,117,193,200, 59,149, 94, 83, 3, 3, 87,115,118, 89, 89,131, 4,234,138,253, 97,159,159,190,164, 2,123,251,160, -172,102, 99,240,231, 1,252, 94, 83,145,131, 66, 87,175, 0, 0, 0, 1, 0,159,254, 86, 3,150, 4,124, 0, 31, 0, 84, 64, 12, - 33, 69, 16, 18, 5, 29, 2, 18, 11, 22, 70, 32, 16,252, 60,236,212, 60,236,228, 49, 64, 13, 5,169, 6,189, 32, 22,134, 23, 20, -185, 25,184, 32, 0, 16,244,236,212,236, 16,252,236, 48, 64, 10, 0, 31, 29, 31, 17, 0, 17, 13, 14, 13, 7, 5, 16,236,236, 1, - 73, 80, 88,177, 31, 29, 16, 60, 89,179, 30, 31, 14, 13, 7, 4, 16, 60, 5, 6, 21, 20, 51, 33, 21, 33, 34, 39, 38, 39, 38, 55, - 1, 54, 39, 38, 39, 38, 7, 6, 7, 53, 54, 23, 22, 23, 22, 21, 20, 7, 1,134, 14, 47, 1,238,253,195, 87, 58, 37, 2, 2, 38, - 1,205, 68, 1, 1, 47, 67,141,120,188,188,161,195,132, 81, 69,192, 19, 21, 32,162, 69, 44, 65, 56, 56, 2,173,102, 93, 68, 64, - 90, 1, 1,120,198,106, 1, 1,170,104,136,154,101, 0, 0, 0,255,255, 0,186, 0, 0, 4,100, 4,123, 18, 6, 0, 81, 0, 0, - 0, 1, 0, 70,254, 86, 3, 59, 4, 96, 0, 37, 0, 88, 64, 17, 16, 18, 35, 35, 5, 26, 39, 5, 11, 26, 30, 18, 21, 2, 18, 11, - 38, 16,212,236,220,236,204, 16,220,196, 17, 18, 57, 47,236, 49, 64, 14, 35, 16, 5, 27, 27,169, 26,188, 38, 5,169, 6,189, 38, - 0, 16,252,236, 16,244,236, 17, 18, 57, 57, 48,182, 37, 17, 0, 17, 13, 14, 13, 7, 4, 16,236,236,182, 19, 17, 18, 17, 32, 33, - 32, 7, 4, 16,236,236, 5, 6, 21, 20, 51, 33, 21, 33, 34, 39, 38, 53, 52, 55, 1, 54, 55, 54, 47, 1, 38, 53, 52, 55, 54, 59, - 1, 21, 35, 38, 21, 20, 31, 1, 22, 21, 20, 7, 1, 40, 14, 51, 1,238,253,195, 87, 58, 39, 36, 1, 70, 31, 1, 2, 91,149, 76, - 22, 50,214,115,101, 96, 54,142,103, 43,182, 17, 33, 32,162, 69, 47, 62, 65, 47, 1,173, 40, 60, 69, 99,163, 83,101, 40, 50,122, -175, 1, 58, 46, 59,155,112,110,117, 57, 0, 0,255,255, 0, 0, 0, 0, 0, 0, 0, 0, 16, 6, 2, 6, 0, 0, 0, 2, 0,159, -254, 86, 3,150, 4,123, 0, 27, 0, 41, 0, 99, 64, 14, 43, 69, 40, 18, 5, 25, 2, 18, 11, 34, 18, 17, 69, 42, 16,252,236, 60, -236,212, 60,236,228, 49, 64, 10, 5,169, 6,189, 42, 30,185, 21,184, 42, 0, 16,244,236, 16,252,236, 48, 64, 11, 26, 27, 27, 17, - 0, 17, 37, 14, 13, 38, 13, 7, 5, 16, 60, 60,236,236, 4, 16, 60,178, 0, 27, 25, 1, 73, 80, 88,177, 27, 25, 16, 60, 89, 64, - 9, 37, 17, 36, 17, 14, 38, 13, 15, 14, 7, 8, 16,236,236, 5, 6, 21, 20, 51, 33, 21, 33, 34, 39, 38, 39, 38, 63, 1, 3, 38, - 53, 52, 55, 54, 51, 50, 23, 22, 21, 20, 7, 3, 38, 35, 34, 7, 6, 21, 20, 23, 27, 1, 54, 39, 38, 1,134, 14, 47, 1,238,253, -195, 87, 58, 37, 2, 2, 38,145,141, 40, 96, 91,175,212,115, 68, 69,159, 72,100, 59, 54, 59, 33, 88,191, 68, 1, 1,192, 19, 21, - 32,162, 69, 44, 65, 55, 57,217, 1,228,137, 70,163,109,103,171,101,139,154,101, 1,139, 89, 45, 49,103, 60,120,254,191, 1, 26, -101, 94, 89, 0, 0, 1, 0,186, 0, 0, 4,116, 4,123, 0, 28, 0,103, 64, 13, 28, 9, 2, 18, 25, 21, 78, 13, 9, 8, 11, 70, - 29, 16,252,236, 50,244, 60,236, 16,220, 49, 64, 12, 6,135, 14, 17,184, 12,188, 28, 25,169, 26, 10, 0, 47, 60,236, 50,228,244, -196,236,181, 21, 2, 9, 3, 14, 10, 17, 18, 23, 57, 48,177, 23, 0, 16, 60, 64, 8, 23, 17, 0, 24, 17, 28, 0, 28, 7, 5, 16, -236, 16,236, 1,178, 0, 23, 21, 73, 80, 88,177, 23, 21, 16, 60, 89,180, 96, 30,207, 30, 2, 1, 93, 1, 54, 55, 54, 39, 38, 35, - 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 23, 22, 21, 20, 7, 1, 33, 21, 33, 53, 3, 82, 90, 1, 1, 64, 62,124,149,172, -185,185, 66,179,117,205,127, 65, 71,254,250, 1, 87,253,223, 1,232,110,132, 96, 82, 79,190,164,253,135, 4, 96,174,101,100,185, - 94,119,176, 85,254,199,175,175,255,255, 0,174,255,227, 4, 88, 4, 96, 18, 6, 0, 88, 0, 0, 0, 1, 0,174,254, 86, 5, 45, - 6, 20, 0, 21, 0, 61, 64, 12, 23, 13, 15, 9, 8, 11, 78, 2, 8, 0, 70, 22, 16,252,236,244,236, 50,220,196, 49, 64, 21, 3, - 9, 0, 3, 16, 1, 6,135, 16, 19,140, 10,151, 1,188, 22, 13,169, 15,189, 22, 0, 16,252,236, 16,228,228,244,196,236, 17, 18, - 23, 57, 48, 19, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 51, 21, 33, 17, 14, 1, 35, 34, 38,174,184,124,124,149,173,184, -213,254,115, 67,177,117,193,200, 1,186, 2,166,253, 97,159,159,190,164, 4, 47,248,228,162, 2, 86,102, 99,240, 0, 1, 0,174, -255,227, 7, 28, 4,123, 0, 37, 0,105, 64, 15, 12, 8, 10, 80, 21, 1, 8, 2, 20, 80, 31, 8, 29, 70, 38, 16,252,236,252, 60, -252, 60,252,236, 49, 64, 17, 15,135, 3, 6,184, 10, 34,135, 22, 25,140, 10, 1, 29,188, 20, 10, 0, 47, 60,244, 60, 16,244,196, -236, 16,244,196,236,181, 28, 31, 0, 3, 22, 29, 17, 18, 23, 57,181, 9, 12, 19, 3, 3, 10, 17, 18, 23, 57, 48, 64, 19, 48, 39, - 80, 39,112, 39,144, 39,160, 39,160, 39,191, 39,223, 39,255, 39, 9, 1, 93, 1, 17, 51, 21, 62, 1, 51, 50, 22, 21, 17, 35, 17, - 52, 38, 35, 34, 7, 6, 21, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 55, 54, 3,143,184, 66,179, 89,193, -198,184,124,124,122, 85, 86,184, 67,177,100,193,200,184,124,124,130, 88, 87, 1,229, 2,123,174,101,100,239,232,253, 92, 2,158, -159,158, 95, 96,163,253,135,172,102, 99,240,231, 2,166,253, 97,159,159, 95, 92, 0, 1, 0,186,254, 86, 4,100, 4,123, 0, 19, - 0, 55, 64, 26, 3, 9, 0, 3, 14, 1, 6,135, 14, 17,184, 12,188, 10,189, 1, 2, 8, 0, 78, 13, 9, 8, 11, 70, 20, 16,252, -236, 50,244,236, 49, 0, 47,236,228,244,196,236, 17, 18, 23, 57, 48,180, 96, 21,207, 21, 2, 1, 93, 1, 17, 35, 17, 52, 38, 35, - 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 4,100,184,124,124,149,172,185,185, 66,179,117,193,198, 2,164,253, 92, 2, -158,159,158,190,164,251,221, 6, 10,174,101,100,239, 0, 0, 0,255,255, 0,113,254, 86, 4, 90, 4,123, 18, 6, 0, 74, 0, 0, - 0, 1, 0,193, 0, 0, 2,215, 4, 96, 0, 5, 0, 29, 64, 7, 7, 1, 5, 8, 3, 70, 6, 16,252,252,212,196, 49, 0, 64, 6, - 4,188, 3, 1,169, 2, 47,236, 16,228, 48, 37, 33, 21, 33, 17, 51, 1,121, 1, 94,253,234,184,175,175, 4, 96, 0, 1, 0,174, -254, 86, 7, 28, 6, 20, 0, 37, 0,107, 64, 15, 12, 8, 10, 80, 21, 1, 8, 2, 20, 80, 31, 8, 29, 70, 38, 16,252,236,252, 60, -252, 60,252,236, 49, 64, 19, 15,135, 3, 6,184, 10, 34,135, 22, 25,140, 10, 29,188, 1,151, 20,189, 10, 0, 47,236,228,244, 16, -244,196,236, 16,244,196,236,181, 28, 31, 0, 3, 22, 29, 17, 18, 23, 57,181, 9, 12, 19, 3, 3, 10, 17, 18, 23, 57, 48, 64, 19, - 48, 39, 80, 39,112, 39,144, 39,160, 39,160, 39,191, 39,223, 39,255, 39, 9, 1, 93, 1, 17, 51, 17, 62, 1, 51, 50, 22, 21, 17, - 35, 17, 52, 38, 35, 34, 7, 6, 21, 17, 35, 17, 14, 1, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 55, 54, 3,143,184, 66,179, - 89,193,198,184,124,124,118, 89, 86,184, 67,177,100,193,200,184,124,124,130, 88, 87, 1,229, 4, 47,253,158,101,100,239,232,253, - 92, 2,158,159,158, 95, 92,167,251,221, 2, 86,102, 99,240,231, 2,166,253, 97,159,159, 95, 92, 0, 2, 0, 0,254, 86, 4,191, - 4,123, 0, 24, 0, 36, 0, 85, 64, 16, 38, 69, 11, 19, 25, 18, 11, 71, 31, 22, 4, 18, 8, 23, 2, 1, 47,220, 60,236, 50, 50, - 50,244,236,196, 16,228, 49, 64, 22, 34,185, 17, 14, 28,185, 5, 8,184, 14,140, 37, 20, 24,169, 18, 2, 22,189, 3,188, 37, 0, - 16,228,236,220, 60,252, 60, 16,228,244,196,236, 16,196,238,178, 0, 22, 24, 73, 80, 88,177, 22, 24, 16, 60, 89, 48, 21, 53, 51, - 17, 51, 21, 62, 1, 51, 50, 0, 17, 16, 2, 35, 34, 38, 39, 17, 33, 21, 33, 21, 35, 53, 1, 52, 38, 35, 34, 6, 21, 20, 22, 51, - 50, 54,213,185, 58,177,123,204, 0,255,255,204,123,177, 58, 2,233,253, 23,185, 3, 43,167,146,146,167,167,146,146,167,250,150, - 4,196,170,100, 97,254,188,254,248,254,248,254,188, 97,100,254,244,150,176,176, 3, 41,203,231,231,203,203,231,231, 0, 0, 0, -255,255, 0,113,255,227, 4,117, 4,123, 18, 6, 0, 82, 0, 0, 0, 3, 0,122,254, 86, 4,150, 6, 43, 0, 34, 0, 45, 0, 54, - 0,117, 64, 17, 56, 51, 18, 28, 32, 22, 46, 8, 0, 35, 10, 42, 18, 5, 14, 69, 55, 16,252, 60,236,220, 60, 60,252, 60, 60,220, -236,196, 49, 64, 18, 5,134, 4, 38,185, 18,151, 55, 47, 9,135, 4, 32, 0,140, 34,189, 55, 0, 16,236,244, 60,196,236, 50, 16, -244,236, 16,236,179, 23, 35, 0, 18, 17, 18, 57, 57,178, 14, 35, 18, 17, 18, 57,182, 26, 51, 46, 10, 4, 32, 23, 17, 18, 23, 57, - 48,180, 23, 35, 24, 24, 44, 7, 4, 16, 60, 60,181, 46, 17, 23, 10, 17, 35, 16,236, 16,236, 5, 38, 39, 38, 39, 53, 22, 23, 22, - 23, 17, 38, 39, 38, 53, 52, 55, 54, 55, 54, 23, 22, 21, 17, 23, 22, 23, 22, 21, 16, 7, 6, 35, 17, 35, 25, 1, 52, 39, 38, 7, - 6, 21, 22, 23, 22, 5, 17, 50, 55, 54, 53, 52, 39, 38, 2, 44, 68,100,125,141, 49,211, 75, 99,231,102,101,112, 95,152,123, 53, - 83, 35,194, 97,108,146,126,162,184, 69, 85, 24, 64, 1, 59, 39, 1, 71, 93, 55, 95, 69, 56, 24, 2, 17, 21, 71,187, 31, 73, 26, - 1, 2,163, 45, 97, 96,165,147,113, 96, 1, 2, 52, 79,148,254,169, 7, 45, 98,108,235,254,218,105, 90,254,110, 5,141, 1, 33, -115, 3, 2, 29, 79, 59,115, 58, 36,246,253,129, 43, 73,191,179, 74, 62, 0, 0, 0, 1, 0,174,255,227, 5,182, 6, 20, 0, 21, - 0, 56, 64, 12, 23, 13, 15, 9, 8, 11, 78, 2, 8, 0, 70, 22, 16,252,236,244,236, 50,220,196, 49, 64, 18, 3, 9, 0, 3, 16, - 10, 6,135, 16, 19,140, 1,151, 10,188, 13,169, 15, 0, 47,236,228,228,244,196,236, 17, 18, 23, 57, 48, 19, 17, 51, 17, 20, 22, - 51, 50, 54, 53, 17, 51, 17, 33, 21, 33, 53, 14, 1, 35, 34, 38,174,184,124,124,149,173,184, 1, 94,253,234, 67,177,117,193,200, - 1,186, 4, 90,251,173,159,159,190,164, 2,123,252, 79,175,172,102, 99,240, 0, 0, 2, 0,240, 0, 0, 1,195, 3, 82, 0, 3, - 0, 7, 0, 29, 64, 7, 5, 1, 3, 4, 0, 24, 8, 16,252, 60,236, 50, 49, 0, 64, 6, 6,131, 4, 0,131, 2, 47,236, 47,236, - 48, 55, 51, 21, 35, 17, 51, 21, 35,240,211,211,211,211,254,254, 3, 82,254, 0, 0, 1, 0, 96, 1,164, 3, 33, 2,238, 0, 11, - 0, 0, 1, 30, 1, 55, 21, 14, 1, 34, 38, 39, 51, 22, 1, 85, 32,222,205, 44,228,255,157, 20,167, 16, 2, 99, 24, 1, 65,162, - 14, 55,170,159, 87, 0, 0, 0, 0, 1, 0,219, 0, 0, 2, 0, 1,236, 0, 5, 0, 0, 33, 35, 53, 19, 51, 3, 1,174,211,164, -129, 82,172, 1, 64,254,192, 0,255,255, 0, 16,253, 46, 5,104, 5,213, 16, 39, 2, 70, 0,183, 0, 0, 18, 2, 0, 36, 0, 0, -255,255, 0,123,253, 46, 4, 45, 4,123, 16, 38, 2, 70,107, 0, 18, 2, 0, 68, 0, 0, 0, 0,255,255, 0,201, 0, 0, 4,236, - 7, 80, 18, 34, 0, 37, 0, 0, 16, 3, 2, 50, 0,173, 1, 64,255,255, 0,186,255,227, 4,164, 7,133, 16, 39, 2, 79, 3, 22, - 1,117, 18, 6, 0, 69, 0, 0,255,255, 0,201,254,135, 4,236, 5,213, 18, 34, 0, 37, 0, 0, 16, 3, 2,107, 4,165, 0, 0, -255,255, 0,186,254,135, 4,164, 6, 20, 18, 34, 0, 69, 0, 0, 16, 3, 2,107, 4,154, 0, 0,255,255, 0,201,254,192, 4,236, - 5,213, 18, 34, 0, 37, 0, 0, 16, 3, 2, 38, 0,151, 0, 0,255,255, 0,186,254,192, 4,164, 6, 20, 18, 34, 0, 69, 0, 0, - 16, 3, 2, 38, 0,143, 0, 0,255,255, 0,115,254,117, 5, 39, 7,107, 18, 34, 0,137, 0, 0, 16, 67, 0,118, 0,254, 2,240, - 64, 0, 44,204,255,255, 0,113,254,117, 3,231, 6,102, 18, 34, 0,169, 0, 0, 16, 2, 0,118, 67, 0, 0, 0,255,255, 0,201, - 0, 0, 5,176, 7, 80, 18, 34, 0, 39, 0, 0, 16, 3, 2, 50, 0,253, 1, 64,255,255, 0,113,255,227, 4,110, 7,133, 16, 39, - 2, 79, 5,254, 1,117, 18, 6, 0, 71, 0, 0,255,255, 0,201,254,135, 5,176, 5,213, 16, 35, 2,107, 4,174, 0, 0, 16, 2, - 0, 39, 0, 0,255,255, 0,113,254,135, 4, 90, 6, 20, 16, 35, 2,107, 4,122, 0, 0, 16, 2, 0, 71, 0, 0,255,255, 0,201, -254,192, 5,176, 5,213, 18, 34, 0, 39, 0, 0, 16, 3, 2, 38, 0,232, 0, 0,255,255, 0,113,254,192, 4, 90, 6, 20, 18, 34, - 0, 71, 0, 0, 16, 2, 2, 38, 79, 0, 0, 0,255,255, 0,201,254,119, 5,176, 5,213, 18, 34, 0, 39, 0, 0, 16, 2, 0,122, - 91, 2, 0, 0,255,255, 0,113,254,117, 4, 90, 6, 20, 18, 34, 0, 71, 0, 0, 16, 2, 0,122,246, 0, 0, 0,255,255, 0,201, -254, 24, 5,176, 5,213, 16, 39, 2, 31, 0,166,249, 42, 18, 6, 0, 39, 0, 0,255,255, 0,113,254, 24, 4, 90, 6, 20, 16, 39, - 2, 31, 0, 94,249, 42, 18, 6, 0, 71, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,149, -238, 0, 0, 0,255,255, 0,113,255,227, 4,127, 4,123, 16, 39, 6,149,255,217,255, 4, 16, 6, 0, 72, 0, 0,255,255, 0,201, - 0, 0, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,148,236, 0, 0, 0,255,255, 0,113,255,227, 4,127, 4,123, 16, 38, - 0, 72, 0, 0, 16, 7, 6,148,255,215,255, 4,255,255, 0,201,253,221, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 3, 2,117, - 4,177, 0, 0,255,255, 0,113,253,221, 4,127, 4,123, 18, 34, 0, 72, 0, 0, 16, 3, 2,117, 4,176, 0, 0,255,255, 0,201, -254,118, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 3, 2, 71, 0,179, 0, 0,255,255, 0,113,254,118, 4,127, 4,123, 18, 34, - 0, 72, 0, 0, 16, 3, 2, 71, 0,155, 0, 0,255,255, 0,201,254,117, 4,139, 7,102, 18, 34, 0, 40, 0, 0, 16, 99, 2, 49, - 0,218, 1,190, 64, 0, 57,153, 16, 3, 0,122, 0,190, 0, 0,255,255, 0,113,254,117, 4,127, 6, 72, 18, 34, 0, 72, 0, 0, - 16, 35, 2, 49, 0,135, 0, 0, 16, 2, 0,122, 75, 0, 0, 0,255,255, 0,201, 0, 0, 4, 35, 7, 80, 18, 34, 0, 41, 0, 0, - 16, 3, 2, 50, 0,118, 1, 64,255,255, 0, 47, 0, 0, 2,248, 7, 80, 18, 34, 0, 73, 0, 0, 16, 3, 2, 50, 0, 12, 1, 64, -255,255, 0,115,255,227, 5,139, 7, 24, 18, 34, 0, 42, 0, 0, 16, 3, 2, 34, 1, 50, 1, 34,255,255, 0,113,254, 86, 4, 90, - 5,246, 18, 34, 0, 74, 0, 0, 16, 2, 2, 34, 73, 0, 0, 0,255,255, 0,201, 0, 0, 5, 59, 7, 80, 18, 34, 0, 43, 0, 0, - 16, 3, 2, 50, 1, 20, 1, 64,255,255, 0,186, 0, 0, 4,100, 7,133, 16, 39, 2, 79, 3, 22, 1,117, 18, 6, 0, 75, 0, 0, -255,255, 0,201,254,135, 5, 59, 5,213, 16, 35, 2,107, 5, 2, 0, 0, 16, 2, 0, 43, 0, 0,255,255, 0,186,254,135, 4,100, - 6, 20, 16, 35, 2,107, 4,143, 0, 0, 16, 2, 0, 75, 0, 0,255,255, 0,201, 0, 0, 5, 59, 7, 80, 18, 34, 0, 43, 0, 0, - 16, 3, 0,106, 1, 8, 1, 64,255,255,255,235, 0, 0, 4,100, 7,133, 16, 39, 2, 80, 3, 22, 1,117, 18, 6, 0, 75, 0, 0, -255,255, 0, 17,254,116, 5, 59, 5,213, 18, 34, 0, 43, 0, 0, 16, 3, 0,122,254,238,255,255,255,255, 0, 2,254,116, 4,100, - 6, 20, 18, 34, 0, 75, 0, 0, 16, 3, 0,122,254,223,255,255,255,255, 0,201,254, 57, 5, 59, 5,213, 18, 34, 0, 43, 0, 0, - 16, 3, 2,118, 5, 10, 0, 0,255,255, 0,186,254, 57, 4,100, 6, 20, 18, 34, 0, 75, 0, 0, 16, 3, 2,118, 4,149, 0, 0, -255,255, 0, 0,254,118, 2,148, 5,213, 18, 34, 0, 44, 0, 0, 16, 3, 2, 71,255, 74, 0, 0,255,255, 0, 39,254,118, 2, 56, - 6, 20, 18, 34, 0, 76, 0, 0, 16, 66, 2, 71,150, 0, 51, 51, 64, 0, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 18, 34, - 0, 44, 0, 0, 16, 7, 6,146,254,116, 0, 0,255,255, 0,193, 0, 0, 1,121, 4, 96, 18, 34, 0,243, 0, 0, 16, 7, 6,146, -254, 97,254,188,255,255, 0,201, 0, 0, 5,106, 7,107, 18, 34, 0, 46, 0, 0, 16, 67, 0,118, 0,164, 2,240, 64, 0, 44,204, -255,255, 0,186, 0, 0, 4,156, 6, 20, 16, 39, 6,133, 3, 90, 1,118, 18, 2, 0, 78, 0, 0,255,255, 0,201,254,135, 5,106, - 5,213, 18, 34, 0, 46, 0, 0, 16, 3, 2,107, 4,220, 0, 0,255,255, 0,186,254,135, 4,156, 6, 20, 18, 34, 0, 78, 0, 0, - 16, 3, 2,107, 4,145, 0, 0,255,255, 0,201,254,192, 5,106, 5,213, 18, 34, 0, 46, 0, 0, 16, 3, 2, 38, 1, 13, 0, 0, -255,255, 0,186,254,192, 4,156, 6, 20, 18, 34, 0, 78, 0, 0, 16, 2, 2, 38,118, 0, 0, 0,255,255, 0,201,254,135, 4,106, - 5,213, 16, 35, 2,107, 4,154, 0, 0, 16, 2, 0, 47, 0, 0,255,255, 0,182,254,135, 1,131, 6, 20, 16, 35, 2,107, 3, 28, - 0, 0, 16, 2, 0, 79, 0, 0,255,255, 0, 3,254,136, 4,106, 7,107, 16, 39, 2, 76, 3, 42, 1,117, 16, 39, 2,107, 4,153, - 0, 1, 18, 6, 0, 47, 0, 0,255,255,255,241,254,135, 2, 72, 7, 49, 16, 35, 0,113,255, 28, 1, 59, 16, 2, 4,179, 0, 0, -255,255, 0,201,254,192, 4,106, 5,213, 18, 34, 0, 47, 0, 0, 16, 3, 2, 38, 0,142, 0, 0,255,255, 0, 39,254,192, 2, 7, - 6, 20, 18, 34, 0, 79, 0, 0, 16, 67, 2, 38,255,125, 0, 0, 51, 51, 64, 0,255,255, 0,201,254, 23, 4,106, 5,213, 16, 39, - 2, 31, 0,151,249, 41, 18, 6, 0, 47, 0, 0,255,255,255,222,254, 23, 2, 92, 6, 20, 16, 39, 2, 31,255, 29,249, 41, 18, 6, - 0, 79, 0, 0,255,255, 0,201, 0, 0, 6, 31, 7,107, 18, 34, 0, 48, 0, 0, 16, 67, 0,118, 1, 66, 2,240, 64, 0, 44,204, -255,255, 0,186, 0, 0, 7, 29, 6,102, 18, 34, 0, 80, 0, 0, 16, 3, 0,118, 1,148, 0, 0,255,255, 0,201, 0, 0, 6, 31, - 7, 80, 18, 34, 0, 48, 0, 0, 16, 3, 2, 50, 1,119, 1, 64,255,255, 0,186, 0, 0, 7, 29, 6, 16, 16, 39, 2, 50, 2, 70, - 0, 0, 18, 6, 0, 80, 0, 0,255,255, 0,201,254,135, 6, 31, 5,213, 16, 35, 2,107, 5,116, 0, 0, 16, 2, 0, 48, 0, 0, -255,255, 0,186,254,135, 7, 29, 4,123, 16, 35, 2,107, 5,230, 0, 0, 16, 2, 0, 80, 0, 0,255,255, 0,201, 0, 0, 5, 51, - 5,213, 16, 39, 6,140, 4,254, 1, 92, 18, 6, 0, 49, 0, 0,255,255, 0,186, 0, 0, 4,100, 5,193, 16, 39, 2, 50, 0,143, -255,177, 18, 6, 0, 81, 0, 0,255,255, 0,201,254,135, 5, 51, 5,213, 16, 35, 2,107, 4,254, 0, 0, 16, 2, 0, 49, 0, 0, -255,255, 0,186,254,135, 4,100, 4,123, 16, 35, 2,107, 4,143, 0, 0, 16, 2, 0, 81, 0, 0,255,255, 0,201,254,192, 5, 51, - 5,213, 18, 34, 0, 49, 0, 0, 16, 3, 2, 38, 0,247, 0, 0,255,255, 0,186,254,192, 4,100, 4,123, 18, 34, 0, 81, 0, 0, - 16, 3, 2, 38, 0,140, 0, 0,255,255, 0,201,254, 21, 5, 51, 5,213, 16, 39, 2, 31, 0,254,249, 39, 18, 6, 0, 49, 0, 0, -255,255, 0,186,254, 21, 4,100, 4,123, 16, 39, 2, 31, 0,149,249, 39, 18, 6, 0, 81, 0, 0,255,255, 0,115,255,227, 5,217, - 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,154,102, 0, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 18, 34, 0, 82, 0, 0, - 16, 7, 6,154,255,178,254,178,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,152,108, 0, 0, 0, -255,255, 0,113,255,227, 4,117, 7, 15, 18, 34, 0, 82, 0, 0, 16, 39, 0,106, 0,111, 0,255, 16, 7, 6,134, 4,114, 0, 18, -255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,149,106, 0, 0, 0,255,255, 0,113,255,227, 4,117, - 4,123, 16, 38, 0, 82, 0, 0, 16, 7, 6,149,255,181,255, 4,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, - 16, 6, 6,148,104, 0, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 16, 39, 6,148,255,185,255, 4, 16, 6, 0, 82, 0, 0, -255,255, 0,201, 0, 0, 4,141, 7,107, 18, 34, 0, 51, 0, 0, 16, 67, 0,118, 0, 65, 2,240, 64, 0, 44,204,255,255, 0,186, -254, 86, 4,164, 6,102, 18, 34, 0, 83, 0, 0, 16, 2, 0,118, 50, 0, 0, 0,255,255, 0,201, 0, 0, 4,141, 7, 80, 18, 34, - 0, 51, 0, 0, 16, 3, 2, 50, 0,132, 1, 64,255,255, 0,186,254, 86, 4,164, 6, 16, 16, 39, 2, 50, 0,217, 0, 0, 18, 6, - 0, 83, 0, 0,255,255, 0,201, 0, 0, 5, 84, 7, 80, 18, 34, 0, 53, 0, 0, 16, 3, 2, 50, 0,131, 1, 64,255,255, 0,186, - 0, 0, 3, 74, 6, 18, 18, 34, 0, 85, 0, 0, 16, 2, 2, 50, 19, 2, 0, 0,255,255, 0,201,254,135, 5, 84, 5,213, 16, 35, - 2,107, 4,125, 0, 0, 16, 2, 0, 53, 0, 0,255,255, 0,186,254,135, 3, 74, 4,123, 16, 35, 2,107, 3, 32, 0, 0, 16, 2, - 0, 85, 0, 0,255,255, 0,201,254,135, 5, 84, 7, 51, 16, 99, 0,113, 0,122, 1, 50, 64, 0, 64,110, 16, 2, 4,214, 0, 0, -255,255, 0,186,254,135, 3, 74, 5,245, 16, 34, 0,113, 24,255, 16, 2, 4,215, 0, 0, 0, 0,255,255, 0,201,254,192, 5, 84, - 5,213, 18, 34, 0, 53, 0, 0, 16, 3, 2, 38, 0,229, 0, 0,255,255, 0, 84,254,192, 3, 74, 4,123, 18, 34, 0, 85, 0, 0, - 16, 3, 2, 38,255,127, 0, 0,255,255, 0,135,255,227, 4,162, 7, 80, 18, 34, 0, 54, 0, 0, 16, 3, 2, 50, 0,184, 1, 64, -255,255, 0,111,255,227, 3,199, 6, 16, 16, 38, 2, 50, 37, 0, 18, 6, 0, 86, 0, 0, 0, 0,255,255, 0,135,254,135, 4,162, - 5,240, 16, 35, 2,107, 4,138, 0, 0, 16, 2, 0, 54, 0, 0,255,255, 0,111,254,135, 3,199, 4,123, 16, 35, 2,107, 4, 21, - 0, 0, 16, 2, 0, 86, 0, 0,255,255, 0,135,255,227, 4,162, 7,107, 18, 34, 0, 54, 0, 0, 16, 35, 2, 50,255,164, 1, 90, - 16, 67, 0,118, 0,242, 2,240, 64, 0, 44,204,255,255, 0,111,255,227, 3,226, 6,102, 18, 34, 0, 86, 0, 0, 16, 34, 2, 50, -140, 86, 16, 3, 0,118, 0,144, 0, 0, 0, 0,255,255, 0,135,255,227, 4,162, 5,240, 16, 38, 6,153,228, 0, 18, 2, 0, 54, - 0, 0, 0, 0,255,255, 0,111,255,227, 3,199, 7,176, 16, 38, 1, 35, 0, 0, 16, 7, 2, 50, 0, 34, 1,160,255,255, 0,135, -254,135, 4,162, 7, 80, 18, 34, 4,222, 0, 0, 16, 3, 2, 50, 0,155, 1, 64,255,255, 0,111,254,135, 3,199, 6, 18, 18, 34, - 4,223, 0, 0, 16, 2, 2, 50, 42, 2, 0, 0,255,255,255,250, 0, 0, 4,233, 7, 80, 18, 34, 0, 55, 0, 0, 16, 3, 2, 50, - 0,114, 1, 64,255,255, 0, 55, 0, 0, 2,242, 7, 47, 18, 34, 0, 87, 0, 0, 16, 3, 2, 50,255, 35, 1, 31,255,255,255,250, -254,135, 4,233, 5,213, 16, 35, 2,107, 4,113, 0, 0, 16, 2, 0, 55, 0, 0,255,255, 0, 55,254,135, 2,242, 5,158, 16, 35, - 2,107, 3,232, 0, 0, 16, 2, 0, 87, 0, 0,255,255,255,250,254,192, 4,233, 5,213, 18, 34, 0, 55, 0, 0, 16, 2, 2, 38, - 98, 0, 0, 0,255,255, 0, 55,254,192, 2,242, 5,158, 18, 34, 0, 87, 0, 0, 16, 66, 2, 38, 60, 0, 51, 51, 64, 0, 0, 0, -255,255,255,250,254, 21, 4,233, 5,213, 16, 39, 2, 31, 0,114,249, 39, 18, 6, 0, 55, 0, 0,255,255, 0, 55,254, 20, 3, 39, - 5,158, 16, 39, 2, 31,255,232,249, 38, 18, 6, 0, 87, 0, 0,255,255, 0,178,254,137, 5, 41, 5,213, 16, 35, 2,108, 4,240, - 0, 0, 18, 2, 0, 56, 0, 0,255,255, 0,174,254,137, 4, 88, 4, 96, 16, 35, 2,108, 4,123, 0, 0, 18, 2, 0, 88, 0, 0, -255,255, 0,178,254,118, 5, 41, 5,213, 18, 34, 0, 56, 0, 0, 16, 3, 2, 71, 0,242, 0, 0,255,255, 0,174,254,118, 4, 88, - 4, 96, 18, 34, 0, 88, 0, 0, 16, 3, 2, 71, 0,143, 0, 0,255,255, 0,178,253,221, 5, 41, 5,213, 18, 34, 0, 56, 0, 0, - 16, 3, 2,117, 4,224, 0, 0,255,255, 0,174,253,221, 4, 88, 4, 96, 18, 34, 0, 88, 0, 0, 16, 3, 2,117, 4,117, 0, 0, -255,255, 0,178,255,227, 5, 41, 5,213, 16, 38, 6,154, 46, 0, 18, 2, 0, 56, 0, 0, 0, 0,255,255, 0,174,255,227, 4, 88, - 7,236, 16, 38, 1, 43, 0, 0, 16, 7, 0,118, 0,150, 1,134,255,255, 0,178,255,227, 5, 41, 5,213, 16, 38, 6,144, 50, 0, - 18, 2, 0, 56, 0, 0, 0, 0,255,255, 0,174,255,227, 4, 88, 4, 96, 16, 39, 6,144,255,200,254,192, 18, 2, 0, 88, 0, 0, -255,255, 0, 16, 0, 0, 5,104, 7,125, 18, 34, 0, 57, 0, 0, 16, 3, 2, 53, 0,237, 1, 70,255,255, 0, 61, 0, 0, 4,127, - 6, 55, 18, 34, 0, 89, 0, 0, 16, 2, 2, 53,109, 0, 0, 0,255,255, 0, 16,254,135, 5,104, 5,213, 16, 38, 0, 57, 0, 0, - 16, 7, 2,107, 4,188, 0, 0,255,255, 0, 61,254,135, 4,127, 4, 96, 16, 38, 0, 89, 0, 0, 16, 7, 2,107, 4, 94, 0, 0, -255,255, 0, 68, 0, 0, 7,166, 5,213, 16, 39, 6,135, 5,245, 1,124, 18, 6, 0, 58, 0, 0,255,255, 0, 86, 0, 0, 6, 53, - 6,107, 16, 39, 0, 67, 1, 9, 0, 5, 18, 6, 0, 90, 0, 0,255,255, 0, 68, 0, 0, 7,166, 5,213, 16, 39, 6,133, 5,245, - 1,124, 18, 6, 0, 58, 0, 0,255,255, 0, 86, 0, 0, 6, 53, 6,109, 16, 39, 0,118, 1,134, 0, 7, 18, 6, 0, 90, 0, 0, -255,255, 0, 68, 0, 0, 7,166, 7, 52, 16, 39, 0,106, 1,245, 1, 36, 18, 6, 0, 58, 0, 0,255,255, 0, 86, 0, 0, 6, 53, - 5,191, 16, 39, 0,106, 1, 69,255,175, 18, 6, 0, 90, 0, 0,255,255, 0, 68, 0, 0, 7,166, 7, 80, 18, 34, 0, 58, 0, 0, - 16, 3, 2, 50, 1,245, 1, 64,255,255, 0, 86, 0, 0, 6, 53, 6, 18, 18, 34, 0, 90, 0, 0, 16, 3, 2, 50, 1, 71, 0, 2, -255,255, 0, 68,254,135, 7,166, 5,213, 18, 34, 0, 58, 0, 0, 16, 3, 2,107, 5,251, 0, 0,255,255, 0, 86,254,135, 6, 53, - 4, 96, 18, 34, 0, 90, 0, 0, 16, 3, 2,107, 5, 74, 0, 0,255,255, 0, 61, 0, 0, 5, 59, 7, 80, 18, 34, 0, 59, 0, 0, - 16, 3, 2, 50, 0,202, 1, 64,255,255, 0, 59, 0, 0, 4,121, 6, 18, 18, 34, 0, 91, 0, 0, 16, 2, 2, 50,103, 2, 0, 0, -255,255, 0, 61, 0, 0, 5, 59, 7, 78, 18, 34, 0, 59, 0, 0, 16, 3, 0,106, 0,202, 1, 62,255,255, 0, 59, 0, 0, 4,121, - 6, 16, 18, 34, 0, 91, 0, 0, 16, 2, 0,106,102, 0, 0, 0,255,255,255,252, 0, 0, 4,231, 7, 80, 18, 34, 0, 60, 0, 0, - 16, 3, 2, 50, 0,112, 1, 64,255,255, 0, 61,254, 86, 4,127, 6, 16, 18, 34, 0, 92, 0, 0, 16, 2, 2, 50,102, 0, 0, 0, -255,255, 0, 92, 0, 0, 5, 31, 7,107, 18, 34, 0, 61, 0, 0, 16, 67, 2, 31, 0,190, 2,240, 64, 0, 44,204,255,255, 0, 88, - 0, 0, 3,219, 6,102, 18, 34, 0, 93, 0, 0, 16, 2, 2, 31, 26, 0, 0, 0,255,255, 0, 92,254,135, 5, 31, 5,213, 18, 34, - 0, 61, 0, 0, 16, 3, 2,107, 4,217, 0, 0,255,255, 0, 88,254,135, 3,219, 4, 96, 18, 34, 0, 93, 0, 0, 16, 3, 2,107, - 4, 49, 0, 0,255,255, 0, 92,254,192, 5, 31, 5,213, 18, 34, 0, 61, 0, 0, 16, 3, 2, 38, 0,199, 0, 0,255,255, 0, 88, -254,192, 3,219, 4, 96, 18, 34, 0, 93, 0, 0, 16, 2, 2, 38, 27, 0, 0, 0,255,255, 0,186,254,192, 4,100, 6, 20, 18, 34, - 0, 75, 0, 0, 16, 2, 2, 38,102, 0, 0, 0,255,255, 0, 4, 0, 0, 2,242, 7, 78, 18, 34, 0, 87, 0, 0, 16, 3, 0,106, -255, 45, 1, 62,255,255, 0, 86, 0, 0, 6, 53, 7, 6, 18, 34, 0, 90, 0, 0, 16, 3, 2, 51, 1, 66, 0, 0,255,255, 0, 61, -254, 86, 4,127, 7, 6, 18, 34, 0, 92, 0, 0, 16, 3, 2, 51, 0,129, 0, 0,255,255, 0,123,255,227, 5, 97, 6, 20, 18, 34, - 0, 68, 0, 0, 16, 3, 2, 23, 3,218, 0, 0,255,255, 0, 47, 0, 0, 2,248, 7, 80, 18, 34, 1, 65, 0, 0, 16, 3, 2, 50, -255,253, 1, 64,255,255, 0, 16,254,135, 5,104, 5,213, 16, 35, 2,107, 4,183, 0, 0, 18, 2, 0, 36, 0, 0,255,255, 0,123, -254,135, 4, 45, 4,123, 16, 35, 2,107, 4, 33, 0, 0, 18, 2, 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 7,240, 18, 38, - 0, 36, 0, 0, 16, 7, 2, 81, 4,188, 1,117,255,255, 0,123,255,227, 4, 45, 6,123, 18, 38, 0, 68, 0, 0, 16, 7, 2, 81, - 4, 84, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,155, 0, 0, 0, 0,255,255, 0,123, -255,227, 4, 45, 4,123, 16, 39, 6,155,255,151,254,139, 16, 6, 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, - 0, 36, 0, 0, 16, 6, 6,156, 0, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 4,123, 16, 38, 0, 68, 0, 0, 16, 7, 6,156, -255,148,254,140,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,162, 0, 0, 0, 0,255,255, 0,123, -255,227, 4, 45, 4,123, 16, 39, 6,162,255,150,254,139, 16, 6, 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, - 0, 36, 0, 0, 16, 6, 6,157, 0, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 4,123, 16, 39, 6,157,255,150,254,139, 16, 6, - 0, 68, 0, 0,255,255, 0, 16,254,135, 5,104, 5,213, 16, 35, 2,107, 4,175, 0, 0, 18, 2, 0,132, 0, 0,255,255, 0,123, -254,135, 4, 45, 6,102, 18, 34, 0,164, 0, 0, 16, 3, 2,107, 4, 34, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, - 0, 36, 0, 0, 16, 6, 6,159, 0, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 4,123, 16, 39, 6,159,255,145,254,170, 16, 6, - 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,160, 0, 0, 0, 0,255,255, 0,123, -255,227, 4, 45, 4,123, 16, 39, 6,160,255,146,254,170, 16, 6, 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, - 0, 36, 0, 0, 16, 6, 6,161, 0, 0, 0, 0,255,255, 0,123,255,227, 4, 45, 4,123, 16, 39, 6,161,255,148,254,170, 16, 6, - 0, 68, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 18, 34, 0, 36, 0, 0, 16, 6, 6,158, 0, 0, 0, 0,255,255, 0,123, -255,227, 4, 45, 4,123, 16, 38, 0, 68, 0, 0, 16, 7, 6,158,255,146,254,170,255,255, 0, 16,254,135, 5,104, 7,146, 18, 34, - 0,196, 0, 0, 16, 3, 2,107, 4,192, 0, 0,255,255, 0,123,254,135, 4, 45, 6, 31, 18, 34, 0,197, 0, 0, 16, 3, 2,107, - 4, 51, 0, 0,255,255, 0,201,254,135, 4,139, 5,213, 16, 38, 0, 40, 0, 0, 16, 7, 2,107, 4,158, 0, 0,255,255, 0,113, -254,135, 4,127, 4,123, 16, 38, 0, 72, 0, 0, 16, 7, 2,107, 4,139, 0, 0,255,255, 0,201, 0, 0, 4,139, 7,240, 18, 38, - 0, 40, 0, 0, 16, 7, 2, 81, 4,158, 1,117,255,255, 0,113,255,227, 4,127, 6,123, 18, 38, 0, 72, 0, 0, 16, 7, 2, 81, - 4,141, 0, 0,255,255, 0,201, 0, 0, 4,139, 7, 69, 16, 99, 2, 53, 0,185, 2, 76, 64, 0, 51, 51, 18, 2, 0, 40, 0, 0, -255,255, 0,113,255,227, 4,127, 6, 55, 16, 35, 2, 53, 0,151, 0, 0, 18, 2, 0, 72, 0, 0,255,255, 0,201, 0, 0, 4,139, - 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,155, 0, 0, 0, 0,255,255, 0,113,255,227, 4,127, 4,123, 16, 39, 6,155,255,208, -254,139, 16, 6, 0, 72, 0, 0,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,156,238, 0, 0, 0, -255,255, 0,113,255,227, 4,127, 4,123, 16, 39, 6,156,255,208,254,140, 16, 6, 0, 72, 0, 0,255,255, 0,201, 0, 0, 4,139, - 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,162,238, 0, 0, 0,255,255, 0,113,255,227, 4,127, 4,123, 16, 38, 0, 72, 0, 0, - 16, 7, 6,162,255,208,254,139,255,255, 0,201, 0, 0, 4,139, 5,213, 18, 34, 0, 40, 0, 0, 16, 6, 6,157,234, 0, 0, 0, -255,255, 0,113,255,227, 4,127, 4,123, 16, 39, 6,157,255,209,254,139, 16, 6, 0, 72, 0, 0,255,255, 0,201,254,135, 4,139, - 5,213, 18, 34, 0,140, 0, 0, 16, 7, 2,107, 4,158, 0, 0,255,255, 0,113,254,135, 4,127, 6,102, 16, 39, 2,107, 4,139, - 0, 0, 16, 38, 5, 49, 0, 0, 16, 7, 2, 31, 0,139, 0, 0,255,255, 0, 90, 0, 0, 2, 26, 7,240, 18, 38, 0, 44, 0, 0, - 16, 7, 2, 81, 3, 35, 1,117,255,255, 0, 68, 0, 0, 2, 4, 6,124, 18, 34, 0,243, 0, 0, 16, 7, 2, 81, 3, 13, 0, 1, -255,255, 0,200,254,135, 1,148, 5,213, 16, 38, 0, 44, 0, 0, 16, 7, 2,107, 3, 46, 0, 0,255,255, 0,183,254,135, 1,131, - 6, 20, 16, 38, 0, 76, 0, 0, 16, 7, 2,107, 3, 29, 0, 0,255,255, 0,115,254,135, 5,217, 5,240, 16, 38, 0, 50, 0, 0, - 16, 7, 2,107, 5, 39, 0, 0,255,255, 0,113,254,135, 4,117, 4,123, 16, 38, 0, 82, 0, 0, 16, 7, 2,107, 4,115, 0, 0, -255,255, 0,115,255,227, 5,217, 7,240, 18, 38, 0, 50, 0, 0, 16, 7, 2, 81, 5, 39, 1,117,255,255, 0,113,255,227, 4,117, - 6,123, 18, 38, 0, 82, 0, 0, 16, 7, 2, 81, 4,125, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, - 16, 6, 6,155,108, 0, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 16, 39, 6,155,255,182,254,139, 16, 6, 0, 82, 0, 0, -255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,156,106, 0, 0, 0,255,255, 0,113,255,227, 4,117, - 4,123, 16, 39, 6,156,255,181,254,140, 16, 6, 0, 82, 0, 0,255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, - 16, 6, 6,162,106, 0, 0, 0,255,255, 0,113,255,227, 4,117, 4,123, 16, 39, 6,162,255,182,254,139, 16, 6, 0, 82, 0, 0, -255,255, 0,115,255,227, 5,217, 5,240, 18, 34, 0, 50, 0, 0, 16, 6, 6,157,101, 0, 0, 0,255,255, 0,113,255,227, 4,117, - 4,123, 16, 39, 6,157,255,182,254,139, 16, 6, 0, 82, 0, 0,255,255, 0,115,254,135, 5,217, 5,240, 18, 34, 0,150, 0, 0, - 16, 7, 2,107, 5, 39, 0, 0,255,255, 0,113,254,135, 4,117, 6,102, 16, 39, 2,107, 4,115, 0, 0, 16, 38, 5, 69, 0, 0, - 16, 6, 2, 31,115, 0, 0, 0,255,255, 0,103,255,227, 6,195, 5,240, 16, 39, 6,133, 5, 39, 1,117, 18, 2, 1, 98, 0, 0, -255,255, 0,118,255,227, 4,211, 6,102, 16, 38, 0,118,115, 0, 18, 2, 1, 99, 0, 0, 0, 0,255,255, 0,103,255,227, 6,195, - 5,240, 16, 39, 6,135, 5, 39, 1,117, 18, 2, 1, 98, 0, 0,255,255, 0,118,255,227, 4,211, 6,102, 16, 38, 0, 67,115, 0, - 18, 2, 1, 99, 0, 0, 0, 0,255,255, 0,103,255,227, 6,195, 7,240, 18, 34, 1, 98, 0, 0, 16, 7, 2, 81, 5, 39, 1,117, -255,255, 0,118,255,227, 4,211, 6,123, 18, 38, 1, 99, 0, 0, 16, 7, 2, 81, 4,125, 0, 0,255,255, 0,103,255,227, 6,195, - 5,240, 16, 39, 6,134, 5, 39, 1,117, 18, 2, 1, 98, 0, 0,255,255, 0,118,255,227, 4,211, 6, 55, 16, 38, 2, 53,115, 0, - 18, 2, 1, 99, 0, 0, 0, 0,255,255, 0,103,254,135, 6,195, 5,240, 18, 34, 1, 98, 0, 0, 16, 7, 2,107, 5, 39, 0, 0, -255,255, 0,118,254,135, 4,211, 4,235, 18, 34, 1, 99, 0, 0, 16, 7, 2,107, 4,115, 0, 0,255,255, 0,178,254,135, 5, 41, - 5,213, 16, 38, 0, 56, 0, 0, 16, 7, 2,107, 4,245, 0, 0,255,255, 0,174,254,135, 4, 88, 4, 96, 16, 38, 0, 88, 0, 0, - 16, 7, 2,107, 4,123, 0, 0,255,255, 0,178,255,227, 5, 41, 7,240, 18, 38, 0, 56, 0, 0, 16, 7, 2, 81, 4,238, 1,117, -255,255, 0,174,255,227, 4, 88, 6,123, 18, 38, 0, 88, 0, 0, 16, 7, 2, 81, 4,125, 0, 0,255,255, 0,173,255,247, 6, 95, - 5,233, 16, 39, 6,133, 4,238, 1,117, 18, 2, 1,113, 0, 0,255,255, 0,176,255,227, 5,105, 6,102, 16, 38, 0,118,123, 0, - 18, 2, 1,114, 0, 0, 0, 0,255,255, 0,173,255,247, 6, 95, 5,233, 16, 39, 6,135, 4,238, 1,117, 18, 2, 1,113, 0, 0, -255,255, 0,176,255,227, 5,105, 6,102, 16, 38, 0, 67,123, 0, 18, 2, 1,114, 0, 0, 0, 0,255,255, 0,173,255,247, 6, 95, - 7,240, 18, 34, 1,113, 0, 0, 16, 7, 2, 81, 4,238, 1,117,255,255, 0,176,255,227, 5,105, 6,123, 18, 34, 1,114, 0, 0, - 16, 7, 2, 81, 4,125, 0, 0,255,255, 0,173,255,247, 6, 95, 5,233, 16, 39, 6,134, 4,238, 1,117, 18, 2, 1,113, 0, 0, -255,255, 0,176,255,227, 5,105, 6, 55, 16, 35, 2, 53, 0,128, 0, 0, 18, 2, 1,114, 0, 0,255,255, 0,173,254,135, 6, 95, - 5,233, 18, 34, 1,113, 0, 0, 16, 7, 2,107, 4,245, 0, 0,255,255, 0,176,254,135, 5,105, 4,235, 18, 34, 1,114, 0, 0, - 16, 7, 2,107, 4,123, 0, 0,255,255,255,252, 0, 0, 4,231, 5,213, 18, 38, 0, 60, 0, 0, 16, 7, 6,135, 4,114, 1,124, -255,255, 0, 61,254, 86, 4,127, 6,107, 18, 38, 0, 92, 0, 0, 16, 6, 0, 67, 33, 5, 0, 0,255,255,255,252,254,130, 4,231, - 5,213, 16, 35, 2,107, 4,118,255,251, 18, 2, 0, 60, 0, 0,255,255, 0, 61,254, 86, 4,127, 4, 96, 16, 35, 2,107, 5,116, - 0, 0, 18, 2, 0, 92, 0, 0,255,255,255,252, 0, 0, 4,231, 7,247, 18, 38, 0, 60, 0, 0, 16, 7, 2, 81, 4,114, 1,124, -255,255, 0, 61,254, 86, 4,127, 6,130, 18, 38, 0, 92, 0, 0, 16, 7, 2, 81, 4, 96, 0, 7,255,255,255,252, 0, 0, 4,231, - 7, 69, 16, 99, 2, 53, 0,121, 2, 76, 64, 0, 51, 51, 18, 2, 0, 60, 0, 0,255,255, 0, 61,254, 86, 4,127, 6, 55, 16, 34, - 2, 53,119, 0, 18, 2, 0, 92, 0, 0, 0, 0, 0, 1, 1,134, 4,194, 2,120, 6, 97, 0, 8, 0, 72,180, 5, 8, 7, 2, 9, - 16,212, 60,220,178, 63, 8, 1, 93,192, 49,182, 0, 6, 7, 6, 3, 2, 9, 0, 16,212,180, 63, 2, 95, 2, 2, 93,176, 17, 75, - 80, 88,204, 27,192, 89,204,204,178, 63, 7, 1, 93, 17, 57, 48,177, 6, 3, 73,177, 7, 6, 73, 80, 88,179, 5, 64, 6, 64, 56, - 56, 89, 1, 16, 35, 53, 22, 53, 35, 53, 51, 2,120,242,134,133,241, 5,205,254,245,103, 3,157,158, 0, 0, 0,255,255, 1,115, - 4,238, 3, 82, 6,102, 16, 6, 0,118, 0, 0, 0, 1, 1,134, 4,194, 2,120, 6, 97, 0, 8, 0, 72,180, 2, 7, 4, 0, 9, - 16,212,192,220,178, 63, 7, 1, 93, 60, 49,182, 0, 3, 2, 3, 6, 7, 9, 0, 16,212,180, 63, 7, 95, 7, 2, 93,176, 17, 75, - 80, 88,204, 27,192, 89,204,204,178, 63, 2, 1, 93, 17, 57, 48,177, 3, 6, 73,177, 2, 3, 73, 80, 88,179, 3, 64, 4, 64, 56, - 56, 89, 1, 53, 51, 21, 35, 20, 55, 21, 34, 1,134,242,134,134,242, 5,205,148,158,157, 3,103, 0, 1, 0,100, 1,223, 2,127, - 2,131, 0, 3, 0, 17,182, 0,156, 2, 4, 1, 0, 4, 16,220,204, 49, 0, 16,212,236, 48, 19, 33, 21, 33,100, 2, 27,253,229, - 2,131,164, 0,255,255, 0,100, 1,223, 2,127, 2,131, 18, 6, 5,133, 0, 0, 0, 1, 0, 0, 1,233, 4, 0, 2,121, 0, 3, - 0, 16,182, 2,169, 0,233, 4, 1, 0, 47,198, 49, 0, 16,252,236, 48, 17, 33, 21, 33, 4, 0,252, 0, 2,121,144, 0, 0, 0, - 0, 1, 0, 0, 1,233, 4, 0, 2,121, 0, 3, 0, 16,182, 2,169, 0,233, 4, 1, 0, 47,198, 49, 0, 16,252,236, 48, 17, 33, - 21, 33, 4, 0,252, 0, 2,121,144, 0, 0, 0, 0, 1, 0, 0, 1,233, 8, 0, 2,121, 0, 3, 0, 15,181, 2,169, 0, 4, 1, - 0, 47,204, 49, 0, 16,212,236, 48, 17, 33, 21, 33, 8, 0,248, 0, 2,121,144, 0, 1, 0, 0, 1,233, 8, 0, 2,121, 0, 3, - 0, 15,181, 2,169, 0, 4, 1, 0, 47,204, 49, 0, 16,212,236, 48, 17, 33, 21, 33, 8, 0,248, 0, 2,121,144,255,255, 1, 4, -254, 29, 2,248, 6, 29, 16, 34, 0, 95, 0, 0, 16, 3, 0, 95, 1, 74, 0, 0,255,255,255,236,254, 29, 4, 20,255,238, 16, 38, - 0, 66, 0, 0, 16, 7, 0, 66, 0, 0, 1, 66, 0, 1, 0,174, 3,233, 1,211, 5,213, 0, 5, 0, 24, 64, 11, 0,158, 3,129, - 6, 3, 4, 0, 25, 1, 6, 16,220,252,212,204, 49, 0, 16,244,236, 48, 1, 35, 53, 19, 51, 3, 1,129,211,164,129, 82, 3,233, -173, 1, 63,254,193, 0, 0, 0, 0, 1, 0,178, 3,254, 1,215, 5,213, 0, 5, 0, 24, 64, 11, 3,158, 0,129, 6, 3, 4, 1, - 25, 0, 6, 16,220,236,212,204, 49, 0, 16,244,236, 48, 1, 51, 21, 3, 35, 19, 1, 4,211,164,129, 82, 5,213,152,254,193, 1, - 63, 0, 0, 0, 0, 1, 0,174,255, 18, 1,211, 0,254, 0, 5, 0, 24, 64, 11, 3,158, 0,131, 6, 3, 4, 1, 25, 0, 6, 16, -212,236,212,204, 49, 0, 16,252,236, 48, 37, 51, 21, 3, 35, 19, 1, 0,211,164,129, 82,254,172,254,192, 1, 64, 0, 1, 0,178, - 3,254, 1,215, 5,213, 0, 5, 0, 0, 1, 21, 19, 35, 3, 53, 1,133, 82,129,164, 5,213,152,254,193, 1, 63,152, 0, 0, 0, - 0, 2, 0,174, 3,233, 3,109, 5,213, 0, 5, 0, 11, 0, 39, 64, 19, 6, 0,158, 9, 3,129, 12, 9, 10, 6, 25, 7, 3, 4, - 7, 0, 25, 1, 12, 16,220,252,204,212,204, 16,254,212,206, 49, 0, 16,244, 60,236, 50, 48, 1, 35, 53, 19, 51, 3, 5, 35, 53, - 19, 51, 3, 1,129,211,164,129, 82, 1,154,211,164,129, 82, 3,233,173, 1, 63,254,193,173,173, 1, 63,254,193, 0, 2, 0,174, - 3,233, 3,109, 5,213, 0, 5, 0, 11, 0, 39, 64, 19, 9, 3,158, 6, 0,129, 12, 9, 10, 7, 25, 6, 1, 3, 4, 1, 25, 0, - 12, 16,220,236,212,204, 16,220,238,212,206, 49, 0, 16,244, 60,236, 50, 48, 1, 51, 21, 3, 35, 19, 37, 51, 21, 3, 35, 19, 1, - 0,211,164,129, 82, 1,154,211,164,129, 82, 5,213,172,254,192, 1, 64,172,172,254,192, 1, 64, 0, 2, 0,174,255, 18, 3,109, - 0,254, 0, 5, 0, 11, 0, 39, 64, 19, 9, 3,158, 6, 0,131, 12, 3, 4, 1, 25, 0, 7, 9, 10, 7, 25, 6, 12, 16,220,236, -212,204, 16,220,238,212,206, 49, 0, 16,252, 60,236, 50, 48, 37, 51, 21, 3, 35, 19, 37, 51, 21, 3, 35, 19, 2,154,211,164,129, - 82,254,102,211,164,129, 82,254,172,254,192, 1, 64,172,172,254,192, 1, 64, 0, 0, 2, 0,174, 3,233, 3,109, 5,213, 0, 5, - 0, 11, 0, 0, 1, 21, 19, 35, 3, 53, 33, 21, 19, 35, 3, 53, 1,129, 82,129,164, 2,109, 82,129,164, 5,213,173,254,193, 1, - 63,173,173,254,193, 1, 63,173, 0, 1, 0, 57,255, 59, 3,199, 5,213, 0, 11, 0, 39, 64, 20, 8, 4,185, 10, 2, 0,129, 6, -194, 12, 3, 89, 5, 1, 87, 9, 89, 7, 0, 12, 16,212, 60,236,252, 60,236, 49, 0, 16,228,244,212, 60,236, 50, 48, 1, 51, 17, - 33, 21, 33, 17, 35, 17, 33, 53, 33, 1,168,176, 1,111,254,145,176,254,145, 1,111, 5,213,254, 92,153,251,163, 4, 93,153, 0, - 0, 1, 0, 57,255, 59, 3,199, 5,213, 0, 19, 0, 62, 64, 32, 18, 6,185, 0, 16, 8,185, 10, 4, 0, 2, 14, 10, 12,129, 2, -194, 20, 15, 0, 89, 17, 13, 1, 87, 9, 5, 89, 11, 7, 3, 20, 16,212, 60, 60,236, 50,252, 60, 60,236, 50, 49, 0, 16,228,244, -196, 50, 16,196, 50, 16,238, 50, 16,238, 50, 48, 37, 33, 17, 35, 17, 33, 53, 33, 17, 33, 53, 33, 17, 51, 17, 33, 21, 33, 17, 33, - 3,199,254,145,176,254,145, 1,111,254,145, 1,111,176, 1,111,254,145, 1,111,223,254, 92, 1,164,154, 2, 31,153, 1,164,254, - 92,153,253,225, 0, 1, 1, 51, 1,209, 3,133, 4, 33, 0, 11, 0, 18,183, 9,199, 3, 12, 6, 92, 0, 12, 16,212,236, 49, 0, - 16,212,236, 48, 1, 52, 54, 51, 50, 22, 21, 20, 6, 35, 34, 38, 1, 51,173,126,124,171,172,125,125,172, 2,250,124,171,171,124, -125,172,172, 0, 0, 1, 1, 51, 1,129, 3,213, 4,113, 0, 2, 0, 0, 1, 17, 1, 1, 51, 2,162, 1,129, 2,240,254,136, 0, - 0, 1, 0,236, 0, 0, 1,193, 0,254, 0, 3, 0, 0, 55, 51, 21, 35,236,213,213,254,254, 0, 0, 2, 0,236, 0, 0, 4,107, - 0,254, 0, 3, 0, 7, 0, 0, 37, 51, 21, 35, 37, 51, 21, 35, 3,150,213,213,253, 86,213,213,254,254,254,254, 0, 3, 0,236, - 0, 0, 7, 20, 0,254, 0, 3, 0, 7, 0, 11, 0, 35, 64, 17, 8, 4, 0,131, 10, 6, 2, 4, 25, 5, 0, 25, 1, 9, 25, 8, - 12, 16,212,252,212,236,212,236, 49, 0, 47, 60, 60,236, 50, 50, 48, 37, 51, 21, 35, 37, 51, 21, 35, 37, 51, 21, 35, 3,150,212, -212, 2,169,213,213,250,173,213,213,254,254,254,254,254,254, 0, 0, 1, 0,220, 2,107, 1,175, 3,105, 0, 3, 0, 0, 19, 51, - 21, 35,220,211,211, 3,105,254, 0, 7, 0,113,255,227, 10, 76, 5,240, 0, 11, 0, 23, 0, 35, 0, 39, 0, 51, 0, 63, 0, 75, - 0,174, 64, 68, 36, 15, 37, 38, 37, 38, 15, 39, 36, 39, 66, 64, 0,146, 12, 46,146, 30,141, 40,146, 24, 70, 6,146, 52, 12,141, - 58, 38, 18,140, 36, 24,145, 76, 37, 73, 67, 39, 49, 43, 67, 13, 61, 9, 13, 15, 14, 3, 13, 21, 49, 13, 27, 61, 14, 73, 13, 21, - 55, 43, 13, 27, 14, 33, 11, 76, 16,252,228,236,212,196,236,228, 16,238, 16,238,246,238, 16,238, 17, 18, 57, 17, 18, 57, 49, 0, - 16,228, 50,244, 60, 60,228, 50,236, 50, 16,238,246,238, 16,238, 50, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, 34, 1, - 75,176, 20, 84, 75,176, 9, 84, 91, 75,176, 11, 84, 91, 75,176, 12, 84, 91, 75,176, 13, 84, 91, 75,176, 14, 84, 91, 88,189, 0, - 76, 0, 64, 0, 1, 0, 76, 0, 76,255,192, 56, 17, 55, 56, 89, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 39, 50, 22, 21, - 20, 6, 35, 34, 38, 53, 52, 54, 1, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 33, 51, 1, 35, 19, 34, 6, 21, 20, 22, 51, 50, - 54, 53, 52, 38, 1, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 23, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 8,244, 87,100, -100, 87, 85, 99, 99, 85,158,186,187,157,160,186,187,249,116,158,188,187,159,159,185,186, 4, 37,160,252, 90,160, 31, 86, 99, 98, - 87, 87, 99,100, 3,178,158,186,187,157,160,186,187,159, 87, 99, 99, 87, 85, 99, 99, 2,145,148,132,130,149,149,130,131,149,127, -220,187,187,219,219,187,188,219, 2,224,219,187,189,218,219,188,186,220,249,243, 5,142,149,130,132,148,148,132,129,150,253,159, -220,187,187,219,219,187,188,219,127,148,132,130,149,149,130,131,149, 0, 0, 0, 0, 9, 0,113,255,227, 13,114, 5,240, 0, 11, - 0, 22, 0, 34, 0, 45, 0, 55, 0, 59, 0, 69, 0, 80, 0, 92, 0, 0, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 39, 50, - 22, 16, 6, 35, 34, 38, 53, 52, 54, 5, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 39, 50, 22, 16, 6, 35, 34, 38, 53, 52, 54, - 0, 32, 22, 21, 20, 6, 32, 38, 53, 52, 37, 51, 1, 35, 18, 34, 6, 21, 20, 22, 50, 54, 53, 52, 1, 50, 22, 16, 6, 35, 34, 38, - 53, 52, 54, 23, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 12, 26, 87,100,100, 87, 85, 99, 99, 85,158,186,187,157,160,186,187, -253,121, 87,100,100, 87, 85, 99, 99, 85,158,186,187,157,160,186,187,248,214, 1, 60,188,187,254,194,185, 4,223,160,252, 90,160, -117,172, 99, 98,174, 99, 3, 78,158,186,187,157,160,186,187,159, 87, 99, 99, 87, 85, 99, 99, 2,145,148,132,130,149,149,130,131, -149,127,220,254,138,219,219,187,188,219,127,148,132,130,149,149,130,131,149,127,220,254,138,219,219,187,188,219, 2,224,219,187, -189,218,219,188,186,220,249,243, 5,142,149,130,132,148,148,132,129,254, 53,220,254,138,219,219,187,188,219,127,148,132,130,149, -149,130,131,149, 0, 1, 0, 40, 4, 96, 1,160, 5,213, 0, 3, 0, 0, 27, 1, 51, 1, 40,173,203,254,223, 4, 96, 1,117,254, -139, 0, 0, 0,255,255, 0, 40, 4, 96, 2,204, 5,213, 16, 38, 5,159, 0, 0, 16, 7, 5,159, 1, 44, 0, 0,255,255, 0, 40, - 4, 96, 3,248, 5,213, 16, 39, 5,159, 1, 44, 0, 0, 16, 38, 5,159, 0, 0, 16, 7, 5,159, 2, 88, 0, 0, 0, 1, 0, 40, - 4, 96, 1,160, 5,213, 0, 3, 0, 0, 1, 35, 1, 51, 1,160, 87,254,223,203, 4, 96, 1,117,255,255, 0, 40, 4, 96, 2,204, - 5,213, 16, 38, 5,162, 0, 0, 16, 7, 5,162, 1, 44, 0, 0,255,255, 0, 40, 4, 96, 3,248, 5,213, 16, 38, 5,162, 0, 0, - 16, 39, 5,162, 2, 88, 0, 0, 16, 7, 5,162, 1, 44, 0, 0, 0, 1, 0, 11,254, 29, 2,171,255,195, 0, 5, 0, 0, 1, 35, - 39, 7, 35, 1, 2,171,148,187,188,149, 1, 82,254, 29,249,249, 1,166, 0, 0, 0, 1, 0,158, 0,141, 2,115, 4, 35, 0, 6, - 0, 71, 64, 37, 3,232, 4, 5, 4, 2,232, 1, 2, 5, 5, 4, 2,232, 3, 2, 6, 0, 6, 1,232, 0, 6, 66, 2, 4,231, 0, -166, 7, 2, 3, 0,111, 5,110, 7, 16,252,236, 50, 57, 49, 0, 16,244,236, 57, 48, 75, 83, 88, 7, 4,237, 7, 16, 8,237, 7, - 16, 8,237, 7, 16, 4,237, 89, 34, 1, 21, 9, 1, 21, 1, 53, 2,115,254,211, 1, 45,254, 43, 4, 35,191,254,244,254,244,191, - 1,162, 82, 0, 0, 1, 0,193, 0,141, 2,150, 4, 35, 0, 6, 0, 73, 64, 38, 5,232, 6, 5, 2, 3, 2, 4,232, 3, 3, 2, - 6,232, 0, 1, 0, 5,232, 4, 5, 1, 1, 0, 66, 5, 3,231, 0,166, 7, 5, 1,111, 3, 0,112, 7, 16,252, 60,236, 57, 49, - 0, 16,244,236, 57, 48, 75, 83, 88, 7, 16, 8,237, 7, 16, 4,237, 7, 16, 4,237, 7, 16, 8,237, 89, 34, 19, 1, 21, 1, 53, - 9, 1,193, 1,213,254, 43, 1, 45,254,211, 4, 35,254, 94, 82,254, 94,191, 1, 12, 1, 12, 0,255,255, 0,195, 0, 4, 5,235, - 5,204, 18, 34, 0,153, 0, 75, 16, 35, 0, 17,255,232, 2, 78, 16, 35, 0, 17, 2, 22, 0, 4, 16, 35, 0, 17, 4, 61, 2, 78, - 16, 3, 0, 17, 2, 22, 4,206,255,255, 0,147, 0, 0, 3, 79, 5,213, 16, 39, 0, 4,255, 94, 0, 0, 16, 7, 0, 4, 1, 79, - 0, 0, 0, 0, 0, 3, 0,147, 0, 0, 3,176, 5,240, 0, 23, 0, 27, 0, 36, 0, 0, 1, 35, 17, 6, 7, 6, 7, 53, 62, 1, - 51, 50, 22, 21, 20, 6, 15, 1, 14, 1, 7, 14, 1, 21, 3, 51, 21, 35, 19, 17, 55, 62, 1, 53, 52, 39, 38, 2, 76,191, 31, 32, - 90, 97, 94,193,103,184,223, 72, 90, 88, 47, 39, 8, 6, 6,197,203,203,197, 45, 57, 51, 65, 37, 1,145, 3,173, 8, 13, 35, 67, -188, 57, 56,194,159, 76,137, 86, 86, 47, 53, 25, 21, 60, 52,254,242,254, 5, 66,254, 82, 45, 53, 94, 49, 89, 55, 31, 0, 0, 0, -255,255,255,236, 5,124, 4, 20, 6, 11, 16, 7, 0, 66, 0, 0, 7, 95, 0, 0, 0, 1,255,167,254, 27, 6,199,255,133, 0, 13, - 0, 37,179, 4, 15, 10, 14, 16,196,212,196,179, 7, 0, 15, 14, 17, 18, 57, 57, 49, 64, 7, 11, 3, 10, 4, 7, 0, 14, 0, 16, -212,220,220, 60,204, 50, 48, 1, 50, 36, 55, 21, 6, 4, 35, 34, 36, 39, 53, 22, 4, 3, 54,231, 1,197,229,235,254, 58,224,223, -254, 60,236,230, 1,194,254,181,104,104,126,118,118,117,119,126,105,103, 0, 0, 0, 1,255,167, 6, 4, 6,199, 7,110, 0, 13, - 0, 37,179, 4, 15, 10, 14, 16,196,212,196,179, 7, 0, 15, 14, 17, 18, 57, 57, 49, 64, 7, 10, 4, 11, 3, 0, 7, 14, 0, 16, -212,220,220, 60,204, 50, 48, 1, 50, 4, 23, 21, 38, 36, 35, 34, 4, 7, 53, 54, 36, 3, 54,224, 1,198,235,229,254, 59,231,231, -254, 62,230,236, 1,196, 7,110,118,118,126,104,104,103,105,126,119,117, 0, 0, 0, 1,255,170,254, 29, 2, 73, 1,213, 0, 7, - 0, 0, 1, 51, 9, 1, 35, 11, 1, 35, 1,231, 98,254,226, 1, 30, 98,237,237, 99, 1,213,254, 36,254, 36, 1,138,254,118, 0, -255,255, 0, 61,255,197, 7,195, 6,131, 16, 35, 0, 13, 0, 0,253,123, 16, 35, 0, 13, 4, 0,253,123, 16, 3, 0, 13, 2, 0, - 0,147, 0, 0,255,255, 0,221, 2,129, 3, 51, 3, 95, 18, 67, 2, 34, 0, 8,250,110, 64, 0, 96, 0, 0, 0, 0, 1,254,137, -255,227, 2,205, 5,240, 0, 3, 0, 43, 64, 19, 0, 15, 1, 2, 1, 2, 15, 3, 0, 3, 66, 2,140, 0,145, 4, 1, 3, 4, 16, -212,204, 49, 0, 16,228,228, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, 34, 1, 51, 1, 35, 2, 45,160,252, 92,160, 5, -240,249,243, 0, 0, 1, 0,176,254,242, 2, 88, 6, 20, 0, 11, 0, 0, 1, 17, 51, 21, 33, 17, 33, 21, 35, 17, 51, 21, 1,104, -240,254, 88, 1,168,240,240, 2, 94,253, 35,143, 7, 34,143,253, 35, 74, 0, 0, 0, 1, 0,176,254,242, 2, 88, 6, 20, 0, 11, - 0, 0, 19, 53, 51, 17, 35, 53, 33, 17, 33, 53, 51, 17,176,240,240, 1,168,254, 88,240, 2, 94, 74, 2,221,143,248,222,143, 2, -221, 0, 0, 0,255,255, 0, 73, 0, 0, 7, 23, 5,240, 16, 38, 0, 34,182, 0, 16, 7, 0, 34, 3,102, 0, 0,255,255, 0,147, - 0, 0, 5, 74, 5,240, 16, 38, 0, 34, 0, 0, 16, 7, 0, 4, 3, 74, 0, 0,255,255, 0,147, 0, 0, 5, 74, 5,240, 16, 39, - 0, 4,255, 94, 0, 0, 16, 7, 0, 34, 1,154, 0, 0, 0, 0, 0, 1, 0,111, 0, 0, 3,161, 4,132, 0, 19, 0, 0, 37, 51, - 21, 35, 53, 7, 35, 19, 35, 53, 33, 19, 33, 53, 33, 21, 3, 51, 21, 35, 1,254,169,209, 3,180,224,249, 1, 36,168,253,157, 3, - 50,195,165,208,102,102, 7, 7, 2, 15,102, 1,139,132, 67,254, 52,102, 0, 0, 0, 1, 0,236,255, 59, 4,135, 5,213, 0, 13, - 0, 0, 1, 33, 17, 51, 17, 51, 17, 51, 17, 62, 1, 53, 52, 36, 2,172,254, 64,141,190,142,215,235,254,252, 5,213,249,102, 6, - 31,249,225, 3, 78, 17,221,184,190,232, 0, 0, 0, 2, 0,216, 1,194, 3, 40, 4, 18, 0, 3, 0, 11, 0, 0, 1, 51, 17, 7, - 43, 1, 34, 38, 53, 52, 54, 51, 2,121,175,175,118, 2,125,172,173,126, 4, 18,253,177, 1,172,125,124,171, 0, 0, 2, 0,216, - 1,194, 3, 40, 4, 18, 0, 3, 0, 11, 0, 0, 1, 39, 17, 59, 1, 50, 22, 21, 20, 6, 43, 1, 1,135,175,175,118,126,173,172, -125, 2, 1,194, 1, 2, 79,171,124,125,172, 0,255,255, 0, 61,255,197, 3,195, 3,107, 18, 3, 0, 13, 0, 0,253,123, 0, 0, - 0, 2, 1, 29,255, 18, 2, 66, 4, 35, 0, 3, 0, 9, 0, 0, 1, 35, 21, 51, 17, 35, 21, 19, 51, 3, 1,240,211,211,211,164, -129, 82, 4, 35,254,253,217,172,254,192, 1, 64,255,255,255,167,254, 27, 6,199, 7,110, 16, 38, 5,172, 0, 0, 16, 6, 5,173, - 0, 0, 0, 0,255,255, 0, 61,255,242, 3,195, 7,111, 18, 35, 0, 13, 0, 0,253,168, 16, 3, 0, 13, 0, 0, 1,127, 0, 0, -255,255, 0,145,255, 66, 3, 67, 5,213, 16, 35, 0, 18, 0,145, 0, 0, 16, 35, 0, 17, 1,142, 0, 0, 16, 3, 0, 17,255,217, - 4, 72, 0, 0,255,255, 0,217, 1,211, 5,219, 3, 49, 18, 2, 0, 97, 0, 0,255,255,255,167,254, 20, 6,199,255,126, 16, 7, - 5,173, 0, 0,248, 16, 0, 0, 0, 1, 1, 56, 0,200, 5,124, 5, 13, 0, 23, 0, 0, 1, 17, 35, 17, 7, 39, 55, 33, 53, 33, - 39, 55, 23, 17, 51, 17, 55, 23, 7, 33, 21, 33, 23, 7, 3,170,160,249,113,249,254,159, 1, 97,250,113,250,160,250,113,250, 1, - 97,254,159,250,113, 2, 41,254,159, 1, 96,249,114,249,160,250,114,251, 1, 98,254,158,250,113,250,160,249,114, 0, 3, 0,250, - 1, 50, 3,182, 4,182, 0, 3, 0, 7, 0, 11, 0, 0, 19, 53, 51, 21, 1, 53, 51, 21, 3, 53, 51, 21,250,200, 1, 44,200,200, -200, 2,144,200,200,254,162,200,200, 2,188,200,200, 0, 0, 0,255,255, 0, 40, 4, 96, 5, 36, 5,213, 16, 39, 5,159, 1, 44, - 0, 0, 16, 38, 5,159, 0, 0, 16, 39, 5,159, 3,132, 0, 0, 16, 7, 5,159, 2, 88, 0, 0, 0, 4, 1,102, 1, 0, 5, 78, - 4,232, 0, 3, 0, 7, 0, 11, 0, 15, 0, 0, 1, 53, 51, 21, 33, 53, 51, 21, 1, 53, 51, 21, 3, 53, 51, 21, 1,102,200, 2, - 88,200,253,168,200,200,200, 2,144,200,200,200,200,254,112,200,200, 3, 32,200,200, 0, 0, 0, 0, 5, 1,102, 0,246, 5, 78, - 4,222, 0, 3, 0, 7, 0, 11, 0, 15, 0, 19, 0, 0, 1, 53, 51, 21, 19, 53, 51, 21, 3, 53, 51, 21, 1, 53, 51, 21, 3, 53, - 51, 21, 2,246,200,200,200,200,200,252, 44,200,220,200, 2,134,200,200,254,112,200,200, 3, 32,200,200,252,244,200,200, 3, 12, -200,200, 0, 0, 0, 2, 0,219, 0, 0, 1,174, 5,213, 0, 3, 0, 7, 0, 0, 19, 51, 21, 35, 17, 51, 21, 35,219,211,211,211, -211, 5,213,254,252, 39,254, 0, 0, 4, 0,100,254,229, 5,253, 6,239, 0, 3, 0, 7, 0, 11, 0, 15, 0, 0, 19, 51, 21, 35, - 37, 51, 21, 35, 1, 51, 21, 35, 17, 51, 21, 35,100,211,211, 4,198,211,211,253,157,211,211,211,211, 3,105,254,254,254, 4,132, -254,249,242,254, 0, 5, 0,112, 0, 0, 6, 68, 5,213, 0, 3, 0, 7, 0, 11, 0, 15, 0, 27, 0, 0, 37, 53, 51, 21, 3, 53, - 51, 21, 1, 53, 51, 21, 3, 53, 51, 21, 1, 17, 35, 17, 33, 53, 33, 17, 51, 17, 33, 21, 4,134,200,200,200,252, 44,200,220,200, - 1,124,160,253,102, 2,154,160, 2,154,246,200,200, 3, 32,200,200,252,244,200,200, 3, 12,200,200,254,132,253,102, 2,154,160, - 2,155,253,101,160, 0, 0, 0, 0, 3, 0,219, 0, 80, 1,174, 5, 62, 0, 3, 0, 7, 0, 11, 0, 0, 19, 51, 21, 35, 17, 51, - 21, 35, 17, 51, 21, 35,219,211,211,211,211,211,211, 5, 62,254,253, 14,254, 2,246,254, 0, 0, 0, 4, 0,219, 0, 17, 1,174, - 5,119, 0, 3, 0, 7, 0, 11, 0, 15, 0, 0, 19, 51, 21, 35, 17, 51, 21, 35, 17, 51, 21, 35, 17, 51, 21, 35,219,211,211,211, -211,211,211,211,211, 2,137,254, 3,236,254,252,150,254, 3,240,254, 0, 0, 0, 0, 2, 0, 87, 2,141, 2,238, 5,240, 0, 13, - 0, 25, 0, 0, 0, 34, 7, 6, 21, 20, 23, 22, 50, 55, 54, 53, 52, 47, 1, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 54, 2, 8, -202, 50, 51, 51, 50,202, 50, 51, 51,151,161,170,170,161,162,170,170, 5,151, 86, 86,172,173, 86, 86, 86, 86,173,172, 86,175,222, -211,212,222,222,212,211,222, 0, 0, 2, 0,121, 2,156, 0,238, 6, 4, 0, 3, 0, 7, 0, 31, 64, 6, 9, 5, 1, 4, 0, 8, - 16,220, 60,220, 60,204, 49, 0, 64, 6, 4, 7, 0, 3, 0, 8, 16,212,196, 16,220,204, 48, 19, 51, 17, 35, 17, 51, 21, 35,122, -116,116,116,116, 5, 15,253,141, 3,103,130, 0, 0, 2, 0, 63, 2,156, 2,244, 5,223, 0, 2, 0, 13, 0,212, 64, 22, 0, 3, - 11, 7,221, 5, 1, 9,247, 3,145, 14, 1, 12, 10, 0, 93, 6, 8, 4, 12, 14, 16,220,212, 60,196,236, 50, 17, 57, 49, 0, 16, -244,252,212, 60,236, 50, 18, 57, 48, 1, 75,176, 14, 84, 75,176, 15, 84, 91, 75,176, 16, 84, 91, 75,176, 17, 84, 91, 75,176, 11, - 84, 91, 75,176, 10, 84, 91, 88,189, 0, 14, 0, 64, 0, 1, 0, 14, 0, 14,255,192, 56, 17, 55, 56, 89, 0, 75,176, 17, 84, 75, -176, 14, 84, 91, 88,189, 0, 14,255,192, 0, 1, 0, 14, 0, 14, 0, 64, 56, 17, 55, 56, 89, 64, 84, 11, 1, 29, 1, 47, 1, 57, - 1, 73, 1, 70, 3, 89, 3,105, 3,139, 3,171, 3,187, 3, 11, 1, 0, 15, 1, 15, 2, 15, 5, 15, 6, 15, 7, 15, 8, 15, 11, - 15, 12, 15, 13, 19, 0, 31, 1, 31, 2, 31, 5, 31, 6, 31, 7, 31, 8, 31, 11, 31, 12, 31, 13, 34, 0, 53, 0, 71, 0, 75, 13, - 83, 0, 91, 13,101, 0,132, 0,165, 0,181, 0, 30, 93, 1, 93, 9, 1, 33, 3, 51, 17, 51, 21, 35, 21, 35, 53, 33, 53, 1,221, -254,203, 1, 53, 22,166,135,135,144,254, 98, 5,102,254, 93, 2, 28,253,228,109,186,186,121, 0, 0, 1, 0,102, 2,141, 2,211, - 5,223, 0, 32, 0, 0, 19, 33, 21, 33, 21, 54, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 35, 34, 38, 39, 53, 22, 23, 22, 51, 50, - 54, 52, 38, 35, 34, 6, 7,142, 1,254,254,121, 28, 29, 28, 28,161, 94, 94, 97, 96,176, 60,126, 66, 57, 62, 62, 69,111,130,130, -111, 52,104, 54, 5,223, 95,204, 9, 4, 4, 77, 76,131,135, 75, 74, 18, 18,113, 27, 14, 13,102,174,102, 20, 21, 0, 2, 0, 92, - 2,141, 2,243, 5,240, 0, 15, 0, 47, 0, 0, 1, 34, 7, 6, 21, 20, 23, 22, 51, 50, 55, 54, 53, 52, 39, 38, 19, 21, 38, 39, - 38, 35, 34, 7, 6, 7, 54, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 35, 34, 38, 53, 52, 55, 54, 51, 50, 23, 22, 1,179, 88, 51, - 51, 51, 51, 88, 87, 51, 51, 51, 51,171, 49, 50, 50, 49,128, 68, 68, 10, 38, 57, 58, 68,145, 84, 84, 88, 87,145,167,176,108,108, -182, 49, 50, 50, 4,109, 52, 53, 91, 90, 52, 53, 53, 52, 90, 91, 53, 52, 1, 98,103, 20, 10, 11, 75, 76,153, 49, 26, 26, 76, 77, -132,127, 79, 78,222,212,198,117,118, 8, 9, 0, 0, 1, 0,108, 2,156, 2,213, 5,223, 0, 6, 0, 0, 19, 33, 21, 1, 35, 1, - 33,108, 2,105,254,164,136, 1, 72,254, 51, 5,223, 48,252,237, 2,228, 0, 0, 0, 3, 0, 89, 2,141, 2,236, 5,240, 0, 12, - 0, 42, 0, 58, 0, 0, 0, 34, 7, 6, 21, 20, 22, 51, 50, 55, 54, 52, 39, 37, 38, 39, 38, 53, 52, 54, 32, 23, 22, 21, 20, 7, - 6, 7, 22, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 53, 52, 55, 54, 55, 20, 23, 22, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 7, - 6, 2, 0,186, 53, 53,106, 93, 92, 54, 53, 53,254,236, 84, 46, 47,164, 1, 30, 82, 81, 46, 47, 83, 90, 56, 53, 85, 86,158,159, - 85, 86, 53, 54, 45, 47, 46, 85, 81, 49, 48, 48, 47, 83, 83, 48, 47, 4, 42, 44, 43, 75, 76, 86, 44, 43,150, 43, 93, 18, 49, 50, - 72,100,116, 58, 58,100, 74, 48, 49, 18, 18, 58, 55, 80,121, 65, 65, 65, 65,121, 78, 57, 56,198, 63, 38, 37, 37, 36, 65, 63, 38, - 37, 37, 36, 0, 0, 2, 0, 83, 2,141, 2,233, 5,240, 0, 31, 0, 46, 0, 0, 19, 53, 22, 23, 22, 51, 50, 55, 54, 55, 6, 7, - 6, 35, 34, 38, 53, 52, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 19, 50, 54, 53, 52, 39, 38, 35, 34, 7, 6, 21, - 20, 23, 22,145, 49, 50, 50, 48,129, 68, 67, 10, 35, 60, 57, 69,144,168, 87, 88,145,167, 87, 88,107,108,182, 49, 50, 50,204, 88, -102, 51, 51, 88, 85, 53, 52, 52, 51, 2,174,103, 20, 11, 10, 75, 75,154, 47, 27, 26,152,132,129, 77, 78,111,111,212,198,117,118, - 8, 9, 1,114,104, 92, 90, 52, 53, 53, 52, 90, 92, 52, 52, 0, 0, 1, 0,137, 2,156, 3,176, 5,107, 0, 11, 0, 0, 1, 17, - 33, 21, 33, 17, 35, 17, 33, 53, 33, 17, 2, 81, 1, 95,254,161,105,254,161, 1, 95, 5,107,254,200, 95,254,200, 1, 56, 95, 1, - 56, 0, 0, 0, 0, 1, 0,137, 3,212, 3,176, 4, 51, 0, 3, 0, 0, 19, 33, 21, 33,137, 3, 39,252,217, 4, 51, 95, 0, 0, - 0, 2, 0,137, 3, 97, 3,176, 4,165, 0, 3, 0, 7, 0, 0, 19, 33, 21, 33, 21, 33, 21, 33,137, 3, 39,252,217, 3, 39,252, -217, 4,165, 94,135, 95, 0, 0, 0, 1, 0,111, 2, 5, 1,144, 6, 2, 0, 13, 0, 0, 1, 14, 1, 16, 22, 23, 35, 38, 39, 38, - 52, 55, 54, 55, 1,144, 84, 82, 82, 84,101, 94, 47, 47, 47, 46, 95, 6, 2,129,252,254,254,254,128,131,128,127,250,127,126,132, - 0, 1, 0,103, 2, 5, 1,136, 6, 2, 0, 15, 0, 0, 19, 51, 22, 23, 22, 20, 7, 6, 7, 35, 54, 55, 54, 16, 39, 38,103,101, - 95, 47, 46, 46, 47, 95,101, 84, 41, 42, 42, 41, 6, 2,132,126,127,250,127,128,131,128,127,127, 1, 2,126,126, 0, 1, 0,117, - 2,156, 2,197, 5, 31, 0, 19, 0, 48, 64, 7, 21, 0, 3, 14, 10, 11, 20, 16,212,220, 60, 47,204,204, 75,176, 13, 81, 88,177, - 21, 64, 56, 89, 49,178,127, 21, 1, 93, 0, 64, 6, 6, 17, 12, 2, 11, 20, 16,212, 60,196,212,204, 48, 1, 17, 35, 17, 52, 38, - 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 22, 2,196,116, 78, 78, 94,108,117,117, 41,113, 74,121,125, 4, 23,254,133, - 1,119, 89, 89,107, 92,254,158, 2,115, 97, 56, 56,134, 0, 0,255,255, 0, 87,255,241, 2,238, 3, 84, 16, 7, 5,204, 0, 0, -253,100, 0, 0,255,255, 0,137, 0, 0, 2,197, 3, 67, 16, 7, 0,123, 0, 0,253,100, 0, 0,255,255, 0, 94, 0, 0, 2,180, - 3, 84, 16, 7, 0,116, 0, 0,253,100, 0, 0,255,255, 0, 98,255,241, 2,205, 3, 84, 16, 7, 0,117, 0, 0,253,100, 0, 0, -255,255, 0, 63, 0, 0, 2,244, 3, 67, 16, 7, 5,206, 0, 0,253,100, 0, 0,255,255, 0,102,255,241, 2,211, 3, 67, 16, 7, - 5,207, 0, 0,253,100, 0, 0,255,255, 0, 92,255,241, 2,243, 3, 84, 16, 7, 5,208, 0, 0,253,100, 0, 0,255,255, 0,108, - 0, 0, 2,213, 3, 67, 16, 7, 5,209, 0, 0,253,100, 0, 0,255,255, 0, 89,255,241, 2,236, 3, 84, 16, 7, 5,210, 0, 0, -253,100, 0, 0,255,255, 0, 83,255,241, 2,233, 3, 84, 16, 7, 5,211, 0, 0,253,100, 0, 0,255,255, 0,137, 0, 0, 3,176, - 2,207, 16, 7, 5,212, 0, 0,253,100, 0, 0,255,255, 0,137, 1, 56, 3,176, 1,151, 16, 7, 5,213, 0, 0,253,100, 0, 0, -255,255, 0,137, 0,197, 3,176, 2, 9, 16, 7, 5,214, 0, 0,253,100, 0, 0,255,255, 0,111,255,105, 1,144, 3,102, 16, 7, - 5,215, 0, 0,253,100, 0, 0,255,255, 0,103,255,105, 1,136, 3,102, 16, 7, 5,216, 0, 0,253,100, 0, 0, 0, 1, 0, 86, - 0, 0, 6,174, 5,214, 0, 35, 0, 0, 1, 14, 1, 35, 34, 0, 16, 0, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 16, 22, 51, 50, - 54, 55, 17, 33, 21, 33, 17, 33, 21, 33, 17, 33, 21, 33, 3,221, 79,178, 99,254,254,219, 1, 37,254,101,177, 78, 76,173, 98,192, -204,204,192, 98,173, 76, 2,196,253,211, 2, 22,253,234, 2, 58,253, 47, 1,184, 54, 54, 1, 55, 2, 28, 1, 55, 53, 54,159, 71, - 70,234,254, 68,234, 70, 71, 2, 10,128,254,181,128,254,107,128, 0, 3, 0,115,255,166, 4,190, 6, 57, 0, 39, 0, 46, 0, 52, - 0, 0, 1, 22, 23, 55, 51, 7, 22, 23, 21, 38, 39, 1, 51, 50, 54, 55, 21, 14, 1, 35, 34, 39, 7, 35, 55, 38, 39, 7, 35, 55, - 38, 39, 38, 17, 16, 55, 54, 37, 55, 51, 7, 6, 7, 6, 17, 20, 23, 1, 38, 39, 1, 22, 23, 3,104, 65, 62, 30,155, 47, 40, 37, - 58, 64,254,193, 18,119,211, 93, 97,216,121, 27, 26, 18,155, 25, 65, 57, 38,155, 65, 19, 17,178,178,160, 1, 8, 21,156,227,145, - 88,125, 82, 2, 52, 62, 67,254,193, 53, 65, 5,235, 8, 19,105,165, 22, 28,213, 60, 41,251,151, 94, 95,211, 72, 72, 2, 63, 87, - 18, 30,135,230, 18, 21,207, 1,103, 1,104,208,185, 20, 75,252, 31,112,157,254,216,238,148, 3,203, 19, 4,251,149, 40, 21, 0, - 0, 1, 0, 96,255,228, 4,179, 5,240, 0, 44, 0, 0, 37, 54, 55, 54, 55, 21, 14, 1, 35, 32, 0, 17, 16, 0, 33, 50, 22, 23, - 21, 46, 1, 35, 34, 2, 17, 16, 23, 22, 23, 17, 51, 21, 62, 1, 51, 50, 22, 31, 1, 46, 1, 35, 34, 6, 21, 3, 46, 97, 88,106, - 93, 97,217,121,254,202,254,155, 1,101, 1, 54,123,217, 95, 93,212,119,234,249,124, 94,153,152, 48,154,110, 15, 38, 23, 1, 26, - 60, 36,128,139,138, 7, 39, 47, 95,211, 72, 71, 1,158, 1,103, 1,104, 1,159, 71, 71,213, 95, 94,254,199,254,216,254,217,156, -117, 30, 3, 93,157, 92, 89, 4, 5,170, 16, 15,182,171, 0, 0, 0, 1, 0,133, 0, 0, 4,203, 5,213, 0, 17, 0, 0, 1, 17, - 33, 21, 33, 17, 33, 21, 33, 17, 51, 21, 35, 17, 35, 17, 35, 53, 1,113, 3, 90,253,112, 2, 80,253,176,250,250,202,236, 1,126, - 4, 87,170,254, 72,170,254,181, 69,254,199, 1, 57, 69, 0, 0, 0, 1, 0,129, 0, 0, 4, 98, 5,240, 0, 35, 0, 0, 1, 17, - 33, 21, 33, 53, 51, 17, 35, 53, 51, 53, 35, 53, 51, 53, 16, 54, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 29, 1, 33, 21, 33, 21, - 33, 21, 2, 53, 2, 45,252, 31,236,191,191,199,199,214,232, 61,151, 79, 76,136, 61,148,116, 1,135,254,121, 1,143, 1,236,254, -190,170,170, 1, 66,143,143,143, 95, 1, 5,243, 31, 29,182, 41, 41,155,212, 72,143,143,143, 0, 0, 1, 0,186,255,189, 7, 29, - 4,171, 0, 42, 0, 0, 1, 22, 23, 62, 1, 51, 50, 22, 21, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 17, 52, 39, 1, 35, 1, - 38, 35, 34, 6, 21, 17, 35, 17, 51, 21, 62, 1, 51, 50, 23, 55, 51, 3,204, 61, 32, 69,192,130,175,190,185,114,117,143,166,185, - 14,254,240,128, 1, 59, 53, 81,141,166,185,185, 63,176,121, 74, 60, 22,128, 4, 33, 59, 93,124,118,245,226,253, 92, 2,158,161, -156,190,164,253,135, 2,158, 82, 60,252,145, 3,250, 36,191,163,253,135, 4, 96,174,103, 98, 23, 71, 0, 0, 0, 0, 5, 0,117, - 0, 0, 5,135, 5,213, 0, 2, 0, 6, 0, 34, 0, 38, 0, 41, 0, 0, 1, 39, 21, 19, 39, 35, 21, 3, 33, 19, 51, 17, 51, 17, - 51, 21, 35, 21, 51, 21, 35, 17, 33, 3, 35, 17, 35, 17, 35, 53, 51, 53, 35, 53, 51, 5, 23, 51, 53, 3, 23, 53, 2, 75, 79,182, - 56,126,196, 1, 16,211,229,196,195,195,195,195,254,240,211,229,196,195,195,195,195, 2, 18, 56,126, 79, 79, 3,175,206,206,254, -242,147,147, 3, 52,253,218, 2, 38,253,218,123,147,123,253,218, 2, 38,253,218, 2, 38,123,147,123,123,147,147,254,242,206,206, - 0, 2, 0,201,255,227, 9,206, 5,213, 0, 8, 0, 80, 0, 0, 1, 17, 51, 50, 54, 53, 52, 38, 35, 1, 6, 7, 6, 43, 1, 17, - 35, 17, 33, 50, 23, 22, 23, 51, 17, 51, 17, 33, 21, 33, 17, 20, 22, 59, 1, 53, 30, 1, 51, 50, 54, 53, 52, 38, 47, 1, 46, 1, - 53, 52, 54, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 31, 1, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 35, 34, 38, 53, - 17, 1,135,239,133,145,145,133, 1,221, 6,113,122,236,239,190, 1,173,236,122, 87, 24, 81,174, 1,101,254,155, 71,108,171, 96, -187, 91,122,132, 95,161, 60,161,143,211,194, 96,169, 72, 74,158, 85,129,129, 93,139, 59,185,155,233,203, 85,183,102,171,201,152, - 5, 47,253,207,146,135,134,146,254,204,200,106,113,253,168, 5,213,113, 82,136, 1, 62,254,194,143,253,160,137, 78, 35, 53, 53, - 89, 81, 75, 80, 37, 15, 36,149,130,158,172, 30, 30,174, 40, 40, 84, 84, 64, 73, 33, 14, 42,153,137,156,182, 35, 35, 1,159,210, - 2, 96, 0, 0, 0, 2, 0,201,255,227, 8, 51, 5,213, 0, 7, 0, 69, 0, 0, 1, 17, 51, 50, 54, 16, 38, 35, 1, 23, 35, 3, - 46, 1, 43, 1, 17, 35, 17, 33, 32, 22, 21, 20, 6, 7, 30, 1, 31, 1, 22, 23, 22, 51, 50, 54, 53, 52, 38, 47, 1, 46, 1, 53, - 52, 54, 51, 50, 22, 23, 21, 46, 1, 35, 34, 6, 21, 20, 22, 31, 1, 30, 1, 21, 20, 6, 35, 34, 39, 38, 1,147,254,146,149,149, -146, 2,191, 4,217,191, 74,139,120,220,202, 1,200, 1, 0,252,131,125, 65,123, 62, 91, 98, 96, 99, 97,130,140,101,171, 64,171, -152,224,206,102,180, 76, 78,168, 90,137,137, 98,148, 63,196,165,247,216, 90, 97, 44, 5, 47,253,238,135, 1, 6,133,250,216, 7, - 1,127,150, 98,253,137, 5,213,214,216,141,186, 36, 22,144,126,180, 51, 25, 27, 89, 81, 75, 80, 37, 15, 36,149,130,158,172, 30, - 30,174, 40, 40, 84, 84, 64, 73, 33, 14, 42,153,137,156,182, 18, 8, 0, 0, 0, 0, 6, 0, 59, 0, 0, 7,174, 5,213, 0, 31, - 0, 34, 0, 38, 0, 41, 0, 45, 0, 49, 0, 0, 19, 39, 35, 53, 51, 39, 51, 23, 33, 55, 51, 23, 33, 55, 51, 7, 51, 21, 35, 7, - 51, 21, 35, 3, 35, 3, 35, 3, 35, 3, 35, 53, 5, 27, 1, 1, 23, 33, 55, 1, 27, 2, 7, 51, 39, 33, 23, 33, 55,182, 30, 93, - 58, 49,204, 48, 2, 19, 48,227, 48, 2, 19, 48,205, 49, 57, 93, 29,122,158,225,254,218,195,220,254,224,159, 4,192,165,165,254, -117, 29, 1,145, 29,251, 32,165,165,229, 29,125, 28,253, 76, 29, 1,145, 29, 4, 15,117,143,194,194,194,194,194,194,143,117,143, -252,128, 3,128,252,128, 3,128,143,143,253,103, 2,153, 1, 4,117,117,254,252,253,103, 2,153, 1, 4,117,117,117,117, 0, 0, - 0, 2, 0, 95,255,227, 5,241, 5,213, 0, 13, 0, 27, 0, 0, 19, 37, 32, 0, 25, 1, 35, 17, 52, 38, 35, 33, 17, 35, 41, 1, - 34, 0, 25, 1, 51, 17, 20, 22, 51, 33, 3, 51, 95, 2, 7, 0,255, 1, 6,184,157,176,254,177,184, 5,142,253,253,255,254,250, -184,157,176, 1, 83, 4,184, 5,210, 3,254,214,254,220,254,145, 1, 86,240,211,250,178, 1, 42, 1, 36, 1,111,254,170,240,211, - 5, 78, 0, 0,255,255, 0,129,254,192, 5, 4, 6, 20, 18, 34, 0,211, 16, 0, 16, 3, 2, 38, 0,138, 0, 0, 0, 1, 0, 0, -255,227, 4,143, 5,240, 0, 49, 1, 28, 64, 58, 32, 18,211, 34, 16, 43, 7,211, 9, 25,161, 26,174, 22,149, 29, 1,161, 0,174, - 4,149, 47,145, 29,140, 41, 9, 50, 43, 34, 33, 41, 35, 38, 18, 16, 10, 3, 13, 9, 17, 8, 44, 32, 38, 19, 7, 17, 8, 17, 13, - 28, 25, 0, 38, 42, 33, 47, 60,212,196, 50,252,196,196, 18, 57, 57, 18, 57, 57, 17, 18, 57, 17, 23, 57, 18, 57, 57, 17, 57, 57, - 49, 0, 16,196, 50,228,244,236,244,236, 16,238,246,238, 16,238, 50,221, 60,238, 50, 48, 1, 75,176, 9, 84, 75,176, 12, 84, 91, - 75,176, 13, 84, 91, 75,176, 15, 84, 91, 75,176, 23, 84, 91, 75,176, 24, 84, 91, 88,189, 0, 50,255,192, 0, 1, 0, 50, 0, 50, - 0, 64, 56, 17, 55, 56, 89, 64,122, 14, 0, 14, 1, 11, 2, 11, 49, 84, 20,105, 12,108, 14,110, 15,111, 16,111, 17,111, 18,111, - 19,105, 20,107, 31,111, 32,111, 33,111, 34,111, 35,110, 36,108, 37,105, 39,105, 45,159, 7,159, 8,159, 9,159, 10,159, 11,159, - 12,159, 13,159, 14,159, 15,159, 16,159, 17,159, 18,159, 19,150, 31,159, 32,159, 33,159, 34,159, 35,159, 36,159, 37,159, 38,159, - 39,159, 40,159, 41,159, 42,159, 43,159, 44,157, 45, 50, 0, 8, 0, 9, 16, 8, 16, 9, 32, 8, 32, 9, 85, 21, 83, 30,106, 21, -103, 31, 10, 93, 0, 93, 1, 21, 46, 1, 35, 34, 6, 7, 33, 7, 33, 14, 1, 21, 20, 22, 23, 33, 7, 33, 30, 1, 51, 50, 54, 55, - 21, 14, 1, 35, 34, 0, 3, 35, 55, 51, 52, 38, 53, 52, 54, 53, 35, 55, 51, 18, 0, 51, 50, 22, 4,143, 91,169,102,157,202, 32, - 2, 65, 55,253,230, 2, 1, 1, 2, 1,190, 56,254,138, 32,202,157,102,169, 91, 89,185, 96,237,254,203, 40,211, 55,139, 1, 1, -194, 55,156, 40, 1, 54,236, 98,185, 5, 98,213,105, 90,200,187,123, 24, 46, 35, 32, 46, 24,123,187,202, 90,105,211, 72, 72, 1, - 34, 1, 3,123, 23, 47, 32, 35, 47, 23,123, 1, 1, 1, 34, 71, 0, 1, 0, 40, 0, 0, 5, 22, 5,213, 0, 17, 0, 0, 19, 17, - 51, 17, 1, 51, 1, 33, 21, 33, 1, 35, 1, 17, 35, 17, 35, 53,191,189, 2,117,243,253,128, 1,170,254, 88, 2,176,249,253, 95, -189,151, 3, 84, 2,129,253,137, 2,119,253,127,115,253, 31, 2,207,253, 49, 2,225,115, 0, 0, 0, 1, 0, 20, 0, 0, 5, 3, - 5,213, 0, 23, 0, 0, 1, 17, 33, 53, 33, 21, 33, 17, 55, 23, 5, 21, 55, 23, 5, 17, 35, 17, 7, 39, 37, 53, 7, 39, 2, 38, -253,238, 4,239,253,238,229, 80,254,203,230, 80,254,202,203,231, 77, 1, 52,232, 77, 3,141, 1,158,170,170,254,241,161,111,216, -136,162,111,217,253,184, 1,186,161,110,217,136,162,110, 0, 0, 0, 4, 0, 27,254,117, 8, 90, 5,200, 0, 23, 0, 35, 0, 48, - 0, 59, 0, 0, 51, 55, 51, 54, 55, 19, 34, 6, 29, 1, 7, 16, 55, 54, 33, 51, 50, 0, 21, 16, 3, 6, 4, 33, 55, 51, 32, 0, - 17, 52, 38, 43, 1, 3, 2, 6, 1, 19, 26, 1, 51, 32, 17, 16, 0, 35, 34, 39, 3, 19, 22, 51, 50, 18, 53, 52, 35, 34, 3, 7, - 28,148, 56,116, 42,172,130,150,194,160,160, 1,138, 64,226, 1, 4,238,124,254,172,254,212, 48,118, 1, 24, 1, 68,150,128, 80, -134, 52, 74, 2,140,160, 74,230,192, 1, 72,254,178,224, 52, 92, 86,124, 74, 74,132,176,150,156, 68, 26,160, 82,211, 3, 95,166, -145, 24, 94, 1, 17,159,161,254,234,241,254,119,254,218,152,122,160, 1,168, 1,110,174,208,253, 88,254,255,161,253,139, 3, 44, - 1,115, 1, 66,254,165,254,206,254, 55, 35,254, 82, 2,109, 78, 1, 67,246,245,254,185,130, 0, 0, 4, 0, 68, 0, 0, 4,162, - 5,213, 0, 29, 0, 36, 0, 43, 0, 49, 0, 0, 19, 53, 35, 53, 51, 17, 33, 50, 23, 22, 23, 51, 21, 35, 22, 20, 7, 51, 21, 35, - 6, 7, 6, 43, 1, 17, 35, 17, 35, 53, 5, 33, 21, 51, 50, 55, 54, 1, 33, 38, 39, 38, 43, 1, 5, 33, 21, 33, 54, 52,151, 82, - 82, 1,200,251,129, 76, 31, 92, 72, 1, 1, 71, 90, 31, 77,129,251,254,202, 83, 3, 28,254, 1,254,141, 77, 23,254, 17, 1,255, - 16, 23, 77,141,254, 2, 35,253,221, 2, 35, 2, 3,236, 86,116, 1, 31,113, 68,106,116, 21, 44, 21,116,107, 68,113,253,168, 3, -120,116,116,122, 73, 22, 1, 89, 27, 21, 73,237, 86, 21, 44, 0, 0, 1, 0,117,255,227, 5,188, 5,240, 0, 54, 0, 0, 1, 54, - 55, 54, 55, 33, 53, 33, 54, 55, 54, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 4, 21, 20, 7, 51, 21, 33, 6, 15, 1, 33, - 21, 33, 6, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 32, 36, 53, 52, 55, 35, 53, 1, 92, 4, 22, 74,128,254, 53, 3,146, 12, - 13, 59,179,165, 95,204,115,114,218,105,245, 1, 23, 25,175,254,253,103,216, 67, 2,133,252, 83, 49,188,173,114,236,123,128,239, -106,254,231,254,221, 18,168, 2,161, 7, 22, 74, 44,123, 8, 9, 43,107,118,128, 54, 55,197, 38, 38,228,198, 85, 66,123, 92, 42, - 13,123, 59, 94,126,136, 70, 69,208, 47, 48,224,217, 75, 63,123, 0, 2, 0,170,254,211, 4,119, 6, 20, 0, 33, 0, 44, 0, 0, - 1, 21, 38, 39, 38, 35, 17, 50, 55, 54, 55, 21, 6, 7, 6, 7, 17, 35, 17, 38, 39, 38, 17, 53, 16, 55, 54, 55, 53, 55, 21, 22, - 23, 22, 1, 3, 6, 7, 6, 7, 6, 23, 22, 23, 22, 4,119, 91, 84, 85,101,101, 85, 84, 91, 89, 92, 89, 91,100,185,115,212,212, -121,178,101, 93, 89, 92,254,138, 1, 91, 67,118, 15, 14, 14, 25,108, 67, 4,164,213,105, 45, 45,251,241, 45, 45,105,211, 72, 36, - 34, 2,254,240, 1, 21, 23,117,214, 1, 57, 17, 1, 66,203,116, 23,230, 2,226, 2, 34, 35,251,163, 3,249, 23, 66,117,170,161, -102,180,108, 67, 0, 1,252, 61, 4,122,255,203, 6, 20, 0, 8, 0, 0, 3, 33, 23, 35, 39, 55, 51, 7, 33, 53,253, 27,132,126, -175,175,126,132, 2,229, 5, 21,155,205,205,155, 0, 1,252, 61, 4,122,255,203, 6, 20, 0, 8, 0, 0, 1, 53, 33, 39, 51, 23, - 7, 35, 55,252, 61, 2,229,132,126,175,175,126,132, 5, 21,100,155,205,205,155, 0, 4, 0, 67,255,207, 7,216, 6, 4, 0, 10, - 0, 36, 0, 40, 0, 66, 0, 0, 1, 34, 6, 21, 20, 22, 51, 50, 54, 61, 1, 55, 17, 35, 53, 14, 1, 35, 34, 38, 53, 52, 54, 51, - 23, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 37, 51, 1, 35, 1, 21, 46, 1, 35, 34, 6, 21, 20, 22, 51, 50, 54, 55, 21, - 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 2, 15,160,112, 83, 72,102,127,188,188, 3,153,109,141,166,205,198,169,111,103, 68, -129, 99, 92,148, 71,194,193, 2,176,216,252, 68,216, 5,169, 94,111, 56,121,137,137,121, 56,111, 94, 73,130, 73,202,236,238,209, - 67,128, 3,246, 66, 82, 67, 73,148,130, 10, 77,254, 13, 62, 5, 79,158,129,150,155, 6, 87, 92, 32, 55,178, 36, 30,202,250,249, -203, 3,132,178, 52, 30,156,148,147,157, 31, 52,177, 34, 27,250,209,212,249, 27,255,255, 0,195,255,240, 8,140, 5,240, 16, 38, - 0,114, 0, 0, 16, 71, 0, 38, 3, 70, 0, 12, 65,117, 62, 82, 0, 2,255,214, 0, 0, 5, 24, 5,213, 0, 8, 0, 43, 0,153, -184, 0, 44, 47,184, 0, 45, 47,184, 0, 21,220,184, 0, 0,220,184, 0, 44, 16,184, 0, 40,208,184, 0, 40, 47,184, 0, 4,220, - 65, 27, 0, 22, 0, 4, 0, 38, 0, 4, 0, 54, 0, 4, 0, 70, 0, 4, 0, 86, 0, 4, 0,102, 0, 4, 0,118, 0, 4, 0,134, - 0, 4, 0,150, 0, 4, 0,166, 0, 4, 0,182, 0, 4, 0,198, 0, 4, 0,214, 0, 4, 0, 13, 93, 65, 5, 0,229, 0, 4, 0, -245, 0, 4, 0, 2, 93,184, 0, 0, 16,184, 0, 9,208,184, 0, 21, 16,184, 0, 11,208,184, 0, 21, 16,184, 0, 31,208,184, 0, - 0, 16,184, 0, 35,208, 0,184, 0, 10, 47,186, 0, 33, 0, 34, 0, 3, 43,184, 0, 33, 16, 48, 49, 1, 6, 7, 6, 21, 20, 23, - 22, 23, 17, 53, 51, 21, 22, 23, 22, 23, 21, 38, 39, 38, 39, 17, 54, 55, 54, 55, 21, 6, 7, 6, 7, 21, 33, 21, 33, 53, 38, 39, - 38, 17, 16, 55, 54, 1,119, 73, 51, 99, 99, 51, 73,202, 56, 54, 81, 76, 78, 78, 55, 56, 56, 55, 78, 78, 77, 82, 52, 56, 2,215, -252, 95,161,107,149,151,105, 4,179, 29, 58,114,205,205,113, 59, 29, 3,212,122,110, 4, 11, 18, 35,172, 43, 22, 15, 4,252,164, - 4, 16, 21, 43,170, 36, 18, 11, 4, 42,170,222, 32,114,159, 1, 14, 1, 18,157,110, 0, 0, 0, 0, 4, 0, 60,255,207, 7,229, - 6, 4, 0, 25, 0, 29, 0, 40, 0, 50, 0, 0, 1, 21, 46, 1, 35, 34, 6, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, - 53, 52, 54, 51, 50, 22, 37, 51, 1, 35, 1, 34, 6, 21, 20, 22, 51, 50, 54, 16, 38, 36, 32, 22, 21, 20, 6, 32, 38, 53, 52, 3, - 6, 94,111, 56,121,137,137,121, 56,111, 94, 73,130, 73,202,236,238,209, 67,128, 2,221,216,252, 68,216, 4,107, 97,118,118, 97, - 96,119,119,254,223, 1,130,218,218,254,126,217, 5,151,178, 52, 30,156,148,147,157, 31, 52,177, 34, 29,252,209,212,249, 27, 75, -249,203, 3, 4,158,146,145,159,160, 1, 32,160,157,248,213,212,248,248,212,213, 0, 3, 0, 60,255,207, 8, 77, 6, 4, 0, 19, - 0, 45, 0, 49, 0, 0, 1, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 38, 1, 21, 46, 1, 35, 34, - 6, 21, 20, 22, 51, 50, 54, 55, 21, 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 37, 51, 1, 35, 5, 92,188, 81, 80, 99,117,188, -188, 6,144, 96,158,161,253,170, 94,111, 56,121,137,137,121, 56,111, 94, 73,130, 73,202,236,238,209, 67,128, 2,221,216,252, 68, -216, 1, 76, 2, 16,253,245,114,105,129,117, 1,240,252,144, 68, 9, 80,193, 4,255,178, 52, 30,156,148,147,157, 31, 52,177, 34, - 29,252,209,212,249, 27, 75,249,203, 0, 0, 0,255,255, 0,195, 0, 0, 7, 38, 5,240, 16, 34, 0,114, 0, 0, 16, 3, 0, 41, - 3, 3, 0, 0, 0, 1, 0, 72, 0, 0, 4,135, 6, 20, 0, 25, 0, 0, 1, 3, 35, 19, 62, 1, 53, 52, 38, 35, 34, 6, 7, 3, - 35, 1, 51, 3, 62, 1, 51, 50, 22, 21, 20, 6, 4,117,131,185,131, 9, 10,106, 95,148,217, 32,121,184, 1, 47,184,119, 70,218, -120,148,163, 9, 2,164,253, 92, 2,157, 47, 72, 21, 84, 94,200,166,253,147, 6, 20,253,156, 94,109,160,145, 36, 82, 0, 0, 0, - 0, 1, 0, 34, 0, 0, 4, 98, 6, 20, 0, 29, 0, 0, 1, 54, 55, 54, 51, 50, 23, 22, 7, 3, 35, 19, 54, 38, 35, 34, 6, 7, - 3, 35, 19, 35, 55, 51, 55, 51, 7, 33, 7, 33, 1,148, 85, 99,100,117,193, 76, 75, 45,131,184,130, 31, 93,124,149,209, 32,123, -185,249,154, 25,154, 28,185, 28, 2, 64, 25,253,192, 3,178,101, 50, 50,119,120,232,253, 92, 2,158,159,158,190,164,253,135, 5, - 4,125,147,147,125, 0, 0, 0, 0, 2, 0,106,255,227, 5, 70, 5,240, 0, 33, 0, 50, 0, 0, 63, 1, 54, 51, 50, 23, 22, 51, - 50, 55, 54, 53, 52, 39, 38, 53, 52, 63, 1, 6, 21, 20, 23, 22, 21, 20, 7, 6, 35, 34, 39, 38, 35, 34, 19, 54, 51, 50, 23, 22, - 51, 50, 55, 7, 6, 35, 34, 38, 35, 34, 7,106,140,111,117, 57,132,144, 33,121,100, 71, 62, 80, 80,213, 80, 80, 53,202,186,242, - 54,129,133, 56, 94,110,109,141,123,127,122,128,125,125,200,139,111,143,214,143,122,128, 90,165, 39, 80, 86,137, 97, 75,126,112, -146,109,100,160,140,139,121,107,148, 98,188, 94,242,222, 79, 80, 5, 54, 56, 49, 47, 58,170, 58, 98, 58, 0, 0, 0, 2,255,228, -255,227, 2,210, 5,240, 0, 28, 0, 38, 0, 0, 1, 22, 51, 50, 55, 51, 6, 7, 6, 35, 34, 39, 7, 35, 54, 55, 38, 53, 52, 55, - 18, 55, 54, 51, 50, 21, 6, 7, 2, 1, 18, 19, 54, 53, 52, 35, 6, 3, 6, 1, 48, 41, 87, 58, 75,133, 60, 70, 76, 70,156, 63, - 75,156,108, 80, 10, 31,117,104, 72,123,125, 1, 18, 72,254,184,187, 57, 30, 25,109, 97, 27, 1, 12,200,115,102, 53, 57,139,110, -147,137, 78, 85,152,152, 2, 59,117, 81,173, 78, 93,254,131,254,247, 1, 92, 1, 22,147, 38, 69, 87,253,250,145,255,255, 0,201, - 0, 0, 8,240, 5,240, 16, 39, 0,124, 5,140, 0, 0, 16, 6, 0, 49, 0, 0, 0, 4, 1, 27, 0, 0, 6,229, 5,202, 0, 12, - 0, 25, 0, 34, 0, 45, 0, 0, 1, 22, 17, 16, 0, 33, 32, 0, 3, 16, 0, 33, 32, 6, 33, 32, 0, 17, 18, 0, 33, 32, 0, 17, - 16, 39, 5, 17, 51, 50, 54, 53, 52, 38, 35, 37, 33, 50, 22, 21, 20, 6, 43, 1, 17, 35, 6, 11,218,254, 74,254,209,254,207,254, - 82, 6, 1,180, 1, 49, 1, 50, 41,254,247,254,250,254,134, 5, 1,117, 1, 6, 1, 7, 1,121,187,253,211,178, 99,107,107, 99, -254,193, 1, 63,176,180,180,176,178,141, 4,241,219,254,206,254,208,254, 76, 1,180, 1, 48, 1, 48, 1,182,101,254,133,254,249, -254,251,254,135, 1,121, 1, 5, 1, 9,187,119,254,175, 88, 81, 80, 88,100,137,131,133,135,254,152, 0, 0, 0, 0, 2, 0,110, -254, 59, 5, 67, 3,246, 0, 48, 0, 60, 0, 0, 1, 6, 21, 20, 23, 54, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 35, 34, 39, 54, - 55, 22, 51, 50, 55, 54, 53, 52, 39, 38, 35, 34, 1, 18, 21, 20, 7, 6, 35, 34, 39, 38, 53, 16, 55, 38, 53, 52, 55, 3, 6, 21, - 20, 23, 22, 23, 50, 55, 54, 53, 52, 2, 53,136, 31, 91,171,219,132,131, 70, 73,156,121,174,101, 76, 18, 9, 41,113,122, 93, 69, - 38, 32, 74,189,254,159,135, 69, 89,131,113, 58, 63,223, 46,232,148,129, 31, 48, 46, 65, 28, 32, 3,198,130,190, 77,107,101,148, -189, 76, 80,171,218,215,167, 60, 43, 29, 40,140,104,195,124, 72, 61,254,121,254,222,124,157,110,142, 61, 66,134, 1, 11,252,158, -127,238,164,252,239,198,123,117, 46, 70, 1, 47, 52, 95, 78, 0, 0, 2, 0, 83,255,227, 6,108, 5,241, 0, 73, 0, 88, 0, 0, - 5, 38, 53, 52, 39, 38, 35, 34, 15, 1, 21, 20, 7, 6, 35, 34, 39, 38, 53, 22, 23, 20, 23, 22, 50, 55, 54, 53, 17, 52, 39, 38, - 35, 34, 7, 6, 20, 23, 22, 51, 23, 34, 39, 38, 53, 52, 55, 54, 51, 50, 23, 22, 23, 55, 54, 51, 50, 23, 22, 21, 20, 7, 6, 7, - 50, 23, 22, 23, 22, 21, 20, 23, 55, 23, 1, 22, 21, 17, 55, 54, 55, 54, 53, 52, 39, 38, 35, 34, 7, 5, 2, 82, 22, 40, 79, 42, - 92,120,103,103,140,141,102,103, 45, 46, 64, 64,144, 63, 64, 64, 63, 92, 81, 65, 64, 64, 64, 83, 54,151,102,103,103,102,151,162, -101, 30, 16,211,187,112, 47, 36,126, 65, 66,125, 58, 49, 36, 27, 32, 45,144, 42,252,164, 21,154,144, 77, 74, 74, 24, 31, 64,102, - 29,183,159,140, 91,166, 43, 56,199,206,118,117,117,118,176, 12, 12,122, 86, 87, 87, 87,150, 2,155,149, 88, 87, 87, 86,202, 86, - 87, 92,117,118,156,157,117,117,117, 35, 32, 98, 87, 14, 49,177, 87,123,124, 94, 49, 36,104,123,131,128,118, 67, 91, 4, 83, 75, - 92,254,149, 71, 67,104,102,121,151, 32, 10, 47, 0, 5, 0,118, 0, 0, 5,225, 5,213, 0, 7, 0, 27, 0, 31, 0, 39, 0, 48, - 0, 0, 1, 22, 23, 19, 51, 3, 38, 39, 32, 43, 1, 17, 33, 17, 33, 32, 22, 21, 20, 6, 7, 30, 1, 23, 19, 33, 3, 38, 1, 17, - 51, 17, 1, 17, 38, 35, 33, 17, 33, 50, 55, 54, 55, 54, 53, 52, 39, 38, 39, 3, 46, 78,102,142,200,142, 96, 90,254,164,120, 20, -254,110, 2,168, 1, 0,252,132,124, 64,124, 62,204,254, 72,190, 74,253,186,198, 1,238, 34, 38,254,194, 1, 62, 38,138, 58, 40, - 94, 94, 38, 60, 2,119, 47,201,254,229, 1, 27,192, 56,253,137, 5,213,214,216,141,186, 36, 22,144,126,254,104, 1,127,150, 3, - 92,250,243, 5, 13,253,110, 2,142, 4,253,106, 27, 21, 37, 84,164,158, 88, 36, 20, 0, 0, 0, 0, 2, 0,169, 0, 0, 6,131, - 5,213, 0, 8, 0, 31, 0,167,184, 0, 32, 47,184, 0, 33, 47,184, 0, 32, 16,184, 0, 14,208,184, 0, 14, 47,184, 0, 13,220, -184, 0, 0,208,184, 0, 33, 16,184, 0, 19,220,184, 0, 5,220, 65, 5, 0,234, 0, 5, 0,250, 0, 5, 0, 2, 93, 65, 27, 0, - 25, 0, 5, 0, 41, 0, 5, 0, 57, 0, 5, 0, 73, 0, 5, 0, 89, 0, 5, 0,105, 0, 5, 0,121, 0, 5, 0,137, 0, 5, 0, -153, 0, 5, 0,169, 0, 5, 0,185, 0, 5, 0,201, 0, 5, 0,217, 0, 5, 0, 13, 93,184, 0, 9,208,184, 0, 9, 47,186, 0, - 30, 0, 14, 0, 19, 17, 18, 57, 0,184, 0, 13, 47,184, 0, 26, 47,184, 0, 29, 47,186, 0, 15, 0, 0, 0, 3, 43,184, 0, 15, - 16,186, 0, 2, 0, 11, 0, 3, 43,184, 0, 2, 16, 48, 49, 1, 17, 51, 50, 54, 53, 52, 38, 35, 1, 6, 43, 1, 17, 35, 17, 33, - 50, 4, 21, 20, 7, 23, 55, 51, 9, 1, 35, 11, 1, 35, 1, 1,115,254,141,154,154,141, 1, 32,115,173,254,202, 1,200,251, 1, - 1, 78,174,190,232,254,205, 1, 67,233,207,212,232, 1, 73, 5, 47,253,207,146,135,134,146,253, 95, 54,253,168, 5,213,227,219, -172,107,219,234,254,134,254,107, 1, 4,254,252, 1,149, 0, 0, 0, 2, 1, 3, 3,139, 6, 40, 5,216, 0, 39, 0, 52, 0, 0, - 1, 21, 46, 1, 35, 34, 6, 21, 20, 22, 31, 1, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 47, 1, - 46, 1, 53, 52, 54, 51, 50, 22, 55, 51, 27, 1, 51, 17, 35, 17, 3, 35, 3, 17, 35, 2,230, 85, 87, 39, 65, 71, 47, 69, 56,112, -105,144,140, 52,115, 71, 91,100, 47, 69, 75, 55, 63, 56,112, 99,138,124, 51,105,208,184,161,162,184,138,140,135,141,137, 5,183, - 89, 34, 19, 42, 47, 40, 32, 11, 9, 18, 86, 65, 79, 91, 19, 21, 96, 42, 24, 44, 50, 44, 42, 10, 9, 18, 77, 61, 72, 92, 15, 5, -254,172, 1, 84,253,200, 1,148,254,216, 1, 40,254,108, 0, 0, 0, 3,255,252, 0, 0, 8, 48, 4, 96, 0, 7, 0, 19, 0, 25, - 0, 0, 3, 33, 21, 33, 17, 35, 17, 33, 5, 33, 21, 33, 17, 33, 21, 33, 17, 33, 21, 33, 1, 51, 17, 33, 21, 33, 4, 3,179,254, -114,152,254,115, 2,224, 2,111,254, 22, 1,213,254, 43, 1,246,253,133, 2,239,133, 1,224,253,155, 4, 96,128,252, 32, 3,224, - 96,102,254,247,102,254,187,102, 3,128,252,230,102, 0, 0, 0, 0, 2, 1, 39, 3,147, 6, 70, 5,213, 0, 12, 0, 20, 0, 62, - 64, 33, 1, 6, 7, 16, 10, 4, 18, 14, 9, 3, 6,201, 13, 2, 0,129, 21, 1, 9, 5, 98, 3, 9, 98, 11, 13, 99, 15, 98, 19, - 99, 17, 21, 16,212,228,252,228,212,236,212,236, 17, 57, 49, 0, 16,244, 60, 60,236, 23, 50,212, 60, 60,196, 17, 57, 48, 1, 27, - 1, 51, 17, 35, 17, 3, 35, 3, 17, 35, 17, 35, 21, 35, 17, 35, 17, 35, 53, 4, 74,174,164,170,113,195, 55,203,114,113,203,114, -201, 5,213,255, 0, 1, 0,253,190, 1,228,254,209, 1, 47,254, 28, 2, 66, 94,254, 28, 1,228, 94, 0, 0, 0,255,255, 0, 78, - 0, 0, 5,207, 5,231, 16, 6, 2,199, 0, 0, 0, 1, 0, 78,255,227, 5,207, 5,202, 0, 30, 0, 0, 1, 53, 33, 21, 22, 18, - 21, 20, 0, 32, 0, 53, 52, 18, 55, 53, 33, 21, 33, 6, 2, 21, 16, 0, 33, 32, 0, 17, 52, 2, 39, 5,207,253,168,177,198,254, -248,254, 80,254,247,199,178,253,168, 1, 63,158,145, 1,127, 1, 49, 1, 47, 1,129,142,161, 5, 24,178,178, 97,254,180,202,240, -254,222, 1, 35,239,202, 1, 76, 97,178,178,139,254,214,184,254,194,254,118, 1,137, 1, 53,194, 1, 40,141, 0,255,255, 0,201, - 0, 0, 5,106, 5,213, 16, 6, 0, 46, 0, 0,255,255, 0, 16, 0, 0, 5,104, 7,109, 16, 6, 0,135, 0, 0, 0, 2, 0,125, -255,231, 6, 89, 5, 45, 0, 26, 0, 41, 0, 0, 37, 22, 23, 22, 32, 55, 54, 55, 51, 6, 7, 6, 32, 36, 2, 53, 52, 18, 36, 51, - 50, 4, 18, 21, 33, 34, 21, 53, 20, 51, 33, 50, 53, 17, 38, 39, 38, 35, 34, 7, 6, 7, 1,144, 67, 93,150, 1, 74,152,106, 77, -111, 95,142,179,254,122,254,155,198,201, 1,103,190,189, 1,103,202,251, 74, 19, 19, 3,144, 20, 70, 95,152,159,160,152, 95, 68, -228, 77, 51, 84, 84, 60, 96,120, 71, 90,179, 1, 65,175,176, 1, 69,174,174,254,187,176, 19, 73, 19, 19, 1,112, 80, 51, 82, 81, - 52, 79, 0, 0, 0, 1, 0,201, 0, 0, 4, 35, 5,213, 0, 9, 0, 0, 41, 1, 53, 33, 17, 33, 53, 33, 17, 51, 4, 35,252,166, - 2,144,253,176, 2, 80,202,170, 1,184,170, 2,201, 0, 0, 0, 0, 2, 0,104,255,231, 3, 74, 3, 41, 0, 11, 0, 23, 0, 0, - 1, 52, 38, 35, 34, 2, 21, 20, 22, 51, 50, 18, 3, 50, 22, 21, 20, 2, 35, 34, 38, 53, 52, 18, 2,169, 87, 79,109,141, 86, 80, -109,141,194,152,203,221,162,152,203,221, 1,247,116,125,254,254,207,116,123, 1, 4, 1,253,216,163,198,254,255,216,163,198, 1, - 1, 0, 0, 0, 0, 1, 0,103,255,227, 5,178, 5,240, 0, 54, 0, 0, 9, 1, 22, 21, 20, 7, 52, 39, 1, 7, 6, 31, 1, 22, - 21, 20, 7, 6, 43, 1, 53, 54, 53, 52, 47, 1, 38, 53, 52, 63, 1, 39, 38, 53, 52, 55, 20, 23, 9, 1, 39, 38, 53, 52, 55, 20, - 31, 1, 22, 21, 20, 7, 52, 47, 1, 3,196, 1,139, 99,144, 50,252,251,155, 62, 66,172,100, 61, 86, 69,245,196, 47, 98, 53,140, -154,241, 99,144, 50, 2,108, 1, 25,116, 99,144, 50,182, 99,144, 50, 18, 2,208,254,117, 99, 49,130, 76, 83, 50, 3, 5,156, 63, - 66,172,100,106,108, 44, 62, 56, 63, 93, 29, 47, 99, 54,103, 85,141,155,241, 99, 49,130, 76, 83, 50,253,150, 1, 25,116, 99, 49, -130, 76, 83, 50,182, 99, 49,130, 76, 83, 50, 18, 0, 4, 0,151, 0, 0, 9, 76, 4, 96, 0, 9, 0, 12, 0, 20, 0, 32, 0, 0, - 19, 33, 21, 33, 17, 33, 21, 33, 17, 35, 1, 3, 33, 1, 51, 1, 35, 39, 33, 7, 35, 1, 51, 27, 1, 51, 9, 1, 35, 9, 1, 35, - 1,151, 2,131,254, 20, 1,188,254, 68,151, 3,131,181, 1,106,255, 0,151, 1,119,138, 90,254, 68, 90,140, 3,214,143,245,246, -144,254,195, 1, 82,144,254,235,254,233,144, 1, 96, 4, 96,128,254,182,127,253,233, 3, 8,254, 67, 2, 53,252,128,230,230, 3, -128,254,179, 1, 77,254, 82,254, 46, 1,125,254,131, 1,222, 0, 0, 2, 0, 59,255,227, 5,184, 5,240, 0, 38, 0, 48, 0, 0, - 9, 1, 14, 1, 7, 35, 54, 18, 55, 1, 51, 23, 62, 1, 51, 50, 0, 21, 20, 6, 7, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, - 1, 51, 50, 54, 53, 52, 38, 55, 62, 1, 53, 52, 38, 35, 34, 6, 7, 3,186,254, 4, 59, 66, 6,186, 12,104, 93,254,233,252,143, -104,228,131,241, 1, 50,134,134, 48, 50,222,184, 83,165, 85, 87,158, 68,105,131, 59, 50, 91, 85,212,160, 95,166, 73, 2, 64, 2, - 8, 89,203,114,132, 1, 2,126, 1, 29,147, 89, 87,254,237,215,128,225, 99, 63,125, 60,162,197, 36, 36,182, 47, 49,111, 88, 51, -103,206, 81,161, 88,146,194, 63, 64, 0, 0, 0,255,255, 0,137,255,227, 7, 88, 5,240, 16, 34, 0,123, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 0,117, 4,139,253,100,255,255, 0, 94,255,227, 7, 88, 5,240, 16, 34, 0,116, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 0,117, 4,139,253,100,255,255, 0,137,255,227, 7, 94, 5,240, 16, 34, 0,123, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,207, 4,139,253,100,255,255, 0, 94,255,227, 7, 94, 5,240, 16, 34, 0,116, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,207, 4,139,253,100,255,255, 0, 98,255,227, 7, 94, 5,240, 16, 34, 0,117, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,207, 4,139,253,100,255,255, 0, 63,255,227, 7, 94, 5,240, 16, 34, 5,206, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,207, 4,139,253,100,255,255, 0,137,255,227, 7,126, 5,240, 16, 34, 0,123, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,208, 4,139,253,100,255,255, 0,102,255,227, 7,126, 5,240, 16, 34, 5,207, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,208, 4,139,253,100,255,255, 0,137,255,227, 7,119, 5,240, 16, 34, 0,123, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,210, 4,139,253,100,255,255, 0, 98,255,227, 7,119, 5,240, 16, 34, 0,117, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,210, 4,139,253,100,255,255, 0,102,255,227, 7,119, 5,240, 16, 34, 5,207, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,210, 4,139,253,100,255,255, 0,108,255,227, 7,119, 5,240, 16, 34, 5,209, 0, 0, 16, 39, 6, 90, - 3, 53, 0, 0, 16, 3, 5,210, 4,139,253,100,255,255, 0,137,255,227, 6, 2, 5,240, 16, 34, 0,123, 0, 0, 16, 7, 6, 90, - 3, 53, 0, 0,255,255, 0,201, 0, 0, 1,147, 5,213, 16, 6, 0, 44, 0, 0,255,255, 0,201, 0, 0, 3, 39, 5,213, 16, 38, - 0, 44, 0, 0, 16, 7, 0, 44, 1,148, 0, 0,255,255, 0,201, 0, 0, 4,187, 5,213, 16, 38, 0, 44, 0, 0, 16, 39, 0, 44, - 1,148, 0, 0, 16, 7, 0, 44, 3, 40, 0, 0,255,255, 0,201, 0, 0, 7, 81, 5,213, 16, 38, 0, 44, 0, 0, 16, 7, 0, 57, - 1,233, 0, 0,255,255, 0, 16, 0, 0, 5,104, 5,213, 16, 6, 0, 57, 0, 0,255,255, 0, 16, 0, 0, 6,152, 5,213, 16, 38, - 0, 57, 0, 0, 16, 7, 0, 44, 5, 5, 0, 0,255,255, 0, 16, 0, 0, 8, 44, 5,213, 16, 38, 0, 57, 0, 0, 16, 39, 0, 44, - 5, 5, 0, 0, 16, 7, 0, 44, 6,153, 0, 0,255,255, 0, 16, 0, 0, 9,192, 5,213, 16, 38, 0, 57, 0, 0, 16, 39, 0, 44, - 5, 5, 0, 0, 16, 39, 0, 44, 6,153, 0, 0, 16, 7, 0, 44, 8, 45, 0, 0,255,255, 0,201, 0, 0, 7, 23, 5,213, 16, 38, - 0, 44, 0, 0, 16, 7, 0, 59, 1,220, 0, 0,255,255, 0, 61, 0, 0, 5, 59, 5,213, 16, 6, 0, 59, 0, 0,255,255, 0, 61, - 0, 0, 6,174, 5,213, 16, 38, 0, 59, 0, 0, 16, 7, 0, 44, 5, 27, 0, 0,255,255, 0, 61, 0, 0, 8, 66, 5,213, 16, 38, - 0, 59, 0, 0, 16, 39, 0, 44, 5, 27, 0, 0, 16, 7, 0, 44, 6,175, 0, 0,255,255, 0,201, 0, 0, 4,106, 5,213, 16, 6, - 0, 47, 0, 0,255,255, 0,115,255,227, 5, 39, 5,240, 16, 6, 0, 38, 0, 0,255,255, 0,201, 0, 0, 5,176, 5,213, 16, 6, - 0, 39, 0, 0,255,255, 0,201, 0, 0, 6, 31, 5,213, 16, 6, 0, 48, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 16, 6, - 0, 76, 0, 0,255,255, 0,193, 0, 0, 2,233, 6, 20, 16, 38, 0, 76, 0, 0, 16, 7, 0, 76, 1,112, 0, 0,255,255, 0,193, - 0, 0, 4, 89, 6, 20, 16, 38, 0, 76, 0, 0, 16, 39, 0, 76, 1,112, 0, 0, 16, 7, 0, 76, 2,224, 0, 0,255,255, 0,193, - 0, 0, 6, 65, 6, 20, 16, 38, 0, 76, 0, 0, 16, 7, 0, 89, 1,194, 0, 0,255,255, 0, 61, 0, 0, 4,127, 4, 96, 16, 6, - 0, 89, 0, 0,255,255, 0, 61, 0, 0, 5,189, 6, 20, 16, 38, 0, 89, 0, 0, 16, 7, 0, 76, 4, 68, 0, 0,255,255, 0, 61, - 0, 0, 7, 45, 6, 20, 16, 38, 0, 89, 0, 0, 16, 39, 0, 76, 4, 68, 0, 0, 16, 7, 0, 76, 5,180, 0, 0,255,255, 0, 61, - 0, 0, 8,157, 6, 20, 16, 38, 0, 89, 0, 0, 16, 39, 0, 76, 4, 68, 0, 0, 16, 39, 0, 76, 5,180, 0, 0, 16, 7, 0, 76, - 7, 36, 0, 0,255,255, 0,193, 0, 0, 6, 74, 6, 20, 16, 38, 0, 76, 0, 0, 16, 7, 0, 91, 1,209, 0, 0,255,255, 0, 59, - 0, 0, 4,121, 4, 96, 16, 6, 0, 91, 0, 0,255,255, 0, 59, 0, 0, 5,212, 6, 20, 16, 38, 0, 91, 0, 0, 16, 7, 0, 76, - 4, 91, 0, 0,255,255, 0, 59, 0, 0, 7, 68, 6, 20, 16, 38, 0, 91, 0, 0, 16, 39, 0, 76, 4, 91, 0, 0, 16, 7, 0, 76, - 5,203, 0, 0,255,255, 0,193, 0, 0, 1,121, 6, 20, 16, 6, 0, 79, 0, 0,255,255, 0,113,255,227, 3,231, 4,123, 16, 6, - 0, 70, 0, 0,255,255, 0,113,255,227, 4, 90, 6, 20, 16, 6, 0, 71, 0, 0,255,255, 0,186, 0, 0, 7, 29, 4,123, 16, 6, - 0, 80, 0, 0, 0, 3, 0,121,255,255, 9,125, 5,213, 0, 13, 0, 22, 0, 31, 0, 0, 1, 32, 0, 17, 16, 0, 41, 1, 32, 0, - 17, 16, 0, 33, 1, 51, 32, 0, 17, 16, 0, 33, 35, 3, 17, 35, 32, 0, 17, 16, 0, 33, 6, 53, 1,178, 1,150,254,104,254, 80, -253,140,254, 80,254,104, 1,150, 1,178, 1,159,244, 1, 53, 1, 31,254,225,254,203,244,202,244,254,203,254,225, 1, 31, 1, 53, - 5,213,254,151,254,128,254,126,254,150, 1,106, 1,130, 1,128, 1,105,250,209, 1, 24, 1, 46, 1, 44, 1, 23,251,119, 4,137, -254,233,254,212,254,210,254,232, 0, 3, 0,201, 0, 0, 5,176, 5,213, 0, 17, 0, 26, 0, 35, 0,251,186, 0, 9, 0, 27, 0, - 3, 43,184, 0, 9, 16,186, 0, 14, 0, 23, 0, 3, 43,184, 0, 14, 16,186, 0, 31, 0, 5, 0, 3, 43,184, 0, 31, 16,184, 0, - 9, 16,184, 0, 0,208, 65, 5, 0,234, 0, 5, 0,250, 0, 5, 0, 2, 93, 65, 27, 0, 25, 0, 5, 0, 41, 0, 5, 0, 57, 0, - 5, 0, 73, 0, 5, 0, 89, 0, 5, 0,105, 0, 5, 0,121, 0, 5, 0,137, 0, 5, 0,153, 0, 5, 0,169, 0, 5, 0,185, 0, - 5, 0,201, 0, 5, 0,217, 0, 5, 0, 13, 93,184, 0, 9, 16,184, 0, 18,208, 65, 5, 0,234, 0, 23, 0,250, 0, 23, 0, 2, - 93, 65, 27, 0, 25, 0, 23, 0, 41, 0, 23, 0, 57, 0, 23, 0, 73, 0, 23, 0, 89, 0, 23, 0,105, 0, 23, 0,121, 0, 23, 0, -137, 0, 23, 0,153, 0, 23, 0,169, 0, 23, 0,185, 0, 23, 0,201, 0, 23, 0,217, 0, 23, 0, 13, 93,184, 0, 31, 16,184, 0, - 37,220, 0,186, 0, 2, 0, 34, 0, 3, 43,184, 0, 2, 16,186, 0, 28, 0, 8, 0, 3, 43,184, 0, 28, 16,186, 0, 19, 0, 0, - 0, 3, 43,184, 0, 19, 16,186, 0, 10, 0, 18, 0, 3, 43,184, 0, 10, 16, 48, 49, 1, 21, 51, 32, 0, 17, 16, 0, 33, 35, 21, - 51, 32, 22, 21, 20, 6, 35, 3, 17, 51, 50, 54, 53, 52, 38, 35, 1, 33, 32, 0, 17, 16, 0, 41, 1, 1,147,244, 1, 53, 1, 31, -254,225,254,203,244, 72, 1, 0,240,241,255, 72, 78,159,147,147,159,254,232, 1,159, 1,178, 1,150,254,104,254, 80,254, 97, 1, - 89,179, 1, 24, 1, 46, 1, 44, 1, 23,178,194,207,208,195, 2,158,253,232,129,140,138,129, 1,222,254,151,254,128,254,126,254, -150, 0, 0, 0, 0, 5, 0,121,255,255, 9,125, 5,213, 0, 17, 0, 26, 0, 40, 0, 49, 0, 67, 0, 0, 1, 51, 32, 0, 17, 16, - 0, 33, 35, 53, 51, 32, 54, 53, 52, 38, 33, 35, 25, 1, 51, 50, 22, 21, 20, 6, 35, 19, 32, 0, 17, 16, 0, 41, 1, 32, 0, 17, - 16, 0, 33, 19, 35, 34, 38, 53, 52, 54, 59, 1, 53, 35, 32, 6, 21, 20, 22, 33, 51, 21, 35, 32, 0, 17, 16, 0, 33, 51, 5, 96, -244, 1, 53, 1, 31,254,225,254,203,244, 72, 0,255,241,240,255, 0, 72, 78,159,147,147,159,135, 1,176, 1,152,254,106,254, 78, -253,140,254, 78,254,106, 1,152, 1,176,213, 78,159,147,147,159, 78, 72,255, 0,240,241, 0,255, 72,244,254,203,254,225, 1, 31, - 1, 53,244, 5, 47,254,233,254,212,254,210,254,232,179,195,208,207,194,253, 98, 2, 24,129,138,140,129,254, 33, 1,106, 1,130, - 1,128, 1,105,254,151,254,128,254,126,254,150, 1,223,129,140,138,129,134,194,207,208,195,179, 1, 24, 1, 46, 1, 44, 1, 23, -255,255, 0,115,255,227, 5, 39, 5,240, 16, 6, 1, 72, 0, 0, 0, 1, 0,100, 0,204, 6, 63, 4, 56, 0, 9, 0,129,180, 2, - 9, 6, 0, 10, 16,212,212,204, 50, 64, 9, 64, 2, 64, 9, 48, 2, 48, 9, 4, 93, 49, 64, 10, 2, 5, 9, 1, 0, 6, 5,156, - 6, 10, 0, 16,212,236, 17, 57, 57,204, 16,204, 48, 64, 12, 8, 9, 9, 0, 8, 7, 8, 7,156, 0, 9, 0, 7, 5, 16,252, 60, - 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, 4,156, 1, 2, 1, 7, 5, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, 88, - 0,179, 3, 2, 8, 9, 16, 60, 16, 60,180, 8,156, 9, 9, 0, 7, 5, 16,236,180, 3,156, 2, 2, 1, 7, 5, 16,236, 89, 19, - 53, 1, 23, 7, 33, 21, 33, 23, 7,100, 1,137,120,233, 4,195,251, 61,233,120, 2, 85, 90, 1,137,120,233,170,233,120, 0, 0, - 0, 1, 1,163, 0, 0, 5, 15, 5,220, 0, 9, 0,129, 64, 10, 2, 5, 9, 1, 0, 6, 5,156, 6, 10, 16,212,236, 17, 57, 57, -204, 16,204, 49, 0,180, 2, 9, 6, 0, 10, 16,212,212,204, 50, 64, 9, 79, 2, 79, 9, 63, 2, 63, 9, 4, 93, 48, 64, 12, 8, - 9, 9, 0, 8, 7, 8, 7,156, 0, 9, 0, 7, 4, 16,252, 60, 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, 4,156, 1, - 2, 1, 7, 4, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, 88, 1,179, 3, 2, 8, 9, 16, 60, 16, 60,180, 8,156, 9, 9, 0, - 7, 4, 16,236,180, 3,156, 2, 2, 1, 7, 4, 16,236, 89, 1, 51, 1, 7, 39, 17, 35, 17, 7, 39, 3, 45, 90, 1,136,120,232, -170,234,120, 5,220,254,118,120,234,251, 60, 4,196,234,120, 0, 0, 1, 0,117, 0,204, 6, 80, 4, 56, 0, 9, 0,129,180, 2, - 9, 0, 6, 10, 16,212,212,204, 50, 64, 9, 79, 2, 79, 9, 95, 2, 95, 9, 4, 93, 49, 64, 10, 9, 6, 2, 1, 0, 5, 6,156, - 5, 10, 0, 16,212,236, 17, 57, 57,204, 16,204, 48, 64, 12, 8, 9, 9, 0, 8, 7, 8, 7,156, 0, 9, 0, 7, 5, 16,252, 60, - 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, 4,156, 1, 2, 1, 7, 5, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, 88, - 0,179, 3, 2, 8, 9, 16, 60, 16, 60,180, 8,156, 9, 9, 0, 7, 5, 16,236,180, 3,156, 2, 2, 1, 7, 5, 16,236, 89, 1, - 21, 1, 39, 55, 33, 53, 33, 39, 55, 6, 80,254,119,120,233,251, 61, 4,195,233,120, 2,175, 90,254,119,120,233,170,233,120, 0, - 0, 1, 1,163,255,249, 5, 15, 5,213, 0, 9, 0,129, 64, 10, 9, 6, 2, 1, 0, 5, 6,156, 5, 10, 16,212,236, 17, 57, 57, -204, 16,204, 49, 0,180, 2, 9, 0, 6, 10, 16,212,212,204, 50, 64, 9, 64, 2, 64, 9, 80, 2, 80, 9, 4, 93, 48, 64, 12, 8, - 9, 9, 0, 8, 7, 8, 7,156, 0, 9, 0, 7, 4, 16,252, 60, 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, 4,156, 1, - 2, 1, 7, 4, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, 88, 1,179, 3, 2, 8, 9, 16, 60, 16, 60,180, 8,156, 9, 9, 0, - 7, 4, 16,236,180, 3,156, 2, 2, 1, 7, 4, 16,236, 89, 5, 35, 1, 55, 23, 17, 51, 17, 55, 23, 3,135, 90,254,118,120,234, -170,232,120, 7, 1,138,120,234, 4,196,251, 60,234,120, 0, 0, 0, 1, 0,100, 0,204, 6, 80, 4, 56, 0, 15, 0,218,182, 7, - 10, 9, 2, 15, 0, 16, 16,212,204, 50,212,204, 50, 64, 13, 80, 2, 80, 15, 95, 10, 95, 7, 79, 10, 79, 7, 6, 93, 49, 0, 64, - 15, 7, 2, 4, 10, 15, 0, 1, 8, 9, 4, 13, 4,156, 13, 16, 16,212,236, 17, 23, 57,204, 50, 16,204, 50, 48, 64, 12, 14, 15, - 15, 0, 14, 13, 14, 13,156, 0, 15, 0, 7, 5, 16,252, 60, 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, 4,156, 1, 2, - 1, 7, 5, 16,252, 60, 8, 6, 16, 60, 64, 12, 11, 10, 10, 9, 11, 12, 11, 12,156, 9, 9, 10, 7, 5, 16,252, 60, 8, 6, 16, - 60, 64, 12, 6, 7, 7, 8, 6, 5, 6, 5,156, 8, 7, 8, 7, 5, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, 88, 0,183, 11, - 10, 6, 7, 3, 2, 14, 15, 16, 60, 16, 60, 16, 60, 16, 60,180, 14,156, 15, 15, 0, 7, 5, 16,236,180, 3,156, 2, 2, 1, 7, - 5, 16,236,180, 11,156, 10, 10, 9, 7, 5, 16,236,180, 6,156, 7, 7, 8, 7, 5, 16,236, 89, 19, 53, 1, 23, 7, 33, 39, 55, - 1, 21, 1, 39, 55, 33, 23, 7,100, 1,137,120,233, 3,188,233,120, 1,137,254,119,120,233,252, 68,233,120, 2, 85, 90, 1,137, -120,233,233,120,254,119, 90,254,119,120,233,233,120, 0, 0, 0, 0, 1, 1,163,255,239, 5, 15, 5,220, 0, 15, 0,222, 64, 15, - 7, 2, 4, 10, 15, 0, 1, 8, 9, 4, 13, 4,156, 13, 16, 16,212,236, 17, 23, 57,204, 50, 16,204, 50, 49, 0,182, 7, 10, 9, - 2, 15, 0, 16, 16,212,204, 50,212,204, 50, 64, 17, 95, 2, 95, 15, 80, 10, 80, 7, 79, 2, 79, 15, 64, 10, 64, 7, 8, 93, 48, - 64, 12, 14, 15, 15, 0, 14, 13, 14, 13,156, 0, 15, 0, 7, 4, 16,252, 60, 8, 6, 16, 60, 64, 12, 3, 2, 2, 1, 3, 4, 3, - 4,156, 1, 2, 1, 7, 4, 16,252, 60, 8, 6, 16, 60, 64, 12, 11, 10, 10, 9, 11, 12, 11, 12,156, 9, 9, 10, 7, 4, 16,252, - 60, 8, 6, 16, 60, 64, 12, 6, 7, 7, 8, 6, 5, 6, 5,156, 8, 7, 8, 7, 4, 16,252, 60, 8, 6, 16, 60,176, 16, 75, 83, - 88, 1,183, 11, 10, 6, 7, 3, 2, 14, 15, 16, 60, 16, 60, 16, 60, 16, 60,180, 14,156, 15, 15, 0, 7, 4, 16,236,180, 3,156, - 2, 2, 1, 7, 4, 16,236,180, 11,156, 10, 10, 9, 7, 4, 16,236,180, 6,156, 7, 7, 8, 7, 4, 16,236, 89, 1, 51, 1, 7, - 39, 17, 55, 23, 1, 35, 1, 55, 23, 17, 7, 39, 3, 45, 90, 1,136,120,232,232,120,254,120, 90,254,118,120,234,234,120, 5,220, -254,118,120,234,252, 67,234,120,254,118, 1,138,120,234, 3,189,234,120, 0, 0, 0, 1, 1, 32, 0, 52, 5,159, 4,179, 0, 9, - 0, 0, 1, 55, 33, 21, 33, 1, 7, 1, 17, 35, 1, 32, 63, 2, 44,254,182, 3, 94,120,252,162,169, 4,116, 63,169,252,162,120, - 3, 94,254,182, 0, 1, 1, 32, 0, 52, 5,159, 4,179, 0, 9, 0, 0, 1, 23, 17, 35, 17, 1, 39, 1, 33, 53, 5, 96, 63,169, -252,162,120, 3, 94,254,182, 4,179, 63,253,212, 1, 74,252,162,120, 3, 94,169, 0, 1, 1, 32, 0, 52, 5,159, 4,179, 0, 9, - 0, 0, 37, 7, 33, 53, 33, 1, 55, 1, 17, 51, 5,159, 63,253,212, 1, 74,252,162,120, 3, 94,169,115, 63,169, 3, 94,120,252, -162, 1, 74, 0, 0, 1, 1, 32, 0, 52, 5,159, 4,179, 0, 9, 0, 0, 37, 39, 17, 51, 17, 1, 23, 1, 33, 21, 1, 95, 63,169, - 3, 94,120,252,162, 1, 74, 52, 63, 2, 44,254,182, 3, 94,120,252,162,169, 0, 0, 1, 0,100, 0,204, 5, 63, 5, 3, 0, 11, - 0, 0, 1, 33, 23, 7, 1, 53, 1, 23, 7, 33, 17, 51, 5, 63,252, 61,233,120,254,119, 1,137,120,233, 3, 25,170, 2, 45,233, -120, 1,137, 90, 1,137,120,233, 2, 44, 0, 0, 0, 1, 0,217, 2, 45, 5,219, 2,215, 0, 3, 0, 17,182, 0,156, 2, 4, 1, - 0, 4, 16,212,196, 49, 0, 16,212,236, 48, 19, 33, 21, 33,217, 5, 2,250,254, 2,215,170, 0, 0, 2, 0,217, 0, 0, 5,219, - 5, 4, 0, 11, 0, 15, 0, 0, 33, 35, 17, 33, 53, 33, 17, 51, 17, 33, 21, 33, 1, 53, 33, 21, 3,174,168,253,211, 2, 45,168, - 2, 45,253,211,253, 43, 5, 2, 1,131,170, 1,131,254,125,170, 2,215,170,170, 0, 2, 0,217, 0, 0, 5,219, 5,213, 0, 11, - 0, 15, 0, 87,186, 0, 5, 0, 6, 0, 3, 43,184, 0, 5, 16,184, 0, 0,208,184, 0, 6, 16,184, 0, 10,208,184, 0, 6, 16, -184, 0, 12,208,184, 0, 5, 16,184, 0, 13,208, 0,184, 0, 5, 47,186, 0, 13, 0, 14, 0, 3, 43,184, 0, 13, 16,186, 0, 2, - 0, 3, 0, 3, 43,184, 0, 2, 16,184, 0, 3, 16,184, 0, 7,208,184, 0, 2, 16,184, 0, 9,208, 48, 49, 1, 17, 33, 21, 33, - 17, 35, 17, 33, 53, 33, 25, 1, 51, 21, 35, 3,174, 2, 45,253,211,168,253,211, 2, 45,168,168, 4,160,254, 5,170,254, 5, 1, -251,170, 1,251, 1, 53,204, 0, 0, 1,254,137,255,227, 2,205, 5,240, 0, 3, 0, 43, 64, 19, 0, 15, 1, 2, 1, 2, 15, 3, - 0, 3, 66, 2,140, 0,145, 4, 1, 3, 4, 16,212,204, 49, 0, 16,228,228, 48, 75, 83, 88, 7, 16, 5,237, 7, 16, 5,237, 89, - 34, 1, 51, 1, 35, 2, 45,160,252, 92,160, 5,240,249,243, 0,255,255, 1,138,255,146, 4, 60, 6, 37, 16, 3, 0, 63, 1,138, - 0, 80, 0, 0,255,255, 0,190, 0,175, 4, 68, 4, 85, 16, 7, 0, 13, 0,129,254,101, 0, 0,255,255, 1, 68, 1, 71, 3,190, - 3,194, 16, 7, 0,114, 0,129,253,210, 0, 0, 0, 1, 0,219, 2, 72, 1,174, 3, 70, 0, 3, 0, 18,183, 2,131, 0, 4, 1, - 25, 0, 4, 16,212,236, 49, 0, 16,212,236, 48, 19, 51, 21, 35,219,211,211, 3, 70,254, 0, 0, 0, 1, 0, 61,255,215, 5, 25, - 6,125, 0, 10, 0, 42, 64, 24, 10, 9, 8, 7, 6, 5, 11, 2, 4, 2, 0, 11, 10, 9, 7, 6, 5, 4, 3, 0, 8, 1, 8, 11, - 16,212,204, 23, 57, 49, 0, 16,212,204,196, 17, 18, 23, 57, 48, 1, 51, 21, 35, 1, 35, 1, 7, 39, 37, 1, 4, 92,189,115,253, -174, 66,254,193,125, 25, 1, 27, 1, 0, 6,125, 96,249,186, 3,115, 45, 80, 98,253, 59, 0, 0,255,255, 0, 61,255,215, 5, 25, - 7,208, 18, 34, 6, 95, 0, 0, 16, 3, 0,117, 0,115, 1,224,255,255, 0, 61,255,215, 5, 25, 7,191, 18, 34, 6, 95, 0, 0, - 16, 3, 5,206, 0,115, 1,224, 0, 2, 0,221, 0,221, 4,141, 3,238, 0, 11, 0, 37, 0, 0, 1, 46, 1, 35, 34, 6, 21, 20, - 22, 51, 50, 54, 1, 34, 38, 39, 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 23, 62, 1, 51, 21, 34, 6, 7, 30, 1, 51, 3, 25, - 49,133, 85,102,127,118, 89, 82,134, 1,189, 73,149, 79, 70,157, 94,136,186,167,134, 95,153, 72, 68,158, 97, 43,133, 74, 49,134, - 67, 2,154, 88, 88,132,106,101,134,136,254,232,119,139,135,127,223,166,175,216,126,138,138,131,150,135,162, 88, 90, 0, 0, 0, - 0, 3, 0,221, 0,221, 5,207, 3,238, 0, 11, 0, 23, 0, 47, 0,255, 64, 29, 45, 27, 21, 9, 33, 3, 0, 36, 24, 4, 21, 15, - 39, 33, 21, 27, 15, 33, 48, 12, 0, 36, 24, 18, 6, 42, 18, 30, 48, 16,212,196,212,196, 17, 57, 57, 57, 57, 49, 0, 16,212,196, -212,196, 16,192, 17, 18, 23, 57, 18, 57, 17, 18, 57, 48, 64,190, 5, 2, 5, 3, 5, 4, 0, 5, 0, 6, 0, 7, 5, 8, 5, 9, - 5, 10, 10, 16, 15, 17, 15, 18, 15, 19, 10, 20, 21, 2, 21, 3, 21, 4, 16, 5, 16, 6, 16, 7, 21, 8, 21, 9, 21, 10, 26, 14, - 26, 15, 26, 16, 31, 17, 31, 18, 31, 19, 26, 20, 26, 21, 26, 22, 36, 2, 36, 3, 36, 4, 32, 5, 32, 6, 32, 7, 36, 8, 36, 9, - 36, 10, 42, 14, 42, 15, 42, 16, 47, 17, 47, 18, 47, 19, 42, 20, 42, 21, 42, 22, 53, 2, 53, 3, 53, 4, 48, 5, 48, 6, 48, 7, - 53, 8, 53, 9, 53, 10, 58, 14, 58, 15, 58, 16, 63, 17, 63, 18, 63, 19, 58, 20, 58, 21, 58, 22, 69, 2, 69, 3, 69, 4, 64, 5, - 64, 6, 64, 7, 69, 8, 69, 9, 69, 10, 74, 14, 74, 15, 74, 16, 79, 17, 79, 18, 79, 19, 74, 20, 74, 21, 74, 22, 86,180, 31,176, - 32,176, 33,176, 34,176, 38,176, 39,176, 40,180, 41, 8, 93, 1, 93, 1, 30, 1, 51, 50, 54, 53, 52, 38, 35, 34, 6, 7, 46, 1, - 35, 34, 6, 21, 20, 22, 51, 50, 54, 23, 14, 1, 35, 34, 38, 53, 52, 54, 51, 50, 22, 23, 62, 1, 51, 50, 22, 21, 20, 6, 35, 34, - 38, 3,147, 49,134, 84,101,128,118, 89, 82,133,196, 49,133, 85,102,127,118, 89, 82,134,144, 70,157, 94,136,186,167,134, 95,153, - 72, 68,158, 97,134,188,167,134, 94,149, 2, 47, 88, 90,135,105,101,134,135, 55, 88, 88,132,106,101,134,136, 22,135,127,223,166, -175,216,126,138,138,131,225,167,175,214,119, 0, 0, 6, 0,247, 0, 1, 7, 9, 6, 19, 0, 3, 0, 49, 0, 59, 0, 70, 0, 79, - 0, 89, 0, 0, 1, 33, 17, 33, 17, 21, 20, 6, 32, 38, 53, 52, 54, 59, 1, 17, 35, 34, 38, 53, 52, 54, 32, 22, 29, 1, 33, 53, - 52, 54, 51, 50, 22, 21, 20, 6, 43, 1, 17, 51, 50, 22, 21, 20, 6, 35, 34, 38, 61, 1, 1, 53, 52, 38, 35, 34, 6, 20, 22, 51, - 19, 35, 34, 6, 21, 20, 22, 51, 50, 54, 53, 1, 51, 50, 54, 52, 38, 34, 6, 21, 17, 21, 20, 22, 50, 54, 53, 52, 38, 35, 3,108, - 1, 40,254,216,185,254,252,184,184,127,170,170,127,184,184, 1, 4,185, 1, 40,185,130,131,183,183,128,170,170,128,183,183,131, -130,185,254, 68, 98, 69, 68, 98, 98, 69,166,166, 69, 98, 98, 69, 68, 98, 2, 80,167, 68, 98, 97,138, 98, 98,138, 97, 98, 68, 2, -118, 1, 40,254, 68,170,128,183,184,131,128,186, 1, 40,186,129,130,184,183,128,170,170,128,183,184,130,129,186,254,216,186,128, -131,184,183,128,170, 2, 80,167, 69, 97, 97,138, 98,253,176, 98, 68, 69, 98, 98, 68, 2,247, 98,138, 97, 97, 69,253, 9,167, 68, - 98, 98, 69, 68, 98, 0, 0, 0, 0, 1, 0,217, 1, 31, 5,219, 3, 94, 0, 5, 0, 0, 1, 33, 17, 51, 17, 33, 5,219,250,254, -168, 4, 90, 1, 31, 2, 63,254,107, 0, 0, 0, 0, 2, 0,172, 0, 0, 7, 84, 5,200, 0, 7, 0, 11, 0, 0, 19, 33, 1, 33, - 21, 33, 1, 33, 37, 33, 21, 33,172, 2, 66, 2,154, 1,204,253,188,253,102,254, 54, 3,244, 2,180,253, 76, 5,200,250,204,148, - 5, 52,148,148, 0, 1, 0,183,254,242, 2,123, 6, 18, 0, 5, 0, 0, 19, 1, 51, 9, 1, 35,183, 1, 26,170,254,230, 1, 26, -170, 2,130,252,112, 3,144, 3,144, 0, 0, 0, 0, 1, 0,164,254,242, 2,104, 6, 18, 0, 5, 0, 0, 9, 1, 35, 9, 1, 51, - 2,104,254,230,170, 1, 26,254,230,170, 2,130,252,112, 3,144, 3,144, 0, 0, 0, 3, 0,152,255,236, 6,148, 5,232, 0, 13, - 0, 27, 0, 38, 0,219,186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 35, 0, 29, 0, 3, 43,184, 0, 35, 16,186, 0, - 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, - 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, - 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, - 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0, -153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93, 0,186, 0, 17, 0, 3, 0, 3, 43,184, - 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, 0, 36, 0, 37, 0, 3, 43,184, 0, 36, 16,184, 0, 28,208, 48, - 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 1, 51, 17, - 7, 53, 37, 51, 17, 51, 21, 33, 6,148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, - 1, 28, 1,143,182,254,184,173,173,254,184,182, 1,124,217,236, 1, 1,161,218,253,151, 2,234,254,193,254, 65, 1,191, 1, 63, -198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185,253,255, 2,126, 43,152, 47,252,230, -142, 0, 0, 0, 0, 3, 0,152,255,236, 6,148, 5,232, 0, 13, 0, 27, 0, 56, 1, 63,186, 0, 14, 0, 6, 0, 3, 43,184, 0, - 14, 16,186, 0, 51, 0, 38, 0, 3, 43,184, 0, 51, 16,186, 0, 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, - 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, - 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, - 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, - 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0, -217, 0, 20, 0, 13, 93,184, 0, 51, 16,184, 0, 29,208,184, 0, 29, 47, 65, 5, 0,234, 0, 38, 0,250, 0, 38, 0, 2, 93, 65, - 27, 0, 25, 0, 38, 0, 41, 0, 38, 0, 57, 0, 38, 0, 73, 0, 38, 0, 89, 0, 38, 0,105, 0, 38, 0,121, 0, 38, 0,137, 0, - 38, 0,153, 0, 38, 0,169, 0, 38, 0,185, 0, 38, 0,201, 0, 38, 0,217, 0, 38, 0, 13, 93,186, 0, 44, 0, 6, 0, 0, 17, - 18, 57, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, 0, 29, 0, 30, - 0, 3, 43,184, 0, 29, 16,186, 0, 48, 0, 41, 0, 3, 43,184, 0, 48, 16, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, - 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 1, 33, 21, 33, 53, 54, 36, 55, 62, 1, 53, 52, 38, 35, 34, - 6, 7, 53, 62, 1, 51, 50, 22, 21, 20, 6, 7, 14, 1, 6,148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205, -250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 2, 79, 1,180,253, 92, 82, 1, 6, 33, 62, 47, 95, 78, - 59,132,115, 97,145, 61,163,197, 48, 62, 17,178, 2,234,254,193,254, 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228, -254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185,253,255,142,129, 77,241, 34, 63, 85, 40, 63, 78, 38, 58,171, 36, 31,151,125, - 58,105, 70, 18,167, 0, 0, 0, 0, 3, 0,152,255,236, 6,148, 5,232, 0, 13, 0, 27, 0, 68, 1,181,186, 0, 14, 0, 6, 0, - 3, 43,184, 0, 14, 16,186, 0, 66, 0, 53, 0, 3, 43,184, 0, 66, 16,186, 0, 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, - 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, - 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, - 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, - 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0, -201, 0, 20, 0,217, 0, 20, 0, 13, 93, 65, 5, 0,234, 0, 53, 0,250, 0, 53, 0, 2, 93, 65, 27, 0, 25, 0, 53, 0, 41, 0, - 53, 0, 57, 0, 53, 0, 73, 0, 53, 0, 89, 0, 53, 0,105, 0, 53, 0,121, 0, 53, 0,137, 0, 53, 0,153, 0, 53, 0,169, 0, - 53, 0,185, 0, 53, 0,201, 0, 53, 0,217, 0, 53, 0, 13, 93,186, 0, 28, 0, 53, 0, 66, 17, 18, 57,186, 0, 44, 0, 53, 0, - 66, 17, 18, 57,184, 0, 44, 47, 65, 5, 0,234, 0, 44, 0,250, 0, 44, 0, 2, 93, 65, 27, 0, 25, 0, 44, 0, 41, 0, 44, 0, - 57, 0, 44, 0, 73, 0, 44, 0, 89, 0, 44, 0,105, 0, 44, 0,121, 0, 44, 0,137, 0, 44, 0,153, 0, 44, 0,169, 0, 44, 0, -185, 0, 44, 0,201, 0, 44, 0,217, 0, 44, 0, 13, 93,184, 0, 31,220,186, 0, 38, 0, 6, 0, 0, 17, 18, 57,186, 0, 59, 0, - 6, 0, 0, 17, 18, 57, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, - 0, 41, 0, 34, 0, 3, 43,184, 0, 41, 16,186, 0, 63, 0, 56, 0, 3, 43,184, 0, 63, 16,186, 0, 50, 0, 47, 0, 3, 43,184, - 0, 50, 16,186, 0, 28, 0, 47, 0, 50, 17, 18, 57, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, - 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 5, 30, 1, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 43, 1, - 53, 51, 50, 54, 53, 52, 38, 35, 34, 6, 7, 53, 62, 1, 51, 50, 22, 21, 20, 6, 6,148,254, 63,254,194,254,196,254, 63,206, 1, -113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 3,185, 13,118,216,195, 64,136, - 88, 91,125, 68,117,115,107, 99,140,145, 90, 88, 92, 91, 52,121,107, 95,136, 61,161,193,104, 2,234,254,193,254, 65, 1,191, 1, - 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185,150, 3,129, 93,141,156, 23, 27, -168, 48, 28, 79, 76, 71, 78,140, 60, 58, 60, 63, 21, 32,151, 24, 20,137,115, 81,114, 0, 0, 0, 0, 4, 0,152,255,236, 6,148, - 5,232, 0, 13, 0, 27, 0, 30, 0, 41, 0,243,186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 32, 0, 28, 0, 3, 43, -184, 0, 32, 16,186, 0, 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, - 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, - 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, - 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, - 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93,184, 0, 32, 16, -184, 0, 36,208,184, 0, 28, 16,184, 0, 38,208, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, - 43,184, 0, 10, 16,186, 0, 34, 0, 35, 0, 3, 43,184, 0, 34, 16,184, 0, 29,208,184, 0, 35, 16,184, 0, 39,208, 48, 49, 1, - 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 37, 1, 33, 3, 51, - 17, 51, 21, 35, 21, 35, 53, 33, 53, 6,148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, - 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 2,191,254,243, 1, 13, 24,206,141,141,182,254, 67, 2,234,254,193,254, 65, - 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185, 79,254,130, 2, 72, -253,184,141,211,211,142, 0, 0, 0, 3, 0,152,255,236, 6,148, 5,232, 0, 13, 0, 27, 0, 57, 1, 75,186, 0, 14, 0, 6, 0, - 3, 43,184, 0, 14, 16,186, 0, 31, 0, 28, 0, 3, 43,184, 0, 31, 16,186, 0, 38, 0, 51, 0, 3, 43,184, 0, 38, 16,186, 0, - 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, - 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, - 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, - 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0, -153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93,186, 0, 45, 0, 6, 0, 0, 17, 18, 57, - 65, 5, 0,234, 0, 51, 0,250, 0, 51, 0, 2, 93, 65, 27, 0, 25, 0, 51, 0, 41, 0, 51, 0, 57, 0, 51, 0, 73, 0, 51, 0, - 89, 0, 51, 0,105, 0, 51, 0,121, 0, 51, 0,137, 0, 51, 0,153, 0, 51, 0,169, 0, 51, 0,185, 0, 51, 0,201, 0, 51, 0, -217, 0, 51, 0, 13, 93, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, - 0, 48, 0, 41, 0, 3, 43,184, 0, 48, 16,186, 0, 29, 0, 30, 0, 3, 43,184, 0, 29, 16,186, 0, 35, 0, 54, 0, 3, 43,184, - 0, 35, 16, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, - 2, 1, 33, 21, 33, 21, 6, 54, 51, 50, 22, 21, 20, 6, 35, 34, 38, 39, 53, 30, 1, 51, 50, 54, 53, 52, 38, 35, 34, 6, 7, 6, -148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173, -254,184,182, 1,152, 2, 61,254,111, 3, 63, 31,176,207,213,190, 64,133, 88, 95,119, 68,104,118,118,104, 50,101, 89, 2,234,254, -193,254, 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185, 1, 25, -142,171, 1, 10,176,149,152,172, 20, 24,172, 47, 27, 97, 85, 86, 97, 20, 37, 0, 0, 4, 0,152,255,236, 6,148, 5,232, 0, 13, - 0, 27, 0, 39, 0, 64, 1,145,186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 31, 0, 59, 0, 3, 43,184, 0, 31, 16, -186, 0, 53, 0, 37, 0, 3, 43,184, 0, 53, 16,186, 0, 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, - 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, - 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, - 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, - 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, - 20, 0, 13, 93, 65, 27, 0, 22, 0, 31, 0, 38, 0, 31, 0, 54, 0, 31, 0, 70, 0, 31, 0, 86, 0, 31, 0,102, 0, 31, 0,118, - 0, 31, 0,134, 0, 31, 0,150, 0, 31, 0,166, 0, 31, 0,182, 0, 31, 0,198, 0, 31, 0,214, 0, 31, 0, 13, 93, 65, 5, 0, -229, 0, 31, 0,245, 0, 31, 0, 2, 93, 65, 5, 0,234, 0, 37, 0,250, 0, 37, 0, 2, 93, 65, 27, 0, 25, 0, 37, 0, 41, 0, - 37, 0, 57, 0, 37, 0, 73, 0, 37, 0, 89, 0, 37, 0,105, 0, 37, 0,121, 0, 37, 0,137, 0, 37, 0,153, 0, 37, 0,169, 0, - 37, 0,185, 0, 37, 0,201, 0, 37, 0,217, 0, 37, 0, 13, 93,186, 0, 41, 0, 37, 0, 53, 17, 18, 57, 0,186, 0, 17, 0, 3, - 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, 0, 34, 0, 56, 0, 3, 43,184, 0, 34, 16,186, - 0, 62, 0, 44, 0, 3, 43,184, 0, 62, 16,186, 0, 50, 0, 28, 0, 3, 43,184, 0, 50, 16, 48, 49, 1, 16, 0, 33, 32, 0, 17, - 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 5, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, - 38, 19, 21, 46, 1, 35, 34, 6, 7, 6, 54, 51, 50, 22, 21, 20, 6, 35, 34, 38, 53, 52, 18, 51, 50, 22, 6,148,254, 63,254,194, -254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 2,161, - 78, 92, 92, 78, 78, 92, 92,212, 84, 97, 47,119,127, 5, 9,128, 78,160,186,194,160,185,192,234,200, 53,106, 2,234,254,193,254, - 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185,159, 98, 91, 90, - 98, 98, 90, 91, 98, 1,157,156, 35, 22,148, 80, 11, 61,177,148,145,179,253,231,218, 1, 11, 19, 0, 3, 0,152,255,236, 6,148, - 5,232, 0, 13, 0, 27, 0, 34, 0,235,184, 0, 35, 47,184, 0, 36, 47,184, 0, 0,220,184, 0, 35, 16,184, 0, 6,208,184, 0, - 6, 47,184, 0, 14,220, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, - 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, - 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93,184, 0, 0, 16,184, 0, 20,220, 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, - 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0, -137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93,186, 0, 32, 0, 6, 0, - 0, 17, 18, 57,186, 0, 33, 0, 6, 0, 0, 17, 18, 57, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, - 0, 3, 43,184, 0, 10, 16,186, 0, 29, 0, 33, 0, 3, 43,184, 0, 29, 16, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, - 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 1, 33, 21, 1, 35, 1, 33, 6,148,254, 63,254,194,254,196, -254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 1,107, 2,171, -254,148,193, 1, 81,254, 49, 2,234,254,193,254, 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, - 28,179, 1, 71,177,177,254,185, 1, 25, 75,252,163, 3, 26, 0, 0, 5, 0,152,255,236, 6,148, 5,232, 0, 13, 0, 27, 0, 39, - 0, 63, 0, 75, 2, 13,186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 31, 0, 61, 0, 3, 43,184, 0, 31, 16,186, 0, - 49, 0, 70, 0, 3, 43,184, 0, 49, 16,186, 0, 0, 0, 20, 0, 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, - 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, - 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, - 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0, -105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, - 13, 93, 65, 27, 0, 22, 0, 31, 0, 38, 0, 31, 0, 54, 0, 31, 0, 70, 0, 31, 0, 86, 0, 31, 0,102, 0, 31, 0,118, 0, 31, - 0,134, 0, 31, 0,150, 0, 31, 0,166, 0, 31, 0,182, 0, 31, 0,198, 0, 31, 0,214, 0, 31, 0, 13, 93, 65, 5, 0,229, 0, - 31, 0,245, 0, 31, 0, 2, 93, 65, 5, 0,234, 0, 70, 0,250, 0, 70, 0, 2, 93, 65, 27, 0, 25, 0, 70, 0, 41, 0, 70, 0, - 57, 0, 70, 0, 73, 0, 70, 0, 89, 0, 70, 0,105, 0, 70, 0,121, 0, 70, 0,137, 0, 70, 0,153, 0, 70, 0,169, 0, 70, 0, -185, 0, 70, 0,201, 0, 70, 0,217, 0, 70, 0, 13, 93,186, 0, 37, 0, 70, 0, 49, 17, 18, 57,184, 0, 37, 47, 65, 5, 0,234, - 0, 37, 0,250, 0, 37, 0, 2, 93, 65, 27, 0, 25, 0, 37, 0, 41, 0, 37, 0, 57, 0, 37, 0, 73, 0, 37, 0, 89, 0, 37, 0, -105, 0, 37, 0,121, 0, 37, 0,137, 0, 37, 0,153, 0, 37, 0,169, 0, 37, 0,185, 0, 37, 0,201, 0, 37, 0,217, 0, 37, 0, - 13, 93,186, 0, 43, 0, 61, 0, 31, 17, 18, 57,184, 0, 43, 47,186, 0, 52, 0, 70, 0, 49, 17, 18, 57,184, 0, 37, 16,184, 0, - 55,220,184, 0, 43, 16,184, 0, 64,220, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, - 0, 10, 16,186, 0, 34, 0, 58, 0, 3, 43,184, 0, 34, 16,186, 0, 46, 0, 73, 0, 3, 43,184, 0, 46, 16,186, 0, 67, 0, 28, - 0, 3, 43,184, 0, 67, 16,186, 0, 52, 0, 28, 0, 67, 17, 18, 57, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, - 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 5, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 37, 46, 1, 53, 52, - 54, 51, 50, 22, 21, 20, 6, 7, 30, 1, 21, 20, 6, 35, 34, 38, 53, 52, 54, 55, 20, 22, 51, 50, 54, 53, 52, 38, 35, 34, 6, 6, -148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173, -254,184,182, 2,175, 84, 95, 95, 84, 84, 95, 95,254,198, 4,106,183,157,157,182,105, 4, 15,118,190,173,173,190,118, 87, 81, 77, - 75, 82, 82, 75, 77, 81, 2,234,254,193,254, 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28, -179, 1, 71,177,177,254,185,230, 80, 73, 73, 80, 81, 72, 73, 80, 73, 1,118, 83,116,136,136,116, 83,118, 1, 3,131, 92,138,151, -151,138, 92,131,193, 61, 66, 66, 61, 62, 66, 66, 0, 4, 0,152,255,236, 6,148, 5,232, 0, 13, 0, 27, 0, 52, 0, 64, 1,145, -186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 62, 0, 41, 0, 3, 43,184, 0, 62, 16,186, 0, 0, 0, 20, 0, 3, 43, -184, 0, 0, 16,186, 0, 47, 0, 56, 0, 3, 43,184, 0, 47, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, - 0, 14, 0, 86, 0, 14, 0,102, 0, 14, 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, - 0, 14, 0,214, 0, 14, 0, 13, 93, 65, 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, - 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, - 20, 0,137, 0, 20, 0,153, 0, 20, 0,169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93, 65, 27, 0, 22, - 0, 62, 0, 38, 0, 62, 0, 54, 0, 62, 0, 70, 0, 62, 0, 86, 0, 62, 0,102, 0, 62, 0,118, 0, 62, 0,134, 0, 62, 0,150, - 0, 62, 0,166, 0, 62, 0,182, 0, 62, 0,198, 0, 62, 0,214, 0, 62, 0, 13, 93, 65, 5, 0,229, 0, 62, 0,245, 0, 62, 0, - 2, 93,186, 0, 29, 0, 41, 0, 62, 17, 18, 57, 65, 5, 0,234, 0, 56, 0,250, 0, 56, 0, 2, 93, 65, 27, 0, 25, 0, 56, 0, - 41, 0, 56, 0, 57, 0, 56, 0, 73, 0, 56, 0, 89, 0, 56, 0,105, 0, 56, 0,121, 0, 56, 0,137, 0, 56, 0,153, 0, 56, 0, -169, 0, 56, 0,185, 0, 56, 0,201, 0, 56, 0,217, 0, 56, 0, 13, 93, 0,186, 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, - 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, 0, 32, 0, 50, 0, 3, 43,184, 0, 32, 16,186, 0, 44, 0, 59, 0, 3, 43,184, - 0, 44, 16,186, 0, 53, 0, 38, 0, 3, 43,184, 0, 53, 16, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, - 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, 2, 1, 53, 30, 1, 51, 50, 54, 55, 54, 6, 35, 34, 38, 53, 52, 54, 51, 50, 22, - 21, 20, 2, 35, 34, 38, 19, 50, 54, 53, 52, 38, 35, 34, 6, 21, 20, 22, 6,148,254, 63,254,194,254,196,254, 63,206, 1,113,190, -193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143,182,254,184,173,173,254,184,182, 1,144, 85, 97, 46,119,127, 5, 10,128, - 79,159,186,194,160,185,191,233,200, 53,107,217, 78, 91, 91, 78, 78, 92, 92, 2,234,254,193,254, 65, 1,191, 1, 63,198, 1,114, -198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177,254,185,253,139,156, 36, 21,147, 79, 13, 60,175,148,145, -180,253,232,218,254,246, 19, 1,180, 98, 91, 91, 98, 98, 91, 91, 98, 0, 0, 0, 0, 5, 0,152,255,236, 6,148, 5,232, 0, 13, - 0, 27, 0, 38, 0, 50, 0, 62, 1,155,186, 0, 14, 0, 6, 0, 3, 43,184, 0, 14, 16,186, 0, 35, 0, 29, 0, 3, 43,184, 0, - 35, 16,186, 0, 42, 0, 60, 0, 3, 43,184, 0, 42, 16,186, 0, 54, 0, 48, 0, 3, 43,184, 0, 54, 16,186, 0, 0, 0, 20, 0, - 3, 43,184, 0, 0, 16, 65, 27, 0, 22, 0, 14, 0, 38, 0, 14, 0, 54, 0, 14, 0, 70, 0, 14, 0, 86, 0, 14, 0,102, 0, 14, - 0,118, 0, 14, 0,134, 0, 14, 0,150, 0, 14, 0,166, 0, 14, 0,182, 0, 14, 0,198, 0, 14, 0,214, 0, 14, 0, 13, 93, 65, - 5, 0,229, 0, 14, 0,245, 0, 14, 0, 2, 93, 65, 5, 0,234, 0, 20, 0,250, 0, 20, 0, 2, 93, 65, 27, 0, 25, 0, 20, 0, - 41, 0, 20, 0, 57, 0, 20, 0, 73, 0, 20, 0, 89, 0, 20, 0,105, 0, 20, 0,121, 0, 20, 0,137, 0, 20, 0,153, 0, 20, 0, -169, 0, 20, 0,185, 0, 20, 0,201, 0, 20, 0,217, 0, 20, 0, 13, 93, 65, 5, 0,234, 0, 48, 0,250, 0, 48, 0, 2, 93, 65, - 27, 0, 25, 0, 48, 0, 41, 0, 48, 0, 57, 0, 48, 0, 73, 0, 48, 0, 89, 0, 48, 0,105, 0, 48, 0,121, 0, 48, 0,137, 0, - 48, 0,153, 0, 48, 0,169, 0, 48, 0,185, 0, 48, 0,201, 0, 48, 0,217, 0, 48, 0, 13, 93, 65, 5, 0,234, 0, 60, 0,250, - 0, 60, 0, 2, 93, 65, 27, 0, 25, 0, 60, 0, 41, 0, 60, 0, 57, 0, 60, 0, 73, 0, 60, 0, 89, 0, 60, 0,105, 0, 60, 0, -121, 0, 60, 0,137, 0, 60, 0,153, 0, 60, 0,169, 0, 60, 0,185, 0, 60, 0,201, 0, 60, 0,217, 0, 60, 0, 13, 93, 0,186, - 0, 17, 0, 3, 0, 3, 43,184, 0, 17, 16,186, 0, 10, 0, 24, 0, 3, 43,184, 0, 10, 16,186, 0, 45, 0, 57, 0, 3, 43,184, - 0, 45, 16,186, 0, 36, 0, 37, 0, 3, 43,184, 0, 36, 16,186, 0, 51, 0, 39, 0, 3, 43,184, 0, 51, 16,184, 0, 36, 16,184, - 0, 28,208, 48, 49, 1, 16, 0, 33, 32, 0, 17, 52, 18, 36, 51, 50, 4, 18, 5, 16, 0, 33, 32, 0, 17, 52, 2, 36, 35, 34, 4, - 2, 19, 51, 17, 7, 53, 55, 51, 17, 51, 21, 33, 1, 34, 6, 21, 20, 22, 51, 50, 54, 53, 52, 38, 39, 50, 22, 21, 20, 6, 35, 34, - 38, 53, 52, 54, 6,148,254, 63,254,194,254,196,254, 63,206, 1,113,190,193, 1,113,205,250, 87, 1,143, 1, 28, 1, 28, 1,143, -182,254,184,173,173,254,184,182,205,158,172,188,117,159,254, 62, 3, 4, 64, 69, 69, 64, 63, 70, 70, 63,130,136,136,130,131,136, -136, 2,234,254,193,254, 65, 1,191, 1, 63,198, 1,114,198,198,254,144,200,254,228,254,112, 1,144, 1, 28,179, 1, 71,177,177, -254,185,254, 62, 2, 62, 39,137, 42,253, 54,128, 2,222,151,163,162,151,151,162,163,151,123,228,209,208,228,228,208,209,228, 0, - 0, 1, 0,170, 1,119, 6,130, 4, 99, 0, 5, 0, 11, 0,184, 0, 2, 47,184, 0, 5, 47, 48, 49, 19, 17, 37, 5, 17, 5,170, - 1,119, 4, 97,251,159, 2, 50, 1,117,188,188,254,139,187, 0, 0, 1, 0,170, 0, 0, 4,116, 5,217, 0, 19, 0, 31, 0,184, - 0, 5, 47,186, 0, 16, 0, 18, 0, 3, 43,184, 0, 16, 16,184, 0, 18, 16,184, 0, 13,208,184, 0, 13, 47, 48, 49, 1, 22, 21, - 20, 7, 3, 33, 3, 38, 53, 52, 55, 54, 39, 35, 53, 33, 23, 7, 22, 3,126,246, 8,238,254, 34,237, 9,246,127, 7,117, 1,218, - 1,119, 1, 4,224, 66,179, 32, 36,252, 89, 3,167, 38, 34,175, 66, 26,134, 89, 89, 1,135, 0, 0, 1, 0, 47, 0, 0, 5,170, - 6, 20, 0, 36, 0, 72, 64, 19, 38, 0, 7, 9, 5, 8, 12, 33, 24, 13, 30, 8, 17, 12, 33, 16, 20, 76, 37, 16,252, 60,196, 50, -196,252, 60,196, 16, 60,252, 60,196,196,196, 49, 0, 64, 17, 9, 13, 17,169, 18, 2, 26,135, 0, 24,151, 6, 31, 18,188, 11, 15, - 47, 60,230, 50, 50,254, 60,238, 50, 16,238, 50, 50, 48, 1, 21, 35, 34, 6, 29, 1, 33, 21, 33, 17, 35, 17, 33, 17, 35, 17, 35, - 53, 51, 53, 52, 54, 59, 1, 21, 35, 34, 7, 6, 29, 1, 33, 53, 52, 54, 51, 5,170,176, 99, 77, 1, 47,254,209,185,254, 7,185, -176,176,174,189,174,176, 99, 39, 38, 1,249,174,189, 6, 20,153, 80,104, 99,143,252, 47, 3,209,252, 47, 3,209,143, 78,187,171, -153, 40, 40,104, 99, 78,187,171, 0, 2, 0, 47, 0, 0, 4, 74, 6, 20, 0, 21, 0, 25, 0, 67, 64, 17, 27, 70, 0, 23, 8, 22, - 15, 20, 4, 8, 8, 3, 22, 10, 6, 76, 26, 16,252, 60,196, 50,196,252, 60,196, 16,254, 60,236, 49, 0, 64, 18, 8, 3,169, 0, - 16,135, 14, 24,190, 22,177, 14,151, 9, 0,188, 5, 1, 47, 60,230, 50,238,254,238, 16,238, 16,238, 50, 48, 1, 17, 35, 17, 33, - 17, 35, 17, 35, 53, 51, 53, 52, 54, 59, 1, 21, 35, 34, 6, 29, 1, 1, 51, 21, 35, 4, 74,185,254, 7,185,176,176,173,179,185, -176, 99, 77, 1,249,185,185, 4, 96,251,160, 3,209,252, 47, 3,209,143, 78,183,175,153, 80,104, 99, 1,178,233, 0, 1, 0, 47, - 0, 0, 4, 74, 6, 20, 0, 21, 0, 55, 64, 15, 23, 70, 1, 8, 4, 10, 12, 8, 8, 16, 4, 18, 14, 76, 22, 16,252, 60,196,196, -252, 60,196, 16,254,236, 49, 0, 64, 13, 15, 11,169, 9, 4,135, 0,151, 17, 9,188, 13, 2, 47, 60,230, 50,254,238, 16,238, 50, - 48, 1, 33, 17, 35, 17, 33, 34, 6, 29, 1, 33, 21, 33, 17, 35, 17, 35, 53, 51, 53, 52, 54, 2, 74, 2, 0,185,254,183, 99, 77, - 1, 47,254,209,185,176,176,174, 6, 20,249,236, 5,123, 80,104, 99,143,252, 47, 3,209,143, 78,187,171, 0, 0, 0, 2, 0, 47, - 0, 0, 6,252, 6, 20, 0, 41, 0, 45, 0, 90, 64, 24, 47, 70, 23, 43, 8, 42, 16, 27, 21, 8, 26, 42, 9, 0, 31, 6, 8, 36, - 30, 9, 34, 38, 76, 46, 16,252, 60,196, 50,196,252, 60,196, 16,196, 50,252, 60,196, 16,252, 60,236, 49, 0, 64, 23, 27, 31, 35, -169, 36, 17, 1,135, 0, 45,190, 42,177, 16, 0,151, 22, 7, 36,188, 25, 29, 33, 47, 60, 60,228, 50, 50,228, 50,244,236, 16,236, - 50, 16,236, 50, 50, 48, 1, 21, 35, 34, 7, 6, 29, 1, 33, 53, 52, 55, 54, 55, 54, 59, 1, 21, 35, 34, 6, 29, 1, 33, 17, 35, - 17, 33, 17, 35, 17, 33, 17, 35, 17, 35, 53, 51, 53, 52, 54, 51, 5, 51, 21, 35, 2,248,176, 99, 39, 38, 1,249, 87, 28, 39, 78, -131,174,176, 99, 77, 2,178,185,254, 7,185,254, 7,185,176,176,174,189, 3,249,185,185, 6, 20,153, 40, 40,104, 99, 78,187, 85, - 28, 19, 39,153, 80,104, 99,251,160, 3,209,252, 47, 3,209,252, 47, 3,209,143, 78,187,171, 2,233, 0, 0, 0, 0, 1, 0, 47, - 0, 0, 6,252, 6, 20, 0, 38, 0, 78, 64, 22, 40, 70, 13, 8, 16, 22, 24, 20, 8, 16, 9, 0, 28, 6, 8, 33, 27, 9, 31, 35, - 76, 39, 16,252, 60,196, 50,196,252, 60,196, 16,196,252, 60,196, 16,252,236, 49, 0, 64, 18, 24, 28, 32,169, 33, 17, 2,135, 12, - 38,151, 21, 7, 33,188, 15, 26, 30, 47, 60, 60,228, 50, 50,244, 60,236, 50, 16,236, 50, 50, 48, 1, 21, 35, 34, 7, 6, 29, 1, - 33, 53, 52, 54, 51, 33, 17, 35, 17, 33, 34, 6, 29, 1, 33, 21, 33, 17, 35, 17, 33, 17, 35, 17, 35, 53, 51, 53, 52, 54, 51, 2, -248,176, 99, 39, 38, 1,249,174,189, 2, 0,185,254,183, 99, 77, 1, 47,254,209,185,254, 7,185,176,176,174,189, 6, 20,153, 40, - 40,104, 99, 78,187,171,249,236, 5,123, 80,104, 99,143,252, 47, 3,209,252, 47, 3,209,143, 78,187,171, 0, 0, 0, 1, 0, 47, - 0, 0, 5, 76, 6, 20, 0, 45, 0, 0, 1, 53, 52, 39, 38, 43, 1, 34, 7, 6, 21, 17, 35, 17, 35, 53, 51, 53, 52, 55, 54, 59, - 1, 50, 23, 22, 29, 1, 33, 21, 33, 17, 20, 23, 22, 59, 1, 21, 35, 34, 39, 38, 53, 17, 35, 53, 3, 24, 36, 37,101, 34, 99, 39, - 38,185,176,176, 87, 87,189, 30,189, 87, 85, 1,123,254,133, 37, 38,115,189,189,213, 81, 81,135, 4, 96, 99,104, 40, 40, 40, 40, -104,251, 61, 3,209,143, 78,187, 85, 86, 86, 83,189, 78,143,253,160,137, 39, 39,154, 80, 79,210, 2, 96,143, 0, 0, 1, 0,111, -255,227, 6,178, 5,240, 0, 89, 0, 0, 1, 21, 38, 39, 38, 35, 34, 7, 6, 21, 20, 23, 22, 31, 1, 30, 1, 21, 20, 7, 6, 35, - 34, 39, 38, 39, 53, 22, 23, 22, 51, 50, 55, 54, 53, 52, 39, 38, 47, 1, 38, 39, 38, 53, 52, 55, 54, 51, 50, 23, 38, 53, 52, 55, - 54, 55, 50, 23, 22, 29, 1, 33, 21, 33, 17, 20, 23, 22, 59, 1, 21, 35, 34, 39, 38, 53, 17, 35, 53, 51, 53, 52, 39, 38, 7, 34, - 7, 6, 21, 20, 3, 81, 86, 73, 84, 70,117, 63, 59, 49, 49,148, 63,195,166,123,124,216, 96, 92, 97,108,102, 99, 99, 97,130, 70, - 70, 50, 45,177, 64,171, 76, 76,102,112,181, 72, 77, 5, 92, 91,162,140, 98, 94, 1,123,254,133, 37, 38,115,189,189,213, 81, 81, -135,135, 48, 54, 68, 69, 54, 52, 4, 63,174, 43, 17, 20, 42, 39, 87, 64, 37, 36, 33, 14, 43,152,137,156, 91, 91, 17, 18, 35,190, - 53, 26, 27, 45, 44, 81, 75, 40, 35, 42, 15, 36, 74, 75,130,166, 78, 86, 11, 29, 31,135, 95, 93, 1, 96, 92,136, 76,143,253,160, -137, 39, 39,154, 80, 79,210, 2, 96,143, 78, 65, 43, 50, 1, 49, 48, 64, 61, 0, 0, 1, 0,170,255,227, 8,227, 6, 20, 0, 74, - 0, 0, 1, 22, 21, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 52, 39, 33, 34, 39, 38, 55, 54, - 55, 54, 59, 1, 21, 35, 34, 21, 20, 51, 33, 39, 38, 55, 54, 59, 1, 21, 35, 38, 21, 20, 31, 1, 33, 3, 20, 23, 22, 51, 50, 54, - 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 4, 79, 9,184, 67,177,117,193,200,184,124,124,149,173, 5,254, 83,149, 94, - 83, 3, 3, 87,115,118, 89, 89,131,131, 1,108, 23, 77, 32, 55,209,236,222, 96, 14, 59, 1,221, 1, 62, 62,124,149,173,184,184, - 67,177,117,193,200, 3,182, 37, 33,252,144,172,102, 99,240,231, 1,102,254,161,159,159,190,164, 1,145, 36, 28, 94, 83,145,131, - 66, 87,175,123,138, 56,186, 72,122,175, 1, 44, 39, 34,145,253, 97,160, 79, 79,190,164, 2,123,251,160,172,102, 99,240,231, 1, -252, 0, 0, 0, 0, 1, 0,174,255,227, 8,227, 6, 20, 0, 58, 0, 0, 1, 33, 38, 21, 20, 31, 1, 22, 21, 17, 35, 53, 14, 1, - 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 52, 47, 1, 38, 55, 54, 51, 33, 17, 33, 21, 33, 17, 20, 22, 51, 50, 55, - 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 38, 53, 5, 57,254,243, 96, 14, 77, 49,184, 67,177,117,193,200,184,124,124,149,173, - 16, 77, 77, 32, 55,209, 1,211, 2,242,253, 14,124,124,152, 83, 87,184,184, 67,177,117,193,200, 5,101, 1, 44, 39, 34,188,120, - 77,252,144,172,102, 99,240,231, 2,166,253, 97,159,159,190,164, 1,145, 63, 39,188,187, 71,122,254, 76,170,254, 11,159,159, 95, - 98,161, 1, 59,252,224,172,102, 99,240,231, 0, 0, 1, 0,174,254, 86, 8,227, 6, 20, 0, 53, 0, 0, 1, 33, 38, 21, 20, 31, - 1, 22, 21, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 54, 53, 17, 52, 47, 1, 38, 55, 54, 51, 33, 17, 62, - 1, 51, 50, 22, 21, 17, 35, 17, 52, 38, 35, 34, 6, 21, 17, 35, 5, 57,254,243, 96, 14, 77, 49,184, 67,177,117,193,200,184,124, -124,149,173, 16, 77, 77, 32, 55,209, 1,212, 66,179,117,193,198,184,124,124,149,172,185, 5,101, 1, 44, 39, 34,188,120, 77,252, -144,172,102, 99,240,231, 2,166,253, 97,159,159,190,164, 1,145, 63, 39,188,187, 71,122,253,158,101,100,239,232,253, 92, 2,158, -159,158,190,164,251,221, 0, 0, 0, 2, 0,174,254, 86, 8,227, 6, 20, 0, 53, 0, 60, 0, 0, 1, 33, 34, 39, 38, 55, 54, 55, - 54, 51, 33, 17, 33, 17, 20, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 35, 17, 51, 21, 33, 17, 14, 1, - 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 55, 54, 53, 25, 1, 33, 34, 21, 20, 51, 3,160,254,219,149, 94, 83, 3, 3, 87,115, -118, 1,221, 1,153,124,124,149,173,184,184, 67,177,117,193,200,225,213,254,115, 67,177,117,193,200,184,124,124,149, 87, 86,254, -219,131,131, 3,182, 94, 83,145,131, 66, 87,254, 76,253, 97,159,159,190,164, 2,123,251,160,172,102, 99,240,231, 1,252,251, 66, -162, 2, 86,102, 99,240,231, 1,102,254,161,159,159, 95, 95,164, 2,123, 1, 5,123,138, 0, 0, 0, 1, 0,174,254, 86, 11,155, - 6, 20, 0, 72, 0, 0, 1, 33, 38, 21, 20, 31, 1, 22, 21, 17, 35, 53, 14, 1, 35, 34, 38, 53, 17, 51, 17, 20, 22, 51, 50, 54, - 53, 17, 52, 47, 1, 38, 55, 54, 51, 33, 17, 54, 55, 54, 51, 50, 22, 29, 1, 20, 23, 22, 51, 50, 54, 53, 17, 51, 17, 35, 53, 14, - 1, 35, 34, 39, 38, 61, 1, 52, 38, 35, 34, 6, 21, 17, 35, 5, 57,254,243, 96, 14, 77, 49,184, 67,177,117,193,200,184,124,124, -149,173, 16, 77, 77, 32, 55,209, 1,212, 99, 37, 90,107,193,198, 62, 56,110,140,173,184,184, 67,177,108,175, 98,100,124,124,120, -172,185, 5,101, 1, 44, 39, 34,188,120, 77,252,144,172,102, 99,240,231, 2,166,253, 97,159,159,190,164, 1,145, 63, 39,188,187, - 71,122,253,158,129, 22, 50,239,232,227,151, 88, 79,190,164, 2,123,251,160,172,102, 99,120,123,228,228,159,158,190,164,251,221, - 0, 3, 0, 30,255, 84, 8, 22, 7, 76, 0, 3, 0, 7, 0, 42, 0, 0, 9, 4, 21, 51, 53, 39, 53, 52, 54, 55, 54, 55, 54, 63, - 1, 54, 55, 54, 53, 52, 38, 35, 34, 6, 7, 21, 62, 1, 51, 50, 22, 21, 20, 6, 15, 1, 14, 1, 29, 1, 4, 26, 3,252,252, 4, -252, 4, 3,150,203, 6, 6, 6, 8, 19, 23, 44, 88, 92, 34, 36,223,184,103,193, 94, 97,179, 79,108,131, 51, 57, 90, 90, 56, 7, - 76,252, 4,252, 4, 3,252,253,174,254,254,147,123, 52, 60, 21, 25, 26, 31, 43, 86, 90, 64, 69, 76,159,194, 56, 57,188, 67, 70, -110, 89, 49, 94, 53, 89, 86,130,101,154, 0, 0, 0, 0, 0, 1, 0, 0, 60, 2, 0, 1, 9,254, 48, 0, 0, 11, 11,244, 0, 16, - 0, 36,255,211, 0, 16, 0, 37,255,183, 0, 16, 0, 42, 0, 75, 0, 16, 0, 45, 0,114, 0, 16, 0, 50, 0, 57, 0, 16, 0, 52, - 0, 75, 0, 16, 0, 55,255, 68, 0, 16, 0, 57,255,136, 0, 16, 0, 58,255,173, 0, 16, 0, 59,255,154, 0, 16, 0, 60,255, 13, - 0, 16, 0, 82, 0, 38, 0, 16, 0, 89,255,201, 0, 16, 0, 92,255,220, 0, 16, 0,130,255,211, 0, 16, 0,131,255,211, 0, 16, - 0,132,255,211, 0, 16, 0,133,255,211, 0, 16, 0,134,255,211, 0, 16, 0,148, 0, 57, 0, 16, 0,149, 0, 57, 0, 16, 0,150, - 0, 57, 0, 16, 0,151, 0, 57, 0, 16, 0,152, 0, 57, 0, 16, 0,159,255, 13, 0, 16, 0,180, 0, 38, 0, 16, 0,181, 0, 38, - 0, 16, 0,182, 0, 38, 0, 16, 0,183, 0, 38, 0, 16, 0,184, 0, 38, 0, 16, 0,191,255,220, 0, 16, 0,193,255,220, 0, 16, - 0,194,255,211, 0, 16, 0,196,255,211, 0, 16, 0,198,255,211, 0, 16, 0,224, 0, 75, 0, 16, 1, 38,255, 68, 0, 16, 1, 58, -255, 13, 0, 36, 0, 16,255,211, 0, 36, 0, 17,255,220, 0, 36, 0, 29,255,220, 0, 36, 0, 36, 0, 57, 0, 36, 0, 38,255,220, - 0, 36, 0, 42,255,220, 0, 36, 0, 50,255,220, 0, 36, 0, 52,255,220, 0, 36, 0, 55,255, 97, 0, 36, 0, 57,255,125, 0, 36, - 0, 58,255,144, 0, 36, 0, 60,255, 97, 0, 36, 0, 70,255,220, 0, 36, 0, 71,255,220, 0, 36, 0, 72,255,220, 0, 36, 0, 73, -255,183, 0, 36, 0, 82,255,220, 0, 36, 0, 84,255,220, 0, 36, 0, 87,255,220, 0, 36, 0, 89,255,136, 0, 36, 0, 90,255,173, - 0, 36, 0, 92,255,117, 0, 36, 0,109,255,183, 0, 36, 0,130, 0, 57, 0, 36, 0,131, 0, 57, 0, 36, 0,132, 0, 57, 0, 36, - 0,133, 0, 57, 0, 36, 0,134, 0, 57, 0, 36, 0,137,255,220, 0, 36, 0,148,255,220, 0, 36, 0,149,255,220, 0, 36, 0,150, -255,220, 0, 36, 0,151,255,220, 0, 36, 0,152,255,220, 0, 36, 0,159,255, 97, 0, 36, 0,169,255,220, 0, 36, 0,170,255,220, - 0, 36, 0,171,255,220, 0, 36, 0,172,255,220, 0, 36, 0,173,255,220, 0, 36, 0,180,255,220, 0, 36, 0,181,255,220, 0, 36, - 0,182,255,220, 0, 36, 0,183,255,220, 0, 36, 0,184,255,220, 0, 36, 0,191,255,117, 0, 36, 0,193,255,117, 0, 36, 0,194, - 0, 57, 0, 36, 0,196, 0, 57, 0, 36, 0,198, 0, 57, 0, 36, 0,200,255,220, 0, 36, 0,201,255,220, 0, 36, 0,202,255,220, - 0, 36, 0,203,255,220, 0, 36, 0,204,255,220, 0, 36, 0,205,255,220, 0, 36, 0,206,255,220, 0, 36, 0,207,255,220, 0, 36, - 0,209,255,220, 0, 36, 0,211,255,220, 0, 36, 0,213,255,220, 0, 36, 0,215,255,220, 0, 36, 0,217,255,220, 0, 36, 0,219, -255,220, 0, 36, 0,221,255,220, 0, 36, 0,222,255,220, 0, 36, 0,224,255,220, 0, 36, 0,226,255,220, 0, 36, 1, 14,255,220, - 0, 36, 1, 15,255,220, 0, 36, 1, 16,255,220, 0, 36, 1, 17,255,220, 0, 36, 1, 18,255,220, 0, 36, 1, 19,255,220, 0, 36, - 1, 36,255, 97, 0, 36, 1, 37,255,220, 0, 36, 1, 38,255, 97, 0, 36, 1, 39,255,220, 0, 36, 1, 54,255,144, 0, 36, 1, 55, -255,173, 0, 36, 1, 56,255, 97, 0, 36, 1, 57,255,117, 0, 36, 1, 58,255, 97, 0, 36, 1,136,255,220, 0, 36, 1,172,255,220, - 0, 36, 1,173,255,220, 0, 36, 1,174,255,220, 0, 36, 1,175,255,220, 0, 36, 1,220,255, 97, 0, 36, 1,221,255,220, 0, 36, - 1,240,255,220, 0, 36, 1,243,255,220, 0, 36, 1,244,255, 97, 0, 36, 1,245,255,117, 0, 36, 4,252,255,144, 0, 36, 4,253, -255,173, 0, 36, 4,254,255,144, 0, 36, 4,255,255,173, 0, 36, 5, 0,255,144, 0, 36, 5, 1,255,173, 0, 36, 5,106,255, 97, - 0, 36, 5,107,255,117, 0, 36, 5,145,254,248, 0, 36, 5,146,255, 3, 0, 36, 5,147, 0, 47, 0, 37, 0, 38,255,220, 0, 37, - 0, 42,255,220, 0, 37, 0, 50,255,220, 0, 37, 0, 54,255,220, 0, 37, 0, 57,255,193, 0, 37, 0, 58,255,183, 0, 37, 0, 60, -255,144, 0, 37, 0,109,255,193, 0, 37, 0,125,255,220, 0, 37, 0,137,255,220, 0, 37, 0,148,255,220, 0, 37, 0,149,255,220, - 0, 37, 0,150,255,220, 0, 37, 0,151,255,220, 0, 37, 0,152,255,220, 0, 37, 0,159,255,144, 0, 37, 0,200,255,220, 0, 37, - 0,202,255,220, 0, 37, 0,204,255,220, 0, 37, 0,206,255,220, 0, 37, 0,222,255,220, 0, 37, 0,224,255,220, 0, 37, 0,226, -255,220, 0, 37, 0,228,255,220, 0, 37, 1, 14,255,220, 0, 37, 1, 16,255,220, 0, 37, 1, 18,255,220, 0, 37, 1, 28,255,220, - 0, 37, 1, 30,255,220, 0, 37, 1, 32,255,220, 0, 37, 1, 34,255,220, 0, 37, 1, 54,255,183, 0, 37, 1, 56,255,144, 0, 37, - 1, 58,255,144, 0, 37, 1,172,255,220, 0, 37, 1,174,255,220, 0, 37, 1,218,255,220, 0, 37, 1,240,255,220, 0, 37, 4,252, -255,183, 0, 37, 4,254,255,183, 0, 37, 5, 0,255,183, 0, 37, 5,106,255,144, 0, 37, 5,145,255,144, 0, 37, 5,146,255,144, - 0, 37, 5,147,255,173, 0, 38, 0, 60,255,220, 0, 38, 0,109,255,220, 0, 38, 0,125,255,220, 0, 38, 0,159,255,220, 0, 38, - 1, 56,255,220, 0, 38, 1, 58,255,220, 0, 38, 1,244,255,220, 0, 38, 5,106,255,220, 0, 38, 5,146, 0, 38, 0, 39, 0, 36, -255,220, 0, 39, 0, 57,255,220, 0, 39, 0, 60,255,144, 0, 39, 0,109,255,220, 0, 39, 0,125,255,220, 0, 39, 0,130,255,220, - 0, 39, 0,131,255,220, 0, 39, 0,132,255,220, 0, 39, 0,133,255,220, 0, 39, 0,134,255,220, 0, 39, 0,159,255,144, 0, 39, - 0,194,255,220, 0, 39, 0,196,255,220, 0, 39, 0,198,255,220, 0, 39, 1, 56,255,144, 0, 39, 1, 58,255,144, 0, 39, 1,244, -255,144, 0, 39, 5,106,255,144, 0, 39, 5,145,255,211, 0, 39, 5,146,255,201, 0, 39, 5,147,255, 68, 0, 41, 0, 17,254,183, - 0, 41, 0, 29,255, 97, 0, 41, 0, 36,255, 68, 0, 41, 0, 54,255,220, 0, 41, 0, 55,255,220, 0, 41, 0, 68,255, 68, 0, 41, - 0, 72,255,144, 0, 41, 0, 76,255,107, 0, 41, 0, 82,255,183, 0, 41, 0, 85,255,107, 0, 41, 0, 88,255,144, 0, 41, 0, 92, -255, 68, 0, 41, 0,130,255, 68, 0, 41, 0,131,255, 68, 0, 41, 0,132,255, 68, 0, 41, 0,133,255, 68, 0, 41, 0,134,255, 68, - 0, 41, 0,162,255, 68, 0, 41, 0,163,255, 68, 0, 41, 0,164,255, 68, 0, 41, 0,165,255, 68, 0, 41, 0,166,255, 68, 0, 41, - 0,167,255, 68, 0, 41, 0,170,255,144, 0, 41, 0,171,255,144, 0, 41, 0,172,255,144, 0, 41, 0,173,255,144, 0, 41, 0,180, -255,183, 0, 41, 0,181,255,183, 0, 41, 0,182,255,183, 0, 41, 0,183,255,183, 0, 41, 0,184,255,183, 0, 41, 0,187,255,144, - 0, 41, 0,188,255,144, 0, 41, 0,189,255,144, 0, 41, 0,190,255,144, 0, 41, 0,191,255, 68, 0, 41, 0,193,255, 68, 0, 41, - 0,194,255, 68, 0, 41, 0,195,255, 68, 0, 41, 0,196,255, 68, 0, 41, 0,197,255, 68, 0, 41, 0,198,255, 68, 0, 41, 0,199, -255, 68, 0, 41, 0,213,255,144, 0, 41, 0,215,255,144, 0, 41, 0,217,255,144, 0, 41, 0,219,255,144, 0, 41, 0,221,255,144, - 0, 41, 0,241,255,107, 0, 41, 0,245,255,107, 0, 41, 1, 15,255,183, 0, 41, 1, 17,255,183, 0, 41, 1, 19,255,183, 0, 41, - 1, 23,255,107, 0, 41, 1, 25,255,107, 0, 41, 1, 27,255,107, 0, 41, 1, 28,255,220, 0, 41, 1, 30,255,220, 0, 41, 1, 32, -255,220, 0, 41, 1, 34,255,220, 0, 41, 1, 36,255,220, 0, 41, 1, 38,255,220, 0, 41, 1, 40,255,220, 0, 41, 1, 43,255,144, - 0, 41, 1, 45,255,144, 0, 41, 1, 47,255,144, 0, 41, 1, 49,255,144, 0, 41, 1, 51,255,144, 0, 41, 1, 53,255,144, 0, 41, - 1, 57,255, 68, 0, 41, 1,173,255,183, 0, 41, 1,175,255,183, 0, 41, 1,218,255,220, 0, 41, 1,220,255,220, 0, 41, 1,241, -255,183, 0, 41, 1,245,255, 68, 0, 41, 5,107,255, 68, 0, 41, 5,145,255,211, 0, 41, 5,147,254,136, 0, 42, 0, 55,255,183, - 0, 42, 0, 60,255,154, 0, 42, 0,109,255,220, 0, 42, 0,125,255,220, 0, 42, 0,159,255,154, 0, 42, 1, 38,255,183, 0, 42, - 1, 58,255,154, 0, 42, 5,145,255,211, 0, 42, 5,146,255,211, 0, 42, 5,147,255,201, 0, 43, 0, 17,255,220, 0, 43, 5,145, -255,183, 0, 43, 5,146,255,193, 0, 43, 5,147,255,183, 0, 45, 0, 16,255,183, 0, 45, 0, 36,255,220, 0, 45, 0,109,255,220, - 0, 45, 0,125,255,220, 0, 45, 0,130,255,220, 0, 45, 0,131,255,220, 0, 45, 0,132,255,220, 0, 45, 0,133,255,220, 0, 45, - 0,134,255,220, 0, 45, 5,145,255,183, 0, 45, 5,146,255,193, 0, 45, 5,147,255,144, 0, 46, 0, 16,255, 41, 0, 46, 0, 36, -255,220, 0, 46, 0, 38,255,144, 0, 46, 0, 50,255,144, 0, 46, 0, 55,255, 97, 0, 46, 0, 56,255,201, 0, 46, 0, 58,255,183, - 0, 46, 0, 60,255,183, 0, 46, 0, 68,255,220, 0, 46, 0, 72,255,154, 0, 46, 0, 82,255,154, 0, 46, 0, 88,255,154, 0, 46, - 0, 92,255,107, 0, 46, 0,109,255,125, 0, 46, 0,130,255,220, 0, 46, 0,131,255,220, 0, 46, 0,132,255,220, 0, 46, 0,133, -255,220, 0, 46, 0,134,255,220, 0, 46, 0,137,255,144, 0, 46, 0,148,255,144, 0, 46, 0,149,255,144, 0, 46, 0,150,255,144, - 0, 46, 0,151,255,144, 0, 46, 0,152,255,144, 0, 46, 0,155,255,201, 0, 46, 0,156,255,201, 0, 46, 0,157,255,201, 0, 46, - 0,158,255,201, 0, 46, 0,159,255,183, 0, 46, 0,162,255,220, 0, 46, 0,163,255,220, 0, 46, 0,164,255,220, 0, 46, 0,165, -255,220, 0, 46, 0,166,255,220, 0, 46, 0,167,255,220, 0, 46, 0,170,255,154, 0, 46, 0,171,255,154, 0, 46, 0,172,255,154, - 0, 46, 0,173,255,154, 0, 46, 0,180,255,154, 0, 46, 0,181,255,154, 0, 46, 0,182,255,154, 0, 46, 0,183,255,154, 0, 46, - 0,184,255,154, 0, 46, 0,187,255,154, 0, 46, 0,188,255,154, 0, 46, 0,189,255,154, 0, 46, 0,190,255,154, 0, 46, 0,191, -255,107, 0, 46, 0,193,255,107, 0, 46, 0,200,255,144, 0, 46, 0,206,255,144, 0, 46, 0,221,255,154, 0, 46, 1, 38,255, 97, - 0, 46, 1, 48,255,201, 0, 46, 1, 49,255,154, 0, 46, 1, 58,255,183, 0, 46, 5,145,255,193, 0, 46, 5,146,255,193, 0, 47, - 0, 16,255,220, 0, 47, 0, 36, 0, 47, 0, 47, 0, 50,255,183, 0, 47, 0, 55,254,230, 0, 47, 0, 56,255,154, 0, 47, 0, 57, -255, 31, 0, 47, 0, 58,255, 68, 0, 47, 0, 60,254,240, 0, 47, 0, 72,255,220, 0, 47, 0, 82,255,220, 0, 47, 0, 88,255,220, - 0, 47, 0, 92,255, 68, 0, 47, 0,130, 0, 47, 0, 47, 0,131, 0, 47, 0, 47, 0,132, 0, 47, 0, 47, 0,133, 0, 47, 0, 47, - 0,134, 0, 47, 0, 47, 0,148,255,183, 0, 47, 0,149,255,183, 0, 47, 0,150,255,183, 0, 47, 0,151,255,183, 0, 47, 0,152, -255,183, 0, 47, 0,155,255,154, 0, 47, 0,156,255,154, 0, 47, 0,157,255,154, 0, 47, 0,158,255,154, 0, 47, 0,159,254,240, - 0, 47, 0,170,255,220, 0, 47, 0,171,255,220, 0, 47, 0,172,255,220, 0, 47, 0,173,255,220, 0, 47, 0,180,255,220, 0, 47, - 0,181,255,220, 0, 47, 0,182,255,220, 0, 47, 0,183,255,220, 0, 47, 0,184,255,220, 0, 47, 0,187,255,220, 0, 47, 0,188, -255,220, 0, 47, 0,189,255,220, 0, 47, 0,190,255,220, 0, 47, 0,191,255, 68, 0, 47, 0,193,255, 68, 0, 47, 0,221,255,220, - 0, 47, 1, 38,254,230, 0, 47, 1, 48,255,154, 0, 47, 1, 49,255,220, 0, 47, 1, 58,254,240, 0, 47, 5,145,254, 97, 0, 47, - 5,146,253,230, 0, 50, 0, 16, 0, 57, 0, 50, 0, 17,255,173, 0, 50, 0, 29,255,220, 0, 50, 0, 36,255,220, 0, 50, 0, 57, -255,220, 0, 50, 0, 59,255,125, 0, 50, 0, 60,255,144, 0, 50, 0,109,255,220, 0, 50, 0,130,255,220, 0, 50, 0,131,255,220, - 0, 50, 0,132,255,220, 0, 50, 0,133,255,220, 0, 50, 0,134,255,220, 0, 50, 0,159,255,144, 0, 50, 1, 58,255,144, 0, 50, - 5,145,255,211, 0, 50, 5,146,255,220, 0, 50, 5,147,255, 68, 0, 51, 0, 16,255,211, 0, 51, 0, 17,254,193, 0, 51, 0, 36, -255,125, 0, 51, 0, 60,255,211, 0, 51, 0, 68,255,164, 0, 51, 0, 72,255,183, 0, 51, 0, 76,255,211, 0, 51, 0, 81,255,220, - 0, 51, 0, 82,255,183, 0, 51, 0, 85,255,220, 0, 51, 0, 86,255,220, 0, 51, 0, 88,255,220, 0, 51, 0,109,255,220, 0, 51, - 0,130,255,125, 0, 51, 0,131,255,125, 0, 51, 0,132,255,125, 0, 51, 0,133,255,125, 0, 51, 0,134,255,125, 0, 51, 0,159, -255,211, 0, 51, 0,162,255,164, 0, 51, 0,163,255,164, 0, 51, 0,164,255,164, 0, 51, 0,165,255,164, 0, 51, 0,166,255,164, - 0, 51, 0,167,255,164, 0, 51, 0,170,255,183, 0, 51, 0,171,255,183, 0, 51, 0,172,255,183, 0, 51, 0,173,255,183, 0, 51, - 0,179,255,220, 0, 51, 0,180,255,183, 0, 51, 0,181,255,183, 0, 51, 0,182,255,183, 0, 51, 0,183,255,183, 0, 51, 0,184, -255,183, 0, 51, 0,187,255,220, 0, 51, 0,188,255,220, 0, 51, 0,189,255,220, 0, 51, 0,190,255,220, 0, 51, 0,221,255,183, - 0, 51, 1, 10,255,220, 0, 51, 1, 23,255,220, 0, 51, 1, 27,255,220, 0, 51, 1, 33,255,220, 0, 51, 1, 35,255,220, 0, 51, - 1, 49,255,220, 0, 51, 1, 58,255,211, 0, 51, 5,145, 0, 38, 0, 51, 5,146, 0, 38, 0, 51, 5,147,254,183, 0, 52, 0, 16, - 0, 57, 0, 52, 5,145,255,211, 0, 52, 5,146,255,220, 0, 52, 5,147,255,125, 0, 53, 0, 16,255,173, 0, 53, 0, 17,255,183, - 0, 53, 0, 29,255,193, 0, 53, 0, 36,255,173, 0, 53, 0, 38,255,154, 0, 53, 0, 55,255,107, 0, 53, 0, 57,255,144, 0, 53, - 0, 58,255,173, 0, 53, 0, 60,255,125, 0, 53, 0, 68,255,211, 0, 53, 0, 72,255,164, 0, 53, 0, 82,255,164, 0, 53, 0, 88, -255,164, 0, 53, 0, 92,255,144, 0, 53, 0,109,255,144, 0, 53, 0,125,255,220, 0, 53, 0,130,255,173, 0, 53, 0,131,255,173, - 0, 53, 0,132,255,173, 0, 53, 0,133,255,173, 0, 53, 0,134,255,173, 0, 53, 0,137,255,154, 0, 53, 0,159,255,125, 0, 53, - 0,162,255,211, 0, 53, 0,163,255,211, 0, 53, 0,164,255,211, 0, 53, 0,165,255,211, 0, 53, 0,166,255,211, 0, 53, 0,167, -255,211, 0, 53, 0,170,255,164, 0, 53, 0,171,255,164, 0, 53, 0,172,255,164, 0, 53, 0,173,255,164, 0, 53, 0,180,255,164, - 0, 53, 0,181,255,164, 0, 53, 0,182,255,164, 0, 53, 0,183,255,164, 0, 53, 0,184,255,164, 0, 53, 0,187,255,164, 0, 53, - 0,188,255,164, 0, 53, 0,189,255,164, 0, 53, 0,190,255,164, 0, 53, 0,191,255,144, 0, 53, 0,193,255,144, 0, 53, 0,200, -255,154, 0, 53, 0,206,255,154, 0, 53, 0,221,255,164, 0, 53, 1, 38,255,107, 0, 53, 1, 49,255,164, 0, 53, 1, 58,255,125, - 0, 53, 5,145,255,107, 0, 53, 5,146,255,125, 0, 53, 5,147,255,220, 0, 54, 0, 36, 0, 38, 0, 54, 0,130, 0, 38, 0, 54, - 0,131, 0, 38, 0, 54, 0,132, 0, 38, 0, 54, 0,133, 0, 38, 0, 54, 0,134, 0, 38, 0, 55, 0, 16,255, 68, 0, 55, 0, 17, -255, 13, 0, 55, 0, 29,255, 31, 0, 55, 0, 36,255, 97, 0, 55, 0, 38,255,136, 0, 55, 0, 55,255,220, 0, 55, 0, 68,254,173, - 0, 55, 0, 70,254,164, 0, 55, 0, 72,254,164, 0, 55, 0, 76,255,193, 0, 55, 0, 82,254,164, 0, 55, 0, 85,254,211, 0, 55, - 0, 86,254,173, 0, 55, 0, 88,254,201, 0, 55, 0, 90,254,173, 0, 55, 0, 92,254,193, 0, 55, 0,109,255, 68, 0, 55, 0,125, -255,144, 0, 55, 0,130,255, 97, 0, 55, 0,131,255, 97, 0, 55, 0,132,255, 97, 0, 55, 0,133,255, 97, 0, 55, 0,134,255, 97, - 0, 55, 0,137,255,136, 0, 55, 0,162,254,173, 0, 55, 0,163,254,173, 0, 55, 0,164,254,173, 0, 55, 0,165,254,173, 0, 55, - 0,166,254,173, 0, 55, 0,167,254,173, 0, 55, 0,169,254,164, 0, 55, 0,170,254,164, 0, 55, 0,171,254,164, 0, 55, 0,172, -254,164, 0, 55, 0,173,254,164, 0, 55, 0,180,254,164, 0, 55, 0,181,254,164, 0, 55, 0,182,254,164, 0, 55, 0,183,254,164, - 0, 55, 0,184,254,164, 0, 55, 0,187,254,201, 0, 55, 0,188,254,201, 0, 55, 0,189,254,201, 0, 55, 0,190,254,201, 0, 55, - 0,191,254,193, 0, 55, 0,193,254,193, 0, 55, 0,200,255,136, 0, 55, 0,201,254,164, 0, 55, 0,206,255,136, 0, 55, 0,207, -254,164, 0, 55, 0,221,254,164, 0, 55, 1, 23,254,211, 0, 55, 1, 27,254,211, 0, 55, 1, 33,254,173, 0, 55, 1, 35,254,173, - 0, 55, 1, 38,255,220, 0, 55, 1, 49,254,201, 0, 55, 5,146,255,211, 0, 55, 5,147,254,248, 0, 56, 0, 61,255,220, 0, 56, - 1, 63,255,220, 0, 57, 0, 16,255,136, 0, 57, 0, 17,254,248, 0, 57, 0, 29,255, 89, 0, 57, 0, 36,255,125, 0, 57, 0, 50, -255,220, 0, 57, 0, 68,255, 97, 0, 57, 0, 72,255, 97, 0, 57, 0, 76,255,211, 0, 57, 0, 82,255, 97, 0, 57, 0, 88,255,117, - 0, 57, 0, 92,255,201, 0, 57, 0,109,255, 78, 0, 57, 0,125,255,144, 0, 57, 0,130,255,125, 0, 57, 0,131,255,125, 0, 57, - 0,132,255,125, 0, 57, 0,133,255,125, 0, 57, 0,134,255,125, 0, 57, 0,148,255,220, 0, 57, 0,149,255,220, 0, 57, 0,150, -255,220, 0, 57, 0,151,255,220, 0, 57, 0,152,255,220, 0, 57, 0,162,255, 97, 0, 57, 0,163,255, 97, 0, 57, 0,164,255, 97, - 0, 57, 0,165,255, 97, 0, 57, 0,166,255, 97, 0, 57, 0,167,255, 97, 0, 57, 0,170,255, 97, 0, 57, 0,171,255, 97, 0, 57, - 0,172,255, 97, 0, 57, 0,173,255, 97, 0, 57, 0,180,255, 97, 0, 57, 0,181,255, 97, 0, 57, 0,182,255, 97, 0, 57, 0,183, -255, 97, 0, 57, 0,184,255, 97, 0, 57, 0,187,255,117, 0, 57, 0,188,255,117, 0, 57, 0,189,255,117, 0, 57, 0,190,255,117, - 0, 57, 0,191,255,201, 0, 57, 0,193,255,201, 0, 57, 0,221,255, 97, 0, 57, 1, 49,255,117, 0, 57, 5,147,254,230, 0, 58, - 0, 16,255,173, 0, 58, 0, 17,255, 21, 0, 58, 0, 29,255,136, 0, 58, 0, 36,255,144, 0, 58, 0, 68,255,125, 0, 58, 0, 72, -255,136, 0, 58, 0, 76,255,211, 0, 58, 0, 82,255,136, 0, 58, 0, 85,255,164, 0, 58, 0, 88,255,183, 0, 58, 0, 92,255,220, - 0, 58, 0,109,255,144, 0, 58, 0,125,255,220, 0, 58, 0,130,255,144, 0, 58, 0,131,255,144, 0, 58, 0,132,255,144, 0, 58, - 0,133,255,144, 0, 58, 0,134,255,144, 0, 58, 0,162,255,125, 0, 58, 0,163,255,125, 0, 58, 0,164,255,125, 0, 58, 0,165, -255,125, 0, 58, 0,166,255,125, 0, 58, 0,167,255,125, 0, 58, 0,170,255,136, 0, 58, 0,171,255,136, 0, 58, 0,172,255,136, - 0, 58, 0,173,255,136, 0, 58, 0,180,255,136, 0, 58, 0,181,255,136, 0, 58, 0,182,255,136, 0, 58, 0,183,255,136, 0, 58, - 0,184,255,136, 0, 58, 0,187,255,183, 0, 58, 0,188,255,183, 0, 58, 0,189,255,183, 0, 58, 0,190,255,183, 0, 58, 0,191, -255,220, 0, 58, 0,193,255,220, 0, 58, 0,221,255,136, 0, 58, 1, 23,255,164, 0, 58, 1, 27,255,164, 0, 58, 1, 49,255,183, - 0, 58, 5,145,255,220, 0, 58, 5,147,254,248, 0, 59, 0, 16,255,154, 0, 59, 0, 38,255,107, 0, 59, 0, 50,255,125, 0, 59, - 0, 55,255,220, 0, 59, 0, 72,255,164, 0, 59, 0,109,255,144, 0, 59, 0,137,255,107, 0, 59, 0,148,255,125, 0, 59, 0,149, -255,125, 0, 59, 0,150,255,125, 0, 59, 0,151,255,125, 0, 59, 0,152,255,125, 0, 59, 0,170,255,164, 0, 59, 0,171,255,164, - 0, 59, 0,172,255,164, 0, 59, 0,173,255,164, 0, 59, 0,200,255,107, 0, 59, 0,206,255,107, 0, 59, 0,221,255,164, 0, 59, - 1, 38,255,220, 0, 59, 5,145,255, 97, 0, 59, 5,146,255,173, 0, 59, 5,147,255,211, 0, 60, 0, 16,255, 13, 0, 60, 0, 17, -254, 97, 0, 60, 0, 29,254,240, 0, 60, 0, 36,255, 97, 0, 60, 0, 38,255,144, 0, 60, 0, 50,255,144, 0, 60, 0, 68,254,230, - 0, 60, 0, 72,254,240, 0, 60, 0, 76,255,183, 0, 60, 0, 82,254,240, 0, 60, 0, 88,255, 21, 0, 60, 0,109,255, 31, 0, 60, - 0,125,255,107, 0, 60, 0,130,255, 97, 0, 60, 0,131,255, 97, 0, 60, 0,132,255, 97, 0, 60, 0,133,255, 97, 0, 60, 0,134, -255, 97, 0, 60, 0,137,255,144, 0, 60, 0,148,255,144, 0, 60, 0,149,255,144, 0, 60, 0,150,255,144, 0, 60, 0,151,255,144, - 0, 60, 0,152,255,144, 0, 60, 0,162,254,230, 0, 60, 0,163,254,230, 0, 60, 0,164,254,230, 0, 60, 0,165,254,230, 0, 60, - 0,166,254,230, 0, 60, 0,167,254,230, 0, 60, 0,170,254,240, 0, 60, 0,171,254,240, 0, 60, 0,172,254,240, 0, 60, 0,173, -254,240, 0, 60, 0,180,254,240, 0, 60, 0,181,254,240, 0, 60, 0,182,254,240, 0, 60, 0,183,254,240, 0, 60, 0,184,254,240, - 0, 60, 0,187,255, 21, 0, 60, 0,188,255, 21, 0, 60, 0,189,255, 21, 0, 60, 0,190,255, 21, 0, 60, 0,200,255,144, 0, 60, - 0,206,255,144, 0, 60, 0,221,254,240, 0, 60, 1, 49,255, 21, 0, 60, 5,145,255,144, 0, 60, 5,146,255,220, 0, 60, 5,147, -254,248, 0, 61, 0, 16,255,220, 0, 61, 5,145,255,220, 0, 61, 5,146,255,220, 0, 61, 5,147,255,220, 0, 72, 0, 91,255,220, - 0, 73, 0, 16,255,144, 0, 73, 0, 17,255,107, 0, 73, 0, 29,255,183, 0, 73, 0, 87,255,220, 0, 73, 0, 90,255,220, 0, 73, - 0, 92,255,220, 0, 73, 0,109,255,183, 0, 73, 0,125,255,220, 0, 73, 0,191,255,220, 0, 73, 0,193,255,220, 0, 73, 1, 39, -255,220, 0, 73, 5,145, 0, 65, 0, 73, 5,147,255, 21, 0, 78, 0, 68,255,220, 0, 78, 0, 72,255,183, 0, 78, 0, 82,255,183, - 0, 78, 0, 88,255,193, 0, 78, 0, 92,255,183, 0, 78, 0,162,255,220, 0, 78, 0,163,255,220, 0, 78, 0,164,255,220, 0, 78, - 0,165,255,220, 0, 78, 0,166,255,220, 0, 78, 0,167,255,220, 0, 78, 0,170,255,183, 0, 78, 0,171,255,183, 0, 78, 0,172, -255,183, 0, 78, 0,173,255,183, 0, 78, 0,180,255,183, 0, 78, 0,181,255,183, 0, 78, 0,182,255,183, 0, 78, 0,183,255,183, - 0, 78, 0,184,255,183, 0, 78, 0,187,255,193, 0, 78, 0,188,255,193, 0, 78, 0,189,255,193, 0, 78, 0,190,255,193, 0, 78, - 0,191,255,183, 0, 78, 0,193,255,183, 0, 78, 0,221,255,183, 0, 78, 1, 49,255,193, 0, 81, 5,145,255,107, 0, 81, 5,146, -255,144, 0, 81, 5,147,255,164, 0, 82, 0, 16, 0, 38, 0, 82, 0, 17,255,220, 0, 82, 0, 91,255,193, 0, 82, 5,145,255,107, - 0, 82, 5,146,255,183, 0, 82, 5,147,255,125, 0, 85, 0, 16,255,125, 0, 85, 0, 17,255, 68, 0, 85, 0, 29,255,220, 0, 85, - 0, 70,255,211, 0, 85, 0, 71,255,220, 0, 85, 0, 72,255,211, 0, 85, 0, 74,255,220, 0, 85, 0, 75,255,220, 0, 85, 0, 80, -255,220, 0, 85, 0, 81,255,220, 0, 85, 0, 82,255,211, 0, 85, 0, 84,255,220, 0, 85, 0, 85,255,220, 0, 85, 0, 91,255,201, - 0, 85, 0,109,255,183, 0, 85, 0,169,255,211, 0, 85, 0,170,255,211, 0, 85, 0,171,255,211, 0, 85, 0,172,255,211, 0, 85, - 0,173,255,211, 0, 85, 0,179,255,220, 0, 85, 0,180,255,211, 0, 85, 0,181,255,211, 0, 85, 0,182,255,211, 0, 85, 0,183, -255,211, 0, 85, 0,184,255,211, 0, 85, 0,201,255,211, 0, 85, 0,207,255,211, 0, 85, 0,209, 0, 72, 0, 85, 0,221,255,211, - 0, 85, 0,225,255,220, 0, 85, 1, 10,255,220, 0, 85, 1, 23,255,220, 0, 85, 1, 27,255,220, 0, 85, 5,146, 0, 86, 0, 85, - 5,147,254,201, 0, 89, 0, 16,255,201, 0, 89, 0, 17,255, 97, 0, 89, 0, 29,255,144, 0, 89, 0,109,255,220, 0, 89, 0,125, -255,220, 0, 89, 5,146,255,220, 0, 89, 5,147,254,240, 0, 90, 0, 17,255, 68, 0, 90, 0, 29,255,144, 0, 90, 0,109,255,220, - 0, 90, 0,125,255,220, 0, 90, 5,147,255, 41, 0, 91, 0, 70,255,220, 0, 91, 0, 72,255,193, 0, 91, 0, 82,255,193, 0, 91, - 0,169,255,220, 0, 91, 0,170,255,193, 0, 91, 0,171,255,193, 0, 91, 0,172,255,193, 0, 91, 0,173,255,193, 0, 91, 0,180, -255,193, 0, 91, 0,181,255,193, 0, 91, 0,182,255,193, 0, 91, 0,183,255,193, 0, 91, 0,184,255,193, 0, 91, 0,201,255,220, - 0, 91, 0,207,255,220, 0, 91, 0,221,255,193, 0, 92, 0, 16,255,220, 0, 92, 0, 17,254,220, 0, 92, 0, 29,255,107, 0, 92, - 0,109,255,220, 0, 92, 0,125,255,220, 0, 92, 5,147,254,211, 0,109, 0, 37,255,220, 0,109, 0, 38,255,220, 0,109, 0, 39, -255,220, 0,109, 0, 42,255,220, 0,109, 0, 45,255,220, 0,109, 0, 55,255,144, 0,109, 0, 57,255,144, 0,109, 0, 58,255,220, - 0,109, 0, 60,255,107, 0,109, 0, 89,255,220, 0,109, 0, 90,255,220, 0,109, 0, 92,255,220, 0,109, 0,136, 0,151, 0,109, - 0,137,255,220, 0,109, 0,159,255,107, 0,109, 0,191,255,220, 0,109, 0,193,255,220, 0,109, 0,200,255,220, 0,109, 0,206, -255,220, 0,109, 0,208,255,220, 0,109, 0,224,255,220, 0,109, 1, 38,255,144, 0,109, 1, 58,255,107, 0,125, 0, 36,255,183, - 0,125, 0, 37,255,183, 0,125, 0, 38,255,220, 0,125, 0, 39,255,220, 0,125, 0, 45,255,220, 0,125, 0, 50,255,220, 0,125, - 0, 55,255, 68, 0,125, 0, 57,255, 78, 0,125, 0, 58,255,144, 0,125, 0, 59,255,144, 0,125, 0, 60,255, 31, 0,125, 0, 89, -255,220, 0,125, 0, 90,255,220, 0,125, 0, 92,255,220, 0,125, 0,130,255,183, 0,125, 0,131,255,183, 0,125, 0,132,255,183, - 0,125, 0,133,255,183, 0,125, 0,134,255,183, 0,125, 0,137,255,220, 0,125, 0,148,255,220, 0,125, 0,149,255,220, 0,125, - 0,150,255,220, 0,125, 0,151,255,220, 0,125, 0,152,255,220, 0,125, 0,159,255, 31, 0,125, 0,191,255,220, 0,125, 0,193, -255,220, 0,125, 0,200,255,220, 0,125, 0,206,255,220, 0,125, 0,208,255,220, 0,125, 1, 38,255, 68, 0,125, 1, 58,255, 31, - 0,130, 0, 16,255,211, 0,130, 0, 17,255,220, 0,130, 0, 29,255,220, 0,130, 0, 36, 0, 57, 0,130, 0, 38,255,220, 0,130, - 0, 42,255,220, 0,130, 0, 50,255,220, 0,130, 0, 52,255,220, 0,130, 0, 55,255, 97, 0,130, 0, 57,255,125, 0,130, 0, 58, -255,144, 0,130, 0, 60,255, 97, 0,130, 0, 70,255,220, 0,130, 0, 71,255,220, 0,130, 0, 72,255,220, 0,130, 0, 73,255,183, - 0,130, 0, 82,255,220, 0,130, 0, 84,255,220, 0,130, 0, 87,255,220, 0,130, 0, 89,255,136, 0,130, 0, 90,255,173, 0,130, - 0, 92,255,117, 0,130, 0,109,255,183, 0,130, 0,130, 0, 57, 0,130, 0,131, 0, 57, 0,130, 0,132, 0, 57, 0,130, 0,133, - 0, 57, 0,130, 0,134, 0, 57, 0,130, 0,137,255,220, 0,130, 0,148,255,220, 0,130, 0,149,255,220, 0,130, 0,150,255,220, - 0,130, 0,151,255,220, 0,130, 0,152,255,220, 0,130, 0,159,255, 97, 0,130, 0,169,255,220, 0,130, 0,170,255,220, 0,130, - 0,171,255,220, 0,130, 0,172,255,220, 0,130, 0,173,255,220, 0,130, 0,180,255,220, 0,130, 0,181,255,220, 0,130, 0,182, -255,220, 0,130, 0,183,255,220, 0,130, 0,184,255,220, 0,130, 0,191,255,117, 0,130, 0,193,255,117, 0,130, 0,194, 0, 57, - 0,130, 0,196, 0, 57, 0,130, 0,198, 0, 57, 0,130, 0,200,255,220, 0,130, 0,201,255,220, 0,130, 0,202,255,220, 0,130, - 0,204,255,220, 0,130, 0,205,255,220, 0,130, 0,206,255,220, 0,130, 0,207,255,220, 0,130, 0,209,255,220, 0,130, 0,213, -255,220, 0,130, 0,215,255,220, 0,130, 0,217,255,220, 0,130, 0,219,255,220, 0,130, 0,221,255,220, 0,130, 0,222,255,220, - 0,130, 0,224,255,220, 0,130, 0,226,255,220, 0,130, 1, 14,255,220, 0,130, 1, 15,255,220, 0,130, 1, 16,255,220, 0,130, - 1, 17,255,220, 0,130, 1, 18,255,220, 0,130, 1, 19,255,220, 0,130, 1, 36,255, 97, 0,130, 1, 37,255,220, 0,130, 1, 38, -255, 97, 0,130, 1, 39,255,220, 0,130, 1, 54,255,144, 0,130, 1, 55,255,173, 0,130, 1, 56,255, 97, 0,130, 1, 57,255,117, - 0,130, 1, 58,255, 97, 0,130, 1,240,255,220, 0,130, 1,241,255,220, 0,130, 4,252,255,144, 0,130, 4,255,255,173, 0,130, - 5, 0,255,144, 0,130, 5, 1,255,173, 0,130, 5,106,255, 97, 0,130, 5,107,255,117, 0,130, 5,145,254,248, 0,130, 5,146, -255, 3, 0,130, 5,147, 0, 47, 0,131, 0, 16,255,211, 0,131, 0, 17,255,220, 0,131, 0, 29,255,220, 0,131, 0, 36, 0, 57, - 0,131, 0, 38,255,220, 0,131, 0, 42,255,220, 0,131, 0, 50,255,220, 0,131, 0, 52,255,220, 0,131, 0, 55,255, 97, 0,131, - 0, 57,255,125, 0,131, 0, 58,255,144, 0,131, 0, 60,255, 97, 0,131, 0, 70,255,220, 0,131, 0, 71,255,220, 0,131, 0, 72, -255,220, 0,131, 0, 73,255,183, 0,131, 0, 82,255,220, 0,131, 0, 84,255,220, 0,131, 0, 87,255,220, 0,131, 0, 89,255,136, - 0,131, 0, 90,255,173, 0,131, 0, 92,255,117, 0,131, 0,109,255,183, 0,131, 0,130, 0, 57, 0,131, 0,131, 0, 57, 0,131, - 0,132, 0, 57, 0,131, 0,133, 0, 57, 0,131, 0,134, 0, 57, 0,131, 0,137,255,220, 0,131, 0,148,255,220, 0,131, 0,149, -255,220, 0,131, 0,150,255,220, 0,131, 0,151,255,220, 0,131, 0,152,255,220, 0,131, 0,159,255, 97, 0,131, 0,169,255,220, - 0,131, 0,170,255,220, 0,131, 0,171,255,220, 0,131, 0,172,255,220, 0,131, 0,173,255,220, 0,131, 0,180,255,220, 0,131, - 0,181,255,220, 0,131, 0,182,255,220, 0,131, 0,183,255,220, 0,131, 0,184,255,220, 0,131, 0,191,255,117, 0,131, 0,193, -255,117, 0,131, 0,194, 0, 57, 0,131, 0,196, 0, 57, 0,131, 0,198, 0, 57, 0,131, 0,200,255,220, 0,131, 0,201,255,220, - 0,131, 0,202,255,220, 0,131, 0,204,255,220, 0,131, 0,205,255,220, 0,131, 0,206,255,220, 0,131, 0,207,255,220, 0,131, - 0,209,255,220, 0,131, 0,213,255,220, 0,131, 0,215,255,220, 0,131, 0,217,255,220, 0,131, 0,219,255,220, 0,131, 0,221, -255,220, 0,131, 0,222,255,220, 0,131, 0,224,255,220, 0,131, 0,226,255,220, 0,131, 1, 14,255,220, 0,131, 1, 15,255,220, - 0,131, 1, 16,255,220, 0,131, 1, 17,255,220, 0,131, 1, 18,255,220, 0,131, 1, 19,255,220, 0,131, 1, 36,255, 97, 0,131, - 1, 37,255,220, 0,131, 1, 38,255, 97, 0,131, 1, 39,255,220, 0,131, 1, 54,255,144, 0,131, 1, 55,255,173, 0,131, 1, 56, -255, 97, 0,131, 1, 57,255,117, 0,131, 1, 58,255, 97, 0,131, 1,240,255,220, 0,131, 1,241,255,220, 0,131, 4,252,255,144, - 0,131, 4,254,255,144, 0,131, 4,255,255,173, 0,131, 5, 0,255,144, 0,131, 5, 1,255,173, 0,131, 5,106,255, 97, 0,131, - 5,107,255,117, 0,131, 5,145,254,248, 0,131, 5,146,255, 3, 0,131, 5,147, 0, 47, 0,132, 0, 16,255,211, 0,132, 0, 17, -255,220, 0,132, 0, 29,255,220, 0,132, 0, 36, 0, 57, 0,132, 0, 38,255,220, 0,132, 0, 42,255,220, 0,132, 0, 50,255,220, - 0,132, 0, 52,255,220, 0,132, 0, 55,255, 97, 0,132, 0, 57,255,125, 0,132, 0, 58,255,144, 0,132, 0, 60,255, 97, 0,132, - 0, 70,255,220, 0,132, 0, 71,255,220, 0,132, 0, 72,255,220, 0,132, 0, 73,255,183, 0,132, 0, 82,255,220, 0,132, 0, 84, -255,220, 0,132, 0, 87,255,220, 0,132, 0, 89,255,136, 0,132, 0, 90,255,173, 0,132, 0, 92,255,117, 0,132, 0,109,255,183, - 0,132, 0,130, 0, 57, 0,132, 0,131, 0, 57, 0,132, 0,132, 0, 57, 0,132, 0,133, 0, 57, 0,132, 0,134, 0, 57, 0,132, - 0,137,255,220, 0,132, 0,148,255,220, 0,132, 0,149,255,220, 0,132, 0,150,255,220, 0,132, 0,151,255,220, 0,132, 0,152, -255,220, 0,132, 0,159,255, 97, 0,132, 0,169,255,220, 0,132, 0,170,255,220, 0,132, 0,171,255,220, 0,132, 0,172,255,220, - 0,132, 0,173,255,220, 0,132, 0,180,255,220, 0,132, 0,181,255,220, 0,132, 0,182,255,220, 0,132, 0,183,255,220, 0,132, - 0,184,255,220, 0,132, 0,191,255,117, 0,132, 0,193,255,117, 0,132, 0,194, 0, 57, 0,132, 0,196, 0, 57, 0,132, 0,198, - 0, 57, 0,132, 0,200,255,220, 0,132, 0,201,255,220, 0,132, 0,202,255,220, 0,132, 0,204,255,220, 0,132, 0,205,255,220, - 0,132, 0,206,255,220, 0,132, 0,207,255,220, 0,132, 0,209,255,220, 0,132, 0,213,255,220, 0,132, 0,215,255,220, 0,132, - 0,217,255,220, 0,132, 0,219,255,220, 0,132, 0,221,255,220, 0,132, 0,222,255,220, 0,132, 0,224,255,220, 0,132, 0,226, -255,220, 0,132, 1, 14,255,220, 0,132, 1, 15,255,220, 0,132, 1, 16,255,220, 0,132, 1, 17,255,220, 0,132, 1, 18,255,220, - 0,132, 1, 19,255,220, 0,132, 1, 36,255, 97, 0,132, 1, 37,255,220, 0,132, 1, 38,255, 97, 0,132, 1, 39,255,220, 0,132, - 1, 54,255,144, 0,132, 1, 55,255,173, 0,132, 1, 56,255, 97, 0,132, 1, 57,255,117, 0,132, 1, 58,255, 97, 0,132, 1,240, -255,220, 0,132, 1,241,255,220, 0,132, 4,252,255,144, 0,132, 4,254,255,144, 0,132, 4,255,255,173, 0,132, 5, 0,255,144, - 0,132, 5, 1,255,173, 0,132, 5,106,255, 97, 0,132, 5,107,255,117, 0,132, 5,145,254,248, 0,132, 5,146,255, 3, 0,132, - 5,147, 0, 47, 0,133, 0, 16,255,211, 0,133, 0, 17,255,220, 0,133, 0, 29,255,220, 0,133, 0, 36, 0, 57, 0,133, 0, 38, -255,220, 0,133, 0, 42,255,220, 0,133, 0, 50,255,220, 0,133, 0, 52,255,220, 0,133, 0, 55,255, 97, 0,133, 0, 57,255,125, - 0,133, 0, 58,255,144, 0,133, 0, 60,255, 97, 0,133, 0, 70,255,220, 0,133, 0, 71,255,220, 0,133, 0, 72,255,220, 0,133, - 0, 73,255,183, 0,133, 0, 82,255,220, 0,133, 0, 84,255,220, 0,133, 0, 87,255,220, 0,133, 0, 89,255,136, 0,133, 0, 90, -255,173, 0,133, 0, 92,255,117, 0,133, 0,109,255,183, 0,133, 0,130, 0, 57, 0,133, 0,131, 0, 57, 0,133, 0,132, 0, 57, - 0,133, 0,133, 0, 57, 0,133, 0,134, 0, 57, 0,133, 0,137,255,220, 0,133, 0,148,255,220, 0,133, 0,149,255,220, 0,133, - 0,150,255,220, 0,133, 0,151,255,220, 0,133, 0,152,255,220, 0,133, 0,159,255, 97, 0,133, 0,169,255,220, 0,133, 0,170, -255,220, 0,133, 0,171,255,220, 0,133, 0,172,255,220, 0,133, 0,173,255,220, 0,133, 0,180,255,220, 0,133, 0,181,255,220, - 0,133, 0,182,255,220, 0,133, 0,183,255,220, 0,133, 0,184,255,220, 0,133, 0,191,255,117, 0,133, 0,193,255,117, 0,133, - 0,194, 0, 57, 0,133, 0,196, 0, 57, 0,133, 0,198, 0, 57, 0,133, 0,200,255,220, 0,133, 0,201,255,220, 0,133, 0,202, -255,220, 0,133, 0,204,255,220, 0,133, 0,205,255,220, 0,133, 0,206,255,220, 0,133, 0,207,255,220, 0,133, 0,209,255,220, - 0,133, 0,213,255,220, 0,133, 0,215,255,220, 0,133, 0,217,255,220, 0,133, 0,219,255,220, 0,133, 0,221,255,220, 0,133, - 0,222,255,220, 0,133, 0,224,255,220, 0,133, 0,226,255,220, 0,133, 1, 14,255,220, 0,133, 1, 15,255,220, 0,133, 1, 16, -255,220, 0,133, 1, 17,255,220, 0,133, 1, 18,255,220, 0,133, 1, 19,255,220, 0,133, 1, 36,255, 97, 0,133, 1, 37,255,220, - 0,133, 1, 38,255, 97, 0,133, 1, 39,255,220, 0,133, 1, 54,255,144, 0,133, 1, 55,255,173, 0,133, 1, 56,255, 97, 0,133, - 1, 57,255,117, 0,133, 1, 58,255, 97, 0,133, 1,240,255,220, 0,133, 4,252,255,144, 0,133, 4,254,255,144, 0,133, 4,255, -255,173, 0,133, 5, 0,255,144, 0,133, 5, 1,255,173, 0,133, 5,106,255, 97, 0,133, 5,107,255,117, 0,133, 5,145,254,248, - 0,133, 5,146,255, 3, 0,133, 5,147, 0, 47, 0,134, 0, 16,255,211, 0,134, 0, 17,255,220, 0,134, 0, 29,255,220, 0,134, - 0, 36, 0, 57, 0,134, 0, 38,255,220, 0,134, 0, 42,255,220, 0,134, 0, 50,255,220, 0,134, 0, 52,255,220, 0,134, 0, 55, -255, 97, 0,134, 0, 57,255,125, 0,134, 0, 58,255,144, 0,134, 0, 60,255, 97, 0,134, 0, 70,255,220, 0,134, 0, 71,255,220, - 0,134, 0, 72,255,220, 0,134, 0, 73,255,183, 0,134, 0, 82,255,220, 0,134, 0, 84,255,220, 0,134, 0, 87,255,220, 0,134, - 0, 89,255,136, 0,134, 0, 90,255,173, 0,134, 0, 92,255,117, 0,134, 0,109,255,183, 0,134, 0,130, 0, 57, 0,134, 0,131, - 0, 57, 0,134, 0,132, 0, 57, 0,134, 0,133, 0, 57, 0,134, 0,134, 0, 57, 0,134, 0,137,255,220, 0,134, 0,148,255,220, - 0,134, 0,149,255,220, 0,134, 0,150,255,220, 0,134, 0,151,255,220, 0,134, 0,152,255,220, 0,134, 0,159,255, 97, 0,134, - 0,169,255,220, 0,134, 0,170,255,220, 0,134, 0,171,255,220, 0,134, 0,172,255,220, 0,134, 0,173,255,220, 0,134, 0,180, -255,220, 0,134, 0,181,255,220, 0,134, 0,182,255,220, 0,134, 0,183,255,220, 0,134, 0,184,255,220, 0,134, 0,191,255,117, - 0,134, 0,193,255,117, 0,134, 0,194, 0, 57, 0,134, 0,196, 0, 57, 0,134, 0,198, 0, 57, 0,134, 0,200,255,220, 0,134, - 0,201,255,220, 0,134, 0,202,255,220, 0,134, 0,204,255,220, 0,134, 0,205,255,220, 0,134, 0,206,255,220, 0,134, 0,207, -255,220, 0,134, 0,209,255,220, 0,134, 0,213,255,220, 0,134, 0,215,255,220, 0,134, 0,217,255,220, 0,134, 0,219,255,220, - 0,134, 0,221,255,220, 0,134, 0,222,255,220, 0,134, 0,224,255,220, 0,134, 0,226,255,220, 0,134, 1, 14,255,220, 0,134, - 1, 15,255,220, 0,134, 1, 16,255,220, 0,134, 1, 17,255,220, 0,134, 1, 18,255,220, 0,134, 1, 19,255,220, 0,134, 1, 36, -255, 97, 0,134, 1, 37,255,220, 0,134, 1, 38,255, 97, 0,134, 1, 39,255,220, 0,134, 1, 54,255,144, 0,134, 1, 55,255,173, - 0,134, 1, 56,255, 97, 0,134, 1, 57,255,117, 0,134, 1, 58,255, 97, 0,134, 1,240,255,220, 0,134, 1,241,255,220, 0,134, - 4,252,255,144, 0,134, 4,254,255,144, 0,134, 4,255,255,173, 0,134, 5, 0,255,144, 0,134, 5, 1,255,173, 0,134, 5,106, -255, 97, 0,134, 5,107,255,117, 0,134, 5,145,254,248, 0,134, 5,146,255, 3, 0,134, 5,147, 0, 47, 0,136, 5,145,255,173, - 0,136, 5,146,255,164, 0,136, 5,147,255,144, 0,137, 0, 60,255,220, 0,137, 0,109,255,220, 0,137, 0,125,255,220, 0,137, - 0,159,255,220, 0,137, 1, 58,255,220, 0,137, 5,146, 0, 38, 0,146, 0, 36,255,220, 0,146, 0, 57,255,220, 0,146, 0, 60, -255,144, 0,146, 0,109,255,220, 0,146, 0,125,255,220, 0,146, 0,130,255,220, 0,146, 0,131,255,220, 0,146, 0,132,255,220, - 0,146, 0,133,255,220, 0,146, 0,134,255,220, 0,146, 0,159,255,144, 0,146, 0,194,255,220, 0,146, 0,196,255,220, 0,146, - 0,198,255,220, 0,146, 1, 56,255,144, 0,146, 1, 58,255,144, 0,146, 1,244,255,144, 0,146, 5,106,255,144, 0,146, 5,145, -255,211, 0,146, 5,146,255,201, 0,146, 5,147,255, 68, 0,148, 0, 16, 0, 57, 0,148, 0, 17,255,173, 0,148, 0, 29,255,220, - 0,148, 0, 36,255,220, 0,148, 0, 57,255,220, 0,148, 0, 59,255,125, 0,148, 0, 60,255,144, 0,148, 0,109,255,220, 0,148, - 0,130,255,220, 0,148, 0,131,255,220, 0,148, 0,132,255,220, 0,148, 0,133,255,220, 0,148, 0,134,255,220, 0,148, 0,159, -255,144, 0,148, 1, 58,255,144, 0,148, 5,145,255,211, 0,148, 5,146,255,220, 0,148, 5,147,255, 68, 0,149, 0, 16, 0, 57, - 0,149, 0, 17,255,173, 0,149, 0, 29,255,220, 0,149, 0, 36,255,220, 0,149, 0, 57,255,220, 0,149, 0, 59,255,125, 0,149, - 0, 60,255,144, 0,149, 0,109,255,220, 0,149, 0,130,255,220, 0,149, 0,131,255,220, 0,149, 0,132,255,220, 0,149, 0,133, -255,220, 0,149, 0,134,255,220, 0,149, 0,159,255,144, 0,149, 1, 58,255,144, 0,149, 5,145,255,211, 0,149, 5,146,255,220, - 0,149, 5,147,255, 68, 0,150, 0, 16, 0, 57, 0,150, 0, 17,255,173, 0,150, 0, 29,255,220, 0,150, 0, 36,255,220, 0,150, - 0, 57,255,220, 0,150, 0, 59,255,125, 0,150, 0, 60,255,144, 0,150, 0,109,255,220, 0,150, 0,130,255,220, 0,150, 0,131, -255,220, 0,150, 0,132,255,220, 0,150, 0,133,255,220, 0,150, 0,134,255,220, 0,150, 0,159,255,144, 0,150, 1, 58,255,144, - 0,150, 5,145,255,211, 0,150, 5,146,255,220, 0,150, 5,147,255, 68, 0,151, 0, 16, 0, 57, 0,151, 0, 17,255,173, 0,151, - 0, 29,255,220, 0,151, 0, 36,255,220, 0,151, 0, 57,255,220, 0,151, 0, 59,255,125, 0,151, 0, 60,255,144, 0,151, 0,109, -255,220, 0,151, 0,130,255,220, 0,151, 0,131,255,220, 0,151, 0,132,255,220, 0,151, 0,133,255,220, 0,151, 0,134,255,220, - 0,151, 0,159,255,144, 0,151, 1, 58,255,144, 0,151, 5,145,255,211, 0,151, 5,146,255,220, 0,151, 5,147,255, 68, 0,152, - 0, 16, 0, 57, 0,152, 0, 17,255,173, 0,152, 0, 29,255,220, 0,152, 0, 36,255,220, 0,152, 0, 57,255,220, 0,152, 0, 59, -255,125, 0,152, 0, 60,255,144, 0,152, 0,109,255,220, 0,152, 0,130,255,220, 0,152, 0,131,255,220, 0,152, 0,132,255,220, - 0,152, 0,133,255,220, 0,152, 0,134,255,220, 0,152, 0,159,255,144, 0,152, 1, 58,255,144, 0,152, 5,145,255,211, 0,152, - 5,146,255,220, 0,152, 5,147,255, 68, 0,155, 0, 61,255,220, 0,155, 1, 63,255,220, 0,156, 0, 61,255,220, 0,156, 1, 63, -255,220, 0,157, 0, 61,255,220, 0,157, 1, 63,255,220, 0,158, 0, 61,255,220, 0,158, 1, 63,255,220, 0,159, 0, 16,255, 13, - 0,159, 0, 17,254, 97, 0,159, 0, 29,254,240, 0,159, 0, 36,255, 97, 0,159, 0, 38,255,144, 0,159, 0, 50,255,144, 0,159, - 0, 68,254,230, 0,159, 0, 72,254,240, 0,159, 0, 76,255,183, 0,159, 0, 82,254,240, 0,159, 0, 88,255, 21, 0,159, 0,109, -255, 31, 0,159, 0,125,255,107, 0,159, 0,130,255, 97, 0,159, 0,131,255, 97, 0,159, 0,132,255, 97, 0,159, 0,133,255, 97, - 0,159, 0,134,255, 97, 0,159, 0,137,255,144, 0,159, 0,148,255,144, 0,159, 0,149,255,144, 0,159, 0,150,255,144, 0,159, - 0,151,255,144, 0,159, 0,152,255,144, 0,159, 0,162,254,230, 0,159, 0,163,254,230, 0,159, 0,164,254,230, 0,159, 0,165, -254,230, 0,159, 0,166,254,230, 0,159, 0,167,254,230, 0,159, 0,170,254,240, 0,159, 0,171,254,240, 0,159, 0,172,254,240, - 0,159, 0,173,254,240, 0,159, 0,180,254,240, 0,159, 0,181,254,240, 0,159, 0,182,254,240, 0,159, 0,183,254,240, 0,159, - 0,184,254,240, 0,159, 0,187,255, 21, 0,159, 0,188,255, 21, 0,159, 0,189,255, 21, 0,159, 0,190,255, 21, 0,159, 0,200, -255,144, 0,159, 0,206,255,144, 0,159, 0,221,254,240, 0,159, 1, 49,255, 21, 0,159, 5,145,255,144, 0,159, 5,146,255,220, - 0,159, 5,147,254,248, 0,160, 0, 17,255,107, 0,160, 0, 29,255,183, 0,160, 5,145,255,220, 0,160, 5,147,255, 68, 0,161, - 0, 16, 0, 38, 0,161, 5,145,255,144, 0,161, 5,146,255,144, 0,161, 5,147,255,173, 0,170, 0, 91,255,220, 0,171, 0, 91, -255,220, 0,172, 0, 91,255,220, 0,173, 0, 91,255,220, 0,178, 5,145,255,164, 0,178, 5,146,255,144, 0,178, 5,147,255,183, - 0,179, 5,145,255,107, 0,179, 5,146,255,144, 0,179, 5,147,255,164, 0,180, 0, 16, 0, 38, 0,180, 0, 17,255,220, 0,180, - 0, 91,255,193, 0,180, 5,145,255,107, 0,180, 5,146,255,183, 0,180, 5,147,255,125, 0,181, 0, 16, 0, 38, 0,181, 0, 17, -255,220, 0,181, 0, 91,255,193, 0,181, 5,145,255,107, 0,181, 5,146,255,183, 0,181, 5,147,255,125, 0,182, 0, 16, 0, 38, - 0,182, 0, 17,255,220, 0,182, 0, 91,255,193, 0,182, 5,145,255,107, 0,182, 5,146,255,183, 0,182, 5,147,255,125, 0,183, - 0, 16, 0, 38, 0,183, 0, 17,255,220, 0,183, 0, 91,255,193, 0,183, 5,145,255,107, 0,183, 5,146,255,183, 0,183, 5,147, -255,125, 0,184, 0, 16, 0, 38, 0,184, 0, 17,255,220, 0,184, 0, 91,255,193, 0,184, 5,145,255,107, 0,184, 5,146,255,183, - 0,184, 5,147,255,125, 0,191, 0, 16,255,220, 0,191, 0, 17,254,220, 0,191, 0, 29,255,107, 0,191, 0,109,255,220, 0,191, - 0,125,255,220, 0,191, 5,147,254,211, 0,193, 0, 16,255,220, 0,193, 0, 17,254,220, 0,193, 0, 29,255,107, 0,193, 0,109, -255,220, 0,193, 0,125,255,220, 0,193, 5,147,254,211, 0,194, 0, 16,255,211, 0,194, 0, 17,255,220, 0,194, 0, 29,255,220, - 0,194, 0, 36, 0, 57, 0,194, 0, 38,255,220, 0,194, 0, 42,255,220, 0,194, 0, 50,255,220, 0,194, 0, 52,255,220, 0,194, - 0, 55,255, 97, 0,194, 0, 57,255,125, 0,194, 0, 58,255,144, 0,194, 0, 60,255, 97, 0,194, 0, 70,255,220, 0,194, 0, 71, -255,220, 0,194, 0, 72,255,220, 0,194, 0, 73,255,183, 0,194, 0, 82,255,220, 0,194, 0, 84,255,220, 0,194, 0, 87,255,220, - 0,194, 0, 89,255,136, 0,194, 0, 90,255,173, 0,194, 0, 92,255,117, 0,194, 0,109,255,183, 0,194, 0,130, 0, 57, 0,194, - 0,131, 0, 57, 0,194, 0,132, 0, 57, 0,194, 0,133, 0, 57, 0,194, 0,134, 0, 57, 0,194, 0,148,255,220, 0,194, 0,149, -255,220, 0,194, 0,150,255,220, 0,194, 0,151,255,220, 0,194, 0,152,255,220, 0,194, 0,159,255, 97, 0,194, 0,169,255,220, - 0,194, 0,170,255,220, 0,194, 0,171,255,220, 0,194, 0,172,255,220, 0,194, 0,173,255,220, 0,194, 0,180,255,220, 0,194, - 0,181,255,220, 0,194, 0,182,255,220, 0,194, 0,183,255,220, 0,194, 0,184,255,220, 0,194, 0,191,255,117, 0,194, 0,193, -255,117, 0,194, 0,194, 0, 57, 0,194, 0,196, 0, 57, 0,194, 0,198, 0, 57, 0,194, 0,200,255,220, 0,194, 0,202,255,220, - 0,194, 0,204,255,220, 0,194, 0,205,255,220, 0,194, 0,206,255,220, 0,194, 0,209,255,220, 0,194, 0,211,255,220, 0,194, - 0,213,255,220, 0,194, 0,215,255,220, 0,194, 0,217,255,220, 0,194, 0,219,255,220, 0,194, 0,221,255,220, 0,194, 0,222, -255,220, 0,194, 0,226,255,220, 0,194, 1, 14,255,220, 0,194, 1, 15,255,220, 0,194, 1, 16,255,220, 0,194, 1, 17,255,220, - 0,194, 1, 18,255,220, 0,194, 1, 19,255,220, 0,194, 1, 36,255, 97, 0,194, 1, 37,255,220, 0,194, 1, 38,255, 97, 0,194, - 1, 39,255,220, 0,194, 1, 54,255,144, 0,194, 1, 55,255,173, 0,194, 1, 56,255, 97, 0,194, 1, 57,255,117, 0,194, 1, 58, -255, 97, 0,194, 1,240,255,220, 0,194, 1,241,255,220, 0,194, 4,252,255,144, 0,194, 4,254,255,144, 0,194, 4,255,255,173, - 0,194, 5, 0,255,144, 0,194, 5, 1,255,173, 0,194, 5,106,255, 97, 0,194, 5,107,255,117, 0,194, 5,145,254,248, 0,194, - 5,146,255, 2, 0,194, 5,147, 0, 47, 0,196, 0, 16,255,211, 0,196, 0, 17,255,220, 0,196, 0, 29,255,220, 0,196, 0, 36, - 0, 57, 0,196, 0, 38,255,220, 0,196, 0, 42,255,220, 0,196, 0, 50,255,220, 0,196, 0, 52,255,220, 0,196, 0, 55,255, 97, - 0,196, 0, 57,255,125, 0,196, 0, 58,255,144, 0,196, 0, 60,255, 97, 0,196, 0, 70,255,220, 0,196, 0, 71,255,220, 0,196, - 0, 72,255,220, 0,196, 0, 73,255,183, 0,196, 0, 82,255,220, 0,196, 0, 84,255,220, 0,196, 0, 87,255,220, 0,196, 0, 89, -255,136, 0,196, 0, 90,255,173, 0,196, 0, 92,255,117, 0,196, 0,109,255,183, 0,196, 0,130, 0, 57, 0,196, 0,131, 0, 57, - 0,196, 0,132, 0, 57, 0,196, 0,133, 0, 57, 0,196, 0,134, 0, 57, 0,196, 0,148,255,220, 0,196, 0,149,255,220, 0,196, - 0,150,255,220, 0,196, 0,151,255,220, 0,196, 0,152,255,220, 0,196, 0,159,255, 97, 0,196, 0,169,255,220, 0,196, 0,170, -255,220, 0,196, 0,171,255,220, 0,196, 0,172,255,220, 0,196, 0,173,255,220, 0,196, 0,180,255,220, 0,196, 0,181,255,220, - 0,196, 0,182,255,220, 0,196, 0,183,255,220, 0,196, 0,184,255,220, 0,196, 0,191,255,117, 0,196, 0,193,255,117, 0,196, - 0,194, 0, 57, 0,196, 0,196, 0, 57, 0,196, 0,198, 0, 57, 0,196, 0,200,255,220, 0,196, 0,202,255,220, 0,196, 0,204, -255,220, 0,196, 0,205,255,220, 0,196, 0,206,255,220, 0,196, 0,209,255,220, 0,196, 0,211,255,220, 0,196, 0,213,255,220, - 0,196, 0,215,255,220, 0,196, 0,217,255,220, 0,196, 0,219,255,220, 0,196, 0,221,255,220, 0,196, 0,222,255,220, 0,196, - 0,226,255,220, 0,196, 1, 14,255,220, 0,196, 1, 15,255,220, 0,196, 1, 16,255,220, 0,196, 1, 17,255,220, 0,196, 1, 18, -255,220, 0,196, 1, 19,255,220, 0,196, 1, 36,255, 97, 0,196, 1, 37,255,220, 0,196, 1, 38,255, 97, 0,196, 1, 39,255,220, - 0,196, 1, 54,255,144, 0,196, 1, 55,255,173, 0,196, 1, 56,255, 97, 0,196, 1, 57,255,117, 0,196, 1, 58,255, 97, 0,196, - 1,240,255,220, 0,196, 1,241,255,220, 0,196, 4,252,255,144, 0,196, 4,254,255,144, 0,196, 4,255,255,173, 0,196, 5, 0, -255,144, 0,196, 5, 1,255,173, 0,196, 5,106,255, 97, 0,196, 5,107,255,117, 0,196, 5,145,254,248, 0,196, 5,146,255, 2, - 0,196, 5,147, 0, 47, 0,198, 0, 16,255,211, 0,198, 0, 17,255,220, 0,198, 0, 29,255,220, 0,198, 0, 36, 0, 57, 0,198, - 0, 38,255,220, 0,198, 0, 42,255,220, 0,198, 0, 50,255,220, 0,198, 0, 52,255,220, 0,198, 0, 55,255, 97, 0,198, 0, 57, -255,125, 0,198, 0, 58,255,144, 0,198, 0, 60,255, 97, 0,198, 0, 70,255,220, 0,198, 0, 71,255,220, 0,198, 0, 72,255,220, - 0,198, 0, 73,255,183, 0,198, 0, 82,255,220, 0,198, 0, 84,255,220, 0,198, 0, 87,255,220, 0,198, 0, 89,255,136, 0,198, - 0, 90,255,173, 0,198, 0,109,255,183, 0,198, 0,130, 0, 57, 0,198, 0,131, 0, 57, 0,198, 0,132, 0, 57, 0,198, 0,133, - 0, 57, 0,198, 0,134, 0, 57, 0,198, 0,148,255,220, 0,198, 0,149,255,220, 0,198, 0,150,255,220, 0,198, 0,151,255,220, - 0,198, 0,152,255,220, 0,198, 0,159,255, 97, 0,198, 0,169,255,220, 0,198, 0,170,255,220, 0,198, 0,171,255,220, 0,198, - 0,172,255,220, 0,198, 0,173,255,220, 0,198, 0,180,255,220, 0,198, 0,181,255,220, 0,198, 0,182,255,220, 0,198, 0,183, -255,220, 0,198, 0,184,255,220, 0,198, 0,194, 0, 57, 0,198, 0,196, 0, 57, 0,198, 0,198, 0, 57, 0,198, 0,200,255,220, - 0,198, 0,202,255,220, 0,198, 0,204,255,220, 0,198, 0,205,255,220, 0,198, 0,206,255,220, 0,198, 0,209,255,220, 0,198, - 0,211,255,220, 0,198, 0,213,255,220, 0,198, 0,215,255,220, 0,198, 0,217,255,220, 0,198, 0,219,255,220, 0,198, 0,221, -255,220, 0,198, 0,222,255,220, 0,198, 0,226,255,220, 0,198, 1, 14,255,220, 0,198, 1, 15,255,220, 0,198, 1, 16,255,220, - 0,198, 1, 17,255,220, 0,198, 1, 19,255,220, 0,198, 1, 36,255, 97, 0,198, 1, 37,255,220, 0,198, 1, 38,255, 97, 0,198, - 1, 39,255,220, 0,198, 1, 54,255,144, 0,198, 1, 55,255,173, 0,198, 1, 56,255, 97, 0,198, 1, 58,255, 97, 0,198, 1,240, -255,220, 0,198, 1,241,255,220, 0,198, 4,252,255,144, 0,198, 4,254,255,144, 0,198, 4,255,255,173, 0,198, 5, 0,255,144, - 0,198, 5, 1,255,173, 0,198, 5,106,255, 97, 0,198, 5,145,254,248, 0,198, 5,146,255, 2, 0,198, 5,147, 0, 47, 0,200, - 0, 60,255,220, 0,200, 0,109,255,220, 0,200, 0,125,255,220, 0,200, 0,159,255,220, 0,200, 1, 58,255,220, 0,200, 5,146, - 0, 38, 0,206, 0, 60,255,220, 0,206, 0,109,255,220, 0,206, 0,125,255,220, 0,206, 0,159,255,220, 0,206, 1, 58,255,220, - 0,206, 5,146, 0, 38, 0,208, 0, 36,255,220, 0,208, 0, 57,255,220, 0,208, 0, 60,255,144, 0,208, 0,109,255,220, 0,208, - 0,125,255,220, 0,208, 0,130,255,220, 0,208, 0,131,255,220, 0,208, 0,132,255,220, 0,208, 0,133,255,220, 0,208, 0,134, -255,220, 0,208, 0,159,255,144, 0,208, 0,194,255,220, 0,208, 0,196,255,220, 0,208, 0,198,255,220, 0,208, 1, 56,255,144, - 0,208, 1, 58,255,144, 0,208, 1,244,255,144, 0,208, 5,106,255,144, 0,208, 5,145,255,211, 0,208, 5,146,255,201, 0,208, - 5,147,255, 68, 0,210, 0, 36,255,220, 0,210, 0, 57,255,220, 0,210, 0, 60,255,144, 0,210, 0,109,255,220, 0,210, 0,125, -255,220, 0,210, 0,130,255,220, 0,210, 0,131,255,220, 0,210, 0,132,255,220, 0,210, 0,133,255,220, 0,210, 0,134,255,220, - 0,210, 0,159,255,144, 0,210, 1, 58,255,144, 0,210, 5,145,255,211, 0,210, 5,146,255,201, 0,210, 5,147,255, 68, 0,221, - 0, 91,255,220, 0,224, 0, 55,255,183, 0,224, 0, 60,255,154, 0,224, 0,109,255,220, 0,224, 0,125,255,220, 0,224, 0,159, -255,154, 0,224, 1, 38,255,183, 0,224, 1, 58,255,154, 0,224, 5,145,255,211, 0,224, 5,146,255,211, 0,224, 5,147,255,201, - 0,251, 0, 16,255,220, 0,251, 0, 36, 0, 47, 0,251, 0, 50,255,183, 0,251, 0, 55,254,230, 0,251, 0, 56,255,154, 0,251, - 0, 57,255, 31, 0,251, 0, 58,255, 68, 0,251, 0, 60,254,240, 0,251, 0, 72,255,220, 0,251, 0, 82,255,220, 0,251, 0, 88, -255,220, 0,251, 0, 92,255, 68, 0,251, 0,130, 0, 47, 0,251, 0,131, 0, 47, 0,251, 0,132, 0, 47, 0,251, 0,133, 0, 47, - 0,251, 0,134, 0, 47, 0,251, 0,148,255,183, 0,251, 0,149,255,183, 0,251, 0,150,255,183, 0,251, 0,151,255,183, 0,251, - 0,152,255,183, 0,251, 0,155,255,154, 0,251, 0,156,255,154, 0,251, 0,157,255,154, 0,251, 0,158,255,154, 0,251, 0,159, -254,240, 0,251, 0,170,255,220, 0,251, 0,171,255,220, 0,251, 0,172,255,220, 0,251, 0,173,255,220, 0,251, 0,180,255,220, - 0,251, 0,181,255,220, 0,251, 0,182,255,220, 0,251, 0,183,255,220, 0,251, 0,184,255,220, 0,251, 0,187,255,220, 0,251, - 0,188,255,220, 0,251, 0,189,255,220, 0,251, 0,190,255,220, 0,251, 0,191,255, 68, 0,251, 0,193,255, 68, 0,251, 0,221, -255,220, 0,251, 1, 38,254,230, 0,251, 1, 48,255,154, 0,251, 1, 49,255,220, 0,251, 1, 58,254,240, 0,251, 5,145,254, 97, - 0,251, 5,146,253,230, 0,255, 0, 16,255,220, 0,255, 0, 36, 0, 47, 0,255, 0, 50,255,183, 0,255, 0, 55,254,230, 0,255, - 0, 56,255,154, 0,255, 0, 57,255, 31, 0,255, 0, 58,255, 68, 0,255, 0, 60,254,240, 0,255, 0, 72,255,220, 0,255, 0, 82, -255,220, 0,255, 0, 88,255,220, 0,255, 0, 92,255, 68, 0,255, 0,130, 0, 47, 0,255, 0,131, 0, 47, 0,255, 0,132, 0, 47, - 0,255, 0,133, 0, 47, 0,255, 0,134, 0, 47, 0,255, 0,148,255,183, 0,255, 0,149,255,183, 0,255, 0,150,255,183, 0,255, - 0,151,255,183, 0,255, 0,152,255,183, 0,255, 0,155,255,154, 0,255, 0,156,255,154, 0,255, 0,157,255,154, 0,255, 0,158, -255,154, 0,255, 0,159,254,240, 0,255, 0,170,255,220, 0,255, 0,171,255,220, 0,255, 0,172,255,220, 0,255, 0,173,255,220, - 0,255, 0,180,255,220, 0,255, 0,181,255,220, 0,255, 0,182,255,220, 0,255, 0,183,255,220, 0,255, 0,184,255,220, 0,255, - 0,187,255,220, 0,255, 0,188,255,220, 0,255, 0,189,255,220, 0,255, 0,190,255,220, 0,255, 0,191,255, 68, 0,255, 0,193, -255, 68, 0,255, 0,221,255,220, 0,255, 1, 38,254,230, 0,255, 1, 48,255,154, 0,255, 1, 49,255,220, 0,255, 1, 58,254,240, - 0,255, 5,145,254, 97, 0,255, 5,146,253,230, 1, 2, 0, 79,255, 63, 1, 10, 5,145,255,107, 1, 10, 5,146,255,144, 1, 10, - 5,147,255,164, 1, 22, 0, 16,255,173, 1, 22, 0, 17,255,183, 1, 22, 0, 29,255,193, 1, 22, 0, 36,255,173, 1, 22, 0, 38, -255,154, 1, 22, 0, 55,255,107, 1, 22, 0, 57,255,144, 1, 22, 0, 58,255,173, 1, 22, 0, 60,255,125, 1, 22, 0, 68,255,211, - 1, 22, 0, 72,255,164, 1, 22, 0, 82,255,164, 1, 22, 0, 88,255,164, 1, 22, 0, 92,255,144, 1, 22, 0,109,255,144, 1, 22, - 0,125,255,220, 1, 22, 0,130,255,173, 1, 22, 0,131,255,173, 1, 22, 0,132,255,173, 1, 22, 0,133,255,173, 1, 22, 0,134, -255,173, 1, 22, 0,137,255,154, 1, 22, 0,159,255,125, 1, 22, 0,162,255,211, 1, 22, 0,163,255,211, 1, 22, 0,164,255,211, - 1, 22, 0,165,255,211, 1, 22, 0,166,255,211, 1, 22, 0,167,255,211, 1, 22, 0,170,255,164, 1, 22, 0,171,255,164, 1, 22, - 0,172,255,164, 1, 22, 0,173,255,164, 1, 22, 0,180,255,164, 1, 22, 0,181,255,164, 1, 22, 0,182,255,164, 1, 22, 0,183, -255,164, 1, 22, 0,184,255,164, 1, 22, 0,187,255,164, 1, 22, 0,188,255,164, 1, 22, 0,189,255,164, 1, 22, 0,190,255,164, - 1, 22, 0,191,255,144, 1, 22, 0,193,255,144, 1, 22, 0,200,255,154, 1, 22, 0,206,255,154, 1, 22, 0,221,255,164, 1, 22, - 1, 38,255,107, 1, 22, 1, 49,255,164, 1, 22, 1, 58,255,125, 1, 22, 5,145,255,107, 1, 22, 5,146,255,125, 1, 22, 5,147, -255,220, 1, 23, 0, 16,255,125, 1, 23, 0, 17,255, 68, 1, 23, 0, 29,255,220, 1, 23, 0, 70,255,211, 1, 23, 0, 71,255,220, - 1, 23, 0, 72,255,211, 1, 23, 0, 74,255,220, 1, 23, 0, 75,255,220, 1, 23, 0, 80,255,220, 1, 23, 0, 81,255,220, 1, 23, - 0, 82,255,211, 1, 23, 0, 84,255,220, 1, 23, 0, 85,255,220, 1, 23, 0, 91,255,201, 1, 23, 0,109,255,183, 1, 23, 0,169, -255,211, 1, 23, 0,170,255,211, 1, 23, 0,171,255,211, 1, 23, 0,172,255,211, 1, 23, 0,173,255,211, 1, 23, 0,179,255,220, - 1, 23, 0,180,255,211, 1, 23, 0,181,255,211, 1, 23, 0,182,255,211, 1, 23, 0,183,255,211, 1, 23, 0,184,255,211, 1, 23, - 0,201,255,211, 1, 23, 0,207,255,211, 1, 23, 0,209, 0, 72, 1, 23, 0,221,255,211, 1, 23, 0,225,255,220, 1, 23, 1, 10, -255,220, 1, 23, 1, 23,255,220, 1, 23, 1, 27,255,220, 1, 23, 5,146, 0, 86, 1, 23, 5,147,254,201, 1, 26, 0, 16,255,173, - 1, 26, 0, 17,255,183, 1, 26, 0, 29,255,193, 1, 26, 0, 36,255,173, 1, 26, 0, 38,255,154, 1, 26, 0, 55,255,107, 1, 26, - 0, 57,255,144, 1, 26, 0, 58,255,173, 1, 26, 0, 60,255,125, 1, 26, 0, 68,255,211, 1, 26, 0, 72,255,164, 1, 26, 0, 82, -255,164, 1, 26, 0, 88,255,164, 1, 26, 0, 92,255,144, 1, 26, 0,109,255,144, 1, 26, 0,125,255,220, 1, 26, 0,130,255,173, - 1, 26, 0,131,255,173, 1, 26, 0,132,255,173, 1, 26, 0,133,255,173, 1, 26, 0,134,255,173, 1, 26, 0,137,255,154, 1, 26, - 0,159,255,125, 1, 26, 0,162,255,211, 1, 26, 0,163,255,211, 1, 26, 0,164,255,211, 1, 26, 0,165,255,211, 1, 26, 0,166, -255,211, 1, 26, 0,167,255,211, 1, 26, 0,170,255,164, 1, 26, 0,171,255,164, 1, 26, 0,172,255,164, 1, 26, 0,173,255,164, - 1, 26, 0,180,255,164, 1, 26, 0,181,255,164, 1, 26, 0,182,255,164, 1, 26, 0,183,255,164, 1, 26, 0,184,255,164, 1, 26, - 0,187,255,164, 1, 26, 0,188,255,164, 1, 26, 0,189,255,164, 1, 26, 0,190,255,164, 1, 26, 0,191,255,144, 1, 26, 0,193, -255,144, 1, 26, 0,200,255,154, 1, 26, 0,206,255,154, 1, 26, 0,221,255,164, 1, 26, 1, 38,255,107, 1, 26, 1, 49,255,164, - 1, 26, 1, 58,255,125, 1, 26, 5,145,255,107, 1, 26, 5,146,255,125, 1, 26, 5,147,255,220, 1, 27, 0, 16,255,125, 1, 27, - 0, 17,255, 68, 1, 27, 0, 29,255,220, 1, 27, 0, 70,255,211, 1, 27, 0, 71,255,220, 1, 27, 0, 72,255,211, 1, 27, 0, 74, -255,220, 1, 27, 0, 75,255,220, 1, 27, 0, 80,255,220, 1, 27, 0, 81,255,220, 1, 27, 0, 82,255,211, 1, 27, 0, 84,255,220, - 1, 27, 0, 85,255,220, 1, 27, 0, 91,255,201, 1, 27, 0,109,255,183, 1, 27, 0,169,255,211, 1, 27, 0,170,255,211, 1, 27, - 0,171,255,211, 1, 27, 0,172,255,211, 1, 27, 0,173,255,211, 1, 27, 0,179,255,220, 1, 27, 0,180,255,211, 1, 27, 0,181, -255,211, 1, 27, 0,182,255,211, 1, 27, 0,183,255,211, 1, 27, 0,184,255,211, 1, 27, 0,201,255,211, 1, 27, 0,207,255,211, - 1, 27, 0,209,255,220, 1, 27, 0,221,255,211, 1, 27, 0,225,255,220, 1, 27, 1, 10,255,220, 1, 27, 1, 23,255,220, 1, 27, - 1, 27,255,220, 1, 27, 5,146, 0, 86, 1, 27, 5,147,254,201, 1, 32, 0, 36, 0, 38, 1, 32, 0,130, 0, 38, 1, 32, 0,131, - 0, 38, 1, 32, 0,132, 0, 38, 1, 32, 0,133, 0, 38, 1, 32, 0,134, 0, 38, 1, 34, 0, 36, 0, 38, 1, 34, 0,130, 0, 38, - 1, 34, 0,131, 0, 38, 1, 34, 0,132, 0, 38, 1, 34, 0,133, 0, 38, 1, 34, 0,134, 0, 38, 1, 38, 0, 16,255, 68, 1, 38, - 0, 17,255, 13, 1, 38, 0, 29,255, 31, 1, 38, 0, 36,255, 97, 1, 38, 0, 38,255,136, 1, 38, 0, 55,255,220, 1, 38, 0, 68, -254,173, 1, 38, 0, 70,254,164, 1, 38, 0, 72,254,164, 1, 38, 0, 76,255,193, 1, 38, 0, 82,254,164, 1, 38, 0, 85,254,211, - 1, 38, 0, 86,254,173, 1, 38, 0, 88,254,201, 1, 38, 0, 90,254,173, 1, 38, 0, 92,254,193, 1, 38, 0,109,255, 68, 1, 38, - 0,125,255,144, 1, 38, 0,130,255, 97, 1, 38, 0,131,255, 97, 1, 38, 0,132,255, 97, 1, 38, 0,133,255, 97, 1, 38, 0,134, -255, 97, 1, 38, 0,137,255,136, 1, 38, 0,162,254,173, 1, 38, 0,163,254,173, 1, 38, 0,164,254,173, 1, 38, 0,165,254,173, - 1, 38, 0,166,254,173, 1, 38, 0,167,254,173, 1, 38, 0,169,254,164, 1, 38, 0,170,254,164, 1, 38, 0,171,254,164, 1, 38, - 0,172,254,164, 1, 38, 0,173,254,164, 1, 38, 0,180,254,164, 1, 38, 0,181,254,164, 1, 38, 0,182,254,164, 1, 38, 0,183, -254,164, 1, 38, 0,184,254,164, 1, 38, 0,187,254,201, 1, 38, 0,188,254,201, 1, 38, 0,189,254,201, 1, 38, 0,190,254,201, - 1, 38, 0,191,254,193, 1, 38, 0,193,254,193, 1, 38, 0,200,255,136, 1, 38, 0,201,254,164, 1, 38, 0,206,255,136, 1, 38, - 0,207,254,164, 1, 38, 0,221,254,164, 1, 38, 1, 23,254,211, 1, 38, 1, 27,254,211, 1, 38, 1, 33,254,173, 1, 38, 1, 35, -254,173, 1, 38, 1, 38,255,220, 1, 38, 1, 49,254,201, 1, 38, 5,146,255,211, 1, 38, 5,147,254,248, 1, 48, 0, 61,255,220, - 1, 48, 1, 63,255,220, 1, 58, 0, 16,255, 13, 1, 58, 0, 17,254, 97, 1, 58, 0, 29,254,240, 1, 58, 0, 36,255, 97, 1, 58, - 0, 38,255,144, 1, 58, 0, 50,255,144, 1, 58, 0, 68,254,230, 1, 58, 0, 72,254,240, 1, 58, 0, 76,255,183, 1, 58, 0, 82, -254,240, 1, 58, 0, 88,255, 21, 1, 58, 0,109,255, 31, 1, 58, 0,125,255,107, 1, 58, 0,130,255, 97, 1, 58, 0,131,255, 97, - 1, 58, 0,132,255, 97, 1, 58, 0,133,255, 97, 1, 58, 0,134,255, 97, 1, 58, 0,137,255,144, 1, 58, 0,148,255,144, 1, 58, - 0,149,255,144, 1, 58, 0,150,255,144, 1, 58, 0,151,255,144, 1, 58, 0,152,255,144, 1, 58, 0,162,254,230, 1, 58, 0,163, -254,230, 1, 58, 0,164,254,230, 1, 58, 0,165,254,230, 1, 58, 0,166,254,230, 1, 58, 0,167,254,230, 1, 58, 0,170,254,240, - 1, 58, 0,171,254,240, 1, 58, 0,172,254,240, 1, 58, 0,173,254,240, 1, 58, 0,180,254,240, 1, 58, 0,181,254,240, 1, 58, - 0,182,254,240, 1, 58, 0,183,254,240, 1, 58, 0,184,254,240, 1, 58, 0,187,255, 21, 1, 58, 0,188,255, 21, 1, 58, 0,189, -255, 21, 1, 58, 0,190,255, 21, 1, 58, 0,200,255,144, 1, 58, 0,206,255,144, 1, 58, 0,221,254,240, 1, 58, 1, 49,255, 21, - 1, 58, 5,145,255,144, 1, 58, 5,146,255,220, 1, 58, 5,147,254,248, 1, 63, 0, 16,255,220, 1, 63, 5,145,255,220, 1, 63, - 5,146,255,220, 1, 63, 5,147,255,220, 5,133, 0, 36,255,211, 5,133, 0, 37,255,183, 5,133, 0, 42, 0, 75, 5,133, 0, 45, - 0,114, 5,133, 0, 50, 0, 57, 5,133, 0, 52, 0, 75, 5,133, 0, 55,255, 68, 5,133, 0, 57,255,136, 5,133, 0, 58,255,173, - 5,133, 0, 59,255,154, 5,133, 0, 60,255, 13, 5,133, 0, 82, 0, 38, 5,133, 0, 89,255,201, 5,133, 0, 92,255,220, 5,133, - 0,130,255,211, 5,133, 0,131,255,211, 5,133, 0,132,255,211, 5,133, 0,133,255,211, 5,133, 0,134,255,211, 5,133, 0,148, - 0, 57, 5,133, 0,149, 0, 57, 5,133, 0,150, 0, 57, 5,133, 0,151, 0, 57, 5,133, 0,152, 0, 57, 5,133, 0,159,255, 13, - 5,133, 0,180, 0, 38, 5,133, 0,181, 0, 38, 5,133, 0,182, 0, 38, 5,133, 0,183, 0, 38, 5,133, 0,184, 0, 38, 5,133, - 0,191,255,220, 5,133, 0,193,255,220, 5,133, 0,224, 0, 75, 5,133, 1, 38,255, 68, 5,133, 1, 58,255, 13, 5,145, 0, 36, -254,248, 5,145, 0, 37,255,193, 5,145, 0, 38,255,183, 5,145, 0, 39,255,193, 5,145, 0, 41,255,193, 5,145, 0, 42,255,183, - 5,145, 0, 43,255,193, 5,145, 0, 45,255,193, 5,145, 0, 46,255,193, 5,145, 0, 47,255,193, 5,145, 0, 50,255,183, 5,145, - 0, 51,255,193, 5,145, 0, 52,255,183, 5,145, 0, 53,255,193, 5,145, 0, 59,255,136, 5,145, 0, 61,255,220, 5,145, 0, 73, -255,183, 5,145, 0, 81,255,144, 5,145, 0, 82,255,107, 5,145, 0, 85,255,144, 5,145, 0, 89,255,183, 5,145, 0, 90,255,183, - 5,145, 0, 92,255,183, 5,145, 0,130,254,248, 5,145, 0,131,254,248, 5,145, 0,132,254,248, 5,145, 0,133,254,248, 5,145, - 0,134,254,248, 5,145, 0,136,254,125, 5,145, 0,137,255,183, 5,145, 0,148,255,183, 5,145, 0,149,255,183, 5,145, 0,150, -255,183, 5,145, 0,151,255,183, 5,145, 0,152,255,183, 5,145, 0,160,255,193, 5,145, 0,161,255,193, 5,145, 0,178,255,183, - 5,145, 0,179,255,144, 5,145, 0,180,255,107, 5,145, 0,181,255,107, 5,145, 0,182,255,107, 5,145, 0,183,255,107, 5,145, - 0,184,255,107, 5,145, 0,191,255,183, 5,145, 0,193,255,183, 5,145, 0,200,255,183, 5,145, 0,206,255,183, 5,145, 0,208, -255,193, 5,145, 0,224,255,183, 5,145, 0,251,255,193, 5,145, 0,255,255,193, 5,145, 1, 10,255,144, 5,145, 1, 22,255,193, - 5,145, 1, 23,255,144, 5,145, 1, 26,255,193, 5,145, 1, 27,255,144, 5,145, 1, 63,255,220, 5,147, 0, 36, 0, 38, 5,147, - 0, 37,255,183, 5,147, 0, 38,255,144, 5,147, 0, 39,255,183, 5,147, 0, 41,255,183, 5,147, 0, 42,255,183, 5,147, 0, 43, -255,183, 5,147, 0, 45, 0, 47, 5,147, 0, 46,255,183, 5,147, 0, 47,255,183, 5,147, 0, 50,255,144, 5,147, 0, 51,255,183, - 5,147, 0, 52,255,144, 5,147, 0, 53,255,183, 5,147, 0, 55,254,230, 5,147, 0, 57,254,136, 5,147, 0, 58,255, 3, 5,147, - 0, 59,255,183, 5,147, 0, 60,254,136, 5,147, 0, 73,255,220, 5,147, 0, 81,255,183, 5,147, 0, 82,255,183, 5,147, 0, 85, -255,183, 5,147, 0, 89,255, 21, 5,147, 0, 90,255, 60, 5,147, 0, 92,255,144, 5,147, 0,130, 0, 38, 5,147, 0,131, 0, 38, - 5,147, 0,132, 0, 38, 5,147, 0,133, 0, 38, 5,147, 0,134, 0, 38, 5,147, 0,136, 0, 38, 5,147, 0,137,255,144, 5,147, - 0,148,255,144, 5,147, 0,149,255,144, 5,147, 0,150,255,144, 5,147, 0,151,255,144, 5,147, 0,152,255,144, 5,147, 0,159, -254,136, 5,147, 0,160,255,183, 5,147, 0,161,255,183, 5,147, 0,178,255,183, 5,147, 0,179,255,183, 5,147, 0,180,255,183, - 5,147, 0,181,255,183, 5,147, 0,182,255,183, 5,147, 0,183,255,183, 5,147, 0,184,255,183, 5,147, 0,191,255,144, 5,147, - 0,193,255,144, 5,147, 0,200,255,144, 5,147, 0,206,255,144, 5,147, 0,208,255,183, 5,147, 0,224,255,183, 5,147, 0,251, -255,183, 5,147, 0,255,255,183, 5,147, 1, 10,255,183, 5,147, 1, 22,255,183, 5,147, 1, 23,255,183, 5,147, 1, 26,255,183, - 5,147, 1, 27,255,183, 5,147, 1, 38,254,230, 5,147, 1, 58,254,136, 0, 0, 0, 0, 0, 61, 2,226, 0, 1, 0, 0, 0, 0, - 0, 0, 0,152, 1, 50, 0, 1, 0, 0, 0, 0, 0, 1, 0, 11, 1,227, 0, 1, 0, 0, 0, 0, 0, 2, 0, 4, 1,249, 0, 1, - 0, 0, 0, 0, 0, 3, 0, 11, 2, 22, 0, 1, 0, 0, 0, 0, 0, 4, 0, 11, 2, 58, 0, 1, 0, 0, 0, 0, 0, 5, 0, 11, - 2, 94, 0, 1, 0, 0, 0, 0, 0, 6, 0, 10, 2,128, 0, 1, 0, 0, 0, 0, 0, 8, 0, 17, 2,175, 0, 1, 0, 0, 0, 0, - 0, 11, 0, 29, 2,253, 0, 1, 0, 0, 0, 0, 0, 13, 18,157, 40, 87, 0, 1, 0, 0, 0, 0, 0, 14, 0, 52, 59, 95, 0, 1, - 0, 0, 0, 0, 1, 0, 0, 24, 59,148, 0, 1, 0, 0, 0, 0, 1, 1, 0, 9, 60, 27, 0, 1, 0, 0, 0, 0, 1, 2, 0, 18, - 60, 76, 0, 1, 0, 0, 0, 0, 1, 3, 0, 9, 60,139, 0, 1, 0, 0, 0, 0, 1, 4, 0, 17, 60,167, 0, 1, 0, 0, 0, 0, - 1, 5, 0, 16, 61, 22, 0, 1, 0, 0, 0, 0, 1, 6, 0, 14, 61,125, 0, 1, 0, 0, 0, 0, 1, 7, 0, 7, 61,207, 0, 1, - 0, 0, 0, 0, 1, 8, 0, 18, 61,245, 0, 1, 0, 0, 0, 1, 1, 0, 0, 24, 59,173, 0, 1, 0, 0, 0, 1, 1, 1, 0, 9, - 60, 37, 0, 1, 0, 0, 0, 1, 1, 2, 0, 23, 60, 95, 0, 1, 0, 0, 0, 1, 1, 3, 0, 9, 60,149, 0, 1, 0, 0, 0, 1, - 1, 4, 0, 31, 60,185, 0, 1, 0, 0, 0, 1, 1, 5, 0, 18, 61, 39, 0, 1, 0, 0, 0, 1, 1, 6, 0, 15, 61,140, 0, 1, - 0, 0, 0, 1, 1, 7, 0, 21, 61,215, 0, 1, 0, 0, 0, 1, 1, 8, 0, 22, 62, 8, 0, 1, 0, 0, 0, 2, 1, 0, 0, 33, - 59,198, 0, 1, 0, 0, 0, 2, 1, 1, 0, 9, 60, 47, 0, 1, 0, 0, 0, 2, 1, 4, 0, 23, 60,217, 0, 1, 0, 0, 0, 2, - 1, 5, 0, 17, 61, 58, 0, 1, 0, 0, 0, 2, 1, 6, 0, 17, 61,156, 0, 1, 0, 0, 0, 2, 1, 8, 0, 16, 62, 31, 0, 1, - 0, 0, 0, 3, 1, 0, 0, 21, 59,232, 0, 1, 0, 0, 0, 3, 1, 1, 0, 8, 60, 57, 0, 1, 0, 0, 0, 3, 1, 4, 0, 17, - 60,241, 0, 1, 0, 0, 0, 3, 1, 5, 0, 19, 61, 76, 0, 1, 0, 0, 0, 3, 1, 6, 0, 13, 61,174, 0, 1, 0, 0, 0, 3, - 1, 8, 0, 18, 62, 48, 0, 1, 0, 0, 0, 4, 1, 0, 0, 28, 59,254, 0, 1, 0, 0, 0, 4, 1, 1, 0, 9, 60, 66, 0, 1, - 0, 0, 0, 4, 1, 2, 0, 19, 60,119, 0, 1, 0, 0, 0, 4, 1, 3, 0, 7, 60,159, 0, 1, 0, 0, 0, 4, 1, 4, 0, 18, - 61, 3, 0, 1, 0, 0, 0, 4, 1, 5, 0, 28, 61, 96, 0, 1, 0, 0, 0, 4, 1, 6, 0, 18, 61,188, 0, 1, 0, 0, 0, 4, - 1, 7, 0, 7, 61,237, 0, 1, 0, 0, 0, 4, 1, 8, 0, 17, 62, 67, 0, 3, 0, 1, 4, 9, 0, 0, 1, 48, 0, 0, 0, 3, - 0, 1, 4, 9, 0, 1, 0, 22, 1,203, 0, 3, 0, 1, 4, 9, 0, 2, 0, 8, 1,239, 0, 3, 0, 1, 4, 9, 0, 3, 0, 22, - 1,254, 0, 3, 0, 1, 4, 9, 0, 4, 0, 22, 2, 34, 0, 3, 0, 1, 4, 9, 0, 5, 0, 22, 2, 70, 0, 3, 0, 1, 4, 9, - 0, 6, 0, 20, 2,106, 0, 3, 0, 1, 4, 9, 0, 8, 0, 34, 2,139, 0, 3, 0, 1, 4, 9, 0, 11, 0, 58, 2,193, 0, 3, - 0, 1, 4, 9, 0, 13, 37, 58, 3, 27, 0, 3, 0, 1, 4, 9, 0, 14, 0,104, 58,245, 0, 67, 0,111, 0,112, 0,121, 0,114, - 0,105, 0,103, 0,104, 0,116, 0, 32, 0, 40, 0, 99, 0, 41, 0, 32, 0, 50, 0, 48, 0, 48, 0, 51, 0, 32, 0, 98, 0,121, - 0, 32, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 44, 0, 32, 0, 73, 0,110, 0, 99, 0, 46, - 0, 32, 0, 65, 0,108, 0,108, 0, 32, 0, 82, 0,105, 0,103, 0,104, 0,116, 0,115, 0, 32, 0, 82, 0,101, 0,115, 0,101, - 0,114, 0,118, 0,101, 0,100, 0, 46, 0, 10, 0, 67, 0,111, 0,112, 0,121, 0,114, 0,105, 0,103, 0,104, 0,116, 0, 32, - 0, 40, 0, 99, 0, 41, 0, 32, 0, 50, 0, 48, 0, 48, 0, 54, 0, 32, 0, 98, 0,121, 0, 32, 0, 84, 0, 97, 0,118, 0,109, - 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, 46, 0, 32, 0, 65, 0,108, 0,108, 0, 32, 0, 82, 0,105, - 0,103, 0,104, 0,116, 0,115, 0, 32, 0, 82, 0,101, 0,115, 0,101, 0,114, 0,118, 0,101, 0,100, 0, 46, 0, 10, 0, 68, - 0,101, 0,106, 0, 97, 0, 86, 0,117, 0, 32, 0, 99, 0,104, 0, 97, 0,110, 0,103, 0,101, 0,115, 0, 32, 0, 97, 0,114, - 0,101, 0, 32, 0,105, 0,110, 0, 32, 0,112, 0,117, 0, 98, 0,108, 0,105, 0, 99, 0, 32, 0,100, 0,111, 0,109, 0, 97, - 0,105, 0,110, 0, 10, 0, 0, 67,111,112,121,114,105,103,104,116, 32, 40, 99, 41, 32, 50, 48, 48, 51, 32, 98,121, 32, 66,105, -116,115,116,114,101, 97,109, 44, 32, 73,110, 99, 46, 32, 65,108,108, 32, 82,105,103,104,116,115, 32, 82,101,115,101,114,118,101, -100, 46, 10, 67,111,112,121,114,105,103,104,116, 32, 40, 99, 41, 32, 50, 48, 48, 54, 32, 98,121, 32, 84, 97,118,109,106,111,110, -103, 32, 66, 97,104, 46, 32, 65,108,108, 32, 82,105,103,104,116,115, 32, 82,101,115,101,114,118,101,100, 46, 10, 68,101,106, 97, - 86,117, 32, 99,104, 97,110,103,101,115, 32, 97,114,101, 32,105,110, 32,112,117, 98,108,105, 99, 32,100,111,109, 97,105,110, 10, - 0, 0, 68, 0,101, 0,106, 0, 97, 0, 86, 0,117, 0, 32, 0, 83, 0, 97, 0,110, 0,115, 0, 0, 68,101,106, 97, 86,117, 32, - 83, 97,110,115, 0, 0, 66, 0,111, 0,111, 0,107, 0, 0, 66,111,111,107, 0, 0, 68, 0,101, 0,106, 0, 97, 0, 86, 0,117, - 0, 32, 0, 83, 0, 97, 0,110, 0,115, 0, 0, 68,101,106, 97, 86,117, 32, 83, 97,110,115, 0, 0, 68, 0,101, 0,106, 0, 97, - 0, 86, 0,117, 0, 32, 0, 83, 0, 97, 0,110, 0,115, 0, 0, 68,101,106, 97, 86,117, 32, 83, 97,110,115, 0, 0, 86, 0,101, - 0,114, 0,115, 0,105, 0,111, 0,110, 0, 32, 0, 50, 0, 46, 0, 56, 0, 0, 86,101,114,115,105,111,110, 32, 50, 46, 56, 0, - 0, 68, 0,101, 0,106, 0, 97, 0, 86, 0,117, 0, 83, 0, 97, 0,110, 0,115, 0, 0, 68,101,106, 97, 86,117, 83, 97,110,115, - 0, 0, 68, 0,101, 0,106, 0, 97, 0, 86, 0,117, 0, 32, 0,102, 0,111, 0,110, 0,116, 0,115, 0, 32, 0,116, 0,101, 0, - 97, 0,109, 0, 0, 68,101,106, 97, 86,117, 32,102,111,110,116,115, 32,116,101, 97,109, 0, 0,104, 0,116, 0,116, 0,112, 0, - 58, 0, 47, 0, 47, 0,100, 0,101, 0,106, 0, 97, 0,118, 0,117, 0, 46, 0,115, 0,111, 0,117, 0,114, 0, 99, 0,101, 0, -102, 0,111, 0,114, 0,103, 0,101, 0, 46, 0,110, 0,101, 0,116, 0, 0,104,116,116,112, 58, 47, 47,100,101,106, 97,118,117, - 46,115,111,117,114, 99,101,102,111,114,103,101, 46,110,101,116, 0, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 32, 0, 97, 0, -114, 0,101, 0, 32, 0, 40, 0, 99, 0, 41, 0, 32, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, - 32, 0, 40, 0,115, 0,101, 0,101, 0, 32, 0, 98, 0,101, 0,108, 0,111, 0,119, 0, 41, 0, 46, 0, 32, 0, 68, 0,101, 0, -106, 0, 97, 0, 86, 0,117, 0, 32, 0, 99, 0,104, 0, 97, 0,110, 0,103, 0,101, 0,115, 0, 32, 0, 97, 0,114, 0,101, 0, - 32, 0,105, 0,110, 0, 32, 0,112, 0,117, 0, 98, 0,108, 0,105, 0, 99, 0, 32, 0,100, 0,111, 0,109, 0, 97, 0,105, 0, -110, 0, 46, 0, 32, 0, 71, 0,108, 0,121, 0,112, 0,104, 0,115, 0, 32, 0,105, 0,109, 0,112, 0,111, 0,114, 0,116, 0, -101, 0,100, 0, 32, 0,102, 0,114, 0,111, 0,109, 0, 32, 0, 65, 0,114, 0,101, 0,118, 0, 32, 0,102, 0,111, 0,110, 0, -116, 0,115, 0, 32, 0, 97, 0,114, 0,101, 0, 32, 0, 40, 0, 99, 0, 41, 0, 32, 0, 84, 0, 97, 0,118, 0,109, 0,106, 0, -117, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, 32, 0, 40, 0,115, 0,101, 0,101, 0, 32, 0, 98, 0,101, 0,108, 0, -111, 0,119, 0, 41, 0, 10, 0, 10, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 32, 0, 86, 0, -101, 0,114, 0, 97, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 32, 0, 67, 0,111, 0,112, 0,121, 0,114, 0,105, 0, -103, 0,104, 0,116, 0, 10, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, - 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, - 45, 0, 45, 0, 10, 0, 10, 0, 67, 0,111, 0,112, 0,121, 0,114, 0,105, 0,103, 0,104, 0,116, 0, 32, 0, 40, 0, 99, 0, - 41, 0, 32, 0, 50, 0, 48, 0, 48, 0, 51, 0, 32, 0, 98, 0,121, 0, 32, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0, -101, 0, 97, 0,109, 0, 44, 0, 32, 0, 73, 0,110, 0, 99, 0, 46, 0, 32, 0, 65, 0,108, 0,108, 0, 32, 0, 82, 0,105, 0, -103, 0,104, 0,116, 0,115, 0, 32, 0, 82, 0,101, 0,115, 0,101, 0,114, 0,118, 0,101, 0,100, 0, 46, 0, 32, 0, 66, 0, -105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 32, 0, 86, 0,101, 0,114, 0, 97, 0, 32, 0,105, 0,115, 0, - 10, 0, 97, 0, 32, 0,116, 0,114, 0, 97, 0,100, 0,101, 0,109, 0, 97, 0,114, 0,107, 0, 32, 0,111, 0,102, 0, 32, 0, - 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 44, 0, 32, 0, 73, 0,110, 0, 99, 0, 46, 0, 10, 0, - 10, 0, 80, 0,101, 0,114, 0,109, 0,105, 0,115, 0,115, 0,105, 0,111, 0,110, 0, 32, 0,105, 0,115, 0, 32, 0,104, 0, -101, 0,114, 0,101, 0, 98, 0,121, 0, 32, 0,103, 0,114, 0, 97, 0,110, 0,116, 0,101, 0,100, 0, 44, 0, 32, 0,102, 0, -114, 0,101, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0, 99, 0,104, 0, 97, 0,114, 0,103, 0,101, 0, 44, 0, 32, 0,116, 0, -111, 0, 32, 0, 97, 0,110, 0,121, 0, 32, 0,112, 0,101, 0,114, 0,115, 0,111, 0,110, 0, 32, 0,111, 0, 98, 0,116, 0, - 97, 0,105, 0,110, 0,105, 0,110, 0,103, 0, 32, 0, 97, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0, 10, 0,111, 0,102, 0, - 32, 0,116, 0,104, 0,101, 0, 32, 0,102, 0,111, 0,110, 0,116, 0,115, 0, 32, 0, 97, 0, 99, 0, 99, 0,111, 0,109, 0, -112, 0, 97, 0,110, 0,121, 0,105, 0,110, 0,103, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, 32, 0,108, 0,105, 0, 99, 0, -101, 0,110, 0,115, 0,101, 0, 32, 0, 40, 0, 34, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 34, 0, 41, 0, 32, 0, 97, 0, -110, 0,100, 0, 32, 0, 97, 0,115, 0,115, 0,111, 0, 99, 0,105, 0, 97, 0,116, 0,101, 0,100, 0, 10, 0,100, 0,111, 0, - 99, 0,117, 0,109, 0,101, 0,110, 0,116, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, 32, 0,102, 0,105, 0,108, 0,101, 0, -115, 0, 32, 0, 40, 0,116, 0,104, 0,101, 0, 32, 0, 34, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0, -116, 0,119, 0, 97, 0,114, 0,101, 0, 34, 0, 41, 0, 44, 0, 32, 0,116, 0,111, 0, 32, 0,114, 0,101, 0,112, 0,114, 0, -111, 0,100, 0,117, 0, 99, 0,101, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,100, 0,105, 0,115, 0,116, 0,114, 0,105, 0, - 98, 0,117, 0,116, 0,101, 0, 32, 0,116, 0,104, 0,101, 0, 10, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0, -102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 44, 0, 32, 0,105, 0,110, 0, 99, 0,108, 0,117, 0,100, 0,105, 0,110, 0, -103, 0, 32, 0,119, 0,105, 0,116, 0,104, 0,111, 0,117, 0,116, 0, 32, 0,108, 0,105, 0,109, 0,105, 0,116, 0, 97, 0, -116, 0,105, 0,111, 0,110, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,114, 0,105, 0,103, 0,104, 0,116, 0,115, 0, 32, 0, -116, 0,111, 0, 32, 0,117, 0,115, 0,101, 0, 44, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0, 44, 0, 32, 0,109, 0,101, 0, -114, 0,103, 0,101, 0, 44, 0, 10, 0,112, 0,117, 0, 98, 0,108, 0,105, 0,115, 0,104, 0, 44, 0, 32, 0,100, 0,105, 0, -115, 0,116, 0,114, 0,105, 0, 98, 0,117, 0,116, 0,101, 0, 44, 0, 32, 0, 97, 0,110, 0,100, 0, 47, 0,111, 0,114, 0, - 32, 0,115, 0,101, 0,108, 0,108, 0, 32, 0, 99, 0,111, 0,112, 0,105, 0,101, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0, -116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0, -101, 0, 44, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,112, 0,101, 0,114, 0,109, 0,105, 0,116, 0, - 10, 0,112, 0,101, 0,114, 0,115, 0,111, 0,110, 0,115, 0, 32, 0,116, 0,111, 0, 32, 0,119, 0,104, 0,111, 0,109, 0, - 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0, -114, 0,101, 0, 32, 0,105, 0,115, 0, 32, 0,102, 0,117, 0,114, 0,110, 0,105, 0,115, 0,104, 0,101, 0,100, 0, 32, 0, -116, 0,111, 0, 32, 0,100, 0,111, 0, 32, 0,115, 0,111, 0, 44, 0, 32, 0,115, 0,117, 0, 98, 0,106, 0,101, 0, 99, 0, -116, 0, 32, 0,116, 0,111, 0, 32, 0,116, 0,104, 0,101, 0, 10, 0,102, 0,111, 0,108, 0,108, 0,111, 0,119, 0,105, 0, -110, 0,103, 0, 32, 0, 99, 0,111, 0,110, 0,100, 0,105, 0,116, 0,105, 0,111, 0,110, 0,115, 0, 58, 0, 10, 0, 10, 0, - 84, 0,104, 0,101, 0, 32, 0, 97, 0, 98, 0,111, 0,118, 0,101, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0,114, 0,105, 0, -103, 0,104, 0,116, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,116, 0,114, 0, 97, 0,100, 0,101, 0,109, 0, 97, 0,114, 0, -107, 0, 32, 0,110, 0,111, 0,116, 0,105, 0, 99, 0,101, 0,115, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,116, 0,104, 0, -105, 0,115, 0, 32, 0,112, 0,101, 0,114, 0,109, 0,105, 0,115, 0,115, 0,105, 0,111, 0,110, 0, 32, 0,110, 0,111, 0, -116, 0,105, 0, 99, 0,101, 0, 32, 0,115, 0,104, 0, 97, 0,108, 0,108, 0, 10, 0, 98, 0,101, 0, 32, 0,105, 0,110, 0, - 99, 0,108, 0,117, 0,100, 0,101, 0,100, 0, 32, 0,105, 0,110, 0, 32, 0, 97, 0,108, 0,108, 0, 32, 0, 99, 0,111, 0, -112, 0,105, 0,101, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0,111, 0,110, 0,101, 0, 32, 0,111, 0,114, 0, 32, 0,109, 0, -111, 0,114, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, - 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,116, 0,121, 0,112, 0,101, 0,102, 0, 97, 0, 99, 0, -101, 0,115, 0, 46, 0, 10, 0, 10, 0, 84, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0, -102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0,109, 0,111, 0, -100, 0,105, 0,102, 0,105, 0,101, 0,100, 0, 44, 0, 32, 0, 97, 0,108, 0,116, 0,101, 0,114, 0,101, 0,100, 0, 44, 0, - 32, 0,111, 0,114, 0, 32, 0, 97, 0,100, 0,100, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, 44, 0, 32, 0, 97, 0,110, 0, -100, 0, 32, 0,105, 0,110, 0, 32, 0,112, 0, 97, 0,114, 0,116, 0,105, 0, 99, 0,117, 0,108, 0, 97, 0,114, 0, 10, 0, -116, 0,104, 0,101, 0, 32, 0,100, 0,101, 0,115, 0,105, 0,103, 0,110, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0,103, 0, -108, 0,121, 0,112, 0,104, 0,115, 0, 32, 0,111, 0,114, 0, 32, 0, 99, 0,104, 0, 97, 0,114, 0, 97, 0, 99, 0,116, 0, -101, 0,114, 0,115, 0, 32, 0,105, 0,110, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, - 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0,109, 0,111, 0,100, 0,105, 0,102, 0,105, 0,101, 0,100, 0, - 32, 0, 97, 0,110, 0,100, 0, 10, 0, 97, 0,100, 0,100, 0,105, 0,116, 0,105, 0,111, 0,110, 0, 97, 0,108, 0, 32, 0, -103, 0,108, 0,121, 0,112, 0,104, 0,115, 0, 32, 0,111, 0,114, 0, 32, 0, 99, 0,104, 0, 97, 0,114, 0, 97, 0, 99, 0, -116, 0,101, 0,114, 0,115, 0, 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0, 97, 0,100, 0,100, 0,101, 0, -100, 0, 32, 0,116, 0,111, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 44, 0, 32, 0, -111, 0,110, 0,108, 0,121, 0, 32, 0,105, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,102, 0,111, 0,110, 0,116, 0, -115, 0, 10, 0, 97, 0,114, 0,101, 0, 32, 0,114, 0,101, 0,110, 0, 97, 0,109, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, - 32, 0,110, 0, 97, 0,109, 0,101, 0,115, 0, 32, 0,110, 0,111, 0,116, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0, -105, 0,110, 0,105, 0,110, 0,103, 0, 32, 0,101, 0,105, 0,116, 0,104, 0,101, 0,114, 0, 32, 0,116, 0,104, 0,101, 0, - 32, 0,119, 0,111, 0,114, 0,100, 0,115, 0, 32, 0, 34, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0, -109, 0, 34, 0, 32, 0,111, 0,114, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,119, 0,111, 0,114, 0,100, 0, 10, 0, 34, 0, - 86, 0,101, 0,114, 0, 97, 0, 34, 0, 46, 0, 10, 0, 10, 0, 84, 0,104, 0,105, 0,115, 0, 32, 0, 76, 0,105, 0, 99, 0, -101, 0,110, 0,115, 0,101, 0, 32, 0, 98, 0,101, 0, 99, 0,111, 0,109, 0,101, 0,115, 0, 32, 0,110, 0,117, 0,108, 0, -108, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,118, 0,111, 0,105, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,116, 0,104, 0, -101, 0, 32, 0,101, 0,120, 0,116, 0,101, 0,110, 0,116, 0, 32, 0, 97, 0,112, 0,112, 0,108, 0,105, 0, 99, 0, 97, 0, - 98, 0,108, 0,101, 0, 32, 0,116, 0,111, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 32, 0,111, 0,114, 0, 32, 0, - 70, 0,111, 0,110, 0,116, 0, 10, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,116, 0,104, 0, - 97, 0,116, 0, 32, 0,104, 0, 97, 0,115, 0, 32, 0, 98, 0,101, 0,101, 0,110, 0, 32, 0,109, 0,111, 0,100, 0,105, 0, -102, 0,105, 0,101, 0,100, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,105, 0,115, 0, 32, 0,100, 0,105, 0,115, 0,116, 0, -114, 0,105, 0, 98, 0,117, 0,116, 0,101, 0,100, 0, 32, 0,117, 0,110, 0,100, 0,101, 0,114, 0, 32, 0,116, 0,104, 0, -101, 0, 32, 0, 34, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 10, 0, 86, 0,101, 0,114, 0, - 97, 0, 34, 0, 32, 0,110, 0, 97, 0,109, 0,101, 0,115, 0, 46, 0, 10, 0, 10, 0, 84, 0,104, 0,101, 0, 32, 0, 70, 0, -111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,109, 0, 97, 0,121, 0, - 32, 0, 98, 0,101, 0, 32, 0,115, 0,111, 0,108, 0,100, 0, 32, 0, 97, 0,115, 0, 32, 0,112, 0, 97, 0,114, 0,116, 0, - 32, 0,111, 0,102, 0, 32, 0, 97, 0, 32, 0,108, 0, 97, 0,114, 0,103, 0,101, 0,114, 0, 32, 0,115, 0,111, 0,102, 0, -116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,112, 0, 97, 0, 99, 0,107, 0, 97, 0,103, 0,101, 0, 32, 0, 98, 0,117, 0, -116, 0, 32, 0,110, 0,111, 0, 10, 0, 99, 0,111, 0,112, 0,121, 0, 32, 0,111, 0,102, 0, 32, 0,111, 0,110, 0,101, 0, - 32, 0,111, 0,114, 0, 32, 0,109, 0,111, 0,114, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, - 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,116, 0,121, 0, -112, 0,101, 0,102, 0, 97, 0, 99, 0,101, 0,115, 0, 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0,115, 0, -111, 0,108, 0,100, 0, 32, 0, 98, 0,121, 0, 32, 0,105, 0,116, 0,115, 0,101, 0,108, 0,102, 0, 46, 0, 10, 0, 10, 0, - 84, 0, 72, 0, 69, 0, 32, 0, 70, 0, 79, 0, 78, 0, 84, 0, 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, 87, 0, 65, 0, 82, 0, - 69, 0, 32, 0, 73, 0, 83, 0, 32, 0, 80, 0, 82, 0, 79, 0, 86, 0, 73, 0, 68, 0, 69, 0, 68, 0, 32, 0, 34, 0, 65, 0, - 83, 0, 32, 0, 73, 0, 83, 0, 34, 0, 44, 0, 32, 0, 87, 0, 73, 0, 84, 0, 72, 0, 79, 0, 85, 0, 84, 0, 32, 0, 87, 0, - 65, 0, 82, 0, 82, 0, 65, 0, 78, 0, 84, 0, 89, 0, 32, 0, 79, 0, 70, 0, 32, 0, 65, 0, 78, 0, 89, 0, 32, 0, 75, 0, - 73, 0, 78, 0, 68, 0, 44, 0, 32, 0, 69, 0, 88, 0, 80, 0, 82, 0, 69, 0, 83, 0, 83, 0, 10, 0, 79, 0, 82, 0, 32, 0, - 73, 0, 77, 0, 80, 0, 76, 0, 73, 0, 69, 0, 68, 0, 44, 0, 32, 0, 73, 0, 78, 0, 67, 0, 76, 0, 85, 0, 68, 0, 73, 0, - 78, 0, 71, 0, 32, 0, 66, 0, 85, 0, 84, 0, 32, 0, 78, 0, 79, 0, 84, 0, 32, 0, 76, 0, 73, 0, 77, 0, 73, 0, 84, 0, - 69, 0, 68, 0, 32, 0, 84, 0, 79, 0, 32, 0, 65, 0, 78, 0, 89, 0, 32, 0, 87, 0, 65, 0, 82, 0, 82, 0, 65, 0, 78, 0, - 84, 0, 73, 0, 69, 0, 83, 0, 32, 0, 79, 0, 70, 0, 32, 0, 77, 0, 69, 0, 82, 0, 67, 0, 72, 0, 65, 0, 78, 0, 84, 0, - 65, 0, 66, 0, 73, 0, 76, 0, 73, 0, 84, 0, 89, 0, 44, 0, 10, 0, 70, 0, 73, 0, 84, 0, 78, 0, 69, 0, 83, 0, 83, 0, - 32, 0, 70, 0, 79, 0, 82, 0, 32, 0, 65, 0, 32, 0, 80, 0, 65, 0, 82, 0, 84, 0, 73, 0, 67, 0, 85, 0, 76, 0, 65, 0, - 82, 0, 32, 0, 80, 0, 85, 0, 82, 0, 80, 0, 79, 0, 83, 0, 69, 0, 32, 0, 65, 0, 78, 0, 68, 0, 32, 0, 78, 0, 79, 0, - 78, 0, 73, 0, 78, 0, 70, 0, 82, 0, 73, 0, 78, 0, 71, 0, 69, 0, 77, 0, 69, 0, 78, 0, 84, 0, 32, 0, 79, 0, 70, 0, - 32, 0, 67, 0, 79, 0, 80, 0, 89, 0, 82, 0, 73, 0, 71, 0, 72, 0, 84, 0, 44, 0, 32, 0, 80, 0, 65, 0, 84, 0, 69, 0, - 78, 0, 84, 0, 44, 0, 10, 0, 84, 0, 82, 0, 65, 0, 68, 0, 69, 0, 77, 0, 65, 0, 82, 0, 75, 0, 44, 0, 32, 0, 79, 0, - 82, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 82, 0, 73, 0, 71, 0, 72, 0, 84, 0, 46, 0, 32, 0, 73, 0, - 78, 0, 32, 0, 78, 0, 79, 0, 32, 0, 69, 0, 86, 0, 69, 0, 78, 0, 84, 0, 32, 0, 83, 0, 72, 0, 65, 0, 76, 0, 76, 0, - 32, 0, 66, 0, 73, 0, 84, 0, 83, 0, 84, 0, 82, 0, 69, 0, 65, 0, 77, 0, 32, 0, 79, 0, 82, 0, 32, 0, 84, 0, 72, 0, - 69, 0, 32, 0, 71, 0, 78, 0, 79, 0, 77, 0, 69, 0, 10, 0, 70, 0, 79, 0, 85, 0, 78, 0, 68, 0, 65, 0, 84, 0, 73, 0, - 79, 0, 78, 0, 32, 0, 66, 0, 69, 0, 32, 0, 76, 0, 73, 0, 65, 0, 66, 0, 76, 0, 69, 0, 32, 0, 70, 0, 79, 0, 82, 0, - 32, 0, 65, 0, 78, 0, 89, 0, 32, 0, 67, 0, 76, 0, 65, 0, 73, 0, 77, 0, 44, 0, 32, 0, 68, 0, 65, 0, 77, 0, 65, 0, - 71, 0, 69, 0, 83, 0, 32, 0, 79, 0, 82, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 76, 0, 73, 0, 65, 0, - 66, 0, 73, 0, 76, 0, 73, 0, 84, 0, 89, 0, 44, 0, 32, 0, 73, 0, 78, 0, 67, 0, 76, 0, 85, 0, 68, 0, 73, 0, 78, 0, - 71, 0, 10, 0, 65, 0, 78, 0, 89, 0, 32, 0, 71, 0, 69, 0, 78, 0, 69, 0, 82, 0, 65, 0, 76, 0, 44, 0, 32, 0, 83, 0, - 80, 0, 69, 0, 67, 0, 73, 0, 65, 0, 76, 0, 44, 0, 32, 0, 73, 0, 78, 0, 68, 0, 73, 0, 82, 0, 69, 0, 67, 0, 84, 0, - 44, 0, 32, 0, 73, 0, 78, 0, 67, 0, 73, 0, 68, 0, 69, 0, 78, 0, 84, 0, 65, 0, 76, 0, 44, 0, 32, 0, 79, 0, 82, 0, - 32, 0, 67, 0, 79, 0, 78, 0, 83, 0, 69, 0, 81, 0, 85, 0, 69, 0, 78, 0, 84, 0, 73, 0, 65, 0, 76, 0, 32, 0, 68, 0, - 65, 0, 77, 0, 65, 0, 71, 0, 69, 0, 83, 0, 44, 0, 10, 0, 87, 0, 72, 0, 69, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, - 73, 0, 78, 0, 32, 0, 65, 0, 78, 0, 32, 0, 65, 0, 67, 0, 84, 0, 73, 0, 79, 0, 78, 0, 32, 0, 79, 0, 70, 0, 32, 0, - 67, 0, 79, 0, 78, 0, 84, 0, 82, 0, 65, 0, 67, 0, 84, 0, 44, 0, 32, 0, 84, 0, 79, 0, 82, 0, 84, 0, 32, 0, 79, 0, - 82, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 87, 0, 73, 0, 83, 0, 69, 0, 44, 0, 32, 0, 65, 0, 82, 0, 73, 0, - 83, 0, 73, 0, 78, 0, 71, 0, 32, 0, 70, 0, 82, 0, 79, 0, 77, 0, 44, 0, 32, 0, 79, 0, 85, 0, 84, 0, 32, 0, 79, 0, - 70, 0, 10, 0, 84, 0, 72, 0, 69, 0, 32, 0, 85, 0, 83, 0, 69, 0, 32, 0, 79, 0, 82, 0, 32, 0, 73, 0, 78, 0, 65, 0, - 66, 0, 73, 0, 76, 0, 73, 0, 84, 0, 89, 0, 32, 0, 84, 0, 79, 0, 32, 0, 85, 0, 83, 0, 69, 0, 32, 0, 84, 0, 72, 0, - 69, 0, 32, 0, 70, 0, 79, 0, 78, 0, 84, 0, 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, 87, 0, 65, 0, 82, 0, 69, 0, 32, 0, - 79, 0, 82, 0, 32, 0, 70, 0, 82, 0, 79, 0, 77, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 68, 0, 69, 0, - 65, 0, 76, 0, 73, 0, 78, 0, 71, 0, 83, 0, 32, 0, 73, 0, 78, 0, 32, 0, 84, 0, 72, 0, 69, 0, 10, 0, 70, 0, 79, 0, - 78, 0, 84, 0, 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, 87, 0, 65, 0, 82, 0, 69, 0, 46, 0, 10, 0, 10, 0, 69, 0,120, 0, - 99, 0,101, 0,112, 0,116, 0, 32, 0, 97, 0,115, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0,105, 0,110, 0,101, 0, -100, 0, 32, 0,105, 0,110, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, 32, 0,110, 0,111, 0,116, 0,105, 0, 99, 0,101, 0, - 44, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,110, 0, 97, 0,109, 0,101, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0, 71, 0, -110, 0,111, 0,109, 0,101, 0, 44, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 71, 0,110, 0,111, 0,109, 0,101, 0, 10, 0, - 70, 0,111, 0,117, 0,110, 0,100, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, 44, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0, - 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 32, 0, 73, 0,110, 0, 99, 0, 46, 0, 44, 0, 32, 0, -115, 0,104, 0, 97, 0,108, 0,108, 0, 32, 0,110, 0,111, 0,116, 0, 32, 0, 98, 0,101, 0, 32, 0,117, 0,115, 0,101, 0, -100, 0, 32, 0,105, 0,110, 0, 32, 0, 97, 0,100, 0,118, 0,101, 0,114, 0,116, 0,105, 0,115, 0,105, 0,110, 0,103, 0, - 32, 0,111, 0,114, 0, 10, 0,111, 0,116, 0,104, 0,101, 0,114, 0,119, 0,105, 0,115, 0,101, 0, 32, 0,116, 0,111, 0, - 32, 0,112, 0,114, 0,111, 0,109, 0,111, 0,116, 0,101, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,115, 0, 97, 0,108, 0, -101, 0, 44, 0, 32, 0,117, 0,115, 0,101, 0, 32, 0,111, 0,114, 0, 32, 0,111, 0,116, 0,104, 0,101, 0,114, 0, 32, 0, -100, 0,101, 0, 97, 0,108, 0,105, 0,110, 0,103, 0,115, 0, 32, 0,105, 0,110, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, - 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 10, 0,119, 0, -105, 0,116, 0,104, 0,111, 0,117, 0,116, 0, 32, 0,112, 0,114, 0,105, 0,111, 0,114, 0, 32, 0,119, 0,114, 0,105, 0, -116, 0,116, 0,101, 0,110, 0, 32, 0, 97, 0,117, 0,116, 0,104, 0,111, 0,114, 0,105, 0,122, 0, 97, 0,116, 0,105, 0, -111, 0,110, 0, 32, 0,102, 0,114, 0,111, 0,109, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 71, 0,110, 0,111, 0,109, 0, -101, 0, 32, 0, 70, 0,111, 0,117, 0,110, 0,100, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, 32, 0,111, 0,114, 0, 32, 0, - 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 10, 0, 73, 0,110, 0, 99, 0, 46, 0, 44, 0, 32, 0, -114, 0,101, 0,115, 0,112, 0,101, 0, 99, 0,116, 0,105, 0,118, 0,101, 0,108, 0,121, 0, 46, 0, 32, 0, 70, 0,111, 0, -114, 0, 32, 0,102, 0,117, 0,114, 0,116, 0,104, 0,101, 0,114, 0, 32, 0,105, 0,110, 0,102, 0,111, 0,114, 0,109, 0, - 97, 0,116, 0,105, 0,111, 0,110, 0, 44, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0, 99, 0,116, 0, 58, 0, 32, 0, -102, 0,111, 0,110, 0,116, 0,115, 0, 32, 0, 97, 0,116, 0, 32, 0,103, 0,110, 0,111, 0,109, 0,101, 0, 32, 0,100, 0, -111, 0,116, 0, 10, 0,111, 0,114, 0,103, 0, 46, 0, 32, 0, 10, 0, 10, 0, 65, 0,114, 0,101, 0,118, 0, 32, 0, 70, 0, -111, 0,110, 0,116, 0,115, 0, 32, 0, 67, 0,111, 0,112, 0,121, 0,114, 0,105, 0,103, 0,104, 0,116, 0, 10, 0, 45, 0, - 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, - 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 45, 0, 10, 0, 10, 0, 67, 0, -111, 0,112, 0,121, 0,114, 0,105, 0,103, 0,104, 0,116, 0, 32, 0, 40, 0, 99, 0, 41, 0, 32, 0, 50, 0, 48, 0, 48, 0, - 54, 0, 32, 0, 98, 0,121, 0, 32, 0, 84, 0, 97, 0,118, 0,109, 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0, -104, 0, 46, 0, 32, 0, 65, 0,108, 0,108, 0, 32, 0, 82, 0,105, 0,103, 0,104, 0,116, 0,115, 0, 32, 0, 82, 0,101, 0, -115, 0,101, 0,114, 0,118, 0,101, 0,100, 0, 46, 0, 10, 0, 10, 0, 80, 0,101, 0,114, 0,109, 0,105, 0,115, 0,115, 0, -105, 0,111, 0,110, 0, 32, 0,105, 0,115, 0, 32, 0,104, 0,101, 0,114, 0,101, 0, 98, 0,121, 0, 32, 0,103, 0,114, 0, - 97, 0,110, 0,116, 0,101, 0,100, 0, 44, 0, 32, 0,102, 0,114, 0,101, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0, 99, 0, -104, 0, 97, 0,114, 0,103, 0,101, 0, 44, 0, 32, 0,116, 0,111, 0, 32, 0, 97, 0,110, 0,121, 0, 32, 0,112, 0,101, 0, -114, 0,115, 0,111, 0,110, 0, 32, 0,111, 0, 98, 0,116, 0, 97, 0,105, 0,110, 0,105, 0,110, 0,103, 0, 10, 0, 97, 0, - 32, 0, 99, 0,111, 0,112, 0,121, 0, 32, 0,111, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,102, 0,111, 0,110, 0, -116, 0,115, 0, 32, 0, 97, 0, 99, 0, 99, 0,111, 0,109, 0,112, 0, 97, 0,110, 0,121, 0,105, 0,110, 0,103, 0, 32, 0, -116, 0,104, 0,105, 0,115, 0, 32, 0,108, 0,105, 0, 99, 0,101, 0,110, 0,115, 0,101, 0, 32, 0, 40, 0, 34, 0, 70, 0, -111, 0,110, 0,116, 0,115, 0, 34, 0, 41, 0, 32, 0, 97, 0,110, 0,100, 0, 10, 0, 97, 0,115, 0,115, 0,111, 0, 99, 0, -105, 0, 97, 0,116, 0,101, 0,100, 0, 32, 0,100, 0,111, 0, 99, 0,117, 0,109, 0,101, 0,110, 0,116, 0, 97, 0,116, 0, -105, 0,111, 0,110, 0, 32, 0,102, 0,105, 0,108, 0,101, 0,115, 0, 32, 0, 40, 0,116, 0,104, 0,101, 0, 32, 0, 34, 0, - 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 34, 0, 41, 0, 44, 0, - 32, 0,116, 0,111, 0, 32, 0,114, 0,101, 0,112, 0,114, 0,111, 0,100, 0,117, 0, 99, 0,101, 0, 10, 0, 97, 0,110, 0, -100, 0, 32, 0,100, 0,105, 0,115, 0,116, 0,114, 0,105, 0, 98, 0,117, 0,116, 0,101, 0, 32, 0,116, 0,104, 0,101, 0, - 32, 0,109, 0,111, 0,100, 0,105, 0,102, 0,105, 0, 99, 0, 97, 0,116, 0,105, 0,111, 0,110, 0,115, 0, 32, 0,116, 0, -111, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 66, 0,105, 0,116, 0,115, 0,116, 0,114, 0,101, 0, 97, 0,109, 0, 32, 0, - 86, 0,101, 0,114, 0, 97, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0, -114, 0,101, 0, 44, 0, 10, 0,105, 0,110, 0, 99, 0,108, 0,117, 0,100, 0,105, 0,110, 0,103, 0, 32, 0,119, 0,105, 0, -116, 0,104, 0,111, 0,117, 0,116, 0, 32, 0,108, 0,105, 0,109, 0,105, 0,116, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, - 32, 0,116, 0,104, 0,101, 0, 32, 0,114, 0,105, 0,103, 0,104, 0,116, 0,115, 0, 32, 0,116, 0,111, 0, 32, 0,117, 0, -115, 0,101, 0, 44, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0, 44, 0, 32, 0,109, 0,101, 0,114, 0,103, 0,101, 0, 44, 0, - 32, 0,112, 0,117, 0, 98, 0,108, 0,105, 0,115, 0,104, 0, 44, 0, 10, 0,100, 0,105, 0,115, 0,116, 0,114, 0,105, 0, - 98, 0,117, 0,116, 0,101, 0, 44, 0, 32, 0, 97, 0,110, 0,100, 0, 47, 0,111, 0,114, 0, 32, 0,115, 0,101, 0,108, 0, -108, 0, 32, 0, 99, 0,111, 0,112, 0,105, 0,101, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, - 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 44, 0, 32, 0, 97, 0, -110, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,112, 0,101, 0,114, 0,109, 0,105, 0,116, 0, 10, 0,112, 0,101, 0,114, 0, -115, 0,111, 0,110, 0,115, 0, 32, 0,116, 0,111, 0, 32, 0,119, 0,104, 0,111, 0,109, 0, 32, 0,116, 0,104, 0,101, 0, - 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,105, 0, -115, 0, 32, 0,102, 0,117, 0,114, 0,110, 0,105, 0,115, 0,104, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,100, 0, -111, 0, 32, 0,115, 0,111, 0, 44, 0, 32, 0,115, 0,117, 0, 98, 0,106, 0,101, 0, 99, 0,116, 0, 32, 0,116, 0,111, 0, - 10, 0,116, 0,104, 0,101, 0, 32, 0,102, 0,111, 0,108, 0,108, 0,111, 0,119, 0,105, 0,110, 0,103, 0, 32, 0, 99, 0, -111, 0,110, 0,100, 0,105, 0,116, 0,105, 0,111, 0,110, 0,115, 0, 58, 0, 10, 0, 10, 0, 84, 0,104, 0,101, 0, 32, 0, - 97, 0, 98, 0,111, 0,118, 0,101, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0,114, 0,105, 0,103, 0,104, 0,116, 0, 32, 0, - 97, 0,110, 0,100, 0, 32, 0,116, 0,114, 0, 97, 0,100, 0,101, 0,109, 0, 97, 0,114, 0,107, 0, 32, 0,110, 0,111, 0, -116, 0,105, 0, 99, 0,101, 0,115, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, 32, 0,112, 0, -101, 0,114, 0,109, 0,105, 0,115, 0,115, 0,105, 0,111, 0,110, 0, 32, 0,110, 0,111, 0,116, 0,105, 0, 99, 0,101, 0, - 10, 0,115, 0,104, 0, 97, 0,108, 0,108, 0, 32, 0, 98, 0,101, 0, 32, 0,105, 0,110, 0, 99, 0,108, 0,117, 0,100, 0, -101, 0,100, 0, 32, 0,105, 0,110, 0, 32, 0, 97, 0,108, 0,108, 0, 32, 0, 99, 0,111, 0,112, 0,105, 0,101, 0,115, 0, - 32, 0,111, 0,102, 0, 32, 0,111, 0,110, 0,101, 0, 32, 0,111, 0,114, 0, 32, 0,109, 0,111, 0,114, 0,101, 0, 32, 0, -111, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0, -119, 0, 97, 0,114, 0,101, 0, 10, 0,116, 0,121, 0,112, 0,101, 0,102, 0, 97, 0, 99, 0,101, 0,115, 0, 46, 0, 10, 0, - 10, 0, 84, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0, -114, 0,101, 0, 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0,109, 0,111, 0,100, 0,105, 0,102, 0,105, 0, -101, 0,100, 0, 44, 0, 32, 0, 97, 0,108, 0,116, 0,101, 0,114, 0,101, 0,100, 0, 44, 0, 32, 0,111, 0,114, 0, 32, 0, - 97, 0,100, 0,100, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, 44, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,105, 0,110, 0, - 10, 0,112, 0, 97, 0,114, 0,116, 0,105, 0, 99, 0,117, 0,108, 0, 97, 0,114, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, -100, 0,101, 0,115, 0,105, 0,103, 0,110, 0,115, 0, 32, 0,111, 0,102, 0, 32, 0,103, 0,108, 0,121, 0,112, 0,104, 0, -115, 0, 32, 0,111, 0,114, 0, 32, 0, 99, 0,104, 0, 97, 0,114, 0, 97, 0, 99, 0,116, 0,101, 0,114, 0,115, 0, 32, 0, -105, 0,110, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 32, 0,109, 0, 97, 0,121, 0, - 32, 0, 98, 0,101, 0, 10, 0,109, 0,111, 0,100, 0,105, 0,102, 0,105, 0,101, 0,100, 0, 32, 0, 97, 0,110, 0,100, 0, - 32, 0, 97, 0,100, 0,100, 0,105, 0,116, 0,105, 0,111, 0,110, 0, 97, 0,108, 0, 32, 0,103, 0,108, 0,121, 0,112, 0, -104, 0,115, 0, 32, 0,111, 0,114, 0, 32, 0, 99, 0,104, 0, 97, 0,114, 0, 97, 0, 99, 0,116, 0,101, 0,114, 0,115, 0, - 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0, 97, 0,100, 0,100, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, - 32, 0,116, 0,104, 0,101, 0, 10, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 44, 0, 32, 0,111, 0,110, 0,108, 0,121, 0, - 32, 0,105, 0,102, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,102, 0,111, 0,110, 0,116, 0,115, 0, 32, 0, 97, 0,114, 0, -101, 0, 32, 0,114, 0,101, 0,110, 0, 97, 0,109, 0,101, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,110, 0, 97, 0,109, 0, -101, 0,115, 0, 32, 0,110, 0,111, 0,116, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0,105, 0,110, 0,105, 0,110, 0, -103, 0, 32, 0,101, 0,105, 0,116, 0,104, 0,101, 0,114, 0, 10, 0,116, 0,104, 0,101, 0, 32, 0,119, 0,111, 0,114, 0, -100, 0,115, 0, 32, 0, 34, 0, 84, 0, 97, 0,118, 0,109, 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, - 34, 0, 32, 0,111, 0,114, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,119, 0,111, 0,114, 0,100, 0, 32, 0, 34, 0, 65, 0, -114, 0,101, 0,118, 0, 34, 0, 46, 0, 10, 0, 10, 0, 84, 0,104, 0,105, 0,115, 0, 32, 0, 76, 0,105, 0, 99, 0,101, 0, -110, 0,115, 0,101, 0, 32, 0, 98, 0,101, 0, 99, 0,111, 0,109, 0,101, 0,115, 0, 32, 0,110, 0,117, 0,108, 0,108, 0, - 32, 0, 97, 0,110, 0,100, 0, 32, 0,118, 0,111, 0,105, 0,100, 0, 32, 0,116, 0,111, 0, 32, 0,116, 0,104, 0,101, 0, - 32, 0,101, 0,120, 0,116, 0,101, 0,110, 0,116, 0, 32, 0, 97, 0,112, 0,112, 0,108, 0,105, 0, 99, 0, 97, 0, 98, 0, -108, 0,101, 0, 32, 0,116, 0,111, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0,115, 0, 10, 0,111, 0,114, 0, 32, 0, 70, 0, -111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,116, 0,104, 0, 97, 0, -116, 0, 32, 0,104, 0, 97, 0,115, 0, 32, 0, 98, 0,101, 0,101, 0,110, 0, 32, 0,109, 0,111, 0,100, 0,105, 0,102, 0, -105, 0,101, 0,100, 0, 32, 0, 97, 0,110, 0,100, 0, 32, 0,105, 0,115, 0, 32, 0,100, 0,105, 0,115, 0,116, 0,114, 0, -105, 0, 98, 0,117, 0,116, 0,101, 0,100, 0, 32, 0,117, 0,110, 0,100, 0,101, 0,114, 0, 32, 0,116, 0,104, 0,101, 0, - 32, 0, 10, 0, 34, 0, 84, 0, 97, 0,118, 0,109, 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, 32, 0, - 65, 0,114, 0,101, 0,118, 0, 34, 0, 32, 0,110, 0, 97, 0,109, 0,101, 0,115, 0, 46, 0, 10, 0, 10, 0, 84, 0,104, 0, -101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0, -109, 0, 97, 0,121, 0, 32, 0, 98, 0,101, 0, 32, 0,115, 0,111, 0,108, 0,100, 0, 32, 0, 97, 0,115, 0, 32, 0,112, 0, - 97, 0,114, 0,116, 0, 32, 0,111, 0,102, 0, 32, 0, 97, 0, 32, 0,108, 0, 97, 0,114, 0,103, 0,101, 0,114, 0, 32, 0, -115, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,112, 0, 97, 0, 99, 0,107, 0, 97, 0,103, 0,101, 0, - 32, 0, 98, 0,117, 0,116, 0, 10, 0,110, 0,111, 0, 32, 0, 99, 0,111, 0,112, 0,121, 0, 32, 0,111, 0,102, 0, 32, 0, -111, 0,110, 0,101, 0, 32, 0,111, 0,114, 0, 32, 0,109, 0,111, 0,114, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0,116, 0, -104, 0,101, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0,111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, - 32, 0,116, 0,121, 0,112, 0,101, 0,102, 0, 97, 0, 99, 0,101, 0,115, 0, 32, 0,109, 0, 97, 0,121, 0, 32, 0, 98, 0, -101, 0, 32, 0,115, 0,111, 0,108, 0,100, 0, 32, 0, 98, 0,121, 0, 10, 0,105, 0,116, 0,115, 0,101, 0,108, 0,102, 0, - 46, 0, 10, 0, 10, 0, 84, 0, 72, 0, 69, 0, 32, 0, 70, 0, 79, 0, 78, 0, 84, 0, 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, - 87, 0, 65, 0, 82, 0, 69, 0, 32, 0, 73, 0, 83, 0, 32, 0, 80, 0, 82, 0, 79, 0, 86, 0, 73, 0, 68, 0, 69, 0, 68, 0, - 32, 0, 34, 0, 65, 0, 83, 0, 32, 0, 73, 0, 83, 0, 34, 0, 44, 0, 32, 0, 87, 0, 73, 0, 84, 0, 72, 0, 79, 0, 85, 0, - 84, 0, 32, 0, 87, 0, 65, 0, 82, 0, 82, 0, 65, 0, 78, 0, 84, 0, 89, 0, 32, 0, 79, 0, 70, 0, 32, 0, 65, 0, 78, 0, - 89, 0, 32, 0, 75, 0, 73, 0, 78, 0, 68, 0, 44, 0, 10, 0, 69, 0, 88, 0, 80, 0, 82, 0, 69, 0, 83, 0, 83, 0, 32, 0, - 79, 0, 82, 0, 32, 0, 73, 0, 77, 0, 80, 0, 76, 0, 73, 0, 69, 0, 68, 0, 44, 0, 32, 0, 73, 0, 78, 0, 67, 0, 76, 0, - 85, 0, 68, 0, 73, 0, 78, 0, 71, 0, 32, 0, 66, 0, 85, 0, 84, 0, 32, 0, 78, 0, 79, 0, 84, 0, 32, 0, 76, 0, 73, 0, - 77, 0, 73, 0, 84, 0, 69, 0, 68, 0, 32, 0, 84, 0, 79, 0, 32, 0, 65, 0, 78, 0, 89, 0, 32, 0, 87, 0, 65, 0, 82, 0, - 82, 0, 65, 0, 78, 0, 84, 0, 73, 0, 69, 0, 83, 0, 32, 0, 79, 0, 70, 0, 10, 0, 77, 0, 69, 0, 82, 0, 67, 0, 72, 0, - 65, 0, 78, 0, 84, 0, 65, 0, 66, 0, 73, 0, 76, 0, 73, 0, 84, 0, 89, 0, 44, 0, 32, 0, 70, 0, 73, 0, 84, 0, 78, 0, - 69, 0, 83, 0, 83, 0, 32, 0, 70, 0, 79, 0, 82, 0, 32, 0, 65, 0, 32, 0, 80, 0, 65, 0, 82, 0, 84, 0, 73, 0, 67, 0, - 85, 0, 76, 0, 65, 0, 82, 0, 32, 0, 80, 0, 85, 0, 82, 0, 80, 0, 79, 0, 83, 0, 69, 0, 32, 0, 65, 0, 78, 0, 68, 0, - 32, 0, 78, 0, 79, 0, 78, 0, 73, 0, 78, 0, 70, 0, 82, 0, 73, 0, 78, 0, 71, 0, 69, 0, 77, 0, 69, 0, 78, 0, 84, 0, - 10, 0, 79, 0, 70, 0, 32, 0, 67, 0, 79, 0, 80, 0, 89, 0, 82, 0, 73, 0, 71, 0, 72, 0, 84, 0, 44, 0, 32, 0, 80, 0, - 65, 0, 84, 0, 69, 0, 78, 0, 84, 0, 44, 0, 32, 0, 84, 0, 82, 0, 65, 0, 68, 0, 69, 0, 77, 0, 65, 0, 82, 0, 75, 0, - 44, 0, 32, 0, 79, 0, 82, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 82, 0, 73, 0, 71, 0, 72, 0, 84, 0, - 46, 0, 32, 0, 73, 0, 78, 0, 32, 0, 78, 0, 79, 0, 32, 0, 69, 0, 86, 0, 69, 0, 78, 0, 84, 0, 32, 0, 83, 0, 72, 0, - 65, 0, 76, 0, 76, 0, 10, 0, 84, 0, 65, 0, 86, 0, 77, 0, 74, 0, 79, 0, 78, 0, 71, 0, 32, 0, 66, 0, 65, 0, 72, 0, - 32, 0, 66, 0, 69, 0, 32, 0, 76, 0, 73, 0, 65, 0, 66, 0, 76, 0, 69, 0, 32, 0, 70, 0, 79, 0, 82, 0, 32, 0, 65, 0, - 78, 0, 89, 0, 32, 0, 67, 0, 76, 0, 65, 0, 73, 0, 77, 0, 44, 0, 32, 0, 68, 0, 65, 0, 77, 0, 65, 0, 71, 0, 69, 0, - 83, 0, 32, 0, 79, 0, 82, 0, 32, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 76, 0, 73, 0, 65, 0, 66, 0, 73, 0, - 76, 0, 73, 0, 84, 0, 89, 0, 44, 0, 10, 0, 73, 0, 78, 0, 67, 0, 76, 0, 85, 0, 68, 0, 73, 0, 78, 0, 71, 0, 32, 0, - 65, 0, 78, 0, 89, 0, 32, 0, 71, 0, 69, 0, 78, 0, 69, 0, 82, 0, 65, 0, 76, 0, 44, 0, 32, 0, 83, 0, 80, 0, 69, 0, - 67, 0, 73, 0, 65, 0, 76, 0, 44, 0, 32, 0, 73, 0, 78, 0, 68, 0, 73, 0, 82, 0, 69, 0, 67, 0, 84, 0, 44, 0, 32, 0, - 73, 0, 78, 0, 67, 0, 73, 0, 68, 0, 69, 0, 78, 0, 84, 0, 65, 0, 76, 0, 44, 0, 32, 0, 79, 0, 82, 0, 32, 0, 67, 0, - 79, 0, 78, 0, 83, 0, 69, 0, 81, 0, 85, 0, 69, 0, 78, 0, 84, 0, 73, 0, 65, 0, 76, 0, 10, 0, 68, 0, 65, 0, 77, 0, - 65, 0, 71, 0, 69, 0, 83, 0, 44, 0, 32, 0, 87, 0, 72, 0, 69, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 73, 0, 78, 0, - 32, 0, 65, 0, 78, 0, 32, 0, 65, 0, 67, 0, 84, 0, 73, 0, 79, 0, 78, 0, 32, 0, 79, 0, 70, 0, 32, 0, 67, 0, 79, 0, - 78, 0, 84, 0, 82, 0, 65, 0, 67, 0, 84, 0, 44, 0, 32, 0, 84, 0, 79, 0, 82, 0, 84, 0, 32, 0, 79, 0, 82, 0, 32, 0, - 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 87, 0, 73, 0, 83, 0, 69, 0, 44, 0, 32, 0, 65, 0, 82, 0, 73, 0, 83, 0, 73, 0, - 78, 0, 71, 0, 10, 0, 70, 0, 82, 0, 79, 0, 77, 0, 44, 0, 32, 0, 79, 0, 85, 0, 84, 0, 32, 0, 79, 0, 70, 0, 32, 0, - 84, 0, 72, 0, 69, 0, 32, 0, 85, 0, 83, 0, 69, 0, 32, 0, 79, 0, 82, 0, 32, 0, 73, 0, 78, 0, 65, 0, 66, 0, 73, 0, - 76, 0, 73, 0, 84, 0, 89, 0, 32, 0, 84, 0, 79, 0, 32, 0, 85, 0, 83, 0, 69, 0, 32, 0, 84, 0, 72, 0, 69, 0, 32, 0, - 70, 0, 79, 0, 78, 0, 84, 0, 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, 87, 0, 65, 0, 82, 0, 69, 0, 32, 0, 79, 0, 82, 0, - 32, 0, 70, 0, 82, 0, 79, 0, 77, 0, 10, 0, 79, 0, 84, 0, 72, 0, 69, 0, 82, 0, 32, 0, 68, 0, 69, 0, 65, 0, 76, 0, - 73, 0, 78, 0, 71, 0, 83, 0, 32, 0, 73, 0, 78, 0, 32, 0, 84, 0, 72, 0, 69, 0, 32, 0, 70, 0, 79, 0, 78, 0, 84, 0, - 32, 0, 83, 0, 79, 0, 70, 0, 84, 0, 87, 0, 65, 0, 82, 0, 69, 0, 46, 0, 10, 0, 10, 0, 69, 0,120, 0, 99, 0,101, 0, -112, 0,116, 0, 32, 0, 97, 0,115, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0,105, 0,110, 0,101, 0,100, 0, 32, 0, -105, 0,110, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, 32, 0,110, 0,111, 0,116, 0,105, 0, 99, 0,101, 0, 44, 0, 32, 0, -116, 0,104, 0,101, 0, 32, 0,110, 0, 97, 0,109, 0,101, 0, 32, 0,111, 0,102, 0, 32, 0, 84, 0, 97, 0,118, 0,109, 0, -106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, 32, 0,115, 0,104, 0, 97, 0,108, 0,108, 0, 32, 0,110, 0, -111, 0,116, 0, 10, 0, 98, 0,101, 0, 32, 0,117, 0,115, 0,101, 0,100, 0, 32, 0,105, 0,110, 0, 32, 0, 97, 0,100, 0, -118, 0,101, 0,114, 0,116, 0,105, 0,115, 0,105, 0,110, 0,103, 0, 32, 0,111, 0,114, 0, 32, 0,111, 0,116, 0,104, 0, -101, 0,114, 0,119, 0,105, 0,115, 0,101, 0, 32, 0,116, 0,111, 0, 32, 0,112, 0,114, 0,111, 0,109, 0,111, 0,116, 0, -101, 0, 32, 0,116, 0,104, 0,101, 0, 32, 0,115, 0, 97, 0,108, 0,101, 0, 44, 0, 32, 0,117, 0,115, 0,101, 0, 32, 0, -111, 0,114, 0, 32, 0,111, 0,116, 0,104, 0,101, 0,114, 0, 10, 0,100, 0,101, 0, 97, 0,108, 0,105, 0,110, 0,103, 0, -115, 0, 32, 0,105, 0,110, 0, 32, 0,116, 0,104, 0,105, 0,115, 0, 32, 0, 70, 0,111, 0,110, 0,116, 0, 32, 0, 83, 0, -111, 0,102, 0,116, 0,119, 0, 97, 0,114, 0,101, 0, 32, 0,119, 0,105, 0,116, 0,104, 0,111, 0,117, 0,116, 0, 32, 0, -112, 0,114, 0,105, 0,111, 0,114, 0, 32, 0,119, 0,114, 0,105, 0,116, 0,116, 0,101, 0,110, 0, 32, 0, 97, 0,117, 0, -116, 0,104, 0,111, 0,114, 0,105, 0,122, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, 10, 0,102, 0,114, 0,111, 0,109, 0, - 32, 0, 84, 0, 97, 0,118, 0,109, 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 66, 0, 97, 0,104, 0, 46, 0, 32, 0, 70, 0, -111, 0,114, 0, 32, 0,102, 0,117, 0,114, 0,116, 0,104, 0,101, 0,114, 0, 32, 0,105, 0,110, 0,102, 0,111, 0,114, 0, -109, 0, 97, 0,116, 0,105, 0,111, 0,110, 0, 44, 0, 32, 0, 99, 0,111, 0,110, 0,116, 0, 97, 0, 99, 0,116, 0, 58, 0, - 32, 0,116, 0, 97, 0,118, 0,109, 0,106, 0,111, 0,110, 0,103, 0, 32, 0, 64, 0, 32, 0,102, 0,114, 0,101, 0,101, 0, - 10, 0, 46, 0, 32, 0,102, 0,114, 0, 46, 0, 0, 70,111,110,116,115, 32, 97,114,101, 32, 40, 99, 41, 32, 66,105,116,115,116, -114,101, 97,109, 32, 40,115,101,101, 32, 98,101,108,111,119, 41, 46, 32, 68,101,106, 97, 86,117, 32, 99,104, 97,110,103,101,115, - 32, 97,114,101, 32,105,110, 32,112,117, 98,108,105, 99, 32,100,111,109, 97,105,110, 46, 32, 71,108,121,112,104,115, 32,105,109, -112,111,114,116,101,100, 32,102,114,111,109, 32, 65,114,101,118, 32,102,111,110,116,115, 32, 97,114,101, 32, 40, 99, 41, 32, 84, - 97,118,109,106,117,110,103, 32, 66, 97,104, 32, 40,115,101,101, 32, 98,101,108,111,119, 41, 10, 10, 66,105,116,115,116,114,101, - 97,109, 32, 86,101,114, 97, 32, 70,111,110,116,115, 32, 67,111,112,121,114,105,103,104,116, 10, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 67,111,112,121,114,105,103,104, -116, 32, 40, 99, 41, 32, 50, 48, 48, 51, 32, 98,121, 32, 66,105,116,115,116,114,101, 97,109, 44, 32, 73,110, 99, 46, 32, 65,108, -108, 32, 82,105,103,104,116,115, 32, 82,101,115,101,114,118,101,100, 46, 32, 66,105,116,115,116,114,101, 97,109, 32, 86,101,114, - 97, 32,105,115, 10, 97, 32,116,114, 97,100,101,109, 97,114,107, 32,111,102, 32, 66,105,116,115,116,114,101, 97,109, 44, 32, 73, -110, 99, 46, 10, 10, 80,101,114,109,105,115,115,105,111,110, 32,105,115, 32,104,101,114,101, 98,121, 32,103,114, 97,110,116,101, -100, 44, 32,102,114,101,101, 32,111,102, 32, 99,104, 97,114,103,101, 44, 32,116,111, 32, 97,110,121, 32,112,101,114,115,111,110, - 32,111, 98,116, 97,105,110,105,110,103, 32, 97, 32, 99,111,112,121, 10,111,102, 32,116,104,101, 32,102,111,110,116,115, 32, 97, - 99, 99,111,109,112, 97,110,121,105,110,103, 32,116,104,105,115, 32,108,105, 99,101,110,115,101, 32, 40, 34, 70,111,110,116,115, - 34, 41, 32, 97,110,100, 32, 97,115,115,111, 99,105, 97,116,101,100, 10,100,111, 99,117,109,101,110,116, 97,116,105,111,110, 32, -102,105,108,101,115, 32, 40,116,104,101, 32, 34, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 34, 41, 44, 32,116,111, 32, -114,101,112,114,111,100,117, 99,101, 32, 97,110,100, 32,100,105,115,116,114,105, 98,117,116,101, 32,116,104,101, 10, 70,111,110, -116, 32, 83,111,102,116,119, 97,114,101, 44, 32,105,110, 99,108,117,100,105,110,103, 32,119,105,116,104,111,117,116, 32,108,105, -109,105,116, 97,116,105,111,110, 32,116,104,101, 32,114,105,103,104,116,115, 32,116,111, 32,117,115,101, 44, 32, 99,111,112,121, - 44, 32,109,101,114,103,101, 44, 10,112,117, 98,108,105,115,104, 44, 32,100,105,115,116,114,105, 98,117,116,101, 44, 32, 97,110, -100, 47,111,114, 32,115,101,108,108, 32, 99,111,112,105,101,115, 32,111,102, 32,116,104,101, 32, 70,111,110,116, 32, 83,111,102, -116,119, 97,114,101, 44, 32, 97,110,100, 32,116,111, 32,112,101,114,109,105,116, 10,112,101,114,115,111,110,115, 32,116,111, 32, -119,104,111,109, 32,116,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,105,115, 32,102,117,114,110,105,115, -104,101,100, 32,116,111, 32,100,111, 32,115,111, 44, 32,115,117, 98,106,101, 99,116, 32,116,111, 32,116,104,101, 10,102,111,108, -108,111,119,105,110,103, 32, 99,111,110,100,105,116,105,111,110,115, 58, 10, 10, 84,104,101, 32, 97, 98,111,118,101, 32, 99,111, -112,121,114,105,103,104,116, 32, 97,110,100, 32,116,114, 97,100,101,109, 97,114,107, 32,110,111,116,105, 99,101,115, 32, 97,110, -100, 32,116,104,105,115, 32,112,101,114,109,105,115,115,105,111,110, 32,110,111,116,105, 99,101, 32,115,104, 97,108,108, 10, 98, -101, 32,105,110, 99,108,117,100,101,100, 32,105,110, 32, 97,108,108, 32, 99,111,112,105,101,115, 32,111,102, 32,111,110,101, 32, -111,114, 32,109,111,114,101, 32,111,102, 32,116,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,116,121,112, -101,102, 97, 99,101,115, 46, 10, 10, 84,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,109, 97,121, 32, 98, -101, 32,109,111,100,105,102,105,101,100, 44, 32, 97,108,116,101,114,101,100, 44, 32,111,114, 32, 97,100,100,101,100, 32,116,111, - 44, 32, 97,110,100, 32,105,110, 32,112, 97,114,116,105, 99,117,108, 97,114, 10,116,104,101, 32,100,101,115,105,103,110,115, 32, -111,102, 32,103,108,121,112,104,115, 32,111,114, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32,105,110, 32,116,104,101, 32, 70, -111,110,116,115, 32,109, 97,121, 32, 98,101, 32,109,111,100,105,102,105,101,100, 32, 97,110,100, 10, 97,100,100,105,116,105,111, -110, 97,108, 32,103,108,121,112,104,115, 32,111,114, 32, 99,104, 97,114, 97, 99,116,101,114,115, 32,109, 97,121, 32, 98,101, 32, - 97,100,100,101,100, 32,116,111, 32,116,104,101, 32, 70,111,110,116,115, 44, 32,111,110,108,121, 32,105,102, 32,116,104,101, 32, -102,111,110,116,115, 10, 97,114,101, 32,114,101,110, 97,109,101,100, 32,116,111, 32,110, 97,109,101,115, 32,110,111,116, 32, 99, -111,110,116, 97,105,110,105,110,103, 32,101,105,116,104,101,114, 32,116,104,101, 32,119,111,114,100,115, 32, 34, 66,105,116,115, -116,114,101, 97,109, 34, 32,111,114, 32,116,104,101, 32,119,111,114,100, 10, 34, 86,101,114, 97, 34, 46, 10, 10, 84,104,105,115, - 32, 76,105, 99,101,110,115,101, 32, 98,101, 99,111,109,101,115, 32,110,117,108,108, 32, 97,110,100, 32,118,111,105,100, 32,116, -111, 32,116,104,101, 32,101,120,116,101,110,116, 32, 97,112,112,108,105, 99, 97, 98,108,101, 32,116,111, 32, 70,111,110,116,115, - 32,111,114, 32, 70,111,110,116, 10, 83,111,102,116,119, 97,114,101, 32,116,104, 97,116, 32,104, 97,115, 32, 98,101,101,110, 32, -109,111,100,105,102,105,101,100, 32, 97,110,100, 32,105,115, 32,100,105,115,116,114,105, 98,117,116,101,100, 32,117,110,100,101, -114, 32,116,104,101, 32, 34, 66,105,116,115,116,114,101, 97,109, 10, 86,101,114, 97, 34, 32,110, 97,109,101,115, 46, 10, 10, 84, -104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,109, 97,121, 32, 98,101, 32,115,111,108,100, 32, 97,115, 32, -112, 97,114,116, 32,111,102, 32, 97, 32,108, 97,114,103,101,114, 32,115,111,102,116,119, 97,114,101, 32,112, 97, 99,107, 97,103, -101, 32, 98,117,116, 32,110,111, 10, 99,111,112,121, 32,111,102, 32,111,110,101, 32,111,114, 32,109,111,114,101, 32,111,102, 32, -116,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,116,121,112,101,102, 97, 99,101,115, 32,109, 97,121, 32, - 98,101, 32,115,111,108,100, 32, 98,121, 32,105,116,115,101,108,102, 46, 10, 10, 84, 72, 69, 32, 70, 79, 78, 84, 32, 83, 79, 70, - 84, 87, 65, 82, 69, 32, 73, 83, 32, 80, 82, 79, 86, 73, 68, 69, 68, 32, 34, 65, 83, 32, 73, 83, 34, 44, 32, 87, 73, 84, 72, 79, - 85, 84, 32, 87, 65, 82, 82, 65, 78, 84, 89, 32, 79, 70, 32, 65, 78, 89, 32, 75, 73, 78, 68, 44, 32, 69, 88, 80, 82, 69, 83, 83, - 10, 79, 82, 32, 73, 77, 80, 76, 73, 69, 68, 44, 32, 73, 78, 67, 76, 85, 68, 73, 78, 71, 32, 66, 85, 84, 32, 78, 79, 84, 32, 76, - 73, 77, 73, 84, 69, 68, 32, 84, 79, 32, 65, 78, 89, 32, 87, 65, 82, 82, 65, 78, 84, 73, 69, 83, 32, 79, 70, 32, 77, 69, 82, 67, - 72, 65, 78, 84, 65, 66, 73, 76, 73, 84, 89, 44, 10, 70, 73, 84, 78, 69, 83, 83, 32, 70, 79, 82, 32, 65, 32, 80, 65, 82, 84, 73, - 67, 85, 76, 65, 82, 32, 80, 85, 82, 80, 79, 83, 69, 32, 65, 78, 68, 32, 78, 79, 78, 73, 78, 70, 82, 73, 78, 71, 69, 77, 69, 78, - 84, 32, 79, 70, 32, 67, 79, 80, 89, 82, 73, 71, 72, 84, 44, 32, 80, 65, 84, 69, 78, 84, 44, 10, 84, 82, 65, 68, 69, 77, 65, 82, - 75, 44, 32, 79, 82, 32, 79, 84, 72, 69, 82, 32, 82, 73, 71, 72, 84, 46, 32, 73, 78, 32, 78, 79, 32, 69, 86, 69, 78, 84, 32, 83, - 72, 65, 76, 76, 32, 66, 73, 84, 83, 84, 82, 69, 65, 77, 32, 79, 82, 32, 84, 72, 69, 32, 71, 78, 79, 77, 69, 10, 70, 79, 85, 78, - 68, 65, 84, 73, 79, 78, 32, 66, 69, 32, 76, 73, 65, 66, 76, 69, 32, 70, 79, 82, 32, 65, 78, 89, 32, 67, 76, 65, 73, 77, 44, 32, - 68, 65, 77, 65, 71, 69, 83, 32, 79, 82, 32, 79, 84, 72, 69, 82, 32, 76, 73, 65, 66, 73, 76, 73, 84, 89, 44, 32, 73, 78, 67, 76, - 85, 68, 73, 78, 71, 10, 65, 78, 89, 32, 71, 69, 78, 69, 82, 65, 76, 44, 32, 83, 80, 69, 67, 73, 65, 76, 44, 32, 73, 78, 68, 73, - 82, 69, 67, 84, 44, 32, 73, 78, 67, 73, 68, 69, 78, 84, 65, 76, 44, 32, 79, 82, 32, 67, 79, 78, 83, 69, 81, 85, 69, 78, 84, 73, - 65, 76, 32, 68, 65, 77, 65, 71, 69, 83, 44, 10, 87, 72, 69, 84, 72, 69, 82, 32, 73, 78, 32, 65, 78, 32, 65, 67, 84, 73, 79, 78, - 32, 79, 70, 32, 67, 79, 78, 84, 82, 65, 67, 84, 44, 32, 84, 79, 82, 84, 32, 79, 82, 32, 79, 84, 72, 69, 82, 87, 73, 83, 69, 44, - 32, 65, 82, 73, 83, 73, 78, 71, 32, 70, 82, 79, 77, 44, 32, 79, 85, 84, 32, 79, 70, 10, 84, 72, 69, 32, 85, 83, 69, 32, 79, 82, - 32, 73, 78, 65, 66, 73, 76, 73, 84, 89, 32, 84, 79, 32, 85, 83, 69, 32, 84, 72, 69, 32, 70, 79, 78, 84, 32, 83, 79, 70, 84, 87, - 65, 82, 69, 32, 79, 82, 32, 70, 82, 79, 77, 32, 79, 84, 72, 69, 82, 32, 68, 69, 65, 76, 73, 78, 71, 83, 32, 73, 78, 32, 84, 72, - 69, 10, 70, 79, 78, 84, 32, 83, 79, 70, 84, 87, 65, 82, 69, 46, 10, 10, 69,120, 99,101,112,116, 32, 97,115, 32, 99,111,110,116, - 97,105,110,101,100, 32,105,110, 32,116,104,105,115, 32,110,111,116,105, 99,101, 44, 32,116,104,101, 32,110, 97,109,101,115, 32, -111,102, 32, 71,110,111,109,101, 44, 32,116,104,101, 32, 71,110,111,109,101, 10, 70,111,117,110,100, 97,116,105,111,110, 44, 32, - 97,110,100, 32, 66,105,116,115,116,114,101, 97,109, 32, 73,110, 99, 46, 44, 32,115,104, 97,108,108, 32,110,111,116, 32, 98,101, - 32,117,115,101,100, 32,105,110, 32, 97,100,118,101,114,116,105,115,105,110,103, 32,111,114, 10,111,116,104,101,114,119,105,115, -101, 32,116,111, 32,112,114,111,109,111,116,101, 32,116,104,101, 32,115, 97,108,101, 44, 32,117,115,101, 32,111,114, 32,111,116, -104,101,114, 32,100,101, 97,108,105,110,103,115, 32,105,110, 32,116,104,105,115, 32, 70,111,110,116, 32, 83,111,102,116,119, 97, -114,101, 10,119,105,116,104,111,117,116, 32,112,114,105,111,114, 32,119,114,105,116,116,101,110, 32, 97,117,116,104,111,114,105, -122, 97,116,105,111,110, 32,102,114,111,109, 32,116,104,101, 32, 71,110,111,109,101, 32, 70,111,117,110,100, 97,116,105,111,110, - 32,111,114, 32, 66,105,116,115,116,114,101, 97,109, 10, 73,110, 99, 46, 44, 32,114,101,115,112,101, 99,116,105,118,101,108,121, - 46, 32, 70,111,114, 32,102,117,114,116,104,101,114, 32,105,110,102,111,114,109, 97,116,105,111,110, 44, 32, 99,111,110,116, 97, - 99,116, 58, 32,102,111,110,116,115, 32, 97,116, 32,103,110,111,109,101, 32,100,111,116, 10,111,114,103, 46, 32, 10, 10, 65,114, -101,118, 32, 70,111,110,116,115, 32, 67,111,112,121,114,105,103,104,116, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 10, 10, 67,111,112,121,114,105,103,104,116, 32, 40, 99, 41, - 32, 50, 48, 48, 54, 32, 98,121, 32, 84, 97,118,109,106,111,110,103, 32, 66, 97,104, 46, 32, 65,108,108, 32, 82,105,103,104,116, -115, 32, 82,101,115,101,114,118,101,100, 46, 10, 10, 80,101,114,109,105,115,115,105,111,110, 32,105,115, 32,104,101,114,101, 98, -121, 32,103,114, 97,110,116,101,100, 44, 32,102,114,101,101, 32,111,102, 32, 99,104, 97,114,103,101, 44, 32,116,111, 32, 97,110, -121, 32,112,101,114,115,111,110, 32,111, 98,116, 97,105,110,105,110,103, 10, 97, 32, 99,111,112,121, 32,111,102, 32,116,104,101, - 32,102,111,110,116,115, 32, 97, 99, 99,111,109,112, 97,110,121,105,110,103, 32,116,104,105,115, 32,108,105, 99,101,110,115,101, - 32, 40, 34, 70,111,110,116,115, 34, 41, 32, 97,110,100, 10, 97,115,115,111, 99,105, 97,116,101,100, 32,100,111, 99,117,109,101, -110,116, 97,116,105,111,110, 32,102,105,108,101,115, 32, 40,116,104,101, 32, 34, 70,111,110,116, 32, 83,111,102,116,119, 97,114, -101, 34, 41, 44, 32,116,111, 32,114,101,112,114,111,100,117, 99,101, 10, 97,110,100, 32,100,105,115,116,114,105, 98,117,116,101, - 32,116,104,101, 32,109,111,100,105,102,105, 99, 97,116,105,111,110,115, 32,116,111, 32,116,104,101, 32, 66,105,116,115,116,114, -101, 97,109, 32, 86,101,114, 97, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 44, 10,105,110, 99,108,117,100,105,110, -103, 32,119,105,116,104,111,117,116, 32,108,105,109,105,116, 97,116,105,111,110, 32,116,104,101, 32,114,105,103,104,116,115, 32, -116,111, 32,117,115,101, 44, 32, 99,111,112,121, 44, 32,109,101,114,103,101, 44, 32,112,117, 98,108,105,115,104, 44, 10,100,105, -115,116,114,105, 98,117,116,101, 44, 32, 97,110,100, 47,111,114, 32,115,101,108,108, 32, 99,111,112,105,101,115, 32,111,102, 32, -116,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 44, 32, 97,110,100, 32,116,111, 32,112,101,114,109,105,116, - 10,112,101,114,115,111,110,115, 32,116,111, 32,119,104,111,109, 32,116,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, 97, -114,101, 32,105,115, 32,102,117,114,110,105,115,104,101,100, 32,116,111, 32,100,111, 32,115,111, 44, 32,115,117, 98,106,101, 99, -116, 32,116,111, 10,116,104,101, 32,102,111,108,108,111,119,105,110,103, 32, 99,111,110,100,105,116,105,111,110,115, 58, 10, 10, - 84,104,101, 32, 97, 98,111,118,101, 32, 99,111,112,121,114,105,103,104,116, 32, 97,110,100, 32,116,114, 97,100,101,109, 97,114, -107, 32,110,111,116,105, 99,101,115, 32, 97,110,100, 32,116,104,105,115, 32,112,101,114,109,105,115,115,105,111,110, 32,110,111, -116,105, 99,101, 10,115,104, 97,108,108, 32, 98,101, 32,105,110, 99,108,117,100,101,100, 32,105,110, 32, 97,108,108, 32, 99,111, -112,105,101,115, 32,111,102, 32,111,110,101, 32,111,114, 32,109,111,114,101, 32,111,102, 32,116,104,101, 32, 70,111,110,116, 32, - 83,111,102,116,119, 97,114,101, 10,116,121,112,101,102, 97, 99,101,115, 46, 10, 10, 84,104,101, 32, 70,111,110,116, 32, 83,111, -102,116,119, 97,114,101, 32,109, 97,121, 32, 98,101, 32,109,111,100,105,102,105,101,100, 44, 32, 97,108,116,101,114,101,100, 44, - 32,111,114, 32, 97,100,100,101,100, 32,116,111, 44, 32, 97,110,100, 32,105,110, 10,112, 97,114,116,105, 99,117,108, 97,114, 32, -116,104,101, 32,100,101,115,105,103,110,115, 32,111,102, 32,103,108,121,112,104,115, 32,111,114, 32, 99,104, 97,114, 97, 99,116, -101,114,115, 32,105,110, 32,116,104,101, 32, 70,111,110,116,115, 32,109, 97,121, 32, 98,101, 10,109,111,100,105,102,105,101,100, - 32, 97,110,100, 32, 97,100,100,105,116,105,111,110, 97,108, 32,103,108,121,112,104,115, 32,111,114, 32, 99,104, 97,114, 97, 99, -116,101,114,115, 32,109, 97,121, 32, 98,101, 32, 97,100,100,101,100, 32,116,111, 32,116,104,101, 10, 70,111,110,116,115, 44, 32, -111,110,108,121, 32,105,102, 32,116,104,101, 32,102,111,110,116,115, 32, 97,114,101, 32,114,101,110, 97,109,101,100, 32,116,111, - 32,110, 97,109,101,115, 32,110,111,116, 32, 99,111,110,116, 97,105,110,105,110,103, 32,101,105,116,104,101,114, 10,116,104,101, - 32,119,111,114,100,115, 32, 34, 84, 97,118,109,106,111,110,103, 32, 66, 97,104, 34, 32,111,114, 32,116,104,101, 32,119,111,114, -100, 32, 34, 65,114,101,118, 34, 46, 10, 10, 84,104,105,115, 32, 76,105, 99,101,110,115,101, 32, 98,101, 99,111,109,101,115, 32, -110,117,108,108, 32, 97,110,100, 32,118,111,105,100, 32,116,111, 32,116,104,101, 32,101,120,116,101,110,116, 32, 97,112,112,108, -105, 99, 97, 98,108,101, 32,116,111, 32, 70,111,110,116,115, 10,111,114, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, - 32,116,104, 97,116, 32,104, 97,115, 32, 98,101,101,110, 32,109,111,100,105,102,105,101,100, 32, 97,110,100, 32,105,115, 32,100, -105,115,116,114,105, 98,117,116,101,100, 32,117,110,100,101,114, 32,116,104,101, 32, 10, 34, 84, 97,118,109,106,111,110,103, 32, - 66, 97,104, 32, 65,114,101,118, 34, 32,110, 97,109,101,115, 46, 10, 10, 84,104,101, 32, 70,111,110,116, 32, 83,111,102,116,119, - 97,114,101, 32,109, 97,121, 32, 98,101, 32,115,111,108,100, 32, 97,115, 32,112, 97,114,116, 32,111,102, 32, 97, 32,108, 97,114, -103,101,114, 32,115,111,102,116,119, 97,114,101, 32,112, 97, 99,107, 97,103,101, 32, 98,117,116, 10,110,111, 32, 99,111,112,121, - 32,111,102, 32,111,110,101, 32,111,114, 32,109,111,114,101, 32,111,102, 32,116,104,101, 32, 70,111,110,116, 32, 83,111,102,116, -119, 97,114,101, 32,116,121,112,101,102, 97, 99,101,115, 32,109, 97,121, 32, 98,101, 32,115,111,108,100, 32, 98,121, 10,105,116, -115,101,108,102, 46, 10, 10, 84, 72, 69, 32, 70, 79, 78, 84, 32, 83, 79, 70, 84, 87, 65, 82, 69, 32, 73, 83, 32, 80, 82, 79, 86, - 73, 68, 69, 68, 32, 34, 65, 83, 32, 73, 83, 34, 44, 32, 87, 73, 84, 72, 79, 85, 84, 32, 87, 65, 82, 82, 65, 78, 84, 89, 32, 79, - 70, 32, 65, 78, 89, 32, 75, 73, 78, 68, 44, 10, 69, 88, 80, 82, 69, 83, 83, 32, 79, 82, 32, 73, 77, 80, 76, 73, 69, 68, 44, 32, - 73, 78, 67, 76, 85, 68, 73, 78, 71, 32, 66, 85, 84, 32, 78, 79, 84, 32, 76, 73, 77, 73, 84, 69, 68, 32, 84, 79, 32, 65, 78, 89, - 32, 87, 65, 82, 82, 65, 78, 84, 73, 69, 83, 32, 79, 70, 10, 77, 69, 82, 67, 72, 65, 78, 84, 65, 66, 73, 76, 73, 84, 89, 44, 32, - 70, 73, 84, 78, 69, 83, 83, 32, 70, 79, 82, 32, 65, 32, 80, 65, 82, 84, 73, 67, 85, 76, 65, 82, 32, 80, 85, 82, 80, 79, 83, 69, - 32, 65, 78, 68, 32, 78, 79, 78, 73, 78, 70, 82, 73, 78, 71, 69, 77, 69, 78, 84, 10, 79, 70, 32, 67, 79, 80, 89, 82, 73, 71, 72, - 84, 44, 32, 80, 65, 84, 69, 78, 84, 44, 32, 84, 82, 65, 68, 69, 77, 65, 82, 75, 44, 32, 79, 82, 32, 79, 84, 72, 69, 82, 32, 82, - 73, 71, 72, 84, 46, 32, 73, 78, 32, 78, 79, 32, 69, 86, 69, 78, 84, 32, 83, 72, 65, 76, 76, 10, 84, 65, 86, 77, 74, 79, 78, 71, - 32, 66, 65, 72, 32, 66, 69, 32, 76, 73, 65, 66, 76, 69, 32, 70, 79, 82, 32, 65, 78, 89, 32, 67, 76, 65, 73, 77, 44, 32, 68, 65, - 77, 65, 71, 69, 83, 32, 79, 82, 32, 79, 84, 72, 69, 82, 32, 76, 73, 65, 66, 73, 76, 73, 84, 89, 44, 10, 73, 78, 67, 76, 85, 68, - 73, 78, 71, 32, 65, 78, 89, 32, 71, 69, 78, 69, 82, 65, 76, 44, 32, 83, 80, 69, 67, 73, 65, 76, 44, 32, 73, 78, 68, 73, 82, 69, - 67, 84, 44, 32, 73, 78, 67, 73, 68, 69, 78, 84, 65, 76, 44, 32, 79, 82, 32, 67, 79, 78, 83, 69, 81, 85, 69, 78, 84, 73, 65, 76, - 10, 68, 65, 77, 65, 71, 69, 83, 44, 32, 87, 72, 69, 84, 72, 69, 82, 32, 73, 78, 32, 65, 78, 32, 65, 67, 84, 73, 79, 78, 32, 79, - 70, 32, 67, 79, 78, 84, 82, 65, 67, 84, 44, 32, 84, 79, 82, 84, 32, 79, 82, 32, 79, 84, 72, 69, 82, 87, 73, 83, 69, 44, 32, 65, - 82, 73, 83, 73, 78, 71, 10, 70, 82, 79, 77, 44, 32, 79, 85, 84, 32, 79, 70, 32, 84, 72, 69, 32, 85, 83, 69, 32, 79, 82, 32, 73, - 78, 65, 66, 73, 76, 73, 84, 89, 32, 84, 79, 32, 85, 83, 69, 32, 84, 72, 69, 32, 70, 79, 78, 84, 32, 83, 79, 70, 84, 87, 65, 82, - 69, 32, 79, 82, 32, 70, 82, 79, 77, 10, 79, 84, 72, 69, 82, 32, 68, 69, 65, 76, 73, 78, 71, 83, 32, 73, 78, 32, 84, 72, 69, 32, - 70, 79, 78, 84, 32, 83, 79, 70, 84, 87, 65, 82, 69, 46, 10, 10, 69,120, 99,101,112,116, 32, 97,115, 32, 99,111,110,116, 97,105, -110,101,100, 32,105,110, 32,116,104,105,115, 32,110,111,116,105, 99,101, 44, 32,116,104,101, 32,110, 97,109,101, 32,111,102, 32, - 84, 97,118,109,106,111,110,103, 32, 66, 97,104, 32,115,104, 97,108,108, 32,110,111,116, 10, 98,101, 32,117,115,101,100, 32,105, -110, 32, 97,100,118,101,114,116,105,115,105,110,103, 32,111,114, 32,111,116,104,101,114,119,105,115,101, 32,116,111, 32,112,114, -111,109,111,116,101, 32,116,104,101, 32,115, 97,108,101, 44, 32,117,115,101, 32,111,114, 32,111,116,104,101,114, 10,100,101, 97, -108,105,110,103,115, 32,105,110, 32,116,104,105,115, 32, 70,111,110,116, 32, 83,111,102,116,119, 97,114,101, 32,119,105,116,104, -111,117,116, 32,112,114,105,111,114, 32,119,114,105,116,116,101,110, 32, 97,117,116,104,111,114,105,122, 97,116,105,111,110, 10, -102,114,111,109, 32, 84, 97,118,109,106,111,110,103, 32, 66, 97,104, 46, 32, 70,111,114, 32,102,117,114,116,104,101,114, 32,105, -110,102,111,114,109, 97,116,105,111,110, 44, 32, 99,111,110,116, 97, 99,116, 58, 32,116, 97,118,109,106,111,110,103, 32, 64, 32, -102,114,101,101, 10, 46, 32,102,114, 46, 0, 0,104, 0,116, 0,116, 0,112, 0, 58, 0, 47, 0, 47, 0,100, 0,101, 0,106, 0, - 97, 0,118, 0,117, 0, 46, 0,115, 0,111, 0,117, 0,114, 0, 99, 0,101, 0,102, 0,111, 0,114, 0,103, 0,101, 0, 46, 0, -110, 0,101, 0,116, 0, 47, 0,119, 0,105, 0,107, 0,105, 0, 47, 0,105, 0,110, 0,100, 0,101, 0,120, 0, 46, 0,112, 0, -104, 0,112, 0, 47, 0, 76, 0,105, 0, 99, 0,101, 0,110, 0,115, 0,101, 0, 0,104,116,116,112, 58, 47, 47,100,101,106, 97, -118,117, 46,115,111,117,114, 99,101,102,111,114,103,101, 46,110,101,116, 47,119,105,107,105, 47,105,110,100,101,120, 46,112,104, -112, 47, 76,105, 99,101,110,115,101, 0, 65,108,108, 32, 84,121,112,111,103,114, 97,112,104,105, 99, 32, 70,101, 97,116,117,114, -101,115, 0, 70,111,110, 99,116,105,111,110,115, 32,116,121,112,111,103,114, 97,112,104,105,113,117,101,115, 0, 65,108,108,101, - 32,116,121,112,111,103,114, 97,102,105,115, 99,104,101,110, 32, 77,154,103,108,105, 99,104,107,101,105,116,101,110, 0, 70,117, -110,122,105,111,110,105, 32, 84,105,112,111,103,114, 97,102,105, 99,104,101, 0, 65,108,108,101, 32,116,121,112,111,103,114, 97, -102,105,115, 99,104,101, 32,107,101,110,109,101,114,107,101,110, 0, 76,105,103, 97,116,117,114,101,115, 0, 76,105,103, 97,116, -117,114,101,115, 0, 76,105,103, 97,116,117,114,101,110, 0, 76,101,103, 97,116,117,114,101, 0, 76,105,103, 97,116,117,114,101, -110, 0, 67,117,114,115,105,118,101, 32, 99,111,110,110,101, 99,116,105,111,110, 0, 67,111,110,110,101, 99,116,105,111,110, 32, -100,101,115, 32, 67,117,114,115,105,118,101,115, 0, 67,117,114,115,105,101,118,101, 32,118,101,114, 98,105,110,100,105,110,103, - 0, 70,114, 97, 99,116,105,111,110,115, 0, 70,114, 97, 99,116,105,111,110,115, 0, 66,114,101,117,107,101,110, 0, 65,108,108, - 32, 84,121,112,101, 32, 70,101, 97,116,117,114,101,115, 0, 84,111,117,116,101,115, 32,102,111,110, 99,116,105,111,110,115, 32, -116,121,112,111,103,114, 97,112,104,105,113,117,101,115, 0, 65,108,108,101, 32, 65,117,115,122,101,105, 99,104,110,117,110,103, -115, 97,114,116,101,110, 0, 84,117,116,116,101, 32,108,101, 32, 70,117,110,122,105,111,110,105, 0, 65,108,108,101, 32,116,121, -112,101,107,101,110,109,101,114,107,101,110, 0, 67,111,109,109,111,110, 32, 76,105,103, 97,116,117,114,101,115, 0, 76,105,103, - 97,116,117,114,101,115, 32, 85,115,117,101,108,108,101,115, 0, 78,111,114,109, 97,108,101, 32, 76,105,103, 97,116,117,114,101, -110, 0, 76,101,103, 97,116,117,114,101, 32,112,105,157, 32, 67,111,109,117,110,105, 0, 71,101,109,101,101,110,115, 99,104, 97, -112,112,101,108,105,106,107,101, 32, 76,105,103, 97,116,117,114,101,110, 0, 82, 97,114,101, 32, 76,105,103, 97,116,117,114,101, -115, 0, 76,105,103, 97,116,117,114,101,115, 32, 82, 97,114,101,115, 0, 83,101,108,116,101,110,101, 32, 76,105,103, 97,116,117, -114,101,110, 0, 76,101,103, 97,116,117,114,101, 32, 82, 97,114,101, 0, 90,101,108,100,122, 97,109,101, 32,108,105,103, 97,116, -117,114,101,110, 0, 67,117,114,115,105,118,101, 0, 80,108,101,105,110,101,109,101,110,116, 32, 99,111,110,110,101, 99,116,142, -101,115, 0, 67,117,114,115,105,101,102, 0, 68,105, 97,103,111,110, 97,108, 32, 70,114, 97, 99,116,105,111,110,115, 0, 70,114, - 97, 99,116,105,111,110,115, 32,101,110, 32, 68,105, 97,103,111,110, 97,108,101, 0, 68,105, 97,103,111,110, 97,108,101,114, 32, - 66,114,117, 99,104, 0, 70,114, 97,122,105,111,110,105, 32, 68,105, 97,103,111,110, 97,108,105, 0, 68,105, 97,103,111,110, 97, -108,101, 32, 98,114,101,117,107,101,110, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,255,171, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,163, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, - 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, - 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, 0, 32, 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, - 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, - 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 63, 0, 64, 0, 65, 0, 66, 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, 0, 72, - 0, 73, 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, 0, 86, 0, 87, 0, 88, - 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, 0, 94, 0, 95, 0, 96, 0, 97, 0,172, 0,163, 0,132, 0,133, 0,189, 0,150, 0,232, - 0,134, 0,142, 0,139, 0,157, 0,169, 0,164, 1, 2, 0,138, 0,218, 0,131, 0,147, 0,242, 0,243, 0,141, 0,151, 0,136, - 0,195, 0,222, 0,241, 0,158, 0,170, 0,245, 0,244, 0,246, 0,162, 0,173, 0,201, 0,199, 0,174, 0, 98, 0, 99, 0,144, - 0,100, 0,203, 0,101, 0,200, 0,202, 0,207, 0,204, 0,205, 0,206, 0,233, 0,102, 0,211, 0,208, 0,209, 0,175, 0,103, - 0,240, 0,145, 0,214, 0,212, 0,213, 0,104, 0,235, 0,237, 0,137, 0,106, 0,105, 0,107, 0,109, 0,108, 0,110, 0,160, - 0,111, 0,113, 0,112, 0,114, 0,115, 0,117, 0,116, 0,118, 0,119, 0,234, 0,120, 0,122, 0,121, 0,123, 0,125, 0,124, - 0,184, 0,161, 0,127, 0,126, 0,128, 0,129, 0,236, 0,238, 0,186, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 0,253, - 0,254, 1, 9, 1, 10, 1, 11, 1, 12, 0,255, 1, 0, 1, 13, 1, 14, 1, 15, 1, 1, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, - 1, 21, 1, 22, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 0,248, 0,249, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 33, 1, 34, - 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 0,250, 0,215, 1, 44, 1, 45, 1, 46, 1, 47, 1, 48, - 1, 49, 1, 50, 1, 51, 1, 52, 1, 53, 1, 54, 1, 55, 1, 56, 1, 57, 1, 58, 0,226, 0,227, 1, 59, 1, 60, 1, 61, 1, 62, - 1, 63, 1, 64, 1, 65, 1, 66, 1, 67, 1, 68, 1, 69, 1, 70, 1, 71, 1, 72, 1, 73, 0,176, 0,177, 1, 74, 1, 75, 1, 76, - 1, 77, 1, 78, 1, 79, 1, 80, 1, 81, 1, 82, 1, 83, 0,251, 0,252, 0,228, 0,229, 1, 84, 1, 85, 1, 86, 1, 87, 1, 88, - 1, 89, 1, 90, 1, 91, 1, 92, 1, 93, 1, 94, 1, 95, 1, 96, 1, 97, 1, 98, 1, 99, 1,100, 1,101, 1,102, 1,103, 1,104, - 1,105, 0,187, 1,106, 1,107, 1,108, 1,109, 0,230, 0,231, 1,110, 1,111, 1,112, 1,113, 1,114, 1,115, 1,116, 1,117, - 1,118, 1,119, 1,120, 1,121, 1,122, 1,123, 1,124, 1,125, 1,126, 1,127, 1,128, 0,166, 1,129, 1,130, 1,131, 1,132, - 1,133, 1,134, 1,135, 1,136, 1,137, 1,138, 1,139, 1,140, 1,141, 1,142, 1,143, 1,144, 1,145, 1,146, 1,147, 1,148, - 1,149, 1,150, 1,151, 1,152, 1,153, 1,154, 1,155, 1,156, 1,157, 1,158, 1,159, 1,160, 1,161, 1,162, 1,163, 1,164, - 1,165, 1,166, 1,167, 1,168, 1,169, 1,170, 1,171, 1,172, 1,173, 1,174, 1,175, 1,176, 1,177, 1,178, 1,179, 1,180, - 1,181, 1,182, 1,183, 1,184, 1,185, 1,186, 1,187, 1,188, 1,189, 1,190, 1,191, 1,192, 1,193, 1,194, 1,195, 1,196, - 1,197, 1,198, 1,199, 1,200, 1,201, 1,202, 1,203, 1,204, 1,205, 1,206, 1,207, 1,208, 1,209, 1,210, 1,211, 1,212, - 1,213, 1,214, 1,215, 1,216, 1,217, 1,218, 1,219, 1,220, 1,221, 1,222, 1,223, 1,224, 1,225, 1,226, 1,227, 1,228, - 1,229, 1,230, 1,231, 1,232, 1,233, 1,234, 1,235, 1,236, 1,237, 1,238, 1,239, 1,240, 1,241, 1,242, 1,243, 1,244, - 1,245, 1,246, 1,247, 1,248, 1,249, 1,250, 1,251, 1,252, 1,253, 1,254, 1,255, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, - 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 2, 11, 2, 12, 2, 13, 2, 14, 2, 15, 2, 16, 2, 17, 2, 18, 2, 19, 2, 20, - 2, 21, 2, 22, 2, 23, 2, 24, 2, 25, 2, 26, 2, 27, 2, 28, 2, 29, 2, 30, 2, 31, 2, 32, 2, 33, 2, 34, 2, 35, 2, 36, - 2, 37, 2, 38, 2, 39, 2, 40, 2, 41, 2, 42, 2, 43, 2, 44, 2, 45, 2, 46, 2, 47, 2, 48, 2, 49, 2, 50, 2, 51, 2, 52, - 2, 53, 2, 54, 2, 55, 2, 56, 2, 57, 2, 58, 2, 59, 2, 60, 2, 61, 2, 62, 2, 63, 2, 64, 2, 65, 2, 66, 2, 67, 2, 68, - 2, 69, 2, 70, 2, 71, 2, 72, 2, 73, 2, 74, 0,216, 0,225, 2, 75, 2, 76, 2, 77, 2, 78, 2, 79, 2, 80, 2, 81, 2, 82, - 2, 83, 2, 84, 2, 85, 2, 86, 2, 87, 2, 88, 2, 89, 2, 90, 0,219, 0,220, 0,221, 0,224, 0,217, 0,223, 2, 91, 2, 92, - 2, 93, 2, 94, 2, 95, 2, 96, 2, 97, 2, 98, 2, 99, 2,100, 2,101, 2,102, 2,103, 2,104, 2,105, 2,106, 2,107, 2,108, - 2,109, 2,110, 2,111, 2,112, 2,113, 2,114, 2,115, 2,116, 2,117, 2,118, 2,119, 2,120, 2,121, 2,122, 2,123, 2,124, - 2,125, 2,126, 2,127, 2,128, 2,129, 2,130, 2,131, 2,132, 2,133, 2,134, 2,135, 2,136, 2,137, 2,138, 2,139, 2,140, - 2,141, 2,142, 2,143, 2,144, 2,145, 2,146, 2,147, 2,148, 2,149, 2,150, 2,151, 2,152, 2,153, 2,154, 2,155, 2,156, - 2,157, 2,158, 2,159, 2,160, 2,161, 2,162, 2,163, 2,164, 2,165, 2,166, 2,167, 2,168, 2,169, 2,170, 2,171, 2,172, - 2,173, 2,174, 2,175, 2,176, 2,177, 2,178, 2,179, 2,180, 2,181, 2,182, 2,183, 2,184, 2,185, 2,186, 2,187, 2,188, - 2,189, 2,190, 2,191, 2,192, 2,193, 2,194, 2,195, 2,196, 2,197, 2,198, 2,199, 2,200, 2,201, 2,202, 2,203, 2,204, - 2,205, 2,206, 2,207, 2,208, 2,209, 2,210, 2,211, 2,212, 2,213, 2,214, 2,215, 2,216, 2,217, 2,218, 2,219, 2,220, - 2,221, 2,222, 2,223, 2,224, 2,225, 2,226, 2,227, 2,228, 2,229, 2,230, 2,231, 2,232, 2,233, 2,234, 0,159, 2,235, - 2,236, 2,237, 2,238, 2,239, 2,240, 2,241, 2,242, 2,243, 2,244, 2,245, 2,246, 2,247, 2,248, 2,249, 2,250, 2,251, - 2,252, 2,253, 2,254, 2,255, 3, 0, 0,155, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3, 10, - 3, 11, 3, 12, 3, 13, 3, 14, 3, 15, 3, 16, 3, 17, 3, 18, 3, 19, 3, 20, 3, 21, 3, 22, 3, 23, 3, 24, 3, 25, 3, 26, - 3, 27, 3, 28, 3, 29, 3, 30, 3, 31, 3, 32, 3, 33, 3, 34, 3, 35, 3, 36, 3, 37, 3, 38, 3, 39, 3, 40, 3, 41, 3, 42, - 3, 43, 3, 44, 3, 45, 3, 46, 3, 47, 3, 48, 3, 49, 3, 50, 3, 51, 3, 52, 3, 53, 3, 54, 3, 55, 3, 56, 3, 57, 3, 58, - 3, 59, 3, 60, 3, 61, 3, 62, 3, 63, 3, 64, 3, 65, 3, 66, 3, 67, 3, 68, 3, 69, 3, 70, 3, 71, 3, 72, 3, 73, 3, 74, - 3, 75, 3, 76, 3, 77, 3, 78, 3, 79, 3, 80, 3, 81, 3, 82, 3, 83, 3, 84, 3, 85, 3, 86, 3, 87, 3, 88, 3, 89, 3, 90, - 3, 91, 3, 92, 3, 93, 3, 94, 3, 95, 3, 96, 3, 97, 3, 98, 3, 99, 3,100, 3,101, 3,102, 3,103, 3,104, 3,105, 3,106, - 3,107, 3,108, 3,109, 3,110, 3,111, 3,112, 3,113, 3,114, 3,115, 3,116, 3,117, 3,118, 3,119, 3,120, 3,121, 3,122, - 3,123, 3,124, 3,125, 3,126, 3,127, 3,128, 3,129, 3,130, 3,131, 3,132, 3,133, 3,134, 3,135, 3,136, 3,137, 3,138, - 3,139, 3,140, 3,141, 3,142, 3,143, 3,144, 3,145, 3,146, 3,147, 3,148, 3,149, 3,150, 3,151, 3,152, 3,153, 3,154, - 3,155, 3,156, 3,157, 3,158, 3,159, 3,160, 3,161, 3,162, 3,163, 3,164, 3,165, 3,166, 3,167, 3,168, 3,169, 3,170, - 3,171, 3,172, 3,173, 3,174, 3,175, 3,176, 3,177, 3,178, 3,179, 3,180, 3,181, 3,182, 3,183, 3,184, 3,185, 3,186, - 3,187, 3,188, 3,189, 3,190, 3,191, 3,192, 3,193, 3,194, 3,195, 3,196, 3,197, 3,198, 3,199, 3,200, 3,201, 3,202, - 3,203, 3,204, 3,205, 3,206, 3,207, 3,208, 3,209, 3,210, 3,211, 3,212, 3,213, 3,214, 3,215, 3,216, 3,217, 3,218, - 3,219, 3,220, 3,221, 3,222, 3,223, 3,224, 3,225, 3,226, 3,227, 3,228, 3,229, 3,230, 3,231, 3,232, 3,233, 3,234, - 3,235, 3,236, 3,237, 3,238, 3,239, 3,240, 3,241, 3,242, 3,243, 3,244, 3,245, 3,246, 3,247, 3,248, 3,249, 3,250, - 3,251, 3,252, 3,253, 3,254, 3,255, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4, 10, - 4, 11, 4, 12, 4, 13, 4, 14, 4, 15, 4, 16, 4, 17, 4, 18, 4, 19, 4, 20, 4, 21, 4, 22, 4, 23, 4, 24, 4, 25, 4, 26, - 4, 27, 4, 28, 4, 29, 4, 30, 4, 31, 4, 32, 4, 33, 4, 34, 4, 35, 4, 36, 4, 37, 4, 38, 4, 39, 4, 40, 4, 41, 4, 42, - 4, 43, 4, 44, 4, 45, 4, 46, 4, 47, 4, 48, 4, 49, 4, 50, 4, 51, 4, 52, 4, 53, 4, 54, 4, 55, 4, 56, 4, 57, 4, 58, - 4, 59, 4, 60, 4, 61, 4, 62, 4, 63, 4, 64, 4, 65, 4, 66, 4, 67, 4, 68, 4, 69, 4, 70, 4, 71, 4, 72, 4, 73, 4, 74, - 4, 75, 4, 76, 4, 77, 4, 78, 4, 79, 4, 80, 4, 81, 4, 82, 4, 83, 4, 84, 4, 85, 4, 86, 4, 87, 4, 88, 4, 89, 4, 90, - 4, 91, 4, 92, 4, 93, 4, 94, 4, 95, 4, 96, 4, 97, 4, 98, 4, 99, 4,100, 4,101, 4,102, 4,103, 4,104, 4,105, 4,106, - 4,107, 4,108, 4,109, 4,110, 4,111, 4,112, 4,113, 4,114, 4,115, 4,116, 4,117, 4,118, 4,119, 4,120, 4,121, 4,122, - 4,123, 4,124, 4,125, 4,126, 4,127, 4,128, 4,129, 4,130, 4,131, 4,132, 4,133, 4,134, 4,135, 4,136, 4,137, 4,138, - 4,139, 4,140, 4,141, 4,142, 4,143, 4,144, 4,145, 4,146, 4,147, 4,148, 4,149, 4,150, 4,151, 4,152, 4,153, 4,154, - 4,155, 4,156, 4,157, 4,158, 4,159, 4,160, 4,161, 4,162, 4,163, 4,164, 4,165, 4,166, 4,167, 4,168, 4,169, 4,170, - 4,171, 4,172, 4,173, 4,174, 4,175, 4,176, 4,177, 4,178, 4,179, 4,180, 4,181, 4,182, 4,183, 4,184, 4,185, 4,186, - 4,187, 4,188, 4,189, 4,190, 4,191, 4,192, 4,193, 4,194, 4,195, 4,196, 4,197, 4,198, 4,199, 4,200, 4,201, 4,202, - 4,203, 4,204, 4,205, 4,206, 4,207, 4,208, 4,209, 4,210, 4,211, 4,212, 4,213, 4,214, 4,215, 4,216, 4,217, 4,218, - 4,219, 4,220, 4,221, 4,222, 4,223, 4,224, 4,225, 4,226, 4,227, 4,228, 4,229, 4,230, 4,231, 4,232, 4,233, 4,234, - 4,235, 4,236, 4,237, 4,238, 4,239, 4,240, 4,241, 4,242, 4,243, 4,244, 4,245, 4,246, 4,247, 4,248, 4,249, 4,250, - 4,251, 4,252, 4,253, 4,254, 4,255, 5, 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 5, 6, 5, 7, 5, 8, 5, 9, 5, 10, - 5, 11, 5, 12, 5, 13, 5, 14, 5, 15, 5, 16, 5, 17, 5, 18, 5, 19, 5, 20, 5, 21, 5, 22, 5, 23, 5, 24, 5, 25, 5, 26, - 5, 27, 5, 28, 5, 29, 5, 30, 5, 31, 5, 32, 5, 33, 5, 34, 5, 35, 5, 36, 5, 37, 5, 38, 5, 39, 5, 40, 5, 41, 5, 42, - 5, 43, 5, 44, 5, 45, 5, 46, 5, 47, 5, 48, 5, 49, 5, 50, 5, 51, 5, 52, 5, 53, 5, 54, 5, 55, 5, 56, 5, 57, 5, 58, - 5, 59, 5, 60, 5, 61, 5, 62, 5, 63, 5, 64, 5, 65, 5, 66, 5, 67, 5, 68, 5, 69, 5, 70, 5, 71, 5, 72, 5, 73, 5, 74, - 5, 75, 5, 76, 5, 77, 5, 78, 5, 79, 5, 80, 5, 81, 5, 82, 5, 83, 5, 84, 5, 85, 5, 86, 5, 87, 5, 88, 5, 89, 5, 90, - 5, 91, 5, 92, 5, 93, 5, 94, 5, 95, 5, 96, 5, 97, 5, 98, 5, 99, 5,100, 5,101, 5,102, 5,103, 5,104, 5,105, 5,106, - 5,107, 5,108, 5,109, 5,110, 5,111, 5,112, 5,113, 5,114, 5,115, 5,116, 5,117, 5,118, 5,119, 5,120, 5,121, 5,122, - 5,123, 5,124, 5,125, 5,126, 5,127, 5,128, 5,129, 5,130, 5,131, 5,132, 5,133, 5,134, 5,135, 5,136, 5,137, 5,138, - 5,139, 5,140, 5,141, 5,142, 5,143, 5,144, 5,145, 5,146, 5,147, 5,148, 5,149, 5,150, 5,151, 5,152, 5,153, 5,154, - 5,155, 5,156, 5,157, 5,158, 5,159, 5,160, 5,161, 5,162, 5,163, 5,164, 5,165, 5,166, 5,167, 5,168, 5,169, 0,178, - 0,179, 5,170, 5,171, 5,172, 0,182, 0,183, 0,196, 5,173, 0,180, 0,181, 0,197, 5,174, 0,130, 0,194, 0,135, 5,175, - 5,176, 5,177, 0,171, 5,178, 0,198, 5,179, 5,180, 5,181, 5,182, 5,183, 5,184, 5,185, 5,186, 0,190, 0,191, 5,187, - 5,188, 5,189, 5,190, 5,191, 5,192, 5,193, 5,194, 5,195, 0,188, 5,196, 5,197, 5,198, 5,199, 5,200, 5,201, 5,202, - 5,203, 5,204, 5,205, 5,206, 5,207, 5,208, 5,209, 5,210, 5,211, 5,212, 5,213, 5,214, 5,215, 5,216, 5,217, 5,218, - 5,219, 5,220, 5,221, 5,222, 5,223, 5,224, 5,225, 5,226, 5,227, 5,228, 5,229, 5,230, 5,231, 5,232, 5,233, 5,234, - 5,235, 5,236, 5,237, 5,238, 5,239, 5,240, 5,241, 5,242, 5,243, 5,244, 5,245, 5,246, 5,247, 5,248, 5,249, 5,250, - 5,251, 5,252, 5,253, 0,247, 5,254, 5,255, 6, 0, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, - 6, 10, 6, 11, 6, 12, 6, 13, 6, 14, 6, 15, 6, 16, 6, 17, 6, 18, 6, 19, 6, 20, 6, 21, 6, 22, 6, 23, 6, 24, 6, 25, - 6, 26, 6, 27, 6, 28, 6, 29, 6, 30, 6, 31, 6, 32, 0,140, 6, 33, 6, 34, 6, 35, 6, 36, 6, 37, 6, 38, 6, 39, 6, 40, - 6, 41, 6, 42, 6, 43, 6, 44, 6, 45, 6, 46, 6, 47, 6, 48, 6, 49, 6, 50, 6, 51, 6, 52, 6, 53, 6, 54, 6, 55, 6, 56, - 6, 57, 6, 58, 6, 59, 6, 60, 6, 61, 6, 62, 6, 63, 6, 64, 6, 65, 6, 66, 6, 67, 6, 68, 6, 69, 6, 70, 6, 71, 6, 72, - 6, 73, 6, 74, 6, 75, 6, 76, 6, 77, 6, 78, 6, 79, 6, 80, 6, 81, 6, 82, 6, 83, 6, 84, 6, 85, 6, 86, 6, 87, 6, 88, - 6, 89, 6, 90, 6, 91, 6, 92, 6, 93, 6, 94, 6, 95, 6, 96, 6, 97, 6, 98, 6, 99, 6,100, 6,101, 6,102, 0,239, 6,103, - 6,104, 0,188, 6,105, 6,106, 6,107, 0,195, 0,165, 6,108, 6,109, 6,110, 0,146, 6,111, 6,112, 6,113, 6,114, 6,115, - 6,116, 6,117, 6,118, 6,119, 6,120, 6,121, 6,122, 6,123, 6,124, 6,125, 6,126, 6,127, 6,128, 6,129, 0,192, 0,193, - 6,130, 6,131, 6,132, 6,133, 6,134, 6,135, 6,136, 6,137, 6,138, 6,139, 6,140, 6,141, 6,142, 6,143, 6,144, 6,145, - 6,146, 6,147, 6,148, 6,149, 6,150, 6,151, 6,152, 6,153, 6,154, 6,155, 6,156, 6,157, 6,158, 6,159, 6,160, 6,161, - 6,162, 6,163, 6,164, 6,165, 6,166, 6,167, 6,168, 6,169, 6,170, 6,171, 9,115,102,116,104,121,112,104,101,110, 7, 65, -109, 97, 99,114,111,110, 7, 97,109, 97, 99,114,111,110, 6, 65, 98,114,101,118,101, 6, 97, 98,114,101,118,101, 7, 65,111,103, -111,110,101,107, 7, 97,111,103,111,110,101,107, 11, 67, 99,105,114, 99,117,109,102,108,101,120, 11, 99, 99,105,114, 99,117,109, -102,108,101,120, 10, 67,100,111,116, 97, 99, 99,101,110,116, 10, 99,100,111,116, 97, 99, 99,101,110,116, 6, 68, 99, 97,114,111, -110, 6,100, 99, 97,114,111,110, 6, 68, 99,114,111, 97,116, 7, 69,109, 97, 99,114,111,110, 7,101,109, 97, 99,114,111,110, 6, - 69, 98,114,101,118,101, 6,101, 98,114,101,118,101, 10, 69,100,111,116, 97, 99, 99,101,110,116, 10,101,100,111,116, 97, 99, 99, -101,110,116, 7, 69,111,103,111,110,101,107, 7,101,111,103,111,110,101,107, 6, 69, 99, 97,114,111,110, 6,101, 99, 97,114,111, -110, 11, 71, 99,105,114, 99,117,109,102,108,101,120, 11,103, 99,105,114, 99,117,109,102,108,101,120, 10, 71,100,111,116, 97, 99, - 99,101,110,116, 10,103,100,111,116, 97, 99, 99,101,110,116, 12, 71, 99,111,109,109, 97, 97, 99, 99,101,110,116, 12,103, 99,111, -109,109, 97, 97, 99, 99,101,110,116, 11, 72, 99,105,114, 99,117,109,102,108,101,120, 11,104, 99,105,114, 99,117,109,102,108,101, -120, 4, 72, 98, 97,114, 4,104, 98, 97,114, 6, 73,116,105,108,100,101, 6,105,116,105,108,100,101, 7, 73,109, 97, 99,114,111, -110, 7,105,109, 97, 99,114,111,110, 6, 73, 98,114,101,118,101, 6,105, 98,114,101,118,101, 7, 73,111,103,111,110,101,107, 7, -105,111,103,111,110,101,107, 2, 73, 74, 2,105,106, 11, 74, 99,105,114, 99,117,109,102,108,101,120, 11,106, 99,105,114, 99,117, -109,102,108,101,120, 12, 75, 99,111,109,109, 97, 97, 99, 99,101,110,116, 12,107, 99,111,109,109, 97, 97, 99, 99,101,110,116, 12, -107,103,114,101,101,110,108, 97,110,100,105, 99, 6, 76, 97, 99,117,116,101, 6,108, 97, 99,117,116,101, 12, 76, 99,111,109,109, - 97, 97, 99, 99,101,110,116, 12,108, 99,111,109,109, 97, 97, 99, 99,101,110,116, 6, 76, 99, 97,114,111,110, 6,108, 99, 97,114, -111,110, 4, 76,100,111,116, 4,108,100,111,116, 6, 78, 97, 99,117,116,101, 6,110, 97, 99,117,116,101, 12, 78, 99,111,109,109, - 97, 97, 99, 99,101,110,116, 12,110, 99,111,109,109, 97, 97, 99, 99,101,110,116, 6, 78, 99, 97,114,111,110, 6,110, 99, 97,114, -111,110, 11,110, 97,112,111,115,116,114,111,112,104,101, 3, 69,110,103, 3,101,110,103, 7, 79,109, 97, 99,114,111,110, 7,111, -109, 97, 99,114,111,110, 6, 79, 98,114,101,118,101, 6,111, 98,114,101,118,101, 13, 79,104,117,110,103, 97,114,117,109,108, 97, -117,116, 13,111,104,117,110,103, 97,114,117,109,108, 97,117,116, 6, 82, 97, 99,117,116,101, 6,114, 97, 99,117,116,101, 12, 82, - 99,111,109,109, 97, 97, 99, 99,101,110,116, 12,114, 99,111,109,109, 97, 97, 99, 99,101,110,116, 6, 82, 99, 97,114,111,110, 6, -114, 99, 97,114,111,110, 6, 83, 97, 99,117,116,101, 6,115, 97, 99,117,116,101, 11, 83, 99,105,114, 99,117,109,102,108,101,120, - 11,115, 99,105,114, 99,117,109,102,108,101,120, 12, 84, 99,111,109,109, 97, 97, 99, 99,101,110,116, 12,116, 99,111,109,109, 97, - 97, 99, 99,101,110,116, 6, 84, 99, 97,114,111,110, 6,116, 99, 97,114,111,110, 4, 84, 98, 97,114, 4,116, 98, 97,114, 6, 85, -116,105,108,100,101, 6,117,116,105,108,100,101, 7, 85,109, 97, 99,114,111,110, 7,117,109, 97, 99,114,111,110, 6, 85, 98,114, -101,118,101, 6,117, 98,114,101,118,101, 5, 85,114,105,110,103, 5,117,114,105,110,103, 13, 85,104,117,110,103, 97,114,117,109, -108, 97,117,116, 13,117,104,117,110,103, 97,114,117,109,108, 97,117,116, 7, 85,111,103,111,110,101,107, 7,117,111,103,111,110, -101,107, 11, 87, 99,105,114, 99,117,109,102,108,101,120, 11,119, 99,105,114, 99,117,109,102,108,101,120, 11, 89, 99,105,114, 99, -117,109,102,108,101,120, 11,121, 99,105,114, 99,117,109,102,108,101,120, 6, 90, 97, 99,117,116,101, 6,122, 97, 99,117,116,101, - 10, 90,100,111,116, 97, 99, 99,101,110,116, 10,122,100,111,116, 97, 99, 99,101,110,116, 5,108,111,110,103,115, 7,117,110,105, - 48, 49, 56, 48, 7,117,110,105, 48, 49, 56, 49, 7,117,110,105, 48, 49, 56, 50, 7,117,110,105, 48, 49, 56, 51, 7,117,110,105, - 48, 49, 56, 52, 7,117,110,105, 48, 49, 56, 53, 7,117,110,105, 48, 49, 56, 54, 7,117,110,105, 48, 49, 56, 55, 7,117,110,105, - 48, 49, 56, 56, 7,117,110,105, 48, 49, 56, 57, 7,117,110,105, 48, 49, 56, 65, 7,117,110,105, 48, 49, 56, 66, 7,117,110,105, - 48, 49, 56, 67, 7,117,110,105, 48, 49, 56, 68, 7,117,110,105, 48, 49, 56, 69, 7,117,110,105, 48, 49, 56, 70, 7,117,110,105, - 48, 49, 57, 48, 7,117,110,105, 48, 49, 57, 49, 7,117,110,105, 48, 49, 57, 51, 7,117,110,105, 48, 49, 57, 52, 7,117,110,105, - 48, 49, 57, 53, 7,117,110,105, 48, 49, 57, 54, 7,117,110,105, 48, 49, 57, 55, 7,117,110,105, 48, 49, 57, 56, 7,117,110,105, - 48, 49, 57, 57, 7,117,110,105, 48, 49, 57, 65, 7,117,110,105, 48, 49, 57, 66, 7,117,110,105, 48, 49, 57, 67, 7,117,110,105, - 48, 49, 57, 68, 7,117,110,105, 48, 49, 57, 69, 7,117,110,105, 48, 49, 57, 70, 5, 79,104,111,114,110, 5,111,104,111,114,110, - 7,117,110,105, 48, 49, 65, 50, 7,117,110,105, 48, 49, 65, 51, 7,117,110,105, 48, 49, 65, 52, 7,117,110,105, 48, 49, 65, 53, - 7,117,110,105, 48, 49, 65, 54, 7,117,110,105, 48, 49, 65, 55, 7,117,110,105, 48, 49, 65, 56, 7,117,110,105, 48, 49, 65, 57, - 7,117,110,105, 48, 49, 65, 65, 7,117,110,105, 48, 49, 65, 66, 7,117,110,105, 48, 49, 65, 67, 7,117,110,105, 48, 49, 65, 68, - 7,117,110,105, 48, 49, 65, 69, 5, 85,104,111,114,110, 5,117,104,111,114,110, 7,117,110,105, 48, 49, 66, 49, 7,117,110,105, - 48, 49, 66, 50, 7,117,110,105, 48, 49, 66, 51, 7,117,110,105, 48, 49, 66, 52, 7,117,110,105, 48, 49, 66, 53, 7,117,110,105, - 48, 49, 66, 54, 7,117,110,105, 48, 49, 66, 55, 7,117,110,105, 48, 49, 66, 56, 7,117,110,105, 48, 49, 66, 57, 7,117,110,105, - 48, 49, 66, 65, 7,117,110,105, 48, 49, 66, 66, 7,117,110,105, 48, 49, 66, 67, 7,117,110,105, 48, 49, 66, 68, 7,117,110,105, - 48, 49, 66, 69, 7,117,110,105, 48, 49, 66, 70, 7,117,110,105, 48, 49, 67, 48, 7,117,110,105, 48, 49, 67, 49, 7,117,110,105, - 48, 49, 67, 50, 7,117,110,105, 48, 49, 67, 51, 7,117,110,105, 48, 49, 67, 52, 7,117,110,105, 48, 49, 67, 53, 7,117,110,105, - 48, 49, 67, 54, 7,117,110,105, 48, 49, 67, 55, 7,117,110,105, 48, 49, 67, 56, 7,117,110,105, 48, 49, 67, 57, 7,117,110,105, - 48, 49, 67, 65, 7,117,110,105, 48, 49, 67, 66, 7,117,110,105, 48, 49, 67, 67, 7,117,110,105, 48, 49, 67, 68, 7,117,110,105, - 48, 49, 67, 69, 7,117,110,105, 48, 49, 67, 70, 7,117,110,105, 48, 49, 68, 48, 7,117,110,105, 48, 49, 68, 49, 7,117,110,105, - 48, 49, 68, 50, 7,117,110,105, 48, 49, 68, 51, 7,117,110,105, 48, 49, 68, 52, 7,117,110,105, 48, 49, 68, 53, 7,117,110,105, - 48, 49, 68, 54, 7,117,110,105, 48, 49, 68, 55, 7,117,110,105, 48, 49, 68, 56, 7,117,110,105, 48, 49, 68, 57, 7,117,110,105, - 48, 49, 68, 65, 7,117,110,105, 48, 49, 68, 66, 7,117,110,105, 48, 49, 68, 67, 7,117,110,105, 48, 49, 68, 68, 7,117,110,105, - 48, 49, 68, 69, 7,117,110,105, 48, 49, 68, 70, 7,117,110,105, 48, 49, 69, 48, 7,117,110,105, 48, 49, 69, 49, 7,117,110,105, - 48, 49, 69, 50, 7,117,110,105, 48, 49, 69, 51, 7,117,110,105, 48, 49, 69, 52, 7,117,110,105, 48, 49, 69, 53, 6, 71, 99, 97, -114,111,110, 6,103, 99, 97,114,111,110, 7,117,110,105, 48, 49, 69, 56, 7,117,110,105, 48, 49, 69, 57, 7,117,110,105, 48, 49, - 69, 65, 7,117,110,105, 48, 49, 69, 66, 7,117,110,105, 48, 49, 69, 67, 7,117,110,105, 48, 49, 69, 68, 7,117,110,105, 48, 49, - 69, 69, 7,117,110,105, 48, 49, 69, 70, 7,117,110,105, 48, 49, 70, 48, 7,117,110,105, 48, 49, 70, 49, 7,117,110,105, 48, 49, - 70, 50, 7,117,110,105, 48, 49, 70, 51, 7,117,110,105, 48, 49, 70, 52, 7,117,110,105, 48, 49, 70, 53, 7,117,110,105, 48, 49, - 70, 54, 7,117,110,105, 48, 49, 70, 55, 7,117,110,105, 48, 49, 70, 56, 7,117,110,105, 48, 49, 70, 57, 10, 65,114,105,110,103, - 97, 99,117,116,101, 10, 97,114,105,110,103, 97, 99,117,116,101, 7, 65, 69, 97, 99,117,116,101, 7, 97,101, 97, 99,117,116,101, - 11, 79,115,108, 97,115,104, 97, 99,117,116,101, 11,111,115,108, 97,115,104, 97, 99,117,116,101, 7,117,110,105, 48, 50, 48, 48, - 7,117,110,105, 48, 50, 48, 49, 7,117,110,105, 48, 50, 48, 50, 7,117,110,105, 48, 50, 48, 51, 7,117,110,105, 48, 50, 48, 52, - 7,117,110,105, 48, 50, 48, 53, 7,117,110,105, 48, 50, 48, 54, 7,117,110,105, 48, 50, 48, 55, 7,117,110,105, 48, 50, 48, 56, - 7,117,110,105, 48, 50, 48, 57, 7,117,110,105, 48, 50, 48, 65, 7,117,110,105, 48, 50, 48, 66, 7,117,110,105, 48, 50, 48, 67, - 7,117,110,105, 48, 50, 48, 68, 7,117,110,105, 48, 50, 48, 69, 7,117,110,105, 48, 50, 48, 70, 7,117,110,105, 48, 50, 49, 48, - 7,117,110,105, 48, 50, 49, 49, 7,117,110,105, 48, 50, 49, 50, 7,117,110,105, 48, 50, 49, 51, 7,117,110,105, 48, 50, 49, 52, - 7,117,110,105, 48, 50, 49, 53, 7,117,110,105, 48, 50, 49, 54, 7,117,110,105, 48, 50, 49, 55, 12, 83, 99,111,109,109, 97, 97, - 99, 99,101,110,116, 12,115, 99,111,109,109, 97, 97, 99, 99,101,110,116, 7,117,110,105, 48, 50, 49, 65, 7,117,110,105, 48, 50, - 49, 66, 7,117,110,105, 48, 50, 49, 67, 7,117,110,105, 48, 50, 49, 68, 7,117,110,105, 48, 50, 49, 69, 7,117,110,105, 48, 50, - 49, 70, 7,117,110,105, 48, 50, 50, 48, 7,117,110,105, 48, 50, 50, 49, 7,117,110,105, 48, 50, 50, 50, 7,117,110,105, 48, 50, - 50, 51, 7,117,110,105, 48, 50, 50, 52, 7,117,110,105, 48, 50, 50, 53, 7,117,110,105, 48, 50, 50, 54, 7,117,110,105, 48, 50, - 50, 55, 7,117,110,105, 48, 50, 50, 56, 7,117,110,105, 48, 50, 50, 57, 7,117,110,105, 48, 50, 50, 65, 7,117,110,105, 48, 50, - 50, 66, 7,117,110,105, 48, 50, 50, 67, 7,117,110,105, 48, 50, 50, 68, 7,117,110,105, 48, 50, 50, 69, 7,117,110,105, 48, 50, - 50, 70, 7,117,110,105, 48, 50, 51, 48, 7,117,110,105, 48, 50, 51, 49, 7,117,110,105, 48, 50, 51, 50, 7,117,110,105, 48, 50, - 51, 51, 7,117,110,105, 48, 50, 51, 52, 7,117,110,105, 48, 50, 51, 53, 7,117,110,105, 48, 50, 51, 54, 8,100,111,116,108,101, -115,115,106, 7,117,110,105, 48, 50, 51, 56, 7,117,110,105, 48, 50, 51, 57, 7,117,110,105, 48, 50, 51, 65, 7,117,110,105, 48, - 50, 51, 66, 7,117,110,105, 48, 50, 51, 67, 7,117,110,105, 48, 50, 51, 68, 7,117,110,105, 48, 50, 51, 69, 7,117,110,105, 48, - 50, 51, 70, 7,117,110,105, 48, 50, 52, 48, 7,117,110,105, 48, 50, 52, 49, 7,117,110,105, 48, 50, 53, 57, 7,117,110,105, 48, - 50, 54, 50, 7,117,110,105, 48, 50, 55, 48, 7,117,110,105, 48, 50, 55, 53, 7,117,110,105, 48, 50, 57, 50, 7,117,110,105, 48, - 50, 66, 48, 7,117,110,105, 48, 50, 66, 49, 7,117,110,105, 48, 50, 66, 50, 7,117,110,105, 48, 50, 66, 51, 7,117,110,105, 48, - 50, 66, 52, 7,117,110,105, 48, 50, 66, 53, 7,117,110,105, 48, 50, 66, 54, 7,117,110,105, 48, 50, 66, 55, 7,117,110,105, 48, - 50, 66, 56, 7,117,110,105, 48, 50, 66, 57, 7,117,110,105, 48, 50, 66, 65, 7,117,110,105, 48, 50, 66, 66, 9, 97,102,105,105, - 53, 55, 57, 50, 57, 9, 97,102,105,105, 54, 52, 57, 51, 55, 7,117,110,105, 48, 50, 66, 69, 7,117,110,105, 48, 50, 66, 70, 7, -117,110,105, 48, 50, 67, 48, 7,117,110,105, 48, 50, 67, 49, 7,117,110,105, 48, 50, 67, 50, 7,117,110,105, 48, 50, 67, 51, 7, -117,110,105, 48, 50, 67, 52, 7,117,110,105, 48, 50, 67, 53, 7,117,110,105, 48, 50, 67, 56, 7,117,110,105, 48, 50, 67, 57, 7, -117,110,105, 48, 50, 67, 65, 7,117,110,105, 48, 50, 67, 66, 7,117,110,105, 48, 50, 67, 67, 7,117,110,105, 48, 50, 67, 68, 7, -117,110,105, 48, 50, 67, 69, 7,117,110,105, 48, 50, 67, 70, 7,117,110,105, 48, 50, 68, 48, 7,117,110,105, 48, 50, 68, 49, 7, -117,110,105, 48, 50, 68, 50, 7,117,110,105, 48, 50, 68, 51, 7,117,110,105, 48, 50, 68, 52, 7,117,110,105, 48, 50, 68, 53, 7, -117,110,105, 48, 50, 68, 54, 7,117,110,105, 48, 50, 68, 55, 7,117,110,105, 48, 50, 68, 69, 7,117,110,105, 48, 50, 68, 70, 7, -117,110,105, 48, 50, 69, 48, 7,117,110,105, 48, 50, 69, 49, 7,117,110,105, 48, 50, 69, 50, 7,117,110,105, 48, 50, 69, 51, 7, -117,110,105, 48, 50, 69, 52, 7,117,110,105, 48, 50, 69, 53, 7,117,110,105, 48, 50, 69, 54, 7,117,110,105, 48, 50, 69, 55, 7, -117,110,105, 48, 50, 69, 56, 7,117,110,105, 48, 50, 69, 57, 7,117,110,105, 48, 50, 69, 67, 7,117,110,105, 48, 50, 69, 68, 7, -117,110,105, 48, 50, 69, 69, 7,117,110,105, 48, 50, 70, 51, 7,117,110,105, 48, 50, 70, 55, 9,103,114, 97,118,101, 99,111,109, - 98, 9, 97, 99,117,116,101, 99,111,109, 98, 7,117,110,105, 48, 51, 48, 50, 9,116,105,108,100,101, 99,111,109, 98, 7,117,110, -105, 48, 51, 48, 52, 7,117,110,105, 48, 51, 48, 53, 7,117,110,105, 48, 51, 48, 54, 7,117,110,105, 48, 51, 48, 55, 7,117,110, -105, 48, 51, 48, 56, 13,104,111,111,107, 97, 98,111,118,101, 99,111,109, 98, 7,117,110,105, 48, 51, 48, 65, 7,117,110,105, 48, - 51, 48, 66, 7,117,110,105, 48, 51, 48, 67, 7,117,110,105, 48, 51, 48, 68, 7,117,110,105, 48, 51, 48, 69, 7,117,110,105, 48, - 51, 48, 70, 7,117,110,105, 48, 51, 49, 48, 7,117,110,105, 48, 51, 49, 49, 7,117,110,105, 48, 51, 49, 50, 7,117,110,105, 48, - 51, 49, 51, 7,117,110,105, 48, 51, 49, 52, 7,117,110,105, 48, 51, 49, 53, 7,117,110,105, 48, 51, 49, 54, 7,117,110,105, 48, - 51, 49, 55, 7,117,110,105, 48, 51, 49, 56, 7,117,110,105, 48, 51, 49, 57, 7,117,110,105, 48, 51, 49, 65, 7,117,110,105, 48, - 51, 49, 66, 7,117,110,105, 48, 51, 49, 67, 7,117,110,105, 48, 51, 49, 68, 7,117,110,105, 48, 51, 49, 69, 7,117,110,105, 48, - 51, 49, 70, 7,117,110,105, 48, 51, 50, 48, 7,117,110,105, 48, 51, 50, 49, 7,117,110,105, 48, 51, 50, 50, 12,100,111,116, 98, -101,108,111,119, 99,111,109, 98, 7,117,110,105, 48, 51, 50, 52, 7,117,110,105, 48, 51, 50, 53, 7,117,110,105, 48, 51, 50, 54, - 7,117,110,105, 48, 51, 50, 55, 7,117,110,105, 48, 51, 50, 56, 7,117,110,105, 48, 51, 50, 57, 7,117,110,105, 48, 51, 50, 65, - 7,117,110,105, 48, 51, 50, 66, 7,117,110,105, 48, 51, 50, 67, 7,117,110,105, 48, 51, 50, 68, 7,117,110,105, 48, 51, 50, 69, - 7,117,110,105, 48, 51, 50, 70, 7,117,110,105, 48, 51, 51, 48, 7,117,110,105, 48, 51, 51, 49, 7,117,110,105, 48, 51, 51, 50, - 7,117,110,105, 48, 51, 51, 51, 7,117,110,105, 48, 51, 51, 52, 7,117,110,105, 48, 51, 51, 53, 7,117,110,105, 48, 51, 51, 54, - 7,117,110,105, 48, 51, 51, 55, 7,117,110,105, 48, 51, 51, 56, 7,117,110,105, 48, 51, 51, 57, 7,117,110,105, 48, 51, 51, 65, - 7,117,110,105, 48, 51, 51, 66, 7,117,110,105, 48, 51, 51, 67, 7,117,110,105, 48, 51, 51, 68, 7,117,110,105, 48, 51, 51, 69, - 7,117,110,105, 48, 51, 51, 70, 7,117,110,105, 48, 51, 52, 48, 7,117,110,105, 48, 51, 52, 49, 7,117,110,105, 48, 51, 52, 50, - 7,117,110,105, 48, 51, 52, 51, 7,117,110,105, 48, 51, 52, 52, 7,117,110,105, 48, 51, 52, 53, 7,117,110,105, 48, 51, 52, 54, - 7,117,110,105, 48, 51, 52, 55, 7,117,110,105, 48, 51, 52, 56, 7,117,110,105, 48, 51, 52, 57, 7,117,110,105, 48, 51, 52, 65, - 7,117,110,105, 48, 51, 52, 66, 7,117,110,105, 48, 51, 52, 67, 7,117,110,105, 48, 51, 52, 68, 7,117,110,105, 48, 51, 52, 69, - 7,117,110,105, 48, 51, 53, 49, 7,117,110,105, 48, 51, 53, 50, 7,117,110,105, 48, 51, 53, 51, 7,117,110,105, 48, 51, 53, 55, - 7,117,110,105, 48, 51, 53, 56, 7,117,110,105, 48, 51, 53, 67, 7,117,110,105, 48, 51, 53, 68, 7,117,110,105, 48, 51, 54, 48, - 7,117,110,105, 48, 51, 54, 49, 7,117,110,105, 48, 51, 54, 50, 7,117,110,105, 48, 51, 55, 52, 7,117,110,105, 48, 51, 55, 53, - 7,117,110,105, 48, 51, 55, 65, 7,117,110,105, 48, 51, 55, 69, 5,116,111,110,111,115, 13,100,105,101,114,101,115,105,115,116, -111,110,111,115, 10, 65,108,112,104, 97,116,111,110,111,115, 9, 97,110,111,116,101,108,101,105, 97, 12, 69,112,115,105,108,111, -110,116,111,110,111,115, 8, 69,116, 97,116,111,110,111,115, 9, 73,111,116, 97,116,111,110,111,115, 12, 79,109,105, 99,114,111, -110,116,111,110,111,115, 12, 85,112,115,105,108,111,110,116,111,110,111,115, 10, 79,109,101,103, 97,116,111,110,111,115, 17,105, -111,116, 97,100,105,101,114,101,115,105,115,116,111,110,111,115, 5, 65,108,112,104, 97, 4, 66,101,116, 97, 5, 71, 97,109,109, - 97, 7,117,110,105, 48, 51, 57, 52, 7, 69,112,115,105,108,111,110, 4, 90,101,116, 97, 3, 69,116, 97, 5, 84,104,101,116, 97, - 4, 73,111,116, 97, 5, 75, 97,112,112, 97, 6, 76, 97,109, 98,100, 97, 2, 77,117, 2, 78,117, 2, 88,105, 7, 79,109,105, 99, -114,111,110, 2, 80,105, 3, 82,104,111, 5, 83,105,103,109, 97, 3, 84, 97,117, 7, 85,112,115,105,108,111,110, 3, 80,104,105, - 3, 67,104,105, 3, 80,115,105, 12, 73,111,116, 97,100,105,101,114,101,115,105,115, 15, 85,112,115,105,108,111,110,100,105,101, -114,101,115,105,115, 10, 97,108,112,104, 97,116,111,110,111,115, 12,101,112,115,105,108,111,110,116,111,110,111,115, 8,101,116, - 97,116,111,110,111,115, 9,105,111,116, 97,116,111,110,111,115, 20,117,112,115,105,108,111,110,100,105,101,114,101,115,105,115, -116,111,110,111,115, 5, 97,108,112,104, 97, 4, 98,101,116, 97, 5,103, 97,109,109, 97, 5,100,101,108,116, 97, 7,101,112,115, -105,108,111,110, 4,122,101,116, 97, 3,101,116, 97, 5,116,104,101,116, 97, 4,105,111,116, 97, 5,107, 97,112,112, 97, 6,108, - 97,109, 98,100, 97, 7,117,110,105, 48, 51, 66, 67, 2,110,117, 2,120,105, 7,111,109,105, 99,114,111,110, 3,114,104,111, 6, -115,105,103,109, 97, 49, 5,115,105,103,109, 97, 3,116, 97,117, 7,117,112,115,105,108,111,110, 3,112,104,105, 3, 99,104,105, - 3,112,115,105, 5,111,109,101,103, 97, 12,105,111,116, 97,100,105,101,114,101,115,105,115, 15,117,112,115,105,108,111,110,100, -105,101,114,101,115,105,115, 12,111,109,105, 99,114,111,110,116,111,110,111,115, 12,117,112,115,105,108,111,110,116,111,110,111, -115, 10,111,109,101,103, 97,116,111,110,111,115, 7,117,110,105, 48, 51, 68, 48, 6,116,104,101,116, 97, 49, 8, 85,112,115,105, -108,111,110, 49, 7,117,110,105, 48, 51, 68, 51, 7,117,110,105, 48, 51, 68, 52, 4,112,104,105, 49, 6,111,109,101,103, 97, 49, - 7,117,110,105, 48, 51, 68, 55, 7,117,110,105, 48, 51, 68, 56, 7,117,110,105, 48, 51, 68, 57, 7,117,110,105, 48, 51, 68, 65, - 7,117,110,105, 48, 51, 68, 66, 7,117,110,105, 48, 51, 68, 67, 7,117,110,105, 48, 51, 68, 68, 7,117,110,105, 48, 51, 68, 69, - 7,117,110,105, 48, 51, 68, 70, 7,117,110,105, 48, 51, 69, 48, 7,117,110,105, 48, 51, 69, 49, 7,117,110,105, 48, 51, 69, 50, - 7,117,110,105, 48, 51, 69, 51, 7,117,110,105, 48, 51, 69, 52, 7,117,110,105, 48, 51, 69, 53, 7,117,110,105, 48, 51, 69, 54, - 7,117,110,105, 48, 51, 69, 55, 7,117,110,105, 48, 51, 69, 56, 7,117,110,105, 48, 51, 69, 57, 7,117,110,105, 48, 51, 69, 65, - 7,117,110,105, 48, 51, 69, 66, 7,117,110,105, 48, 51, 69, 67, 7,117,110,105, 48, 51, 69, 68, 7,117,110,105, 48, 51, 69, 69, - 7,117,110,105, 48, 51, 69, 70, 7,117,110,105, 48, 51, 70, 48, 7,117,110,105, 48, 51, 70, 49, 7,117,110,105, 48, 51, 70, 50, - 7,117,110,105, 48, 51, 70, 51, 7,117,110,105, 48, 51, 70, 52, 7,117,110,105, 48, 51, 70, 53, 7,117,110,105, 48, 51, 70, 54, - 7,117,110,105, 48, 51, 70, 55, 7,117,110,105, 48, 51, 70, 56, 7,117,110,105, 48, 51, 70, 57, 7,117,110,105, 48, 51, 70, 65, - 7,117,110,105, 48, 51, 70, 66, 7,117,110,105, 48, 51, 70, 67, 7,117,110,105, 48, 51, 70, 68, 7,117,110,105, 48, 51, 70, 69, - 7,117,110,105, 48, 51, 70, 70, 7,117,110,105, 48, 52, 48, 48, 9, 97,102,105,105, 49, 48, 48, 50, 51, 9, 97,102,105,105, 49, - 48, 48, 53, 49, 9, 97,102,105,105, 49, 48, 48, 53, 50, 9, 97,102,105,105, 49, 48, 48, 53, 51, 9, 97,102,105,105, 49, 48, 48, - 53, 52, 9, 97,102,105,105, 49, 48, 48, 53, 53, 9, 97,102,105,105, 49, 48, 48, 53, 54, 9, 97,102,105,105, 49, 48, 48, 53, 55, - 9, 97,102,105,105, 49, 48, 48, 53, 56, 9, 97,102,105,105, 49, 48, 48, 53, 57, 9, 97,102,105,105, 49, 48, 48, 54, 48, 9, 97, -102,105,105, 49, 48, 48, 54, 49, 7,117,110,105, 48, 52, 48, 68, 9, 97,102,105,105, 49, 48, 48, 54, 50, 9, 97,102,105,105, 49, - 48, 49, 52, 53, 9, 97,102,105,105, 49, 48, 48, 49, 55, 9, 97,102,105,105, 49, 48, 48, 49, 56, 9, 97,102,105,105, 49, 48, 48, - 49, 57, 9, 97,102,105,105, 49, 48, 48, 50, 48, 9, 97,102,105,105, 49, 48, 48, 50, 49, 9, 97,102,105,105, 49, 48, 48, 50, 50, - 9, 97,102,105,105, 49, 48, 48, 50, 52, 9, 97,102,105,105, 49, 48, 48, 50, 53, 9, 97,102,105,105, 49, 48, 48, 50, 54, 9, 97, -102,105,105, 49, 48, 48, 50, 55, 9, 97,102,105,105, 49, 48, 48, 50, 56, 9, 97,102,105,105, 49, 48, 48, 50, 57, 9, 97,102,105, -105, 49, 48, 48, 51, 48, 9, 97,102,105,105, 49, 48, 48, 51, 49, 9, 97,102,105,105, 49, 48, 48, 51, 50, 9, 97,102,105,105, 49, - 48, 48, 51, 51, 9, 97,102,105,105, 49, 48, 48, 51, 52, 9, 97,102,105,105, 49, 48, 48, 51, 53, 9, 97,102,105,105, 49, 48, 48, - 51, 54, 9, 97,102,105,105, 49, 48, 48, 51, 55, 9, 97,102,105,105, 49, 48, 48, 51, 56, 9, 97,102,105,105, 49, 48, 48, 51, 57, - 9, 97,102,105,105, 49, 48, 48, 52, 48, 9, 97,102,105,105, 49, 48, 48, 52, 49, 9, 97,102,105,105, 49, 48, 48, 52, 50, 9, 97, -102,105,105, 49, 48, 48, 52, 51, 9, 97,102,105,105, 49, 48, 48, 52, 52, 9, 97,102,105,105, 49, 48, 48, 52, 53, 9, 97,102,105, -105, 49, 48, 48, 52, 54, 9, 97,102,105,105, 49, 48, 48, 52, 55, 9, 97,102,105,105, 49, 48, 48, 52, 56, 9, 97,102,105,105, 49, - 48, 48, 52, 57, 9, 97,102,105,105, 49, 48, 48, 54, 53, 9, 97,102,105,105, 49, 48, 48, 54, 54, 9, 97,102,105,105, 49, 48, 48, - 54, 55, 9, 97,102,105,105, 49, 48, 48, 54, 56, 9, 97,102,105,105, 49, 48, 48, 54, 57, 9, 97,102,105,105, 49, 48, 48, 55, 48, - 9, 97,102,105,105, 49, 48, 48, 55, 50, 9, 97,102,105,105, 49, 48, 48, 55, 51, 9, 97,102,105,105, 49, 48, 48, 55, 52, 9, 97, -102,105,105, 49, 48, 48, 55, 53, 9, 97,102,105,105, 49, 48, 48, 55, 54, 9, 97,102,105,105, 49, 48, 48, 55, 55, 9, 97,102,105, -105, 49, 48, 48, 55, 56, 9, 97,102,105,105, 49, 48, 48, 55, 57, 9, 97,102,105,105, 49, 48, 48, 56, 48, 9, 97,102,105,105, 49, - 48, 48, 56, 49, 9, 97,102,105,105, 49, 48, 48, 56, 50, 9, 97,102,105,105, 49, 48, 48, 56, 51, 9, 97,102,105,105, 49, 48, 48, - 56, 52, 9, 97,102,105,105, 49, 48, 48, 56, 53, 9, 97,102,105,105, 49, 48, 48, 56, 54, 9, 97,102,105,105, 49, 48, 48, 56, 55, - 9, 97,102,105,105, 49, 48, 48, 56, 56, 9, 97,102,105,105, 49, 48, 48, 56, 57, 9, 97,102,105,105, 49, 48, 48, 57, 48, 9, 97, -102,105,105, 49, 48, 48, 57, 49, 9, 97,102,105,105, 49, 48, 48, 57, 50, 9, 97,102,105,105, 49, 48, 48, 57, 51, 9, 97,102,105, -105, 49, 48, 48, 57, 52, 9, 97,102,105,105, 49, 48, 48, 57, 53, 9, 97,102,105,105, 49, 48, 48, 57, 54, 9, 97,102,105,105, 49, - 48, 48, 57, 55, 7,117,110,105, 48, 52, 53, 48, 9, 97,102,105,105, 49, 48, 48, 55, 49, 9, 97,102,105,105, 49, 48, 48, 57, 57, - 9, 97,102,105,105, 49, 48, 49, 48, 48, 9, 97,102,105,105, 49, 48, 49, 48, 49, 9, 97,102,105,105, 49, 48, 49, 48, 50, 9, 97, -102,105,105, 49, 48, 49, 48, 51, 9, 97,102,105,105, 49, 48, 49, 48, 52, 9, 97,102,105,105, 49, 48, 49, 48, 53, 9, 97,102,105, -105, 49, 48, 49, 48, 54, 9, 97,102,105,105, 49, 48, 49, 48, 55, 9, 97,102,105,105, 49, 48, 49, 48, 56, 9, 97,102,105,105, 49, - 48, 49, 48, 57, 7,117,110,105, 48, 52, 53, 68, 9, 97,102,105,105, 49, 48, 49, 49, 48, 9, 97,102,105,105, 49, 48, 49, 57, 51, - 7,117,110,105, 48, 52, 54, 48, 7,117,110,105, 48, 52, 54, 49, 9, 97,102,105,105, 49, 48, 49, 52, 54, 9, 97,102,105,105, 49, - 48, 49, 57, 52, 7,117,110,105, 48, 52, 54, 52, 7,117,110,105, 48, 52, 54, 53, 7,117,110,105, 48, 52, 54, 54, 7,117,110,105, - 48, 52, 54, 55, 7,117,110,105, 48, 52, 54, 56, 7,117,110,105, 48, 52, 54, 57, 7,117,110,105, 48, 52, 54, 65, 7,117,110,105, - 48, 52, 54, 66, 7,117,110,105, 48, 52, 54, 67, 7,117,110,105, 48, 52, 54, 68, 7,117,110,105, 48, 52, 54, 69, 7,117,110,105, - 48, 52, 54, 70, 7,117,110,105, 48, 52, 55, 48, 7,117,110,105, 48, 52, 55, 49, 9, 97,102,105,105, 49, 48, 49, 52, 55, 9, 97, -102,105,105, 49, 48, 49, 57, 53, 9, 97,102,105,105, 49, 48, 49, 52, 56, 9, 97,102,105,105, 49, 48, 49, 57, 54, 7,117,110,105, - 48, 52, 55, 54, 7,117,110,105, 48, 52, 55, 55, 7,117,110,105, 48, 52, 55, 56, 7,117,110,105, 48, 52, 55, 57, 7,117,110,105, - 48, 52, 55, 65, 7,117,110,105, 48, 52, 55, 66, 7,117,110,105, 48, 52, 55, 67, 7,117,110,105, 48, 52, 55, 68, 7,117,110,105, - 48, 52, 55, 69, 7,117,110,105, 48, 52, 55, 70, 7,117,110,105, 48, 52, 56, 48, 7,117,110,105, 48, 52, 56, 49, 7,117,110,105, - 48, 52, 56, 50, 7,117,110,105, 48, 52, 56, 51, 7,117,110,105, 48, 52, 56, 52, 7,117,110,105, 48, 52, 56, 53, 7,117,110,105, - 48, 52, 56, 54, 7,117,110,105, 48, 52, 56, 56, 7,117,110,105, 48, 52, 56, 57, 7,117,110,105, 48, 52, 56, 65, 7,117,110,105, - 48, 52, 56, 66, 7,117,110,105, 48, 52, 56, 67, 7,117,110,105, 48, 52, 56, 68, 7,117,110,105, 48, 52, 56, 69, 7,117,110,105, - 48, 52, 56, 70, 9, 97,102,105,105, 49, 48, 48, 53, 48, 9, 97,102,105,105, 49, 48, 48, 57, 56, 7,117,110,105, 48, 52, 57, 50, - 7,117,110,105, 48, 52, 57, 51, 7,117,110,105, 48, 52, 57, 52, 7,117,110,105, 48, 52, 57, 53, 7,117,110,105, 48, 52, 57, 54, - 7,117,110,105, 48, 52, 57, 55, 7,117,110,105, 48, 52, 57, 56, 7,117,110,105, 48, 52, 57, 57, 7,117,110,105, 48, 52, 57, 65, - 7,117,110,105, 48, 52, 57, 66, 7,117,110,105, 48, 52, 57, 67, 7,117,110,105, 48, 52, 57, 68, 7,117,110,105, 48, 52, 57, 69, - 7,117,110,105, 48, 52, 57, 70, 7,117,110,105, 48, 52, 65, 48, 7,117,110,105, 48, 52, 65, 49, 7,117,110,105, 48, 52, 65, 50, - 7,117,110,105, 48, 52, 65, 51, 7,117,110,105, 48, 52, 65, 52, 7,117,110,105, 48, 52, 65, 53, 7,117,110,105, 48, 52, 65, 54, - 7,117,110,105, 48, 52, 65, 55, 7,117,110,105, 48, 52, 65, 56, 7,117,110,105, 48, 52, 65, 57, 7,117,110,105, 48, 52, 65, 65, - 7,117,110,105, 48, 52, 65, 66, 7,117,110,105, 48, 52, 65, 67, 7,117,110,105, 48, 52, 65, 68, 7,117,110,105, 48, 52, 65, 69, - 7,117,110,105, 48, 52, 65, 70, 7,117,110,105, 48, 52, 66, 48, 7,117,110,105, 48, 52, 66, 49, 7,117,110,105, 48, 52, 66, 50, - 7,117,110,105, 48, 52, 66, 51, 7,117,110,105, 48, 52, 66, 52, 7,117,110,105, 48, 52, 66, 53, 7,117,110,105, 48, 52, 66, 54, - 7,117,110,105, 48, 52, 66, 55, 7,117,110,105, 48, 52, 66, 56, 7,117,110,105, 48, 52, 66, 57, 7,117,110,105, 48, 52, 66, 65, - 7,117,110,105, 48, 52, 66, 66, 7,117,110,105, 48, 52, 66, 67, 7,117,110,105, 48, 52, 66, 68, 7,117,110,105, 48, 52, 66, 69, - 7,117,110,105, 48, 52, 66, 70, 7,117,110,105, 48, 52, 67, 48, 7,117,110,105, 48, 52, 67, 49, 7,117,110,105, 48, 52, 67, 50, - 7,117,110,105, 48, 52, 67, 51, 7,117,110,105, 48, 52, 67, 52, 7,117,110,105, 48, 52, 67, 53, 7,117,110,105, 48, 52, 67, 54, - 7,117,110,105, 48, 52, 67, 55, 7,117,110,105, 48, 52, 67, 56, 7,117,110,105, 48, 52, 67, 57, 7,117,110,105, 48, 52, 67, 65, - 7,117,110,105, 48, 52, 67, 66, 7,117,110,105, 48, 52, 67, 67, 7,117,110,105, 48, 52, 67, 68, 7,117,110,105, 48, 52, 67, 69, - 7,117,110,105, 48, 52, 68, 48, 7,117,110,105, 48, 52, 68, 49, 7,117,110,105, 48, 52, 68, 50, 7,117,110,105, 48, 52, 68, 51, - 7,117,110,105, 48, 52, 68, 52, 7,117,110,105, 48, 52, 68, 53, 7,117,110,105, 48, 52, 68, 54, 7,117,110,105, 48, 52, 68, 55, - 7,117,110,105, 48, 52, 68, 56, 9, 97,102,105,105, 49, 48, 56, 52, 54, 7,117,110,105, 48, 52, 68, 65, 7,117,110,105, 48, 52, - 68, 66, 7,117,110,105, 48, 52, 68, 67, 7,117,110,105, 48, 52, 68, 68, 7,117,110,105, 48, 52, 68, 69, 7,117,110,105, 48, 52, - 68, 70, 7,117,110,105, 48, 52, 69, 48, 7,117,110,105, 48, 52, 69, 49, 7,117,110,105, 48, 52, 69, 50, 7,117,110,105, 48, 52, - 69, 51, 7,117,110,105, 48, 52, 69, 52, 7,117,110,105, 48, 52, 69, 53, 7,117,110,105, 48, 52, 69, 54, 7,117,110,105, 48, 52, - 69, 55, 7,117,110,105, 48, 52, 69, 56, 7,117,110,105, 48, 52, 69, 57, 7,117,110,105, 48, 52, 69, 65, 7,117,110,105, 48, 52, - 69, 66, 7,117,110,105, 48, 52, 69, 67, 7,117,110,105, 48, 52, 69, 68, 7,117,110,105, 48, 52, 69, 69, 7,117,110,105, 48, 52, - 69, 70, 7,117,110,105, 48, 52, 70, 48, 7,117,110,105, 48, 52, 70, 49, 7,117,110,105, 48, 52, 70, 50, 7,117,110,105, 48, 52, - 70, 51, 7,117,110,105, 48, 52, 70, 52, 7,117,110,105, 48, 52, 70, 53, 7,117,110,105, 48, 52, 70, 54, 7,117,110,105, 48, 52, - 70, 55, 7,117,110,105, 48, 52, 70, 56, 7,117,110,105, 48, 52, 70, 57, 7,117,110,105, 48, 53, 48, 48, 7,117,110,105, 48, 53, - 48, 49, 7,117,110,105, 48, 53, 48, 50, 7,117,110,105, 48, 53, 48, 51, 7,117,110,105, 48, 53, 48, 52, 7,117,110,105, 48, 53, - 48, 53, 7,117,110,105, 48, 53, 48, 54, 7,117,110,105, 48, 53, 48, 55, 7,117,110,105, 48, 53, 48, 56, 7,117,110,105, 48, 53, - 48, 57, 7,117,110,105, 48, 53, 48, 65, 7,117,110,105, 48, 53, 48, 66, 7,117,110,105, 48, 53, 48, 67, 7,117,110,105, 48, 53, - 48, 68, 7,117,110,105, 48, 53, 48, 69, 7,117,110,105, 48, 53, 48, 70, 7,117,110,105, 48, 53, 51, 49, 7,117,110,105, 48, 53, - 51, 50, 7,117,110,105, 48, 53, 51, 51, 7,117,110,105, 48, 53, 51, 52, 7,117,110,105, 48, 53, 51, 53, 7,117,110,105, 48, 53, - 51, 54, 7,117,110,105, 48, 53, 51, 55, 7,117,110,105, 48, 53, 51, 56, 7,117,110,105, 48, 53, 51, 57, 7,117,110,105, 48, 53, - 51, 65, 7,117,110,105, 48, 53, 51, 66, 7,117,110,105, 48, 53, 51, 67, 7,117,110,105, 48, 53, 51, 68, 7,117,110,105, 48, 53, - 51, 69, 7,117,110,105, 48, 53, 51, 70, 7,117,110,105, 48, 53, 52, 48, 7,117,110,105, 48, 53, 52, 49, 7,117,110,105, 48, 53, - 52, 50, 7,117,110,105, 48, 53, 52, 51, 7,117,110,105, 48, 53, 52, 52, 7,117,110,105, 48, 53, 52, 53, 7,117,110,105, 48, 53, - 52, 54, 7,117,110,105, 48, 53, 52, 55, 7,117,110,105, 48, 53, 52, 56, 7,117,110,105, 48, 53, 52, 57, 7,117,110,105, 48, 53, - 52, 65, 7,117,110,105, 48, 53, 52, 66, 7,117,110,105, 48, 53, 52, 67, 7,117,110,105, 48, 53, 52, 68, 7,117,110,105, 48, 53, - 52, 69, 7,117,110,105, 48, 53, 52, 70, 7,117,110,105, 48, 53, 53, 48, 7,117,110,105, 48, 53, 53, 49, 7,117,110,105, 48, 53, - 53, 50, 7,117,110,105, 48, 53, 53, 51, 7,117,110,105, 48, 53, 53, 52, 7,117,110,105, 48, 53, 53, 53, 7,117,110,105, 48, 53, - 53, 54, 7,117,110,105, 48, 53, 53, 57, 7,117,110,105, 48, 53, 53, 65, 7,117,110,105, 48, 53, 53, 66, 7,117,110,105, 48, 53, - 53, 67, 7,117,110,105, 48, 53, 53, 68, 7,117,110,105, 48, 53, 53, 69, 7,117,110,105, 48, 53, 53, 70, 7,117,110,105, 48, 53, - 54, 49, 7,117,110,105, 48, 53, 54, 50, 7,117,110,105, 48, 53, 54, 51, 7,117,110,105, 48, 53, 54, 52, 7,117,110,105, 48, 53, - 54, 53, 7,117,110,105, 48, 53, 54, 54, 7,117,110,105, 48, 53, 54, 55, 7,117,110,105, 48, 53, 54, 56, 7,117,110,105, 48, 53, - 54, 57, 7,117,110,105, 48, 53, 54, 65, 7,117,110,105, 48, 53, 54, 66, 7,117,110,105, 48, 53, 54, 67, 7,117,110,105, 48, 53, - 54, 68, 7,117,110,105, 48, 53, 54, 69, 7,117,110,105, 48, 53, 54, 70, 7,117,110,105, 48, 53, 55, 48, 7,117,110,105, 48, 53, - 55, 49, 7,117,110,105, 48, 53, 55, 50, 7,117,110,105, 48, 53, 55, 51, 7,117,110,105, 48, 53, 55, 52, 7,117,110,105, 48, 53, - 55, 53, 7,117,110,105, 48, 53, 55, 54, 7,117,110,105, 48, 53, 55, 55, 7,117,110,105, 48, 53, 55, 56, 7,117,110,105, 48, 53, - 55, 57, 7,117,110,105, 48, 53, 55, 65, 7,117,110,105, 48, 53, 55, 66, 7,117,110,105, 48, 53, 55, 67, 7,117,110,105, 48, 53, - 55, 68, 7,117,110,105, 48, 53, 55, 69, 7,117,110,105, 48, 53, 55, 70, 7,117,110,105, 48, 53, 56, 48, 7,117,110,105, 48, 53, - 56, 49, 7,117,110,105, 48, 53, 56, 50, 7,117,110,105, 48, 53, 56, 51, 7,117,110,105, 48, 53, 56, 52, 7,117,110,105, 48, 53, - 56, 53, 7,117,110,105, 48, 53, 56, 54, 7,117,110,105, 48, 53, 56, 55, 7,117,110,105, 48, 53, 56, 57, 7,117,110,105, 48, 53, - 56, 65, 9, 97,102,105,105, 53, 55, 51, 56, 56, 7,117,110,105, 49, 69, 48, 48, 7,117,110,105, 49, 69, 48, 49, 7,117,110,105, - 49, 69, 48, 50, 7,117,110,105, 49, 69, 48, 51, 7,117,110,105, 49, 69, 48, 52, 7,117,110,105, 49, 69, 48, 53, 7,117,110,105, - 49, 69, 48, 54, 7,117,110,105, 49, 69, 48, 55, 7,117,110,105, 49, 69, 48, 56, 7,117,110,105, 49, 69, 48, 57, 7,117,110,105, - 49, 69, 48, 65, 7,117,110,105, 49, 69, 48, 66, 7,117,110,105, 49, 69, 48, 67, 7,117,110,105, 49, 69, 48, 68, 7,117,110,105, - 49, 69, 48, 69, 7,117,110,105, 49, 69, 48, 70, 7,117,110,105, 49, 69, 49, 48, 7,117,110,105, 49, 69, 49, 49, 7,117,110,105, - 49, 69, 49, 50, 7,117,110,105, 49, 69, 49, 51, 7,117,110,105, 49, 69, 49, 52, 7,117,110,105, 49, 69, 49, 53, 7,117,110,105, - 49, 69, 49, 54, 7,117,110,105, 49, 69, 49, 55, 7,117,110,105, 49, 69, 49, 56, 7,117,110,105, 49, 69, 49, 57, 7,117,110,105, - 49, 69, 49, 65, 7,117,110,105, 49, 69, 49, 66, 7,117,110,105, 49, 69, 49, 67, 7,117,110,105, 49, 69, 49, 68, 7,117,110,105, - 49, 69, 49, 69, 7,117,110,105, 49, 69, 49, 70, 7,117,110,105, 49, 69, 50, 48, 7,117,110,105, 49, 69, 50, 49, 7,117,110,105, - 49, 69, 50, 50, 7,117,110,105, 49, 69, 50, 51, 7,117,110,105, 49, 69, 50, 52, 7,117,110,105, 49, 69, 50, 53, 7,117,110,105, - 49, 69, 50, 54, 7,117,110,105, 49, 69, 50, 55, 7,117,110,105, 49, 69, 50, 56, 7,117,110,105, 49, 69, 50, 57, 7,117,110,105, - 49, 69, 50, 65, 7,117,110,105, 49, 69, 50, 66, 7,117,110,105, 49, 69, 50, 67, 7,117,110,105, 49, 69, 50, 68, 7,117,110,105, - 49, 69, 50, 69, 7,117,110,105, 49, 69, 50, 70, 7,117,110,105, 49, 69, 51, 48, 7,117,110,105, 49, 69, 51, 49, 7,117,110,105, - 49, 69, 51, 50, 7,117,110,105, 49, 69, 51, 51, 7,117,110,105, 49, 69, 51, 52, 7,117,110,105, 49, 69, 51, 53, 7,117,110,105, - 49, 69, 51, 54, 7,117,110,105, 49, 69, 51, 55, 7,117,110,105, 49, 69, 51, 56, 7,117,110,105, 49, 69, 51, 57, 7,117,110,105, - 49, 69, 51, 65, 7,117,110,105, 49, 69, 51, 66, 7,117,110,105, 49, 69, 51, 67, 7,117,110,105, 49, 69, 51, 68, 7,117,110,105, - 49, 69, 51, 69, 7,117,110,105, 49, 69, 51, 70, 7,117,110,105, 49, 69, 52, 48, 7,117,110,105, 49, 69, 52, 49, 7,117,110,105, - 49, 69, 52, 50, 7,117,110,105, 49, 69, 52, 51, 7,117,110,105, 49, 69, 52, 52, 7,117,110,105, 49, 69, 52, 53, 7,117,110,105, - 49, 69, 52, 54, 7,117,110,105, 49, 69, 52, 55, 7,117,110,105, 49, 69, 52, 56, 7,117,110,105, 49, 69, 52, 57, 7,117,110,105, - 49, 69, 52, 65, 7,117,110,105, 49, 69, 52, 66, 7,117,110,105, 49, 69, 52, 67, 7,117,110,105, 49, 69, 52, 68, 7,117,110,105, - 49, 69, 52, 69, 7,117,110,105, 49, 69, 52, 70, 7,117,110,105, 49, 69, 53, 48, 7,117,110,105, 49, 69, 53, 49, 7,117,110,105, - 49, 69, 53, 50, 7,117,110,105, 49, 69, 53, 51, 7,117,110,105, 49, 69, 53, 52, 7,117,110,105, 49, 69, 53, 53, 7,117,110,105, - 49, 69, 53, 54, 7,117,110,105, 49, 69, 53, 55, 7,117,110,105, 49, 69, 53, 56, 7,117,110,105, 49, 69, 53, 57, 7,117,110,105, - 49, 69, 53, 65, 7,117,110,105, 49, 69, 53, 66, 7,117,110,105, 49, 69, 53, 67, 7,117,110,105, 49, 69, 53, 68, 7,117,110,105, - 49, 69, 53, 69, 7,117,110,105, 49, 69, 53, 70, 7,117,110,105, 49, 69, 54, 48, 7,117,110,105, 49, 69, 54, 49, 7,117,110,105, - 49, 69, 54, 50, 7,117,110,105, 49, 69, 54, 51, 7,117,110,105, 49, 69, 54, 52, 7,117,110,105, 49, 69, 54, 53, 7,117,110,105, - 49, 69, 54, 54, 7,117,110,105, 49, 69, 54, 55, 7,117,110,105, 49, 69, 54, 56, 7,117,110,105, 49, 69, 54, 57, 7,117,110,105, - 49, 69, 54, 65, 7,117,110,105, 49, 69, 54, 66, 7,117,110,105, 49, 69, 54, 67, 7,117,110,105, 49, 69, 54, 68, 7,117,110,105, - 49, 69, 54, 69, 7,117,110,105, 49, 69, 54, 70, 7,117,110,105, 49, 69, 55, 48, 7,117,110,105, 49, 69, 55, 49, 7,117,110,105, - 49, 69, 55, 50, 7,117,110,105, 49, 69, 55, 51, 7,117,110,105, 49, 69, 55, 52, 7,117,110,105, 49, 69, 55, 53, 7,117,110,105, - 49, 69, 55, 54, 7,117,110,105, 49, 69, 55, 55, 7,117,110,105, 49, 69, 55, 56, 7,117,110,105, 49, 69, 55, 57, 7,117,110,105, - 49, 69, 55, 65, 7,117,110,105, 49, 69, 55, 66, 7,117,110,105, 49, 69, 55, 67, 7,117,110,105, 49, 69, 55, 68, 7,117,110,105, - 49, 69, 55, 69, 7,117,110,105, 49, 69, 55, 70, 6, 87,103,114, 97,118,101, 6,119,103,114, 97,118,101, 6, 87, 97, 99,117,116, -101, 6,119, 97, 99,117,116,101, 9, 87,100,105,101,114,101,115,105,115, 9,119,100,105,101,114,101,115,105,115, 7,117,110,105, - 49, 69, 56, 54, 7,117,110,105, 49, 69, 56, 55, 7,117,110,105, 49, 69, 56, 56, 7,117,110,105, 49, 69, 56, 57, 7,117,110,105, - 49, 69, 56, 65, 7,117,110,105, 49, 69, 56, 66, 7,117,110,105, 49, 69, 56, 67, 7,117,110,105, 49, 69, 56, 68, 7,117,110,105, - 49, 69, 56, 69, 7,117,110,105, 49, 69, 56, 70, 7,117,110,105, 49, 69, 57, 48, 7,117,110,105, 49, 69, 57, 49, 7,117,110,105, - 49, 69, 57, 50, 7,117,110,105, 49, 69, 57, 51, 7,117,110,105, 49, 69, 57, 52, 7,117,110,105, 49, 69, 57, 53, 7,117,110,105, - 49, 69, 57, 54, 7,117,110,105, 49, 69, 57, 55, 7,117,110,105, 49, 69, 57, 56, 7,117,110,105, 49, 69, 57, 57, 7,117,110,105, - 49, 69, 57, 65, 7,117,110,105, 49, 69, 57, 66, 7,117,110,105, 49, 69, 65, 48, 7,117,110,105, 49, 69, 65, 49, 7,117,110,105, - 49, 69, 65, 50, 7,117,110,105, 49, 69, 65, 51, 7,117,110,105, 49, 69, 65, 52, 7,117,110,105, 49, 69, 65, 53, 7,117,110,105, - 49, 69, 65, 54, 7,117,110,105, 49, 69, 65, 55, 7,117,110,105, 49, 69, 65, 56, 7,117,110,105, 49, 69, 65, 57, 7,117,110,105, - 49, 69, 65, 65, 7,117,110,105, 49, 69, 65, 66, 7,117,110,105, 49, 69, 65, 67, 7,117,110,105, 49, 69, 65, 68, 7,117,110,105, - 49, 69, 65, 69, 7,117,110,105, 49, 69, 65, 70, 7,117,110,105, 49, 69, 66, 48, 7,117,110,105, 49, 69, 66, 49, 7,117,110,105, - 49, 69, 66, 50, 7,117,110,105, 49, 69, 66, 51, 7,117,110,105, 49, 69, 66, 52, 7,117,110,105, 49, 69, 66, 53, 7,117,110,105, - 49, 69, 66, 54, 7,117,110,105, 49, 69, 66, 55, 7,117,110,105, 49, 69, 66, 56, 7,117,110,105, 49, 69, 66, 57, 7,117,110,105, - 49, 69, 66, 65, 7,117,110,105, 49, 69, 66, 66, 7,117,110,105, 49, 69, 66, 67, 7,117,110,105, 49, 69, 66, 68, 7,117,110,105, - 49, 69, 66, 69, 7,117,110,105, 49, 69, 66, 70, 7,117,110,105, 49, 69, 67, 48, 7,117,110,105, 49, 69, 67, 49, 7,117,110,105, - 49, 69, 67, 50, 7,117,110,105, 49, 69, 67, 51, 7,117,110,105, 49, 69, 67, 52, 7,117,110,105, 49, 69, 67, 53, 7,117,110,105, - 49, 69, 67, 54, 7,117,110,105, 49, 69, 67, 55, 7,117,110,105, 49, 69, 67, 56, 7,117,110,105, 49, 69, 67, 57, 7,117,110,105, - 49, 69, 67, 65, 7,117,110,105, 49, 69, 67, 66, 7,117,110,105, 49, 69, 67, 67, 7,117,110,105, 49, 69, 67, 68, 7,117,110,105, - 49, 69, 67, 69, 7,117,110,105, 49, 69, 67, 70, 7,117,110,105, 49, 69, 68, 48, 7,117,110,105, 49, 69, 68, 49, 7,117,110,105, - 49, 69, 68, 50, 7,117,110,105, 49, 69, 68, 51, 7,117,110,105, 49, 69, 68, 52, 7,117,110,105, 49, 69, 68, 53, 7,117,110,105, - 49, 69, 68, 54, 7,117,110,105, 49, 69, 68, 55, 7,117,110,105, 49, 69, 68, 56, 7,117,110,105, 49, 69, 68, 57, 7,117,110,105, - 49, 69, 68, 65, 7,117,110,105, 49, 69, 68, 66, 7,117,110,105, 49, 69, 68, 67, 7,117,110,105, 49, 69, 68, 68, 7,117,110,105, - 49, 69, 68, 69, 7,117,110,105, 49, 69, 68, 70, 7,117,110,105, 49, 69, 69, 48, 7,117,110,105, 49, 69, 69, 49, 7,117,110,105, - 49, 69, 69, 50, 7,117,110,105, 49, 69, 69, 51, 7,117,110,105, 49, 69, 69, 52, 7,117,110,105, 49, 69, 69, 53, 7,117,110,105, - 49, 69, 69, 54, 7,117,110,105, 49, 69, 69, 55, 7,117,110,105, 49, 69, 69, 56, 7,117,110,105, 49, 69, 69, 57, 7,117,110,105, - 49, 69, 69, 65, 7,117,110,105, 49, 69, 69, 66, 7,117,110,105, 49, 69, 69, 67, 7,117,110,105, 49, 69, 69, 68, 7,117,110,105, - 49, 69, 69, 69, 7,117,110,105, 49, 69, 69, 70, 7,117,110,105, 49, 69, 70, 48, 7,117,110,105, 49, 69, 70, 49, 6, 89,103,114, - 97,118,101, 6,121,103,114, 97,118,101, 7,117,110,105, 49, 69, 70, 52, 7,117,110,105, 49, 69, 70, 53, 7,117,110,105, 49, 69, - 70, 54, 7,117,110,105, 49, 69, 70, 55, 7,117,110,105, 49, 69, 70, 56, 7,117,110,105, 49, 69, 70, 57, 7,117,110,105, 49, 70, - 66, 70, 7,117,110,105, 49, 70, 70, 68, 7,117,110,105, 49, 70, 70, 69, 7,117,110,105, 50, 48, 48, 48, 7,117,110,105, 50, 48, - 48, 49, 7,117,110,105, 50, 48, 48, 50, 7,117,110,105, 50, 48, 48, 51, 7,117,110,105, 50, 48, 48, 52, 7,117,110,105, 50, 48, - 48, 53, 7,117,110,105, 50, 48, 48, 54, 7,117,110,105, 50, 48, 48, 55, 7,117,110,105, 50, 48, 48, 56, 7,117,110,105, 50, 48, - 48, 57, 7,117,110,105, 50, 48, 48, 65, 7,117,110,105, 50, 48, 48, 66, 9, 97,102,105,105, 54, 49, 54, 54, 52, 7, 97,102,105, -105, 51, 48, 49, 7, 97,102,105,105, 50, 57, 57, 7, 97,102,105,105, 51, 48, 48, 7,117,110,105, 50, 48, 49, 48, 7,117,110,105, - 50, 48, 49, 49, 10,102,105,103,117,114,101,100, 97,115,104, 9, 97,102,105,105, 48, 48, 50, 48, 56, 7,117,110,105, 50, 48, 49, - 54, 13,117,110,100,101,114,115, 99,111,114,101,100, 98,108, 13,113,117,111,116,101,114,101,118,101,114,115,101,100, 7,117,110, -105, 50, 48, 49, 70, 7,117,110,105, 50, 48, 50, 51, 14,111,110,101,100,111,116,101,110,108,101, 97,100,101,114, 14,116,119,111, -100,111,116,101,110,108,101, 97,100,101,114, 7,117,110,105, 50, 48, 50, 55, 7,117,110,105, 50, 48, 51, 49, 6,109,105,110,117, -116,101, 6,115,101, 99,111,110,100, 7,117,110,105, 50, 48, 51, 52, 7,117,110,105, 50, 48, 51, 53, 7,117,110,105, 50, 48, 51, - 54, 7,117,110,105, 50, 48, 51, 55, 7,117,110,105, 50, 48, 51, 56, 7,117,110,105, 50, 48, 51, 66, 9,101,120, 99,108, 97,109, -100, 98,108, 7,117,110,105, 50, 48, 51, 68, 7,117,110,105, 50, 48, 51, 69, 7,117,110,105, 50, 48, 51, 70, 7,117,110,105, 50, - 48, 52, 48, 7,117,110,105, 50, 48, 52, 49, 7,117,110,105, 50, 48, 52, 50, 7,117,110,105, 50, 48, 52, 51, 7,117,110,105, 50, - 48, 52, 53, 7,117,110,105, 50, 48, 52, 54, 7,117,110,105, 50, 48, 52, 55, 7,117,110,105, 50, 48, 52, 56, 7,117,110,105, 50, - 48, 52, 57, 7,117,110,105, 50, 48, 52, 65, 7,117,110,105, 50, 48, 52, 66, 7,117,110,105, 50, 48, 52, 67, 7,117,110,105, 50, - 48, 52, 68, 7,117,110,105, 50, 48, 52, 69, 7,117,110,105, 50, 48, 52, 70, 7,117,110,105, 50, 48, 53, 48, 7,117,110,105, 50, - 48, 53, 49, 7,117,110,105, 50, 48, 53, 50, 7,117,110,105, 50, 48, 53, 51, 7,117,110,105, 50, 48, 53, 52, 7,117,110,105, 50, - 48, 53, 53, 7,117,110,105, 50, 48, 53, 54, 7,117,110,105, 50, 48, 53, 55, 7,117,110,105, 50, 48, 53, 56, 7,117,110,105, 50, - 48, 53, 57, 7,117,110,105, 50, 48, 53, 65, 7,117,110,105, 50, 48, 53, 66, 7,117,110,105, 50, 48, 53, 67, 7,117,110,105, 50, - 48, 53, 68, 7,117,110,105, 50, 48, 53, 69, 7,117,110,105, 50, 48, 55, 48, 7,117,110,105, 50, 48, 55, 49, 7,117,110,105, 50, - 48, 55, 52, 7,117,110,105, 50, 48, 55, 53, 7,117,110,105, 50, 48, 55, 54, 7,117,110,105, 50, 48, 55, 55, 7,117,110,105, 50, - 48, 55, 56, 7,117,110,105, 50, 48, 55, 57, 7,117,110,105, 50, 48, 55, 65, 7,117,110,105, 50, 48, 55, 66, 7,117,110,105, 50, - 48, 55, 67, 7,117,110,105, 50, 48, 55, 68, 7,117,110,105, 50, 48, 55, 69, 7,117,110,105, 50, 48, 55, 70, 7,117,110,105, 50, - 48, 56, 48, 7,117,110,105, 50, 48, 56, 49, 7,117,110,105, 50, 48, 56, 50, 7,117,110,105, 50, 48, 56, 51, 7,117,110,105, 50, - 48, 56, 52, 7,117,110,105, 50, 48, 56, 53, 7,117,110,105, 50, 48, 56, 54, 7,117,110,105, 50, 48, 56, 55, 7,117,110,105, 50, - 48, 56, 56, 7,117,110,105, 50, 48, 56, 57, 7,117,110,105, 50, 48, 56, 65, 7,117,110,105, 50, 48, 56, 66, 7,117,110,105, 50, - 48, 56, 67, 7,117,110,105, 50, 48, 56, 68, 7,117,110,105, 50, 48, 56, 69, 7,117,110,105, 50, 48, 65, 48, 13, 99,111,108,111, -110,109,111,110,101,116, 97,114,121, 7,117,110,105, 50, 48, 65, 50, 4,108,105,114, 97, 7,117,110,105, 50, 48, 65, 53, 7,117, -110,105, 50, 48, 65, 54, 6,112,101,115,101,116, 97, 7,117,110,105, 50, 48, 65, 56, 7,117,110,105, 50, 48, 65, 57, 9, 97,102, -105,105, 53, 55, 54, 51, 54, 4,100,111,110,103, 4, 69,117,114,111, 7,117,110,105, 50, 48, 65, 68, 7,117,110,105, 50, 48, 65, - 69, 7,117,110,105, 50, 48, 65, 70, 7,117,110,105, 50, 48, 66, 49, 7,117,110,105, 50, 48, 66, 52, 7,117,110,105, 50, 48, 66, - 53, 7,117,110,105, 50, 48, 68, 54, 7,117,110,105, 50, 48, 68, 55, 7,117,110,105, 50, 49, 48, 48, 7,117,110,105, 50, 49, 48, - 51, 7,117,110,105, 50, 49, 48, 52, 9, 97,102,105,105, 54, 49, 50, 52, 56, 7,117,110,105, 50, 49, 48, 54, 7,117,110,105, 50, - 49, 48, 57, 7,117,110,105, 50, 49, 48, 69, 7,117,110,105, 50, 49, 48, 70, 8, 73,102,114, 97,107,116,117,114, 9, 97,102,105, -105, 54, 49, 50, 56, 57, 9, 97,102,105,105, 54, 49, 51, 53, 50, 7,117,110,105, 50, 49, 49, 55, 11,119,101,105,101,114,115,116, -114, 97,115,115, 8, 82,102,114, 97,107,116,117,114, 7,117,110,105, 50, 49, 49, 68, 12,112,114,101,115, 99,114,105,112,116,105, -111,110, 7,117,110,105, 50, 49, 50, 48, 7,117,110,105, 50, 49, 50, 49, 7,117,110,105, 50, 49, 50, 54, 7,117,110,105, 50, 49, - 50, 55, 7,117,110,105, 50, 49, 50, 65, 7,117,110,105, 50, 49, 50, 66, 9,101,115,116,105,109, 97,116,101,100, 7,117,110,105, - 50, 49, 51, 50, 7,117,110,105, 50, 49, 51, 52, 5, 97,108,101,112,104, 7,117,110,105, 50, 49, 51, 66, 7,117,110,105, 50, 49, - 52, 66, 8,111,110,101,116,104,105,114,100, 9,116,119,111,116,104,105,114,100,115, 7,117,110,105, 50, 49, 53, 53, 7,117,110, -105, 50, 49, 53, 54, 7,117,110,105, 50, 49, 53, 55, 7,117,110,105, 50, 49, 53, 56, 7,117,110,105, 50, 49, 53, 57, 7,117,110, -105, 50, 49, 53, 65, 9,111,110,101,101,105,103,104,116,104, 12,116,104,114,101,101,101,105,103,104,116,104,115, 11,102,105,118, -101,101,105,103,104,116,104,115, 12,115,101,118,101,110,101,105,103,104,116,104,115, 7,117,110,105, 50, 49, 53, 70, 7,117,110, -105, 50, 49, 54, 48, 7,117,110,105, 50, 49, 54, 49, 7,117,110,105, 50, 49, 54, 50, 7,117,110,105, 50, 49, 54, 51, 7,117,110, -105, 50, 49, 54, 52, 7,117,110,105, 50, 49, 54, 53, 7,117,110,105, 50, 49, 54, 54, 7,117,110,105, 50, 49, 54, 55, 7,117,110, -105, 50, 49, 54, 56, 7,117,110,105, 50, 49, 54, 57, 7,117,110,105, 50, 49, 54, 65, 7,117,110,105, 50, 49, 54, 66, 7,117,110, -105, 50, 49, 54, 67, 7,117,110,105, 50, 49, 54, 68, 7,117,110,105, 50, 49, 54, 69, 7,117,110,105, 50, 49, 54, 70, 7,117,110, -105, 50, 49, 55, 48, 7,117,110,105, 50, 49, 55, 49, 7,117,110,105, 50, 49, 55, 50, 7,117,110,105, 50, 49, 55, 51, 7,117,110, -105, 50, 49, 55, 52, 7,117,110,105, 50, 49, 55, 53, 7,117,110,105, 50, 49, 55, 54, 7,117,110,105, 50, 49, 55, 55, 7,117,110, -105, 50, 49, 55, 56, 7,117,110,105, 50, 49, 55, 57, 7,117,110,105, 50, 49, 55, 65, 7,117,110,105, 50, 49, 55, 66, 7,117,110, -105, 50, 49, 55, 67, 7,117,110,105, 50, 49, 55, 68, 7,117,110,105, 50, 49, 55, 69, 7,117,110,105, 50, 49, 55, 70, 7,117,110, -105, 50, 49, 56, 48, 7,117,110,105, 50, 49, 56, 49, 7,117,110,105, 50, 49, 56, 50, 7,117,110,105, 50, 49, 56, 51, 9, 97,114, -114,111,119,108,101,102,116, 7, 97,114,114,111,119,117,112, 10, 97,114,114,111,119,114,105,103,104,116, 9, 97,114,114,111,119, -100,111,119,110, 9, 97,114,114,111,119, 98,111,116,104, 9, 97,114,114,111,119,117,112,100,110, 7,117,110,105, 50, 49, 57, 54, - 7,117,110,105, 50, 49, 57, 55, 7,117,110,105, 50, 49, 57, 56, 7,117,110,105, 50, 49, 57, 57, 14, 99, 97,114,114,105, 97,103, -101,114,101,116,117,114,110, 7,117,110,105, 50, 50, 49, 51, 7,117,110,105, 50, 50, 49, 52, 7,117,110,105, 50, 50, 49, 54, 12, - 97,115,116,101,114,105,115,107,109, 97,116,104, 7,117,110,105, 50, 50, 49, 56, 7,117,110,105, 50, 50, 49, 66, 7,117,110,105, - 50, 50, 49, 67, 12,112,114,111,112,111,114,116,105,111,110, 97,108, 7,117,110,105, 50, 51, 49, 56, 7,117,110,105, 50, 51, 49, - 57, 7,117,110,105, 50, 51, 50, 53, 9, 97,110,103,108,101,108,101,102,116, 10, 97,110,103,108,101,114,105,103,104,116, 7,117, -110,105, 50, 52, 54, 48, 7,117,110,105, 50, 52, 54, 49, 7,117,110,105, 50, 52, 54, 50, 7,117,110,105, 50, 52, 54, 51, 7,117, -110,105, 50, 52, 54, 52, 7,117,110,105, 50, 52, 54, 53, 7,117,110,105, 50, 52, 54, 54, 7,117,110,105, 50, 52, 54, 55, 7,117, -110,105, 50, 52, 54, 56, 7,117,110,105, 50, 52, 54, 57, 7,117,110,105, 50, 54, 66, 48, 7,117,110,105, 50, 54, 66, 49, 7,117, -110,105, 50, 56, 48, 48, 7,117,110,105, 70, 66, 48, 48, 7,117,110,105, 70, 66, 48, 51, 7,117,110,105, 70, 66, 48, 52, 7,117, -110,105, 70, 66, 48, 53, 7,117,110,105, 70, 66, 48, 54, 7,117,110,105, 70, 66, 49, 51, 7,117,110,105, 70, 66, 49, 52, 7,117, -110,105, 70, 66, 49, 53, 7,117,110,105, 70, 66, 49, 54, 7,117,110,105, 70, 66, 49, 55, 7,117,110,105, 70, 70, 70, 68, 9,100, -108, 76,116, 99, 97,114,111,110, 8, 68,105,101,114,101,115,105,115, 5, 65, 99,117,116,101, 5, 84,105,108,100,101, 5, 71,114, - 97,118,101, 10, 67,105,114, 99,117,109,102,108,101,120, 5, 67, 97,114,111,110, 12,117,110,105, 48, 51, 49, 49, 46, 99, 97,115, -101, 5, 66,114,101,118,101, 9, 68,111,116, 97, 99, 99,101,110,116, 12, 72,117,110,103, 97,114,117,109,108, 97,117,116, 11, 68, -111,117, 98,108,101, 97, 99,117,116,101, 11,117,110,105, 48, 51, 48, 56, 48, 51, 48, 52, 11,117,110,105, 48, 51, 48, 52, 48, 51, - 48, 56, 11,117,110,105, 48, 51, 48, 55, 48, 51, 48, 52, 11,117,110,105, 48, 51, 48, 56, 48, 51, 48, 49, 11,117,110,105, 48, 51, - 48, 56, 48, 51, 48, 48, 11,117,110,105, 48, 51, 48, 52, 48, 51, 48, 49, 11,117,110,105, 48, 51, 48, 52, 48, 51, 48, 48, 11,117, -110,105, 48, 51, 48, 51, 48, 51, 48, 52, 11,117,110,105, 48, 51, 48, 56, 48, 51, 48, 67, 11,117,110,105, 48, 51, 48, 51, 48, 51, - 48, 56, 11,117,110,105, 48, 51, 48, 67, 48, 51, 48, 55, 11,117,110,105, 48, 51, 48, 51, 48, 51, 48, 49, 11,117,110,105, 48, 51, - 48, 50, 48, 51, 48, 49, 11,117,110,105, 48, 51, 48, 50, 48, 51, 48, 48, 11,117,110,105, 48, 51, 48, 50, 48, 51, 48, 51, 11,117, -110,105, 48, 51, 48, 54, 48, 51, 48, 51, 11,117,110,105, 48, 51, 48, 54, 48, 51, 48, 49, 11,117,110,105, 48, 51, 48, 54, 48, 51, - 48, 48, 11,117,110,105, 48, 51, 48, 54, 48, 51, 48, 57, 11,117,110,105, 48, 51, 48, 50, 48, 51, 48, 57, 0, 0, 0, 2, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 20,108, 0, 0, 0, 16, 0, 0, 0, 7, 0, 1, 0, 2, 0, 0, 0, 1,255,255,255,255, - 0, 1, 0, 3, 0, 0, 0, 0,255,255,255,254, 0, 1, 0, 2, 0, 0, 0, 1,255,255,255,255, 0, 1, 0, 3, 0, 0, 0, 0, -255,255,255,254, 0, 1, 0, 4, 0, 0, 0, 2,255,255,255,255, 0, 1, 0, 5, 0, 0, 0, 0,255,255,255,253, 0, 1, 0, 4, - 0, 0, 0, 2,255,255,255,255, 0, 1, 0, 5, 0, 0, 0, 0,255,255,255,253, 0, 1, 0, 4, 0, 0, 0, 2,255,255,255,255, - 0, 1, 0, 5, 0, 0, 0, 0,255,255,255,253, 0, 2, 0, 2, 0, 0, 0, 4,255,255,255,255, 0, 2, 0, 0, 0, 0, 0, 0, -255,255,255,251, 0, 11, 0, 2, 0, 0, 0, 8,255,255,255,255, 0, 11, 0, 0, 0, 0, 0, 0,255,255,255,247, 0, 0, 0, 0, -255,255,255,255,255,255,255,255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,176, 64, 0, 0, 1, 0, 0, 0, 4, - 0, 0, 0, 6, 0, 0, 0, 20, 0, 0, 0,242, 0, 0, 1, 34, 0, 0, 1, 98, 0, 4, 0, 6, 0, 10, 0, 48, 0, 3, 0, 12, - 2, 92, 2, 72, 0, 78, 2, 97, 2, 94, 0,120, 2,104, 2,100, 0,128, 2,110, 2,107, 0,138, 2,123, 2,113, 0,146, 2,138, - 2,129, 0,168, 2,140, 2,140, 0,188, 2,154, 2,142, 0,190, 4,123, 4,123, 0,216, 5,253, 5,252, 0,218,255,255,255,255, - 0, 0, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, - 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 4, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 0, 1, 0, 2, 0, 3, 0, 3, 0, 4, 0, 3, 0, 5, 0, 4, 0, 6, 0, 6, 0, 7, 0, 6, 0, 5, - 0, 7, 0, 0, 0, 0,255,255,255,255, 0, 2,128, 0,255,255, 0, 0, 0, 1, 0, 0,255,255,255,255, 0, 0, 0, 0, 0, 1, -255,255, 0, 2, 0, 0,255,255,255,255, 0, 3,128, 0,255,255, 0, 2, 0, 0, 0, 0, 0, 3,255,255, 0, 3, 0, 0,255,255, -255,255, 0, 0, 0, 16, 0, 0, 0, 28, 0, 0, 0, 40, 0, 0, 0, 52, 0, 4, 0, 6, 0, 0, 0, 0,255,255, 0, 0, 0, 4, - 0, 6, 0, 0, 0, 0,255,255, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0,255,255, 0, 0, 0, 4, 0, 6, 0, 0, 0, 0,255,255, - 0, 0, 0, 0, 0, 0, 4, 52, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 22, 0, 0, 0, 28, 0, 0, 0,160, 0, 0, 2,132, - 0, 0, 3, 38, 0, 0, 3,186, 0, 0, 4, 4, 0, 4, 0, 6, 0, 13, 0, 48, 0, 3, 0, 30, 0, 3, 0, 3, 0, 96, 0, 17, - 0, 17, 0, 98, 0, 41, 0, 41, 0,100, 0, 81, 0, 81, 0,102, 0,114, 0,114, 0,104, 2, 21, 2, 21, 0,106, 2, 73, 2, 73, - 0,108, 2, 76, 2, 75, 0,110, 2, 80, 2, 78, 0,114, 2, 83, 2, 82, 0,120, 2,112, 2,111, 0,124, 5,159, 5,159, 0,128, - 5,162, 5,162, 0,130,255,255,255,255, 0, 0, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, - 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, - 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 4, 0, 7, 0, 8, - 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 17, - 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 18, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 19, 0, 0, 0, 3, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 2, 0, 0, 0, 20, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 6, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, - 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 22, 0, 23, 0, 22, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 24, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, - 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 25, 0, 26, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 0, - 0, 3,128, 0, 0, 0, 0, 5,128, 0, 0, 0, 0, 6,128, 0, 0, 0, 0, 7,128, 0, 0, 0, 0, 9,128, 0, 0, 0, 0, 0, -160, 0, 0, 0, 0, 0,160, 0, 0, 2, 0, 0,160, 0, 0, 4, 0, 0,160, 0, 0, 6, 0, 0,160, 0, 0, 8, 0, 0,160, 0, - 0, 10, 0, 0,160, 0, 0, 12, 0, 0,160, 0, 0, 14, 0, 0,160, 0, 0, 16, 0, 0,160, 0, 0, 18, 0, 4,128, 0, 0, 0, - 0, 0,160, 0, 0, 20, 0, 0,160, 0, 0, 23, 0, 0,160, 0, 0, 25, 0, 8,128, 0, 0, 0, 0, 0, 96, 0, 0, 27, 0, 0, -160, 0, 0, 29, 0, 10,128, 0, 0, 0, 0, 0, 96, 0, 0, 32, 0, 0,160, 0, 0, 34, 63,255,253,183,191,255,255,254, 63,255, -253,183,128, 0, 0, 0, 63,255,253,184,128, 0, 0, 2, 63,255,253,184,128, 0, 0, 4, 63,255,253,185,128, 0, 0, 6, 63,255, -253,186,128, 0, 0, 8, 63,255,253,186,128, 0, 0, 10, 63,255,253,187,128, 0, 0, 12, 63,255,253,161,128, 0, 0, 14, 63,255, -253,162,128, 0, 0, 16, 0, 0, 0, 3, 0, 0, 0, 4,128, 0, 0, 5, 63,255,255,238,191,255,255,166, 63,255,255,200,191,255, -254, 5, 63,255,250,124,191,255,250,125, 63,255,250,126, 63,255,250,127,191,255,250,128, 63,255,250,126,191,255,250,127, 63,255, -250,128, 63,255,250,129,191,255,250,130, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, - 0, 5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, - 0, 0, 0, 13, 0, 0, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 16, 0,118, 2, 53, 0,113, 2, 49, 2, 50, 0,106, - 2, 51, 2, 54, 0,122, 2, 52, 5,155, 6, 3, 1, 11, 5,160, 5,161, 5,163, 5,164, 0, 0, 0, 0, 0,144, 0, 0, 0, 2, - 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 28, 0, 0, 0, 62, 0, 0, 0, 98, 0, 0, 0,116, 0, 0, 0,124, 0, 0, 0,128, - 0, 4, 0, 6, 0, 2, 0, 12, 0, 1, 0, 0, 4, 86, 4, 86, 0, 30, 4,115, 4,115, 0, 32,255,255,255,255, 0, 0, 0, 4, - 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 0, 0, 0,160, 0, 0, 0, 63,255,251,141,191,255,251,171, - 0, 0, 0, 0, 4,120, 0, 0, 0, 0, 1, 48, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 10, 0, 0, 0, 28, 0, 0, 0, 94, - 0, 0, 0,174, 0, 0, 0,222, 0, 0, 1, 6, 0, 0, 1, 26, 0, 4, 0, 6, 0, 6, 0, 24, 0, 2, 0, 12, 4, 86, 4, 86, - 0, 54, 4, 92, 4, 92, 0, 56, 4, 94, 4, 94, 0, 58, 4,101, 4,101, 0, 60, 4,103, 4,103, 0, 62, 4,111, 4,111, 0, 64, -255,255,255,255, 0, 0, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 4, 0, 5, 0, 1, 0, 6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, - 0, 2, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 0, 0, 3,128, 0, 0, 0, 0, 0,160, 0, 0, 0, 0, 0,160, 0, 0, 2, - 0, 0,160, 0, 0, 4, 0, 0,160, 0, 0, 6, 0, 0,160, 0, 0, 8, 63,255,251,170,191,255,251,156, 63,255,251,166,191,255, -251,158, 63,255,251,166,191,255,251,160, 63,255,251,159,191,255,251,162, 63,255,251,161,191,255,251,154, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 6,126, 6,127, 6,129, 6,125, 6,128, 0, 0, 4,228, 0, 0, 0, 2, - 0, 0, 0, 2, 0, 0, 0, 23, 0, 0, 0, 28, 0, 0, 0,162, 0, 0, 3, 84, 0, 0, 3,246, 0, 0, 4,122, 0, 0, 4,188, - 0, 4, 0, 6, 0, 13, 0, 48, 0, 3, 0, 30, 0, 18, 0, 18, 0, 96, 0, 36, 0, 36, 0, 98, 0, 41, 0, 40, 0,100, 0, 48, - 0, 47, 0,104, 0, 55, 0, 53, 0,108, 0, 59, 0, 59, 0,114, 0, 68, 0, 68, 0,116, 0, 70, 0, 70, 0,118, 0, 73, 0, 73, - 0,120, 0, 76, 0, 76, 0,122, 0, 79, 0, 79, 0,124, 0, 82, 0, 82, 0,126, 0, 88, 0, 86, 0,128,255,255,255,255, 0, 0, - 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, - 0, 20, 0, 21, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, - 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, - 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 10, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, - 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 14, 0, 0, 0, 2, 0, 3, - 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, - 0, 5, 0, 16, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, - 0, 7, 0, 0, 0, 0, 0, 18, 0, 8, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 2, 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 20, 0, 21, 0, 22, 0, 0, 0, 8, 0, 0, 0, 0, 0, 23, 0, 23, - 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 23, 0, 24, - 0, 25, 0, 23, 0, 23, 0, 23, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, - 0, 3, 0, 4, 0, 0, 0, 5, 0, 6, 0, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -128, 0, 0, 0, 0, 4,128, 0, 0, 0, 0, 5,128, 0, 0, 0, 0, 6,128, 0, 0, 0, 0, 8,128, 0, 0, 0, 0, 10,128, 0, - 0, 0, 0, 12,128, 0, 0, 0, 0, 14,128, 0, 0, 0, 0, 3,128, 0, 0, 0, 0, 0,160, 0, 0, 0, 0, 0,160, 0, 0, 3, - 0, 0,160, 0, 0, 5, 0, 7,128, 0, 0, 0, 0, 0,160, 0, 0, 7, 0, 9,128, 0, 0, 0, 0, 0,160, 0, 0, 10, 0, 11, -128, 0, 0, 0, 0, 0,160, 0, 0, 13, 0, 0,160, 0, 0, 16, 0, 13,128, 0, 0, 0, 0, 0,160, 0, 0, 19, 0, 0,160, 0, - 0, 21, 0, 0, 96, 0, 0, 23, 0, 0,160, 0, 0, 25, 0, 0,160, 0, 0, 28, 0, 0,160, 0, 0, 31, 63,255,255,197, 63,255, -255,221,191,255,255,217, 63,255,255,173,191,255,255,207, 63,255,255,213,191,255,255,208, 63,255,255,216, 63,255,255,224,191,255, -255,210, 63,255,255,196, 63,255,255,249,191,255,255,200, 63,255,255,187, 63,255,255,252,191,255,255,201, 63,255,255,184, 63,255, -255,255,191,255,255,204, 63,255,255,199,191,255,255,203, 63,255,255,198,191,255,255,205, 63,255,255,206,191,255,255,207, 63,255, -255,205, 63,255,255,209,191,255,255,210, 63,255,255,205, 63,255,255,212,191,255,255,213, 63,255,255,200,191,255,255,202, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 0, - 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, - 6, 25, 5,241, 6, 14, 6, 15, 5,254, 6, 1, 6, 2, 6,119, 6,120, 6,118, 6,121, 6,122, 6,124, 0, 0, 0, 0, 0,220, - 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 28, 0, 0, 0, 62, 0, 0, 0,110, 0, 0, 0,152, 0, 0, 0,184, - 0, 0, 0,200, 0, 4, 0, 6, 0, 2, 0, 12, 0, 1, 0, 0, 0, 4, 0, 4, 0, 30, 0, 34, 0, 34, 0, 32,255,255,255,255, - 0, 0, 0, 4, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, - 0, 0, 0, 3,128, 0, 0, 0, 0, 0,160, 0, 0, 0, 0, 0,160, 0, 0, 2, 0, 0,160, 0, 0, 4, 0, 0,160, 0, 0, 6, - 63,255,255,252,191,255,255,253, 63,255,255,224,191,255,255,255, 0, 0, 0, 0,191,255,255,227, 63,255,255,228,191,255,255,229, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 5,169, 5,182, 5,181, 5,180, 0, 0, 6, 56, 0, 0, 0, 2, - 0, 0, 0, 8, 0, 0, 0, 14, 0, 0, 0, 28, 0, 0, 0, 84, 0, 0, 2,132, 0, 0, 3,182, 0, 0, 5, 46, 0, 0, 5,234, - 0, 4, 0, 6, 0, 3, 0, 12, 0, 1, 0, 6, 0, 18, 0, 18, 0, 36, 0, 27, 0, 20, 0, 38, 5,177, 5,177, 0, 54,255,255, -255,255, 0, 0, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 1, 0, 2, 0, 3, - 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 8, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, - 0, 14, 0, 9, 0, 15, 0, 9, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 16, - 0, 22, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 24, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 25, 0, 4, 0, 26, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 27, 0, 4, 0, 28, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 2, 0, 3, 0, 31, 0, 32, 0, 0, 0, 6, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, - 0, 34, 0, 35, 0, 0, 0, 6, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, - 0, 0, 0, 6, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 39, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 40, 0, 0, 0, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 42, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 43, 0, 6, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 45, 0, 6, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 1, - 0, 2, 0, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, - 0, 4, 0, 5, 0, 0, 0, 6, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, - 0, 0, 0, 6, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,128, 0, 0, 0, 0, 5,128, 0, 0, 0, 0, 8,128, 0, 0, 0, - 0, 11,128, 0, 0, 0, 0, 14,128, 0, 0, 0, 0, 17,128, 0, 0, 0, 0, 4,128, 0, 0, 0, 0, 3,128, 0, 0, 0, 0, 0, - 96, 0, 0, 0, 0, 0,160, 0, 0, 2, 0, 0,160, 0, 0, 5, 0, 0,160, 0, 0, 8, 0, 0,160, 0, 0, 11, 0, 0,160, 0, - 0, 14, 0, 0,160, 0, 0, 17, 0, 0, 96, 0, 0, 20, 0, 0,160, 0, 0, 22, 0, 0,160, 0, 0, 25, 0, 0,160, 0, 0, 28, - 0, 0,160, 0, 0, 31, 0, 0,160, 0, 0, 34, 0, 0,160, 0, 0, 37, 0, 7,128, 0, 0, 0, 0, 6,128, 0, 0, 0, 0, 0, -160, 0, 0, 40, 0, 0,160, 0, 0, 43, 0, 0,160, 0, 0, 46, 0, 0,160, 0, 0, 49, 0, 10,128, 0, 0, 0, 0, 9,128, 0, - 0, 0, 0, 0,160, 0, 0, 52, 0, 0,160, 0, 0, 55, 0, 0,160, 0, 0, 58, 0, 0,160, 0, 0, 61, 0, 0,160, 0, 0, 64, - 0, 0,160, 0, 0, 67, 0, 13,128, 0, 0, 0, 0, 12,128, 0, 0, 0, 0, 0,160, 0, 0, 70, 0, 0,160, 0, 0, 73, 0, 16, -128, 0, 0, 0, 0, 15,128, 0, 0, 0, 0, 0,160, 0, 0, 76, 0, 0,160, 0, 0, 79, 0, 0,160, 0, 0, 82, 0, 0,160, 0, - 0, 85, 0, 19,128, 0, 0, 0, 0, 18,128, 0, 0, 0, 0, 0,160, 0, 0, 88, 0, 0,160, 0, 0, 91, 63,255,250, 79,191,255, -255,237, 63,255,255,237, 63,255,250, 82,191,255,255,240, 63,255,255,239, 63,255,250, 85,191,255,255,243, 63,255,255,241, 63,255, -250, 88,191,255,255,246, 63,255,255,243, 63,255,250, 91,191,255,255,249, 63,255,255,245, 63,255,250, 94,191,255,255,252, 63,255, -255,246, 63,255,250, 97,191,255,255,255, 0, 0, 0, 2,128, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 5,128, 0, 0, 4, 0, 0, - 0, 3, 0, 0, 0, 8,128, 0, 0, 7, 0, 0, 0, 5, 0, 0, 0, 11,128, 0, 0, 10, 0, 0, 0, 7, 0, 0, 0, 14,128, 0, - 0, 13, 0, 0, 0, 9, 0, 0, 0, 17,128, 0, 0, 16, 0, 0, 0, 10, 0, 0, 0, 20,128, 0, 0, 19, 0, 0, 0, 18, 63,255, -250,120,128, 0, 0, 21, 0, 0, 0, 19, 63,255,250,123,128, 0, 0, 24, 0, 0, 0, 24, 0, 0, 0, 29,128, 0, 0, 27, 0, 0, - 0, 25, 0, 0, 0, 32,128, 0, 0, 30, 0, 0, 0, 29, 63,255,250,132,128, 0, 0, 32, 0, 0, 0, 31, 63,255,250,135,128, 0, - 0, 35, 0, 0, 0, 31, 63,255,250,138,128, 0, 0, 38, 0, 0, 0, 38, 0, 0, 0, 44,128, 0, 0, 41, 0, 0, 0, 40, 0, 0, - 0, 47,128, 0, 0, 44, 0, 0, 0, 40, 0, 0, 0, 50,128, 0, 0, 47, 0, 0, 0, 46, 63,255,250,150,128, 0, 0, 49, 0, 0, - 0, 49, 0, 0, 0, 56,128, 0, 0, 52, 0, 0, 0, 51, 63,255,250,156,128, 0, 0, 54, 0, 0, 0, 52, 63,255,250,159,128, 0, - 0, 57, 0, 0, 0, 57, 0, 0, 0, 65,128, 0, 0, 60, 0, 0, 0, 58, 0, 0, 0, 68,128, 0, 0, 63, 0, 0, 0, 61, 63,255, -250,168,128, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 74,128, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, - 0, 0, 0, 8, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, - 0, 13, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 18, - 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 24, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, - 0, 29, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 31, 6, 39, 0,127, 6, 27, 0,126, 6, 29, 6, 33, 6, 35, 6, 39, 0,127, - 6, 27, 0,126, 6, 29, 6, 33, 6, 35, 6, 28, 6, 30, 6, 28, 6, 30, 0,128, 6, 31, 6, 36, 0,128, 6, 31, 6, 36, 6, 32, - 6, 32, 6, 34, 6, 37, 6, 34, 6, 37, 6, 38, 6, 38, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 60, 0, 0, 1, 0, 0, 1, 0, 2, 0, 0, 0, 64, 0, 0, 1, 1, 0, 2, 0, 1, 0, 0, 0, 72,192, 0, 1, 2, - 0, 11, 0, 1, 0, 0, 0, 76,192, 0, 1, 3, 0, 0, 1, 4, 0, 2, 1, 5, 0, 4, 1, 6, 0, 2, 1, 7, 0, 2, 1, 8, - 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 6, 0, 97, 1,128, 0, 6, 0,198, 0, 3, 0, 3, 0, 10, 0, 5, 0, 4, 0, 11, - 0, 8, 0, 6, 0, 5, 0, 10, 0, 9, 0, 11, 0, 11, 0, 11, 17, 11, 0, 12, 0, 12, 31, 11, 0, 13, 0, 13, 0, 11, 0, 14, - 0, 14, 0, 4, 0, 15, 0, 15, 0, 7, 0, 16, 0, 16, 0, 4, 0, 18, 0, 17, 0, 7, 0, 28, 0, 19, 0, 3, 0, 29, 0, 29, - 0, 7, 0, 30, 0, 30, 0, 11, 0, 31, 0, 31, 18, 11, 0, 32, 0, 32, 0, 11, 0, 33, 0, 33, 30, 11, 0, 35, 0, 34, 0, 11, - 0, 62, 0, 62, 18, 11, 0, 63, 0, 63, 0, 11, 0, 64, 0, 64, 30, 11, 0, 67, 0, 65, 0, 11, 0, 94, 0, 94, 18, 11, 0, 95, - 0, 95, 0, 11, 0, 96, 0, 96, 30, 11, 0, 97, 0, 97, 0, 11, 0, 98, 0, 98, 0, 7, 0, 99, 0, 99, 0, 11, 0,103, 0,100, - 0, 5, 0,107, 0,104, 0, 11, 0,113, 0,109, 0, 11, 0,115, 0,114, 0, 5, 0,117, 0,116, 0, 3, 0,118, 0,118, 0, 11, - 0,122, 0,120, 0, 11, 0,123, 0,123, 0, 3, 0,129, 0,125, 0, 11, 0,153, 0,153, 0, 11, 0,185, 0,185, 0, 11, 2, 19, - 2, 18, 0, 11, 2, 40, 2, 27, 0, 11, 2, 56, 2, 43, 0, 11, 2, 68, 2, 62, 0, 11, 2, 71, 2, 70, 0, 11, 2,154, 2, 72, -128, 11, 2,156, 2,155, 0, 11, 2,160, 2,157,128, 11, 2,162, 2,161, 0, 11, 2,166, 2,164, 0, 11, 2,168, 2,168, 0, 11, - 3, 19, 3, 19, 0, 11, 3,163, 3,160,128, 11, 3,165, 3,164, 0, 11, 4,122, 4,122, 0, 11, 4,123, 4,123, 0, 7, 5,116, - 5,114, 0, 11, 5,127, 5,117, 0, 10, 5,130, 5,128, 0, 11, 5,132, 5,131, 0, 10, 5,156, 5,133, 0, 11, 5,161, 5,157, - 0, 5, 5,165, 5,162, 0, 11, 5,166, 5,166, 17, 11, 5,167, 5,167, 31, 11, 5,176, 5,168, 0, 11, 5,177, 5,177, 0, 7, - 5,178, 5,178, 17, 11, 5,179, 5,179, 31, 11, 5,203, 5,180, 0, 11, 5,204, 5,204, 0, 3, 5,211, 5,206, 0, 3, 5,213, - 5,212, 0, 4, 5,214, 5,214, 0, 11, 5,215, 5,215, 17, 11, 5,216, 5,216, 31, 11, 5,227, 5,218, 0, 3, 5,229, 5,228, - 0, 4, 5,230, 5,230, 0, 11, 5,231, 5,231, 17, 11, 5,232, 5,232, 31, 11, 5,251, 5,233, 0, 5, 5,253, 5,252,128, 11, - 6, 3, 5,254, 0, 11, 6, 10, 6, 8, 0, 11, 6, 16, 6, 13, 0, 11, 6, 18, 6, 18, 0, 11, 6, 21, 6, 21, 0, 5, 6, 22, - 6, 22, 0, 11, 6, 39, 6, 25, 0, 11, 6, 86, 6, 76, 0, 11, 6, 87, 6, 87, 0, 4, 6, 88, 6, 88, 0, 5, 6,102, 6, 89, - 0, 11, 6,103, 6,103, 17, 11, 6,104, 6,104, 31, 11, 6,116, 6,105, 0, 11, 6,130, 6,130, 0, 1,255,255,255,255, 0, 0, -}; - diff --git a/source/blender/src/blenderbuttons.c b/source/blender/src/blenderbuttons.c deleted file mode 100644 index c8fb9ec7a7a..00000000000 --- a/source/blender/src/blenderbuttons.c +++ /dev/null @@ -1,2020 +0,0 @@ -/* DataToC output of file */ - -int datatoc_blenderbuttons_size= 64418; -char datatoc_blenderbuttons[]= { -137, 80, - 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 2, 0, 0, 0, 1, 0, 8, 6, 0, 0, 0,197,144,206,103, 0, - 0, 0, 1,115, 82, 71, 66, 0,174,206, 28,233, 0, 0, 0, 6, 98, 75, 71, 68, 0,255, 0,255, 0,255,160,189,167,147, 0, 0, - 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,215, 11, 26, 20, - 59, 43, 0,186, 29, 9, 0, 0, 32, 0, 73, 68, 65, 84,120,218,236,125,121, 92, 84, 85,255,255,251,220,217,217, 23, 1, 21,151, -193,125, 95,201, 37, 55, 40, 53,243,155,153, 6,148,154,100,101, 98,137,218,147,166, 61,101,143,250,211, 71,197,164, 50, 53,161, -167,210,172, 52, 5,115,201, 45, 81, 7,245, 81, 82,113, 47, 23, 20, 69, 4, 69,150, 97, 22,102,187,115,151,223, 31, 51, 67, 3, - 2,179,128, 91,207,188, 95,220,215,229,222,123,238,103,206, 61,219,103, 61,231,144, 30, 61,122,240,240,192, 3, 15, 60,240,192, - 3, 15,254,167, 64,121,138,192, 3, 15, 60,240,192, 3, 15,254,119,112,230,236, 1, 0, 0,241, 88, 0, 60,240,192, 3, 15, 60, -240,192, 99, 1,240,192, 3, 15, 60,240,192, 3, 15, 60, 2,128, 7, 30,120,224,129, 7, 30,120,224, 17, 0, 60,240,192, 3, 15, - 60,240,192,131,191, 5,132,246, 23,231,206,157, 35,238, 18,170, 41,150,192, 67,207, 67,175, 54,164,166,166,242,107,215,174,125, -100,249, 27, 55,110, 28,191,105,211, 38,226,169,143, 39,154, 30,234, 65, 15,158,242,243,208,251, 59,211,115, 89, 0,248, 31, 71, -245, 2, 36,143,115, 62, 83, 82, 82, 48,117,234, 84,226,169, 54,247,235,120,216,176, 97,149,215, 25, 25, 25,127,139,178, 28,253, - 82, 66,157, 3,193,142,237,169,127,235, 54, 35, 11,220, 6,169,177, 13, 34, 64,163, 2,123,145, 99,152,247, 56,183, 69, 79,255, -245,224,241,177, 0, 60,140,198, 58,122,244,232,168, 29, 59,118, 40,236,174,163,119,236,216,145,249, 88,244, 72,222, 50,118, 18, -242,216,246, 75, 62, 47, 47, 15, 0, 32,151,203,159,164, 65,196,105,233,116,220,184,113, 78,167,221,180,105,147, 43,130, 26,191, -101,203,150,202,139,109,219,182, 97,216,176, 97, 85,158, 63, 42, 33, 32, 59, 59,155, 7,128,200,200, 72,210, 16,233,118,108, 79, -125,160,245, 23, 30,209, 28, 0,112,207,104, 4, 99, 48, 89,110,170, 52, 0,128,216,216, 88,164,165,165,213,154,191,222,185,189, -249,182,119,219,186,244,227, 63, 15,252,217,137,122,145, 33,240,221,139, 48,238,216,134,242,242, 49, 40, 7,208, 75,246, 41,230, -201, 78,163,185, 20, 40, 49,230, 98,158, 33,206,165,223,141,141,141,141, 74, 75, 75, 83, 84,187, 23,157,150,150,150,249,152,245, -173, 6,105,183, 79,200,247, 54, 56,154, 4, 75,136,143,200,159,152,164, 98,222,164, 50, 80, 21, 6, 13,167, 51,153,255, 39,102, -199, 57, 20, 0,172, 12,219,118,174,111, 67,224,119,236,216,129,133, 91, 22,195,167,185, 63, 42,110,171, 49, 63,110,158,226, 49, -215,184, 31, 39, 16,185, 92,206,231,229,229, 33, 47, 47, 15,251,246,237,195,212,169, 83, 31, 87, 33,192,214,129, 72,106,106,170, - 40, 33, 33,193,188,124,249,242, 83, 0, 48,103,206,156,167,234,122,113,204,152, 49,149,255, 51, 12, 11,218,108, 2,109,162, 65, -211,150,131, 97, 24,204,153, 51,199,165,188,216, 51,255,154, 96, 21, 6,248, 71,105, 9,112, 69,248,121,100, 26,126,128, 31, 46, -220,248, 25, 50, 52, 3,139, 99, 40,254,230, 12,206,231,150, 97,236,178,117, 78,189,222,246,110, 91, 39, 25,186, 5,175,254,247, - 85,135,101, 34, 27, 57, 15, 65,163,223, 66,225,123,189, 0, 67,121,229,253, 51,134, 15,112, 6, 0, 12,192, 96, 89, 44, 14, 6, -158, 70, 0,128,222,229,189,157,106, 51,105,105,105,247,221,180, 99,144,228, 49,234, 99, 13, 49, 6, 60, 9,223,219,160, 24,208, -173, 7,121, 45, 60, 66,168,106,209, 72, 16,218, 49,156, 18,146, 80,162, 87,171, 57, 41,194, 88,170,103, 51,246,245, 81,195, 89, - 39, 73,221,113,225,103,155, 58,145,102,150, 11,244,146, 31,168, 0,176, 99,199, 14,197,150, 79, 62, 66,220,162, 37,138,122, 54, - 2,222,198,248, 1,160, 84, 95, 6, 4, 3,255, 60,184, 0,154, 27,229, 88,243,246,202,199,141,145,213, 54,240, 60,234, 60, 86, - 10, 1, 35, 70,140, 64, 94, 94, 30,228,114,249, 99, 87,118, 10,133,101,220,136,142,142,230, 1, 80,169,169,169,225, 9, 9, 9, -133,203,151, 47, 63,237, 44, 17,134, 97, 64,211,230, 74,198,111,207,252,179,179,179, 17, 25, 25,233, 82,166,226,226,226,236,153, - 45, 50, 50, 50,170, 11, 0, 13,209, 86, 92,174,135,200,200, 72, 50,110,220, 56,126,248,240,225,247, 61,219,191,127,191,205,210, - 97,179,122, 56, 77,191, 33,221, 1,225, 17,205, 81, 88,174,198, 47, 83, 95, 70, 48, 25,128,220,255,204, 70,171, 49,173,144,225, - 2,243,175, 44, 44,171,169,141, 52,128,169, 45,124,203, 49,232,111, 85,160, 48, 33,162,206,116, 23,165, 7,176,176,235, 61, 44, -189,248,113,125,235,179, 33,152,110, 67,210, 64, 3,211,122, 16,223,219, 32,136,143,143,247, 2,240, 52, 0, 31,187,219, 42, 0, - 23, 54,108,216,160,116,150,206, 23,107,191,160,232, 82,147,136, 54, 25,165,229, 48, 75, 69, 34,161, 80, 99,148, 82, 98,177,129, - 19,248,121, 51,180,204,108, 22, 22,221, 49,125,255,205,122,227,235,147, 39,177,206,124,183, 74,165,250,183,237,255,156,156,156, - 82,111,111,111, 74,167,211,113,246,105,250,244,233,243,121, 3, 51,246, 89,245, 45, 83,161, 35,237,255,242,229,203,104,235,227, -103,111, 13,112,199, 10, 80,201,252, 75,245,101, 88,250,236,130,202, 7,111,236,120, 23, 8, 5,198, 44,143,195,182, 57, 91, 92, -105,100,117, 13,110,245,110,168,183,111,223, 6, 0, 52,111,222,188,202,255,112,193,156,221,128,130, 8,169, 77, 8, 48,155, 25, - 91, 60, 64,131,104, 1, 13, 80,150,246,204, 31, 0, 72, 66, 66, 2, 0,220, 73, 77, 77, 13, 76, 72, 72, 40,119,154,249,155,205, -160,105, 19, 76, 52, 13,115, 53,230,207,115,174, 85, 67, 92, 92, 28,178,179,179,255,234, 93,201,201,136,137,137,169,188, 78, 79, - 79,175,183,176, 99, 39,240,212,187,253,217, 51,254,113,227,198,161,103,207,158, 54, 1,192, 85,139, 64,131, 52,194,130, 27,249, -208,109,251, 23,124,222, 92,137,240,136,230, 8, 11,150,225,198,182, 27, 22,230, 31,224,103,113, 1,136, 4,206, 73,176, 13,228, - 99,107,119,233, 58,110,207, 95, 12, 67,218,250,186, 45, 4, 50, 25,140, 70, 35,114,115,115, 81,108,188,138,118, 8,175, 53,173, -213, 12, 94, 87,219, 39,182,126, 98, 77,155,233, 70,255, 34,118,253,154,119,179,159,145, 58, 24,183,211,109,176,166,239,141,137, -137,225, 9, 33, 54, 87, 78,125,190,215,214,151,121,161, 80, 88,175, 58,143,143,143,247, 7, 48,230,224,193,131,255,226, 56,206, -100,215,150,132, 2,129,192, 59, 62, 62,126,242,134, 13, 27,246, 56,228,152,115,103, 9, 75,239,148, 72, 69, 34,137, 55, 37, 36, -126,188, 64,226,197, 9, 4, 66,142, 80,224,136,144,229, 5, 2,147,128, 35, 70,157,128,213,123,139, 69,228,155, 99,123,140,137, - 73,147, 56,228, 59,206, 99,121,121,185, 70,175,215, 51, 0,160,211,233,184,143, 62,250,168,146,225, 47, 89,178,228, 31,245,109, -239, 67,135, 14,157,106,251,255,192,129, 3, 41, 13,209,135, 40, 71,218,255,226, 87, 98, 96, 44, 41,193,236,206, 29, 96,239,187, -119, 90, 11, 25, 61, 58, 10, 64, 21,230, 63,122,244,232,104, 0,100,244,232,209,209,235, 70,127,101,177, 44,182,111, 84, 37,189, - 51,152,179, 38, 7,115,214,228, 96,218,138,203,120,125,209, 31, 24,251,207,115,245, 31,232, 10, 10,156, 18, 12, 30, 22,243,183, -250,252,249, 90, 44, 1, 48,211, 52,250,246,233,211, 16, 66, 6,191,101,203, 22,108,217,178, 5, 10,133,162,242,112, 81,224,225, - 21, 10, 5,162,163,163, 43,153,191,253,195,132,132, 4,149, 51, 3, 19,195,176, 22,205,223,100, 49,253, 87,103,254, 44,203, 66, -103,208,185,244,129, 54,139, 65,117,171, 65,122,122, 58,210,211,211,171, 8, 3, 46,125,111,102,213,241,208,122, 93, 47, 33,209, -198,252,199,141, 27,135,229,203,151, 87, 50,127,145, 80,228, 42,243,183, 13,224,181, 29, 78,195,128,124, 84,140,233, 11, 62,109, - 54, 10,110,228,131, 31,211,241,175, 66, 72,155, 13, 97,147, 16, 32, 32,224,161, 74,198,186,210, 92, 24,210,214,131,231,121, 92, -188,120, 17,131, 7, 15,134, 76, 38,171,194,248, 3, 3, 3, 97, 48, 24, 96, 48, 24, 80, 88, 88,136,241,134, 25,248, 38,240,189, - 90,105, 58,105,242, 38,213,210,186,202,184, 27, 74, 89, 33,181, 48,127,167,219, 96,245,239,141,137,137,225,211,211,211,145,150, -150,134,216,216, 88,190,190,223,107,101,254, 96, 24,198,237, 62, 17, 31, 31, 47, 5,240,246,129, 3, 7, 62, 90,180,104,209, 9, - 66,136,220,118, 0,104, 22, 28, 28,236,117,232,208,161,181,241,241,241,131,235,162,243, 85,202, 90,129,128,136, 36, 52,195,251, -153, 76,230, 80,150,227,154,177, 28, 23,193, 18,210, 2, 2, 65, 48, 33, 36, 0, 68,224,199,241, 8,226,105, 46, 64, 99, 48,123, -135,250, 49, 2,170,143,214,169, 58,210,235,245, 76,117,173,255,113, 7, 85, 23,227,110,215,174, 29,218,250,248, 65, 95,116, 23, -207,247,236,229, 50,131,182, 9, 17, 11,183, 44, 6,128, 74,230,111,179, 34,236,216,177, 35,211, 38, 4, 20,104,238,160,215,156, -126, 46, 9, 25, 58, 3, 11,157,129,197,221, 50, 19, 10, 75,140,184,125,207,232, 22,227,179,117, 22, 71,204,255, 81,161, 14, 33, - 0, 70,218, 4,163,209, 88, 31,242,188, 66,161,128,205, 71, 30, 18, 18, 98,175,205,194,133,193,164,138, 38, 92,135, 41,209,225, -160, 71,155, 77, 22,205,223, 68,131, 54, 87,101,254,102,179, 25, 58,157, 14, 90,141,246, 81, 87, 11,191,101, 75, 90,213, 79,178, -252,193,122,223,173, 1,207,158,249,219, 24, 63, 69, 81,144, 74,165,240,246,241,170, 87,134, 71,191,148,192,215,118, 56,122,119, -223, 63, 23, 32, 24, 3,192, 12,157, 14, 0,240,201,186,142,243,185,101,150, 65,126,232,116,152, 47, 46, 4, 74,203, 92, 43, 64, - 43,220,253, 30,111,148, 2, 0,214,175, 95,143, 29, 59,118,224,211, 79, 63,197,201,147, 39, 97, 50,153, 80, 92, 92,108,211,202, - 42,211,135,135,135,195, 0, 64,128,155,143,164,189,212,209,238, 73, 61,132, 70, 82,135, 5,207,101,154,246,150,176,154, 98, 2, -220, 97,254, 0,224,174, 16, 16, 31, 31,223,216,202,252,167,124,255,253,247,151,230,205,155,247,210,198,141, 27,209,174, 93, 59, - 0, 64,203,150, 45,161, 86,171, 37, 11, 23, 46, 60,125,232,208,161, 31,227,227,227,229,181,150, 18,199, 19,112,140,148,101,153, - 32,150, 97,155,153, 89,115, 27, 1, 69,154,138,133,148, 72, 42, 18, 24,132, 94, 98,149,183,175, 64, 35,144,242,140, 84, 32,240, - 22, 50,180,223,205, 51,103, 37, 19, 67,190,112,152,239,156,156,156, 82,157, 78,199,213,100,230,239,222,189,251, 85,154,166, 27, -172, 33,117,239,222,189,193,104, 9,235, 98,220,255,153,242,214, 95,204,182,224, 54,102,119,238,128, 21, 22, 6,237,146,212,106, -211,254,109, 76,191,218,239, 84, 94, 7,119,109,236, 82,230, 43, 12, 44,180,122, 6, 26, 29, 3,117, 5, 3,149,150,113,189, 87, -214, 16,249,111,175,229,219,255,127,227,198, 13,168, 84,170,135, 54, 98,164,164,164, 64, 46,151,195, 22,244, 87,205,215,207,167, -164,164,192,104, 48,212, 71, 0,224,215,173, 91,135,130,194, 66,136, 4, 2,132, 53,110, 92,133,249, 63,251,236,179, 56,120,240, -160,179,131, 19,137,142,142,174, 46, 4, 84,177,100, 56, 27,171, 64,155,104,208, 38, 19,204,102, 26, 12,195, 86, 50,127,147,201, - 4,189, 94,143,138,138, 10,104,181,174, 11, 0,246, 46, 0, 27,220,213,252,183,164,109, 1,120,160,212,202,104,172, 78,109, 16, -158,183, 8, 1,105,105,136,179,104, 80, 46,245,149,234,204, 95, 36, 18, 65, 34,145, 64, 42,149, 66, 42,149,214,187, 77,213,230, - 18,168,105, 94,188, 61,198,166,108, 5,255, 98, 4,238,245,239,133, 96, 12,128,236,229, 85, 96,238,150, 0, 1,126, 16,150,109, -194,174, 47, 78, 3, 2,129, 75,121,169,175, 43, 64, 39,176,140, 41, 75,151, 46, 69, 73, 73, 9,214,174, 93,139,238,221,187, 99, -209,162, 69,232,213,171, 23, 12, 6, 67,117, 13,205, 38, 82, 63,108,198,239, 44,131,118,215, 29, 80,155, 32,225, 50, 29,235, 44, -142,202,190,225,174,107,204,158,249, 87, 50, 27,171, 16,224,162, 59,192,247,194,133, 11, 95,190,243,206, 59, 71,186,118,237,234, - 7, 0, 11, 22, 44, 64, 78, 78, 14, 0,160, 95,191,126,248,229,151, 95, 48,112,224, 64,239,241,227,199,231,102,102,102, 30,120, -227,141, 55,198,159, 61,123,246,190,146, 13, 10, 14,226,110,220,200,101, 50, 21, 7,247,182,105,211, 54, 51,162,165,252,146,192, - 87, 86, 44, 32, 98, 29, 37, 17,233, 41,169,151,150, 22, 10,104,240,102, 1, 39, 53,251,106, 11,203,124, 78, 30, 58,215,167, 81, - 96,216, 47, 14,133, 81, 59,159,255,182,109,219, 94, 31, 51,102,204,247, 54,179,191, 70,163,161,196, 98,113,189, 27,146,205,236, -127,224,192,129, 7,107, 1,176,105,249,145,173,219,194, 88, 82, 2, 93,129,133, 9, 14,182,106,135,174, 90, 1,110,252,113,253, - 62,218, 53, 93,151, 93, 44,114, 41,243,245,101,254,246,140,159,231,121,155,143,191, 18,102,179,185,242, 80,169, 84,208,233,116, - 80, 42,149, 15,109,228,176,205,243,223,183,111, 95,117, 75, 0,159,146,146,130,110,221,186,193,104, 52, 84, 14,116, 41, 41, 41, - 46,153,235,215,124,181, 6,102,179, 25,205,194,195, 97,102,217,218,152,191, 43, 3, 9,169,193,244, 95, 57,117,177, 46, 75,198, -125, 2, 0,109,174,100,254,167, 78,158,130,222, 96,128, 86,171,133, 90,173,134, 74,165,170,162,217,185, 10,155, 27,160, 30,126, -127,148,149,150,161,172,172, 20,165,101, 74,148,150,149,161,172,172, 12,101,165, 22,141,180, 67,199,142, 80, 90,255,119, 85,251, - 7,128,158, 61,123,254,165,245,123,123,195,199,199, 23,190, 62,190,208,106,181,209,245,100,254,110,187, 3,114, 63,157, 2,209, -203,171, 16,140, 1, 16,102,173,130,121,235,116, 32,192, 15, 59,223,141,193,173,157, 55, 49,106,249, 6, 64,248,144,151, 21, 49, -222,130, 44, 92, 6,157, 78, 7,163,209, 8,189, 94,143,172,172, 44, 44, 91,182,172,198,228, 94, 94, 54, 11,202,117,119,152,183, -187, 90,181,125,249, 18, 39,175,235, 35,100,184,218,103,171,208, 73, 75, 75, 35,177,177,177, 54,230,239,182,101, 66, 40, 20, 18, -134, 97,170, 11, 5,112, 53, 22, 96,195,134, 13,215, 98, 99, 99,187,111,220,184,113,240,209,163, 71,125,135, 14, 29,122,210,198, -252,173, 10, 36, 36, 18, 9,127,235,214, 45,209,222,189,123,219, 7, 6, 6,158, 26, 48, 96, 64,110, 77,180, 94,125,229, 85,174, -109, 68, 59,109,191,126,253, 98, 46, 93,250,243, 25,141, 78,219,152,103,204, 12, 40,152, 25, 19,101, 50,153, 76, 6, 13,138, 52, -156,201,168, 45,204, 47, 98,118,237,222,147,212, 40, 56,164,152,166,245, 14,213,247,154,180,255,242,242,114, 33, 0,248,249,249, - 61,182,110, 1,170, 54,237,127,203, 39, 31, 89,164,230,162,187, 85,158,185, 26, 11, 48,122,244,232,232, 53,111,175, 4, 96, 9, -248,219,177, 99,135,194,198,244,109,107, 2, 12,251,225, 37, 0,192,153,229,191,219,226, 3, 30, 22, 42, 27, 99, 65, 65, 65,165, -182,111, 99,250,118,149, 11,173, 86, 11,163,209,104, 55,136, 60,188, 60, 78,157,106,137,253, 48, 51, 12, 46, 93,186,132,179,103, -206,160,123,183,238, 48, 26,141, 48, 24,140, 48, 26, 12,248,241,135, 31, 96, 75,231, 76, 71, 79, 78, 78, 70,167,142,157, 96, 54, -155,113,237,218, 53, 48,102, 26,133, 5,133, 13, 90,166,182,107,235,154, 5,182,181, 11, 28, 91, 0,204, 38, 48,172,197,236,127, -226,196,239,208, 25,116,168,208,106,160, 86,171, 81,174, 82,161,188, 92, 89, 47, 65,204,102, 9,112, 83,251, 7, 0, 28, 57,114, - 4, 90,173, 22, 90,173,198,122,214,162, 81,112, 48, 58,116,236,136, 43,151, 47,227,240,145, 35, 46,211,180,105,255, 66,161, 8, - 94, 94, 94,240,241,241,129,175,143, 15,124,124,188,160, 44, 87, 70, 39, 36, 36,100, 58,213,231,234, 97,234,175, 13,231,115,203, - 96,190,184, 16,101, 56, 6, 50,114, 5,200,128,127, 33,247,211, 41,120,113,249,247,144,138, 40, 64, 36,180, 28,238,112, 29, 55, - 93, 1,133, 47,124,133,160, 77, 47, 64,175,215, 35, 40, 40, 8,229,229,229, 40, 47, 47,199,241,227,199,113,247,238,221, 74, 51, -113,101,250,194, 66,188, 27, 40, 67, 35,175,146,186, 52,224,104,123,166, 26, 27, 27, 27,101,247, 44,170,218,179,104, 23,251, 5, - 95, 7, 3,111,136, 25, 5, 46,107,254, 53,125,111, 90, 90, 26, 73, 79, 79, 39,245,252,222, 42, 66,128, 59,204,223,134,143, 63, -254,248,194, 75, 47,189, 52,126,233,210,165,237,207,159, 63, 63, 64, 38,147, 9, 94,124,241, 69, 34,145, 72,192,113, 28, 25, 57, -114,228,133,153, 51,103,118,235,210,165,203,206,201,147, 39,191, 62,121,242,228, 90,125, 81, 9,211, 18,184, 63, 47, 95, 59,213, -165,107,183,215, 78,157, 60, 57,118,231,238, 95,151,100,159, 60,217,248, 82,206, 21,233,181,194, 92,254,199,149,155,101, 75,147, - 63,237,116, 96,247,238,228, 54,173,219,236,242, 9,243, 62,178, 97,195, 6,214,217, 18, 29, 58,116, 40, 78,157, 58,213, 35, 37, - 37,101,161,209,104, 20, 45, 90,180,232,179,157, 59,119,142, 43, 44, 44,124,232,140,195,169, 58,170,237, 65,240,205, 60, 40,129, - 74,237,223,134,193, 33, 33, 88,129, 43,206,107, 29, 86, 19,255,149,211,151, 16,208,190, 17,134,253,240, 18,118, 76,220,174,176, - 73,111, 54,230,111,211,254, 93,153,101,240,203,210, 30, 13,195, 97, 9,193,229,203,151, 97,107,172,213,205,203, 34,145, 8, 34, -145, 8, 37, 37, 37, 24, 57,114,228,163,168, 39, 34,151,203,249,148,148, 20,244,233,211, 7, 70,147, 9, 6,163, 1, 70,107,112, -147,193,104,113, 3,172, 94,189, 26,137,137,137,142, 6, 19,126,249,242,229, 96, 89, 22,167, 79,159,129, 72,104, 49,219,182,109, -219, 22, 55,243,242, 80, 88, 88,136, 77,155,126,198,184,113,175, 2, 0, 95,205, 18, 80,235, 0,148,154,154, 42, 6,192, 36, 36, - 36,112, 53,105, 64,174, 76, 85,180,105,254, 89, 89, 89,208, 85,232, 43, 5, 48,141, 86, 3,141, 70, 13,141,198, 61, 23,128,189, -246, 63,110,220,184, 74, 11,128,171,130,192,184,113,227,170, 92, 71,200,229,232,208,209, 18, 20,119,229,242,101,220,180, 90, 60, -198,141, 27,231,114,212,126,255,167,251, 67, 34,150, 64, 38,147, 65, 42,149, 66, 34,145,160,168,168,200,105,230,111,167,237, 55, -104, 3, 28,187,108, 29,126, 1, 48, 98,233,255,129, 79,155, 13, 18,151,140,243,185,101, 32, 65,129,184, 94,160,177,104,255, 46, -186, 0,236,250, 31,177, 9, 2,246,215, 14, 97, 48, 0, 2,139,178,247,151,121,223,194,232,205,102, 51,190,249,230, 27, 12, 30, -252, 87, 92,216,193, 73,225, 64,177, 30,237,247,148,163, 71, 72,203, 26, 73,214, 16,229,110,239,242, 84, 56, 72,235, 44,195, 38, -245,176, 40,212,101,141,112, 89,144,120,208,223,107, 21, 2,234, 61, 11, 96,233,210,165,155,102,204,152, 17,114,238,194,133, 56, -131,193,208, 77,161, 56, 36,147, 72, 37, 66,138, 80, 56,116,232,144,111,167, 78,157, 54,196,198,198,254,107,236,216,177, 14,181, -245,204, 67,251,185, 81, 47,141, 58,220,189,123,207, 57, 52, 99, 26,113, 61,231,218, 18, 46, 47,151, 1,192, 75, 65,153,187,182, -105,159, 22, 26, 26,178, 71, 32, 20,255,248,239,121, 73,244, 23,139, 62,119, 88, 75,125,250,244,249,124,232,208,161, 0,128,146, -146, 18, 28, 56,112,192,239,187,239,190, 91, 2, 0,167, 78,157,234,211,185,115,231,125, 79,132, 0, 96, 91,248,231,217, 31, 55, - 58,210,236, 93,153, 18, 72,182,205,217,194,247,154,211, 15,193, 93, 27, 87, 50,253, 74,115,234,197, 34,156, 89,254,187,171,102, -171,134,154,147, 74, 0,240, 29, 59,118,196,197,139, 23,171, 48, 22,149, 74,149, 11,160,181,139,210,252,131,180, 4,220,247,155, - 63,254,240, 35,140, 70, 35, 76,180, 9, 52, 77, 99,249,242,229,117, 45,146,195, 47, 95,190,188,242,130,227, 88, 72,101, 62, 48, - 24,140,184,124,233, 18,132, 34, 17,204, 52, 13, 47,111, 47,108,218,180, 9, 2,129, 0,113,113,113,120,246,217,103,249,178,178, -218, 3,188,150, 47, 95,190, 47, 33, 33,129, 78, 77, 77, 13,181,149, 77,181,117, 0, 92, 50,109,206,153, 51, 7,199,142, 29, 67, - 69, 69, 5, 42,116, 58,104, 53, 26, 43,243,215, 64,171,209,162, 66, 91, 1,157,221,128,239, 76,217, 69, 70, 70,242,217,217,217, -149,218,127, 77,211, 0,157, 93, 4,200, 58, 23,191, 74, 93,216,152,190,205,247,232,202, 42,133,182, 21,254, 0,192,199,203, 7, - 82,153, 20, 90,173, 54,218,230,218,113,131,249, 63,144,249,218, 54, 33, 96,204,210,239,192,111, 5, 26, 77, 74, 69,230,123, 49, - 24,152,244, 19, 32, 18,193, 91, 90, 63, 63,103,117, 65, 0, 0,198, 29, 27,231,224,173,123,232,186,207, 11, 69,191,234, 81,190, -248,175,187,102,179, 25,131, 6, 13, 2, 0,132, 7,202,240,223,212,230,248,116,217,109,124,117,198,224, 72, 35,182,159, 22,135, -218,254,183, 75,155,233,198,152,213, 80,115,235, 27,194,231,255, 32,191,183, 82, 8,104,136,246,247,229,151, 95,126,249,198,164, - 55,246, 62,213, 59,178,143, 86,163, 9, 98, 88,198, 20, 22, 22, 86, 18, 30, 30, 94,164,209,104,206,143, 29, 59,214,233, 65,225, -215,237,191,114, 0, 54,189, 54,225,173,172, 1, 3, 7,110,151,201,100,254, 4, 60, 71, 8, 1,199,241,106,131,174, 92,113,245, - 66,190,214, 91, 34,118,106,156,183, 49,127,192, 18, 72, 93, 61, 80,111,217,178,101,255,122, 34, 4, 0, 43, 83,119, 88, 97, 59, -118,236,112,185,177,158, 89,254, 59, 15, 0, 54, 65,192,142,241, 55, 36, 67,119,187, 35,117,237,218, 21,167, 78,157, 66, 73, 73, -165,137,176, 53, 0,216,152,223,196,137, 19, 31,117,125, 85, 41,163,148,148, 20,254,181,137,175, 97,245,234, 53, 86,159, 57,131, - 57,115,230,212, 57,125,201,197, 21,244, 44,154,211,193,131,142, 54,155,232,184,124,249,242,107, 9, 9, 9,197,169,169,169,130, -132,132,132,202,128, 64,235,180, 64,167, 7, 58,155,198, 60, 96,192,128, 6, 47,187,200,200, 72,222, 94,139,183,143, 1,112, 99, - 5, 64, 2,128,223,180,105,211,125, 90,190,213, 66,224,114,123,222,180,105, 19,113,213, 98,224, 12,234, 50,253,187, 42, 44,140, - 93,182, 14,176, 91,248,103,200, 71,127, 77, 71,214, 53, 84, 69,217, 89, 0, 28,173, 4, 88, 56,160, 16,133, 0,122,125, 26,136, -197,167,219, 33, 4, 64, 73,174, 14,109,218,180,177, 48,141,197,129,120,238,169, 16, 68, 60,151,227,172, 70,236,180,123,211,154, -150,184, 59,222, 52,208,152, 87, 47, 90, 15,233,123, 27, 12,235,214,175,187, 6,224, 90, 67,209,251,241,167,111,243,208, 0, 81, -161, 13, 25,152,103,197,172,135, 81,158, 15,123, 51, 32, 50,122,244,232,168, 29,203, 31,203,189, 0, 8, 0,254,169,167,158,194, -158, 61,123,140, 86,166,207, 1,240,122, 64,150,135,122,195, 22, 36,152,152, 56,141,183,106,254,143, 36,111,115,230,204,105, 89, -147, 89,210,110, 26,161, 43,218, 14,121,192,117, 92,153,159,250, 46,251, 91,219,170,124,174, 50,113, 71,107,251, 55, 4,234,227, - 18,152, 59,119, 46,110,220,184,209, 96,121,113,102,121, 95, 87,113,230,131,114,156,129, 37, 48,116,112,172, 12,191,157,104,135, - 48, 47, 31,252,153,125, 15,237,157,100,254, 78,180,191,199,117, 57, 92,242,128,222,245, 44,207,238, 28,154, 54, 48,189,228,135, -149,241,135,190, 27, 96,117, 11,131, 27,150,132, 7, 46, 4,140, 28, 57, 82,250,132, 53, 64,183, 52,251,134,250,237,212,212, 84, -219, 10, 53, 76, 66, 66, 66,125,167, 50,121,208,240,204,191, 94,117,145,148,148,212, 32,117,153,154,154, 42, 76, 24,152,240,192, -219,197,145, 52, 3,142,164,229, 60,246,125,214,211, 50, 61,120,228,141,208,221,125,132, 61,240,192, 3, 15, 60,240,192,131, 39, - 23,148,167, 8, 60,240,192, 3, 15, 60,240,192, 35, 0,120,224,129, 7, 30,120,224,129, 7, 30, 1,192, 3, 15, 60,240,192, 3, - 15, 60,240, 8, 0, 30,120,224,129, 7, 30,120,224, 1, 0,156, 4, 80, 98, 61, 63,145,168, 50, 11,224,220,185,115,110, 71,166, -214, 20, 76,232,161,231,161,231,161,231,161,231, 36,189, 58,167,137, 62, 6,244, 60,245,235,161, 87,133,249,159, 61,123,118, 24, - 96,217, 96,146, 16, 98,124,220,190,215, 99, 1,240,192, 3, 15,224,239,239, 79,249,251,251, 19,127,127,127, 17, 0,193,227,150, - 63,219,190,243,118,251,207,215, 23, 53,173,143,239,193, 99,132,255,251,191,255,139,122,194, 63,161, 15, 0,219,178,195,162, 39, -245, 35, 60, 2,192,223, 28,245,216,110,221,101, 12, 27, 54, 44,202, 58,232, 86, 30,214,123,127, 75,122,143, 57, 72,203,176, 48, - 2, 0,106,181,154, 83,171,213,188, 90,173, 54, 3, 96,221, 33,246,246,115, 93, 11,166,140,232, 58, 26, 0,166,140,232,250,195, -219,207,117, 93, 3, 0,115,198, 60, 69,230,188, 28, 41,122,123,120, 23,183,214, 20,177, 95,138, 54, 45, 45,173,202,230, 59,245, - 97,254,118,237,190, 33,215,218,175, 47,205,134,166,247,196, 50,255, 61,123,246, 40,254, 6,159,194,160,225, 86,116,172, 21, 77, -130, 37,164,109,227, 80,170,133,188, 25, 9, 11, 8, 22,120, 75, 68, 13,246,123,194,191, 73,155,162, 0,200, 96, 49,199,112,240, -160,138, 0,224,196,222, 42, 38, 0,146,250,254, 84, 70, 70, 6,146,147,147,171, 44,255, 55,107,214, 44, 91, 71, 39,238,208,227, - 54, 7, 86,173,232, 87, 50, 30, 23,122,143,125,213, 71,120,203,248,136, 86,114, 0, 64, 17,205, 76,104, 44, 22,254,100,123,120, - 69, 83, 33, 41, 42, 45,165,157, 33, 52,121,120,151, 28,150,229,195,159,238,223,200,175,125,251, 1,251, 37, 18,234,214,180,164, - 62,255,254, 15,185,136,123,106,253,255,137,132,228, 87,128, 92, 2,208,217,213, 76, 86, 95,138,182,158,203,205, 86, 97,254,118, -109,223,221, 65,154,184,120,255, 97,211,123, 98,153, 63,199,113, 32,132, 96,240,224,193,252,145, 35, 71,136,139,117, 44, 6, 96, -110,136,252, 4, 5, 5, 77, 81, 42,149, 95,187,249,186, 4,128,209,206, 18,208,160, 24,208,173, 7,121, 45, 60, 66,168,106,209, - 72, 16,218, 49,156, 18,146, 80,162, 87,171, 57, 41,194, 88,170,103, 51,246,245, 81,195,217,250,254,134,179, 2, 64, 8,128, 72, - 0,217,176, 4, 61, 60, 78,240, 3, 48, 20,192, 24, 0,219, 0, 28, 0,160,105, 0,186, 63, 3,120,181,129, 24,236,163,147,140, - 40,135, 70,158, 62,214, 14, 21, 10,160,216,221,129,119,230,204,153,104,209,162,197,125,219,133, 38, 39, 39, 71,231,231,231, 43, - 86,174, 92,233,202, 32,204,175,159,238,141,248,129,247,111, 46,195,109, 14,196,134,255,210,152,180, 74,247,200,232, 45, 95,190, - 60,234,195, 15, 63, 84,196,197,197,225,231,159,127, 38, 0,240,206, 59,239, 68,173, 93,187, 86,209,162, 69, 11,112, 28, 7,131, -193,128,168,168, 40,108,221,186,213, 33,205,117,203, 63,139,106,255,225, 22, 69, 70,175,102,209,243,179,211, 51, 1, 96,205,194, - 53, 81, 87,231, 51, 10,182,133, 31, 52,156, 55,202, 13,126, 40,246, 63, 21,125,242,198, 39,153,142,232,181,106, 22,214,184,133, - 88,118,119,250,180,137,166, 48,153, 88,172, 81, 26,200,242,239, 54,254,244,209,212,215, 16, 40,147,241, 70, 51,203,127,178,250, - 59, 83, 81,105, 41,105,220, 56, 88, 88, 84, 84, 86,107, 35, 57,179,237,229,182, 59,118,222, 14, 24,240,116, 72,114,207,222, 65, -162,245,235,175,203, 67, 26,201, 74, 63,127,239, 68,242,140,151,122,176, 79,247,111,148,149,115, 77,155, 63, 41,190,245,200,111, -246, 95,172, 15, 83,172,175, 38,197,215,100,241,170,167, 16, 80,219, 59,238,230,181,161,233, 61,177,204,127,214,172, 89, 24, 60, -120, 48,255,223,255,254,215, 29, 82, 52, 44,102,119,166, 1,178, 85, 20, 20, 20, 52, 70,169, 84,110,115,227, 93,127,171,210, 25, - 8,224,110,124,124,124, 0,128, 41,214,107, 27,238, 1,248,117,195,134, 13,185,206, 18,253, 98,237, 23, 20, 93,106, 18,209, 38, -163,180, 28,102,169, 72, 36, 20,106,140, 82, 74, 44, 54,112, 2, 63,111,134,150,153,205,194,162, 59,166,239,191, 89,111,124,125, -242, 36,182, 62,109,199, 25, 23, 64,115, 0, 63, 0,136,177,158,155, 63, 70,109, 42, 24,192, 38, 0,207, 3, 56, 14, 96,132,245, - 58,184, 1,104,191, 2, 39,252,165, 15,211,196,254,128,208, 15,192, 85, 0, 17,238,104, 35, 54, 19,186, 61,243,159, 53,107,150, -194, 78,243,175,124,230,140,185,221,150,198,158, 89, 83,175,148,131,122,165,188,242,218,246,236, 81,208, 3,128, 19, 39, 78, 40, -164, 82, 41,178,178,178,238, 19,182,242,243,243, 73, 65, 65, 1,233,215,175, 95,244,238,221,187,157, 42,195,198, 39, 46, 41,120, -169, 8,221, 74,196, 85,180, 97, 66,241, 88,147,255, 6,249,161, 32,142,200, 71, 92,140,102,238,188,224,208,108, 26,213, 74,206, -183, 16,203,238,190,255,238, 4, 83, 51, 31,177, 88,125,233, 24,241, 42,190,128, 25,131,218,162,105,128, 12,197,103,142,146,123, -167,143, 81,179,166, 76,164,163, 90,201,249, 14, 94,190,230,186, 52,152, 70,141,196, 67,196, 98, 74,122,252,248,221,153,167, 78, -222,233, 24,214,172,149, 57,160, 81, 51,226,235, 11,175, 86, 17, 94, 17, 65, 65,146, 54, 28,207,155,118,157, 44,214, 61,194, 54, -204,219, 51,123,219, 81, 67, 31,229,157,165, 85,237, 92,253,168, 41,221,195,162,247,196, 50,255,221,187,119, 43, 8, 33,160, 40, - 10,217,217,217, 56,122,244,168, 91,180, 88,150,189, 96,181, 0, 52, 68, 60,139, 76,169, 84,110, 11, 10, 10,122,217,141,119,205, -214,250, 50,197,199,199,135, 1, 88,113,240,224,193,127,103,100,100,188,111, 59, 14, 28, 56,176, 92,161, 80,228,196,199,199,207, -119,134,224,172,185,179,132,165,119, 74,188, 12,188, 41,128, 23,146, 80, 94, 34,105,204,137,196,141, 57, 66,133,114, 68, 24,194, - 8, 4, 65, 28, 71,252,117,132,245, 97,196,148,236,155, 99,123,132,210, 23, 67, 31,168, 0,240, 5,128,131, 0,102, 88,207, 95, -212,163,176, 3, 1, 44, 0,176,219, 90,112,187,173,215,129,110,210, 59, 2, 96, 15,128, 4, 0,107, 1,252,195, 74,243, 72, 61, - 27,133,191,245,236,221, 0, 26, 54,172, 26,246, 2,235,249,113,195, 83, 0,142, 1,104,108, 21,158, 94,115,229,229,140,140, 12, -133,189,217,127,214,172, 89,138,228,228,228,232,228,228,228,104,123, 33, 32, 57, 57, 57, 58, 35, 35, 67,225, 12, 61,123, 51, 61, -245, 74, 57,174,237,153,136,107,123, 38, 86, 97,218,220,230, 64,184, 75,207, 42,228, 16,119,232,165,164,164, 68, 29, 63,126, 28, - 19, 38, 76, 64,126,126, 62, 18, 18, 18,162,106, 74, 35,149, 74, 21, 77,154, 52,113, 88,126,169, 41, 41, 81, 77,142,255,129,130, - 9, 3, 32,206, 87,227,235, 5,159, 71, 85, 87,142, 83, 82, 82,163, 68,198, 22,138,160, 38, 6,135,204,127,202,228, 87,232, 79, -102, 78,228,197,183,206,136, 3,239, 93, 36, 23,239,106, 16, 30,226,141,167, 59,133,161,169,234, 42,110,104, 13, 16,114, 60, 2, -136, 64,244,207,183, 38,240,211,223,121,243,106, 84, 43,121,173, 76,167, 92,165, 13,234,211,199, 39,185,107,191,231,205,190, 65, -173, 37, 62, 1,161,156,204,199,219, 20,212, 40,216, 24, 18,222, 92, 88,174,212, 74, 52,106, 6,229,106,147,211,131,144,213,207, -239,144,113, 58, 25, 15,112,159,230, 95,147, 80,238,130, 16, 64,106, 56, 87, 63,106, 74,231, 20, 61,126, 75,224,125,135,139,244, -158, 56, 80, 20,197,239,221,187, 87,193,113, 28,222,123,239, 61, 16, 66,112,244,232, 81, 88,182,222,229,136, 27,244, 64,211,244, - 89,171, 5,160,190,110,108, 37, 0, 40,149,202,173, 65, 65, 65,209,238,240, 79,154,166,133, 0,190, 62,112,224, 64,252,162, 69, -139,238, 16, 66,196,182, 3,128, 40, 56, 56,152, 28, 58,116,104, 94,124,124,252,116, 71, 4, 5, 68, 36,161, 25,222,207,100, 50, -135,178, 28,215,140,229,184, 8,150,144, 22, 16, 8,130, 9, 33, 1, 32, 2, 63,142, 71, 16, 79,115, 1, 26,131,217, 59,212,143, - 17, 80,125,180, 15, 76, 0, 8,183,106,252,159,194,178,219,231,167,214,235,112, 55,126,107, 34,128,124,107, 3,159, 11, 32,200, -122, 38,214,251,174,238,181,251, 47, 0,215, 1,172,177,154,131, 36,214, 6,241,149,245,126,125,246, 95, 30, 12,139,171, 99, 72, - 3,245,129, 55, 1,204,183,158, 31, 55,116, 6,176, 29,192,179, 86, 75, 74,103,119, 9,217,152,191, 61,211,183, 23, 2, 92,110, -156, 86,230,111, 67,117, 33,192, 29,122,213, 6, 88,226, 42,189,195,135, 15,131,166,105,244,238,221, 59,186, 67,135, 14,200,203, -203,171,252, 62,142,227, 32,151,203,249,121,243,230, 41,142, 31, 63,142,145, 35, 71, 58, 28, 80,140, 89,167, 64,209, 12, 84,189, -229,209,166, 14,193,184,190,238,240, 95, 76,139,227, 49, 77,190,142, 63, 60, 47, 88,113,243,184, 63,134,189,113,205,241, 0, 69, - 9, 42, 74, 46,102,113, 69, 42, 35,202, 42,104, 62,166, 71, 11,222, 95, 38,198, 29,149, 14, 37,106, 3,226,122,182,224, 41, 66, -248,223,127,221, 7,245,145, 19,252,153,109,187,110,213, 69, 46,235,108,211,105, 33,161,126,173,155,182,136, 96,188,100, 92,235, -193,207,199,249,180,234,157,240, 66,227,118, 47, 14, 11,106, 26,217, 93, 89,209, 56,198, 76,155,205, 55,114,117,126, 78, 50,127, -222,217, 45,104,211,210,210, 20, 14,102, 6,212,248,204, 9,151,156,103,118,192, 67,212,252,121,158,135,217,252,151,203,126,224, -192,129,182,254,226, 46,227, 50,139, 68, 34, 51,199,113,199,173, 90,120,125,132,128,208, 74, 73, 64,169, 84, 4, 5, 5, 37,184, -240,110,185, 74,165,146, 28, 62,124,248,181, 3, 7, 14, 60,255,253,247,223,151,205,155, 55,175,197,198,141, 27,209,174, 93, 59, - 0, 64,203,150, 45,161, 86,171,201,194,133, 11,139, 15, 29, 58,244,121,124,124,252,192, 58, 41,114,140,148,101,153, 32,150, 97, -155,153, 89,115, 27, 1, 69,154,138,133,148, 72, 42, 18, 24,132, 94, 98,149,183,175, 64, 35,144,242,140, 84, 32,240, 22, 50,180, -223,205, 51,103, 37, 19, 67,190,112,187, 61, 59, 18, 0,158,179,106,135,246, 56,102,189,239, 10,198, 3,120, 15,128,220,202, 8, -255, 0, 80,110, 61,207,183,222,127,207,154,206, 25,120,193,226,107,137,183, 94,155,236, 14, 88,239, 79,193,253, 91,249, 58,139, - 87, 0,124,103, 61,215, 23,111, 0,152,102, 45,179,105,214,235,199, 5,109, 96, 9,154,220, 5, 32, 17,192, 84, 0, 81,158, 97, -171,118, 20, 22, 22, 42,250,246,237,139,169, 83,167,102,246,237,219, 23, 39, 78,156,192,218,181,107,163, 26, 55,110,172,160, 40, - 10,121,121,121,164,180,180,148, 76,159, 62, 61,250,200,145, 35,138,201,147, 39,215,217, 57,251,223,188,163, 40,234,219, 17, 9, - 83,167,102,254, 25,198, 70,119, 86, 7, 41, 82,215,166, 70, 89,164, 19, 96, 77,222, 27,100, 83,105, 12, 25, 60,189, 48,250,104, -154, 92, 17,253,244,167,181,214, 79, 1,205,172,248,250,235,141, 65, 91, 47, 20,222,222,120, 38, 95,181,238,248, 13,221,205, 34, - 35, 79,241, 20,140,122, 22, 37, 37, 52,178,243,203,217, 29,121,133,218,221,119,138, 84,191,220, 42,184,114,172,168,120,248,109, -147,249,179,218,104,250, 5,134, 55, 51, 84,148, 55,237, 20,249, 12, 69,147,150,131, 11,175,108, 55, 4, 6,121,203, 90,117,236, - 81,194, 51, 37, 23,136,192, 47,132,227, 56,193,189,123, 6,103,172,120,188, 45,226,223,142, 17, 87, 55,131,219, 95,195,154,158, -119, 66,195,174,212,244,109,135, 51,233, 61,120,176,168,168,168, 80, 0,128, 80, 40,196,236,217,179,145,157,157, 13, 55,253,254, -246, 48, 1, 48,153, 76, 38, 83, 97, 97, 97, 6,234, 23, 16,168,173, 98, 14, 80, 42, 83,131,130,130, 70, 57,249,174,212,104, 52, -134,207,153, 51, 39,249,157,119,222,209,119,237,218, 85, 2, 0, 11, 22, 44, 64, 78,142,101, 55,202,126,253,250,129,227, 56, 12, - 28, 56, 80, 50,126,252,120,237,149, 43, 87, 14,189,241,198, 27,125,188,188,106,102, 77, 28,199, 51,153, 7, 15,238,205,203,187, - 49,158, 53,179,141, 4, 34,153, 73, 64,164, 58, 74, 34,214, 83, 82, 47, 45, 45,242,170, 0, 37, 81,115, 82,214,172, 85,151,249, - 40,118,158, 27,197,158, 58,235,118, 0,183, 35, 1, 96, 56,128, 67,213,238, 29,178,222,119, 22, 2, 0, 31, 1,136, 3, 80, 86, - 75,154, 50,235,243,143,224,156, 95,103, 60,128,253, 0,212,181, 60, 87, 91,159,143,119,163, 76,158,129, 37,134, 96,153,245,252, - 76, 61, 26, 87,140,213,106,210,207,154,159,126,214,235, 24, 23,233, 4, 2, 8,112,226,112,213,149,210, 31,150, 85,172,108, 65, - 72,183,172,150, 30,183,226, 60,170,107,252,213, 45, 2,174,130,219, 28,136,182, 35,127,168,188,110, 59,242,135,251,162,248, 93, -165, 87,141,153,240,174,208, 91,189,122, 53,159,157,157,192,140, 1,163, 0, 0, 32, 0, 73, 68, 65, 84,141,211,167, 79,163, 89, -179,102,252,111,191,253, 6,141, 70,131,203,151, 47,223,167,209,126,244,209, 71,153,157, 58,117,138,222,178,101, 75,173,244,190, - 89,189,154,111,158,125, 17,161,167,115,160,104, 54,146,239,122,149, 81, 80, 26, 51,216,203, 21,247,165,125,255,163,183, 50, 91, - 68,158,142,190,245,199, 43,181,106,207,215, 11, 10, 62, 40,160,153, 21, 37,165, 6, 57,109, 96, 3,115,238,104,124,118, 95, 41, - 44, 51,181,236,142, 78,161, 65, 0,128,221,231,238, 9,115,139, 42,252, 0, 4, 22,209,198, 78,183, 77,230,216,220,194,194, 15, -106,163, 57,228,133, 56,170,195,224, 37, 93, 25,221, 31,249, 45, 58, 14,149,137, 68, 44,125,253,143, 12, 85, 97,254,229,123,197, -249,191,231,107,148,133, 0, 69, 17,165,150,246,159, 18,215,211, 81,187, 33,177,177,177,213,153,113,117,179,186,253, 53,172,233, - 31, 86, 52,190, 7, 13,136,193,131, 7,243,135, 15, 31, 6,183, 57, 0, 60,207,227,243,207, 63,199,145, 35, 71,108,130,154,219, -117, 80, 94, 94,110, 34,132, 12, 58,117,234,148, 49, 60, 60,124, 88, 61,173, 58, 1,128,101, 54,128,245, 60, 17, 0, 23, 20, 20, -228,140,162,102,108,220,184,177,122,223,190,125,111,110,220,184,209,255,232,209,163,226,161, 67,135,170,109,204, 31,176,108,119, - 47,145, 72,112,235,214, 45,106,239,222,189,126,129,129,129,119, 7, 12, 24,144,203,113, 53, 79, 86,107, 27,209, 78,219,175, 95, -191,152, 75,151,254,124, 70,163,211, 54,230, 25, 51, 3, 10,102,198, 68,153, 76, 38,147, 65,131, 34, 13,103, 50,106, 11,243,139, -152, 93,187,247, 36, 53, 10, 14, 41,166,105,189,219,179, 16,168, 26, 58, 6,101, 61,154,194,226, 23, 62,108,119,143,178, 94, 55, -182, 62,183,221,171,171,131,206,128, 37, 64,239,102, 53, 58,213,143,155,214,116, 51, 28,208,163, 0,140, 5,240,189, 3,122,223, - 91,211, 81, 78,208,179, 29,173, 96,137,115,248, 24,150,153, 4, 31, 91,175, 91, 85, 75,231, 12,189,241, 0,222,177, 50, 89,131, -245,158,193,122,253,142,245,185, 51,244,226, 97,137,115,112,246,136,119, 34,127,159, 1,248, 15,128, 81,214, 50,167, 0, 72, 1, -156,176, 90,101,250, 2, 72,178, 62,175, 43,127, 24, 54,108,216,125,190,126, 91, 16, 96,245,216,128, 97,195,134, 57, 20, 6,134, - 13, 27, 22, 93,221, 55,223,118,228, 15,247, 49,127,234,149,114,184, 75,207,166,101,186, 74,239,220,185,115,104,209,162, 5,238, -221,187, 71, 10, 10, 10,200,221,187,119, 73,255,254,253,239, 11, 6,172, 52, 83,121,121, 41,164, 82,105,173,244,228,231,206, 65, -213,162, 9,122,220, 59, 65,162, 11,246,144,151,238,110, 38,103,125,138,163,217, 44,117,141, 76, 62, 63,135,134, 68, 90,183,178, -115,189,160, 96, 78, 1,205,196, 20,208,204,138,219,180,249,243,115, 55, 75, 66,244, 12, 3,181,209, 98, 28,187, 84, 82,130,155, - 70,122,195,109,147,121,205,109,154,249, 34,183,176, 48, 29,117, 76,157,109, 42,239, 48, 39,160,105,191,208,210,252, 3, 90,134, - 49,149, 23, 22, 73,155, 93, 56,113,202,255,242,185,243,109,242,110,177, 61,111,223,188, 13,177, 72, 24,218, 57,204,123,188, 74, -107,110,227,168, 62,210,210,210, 72,108,108,172, 83, 66, 97,108,108,108,116, 90, 90,154,203,140,194, 62, 16,240,113,158,161,243, -119,198,144, 33,131,249,204,204,204,202, 24,135,253,243,124,193,243, 60, 6, 15, 30, 92, 31,211, 63,172, 76, 58, 26, 0,158,126, -250,105,125, 53,193,209, 45,121, 34, 40, 40,104,130,157,114,106, 82, 42,149,187,149, 74,229,186, 58,222,177,165,229, 0, 84,132, -133,133, 93,120,233,165,151, 86, 47, 93,186,212,235,252,249,243,254, 50,153, 12, 47,190,248, 34, 36, 18, 9, 56,142,195,200,145, - 35, 43,102,206,156, 25,208,165, 75,151, 43,147, 39, 79,238, 60,121,242,228, 50,163,177,230,133, 3, 19,166, 37,112,127, 94,190, -118,170, 75,215,110,175,157, 58,121,114,236,206,221,191, 46,201, 62,121,178,241,165,156, 43,210,107,133,185,252,143, 43, 55,203, -150, 38,127,218,233,192,238,221,201,109, 90,183,217,229, 19,230,125,100,195,134, 13,110, 79, 7, 20,214,160,173, 71, 2, 24, 0, - 96, 17,128,233,214,193,210,187,154,217,238, 7, 88,252,236,159,192,226, 18,200,174, 67,192,120,202,170,253, 58, 99,142, 63,110, -181, 46, 80,117,208, 11, 1,208, 18,192,105, 7, 52, 79, 91,211,133,162,246,169,139, 20, 44,129,121,129, 86,198,249, 18, 44, 83, -255,114,172,180,115,172,215, 27, 97,241,147,111,128,197,117, 65, 59,160,247, 10,128,111, 0,116, 0, 80, 84, 45,159,119, 97, 9, - 90,188, 98, 77,187,217, 1,189,247, 96,153,221,160,119,162,252,188, 0,236, 3,240,147,131,250,120, 25,192,191,173,231,179,118, -249, 19, 89,235, 50, 13,192, 42, 0,139,173,207,239,214,246,131, 25, 25, 25,153, 0,144,159,159,175,176, 69,251, 87,215,250,243, -243,243, 21,246,105,235,130, 45,205,134,255,210,149,209,249,213,181,244, 13,255,165,241, 40,232,101,101,101, 97,208,160, 65,184, -114,229,202, 95, 76, 92, 46,143,222,178,101,139,162, 85,171, 86,209, 28,199, 41, 90,182,108,201,219,166, 1,238,218,181, 11,145, -145,145,209,123,247,238,173,145, 94,251,172, 44,252, 28, 28, 90,165,172, 58, 38, 14,135,238,211,219,192,179,161,224, 57, 96, 90, -203,239,248, 10,206, 7, 74,131, 31,148, 57, 65,232, 62,104,103,244,229, 95,234, 54,179, 95, 47, 40,216, 10, 96,107,235, 22, 77, -219, 3,248,135,137,229,144,126, 33, 15,131,194, 44,238, 78,194,243, 90, 45,195, 44, 42, 46, 46,190,231, 4, 51,253,148,231,121, -239,156, 43,202,215, 84,167,183, 52, 42,190,171, 68,241, 61, 45,132,194, 50,239,138,114, 30, 42, 13,203,135,134,136, 3,132, 28, -198, 24, 76,236,207,139,222,123, 58,224,147, 47,142,171, 28, 8, 1,153, 78, 12,216,164,154,187,192, 53, 12,181, 90, 94, 14,196, -185,250,166,205, 26,230, 40, 42,223, 62, 29,113,150, 30,137, 43, 71, 61,233, 61, 9,224, 51,167, 93, 4,210, 45,147,177,246, 95, - 96,176, 78, 97,233, 99, 46,206,249,175,181,109, 8, 4,130, 16,161, 80, 88,124,252,248,241,111,159,126,250,233,250,148, 89, 11, -165, 82,185,198, 42, 88,188,162, 84, 42, 55,219,206,117,188,179, 9, 22,151, 41,111, 29,187, 43,150, 46, 93, 58,125,198,140, 25, - 77,207, 93,184, 48,212, 96, 48,248, 42, 20,135,136, 68, 42, 1, 69, 40, 28, 58,116, 72,212,169, 83,167,179,177,177,177, 35,199, -142, 29, 91,225, 40, 67,153,135,246,115,163, 94, 26,117,184,123,247,158,115,104,198, 52,226,122,206,181, 37, 92, 94, 46, 3,128, -151,130, 50,119,109,211, 62, 45, 52, 52,100,143, 64, 40,254,241,223,243,146,232, 47, 22,125,238,118, 65,214, 36, 0,252,195, 42, -225,188, 0,224, 50, 0,159, 26,222,219, 99,213,216, 99, 96,153, 71, 30, 95,135,249,191,173,181,192,156, 17, 0,202,172,233, 5, -117,208,139, 2,112,205, 73,122,215,172,233,127,169,131,222, 20, 0,147, 0, 92, 4, 48,211,250, 93,246,180, 21, 0,242, 96,241, -223,239, 6,176, 30,150, 25, 7,181,209,155,104, 45,143, 30, 86, 43, 66, 77,249,212, 88,159,167, 88,133,128,245,117,208,251,222, -218,208,188,156, 28,188,190,119, 80,126,159, 89, 45, 27,251,173, 66, 13,170,209,254, 13, 64, 39,107, 93,228, 88, 5, 41,135,166, - 93,235, 60,127, 69, 3, 45, 4, 68, 38,173,210,241,147, 86,233,106, 88,184,167, 28,143,138,222,159,127,254, 73,254,252,243,207, - 42,247,126,250,233,167, 76, 0,100,243,230,205, 0, 64,110,221,170, 26, 83, 87, 27,243, 7,128,230,127,254, 73,128,170,244,222, - 94, 50,203,194, 28,151, 89,243, 84, 61, 68,239, 23, 23, 70, 97,150,207,131, 16, 16, 84,160,146,249, 91,185,250, 61,169, 84,234, -148,217,144,231,121, 66, 8, 89, 48, 39,174,179, 87, 88,179,150,163, 56,120,181, 45,200, 47, 18,152,141, 42,190,113,168, 15,241, -241, 22, 17,198,204,161, 92, 69, 51, 68, 70,100,106, 45,211,166, 14,133,160,182, 54, 91,253,255, 71,201, 0,237,221, 17,206,204, -219, 39, 15,153,222, 99,207,252,185,205,129,216,127,193, 50, 69,127,189,130,198,207,199,105, 91, 76, 6,105,168,250, 97, 89,182, - 12, 0,122,245,234, 85,175, 5,129,108,204,223,138, 82,235,217, 81,223, 72,180, 27, 79,205, 0, 10, 0,224,203, 47,191,124,249, -141, 73,111, 12,123,170,119,228, 24,173, 70, 19,194,176,140, 49, 44, 44,172, 48, 60, 60, 60, 87,163,209,108, 27, 59,118,108,169, -179,249,250,117,251,175, 28,128, 77,175, 77,120, 43,107,192,192,129,219,101, 50,153, 63, 1,207, 89,102, 78,240,106,131,174, 92, -113,245, 66,190,214, 91, 34,174, 87, 64,107,117, 1,128,133, 37, 72,205, 25, 63,252, 41,235,193,162,246,229, 69, 89, 88, 34,234, -157,157,175,169,128,101, 33,159,186,232,237,128, 37,104,205, 25,188,230, 68,254,190, 6,240,173,163,177, 31,192,187,118,239,212, - 69,239, 7,171,197,192, 17,242,172,154,189, 51,249,115,101,190,235,215, 14,232, 61,235, 4, 61,155,181, 97,189,181,108,156, 49, - 49,145, 97,195,134, 69, 85,143,250, 31, 54,108, 88,180, 51,154,122,109,244,236, 86,234,123,220,232, 61,246,184, 81,120,215, 68, - 53,107,182,254,157, 79, 83, 38,217,238,209, 34,234, 39,163,158,219, 87,148,159,175,117,170,208, 8,225,255, 61,165, 31,249,248, -235,223,231,236, 90, 21,186,237,196,201,187, 83, 67,252,185, 23,169, 32,191, 0,158, 7, 8,225, 77, 38,134, 43,226,128, 82,218, -196, 5, 20,222, 53,184,228,143,180,154,249, 21,213,174, 31,151, 34,244,172, 4,232, 38,158, 91,172,125,208,223,200, 1,104, 34, -149, 74,239,246,234,213,235,217, 51,103,206,212,155,160, 82,169, 60, 24, 20, 20, 52, 73,169, 84,174,119,242, 21,129, 53, 31,149, -227,233,186,245,235, 50, 0,100, 52,212, 71,254,248,211,183,121, 86, 94,241, 64, 80,147, 0, 96,116,131, 14, 95, 71, 37,153, 60, -244,254,182,244,170,192,202, 72, 73,181,123,110, 55,206,199,157,222,147, 0,165, 94,255, 38,224,101, 6, 16,194,129, 47, 52, 26, -233,141, 69, 69, 37,231,225,194, 42,106, 31,127,253, 59,191,253,179, 17,228,133,233,251,178, 0,100,197,246,109,255,143,160, 32, -201, 92,161,128,240,119,203,140, 87,239,210,204, 6,153,136,146,202,132, 2,129,153,225,164,174,228, 47, 45, 45, 45, 51, 54, 54, -214,182, 15,128,205, 61,224, 58,103,173,238,235,183, 51,253,215, 35, 14,192,179, 18,160, 27,160, 94, 41, 7, 33, 4, 47,142,158, - 82,227, 24,178, 99,123,106, 67,125,107, 17, 0,210, 16,204,223, 78, 8, 88,239, 66,114,153,117, 76,165,159,212,186, 18,214,208, - 16, 27,114,142,172,135,222,223,155,158, 7,143,187, 0,160, 84,242, 74,165,114, 74,125,233,188,244,254, 62, 30, 0, 94, 27,220, -137,252,120,228,210,231, 6,126,218,170,233,227,142,119,162,117, 36, 34, 72, 36,108, 4, 66,244, 62, 50, 97, 73,151, 14,126, 57, -233,251, 93,163,109, 13,244,227,221, 9,248,123,192, 26,180,199, 2,224,198, 55,166,166,166,240, 9, 9, 83,201,142,237,169,127, -247,238,229,111, 21,164, 37,110, 42,206,143,190,178,220,221, 71,216, 3, 15, 60,120, 2, 37,126, 1,224, 37, 33,224, 56, 30, 32, - 4, 21, 6, 79,247,247,192,131,255,217,241,192, 83, 4, 30,120,240,191, 3,134, 5, 52,250,191,245,178,243, 30,120,224,129,147, -160, 60, 69,224,129, 7, 30,120,224,129, 7, 30, 1,192, 3, 15, 60,240,192, 3, 15, 60,240, 8, 0, 30,120,224,129, 7, 30,120, -224,193,223, 17, 85, 98, 0,206,157, 59,231,118, 52,106, 77,193,132, 53,209,123,225,153,200,168, 46,221,218, 40,154, 52, 11,143, -214, 26,116,138,195,138,172,232,140, 67,231, 51,221,165,215,181,239,240,168, 30,221,250, 42,238, 21, 22,194, 91,230,141,219, 5, -185,209,217, 39,246,184, 77,175,161,191, 55,113, 60, 21,213,175,111, 43,133,204, 91, 0,161,128, 2,145, 18,188, 56,238, 18,113, -151, 94,194,255,203,138,122,170,239, 83, 10,127, 31, 1, 32, 4, 98,251,214, 60,199,233, 81,125,175,135,222, 99, 75,175,206,169, -102,143,251,247,182,234,245, 50,239,199,229, 62,208,252,157,253,232,150,219, 3,105,207, 37, 45,239,187,247,121,163, 66,183,233, -253,163,244,254, 13, 87, 61,237,249,161,208, 19,162,134, 41,178, 79,226,247,186, 44, 0,212,134,149, 81,104, 11,203,122,248, 44, -128,220,153,153,184,233,236, 15, 12, 31,216, 42,138,128, 67, 72, 64, 16,178, 14,159, 81,124,152, 56, 17, 3,134, 14, 0,163,211, - 43, 58,117, 24, 12,142,131, 98,198, 91, 79, 71,247,236,217, 13,215,175,223,130, 90,165,195,234,245, 71, 50,107,163,215,123,208, -171, 81, 60, 8, 90,182,105,165, 72,120,127, 49,222,124,245, 57,252,240,159,175, 0, 72,177,231,124, 1, 40, 10,138,149, 11,230, - 33, 39,231, 42,228,242,150,144,200,132,184, 83,144, 19, 13,125,205, 89,158,251, 92,119, 94, 44, 22, 67, 38,147, 33, 55, 55, 23, - 77, 67,253,208, 72,232,131,166, 45, 2, 16, 40,243,135, 55, 97, 65, 81, 20,120,142,133, 94, 34,132,250,158, 26, 99,254,147,225, -176,162,150,207,233,198,251,202,212,240, 11, 16,195,199, 91, 8,177,140,130, 80, 0, 80, 98, 33, 50,119, 69,242,102, 94,128, 97, -163, 78, 56, 93,225, 93, 95, 90, 25, 21, 30, 30,142,102,173,155, 41, 12, 70, 19, 40,137, 12, 48, 3,211,146, 79, 69, 25,244, 58, -124,247, 73, 84,230, 35, 20, 36,255, 86,243,152,159,112,184, 90, 23, 78,167,143,253,112,174, 55,128,167, 26,203,188,254, 93, 88, - 88,216, 65, 36,149,128,243,242, 90, 6, 96,109,218,178,164,138,199,165, 0, 34, 58, 13,137,186,121,233,112, 77,251, 41,252, 45, -218,104,106,106, 42,249, 97,195,134, 43, 18,177, 88,198,113,156,191,183,143,143,207,168, 23, 95,244, 2, 64, 39, 36, 36,240,143, -105,158, 41, 0, 72, 72, 72,224, 26,128,156,159,191,191,255,172,246,237,219,143,149, 72, 36,205, 10, 10, 10, 10, 10, 11, 11, 79, -210, 52,189, 4, 64,174, 27,244, 2, 2, 3, 3, 23, 63,243,204, 51,207,135,133,133,201, 79,157, 58,117,239,226,197,139,199,141, - 70,227, 66, 88, 86,136,253,223,176, 0,212,194,252, 5,222, 18,225, 83, 19, 7,182, 94,193,241,188,241,232,213,123, 95,174,140, - 82,239,159,153,137, 75,142,222, 85,222, 61,200,155, 42,148, 48, 87,168, 32,100, 41,252,113,233, 42, 94,127,125,102,229,115,138, - 2,126,207, 90,143, 70, 45,194, 21, 92,133, 6, 52, 71,112,232, 80, 86,244,234,245, 71,106,161,216,146, 63,125,226, 18,136,151, - 31,206, 92,202,199,249, 75,111,224,187,159,127,171,124,202,113,192,136,254,253,129,138, 34, 0,190,200,189,120, 25,162, 70, 1, - 24,208,175,139, 66,165,175, 67,102, 33, 20, 64, 40,244,232,214, 11,141,189,197,104,218, 72, 10,191,224, 32, 4, 74,124, 17, 40, - 21, 64, 36, 16,192,204,178, 80, 49, 28, 78,149,158,118, 88,168, 11,223,109,206,203, 4,229,240,243,242, 66, 72,163, 96,248,249, -121,129,167, 88, 48, 92, 5, 88,176,240,241,241, 66,163,198,205,144,123,165, 29,223,186,195, 15,117, 14, 74, 61, 99, 86,241,254, -190,222,240, 15, 8, 68, 72,163, 96,232,116, 58,136, 37, 82,136,140,150,197,249, 34,228, 45, 21,202,114, 21,158,121,107,125,116, -126,193, 29,148, 23,221, 66,217,249, 84, 71,194,128,211,131,196,208, 73, 67,163, 15,172, 63,144,233, 4,173, 7, 42, 4,228,229, -229,241, 0, 32,151,203,201,227, 66, 47, 60, 60,252,117,154,166,215, 3,192,216,232,104, 42,117,203, 22,119, 6, 95,203, 26,169, -118,134, 28,158,231, 65, 8,169, 60,219,238,217,210, 57,216, 73,205,149,245,228, 93, 97,254,157,188,205,204, 86,223, 0,255, 14, - 0, 32,150, 73, 65, 27,140,224,116,250,229,199,143, 28, 94, 16,251,225,220,142,105,203,146,242, 29,209,249,242,163, 68,222,170, - 97, 49,176,184, 32, 57,235, 56, 84,227, 88,212,125,200,243, 24,242,220,255,185, 84, 71, 55, 47, 29, 86,180,233, 18, 21,125,253, -143, 76,215,133,226, 88,165, 75,201,227,226,226,176, 37,246, 64,157,105,162, 15, 84,221,138,164, 83,128,229, 83,139,141, 28, 12, -140,165, 94,117,214,115,106,223, 0,180,243, 21,213, 73,111,197,138, 21,153, 31,189, 55, 59,116,244,216, 49, 62, 70,163, 1, 43, - 63,255,140, 90,189,122,181, 49, 49, 49, 49, 28,192,157,134,238,123, 99,198,140, 25,186,109,219,182, 12, 87,133,168, 73,147, 38, -241,121,121,121, 40, 43, 43,195,210,165, 75,225,235,235,139,168,168, 40,200,229,114,172, 95,191,222,221,126, 55,184, 87,175, 94, - 27,222,127,255,253,235,237,219,183, 95,223,179,103,207,203,247,238,221,107,150,149,149,213,235,205, 55,223,220,173,209,104,150, -195,178,149,187,179,136, 30, 59,118,108, 90, 82, 82, 82,176,217,108,134, 76, 38,131,183,183,119, 19,157, 78,247,242,232,209,163, - 71, 93,184,112, 33, 17,150,141,211,158, 56,156, 59,119,174,186,149,192, 57, 1, 96,101, 20,154, 3,104, 13,203, 18,135,172,206, -196,220,206,186, 86,252, 69,255,182,161, 51,159,233,212,100, 65, 99,127, 89,211,149, 40,218, 4,224,234,204,204,218, 55,169, 49, - 85, 40,209,184,205,179, 88,252,193, 88,172,183,227, 73,135,143,167, 64,167, 55, 97,228,208,153,120,122,192, 36,188, 26,247, 12, -100, 50, 9,104,150,129, 86, 79, 43,106,111,100,183, 0, 26, 24, 59, 97, 45,222,126,127,106,229,221, 17, 79, 71, 65, 42,149, 96, -251,161,223,176,231, 88, 22, 54,172,251, 10, 70,131, 9, 98,129, 16, 62, 94, 98,232,202, 10,162, 85, 5,168,113,135, 53,158,231, - 1,158,179, 28, 20, 7,158,231, 97,162, 37,149,203, 59,240, 52, 11, 86, 0,176, 96,193,210, 28, 24,182,110, 1,118,206, 91,114, - 62,208,143,129,159,175, 55,194,155, 69,160, 67,215, 54,240,245,145, 65, 93, 81,130,162,146, 34,148,171,239,193,108, 36,240,242, -242, 66, 72,200, 0,148, 22,135,240,141, 66, 63,171,217,140, 63,120, 30,207, 24,244, 48, 8, 1,177, 84, 12,131, 94, 12, 90, 47, -134, 81, 42,129,144, 48,224, 33,128,209, 80, 1,131, 94,139,102,205,154, 42,196, 2, 33,148,208, 32,148,158,128,234,107,204, 87, -199,167, 27, 62,117,216,128, 62,136,255,160,238,177, 50, 54,182,202,254,238,177,177,177,189,131,130,130,114, 8, 33, 70,158,231, -133,129,129,129, 94,185,185,185,193,214,213,221,154,186,219,144, 19, 19, 19,199,217,253, 70,148,187,171,197,213,200, 45, 9,225, -167, 77,155, 22,189,122,245,106,151,104,134,135,135, 39,244,233,211,103,201,192, 30, 61, 96,150, 72,144,156,156,204, 77,125,229, -149, 97, 41,155, 55, 31,112,241,247,177, 98,193,130,202,235, 89,243,231, 35,121,225,194, 58,175,157, 33, 91,141,185,243,189,123, -247, 6, 0,126,232,208, 86,157, 1,220, 72, 74, 74, 51,184,200,252,179,186,118,238,236,103,235, 51,222, 82, 25,238,150, 20, 67, - 83,174, 66,175, 62,125,189,118,125,183,238, 64,236,135,115, 59,167, 45, 75,114,180, 54, 59, 51, 99,201,106,225,107, 47,143, 18, -182,149,203, 57,171, 16,128,249,201,171,170, 10,209,179,166, 3, 0, 62,122, 47,209,173,237,164,221, 98,254, 54,164, 5,185,144, -120,168, 75,164,189,133, 4,231, 23,190, 5,226,215, 8,236,141,243, 48,221,248, 19, 57, 74, 29, 34,247, 22, 59,245,126,207, 94, -189,142, 78, 25, 31,223, 50,126,242,155, 1,105, 63,253,204,201,229,114,106,113,210,114,248, 46, 88,140,237,219,183, 23,166,166, -166, 82, 13,101, 5, 24, 51,102,204,176,109,219,182,237,223,182,109,155,237,122,184,237,127, 7, 2, 74,212,254,253,251, 21,183, -110,221, 66,235,214,173, 49,104,208, 32,248,251,251, 67,165, 82,225,206,157, 59,184,121,243, 38,134, 15, 31,206, 15, 31, 62, 60, -122,246,236,217,174,212,211,152,103,158,121,102,229,138, 21, 43, 54,245,236,217,115, 37, 33,228,142,221, 56, 78, 98, 98, 98,124, - 0,100, 89, 15,167,232, 37, 38, 38,166, 79,155, 54,141, 58,125,250, 52, 8, 33, 8, 14, 14,174, 60,246,238,221, 43,238,215,175, -223, 87,183,111,223, 62,241,164, 51,127,219,189,234, 66,128,176, 6,230, 31, 28, 25, 17, 28,223,163,101,208, 4, 66,136,136,231, -121, 51,103, 57,104,214,108, 52,136, 41,174,105,215,198,210, 15, 26,249,181,110,179,237,212,205,159, 87, 70,113, 71,103,102,214, -190, 91, 28, 32, 70,167,142,237, 65, 81,153,200, 81,149, 1,184, 12,117,225, 53,136,164, 18,236,216,253, 37,244,165, 44, 38,188, -241, 15,112, 28,240,226,168,254, 96,133, 62, 14, 63, 46, 39,231, 50, 56, 14, 24,217,157, 88,249, 74, 75, 24, 77, 52, 98, 70, 12, -135, 52,128,194,134,141,251, 64, 81, 64,250,207,235, 81,120,227,207,232,189,155, 86,100,214, 36,253, 0, 0,199, 3, 28,199,129, -227, 56,176, 44, 11,147,136,135,153,152, 65,211, 52,244, 94, 70,128,147,130,226, 89,176, 98, 30, 21,180, 17, 58,141,186,206,188, -133,248,152, 32, 20,202, 16, 28, 28,140, 54,109,218, 32,172,113, 95, 64, 64,129,101, 79,131,226, 85, 48,234, 24,176,156, 14, 69, -119,148, 8, 9, 46, 69,112,192, 0, 44, 91,177, 43,234,231, 31,239,167, 37, 51, 50,224, 77,165,128, 81, 2,154, 50, 67, 39, 22, -162, 66, 38,130, 80, 36, 6, 56,111, 16, 1, 65,133, 78,143,242,162, 91,200, 61,125, 12,202,252,124,112, 28, 7,138, 23,184,213, -104,190, 91,251,151,224,252,230, 59,111, 58, 30, 39,171,174,217,110, 76, 75, 75,155,251,254,251,239, 79,205,207,207,167, 8, 33, - 33,169,169,169, 63,195,178,185,147,151,187, 13,121, 74,108,172,104,205,154, 53, 27,239,221,187,135,244,244,116, 68,182,111, 47, -104,136, 14, 34,151,203, 73, 92, 92, 92, 20,207,243,138,213,171, 87,187,188, 97, 17, 77,211, 41, 3,173,109, 74, 44, 22,163, 93, -187,118,216,122,232, 80, 70, 72, 72, 8, 74, 74, 74,156,166, 99,211,236, 31, 0, 72,239,222,189,249,211,167, 45, 22, 43,187,243, -159, 67,134, 12, 41,156, 59, 55,214, 63, 41,201,241,154,251,177, 31,206,245,246, 54, 51, 91,187,118,238,236, 39,160, 40,188,251, -218, 4, 24,140, 38, 36,127,251, 45,188,100, 50, 24,141, 70, 24, 13, 6,116,239,217,163,237,111, 63,253, 52, 13,192, 23,142,172, -142, 11,103, 77,231, 0, 80,215,242,242,168,234, 12,191,122,247,116,231,195,155,119, 24, 28,125,251,202, 17,126,216,139,111, 69, -103,236,252,214, 45, 65,192,126,215, 62,219,150,182,117,221,119,132, 78, 1, 66,220,170, 96,113,120, 88, 8, 68, 51, 83,161,153, - 16, 1, 97, 96,168, 75,204, 63, 46, 46,174,200,172,211,223,153,252,238,212,230, 31,254, 99, 14, 86,175, 75,185,212,167, 87,175, - 86, 41,171, 82,188,222,155, 51, 27, 63,245,239,139,141, 27, 55, 78,132,101,215,210,250, 48,254,168,109,219,182, 41,108,204, 62, - 53, 53, 53, 23,150,109,218, 15, 58, 35, 0,236,223,191, 95, 17, 18, 18,130,158, 61,123, 50, 20, 69, 9, 45,214, 89, 14, 34,145, - 8, 65, 65, 65,104,220,184, 49,110,222,188,137,253,251,247, 43, 92,232,115,177, 47,188,240,194,103, 43, 86,172, 88,213,190,125, -251,181,132, 16, 14,192, 87, 0,158, 3,112,132, 16,178, 16,150, 53,243,103, 3, 88,232, 12,189, 21,137,137,155, 7,198,198,146, -157, 59,119, 66, 40, 20, 66,161, 80,224,252,249,243,104,211,166, 13, 22, 45, 90,132, 46, 93,186, 96,234,212,169,194,143, 63,254, -120,197,147,200,252,167,204, 93, 86,121,239,235,164, 15,107, 20, 2,106,154, 5, 64, 9, 5,148,144,225,120,173,193,204,220, 33, -132, 72,124, 36,130,110,126, 98, 68,202, 58, 15,105,141,232,183,129, 14,131,208,196,155, 31, 51,113, 64,196,135, 65,126, 94,195, - 86, 70,193,191,246,236,112, 16, 8,108, 99,182, 31,128,102,240, 15,127, 1, 6,214,136,181,169,235,240,195,198,116, 12,143, 30, - 0, 0,208,235, 1,129,176,118, 82, 50,175,246, 0, 0,150,181,223,155,166, 8, 64, 22, 40,129, 4,241,175,191,133,152,184, 56, -236,218,109, 97,100, 94,222,128,174,226,110,157,133,101,134,160,146,249,155, 25, 22, 38,141, 25,122,149, 30, 42, 51, 13,165,158, - 70,185, 73, 11,149,182, 2,229,197, 90, 40, 85, 70, 40, 43,106, 95, 66,253,221, 87, 91,241,132, 16, 8, 4, 4,132,146,128,101, -121, 48,250,124,232, 84,215, 80, 88,164,134,178,188, 2,106, 45, 11,101,185, 17, 5, 5, 69,184,116,229, 28, 84,234,115,232,219, -171,183,162, 54,154, 2, 0,148,214, 8,195,245, 59, 40,251,227, 50,202,242,111, 65,163, 86, 66,163, 86,226,214,165,211, 56,158, -246, 29,178,182,108, 64,201,245,235, 96,105,206,210,155, 4, 15,205, 13,104,219,135,155,142,137,137,233,184,120,241,226,247,155, - 52,105,162, 75, 79, 79,239,150,150,150,246, 43,128,158,214, 74,119,123,193, 41,113, 88,216, 44, 0,232,215,165, 11,166, 77,155, - 86,124,234,202,149, 3, 79,117,232, 16,213, 16,153,223,178,101, 75, 38, 0,146,152,104,209, 50, 19, 19, 19, 93,162,107,150, 72, - 0, 0, 91,183,110, 69,104,104, 40, 62, 76, 76,196,172, 89,179, 16, 18, 18,242, 88,248, 97,109, 76, 63, 53, 53,181,242, 0,128, -195,135, 15,135, 3, 24,229, 36,153,167, 2, 2, 3, 59, 8, 40, 10,111,196,196, 64,165,214,160,224,238, 29,136, 68, 66, 8,133, -150, 67, 36, 18, 65, 34,243, 66,107,185,252,243,158, 67,135, 58,165,177, 95,203,203,195,143, 91,127,173, 60,108,152,159,188, 10, -243,147, 87, 97,143,226,176,203,223, 59, 52,246,227, 40, 0,184,125,229, 72,230, 80, 11,243, 87,224, 49, 89,237,232,194,247, 95, -160,248,237, 94, 24,146, 81,130, 78, 1, 66, 8,252,130,192,148, 23, 35,114,111, 49,188,133, 22, 30, 40,112, 48, 39,235,230,245, -235,101, 95,167,254,167,253,247,255,249, 30, 95,126,251,213,173,175, 86,124, 54,255,253,233, 51, 70, 45, 94,178, 24, 50, 95,111, - 12,234, 55, 0,167, 78,158,250,254,181,248,215,220,254,102, 27,243,183, 93,239,220,185, 19, 79, 61,245, 84,107, 0, 19,156, 53, -251,155,205,102,244,234,213,139, 99, 89, 86,168, 86,171, 97, 50,153, 96, 50,153,112,229,202, 21, 40, 20, 10, 28, 59,118, 12, 77, -154, 52,129,217,108,198,164, 73,147,156,201,235,184,184,184,184, 47,198,142, 29,235,183,118,237, 90, 63, 66,136, 24,192, 97, 0, -106, 0,189, 0,252,106, 39,120, 30, 4,208,197, 17,189,109,239,191,191,121, 84,247,238,228,167,152, 24, 20,158, 61,139,207, 62, -251,140,219,181,107,215,255,187,125,251,118,168, 66,161,120,123,238,220,185, 48,155,205, 24, 48, 96, 0,188,189,189,251,227, 9, -135,189, 48, 80,167, 5, 96,102, 38, 74, 86,162, 36,229,247,235, 37, 25,145, 17,193,209,189,229, 65,150,117,196, 95, 88,132,223, -125,134,227,224, 31,197,232,223, 57, 16,207,200,119,193,247,183, 37, 61, 71,244,144, 79,216,120,228,210, 31, 53, 17,111,210, 54, -150,240,124, 1, 63,250,245,153,152, 53,253, 43, 0, 74, 0,190, 0, 76,104,217,190, 23,164, 18, 33, 12, 58, 19, 64, 91, 4, 4, - 95, 95, 95, 20, 43,107,221, 47, 27, 6,253, 85, 2,128,191,244,251,183,160,168,213, 85,148, 4,206,240, 39,140, 38, 51,100, 62, - 82, 64,108, 17, 16,180, 26, 13,250,247,239,143, 35,191,254, 84,187, 58,194,209,224, 56, 33, 24,134,129,201,100, 66,133, 80, 0, - 33, 77, 1,119, 53, 96,188, 24,176, 98, 14,188, 72, 0,189, 64, 8, 70,167,135,202, 84,123,172,147,175,143, 14, 12, 67, 96,162, - 89,168,212, 26,228, 92,207, 71,193,221, 82, 24,104, 51, 52, 21, 74, 84,104, 85, 48,178, 52,136,144, 64,167, 87, 67,163,191,137, - 91,133,106,148,105,117,181,210,100,237,164, 52, 70,173, 67,193,185,203,184,119,249, 38, 52,218,235,208,170, 84,224, 33,132, 72, - 64,192, 19, 17, 40,202, 98,245,117,197,185,246, 65,252, 7, 78,185, 3, 28,224, 30,128,123,243,230,205, 51, 0,192,220,185,115, - 79, 37, 37, 37,121, 91,179,110, 4,144,239, 46,225, 53,107,214, 44,141,137,137, 1, 0, 68,132,132,132, 90,125,226,130,134,236, - 28, 54,243,191,213, 18,224,176,248,194,195,195,135,210, 52,141,228,228,100,188,252,242,203, 24, 59,124,248, 95, 3,253,133, 11, - 22, 75, 80, 72, 8,239,108, 92,192,172,249,243, 43,125,254, 0, 48,123,193,130, 42,150, 1, 39,205,254, 85, 96,211,254,109, 76, -223,134,212,212, 84, 36, 36, 36,224,192,129, 27, 63, 2,248,201, 17,157, 0,161,240,223, 70,218, 4,129, 64,128, 43, 55,114,193, -243, 60, 46,229, 92, 3, 77,155, 65,129, 64, 40, 20,130, 16, 2,142,101, 97,208,233,113,237,247,223, 15, 57, 81,134,148, 61,211, -127,237,229, 81,246, 26, 63, 5, 0, 39,206, 92, 64,219,136,150, 46, 77, 83, 62,144,246,239, 74,109,255,128, 69,243,183,185, 66, -248,231,199,188, 21,189,119,155,123,214,128, 6,129,242, 46,196, 45,218,161,120,154, 20,146,103,198,129,205,222, 7, 86, 99,137, - 55, 40,158,246, 52, 90,166,102,129,229,234,110, 42,237,219,182,111,234,229,229,237,245,229, 55,107,140,209, 67,134,136,251,246, -239,247,211,254, 61,191, 61,127,229,122, 14,192,241,144, 74, 36, 24,208,123, 0,118,239,220,141, 17, 35, 70,240,251,246,237,115, -122, 40,168,174,245,239,223,191, 31, 55,110,220,160, 1,136, 79,158, 60, 73, 79,157, 58,117,124,106,106,234,107,142,232,228,229, -229,161,117,235,214, 0, 64,229,229,229,225,252,249,243,104,217,178, 37, 34, 34, 34, 80, 94, 94,142,236,236,108,180,106,213, 10, -161,161,161,104,217,178, 37,242,242,242,234,110, 40, 20, 21, 31, 23, 23,183,100,240,224,193, 62,167, 78,157,242, 99, 24,102,178, - 76, 38, 27,109, 48, 24, 86,192,178,245, 57,172, 2,192, 42, 88,182, 86,167, 81,199,244,118,145, 72, 20,159, 54, 99,198,250,167, - 67, 66, 72,201,156, 57,232,207,113, 88,181,115, 39, 95,168,215,191,133,191,182,101, 95,127,233,210,165,181, 12,195, 8,125,124, -124, 16, 30, 30,238, 99, 54,155, 33, 18,137,240,119, 67, 77, 46,128, 48, 0,173,199, 68,182,120,183,121,176,247, 4,152, 13, 64, -251, 97, 56, 19, 50, 6,207, 36,126, 7, 67,169, 10, 2, 63, 95, 40, 86,198, 99, 80,167,223, 17,116, 33, 99, 48,128, 22,181,253, - 64, 27,191,102,248,227,194, 47,118, 6, 7, 29, 44, 91, 40,155, 1,179, 9, 66, 78, 0,202,202,196,183,109,119,188,139,200,190, -139, 60, 70,244,236, 82, 77, 9, 21, 2, 16, 1, 34, 41, 24,194,194,170, 7,227,149, 9, 51, 0, 64,145,244, 81, 98,173, 29,129, -229,120, 48, 28, 5,138, 97, 64,209, 38,232, 41, 75,219, 49, 8, 4,240,102, 12,208, 24,120, 16, 17, 1,203,178,208,179, 64,177, -174,246,141,159, 24,154,131, 81, 36, 0,167,103,192,112,106,104, 43,204, 16, 16, 17, 76,140, 25, 52, 79,131, 49,211,128,152, 3, - 69, 0, 34,225,160, 54,176, 40, 42,209, 67,103, 98,106, 84,146, 41,194, 86,238,195, 75,200, 95, 46, 93,179,209, 0,181, 82, 9, -138, 8, 32, 20,242, 0, 47,132,128,184,175,234, 92,189,117,149,110,223,178,189,216, 25,179,127,109,178, 25,236,118,196, 74, 74, - 74, 26, 5,224,246,220,185,115,123,250,251,251, 7,168,213,234, 91, 73, 73, 73, 46, 19, 77, 76, 76,124,115,205,154, 53,104,220, -184,177,253, 61,213,170, 85,171, 14, 60,213,161,195,208, 83, 87,174, 28,108,168,142,144,152,152, 24,109,231, 10,168,139,249, 71, -245,233,211, 39,124, 96,143, 30, 32,190,190, 72, 74, 74,194,156, 57,115, 32, 18,137, 96, 46, 47,135,191,191, 63, 62, 76, 76,172, -140, 11, 72,136,139,115, 40, 4, 84,247,241, 59,138, 9,168,203,163, 80, 93,251,119, 96, 29,112,216,100,202,149,202, 14, 62,190, -190, 40, 45, 47,135,226,196, 9, 8, 41, 1, 76,102, 51,244, 6, 3, 56,142,171, 20, 92, 24, 51, 13,218,100,114,198,165,193, 1, -160,172,110, 0,206,174,225, 27,173,247, 49, 63,121,149, 24, 0,218,202,229,197, 55,107,214, 45, 92,178, 82, 53,107, 29, 25,181, -119,219,183,174,152,155,107, 47, 96, 23,204,254, 85,204,178, 91,254,131, 30,175,255, 3,146,136,110,150,177,162,244, 46,114,148, - 22,193, 95,210,255, 5,228,179, 12,188, 86,215,237,106,214,104, 52, 1, 18,153, 20,109, 34, 34,164, 55, 11,110, 55, 41, 43, 41, -195, 43,175, 77, 80,236, 57,152,129,149,203,146,211,183,237,217, 25,211, 54,162, 45,226, 95,158,136,172, 51,199, 48, 98,248,112, -126,223,254,253, 14,191,217, 94,235,223,191,127, 63,134, 13, 27,102, 19, 22,197,119,238,220,193,212,169, 83,197, 0,224, 76,108, - 65, 89, 89, 25, 6, 13, 26, 4,150,101,145,151,151,135, 99,199,142,161, 83,167, 78,240,247,247, 71,243,230,205,209,163, 71, 15, - 80, 20, 5,138,162,208,164, 73, 19, 71,237,180, 83,151, 46, 93,190,232,223,191,191,224,194,133, 11,126, 44,203, 22,109,221,186, - 85, 99, 48, 24,146, 0,216, 59, 77,223,125,254,249,231,243,247,236,217, 19, 65, 8,185,139,218, 55,230,233,153, 48,112,224,250, -190, 66, 33, 41, 89,178, 4,188,217, 12,133, 64,192,101,233,245,147, 96,217,198,221,134,119,230,205,155, 39,164, 40, 10, 74,165, - 18, 55,110,220, 40,238,210,165, 75, 40,254,134, 16, 86, 99,254,109,195,252,101, 3,159,239, 30, 62,213, 79, 38,234,195,176, 92, -185,144,103,253, 16,208, 68,112, 87,101,132,161, 84, 13,136,133, 96, 85, 90, 20,148,211, 64,112, 11, 80, 28, 45,173,203,196,123, - 93,163, 65,187, 0, 63, 48, 38,224,122,230,143,104, 19,245, 92,165, 2,103,166,205, 16,129, 66,133,209,178, 67,237,136,168, 94, -144, 5,135, 99,197,250, 95,107,205,240,136,174, 4,123,206,243, 16, 73, 1,113,139,231, 64,231, 31,173,180, 2,136,196, 18,152, - 97,132,143,204,178, 35,233,206, 61,155,240,199,201,204, 58, 77,146, 28,199, 65, 76, 27, 96,134, 24, 20,197, 0, 70,203,192,102, - 54,155, 97, 50,138, 32, 16,138, 0, 35,192,115, 22, 23, 65, 75,121, 4,144, 85,243,140, 2,189,145,131, 64, 64, 96,102,204, 48, -154, 56,104,180,150,118,104,230,120,208, 38, 14, 16, 2, 2,145, 0, 66, 41, 64, 12, 44, 56,194,128,131, 1, 90, 3, 0, 56, 30, - 88, 88, 0, 20, 7,240, 4,160, 40, 14,132, 8,192,241, 4, 20,101, 85,156, 56, 10, 28, 69,129,112,206, 41,200,118, 65,126,226, -122,182, 35,111, 0, 33,115,231,206, 45, 78, 74, 74,138, 6,240,210,220,185,115,135, 39, 37, 37,233, 0,148,185,101,178,138,141, - 21,175, 89,179,230,219,152,152, 24,200, 27, 53,170,188, 47,111,212, 40,192,106, 5, 8,121, 20, 29,134,166,105,133,205,247,207, -107,181,248,228,147, 79, 96, 42, 43,131, 45,242,173,141, 85, 88, 17,153, 76, 24, 53,106, 84,113, 97,113,241,120,103, 52,237, 6, -116,201, 84,177, 0,212, 97, 33,192,233,211,167, 73, 77,194, 67, 21,161,214, 68, 67, 69, 43, 97, 52, 26, 17,224,239, 15,169, 88, - 2, 51,203,128,231,121,176, 44, 11,154,166, 97, 54,155,193, 49,172,179,241, 12,220,181,188, 60,170,173, 92,110,211, 8,184,107, -121,121,212,143, 91,127,149,218, 91, 4,218,202,229,170,134, 50,223, 23,228,102, 55,152,230,239,110, 12,192,144,140, 18, 20,203, -211, 33,110,209, 14, 36,162, 27, 90,174, 59,139, 82, 35, 7,111, 33, 1,253,223,237,184,122,227, 38, 28,237, 90,108, 96,104,156, -206, 58,137, 47, 86,124,142,167,163, 6, 98,222,255, 91,128,223,246,254,134,159, 54,252,128,254,131, 7,198, 52,151,183,128,208, - 75,132,131, 71, 15, 98,227,247, 63,224,151,237, 91, 33,150, 74,249,157, 59,119,214,185, 62,196,182,109,219,170, 48,126, 27, 84, - 42,149,203,229,163,213,106,225,239,239,127, 2, 64, 95,185, 92,142,222,189,123, 67, 32,176,184, 89, 91,182,108, 9,137, 68, 2, -181, 90, 13,185, 92, 14, 95, 95,223, 91, 90,173,182,101, 29,228, 46, 93,184,112, 97,233, 47,191,252, 50,178,109,219,182, 29,182, -110,221, 90, 81, 94, 94,190, 16,192, 70,123,249,101,200,144, 33,239,175, 91,183,110, 11,128, 98, 0,177, 0,126, 7,208,189, 6, -122,103, 87, 43, 20, 75, 3,178,179, 63,122,149, 97,240, 57,192,125, 91, 81, 49,177, 26,189,151,102,204,152,241,249,148, 41, 83, -112,243,230, 77,236,222,189, 27, 12,195, 28, 2,240,234,147,194,212,123,244,232,129,115,231,206, 85,250,253,235,180,176, 84,187, -110, 53, 38,178,197, 98, 63,153,168, 79,137,198,248,219,241,107, 37, 73, 16, 72,128,171, 71,241,172,156,199, 63,167,143, 66,239, -206,114,204, 72,120, 30, 47,182,166,129,139,251,193,139,100, 12,234, 12,214, 81, 33, 71,149, 15,161, 4, 24,241,226, 63,176,241, -203,101, 22,101, 81,111, 2,107, 0,182, 43,206,225,192, 41,203,140,194,102, 45, 34, 64, 9, 29, 51,175,145,221, 9,204, 70, 96, -231,238,125,136, 28, 62,221,162,253, 67, 4,129, 12,136,123, 33, 22, 35, 7,143,182,116,252, 91,185, 96,140,117,111,213,204,243, - 60, 24, 98, 97,240, 38,218, 18,252,103, 50, 26,160,215,235, 81, 81, 81, 1,173, 70, 13,173, 86, 11,141,202,162,101,189, 0, 0, - 32, 0, 73, 68, 65, 84,182, 2,198,138, 10, 24, 12,134,218, 27,127, 5,129,193,200,194, 96,100,161,211,155,161,173, 48,161, 92, -107,130, 74, 67, 67,173, 53, 67,165,178,156,149,101, 12,148,229, 12,148,106, 6,165, 74, 26,247, 74,107,207, 35,197,243, 96, 1, - 16,150,128, 80, 28,120,194, 3, 60, 15,158, 23,128,229,254,170, 62,206, 58,122,184,106, 27,239,216,191, 35,142,237, 57,134,223, - 14,253, 86, 41, 20, 92,189,117,213,213, 54, 23, 14,160,245,242,229,203,207, 3, 88,253,225,135, 31,190,215,170, 85, 43, 38, 53, - 53,149, 36, 39, 39,187,172,117, 77,137,141, 37,226,176,176,109, 0, 16, 22, 22,118,223,243,105,211,166, 49,217, 87,175,110,106, -168, 88, 0,155,249,223,217,125,227,109,190,127, 0,216,188,121, 51,174, 23, 21, 1, 0,118,101,102, 86,121,118,245,234,213,208, -144,144,144,242, 71, 49, 8, 12, 29,218,202, 54,239,186,202,125,219,181,237,185, 35,120,249,249, 94,225, 88, 22, 26,101, 57, 74, - 75, 75, 81,166, 42,135, 78,175,135, 78,175,135,182,162, 2, 58,181, 6, 90,149, 10, 70,131, 30,180,209, 8,142, 97, 29,142, 57, -109,229,114,219,152,193, 1,160,237,221, 1, 0,240,227,214, 95, 49, 63,121, 85, 0,128, 48,151, 27, 98,235,200,168,234,130, 67, - 68,167, 33, 81,143,122, 80,190,251,138, 28, 45,215,157, 5,137,232, 6,211,225,116,220,122,163, 39,188,133, 4, 71,135,133,128, - 81,151, 32,114, 95, 49,132, 14,154, 95, 70, 70, 6,121,123,230, 59,184,126,245, 42,178, 50,143,194,223,215, 31,227, 94, 25,135, -128,224, 32,156, 57,153, 13, 31,177, 20,222,222,222,104, 34,111,138, 77, 63,111,194,135, 31,127,132, 10, 55,152,184, 13,189,122, -245,114,249, 29, 95, 95, 95,168,213,234,190, 20, 69,209,205,155, 55, 71,159, 62,125,208,185,115,103, 52,106,212, 8, 82,169, 20, -114,185, 28,221,187,119, 71, 64, 64, 0,180, 90,109, 75, 95, 95, 95, 71, 36, 63, 61,124,248,112,198,134, 13, 27, 68,229,229,229, -243,170, 49,235,216, 65,131, 6,125,177,110,221,186,239,194,194,194,150, 16, 66,124, 0,124, 8,160, 46, 51,217,199,139,181,218, - 79,223, 98, 24,246, 91,131, 97,124, 53,122, 49,175, 38,252,235,151,233,239,205, 18, 92,189,122, 21, 39, 78,156,192,186,117,235, - 42, 0,252,243, 73,211,236,171, 7,189,215, 22, 4, 95,125, 16,144, 8, 40,226,155, 95,166,251,105, 83,214,205,127,158,187,165, - 60,105, 96,201,117,148,222,132,244,151,119,177,100,128, 22,217, 11,251, 96,101,116, 5,188,183, 79, 3,148, 5,168,224,165, 23, -173,146, 87, 45,248, 43,170,255,252,133, 95,241,175,127,109, 64, 27,191,174,248,243,248,121,236, 87, 92, 70,116,255,206, 24, 54, -200,210,208,120,129, 16, 52,235,252, 71,142,232,217, 1,139, 63, 93,134,125, 23, 53,240,145,119,194, 11, 47,140,194,111,135,182, - 97,247,111,155, 44, 31,199,154, 33, 17,213, 61,206,241, 28, 11,150,179,104, 51,176,106, 51, 52, 77,195,104, 52,194, 96, 48, 64, -167, 55,192,160,215,193,160,215, 65,111, 50,130, 54,213,190,237,115,153,193, 23,234, 10, 22, 26, 3, 7,141,129,179,252,175,229, - 80,161, 99, 80,161,103, 80,174,100, 81,166, 52,163,172,220,140,178, 50, 51, 74, 75,105,220, 43, 53,215, 41, 0,252,101,254,191, - 95, 85, 19, 10,120, 8, 8, 1, 95, 45,234,159, 39,142, 21,167, 15,226, 63, 64,199,254, 29, 43,175, 15,172, 63, 80,105, 17, 56, -182,231, 24,174,222,186,122,211,149, 6,151,158,158,254, 95,158,231,187,196,196,196,196, 71, 68, 68,132, 0,160, 56,142,147,152, -205,230,192,153, 51,103,250,213, 98, 10,174, 17,226,176,176,249,107,214,172, 25, 25, 19, 19,131,136,144, 16,167, 92, 87,245, 52, -255, 71, 1, 64,100,135, 14, 14, 3,216,218, 54,110, 28,157,156,156,140, 63,111,221,210,252,178,127, 63,174, 92,185, 82,169,245, -183,111,223, 30,214,103,244, 47,251,247,227,214,173, 91,184,154,157,109,112, 68,115,214,252,249,152,189, 96, 65,165,121,223,246, -191,237,218,246,191, 43,177, 0, 73, 73,105,252,144, 33, 67,222,181,103,250,182,115,239,222,189,145,148,148,230,148,118,125,237, - 74,110, 54,195, 48,160,105, 19,148,247,138, 81,114,183, 8,165, 69,247, 80, 90,116, 15,202,226, 18,168,202,202, 96,210,233, 44, -241, 51, 42, 21,156, 8, 2,100,230, 39,175, 18,206, 79, 94, 37, 4,160, 1,192,245,237,213,237,190, 68,118,113, 1, 78,163,105, -235,200,168,194,220,108, 69,247, 62,127,229,161,117,207, 23,163, 84, 37, 55, 20,245,105, 31, 36,174,188,138,230,239, 14,114,148, - 58,228, 79,126, 10,252,205, 11, 8,253,207, 25,120,175, 61,141,187,175,200,209,123, 95, 49,136, 72, 2, 33, 1,132,148, 99, 1, -244,194,197,139,228,147,101,139, 49, 99,246,251, 48,115, 44,174,228, 93,195,132,113,227, 33,150, 74,177, 99,251, 78,192,204,194, -100, 52,225,104,246,113, 24, 12, 21,152, 50,105,210,225,183,223,126,187,174,186, 38, 99,198,140,137, 30, 62,124, 56, 8, 33,200, -200,200,184,207,164,255,193, 7, 31, 56,253,157,193,193,193,184,115,231, 14, 0, 8, 83, 82, 82, 80, 82, 82,130,174, 93,187, 34, - 32, 32, 0, 20, 69,225,228,201,147,160, 40, 10,132, 16,220,185,115, 7,193,193,193,206,144, 93, 66,211,244, 96, 0,155,237,238, -141, 27, 52,104, 80,242,228,201,147, 3, 83, 82, 82,164,132, 16, 10,192, 54, 88,102, 1,220,115, 64,111,206, 9,179, 57,178, 58, -189, 87,231,254,178,229,229,241,211,200,200,119, 82,144,121,226, 18,146,147,147, 57,141, 70,243, 38, 44,179, 11,158, 56,244,232, -209,163,242,112,202, 5, 0, 32,119,211,241,155,137, 74,157,233, 52,128, 28, 0, 77,178,174,149,124, 61,184, 67,216,199,194,155, - 39,130,176,110, 34, 32,241, 6, 76, 58,128,231, 97, 22, 72,239, 29,253,243,238,183,168, 99,245,165,141, 63,125, 21, 61,126, 66, -188, 2, 0,116,156, 25,215, 85,249, 0, 88,180,241,139, 64,116,116, 55,132, 53,106,140, 50,181,198, 98, 43,160, 25,220, 85,233, -234,252,168,102, 45,250,163, 32,223, 58,205,147, 8, 49,162,187, 37, 6, 96,223, 69, 51,126,219,149,142,123,165,119, 16, 28, 96, -153, 73, 16, 32, 22,161, 91,100, 15, 40,182,215, 97,210,133, 16, 98,142, 1, 11, 1, 56, 66, 64,177, 28, 96,102,192,138,132, 0, -161, 96,235,147, 28, 15,203, 90, 1,117, 96,175,226, 38,121,126,160, 47,239, 37,230, 33, 20,217, 89, 24,204, 0,195, 3, 70, 26, - 96, 77, 44, 8, 33, 32, 98, 2,134, 5,116, 38,224,100,150,154,244,232,209,156,175,209,228,111,227,150, 20, 7, 98, 53,255, 91, -132, 2, 2,150,163, 64, 9,172, 51, 5, 0,240, 2, 30,224,157,179, 2,216, 51,255,154,174,143,237, 57, 22,225,108, 67,139,137, -137,233,156,158,158,254, 57,128, 30,233,233,233,251,210,211,211,143,198,196,196, 36,182,110,221,218, 76, 8, 9, 94,185,114,229, -254, 15, 63,252,112,194,178,101,203, 14,215, 33,124,218,180,127,225,236,217,179,231,207,158, 61, 27,251,246,237,131,238,222,253, -125, 57, 34, 36, 4, 55,111,222, 4, 0,133, 51, 11,249,212,182,232, 79, 98, 98, 98,212,154, 53,107, 20,171, 87,175, 70,100,251, -246,209,167, 46, 95,118,104, 42, 62,126,241, 98,230,128,255,207,222,151,199, 53,121,108,239, 63,147,141, 0, 42,130,187,104, 85, -172,168, 85,235,130, 21, 80, 43,137,162,181, 90,187,252,106,212,234,181,245,171, 45, 65,237,117,235,130,182,182,118,209,170,189, - 23,181,171,196, 46, 87,187, 88, 37, 88, 91,183,186,160, 9, 42, 34,136, 86,235, 10, 8, 42,130, 11, 74,194,150, 0,217,230,247, - 71,242,198, 16, 3,121, 19, 80,180,125,159,207, 39, 31,222, 45,135,201,204,188,243,156,115,230,204,153,190,125,159,186,112,236, - 88,103, 0, 62, 0, 62, 55,250,248, 64, 88, 93,141,110,237,218, 97,193,130, 5, 72, 77, 77, 93, 25, 26, 26,154,146,154,154,186, -191,160,160,192,141,114,119,119, 30,128,122,196, 0,212,208, 3, 83, 82, 82, 72, 92,156,236,216,209,163, 69,169,114,185, 92, 4, - 0,113,113,178,193, 43, 87, 42,211,192, 50, 9, 80,231,190,143,189, 83,121,253,198, 40,139,201,220, 67, 87, 90,138,210,219,183, - 64, 8, 15,148, 90, 80, 85, 85, 5, 74, 41, 40,165,184,116,238, 60,140,134,106,252,153,156,236,174, 14, 29,199,156,230, 0,120, - 99,164, 81,150, 49,210, 40, 56, 46, 11,180, 77, 17,176, 70,135,110,131, 36, 5, 57, 25, 42, 0,232,220,169, 19, 78,101, 88,245, -228,220, 63,183, 1, 0, 90, 61, 50, 64,122, 43,255, 68,163, 13,198, 3,255, 40, 66,230,211, 64,191,176,104, 20,205, 30,140,182, - 95, 31, 65,182, 70,135, 64, 17, 65,177, 70, 11, 1, 33,110, 61, 0,246,119, 51, 53,181,198,147, 93,187,118,165, 99,198, 62,141, - 29,219,118, 32, 49, 49, 17, 31,188,251, 30,246,170,247,131, 47,224, 35,184, 67,112, 84,105,105,221, 75,151,183,110,221,170,182, - 41, 2,146, 81,163, 70,213,136, 5,216,183,111, 31, 46, 94,188, 88,165, 80, 40,218, 57,123,147, 92,246,151,206,157,145,151,151, -135,199, 30,123,204, 52,111,222, 60,209,166, 77,155, 16, 16, 16,128, 11, 23, 46,220,229,121,205,203,203, 67,103,246,237,236,152, -120,110,234, 19, 79, 60,241,209, 75, 47,189, 20,144,153,153,217,180,170,170,234,255,124,125,125,159,177, 5, 6,254,206, 82,158, -227, 66,249,169,207,252,123,211,134,161, 35, 94, 32,159, 38, 3,164,253,179,248,100,205, 59, 84,147,115, 97, 58, 0, 37,254,198, -168,161, 0,204, 85,227,236,103,146,234,236,185,106,251,148,102,254,103,146,146, 63,202,171, 76,186,240, 71, 91,142, 9,242,227, - 63,193,175,174,242, 55, 81, 94,121,113,185,225,104,218,197, 27,123, 10, 53,250,148,185,106, 92,175, 77,201,152,242,175,197,234, -131, 71,210,164, 0, 84, 22, 62, 51,205,199,199,197,178,235,120,255,245,233,208,235,171, 81, 86,105,141, 1, 48,240,124,176,121, -107,221,105,118, 11,242,211,200, 11,207,254,219, 74,150,102,198,114, 54, 97,116, 31,130, 73,179, 86,193,207,207, 7,205,124,197, - 82, 0,170,156, 51, 39,164,235,191,216, 90,231,128, 36,160, 38, 24,136, 85, 9, 0, 33, 48, 83,106, 85, 4, 76,182,229,126,132, - 7,129,197, 2,147, 45, 56,208,157, 18, 80, 82,217, 28,149,213,197, 16, 9,120,246, 52,103, 38, 11, 96, 52, 82, 24, 77, 20, 21, -149, 22, 16, 62,129, 25, 4, 70,203, 29,215,189, 43,152, 45, 60,240,136, 25,196, 76, 64,121,212,238,254, 39,181, 24,207,140,164, -179, 23, 54, 17,119,185,161,207,167,157,175,111,223,177,187, 45,250,244,233,115, 61, 36, 36,228,133,203,151, 47,119, 75, 76, 76, -204, 0,240, 92, 82, 82,210,115,142, 15,175, 88,177, 66,189,112,225, 66,233,138, 21, 43,220, 17,132,189, 66, 98, 99, 99,107,125, -232,197, 87, 94,177,250, 0, 61, 75, 12, 68,157,220,254, 0,128, 65, 61,123, 74, 51, 88,144,191,125, 0, 62,117,202, 30,173, 58, -184, 79, 31, 75,124,124,252,151,227,198,141, 51,101,101,101, 9,174, 92,185,130,206, 45, 90,164,237,216,177,131, 85,128,226, 61, -202, 3,224, 72,238, 55, 83, 82, 82, 28, 99, 60, 78, 59,212,179, 91, 37, 64,185, 98,165, 78,182, 48,238,197, 11,251, 15,164, 53, -247,247,111, 86,166, 45,129,201,100, 2,181,189, 7,218,155, 69, 40,211,106, 65, 41, 69,255,232,104,233,159,201,110,243, 32,153, -112, 39,230,132,103, 91, 14,200, 11, 31,240, 56,198, 72,163,236,171, 0,114, 46, 95,102,173, 4, 68,143,125, 73,146,188,243, 23, -187,149,255,187,242, 59, 21, 0,180, 10, 25, 34,189,149,151,170, 6,128,198, 33,127,122,183, 18,128,111,208, 47,246,125,220,176, - 88,208,119,125, 6, 50, 70,183, 65,175, 29, 55, 33, 32, 64, 83,161,119,123,179,237,216,177,131, 76,124,105, 34, 29, 62,114, 4, -182,109,249, 13, 31,175, 92,129,184,210, 82, 80,139, 5,155, 55,111, 65, 97, 97,225, 51, 0,118,184,147,227, 74, 17, 0,128, 23, - 94,120,225, 36,128,114, 54,101, 89,191,126, 61, 25, 53,106, 20, 61,113,226,132,104,192,128, 1, 24, 49, 98, 4, 84, 42, 21, 30, -121,228, 17, 84, 87, 87, 35, 42, 42, 10,148, 82,203,137, 19, 39,120, 66,161,208,155,140,128,143, 5, 4, 4,172,158, 56,113,162, -240,220,185,115,205,170,171,171,107, 11, 12,100,139,254,193,253, 38,108,232, 55,108, 34,249, 46, 5, 40,171, 4, 12,151,118, 91, - 52, 57,170,105,168, 25, 24,248,208,128,201, 3,224,104,249,187,186,230,210,149,234, 64,254,204,249,249,207, 36, 21,249, 87,110, - 87,164, 1,104,103,123,121,171, 1, 20, 2,200,155,171,134, 91, 23,167,226,235,157,234,161, 67,251, 72,205,180,137,202,241,229, -168,208,149, 89,215,253,243,252,144, 91, 14,178,230,235,141,172,126,224,214,109, 95,144, 91,154, 60, 9,120,122,149, 35, 23, 54, -105, 18, 0,179, 81, 11, 80, 29, 70,247, 97, 55,161,107, 4, 31,160,212, 74,212,224, 67, 68,109,138,128,141,252,173, 57, 0, 1, -152,217,205, 77,164, 29,191, 74,194,122,183,163, 38,163, 6, 2,219,194, 94, 74, 41,204, 38,138, 42, 35, 80, 86,110,130, 17, 20, - 38,202,131, 64, 72,112,251,166,177,214,114, 30, 59,182,146, 0,192,224,200,183, 40, 49, 90,173,127, 10,128, 82, 2, 80,155,197, - 64,249, 32,124, 11, 44, 22, 1,178,115,182,176,250,205,175,126,252,170,244,114,238,229,186, 8, 88, 8,235, 82,141,186,216,201, - 94,243, 75,150, 44, 97,252,163,167,108, 86,241, 29,162,126,241, 69,201,150, 45, 91, 84, 54, 37, 64,229, 78, 9, 88,167, 84, 26, -255, 60,125, 90,214,185, 79, 31,243, 19, 61,122,232,108,125,180,218,230, 16,177, 67, 54,122,180,213,226,232,211,199,253,116,199, - 91,111, 73, 1, 96, 96,247,238,119,221,203,204,202, 82,103,156,247, 94, 25,234,211,179,231,215, 60, 30,207,124,225,216, 49,255, - 54,109,218,220, 78, 45, 40,216,224,206,234,191, 15,172,227,216, 15,116,182,128, 63,102,106,160,194,169,173,217, 40, 1,231,100, - 11,227,194,183,125,251,221,150,144, 46,157, 31,171,174,174,130,217,104,130,197, 98, 65,211,192, 64,148,106, 52, 12,249,179, 81, -162, 74, 62,124,227,223,173, 1, 24,114, 46, 95, 22, 49,243,255,233, 39,254,194, 24,105,148,101, 73,252, 23,238,146, 3,217, 49, -107, 78, 28,189,144,117, 65,234, 72,254, 0, 48,252,169,231,164, 7,246,252,174,190,149,151,234,125, 37,214, 18,224,231,250, 58, -123, 14, 27,248, 71, 17,240,199,235,246,243, 71,127,191, 97, 63, 46, 53,154,189, 46,239,230, 95, 54,147, 33, 67,134, 60, 61,106, -236,232, 93,175, 77,157,113,248,241,190,125,134,110,251,125, 59,210, 78, 30,199,241,227,199,119,214,229, 6,174, 67, 17,152,177, -117,235,214,111,183,110,221, 26,177,117,235, 86,214,133, 27, 53,106,212,240,189,123,247, 30,216,177, 99, 7, 66, 66, 66, 48,114, -228, 72, 4, 4, 4,100,151,150,150,134,158, 61,123, 22,121,121,121, 60,161, 80,136, 81,163, 70, 69,239,221,187,215,211,159,122, -174,180,180,116,229,246,237,219,235, 10, 12,244, 4,127, 22,158, 76, 92,254, 91,210,179,239, 84, 6, 79, 65,229,177,197,150,107, -135,150, 77,173,135,188, 7, 78, 17, 96,237, 1,168, 13,115,213,208, 1,248,203,246,241, 10,135, 15,159, 86,199,198, 46,148, 38, - 40, 62, 86, 5,119,234, 6,160, 26, 66, 31, 49, 10,174,151, 97,227,142, 84,226,185,188,157,234,105,175,206,199,250,239,127, 5, - 44, 87, 0, 8, 96,170,170, 68,112,187, 0,233,178,183,102,176,182,230, 96,182, 64,192,179,192, 72, 4, 16, 82,211, 29, 69, 0, - 38,128,154,193, 54, 48,204, 17,199,207, 92, 39, 0,208, 54,136, 71,133, 2,171,181,111,178, 88, 19, 24,149,148, 83,152, 77, 0, - 95, 96,129,217,196,110,228, 56,146,246, 31, 2, 0,225,131, 22, 80, 48, 57,225,121,128,133, 88,221,253, 89, 57,219, 61, 42,228, -183,239,125,171,110,128,254,197,202, 92, 97,200,223,193, 19,224,118, 57,214,177, 11, 23,146,142, 57,185, 12,235,120,214,237, 51, - 13,153, 58,248, 46,229,214,186,196, 47,193,106, 91,123,183,111, 72, 3,231, 1,112,174, 91,157,155,165, 86,172,250,142,114,197, -202, 11,178,133,113,189, 1,240, 47,164,164, 24,171,244,149,176,152,205,232, 25, 22, 38,109, 23,250, 24,142,253,177,157, 93, 29, - 83, 50,113,207, 31, 59,237,167,131, 31, 11,177, 31,239,249, 99,231, 93,231,117,133,198,127,253,185, 85, 65, 30,241,212,243,210, -115, 23,114,113,253,202,105, 21, 0, 28,216,243,187,170,205, 35,189,165, 55,243,207,120,220,238, 19, 38, 76,128,167,233,125,205, -196,167,206,251,249, 47,180,197, 31,215,170,238,249,128,159,154,154,250,135, 66,161,224,101,102,102, 90,246, 31, 77, 65,139,150, - 45,156, 87,122,120,132,173, 91,183,126,167, 80, 40,126,144,203,229, 70, 79,190,247,230,155,111,170, 0,144,105,211,166,209,220, -220, 92,100,100,100,160,188,188, 60,180,105,211,166,104,209,162,133,125, 47, 0, 47,200,159,193,127, 82, 82, 82,132,105,105,105, -125, 12, 6,195, 98,212,156,203,247, 6,239,158,217,252, 47, 97, 64,215, 31, 22,148,230,238,157,210, 0,242, 26, 21,204, 42, 0, - 87,215,189, 82, 0,220, 14,130, 10,133, 96,237,218,181,238, 93, 85,123,142,168, 59,116, 30, 65,110, 22,164,209,214,193, 29,161, - 41, 55, 97,227,182,195, 94,119,208,245,223,174,182,125,183, 13, 5,110, 34,176,169, 0,203, 22,189,230,209, 75,255,205,209,156, -123,182,129,205, 13,141,133, 0,128,216, 87, 72, 13,149, 70, 88, 0,248,249,249, 65,111,210, 19,179,201,115,121,233, 25,214, 61, - 3,194,159,152, 79, 45,148,143,203,151,118, 53,230,238,102,108,151, 14,114,187, 4,178,168, 31, 71,194,111,224,105, 1, 67, 92, -156,204, 7,128,121,229, 74,165,185, 62,130,148, 43, 86, 50, 27,249,216,219, 52,247,140,103,235,244,231, 44,255,194, 43,101,204, -121, 43, 96, 71,236,223,243,155,218,185,175,221,204,247, 46,127,128,187,141,125,156,117, 96, 19,241, 65, 37,175,238, 21,169,185, -229, 38,132, 54, 21,220,151, 87,197,182, 86,191,193,222, 57, 79,201,191,198,248,236,253,134, 63,108,240,137,193, 96,248, 13,112, -191, 41, 29, 75,188, 93,154,187,119, 35,106,198, 6, 60,212, 74, 0,171,193,199,219,125,132, 57,112,112, 68,183,110,221,144,147, -147,195, 85, 4, 7, 14, 28, 56, 60, 36,224,113, 85,192,161, 33,192,145, 63, 7, 14, 28, 56,112, 10, 0, 7, 14, 28, 56,112,224, -192,129, 83, 0, 56,112,224,192,129, 3, 7, 14,156, 2,192,129, 3, 7, 14, 28, 56,112,104,116,212, 8, 77, 61,121,242,164,215, - 81,155,174,130, 9, 57,121,156, 60, 78,222, 3, 35,175,206,232,112,174,254, 56,121,156,188,191,151, 60,143, 21, 0,135,129,194, - 83,184, 27,120, 26, 82, 30,135, 7, 19,148,107,183,135,178, 29, 88, 63,175, 80, 40,252, 1, 60,113,248,240,225,101,124, 62,127, -176,143,143, 15,244,122,253,145,161, 67,135,190, 11, 32, 67, 46,151,235, 31,132, 10,176,101,135, 84,253,147,199, 21, 74, 41, 61, -115,230, 12,250,244,233,195,189,147, 28, 60, 82, 0, 60, 90,135,204, 38, 81,142, 43,121,142,137, 79, 60,149,247, 15, 28,208, 89, -225,169,167,158,146,238,217,179, 71,205, 86,102,112,112,240, 93, 55, 10, 11, 11,157, 7, 83, 40,149, 74,194,178,140,247, 76, 9, -168, 45,159,127, 99,201, 91,181,106,213,136, 45, 91,182, 36,103,103,103, 3, 0, 66, 66, 66,158, 77, 79, 79,223,238,109,251, 58, -246,123, 74,169,253,253, 96,174, 51,239,138,237, 58,113,163, 60,179,109, 7, 79,200,255,177, 51,103,206,108, 41, 43, 43,235,209, -169, 83, 39,220,190,125, 27, 85, 85, 85, 0, 48,120,203,150, 45, 42,127,127,255, 11, 10,133,226,121,185, 92, 94,231, 86,146,103, -206,156,241,200, 32, 72, 77, 77,149,202,229,114,181, 39,223, 81, 42,149, 42,153, 76, 38,245, 38, 1, 20,245, 48, 9,195,132, 9, - 19, 60,121, 63, 0, 0,157, 58, 89,119,192, 45, 47, 47, 71,117,181, 53, 13,186, 78,167,243,228,125,171, 19,167, 79,159,166,131, - 7, 15, 70,207,158, 61,225,227,227, 83, 84, 93, 93,253, 8, 55,140,254,243,224,156, 12,232,158, 37, 2,226,172,216,123,139,223, - 19, 70,187,125,230,249,153,187, 61,146,169, 82,221, 49,144,178,179,179,225,239,239,111, 31,132, 24,176,217,252, 67, 38,147, 81, -165, 82,233,124, 78,106,121,198,171,186,141,138,186,179,157,171, 43,249,245, 1, 33,132, 14, 27, 54, 76,154,146,146,226, 17, 89, -108,217,178, 37,185,117,235,214,120,249,229,151,161,213,106, 45,241,241,241,219, 86,172, 88, 49,105,225,194,133,155, 61,252,255, -248,227,143, 63,236,231,163, 71,143,198,238,221,187,235, 60,103, 35,214,169, 47,211,176,176, 48, 0,160, 14,153,225, 60, 34,255, -210,210,210,180,174, 93,187, 54, 3, 0,177, 88, 12, 95, 95, 95, 20, 21, 21,161,164,164, 4, 1, 1, 1, 40, 42, 42,234,177,123, -247,238, 12,133, 66,209, 93, 46,151,223,168, 75, 94,239,222,189, 33,147,201, 16, 18,114, 39,235,223,202,149, 43,107, 60, 19, 23, - 23, 7, 0, 56,122,244,168,202,155,126, 83,159,236,143,107,214,172,169,237,150,125,175, 2,111,225,239,239,143,115,231,206, 65, - 40, 20,194, 96, 48, 96,247,238,221,200,201,201,193,162, 69,245,219,113, 54, 48, 48,144, 15, 32,250,224,193,131,187,163,162,162, -110, 62,255,252,243,109,146,147,147,193,231,243, 91, 53,111,222,156, 15, 14,255,104,242,103,174, 57, 43, 1,127,155, 32,192,240, -240,112,201,253,182,184, 27, 19,193, 3,151,218, 63,222, 66,171,213,218, 45,126,157, 78,135,117,235,214,217, 63, 30, 12,180, 46, -207,199,143, 31, 79,101, 50, 25, 5, 64,157,159,241, 20, 7, 15, 30, 84,189,245,214, 91,232,210,165, 75,131,213, 95,231,206,157, -201,219,111,191, 13, 74, 41, 82, 82, 82, 84,158,182,123,118,118, 54, 70,143, 30,109, 1, 0,145, 72,196, 11, 13, 13, 69,124,124, -252,166, 86,173, 90,209,240,240,240, 49, 30, 88,156,247,170,139,144,176,176, 48,202,252,174,227,199,143, 51,251, 1, 48,237,194, -218,237,175,213,106,183,136, 68,162,102, 0, 48,123,246,108, 76,153, 50, 5, 34,145, 8,190,190,190, 16,139,197, 32,132,128,207, -231,163,180,180,180, 25,128,120,133, 66, 81,167,236,184,184, 56,132,132,132, 32, 47, 47,207,254,137,139,139,171,241,169, 15,100, - 50,153,212,246, 59,189, 30, 19,230,207,159,111,255, 56,142,151, 78,215, 45,108,229,117,234,212, 9,254,254,254, 88,188,120, 49, -252,253,253,177,109,219, 54, 84, 86, 86, 54, 8,249,219,222,101,170,213,106,255,111,234,212,169,232,214,173, 91,155,221,187,119, -227,230,205,155,184,122,245, 42, 74, 74, 74, 12,247,115,108, 82, 40, 20,146,130,130, 2,170, 80, 40, 36,174,238,229,228,228,208, -139, 23, 47,114, 9,232,238, 3,249,199,196,173, 64, 76,220,138, 90, 21,131,251,162, 0, 16, 23,168,235,186, 55, 72, 79, 79, 87, - 53,132, 18, 48,101,202,148,135, 70, 9,168, 47,244,122,253, 93, 86,191, 55,205,203,144,201,248,241,227,237, 86,126, 82, 82, 18, -234, 75,252,142,214,191, 82,169, 36,195,134, 13,147, 42,149,202, 26, 30,129,250, 32, 49, 49,145, 0, 32, 81, 81, 81, 82,103, 79, - 3,203, 65,215,100,243, 6,160,117,235,214, 88,186,116,105,213, 27,111,188, 97,200,203,203,219,185, 98,197,138,145,141,221,190, - 14,123, 0, 16,199,118,242,176, 93,158,200,201,201,233, 1, 0, 51,102,204, 64,105,105, 41,174, 93,187, 6,161, 80, 8,129, 64, - 0,129, 64, 0,161, 80, 8, 95, 95, 95, 84, 86, 86, 34, 57, 57,121, 50,128, 64,119, 66,243,242,242,160, 84, 42,237, 31, 71, 79, -192,202,149, 43,145,156,156,236,245,239, 86, 42,149,106,219, 20,128,170,129,222,229,218, 18,119,179, 30, 63, 47, 95,190,140,157, - 59,119, 98,233,210,165,232,212,169, 19, 90,182,108,137,148,148, 20, 44, 90,180, 8,254,254,254, 0, 0, 62,191, 94,134,122,187, -233,211,167, 79,252,207,127,254,131,244,244,116, 92,187,118, 13, 38,147,233,229, 22, 45, 90, 4, 2, 48,222,239,190, 23, 28, 28, -140,152,152, 24, 85,110,110, 46,117, 36,255,152,152, 24,213,163,143, 62, 10,179,217, 12, 14,247, 22,142,196,239,120,220, 24, 30, - 0,234,226, 83,215,245, 70, 83, 2,198,140, 25,211, 16, 74, 0,245,224,195, 26, 47,190,190,167,193, 26, 36, 59, 59, 27, 58,157, -174, 86, 55,255,145, 35, 71, 26, 66, 49,168, 55, 14, 30, 60,168,178, 41, 22, 72, 73, 73, 81, 19, 66,208,186,117,107, 85, 67,118, - 78,198,253,111,243, 4,212,137, 85,171, 86,141, 25, 50,100, 8, 5,128,248,248,120,209,247,223,127,143,151, 95,126,153,113,205, -139,255,250,235, 47,145,237,222,222,240,240,240,231,216,252,255,209,163, 71,227,233,167,159,182,187,247,153, 99,230,156, 57,102, -233,254, 7, 0,216,172,127, 87,237, 64,156,238,215,137,221,187,119, 47,107,217,178, 37, 0,224,226,197,139,200,207,207,199,137, - 19, 39, 96, 48, 24, 64, 8,129, 64, 32, 0, 33, 4,102,179, 25,122,189, 30, 91,183,110, 5,128,190,158,120,142,100, 50,153, 75, -229, 37, 47, 47,175, 94, 74,128,195,111,175,151, 55, 0, 13, 48, 85,106, 52, 26, 49, 96,192, 0,168,213,106, 92,190,124, 25, 3, - 7, 14,180,223, 83,171,213, 8, 10, 10,178, 43, 2, 94,160,253,244,233,211, 11,190,251,238, 59, 68, 71, 91, 55, 50,106,223,190, - 61,204,102,243,143, 0, 74,238, 55,241,200,229,114, 53,163,124,134,132,132,224,216,177, 99,148, 33,127, 70,249,235,222,189, 59, -155,241, 97, 16,128, 31, 96,221,243,172, 46,140, 5, 16, 3,160, 21, 71,251,247,185, 99,179, 98,195,251, 24, 4,104, 83, 2,164, -233,233,233,106,111,101,116,238,220, 25, 83,166, 76,193,207, 63,255,236,109, 76, 0, 1, 64,127,254,249,103,151, 55,119,237,218, - 5,219, 61,143,101, 31,189,244, 24, 34,186,156, 67, 97,230,226,122,213,147,227,156,127,114,114, 50,162,163,163, 17, 19, 19, 99, - 39,255,142, 29, 59, 54,132,210, 87, 47, 69, 32, 42, 42, 74,114,240,224, 65,220,190,125, 91,202, 92,147, 72, 36, 82,165, 82,169, -138,138,138,146,120, 58,111,239,230,127, 73,217, 40, 0, 91,182,108,217,201,204,253,235,116, 58,172, 92,185, 18, 21, 21, 21, 16, - 10,133,240,241,241,193,165, 75,151,176,116,233, 82,104,181, 90,196,199,199,255,182, 98,197,138,225, 11, 23, 46, 84,185, 33,217, - 26,202,128,187,152, 0, 22,117, 14, 55, 59, 0,218,167, 3,220,253,222,160,160,160,193,213,213,213, 48,153, 76, 56,114,228, 8, -248,124, 62, 12, 6, 3, 42, 43, 43, 97,177, 88,236,239,177,209,104, 68,117,117, 53,243, 78,247,118, 39,183, 54, 55,127, 92, 92, -156, 61, 30, 32, 36, 36, 4, 69, 69, 69,245, 86, 68, 29, 86, 5,176,237,139, 26, 0, 65,174,110,172, 94,189,218,171, 66,196,199, -199,227,173,183,222, 66,255,254,253,237, 30, 16, 38,125,118,255,254,253,145,149,149,133,214,173, 91,123, 35,186,211,244,233,211, - 47,127,247,221,119,142,227,103,240,181,107,215,174, 53, 38,177, 12, 28, 56,144, 48,164, 63,112,224, 64, 12, 28, 56, 80, 5, 0, - 89, 89, 89,232,209,163, 7,219,118, 56, 9,192, 23,192, 38, 0,147,224,180, 37,184, 13,175, 3,248,194,118,252, 46,128, 30,128, -251, 45,234,255,206, 96,118, 3, 92,183,114,161,221,242, 95,183,114,161,253,222,125, 87, 0,238, 55, 30, 20, 37, 96,202,148, 41, -244,221,119,223,189,203, 21,232, 13,249, 55,164,245, 15,192,165,245,207, 88,253, 66,161, 16, 55,110,220,104, 84,242,119,180,254, - 29, 3,186, 84, 42,149,163, 23,224,190, 7,108,102,103,103,227,229,151, 95,214, 3,240,243,247,247,199,123,239,189, 7,161, 80, -104,191, 63,109,218, 52, 0, 64, 96, 96, 32,198,141, 27,135,195,135, 15, 31,184,143,229, 36,142, 30,128,186,148,128,176,176, 48, -231,173, 98, 93, 42, 3, 6,131, 1, 26,141, 6, 85, 85, 85, 8, 8, 8,128,143,143, 15, 76, 38, 19, 40,165, 48,155,205, 48, 24, - 12, 48, 26,141, 48,155,205,142, 10,253,237,186, 10,153,151,151, 87, 35, 0,144,153, 14,112,244, 8, 56,222,175, 47,188, 8, 8, - 20,215,118,195, 49, 38,192, 19,101, 96,233,210,165, 24, 59,118, 44, 58,119,238, 12, 63, 63, 63, 72, 36, 18,104, 52, 26,248,251, -251, 67,171,213, 98,253,250,245,224,241, 60,118,200,118,152, 62,125,250,229,121,243,230, 97,219,182,109,120,238,185,231, 0,160, - 45,128,155, 15,194, 56, 44,151,203,213, 1, 1, 1,210,137, 19, 39,170, 0, 96,243,230,205,210, 73,147, 38,121,210, 22, 6, 0, - 83, 0,252, 92,135, 18,224, 56,213,246, 8,128, 62, 0, 50, 56,219, 30, 53,136,191, 54,252, 45, 51, 1,214,151,252, 25,120,107, -165, 59, 14,200,203,150, 45,171, 55,249, 51, 24,208,191, 31,246, 31, 80, 97,227, 1, 63,187, 82,112,244,210, 99,245,250,141, 97, - 97, 97,200,203,203, 67, 82, 82, 18, 58,118,236,136, 13, 27, 54,120,108,117, 41, 20, 9, 18, 7, 15, 78,131,144, 63, 51, 31, 95, - 84, 84, 36,117,190, 55,108,216, 48,105, 82, 82, 82,131,197, 2, 0, 86,247, 63, 91,239,147, 86,171, 61, 15,235,188,176,101,243, -230,205, 88,191,126, 61, 0, 96,211,166, 77,208,106,181,204, 99,166,172,172, 44,180,106,213, 56, 94, 73,167,104,255,187,148, 51, -182,251,196,231,229,229, 29, 49,155,205,208,106,181,184,125,251, 54,180, 90, 45,244,122, 61,244,122, 61, 42, 42, 42, 80, 86, 86, -134,210,210, 82, 84, 86, 86,162,186,186,154,153,219, 77,171, 75,166, 51,185,187, 10, 36,117, 94, 21,192, 22, 54, 87, 63,117,113, -205, 19,248, 53,116,123,108,216,176, 1, 18,137, 4,126,126,126, 56,119,238, 28,212,106, 53,252,253,253,241,254,251,239,227,240, -225,195, 88,180,104,145,167, 10, 64,219,233,211,167, 95,157, 52,105, 18,126,253,245, 87,134,252,219, 63, 40,228,111, 29, 23, 20, - 18,134,252, 1, 96,226,196,137,170, 11, 23, 46,120, 58,181,202, 40, 1,176, 41, 1,206,211, 1, 23, 29,142,243, 1,156,230,104, -255, 14,156,131, 0, 27, 69, 1,184, 31, 65,128, 13, 77,254, 54,226,110, 8,203,141, 44, 91,182,172, 94,228,255,226,235,123, 48, -160,255, 29,215,205,150, 95,183,218, 61, 2,251, 15,168,188, 82, 2,228,114, 57,108, 75,195,160,215,235,177,111,223, 62, 44, 93, -106, 93, 81,112,250,244,105,152, 76, 38, 15,100,197,170, 1,107,224, 31,165,148, 9, 6,172, 23,249, 51,214,127, 93,110,254,134, -138, 5, 96, 20, 9,137, 68, 34,117,247,108, 72, 72,200,168,248,248,248,176,244,244,116,193, 15, 63,252,192,187,112,225, 2,166, - 77,155,102, 98,234, 49, 62, 62, 30,233,233,233,248,225,135, 31, 4, 87,174, 92, 65,120,120,184, 91,153,247, 34, 6,128,177,164, -157,148, 0,202, 40,125,108, 17, 26, 26,154,105, 50,153, 96, 48, 24,112,235,214, 45,220,184,113, 3, 55,111,222,196,205,155, 55, -113,235,214, 45,104, 52, 26,232,245,122, 84, 87, 87,163,180,180,148,249,159, 5,117,201,100, 2,253, 28,149,208, 58,202,238, 17, -249, 51, 57, 0,156,175,213,167,127,184, 88, 13, 96, 87,242,216,202,200,201,201, 65, 86, 86, 22,244,122, 61, 34, 35, 35,209,183, -111, 95,108,216,176, 1,239,188,243, 14, 68, 34, 17,248,124, 62, 4, 2,214, 14,217, 14,211,167, 79,191, 62,105,210, 36,100,100, -100,224,131, 15, 62, 96,172,223,235,120, 64,150, 49,103,102,102, 82,102,206,255,196,137, 19, 88,183,110,157, 20, 0,186,119,239, - 14,199,192,192,122, 42, 1,115, 97,157,255, 31, 15, 96, 22,128,112,252,195,221,255,192,157, 72,127, 87, 65,128,206,171, 0,238, -215, 20, 0,245,240,250,223,133,252,237, 74, 64, 61,166, 18,106,144,191,171,243,253, 7, 60, 31,223, 28, 7, 93, 63, 63, 63,244, -236,217,179,198,253,244,244,116,143,228,141, 31, 63, 30, 73, 73, 73, 96, 20, 1, 0,212,118,205,227,117,231, 27, 54,108, 80, 1, -192,238,221,187,165,174, 34,214, 83, 82, 82,212,151, 47, 95,118,105, 61,186, 66,109, 73,127, 24, 69, 35, 37, 37, 5, 81, 81, 81, - 82,149, 74,229,182,239,164,167,167,239, 91,190,124,249,136,212,212,212,253,161,161,161,200,206,206,134, 86,171, 21, 4, 6, 6, - 98,250,244,233,208,104, 52, 87, 82, 83, 83, 59,133,134,134, 34, 53, 53,149,196,198,198,186, 83,142,239,154,243,175, 71, 12, 64, -141,119,139,201,151, 96,203,157, 96,247,204, 56,204,255,187,109,143,136,136,136,119,212,106,245, 28,179,217,140,178,178, 50, 24, -141, 70,251,188,127, 85, 85, 21, 40,165,160,148, 34, 43, 43, 11, 6,131, 1,209,209,209, 47,201,229,114,147,171,164, 35,181, 33, - 58, 58, 26,209,209,209, 53,130,254, 60,157, 2,112, 36,122,155,203,159, 58,246, 15,219,170,128,134, 30,215, 88,143,159,204, 82, -191, 55,222,120, 3,106,181, 26, 82,169, 20, 57, 57, 57,104,210,164, 9,242,243,243,193,231,243,217,122, 0,200,244,233,211,175, - 78,157, 58, 21,135, 14, 29,194,251,239,191, 15, 0,193, 0,174,225, 78,254,135, 70,183,252,153,241, 37, 47, 47, 15, 97, 97, 97, - 76, 63,147,198,196,196,168, 66, 66, 66,144,149,149, 69, 89, 6, 2, 58, 42, 1,147,108, 10,192, 38, 0, 71, 0,200, 1, 72, 0, -220, 0,135,134,235,192, 13,157,141,207, 85,192,207,202,149, 43,107,189,222,152,228,111, 91, 1,112, 47,180,104,175,101, 94, 45, -112,223,191,125,125, 61,243, 90,186, 11, 18,243, 20,209,209,209,210,164,164, 36,245,132, 9, 19,104, 98, 98, 98, 13, 69,192, 73, -225, 99, 93, 15,177,177,177,110, 53, 27, 15, 19, 3, 81, 39, 69,194, 58, 42, 73,165,172,200,223, 97, 48,183,207,235,135,135,135, -255, 43, 62, 62,254,199,113,227,198, 33, 43, 43, 11, 87,174, 92,233,180,120,241, 98,105,108,108, 44, 43,121,247, 40, 15, 64,141, -122,174,133,248, 88,101, 12,148,203,229,186,132,132,132, 37,187,118,237,250,208,100, 50,161,164,164,196, 30, 3, 0, 0,183,110, -221, 66, 73, 73, 9, 40,165,140,213,238, 17,203, 50,243,255, 97, 97, 97,246, 8,118,230, 58, 91, 37,192,133,149,127,215, 52,212, - 61, 32,127,143,193, 40, 1, 11, 23, 46, 68, 74, 74, 10,198,141, 27,135,229,203,151,227,205, 55,223,132, 64, 32,128, 88, 44,118, - 59,134, 80, 74, 45, 51,102,204,192,143, 63,254,136,239,191,255, 30, 0, 58,218,200,191,193, 13,170,250,160,176,176, 16, 59,119, -238,172,145,197,209,118, 44, 29, 62,124,184,202,203, 37,143,102,155, 18,176,195,102,253, 71,112,228, 95, 59, 92, 5, 1,178, 82, - 0, 60, 73,196,225, 45, 97, 55, 52, 26,130,252,235, 75,212,247, 2,115,231,206,149, 94,184,112,161, 65,101,218, 92,164, 13,186, -148,142, 33, 60,219,218,122,198, 43, 64, 9, 33,176, 88, 44,216,178,101, 11,107, 37,224,173,183,222, 98,202,121, 87, 12, 0,143, -199,131,197, 98,193,219,111,191,173, 98, 75,158,117,201, 75, 73, 73, 81, 59,102, 69,244,162,223,253,180,124,249,242, 91,169,169, -169,187,217, 90,253,247,193,219, 70,156,189, 61,181, 40,124,172,148,128,216,216,216,143, 20, 10, 69,210,207, 63,255,124, 86, 36, - 18,129, 89, 21, 96,177, 88,208,188,121,115,104,181, 90,200,100, 50, 68, 71, 71,251,201,229,114,183, 11,188,153,241,197, 49,248, -239,248,241,227,136,142,142,174, 49,158,184, 27,135,226,226,226,104, 94, 94,158,212,217,197,239,109, 26, 96, 71,184, 8,240, 51, - 1, 48,173, 94,189, 90,108,179, 70,121, 14, 31,143,148, 0,199,196, 63,179,102,205,178, 31,151,149,149,185, 29,155, 8, 33,100, -250,244,233,244,135, 31,126,120, 30,192,239, 15, 34,241,216,136,158,120,122,143,141,210,238,132,235, 15,195, 24,126,191,193,172, - 2,112, 69,252,172, 86, 1, 52, 52,169,215, 38,239, 65, 81, 30, 30,228,142,243,217,103,159,169, 27, 90,166,211, 26,233,123, 6, - 39,247, 63,219,151,154,109, 46,116,226,193,239,189,167,191,117,209,162, 69,123,234, 83,159,163, 71,143,174,177, 44,246,233,167, -159,174,225, 25,240,112,238,159,120,232,237, 97, 85,110,185, 92,126, 78,161, 80, 52,217,187,119,239, 39,249,249,249,115, 42, 43, - 43, 97, 54,155,209,175, 95, 63, 12, 28, 56, 48, 62, 58, 58, 58,142, 13,249, 3,192,209,163, 71,237,199, 81, 81, 81, 53,174, 59, -159,187, 25, 87,136,163, 66,203, 40, 19,182, 56, 0,175,218,125,194,132, 9,181,221, 18, 56,140,151,162,123, 53,174,184,241, 84, - 88, 0,224,251,239,191,231, 54, 76,225,192, 90, 9,168,141,252,107, 83, 0, 26,186,115,113,157,149, 3,241, 80,179,255,199,213, -141, 35,225,223,131,105,129, 6,121, 7,229,114,185, 14, 86,215,235, 92,230,218,249,243,231,217, 16,151, 29,189,123,247,110,240, -241,192,149, 66,235,173,203,255, 94, 43,139, 28, 56,254,184,159, 74,128,219,202,245,118, 31, 97, 14, 28, 56,112,224,192,129,195, -195, 11, 30, 87, 5, 28, 56,112,224,192,129, 3,167, 0,112,224,192,129, 3, 7, 14, 28, 56, 5,128, 3, 7, 14, 28, 56, 60,132, - 48,193,131,237,138, 57,255,124,202,173, 0, 0, 32, 0, 73, 68, 65, 84,252, 51, 33,224,170,128, 3, 7, 14, 28,184,177,157,195, - 63,188,147,156, 60,121,210,235,136, 75, 87,193,132,110,228,213,185,254,216, 11,121, 13, 93, 62, 78, 30, 39,239, 31, 45,239,207, -119,174,120, 61,176,244,255,164, 19,238,181,188,227,139,188,151, 23,182,252,110,121, 76,253, 41, 20, 10,137,209,104,196,165, 75, -151, 84, 6,131, 1, 2,129, 0, 5, 5, 5,120, 41,160, 51,246,100,102,162,242,241,142,136,136,136,144,242,249,124,102, 93,123, -163,181,175, 66,161,120, 12, 64,235,179,103,207,238,108,223,190, 61, 79,163,209,136,219,183,111,191,212,215,215,119,173, 92, 46, -191, 6, 0, 9, 9, 9,188,132,132, 4,115,109,242, 18, 18, 18,154,218,188, 5,250,216,216, 88, 10, 0,139,255,253,228, 55,242, - 39,243,167,111,204, 12,189, 36,104, 61, 42,162, 73,211,102, 21, 0, 40,165, 84, 0, 32, 48, 33, 33,225, 42,247,190, 61,216,242, -238,181,150,200,118,211, 23, 79, 83,224,122,156, 50,119,101,228, 83, 18, 65, 80,128, 42, 55,251,162,244, 81,159, 38, 88,112,230, -160,250, 65,210,178,234,200, 71,206, 45,113,105,100,140, 29, 59, 86,178,107,215, 46, 85,252, 59,214,243,223, 14, 61,137,131, 7, - 15,178,106,151,127, 77,123, 69,194, 35, 68,149,117,225, 2,180, 90, 45, 58,117,234,132, 38, 77,155, 98,107,210, 22,214,237, 58, -126,252,248, 26, 47,110, 82, 82, 82,157,123, 41,216,178, 43,122,213,111,152,141,154, 40,165,245,235,119, 50, 77,205, 87, 85, 25, -228,189,172,176,213, 64,200, 43,214,227,188,245,192,241, 5,245,111,212,241,183,107,150, 47,169, 37,171,175, 41, 20, 10,170,211, -233,164, 91,183,110, 85,229,229,229, 65, 38,108,129,182, 29, 91,161, 74, 87, 9, 95,189, 9, 67,222,124, 13,195,198, 77,196,142, -239, 18,176,125,255,126,213,168, 81,163,164, 15, 64, 23,206, 54,155,205,237,242,242,242, 44,125,251,246, 21,133,134,134,226,196, -137, 19,239, 84, 85, 85,141, 85, 40, 20,209,114,185, 92, 19, 27, 27,107,169,107, 73, 88,108,108,108,185,227,249, 87, 95,125,197, -219,253, 83, 92,183, 14, 51,250,227,237, 65,189, 90, 29,221,251,223,196, 45,167, 37, 39,187,245, 30,190,156, 16,162,145,203,229, - 5,253,250,245,179,216,148, 6,206,211,240, 15,115, 19,121,170,105,176,202, 54,230, 13,249,127, 29,245,172, 36,178, 85, 7, 21, - 1, 69, 78, 69, 9,218,181,239,172, 50, 90,204, 88,212,103, 48,138, 58,181,146,126,183,227,119, 86,138, 64,204, 36,208, 30, 93, -153, 51, 62,182,238,181,224,208, 49,138,152, 73, 64,143,174,192,130,101,245, 35,110,102,131,146,250,102, 39,115,165, 76, 52,148, -220,250,128, 82, 74,177,132,128,124, 84,231, 51,192, 18,130, 9,231,101, 15,204, 90,235, 59,228, 79,109,228, 63, 12,135, 15, 31, -102,245,221,180,163, 47, 82,147,177, 7,148,202,235, 72, 79,179, 38,172,201,190,144, 5, 0,216,185,147,208,172,139,227,165, 11, -230,178,107,151,145, 35, 71, 90,246,237,219,199, 75, 74, 74,194,129, 3, 7,106, 36,195,113,134,151, 41, 84,237,205,228,162, 35, - 83,234,133, 66,193,164, 11,175,119,206,130,144, 87,236, 27,237,172, 94,189,186, 97, 20, 0,135,122,178,237, 78,200, 10,185,185, -185, 80, 39, 38,170, 62,138,158,128,126, 83,102, 65,212, 38, 16, 16,216,146,253, 89, 40, 96, 17,194, 82, 77, 49,230,149, 24,228, -127,190, 2, 71,142, 28, 81, 41, 20,138, 26,233,110, 27, 1,102, 30,143,215,186,101,203,150, 80,171,213,130,190,125,251, 98,208, -160, 65,188, 27, 55,110,244, 63,117,234,212, 25,133, 66, 49, 64, 46,151,223,176,145, 53,143,101,221, 53, 25, 49,124,100,200,242, - 85,219,120,113,211, 78, 55,139, 24, 61, 83, 26, 17,158,252,228,155, 95, 20, 60, 19,250,196,203, 97, 0,202, 97,141, 49,224,213, -198, 15,142,137,173,220,245,163,122, 43,164, 28,156, 61, 9,238,188, 5,246, 99, 79,130, 0, 41,211,184,253, 94,238, 3,133, 66, -193,243,128, 8,157, 55,169,160, 97, 97, 97, 8, 11, 11,243, 58, 79,188, 98,114,140,100,114,255, 72, 85,247,118,193,232,218, 46, - 24,143,183,106,143, 96,223, 38, 16, 91,128, 46, 62, 77, 16,144,115, 77, 53,253,153,231, 36,108,100,245,232, 10, 92,200,229,225, -252, 69, 63,156,201,109,134,231, 71,250, 99,213,187,124,244,232, 74, 26,204, 72,175, 47, 73, 51,219,156,134,132,132,168, 50, 51, - 51,145,153,153,137, 15,127, 58,133, 71,199,196,169, 0, 80, 15,183, 60,165,108, 63, 50,153,204,253, 91,188,196, 90, 71, 97, 97, - 97,144,201,100, 46, 63,204, 51,158, 98, 92,223, 15, 36,142,229, 25,219,103,137,164, 33,218, 99,236,216,177,146,157, 59,119,170, - 8, 33,120,227, 19,130,223, 14, 13,195,161, 67,135, 88,125, 55, 49,113,138, 36, 34, 60, 22, 67,135, 94,199,231,159,127, 94,227, -222,228,201,192,152, 49,192,252, 57, 73,170, 85,159,177,107, 19,134,252,213,106, 53,120, 60, 30, 38, 78,156, 8, 62,159, 95, 31, -178,191,203,242,119, 53, 32, 19,226, 29,249, 55, 24,194, 86, 1, 0,214,172, 89,131, 53,107,214, 88,175, 13,136,111,180,226, 28, - 56,112, 0, 95,189, 16,131,129,207,201, 32,104, 17, 4, 34,228,131, 39,228,131, 47, 22,129,231, 43, 6, 64, 65,205, 38, 80,131, - 1,175,189, 50, 11,101,251, 51,145,155,155,171, 82, 40, 20, 18, 52, 30, 72,102,102,102,100,199,142, 29, 69, 22,139, 5, 41, 41, - 41,216,182,109, 27, 2, 2, 2, 16, 25, 25,217,110,243,230,205, 31,219,158, 99, 21, 16,168, 80, 40,248,135,247,255,242,191, 71, -252, 10,218,232,202,249,152,188,164, 2, 95,254,247, 51,160,105,111,193,127,227, 90,119,201, 61,241,243,100, 7,238,224,213,162, - 24, 18, 7, 82, 39,214,203,196,126,236,120,253, 30,237,133,193,161,129, 61, 0,246, 86,218,184,251,231,146,174,143,118,109, 46, -255,232, 53,139,135,236, 72,194,194,194, 40,147,150,212, 33, 61, 41,245, 52,109,167,226,133, 87, 36, 79,117,124, 84, 37,170, 50, -193,247,191,111,193,164, 55, 64,252,198, 50, 4,136,196,168, 18, 86, 66, 87, 85, 9, 95, 16, 84, 95, 45, 82,125,250,233,167,210, -183,223,126,187, 78,242,189,144, 11,172,219,100, 1,160,183,125,128, 39,159,224,225,133, 81,164,198,123, 19, 51, 9, 88,183,201, - 43,242,150, 42,149, 74,234,173,181,206, 88,253,153,153,153,119,234,224,176, 17,149, 6, 29, 0, 96, 68,220, 62, 40, 87,142,244, -200,203,144,187, 34, 23, 66,146,115,167, 35,144, 66,144,150, 61, 28,206,139,208,234,255, 94, 96,215,176, 31,217,243,205,147,218, -210,206, 18,155,210,119,252, 56,187,118,150, 63,251,165,100,221,182,127,171,182,159,250, 0,203,231,253,134,112, 73, 40, 54,126, -125, 8,223,238,181,110, 16, 52,243, 95, 31, 72,215,254,244,129, 87, 74, 85,252, 59,160,192, 78, 40,127, 56, 11, 74, 41,154,182, -126, 28,135, 14, 29,130,109,223,130, 58,203,183,234, 51,153, 68, 38,107,161, 2,190, 2,240, 27,210,211,129,240,240, 59,247, 63, -254,248,206,241,252, 57, 73, 42, 95,191,197,210,153,175, 45,173,179,156, 12,249, 71, 69, 69,193, 98,177,224,203, 47,191,108, 80, - 7, 13, 0, 88, 44,150,187,201,159,214,253,254,242, 38,104,107,188,252,204, 16,110,145,185,120,206,238,231,179, 30,244,237,123, -247, 28, 59,111,162,182,134,154,111,177, 76,195,188,121,243,236,247,231,205,155,135, 53,107,214,128,215,109,198,157,255,106,123, -222,149, 60,193, 68,215,229,115,222,201, 90, 48,145, 93,249,170,170,170,208,182, 83,103,192, 98, 0,207, 7, 32, 2, 62, 76,229, -165,168,202,187,132, 91, 5,133,232, 48, 88, 2, 34,106, 14, 98, 52, 0,124, 30, 86,206,124, 19, 35,215,125,128, 5, 11, 22, 52, -244,184,204,138, 21, 21, 10, 5,161,148, 54,175,172,172, 28, 28, 20, 20,132,172,172, 44, 88, 44, 22, 92,186,116, 9,235,215,175, - 71,207,158, 61, 17, 28, 28,252, 50,128,215,156,200,186, 86,111, 0,165,180,101, 39, 94,186,164,221, 35,163, 69, 37, 41,167, 81, -170,245,193,143, 59, 76,216,117,244, 39,204,145,249, 10, 4,122, 75,152, 45,166,192,165, 2,192, 17,122,227,163,182,233, 30, 87, -158, 1, 30,139,142,200,204, 27, 66,178,104, 24,214,165, 40,154,231, 94,204,197,201, 31, 78, 67,161, 80,120,100, 61, 48,228,160, -215,255, 12,189,126, 35, 52,154,104,198, 58,246,232, 7, 14,242,105,166,106, 93,101,134,120,201, 44,152,111,107, 96,186,120, 25, - 2,145, 16,126,132, 15,127,194,135, 63, 95,128, 32,161, 24,180, 92,135,235, 7,142,184,221,233,197, 21,169, 31, 58,102,177,191, -135,171,222, 37,136, 95, 76,108, 30, 1,239,172,127, 27, 57,171,224, 69, 10, 92,103,242,135,128,143,188,235, 21,184, 94,108, 64, -250, 57,235, 6, 34,221,166,109,135, 39,251,158, 11, 73, 14, 4,164, 16, 62,188, 83,214,191,173, 9, 2, 39, 95, 67,192,164, 51, -240,121,126, 9, 16,236,239,153, 39,151,197,206,109,158,108,241,170,216,246,186, 42, 34,232, 93, 28, 63,120, 9,255,111,252, 56, - 4,183,236,142, 89,255,126, 21, 95, 44,222,139,136,192,197, 88,251,211,135, 94,239,224, 67, 8, 16,187,224,140,221, 98, 25, 58, -116,168,141,144, 44,110, 27,120,202, 36,161, 10, 56, 0,224, 55,148,220,108,130,110,143, 52,193, 55,223, 88, 45,255, 37, 75,128, -144, 16,171,136,146,155, 77, 80,114,179, 9,250,245, 57,175,114, 71,254, 7, 14, 28,128,197, 98,177,147,244,230,205,155, 97, 54, -155, 61,114, 95,215,225,225,185,139,252,173,239,179,123,229,157, 2,100,173, 66, 33,101, 44, 53, 11,165,176, 88,238,238,190,204, -117, 11,165, 88,155,144, 32, 77,176,126,199,229,255,164, 0,161, 20, 36, 33, 65, 33,165,148,226,179,207, 62,179,223,103,142, 19, - 18, 18,164,148, 90,159,163, 0,169, 77, 94,130, 66, 1,219, 61, 98, 54,155, 97, 50,155, 97, 50,221, 93,103,204,117,147,217,140, -175,215,174,149,174, 77, 72,168,165,124, 20,130,166, 77, 1, 33, 31,102,125, 5,206,110, 73,194,251,175,202,209,225,117, 57,250, -175,248, 8,151,254, 60, 1,190,175, 24,198,226,155, 56,125, 84,141,237,135,246,160,244,198, 13,156, 57,115,166,193, 54,214,138, -140,140,100,229, 77, 80, 40, 20, 1,148,210, 65,153,153,153,191,191,247,222,123,189,206,158, 61, 43, 50, 24, 12,224,243,249,104, -218,180, 41, 76, 38, 19, 50, 50, 50, 64, 8, 17,185, 27,235, 19, 18, 18,252, 21, 10,133,111, 66, 66, 66,112, 73, 65,234,159, 31, -254, 47, 63,232,175, 67, 59,160,209,241, 32, 18,240,208, 33, 80,140,210,219, 34,200, 63, 53,225,244,237,254,254,238,120,195, 22, -107, 66, 29,251,162, 77, 49,184,235, 58, 71,215,247, 7, 12,249, 59, 43, 7, 60,119, 90, 40,179,223,119, 13, 55,231,232, 41,158, -123,251,108,238,126,189,126, 35, 0,130,170,170,239, 33, 62,118, 25,250, 61,143,214,184,239, 14,111, 15,136,146, 4,104,202, 97, - 17, 9, 96, 56,126, 22,213,231,243, 80,181,247, 16, 80, 89, 13, 17,165,240, 3, 31, 2, 16, 84, 91, 76,208, 84, 87,225,235,125, - 59,220,202, 92,245,174,213,186,119,132,245,156, 49, 87, 40,178, 46, 82, 44, 88,230,125,127,117,202, 87,206,218,101, 47,147,201, -236,123,107, 51,120,105, 77, 1,246, 31,215, 34,255,102, 21, 0, 32,255,102, 21,114, 10, 42,129,232, 68,102, 99, 20,247,174, 31, - 82,104, 85, 4,202, 79,195,223,255, 34,124,196,229,176, 88, 52, 48, 26,143,131,207, 15,129, 65, 87,220,104,157,117,194,232,127, - 75, 0,130, 47,127,155,129, 38,188, 71, 0, 0,215,179, 40, 6,140,227,227,223, 75, 71, 98,232,200, 94, 0,168,237, 57,207, 16, - 21, 21, 69,223,248,132,160, 73,171, 62,160, 0, 70,191, 48,147,245,188,255,218,111, 22,211,214,173,255, 2,112, 6, 37, 55,155, -160,188,216,186, 5,115,223,190, 64,183,110,192,203, 47,223, 33,255,242, 98, 95,148, 23,251, 34,200,239,122,157, 50,199,143, 31, - 15,169, 84,138,225,195,135,215,112,253, 59,126,188,153, 18,112,245,222,122,131, 88,135,249,109, 66,136,253, 83,219,181, 88,185, - 92, 45,143,113, 63, 39, 30, 19, 19,163,114,101, 57,207,155, 55, 15, 49, 49, 49, 53, 8,181, 54,121,191, 41, 20, 56,115,230,140, -221, 5,239, 88,103, 12,156,175,205,140,141, 85,199,202, 93,111,213, 44,162, 20, 60, 63, 31, 24,111, 92,129, 98,241, 98,172,215, -149, 64, 27, 21, 97,191,255,221, 79,235,241,193,155,175, 34,116,193, 75,248,232,244, 1, 36,106, 47, 97,228,179,207, 34, 36, 36, -196,227, 96, 64, 27,209,211,240,240,240, 26,125,248,232,209,163,170,186,182, 99, 87, 40, 20, 66,133, 66, 49,240,244,233,211,249, - 41, 41, 41,234, 55,222,120, 35,226,203, 47,191, 20, 87, 84, 84,216,183,105,174,170,170, 66,147, 38, 77,114, 38, 76,152,208,125, -200,144, 33,143,184, 81, 36,120,132,144, 78,167,211,182, 20,101,239, 89,112,121,193,162,248,118,219,151,180,199,249, 66, 1, 74, - 43,248,176, 16,160,184,194, 0,218,162,107,213,252,119,150,245,122,230,249,127,189, 6, 55,241, 4, 54,247,127, 13, 87,191,155, - 99, 14,141, 64,254,181, 77, 1, 80,182,174, 28,185, 92,238,238, 33,234,108,253, 91, 93,109,223,215,230, 29,112,251, 79,123,181, -108,163,210, 80, 35, 68,197, 26,136,127, 59, 0, 34,224, 1, 85, 6,208,114, 29,136,201, 4, 33, 0, 51,181,160,202,108, 66,185, -201, 0, 88,220, 91, 81, 76,144,223,170,119,107,213,105, 97, 13, 18,108, 16,133,149, 56, 4,242,185,125, 1,238,178,254, 1,252, -242,122,187, 26,231, 3, 23,230, 65, 72,111,195, 72, 90, 66,169, 84, 30, 96,251, 98,137, 43, 84, 8,250,232, 39,220,122, 35, 22, -183, 53,190,104,111, 60, 11,179, 57, 15, 0,112,229,100,219, 70,235,176,137,187,191, 80,189, 58, 74, 81,131,252, 25, 68, 4, 46, -198,224, 94,227, 17, 25,116, 22,137,187,151,170, 60, 25, 68,134, 13, 27, 70, 83, 82, 82, 80, 92, 60, 2, 45, 90,236, 71,147,150, -189, 65, 41, 5,143,199, 99, 21,136,148,159, 15,228,229,157,177,157, 85, 0,226, 10,104,116,192,160, 65,214, 43, 57, 57,192, 87, - 95, 1,229,101,128,174, 2,168,208, 1,254,129,101,172,202, 86,155,181,159,155,155, 11, 0,248,228,147, 79, 0, 0,161,161,161, -247,194,205,204,170, 14,231,206,157, 91,195, 98,119, 38,110,214,222, 29, 27, 97,219,231,253, 29,240,217,103,159, 97,205,154, 53, - 80, 40, 20, 18,119,193,117, 51,130, 67,145,125,246, 28, 10, 3, 3, 85, 60, 30, 15,115,230,204,185, 43, 38,195,147,242, 61, 89, -221, 28,212, 82,129, 87, 63,121, 23,125,198,143,135,226,147, 79,192,227,221,225, 57, 69,206,153, 59, 30,194, 67,135,176,111,223, - 62, 92,186,116, 73, 42,151,203,213,108, 54, 94,113, 36,255,180,180, 52, 21, 0,100,100,100,168, 34, 35, 35,165,105,105,105,234, -240,240,112, 73,122,122, 58, 34, 35, 35,165,149,149,149,170, 90,198, 92,227,180,105,211,250, 76,153, 50,165, 89,151, 46, 93,176, -107,215, 46,125,105,105,169,160,178,178,210,234,237,176,205,127,108,221,186, 53,116,244,232,209,190,114,185,188,210,133, 24,158, - 3, 89,243,242,178, 78,174,249,224,237,233, 77, 90,116, 83,226, 79,229, 43,248,235, 42, 65,254, 77, 1, 64,121,168, 54, 24,161, -161, 45, 10,103,207,152, 21, 65, 8, 41,100,198,124, 79,126,175, 11, 15, 1, 55, 85,240,128,160, 86, 45, 46, 37, 37,229,174, 79, - 73,161, 22, 37,133, 90,143,218,154,249,220,177, 98,173, 13, 47, 62,118, 25, 62,103, 10, 33, 40,208, 50, 30,128, 26,207,215, 38, -240, 92, 65, 62,142,221,190,134,179,151,242,112,243,210,101,148, 93, 46, 64,249,213, 66,152,244,149, 48, 26, 77, 40, 55, 27,160, - 55,155, 80, 77,205, 48,131,130, 18,246, 74,166, 99,180,255,133, 92,235,249,130,101,140,229,207, 67,252,187, 13,179,226,197,211, - 56,128, 56,165, 22,113, 74,109, 13,194,103, 62,145,113, 25, 16,210,219, 16, 80, 45,126,153, 97, 54,177,158, 2,184,121, 12,102, - 93, 19, 0,192,127, 5, 1,168,190,121, 5,153,159,182, 67,246,207, 99,113,236,211,126,200,201,186,214,168, 29,179,239,160, 16, -232,180,128, 78, 11,232,125,207, 1, 0,126,253,208,136,183,231, 45, 1, 0, 12,137,238,229,177,229,255,194,176,131,208,104,162, - 17,120,116, 63, 86,191,107, 85,114,135, 13, 27,198,202,245, 15, 0,203, 63, 94, 74,186,118, 5, 28, 63, 23, 46, 88,221,255, 0, -208,173, 27,197,154, 53, 64,167,238, 21,120, 44,226, 22, 6,141,184,133,231, 95, 50,178, 46,163,163,197,207,156,135,134,134, 34, - 52, 52, 20,115,230,204,105,232, 42,118,251,174, 57, 98,221,186,117, 82, 87,132,109,247,162,173, 90,133,117,235,214,177,178,132, - 95,123,237, 53, 21, 19,249,239, 10,243,231,207,191,203, 11,224, 10, 7,207,229, 99,250,140,217, 56,190,113, 35, 22, 45, 90, 84, -171,114,194,148,111,255,254,253,168, 43, 96,111,216, 99,143,224,251,239,190, 66,216,228,201, 88,190,124, 57,234, 42,227,188,121, -243, 48, 98,196, 8,120,179, 2, 32, 45, 45, 77,229, 16, 44,135,163, 71,143,170, 0, 32, 61, 61, 93, 69, 8, 65, 90, 90, 90,157, - 50,245,122,125,243, 29, 59,118,224,220,185,115,200,201,201,241,211,233,116, 48, 26,173,253,204, 96, 48, 96,247,238,221,196,166, - 44, 84,178, 40,142,165,186,186, 90,116,124,203,100, 84,101,127,129, 61, 41,185,184,116,157,143, 50, 29, 15,102, 10, 20,234,124, - 49,123,193,187,145,177,177,177, 5, 44, 12, 62,187, 94,193, 44, 57,101, 57, 29,192,161, 17,172,255,218, 20, 0, 2,128, 72, 36, - 18, 72, 36, 18,156, 58,117,202,254,201, 59,118, 5,165,149,165,104, 49,200,243,117,191,199,143, 31, 39, 0,224,231, 55, 5,226, - 99,151, 33,188, 82, 12, 74, 8, 68, 51,138,107,220,119, 75, 92, 34, 62,204, 20, 40,208,149, 32,191, 84,131, 91,101, 90,148, 86, - 85, 65,107,168,196,173,234, 74, 92,175,210,163,176,170, 2, 26, 99, 53,180, 22, 35, 12, 22,247,193,175, 79, 62,225, 98,192,115, -136, 11,120,117, 98, 19, 80,136, 64, 61,222, 6,252, 78,244,190,139,107,172,145,127,179, 10,251,143,107, 49,112, 97, 94,205,186, -160,183,225, 99,185, 2, 31,203, 21,124,240,148, 0,249,249,249, 6,182, 50,183, 92,178,160, 85,124,130,253,252,146,206,140,130, -220, 66,100,165,158,197,141,203, 37,141,222,113, 55,126,157, 2, 0, 40, 43,162,240,171,124, 12,146, 25, 2,252,191, 37, 66,251, - 39, 62,113, 50, 8,123,227,159, 62, 55, 52, 5,175, 44,176,146, 63, 33, 4,191,167, 90,155,128,237,154,127, 6,161, 61,186,215, - 44,231, 70,224,203, 47,129,139, 23,173,158,128, 15, 63,164,118,247, 59,165, 20,129,129,129,238, 71, 96, 91, 31,101,230,253, 63, -249,228, 19,228,230,230, 34, 59, 59, 27,217,217,217, 72, 78, 78,198,155,111,190,137,252,252,252, 70,107, 15,134,232, 92, 89,210, -115,231,206, 5, 33,132, 53, 25, 18, 66, 80,151, 50, 81,215, 61, 71, 28,242, 41, 1,225, 53,193,183,239, 44, 67,147, 29,201,136, -137,137,193,100, 70, 27, 3, 32,239,214, 27,115,195, 6,195,207,207, 15,195,134, 13,195,123,239,189,135,228,228,100,213,242,229, -203, 93,190,127,223, 21,102,227,122,175,199, 16, 28, 28, 44,181, 88, 44,117, 42, 20,117,221, 99, 65,142,118,143, 83,100,100,164, -212,129, 40, 17, 17, 17, 33,117,227, 61, 25, 62,108,216,176,102,249,249,249, 56,116,232, 16, 30,125,244, 81, 8, 4, 2,251, 20, - 71,112,112, 48,219,233, 8,139,237,255,146,174, 61,250,199,173,219,219, 28,127,237, 90,130, 39, 35,123,194, 95,204,131,191,159, - 25,190, 62,213,120,250,185, 9, 22, 0, 26,199, 47, 38, 36, 36,184,155,139,178,175, 2, 96, 57, 29,192,225, 65,243, 0, 0, 32, - 10,133,162,233,220,185,115, 49,119,238, 92, 0, 48,124, 28,251, 49,140, 69, 38,248,250,138,225, 77,227,201,100,214,240, 97,191, -167, 46,130,242,121,120,239, 87,189,163,245,207, 10,126,193,193, 82, 83, 19, 63,104,169, 25,231,116, 90,156, 41, 45,198,217,178, -219, 56, 91,166,193, 57,157, 6, 23,245, 90, 20, 87, 87,161,194,100,194, 53,189,206,254, 63,235,194, 11,163, 8, 86,189,203,199, -170,119,249,160,224,131, 18, 30, 98, 38, 17,188, 54, 73,132, 25, 19, 91,161,107,215, 54,176, 64,232,241, 79,102, 92,253,142,243, -242,117, 36, 5,170, 77,134, 52,167,192,170,200,103,174,176, 6,209,237,121, 43, 0, 0, 32,160, 90,240,169, 14,213, 60,107, 68, -179, 70,163,241,147,201,100,209,158,148, 49, 44, 44, 12,201,201,201,216, 88,161, 67,165,129,135, 87, 54,125,139, 34,177, 47, 42, - 13,141,183, 77,196,184,190, 31, 72,211, 52,203,176,241,199, 68,251,181, 95, 63, 52, 34, 34,112,177,253, 60,230,153,175,164, 20, -172,214, 15,211,213,139,129,105, 11, 70,160,249,209,100, 72, 63,141, 2,111, 44,160, 86,171,189,234,195,157, 58,213,140, 30, 31, - 62, 28,104,222, 28, 8, 9, 1,194,251, 54,133, 88,196, 7,159,119, 71,172,216,215,215,237,128,204,227,241,236,150,127,110,110, -174,221,234,103, 62, 31,125,244, 17, 62,250,232, 35, 92,187,198,222, 43,227,106,190,190,230,125,207,173,175,117,235,214, 73, 87, -175, 94,237,146,176,217, 90,255, 14,174,231,187,226, 20,152,115,139,133, 93, 10,123, 3, 33,176,232,171, 33,108,219, 9,242,165, - 75, 49,205,191, 57,154,171,211,236,247,103,252,107, 26, 62,248,239,183,200, 89,245, 11,222,239, 51, 28, 19, 2,187, 96,223,182, -109,200,203,203,115,249,254, 61, 31, 43, 71,175,222,189,165, 22, 91,153, 24,133,204,113,122,198,213,181,218, 48,115,230, 76, 74, - 8,161, 76, 96, 31, 51,223,239, 72,242,105,105,105,234,136,136, 8, 41,165, 20,204, 84,128,155,122, 75, 17, 10,133,143, 62,255, -252,243,185,165,165,165,208,106,181,240,245,245, 69,171, 86,173,208,188,121,115, 52,111,222,220, 93,229, 89,156, 20, 59,179,143, -143,143,254,197,216,207,165,235,143, 13,196,229,171,101,104, 19,192, 71,100,119,130,199,187, 80,248, 55,107, 86, 2,192, 92, 7, -111,112,251, 13, 60,164,214, 63,224,102, 25,160, 92, 46,175, 80, 40, 20, 62, 0,252,229,114,185, 93, 11,236, 16,213,222, 43,205, -151, 89,234, 39,147,201,168,104,134, 61,242,159, 56,204,255,187, 29,144,223,217,153,168,254, 36,250, 57,232, 77,213, 40,211,233, -145,107, 52, 66,104,177,126,185,212, 88, 5, 11,165,160, 0,118,221,188, 4,157,201, 8, 0, 44, 6, 38,130, 5,203,106,246,113, -107, 60,128, 5,102, 84,227,252,197,114,124,191,185,204,163, 31,235, 72,244, 54,151, 63,181, 29,219,137,157,205,234, 7,235,119, -149, 16,142,248, 26, 64, 8,138,139,239, 4,231,137, 44,215, 97,224,181,195,236, 62,217,184,126,221,110, 57,237,103, 83,190,216, - 95,215,213, 80,188,148, 74, 37,152,210,108, 58,125, 4,209,209,209,141,214,113,183,159,178, 46,239, 75, 77, 62, 11, 0, 24,220, -203,154, 25,239,237,121, 75,112,228,108, 47,252, 55,113, 50, 20, 59,102,177,158,255,127,101, 65, 52,130,130,146,109,103,106,155, -178, 20, 13, 74,173,214, 24, 64, 17, 20,148,204, 74,214,190, 61,123,237, 57, 45, 38, 79, 6,164, 82,130,219, 87, 3,160,211,138, - 81, 89, 38,194,166, 13, 4,115,231, 82, 92, 41, 42, 71,120,100, 4, 82, 14,168, 88, 89,197,102,179,217, 62,223,159,156,108, 45, -171, 35,225, 23, 21, 21,161,168,168,136, 53,255, 59, 16, 6,229,241,120,119,145, 42,165, 32,158, 38, 1,146,203,229,234,215, 94, -123,173, 70, 44, 0,227, 17,240,196, 21, 78, 28,180, 18,139,211,178, 2, 66,216,207,217, 17, 66, 96, 42, 47,135,176,101, 16,248, -126, 77,208,235,197,241,248,104,212, 72,188,195, 44,219,235, 63, 0,230,202, 42, 8, 91,180, 65,159, 8, 9, 58,119,232,130,207, -207,167,161,119,239,222,210, 99,199,142,221,165, 4,196,202,229, 0,136, 10, 0,102,197,198,218,151, 14,154,156,200, 94, 32,224, - 3,244,206, 66,197,218, 10,188,118,237, 90, 2,128,218, 92,252, 36, 35, 35,195,165,139, 63, 45, 45, 77,205,134,252, 19, 18, 18, - 8, 33,100,113,243,230,205,123, 69, 68, 68,116,189,112,225, 2, 78,156, 56, 1,179,217, 12,127,127,127,232,245,250,162,160,160, -160,203,158, 24,125, 10,133,130,215,166, 77,155,125,207, 61,247, 92,155,163,135, 51,176, 70,185, 15,205,136, 8,221,219, 84,227, -226,109,127, 12,237,110,188, 4,192,121, 30,203, 92, 87,155, 56,102,156, 34,132, 56,158, 58,231,125,225,208,200, 16,176,120,233, - 13, 0, 12, 14,131, 10, 45, 72,241,120,126,184, 6,185,215, 66,124,172, 51, 6,150,105,180, 82,163,159, 88, 85,202,179,224, 70, - 85, 5, 96, 52,194,108, 91,215,116,190,162, 4,133,250, 50, 80, 74, 97,203, 47,160,102, 83,188,152, 73, 4,235, 54,221,233,147, - 23,114,129, 30, 93, 77,224, 67, 87, 47,242,119,234,236,238,234,160, 86, 47,128, 82, 57, 75, 5,100, 66,163,209, 24,242,243,243, - 5, 43, 71,130, 23,183,111, 24,230,245, 62, 98,183,194,216, 42, 21,174,188, 46,206,231, 12, 9,177,181,230,176,132, 96,160,109, - 37,135,171,229,126,137,137,137,214, 76,128, 50, 25,101,147,243, 33,118,220,215, 82,197,246,217,170,180, 68,138,200,160,179, 24, - 18,221, 11,135,247,157,197, 81,237, 82, 16, 16,200,199,125, 37, 77,216, 62,155, 85,249,130,130,146, 65, 8,193, 11, 47,188,128, -111,190, 41, 3, 67, 49,214,191,148, 81, 8,104, 77,203,254,118,173,242,162,134, 75,165, 41, 7, 84,170,225,195, 1,195,141,142, -184, 90,226, 3,139,109,182,181,157,174, 13,222,138, 41,199,190,163,221,209,180, 67,119, 41,147, 37,176, 46, 48,196, 95, 80, 80, - 0, 0,184,113,227,134,221, 51,112,243,230, 77,251,192,234, 37,136,131,219,217,249,165, 36,108,242, 1, 56,226,155,111,190,145, -174, 89,179, 70,197, 40, 0,171, 87,175,246,216,250,119, 38, 12,111, 33, 22,139,113,227,202,101,116,233,218, 13, 22, 83, 53,136, -201, 12, 65,211,102,104, 58, 96, 32,154,244,127, 2, 22,157, 9,102,125, 53,168,201, 12,152, 45,136, 91,251, 95, 76,156, 60, 17, - 98,177,216,165, 60,211,166, 64, 86,255,215,213,115, 97,203, 93, 63, 27, 25, 25, 41,181, 41, 0,148, 82,138, 33, 67,134, 72, 83, - 83, 83,239,122,206, 29,249,219,234,202, 2, 96,119,247,238,221,251,127,241,197, 23,134, 91,183,110, 85,141, 28, 57,242,185,204, -204,204,247,245,122,125,113,203,150, 45,229,159,127,254,185,134,109,253, 41, 20, 10, 33,128, 71, 34,194,195, 91,197,206,136,197, -165,130, 75,154,169, 51, 98,159, 76,223,183, 33,254,122,185,102,240,192,168,145,150, 54, 29, 66,255,159,179,149, 95, 87,106, 97, - 91, 31, 35, 14,250, 39,113,193, 1,206,199, 28, 30, 84, 5,160, 46,235,194, 27,242,103,200,166,150,132, 49,172,148,128, 21, 39, - 14,170, 1,144, 73, 3, 34, 41,124,197,208, 82, 19, 12, 38, 19, 44,212,130, 22, 1, 1, 40,208,149,194,147,228, 66,174,150,247, -221,137, 1,240,108, 45,182, 43, 23,127,125,211,245,218,242, 8,140, 27, 56,112,224,246,184,184, 56, 81, 80, 80,144,229,250,245, -235,152,215,251,186, 51,249,179,254, 31,181, 37,236,241, 10,182, 44,127, 46,146, 60,221,245, 12, 91, 36,108,159,165, 6, 64,198, -246, 89, 34,217,121,250, 67, 85, 90, 34, 64, 64, 48,174,239, 7,210,237,167, 62, 80,179, 37,127,166, 47, 21, 23,143,160, 64, 25, - 99,253,194, 21,239,172,143,223,207,244, 7, 82,215,230, 26, 54,171,158, 20,107,123, 75,204,229,229, 42,194, 7,244, 85,190, 32, -229, 38, 8,120, 2,232,121, 98,233,168, 9,175, 98,118, 76,172,219,246, 72, 74, 74, 34, 73, 73, 73,244, 30,190,127,160,148, 18, - 66, 8,117,140,104,119,244, 4,120, 34, 75, 46,151,171, 99, 98, 98, 48,111,222, 60,187, 66,209, 88,169,112,135, 15, 31,142,217, -137,235,240, 81,121, 9,250, 69, 13, 5,175, 77,160,181, 76, 70,106, 77,221, 11, 33, 8, 95, 0, 34,226,227,155,132, 85,104, 54, - 98, 32,186,118,237,234,113,212,126,125,224, 96,221,171,194,195,195,165,169,169,169,245,170,171,220,220,220,232,253,251,247, 95, -225,243,249,219,158,124,242,201,143,103,205,154,117,107,237,218,181, 41,128,117,202,193, 3, 81, 60, 0,201, 39, 78,156, 24,244, -195,250, 13, 60, 17,223,231,234,248,151,198,247,157, 61,123,182,246,235,175,191, 30, 11, 32,192, 70,252,229,204, 6, 65,108, 60, - 10, 28, 30, 12,176,113,255,123,171, 0,212, 91, 97,112, 67, 62,172, 7,164, 77, 39,210,136,108,188, 76, 98,201,202, 81,233,170, - 13, 48,153,205,232, 58,104, 0, 66, 77,225,158, 18,110,131, 5,163, 48, 73,127, 0,168, 24,107,220, 22, 7, 80,175, 28,248, 74, -165,114,135, 66,161, 16, 36, 39, 39, 47, 88,185,114,229,167, 14,202,197,112,199,255,197,214,163, 0,160,193,146,151, 76, 56,207, -196, 89,212,254,251, 38,156,151,121,165,233,239, 60,253,161,154,105, 31, 10,138,237,167, 62,240,170,140, 86,114, 39,120,101,193, -240, 59,102, 47,185,115,111,193, 50,207,243,145,199,189,117, 70, 29, 7,144,181,223, 44,150, 84,234,173,251, 0,220,201,255, 31, -235,241, 59, 98,179,200,204,114,185,188,193,231, 85, 25, 37,160, 33,100,217, 98, 1, 84,204,113, 3,148,205,171,239,117,237,218, - 21,109,231,204,145,174,217,187, 87,149,247,241,111,144, 9, 91,160,185,109,243,158, 74,189, 9,115,223, 92, 4,190, 95, 16,118, -109, 80,224, 84, 75,130, 81,131, 7,123,157,183,223,108, 54,121, 61, 76,176,117,241,179, 80,190,200,243,207, 63,127,139, 82, 26, -223,163, 71,143,255, 21, 23, 23,235,188, 32,126,199,122, 31,150,145,145, 1,139,137, 96,240,144,190, 31,204,158, 61, 91, 11, 0, -179,102,205,178, 0,208,214,167, 73, 29, 60, 78, 53,142, 93,120, 69, 57, 60,100, 30,128,123,162, 20,120, 77,140, 73, 53, 18,236, - 32, 35, 55,171,209, 43,213, 41,233, 15,115,173,222,114,229,114,185, 25,192,127,108, 31,175,229,186, 42, 95, 61,127, 47,105,136, -103,238, 37,172, 4, 79,177, 96, 89,114,131,203,118,151,234,215,131,246, 53,222,203, 58,104,168, 77, 87,228,114,185, 90, 46,151, - 55,136, 44, 82,143, 57, 0,166, 12, 10,133, 2,182,237,123,145,239,176,125,111,234,254,125,246,237,123, 71, 68,140,128, 77,233, -173,245,255,241, 39,106,137,121,115,224,221,196,196,114, 55, 65,119, 74, 64, 67,212,215, 19, 79, 60, 81,109, 50,153, 82, 0,232, -222,123,239,189,122,145,104,108,108, 44,121,239,189,247,168,193, 96, 0,128,189,181, 61,183, 98,197, 10,178,112,225, 66,251,255, -178,165, 2,174,115,108,119, 14,238,228,112,127,193,214,195, 69,188,221, 71,152, 3, 7, 14, 28, 56, 52, 10, 76, 0,170, 0,136, - 27,216,136,115,183, 99, 32,235, 29, 5, 57, 60, 28,224, 26,147, 3, 7, 14, 28, 30, 46, 8, 0, 52, 97, 65,254,122, 88, 3,184, - 27,138, 15, 44,224,150,253,253,237, 58, 18, 7, 14, 28, 56,112,248,251,193,143,227, 11, 14,156, 7,128, 3, 7, 14, 28, 56,112, -224,192, 41, 0, 28, 56,112,224,192,129,195, 63, 29, 53, 92, 58, 39, 79,158,244, 58, 34,215, 85, 48,225,131, 46, 47,100,128, 15, -124,125,110, 64, 40, 42,129,197, 98, 93, 22,198,231,243,192, 35,124,235, 95, 30, 1, 33, 60, 80, 34, 0, 33, 4, 60,152,176,125, -167, 16,148, 82, 4,241, 90,192,147,242,217, 50, 42,182,132, 53,128,167, 28,214, 4, 3, 70,102,201,215,195, 88,127,156, 60, 78, - 30, 39,143,147,199,201,123, 48,229,113, 30, 0, 55, 56,120,248, 34,180,165, 90, 24,141, 20,183,110, 19,236, 73,246,197,222,125, -254,224, 17, 33,246,169,218, 98,239,129,118,216,171,106,135, 67,199, 90, 65, 0, 1,120, 16, 99,104, 36, 15, 62, 34, 31,214,255, - 99,210, 43, 83,233,164, 87,166,210,195,169,170, 42, 35,143,164,158, 61,147,121, 80,117,228,176, 46, 57, 57,185, 10, 64, 83, 78, - 7,125,248, 49,242,169,161,146, 89,179,166, 82, 79, 55,121,122, 88,161, 80, 40, 36,212,134,186,118,215, 99, 11,234, 4,174, 71, -113,224,208, 8, 30, 0, 6,131,135, 12, 98,253, 18, 30, 73,205,112,171,181, 52,180,188,134, 68, 70,166, 16,163, 71,154,113,234, - 47, 95,136,132, 2, 8,248, 2, 8,133, 20, 62,124, 35, 32,104, 10, 1, 42, 49,168,151, 9, 98,145, 15, 40,128,118,109,128,103, -199, 88,176,127, 27, 59,242,191,120, 62, 27,143, 62,214, 21,237,131,155,163,224,202,133, 78, 1,109,187,160,101,123, 51,254,248, -253,119, 36, 39, 39,151,160,145,119,196,146,201,100, 99,148, 74,229, 78,135,243,103, 28,207, 57,212,142,217,179,100,212, 84,117, - 86, 58, 40, 44, 80,101,177, 20,163,180,125,165,170, 67,219, 17,168,168,110,135,111,214,253,244,183,221,233, 44, 38, 38, 70, 53, -111,222, 60, 16, 66,176,122,245,106, 85, 67,228, 4, 96,210, 1,112,252,127,255,225,145,210, 69, 41, 8,143, 87, 87,123, 83,199, -246,100,218,244, 78,242,173,154,237,236,184, 51, 34,135,134, 5,147, 13,208,193, 75,192, 78, 1,104, 44,240,238, 51, 23,142, 25, -101, 4, 5, 31, 2,190, 16,131,195, 9, 90,183,226, 65, 32,224,193, 71,200, 71,143, 80, 30,174, 92, 53, 97, 80, 24, 15, 45,130, -196,248,227, 64, 51, 0, 0,159, 86,130, 82, 11,220,165, 8,158,244,202, 84,250, 87,102, 38, 58,183,239,128,191,210,142, 34,221, - 96,132,246,182, 22, 34,159,166,232,217,127, 8,250, 14, 25, 5,213,118, 37,100, 44,115,227,223, 3,226, 31,174, 84, 42,247,135, -132,132, 32, 51, 51,147,233, 48, 37, 0,230, 40,149,202, 29, 50,153, 44, 90,169, 84,238,255,187,189, 20, 51, 99,101,212, 71,160, -129,128,103, 64, 85,149, 25,165, 58, 95,252,248,243,126,143,234,127,196,200, 33,146,102,190, 26, 12, 31, 34, 66,231, 78,207,170, -154, 53, 11,128,209,100,194,173, 91,183,209, 38,255, 42,114,114,243,240,202,203, 99,232,134, 31,118,121,213,174, 97,182, 61, 21, - 0,246,219,100,223, 79,235, 31,184,179, 29,238,234,213,171,161, 80, 40, 36,141,149, 14,248, 62,190, 47,116,203,150, 45,119,239, -167,208, 72,228,165, 80, 36, 72, 8, 8, 98, 26,160,222,105,254,175, 32,233,175, 58,114,188, 45, 75,166,125,223, 43, 59, 94, 77, -208,185, 85,228,254,248,227, 15,251,249,232,209,163,177,123,247,238, 58,207, 57,220,123,242,119,188,230,168, 8,212,169, 0,164, - 30, 78,199,144,161,225,247,173,208, 22,207,178, 67, 58, 62,236,213, 75,200, 19,240,161,213, 8,208,182,181, 16,109, 91,139, 80, - 81, 33,132, 88, 40,128, 89,224,131, 1,125, 8,250, 61,206, 7,143, 8, 65, 8,129,143, 80, 4, 33,175, 26, 68, 44,130, 73, 15, -152,160,171,147,252, 15, 31,216,143, 46,237, 90,225,204,169, 51,200, 47,186,126,167,124,229, 21, 16,159, 61, 70,121,124,130, 1, - 97, 3,240,199,110,207, 56,118,237,218,181,146,204,204, 76,213,197,139, 23,225,235,235, 11, 95, 95, 95,233,214,173, 91,213, 30, - 14,102, 82,165, 82,185,159, 33,126,135,206,209, 28,192,168,111,191,253,246,246,171,175,190,154, 44,147,201, 70, 42,149,202,228, - 7,177,131,135,135,135, 75,210,211,211, 89,255,110,201,240,193,146,222,161, 77, 85, 29,218, 21, 33,160,153, 15,120, 60, 63, 84, - 86,154, 80,172,169,196,100, 89, 79, 42,110, 54, 0,223,127,247, 51,171,126, 36,196, 13,188,240,204,227,170, 94,189,122,226,250, - 13, 45,142,255,121, 2, 21, 21, 58, 4, 4, 52, 69, 72, 72, 39,240,248, 66,152,205,249,136,157, 57,149, 38,172,253,241,111,101, -221,196,196,196,168,230,207,159,111, 63,159, 55,111, 94,131,121, 1, 30,100, 15,128, 82,169, 36, 50,153,140, 38, 37, 37,193,213, -198, 74,247,219,104,151,203, 99, 65, 8,193,186,117, 10,105, 76, 76,253,148, 0, 94,167, 23,237,228,157,177,188,137,203,193,180, -109,115, 30,130,131,120, 15,109,251,253, 83,225, 72,246,174,148, 2,183, 30,128,212,195,233, 0, 80,111, 69,224,240,156,156, 58, -239, 15,253,188,155,215,131,133, 67,142,115,143, 6,161,100,117,107, 8, 5, 66,116,108, 95,129,242,114, 33,142,159,233, 8, 62, -159, 15, 62,225, 67, 36, 52,161, 87, 55, 61,186,119,227,131,128, 7,145,208, 7, 34, 62, 65,216,227, 6, 4, 5, 90,176,241,127, -117,203,238,217,165, 13,174,228, 22,213, 36,127, 27,242,175, 93, 33,132, 39,160,237, 34, 31, 71, 96,243,166, 40,209,222,102, 85, -222, 53,107,214, 72, 86,172, 88,161,186,114,229,138,227,101,213,152, 49, 99,176,107, 23,123,107, 83,169, 84, 30,112, 36,127, 23, -104, 25, 31, 31, 95,242,198, 27,111,236, 67, 35, 79, 81,212, 65,254, 42, 79,202, 22, 26, 18,164, 10,110, 83,134,150, 45,252,209, - 33,184, 45,252,252,253,112,229, 74, 33,204,102, 11,130,219, 55,197,217,243,105,136, 28, 58, 72,146,118, 56,163,206,193,244,245, -215,167,210,199, 67,181,120,228,145, 14, 56,119,254, 10,142, 31, 63,143, 91,183,203, 65, 41, 16, 24,232, 11,189,190, 2,253,251, -247, 66, 73, 73, 41, 10,143,255,137, 33, 79,134, 75, 82, 15,177, 87, 84,107,134, 60,189, 0, 0, 32, 0, 73, 68, 65, 84, 30,100, - 48,214,191,109,219,105, 48,158,128, 53,107,214,120,236, 5, 96,166,251,157, 51, 1,187,216, 78,182,222,253,175, 67,135, 14,180, - 99,199,142,245,206,197,175, 84, 42,201,132, 9, 19,104, 98, 98, 34,152,141,149,234, 34, 60,219, 86,184,119,149, 63, 50, 50, 82, -194,108, 14, 84,139, 18, 75,221,200,180,255,111,185, 60, 86, 85,159,119,212, 89,222,160, 69, 21, 56,182,188, 73, 13,226,231,240, -112, 90,255,206, 46,255,122, 77, 1,212, 87, 17, 24,250,121,183, 90,149, 0,111,200,159, 65, 74, 74, 10, 10, 11, 11, 1, 0,193, -193,193,212,147,151,129, 79, 43, 33, 32,102,136,132, 66,252,121,166, 21,248, 2, 1,154, 10,117,214, 56,128, 38, 60, 20, 22, 54, -197,227,189, 44, 32,132, 64,246,172, 9,212,194, 3,136, 15, 8, 40,172,129,252,174,161, 47,185,138, 27,154, 10,100, 23, 22,214, - 90,150,146, 82, 13,180,183,110,216,100,177, 30,128,156,201, 31, 0,176,107,215, 46, 60,245,212, 83,146, 61,123,246,184, 29,224, -100, 50,217,240,188,188, 60,151, 29,166,180,180,212,241,114,243, 37, 75,150,224,220,185,115, 35, 30,164,169, 0, 7,242,103, 13, -201,240,193, 18,177,224, 58,124,125,155, 67,236, 35, 66,151, 46,157,209,177,115,103,148,149,169,161,209, 84, 64, 36,226, 35, 40, - 80, 12,129,111,115,183,131,169,128, 22,162,105,147, 22,208, 87,154,112,230, 76, 14,174,221, 40,197,245, 27, 21,168,172, 22,227, -145, 96, 19,196, 62,124,228,100,231,225,209,174, 93,113,237,122, 25, 42, 77,205, 88, 13,208,142,110,255,218,174,123, 58, 29, 80, -155, 76,111,100, 49,214,255,188,121,243,238,186, 62,127,254,124,175,188, 0,174,118, 39,116,158, 59,110, 40,175, 66, 90, 90,154, -170,190, 27,242, 76,152, 48,129, 42,149, 74,200,100, 50,184,154, 14, 96,227,169, 98,200, 31, 0, 50, 50, 50,238, 42,147,237,190, - 91,163,135,217, 97,176,161, 60, 46,137,243,253, 49, 97,181,206, 37,241, 7, 7,241,108,163, 20,187,230, 29, 61,122,116, 13, 47, -201,211, 79, 63, 93,163,174, 56,183,255,131, 3,143, 99, 0, 26,202, 35,208,144,200,201,177, 42, 22,133,133,133, 30, 41, 1, 2, -129, 0, 66,190, 16, 66, 33,193,176, 33,128, 94, 87,141, 75,185, 34, 8, 5, 66, 8,204, 2, 68,132, 83,136,132, 66,240,249, 60, -128, 18,104,180,192,177, 19, 2, 88, 44, 22, 0,183,106,149,123,226,207, 92, 84, 84,212,158,129,179, 75,219,182, 84,103, 34,168, -172, 44,133,217, 98, 98,253, 59, 79,156, 56, 81,187,210,161,215,179, 34, 26,103,215,191, 43,205,112,251,246,237,142,207, 39, 55, -134, 23,192,149,139,223,145,252,109, 3, 32, 59, 11, 48,184,141,138,199,187, 10,147,217, 2,131,209,132, 91,183, 53, 16,138,196, -168,174, 54,194,104, 50,195,100,178,192,100,166,172, 60, 49, 34,161, 14, 98,223, 14, 40, 46, 46, 69, 89,185, 30, 26,109, 37,154, -181,232,139,193,143, 63,142,140,212,221,104,111, 48,161,180,172, 20,221,187,119,133,143, 72, 0, 93,185,230,111, 49, 80,216, 34, -255,237,115,255, 78,158, 41,175, 98, 1,230,205,155, 87,195,155,224,124,143,173, 2,160,209, 68,219, 31,140,141, 13, 66, 98, 98, - 98,141,254,202, 24, 8,249,249,249, 94,239,202, 41,147,201,104, 98, 98,162,125,155,241,218, 98, 2,156,201,213,217, 83,149,150, -150,166, 98, 2,223, 40,165,244,232,209,163, 53,238, 31, 61,122, 84,229,206,233,193, 40, 13,140, 18,224,104,197,215,102,232,187, -249,109, 24, 31,153,140,205, 0, 38,174,214,225,137, 69, 21,245, 82,190,156,231,248,221,197, 4,112,184,247,222,128,218, 60, 0, -247,213,191,227,202,210,175,143,245,239,100,177, 34, 39, 39,135, 25, 80, 88,245, 94, 62, 95,128,136, 65, 22,240,121, 2, 28,203, - 20, 35, 43, 71,140,177, 79, 1,207, 60, 13,140, 27, 77,208,174,141, 8, 98,145, 15,196, 34, 31,248,138,125, 16,220,206, 7, 98, -145, 24, 98, 55,203, 0, 11,242,175,146, 18,205, 77, 82,219, 64,210,181, 75, 39, 4, 52,247,135,216, 98, 64,133,222,120,223, 59, -197,225,195,135,247, 31, 62,124,184, 6,225, 59,126, 0,160,184,184, 24,227,198,141,107, 52, 43,223,102, 29, 73,156,175,217,142, - 61,178,228,204,102, 64,167, 55, 66,167, 51,160,172,172, 26, 55,111,106,113,237,218,109,148,151, 87,163,162,194,136,138, 10, 3, -116, 58, 35, 74, 75, 74,221,202,170,174, 54,161,170,202, 12,163,209,128,166, 77, 69,232, 24,220, 12,126,254,254, 0,128,144,174, -157,209,161,125, 51, 4, 52, 19,131, 82, 51,140, 38, 11,170,171,117,127,139,129, 36, 38, 38, 70,181, 96,193,130, 58,201, 60, 38, - 38,134,181, 69,106,219, 82,184,214,251,171, 87,175,198, 55,223,124,227,241, 86,195, 14,219,206,218, 63, 12,161, 22, 22, 22, 50, -187,103,122,196,110, 19, 38, 76,160, 73, 73, 73,112, 84, 30,148, 74, 37, 25, 63,126,124,157,223,155, 57,115, 38, 8, 33, 96,250, -113,120,120,184, 4, 0, 34, 34, 34,164, 12,145, 51, 86, 63,115,159, 82,106,191,207,226,215,214,176,226, 93, 41, 14,108,102, 80, - 90,182,108, 9,226,160, 37,212, 87, 30,135, 7,143,252, 93,157,123,229, 1,120,144, 44,255, 59, 3,188, 25,124, 62,223,227,239, - 13, 25,100, 65,235, 86, 62, 40, 43, 19,192, 71, 96,130,143,136, 15,117,186, 8, 99,165, 66,136,132, 66,148,149, 9,145,154,233, -143,102, 98, 2, 30,143,135,209,209, 6, 60, 55,150,130,199,163, 88,122,210,243,114,202,100, 50,202,247, 19, 67, 35,108, 9, 63, - 99, 1, 46, 22, 82, 12,151, 12, 99,189,165,111,255,254,253,113,228,200, 17,151,247,252,252,252, 88, 15,150, 90,173,118, 4, 0, -172, 95,191, 30,211,166, 77,179, 95, 47, 46, 46,182, 31, 79,155, 54, 13, 69, 69, 69,141,210,158,233,233,233,106, 66, 8,152,121, - 82, 30,143, 7,198,221, 89,199,188,105,173,200,191,122, 77,218,170,153, 94,229, 35,226,195, 96,180,160,170,186, 0, 87, 11,138, -161,209,150, 65,163,209,163, 88, 83,137, 98, 77, 37,154, 7,117, 6,144, 91,167,172,155,183, 41,110,220,188,141,158, 61,187,162, - 68,171,133, 80,192, 67, 89,121, 1,116, 37, 22, 60,246,168, 14,109, 90,181,130,159,159, 31,124,124,124,113,253, 70, 57, 8, 63, -144, 85, 25, 29, 93,242, 13,181, 10,160,161, 87, 16,212,102,173, 3,119, 98, 1,216, 66, 46,151,171, 99, 98, 98, 48,119,238,220, -187,188, 10,204, 52,131,183, 43, 11, 38, 76,152, 80,195,130,101,222, 47, 66, 8, 94,124,241, 69, 36, 37, 37, 17,182, 74,128,179, -229,239,120,207,217,211,224,140,181,107,215, 18, 0,118, 43, 63, 35, 35, 67,101,235,215,106,155, 55,128,249,171, 2, 64,210,211, -211,237,247,235,218,206, 53, 45, 45, 77, 53,100,200, 96,233,145, 35,214,119, 98,230,204,153, 56,121,242, 79, 41, 67,225, 71,143, - 30, 85, 49,191, 63, 34, 34,194,173,167,108,237,218,181,248, 74, 26,136,137,107,244,214,223, 53,223,191,198,253,137,107,244,246, -250,156, 46, 21,226,187, 3, 6,112,120, 8,148,246,184, 21, 53,149,238,149, 11,113,242,228, 73,246,171, 0,238, 5,241, 59,198, - 2,212,199,250,175,105,201,215, 36,127,155,155,201,237, 84, 64,203,150,124,240, 8, 31,173, 90,242,209,173, 43,197,181,107, 2, -240,248, 4, 66,129, 0, 66,129, 16,127,157,246, 71,144,191, 16,124, 62, 31, 67,194,205,240,245,245,129,197, 66, 1,106,246,138, -252,155,180,233,136,155, 21, 20,186,139,106, 8, 8, 31, 23,175,229,147,139, 44,201,223, 54,176, 73,175, 94,189,170,186,122,245, -170,171,223,171,102, 89,142,145,197,197,197,251, 24,146, 7,128,113,227,198, 97,253,250,245,246,103,202,202,202, 80, 84, 84,132, - 29, 59,118, 48,203, 5,239,123,231,181, 13, 92,170,140,140, 12, 21, 19, 44,102,187,230, 49, 41,164, 30, 74, 87, 75, 37, 97,160, -133,101,208, 87, 26,161,245,169, 2,133, 22, 85, 85, 38,148,149, 85,163,232,182, 30,215,174, 87,224, 73,105, 39, 0,169,117,202, -170, 52,180, 68,222,165, 91, 8,233,242, 8,186,116,233,128,226,226,219, 8,108,110, 70,183,110, 1,104,221, 42, 4, 98, 95, 95, -148,148, 84,224,248,137, 11, 40, 40, 44, 67,219, 14,189, 30,218, 1, 36, 65,161,160,132, 64,202,112,169, 35,169,214,181,110, 63, - 65,161,144, 36,172, 93,203,202, 11,176,102,205, 26,149,179, 2,176,106,213, 42,172, 91,183, 78,234, 78, 94, 66, 66, 2,141,141, -141, 37,114,121,160, 67,153,168, 43, 98,166, 0, 48,126,252,120, 86,238,127,199, 41,133, 22, 45,146,224,237,180, 1, 99,229,219, - 20, 0, 74, 41,197,144, 33, 67,164,169,169,169,181,222,119, 71,216,204,220,122,106,234, 17, 21, 33, 4,132, 16,244,235,215, 87, -186,118,237, 90,245,221,207,222, 81, 50,220,201,227, 77,208,130,145, 39, 27,222,185,134,126, 52, 97,245, 57,187, 60, 54,224, 98, - 0, 30, 30,184, 85, 0, 30, 68,139,159,193,164, 73,147,234,245,125, 30,143, 7, 62,223,250,233, 25,202, 67,255, 62,102,248,136, -196, 86, 5, 64, 40,196,224,112,192,199, 7, 16,242,125,208,178,165, 24,124,190, 14,102,179, 5, 22,139,231,110,123,189,230, 6, -196, 29,122,224, 82,242, 79,104, 37,224,225,112,254, 21,143, 7,148,121,243,230,169,215,174, 93, 43,173,207, 50, 64,102, 89,223, -235,175,191,110,191,198, 88,250,101,101,101,208,235,245,152, 62,125, 58, 0,224,235,175,191, 6, 0, 85, 99,180,109, 90, 90,154, -218,102,237,171, 0, 96,208,160, 65,245, 10,224,234,208,169, 59, 50,143,238, 65,235,150,126,240,243,179,118,251,234,106, 51,202, -202, 13,208,104, 43,209,177, 75, 47,252,184, 97,163,219, 54,249,253,247,189,228,197,231, 35,232,209,140,179,120,114, 72, 95,116, -234,212, 9, 70, 67, 21,250,247,123, 28,254, 1, 1,184,146,151,143,194,107, 37, 72, 77, 59, 15,109,121, 0,118,175,223,248,208, -250, 76,103,198,202,109,237, 79, 48, 83, 46,183, 47, 11,183, 56,145, 62,143, 71, 0,106,167, 12, 58, 83, 46, 71, 95, 23, 22, 44, - 33,160,112, 80,203, 99, 99, 99,225,236, 5,152, 59,119, 46, 8, 33,136,141,149,171,108,124,142,153,177,114,244,237,123,183,188, -216,216, 88,187, 59,222, 29,201,177, 37,127,103,140, 31, 63, 30, 35, 70,140,144,122,171, 4, 59,206,213,135,135,135, 75, 83, 83, - 83,213,181,221,103, 19,164,104, 91, 85, 64, 25,229, 43, 50, 50, 82, 42,151,199,170,157,149, 14, 7,249,240, 68, 94,226,252, 38, -214, 83,113,155, 59,158,142,249,249,118,133, 96,207,169,186,199, 62, 87,121, 0,184, 24,128,135, 84, 1, 24, 60,100,208, 61,153, -243,105, 40,203,223,177, 35,121, 3,141,150,160, 93, 27, 30, 8,225,129,240,120,216,187,223, 58,191,239,227, 35,134,143,200, 7, -227,158, 38, 16,251,136,224, 43, 38,208, 20,243,145,113,188, 41,204, 22, 51, 58,118,240,108, 94, 87, 38,147,209,107, 5,151,160, -205,220,133,110, 29,133, 56, 83,232,253,188,240,204,153, 51,213,168,103, 80,158, 76, 38,147,126,249,229,151, 42,198,205, 95, 92, - 92, 60, 49, 60, 60,188, 98,223,190,125, 59,159,123,238,185, 81,197,197,197,100,234,212,169,123,108,249, 2, 26,173,115,166,167, -167,171,195,195,195,165,204,113,125,100,253,184, 97, 35,153,250,202,100,154,125,225, 28,174,229, 93, 1,143, 71, 96, 54, 83,136, -125,131, 16,218,179, 55,118,255,145,204,186, 78,175,221,178, 72, 53,197,215, 84, 85, 85, 38,244,233, 29,130,224,246, 45,145,127, -245, 38,180,167,115,145,149,157,143,253, 7,254,194,149, 66,138, 99,153,103,188,106,167, 7, 37,249,143,101,115,160,215,207,245, -255,132,165,188,220,255, 97,205,154, 53,118, 5, 96,205,154, 53, 64,222,250,187,158,117, 37,143, 45, 40,165,164, 62,253, 56, 54, - 54,182, 94,125,207,129,228,213,222,220,119,229, 85,112,252,174, 43,121, 30,181,243,149, 45, 72, 90,243,178,117,108, 24,254, 72, - 13,242, 7, 0,217,152, 39,172, 7,218,147,110, 21, 0, 46, 15,192,131,131,117, 43, 23,222, 53, 13,224,145, 2,240,128, 7,124, -212,187,112,153, 39,124, 32, 22,137, 48,110, 12, 1,143, 16, 12, 26,104,194,233, 51,190,224, 17,235,156,127, 73, 9, 15,237,219, -242,193, 35, 34,156, 58, 45,130,216, 7, 48, 24, 13,184,146,239,235, 17,249,231,102,255,137,240, 17,207, 64,208, 50, 28,185,217, - 25, 16,220, 72, 66, 64,179, 32, 90, 90,166,105,148, 10, 86, 42,149,106,153, 76, 38, 29, 56,112,160, 42, 46, 46, 14,189,123,247, - 46,210,106,181, 24, 56,112,160, 84,171,213, 98,206,156, 57, 42, 27,249,171, 27,187,145,235, 75,252,206, 74, 0, 0, 68, 14, 29, - 36,105,215,182,157,202,223,223, 31, 63,110,216, 72,206,156,205,245,108, 64, 79,205, 80, 3, 32,102,180,164,231,178,210,209,174, - 77, 19,136,197, 66, 84, 84, 24, 80,120,189, 12, 68,208, 17,199, 50, 83,185,104, 41, 54, 56,241, 6,208,245,255, 80, 99,121,225, -241, 5,141, 90,164,216,216, 32,135,180,181, 13, 67,104,238, 72,217, 19,210,174,111, 62, 3, 87,227,188, 44,210,199,250, 91, 43, -175, 91, 63, 28, 30, 90,244,235,215,207, 30,240,183,110,229,194,187,238,185, 85, 0, 26, 58, 31,255,253,206,239,239,153, 22, 65, -160,213, 18,248,181, 37,104, 17, 68, 48,112,128, 17, 98, 17, 31, 62, 34, 35, 90, 4,137,109,131, 0, 65,196, 64, 51, 50, 78, 8, -173,222, 2,150,138,145, 76, 38,163,189,186, 55,195, 27,115, 63, 66,165,168, 3,126, 77, 46, 68,215,208, 65, 0,128, 38,199,118, - 32, 59, 31,180,162,188,241,148, 0, 0, 36, 47, 47, 79,178,114,229, 74,149,163,119, 0, 0,105, 76,203,255, 94,195,150,236,167, -222,245,126,240,208, 9, 50,245,149,201,244, 86,241, 45, 84,222,208, 67, 44,110,129, 14, 93, 30,103, 53,149,240,176,195,154, 14, -187,129,126,102,222,122,216, 87, 4,228,109,104,244,223,230, 46,184,239,239,134, 81,207, 76,108, 80,203,157,139, 1,120,176,148, -128,218,200,223,173, 7,224,159, 0, 10,107, 84, 63,225, 81, 80, 80, 4, 53,167, 72, 57, 44,128, 88, 36,132,143, 72,128,103,199, - 80, 80,106, 65, 96, 11, 19, 76,102, 2,139,197,108, 27,252,220,227,241,206, 21, 24,251,162, 12, 21,130,110,104,221,196, 31,147, - 95, 8,194,198,173,167,237, 74,128,209,252, 43, 78, 95,104,220,117,226,140, 34,224,112,206,189, 61, 94,120, 21,254,142, 32, 19, -180,132, 38, 6,222,205, 12,202, 32,175,228,173,211,174, 64, 76,224,194,187,111, 28, 95,208,232, 86,255, 63, 25,251,254, 50, 54, -100, 31, 38, 86, 5,145, 58, 40,139,220,180, 64, 99, 41, 1,110, 27,203,219,125,132, 57,112,224,192,129, 3, 7, 14, 15, 47,184, - 68,207, 28, 56,112,224,192,129, 3,167, 0,112,224,192,129, 3, 7, 14, 28, 56, 5,128, 3, 7, 14, 28, 56,112,224,192, 41, 0, - 28, 56,112,224,192,129, 3,135,191, 7,106,172, 2, 56,121,242,164,215,209,160,174,130, 9, 27, 90,222,148,233,177,110,191,167, -211,220,176, 31,251, 7,181,181, 31,255,252,125,194, 93,207,182,146,190,234, 86,222,190,213,119, 50,230,141,156,255,165,253,248, -150,234, 91,120, 83,190,218,224,109,249,106,131,171,242, 61, 63, 85,238,246,123,153,170,157,232,220,185, 51, 46, 95,190,140,129, -210,177,246,235,191,253,168,184,231,245,231,174,191,196, 7, 7, 75,222, 40, 44,116,204, 76, 72,238,103,255,115,150, 55,118,236, - 88,201,174, 93,187,106,100, 74, 28, 51,102,140,116,231,206,157,234,198,120, 63, 30,100,121,245,145,245,119,174,191,168,168,168, -151,250,244,233,179,241,244,233,211, 47,166,164,164,252,218, 0,229,163, 15,202,251,193,201,107, 92,121, 30, 43, 0,206,248,234, -171,175, 36, 85, 85, 85, 32,124, 33, 8, 33, 48,155,140, 16, 9, 5,152, 51,103,142,186,190,154,199, 87, 95,125, 37, 1,128,217, -179,103,215, 75,150, 78,115, 3,254, 65,109,237,196,223,182, 99,103, 0,192,141,171,151,189,146,183,111,245,235, 24, 57,255, 75, - 59,113,125,181, 45, 3, 0, 48,251,217, 65,127, 75, 13, 48, 83,181, 19, 3,165, 99,145,169,218,105, 37,181,241, 83, 0, 0,151, - 47, 55,126,253,133, 2,146,108, 64, 21, 10, 72,179, 1,213, 27,133,133,200,136,123, 27, 0, 48,104,229,167,141, 90,111, 47,189, -244, 18,221,180,105, 19,170,170,170,106, 92, 23,139,197,170,151, 94,122, 9,191,252,242,203,131,186, 60,112,104,247, 46,193, 27, -168,217,172,207,206,191,177, 8,192, 14,206, 14,170, 29,159,127,254,249,240, 63,255,252,179,217,181,107,215,218, 6, 5, 5, 53, - 15, 11, 11, 43,124,243,205, 55,127,244, 86, 94, 84, 84,212,136,201,147, 39,167,108,220,184,241, 85, 0, 1,147,254, 47,118, 58, - 0,203,233,211,167, 95, 86, 40, 20,191,201,229,114,139,135, 34,153,228,202,180, 1,198, 43,103, 18,105,168, 62, 76,239,129, 76, - 14, 13,237, 1,112,196,127,254, 27, 47, 9,232,216, 71, 21,213,167, 7,252,124,132,160,148,194,108,166, 56,147,115, 5,241,171, - 63,147,250,250, 8, 49,107,214, 44,175,200,251,231, 13,139, 36,189,186, 29, 84,157,201, 14,145,122, 91,112,134,240,125, 3, 90, - 64,167,185, 97, 39,254,186, 60, 2,108, 44,213, 65, 83, 22, 98,223,234,215,237, 47, 82,109,207,213,181,198,210,249,127,138, 68, - 34,235, 91, 64, 41, 44, 22,235,251,109, 54,155,237,229,231,241,133,172,173,104, 0,104,215,218,154,170,211, 80, 86,130,106,147, - 9, 0, 80, 97,178,202,235, 50,106, 6, 30,237,213,159, 21,241, 3, 64,223,193, 35,144,169,218,105, 39,254,218,158,187,159,245, -199, 12, 26,217, 0,158,242,247,199, 30,157, 78,197, 16, 63, 0,100,237,221, 87,215,160, 85, 39, 62,253,105,153,228,248,237, 99, - 40,204, 63,133,110,157, 34,240,191,185,191,120,220,135,199,142, 29,251,220,230,205,155, 25,242, 55, 1,168, 2,224, 7,192, 82, - 85, 85, 37,240,245,245,197,216,177, 99, 37,174, 60, 1,141,140, 54, 79,244,235,243,199,158, 95, 18,154,232, 10,207, 99,168,108, -230,198, 43, 90,227,203, 0,126,123,208, 6, 38,153, 76, 70,189,221,128,199,137, 24,189,194,151, 95,126, 41,201,200,200, 80,109, -216,112, 39, 49,209,237,219,183,145,157,157,141,103,158,121,230, 7,137, 68, 34,125,243,205, 55, 89,181,175, 66,161,224,109,220, -184,241, 67, 0,255,159,189, 47,143,111,162,234,222,127, 38, 73,211,116,223,217,247,150,202, 78,161, 8,200,154, 0,165, 66, 1, -101, 41, 90,208, 87, 68,104, 64, 69, 1, 81,180,175,223,159,190, 46, 8,138, 20,101, 13,139,226,171,101, 43,136, 82, 40, 20, 10, - 41,101,211, 74, 41,101,183,180,165,116,163,116, 79,151,236,153,249,253,145, 76, 76, 67,210, 76,210,176,190,243,124, 62,243,105, -231,206,228,100,114,231,222,251,156,115,238,185,231, 62, 55, 34,242, 69,183,157, 59,119,182,126,249,245, 5, 94, 0,116, 0,218, - 26,110,123, 6, 0,103,244,232,209,163,128,251,183, 58,183, 70,170,131,103,127,136,140,132,149,148,181,254,102, 71,255,160,210, -207,103,128,203,229, 65,167,211, 66, 86,223,128, 89,211, 95,160,234,235,235, 91, 74,216,148, 51,223, 11, 11,219,176,180,237,175, -137,167,192,182, 2,176,102,237, 58,161,112,226, 12,105,199, 86, 62,112, 23,240, 64,146, 36,116, 36,192,227, 18,240,247,233,129, -222,221, 59, 73, 83, 83, 14,139, 54,110,220, 40,180, 87, 9, 88,183,110,157,176,103,240, 89,105,255, 30,183,193,229,232,164,235, -214,175, 23, 45,122,251,109,187,100, 52, 86,151,193,205, 39, 0, 62,222, 94, 0, 96,252,107,233,190, 54, 29,187,216,244, 6, 28, -143,127, 27,131,103,127,136,215, 94,154, 6, 0,198,191,150,238,219,112, 48,195, 46,237,154,203,229,162, 67,135, 14,224,114,185, - 80,171,213,104,108,108,132, 78,167, 67, 77, 77,141, 67, 47,215,147,199,197, 15,107, 15,192,213, 7,184, 87, 0,252,213, 80,130, -138,178, 92,252, 28,255,145, 93, 86,127,255, 97, 99,209,161,157,126,138,164,131, 5,242,239,210,165,139,113, 58, 0, 0,138,139, -139,157, 82,127, 12,147,171, 82,145, 30, 30,248,252,237,183, 0, 0,159,155, 16,255, 47, 57, 57, 77, 7, 19, 59,178,181,206,250, -104,164,176,102,112,170,244,195, 78,175, 64, 69,142,131, 43, 73, 33,226, 5, 29,126,252,102,175,232,248, 6, 48, 29,204,121, 11, - 22, 44,248, 77,161, 80, 96,199,142, 29,202, 57,115,230, 8, 0,120, 2, 32,119,236,216,161,158, 51,103, 14, 79,161, 80, 64, 32, - 16, 72, 91, 58,208, 69, 70, 70, 10,143, 29, 59, 38, 53,108,216,210, 98,120,242, 57,255,111,221,231, 31,184,249, 94,223, 5,183, -191, 79,226,211, 49,126, 94,239, 36, 85,124, 86,175,166, 30, 43, 5,128,222,130,183,166, 38,130,242,247, 79,181,251,183, 15, 25, - 50, 68,248,231,159,127, 58, 76, 54,107,214,172, 17,238,219,183, 79, 90, 95, 95,111,241,250,221,187,119,177,111,223, 62,233,235, -175,191, 46,250,241,199, 31,211,108,180, 23, 98,231,206,157, 63,143,136,124,113,102, 78,214, 57, 94,135,118,109,180, 47,191,190, -160,201,184,123,242,240,175,232,219,183,111,143,157, 59,119, 78,232,219,183,239, 65, 0, 56,115,230, 76,179,253,131, 73,127,211, -247, 15, 2,176,145,136,103,192,128, 1,212,145,148,227,200,186,122,221, 88,166, 84,170,240,245,186, 45, 13, 11,231,196,176,132, -253, 20,227,190, 32,192,213,171, 87, 11, 71,140,159, 42,237,209, 41, 0,174, 46, 28,144, 36,137,178,178, 50, 92,201,206,130, 90, - 75,130, 36, 41, 4,248,184, 99,252,132, 73, 82,133, 74,107,247, 23,186,186,148, 35,184, 83, 25,192, 37,208,171,123, 17, 92,121, -247,236,182,252, 77,201,223, 28,178,186,122,148, 21, 21,192,205, 39,192,170, 87,160, 57,242, 50,199, 79,123,126,197, 91, 83, 6, - 99,240,236, 15,209,140,150,125, 31,248,124, 62,184, 92, 46,188,189,189,145,159,159,143,154,154, 26,189, 34,229, 32,249,183,109, -213, 26,158, 60, 46,166, 46,250, 2, 19,102, 13,195,161,171, 37, 40, 83,160,197,228,111,142,226,210, 50, 92,187,112, 22, 65,126, -222,122,242,231,113,157, 82,127,207, 79,127, 13, 0,224,199,115,177,139,252, 1,224,255,214,111,192,255,173,223, 96, 36,255,148, -198, 70,188, 63,126,146,254, 98, 16,159,209,239, 30, 22,215, 85, 56,255,189,231,164,175,119,126, 19, 46, 28, 79,120,192, 29, 28, -112,209,190,245,112,188,253,249, 82,233,242,164, 30,140,212,136,180,180, 52, 13, 0,252,244,211, 79,114, 0, 2,122, 27,229, 29, - 59,118,144, 0,220, 77,183, 85,142,137,137,113,104, 94, 46, 62, 62, 94,104, 79, 57, 3,140, 24, 52,160,191, 60,241,215, 3,226, - 1,125, 66,185,141,215, 79,160,160,188, 30,119,107,229, 32, 41,202,161, 64, 96,138,162,168,234,234,113,212,168, 81,163,156,154, - 72,204,132,252,225,239,159,234,144,140,140,140, 12, 41, 0,130, 32, 8, 12, 25, 50,196,238, 58, 75, 77, 77,189,143,252, 47, 92, -184,128, 89,179,102, 25,207, 53, 26, 13,110,222,188, 41,141,143,143,111,214,139,185,115,231,206,183, 71, 68,190, 56,233,203,184, - 37,188,196,196, 68,108, 91,183,154,103,240, 24, 25,201, 63, 49, 49, 17,235,215,175, 71,223,190,125, 15,218,234,111,230,228,111, -173,191, 77, 24,110,240, 2,122,121,216,148,247,237,186, 77, 70,242, 47,175,172, 66,121,101, 21,100,245, 13,112,113,225,121,110, -218,177, 75, 9,103,109,136,192,226,161, 34, 44, 44,236,190,163, 89, 5, 96,227,198,141, 84, 64,151,126,232,210,198, 23, 74,141, - 14, 4, 1,164,164, 28,197,127,127,218,129,203,217,217,120,127,233, 98,112,185, 28,144, 58, 18,222,238,174,232,210,111,132,116, -237,218,181,140, 59,216,250,245,235,133,189,187,223,145,122,123,202,241,195, 79,229,224, 16, 20, 6,247,253, 91,186,126,253,122, -187, 58,169, 37,242,167,137, 95, 33,171,106,162, 32,200,234,234,109,202,179,212,153,232,142,148,145,176,178, 9,193,253,180,231, - 87, 70,207, 24, 28, 28,140,128,128, 0,212,213,213,129,207,231,131,195,225, 64,161, 80,160,166,166, 6, 92,174,190,147,219,179, -217,210,254,223, 14, 96,241,218, 99, 56,176,238, 99,180,109,213, 26,238, 30,254, 40,210,149,224,231,248,143,224,105, 24, 52,184, - 12,229, 89, 34,127,154,248,101,165,121,232,209,161, 21,234,229, 74,184,186,187, 2, 58,157,205,120, 0, 91,245,247,209,214, 67, -184,118,241, 60,250,116,235, 5,153,206,182,210, 72,147,255,223,199,142,227,255,214,111, 48,150,167, 52, 54, 34,165,177, 17,249, -226,255,224,216,245,203,232, 61,184, 27, 80,101,123,107,230,209,203,186, 9, 23,190, 51, 86, 26,228,209, 19, 10,170, 30, 80,149, -131,175,170,134, 74, 87, 15, 37,169, 0,201,247, 68,251,145,131, 16,177,176, 51,101,203,154,163,231,253,197, 98,177,187, 88, 44, - 6,244, 83, 0, 16,139,197, 48,156, 27, 44, 40, 37,118,239,222,109,119,167, 93,178,100,137,112,233,210,165,210, 94,189,122, 81, - 4, 65, 72, 1,224,149, 87, 94,161, 58,119,238, 76,125,252,241,199, 14,109,205,236,229,202,217,177,225,195,215,221, 34,219,171, -184,231,110,150,225, 80, 1, 7, 31, 30,185,167,250, 79, 90,131,172, 81,131,215, 28,145, 89, 83, 19,241, 32, 45,127,248,251,167, - 98,246,236,217,118, 79, 17,154, 18, 62, 69, 81, 4,189,157, 52, 83,188,246,218,107,194,123,247,152, 25, 37,106,181, 26, 87,174, - 92, 57,217, 92,123, 1, 32,236,208,174, 13, 63, 58, 58, 26, 0,144,153,153,137,147,135,127, 21, 20,151,150,145, 52,249, 27,126, -187,177,191, 93,185,114, 37,190, 37,253,237,235, 57,147,112, 53,175, 8,109,186,181, 5, 26,229,140,127,123,121,101, 21, 52, 26, -173, 65,193,209, 66,163,209,162,232, 78,129,160,133,175,149,176,113,206,226, 17,162,137, 43, 74,165, 82, 97, 64,143, 30, 82,119, - 55, 23,144, 36, 5, 29, 9,156, 61,125, 6,255,249,252, 11,144, 20,112, 43, 55, 23,151,179, 47,161, 79,159,254,224,114, 9, 60, -211,173, 3,242, 47, 50,247, 2,240,121,229, 8,237, 82, 10,240, 8, 20,221,213, 0, 60, 2,253,122,220, 65,198,149,114,135,127, -128,169,123,223,146,103, 64, 33,171,106,178, 26,192, 22, 76,221,251,150, 52,237,140,132,149,136, 88,178,222, 98, 20,187, 41,180, - 90, 45,220,221,221,193,225,112,224,231,231, 7,185, 92,142,198, 70,253, 54,192, 65, 65, 65,168,170,170,178, 43, 71,182,178, 6, - 24,236,230,134,247,215,157, 70, 68,127,224, 78, 22,240,151,225,218,251,235, 78,227,251, 37, 34,232, 72,157,221,245,119,237,194, - 89,227,255, 99,195,123,128,231,197, 65, 74,218,117, 12,232,209, 17,222,158,174,248,105, 95, 42, 6,137,162, 80,108, 97, 21,128, -173,250, 59,120,157, 2,238, 2, 83,198, 18,216,122, 40, 31, 1,126, 93, 49,109, 56,193,168,254,104,119,127, 74,227, 63, 91, 39, - 83,159,198, 3,237,101, 32,230,127, 2,234, 63,159, 3, 28, 5,136,140, 21,244,160, 98,181, 50,131,167,123, 74, 59,251,134,163, - 78,215, 0, 85, 77, 46,126, 46,220,137, 51, 83,106,208,107,158, 8,227, 23,121,194,205,239, 25, 8,120,126,224, 77,145, 97,158, -118, 30,181,109,235, 54,139,131,148, 88, 44,166,104,165,141,195,225,128,162, 40,181, 65,137, 86,114, 56, 28, 57, 69, 81,254, 0, - 72,180, 96,121,109,124,124,124, 90,100,100,164,168,170,170, 74,154,146,146,162, 87,124, 82, 82,208,179,103, 79,244,232,209, 67, - 68,151,217,131,122, 21,249,206,220,255,251, 62,233,155,168, 54, 28, 74, 41,195,252,132, 28,141, 86,163, 89,175,210, 97, 5, 0, -135, 54,163,120,241, 69,245, 3, 39,255,132,132,132, 52, 71,172,127,211, 41, 19,130, 32, 48,120,240, 96, 33,211, 93, 37,117, 58, -157, 93, 10,195,237,219,183, 33,145, 72,136, 77,155, 54, 89,186, 44, 0,208, 11, 0,111, 76,212,180,218,252,252,124,223,204,204, - 76, 36, 38, 38, 34, 60, 63,159,147,153,153, 9, 0, 8, 15, 15,199,243,163, 7,193,219,211, 21,235,127, 60, 80, 62,107,214,172, -184, 77,155, 54, 45,177,183,191,221,253,109, 37,188,122, 11,224,217,125, 49,246,174,156,135,254,125,218,224,153, 73, 95,216,236, - 31,178,186,122, 8, 4,174, 0, 0, 23, 23, 30,228,114,165,179,121,134, 37,253, 71, 0, 38,155, 1, 53, 25,168, 72,146,132,187, - 43, 31,106, 45, 5,146, 2, 56, 4,240,201,103, 95, 64, 71, 2, 13, 13, 13, 40, 43,187,139,214,173,219,128,162, 72,104,181, 58, - 8, 92,120,224,186, 48,115,193,110,216,176, 65,216,189, 75,177, 52,208,175, 78,223, 28, 12, 7, 65, 80, 24,216,251,150,148, 94, - 21, 96, 15,104,235,158,118,247,155,147, 63, 19,235,223, 92,139,166,137,127,195,193,140,251,200,159,169,245, 15,232, 3,134, 92, - 93, 93,225,227,227, 99,116, 25,210,129,127, 62, 62, 62,104,211,166, 13,180, 90,230,202,211,143,169,167,224,211, 5, 16,134,234, -207,115,180,122,247, 63,160, 47,251,248, 11, 41,106,213,246, 77,201, 20,151,234,131, 21, 59,181,242,135,151,143, 7,120,222, 92, - 40, 43, 21, 0,135,131,182,157, 59,224,108,118,129, 67,245,247,218,123, 95, 98,212,208, 49,224,149, 1, 13,173, 1,119, 14, 7, - 67,187,116,133,120, 74,107, 70,114,204,231,250,127,121,105, 30,166,190, 56, 18, 8, 81, 2,151,121,128, 39, 15,152, 28,142, 14, -155,183, 50,243,198,180,247,135, 90, 93, 13, 66, 85,133,159, 11,119,226,252, 28, 31,140,154, 58, 7, 35, 90, 61, 47,186,122, 76, - 11, 45,217, 8, 23,117, 35,180, 61, 72, 84,220, 99, 22, 52,106, 80,222,148,115,230,204,225, 0,168,161, 12, 59, 68, 25,206, 91, -132,148,148,148,180,158, 61,123,138,220,221,221, 17, 24, 24, 8,119,119,119,164,167,167, 19, 41, 41, 41,105, 14,136,107, 51,105, -210,164,173, 27,182,252,192,249, 36,173,129,220,119, 46, 23, 42,181,166, 81,169,195, 50,123,200,223,220,229,159,158,158, 78,208, -199,227, 66,254,150,220,253,246,122, 1, 26, 26, 26,140,255, 95,184,112,193,120, 0,192,210,165, 75,155,156,155,220,239,106, 69, - 92, 59, 0, 93, 12, 74,161,251,243,211, 95, 81,154,122, 2,104,203,255,185,225,195, 77,251,219, 33,177, 88,172,180,167,191,197, - 78, 30,133,126,225, 61,224,213,223, 11, 37, 39, 10, 1,129, 43,166, 47,250, 23, 6,191,250, 61,163,223,172,213,234, 80,114,247, -158,150,182,252,105, 20,221, 41,104,233,171,165,172, 28, 44, 30, 3,133, 0,150, 44, 21,202, 48,184,145, 20,160, 35,245, 74, 0, - 65, 0,191,238,223,135,169,211,102, 32, 48,168,149,113, 0,164,236,120,151, 92, 78, 57,122,135, 20, 25,207,251,245,113, 55,234, -134, 3,123,229,131,203,177,223, 11, 96,238,238,183,116,221, 30,235,223,220,221,111,233,186,233, 90,246,230, 80, 87, 87,135,250, -250,122,168, 84, 42,144, 36,137,138,138, 10,163,251, 95, 46,151,163,161,161,193,174, 41,128, 3,235, 62, 70,218, 85, 64, 86, 0, -104, 20,192,247,203, 69, 70,247,255,197, 44,224,210,221,179,224,218, 89,127,178,210, 60,248,251,120, 32,192,223, 3,207,132,246, - 68,254,237, 10,228,148, 84,161, 83,128, 15, 84,247,202,145,123, 43,183, 73, 46, 0, 38,245, 55, 76,248, 2, 70,136, 98,112, 32, -105, 47,164,233,123,177,115,205,123,152,254,222, 10, 92,214, 0, 21, 85,229,140,234,207,116,174,255,245, 97, 67, 48,187, 87,103, -236, 61,112, 18,151, 47, 23, 96,205,149, 76,236,142,248, 23,176,253, 28, 74, 74, 42, 24, 89, 23, 29,148,174,208,169, 43,161, 86, -235, 35,171, 91,183,239,136, 30, 61,123,138,234,220,244,177, 24, 10, 82, 14,142,170, 17,110,141, 92,220,187,219,188, 2, 64,191, - 51,165, 82, 9,165, 82, 41, 0,160, 6,224,165, 84, 42,189,205,151, 4,182,192, 11, 32, 76, 79, 79,151,246,236,217, 19,175,188, -242,138,168,178,178, 18,211,166, 77,179,103,224, 28,193,231,243, 27, 60, 61, 61,181, 17, 17, 17,119,151, 47, 95,222, 46, 46, 46, - 46,255,175,172,203, 19,119, 95, 83,221,212,144,176,123, 63,214, 7,225,242,119, 38,249,155, 91,255,180,194, 66,191, 51,166,177, - 0, 46, 46,255,196,168,172, 89,179,198,120, 88, 58, 7,140, 43,124,172,189, 27,190,225,224, 0,224,201, 74,243, 44,186,211,233, -254,150,117, 49,235,246,172, 89,179, 98,237,233,111, 35,159,125, 6,227,134,135,226,203,207, 86,227,219,181,201,248,127,191,156, -196,130, 49,131, 80,246,123, 50,100, 53,117, 76,250, 7, 17, 61,229,121,104, 52,218, 44,141, 70,171, 53, 85, 0, 0, 96,197, 39, - 31,181,196,130,103, 45,255, 71, 8, 75,115,255,230, 74, 64, 19, 5,128,195,225, 64,214, 32, 7,151, 67, 64,171,213,129,164, 40, -104, 73,125, 16,105,246,165, 44,140, 25, 27,169,119,147, 81, 20,184, 28, 46,234,229,106,104,213, 42,219,214,255,198,141,194,174, -237,239, 74,131,252,101, 70, 45, 99,216, 96, 79, 67,140, 46, 1,130,160, 48,160,103,174,116,195,198,141,140,189, 0,180,117,223, - 92, 48,160, 67,214,107, 51,193, 53,246,192,207,207, 15, 21, 21, 21,112,117,117, 69,125,125, 61,130,130,130,140, 65,129, 74,165, - 18,181,181,181,118, 41, 0,177, 95,238,198,247,203, 69,240,233, 2,164, 93, 5,222, 89, 37,133, 39,143,139,105,239,126,133, 98, -178, 12, 9,107, 62, 0,151,195, 92, 30,109,253,135,135,135, 34,168, 91, 23,180, 10, 10, 4,159, 67, 64, 75, 80,168,104, 84,160, -166, 94,233, 80,253,125,187,242, 55,188,216,179, 43,188,189, 3,224, 30,212, 14,154,234, 26,100, 29,218,133,218,234, 66,135, 26, -241, 15, 43,223, 6,150,140, 3, 79,171, 70,151, 70,160,156, 91,135,239,239,254, 5,240,189, 25,203,184,152,244,135,168,146,163, - 64, 33, 95,142, 65, 33, 34,244,250,151, 39,242,253,210,164, 65, 65, 89,210,142, 67,243, 33,227,212, 67, 69, 41, 32,255,133,132, -192,211,139,137,229,111, 58,192,211,171, 0,248,206,234,184, 71,143, 30, 5, 0,204,158, 61, 91, 20, 31, 31,159, 54,117,234, 84, -163,197,200,132,252,131,130,130,142,108,221,186,213, 67, 34,145,112,151, 44, 89,130,197,139, 23, 83,231,206,157, 27, 10, 32, 69, -161, 69, 79, 0,127,218,251, 76, 98,177,159, 85,183,191,163, 1,129,206, 36,127,115,130, 55, 85, 88, 40,138, 34, 12,129,129,182, -251, 69,113,241, 57,250,255,157, 59,119, 26, 15,243, 50, 26,254,254,254, 16,139,197,214, 6,193, 98, 0,181, 0, 56,197,165,101, - 56,127,254,188,113,206, 63, 60, 60, 28,128,126,251,237, 61, 7,147, 81, 83,175,148, 3, 88, 33, 22,139,117,246,244,183,223, 15, -124,138,200,229,139, 48,113,226, 88, 4,186,114, 81, 79, 80, 72,201, 41,194,249,171, 37,118, 17,245,194, 57, 49,207,230,231,230, -242,138,238, 20,128, 62, 12,228, 15,214,106,127, 50,137,223,188,204, 18,154,196, 0,184,186,186,226,214,245,203,162, 46,237,252, -165,110, 46, 60,232,116, 36, 8,130, 0, 65, 0,177,226,183, 64, 81, 36,116,134,124, 0,114,165, 18, 55,114,242,193,231,219,140, -234,134, 86, 83,141, 1,189,110,155,142, 24,120,115,201,109,236,255,165,187,177,105, 13,234,147,135, 63,178,123,218,109,253, 91, - 34,126,133,172, 10, 0, 28,178,254, 45,117,180,140,132,149, 0,192,216,250, 7,244,235,252,219,180,105, 3,149, 74,133,123,247, -238, 65,167,211, 33, 48, 48, 16, 85, 85, 85, 8, 12, 12, 52,212, 43,115,194,174, 40,203,197,199, 95, 72, 33, 43, 0,190,121,111, - 36, 26,180, 58, 44, 93,149,136,239,150, 71,227,189, 53,135,192, 35, 8,216,193,255,144,149,230,161,109,160, 47, 92,224, 2, 29, - 8,220,189,125, 13,119,202,101, 8, 14,242,199,239, 23,207,225,198,117,216,109,253, 79,159,187, 20, 46,254, 0,135, 11,236, 72, -190,141,253, 27,223,199,220,149, 18, 44,157,220, 31,111,141,237,108, 87,253,165, 52, 54,226,219, 41, 51,129, 90, 1, 64,184, 0, -223,174,198,140,191, 78,227,216,216,133, 32,190, 90, 4,226,143, 15, 24, 91, 24,151,238, 6, 96,136, 66,134, 6, 55, 46,228, 2, - 1,130,167,187, 64, 69, 41, 32,227,184, 64,139, 80, 80, 58, 57, 52,149,119,113,118,157, 12,179,103, 5, 35, 77, 42,125,232,157, - 54, 54, 54,150, 2,128, 45, 91,182,208,174,126, 98,201, 18,253, 52,240, 47,191,252,194,244,205, 14,111,215,174,221,209,175,190, -250,202,227,214,173, 91,112,113,113,129,183,183, 55, 46, 95,190,172, 1, 80,209,146,231,107,110, 77,190, 35,222, 1,103,146,191, -185,245,175, 39,230,251,151, 15, 26,150, 7,166,217,120,174, 91,123,246,236, 25,198,116,122, 78, 32, 16,204,181,174, 52,137,235, - 71,143, 30,125, 27, 64,120, 78,214, 57,152,206,249,191, 57,119, 38,142,118,235,134,196,196, 68,100,102,102,226, 72,183,110,238, -179,102,205,250,241,212,169, 83,140,251,219, 75,227,134,192,135,244,131, 28, 46,216, 31,191, 8, 27, 15, 93,194,251,207,143,192, -156, 53, 59, 49, 99,197,207,246, 90,224,196,138, 79, 62,178,148, 8,136, 50, 81, 2, 88,139,254, 41, 67, 19, 15,192,155,111,190, - 73,212,222,205, 69, 94, 81, 21,120, 46, 92,104,117, 36, 52, 90, 29, 46, 94,204,196,127,255,251, 35,212, 58, 10, 26, 29, 74,253, -203,119, 0, 0, 32, 0, 73, 68, 65, 84, 9, 62,143,131,242,154, 6,148,220, 56, 47, 90,188,120,113,179, 29,106,227,198,141,194, -158,193,119,254,177,254, 13,237,106,255, 47,161,250,246,196,161, 0, 14, 5, 14,135,196,208,254, 55,164, 27, 25,120, 1, 44, 89, -255,166,171, 0, 60,252,219,216, 69,254,150,172,127,211,168,218,136, 37,235,237, 34, 47,253,160, 88,131,134,134, 6,184,184,184, - 24,173,127,146, 36,141,127,237, 85, 0,126,142,255, 8, 23, 75, 78,193,179,141, 62,232,207,139,199, 69, 69, 89, 46,188, 93, 93, - 80, 91, 93, 12, 46,135, 0,143,195,108,250,153,182,254, 59,250,123,225,122,254,109,104,213,106,184,242,248,104,104, 80,226,119, -233, 57, 12, 18, 69,217, 69,254,116,253,189,240,246,231, 72,248,254, 59,200, 73,160, 99,112, 7, 92,189,246, 7,150, 78,238,239, - 80,253, 1,192,210,224, 65, 72,186,117, 18,144,105, 1, 65, 32,142,103, 92, 7,241,213, 34,122, 96, 98, 92,121,167, 86,231,167, -157, 61,158, 1,168,235,209, 64,212,163,134,211, 0, 25, 79, 3,141,174, 14,174, 74, 57, 4,165,183,177, 59,238, 22,186,132,133, -194, 90, 0,160, 57,220,220,220, 76, 73, 0, 2,129,192,226, 53,166,216,186,117, 43,182,110,221,218,162,206,236,229,229,245, 78, -110,110,174,135,183,183, 55,220,220,220,224,239,239,143,138,138, 10, 16, 4, 33,119,230,160, 65, 91,252,209,209,209, 20,160, 15, - 8,180, 39, 40,208,217,228, 63,100,200, 16,161,173,128, 90,166,177, 0, 30, 30, 30,177, 60, 30, 47,207,188,124,205,154, 53, 77, - 44,127, 0,232,220,185, 51,198,141, 27,183,195,150,253, 83, 92, 90,214, 36,218,255,227,255, 91, 2, 87, 30, 31,173, 91,183, 6, - 29, 19, 96,184,238, 97, 79,127,155, 39,236,135,197,171,191, 67,253,189,114, 4,121,183,194,181,235,133,152,179,102,167,221,253, -195,140,240, 9,179,207,155,202, 97, 61, 1, 79, 0, 46, 93,186,212,108, 50, 32,171, 30, 0, 0, 88,182,108, 89,218, 55,171, 9, - 17, 69, 77,145,118,105, 23, 0, 47,119, 87,244,234, 19,134, 94,189,251,131,199, 1, 26, 20, 58, 20,222,173, 70, 70,218, 97,145, -167,135,187,205, 47,104,148,203, 17,218,249, 46,148, 42,129, 33,107,139,190, 25,185, 9,148,160, 40,160,186,214, 21, 32, 0, 47, - 15, 45,250,134, 22,224,244, 5,219, 89,236, 76,173,127, 83,139,223,205, 39, 0, 46,148, 6,208,254, 51,222,233,120,182,159,209, -212,250, 55,181,248,233,178,220,107, 89,198,123,153,100,217, 51, 85, 2, 0,160, 77, 27,189, 50, 82, 93, 93, 13,111,111,111,163, -251,223, 30, 5,128, 86, 2,128,175,176, 48,122, 52,240,253,105,108,252,119, 20,102,188,247, 29,118,174,124, 11, 60,130, 0,223, -149,217,138, 29,218,250,191, 94, 88,142,144,142,129,216,190,109, 55,186,116,233, 2,159,118,193,232,223, 46, 24, 26,213, 63,238, -127, 23, 6, 50,105,235,255,139,185, 99,241,206, 39, 59,208,177, 27,209,162,250,163,173,255,241, 7,126,192,177,217, 49, 32, 58, - 12, 5,160,207, 10, 8, 0,183, 27, 27,141, 74, 98, 14,152, 37,240,217, 48, 39,143, 24,189,140, 18, 6, 79,171,151,118,233,222, - 7,117,110,192,109,220, 65,125, 65, 5, 42, 86,232,208, 80,211, 1, 55,207,230, 48,126, 33, 36, 73, 18,110,110,110,148, 66,161, -128,137,229, 73,185,185,185,129, 36, 73,226, 81, 12,150,245,245,245,223,188,245,214, 91, 83,182,110,221, 42,240,241,241,129, 84, - 42,197,218,181,107,235,212,106,245,243,206,252, 30,218,226,167,151,203,217, 27, 8,152,152,152, 72, 24,146,252,180,152,252, 1, -192,132,216,109,214,185,173, 12,131, 98,177, 88, 45,145, 72,134,238,221,187,247,114, 99, 99, 99, 91,141, 70,191,204,212,156,252, -123,245,234,133,161, 67,135, 78, 18,139,197,182,190,147, 39, 43,205,195,151,159,126,140, 95,147,142, 32,114,196, 64,156, 72,253, - 67,111,192,180, 11,134, 79,187, 96,132,231,231,227,249,233,175, 84, 22, 86,201,199, 3,216,199,212,250, 95,188, 37, 9,113,111, -140, 71,187, 54, 66,163,114, 97, 94, 15, 45,204,166,200,122, 2,158, 34,165,128,145, 2, 0, 0,239, 47,123, 47,237,155,111, 72, -209,237, 14,207,160, 91,247,158, 82,111, 15, 55,144, 20,160, 80,169,145,159,159,143,138,252, 75, 34, 47, 79, 15, 44, 92,184,208, -102,199,117, 19, 8,176,247,232,104, 17, 29, 1,223,172, 59,130,195,129,135, 7,115,235,137, 94, 2,232,225,223, 6,164, 78,163, - 39,127, 3, 52,132,139,205, 20,187,230,160,151,212, 68, 44, 89,223,132,180, 28, 33,127, 83, 37,192, 52,241, 79,117,117,181,237, - 23, 96, 67, 9,248,217,100,149,240,214, 21,111,254,115,162,105,128, 39, 67, 57, 29,253,189,176,247,194, 37, 92,189,249, 55, 6, -137,162,154,144,190, 61,228, 79,227,133,183, 63,199,254,129, 30,120,123,106, 15,167,212,223,210,224, 65,120,239,224, 94, 16, 95, -126,130, 35,173,135, 96,109,195,213, 38,215,167,249,248, 98,165,172,214, 46,226, 56,181, 58, 63,205,143, 23,129,226,154, 60, 84, - 84,221,197,189, 28, 79,112,117,222, 24,222,111, 36,118,159,221,253, 72, 7, 53, 39,101,251,187,240,227,143, 63, 70, 16, 4,113, -252,187,239,190, 19,188,248,226,139,117,114,185,124, 60, 28,152,243,111, 14,206, 88, 2, 40, 22,251, 57,133,252, 45, 88,169,182, -148, 15, 6,207, 38,174,148, 72, 36,193,245,245,245, 95,102,102,102, 46, 41, 41, 41, 65, 99, 99, 35,248,124, 62,218,182,109,139, -160,160,160, 23, 37, 18,201,239, 63,255,204,104, 75,128, 27, 0,194, 59,250,123,225,185,231,158,195,165, 91, 37, 8,236,218,187, - 73,127,123,126,250, 43,114, 0,235,190,140, 91,178,143,233,239,152, 39,236,135,136,212, 63, 49,251,147,255, 98,212,168, 81,104, -221,186,181, 69, 69,203,137,175,157,112,128,252,169,102,202, 89, 37,226, 17,144, 62,163, 84,192, 0,240,254,251,239,167,109,216, -176, 65,120, 49, 45, 71, 4,232, 35,105, 41,138,130,171,171, 43, 62,120,127, 25,227, 78,251,182,157,105,126,153,130,118,245,115, -181,114, 64, 43, 55, 70,192,211,196,111,239, 90, 44,218,213,159,123, 45, 11,185,215,178, 16, 20, 20,132,138,138, 10,135,136,223, - 39,168, 29,212, 12,130, 35,153, 98,246,231, 63,227,220,105,231, 85, 99, 65, 65,129,113,183, 63,141, 74,121, 31,249,219, 67,252, - 52,254, 53,208,195,105,245, 7, 0, 68,252, 7, 70,226,167,201,255,118, 99,163,104,154,143, 47, 82,128,180,149,178, 90,135,126, -251,111, 43,143,155, 12, 60, 10, 0,192,238,107,204, 19,246, 80, 20, 69,184,186,186, 26,189, 0,244,255, 0,224,234,234, 74, 88, -250,255, 33,227,204, 15, 63,252, 48,106,223,190,125, 75,235,234,234,226, 1,100, 56,251, 11,156,177,244,207,201,228,228,116,136, -197, 98, 5,128,165,134,163, 69,239,227,202,149, 43,195, 1,116, 13,236,218, 91,174, 81, 41,221, 13,253,173, 14,128, 12,192,141, - 78, 1,238, 47,137,197, 98,187, 26,116,196,199, 91, 31, 22,241, 59,164,104, 57,120, 63, 11, 39, 32, 44, 44,140, 17,249,219, 52, - 64, 91,186, 83,223,131, 0, 61,183, 79, 19, 63, 90, 72,252,244,220,180,172,188, 24,178,242, 98, 4, 5, 5,181,200,226, 7, 0, -173,142,180,219,251,208, 28,202,171,101, 14, 63,139, 57,232,185,125,103, 17,255, 3,168, 63, 2, 0, 34, 61, 60, 40, 83,171,127, - 0,207,165, 69,196,255, 63,134,191,234,234,234, 98,216,106,120,244, 56,117,234,148, 68, 34,145,252,183,176, 74, 46,215,168,148, -166,243,145,222,157, 2,220,253, 28,216,253,143, 0,244, 83, 25, 79,154, 82,197,226,225, 42, 1,140, 26,147,163,251, 8,179, 96, -193,130, 5, 11, 22, 44,158, 92,112,216, 42, 96,193,130, 5, 11, 22, 44, 88, 5,128, 5, 11, 22, 44, 88,176, 96,193, 42, 0, 44, - 88,176, 96,193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88, 60, 21,104,178, 10,224,210,165, 75, 14, 71,145, 90, 10, 38, -100,229,177,242,156, 37,207,176,183, 58, 7, 0,105, 41,249, 10, 91,127,214,229,133,133,133,209,117, 71,175,229,166, 46, 93,186, - 68,178,245,199,202, 99,229, 61,189,242,236, 86, 0,158, 18,180, 40,201, 68,116,116,180, 16,128,105,202, 80, 81, 98, 98, 98, 26, -171, 43, 62, 26,124,253,245,215,175, 94,185,114,165,255,249,243,231,223,115,117,117,133, 92, 46,255, 64, 34,145,172,102,144,129, -141,197, 63, 3, 11, 5, 64,199,214,196,227,141,168,168, 40,225,225,195,135,211, 28,252,172, 40, 57, 57,249,164,147, 18, 74, 33, - 42, 42,234,165,228,228,228,221,155, 55,111,246, 7, 80, 15, 64,199,246,185,167, 15, 79,213, 20,128,129,188, 91,244,249,189,123, -247,154,231, 11,151,182, 68,110,116,116,180,208,176,102,151,138,142,142,166,236,149, 69,217, 9, 75,235,131, 91, 40, 79,248, 40, -222,165, 68, 34, 33, 22, 45, 90,180,250,218,181,107,223,119,238,220,249, 61,129, 64, 0,149, 74, 5, 0, 95,239,223,191,159,156, - 58,117,170,232, 17,117, 25,202,254,227, 97,202,179,186, 7,187,233, 94,236, 14,237,207, 30, 29, 29, 45,164, 40,138,162,254,159, -101,217,244, 53, 91,109,208, 18, 10, 10, 10,168,130,130, 2,167, 17, 76,117,245,184, 38,251, 21, 56,155,168, 9,130,176, 75, 46, - 73, 82,148, 78, 71, 81, 36,105,249,136,138,138, 18, 38, 39, 39, 59,180, 11,213,150, 45, 91,198, 28, 57,114,228,228,232,209,163, - 65, 16, 4,181,107,215,174,113,246, 62,155,249,113,228,200,145,221, 47, 15,227, 67,188, 64, 92,157,231,153,191,111,254,252, 88, -146,190,102, 75, 94, 99, 99, 35,213,216,216,216,108, 59,164,239,121, 16,239,135,133, 85, 67,224,190, 4, 65, 60, 27, 29,222, 98, -222,108, 91,249,180, 31, 33, 90,180,141,219,222,189,123,165, 51,103,206, 4,160, 79,170, 97,210, 56,165,142,120, 21,104,133,130, -206,249,111, 72, 67, 42,141,142,142,182,207,171,144,232,111,199,183,218,238,251,141,147,223,100, 46,206,254,125,109,172,117,104, -198,245, 39,145, 72, 8,153, 76,182,167, 79,159, 62,211, 1,112, 40,138,130,155,155, 27,202,203,203, 81, 91, 91, 11, 31, 31, 31, -148,151,151,159,156, 58,117,170,232,192,129, 3,105,118,190, 19,138, 78, 7, 75, 16, 4,166, 79,159,142,113,227,198,137, 22, 44, - 88,192, 88,206,193,131,191, 25,255,159, 50,229, 69,155,231,182,160, 56,247,246, 63,213, 61,108,125,147,115,243, 50,183, 97,182, - 55, 85,162,183, 19, 54, 69,122,122, 58, 86,172, 88,113,223,187, 24, 57,114, 36,117,250,244,105, 70,109, 57, 49, 49, 81,138, 79, - 8,250,252,254,196, 51,159, 16, 45, 30,204, 31,227,177,165,137,165, 45,145, 72, 68,177,177,177, 24, 53,106, 20,117,230,204, 25, - 70,159, 61,103, 37, 39,227,129,196,247,144,156,156, 44,165, 55, 9, 27, 53,106, 20, 85, 87, 87,215, 28,225, 11, 99, 99, 99,141, -237,245,247,223,127,119, 39, 8, 2, 49, 49, 49,247, 0,180,158, 53,107,214,113,137, 68,194,177,199, 98, 95,125,124,181,241,255, -178,148,187, 32, 8, 2, 59,223,117, 7, 64,224,155, 87,190,126, 33, 48, 48, 16, 0,176,235,167,157,140,235, 42, 60, 60, 28,221, -186,117, 99,153,247, 49, 33,127,123, 61, 0, 84, 98, 98, 34,194,195,195, 41, 43, 3, 40,229, 64,231,118,170, 53,105, 46, 47, 49, - 49,209,116, 67, 12,187, 65, 16, 4,145,152,152, 72,208, 3,144,225,175,195,150, 38, 77,254,134,103, 34, 76,158,205,110, 69,133, -152, 89, 99, 60,152,148,219,130,231,161, 77,198,131, 73,185, 61,228, 79, 81, 20,232,221,217, 40,202,190,102, 34,145, 72, 56, 53, - 53, 53,255,245,241,241,153, 14,128, 51,119,238, 92,204,158, 61, 27,124, 62, 31,110,110,110, 16, 8, 4, 32, 8, 2, 92, 46, 23, - 50,153,140,113, 61, 70, 68, 68, 8, 1, 80,251,246,237, 3,253, 78, 40,138,194,254,253,251,177, 96,193, 2,169,225,250, 99, 7, - 75, 10,193,163,240,172, 37, 38, 38, 74, 1, 16, 47,221,156,137,153, 55, 44,246, 49,106,230,141,104, 17,241,153, 67,253,142,122, -255,253,247,209,181,107, 87,167, 60, 47, 65, 16,148, 88,236,135,128,128, 19, 78,173,135, 9, 19, 38,140, 77, 77, 77, 61, 73, 81, - 20, 17, 27, 27,155,102, 15,249, 91,195,129,196,247, 16, 31, 31, 15,146, 36,241,222,123,239, 49, 82, 40, 76,201, 31, 0,142, 28, - 57,146, 52,106,212, 40, 0,240,139,137,137,209,142, 30, 61, 26, 98,177,152, 52,196,205, 48,241, 50, 54, 57, 95,187,118, 45, 94, -122, 78,111, 27,238,124,215, 13, 47, 15,227,227,131,200,247, 25,255, 38, 15, 15, 15,140, 26, 53, 10,153,153,153,198,241,212,252, -160,239, 97,179, 23, 62, 58,242,111, 86, 1,160,201, 42, 51, 51,211,152,118,210,212,122,178,151,104, 77, 6, 17,103, 15, 74,230, -202,128, 83, 93,195, 22,166, 4,236,134,169, 66, 97,176,254,159,198,118, 70,153, 14, 38, 37, 37, 37,198, 11,197,197,197,140, 21, - 70,153, 76,246,149, 92, 46,127,133,195,225,112,102,205,154, 5,153, 76,134,210,210, 82,184,184,184,128,199,227,129,199,227,193, -197,197, 5,110,110,110, 80, 40, 20, 96,226, 66,220,188,121,179,240,248,241,227, 82,130, 32, 48, 99,198, 12, 80, 20, 69, 43,121, -196,140, 25, 51, 0, 0,169,169,169, 82,118,168,104,158,252, 13,239, 87,100,170, 36,211,239,222,212,171,229,200,160,158,152,152, - 72, 24,222, 11, 54,111,222,236, 20,101,236,163,143, 62,162,141,130, 22,123, 38, 34, 35, 35, 35, 46, 92,184,144,218,165, 75, 23, -132,132,132, 80,195,135, 15, 55,122, 78, 12,187, 63, 58, 68,254,107,214,172, 1, 65, 16,224,112, 56,184,112,225, 2,152,120, 99, -204, 60, 18, 47, 16, 4,129,151, 95,126, 89,107, 40, 82,199,196,196,212, 9,133, 66, 44, 88,176,128,156, 56,113,162,205,223,110, -186, 43,105, 89,202, 93,128, 0, 18,222,249, 39,107,241,206,119,221, 17, 51,220, 21,203,159,255,128,241,115, 49,177,252, 89,239, -192,195, 35,255,216,229, 43, 45, 94,231, 53,215, 33,195,195,195,169,204,204, 76,208,158, 0,154,184,194,195,195,237,234,228, 15, -154,252, 77,173,234,199, 61, 96,207,116, 74,224,169,211, 0, 40, 10, 37, 37, 37, 40, 43, 43, 51,150,153,159,219,176,254,185, 71, -143, 30,157, 24, 26, 26, 10, 46,151,139,220,220, 92, 80, 20,133,191,255,254, 27,106,181, 26, 4, 65,128,199,227,129, 32, 8,232, -116, 58,200,229,114, 28, 56,112,192,166,220, 19, 39, 78, 72, 1, 96,198,140, 25,247,181, 91,122,170,135, 38, 10, 38,237,218,220, -173,111,235,156,137,149, 79,195,218,116, 0, 19,215,191, 57,210,211,211, 97,176, 12, 91,166, 0,127, 66,128,248, 76,175,192,153, - 42,175, 20, 69, 1,159, 16,152,121, 35,218,225, 64, 89,130, 32, 40,195,123, 49,146,145,225,125, 17, 45,145,215,189,123,247,251, -200,205, 81,184,186,186, 82,215,174, 93, 67, 69, 69, 5, 81, 81, 81,129,176,176, 48,170,160,160, 0, 92, 46, 23, 90,173,214,161, - 47, 24, 61,156, 75, 43, 15, 88,182,108, 25,214,174, 93,139,211,167, 79,131, 32, 8, 76,158, 50, 31,119, 10,152,109,224,120,228, -200,145,223, 12,239, 88, 9,128, 52, 28,136,137,137,169, 5,224,155,156,156,140,168,168, 40,161,169, 66,222, 28,244,214,255,253, -251,152,232,167, 3,128, 93, 59,179,236,146,199,226,241, 37,255,102, 61, 0, 6,235,159, 48,245, 4,208,150,127,102,102,102, 75, -200,223, 86,128,146, 67,242, 76, 60, 19, 66, 56, 16,224,244, 0, 44, 39,202,100,240, 49, 62, 15, 93,230,172,224, 23,106,175,159, -241,112, 6, 26, 38, 45, 52, 30,118, 88,254, 20, 61,216,118,232,208, 1,131, 6, 13,194,160, 65,131, 0,192,120,110,126,175, 21, -248,250,251,251,247, 81,169, 84,168,174,174,198,185,115,231,144,145,145,129,138,138, 10, 40, 20, 10,208,115,164, 20, 69, 65,163, -209, 64,165, 82, 49,154, 98,160,219,134, 53,114, 79, 76, 76, 36, 8,130, 0, 83,207,204,193,131,191, 25, 15, 38,231,182,160, 56, -247,118, 19,162,167, 15,211,115,211,123,152, 98,212,168, 81, 72, 79, 79,111, 89,131, 48,153,243,135,126, 26, 75,100, 32,103,130, -190,134, 22,198,222,152,190, 23,218, 11,224, 44, 56,195, 11,208,190,125,123, 20, 23, 23, 19,230,202,174,163,228,127, 32,241, 61, - 99, 27,166, 49, 98,196, 8, 0,192,169,179,204, 23,107, 68, 69, 69, 69, 26,230,254,175, 3,144, 27,198,115,250, 48,106,221, 76, -131, 11,155,206,253, 91, 80,174,236,148,199,226,241, 7,143, 73,231,164, 61, 1,246, 90,254,203,151, 47,167, 86,173, 90,229,180, -135,181, 37,207, 48, 72, 57,173,113, 50,157, 67,107,142,116, 76,100, 53,136,197, 98, 79,107,215, 29,133,233,220,191, 51,148, 0, -211,185,127,166, 74,192,236,217,179,225,225,225, 1, 79, 79, 79,120,121,121,193,199,199,135,244,243,243,227, 36, 39, 39,227,213, - 87, 95, 53,222, 39, 16, 8, 48,126,252,120, 52,163, 4, 4,168,213,106, 84, 87, 87, 67,169, 84,194,199,199, 7,174,174,174,208, -106,181,160, 40, 10, 58,157, 14,106,181, 26, 26,141, 6, 58,157,206,174,248, 2, 67,208,154,213,235,166, 86,232,163,132,173,128, - 64,123,209, 82, 37,128,248,204,250,116,223,204, 27,209, 6,114,117, 80,182,153,245,111, 82,142, 25, 51,102,216, 29, 12,104,110, -253,155,202,115, 20,225,225,225,148, 78,167, 67, 88, 88, 24,117,233,210, 37, 34, 44, 44,140,210,104, 52,144,201,100, 14,203,164, -141, 41, 30,143,135, 37, 75,150,224,194,133, 11,248,103,222,159,121,155, 62,122,244,232,209,145, 35, 71, 2,128,151,129,244,229, - 0,176,123,247,238, 86,167, 78,157,242, 54,244, 15,194,240,215,166,224,181,223,173,197,203, 67,239,183,254,103,127, 47,199,238, -115, 26, 80, 20,133, 1,179, 6, 32,107,103, 22,241, 40,141, 43, 22,206,177,254,109,122, 0,104, 75,149,110,176,166,241, 0, 76, -176,106,213, 42,218, 98,112, 10, 24,200,115,120,126,221,176, 68,175,201,145,154,154, 74,210,171, 2, 90,106,177,199,198,198,122, - 62,205, 13,110,203,150, 45, 88,179,102, 77,147,118, 69,147,255,148, 41, 83, 48,101,202, 20,189,133,115,234, 84,115, 98,252,243, -243,243,149, 58,157, 14, 53, 53, 53,168,172,172, 68, 77, 77, 13,228,114, 57,228,114, 57, 26, 26, 26, 80, 87, 87, 7,153, 76, 6, -133, 66, 1,149, 74, 5,157,206,182,197, 68, 16, 4,246,237,219,103,151,194,246, 36, 35, 61, 61,189,201, 97,138, 37, 75,150, 8, - 77,207,153,204, 57, 91,152,243,111, 98,185,183, 36,144,203,210,103, 41,138, 34,246,237,219,231,212, 88,128,125,251,246,217,221, -135, 7, 14, 28, 72,233,116, 58, 99,130,150,176,176, 48,138, 36, 73,220,187,119, 15,141,141,141, 14,253,230,127, 47, 31,141, 83, -167, 78,129,220,227, 11,138,162, 16, 31, 31,111,124, 71,233,231, 72, 48,157,249,136,138,138,122, 17, 0, 98, 98, 98, 74, 12, 10, -128,106,215,174,132, 86, 11, 23, 46,108,117,234,212, 41, 76,152, 48, 33,194,158,156, 0,101, 41,119, 65,128, 64,130,137,245, 63, -235, 59, 57,184, 47,203,176,235,156, 26,139, 23, 47,198,170,163, 95,179,204,250, 20,145,191, 77, 15,128,249,188,191,105, 60, 0, -211,105,128,196,196,196, 52, 67,128,144,212,204,147,228,232,128,113,159, 60,122, 90,192, 48, 15,233,148, 9,246,113,227,198, 93, - 77, 77, 77,237,243, 56,190, 96,218,234,119,150,219,159,182,250,237,112,251, 55, 65, 66, 66,130,241,255,255,252,231, 63,248,241, -199, 31, 1, 64, 13,128, 79, 19, 63, 0,140, 31, 63,222,150, 2,160, 8, 13, 13,133, 92, 46,135, 90,173, 70, 69, 69, 5, 92, 93, - 93,193,227,241,140, 30,128,198,198, 70,200,229,114,168, 84, 42,200,100, 50, 76,159, 62, 93,180,127,255,254,102,159,143,182, 50, -109, 44,107,197,140, 25, 51,108, 42, 10,122,133,230,193,197, 0, 56,114,221, 28, 38,203,253,238, 67,124,124,188,116,201,146, 37, -162,248,248,248,180, 71,218,134,173, 88,255,166,176, 39, 22,192,154,245,239, 40, 6, 14, 28, 72, 93,188,120,145, 8, 11, 11,251, -148,110,218, 58,157,238, 19, 15, 15, 15, 84, 86, 86, 58, 52,198,124,252,225,104,164,165,165,129,216, 23, 0, 0, 56,246,177, 23, -198,127, 81,143, 81,163, 70,225,203, 85,167, 64, 81, 20, 99,111,197,145, 35, 71, 14,140, 30, 61, 26, 0, 42,118,239,222,217,254, -212,169,211,190, 20, 65, 97,226,132,137, 83, 14, 31, 62,156,116,248,240, 97, 70,114,104, 47,231,218,181,107,241,242, 48,151,166, - 22, 63, 40, 44, 89,188, 4,173,199,183,193,211, 26,183,244, 84, 27,101,171, 62,180,170, 32,132,133,133, 53,175, 0,152, 70,252, - 27,200,223, 24, 44, 69,123, 2,152,106,254, 22, 72,187, 69,176, 32,207,233,115, 82,177,177,177,125, 82, 83, 83,157, 57,224, 61, -173,237,140,128, 62, 10,220,104, 73,191,254,250,235, 0,192, 55,105, 75,198,107,134, 65,203, 26,174, 13, 29, 58,244,213,180,180, -180, 68,157, 78,135,186,186, 58,104, 52, 26,227,188,191, 82,169, 52, 46, 49,164, 3, 3,247,239,223,159,198,160,189, 16, 48, 44, - 1, 52,111,183,209,209,209, 20, 77,250,227,198,141, 19, 49, 81, 0, 30, 84, 30, 0,211,185,127, 83,242, 55,159, 22, 96,240, 62, -154, 3, 21, 31, 31, 47,125,233,165,151,176,103,207, 30, 71,189,101, 66, 83,207, 9,125, 78, 7, 12,206,188, 17, 77,221,186,117, -203,234,231,233,132, 63, 71,143, 30,181,234,177,187,125,251, 54, 99,207, 76,117,245, 56, 10, 0, 34, 34,242,145,159,159,111, 49, -186,188,170,106, 44,128, 26, 0,182,199,173, 94,189,122, 81, 23, 47, 94, 36, 12,131,229,167, 0,192,225,112, 62,185,115,231, 14, -106,106,106, 28,234,200, 28, 14,161, 87,216,105,242,191,172,197,143, 82, 53, 0,224,203, 85,167,236, 30, 35,232, 62,177,112,225, -194, 48,138,162, 16, 53, 41,106,250,161,164, 67,191, 50, 37,126, 83, 81, 47, 78,125,225, 58, 65, 16,189, 40, 10,224,190, 44, 3, - 69, 81, 88,178,116, 9,218,140,111,219,194,188,170,250,101,189,116,187, 99, 51, 9, 62,126,104,110, 21,128,113,240, 54, 91,198, - 70, 37, 38, 38,218,237, 50, 53, 33,109,167, 60,184,169, 60,122,253,255, 83,186,188,238,137,128, 89,221, 55, 89, 34,102,229,218, -125,131,129, 88, 44,214, 74, 36,146,253,163, 71,143, 94,148,156,156,188, 78,171,213,162,182,182,214, 24, 3, 0, 0, 21, 21, 21, -168,173,173, 5, 69, 81,176,167, 61, 69, 68, 68,136,142, 31, 63, 46, 77, 76, 76,108, 98,125,210,159,143,136,136,176, 43, 25,208, -131,128,226,220,219,142, 16,254,125, 4,111, 99,200, 38, 8,130,160, 28, 33,127,131,167, 45,205, 82, 95, 4, 0,147,160, 64, 70, - 88,176, 96,129,148,193,119, 50, 54, 52, 76,167, 42,239, 39, 34,102,201,241,186,118,237, 74, 93,191,126,157,118,249,127, 10,224, - 19,149, 74,133,188,188, 60,200,100, 50, 71,169,144, 34,247,248,225,216,101,253, 74,189, 29, 82, 53,118,159, 83,131,162, 40,156, - 62,239, 56, 39,166,167,167, 99,194,132, 9,162,195,135, 15,167, 29, 74, 58,228,168, 24, 14, 73,146, 46, 0,176,231,188, 6,139, - 23, 47, 70,155,200,182,204,213, 73, 11,104,108,108, 4, 0,228,231,231, 83, 91,182,108, 49, 42,100,166,177, 36, 59,118,236, 48, - 29, 31, 88,247,130, 19, 65, 91,247,150, 44,127,243,235,205, 77, 1, 16,134, 41,128,251,150, 77,217, 51, 5, 96,113,160,112, 30, -233,152,202,115,234,250,127,122,238,223, 81,216, 82, 72,236, 85, 88,172,185,251, 29,157, 6,176,230,238,119,112, 26,192, 52, 40, -136,176,227, 26, 44, 40, 1, 20,128,245, 18,137,100,115, 66, 66,130,134,207,231, 67,165, 82, 65,171,213,130, 36, 73,248,250,250, -162,166,166, 6,246,102, 83, 60,126,252,120, 26,244,235,254,169,125,251,246,193,160, 8, 24,151, 6, 30, 63,126,252,127, 98,112, -120,233,165,151,168,198,198, 70, 28, 58,116,200,222,246, 44,180, 81,223,212,204, 27,209, 34, 38,222,184,247,223,127,255, 62,227, -194, 28, 31,124,240, 1,197, 52,200, 83, 44,246,179, 41, 79, 44,246, 99, 36,204,205,205,141, 30, 36, 41,138,162, 32,151,203, 81, - 90, 90,234,240,156,191, 41, 34,191,168,111,114,222, 18,242,215,233,116, 4, 0, 56, 96,241,155,131, 60,248,123, 82,119,211, 76, -128,206, 66,115, 10,153,137, 2,192,226,113,244, 0, 24, 94, 28, 97, 79,249, 35,182, 64,211, 30,179,231, 33,236,176,152,109, 40, - 34,227,156,246, 92, 51,103,206, 20, 57,144,222,183, 89, 11,205,130, 5,218,156,117,202, 40,104, 76, 44, 22,107, 1, 16,211,167, - 79, 23, 22, 22, 22, 74, 21, 10, 5,116, 58, 29,122,245,234, 37, 26, 52,104,144,195,239,123,223,190,125,166, 75,206, 28,242, 26, - 61,232, 24, 0, 91,231, 76,244, 69, 67,116,120, 83,194, 57,125,218,110,183,191, 97,173, 63, 53,243,198,253, 10, 28, 69, 81, 20, -157, 35,192, 68, 33, 51, 6,204, 57,218, 55, 0, 96,239,222,189,132,179,250, 26,211,123, 0,160,186,186, 26, 93,187,118,165,234, -234,234,208,185,115,103,100,103,103, 59,101,172,227,188, 84, 3,130, 32, 48,229,133, 88,218, 13,131,213,171, 22, 24,255,183, 55, - 99,166,179, 32, 22,139,201,205,167, 54, 59, 85,230,156, 57,115, 12, 94, 23,137, 39, 0,173,225,160,196, 98, 49,105,114, 15, 59, - 29,240,184, 43, 0, 79, 16, 90,220, 73, 31, 87, 55,148,179,159,235, 1,120, 97, 30,104,189, 25,230,248,141,223,113,227,198,141, - 71,252, 70, 72,226,241,150,167,175, 43,123, 51,202, 89,197, 39, 77,246,177,160, 44, 93, 51, 88,222,105, 79,195, 64, 82, 86, 86, -102,124, 31,249,249,249, 78,123, 39, 18,201,102, 74, 44, 94, 64,252,254,155,132,209, 7, 28,221,222,213, 17, 24,150,245, 57,125, - 76,104, 78,185,102,221,254, 15, 31,150,166, 6,136,135,217,208, 88,176, 96,193,130, 5, 11, 22,143, 7, 56,108, 21,176, 96,193, -130, 5, 11, 22,172, 2,192,130, 5, 11, 22, 44, 88,176, 96, 21, 0, 22, 44, 88,176, 96,193,130, 5,171, 0,176, 96,193,130, 5, - 11, 22, 44,158, 10, 52, 89, 5, 64,231,188,118, 4,150,130, 9, 89,121,172, 60, 86,222,195,147, 23, 23, 23,215, 84,187,231,112, -140,217,229, 76,151,154,209,217, 20, 77,151,158, 89, 74, 31,236,233,233, 9,129, 64, 96,252, 60,135,195, 1,151,203,189, 79, 30, -189, 49, 19, 73,234, 87,121, 89,219, 44,135,125,191,214, 33,145,108, 17,114,121,174,160, 72, 45,230,207,127, 35,205, 17,121,155, - 55,111, 22,101,103,103,243,194,194,194, 82,205,179,238, 57, 40, 79,152,157,157,141, 77,155, 54,165,177,253,237,201,147,103,183, - 2,240,191,136,192,192, 55,154, 84, 92,101,229,118,226,177,146,247, 70, 32, 5, 0,149,219, 43, 9,211,255, 91, 32,178,133,201, - 61, 31,184,188,255, 89,108, 93,183, 70, 88,113,245, 28, 70,249, 85, 72,219,107,139,144, 67,117,197,133, 70,127,145,119,232, 16, - 44, 90,186, 44,205,214,231,207,156, 57,131, 17, 35, 70, 24,137,159, 38,108,130, 32,238, 35,108,146, 36,141,199,157, 59,119, 44, -202,187,120,241, 34,194,195,195,225,230,230, 6, 30,143, 7, 46,151,219, 68, 38, 77,250, 58,157,206,120,168, 84, 42,100,102,102, - 34, 36, 36,228,169,123, 63, 18,137,132, 16,139,197,212,230,205,155,133,127,255,253, 55,110,221,186, 37,245,245,245,197, 47,191, -252,210,162,246,191,101,203, 86,161,171,192, 31,190,126,207, 72, 27, 27, 74, 68, 91,182,108, 19,110,220,104, 95,238,135, 77,155, - 54, 9, 19, 19, 19, 79,230,228,228,224,208,161, 67, 8, 13, 13,197,123,239,189,199, 53, 93,123,239,128, 60,105,126, 94, 46, 66, -130,187,129,239,234,138,197,139,151,140,137,141,141,101,183, 2,126, 90, 61, 0, 79, 18, 34, 34, 34,108,106, 60,199,143, 31,183, -217, 49,105,130, 54, 39,110, 71,225,108,121, 15, 0,132,157,164,109, 51,181,172,147,229, 49,249,188,249,247, 63,217,196,178,121, -179,240,250,153, 99, 40,220,253,141, 84, 46, 87, 65, 51,132, 3,183, 14, 4,186, 23, 94,198,179, 94,148,180,166,226, 47,180,219, -252,255, 68,211, 23,124,214,172, 18,112,253,250,117,112,185, 92,140, 28, 57, 18, 60, 30,207,120,208, 10, 1,109,245,107,181, 90, -232,116, 58,104, 52, 26,220,185,115, 7, 39, 79,158,180, 40, 79, 46,151, 35, 43, 43, 11, 67,135, 14, 5,159,207,135,139,139, 75, - 19,153, 36, 73, 66,171,213, 66,171,213, 66,163,209, 64,161, 80, 32, 43, 43, 11, 13, 13, 13,143, 3, 89,115, 12,109,131, 3, 64, -219,146, 60,244, 18,137,132,136,139,139, 35,227,226,226, 16, 16, 16,128,127,255,251,223,152, 49, 99, 6,234,235,235, 17, 16, 16, -224, 80, 6,210,128,128, 0,227,243,124,244,209,135,248,121,103, 38,220,220, 90,129,203,229, 75, 27,234,139,236,150,153,145,145, -129,134,134, 6, 12, 29, 58,244,206,184,113,227,218, 86, 85, 85,225,216,177, 99,186,249,243,231, 99,235,214,173,205,246, 17, 85, - 65,238,125,117,115,229,230, 77,164,121,185, 99,105,252,103, 69, 3, 6,246,233,120,183,184, 28,199,146,211, 78,238,218,181,123, - 92, 76,204,203, 39, 88,234,124,252, 65,167,254, 53,243, 20, 48, 82, 0,204, 83,183,218, 58,127,232,228,255,230,155,111, 54,123, - 79, 77, 77, 13, 0, 80, 76,148, 0,154,172, 91,106,173, 63, 8,121,166,150,191, 19,172,127,123, 73,155, 41, 89, 59, 91,158,233, -189,166,127, 1, 0,213,213,250,204,136,254,254,169, 79, 69, 71, 45,248, 51, 21, 33, 69, 82,105,145,156,196,180, 16, 46,158, 9, -210,130,244,167,224,226,207, 69,125, 21, 31,110,245, 10,244,204, 94, 47,253, 57, 62, 78,244,234,146, 21, 86,149, 0,130, 32,112, -227,198, 13,240,249,124,140, 25, 51,198, 72,218, 46, 46, 46,224,112, 56,160, 40, 10, 26,141, 6, 90,173, 22, 42,149, 10, 69, 69, - 69,144, 74,165, 86,183, 84,230,112, 56,208,104, 52,200,206,206,198,200,145, 35,225,230,230, 6, 87, 87, 87,163, 60, 90, 1, 80, -169, 84,104,104,104,192,149, 43, 87,160, 84, 42,141,211, 4, 76, 16, 19, 19, 35,228,114,185,210,250,250,122,240,249,124,148,151, -151,191, 61,109,218,180,122,129, 64,240,179, 35,164, 29, 19, 19, 51,147,203,229,238, 73, 78, 78,166,229,229, 76,155, 54,237,111, -137, 68, 50, 67, 44, 22,171, 29,177,132,227,226,226,164, 43, 86,172, 40, 7,208, 10,208, 79,181, 92,191,126, 29,173, 90,181, 66, - 88, 88, 24,126,250,233, 39,187,201,255,135,185,115, 49,113,192, 0, 0, 64,155, 69,139,224,230,222, 26, 13,117,133,168,147,229, -137, 98, 99,231,165, 89,203,231,110, 13,253,250,245, 67,121,121, 57,206,156, 57,211,153,195,225,224,202,149, 43,240,247,247, 71, -122,122, 58, 94,123,237, 53, 42, 59, 59,187,217,207, 87,125,181,180,201,185,167, 90,131,118, 90, 37, 22,191,255, 73,199,248,213, -255,193, 55,171, 55,162, 61, 71,135,141,171,215,164,190,246,218,107,176, 37,143,197,227, 71,254,116, 57,211,189, 0,238,203,255, -109,235,252, 97,194,153, 59,245, 61, 9, 48, 85, 2, 30,146, 39,192, 94, 75,157,176, 97,157, 59, 34,207,210,223,167, 42,113,213, -119,171,190, 20,134,102,255, 32, 45,231,234, 16,226, 3,116,238, 68,129,219,143, 15, 94,183,110,224,171,148, 80,157, 45,130, 74, -198, 3,151,116,129, 50,245,103,233,214, 13,171, 69,243,223,178, 60, 29, 64,187,231,115,115,115,225,231,231, 7,145, 72, 4,129, - 64, 0, 62,159, 15, 30,143,103,180,250,149, 74, 37, 74, 75, 75,113,234,212, 41,112, 56, 28,112, 56, 28, 52, 39, 79,167,211,225, -218,181,107, 24, 49, 98, 4,188,189,189, 33, 16, 8,192,229,114,161,213,106,161, 86,171, 81, 87, 87,135,191,254,250, 11, 42,149, - 10, 60, 30,207, 24, 11, 96, 11, 35, 71,142, 20,222,188,121, 83,122,251,246,109,212,213,213,129,207,231,163, 77,155, 54,235, 79, -159, 62,141, 97,195,134,241, 36, 18,201,143,246, 40, 1, 35, 71,142,156,122,243,230,205, 61,102,242, 66, 79,159, 62, 29, 58,108, -216,176, 93, 6, 37,128,145,188, 77,155, 54, 9,213,106, 53,202,202,202,104,151,183,177,146, 86,172, 88, 81, 18, 23, 23,215,126, -198,140, 25, 99,222,125,247, 93,187,198,191,173,219,126, 20,126,184,124, 89,147,178,178,117,235,208,230,197, 14,248,230,155,239, - 68,115,231,190,226,208,120,122,230,204, 25,233,159,127,254,137, 15, 63,252,176,142,203,229,122, 11, 4, 2, 12, 27, 54, 12, 82, -169, 20,201,201,201,104,223,190,189, 29, 61,143,192, 47,185,119,177,255, 86, 9, 14,254,254, 19,184, 92, 2, 75, 23,189, 74,246, -111, 19,200,217,178,248, 19,108,181, 87, 30,139, 71, 66,254,230, 74,164, 37,165,192,225, 85, 0,143,122,123,219,110,221,186,137, -108, 29, 15,219, 90,127, 16,242,156,104,245, 51, 37,109, 71,200, 26,166,214, 57,109,161, 27,228, 80, 14,202,179, 58, 80,251,251, -167, 58,100,253,111,216,176, 65, 56,111,222, 60,202, 90,153,249, 53,107, 48,189,127,195,134, 13, 66,243,107,230,101,205,214,215, -181,139,210,210,146, 58,180,242,226,161,155, 23, 5, 94, 32, 9,222,115,207,195,163,255,207,112, 27,248, 45, 92,125,220,192,111, - 80, 64, 46,215,161, 19, 87,142,244, 4,235,169,100, 57, 28, 14,120, 60, 30, 92, 92, 92,112,235,214, 45, 92,185,114, 5,222,222, -222, 8, 8, 8, 64, 64, 64, 0, 2, 3, 3,225,235,235, 11,153, 76,134,244,244,116,112,185, 92,227,220,190, 37,208,215,249,124, - 62,116, 58, 29,114,114,114,224,238,238,142,192,192, 64,180,106,213, 10, 65, 65, 65,240,244,244, 68, 78, 78, 14, 52, 26,141,113, -138,192,154, 66, 97,110,249,223,187,119, 79,154,151,151,135,174, 93,187, 34, 50, 50, 18,131, 7, 15,134, 92, 46,199,201,147, 39, -145,157,157,189, 93,169, 84,190, 98,135,229, 47,186, 87, 94,241,107,254, 93, 25,188, 66,134, 34, 52,242, 13,180, 31, 60, 5, 53, - 42, 14,142,167,158, 64,118,118,246, 52,165, 82, 57,159, 41,249,215,213,213,225,242,229,203,210, 51,103,206,160, 95,191,126,136, -139,139, 11, 4, 64, 26, 60, 0,237, 1, 64, 32, 16, 48, 38,235,173,219,126, 20,254,146,144, 36,244, 15,232, 35, 77,216,125, 25, -115,127,248, 1,201, 89, 89, 72,206,202, 66,155, 69,139, 0, 0, 26, 77,227, 41, 71,250,220, 11, 47,188, 64, 29, 60,120, 16,211, -167, 79,191,227,229,229,197,113,119,119,207,204,200,200,192,153, 51,103, 80, 89, 89,137,208,208, 80,251,148,210,172, 91, 88,253, -199, 85,108, 93,253,209,101, 30, 87, 1,142,174, 30, 95,175,253,129,179, 39, 61, 19,165, 28, 30,158,121,230, 25,150,101,159, 18, -240, 28, 37,248, 71,181,121,197, 3,179,176,255,183, 21,129, 7, 50,175,222, 66, 87, 61, 97,163,220, 46,165, 98,245,234,213,194, - 19, 39, 78, 72,115,115,115,173,150,101,100,100, 48,146, 69,223,151,145,145,129,234,234,106,233,234,213,171, 69,203,150,233,173, -114, 75,101,205,193, 91, 89,133,228, 66, 37,218,215,112, 49,192,155, 64, 80, 5, 16,194,243, 1,135, 8, 0,165,188,135,198,123, - 4,174, 21,146, 40,107, 84,130,199,225,160,175,191,171,212,218,239, 54, 85, 0, 92, 93, 93,145,151,151,135,246,237,219, 35, 34, - 34, 2, 92, 46, 23, 36, 73,162,170,170, 10,103,206,156,129,139,139, 11,248,124, 62,212,106,181, 85, 5,128,246, 14,208, 74, 0, - 69, 81,200,207,207, 71, 72, 72, 8,124,124,124,208,208,208,128,172,172, 44,232,116, 58,184,186,186, 66,165, 82, 65,165, 82, 89, - 29, 59,232, 32, 58, 0,168,168,168,144, 22, 23, 23,163,127,255,254, 16, 10,133,232,208,161,131,168,177,177, 17, 65, 65, 65,210, -212,212, 84,156, 63,127, 30,190,190,190, 67, 37, 18,201, 78,177, 88,172,179, 85,143, 21, 21, 21, 39,239, 85,203,224, 31, 58, 20, -221, 70,190, 4,223, 14,161, 80, 53,214,162,240,207,195,184,117,226, 39, 90, 30,163,247,107,136,125,144,150,150,150,162,117,235, -214, 16, 8, 4,162,203,151, 47, 75,227,226,226, 56, 6, 15, 0, 0,220,140,139,139, 35,153,180,193,109,219,127, 18,250,250, 61, - 35,245,245,127, 6, 28,142, 11, 52,154, 70,108,255, 81,138,185,175,139,104,143, 2,230,207,159,143,160,160, 32,210,222,190,247, -234,171,175, 82, 9, 9, 9, 24, 57,114, 36, 6, 14, 28,216, 25,128,246,196,137, 19,225, 5, 5, 5,112,115,115,131,155,155, 27, -162,162,162,198,236,221,187,247, 36, 19,121, 59,255, 46,194,183,127,221,196,182,149,203,171, 59, 60,211,185, 95, 99, 67, 13,126, - 63,242, 23, 46, 95,249, 27,190, 20, 9,126,217, 61, 68,189, 61,123,220,158, 61,123,255,183, 92,176, 79, 16, 44, 77, 31, 89,243, - 10, 88, 83,213,137, 25, 51,102,152, 90,208, 68,116,116,116,115,231, 79, 44, 42, 43,183, 19,166,199,227, 38, 15,120, 32,238,255, -230,172,246, 22, 61,179,163,214,185, 61, 30, 0,123, 17, 19, 19, 35, 76, 74, 74,106, 66,254,150,202, 28, 65,110,110, 46,146,146, -146,164, 49, 49, 49,194,230,202,172, 18, 87,101, 17,206,221, 85, 64,174, 35,113,186,136, 68,153,150, 7,157, 42, 19, 53,215,223, -196, 79,139, 98,113,232,152, 12, 87,170, 40, 92,170,208,226, 90,149, 22, 85,165,101,205,122,229, 76,149, 0,129, 64,128, 59,119, -238,224,230,205,155, 0,244,113, 49,127,100,194, 62, 90, 0, 0, 32, 0, 73, 68, 65, 84,252,241, 71,147,185,252,230,230,235, 9, -130, 48,122, 1,104,121, 20, 69,161,168,168, 8,157, 58,117, 66,105,105, 41, 72,146,132, 64, 32, 48,202,106,110, 74,193, 20,133, -133,133, 80, 42,149, 8, 15, 15, 71,135, 14, 29, 68, 92, 46, 23,222,222,222, 24, 50,100,136,200,211,211, 19,133,133,133,168,171, -171,187,194,180, 29, 20, 22, 22,130,228,240,209, 62,108, 28,124, 59,132,130,195,117,129,155,119, 16, 58, 13,137, 2,223,195,143, -150, 87, 96, 75,206,230,205,155,133,181,181,181,210,146,146, 18,116,236,216, 17, 34,145, 72,244,243,207, 63,167, 85, 85, 85, 17, - 0, 48,116,232, 80,173,225,214, 80, 31, 31, 31, 72, 36, 18,155, 1, 15, 2, 65, 0, 2,130,250, 67,167, 85,161,252,110, 6,202, - 74,206,140,173,172,200,250,200, 32, 15, 0,112,175,172, 12, 6,121, 46, 76,219,158, 88, 44,158,145,144,144,128,217,179,103, 99, -214,172, 89, 0, 64, 30, 59,118,140,151,148,148,132,185,115,231,142,191,120,241, 34,113,246,236, 89, 34, 46, 46,142, 81,228,126, - 78,157, 28,203, 79, 93,194, 87,239,197, 98,228,164,113,254, 58, 74,139,189,191,158,194,247,235,127,198,145, 37,175, 97,107,255, - 78,232,228,195,195, 71, 31,197,177, 65,128, 79, 8, 46, 93,186,100,149,252,155,245, 0,152,207,237,219, 58,127, 26,241, 0,150, -224, 57,132, 47,158,253, 66,180, 96,193,130, 39,161,190,155, 76, 41, 60,224, 32, 61, 70,239, 33, 42, 42, 74,120,235,214, 45,169, - 90,173,110,182,172, 37,168,169,169, 65, 99, 99,163, 52, 42, 42, 74, 84, 84, 84,116, 95,217,225,195,135,173,190,187,236,106, 5, -100,106, 18,217, 21, 90,148,214,106,209,250, 15, 30,250,237,205,197,157,130,107,248,251, 79, 53,180, 60, 46,212, 36,160, 84, 83, -168,161, 72, 4, 53,179,173, 61,189,220,143,158,187,167, 35,246,239,221,187,135,206,157, 59,163,160,160,192,232,242,231,241,120, -198,251,237,157,206, 51,205, 33, 64,255,125, 64, 83,130,181,112,110,204,135, 77,178, 38, 73, 18,141,141,141,250,193,145,199, 19, -189,249,230,155, 77,222, 93,125,125, 61,239,224,193,131,152, 50,101, 10,103,249,242,229,247, 86,173, 90,165,181,213, 22, 9, 66, -175, 16, 41,228,247,208, 80, 95, 36,154, 55,239,181, 52,137, 68,146, 14,224,171,250,250,122, 28, 60,120,208,168, 56,134,132,132, -168,153,180,237,149, 43, 87, 78,249,230,155,111, 18,163,162,162, 48, 98,196, 8, 0, 32,207,158, 61,203,249,237,183,223, 32, 20, - 10, 39,109,216,176,225,184, 61, 21,115, 87,174,194,171,201,127, 96,241,204, 40,204,120,117, 58,228,202, 58, 28, 56,152,134,181, - 27,119,226,191,227,159, 69,183,242, 98,150, 77,159, 2,101,128,169, 7,192,217,160,204, 58,178,173,115, 22, 38,120,208,228,239, - 68,171,221,154, 71,193,209,249,255,230,218, 5,163,246,114,248,240,225,180,238,221,187,139,252,252,252,154, 45,107, 9,252,252, -252,208,189,123,247, 38, 68,111,169,204, 18, 20, 58,111,104, 8,224, 66,165, 10,229, 58, 29, 78,228, 43,177, 55, 81,137,147,197, - 65,200,229,251,160, 88,166, 65, 81, 61,137, 70, 45, 32,215, 82,112, 13,104, 99,147,152,233,245,253, 58,157, 14, 90,173, 22, 1, - 1, 1,240,244,244, 68,231,206,157,161,209,104,140,229,150, 18, 2,153,203,163,215,247,107,181, 90, 40, 20, 10, 80, 20,133,142, - 29, 59,162,164,164, 4,109,219,182, 5,143,199,131, 74,165,130, 90,173, 54,126, 47,147,233,193, 78,157, 58, 65, 32, 16, 32, 51, - 51, 19,197,197,197, 82,157, 78,135,186,186, 58,226,207, 63,255,148, 54, 52, 52,160, 83,167, 78,240,246,246,126,158,233, 24,213, -169, 83, 39,112, 72, 53, 74,178, 82, 81, 91,156, 3, 82,167,129,162,174, 2,133,127, 30,134,186,177,134,150,215,133,137,114, 67, - 35, 32, 32, 64,186,105,211, 38,163, 23,167,170,170,138,184,118,237, 26, 12,164, 77, 2,104,109, 41,225,145, 57,180, 90, 5,180, -154, 6,184,121,180,129,192,205, 31, 18,201, 22,161, 88, 44,214,174, 88,177, 34,192, 68, 30,182,110,221, 10,153, 76, 70, 47, 97, -188, 15, 43, 86,172,160,134, 15, 31, 78, 13, 28, 56,144,250,236,179,207,126,159, 50,101, 10, 38, 77,154, 4, 0,184,120,241, 98, - 93, 82, 82, 18,102,204,152, 49,229,196,137, 19,135,153,212,217,138, 21, 43,168, 17, 35, 70, 80, 47,191,249, 54,198,236, 59,133, -101,255,154,134,119, 62, 88, 8,165,186, 1,183,243,138, 32,145,236,197,111,147,135, 65,216,177,149,195,125, 99,194,132, 9,236, -184,254, 8, 17, 22, 22,214,132,244,205, 3, 1, 31,106, 42,224,232,232,104,161, 61,231, 15,205,210,183,178,102,223,220,218,103, -106,253, 91,147,247, 70, 96, 32,245, 70,224, 63,238,124,243,115, 91,158, 8,103,201,179, 98, 73, 59, 66,212, 15, 12,102, 74,132, -195, 30, 0, 0,216,181,107, 87,218,228,201,147, 69,166,201,105, 44,149, 57,130,144,144, 16, 76,158, 60, 89,180,107,215,174,180, -230,202,172,126,190,123, 8,186,123,112,225, 69, 0, 26,138,194,141, 26, 53, 18,114, 85,216,117,174, 20,127,229, 85,163, 84, 1, - 84, 41,117,200,107,160,112, 87, 69,161, 65,173, 17, 53, 71, 94,244,210, 60,181, 90, 13,133, 66,129,182,109,219,162, 79,159, 62, - 6, 69,207, 31,131, 7, 15, 54, 18, 54, 77,218,214, 8,155, 38,116,141, 70, 3,181, 90, 13,130, 32, 16, 28, 28,140,218,218, 90, - 20, 21, 21,161,186,186, 26, 93,186,116, 1,135,195,129, 90,173,134, 74,165, 50,126,198, 22,130,130,130, 68, 29, 58,116,192,181, -107,215,112,244,232, 81, 28, 58,116, 72,122,232,208,161,147,167, 79,159, 6,151,203,197,115,207, 61,135,110,221,186, 41, 96, 8, -188, 99, 32,111, 74,107,127, 31, 84,229, 95,194,223,199,127,196,181,195,155,112,227,176, 4,119,206,255, 6, 87, 14, 73,203, 43, -177, 37,231,173,183,222, 74,107,221,186,181,200,219,219, 27,217,217,217, 40, 46, 46,150,198,199,199, 11, 77, 21, 1,131, 39,128, -147,144,144,128,222,189,123,219,124, 54,181, 74, 6, 89,109, 46, 92, 92, 60,224,235,223, 67,234,225,217, 30, 63,252,240,139,144, - 32, 56, 67,233,123,188,106, 83, 33,253,239, 59,136,232,209, 96,181,109, 31, 62,124, 24,110,110,110,232,221,187, 55,186,116,233, - 66, 79, 31,104,107,106,106, 26,246,237,219,231, 27, 22, 22, 54,101,207,158, 61, 73, 76,219,110,114,242, 97,120,123,123, 98,212, -232, 33,242,176,129,253, 48,245,205,185,144, 19, 90, 84,148, 87, 99,193,162,207,177,106, 80, 8, 6,182,114, 92, 73,158, 48, 97, - 2,245,245,215, 95,179, 74,192, 99,162, 8, 88,194, 99,179, 23,192,163, 94, 85,224, 8, 1,219,139,237,149,122, 5,194,148,168, -233,178,199, 65,222,227,234, 81, 48,243, 4, 80,246,120, 0,104, 44, 91,182, 44,109,236,216,177,162,193,131, 7, 91, 45, 51,189, -214, 28, 76,239, 31, 59,118,108,147, 96, 63, 75,101,205, 90,135,174, 30,162,190,109, 3, 49, 60,192, 21,207,250,241,209, 78,192, -129, 43, 69, 65,160,210,162,147, 39, 15, 53, 20,133,171, 13, 90,228, 52,106,209,190, 85, 0,186, 60, 59,218,170, 44,218,234,167, -151,250,117,234,212, 9,253,251,247, 71, 77, 77, 13,106,107,107, 81, 91, 91, 11, 47, 47, 47, 12, 29, 58, 20,106,181,218,152, 19, -192, 26, 97,211,202,132, 70,163, 1, 65, 16, 8, 13, 13,133, 66,161, 64, 69, 69, 5,202,203,203, 81, 81, 81,129,198,198, 70,132, -134,134,130,199,227, 25,229, 89,203, 43, 96,174,148,181,110,221, 90, 20, 28, 28,140,219,183,111, 35, 37, 37, 5, 25, 25, 25,112, -119,119,199,152, 49, 99,208,191,127,255,195, 2,129, 96, 41,211,101,123,187,118,237, 74,106,221, 42,232,149,224,182,190,104,200, -251, 19, 57, 41,219, 81,146,241, 59,252, 92,117, 24, 55,118, 12,250,247,239, 63,231,221,119,223, 61,200, 68,150,183,183, 55, 6, - 14, 28, 8,138,162,112,238,220, 57,100,102,102, 74, 75, 74, 74,164, 95,125,245,149, 48, 46, 46, 78, 68,103, 78, 28, 52,104, 16, -210,211,211,109,202,155, 63,127,110,154,172, 38, 87, 84, 93,113, 5,174, 2,127,180,105,247,156, 52,168,205, 96,169,151,119,151, -195,223,172,254,126, 50, 45,111,215,187,238,216,125, 86, 5,107, 74, 79, 78, 78, 14, 2, 3, 3, 49, 98,196, 8,242,217,103,159, -133, 92, 46, 71, 99, 99, 35,214,175, 95,239,217,163, 71,143, 23,165, 82,105,146, 61,125,226,239,191,115,208,185, 83, 7,188,252, -242, 20,247,143,255,189, 24, 85,245, 50, 84, 86, 85, 34,246,157,207,241,249,212,177, 24,219,169,117,139,200,127,237,218,181,232, -211,167, 15,214,173, 91,199, 42, 1, 15, 17,166,243,254,182,240,208, 50, 1, 58,115, 85,129, 33,185,143, 83, 50, 1,218,130,121, - 34, 30,103, 40, 1,206, 36,107,103,203,115,198,171,134, 19,210, 3,155, 41, 16,132, 21,143,133, 93,120,235,173,183,210,204, 63, -103, 90,182,109,219, 54, 70, 50,233,251, 44,221,207, 84, 6,141, 29,187,246,164, 45,127,117, 38,180, 25,201, 40,144, 1,158,132, - 11, 58,123,114, 80,162, 35,192,117,229, 33,189, 92, 7, 37, 9, 4,185,114, 17, 60,104, 20,222, 93,189, 53,173, 57, 5, 64,163, -209,128,203,229,162,107,215,174, 24, 56,112, 32,234,234,234,160, 84, 42,141,235,243,213,106, 53,252,253,253, 49, 98,196, 8, 36, - 37, 37, 25,167, 4, 44, 65,167,211, 25,179, 8,246,236,217, 19, 6, 55, 61,148, 74,165,177, 63,211,158,132,158, 61,123,162,186, -186, 26, 13, 13, 13, 86,251,178, 57,153,159, 62,125, 58, 45, 38, 38,102, 76,239,222,189, 79,154, 36, 2,170, 29, 57,114,228, 73, -129, 64, 48, 91, 44, 22, 43,237,169,203,211,167, 79, 39,196,196,196,212,245,238,221,251,160,137,188,202,145, 35, 71,174,127,247, -221,119, 25,103,235, 89,184,112, 97,218,166, 77,155, 68,145,145,145,184,125,251,182,244,230,205,155, 40, 44, 44,132,151,151,151, -212,215,215, 23, 17, 17, 17,216,182,109, 27, 6, 13, 26,196,248,217,222,120,227,213,180,109,219,118,136,148,202,106,248,250,133, - 74, 61,189, 58,194,203,187, 19, 26,235, 75,146, 86,174,218,142,152,151,199, 97,215,187,238,198,122,178,100,177, 77,156, 56, 17, -201,201,201, 40, 46, 46,230, 84, 87, 87, 67,169, 84, 34, 61, 61,157,103, 80, 58,235,206,158, 61,107, 87,127,136,138,154,136, 3, - 7,146, 80, 87, 91,133,226,210,187,120,247,173,127,169,223,255,112, 5,127,234,152, 97, 24,161,170, 3, 92, 28,163,135, 9, 19, - 38, 80,159,126,250,169, 49, 29,116,112,112, 48,190,254,250,107, 0,160,142, 28, 57,194,166, 13,127, 68, 74,193,163, 84, 0,136, - 25, 51,102,152,186,208, 8, 51,119, 63, 97,175,251,223, 25,228,110, 36,249,202,237,176,149,109,207,158,224,191,202,202,237, 48, -117,197,155, 18,179,185,203,158, 9,105, 87,110,175,116,170,188, 39, 0,255, 83,131, 68,151, 97, 34,209,101,149, 86, 90,113,242, - 4, 92,180, 10, 92,174,167,144, 90,175, 5,159, 32, 16, 64, 81, 16,181,245,133, 95,155, 32, 81,135, 33, 66, 96,199, 30,155, 30, -128, 46, 93,186, 96,240,224,193, 80, 40, 20,208,104, 52,224,243,249, 70,194,166,173,244,160,160, 32, 12, 31, 62, 28, 41, 41, 41, -205,122, 0,120, 60, 30,250,247,239, 15,130, 32, 32,151,203,141,222, 5, 90,105,167,179, 11,146, 36,137,190,125,251,226,143, 63, -254,128, 61,193,149,187,118,237,146, 2, 32, 36, 18, 9, 1,192, 19,250,108,123,133, 98,177, 88,227, 72, 93,238,218,181, 43,201, - 32,207, 19,128, 63,128,106,177, 88,108,119,110,226,133, 11, 23,166, 1,192,134, 13, 27, 68, 46, 46, 46,200,207,207,135,191,191, -191, 20, 0, 74, 74, 74, 48, 97,194, 4,172, 89,179,198, 46,153,243,230,205, 73,147, 72,182, 8,213,106,153,200,173,174, 64,234, -237, 27, 12,119,207,118,112,247,108,135, 99, 39,238,129, 24,219,188,197,253,211, 79, 63, 17,243,231,207,167,170,171,171, 49,113, -226, 68,117, 64, 64, 0,159, 36, 73, 20, 22, 22,218,237, 17, 3,128, 29, 59,126, 34,196,226, 88,202,251,122, 38,222,122,235, 13, -116, 8,237,206,255,122,241, 27,228,142,141, 63,113,214,115,149, 14,181,229, 9, 19, 38, 80,203,151, 47,135,175,175, 47, 74, 75, - 75,225,230,230, 6,146, 36,225,225,225,129, 47,191,252,146, 85, 2, 30, 2,194,194,194,172,122, 1,152,166, 2,118, 58, 30,243, - 85, 5, 68,229,246, 74,139, 23, 28,180,254,137,237,149,247,203, 51,183,212,105,215, 61, 3,210,118,182, 60, 22,143, 17, 12,100, - 67,188, 20, 53, 65,232,163, 85, 73,185,119,242, 17,162,185, 11,175,128,214, 24,214,183, 7, 2,218, 7,138, 62,216,180, 51,109, -119,198, 66,155, 94,180,174, 93,187, 98,196,136, 17,198,249,120, 46,151, 11,149, 74,101, 76,221,107, 58, 77,208,177, 99, 71, 12, - 31, 62, 28,105,105,150,187,158,155,155, 27,194,194,194,192,227,241,160, 86,171,141,159, 51, 93, 58,104,186, 17, 16,135,195,193, -128, 1, 3,144,153,153,105,119, 29, 24,188, 3,245,134,163,197, 48,144,126,139, 55, 37, 48,120,136,140,253,112,211,166, 77, 66, -185, 92, 14,149, 74,133, 30, 61,122, 32, 62, 62, 94,106,223,115,197,166, 1,128, 68,178, 69,164, 80, 84,192,213,213, 15, 46,124, - 47, 41,135,195,195, 47, 9,135, 69,175,204,142,106, 86,222,214,173, 91, 9,137, 68, 66,124,251,237,183,164, 66,161, 0, 0,132, -134,134,218,149,126,217, 20, 18,201, 22, 98,219,182,173, 19,230,126,250,109,178, 94, 30,197, 9, 13,125, 6,161, 47,190,248,202, - 91,111,189,149,224,136,204, 85,171, 86,177,157,250, 49, 81, 2,154, 35,255,135,170, 0, 60,169,112,230,178, 63,115, 98,110, 41, - 81, 59, 81,158,179, 21, 6, 86, 1,113, 0,123, 14, 31, 73,107, 82,119,117,133, 56,125,187,144,241,231,163,163,163,225,231,231, -103,140,240, 39, 73,210,232,194,167, 61, 0,116,208, 31,189, 35, 96,112,112, 48, 8,130,192,238,221,187,239,147,183,118,237, 90, - 36, 38, 38, 26,239,213,233,116, 54,183, 3,230,243,249, 24, 52,104, 16,152, 68,199, 63,193,202, 90,139,219, 58,173, 8,232, 73, -125, 59,244,225, 88,164,148,137, 60,131,178, 68, 0,192,166, 77,155,168,133, 11, 23, 18, 39, 78, 56,190, 52,127,222,188,249, 71, - 12, 94, 19, 14, 73,146, 58, 14,135,227,102,239,244, 11, 13,214,186,127,188,148, 0,155, 3,181,163,251, 8,179, 96,193,130, 5, - 11, 22, 44,158, 92,112,216, 42, 96,193,130, 5, 11, 22, 44, 88, 5,128, 5, 11, 22, 44, 88,176, 96,193, 42, 0, 44, 88,176, 96, -193,130, 5, 11, 86, 1, 96,193,130, 5, 11, 22, 44, 88, 60, 21,104,178, 10,224,210,165, 75, 14, 71,112, 90, 10, 38,100,229,177, -242, 88,121, 79,165, 60,234,133, 23,197,248,253, 55, 9, 36, 18, 9,199, 82,182, 62,182,254, 88,121,157, 58,117, 50,222, 83, 88, - 88, 72,176,245,247,112,229,217,173, 0,208,157,187,153,251, 29,121,192, 39, 89,158, 35, 50, 31,247,223,219, 4, 18,137,132, 15, -192, 27,128,187,161, 61,144, 0, 42, 29, 73,158,242,128, 65, 57,235, 55, 91,169,211, 71,178,124,105,245,234,213,194,115,231,206, - 73, 79,157, 58, 5, 0, 24, 61,122, 52,134, 13, 27,198, 56,149,240,163,120, 15, 47,188, 40,198,196, 9, 3,181,128,152, 39, 22, -139, 73,176,203, 62, 89,152,161, 83,167, 78,212,228,201,193,198,243,164, 36, 80,182,148, 0, 22,143,216, 3, 96,236,225,123,239, -223, 0,130,152, 89,211,146,239, 33, 28, 32,222,135, 38,207,210,239,109,225,111,126,172,127, 47, 77,252,215, 46,159,254,113,239, -174,245, 99,219,180, 15,110, 45,147,105,224,227,227,130,178,146, 60,178,119,239,254,213, 18,137,100,176, 88, 44,190,109,143, 76, -241,156,254, 84,126, 94, 14,242, 10,148, 40,186, 75,161, 99, 91, 2,193, 93, 4,232, 22, 28, 10,201,142,236,199,165,243, 91, 82, - 36,232,189, 6, 30,250, 51, 94,185,114, 69, 26, 22,118, 20,155, 55,203,145,150, 6,124,242,201, 49, 20, 21, 21, 73, 39, 79,158, - 12,129, 64,128,210,210, 82,209,212,169, 83,225, 12,133,224,149, 87, 94,161,100, 50,153, 40, 34, 34, 2,239,188,243, 78,154, 3, -109,134, 35, 22,139, 49,113,194, 64, 50, 54, 54,150, 7,108,193,239,191, 1, 18,137,132, 96,154,179,159,197,255, 14,212,234,229, - 72, 73,137, 69,100,228, 22, 76,158,188, 10, 73, 73,250,190,199, 42, 2, 15, 7,108, 34, 32,123, 24,214,132,236, 9, 2, 32,247, -248, 61,181,191,117,253,186, 53,175, 30, 58,248, 67, 92, 72, 72,247, 30,211, 94, 28,141,142,237,189,225,235,227,138,154, 90, 37, - 74,238,118,228,220,202,175, 9, 60,116,240, 7,233,250,117,107,190,125,123,209,210,117,182,228,189,251,246, 44,225,237,156, 67, -210,242,210,108,188, 20, 5, 12, 15, 7,130, 59, 3,185, 5, 20,206, 92, 80, 32, 89,154,141, 41,227,189,169,174,161,147, 68,223, -173,223,233, 40,145, 57,211,242, 39, 44,200,126, 36, 74, 64,117,117, 53,222,121, 71,142,160, 32, 32, 58, 26, 88,185,178, 1, 89, - 89, 89,208,106,181, 16, 8, 4,104,213,170,149,244,208,161, 67,152, 63,127,190,104,235,214,173,118,213,221,194,133, 11,133, 87, -175, 94, 69,235,214,173,165,251,246,237, 35,126,249,229, 23, 0,144,166,166,166,226,141, 55,222,192,246,237,219,237,253,173,124, - 0, 72, 62,114,145, 3,108, 33,245,127,239,207,241,207,130,181,254, 1, 96,250,244,253, 72, 73,209,255,141,141,205, 3,237, 17, - 96,189, 1, 15,151,248, 77,203,205,149, 0, 54, 8,208,130, 23,224,105, 38,127,137, 68,194, 59,158,178,247, 99,209,168,129, 61, -166, 69,133,162,127,239, 86, 8,240,115, 3, 1, 2,222,158,174, 8, 13,246, 71,196,232, 46, 24, 61, 98, 64,231,227, 41,123, 63, -150, 72, 36,109,108,201,188,157,115, 72, 58, 50,188, 14,123,215, 3,115,163,129, 30, 6,207,159,135, 59,208, 51, 4,248,108, 9, - 48,180,127, 29,110,231, 28,146,182,228, 21,181,212,235, 97, 67,145,120, 36, 3,146,191,191, 63, 14, 29,114, 67, 69, 5,144,152, - 8,212,212,240, 16, 18, 18,130, 73,147, 38,209,219,189, 34, 45, 45, 13,153,153,153,210,213,171, 87, 11,153,202,141,140,140, 20, - 94,187,118, 77,202,231,243,165, 53, 53, 77, 61, 89, 10,133, 2,219,183,111,135, 72, 36,178,183, 62, 73, 0,248,253, 55, 9,146, -143, 92,228,252,254,155,164, 69,191,125,222,188,121, 20,125, 52, 87,198,176, 93, 80, 14,148, 53,139, 45,155, 55, 11,183, 44, 89, - 34,188, 52,127, 62, 85, 52,113, 34,117,126,206, 28,106,195, 59,239, 8,183,108,222, 44,108,201,111,110,105,155,177, 36,131,105, -217,131,150, 71,187,254, 39, 79, 14, 70,108,108, 74,147,191, 52, 38, 79, 14,110, 18, 31,192,226,193, 32, 44, 44,172,201, 97, 73, - 57, 96, 21,128,199,129, 5, 30, 34,174, 93, 62,189, 50, 36, 36, 36,116,240,192,182, 77, 27, 2,135, 0,159,207,133,155,128, 7, - 23, 23, 14,130,187,250, 33, 56, 56,164,213,181,203,167, 15, 73, 36, 18,171,158, 34,241,156,254, 20, 23,117, 88, 50, 23, 80,170, -128,219, 69, 64,141, 12,168,173, 3,118, 30, 4, 22,125, 10,196,173, 6,134, 13, 4, 56, 84, 29,196,115,250,179, 29,223, 4,125, -251,246, 21,253,254,123, 79,180,106, 5,204,154,197, 67,155, 54,207, 98,244,232,209,162, 67,135, 14, 17,147, 38, 77, 18, 69, 70, - 70,162,117,235,214,184,120,241, 34,246,236,217, 35,157, 62,125,186,240,251,239,191,111,150,128, 70,142, 28, 41, 84,169, 84, 82, - 23, 23,151,102,191, 91, 42,149, 98,236,216,177, 76,200,140,154, 61,123, 54, 37, 22,139,213,134,152, 17,152,144, 63, 1, 0,179, -103,207,182, 91, 65,203,200,200, 48, 30,205,149, 57,216,109,137,150,116,239, 45,155, 55, 11,187,221,188, 41,157,122,233,146,180, - 99, 78, 46,248,117,117,104,155,115, 19,194, 63,206, 75,131,178,179,165, 18, 7,149,128,140,140, 12,204,155, 55,143, 90,180,104, -145,195, 74, 4, 45,131, 73, 25, 83,121,230, 68,207,164,204, 22,104,210,167,255,170, 39,135,176, 29,254, 33, 18, 63, 19, 60,169, - 10, 0,101,225,112,154,224, 7,248,124,148,147, 31,147,178,183, 46,174, 93,207,158, 16, 26,236,111, 36,125, 75,219, 52, 11, 92, -121,208,106, 73,132, 6,251,227,218,245,236, 96, 0, 62,214,228,229,231,229, 32,106,140,254,255,163,233,192, 27, 31, 2,155,119, - 2,165,247,128,155,185, 64,214, 53, 10,169,103,129, 19,231,128,200,209,250,251, 91,160,155, 17, 15,240, 21, 63, 18,197,100,217, -178,101,105, 13, 13,250,120,203, 89,179,102,225,252,249,243,132, 68, 34, 73,163,175, 85, 87, 87,139,122,246,228, 97,254,124, 96, -192,128, 11,208,233,110, 74,139,139,139,173,122, 82, 22, 46, 92, 40, 36, 8, 66,202,116,115,152,242,242,114,155, 94,153,217,179, -103, 35, 33, 33, 1, 0,168,244,244,116,181,201,187, 32,104,226, 79, 72, 72,192,236,217,179, 31,229,120,224,104,153, 69,168,174, - 94, 69,215, 63,255, 52,108,130,164,134,150, 36, 65,106,116, 32, 53, 90, 4,157, 78, 71, 29,195,253,214,173, 17,238, 95,127,253, - 37,125,238,185,231, 30,184, 18,224,136,119,161,165,228,175,158, 28, 98,241, 72,137, 77, 97,217,249, 49,131, 69,203,174,153,224, - 55,202, 65,195,153,114,162, 60,226, 49, 24, 92,154,125, 6, 27, 65,133,148, 51,234,207,145,192, 69,137, 68,194, 75, 79, 63,210, -171, 93, 27, 79, 80, 20,112,250,124, 17,228, 10,253,174,171, 3,251,183, 65, 80,128, 27,138, 74,234,201,220,219, 53, 28, 30,143, -131,238,221,252,208,174, 93,136, 47,244, 91,180, 90, 68, 94,129, 18,195,195, 1,149, 6, 56,114, 10,144,158,167,208,174, 53,129, -110,157,128,177, 35,128, 30,193, 4,120, 92,253,214,226, 67,195,128,111, 36, 74,166,245, 77,216,249, 63, 83, 37,130,194,253,177, - 0,212, 35,106, 91, 0, 64,111,231,138,126,253,250,137,204,175,113,185, 92,105,175, 94,229,136,139,211, 63,230,138, 21, 57, 40, - 40,232,109, 85,150, 82,169,180,105,249,155,162,160,160,192,230, 61, 9, 9, 9, 70, 43,159, 86, 4, 76,174,209, 10, 2, 97,184, -246, 56, 56,237,136,150,142, 27,221, 43,171,164,106,141, 6, 28, 14, 7, 20,151, 11,146, 36,161, 33, 73,144, 58, 29,116, 58, 18, - 29,238,222,149,182,164,189,200,229,114, 0,144,206,155, 55, 15, 4, 65,216, 29,223, 97, 74,248,219,182,109, 35,154, 43,123,152, -228, 15, 0, 41,177, 41,136,220, 18,137,233,251,129,216, 20,253,255, 52,249,171, 39,135,128,159,148,203, 50,239, 67,132,169,219, -159,209,118,192,214, 86, 1,180, 96,117,128,181, 40,118, 71,162,219, 41, 27,131,187,195, 74,131, 21, 82, 37, 28,177, 34,154, 9, - 42,116, 68,158,213,207,208,223, 67, 0, 32,247,218,140, 93, 32,245,209,254,174, 0,128,162,210, 58, 40, 20, 90, 0, 64, 72, 55, - 63, 4, 5,184, 33,251, 90, 57,231,239, 91,213, 16, 8,184, 8,238,234,139, 26,153, 26, 0,172, 10, 46,186, 75, 33,184,179,254, -251,159, 31, 5,132,245, 34,224,202, 7,180, 90, 96,252, 72,192,215, 11,200, 47, 4, 34, 71, 1,157, 59,232,239,127,196, 32,204, -188, 39,143, 74,177,124, 32, 40, 47, 47,183,171, 31,214,215, 51,223,125, 55, 33, 33,129, 48, 81, 2, 76,189, 3,143,188,238,186, -117,235, 70,229,231,231, 19,142, 94, 55,135, 75, 94, 46, 84, 26, 53, 8, 46, 15, 58,138, 2, 1, 64,171, 35,161,209,146,160,116, - 58, 16,183,254,118,202,115, 95,189,122, 21,129,129,129,210,175,191,254, 90,244,193, 7, 31, 56,172, 4,152, 79,163,216, 75,220, -206, 34,255,194,194, 66,162, 83,167, 78,212,244,253, 77, 21, 2, 0,136,220, 18, 9,126, 82, 46,146,146,242,140, 43, 1,216, 88, -128, 71, 71,254, 86, 21,128, 39, 0,205,145,168,221, 4,219,194, 37,142,214,229, 62,224,213, 4,196,204, 26,123,191,131,240,241, -113, 65, 77,173, 18,129,254,238,136,158,210, 3, 90, 29, 9, 87, 87, 46,184, 28, 14, 40,138,194,164,241,193,136,138, 8, 6, 65, - 0, 85, 53, 10,248,248,184, 0, 64,181, 53,129, 29,219, 18,200,187, 67,161, 71, 48, 48,230, 57,125,101,223,204, 5,250,245, 0, -252,188,129, 9, 66,128, 36, 1, 30, 23,200,185,173,191, 63,191,136, 98,250,110,237,249,191,165, 3,201, 35, 89, 6,184,105,211, - 38,225,234,213,171,145,151,151,135,244,244,116,233, 55,223,124, 35,242,244,244, 52,110, 59,171,211,233, 68,215,175,183,146,254, -231, 63, 37, 32, 8, 2,229,229,161, 8, 13,237,130,156, 28,203, 83, 41, 36, 73, 90, 44, 31, 59,118,236,253, 94, 36,138,194,201, -147, 39,237,250,205,166, 74,192,227, 68,254,206, 80, 18, 76, 81,221,161, 61,248, 55,255, 6,229, 2,240, 73, 10, 4, 1,104,116, - 90,168, 41, 29,228, 90, 45, 20, 33, 61,128,235, 55, 91,252,236,125,250,244, 1, 65, 16, 14,145, 63, 0, 12, 30, 60, 24,219,182, -109, 35,250,245,235, 71, 53, 87,102, 11,219,182,109, 35,204, 9,223, 82,153, 61,136, 77,249,135,248, 1,220,103,249,211, 1,131, - 73, 73,121, 44, 83, 63, 2,242, 7,216, 32, 64, 83, 18, 49, 63, 90,108, 21, 82, 20,192,121,169,230,129, 61, 52,181,215, 79,255, - 29,204, 21, 24, 94, 89, 73, 94,101, 81,137,222,234, 91,179,233, 47, 92,186, 90, 14,141,134, 4, 73, 82, 6,165,133, 48,198, 6, - 20,149,212,163,172, 36,239, 54, 0,171,102,101,112, 23, 1,206,102,234,255, 15, 12, 7,178,174, 1,177, 49, 64, 72,103,189,219, -255,139,245, 0,223, 5,224,112,128,179,153,250,251, 91, 64,208,206,142,161, 48,127,223, 15,221, 26,185,126,253, 58, 4, 2,125, -157, 28, 62,124, 24, 9, 9, 9,210,180, 52, 61, 23,172, 94,189, 90,232,239,239, 47,189,113, 67,139,173, 91,129,172,172, 65,224, -114,123,136, 58,116,232, 32,178, 38,207,195,195,131,241,119,107,181,218, 39,190,227,154,146,127,183,110,221, 40,107,135,189,202, - 66, 94, 80, 43, 81,141, 90,133, 58,181, 26, 10,181, 6, 42,173, 22, 26, 74, 7,185, 70,131,122,181, 26,165,237,218,137, 90,242, -220,238,238,238,240,240,240, 16,109,219,182,141,112,196,253,111, 74,244,182,202,236, 81, 2, 6, 15, 30,108,179,140,137, 23,192, - 26,249,155, 90,255, 44, 30, 45,249,179, 10,192, 67,192,131, 94, 82, 72,237,245, 3, 5,198,138,134,182,119,239,254,165,185,183, -107, 64,146, 20, 62,124,119, 40,114,114,171,113, 35,167, 10, 4,129, 38, 1,129, 36, 73, 33,247,118, 13,122,247,238,127, 21,128, - 85, 63,113,183,224, 80, 28, 62, 9,232,116, 0,149, 15, 72,207, 3, 73, 39,128, 9,175, 3,162, 89, 64,218, 31,250,251,116, 58, -224,240, 73,253,253,143, 16,150,230,255,225, 12,101,207, 81, 84, 87, 87, 75,123,246,188,141,140, 12,224,252,121, 29, 58,116,184, -140,172,172, 44,233,228,201,147,169, 67,135, 14, 73, 83, 82, 82,112,239,222, 61, 12, 28, 56, 16, 47,189,244,146,104,255,254,253, -105,205, 37,241,161, 40, 74,100,205, 11, 96, 14, 90,241,176, 23,244, 20,192, 35,154,243,111, 2, 83,139, 62, 63, 63,159,176,118, - 88,186,191, 57,248, 13, 24,128,170,145,163, 80,173, 80,162, 70,163,130, 82,171, 69,131, 70, 7,153, 90,141,250, 49, 99, 17, 24, - 30,238,160, 87,144,192,224,193,131,209,183,111, 95,209,249,243,231,211, 90, 34,195,148,232, 45,149,181, 68, 9, 48, 29, 11, 44, -149, 49,129, 37,242,167, 45,127,243, 76,129, 44, 30, 62,249,179, 10,192,147,238,182,152, 89, 99,215, 52,128, 88, 44,214,245,238, - 55,114, 76, 94, 94,238,205, 63, 51, 75, 65,146, 20, 38,140,235,134,203,215,202,241,229,154,243,248,226,219,115, 70,242,255, 51, -179, 20,121,121,185,119,122,247, 27,249,182, 88, 44,214, 88,147, 41,217,145, 77,232,224,141,248, 31,244, 36,191,249, 11,224,191, -191, 2,162,161,192,128, 94, 64,218, 46,125,121,252, 15,128, 14,222, 45,201, 8,216,210, 85, 0,148, 13, 57,143,100, 46,178,177, -177, 17,125,251, 42,241,236,179,192,179,207, 2,131, 6, 81,200,207,207, 71, 82, 82, 18,254,248, 67,175, 61, 9,133, 66,132,135, -135, 51, 74, 15,188,127,255,254, 52, 38,196,174,213,106,225,229,229,101,183, 21,107,136,250, 55, 70,252,211,231,142, 90,176,244, -209, 92,153, 61, 74,128, 51,238, 3, 0,241,194,133,105,234, 33, 67, 68, 55,198, 71,136,202,158,121, 6,101, 46, 46, 40,235,209, - 3, 57,145,145, 34,221,115, 67, 69, 98,195, 20,141,189,120,246,217,103,209, 18,171,223, 84,134,173, 50,166,117,104,201,234,127, -246,217,103,109,150, 57, 2, 58, 71,192, 63, 73,129, 88,143,192,131, 2,147,165,128,108, 38,192, 7,104,153, 63,142,223, 33, 22, -139,171,214,175, 91,179, 54,229,232,158,247,139,239,214, 7,135,116,245, 67,212,248, 96,248,249, 10,240,255,219,187,246,248, 38, -170,109,253, 77,146,166,105,105,121, 83, 94, 90,105,121, 40,130,128,130, 88, 69,165, 81, 16, 99, 27, 64,218,136, 23,245,130,200, -105,229,120, 16,181, 66,208,123,188,162,247,120, 33, 28, 42, 92,185, 30, 72, 21,161,222,115, 84, 76, 11,150,242,176, 90, 78,234, -241, 40,120,160, 10,200, 67, 45, 45, 90,164, 64,161,208,119,210,100, 50,251,254,145, 76,153,166,121,204, 36, 83, 90,112,127,191, -223,252, 50,179,103,102,101,102,246,204,254,214, 90,123,237,181, 47,213,218,241,221,247,231,112,226,228, 37,148,151,159,248,122, -218,131,179,183, 2, 56, 21, 76,102,194,136, 84,237,151,165, 59,172, 95,151,214, 35,229, 62,224,157, 21,238, 76,128,229,191, 0, - 27, 63,118, 91,254, 46,116, 71,194,136, 84, 45, 62,251, 64, 14, 2,151,251,220, 78, 27, 5,112,230,204, 25,109,175, 94,125,173, - 7, 14,156, 7, 0,252,244, 83,119,220,126,251,205,232,211,167, 15, 52, 26, 13,206,156, 57,163, 77, 77, 77,149,148, 10,120,200, -144, 33,218, 31,127,252,209,234,207, 98, 99, 89, 22,195,134, 13,195,198,141, 27, 37,145,144,119,223,191, 96,155,132, 18, 11,224, -203, 90, 13,213,130, 13, 70,238, 82,200, 95,168, 4,180,121, 47, 14, 31, 14,187,190,195,181,208,165, 60, 55,177,255, 37,183,188, - 64,228, 47,132, 67, 63, 12,160,253,255, 87,196, 19,224, 79, 49,144, 52, 12, 48,140, 96, 57,185,199, 94,147, 16,247, 93,145,235, - 11,242,156,100,185,190,112, 2, 23,255,176,232, 5,179,217,108,254,232,232,225, 47,255,178,173,224,139,196, 1,131,135, 38, 9, -230, 2,216, 55,106,212,216,127,165, 78,159,255,114,102,102,102,147, 24,121,158,244,190, 76,230,188,177,100,203,206,159,240,223, -111,251,153, 11, 32,116,242,151,197, 97,210,213,200, 31, 0, 30,125,244, 81, 28, 58,116, 8, 79, 62,121, 0, 0, 48, 97,194, 4, - 60,242,200, 88,237,243,207, 63,223, 74,206, 95,125,245,149, 36,153,235,215,175, 47, 1,192,164,164,164, 36, 55, 52, 52, 88,149, - 74, 37, 20, 10, 5, 88,150,133, 90,173, 70, 76, 76,140, 54, 92,242, 7, 32,139, 18, 64,113,109,162,178,178,146, 41,202, 40, 34, -131, 22, 13,210, 98,136,239, 99,170, 50,138,172,212,250,239, 92,168, 36, 52,148,114, 55,188, 29, 33,143,233,226,215,215, 21,228, -241,158,128, 58,179,217,252,248,168, 49,247,240, 25, 99, 98, 0,244, 5,112, 6,128,205, 51,203,155, 36,120,187,247, 43, 78, 17, - 84,156,178, 1, 95, 30,234,236,231,208,149,242, 74,180,129,135,232, 91,175,225,200,145, 35,178,201,222,185,115,103,137, 92,247, - 39,232,247,103,188,202, 25,120, 18, 1, 81, 80,120, 43, 1,149, 75, 42,209, 85,191,189,107, 21, 98,179, 0, 2, 0, 19,234, 60, -194, 20, 20, 20, 20, 20, 20, 20, 87, 47,104, 16, 32, 5, 5, 5, 5, 5, 5, 85, 0, 40, 40, 40, 40, 40, 40, 40,168, 2, 64, 65, - 65, 65, 65, 65, 65, 65, 21, 0, 10, 10, 10, 10, 10, 10,138,107, 3,109, 70, 1, 28, 60,120, 48,228,168, 76, 95,193,132, 84, 94, -135,201, 11, 58,137, 77,103,202, 51, 24, 12,201, 0,172, 22,139, 69, 22,121,179,103,207, 78,230, 56, 78, 54,121,244,253,235, 28, -121, 11, 23, 46,156,157,153,153,249,113, 71, 94,159,217,108,142, 0,160,241,188,211,118, 0, 28, 0,146,153,153, 73,104,125, 80, -121,191, 37,121,114,121, 0,136,136, 69, 10,228,150,119,197, 64, 46,174, 34,164,113,173,232,235,243, 16,161,108,247, 43,144,135, -236,236,108,109,128,231, 41, 89,222,145,183,187, 35, 92,121, 60,102,222,190,203,154,208,189, 16, 0, 48,126,252,248,176,235,115, - 68,255, 45,184,161,223, 30, 68, 69, 69, 97,202,148, 41,157,253,126,144, 16,150,171, 89, 94,176,255,145,130,189, 29, 85, 41, 57, - 57, 57, 15,189,251,238,187, 47, 70, 68, 68,108, 83,171,213,165,106,181,250, 7, 0,102,165, 82,105, 97, 24,230, 47,102,179,185, -175,217,108,166,195,206, 40, 40,252,121, 0,124,125,228,132,248,255,198, 37,230,134, 38, 30,129,114,201,147,100,193,202,137,244, -244,116,114,226,196,137,160,228,106,177, 88,172, 70,163, 17,113,113,113, 62, 83,174,102,101,101, 89,165,144,181,197, 98,177,102, -103,103,107,179,178,178,172,251,246,237,179,122, 41, 2, 33,201,227,142,253, 39, 20, 55,191,142,247,255,238, 0, 0,112,199,254, -243,178,118,120,243,235,146,158,203,135,127,238, 70, 56, 2,124,244,169, 91,150,110,114, 4, 70, 13, 59, 10,192,173, 4,148,150, -150, 74,170,155, 85,111,107,147,107,127,174, 65,163,163,151,181,169,165, 27,116,211,106, 49,120, 0,131,132,132,185,164,190,222, -142, 45, 91,182,116, 86,131,206,132,248,110, 94, 17,121,129,190, 49, 25,191,185, 80,224, 16,190,127,121,121,121,214, 89,179,102, -105,243,243,243, 75,194, 17,250,238,187,239,234, 84, 42,213,189, 42,149,234, 81,165, 82,217, 75,161, 80,196,152, 76, 38,197,146, - 37, 75,230,187, 92, 46,176,110, 60,234,114,185,244,102,179,249, 43,143, 55,192,225,105,255, 58,188, 27,116,250,244,233, 68,236, -179, 47, 40, 40,144, 84, 33, 51,102,204, 32,225,156, 79,113,237,131,207, 8, 40,117, 58,224,160,228, 63,126,252,120,148,150,150, - 74,106,176, 2, 53, 56, 34,229,181,147,111, 52, 26, 81, 81, 81, 1,143,139, 88,182,105, 93, 73,213,120,130,168, 17, 96,122,125, -200, 0, 0,211,123, 41,147,158,158, 30,180,117, 21,146,117,117,117,181,213, 31,249, 27,141, 70,152, 76, 38, 73,228,239,217, 70, - 82, 82,146, 54, 41, 41, 41, 44,121, 60,217,243,191, 43,255, 11,109,200,127,105,154, 6,171,242,237,162,158,213, 71,107, 99,200, -232, 4, 5,154,108, 4, 47, 60,161,193,190,163, 44,108, 77, 4,205, 14, 64, 59,238, 40,142,254,228,194,248,241,227,137, 88, 37, -192,248,199,155, 72,249,119,245,136,237,174,198,128,129, 49,232,215,127, 24,126, 41,119, 96,200,205, 78, 68,104,170, 81,188,237, - 2, 30,124,240, 65,242,233,167,159,210, 6,239,234, 65,235,244,131, 22,139,197,170,215,235,145,159,159,111,245,245,189,238,223, -191,159,188,246,218,107,216,177, 99, 71,192,250,221,184,113,227,125,106,181,122,180, 90,173, 94,164, 86,171,163, 79,157, 58,133, -225,195,135, 67,169, 84, 34, 54, 54, 22, 39, 78,156, 64, 76, 76,140,106,255,254,253, 61,247,238,221,251,229, 51,207, 60, 51, 4, -192, 47, 0,212,112,119, 15,248,109,248,132,237,159,176,221,226,203, 25,134, 1, 35, 66,131,218,190,125,187, 95, 25,194,114, 41, -138,155,128,240,195, 58,191, 35,177,112,225,194,100, 79, 86, 74,138, 78, 34,253, 80, 61, 0,162,200, 95, 44,140, 70, 99,208, 99, -196, 16,151, 63,242, 95,185,114, 37,150, 45, 91,230,173,116,132, 68, 12,228,192,120,130, 62, 35,192, 36,124,200, 8, 45,254,188, -188, 60, 6, 0,248, 95,127,125, 46,222,100, 29,136,252, 61,158,129,160, 86,187,197, 98,177,122, 91,248,124,153,240, 25, 75,149, - 23,200,194, 95,154, 38,126,166,184,252,181,221,200,240, 27, 20,136,138,100,112,195, 32, 37, 46, 92,226,224,100,149,168,169, 37, -168,107, 36, 56,241, 43, 7, 40,128,190,209,135,249,231, 19,176, 81,120,249, 63,110, 76, 30, 49, 52, 17,123,207,158, 67, 66,124, - 63,140, 30,147, 8,101,100,111,220,144,112, 9,151,108,118, 84,159,117,225,215,115,118, 68,171, 42, 68,201,187, 2, 32, 50, 88, -246,178,203,243,199, 77,157, 72, 20,156,192,250,135, 70,163,209, 2,176,122,215,225,129, 3, 7, 68,145, 63, 0, 68, 68, 68,244, -212,104, 52,243, 46, 92,184, 16, 61, 98,196, 8,220,122,235,173, 80,169, 84,120,235,173,183,224,114,185,112,203, 45,183, 96,235, -214,173,216,191,127, 63, 14, 31, 62, 12,165, 82,249, 23,179,217, 60, 99,253,250,245,129,172,234,214,231, 39,135,199,210,108, 54, -107, 7, 12, 24, 96, 37,132, 4, 60,231,236,217,179,218,204,204, 76, 73, 15,148,151, 29,234,249, 60, 81, 31, 63,126, 60, 96,187, - 49,114,228, 72,173, 84, 50, 63,126,252,184,117,206,156, 57,232,209,163,135,150, 42, 2, 93, 19, 42,127,141, 79, 48, 75,189,171, -160,162,162, 2,203,150, 45, 11, 85,129,240,139,244,244,116,194, 12,202, 99,210,211, 19,136, 37,103, 34,176,249,110,194,196, 60, - 23,244,139,247, 69,214,222,164, 28,168, 91,192, 31,132, 10,197,190,125,251,172, 73, 73, 66,237, 17,236, 0, 0, 26,206, 73, 68, - 65, 84, 73,109, 92,255, 82,229,125,176, 36,198,111,227,246,216,234, 38,209,114,214,175, 95,159, 28,169, 92, 2,133, 2,136,142, - 2,106,235, 57,180, 16,130,110, 81, 12,236, 28, 96,107, 33,184,174,159, 2, 28, 11,148,157,114,161,162,162,194, 26,136,200, 22, - 63, 59, 53, 57,225,134,104,171, 90, 77,240,187,121,119,192,229, 34, 56, 91,237, 64,229,233, 90, 32,226, 20,162,122,181,224, 76, -245,207, 80,168,235,112,236, 88, 45,122,244, 10, 44,239, 10,130,241,241, 29,133,204,180,222, 19, 61,121,230,126,144, 44,239,226, -197, 41,109,182,123,247, 46, 14, 74,108, 18,149, 18, 34, 65, 73,113,241,223, 72,106,106, 42,120,210,183,217,108,173,117,200, 91, -254,133,133,133,162,234, 52, 50, 50,242,174,166,166,166,155, 70,142, 28, 9,173, 86,139,172,172, 44, 60,245,212, 83, 0, 0,167, -211,137,205,155, 55,163,180,180, 20,223,126,251, 45,182,108,217, 2,155,205, 54,140,227, 56, 93, 16,139, 93,214,247,105,231,206, -157,162,186,230, 24,134,145,252, 46, 11,101,135,114,190,231, 27, 46,153, 51,103, 14,170,170,170,124,238, 31, 52,104, 16, 66, 37, -240,170,170, 42, 84, 85, 85, 81, 69,224, 10, 67,232,238, 15,228, 13, 80, 73,181,216,229, 38,218,112,225,113,251,135,110,186,141, - 7,193, 64,128,217,225,254,112,152, 9,165, 76,122,122, 66,107,163,150,151,151,199, 32,103, 34,241,246, 4,136, 37,235,234,234, -234, 54,228, 28, 10, 89,139,133, 64,233,144,165,159, 88,224,254,247,121,240,134, 13, 27,200,249,163,207, 99,224, 8, 37,154,108, -151, 15,177,185, 8,236, 14,192,233, 41,115,178, 4, 68,225, 94,255,254,112, 41, 12, 6, 67,114, 89, 89,153,207,255,140,141,173, -179, 54,217, 20,232,219,187, 39,106, 47, 54,163,182,174, 22,251, 14,156,197,233,115, 4,234,110,205, 24, 60,172, 17,182,230, 11, - 24, 62,198,137, 33, 35, 91,176,229,157, 82, 60,252,240,195,201, 39, 79,158,164, 95,253, 85, 0,222,250,103, 24, 6,169,169,169, - 4, 0,118,236,216, 1,131,193,144,108, 52, 26,173, 82,200,223,108, 54, 71,214,214,214,206,117, 58,157,138,232,232,104,220,123, -239,189, 88,189,122, 53, 34, 34, 34,144,153,153,137,220,220, 92,148,150,150, 98,223,190,125,216,179,103, 15,190,255,254,123,244, -237,219,183, 47,203,178, 55,192,143,251, 95,232, 2, 13,214, 5,160, 80, 40, 68, 93,103, 71,118, 1,108,223,190, 93,150, 46,128, - 30, 61,122,104,171,170,170,172,254,246,133, 91,239, 84, 17,184,122, 60, 0, 87, 19, 24, 63,228, 36, 89, 11, 78, 79, 79, 39,150, -101, 39, 1,165, 26,232, 25, 1,244, 28, 2, 38,207, 35, 76,100,223,127, 7,128, 8,173,126, 0, 16, 90,254, 62, 26, 87, 36, 37, - 37,105, 3, 4, 3, 74,190,135,191,189,216,205,175, 71, 32,182, 62, 11, 63, 59, 8,206, 94,224, 0, 40, 16, 19,237,118,113, 58, - 89, 2,123, 11, 96,119, 0,246, 22,192,225, 4,236, 54,192,209,114,217, 75,226, 43, 32,229,111,111,119, 35,197,251, 26,112,125, - 66, 12, 72,132, 10, 23,108, 54, 88,191, 56,133, 99, 39, 78,227,226,197, 70,140, 26,239, 66,147,157,133,189,197, 5, 91, 51,135, -179,149,128,173, 9,216,182,109,155, 85,202, 4, 24, 20,178,121, 56,164,126,107,132,183,254, 53, 26,141,214, 98,177,148,240, 67, - 70,109, 54,155,117,194,132, 9, 82,100,177, 0,134, 1,224,198,141, 27,199,105, 52, 26, 69,110,110, 46,230,207,159,143, 21, 43, - 86,128, 16,130,111,190,249, 6, 95,124,241, 5, 14, 31, 62,140,186,186, 58, 12, 31, 62, 28,245,245,245,209, 10,133, 34, 46,152, -240,153, 51,103,250, 37, 84,169, 30,148,174,222, 5, 16,200, 11, 16,142,245, 79, 21, 1,170, 0,116, 8, 41, 26, 12, 6,173,160, -207,208, 91, 9, 96,132,214,134,199, 37, 31,146, 75,143, 39,253,188,188, 60,198,146, 51, 17, 80,171,193,228,229, 93,209,155,229, -163,254, 45, 22, 11, 99, 48, 24, 72, 48,111,136,119,108,128, 20, 66,247,133, 64,199,206,125,169, 9,131,250, 43, 48, 71,175,134, -189, 5,232, 17,203, 64,193,120,172,126, 16,216,155,129, 38, 7, 65,147,141,160,201, 78,192, 17, 64, 17, 32,230,122,238,226, 38, -220, 50,182, 2, 3,110,186,136,207,119, 87,227,226, 69, 59,198,221, 89,143, 49,189, 27,129,136, 22,216,155, 57, 84,159, 38,104, -106, 98,192,178, 12,122,247,101, 0,134,163, 95,241, 85,244,237, 10,222,213, 18,225, 47, 15,189, 94,223, 46,254,200, 71, 44, 0, - 95,233,195, 0, 28, 92,186,116,233, 93, 42,149, 42,230,253,247,223,199,166, 77,155,240,228,147, 79, 98,229,202,149, 96, 24, 6, - 63,255,252, 51,108, 54, 27,140, 70, 35, 88,150,197,211, 79, 63,205, 49, 12, 19,244, 3,144, 51,154,190,171,119, 1, 4,242, 2, -200, 97,253, 83, 80, 5, 64, 86,248,232, 71,102, 2, 28, 39,222,196,153,224,142, 80, 79, 79, 31, 76,128, 50, 88,222, 58, 9, 68, -141,104,245, 4,240, 74,129,152,110, 0,185,192, 91,243, 6,131,129, 8,173,127,222, 35, 32,220, 54, 24, 12, 16, 36,203, 33, 82, - 9,221, 27,130, 81, 0, 62,229,177, 46,160,169,153,160,197,225, 14,246,107,113, 16,168, 34, 47,239,179, 55, 3, 54, 39, 65,205, - 69,130,243,151, 8,190, 61,198,130,227, 0,131,193,160, 45, 43, 43,107, 87, 55, 44, 11, 84,157,114,224, 84,249, 37,252,115,239, - 37, 16,194,224,216, 15, 28, 82,231,176, 80,171, 8,206,159, 3,254,249, 25, 80, 95, 79, 64, 56,224,238,251, 24,104, 52,128, 78, - 55, 3,191,252,242,139,168,123,210,221, 9,178,123,111,135,196, 12,200,234, 33,242,244,249,135,141,222,189,139,187,156, 39, 97, -199,142, 29,237,202, 94,125,245, 85,178, 99,199, 14, 20, 22, 22,138,149,163, 0,112, 4,192,193,236,236,236,177, 61,123,246,140, - 1,220,110,240,247,222,123, 15,243,231,207,199,166, 77,155, 90, 45,245,236,236,108,212,214,214,162,190,190,190,177,185,185,185, -194,227, 65, 80, 7,250, 3,142,227,218,196, 67,241, 22, 60, 33, 68,180,251, 31,184, 58,186, 0,124,121, 1,228,182,254,121,153, -212,242,167, 10, 64, 88, 40, 45, 45, 13, 26,253,237,217, 47, 78, 96,100, 55, 88,134,252, 3,120, 59,129, 32,161, 27, 48,180, 5, -204,141,133, 12,222, 26,223,218,247, 31, 78, 55,128,247, 80, 64,127, 67, 3,125, 53,150,124,123,193,147,191,119, 0,160,199,138, -106, 45, 11,226, 1, 96,100, 38, 43,230,238,201,211,147, 79,159,217,109,229,250,113, 80,168,128, 8, 79,187,232,228, 8, 88, 22, -104,104, 32,112, 56, 1,214,233, 86, 10,102,204,116,123,111,252,184,236,153,164, 59,167, 39,183, 92,216,101, 29, 53,138,195,151, - 95,184,192, 40,128,243,103, 25,104,162,128, 47, 62, 5, 28, 54, 6, 12, 1,198,220, 22,129,170, 74, 14,147, 39,167,160,160,160, - 64,212,180,214,186, 59, 65, 86, 61,227,190,127,153,149, 0, 70,102, 5, 64, 22,121,193, 92,206,157, 65,254,190, 10,249,168,127, -225, 49,188,247, 46, 45, 45, 77,155,159,159,239, 79, 94, 35,128,147,223,125,247, 93,227, 61,247,220,211, 15,130, 49,253,239,189, -247, 94, 43, 33, 58,157, 78,184, 92, 46,148,149,149,161, 95,191,126, 23, 56,142, 19,165, 45,206,156, 57,211,159,165, 46,233,166, -175,134, 46, 0, 95, 94, 0, 57,173,127, 74,252,215,160, 2,224, 25,179,127, 69, 91, 24,222,202,181, 88, 44,188,197,203,248, 56, -134,240,228, 47,176,138, 37, 65, 56, 10,128, 47,147,106,249,123, 7, 0,122,208, 90,150,149,149,101,245,116,103,136,146, 39, 36, -127, 95, 49, 1, 82,229, 5,195,170,124, 59,130,201, 43, 40, 40, 40,233,211,147,193,253, 73, 17,224, 0, 56, 29, 28, 34,213,238, -199,212,208, 68,208,226, 36, 96, 93, 64,233, 17, 23, 92, 28, 65,176, 33,123, 5, 5, 5, 37,253,251, 49,152,156,172,196,195,143, - 41,209,216, 64,208, 80, 7, 52, 53, 48, 72, 24, 78,224,114, 50, 80, 41, 52,168,189,200,161,234, 87, 7,202,126, 16, 23, 48,166, -187, 19,100,237, 98, 96, 68, 60,176,238, 5, 96,209,155, 29,162, 4,200,233, 25,144, 69, 94, 7, 14,249, 11,229,217,113,190,200, -127,249,242,229,237,220,252,121,121,121,124,158,128, 18, 63,214, 63,224, 78,230,115,240,198, 27,111, 44,183,219,237,131,149, 74, -165, 38, 58, 58, 26, 0,144,159,159,143,180,180, 52,216,108, 54,216,237,118,180,180,180, 32, 38, 38,198,238,114,185, 10, 8, 33, -103, 69, 90,215,178,188, 31, 87, 75, 23,128,208, 11,192,175, 83,226,167, 10,192, 21, 35,127, 49, 50, 61,132, 79, 60,235, 0, 64, -132,195, 18, 75, 75, 75,219, 16,190, 47, 5,161, 29,148, 12,160, 86, 0, 81, 74, 32, 70, 5,180, 52,192,178, 34, 2, 88,251, 20, - 65, 84,111, 32,170,183,228,190,127, 63,228, 15, 31,100, 45,234,195,240, 38,127,239,152, 0,169,242, 36,144,127, 80,121, 53,181, -132,217, 89,226, 36, 26, 13,192,113,192, 45, 55, 42, 47,215,199,247, 46, 56, 93, 4, 46, 78,137, 89,179,102,137, 82, 78,206,157, - 39,204,238, 79, 93,132,101, 1,135,147,192,197, 2, 10, 6, 72, 78, 1, 26,106, 25,252,112,200, 6,155, 93,129,233,250, 89,216, -186,117,171, 40,242, 95,254, 20, 48,236, 58,247,246,208,193, 64, 7,121, 2, 40, 36, 32, 64,178, 31,146,146,146, 34,102, 52,128, -178,103,207,158, 7,109, 54,219, 95, 43, 42, 42,134,140, 29, 59, 54,145,101, 89, 85, 68, 68, 4, 10, 10, 10, 48,117,234, 84,216, -237,118, 52, 55, 55,163,172,172,172,190, 87,175, 94,127,183,217,108,239,115, 28,215, 4,145, 25, 0,133, 1, 9, 82, 93,255, 2, - 69,162,157,231,160, 43,118, 1, 8,189, 0,114,200, 9, 37,119, 0,197, 85,160, 0,116,134,229,239,195,250, 32, 94,215, 35,151, -149,226,215, 35, 32,214, 3, 32, 55,249,243,202,142,151,123,159, 8,203,164,202, 11, 22, 11, 32, 85, 94,147,157, 48, 77,118, 16, -133, 2,248,103,169,187,175,159, 15,248,115,247,251,207,146, 36,175,161,129, 48,140,194,147,147, 66,225,150,241,175,127, 0, 77, -141, 28, 8, 7, 76,159,158,130,173, 91,183, 6,173, 15,221,157, 32,198,199,129,158, 49, 64,213, 5, 32, 42, 18,224, 8,208, 77, - 3,188,145, 73,149, 0,137, 32, 34,190, 75,209,240, 69,254, 12,195,144,148,148, 20, 0, 64,106,106, 42, 97, 24, 38,144, 34, 16, -227,112, 56, 26, 21, 10, 69,241,160, 65,131,174,107,104,104,120,230,192,129, 3, 3,111,189,245, 86,142,101,217,230,186,186,186, -115,135, 14, 29,250, 57, 33, 33,161,188, 79,159, 62, 21, 54,155, 45,159,101,217,115, 25, 25, 25, 77,227,198,141, 19,165, 0,240, - 73,129,194,129,217,108, 22, 77,168,161,116, 1,132,115,190, 63, 47,128, 28, 47, 11, 37,255,171, 84, 1, 16, 49,214, 95,210,135, - 46, 33,119,128, 20,185,140, 32,202, 63,100,242, 98, 74,193,164, 39, 60, 72,240, 19,128,159,188,247,214,121, 22,105, 99,204, 61, -247,107,149,139, 92,189,158, 11,225,243, 12,120, 2, 4, 25,129, 55, 36, 36,121,127,123,177,155, 80, 41, 8, 69, 94,171,220,180, -180,203,117,194, 7,252, 89, 44,150,146, 80,228, 17,174,109, 29, 55,214, 3, 41, 41, 41,216,185,115, 39,195, 91, 85,162,234,227, -175, 87,156, 8, 59, 85, 94, 23,235,247,111, 99,177, 11, 55,188,201,159,143,219, 17, 6, 9,234,245,250, 64,242, 42, 29, 14, 71, - 36, 33,164,129,227, 56,179,195,225,248, 38, 62, 62,190,111,109,109, 45,243,202, 43,175,212,215,213,213,213, 12, 30, 60,184,161, -177,177,177,201,225,112,212, 59,157,206,150, 5, 11, 22,216, 36, 90,216, 97, 63,204,204,204,204, 14, 35,194,142,148, 77,241,219, - 84, 0,228,110, 61, 58,172, 53,242,144, 40,227,203, 90,150, 2,153,163,250,197,100, 11, 12,235, 15,164, 76,250, 35,135, 55, 32, -132, 58,241,187, 29,174,188,157, 59,119, 74,170,171, 14,176,238,127,107,242,228,148,205, 0, 64, 78, 78, 14, 81, 40, 20,224, 23, -161, 11, 91,167,211,129,227, 56,112, 28,135,140,140, 12, 38,200,168, 0,134,101,217,104, 66,136,139,227,184, 22,167,211,249, 15, -165, 82,201, 40, 20,138, 72, 0,145, 28,199,193,229,114, 41, 89,150, 85,179, 44, 59,112,193,130, 5,199, 5,231,118,248, 36, 64, - 20, 20, 93, 1,129,114,164, 48,161,206, 35, 76, 65, 65, 65,209, 5,208, 44, 32,116, 78, 96,216,168, 4,229,103, 0,244, 0,160, -161,196, 79, 65, 17,216, 3, 64, 65, 65, 65,113,181, 64,227, 81, 2, 56, 1,241, 43,112,121,230, 65, 21,128,129,158,117,154, 53, -138,130,130, 42, 0, 20, 20, 20,215, 8, 20, 0, 98, 4,219, 60,241,171, 5,164,207,121,142,163,214, 63, 5, 5, 85, 0, 40, 40, - 40,126, 35,109, 26, 37,125, 10,138, 0,218, 51, 5, 5, 5, 5, 5, 5,197,111, 89, 91, 62,120,240,160,112, 34, 29,226,149, 68, -135,160,237, 68, 59,149, 22,139, 37,158,223,246, 21, 76, 40,148, 39, 21,215,162, 60, 31,195, 22, 25,250,252,104,125, 92, 45,242, -226,227,227, 91,143,169,172,172,100,164,202, 91,184,112, 33, 50, 51, 51, 25,250,254,133, 38,147,126,191, 84,158, 20,121,146, 21, - 0,137,232, 39,242, 56, 98, 48, 24, 36,103,150,242, 55, 95, 60,218,143,153,246, 53, 27,160,175, 99,174, 56,120,130,241,140,133, -183, 90, 44,150,214,108, 93, 93,101,172,182, 94,175, 79, 46, 44, 44,108, 37,193,148,148, 20,237,206,157, 59, 75,174, 69,109,215, - 87,125, 28, 63,238, 30, 25, 54,114,228,200,206,190, 60, 50, 99,102, 38, 10, 62, 49,251,124,103,103,204,204, 36,158,125,126, 95, -156, 25, 51, 51, 3, 54, 2, 5,159,152, 67,126,233,226,227,227,137, 94, 63,180,117,187,176, 16, 36,152, 18, 16, 12,171,179, 87, - 39,111,255,108, 59, 18, 71, 37, 90,193, 0,199,191, 59,166,189,115,220, 93, 88,251,230, 90, 73,239,223,220,185,115,219,221,119, -110,110, 46, 77,238, 68, 65,209,129, 10,128, 90,236,129, 73, 73, 73,146,133, 7, 80, 0,124,146,168,247, 68, 27, 18,136, 54, 20, -205, 73, 76,227, 66, 44, 22, 11,140, 70, 35, 76, 38,147, 53, 64,154, 78, 49,255,223,230,152,193, 9,215, 3, 0,206,217,237, 96, -109, 45,238,194,218,122,158,228,196,165, 63,110,109,200, 11,219,228, 20,240,228, 22,151, 52,199,187,130,113,103,215,227,127,129, -160,235,157,209, 56,183,169, 15,158,248,195,168, 15, 57,239,129,204,152,153,137,135,116,183,217,129, 76,141,135,232, 67,250, 15, -129, 2, 33, 59, 28, 14, 35,138,138, 50, 48,109, 90, 14,244,122, 19, 10, 11,221,207, 42, 20, 69,224,137,103,159, 32,181,189, 47, - 98,141,121, 53,122, 69,247, 2,199,186, 96, 39, 45,214, 79,191,249,108,218,108,215, 35,228,174,196, 73,218,197,139, 23, 7, 85, - 4,230,206,157, 75, 22, 46, 92,232,243,153, 82, 37,128,226,183,140,131, 7, 15,122,123, 9,218, 29, 19, 78, 12,128,164,115,189, -167,175,149, 11, 27,204,230,228,176, 91, 95, 66, 68, 47, 98, 69, 26,141, 70, 16, 66,176,114,229,202, 64,231, 17,201,249,187,123, -118,199,225,138,143, 80, 86,241, 79, 92,170,250, 31,148,255, 57, 3, 91,159, 78,235,212, 23,237,240,247, 71, 90, 73,254,200, 17, -247, 58,112,121, 93, 88,206, 17,209,117, 34, 10, 82,234,227,248,241,227,152, 55,111, 30, 2,146,191, 8,133,241,254,251,119,135, -170, 56,250,197, 67,186,219,154, 51, 50, 50, 52, 15,233,110, 11,153,216, 61, 22,126,160, 37,100,235, 31, 0,210,210,220,179,242, -165,165,229,163,176,176, 28,122,253, 80,232,245, 67,219,116, 13, 4,253, 94, 55,108, 72,158,253,252, 35,228,119,127,152,143,151, -103, 46,197,109,241,183, 99, 72,247, 33, 24,210,107, 8, 70,197,221,130, 63, 76,249,125,209, 75, 47, 44,195,222,234,175,173,107, -214,172, 17,245,109, 95,184,112,161,205,114,199, 72, 27, 54, 47,254, 10,179,103,207, 38,194, 37,156,250,209,233,116,178,214,183, -220,242, 58, 18, 11, 23, 46, 76,150, 67,134, 12,114,250, 0, 24, 15,224, 37, 0,107, 1, 20, 1, 48, 1,248, 47,207,114, 19,165, -125,223,228,239,175,172,141, 7,192,104, 52,146,138,138, 10, 0, 64, 98, 98, 34,132,147,205, 88, 44,150, 54,219,222,251, 3, 89, -236,213,213,213, 86,139,197, 34,218, 19, 16, 76, 89, 16, 90,245, 79,123, 82, 97,122, 91,250, 82, 93,236, 57, 57, 57, 65,143, 41, - 46, 22, 53,183, 58, 49, 24, 12, 88,185,114,165,207,157,203,150, 45,131,201,100,130,209,104,244,123,140, 47, 12, 78,184, 30,167, - 47,213, 97,235,211,105,232,195, 76, 66,249, 59, 47, 34,241,225, 68,124, 94, 94,131, 89, 43, 55,117,234,203, 54,230,150,209,173, -235,163, 71,143,110, 83,206,123, 6,132,229,114, 91,246, 65,200,141, 24, 12, 6,204,155, 55,207,231,206,205,155, 55,195,100, 50, - 65, 55,233, 86,236,254,234, 59, 32,182, 27, 80,223,120,197,159,225,174,221,223, 70, 3, 57,216,181,251, 91, 89,228,157,251,115, -159,128, 4,211,127, 73,141,168, 15, 68,232,250,207,200, 40,130, 94, 63,180,245,151,135, 94, 63, 84,116,151,192, 59, 31,190,131, - 21,111,255, 9,247, 12, 79,134,171,165, 5,172,139, 5,163, 98, 0, 40, 65,192,225,220,249, 42,140,236,119, 19, 94,126,250,101, -252,105,213,159, 68,121,163,188, 27,182,148, 65,155, 1, 0, 91,182,108,105,115,238,236,217,179,137,119,153, 88,178,222,245,202, -110, 60, 4, 29,217,189,123,119,216, 94, 5,157, 78, 71, 86,173, 90, 5, 0,178,200,235, 72,226,175,171,171,227,189,101, 97, 93, -103, 93, 93, 29,223,166,135, 42, 39, 6,192,191, 1,248, 14,192,251, 0,166, 2,120, 16,192,239,225,158, 21, 18, 0, 46, 80,234, -111,139, 12,163,155, 99,114, 76,203,130, 91,241, 38,147,137,177, 88, 44,140,197, 98, 97, 42, 42, 42,192,175,243, 46,101,225,182, -175,253,254,192, 43, 21, 89, 89, 89,214,234,234,106,171, 47, 5, 65,184, 29, 36, 85,174, 47,171, 38,208,246, 21,255,192, 62,254, -248, 99,159,196,207, 48, 76, 59,242, 95,182,108,153, 40,153,191, 86, 84,162,241,189,197,152,181, 33, 31,131, 19,174, 71,255, 62, - 81,168,216, 86,225, 38,255,158,221,221, 7, 69, 40, 37, 95,171, 94,175,215, 6,218, 22, 3,142, 0,215, 69, 3,219, 51,129,184, - 72, 96, 84,175,203,110,255,248,110,192, 39, 25,151,203,165,130, 97, 24,159,139, 20,188,254,250,235, 62,137,127,228,200,145, 48, -153, 76, 88, 53, 47, 21, 71,202, 79, 97, 64,226, 64,160,169, 89,140,245, 15,145, 94, 0,209, 86, 94,193, 39,102,236,218,253,173, - 79, 75, 95,208,183, 47,233,198, 87,125, 64,252, 46,161,128, 39,125,254,215,161, 31, 38,233,252,102, 91, 51, 38,205,190,203,154, - 52,240, 14,180, 52, 53, 1, 74, 37, 84, 42, 21,148, 74, 37,148, 74, 21, 78,158, 60,137,173,219, 10, 78,219,157,205, 24, 18, 25, -143, 91, 39,143,155, 50,255,119,243, 37, 91,141,111,236,154,135, 7,140, 9,237,202,183,108,217,194, 72,245, 4,240,228,143, 33, -107,176,235,149,221, 97, 91,238, 58,157,142,172, 93,187, 22,163, 71,143,198,186,117,235,186,164, 39, 96,225,194,133,201,115,230, -204, 33,199,143, 31,183, 86, 85, 85,201, 34,175,170,170, 10, 85, 85, 85,225,120, 19,180, 0, 38, 3, 56, 4,224, 52,128, 1, 0, -126, 4,240, 11,128, 83,158,197, 6,138, 86,133,152, 39,127,225,186,183,178,124, 69,242, 0, 8,250, 94, 81, 81, 81,129,184,184, -184,118, 10, 2, 95,230, 75, 65, 16,217,184,134, 28,252,247,200, 35,143,116,216,189, 11,201,202,151,213,239,153, 56,136, 9, 70, - 22, 54, 84,162,241,225, 59, 64, 98, 95, 4,166,188,130, 70,124, 8,188,235,182, 22,137,229, 69, 68,252,251, 58,176,172,244, 68, -103,133,133,133, 37,194,231, 20, 36,247,186,111, 15,207,123,192,107, 27,128,235,175, 3,206,237, 80, 35,119,163, 3,243, 62,242, - 95, 46,201,188,151,121, 62,123, 97,176,223,153, 79, 86, 34,118,148, 6, 49,195,159,195,199, 43, 23, 96,236,232, 1,184, 49,245, - 79,162,234, 67,204,165,223,127,255,110,236,217,163, 19,211,151,207, 0, 32, 94,228,207,240,129,127,161,244,235,139,181,240,197, -192, 31,209, 23,121,121, 2,130,225, 76,245, 25, 60, 96,120, 0,177,221,123,193,197,176,248,242,139,127,160,161,177, 17,250,233, -211,113,190,186, 26,121,249, 91,241,212,147,243, 6, 71,106, 34,161, 32, 17,152,118,219,180,226, 31,173,235, 66,178, 26, 47, 93, -186, 20,246,125, 11,201, 31,128, 71, 9,120, 62,100, 79,128, 78,167, 35,203,151, 47,199,176, 97,238,231, 57,116,232, 80,116, 37, - 79,128,151,197, 47, 27, 4,214, 63,191, 30,202,189,222,236,249, 38, 35, 0, 68, 3, 24, 5,224, 24,128,193, 0,234, 1,212, 66, -254, 73,186,174,121, 92,177, 68, 64,113,113,113, 90,131,193,208,174, 43,192, 51,183, 61, 0,180,206,119, 47,149, 28, 66, 12,254, - 19,235,113, 8, 25,188,117,239,207,221, 47,214,250, 7,128, 79, 95, 90, 14,253,138, 55,193, 78,153, 4, 21,128,152,189, 39,240, -121,121, 13, 0,128,157,178, 8,206,239,251,130,233,247,123,201, 36, 21,128,144, 68,163,102,230,135, 88,244,228, 41,252,244,244, - 82, 52,237,113, 96, 64,223,192,229,161, 42, 80,225, 42, 7,155, 55,111,118,107,195,250,123,177,175,170, 26,177, 99, 99,113,186, -168, 28,208, 68, 34,109,209,191,163,247,117,169,157,249, 45,250,139,250, 15,169, 78, 2,120, 17,124,121, 31, 2,202, 46,202, 40, -194,180,156,105, 72,203, 7, 50,138,220,235, 69, 25, 69,173,202,129,186,240,132,168,107,104,180, 55,160,111, 84, 31,176,246,102, - 16, 5,193,237, 19, 39, 98,219,182,109,246,181,111,190,169,225, 8,193, 99,143, 63,134,222,125,122,163,185,177, 17,172,139, 69, -108, 68,119, 56, 21,206,144,238,183,182,182,182,205,232, 0,169, 1,129,237,200,159, 71,136, 74,128, 78,167, 35, 70,163, 17, 19, - 39, 78,108, 83, 62,122,244,104,188,241,198, 27,157,170, 4,116, 20,241,243,178,133,114,121, 47, 64, 8, 83, 5,127, 3,224,160, -135,236, 31, 4,240, 0,128, 50, 0, 99, 0, 20, 0,216, 4,192, 9,138,176, 20, 0,226, 69,138, 68,226,254,128, 72, 76, 76,108, - 37,253,164,164, 36, 45, 31, 27,192,123, 7, 18, 19, 19,173,124,119, 65,103, 53,188,114, 34, 88, 95,191,192,250, 15,138, 89, 27, -242, 65,166, 39,224,220,157,183,161, 15, 38, 33, 42,109, 29,216, 51,231,129,158,221,161,170,249, 16, 59,214,150, 2, 74,101, 40, -247, 30,182,214,124,232,133,127,195,132,113, 64,226,162, 35, 24, 21,243, 36,126,188,193, 0,252,239, 82,191,229,157,229, 1, 48, -153, 76,184,231,246, 27, 49,101,210, 8,232,111, 89,138,236,181,235,113,172,244, 52,158,190,111, 2,206, 22,236, 66,221,165,122, -185,222,135, 54, 93, 5, 30, 47, 64, 80,130, 22, 18,190,156,228,239, 71,166, 40, 84, 86, 86, 50,241,241,241,196, 19,255,215,170, - 16, 0,192,180,156,105, 80, 23,158, 64, 97, 97,121,235, 72,128,192, 1,129, 12, 56,142,131,139, 3, 8,199, 34, 50, 74,131,199, -159,120, 66,243,218,171,175,162,127,255,254,220,224, 1, 3, 20,246,166, 70,184, 8, 64, 56, 23, 56, 46,184, 71, 43, 55, 55,151, -153, 58,117, 42,169,169,169, 65,125,125,125, 27,197,209,107,116,128,232, 81, 1, 58,157,142,100, 47, 56, 10,104,134, 1,103,223, -110,127,128,102, 24,178, 23, 28, 5, 68, 42, 1, 58,157,142,204,152, 49, 67, 59,122,244,104,107, 77, 77, 77,187,253,241,241,241, -152, 49, 99,134, 22, 93, 60, 38, 32, 92,235, 63, 76, 47,128, 80, 97, 24, 8,119, 87,192,195, 0,154, 64, 33,155, 2, 32, 37, 17, -144,175,253, 62, 97, 48, 24,124,122, 1,120,178,143,139,139,211, 26,141, 70,171,135, 16, 97, 48, 24, 2, 6, 21, 6,178, 14, 67, - 24, 95,223, 33,195, 0,121,235, 62, 80, 48,160, 20,148,255, 57, 3, 17,105,235, 96,171,250, 9,170,189,235,224,204, 95, 4,230, -161,213,216,254,251,116,252,178,253, 36,244,171,222, 7, 84,157,147,217,121,169, 5, 40, 90,181, 13,163,126,153, 6, 92,104,194, -146,169, 75, 3,150,203,225, 1, 8,213,250, 47,216,182, 28,202,193, 55, 35, 6, 35, 80,249, 69, 14, 26, 24,130,127,253,116, 10, - 83,142,156, 22,117, 57,123,246,232,252,146, 61, 0,120,246,251, 60, 78, 44,249,251,121, 71,195, 34,134,112,114, 0,240,200, 40, -186, 76,252, 0,218, 89,254,124,192, 96, 97, 97,185,207,243, 99,163, 98, 81, 85, 87,133,137, 67,238,128,173,197, 14,216,236, 96, - 29, 78,188,108, 52,130, 81, 64,209,220,212, 8,142,115,129,117, 17, 68,170, 34,112,190,241, 60, 34, 92,193, 71, 27,127,254,249, -231,173,247, 54,119,238, 92,194,183, 55, 23, 46, 92,142, 9, 59,115,230,140,232,251,116,147,176, 91, 9, 24,153,208,254,255,143, -159,116, 32,235,221, 81, 16, 75,214,158,227,200,196,137, 19, 17, 31, 31,223,110,255,145, 35, 71, 80, 80, 80, 96,237, 44,242,247, - 88,227, 12,239, 9,144,163,223,223,151,245, 47,131, 23,128,199, 3, 30,133,160,133, 82,184,188, 10, 64,135,128,183,252, 1, 32, - 41, 41, 73,107,177, 88,172,188,235,223,143,114,160, 45, 43, 43, 11, 22, 11,192,200,101,205, 75, 33, 19,177, 10, 6,111,253,251, - 34,126, 94,209,145,114,189,135,202,107,224,252,254, 53,156,195, 87, 24,240,208,106,160,174, 30,229, 57, 47, 98,232,194, 53, 56, -187,233, 69, 32, 66, 5, 40, 58, 39,179,115,101, 19, 48, 50,238, 97,209,229,157,225, 1, 48,153, 76,141,179,167,220,113,166, 7, -215,235,250,102, 68,104,242,215, 44,194, 95,118, 28,196,146, 7,239,198,188, 55, 63, 64,250,127,255, 95,135,122,131, 2,221, 98, -193, 39,102,120,146, 0, 49,225, 42,167,225,184,250, 3,121, 1, 50,138,138,136, 47,242, 23, 90,255,193, 48, 40,110, 16, 62,253, -178, 8,119, 93,127, 23,162,187,197,128,227, 8, 20,132, 5,199, 48, 32,132,192, 69, 0,150, 35, 96, 89, 22,182,186, 38,236,220, -191, 19,106,151, 90,114, 80,170,119,160,211,127, 44,154,132,148, 65, 21, 96, 62, 19, 47,195,159, 18, 32,149,252,189,149,128, 85, -171, 86, 97,224,192,129,151, 21,251,242,114,152, 76, 38,116, 5,203, 95,110, 69,192,151,245, 31,166, 23, 0, 0,146, 1,220, 0, -224,143,184, 60,241, 19, 69, 87, 86, 0,226,226,226,180,222, 30, 1,190,223, 93,168, 28, 8,215,195,180,224, 37,191, 88, 50, 14, - 3,244,105,253,135, 74,252, 60,102,173,220,132,173, 0, 30, 92,145, 2, 98,121, 17,204, 35,217, 56, 84, 94, 3,166,119, 47,156, -248,181,222,109,253, 75,239, 2,144, 5, 71,142, 28,105, 29,242, 39,102, 93, 14, 15,128, 20,229, 96,243,230,205, 14, 0, 13, 11, -146,199,212, 63,183,250,127, 28, 47,189,108,180,247,235, 30, 87,115,244, 88,101,255,121,199, 62,136,233, 36,226, 23, 67,206,194, - 46, 26,209, 94,128,142, 74, 6,228,139,252,121,203, 31, 64,208,128,192,197,139, 23, 51,119,221,127,215,116,235,164,146, 2,195, - 45,233,168,183,215,131, 81, 0,238,193, 72, 28, 92, 46, 2,142,101,209, 45, 50, 22, 95,215,125,135,178,189, 39,144,103,206, 43, - 9,251,194,203,127, 7, 64,250, 48,192, 54, 74,192,192, 74, 28, 63, 19, 31, 18,249,123, 43, 1,235,214,173, 67,207,158, 61, 81, - 83, 83,131,229,203,151,163,171,185,253,229, 80, 4,252, 89,255, 33,122, 1,250,195, 29,245,175, 0,112, 43,128, 44, 0,229,148, -190,101, 86, 0, 58, 42, 15,128, 63,143, 64,118,118,182,214, 91, 81, 48, 24, 12,146, 19, 6, 9,137,160, 43,164,216, 21, 90,255, - 66,226, 55, 26,141,124,183,135,240,185,138,190, 96, 94, 9,120,120,197,123, 32,249, 64,223,121,102,148, 60,151,142,187, 77,127, - 3, 34, 34,208, 77,163,238,148,251, 21,142,241,247,181, 30, 98, 30, 0, 22,128,194, 83,183,138, 48,235,227,220,236, 41,119, 84, - 61,151, 83,152,240,242, 83, 15,116, 31, 52, 32,217, 1,224,176,193, 96,232, 1,247,248,226,144,234,131,127,229,246,236,209,241, - 17,255,161, 40,119, 76, 48, 11, 94, 10,161,203,225,234,151, 2,111,210,231, 61, 2,189,123,247,246,169,157,125,189,231,235,237, -241, 55, 93, 15,215,108,246,240,228,235, 39,143,233, 19,219, 7,118,167, 29,132, 16,168, 85,106,212,218,154,177,239,215, 61,216, -252,215, 92,104,111,214,106,243,144, 23,246, 53,190,177,107, 30,114,115,115, 81, 86, 38, 61, 7,192,101, 37, 0, 97,145,191, 80, -222,162, 69,139,200,170, 85,171,176,116,233, 82,116,229, 62,127,161, 34, 80, 82, 82, 18,210,185,129,142,145, 32,115, 6,220,227, -253,237, 0, 94, 0,176, 31,128,139,210,183,111,140, 27, 55, 14, 7, 15, 30, 68,142,105, 89,187, 60, 0,222,217, 0, 85, 94, 13, -101,192, 62,126,225,182,247,126, 41,147, 17, 4, 34,250, 16,189, 0, 97,161,163,134, 1,242,202,136,217,108, 70,113,113, 49, 87, - 81, 81, 33, 36, 50,173,197, 98,145,108,221,204, 90,185, 9, 16, 36,254,153,252,242,134,214,245, 78,138,134, 9,218,128,113, 36, -164,103,183, 22,192, 69,184,135,255, 60, 30,230, 53,158, 93,144, 60,166,101,106,241, 55,221, 31,123,245,125,152,205,102,117,113, -113,241, 64,180, 77,103, 29, 82,125,116,180, 39, 32, 88,126,255,160, 45,103, 7,116, 9,248, 35,127,135,126, 24, 80, 24,220, 48, -251,232,237, 45, 76, 55,101, 12,217, 27,191, 15,147,238,152,132,193,177,131, 1,142,224,188,189, 6, 95,127,251, 53,206, 30, 61, -139,251, 70,222,167,125,246,217,103, 59,189, 62,132, 74,128, 92,100,205,123, 2,174,150,128,191, 48,250,234,229, 66,142,103,161, -144,250,224, 76,203,196,123, 0, 58, 10, 89, 89, 89, 62,201,222,107, 38, 54, 33,172,190,242, 22, 7, 35,218, 80,209, 17,195, 0, - 77, 38, 19,204,102, 51, 91, 92, 92,172,242,116, 29,240,228,127, 95,128,251,246, 9,207,100, 74, 29,145, 74,153, 4, 40,239,148, -198,201,108, 54, 71,122,222,203, 87, 60, 69,174,204,204,204, 39,194, 20, 27, 57,245,143,239,148,154,205,230,123,139,139,139, 81, - 92, 92,108, 7,160,241, 44,114, 16, 63, 35,114,188,191,100,146,246,236,111, 83, 95, 82,137, 91,142, 46,129,202,202, 74,166, 40, -163,136, 12, 90, 52, 72,139, 33,190,143,169,202, 40,178,138,141, 7,216,248,214, 70,102,205,154, 53,201,155, 86,108, 66,252,176, - 27,172, 0,240,227,145, 31,180,169, 83,245, 88,187,126,109,201, 71,248, 40,164,235,204,205,205,101, 30,120,224,129,118,163, 2, -156,206,240, 70,136,201, 77,214,215, 90,180, 63, 69,215,244, 2,120,151,137, 86, 0,130, 89,226, 18, 44,245, 80, 95,116,210,193, -242,229, 58,223,167, 60,131,193, 64,138,139,139, 85,194,231, 37,244,176, 72, 84, 80, 74, 58,136,144,187, 98, 35, 20, 11,160, 17, - 32, 4,238,196,252, 81, 8,111,124, 47, 95, 31, 63, 23, 23, 23,243,227,202,234, 19, 19, 19,251,153, 76,166,200,174,240, 44, 59, -210,109, 47,167,236,202,202, 74,166,114, 73,165,108,207,224,249,231,159, 47,241, 62,239,235,191,239, 13,251, 58, 63,251,236, 51, - 74,174, 20, 84, 9, 16, 97, 68, 51,161,206, 35, 76, 65, 65, 65, 65, 65, 65,113,245, 66, 65, 31, 1, 5, 5, 5, 5, 5, 5, 85, - 0, 40, 40, 40, 40, 40, 40, 40,126, 3,248,127, 37, 93,196,116, 64, 61,103,188, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, -}; - diff --git a/source/blender/src/booleanops.c b/source/blender/src/booleanops.c deleted file mode 100644 index 04214beeb90..00000000000 --- a/source/blender/src/booleanops.c +++ /dev/null @@ -1,566 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * CSG operations. - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_ghash.h" - -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - -#include "CSG_BooleanOps.h" - -#include "BKE_booleanops.h" -#include "BKE_cdderivedmesh.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_material.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_toolbox.h" - -#include "BDR_editface.h" - -#include - -/** - * Here's the vertex iterator structure used to walk through - * the blender vertex structure. - */ - -typedef struct { - Mesh *mesh; - Object *ob; - int pos; -} VertexIt; - -/** - * Implementations of local vertex iterator functions. - * These describe a blender mesh to the CSG module. - */ - -static void VertexIt_Destruct(CSG_VertexIteratorDescriptor * iterator) -{ - if (iterator->it) { - // deallocate memory for iterator - MEM_freeN(iterator->it); - iterator->it = 0; - } - iterator->Done = NULL; - iterator->Fill = NULL; - iterator->Reset = NULL; - iterator->Step = NULL; - iterator->num_elements = 0; - -} - -static int VertexIt_Done(CSG_IteratorPtr it) -{ - VertexIt * iterator = (VertexIt *)it; - return(iterator->pos >= iterator->mesh->totvert); -} - -static void VertexIt_Fill(CSG_IteratorPtr it, CSG_IVertex *vert) -{ - VertexIt * iterator = (VertexIt *)it; - MVert *verts = iterator->mesh->mvert; - - float global_pos[3]; - - /* boolean happens in global space, transform both with obmat */ - VecMat4MulVecfl( - global_pos, - iterator->ob->obmat, - verts[iterator->pos].co - ); - - vert->position[0] = global_pos[0]; - vert->position[1] = global_pos[1]; - vert->position[2] = global_pos[2]; -} - -static void VertexIt_Step(CSG_IteratorPtr it) -{ - VertexIt * iterator = (VertexIt *)it; - iterator->pos ++; -} - -static void VertexIt_Reset(CSG_IteratorPtr it) -{ - VertexIt * iterator = (VertexIt *)it; - iterator->pos = 0; -} - -static void VertexIt_Construct(CSG_VertexIteratorDescriptor *output, Object *ob) -{ - - VertexIt *it; - if (output == 0) return; - - // allocate some memory for blender iterator - it = (VertexIt *)(MEM_mallocN(sizeof(VertexIt),"Boolean_VIt")); - if (it == 0) { - return; - } - // assign blender specific variables - it->ob = ob; - it->mesh = ob->data; - - it->pos = 0; - - // assign iterator function pointers. - output->Step = VertexIt_Step; - output->Fill = VertexIt_Fill; - output->Done = VertexIt_Done; - output->Reset = VertexIt_Reset; - output->num_elements = it->mesh->totvert; - output->it = it; -} - -/** - * Blender Face iterator - */ - -typedef struct { - Mesh *mesh; - int pos; - int offset; -} FaceIt; - -static void FaceIt_Destruct(CSG_FaceIteratorDescriptor * iterator) -{ - MEM_freeN(iterator->it); - iterator->Done = NULL; - iterator->Fill = NULL; - iterator->Reset = NULL; - iterator->Step = NULL; - iterator->num_elements = 0; -} - -static int FaceIt_Done(CSG_IteratorPtr it) -{ - // assume CSG_IteratorPtr is of the correct type. - FaceIt * iterator = (FaceIt *)it; - return(iterator->pos >= iterator->mesh->totface); -} - -static void FaceIt_Fill(CSG_IteratorPtr it, CSG_IFace *face) -{ - // assume CSG_IteratorPtr is of the correct type. - FaceIt *face_it = (FaceIt *)it; - MFace *mfaces = face_it->mesh->mface; - MFace *mface = &mfaces[face_it->pos]; - - face->vertex_index[0] = mface->v1; - face->vertex_index[1] = mface->v2; - face->vertex_index[2] = mface->v3; - if (mface->v4) { - face->vertex_index[3] = mface->v4; - face->vertex_number = 4; - } else { - face->vertex_number = 3; - } - - face->orig_face = face_it->offset + face_it->pos; -} - -static void FaceIt_Step(CSG_IteratorPtr it) -{ - FaceIt * face_it = (FaceIt *)it; - face_it->pos ++; -} - -static void FaceIt_Reset(CSG_IteratorPtr it) -{ - FaceIt * face_it = (FaceIt *)it; - face_it->pos = 0; -} - -static void FaceIt_Construct( - CSG_FaceIteratorDescriptor *output, Object *ob, int offset) -{ - FaceIt *it; - if (output == 0) return; - - // allocate some memory for blender iterator - it = (FaceIt *)(MEM_mallocN(sizeof(FaceIt),"Boolean_FIt")); - if (it == 0) { - return ; - } - // assign blender specific variables - it->mesh = ob->data; - it->offset = offset; - it->pos = 0; - - // assign iterator function pointers. - output->Step = FaceIt_Step; - output->Fill = FaceIt_Fill; - output->Done = FaceIt_Done; - output->Reset = FaceIt_Reset; - output->num_elements = it->mesh->totface; - output->it = it; -} - -static Object *AddNewBlenderMesh(Base *base) -{ - // This little function adds a new mesh object to the blender object list - // It uses ob to duplicate data as this seems to be easier than creating - // a new one. This new oject contains no faces nor vertices. - Mesh *old_me; - Base *basen; - Object *ob_new; - - // now create a new blender object. - // duplicating all the settings from the previous object - // to the new one. - ob_new= copy_object(base->object); - - // Ok we don't want to use the actual data from the - // last object, the above function incremented the - // number of users, so decrement it here. - old_me= ob_new->data; - old_me->id.us--; - - // Now create a new base to add into the linked list of - // vase objects. - - basen= MEM_mallocN(sizeof(Base), "duplibase"); - *basen= *base; - BLI_addhead(&G.scene->base, basen); /* addhead: anders oneindige lus */ - basen->object= ob_new; - basen->flag &= ~SELECT; - - // Initialize the mesh data associated with this object. - ob_new->data= add_mesh("Mesh"); - G.totmesh++; - - // Finally assign the object type. - ob_new->type= OB_MESH; - - return ob_new; -} - -static void InterpCSGFace( - DerivedMesh *dm, Mesh *orig_me, int index, int orig_index, int nr, - float mapmat[][4]) -{ - float obco[3], *co[4], *orig_co[4], w[4][4]; - MFace *mface, *orig_mface; - int j; - - mface = CDDM_get_face(dm, index); - orig_mface = orig_me->mface + orig_index; - - // get the vertex coordinates from the original mesh - orig_co[0] = (orig_me->mvert + orig_mface->v1)->co; - orig_co[1] = (orig_me->mvert + orig_mface->v2)->co; - orig_co[2] = (orig_me->mvert + orig_mface->v3)->co; - orig_co[3] = (orig_mface->v4)? (orig_me->mvert + orig_mface->v4)->co: NULL; - - // get the vertex coordinates from the new derivedmesh - co[0] = CDDM_get_vert(dm, mface->v1)->co; - co[1] = CDDM_get_vert(dm, mface->v2)->co; - co[2] = CDDM_get_vert(dm, mface->v3)->co; - co[3] = (nr == 4)? CDDM_get_vert(dm, mface->v4)->co: NULL; - - for (j = 0; j < nr; j++) { - // get coordinate into the space of the original mesh - if (mapmat) - VecMat4MulVecfl(obco, mapmat, co[j]); - else - VecCopyf(obco, co[j]); - - InterpWeightsQ3Dfl(orig_co[0], orig_co[1], orig_co[2], orig_co[3], obco, w[j]); - } - - CustomData_interp(&orig_me->fdata, &dm->faceData, &orig_index, NULL, (float*)w, 1, index); -} - -/* Iterate over the CSG Output Descriptors and create a new DerivedMesh - from them */ -static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh( - CSG_FaceIteratorDescriptor *face_it, - CSG_VertexIteratorDescriptor *vertex_it, - float parinv[][4], - float mapmat[][4], - Material **mat, - int *totmat, - Object *ob1, - Object *ob2) -{ - DerivedMesh *dm; - GHash *material_hash = NULL; - Mesh *me1= (Mesh*)ob1->data; - Mesh *me2= (Mesh*)ob2->data; - int i; - - // create a new DerivedMesh - dm = CDDM_new(vertex_it->num_elements, 0, face_it->num_elements); - - CustomData_merge(&me1->fdata, &dm->faceData, CD_MASK_DERIVEDMESH, - CD_DEFAULT, face_it->num_elements); - CustomData_merge(&me2->fdata, &dm->faceData, CD_MASK_DERIVEDMESH, - CD_DEFAULT, face_it->num_elements); - - // step through the vertex iterators: - for (i = 0; !vertex_it->Done(vertex_it->it); i++) { - CSG_IVertex csgvert; - MVert *mvert = CDDM_get_vert(dm, i); - - // retrieve a csg vertex from the boolean module - vertex_it->Fill(vertex_it->it, &csgvert); - vertex_it->Step(vertex_it->it); - - // we have to map the vertex coordinates back in the coordinate frame - // of the resulting object, since it was computed in world space - VecMat4MulVecfl(mvert->co, parinv, csgvert.position); - } - - // a hash table to remap materials to indices - if (mat) { - material_hash = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - *totmat = 0; - } - - // step through the face iterators - for(i = 0; !face_it->Done(face_it->it); i++) { - Mesh *orig_me; - Object *orig_ob; - Material *orig_mat; - CSG_IFace csgface; - MFace *mface; - int orig_index, mat_nr; - - // retrieve a csg face from the boolean module - face_it->Fill(face_it->it, &csgface); - face_it->Step(face_it->it); - - // find the original mesh and data - orig_ob = (csgface.orig_face < me1->totface)? ob1: ob2; - orig_me = (orig_ob == ob1)? me1: me2; - orig_index = (orig_ob == ob1)? csgface.orig_face: csgface.orig_face - me1->totface; - - // copy all face layers, including mface - CustomData_copy_data(&orig_me->fdata, &dm->faceData, orig_index, i, 1); - - // set mface - mface = CDDM_get_face(dm, i); - mface->v1 = csgface.vertex_index[0]; - mface->v2 = csgface.vertex_index[1]; - mface->v3 = csgface.vertex_index[2]; - mface->v4 = (csgface.vertex_number == 4)? csgface.vertex_index[3]: 0; - - // set material, based on lookup in hash table - orig_mat= give_current_material(orig_ob, mface->mat_nr+1); - - if (mat && orig_mat) { - if (!BLI_ghash_haskey(material_hash, orig_mat)) { - mat[*totmat] = orig_mat; - mat_nr = mface->mat_nr = (*totmat)++; - BLI_ghash_insert(material_hash, orig_mat, (void*)mat_nr); - } - else - mface->mat_nr = (int)BLI_ghash_lookup(material_hash, orig_mat); - } - else - mface->mat_nr = 0; - - InterpCSGFace(dm, orig_me, i, orig_index, csgface.vertex_number, - (orig_me == me2)? mapmat: NULL); - - test_index_face(mface, &dm->faceData, i, csgface.vertex_number); - } - - if (material_hash) - BLI_ghash_free(material_hash, NULL, NULL); - - CDDM_calc_edges(dm); - CDDM_calc_normals(dm); - - return dm; -} - -static void BuildMeshDescriptors( - struct Object *ob, - int face_offset, - struct CSG_FaceIteratorDescriptor * face_it, - struct CSG_VertexIteratorDescriptor * vertex_it) -{ - VertexIt_Construct(vertex_it,ob); - FaceIt_Construct(face_it,ob,face_offset); -} - -static void FreeMeshDescriptors( - struct CSG_FaceIteratorDescriptor *face_it, - struct CSG_VertexIteratorDescriptor *vertex_it) -{ - VertexIt_Destruct(vertex_it); - FaceIt_Destruct(face_it); -} - -DerivedMesh *NewBooleanDerivedMesh_intern( - struct Object *ob, struct Object *ob_select, - int int_op_type, Material **mat, int *totmat) -{ - - float inv_mat[4][4]; - float map_mat[4][4]; - - DerivedMesh *dm = NULL; - Mesh *me1 = get_mesh(ob_select); - Mesh *me2 = get_mesh(ob); - - if (me1 == NULL || me2 == NULL) return 0; - if (!me1->totface || !me2->totface) return 0; - - // we map the final object back into ob's local coordinate space. For this - // we need to compute the inverse transform from global to ob (inv_mat), - // and the transform from ob to ob_select for use in interpolation (map_mat) - Mat4Invert(inv_mat, ob->obmat); - Mat4MulMat4(map_mat, ob_select->obmat, inv_mat); - Mat4Invert(inv_mat, ob_select->obmat); - - { - // interface with the boolean module: - // - // the idea is, we pass the boolean module verts and faces using the - // provided descriptors. once the boolean operation is performed, we - // get back output descriptors, from which we then build a DerivedMesh - - CSG_VertexIteratorDescriptor vd_1, vd_2; - CSG_FaceIteratorDescriptor fd_1, fd_2; - CSG_OperationType op_type; - CSG_BooleanOperation *bool_op; - - // work out the operation they chose and pick the appropriate - // enum from the csg module. - switch (int_op_type) { - case 1 : op_type = e_csg_intersection; break; - case 2 : op_type = e_csg_union; break; - case 3 : op_type = e_csg_difference; break; - case 4 : op_type = e_csg_classify; break; - default : op_type = e_csg_intersection; - } - - BuildMeshDescriptors(ob_select, 0, &fd_1, &vd_1); - BuildMeshDescriptors(ob, me1->totface, &fd_2, &vd_2); - - bool_op = CSG_NewBooleanFunction(); - - // perform the operation - if (CSG_PerformBooleanOperation(bool_op, op_type, fd_1, vd_1, fd_2, vd_2)) { - CSG_VertexIteratorDescriptor vd_o; - CSG_FaceIteratorDescriptor fd_o; - - CSG_OutputFaceDescriptor(bool_op, &fd_o); - CSG_OutputVertexDescriptor(bool_op, &vd_o); - - // iterate through results of operation and insert - // into new object - dm = ConvertCSGDescriptorsToDerivedMesh( - &fd_o, &vd_o, inv_mat, map_mat, mat, totmat, ob_select, ob); - - // free up the memory - CSG_FreeVertexDescriptor(&vd_o); - CSG_FreeFaceDescriptor(&fd_o); - } - else - error("Unknown internal error in boolean"); - - CSG_FreeBooleanOperation(bool_op); - - FreeMeshDescriptors(&fd_1, &vd_1); - FreeMeshDescriptors(&fd_2, &vd_2); - } - - return dm; -} - -int NewBooleanMesh(Base *base, Base *base_select, int int_op_type) -{ - Mesh *me_new; - int a, maxmat, totmat= 0; - Object *ob_new, *ob, *ob_select; - Material **mat; - DerivedMesh *dm; - - ob= base->object; - ob_select= base_select->object; - - maxmat= ob->totcol + ob_select->totcol; - mat= (Material**)MEM_mallocN(sizeof(Material*)*maxmat, "NewBooleanMeshMat"); - - dm= NewBooleanDerivedMesh_intern(ob, ob_select, int_op_type, mat, &totmat); - - if (dm == NULL) { - MEM_freeN(mat); - return 0; - } - - /* create a new blender mesh object - using 'base' as a template */ - ob_new= AddNewBlenderMesh(base_select); - me_new= ob_new->data; - - DM_to_mesh(dm, me_new); - dm->release(dm); - - /* add materials to object */ - for (a = 0; a < totmat; a++) - assign_material(ob_new, mat[a], a+1); - - MEM_freeN(mat); - - /* update dag */ - DAG_object_flush_update(G.scene, ob_new, OB_RECALC_DATA); - - return 1; -} - -DerivedMesh *NewBooleanDerivedMesh(struct Object *ob, struct Object *ob_select, - int int_op_type) -{ - return NewBooleanDerivedMesh_intern(ob, ob_select, int_op_type, NULL, NULL); -} - diff --git a/source/blender/src/booleanops_mesh.c b/source/blender/src/booleanops_mesh.c deleted file mode 100644 index d0b40b6eb7e..00000000000 --- a/source/blender/src/booleanops_mesh.c +++ /dev/null @@ -1,296 +0,0 @@ -#if 0 - -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ -#include "CSG_BooleanOps.h" - -#include "BKE_booleanops.h" -#include "BKE_booleanops_mesh.h" -#include "MEM_guardedalloc.h" - -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_displist.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" -#include "BKE_library.h" -#include "BKE_material.h" - -#include "BLI_arithb.h" - -/** - * Implementation of boolean ops mesh interface. - */ - - void -CSG_DestroyMeshDescriptor( - CSG_MeshDescriptor *mesh -){ - // Call mesh descriptors destroy function.... - mesh->m_destroy_func(mesh); -} - -// Destroy function for blender mesh internals. - -static - void -CSG_DestroyBlenderMeshInternals( - CSG_MeshDescriptor *mesh -) { - // Free face and vertex iterators. - FreeMeshDescriptors(&(mesh->m_face_iterator),&(mesh->m_vertex_iterator)); -} - - -static - void -CSG_DestroyCSGMeshInternals( - CSG_MeshDescriptor *mesh -){ - CSG_FreeVertexDescriptor(&(mesh->m_vertex_iterator)); - CSG_FreeFaceDescriptor(&(mesh->m_face_iterator)); -} - -static - int -MakeCSGMeshFromBlenderBase( - Base * base, - CSG_MeshDescriptor * output -) { - Mesh *me; - if (output == NULL || base == NULL) return 0; - - me = get_mesh(base->object); - - output->m_descriptor.user_face_vertex_data_size = 0; - output->m_descriptor.user_data_size = sizeof(FaceData); - - output->base = base; - - BuildMeshDescriptors( - base->object, - &(output->m_face_iterator), - &(output->m_vertex_iterator) - ); - - output->m_destroy_func = CSG_DestroyBlenderMeshInternals; - - return 1; -} - - int -CSG_LoadBlenderMesh( - Object * obj, - CSG_MeshDescriptor *output -){ - - Mesh *me; - if (output == NULL || obj == NULL) return 0; - - me = get_mesh(obj); - - output->m_descriptor.user_face_vertex_data_size = 0; - output->m_descriptor.user_data_size = sizeof(FaceData); - - output->base = NULL; - - BuildMeshDescriptors( - obj, - &(output->m_face_iterator), - &(output->m_vertex_iterator) - ); - - output->m_destroy_func = CSG_DestroyBlenderMeshInternals; - output->base = NULL; - - return 1; -} - - - - - int -CSG_AddMeshToBlender( - CSG_MeshDescriptor *mesh -){ - Mesh *me_new = NULL; - Object *ob_new = NULL; - float inv_mat[4][4]; - - if (mesh == NULL) return 0; - if (mesh->base == NULL) return 0; - - Mat4Invert(inv_mat,mesh->base->object->obmat); - - // Create a new blender mesh object - using 'base' as - // a template for the new object. - ob_new= AddNewBlenderMesh(mesh->base); - - me_new = ob_new->data; - - // make sure the iterators are reset. - mesh->m_face_iterator.Reset(mesh->m_face_iterator.it); - mesh->m_vertex_iterator.Reset(mesh->m_vertex_iterator.it); - - // iterate through results of operation and insert into new object - // see subsurf.c - - ConvertCSGDescriptorsToMeshObject( - ob_new, - &(mesh->m_descriptor), - &(mesh->m_face_iterator), - &(mesh->m_vertex_iterator), - inv_mat - ); - - return 1; -} - - int -CSG_PerformOp( - CSG_MeshDescriptor *mesh1, - CSG_MeshDescriptor *mesh2, - int int_op_type, - CSG_MeshDescriptor *output -){ - - CSG_OperationType op_type; - CSG_BooleanOperation * bool_op = CSG_NewBooleanFunction(); - int success = 0; - - if (bool_op == NULL) return 0; - - if ((mesh1 == NULL) || (mesh2 == NULL) || (output == NULL)) { - return 0; - } - if ((int_op_type < 1) || (int_op_type > 3)) return 0; - - switch (int_op_type) { - case 1 : op_type = e_csg_intersection; break; - case 2 : op_type = e_csg_union; break; - case 3 : op_type = e_csg_difference; break; - case 4 : op_type = e_csg_classify; break; - default : op_type = e_csg_intersection; - } - - output->m_descriptor = CSG_DescibeOperands(bool_op,mesh1->m_descriptor,mesh2->m_descriptor); - output->base = mesh1->base; - - if (output->m_descriptor.user_face_vertex_data_size) { - // Then use the only interp function supported - success = - CSG_PerformBooleanOperation( - bool_op, - op_type, - mesh1->m_face_iterator, - mesh1->m_vertex_iterator, - mesh2->m_face_iterator, - mesh2->m_vertex_iterator, - InterpFaceVertexData - ); - } else { - success = - CSG_PerformBooleanOperation( - bool_op, - op_type, - mesh1->m_face_iterator, - mesh1->m_vertex_iterator, - mesh2->m_face_iterator, - mesh2->m_vertex_iterator, - InterpNoUserData - ); - } - - if (!success) { - CSG_FreeBooleanOperation(bool_op); - bool_op = NULL; - return 0; - } - - // get the ouput mesh descriptors. - - CSG_OutputFaceDescriptor(bool_op,&(output->m_face_iterator)); - CSG_OutputVertexDescriptor(bool_op,&(output->m_vertex_iterator)); - output->m_destroy_func = CSG_DestroyCSGMeshInternals; - - return 1; -} - - int -NewBooleanMeshTest( - struct Base * base, - struct Base * base_select, - int op_type -){ - - CSG_MeshDescriptor m1,m2,output; - CSG_MeshDescriptor output2,output3; - - if (!MakeCSGMeshFromBlenderBase(base,&m1)) { - return 0; - } - - if (!MakeCSGMeshFromBlenderBase(base_select,&m2)) { - return 0; - } - - CSG_PerformOp(&m1,&m2,1,&output); - CSG_PerformOp(&m1,&m2,2,&output2); - CSG_PerformOp(&m1,&m2,3,&output3); - - if (!CSG_AddMeshToBlender(&output)) { - return 0; - } - if (!CSG_AddMeshToBlender(&output2)) { - return 0; - } - if (!CSG_AddMeshToBlender(&output3)) { - return 0; - } - - - CSG_DestroyMeshDescriptor(&m1); - CSG_DestroyMeshDescriptor(&m2); - CSG_DestroyMeshDescriptor(&output); - CSG_DestroyMeshDescriptor(&output2); - CSG_DestroyMeshDescriptor(&output3); - - return 1; -} - -#endif - diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c deleted file mode 100644 index 2eddd362b62..00000000000 --- a/source/blender/src/butspace.c +++ /dev/null @@ -1,801 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "blendef.h" -#include "MEM_guardedalloc.h" - -#include "DNA_color_types.h" -#include "DNA_image_types.h" -#include "DNA_material_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_view3d_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" - -#include "BKE_colortools.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_library.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" - -#include "BSE_drawview.h" // for do_viewbuttons.c .... hurms -#include "BSE_node.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_interface.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_butspace.h" -#include "BSE_headerbuttons.h" -#include "BIF_previewrender.h" -#include "BIF_mywindow.h" -#include "BIF_glutil.h" -#include "BIF_resources.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "mydevice.h" -#include "butspace.h" // own module - -/************************ function prototypes ***************************/ -void drawbutspace(ScrArea *, void *); - - -/* Local vars ---------------------------------------------------------- */ -short bgpicmode=0, near=1000, far=1000; -MTex emptytex; -MTex mtexcopybuf; - -char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", - "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", - "Voronoi", "DistNoise", "", "", "", "", "", ""}; -/* ---------------------------------------------------------------------- */ - -void test_idbutton_cb(void *namev, void *arg2) -{ - char *name= namev; - - test_idbutton(name+2); -} - - -void test_scriptpoin_but(char *name, ID **idpp) -{ - ID *id; - - id= G.main->text.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_actionpoin_but(char *name, ID **idpp) -{ - ID *id; - - id= G.main->action.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - id_us_plus(id); - *idpp= id; - return; - } - id= id->next; - } - *idpp= NULL; -} - - -void test_obpoin_but(char *name, ID **idpp) -{ - ID *id; - - if(idpp == (ID **)&(emptytex.object)) { - error("You must add a texture first"); - *idpp= 0; - return; - } - - id= G.main->object.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_lib_extern(id); /* checks lib data, sets correct flag for saving then */ - return; - } - id= id->next; - } - *idpp= NULL; -} - -/* tests for an object of type OB_MESH */ -void test_meshobpoin_but(char *name, ID **idpp) -{ - ID *id; - - id = G.main->object.first; - while(id) { - Object *ob = (Object *)id; - if(ob->type == OB_MESH && strcmp(name, id->name + 2) == 0) { - *idpp = id; - /* checks lib data, sets correct flag for saving then */ - id_lib_extern(id); - return; - } - id = id->next; - } - *idpp = NULL; -} - -void test_meshpoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->mesh.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_matpoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->mat.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_scenepoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->scene.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_grouppoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->group.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_texpoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->tex.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -void test_imapoin_but(char *name, ID **idpp) -{ - ID *id; - - if( *idpp ) (*idpp)->us--; - - id= G.main->image.first; - while(id) { - if( strcmp(name, id->name+2)==0 ) { - *idpp= id; - id_us_plus(id); - return; - } - id= id->next; - } - *idpp= NULL; -} - -/* ----------- custom button group ---------------------- */ - -static void curvemap_buttons_zoom_in(void *cumap_v, void *unused) -{ - CurveMapping *cumap = cumap_v; - float d; - - /* we allow 20 times zoom */ - if( (cumap->curr.xmax - cumap->curr.xmin) > 0.04f*(cumap->clipr.xmax - cumap->clipr.xmin) ) { - d= 0.1154f*(cumap->curr.xmax - cumap->curr.xmin); - cumap->curr.xmin+= d; - cumap->curr.xmax-= d; - d= 0.1154f*(cumap->curr.ymax - cumap->curr.ymin); - cumap->curr.ymin+= d; - cumap->curr.ymax-= d; - } -} - -static void curvemap_buttons_zoom_out(void *cumap_v, void *unused) -{ - CurveMapping *cumap = cumap_v; - float d, d1; - - /* we allow 20 times zoom, but dont view outside clip */ - if( (cumap->curr.xmax - cumap->curr.xmin) < 20.0f*(cumap->clipr.xmax - cumap->clipr.xmin) ) { - d= d1= 0.15f*(cumap->curr.xmax - cumap->curr.xmin); - - if(cumap->flag & CUMA_DO_CLIP) - if(cumap->curr.xmin-d < cumap->clipr.xmin) - d1= cumap->curr.xmin - cumap->clipr.xmin; - cumap->curr.xmin-= d1; - - if(cumap->flag & CUMA_DO_CLIP) - if(cumap->curr.xmax+d > cumap->clipr.xmax) - d1= -cumap->curr.xmax + cumap->clipr.xmax; - cumap->curr.xmax+= d1; - - d= d1= 0.15f*(cumap->curr.ymax - cumap->curr.ymin); - - if(cumap->flag & CUMA_DO_CLIP) - if(cumap->curr.ymin-d < cumap->clipr.ymin) - d1= cumap->curr.ymin - cumap->clipr.ymin; - cumap->curr.ymin-= d1; - - if(cumap->flag & CUMA_DO_CLIP) - if(cumap->curr.ymax+d > cumap->clipr.ymax) - d1= -cumap->curr.ymax + cumap->clipr.ymax; - cumap->curr.ymax+= d1; - } -} - -static void curvemap_buttons_setclip(void *cumap_v, void *unused) -{ - CurveMapping *cumap = cumap_v; - - curvemapping_changed(cumap, 0); -} - -static void curvemap_buttons_delete(void *cumap_v, void *unused) -{ - CurveMapping *cumap = cumap_v; - - curvemap_remove(cumap->cm+cumap->cur, SELECT); - curvemapping_changed(cumap, 0); -} - -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *curvemap_clipping_func(void *cumap_v) -{ - CurveMapping *cumap = cumap_v; - uiBlock *block; - uiBut *bt; - - block= uiNewBlock(&curarea->uiblocks, "curvemap_clipping_func", UI_EMBOSS, UI_HELV, curarea->win); - - /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", -4, 16, 128, 106, NULL, 0, 0, 0, 0, ""); - - bt= uiDefButBitI(block, TOG, CUMA_DO_CLIP, 1, "Use Clipping", - 0,100,120,18, &cumap->flag, 0.0, 0.0, 10, 0, ""); - uiButSetFunc(bt, curvemap_buttons_setclip, cumap, NULL); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, 0, "Min X ", 0,74,120,18, &cumap->clipr.xmin, -100.0, cumap->clipr.xmax, 10, 0, ""); - uiDefButF(block, NUM, 0, "Min Y ", 0,56,120,18, &cumap->clipr.ymin, -100.0, cumap->clipr.ymax, 10, 0, ""); - uiDefButF(block, NUM, 0, "Max X ", 0,38,120,18, &cumap->clipr.xmax, cumap->clipr.xmin, 100.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "Max Y ", 0,20,120,18, &cumap->clipr.ymax, cumap->clipr.ymin, 100.0, 10, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - - return block; -} - - -static void curvemap_tools_dofunc(void *cumap_v, int event) -{ - CurveMapping *cumap = cumap_v; - CurveMap *cuma= cumap->cm+cumap->cur; - - switch(event) { - case 0: - curvemap_reset(cuma, &cumap->clipr); - curvemapping_changed(cumap, 0); - break; - case 1: - cumap->curr= cumap->clipr; - break; - case 2: /* set vector */ - curvemap_sethandle(cuma, 1); - curvemapping_changed(cumap, 0); - break; - case 3: /* set auto */ - curvemap_sethandle(cuma, 0); - curvemapping_changed(cumap, 0); - break; - case 4: /* extend horiz */ - cuma->flag &= ~CUMA_EXTEND_EXTRAPOLATE; - curvemapping_changed(cumap, 0); - break; - case 5: /* extend extrapolate */ - cuma->flag |= CUMA_EXTEND_EXTRAPOLATE; - curvemapping_changed(cumap, 0); - break; - } - addqueue(curarea->win, REDRAW, 1); -} - -static uiBlock *curvemap_tools_func(void *cumap_v) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "curvemap_tools_func", UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset View", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector Handle", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Handle", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extend Extrapolated", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */ -void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short event, short redraw, rctf *rect) -{ - uiBut *bt; - float dx, fy= rect->ymax-18.0f; - int icon; - short xco, yco; - - yco= (short)(rect->ymax-18.0f); - - /* curve choice options + tools/settings, 8 icons + spacer */ - dx= (rect->xmax-rect->xmin)/(9.0f); - - uiBlockBeginAlign(block); - if(labeltype=='v') { /* vector */ - xco= (short)rect->xmin; - if(cumap->cm[0].curve) - uiDefButI(block, ROW, redraw, "X", xco, yco+2, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, ""); - xco= (short)(rect->xmin+1.0f*dx); - if(cumap->cm[1].curve) - uiDefButI(block, ROW, redraw, "Y", xco, yco+2, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, ""); - xco= (short)(rect->xmin+2.0f*dx); - if(cumap->cm[2].curve) - uiDefButI(block, ROW, redraw, "Z", xco, yco+2, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, ""); - } - else if(labeltype=='c') { /* color */ - xco= (short)rect->xmin; - if(cumap->cm[3].curve) - uiDefButI(block, ROW, redraw, "C", xco, yco+2, dx, 16, &cumap->cur, 0.0, 3.0, 0.0, 0.0, ""); - xco= (short)(rect->xmin+1.0f*dx); - if(cumap->cm[0].curve) - uiDefButI(block, ROW, redraw, "R", xco, yco+2, dx, 16, &cumap->cur, 0.0, 0.0, 0.0, 0.0, ""); - xco= (short)(rect->xmin+2.0f*dx); - if(cumap->cm[1].curve) - uiDefButI(block, ROW, redraw, "G", xco, yco+2, dx, 16, &cumap->cur, 0.0, 1.0, 0.0, 0.0, ""); - xco= (short)(rect->xmin+3.0f*dx); - if(cumap->cm[2].curve) - uiDefButI(block, ROW, redraw, "B", xco, yco+2, dx, 16, &cumap->cur, 0.0, 2.0, 0.0, 0.0, ""); - } - /* else no channels ! */ - uiBlockEndAlign(block); - - xco= (short)(rect->xmin+4.5f*dx); - uiBlockSetEmboss(block, UI_EMBOSSN); - bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMIN, xco, yco, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom in"); - uiButSetFunc(bt, curvemap_buttons_zoom_in, cumap, NULL); - - xco= (short)(rect->xmin+5.25f*dx); - bt= uiDefIconBut(block, BUT, redraw, ICON_ZOOMOUT, xco, yco, dx, 14, NULL, 0.0, 0.0, 0.0, 0.0, "Zoom out"); - uiButSetFunc(bt, curvemap_buttons_zoom_out, cumap, NULL); - - xco= (short)(rect->xmin+6.0f*dx); - bt= uiDefIconBlockBut(block, curvemap_tools_func, cumap, event, ICON_MODIFIER, xco, yco, dx, 18, "Tools"); - - xco= (short)(rect->xmin+7.0f*dx); - if(cumap->flag & CUMA_DO_CLIP) icon= ICON_CLIPUV_HLT; else icon= ICON_CLIPUV_DEHLT; - bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, event, icon, xco, yco, dx, 18, "Clipping Options"); - - xco= (short)(rect->xmin+8.0f*dx); - bt= uiDefIconBut(block, BUT, event, ICON_X, xco, yco, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points"); - uiButSetFunc(bt, curvemap_buttons_delete, cumap, NULL); - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiDefBut(block, BUT_CURVE, event, "", - rect->xmin, rect->ymin, rect->xmax-rect->xmin, fy-rect->ymin, - cumap, 0.0f, 1.0f, 0, 0, ""); - - -} - - -/* --------------------------------- */ - -/* nodes have button callbacks, that can draw in butspace too. need separate handling */ -static void do_node_buts(unsigned short event) -{ - Material *ma; - - /* all operations default on active material layer here */ - /* but this also gets called for lamp and world... */ - ma= G.buts->lockpoin; - if(ma && GS(ma->id.name)==ID_MA) - ma = editnode_get_active_material(ma); - else - ma= NULL; - - if(event>=B_NODE_EXEC) { - if(ma) end_render_material(ma); /// temporal... 3d preview - BIF_preview_changed(ID_MA); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - } -} - -void do_butspace(unsigned short event) -{ - SpaceButs *buts; - - /* redraw windows of the same type? */ - buts= curarea->spacedata.first; - if(buts->mainb==CONTEXT_SCENE) allqueue(REDRAWBUTSSCENE, curarea->win); - if(buts->mainb==CONTEXT_OBJECT) allqueue(REDRAWBUTSOBJECT, curarea->win); - if(buts->mainb==CONTEXT_SHADING) allqueue(REDRAWBUTSSHADING, curarea->win); - if(buts->mainb==CONTEXT_EDITING) allqueue(REDRAWBUTSEDIT, curarea->win); - if(buts->mainb==CONTEXT_SCRIPT) allqueue(REDRAWBUTSSCRIPT, curarea->win); - if(buts->mainb==CONTEXT_LOGIC) allqueue(REDRAWBUTSLOGIC, curarea->win); - - if (event <=50){ - do_global_buttons2(event); - } - else if(event<=100) { - do_global_buttons(event); - } - else if(event < 1000) { - do_headerbuttons(event); - } - else if(event<=B_VIEWBUTS) { - do_viewbuts(event); - } - else if(event<=B_LAMPBUTS) { - do_lampbuts(event); - } - else if(event<=B_MATBUTS) { - do_matbuts(event); - } - else if(event<=B_TEXBUTS) { - do_texbuts(event); - } - else if(event<=B_ANIMBUTS) { - do_object_panels(event); - } - else if(event<=B_WORLDBUTS) { - do_worldbuts(event); - } - else if(event<=B_RENDERBUTS) { - do_render_panels(event); // buttons_scene.c - } - else if(event<=B_COMMONEDITBUTS) { - do_common_editbuts(event); - } - else if(event<=B_MESHBUTS) { - do_meshbuts(event); - } - else if(event<=B_VGROUPBUTS) { - do_vgroupbuts(event); - } - else if(event<=B_CURVEBUTS) { - do_curvebuts(event); - } - else if(event<=B_FONTBUTS) { - do_fontbuts(event); - } - else if(event<=B_ARMBUTS) { - do_armbuts(event); - } - else if(event<=B_CAMBUTS) { - do_cambuts(event); - } - else if(event<=B_MBALLBUTS) { - do_mballbuts(event); - } - else if(event<=B_LATTBUTS) { - do_latticebuts(event); - } - else if(event<=B_GAMEBUTS) { - do_logic_buts(event); // buttons_logic.c - } - else if(event<=B_FPAINTBUTS) { - do_fpaintbuts(event); - } - else if(event<=B_RADIOBUTS) { - do_radiobuts(event); - } - else if(event<=B_SCRIPTBUTS) { - do_scriptbuts(event); - } - else if(event<=B_SOUNDBUTS) { - do_soundbuts(event); - } - else if(event<=B_CONSTRAINTBUTS) { - do_constraintbuts(event); - } - else if(event<=B_UVAUTOCALCBUTS) { - do_uvcalculationbuts(event); - } - else if(event<=B_EFFECTSBUTS) { - do_effects_panels(event); - } - else if(event<=B_MODIFIER_BUTS) { - extern void do_modifier_panels(unsigned short event); - do_modifier_panels(event); - } - else if(event<=B_NODE_BUTS) { - do_node_buts(event); - } - else if(event==REDRAWVIEW3D) allqueue(event, 1); // 1=do header too - else if(event>REDRAWVIEW3D) allqueue(event, 0); -} - -static void butspace_context_switch(SpaceButs *buts, Object *new) -{ - // change type automatically - if(new) { - int tab= buts->tab[CONTEXT_SHADING]; - - if(tab == TAB_SHADING_WORLD) { - if(new->type==OB_CAMERA); - else if(new->type==OB_LAMP) { - buts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP; - } - else buts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT; - - } - else if(tab == TAB_SHADING_TEX) { - if(new->type==OB_LAMP) buts->texfrom= 2; - else if(new->type==OB_CAMERA) buts->texfrom= 1; - else buts->texfrom= 0; - } - else if(tab == TAB_SHADING_RAD) { - } - else if(new->type==OB_CAMERA) { - buts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD; - } - else if(new->type==OB_LAMP) { - buts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP; - } - else { - buts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT; - } - } -} - -/* new active object */ -void redraw_test_buttons(Object *new) -{ - ScrArea *sa; - SpaceButs *buts; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - - if(ELEM5(buts->mainb, CONTEXT_OBJECT, CONTEXT_EDITING, CONTEXT_SHADING, CONTEXT_LOGIC, CONTEXT_SCRIPT)) { - addqueue(sa->win, REDRAW, 1); - buts->re_align= 1; - - if(new && buts->mainb==CONTEXT_SHADING) { - /* does node previews too... */ - BIF_preview_changed(ID_TE); - } - } - // always do context switch - if(new) butspace_context_switch(buts, new); - - } - sa= sa->next; - } -} - - -/* callback */ -void drawbutspace(ScrArea *sa, void *spacedata) -{ - ID *id, *idfrom; - SpaceButs *sbuts= sa->spacedata.first; - View2D *v2d= &sbuts->v2d; - float col[3]; - int tab, align=0; - - /* context */ - buttons_active_id(&id, &idfrom); - G.buts->lockpoin= id; - - myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - uiSetButLock(G.scene->id.lib!=0, ERROR_LIBDATA_MESSAGE); - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - /* select the context to be drawn, per contex/tab the actual context is tested */ - switch(sbuts->mainb) { - case CONTEXT_SCENE: - tab= sbuts->tab[CONTEXT_SCENE]; - - if(tab== TAB_SCENE_RENDER) - render_panels(); - else if(tab == TAB_SCENE_ANIM) - anim_panels(); - else if(tab == TAB_SCENE_SOUND) - sound_panels(); - - break; - case CONTEXT_OBJECT: - tab= sbuts->tab[CONTEXT_OBJECT]; - - if(tab==TAB_OBJECT_OBJECT) - object_panels(); - else if(tab==TAB_OBJECT_PHYSICS) - physics_panels(); - else if(tab==TAB_OBJECT_PARTICLE) - particle_panels(); - - break; - case CONTEXT_SHADING: - tab= sbuts->tab[CONTEXT_SHADING]; - - if(tab==TAB_SHADING_MAT) - material_panels(); - else if(tab==TAB_SHADING_LAMP) - lamp_panels(); - else if(tab==TAB_SHADING_WORLD) - world_panels(); - else if(tab==TAB_SHADING_RAD) - radio_panels(); - else if(tab==TAB_SHADING_TEX) - texture_panels(); - - break; - case CONTEXT_EDITING: - /* no tabs */ - editing_panels(); - - break; - case CONTEXT_SCRIPT: - script_panels(); - - break; - case CONTEXT_LOGIC: - /* no tabs */ - logic_buts(); - break; - } - - uiClearButLock(); - - /* when align changes, also do this for new panels */ - /* don't always align, this function is called during AnmatePanels too */ - if(sbuts->align) - if(sbuts->re_align || sbuts->mainbo!=sbuts->mainb || sbuts->tabo!=sbuts->tab[sbuts->mainb]) - align= 1; - - uiDrawBlocksPanels(sa, align); - - /* since panels give different layouts, we have to make sure v2d.tot matches */ - uiMatchPanel_view2d(sa); - - sbuts->re_align= 0; - // also for memory for finding which texture you'd like to see - sbuts->mainbo= sbuts->mainb; - sbuts->tabo= sbuts->tab[sbuts->mainb]; - - myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375); - draw_area_emboss(sa); - myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); - - /* always in end */ - sa->win_swap= WIN_BACK_OK; -} - - diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c deleted file mode 100644 index ca878933499..00000000000 --- a/source/blender/src/buttons_editing.c +++ /dev/null @@ -1,6153 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef WIN32 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - -#include "MEM_guardedalloc.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_camera_types.h" -#include "DNA_color_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_group_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_meta_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" -#include "DNA_radio_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vfont_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -#include "DNA_packedFile_types.h" - -#include "BKE_blender.h" -#include "BKE_brush.h" -#include "BKE_curve.h" -#include "BKE_customdata.h" -#include "BKE_colortools.h" -#include "BKE_deform.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_packedFile.h" -#include "BKE_particle.h" -#include "BKE_scene.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_vfontdata.h" -#include "BLI_editVert.h" -#include "BLI_dynstr.h" - -#include "BSE_filesel.h" - -#include "BIF_gl.h" -#include "BIF_editarmature.h" -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_editfont.h" -#include "BIF_editkey.h" -#include "BIF_editmesh.h" -#include "BIF_editparticle.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_scrarea.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_previewrender.h" -#include "BIF_butspace.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "mydevice.h" -#include "blendef.h" - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_displist.h" -#include "BKE_DerivedMesh.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_icons.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BIF_poseobject.h" - -#include "BDR_drawobject.h" -#include "BDR_editcurve.h" -#include "BDR_editface.h" -#include "BDR_editobject.h" -#include "BDR_sculptmode.h" -#include "BDR_vpaint.h" -#include "BDR_unwrapper.h" - -#include "BSE_drawview.h" -#include "BSE_editipo.h" -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" -#include "BSE_seqaudio.h" - -#include "RE_render_ext.h" // make_sticky - -#include "butspace.h" // own module -#include "multires.h" - -static float editbutweight= 1.0; -float editbutvweight= 1; -static int actmcol= 0, acttface= 0, acttface_rnd = 0, actmcol_rnd = 0; - -extern ListBase editNurb; - -/* *************************** Unicode Character Groups ****************** */ -unicodect uctabname[125] = { - {"All", "All", 0x0000, 0xffff}, - {"Basic Latin", "Basic Latin", 0x0000, 0x007f}, - {"Latin 1 Supp", "Latin-1 Supplement", 0x0080, 0x00ff}, - - {"Latin Ext. A.", "Latin Extended-A", 0x0100, 0x017F}, - {"Latin Ext. B.", "Latin Extended-B", 0x0180,0x024F}, - {"Latin Ext. Add.", "Latin Extended Additional", 0x1e00, 0x1eff}, - - {"IPA Ext", "IPA Extensions", 0x0250, 0x02AF}, - {"Spacing Mod.", "Spacing Modifier Letters", 0x02b0, 0x02ff}, - - {"Comb. Dia.", "Combining Diacritical Marks", 0x0300, 0x036F}, - {"Greek, Coptic", "Greek and Coptic", 0x0370, 0x03ff}, - {"Greek Ext.", "Greek Extended", 0x1f00, 0x1fff}, - - {"Cyrillic", "Cyrillic", 0x0400, 0x04ff}, - {"Cyrillic Supp.", "Cyrillic Supplementary", 0x0500, 0x052f}, - - {"Armenian", "Armenian", 0x0530, 0x058f}, - {"Hebrew", "Hebrew", 0x0590, 0x05ff}, - - - {"Arabic", "Arabic", 0x0600, 0x06ff}, - {"Syriac", "Syriac", 0x0700, 0x074f}, - - {"Thaana", "Thaana", 0x0780, 0x07bf}, - {"Devanagari", "Devanagari", 0x0900, 0x097f}, - - {"Bengali", "Bengali", 0x0980, 0x09ff}, - {"Gurmukhi", "Gurmukhi", 0x0a00, 0x0a7f}, - - {"Gujarati", "Gujarati", 0x0a80, 0x0aff}, - {"Oriya", "Oriya", 0x0b00, 0x0b7f}, - - {"Tamil", "Tamil", 0x0b80, 0x0bff}, - {"Tegulu", "Tegulu", 0x0c00, 0x0c7f}, - - {"Kannada", "Kannada", 0x0c80, 0x0cff}, - {"Malayalam", "Malayalam", 0x0d00, 0x0d7f}, - - {"Sinhala", "Sinhala", 0x0d80, 0x0dff}, - {"Thai", "Thai", 0x0e00, 0x0e7f}, - - {"Lao", "Lao", 0x0e80, 0x0eff}, - {"Tibetan", "Tibetan", 0x0f00, 0x0fff}, - - {"Myanmar", "Myanmar", 0x1000, 0x109f}, - {"Georgian", "Georgian", 0x10a0, 0x10ff}, - - {"Ethiopic", "Ethiopic", 0x1200, 0x137f}, - - {"Cherokee", "Cherokee", 0x13a0, 0x13ff}, - {"Unif. Canadian", "Unified Canadian Aboriginal Syllabics", 0x1400, 0x167f}, - - {"Ogham", "Ogham", 0x1680, 0x169f}, - {"Runic", "Runic", 0x16a0, 0x16ff}, - - {"Tagalog", "Tagalog", 0x1700, 0x171f}, - {"Hanunoo", "Hanunoo", 0x1720, 0x173f}, - - {"Buhid", "Buhid", 0x1740, 0x175f}, - {"Tagbanwa", "Tagbanwa", 0x1760, 0x177f}, - - {"Khmer", "Khmer", 0x1780, 0x17ff}, - {"Khmer Symb", "Khmer Symbols", 0x19e0, 0x19ff}, - - {"Mongolian", "Mongolian", 0x1800, 0x18af}, - - {"Limbu", "Limbu", 0x1900, 0x194f}, - {"Tai Le", "Tai Le", 0x1950, 0x197f}, - - {"Phon. Ext.", "Phonetic Extensions", 0x1d00, 0x1d7f}, - - - {"Gen. Punct.", "General Punctutation", 0x2000, 0x206f}, - {"Super, Sub", "Superscripts and Subscripts", 0x2070, 0x209f}, - - {"Curr. Symb.", "Currency Symbols", 0x20a0, 0x20cf}, - {"Comb. Diacrit.", "Combining Diacritical Marks for Symbols", 0x20d0, 0x20ff}, - - {"Letter Symb", "Letterlike Symbols", 0x2100, 0x214f}, - {"Numb. Forms", "Number Forms", 0x2150, 0x218f}, - - {"Arrows", "Arrows", 0x2190, 0x21ff}, - {"Math Oper.", "Mathematical Operators", 0x2200, 0x22ff}, - - {"Misc. Tech.", "Miscellaneous Technical", 0x2300, 0x23ff}, - {"Ctrl. Pict.", "Control Pictures", 0x2400, 0x243f}, - - {"OCR", "Optical Character Recognition", 0x2440, 0x245f}, - {"Enc. Alpha", "Enclosed Alphanumerics", 0x2460, 0x24ff}, - - {"Bow Drawing", "Box Drawing", 0x2500, 0x257f}, - {"BLock Elem.", "Block Elements", 0x2580, 0x259f}, - - {"Geom. Shapes", "Geometric Shapes", 0x25a0, 0x25ff}, - {"Misc. Symb.", "Miscellaneous Symbols", 0x2600, 0x26ff}, - - {"Dingbats", "Dingbats", 0x2700, 0x27bf}, - {"Misc. Math A", "Miscellaneous Mathematical Symbols-A", 0x27c0, 0x27ef}, - - {"Supp. Arrows-A", "Supplemental Arrows-A", 0x27f0, 0x27ff}, - {"Braille Pat.", "Braille Patterns", 0x2800, 0x28ff}, - - {"Supp. Arrows-B", "Supplemental Arrows-B", 0x2900, 0x297f}, - {"Misc. Math B", "Miscellaneous Mathematical Symbols-B", 0x2980, 0x29ff}, - - {"Supp. Math Op.", "Supplemental Mathematical Operators", 0x2a00, 0x2aff}, - {"Misc. Symb.", "Miscellaneous Symbols and Arrows", 0x2b00, 0x2bff}, - - {"Kangxi Rad.", "Kangxi Radicals", 0x2f00, 0x2fdf}, - - {"Ideographic", "Ideographic Description Characters", 0x2ff0, 0x2fff}, - - {"Hiragana", "Hiragana", 0x3040, 0x309f}, - {"Katakana", "Katakana", 0x30a0, 0x30ff}, - {"Katakana Ext.", "Katakana Phonetic Extensions", 0x31f0, 0x31ff}, - - {"Bopomofo", "Bopomofo", 0x3100, 0x312f}, - {"Bopomofo Ext.", "Bopomofo Extended", 0x31a0, 0x31bf}, - - {"Hangul", "Hangul Jamo", 0x1100, 0x11ff}, - {"Hangul Comp.", "Hangul Compatibility Jamo", 0x3130, 0x318f}, - {"Hangul Syll.", "Hangul Syllables", 0xac00, 0xd7af}, - - {"Kanbun", "Kanbun", 0x3190, 0x319f}, - - - - {"Yijing Hex.", "Yijing Hexagram Symbols", 0x4dc0, 0x4dff}, - - {"Yi Syllables", "Yi Syllables", 0xa000, 0xa48f}, - {"Yi Radicals", "Yi Radicals", 0xa490, 0xa4cf}, - - {"High Surr.", "High Surrogate Area", 0xd800, 0xdbff}, - - {"Low Surr.", "Low Surrogates", 0xdc00, 0xdfff}, - {"Priv. Use Area", "Private Use Area", 0xe000, 0xf8ff}, - - {"CJK Rad. Supp.", "CJK Radicals Supplement", 0x2e80, 0x2eff}, - {"CJK Ideographs", "CJK Unified Ideographs", 0x4e00, 0x9faf}, - {"CJK Ideog. Ext. A", "CJK Unified Ideographs Extension A", 0x3400, 0x4dbf}, - {"CJK Ideog. Ext. B", "CJK Unified Ideographs Extension B", 0x20000, 0x2a6df}, - {"CJK Symbols.", "CJK Symbols and Punctuation", 0x3000, 0x303f}, - {"Enclosed CJK", "Enclosed CJK Letters and Months", 0x3200, 0x32ff}, - {"CJK Comp.", "CJK Compatibility", 0x3300, 0x33ff}, - {"CJK Comp. Ideog.", "CJK Compatibility Ideographs", 0xf900, 0xfaff}, - {"CJK Comp. Forms", "CJK Compatibility Forms", 0xfe30, 0xfe4f}, - {"CJK Comp. Supp.", "CJK Compatibility Ideographs Supplement", 0x2f800, 0x2fa1f}, - - {"Alpha. Pres. Forms", "Alphabetic Presentation Forms", 0xfb00, 0xfb4f}, - - {"Arabic Pres. A", "Arabic Presentation Forms-A", 0xfb50, 0xfdff}, - {"Arabic Pres. B", "Arabic Presentation Forms-B", 0xfe70, 0xfeff}, - - {"Var. Sel.", "Variation Selectors", 0xfe00, 0xfe0f}, - - {"Comb. Half", "Combining Half Marks", 0xfe20, 0xfe2f}, - - {"Sml. From Var.", "Small Form Variants", 0xfe50, 0xfe6f}, - - {"Half, Full Forms", "Halfwidth and Fullwidth Forms", 0xff00, 0xffef}, - {"Specials", "Specials", 0xfff0, 0xffff}, - - {"Lin. B Syllab.", "Linear B Syllabary", 0x10000, 0x1007f}, - {"Lin. B Idog.", "Linear B Ideograms", 0x10080, 0x100ff}, - - {"Aegean Num.", "Aegean Numbers", 0x10100, 0x1013f}, - {"Old Italic", "Old Italic", 0x10300, 0x1032f}, - - {"Gothic", "Gothic", 0x10330, 0x1034f}, - {"Ugaritic", "Ugaritic", 0x10380, 0x1039f}, - - {"Deseret", "Deseret", 0x10400, 0x1044f}, - {"Shavian", "Shavian", 0x10450, 0x1047f}, - - {"Osmanya", "Osmanya", 0x10480, 0x104af}, - {"Cypriot Syll", "Cypriot Syllabary", 0x10800, 0x1083f}, - - {"Bysantine Mus.", "Bysantine Musical Symbols", 0x1d000, 0x1d0ff}, - {"Music Symb.", "Musical Symbols", 0x1d100, 0x1d1ff}, - - {"Tai Xuan Symb", "Tai Xuan Jing Symbols", 0x1d300, 0x1d35f}, - {"Math. Alpha Symb.", "Mathematical Alpanumeric Symbols", 0x1d400, 0x1d7ff}, - - - {"Tags", "Tags", 0xe0000, 0xe007f}, - {"Var. Supp", "Variation Selectors Supplement", 0xe0100, 0xe01ef}, - - {"Supp. Priv. A", "Supplementary Private Use Area-A", 0xf0000, 0xffffd}, - {"Supp. Priv. B", "Supplementary Private Use Area-B", 0x100000, 0x10fffd} -}; - - -/* *************************** static functions prototypes ****************** */ -VFont *exist_vfont(char *str); - -/* *************** */ - -void do_common_editbuts(unsigned short event) // old name, is a mix of object and editing events.... -{ - EditMesh *em = G.editMesh; - EditFace *efa; - Base *base; - Object *ob= OBACT; - Material *ma; - Nurb *nu; - Curve *cu; - BezTriple *bezt; - BPoint *bp; - unsigned int local; - int a, bit, index= -1; - - switch(event) { - - case B_MATWICH: - if(G.obedit && G.obedit->actcol>0) { - if(G.obedit->type == OB_MESH) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - if(index== -1) index= efa->mat_nr; - else if(index!=efa->mat_nr) { - error("Mixed colors"); - return; - } - } - } - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nu= editNurb.first; - while(nu) { - if( isNurbsel(nu) ) { - if(index== -1) index= nu->mat_nr; - else if(index!=nu->mat_nr) { - error("Mixed colors"); - return; - } - } - nu= nu->next; - } - } - if(index>=0) { - G.obedit->actcol= index+1; - scrarea_queue_winredraw(curarea); - } - } - break; - case B_MATNEW: - new_material_to_objectdata(ob); - scrarea_queue_winredraw(curarea); - BIF_undo_push("New material"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D_Z, 0); - allqueue(REDRAWOOPS, 0); - break; - case B_MATDEL: - delete_material_index(); - scrarea_queue_winredraw(curarea); - BIF_undo_push("Delete material index"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D_Z, 0); - allqueue(REDRAWOOPS, 0); - break; - case B_MATASS: - if(G.obedit && G.obedit->actcol>0) { - if(G.obedit->type == OB_MESH) { - efa= em->faces.first; - while(efa) { - if(efa->f & SELECT) - efa->mat_nr= G.obedit->actcol-1; - efa= efa->next; - } - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nu= editNurb.first; - while(nu) { - if( isNurbsel(nu) ) - nu->mat_nr= nu->charidx= G.obedit->actcol-1; - nu= nu->next; - } - } - else if (G.obedit->type == OB_FONT) { - if (mat_to_sel()) { - allqueue(REDRAWVIEW3D, 0); - } - } - allqueue(REDRAWVIEW3D_Z, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - shade_buttons_change_3d(); - BIF_undo_push("Assign material index"); - } - break; - case B_MATASS_BROWSE: - /* if slot available, make that index active, and assign */ - /* else, make new slot, and assign */ - ma= BLI_findlink(&G.main->mat, G.buts->menunr-1); - if(ma) { - ob->actcol= find_material_index(ob, ma); - if(ob->actcol==0) { - assign_material(ob, ma, ob->totcol+1); - ob->actcol= ob->totcol; - } - } - else { - do_common_editbuts(B_MATNEW); - } - do_common_editbuts(B_MATASS); - break; - - case B_MATCOL2: - ma= give_current_material(ob, ob->actcol); - BKE_icon_changed(BKE_icon_getid((ID *)ma)); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_MATSEL: - case B_MATDESEL: - if(G.obedit) { - if(G.obedit->type == OB_MESH) { - if (event==B_MATSEL) { - editmesh_select_by_material(G.obedit->actcol-1); - } else { - editmesh_deselect_by_material(G.obedit->actcol-1); - } - allqueue(REDRAWVIEW3D, 0); - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nu= editNurb.first; - while(nu) { - if(nu->mat_nr==G.obedit->actcol-1) { - if(nu->bezt) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if(bezt->hide==0) { - if(event==B_MATSEL) { - bezt->f1 |= SELECT; - bezt->f2 |= SELECT; - bezt->f3 |= SELECT; - } - else { - bezt->f1 &= ~SELECT; - bezt->f2 &= ~SELECT; - bezt->f3 &= ~SELECT; - } - } - bezt++; - } - } - else if(nu->bp) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if(bp->hide==0) { - if(event==B_MATSEL) bp->f1 |= SELECT; - else bp->f1 &= ~SELECT; - } - bp++; - } - } - } - nu= nu->next; - } - BIF_undo_push("Select material index"); - allqueue(REDRAWVIEW3D, 0); - } - } - countall(); - break; - case B_HIDE: - if(G.obedit) { - if(G.obedit->type == OB_MESH) hide_mesh(0); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) hideNurb(0); - } - break; - case B_REVEAL: - if(G.obedit) { - if(G.obedit->type == OB_MESH) reveal_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) revealNurb(); - } - else if(FACESEL_PAINT_TEST) reveal_tface(); - - break; - case B_SELSWAP: - if(G.obedit) { - if(G.obedit->type == OB_MESH) selectswap_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) selectswapNurb(); - } - break; - case B_AUTOTEX: - if(ob && G.obedit==0) { - if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data); - } - break; - case B_DOCENTER: - docenter(0); - break; - case B_DOCENTERNEW: - docenter_new(); - break; - case B_DOCENTERCURSOR: - docenter_cursor(); - break; - case B_SETSMOOTH: - case B_SETSOLID: - if(G.obedit) { - if(G.obedit->type == OB_MESH) { - mesh_set_smooth_faces((event==B_SETSMOOTH)); - } - else { - nurb_set_smooth((event==B_SETSMOOTH)); - } - } - else if(G.vd) { - base= FIRSTBASE; - while(base) { - if(TESTBASELIB(base)) { - if(base->object->type==OB_MESH) { - mesh_set_smooth_flag(base->object, (event==B_SETSMOOTH)); - } - else if ELEM(base->object->type, OB_SURF, OB_CURVE) { - cu= base->object->data; - nu= cu->nurb.first; - while(nu) { - if(event==B_SETSMOOTH) nu->flag |= ME_SMOOTH; - else nu->flag &= ~ME_SMOOTH; - nu= nu->next; - } - makeDispListCurveTypes(base->object, 0); - } - } - base= base->next; - } - allqueue(REDRAWVIEW3D, 0); - - if(event == B_SETSMOOTH) BIF_undo_push("Set Smooth"); - else BIF_undo_push("Set Solid"); - } - break; - case B_CHANGEDEP: - DAG_scene_sort(G.scene); // makes new dag - if(ob) ob->recalc |= OB_RECALC; - allqueue(REDRAWVIEW3D, 0); - break; - - case B_ADDKEY: - insert_shapekey(ob); - break; - case B_SETKEY: - ob->shapeflag |= OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_LOCKKEY: - ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_NEXTKEY: - { - Key *key= ob_get_key(ob); - if(ob->shapenr == BLI_countlist(&key->block)) - ob->shapenr= 1; - else ob->shapenr++; - do_common_editbuts(B_SETKEY); - break; - } - case B_PREVKEY: - { - Key *key= ob_get_key(ob); - if(ob->shapenr <= 1) - ob->shapenr= BLI_countlist(&key->block); - else ob->shapenr--; - do_common_editbuts(B_SETKEY); - break; - } - case B_NAMEKEY: - allspace(REMAKEIPO, 0); - allqueue (REDRAWIPO, 0); - break; - case B_DELKEY: - delete_key(OBACT); - allqueue(REDRAWACTION, 0); - break; - - - default: - if (G.vd==NULL) - break; - - if(event>=B_OBLAY && event<=B_OBLAY+31) { - local= BASACT->lay & 0xFF000000; - BASACT->lay -= local; - if(BASACT->lay==0 || (G.qual & LR_SHIFTKEY)==0) { - bit= event-B_OBLAY; - BASACT->lay= 1<lay += local; - /* optimal redraw */ - if( (ob->lay & G.vd->lay) && (BASACT->lay & G.vd->lay) ); - else if( (ob->lay & G.vd->lay)==0 && (BASACT->lay & G.vd->lay)==0 ); - else { - allqueue(REDRAWVIEW3D, 0); - DAG_scene_sort(G.scene); - } - ob->lay= BASACT->lay; - } - } - -} - -/* *************************** MESH ******************************** */ - -static void verify_customdata_name_func(void *data1, void *data2) -{ - CustomData *data= (CustomData*)data1; - CustomDataLayer *layer= (CustomDataLayer*)data2; - - CustomData_set_layer_unique_name(data, layer - data->layers); -} - -static void delete_customdata_layer(void *data1, void *data2) -{ - Mesh *me= (Mesh*)data1; - CustomData *data= (G.obedit)? &G.editMesh->fdata: &me->fdata; - CustomDataLayer *layer= (CustomDataLayer*)data2; - void *actlayerdata, *rndlayerdata, *layerdata=layer->data; - int type= layer->type; - int index= CustomData_get_layer_index(data, type); - int i, actindex, rndindex; - - /*ok, deleting a non-active layer needs to preserve the active layer indices. - to do this, we store a pointer to the .data member of both layer and the active layer, - (to detect if we're deleting the active layer or not), then use the active - layer data pointer to find where the active layer has ended up. - - this is necassary because the deletion functions only support deleting the active - layer. */ - actlayerdata = data->layers[CustomData_get_active_layer_index(data, type)].data; - rndlayerdata = data->layers[CustomData_get_render_layer_index(data, type)].data; - CustomData_set_layer_active(data, type, layer - &data->layers[index]); - - /* Multires is handled seperately because the display data is separate - from the data stored in multires */ - if(me && me->mr) { - multires_delete_layer(me, &me->mr->fdata, type, layer - &data->layers[index]); - } - else if(G.obedit) { - EM_free_data_layer(data, type); - } - else if(me) { - CustomData_free_layer_active(data, type, me->totface); - mesh_update_customdata_pointers(me); - } - - if(!CustomData_has_layer(data, type)) { - if(type == CD_MCOL && (G.f & G_VERTEXPAINT)) - G.f &= ~G_VERTEXPAINT; /* get out of vertexpaint mode */ - } - - /*reconstruct active layer*/ - if (actlayerdata != layerdata) { - /*find index. . .*/ - actindex = CustomData_get_layer_index(data, type); - for (i=actindex; itotlayer; i++) { - if (data->layers[i].data == actlayerdata) { - actindex = i - actindex; - break; - } - } - - /*set index. . .*/ - CustomData_set_layer_active(data, type, actindex); - } - - if (rndlayerdata != layerdata) { - /*find index. . .*/ - rndindex = CustomData_get_layer_index(data, type); - for (i=rndindex; itotlayer; i++) { - if (data->layers[i].data == rndlayerdata) { - rndindex = i - rndindex; - break; - } - } - - /*set index. . .*/ - CustomData_set_layer_render(data, type, rndindex); - } - - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - - if(type == CD_MTFACE) - BIF_undo_push("Delete UV Texture"); - else if(type == CD_MCOL) - BIF_undo_push("Delete Vertex Color"); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - -static int customdata_buttons( - uiBlock *block, Mesh *me, CustomData *data, - int type, int *activep, int *renderp, - int setevt, int setevt_rnd, int newevt, - char *label, char *shortlabel, char *browsetip, char *browsetip_rnd, - char *newtip, char *deltip, int x, int y) -{ - CustomDataLayer *layer; - uiBut *but; - int i, count= CustomData_number_of_layers(data, type); - - if(count >= MAX_MTFACE) { - uiDefBut(block, LABEL, 0, label, x,y,220,19, 0, 0.0, 0, 0, 0, ""); - } - else { - uiDefBut(block, LABEL, 0, label, x,y,140,19, 0, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefBut(block, BUT, newevt, "New", x+140,y,80,19, 0,0,0,0,0, newtip); - uiBlockEndAlign(block); - } - - y -= (count)? 24: 19; - - uiBlockBeginAlign(block); - for (count=1, i=0; itotlayer; i++) { - layer= &data->layers[i]; - - if(layer->type == type) { - *activep= layer->active + 1; - *renderp= layer->active_rnd + 1; - - uiDefIconButI(block, ROW, setevt, ICON_VIEW3D, x,y,25,19, activep, 1.0, count, 0, 0, browsetip); - uiDefIconButI(block, ROW, setevt_rnd, ICON_SCENE, x+25,y,25,19, renderp, 1.0, count, 0, 0, browsetip_rnd); - but=uiDefBut(block, TEX, setevt, "", x+50,y,145,19, layer->name, 0.0, 31.0, 0, 0, label); - uiButSetFunc(but, verify_customdata_name_func, data, layer); - but= uiDefIconBut(block, BUT, B_NOP, VICON_X, x+195,y,25,19, NULL, 0.0, 0.0, 0.0, 0.0, deltip); - uiButSetFunc(but, delete_customdata_layer, me, layer); - - - count++; - y -= 19; - } - } - uiBlockEndAlign(block); - - return y; -} - -static void editing_panel_mesh_type(Object *ob, Mesh *me) -{ - uiBlock *block; - uiBut *but; - float val; - CustomData *fdata; - int yco; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_type", UI_EMBOSS, UI_HELV, curarea->win); - if( uiNewPanel(curarea, block, "Mesh", "Editing", 320, 0, 318, 204)==0) return; - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ME_AUTOSMOOTH, REDRAWVIEW3D, "Auto Smooth",10,180,170,19, &me->flag, 0, 0, 0, 0, "Treats all set-smoothed faces with angles less than Degr: as 'smooth' during render"); - uiDefButS(block, NUM, B_DIFF, "Degr:", 10,160,170,19, &me->smoothresh, 1, 80, 0, 0, "Defines maximum angle between face normals that 'Auto Smooth' will operate on"); - uiBlockEndAlign(block); - - /* Retopo */ - if(G.obedit) { - uiBlockBeginAlign(block); - but= uiDefButBitC(block,TOG,RETOPO,B_NOP, "Retopo", 10,130,170,19, &G.scene->toolsettings->retopo_mode, 0,0,0,0, "Turn on the re-topology tool"); - uiButSetFunc(but,retopo_toggle,ob,me); - if(G.scene->toolsettings->retopo_mode) { - but= uiDefButBitC(block,TOG,RETOPO_PAINT,B_NOP,"Paint", 10,110,55,19, &G.scene->toolsettings->retopo_mode,0,0,0,0, "Draw intersecting lines in the 3d view, ENTER creates quad or tri faces, wrapped onto other objects in the 3d view."); - uiButSetFunc(but,retopo_paint_toggle,ob,me); - but= uiDefBut(block,BUT,B_NOP,"Retopo All", 65,110,115,19, 0,0,0,0,0, "Apply the re-topology tool to all selected vertices"); - uiButSetFunc(but,retopo_do_all_cb,ob,me); - } - uiBlockEndAlign(block); - } - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_DOCENTER, "Center", 10, 80, 65, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin"); - uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 75, 80, 105, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data"); - uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ME_TWOSIDED, REDRAWVIEW3D, "Double Sided", 10,30,170,19, &me->flag, 0, 0, 0, 0, "Render/display the mesh as double or single sided"); - uiDefButBitS(block, TOG, ME_NOPUNOFLIP, REDRAWVIEW3D, "No V.Normal Flip", 10,10,170,19, &me->flag, 0, 0, 0, 0, "Disables flipping of vertexnormals during render"); - uiBlockEndAlign(block); - - uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, B_REDR, "TexMesh: ", 190,180,220,19, &me->texcomesh, "Derive texture coordinates from another mesh."); - - if(me->msticky) val= 1.0; else val= 0.0; - uiDefBut(block, LABEL, 0, "Sticky", 190,155,140,19, 0, val, 0, 0, 0, ""); - uiBlockBeginAlign(block); - if(me->msticky==NULL) { - uiDefBut(block, BUT, B_MAKESTICKY, "Make", 330,155, 80,19, 0, 0, 0, 0, 0, "Creates Sticky coordinates from the current camera view background picture"); - } - else uiDefBut(block, BUT, B_DELSTICKY, "Delete", 330,155, 80,19, 0, 0, 0, 0, 0, "Deletes Sticky texture coordinates"); - uiBlockEndAlign(block); - - fdata= (G.obedit)? &G.editMesh->fdata: &me->fdata; - yco= customdata_buttons(block, me, fdata, CD_MTFACE, &acttface, &acttface_rnd, - B_SETTFACE, B_SETTFACE_RND, B_NEWTFACE, "UV Texture", "UV Texture:", - "Set active UV texture", "Set rendering UV texture", "Creates a new UV texture layer", - "Removes the current UV texture layer", 190, 130); - - yco= customdata_buttons(block, me, fdata, CD_MCOL, &actmcol, &actmcol_rnd, - B_SETMCOL, B_SETMCOL_RND, B_NEWMCOL, "Vertex Color", "Vertex Color:", - "Sets active vertex color layer", "Sets rendering vertex color layer", "Creates a new vertex color layer", - "Removes the current vertex color layer", 190, yco-5); - - if(yco < 0) - uiNewPanelHeight(block, 204 - yco); -} - -/* *************************** MODIFIERS ******************************** */ - -void do_modifier_panels(unsigned short event) -{ - Object *ob = OBACT; - - switch(event) { - case B_MODIFIER_REDRAW: - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - break; - - case B_MODIFIER_RECALC: - ob->softflag |= OB_SB_RESET; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWOOPS, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - object_handle_update(ob); - countall(); - break; - } -} - -static void modifiers_add(void *ob_v, int type) -{ - Object *ob = ob_v; - ModifierTypeInfo *mti = modifierType_getInfo(type); - - if (mti->flags&eModifierTypeFlag_RequiresOriginalData) { - ModifierData *md = ob->modifiers.first; - - while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) { - md = md->next; - } - - BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); - } else { - BLI_addtail(&ob->modifiers, modifier_new(type)); - } - BIF_undo_push("Add modifier"); -} - -typedef struct MenuEntry { - char *name; - int ID; -} MenuEntry; - -static int menuEntry_compare_names(const void *entry1, const void *entry2) -{ - return strcmp(((MenuEntry *)entry1)->name, ((MenuEntry *)entry2)->name); -} - -static uiBlock *modifiers_add_menu(void *ob_v) -{ - Object *ob = ob_v; - uiBlock *block; - int i, yco=0; - int numEntries = 0; - MenuEntry entries[NUM_MODIFIER_TYPES]; - - block= uiNewBlock(&curarea->uiblocks, "modifier_add_menu", - UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, modifiers_add, ob); - - for (i=eModifierType_None+1; iflags&eModifierTypeFlag_AcceptsCVs) || - (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) { - entries[numEntries].name = mti->name; - entries[numEntries].ID = i; - - ++numEntries; - } - } - - qsort(entries, numEntries, sizeof(*entries), menuEntry_compare_names); - - - for(i = 0; i < numEntries; ++i) - uiDefBut(block, BUTM, B_MODIFIER_RECALC, entries[i].name, - 0, yco -= 20, 160, 19, NULL, 0, 0, 1, entries[i].ID, ""); - - uiTextBoundsBlock(block, 50); - uiBlockSetDirection(block, UI_DOWN); - - return block; -} - -static void modifiers_del(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md; - - /* It seems on rapid delete it is possible to - * get called twice on same modifier, so make - * sure it is in list. - */ - for (md=ob->modifiers.first; md; md=md->next) - if (md==md_v) - break; - - if (!md) - return; - - if(md->type==eModifierType_ParticleSystem){ - ParticleSystemModifierData *psmd=(ParticleSystemModifierData*)md; - BLI_remlink(&ob->particlesystem, psmd->psys); - psys_free(ob,psmd->psys); - } - - BLI_remlink(&ob->modifiers, md_v); - - modifier_free(md_v); - - BIF_undo_push("Del modifier"); -} - -int mod_moveUp(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - - if (md->prev) { - ModifierTypeInfo *mti = modifierType_getInfo(md->type); - - if (mti->type!=eModifierTypeType_OnlyDeform) { - ModifierTypeInfo *nmti = modifierType_getInfo(md->prev->type); - - if (nmti->flags&eModifierTypeFlag_RequiresOriginalData) - return -1; - } - - BLI_remlink(&ob->modifiers, md); - BLI_insertlink(&ob->modifiers, md->prev->prev, md); - } - - return 0; -} - -static void modifiers_moveUp(void *ob_v, void *md_v) -{ - if( mod_moveUp( ob_v, md_v ) ) - error("Cannot move above a modifier requiring original data."); - else - BIF_undo_push("Move modifier"); -} - -int mod_moveDown(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - - if (md->next) { - ModifierTypeInfo *mti = modifierType_getInfo(md->type); - - if (mti->flags&eModifierTypeFlag_RequiresOriginalData) { - ModifierTypeInfo *nmti = modifierType_getInfo(md->next->type); - - if (nmti->type!=eModifierTypeType_OnlyDeform) - return -1; - } - - BLI_remlink(&ob->modifiers, md); - BLI_insertlink(&ob->modifiers, md->next, md); - } - - return 0; -} - -static void modifiers_moveDown(void *ob_v, void *md_v) -{ - if( mod_moveDown( ob_v, md_v ) ) - error("Cannot move beyond a non-deforming modifier."); - else - BIF_undo_push("Move modifier"); -} - -static void modifier_testLatticeObj(char *name, ID **idpp) -{ - ID *id; - - for (id= G.main->object.first; id; id= id->next) { - if( strcmp(name, id->name+2)==0 ) { - if (((Object *)id)->type != OB_LATTICE) { - error ("Lattice deform object must be a lattice"); - break; - } - *idpp= id; - return; - } - } - *idpp= 0; -} - -static void modifier_testCurveObj(char *name, ID **idpp) -{ - ID *id; - - for (id= G.main->object.first; id; id= id->next) { - if( strcmp(name, id->name+2)==0 ) { - if (((Object *)id)->type != OB_CURVE) { - error ("Curve deform object must be a curve"); - break; - } - *idpp= id; - return; - } - } - *idpp= 0; -} - -static void modifier_testMeshObj(char *name, ID **idpp) -{ - ID *id; - - for (id= G.main->object.first; id; id= id->next) { - /* no boolean on its own object */ - if(id != (ID *)OBACT) { - if( strcmp(name, id->name+2)==0 ) { - if (((Object *)id)->type != OB_MESH) { - error ("Boolean modifier object must be a mesh"); - break; - } - *idpp= id; - return; - } - } - } - *idpp= NULL; -} - -static void modifier_testArmatureObj(char *name, ID **idpp) -{ - ID *id; - - for (id= G.main->object.first; id; id= id->next) { - if( strcmp(name, id->name+2)==0 ) { - if (((Object *)id)->type != OB_ARMATURE) { - error ("Armature deform object must be an armature"); - break; - } - *idpp= id; - return; - } - } - *idpp= 0; -} - -static void modifier_testTexture(char *name, ID **idpp) -{ - ID *id; - - for(id = G.main->tex.first; id; id = id->next) { - if(strcmp(name, id->name + 2) == 0) { - *idpp = id; - /* texture gets user, objects not: delete object = clear modifier */ - id_us_plus(id); - return; - } - } - *idpp = 0; -} - -#if 0 /* this is currently unused, but could be useful in the future */ -static void modifier_testMaterial(char *name, ID **idpp) -{ - ID *id; - - for(id = G.main->mat.first; id; id = id->next) { - if(strcmp(name, id->name + 2) == 0) { - *idpp = id; - return; - } - } - *idpp = 0; -} -#endif - -static void modifier_testImage(char *name, ID **idpp) -{ - ID *id; - - for(id = G.main->image.first; id; id = id->next) { - if(strcmp(name, id->name + 2) == 0) { - *idpp = id; - return; - } - } - *idpp = 0; -} - -/* autocomplete callback for ID buttons */ -void autocomplete_image(char *str, void *arg_v) -{ - /* search if str matches the beginning of an ID struct */ - if(str[0]) { - AutoComplete *autocpl = autocomplete_begin(str, 22); - ID *id; - - for(id = G.main->image.first; id; id = id->next) - autocomplete_do_name(autocpl, id->name+2); - - autocomplete_end(autocpl, str); - } -} - -/* autocomplete callback for ID buttons */ -void autocomplete_meshob(char *str, void *arg_v) -{ - /* search if str matches the beginning of an ID struct */ - if(str[0]) { - AutoComplete *autocpl = autocomplete_begin(str, 22); - ID *id; - - for(id = G.main->object.first; id; id = id->next) - if(((Object *)id)->type == OB_MESH) - autocomplete_do_name(autocpl, id->name+2); - - autocomplete_end(autocpl, str); - } -} -static void modifiers_convertParticles(void *obv, void *mdv) -{ - Object *obn; - ModifierData *md = mdv; - ParticleSystem *psys; - ParticleCacheKey *key, **cache; - Mesh *me; - MVert *mvert; - MFace *mface; - int a, k, kmax; - int totvert=0, totface=0, cvert=0; - int totpart=0, totchild=0; - - if(md->type != eModifierType_ParticleSystem) return; - - if(G.f & G_PARTICLEEDIT) return; - - psys=((ParticleSystemModifierData *)md)->psys; - - if(psys->part->draw_as != PART_DRAW_PATH || psys->pathcache == 0) return; - - totpart= psys->totcached; - totchild= psys->totchildcache; - - if(totchild && (psys->part->draw&PART_DRAW_PARENT)==0) - totpart= 0; - - /* count */ - cache= psys->pathcache; - for(a=0; acol[3])+1; - totface+= (int)(key->col[3]); - } - - cache= psys->childcache; - for(a=0; acol[3])+1; - totface+= (int)(key->col[3]); - } - - if(totvert==0) return; - - /* add new mesh */ - obn= add_object(OB_MESH); - me= obn->data; - - me->totvert= totvert; - me->totface= totface; - - me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, totvert); - me->mface= CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, totface); - - mvert= me->mvert; - mface= me->mface; - - /* copy coordinates */ - cache= psys->pathcache; - for(a=0; acol[3]); - for(k=0; k<=kmax; k++,key++,cvert++,mvert++) { - VECCOPY(mvert->co,key->co); - if(k){ - mface->v1= cvert-1; - mface->v2= cvert; - mface++; - } - } - } - - cache=psys->childcache; - for(a=0; acol[3]); - for(k=0; k<=kmax; k++,key++,cvert++,mvert++) { - VECCOPY(mvert->co,key->co); - if(k){ - mface->v1=cvert-1; - mface->v2=cvert; - mface++; - } - } - } - make_edges(me, 0); -} -static void modifiers_applyModifier(void *obv, void *mdv) -{ - Object *ob = obv; - ModifierData *md = mdv; - DerivedMesh *dm; - Mesh *me = ob->data; - int converted = 0; - - if (G.obedit) { - error("Modifiers cannot be applied in editmode"); - return; - } else if (((ID*) ob->data)->us>1) { - error("Modifiers cannot be applied to multi-user data"); - return; - } - - if (md!=ob->modifiers.first) { - if (!okee("Modifier is not first")) - return; - } - - if (ob->type==OB_MESH) { - if(me->mr && multires_modifier_warning()) { - error("Modifier changes topology; cannot apply with multires active"); - return; - } - if(me->key) { - error("Modifier cannot be applied to Mesh with Shape Keys"); - return; - } - - sculptmode_pmv_off(me); - - dm = mesh_create_derived_for_modifier(ob, md); - if (!dm) { - error("Modifier is disabled or returned error, skipping apply"); - return; - } - - DM_to_mesh(dm, me); - converted = 1; - - dm->release(dm); - } - else if (ELEM(ob->type, OB_CURVE, OB_SURF)) { - ModifierTypeInfo *mti = modifierType_getInfo(md->type); - Curve *cu = ob->data; - int numVerts; - float (*vertexCos)[3]; - - if (!okee("Apply will only change CV points, not tesselated/bevel vertices")) - return; - - if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md))) { - error("Modifier is disabled, skipping apply"); - return; - } - - vertexCos = curve_getVertexCos(cu, &cu->nurb, &numVerts); - mti->deformVerts(md, ob, NULL, vertexCos, numVerts); - curve_applyVertexCos(cu, &cu->nurb, vertexCos); - - converted = 1; - - MEM_freeN(vertexCos); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else { - error("Cannot apply modifier for this object type"); - return; - } - - if (converted) { - BLI_remlink(&ob->modifiers, md); - modifier_free(md); - - BIF_undo_push("Apply modifier"); - } -} - -static void modifiers_copyModifier(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - ModifierData *nmd = modifier_new(md->type); - - modifier_copyData(md, nmd); - - BLI_insertlink(&ob->modifiers, md, nmd); - - BIF_undo_push("Copy modifier"); -} - -static void modifiers_setOnCage(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md; - - int i, cageIndex = modifiers_getCageIndex(ob, NULL ); - - for( i = 0, md=ob->modifiers.first; md; ++i, md=md->next ) - if( md == md_v ) { - if( i >= cageIndex ) - md->mode ^= eModifierMode_OnCage; - break; - } -} - -static void modifiers_clearHookOffset(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - - if (hmd->object) { - Mat4Invert(hmd->object->imat, hmd->object->obmat); - Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); - BIF_undo_push("Clear hook offset"); - } -} - -static void modifiers_cursorHookCenter(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - - if (G.vd) { - float *curs = give_cursor(); - float bmat[3][3], imat[3][3]; - - where_is_object(ob); - - Mat3CpyMat4(bmat, ob->obmat); - Mat3Inv(imat, bmat); - - curs= give_cursor(); - hmd->cent[0]= curs[0]-ob->obmat[3][0]; - hmd->cent[1]= curs[1]-ob->obmat[3][1]; - hmd->cent[2]= curs[2]-ob->obmat[3][2]; - Mat3MulVecfl(imat, hmd->cent); - - BIF_undo_push("Hook cursor center"); - } -} - -static void modifiers_selectHook(void *ob_v, void *md_v) -{ - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - - hook_select(hmd); -} - -static void modifiers_reassignHook(void *ob_v, void *md_v) -{ - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - float cent[3]; - int *indexar, tot, ok; - char name[32]; - - ok= hook_getIndexArray(&tot, &indexar, name, cent); - - if (!ok) { - error("Requires selected vertices or active Vertex Group"); - } else { - if (hmd->indexar) { - MEM_freeN(hmd->indexar); - } - - VECCOPY(hmd->cent, cent); - hmd->indexar = indexar; - hmd->totindex = tot; - } -} - -static void modifiers_convertToReal(void *ob_v, void *md_v) -{ - Object *ob = ob_v; - ModifierData *md = md_v; - ModifierData *nmd = modifier_new(md->type); - - modifier_copyData(md, nmd); - nmd->mode &= ~eModifierMode_Virtual; - - BLI_addhead(&ob->modifiers, nmd); - - ob->partype = PAROBJECT; - - BIF_undo_push("Modifier convert to real"); -} - -static void build_uvlayer_menu_vars(CustomData *data, char **menu_string, - int *uvlayer_tmp, char *uvlayer_name) -{ - char strtmp[38]; - int totuv, i; - CustomDataLayer *layer - = &data->layers[CustomData_get_layer_index(data, CD_MTFACE)]; - - *uvlayer_tmp = -1; - - totuv = CustomData_number_of_layers(data, CD_MTFACE); - - *menu_string = MEM_callocN(sizeof(**menu_string) * (totuv * 38 + 10), - "menu_string"); - sprintf(*menu_string, "UV Layer%%t"); - for(i = 0; i < totuv; i++) { - /* assign first layer as uvlayer_name if uvlayer_name is null. */ - if(strcmp(layer->name, uvlayer_name) == 0) *uvlayer_tmp = i + 1; - sprintf(strtmp, "|%s%%x%d", layer->name, i + 1); - strcat(*menu_string, strtmp); - layer++; - } - - /* there is no uvlayer defined, or else it was deleted. Assign active - * layer, then recalc modifiers. - */ - if(*uvlayer_tmp == -1) { - if(CustomData_get_active_layer_index(data, CD_MTFACE) != -1) { - *uvlayer_tmp = 1; - layer = data->layers; - for(i = 0; i < CustomData_get_active_layer_index(data, CD_MTFACE); - i++, layer++) { - if(layer->type == CD_MTFACE) (*uvlayer_tmp)++; - } - strcpy(uvlayer_name, layer->name); - - /* update the modifiers */ - do_modifier_panels(B_MODIFIER_RECALC); - } else { - /* ok we have no uv layers, so make sure menu button knows that.*/ - *uvlayer_tmp = 0; - } - } -} - -void set_displace_uvlayer(void *arg1, void *arg2) -{ - DisplaceModifierData *dmd=arg1; - CustomDataLayer *layer = arg2; - - /*check we have UV layers*/ - if (dmd->uvlayer_tmp < 1) return; - layer = layer + (dmd->uvlayer_tmp-1); - - strcpy(dmd->uvlayer_name, layer->name); -} - -void set_uvproject_uvlayer(void *arg1, void *arg2) -{ - UVProjectModifierData *umd=arg1; - CustomDataLayer *layer = arg2; - - /*check we have UV layers*/ - if (umd->uvlayer_tmp < 1) return; - layer = layer + (umd->uvlayer_tmp-1); - - strcpy(umd->uvlayer_name, layer->name); -} - -static void modifiers_bindMeshDeform(void *ob_v, void *md_v) -{ - MeshDeformModifierData *mmd = (MeshDeformModifierData*) md_v; - Object *ob = (Object*)ob_v; - - if(mmd->bindcos) { - if(mmd->bindweights) MEM_freeN(mmd->bindweights); - if(mmd->bindcos) MEM_freeN(mmd->bindcos); - if(mmd->dyngrid) MEM_freeN(mmd->dyngrid); - if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences); - if(mmd->dynverts) MEM_freeN(mmd->dynverts); - mmd->bindweights= NULL; - mmd->bindcos= NULL; - mmd->dyngrid= NULL; - mmd->dyninfluences= NULL; - mmd->dynverts= NULL; - mmd->totvert= 0; - mmd->totcagevert= 0; - mmd->totinfluence= 0; - } - else { - DerivedMesh *dm; - int mode= mmd->modifier.mode; - - /* force modifier to run, it will call binding routine */ - mmd->needbind= 1; - mmd->modifier.mode |= eModifierMode_Realtime; - - if(ob->type == OB_MESH) { - dm= mesh_create_derived_view(ob, 0); - dm->release(dm); - } - else if(ob->type == OB_LATTICE) { - lattice_calc_modifiers(ob); - } - else if(ob->type==OB_MBALL) { - makeDispListMBall(ob); - } - else if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - makeDispListCurveTypes(ob, 0); - } - - mmd->needbind= 0; - mmd->modifier.mode= mode; - } -} - -void modifiers_explodeFacepa(void *arg1, void *arg2) -{ - ExplodeModifierData *emd=arg1; - - emd->flag |= eExplodeFlag_CalcFaces; -} - -static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex) -{ - ModifierTypeInfo *mti = modifierType_getInfo(md->type); - uiBut *but; - int isVirtual = md->mode&eModifierMode_Virtual; - int x = *xco, y = *yco, color = md->error?TH_REDALERT:TH_BUT_NEUTRAL; - int editing = (G.obedit==ob); - short height=26, width = 295, buttonWidth = width-120-10; - char str[128]; - - /* rounded header */ - uiBlockSetCol(block, color); - /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ - uiDefBut(block, ROUNDBOX, 0, "", x-10, y-4, width, 25, NULL, 7.0, 0.0, - (!isVirtual && (md->mode&eModifierMode_Expanded))?3:15, 20, ""); - uiBlockSetCol(block, TH_AUTO); - - /* open/close icon */ - if (!isVirtual) { - uiBlockSetEmboss(block, UI_EMBOSSN); - uiDefIconButBitI(block, ICONTOG, eModifierMode_Expanded, B_MODIFIER_REDRAW, VICON_DISCLOSURE_TRI_RIGHT, x-10, y-2, 20, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Modifier"); - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - if (isVirtual) { - sprintf(str, "%s parent deform", md->name); - uiDefBut(block, LABEL, 0, str, x+10, y-1, width-110, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); - - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Make Real", x+width-100, y, 80, 16, NULL, 0.0, 0.0, 0.0, 0.0, "Convert virtual modifier to a real modifier"); - uiButSetFunc(but, modifiers_convertToReal, ob, md); - } else { - uiBlockBeginAlign(block); - uiDefBut(block, TEX, B_MODIFIER_REDRAW, "", x+10, y-1, buttonWidth-60, 19, md->name, 0.0, sizeof(md->name)-1, 0.0, 0.0, "Modifier name"); - - /* Softbody not allowed in this situation, enforce! */ - if (md->type!=eModifierType_Softbody || !(ob->pd && ob->pd->deflect)) { - uiDefIconButBitI(block, TOG, eModifierMode_Render, B_MODIFIER_RECALC, ICON_SCENE, x+10+buttonWidth-60, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during rendering"); - but= uiDefIconButBitI(block, TOG, eModifierMode_Realtime, B_MODIFIER_RECALC, VICON_VIEW3D, x+10+buttonWidth-40, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during interactive display"); - if (mti->flags&eModifierTypeFlag_SupportsEditmode) { - uiDefIconButBitI(block, TOG, eModifierMode_Editmode, B_MODIFIER_RECALC, VICON_EDIT, x+10+buttonWidth-20, y-1, 19, 19,&md->mode, 0, 0, 1, 0, "Enable modifier during Editmode (only if enabled for display)"); - } - } - uiBlockEndAlign(block); - - uiBlockSetEmboss(block, UI_EMBOSSR); - - if (ob->type==OB_MESH && modifier_couldBeCage(md) && index<=lastCageIndex) { - int icon, color; - - if (index==cageIndex) { - color = TH_BUT_SETTING; - icon = VICON_EDITMODE_HLT; - } else if (indexmode&eModifierMode_Expanded)) { - y -= 18; - } else { - int cy = y - 8; - int lx = x + width - 60 - 15; - - if (md->type==eModifierType_Subsurf) { - height = 105; - } else if (md->type==eModifierType_Lattice) { - height = 48; - } else if (md->type==eModifierType_Curve) { - height = 72; - } else if (md->type==eModifierType_Build) { - height = 86; - } else if (md->type==eModifierType_Mirror) { - height = 86; - } else if (md->type==eModifierType_EdgeSplit) { - EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md; - height = 48; - if(emd->flags & MOD_EDGESPLIT_FROMANGLE) height += 19; - } else if (md->type==eModifierType_Displace) { - DisplaceModifierData *dmd = (DisplaceModifierData *)md; - height = 124; - if(dmd->texmapping == MOD_DISP_MAP_OBJECT || - dmd->texmapping == MOD_DISP_MAP_UV) - height += 19; - } else if (md->type==eModifierType_UVProject) { - height = 114 + ((UVProjectModifierData *)md)->num_projectors * 19; - } else if (md->type==eModifierType_Decimate) { - height = 48; - } else if (md->type==eModifierType_Smooth) { - height = 86; - } else if (md->type==eModifierType_Cast) { - height = 143; - } else if (md->type==eModifierType_Wave) { - WaveModifierData *wmd = (WaveModifierData *)md; - height = 294; - if(wmd->texmapping == MOD_WAV_MAP_OBJECT || - wmd->texmapping == MOD_WAV_MAP_UV) - height += 19; - if(wmd->flag & MOD_WAVE_NORM) - height += 19; - } else if (md->type==eModifierType_Armature) { - height = 105; - } else if (md->type==eModifierType_Hook) { - HookModifierData *hmd = (HookModifierData*) md; - height = 86; - if (editing) - height += 20; - if(hmd->indexar==NULL) - height += 20; - } else if (md->type==eModifierType_Softbody) { - height = 31; - } else if (md->type==eModifierType_Boolean) { - height = 48; - } else if (md->type==eModifierType_Array) { - height = 211; - } else if (md->type==eModifierType_MeshDeform) { - MeshDeformModifierData *mmd= (MeshDeformModifierData*)md; - height = (mmd->bindcos)? 73: 93; - } else if (md->type==eModifierType_ParticleSystem) { - height = 31; - } else if (md->type==eModifierType_ParticleInstance) { - height = 94; - } else if (md->type==eModifierType_Explode) { - height = 94; - } - - /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ - uiDefBut(block, ROUNDBOX, 0, "", x-10, y-height-2, width, height-2, NULL, 5.0, 0.0, 12, 40, ""); - - y -= 18; - - if (!isVirtual) { - uiBlockBeginAlign(block); - if (md->type==eModifierType_ParticleSystem) { - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Convert", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Convert the current particles to a mesh object"); - uiButSetFunc(but, modifiers_convertParticles, ob, md); - } - else{ - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Apply", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Apply the current modifier and remove from the stack"); - uiButSetFunc(but, modifiers_applyModifier, ob, md); - } - - if (md->type!=eModifierType_Softbody && md->type!=eModifierType_ParticleSystem) { - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Copy", lx,(cy-=19),60,19, 0, 0, 0, 0, 0, "Duplicate the current modifier at the same position in the stack"); - uiButSetFunc(but, modifiers_copyModifier, ob, md); - } - uiBlockEndAlign(block); - } - - lx = x + 10; - cy = y + 10 - 1; - uiBlockBeginAlign(block); - if (md->type==eModifierType_Subsurf) { - SubsurfModifierData *smd = (SubsurfModifierData*) md; - char subsurfmenu[]="Subsurf Type%t|Catmull-Clark%x0|Simple Subdiv.%x1"; - uiDefButS(block, MENU, B_MODIFIER_RECALC, subsurfmenu, lx,(cy-=19),buttonWidth,19, &smd->subdivType, 0, 0, 0, 0, "Selects type of subdivision algorithm."); - uiDefButS(block, NUM, B_MODIFIER_RECALC, "Levels:", lx, (cy-=19), buttonWidth,19, &smd->levels, 1, 6, 0, 0, "Number subdivisions to perform"); - uiDefButS(block, NUM, B_MODIFIER_REDRAW, "Render Levels:", lx, (cy-=19), buttonWidth,19, &smd->renderLevels, 1, 6, 0, 0, "Number subdivisions to perform when rendering"); - - /* Disabled until non-EM DerivedMesh implementation is complete */ - - /* - uiDefButBitS(block, TOG, eSubsurfModifierFlag_Incremental, B_MODIFIER_RECALC, "Incremental", lx, (cy-=19),90,19,&smd->flags, 0, 0, 0, 0, "Use incremental calculation, even outside of mesh mode"); - uiDefButBitS(block, TOG, eSubsurfModifierFlag_DebugIncr, B_MODIFIER_RECALC, "Debug", lx+90, cy,buttonWidth-90,19,&smd->flags, 0, 0, 0, 0, "Visualize the subsurf incremental calculation, for debugging effect of other modifiers"); - */ - - uiDefButBitS(block, TOG, eSubsurfModifierFlag_ControlEdges, B_MODIFIER_RECALC, "Optimal Draw", lx, (cy-=19), buttonWidth,19,&smd->flags, 0, 0, 0, 0, "Skip drawing/rendering of interior subdivided edges"); - uiDefButBitS(block, TOG, eSubsurfModifierFlag_SubsurfUv, B_MODIFIER_RECALC, "Subsurf UV", lx, (cy-=19),buttonWidth,19,&smd->flags, 0, 0, 0, 0, "Use subsurf to subdivide UVs"); - } else if (md->type==eModifierType_Lattice) { - LatticeModifierData *lmd = (LatticeModifierData*) md; - uiDefIDPoinBut(block, modifier_testLatticeObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &lmd->object, "Lattice object to deform with"); - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &lmd->name, 0.0, 31.0, 0, 0, "Vertex Group name"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - } else if (md->type==eModifierType_Curve) { - CurveModifierData *cmd = (CurveModifierData*) md; - uiDefIDPoinBut(block, modifier_testCurveObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &cmd->object, "Curve object to deform with"); - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &cmd->name, 0.0, 31.0, 0, 0, "Vertex Group name"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - - uiDefButS(block, ROW,B_MODIFIER_RECALC,"X", lx, (cy-=19), 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSX, 0, 0, "The axis that the curve deforms along"); - uiDefButS(block, ROW,B_MODIFIER_RECALC,"Y", (lx+buttonWidth/6), cy, 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSY, 0, 0, "The axis that the curve deforms along"); - uiDefButS(block, ROW,B_MODIFIER_RECALC,"Z", (lx+2*buttonWidth/6), cy, 19,19, &cmd->defaxis, 12.0, MOD_CURVE_POSZ, 0, 0, "The axis that the curve deforms along"); - uiDefButS(block, ROW,B_MODIFIER_RECALC,"-X", (lx+3*buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGX, 0, 0, "The axis that the curve deforms along"); - uiDefButS(block, ROW,B_MODIFIER_RECALC,"-Y", (lx+4*buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGY, 0, 0, "The axis that the curve deforms along"); - uiDefButS(block, ROW,B_MODIFIER_RECALC,"-Z", (lx+buttonWidth-buttonWidth/6), cy, 24,19, &cmd->defaxis, 12.0, MOD_CURVE_NEGZ, 0, 0, "The axis that the curve deforms along"); - } else if (md->type==eModifierType_Build) { - BuildModifierData *bmd = (BuildModifierData*) md; - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Start:", lx, (cy-=19), buttonWidth,19, &bmd->start, 1.0, MAXFRAMEF, 100, 0, "Specify the start frame of the effect"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Length:", lx, (cy-=19), buttonWidth,19, &bmd->length, 1.0, MAXFRAMEF, 100, 0, "Specify the total time the build effect requires"); - uiDefButI(block, TOG, B_MODIFIER_RECALC, "Randomize", lx, (cy-=19), buttonWidth,19, &bmd->randomize, 0, 0, 1, 0, "Randomize the faces or edges during build."); - uiDefButI(block, NUM, B_MODIFIER_RECALC, "Seed:", lx, (cy-=19), buttonWidth,19, &bmd->seed, 1.0, MAXFRAMEF, 100, 0, "Specify the seed for random if used."); - } else if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Merge Limit:", lx, (cy-=19), buttonWidth,19, &mmd->tolerance, 0.0, 1.0, 10, 10, "Distance from axis within which mirrored vertices are merged"); - uiDefButBitS(block, TOG, MOD_MIR_AXIS_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),20,19, &mmd->flag, 0, 0, 0, 0, "Enable X axis mirror"); - uiDefButBitS(block, TOG, MOD_MIR_AXIS_Y, B_MODIFIER_RECALC, "Y", lx+20,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Y axis mirror"); - uiDefButBitS(block, TOG, MOD_MIR_AXIS_Z, B_MODIFIER_RECALC, "Z", lx+40,cy,20,19, &mmd->flag, 0, 0, 0, 0, "Enable Z axis mirror"); - uiDefButBitS(block, TOG, MOD_MIR_CLIPPING, B_MODIFIER_RECALC, "Do Clipping", lx+60, cy, buttonWidth-60,19, &mmd->flag, 1, 2, 0, 0, "Prevents during Transform vertices to go through Mirror"); - uiDefButBitS(block, TOG, MOD_MIR_MIRROR_U, B_MODIFIER_RECALC, - "Mirror U", - lx, (cy-=19), buttonWidth/2, 19, - &mmd->flag, 0, 0, 0, 0, - "Mirror the U texture coordinate around " - "the 0.5 point"); - uiDefButBitS(block, TOG, MOD_MIR_MIRROR_V, B_MODIFIER_RECALC, - "Mirror V", - lx + buttonWidth/2 + 1, cy, buttonWidth/2, 19, - &mmd->flag, 0, 0, 0, 0, - "Mirror the V texture coordinate around " - "the 0.5 point"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, - "Ob: ", lx, (cy -= 19), buttonWidth, 19, - &mmd->mirror_ob, - "Object to use as mirror"); - - } else if (md->type==eModifierType_EdgeSplit) { - EdgeSplitModifierData *emd = (EdgeSplitModifierData*) md; - uiDefButBitI(block, TOG, MOD_EDGESPLIT_FROMANGLE, - B_MODIFIER_RECALC, "From Edge Angle", - lx, (cy -= 19), buttonWidth, 19, - &emd->flags, 0, 0, 0, 0, - "Split edges with high angle between faces"); - if(emd->flags & MOD_EDGESPLIT_FROMANGLE) { - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Split Angle:", - lx, (cy -= 19), buttonWidth, 19, &emd->split_angle, - 0.0, 180.0, 100, 2, - "Angle above which to split edges"); - } - uiDefButBitI(block, TOG, MOD_EDGESPLIT_FROMFLAG, - B_MODIFIER_RECALC, "From Marked As Sharp", - lx, (cy -= 19), buttonWidth, 19, - &emd->flags, 0, 0, 0, 0, - "Split edges that are marked as sharp"); - } else if (md->type==eModifierType_Displace) { - DisplaceModifierData *dmd = (DisplaceModifierData*) md; - but = uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", - lx, (cy -= 19), buttonWidth, 19, - &dmd->defgrp_name, 0.0, 31.0, 0, 0, - "Name of vertex group to displace" - " (displace whole mesh if blank)"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - uiDefIDPoinBut(block, modifier_testTexture, ID_TE, B_CHANGEDEP, - "Texture: ", lx, (cy -= 19), buttonWidth, 19, - &dmd->texture, - "Texture to use as displacement input"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Midlevel:", - lx, (cy -= 19), buttonWidth, 19, &dmd->midlevel, - 0, 1, 10, 3, - "Material value that gives no displacement"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Strength:", - lx, (cy -= 19), buttonWidth, 19, &dmd->strength, - -1000, 1000, 10, 0.1, - "Strength of displacement"); - sprintf(str, "Direction%%t|Normal%%x%d|RGB -> XYZ%%x%d|" - "Z%%x%d|Y%%x%d|X%%x%d", - MOD_DISP_DIR_NOR, MOD_DISP_DIR_RGB_XYZ, - MOD_DISP_DIR_Z, MOD_DISP_DIR_Y, MOD_DISP_DIR_X); - uiDefButI(block, MENU, B_MODIFIER_RECALC, str, - lx, (cy -= 19), buttonWidth, 19, &dmd->direction, - 0.0, 1.0, 0, 0, "Displace direction"); - sprintf(str, "Texture Coordinates%%t" - "|Local%%x%d|Global%%x%d|Object%%x%d|UV%%x%d", - MOD_DISP_MAP_LOCAL, MOD_DISP_MAP_GLOBAL, - MOD_DISP_MAP_OBJECT, MOD_DISP_MAP_UV); - uiDefButI(block, MENU, B_MODIFIER_RECALC, str, - lx, (cy -= 19), buttonWidth, 19, &dmd->texmapping, - 0.0, 1.0, 0, 0, - "Texture coordinates used for displacement input"); - if (dmd->texmapping == MOD_DISP_MAP_UV) { - char *strtmp; - int i; - CustomData *fdata = G.obedit ? &G.editMesh->fdata - : &((Mesh*)ob->data)->fdata; - build_uvlayer_menu_vars(fdata, &strtmp, &dmd->uvlayer_tmp, - dmd->uvlayer_name); - but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp, - lx, (cy -= 19), buttonWidth, 19, &dmd->uvlayer_tmp, - 0.0, 1.0, 0, 0, "Set the UV layer to use"); - MEM_freeN(strtmp); - i = CustomData_get_layer_index(fdata, CD_MTFACE); - uiButSetFunc(but, set_displace_uvlayer, dmd, - &fdata->layers[i]); - } - if(dmd->texmapping == MOD_DISP_MAP_OBJECT) { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, - "Ob: ", lx, (cy -= 19), buttonWidth, 19, - &dmd->map_object, - "Object to get texture coordinates from"); - } - } else if (md->type==eModifierType_UVProject) { - UVProjectModifierData *umd = (UVProjectModifierData *) md; - int i; - char *strtmp; - CustomData *fdata = G.obedit ? &G.editMesh->fdata - : &((Mesh*)ob->data)->fdata; - build_uvlayer_menu_vars(fdata, &strtmp, &umd->uvlayer_tmp, - umd->uvlayer_name); - but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp, - lx, (cy -= 19), buttonWidth, 19, &umd->uvlayer_tmp, - 0.0, 1.0, 0, 0, "Set the UV layer to use"); - i = CustomData_get_layer_index(fdata, CD_MTFACE); - uiButSetFunc(but, set_uvproject_uvlayer, umd, &fdata->layers[i]); - MEM_freeN(strtmp); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "AspX:", - lx, (cy -= 19), buttonWidth / 2, 19, &umd->aspectx, - 1, 1000, 100, 2, - "Horizontal Aspect Ratio"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "AspY:", - lx + (buttonWidth / 2) + 1, cy, buttonWidth / 2, 19, - &umd->aspecty, - 1, 1000, 100, 2, - "Vertical Aspect Ratio"); - uiDefButI(block, NUM, B_MODIFIER_RECALC, "Projectors:", - lx, (cy -= 19), buttonWidth, 19, &umd->num_projectors, - 1, MOD_UVPROJECT_MAXPROJECTORS, 0, 0, - "Number of objects to use as projectors"); - for(i = 0; i < umd->num_projectors; ++i) { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, - "Ob: ", lx, (cy -= 19), buttonWidth, 19, - &umd->projectors[i], - "Object to use as projector"); - } - uiDefIDPoinBut(block, modifier_testImage, ID_IM, B_CHANGEDEP, - "Image: ", lx, (cy -= 19), buttonWidth, 19, - &umd->image, - "Image to project (only faces with this image " - "will be altered"); - uiButSetCompleteFunc(but, autocomplete_image, (void *)ob); - uiDefButBitI(block, TOG, MOD_UVPROJECT_OVERRIDEIMAGE, - B_MODIFIER_RECALC, "Override Image", - lx, (cy -= 19), buttonWidth, 19, - &umd->flags, 0, 0, 0, 0, - "Override faces' current images with the " - "given image"); - } else if (md->type==eModifierType_Decimate) { - DecimateModifierData *dmd = (DecimateModifierData*) md; - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Ratio:", lx,(cy-=19),buttonWidth,19, &dmd->percent, 0.0, 1.0, 10, 0, "Defines the percentage of triangles to reduce to"); - sprintf(str, "Face Count: %d", dmd->faceCount); - uiDefBut(block, LABEL, 1, str, lx, (cy-=19), 160,19, NULL, 0.0, 0.0, 0, 0, "Displays the current number of faces in the decimated mesh"); - } else if (md->type==eModifierType_Smooth) { - SmoothModifierData *smd = (SmoothModifierData*) md; - - uiDefButBitS(block, TOG, MOD_SMOOTH_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &smd->flag, 0, 0, 0, 0, "Enable X axis smoothing"); - uiDefButBitS(block, TOG, MOD_SMOOTH_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &smd->flag, 0, 0, 0, 0, "Enable Y axis smoothing"); - uiDefButBitS(block, TOG, MOD_SMOOTH_Z, B_MODIFIER_RECALC, "Z", lx+90,cy,45,19, &smd->flag, 0, 0, 0, 0, "Enable Z axis smoothing"); - - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth, 19, &smd->fac, -10.0, 10.0, 0.5, 0, "Define the amount of smoothing, from 0.0 to 1.0 (lower / higher values can deform the mesh)"); - uiDefButS(block, NUM, B_MODIFIER_RECALC, "Repeat:", lx,(cy-=19),buttonWidth, 19, &smd->repeat, 0.0, 30.0, 1, 0, "Number of smoothing iterations"); - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &smd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to define which vertices are affected"); - } else if (md->type==eModifierType_Cast) { - CastModifierData *cmd = (CastModifierData*) md; - - char casttypemenu[]="Projection Type%t|Sphere%x0|Cylinder%x1|Cuboid%x2"; - uiDefButS(block, MENU, B_MODIFIER_RECALC, casttypemenu, lx,(cy-=19),buttonWidth - 30,19, &cmd->type, 0, 0, 0, 0, "Projection type to apply"); - uiDefButBitS(block, TOG, MOD_CAST_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) X axis deformation"); - uiDefButBitS(block, TOG, MOD_CAST_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) Y axis deformation"); - if (cmd->type != MOD_CAST_TYPE_CYLINDER) { - uiDefButBitS(block, TOG, MOD_CAST_Z, B_MODIFIER_RECALC, "Z", lx+90,cy,45,19, &cmd->flag, 0, 0, 0, 0, "Enable (local) Z axis deformation"); - } - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Factor:", lx,(cy-=19),buttonWidth, 19, &cmd->fac, -10.0, 10.0, 5, 0, "Define the amount of deformation"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Radius:", lx,(cy-=19),buttonWidth, 19, &cmd->radius, 0.0, 100.0, 10.0, 0, "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Size:", lx,(cy-=19),buttonWidth, 19, &cmd->size, 0.0, 100.0, 10.0, 0, "Size of projection shape (leave as 0 for auto)"); - uiDefButBitS(block, TOG, MOD_CAST_SIZE_FROM_RADIUS, B_MODIFIER_RECALC, "From radius", lx+buttonWidth,cy,80,19, &cmd->flag, 0, 0, 0, 0, "Use radius as size of projection shape (0 = auto)"); - if (ob->type == OB_MESH) { - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &cmd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to define which vertices are affected"); - } - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx,(cy-=19), buttonWidth,19, &cmd->object, "Control object: if available, its location determines the center of the effect"); - if(cmd->object) { - uiDefButBitS(block, TOG, MOD_CAST_USE_OB_TRANSFORM, B_MODIFIER_RECALC, "Use transform", lx+buttonWidth,cy,80,19, &cmd->flag, 0, 0, 0, 0, "Use object transform to control projection shape"); - } - } else if (md->type==eModifierType_Wave) { - WaveModifierData *wmd = (WaveModifierData*) md; - uiDefButBitS(block, TOG, MOD_WAVE_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),45,19, &wmd->flag, 0, 0, 0, 0, "Enable X axis motion"); - uiDefButBitS(block, TOG, MOD_WAVE_Y, B_MODIFIER_RECALC, "Y", lx+45,cy,45,19, &wmd->flag, 0, 0, 0, 0, "Enable Y axis motion"); - uiDefButBitS(block, TOG, MOD_WAVE_CYCL, B_MODIFIER_RECALC, "Cycl", lx+90,cy,buttonWidth-90,19, &wmd->flag, 0, 0, 0, 0, "Enable cyclic wave effect"); - uiDefButBitS(block, TOG, MOD_WAVE_NORM, B_MODIFIER_RECALC, "Normals", lx,(cy-=19),buttonWidth,19, &wmd->flag, 0, 0, 0, 0, "Displace along normals"); - if (wmd->flag & MOD_WAVE_NORM){ - if (ob->type==OB_MESH) { - uiDefButBitS(block, TOG, MOD_WAVE_NORM_X, B_MODIFIER_RECALC, "X", lx,(cy-=19),buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the X normal"); - uiDefButBitS(block, TOG, MOD_WAVE_NORM_Y, B_MODIFIER_RECALC, "Y", lx+(buttonWidth/3),cy,buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the Y normal"); - uiDefButBitS(block, TOG, MOD_WAVE_NORM_Z, B_MODIFIER_RECALC, "Z", lx+(buttonWidth/3)*2,cy,buttonWidth/3,19, &wmd->flag, 0, 0, 0, 0, "Enable displacement along the Z normal"); - } - else - uiDefBut(block, LABEL, 1, "Meshes Only", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, ""); - } - - uiBlockBeginAlign(block); - if(wmd->speed >= 0) - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Time sta:", lx,(cy-=19),buttonWidth,19, &wmd->timeoffs, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify starting frame of the wave"); - else - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Time end:", lx,(cy-=19),buttonWidth,19, &wmd->timeoffs, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify ending frame of the wave"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Lifetime:", lx,(cy-=19),buttonWidth,19, &wmd->lifetime, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the lifespan of the wave"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Damptime:", lx,(cy-=19),buttonWidth,19, &wmd->damp, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify the dampingtime of the wave"); - cy -= 9; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta x:", lx,(cy-=19),113,19, &wmd->startx, -100.0, 100.0, 100, 0, "Starting position for the X axis"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Sta y:", lx+115,cy,105,19, &wmd->starty, -100.0, 100.0, 100, 0, "Starting position for the Y axis"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MODIFIER_RECALC, "Ob: ", lx, (cy-=19), 220,19, &wmd->objectcenter, "Object to use as Starting Position (leave blank to disable)"); - uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ",lx, (cy -= 19), 220, 19,&wmd->defgrp_name, 0.0, 31.0, 0, 0, "Name of vertex group with which to modulate displacement"); - uiDefIDPoinBut(block, modifier_testTexture, ID_TE, B_CHANGEDEP,"Texture: ", lx, (cy -= 19), 220, 19, &wmd->texture,"Texture with which to modulate wave"); - sprintf(str, "Texture Coordinates%%t" - "|Local%%x%d|Global%%x%d|Object%%x%d|UV%%x%d", - MOD_WAV_MAP_LOCAL, MOD_WAV_MAP_GLOBAL, - MOD_WAV_MAP_OBJECT, MOD_WAV_MAP_UV); - uiDefButI(block, MENU, B_MODIFIER_RECALC, str, - lx, (cy -= 19), 220, 19, &wmd->texmapping, - 0.0, 1.0, 0, 0, - "Texture coordinates used for modulation input"); - if (wmd->texmapping == MOD_WAV_MAP_UV) { - char *strtmp; - int i; - CustomData *fdata = G.obedit ? &G.editMesh->fdata - : &((Mesh*)ob->data)->fdata; - build_uvlayer_menu_vars(fdata, &strtmp, &wmd->uvlayer_tmp, - wmd->uvlayer_name); - but = uiDefButI(block, MENU, B_MODIFIER_RECALC, strtmp, - lx, (cy -= 19), 220, 19, &wmd->uvlayer_tmp, - 0.0, 1.0, 0, 0, "Set the UV layer to use"); - MEM_freeN(strtmp); - i = CustomData_get_layer_index(fdata, CD_MTFACE); - uiButSetFunc(but, set_displace_uvlayer, wmd, - &fdata->layers[i]); - } - if(wmd->texmapping == MOD_DISP_MAP_OBJECT) { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, - "Ob: ", lx, (cy -= 19), 220, 19, - &wmd->map_object, - "Object to get texture coordinates from"); - } - cy -= 9; - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Speed:", lx,(cy-=19),220,19, &wmd->speed, -2.0, 2.0, 0, 0, "Specify the wave speed"); - uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Height:", lx,(cy-=19),220,19, &wmd->height, -2.0, 2.0, 0, 0, "Specify the amplitude of the wave"); - uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Width:", lx,(cy-=19),220,19, &wmd->width, 0.0, 5.0, 0, 0, "Specify the width of the wave"); - uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Narrow:", lx,(cy-=19),220,19, &wmd->narrow, 0.0, 10.0, 0, 0, "Specify how narrow the wave follows"); - } else if (md->type==eModifierType_Armature) { - ArmatureModifierData *amd = (ArmatureModifierData*) md; - uiDefIDPoinBut(block, modifier_testArmatureObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &amd->object, "Armature object to deform with"); - - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth-40,19, &amd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to control overall armature influence"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - uiDefButBitS(block, TOG, ARM_DEF_INVERT_VGROUP, B_ARM_RECALCDATA, "Inv", lx+buttonWidth-40,cy, 40, 20, &amd->deformflag, 0, 0, 0, 0, "Invert vertex group influence"); - - uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vert.Groups", lx,cy-=19,buttonWidth/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform"); - uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", lx+buttonWidth/2,cy,(buttonWidth + 1)/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform"); - uiDefButBitS(block, TOG, ARM_DEF_QUATERNION, B_ARM_RECALCDATA, "Quaternion", lx,(cy-=19),buttonWidth/2,20, &amd->deformflag, 0, 0, 0, 0, "Enable deform rotation interpolation with Quaternions"); - uiDefButBitS(block, TOG, ARM_DEF_B_BONE_REST, B_ARM_RECALCDATA, "B-Bone Rest", lx+buttonWidth/2,cy,(buttonWidth + 1)/2,20, &amd->deformflag, 0, 0, 0, 0, "Make B-Bones deform already in rest position"); - - uiDefButS(block, TOG, B_ARM_RECALCDATA, "MultiModifier", lx,cy-=19, buttonWidth, 20, &amd->multi, 0, 0, 0, 0, "Use same input as previous modifier, and mix results using overall vgroup"); - - } else if (md->type==eModifierType_Hook) { - HookModifierData *hmd = (HookModifierData*) md; - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Falloff: ", lx, (cy-=19), buttonWidth,19, &hmd->falloff, 0.0, 100.0, 100, 0, "If not zero, the distance from hook where influence ends"); - uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "Force: ", lx, (cy-=19), buttonWidth,19, &hmd->force, 0.0, 1.0, 100, 0, "Set relative force of hook"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &hmd->object, "Parent Object for hook, also recalculates and clears offset"); - if(hmd->indexar==NULL) { - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-=19), buttonWidth,19, &hmd->name, 0.0, 31.0, 0, 0, "Vertex Group name"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - } - uiBlockBeginAlign(block); - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Reset", lx, (cy-=19), 80,19, NULL, 0.0, 0.0, 0, 0, "Recalculate and clear offset (transform) of hook"); - uiButSetFunc(but, modifiers_clearHookOffset, ob, md); - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Recenter", lx+80, cy, buttonWidth-80,19, NULL, 0.0, 0.0, 0, 0, "Sets hook center to cursor position"); - uiButSetFunc(but, modifiers_cursorHookCenter, ob, md); - - if (editing) { - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Select", lx, (cy-=19), 80,19, NULL, 0.0, 0.0, 0, 0, "Selects effected vertices on mesh"); - uiButSetFunc(but, modifiers_selectHook, ob, md); - but = uiDefBut(block, BUT, B_MODIFIER_RECALC, "Reassign", lx+80, cy, buttonWidth-80,19, NULL, 0.0, 0.0, 0, 0, "Reassigns selected vertices to hook"); - uiButSetFunc(but, modifiers_reassignHook, ob, md); - } - } else if (md->type==eModifierType_Softbody) { - uiDefBut(block, LABEL, 1, "See Softbody panel.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, ""); - } else if (md->type==eModifierType_Boolean) { - BooleanModifierData *bmd = (BooleanModifierData*) md; - uiDefButI(block, MENU, B_MODIFIER_RECALC, "Operation%t|Intersect%x0|Union%x1|Difference%x2", lx,(cy-=19),buttonWidth,19, &bmd->operation, 0.0, 1.0, 0, 0, "Boolean operation to perform"); - uiDefIDPoinBut(block, modifier_testMeshObj, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &bmd->object, "Mesh object to use for boolean operation"); - } else if (md->type==eModifierType_Array) { - ArrayModifierData *amd = (ArrayModifierData*) md; - float range = 10000; - int cytop, halfwidth = (width - 5)/2 - 15; - int halflx = lx + halfwidth + 10; - - uiBlockSetEmboss(block, UI_EMBOSSX); - uiBlockEndAlign(block); - - /* length parameters */ - uiBlockBeginAlign(block); - sprintf(str, "Length Fit%%t|Fixed Count%%x%d|Fixed Length%%x%d" - "|Fit To Curve Length%%x%d", - MOD_ARR_FIXEDCOUNT, MOD_ARR_FITLENGTH, MOD_ARR_FITCURVE); - uiDefButI(block, MENU, B_MODIFIER_RECALC, str, - lx, (cy-=19), buttonWidth, 19, &amd->fit_type, - 0.0, 1.0, 0, 0, "Array length calculation method"); - switch(amd->fit_type) - { - case MOD_ARR_FIXEDCOUNT: - uiDefButI(block, NUM, B_MODIFIER_RECALC, "Count:", - lx, (cy -= 19), buttonWidth, 19, &amd->count, - 1, 1000, 0, 0, "Number of duplicates to make"); - break; - case MOD_ARR_FITLENGTH: - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Length:", - lx, (cy -= 19), buttonWidth, 19, &amd->length, - 0, range, 10, 2, - "Length to fit array within"); - break; - case MOD_ARR_FITCURVE: - uiDefIDPoinBut(block, modifier_testCurveObj, ID_OB, - B_CHANGEDEP, "Ob: ", - lx, (cy -= 19), buttonWidth, 19, &amd->curve_ob, - "Curve object to fit array length to"); - break; - } - uiBlockEndAlign(block); - - /* offset parameters */ - cy -= 10; - cytop= cy; - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MOD_ARR_OFF_CONST, B_MODIFIER_RECALC, - "Constant Offset", lx, (cy-=19), halfwidth, 19, - &amd->offset_type, 0, 0, 0, 0, - "Constant offset between duplicates " - "(local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "X:", - lx, (cy-=19), halfwidth, 19, - &amd->offset[0], - -range, range, 10, 3, - "Constant component for duplicate offsets " - "(local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Y:", - lx, (cy-=19), halfwidth, 19, - &amd->offset[1], - -range, range, 10, 3, - "Constant component for duplicate offsets " - "(local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Z:", - lx, (cy-=19), halfwidth, 19, - &amd->offset[2], - -range, range, 10, 3, - "Constant component for duplicate offsets " - "(local coordinates)"); - uiBlockEndAlign(block); - - cy= cytop; - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MOD_ARR_OFF_RELATIVE, B_MODIFIER_RECALC, - "Relative Offset", halflx, (cy-=19), halfwidth, 19, - &amd->offset_type, 0, 0, 0, 0, - "Offset between duplicates relative to object width " - "(local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "X:", - halflx, (cy-=19), halfwidth, 19, - &amd->scale[0], - -range, range, 10, 3, - "Component for duplicate offsets relative to object " - "width (local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Y:", - halflx, (cy-=19), halfwidth, 19, - &amd->scale[1], - -range, range, 10, 3, - "Component for duplicate offsets relative to object " - "width (local coordinates)"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Z:", - halflx, (cy-=19), halfwidth, 19, - &amd->scale[2], - -range, range, 10, 3, - "Component for duplicate offsets relative to object " - "width (local coordinates)"); - uiBlockEndAlign(block); - - /* vertex merging parameters */ - cy -= 10; - cytop= cy; - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MOD_ARR_MERGE, B_MODIFIER_RECALC, - "Merge", - lx, (cy-=19), halfwidth/2, 19, &amd->flags, - 0, 0, 0, 0, - "Merge vertices in adjacent duplicates"); - uiDefButBitI(block, TOG, MOD_ARR_MERGEFINAL, B_MODIFIER_RECALC, - "First Last", - lx + halfwidth/2, cy, (halfwidth+1)/2, 19, - &amd->flags, - 0, 0, 0, 0, - "Merge vertices in first duplicate with vertices" - " in last duplicate"); - uiDefButF(block, NUM, B_MODIFIER_RECALC, "Limit:", - lx, (cy-=19), halfwidth, 19, &amd->merge_dist, - 0, 1.0f, 1, 4, - "Limit below which to merge vertices"); - - /* offset ob */ - cy = cytop; - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MOD_ARR_OFF_OBJ, B_MODIFIER_RECALC, - "Object Offset", halflx, (cy -= 19), halfwidth, 19, - &amd->offset_type, 0, 0, 0, 0, - "Add an object transformation to the total offset"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, - "Ob: ", halflx, (cy -= 19), halfwidth, 19, - &amd->offset_ob, - "Object from which to take offset transformation"); - uiBlockEndAlign(block); - - cy -= 10; - but = uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB, - B_CHANGEDEP, "Start cap: ", - lx, (cy -= 19), halfwidth, 19, - &amd->start_cap, - "Mesh object to use as start cap"); - uiButSetCompleteFunc(but, autocomplete_meshob, (void *)ob); - but = uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB, - B_CHANGEDEP, "End cap: ", - halflx, cy, halfwidth, 19, - &amd->end_cap, - "Mesh object to use as end cap"); - uiButSetCompleteFunc(but, autocomplete_meshob, (void *)ob); - } else if (md->type==eModifierType_MeshDeform) { - MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; - - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_meshobpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy-=19), buttonWidth,19, &mmd->object, "Mesh object to be use as cage"); - but=uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", lx, (cy-19), buttonWidth-40,19, &mmd->defgrp_name, 0.0, 31.0, 0, 0, "Vertex Group name to control overall meshdeform influence"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - uiDefButBitS(block, TOG, MOD_MDEF_INVERT_VGROUP, B_MODIFIER_RECALC, "Inv", lx+buttonWidth-40, (cy-=19), 40,19, &mmd->flag, 0.0, 31.0, 0, 0, "Invert vertex group influence"); - - uiBlockBeginAlign(block); - if(mmd->bindcos) { - but= uiDefBut(block, BUT, B_MODIFIER_RECALC, "Unbind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Unbind mesh from cage"); - uiButSetFunc(but,modifiers_bindMeshDeform,ob,md); - } - else { - but= uiDefBut(block, BUT, B_MODIFIER_RECALC, "Bind", lx,(cy-=24), buttonWidth,19, 0, 0, 0, 0, 0, "Bind mesh to cage"); - uiButSetFunc(but,modifiers_bindMeshDeform,ob,md); - uiDefButS(block, NUM, B_NOP, "Precision:", lx,(cy-19), buttonWidth/2 + 20,19, &mmd->gridsize, 2, 10, 0.5, 0, "The grid size for binding"); - uiDefButBitS(block, TOG, MOD_MDEF_DYNAMIC_BIND, B_MODIFIER_RECALC, "Dynamic", lx+(buttonWidth+1)/2 + 20, (cy-=19), buttonWidth/2 - 20,19, &mmd->flag, 0.0, 31.0, 0, 0, "Invert vertex group influence"); - } - uiBlockEndAlign(block); - } else if (md->type==eModifierType_ParticleSystem) { - uiDefBut(block, LABEL, 1, "See Particle buttons.", lx, (cy-=19), buttonWidth,19, NULL, 0.0, 0.0, 0, 0, ""); - } else if (md->type==eModifierType_ParticleInstance) { - ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData*) md; - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CHANGEDEP, "Ob: ", lx, (cy -= 19), buttonWidth, 19, &pimd->ob, "Object that has the particlesystem"); - uiDefButS(block, NUM, B_MODIFIER_RECALC, "PSYS:", lx, (cy -= 19), buttonWidth, 19, &pimd->psys, 1, 10, 10, 3, "Particlesystem number in the object"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Parents, B_MODIFIER_RECALC, "Normal", lx, (cy -= 19), buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances from normal particles"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Children, B_MODIFIER_RECALC, "Children", lx+buttonWidth/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances from child particles"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Path, B_MODIFIER_RECALC, "Path", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Create instances along particle paths"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Unborn, B_MODIFIER_RECALC, "Unborn", lx, (cy -= 19), buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are unborn"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are alive"); - uiDefButBitS(block, TOG, eParticleInstanceFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &pimd->flag, 0, 0, 0, 0, "Show instances when particles are dead"); - } else if (md->type==eModifierType_Explode) { - ExplodeModifierData *emd = (ExplodeModifierData*) md; - uiBut *but; - char *menustr= get_vertexgroup_menustr(ob); - int defCount=BLI_countlist(&ob->defbase); - if(defCount==0) emd->vgroup=0; - - but=uiDefButS(block, MENU, B_MODIFIER_RECALC, menustr, lx, (cy-=19), buttonWidth/2,19, &emd->vgroup, 0, defCount, 0, 0, "Protect this vertex group"); - uiButSetFunc(but,modifiers_explodeFacepa,emd,0); - MEM_freeN(menustr); - - but=uiDefButF(block, NUMSLI, B_MODIFIER_RECALC, "", lx+buttonWidth/2, cy, buttonWidth/2,19, &emd->protect, 0.0f, 1.0f, 0, 0, "Clean vertex group edges"); - uiButSetFunc(but,modifiers_explodeFacepa,emd,0); - - but=uiDefBut(block, BUT, B_MODIFIER_RECALC, "Refresh", lx, (cy-=19), buttonWidth/2,19, 0, 0, 0, 0, 0, "Recalculate faces assigned to particles"); - uiButSetFunc(but,modifiers_explodeFacepa,emd,0); - - uiDefButBitS(block, TOG, eExplodeFlag_EdgeSplit, B_MODIFIER_RECALC, "Split Edges", lx+buttonWidth/2, cy, buttonWidth/2,19, &emd->flag, 0, 0, 0, 0, "Split face edges for nicer shrapnel"); - uiDefButBitS(block, TOG, eExplodeFlag_Unborn, B_MODIFIER_RECALC, "Unborn", lx, (cy-=19), buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are unborn"); - uiDefButBitS(block, TOG, eExplodeFlag_Alive, B_MODIFIER_RECALC, "Alive", lx+buttonWidth/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are alive"); - uiDefButBitS(block, TOG, eExplodeFlag_Dead, B_MODIFIER_RECALC, "Dead", lx+buttonWidth*2/3, cy, buttonWidth/3,19, &emd->flag, 0, 0, 0, 0, "Show mesh when particles are dead"); - } - - uiBlockEndAlign(block); - - y-=height; - } - - if (md->error) { - char str[512]; - - y -= 20; - - uiBlockSetCol(block, color); - /* roundbox 4 free variables: corner-rounding, nop, roundbox type, shade */ - uiDefBut(block, ROUNDBOX, 0, "", x-10, y, width, 20, NULL, 5.0, 0.0, 15, 40, ""); - uiBlockSetCol(block, TH_AUTO); - - sprintf(str, "Modifier Error: %s", md->error); - uiDefBut(block, LABEL, B_NOP, str, x+15, y+15, width-35, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); - } - - uiClearButLock(); - - y -= 3+6; - - *xco = x; - *yco = y; -} - -static void editing_panel_modifiers(Object *ob) -{ - ModifierData *md; - uiBlock *block; - char str[64]; - int xco, yco, i, lastCageIndex, cageIndex = modifiers_getCageIndex(ob, &lastCageIndex); - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_modifiers", UI_EMBOSS, UI_HELV, curarea->win); - if( uiNewPanel(curarea, block, "Modifiers", "Editing", 640, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - uiNewPanelHeight(block, 204); - - uiDefBlockBut(block, modifiers_add_menu, ob, "Add Modifier", 0, 190, 130, 20, "Add a new modifier"); - - sprintf(str, "To: %s", ob->id.name+2); - uiDefBut(block, LABEL, 1, str, 140, 190, 150, 20, NULL, 0.0, 0.0, 0, 0, "Object whose modifier stack is being edited"); - - xco = 0; - yco = 160; - - md = modifiers_getVirtualModifierList(ob); - - for (i=0; md; i++, md=md->next) { - draw_modifier(block, ob, md, &xco, &yco, i, cageIndex, lastCageIndex); - if (md->mode&eModifierMode_Virtual) i--; - } - - if(yco < 0) uiNewPanelHeight(block, 204-yco); -} - -static char *make_key_menu(Key *key, int startindex) -{ - KeyBlock *kb; - int index= 1; - char *str, item[64]; - - for (kb = key->block.first; kb; kb=kb->next, index++); - str= MEM_mallocN(index*40, "key string"); - str[0]= 0; - - index= startindex; - for (kb = key->block.first; kb; kb=kb->next, index++) { - sprintf (item, "|%s%%x%d", kb->name, index); - strcat(str, item); - } - - return str; -} - -static void editing_panel_shapes(Object *ob) -{ - uiBlock *block; - Key *key= NULL; - KeyBlock *kb; - int icon; - char *strp; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_shapes", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Modifiers", "Editing"); - if( uiNewPanel(curarea, block, "Shapes", "Editing", 640, 0, 318, 204)==0) return; - - /* Todo check data is library here */ - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - uiDefBut(block, BUT, B_ADDKEY, "Add Shape Key" , 10, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, "Add new Shape Key"); - - key= ob_get_key(ob); - if(key==NULL) { - /* label aligns add button */ - uiDefBut(block, LABEL, 0, "", 170, 180,140,20, NULL, 0, 0, 0, 0, ""); - return; - } - - uiDefButS(block, TOG, B_RELKEY, "Relative", 170, 180,140,20, &key->type, 0, 0, 0, 0, "Makes Shape Keys relative"); - - kb= BLI_findlink(&key->block, ob->shapenr-1); - if(kb==NULL) { - ob->shapenr= 1; - kb= key->block.first; - } - - uiBlockBeginAlign(block); - if(ob->shapeflag & OB_SHAPE_LOCK) icon= ICON_PIN_HLT; else icon= ICON_PIN_DEHLT; - uiDefIconButBitS(block, TOG, OB_SHAPE_LOCK, B_LOCKKEY, icon, 10,150,25,20, &ob->shapeflag, 0, 0, 0, 0, "Always show the current Shape for this Object"); - if(kb->flag & KEYBLOCK_MUTE) icon= ICON_MUTE_IPO_ON; else icon = ICON_MUTE_IPO_OFF; - uiDefIconButBitS(block, TOG, KEYBLOCK_MUTE, B_MODIFIER_RECALC, icon, 35,150,20,20, &kb->flag, 0, 0, 0, 0, "Mute the current Shape"); - uiSetButLock(G.obedit==ob, "Unable to perform in EditMode"); - uiDefIconBut(block, BUT, B_PREVKEY, ICON_TRIA_LEFT, 55,150,20,20, NULL, 0, 0, 0, 0, "Previous Shape Key"); - strp= make_key_menu(key, 1); - uiDefButS(block, MENU, B_SETKEY, strp, 75,150,20,20, &ob->shapenr, 0, 0, 0, 0, "Browse existing choices"); - MEM_freeN(strp); - - uiDefIconBut(block, BUT, B_NEXTKEY, ICON_TRIA_RIGHT, 95,150,20,20, NULL, 0, 0, 0, 0, "Next Shape Key"); - uiClearButLock(); - uiDefBut(block, TEX, B_NAMEKEY, "", 115, 150, 170, 20, kb->name, 0.0, 31.0, 0, 0, "Current Shape Key name"); - uiDefIconBut(block, BUT, B_DELKEY, ICON_X, 285,150,25,20, 0, 0, 0, 0, 0, "Deletes current Shape Key"); - uiBlockEndAlign(block); - - if(key->type && (ob->shapeflag & OB_SHAPE_LOCK)==0 && ob->shapenr!=1) { - uiBlockBeginAlign(block); - make_rvk_slider(block, ob, ob->shapenr-1, 10, 120, 150, 20, "Key value, when used it inserts an animation curve point"); - uiDefButF(block, NUM, B_REDR, "Min ", 160,120, 75, 20, &kb->slidermin, -10.0, 10.0, 100, 1, "Minumum for slider"); - uiDefButF(block, NUM, B_REDR, "Max ", 235,120, 75, 20, &kb->slidermax, -10.0, 10.0, 100, 1, "Maximum for slider"); - uiBlockEndAlign(block); - } - if(key->type && ob->shapenr!=1) { - uiDefBut(block, TEX, B_MODIFIER_RECALC, "VGroup: ", 10, 90, 150,19, &kb->vgroup, 0.0, 31.0, 0, 0, "Vertex Weight Group name, to blend with Basis Shape"); - - strp= make_key_menu(key, 0); - uiDefButS(block, MENU, B_MODIFIER_RECALC, strp, 160, 90, 150,19, &kb->relative, 0.0, 0.0, 0, 0, "Shape used as a relative key"); - MEM_freeN(strp); - } - - if(key->type==0) - uiDefButS(block, NUM, B_DIFF, "Slurph:", 10, 60, 150, 19, &(key->slurph), -500.0, 500.0, 0, 0, "Creates a delay in amount of frames in applying keypositions, first vertex goes first"); - -} - -/* *************************** FONT ******************************** */ - -static short give_vfontnr(VFont *vfont) -{ - VFont *vf; - short nr= 1; - - vf= G.main->vfont.first; - while(vf) { - if(vf==vfont) return nr; - nr++; - vf= vf->id.next; - } - return -1; -} - -static VFont *give_vfontpointer(int nr) /* nr= button */ -{ - VFont *vf; - short tel= 1; - - vf= G.main->vfont.first; - while(vf) { - if(tel==nr) return vf; - tel++; - vf= vf->id.next; - } - return G.main->vfont.first; -} - -VFont *exist_vfont(char *str) -{ - VFont *vf; - - vf= G.main->vfont.first; - while(vf) { - if(strcmp(vf->name, str)==0) return vf; - vf= vf->id.next; - } - return 0; -} - -static char *give_vfontbutstr(void) -{ - VFont *vf; - int len= 0; - char *str, di[FILE_MAXDIR], fi[FILE_MAXFILE]; - - vf= G.main->vfont.first; - while(vf) { - strcpy(di, vf->name); - BLI_splitdirstring(di, fi); - len+= strlen(fi)+4; - vf= vf->id.next; - } - - str= MEM_callocN(len+21, "vfontbutstr"); - strcpy(str, "FONTS %t"); - vf= G.main->vfont.first; - while(vf) { - - if(vf->id.us==0) strcat(str, "|0 "); - else strcat(str, "| "); - - strcpy(di, vf->name); - BLI_splitdirstring(di, fi); - - strcat(str, fi); - vf= vf->id.next; - } - return str; -} - -static void load_buts_vfont(char *name) -{ - VFont *vf; - Curve *cu; - - if(OBACT && OBACT->type==OB_FONT) cu= OBACT->data; - else return; - - vf= exist_vfont(name); - if(vf==0) { - vf= load_vfont(name); - if(vf==0) return; - } - else id_us_plus((ID *)vf); - - switch(cu->curinfo.flag & CU_STYLE) { - case CU_BOLD: - if(cu->vfontb) cu->vfontb->id.us--; - cu->vfontb= vf; - break; - case CU_ITALIC: - if(cu->vfonti) cu->vfonti->id.us--; - cu->vfonti= vf; - break; - case (CU_BOLD|CU_ITALIC): - if(cu->vfontbi) cu->vfontbi->id.us--; - cu->vfontbi= vf; - break; - default: - if(cu->vfont) cu->vfont->id.us--; - cu->vfont= vf; - break; - } - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - BIF_undo_push("Load vector font"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - -static void set_unicode_text_fs(char *file) -{ - if (file > 0) paste_unicodeText(file); -} - -void do_fontbuts(unsigned short event) -{ - Curve *cu; - VFont *vf; - Object *ob; - ScrArea *sa; - char str[80]; - int ctevt; - char *ctmenu; - DynStr *ds; - int i, style=0; - - ob= OBACT; - - switch(event) { - case B_MAKEFONT: - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - - case B_STYLETOSELU: - case B_STYLETOSELB: - case B_STYLETOSELI: - switch (event) { - case B_STYLETOSELU: style = CU_UNDERLINE; break; - case B_STYLETOSELB: style = CU_BOLD; break; - case B_STYLETOSELI: style = CU_ITALIC; break; - } - if (style_to_sel(style, ((Curve*)ob->data)->curinfo.flag & style)) { - text_to_curve(ob, 0); - makeDispListCurveTypes(ob, 0); - allqueue(REDRAWVIEW3D, 0); - } - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_FASTFONT: - if (G.obedit) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_INSTB: - cu= ob->data; - if (cu->totbox < 256) { - for (i = cu->totbox; i>cu->actbox; i--) cu->tb[i]= cu->tb[i-1]; - cu->tb[cu->actbox]= cu->tb[cu->actbox-1]; - cu->actbox++; - cu->totbox++; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - text_to_curve(ob, 0); - makeDispListCurveTypes(ob, 0); - } - else { - error("Do you really need that many text frames?"); - } - break; - case B_DELTB: - cu= ob->data; - if (cu->totbox > 1) { - for (i = cu->actbox-1; i < cu->totbox; i++) cu->tb[i]= cu->tb[i+1]; - cu->totbox--; - cu->actbox--; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - text_to_curve(ob, 0); - makeDispListCurveTypes(ob, 0); - } - break; - case B_TOUPPER: - to_upper(); - break; - case B_LOADFONT: - vf= give_vfontpointer(G.buts->texnr); - if(vf && vf->id.prev!=vf->id.next) strcpy(str, vf->name); - else strcpy(str, U.fontdir); - - sa= closest_bigger_area(); - areawinset(sa->win); - - activate_fileselect(FILE_LOADFONT, "SELECT FONT", str, load_buts_vfont); - - break; - case B_PACKFONT: - if (ob) { - cu= ob->data; - if(cu && cu->vfont) { - if (cu->vfont->packedfile) { - if (G.fileflags & G_AUTOPACK) { - if (okee("Disable AutoPack ?")) { - G.fileflags &= ~G_AUTOPACK; - } - } - - if ((G.fileflags & G_AUTOPACK) == 0) { - if (unpackVFont(cu->vfont, PF_ASK) == RET_OK) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } - } else { - cu->vfont->packedfile = newPackedFile(cu->vfont->name); - } - } - } - allqueue(REDRAWHEADERS, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_LOAD3DTEXT: - if (!G.obedit) { error("Only in editmode!"); return; } - if (G.obedit->type != OB_FONT) return; - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, load_3dtext_fs); - break; - - case B_LOREM: - if (!G.obedit) { error("Only in editmode!"); return; } - if (G.obedit->type != OB_FONT) return; - add_lorem(); - - break; - - case B_SETFONT: - if(ob) { - cu= ob->data; - - vf= give_vfontpointer(G.buts->texnr); - if(vf) { - id_us_plus((ID *)vf); - - switch(cu->curinfo.flag & CU_STYLE) { - case CU_BOLD: - cu->vfontb->id.us--; - cu->vfontb= vf; - break; - case CU_ITALIC: - cu->vfonti->id.us--; - cu->vfonti= vf; - break; - case (CU_BOLD|CU_ITALIC): - cu->vfontbi->id.us--; - cu->vfontbi= vf; - break; - default: - cu->vfont->id.us--; - cu->vfont= vf; - break; - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - BIF_undo_push("Set vector font"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } - break; - - case B_SETCHAR: - G.charmin = 0x0000; - G.charmax = 0xffff; - if(G.charstart < 0) - G.charstart = 0; - if(G.charstart > (0xffff - 12*6)) - G.charstart = 0xffff - (12*6); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_SETUPCHAR: - G.charstart = G.charstart - (12*6); - if(G.charstart < 0) - G.charstart = 0; - if(G.charstart < G.charmin) - G.charstart = G.charmin; - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_SETCAT: - // Create new dynamic string - ds = BLI_dynstr_new(); - - // Fill the dynamic string with entries - for(i=0;i<104;i++) - { - BLI_dynstr_append(ds, "|"); - BLI_dynstr_append(ds, uctabname[i].name); - } - - // Create the menu string from dyn string - ctmenu = BLI_dynstr_get_cstring(ds); - - // Call the popup menu - ctevt = pupmenu_col(ctmenu, 40); - G.charstart = uctabname[ctevt-1].start; - G.charmin = uctabname[ctevt-1].start; - G.charmax = uctabname[ctevt-1].end; - - // Free all data - BLI_dynstr_free(ds); - MEM_freeN(ctmenu); - - // And refresh - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - break; - - case B_SETDOWNCHAR: - G.charstart = G.charstart + (12*6); - if(G.charstart > (0xffff - 12*6)) - G.charstart = 0xffff - (12*6); - if(G.charstart > G.charmax - 12*6) - G.charstart = G.charmax - 12*6; - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_SETUNITEXT: - sa= closest_bigger_area(); - areawinset(sa->win); - - if(ob==G.obedit) { - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, set_unicode_text_fs); - } - break; - - case B_TEXTONCURVE: - if(ob) { - cu= ob->data; - if(cu->textoncurve && cu->textoncurve->type!=OB_CURVE) { - error("Only Curve Objects"); - cu->textoncurve= 0; - allqueue(REDRAWBUTSEDIT, 0); - } - DAG_scene_sort(G.scene); // makes new dag - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } -} - -#ifdef INTERNATIONAL -static void editing_panel_char_type(Object *ob, Curve *cu) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_char_type", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Font", "Editing"); - if(uiNewPanel(curarea, block, "Char", "Editing", 640, 0, 318, 204)==0) - return; - - // Set the selected font - G.selfont = cu->vfont; - - uiDefIconBut(block, BUT, B_SETUNITEXT, ICON_TEXT, 0,210,20,20, 0, 0, 0, 0, 0, "Load Unicode Text file"); - - // Unicode categorization selection button - uiDefBut(block, BUT, B_SETCAT, "Unicode Table", 22,210,226,20, 0, 0, 0, 0, 0, "Select Unicode Table"); - uiDefButI(block, NUM, /*B_SETUPCHAR*/ 0, "", 250,210,50,20, &G.charstart, 0, 0xffff, 0, 0, "UT"); - - // Character selection button - uiDefBut(block, CHARTAB, B_SETCHAR, "", 0, 0, 264, 200, 0, 0, 0, 0, 0, "Select character"); - - // Buttons to change the max, min - uiDefButI(block, BUT, B_SETUPCHAR, "U", 280, 185, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table up"); - uiDefButI(block, BUT, B_SETDOWNCHAR, "D", 280, 0, 15, 15, &G.charstart, 0, 0xffff, 0, 0, "Scroll character table down"); -} -#endif - -static void editing_panel_font_type(Object *ob, Curve *cu) -{ - uiBlock *block; - char *strp; - static int packdummy = 0; - char str[32]; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_font_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Font", "Editing", 640, 0, 470, 204)==0) return; - - switch(cu->curinfo.flag & CU_STYLE) { - case CU_BOLD: - G.buts->texnr= give_vfontnr(cu->vfontb); - break; - case CU_ITALIC: - G.buts->texnr= give_vfontnr(cu->vfonti); - break; - case (CU_BOLD|CU_ITALIC): - G.buts->texnr= give_vfontnr(cu->vfontbi); - break; - default: - G.buts->texnr= give_vfontnr(cu->vfont); - break; - } - - strp= give_vfontbutstr(); -// vfd= cu->vfont->data; - - uiDefBut(block, BUT,B_LOADFONT, "Load", 480,188,68,20, 0, 0, 0, 0, 0, "Load a new font"); - uiDefButS(block, MENU, B_SETFONT, strp, 550,188,220,20, &G.buts->texnr, 0, 0, 0, 0, "Change font for object"); - - if (cu->vfont->packedfile) { - packdummy = 1; - } else { - packdummy = 0; - } - uiDefIconButI(block, TOG|BIT|0, B_PACKFONT, ICON_PACKAGE, 772,188,20,20, &packdummy, 0, 0, 0, 0, "Pack/Unpack this font"); - - /* This doesn't work anyway */ -// uiDefBut(block, LABEL, 0, vfd->name, 480, 165,314,20, 0, 0, 0, 0, 0, "Postscript name of the font"); - - uiDefBut(block, BUT, B_LOAD3DTEXT, "Insert Text", 480, 165, 90, 20, 0, 0, 0, 0, 0, "Insert text file at cursor"); - uiDefBut(block, BUT, B_LOREM, "Lorem", 575, 165, 70, 20, 0, 0, 0, 0, 0, "Insert a paragraph of Lorem Ipsum at cursor"); - uiDefButC(block, TOG|BIT|2,B_STYLETOSELU, "U", 727,165,20,20, &(cu->curinfo.flag), 0,0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitC(block, TOG, CU_BOLD, B_STYLETOSELB, "B", 752,165,20,20, &(cu->curinfo.flag), 0,0, 0, 0, ""); - uiDefButBitC(block, TOG, CU_ITALIC, B_STYLETOSELI, "i", 772,165,20,20, &(cu->curinfo.flag), 0, 0, 0, 0, ""); - uiBlockEndAlign(block); - - MEM_freeN(strp); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_MAKEFONT, "Left", 480,135,47,20, &cu->spacemode, 0.0,0.0, 0, 0, "Left align the text from the object center"); - uiDefButS(block, ROW,B_MAKEFONT, "Center", 527,135,47,20, &cu->spacemode, 0.0,1.0, 0, 0, "Middle align the text from the object center"); - uiDefButS(block, ROW,B_MAKEFONT, "Right", 574,135,47,20, &cu->spacemode, 0.0,2.0, 0, 0, "Right align the text from the object center"); - uiDefButS(block, ROW,B_MAKEFONT, "Justify", 621,135,47,20, &cu->spacemode, 0.0,3.0, 0, 0, "Fill completed lines to maximum textframe width by expanding whitespace"); - uiDefButS(block, ROW,B_MAKEFONT, "Flush", 668,135,47,20, &cu->spacemode, 0.0,4.0, 0, 0, "Fill every line to maximum textframe width, distributing space among all characters"); - uiDefBut(block, BUT, B_TOUPPER, "ToUpper", 715,135,78,20, 0, 0, 0, 0, 0, "Toggle between upper and lower case in editmode"); - uiBlockEndAlign(block); - uiDefButBitS(block, TOG, CU_FAST, B_FASTFONT, "Fast Edit", 715,105,78,20, &cu->flag, 0, 0, 0, 0, "Don't fill polygons while editing"); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_TEXTONCURVE, "TextOnCurve:", 480,105,220,19, &cu->textoncurve, "Apply a deforming curve to the text"); - uiDefBut(block, TEX,REDRAWVIEW3D, "Ob Family:", 480,84,220,19, cu->family, 0.0, 20.0, 0, 0, "Blender uses font from selfmade objects"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,B_MAKEFONT, "Size:", 480,56,155,20, &cu->fsize, 0.1,10.0, 10, 0, "Size of the text"); - uiDefButF(block, NUM,B_MAKEFONT, "Linedist:", 640,56,155,20, &cu->linedist, 0.0,10.0, 10, 0, "Distance between text lines"); - uiDefButF(block, NUM,B_MAKEFONT, "Word spacing:", 795,56,155,20, &cu->wordspace, 0.0,10.0, 10, 0, "Distance factor between words"); - uiDefButF(block, NUM,B_MAKEFONT, "Spacing:", 480,34,155,20, &cu->spacing, 0.0,10.0, 10, 0, "Spacing of individual characters"); - uiDefButF(block, NUM,B_MAKEFONT, "X offset:", 640,34,155,20, &cu->xof, -50.0,50.0, 10, 0, "Horizontal position from object center"); - uiDefButF(block, NUM,B_MAKEFONT, "UL position:", 795,34,155,20, &cu->ulpos, -0.2,0.8, 10, 0, "Vertical position of underline"); - uiDefButF(block, NUM,B_MAKEFONT, "Shear:", 480,12,155,20, &cu->shear, -1.0,1.0, 10, 0, "Italic angle of the characters"); - uiDefButF(block, NUM,B_MAKEFONT, "Y offset:", 640,12,155,20, &cu->yof, -50.0,50.0, 10, 0, "Vertical position from object center"); - uiDefButF(block, NUM,B_MAKEFONT, "UL height:", 795,12,155,20, &cu->ulheight, 0.01,0.5, 10, 0, "Thickness of underline"); - uiBlockEndAlign(block); - - sprintf(str, "%d TextFrame: ", cu->totbox); - uiBlockBeginAlign(block); - uiDefButI(block, NUM, REDRAWVIEW3D, str, 805, 188, 145, 20, &cu->actbox, 1.0, cu->totbox, 0, 10, "Textbox to show settings for"); - uiDefBut(block, BUT,B_INSTB, "Insert", 805, 168, 72, 20, 0, 0, 0, 0, 0, "Insert a new text frame after the current one"); - uiDefBut(block, BUT,B_DELTB, "Delete", 877, 168, 73, 20, 0, 0, 0, 0, 0, "Delete current text frame and shift the others up"); - uiDefButF(block, NUM,B_MAKEFONT, "X:", 805, 148, 72, 20, &(cu->tb[cu->actbox-1].x), -50.0, 50.0, 10, 0, "Horizontal offset of text frame"); - uiDefButF(block, NUM,B_MAKEFONT, "Y:", 877, 148, 73, 20, &(cu->tb[cu->actbox-1].y), -50.0, 50.0, 10, 0, "Horizontal offset of text frame"); - uiDefButF(block, NUM,B_MAKEFONT, "Width:", 805, 128, 145, 20, &(cu->tb[cu->actbox-1].w), 0.0, 50.0, 10, 0, "Horizontal offset of text frame"); - uiDefButF(block, NUM,B_MAKEFONT, "Height:", 805, 108, 145, 20, &(cu->tb[cu->actbox-1].h), 0.0, 50.0, 10, 0, "Horizontal offset of text frame"); - uiBlockEndAlign(block); -} - - -/* *************************** CURVE ******************************** */ - - -void do_curvebuts(unsigned short event) -{ - extern Nurb *lastnu; - extern ListBase editNurb; /* from editcurve */ - Object *ob; - Curve *cu; - Nurb *nu; - - ob= OBACT; - if(ob==0) return; - - switch(event) { - - case B_CONVERTPOLY: - case B_CONVERTBEZ: - case B_CONVERTBSPL: - case B_CONVERTCARD: - case B_CONVERTNURB: - if(G.obedit) { - setsplinetype(event-B_CONVERTPOLY); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_UNIFU: - case B_ENDPU: - case B_BEZU: - case B_UNIFV: - case B_ENDPV: - case B_BEZV: - if(G.obedit) { - nu= editNurb.first; - while(nu) { - if(isNurbsel(nu)) { - if((nu->type & 7)==CU_NURBS) { - if(eventflagu &= 1; - nu->flagu += ((event-B_UNIFU)<<1); - makeknots(nu, 1, nu->flagu>>1); - } - else if(nu->pntsv>1) { - nu->flagv &= 1; - nu->flagv += ((event-B_UNIFV)<<1); - makeknots(nu, 2, nu->flagv>>1); - } - } - } - nu= nu->next; - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SETWEIGHT: - if(G.obedit) { - weightflagNurb(1, editbutweight, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SETW1: - editbutweight= 1.0; - scrarea_queue_winredraw(curarea); - break; - case B_SETW2: - editbutweight= sqrt(2.0)/4.0; - scrarea_queue_winredraw(curarea); - break; - case B_SETW3: - editbutweight= 0.25; - scrarea_queue_winredraw(curarea); - break; - case B_SETW4: - editbutweight= sqrt(0.5); - scrarea_queue_winredraw(curarea); - break; - case B_SETORDER: - if(G.obedit) { - nu= lastnu; - if(nu && (nu->type & 7)==CU_NURBS ) { - if(nu->orderu>nu->pntsu) { - nu->orderu= nu->pntsu; - scrarea_queue_winredraw(curarea); - } - makeknots(nu, 1, nu->flagu>>1); - if(nu->orderv>nu->pntsv) { - nu->orderv= nu->pntsv; - scrarea_queue_winredraw(curarea); - } - makeknots(nu, 2, nu->flagv>>1); - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_TILTINTERP: - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - case B_SUBSURFTYPE: - /* fallthrough */ - case B_MAKEDISP: - if(G.vd) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - } - break; - - case B_SUBDIVCURVE: - subdivideNurb(); - break; - case B_SPINNURB: - if( (G.obedit==NULL) || (G.obedit->type!=OB_SURF) || (G.vd==NULL) || - ((G.obedit->lay & G.vd->lay) == 0) ) return; - spinNurb(0, 0); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - case B_CU3D: /* allow 3D curve */ - if(G.obedit) { - cu= G.obedit->data; - nu= editNurb.first; - while(nu) { - nu->type &= ~CU_2D; - if((cu->flag & CU_3D)==0) nu->type |= CU_2D; - test2DNurb(nu); - nu= nu->next; - } - } - if(ob->type==OB_CURVE) { - cu= ob->data; - nu= cu->nurb.first; - while(nu) { - nu->type &= ~CU_2D; - if((cu->flag & CU_3D)==0) nu->type |= CU_2D; - test2DNurb(nu); - nu= nu->next; - } - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - case B_SETRESOLU: - if(ob->type==OB_CURVE) { - cu= ob->data; - if(ob==G.obedit) nu= editNurb.first; - else nu= cu->nurb.first; - - while(nu) { - nu->resolu= cu->resolu; - nu= nu->next; - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - - break; - - /* Buttons for aligning handles */ - case B_SETPT_AUTO: - if(ob->type==OB_CURVE) { - sethandlesNurb(1); - BIF_undo_push("Auto Curve Handles"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SETPT_VECTOR: - if(ob->type==OB_CURVE) { - sethandlesNurb(2); - BIF_undo_push("Vector Curve Handles"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SETPT_ALIGN: - if(ob->type==OB_CURVE) { - sethandlesNurb(5); - BIF_undo_push("Align Curve Handles"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SETPT_FREE: - if(ob->type==OB_CURVE) { - sethandlesNurb(6); - BIF_undo_push("Free Align Curve Handles"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - } -} - -static void editing_panel_curve_tools(Object *ob, Curve *cu) -{ - Nurb *nu; - extern ListBase editNurb; /* from editcurve */ - extern Nurb *lastnu; - uiBlock *block; - short *sp; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Curve Tools", "Editing", 640, 0, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "Make Knots",562,173,102, 18, 0, 0, 0, 0, 0, ""); - - if(ob->type==OB_CURVE) { - uiDefBut(block, LABEL, 0, "Convert", 463,173,72, 18, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_CONVERTPOLY,"Poly", 467,152,72, 18, 0, 0, 0, 0, 0, "Converts selected into regular Polygon vertices"); - uiDefBut(block, BUT,B_CONVERTBEZ,"Bezier", 467,132,72, 18, 0, 0, 0, 0, 0, "Converts selected to Bezier triples"); - uiDefBut(block, BUT,B_CONVERTNURB,"Nurb", 467,112,72, 18, 0, 0, 0, 0, 0, "Converts selected to Nurbs Points"); - } - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_UNIFU,"Uniform U", 565,152,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in U"); - uiDefBut(block, BUT,B_UNIFV,"V", 670,152,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result doesn't go to end points in V"); - uiDefBut(block, BUT,B_ENDPU,"Endpoint U", 565,132,102, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in U"); - uiDefBut(block, BUT,B_ENDPV,"V", 670,132,50, 18, 0, 0, 0, 0, 0, "Nurbs only; interpolated result is forced to end points in V"); - uiDefBut(block, BUT,B_BEZU,"Bezier U", 565,112,102, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in U"); - uiDefBut(block, BUT,B_BEZV,"V", 670,112,50, 18, 0, 0, 0, 0, 0, "Nurbs only; make knots array mimic a Bezier in V"); - uiBlockEndAlign(block); - - uiDefBut(block, BUT,B_SETWEIGHT,"Set Weight", 465,11,95,49, 0, 0, 0, 0, 0, "Nurbs only; set weight for select points"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,0,"Weight:", 565,36,102,22, &editbutweight, 0.01, 100.0, 10, 0, "The weight you can assign"); - uiDefBut(block, BUT,B_SETW1,"1.0", 670,36,50,22, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT,B_SETW2,"sqrt(2)/4",565,11,55,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT,B_SETW3,"0.25", 620,11,45,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT,B_SETW4,"sqrt(0.5)",665,11,55,20, 0, 0, 0, 0, 0, ""); - uiBlockEndAlign(block); - - if(ob==G.obedit) { - nu= lastnu; - if(nu==NULL) nu= editNurb.first; - if(nu) { - if (ob->type==OB_CURVE) { - uiDefBut(block, LABEL, 0, "Tilt", - 467,87,72, 18, 0, 0, 0, 0, 0, ""); - /* KEY_LINEAR, KEY_CARDINAL, KEY_BSPLINE */ - uiDefButS(block, MENU, B_TILTINTERP, "Tilt Interpolation %t|Linear %x0|Cardinal %x1|BSpline %x2", - 467,67,72, 18, &(nu->tilt_interp), 0, 0, 0, 0, "Tilt interpolation"); - } - - uiBlockBeginAlign(block); - sp= &(nu->orderu); - uiDefButS(block, NUM, B_SETORDER, "Order U:", 565,90,102, 19, sp, 2.0, 6.0, 0, 0, "Nurbs only; the amount of control points involved"); - sp= &(nu->orderv); - uiDefButS(block, NUM, B_SETORDER, "V:", 670,90,50, 19, sp, 2.0, 6.0, 0, 0, "Nurbs only; the amount of control points involved"); - sp= &(nu->resolu); - uiDefButS(block, NUM, B_MAKEDISP, "Resol U:", 565,70,102, 19, sp, 1.0, 1024.0, 0, 0, "The amount of new points interpolated per control vertex pair"); - sp= &(nu->resolv); - uiDefButS(block, NUM, B_MAKEDISP, "V:", 670,70,50, 19, sp, 1.0, 1024.0, 0, 0, "The amount of new points interpolated per control vertex pair"); - } - } - - -} - -static void editing_panel_curve_tools1(Object *ob, Curve *cu) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_tools1", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Curve Tools1", "Editing", 960, 0, 318, 204)==0) return; - - uiDefBut(block, BUT, B_SUBDIVCURVE, "Subdivide", 400,180,150,20, 0, 0, 0, 0, 0, "Subdivide selected"); - if(ob->type==OB_SURF) { - uiDefBut(block, BUT, B_SPINNURB, "Spin", 400,160,150,20, 0, 0, 0, 0, 0, "Spin selected 360 degrees"); - } - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_HIDE, "Hide", 400,140,150,18, 0, 0, 0, 0, 0, "Hides selected faces"); - uiDefBut(block, BUT,B_REVEAL, "Reveal", 400,120,150,18, 0, 0, 0, 0, 0, "Reveals selected faces"); - uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 400,100,150,18, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 400, 60, 150, 19, &G.scene->editbutsize, 0.001, 1.0, 10, 0, "Normal size for drawing"); - uiDefButBitI(block, TOGN, G_HIDDENHANDLES, REDRAWVIEW3D, "Draw Handles", 400, 40, 150, 19, &G.f, 0, 0, 0, 0, "Draw curve handles in 3D view"); - uiBlockEndAlign(block); - - if(G.obedit) { - uiBut *but; - uiBlockBeginAlign(block); - but= uiDefButBitS(block,TOG,CU_RETOPO,B_NOP, "Retopo", 560,180,100,19, &cu->flag, 0,0,0,0, "Turn on the re-topology tool"); - uiButSetFunc(but,retopo_toggle,0,0); - if(cu->flag & CU_RETOPO) { - but= uiDefBut(block,BUT,B_NOP,"Retopo All", 560,160,100,19, 0,0,0,0,0, "Apply the re-topology tool to all selected vertices"); - uiButSetFunc(but,retopo_do_all_cb,0,0); - } - } -} - -/* only for bevel or taper */ -static void test_obcurpoin_but(char *name, ID **idpp) -{ - ID *id; - - for(id= G.main->object.first; id; id= id->next) { - if( strcmp(name, id->name+2)==0 ) { - if (((Object *)id)->type != OB_CURVE) { - error ("Bevel/Taper Object must be a Curve"); - break; - } - if(id == (ID *)OBACT) { - error ("Cannot Bevel/Taper own Object"); - break; - } - - *idpp= id; - return; - } - } - *idpp= NULL; -} - - - -/* for curve, surf and font! */ -static void editing_panel_curve_type(Object *ob, Curve *cu) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_curve_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Curve and Surface", "Editing", 320, 0, 318, 204)==0) return; - - uiDefButBitS(block, TOG, CU_UV_ORCO, 0, "UV Orco", 600,160,150,19, &cu->flag, 0, 0, 0, 0, "Forces to use UV coordinates for texture mapping 'orco'"); - if(ob->type==OB_SURF) - uiDefButBitS(block, TOG, CU_NOPUNOFLIP, REDRAWVIEW3D, "No Puno Flip", 600,140,150,19, &cu->flag, 0, 0, 0, 0, "Don't flip vertex normals while render"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_DOCENTER, "Center", 600, 115, 55, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin"); - uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 655, 115, 95, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data"); - uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location"); - uiBlockEndAlign(block); - - if(cu->key) { - /* uiDefButS(block, NUM, B_DIFF, "Slurph:", 600,25,140,19, &(cu->key->slurph), -500.0, 500.0,0,0); ,""*/ - uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 600, 72,150,19, &cu->key->type, 0, 0, 0, 0, ""); - } - - - if(ob->type!=OB_SURF) { - - if(ob->type==OB_CURVE) { - extern float prlen; // buttons_object.c, should be moved.... - char str[32]; - - sprintf(str, "%.4f", prlen); - uiDefBut(block, BUT, B_PRINTLEN, "PrintLen", 600,135,75,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, str, 675,135,75,19, 0, 1.0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - /*note, PathLen's max was MAXFRAMEF but this is a short, perhaps the pathlen should be increased later on */ - uiDefButS(block, NUM, B_RECALCPATH, "PathLen:", 600,50,150,19, &cu->pathlen, 1.0, 32767.0f, 0, 0, "If no speed Ipo was set, the amount of frames of the path"); - uiDefButBitS(block, TOG, CU_PATH, B_RECALCPATH, "CurvePath", 600,30,75,19 , &cu->flag, 0, 0, 0, 0, "Enables curve to become translation path"); - uiDefButBitS(block, TOG, CU_FOLLOW, REDRAWVIEW3D, "CurveFollow",675,30,75,19, &cu->flag, 0, 0, 0, 0, "Makes curve path children to rotate along path"); - uiDefButBitS(block, TOG, CU_STRETCH, B_CURVECHECK, "CurveStretch", 600,10,150,19, &cu->flag, 0, 0, 0, 0, "Option for curve-deform: makes deformed child to stretch along entire path"); - uiDefButBitS(block, TOG, CU_OFFS_PATHDIST, REDRAWVIEW3D, "PathDist Offs", 600,-10,150,19, &cu->flag, 0, 0, 0, 0, "Children will use TimeOffs value as path distance offset"); - - uiBlockEndAlign(block); - } - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_SETRESOLU, "DefResolU:", 760,160,150,19, &cu->resolu, 1.0, 1024.0, 0, 0, "Default resolution"); - uiDefButS(block, NUM, B_NOP, "RenResolU", 760,140,150,19, &cu->resolu_ren, 0.0f, 1024, 0, 0, "Set resolution for rendering. A value of zero skips this operation."); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MAKEDISP, "Width:", 760,90,150,19, &cu->width, 0.0, 2.0, 1, 0, "Make interpolated result thinner or fatter"); - uiDefButF(block, NUM, B_MAKEDISP, "Extrude:", 760,70,150,19, &cu->ext1, 0.0, 100.0, 10, 0, "Curve extrusion size when not using a bevel object"); - uiDefButF(block, NUM, B_MAKEDISP, "Bevel Depth:", 760,50,150,19, &cu->ext2, 0.0, 2.0, 1, 0, "Bevel depth when not using a bevel object"); - uiDefButS(block, NUM, B_MAKEDISP, "BevResol:", 760,30,150,19, &cu->bevresol, 0.0, 32.0, 0, 0, "Bevel resolution when depth is non-zero and not using a bevel object"); - uiDefIDPoinBut(block, test_obcurpoin_but, ID_OB, B_CHANGEDEP, "BevOb:", 760,10,150,19, &cu->bevobj, "Curve object name that defines the bevel shape"); - uiDefIDPoinBut(block, test_obcurpoin_but, ID_OB, B_CHANGEDEP, "TaperOb:", 760,-10,150,19, &cu->taperobj, "Curve object name that defines the taper (width)"); - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, CU_BACK, B_MAKEDISP, "Back", 760,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled back for extruded/beveled curves"); - uiDefButBitS(block, TOG, CU_FRONT, B_MAKEDISP, "Front",810,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled front for extruded/beveled curves"); - uiDefButBitS(block, TOG, CU_3D, B_CU3D, "3D", 860,115,50,19, &cu->flag, 0, 0, 0, 0, "Allow Curve to be 3d, it doesn't fill then"); - } -} - - -/* *************************** CAMERA ******************************** */ - -/* callback to handle angle to lens conversion */ -static void do_angletolensconversion_cb(void *lens1, void *angle1) -{ - float *lens= (float *)lens1; - float *angle= (float *)angle1; - float anglevalue= *angle; - - if(lens) { - *lens= 16.0f / tan(M_PI*anglevalue/360.0f); - } - - allqueue(REDRAWVIEW3D, 0); -} - -/* callback to handle lens to angle conversion */ -static void do_lenstoangleconversion_cb(void *lens1, void *angle1) -{ - float *lens= (float *)lens1; - float *angle= (float *)angle1; - float lensvalue= *lens; - - if(lens) { - *angle= 360.0f * atan(16.0f/lensvalue) / M_PI; - } - - allqueue(REDRAWVIEW3D, 0); -} - -static void editing_panel_camera_type(Object *ob, Camera *cam) -{ - uiBlock *block; - uiBut *but; - float grid=0.0; - - if(G.vd) grid= G.vd->grid; - if(grid<1.0) grid= 1.0; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Camera", "Editing", 320, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - uiDefBut(block, LABEL, 10, "Lens:", 10, 180, 150, 20, 0, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - if(cam->type==CAM_ORTHO) { - uiDefButF(block, NUM,REDRAWVIEW3D, "Scale:", - 10, 160, 150, 20, &cam->ortho_scale, 0.01, 1000.0, 50, 0, "Specify the ortho scaling of the used camera"); - } else { - if(cam->flag & CAM_ANGLETOGGLE) { - but= uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:", - 10, 160, 130, 20, &cam->angle, 7.323871, 172.847331, 100, 0, "Specify the lens of the camera in degrees"); - uiButSetFunc(but,do_angletolensconversion_cb, &cam->lens, &cam->angle); - } - else { - but= uiDefButF(block, NUM,REDRAWVIEW3D, "Lens:", - 10, 160, 130, 20, &cam->lens, 1.0, 250.0, 100, 0, "Specify the lens of the camera"); - uiButSetFunc(but,do_lenstoangleconversion_cb, &cam->lens, &cam->angle); - } - - uiDefButS(block, TOG|BIT|5, B_REDR, "D", - 140, 160, 20, 20, &cam->flag, 0, 0, 0, 0, "Use degree as the unit of the camera lens"); - } - uiDefButS(block, TOG, REDRAWVIEW3D, "Orthographic", - 10, 140, 150, 20, &cam->type, 0, 0, 0, 0, "Render with orthographic projection (no prespective)"); - uiBlockEndAlign(block); - -/* qdn: focal dist. param. from yafray now enabled for Blender as well, to use with defocus composit node */ - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "Dof Dist:", 10, 110, 150, 20 /*0, 125, 150, 20*/, &cam->YF_dofdist, 0.0, 5000.0, 50, 0, "Sets distance to point of focus (enable 'Limits' to make visible in 3Dview)"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "Dof Ob:", 10, 90, 150, 20, &cam->dof_ob, "Focus on this object (overrides the 'Dof Dist')"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Clipping Start/End:", 10, 45, 150, 20, 0, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,REDRAWVIEW3D, "Start:", - 10, 25, 150, 20, &cam->clipsta, 0.001*grid, 100.0*grid, 10, 0, "Clip out geometry closer then this distance to the camera"); - uiDefButF(block, NUM,REDRAWVIEW3D, "End:", - 10, 5, 150, 20, &cam->clipend, 1.0, 5000.0*grid, 100, 0, "Clip out geometry further then this distance to the camera"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Show:", 170, 180, 150, 20, 0, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButS(block, TOG|BIT|0, REDRAWVIEW3D, "Limits", - 170, 160, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw the clipping range and the focal point"); - uiDefButS(block, TOG|BIT|1, REDRAWVIEW3D, "Mist", - 245, 160, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw a line that indicates the mist area"); - - uiDefButS(block, TOG|BIT|4, REDRAWVIEW3D, "Name", - 170, 140, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw the active camera's name in camera view"); - uiDefButS(block, TOG|BIT|3, REDRAWVIEW3D, "Title Safe", - 245, 140, 75, 20, &cam->flag, 0, 0, 0, 0, "Draw a the title safe zone in camera view"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, TOG|BIT|2, REDRAWVIEW3D, "Passepartout", - 170, 110, 150, 20, &cam->flag, 0, 0, 0, 0, "Draw a darkened passepartout over the off-screen area in camera view"); - uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Alpha: ", - 170, 90, 150, 20, &cam->passepartalpha, 0.0, 1.0, 0, 0, "The opacity (darkness) of the passepartout"); - uiBlockEndAlign(block); - - uiDefButF(block, NUM,REDRAWVIEW3D, "Size:", - 170, 50, 150, 20, &cam->drawsize, 0.1*grid, 10.0, 10, 0, "The size that the camera is displayed in the 3D View (different from the object's scale)"); - - uiDefBut(block, LABEL, 0, "Shift:", 170, 25, 150, 20, 0, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,REDRAWVIEW3D, "X:", - 170, 5, 75, 20, &cam->shiftx, -2.0, 2.0, 1, 2, "Horizontally shift the camera view, without changing the perspective"); - uiDefButF(block, NUM,REDRAWVIEW3D, "Y:", - 245, 5, 75, 20, &cam->shifty, -2.0, 2.0, 1, 2, "Vertically shift the camera view, without changing the perspective"); - uiBlockEndAlign(block); -} - -/* yafray: extra camera panel to set Depth-of-Field parameters */ -static void editing_panel_camera_yafraydof(Object *ob, Camera *cam) -{ - uiBlock *block; - char *mst1, *mst2; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_yafraydof", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Camera", "Editing"); - if(uiNewPanel(curarea, block, "Yafray DoF", "Editing", 320, 0, 318, 204)==0) return; - - uiDefButF(block, NUM, REDRAWVIEW3D, "DoFDist:", 10, 147, 180, 20, &cam->YF_dofdist, 0.0, 5000.0, 50, 0, "Sets distance to point of focus (use camera 'ShowLimits' to make visible in 3Dview)"); - uiDefButF(block, NUM, B_DIFF, "Aperture:", 10, 125, 180, 20, &cam->YF_aperture, 0.0, 2.0, 1, 0, "Sets lens aperture, the larger, the more blur (use small values, 0 is no DoF)"); - - uiDefButBitS(block, TOG, CAM_YF_NO_QMC, B_DIFF, "Random sampling", 10, 90, 180, 20, &cam->flag, 0, 0, 0, 0, "Use noisy random Lens sampling instead of QMC"); - - uiDefBut(block, LABEL, 0, "Bokeh", 10, 60, 180, 19, 0, 0.0, 0.0, 0, 0, ""); - mst1 = "Bokeh Type%t|Disk1%x0|Disk2%x1|Triangle%x2|Square%x3|Pentagon%x4|Hexagon%x5|Ring%x6"; - uiDefButS(block, MENU, B_REDR, mst1, 10, 40, 89, 20, &cam->YF_bkhtype, 0.0, 0.0, 0, 0, "Sets Bokeh type"); - - if ((cam->YF_bkhtype!=0) && (cam->YF_bkhtype!=6)) { - mst2 = "Bokeh Bias%t|Uniform%x0|Center%x1|Edge%x2"; - uiDefButS(block, MENU, B_REDR, mst2, 100, 40, 90, 20, &cam->YF_bkhbias, 0.0, 0.0, 0, 0, "Sets Bokeh bias"); - if (cam->YF_bkhtype>1) - uiDefButF(block, NUM, B_DIFF, "Rotation:", 10, 15, 180, 20, &cam->YF_bkhrot, 0.0, 360.0, 100, 0, "Shape rotation amount in degrees"); - } - -} - -/* **************************** CAMERA *************************** */ - -void do_cambuts(unsigned short event) -{ - Object *ob; - Camera *cam; - - ob= OBACT; - if (ob==0) return; - cam= ob->data; - - switch(event) { - case 0: - ; - break; - } -} - -/* *************************** MBALL ******************************** */ - -void do_mballbuts(unsigned short event) -{ - switch(event) { - case B_RECALCMBALL: - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - } -} - -static void editing_panel_mball_type(Object *ob, MetaBall *mb) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "MetaBall", "Editing", 320, 0, 318, 204)==0) return; - - ob= find_basis_mball(ob); - mb= ob->data; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_RECALCMBALL, "Wiresize:", 470,178,250,19, &mb->wiresize, 0.05, 1.0, 1, 0, "Polygonization resolution in 3d window"); - uiDefButF(block, NUM, B_NOP, "Rendersize:", 470,158,250,19, &mb->rendersize, 0.05, 1.0, 1, 0, "Polygonization resolution in rendering"); - uiDefButF(block, NUM, B_RECALCMBALL, "Threshold:", 470,138,250,19, &mb->thresh, 0.0001, 5.0, 1, 0, "Defines influence of meta elements"); - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefBut(block, LABEL, 0, "Update:", 471,108,120,19, 0, 0, 0, 0, 0, ""); - uiDefButS(block, ROW, B_DIFF, "Always", 471, 85, 120, 19, &mb->flag, 0.0, 0.0, 0, 0, "While editing, always updates"); - uiDefButS(block, ROW, B_DIFF, "Half Res", 471, 65, 120, 19, &mb->flag, 0.0, 1.0, 0, 0, "While editing, updates in half resolution"); - uiDefButS(block, ROW, B_DIFF, "Fast", 471, 45, 120, 19, &mb->flag, 0.0, 2.0, 0, 0, "While editing, updates without polygonization"); - uiDefButS(block, ROW, B_DIFF, "Never", 471, 25, 120, 19, &mb->flag, 0.0, 3.0, 0, 0, "While editing, doesn't update"); - -} - -static void editing_panel_mball_tools(Object *ob, MetaBall *mb) -{ - extern MetaElem *lastelem; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mball_tools", UI_EMBOSS, UI_HELV, curarea->win); - if( uiNewPanel(curarea, block, "MetaBall tools", "Editing", 640, 0, 318, 204)==0) return; - - if(ob==G.obedit && lastelem) { - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 750,178,250,19, &lastelem->s, 0.0, 10.0, 1, 0, "Stiffness for active meta"); - if(lastelem->type!=MB_BALL) - uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 750,158,250,19, &lastelem->expx, 0.0, 20.0, 1, 0, "X size for active meta"); - if((lastelem->type!=MB_BALL)&&(lastelem->type!=MB_TUBE)) - uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 750,138,250,19, &lastelem->expy, 0.0, 20.0, 1, 0, "Y size for active meta"); - - if((lastelem->type==MB_CUBE)||(lastelem->type==MB_ELIPSOID)) - uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 750,118,250,19, &lastelem->expz, 0.0, 20.0, 1, 0, "Z size for active meta"); - uiBlockEndAlign(block); - - uiDefButS(block, ROW, B_RECALCMBALL, "Ball", 753,83,60,19, &lastelem->type, 1.0, MB_BALL, 0, 0, "Draw active meta as Ball"); - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_RECALCMBALL, "Tube", 753,62,60,19, &lastelem->type, 1.0, MB_TUBE, 0, 0, "Draw active meta as Ball"); - uiDefButS(block, ROW, B_RECALCMBALL, "Plane", 814,62,60,19, &lastelem->type, 1.0, MB_PLANE, 0, 0, "Draw active meta as Plane"); - uiDefButS(block, ROW, B_RECALCMBALL, "Elipsoid", 876,62,60,19, &lastelem->type, 1.0, MB_ELIPSOID, 0, 0, "Draw active meta as Ellipsoid"); - uiDefButS(block, ROW, B_RECALCMBALL, "Cube", 938,62,60,19, &lastelem->type, 1.0, MB_CUBE, 0, 0, "Draw active meta as Cube"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MB_NEGATIVE, B_RECALCMBALL, "Negative",753,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta creating holes"); - uiDefButBitS(block, TOG, MB_HIDE, B_RECALCMBALL, "Hide",878,16,125,19, &lastelem->flag, 0, 0, 0, 0, "Make active meta invisible"); - uiBlockEndAlign(block); - - } - -} - - -/* *************************** LATTICE ******************************** */ - -void do_latticebuts(unsigned short event) -{ - Object *ob; - Lattice *lt; - - ob= OBACT; - if(ob->type!=OB_LATTICE) return; - - switch(event) { - case B_REGULARLAT: - if(ob) { - lt = ob->data; - if(ob==G.obedit) resizelattice(editLatt, lt->opntsu, lt->opntsv, lt->opntsw, NULL); - else resizelattice(ob->data, lt->opntsu, lt->opntsv, lt->opntsw, NULL); - ob->softflag |= OB_SB_REDO; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - case B_RESIZELAT: - if(ob) { - lt = ob->data; - resizelattice(ob->data, lt->opntsu, lt->opntsv, lt->opntsw, ob); - ob->softflag |= OB_SB_REDO; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_DRAWLAT: - allqueue(REDRAWVIEW3D, 0); - break; - case B_LATTCHANGED: - - lt= ob->data; - if(lt->flag & LT_OUTSIDE) outside_lattice(lt); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - - break; - } -} - -static void editing_panel_lattice_type(Object *ob, Lattice *lt) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_lattice_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Lattice", "Editing", 320, 0, 318, 204)==0) return; - - - uiSetButLock(lt->key!=0, "Not with VertexKeys"); - uiSetButLock(ob==G.obedit, "Unable to perform function in EditMode"); - - uiBlockBeginAlign(block); - - lt->opntsu = lt->pntsu; - lt->opntsv = lt->pntsv; - lt->opntsw = lt->pntsw; - - uiDefButS(block, NUM, B_RESIZELAT, "U:", 469, 178,100,19, <->opntsu, 1.0, 64.0, 0, 0, "Points in U direction"); - uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 178, 40, 19, <->typeu, 1.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 178, 40, 19, <->typeu, 1.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 178, 40, 19, <->typeu, 1.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation"); - - uiDefButS(block, NUM, B_RESIZELAT, "V:", 469, 156,100,19, <->opntsv, 1.0, 64.0, 0, 0, "Points in V direction"); - uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 156, 40, 19, <->typev, 2.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 156, 40, 19, <->typev, 2.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 156, 40, 19, <->typev, 2.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation"); - - uiDefButS(block, NUM, B_RESIZELAT, "W:", 469, 134,100,19, <->opntsw, 1.0, 64.0, 0, 0, "Points in W direction"); - uiDefButC(block, ROW, B_LATTCHANGED, "Lin", 572, 134, 40, 19, <->typew, 3.0, (float)KEY_LINEAR, 0, 0, "Set Linear interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "Card", 613, 134, 40, 19, <->typew, 3.0, (float)KEY_CARDINAL, 0, 0, "Set Cardinal interpolation"); - uiDefButC(block, ROW, B_LATTCHANGED, "B", 652, 134, 40, 19, <->typew, 3.0, (float)KEY_BSPLINE, 0, 0, "Set B-spline interpolation"); - - uiBlockEndAlign(block); - - uiDefBut(block, BUT, B_REGULARLAT, "Make Regular", 469,98,102,31, 0, 0, 0, 0, 0, "Make Lattice regular"); - - uiClearButLock(); - uiDefButBitS(block, TOG, LT_OUTSIDE, B_LATTCHANGED, "Outside", 571,98,122,31, <->flag, 0, 0, 0, 0, "Only draw, and take into account, the outer vertices"); - - if(lt->key) { - uiDefButS(block, NUM, B_DIFF, "Slurph:", 469,60,120,19, &(lt->key->slurph), -500.0, 500.0, 0, 0, "Set time value to denote 'slurph' (sequential delay) vertices with key framing"); - uiDefButS(block, TOG, B_RELKEY, "Relative Keys", 469,40,120,19, <->key->type, 0, 0, 0, 0, "Use relative keys (instead of absolute)"); - } - -} - -/* *************************** ARMATURE ******************************** */ - -void do_armbuts(unsigned short event) -{ - Object *ob= OBACT; - - switch(event) { - case B_ARM_RECALCDATA: - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_ARM_STRIDE: - if(ob && ob->pose) { - bPoseChannel *pchan; - bActionStrip *strip; - - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) - if(pchan->flag & POSE_STRIDE) - break; - - /* we put the stride bone name in the strips, for lookup of action channel */ - for (strip=ob->nlastrips.first; strip; strip=strip->next){ - if(strip->flag & ACTSTRIP_USESTRIDE) { - if(pchan) BLI_strncpy(strip->stridechannel, pchan->name, 32); - else strip->stridechannel[0]= 0; - } - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_ARM_CALCPATHS: - if (ob && ob->pose) - pose_calculate_path(ob); - break; - case B_ARM_CLEARPATHS: - if (ob && ob->pose) - pose_clear_paths(ob); - break; - } -} - -static void validate_stridebutton_cb(void *pchanv, void *poin) -{ - Object *ob= OBACT; - bPoseChannel *pchan; - - if(ob && ob->pose) { - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next){ - if(pchan!=pchanv) - pchan->flag &= ~POSE_STRIDE; - } - } -} - -static int editbone_to_parnr (EditBone *bone) -{ - EditBone *ebone; - int index; - - for (ebone=G.edbo.first, index=0; ebone; ebone=ebone->next, index++){ - if (ebone==bone) - return index; - } - - return -1; -} - - -/* the "IK" button in editbuttons */ -static void attach_bone_to_parent_cb(void *bonev, void *arg2_unused) -{ - EditBone *ebone= bonev; - - if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { - /* Attach this bone to its parent */ - VECCOPY(ebone->head, ebone->parent->tail); - } -} - -static void parnr_to_editbone(EditBone *bone) -{ - if (bone->parNr == -1){ - bone->parent = NULL; - bone->flag &= ~BONE_CONNECTED; - } - else{ - bone->parent = BLI_findlink(&G.edbo, bone->parNr); - attach_bone_to_parent_cb(bone, NULL); - } -} - -static void parnr_to_editbone_cb(void *bonev, void *arg2_unused) -{ - EditBone *curBone= bonev; - parnr_to_editbone(curBone); -} - -/* only used for showing parent of editbones */ -static void build_bonestring (char *string, EditBone *bone) -{ - bArmature *arm= G.obedit->data; - EditBone *curBone; - EditBone *pBone; - int skip=0; - int index, numbones, i; - char (*qsort_ptr)[32] = NULL; - - /* That space is there for a reason - for no parent */ - sprintf (string, "Parent%%t| %%x%d", -1); - - numbones = BLI_countlist(&G.edbo); - - /* - * This will hold the bone names temporarily so we can sort them - */ - if (numbones > 0) - qsort_ptr = MEM_callocN (numbones * sizeof (qsort_ptr[0]), - "qsort_ptr"); - - numbones = 0; - for (curBone = G.edbo.first, index=0; curBone; - curBone=curBone->next, index++){ - /* Make sure this is a valid child */ - if (curBone != bone){ - skip=0; - for (pBone=curBone->parent; pBone; pBone=pBone->parent){ - if (pBone==bone){ - skip=1; - break; - } - } - /* no browsing for bones in invisible layers */ - if ((arm->layer & curBone->layer) == 0) { - /* but ensure the current parent at least shows */ - if(bone->parent!=curBone) - skip= 1; - } - - if (skip) - continue; - - sprintf (qsort_ptr[numbones], "|%s%%x%d", curBone->name, index); - numbones++; - } - } - qsort (qsort_ptr, numbones, sizeof (qsort_ptr[0]), - ( int (*)(const void *, const void *) ) strcmp); - - for (i=0; i < numbones; ++i) { - sprintf (string, "%s%s", string, qsort_ptr[i]); - } - - if (qsort_ptr) - MEM_freeN(qsort_ptr); -} - -/* assumes armature editmode */ -/* exported to drawview.c via BIF_butspace.h */ -void validate_editbonebutton_cb(void *bonev, void *namev) -{ - EditBone *eBone= bonev; - char oldname[32], newname[32]; - - /* need to be on the stack */ - BLI_strncpy(newname, eBone->name, 32); - BLI_strncpy(oldname, (char *)namev, 32); - /* restore */ - BLI_strncpy(eBone->name, oldname, 32); - - armature_bone_rename(G.obedit->data, oldname, newname); // editarmature.c - allqueue(REDRAWALL, 0); -} - -/* assumes armature posemode */ -static void validate_posebonebutton_cb(void *bonev, void *namev) -{ - Bone *bone= bonev; - Object *ob= OBACT; - char oldname[32], newname[32]; - - /* need to be on the stack */ - BLI_strncpy(newname, bone->name, 32); - BLI_strncpy(oldname, (char *)namev, 32); - /* restore */ - BLI_strncpy(bone->name, oldname, 32); - - armature_bone_rename(ob->data, oldname, newname); // editarmature.c - allqueue(REDRAWALL, 0); -} - -static void armature_layer_cb(void *lay_v, void *value_v) -{ - short *layer= lay_v; - int value= (long)value_v; - - if(*layer==0 || G.qual==0) *layer= value; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); -} - -static void editing_panel_armature_type(Object *ob, bArmature *arm) -{ - uiBlock *block; - uiBut *but; - int a; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_type", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Armature", "Editing", 320, 0, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "Editing Options", 10,180,150,20, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, ARM_MIRROR_EDIT, B_DIFF, "X-Axis Mirror", 10, 160,100,20, &arm->flag, 0, 0, 0, 0, "Enable X-axis mirrored editing"); - uiDefButBitC(block, TOG, OB_DRAWXRAY,REDRAWVIEW3D, "X-Ray", 110,160,100,20, &ob->dtx, 0, 0, 0, 0, "Draw armature in front of solid objects"); - uiDefButBitI(block, TOG, ARM_AUTO_IK, B_DIFF, "Auto IK", 210,160,100,20, &arm->flag, 0, 0, 0, 0, "Adds temporal IK chains while grabbing Bones"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Display Options", 10,133,150,19, 0, 0, 0, 0, 0, ""); - - /* layers */ - uiBlockBeginAlign(block); - for(a=0; a<8; a++) { - short dx= 18; - but= uiDefButBitS(block, BUT_TOGDUAL, 1<layer, 0, 0, 0, 0, ""); - uiButSetFunc(but, armature_layer_cb, &arm->layer, (void *)(1<layer, 0, 0, 0, 0, ""); - uiButSetFunc(but, armature_layer_cb, &arm->layer, (void *)(1<pose) - ob->pose->proxy_layer= arm->layer; - - uiBlockBeginAlign(block); - uiDefButI(block, ROW, REDRAWVIEW3D, "Octahedron", 10, 87,90,20, &arm->drawtype, 0, ARM_OCTA, 0, 0, "Draw bones as octahedra"); - uiDefButI(block, ROW, REDRAWVIEW3D, "Stick", 100, 87,55,20, &arm->drawtype, 0, ARM_LINE, 0, 0, "Draw bones as simple 2d lines with dots"); - uiDefButI(block, ROW, REDRAWVIEW3D, "B-Bone", 155, 87,70,20, &arm->drawtype, 0, ARM_B_BONE, 0, 0, "Draw bones as boxes, showing subdivision and b-splines"); - uiDefButI(block, ROW, REDRAWVIEW3D, "Envelope", 225, 87,85,20, &arm->drawtype, 0, ARM_ENVELOPE, 0, 0, "Draw bones as extruded spheres, showing deformation influence volume"); - - uiDefButBitI(block, TOG, ARM_DRAWAXES, REDRAWVIEW3D, "Draw Axes", 10, 67,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone axes"); - uiDefButBitI(block, TOG, ARM_DRAWNAMES, REDRAWVIEW3D, "Draw Names", 110,67,100,20, &arm->flag, 0, 0, 0, 0, "Draw bone names"); - uiDefButBitI(block, TOGN, ARM_NO_CUSTOM, REDRAWVIEW3D, "Draw Shapes", 210,67,100,20, &arm->flag, 0, 0, 0, 0, "Draw custom bone shapes"); - - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Deform Options", 10,40,150,20, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ARM_DEF_VGROUP, B_ARM_RECALCDATA, "Vertex Groups", 10, 20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable VertexGroups defining deform (not for Modifiers)"); - uiDefButBitS(block, TOG, ARM_DEF_ENVELOPE, B_ARM_RECALCDATA, "Envelopes", 110,20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable Bone Envelopes defining deform (not for Modifiers)"); - uiDefButBitS(block, TOG, ARM_DEF_QUATERNION, B_ARM_RECALCDATA, "Quaternion", 210,20,100,20, &arm->deformflag, 0, 0, 0, 0, "Enable deform rotation interpolation with Quaternions (not for Modifiers)"); - uiDefButBitI(block, TOG, ARM_RESTPOS, B_ARM_RECALCDATA,"Rest Position", 10,0,100,20, &arm->flag, 0, 0, 0, 0, "Show armature rest position, no posing possible"); - uiDefButBitI(block, TOG, ARM_DELAYDEFORM, REDRAWVIEW3D, "Delay Deform", 110,0,100,20, &arm->flag, 0, 0, 0, 0, "Don't deform children when manipulating bones in pose mode"); - uiDefButBitS(block, TOG, ARM_DEF_B_BONE_REST, B_ARM_RECALCDATA,"B-Bone Rest", 210,0,100,20, &arm->deformflag, 0, 0, 0, 0, "Make B-Bones deform already in rest position"); - uiBlockEndAlign(block); -} - -static void editing_panel_armature_visuals(Object *ob, bArmature *arm) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_visuals", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Armature", "Editing"); - if(uiNewPanel(curarea, block, "Armature Visualisations", "Editing", 320, 0, 318, 204)==0) return; - - /* version patch for older files here (do_versions patch too complicated) */ - if ((arm->ghostsf == 0) || (arm->ghostef == 0)) { - arm->ghostsf = CFRA - (arm->ghostep * arm->ghostsize); - arm->ghostef = CFRA + (arm->ghostep * arm->ghostsize); - } - if ((arm->pathsf == 0) || (arm->pathef == 0)) { - arm->pathsf = SFRA; - arm->pathef = EFRA; - } - if ((arm->pathbc == 0) || (arm->pathac == 0)) { - arm->pathbc = 15; - arm->pathac = 15; - } - - /* Ghost Drawing Options */ - uiDefBut(block, LABEL, 0, "Ghost Options", 10,180,150,20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButS(block, MENU, REDRAWVIEW3D, "Ghosts %t|Around Current Frame %x0|In Range %x1|On Keyframes %x2", - 10, 160, 150, 20, &arm->ghosttype, 0, 0, 0, 0, "Choose range of Ghosts to draw for current Action"); - - if (arm->ghosttype != ARM_GHOST_KEYS) - uiDefButS(block, NUM, REDRAWVIEW3D, "GStep: ", 10,140,120,20, &arm->ghostsize, 1.0f, 20.0f, 0, 0, "How many frames between Ghost instances"); - else - uiDefBut(block, LABEL, REDRAWVIEW3D, "GStep: N/A", 10,140,120,20, NULL, 0.0f, 0.0f, 0, 0, "How many frames between Ghost instances"); - uiDefButBitI(block, TOG, ARM_GHOST_ONLYSEL, REDRAWVIEW3D, "Sel", 130, 140, 30, 20, &arm->flag, 0, 0, 0, 0, "Only show Ghosts for selected bones"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - if (arm->ghosttype == ARM_GHOST_CUR) { - /* range is around current frame */ - uiDefButS(block, NUM, REDRAWVIEW3D, "Ghost: ", 10,110,150,20, &arm->ghostep, 0.0f, 30.0f, 0, 0, "Draw Ghosts around current frame, for current Action"); - } - else if (ELEM(arm->ghosttype, ARM_GHOST_RANGE, ARM_GHOST_KEYS)) { - /* range is defined by start+end frame below */ - uiDefButI(block, NUM,REDRAWVIEW3D,"GSta:",10,110,150,20, &arm->ghostsf,1.0,MAXFRAMEF, 0, 0, "The start frame for Ghost display range"); - uiDefButI(block, NUM,REDRAWVIEW3D,"GEnd:",10,90,150,20, &arm->ghostef,arm->ghostsf,MAXFRAMEF, 0, 0, "The end frame for Ghost display range"); - } - uiBlockEndAlign(block); - - /* Bone Path Drawing Options */ - uiDefBut(block, LABEL, 0, "Bone Paths Drawing:", 165,180,170,20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, REDRAWVIEW3D, "PStep:",170,160,80,20, &arm->pathsize,1,100, 10, 50, "Frames between highlighted points on bone path"); - uiDefButBitS(block, TOG, ARM_PATH_FNUMS, REDRAWVIEW3D, "Frame Nums", 250, 160, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show frame numbers on path"); - - uiDefButBitS(block, TOG, ARM_PATH_KFRAS, REDRAWVIEW3D, "Show Keys", 170, 140, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show key frames on path"); - uiDefButBitS(block, TOG, ARM_PATH_KFNOS, REDRAWVIEW3D, "Keyframe Nums", 250, 140, 80, 20, &arm->pathflag, 0, 0, 0, 0, "Show frame numbers of key frames on path"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ARM_PATH_ACFRA, REDRAWVIEW3D, "Around Current Frame", 170, 110, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Only show Bone Path around the current frame"); - - /* only show extra ranges when needed */ - if (arm->pathflag & ARM_PATH_ACFRA) { - uiDefButI(block, NUM, REDRAWVIEW3D,"PPre:",170,90,80,20, &arm->pathbc, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames before current frame for Bone Path display range"); - uiDefButI(block, NUM, REDRAWVIEW3D,"PPost:",250,90,80,20, &arm->pathac, 1.0, MAXFRAMEF/2, 0, 0, "The number of frames after current frame for Bone Path display range"); - } - uiBlockEndAlign(block); - - /* Bone Path Calculation Options */ - uiDefBut(block, LABEL, 0, "Bone Paths Calc.", 10,50,170,20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_ARM_CALCPATHS, "Calculate Paths", 10,30,155,20, 0, 0, 0, 0, 0, "(Re)calculates the paths of the selected bones"); - uiDefBut(block, BUT, B_ARM_CLEARPATHS, "Clear Paths", 10,10,155,20, 0, 0, 0, 0, 0, "Clears bone paths of the selected bones"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ARM_PATH_HEADS, REDRAWVIEW3D, "Bone-Head Path", 170, 30, 160, 20, &arm->pathflag, 0, 0, 0, 0, "Calculate the Path travelled by the Bone's Head instead of Tail"); - uiDefButI(block, NUM,REDRAWVIEW3D,"PSta:",170,10,80,20, &arm->pathsf, 1.0, MAXFRAMEF, 0, 0, "The start frame for Bone Path display range"); - uiDefButI(block, NUM,REDRAWVIEW3D,"PEnd:",250,10,80,20, &arm->pathef, arm->pathsf, MAXFRAMEF, 0, 0, "The end frame for Bone Path display range"); - uiBlockEndAlign(block); -} - -/* autocomplete callback for editbones */ -static void autocomplete_editbone(char *str, void *arg_v) -{ - if(G.obedit==NULL) return; - - /* search if str matches the beginning of an ID struct */ - if(str[0]) { - AutoComplete *autocpl= autocomplete_begin(str, 32); - EditBone *ebone; - - for (ebone=G.edbo.first; ebone; ebone=ebone->next) - if(ebone->name!=str) - autocomplete_do_name(autocpl, ebone->name); - - autocomplete_end(autocpl, str); - } -} - -static void editing_panel_armature_bones(Object *ob, bArmature *arm) -{ - uiBlock *block; - uiBut *but; - EditBone *curBone; - char *boneString=NULL; - int by=180; - int index, a; - - /* Draw the bone name block */ - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_armature_bones", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Armature Bones", "Editing", 640, 0, 318, 204)==0) return; - - /* this is a variable height panel, newpanel doesnt force new size on existing panels */ - /* so first we make it default height */ - uiNewPanelHeight(block, 204); - - - uiDefBut(block, LABEL, 0, "Selected Bones", 0,by,158,18, 0, 0, 0, 0, 0, "Only show in Armature Editmode"); - by-=20; - for (curBone=G.edbo.first, index=0; curBone; curBone=curBone->next, index++){ - if ((curBone->flag & BONE_SELECTED) && (curBone->layer & arm->layer)) { - - /* Bone naming button */ - but=uiDefBut(block, TEX, REDRAWVIEW3D, "BO:", -10,by,117,18, curBone->name, 0, 31, 0, 0, "Change the bone name"); - uiButSetFunc(but, validate_editbonebutton_cb, curBone, NULL); - uiButSetCompleteFunc(but, autocomplete_editbone, (void *)OBACT); - - uiDefBut(block, LABEL, 0, "child of", 107,by,73,18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - boneString = MEM_mallocN((BLI_countlist(&G.edbo) * 64)+64, "Bone str"); - build_bonestring (boneString, curBone); - - curBone->parNr = editbone_to_parnr(curBone->parent); - but = uiDefButI(block, MENU,REDRAWVIEW3D, boneString, 180,by,120,18, &curBone->parNr, 0.0, 0.0, 0.0, 0.0, "Parent"); - /* last arg NULL means button will put old string there */ - uiButSetFunc(but, parnr_to_editbone_cb, curBone, NULL); - - MEM_freeN(boneString); - - /* Connect to parent flag */ - if (curBone->parent){ - but=uiDefButBitI(block, TOG, BONE_CONNECTED, B_ARM_RECALCDATA, "Con", 300,by,32,18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Connect this Bone to Parent"); - uiButSetFunc(but, attach_bone_to_parent_cb, curBone, NULL); - } - - /* Segment, dist and weight buttons */ - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_ARM_RECALCDATA, "Segm: ", -10,by-19,117,18, &curBone->segments, 1.0, 32.0, 0.0, 0.0, "Subdivisions for B-bones"); - uiDefButF(block, NUM,B_ARM_RECALCDATA, "Dist:", 110, by-19, 105, 18, &curBone->dist, 0.0, 1000.0, 10.0, 0.0, "Bone deformation distance"); - uiDefButF(block, NUM,B_ARM_RECALCDATA, "Weight:", 225, by-19,105, 18, &curBone->weight, 0.0F, 1000.0F, 10.0F, 0.0F, "Bone deformation weight"); - - /* bone types */ - uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); - uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); - uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 18, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry"); - uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,18, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup"); - uiDefButBitI(block, TOG, BONE_HIDDEN_A, REDRAWVIEW3D, "Hide", 250,by-38,80,18, &curBone->flag, 0, 0, 0, 0, "Toggles display of this bone in Edit Mode"); - - /* layers */ - uiBlockBeginAlign(block); - for(a=0; a<8; a++) { - short dx= 21; - but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); - uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); - uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<id.lib) - return 0; - if(arm->id.lib) { - if(pchan==NULL) - uiSetButLock(1, ERROR_LIBDATA_MESSAGE); - else if(ob->proxy && bone->layer & arm->layer_protected) { - uiSetButLock(1, "Can't edit protected proxy channel"); - return 1; - } - else - uiClearButLock(); - } - return 0; -} - -static void editing_panel_pose_bones(Object *ob, bArmature *arm) -{ - uiBlock *block; - uiBut *but; - bPoseChannel *pchan; - Bone *curBone; - int by, a; - int index, zerodof, zerolimit; - - /* Draw the bone name block */ - block= uiNewBlock(&curarea->uiblocks, "editing_panel_pose_bones", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Armature Bones", "Editing", 640, 0, 318, 204)==0) return; - - /* this is a variable height panel, newpanel doesnt force new size on existing panels */ - /* so first we make it default height */ - uiNewPanelHeight(block, 204); - - uiDefBut(block, LABEL, 0, "Selected Bones", 0,180,158,18, 0, 0, 0, 0, 0, "Only show in Armature Editmode/Posemode"); - by= 160; - - for (pchan=ob->pose->chanbase.first, index=0; pchan; pchan=pchan->next, index++){ - curBone= pchan->bone; - if ((curBone->flag & BONE_SELECTED) && (curBone->layer & arm->layer)) { - - if(ob_arm_bone_pchan_lock(ob, arm, curBone, pchan)) - uiDefBut(block, LABEL, 0, "Proxy Locked", 160, 180,150,18, NULL, 1, 0, 0, 0, ""); - - /* Bone naming button */ - uiBlockBeginAlign(block); - but=uiDefBut(block, TEX, REDRAWVIEW3D, "BO:", -10,by,117,19, curBone->name, 0, 24, 0, 0, "Change the bone name"); - uiButSetFunc(but, validate_posebonebutton_cb, curBone, NULL); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - - /* Dist and weight buttons */ - uiDefButF(block, NUM,B_ARM_RECALCDATA, "Dist:", 107, by, 105, 19, &curBone->dist, 0.0, 1000.0, 10.0, 0.0, "Bone deformation distance"); - uiDefButF(block, NUM,B_ARM_RECALCDATA, "Weight:", 220, by, 110, 19, &curBone->weight, 0.0F, 1000.0F, 10.0F, 0.0F, "Bone deformation weight"); - - /* Segment, ease in/out buttons */ - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_ARM_RECALCDATA, "Segm: ", -10,by-19,117,19, &curBone->segments, 1.0, 32.0, 0.0, 0.0, "Subdivisions for B-bones"); - uiDefButF(block, NUM,B_ARM_RECALCDATA, "In:", 107, by-19,105, 19, &curBone->ease1, 0.0, 2.0, 10.0, 0.0, "First length of Bezier handle"); - uiDefButF(block, NUM,B_ARM_RECALCDATA, "Out:", 220, by-19, 110, 19, &curBone->ease2, 0.0, 2.0, 10.0, 0.0, "Second length of Bezier handle"); - - /* bone types */ - uiDefButBitI(block, TOG, BONE_HINGE, B_ARM_RECALCDATA, "Hinge", -10,by-38,80,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit rotation or scale from parent Bone"); - uiDefButBitI(block, TOG, BONE_NO_SCALE, B_ARM_RECALCDATA, "S", 70,by-38,20,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Don't inherit scale from parent Bone"); - uiDefButBitI(block, TOGN, BONE_NO_DEFORM, B_ARM_RECALCDATA, "Deform", 90, by-38, 80, 19, &curBone->flag, 0.0, 0.0, 0.0, 0.0, "Indicate if Bone deforms geometry"); - uiDefButBitI(block, TOG, BONE_MULT_VG_ENV, B_ARM_RECALCDATA, "Mult", 170,by-38,80,19, &curBone->flag, 1.0, 32.0, 0.0, 0.0, "Multiply Bone Envelope with VertexGroup"); - ob_arm_bone_pchan_lock(ob, arm, curBone, pchan); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "OB:", 250,by-38,80,19, &pchan->custom, "Object that defines custom draw type for this Bone"); - ob_arm_bone_pchan_lock(ob, arm, curBone, NULL); - - /* layers */ - uiBlockBeginAlign(block); - for(a=0; a<8; a++) { - short dx= 21; - but= uiDefButBitS(block, TOG, 1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); - uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<layer, 0, 0, 0, 0, "Armature layer that bone exists on"); - uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<ikflag, 0.0, 0.0, 0.0, 0.0, "Disable X DoF for IK"); - if ((pchan->ikflag & BONE_IK_NO_XDOF)==0) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff X:", -10, by-80, 114, 19, &pchan->stiffness[0], 0.0, 0.99, 1.0, 0.0, "Resistance to bending for X axis"); - uiDefButBitS(block, TOG, BONE_IK_XLIMIT, B_ARM_RECALCDATA, "Limit X", -10,by-100,114,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over X axis"); - if ((pchan->ikflag & BONE_IK_XLIMIT)) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min X:", -10, by-120, 114, 19, &pchan->limitmin[0], -180.0, 0.0, 1000, 1, "Minimum X limit"); - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max X:", -10, by-140, 114, 19, &pchan->limitmax[0], 0.0, 180.0f, 1000, 1, "Maximum X limit"); - zerolimit = 0; - } - zerodof = 0; - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BONE_IK_NO_YDOF, B_ARM_RECALCDATA, "Lock Y Rot", 104,by-60,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Disable Y DoF for IK"); - if ((pchan->ikflag & BONE_IK_NO_YDOF)==0) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff Y:", 104, by-80, 114, 19, &pchan->stiffness[1], 0.0, 0.99, 1.0, 0.0, "Resistance to twisting over Y axis"); - uiDefButBitS(block, TOG, BONE_IK_YLIMIT, B_ARM_RECALCDATA, "Limit Y", 104,by-100,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over Y axis"); - if ((pchan->ikflag & BONE_IK_YLIMIT)) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min Y:", 104, by-120, 113, 19, &pchan->limitmin[1], -180.0, 0.0, 1000, 1, "Minimum Y limit"); - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max Y:", 104, by-140, 113, 19, &pchan->limitmax[1], 0.0, 180.0, 1000, 1, "Maximum Y limit"); - zerolimit = 0; - } - zerodof = 0; - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BONE_IK_NO_ZDOF, B_ARM_RECALCDATA, "Lock Z Rot", 217,by-60,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Disable Z DoF for IK"); - if ((pchan->ikflag & BONE_IK_NO_ZDOF)==0) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stiff Z:", 217, by-80, 114, 19, &pchan->stiffness[2], 0.0, 0.99, 1.0, 0.0, "Resistance to bending for Z axis"); - uiDefButBitS(block, TOG, BONE_IK_ZLIMIT, B_ARM_RECALCDATA, "Limit Z", 217,by-100,113,19, &pchan->ikflag, 0.0, 0.0, 0.0, 0.0, "Limit rotation over Z axis"); - if ((pchan->ikflag & BONE_IK_ZLIMIT)) { - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Min Z:", 217, by-120, 113, 19, &pchan->limitmin[2], -180.0, 0.0, 1000, 1, "Minimum Z limit"); - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Max Z:", 217, by-140, 113, 19, &pchan->limitmax[2], 0.0, 180.0, 1000, 1, "Maximum Z limit"); - zerolimit = 0; - } - zerodof = 0; - } - uiBlockEndAlign(block); - - by -= (zerodof)? 82: (zerolimit)? 122: 162; - - uiDefButF(block, NUM, B_ARM_RECALCDATA, "Stretch:", -10, by, 113, 19, &pchan->ikstretch, 0.0, 1.0, 1.0, 0.0, "Allow scaling of the bone for IK"); - - by -= 20; - } - else { - but= uiDefButBitS(block, TOG, POSE_STRIDE, B_ARM_STRIDE, "Stride Root", -10, by-60, 113, 19, &pchan->flag, 0.0, 0.0, 0, 0, "Set this PoseChannel to define the Stride distance"); - uiButSetFunc(but, validate_stridebutton_cb, pchan, NULL); - - uiDefBut(block, LABEL, 0, "(DoF only for IK chains)", 110,by-60, 190, 19, 0, 0, 0, 0, 0, ""); - by -= 82; - } - - - if(by < -200) break; // for time being... extreme long panels are very slow - } - } - - if(by<0) { - uiNewPanelHeight(block, 204 - by); - } - -} - - -/* *************************** MESH ******************************** */ - -/* from this object to all objects with same ob->data */ -static void copy_linked_vgroup_channels(Object *ob) -{ - Base *base; - - for(base=FIRSTBASE; base; base= base->next) { - if(base->object->type==ob->type) { - if(base->object!=ob && base->object->data==ob->data) { - BLI_freelistN(&base->object->defbase); - duplicatelist(&base->object->defbase, &ob->defbase); - base->object->actdef= ob->actdef; - DAG_object_flush_update(G.scene, base->object, OB_RECALC_DATA); - } - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - -void do_vgroupbuts(unsigned short event) -{ - Object *ob= OBACT; - - switch(event) { - case B_NEWVGROUP: - add_defgroup (ob); - scrarea_queue_winredraw(curarea); - allqueue(REDRAWOOPS, 0); - break; - case B_DELVGROUP: - if ((G.obedit) && (G.obedit == ob)) - del_defgroup (ob); - else - del_defgroup_in_object_mode (ob); - allqueue (REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Delete vertex group"); - break; - case B_ASSIGNVGROUP: - assign_verts_defgroup (); - allqueue (REDRAWVIEW3D, 1); - BIF_undo_push("Assign to vertex group"); - break; - case B_REMOVEVGROUP: - remove_verts_defgroup (0); - allqueue (REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Remove from vertex group"); - break; - case B_SELVGROUP: - sel_verts_defgroup(1); - allqueue (REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - countall(); - break; - case B_DESELVGROUP: - sel_verts_defgroup(0); - allqueue (REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - countall(); - break; - case B_LINKEDVGROUP: - copy_linked_vgroup_channels(ob); - break; - case B_COPYVGROUP: - duplicate_defgroup (ob); - scrarea_queue_winredraw (curarea); - allqueue (REDRAWOOPS, 0); - break; - } -} - -void do_meshbuts(unsigned short event) -{ - Object *ob; - Mesh *me; - MCol *mcol; - EditMesh *em= G.editMesh; - float fac; - int count; /* store num of changes made to see if redraw & undo are needed*/ - int layernum; - short randfac; - - ob= OBACT; - if(ob && ob->type==OB_MESH) { - - me= get_mesh(ob); - if(me==NULL) return; - - switch(event) { - case B_DELSTICKY: - if(me->msticky) { - CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert); - me->msticky= NULL; - BIF_undo_push("Delete Sticky"); - } - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_MAKESTICKY: - RE_make_sticky(); - BIF_undo_push("Make Sticky"); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_NEWMCOL: - if(G.obedit) { - layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL); - EM_add_data_layer(&em->fdata, CD_MCOL); - CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum); - } - else if(me) { - mcol= me->mcol; - layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL); - - if(mcol) - CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE, - mcol, me->totface); - else - CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC, - NULL, me->totface); - - CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum); - mesh_update_customdata_pointers(me); - - if(!mcol) - shadeMeshMCol(ob, me); - } - - if (me->mr) multires_load_cols(me); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("New Vertex Color"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_SETMCOL: - if (G.obedit || me) { - CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata; - CustomData_set_layer_active(fdata, CD_MCOL, actmcol-1); - mesh_update_customdata_pointers(me); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Set Active Vertex Color"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_SETMCOL_RND: - if (G.obedit || me) { - CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata; - CustomData_set_layer_render(fdata, CD_MCOL, actmcol_rnd-1); - - BIF_undo_push("Set Render Vertex Color"); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case B_NEWTFACE: - if(me) - layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE); - else - layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE); - - if(me && me->mr) { - multires_add_layer(me, &me->mr->fdata, CD_MTFACE, layernum); - } - else if(G.obedit) { - EM_add_data_layer(&em->fdata, CD_MTFACE); - CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum); - } - else if(me) { - if(me->mtface) - CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE, - me->mtface, me->totface); - else - CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, - NULL, me->totface); - - CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum); - mesh_update_customdata_pointers(me); - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("New UV Texture"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_SETTFACE: - if (G.obedit || me) { - CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata; - - CustomData_set_layer_active(fdata, CD_MTFACE, acttface-1); - mesh_update_customdata_pointers(me); - - /* Update first-level face data in multires */ - if(me && me->mr && me->mr->current != 1) - CustomData_set_layer_active(&me->mr->fdata, CD_MTFACE, acttface-1); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Set Active UV Texture"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SETTFACE_RND: - if (G.obedit || me) { - CustomData *fdata= (G.obedit)? &em->fdata: &me->fdata; - CustomData_set_layer_render(fdata, CD_MTFACE, acttface_rnd-1); - BIF_undo_push("Set Render UV Texture"); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case B_FLIPNORM: - if(G.obedit) { - flip_editnormals(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Flip Normals"); - allqueue(REDRAWVIEW3D, 0); - } - break; - } - } - if(G.obedit==NULL || (G.obedit->type!=OB_MESH)) return; - - switch(event) { - case B_SPIN: - if( select_area(SPACE_VIEW3D)) spin_mesh(G.scene->toolsettings->step, G.scene->toolsettings->degr, 0, 0); - break; - case B_SPINDUP: - if( select_area(SPACE_VIEW3D)) spin_mesh(G.scene->toolsettings->step, G.scene->toolsettings->degr, 0, 1); - break; - case B_EXTR: - G.f |= G_DISABLE_OK; - if( select_area(SPACE_VIEW3D)) extrude_mesh(); - G.f -= G_DISABLE_OK; - break; - case B_SCREW: - if( select_area(SPACE_VIEW3D)) screw_mesh(G.scene->toolsettings->step, G.scene->toolsettings->turn); - break; - case B_EXTREP: - if( select_area(SPACE_VIEW3D)) extrude_repeat_mesh(G.scene->toolsettings->step, G.scene->toolsettings->extr_offs); - break; - case B_SPLIT: - G.f |= G_DISABLE_OK; - split_mesh(); - G.f -= G_DISABLE_OK; - break; - case B_REMDOUB: - count= removedoublesflag(1, 0, G.scene->toolsettings->doublimit); - notice("Removed: %d", count); - if (count) { /* only undo and redraw if an action is taken */ - countall (); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Rem Doubles"); - } - break; - case B_SUBDIV: - waitcursor(1); - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag,1,0); - countall(); - waitcursor(0); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Subdivide"); - break; - case B_FRACSUBDIV: - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - waitcursor(1); - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag,1,0); - countall(); - waitcursor(0); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Fractal Subdivide"); - break; - case B_XSORT: - if( select_area(SPACE_VIEW3D)) xsortvert_flag(1); - break; - case B_HASH: - hashvert_flag(1); - break; - case B_TOSPHERE: - vertices_to_sphere(); - break; - case B_VERTEXNOISE: - vertexnoise(); - break; - case B_VERTEXSMOOTH: - vertexsmooth(); - break; - case B_DRAWEDGES: - G.f &= ~G_DRAWCREASES; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_DRAWCREASES: - G.f &= ~G_DRAWEDGES; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_JOINTRIA: - join_triangles(); - break; - case B_GEN_SKELETON: - generateSkeleton(); - break; - } - - /* WATCH IT: previous events only in editmode! */ -} - -static void editing_panel_mesh_tools(Object *ob, Mesh *me) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Mesh Tools", "Editing", 640, 0, 318, 254)==0) return; - - uiBlockBeginAlign(block); - //uiDefButBitS(block, TOG, B_AUTOFGON, 0, "FGon", 10,195,30,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' To create FGon on inner edges where possible"); - uiDefButBitS(block, TOG, B_BEAUTY, 0, "Beauty", 10,195,53,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using long edges unless 'Short' is selected"); - uiDefButBitS(block, TOG, B_BEAUTY_SHORT, 0, "Short", 63,195,52,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "If Beauty is set, 'Subdivide' splits faces in halves using short edges"); - - uiDefBut(block, BUT,B_SUBDIV,"Subdivide", 115,195,105,19, 0, 0, 0, 0, 0, "Splits selected faces into halves or quarters"); - - uiDefButS(block, MENU, B_DIFF, "Corner Cut Type %t|Path %x0|Innervert %x1|Fan %x2", - 220, 195, 105, 19, &G.scene->toolsettings->cornertype , 0, 0, 0, 0, "Choose Quad Corner Cut Type"); - - uiDefBut(block, BUT,B_VERTEXNOISE,"Noise", 10,175,78,19, 0, 0, 0, 0, 0, "Use vertex coordinate as texture coordinate"); - uiDefBut(block, BUT,B_HASH,"Hash", 88,175,78,19, 0, 0, 0, 0, 0, "Randomizes selected vertex sequence data"); - uiDefBut(block, BUT,B_XSORT,"Xsort", 166,175,78,19, 0, 0, 0, 0, 0, "Sorts selected vertex data in the X direction"); - uiDefBut(block, BUT,B_FRACSUBDIV, "Fractal", 244,175,81,19, 0, 0, 0, 0, 0, "Subdivides selected faces with a random factor"); - - - uiDefBut(block, BUT,B_TOSPHERE,"To Sphere", 10,155,78,19, 0, 0, 0, 0, 0, "Moves selected vertices outwards into a spherical shape"); - uiDefBut(block, BUT,B_VERTEXSMOOTH,"Smooth", 88,155,78,19, 0, 0, 0, 0, 0, "Flattens angles of selected faces"); - uiDefBut(block, BUT,B_SPLIT,"Split", 166,155,78,19, 0, 0, 0, 0, 0, "Splits selected vertices to separate sub-mesh"); - uiDefBut(block, BUT,B_FLIPNORM,"Flip Normals", 244,155,81,19, 0, 0, 0, 0, 0, "Toggles the direction of the selected face's normals"); - - uiDefBut(block, BUT,B_REMDOUB,"Rem Doubles", 10,135,78,19, 0, 0, 0, 0, 0, "Removes duplicates from selected vertices"); - uiDefButF(block, NUM, B_DIFF, "Limit:", 88,135,117,19, &G.scene->toolsettings->doublimit, 0.0001, 1.0, 10, 0, "Specifies the max distance 'Rem Doubles' will consider vertices as 'doubled'"); - uiDefButF(block, NUM, B_DIFF, "Threshold:", 205,135,120,19, &G.scene->toolsettings->select_thresh, 0.0001, 1.0, 10, 0, "Tolerence for the 'Select Group' tool (Shift+G) and 'Knife Exact' (vertex snap)."); - uiBlockEndAlign(block); - - uiDefBut(block, BUT,B_EXTR,"Extrude", 10,105,315,24, 0, 0, 0, 0, 0, "Converts selected edges to faces and selects the new vertices"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_SPIN, "Spin", 10,75,100,24, 0, 0, 0, 0, 0, "Extrudes the selected vertices in a circle around the cursor in the indicated viewport"); - uiDefBut(block, BUT,B_SPINDUP,"Spin Dup", 110,75,100,24, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a circle around the cursor in the indicated viewport"); - uiDefBut(block, BUT,B_SCREW,"Screw", 210,75,115,24, 0, 0, 0, 0, 0, "Activates the screw tool"); // Bish - This could use some more definition - - uiDefButF(block, NUM, B_DIFF, "Degr:", 10,55,100,19, &G.scene->toolsettings->degr,-360.0,360.0, 1000, 0, "Specifies the number of degrees 'Spin' revolves"); - uiDefButS(block, NUM, B_DIFF, "Steps:", 110,55,100,19, &G.scene->toolsettings->step,1.0,180.0, 0, 0, "Specifies the total number of 'Spin' slices"); - uiDefButS(block, NUM, B_DIFF, "Turns:", 210,55,115,19, &G.scene->toolsettings->turn,1.0,360.0, 0, 0, "Specifies the number of revolutions the screw turns"); - uiDefButBitS(block, TOG, B_KEEPORIG, B_DIFF, "Keep Original",10,35,200,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Keeps a copy of the original vertices and faces after executing tools"); - uiDefButBitS(block, TOG, B_CLOCKWISE, B_DIFF, "Clockwise", 210,35,115,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Specifies the direction for 'Screw' and 'Spin'"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_EXTREP, "Extrude Dup", 10,10,150,19, 0, 0, 0, 0, 0, "Creates copies of the selected vertices in a straight line away from the current viewport"); - uiDefButF(block, NUM, B_DIFF, "Offset:", 160,10,165,19, &G.scene->toolsettings->extr_offs, 0.01, 100.0, 100, 0, "Sets the distance between each copy for 'Extrude Dup'"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_JOINTRIA, "Join Triangles", 10, -20, 120, 19, 0, 0, 0, 0, 0, "Convert selected triangles to Quads"); - uiDefButF(block, NUM, B_DIFF, "Threshold", 130, -20, 195, 19, &G.scene->toolsettings->jointrilimit, 0.0, 1.0, 5, 0, "Conversion threshold for complex islands"); - uiDefButBitS(block, TOG, B_JOINTRIA_UV, 0, "Delimit UVs", 10, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where UVs match"); - uiDefButBitS(block, TOG, B_JOINTRIA_VCOL, 0, "Delimit Vcol", 90, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where Vcols match"); - uiDefButBitS(block, TOG, B_JOINTRIA_SHARP, 0, "Delimit Sharp", 170, -40, 78, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where edge is not sharp"); - uiDefButBitS(block, TOG, B_JOINTRIA_MAT, 0, "Delimit Mat", 250, -40, 74, 19, &G.scene->toolsettings->editbutflag, 0,0,0,0, "Join pairs only where material matches"); - uiBlockEndAlign(block); - - -} - -static void verify_vertexgroup_name_func(void *datav, void *data2_unused) -{ - unique_vertexgroup_name((bDeformGroup*)datav, OBACT); -} - -static void skgen_reorder(void *option, void *arg2) -{ - char tmp; - switch ((int)option) - { - case 0: - tmp = G.scene->toolsettings->skgen_subdivisions[0]; - G.scene->toolsettings->skgen_subdivisions[0] = G.scene->toolsettings->skgen_subdivisions[1]; - G.scene->toolsettings->skgen_subdivisions[1] = tmp; - break; - case 1: - tmp = G.scene->toolsettings->skgen_subdivisions[2]; - G.scene->toolsettings->skgen_subdivisions[2] = G.scene->toolsettings->skgen_subdivisions[1]; - G.scene->toolsettings->skgen_subdivisions[1] = tmp; - break; - case 2: - tmp = G.scene->toolsettings->skgen_subdivisions[0]; - G.scene->toolsettings->skgen_subdivisions[0] = G.scene->toolsettings->skgen_subdivisions[2]; - G.scene->toolsettings->skgen_subdivisions[2] = G.scene->toolsettings->skgen_subdivisions[1]; - G.scene->toolsettings->skgen_subdivisions[1] = tmp; - break; - } -} - -static void editing_panel_mesh_skgen(Object *ob, Mesh *me) -{ - uiBlock *block; - uiBut *but; - int i; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_skgen", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Skeleton Generator", "Editing", 960, 0, 318, 204)==0) return; - - uiDefBut(block, BUT, B_GEN_SKELETON, "Generate Skeleton", 1025,170,250,19, 0, 0, 0, 0, 0, "Generate Skeleton from Mesh"); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_DIFF, "Resolution:", 1025,150,250,19, &G.scene->toolsettings->skgen_resolution,10.0,1000.0, 0, 0, "Specifies the resolution of the graph's embedding"); - uiDefButBitS(block, TOG, SKGEN_FILTER_INTERNAL, B_DIFF, "Filter In", 1025,130, 83,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Filter internal small arcs from graph"); - uiDefButF(block, NUM, B_DIFF, "T:", 1111,130,164,19, &G.scene->toolsettings->skgen_threshold_internal,0.0, 1.0, 10, 0, "Specify the threshold ratio for filtering internal arcs"); - uiDefButBitS(block, TOG, SKGEN_FILTER_EXTERNAL, B_DIFF, "Filter Ex", 1025,110, 83,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Filter external small arcs from graph"); - uiDefButF(block, NUM, B_DIFF, "T:", 1111,110,164,19, &G.scene->toolsettings->skgen_threshold_external,0.0, 1.0, 10, 0, "Specify the threshold ratio for filtering external arcs"); - - for(i = 0; i < SKGEN_SUB_TOTAL; i++) - { - int y = 90 - 20 * i; - - but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, 1025, y, 16, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Change the order the subdivisions algorithm are applied"); - uiButSetFunc(but, skgen_reorder, (void *)i, NULL); - - switch(G.scene->toolsettings->skgen_subdivisions[i]) - { - case SKGEN_SUB_LENGTH: - uiDefButBitS(block, TOG, SKGEN_CUT_LENGTH, B_DIFF, "Length", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs in bones of equal length"); - uiDefButF(block, NUM, B_DIFF, "T:", 1111, y, 82,19, &G.scene->toolsettings->skgen_length_ratio,1.0, 4.0, 10, 0, "Specify the ratio limit between straight arc and embeddings to trigger equal subdivisions"); - uiDefButF(block, NUM, B_DIFF, "L:", 1193, y, 82,19, &G.scene->toolsettings->skgen_length_limit,0.1,50.0, 10, 0, "Maximum length of the bones when subdividing"); - break; - case SKGEN_SUB_ANGLE: - uiDefButBitS(block, TOG, SKGEN_CUT_ANGLE, B_DIFF, "Angle", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs based on angle"); - uiDefButF(block, NUM, B_DIFF, "T:", 1111, y,164,19, &G.scene->toolsettings->skgen_angle_limit,0.0, 90.0, 10, 0, "Specify the threshold angle in degrees for subdivision"); - break; - case SKGEN_SUB_CORRELATION: - uiDefButBitS(block, TOG, SKGEN_CUT_CORRELATION, B_DIFF, "Correlation", 1041, y, 67,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Subdivide arcs based on correlation"); - uiDefButF(block, NUM, B_DIFF, "T:", 1111, y,164,19, &G.scene->toolsettings->skgen_correlation_limit,0.0, 1.0, 0.01, 0, "Specify the threshold correlation for subdivision"); - break; - } - } - - uiDefButBitS(block, TOG, SKGEN_SYMMETRY, B_DIFF, "Symmetry", 1025, 30,125,19, &G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Restore symmetries based on topology"); - uiDefButF(block, NUM, B_DIFF, "T:", 1150, 30,125,19, &G.scene->toolsettings->skgen_symmetry_limit,0.0, 1.0, 10, 0, "Specify the threshold distance for considering potential symmetric arcs"); - uiDefButC(block, NUM, B_DIFF, "P:", 1025, 10, 62,19, &G.scene->toolsettings->skgen_postpro_passes, 0, 10, 10, 0, "Specify the number of processing passes on the embeddings"); - uiDefButC(block, ROW, B_DIFF, "Smooth", 1087, 10, 63,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_SMOOTH, 0, 0, "Smooth embeddings"); - uiDefButC(block, ROW, B_DIFF, "Average", 1150, 10, 62,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_AVERAGE, 0, 0, "Average embeddings"); - uiDefButC(block, ROW, B_DIFF, "Sharpen", 1212, 10, 63,19, &G.scene->toolsettings->skgen_postpro, 5.0, (float)SKGEN_SHARPEN, 0, 0, "Sharpen embeddings"); - uiBlockEndAlign(block); -} - -static void editing_panel_mesh_tools1(Object *ob, Mesh *me) -{ - uiBlock *block; - - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_tools1", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Mesh Tools 1", "Editing", 960, 0, 318, 204)==0) return; - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_SELSWAP, "Select Swap", 955, 200, 106, 19, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces (Ctrl+I)"); - uiDefBut(block, BUT,B_HIDE, "Hide", 1061, 200, 106, 19, 0, 0, 0, 0, 0, "Hides selected faces (H)"); - uiDefBut(block, BUT,B_REVEAL, "Reveal", 1167, 200, 107, 19, 0, 0, 0, 0, 0, "Reveals selected faces (Alt H)"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "NSize:", 955, 170, 150, 19, &G.scene->editbutsize, 0.001, 2.0, 10, 0, "Sets the length to use when displaying face normals"); - uiDefButBitI(block, TOG, G_DRAWNORMALS, REDRAWVIEW3D, "Draw Normals", 955,148,150,19, &G.f, 0, 0, 0, 0, "Displays face normals as lines"); - uiDefButBitI(block, TOG, G_DRAW_VNORMALS, REDRAWVIEW3D, "Draw VNormals",955,126,150,19, &G.f, 0, 0, 0, 0, "Displays vertex normals as lines"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, G_DRAWFACES, REDRAWVIEW3D_IMAGE, "Draw Faces", 955,88,150,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades in the 3d view and UV editor"); - uiDefButBitI(block, TOG, G_DRAWEDGES, REDRAWVIEW3D, "Draw Edges", 955,66,150,19, &G.f, 0, 0, 0, 0, "Displays selected edges using hilights"); - uiDefButBitI(block, TOG, G_DRAWCREASES, REDRAWVIEW3D, "Draw Creases", 955,44,150,19, &G.f, 0, 0, 0, 0, "Displays creases created for subsurf weighting"); - uiDefButBitI(block, TOG, G_DRAWSEAMS, REDRAWVIEW3D, "Draw Seams", 955,22,150,19, &G.f, 0, 0, 0, 0, "Displays UV unwrapping seams"); - uiDefButBitI(block, TOG, G_DRAWSHARP, REDRAWVIEW3D, "Draw Sharp", 955,0,150,19, &G.f, 0, 0, 0, 0, "Displays sharp edges, used with the EdgeSplit modifier"); - uiBlockEndAlign(block); - - /* Measurement drawing options */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, G_DRAW_EDGELEN, REDRAWVIEW3D, "Edge Length", 1125,170,150,19, &G.f, 0, 0, 0, 0, "Displays selected edge lengths"); - uiDefButBitI(block, TOG, G_DRAW_EDGEANG, REDRAWVIEW3D, "Edge Angles", 1125,148,150,19, &G.f, 0, 0, 0, 0, "Displays the angles in the selected edges in degrees"); - uiDefButBitI(block, TOG, G_DRAW_FACEAREA, REDRAWVIEW3D, "Face Area", 1125,126,150,19, &G.f, 0, 0, 0, 0, "Displays the area of selected faces"); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - uiDefButBitI(block, TOG, G_DRAW_VERSE_DEBUG, REDRAWVIEW3D, "Draw VDebug",1125,104,150,19, &G.f, 0, 0, 0, 0, "Displays verse debug information"); -#endif - - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, G_ALLEDGES, 0, "All Edges", 1125, 22,150,19, &G.f, 0, 0, 0, 0, "Displays all edges in object mode without optimization"); - uiDefButBitS(block, TOG, B_MESH_X_MIRROR, B_DIFF, "X-axis mirror",1125,0,150,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "While using transforms, mirrors the transformation"); - uiBlockEndAlign(block); -} - -char *get_vertexgroup_menustr(Object *ob) -{ - bDeformGroup *dg; - int defCount, min, index; - char (*qsort_ptr)[sizeof(dg->name)+6] = NULL; // +6 for "%x999|" max 999 groups selectable - char *s, *menustr; - int printed; - - defCount=BLI_countlist(&ob->defbase); - - if (!defCount) min=0; - else min=1; - - if (defCount > 0) { - /* - * This will hold the group names temporarily - * so we can sort them - */ - qsort_ptr = MEM_callocN (defCount * sizeof (qsort_ptr[0]), - "qsort_ptr"); - for (index = 1, dg = ob->defbase.first; dg; index++, dg=dg->next) { - printed = snprintf (qsort_ptr[index - 1], sizeof (dg->name), dg->name); - snprintf (qsort_ptr[index - 1]+printed, 6+1, "%%x%d|", index); // +1 to move the \0 see above 999 max here too - } - - qsort (qsort_ptr, defCount, sizeof (qsort_ptr[0]), - ( int (*)(const void *, const void *) ) strcmp); - } - - s= menustr = MEM_callocN((sizeof(qsort_ptr[0]) * defCount)+30, "menustr"); // plus 30 for when defCount==0 - if(defCount) { - for (index = 0; index < defCount; index++) { - int cnt= sprintf (s, "%s", qsort_ptr[index]); - if (cnt>0) s+= cnt; - } - } - else strcpy(menustr, "No Vertex Groups in Object"); - - if (qsort_ptr) - MEM_freeN (qsort_ptr); - - return menustr; -} - -static void editing_panel_links(Object *ob) -{ - uiBlock *block; - ID *id, *idfrom; - int *poin, xco=143; - float min; - Material *ma; - char str[64]; - uiBut *but; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_links", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Link and Materials", "Editing", 0, 0, 318, 204)==0) return; - - uiSetButLock((ob && ob->id.lib), ERROR_LIBDATA_MESSAGE); - - buttons_active_id(&id, &idfrom); - - if(id) { - int alone= 0; - int local= 0; - int browse= B_EDITBROWSE; - - if(ob->type==OB_MESH) { - browse= B_MESHBROWSE; - alone= B_MESHALONE; - local= B_MESHLOCAL; - uiSetButLock(G.obedit!=0, "Unable to perform function in EditMode"); - } - else if(ob->type==OB_MBALL) { - alone= B_MBALLALONE; - local= B_MBALLLOCAL; - } - else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) { - alone= B_CURVEALONE; - local= B_CURVELOCAL; - } - else if(ob->type==OB_CAMERA) { - alone= B_CAMERAALONE; - local= B_CAMERALOCAL; - } - else if(ob->type==OB_LAMP) { - alone= B_LAMPALONE; - local= B_LAMPLOCAL; - } - else if (ob->type==OB_ARMATURE){ - alone = B_ARMALONE; - local = B_ARMLOCAL; - } - else if(ob->type==OB_LATTICE) { - alone= B_LATTALONE; - local= B_LATTLOCAL; - } - uiBlockSetCol(block, TH_BUT_SETTING2); - xco= std_libbuttons(block, 143, 180, 0, NULL, browse, GS(id->name), 0, id, idfrom, &(G.buts->menunr), alone, local, 0, 0, B_KEEPDATA); - uiBlockSetCol(block, TH_AUTO); - } - if(ob) { - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - but = uiDefBut(block, TEX, B_IDNAME, "OB:", xco, 180, 454-xco, YIC, ob->id.name+2, 0.0, 21.0, 0, 0, "Active Object name."); -#ifdef WITH_VERSE - if(ob->vnode) uiButSetFunc(but, test_and_send_idbutton_cb, ob, ob->id.name); - else uiButSetFunc(but, test_idbutton_cb, ob->id.name, NULL); -#else - uiButSetFunc(but, test_idbutton_cb, ob->id.name, NULL); -#endif - - } - - /* empty display handling, note it returns! */ - if (ob->type==OB_EMPTY) { - uiDefBut(block, LABEL,0,"Empty Display:", - xco, 154, 130,20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButC(block, MENU, REDRAWVIEW3D, "Empty Drawtype%t|Arrows%x1|Single Arrow%x4|Plain Axes%x2|Circle%x3|Cube%x5|Sphere%x6|Cone%x7", - xco, 128, 140, 20, &ob->empty_drawtype, 0, 0, 0, 0, "The Empty 3D View display style"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Size:", - xco, 108, 140, 21, &ob->empty_drawsize, 0.01, 10.0, 1, 0, "The size to display the Empty"); - uiBlockEndAlign(block); - return; - } - - /* vertex group... partially editmode... */ - if(ob->type==OB_MESH || ob->type==OB_LATTICE) { - bDeformGroup *defGroup; - uiBut *but; - int defCount; - - uiDefBut(block, LABEL,0,"Vertex Groups", - 143,153,130,20, 0, 0, 0, 0, 0, ""); - - defCount=BLI_countlist(&ob->defbase); - - if (defCount) { - char *menustr= get_vertexgroup_menustr(ob); - - uiBlockBeginAlign(block); - - uiDefButS(block, MENU, B_MAKEDISP, menustr, 143, 132,18,21, (short *)&ob->actdef, 1, defCount, 0, 0, "Browses available vertex groups"); - MEM_freeN (menustr); - - if (ob->actdef){ - defGroup = BLI_findlink(&ob->defbase, ob->actdef-1); - but= uiDefBut(block, TEX, REDRAWBUTSEDIT,"", 161,132,140-18,21, defGroup->name, 0, 31, 0, 0, "Displays current vertex group name. Click to change. (Match bone name for deformation.)"); - uiButSetFunc(but, verify_vertexgroup_name_func, defGroup, NULL); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ob); - - uiDefButF(block, NUM, REDRAWVIEW3D, "Weight:", 143, 111, 140, 21, &editbutvweight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength"); - } - uiBlockEndAlign(block); - } - - if (G.obedit && G.obedit==ob){ - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_NEWVGROUP,"New", 143,90,70,21, 0, 0, 0, 0, 0, "Creates a new vertex group"); - uiDefBut(block, BUT,B_DELVGROUP,"Delete", 213,90,70,21, 0, 0, 0, 0, 0, "Removes the current vertex group"); - - uiDefBut(block, BUT,B_ASSIGNVGROUP,"Assign", 143,69,70,21, 0, 0, 0, 0, 0, "Assigns selected vertices to the current vertex group"); - uiDefBut(block, BUT,B_REMOVEVGROUP,"Remove", 213,69,70,21, 0, 0, 0, 0, 0, "Removes selected vertices from the current vertex group"); - - uiDefBut(block, BUT,B_SELVGROUP,"Select", 143,48,70,21, 0, 0, 0, 0, 0, "Selects vertices belonging to the current vertex group"); - uiDefBut(block, BUT,B_DESELVGROUP,"Desel.", 213,48,70,21, 0, 0, 0, 0, 0, "Deselects vertices belonging to the current vertex group"); - uiBlockEndAlign(block); - } - else { - ID *id= ob->data; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign (block); - uiDefBut (block, BUT, B_NEWVGROUP, "New", 143, 90, 70, 21, 0, 0, 0, 0, 0, "Creates a new vertex group"); - uiDefBut (block, BUT, B_DELVGROUP, "Delete", 213, 90, 70, 21, 0, 0, 0, 0, 0, "Removes the current vertex group"); - uiDefBut (block, BUT, B_COPYVGROUP, "Copy Group", 143, 70, 140, 19, 0, 0, 0, 0, 0, "Copy Group of Vertex"); - uiBlockEndAlign (block); - - if(id->us > 1) - uiDefBut(block, BUT,B_LINKEDVGROUP, "Copy To Linked", 143,50,140,20, 0, 0, 0, 0, 0, "Creates identical vertex group names in other Objects using this Object-data"); - } - } - - /* now only objects that can be visible rendered */ - if ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL); - else return; - - id= ob->data; - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(ob->type==OB_MESH) poin= &( ((Mesh *)ob->data)->texflag ); - else if(ob->type==OB_MBALL) poin= &( ((MetaBall *)ob->data)->texflag ); - else poin= &( ((Curve *)ob->data)->texflag ); - uiDefButBitI(block, TOG, AUTOSPACE, B_AUTOTEX, "AutoTexSpace", 143,15,140,19, poin, 0, 0, 0, 0, "Adjusts active object's texture space automatically when transforming object"); - - sprintf(str,"%d Mat ", ob->totcol); - if(ob->totcol) min= 1.0; else min= 0.0; - ma= give_current_material(ob, ob->actcol); - - if(G.obedit) { - char *str= NULL; - IDnames_to_pupstring(&str, NULL, "ADD NEW %x 32767", &G.main->mat, NULL, NULL); - uiDefButS(block, MENU, B_MATASS_BROWSE, str, 292,150,20,20, &G.buts->menunr, 0, 0, 0, 0, "Browses existing choices and assign"); - MEM_freeN(str); - } - - if(ma) uiDefBut(block, LABEL, 0, ma->id.name+2, 318,150, 103, 20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - if(ma) uiDefButF(block, COL, B_MATCOL2, "", 292,113,31,30, &(ma->r), 0, 0, 0, 0, ""); - uiDefButC(block, NUM, B_ACTCOL, str, 324,113,100,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index"); - uiDefBut(block, BUT,B_MATWICH, "?", 424,113,30,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_MATNEW, "New", 292,90,80,20, 0, 0, 0, 0, 0, "Adds a new Material index"); - uiDefBut(block, BUT,B_MATDEL, "Delete", 372,90,80,20, 0, 0, 0, 0, 0, "Deletes this Material index"); - uiDefBut(block, BUT,B_MATSEL, "Select", 292,70,80,20, 0, 0, 0, 0, 0, "In EditMode, selects faces that have the active index"); - uiDefBut(block, BUT,B_MATDESEL, "Deselect", 372,70,80,20, 0, 0, 0, 0, 0, "Deselects everything with current indexnumber"); - uiDefBut(block, BUT,B_MATASS, "Assign", 292,50,160,20, 0, 0, 0, 0, 0, "In EditMode, assigns the active index to selected faces"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_SETSMOOTH,"Set Smooth", 292,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'smooth' rendering of selected faces"); - uiDefBut(block, BUT,B_SETSOLID, "Set Solid", 372,15,80,20, 0, 0, 0, 0, 0, "In EditMode, sets 'solid' rendering of selected faces"); - - uiBlockEndAlign(block); - - -} - -void editing_panel_sculpting_tools() -{ - uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_tools", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Sculpt", "Editing", 300, 0, 318, 204)==0) return; - - sculptmode_draw_interface_tools(block,0,200); -} - -void editing_panel_sculpting_brush() -{ - uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_brush", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Brush", "Editing", 300, 0, 318, 204)==0) return; - - sculptmode_draw_interface_brush(block,0,200); -} - -void editing_panel_sculpting_textures() -{ - uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_texture", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Texture", "Editing", 300, 0, 318, 204)==0) return; - - sculptmode_draw_interface_textures(block,0,200); -} - -void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned short cy) -{ - SculptData *sd; - - if(!G.scene) return; - sd= &G.scene->sculptdata; - - uiBlockBeginAlign(block); - - uiDefBut(block,LABEL,B_NOP,"Brush",cx,cy,90,19,NULL,0,0,0,0,""); - cy-= 20; - - uiBlockBeginAlign(block); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Draw",cx,cy,67,19,&sd->brush_type,14.0,DRAW_BRUSH,0,0,"Draw lines on the model"); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Smooth",cx+67,cy,67,19,&sd->brush_type,14.0,SMOOTH_BRUSH,0,0,"Interactively smooth areas of the model"); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Pinch",cx+134,cy,67,19,&sd->brush_type,14.0,PINCH_BRUSH,0,0,"Interactively pinch areas of the model"); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Inflate",cx+201,cy,67,19,&sd->brush_type,14,INFLATE_BRUSH,0,0,"Push vertices along the direction of their normals"); - cy-= 20; - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Grab", cx,cy,89,19,&sd->brush_type,14,GRAB_BRUSH,0,0,"Grabs a group of vertices and moves them with the mouse"); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Layer", cx+89,cy,89,19,&sd->brush_type,14, LAYER_BRUSH,0,0,"Adds a layer of depth"); - uiDefButS(block,ROW,REDRAWBUTSEDIT,"Flatten", cx+178,cy,90,19,&sd->brush_type,14, FLATTEN_BRUSH,0,0,"Interactively flatten areas of the model"); - cy-= 25; - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block,LABEL,B_NOP,"Shape",cx,cy,90,19,NULL,0,0,0,0,""); - cy-= 20; - uiBlockBeginAlign(block); - if(sd->brush_type != SMOOTH_BRUSH && sd->brush_type != GRAB_BRUSH && sd->brush_type != FLATTEN_BRUSH) { - uiDefButC(block,ROW,B_NOP,"Add",cx,cy,89,19,&sculptmode_brush()->dir,15.0,1.0,0, 0,"Add depth to model [Shift]"); - uiDefButC(block,ROW,B_NOP,"Sub",cx+89,cy,89,19,&sculptmode_brush()->dir,15.0,2.0,0, 0,"Subtract depth from model [Shift]"); - } - if(sd->brush_type!=GRAB_BRUSH) - uiDefButC(block,TOG,B_NOP,"Airbrush",cx+178,cy,89,19,&sculptmode_brush()->airbrush,0,0,0,0,"Brush makes changes without waiting for the mouse to move"); - cy-= 20; - uiDefButS(block,NUMSLI,B_NOP,"Size: ",cx,cy,268,19,&sculptmode_brush()->size,1.0,200.0,0,0,"Set brush radius in pixels"); - cy-= 20; - if(sd->brush_type!=GRAB_BRUSH) - uiDefButC(block,NUMSLI,B_NOP,"Strength: ",cx,cy,268,19,&sculptmode_brush()->strength,1.0,100.0,0,0,"Set brush strength"); - cy-= 25; - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut( block,LABEL,B_NOP,"Symmetry",cx,cy,90,19,NULL,0,0,0,0,""); - cy-= 20; - uiBlockBeginAlign(block); - uiDefButBitC(block, TOG, SYMM_X, 0, "X", cx,cy,89,19, &sd->symm, 0,0,0,0, "Mirror brush across X axis"); - uiDefButBitC(block, TOG, SYMM_Y, 0, "Y", cx+89,cy,89,19, &sd->symm, 0,0,0,0, "Mirror brush across Y axis"); - uiDefButBitC(block, TOG, SYMM_Z, 0, "Z", cx+178,cy,90,19, &sd->symm, 0,0,0,0, "Mirror brush across Z axis"); - uiBlockEndAlign(block); - - cx+= 210; -} - -static void sculptmode_curves_reset(void *sd_v, void *j) -{ - SculptData *sd = sd_v; - sculpt_reset_curve(sd); - curvemapping_changed(sd->cumap, 0); -} - -void sculptmode_draw_interface_brush(uiBlock *block, unsigned short cx, unsigned short cy) -{ - SculptData *sd= sculpt_data(); - int orig_y = cy; - rctf rect; - uiBut *but; - - uiBlockBeginAlign(block); - cy-= 20; - uiDefButC(block,TOG,REDRAWBUTSEDIT, "Curve", cx,cy,80,19, &sd->texfade, 0,0,0,0,"Use curve control for radial brush intensity"); - cy-= 20; - but= uiDefBut(block, BUT, REDRAWBUTSEDIT, "Reset",cx,cy,80,19, NULL, 0,0,0,0, "Default curve preset"); - uiButSetFunc(but, sculptmode_curves_reset, sd, NULL); - cy-= 25; - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block,NUM,B_NOP, "Space", cx,cy,80,19, &sd->spacing, 0,500,20,0,"Non-zero inserts N pixels between dots"); - cy-= 20; - if(sd->brush_type == DRAW_BRUSH) - uiDefButC(block,NUM,B_NOP, "View", cx,cy,80,19, &sculptmode_brush()->view, 0,10,20,0,"Pulls brush direction towards view"); - uiBlockEndAlign(block); - - /* Draw curve */ - cx += 90; - cy = orig_y; - rect.xmin= cx; rect.xmax= cx + 178; - rect.ymin= cy - 160; rect.ymax= cy + 20; - uiBlockBeginAlign(block); - curvemap_buttons(block, sd->cumap, (char)0, B_NOP, 0, &rect); - uiBlockEndAlign(block); -} - -void sculptmode_draw_interface_textures(uiBlock *block, unsigned short cx, unsigned short cy) -{ - SculptData *sd= sculpt_data(); - MTex *mtex; - int i; - int orig_y= cy; - char *strp; - uiBut *but; - - uiBlockBeginAlign(block); - cy-= 20; - /* TEX CHANNELS */ - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_NEUTRAL); - for(i=-1; i<8; i++) { - char str[64]; - int loos; - mtex= sd->mtex[i]; - - if(i==-1) - strcpy(str, "Default"); - else { - if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos); - else strcpy(str, ""); - } - str[10]= 0; - uiDefButS(block, ROW, REDRAWBUTSEDIT, str,cx, cy, 80, 20, &sd->texact, 3.0, (float)i, 0, 0, "Texture channel"); - cy-= 18; - } - - cy= orig_y-20; - cx+= 85; - mtex= sd->mtex[sd->texact]; - - if(sd->texact == -1) { - uiBlockBeginAlign(block); - uiDefBut(block,LABEL,B_NOP,"",cx,cy,115,20,0,0,0,0,0,""); /* Padding */ - } else { - ID *id= NULL; - uiBlockBeginAlign(block); - - if(mtex && mtex->tex) id= &mtex->tex->id; - IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &G.main->tex, id, &G.buts->texnr); - - if(mtex && mtex->tex) { - uiDefBut(block, TEX, B_IDNAME, "TE:",cx,cy,115,19, mtex->tex->id.name+2, 0.0, 21.0, 0, 0, "Texture name"); - cy-= 20; - - uiDefButS(block,MENU,B_SCULPT_TEXBROWSE, strp, cx,cy,20,19, &G.buts->texnr, 0,0,0,0, "Selects an existing texture or creates new"); - uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, cx+21,cy,21,20, 0, 0, 0, 0, 0, "Auto-assigns name to texture"); - - but= uiDefBut(block, BUT, B_NOP, "Clear",cx+43, cy, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture"); - uiButSetFunc(but,sculptmode_rem_tex,0,0); - cy-= 25; - - uiBlockBeginAlign(block); - uiDefButC(block,ROW, REDRAWBUTSEDIT, "Drag", cx, cy,39,19, &sd->texrept, 18,SCULPTREPT_DRAG,0,0,"Move the texture with the brush"); - uiDefButC(block,ROW, REDRAWBUTSEDIT, "Tile", cx+39,cy,39,19, &sd->texrept, 18,SCULPTREPT_TILE,0,0,"Treat the texture as a tiled image extending across the screen"); - uiDefButC(block,ROW, REDRAWBUTSEDIT, "3D", cx+78,cy,37,19, &sd->texrept, 18,SCULPTREPT_3D, 0,0,"Use vertex coords as texture coordinates"); - cy-= 20; - - if(sd->texrept != SCULPTREPT_3D) { - uiBlockBeginAlign(block); - uiDefButF(block,NUM,0, "Angle", cx,cy,115,19, &mtex->warpfac, 0,360,100,0, "Rotate texture counterclockwise"); - /*Moved inside, so that following buttons aren't made bigger for no reason*/ - cy-= 20; - } - - /* Added Rake button. Needs to be turned off if 3D is on / disappear*/ - if(sd->texrept != SCULPTREPT_3D){ - uiDefButC(block,TOG,B_NOP, "Rake", cx,cy,115,19, &sd->rake, 0,0,0,0,"Rotate the brush in the direction of motion"); - cy-=20; - } - - if(sd->texrept != SCULPTREPT_DRAG) { - uiBlockBeginAlign(block); - but= uiDefIconButC(block, TOG, REDRAWBUTSEDIT, sd->texsep ? ICON_UNLOCKED : ICON_LOCKED, cx,cy,20,19, &sd->texsep,0,0,0,0, "Locks the texture sizes together"); - uiBlockBeginAlign(block); - uiDefButF(block,NUM,B_NOP, sd->texsep ? "SizeX" : "Size", cx+20,cy,95,19, &mtex->size[0],1,1000,100,0,"Scaling factor for texture"); - cy-= 20; - if(sd->texsep) { - uiDefButF(block,NUM,B_NOP, "SizeY", cx+20,cy,95,19, &mtex->size[1],1,1000,100,0,"Scaling factor for texture"); - cy-= 20; - if(sd->texrept == SCULPTREPT_3D) - uiDefButF(block,NUM,B_NOP, "SizeZ", cx+20,cy,95,19, &mtex->size[2],1,1000,100,0,"Scaling factor for texture"); - cy-= 20; - } - } - } - else { - uiDefButS(block,TOG,B_SCULPT_TEXBROWSE, "Add New" ,cx, cy, 115, 19, &G.buts->texnr,-1,32767,0,0, "Adds a new texture"); - uiDefButS(block,MENU,B_SCULPT_TEXBROWSE, strp, cx,cy-20,20,19, &G.buts->texnr, 0,0,0,0, "Selects an existing texture or creates new"); - } - - MEM_freeN(strp); - } - - uiBlockEndAlign(block); -} - -/* *************************** FACE/PAINT *************************** */ - -void do_fpaintbuts(unsigned short event) -{ - Mesh *me; - Object *ob; - bDeformGroup *defGroup; - MTFace *activetf, *tf; - MFace *mf; - MCol *activemcol; - int a; - SculptData *sd= &G.scene->sculptdata; - ID *id, *idtest; - extern VPaint Gwp; /* from vpaint */ - ToolSettings *settings= G.scene->toolsettings; - int nr= 1; - MTex *mtex; - ParticleSystem *psys; - - ob= OBACT; - if(ob==NULL) return; - - switch(event) { - - case B_VPGAMMA: - vpaint_dogamma(); - break; - case B_COPY_TF_MODE: - case B_COPY_TF_UV: - case B_COPY_TF_COL: - case B_COPY_TF_TEX: - me= get_mesh(OBACT); - activetf= get_active_mtface(NULL, &activemcol, 0); - - if(me && activetf) { - for (a=0, tf=me->mtface, mf=me->mface; a < me->totface; a++, tf++, mf++) { - if(tf!=activetf && (mf->flag & ME_FACE_SEL)) { - if(event==B_COPY_TF_MODE) { - tf->mode= activetf->mode; - tf->transp= activetf->transp; - } - else if(event==B_COPY_TF_UV) { - memcpy(tf->uv, activetf->uv, sizeof(tf->uv)); - tf->tpage= activetf->tpage; - tf->tile= activetf->tile; - - if(activetf->mode & TF_TILES) tf->mode |= TF_TILES; - else tf->mode &= ~TF_TILES; - - } - else if(event==B_COPY_TF_TEX) { - tf->tpage= activetf->tpage; - tf->tile= activetf->tile; - - if(activetf->mode & TF_TILES) tf->mode |= TF_TILES; - else tf->mode &= ~TF_TILES; - } - else if(event==B_COPY_TF_COL && activemcol) - memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4); - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - do_shared_vertexcol(me); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SET_VCOL: - if(FACESEL_PAINT_TEST) - clear_vpaint_selectedfaces(); - else - clear_vpaint(); - break; - case B_REDR_3D_IMA: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_ASSIGNMESH: - - test_object_materials(ob->data); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_TFACE_HALO: - activetf = get_active_mtface(NULL, NULL, 0); - if(activetf) { - activetf->mode &= ~TF_BILLBOARD2; - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case B_TFACE_BILLB: - activetf = get_active_mtface(NULL, NULL, 0); - if(activetf) { - activetf->mode &= ~TF_BILLBOARD; - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_WEIGHT0_0: - editbutvweight = 0.0f; - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_WEIGHT1_4: - editbutvweight = 0.25f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_WEIGHT1_2: - editbutvweight = 0.5f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_WEIGHT3_4: - editbutvweight = 0.75f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_WEIGHT1_0: - editbutvweight = 1.0f; - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_OPA1_8: - Gwp.a = 0.125f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_OPA1_4: - Gwp.a = 0.25f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_OPA1_2: - Gwp.a = 0.5f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_OPA3_4: - Gwp.a = 0.75f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_OPA1_0: - Gwp.a = 1.0f; - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_CLR_WPAINT: - if(!multires_level1_test()) { - defGroup = BLI_findlink(&ob->defbase, ob->actdef-1); - if(defGroup) { - Mesh *me= ob->data; - int a; - for(a=0; atotvert; a++) - remove_vert_defgroup (ob, defGroup, a); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - break; - case B_SCULPT_TEXBROWSE: - sd= &G.scene->sculptdata; - - if(G.buts->texnr== -2) { - id= NULL; - if(sd) { - mtex= sd->mtex[sd->texact]; - if(mtex) id= &mtex->tex->id; - } - - activate_databrowse((ID *)id, ID_TE, 0, B_SCULPT_TEXBROWSE, &G.buts->texnr, do_global_buttons); - return; - } - if(G.buts->texnr < 0) break; - - if(G.buts->pin) { - - } - else if(sd && sd->texact == -1) { - error("No texture channel selected"); - allqueue(REDRAWBUTSSHADING, 0); - } - else if(sd && sd->texact != -1) { - id= NULL; - - mtex= sd->mtex[sd->texact]; - if(mtex) id= &mtex->tex->id; - - idtest= G.main->tex.first; - while(idtest) { - if(nr==G.buts->texnr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new tex */ - if(id) idtest= (ID *)copy_texture((Tex *)id); - else idtest= (ID *)add_texture("Tex"); - idtest->us--; - } - if(idtest!=id && sd) { - - if(sd->mtex[sd->texact]==0) { - sd->mtex[sd->texact]= add_mtex(); - sd->mtex[sd->texact]->texco= TEXCO_VIEW; - sd->mtex[sd->texact]->size[0]= - sd->mtex[sd->texact]->size[1]= - sd->mtex[sd->texact]->size[2]= 100; - sd->mtex[sd->texact]->warpfac= 0; - } - sd->mtex[sd->texact]->tex= (Tex *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Texture browse"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_TE); - } - } - break; - - case B_BRUSHBROWSE: - if(G.buts->menunr==-2) { - activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_BRUSHBROWSE, &G.buts->menunr, do_global_buttons); - break; - } - else if(G.buts->menunr < 0) break; - - if(brush_set_nr(&settings->imapaint.brush, G.buts->menunr)) { - BIF_undo_push("Browse Brush"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_BRUSHDELETE: - if(brush_delete(&settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_BRUSHKEEPDATA: - brush_toggle_fake_user(settings->imapaint.brush); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_BRUSHLOCAL: - if(settings->imapaint.brush && settings->imapaint.brush->id.lib) { - if(okee("Make local")) { - make_local_brush(settings->imapaint.brush); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_BTEXBROWSE: - if(settings->imapaint.brush) { - Brush *brush= settings->imapaint.brush; - - if(G.buts->menunr==-2) { - MTex *mtex= brush->mtex[brush->texact]; - ID *id= (ID*)((mtex)? mtex->tex: NULL); - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts); - } else { - activate_databrowse(id, ID_TE, 0, B_BTEXBROWSE, &G.buts->menunr, do_fpaintbuts); - } - break; - } - else if(G.buts->menunr < 0) break; - - if(brush_texture_set_nr(brush, G.buts->menunr)) { - BIF_undo_push("Browse Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_BTEXDELETE: - if(settings->imapaint.brush) { - if (brush_texture_delete(settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_BRUSHCHANGE: - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_BAKE_REDRAWEDIT: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_BAKE_RECACHE: - psys=PE_get_current(ob); - PE_hide_keys_time(psys,CFRA); - psys_cache_paths(ob,psys,CFRA,0); - if(PE_settings()->flag & PE_SHOW_CHILD) - psys_cache_child_paths(ob,psys,CFRA,0); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - } -} - -/* -------------------- MODE: vpaint ------------------- */ - -void weight_paint_buttons(uiBlock *block) -{ - extern VPaint Gwp; /* from vpaint */ - Object *ob; - ob= OBACT; - - if(ob==NULL) return; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, REDRAWVIEW3D, "Weight:",10,170,225,19, &editbutvweight, 0, 1, 10, 0, "Sets the current vertex group's bone deformation strength"); - - uiDefBut(block, BUT, B_WEIGHT0_0 , "0", 10,150,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_WEIGHT1_4 , "1/4", 55,150,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_WEIGHT1_2 , "1/2", 100,150,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_WEIGHT3_4 , "3/4", 145,150,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_WEIGHT1_0 , "1", 190,150,45,19, 0, 0, 0, 0, 0, ""); - - uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 10,130,225,19, &Gwp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush"); - - uiDefBut(block, BUT, B_OPA1_8 , "1/8", 10,110,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_OPA1_4 , "1/4", 55,110,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_OPA1_2 , "1/2", 100,110,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_OPA3_4 , "3/4", 145,110,45,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_OPA1_0 , "1", 190,110,45,19, 0, 0, 0, 0, 0, ""); - - uiDefButF(block, NUMSLI, B_NOP, "Size ", 10,90,225,19, &Gwp.size, 2.0, 64.0, 0, 0, "The size of the brush"); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_DIFF, "Mix", 250,170,60,17, &Gwp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colors"); - uiDefButS(block, ROW, B_DIFF, "Add", 250,152,60,17, &Gwp.mode, 1.0, 1.0, 0, 0, "Add the vertex colors"); - uiDefButS(block, ROW, B_DIFF, "Sub", 250,134,60,17, &Gwp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Mul", 250,116,60,17, &Gwp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Blur", 250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values"); - uiDefButS(block, ROW, B_DIFF, "Lighter", 250, 80,60,17, &Gwp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only"); - uiDefButS(block, ROW, B_DIFF, "Darker", 250, 62,60,17, &Gwp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only"); - uiBlockEndAlign(block); - - /* draw options same as below */ - uiBlockBeginAlign(block); - if (FACESEL_PAINT_TEST) { - uiDefButBitI(block, TOG, G_DRAWFACES, B_UVAUTO_DRAWFACES, "Faces", 10,45,60,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades"); - uiDefButBitI(block,TOG, G_DRAWEDGES, REDRAWVIEW3D,"Edges",70,45,60,19, &G.f, 2.0, 0, 0, 0, "Displays edges of visible faces"); - uiDefButBitI(block,TOG, G_HIDDENEDGES, REDRAWVIEW3D,"Hidden Edges",130,45,100,19, &G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces"); - } else{ - uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 10,45,75,19, &ob->dtx, 0, 0, 0, 0, "Displays the active object's wireframe in shaded drawing modes"); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 10,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Paint on all faces inside brush (otherwise only on face under mouse cursor)"); - uiDefButBitS(block, TOG, VP_SOFT, 0, "Vert Dist", 70,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of all vertices of face)"); - uiDefButBitS(block, TOGN, VP_HARD, 0, "Soft", 130,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Use a soft brush"); - uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 190,20,60,19, &Gwp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting"); - uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 250,20,55,19, &Gwp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse"); - uiBlockEndAlign(block); - - if(ob) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, VP_ONLYVGROUP, REDRAWVIEW3D, "Vgroup", 10,0,100,19, &Gwp.flag, 0, 0, 0, 0, "Only paint on vertices in the selected vertex group."); - uiDefButBitS(block, TOG, VP_MIRROR_X, REDRAWVIEW3D, "X-Mirror", 110,0,100,19, &Gwp.flag, 0, 0, 0, 0, "Mirrored Paint, applying on mirrored Weight Group name"); - uiDefBut(block, BUT, B_CLR_WPAINT, "Clear", 210,0,100,19, NULL, 0, 0, 0, 0, "Removes reference to this deform group from all vertices"); - uiBlockEndAlign(block); - } -} - -static void editing_panel_mesh_paint(void) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_paint", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Paint", "Editing", 640, 0, 318, 204)==0) return; - - - if(G.f & G_WEIGHTPAINT) { - weight_paint_buttons(block); - } - else if(G.f & G_VERTEXPAINT) { - extern VPaint Gvp; /* from vpaint */ - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_NOP, "R ", 979,170,150,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting"); - uiDefButF(block, NUMSLI, B_NOP, "G ", 979,150,150,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting"); - uiDefButF(block, NUMSLI, B_NOP, "B ", 979,130,150,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 979,105,222,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush"); - uiDefButF(block, NUMSLI, B_NOP, "Size ", 979,85,222,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush"); - uiBlockEndAlign(block); - - uiDefButF(block, COL, B_REDR, "", 1140,150,60,40, &(Gvp.r), 0, 0, 0, B_VPCOLSLI, ""); - uiDefBut(block, BUT, B_SET_VCOL, "SetVCol", 1140,130,60,20, 0, 0, 0, 0, 0, "Set Vertex color of selection to current (Shift+K)"); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_DIFF, "Mix", 1212,170,63,17, &Gvp.mode, 1.0, 0.0, 0, 0, "Mix the vertex colors"); - uiDefButS(block, ROW, B_DIFF, "Add", 1212,152,63,17, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Sub", 1212, 134,63,17, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Mul", 1212, 116,63,17, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color"); - uiDefButS(block, ROW, B_DIFF, "Blur", 1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Blur the color with surrounding values"); - uiDefButS(block, ROW, B_DIFF, "Lighter", 1212, 80,63,17, &Gvp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only"); - uiDefButS(block, ROW, B_DIFF, "Darker", 1212, 62,63,17, &Gvp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only"); - uiBlockEndAlign(block); - - /* draw options */ - uiBlockBeginAlign(block); - if (FACESEL_PAINT_TEST) { - uiDefButBitI(block, TOG, G_DRAWFACES, B_UVAUTO_DRAWFACES, "Faces", 979,50,60,19, &G.f, 0, 0, 0, 0, "Displays all faces as shades"); - uiDefButBitI(block,TOG, G_DRAWEDGES, REDRAWVIEW3D,"Edges",1039,50,60,19, &G.f, 2.0, 0, 0, 0, "Displays edges of visible faces"); - uiDefButBitI(block,TOG, G_HIDDENEDGES, REDRAWVIEW3D,"Hidden Edges",1099,50,100,19, &G.f, 2.0, 1.0, 0, 0, "Displays edges of hidden faces"); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, VP_AREA, 0, "All Faces", 979,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Paint on all faces inside brush"); - uiDefButBitS(block, TOG, VP_SOFT, 0, "Vertex Dist", 1054,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Use distances to vertices (instead of paint entire faces)"); - uiDefButBitS(block, TOG, VP_NORMALS, 0, "Normals", 1129,25,75,19, &Gvp.flag, 0, 0, 0, 0, "Applies the vertex normal before painting"); - uiDefButBitS(block, TOG, VP_SPRAY, 0, "Spray", 1204,25,72,19, &Gvp.flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_VPGAMMA, "Set", 979,0,81,19, 0, 0, 0, 0, 0, "Apply Mul and Gamma to vertex colors"); - uiDefButF(block, NUM, B_DIFF, "Mul:", 1061,0,112,19, &Gvp.mul, 0.1, 50.0, 10, 0, "Set the number to multiply vertex colors with"); - uiDefButF(block, NUM, B_DIFF, "Gamma:", 1174,0,102,19, &Gvp.gamma, 0.1, 5.0, 10, 0, "Change the clarity of the vertex colors"); - uiBlockEndAlign(block); - } - else { /* texture paint */ - ToolSettings *settings= G.scene->toolsettings; - Brush *brush= settings->imapaint.brush; - ID *id; - int yco, xco, butw; - - yco= 160; - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_BRUSHCHANGE, "Draw", 0 ,yco,108,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_DRAW, 0, 0, "Draw brush"); - uiDefButS(block, ROW, B_BRUSHCHANGE, "Soften", 108 ,yco,106,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SOFTEN, 0, 0, "Soften brush"); - uiDefButS(block, ROW, B_BRUSHCHANGE, "Smear", 214,yco,106,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SMEAR, 0, 0, "Smear brush"); - uiBlockEndAlign(block); - yco -= 30; - - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (ID*)settings->imapaint.brush; - xco= std_libbuttons(block, 0, yco, 0, NULL, B_BRUSHBROWSE, ID_BR, 0, id, NULL, &(G.buts->menunr), 0, B_BRUSHLOCAL, B_BRUSHDELETE, 0, B_BRUSHKEEPDATA); - uiBlockSetCol(block, TH_AUTO); - - if(brush && !brush->id.lib) { - MTex *mtex= brush->mtex[brush->texact]; - - butw= 320-(xco+10); - - uiDefButS(block, MENU, B_NOP, "Mix %x0|Add %x1|Subtract %x2|Multiply %x3|Lighten %x4|Darken %x5|Erase Alpha %x6|Add Alpha %x7", xco+10,yco,butw,19, &brush->blend, 0, 0, 0, 0, "Blending method for applying brushes"); - - uiDefButBitS(block, TOG|BIT, BRUSH_TORUS, B_BRUSHCHANGE, "Wrap", xco+10,yco-25,butw,19, &brush->flag, 0, 0, 0, 0, "Enables torus wrapping"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG|BIT, BRUSH_AIRBRUSH, B_BRUSHCHANGE, "Airbrush", xco+10,yco-50,butw,19, &brush->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse (spray)"); - uiDefButF(block, NUM, B_NOP, "Rate ", xco+10,yco-70,butw,19, &brush->rate, 0.01, 1.0, 0, 0, "Number of paints per second for Airbrush"); - uiBlockEndAlign(block); - - yco -= 25; - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_VPCOLSLI, "", 0,yco,200,19, brush->rgb, 0, 0, 0, 0, ""); - uiDefButF(block, NUMSLI, B_NOP, "Opacity ", 0,yco-20,180,19, &brush->alpha, 0.0, 1.0, 0, 0, "The amount of pressure on the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_ALPHA_PRESSURE, B_NOP, "P", 180,yco-20,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButI(block, NUMSLI, B_NOP, "Size ", 0,yco-40,180,19, &brush->size, 1, 200, 0, 0, "The size of the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_SIZE_PRESSURE, B_NOP, "P", 180,yco-40,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButF(block, NUMSLI, B_NOP, "Falloff ", 0,yco-60,180,19, &brush->innerradius, 0.0, 1.0, 0, 0, "The fall off radius of the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_RAD_PRESSURE, B_NOP, "P", 180,yco-60,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButF(block, NUMSLI, B_NOP, "Spacing ",0,yco-80,180,19, &brush->spacing, 1.0, 100.0, 0, 0, "Repeating paint on %% of brush diameter"); - uiDefButBitS(block, TOG|BIT, BRUSH_SPACING_PRESSURE, B_NOP, "P", 180,yco-80,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiBlockEndAlign(block); - - yco -= 110; - - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (mtex)? (ID*)mtex->tex: NULL; - xco= std_libbuttons(block, 0, yco, 0, NULL, B_BTEXBROWSE, ID_TE, 0, id, NULL, &(G.buts->menunr), 0, 0, B_BTEXDELETE, 0, 0); - /*uiDefButBitS(block, TOG|BIT, BRUSH_FIXED_TEX, B_BRUSHCHANGE, "Fixed", xco+5,yco,butw,19, &brush->flag, 0, 0, 0, 0, "Keep texture origin in fixed position");*/ - uiBlockSetCol(block, TH_AUTO); - } - } -} - -static void editing_panel_mesh_texface(void) -{ - uiBlock *block; - MTFace *tf; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_texface", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Multires", "Editing"); - if(uiNewPanel(curarea, block, "Texture Face", "Editing", 960, 0, 318, 204)==0) return; - - tf = get_active_mtface(NULL, NULL, 0); - if(tf) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TF_TEX, B_REDR_3D_IMA, "Tex", 600,160,60,19, &tf->mode, 0, 0, 0, 0, "Render face with texture"); - uiDefButBitS(block, TOG, TF_TILES, B_REDR_3D_IMA, "Tiles", 660,160,60,19, &tf->mode, 0, 0, 0, 0, "Use tilemode for face"); - uiDefButBitS(block, TOG, TF_LIGHT, REDRAWVIEW3D, "Light", 720,160,60,19, &tf->mode, 0, 0, 0, 0, "Use light for face"); - uiDefButBitS(block, TOG, TF_INVISIBLE, REDRAWVIEW3D, "Invisible",780,160,60,19, &tf->mode, 0, 0, 0, 0, "Make face invisible"); - uiDefButBitS(block, TOG, TF_DYNAMIC, REDRAWVIEW3D, "Collision", 840,160,60,19, &tf->mode, 0, 0, 0, 0, "Use face for collision detection"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TF_SHAREDCOL, REDRAWVIEW3D, "Shared", 600,135,60,19, &tf->mode, 0, 0, 0, 0, "Blend vertex colors across face when vertices are shared"); - uiDefButBitS(block, TOG, TF_TWOSIDE, REDRAWVIEW3D, "Twoside",660,135,60,19, &tf->mode, 0, 0, 0, 0, "Render face twosided"); - uiDefButBitS(block, TOG, TF_OBCOL, REDRAWVIEW3D, "ObColor",720,135,60,19, &tf->mode, 0, 0, 0, 0, "Use ObColor instead of vertex colors"); - - uiBlockBeginAlign(block); - - uiDefButBitS(block, TOG, TF_BILLBOARD, B_TFACE_HALO, "Halo", 600,110,60,19, &tf->mode, 0, 0, 0, 0, "Screen aligned billboard"); - uiDefButBitS(block, TOG, TF_BILLBOARD2, B_TFACE_BILLB, "Billboard",660,110,60,19, &tf->mode, 0, 0, 0, 0, "Billboard with Z-axis constraint"); - uiDefButBitS(block, TOG, TF_SHADOW, REDRAWVIEW3D, "Shadow", 720,110,60,19, &tf->mode, 0, 0, 0, 0, "Face is used for shadow"); - uiDefButBitS(block, TOG, TF_BMFONT, REDRAWVIEW3D, "Text", 780,110,60,19, &tf->mode, 0, 0, 0, 0, "Enable bitmap text on face"); - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque", 600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Add", 660,80,60,19, &tf->transp, 2.0, (float)TF_ADD, 0, 0, "Render face transparent and add color of face"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha", 720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture"); - } -} - -void do_uvcalculationbuts(unsigned short event) -{ - switch(event) { - case B_UVAUTO_DRAWFACES: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - } -} - -static void editing_panel_mesh_uvautocalculation(void) -{ - uiBlock *block; - int butH= 19, butHB= 20, row= 180, butS= 10; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_uvautocalculation", UI_EMBOSS, UI_HELV, curarea->win); - /* make this a tab of "Texture face" to save screen space*/ - uiNewPanelTabbed("Multires", "Editing"); - if(uiNewPanel(curarea, block, "UV Calculation", "Editing", 960, 0, 318, 204)==0) - return; - row-= 4*butHB+butS; - - uiBlockBeginAlign(block); - uiDefButS(block, MENU, REDRAWBUTSEDIT, "Unwrapper%t|Conformal%x0|Angle Based%x1",100,row,200,butH, &G.scene->toolsettings->unwrapper, 0, 0, 0, 0, "Unwrap method"); - uiDefButBitS(block, TOG, 1, B_NOP, "Fill Holes",100,row-butHB,200,butH,&G.scene->toolsettings->uvcalc_flag, 0, 0, 0, 0, "Fill holes to prevent internal overlaps"); - uiBlockEndAlign(block); - row-= 2*butHB+butS; - - row= 180; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,B_UVAUTO_CUBESIZE ,"Cube Size:",315,row,200,butH, &G.scene->toolsettings->uvcalc_cubesize, 0.0001, 100.0, 10, 3, "Defines the cubemap size for cube mapping"); - uiBlockEndAlign(block); - row-= butHB+butS; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,B_UVAUTO_CYLRADIUS ,"Cyl Radius:",315,row,200,butH, &G.scene->toolsettings->uvcalc_radius, 0.1, 100.0, 10, 3, "Defines the radius of the UV mapping cylinder"); - uiBlockEndAlign(block); - row-= butHB+butS; - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_UVAUTO_FACE,"View Aligns Face",315,row,200,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 1.0, 0.0,0.0, "View is on equator for cylindrical and spherical UV mapping"); - uiDefButS(block, ROW,B_UVAUTO_TOP,"VA Top",315,row-butHB,100,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 0.0, 0.0,0.0, "View is on poles for cylindrical and spherical UV mapping"); - uiDefButS(block, ROW,B_UVAUTO_TOP,"Al Obj",415,row-butHB,100,butH, &G.scene->toolsettings->uvcalc_mapdir,2.0, 2.0, 0.0,0.0, "Align to object for cylindrical and spherical UV mapping"); - uiBlockEndAlign(block); - row-= 2*butHB+butS; - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_UVAUTO_ALIGNX,"Polar ZX",315,row,100,butH, &G.scene->toolsettings->uvcalc_mapalign,2.0, 0.0, 0.0,0.0, "Polar 0 is X for cylindrical and spherical UV mapping"); - uiDefButS(block, ROW,B_UVAUTO_ALIGNY,"Polar ZY",415,row,100,butH, &G.scene->toolsettings->uvcalc_mapalign,2.0, 1.0, 0.0,0.0, "Polar 0 is Y for cylindrical and spherical UV mapping"); - uiBlockEndAlign(block); -} - -void editing_panel_mesh_multires() -{ - uiBlock *block; - uiBut *but; - Object *ob= OBACT; - Mesh *me= get_mesh(ob); - int cx= 100, cy= 0; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_multires", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Multires", "Editing", 500, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(!me->mr) { - but= uiDefBut(block,BUT,B_NOP,"Add Multires", cx,cy,268,19,0,0,0,0,0,""); - uiButSetFunc(but,multires_make,ob,me); - } else { - char subsurfmenu[]= "Subsurf Type%t|Catmull-Clark%x0|Simple Subdiv.%x1"; - - but= uiDefBut(block,BUT,B_NOP,"Apply Multires", cx,cy,268,19,0,0,0,0,0,"Apply current multires level to mesh and the delete other levels"); - uiButSetFunc(but,multires_delete,ob,me); - cy-= 24; - - uiBlockBeginAlign(block); - but= uiDefBut(block,BUT,B_NOP,"Add Level", cx,cy,134,19,0,0,0,0,0,"Add a new level of subdivision at the end of the chain"); - uiButSetFunc(but,multires_add_level,ob,me); - uiDefButC(block, MENU, B_NOP, subsurfmenu, cx + 134, cy, 134, 19, &G.scene->toolsettings->multires_subdiv_type, 0, 0, 0, 0, "Selects type of subdivision algorithm."); - cy-= 20; - - if(me->mr->level_count>1) { - but= uiDefBut(block,BUT,B_NOP,"Del Lower", cx,cy,134,19,0,0,0,0,0,"Remove all levels of subdivision below the current one"); - uiButSetFunc(but,multires_del_lower,ob,me); - but= uiDefBut(block,BUT,B_NOP,"Del Higher", cx+134,cy,134,19,0,0,0,0,0,"Remove all levels of subdivision above the current one"); - uiButSetFunc(but,multires_del_higher,ob,me); - cy-= 20; - - but= uiDefButC(block,NUM,B_NOP,"Level: ",cx,cy,268,19,(char *)&me->mr->newlvl,1.0,me->mr->level_count,0,0,""); - uiButSetFunc(but,multires_set_level_cb, ob, me); - cy-= 20; - - but= uiDefButC(block,NUM,B_NOP,"Edges: ",cx,cy,268,19,(char *)&me->mr->edgelvl,1.0,me->mr->level_count,0,0,"Set level of edges to display"); - uiButSetFunc(but,multires_edge_level_update,ob,me); - cy-= 20; - uiBlockEndAlign(block); - - cy-= 5; - uiDefBut(block,LABEL,B_NOP,"Rendering",cx,cy,100,19,0,0,0,0,0,""); - cy-= 20; - - uiBlockBeginAlign(block); - uiDefButC(block,NUM,B_NOP,"Pin: ",cx,cy,268,19,(char *)&me->mr->pinlvl,1.0,me->mr->level_count,0,0,"Set level to apply modifiers to during render"); - cy-= 20; - - uiDefButC(block,NUM,B_NOP,"Render: ",cx,cy,268,19,(char *)&me->mr->renderlvl,1.0,me->mr->level_count,0,0,"Set level to render"); - cy-= 20; - - if(multires_modifier_warning()) { - char *tip= "One or more modifiers are enabled that modify mesh topology"; - uiDefIconBut(block,LABEL,B_NOP,ICON_ERROR, cx,cy,20,20, 0,0,0,0,0, tip); - uiDefBut(block,LABEL,B_NOP, "Cannot use render level", cx+20,cy,180,19, 0,0,0,0,0, tip); - } - } - } - - uiBlockEndAlign(block); -} - -void particle_edit_buttons(uiBlock *block) -{ - Object *ob=OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEditSettings *pset = PE_settings(); - ParticleEdit *edit; - uiBut *but; - short butx=10,buty=150,butw=150,buth=20, lastbuty; - static short partact; - - char *menustr; - - if(psys==NULL) return; - - menustr = psys_menu_string(ob, 0); - partact = PE_get_current_num(ob)+1; - - but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr, 160,180,butw,buth, &partact, 14.0, 0.0, 0, 0, "Browse systems"); - uiButSetFunc(but, PE_change_act, ob, &partact); - - MEM_freeN(menustr); - - if(psys->edit) { - edit= psys->edit; - - /* brushes */ - //uiDefBut(block, LABEL, 0, "Brush", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"None",butx,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_NONE,0,0,"Disable brush"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Comb",butx+75,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_COMB,0,0,"Comb hairs"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Smooth",butx+150,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_SMOOTH,0,0,"Smooth hairs"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Weight",butx+225,buty,75,19,&pset->brushtype,14,PE_BRUSH_WEIGHT,0,0,"Weight hairs"); - buty-= buth; - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Add", butx,buty,75,19,&pset->brushtype,14,PE_BRUSH_ADD,0,0,"Add hairs"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Length", butx+75,buty,75,19,&pset->brushtype,14, PE_BRUSH_LENGTH,0,0,"Make hairs longer or shorter"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Puff", butx+150,buty,75,19,&pset->brushtype,14, PE_BRUSH_PUFF,0,0,"Make hairs stand up"); - uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Cut", butx+225,buty,75,19,&pset->brushtype,14, PE_BRUSH_CUT,0,0,"Cut hairs"); - uiBlockEndAlign(block); - - buty-= 10; - lastbuty= buty; - - /* brush options */ - if(pset->brushtype>=0) { - ParticleBrushData *brush= &pset->brush[pset->brushtype]; - - butw= 180; - - uiBlockBeginAlign(block); - uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Size:", butx,(buty-=buth),butw,buth, &brush->size, 1.0, 100.0, 1, 1, "Brush size"); - uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Strength:", butx,(buty-=buth),butw,buth, &brush->strength, 1.0, 100.0, 1, 1, "Brush strength"); - - if(ELEM(pset->brushtype, PE_BRUSH_LENGTH, PE_BRUSH_PUFF)) { - char *str1, *str2, *tip1, *tip2; - - if(pset->brushtype == PE_BRUSH_LENGTH) { - str1= "Grow"; tip1= "Make hairs longer [Shift]"; - str2= "Shrink"; tip2= "Make hairs shorter [Shift]"; - } - else /*if(pset->brushtype == PE_BRUSH_PUFF)*/ { - str1= "Add"; tip1= "Make hair more puffy [Shift]"; - str2= "Sub"; tip2= "Make hair less puffy [Shift]"; - } - - uiDefButS(block,ROW,B_NOP,str1, butx,(buty-=buth),butw/2,buth,&brush->invert,0.0,0.0,0, 0,tip1); - uiDefButS(block,ROW,B_NOP,str2, butx+butw/2,buty,butw/2,buth,&brush->invert,0.0,1.0,0, 0,tip2); - } - uiBlockEndAlign(block); - - butx += butw+10; - buty= lastbuty; - butw= 110; - - if(pset->brushtype==PE_BRUSH_ADD) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PE_INTERPOLATE_ADDED, B_BAKE_REDRAWEDIT, "Interpolate", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Interpolate new particles from the existing ones"); - uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Step:", butx,(buty-=buth),butw,buth, &brush->step, 1.0, 50.0, 1, 1, "Brush step"); - uiDefButS(block, NUMSLI, B_BAKE_REDRAWEDIT, "Keys:", butx,(buty-=buth),butw,buth, &pset->totaddkey, 2.0, 20.0, 1, 1, "How many keys to make new particles with"); - uiBlockEndAlign(block); - } - } - - /* keep options */ - butw= 150; - butx= 10; - buty= lastbuty - (buth*3 + 10); - lastbuty= buty; - - uiDefBut(block, LABEL, 0, "Keep", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PE_KEEP_LENGTHS, B_BAKE_REDRAWEDIT, "Lengths", butx,(buty-=buth),butw/2,buth, &pset->flag, 0, 0, 0, 0, "Keep path lengths constant"); - uiDefButBitS(block, TOG, PE_LOCK_FIRST, B_BAKE_REDRAWEDIT, "Root", butx+butw/2,buty,butw/2,buth, &pset->flag, 0, 0, 0, 0, "Keep first keys unmodified"); - uiBlockEndAlign(block); - - buty -= 5; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PE_DEFLECT_EMITTER, B_BAKE_REDRAWEDIT, "Deflect Emitter", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Keep paths from intersecting the emitter"); - uiDefButF(block, NUM, B_BAKE_REDRAWEDIT, "Dist:", butx,(buty-=buth),butw,buth, &pset->emitterdist, 0.0, 10.0, 1, 1, "Distance from emitter"); - uiBlockEndAlign(block); - - buty= lastbuty; - butx += butw+10; - butw -= 10; - - uiDefBut(block, LABEL, 0, "Draw", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, NUMSLI, B_BAKE_RECACHE, "Steps:", butx,(buty-=buth),butw,buth, &psys->part->draw_step, 0.0, 10.0, 1, 1, "Drawing accuracy of paths"); - uiBlockEndAlign(block); - - buty -= 5; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PE_SHOW_TIME, B_BAKE_REDRAWEDIT, "Show Time", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Show time values of the baked keys"); - uiDefButBitS(block, TOG, PE_SHOW_CHILD, B_BAKE_RECACHE, "Show Children", butx,(buty-=buth),butw,buth, &pset->flag, 0, 0, 0, 0, "Show child particles in particle mode"); - uiBlockEndAlign(block); - } - else{ - uiDefBut(block, LABEL, 0, "System isn't editable", butx,(buty-=buth),250,buth, NULL, 0.0, 0, 0, 0, ""); - } -} -/* this is a mode context sensitive system */ - -void editing_panels() -{ - Object *ob; - Curve *cu; - MetaBall *mb; - Lattice *lt; - bArmature *arm; - Camera *cam; - - ob= OBACT; - if(ob==NULL) return; - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - switch(ob->type) { - case OB_MESH: - editing_panel_links(ob); - editing_panel_mesh_type(ob, ob->data); - editing_panel_modifiers(ob); - editing_panel_shapes(ob); - editing_panel_mesh_multires(); - /* modes */ - if(G.obedit) { - editing_panel_mesh_tools(ob, ob->data); - editing_panel_mesh_tools1(ob, ob->data); - uiNewPanelTabbed("Mesh Tools 1", "Editing"); - editing_panel_mesh_skgen(ob, ob->data); - editing_panel_mesh_uvautocalculation(); - if (EM_texFaceCheck()) - editing_panel_mesh_texface(); - } - else if(G.f & G_SCULPTMODE) { - uiNewPanelTabbed("Multires", "Editing"); - editing_panel_sculpting_tools(); - uiNewPanelTabbed("Multires", "Editing"); - editing_panel_sculpting_brush(); - uiNewPanelTabbed("Multires", "Editing"); - editing_panel_sculpting_textures(); - } else { - if(G.f & (G_VERTEXPAINT | G_TEXTUREPAINT | G_WEIGHTPAINT) ) { - editing_panel_mesh_paint(); - } - } - break; - - case OB_CURVE: - case OB_SURF: - cu= ob->data; - editing_panel_links(ob); - editing_panel_curve_type(ob, cu); - editing_panel_modifiers(ob); -// editing_panel_shapes(ob); - if(G.obedit) { - editing_panel_curve_tools(ob, cu); - editing_panel_curve_tools1(ob, cu); - } - break; - - case OB_MBALL: - mb= ob->data; - editing_panel_links(ob); - editing_panel_mball_type(ob, mb); - if(G.obedit) { - editing_panel_mball_tools(ob, mb); - } - break; - - case OB_FONT: - cu= ob->data; - editing_panel_links(ob); - editing_panel_curve_type(ob, cu); - editing_panel_font_type(ob, cu); - -#ifdef INTERNATIONAL - if(G.obedit) - { - editing_panel_char_type(ob, cu); - } -#endif - editing_panel_modifiers(ob); - break; - - case OB_LATTICE: - lt= ob->data; - editing_panel_links(ob); - editing_panel_lattice_type(ob, lt); - editing_panel_modifiers(ob); - editing_panel_shapes(ob); - break; - - case OB_LAMP: - editing_panel_links(ob); - break; - - case OB_EMPTY: - editing_panel_links(ob); - break; - - case OB_CAMERA: - cam= ob->data; - editing_panel_links(ob); // no editmode! - editing_panel_camera_type(ob, cam); - /* yafray: extra panel for dof parameters */ - if (G.scene->r.renderer==R_YAFRAY) editing_panel_camera_yafraydof(ob, cam); - break; - - case OB_ARMATURE: - arm= ob->data; - editing_panel_links(ob); // no editmode! - editing_panel_armature_type(ob, arm); - if(G.obedit) { - editing_panel_armature_bones(ob, arm); - } - else if(ob->flag & OB_POSEMODE) { - editing_panel_armature_visuals(ob, arm); - editing_panel_pose_bones(ob, arm); - object_panel_constraint("Editing"); - } - break; - } - uiClearButLock(); -} diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c deleted file mode 100644 index 77922f041d8..00000000000 --- a/source/blender/src/buttons_logic.c +++ /dev/null @@ -1,2814 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_material_types.h" -#include "DNA_sensor_types.h" -#include "DNA_actuator_types.h" -#include "DNA_controller_types.h" -#include "DNA_property_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_text_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_mesh_types.h" -#include "DNA_world_types.h" - -#include "BKE_library.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_sca.h" -#include "BKE_property.h" - -#include "BIF_gl.h" -#include "BIF_resources.h" -#include "BIF_space.h" -#include "BIF_interface.h" -#include "BIF_butspace.h" -#include "BIF_screen.h" -#include "BIF_keyval.h" -#include "BIF_editsound.h" - -#include "BIF_editsca.h" - - -#include "BDR_editcurve.h" -#include "BDR_editobject.h" -#include "BSE_headerbuttons.h" -#include "BSE_filesel.h" - -#include "blendef.h" -#include "mydevice.h" -#include "nla.h" /* For __NLA : Important, do not remove */ -#include "butspace.h" // own module - -/* internals */ -void buttons_enji(uiBlock *, Object *); -void buttons_ketsji(uiBlock *, Object *); -void buttons_bullet(uiBlock *, Object *); - -/****/ - -static ID **get_selected_and_linked_obs(short *count, short scavisflag); -static char *actuator_pup(Object *owner); - -/****/ - - -static void del_property(void *selpropv, void *data2_unused) -{ - bProperty *prop, *selprop= selpropv; - Object *ob; - int a=0; - - ob= OBACT; - if(ob==NULL) return; - - prop= ob->prop.first; - while(prop) { - if(prop==selprop) { - if (strcmp(prop->name,"Text") == 0) { - allqueue(REDRAWVIEW3D, 0); - } - BLI_remlink(&ob->prop, prop); - free_property(prop); - break; - } - a++; - prop= prop->next; - } - BIF_undo_push("Delete property"); - allqueue(REDRAWBUTSLOGIC, 0); - -} - -static int vergname(const void *v1, const void *v2) -{ - char **x1, **x2; - - x1= (char **)v1; - x2= (char **)v2; - - return strcmp(*x1, *x2); -} - -void make_unique_prop_names(char *str) -{ - Object *ob; - bProperty *prop; - bSensor *sens; - bController *cont; - bActuator *act; - ID **idar; - short a, obcount, propcount=0, nr; - char **names; - - /* this function is called by a Button, and gives the current - * stringpointer as an argument, this is the one that can change - */ - - idar= get_selected_and_linked_obs(&obcount, BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_CONT_SEL|BUTS_CONT_ACT); - - /* for each object, make properties and sca names unique */ - - /* count total names */ - for(a=0; aprop); - propcount+= BLI_countlist(&ob->sensors); - propcount+= BLI_countlist(&ob->controllers); - propcount+= BLI_countlist(&ob->actuators); - } - if(propcount==0) { - if(idar) MEM_freeN(idar); - return; - } - - /* make names array for sorting */ - names= MEM_callocN(propcount*sizeof(void *), "names"); - - /* count total names */ - nr= 0; - for(a=0; aprop.first; - while(prop) { - names[nr++]= prop->name; - prop= prop->next; - } - sens= ob->sensors.first; - while(sens) { - names[nr++]= sens->name; - sens= sens->next; - } - cont= ob->controllers.first; - while(cont) { - names[nr++]= cont->name; - cont= cont->next; - } - act= ob->actuators.first; - while(act) { - names[nr++]= act->name; - act= act->next; - } - } - - qsort(names, propcount, sizeof(void *), vergname); - - /* now we check for double names, and change them */ - - for(nr=0; nr0) { - /* now find out which object has this ... */ - base= FIRSTBASE; - while(base) { - - sens= base->object->sensors.first; - while(sens) { - if(sens == sens_to_delete) break; - sens= sens->next; - } - - if(sens) { - if( val==1 && sens->prev) { - BLI_remlink(&base->object->sensors, sens); - BLI_insertlinkbefore(&base->object->sensors, sens->prev, sens); - } - else if( val==2 && sens->next) { - BLI_remlink(&base->object->sensors, sens); - BLI_insertlink(&base->object->sensors, sens->next, sens); - } - BIF_undo_push("Move sensor"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - } - - base= base->next; - } - } -} - -static void sca_move_controller(void *datav, void *data2_unused) -{ - bController *controller_to_del= datav; - int val; - Base *base; - bController *cont; - - val= pupmenu("Move up%x1|Move down %x2"); - - if(val>0) { - /* now find out which object has this ... */ - base= FIRSTBASE; - while(base) { - - cont= base->object->controllers.first; - while(cont) { - if(cont == controller_to_del) break; - cont= cont->next; - } - - if(cont) { - if( val==1 && cont->prev) { - BLI_remlink(&base->object->controllers, cont); - BLI_insertlinkbefore(&base->object->controllers, cont->prev, cont); - } - else if( val==2 && cont->next) { - BLI_remlink(&base->object->controllers, cont); - BLI_insertlink(&base->object->controllers, cont->next, cont); - } - BIF_undo_push("Move controller"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - } - - base= base->next; - } - } -} - -static void sca_move_actuator(void *datav, void *data2_unused) -{ - bActuator *actuator_to_move= datav; - int val; - Base *base; - bActuator *act; - - val= pupmenu("Move up%x1|Move down %x2"); - - if(val>0) { - /* now find out which object has this ... */ - base= FIRSTBASE; - while(base) { - - act= base->object->actuators.first; - while(act) { - if(act == actuator_to_move) break; - act= act->next; - } - - if(act) { - if( val==1 && act->prev) { - BLI_remlink(&base->object->actuators, act); - BLI_insertlinkbefore(&base->object->actuators, act->prev, act); - } - else if( val==2 && act->next) { - BLI_remlink(&base->object->actuators, act); - BLI_insertlink(&base->object->actuators, act->next, act); - } - BIF_undo_push("Move actuator"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - } - - base= base->next; - } - } -} - -void do_logic_buts(unsigned short event) -{ - bProperty *prop; - bSensor *sens; - bController *cont; - bActuator *act; - Base *base; - Object *ob; - int didit; - - ob= OBACT; - if(ob==0) return; - - switch(event) { - - case B_SETSECTOR: - /* check for inconsistant types */ - ob->gameflag &= ~(OB_PROP|OB_MAINACTOR|OB_DYNAMIC|OB_ACTOR); - ob->dtx |= OB_BOUNDBOX; - allqueue(REDRAWBUTSGAME, 0); - allqueue(REDRAWVIEW3D, 0); - break; - - case B_SETPROP: - /* check for inconsistant types */ - ob->gameflag &= ~(OB_SECTOR|OB_MAINACTOR|OB_DYNAMIC|OB_ACTOR); - allqueue(REDRAWBUTSGAME, 0); - allqueue(REDRAWVIEW3D, 0); - break; - - case B_SETACTOR: - case B_SETDYNA: - case B_SETMAINACTOR: - ob->gameflag &= ~(OB_SECTOR|OB_PROP); - allqueue(REDRAWBUTSGAME, 0); - allqueue(REDRAWVIEW3D, 0); - break; - - - case B_ADD_PROP: - prop= new_property(PROP_FLOAT); - make_unique_prop_names(prop->name); - BLI_addtail(&ob->prop, prop); - BIF_undo_push("Add property"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_CHANGE_PROP: - prop= ob->prop.first; - while(prop) { - if(prop->type!=prop->otype) { - init_property(prop); - if (strcmp(prop->name, "Text") == 0) { - allqueue(REDRAWVIEW3D, 0); - } - } - prop= prop->next; - } - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_ADD_SENS: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDSENS) { - base->object->scaflag &= ~OB_ADDSENS; - sens= new_sensor(SENS_ALWAYS); - BLI_addtail(&(base->object->sensors), sens); - make_unique_prop_names(sens->name); - base->object->scaflag |= OB_SHOWSENS; - } - base= base->next; - } - - BIF_undo_push("Add sensor"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_CHANGE_SENS: - base= FIRSTBASE; - while(base) { - sens= base->object->sensors.first; - while(sens) { - if(sens->type != sens->otype) { - init_sensor(sens); - sens->otype= sens->type; - break; - } - sens= sens->next; - } - base= base->next; - } - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_DEL_SENS: - base= FIRSTBASE; - while(base) { - sens= base->object->sensors.first; - while(sens) { - if(sens->flag & SENS_DEL) { - BLI_remlink(&(base->object->sensors), sens); - free_sensor(sens); - break; - } - sens= sens->next; - } - base= base->next; - } - BIF_undo_push("Delete sensor"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_ADD_CONT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDCONT) { - base->object->scaflag &= ~OB_ADDCONT; - cont= new_controller(CONT_LOGIC_AND); - make_unique_prop_names(cont->name); - base->object->scaflag |= OB_SHOWCONT; - BLI_addtail(&(base->object->controllers), cont); - } - base= base->next; - } - BIF_undo_push("Add controller"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_CHANGE_CONT: - base= FIRSTBASE; - while(base) { - cont= base->object->controllers.first; - while(cont) { - if(cont->type != cont->otype) { - init_controller(cont); - cont->otype= cont->type; - break; - } - cont= cont->next; - } - base= base->next; - } - allqueue(REDRAWBUTSLOGIC, 0); - break; - - - case B_DEL_CONT: - base= FIRSTBASE; - while(base) { - cont= base->object->controllers.first; - while(cont) { - if(cont->flag & CONT_DEL) { - BLI_remlink(&(base->object->controllers), cont); - unlink_controller(cont); - free_controller(cont); - break; - } - cont= cont->next; - } - base= base->next; - } - BIF_undo_push("Delete controller"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_ADD_ACT: - base= FIRSTBASE; - while(base) { - if(base->object->scaflag & OB_ADDACT) { - base->object->scaflag &= ~OB_ADDACT; - act= new_actuator(ACT_OBJECT); - make_unique_prop_names(act->name); - BLI_addtail(&(base->object->actuators), act); - base->object->scaflag |= OB_SHOWACT; - } - base= base->next; - } - BIF_undo_push("Add actuator"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_CHANGE_ACT: - base= FIRSTBASE; - while(base) { - act= base->object->actuators.first; - while(act) { - if(act->type != act->otype) { - init_actuator(act); - act->otype= act->type; - break; - } - act= act->next; - } - base= base->next; - } - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_DEL_ACT: - base= FIRSTBASE; - while(base) { - act= base->object->actuators.first; - while(act) { - if(act->flag & ACT_DEL) { - BLI_remlink(&(base->object->actuators), act); - unlink_actuator(act); - free_actuator(act); - break; - } - act= act->next; - } - base= base->next; - } - BIF_undo_push("Delete actuator"); - allqueue(REDRAWBUTSLOGIC, 0); - break; - - case B_SOUNDACT_BROWSE: - /* since we don't know which... */ - didit= 0; - base= FIRSTBASE; - while(base) - { - act= base->object->actuators.first; - while(act) - { - if(act->type==ACT_SOUND) - { - bSoundActuator *sa= act->data; - if(sa->sndnr) - { - bSound *sound= G.main->sound.first; - int nr= 1; - - if(sa->sndnr == -2) { - activate_databrowse((ID *)G.main->sound.first, ID_SO, 0, B_SOUNDACT_BROWSE, - &sa->sndnr, do_logic_buts); - break; - } - - while(sound) - { - if(nr==sa->sndnr) - break; - nr++; - sound= sound->id.next; - } - - if(sa->sound) - sa->sound->id.us--; - - sa->sound= sound; - - if(sound) - sound->id.us++; - - sa->sndnr= 0; - didit= 1; - } - } - act= act->next; - } - if(didit) - break; - base= base->next; - } - allqueue(REDRAWBUTSLOGIC, 0); - allqueue(REDRAWSOUND, 0); - - break; - } -} - - -static char *sensor_name(int type) -{ - switch (type) { - case SENS_ALWAYS: - return "Always"; - case SENS_TOUCH: - return "Touch"; - case SENS_NEAR: - return "Near"; - case SENS_KEYBOARD: - return "Keyboard"; - case SENS_PROPERTY: - return "Property"; - case SENS_MOUSE: - return "Mouse"; - case SENS_COLLISION: - return "Collision"; - case SENS_RADAR: - return "Radar"; - case SENS_RANDOM: - return "Random"; - case SENS_RAY: - return "Ray"; - case SENS_MESSAGE: - return "Message"; - case SENS_JOYSTICK: - return "Joystick"; - } - return "unknown"; -} - -static char *sensor_pup(void) -{ - /* the number needs to match defines in game.h */ - return "Sensors %t|Always %x0|Keyboard %x3|Mouse %x5|" - "Touch %x1|Collision %x6|Near %x2|Radar %x7|" - "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11"; -} - -static char *controller_name(int type) -{ - switch (type) { - case CONT_LOGIC_AND: - return "AND"; - case CONT_LOGIC_OR: - return "OR"; - case CONT_EXPRESSION: - return "Expression"; - case CONT_PYTHON: - return "Python"; - } - return "unknown"; -} - -static char *controller_pup(void) -{ - return "Controllers %t|AND %x0|OR %x1|Expression %x2|Python %x3"; -} - -static char *actuator_name(int type) -{ - switch (type) { - case ACT_ACTION: - return "Action"; - case ACT_OBJECT: - return "Motion"; - case ACT_IPO: - return "Ipo"; - case ACT_LAMP: - return "Lamp"; - case ACT_CAMERA: - return "Camera"; - case ACT_MATERIAL: - return "Material"; - case ACT_SOUND: - return "Sound"; - case ACT_CD: - return "CD"; - case ACT_PROPERTY: - return "Property"; - case ACT_EDIT_OBJECT: - return "Edit Object"; - case ACT_CONSTRAINT: - return "Constraint"; - case ACT_SCENE: - return "Scene"; - case ACT_GROUP: - return "Group"; - case ACT_RANDOM: - return "Random"; - case ACT_MESSAGE: - return "Message"; - case ACT_GAME: - return "Game"; - case ACT_VISIBILITY: - return "Visibility"; - } - return "unknown"; -} - - - - -static char *actuator_pup(Object *owner) -{ - switch (owner->type) - { - case OB_ARMATURE: - return "Actuators %t|Action %x15|Motion %x0|Constraint %x9|Ipo %x1" - "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" - "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" - "|Visibility %x18"; - break; - default: - return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1" - "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10" - "|Scene %x11|Random %x13|Message %x14|CD %x16|Game %x17" - "|Visibility %x18"; - } -} - - - -static void set_sca_ob(Object *ob) -{ - bController *cont; - bActuator *act; - - cont= ob->controllers.first; - while(cont) { - cont->mynew= (bController *)ob; - cont= cont->next; - } - act= ob->actuators.first; - while(act) { - act->mynew= (bActuator *)ob; - act= act->next; - } -} - -static ID **get_selected_and_linked_obs(short *count, short scavisflag) -{ - Base *base; - Object *ob, *obt; - ID **idar; - bSensor *sens; - bController *cont; - unsigned int lay; - int a, nr, doit; - - /* we need a sorted object list */ - /* set scavisflags flags in Objects to indicate these should be evaluated */ - /* also hide ob pointers in ->new entries of controllerss/actuators */ - - *count= 0; - - if(G.scene==NULL) return NULL; - - ob= G.main->object.first; - while(ob) { - ob->scavisflag= 0; - set_sca_ob(ob); - ob= ob->id.next; - } - - if(G.vd) lay= G.vd->lay; - else lay= G.scene->lay; - - base= FIRSTBASE; - while(base) { - if(base->lay & lay) { - if(base->flag & SELECT) { - if(scavisflag & BUTS_SENS_SEL) base->object->scavisflag |= OB_VIS_SENS; - if(scavisflag & BUTS_CONT_SEL) base->object->scavisflag |= OB_VIS_CONT; - if(scavisflag & BUTS_ACT_SEL) base->object->scavisflag |= OB_VIS_ACT; - } - } - base= base->next; - } - - if(OBACT) { - if(scavisflag & BUTS_SENS_ACT) OBACT->scavisflag |= OB_VIS_SENS; - if(scavisflag & BUTS_CONT_ACT) OBACT->scavisflag |= OB_VIS_CONT; - if(scavisflag & BUTS_ACT_ACT) OBACT->scavisflag |= OB_VIS_ACT; - } - - if(scavisflag & (BUTS_SENS_LINK|BUTS_CONT_LINK|BUTS_ACT_LINK)) { - doit= 1; - while(doit) { - doit= 0; - - ob= G.main->object.first; - while(ob) { - - /* 1st case: select sensor when controller selected */ - if((scavisflag & BUTS_SENS_LINK) && (ob->scavisflag & OB_VIS_SENS)==0) { - sens= ob->sensors.first; - while(sens) { - for(a=0; atotlinks; a++) { - if(sens->links[a]) { - obt= (Object *)sens->links[a]->mynew; - if(obt && (obt->scavisflag & OB_VIS_CONT)) { - doit= 1; - ob->scavisflag |= OB_VIS_SENS; - break; - } - } - } - if(doit) break; - sens= sens->next; - } - } - - /* 2nd case: select cont when act selected */ - if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_CONT)==0) { - cont= ob->controllers.first; - while(cont) { - for(a=0; atotlinks; a++) { - if(cont->links[a]) { - obt= (Object *)cont->links[a]->mynew; - if(obt && (obt->scavisflag & OB_VIS_ACT)) { - doit= 1; - ob->scavisflag |= OB_VIS_CONT; - break; - } - } - } - if(doit) break; - cont= cont->next; - } - } - - /* 3rd case: select controller when sensor selected */ - if((scavisflag & BUTS_CONT_LINK) && (ob->scavisflag & OB_VIS_SENS)) { - sens= ob->sensors.first; - while(sens) { - for(a=0; atotlinks; a++) { - if(sens->links[a]) { - obt= (Object *)sens->links[a]->mynew; - if(obt && (obt->scavisflag & OB_VIS_CONT)==0) { - doit= 1; - obt->scavisflag |= OB_VIS_CONT; - } - } - } - sens= sens->next; - } - } - - /* 4th case: select actuator when controller selected */ - if( (scavisflag & BUTS_ACT_LINK) && (ob->scavisflag & OB_VIS_CONT)) { - cont= ob->controllers.first; - while(cont) { - for(a=0; atotlinks; a++) { - if(cont->links[a]) { - obt= (Object *)cont->links[a]->mynew; - if(obt && (obt->scavisflag & OB_VIS_ACT)==0) { - doit= 1; - obt->scavisflag |= OB_VIS_ACT; - } - } - } - cont= cont->next; - } - - } - ob= ob->id.next; - } - } - } - - /* now we count */ - ob= G.main->object.first; - while(ob) { - if( ob->scavisflag ) (*count)++; - ob= ob->id.next; - } - - if(*count==0) return NULL; - if(*count>24) *count= 24; /* temporal */ - - idar= MEM_callocN( (*count)*sizeof(void *), "idar"); - - ob= G.main->object.first; - nr= 0; - while(ob) { - if( ob->scavisflag ) { - idar[nr]= (ID *)ob; - nr++; - } - if(nr>=24) break; - ob= ob->id.next; - } - - /* just to be sure... these were set in set_sca_done_ob() */ - clear_sca_new_poins(); - - return idar; -} - - -static int get_col_sensor(int type) -{ - switch(type) { - case SENS_ALWAYS: return TH_BUT_ACTION; - case SENS_TOUCH: return TH_BUT_NEUTRAL; - case SENS_COLLISION: return TH_BUT_SETTING; - case SENS_NEAR: return TH_BUT_SETTING1; - case SENS_KEYBOARD: return TH_BUT_SETTING2; - case SENS_PROPERTY: return TH_BUT_NUM; - case SENS_MOUSE: return TH_BUT_TEXTFIELD; - case SENS_RADAR: return TH_BUT_POPUP; - case SENS_RANDOM: return TH_BUT_NEUTRAL; - case SENS_RAY: return TH_BUT_SETTING1; - case SENS_MESSAGE: return TH_BUT_SETTING2; - case SENS_JOYSTICK: return TH_BUT_NEUTRAL; - default: return TH_BUT_NEUTRAL; - } -} -static void set_col_sensor(int type, int medium) -{ - int col= get_col_sensor(type); - BIF_ThemeColorShade(col, medium?30:0); -} - -/** - * Draws a toggle for pulse mode, a frequency field and a toggle to invert - * the value of this sensor. Operates on the shared data block of sensors. - */ -static void draw_default_sensor_header(bSensor *sens, - uiBlock *block, - short x, - short y, - short w) -{ - /* Pulsing and frequency */ - uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP, - (short)(x + 10 + 0. * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, - &sens->pulse, 0.0, 0.0, 0, 0, - "Activate TRUE level triggering (pulse mode)"); - - uiDefIconButBitS(block, TOG, SENS_NEG_PULSE_MODE, 1, ICON_DOTSDOWN, - (short)(x + 10 + 0.15 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, - &sens->pulse, 0.0, 0.0, 0, 0, - "Activate FALSE level triggering (pulse mode)"); - uiDefButS(block, NUM, 1, "f:", - (short)(x + 10 + 0.3 * (w-20)), (short)(y - 19), (short)(0.275 * (w-20)), 19, - &sens->freq, 0.0, 10000.0, 0, 0, - "Delay between repeated pulses (in logic tics, 0 = no delay)"); - - /* value or shift? */ - uiDefButS(block, TOG, 1, "Inv", - (short)(x + 10 + 0.85 * (w-20)), (short)(y - 19), (short)(0.15 * (w-20)), 19, - &sens->invert, 0.0, 0.0, 0, 0, - "Invert the level (output) of this sensor"); -} - -static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short yco, short width,char* objectname) -{ - bNearSensor *ns = NULL; - bTouchSensor *ts = NULL; - bKeyboardSensor *ks = NULL; - bPropertySensor *ps = NULL; - bMouseSensor *ms = NULL; - bCollisionSensor *cs = NULL; - bRadarSensor *rs = NULL; - bRandomSensor *randomSensor = NULL; - bRaySensor *raySens = NULL; - bMessageSensor *mes = NULL; - bJoystickSensor *joy = NULL; - - short ysize; - char *str; - - /* yco is at the top of the rect, draw downwards */ - - uiBlockSetEmboss(block, UI_EMBOSSM); - - set_col_sensor(sens->type, 0); - - switch (sens->type) - { - case SENS_ALWAYS: - { - ysize= 24; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - - yco-= ysize; - - break; - } - case SENS_TOUCH: - { - ysize= 48; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - - ts= sens->data; - - /* uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, 31, 0, 0, "Only look for Objects with this property"); */ - uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material"); - ///* uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity"); - yco-= ysize; - break; - } - case SENS_COLLISION: - { - ysize= 48; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - cs= sens->data; - - /* The collision sensor will become a generic collision (i.e. it */ - /* absorb the old touch sensor). */ - - uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10),(short)(yco - 44), - (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, - "Toggle collision on material or property."); - - if (cs->mode & SENS_COLLISION_MATERIAL) { - uiDefBut(block, TEX, 1, "Material:", (short)(xco + 10 + 0.20 * (width-20)), - (short)(yco-44), (short)(0.8*(width-20)), 19, &cs->materialName, 0, 31, 0, 0, - "Only look for Objects with this material"); - } else { - uiDefBut(block, TEX, 1, "Property:", (short)(xco + 10 + 0.20 * (width-20)), (short)(yco-44), - (short)(0.8*(width-20)), 19, &cs->name, 0, 31, 0, 0, - "Only look for Objects with this property"); - } - - /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */ - - yco-= ysize; - break; - } - case SENS_NEAR: - { - ysize= 72; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - ns= sens->data; - - uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19, - &ns->name, 0, 31, 0, 0, "Only look for Objects with this property"); - uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19, - &ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance"); - uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19, - &ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance"); - yco-= ysize; - break; - } - case SENS_RADAR: - { - ysize= 72; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - - rs= sens->data; - - uiDefBut(block, TEX, 1, "Prop:", - (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19, - &rs->name, 0, 31, 0, 0, - "Only look for Objects with this property"); - uiDefButS(block, ROW, 1, "X", - (short)(10+xco+0.7 * (width-20)),(short)(yco-44), (short)(0.1 * (width-22)),19, - &rs->axis, 2.0, 0, 0, 0, - "Cast the cone along the object's positive x-axis"); - uiDefButS(block, ROW, 1, "Y", - (short)(10+xco+0.8 * (width-20)),(short)(yco-44),(short)(0.1 * (width-22)), 19, - &rs->axis, 2.0, 1, 0, 0, - "Cast the cone along the object's positive y-axis"); - uiDefButS(block, ROW, 1, "Z", - (short)(10+xco+0.9 * (width-20)), (short)(yco-44), (short)(0.1 * (width-22)), 19, - &rs->axis, 2.0, 2, 0, 0, - "Cast the cone along the object's positive z-axis"); - uiDefButF(block, NUM, 1, "Ang:", - (short)(10+xco), (short)(yco-68), (short)((width-20)/2), 19, - &rs->angle, 0.0, 179.9, 10, 0, - "Opening angle of the radar cone."); - uiDefButF(block, NUM, 1, "Dist:", - (short)(xco+10 + (width-20)/2), (short)(yco-68), (short)((width-20)/2), 19, - &rs->range, 0.01, 10000.0, 100, 0, - "Depth of the radar cone"); - yco-= ysize; - break; - } - case SENS_KEYBOARD: - { - /* 5 lines: 120 height */ - ysize= 120; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - /* header line */ - draw_default_sensor_header(sens, block, xco, yco, width); - ks= sens->data; - - /* line 2: hotkey and allkeys toggle */ - uiDefKeyevtButS(block, B_DIFF, "", xco+40, yco-44, (width)/2, 19, &ks->key, "Key code"); - - /* line 3: two key modifyers (qual1, qual2) */ - uiDefKeyevtButS(block, B_DIFF, "", xco+40, yco-68, (width-50)/2, 19, &ks->qual, "Modifier key code"); - uiDefKeyevtButS(block, B_DIFF, "", xco+40+(width-50)/2, yco-68, (width-50)/2, 19, &ks->qual2, "Second Modifier key code"); - - /* labels for line 1 and 2 */ - uiDefBut(block, LABEL, 0, "Key", xco, yco-44, 40, 19, NULL, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Hold", xco, yco-68, 40, 19, NULL, 0, 0, 0, 0, ""); - - /* part of line 1 */ - uiBlockSetCol(block, TH_BUT_SETTING2); - uiDefButBitS(block, TOG, 1, 0, "All keys", xco+40+(width/2), yco-44, (width/2)-50, 19, - &ks->type, 0, 0, 0, 0, ""); - - /* line 4: toggle property for string logging mode */ - uiDefBut(block, TEX, 1, "LogToggle: ", - xco+10, yco-92, (width-20), 19, - ks->toggleName, 0, 31, 0, 0, - "Property that indicates whether to log " - "keystrokes as a string."); - - /* line 5: target property for string logging mode */ - uiDefBut(block, TEX, 1, "Target: ", - xco+10, yco-116, (width-20), 19, - ks->targetName, 0, 31, 0, 0, - "Property that receives the keystrokes in case " - "a string is logged."); - - yco-= ysize; - break; - } - case SENS_PROPERTY: - { - ysize= 96; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, - (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - ps= sens->data; - - str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3"; - /* str= "Type %t|Equal %x0|Not Equal %x1"; */ - uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19, - &ps->type, 0, 31, 0, 0, "Type"); - - if (ps->type != SENS_PROP_EXPRESSION) - { - uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19, - ps->name, 0, 31, 0, 0, "Property name"); - } - - if(ps->type == SENS_PROP_INTERVAL) - { - uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19, - ps->value, 0, 31, 0, 0, "test for min value"); - uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19, - ps->maxvalue, 0, 31, 0, 0, "test for max value"); - } - else if(ps->type == SENS_PROP_CHANGED); - else - { - uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19, - ps->value, 0, 31, 0, 0, "test for value"); - } - - yco-= ysize; - break; - } - case SENS_MOUSE: - { - ms= sens->data; - /* Two lines: 48 pixels high. */ - ysize = 48; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - /* line 1: header */ - draw_default_sensor_header(sens, block, xco, yco, width); - - /* Line 2: type selection. The number are a bit mangled to get - * proper compatibility with older .blend files. */ - str= "Type %t|Left button %x1|Middle button %x2|" - "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; - uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19, - &ms->type, 0, 31, 0, 0, - "Specify the type of event this mouse sensor should trigger on."); - - yco-= ysize; - break; - } - case SENS_RANDOM: - { - ysize = 48; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - randomSensor = sens->data; - /* some files were wrongly written, avoid crash now */ - if (randomSensor) - { - uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19, - &randomSensor->seed, 0, 1000, 0, 0, - "Initial seed of the generator. (Choose 0 for not random)"); - } - yco-= ysize; - break; - } - case SENS_RAY: - { - ysize = 72; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - draw_default_sensor_header(sens, block, xco, yco, width); - raySens = sens->data; - - /* 1. property or material */ - uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", - xco + 10,yco - 44, 0.20 * (width-20), 19, - &raySens->mode, 0.0, 0.0, 0, 0, - "Toggle collision on material or property."); - - if (raySens->mode & SENS_COLLISION_MATERIAL) - { - uiDefBut(block, TEX, 1, "Material:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, - &raySens->matname, 0, 31, 0, 0, - "Only look for Objects with this material"); - } - else - { - uiDefBut(block, TEX, 1, "Property:", xco + 10 + 0.20 * (width-20), yco-44, 0.8*(width-20), 19, - &raySens->propname, 0, 31, 0, 0, - "Only look for Objects with this property"); - } - - /* 2. sensing range */ - uiDefButF(block, NUM, 1, "Range", xco+10, yco-68, 0.6 * (width-20), 19, - &raySens->range, 0.01, 10000.0, 100, 0, - "Sense objects no farther than this distance"); - - /* 3. axis choice */ - str = "Type %t|+ X axis %x1|+ Y axis %x0|+ Z axis %x2|- X axis %x3|- Y axis %x4|- Z axis %x5"; - uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, - &raySens->axisflag, 2.0, 31, 0, 0, - "Specify along which axis the ray is cast."); - - yco-= ysize; - break; - } - case SENS_MESSAGE: - { - mes = sens->data; - ysize = 2 * 24; /* total number of lines * 24 pixels/line */ - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, - (float)xco+width, (float)yco, 1); - - /* line 1: header line */ - draw_default_sensor_header(sens, block, xco, yco, width); - - /* line 2: Subject filter */ - uiDefBut(block, TEX, 1, "Subject: ", - (xco+10), (yco-44), (width-20), 19, - mes->subject, 0, 31, 0, 0, - "Optional subject filter: only accept messages with this subject" - ", or empty for all"); - - yco -= ysize; - break; - } - case SENS_JOYSTICK: - { - - ysize = 72; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - /* line 1: header */ - draw_default_sensor_header(sens, block, xco, yco, width); - - joy= sens->data; - - - str= "Type %t|Button %x0|Axis %x1|Hat%x2"; - uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, 0.6 * (width-20), 19, - &joy->type, 0, 31, 0, 0, - "The type of event this joystick sensor is triggered on."); - - if(joy->type == SENS_JOY_BUTTON) - { - uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.6 * (width-20), 19, - &joy->button, 0, 18, 100, 0, - "Specify which button to use"); - - str = "Type %t|Pressed %x0|Released %x1"; - uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, - &joy->buttonf, 2.0, 31, 0, 0, - "Button pressed or released."); - } - else if(joy->type == SENS_JOY_AXIS) - { - uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.6 * (width-20), 19, - &joy->axis, 1, 2.0, 100, 0, - "Specify which axis to use"); - - uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, - &joy->precision, 0, 32768.0, 100, 0, - "Specify the precision of the axis"); - - str = "Type %t|Up Axis %x1 |Down Axis %x3|Left Axis %x2|Right Axis %x0"; - uiDefButI(block, MENU, B_REDR, str, xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, - &joy->axisf, 2.0, 31, 0, 0, - "The direction of the axis"); - } - else - { - uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.6 * (width-20), 19, - &joy->hat, 1, 2.0, 100, 0, - "Specify which hat to use"); - - uiDefButI(block, NUM, 1, "Direction:", xco+10 + 0.6 * (width-20), yco-68, 0.4 * (width-20), 19, - &joy->hatf, 0, 12, 100, 0, - "Specify hat direction"); - } - yco-= ysize; - break; - } - } - - uiBlockSetEmboss(block, UI_EMBOSSM); - uiBlockSetCol(block, TH_AUTO); - - return yco-4; -} - - - -static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco, short yco, short width) -{ - bExpressionCont *ec; - bPythonCont *pc; - short ysize; - - uiBlockSetEmboss(block, UI_EMBOSSM); - - switch (cont->type) { - case CONT_EXPRESSION: - ysize= 28; - - BIF_ThemeColor(TH_BUT_SETTING); - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - /* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */ - ec= cont->data; - /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */ - uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19, - ec->str, 0, 127, 0, 0, - "Expression"); - - yco-= ysize; - break; - case CONT_PYTHON: - ysize= 28; - - if(cont->data==NULL) init_controller(cont); - pc= cont->data; - - BIF_ThemeColor(TH_BUT_SETTING1); - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+45,yco-24,width-90, 19, &pc->text, ""); - - yco-= ysize; - break; - - default: - ysize= 4; - - BIF_ThemeColor(TH_BUT_NEUTRAL); - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - yco-= ysize; - } - - uiBlockSetEmboss(block, UI_EMBOSSM); - uiBlockSetCol(block, TH_AUTO); - - return yco; -} - -static int get_col_actuator(int type) -{ - switch(type) { - case ACT_ACTION: return TH_BUT_ACTION; - case ACT_OBJECT: return TH_BUT_NEUTRAL; - case ACT_IPO: return TH_BUT_SETTING; - case ACT_PROPERTY: return TH_BUT_SETTING1; - case ACT_SOUND: return TH_BUT_SETTING2; - case ACT_CD: return TH_BUT_NUM; - case ACT_CAMERA: return TH_BUT_TEXTFIELD; - case ACT_EDIT_OBJECT: return TH_BUT_POPUP; - case ACT_GROUP: return TH_BUT_ACTION; - case ACT_RANDOM: return TH_BUT_NEUTRAL; - case ACT_SCENE: return TH_BUT_SETTING; - case ACT_MESSAGE: return TH_BUT_SETTING1; - case ACT_GAME: return TH_BUT_SETTING2; - case ACT_VISIBILITY: return TH_BUT_NUM; - case ACT_CONSTRAINT: return TH_BUT_ACTION; - default: return TH_BUT_NEUTRAL; - } -} -static void set_col_actuator(int item, int medium) -{ - int col= get_col_actuator(item); - BIF_ThemeColorShade(col, medium?30:10); - -} - -static short draw_actuatorbuttons(bActuator *act, uiBlock *block, short xco, short yco, short width) -{ - bSoundActuator *sa = NULL; - bCDActuator *cda = NULL; - bObjectActuator *oa = NULL; - bIpoActuator *ia = NULL; - bPropertyActuator *pa = NULL; - bCameraActuator *ca = NULL; - bEditObjectActuator *eoa = NULL; - bConstraintActuator *coa = NULL; - bSceneActuator *sca = NULL; - bGroupActuator *ga = NULL; - bRandomActuator *randAct = NULL; - bMessageActuator *ma = NULL; - bActionActuator *aa = NULL; - bGameActuator *gma = NULL; - bVisibilityActuator *visAct = NULL; - - float *fp; - short ysize = 0, wval; - char *str; - int myline; - - /* yco is at the top of the rect, draw downwards */ - uiBlockSetEmboss(block, UI_EMBOSSM); - set_col_actuator(act->type, 0); - - switch (act->type) - { - case ACT_OBJECT: - { - ysize= 129; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - oa = act->data; - wval = (width-100)/3; - - uiDefBut(block, LABEL, 0, "Force", xco, yco-22, 55, 19, NULL, 0, 0, 0, 0, "Sets the force"); - uiDefButF(block, NUM, 0, "", xco+45, yco-22, wval, 19, oa->forceloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-22, wval, 19, oa->forceloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-22, wval, 19, oa->forceloc+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "Torque", xco, yco-41, 55, 19, NULL, 0, 0, 0, 0, "Sets the torque"); - uiDefButF(block, NUM, 0, "", xco+45, yco-41, wval, 19, oa->forcerot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-41, wval, 19, oa->forcerot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-41, wval, 19, oa->forcerot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dLoc", xco, yco-64, 45, 19, NULL, 0, 0, 0, 0, "Sets the dLoc"); - uiDefButF(block, NUM, 0, "", xco+45, yco-64, wval, 19, oa->dloc, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-64, wval, 19, oa->dloc+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-64, wval, 19, oa->dloc+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "dRot", xco, yco-83, 45, 19, NULL, 0, 0, 0, 0, "Sets the dRot"); - uiDefButF(block, NUM, 0, "", xco+45, yco-83, wval, 19, oa->drot, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-83, wval, 19, oa->drot+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-83, wval, 19, oa->drot+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "linV", xco, yco-106, 45, 19, NULL, 0, 0, 0, 0, "Sets the linear velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-106, wval, 19, oa->linearvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-106, wval, 19, oa->linearvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-106, wval, 19, oa->linearvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefBut(block, LABEL, 0, "angV", xco, yco-125, 45, 19, NULL, 0, 0, 0, 0, "Sets the angular velocity"); - uiDefButF(block, NUM, 0, "", xco+45, yco-125, wval, 19, oa->angularvelocity, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-125, wval, 19, oa->angularvelocity+1, -10000.0, 10000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-125, wval, 19, oa->angularvelocity+2, -10000.0, 10000.0, 10, 0, ""); - - uiDefButBitI(block, TOG, ACT_FORCE_LOCAL, 0, "L", xco+45+3*wval, yco-22, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_TORQUE_LOCAL, 0, "L", xco+45+3*wval, yco-41, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_DLOC_LOCAL, 0, "L", xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_DROT_LOCAL, 0, "L", xco+45+3*wval, yco-83, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-106, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitI(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-125, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - - uiDefButBitI(block, TOG, ACT_ADD_LIN_VEL, 0, "add",xco+45+3*wval+15, yco-106, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); - - yco-= ysize; - break; - } - case ACT_ACTION: - { - /* DrawAct */ -#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - ysize = 112; -#else - ysize= 92; -#endif - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - aa = act->data; - wval = (width-60)/3; - - // str= "Action types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; -#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6|Displacement %x7"; -#else - str= "Action types %t|Play %x0|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; -#endif - uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &aa->type, 0.0, 0.0, 0.0, 0.0, "Action playback type"); - uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, 1, "AC: ", xco+30, yco-44, width-60, 19, &aa->act, "Action name"); - - if(aa->type == ACT_ACTION_FROM_PROP) - { - uiDefBut(block, TEX, 0, "Prop: ",xco+30, yco-64, width-60, 19, aa->name, 0.0, 31.0, 0, 0, "Use this property to define the Action position"); - } - else - { - uiDefButI(block, NUM, 0, "Sta: ",xco+30, yco-64, (width-60)/2, 19, &aa->sta, 0.0, MAXFRAMEF, 0, 0, "Start frame"); - uiDefButI(block, NUM, 0, "End: ",xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->end, 0.0, MAXFRAMEF, 0, 0, "End frame"); - } - - - - uiDefButI(block, NUM, 0, "Blendin: ", xco+30, yco-84, (width-60)/2, 19, &aa->blendin, 0.0, MAXFRAMEF, 0.0, 0.0, "Number of frames of motion blending"); - uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-84, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers"); - -#ifdef __NLA_ACTION_BY_MOTION_ACTUATOR - if(aa->type == ACT_ACTION_MOTION) - { - uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-104, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); - } -#endif - - yco-=ysize; - break; - } - case ACT_IPO: - { - ia= act->data; - - ysize= 52; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - str = "Ipo types %t|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x6"; - - uiDefButS(block, MENU, B_REDR, str, xco+20, yco-24, width-40 - (width-40)/3, 19, &ia->type, 0, 0, 0, 0, ""); - uiDefButBitS(block, TOG, ACT_IPOCHILD, B_REDR, - "Child", xco+20+0.666*(width-40), yco-24, (width-40)/3, 19, - &ia->flag, 0, 0, 0, 0, - "Add all children Objects as well"); - - if(ia->type==ACT_IPO_FROM_PROP) { - uiDefBut(block, TEX, 0, - "Prop: ", xco+20, yco-44, width-40, 19, - ia->name, 0.0, 31.0, 0, 0, - "Use this property to define the Ipo position"); - } - else { - uiDefButI(block, NUM, 0, - "Sta", xco+20, yco-44, (width-100)/2, 19, - &ia->sta, 0.0, MAXFRAMEF, 0, 0, - "Start frame"); - uiDefButI(block, NUM, 0, - "End", xco+18+(width-90)/2, yco-44, (width-100)/2, 19, - &ia->end, 0.0, MAXFRAMEF, 0, 0, - "End frame"); - - uiDefButBitS(block, TOG, ACT_IPOFORCE, B_REDR, - "Force", xco+width-78, yco-44, 43, 19, - &ia->flag, 0, 0, 0, 0, - "Convert Ipo to force"); - - /* Only show the do-force-local toggle if force is requested */ - if (ia->flag & ACT_IPOFORCE) { - uiDefButBitS(block, TOG, ACT_IPOFORCE_LOCAL, 0, - "L", xco+width-35, yco-44, 15, 19, - &ia->flag, 0, 0, 0, 0, - "Let the force-ipo act in local coordinates."); - } - - } - yco-= ysize; - break; - } - case ACT_PROPERTY: - { - ysize= 68; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - pa= act->data; - - str= "Type %t|Assign %x0|Add %x1|Copy %x2"; - uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type"); - - uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, 31, 0, 0, "Property name"); - - if(pa->type==ACT_PROP_COPY) { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-64, (width-20)/2, 19, &(pa->ob), "Copy from this Object"); - uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, 31, 0, 0, "Copy this property"); - } - else { - uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, 31, 0, 0, "change with this value"); - } - yco-= ysize; - - break; - } - case ACT_SOUND: - { - ysize = 70; - - sa = act->data; - sa->sndnr = 0; - - wval = (width-20)/2; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - if(G.main->sound.first) { - IDnames_to_pupstring(&str, "Sound files", NULL, &(G.main->sound), (ID *)sa->sound, &(sa->sndnr)); - /* reset this value, it is for handling the event */ - sa->sndnr = 0; - uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, ""); - - if(sa->sound) { - char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; - uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, ""); - uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->sound->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound"); - uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->sound->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound"); - } - MEM_freeN(str); - } - else { - uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, ""); - } - - yco-= ysize; - - break; - } - case ACT_CD: - { - char cd_type_str[] = "Sound mode %t|Play all tracks %x0|Play one track %x1|" - "Volume %x3|Stop %x4|Pause %x5|Resume %x6"; - cda = act->data; - - if (cda) { - if (cda->track == 0) { - cda->track = 1; - cda->volume = 1; - cda->type = ACT_CD_PLAY_ALL; - } - - if (cda->type == ACT_CD_PLAY_TRACK || cda->type == ACT_CD_LOOP_TRACK) { - ysize = 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefButS(block, NUM, 0, "Track:", xco+10,yco-44,width-20, 19, &cda->track, 1, 99, 0, 0, "Select the track to be played"); - } - else if (cda->type == ACT_CD_VOLUME) { - ysize = 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-44,width-20, 19, &cda->volume, 0, 1, 0, 0, "Set the volume for CD playback"); - } - else { - ysize = 28; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - } - uiDefButS(block, MENU, B_REDR, cd_type_str,xco+10,yco-22,width-20, 19, &cda->type, 0.0, 0.0, 0, 0, ""); - } - yco-= ysize; - break; - } - case ACT_CAMERA: - - ysize= 48; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - ca= act->data; - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-24, (width-20)/2, 19, &(ca->ob), "Look at this Object"); - uiDefButF(block, NUM, 0, "Height:", xco+10+(width-20)/2, yco-24, (width-20)/2, 19, &ca->height, 0.0, 20.0, 0, 0, ""); - - uiDefButF(block, NUM, 0, "Min:", xco+10, yco-44, (width-60)/2, 19, &ca->min, 0.0, 20.0, 0, 0, ""); - - if(ca->axis==0) ca->axis= 'x'; - uiDefButS(block, ROW, 0, "X", xco+10+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'x', 0, 0, "Camera tries to get behind the X axis"); - uiDefButS(block, ROW, 0, "Y", xco+30+(width-60)/2, yco-44, 20, 19, &ca->axis, 4.0, (float)'y', 0, 0, "Camera tries to get behind the Y axis"); - - uiDefButF(block, NUM, 0, "Max:", xco+20+(width)/2, yco-44, (width-60)/2, 19, &ca->max, 0.0, 20.0, 0, 0, ""); - - yco-= ysize; - - break; - - case ACT_EDIT_OBJECT: - - eoa= act->data; - - if(eoa->type==ACT_EDOB_ADD_OBJECT) { - int wval; /* just a temp width */ - ysize = 72; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object (cant be on an visible layer)"); - uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the new Object lives"); - - wval= (width-60)/3; - uiDefBut(block, LABEL, 0, "linV", xco, yco-68, 45, 19, - NULL, 0, 0, 0, 0, - "Velocity upon creation."); - uiDefButF(block, NUM, 0, "", xco+45, yco-68, wval, 19, - eoa->linVelocity, -100.0, 100.0, 10, 0, - "Velocity upon creation, x component."); - uiDefButF(block, NUM, 0, "", xco+45+wval, yco-68, wval, 19, - eoa->linVelocity+1, -100.0, 100.0, 10, 0, - "Velocity upon creation, y component."); - uiDefButF(block, NUM, 0, "", xco+45+2*wval, yco-68, wval, 19, - eoa->linVelocity+2, -100.0, 100.0, 10, 0, - "Velocity upon creation, z component."); - uiDefButBitS(block, TOG, 2, 0, "L", xco+45+3*wval, yco-68, 15, 19, - &eoa->localflag, 0.0, 0.0, 0, 0, - "Apply the transformation locally"); - - } - else if(eoa->type==ACT_EDOB_END_OBJECT) { - ysize= 28; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - } - else if(eoa->type==ACT_EDOB_REPLACE_MESH) { - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_meshpoin_but, ID_ME, 1, "ME:", xco+40, yco-44, (width-80), 19, &(eoa->me), "replace the existing mesh with this one"); - } - else if(eoa->type==ACT_EDOB_TRACK_TO) { - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Track to this Object"); - uiDefButI(block, NUM, 0, "Time:", xco+10+(width-20)/2, yco-44, (width-20)/2-40, 19, &eoa->time, 0.0, 2000.0, 0, 0, "Duration the tracking takes"); - uiDefButS(block, TOG, 0, "3D", xco+width-50, yco-44, 40, 19, &eoa->flag, 0.0, 0.0, 0, 0, "Enable 3D tracking"); - } - - str= "Edit Object %t|Add Object %x0|End Object %x1|Replace Mesh %x2|Track to %x3"; - uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &eoa->type, 0.0, 0.0, 0, 0, ""); - - yco-= ysize; - - break; - - case ACT_CONSTRAINT: - - ysize= 44; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - coa= act->data; - -/* str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4|Rot X %x8|Rot Y %x16|Rot Z %x32"; */ - str= "Limit %t|None %x0|Loc X %x1|Loc Y %x2|Loc Z %x4"; - uiDefButS(block, MENU, 1, str, xco+10, yco-40, 70, 19, &coa->flag, 0.0, 0.0, 0, 0, ""); - - uiDefButS(block, NUM, 0, "Damp:", xco+10, yco-20, 70, 19, &coa->damp, 0.0, 100.0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Min", xco+80, yco-20, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Max", xco+80+(width-90)/2, yco-20, (width-90)/2, 19, NULL, 0.0, 0.0, 0, 0, ""); - - if(coa->flag & ACT_CONST_LOCX) fp= coa->minloc; - else if(coa->flag & ACT_CONST_LOCY) fp= coa->minloc+1; - else if(coa->flag & ACT_CONST_LOCZ) fp= coa->minloc+2; - else if(coa->flag & ACT_CONST_ROTX) fp= coa->minrot; - else if(coa->flag & ACT_CONST_ROTY) fp= coa->minrot+1; - else fp= coa->minrot+2; - - uiDefButF(block, NUM, 0, "", xco+80, yco-40, (width-90)/2, 19, fp, -2000.0, 2000.0, 10, 0, ""); - uiDefButF(block, NUM, 0, "", xco+80+(width-90)/2, yco-40, (width-90)/2, 19, fp+3, -2000.0, 2000.0, 10, 0, ""); - - yco-= ysize; - - break; - - case ACT_SCENE: - sca= act->data; - - if(sca->type==ACT_SCENE_RESTART) { - ysize= 28; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - } - else if(sca->type==ACT_SCENE_CAMERA) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", xco+40, yco-44, (width-80), 19, &(sca->camera), "Set this Camera"); - } - else if(sca->type==ACT_SCENE_SET) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Set this Scene"); - } - else if(sca->type==ACT_SCENE_ADD_FRONT) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add an Overlay Scene"); - } - else if(sca->type==ACT_SCENE_ADD_BACK) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Add a Background Scene"); - } - else if(sca->type==ACT_SCENE_REMOVE) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Remove a Scene"); - } - else if(sca->type==ACT_SCENE_SUSPEND) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Pause a Scene"); - } - else if(sca->type==ACT_SCENE_RESUME) { - - ysize= 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 1, "SCE:", xco+40, yco-44, (width-80), 19, &(sca->scene), "Unpause a Scene"); - } - - str= "Scene %t|Restart %x0|Set Scene %x1|Set Camera %x2|Add OverlayScene %x3|Add BackgroundScene %x4|Remove Scene %x5|Suspend Scene %x6|Resume Scene %x7"; - uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &sca->type, 0.0, 0.0, 0, 0, ""); - - yco-= ysize; - break; - case ACT_GAME: - { - gma = act->data; - if (gma->type == ACT_GAME_LOAD) - { - //ysize = 68; - ysize = 48; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file"); -// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); - } -/* else if (gma->type == ACT_GAME_START) - { - ysize = 68; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, 63, 0, 0, "Load this file"); - uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, 63, 0, 0, "Use this loadinganimation"); - } -*/ else if (gma->type == ACT_GAME_RESTART) - { - ysize = 28; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - } - else if (gma->type == ACT_GAME_QUIT) - { - ysize = 28; - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - } - - //str = "Scene %t|Load game%x0|Start loaded game%x1|Restart this game%x2|Quit this game %x3"; - str = "Scene %t|Start new game%x0|Restart this game%x2|Quit this game %x3"; - uiDefButS(block, MENU, B_REDR, str, xco+40, yco-24, (width-80), 19, &gma->type, 0.0, 0.0, 0, 0, ""); - - yco -= ysize; - break; - } - case ACT_GROUP: - ga= act->data; - - ysize= 52; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - str= "GroupKey types %t|Set Key %x6|Play %x0|Ping Pong %x1|Flipper %x2|Loop Stop %x3|Loop End %x4|Property %x5"; - - uiDefButS(block, MENU, 1, str, xco+20, yco-24, width-40, 19, &ga->type, 0, 0, 0, 0, ""); - if(ga->type==ACT_GROUP_SET) { - uiDefBut(block, TEX, 0, "Key: ", xco+20, yco-44, (width-10)/2, 19, ga->name, 0.0, 31.0, 0, 0, "This name defines groupkey to be set"); - uiDefButI(block, NUM, 0, "Frame:", xco+20+(width-10)/2, yco-44, (width-70)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Set this frame"); - } - else if(ga->type==ACT_GROUP_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ", xco+20, yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define the Group position"); - } - else { - uiDefButI(block, NUM, 0, "Sta", xco+20, yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame"); - uiDefButI(block, NUM, 0, "End", xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, "End frame"); - } - yco-= ysize; - break; - - case ACT_VISIBILITY: - ysize = 24; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, - (float)yco-ysize, (float)xco+width, (float)yco, 1); - - visAct = act->data; - - str= "Visibility %t|Visible %x0|Invisible %x1"; - - uiDefButI(block, MENU, B_REDR, str, - xco + 10, yco - 24, width - 20, 19, &visAct->flag, - 0.0, 0.0, 0, 0, - "Make the object invisible or visible."); -/* - uiDefButBitI(block, TOG, ACT_VISIBILITY_INVISIBLE, 0, - "Invisible", - xco + 10, yco - 24, width - 20, 19, &visAct->flag, - 0.0, 0.0, 0, 0, - "Make the object invisible or visible."); -*/ - yco-= ysize; - - break; - - case ACT_RANDOM: - ysize = 69; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, - (float)yco-ysize, (float)xco+width, (float)yco, 1); - - randAct = act->data; - - /* 1. seed */ - uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19, - &randAct->seed, 0, 1000, 0, 0, - "Initial seed of the random generator. Use Python for more freedom. " - " (Choose 0 for not random)"); - - /* 2. distribution type */ - /* One pick per distribution. These numbers MUST match the #defines */ - /* in game.h !!! */ - str= "Distribution %t|Bool Constant %x0|Bool Uniform %x1" - "|Bool Bernoulli %x2|Int Constant %x3|Int Uniform %x4" - "|Int Poisson %x5|Float Constant %x6|Float Uniform %x7" - "|Float Normal %x8|Float Neg. Exp. %x9"; - uiDefButI(block, MENU, B_REDR, str, (xco+10) + 0.4 * (width-20), yco-24, 0.6 * (width-20), 19, - &randAct->distribution, 0.0, 0.0, 0, 0, - "Choose the type of distribution"); - - /* 3. property */ - uiDefBut(block, TEX, 1, "Property:", (xco+10), yco-44, (width-20), 19, - &randAct->propname, 0, 31, 0, 0, - "Assign the random value to this property"); - - /*4. and 5. arguments for the distribution*/ - switch (randAct->distribution) { - case ACT_RANDOM_BOOL_CONST: - uiDefButBitI(block, TOG, 1, 1, "Always true", (xco+10), yco-64, (width-20), 19, - &randAct->int_arg_1, 2.0, 1, 0, 0, - "Always false or always true"); - break; - case ACT_RANDOM_BOOL_UNIFORM: - uiDefBut(block, LABEL, 0, " Do a 50-50 pick.", (xco+10), yco-64, (width-20), 19, - NULL, 0, 0, 0, 0, - "Choose between true and false, 50% chance each."); - break; - case ACT_RANDOM_BOOL_BERNOUILLI: - uiDefButF(block, NUM, 1, "Chance", (xco+10), yco-64, (width-20), 19, - &randAct->float_arg_1, 0.0, 1.0, 0, 0, - "Pick a number between 0 and 1. Success if you stay " - "below this value"); - break; - case ACT_RANDOM_INT_CONST: - uiDefButI(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19, - &randAct->int_arg_1, -1000, 1000, 0, 0, - "Always return this number"); - break; - case ACT_RANDOM_INT_UNIFORM: - uiDefButI(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, - &randAct->int_arg_1, -1000, 1000, 0, 0, - "Choose a number from a range. " - "Lower boundary of the range."); - uiDefButI(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, - &randAct->int_arg_2, -1000, 1000, 0, 0, - "Choose a number from a range. " - "Upper boundary of the range."); - break; - case ACT_RANDOM_INT_POISSON: - uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20), 19, - &randAct->float_arg_1, 0.01, 100.0, 0, 0, - "Expected mean value of the distribution."); - break; - case ACT_RANDOM_FLOAT_CONST: - uiDefButF(block, NUM, 1, "Value: ", (xco+10), yco-64, (width-20), 19, - &randAct->float_arg_1, 0.0, 1.0, 0, 0, - "Always return this number"); - break; - case ACT_RANDOM_FLOAT_UNIFORM: - uiDefButF(block, NUM, 1, "Min: ", (xco+10), yco-64, (width-20)/2, 19, - &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, - "Choose a number from a range. " - "Lower boundary of the range."); - uiDefButF(block, NUM, 1, "Max: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, - &randAct->float_arg_2, -10000.0, 10000.0, 0, 0, - "Choose a number from a range. " - "Upper boundary of the range."); - break; - case ACT_RANDOM_FLOAT_NORMAL: - uiDefButF(block, NUM, 1, "Mean: ", (xco+10), yco-64, (width-20)/2, 19, - &randAct->float_arg_1, -10000.0, 10000.0, 0, 0, - "A normal distribution. Mean of the distribution."); - uiDefButF(block, NUM, 1, "SD: ", (xco+10) + (width-20)/2, yco-64, (width-20)/2, 19, - &randAct->float_arg_2, 0.0, 10000.0, 0, 0, - "A normal distribution. Standard deviation of the " - "distribution."); - break; - case ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL: - uiDefButF(block, NUM, 1, "Half-life time: ", (xco+10), yco-64, (width-20), 19, - &randAct->float_arg_1, 0.001, 10000.0, 0, 0, - "Negative exponential dropoff."); - break; - default: - ; /* don't know what this distro is... can be useful for testing */ - /* though :) */ - } - - yco-= ysize; - break; - case ACT_MESSAGE: - ma = act->data; - -#define MESSAGE_SENSOR_TO_FIELD_WORKS /* Really? Not really. Don't remove this ifdef yet */ - -#ifdef MESSAGE_SENSOR_TO_FIELD_WORKS - ysize = 4 + (3 * 24); /* footer + number of lines * 24 pixels/line */ -#else - ysize = 4 + (2 * 24); /* footer + number of lines * 24 pixels/line */ -#endif - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, - (float)xco+width, (float)yco, 1); - - myline=1; - - -#ifdef MESSAGE_SENSOR_TO_FIELD_WORKS - /* line 1: To */ - uiDefBut(block, TEX, 1, "To: ", - (xco+10), (yco-(myline++*24)), (width-20), 19, - &ma->toPropName, 0, 31, 0, 0, - "Optional send message to objects with this name only" - ", or empty to broadcast"); - -#endif - - /* line 2: Message Subject */ - uiDefBut(block, TEX, 1, "Subject: ", - (xco+10), (yco-(myline++*24)), (width-20), 19, - &ma->subject, 0, 31, 0, 0, - "Optional message subject. This is what can be filtered on."); - - /* line 3: Text/Property */ - uiDefButBitS(block, TOG, 1, B_REDR, "T/P", - (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19, - &ma->bodyType, 0.0, 0.0, 0, 0, - "Toggle message type: either Text or a PropertyName."); - - if (ma->bodyType == ACT_MESG_MESG) - { - /* line 3: Message Body */ - uiDefBut(block, TEX, 1, "Body: ", - (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, - &ma->body, 0, 31, 0, 0, - "Optional message body Text"); - } else - { - /* line 3: Property body (set by property) */ - uiDefBut(block, TEX, 1, "Propname: ", - (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, - &ma->body, 0, 31, 0, 0, - "The message body will be set by the Property Value"); - } - - yco -= ysize; - break; - default: - ysize= 4; - - glRects(xco, yco-ysize, xco+width, yco); - uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - - yco-= ysize; - break; - } - - uiBlockSetEmboss(block, UI_EMBOSSM); - - return yco-4; -} - -static void do_sensor_menu(void *arg, int event) -{ - ID **idar; - Object *ob; - bSensor *sens; - short count, a; - - idar= get_selected_and_linked_obs(&count, G.buts->scaflag); - - for(a=0; ascaflag |= OB_SHOWSENS; - else if(event==1) ob->scaflag &= ~OB_SHOWSENS; - } - - for(a=0; asensors.first; - while(sens) { - if(event==2) sens->flag |= SENS_SHOW; - else if(event==3) sens->flag &= ~SENS_SHOW; - sens= sens->next; - } - } - - if(idar) MEM_freeN(idar); - allqueue(REDRAWBUTSLOGIC, 0); -} - -static uiBlock *sensor_menu(void *arg_unused) -{ - uiBlock *block; - int yco=0; - - block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, do_sensor_menu, NULL); - - uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Show Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefBut(block, BUTM, 1, "Hide Sensors", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_TOP); - - return block; -} - -static void do_controller_menu(void *arg, int event) -{ - ID **idar; - Object *ob; - bController *cont; - short count, a; - - idar= get_selected_and_linked_obs(&count, G.buts->scaflag); - - for(a=0; ascaflag |= OB_SHOWCONT; - else if(event==1) ob->scaflag &= ~OB_SHOWCONT; - } - - for(a=0; acontrollers.first; - while(cont) { - if(event==2) cont->flag |= CONT_SHOW; - else if(event==3) cont->flag &= ~CONT_SHOW; - cont= cont->next; - } - } - - if(idar) MEM_freeN(idar); - allqueue(REDRAWBUTSLOGIC, 0); -} - -static uiBlock *controller_menu(void *arg_unused) -{ - uiBlock *block; - int yco=0; - - block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, do_controller_menu, NULL); - - uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Hide Objects", 0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Show Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, ""); - uiDefBut(block, BUTM, 1, "Hide Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, ""); - - uiBlockSetDirection(block, UI_TOP); - - return block; -} - -static void do_actuator_menu(void *arg, int event) -{ - ID **idar; - Object *ob; - bActuator *act; - short count, a; - - idar= get_selected_and_linked_obs(&count, G.buts->scaflag); - - for(a=0; ascaflag |= OB_SHOWACT; - else if(event==1) ob->scaflag &= ~OB_SHOWACT; - } - - for(a=0; aactuators.first; - while(act) { - if(event==2) act->flag |= ACT_SHOW; - else if(event==3) act->flag &= ~ACT_SHOW; - act= act->next; - } - } - - if(idar) MEM_freeN(idar); - allqueue(REDRAWBUTSLOGIC, 0); -} - -static uiBlock *actuator_menu(void *arg_unused) -{ - uiBlock *block; - int xco=0; - - block= uiNewBlock(&curarea->uiblocks, "filemenu", UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, do_actuator_menu, NULL); - - uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefBut(block, SEPR, 0, "", 0, (short)(xco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, BUTM, 1, "Show Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefBut(block, BUTM, 1, "Hide Actuators", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_TOP); - - return block; -} - - -void buttons_enji(uiBlock *block, Object *ob) -{ - uiDefButBitI(block, TOG, OB_SECTOR, B_SETSECTOR, "Sector", - 10,205,65,19, &ob->gameflag, 0, 0, 0, 0, - "All game elements should be in the Sector boundbox"); - uiDefButBitI(block, TOG, OB_PROP, B_SETPROP, "Prop", - 75,205,65,19, &ob->gameflag, 0, 0, 0, 0, - "An Object fixed within a sector"); - uiBlockSetCol(block, BUTPURPLE); - uiDefButBitI(block, TOG, OB_ACTOR, B_SETACTOR, "Actor", - 140,205,65,19, &ob->gameflag, 0, 0, 0, 0, - "Objects that are evaluated by the engine "); - if(ob->gameflag & OB_ACTOR) { - uiDefButBitI(block, TOG, OB_DYNAMIC, B_SETDYNA, "Dynamic", - 205,205,75,19, &ob->gameflag, 0, 0, 0, 0, - "Motion defined by laws of physics"); - uiDefButBitI(block, TOG, OB_MAINACTOR, B_SETMAINACTOR, "MainActor", - 280,205,70,19, &ob->gameflag, 0, 0, 0, 0, ""); - - if(ob->gameflag & OB_DYNAMIC) { - uiDefButBitI(block, TOG, OB_DO_FH, B_DIFF, "Do Fh", - 10,185,50,19, &ob->gameflag, 0, 0, 0, 0, - "Use Fh settings in Materials"); - uiDefButBitI(block, TOG, OB_ROT_FH, B_DIFF, "Rot Fh", - 60,185,50,19, &ob->gameflag, 0, 0, 0, 0, - "Use face normal to rotate Object"); - - uiBlockSetCol(block, BUTGREY); - uiDefButF(block, NUM, B_DIFF, "Mass:", - 110, 185, 120, 19, &ob->mass, 0.01, 100.0, 10, 0, - "The mass of the Object"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Size:", - 230, 185, 120, 19, &ob->inertia, 0.01, 10.0, 10, 0, - "Bounding sphere size"); - uiDefButF(block, NUM, B_DIFF, "Damp:", - 10, 165, 100, 19, &ob->damping, 0.0, 1.0, 10, 0, - "General movement damping"); - uiDefButF(block, NUM, B_DIFF, "RotDamp:", - 110, 165, 120, 19, &ob->rdamping, 0.0, 1.0, 10, 0, - "General rotation damping"); - } - } - -} - -void buttons_ketsji(uiBlock *block, Object *ob) -{ - uiDefButBitI(block, TOG, OB_ACTOR, B_REDR, "Actor", - 10,205,55,19, &ob->gameflag, 0, 0, 0, 0, - "Objects that are evaluated by the engine "); - if(ob->gameflag & OB_ACTOR) { - uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", 65,205,55,19, - &ob->gameflag, 0, 0, 0, 0, - "Objects that don't restitute collisions (like a ghost)"); - uiDefButBitI(block, TOG, OB_DYNAMIC, B_REDR, "Dynamic", 120,205,70,19, - &ob->gameflag, 0, 0, 0, 0, - "Motion defined by laws of physics"); - - if(ob->gameflag & OB_DYNAMIC) { - uiDefButBitI(block, TOG, OB_RIGID_BODY, B_REDR, "Rigid Body", 190,205,80,19, - &ob->gameflag, 0, 0, 0, 0, - "Enable rolling physics"); - uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, B_REDR, "No sleeping", 270,205,80,19, - &ob->gameflag, 0, 0, 0, 0, - "Disable auto (de)activation"); - - uiDefButBitI(block, TOG, OB_DO_FH, B_DIFF, "Do Fh", 10,185,50,19, - &ob->gameflag, 0, 0, 0, 0, - "Use Fh settings in Materials"); - uiDefButBitI(block, TOG, OB_ROT_FH, B_DIFF, "Rot Fh", 60,185,50,19, - &ob->gameflag, 0, 0, 0, 0, - "Use face normal to rotate Object"); - uiDefButF(block, NUM, B_DIFF, "Mass:", 110, 185, 80, 19, - &ob->mass, 0.01, 10000.0, 10, 0, - "The mass of the Object"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 190, 185, 80, 19, - &ob->inertia, 0.01, 10.0, 10, 0, - "Bounding sphere radius"); - uiDefButF(block, NUM, B_DIFF, "Form:", 270, 185, 80, 19, - &ob->formfactor, 0.01, 100.0, 10, 0, - "Form factor"); - - uiDefButF(block, NUM, B_DIFF, "Damp:", 10, 165, 100, 19, - &ob->damping, 0.0, 1.0, 10, 0, - "General movement damping"); - uiDefButF(block, NUM, B_DIFF, "RotDamp:", 110, 165, 120, 19, - &ob->rdamping, 0.0, 1.0, 10, 0, - "General rotation damping"); - uiDefButBitI(block, TOG, OB_ANISOTROPIC_FRICTION, B_REDR, "Anisotropic", - 230, 165, 120, 19, - &ob->gameflag, 0.0, 1.0, 10, 0, - "Enable anisotropic friction"); - } - - if (ob->gameflag & OB_ANISOTROPIC_FRICTION) { - uiDefButF(block, NUM, B_DIFF, "x friction:", 10, 145, 114, 19, - &ob->anisotropicFriction[0], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the x-direction."); - uiDefButF(block, NUM, B_DIFF, "y friction:", 124, 145, 113, 19, - &ob->anisotropicFriction[1], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the y-direction."); - uiDefButF(block, NUM, B_DIFF, "z friction:", 237, 145, 113, 19, - &ob->anisotropicFriction[2], 0.0, 1.0, 10, 0, - "Relative friction coefficient in the z-direction."); - } - } - - if (!(ob->gameflag & OB_GHOST)) { - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 125, 75, 19, - &ob->gameflag, 0, 0,0, 0, - "Specify a bounds object for physics"); - if (ob->gameflag & OB_BOUNDS) { - uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4", - 85, 125, 160, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type"); - uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 250,125,100,19, - &ob->gameflag, 0, 0, 0, 0, - "Add Children"); - } - uiBlockEndAlign(block); - } -} - -void buttons_bullet(uiBlock *block, Object *ob) -{ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, OB_ACTOR, B_REDR, "Actor", - 10,205,55,19, &ob->gameflag, 0, 0, 0, 0, - "Objects that are evaluated by the engine "); - if(ob->gameflag & OB_ACTOR) { - uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", 65,205,55,19, - &ob->gameflag, 0, 0, 0, 0, - "Objects that don't restitute collisions (like a ghost)"); - uiDefButBitI(block, TOG, OB_DYNAMIC, B_REDR, "Dynamic", 120,205,70,19, - &ob->gameflag, 0, 0, 0, 0, - "Motion defined by laws of physics"); - - if(ob->gameflag & OB_DYNAMIC) { - uiDefButBitI(block, TOG, OB_RIGID_BODY, B_REDR, "Rigid Body", 190,205,80,19, - &ob->gameflag, 0, 0, 0, 0, - "Enable rolling physics"); - uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, B_REDR, "No sleeping", 270,205,80,19, - &ob->gameflag, 0, 0, 0, 0, - "Disable auto (de)activation"); - - uiDefButF(block, NUM, B_DIFF, "Mass:", 10, 185, 170, 19, - &ob->mass, 0.01, 10000.0, 10, 2, - "The mass of the Object"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 180, 185, 170, 19, - &ob->inertia, 0.01, 10.0, 10, 2, - "Bounding sphere radius"); - - uiDefButF(block, NUMSLI, B_DIFF, "Damp ", 10, 165, 150, 19, - &ob->damping, 0.0, 1.0, 10, 0, - "General movement damping"); - uiDefButF(block, NUMSLI, B_DIFF, "RotDamp ", 160, 165, 190, 19, - &ob->rdamping, 0.0, 1.0, 10, 0, - "General rotation damping"); - } - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 125, 75, 19, - &ob->gameflag, 0, 0,0, 0, - "Specify a bounds object for physics"); - if (ob->gameflag & OB_BOUNDS) { - uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4", - //almost ready to enable this one: uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4|Dynamic Mesh %x5|", - 85, 125, 160, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type"); - uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 250,125,100,19, - &ob->gameflag, 0, 0, 0, 0, - "Add Children"); - } - uiBlockEndAlign(block); -} - -/* never used, see CVS 1.134 for the code */ -/* static FreeCamera *new_freecamera(void) */ - -/* never used, see CVS 1.120 for the code */ -/* static uiBlock *freecamera_menu(void) */ - - -void logic_buts(void) -{ - ID **idar; - Object *ob; - bProperty *prop; - bSensor *sens; - bController *cont; - bActuator *act; - uiBlock *block; - uiBut *but; - World *wrld; - int a; - short xco, yco, count, width, ycoo; - char *pupstr, name[32]; - - wrld= G.scene->world; - - ob= OBACT; - - if(ob==0) return; - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - sprintf(name, "buttonswin %d", curarea->win); - block= uiNewBlock(&curarea->uiblocks, name, UI_EMBOSS, UI_HELV, curarea->win); - - uiBlockSetCol(block, TH_BUT_SETTING2); - - if(wrld) { - switch(wrld->physicsEngine) { - case WOPHY_ENJI: - buttons_enji(block, ob); - break; - case WOPHY_BULLET: - buttons_bullet(block, ob); - break; - default: - buttons_ketsji(block, ob); - break; - } - } - else buttons_ketsji(block, ob); - - uiBlockSetCol(block, TH_AUTO); - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_ADD_PROP, "Add Property", 10, 90, 340, 24, - NULL, 0.0, 100.0, 100, 0, - ""); - - pupstr= "Types %t|Bool %x0|Int %x1|Float %x2|String %x3|Timer %x5"; - - a= 0; - prop= ob->prop.first; - while(prop) { - but= uiDefBut(block, BUT, 1, "Del", 10, (short)(70-20*a), 40, 20, NULL, 0.0, 0.0, 1, (float)a, ""); - uiButSetFunc(but, del_property, prop, NULL); - uiDefButS(block, MENU, B_CHANGE_PROP, pupstr, 50, (short)(70-20*a), 60, 20, &prop->type, 0, 0, 0, 0, ""); - but= uiDefBut(block, TEX, 1, "Name:", 110, (short)(70-20*a), 110, 20, prop->name, 0, 31, 0, 0, ""); - uiButSetFunc(but, make_unique_prop_names_cb, prop->name, (void*) 1); - - if(prop->type==PROP_BOOL) { - uiDefButBitI(block, TOG, 1, B_REDR, "True", 220, (short)(70-20*a), 55, 20, &prop->data, 0, 0, 0, 0, ""); - uiDefButBitI(block, TOGN, 1, B_REDR, "False", 270, (short)(70-20*a), 55, 20, &prop->data, 0, 0, 0, 0, ""); - } - else if(prop->type==PROP_INT) - uiDefButI(block, NUM, B_REDR, "", 220, (short)(70-20*a), 110, 20, &prop->data, -10000, 10000, 0, 0, ""); - else if(prop->type==PROP_FLOAT) - uiDefButF(block, NUM, B_REDR, "", 220, (short)(70-20*a), 110, 20, (float*) &prop->data, -10000, 10000, 100, 3, ""); - else if(prop->type==PROP_STRING) - uiDefBut(block, TEX, B_REDR, "", 220, (short)(70-20*a), 110, 20, prop->poin, 0, 127, 0, 0, ""); - else if(prop->type==PROP_TIME) - uiDefButF(block, NUM, B_REDR, "", 220, (short)(70-20*a), 110, 20, (float*) &prop->data, -10000, 10000, 100, 3, ""); - - uiDefButBitS(block, TOG, PROP_DEBUG, B_REDR, "D", 330, (short)(70-20*a), 20, 20, &prop->flag, 0, 0, 0, 0, "Print Debug info"); - - a++; - prop= prop->next; - - } - uiBlockEndAlign(block); - - uiClearButLock(); - - idar= get_selected_and_linked_obs(&count, G.buts->scaflag); - - /* ******************************* */ - xco= 375; yco= 170; width= 230; - - uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 80, 19, ""); - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_SENS_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_SENS_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_SENS_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiBlockEndAlign(block); - - for(a=0; ascavisflag & OB_VIS_SENS) == 0) continue; - - /* presume it is only objects for now */ - uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockBeginAlign(block); - if(ob->sensors.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); - if(ob->sensors.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); - uiBlockEndAlign(block); - yco-=20; - - if(ob->scaflag & OB_SHOWSENS) { - - sens= ob->sensors.first; - while(sens) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, SENS_DEL, B_DEL_SENS, ICON_X, xco, yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Delete Sensor"); - uiDefIconButBitS(block, ICONTOG, SENS_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &sens->flag, 0, 0, 0, 0, "Sensor settings"); - - ycoo= yco; - if(sens->flag & SENS_SHOW) - { - uiDefButS(block, MENU, B_CHANGE_SENS, sensor_pup(), (short)(xco+22), yco, 100, 19, &sens->type, 0, 0, 0, 0, "Sensor type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, sens->name, 0, 31, 0, 0, "Sensor name"); - uiButSetFunc(but, make_unique_prop_names_cb, sens->name, (void*) 0); - - sens->otype= sens->type; - yco= draw_sensorbuttons(sens, block, xco, yco, width,ob->id.name); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; - } - else { - set_col_sensor(sens->type, 1); - glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 100, 19, sens, 0, 0, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); - but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+122), yco, (short)(width-144), 19, sens, 0, 31, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); - } - - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); - uiSetButLink(but, NULL, (void ***)&(sens->links), &sens->totlinks, LINK_SENSOR, LINK_CONTROLLER); - - yco-=20; - - sens= sens->next; - } - yco-= 6; - } - } - - /* ******************************* */ - xco= 675; yco= 170; width= 230; - - uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, 19, ""); - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_CONT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_CONT_ACT, B_REDR, "Act", xco+110+(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator"); - uiBlockEndAlign(block); - - ob= OBACT; - - for(a=0; ascavisflag & OB_VIS_CONT) == 0) continue; - - /* presume it is only objects for now */ - uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockBeginAlign(block); - if(ob->controllers.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), 19, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); - if(ob->controllers.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); - uiBlockEndAlign(block); - yco-=20; - - if(ob->scaflag & OB_SHOWCONT) { - - cont= ob->controllers.first; - while(cont) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); - uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Controller settings"); - - if(cont->flag & CONT_SHOW) { - cont->otype= cont->type; - uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 100, 19, &cont->type, 0, 0, 0, 0, "Controller type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, cont->name, 0, 31, 0, 0, "Controller name"); - uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); - - ycoo= yco; - yco= draw_controllerbuttons(cont, block, xco, yco, width); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; - } - else { - cpack(0x999999); - glRecti(xco+22, yco, xco+width-22,yco+19); - but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 100, 19, cont, 0, 0, 0, 0, "Controller type"); - uiButSetFunc(but, sca_move_controller, cont, NULL); - but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+122), yco,(short)(width-144), 19, cont, 0, 0, 0, 0, "Controller name"); - uiButSetFunc(but, sca_move_controller, cont, NULL); - ycoo= yco; - } - - but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, 19, 19, NULL, 0, 0, 0, 0, ""); - uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); - - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, cont, LINK_CONTROLLER, 0, 0, 0, ""); - - yco-=20; - - cont= cont->next; - } - yco-= 6; - } - } - - /* ******************************* */ - xco= 985; yco= 170; width= 280; - - uiBlockSetEmboss(block, UI_EMBOSSP); - uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 100, 19, ""); - uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, BUTS_ACT_SEL, B_REDR, "Sel", xco+110, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show all selected Objects"); - uiDefButBitS(block, TOG, BUTS_ACT_ACT, B_REDR, "Act", xco+110+(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show active Object"); - uiDefButBitS(block, TOG, BUTS_ACT_LINK, B_REDR, "Link", xco+110+2*(width-110)/3, yco+35, (width-110)/3, 19, &G.buts->scaflag, 0, 0, 0, 0, "Show linked Objects to Controller"); - uiBlockEndAlign(block); - for(a=0; ascavisflag & OB_VIS_ACT) == 0) continue; - - /* presume it is only objects for now */ - uiBlockSetEmboss(block, UI_EMBOSS); - uiBlockBeginAlign(block); - if(ob->actuators.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), 19, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); - if(ob->actuators.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, 19, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); - uiBlockEndAlign(block); - yco-=20; - - if(ob->scaflag & OB_SHOWACT) { - - act= ob->actuators.first; - while(act) { - uiBlockSetEmboss(block, UI_EMBOSSM); - uiDefIconButBitS(block, TOG, ACT_DEL, B_DEL_ACT, ICON_X, xco, yco, 22, 19, &act->flag, 0, 0, 0, 0, "Delete Actuator"); - uiDefIconButBitS(block, ICONTOG, ACT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, 19, &act->flag, 0, 0, 0, 0, "Actuator settings"); - - if(act->flag & ACT_SHOW) { - act->otype= act->type; - uiDefButS(block, MENU, B_CHANGE_ACT, actuator_pup(ob), (short)(xco+22), yco, 100, 19, &act->type, 0, 0, 0, 0, "Actuator type"); - but= uiDefBut(block, TEX, 1, "", (short)(xco+122), yco, (short)(width-144), 19, act->name, 0, 31, 0, 0, "Actuator name"); - uiButSetFunc(but, make_unique_prop_names_cb, act->name, (void*) 0); - - ycoo= yco; - yco= draw_actuatorbuttons(act, block, xco, yco, width); - if(yco-6 < ycoo) ycoo= (yco+ycoo-20)/2; - } - else { - set_col_actuator(act->type, 1); - glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); - but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 100, 19, act, 0, 0, 0, 0, "Actuator type"); - uiButSetFunc(but, sca_move_actuator, act, NULL); - but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+122), yco, (short)(width-144), 19, act, 0, 0, 0, 0, "Actuator name"); - uiButSetFunc(but, sca_move_actuator, act, NULL); - ycoo= yco; - } - - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, 19, 19, act, LINK_ACTUATOR, 0, 0, 0, ""); - - yco-=20; - - act= act->next; - } - yco-= 6; - } - } - - uiComposeLinks(block); - uiDrawBlock(block); - - if(idar) MEM_freeN(idar); -} - diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c deleted file mode 100644 index e5bb4dd8a10..00000000000 --- a/source/blender/src/buttons_object.c +++ /dev/null @@ -1,4749 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" - -#include "BKE_action.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_library.h" -#include "BKE_softbody.h" -#include "BKE_utildefines.h" -#include "BKE_particle.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" - -#include "BIF_butspace.h" -#include "BIF_editaction.h" -#include "BIF_editparticle.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_outliner.h" - -#include "BDR_drawobject.h" -#include "BDR_editcurve.h" - -#include "mydevice.h" -#include "blendef.h" - -/* -----includes for this file specific----- */ - - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_group_types.h" -#include "DNA_image_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_meta_types.h" -#include "DNA_mesh_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_object_fluidsim.h" -#include "DNA_particle_types.h" -#include "DNA_radio_types.h" -#include "DNA_screen_types.h" -#include "DNA_sound_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vfont_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -#include "DNA_text_types.h" - -#include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_deform.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_group.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_sound.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" -#include "BKE_DerivedMesh.h" - -#include "LBM_fluidsim.h" -#include "elbeem.h" - -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_editparticle.h" - -#include "BSE_editipo.h" -#include "BSE_edit.h" - -#include "BDR_editobject.h" -#include "BPY_extern.h" - -#include "butspace.h" // own module - -static float prspeed=0.0; -float prlen=0.0; - - -/* ********************* CONSTRAINT ***************************** */ - -static void constraint_active_func(void *ob_v, void *con_v) -{ - Object *ob= ob_v; - bConstraint *con; - ListBase *lb; - - /* lets be nice and escape if its active already */ - if(con_v) { - con= con_v; - if(con->flag & CONSTRAINT_ACTIVE) return; - } - - lb= get_active_constraints(ob); - - for(con= lb->first; con; con= con->next) { - if(con==con_v) con->flag |= CONSTRAINT_ACTIVE; - else con->flag &= ~CONSTRAINT_ACTIVE; - } - - /* make sure ipowin and buttons shows it */ - if(ob->ipowin==ID_CO) { - allqueue(REDRAWIPO, ID_CO); - allspace(REMAKEIPO, 0); - allqueue(REDRAWNLA, 0); - } - allqueue(REDRAWBUTSOBJECT, 0); -} - -static void add_constraint_to_active(Object *ob, bConstraint *con) -{ - ListBase *list; - - list = get_active_constraints(ob); - if (list) { - unique_constraint_name(con, list); - BLI_addtail(list, con); - - con->flag |= CONSTRAINT_ACTIVE; - for(con= con->prev; con; con= con->prev) - con->flag &= ~CONSTRAINT_ACTIVE; - } -} - -/* returns base ID for Ipo, sets actname to channel if appropriate */ -/* should not make action... */ -static void get_constraint_ipo_context(void *ob_v, char *actname) -{ - Object *ob= ob_v; - - /* todo; check object if it has ob-level action ipo */ - - if (ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - - pchan = get_active_posechannel(ob); - if (pchan) { - BLI_strncpy(actname, pchan->name, 32); - } - } - else if(ob->ipoflag & OB_ACTION_OB) - strcpy(actname, "Object"); -} - -/* initialize UI to show Ipo window and make sure channels etc exist */ -static void enable_constraint_ipo_func (void *ob_v, void *con_v) -{ - Object *ob= ob_v; - bConstraint *con = con_v; - char actname[32]=""; - - /* verifies if active constraint is set and shown in UI */ - constraint_active_func(ob_v, con_v); - - /* the context */ - get_constraint_ipo_context(ob, actname); - - /* adds ipo & channels & curve if needed */ - if(con->flag & CONSTRAINT_OWN_IPO) - verify_ipo((ID *)ob, ID_CO, NULL, con->name, actname); - else - verify_ipo((ID *)ob, ID_CO, actname, con->name, NULL); - - /* make sure ipowin shows it */ - ob->ipowin= ID_CO; - allqueue(REDRAWIPO, ID_CO); - allspace(REMAKEIPO, 0); - allqueue(REDRAWNLA, 0); -} - - -static void add_influence_key_to_constraint_func (void *ob_v, void *con_v) -{ - Object *ob= ob_v; - bConstraint *con = con_v; - IpoCurve *icu; - char actname[32]=""; - - /* verifies if active constraint is set and shown in UI */ - constraint_active_func(ob_v, con_v); - - /* the context */ - get_constraint_ipo_context(ob, actname); - - /* adds ipo & channels & curve if needed */ - if(con->flag & CONSTRAINT_OWN_IPO) - icu= verify_ipocurve((ID *)ob, ID_CO, NULL, con->name, actname, CO_ENFORCE); - else - icu= verify_ipocurve((ID *)ob, ID_CO, actname, con->name, NULL, CO_ENFORCE); - - if (!icu) { - error("Cannot get a curve from this IPO, may be dealing with linked data"); - return; - } - - if(ob->action) - insert_vert_icu(icu, get_action_frame(ob, (float)CFRA), con->enforce, 0); - else - insert_vert_icu(icu, CFRA, con->enforce, 0); - - /* make sure ipowin shows it */ - ob->ipowin= ID_CO; - allqueue(REDRAWIPO, ID_CO); - allspace(REMAKEIPO, 0); - allqueue(REDRAWNLA, 0); - - BIF_undo_push("Insert Influence Key"); -} - -void del_constr_func (void *ob_v, void *con_v) -{ - bConstraint *con= con_v; - bConstraintChannel *chan; - ListBase *lb; - - /* remove ipo channel */ - lb= get_active_constraint_channels(ob_v, 0); - if(lb) { - chan = get_constraint_channel(lb, con->name); - if(chan) { - if(chan->ipo) chan->ipo->id.us--; - BLI_freelinkN(lb, chan); - } - } - /* remove constraint itself */ - lb= get_active_constraints(ob_v); - free_constraint_data (con); - BLI_freelinkN(lb, con); - - constraint_active_func(ob_v, NULL); -} - -static void del_constraint_func (void *ob_v, void *con_v) -{ - del_constr_func (ob_v, con_v); - BIF_undo_push("Delete constraint"); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWIPO, 0); -} - -static void verify_constraint_name_func (void *con_v, void *name_v) -{ - Object *ob= OBACT; - bConstraint *con= con_v; - char oldname[32]; - - if (!con) - return; - - /* put on the stack */ - BLI_strncpy(oldname, (char *)name_v, 32); - - rename_constraint(ob, con, oldname); - - constraint_active_func(ob, con); - allqueue(REDRAWACTION, 0); -} - -void const_moveUp(void *ob_v, void *con_v) -{ - bConstraint *con, *constr= con_v; - ListBase *conlist; - - if(constr->prev) { - conlist = get_active_constraints(ob_v); - for(con= conlist->first; con; con= con->next) { - if(con==constr) { - BLI_remlink(conlist, con); - BLI_insertlink(conlist, con->prev->prev, con); - break; - } - } - } -} - -static void constraint_moveUp(void *ob_v, void *con_v) -{ - const_moveUp(ob_v, con_v); - BIF_undo_push("Move constraint"); -} - -void const_moveDown(void *ob_v, void *con_v) -{ - bConstraint *con, *constr= con_v; - ListBase *conlist; - - if(constr->next) { - conlist = get_active_constraints(ob_v); - for(con= conlist->first; con; con= con->next) { - if(con==constr) { - BLI_remlink(conlist, con); - BLI_insertlink(conlist, con->next, con); - break; - } - } - } -} - -static void constraint_moveDown(void *ob_v, void *con_v) -{ - const_moveDown(ob_v, con_v); - BIF_undo_push("Move constraint"); -} - -/* autocomplete callback for buttons */ -void autocomplete_bone(char *str, void *arg_v) -{ - Object *ob= (Object *)arg_v; - - if(ob==NULL || ob->pose==NULL) return; - - /* search if str matches the beginning of name */ - if(str[0]) { - AutoComplete *autocpl= autocomplete_begin(str, 32); - bPoseChannel *pchan; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - autocomplete_do_name(autocpl, pchan->name); - - autocomplete_end(autocpl, str); - } -} - -/* autocomplete callback for buttons */ -void autocomplete_vgroup(char *str, void *arg_v) -{ - Object *ob= (Object *)arg_v; - - if(ob==NULL) return; - - /* search if str matches the beginning of a name */ - if(str[0]) { - AutoComplete *autocpl= autocomplete_begin(str, 32); - bDeformGroup *dg; - - for(dg= ob->defbase.first; dg; dg= dg->next) - if(dg->name!=str) - autocomplete_do_name(autocpl, dg->name); - - autocomplete_end(autocpl, str); - } -} - -/* pole angle callback */ -void con_kinematic_set_pole_angle(void *ob_v, void *con_v) -{ - bConstraint *con= con_v; - bKinematicConstraint *data = con->data; - - if(data->poletar) { - if(data->flag & CONSTRAINT_IK_SETANGLE) { - data->flag |= CONSTRAINT_IK_GETANGLE; - data->flag &= ~CONSTRAINT_IK_SETANGLE; - } - else { - data->flag &= ~CONSTRAINT_IK_GETANGLE; - data->flag |= CONSTRAINT_IK_SETANGLE; - } - } -} - -/* some commonly used macros in the constraints drawing code */ -#define is_armature_target(target) (target && target->type==OB_ARMATURE) -#define is_armature_owner(ob) ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE)) -#define is_geom_target(target) (target && (ELEM(target->type, OB_MESH, OB_LATTICE)) ) - -/* Helper function for draw constraint - draws constraint space stuff - * This function should not be called if no menus are required - * owner/target: -1 = don't draw menu; 0= not posemode, 1 = posemode - */ -static void draw_constraint_spaceselect (uiBlock *block, bConstraint *con, short xco, short yco, short owner, short target) -{ - short tarx, ownx; - short bwidth; - - /* calculate sizes and placement of menus */ - if (owner == -1) { - bwidth = 125; - tarx = 120; - ownx = 0; - } - else if (target == -1) { - bwidth = 125; - tarx = 0; - ownx = 120; - } - else { - bwidth = 100; - tarx = 95; - ownx = tarx + bwidth; - } - - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "CSpace:", xco, yco, 80,18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiBlockBeginAlign(block); - - /* Target-Space */ - if (target == 1) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1", - tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in"); - } - else if (target == 0) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Local (Without Parent) Space %x1", - tarx, yco, bwidth, 18, &con->tarspace, 0, 0, 0, 0, "Choose space that target is evaluated in"); - } - - /* Owner-Space */ - if (owner == 1) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1", - ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in"); - } - else if (owner == 0) { - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Owner Space %t|World Space %x0|Local (Without Parent) Space %x1", - ownx, yco, bwidth, 18, &con->ownspace, 0, 0, 0, 0, "Choose space that owner is evaluated in"); - } - - uiBlockEndAlign(block); -} - -/* draw panel showing settings for a constraint */ -static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, short *xco, short *yco) -{ - Object *ob= OBACT; - bConstraintTypeInfo *cti; - uiBut *but; - char typestr[32]; - short height, width = 265; - int rb_col; - - cti= constraint_get_typeinfo(con); - if (cti == NULL) { - /* exception for 'Null' constraint - it doesn't have constraint typeinfo! */ - if (con->type == CONSTRAINT_TYPE_NULL) - strcpy(typestr, "Null"); - else - strcpy(typestr, "Unknown"); - } - else - strcpy(typestr, cti->name); - - /* unless button has own callback, it adds this callback to button */ - uiBlockSetFunc(block, constraint_active_func, ob, con); - - /* Draw constraint header */ - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* rounded header */ - rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-1, width+40, 22, NULL, 5.0, 0.0, - (con->flag & CONSTRAINT_EXPAND)?3:15 , rb_col-20, ""); - - /* open/close */ - uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_DISCLOSURE_TRI_RIGHT, *xco-10, *yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint"); - - /* up/down */ - uiBlockBeginAlign(block); - uiBlockSetEmboss(block, UI_EMBOSS); - but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack"); - uiButSetFunc(but, constraint_moveUp, ob, con); - - but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack"); - uiButSetFunc(but, constraint_moveDown, ob, con); - uiBlockEndAlign(block); - - if (con->flag & CONSTRAINT_EXPAND) { - if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT); - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, *xco+10, *yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", *xco+120, *yco, 85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); - uiButSetFunc(but, verify_constraint_name_func, con, NULL); - } - else { - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (con->flag & CONSTRAINT_DISABLE) - uiBlockSetCol(block, TH_REDALERT); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, *xco+10, *yco, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, *xco+120, *yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); - } - - uiBlockSetCol(block, TH_AUTO); - - uiBlockSetEmboss(block, UI_EMBOSSN); - - but = uiDefIconBut(block, BUT, B_CONSTRAINT_CHANGETARGET, ICON_X, *xco+262, *yco, 19, 19, list, 0.0, 0.0, 0.0, 0.0, "Delete constraint"); - uiButSetFunc(but, del_constraint_func, ob, con); - - uiBlockSetEmboss(block, UI_EMBOSS); - - - /* Draw constraint data */ - if ((con->flag & CONSTRAINT_EXPAND) == 0) { - (*yco) -= 21; - } - else { - switch (con->type) { - case CONSTRAINT_TYPE_PYTHON: - { - bPythonConstraint *data = con->data; - bConstraintTarget *ct; - uiBut *but2; - int tarnum, theight; - static int pyconindex=0; - char *menustr; - - theight = (data->tarnum)? (data->tarnum * 38) : (38); - height = theight + 78; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40, height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Script:", *xco+60, *yco-24, 55, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* do the scripts menu */ - menustr = buildmenu_pyconstraints(data->text, &pyconindex); - but2 = uiDefButI(block, MENU, B_CONSTRAINT_TEST, menustr, - *xco+120, *yco-24, 150, 20, &pyconindex, - 0.0, 1.0, 0, 0, "Set the Script Constraint to use"); - uiButSetFunc(but2, validate_pyconstraint_cb, data, &pyconindex); - MEM_freeN(menustr); - - /* draw target(s) */ - if (data->flag & PYCON_USETARGETS) { - /* Draw target parameters */ - for (ct=data->targets.first, tarnum=1; ct; ct=ct->next, tarnum++) { - char tarstr[32]; - short yoffset= ((tarnum-1) * 38); - - /* target label */ - sprintf(tarstr, "Target %02d:", tarnum); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, tarstr, *xco+45, *yco-(48+yoffset), 60, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* target space-selector - per target */ - if (is_armature_target(ct->tar)) { - uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Pose Space %x3|Local with Parent %x4|Local Space %x1", - *xco+10, *yco-(66+yoffset), 100, 18, &ct->space, 0, 0, 0, 0, "Choose space that target is evaluated in"); - } - else { - uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Target Space %t|World Space %x0|Local (Without Parent) Space %x1", - *xco+10, *yco-(66+yoffset), 100, 18, &ct->space, 0, 0, 0, 0, "Choose space that target is evaluated in"); - } - - uiBlockBeginAlign(block); - /* target object */ - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-(48+yoffset), 150, 18, &ct->tar, "Target Object"); - - /* subtarget */ - if (is_armature_target(ct->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-(66+yoffset),150,18, &ct->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ct->tar); - } - else if (is_geom_target(ct->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-(66+yoffset),150,18, &ct->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)ct->tar); - } - else { - strcpy(ct->subtarget, ""); - } - uiBlockEndAlign(block); - } - } - else { - /* Draw indication that no target needed */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+60, *yco-48, 55, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Not Applicable", *xco+120, *yco-48, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - } - - /* settings */ - uiBlockBeginAlign(block); - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Options", *xco, *yco-(52+theight), (width/2),18, NULL, 0, 24, 0, 0, "Change some of the constraint's settings."); - uiButSetFunc(but, BPY_pyconstraint_settings, data, NULL); - - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Refresh", *xco+((width/2)+10), *yco-(52+theight), (width/2),18, NULL, 0, 24, 0, 0, "Force constraint to refresh it's settings"); - uiBlockEndAlign(block); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-(73+theight), is_armature_owner(ob), -1); - } - break; - case CONSTRAINT_TYPE_ACTION: - { - bActionConstraint *data = con->data; - float minval, maxval; - - height = 108; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - - uiBlockEndAlign(block); - - /* Draw action/type buttons */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_actionpoin_but, ID_AC, B_CONSTRAINT_TEST, "AC:", *xco+((width/2)-117), *yco-64, 78, 18, &data->act, "Action containing the keyed motion for this bone"); - uiDefButS(block, MENU, B_CONSTRAINT_TEST, "Key on%t|Loc X%x20|Loc Y%x21|Loc Z%x22|Rot X%x0|Rot Y%x1|Rot Z%x2|Size X%x10|Size Y%x11|Size Z%x12", *xco+((width/2)-117), *yco-84, 78, 18, &data->type, 0, 24, 0, 0, "Specify which transformation channel from the target is used to key the action"); - uiBlockEndAlign(block); - - /* Draw start/end frame buttons */ - uiBlockBeginAlign(block); - uiDefButI(block, NUM, B_CONSTRAINT_TEST, "Start:", *xco+((width/2)-36), *yco-64, 78, 18, &data->start, 1, MAXFRAME, 0.0, 0.0, "Starting frame of the keyed motion"); - uiDefButI(block, NUM, B_CONSTRAINT_TEST, "End:", *xco+((width/2)-36), *yco-84, 78, 18, &data->end, 1, MAXFRAME, 0.0, 0.0, "Ending frame of the keyed motion"); - uiBlockEndAlign(block); - - /* Draw minimum/maximum transform range buttons */ - uiBlockBeginAlign(block); - if (data->type < 10) { /* rotation */ - minval = -180.0f; - maxval = 180.0f; - } - else if (data->type < 20) { /* scaling */ - minval = 0.0001f; - maxval = 1000.0f; - } - else { /* location */ - minval = -1000.0f; - maxval = 1000.0f; - } - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Min:", *xco+((width/2)+45), *yco-64, 78, 18, &data->min, minval, maxval, 0, 0, "Minimum value for target channel range"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Max:", *xco+((width/2)+45), *yco-84, 78, 18, &data->max, minval, maxval, 0, 0, "Maximum value for target channel range"); - uiBlockEndAlign(block); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-104, -1, is_armature_target(data->tar)); - } - break; - case CONSTRAINT_TYPE_CHILDOF: - { - bChildOfConstraint *data = con->data; - short normButWidth = (width/3); - - height = 165; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Parent:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object to use as Parent"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone to use as Parent"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - /* Draw triples of channel toggles */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Use Channel(s):", *xco+65, *yco-64, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, CHILDOF_LOCX, B_CONSTRAINT_TEST, "Loc X", *xco, *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-location"); - uiDefButBitI(block, TOG, CHILDOF_LOCY, B_CONSTRAINT_TEST, "Loc Y", *xco+normButWidth, *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-location"); - uiDefButBitI(block, TOG, CHILDOF_LOCZ, B_CONSTRAINT_TEST, "Loc Z", *xco+(normButWidth * 2), *yco-84, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-location"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, CHILDOF_ROTX, B_CONSTRAINT_TEST, "Rot X", *xco, *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-rotation"); - uiDefButBitI(block, TOG, CHILDOF_ROTY, B_CONSTRAINT_TEST, "Rot Y", *xco+normButWidth, *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-rotation"); - uiDefButBitI(block, TOG, CHILDOF_ROTZ, B_CONSTRAINT_TEST, "Rot Z", *xco+(normButWidth * 2), *yco-105, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-rotation"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, CHILDOF_SIZEX, B_CONSTRAINT_TEST, "Scale X", *xco, *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects x-scaling"); - uiDefButBitI(block, TOG, CHILDOF_SIZEY, B_CONSTRAINT_TEST, "Scale Y", *xco+normButWidth, *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects y-scaling"); - uiDefButBitI(block, TOG, CHILDOF_SIZEZ, B_CONSTRAINT_TEST, "Scale Z", *xco+(normButWidth * 2), *yco-126, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Parent affects z-scaling"); - uiBlockEndAlign(block); - - - /* Inverse options */ - uiBlockBeginAlign(block); - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Set Offset", *xco, *yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Calculate current Parent-Inverse Matrix (i.e. restore offset from parent)"); - uiButSetFunc(but, childof_const_setinv, data, NULL); - - but=uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Clear Offset", *xco+((width/2)+10), *yco-151, (width/2),18, NULL, 0, 24, 0, 0, "Clear Parent-Inverse Matrix (i.e. clear offset from parent)"); - uiButSetFunc(but, childof_const_clearinv, data, NULL); - uiBlockEndAlign(block); - } - break; - case CONSTRAINT_TYPE_LOCLIKE: - { - bLocateLikeConstraint *data = con->data; - - height = 111; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - /* Draw XYZ toggles */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, LOCLIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component"); - uiDefButBitI(block, TOG, LOCLIKE_X_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert X component"); - uiDefButBitI(block, TOG, LOCLIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component"); - uiDefButBitI(block, TOG, LOCLIKE_Y_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Y component"); - uiDefButBitI(block, TOG, LOCLIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+96), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component"); - uiDefButBitI(block, TOG, LOCLIKE_Z_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+128), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Z component"); - uiBlockEndAlign(block); - - /* Draw options */ - uiDefButBitI(block, TOG, LOCLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-89, (width/2), 18, &data->flag, 0, 24, 0, 0, "Add original location onto copied location"); - if (is_armature_target(data->tar)) { - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco+(width/2), *yco-89, (width/2), 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1"); - } - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-109, is_armature_owner(ob), is_armature_target(data->tar)); - } - break; - case CONSTRAINT_TYPE_ROTLIKE: - { - bRotateLikeConstraint *data = con->data; - - height = 101; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - /* Draw XYZ toggles */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, ROTLIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component"); - uiDefButBitI(block, TOG, ROTLIKE_X_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert X component"); - uiDefButBitI(block, TOG, ROTLIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component"); - uiDefButBitI(block, TOG, ROTLIKE_Y_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Y component"); - uiDefButBitI(block, TOG, ROTLIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+96), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component"); - uiDefButBitI(block, TOG, ROTLIKE_Z_INVERT, B_CONSTRAINT_TEST, "-", *xco+((width/2)+128), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Invert Z component"); - uiBlockEndAlign(block); - - /* draw offset toggle */ - uiDefButBitI(block, TOG, ROTLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original rotation onto copied rotation"); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar)); - } - break; - case CONSTRAINT_TYPE_SIZELIKE: - { - bSizeLikeConstraint *data = con->data; - - height = 101; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - /* Draw XYZ toggles */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SIZELIKE_X, B_CONSTRAINT_TEST, "X", *xco+((width/2)-48), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy X component"); - uiDefButBitI(block, TOG, SIZELIKE_Y, B_CONSTRAINT_TEST, "Y", *xco+((width/2)-16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Y component"); - uiDefButBitI(block, TOG, SIZELIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component"); - uiBlockEndAlign(block); - - /* draw offset toggle */ - uiDefButBitI(block, TOG, SIZELIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original scaling onto copied scaling"); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar)); - } - break; - case CONSTRAINT_TYPE_KINEMATIC: - { - bKinematicConstraint *data = con->data; - - height = 146; - if(data->poletar) - height += 30; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* IK Target */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco, *yco-44, 137, 19, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco, *yco-62,137,19, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco, *yco-62,137,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy (data->subtarget, ""); - } - - uiBlockEndAlign(block); - - /* Settings */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, CONSTRAINT_IK_TIP, B_CONSTRAINT_TEST, "Use Tail", *xco, *yco-92, 137, 19, &data->flag, 0, 0, 0, 0, "Include Bone's tail als last element in Chain"); - uiDefButS(block, NUM, B_CONSTRAINT_TEST, "ChainLen:", *xco, *yco-112,137,19, &data->rootbone, 0, 255, 0, 0, "If not zero, the amount of bones in this chain"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_CONSTRAINT_TEST, "PosW ", *xco+147, *yco-92, 137, 19, &data->weight, 0.01, 1.0, 2, 2, "For Tree-IK: weight of position control for this target"); - uiDefButBitS(block, TOG, CONSTRAINT_IK_ROT, B_CONSTRAINT_TEST, "Rot", *xco+147, *yco-112, 40,19, &data->flag, 0, 0, 0, 0, "Chain follows rotation of target"); - uiDefButF(block, NUMSLI, B_CONSTRAINT_TEST, "W ", *xco+187, *yco-112, 97, 19, &data->orientweight, 0.01, 1.0, 2, 2, "For Tree-IK: Weight of orientation control for this target"); - - uiBlockBeginAlign(block); - - uiDefButBitS(block, TOG, CONSTRAINT_IK_STRETCH, B_CONSTRAINT_TEST, "Stretch", *xco, *yco-137,137,19, &data->flag, 0, 0, 0, 0, "Enable IK stretching"); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_CONSTRAINT_TEST, "Iterations:", *xco+147, *yco-137, 137, 19, &data->iterations, 1, 10000, 0, 0, "Maximum number of solving iterations"); - uiBlockEndAlign(block); - - /* Pole Vector */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Pole Target:", *xco+147, *yco-24, 100, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+147, *yco-44, 137, 19, &data->poletar, "Pole Target Object"); - if (is_armature_target(data->poletar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+147, *yco-62,137,19, &data->polesubtarget, 0, 24, 0, 0, "Pole Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->poletar); - } - else if (is_geom_target(data->poletar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+147, *yco-62,137,18, &data->polesubtarget, 0, 24, 0, 0, "Name of Vertex Group defining pole 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->poletar); - } - else { - strcpy (data->polesubtarget, ""); - } - - if(data->poletar) { - uiBlockBeginAlign(block); -#if 0 - but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, (data->flag & CONSTRAINT_IK_SETANGLE)? "Set Pole Offset": "Clear Pole Offset", *xco, *yco-167, 137, 19, 0, 0.0, 1.0, 0.0, 0.0, "Set the pole rotation offset from the current pose"); - uiButSetFunc(but, con_kinematic_set_pole_angle, ob, con); - if(!(data->flag & CONSTRAINT_IK_SETANGLE)) -#endif - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pole Offset ", *xco, *yco-167, 137, 19, &data->poleangle, -180.0, 180.0, 0, 0, "Pole rotation offset"); - } - } - break; - case CONSTRAINT_TYPE_TRACKTO: - { - bTrackToConstraint *data = con->data; - - if (is_armature_target(data->tar)) - height = 118; - else - height = 96; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Align:", *xco+5, *yco-42, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButBitI(block, TOG, 1, B_CONSTRAINT_TEST, "TargetZ", *xco+60, *yco-42, 50, 18, &data->flags, 0, 1, 0, 0, "Target Z axis, not world Z axis, will constrain up direction"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "To:", *xco+12, *yco-64, 25, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->reserved1, 12.0, 0.0, 0, 0, "X axis points to the target object"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->reserved1, 12.0, 1.0, 0, 0, "Y axis points to the target object"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->reserved1, 12.0, 2.0, 0, 0, "Z axis points to the target object"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->reserved1, 12.0, 3.0, 0, 0, "-X axis points to the target object"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->reserved1, 12.0, 4.0, 0, 0, "-Y axis points to the target object"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->reserved1, 12.0, 5.0, 0, 0, "-Z axis points to the target object"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Up:", *xco+174, *yco-64, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->reserved2, 13.0, 0.0, 0, 0, "X axis points upward"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->reserved2, 13.0, 1.0, 0, 0, "Y axis points upward"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->reserved2, 13.0, 2.0, 0, 0, "Z axis points upward"); - uiBlockEndAlign(block); - - if (is_armature_target(data->tar)) { - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco, *yco-94, 241, 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1"); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-116, is_armature_owner(ob), is_armature_target(data->tar)); - } - else { - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar)); - } - } - break; - case CONSTRAINT_TYPE_MINMAX: - { - bMinMaxConstraint *data = con->data; - - if (is_armature_target(data->tar)) - height = 88; - else - height = 66; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Offset:", *xco, *yco-44, 100, 18, &data->offset, -100, 100, 100.0, 0.0, "Offset from the position of the object center"); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - uiDefButBitI(block, TOG, MINMAX_STICKY, B_CONSTRAINT_TEST, "Sticky", *xco, *yco-24, 44, 18, &data->flag, 0, 24, 0, 0, "Immobilize object while constrained"); - uiDefButBitI(block, TOG, MINMAX_USEROT, B_CONSTRAINT_TEST, "Use Rot", *xco+44, *yco-24, 64, 18, &data->flag, 0, 24, 0, 0, "Use target object rotation"); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Max/Min:", *xco-8, *yco-64, 54, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiBlockBeginAlign(block); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+51, *yco-64,17,18, &data->minmaxflag, 12.0, 0.0, 0, 0, "Will not pass below X of target"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+67, *yco-64,17,18, &data->minmaxflag, 12.0, 1.0, 0, 0, "Will not pass below Y of target"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+85, *yco-64,17,18, &data->minmaxflag, 12.0, 2.0, 0, 0, "Will not pass below Z of target"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+102, *yco-64,24,18, &data->minmaxflag, 12.0, 3.0, 0, 0, "Will not pass above X of target"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+126, *yco-64,24,18, &data->minmaxflag, 12.0, 4.0, 0, 0, "Will not pass above Y of target"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+150, *yco-64,24,18, &data->minmaxflag, 12.0, 5.0, 0, 0, "Will not pass above Z of target"); - uiBlockEndAlign(block); - - if (is_armature_target(data->tar)) { - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco, *yco-86, 241, 18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1"); - } - - } - break; - case CONSTRAINT_TYPE_LOCKTRACK: - { - bLockTrackConstraint *data = con->data; - height = 66; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "To:", *xco+12, *yco-64, 25, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->trackflag, 12.0, 0.0, 0, 0, "X axis points to the target object"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->trackflag, 12.0, 1.0, 0, 0, "Y axis points to the target object"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->trackflag, 12.0, 2.0, 0, 0, "Z axis points to the target object"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->trackflag, 12.0, 3.0, 0, 0, "-X axis points to the target object"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->trackflag, 12.0, 4.0, 0, 0, "-Y axis points to the target object"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->trackflag, 12.0, 5.0, 0, 0, "-Z axis points to the target object"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Lock:", *xco+166, *yco-64, 38, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->lockflag, 13.0, 0.0, 0, 0, "X axis is locked"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->lockflag, 13.0, 1.0, 0, 0, "Y axis is locked"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->lockflag, 13.0, 2.0, 0, 0, "Z axis is locked"); - uiBlockEndAlign(block); - } - break; - case CONSTRAINT_TYPE_FOLLOWPATH: - { - bFollowPathConstraint *data = con->data; - - height = 66; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - /* Draw Curve Follow toggle */ - uiDefButBitI(block, TOG, 1, B_CONSTRAINT_TEST, "CurveFollow", *xco+39, *yco-44, 100, 18, &data->followflag, 0, 24, 0, 0, "Object will follow the heading and banking of the curve"); - - /* Draw Offset number button */ - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Offset:", *xco+155, *yco-44, 100, 18, &data->offset, -MAXFRAMEF, MAXFRAMEF, 100.0, 0.0, "Offset from the position corresponding to the time frame"); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Fw:", *xco+12, *yco-64, 27, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+39, *yco-64,17,18, &data->trackflag, 12.0, 0.0, 0, 0, "The axis that points forward along the path"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+56, *yco-64,17,18, &data->trackflag, 12.0, 1.0, 0, 0, "The axis that points forward along the path"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+73, *yco-64,17,18, &data->trackflag, 12.0, 2.0, 0, 0, "The axis that points forward along the path"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-X", *xco+90, *yco-64,24,18, &data->trackflag, 12.0, 3.0, 0, 0, "The axis that points forward along the path"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Y", *xco+114, *yco-64,24,18, &data->trackflag, 12.0, 4.0, 0, 0, "The axis that points forward along the path"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"-Z", *xco+138, *yco-64,24,18, &data->trackflag, 12.0, 5.0, 0, 0, "The axis that points forward along the path"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Up:", *xco+174, *yco-64, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"X", *xco+204, *yco-64,17,18, &data->upflag, 13.0, 0.0, 0, 0, "The axis that points upward"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Y", *xco+221, *yco-64,17,18, &data->upflag, 13.0, 1.0, 0, 0, "The axis that points upward"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST,"Z", *xco+238, *yco-64,17,18, &data->upflag, 13.0, 2.0, 0, 0, "The axis that points upward"); - uiBlockEndAlign(block); - } - break; - case CONSTRAINT_TYPE_STRETCHTO: - { - bStretchToConstraint *data = con->data; - - height = 105; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - if (is_armature_target(data->tar)) { - but=uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - if (is_armature_target(data->tar)) { - uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->orglength, 0.0, 0, 0, 0, "Recalculate RLength"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Rest Length:", *xco+18, *yco-60,139,18, &data->orglength, 0.0, 100, 0.5, 0.5, "Length at Rest Position"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Head/Tail:", *xco+155, *yco-60,97,18, &con->headtail, 0.0, 1, 0.1, 0.1, "Target along length of bone: Head=0, Tail=1"); - } - else { - uiDefButF(block, BUTM, B_CONSTRAINT_TEST, "R", *xco, *yco-60, 20, 18, &data->orglength, 0.0, 0, 0, 0, "Recalculate RLength"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Rest Length:", *xco+18, *yco-60, 237, 18, &data->orglength, 0.0, 100, 0.5, 0.5, "Length at Rest Position"); - } - uiBlockEndAlign(block); - - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Volume Variation:", *xco+18, *yco-82, 237, 18, &data->bulge, 0.0, 100, 0.5, 0.5, "Factor between volume variation and stretching"); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Vol:",*xco+14, *yco-104,30,18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"XZ", *xco+44, *yco-104,30,18, &data->volmode, 12.0, 0.0, 0, 0, "Keep Volume: Scaling X & Z"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+74, *yco-104,20,18, &data->volmode, 12.0, 1.0, 0, 0, "Keep Volume: Scaling X"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+94, *yco-104,20,18, &data->volmode, 12.0, 2.0, 0, 0, "Keep Volume: Scaling Z"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"NONE", *xco+114, *yco-104,50,18, &data->volmode, 12.0, 3.0, 0, 0, "Ignore Volume"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST,"Plane:",*xco+175, *yco-104,40,18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"X", *xco+215, *yco-104,20,18, &data->plane, 12.0, 0.0, 0, 0, "Keep X axis"); - uiDefButI(block, ROW,B_CONSTRAINT_TEST,"Z", *xco+235, *yco-104,20,18, &data->plane, 12.0, 2.0, 0, 0, "Keep Z axis"); - uiBlockEndAlign(block); - } - break; - case CONSTRAINT_TYPE_LOCLIMIT: - { - bLocLimitConstraint *data = con->data; - - int togButWidth = 50; - int textButWidth = ((width/2)-togButWidth); - - height = 136; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_XMIN, B_CONSTRAINT_TEST, "minX", *xco, *yco-28, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-28, (textButWidth-5), 18, &(data->xmin), -1000, 1000, 0.1,0.5,"Lowest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_XMAX, B_CONSTRAINT_TEST, "maxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-28, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-28, (textButWidth-5), 18, &(data->xmax), -1000, 1000, 0.1,0.5,"Highest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_YMIN, B_CONSTRAINT_TEST, "minY", *xco, *yco-50, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-50, (textButWidth-5), 18, &(data->ymin), -1000, 1000, 0.1,0.5,"Lowest y value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_YMAX, B_CONSTRAINT_TEST, "maxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-50, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-50, (textButWidth-5), 18, &(data->ymax), -1000, 1000, 0.1,0.5,"Highest y value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_ZMIN, B_CONSTRAINT_TEST, "minZ", *xco, *yco-72, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-72, (textButWidth-5), 18, &(data->zmin), -1000, 1000, 0.1,0.5,"Lowest z value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_ZMAX, B_CONSTRAINT_TEST, "maxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-72, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum z value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-72, (textButWidth-5), 18, &(data->zmax), -1000, 1000, 0.1,0.5,"Highest z value to allow"); - uiBlockEndAlign(block); - - /* special option(s) */ - uiDefButBitS(block, TOG, LIMIT_TRANSFORM, B_CONSTRAINT_TEST, "For Transform", *xco+(width/4), *yco-100, (width/2), 18, &data->flag2, 0, 24, 0, 0, "Transforms are affected by this constraint as well"); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-130, is_armature_owner(ob), -1); - } - break; - case CONSTRAINT_TYPE_ROTLIMIT: - { - bRotLimitConstraint *data = con->data; - int normButWidth = (width/3); - - height = 106; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_XROT, B_CONSTRAINT_TEST, "LimitX", *xco, *yco-28, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on x-axis"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-28, normButWidth, 18, &(data->xmin), -360, 360, 0.1,0.5,"Lowest x value to allow"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-28, normButWidth, 18, &(data->xmax), -360, 360, 0.1,0.5,"Highest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_YROT, B_CONSTRAINT_TEST, "LimitY", *xco, *yco-50, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on y-axis"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-50, normButWidth, 18, &(data->ymin), -360, 360, 0.1,0.5,"Lowest y value to allow"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-50, normButWidth, 18, &(data->ymax), -360, 360, 0.1,0.5,"Highest y value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_ZROT, B_CONSTRAINT_TEST, "LimitZ", *xco, *yco-72, normButWidth, 18, &data->flag, 0, 24, 0, 0, "Limit rotation on z-axis"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min:", *xco+normButWidth, *yco-72, normButWidth, 18, &(data->zmin), -360, 360, 0.1,0.5,"Lowest z value to allow"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-72, normButWidth, 18, &(data->zmax), -360, 360, 0.1,0.5,"Highest z value to allow"); - uiBlockEndAlign(block); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-100, is_armature_owner(ob), -1); - } - break; - case CONSTRAINT_TYPE_SIZELIMIT: - { - bSizeLimitConstraint *data = con->data; - - int togButWidth = 50; - int textButWidth = ((width/2)-togButWidth); - - height = 106; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_XMIN, B_CONSTRAINT_TEST, "minX", *xco, *yco-28, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-28, (textButWidth-5), 18, &(data->xmin), 0.0001, 1000, 0.1,0.5,"Lowest x value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_XMAX, B_CONSTRAINT_TEST, "maxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-28, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum x value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-28, (textButWidth-5), 18, &(data->xmax), 0.0001, 1000, 0.1,0.5,"Highest x value to allow"); - uiBlockEndAlign(block); - - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_YMIN, B_CONSTRAINT_TEST, "minY", *xco, *yco-50, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-50, (textButWidth-5), 18, &(data->ymin), 0.0001, 1000, 0.1,0.5,"Lowest y value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_YMAX, B_CONSTRAINT_TEST, "maxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-50, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum y value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-50, (textButWidth-5), 18, &(data->ymax), 0.0001, 1000, 0.1,0.5,"Highest y value to allow"); - uiBlockEndAlign(block); - - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_ZMIN, B_CONSTRAINT_TEST, "minZ", *xco, *yco-72, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-72, (textButWidth-5), 18, &(data->zmin), 0.0001, 1000, 0.1,0.5,"Lowest z value to allow"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LIMIT_ZMAX, B_CONSTRAINT_TEST, "maxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-72, 50, 18, &data->flag, 0, 24, 0, 0, "Use maximum z value"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-72, (textButWidth-5), 18, &(data->zmax), 0.0001, 1000, 0.1,0.5,"Highest z value to allow"); - uiBlockEndAlign(block); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-100, is_armature_owner(ob), -1); - } - break; - case CONSTRAINT_TYPE_RIGIDBODYJOINT: - { - bRigidBodyJointConstraint *data = con->data; - float extremeLin = 999.f; - float extremeAngX = 180.f; - float extremeAngY = 45.f; - float extremeAngZ = 45.f; - int togButWidth = 70; - int offsetY = 150; - int textButWidth = ((width/2)-togButWidth); - - uiDefButI(block, MENU, B_CONSTRAINT_TEST, "Joint Types%t|Ball%x1|Hinge%x2|Cone Twist%x4|Generic (experimental)%x12",//|Extra Force%x6", - *xco, *yco-25, 150, 18, &data->type, 0, 0, 0, 0, "Choose the joint type"); - height = 140; - if (data->type==CONSTRAINT_RB_GENERIC6DOF) - height = 270; - if (data->type==CONSTRAINT_RB_CONETWIST) - height = 200; - - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "toObject:", *xco, *yco-50, 130, 18, &data->tar, "Child Object"); - uiDefButBitS(block, TOG, CONSTRAINT_DRAW_PIVOT, B_CONSTRAINT_TEST, "ShowPivot", *xco+135, *yco-50, 130, 18, &data->flag, 0, 24, 0, 0, "Show pivot position and rotation"); - - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot X:", *xco, *yco-75, 130, 18, &data->pivX, -1000, 1000, 100, 0.0, "Offset pivot on X"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot Y:", *xco, *yco-100, 130, 18, &data->pivY, -1000, 1000, 100, 0.0, "Offset pivot on Y"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Pivot Z:", *xco, *yco-125, 130, 18, &data->pivZ, -1000, 1000, 100, 0.0, "Offset pivot on z"); - - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax X:", *xco+135, *yco-75, 130, 18, &data->axX, -360, 360, 1500, 0.0, "Rotate pivot on X Axis (in degrees)"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax Y:", *xco+135, *yco-100, 130, 18, &data->axY, -360, 360, 1500, 0.0, "Rotate pivot on Y Axis (in degrees)"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "Ax Z:", *xco+135, *yco-125, 130, 18, &data->axZ, -360, 360, 1500, 0.0, "Rotate pivot on Z Axis (in degrees)"); - - if (data->type==CONSTRAINT_RB_GENERIC6DOF) { - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMinX", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"min x limit"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 1, B_CONSTRAINT_TEST, "LinMaxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[0]), -extremeLin, extremeLin, 0.1,0.5,"max x limit"); - uiBlockEndAlign(block); - - offsetY += 20; - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMinY", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"min y limit"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 2, B_CONSTRAINT_TEST, "LinMaxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[1]), -extremeLin, extremeLin, 0.1,0.5,"max y limit"); - uiBlockEndAlign(block); - - offsetY += 20; - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMinZ", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"min z limit"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 4, B_CONSTRAINT_TEST, "LinMaxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[2]), -extremeLin, extremeLin, 0.1,0.5,"max z limit"); - uiBlockEndAlign(block); - offsetY += 20; - } - if ((data->type==CONSTRAINT_RB_GENERIC6DOF) || (data->type==CONSTRAINT_RB_CONETWIST)) { - /* Draw Pairs of LimitToggle+LimitValue */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMinX", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum x limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"min x limit"); - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 8, B_CONSTRAINT_TEST, "AngMaxX", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum x limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[3]), -extremeAngX, extremeAngX, 0.1,0.5,"max x limit"); - uiBlockEndAlign(block); - - offsetY += 20; - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMinY", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum y limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"min y limit"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 16, B_CONSTRAINT_TEST, "AngMaxY", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum y limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[4]), -extremeAngY, extremeAngY, 0.1,0.5,"max y limit"); - uiBlockEndAlign(block); - - offsetY += 20; - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMinZ", *xco, *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use minimum z limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+togButWidth, *yco-offsetY, (textButWidth-5), 18, &(data->minLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"min z limit"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 32, B_CONSTRAINT_TEST, "AngMaxZ", *xco+(width-(textButWidth-5)-togButWidth), *yco-offsetY, togButWidth, 18, &data->flag, 0, 24, 0, 0, "Use maximum z limit"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "", *xco+(width-textButWidth-5), *yco-offsetY, (textButWidth), 18, &(data->maxLimit[5]), -extremeAngZ, extremeAngZ, 0.1,0.5,"max z limit"); - uiBlockEndAlign(block); - } - } - break; - case CONSTRAINT_TYPE_CLAMPTO: - { - bClampToConstraint *data = con->data; - - height = 90; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object"); - - /* Draw XYZ toggles */ - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Main Axis:", *xco, *yco-64, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Auto", *xco+100, *yco-64, 50, 18, &data->flag, 12.0, CLAMPTO_AUTO, 0, 0, "Automatically determine main-axis of movement"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST, "X", *xco+150, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_X, 0, 0, "Main axis of movement is x-axis"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Y", *xco+182, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_Y, 0, 0, "Main axis of movement is y-axis"); - uiDefButI(block, ROW, B_CONSTRAINT_TEST, "Z", *xco+214, *yco-64, 32, 18, &data->flag, 12.0, CLAMPTO_Z, 0, 0, "Main axis of movement is z-axis"); - uiBlockEndAlign(block); - - /* Extra Options Controlling Behaviour */ - //uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Options:", *xco, *yco-88, 90, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButBitI(block, TOG, CLAMPTO_CYCLIC, B_CONSTRAINT_TEST, "Cyclic", *xco+((width/2)), *yco-88,60,19, &data->flag2, 0, 0, 0, 0, "Treat curve as cyclic curve (no clamping to curve bounding box)"); - //uiBlockEndAlign(block); - } - break; - case CONSTRAINT_TYPE_TRANSFORM: - { - bTransformConstraint *data = con->data; - float fmin, fmax, tmin, tmax; - - height = 178; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - - /* Draw target parameters */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Target:", *xco+65, *yco-24, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* Draw target parameters */ - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_CONSTRAINT_CHANGETARGET, "OB:", *xco+120, *yco-24, 135, 18, &data->tar, "Target Object to use as Parent"); - - if (is_armature_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "BO:", *xco+120, *yco-42,135,18, &data->subtarget, 0, 24, 0, 0, "Subtarget Bone to use as Parent"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)data->tar); - } - else if (is_geom_target(data->tar)) { - but= uiDefBut(block, TEX, B_CONSTRAINT_CHANGETARGET, "VG:", *xco+120, *yco-66,150,18, &data->subtarget, 0, 24, 0, 0, "Name of Vertex Group defining 'target' points"); - uiButSetCompleteFunc(but, autocomplete_vgroup, (void *)data->tar); - } - else { - strcpy(data->subtarget, ""); - } - uiBlockEndAlign(block); - - /* Extrapolate Ranges? */ - uiDefButBitC(block, TOG, 1, B_CONSTRAINT_TEST, "Extrapolate", *xco, *yco-42,80,19, &data->expo, 0, 0, 0, 0, "Extrapolate ranges"); - - /* Draw options for source motion */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Source:", *xco-10, *yco-62, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* draw Loc/Rot/Size toggles */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Loc", *xco-5, *yco-82, 45, 18, &data->from, 12.0, 0, 0, 0, "Use Location transform channels from Target"); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Rot", *xco+40, *yco-82, 45, 18, &data->from, 12.0, 1, 0, 0, "Use Rotation transform channels from Target"); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Scale", *xco+85, *yco-82, 45, 18, &data->from, 12.0, 2, 0, 0, "Use Scale transform channels from Target"); - uiBlockEndAlign(block); - - /* Draw Pairs of Axis: Min/Max Value*/ - if (data->from == 2) { - fmin= 0.0001; - fmax= 1000.0; - } - else if (data->from == 1) { - fmin= -360.0; - fmax= 360.0; - } - else { - fmin = -1000.0; - fmax= 1000.0; - } - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "X:", *xco-10, *yco-107, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-107, 55, 18, &data->from_min[0], fmin, fmax, 0, 0, "Bottom of range of x-axis source motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-107, 55, 18, &data->from_max[0], fmin, fmax, 0, 0, "Top of range of x-axis source motion for source->target mapping"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Y:", *xco-10, *yco-127, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-127, 55, 18, &data->from_min[1], fmin, fmax, 0, 0, "Bottom of range of y-axis source motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-127, 55, 18, &data->from_max[1], fmin, fmax, 0, 0, "Top of range of y-axis source motion for source->target mapping"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Z:", *xco-10, *yco-147, 30, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+20, *yco-147, 55, 18, &data->from_min[2], fmin, fmax, 0, 0, "Bottom of range of z-axis source motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+75, *yco-147, 55, 18, &data->from_max[2], fmin, fmax, 0, 0, "Top of range of z-axis source motion for source->target mapping"); - uiBlockEndAlign(block); - - - /* Draw options for target motion */ - uiDefBut(block, LABEL, B_CONSTRAINT_TEST, "Destination:", *xco+150, *yco-62, 150, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); - - /* draw Loc/Rot/Size toggles */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Loc", *xco+150, *yco-82, 45, 18, &data->to, 12.0, 0, 0, 0, "Use as Location transform"); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Rot", *xco+195, *yco-82, 45, 18, &data->to, 12.0, 1, 0, 0, "Use as Rotation transform"); - uiDefButS(block, ROW, B_CONSTRAINT_TEST, "Scale", *xco+245, *yco-82, 45, 18, &data->to, 12.0, 2, 0, 0, "Use as Scale transform"); - uiBlockEndAlign(block); - - /* Draw Pairs of Source-Axis: Min/Max Value*/ - if (data->to == 2) { - tmin= 0.0001; - tmax= 1000.0; - } - else if (data->to == 1) { - tmin= -360.0; - tmax= 360.0; - } - else { - tmin = -1000.0; - tmax= 1000.0; - } - - uiBlockBeginAlign(block); - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->X%x0|Y->X%x1|Z->X%x2", *xco+150, *yco-107, 40, 18, &data->map[0], 0, 24, 0, 0, "Specify which source axis the x-axis destination uses"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-107, 50, 18, &data->to_min[0], tmin, tmax, 0, 0, "Bottom of range of x-axis destination motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-107, 50, 18, &data->to_max[0], tmin, tmax, 0, 0, "Top of range of x-axis destination motion for source->target mapping"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->Y%x0|Y->Y%x1|Z->Y%x2", *xco+150, *yco-127, 40, 18, &data->map[1], 0, 24, 0, 0, "Specify which source axis the y-axis destination uses"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-127, 50, 18, &data->to_min[1], tmin, tmax, 0, 0, "Bottom of range of y-axis destination motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-127, 50, 18, &data->to_max[1], tmin, tmax, 0, 0, "Top of range of y-axis destination motion for source->target mapping"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButC(block, MENU, B_CONSTRAINT_TEST, "Axis Mapping%t|X->Z%x0|Y->Z%x1|Z->Z%x2", *xco+150, *yco-147, 40, 18, &data->map[2], 0, 24, 0, 0, "Specify which source axis the z-axis destination uses"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "min", *xco+175, *yco-147, 50, 18, &data->to_min[2], tmin, tmax, 0, 0, "Bottom of range of z-axis destination motion for source->target mapping"); - uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max", *xco+240, *yco-147, 50, 18, &data->to_max[2], tmin, tmax, 0, 0, "Top of range of z-axis destination motion for source->target mapping"); - uiBlockEndAlign(block); - - /* constraint space settings */ - draw_constraint_spaceselect(block, con, *xco, *yco-170, is_armature_owner(ob), is_armature_target(data->tar)); - } - break; - case CONSTRAINT_TYPE_NULL: - { - height = 17; - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); - } - break; - default: - height = 0; - break; - } - - (*yco)-=(24+height); - } - - if (ELEM(con->type, CONSTRAINT_TYPE_NULL, CONSTRAINT_TYPE_RIGIDBODYJOINT)==0) { - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_CONSTRAINT_INF, "Influence ", *xco, *yco, 197, 20, &(con->enforce), 0.0, 1.0, 0.0, 0.0, "Amount of influence this constraint will have on the final solution"); - but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Show", *xco+200, *yco, 45, 20, 0, 0.0, 1.0, 0.0, 0.0, "Show constraint's ipo in the Ipo window, adds a channel if not there"); - /* If this is on an object or bone, add ipo channel the constraint */ - uiButSetFunc (but, enable_constraint_ipo_func, ob, con); - but = uiDefBut(block, BUT, B_CONSTRAINT_TEST, "Key", *xco+245, *yco, 40, 20, 0, 0.0, 1.0, 0.0, 0.0, "Add an influence keyframe to the constraint"); - /* Add a keyframe to the influence IPO */ - uiButSetFunc (but, add_influence_key_to_constraint_func, ob, con); - uiBlockEndAlign(block); - (*yco)-=24; - } - else { - (*yco)-=3; - } -} - -static uiBlock *add_constraintmenu(void *arg_unused) -{ - Object *ob= OBACT; - uiBlock *block; - ListBase *conlist; - short yco= 0; - - conlist = get_active_constraints(ob); - - block= uiNewBlock(&curarea->uiblocks, "add_constraintmenu", UI_EMBOSSP, UI_HELV, curarea->win); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_CHILDOF, "Child Of", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_TRANSFORM, "Transformation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCLIKE, "Copy Location", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ROTLIKE, "Copy Rotation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_SIZELIKE, "Copy Scale", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCLIMIT, "Limit Location", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ROTLIMIT, "Limit Rotation", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_SIZELIMIT, "Limit Scale", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_TRACKTO, "Track To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_MINMAX, "Floor", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_LOCKTRACK, "Locked Track", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_FOLLOWPATH, "Follow Path", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_CLAMPTO, "Clamp To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_STRETCHTO, "Stretch To", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_RIGIDBODYJOINT, "Rigid Body Joint", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, "");//rcruiz - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (ob->flag & OB_POSEMODE) { - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_KINEMATIC, "IK Solver", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - } - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_ACTION, "Action", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_PYTHON, "Script", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, BUTM, B_CONSTRAINT_ADD_NULL, "Null", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - - - uiTextBoundsBlock(block, 50); - uiBlockSetDirection(block, UI_DOWN); - - return block; -} - -void do_constraintbuts(unsigned short event) -{ - Object *ob= OBACT; - bConstraint *con; - - switch(event) { - case B_CONSTRAINT_TEST: - break; // no handling - case B_CONSTRAINT_INF: - /* influence; do not execute actions for 1 dag_flush */ - if (ob->pose) - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - - case B_CONSTRAINT_CHANGETARGET: - if (ob->pose) ob->pose->flag |= POSE_RECALC; // checks & sorts pose channels - DAG_scene_sort(G.scene); - break; - - case B_CONSTRAINT_ADD_NULL: - { - con = add_new_constraint(CONSTRAINT_TYPE_NULL); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_PYTHON: - { - con = add_new_constraint(CONSTRAINT_TYPE_PYTHON); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_KINEMATIC: - { - con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_CHILDOF: - { - con= add_new_constraint(CONSTRAINT_TYPE_CHILDOF); - add_constraint_to_active(ob, con); - - /* if this constraint is being added to a posechannel, make sure - * the constraint gets evaluated in pose-space - */ - if (ob->flag & OB_POSEMODE) { - con->ownspace = CONSTRAINT_SPACE_POSE; - con->flag |= CONSTRAINT_SPACEONCE; - } - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_TRACKTO: - { - con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_MINMAX: - { - con = add_new_constraint(CONSTRAINT_TYPE_MINMAX); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_ROTLIKE: - { - con = add_new_constraint(CONSTRAINT_TYPE_ROTLIKE); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_LOCLIKE: - { - con = add_new_constraint(CONSTRAINT_TYPE_LOCLIKE); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_SIZELIKE: - { - con = add_new_constraint(CONSTRAINT_TYPE_SIZELIKE); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_ACTION: - { - con = add_new_constraint(CONSTRAINT_TYPE_ACTION); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_LOCKTRACK: - { - con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_FOLLOWPATH: - { - con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_STRETCHTO: - { - con = add_new_constraint(CONSTRAINT_TYPE_STRETCHTO); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_LOCLIMIT: - { - con = add_new_constraint(CONSTRAINT_TYPE_LOCLIMIT); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_ROTLIMIT: - { - con = add_new_constraint(CONSTRAINT_TYPE_ROTLIMIT); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_SIZELIMIT: - { - con = add_new_constraint(CONSTRAINT_TYPE_SIZELIMIT); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_RIGIDBODYJOINT: - { - bRigidBodyJointConstraint *data; - Base *base_iter; - - con = add_new_constraint(CONSTRAINT_TYPE_RIGIDBODYJOINT); - add_constraint_to_active(ob, con); - - /* set selected first object as target - moved from new_constraint_data */ - data = (bRigidBodyJointConstraint*)con->data; - base_iter = G.scene->base.first; - while ( base_iter && !data->tar ) { - if( ( ( base_iter->flag & SELECT ) && -// ( base_iter->lay & G.vd->lay ) ) && - ( base_iter != G.scene->basact ) )) - { - data->tar=base_iter->object; - break; - } - base_iter = base_iter->next; - } - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_CLAMPTO: - { - con = add_new_constraint(CONSTRAINT_TYPE_CLAMPTO); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - case B_CONSTRAINT_ADD_TRANSFORM: - { - con = add_new_constraint(CONSTRAINT_TYPE_TRANSFORM); - add_constraint_to_active(ob, con); - - BIF_undo_push("Add constraint"); - } - break; - - default: - break; - } - - object_test_constraints(ob); - - if(ob->pose) update_pose_constraint_flags(ob->pose); - - if(ob->type==OB_ARMATURE) DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB); - else DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); -} - -void softbody_bake(Object *ob) -{ - Base *base; - SoftBody *sb; - ScrArea *sa; - float frameleno= G.scene->r.framelen; - int cfrao= CFRA, sfra=100000, efra=0, didbreak =0; - - - G.scene->r.framelen= 1.0; // baking has to be in uncorrected time - sbSetInterruptCallBack(blender_test_break); // make softbody module ESC aware - G.afbreek=0; // init global break system - - if(ob) { - sb= ob->soft; - sfra= MIN2(sfra, sb->sfra); - efra= MAX2(efra, sb->efra); - sbObjectToSoftbody(ob); // put softbody in restposition, free bake - ob->softflag |= OB_SB_BAKEDO; - } - else { - for(base=G.scene->base.first; base; base= base->next) { - if(TESTBASELIB(base)) { - if(base->object->soft) { - sb= base->object->soft; - sfra= MIN2(sfra, sb->sfra); - efra= MAX2(efra, sb->efra); - sbObjectToSoftbody(base->object); // put softbody in restposition, free bake - base->object->softflag |= OB_SB_BAKEDO; - } - } - } - } - - CFRA= sfra; - update_for_newframe_muted(); // put everything on this frame - - curarea->win_swap= 0; // clean swapbuffers - - for(; CFRA <= efra; CFRA++) { - set_timecursor(CFRA); - - update_for_newframe_muted(); - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype == SPACE_VIEW3D) { - scrarea_do_windraw(sa); - } - } - screen_swapbuffers(); - //blender_test_break() has a granularity of 10 ms, who cares .. baking the unit cube is kinda boring - if (blender_test_break()){ - didbreak = 1; - break; - } - - } - if((didbreak)&&(G.qual!=LR_SHIFTKEY)) { - if(ob) - sbObjectToSoftbody(ob); // free bake - else { - for(base=G.scene->base.first; base; base= base->next) { - if(TESTBASELIB(base)) { - if(base->object->soft) { - sbObjectToSoftbody(base->object); // free bake - } - } - } - } - } - - /* restore */ - waitcursor(0); - sbSetInterruptCallBack(NULL); // softbody module won't ESC - G.afbreek=0; // reset global break system - - if(ob) - ob->softflag &= ~OB_SB_BAKEDO; - else { - for(base=G.scene->base.first; base; base= base->next) - if(TESTBASELIB(base)) - if(base->object->soft) - base->object->softflag &= ~OB_SB_BAKEDO; - } - - CFRA= cfrao; - G.scene->r.framelen= frameleno; - update_for_newframe_muted(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); -} - -// store processed path & file prefix for fluidsim bake directory -void fluidsimFilesel(char *selection) -{ - Object *ob = OBACT; - char srcDir[FILE_MAXDIR+FILE_MAXFILE], srcFile[FILE_MAXFILE]; - char prefix[FILE_MAXFILE]; - char *srch, *srchSub, *srchExt, *lastFound; - int isElbeemSurf = 0; - - // make prefix - strcpy(srcDir, selection); - BLI_splitdirstring(srcDir, srcFile); - strcpy(prefix, srcFile); - // check if this is a previously generated surface mesh file - srch = strstr(prefix, "fluidsurface_"); - // TODO search from back... - if(srch) { - srchSub = strstr(prefix,"_preview_"); - if(!srchSub) srchSub = strstr(prefix,"_final_"); - srchExt = strstr(prefix,".gz.bobj"); - if(!srchExt) srchExt = strstr(prefix,".bobj"); - if(srchSub && srchExt) { - *srch = '\0'; - isElbeemSurf = 1; - } - } - if(!isElbeemSurf) { - // try to remove suffix - lastFound = NULL; - srch = strchr(prefix, '.'); // search last . from extension - while(srch) { - lastFound = srch; - if(srch) { - srch++; - srch = strchr(srch, '.'); - } - } - if(lastFound) { - *lastFound = '\0'; - } - } - - if(ob->fluidsimSettings) { - strcpy(ob->fluidsimSettings->surfdataPath, srcDir); - //not necessary? strcat(ob->fluidsimSettings->surfdataPath, "/"); - strcat(ob->fluidsimSettings->surfdataPath, prefix); - - // redraw view & buttons... - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } -} - -void do_object_panels(unsigned short event) -{ - Object *ob; - Effect *eff; - - ob= OBACT; - if(ob==NULL) - return; - - switch(event) { - case B_TRACKBUTS: - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RECALCPATH: - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - case B_DUPLI_FRAME: - ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFACES|OB_DUPLIGROUP); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_DUPLI_VERTS: - ob->transflag &= ~(OB_DUPLIFRAMES|OB_DUPLIFACES|OB_DUPLIGROUP); - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_DUPLI_FACES: - ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFRAMES|OB_DUPLIGROUP); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_DUPLI_GROUP: - ob->transflag &= ~(OB_DUPLIVERTS|OB_DUPLIFRAMES|OB_DUPLIFACES); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - - case B_PRINTSPEED: - { - float vec[3]; - CFRA++; - do_ob_ipo(ob); - where_is_object(ob); - VECCOPY(vec, ob->obmat[3]); - CFRA--; - do_ob_ipo(ob); - where_is_object(ob); - VecSubf(vec, vec, ob->obmat[3]); - prspeed= Normalize(vec); - scrarea_queue_winredraw(curarea); - } - break; - case B_PRINTLEN: - if(ob->type==OB_CURVE) { - Curve *cu=ob->data; - - if(cu->path) prlen= cu->path->totdist; else prlen= -1.0; - scrarea_queue_winredraw(curarea); - } - break; - case B_RELKEY: - allspace(REMAKEIPO, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIPO, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - break; - case B_CURVECHECK: - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - break; - - case B_SOFTBODY_CHANGE: - ob= OBACT; - if(ob) { - ParticleSystem *psys = PE_get_current(ob); - if(psys) - psys->softflag |= OB_SB_REDO; - else - ob->softflag |= OB_SB_REDO; - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SOFTBODY_DEL_VG: - if(ob->soft) { - ob->soft->vertgroup= 0; - ob->softflag |= OB_SB_REDO; - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_SOFTBODY_BAKE: - if(ob->soft) softbody_bake(ob); - break; - case B_SOFTBODY_BAKE_FREE: - if(ob->soft) sbObjectToSoftbody(ob); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_FLUIDSIM_BAKE: - /* write config files (currently no simulation) */ - fluidsimBake(ob); - break; - case B_FLUIDSIM_MAKEPART: - { - PartEff *paf= NULL; - /* prepare fluidsim particle display */ - // simplified delete effect, create new - recalc some particles... - if(ob==NULL || ob->type!=OB_MESH) break; - ob->fluidsimSettings->type = 0; - // reset type, and init particle system once normally - paf= give_parteff(ob); - if( (BLI_countlist(&ob->effect)totpart = 1000; paf->sta = paf->end = 1.0; // generate some particles... - build_particle_system(ob); - ob->fluidsimSettings->type = OB_FLUIDSIM_PARTICLE; - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_FLUIDSIM_SELDIR: - { - ScrArea *sa = closest_bigger_area(); - /* choose dir for surface files */ - areawinset(sa->win); - activate_fileselect(FILE_SPECIAL, "Select Directory", ob->fluidsimSettings->surfdataPath, fluidsimFilesel); - } - break; - case B_FLUIDSIM_FORCEREDRAW: - /* force redraw */ - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - break; - case B_GROUP_RELINK: - group_relink_nla_objects(ob); - allqueue(REDRAWVIEW3D, 0); - break; - case B_BAKEABLE_CHANGE: - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_OBJECT_IPOFLAG: - if(ob->ipo) ob->ipo->showkey= (ob->ipoflag & OB_DRAWKEY)?1:0; - allqueue(REDRAWVIEW3D, 0); - break; - - default: - if(event>=B_SELEFFECT && eventeffect.first; - while(eff) { - if(event==a) eff->flag |= SELECT; - else eff->flag &= ~SELECT; - - a++; - eff= eff->next; - } - allqueue(REDRAWBUTSOBJECT, 0); - } - } - -} - -static void do_add_groupmenu(void *arg, int event) -{ - Object *ob= OBACT; - - if(ob) { - - if(event== -1) { - Group *group= add_group( "Group" ); - add_to_group(group, ob); - } - else - add_to_group(BLI_findlink(&G.main->group, event), ob); - - ob->flag |= OB_FROMGROUP; - BASACT->flag |= OB_FROMGROUP; - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - } -} - -static uiBlock *add_groupmenu(void *arg_unused) -{ - uiBlock *block; - Group *group; - short yco= 0; - char str[32]; - - block= uiNewBlock(&curarea->uiblocks, "add_constraintmenu", UI_EMBOSSP, UI_HELV, curarea->win); - uiBlockSetButmFunc(block, do_add_groupmenu, NULL); - - uiDefBut(block, BUTM, B_NOP, "ADD NEW", 0, 20, 160, 19, NULL, 0.0, 0.0, 1, -1, ""); - for(group= G.main->group.first; group; group= group->id.next, yco++) { - if(group->id.lib) strcpy(str, "L "); - else strcpy(str, " "); - strcat(str, group->id.name+2); - uiDefBut(block, BUTM, B_NOP, str, 0, -20*yco, 160, 19, NULL, 0.0, 0.0, 1, yco, ""); - } - - uiTextBoundsBlock(block, 50); - uiBlockSetDirection(block, UI_DOWN); - - return block; -} - -static void group_ob_rem(void *gr_v, void *ob_v) -{ - Object *ob= OBACT; - - rem_from_group(gr_v, ob); - if(find_group(ob)==NULL) { - ob->flag &= ~OB_FROMGROUP; - BASACT->flag &= ~OB_FROMGROUP; - } - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - -} - -static void group_local(void *gr_v, void *unused) -{ - Group *group= gr_v; - - group->id.lib= NULL; - - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - -} - -static void object_panel_object(Object *ob) -{ - uiBlock *block; - uiBut *but; - Group *group; - int a, xco, yco=0; - short dx= 33, dy= 30; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_object", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Object and Links", "Object", 0, 0, 318, 204)==0) return; - - uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - /* object name */ - uiBlockSetCol(block, TH_BUT_SETTING2); - xco= std_libbuttons(block, 10, 180, 0, NULL, 0, ID_OB, 0, &ob->id, NULL, &(G.buts->menunr), B_OBALONE, B_OBLOCAL, 0, 0, B_KEEPDATA); - uiBlockSetCol(block, TH_AUTO); - - /* parent */ - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", xco+5, 180, 305-xco, 20, &ob->parent, "Parent Object"); - - /* TODO, check for ob->id.lib */ - but = uiDefButS(block, NUM, B_NOP, "PassIndex:", xco+5, 150, 305-xco, 20, &ob->index, 0.0, 1000.0, 0, 0, "Index # for the IndexOB render pass."); - - uiDefBlockBut(block, add_groupmenu, NULL, "Add to Group", 10,150,150,20, "Add Object to a new Group"); - - /* all groups */ - for(group= G.main->group.first; group; group= group->id.next) { - if(object_in_group(ob, group)) { - xco= 160; - - uiBlockBeginAlign(block); - but = uiDefBut(block, TEX, B_IDNAME, "GR:", 10, 120-yco, 150, 20, group->id.name+2, 0.0, 21.0, 0, 0, "Displays Group name. Click to change."); - uiButSetFunc(but, test_idbutton_cb, group->id.name, NULL); - - if(group->id.lib) { - but= uiDefIconBut(block, BUT, B_NOP, ICON_PARLIB, 160, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Make Group local"); - uiButSetFunc(but, group_local, group, NULL); - xco= 180; - } - but = uiDefIconBut(block, BUT, B_NOP, VICON_X, xco, 120-yco, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Remove Group membership"); - uiButSetFunc(but, group_ob_rem, group, ob); - - yco+= 20; - xco= 10; - - /* layers */ - uiBlockBeginAlign(block); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<layer), 0, 0, 0, 0, ""); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<<(a+10), REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 105-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, ""); - - xco+= 7; - uiBlockBeginAlign(block); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<layer), 0, 0, 0, 0, ""); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<<(a+10), REDRAWVIEW3D, "", (short)(xco+a*(dx/2)), 105-yco, (short)(dx/2), (short)(dy/2), (int *)&(group->layer), 0, 0, 0, 0, ""); - - uiBlockEndAlign(block); - - yco+= 40; - } - } - - if(120-yco < -10) - uiNewPanelHeight(block, 204 - (120-yco)); -} - -static void object_panel_anim(Object *ob) -{ - uiBlock *block; - char str[32]; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Anim settings", "Object", 320, 0, 318, 204)==0) return; - - uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_TRACKBUTS,"TrackX", 24,180,59,19, &ob->trackflag, 12.0, 0.0, 0, 0, "Specify the axis that points to another object"); - uiDefButS(block, ROW,B_TRACKBUTS,"Y", 85,180,19,19, &ob->trackflag, 12.0, 1.0, 0, 0, "Specify the axis that points to another object"); - uiDefButS(block, ROW,B_TRACKBUTS,"Z", 104,180,19,19, &ob->trackflag, 12.0, 2.0, 0, 0, "Specify the axis that points to another object"); - uiDefButS(block, ROW,B_TRACKBUTS,"-X", 124,180,24,19, &ob->trackflag, 12.0, 3.0, 0, 0, "Specify the axis that points to another object"); - uiDefButS(block, ROW,B_TRACKBUTS,"-Y", 150,180,24,19, &ob->trackflag, 12.0, 4.0, 0, 0, "Specify the axis that points to another object"); - uiDefButS(block, ROW,B_TRACKBUTS,"-Z", 178,180,24,19, &ob->trackflag, 12.0, 5.0, 0, 0, "Specify the axis that points to another object"); - uiBlockBeginAlign(block); - uiDefButS(block, ROW,REDRAWVIEW3D,"UpX", 226,180,45,19, &ob->upflag, 13.0, 0.0, 0, 0, "Specify the axis that points up"); - uiDefButS(block, ROW,REDRAWVIEW3D,"Y", 274,180,20,19, &ob->upflag, 13.0, 1.0, 0, 0, "Specify the axis that points up"); - uiDefButS(block, ROW,REDRAWVIEW3D,"Z", 298,180,19,19, &ob->upflag, 13.0, 2.0, 0, 0, "Specify the axis that points up"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_DRAWKEY, B_OBJECT_IPOFLAG, "Draw Key", 24,155,71,19, &ob->ipoflag, 0, 0, 0, 0, "Draw object as key position"); - uiDefButBitS(block, TOG, OB_DRAWKEYSEL, REDRAWVIEW3D, "Draw Key Sel", 97,155,81,19, &ob->ipoflag, 0, 0, 0, 0, "Limit the drawing of object keys"); - uiDefButBitS(block, TOG, OB_POWERTRACK, REDRAWVIEW3D, "Powertrack", 180,155,78,19, &ob->transflag, 0, 0, 0, 0, "Switch objects rotation off"); - uiDefButBitS(block, TOG, PARSLOW, 0, "SlowPar", 260,155,56,19, &ob->partype, 0, 0, 0, 0, "Create a delay in the parent relationship"); - uiBlockBeginAlign(block); - - uiDefButBitS(block, TOG, OB_DUPLIFRAMES, B_DUPLI_FRAME, "DupliFrames", 24,130,95,20, &ob->transflag, 0, 0, 0, 0, "Make copy of object for every frame"); - uiDefButBitS(block, TOG, OB_DUPLIVERTS, B_DUPLI_VERTS, "DupliVerts", 119,130,95,20, &ob->transflag, 0, 0, 0, 0, "Duplicate child objects on all vertices"); - uiDefButBitS(block, TOG, OB_DUPLIFACES, B_DUPLI_FACES, "DupliFaces", 214,130,102,20, &ob->transflag, 0, 0, 0, 0, "Duplicate child objects on all faces"); - uiDefButBitS(block, TOG, OB_DUPLIGROUP, B_DUPLI_GROUP, "DupliGroup", 24,110,150,20, &ob->transflag, 0, 0, 0, 0, "Enable group instancing"); - if(ob->transflag & OB_DUPLIFRAMES) { - uiDefButBitS(block, TOG, OB_DUPLINOSPEED, REDRAWVIEW3D, "No Speed", 174,110,142,20, &ob->transflag, 0, 0, 0, 0, "Set dupliframes to still, regardless of frame"); - } else if(ob->transflag & OB_DUPLIVERTS) { - uiDefButBitS(block, TOG, OB_DUPLIROT, REDRAWVIEW3D, "Rot", 174,110,142,20, &ob->transflag, 0, 0, 0, 0, "Rotate dupli according to vertex normal"); - } else if(ob->transflag & OB_DUPLIFACES) { - uiDefButBitS(block, TOG, OB_DUPLIFACES_SCALE, REDRAWVIEW3D, "Scale", 174,110,80,20, &ob->transflag, 0, 0, 0, 0, "Scale dupli based on face size"); - uiDefButF(block, NUM, REDRAWVIEW3D, "", 254,110,62,20, &ob->dupfacesca, 0.001, 10000.0, 0, 0, "Scale the DupliFace objects"); - } else { - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_GROUP_RELINK, "GR:", 174,110,142,20, &ob->dup_group, "Instance an existing group"); - } - - uiBlockBeginAlign(block); - /* DupSta and DupEnd are both shorts, so the maxframe is greater then their range - just limit the buttons to the max short */ - uiDefButI(block, NUM, REDRAWVIEW3D, "DupSta:", 24,85,141,19, &ob->dupsta, 1.0, 32767, 0, 0, "Specify startframe for Dupliframes"); - uiDefButI(block, NUM, REDRAWVIEW3D, "DupOn:", 170,85,146,19, &ob->dupon, 1.0, 1500.0, 0, 0, "Specify the number of frames to use between DupOff frames"); - uiDefButI(block, NUM, REDRAWVIEW3D, "DupEnd", 24,65,140,19, &ob->dupend, 1.0, 32767, 0, 0, "Specify endframe for Dupliframes"); - uiDefButI(block, NUM, REDRAWVIEW3D, "DupOff", 171,65,145,19, &ob->dupoff, 0.0, 1500.0, 0, 0, "Specify recurring frames to exclude from the Dupliframes"); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_OFFS_OB, REDRAWALL, "Offs Ob", 24,35,56,20, &ob->ipoflag, 0, 0, 0, 0, "Not functional at the moment!"); - uiDefButBitS(block, TOG, OB_OFFS_PARENT, REDRAWALL, "Offs Par", 82,35,56,20 , &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on the parent"); - uiDefButBitS(block, TOG, OB_OFFS_PARTICLE, REDRAWALL, "Offs Particle", 140,35,103,20, &ob->ipoflag, 0, 0, 0, 0, "Let the timeoffset work on the particle effect"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWALL, "TimeOffset:", 24,10,115,20, &ob->sf, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Specify an offset in frames"); - uiDefBut(block, BUT, B_AUTOTIMEOFS, "Automatic Time", 139,10,104,20, 0, 0, 0, 0, 0, "Generate automatic timeoffset values for all selected frames"); - uiDefBut(block, BUT, B_PRINTSPEED, "PrSpeed", 248,10,67,20, 0, 0, 0, 0, 0, "Print objectspeed"); - uiBlockEndAlign(block); - - sprintf(str, "%.4f", prspeed); - uiDefBut(block, LABEL, 0, str, 247,35,63,31, NULL, 1.0, 0, 0, 0, ""); - -} - -static void object_panel_draw(Object *ob) -{ - uiBlock *block; - int xco, a, dx, dy; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_draw", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Draw", "Object", 640, 0, 318, 204)==0) return; - - uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - /* LAYERS */ - xco= 120; - dx= 35; - dy= 30; - - uiDefBut(block, LABEL, 0, "Layers", 10,170,100,20, NULL, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<lay), 0, 0, 0, 0, ""); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<<(a+10), B_OBLAY+a+10, "", (short)(xco+a*(dx/2)), 165, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, ""); - - xco+= 7; - uiBlockBeginAlign(block); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<lay), 0, 0, 0, 0, ""); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<<(a+10), B_OBLAY+a+10, "", (short)(xco+a*(dx/2)), 165, (short)(dx/2), (short)(dy/2), (int *)&(BASACT->lay), 0, 0, 0, 0, ""); - - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Drawtype", 10,120,100,20, NULL, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButC(block, ROW, REDRAWVIEW3D, "Shaded", 10,100,100, 20, &ob->dt, 0, OB_SHADED, 0, 0, "Draw active object shaded or textured"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Solid", 10,80,100, 20, &ob->dt, 0, OB_SOLID, 0, 0, "Draw active object in solid"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Wire", 10,60, 100, 20, &ob->dt, 0, OB_WIRE, 0, 0, "Draw active object in wireframe"); - uiDefButC(block, ROW, REDRAWVIEW3D, "Bounds", 10,40, 100, 20, &ob->dt, 0, OB_BOUNDBOX, 0, 0, "Only draw object with bounding box"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Draw Extra", 120,120,90,20, NULL, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitC(block, TOG, OB_BOUNDBOX, REDRAWVIEW3D, "Bounds", 120, 100, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's bounds"); - uiDefButBitC(block, TOG, OB_DRAWNAME, REDRAWVIEW3D, "Name", 210, 100, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's name"); - - uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Polyheder%x4", - 120, 80, 90, 20, &ob->boundtype, 0, 0, 0, 0, "Selects the boundary display type"); - uiDefButBitC(block, TOG, OB_AXIS, REDRAWVIEW3D, "Axis", 210, 80, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's center and axis"); - - uiDefButBitC(block, TOG, OB_TEXSPACE, REDRAWVIEW3D, "TexSpace", 120, 60, 90, 20, &ob->dtx, 0, 0, 0, 0, "Displays the active object's texture space"); - uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", 210, 60, 90, 20, &ob->dtx, 0, 0, 0, 0, "Adds the active object's wireframe over solid drawing"); - - uiDefButBitC(block, TOG, OB_DRAWTRANSP, REDRAWVIEW3D, "Transp", 120, 40, 90, 20, &ob->dtx, 0, 0, 0, 0, "Enables transparent materials for the active object (Mesh only)"); - uiDefButBitC(block, TOG, OB_DRAWXRAY, REDRAWVIEW3D, "X-ray", 210, 40, 90, 20, &ob->dtx, 0, 0, 0, 0, "Makes the active object draw in front of others"); -} - -void object_panel_constraint(char *context) -{ - uiBlock *block; - Object *ob= OBACT; - ListBase *conlist; - bConstraint *curcon; - short xco, yco; - char str[64]; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_constraint", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Constraints", context, 960, 0, 318, 204)==0) return; - - uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - /* this is a variable height panel, newpanel doesnt force new size on existing panels */ - /* so first we make it default height */ - uiNewPanelHeight(block, 204); - - /* do not allow this panel to draw in editmode - why?*/ - if(G.obedit==OBACT) return; // ?? - - conlist = get_active_constraints(OBACT); - - if (conlist) { - uiDefBlockBut(block, add_constraintmenu, NULL, "Add Constraint", 0, 190, 130, 20, "Add a new constraint"); - - /* print active object or bone */ - str[0]= 0; - if (ob->flag & OB_POSEMODE) { - bPoseChannel *pchan= get_active_posechannel(ob); - if(pchan) sprintf(str, "To Bone: %s", pchan->name); - } - else { - sprintf(str, "To Object: %s", ob->id.name+2); - } - uiDefBut(block, LABEL, 1, str, 150, 190, 150, 20, NULL, 0.0, 0.0, 0, 0, "Displays Active Object or Bone name"); - - /* Go through the list of constraints and draw them */ - xco = 10; - yco = 160; - - for (curcon = conlist->first; curcon; curcon=curcon->next) { - /* hrms, the temporal constraint should not draw! */ - if(curcon->type==CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data= curcon->data; - if(data->flag & CONSTRAINT_IK_TEMP) - continue; - } - /* Draw default constraint header */ - draw_constraint(block, conlist, curcon, &xco, &yco); - } - - if(yco < 0) uiNewPanelHeight(block, 204-yco); - - } -} - -void do_effects_panels(unsigned short event) -{ - Object *ob; - Base *base; - Effect *eff, *effn; - PartEff *paf; - ModifierData *md; - ParticleSystemModifierData *psmd; - ParticleSystem *psys; - ParticleSettings *part; - ID *id,*idtest; - int nr; - - ob= OBACT; - - psys=psys_get_current(ob); - - switch(event) { - - case B_AUTOTIMEOFS: - auto_timeoffs(); - break; - case B_FRAMEMAP: - G.scene->r.framelen= G.scene->r.framapto; - G.scene->r.framelen/= G.scene->r.images; - allqueue(REDRAWALL, 0); - break; - case B_NEWEFFECT: - if(ob) { - if(ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) { - // NT particles and fluid meshes currently dont work together -> switch off beforehand - if(ob->fluidsimSettings->type == OB_FLUIDSIM_DOMAIN) { - pupmenu("Fluidsim Particle Error%t|Please disable the fluidsim domain before activating particles.%x0"); - break; - //ob->fluidsimFlag = 0; ob->fluidsimSettings->type = 0; allqueue(REDRAWVIEW3D, 0); - } - } - if (BLI_countlist(&ob->effect)==MAX_EFFECT) - error("Unable to add: effect limit reached"); - else - copy_act_effect(ob); - } - DAG_scene_sort(G.scene); - BIF_undo_push("New effect"); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_DELEFFECT: - if(ob==NULL || ob->type!=OB_MESH) break; - eff= ob->effect.first; - while(eff) { - effn= eff->next; - if(eff->flag & SELECT) { - BLI_remlink(&ob->effect, eff); - free_effect(eff); - break; - } - eff= effn; - } - BIF_undo_push("Delete effect"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_NEXTEFFECT: - if(ob==0 || ob->type!=OB_MESH) break; - eff= ob->effect.first; - while(eff) { - if(eff->flag & SELECT) { - if(eff->next) { - eff->flag &= ~SELECT; - eff->next->flag |= SELECT; - } - break; - } - eff= eff->next; - } - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_PREVEFFECT: - if(ob==0 || ob->type!=OB_MESH) break; - eff= ob->effect.first; - while(eff) { - if(eff->flag & SELECT) { - if(eff->prev) { - eff->flag &= ~SELECT; - eff->prev->flag |= SELECT; - } - break; - } - eff= eff->next; - } - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_EFFECT_DEP: - DAG_scene_sort(G.scene); - /* no break, pass on */ - case B_CALCEFFECT: - if(ob==NULL || ob->type!=OB_MESH) break; - eff= ob->effect.first; - while(eff) { - if(eff->flag & SELECT) { - if(eff->type==EFF_PARTICLE) build_particle_system(ob); - } - eff= eff->next; - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_PAF_SET_VG: - - paf= give_parteff(ob); - if(paf) { - bDeformGroup *dg= get_named_vertexgroup(ob, paf->vgroupname); - if(dg) - paf->vertgroup= get_defgroup_num(ob, dg)+1; - else - paf->vertgroup= 0; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_PAF_SET_VG1: - - paf= give_parteff(ob); - if(paf) { - bDeformGroup *dg= get_named_vertexgroup(ob, paf->vgroupname_v); - if(dg) - paf->vertgroup_v= get_defgroup_num(ob, dg)+1; - else - paf->vertgroup_v= 0; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_PARTBROWSE: - if(G.buts->menunr== -2) { - activate_databrowse((ID *)G.buts->lockpoin, ID_PA, 0, B_PARTBROWSE, &G.buts->menunr, do_effects_panels); - return; - } - - if(G.buts->menunr < 0) return; - - if(G.buts->pin) { - - } - else { - psys= psys_get_current(ob); - if(psys) - part=psys->part; - else - part=NULL; - - nr= 1; - - id= (ID *)part; - - idtest= G.main->particle.first; - while(idtest) { - if(nr==G.buts->menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new particle system */ - if(id){ - idtest= (ID *)psys_copy_settings((ParticleSettings *)id); - } - else { - idtest= (ID *)psys_new_settings("PSys", G.main); - } - idtest->us--; - } - if(idtest!=id) { - short nr=0; - if(id==0){ /* no psys previously -> no modifier -> need to create that also */ - psys = MEM_callocN(sizeof(ParticleSystem), "particle_system"); - BLI_addtail(&ob->particlesystem,psys); - - md= modifier_new(eModifierType_ParticleSystem); - sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem)); - psmd= (ParticleSystemModifierData*) md; - psmd->psys=psys; - BLI_addtail(&ob->modifiers, md); - } - - idtest->us++; - psys->part=(ParticleSettings*)idtest; - psys->totpart=0; - psys->flag=PSYS_ENABLED|PSYS_CURRENT; - psys->cfra=bsystem_time(ob,G.scene->r.cfra+1,0.0); - - /* check need for dupliobjects */ - nr=0; - for(psys=ob->particlesystem.first; psys; psys=psys->next){ - if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR)) - nr++; - } - if(nr) - ob->transflag |= OB_DUPLIPARTS; - else - ob->transflag &= ~OB_DUPLIPARTS; - - BIF_undo_push("Browse Particle System"); - - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - - } - break; - case B_PARTDELETE: - if(ob && ob->particlesystem.first){ - psys= psys_get_current(ob); - if(psys) { - /* clear modifier */ - psmd= psys_get_modifier(ob,psys); - BLI_remlink(&ob->modifiers, psmd); - modifier_free((ModifierData *)psmd); - - /* clear particle system */ - BLI_remlink(&ob->particlesystem,psys); - psys_free(ob,psys); - - BIF_undo_push("Delete particle system"); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - } - break; - case B_PARTALONE: /* TODO: not too sure of how this works so someone check please, jahka */ - if(ob && (psys=psys_get_current(ob))){ - if(psys->part) { - if(psys->part->id.us>1){ - if(okee("Make local")){ - part=psys_copy_settings(psys->part); - part->id.us=1; - psys->part->id.us--; - psys->part=part; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Make single user or local"); - } - } - } - } - break; - case B_PART_ALLOC: - case B_PART_ALLOC_CHILD: - if(psys){ - psys_flush_settings(psys->part,PSYS_ALLOC,event==B_PART_ALLOC); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - break; - case B_PART_DISTR: - case B_PART_DISTR_CHILD: - if(psys){ - psys_flush_settings(psys->part,PSYS_DISTR,event==B_PART_DISTR); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - break; - case B_PART_INIT: - case B_PART_INIT_CHILD: - if(psys){ - psys_flush_settings(psys->part,PSYS_INIT,event==B_PART_INIT); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - break; - case B_PART_ENABLE: - if(psys) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_PART_RECALC: - case B_PART_RECALC_CHILD: - if(psys){ - psys_flush_settings(psys->part,0,event==B_PART_RECALC); - allqueue(REDRAWOOPS, 0); - } - /* no break! */ - case B_PART_REDRAW: - nr=0; - for(psys=ob->particlesystem.first; psys; psys=psys->next){ - if(ELEM(psys->part->draw_as,PART_DRAW_OB,PART_DRAW_GR)) - nr++; - } - if(nr) - ob->transflag |= OB_DUPLIPARTS; - else - ob->transflag &= ~OB_DUPLIPARTS; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_PARTTYPE: - if((psys=psys_get_current(ob))){ - DAG_scene_sort(G.scene); - - psys_flush_settings(psys->part,PSYS_TYPE,1); - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_PARTACT: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWIPO, 0); - break; - case B_PARTTARGET: - if((psys=psys_get_current(ob))){ - if(psys->keyed_ob==ob || psys->target_ob==ob){ - if(psys->keyed_ob==ob) - psys->keyed_ob=NULL; - else - psys->target_ob=NULL; - } - else{ - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - } - break; - case B_PART_REKEY: - PE_rekey(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_PART_EDITABLE: - if((psys = psys_get_current(ob))) { - if(psys->flag & PSYS_EDITED){ - if(okee("Lose changes done in particle mode?")){ - if(psys->edit) - PE_free_particle_edit(psys); - - psys->flag &= ~PSYS_EDITED; - psys->recalc |= PSYS_RECALC_HAIR; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - else { - psys->flag |= PSYS_EDITED; - if(G.f & G_PARTICLEEDIT) - PE_create_particle_edit(ob, psys); - } - } - case B_FIELD_DEP: - /* do this before scene sort, that one checks for CU_PATH */ - if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) { - Curve *cu= ob->data; - - cu->flag |= (CU_PATH|CU_3D); - do_curvebuts(B_CU3D); /* all curves too */ - } - DAG_scene_sort(G.scene); - - if(ob->type==OB_CURVE && ob->pd->forcefield==PFIELD_GUIDE) - DAG_object_flush_update(G.scene, ob, OB_RECALC); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - break; - case B_FIELD_CHANGE: - if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex){ - ob->pd->tex->id.us--; - ob->pd->tex=0; - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RECALCAL: - if (G.vd==NULL) - break; - - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - ob= base->object; - eff= ob->effect.first; - while(eff) { - if(eff->flag & SELECT) { - if(eff->type==EFF_PARTICLE) build_particle_system(ob); - } - eff= eff->next; - } - } - base= base->next; - } - allqueue(REDRAWVIEW3D, 0); - break; - default: - if(event>=B_SELEFFECT && eventeffect.first; - while(eff) { - if(event==a) eff->flag |= SELECT; - else eff->flag &= ~SELECT; - - a++; - eff= eff->next; - } - allqueue(REDRAWBUTSOBJECT, 0); - } - } - } - -} - -/* copy from buttons_editing.c */ -static void field_testTexture(char *name, ID **idpp) -{ - ID *id; - - for(id = G.main->tex.first; id; id = id->next) { - if(strcmp(name, id->name + 2) == 0) { - *idpp = id; - /* texture gets user, objects not: delete object = clear modifier */ - id_us_plus(id); - return; - } - } - *idpp = 0; -} -/* Panels for particle interaction settings */ -static void object_panel_deflection(Object *ob) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_deflection", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Deflection", "Physics", 0, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - /* should become button, option? */ - if(ob->pd==NULL) { - ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); - /* and if needed, init here */ - ob->pd->pdef_sbdamp = 0.1f; - ob->pd->pdef_sbift = 0.2f; - ob->pd->pdef_sboft = 0.02f; - } - - /* only meshes collide now */ - if(ob->pd && ob->type==OB_MESH) { - PartDeflect *pd= ob->pd; - - uiDefButBitS(block, TOG, 1, B_REDR, "Deflection",160,160,150,20, &pd->deflect, 0, 0, 0, 0, "Deflects particles based on collision"); - if(pd->deflect) { - uiDefBut(block, LABEL, 0, "Particles", 160,140,75,20, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitS(block, TOG, PDEFLE_KILL_PART, B_DIFF, "Kill",235,140,75,20, &pd->flag, 0, 0, 0, 0, "Kill collided particles"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_DIFF, "Damping: ", 160,120,75,20, &pd->pdef_damp, 0.0, 1.0, 10, 0, "Amount of damping during particle collision"); - uiDefButF(block, NUM, B_DIFF, "Rnd Damping: ", 235,120,75,20, &pd->pdef_rdamp, 0.0, 1.0, 10, 0, "Random variation of damping"); - uiDefButF(block, NUM, B_DIFF, "Friction: ", 160,100,75,20, &pd->pdef_frict, 0.0, 1.0, 10, 0, "Amount of friction during particle collision"); - uiDefButF(block, NUM, B_DIFF, "Rnd Friction: ", 235,100,75,20, &pd->pdef_rfrict, 0.0, 1.0, 10, 0, "Random variation of friction"); - uiDefButF(block, NUM, B_DIFF, "Permeability: ", 160,80,150,20, &pd->pdef_perm, 0.0, 1.0, 10, 0, "Chance that the particle will pass through the mesh"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Soft Body", 160,60,150,20, NULL, 0.0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 160,40,150,20, &pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 160,20,150,20, &pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160, 0,150,20, &pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); - } - } -} -static void object_panel_fields(Object *ob) -{ - uiBlock *block; - uiBut *but; - int particles=0; - static short actpsys=-1; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_fields", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Deflection", "Physics"); - if(uiNewPanel(curarea, block, "Fields", "Physics", 0, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - /* should become button, option? */ - if(ob->pd==NULL) { - ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); - /* and if needed, init here */ - ob->pd->pdef_sbdamp = 0.1f; - ob->pd->pdef_sbift = 0.2f; - ob->pd->pdef_sboft = 0.02f; - } - - if(ob->pd) { - PartDeflect *pd= ob->pd; - char *menustr= MEM_mallocN(256, "temp string"); - char *tipstr="Choose field type"; - - if(ob->particlesystem.first) { - ParticleSystem *psys; - char *menustr2= psys_menu_string(ob,1); - - psys= psys_get_current(ob); - if(psys && actpsys >= 0) { - actpsys= psys_get_current_num(ob)+1; - - if(psys->part->pd==NULL) - psys->part->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); - - pd= psys->part->pd; - particles=1; - } - else - actpsys= -1; /* -1 = object */ - - but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr2, 10,180,70,20, &actpsys, 14.0, 0.0, 0, 0, "Browse systems"); - uiButSetFunc(but, PE_change_act, ob, &actpsys); - - MEM_freeN(menustr2); - } - - /* setup menu button */ - if(particles){ - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC); - - if(pd->forcefield==PFIELD_FORCE) tipstr= "Particle attracts or repels particles"; - else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of particle Z axis"; - else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the particle"; - } - else{ - if(ob->type==OB_CURVE) - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE); - else - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE); - - if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles"; - else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis"; - else if(pd->forcefield==PFIELD_VORTEX) tipstr= "Particles swirl around Z-axis of the Object"; - else if(pd->forcefield==PFIELD_GUIDE) tipstr= "Use a Curve Path to guide particles"; - } - - if(ob->particlesystem.first) - uiDefButS(block, MENU, B_FIELD_DEP, menustr, 80,180,70,20, &pd->forcefield, 0.0, 0.0, 0, 0, tipstr); - else - uiDefButS(block, MENU, B_FIELD_DEP, menustr, 10,180,140,20, &pd->forcefield, 0.0, 0.0, 0, 0, tipstr); - - MEM_freeN(menustr); - - if(pd->forcefield) { - uiBlockBeginAlign(block); - if(pd->forcefield == PFIELD_GUIDE) { - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 10,140,140,20, &pd->f_strength, 0.0, 1000.0, 10, 0, "The distance from which particles are affected fully."); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 10,120,140,20, &pd->f_power, 0.0, 10.0, 10, 0, "Falloff factor, between mindist and maxdist"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Free: ", 10,100,140,20, &pd->free_end, 0.0, 0.99, 10, 0, "Guide-free time from particle life's end"); - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 10,80,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 50,80,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work"); - } - else { - uiDefButF(block, NUM, B_FIELD_CHANGE, "Strength: ", 10,140,140,20, &pd->f_strength, -1000, 1000, 10, 0, "Strength of force field"); - - if(pd->forcefield == PFIELD_TEXTURE){ - uiDefIDPoinBut(block, field_testTexture, ID_TE, B_FIELD_CHANGE, "Texture: ", 10, 120, 140, 20, &pd->tex, "Texture to use as force"); - uiDefButBitS(block, TOG, PFIELD_TEX_OBJECT, B_FIELD_CHANGE, "Use Object Co", 10,100,140,20, &pd->flag, 0.0, 0, 0, 0, "Use object/global coordinates for texture"); - uiDefButBitS(block, TOG, PFIELD_TEX_2D, B_FIELD_CHANGE, "2D", 10,80,140,20, &pd->flag, 0.0, 0, 0, 0, "Apply force only in 2d"); - } - else if(pd->forcefield == PFIELD_HARMONIC) - uiDefButF(block, NUM, B_FIELD_CHANGE, "Damp: ", 10,120,140,20, &pd->f_damp, 0, 10, 10, 0, "Damping of the harmonic force"); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - if(pd->forcefield == PFIELD_GUIDE){ - uiDefButBitS(block, TOG, PFIELD_GUIDE_PATH_ADD, B_FIELD_CHANGE, "Additive", 10,40,140,20, &pd->flag, 0.0, 0, 0, 0, "Based on distance/falloff it adds a portion of the entire path"); - } - else if(pd->forcefield==PFIELD_TEXTURE){ - uiDefButS(block, MENU, B_FIELD_CHANGE, "Texture mode%t|RGB%x0|Gradient%x1|Curl%x2", 10,40,140,20, &pd->tex_mode, 0.0, 0.0, 0, 0, "How the texture effect is calculated (RGB & Curl need a RGB texture)"); - - uiDefButF(block, NUM, B_FIELD_CHANGE, "Nabla:", 10,20,140,20, &pd->tex_nabla, 0.0001f, 1.0, 1, 0, "Specify the dimension of the area for gradient and curl calculation"); - } - else if(particles==0 && ELEM(pd->forcefield,PFIELD_VORTEX,PFIELD_WIND)==0){ - //uiDefButF(block, NUM, B_FIELD_CHANGE, "Distance: ", 10,20,140,20, &pd->f_dist, 0, 1000.0, 10, 0, "Falloff power (real gravitational fallof = 2)"); - uiDefButBitS(block, TOG, PFIELD_PLANAR, B_FIELD_CHANGE, "Planar", 10,0,140,20, &pd->flag, 0.0, 0, 0, 0, "Create planar field"); - } - uiBlockEndAlign(block); - - if(pd->forcefield==PFIELD_GUIDE){ - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Clump:", 160,180,140,20, &pd->clump_fac, -1.0, 1.0, 1, 3, "Amount of clumpimg"); - uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Shape:", 160,160,140,20, &pd->clump_pow, -0.999, 0.999, 1, 3, "Shape of clumpimg"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - if(pd->kink){ - uiDefButS(block, MENU, B_FIELD_CHANGE, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", 160,120,70,20, &pd->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the curve"); - uiDefButS(block, MENU, B_FIELD_CHANGE, "Axis %t|Z %x2|Y %x1|X %x0", 230,120,70,20, &pd->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Freq:", 160,100,140,20, &pd->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)"); - uiDefButF(block, NUMSLI, B_FIELD_CHANGE, "Shape:", 160,80,140,20, &pd->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Amplitude:", 160,60,140,20, &pd->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset"); - } - else{ - uiDefButS(block, MENU, B_FIELD_CHANGE, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", 160,120,140,20, &pd->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the curve"); - } - uiBlockEndAlign(block); - } - else{ - uiDefButS(block, MENU, B_FIELD_DEP, "Fall-off%t|Cone%x2|Tube%x1|Sphere%x0", 160,180,140,20, &pd->falloff, 0.0, 0.0, 0, 0, tipstr); - if(pd->falloff==PFIELD_FALL_TUBE) - uiDefBut(block, LABEL, 0, "Lognitudinal", 160,160,70,20, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PFIELD_POSZ, B_FIELD_CHANGE, "Pos", 160,140,40,20, &pd->flag, 0.0, 0, 0, 0, "Effect only in direction of positive Z axis"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 200,140,100,20, &pd->f_power, 0, 10, 10, 0, "Falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAX, B_FIELD_CHANGE, "Use", 160,120,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum distance for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,120,100,20, &pd->maxdist, 0, 1000.0, 10, 0, "Maximum distance for the field to work"); - uiDefButBitS(block, TOG, PFIELD_USEMIN, B_FIELD_CHANGE, "Use", 160,100,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum distance for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,100,100,20, &pd->mindist, 0, 1000.0, 10, 0, "Minimum distance for the field's fall-off"); - uiBlockEndAlign(block); - - if(pd->falloff==PFIELD_FALL_TUBE){ - uiDefBut(block, LABEL, 0, "Radial", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum radial distance for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxDist: ", 200,40,100,20, &pd->maxrad, 0, 1000.0, 10, 0, "Maximum radial distance for the field to work"); - uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum radial distance for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinDist: ", 200,20,100,20, &pd->minrad, 0, 1000.0, 10, 0, "Minimum radial distance for the field's fall-off"); - uiBlockEndAlign(block); - } - else if(pd->falloff==PFIELD_FALL_CONE){ - uiDefBut(block, LABEL, 0, "Angular", 160,80,70,20, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Fall-off: ", 160,60,140,20, &pd->f_power_r, 0, 10, 10, 0, "Radial falloff power (real gravitational falloff = 2)"); - uiDefButBitS(block, TOG, PFIELD_USEMAXR, B_FIELD_CHANGE, "Use", 160,40,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a maximum angle for the field to work"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MaxAngle: ", 200,40,100,20, &pd->maxrad, 0, 89.0, 10, 0, "Maximum angle for the field to work (in radians)"); - uiDefButBitS(block, TOG, PFIELD_USEMINR, B_FIELD_CHANGE, "Use", 160,20,40,20, &pd->flag, 0.0, 0, 0, 0, "Use a minimum angle for the field's fall-off"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "MinAngle: ", 200,20,100,20, &pd->minrad, 0, 89.0, 10, 0, "Minimum angle for the field's fall-off (in radians)"); - uiBlockEndAlign(block); - } - } - } - } -} - -/* Panel for softbodies */ -static void object_softbodies__enable(void *ob_v, void *arg2) -{ - Object *ob = ob_v; - ModifierData *md = modifiers_findByType(ob, eModifierType_Softbody); - - if (modifiers_isSoftbodyEnabled(ob)) { - if (md) { - md->mode &= ~(eModifierMode_Render|eModifierMode_Realtime); - } - } else { - if (!md) { - md = modifier_new(eModifierType_Softbody); - BLI_addhead(&ob->modifiers, md); - } - - md->mode |= eModifierMode_Render|eModifierMode_Realtime; - - if (!ob->soft) { - ob->soft= sbNew(); - ob->softflag |= OB_SB_GOAL|OB_SB_EDGES; - softbody_clear_cache(ob, CFRA); - } - } - /* needed so that initial state is cached correctly */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); -} - -static int _can_softbodies_at_all(Object *ob) -{ - // list of Yes - if ((ob->type==OB_MESH) - || (ob->type==OB_CURVE) - || (ob->type==OB_LATTICE) - || (ob->type==OB_SURF) - ) return 1; - // else deny - return 0; -} -static void object_softbodies__enable_psys(void *ob_v, void *psys_v) -{ - ParticleSystem *psys = psys_v; - Object *ob = ob_v; - - if(psys->softflag & OB_SB_ENABLE){ - psys->softflag &= ~OB_SB_ENABLE; - } - else{ - if (!psys->soft) { - psys->soft= sbNew(); - psys->softflag |= OB_SB_GOAL|OB_SB_EDGES; - psys->soft->particles=psys; - clear_particles_from_cache(ob, psys, CFRA); - } - psys->softflag |= OB_SB_ENABLE; - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWBUTSEDIT, 0); -} - -static void object_softbodies_II(Object *ob) -{ - SoftBody *sb=ob->soft; - uiBlock *block; - static int val; - short *softflag=&ob->softflag, psys_cur=0; - int ob_has_hair=psys_ob_has_hair(ob); - if(!_can_softbodies_at_all(ob)) return; - /*bah that is ugly! creating missing data members in UI code*/ - if(ob->pd == NULL){ - ob->pd= MEM_callocN(sizeof(PartDeflect), "PartDeflect"); - ob->pd->pdef_sbdamp = 0.1f; - ob->pd->pdef_sbift = 0.2f; - ob->pd->pdef_sboft = 0.02f; - } - block= uiNewBlock(&curarea->uiblocks, "object_softbodies_II", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Soft Body", "Physics"); - if(uiNewPanel(curarea, block, "Soft Body Collision", "Physics", 651, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(ob_has_hair) { - if(PE_get_current_num(ob) >= 0) { - ParticleSystem *psys = PE_get_current(ob); - if(psys) { - sb = psys->soft; - softflag = &psys->softflag; - psys_cur = 1; - } - } - } - - if(psys_cur) { - if(*softflag & OB_SB_ENABLE) - val = 1; - else - val = 0; - } - else - val = modifiers_isSoftbodyEnabled(ob); - - if(!val) { - uiDefBut(block, LABEL, 0, "",10,10,1,2, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/ - uiBlockBeginAlign(block); - if(psys_cur){ - uiDefBut(block, LABEL, 0, "Hair is not a softbody",10,190,300,20, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "However the emitter can deflect a softbody",10,170,300,20, NULL, 0.0, 0, 0, 0, ""); - } - else { - uiDefBut(block, LABEL, 0, "Object is not a softbody",10,190,300,20, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "However it can deflect a softbody",10,170,300,20, NULL, 0.0, 0, 0, 0, ""); - } - /* OTHER OBJECTS COLLISION STUFF */ - if (ob->type==OB_MESH){ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, 1, B_REDR, "Deflection",10,50,150,20, &ob->pd->deflect, 0, 0, 0, 0, "Makes this object visible to softbody objects"); - if(ob->pd->deflect) { - uiDefButF(block, NUM, B_FIELD_CHANGE, "Damping:", 160,50,150,20, &ob->pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision"); - uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, &ob->softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Inner:", 160,30,150,20, &ob->pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); - uiDefButF(block, NUM, B_FIELD_CHANGE, "Outer:", 160,10,150,20, &ob->pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); - } - } - uiBlockEndAlign(block); - } - else{ - /* SELF COLLISION STUFF */ - if ((ob->type==OB_MESH)||(ob->type==OB_CURVE) ) { - uiBlockBeginAlign(block); - if (*softflag & OB_SB_EDGES){ - uiDefButBitS(block, TOG, OB_SB_SELF, B_SOFTBODY_CHANGE, "Self Collision", 10,170,150,20, softflag, 0, 0, 0, 0, "enable naive vertex ball self collision"); - if(*softflag & OB_SB_SELF){ - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Ball Size:", 160,170,150,20, &sb->colball, -10.0, 10.0, 10, 0, "Absolute ball size or factor if not manual adjusted"); - uiDefButS(block, ROW, B_DIFF, "Man",10,150,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MANUAL, 0, 0, "Manual adjust"); - uiDefButS(block, ROW, B_DIFF, "Av",70,150,60,20, &sb->sbc_mode, 4.0,SBC_MODE_AVG, 0, 0, "Average Spring lenght * Ball Size"); - uiDefButS(block, ROW, B_DIFF, "Min",130,150,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MIN, 0, 0, "Minimal Spring lenght * Ball Size"); - uiDefButS(block, ROW, B_DIFF, "Max",190,150,60,20, &sb->sbc_mode, 4.0,SBC_MODE_MAX, 0, 0, "Maximal Spring lenght * Ball Size"); - uiDefButS(block, ROW, B_DIFF, "AvMiMa",250,150,60,20, &sb->sbc_mode, 4.0,SBC_MODE_AVGMINMAX, 0, 0, "(Min+Max)/2 * Ball Size"); - uiDefButF(block, NUM, B_DIFF, "B Stiff:", 10,130,150,20, &sb->ballstiff, 0.001, 100.0, 10, 0, "Ball inflating presure"); - uiDefButF(block, NUM, B_DIFF, "B Damp:", 160,130,150,20, &sb->balldamp, 0.001, 1.0, 10, 0, "Blending to inelastic collision"); - } - } - else{ - uiDefBut(block, LABEL, 0, " not available because there",10,170,300,20, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "are no edges, enable ",10,150,300,20, NULL, 0.0, 0, 0, 0, ""); - } - - uiBlockEndAlign(block); - /*SOLVER SETTINGS*/ - uiDefButF(block, NUM, B_DIFF, "Error Lim:", 10,100,130,20, &sb->rklimit , 0.001, 10.0, 10, 0, "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); - uiDefButBitS(block, TOG, SBSO_OLDERR, B_DIFF,"O", 140,100,20,20, &sb->solverflags, 0, 0, 0, 0, "Old Error Calculation"); - uiDefButS(block, NUM, B_DIFF, "Fuzzy:", 160,100,130,20, &sb->fuzzyness, 1.00, 100.0, 10, 0, "Fuzzyness while on collision, high values make collsion handling faster but less stable"); - uiDefButBitS(block, TOG, SBSO_MONITOR, B_DIFF,"M", 290,100,20,20, &sb->solverflags, 0, 0, 0, 0, "Turn on SB diagnose console prints"); - uiDefButS(block, NUM, B_DIFF, "MinS:", 10,80,100,20, &sb->minloops, 0.00, 30000.0, 10, 0, "Minimal # solver steps/frame "); - uiDefButS(block, NUM, B_DIFF, "MaxS:", 110,80,100,20, &sb->maxloops, 0.00, 30000.0, 10, 0, "Maximal # solver steps/frame "); - uiDefButS(block, NUM, B_DIFF, "Choke:", 210,80,100,20, &sb->choke, 0.00, 100.0, 10, 0, "'Viscosity' inside collision target "); - } - /* OTHER OBJECTS COLLISION STUFF */ - if (ob->type==OB_MESH){ - uiDefButBitS(block, TOG, 1, B_REDR, "Deflection",10,50,150,20, &ob->pd->deflect, 0, 0, 0, 0, "Makes this object visible to other softbody objects"); - if(ob->pd->deflect) { - uiDefButF(block, NUM, B_DIFF, "Damping:", 160,50,150,20, &ob->pd->pdef_sbdamp, 0.0, 1.0, 10, 0, "Amount of damping during soft body collision"); - uiDefButBitS(block, TOG,OB_SB_COLLFINAL , B_DIFF, "Ev.M.Stack",10,30,150,20, softflag, 0, 0, 0, 0, "Pick collision object from modifier stack"); - uiDefButF(block, NUM, B_DIFF, "Inner:", 160,30,150,20, &ob->pd->pdef_sbift, 0.001, 1.0, 10, 0, "Inner face thickness"); - uiDefButF(block, NUM, B_DIFF, "Outer:", 160,10,150,20, &ob->pd->pdef_sboft, 0.001, 1.0, 10, 0, "Outer face thickness"); - } - } - uiDefBut(block, LABEL, 0, "",10,10,1,2, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/ - } - uiBlockEndAlign(block); -} - -static void sb_clear_cache(void *ob_v, void *actsoft_v) -{ - Object *ob = ob_v; - short *actsoft = actsoft_v; - - if(actsoft >= 0) - clear_particles_from_cache(ob, BLI_findlink(&ob->particlesystem, *actsoft), CFRA); - else - softbody_clear_cache(ob, CFRA); -} -static void object_softbodies(Object *ob) -{ - SoftBody *sb=ob->soft; - ParticleSystem *psys=NULL; - uiBlock *block; - uiBut *but; - static int val; - short *softflag=&ob->softflag, psys_cur=0; - int ob_has_hair = psys_ob_has_hair(ob); - static short actsoft= -1; - - if(!_can_softbodies_at_all(ob)) return; - block= uiNewBlock(&curarea->uiblocks, "object_softbodies", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Soft Body", "Physics", 640, 0, 318, 204)==0) return; - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(ob_has_hair) { - char *menustr = psys_menu_string(ob,1); - - psys= psys_get_current(ob); - if(psys && actsoft >= 0) { - actsoft= psys_get_current_num(ob)+1; - - sb=psys->soft; - softflag=&psys->softflag; - psys_cur=1; - } - else - actsoft= -1; /* -1 = object */ - - but=uiDefButS(block, MENU, B_BAKE_REDRAWEDIT, menustr, 10,200,100,20, &actsoft, 14.0, 0.0, 0, 0, "Browse systems"); - uiButSetFunc(but, PE_change_act, ob, &actsoft); - - MEM_freeN(menustr); - } - - if(psys_cur && psys){ - if(*softflag & OB_SB_ENABLE) - val=1; - else - val=0; - - but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 110,200,70,20, &val, 0, 0, 0, 0, "Sets hair to become soft body"); - uiButSetFunc(but, object_softbodies__enable_psys, ob, psys); - } - else{ - val = modifiers_isSoftbodyEnabled(ob); - if(ob_has_hair) - but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 110,200,70,20, &val, 0, 0, 0, 0, "Sets object to become soft body"); - else - but = uiDefButI(block, TOG, REDRAWBUTSOBJECT, "Soft Body", 10,200,130,20, &val, 0, 0, 0, 0, "Sets object to become soft body"); - - uiButSetFunc(but, object_softbodies__enable, ob, NULL); - } - - uiDefBut(block, LABEL, 0, "",10,10,300,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/ - - if(val){ - int defCount; - char *menustr; - static char str[128]; - - //uiDefButBitS(block, TOG, OB_SB_BAKESET, REDRAWBUTSOBJECT, "Bake settings", 180,200,130,20, &ob->softflag, 0, 0, 0, 0, "To convert simulation into baked (cached) result"); - - //if(sb->keys) uiSetButLock(1, "Soft Body is baked, free it first"); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_SB_PROTECT_CACHE, REDRAWBUTSOBJECT, "Protect", 180,200,50,20, softflag, 0.0, 0.0, 10, 0, "Protect the cache"); - but=uiDefBut(block, BUT, B_SOFTBODY_CHANGE, "Clear", 230,200,50,20, NULL, 0.0, 0.0, 10, 0, "Clear the cache"); - if((*softflag & PSYS_PROTECT_CACHE)==0) - uiButSetFunc(but, sb_clear_cache, ob, &actsoft); - - uiBlockEndAlign(block); - - if(*softflag & OB_SB_PROTECT_CACHE) uiSetButLock(1, "Cache is protected"); - - //if(ob->softflag & OB_SB_BAKESET) { - // uiBlockBeginAlign(block); - // uiDefButI(block, NUM, B_DIFF, "Start:", 10, 170,100,20, &sb->sfra, 1.0, 10000.0, 10, 0, "Start frame for baking"); - // uiDefButI(block, NUM, B_DIFF, "End:", 110, 170,100,20, &sb->efra, 1.0, 10000.0, 10, 0, "End frame for baking"); - // uiDefButI(block, NUM, B_DIFF, "Interval:", 210, 170,100,20, &sb->interval, 1.0, 10.0, 10, 0, "Interval in frames between baked keys"); - // uiBlockEndAlign(block); - - // uiDefButS(block, TOG, B_DIFF, "Local", 10, 145,100,20, &sb->local, 0.0, 0.0, 0, 0, "Use local coordinates for baking"); - - - // uiClearButLock(); - // uiBlockBeginAlign(block); - - // if(sb->keys) { - // char str[128]; - // uiDefIconTextBut(block, BUT, B_SOFTBODY_BAKE_FREE, ICON_X, "FREE BAKE", 10, 120,300,20, NULL, 0.0, 0.0, 0, 0, "Free baked result"); - // sprintf(str, "Stored %d vertices %d keys %.3f MB", sb->totpoint, sb->totkey, ((float)16*sb->totpoint*sb->totkey)/(1024.0*1024.0)); - // uiDefBut(block, LABEL, 0, str, 10, 100,300,20, NULL, 0.0, 0.0, 00, 0, ""); - // } - // else - // uiDefBut(block, BUT, B_SOFTBODY_BAKE, "BAKE", 10, 120,300,20, NULL, 0.0, 0.0, 10, 0, "Start baking. Press ESC to exit without baking"); - //} - //else { - /* GENERAL STUFF */ - if (sb->totpoint){ - sprintf(str, "Vertex Mass; Object mass %f [k]",sb->nodemass*sb->totpoint/1000.0f); - } - else{ - sprintf(str, "Vertex Mass"); - } - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_DIFF, "Friction:", 10, 170,150,20, &sb->mediafrict, 0.0, 50.0, 10, 0, "General media friction for point movements"); - uiDefButF(block, NUM, B_DIFF, "Mass:", 160, 170,150,20, &sb->nodemass , 0.001, 50000.0, 10, 0, str); - uiDefButF(block, NUM, B_DIFF, "Grav:", 10,150,150,20, &sb->grav , 0.0, 10.0, 10, 0, "Apply gravitation to point movement"); - uiDefButF(block, NUM, B_DIFF, "Speed:", 160,150,150,20, &sb->physics_speed , 0.01, 100.0, 10, 0, "Tweak timing for physics to control frequency and speed"); - uiBlockEndAlign(block); - - /* GOAL STUFF */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_SB_GOAL, B_SOFTBODY_CHANGE, "Use Goal", 10,120,130,20, softflag, 0, 0, 0, 0, "Define forces for vertices to stick to animated position"); - if (*softflag & OB_SB_GOAL){ - if(ob->type==OB_MESH) { - menustr= get_vertexgroup_menustr(ob); - defCount=BLI_countlist(&ob->defbase); - if(defCount==0) sb->vertgroup= 0; - uiDefButS(block, MENU, B_SOFTBODY_CHANGE, menustr, 140,120,20,20, &sb->vertgroup, 0, defCount, 0, 0, "Browses available vertex groups"); - MEM_freeN (menustr); - - if(sb->vertgroup) { - bDeformGroup *defGroup = BLI_findlink(&ob->defbase, sb->vertgroup-1); - if(defGroup) - uiDefBut(block, BUT, B_DIFF, defGroup->name, 160,120,130,20, NULL, 0.0, 0.0, 0, 0, "Name of current vertex group"); - else - uiDefBut(block, BUT, B_DIFF, "(no group)", 160,120,130,20, NULL, 0.0, 0.0, 0, 0, "Vertex Group doesn't exist anymore"); - uiDefIconBut(block, BUT, B_SOFTBODY_DEL_VG, ICON_X, 290,120,20,20, 0, 0, 0, 0, 0, "Disable use of vertex group"); - } - else - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Goal:", 160,120,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used"); - } - else { - uiDefButS(block, TOG, B_SOFTBODY_CHANGE, "W", 140,120,20,20, &sb->vertgroup, 0, 1, 0, 0, "Use control point weight values"); - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Goal:", 160,120,150,20, &sb->defgoal, 0.0, 1.0, 10, 0, "Default Goal (vertex target position) value, when no Vertex Group used"); - } - - uiDefButF(block, NUM, B_DIFF, "G Stiff:", 10,100,150,20, &sb->goalspring, 0.0, 0.999, 10, 0, "Goal (vertex target position) spring stiffness"); - uiDefButF(block, NUM, B_DIFF, "G Damp:", 160,100,150,20, &sb->goalfrict , 0.0, 50.0, 10, 0, "Goal (vertex target position) friction"); - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "G Min:", 10,80,150,20, &sb->mingoal, 0.0, 1.0, 10, 0, "Goal minimum, vertex group weights are scaled to match this range"); - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "G Max:", 160,80,150,20, &sb->maxgoal, 0.0, 1.0, 10, 0, "Goal maximum, vertex group weights are scaled to match this range"); - } - uiBlockEndAlign(block); - - /* EDGE SPRING STUFF */ - if(ob->type!=OB_SURF) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_SB_EDGES, B_SOFTBODY_CHANGE, "Use Edges", 10,50,90,20, softflag, 0, 0, 0, 0, "Use Edges as springs"); - if (*softflag & OB_SB_EDGES){ - uiDefButBitS(block, TOG, OB_SB_QUADS, B_SOFTBODY_CHANGE, "Stiff Quads", 110,50,90,20, softflag, 0, 0, 0, 0, "Adds diagonal springs on 4-gons"); - uiDefButBitS(block, TOG, OB_SB_EDGECOLL, B_DIFF, "CEdge", 220,50,45,20, softflag, 0, 0, 0, 0, "Edge collide too"); - uiDefButBitS(block, TOG, OB_SB_FACECOLL, B_DIFF, "CFace", 265,50,45,20, softflag, 0, 0, 0, 0, "Faces collide too SLOOOOOW warning "); - uiDefButF(block, NUM, B_DIFF, "E Stiff:", 10,30,150,20, &sb->inspring, 0.0, 0.999, 10, 0, "Edge spring stiffness"); - uiDefButF(block, NUM, B_DIFF, "E Damp:", 160,30,150,20, &sb->infrict, 0.0, 50.0, 10, 0, "Edge spring friction"); - uiDefButS(block, NUM, B_DIFF, "Aero:", 10,10,150,20, &sb->aeroedge, 0.00, 30000.0, 10, 0, "Make edges 'sail'"); - if(ob->type==OB_MESH) { - uiDefButF(block, NUM, B_SOFTBODY_CHANGE, "Rigidity:", 160,10,150,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Strenght of Springs over 2 Edges"); - } - else sb->secondspring = 0; - uiDefBut(block, LABEL, 0, "",10,10,1,0, NULL, 0.0, 0, 0, 0, ""); /* tell UI we go to 10,10*/ - } - uiBlockEndAlign(block); - } - //} - } - uiBlockEndAlign(block); -} - - /* Panels for new particles*/ -static void object_panel_particle_children(Object *ob) -{ - uiBlock *block; - ParticleSystem *psys = psys_get_current(ob); - ParticleSettings *part; - short butx=0, buty=160, butw=150, buth=20; - static short kink_ui=0; - - if (psys==NULL) return; - part=psys->part; - if(part==NULL) return; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_child", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Children", "Particle", 1300, 0, 318, 204)==0) return; - uiNewPanelTabbed("Extras", "Particle"); - - uiDefButS(block, MENU, B_PART_ALLOC_CHILD, "Children from:%t|Faces%x2|Particles%x1|None%x0", butx,buty,butw,buth, &part->childtype, 14.0, 0.0, 0, 0, "Create child particles"); - - if(part->childtype==0) return; - - if((psys->flag&(PSYS_HAIR_DONE|PSYS_KEYED))==0) { - uiDefBut(block, LABEL, 0, "Hair or keyed", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "particles needed!", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - return; - } - - uiBlockBeginAlign(block); - - buty -= buth/2; - - uiDefButI(block, NUM, B_PART_ALLOC_CHILD, "Amount:", butx,(buty-=buth),butw,buth, &part->child_nbr, 0.0, MAX_PART_CHILDREN, 0, 0, "Amount of children/parent"); - uiDefButI(block, NUM, B_DIFF, "Render Amount:", butx,(buty-=buth),butw,buth, &part->ren_child_nbr, 0.0, MAX_PART_CHILDREN, 0, 0, "Amount of children/parent for rendering"); - if(part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES) { - uiDefButF(block, NUMSLI, B_PART_DISTR_CHILD, "VParents:", butx,(buty-=buth),butw,buth, &part->parents, 0.0, 1.0, 1, 3, "Relative amount of virtual parents"); - } - else { - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Rad:", butx,(buty-=buth),butw,buth, &part->childrad, 0.0, 10.0, 1, 3, "Radius of children around parent"); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Round:", butx,(buty-=buth),butw,buth, &part->childflat, 0.0, 1.0, 1, 3, "Roundness of children around parent"); - } - uiBlockEndAlign(block); - - buty -= buth/2; - - /* clump */ - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Clump:", butx,(buty-=buth),butw,buth, &part->clumpfac, -1.0, 1.0, 1, 3, "Amount of clumpimg"); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->clumppow, -0.999, 0.999, 1, 3, "Shape of clumpimg"); - uiBlockEndAlign(block); - - buty -= buth/2; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_PART_REDRAW, "Size:", butx,(buty-=buth),butw/2,buth, &part->childsize, 0.01, 100, 10, 1, "A multiplier for the child particle size"); - uiDefButF(block, NUM, B_PART_REDRAW, "Rand:", butx+butw/2,buty,butw/2,buth, &part->childrandsize, 0.0, 1.0, 10, 1, "Random variation to the size of the child particles"); - if(part->childtype==PART_CHILD_FACES) { - uiDefButF(block, NUM, B_PART_REDRAW, "Spread:",butx,(buty-=buth),butw/2,buth, &part->childspread, -1.0, 1.0, 10, 1, "Spread children from the faces"); - uiDefButBitI(block, TOG, PART_CHILD_SEAMS, B_PART_DISTR_CHILD, "Use Seams", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Use seams to determine parents"); - } - uiBlockEndAlign(block); - - butx=160; - buty=180; - - uiDefButBitS(block, TOG, 1, B_PART_REDRAW, "Kink/Branch", butx,(buty-=buth),butw,buth, &kink_ui, 0, 0, 0, 0, "Show kink and branch options"); - - if(kink_ui) { - buty -= buth/2; - - /* kink */ - uiBlockBeginAlign(block); - if(part->kink) { - uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); - uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Axis %t|Z %x2|Y %x1|X %x0", butx+butw/2,buty,butw/2,buth, &part->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset"); - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Freq:", butx,(buty-=buth),butw,buth, &part->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)"); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end"); - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Amplitude:", butx,(buty-=buth),butw,buth, &part->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset"); - } - else { - uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path"); - buty-=3*buth; - } - uiBlockEndAlign(block); - - if(part->childtype==PART_CHILD_PARTICLES) { - if(part->flag & PART_BRANCHING) { - uiDefButBitI(block, TOG, PART_BRANCHING, B_PART_RECALC_CHILD, "Branching", butx,(buty-=2*buth),butw,buth, &part->flag, 0, 0, 0, 0, "Branch child paths from eachother"); - uiDefButBitI(block, TOG, PART_ANIM_BRANCHING, B_PART_RECALC_CHILD, "Animated", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Animate branching"); - uiDefButBitI(block, TOG, PART_SYMM_BRANCHING, B_PART_RECALC_CHILD, "Symmetric", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Start and end points are the same"); - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Threshold:", butx,(buty-=buth),butw,buth, &part->branch_thres, 0.0, 1.0, 1, 3, "Threshold of branching"); - } - else - uiDefButBitI(block, TOG, PART_BRANCHING, B_PART_RECALC_CHILD, "Branching", butx,(buty-=2*buth),butw,buth, &part->flag, 0, 0, 0, 0, "Branch child paths from eachother"); - } - } - else { - /* rough */ - buty -= buth/2; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Rough1:", butx,(buty-=buth),butw,buth, &part->rough1, 0.0, 10.0, 1, 3, "Amount of location dependant rough"); - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Size1:", butx,(buty-=buth),butw,buth, &part->rough1_size, 0.01, 10.0, 1, 3, "Size of location dependant rough"); - uiBlockEndAlign(block); - buty -= buth/2; - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Rough2:", butx,(buty-=buth),butw,buth, &part->rough2, 0.0, 10.0, 1, 3, "Amount of random rough"); - uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Size2:", butx,(buty-=buth),butw,buth, &part->rough2_size, 0.01, 10.0, 1, 3, "Size of random rough"); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Thresh:", butx,(buty-=buth),butw,buth, &part->rough2_thres, 0.00, 1.0, 1, 3, "Amount of particles left untouched by random rough"); - uiBlockEndAlign(block); - buty -= buth/2; - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "RoughE:", butx,(buty-=buth),butw,buth, &part->rough_end, 0.0, 10.0, 1, 3, "Amount of end point rough"); - uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:", butx,(buty-=buth),butw,buth, &part->rough_end_shape, 0.0, 10.0, 1, 3, "Shape of end point rough"); - uiBlockEndAlign(block); - } -} -static void particle_set_vg(void *ob_v, void *vgnum_v) -{ - Object *ob= ob_v; - ParticleSystem *psys=psys_get_current(ob); - short vgnum = *((short *)vgnum_v); - - if(vgnum==PSYS_VG_DENSITY) - psys->recalc|=PSYS_DISTR; - else if(vgnum!=PSYS_VG_SIZE) - psys->recalc|=PSYS_INIT; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} -static void particle_del_vg(void *ob_v, void *vgnum_v) -{ - Object *ob= ob_v; - ParticleSystem *psys=psys_get_current(ob); - short vgnum = *((short *)vgnum_v); - - if(vgnum==PSYS_VG_DENSITY) { - psys->recalc|=PSYS_DISTR; - } - - psys->vgroup[vgnum]=0; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} -static void object_panel_particle_extra(Object *ob) -{ - uiBlock *block; - uiBut *but; - ParticleSystem *psys=psys_get_current(ob); - ParticleSettings *part; - short butx=0, buty=160, butw=150, buth=20; - static short vgnum=0; - int event; - - if (psys==NULL) return; - part=psys->part; - if(part==NULL) return; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_extra", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Extras", "Particle", 980, 0, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "Effectors:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_PART_RECALC, "GR:", butx, (buty-=buth), butw/2, buth, &part->eff_group, "Limit effectors to this Group"); - uiDefButBitI(block, TOG, PART_SIZE_DEFL, B_PART_RECALC, "Size Deflect", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Use particle's size in deflection"); - uiDefButBitI(block, TOG, PART_DIE_ON_COL, B_PART_RECALC, "Die on hit",butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Particles die when they collide with a deflector object"); - uiDefButBitI(block, TOG, PART_STICKY, B_PART_RECALC, "Sticky", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Particles stick to collided objects if they die in the collision"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Time:", butx,(buty-=buth),butw/3,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PART_GLOB_TIME, B_PART_RECALC, "Global", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Set all ipos that work on particles to be calculated in global/object time"); - uiDefButBitI(block, TOG, PART_ABS_TIME, B_PART_RECALC, "Absolute", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Set all ipos that work on particles to be calculated in absolute/relative time"); - - if(part->flag & PART_LOOP){ - uiDefButBitI(block, TOG, PART_LOOP, B_PART_RECALC, "Loop", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Loop particle lives"); - uiDefButBitI(block, TOG, PART_LOOP_INSTANT, B_PART_RECALC, "Instantly", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Loop particle life at time of death"); - } - else - uiDefButBitI(block, TOG, PART_LOOP, B_PART_RECALC, "Loop", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Loop particle lives"); - - uiDefButF(block, NUM, B_PART_RECALC, "Tweak:", butx,(buty-=buth),butw,buth, &part->timetweak, 0.0, 10.0, 1, 0, "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)"); - uiBlockEndAlign(block); - - if(ob->type==OB_MESH) { - char *menustr= get_vertexgroup_menustr(ob); - int defCount=BLI_countlist(&ob->defbase); - if(defCount==0) psys->vgroup[vgnum]= 0; - - uiDefBut(block, LABEL, 0, "Vertex group:", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - - uiDefButS(block, MENU, B_PART_REDRAW, "Attribute%t|TanRot%x10|TanVel%x9|Size%x8|RoughE%x7|Rough2%x6|Rough1%x5|Kink%x4|Clump%x3|Length%x2|Velocity%x1|Density%x0", butx,(buty-=buth),butw-40,buth, &vgnum, 14.0, 0.0, 0, 0, "Attribute effected by vertex group"); - but=uiDefButBitS(block, TOG, (1<vg_neg, 0, 0, 0, 0, "Negate the effect of the vertex group"); - uiButSetFunc(but, particle_set_vg, (void *)ob, (void *)(&vgnum)); - - butx+=butw; - - but= uiDefButS(block, MENU, B_PART_REDRAW, menustr, butx,buty,buth,buth, psys->vgroup+vgnum, 0, defCount, 0, 0, "Browses available vertex groups"); - uiButSetFunc(but, particle_set_vg, (void *)ob, (void *)(&vgnum)); - MEM_freeN (menustr); - - if(psys->vgroup[vgnum]) { - bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[vgnum]-1); - if(defGroup) - uiDefBut(block, BUT, B_PART_REDRAW, defGroup->name, butx+buth,buty,butw-2*buth,buth, NULL, 0.0, 0.0, 0, 0, "Name of current vertex group"); - else{ - uiDefBut(block, BUT, B_PART_REDRAW, "(no group)", butx+buth,buty,butw-2*buth,buth, NULL, 0.0, 0.0, 0, 0, "Vertex Group doesn't exist anymore"); - } - but=uiDefIconBut(block, BUT, B_PART_REDRAW, ICON_X, butx+butw-buth,buty,buth,buth, 0, 0, 0, 0, 0, "Disable use of vertex group"); - uiButSetFunc(but, particle_del_vg, (void *)ob, (void *)(&vgnum)); - } - - uiBlockEndAlign(block); - } - - buty=butx=160; - - uiDefButI(block, NUM, B_PART_DISTR, "Seed:", butx,(buty-=buth),butw,buth, &psys->seed, 0.0, 255.0, 1, 0, "Set an offset in the random table"); - - event=(part->flag&PART_SIZEMASS)?B_PART_RECALC:B_PART_REDRAW; - uiDefButF(block, NUM, event, "Size:", butx,(buty-=2*buth),butw,buth, &part->size, 0.01, 100, 10, 1, "The size of the particles"); - uiDefButF(block, NUM, event, "Rand:", butx,(buty-=buth),butw,buth, &part->randsize, 0.0, 2.0, 10, 1, "Give the particle size a random variation"); - - uiDefButBitI(block, TOG, PART_SIZEMASS, B_PART_RECALC, "Mass from size", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Multiply mass with particle size"); - uiDefButF(block, NUM, B_PART_RECALC, "Mass:", butx,(buty-=buth),butw,buth, &part->mass, 0.01, 100, 10, 1, "Specify the mass of the particles"); -} -/* copy from buttons_shading.c */ -static void autocomplete_uv(char *str, void *arg_v) -{ - Mesh *me; - CustomDataLayer *layer; - AutoComplete *autocpl; - int a; - - if(str[0]==0) - return; - - autocpl= autocomplete_begin(str, 32); - - /* search if str matches the beginning of name */ - for(me= G.main->mesh.first; me; me=me->id.next) - for(a=0, layer= me->fdata.layers; afdata.totlayer; a++, layer++) - if(layer->type == CD_MTFACE) - autocomplete_do_name(autocpl, layer->name); - - autocomplete_end(autocpl, str); -} -static void object_panel_particle_visual(Object *ob) -{ - uiBlock *block; - uiBut *but; - ParticleSystem *psys=psys_get_current(ob); - ParticleSettings *part; - short butx=0, buty=160, butw=150, buth=20; - static short bbuvnum=0; - - if (psys==NULL) return; - part=psys->part; - if(part==NULL) return; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_visual", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Visualization", "Particle", 640, 0, 318, 204)==0) return; - - uiDefButS(block, MENU, B_PART_RECALC, "Billboard %x9|Group %x8|Object %x7|Path %x6|Line %x5|Axis %x4|Cross %x3|Circle %x2|Point %x1|None %x0", butx,buty,butw,buth, &part->draw_as, 14.0, 0.0, 0, 0, "How particles are visualized"); - - if(part->draw_as==PART_DRAW_NOT) { - uiDefButBitS(block, TOG, PART_DRAW_EMITTER, B_PART_REDRAW, "Render emitter", butx,(buty-=2*buth),butw,buth, &part->draw, 0, 0, 0, 0, "Render emitter object"); - return; - } - - uiDefBut(block, LABEL, 0, "Draw:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PART_DRAW_VEL, B_PART_REDRAW, "Vel", butx,(buty-=buth),butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle velocity"); - uiDefButBitS(block, TOG, PART_DRAW_SIZE, B_PART_REDRAW, "Size", butx+butw/3,buty,butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle size"); - uiDefButBitS(block, TOG, PART_DRAW_NUM, B_PART_REDRAW, "Num", butx+2*butw/3,buty,butw/3,buth, &part->draw, 0, 0, 0, 0, "Show particle number"); - uiDefButS(block, NUM, B_PART_REDRAW, "Draw Size:", butx,(buty-=buth),butw,buth, &part->draw_size, 0.0, 10.0, 0, 0, "Size of particles on viewport in pixels (0=default)"); - uiDefButS(block, NUM, B_PART_RECALC, "Disp:", butx,(buty-=buth),butw,buth, &part->disp, 0.0, 100.0, 10, 0, "Percentage of particles to calculate for 3d view"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Render:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_PART_DISTR, "Material:", butx,(buty-=buth),butw-30,buth, &part->omat, 1.0, 16.0, 0, 0, "Specify material used for the particles"); - uiDefButBitS(block, TOG, PART_DRAW_MAT_COL, B_PART_RECALC, "Col", butx+butw-30,buty,30,buth, &part->draw, 0, 0, 0, 0, "Draw particles using material's diffuse color"); - uiDefButBitS(block, TOG, PART_DRAW_EMITTER, B_PART_REDRAW, "Emitter", butx,(buty-=buth),butw/2,buth, &part->draw, 0, 0, 0, 0, "Render emitter Object also"); - uiDefButBitS(block, TOG, PART_DRAW_PARENT, B_PART_REDRAW, "Parents", butx+butw/2,buty,butw/2,buth, &part->draw, 0, 0, 0, 0, "Render parent particles"); - uiDefButBitI(block, TOG, PART_UNBORN, B_PART_REDRAW, "Unborn", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Show particles before they are emitted"); - uiDefButBitI(block, TOG, PART_DIED, B_PART_REDRAW, "Died", butx+butw/2,buty,butw/2,buth, &part->flag, 0, 0, 0, 0, "Show particles after they have died"); - - uiBlockEndAlign(block); - - butx=160; - buty=160-buth; - - uiBlockBeginAlign(block); - - switch(part->draw_as) { - case PART_DRAW_OB: - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PART_REDRAW, "OB:", butx,(buty-=buth),butw,buth, &part->dup_ob, "Show this Object in place of particles"); - break; - case PART_DRAW_GR: - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_PART_REDRAW, "GR:", butx,(buty-=buth),butw,buth, &part->dup_group, "Show Objects in this Group in place of particles"); - uiDefButBitS(block, TOG, PART_DRAW_WHOLE_GR, B_PART_REDRAW, "Dupli Group", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Use whole group at once"); - if((part->draw & PART_DRAW_WHOLE_GR)==0) - uiDefButBitS(block, TOG, PART_DRAW_RAND_GR, B_PART_REDRAW, "Pick Random", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Pick objects from group randomly"); - break; - case PART_DRAW_BB: - uiDefButBitS(block, TOG, PART_DRAW_BB_LOCK, B_PART_REDRAW, "Lock", butx,(buty+=buth),butw/2,buth, &part->draw, 0, 0, 0, 0, "Lock the billboards align axis"); - uiDefButS(block, MENU, B_PART_REDRAW, "Align to%t|Velocity%x4|View%x3|Z%x2|Y%x1|X%x0", butx+butw/2,buty,butw/2,buth, &part->bb_align, 14.0, 0.0, 0, 0, "In respect to what the billboards are aligned"); - uiDefButF(block, NUM, B_PART_REDRAW, "Tilt:", butx,(buty-=buth),butw/2,buth, &part->bb_tilt, -1.0, 1.0, 0, 0, "Tilt of the billboards"); - uiDefButF(block, NUM, B_PART_REDRAW, "Rand:", butx+butw/2,buty,butw/2,buth, &part->bb_rand_tilt, 0.0, 1.0, 0, 0, "Random tilt of the billboards"); - uiDefButS(block, NUM, B_PART_REDRAW, "UV Split:", butx,(buty-=buth),butw,buth, &part->bb_uv_split, 1.0, 10.0, 0, 0, "Amount of rows/columns to split uv coordinates for billboards"); - uiDefButS(block, MENU, B_PART_REDRAW, "Animate%t|Angle%x2|Time%x1|None%x0", butx,(buty-=buth),butw/2,buth, &part->bb_anim, 14.0, 0.0, 0, 0, "How to animate billboard textures"); - uiDefButS(block, MENU, B_PART_REDRAW, "Offset%t|Random%x2|Linear%x1|None%x0", butx+butw/2,buty,butw/2,buth, &part->bb_split_offset, 14.0, 0.0, 0, 0, "How to offset billboard textures"); - uiDefButF(block, NUM, B_PART_REDRAW, "OffsetX:", butx,(buty-=buth),butw,buth, part->bb_offset, -1.0, 1.0, 0, 0, "Offset billboards horizontally"); - uiDefButF(block, NUM, B_PART_REDRAW, "OffsetY:", butx,(buty-=buth),butw,buth, part->bb_offset+1, -1.0, 1.0, 0, 0, "Offset billboards vertically"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PART_REDRAW, "OB:", butx,(buty-=buth),butw,buth, &part->bb_ob, "Billboards face this object (default is active camera)"); - uiDefButS(block, MENU, B_PART_REDRAW, "UV channel%t|Split%x2|Time-Index (X-Y)%x1|Normal%x0", butx,(buty-=buth),butw,buth, &bbuvnum, 14.0, 0.0, 0, 0, "UV channel"); - but=uiDefBut(block, TEX, B_PART_REDRAW, "UV:", butx,(buty-=buth),butw,buth, psys->bb_uvname+bbuvnum, 0, 31, 0, 0, "Set name of UV layer to use with billboards, default is active UV layer"); - uiButSetCompleteFunc(but, autocomplete_uv, NULL); - break; - case PART_DRAW_LINE: - uiDefButBitS(block, TOG, PART_DRAW_VEL_LENGTH, B_PART_REDRAW, "Speed", butx,(buty-=buth),butw,buth, &part->draw, 0, 0, 0, 0, "Multiply line length by particle speed"); - uiDefButF(block, NUM, B_PART_REDRAW, "Back:", butx,(buty-=buth),butw,buth, &part->draw_line[0], 0.0, 10.0, 0, 0, "Length of the line's tail"); - uiDefButF(block, NUM, B_PART_REDRAW, "Front:", butx,(buty-=buth),butw,buth, &part->draw_line[1], 0.0, 10.0, 0, 0, "Length of the line's head"); - break; - case PART_DRAW_PATH: - if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED)) { - uiDefButS(block, NUM, B_PART_RECALC, "Steps:", butx,(buty+=buth),butw,buth, &part->draw_step, 0.0, 7.0, 0, 0, "How many steps paths are drawn with (power of 2)"); - uiDefButS(block, NUM, B_PART_REDRAW, "Render:", butx,(buty-=buth),butw,buth, &part->ren_step, 0.0, 9.0, 0, 0, "How many steps paths are rendered with (power of 2)"); - - uiDefButBitI(block, TOG, PART_ABS_LENGTH, B_PART_RECALC, "Abs Length", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Use maximum length in absolute blender units"); - uiDefButF(block, NUM, B_PART_RECALC, "Max Length:", butx,(buty-=buth),butw,buth, &part->abslength, 0.0, 10000.0, 1, 3, "Absolute path length"); - uiDefButF(block, NUMSLI, B_PART_RECALC, "RLength:", butx,(buty-=buth),butw,buth, &part->randlength, 0.0, 1.0, 1, 3, "Give path length a random variation"); - uiBlockEndAlign(block); - - uiDefButBitI(block, TOG, PART_HAIR_BSPLINE, B_PART_RECALC, "B-Spline", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Interpolate hair using B-Splines"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PART_DRAW_REN_STRAND, B_PART_REDRAW, "Strand render", butx,buty-=buth,butw,buth, &part->draw, 0, 0, 0, 0, "Use the strand primitive for rendering"); - if(part->draw & PART_DRAW_REN_STRAND) { - uiDefButS(block, NUM, B_PART_REDRAW, "Angle:", butx,(buty-=buth),butw,buth, &part->adapt_angle, 0.0, 45.0, 0, 0, "How many degrees path has to curve to make another render segment"); - } - else { - uiDefButBitS(block, TOG, PART_DRAW_REN_ADAPT, B_PART_REDRAW, "Adaptive render", butx,buty-=buth,butw,buth, &part->draw, 0, 0, 0, 0, "Draw steps of the particle path"); - if(part->draw & PART_DRAW_REN_ADAPT) { - uiDefButS(block, NUM, B_PART_REDRAW, "Angle:", butx,(buty-=buth),butw/2,buth, &part->adapt_angle, 0.0, 45.0, 0, 0, "How many degrees path has to curve to make another render segment"); - uiDefButS(block, NUM, B_PART_REDRAW, "Pixel:", butx+butw/2,buty,(butw+1)/2,buth, &part->adapt_pix, 0.0, 50.0, 0, 0, "How many pixels path has to cover to make another render segment"); - } - } - } - else { - uiDefBut(block, LABEL, 0, "Baked or keyed", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "particles needed!", butx,(buty-=2*buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - } - break; - } - uiBlockEndAlign(block); -} -static void object_panel_particle_simplification(Object *ob) -{ - uiBlock *block; - ParticleSystem *psys=psys_get_current(ob); - ParticleSettings *part; - short butx=0, buty=160, butw=150, buth=20; - - if (psys==NULL) return; - part=psys->part; - if(part==NULL) return; - - if(part->draw_as!=PART_DRAW_PATH || !(part->draw & PART_DRAW_REN_STRAND)) - return; - if(part->childtype!=PART_CHILD_FACES) - return; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_simplification", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Visualization", "Particle"); - if(uiNewPanel(curarea, block, "Simplification", "Particle", 640, 0, 318, 204)==0) return; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PART_SIMPLIFY_ENABLE, B_PART_REDRAW, "Child Simplification", butx,buty-=buth,butw,buth, &part->simplify_flag, 0, 0, 0, 0, "Remove child strands as the object becomes smaller on the screen"); - uiBlockEndAlign(block); - if(part->simplify_flag & PART_SIMPLIFY_ENABLE) { - buty -= 10; - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_NOP, "Reference Size:", butx,(buty-=buth),butw,buth, &part->simplify_refsize, 1.0, 32768.0, 0, 0, "Reference size size in pixels, after which simplification begins"); - uiDefButF(block, NUM, B_NOP, "Rate:", butx,(buty-=buth),butw,buth, &part->simplify_rate, 0.0, 1.0, 0, 0, "Speed of simplification"); - uiDefButF(block, NUM, B_NOP, "Transition:", butx,(buty-=buth),butw,buth, &part->simplify_transition, 0.0, 1.0, 0, 0, "Transition period for fading out strands"); - uiBlockEndAlign(block); - - buty -= 10; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, PART_SIMPLIFY_VIEWPORT, B_PART_REDRAW, "Viewport", butx,buty-=buth,butw,buth, &part->simplify_flag, 0, 0, 0, 0, "Remove child strands as the object goes outside the viewport"); - uiDefButF(block, NUM, B_NOP, "Rate:", butx,(buty-=buth),butw,buth, &part->simplify_viewport, 0.0, 0.999, 0, 0, "Speed of simplification"); - uiBlockEndAlign(block); - } - uiBlockEndAlign(block); -} -static void boidrule_moveDown(void *part_v, void *rule_v) -{ - ParticleSettings *part = part_v; - char r, *rule = rule_v; - - int n= rule - part->boidrule; - - if(n+1 < BOID_TOT_RULES) { - r=part->boidrule[n]; - part->boidrule[n]=part->boidrule[n+1]; - part->boidrule[n+1]=r; - } -} -static void boidrule_moveUp(void *part_v, void *rule_v) -{ - ParticleSettings *part = part_v; - char r, *rule = rule_v; - - int n= rule - part->boidrule; - - if(n-1 >= 0) { - r=part->boidrule[n]; - part->boidrule[n]=part->boidrule[n-1]; - part->boidrule[n-1]=r; - } -} -static void object_panel_particle_physics(Object *ob) -{ - uiBlock *block; - uiBut *but; - ParticleSystem *psys=psys_get_current(ob); - ParticleSettings *part; - short butx=0, buty=160, butw=150, buth=20; - - if (psys==NULL) return; - - part=psys->part; - - if(part==NULL) return; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_physics", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Physics", "Particle", 320, 0, 318, 204)==0) return; - - if(ob->id.lib) uiSetButLock(1, "Can't edit library data"); - - if(psys->flag & PSYS_EDITED || psys->flag & PSYS_PROTECT_CACHE) { - uiSetButLock(1, "Hair is edited or cache is protected!"); - } - - if(part->phystype==PART_PHYS_KEYED){ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PSYS_FIRST_KEYED, B_PART_RECALC, "First", butx,buty,45,buth, &psys->flag, 0, 0, 0, 0, "Sets the system to be the starting point of keyed particles"); - uiDefButS(block, MENU, B_PART_RECALC, "Physics %t|Boids%x3|Keyed %x2|Newtonian %x1|None %x0", butx+45,buty,butw-45,buth, &part->phystype, 14.0, 0.0, 0, 0, "Select particle physics type"); - uiBlockEndAlign(block); - } - else - uiDefButS(block, MENU, B_PART_RECALC, "Physics%t|Boids%x3|Keyed%x2|Newtonian%x1|None%x0", butx,buty,butw,buth, &part->phystype, 14.0, 0.0, 0, 0, "Select particle physics type"); - - if(part->phystype==PART_PHYS_BOIDS) { - int i; - char *rules[BOID_TOT_RULES] = {"Collision", "Avoid", "Crowd", "Center", "AvVel", "Velocity", "Goal", "Level"}; - char *ruletext[BOID_TOT_RULES] = { - "Avoid deflector objects", - "Avoid predators", - "Avoid other boids", - "Get to flock center", - "Maintain average velocity", - "Match velocity of nearby boids", - "Seek goal", - "Keep the Z level" - }; - /* left column */ - uiDefBut(block, LABEL, 0, "Behaviour:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - for(i=0; iboidrule+i); - - but = uiDefIconBut(block, BUT, B_PART_RECALC, VICON_MOVE_DOWN, butx+20, buty, 20, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Move rule down"); - uiButSetFunc(but, boidrule_moveDown, part, part->boidrule+i); - - uiBlockSetCol(block, TH_BUT_SETTING2); - - uiDefButF(block, NUM, B_PART_RECALC, rules[part->boidrule[i]], butx+40,buty,butw-40,buth, part->boidfac+part->boidrule[i], -1.0, 2.0, 1, 3, ruletext[part->boidrule[i]]); - } - uiBlockSetCol(block, TH_AUTO); - uiBlockEndAlign(block); - - buty=140; - butx=160; - - uiDefBut(block, LABEL, 0, "Physics:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PART_BOIDS_2D, B_PART_RECALC, "2D", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Constrain boids to a surface"); - uiDefButF(block, NUM, B_PART_RECALC, "MaxVelocity:", butx,(buty-=buth),butw,buth, &part->max_vel, 0.0, 200.0, 1, 3, "Maximum velocity"); - uiDefButF(block, NUM, B_PART_RECALC, "AvVelocity:", butx,(buty-=buth),butw,buth, &part->average_vel, 0.0, 1.0, 1, 3, "The usual speed % of max velocity"); - uiDefButF(block, NUM, B_PART_RECALC, "LatAcc:", butx,(buty-=buth),butw,buth, &part->max_lat_acc, 0.0, 1.0, 1, 3, "Lateral acceleration % of max velocity"); - uiDefButF(block, NUM, B_PART_RECALC, "TanAcc:", butx,(buty-=buth),butw,buth, &part->max_tan_acc, 0.0, 1.0, 1, 3, "Tangential acceleration % of max velocity"); - if(part->flag & PART_BOIDS_2D) { - uiDefButF(block, NUM, B_PART_RECALC, "GroundZ:", butx,(buty-=buth),butw,buth, &part->groundz, -100.0, 100.0, 1, 3, "Default Z value"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw,buth, &psys->keyed_ob, "Constrain boids to object's surface"); - } - else { - uiDefButF(block, NUM, B_PART_RECALC, "Banking:", butx,(buty-=buth),butw,buth, &part->banking, -10.0, 10.0, 1, 3, "Banking of boids on turns (1.0==natural banking)"); - uiDefButF(block, NUM, B_PART_RECALC, "MaxBank:", butx,(buty-=buth),butw,buth, &part->max_bank, 0.0, 1.0, 1, 3, "How much a boid can bank at a single step"); - } - uiBlockEndAlign(block); - uiDefButS(block, NUM, B_PART_RECALC, "N:", butx,(buty-=buth),butw,buth, &part->boidneighbours, 1.0, 10.0, 1, 3, "How many neighbours to consider for each boid"); - } - else { - /* left column */ - uiDefBut(block, LABEL, 0, "Initial velocity:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING2); - uiDefButF(block, NUM, B_PART_RECALC, "Object:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->obfac, -1.0, 1.0, 1, 3, "Let the object give the particle a starting speed"); - uiDefButF(block, NUM, B_PART_RECALC, "Normal:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->normfac, -200.0, 200.0, 1, 3, "Let the surface normal give the particle a starting speed"); - uiDefButF(block, NUM, B_PART_RECALC, "Random:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->randfac, 0.0, 200.0, 1, 3, "Give the starting speed a random variation"); - if(part->type==PART_REACTOR) { - uiDefButF(block, NUM, B_PART_RECALC, "Particle:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->partfac, -10.0, 10.0, 1, 3, "Let the target particle give the particle a starting speed"); - uiDefButF(block, NUM, B_PART_RECALC, "Reactor:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->reactfac, -10.0, 10.0, 1, 3, "Let the vector from target particle give the particle a starting speed"); - } - else { - uiDefButF(block, NUM, B_PART_RECALC, "Tan:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->tanfac, -200.0, 200.0, 1, 3, "Let the surface tangent give the particle a starting speed"); - uiDefButF(block, NUM, B_PART_RECALC, "Rot:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->tanphase, -1.0, 1.0, 1, 3, "Rotate the surface tangent"); - } - uiBlockSetCol(block, TH_AUTO); - uiBlockEndAlign(block); - - buty=160; - butx=160; - - if(part->phystype==PART_PHYS_NEWTON) - uiDefButS(block, MENU, B_PART_RECALC, "Integration%t|RK4%x2|Midpoint%x1|Euler%x0", butx,buty,butw,buth, &part->integrator, 14.0, 0.0, 0, 0, "Select physics integrator type"); - - uiDefBut(block, LABEL, 0, "Rotation:", butx, (buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PART_ROT_DYN, B_PART_RECALC, "Dynamic", butx,(buty-=buth*4/5),butw/2,buth*4/5, &part->flag, 0, 0, 0, 0, "Sets rotation to dynamic/constant"); - uiDefButS(block, MENU, B_PART_RECALC, "Rotation %t|Random %x3|Velocity %x2|Normal %x1|None %x0", butx+butw/2,buty,butw/2,buth*4/5, &part->rotmode, 14.0, 0.0, 0, 0, "Select particle rotation mode"); - uiBlockSetCol(block, TH_BUT_SETTING2); - uiDefButF(block, NUM, B_PART_RECALC, "Amount:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->rotfac, -1.0, 1.0, 1, 3, "Rotation amount"); - uiDefButF(block, NUM, B_PART_RECALC, "Phase:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->phasefac, -1.0, 1.0, 1, 3, "Initial rotation phase"); - uiBlockSetCol(block, TH_AUTO); - - uiDefButS(block, MENU, B_PART_RECALC, "Angular v %t|Velocity%x3|Random%x2|Spin%x1|None%x0", butx,(buty-=buth*4/5),butw,buth*4/5, &part->avemode, 14.0, 0.0, 0, 0, "Select particle angular velocity mode"); - uiBlockSetCol(block, TH_BUT_SETTING2); - uiDefButF(block, NUM, B_PART_RECALC, "Angular v:", butx,(buty-=buth*4/5),butw,buth*4/5, &part->avefac, -200.0, 200.0, 1, 3, "Angular velocity amount"); - uiBlockSetCol(block, TH_AUTO); - uiBlockEndAlign(block); - - if(part->phystype==PART_PHYS_NEWTON) { - butx=0; - buty=40; - uiDefBut(block, LABEL, 0, "Global effects:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, ""); - - butw=103; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_PART_RECALC, "AccX:", butx,(buty-=buth),butw,buth, part->acc, -200.0, 200.0, 10, 0, "Specify a constant acceleration along the X-axis"); - uiDefButF(block, NUM, B_PART_RECALC, "AccY:", butx+butw,buty,butw,buth, part->acc+1,-200.0, 200.0, 10, 0, "Specify a constant acceleration along the Y-axis"); - uiDefButF(block, NUM, B_PART_RECALC, "AccZ:", butx+2*butw,buty,butw+1,buth, part->acc+2, -200.0, 200.0, 10, 0, "Specify a constant acceleration along the Z-axis"); - - uiDefButF(block, NUM, B_PART_RECALC, "Drag:", butx,(buty-=buth),butw,buth, &part->dragfac, 0.0, 1.0, 1, 0, "Specify the amount of air-drag"); - uiDefButF(block, NUM, B_PART_RECALC, "Brown:", butx+butw,buty,butw,buth, &part->brownfac, 0.0, 200.0, 1, 0, "Specify the amount of brownian motion"); - uiDefButF(block, NUM, B_PART_RECALC, "Damp:", butx+2*butw,buty,butw+1,buth, &part->dampfac, 0.0, 1.0, 1, 0, "Specify the amount of damping"); - uiBlockEndAlign(block); - } - else if(part->phystype==PART_PHYS_KEYED) { - short totkpsys=1; - butx=0; - buty=40; - uiDefBut(block, LABEL, 0, "Keyed Target:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, ""); - if(psys->keyed_ob){ - if(psys->keyed_ob==ob || BLI_findlink(&psys->keyed_ob->particlesystem,psys->keyed_psys-1)==0) - uiBlockSetCol(block, TH_REDALERT); - else - totkpsys = BLI_countlist(&psys->keyed_ob->particlesystem); - } - else - uiBlockSetCol(block, TH_REDALERT); - - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw*2/3,buth, &psys->keyed_ob, "The object that has the target particle system"); - uiDefButS(block, NUM, B_PARTTARGET, "Psys:", butx+butw*2/3,buty,butw/3,buth, &psys->keyed_psys, 1.0, totkpsys, 0, 0, "The target particle system number in the object"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_AUTO); - - butx=160; - - if(psys->flag & PSYS_FIRST_KEYED) - uiDefButBitI(block, TOG, PSYS_KEYED_TIME, B_PART_RECALC, "Timed", butx,buty,butw,buth, &psys->flag, 0, 0, 0, 0, "Use intermediate key times"); - else - uiDefButF(block, NUMSLI, B_PART_RECALC, "Time:", butx,buty,butw,buth, &part->keyed_time, 0.0, 1.0, 1, 3, "Keyed key time relative to remaining particle life"); - } - } -} - -static void psys_clear_cache(void *ob_v, void *psys_v) -{ - clear_particles_from_cache((Object *)ob_v, (ParticleSystem *)psys_v, CFRA); -} -static void object_panel_particle_system(Object *ob) -{ - uiBlock *block; - uiBut *but; - ParticleSystem *psys=NULL; - ParticleSettings *part; - ID *id, *idfrom; - short butx=0, buty=160, butw=150, buth=20; - char str[30]; - static short partact; - short totpart; - - block= uiNewBlock(&curarea->uiblocks, "object_panel_particle_system", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Particle System", "Particle", 0, 0, 318, 204)==0) return; - - if(ob->id.lib) uiSetButLock(1, "Can't edit library data"); - - if(ELEM4(ob->type,OB_MESH,OB_FONT,OB_CURVE,OB_SURF)==0) { - uiDefBut(block, LABEL, 0, "Only Mesh or Curve Objects can generate particles", 10,180,300,20, NULL, 0.0, 0, 0, 0, ""); - return; - } - psys=psys_get_current(ob); - - if(psys) - id=(ID*)(psys->part); - else - id=NULL; - idfrom=&ob->id; - - /* browse buttons */ - uiBlockSetCol(block, TH_BUT_SETTING2); - butx= std_libbuttons(block, butx, buty, 0, NULL, B_PARTBROWSE, ID_PA, 0, id, idfrom, &(G.buts->menunr), B_PARTALONE, 0, B_PARTDELETE, 0, 0); - - partact=psys_get_current_num(ob)+1; - totpart=BLI_countlist(&ob->particlesystem); - sprintf(str, "%d Part", totpart); - but=uiDefButS(block, NUM, B_PARTACT, str, 224,buty,88,buth, &partact, 1.0, totpart+1, 0, 0, "Shows the number of particle systems in the object and the active particle system"); - uiButSetFunc(but, PE_change_act, ob, &partact); - - if(psys==NULL) - return; - - part=psys->part; - - if(part==NULL) return; - - butx=0; - buty-=5; - - uiDefButBitI(block, TOG, PSYS_ENABLED, B_PART_ENABLE, "Enabled", 0,(buty-=buth),100,buth, &psys->flag, 0, 0, 0, 0, "Sets particle system to be calculated and shown"); - - if(part->type == PART_HAIR){ - if(psys->flag & PSYS_EDITED) - uiDefBut(block, BUT, B_PART_EDITABLE, "Free Edit", 105,buty,100,buth, NULL, 0.0, 0.0, 10, 0, "Free editing"); - else - uiDefBut(block, BUT, B_PART_EDITABLE, "Set Editable", 105,buty,100,buth, NULL, 0.0, 0.0, 10, 0, "Finalize hair to enable editing in particle mode"); - - } - else { - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PSYS_PROTECT_CACHE, B_PART_REDRAW, "Protect", 105,buty,50,buth, &psys->flag, 0.0, 0.0, 10, 0, "Protect the cache"); - but=uiDefBut(block, BUT, B_PART_RECALC, "Clear", 155,buty,50,buth, NULL, 0.0, 0.0, 10, 0, "Clear the cache"); - if((psys->flag & PSYS_PROTECT_CACHE)==0) - uiButSetFunc(but, psys_clear_cache, ob, &partact); - - uiBlockEndAlign(block); - } - - if(psys->flag & PSYS_EDITED || psys->flag & PSYS_PROTECT_CACHE) { - uiSetButLock(1, "Hair is edited or cache is protected!"); - } - - uiDefButS(block, MENU, B_PARTTYPE, "Type%t|Hair%x2|Reactor%x1|Emitter%x0", 210,buty,100,buth, &part->type, 14.0, 0.0, 0, 0, "Type of particle system"); - - buty-=5; - uiDefBut(block, LABEL, 0, "Basic:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - - if(part->distr==PART_DISTR_GRID) - uiDefButI(block, NUM, B_PART_ALLOC, "Resol:", butx,(buty-=buth),butw,buth, &part->grid_res, 1.0, 100.0, 0, 0, "The resolution of the particle grid"); - else - uiDefButI(block, NUM, B_PART_ALLOC, "Amount:", butx,(buty-=buth),butw,buth, &part->totpart, 0.0, 100000.0, 0, 0, "The total number of particles"); - if(part->type==PART_REACTOR) { - uiDefButBitI(block, TOG, PART_REACT_STA_END, B_PART_INIT, "Sta/End", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Give birth to unreacted particles eventually"); - uiDefButS(block, MENU, B_PART_RECALC, "React on %t|Near %x2|Collision %x1|Death %x0", butx+butw/2,buty,butw/2,buth, &part->reactevent, 14.0, 0.0, 0, 0, "The event of target particles to react"); - if(part->flag&PART_REACT_STA_END) { - uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, 1.0, part->end, 100, 1, "Frame # to start emitting particles"); - uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles"); - } - if(part->from!=PART_FROM_PARTICLE) { - uiDefButBitI(block, TOG, PART_REACT_MULTIPLE, B_PART_RECALC, "Multi React", butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "React multiple times"); - uiDefButF(block, NUM, B_PART_RECALC, "Shape:", butx,(buty-=buth),butw,buth, &part->reactshape, 0.0, 10.0, 100, 1, "Power of reaction strength dependence on distance to target"); - } - } - else if(part->type==PART_HAIR) { - uiDefButS(block, NUM, B_PART_RECALC, "Segments:", butx,(buty-=buth),butw,buth, &part->hair_step, 2.0, 50.0, 0, 0, "Amount of hair segments"); - } - else { - uiDefButF(block, NUM, B_PART_INIT, "Sta:", butx,(buty-=buth),butw,buth, &part->sta, 1.0, part->end, 100, 1, "Frame # to start emitting particles"); - uiDefButF(block, NUM, B_PART_INIT, "End:", butx,(buty-=buth),butw,buth, &part->end, part->sta, MAXFRAMEF, 100, 1, "Frame # to stop emitting particles"); - } - - if(part->type!=PART_HAIR) { - uiDefButF(block, NUM, B_PART_INIT, "Life:", butx,(buty-=buth),butw,buth, &part->lifetime, 1.0, MAXFRAMEF, 100, 1, "Specify the life span of the particles"); - uiDefButF(block, NUM, B_PART_INIT, "Rand:", butx,(buty-=buth),butw,buth, &part->randlife, 0.0, 2.0, 10, 1, "Give the particle life a random variation"); - } - - uiBlockEndAlign(block); - - butx=160; - buty=120; - - buty-=10; - - uiDefBut(block, LABEL, 0, "Emit From:", butx,buty,butw,buth, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, PART_TRAND, B_PART_DISTR, "Random", butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Emit in random order of elements"); - - if(part->type==PART_REACTOR) - uiDefButS(block, MENU, B_PART_DISTR, "Particle %x3|Volume %x2|Faces %x1|Verts %x0", butx+butw/2,buty,butw/2,buth, &part->from, 14.0, 0.0, 0, 0, "Where to emit particles from"); - else - uiDefButS(block, MENU, B_PART_DISTR, "Volume %x2|Faces %x1|Verts%x0", butx+butw/2,buty,butw/2,buth, &part->from, 14.0, 0.0, 0, 0, "Where to emit particles from"); - - if(ELEM(part->from,PART_FROM_FACE,PART_FROM_VOLUME)) { - uiDefButBitI(block, TOG, PART_EDISTR, B_PART_DISTR, "Even",butx,(buty-=buth),butw/2,buth, &part->flag, 0, 0, 0, 0, "Use even distribution from faces based on face areas or edge lengths"); - uiDefButS(block, MENU, B_PART_DISTR, "Distribution %t|Grid%x2|Random%x1|Jittered%x0", butx+butw/2,buty,butw/2,buth, &part->distr, 14.0, 0.0, 0, 0, "How to distribute particles on selected element"); - if(part->distr==PART_DISTR_JIT) { - uiDefButF(block, NUM, B_PART_DISTR, "Amount:", butx,(buty-=buth),butw,buth, &part->jitfac, 0, 2.0, 1, 1, "Amount of jitter applied to the sampling"); - uiDefButI(block, NUM, B_PART_DISTR, "P/F:", butx,(buty-=buth),butw,buth, &part->userjit, 0, 1000.0, 1, 1, "Emission locations / face (0 = automatic)"); - } - if(part->distr==PART_DISTR_GRID){ - uiDefButBitI(block, TOG, PART_GRID_INVERT, B_PART_DISTR, "Invert",butx,(buty-=buth),butw,buth, &part->flag, 0, 0, 0, 0, "Invert what is considered object and what is not."); - } - } - uiBlockEndAlign(block); - - buty=50; - - if(part->type==PART_REACTOR) { - ParticleSystem *tpsys=0; - Object *tob=0; - int tottpsys; - - uiDefBut(block, LABEL, 0, "Target:", butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, ""); - - if(psys->target_ob) - tob=psys->target_ob; - else - tob=ob; - - tottpsys=BLI_countlist(&tob->particlesystem); - - uiBlockBeginAlign(block); - - if(tob->particlesystem.first==0) - uiBlockSetCol(block, TH_REDALERT); - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_PARTTARGET, "OB:", butx,(buty-=buth),butw*2/3,buth, &psys->target_ob, "The object that has the target particle system (empty if same object)"); - - tpsys=BLI_findlink(&tob->particlesystem,psys->target_psys-1); - if(tpsys) { - if(tob==ob && tpsys==psys) - uiBlockSetCol(block, TH_REDALERT); - } - else - uiBlockSetCol(block, TH_REDALERT); - - uiDefButS(block, NUM, B_PARTTARGET, "Psys:", butx+butw*2/3,buty,butw/3,buth, &psys->target_psys, 1.0, tottpsys, 0, 0, "The target particle system number in the object"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_AUTO); - } -} - -/* NT - Panel for fluidsim settings */ -static void object_panel_fluidsim(Object *ob) -{ -#ifndef DISABLE_ELBEEM - uiBlock *block; - int yline = 160; - const int lineHeight = 20; - const int separateHeight = 3; - const int objHeight = 20; - char *msg = NULL; - - block= uiNewBlock(&curarea->uiblocks, "object_fluidsim", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Fluid Simulation", "Physics", 1060, 0, 318, 204)==0) return; - - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(ob->type==OB_MESH) { - if(((Mesh *)ob->data)->totvert == 0) { - msg = "Mesh has no vertices."; - goto errMessage; - } - uiDefButBitS(block, TOG, OB_FLUIDSIM_ENABLE, REDRAWBUTSOBJECT, "Enable", 0,yline, 75,objHeight, - &ob->fluidsimFlag, 0, 0, 0, 0, "Sets object to participate in fluid simulation"); - - if(ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) { - FluidsimSettings *fss= ob->fluidsimSettings; - - if(fss==NULL) { - fss = ob->fluidsimSettings = fluidsimSettingsNew(ob); - } - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Domain", 90, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_DOMAIN, 20.0, 1.0, "Bounding box of this object represents the computational domain of the fluid simulation."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Fluid", 160, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_FLUID, 20.0, 2.0, "Object represents a volume of fluid in the simulation."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Obstacle", 230, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OBSTACLE,20.0, 3.0, "Object is a fixed obstacle."); - yline -= lineHeight; - - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Inflow", 90, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_INFLOW, 20.0, 4.0, "Object adds fluid to the simulation."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Outflow", 160, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_OUTFLOW, 20.0, 5.0, "Object removes fluid from the simulation."); - uiDefButS(block, ROW, B_FLUIDSIM_MAKEPART ,"Particle", 230, yline, 70,objHeight, &fss->type, 15.0, OB_FLUIDSIM_PARTICLE,20.0, 3.0, "Object is made a particle system to display particles generated by a fluidsim domain object."); - uiBlockEndAlign(block); - yline -= lineHeight; - yline -= 2*separateHeight; - - /* display specific settings for each type */ - if(fss->type == OB_FLUIDSIM_DOMAIN) { - const int maxRes = 512; - char memString[32]; - - // use mesh bounding box and object scaling - // TODO fix redraw issue - elbeemEstimateMemreq(fss->resolutionxyz, - ob->fluidsimSettings->bbSize[0],ob->fluidsimSettings->bbSize[1],ob->fluidsimSettings->bbSize[2], fss->maxRefine, memString); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, REDRAWBUTSOBJECT, "Std", 0,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 0, 20.0, 0, "Show standard domain options."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT, "Adv", 25,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 1, 20.0, 1, "Show advanced domain options."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT, "Bnd", 50,yline, 25,objHeight, &fss->show_advancedoptions, 16.0, 2, 20.0, 2, "Show domain boundary options."); - uiBlockEndAlign(block); - - uiDefBut(block, BUT, B_FLUIDSIM_BAKE, "BAKE",90, yline,210,objHeight, NULL, 0.0, 0.0, 10, 0, "Perform simulation and output and surface&preview meshes for each frame."); - yline -= lineHeight; - yline -= 2*separateHeight; - - if(fss->show_advancedoptions == 0) { - uiDefBut(block, LABEL, 0, "Req. BAKE Memory:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, memString, 200,yline,100,objHeight, NULL, 0.0, 0, 0, 0, ""); - yline -= lineHeight; - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, REDRAWBUTSOBJECT, "Resolution:", 0, yline,150,objHeight, &fss->resolutionxyz, 1, maxRes, 10, 0, "Domain resolution in X, Y and Z direction"); - uiDefButS(block, NUM, B_DIFF, "Preview-Res.:", 150, yline,150,objHeight, &fss->previewresxyz, 1, 100, 10, 0, "Resolution of the preview meshes to generate, also in X, Y and Z direction"); - uiBlockEndAlign(block); - yline -= lineHeight; - yline -= 1*separateHeight; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_DIFF, "Start time:", 0, yline,150,objHeight, &fss->animStart, 0.0, 100.0, 10, 0, "Simulation time of the first blender frame."); - uiDefButF(block, NUM, B_DIFF, "End time:", 150, yline,150,objHeight, &fss->animEnd , 0.0, 100.0, 10, 0, "Simulation time of the last blender frame."); - uiBlockEndAlign(block); - yline -= lineHeight; - yline -= 2*separateHeight; - - if((fss->guiDisplayMode<1) || (fss->guiDisplayMode>3)){ fss->guiDisplayMode=2; } // can be changed by particle setting - uiDefBut(block, LABEL, 0, "Disp.-Qual.:", 0,yline, 90,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_FLUIDSIM_FORCEREDRAW, "GuiDisplayMode%t|Geometry %x1|Preview %x2|Final %x3", - 90,yline,105,objHeight, &fss->guiDisplayMode, 0, 0, 0, 0, "How to display the fluid mesh in the Blender GUI."); - uiDefButS(block, MENU, B_DIFF, "RenderDisplayMode%t|Geometry %x1|Preview %x2|Final %x3", - 195,yline,105,objHeight, &fss->renderDisplayMode, 0, 0, 0, 0, "How to display the fluid mesh for rendering."); - uiBlockEndAlign(block); - yline -= lineHeight; - yline -= 1*separateHeight; - - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_FLUIDSIM_SELDIR, ICON_FILESEL, 0, yline, 20, objHeight, 0, 0, 0, 0, 0, "Select Directory (and/or filename prefix) to store baked fluid simulation files in"); - uiDefBut(block, TEX, B_FLUIDSIM_FORCEREDRAW,"", 20, yline, 280, objHeight, fss->surfdataPath, 0.0,79.0, 0, 0, "Enter Directory (and/or filename prefix) to store baked fluid simulation files in"); - uiBlockEndAlign(block); - // FIXME what is the 79.0 above? - } else if(fss->show_advancedoptions == 1) { - // advanced options - uiDefBut(block, LABEL, 0, "Gravity:", 0, yline, 90,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_DIFF, "X:", 90, yline, 70,objHeight, &fss->gravx, -1000.1, 1000.1, 10, 0, "Gravity in X direction"); - uiDefButF(block, NUM, B_DIFF, "Y:", 160, yline, 70,objHeight, &fss->gravy, -1000.1, 1000.1, 10, 0, "Gravity in Y direction"); - uiDefButF(block, NUM, B_DIFF, "Z:", 230, yline, 70,objHeight, &fss->gravz, -1000.1, 1000.1, 10, 0, "Gravity in Z direction"); - uiBlockEndAlign(block); - yline -= lineHeight; - yline -= 1*separateHeight; - - /* viscosity */ - if (fss->viscosityMode==1) /*manual*/ - uiBlockBeginAlign(block); - uiDefButS(block, MENU, REDRAWVIEW3D, "Viscosity%t|Manual %x1|Water %x2|Oil %x3|Honey %x4", - 0,yline, 90,objHeight, &fss->viscosityMode, 0, 0, 0, 0, "Set viscosity of the fluid to a preset value, or use manual input."); - if(fss->viscosityMode==1) { - uiDefButF(block, NUM, B_DIFF, "Value:", 90, yline, 105,objHeight, &fss->viscosityValue, 0.0, 10.0, 10, 0, "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)."); - uiDefButS(block, NUM, B_DIFF, "Neg-Exp.:", 195, yline, 105,objHeight, &fss->viscosityExponent, 0, 10, 10, 0, "Negative exponent for the viscosity value (to simplify entering small values e.g. 5*10^-6."); - uiBlockEndAlign(block); - } else { - // display preset values - uiDefBut(block, LABEL, 0, fluidsimViscosityPresetString[fss->viscosityMode], 90,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - } - yline -= lineHeight; - yline -= 1*separateHeight; - - uiDefBut(block, LABEL, 0, "Realworld-size:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 150, yline,150,objHeight, &fss->realsize, 0.001, 10.0, 10, 0, "Size of the simulation domain in meters."); - yline -= lineHeight; - yline -= 2*separateHeight; - - uiDefBut(block, LABEL, 0, "Gridlevels:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButI(block, NUM, B_DIFF, "", 150, yline,150,objHeight, &fss->maxRefine, -1, 4, 10, 0, "Number of coarsened Grids to use (set to -1 for automatic selection)."); - yline -= lineHeight; - - uiDefBut(block, LABEL, 0, "Compressibility:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 150, yline,150,objHeight, &fss->gstar, 0.001, 0.10, 10,0, "Allowed compressibility due to gravitational force for standing fluid (directly affects simulation step size)."); - yline -= lineHeight; - - } else if(fss->show_advancedoptions == 2) { - // copied from obstacle... - //yline -= lineHeight + 5; - //uiDefBut(block, LABEL, 0, "Domain boundary type settings:", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, ""); - //yline -= lineHeight; - - uiBlockBeginAlign(block); // domain - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Noslip", 0, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_NOSLIP, 20.0, 1.0, "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Part", 100, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_PARTSLIP, 20.0, 2.0, "Mix between no-slip and free-slip. Non moving objects only!"); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Free", 200, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_FREESLIP, 20.0, 3.0, "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!"); - uiBlockEndAlign(block); - yline -= lineHeight; - - if(fss->typeFlags&OB_FSBND_PARTSLIP) { - uiDefBut(block, LABEL, 0, "PartSlipValue:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->partSlipValue, 0.0, 1.0, 10,0, "."); - yline -= lineHeight; - } else { - //uiDefBut(block, LABEL, 0, "-", 200,yline,100,objHeight, NULL, 0.0, 0, 0, 0, ""); - } - // copied from obstacle... - - uiDefBut(block, LABEL, 0, "Tracer Particles:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButI(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->generateTracers, 0.0, 10000.0, 10,0, "Number of tracer particles to generate."); - yline -= lineHeight; - uiDefBut(block, LABEL, 0, "Generate Particles:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->generateParticles, 0.0, 10.0, 10,0, "Amount of particles to generate (0=off, 1=normal, >1=more)."); - yline -= lineHeight; - uiDefBut(block, LABEL, 0, "Surface Subdiv:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButI(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->surfaceSubdivs, 0.0, 5.0, 10,0, "Number of isosurface subdivisions. This is necessary for the inclusion of particles into the surface generation. Warning - can lead to longer computation times!"); - yline -= lineHeight; - - uiDefBut(block, LABEL, 0, "Surface Smoothing:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->surfaceSmoothing, 0.0, 5.0, 10,0, "Amount of surface smoothing (0=off, 1=normal, >1=stronger smoothing)."); - yline -= lineHeight; - - // use new variable... - uiDefBut(block, LABEL, 0, "Generate&Use SpeedVecs:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitC(block, TOG, 1, REDRAWBUTSOBJECT, "Disable", 200, yline,100,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Default is to generate and use fluidsim vertex speed vectors, this option switches calculation off during bake, and disables loading."); - yline -= lineHeight; - } // domain 3 - } - else if( - (fss->type == OB_FLUIDSIM_FLUID) - || (fss->type == OB_FLUIDSIM_INFLOW) - ) { - uiBlockBeginAlign(block); // fluid - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Volume", 0, yline,100,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Shell", 100, yline,100,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Both", 200, yline,100,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell."); - uiBlockEndAlign(block); - yline -= lineHeight; - - yline -= lineHeight + 5; // fluid + inflow - if(fss->type == OB_FLUIDSIM_FLUID) uiDefBut(block, LABEL, 0, "Initial velocity:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - if(fss->type == OB_FLUIDSIM_INFLOW) uiDefBut(block, LABEL, 0, "Inflow velocity:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - yline -= lineHeight; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_DIFF, "X:", 0, yline, 100,objHeight, &fss->iniVelx, -1000.1, 1000.1, 10, 0, "Fluid velocity in X direction"); - uiDefButF(block, NUM, B_DIFF, "Y:", 100, yline, 100,objHeight, &fss->iniVely, -1000.1, 1000.1, 10, 0, "Fluid velocity in Y direction"); - uiDefButF(block, NUM, B_DIFF, "Z:", 200, yline, 100,objHeight, &fss->iniVelz, -1000.1, 1000.1, 10, 0, "Fluid velocity in Z direction"); - uiBlockEndAlign(block); - yline -= lineHeight; - - if(fss->type == OB_FLUIDSIM_INFLOW) { // inflow - uiDefBut(block, LABEL, 0, "Local Inflow Coords", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitS(block, TOG, OB_FSINFLOW_LOCALCOORD, REDRAWBUTSOBJECT, "Enable", 200, yline,100,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Use local coordinates for inflow (e.g. for rotating objects)."); - yline -= lineHeight; - } else { - } - - // domainNovecgen "misused" here - uiDefBut(block, LABEL, 0, "Animated Mesh:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitC(block, TOG, 1, REDRAWBUTSOBJECT, "Export", 200, yline,100,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it."); - yline -= lineHeight; - - } // fluid inflow - else if( (fss->type == OB_FLUIDSIM_OUTFLOW) ) { - yline -= lineHeight + 5; - - uiBlockBeginAlign(block); // outflow - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Volume", 0, yline,100,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Shell", 100, yline,100,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Both", 200, yline,100,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell."); - uiBlockEndAlign(block); - yline -= lineHeight; - - // domainNovecgen "misused" here - uiDefBut(block, LABEL, 0, "Animated Mesh:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitC(block, TOG, 1, REDRAWBUTSOBJECT, "Export", 200, yline,100,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated pos/rot/scale IPOs do not require it."); - yline -= lineHeight; - - //uiDefBut(block, LABEL, 0, "No additional settings as of now...", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, ""); - } - else if( (fss->type == OB_FLUIDSIM_OBSTACLE) ) { - yline -= lineHeight + 5; // obstacle - - uiBlockBeginAlign(block); // obstacle - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Volume", 0, yline,100,objHeight, &fss->volumeInitType, 15.0, 1, 20.0, 1.0, "Type of volume init: use only inner region of mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Shell", 100, yline,100,objHeight, &fss->volumeInitType, 15.0, 2, 20.0, 2.0, "Type of volume init: use only the hollow shell defined by the faces of the mesh."); - uiDefButC(block, ROW, REDRAWBUTSOBJECT ,"Init Both", 200, yline,100,objHeight, &fss->volumeInitType, 15.0, 3, 20.0, 3.0, "Type of volume init: use both the inner volume and the outer shell."); - uiBlockEndAlign(block); - yline -= lineHeight; - - uiBlockBeginAlign(block); // obstacle - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Noslip", 0, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_NOSLIP, 20.0, 1.0, "Obstacle causes zero normal and tangential velocity (=sticky). Default for all. Only option for moving objects."); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Part", 100, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_PARTSLIP, 20.0, 2.0, "Mix between no-slip and free-slip. Non moving objects only!"); - uiDefButS(block, ROW, REDRAWBUTSOBJECT ,"Free", 200, yline,100,objHeight, &fss->typeFlags, 15.0, OB_FSBND_FREESLIP, 20.0, 3.0, "Obstacle only causes zero normal velocity (=not sticky). Non moving objects only!"); - uiBlockEndAlign(block); - yline -= lineHeight; - - // domainNovecgen "misused" here - uiDefBut(block, LABEL, 0, "Animated Mesh:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButBitC(block, TOG, 1, REDRAWBUTSOBJECT, "Export", 200, yline,100,objHeight, &fss->domainNovecgen, 0, 0, 0, 0, "Export this mesh as an animated one. Slower, only use if really necessary (e.g. armatures or parented objects), animated loc/rot/scale IPOs do not require it."); - yline -= lineHeight; - - uiDefBut(block, LABEL, 0, "PartSlip Amount:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - if(fss->typeFlags&OB_FSBND_PARTSLIP) { - uiDefButF(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->partSlipValue, 0.0, 1.0, 10,0, "Amount of mixing between no- and free-slip, 0=stickier, 1=same as free slip."); - } else { uiDefBut(block, LABEL, 0, "-", 200,yline,100,objHeight, NULL, 0.0, 0, 0, 0, ""); } - yline -= lineHeight; - - // generateParticles "misused" here - uiDefBut(block, LABEL, 0, "Impact Factor:", 0,yline,200,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 200, yline,100,objHeight, &fss->surfaceSmoothing, -2.0, 10.0, 10,0, "This is an unphysical value for moving objects - it controls the impact an obstacle has on the fluid, =0 behaves a bit like outflow (deleting fluid), =1 is default, while >1 results in high forces. Can be used to tweak total mass."); - yline -= lineHeight; - - yline -= lineHeight; // obstacle - } - else if(fss->type == OB_FLUIDSIM_PARTICLE) { - - //fss->type == 0; // off, broken... - if(1) { - // limited selection, old fixed: fss->typeFlags = (1<<5)|(1<<1); -# define PARTBUT_WIDTH (300/3) - uiDefButBitS(block, TOG, (1<<2) , REDRAWBUTSOBJECT, "Drops", 0*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show drop particles."); - uiDefButBitS(block, TOG, (1<<4) , REDRAWBUTSOBJECT, "Floats", 1*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show floating foam particles."); - uiDefButBitS(block, TOG, (1<<5) , REDRAWBUTSOBJECT, "Tracer", 2*PARTBUT_WIDTH, yline, PARTBUT_WIDTH,objHeight, &fss->typeFlags, 0, 0, 0, 0, "Show tracer particles."); - yline -= lineHeight; -# undef PARTBUT_WIDTH - - - uiDefBut(block, LABEL, 0, "Size Influence:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 150, yline,150,objHeight, &fss->particleInfSize, 0.0, 2.0, 10,0, "Amount of particle size scaling: 0=off (all same size), 1=full (range 0.2-2.0), >1=stronger."); - yline -= lineHeight; - uiDefBut(block, LABEL, 0, "Alpha Influence:", 0,yline,150,objHeight, NULL, 0.0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_DIFF, "", 150, yline,150,objHeight, &fss->particleInfAlpha, 0.0, 2.0, 10,0, "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)."); - yline -= lineHeight; - - yline -= 1*separateHeight; - - // FSPARTICLE also select input files - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_FLUIDSIM_SELDIR, ICON_FILESEL, 0, yline, 20, objHeight, 0, 0, 0, 0, 0, "Select fluid simulation bake directory/prefix to load particles from, same as for domain object."); - uiDefBut(block, TEX, B_FLUIDSIM_FORCEREDRAW,"", 20, yline, 280, objHeight, fss->surfdataPath, 0.0,79.0, 0, 0, "Enter fluid simulation bake directory/prefix to load particles from, same as for domain object."); - uiBlockEndAlign(block); - yline -= lineHeight; - } // disabled for now... - - } - else { - yline -= lineHeight + 5; - /* not yet set */ - uiDefBut(block, LABEL, 0, "Select object type for simulation", 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, ""); - yline -= lineHeight; - } - return; - - } else { - msg = "Object not enabled for fluid simulation..."; - } - } else { - msg = "Only Mesh Objects can participate."; - } -errMessage: - yline -= lineHeight + 5; - uiDefBut(block, LABEL, 0, msg, 0,yline,300,objHeight, NULL, 0.0, 0, 0, 0, ""); - yline -= lineHeight; - -#endif // DISABLE_ELBEEM -} - -void object_panels() -{ - Object *ob; - - /* check context here */ - ob= OBACT; - if(ob) { - object_panel_object(ob); - object_panel_anim(ob); - object_panel_draw(ob); - object_panel_constraint("Object"); - - uiClearButLock(); - } -} - -void physics_panels() -{ - Object *ob; - - /* check context here */ - ob= OBACT; - if(ob) { - if(ob->type==OB_MESH) - object_panel_deflection(ob); - object_panel_fields(ob); - object_softbodies(ob); - object_softbodies_II(ob); - object_panel_fluidsim(ob); - } -} -void particle_panels() -{ - Object *ob; - ParticleSystem *psys; - - ob=OBACT; - - if(ob && ob->type==OB_MESH) { - object_panel_particle_system(ob); - - psys=psys_get_current(ob); - - if(psys){ - object_panel_particle_physics(ob); - object_panel_particle_visual(ob); - object_panel_particle_simplification(ob); - object_panel_particle_extra(ob); - object_panel_particle_children(ob); - } - } -} diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c deleted file mode 100644 index 8fd74ddc08e..00000000000 --- a/source/blender/src/buttons_scene.c +++ /dev/null @@ -1,2082 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#include "MEM_guardedalloc.h" -#include "DNA_node_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_userdef_types.h" -#include "DNA_packedFile_types.h" - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_node.h" -#include "BKE_library.h" -#include "BKE_scene.h" -#include "BKE_sound.h" -#include "BKE_packedFile.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" - -#include "BSE_filesel.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_imasel.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_mywindow.h" -#include "BIF_meshtools.h" -#include "BIF_resources.h" -#include "BIF_renderwin.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BIF_butspace.h" - -#include "mydevice.h" -#include "blendef.h" - -/* -----includes for this file specific----- */ - -#include "DNA_image_types.h" - -#include "BKE_writeavi.h" -#include "BKE_writeffmpeg.h" -#include "BKE_image.h" - -#include "BLI_threads.h" - -#include "BIF_editsound.h" -#include "BIF_writeimage.h" -#include "BIF_writeavicodec.h" - -#include "BSE_seqaudio.h" -#include "BSE_headerbuttons.h" - -#include "RE_pipeline.h" - -#include "butspace.h" // own module - -#ifdef WITH_QUICKTIME -#include "quicktime_export.h" -#endif - -#ifdef WITH_FFMPEG - -#include /* for PIX_FMT_* and CODEC_ID_* */ -#include - -static int ffmpeg_preset_sel = 0; - -extern int is_container(int); - -extern void makeffmpegstring(char* string); - -#endif - -/* here the calls for scene buttons - - render - - world - - anim settings, audio -*/ - -/* prototypes */ -void playback_anim(void); - -/* ************************ SOUND *************************** */ -static void load_new_sample(char *str) /* called from fileselect */ -{ - char name[FILE_MAX]; - bSound *sound; - bSample *sample, *newsample; - - sound = G.buts->lockpoin; - - if (sound) { - // save values - sample = sound->sample; - strcpy(name, sound->sample->name); - - strcpy(sound->name, str); - sound_set_sample(sound, NULL); - sound_initialize_sample(sound); - - if (sound->sample->type == SAMPLE_INVALID) { - error("Not a valid sample: %s", str); - - newsample = sound->sample; - - // restore values - strcpy(sound->name, name); - sound_set_sample(sound, sample); - - // remove invalid sample - - sound_free_sample(newsample); - BLI_remlink(samples, newsample); - MEM_freeN(newsample); - } - } - - BIF_undo_push("Load new audio file"); - allqueue(REDRAWBUTSSCENE, 0); - -} - - -void do_soundbuts(unsigned short event) -{ - char name[FILE_MAX]; - bSound *sound; - bSample *sample; - bSound* tempsound; - ID *id; - - sound = G.buts->lockpoin; - - switch(event) { - case B_SOUND_REDRAW: - allqueue(REDRAWBUTSSCENE, 0); - break; - - case B_SOUND_LOAD_SAMPLE: - if (sound) strcpy(name, sound->name); - else strcpy(name, U.sounddir); - - activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, load_new_sample); - break; - - case B_SOUND_PLAY_SAMPLE: - if (sound) { - if (sound->sample->type != SAMPLE_INVALID) { - sound_play_sound(sound); - allqueue(REDRAWBUTSSCENE, 0); - } - } - break; - - case B_SOUND_MENU_SAMPLE: - if (G.buts->menunr > 0) { - sample = BLI_findlink(samples, G.buts->menunr - 1); - if (sample && sound) { - BLI_strncpy(sound->name, sample->name, sizeof(sound->name)); - sound_set_sample(sound, sample); - do_soundbuts(B_SOUND_REDRAW); - } - } - - break; - case B_SOUND_NAME_SAMPLE: - load_new_sample(sound->name); - break; - - case B_SOUND_UNPACK_SAMPLE: - if(sound && sound->sample) { - sample = sound->sample; - - if (sample->packedfile) { - if (G.fileflags & G_AUTOPACK) { - if (okee("Disable AutoPack ?")) { - G.fileflags &= ~G_AUTOPACK; - } - } - - if ((G.fileflags & G_AUTOPACK) == 0) { - unpackSample(sample, PF_ASK); - } - } else { - sound_set_packedfile(sample, newPackedFile(sample->name)); - } - allqueue(REDRAWHEADERS, 0); - do_soundbuts(B_SOUND_REDRAW); - } - break; - - case B_SOUND_COPY_SOUND: - if (sound) { - tempsound = sound_make_copy(sound); - sound = tempsound; - id = &sound->id; - G.buts->lockpoin = (bSound*)id; - BIF_undo_push("Copy sound"); - do_soundbuts(B_SOUND_REDRAW); - } - break; - - case B_SOUND_RECALC: - waitcursor(1); - sound = G.main->sound.first; - while (sound) { - free(sound->stream); - sound->stream = 0; - audio_makestream(sound); - sound = (bSound *) sound->id.next; - } - waitcursor(0); - allqueue(REDRAWSEQ, 0); - break; - - case B_SOUND_RATECHANGED: - - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWSEQ, 0); - break; - - case B_SOUND_MIXDOWN: - audio_mixdown(); - break; - - default: - if (G.f & G_DEBUG) { - printf("do_soundbuts: unhandled event %d\n", event); - } - } -} - - -static void sound_panel_listener(void) -{ - uiBlock *block; - int xco= 100, yco=100, mixrate; - char mixrateinfo[256]; - - block= uiNewBlock(&curarea->uiblocks, "sound_panel_listener", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Listener", "Sound", 320, 0, 318, 204)==0) return; - - mixrate = sound_get_mixrate(); - sprintf(mixrateinfo, "Game Mixrate: %d Hz", mixrate); - uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, ""); - - yco -= 30; - uiDefBut(block, LABEL, 0, "Game listener settings:",xco,yco,195,20, 0, 0, 0, 0, 0, ""); - - yco -= 30; - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ", - xco,yco,195,24,&G.listener->gain, 0.0, 1.0, 1.0, 0, "Sets the maximum volume for the overall sound"); - - yco -= 30; - uiDefBut(block, LABEL, 0, "Game Doppler effect settings:",xco,yco,195,20, 0, 0, 0, 0, 0, ""); - - yco -= 30; - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Doppler: ", - xco,yco,195,24,&G.listener->dopplerfactor, 0.0, 10.0, 1.0, 0, "Use this for scaling the doppler effect"); - - yco -=30; - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Velocity: ", - xco,yco,195,24,&G.listener->dopplervelocity,0.0,10000.0, 1.0,0, "Sets the propagation speed of sound"); - - -} - -static void sound_panel_sequencer(void) -{ - uiBlock *block; - short xco, yco; - char mixrateinfo[256]; - - block= uiNewBlock(&curarea->uiblocks, "sound_panel_sequencer", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Sequencer", "Sound", 640, 0, 318, 204)==0) return; - - /* audio sequence engine settings ------------------------------------------------------------------ */ - - xco = 1010; - yco = 195; - - uiDefBut(block, LABEL, 0, "Audio sequencer settings", xco,yco,295,20, 0, 0, 0, 0, 0, ""); - - yco -= 25; - sprintf(mixrateinfo, "Mixing/Sync (latency: %d ms)", (int)( (((float)U.mixbufsize)/(float)G.scene->audio.mixrate)*1000.0 ) ); - uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, ""); - - yco -= 25; - uiDefButI(block, ROW, B_SOUND_RATECHANGED, "44.1 kHz", xco,yco,75,20, &G.scene->audio.mixrate, 2.0, 44100.0, 0, 0, "Mix at 44.1 kHz"); - uiDefButI(block, ROW, B_SOUND_RATECHANGED, "48.0 kHz", xco+80,yco,75,20, &G.scene->audio.mixrate, 2.0, 48000.0, 0, 0, "Mix at 48 kHz"); - uiDefBut(block, BUT, B_SOUND_RECALC, "Recalc", xco+160,yco,75,20, 0, 0, 0, 0, 0, "Recalculate samples"); - - yco -= 25; - uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync", xco,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio"); - uiDefButBitS(block, TOG, AUDIO_SCRUB, B_SOUND_CHANGED, "Scrub", xco+120,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Scrub when changing frames"); - - yco -= 25; - uiDefBut(block, LABEL, 0, "Main mix", xco,yco,295,20, 0, 0, 0, 0, 0, ""); - - yco -= 25; - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Main (dB): ", - xco,yco,235,24,&G.scene->audio.main, -24.0, 6.0, 0, 0, "Set the audio master gain/attenuation in dB"); - - yco -= 25; - uiDefButBitS(block, TOG, AUDIO_MUTE, 0, "Mute", xco,yco,235,24, &G.scene->audio.flag, 0, 0, 0, 0, "Mute audio from sequencer"); - - yco -= 35; - uiDefBut(block, BUT, B_SOUND_MIXDOWN, "MIXDOWN", xco,yco,235,24, 0, 0, 0, 0, 0, "Create WAV file from sequenced audio (output goes to render output dir)"); - -} - -static char *make_sample_menu(void) -{ - int len= BLI_countlist(samples); /* BKE_sound.h */ - - if(len) { - bSample *sample; - char *str; - int nr, a=0; - - str= MEM_callocN(32*len, "menu"); - - for(nr=1, sample= samples->first; sample; sample= sample->id.next, nr++) { - a+= sprintf(str+a, "|%s %%x%d", sample->id.name+2, nr); - } - return str; - } - return NULL; -} - -static void sound_panel_sound(bSound *sound) -{ - static int packdummy=0; - ID *id, *idfrom; - uiBlock *block; - bSample *sample; - char *strp, ch[256]; - - block= uiNewBlock(&curarea->uiblocks, "sound_panel_sound", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Sound", "Sound", 0, 0, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "Blender Sound block",10,180,195,20, 0, 0, 0, 0, 0, ""); - - // warning: abuse of texnr here! (ton didnt code!) - buttons_active_id(&id, &idfrom); - std_libbuttons(block, 10, 160, 0, NULL, B_SOUNDBROWSE2, ID_SO, 0, id, idfrom, &(G.buts->texnr), 1, 0, 0, 0, 0); - - if (sound) { - - uiDefBut(block, BUT, B_SOUND_COPY_SOUND, "Copy sound", 220,160,90,20, 0, 0, 0, 0, 0, "Make another copy (duplicate) of the current sound"); - - uiSetButLock(sound->id.lib!=0, ERROR_LIBDATA_MESSAGE); - sound_initialize_sample(sound); - sample = sound->sample; - - /* info string */ - if (sound->sample && sound->sample->len) { - char *tmp; - if (sound->sample->channels == 1) tmp= "Mono"; - else if (sound->sample->channels == 2) tmp= "Stereo"; - else tmp= "Unknown"; - - sprintf(ch, "Sample: %s, %d bit, %d Hz, %d samples", tmp, sound->sample->bits, sound->sample->rate, (sound->sample->len/(sound->sample->bits/8)/sound->sample->channels)); - uiDefBut(block, LABEL, 0, ch, 35,140,225,20, 0, 0, 0, 0, 0, ""); - } - else { - uiDefBut(block, LABEL, 0, "Sample: No sample info available.",35,140,225,20, 0, 0, 0, 0, 0, ""); - } - - /* sample browse buttons */ - uiBlockBeginAlign(block); - strp= make_sample_menu(); - if (strp) { - uiDefButS(block, MENU, B_SOUND_MENU_SAMPLE, strp, 10,120,23,20, &(G.buts->menunr), 0, 0, 0, 0, "Select another loaded sample"); - MEM_freeN(strp); - } - uiDefBut(block, TEX, B_SOUND_NAME_SAMPLE, "", 35,120,250,20, sound->name, 0.0, 79.0, 0, 0, "The sample file used by this Sound"); - - if (sound->sample->packedfile) packdummy = 1; - else packdummy = 0; - - uiDefIconButBitI(block, TOG, 1, B_SOUND_UNPACK_SAMPLE, ICON_PACKAGE, - 285, 120,25,20, &packdummy, 0, 0, 0, 0,"Pack/Unpack this sample"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_SOUND_LOAD_SAMPLE, "Load sample", 10, 95,150,24, 0, 0, 0, 0, 0, "Load a different sample file"); - - uiDefBut(block, BUT, B_SOUND_PLAY_SAMPLE, "Play", 160, 95, 150, 24, 0, 0.0, 0, 0, 0, "Playback sample using settings below"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ", - 10,70,150,20, &sound->volume, 0.0, 1.0, 0, 0, "Game engine only: Set the volume of this sound"); - - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Pitch: ", - 160,70,150,20, &sound->pitch, -12.0, 12.0, 0, 0, "Game engine only: Set the pitch of this sound"); - - /* looping */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SOUND_FLAGS_LOOP, B_SOUND_REDRAW, "Loop", - 10, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between looping on/off"); - - if (sound->flags & SOUND_FLAGS_LOOP) { - uiDefButBitI(block, TOG, SOUND_FLAGS_BIDIRECTIONAL_LOOP, B_SOUND_REDRAW, "Ping Pong", - 105, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between A->B and A->B->A looping"); - - } - - - /* 3D settings ------------------------------------------------------------------ */ - uiBlockBeginAlign(block); - - if (sound->sample->channels == 1) { - uiDefButBitI(block, TOG, SOUND_FLAGS_3D, B_SOUND_REDRAW, "3D Sound", - 10, 10, 90, 20, &sound->flags, 0, 0, 0, 0, "Game engine only: Turns 3D sound on"); - - if (sound->flags & SOUND_FLAGS_3D) { - uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Scale: ", - 100,10,210,20, &sound->attenuation, 0.0, 5.0, 1.0, 0, "Game engine only: Sets the surround scaling factor for this sound"); - - } - } - } -} - - -/* ************************* SCENE *********************** */ - - -static void output_pic(char *name) -{ - strcpy(G.scene->r.pic, name); - allqueue(REDRAWBUTSSCENE, 0); - BIF_undo_push("Change output picture directory"); -} - -static void backbuf_pic(char *name) -{ - Image *ima; - - strcpy(G.scene->r.backbuf, name); - allqueue(REDRAWBUTSSCENE, 0); - - ima= BKE_add_image_file(name); - if(ima) - BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD); - - BIF_undo_push("Change background picture"); -} - -static void ftype_pic(char *name) -{ - strcpy(G.scene->r.ftype, name); - allqueue(REDRAWBUTSSCENE, 0); -} - -static void run_playanim(char *file) -{ - extern char bprogname[]; /* usiblender.c */ - char str[FILE_MAX]; - int pos[2], size[2]; - - /* use current settings for defining position of window. it actually should test image size */ - calc_renderwin_rectangle((G.scene->r.xsch*G.scene->r.size)/100, - (G.scene->r.ysch*G.scene->r.size)/100, G.winpos, pos, size); -#ifdef WIN32 - sprintf(str, "%s -a -p %d %d -f %d %g \"%s\"", bprogname, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file); -#else - sprintf(str, "\"%s\" -a -p %d %d -f %d %g \"%s\"", bprogname, pos[0], pos[1], G.scene->r.frs_sec, G.scene->r.frs_sec_base, file); -#endif - system(str); -} - -void playback_anim(void) -{ - char file[FILE_MAX]; - - if(BKE_imtype_is_movie(G.scene->r.imtype)) { - switch (G.scene->r.imtype) { -#ifdef WITH_QUICKTIME - case R_QUICKTIME: - makeqtstring(file); - break; -#endif -#ifdef WITH_FFMPEG - case R_FFMPEG: - makeffmpegstring(file); - break; -#endif - default: - makeavistring(&G.scene->r, file); - break; - } - if(BLI_exist(file)) { - run_playanim(file); - } - else error("Can't find movie: %s", file); - } - else { - BKE_makepicstring(file, G.scene->r.pic, G.scene->r.sfra, G.scene->r.imtype); - if(BLI_exist(file)) { - run_playanim(file); - } - else error("Can't find image: %s", file); - } -} - -#ifdef WITH_FFMPEG -static void set_ffmpeg_preset(int preset); -#endif - -void do_render_panels(unsigned short event) -{ - ScrArea *sa; - ID *id; - - switch(event) { - - case B_DORENDER: - BIF_do_render(0); - break; - case B_RTCHANGED: - allqueue(REDRAWALL, 0); - break; - case B_SWITCHRENDER: - /* new panels added, so... */ - G.buts->re_align= 1; - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PLAYANIM: - playback_anim(); - break; - - case B_DOANIM: - BIF_do_render(1); - break; - - case B_FS_PIC: - sa= closest_bigger_area(); - areawinset(sa->win); - if(G.qual == LR_CTRLKEY) - activate_imageselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic); - else - activate_fileselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic); - break; - - case B_FS_BACKBUF: - sa= closest_bigger_area(); - areawinset(sa->win); - if(G.qual == LR_CTRLKEY) - activate_imageselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic); - else - activate_fileselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic); - break; - - case B_FS_FTYPE: - sa= closest_bigger_area(); - areawinset(sa->win); - if(G.qual == LR_CTRLKEY) - activate_imageselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic); - else - activate_fileselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic); - break; - - case B_PR_PAL: - G.scene->r.xsch= 720; - G.scene->r.ysch= 576; - G.scene->r.xasp= 54; - G.scene->r.yasp= 51; - G.scene->r.size= 100; - G.scene->r.frs_sec= 25; - G.scene->r.frs_sec_base= 1; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 4; -#ifdef WITH_FFMPEG - G.scene->r.ffcodecdata.gop_size = 15; -#endif - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set PAL"); - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEWCAM, 0); - break; - - case B_FILETYPEMENU: - allqueue(REDRAWBUTSSCENE, 0); -#ifdef WITH_FFMPEG - if (G.scene->r.imtype == R_FFMPEG) { - if (G.scene->r.ffcodecdata.type <= 0 || - G.scene->r.ffcodecdata.codec <= 0 || - G.scene->r.ffcodecdata.audio_codec <= 0 || - G.scene->r.ffcodecdata.video_bitrate <= 1) { - G.scene->r.ffcodecdata.codec - = CODEC_ID_MPEG2VIDEO; - set_ffmpeg_preset(FFMPEG_PRESET_DVD); - } - - if (G.scene->r.ffcodecdata.audio_codec <= 0) { - G.scene->r.ffcodecdata.audio_codec - = CODEC_ID_MP2; - G.scene->r.ffcodecdata.audio_bitrate = 128; - } - break; - } -#endif -#if defined (_WIN32) || defined (__APPLE__) - // fall through to codec settings if this is the first - // time R_AVICODEC is selected for this scene. - if (((G.scene->r.imtype == R_AVICODEC) - && (G.scene->r.avicodecdata == NULL)) || - ((G.scene->r.imtype == R_QUICKTIME) - && (G.scene->r.qtcodecdata == NULL))) { - } else { - break; - } -#endif /*_WIN32 || __APPLE__ */ - - case B_SELECTCODEC: -#if defined (_WIN32) || defined (__APPLE__) - if ((G.scene->r.imtype == R_QUICKTIME)) { /* || (G.scene->r.qtcodecdata)) */ -#ifdef WITH_QUICKTIME - get_qtcodec_settings(); -#endif /* WITH_QUICKTIME */ - } -#if defined (_WIN32) && !defined(FREE_WINDOWS) - else - get_avicodec_settings(); -#endif /* _WIN32 && !FREE_WINDOWS */ -#endif /* _WIN32 || __APPLE__ */ - break; - - case B_PR_HD: - G.scene->r.xsch= 1920; - G.scene->r.ysch= 1080; - G.scene->r.xasp= 1; - G.scene->r.yasp= 1; - G.scene->r.size= 100; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 4; - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set FULL"); - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEWCAM, 0); - break; - case B_PR_FULL: - G.scene->r.xsch= 1280; - G.scene->r.ysch= 1024; - G.scene->r.xasp= 1; - G.scene->r.yasp= 1; - G.scene->r.size= 100; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 4; - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set FULL"); - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEWCAM, 0); - break; - case B_PR_PRV: - G.scene->r.xsch= 640; - G.scene->r.ysch= 512; - G.scene->r.xasp= 1; - G.scene->r.yasp= 1; - G.scene->r.size= 50; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 2; - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - allqueue(REDRAWVIEWCAM, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PR_PAL169: - G.scene->r.xsch= 720; - G.scene->r.ysch= 576; - G.scene->r.xasp= 64; - G.scene->r.yasp= 45; - G.scene->r.size= 100; - G.scene->r.frs_sec= 25; - G.scene->r.frs_sec_base= 1; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 4; -#ifdef WITH_FFMPEG - G.scene->r.ffcodecdata.gop_size = 15; -#endif - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set PAL 16/9"); - allqueue(REDRAWVIEWCAM, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PR_PC: - G.scene->r.xsch= 640; - G.scene->r.ysch= 480; - G.scene->r.xasp= 100; - G.scene->r.yasp= 100; - G.scene->r.size= 100; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 4; - - BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0); - BIF_undo_push("Set PC"); - allqueue(REDRAWVIEWCAM, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PR_PRESET: - G.scene->r.xsch= 720; - G.scene->r.ysch= 576; - G.scene->r.xasp= 54; - G.scene->r.yasp= 51; - G.scene->r.size= 100; - G.scene->r.mode= R_OSA+R_SHADOW+R_FIELDS; - G.scene->r.imtype= R_TARGA; - G.scene->r.xparts= G.scene->r.yparts= 4; - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set Default"); - allqueue(REDRAWVIEWCAM, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PR_PANO: - G.scene->r.xsch= 576; - G.scene->r.ysch= 176; - G.scene->r.xasp= 115; - G.scene->r.yasp= 100; - G.scene->r.size= 100; - G.scene->r.mode |= R_PANORAMA; - G.scene->r.xparts= 16; - G.scene->r.yparts= 1; - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set Panorama"); - allqueue(REDRAWVIEWCAM, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_PR_NTSC: - G.scene->r.xsch= 720; - G.scene->r.ysch= 480; - G.scene->r.xasp= 10; - G.scene->r.yasp= 11; - G.scene->r.size= 100; - G.scene->r.frs_sec= 30; - G.scene->r.frs_sec_base = 1.001; - G.scene->r.mode &= ~R_PANORAMA; - G.scene->r.xparts= G.scene->r.yparts= 2; -#ifdef WITH_FFMPEG - G.scene->r.ffcodecdata.gop_size = 18; -#endif - - BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9); - BIF_undo_push("Set NTSC"); - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEWCAM, 0); - break; - - case B_SETBROWSE: - id= (ID*) G.scene->set; - - if (G.buts->menunr==-2) { - activate_databrowse(id, ID_SCE, 0, B_SETBROWSE, &G.buts->menunr, do_render_panels); - } - else if (G.buts->menunr>0) { - Scene *newset= (Scene*) BLI_findlink(&G.main->scene, G.buts->menunr-1); - - if (newset==G.scene) - error("Can't use the same scene as its own set"); - else if (newset) { - G.scene->set= newset; - if (scene_check_setscene(G.scene)==0) - error("This would create a cycle"); - - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Change Set Scene"); - } - } - break; - case B_CLEARSET: - G.scene->set= NULL; - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Clear Set Scene"); - - break; - case B_SET_EDGE: - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_SET_ZBLUR: - G.scene->r.mode &= ~R_EDGE; - allqueue(REDRAWBUTSSCENE, 0); - break; - case B_ADD_RENDERLAYER: - if(G.scene->r.actlay==32767) { - scene_add_render_layer(G.scene); - G.scene->r.actlay= BLI_countlist(&G.scene->r.layers) - 1; - } - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWNODE, 0); - break; - case B_SET_PASS: - if(G.scene->nodetree) { - ntreeCompositForceHidden(G.scene->nodetree); - allqueue(REDRAWNODE, 0); - } - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWOOPS, 0); - } -} - -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *edge_render_menu(void *arg_unused) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "edge render", UI_EMBOSS, UI_HELV, curarea->win); - - /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", 0, 0, 220, 115, NULL, 0, 0, 0, 0, ""); - - uiDefButS(block, NUM, 0,"Eint:", 45,75,175,19, &G.scene->r.edgeint, 0.0, 255.0, 0, 0, - "Sets edge intensity for Toon shading"); - - /* color settings for the toon shading */ - uiDefButF(block, COL, 0, "", 10, 10,30,60, &(G.scene->r.edgeR), 0, 0, 0, B_EDGECOLSLI, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, 0, "R ", 45, 50, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0, - "Color for edges in toon shading mode."); - uiDefButF(block, NUMSLI, 0, "G ", 45, 30, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0, - "Color for edges in toon shading mode."); - uiDefButF(block, NUMSLI, 0, "B ", 45, 10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0, - "Color for edges in toon shading mode."); - - - uiBlockSetDirection(block, UI_TOP); - - return block; -} - - -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *framing_render_menu(void *arg_unused) -{ - uiBlock *block; - short yco = 190, xco = 0; - int randomcolorindex = 1234; - - block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSS, UI_HELV, curarea->win); - - /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", -5, -10, 295, 224, NULL, 0, 0, 0, 0, ""); - - uiDefBut(block, LABEL, 0, "Framing:", xco, yco, 68,19, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButC(block, ROW, 0, "Stretch", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_SCALE , 0, 0, "Stretch or squeeze the viewport to fill the display window"); - uiDefButC(block, ROW, 0, "Expose", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_EXTEND, 0, 0, "Show the entire viewport in the display window, viewing more horizontally or vertically"); - uiDefButC(block, ROW, 0, "Letterbox", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_BARS , 0, 0, "Show the entire viewport in the display window, using bar horizontally or vertically"); - uiBlockEndAlign(block); - - yco -= 25; - xco = 40; - - uiDefButF(block, COL, 0, "", 0, yco - 58 + 18, 33, 58, &G.scene->framing.col[0], 0, 0, 0, randomcolorindex, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, 0, "R ", xco,yco,243,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars"); - yco -= 20; - uiDefButF(block, NUMSLI, 0, "G ", xco,yco,243,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars"); - yco -= 20; - uiDefButF(block, NUMSLI, 0, "B ", xco,yco,243,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars"); - uiBlockEndAlign(block); - - xco = 0; - uiDefBut(block, LABEL, 0, "Fullscreen:", xco, yco-=30, 100, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, TOG, 0, "Fullscreen", xco+70, yco, 68, 19, &G.scene->r.fullscreen, 0.0, 0.0, 0, 0, "Starts player in a new fullscreen display"); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, 0, "X:", xco+40, yco-=27, 100, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change."); - uiDefButS(block, NUM, 0, "Y:", xco+140, yco, 100, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change."); - uiDefButS(block, NUM, 0, "Freq:", xco+40, yco-=21, 100, 19, &G.scene->r.freqplay, 10.0, 2000.0, 0, 0, "Displays clock frequency of fullscreen display. Click to change."); - uiDefButS(block, NUM, 0, "Bits:", xco+140, yco, 100, 19, &G.scene->r.depth, 8.0, 32.0, 800.0, 0, "Displays bit depth of full screen display. Click to change."); - uiBlockEndAlign(block); - - /* stereo settings */ - /* can't use any definition from the game engine here so hardcode it. Change it here when it changes there! - * RAS_IRasterizer has definitions: - * RAS_STEREO_NOSTEREO 1 - * RAS_STEREO_QUADBUFFERED 2 - * RAS_STEREO_ABOVEBELOW 3 - * RAS_STEREO_INTERLACED 4 future - * RAS_STEREO_ANAGLYPH 5 - * RAS_STEREO_SIDEBYSIDE 6 - * RAS_STEREO_VINTERLACE 7 - */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, 0, "No Stereo", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 1.0, 0, 0, "Disables stereo"); - uiDefButS(block, ROW, 0, "Pageflip", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 2.0, 0, 0, "Enables hardware pageflip stereo method"); - uiDefButS(block, ROW, 0, "Syncdouble", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method"); - uiDefButS(block, ROW, 0, "Anaglyph", xco-=180, yco-=21, 88, 19, &(G.scene->r.stereomode), 7.0, 5.0, 0, 0, "Enables anaglyph (Red-Blue) stereo method"); - uiDefButS(block, ROW, 0, "Side by Side", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 6.0, 0, 0, "Enables side by side left and right images"); - uiDefButS(block, ROW, 0, "V Interlace", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 7.0, 0, 0, "Enables interlaced vertical strips for autostereo display"); - - uiBlockEndAlign(block); - - uiBlockSetDirection(block, UI_TOP); - - return block; -} - -#ifdef WITH_FFMPEG - -static char* ffmpeg_format_pup(void) -{ - static char string[2048]; - char formatstring[2048]; -#if 0 - int i = 0; - int stroffs = 0; - AVOutputFormat* next = first_oformat; - formatstring = "FFMpeg format: %%t"; - sprintf(string, formatstring); - formatstring = "|%s %%x%d"; - /* FIXME: This should only be generated once */ - while (next != NULL) { - if (next->video_codec != CODEC_ID_NONE && !(next->flags & AVFMT_NOFILE)) { - sprintf(string+stroffs, formatstring, next->name, i++); - stroffs += strlen(string+stroffs); - } - next = next->next; - } - return string; -#endif - strcpy(formatstring, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - sprintf(string, formatstring, - "MPEG-1", FFMPEG_MPEG1, - "MPEG-2", FFMPEG_MPEG2, - "MPEG-4", FFMPEG_MPEG4, - "AVI", FFMPEG_AVI, - "Quicktime", FFMPEG_MOV, - "DV", FFMPEG_DV, - "H264", FFMPEG_H264, - "XVid", FFMPEG_XVID); - return string; -} - -static char* ffmpeg_preset_pup(void) -{ - static char string[2048]; - char formatstring[2048]; - - strcpy(formatstring, "FFMpeg preset: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - sprintf(string, formatstring, - "", FFMPEG_PRESET_NONE, - "DVD", FFMPEG_PRESET_DVD, - "SVCD", FFMPEG_PRESET_SVCD, - "VCD", FFMPEG_PRESET_VCD, - "DV", FFMPEG_PRESET_DV); - return string; -} - - -static char* ffmpeg_codec_pup(void) { - static char string[2048]; - char formatstring[2048]; - strcpy(formatstring, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - sprintf(string, formatstring, - "MPEG1", CODEC_ID_MPEG1VIDEO, - "MPEG2", CODEC_ID_MPEG2VIDEO, - "MPEG4(divx)", CODEC_ID_MPEG4, - "HuffYUV", CODEC_ID_HUFFYUV, - "DV", CODEC_ID_DVVIDEO, - "H264", CODEC_ID_H264, - "XVid", CODEC_ID_XVID); - return string; - -} - -static char* ffmpeg_audio_codec_pup(void) { - static char string[2048]; - char formatstring[2048]; - strcpy(formatstring, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - sprintf(string, formatstring, - "MP2", CODEC_ID_MP2, - "MP3", CODEC_ID_MP3, - "AC3", CODEC_ID_AC3, - "AAC", CODEC_ID_AAC, - "PCM", CODEC_ID_PCM_S16LE); - return string; - -} - -#endif - -static char *imagetype_pup(void) -{ - static char string[1024]; - char formatstring[1024]; - char appendstring[1024]; - - strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - -#ifdef __sgi - strcat(formatstring, "|%s %%x%d"); // add space for Movie -#endif - - strcat(formatstring, "|%s %%x%d"); // add space for PNG -/* Commented out until implemented -#ifdef WITH_DDS - strcat(formatstring, "|%s %%x%d"); // add space for DDS -#endif -*/ - strcat(formatstring, "|%s %%x%d"); // add space for BMP - strcat(formatstring, "|%s %%x%d"); // add space for Radiance HDR - strcat(formatstring, "|%s %%x%d"); // add space for Cineon - strcat(formatstring, "|%s %%x%d"); // add space for DPX - -#ifdef _WIN32 - strcat(formatstring, "|%s %%x%d"); // add space for AVI Codec -#endif - -#ifdef WITH_FFMPEG - strcat(formatstring, "|%s %%x%d"); // Add space for ffmpeg -#endif - strcat(formatstring, "|%s %%x%d"); // Add space for frameserver - -#ifdef WITH_QUICKTIME - if(G.have_quicktime) - strcat(formatstring, "|%s %%x%d"); // add space for Quicktime -#endif - - if(G.have_quicktime) { - sprintf(string, formatstring, - "Frameserver", R_FRAMESERVER, -#ifdef WITH_FFMPEG - "FFMpeg", R_FFMPEG, -#endif - "AVI Raw", R_AVIRAW, - "AVI Jpeg", R_AVIJPEG, -#ifdef _WIN32 - "AVI Codec", R_AVICODEC, -#endif -#ifdef WITH_QUICKTIME - "QuickTime", R_QUICKTIME, -#endif - "Targa", R_TARGA, - "Targa Raw", R_RAWTGA, - "PNG", R_PNG, -/* commented out until implemented -#ifdef WITH_DDS - "DDS", R_DDS, -#endif -*/ - "BMP", R_BMP, - "Jpeg", R_JPEG90, - "HamX", R_HAMX, - "Iris", R_IRIS, - "Radiance HDR", R_RADHDR, - "Cineon", R_CINEON, - "DPX", R_DPX -#ifdef __sgi - ,"Movie", R_MOVIE -#endif - ); - } else { - sprintf(string, formatstring, - "Frameserver", R_FRAMESERVER, -#ifdef WITH_FFMPEG - "FFMpeg", R_FFMPEG, -#endif - "AVI Raw", R_AVIRAW, - "AVI Jpeg", R_AVIJPEG, -#ifdef _WIN32 - "AVI Codec", R_AVICODEC, -#endif - "Targa", R_TARGA, - "Targa Raw", R_RAWTGA, - "PNG", R_PNG, -#ifdef WITH_DDS - "DDS", R_DDS, -#endif - "BMP", R_BMP, - "Jpeg", R_JPEG90, - "HamX", R_HAMX, - "Iris", R_IRIS, - "Radiance HDR", R_RADHDR, - "Cineon", R_CINEON, - "DPX", R_DPX -#ifdef __sgi - ,"Movie", R_MOVIE -#endif - ); - } - -#ifdef WITH_OPENEXR - strcpy(formatstring, "|%s %%x%d"); - sprintf(appendstring, formatstring, "OpenEXR", R_OPENEXR); - strcat(string, appendstring); - sprintf(appendstring, formatstring, "MultiLayer", R_MULTILAYER); - strcat(string, appendstring); -#endif - - if (G.have_libtiff) { - strcpy(formatstring, "|%s %%x%d"); - sprintf(appendstring, formatstring, "TIFF", R_TIFF); - strcat(string, appendstring); - } - - return (string); -} - -#ifdef _WIN32 -static char *avicodec_str(void) -{ - static char string[1024]; - - sprintf(string, "Codec: %s", G.scene->r.avicodecdata->avicodecname); - - return string; -} -#endif - -static void render_panel_output(void) -{ - ID *id; - int a,b; - uiBlock *block; - char *strp; - - - block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return; - - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name"); - uiDefBut(block, TEX,0,"", 31, 190, 279, 20,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to"); - uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image"); - uiDefBut(block, TEX,0,"", 31, 168, 279, 20,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering"); - uiDefIconBut(block, BUT,B_FS_FTYPE, ICON_FILESEL, 10, 146, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image"); - uiDefBut(block, TEX,0,"", 31, 146, 279, 20,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type"); - uiBlockEndAlign(block); - - - /* SET BUTTON */ - uiBlockBeginAlign(block); - id= (ID *)G.scene->set; - IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr)); - if(strp[0]) - uiDefButS(block, MENU, B_SETBROWSE, strp, 10, 120, 20, 20, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set"); - MEM_freeN(strp); - - if(G.scene->set) { - uiSetButLock(1, NULL); - uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, B_NOP, "", 31, 120, 100, 20, &(G.scene->set), "Name of the Set"); - uiClearButLock(); - uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 132, 120, 20, 20, 0, 0, 0, 0, 0, "Remove Set link"); - } - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, R_BACKBUF, B_NOP,"Backbuf", 10, 94, 80, 20, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image"); - uiDefButS(block, NUM, B_NOP, "Threads:", 10, 68, 100, 20, &G.scene->r.threads, 1, BLENDER_MAX_THREADS, 0, 0, "Amount of threads for render"); - uiBlockSetCol(block, TH_AUTO); - - uiBlockBeginAlign(block); - for(b=2; b>=0; b--) - for(a=0; a<3; a++) - uiDefButBitS(block, TOG, 1<<(3*b+a), 800,"", (short)(10+18*a),(short)(10+14*b),16,12, &G.winpos, 0, 0, 0, 0, "Render window placement on screen"); - uiBlockEndAlign(block); - - uiDefButBitS(block, TOG, R_EXR_TILE_FILE, B_NOP, "Save Buffers", 72, 31, 120, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Save the tiles for all RenderLayers and used SceneNodes to files, to save memory"); - - uiDefButS(block, MENU, B_REDR, "Render Display %t|Render Window %x1|Image Editor %x0|Full Screen %x2", - 72, 10, 120, 19, &G.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output display"); - - uiDefButBitS(block, TOG, R_EXTENSION, B_NOP, "Extensions", 205, 10, 105, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations"); - - /* Dither control */ - uiDefButF(block, NUM,B_DIFF, "Dither:", 205,31,105,19, &G.scene->r.dither_intensity, 0.0, 2.0, 0, 0, "The amount of dithering noise present in the output image (0.0 = no dithering)"); - - /* Toon shading buttons */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_EDGE, B_NOP,"Edge", 100, 94, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon Edge-enhance"); - uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings", 170, 94, 140, 20, "Display Edge settings"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, R_NO_TEX, B_NOP, "Disable Tex", 115, 68, 70, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Disables Textures for render"); - uiDefButBitS(block, TOG, R_FREE_IMAGE, B_NOP, "Free Tex Images", 205, 68, 100, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Frees all Images used by Textures after each render"); - uiBlockEndAlign(block); -} - -static void do_bake_func(void *unused_v, void *unused_p) -{ - objects_bake_render(0); -} - -static void render_panel_bake(void) -{ - uiBlock *block; - uiBut *but; - - block= uiNewBlock(&curarea->uiblocks, "render_panel_bake", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Anim", "Render"); - if(uiNewPanel(curarea, block, "Bake", "Render", 320, 0, 318, 204)==0) return; - - but= uiDefBut(block, BUT, B_NOP, "BAKE", 10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render for selected Objects"); - uiButSetFunc(but, do_bake_func, NULL, NULL); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, R_BAKE_TO_ACTIVE, B_DIFF, "Selected to Active", 10,120,190,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Bake shading on the surface of selected objects to the active object"); - uiDefButF(block, NUM, B_DIFF, "Dist:", 10,100,(G.scene->r.bake_mode == RE_BAKE_NORMALS)? 95: 190,20,&G.scene->r.bake_maxdist, 0.0, 10.0, 1, 0, "Maximum distance from active object to other object"); - - if(G.scene->r.bake_mode == RE_BAKE_NORMALS) - uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3", - 105,100,95,20, &G.scene->r.bake_normal_space, 0, 0, 0, 0, "Choose normal space for baking"); - uiBlockEndAlign(block); - -#if 0 - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)"); - uiDefButS(block, ROW,B_DIFF,"5", 10,100,50,20,&G.scene->r.bake_osa,2.0,5.0, 0, 0, "Sets oversample level to 5"); - uiDefButS(block, ROW,B_DIFF,"8", 60,100,45,20,&G.scene->r.bake_osa,2.0,8.0, 0, 0, "Sets oversample level to 8"); - uiDefButS(block, ROW,B_DIFF,"11", 105,100,45,20,&G.scene->r.bake_osa,2.0,11.0, 0, 0, "Sets oversample level to 11"); - uiDefButS(block, ROW,B_DIFF,"16", 150,100,50,20,&G.scene->r.bake_osa,2.0,16.0, 0, 0, "Sets oversample level to 16"); -#endif - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_REDR,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Normals", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Textures", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, ""); - uiBlockEndAlign(block); - - uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,80,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking"); - - uiDefButS(block, NUM, B_DIFF,"Margin:", 210,50,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter"); -} - -static void render_panel_render(void) -{ - uiBlock *block; - char str[256]; - - block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204)==0) return; - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_DORENDER,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Start the rendering"); -#ifndef DISABLE_YAFRAY - /* yafray: on request, render engine menu is back again, and moved to Render panel */ - uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0|YafRay %x1", - 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine"); -#else - uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0", - 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine"); -#endif /* disable yafray */ - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_OSA, B_DIFF, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)"); - uiDefButS(block, ROW,B_DIFF,"5", 369,88,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5"); - uiDefButS(block, ROW,B_DIFF,"8", 400,88,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)"); - uiDefButS(block, ROW,B_DIFF,"11", 431,88,29,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11"); - uiDefButS(block, ROW,B_DIFF,"16", 462,88,29,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Sets oversample level to 16"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_MBLUR, B_REDR, "MBLUR", 496,109,64,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation"); - uiDefButF(block, NUM,B_DIFF,"Bf:", 496,88,64,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 2, "Sets motion blur factor"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,46,95,29,&G.scene->r.xparts,1.0, 512.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)"); - uiDefButS(block, NUM,B_DIFF,"Yparts:", 465,46,95,29,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky"); - uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance"); - uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and color values remain unchanged"); - uiBlockEndAlign(block); - - if(G.scene->r.mode & R_RAYTRACE) - uiDefButS(block, MENU, B_DIFF,"Octree resolution %t|64 %x64|128 %x128|256 %x256|512 %x512", 496,13,64,20,&G.scene->r.ocres,0.0,0.0, 0, 0, "Octree resolution for ray tracing"); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_SHADOW, B_REDR,"Shadow", 565,172,60,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation"); - uiDefButBitI(block, TOG, R_ENVMAP, B_REDR,"EnvMap", 627,172,60,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map rendering"); - uiDefButBitI(block, TOG, R_PANORAMA, B_REDR,"Pano", 565,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)"); - uiDefButBitI(block, TOG, R_RAYTRACE, B_REDR,"Ray",606,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable ray tracing"); - uiDefButBitI(block, TOG, R_RADIO, B_REDR,"Radio", 647,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_DIFF,"100%", 565,109,122,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size"); - uiDefButS(block, ROW,B_DIFF,"75%", 565,88,40,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size"); - uiDefButS(block, ROW,B_DIFF,"50%", 606,88,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size"); - uiDefButS(block, ROW,B_DIFF,"25%", 647,88,40,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_FIELDS, B_REDR,"Fields", 565,55,60,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering"); - uiDefButBitI(block, TOG, R_ODDFIELD, B_REDR,"Odd", 627,55,39,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)"); - uiDefButBitI(block, TOG, R_FIELDSTILL, B_REDR,"X", 668,55,19,20,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations"); - - sprintf(str, "Filter%%t|Box %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH); - uiDefButS(block, MENU, B_DIFF,str, 565,34,60,20, &G.scene->r.filtertype, 0, 0, 0, 0, "Set sampling filter for antialiasing"); - uiDefButF(block, NUM,B_DIFF,"", 627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 10, 2, "Sets the filter size"); - - uiDefButBitI(block, TOG, R_BORDER, REDRAWVIEWCAM, "Border", 565,13,122,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image"); - uiBlockEndAlign(block); - -} - -static void render_panel_anim(void) -{ - uiBlock *block; - - - block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Anim", "Render", 640, 0, 318, 204)==0) return; - - - uiDefBut(block, BUT,B_DOANIM,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence"); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, R_DOSEQ, B_NOP, "Do Sequence",692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)"); - uiDefButBitS(block, TOG, R_DOCOMP, B_NOP, "Do Composite",692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Uses compositing nodes for output rendering"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_AUTO); - uiDefBut(block, BUT,B_PLAYANIM, "PLAY",692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)"); - uiDefButS(block, NUM, B_RTCHANGED, "rt:",789,40,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button"); - - uiBlockBeginAlign(block); - uiDefButI(block, NUM,REDRAWSEQ,"Sta:",692,10,94,24, &G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation"); - uiDefButI(block, NUM,REDRAWSEQ,"End:",789,10,95,24, &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0, "The end frame of the animation"); - uiBlockEndAlign(block); -} - -#ifdef WITH_FFMPEG -static void set_ffmpeg_preset(int preset) -{ - int isntsc = (G.scene->r.frs_sec != 25); - switch (preset) { - case FFMPEG_PRESET_VCD: - G.scene->r.ffcodecdata.type = FFMPEG_MPEG1; - G.scene->r.ffcodecdata.video_bitrate = 1150; - G.scene->r.xsch = 352; - G.scene->r.ysch = isntsc ? 240 : 288; - G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15; - G.scene->r.ffcodecdata.rc_max_rate = 1150; - G.scene->r.ffcodecdata.rc_min_rate = 1150; - G.scene->r.ffcodecdata.rc_buffer_size = 40*8; - G.scene->r.ffcodecdata.mux_packet_size = 2324; - G.scene->r.ffcodecdata.mux_rate = 2352 * 75 * 8; - break; - case FFMPEG_PRESET_SVCD: - G.scene->r.ffcodecdata.type = FFMPEG_MPEG2; - G.scene->r.ffcodecdata.video_bitrate = 2040; - G.scene->r.xsch = 480; - G.scene->r.ysch = isntsc ? 480 : 576; - G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15; - G.scene->r.ffcodecdata.rc_max_rate = 2516; - G.scene->r.ffcodecdata.rc_min_rate = 0; - G.scene->r.ffcodecdata.rc_buffer_size = 224*8; - G.scene->r.ffcodecdata.mux_packet_size = 2324; - G.scene->r.ffcodecdata.mux_rate = 0; - - break; - case FFMPEG_PRESET_DVD: - G.scene->r.ffcodecdata.type = FFMPEG_MPEG2; - G.scene->r.ffcodecdata.video_bitrate = 6000; - G.scene->r.xsch = 720; - G.scene->r.ysch = isntsc ? 480 : 576; - G.scene->r.ffcodecdata.gop_size = isntsc ? 18 : 15; - G.scene->r.ffcodecdata.rc_max_rate = 9000; - G.scene->r.ffcodecdata.rc_min_rate = 0; - G.scene->r.ffcodecdata.rc_buffer_size = 224*8; - G.scene->r.ffcodecdata.mux_packet_size = 2048; - G.scene->r.ffcodecdata.mux_rate = 10080000; - - break; - case FFMPEG_PRESET_DV: - G.scene->r.ffcodecdata.type = FFMPEG_DV; - G.scene->r.xsch = 720; - G.scene->r.ysch = isntsc ? 480 : 576; - break; - } -} - -static void render_panel_ffmpeg_video(void) -{ - uiBlock *block; - int yofs; - int xcol1; - int xcol2; - - block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_video", - UI_EMBOSS, UI_HELV, curarea->win); - - uiNewPanelTabbed("Format", "Render"); - if (uiNewPanel(curarea, block, "Video", "Render", 960, 0, 318, 204)== 0) - return; - - if (ffmpeg_preset_sel != 0) { - set_ffmpeg_preset(ffmpeg_preset_sel); - ffmpeg_preset_sel = 0; - allqueue(REDRAWBUTSSCENE, 0); - } - - xcol1 = 872; - xcol2 = 1002; - - yofs = 54; - uiDefBut(block, LABEL, B_DIFF, "Format", xcol1, yofs+88, - 110, 20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, B_DIFF, "Preset", xcol2, yofs+88, - 110, 20, 0, 0, 0, 0, 0, ""); - uiDefButI(block, MENU, B_DIFF, ffmpeg_format_pup(), - xcol1, yofs+66, 110, 20, &G.scene->r.ffcodecdata.type, - 0,0,0,0, "output file format"); - uiDefButI(block, NUM, B_DIFF, "Bitrate", - xcol1, yofs+44, 110, 20, - &G.scene->r.ffcodecdata.video_bitrate, - 1, 14000, 0, 0, "Video bitrate(kb/s)"); - uiDefButI(block, NUM, B_DIFF, "Min Rate", - xcol1, yofs+22, 110, 20, &G.scene->r.ffcodecdata.rc_min_rate, - 0, 14000, 0, 0, "Rate control: min rate(kb/s)"); - uiDefButI(block, NUM, B_DIFF, "Max Rate", - xcol1, yofs, 110, 20, &G.scene->r.ffcodecdata.rc_max_rate, - 1, 14000, 0, 0, "Rate control: max rate(kb/s)"); - - uiDefButI(block, NUM, B_DIFF, "Mux Rate", - xcol1, yofs-22, 110, 20, - &G.scene->r.ffcodecdata.mux_rate, - 0, 100000000, 0, 0, "Mux rate (bits/s(!))"); - - - uiDefButI(block, MENU, B_REDR, ffmpeg_preset_pup(), - xcol2, yofs+66, 110, 20, &ffmpeg_preset_sel, - 0,0,0,0, "Output file format preset selection"); - uiDefButI(block, NUM, B_DIFF, "GOP Size", - xcol2, yofs+44, 110, 20, &G.scene->r.ffcodecdata.gop_size, - 0, 100, 0, 0, "Distance between key frames"); - uiDefButI(block, NUM, B_DIFF, "Buffersize", - xcol2, yofs+22, 110, 20, - &G.scene->r.ffcodecdata.rc_buffer_size, - 0, 2000, 0, 0, "Rate control: buffer size (kb)"); - uiDefButI(block, NUM, B_DIFF, "Mux PSize", - xcol2, yofs, 110, 20, - &G.scene->r.ffcodecdata.mux_packet_size, - 0, 16384, 0, 0, "Mux packet size (byte)"); - - uiDefButBitI(block, TOG, FFMPEG_AUTOSPLIT_OUTPUT, B_NOP, - "Autosplit Output", - xcol2, yofs-22, 110, 20, - &G.scene->r.ffcodecdata.flags, - 0, 1, 0,0, "Autosplit output at 2GB boundary."); - - - if (ELEM(G.scene->r.ffcodecdata.type, FFMPEG_AVI, FFMPEG_MOV)) { - uiDefBut(block, LABEL, 0, "Codec", - xcol1, yofs-44, 110, 20, 0, 0, 0, 0, 0, ""); - uiDefButI(block, MENU,B_REDR, ffmpeg_codec_pup(), - xcol1, yofs-66, 110, 20, - &G.scene->r.ffcodecdata.codec, - 0,0,0,0, "FFMpeg codec to use"); - } -} - -static void render_panel_ffmpeg_audio(void) -{ - uiBlock *block; - int yofs; - int xcol; - - block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_audio", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Format", "Render"); - if (uiNewPanel(curarea, block, "Audio", "Render", 960, 0, 318, 204) == 0) return; - - yofs = 54; - xcol = 892; - - uiDefButBitI(block, TOG, FFMPEG_MULTIPLEX_AUDIO, B_NOP, - "Multiplex audio", xcol, yofs, 225, 20, - &G.scene->r.ffcodecdata.flags, - 0, 1, 0,0, "Interleave audio with the output video"); - uiDefBut(block, LABEL, 0, "Codec", - xcol, yofs-22, 225, 20, 0, 0, 0, 0, 0, ""); - uiDefButI(block, MENU,B_NOP, ffmpeg_audio_codec_pup(), - xcol, yofs-44, 225, 20, - &G.scene->r.ffcodecdata.audio_codec, - 0,0,0,0, "FFMpeg codec to use"); - uiDefButI(block, NUM, B_DIFF, "Bitrate", - xcol, yofs-66, 110, 20, - &G.scene->r.ffcodecdata.audio_bitrate, - 32, 384, 0, 0, "Audio bitrate(kb/s)"); -} -#endif - -static void render_panel_stamp(void) -{ - uiBlock *block; - int yofs=0, xofs=550; - - block= uiNewBlock (&curarea->uiblocks, "render_panel_stamp", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed ("Format", "Render"); - if(uiNewPanel (curarea, block, "Stamp", "Render", 960, 0, 318, 204)==0) return; - - if (G.scene->r.scemode & R_STAMP_INFO) { - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data"); - uiDefBut(block, TEX, B_NOP, "", xofs+120, yofs, 180, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note"); - uiBlockEndAlign(block); - yofs += 30; /* gap */ - - - yofs += 80; - /* Order is important for alligning ... grr */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, R_STAMP_FILENAME, B_REDR, "Filename", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp blend filename"); - yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name"); - uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name"); - yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)"); - uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date"); - yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_FRAME, B_REDR, "Frame", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp frame number"); - uiDefButBitI(block, TOG, R_STAMP_MARKER, B_REDR, "Marker", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the last marker"); - yofs -= 20; - uiDefButBitI(block, TOG, R_STAMP_SEQSTRIP, B_REDR, "Sequence Strip", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp the forground sequence strip name"); - uiBlockEndAlign(block); - yofs += 80; - - /* draw font selector */ - if (G.scene->r.stamp & R_STAMP_DRAW) { - uiDefButS(block, MENU, B_REDR, "Stamp Font Size%t|Tiny Text%x1|Small Text%x2|Medium Text%x3|Large Text%x0|Extra Large Text%x4|", - xofs+130, yofs, 170, 19, &G.scene->r.stamp_font_id, 0, 0, 0, 0, "Choose stamp text size"); - - /* draw fg/bg next to the scene */ - yofs -= 25; - uiDefBut(block, LABEL, B_NOP, "Text Color", xofs+130, yofs, 70, 19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, B_NOP, "Background", xofs+215, yofs, 70, 19, 0, 0, 0, 0, 0, ""); - yofs -= 20; - uiDefButF(block, COL, B_NOP, "", xofs+130, yofs, 80, 19, G.scene->r.fg_stamp, 0, 0, 0, 0, "Foreground text color"); - uiDefButF(block, COL, B_NOP, "", xofs+220, yofs, 80, 19, G.scene->r.bg_stamp, 0, 0, 0, 0, "Background color"); - yofs -= 30; - uiDefButF(block, NUMSLI, B_NOP, "A ", xofs+130, yofs, 170, 19, &G.scene->r.bg_stamp[3], 0, 1.0, 0, 0, "Alpha for text background"); - yofs += 105; - } else { - yofs += 30; - } - - uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, yofs, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Disable stamp info in images metadata"); - uiDefButBitI(block, TOG, R_STAMP_DRAW, B_REDR, "Draw Stamp", xofs+130, yofs, 170, 20, &G.scene->r.stamp, 0, 0, 0, 0, "Draw the stamp info into each frame"); - yofs += 20; - } - else { - uiDefButBitS(block, TOG, R_STAMP_INFO, B_REDR, "Enable Stamp", xofs, 142, 120, 20, &G.scene->r.scemode, 0, 0, 0, 0, "Enable stamp info to image metadata"); - yofs += 20; - uiDefBut(block, LABEL, 0, "", xofs, yofs, 300, 19, 0, 0, 0, 0, 0, ""); - } -} - -static void render_panel_format(void) -{ - uiBlock *block; - int yofs; - - - block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Format", "Render", 960, 0, 318, 204)==0) return; - uiDefBlockBut(block, framing_render_menu, NULL, - "Game framing settings", - 892, 169, 227, 20, "Display game framing settings"); - /* uiDefIconTextBlockBut(block, framing_render_menu, NULL, - ICON_BLOCKBUT_CORNER, - "Game framing settings", - 892, 169, 227, 20, - "Display game framing settings"); */ - - uiBlockBeginAlign(block); - uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeX:", 892 ,136,112,27, &G.scene->r.xsch, 4.0, 10000.0, 0, 0, "The image width in pixels"); - uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines"); - uiDefButS(block, NUM,REDRAWVIEWCAM,"AspX:", 892 ,114,112,20, &G.scene->r.xasp, 1.0,200.0, 0, 0, "The horizontal aspect ratio"); - uiDefButS(block, NUM,REDRAWVIEWCAM,"AspY:", 1007,114,112,20, &G.scene->r.yasp, 1.0,200.0, 0, 0, "The vertical aspect ratio"); - uiBlockEndAlign(block); - - yofs = 54; - -#ifdef __sgi - yofs = 76; - uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie"); - uiDefButBitI(block, TOG, R_COSMO, 0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware"); -#endif - - uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format"); - uiDefButBitI(block, TOG, R_CROP, B_DIFF, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "When Border render, the resulting image gets cropped"); - - yofs -= 22; - - if(G.scene->r.quality==0) G.scene->r.quality= 90; - -#ifdef WITH_QUICKTIME - if (G.scene->r.imtype == R_AVICODEC || G.scene->r.imtype == R_QUICKTIME) { -#else /* WITH_QUICKTIME */ - if (0) { -#endif - if(G.scene->r.imtype == R_QUICKTIME) { -#ifdef WITH_QUICKTIME -#if defined (_WIN32) || defined (__APPLE__) - //glColor3f(0.65, 0.65, 0.7); - //glRecti(892,yofs+46,892+225,yofs+45+20); - if(G.scene->r.qtcodecdata == NULL) - uiDefBut(block, LABEL, 0, "Codec: not set", 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); - else - uiDefBut(block, LABEL, 0, G.scene->r.qtcodecdata->qtcodecname, 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime"); -#endif -#endif /* WITH_QUICKTIME */ - } else { -#ifdef _WIN32 - //glColor3f(0.65, 0.65, 0.7); - //glRecti(892,yofs+46,892+225,yofs+45+20); - if(G.scene->r.avicodecdata == NULL) - uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+43,225,20, 0, 0, 0, 0, 0, ""); - else - uiDefBut(block, LABEL, 0, avicodec_str(), 892,yofs+43,225,20, 0, 0, 0, 0, 0, ""); -#endif - uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); - } -#ifdef WITH_OPENEXR - } - else if (ELEM(G.scene->r.imtype, R_OPENEXR, R_MULTILAYER)) { - if (G.scene->r.quality > 5) G.scene->r.quality = 2; - - if(G.scene->r.imtype==R_OPENEXR) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_NOP,"Half", 892,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Use 16 bit floats instead of 32 bit floats per channel"); - uiDefButBitS(block, TOG, R_OPENEXR_ZBUF, B_NOP,"Zbuf", 952,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save the z-depth per pixel (32 bit unsigned int zbuffer)"); - uiBlockEndAlign(block); - uiDefButBitS(block, TOG, R_PREVIEW_JPG, B_NOP,"Preview",1027,yofs+44,90,20, &G.scene->r.subimtype, 0, 0, 0, 0, "When animation render, save JPG preview images in same directory"); - } - uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4", - 892,yofs,74,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR"); - -#endif - } else { - if(G.scene->r.quality < 5) G.scene->r.quality = 90; /* restore from openexr */ - - uiDefButS(block, NUM,B_DIFF, "Q:", 892,yofs,74,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies"); - } - uiDefButS(block, NUM,B_FRAMEMAP,"FPS:", 968,yofs,75,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second"); - uiDefButF(block, NUM,B_FRAMEMAP,"/", 1043,yofs,75,20, &G.scene->r.frs_sec_base, 1.0, 120.0, 0.1, 3, "Frames per second base"); - - - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data"); - uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data"); - uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,19, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)"); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_PR_PAL, "PAL", 1146,170,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps"); - uiDefBut(block, BUT,B_PR_NTSC, "NTSC", 1146,150,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps"); - uiDefBut(block, BUT,B_PR_PRESET, "Default", 1146,130,100,18, 0, 0, 0, 0, 0, "Same as PAL, with render settings (OSA, Shadows, Fields)"); - uiDefBut(block, BUT,B_PR_PRV, "Preview", 1146,110,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x512, Render size 50%"); - uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100"); - uiDefBut(block, BUT,B_PR_PAL169, "PAL 16:9",1146,70,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 64x45"); - uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings"); - uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1"); - uiDefBut(block, BUT,B_PR_HD, "HD", 1146,10,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1920x1080, Aspect ratio - 1x1"); - uiBlockEndAlign(block); -} - -#ifndef DISABLE_YAFRAY /* disable yafray stuff */ -/* yafray: global illumination options panel */ -static void render_panel_yafrayGI() -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGI", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Render", "Render"); - if(uiNewPanel(curarea, block, "YafRay GI", "Render", 320, 0, 318, 204)==0) return; - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, ""); - - uiDefBut(block, LABEL, 0, "Method", 5,175,70,20, 0, 1.0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_REDR, "GiMethod %t|None %x0|SkyDome %x1|Full %x2", 70,175,89,20, &G.scene->r.GImethod, 0, 0, 0, 0, "Global Illumination Method"); - - uiDefBut(block, LABEL, 0, "Quality", 5,150,70,20, 0, 1.0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_REDR, "GiQuality %t|None %x0|Low %x1|Medium %x2 |High %x3|Higher %x4|Best %x5|Use Blender AO settings %x6", 70,150,89,20, &G.scene->r.GIquality, 0, 0, 0, 0, "Global Illumination Quality"); - - if (G.scene->r.GImethod>0) { - uiDefButF(block, NUM, B_DIFF, "EmitPwr:", 5,35,154,20, &G.scene->r.GIpower, 0.01, 100.0, 10, 0, "arealight, material emit and background intensity scaling, 1 is normal"); - if (G.scene->r.GImethod==2) uiDefButF(block, NUM, B_DIFF, "GI Pwr:", 5,10,154,20, &G.scene->r.GIindirpower, 0.01, 100.0, 10, 0, "GI indirect lighting intensity scaling, 1 is normal"); - } - - if (G.scene->r.GImethod>0) - { - if (G.scene->r.GIdepth==0) G.scene->r.GIdepth=2; - - if (G.scene->r.GImethod==2) { - uiDefButI(block, NUM, B_DIFF, "Depth:", 180,175,110,20, &G.scene->r.GIdepth, 1.0, 100.0, 10, 10, "Number of bounces of the indirect light"); - uiDefButI(block, NUM, B_DIFF, "CDepth:", 180,150,110,20, &G.scene->r.GIcausdepth, 1.0, 100.0, 10, 10, "Number of bounces inside objects (for caustics)"); - uiDefButBitS(block, TOG, 1, B_REDR, "Photons",210,125,100,20, &G.scene->r.GIphotons, 0, 0, 0, 0, "Use global photons to help in GI"); - } - - uiDefButBitS(block, TOG, 1, B_REDR, "Cache",6,125,95,20, &G.scene->r.GIcache, 0, 0, 0, 0, "Cache occlusion/irradiance samples (faster)"); - if (G.scene->r.GIcache) - { - uiDefButBitS(block,TOG, 1, B_REDR, "NoBump",108,125,95,20, &G.scene->r.YF_nobump, 0, 0, 0, 0, "Don't use bumpnormals for cache (faster, but no bumpmapping in total indirectly lit areas)"); - uiDefBut(block, LABEL, 0, "Cache parameters:", 5,105,130,20, 0, 1.0, 0, 0, 0, ""); - if (G.scene->r.GIshadowquality==0.0) G.scene->r.GIshadowquality=0.9; - uiDefButF(block, NUM, B_DIFF,"ShadQu:", 5,85,154,20, &(G.scene->r.GIshadowquality), 0.01, 1.0 ,1,0, "Sets the shadow quality, keep it under 0.95 :-) "); - if (G.scene->r.GIpixelspersample==0) G.scene->r.GIpixelspersample=10; - uiDefButI(block, NUM, B_DIFF, "Prec:", 5,60,75,20, &G.scene->r.GIpixelspersample, 1, 50, 10, 10, "Maximum number of pixels without samples, the lower the better and slower"); - if (G.scene->r.GIrefinement==0) G.scene->r.GIrefinement=1.0; - uiDefButF(block, NUM, B_DIFF, "Ref:", 84,60,75,20, &G.scene->r.GIrefinement, 0.001, 1.0, 1, 0, "Threshold to refine shadows EXPERIMENTAL. 1 = no refinement"); - } - - if (G.scene->r.GImethod==2) { - if (G.scene->r.GIphotons) - { - uiDefBut(block, LABEL, 0, "Photon parameters:", 170,105,130,20, 0, 1.0, 0, 0, 0, ""); - if(G.scene->r.GIphotoncount==0) G.scene->r.GIphotoncount=100000; - uiDefButI(block, NUM, B_DIFF, "Count:", 170,85,140,20, &G.scene->r.GIphotoncount, - 0, 10000000, 10, 10, "Number of photons to shoot"); - if(G.scene->r.GIphotonradius==0.0) G.scene->r.GIphotonradius=1.0; - uiDefButF(block, NUMSLI, B_DIFF,"Radius:", 170,60,140,20, &(G.scene->r.GIphotonradius), - 0.00001, 100.0 ,0,0, "Radius to search for photons to mix (blur)"); - if(G.scene->r.GImixphotons==0) G.scene->r.GImixphotons=100; - uiDefButI(block, NUM, B_DIFF, "MixCount:", 170,35,140,20, &G.scene->r.GImixphotons, - 0, 1000, 10, 10, "Number of photons to mix"); - uiDefButBitS(block, TOG, 1, B_REDR, "Tune Photons",170,10,140,20, &G.scene->r.GIdirect, - 0, 0, 0, 0, "Show the photonmap directly in the render for tuning"); - } - } - - } -} - -/* yafray: global options panel */ -static void render_panel_yafrayGlobal() -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGlobal", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Render", "Render"); - if(uiNewPanel(curarea, block, "YafRay", "Render", 320, 0, 318, 204)==0) return; - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, ""); - - uiDefButBitS(block, TOGN, 1, B_REDR, "xml", 5,180,75,20, &G.scene->r.YFexportxml, - 0, 0, 0, 0, "Export to an xml file and call yafray instead of plugin"); - - uiDefButF(block, NUMSLI, B_DIFF,"Bi ", 5,35,150,20, &(G.scene->r.YF_raybias), - 0.0, 10.0 ,0,0, "Shadow ray bias to avoid self shadowing"); - uiDefButI(block, NUM, B_DIFF, "Raydepth ", 5,60,150,20, - &G.scene->r.YF_raydepth, 1.0, 80.0, 10, 10, "Maximum render ray depth from the camera"); - uiDefButF(block, NUMSLI, B_DIFF, "Gam ", 5,10,150,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off"); - uiDefButF(block, NUMSLI, B_DIFF, "Exp ", 160,10,150,20,&G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off"); - - uiDefButI(block, NUM, B_DIFF, "Processors:", 160,60,150,20, &G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use"); - - /*AA Settings*/ - uiDefButBitS(block, TOGN, 1, B_REDR, "Auto AA", 5,140,150,20, &G.scene->r.YF_AA, - 0, 0, 0, 0, "Set AA using OSA and GI quality, disable for manual control"); - uiDefButBitS(block, TOGN, 1, B_DIFF, "Clamp RGB", 160,140,150,20, &G.scene->r.YF_clamprgb, 1.0, 8.0, 10, 10, "For AA on fast high contrast changes. Not advisable for Bokeh! Dulls lens shape detail."); - if(G.scene->r.YF_AA){ - uiDefButI(block, NUM, B_DIFF, "AA Passes ", 5,115,150,20, &G.scene->r.YF_AApasses, 0, 64, 10, 10, "Number of AA passes (0 is no AA)"); - uiDefButI(block, NUM, B_DIFF, "AA Samples ", 160,115,150,20, &G.scene->r.YF_AAsamples, 0, 2048, 10, 10, "Number of samples per pass"); - uiDefButF(block, NUMSLI, B_DIFF, "Psz ", 5,90,150,20, &G.scene->r.YF_AApixelsize, 1.0, 2.0, 0, 0, "AA pixel filter size"); - uiDefButF(block, NUMSLI, B_DIFF, "Thr ", 160,90,150,20, &G.scene->r.YF_AAthreshold, 0.000001, 1.0, 0, 0, "AA threshold"); - } -} -#endif /* disable yafray stuff */ - -static void layer_copy_func(void *lay_v, void *lay_p) -{ - unsigned int *lay= lay_p; - int laybit= (int)lay_v; - - if(G.qual & LR_SHIFTKEY) { - if(*lay==0) *lay= 1<r.layers)>1) { - long act= (long)act_i; - - BLI_remlink(&G.scene->r.layers, srl_v); - MEM_freeN(srl_v); - G.scene->r.actlay= 0; - - if(G.scene->nodetree) { - bNode *node; - for(node= G.scene->nodetree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { - if(node->custom1==act) - node->custom1= 0; - else if(node->custom1>act) - node->custom1--; - } - } - } - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWNODE, 0); - } -} - -static void rename_scene_layer_func(void *srl_v, void *unused_v) -{ - if(G.scene->nodetree) { - SceneRenderLayer *srl= srl_v; - bNode *node; - for(node= G.scene->nodetree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { - if(node->custom1==G.scene->r.actlay) - BLI_strncpy(node->name, srl->name, NODE_MAXSTR); - } - } - } - allqueue(REDRAWBUTSSCENE, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWNODE, 0); -} - -static char *scene_layer_menu(void) -{ - SceneRenderLayer *srl; - int len= 32 + 32*BLI_countlist(&G.scene->r.layers); - short a, nr; - char *str= MEM_callocN(len, "menu layers"); - - strcpy(str, "ADD NEW %x32767"); - a= strlen(str); - for(nr=0, srl= G.scene->r.layers.first; srl; srl= srl->next, nr++) { - if(srl->layflag & SCE_LAY_DISABLE) - a+= sprintf(str+a, "|%s %%i%d %%x%d", srl->name, ICON_BLANK1, nr); - else - a+= sprintf(str+a, "|%s %%i%d %%x%d", srl->name, ICON_CHECKBOX_HLT, nr); - } - - return str; -} - -static void draw_3d_layer_buttons(uiBlock *block, unsigned int *poin, short xco, short yco, short dx, short dy) -{ - uiBut *bt; - long a; - - uiBlockBeginAlign(block); - for(a=0; a<5; a++) { - bt= uiDefButBitI(block, TOG, 1<r.layers, G.scene->r.actlay); - char *strp; - - if(srl==NULL) { - G.scene->r.actlay= 0; - srl= G.scene->r.layers.first; - } - - block= uiNewBlock(&curarea->uiblocks, "render_panel_layers", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Output", "Render"); - if(uiNewPanel(curarea, block, "Render Layers", "Render", 320, 0, 318, 204)==0) return; - - /* first, as reminder, the scene layers */ - uiDefBut(block, LABEL, 0, "Scene:", 10,170,100,20, NULL, 0, 0, 0, 0, ""); - draw_3d_layer_buttons(block, &G.scene->lay, 130, 170, 35, 30); - - /* layer disable, menu, name, delete button */ - uiBlockBeginAlign(block); - uiDefIconButBitI(block, ICONTOGN, SCE_LAY_DISABLE, B_REDR, ICON_CHECKBOX_HLT-1, 10, 145, 20, 20, &srl->layflag, 0.0, 0.0, 0, 0, "Disable or enable this RenderLayer"); - strp= scene_layer_menu(); - uiDefButS(block, MENU, B_ADD_RENDERLAYER, strp, 30,145,23,20, &(G.scene->r.actlay), 0, 0, 0, 0, "Choose Active Render Layer"); - MEM_freeN(strp); - - /* name max 20, exr format limit... */ - bt= uiDefBut(block, TEX, REDRAWNODE, "", 53,145,172,20, srl->name, 0.0, 20.0, 0, 0, ""); - uiButSetFunc(bt, rename_scene_layer_func, srl, NULL); - - uiDefButBitS(block, TOG, R_SINGLE_LAYER, B_NOP, "Single", 230,145,60,20, &G.scene->r.scemode, 0, 0, 0, 0, "Only render this layer"); - bt=uiDefIconBut(block, BUT, B_NOP, ICON_X, 285, 145, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer"); - uiButSetFunc(bt, delete_scene_layer_func, srl, (void *)(long)G.scene->r.actlay); - uiBlockEndAlign(block); - - /* RenderLayer visible-layers */ - uiDefBut(block, LABEL, 0, "Layer:", 10,110,100,20, NULL, 0, 0, 0, 0, ""); - draw_3d_layer_buttons(block, &srl->lay, 130,110, 35, 30); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SCE_LAY_ALL_Z, B_NOP,"AllZ", 10, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Fill in Z values for all not-rendered faces, for masking"); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SCE_LAY_SOLID, B_NOP,"Solid", 50, 85, 45, 20, &srl->layflag, 0, 0, 0, 0, "Render Solid faces in this Layer"); - uiDefButBitI(block, TOG, SCE_LAY_HALO, B_NOP,"Halo", 95, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Halos in this Layer (on top of Solid)"); - uiDefButBitI(block, TOG, SCE_LAY_ZTRA, B_NOP,"Ztra", 135, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Z-Transparent faces in this Layer (On top of Solid and Halos)"); - uiDefButBitI(block, TOG, SCE_LAY_SKY, B_NOP,"Sky", 175, 85, 40, 20, &srl->layflag, 0, 0, 0, 0, "Render Sky or backbuffer in this Layer"); - uiDefButBitI(block, TOG, SCE_LAY_EDGE, B_NOP,"Edge", 215, 85, 45, 20, &srl->layflag, 0, 0, 0, 0, "Render Edge-enhance in this Layer (only works for Solid faces)"); - uiDefButBitI(block, TOG, SCE_LAY_STRAND, B_NOP,"Strand",260, 85, 50, 20, &srl->layflag, 0, 0, 0, 0, "Render Strands in this Layer"); - - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_SET_PASS, "Light:", 10, 65, 150, 20, &(srl->light_override), "Name of Group to use as Lamps instead"); - uiDefIDPoinBut(block, test_matpoin_but, ID_MA, B_SET_PASS, "Mat:", 160, 65, 150, 20, &(srl->mat_override), "Name of Material to use as Materials instead"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SCE_PASS_COMBINED, B_SET_PASS,"Combined", 10, 30, 80, 20, &srl->passflag, 0, 0, 0, 0, "Deliver full combined RGBA buffer"); - uiDefButBitI(block, TOG, SCE_PASS_Z, B_SET_PASS,"Z", 90, 30, 30, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Z values pass"); - uiDefButBitI(block, TOG, SCE_PASS_VECTOR, B_SET_PASS,"Vec", 120, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Speed Vector pass"); - uiDefButBitI(block, TOG, SCE_PASS_NORMAL, B_SET_PASS,"Nor", 160, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Normal pass"); - uiDefButBitI(block, TOG, SCE_PASS_UV, B_SET_PASS,"UV", 200, 30, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Texture UV pass"); - uiDefButBitI(block, TOG, SCE_PASS_INDEXOB, B_SET_PASS,"IndexOb",240, 30, 70, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Object Index pass"); - - uiDefButBitI(block, TOG, SCE_PASS_RGBA, B_SET_PASS,"Col", 10, 10, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver shade-less Color pass"); - uiDefButBitI(block, TOG, SCE_PASS_DIFFUSE, B_SET_PASS,"Diff", 45, 10, 35, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Diffuse pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_SPEC, B_SET_PASS,"Spec", 80, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Specular pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_SHADOW, B_SET_PASS,"Shad", 120, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Shadow pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_AO, B_SET_PASS,"AO", 160, 10, 30, 20, &srl->passflag, 0, 0, 0, 0, "Deliver AO pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_REFLECT, B_SET_PASS,"Refl", 190, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Reflection pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_REFRACT, B_SET_PASS,"Refr", 230, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Raytraced Refraction pass"); - uiDefButBitI(block, BUT_TOGDUAL, SCE_PASS_RADIO, B_SET_PASS,"Rad", 270, 10, 40, 20, &srl->passflag, 0, 0, 0, 0, "Deliver Radiosity pass"); -} - -void render_panels() -{ - - render_panel_output(); - render_panel_layers(); - render_panel_render(); - render_panel_anim(); - render_panel_bake(); - - render_panel_format(); - render_panel_stamp(); -#ifdef WITH_FFMPEG - if (G.scene->r.imtype == R_FFMPEG) { - render_panel_ffmpeg_video(); - render_panel_ffmpeg_audio(); - } -#endif - -#ifndef DISABLE_YAFRAY - /* yafray: GI & Global panel, only available when yafray enabled for rendering */ - if (G.scene->r.renderer==R_YAFRAY) { - if (G.scene->r.YF_gamma==0.0) G.scene->r.YF_gamma=1.0; - if (G.scene->r.YF_raybias==0.0) G.scene->r.YF_raybias=0.001; - if (G.scene->r.YF_raydepth==0) G.scene->r.YF_raydepth=5; - if (G.scene->r.YF_AApixelsize==0.0) G.scene->r.YF_AApixelsize=1.5; - if (G.scene->r.YF_AAthreshold==0.0) G.scene->r.YF_AAthreshold=0.05; - if (G.scene->r.GIpower==0.0) G.scene->r.GIpower=1.0; - if (G.scene->r.GIindirpower==0.0) G.scene->r.GIindirpower=1.0; - render_panel_yafrayGlobal(); - render_panel_yafrayGI(); - } -#endif - -} - -/* --------------------------------------------- */ - -void anim_panels() -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "anim_panel", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Anim", "Anim", 0, 0, 318, 204)==0) return; - - uiBlockBeginAlign(block); - uiDefButI(block, NUM,B_FRAMEMAP,"Map Old:", 10,160,150,20,&G.scene->r.framapto,1.0,900.0, 0, 0, "Specify old mapping value in frames"); - uiDefButI(block, NUM,B_FRAMEMAP,"Map New:", 160,160,150,20,&G.scene->r.images,1.0,900.0, 0, 0, "Specify how many frames the Map Old will last"); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_FRAMEMAP,"FPS:", 10,130,75,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second"); - uiDefButF(block, NUM,B_FRAMEMAP,"/", 85,130,75,20, &G.scene->r.frs_sec_base, 1.0, 120.0, 0.1, 3, "Frames per second base"); - - uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync",160,130,150,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio"); - - uiBlockBeginAlign(block); - uiDefButI(block, NUM,REDRAWALL,"Sta:", 10,100,150,20,&G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "Specify the start frame of the animation"); - uiDefButI(block, NUM,REDRAWALL,"End:", 160,100,150,20,&G.scene->r.efra,1.0,MAXFRAMEF, 0, 0, "Specify the end frame of the animation"); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, REDRAWTIME, "Steps:",10, 70, 150, 20,&(G.scene->jumpframe), 1, 100, 1, 100, "Set spacing between frames changes with up and down arrow keys"); - - -} - -/* --------------------------------------------- */ - -void sound_panels() -{ - bSound *sound; - - /* paranoia check */ - sound = G.buts->lockpoin; - if(sound && GS(sound->id.name)!=ID_SO) { - sound= NULL; - G.buts->lockpoin= NULL; - } - - sound_panel_sound(sound); - sound_panel_listener(); - sound_panel_sequencer(); -} - - - diff --git a/source/blender/src/buttons_script.c b/source/blender/src/buttons_script.c deleted file mode 100644 index 52e7be7c93e..00000000000 --- a/source/blender/src/buttons_script.c +++ /dev/null @@ -1,384 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_group_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_radio_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_text_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vfont_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -#include "DNA_space_types.h" - -#include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_sound.h" -#include "BKE_texture.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" - -#include "BSE_filesel.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_toolbox.h" - -#include "BIF_butspace.h" - -#include "mydevice.h" -#include "blendef.h" -#include "butspace.h" - -/* ************************ function prototypes ********************** */ -void draw_scriptlink(uiBlock *, ScriptLink *, int , int , int ) ; - -/* *************************** SCRIPT ******************************** */ - -static void extend_scriptlink(ScriptLink *slink) -{ - void *stmp, *ftmp; - - if (!slink) return; - - stmp= slink->scripts; - slink->scripts= MEM_mallocN(sizeof(ID*)*(slink->totscript+1), "scriptlistL"); - - ftmp= slink->flag; - slink->flag= MEM_mallocN(sizeof(short*)*(slink->totscript+1), "scriptlistF"); - - if (slink->totscript) { - memcpy(slink->scripts, stmp, sizeof(ID*)*(slink->totscript)); - MEM_freeN(stmp); - - memcpy(slink->flag, ftmp, sizeof(short)*(slink->totscript)); - MEM_freeN(ftmp); - } - - slink->scripts[slink->totscript]= NULL; - slink->flag[slink->totscript]= SCRIPT_FRAMECHANGED; - - slink->totscript++; - slink->actscript = slink->totscript; -} - -static void delete_scriptlink(ScriptLink *slink) -{ - int i; - - if (!slink) return; - - if (slink->totscript>0) { - for (i=slink->actscript-1; itotscript-1; i++) { - slink->flag[i]= slink->flag[i+1]; - slink->scripts[i]= slink->scripts[i+1]; - } - - slink->totscript--; - } - - CLAMP(slink->actscript, 1, slink->totscript); - - if (slink->totscript==0) { - if (slink->scripts) MEM_freeN(slink->scripts); - if (slink->flag) MEM_freeN(slink->flag); - - slink->scripts= NULL; - slink->flag= NULL; - slink->totscript= slink->actscript= 0; - } -} - -static char *scriptlinks_menu_string(void) -{ - char *menu = NULL; - DynStr *ds = BLI_dynstr_new(); - Text *text = G.main->text.first; - int txtcounter = 0; - - if (text) { - BLI_dynstr_append(ds, "Select Script Link%t"); - while (text) { - BLI_dynstr_append(ds, "|"); - BLI_dynstr_append(ds, text->id.name+2); - txtcounter += 1; - text = text->id.next; - } - if (txtcounter) menu = BLI_dynstr_get_cstring(ds); - } - BLI_dynstr_free(ds); - return menu; -} - -static void scriptlinks_pupmenu(ScriptLink *slink) -{ - short menuitem; - char *menustr = scriptlinks_menu_string(); - - if (!slink) return; - - if (menustr) { - menuitem = pupmenu_col(menustr, 20); - MEM_freeN(menustr); - if (menuitem > 0) { - Text *text = G.main->text.first; - while (--menuitem) text = text->id.next; - if (text) slink->scripts[slink->totscript - 1]= (ID *)text; - } - } -} - -void do_scriptbuts(unsigned short event) -{ - Object *ob=NULL; - ScriptLink *slink=NULL; - Material *ma; - - switch (event) { - case B_SSCRIPT_ADD: - slink = &G.scene->scriptlink; - extend_scriptlink(slink); - BIF_undo_push("Add scriptlink"); - scriptlinks_pupmenu(slink); - break; - case B_SSCRIPT_DEL: - BIF_undo_push("Delete scriptlink"); - delete_scriptlink(&G.scene->scriptlink); - break; - - case B_SCRIPT_ADD: - case B_SCRIPT_DEL: - ob= OBACT; - - if (ob && G.buts->scriptblock==ID_OB) { - slink= &ob->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_MA) { - ma= give_current_material(ob, ob->actcol); - if (ma) slink= &ma->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_CA) { - if (ob->type==OB_CAMERA) - slink= &((Camera *)ob->data)->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_LA) { - if (ob->type==OB_LAMP) - slink= &((Lamp *)ob->data)->scriptlink; - - } else if (G.buts->scriptblock==ID_WO) { - if (G.scene->world) - slink= &(G.scene->world->scriptlink); - } - - if (event==B_SCRIPT_ADD) { - extend_scriptlink(slink); - BIF_undo_push("Add scriptlink"); - scriptlinks_pupmenu(slink); - } - else { - delete_scriptlink(slink); - BIF_undo_push("Delete scriptlink"); - } - break; - default: - break; - } - - allqueue(REDRAWBUTSSCRIPT, 0); - allqueue(REDRAWOOPS, 0); -} - -void draw_scriptlink(uiBlock *block, ScriptLink *script, int sx, int sy, int scene) -{ - char str[256]; - - if (script->totscript) { - strcpy(str, "FrameChanged%x 1|"); - strcat(str, "Redraw%x 4|"); - strcat(str, "Render%x 16|"); - if (scene) { - strcat(str, "OnLoad%x 2|"); - strcat(str, "OnSave%x 8"); - } - uiBlockBeginAlign(block); - uiDefButS(block, MENU, 1, str, (short)sx, (short)sy, 140, 19, &script->flag[script->actscript-1], 0, 0, 0, 0, "Script links for this event"); - - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "", (short)(sx+140),(short)sy, 140, 19, &script->scripts[script->actscript-1], "Name of Script to link"); - uiBlockEndAlign(block); - } - - sprintf(str,"%d Scr:", script->totscript); - - uiDefButS(block, NUM, REDRAWBUTSSCRIPT, str, (short)(sx+140), (short)sy-20,60,19, &script->actscript, 1, script->totscript, 0, 0, "Total / Active Script link (LeftMouse + Drag to change)"); - - if (scene) { - - if (script->totscript<32767) - uiDefBut(block, BUT, B_SSCRIPT_ADD, "New", (short)(sx+240), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Add a new Script link"); - if (script->totscript) - uiDefBut(block, BUT, B_SSCRIPT_DEL, "Del", (short)(sx+200), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Delete the current Script link"); - uiDefBut(block, LABEL, 0, "Scene Script link", sx,sy-20,140,20, 0, 0, 0, 0, 0, ""); - } - else { - if (script->totscript<32767) - uiDefBut(block, BUT, B_SCRIPT_ADD, "New", (short)(sx+240), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Add a new Script link"); - if (script->totscript) - uiDefBut(block, BUT, B_SCRIPT_DEL, "Del", (short)(sx+200), (short)sy-20, 40, 19, 0, 0, 0, 0, 0, "Delete the current Script link"); - uiDefBut(block, LABEL, 0, "Selected Script link", sx,sy-20,140,20, 0, 0, 0, 0, 0, ""); - - } - -} - -/* ************************************* */ - -static void script_panel_scriptlink(void) -{ - uiBlock *block; - Object *ob=NULL; - ScriptLink *script=NULL; - Material *ma; - int xco = 10; - - block= uiNewBlock(&curarea->uiblocks, "script_panel_scriptlink", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Scriptlinks", "Script", 0, 0, 318, 204)==0) return; - - uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT, - "Enable Script Links", xco, 200, 150, 20, &G.f, 0, 0, 0, 0, - "Enable execution of all assigned Script links and Space Handelers"); - /* for proper alignment: */ - uiDefBut(block, LABEL, 0, "", 160, 200,150,20, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.f & G_DOSCRIPTLINKS) { - //uiBlockBeginAlign(block); - ob= OBACT; - if(ob) - uiDefIconButS(block, ROW, B_REDR, ICON_OBJECT, xco,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_OB, 0, 0, "Displays Object script links"); - - if(ob && give_current_material(ob, ob->actcol)) - uiDefIconButS(block, ROW, B_REDR, ICON_MATERIAL, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_MA, 0, 0, "Displays Material script links "); - - if(G.scene->world) - uiDefIconButS(block, ROW, B_REDR, ICON_WORLD, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_WO, 0, 0, "Displays World script links"); - - if(ob && ob->type==OB_CAMERA) - uiDefIconButS(block, ROW, B_REDR, ICON_CAMERA, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_CA, 0, 0, "Displays Camera script links"); - - if(ob && ob->type==OB_LAMP) - uiDefIconButS(block, ROW, B_REDR, ICON_LAMP, xco+=25,175,25,20, &G.buts->scriptblock, 2.0, (float)ID_LA, 0, 0, "Displays Lamp script links"); - //uiBlockEndAlign(block); - - if (ob && G.buts->scriptblock==ID_OB) { - script= &ob->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_MA) { - ma= give_current_material(ob, ob->actcol); - if (ma) script= &ma->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_CA) { - if (ob->type==OB_CAMERA) - script= &((Camera *)ob->data)->scriptlink; - - } else if (ob && G.buts->scriptblock==ID_LA) { - if (ob->type==OB_LAMP) - script= &((Lamp *)ob->data)->scriptlink; - - } else if (G.buts->scriptblock==ID_WO) { - if (G.scene->world) - script= &(G.scene->world->scriptlink); - } - - if (script) draw_scriptlink(block, script, 10, 140, 0); - - draw_scriptlink(block, &G.scene->scriptlink, 10, 80, 1); - } -} - - - - -void script_panels() -{ - script_panel_scriptlink(); - -} diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c deleted file mode 100644 index ad1afcc0608..00000000000 --- a/source/blender/src/buttons_shading.c +++ /dev/null @@ -1,4372 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: not all of this file anymore. :) - * - * Contributor(s): - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "MEM_guardedalloc.h" - -#include "DNA_brush_types.h" -#include "DNA_curve_types.h" -#include "DNA_customdata_types.h" -#include "DNA_image_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_node_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_particle_types.h" -#include "DNA_radio_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" - -#include "BKE_colortools.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_node.h" -#include "BKE_material.h" -#include "BKE_particle.h" -#include "BKE_utildefines.h" -#include "BKE_texture.h" - -#include "BKE_packedFile.h" -#include "BKE_plugin_types.h" -#include "BKE_image.h" - -#include "BLI_blenlib.h" -#include "BMF_Api.h" - -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" - -#include "BDR_drawmesh.h" - -#include "BIF_drawimage.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_previewrender.h" -#include "BIF_butspace.h" -#include "BIF_writeimage.h" -#include "BIF_toets.h" - -#include "mydevice.h" -#include "blendef.h" -#include "radio.h" - -#include "RE_pipeline.h" - -/* -----includes for this file specific----- */ - -#include "butspace.h" // own module - - -static MTex emptytex; -static int packdummy = 0; - -static char *mapto_blendtype_pup(void) -{ - static char formatstr[] = "|%s %%x%d"; - static char string[1024]; - char *str = string; - - str += sprintf(str, formatstr, "Mix", MTEX_BLEND); - - str += sprintf(str, formatstr, "Add", MTEX_ADD); - str += sprintf(str, formatstr, "Subtract", MTEX_SUB); - - str += sprintf(str, formatstr, "Multiply", MTEX_MUL); - str += sprintf(str, formatstr, "Screen", MTEX_SCREEN); - str += sprintf(str, formatstr, "Overlay", MTEX_OVERLAY); - - str += sprintf(str, formatstr, "Difference", MTEX_DIFF); - str += sprintf(str, formatstr, "Divide", MTEX_DIV); - - str += sprintf(str, formatstr, "Darken", MTEX_DARK); - str += sprintf(str, formatstr, "Lighten", MTEX_LIGHT); - - return string; -} - -void shade_buttons_change_3d(void) -{ - Object *ob= OBACT; - ScrArea *sa; - - if(ob==NULL) return; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_VIEW3D) { - View3D *v3d= sa->spacedata.first; - - if(v3d->drawtype >= OB_SOLID) addqueue(sa->win, REDRAW, 0); - if(v3d->drawtype == OB_SHADED) { - if(ob->type==OB_LAMP) reshadeall_displist(); - else { - /* all objects using material */ - Base *base= FIRSTBASE; - Material *ma= give_current_material(ob, ob->actcol); - int a; - - while(base) { - if(base->lay & G.vd->lay) { - for(a=1; a<=ob->totcol; a++) { - if(ma == give_current_material(base->object, a)) { - freedisplist(&(base->object->disp)); - break; - } - } - } - base= base->next; - } - } - } - } - } -} - -/* *************************** TEXTURE ******************************** */ - -static void load_image_cb(char *str, void *ima_pp_v, void *iuser_v) /* called from fileselect or button */ -{ - Image **ima_pp= (Image **)ima_pp_v; - Image *ima= NULL; - - ima= BKE_add_image_file(str); - if(ima) { - if(*ima_pp) { - (*ima_pp)->id.us--; - } - *ima_pp= ima; - - BKE_image_signal(ima, iuser_v, IMA_SIGNAL_RELOAD); - - /* button event gets lost when it goes via filewindow */ - if(G.buts && G.buts->lockpoin) { - Tex *tex= G.buts->lockpoin; - if(GS(tex->id.name)==ID_TE) { - BIF_preview_changed(ID_TE); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - } - } - } - - BIF_undo_push("Load image"); -} - -static void load_plugin_tex(char *str, void *tex_v, void *unused) /* called from fileselect */ -{ - Tex *tex= tex_v; - - if(tex->type!=TEX_PLUGIN) return; - - if(tex->plugin) free_plugin_tex(tex->plugin); - - tex->stype= 0; - tex->plugin= add_plugin_tex(str); - - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); -} - -static void save_env(char *name) -{ - Tex *tex; - char str[FILE_MAX]; - - strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - tex= G.buts->lockpoin; - - if(tex && GS(tex->id.name)==ID_TE) { - if(tex->env && tex->env->ok && saveover(str)) { - waitcursor(1); - BIF_save_envmap(tex->env, str); - strcpy(G.ima, name); - waitcursor(0); - } - } - -} - -static int vergcband(const void *a1, const void *a2) -{ - const CBData *x1=a1, *x2=a2; - - if( x1->pos > x2->pos ) return 1; - else if( x1->pos < x2->pos) return -1; - return 0; -} - -void do_texbuts(unsigned short event) -{ - Tex *tex; - ScrArea *sa; - char str[FILE_MAX]; - - tex= G.buts->lockpoin; - - switch(event) { - case B_TEXPRV: - BIF_preview_changed(ID_TE); - allqueue(REDRAWBUTSSHADING, 0); - - if(tex && G.scene->nodetree) { - NodeTagIDChanged(G.scene->nodetree, &tex->id); - allqueue(RECALC_COMPOSITE, 0); - } - break; - case B_TEXCHANNEL: - scrarea_queue_headredraw(curarea); - BIF_preview_changed(ID_TE); - allqueue(REDRAWBUTSSHADING, 0); - if(G.buts->texfrom == 3) /* brush texture */ - allqueue(REDRAWIMAGE, 0); - break; - case B_TEXTYPE: - if(tex==NULL) return; - tex->stype= 0; - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - - if(tex && G.scene->nodetree) { - NodeTagIDChanged(G.scene->nodetree, &tex->id); - allqueue(RECALC_COMPOSITE, 0); - } - break; - case B_DEFTEXVAR: - if(tex==NULL) return; - default_tex(tex); - BIF_undo_push("Default texture vars"); - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - break; - - case B_IMAGECHANGED: - BIF_preview_changed(ID_TE); - allqueue(REDRAWBUTSSHADING, 0); - - if(tex) { - if(G.scene->nodetree) { - NodeTagIDChanged(G.scene->nodetree, &tex->id); - allqueue(RECALC_COMPOSITE, 0); - } - if(tex->ima && (tex->imaflag & TEX_MIPMAP) && (tex->ima->flag & IMA_FIELDS)) { - error("Cannot combine fields and mipmap"); - tex->imaflag -= TEX_MIPMAP; - } - if(tex->env) - BKE_free_envmapdata(tex->env); - } - - break; - - case B_TEXREDR_PRV: - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - shade_buttons_change_3d(); - break; - - - case B_LOADPLUGIN: - if(tex==NULL) return; - - sa= closest_bigger_area(); - areawinset(sa->win); - if(tex->plugin) strcpy(str, tex->plugin->name); - else { - strcpy(str, U.plugtexdir); - } - activate_fileselect_args(FILE_SPECIAL, "SELECT PLUGIN", str, load_plugin_tex, tex, NULL); - - break; - - case B_NAMEPLUGIN: - if(tex==NULL || tex->plugin==NULL) return; - strcpy(str, tex->plugin->name); - free_plugin_tex(tex->plugin); - tex->stype= 0; - tex->plugin= add_plugin_tex(str); - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - break; - - case B_COLORBAND: - if(tex==NULL) return; - if(tex->coba==NULL) tex->coba= add_colorband(0); - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); // also ramps, so we do this - break; - - case B_ENV_DELETE: - if(tex->env) { - BKE_free_envmap(tex->env); - tex->env= 0; - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - } - break; - case B_ENV_FREE: - if(tex->env) { - BKE_free_envmapdata(tex->env); - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - } - break; - case B_ENV_FREE_ALL: - tex= G.main->tex.first; - while(tex) { - if(tex->id.us && tex->type==TEX_ENVMAP) { - if(tex->env) { - if(tex->env->stype!=ENV_LOAD) BKE_free_envmapdata(tex->env); - } - } - tex= tex->id.next; - } - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_TE); - break; - case B_ENV_SAVE: - if(tex->env && tex->env->ok) { - if(tex->env->type==ENV_PLANE) { - notice("Sorry, not implemented yet"); - } - else { - sa= closest_bigger_area(); - areawinset(sa->win); - save_image_filesel_str(str); - activate_fileselect(FILE_SPECIAL, str, G.ima, save_env); - } - } - break; - case B_ENV_OB: - if(tex->env && tex->env->object) { - BIF_preview_changed(ID_TE); - if ELEM(tex->env->object->type, OB_CAMERA, OB_LAMP) { - error("Camera or Lamp not allowed"); - tex->env->object= NULL; - } - } - break; - - default: - if(event>=B_PLUGBUT && event<=B_PLUGBUT+23) { - PluginTex *pit= tex->plugin; - if(pit && pit->callback) { - pit->callback(event - B_PLUGBUT); - BIF_preview_changed(ID_TE); - allqueue(REDRAWBUTSSHADING, 0); - } - } - } -} - -static void texture_panel_plugin(Tex *tex) -{ - uiBlock *block; - VarStruct *varstr; - PluginTex *pit; - short xco, yco, a; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_plugin", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Plugin", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - if(tex->plugin && tex->plugin->doit) { - - pit= tex->plugin; - - for(a=0; astypes; a++) { - uiDefButS(block, ROW, B_TEXREDR_PRV, pit->stnames+16*a, (76*a), 152, 75, 20, &tex->stype, 2.0, (float)a, 0, 0, ""); - } - - varstr= pit->varstr; - if(varstr) { - for(a=0; avars; a++, varstr++) { - xco= 140*(a/6)+1; - yco= 125 - 20*(a % 6)+1; - uiDefBut(block, varstr->type, B_PLUGBUT+a, varstr->name, xco,yco,137,19, &(pit->data[a]), varstr->min, varstr->max, 100, 0, varstr->tip); - } - } - uiDefBut(block, TEX, B_NAMEPLUGIN, "", 0,180,318,24, pit->name, 0.0, 159.0, 0, 0, ""); - } - - uiDefBut(block, BUT, B_LOADPLUGIN, "Load Plugin", 0,204,137,24, 0, 0, 0, 0, 0, ""); - -} - - -static void texture_panel_magic(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_magic", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Magic", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_TEXPRV, "Depth:", 10, 90, 150, 19, &tex->noisedepth, 0.0, 10.0, 0, 0, "Sets the depth of the pattern"); - uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the strength of the pattern"); -} - -static void texture_panel_blend(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_blend", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Blend", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Lin", 10, 180, 75, 19, &tex->stype, 2.0, (float)TEX_LIN, 0, 0, "Creates a linear progresion"); - uiDefButS(block, ROW, B_TEXPRV, "Quad", 85, 180, 75, 19, &tex->stype, 2.0, (float)TEX_QUAD, 0, 0, "Creates a quadratic progression"); - uiDefButS(block, ROW, B_TEXPRV, "Ease", 160, 180, 75, 19, &tex->stype, 2.0, (float)TEX_EASE, 0, 0, "Creates a progression easing from one step to the next"); - uiDefButBitS(block, TOG, TEX_FLIPBLEND, B_TEXPRV, "Flip XY", 235, 180, 75, 19, &tex->flag, 0, 0, 0, 0, "Flips the direction of the progression 90 degrees"); - - uiDefButS(block, ROW, B_TEXPRV, "Diag", 10, 160, 75, 19, &tex->stype, 2.0, (float)TEX_DIAG, 0, 0, "Use a diagonal progression"); - uiDefButS(block, ROW, B_TEXPRV, "Sphere", 85, 160, 75, 19, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere"); - uiDefButS(block, ROW, B_TEXPRV, "Halo", 160, 160, 75, 19, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere"); - uiDefButS(block, ROW, B_TEXPRV, "Radial", 235, 160, 75, 19, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression"); - -} - -/* newnoise: noisebasis menu string */ -static char* noisebasis_menu() -{ - static char nbmenu[256]; - sprintf(nbmenu, "Noise Basis %%t|Blender Original %%x%d|Original Perlin %%x%d|Improved Perlin %%x%d|Voronoi F1 %%x%d|Voronoi F2 %%x%d|Voronoi F3 %%x%d|Voronoi F4 %%x%d|Voronoi F2-F1 %%x%d|Voronoi Crackle %%x%d|CellNoise %%x%d", TEX_BLENDER, TEX_STDPERLIN, TEX_NEWPERLIN, TEX_VORONOI_F1, TEX_VORONOI_F2, TEX_VORONOI_F3, TEX_VORONOI_F4, TEX_VORONOI_F2F1, TEX_VORONOI_CRACKLE, TEX_CELLNOISE); - return nbmenu; -} - -static void texture_panel_wood(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_wood", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Wood", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Bands", 10, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BAND, 0, 0, "Uses standard wood texture in bands"); - uiDefButS(block, ROW, B_TEXPRV, "Rings", 85, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RING, 0, 0, "Uses wood texture in rings"); - uiDefButS(block, ROW, B_TEXPRV, "BandNoise", 160, 180, 75, 18, &tex->stype, 2.0, (float)TEX_BANDNOISE, 0, 0, "Adds noise to standard wood"); - uiDefButS(block, ROW, B_TEXPRV, "RingNoise", 235, 180, 75, 18, &tex->stype, 2.0, (float)TEX_RINGNOISE, 0, 0, "Adds noise to rings"); - - uiDefButS(block, ROW, B_TEXPRV, "Sin", 10, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SIN, 0, 0, "Uses a sine wave to produce bands"); - uiDefButS(block, ROW, B_TEXPRV, "Saw", 60, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_SAW, 0, 0, "Uses a saw wave to produce bands"); - uiDefButS(block, ROW, B_TEXPRV, "Tri", 110, 160, 50, 19, &tex->noisebasis2, 8.0, (float)TEX_TRI, 0, 0, "Uses a triangle wave to produce bands"); - uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 160, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise"); - uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 235, 160, 75, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 160, 130, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the bandnoise and ringnoise types"); - uiBlockEndAlign(block); - - /* newnoise: noisebasis menu */ - uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence"); - uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - -} - -static void texture_panel_stucci(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_stucci", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Stucci", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Plastic", 10, 180, 100, 19, &tex->stype, 2.0, (float)TEX_PLASTIC, 0, 0, "Uses standard stucci"); - uiDefButS(block, ROW, B_TEXPRV, "Wall In", 110, 180, 100, 19, &tex->stype, 2.0, (float)TEX_WALLIN, 0, 0, "Creates Dimples"); - uiDefButS(block, ROW, B_TEXPRV, "Wall Out", 210, 180, 100, 19, &tex->stype, 2.0, (float)TEX_WALLOUT, 0, 0, "Creates Ridges"); - - uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 10, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise"); - uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 160, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 90, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the depth of the stucci"); - uiBlockEndAlign(block); - - /* newnoise: noisebasis menu */ - uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence"); - // note, nabla not supported here! -// uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - -} - -static void texture_panel_marble(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_marble", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Marble", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Soft", 10, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SOFT, 0, 0, "Uses soft marble"); - uiDefButS(block, ROW, B_TEXPRV, "Sharp", 110, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SHARP, 0, 0, "Uses more clearly defined marble"); - uiDefButS(block, ROW, B_TEXPRV, "Sharper", 210, 180, 100, 18, &tex->stype, 2.0, (float)TEX_SHARPER, 0, 0, "Uses very clearly defined marble"); - - uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 10, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise"); - uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 160, 160, 150, 19, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise"); - - uiDefButS(block, ROW, B_TEXPRV, "Sin", 10, 140, 100, 18, &tex->noisebasis2, 8.0, 0.0, 0, 0, "Uses a sine wave to produce bands."); - uiDefButS(block, ROW, B_TEXPRV, "Saw", 110, 140, 100, 18, &tex->noisebasis2, 8.0, 1.0, 0, 0, "Uses a saw wave to produce bands"); - uiDefButS(block, ROW, B_TEXPRV, "Tri", 210, 140, 100, 18, &tex->noisebasis2, 8.0, 2.0, 0, 0, "Uses a triangle wave to produce bands"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 110, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiDefButS(block, NUM, B_TEXPRV, "NoiseDepth:", 10, 90, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Sets the depth of the marble calculation"); - uiDefButF(block, NUM, B_TEXPRV, "Turbulence:", 10, 70, 150, 19, &tex->turbul, 0.0, 200.0, 10, 0, "Sets the turbulence of the sine bands"); - uiBlockEndAlign(block); - - /* newnoise: noisebasis menu */ - uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence"); - uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - -} - -static void texture_panel_clouds(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_clouds", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Clouds", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Default", 10, 180, 70, 18, &tex->stype, 2.0, (float)TEX_DEFAULT, 0, 0, "Uses standard noise"); - uiDefButS(block, ROW, B_TEXPRV, "Color", 80, 180, 70, 18, &tex->stype, 2.0, (float)TEX_COLOR, 0, 0, "Lets Noise return RGB value"); - uiDefButS(block, ROW, B_TEXPRV, "Soft noise", 155, 180, 75, 18, &tex->noisetype, 12.0, (float)TEX_NOISESOFT, 0, 0, "Generates soft noise"); - uiDefButS(block, ROW, B_TEXPRV, "Hard noise", 230, 180, 80, 18, &tex->noisetype, 12.0, (float)TEX_NOISEPERL, 0, 0, "Generates hard noise"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize :", 10, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiDefButS(block, NUM, B_TEXPRV, "NoiseDepth:", 160, 130, 150, 19, &tex->noisedepth, 0.0, 6.0, 0, 0, "Sets the depth of the cloud calculation"); - uiBlockEndAlign(block); - - /* newnoise: noisebasis menu */ - uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence"); - uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - -} - -/*****************************************/ -/* newnoise: panel(s) for musgrave types */ -/*****************************************/ - -static void texture_panel_musgrave(Tex *tex) -{ - uiBlock *block; - char *str; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_musgrave", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Musgrave", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* TEX_MFRACTAL, TEX_RIDGEDMF, TEX_HYBRIDMF, TEX_FBM, TEX_HTERRAIN */ - str= "Multifractal %x0|Ridged Multifractal %x1|Hybrid Multifractal %x2|Hetero Terrain %x4|fBm %x3"; - uiDefButS(block, MENU, B_TEXREDR_PRV, str, 10, 160, 150, 19, &tex->stype, 0.0, 0.0, 0, 0, "Sets Musgrave type"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_TEXPRV, "H: ", 10, 130, 150, 19, &tex->mg_H, 0.0001, 2.0, 10, 0, "Sets the highest fractal dimension"); - uiDefButF(block, NUMSLI, B_TEXPRV, "Lacu: ", 160, 130, 150, 19, &tex->mg_lacunarity, 0.0, 6.0, 10, 0, "Sets the gap between succesive frequencies"); - uiDefButF(block, NUMSLI, B_TEXPRV, "Octs: ", 10, 110, 150, 19, &tex->mg_octaves, 0.0, 8.0, 10, 0, "Sets the number of frequencies used"); - if ((tex->stype==TEX_RIDGEDMF) || (tex->stype==TEX_HYBRIDMF) || (tex->stype==TEX_HTERRAIN)) { - uiDefButF(block, NUMSLI, B_TEXPRV, "Ofst: ", 160, 110, 150, 19, &tex->mg_offset, 0.0, 6.0, 10, 0, "Sets the fractal offset"); - if ((tex->stype==TEX_RIDGEDMF) || (tex->stype==TEX_HYBRIDMF)) - uiDefButF(block, NUMSLI, B_TEXPRV, "Gain: ", 10, 90, 150, 19, &tex->mg_gain, 0.0, 6.0, 10, 0, "Sets the gain multiplier"); - } - - uiBlockBeginAlign(block); - /* noise output scale */ - uiDefButF(block, NUM, B_TEXPRV, "iScale: ", 10, 60, 150, 19, &tex->ns_outscale, 0.0, 10.0, 10, 0, "Scales intensity output"); - /* frequency scale */ - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize: ", 160, 60, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiBlockEndAlign(block); - - /* noisebasis menu */ - uiDefBut(block, LABEL, 0, "Noise Basis", 10, 30, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 10, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis used for turbulence"); - uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 10, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - -} - - -static void texture_panel_distnoise(Tex *tex) -{ - uiBlock *block; - block= uiNewBlock(&curarea->uiblocks, "texture_panel_distnoise", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Distorted Noise", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - /* distortion amount */ - uiDefButF(block, NUM, B_TEXPRV, "DistAmnt: ", 10, 130, 150, 19, &tex->dist_amount, 0.0, 10.0, 10, 0, "Sets amount of distortion"); - /* frequency scale */ - uiDefButF(block, NUM, B_TEXPRV, "NoiseSize: ", 160, 130, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Distortion Noise", 10, 100, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Noise Basis", 160, 100, 150, 19, 0, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - /* noisebasis used for the distortion */ - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 10, 80, 150, 19, &tex->noisebasis, 0,0,0,0, "Sets the noise basis which does the distortion"); - /* noisebasis to distort */ - uiDefButS(block, MENU, B_TEXPRV, noisebasis_menu(), 160, 80, 150, 19, &tex->noisebasis2, 0,0,0,0, "Sets the noise basis to distort"); - uiBlockEndAlign(block); - - uiDefButF(block, NUM, B_NOP, "Nabla: ", 10, 50, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); -} - - -static void texture_panel_voronoi(Tex *tex) -{ - char dm_menu[256]; - uiBlock *block; - block= uiNewBlock(&curarea->uiblocks, "texture_panel_voronoi", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Voronoi", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* color types */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXPRV, "Int", 10, 180, 75, 18, &tex->vn_coltype, 1.0, 0.0, 0, 0, "Only calculate intensity"); - uiDefButS(block, ROW, B_TEXPRV, "Col1", 85, 180, 75, 18, &tex->vn_coltype, 1.0, 1.0, 0, 0, "Color cells by position"); - uiDefButS(block, ROW, B_TEXPRV, "Col2", 160, 180, 75, 18, &tex->vn_coltype, 1.0, 2.0, 0, 0, "Same as Col1 + outline based on F2-F1"); - uiDefButS(block, ROW, B_TEXPRV, "Col3", 235, 180, 75, 18, &tex->vn_coltype, 1.0, 3.0, 0, 0, "Same as Col2 * intensity"); - uiBlockEndAlign(block); - - /* distance metric */ - sprintf(dm_menu, "Distance Metric %%t|Actual Distance %%x%d|Distance Squared %%x%d|Manhattan %%x%d|Chebychev %%x%d|Minkovsky 1/2 %%x%d|Minkovsky 4 %%x%d|Minkovsky %%x%d", TEX_DISTANCE, TEX_DISTANCE_SQUARED, TEX_MANHATTAN, TEX_CHEBYCHEV, TEX_MINKOVSKY_HALF, TEX_MINKOVSKY_FOUR, TEX_MINKOVSKY); - uiDefBut(block, LABEL, B_TEXPRV, "Distance Metric", 10, 160, 150, 19, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXPRV, dm_menu, 10, 140, 150, 19, &tex->vn_distm, 0,0,0,0, "Sets the distance metric to be used"); - - if (tex->vn_distm==TEX_MINKOVSKY) - uiDefButF(block, NUMSLI, B_TEXPRV, "Exp: ", 10, 120, 150, 19, &tex->vn_mexp, 0.01, 10.0, 10, 0, "Sets minkovsky exponent"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "iScale: ", 160, 140, 150, 19, &tex->ns_outscale, 0.01, 10.0, 10, 0, "Scales intensity output"); - uiDefButF(block, NUM, B_TEXPRV, "Size: ", 160, 120, 150, 19, &tex->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NOP, "Nabla: ", 160, 70, 150, 19, &tex->nabla, 0.001, 0.1, 1, 0, "Defines size of derivative offset used for calculating normal"); - - /* weights */ - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_TEXPRV, "W1: ", 10, 70, 150, 19, &tex->vn_w1, -2.0, 2.0, 10, 0, "Sets feature weight 1"); - uiDefButF(block, NUMSLI, B_TEXPRV, "W2: ", 10, 50, 150, 19, &tex->vn_w2, -2.0, 2.0, 10, 0, "Sets feature weight 2"); - uiDefButF(block, NUMSLI, B_TEXPRV, "W3: ", 10, 30, 150, 19, &tex->vn_w3, -2.0, 2.0, 10, 0, "Sets feature weight 3"); - uiDefButF(block, NUMSLI, B_TEXPRV, "W4: ", 10, 10, 150, 19, &tex->vn_w4, -2.0, 2.0, 10, 0, "Sets feature weight 4"); -} - - -static char *layer_menu(RenderResult *rr, short *curlay) -{ - RenderLayer *rl; - int len= 64 + 32*BLI_countlist(&rr->layers); - short a, nr= 0; - char *str= MEM_callocN(len, "menu layers"); - - strcpy(str, "Layer %t"); - a= strlen(str); - - /* compo result */ - if(rr->rectf) { - a+= sprintf(str+a, "|Composite %%x0"); - nr= 1; - } - for(rl= rr->layers.first; rl; rl= rl->next, nr++) { - a+= sprintf(str+a, "|%s %%x%d", rl->name, nr); - } - - if(*curlay >= nr) - *curlay= 0; - - return str; -} - -/* rl==NULL means composite result */ -static char *pass_menu(RenderLayer *rl, short *curpass) -{ - RenderPass *rpass; - int len= 64 + 32*(rl?BLI_countlist(&rl->passes):1); - short a, nr= 0; - char *str= MEM_callocN(len, "menu layers"); - - strcpy(str, "Pass %t"); - a= strlen(str); - - /* rendered results don't have a Combined pass */ - if(rl==NULL || rl->rectf) { - a+= sprintf(str+a, "|Combined %%x0"); - nr= 1; - } - - if(rl) - for(rpass= rl->passes.first; rpass; rpass= rpass->next, nr++) - a+= sprintf(str+a, "|%s %%x%d", rpass->name, nr); - - if(*curpass >= nr) - *curpass= 0; - - return str; -} - -static void set_frames_cb(void *ima_v, void *iuser_v) -{ - Image *ima= ima_v; - ImageUser *iuser= iuser_v; - - if(ima->anim) { - iuser->frames = IMB_anim_get_duration(ima->anim); - BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0); - } -} - -static void image_src_change_cb(void *ima_v, void *iuser_v) -{ - BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_SRC_CHANGE); -} - -/* buttons have 2 arg callbacks, filewindow has 3 args... so thats why the wrapper below */ -static void image_browse_cb1(char *unused, void *ima_pp_v, void *iuser_v) -{ - Image **ima_pp= (Image **)ima_pp_v; - ImageUser *iuser= iuser_v; - - if(ima_pp) { - Image *ima= *ima_pp; - - if(iuser->menunr== -2) { - activate_databrowse_args(&ima->id, ID_IM, 0, &iuser->menunr, image_browse_cb1, ima_pp, iuser); - } - else if (iuser->menunr>0) { - Image *newima= (Image*) BLI_findlink(&G.main->image, iuser->menunr-1); - - if (newima && newima!=ima) { - *ima_pp= newima; - id_us_plus(&newima->id); - if(ima) ima->id.us--; - - BKE_image_signal(newima, iuser, IMA_SIGNAL_USER_NEW_IMAGE); - - BIF_undo_push("Browse image"); - } - } - } -} - -static void image_browse_cb(void *ima_pp_v, void *iuser_v) -{ - image_browse_cb1(NULL, ima_pp_v, iuser_v); -} - -static void image_reload_cb(void *ima_v, void *iuser_v) -{ - if(ima_v) { - BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_RELOAD); - } -} - -static void image_field_test(void *ima_v, void *iuser_v) -{ - Image *ima= ima_v; - - if(ima) { - ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v); - if(ibuf) { - short nr= 0; - if( !(ima->flag & IMA_FIELDS) && (ibuf->flags & IB_fields) ) nr= 1; - if( (ima->flag & IMA_FIELDS) && !(ibuf->flags & IB_fields) ) nr= 1; - if(nr) { - BKE_image_signal(ima, iuser_v, IMA_SIGNAL_FREE); - } - } - } -} - -static void image_unlink_cb(void *ima_pp_v, void *unused) -{ - Image **ima_pp= (Image **)ima_pp_v; - - if(ima_pp && *ima_pp) { - Image *ima= *ima_pp; - ima->id.us--; - *ima_pp= NULL; - } -} - -static void image_load_fs_cb(void *ima_pp_v, void *iuser_v) -{ - Image **ima_pp= (Image **)ima_pp_v; - ScrArea *sa; - char *name; - - if(ima_pp==NULL) return; - - sa= closest_bigger_area(); - areawinset(sa->win); - if(*ima_pp) name= (*ima_pp)->name; -#ifdef _WIN32 - else { - if (strcmp (U.textudir, "/") == 0) - name= G.sce; - else - name= U.textudir; - } -#else - else name = U.textudir; -#endif - if (G.qual & LR_CTRLKEY) { - activate_imageselect_args(FILE_SPECIAL, "SELECT IMAGE", name, load_image_cb, ima_pp_v, iuser_v); - } - else { - activate_fileselect_args(FILE_SPECIAL, "SELECT IMAGE", name, load_image_cb, ima_pp_v, iuser_v); - } -} - -/* 5 layer button callbacks... */ -static void image_multi_cb(void *rr_v, void *iuser_v) -{ - BKE_image_multilayer_index(rr_v, iuser_v); -} -static void image_multi_inclay_cb(void *rr_v, void *iuser_v) -{ - RenderResult *rr= rr_v; - ImageUser *iuser= iuser_v; - int tot= BLI_countlist(&rr->layers) + (rr->rectf?1:0); /* fake compo result layer */ - if(iuser->layerlayer++; - BKE_image_multilayer_index(rr, iuser); -} -static void image_multi_declay_cb(void *rr_v, void *iuser_v) -{ - ImageUser *iuser= iuser_v; - if(iuser->layer>0) - iuser->layer--; - BKE_image_multilayer_index(rr_v, iuser); -} -static void image_multi_incpass_cb(void *rr_v, void *iuser_v) -{ - RenderResult *rr= rr_v; - ImageUser *iuser= iuser_v; - RenderLayer *rl= BLI_findlink(&rr->layers, iuser->layer); - if(rl) { - int tot= BLI_countlist(&rl->passes) + (rl->rectf?1:0); /* builtin render result has no combined pass in list */ - if(iuser->passpass++; - BKE_image_multilayer_index(rr, iuser); - } - } -} -static void image_multi_decpass_cb(void *rr_v, void *iuser_v) -{ - ImageUser *iuser= iuser_v; - if(iuser->pass>0) { - iuser->pass--; - BKE_image_multilayer_index(rr_v, iuser); - } -} - -static void image_pack_cb(void *ima_v, void *iuser_v) -{ - if(ima_v) { - Image *ima= ima_v; - if(ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE) { - if (ima->packedfile) { - if (G.fileflags & G_AUTOPACK) { - if (okee("Disable AutoPack ?")) { - G.fileflags &= ~G_AUTOPACK; - } - } - - if ((G.fileflags & G_AUTOPACK) == 0) { - unpackImage(ima, PF_ASK); - BIF_undo_push("Unpack image"); - } - } - else { - ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v); - if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { - error("Can't pack painted image. Save image or use Repack as PNG."); - } else { - ima->packedfile = newPackedFile(ima->name); - BIF_undo_push("Pack image"); - } - } - } - } -} - -static void image_load_cb(void *ima_pp_v, void *iuser_v) -{ - if(ima_pp_v) { - Image *ima= *((Image **)ima_pp_v); - ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v); - char str[FILE_MAX]; - - /* name in ima has been changed by button! */ - BLI_strncpy(str, ima->name, FILE_MAX); - if(ibuf) BLI_strncpy(ima->name, ibuf->name, FILE_MAX); - - load_image_cb(str, ima_pp_v, iuser_v); - } -} - -static void image_freecache_cb(void *ima_v, void *unused) -{ - BKE_image_free_anim_ibufs(ima_v, G.scene->r.cfra); - allqueue(REDRAWIMAGE, 0); -} - -static void image_generated_change_cb(void *ima_v, void *iuser_v) -{ - BKE_image_signal(ima_v, iuser_v, IMA_SIGNAL_FREE); -} - -static void image_user_change(void *iuser_v, void *unused) -{ - BKE_image_user_calc_imanr(iuser_v, G.scene->r.cfra, 0); -} - -void uiblock_layer_pass_buttons(uiBlock *block, RenderResult *rr, ImageUser *iuser, int event, int x, int y, int w) -{ - uiBut *but; - RenderLayer *rl= NULL; - int wmenu1, wmenu2; - char *strp; - - /* layer menu is 1/3 larger than pass */ - wmenu1= (3*w)/5; - wmenu2= (2*w)/5; - - /* menu buts */ - strp= layer_menu(rr, &iuser->layer); - but= uiDefButS(block, MENU, event, strp, x, y, wmenu1, 20, &iuser->layer, 0,0,0,0, "Select Layer"); - uiButSetFunc(but, image_multi_cb, rr, iuser); - MEM_freeN(strp); - - rl= BLI_findlink(&rr->layers, iuser->layer - (rr->rectf?1:0)); /* fake compo layer, return NULL is meant to be */ - strp= pass_menu(rl, &iuser->pass); - but= uiDefButS(block, MENU, event, strp, x+wmenu1, y, wmenu2, 20, &iuser->pass, 0,0,0,0, "Select Pass"); - uiButSetFunc(but, image_multi_cb, rr, iuser); - MEM_freeN(strp); -} - -static void uiblock_layer_pass_arrow_buttons(uiBlock *block, RenderResult *rr, ImageUser *iuser, int imagechanged) -{ - uiBut *but; - - if(rr==NULL || iuser==NULL) - return; - if(rr->layers.first==NULL) { - uiDefBut(block, LABEL, 0, "No Layers in Render Result,", 10, 107, 300, 20, NULL, 1, 0, 0, 0, ""); - return; - } - - uiBlockBeginAlign(block); - - /* decrease, increase arrows */ - but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_LEFT, 10,107,17,20, NULL, 0, 0, 0, 0, "Previous Layer"); - uiButSetFunc(but, image_multi_declay_cb, rr, iuser); - but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_RIGHT, 27,107,18,20, NULL, 0, 0, 0, 0, "Next Layer"); - uiButSetFunc(but, image_multi_inclay_cb, rr, iuser); - - uiblock_layer_pass_buttons(block, rr, iuser, imagechanged, 45, 107, 230); - - /* decrease, increase arrows */ - but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_LEFT, 275,107,17,20, NULL, 0, 0, 0, 0, "Previous Pass"); - uiButSetFunc(but, image_multi_decpass_cb, rr, iuser); - but= uiDefIconBut(block, BUT, imagechanged, ICON_TRIA_RIGHT, 292,107,18,20, NULL, 0, 0, 0, 0, "Next Pass"); - uiButSetFunc(but, image_multi_incpass_cb, rr, iuser); - - uiBlockEndAlign(block); - -} - -/* The general Image panel with the loadsa callbacks! */ -void uiblock_image_panel(uiBlock *block, Image **ima_pp, ImageUser *iuser, - short redraw, short imagechanged) -{ - Image *ima= *ima_pp; - uiBut *but; - char str[128], *strp; - - /* different stuff when we show viewer */ - if(ima && ima->source==IMA_SRC_VIEWER) { - ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser); - - image_info(ima, ibuf, str); - uiDefBut(block, LABEL, 0, ima->id.name+2, 10, 180, 300, 20, NULL, 1, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, str, 10, 160, 300, 20, NULL, 1, 0, 0, 0, ""); - - if(ima->type==IMA_TYPE_COMPOSITE) { - iuser= ntree_get_active_iuser(G.scene->nodetree); - if(iuser) { - uiBlockBeginAlign(block); - uiDefIconTextBut(block, BUT, B_SIMA_RECORD, ICON_REC, "Record", 10,120,100,20, 0, 0, 0, 0, 0, ""); - uiDefIconTextBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, "Play", 110,120,100,20, 0, 0, 0, 0, 0, ""); - but= uiDefBut(block, BUT, B_NOP, "Free Cache", 210,120,100,20, 0, 0, 0, 0, 0, ""); - uiButSetFunc(but, image_freecache_cb, ima, NULL); - - if(iuser->frames) - sprintf(str, "(%d) Frames:", iuser->framenr); - else strcpy(str, "Frames:"); - uiBlockBeginAlign(block); - uiDefButI(block, NUM, imagechanged, str, 10, 90,150, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use"); - uiDefButI(block, NUM, imagechanged, "StartFr:", 160,90,150,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie"); - } - } - else if(ima->type==IMA_TYPE_R_RESULT) { - /* browse layer/passes */ - uiblock_layer_pass_arrow_buttons(block, RE_GetResult(RE_GetRender(G.scene->id.name)), iuser, imagechanged); - } - return; - } - - /* the main ima source types */ - if(ima) { - uiSetButLock(ima->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - uiBlockBeginAlign(block); - uiBlockSetFunc(block, image_src_change_cb, ima, iuser); - uiDefButS(block, ROW, imagechanged, "Still", 10, 180, 60, 20, &ima->source, 0.0, IMA_SRC_FILE, 0, 0, "Single Image file"); - uiDefButS(block, ROW, imagechanged, "Movie", 70, 180, 60, 20, &ima->source, 0.0, IMA_SRC_MOVIE, 0, 0, "Movie file"); - uiDefButS(block, ROW, imagechanged, "Sequence", 130, 180, 90, 20, &ima->source, 0.0, IMA_SRC_SEQUENCE, 0, 0, "Multiple Image files, as a sequence"); - uiDefButS(block, ROW, imagechanged, "Generated", 220, 180, 90, 20, &ima->source, 0.0, IMA_SRC_GENERATED, 0, 0, "Generated Image"); - uiBlockSetFunc(block, NULL, NULL, NULL); - } - else - uiDefBut(block, LABEL, 0, " ", 10, 180, 300, 20, 0, 0, 0, 0, 0, ""); /* for align in panel */ - - /* Browse */ - IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), NULL, &iuser->menunr); - - uiBlockBeginAlign(block); - but= uiDefButS(block, MENU, imagechanged, strp, 10,155,23,20, &iuser->menunr, 0, 0, 0, 0, "Selects an existing Image or Movie"); - uiButSetFunc(but, image_browse_cb, ima_pp, iuser); - - MEM_freeN(strp); - - /* name + options, or only load */ - if(ima) { - int drawpack= (ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE && ima->ok); - - but= uiDefBut(block, TEX, B_IDNAME, "IM:", 33, 155, 177, 20, ima->id.name+2, 0.0, 21.0, 0, 0, "Current Image Datablock name."); - uiButSetFunc(but, test_idbutton_cb, ima->id.name, NULL); - but= uiDefBut(block, BUT, imagechanged, "Reload", 210, 155, 60, 20, NULL, 0, 0, 0, 0, "Reloads Image or Movie"); - uiButSetFunc(but, image_reload_cb, ima, iuser); - - but= uiDefIconBut(block, BUT, imagechanged, ICON_X, 270,155,20,20, 0, 0, 0, 0, 0, "Unlink Image block"); - uiButSetFunc(but, image_unlink_cb, ima_pp, NULL); - sprintf(str, "%d", ima->id.us); - uiDefBut(block, BUT, B_NOP, str, 290,155,20,20, 0, 0, 0, 0, 0, "Only displays number of users of Image block"); - - but= uiDefIconBut(block, BUT, imagechanged, ICON_FILESEL, 10, 135, 23, 20, 0, 0, 0, 0, 0, "Open Fileselect to load new Image"); - uiButSetFunc(but, image_load_fs_cb, ima_pp, iuser); - but= uiDefBut(block, TEX, imagechanged, "", 33,135,257+(drawpack?0:20),20, ima->name, 0.0, 239.0, 0, 0, "Image/Movie file name, change to load new"); - uiButSetFunc(but, image_load_cb, ima_pp, iuser); - - if(drawpack) { - if (ima->packedfile) packdummy = 1; - else packdummy = 0; - but= uiDefIconButBitI(block, TOG, 1, redraw, ICON_PACKAGE, 290,135,20,20, &packdummy, 0, 0, 0, 0, "Toggles Packed status of this Image"); - uiButSetFunc(but, image_pack_cb, ima, iuser); - } - - } - else { - but= uiDefBut(block, BUT, imagechanged, "Load", 33, 155, 100,20, NULL, 0, 0, 0, 0, "Load new Image of Movie"); - uiButSetFunc(but, image_load_fs_cb, ima_pp, iuser); - } - uiBlockEndAlign(block); - - if(ima) { - ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser); - - /* check for re-render, only buttons */ - if(imagechanged==B_IMAGECHANGED) { - if(iuser->flag & IMA_ANIM_REFRESHED) { - iuser->flag &= ~IMA_ANIM_REFRESHED; - BIF_preview_changed(ID_TE); - } - } - - /* multilayer? */ - if(ima->type==IMA_TYPE_MULTILAYER && ima->rr) { - uiblock_layer_pass_arrow_buttons(block, ima->rr, iuser, imagechanged); - } - else { - image_info(ima, ibuf, str); - uiDefBut(block, LABEL, 0, str, 10, 112, 300, 20, NULL, 1, 0, 0, 0, ""); - } - - /* exception, let's do because we only use this panel 3 times in blender... but not real good code! */ - if( (FACESEL_PAINT_TEST) && G.sima && &G.sima->iuser==iuser) - return; - /* left side default per-image options, right half the additional options */ - - /* fields */ - uiBlockBeginAlign(block); - but= uiDefButBitS(block, TOG, IMA_FIELDS, imagechanged, "Fields", 10, 90, 65, 20, &ima->flag, 0, 0, 0, 0, "Click to enable use of fields in Image"); - uiButSetFunc(but, image_field_test, ima, iuser); - uiDefButBitS(block, TOG, IMA_STD_FIELD, B_NOP, "Odd", 75, 90, 45, 20, &ima->flag, 0, 0, 0, 0, "Standard Field Toggle"); - - uiBlockSetFunc(block, image_reload_cb, ima, iuser); - uiDefButBitS(block, TOG, IMA_ANTIALI, B_NOP, "Anti", 10, 70, 45, 20, &ima->flag, 0, 0, 0, 0, "Toggles Image anti-aliasing, only works with solid colors"); - uiDefButBitS(block, TOG, IMA_DO_PREMUL, imagechanged, "Premul", 55, 70, 65, 20, &ima->flag, 0, 0, 0, 0, "Toggles premultiplying alpha"); - uiBlockEndAlign(block); - - if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) { - sprintf(str, "(%d) Frames:", iuser->framenr); - - uiBlockBeginAlign(block); - uiBlockSetFunc(block, image_user_change, iuser, NULL); - uiDefButBitS(block, TOG, IMA_ANIM_ALWAYS, B_NOP, "Auto Refresh", 120, 90, 190, 20, &iuser->flag, 0, 0, 0, 0, "Always refresh Image on frame changes"); - - if(ima->anim) { - uiDefButI(block, NUM, imagechanged, str, 120, 70,170, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use"); - but= uiDefBut(block, BUT, redraw, "<", 290, 70, 20, 20, 0, 0, 0, 0, 0, "Copies number of frames in movie file to Frames: button"); - uiButSetFunc(but, set_frames_cb, ima, iuser); - } - else - uiDefButI(block, NUM, imagechanged, str, 120, 70,190, 20, &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Sets the number of images of a movie to use"); - - uiDefButI(block, NUM, imagechanged, "Offs:", 120,50,100,20, &iuser->offset, -MAXFRAMEF, MAXFRAMEF, 0, 0, "Offsets the number of the frame to use in the animation"); - uiDefButS(block, NUM, imagechanged, "Fie/Ima:", 220,50,90,20, &iuser->fie_ima, 1.0, 200.0, 0, 0, "The number of fields per rendered frame (2 fields is 1 image)"); - - uiDefButI(block, NUM, imagechanged, "StartFr:", 120,30,100,20, &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Sets the global starting frame of the movie"); - uiDefButS(block, TOG, imagechanged, "Cyclic", 220,30,90,20, &iuser->cycl, 0.0, 1.0, 0, 0, "Cycle the images in the movie"); - - uiBlockSetFunc(block, NULL, iuser, NULL); - } - else if(ima->source==IMA_SRC_GENERATED) { - - uiBlockBeginAlign(block); - uiBlockSetFunc(block, image_generated_change_cb, ima, iuser); - uiDefButS(block, NUM, imagechanged, "SizeX:", 120,90,100,20, &ima->gen_x, 1.0, 5000.0, 0, 0, "Image size x"); - uiDefButS(block, NUM, imagechanged, "SizeY:", 220,90,90,20, &ima->gen_y, 1.0, 5000.0, 0, 0, "Image size y"); - uiDefButS(block, TOG, imagechanged, "UV Test grid",120,70,190,20, &ima->gen_type, 0.0, 1.0, 0, 0, ""); - uiBlockSetFunc(block, NULL, NULL, NULL); - } - } - uiBlockEndAlign(block); -} - -static void texture_panel_image(Image **ima, ImageUser *iuser) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_image", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Image", "Texture", 960, 0, 318, 204)==0) return; - - uiblock_image_panel(block, ima, iuser, B_REDR, B_IMAGECHANGED); -} - -static void texture_panel_image_map(Tex *tex, MTex *mtex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_image_map", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Map Image", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* types */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_MIPMAP, B_IMAGECHANGED, "MipMap", 10, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Generates and uses mipmaps"); - uiDefButBitS(block, TOG, TEX_GAUSS_MIP, 0, "Gauss", 85, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Enable Gauss filter to sample down mipmaps"); - uiDefButBitS(block, TOG, TEX_INTERPOL, 0, "Interpol", 160, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Interpolates pixels using Area filter"); - uiDefButBitS(block, TOG, TEX_IMAROT, B_TEXPRV, "Rot90", 235, 180, 75, 20, &tex->imaflag, 0, 0, 0, 0, "Actually flips X and Y for rendering, rotates and mirrors"); - - uiDefButBitS(block, TOG, TEX_USEALPHA, B_TEXPRV, "UseAlpha", 10, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to use Image's alpha channel"); - uiDefButBitS(block, TOG, TEX_CALCALPHA, B_TEXPRV, "CalcAlpha", 110, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to calculate an alpha channel based on Image RGB values"); - uiDefButBitS(block, TOG, TEX_NEGALPHA, B_TEXPRV, "NegAlpha", 210, 160, 100, 20, &tex->flag, 0, 0, 0, 0, "Click to invert the alpha values"); - uiBlockEndAlign(block); - - uiDefButF(block, NUM, B_TEXPRV, "Filter :", 10,120,150,20, &tex->filtersize, 0.1, 25.0, 10, 3, "Sets the filter size used by mipmap and interpol"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map", 160,120,(mtex)? 75: 150,20, &tex->imaflag, - 0, 0, 0, 0, "Use image RGB values for normal mapping"); - if(mtex) - uiDefButS(block, MENU, B_DIFF, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3", - 235,120,75,20, &mtex->normapspace, 0, 0, 0, 0, "Sets space of normal map image"); - uiBlockEndAlign(block); - - /* crop extend clip */ - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,90,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the color of the edge pixels"); - uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,90,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges"); - uiDefButS(block, ROW, B_TEXREDR_PRV, "ClipCube", 121,90,63,19, &tex->extend, 4.0, 4.0, 0, 0, "Sets alpha to 0.0 outside cubeshaped area around Image"); - uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 184,90,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically"); - uiDefButS(block, ROW, B_TEXREDR_PRV, "Checker", 247,90,63,19, &tex->extend, 4.0, 5.0, 0, 0, "Causes Image to repeat in checker pattern"); - - if(tex->extend==TEX_REPEAT) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_REPEAT_XMIR, B_TEXPRV, "Mirr", 10,60,30,19, &tex->flag, 0.0, 0.0, 0, 0, "Mirrors X direction repeat"); - uiDefButS(block, NUM, B_TEXPRV, "Xrepeat:", 40,60,120,19, &tex->xrepeat, 1.0, 512.0, 0, 0, "Sets a repetition multiplier in the X direction"); - uiDefButBitS(block, TOG, TEX_REPEAT_YMIR, B_TEXPRV, "Mirr", 160,60,30,19, &tex->flag, 0.0, 0.0, 0, 0, "Mirrors Y direction repeat"); - uiDefButS(block, NUM, B_TEXPRV, "Yrepeat:", 190,60,120,19, &tex->yrepeat, 1.0, 512.0, 0, 0, "Sets a repetition multiplier in the Y direction"); - } - else if(tex->extend==TEX_CHECKER) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_CHECKER_ODD, B_TEXPRV, "Odd", 10,60,100,19, &tex->flag, 0.0, 0.0, 0, 0, "Sets odd checker tiles"); - uiDefButBitS(block, TOG, TEX_CHECKER_EVEN, B_TEXPRV, "Even", 110,60,100,19, &tex->flag, 0.0, 0.0, 0, 0, "Sets even checker tiles"); - uiDefButF(block, NUM, B_TEXPRV, "Mortar:", 210,60,100,19, &tex->checkerdist, 0.0, 0.99, 0, 0, "Set checkers distance (like mortar)"); - } - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "MinX ", 10,30,150,19, &tex->cropxmin, -10.0, 10.0, 10, 0, "Sets minimum X value to crop Image"); - uiDefButF(block, NUM, B_TEXPRV, "MinY ", 10,10,150,19, &tex->cropymin, -10.0, 10.0, 10, 0, "Sets minimum Y value to crop Image"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "MaxX ", 160,30,150,19, &tex->cropxmax, -10.0, 10.0, 10, 0, "Sets maximum X value to crop Image"); - uiDefButF(block, NUM, B_TEXPRV, "MaxY ", 160,10,150,19, &tex->cropymax, -10.0, 10.0, 10, 0, "Sets maximum Y value to crop Image"); - uiBlockEndAlign(block); - -} - -/***************************************/ - -static void texture_panel_envmap(Tex *tex) -{ - uiBlock *block; - uiBut *but; - EnvMap *env; - ID *id; - short a, xco, yco, dx, dy; - char *strp, str[32]; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_envmap", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Envmap", "Texture", 640, 0, 318, 204)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - if(tex->env==NULL) { - tex->env= BKE_add_envmap(); - tex->env->object= OBACT; - } - if(tex->env) { - env= tex->env; - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_REDR, "Static", 10, 180, 100, 19, &env->stype, 2.0, (float)ENV_STATIC, 0, 0, "Calculates environment map only once"); - uiDefButS(block, ROW, B_REDR, "Anim", 110, 180, 100, 19, &env->stype, 2.0, (float)ENV_ANIM, 0, 0, "Calculates environment map at each rendering"); - uiDefButS(block, ROW, B_ENV_FREE, "Load", 210, 180, 100, 19, &env->stype, 2.0, (float)ENV_LOAD, 0, 0, "Loads saved environment map from disk"); - uiBlockEndAlign(block); - - if(env->stype==ENV_LOAD) { - /* file input */ - id= (ID *)tex->ima; - IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), id, &(G.buts->menunr)); - if(strp[0]) { - uiBlockBeginAlign(block); - - but= uiDefButS(block, MENU, B_TEXPRV, strp, 10,145,23,20, &tex->iuser.menunr, 0, 0, 0, 0, "Selects an existing environment map"); - uiButSetFunc(but, image_browse_cb, &tex->ima, &tex->iuser); - - if(tex->ima) { - but= uiDefBut(block, TEX, B_NAMEIMA, "", 35,145,255,20, tex->ima->name, 0.0, 79.0, 0, 0, "Displays environment map name: click to change"); - uiButSetFunc(but, image_load_cb, &tex->ima, &tex->iuser); - - sprintf(str, "%d", tex->ima->id.us); - uiDefBut(block, BUT, 0, str, 290,145,20,20, 0, 0, 0, 0, 0, "Displays number of users of environment map: click to make single user"); - uiBlockEndAlign(block); - - but= uiDefBut(block, BUT, B_IMAGECHANGED, "Reload", 230,125,80,20, 0, 0, 0, 0, 0, "Reloads saved environment map"); - uiButSetFunc(but, image_reload_cb, tex->ima, NULL); - - if (tex->ima->packedfile) packdummy = 1; - else packdummy = 0; - but= uiDefIconButBitI(block, TOG, 1, B_REDR, ICON_PACKAGE, 205,125,24,20, &packdummy, 0, 0, 0, 0, "Toggles Packed status of this environment map"); - uiButSetFunc(but, image_pack_cb, tex->ima, &tex->iuser); - } - else uiBlockEndAlign(block); - } - MEM_freeN(strp); - - but= uiDefBut(block, BUT, B_IMAGECHANGED, "Load Image", 10,125,150,20, 0, 0, 0, 0, 0, "Loads saved environment map - file select"); - uiButSetFunc(but, image_load_fs_cb, &tex->ima, &tex->iuser); - } - else { - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_ENV_FREE, "Free Data", 10,145,100,20, 0, 0, 0, 0, 0, "Releases all images associated with this environment map"); - uiDefBut(block, BUT, B_ENV_SAVE, "Save EnvMap", 110,145,100,20, 0, 0, 0, 0, 0, "Saves current environment map"); - uiDefBut(block, BUT, B_ENV_FREE_ALL, "Free all EnvMaps", 210,145,100,20, 0, 0, 0, 0, 0, "Frees all rendered environment maps for all materials"); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_NOP, "Cube", 10,120,100,20, &env->type, 3.0f, (float)ENV_CUBE, 0, 0, "Use environment map with six cube sides"); - uiDefButS(block, ROW, B_NOP, "Plane", 110,120,100,20, &env->type, 3.0f, (float)ENV_PLANE, 0, 0, "Only one side is rendered, with Z axis pointing in direction of image"); - uiDefButF(block, NUM, B_NOP, "Zoom: ", 210,120,100,20, &env->viewscale, 0.5f, 5.0f, 100, 2, "Zoom factor for planar environment map"); - uiBlockEndAlign(block); - } - - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_ENV_OB, "Ob:", 10,90,150,20, &(env->object), "Displays object to use as viewpoint for environment map: click to change"); - if(env->stype!=ENV_LOAD) - uiDefButS(block, NUM, B_ENV_FREE, "CubeRes", 160,90,150,20, &env->cuberes, 50, 4096.0, 0, 0, "Sets the pixel resolution of the rendered environment map"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_TEXPRV, "Filter :", 10,65,150,20, &tex->filtersize, 0.1, 25.0, 0, 3, "Adjusts sharpness or blurriness of the reflection"), - uiDefButS(block, NUM, B_ENV_FREE, "Depth:", 160,65,150,20, &env->depth, 0, 5.0, 0, 0, "Sets the number of times a map will be rendered recursively mirror effects"), - uiDefButF(block, NUM, REDRAWVIEW3D, "ClipSta", 10,40,150,20, &env->clipsta, 0.01, 50.0, 100, 0, "Sets start value for clipping: objects nearer than this are not visible to map"); - uiDefButF(block, NUM, B_NOP, "ClipEnd", 160,40,150,20, &env->clipend, 0.1, 20000.0, 1000, 0, "Sets end value for clipping beyond which objects are not visible to map"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 0, "Don't render layer:", 10,10,140,22, 0, 0.0, 0.0, 0, 0, ""); - xco= 160; - yco= 10; - dx= 28; - dy= 26; - - uiBlockBeginAlign(block); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map"); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<<(a+10), 0, "",(xco+a*(dx/2)), yco, (dx/2), (dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map"); - - uiBlockBeginAlign(block); - xco+= 5; - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map"); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<<(a+10), 0, "",(xco+a*(dx/2)), yco, (dx/2), (dy/2), (int *)&env->notlay, 0, 0, 0, 0, "Toggles layer visibility to environment map"); - - } -} - -static void colorband_pos_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - int a; - - if(coba->tot<2) return; - - for(a=0; atot; a++) coba->data[a].cur= a; - qsort(coba->data, coba->tot, sizeof(CBData), vergcband); - for(a=0; atot; a++) { - if(coba->data[a].cur==coba->cur) { - if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */ - coba->cur= a; - break; - } - } -} - -static void colorband_add_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - - if(coba->tot < MAXCOLORBAND-1) coba->tot++; - coba->cur= coba->tot-1; - - colorband_pos_cb(coba, NULL); - BIF_undo_push("Add colorband"); - -} - -static void colorband_del_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - int a; - - if(coba->tot<2) return; - - for(a=coba->cur; atot; a++) { - coba->data[a]= coba->data[a+1]; - } - if(coba->cur) coba->cur--; - coba->tot--; - - BIF_undo_push("Delete colorband"); - BIF_preview_changed(ID_TE); -} - - -/* offset aligns from bottom, standard width 300, height 115 */ -static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int yoffs, int redraw) -{ - CBData *cbd; - uiBut *bt; - - if(coba==NULL) return; - - bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new color position to the colorband"); - uiButSetFunc(bt, colorband_add_cb, coba, NULL); - uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband"); - bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position"); - uiButSetFunc(bt, colorband_del_cb, coba, NULL); - uiDefButS(block, ROW, redraw, "E", 236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); - uiDefButS(block, ROW, redraw, "C", 252+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); - uiDefButS(block, ROW, redraw, "L", 268+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); - uiDefButS(block, ROW, redraw, "S", 284+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); - - uiDefBut(block, BUT_COLORBAND, redraw, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, ""); - - cbd= coba->data + coba->cur; - - uiBlockBeginAlign(block); - bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active color"); - uiButSetFunc(bt, colorband_pos_cb, coba, NULL); - uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); - uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active color"); - uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active color"); - uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active color"); - uiBlockEndAlign(block); -} - -void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int event) -{ - CBData *cbd; - uiBut *bt; - float unit= (butr->xmax-butr->xmin)/14.0f; - float xs= butr->xmin; - - cbd= coba->data + coba->cur; - - uiBlockBeginAlign(block); - uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); - uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, ""); - bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new color position to the colorband"); - uiButSetFunc(bt, colorband_add_cb, coba, NULL); - bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position"); - uiButSetFunc(bt, colorband_del_cb, coba, NULL); - uiDefButS(block, ROW, event, "E", xs+10.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); - uiDefButS(block, ROW, event, "C", xs+11.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); - uiDefButS(block, ROW, event, "L", xs+12.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); - uiDefButS(block, ROW, event, "S", xs+13.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); - - uiDefBut(block, BUT_COLORBAND, event, "", xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, ""); - uiBlockEndAlign(block); - -} - -static void texture_panel_colors(Tex *tex) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_colors", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Texture", "Texture"); - if(uiNewPanel(curarea, block, "Colors", "Texture", 1280, 0, 318, 204)==0) return; - - - /* COLORBAND */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_COLORBAND, B_COLORBAND, "Colorband",10,180,80,20, &tex->flag, 0, 0, 0, 0, "Toggles colorband operations"); - - if(tex->flag & TEX_COLORBAND) { - draw_colorband_buts(block, tex->coba, 10, 85, B_TEXREDR_PRV); - } - - /* RGB-BRICON */ - if((tex->flag & TEX_COLORBAND)==0) { - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_TEXPRV, "R ", 60,80,200,20, &tex->rfac, 0.0, 2.0, 0, 0, "Changes the red value of the texture"); - uiDefButF(block, NUMSLI, B_TEXPRV, "G ", 60,60,200,20, &tex->gfac, 0.0, 2.0, 0, 0, "Changes the green value of the texture"); - uiDefButF(block, NUMSLI, B_TEXPRV, "B ", 60,40,200,20, &tex->bfac, 0.0, 2.0, 0, 0, "Changes the blue value of the texture"); - } - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_TEXPRV, "Bright", 10,10,150,20, &tex->bright, 0.0, 2.0, 0, 0, "Changes the brightness of the color or intensity of a texture"); - uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 5.0, 0, 0, "Changes the contrast of the color or intensity of a texture"); -} - - -static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *la, bNode *node, Brush *br, SculptData *sd) -{ - MTex *mt=NULL; - uiBlock *block; - ID *id=NULL, *idfrom; - int a, yco, loos; - char str[32]; - - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_texture", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Texture", "Texture", 320, 0, 318, 204)==0) return; - - /* first do the browse but */ - if(mtex) - id= (ID *)mtex->tex; - else if(node) - id= node->id; - - if(ma) idfrom= &ma->id; - else if(wrld) idfrom= &wrld->id; - else if(la) idfrom= &la->id; - else if(br) idfrom= &br->id; - else if(sd) idfrom= NULL; /* Not sure what this does */ - else idfrom= NULL; - - uiBlockSetCol(block, TH_BUT_SETTING2); - if(ma) { - std_libbuttons(block, 10, 180, 0, NULL, B_TEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - } - else if(wrld) { - std_libbuttons(block, 10, 180, 0, NULL, B_WTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - } - else if(la) { - std_libbuttons(block, 10, 180, 0, NULL, B_LTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - } - else if(br) { - std_libbuttons(block, 10, 180, 0, NULL, B_BTEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->menunr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - } - else if(sd) { - std_libbuttons(block, 10, 180, 0, NULL, B_SCULPT_TEXBROWSE, ID_TE, 0, id, idfrom, &(G.buts->texnr), B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - } - else if(node) { - - } - uiBlockSetCol(block, TH_BUT_NEUTRAL); - - /* From button: removed */ - - /* CHANNELS */ - if(node==NULL) { - uiBlockBeginAlign(block); - yco= 150; - for(a= 0; amtex[a]; - else if(wrld) mt= wrld->mtex[a]; - else if(la) mt= la->mtex[a]; - else if(br) mt= br->mtex[a]; - else if(sd) mt= sd->mtex[a]; - - if(mt && mt->tex) splitIDname(mt->tex->id.name+2, str, &loos); - else strcpy(str, ""); - str[14]= 0; - - if(ma) { - uiDefButC(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(ma->texact), 0.0, (float)a, 0, 0, "Click to select texture channel"); - yco-= 20; - } - else if(wrld) { - uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(wrld->texact), 0.0, (float)a, 0, 0, ""); - yco-= 20; - } - else if(la) { - uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(la->texact), 0.0, (float)a, 0, 0, ""); - yco-= 20; - } - else if(br) { - uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(br->texact), 0.0, (float)a, 0, 0, ""); - yco-= 20; - } - else if(sd) { - uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(sd->texact), 0.0, (float)a, 0, 0, ""); - yco-= 20; - } - } - uiBlockEndAlign(block); - } - uiBlockSetCol(block, TH_AUTO); - - /* TYPES */ - if(id) { - char textypes[512]; - Tex *tex= (Tex *)id; - - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* newnoise: all texture types as menu, not enough room for more buttons. - * Can widen panel, but looks ugly when other panels overlap it */ - - sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE); - uiDefBut(block, LABEL, 0, "Texture Type", 160, 150, 140, 20, 0, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); - - } - else { - // label to avoid centering - uiDefBut(block, LABEL, 0, " ", 160, 10, 140, 20, 0, 0, 0, 0, 0, ""); - } -} - -static void texture_panel_preview(MTex *mtex, int preview) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_preview", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Preview", "Texture", 0, 0, 318, 204)==0) return; - - if(preview) uiBlockSetDrawExtraFunc(block, BIF_previewdraw); - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButC(block, ROW, B_TEXREDR_PRV, "Mat", 200,175,80,25, &G.buts->texfrom, 3.0, 0.0, 0, 0, "Displays the textures of the active material"); - uiDefButC(block, ROW, B_TEXREDR_PRV, "World", 200,150,80,25, &G.buts->texfrom, 3.0, 1.0, 0, 0, "Displays the textures of the world block"); - uiDefButC(block, ROW, B_TEXREDR_PRV, "Lamp", 200,125,80,25, &G.buts->texfrom, 3.0, 2.0, 0, 0, "Displays the textures of the selected lamp"); - uiDefButC(block, ROW, B_TEXREDR_PRV, "Brush", 200,100,80,25, &G.buts->texfrom, 3.0, 3.0, 0, 0, "Displays the textures of the selected brush"); - uiBlockEndAlign(block); - - if(mtex && mtex->tex) - uiDefButBitS(block, TOG, TEX_PRV_ALPHA, B_TEXREDR_PRV, "Alpha", 200,60,80,20, &mtex->tex->flag, 0, 0, 0, 0, "Show alpha in preview"); - - uiDefBut(block, BUT, B_DEFTEXVAR, "Default Vars",200,10,80,20, 0, 0, 0, 0, 0, "Sets all values to defaults"); - -} - - - -/* *************************** RADIO ******************************** */ - -void do_radiobuts(unsigned short event) -{ - Radio *rad; - int phase; - - phase= rad_phase(); - rad= G.scene->radio; - - switch(event) { - case B_RAD_ADD: - add_radio(); - BIF_undo_push("Add radiosity"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_DELETE: - delete_radio(); - BIF_undo_push("Delete radiosity"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_FREE: - freeAllRad(); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_COLLECT: - rad_collect_meshes(); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_INIT: - if(phase==RAD_PHASE_PATCHES) { - rad_limit_subdivide(); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_RAD_SHOOTP: - if(phase==RAD_PHASE_PATCHES) { - waitcursor(1); - rad_subdivshootpatch(); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - waitcursor(0); - } - break; - case B_RAD_SHOOTE: - if(phase==RAD_PHASE_PATCHES) { - waitcursor(1); - rad_subdivshootelem(); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - waitcursor(0); - } - break; - case B_RAD_GO: - if(phase==RAD_PHASE_PATCHES) { - waitcursor(1); - rad_go(); - waitcursor(0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_RAD_LIMITS: - rad_setlimits(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSSHADING, 0); - break; - case B_RAD_FAC: - set_radglobal(); - if(phase & RAD_PHASE_FACES) make_face_tab(); - else make_node_display(); /* radio solver also uses nodes, different ones :) */ - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_NODELIM: - if(phase & RAD_PHASE_FACES) { - set_radglobal(); - removeEqualNodes(rad->nodelim); - make_face_tab(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSSHADING, 0); - } - break; - case B_RAD_NODEFILT: - if(phase & RAD_PHASE_FACES) { - set_radglobal(); - filterNodes(); - make_face_tab(); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_RAD_FACEFILT: - if(phase & RAD_PHASE_FACES) { - filterFaces(); - allqueue(REDRAWVIEW3D, 0); - } - break; - case B_RAD_DRAW: - set_radglobal(); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_ADDMESH: - if(phase & RAD_PHASE_FACES) rad_addmesh(); - BIF_undo_push("Radiosity add mesh"); - allqueue(REDRAWVIEW3D, 0); - break; - case B_RAD_REPLACE: - if(phase & RAD_PHASE_FACES) rad_replacemesh(); - BIF_undo_push("Radiosity replace mesh"); - allqueue(REDRAWVIEW3D, 0); - break; - } - -} - - -static void radio_panel_calculation(Radio *rad, int flag) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "radio_panel_calculation", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Calculation", "Radio", 640, 0, 318, 204)==0) return; - uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS); - - if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiDefBut(block, BUT, B_RAD_GO, "GO", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Starts the radiosity simulation"); - - uiBlockSetCol(block, TH_AUTO); - uiDefButS(block, NUM, B_NOP, "SubSh Patch:", 1, 0, 10, 10, &rad->subshootp, 0.0, 10.0, 0, 0, "Sets the number of times the environment is tested to detect pathes"); - uiDefButS(block, NUM, B_NOP, "SubSh Element:", 1, 0, 10, 10, &rad->subshoote, 0.0, 10.0, 0, 0, "Sets the number of times the environment is tested to detect elements"); - - if(flag != RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiDefBut(block, BUT, B_RAD_SHOOTE, "Subdiv Shoot Element", 2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, Detects high energy changes and subdivide Elements"); - uiDefBut(block, BUT, B_RAD_SHOOTP, "Subdiv Shoot Patch", 2, 0, 10, 10, NULL, 0, 0, 0, 0, "For pre-subdivision, Detects high energy changes and subdivide Patches"); - - uiBlockSetCol(block, TH_AUTO); - uiDefButI(block, NUM, B_NOP, "MaxEl:", 3, 0, 10, 10, &rad->maxnode, 1.0, 250000.0, 0, 0, "Sets the maximum allowed number of elements"); - uiDefButS(block, NUM, B_NOP, "Max Subdiv Shoot:", 3, 0, 10, 10, &rad->maxsublamp, 1.0, 250.0, 0, 0, "Sets the maximum number of initial shoot patches that are evaluated"); - - if(flag & RAD_PHASE_FACES); - else uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiDefBut(block, BUT, B_RAD_FACEFILT, "FaceFilter", 4, 0, 10, 10, NULL, 0, 0, 0, 0, "Forces an extra smoothing"); - uiDefBut(block, BUT, B_RAD_NODEFILT, "Element Filter", 4, 0, 10, 10, NULL, 0, 0, 0, 0, "Filters elements to remove aliasing artefacts"); - - uiDefBut(block, BUT, B_RAD_NODELIM, "RemoveDoubles", 5, 0, 30, 10, NULL, 0.0, 50.0, 0, 0, "Joins elements which differ less than 'Lim'"); - uiBlockSetCol(block, TH_AUTO); - uiDefButS(block, NUM, B_NOP, "Lim:", 5, 0, 10, 10, &rad->nodelim, 0.0, 50.0, 0, 0, "Sets the range for removing doubles"); - - -} - -static void radio_panel_tool(Radio *rad, int flag) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "radio_panel_tool", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Radio Tool", "Radio", 320, 0, 318, 204)==0) return; - uiAutoBlock(block, 10, 10, 300, 200, UI_BLOCK_ROWS); - - if(flag & RAD_PHASE_PATCHES) uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefBut(block, BUT, B_RAD_COLLECT, "Collect Meshes", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Converts selected visible meshes to patches"); - - if(flag & RAD_PHASE_PATCHES)uiBlockSetCol(block, TH_AUTO); - else uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiDefBut(block, BUT, B_RAD_FREE, "Free Radio Data", 0, 0, 10, 15, NULL, 0, 0, 0, 0, "Releases all memory used by Radiosity"); - - if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO); - else uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiDefBut(block, BUT, B_RAD_REPLACE, "Replace Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, changing input-meshes"); - uiDefBut(block, BUT, B_RAD_ADDMESH, "Add new Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, unchanging input-meshes"); - - uiBlockSetCol(block, TH_AUTO); - uiDefButS(block, ROW, B_RAD_DRAW, "Wire", 2, 0, 10, 10, &rad->drawtype, 0.0, 0.0, 0, 0, "Enables wireframe drawmode"); - uiDefButS(block, ROW, B_RAD_DRAW, "Solid", 2, 0, 10, 10, &rad->drawtype, 0.0, 1.0, 0, 0, "Enables solid drawmode"); - uiDefButS(block, ROW, B_RAD_DRAW, "Gour", 2, 0, 10, 10, &rad->drawtype, 0.0, 2.0, 0, 0, "Enables Gourad drawmode"); - uiDefButBitS(block, TOG, 1, B_RAD_DRAW, "ShowLim", 2, 0, 10, 10, &rad->flag, 0, 0, 0, 0, "Draws patch and element limits"); - uiDefButBitS(block, TOG, 2, B_RAD_DRAW, "Z", 2, 0, 3, 10, &rad->flag, 0, 0, 0, 0, "Draws limits differently"); - - uiDefButS(block, NUM, B_RAD_LIMITS, "ElMax:", 3, 0, 10, 10, &rad->elma, 1.0, 500.0, 0, 0, "Sets maximum size of an element"); - uiDefButS(block, NUM, B_RAD_LIMITS, "ElMin:", 3, 0, 10, 10, &rad->elmi, 1.0, 100.0, 0, 0, "Sets minimum size of an element"); - uiDefButS(block, NUM, B_RAD_LIMITS, "PaMax:", 3, 0, 10, 10, &rad->pama, 10.0, 1000.0, 0, 0, "Sets maximum size of a patch"); - uiDefButS(block, NUM, B_RAD_LIMITS, "PaMin:", 3, 0, 10, 10, &rad->pami, 10.0, 1000.0, 0, 0, "Sets minimum size of a patch"); - - uiDefBut(block, BUT, B_RAD_INIT, "Limit Subdivide", 5, 0, 10, 10, NULL, 0, 0, 0, 0, "Subdivides patches"); -} - - -static void radio_panel_render(Radio *rad) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "radio_panel_render", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Radio Render", "Radio", 0, 0, 318, 204)==0) return; - uiAutoBlock(block, 210, 30, 230, 150, UI_BLOCK_ROWS); - - uiDefButS(block, NUMSLI, B_RAD_LIMITS, "Hemires:", 0, 0, 10, 10, &rad->hemires, 100.0, 1000.0, 100, 0, "Sets the size of a hemicube"); - uiDefButS(block, NUM, B_NOP, "Max Iterations:", 2, 0, 10, 15, &rad->maxiter, 0.0, 10000.0, 0, 0, "Limits the maximum number of radiosity rounds"); - uiDefButF(block, NUM, B_RAD_FAC, "Mult:", 3, 0, 10, 15, &rad->radfac, 0.001, 250.0, 100, 0, "Mulitplies the energy values"); - uiDefButF(block, NUM, B_RAD_FAC, "Gamma:", 3, 0, 10, 15, &rad->gamma, 0.2, 10.0, 10, 0, "Changes the contrast of the energy values"); - uiDefButF(block, NUMSLI, B_NOP, "Convergence:", 5, 0, 10, 10, &rad->convergence, 0.0, 1.0, 10, 0, "Sets the lower threshold of unshot energy"); -} - - -/* ***************************** WORLD ************************** */ - -void do_worldbuts(unsigned short event) -{ - static short mtexcopied=0; - static MTex mtexcopybuf; - World *wrld; - MTex *mtex; - - switch(event) { - case B_TEXCLEARWORLD: - wrld= G.buts->lockpoin; - mtex= wrld->mtex[ wrld->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - wrld->mtex[ wrld->texact ]= 0; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Unlink world texture"); - BIF_preview_changed(ID_WO); - } - break; - case B_WMTEXCOPY: - wrld= G.buts->lockpoin; - if(wrld && wrld->mtex[(int)wrld->texact] ) { - mtex= wrld->mtex[(int)wrld->texact]; - if(mtex->tex==NULL) { - error("No texture available"); - } - else { - memcpy(&mtexcopybuf, wrld->mtex[(int)wrld->texact], sizeof(MTex)); - mtexcopied= 1; - } - } - break; - case B_WMTEXPASTE: - wrld= G.buts->lockpoin; - if(wrld && mtexcopied && mtexcopybuf.tex) { - if(wrld->mtex[(int)wrld->texact]==NULL ) - wrld->mtex[(int)wrld->texact]= MEM_mallocN(sizeof(MTex), "mtex"); - else if(wrld->mtex[(int)wrld->texact]->tex) - wrld->mtex[(int)wrld->texact]->tex->id.us--; - - memcpy(wrld->mtex[(int)wrld->texact], &mtexcopybuf, sizeof(MTex)); - - id_us_plus((ID *)mtexcopybuf.tex); - BIF_undo_push("Paste mapping settings"); - BIF_preview_changed(ID_WO); - scrarea_queue_winredraw(curarea); - } - break; - case B_AO_FALLOFF: - /* falloff distances option only supports plain */ - wrld= G.buts->lockpoin; - if(wrld) - wrld->aocolor= WO_AOPLAIN; - scrarea_queue_winredraw(curarea); - break; - } -} - -static void world_panel_mapto(World *wrld) -{ - uiBlock *block; - MTex *mtex; - - block= uiNewBlock(&curarea->uiblocks, "world_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Texture and Input", "World"); - if(uiNewPanel(curarea, block, "Map To", "World", 1280, 0, 318, 204)==0) return; - - uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - mtex= wrld->mtex[ wrld->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - mtex->texco= TEXCO_VIEW; - } - - /* TEXTURE OUTPUT */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MTEX_STENCIL, B_WORLDPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture"); - uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_WORLDPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect"); - uiDefButBitS(block, TOG, MTEX_RGBTOINT, B_WORLDPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_WORLDPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, ""); - uiDefButF(block, NUMSLI, B_WORLDPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_WORLDPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_WORLDPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiBlockEndAlign(block); - uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); - - /* MAP TO */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, WOMAP_BLEND, B_WORLDPRV, "Blend", 10,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color progression of the background"); - uiDefButBitS(block, TOG, WOMAP_HORIZ, B_WORLDPRV, "Hori", 85,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the horizon"); - uiDefButBitS(block, TOG, WOMAP_ZENUP, B_WORLDPRV, "ZenUp", 160,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith above"); - uiDefButBitS(block, TOG, WOMAP_ZENDOWN, B_WORLDPRV, "ZenDo", 235,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith below"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_WORLDPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_WORLDPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values"); - uiDefButF(block, NUMSLI, B_WORLDPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects normal values"); - uiDefButF(block, NUMSLI, B_WORLDPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values"); - -} - -static void world_panel_texture(World *wrld) -{ - uiBlock *block; - MTex *mtex; - ID *id; - int a, loos; - char str[64], *strp; - - block= uiNewBlock(&curarea->uiblocks, "world_panel_texture", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Texture and Input", "World", 960, 0, 318, 204)==0) return; - - uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* TEX CHANNELS */ - uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiBlockBeginAlign(block); - for(a= 0; amtex[a]; - if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos); - else strcpy(str, ""); - str[10]= 0; - uiDefButS(block, ROW, REDRAWBUTSSHADING, str,10, 160-18*a, 80, 20, &(wrld->texact), 3.0, (float)a, 0, 0, "Texture channel"); - } - uiBlockEndAlign(block); - - mtex= wrld->mtex[ wrld->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - mtex->texco= TEXCO_VIEW; - } - - /* TEXTUREBLOCK SELECT */ - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (ID *)mtex->tex; - IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr)); - uiDefButS(block, MENU, B_WTEXBROWSE, strp, 100,140,20,19, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new"); - MEM_freeN(strp); - - if(id) { - uiDefBut(block, TEX, B_IDNAME, "TE:", 100,160,200,19, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change"); - sprintf(str, "%d", id->us); - uiDefBut(block, BUT, 0, str, 196,140,21,19, 0, 0, 0, 0, 0, "Displays number of users of texture: click to make single user"); - uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 220,140,21,19, 0, 0, 0, 0, 0, "Auto-assigns name to texture"); - if(id->lib) { - if(wrld->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,140,21,19, 0, 0, 0, 0, 0, ""); - else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,140,21,19, 0, 0, 0, 0, 0, ""); - } - uiBlockSetCol(block, TH_AUTO); - uiDefBut(block, BUT, B_TEXCLEARWORLD, "Clear", 122, 140, 72, 19, 0, 0, 0, 0, 0, "Erases link to texture"); - } - else - uiDefButS(block, TOG, B_WTEXBROWSE, "Add New" ,100, 160, 200, 19, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock"); - - uiBlockSetCol(block, TH_AUTO); - - /* copy/paste */ - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_WMTEXCOPY, ICON_COPYUP, 250,140,25,19, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer"); - uiDefIconBut(block, BUT, B_WMTEXPASTE, ICON_PASTEUP,275,140,25,19, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer"); - - /* TEXCO */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_WORLDPRV, "View", 100,110,100,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Uses view vector for the texture coordinates"); - uiDefButS(block, ROW, B_WORLDPRV, "Global", 200,110,100,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates (interior mist)"); - - uiDefButS(block, ROW, B_WORLDPRV, "AngMap", 100,90,70,20, &(mtex->texco), 4.0, (float)TEXCO_ANGMAP, 0, 0, "Uses 360 degree angular coordinates, e.g. for spherical light probes"); - uiDefButS(block, ROW, B_WORLDPRV, "Sphere", 170,90,65,20, &(mtex->texco), 4.0, (float)TEXCO_H_SPHEREMAP, 0, 0, "For 360 degree panorama sky, spherical mapped, only top half"); - uiDefButS(block, ROW, B_WORLDPRV, "Tube", 235,90,65,20, &(mtex->texco), 4.0, (float)TEXCO_H_TUBEMAP, 0, 0, "For 360 degree panorama sky, cylindrical mapped, only top half"); - - uiDefButS(block, ROW, B_WORLDPRV, "Object", 100,70,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_WORLDPRV, "OB:", 170,70,130,20, &(mtex->object), "Object name to use for mapping"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_WORLDPRV, "dX", 100,40,100,19, mtex->ofs, -20.0, 20.0, 10, 0, "Fine tunes texture mapping X coordinate"); - uiDefButF(block, NUM, B_WORLDPRV, "dY", 100,20,100,19, mtex->ofs+1, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Y coordinate"); - uiDefButF(block, NUM, B_WORLDPRV, "dZ", 100, 0,100,19, mtex->ofs+2, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Z coordinate"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_WORLDPRV, "sizeX", 200,40,100,19, mtex->size, -10.0, 10.0, 10, 0, "Sets scaling for the texture's X size"); - uiDefButF(block, NUM, B_WORLDPRV, "sizeY", 200,20,100,19, mtex->size+1, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Y size"); - uiDefButF(block, NUM, B_WORLDPRV, "sizeZ", 200, 0,100,19, mtex->size+2, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Z size"); - -} - -static void world_panel_mistaph(World *wrld) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "world_panel_mistaph", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Mist / Stars / Physics", "World", 640, 0, 318, 204)==0) return; - - uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); - -#if GAMEBLENDER == 1 - uiDefButI(block, MENU, 1, -#ifdef USE_ODE - "Physics %t|None %x0|Sumo %x2|Ode %x4 |Bullet %x5", -#else - //"Physics %t|None %x0|Sumo %x2|Bullet %x5", //disable Sumo, until too many people complain ;-) - "Physics %t|None %x0|Sumo (deprecated) %x2|Bullet %x5", -#endif - 10,180,140,19, &wrld->physicsEngine, 0, 0, 0, 0, - "Physics Engine"); - - /* Gravitation for the game worlds */ - uiDefButF(block, NUMSLI,0, "Grav ", 150,180,150,19, &(wrld->gravity), 0.0, 25.0, 0, 0, "Sets the gravitation constant of the game world"); -#endif - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, WO_MIST, B_WORLDPRV2,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation"); - uiBlockSetCol(block, TH_AUTO); - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_WORLDPRV2, "Quad", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Mist uses quadratic progression"); - uiDefButS(block, ROW, B_WORLDPRV2, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Mist uses linear progression"); - uiDefButS(block, ROW, B_WORLDPRV2, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Mist uses inverse quadratic progression"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM,B_WORLDPRV2, "Start:",10,70,140,19, &wrld->miststa, 0.0, 10000.0, 10, 0, "Specifies the starting distance of the mist"); - uiDefButF(block, NUM,B_WORLDPRV2, "Dist:",10,50,140,19, &wrld->mistdist, 0.0,10000.0, 10, 00, "Specifies the depth of the mist"); - uiDefButF(block, NUM,B_WORLDPRV2,"Height:", 10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specifies the factor for a less dense mist with increasing height"); - uiDefButF(block, NUMSLI, B_WORLDPRV2, "Misi ", 10,10,140,19, &(wrld->misi), 0., 1.0, 0, 0, "Sets the mist intensity"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, WO_STARS, B_WORLDPRV2, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation"); - uiBlockSetCol(block, TH_AUTO); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM,B_WORLDPRV2,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars"); - uiDefButF(block, NUM,B_WORLDPRV2,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars"); - uiDefButF(block, NUMSLI,B_WORLDPRV2,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars"); - uiDefButF(block, NUMSLI,B_WORLDPRV2,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes star color"); - uiBlockEndAlign(block); - -} - -static void world_panel_amb_occ(World *wrld) -{ - uiBlock *block; - short yco=PANEL_YMAX; - - block= uiNewBlock(&curarea->uiblocks, "world_panel_amb_oc", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Mist / Stars / Physics", "World"); - if(uiNewPanel(curarea, block, "Amb Occ", "World", PANELX, PANELY, PANELW, PANELH)==0) return; - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, WO_AMB_OCC, B_REDR, "Ambient Occlusion", - X2CLM1, yco-=BUTH, BUTW1, BUTH, &wrld->mode, 0, 0, 0, 0, "Toggles ambient occlusion (soft shadows)"); - uiBlockSetCol(block, TH_AUTO); - - if(!(wrld->mode & WO_AMB_OCC)) return; - - yco -= YSPACE; - - uiDefButS(block, NUM, B_REDR, "Samples:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aosamp, 1.0, 32.0, 100, 0, "Sets the number of samples used for AO (actual number: squared)"); - - yco -= YSPACE; - - uiDefButF(block, NUM, B_REDR, "Max Dist:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aodist, 0.001, 5000.0, 100, 0, "Sets length of AO rays, defines how far away other faces give occlusion effect"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, WO_AODIST, B_AO_FALLOFF, "Use Falloff", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aomode, 0, 0, 0, 0, "When enabled, distances to objects will be used to attenuate shadows. Only for Plain AO."); - if (wrld->aomode & WO_AODIST) - uiDefButF(block, NUM, B_REDR, "Strength:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aodistfac, 0.00001, 10.0, 100, 0, "Distance attenuation factor, the higher, the 'shorter' the shadows"); - uiBlockEndAlign(block); - - /* column 2 */ - yco = PANEL_YMAX - BUTH - YSPACE; - - uiDefButS(block, MENU, B_REDR, "Constant QMC %x2|Adaptive QMC %x1|Constant Jittered %x0", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Constant QMC: best quality, Adaptive QMC: fast in high contrast areas"); - - yco -= YSPACE; - - if (wrld->ao_samp_method == WO_AOSAMP_HALTON) { - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_REDR, "Threshold:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_adapt_thresh, 0.0, 1.0, 100, 0, "Samples below this threshold will be considered fully shadowed/unshadowed and skipped"); - uiDefButF(block, NUMSLI, B_REDR, "Adapt Vec:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->ao_adapt_speed_fac, 0.0, 1.0, 100, 0, "Use the speed vector pass to reduce AO samples in fast moving pixels. The higher the value, the more aggressive the sample reduction. Requires Vec pass enabled."); - uiBlockEndAlign(block); - } else if (wrld->ao_samp_method == WO_AOSAMP_CONSTANT) { - uiDefButF(block, NUMSLI, B_REDR, "Bias:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &wrld->aobias, 0.0, 0.5, 10, 0, "Sets bias to prevent smoothed faces to show banding (in radians)"); - } - - - yco = PANEL_YMAX - (5*BUTH+4*YSPACE); - - /* result mix modes */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_REDR, "Add", - X3CLM1, yco-=BUTH, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOADD, 0, 0, "adds light/shadows"); - uiDefButS(block, ROW, B_REDR, "Sub", - X3CLM2, yco, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOSUB, 0, 0, "subtracts light/shadows (needs at least one normal light to make anything visible)"); - uiDefButS(block, ROW, B_REDR, "Both", - X3CLM3, yco, BUTW3, BUTH, &wrld->aomix, 1.0, (float)WO_AOADDSUB, 0, 0, "both lightens & darkens"); - - yco -= YSPACE; - - /* color treatment */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_REDR, "Plain", - X3CLM1, yco-=BUTH, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOPLAIN, 0, 0, "Plain diffuse energy (white)"); - uiDefButS(block, ROW, B_REDR, "Sky Color", - X3CLM2, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYCOL, 0, 0, "Use horizon and zenith color for diffuse energy"); - uiDefButS(block, ROW, B_REDR, "Sky Texture", - X3CLM3, yco, BUTW3, BUTH, &wrld->aocolor, 2.0, (float)WO_AOSKYTEX, 0, 0, "Does full Sky texture render for diffuse energy"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiDefButF(block, NUMSLI, B_REDR, "Energy:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &wrld->aoenergy, 0.01, 3.0, 100, 0, "Sets global energy scale for AO"); - -} - -static void world_panel_world(World *wrld) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "world_panel_world", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "World", "World", 320, 0, 318, 204)==0) return; - - uiBlockSetCol(block, TH_BUT_SETTING2); - std_libbuttons(block, 10, 180, 0, NULL, B_WORLDBROWSE, ID_WO, 0, (ID *)wrld, (ID *)G.scene, &(G.buts->menunr), B_WORLDALONE, B_WORLDLOCAL, B_WORLDDELETE, 0, B_KEEPDATA); - - if(wrld==NULL) return; - - uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); - uiBlockSetCol(block, TH_AUTO); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_WORLDPRV, "", 10,150,145,19, &wrld->horr, 0, 0, 0, B_COLHOR, ""); - uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red color at the horizon"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green color at the horizon"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue color at the horizon"); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, ""); - uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red color at the zenith"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green color at the zenith"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue color at the zenith"); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_WORLDPRV, "", 10,70,145,19, &wrld->ambr, 0, 0, 0, 0, ""); - uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient color"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient color"); - uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient color"); - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButF(block, NUMSLI,B_WORLDPRV, "Exp ", 160,30,145,19, &(wrld->exp), 0.0, 1.0, 0, 2, "Sets amount of exponential color correction for light"); - uiDefButF(block, NUMSLI,B_WORLDPRV, "Range ", 160,10,145,19, &(wrld->range), 0.2, 5.0, 0, 2, "Sets the color amount that will be mapped on color 1.0"); - - -} - -static void world_panel_preview(World *wrld) -{ - uiBlock *block; - - /* name "Preview" is abused to detect previewrender offset panel */ - block= uiNewBlock(&curarea->uiblocks, "world_panel_preview", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Preview", "World", 0, 0, 318, 204)==0) return; - - if(wrld==NULL) return; - - uiSetButLock(wrld->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockSetDrawExtraFunc(block, BIF_previewdraw); - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, WO_SKYREAL, B_WORLDPRV,"Real", 200,175,80,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with a real horizon"); - uiDefButBitS(block, TOG, WO_SKYBLEND, B_WORLDPRV,"Blend",200,150,80,25, &wrld->skytype, 0, 0, 0, 0, "Renders background with natural progression from horizon to zenith"); - uiDefButBitS(block, TOG,WO_SKYPAPER, B_WORLDPRV,"Paper",200,125,80,25, &wrld->skytype, 0, 0, 0, 0, "Flattens blend or texture coordinates"); - uiBlockEndAlign(block); - -} - -/* ************************ LAMP *************************** */ - -void do_lampbuts(unsigned short event) -{ - static short mtexcopied=0; - static MTex mtexcopybuf; - Lamp *la; - MTex *mtex; - - switch(event) { - case B_LAMPREDRAW: - BIF_preview_changed(ID_LA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSSHADING, 0); - break; - case B_TEXCLEARLAMP: - la= G.buts->lockpoin; - mtex= la->mtex[ la->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - la->mtex[ la->texact ]= 0; - BIF_undo_push("Unlink world texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_LA); - } - break; - case B_SBUFF: - la= G.buts->lockpoin; - la->bufsize = la->bufsize&=(~15); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - break; - case B_SHADBUF: - la= G.buts->lockpoin; - la->mode &= ~LA_SHAD_RAY; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_SHADRAY: - la= G.buts->lockpoin; - la->mode &= ~LA_SHAD_BUF; - /* yafray: 'softlight' uses it's own shadbuf. flag. - Must be cleared here too when switching from ray shadow */ - la->mode &= ~LA_YF_SOFT; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_LMTEXCOPY: - la= G.buts->lockpoin; - if(la && la->mtex[(int)la->texact] ) { - mtex= la->mtex[(int)la->texact]; - if(mtex->tex==NULL) { - error("No texture available"); - } - else { - memcpy(&mtexcopybuf, la->mtex[(int)la->texact], sizeof(MTex)); - mtexcopied= 1; - } - } - break; - case B_LMTEXPASTE: - la= G.buts->lockpoin; - if(la && mtexcopied && mtexcopybuf.tex) { - if(la->mtex[(int)la->texact]==NULL ) - la->mtex[(int)la->texact]= MEM_mallocN(sizeof(MTex), "mtex"); - else if(la->mtex[(int)la->texact]->tex) - la->mtex[(int)la->texact]->tex->id.us--; - - memcpy(la->mtex[(int)la->texact], &mtexcopybuf, sizeof(MTex)); - - id_us_plus((ID *)mtexcopybuf.tex); - BIF_undo_push("Paste mapping settings"); - BIF_preview_changed(ID_LA); - scrarea_queue_winredraw(curarea); - } - break; - case B_LFALLOFFCHANGED: - la= G.buts->lockpoin; - curvemapping_changed(la->curfalloff, 1); - BIF_undo_push("Edit Lamp falloff curve"); - BIF_preview_changed(ID_LA); - scrarea_queue_winredraw(curarea); - break; - - } -} - - -static void lamp_panel_mapto(Object *ob, Lamp *la) -{ - uiBlock *block; - MTex *mtex; - - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_mapto", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Texture and Input", "Lamp"); - if(uiNewPanel(curarea, block, "Map To", "Lamp", 1280, 0, 318, 204)==0) return; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - mtex= la->mtex[ la->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - mtex->texco= TEXCO_VIEW; - } - - /* TEXTURE OUTPUT */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MTEX_STENCIL, B_LAMPPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture"); - uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_LAMPPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect"); - uiDefButBitS(block, TOG, MTEX_RGBTOINT, B_LAMPPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_LAMPPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, ""); - uiDefButF(block, NUMSLI, B_LAMPPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_LAMPPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_LAMPPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiBlockEndAlign(block); - uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); - - /* MAP TO */ - uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp"); - - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode"); - uiBlockEndAlign(block); - - uiDefButF(block, NUMSLI, B_LAMPPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values"); - -} - - -static void lamp_panel_texture(Object *ob, Lamp *la) -{ - uiBlock *block; - MTex *mtex; - ID *id; - int a, loos; - char *strp, str[64]; - - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_texture", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Texture and Input", "Lamp", 960, 0, 318, 204)==0) return; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* TEX CHANNELS */ - uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiBlockBeginAlign(block); - for(a= 0; amtex[a]; - if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos); - else strcpy(str, ""); - str[10]= 0; - uiDefButS(block, ROW, B_REDR, str, 10, 160-18*a, 80, 20, &(la->texact), 3.0, (float)a, 0, 0, ""); - } - uiBlockEndAlign(block); - - mtex= la->mtex[ la->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - mtex->texco= TEXCO_VIEW; - } - - /* TEXTUREBLOK SELECT */ - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (ID *)mtex->tex; - IDnames_to_pupstring(&strp, NULL, "ADD NEW %x 32767", &(G.main->tex), id, &(G.buts->texnr)); - - /* doesnt work, because lockpoin points to lamp, not to texture */ - uiDefButS(block, MENU, B_LTEXBROWSE, strp, 100,140,20,19, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new"); - MEM_freeN(strp); - - if(id) { - uiDefBut(block, TEX, B_IDNAME, "TE:", 100,160,200,19, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change"); - sprintf(str, "%d", id->us); - uiDefBut(block, BUT, 0, str, 196,140,21,19, 0, 0, 0, 0, 0, "Displays number of users of texture: click to make single user"); - uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 221,140,21,19, 0, 0, 0, 0, 0, "Auto-assigns name to texture"); - if(id->lib) { - if(la->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,140,21,19, 0, 0, 0, 0, 0, ""); - else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,140,21,19, 0, 0, 0, 0, 0, ""); - } - uiBlockSetCol(block, TH_AUTO); - uiDefBut(block, BUT, B_TEXCLEARLAMP, "Clear", 122, 140, 72, 19, 0, 0, 0, 0, 0, "Erases link to texture"); - } - else - uiDefButS(block, TOG, B_LTEXBROWSE, "Add New" ,100, 160, 200, 19, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock"); - - /* copy/paste */ - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_LMTEXCOPY, ICON_COPYUP, 250,140,25,19, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer"); - uiDefIconBut(block, BUT, B_LMTEXPASTE, ICON_PASTEUP, 275,140,25,19, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer"); - - /* TEXCO */ - uiBlockSetCol(block, TH_AUTO); - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_LAMPPRV, "Glob", 100,110,60,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_LAMPPRV, "View", 160,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Uses view coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_LAMPPRV, "Object", 230,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_LAMPPRV, "", 100,90,200,20, &(mtex->object), ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_LAMPPRV, "dX", 100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Fine tunes texture mapping X coordinate"); - uiDefButF(block, NUM, B_LAMPPRV, "dY", 100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Y coordinate"); - uiDefButF(block, NUM, B_LAMPPRV, "dZ", 100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Fine tunes texture mapping Z coordinate"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_LAMPPRV, "sizeX", 200,50,100,18, mtex->size, -10.0, 10.0, 10, 0, "Sets scaling for the texture's X size"); - uiDefButF(block, NUM, B_LAMPPRV, "sizeY", 200,30,100,18, mtex->size+1, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Y size"); - uiDefButF(block, NUM, B_LAMPPRV, "sizeZ", 200,10,100,18, mtex->size+2, -10.0, 10.0, 10, 0, "Sets scaling for the texture's Z size"); - uiBlockEndAlign(block); -} - -static void lamp_panel_spot(Object *ob, Lamp *la) -{ - uiBlock *block; - float grid=0.0; - - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Shadow and Spot", "Lamp", 640, 0, 318, 204)==0) return; - - /* hemis and ray shadow dont work at all... */ - /* yafray: ignore photonlight as well */ - if ((la->type==LA_HEMI) || (la->type==LA_YF_PHOTON)) return; - - if(G.vd) grid= G.vd->grid; - if(grid<1.0) grid= 1.0; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow"); - if(la->type==LA_SPOT) { - uiDefButBitS(block, TOG, LA_SHAD_BUF, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets spotlight produce shadows using shadow buffer"); - if(la->mode & LA_SHAD_BUF) { - char *tip= "Regular buffer type"; - if(la->buftype==LA_SHADBUF_IRREGULAR) - tip= "Irregular buffer produces sharp shadow always, but it doesn't show up for raytracing"; - else if(la->buftype==LA_SHADBUF_HALFWAY) - tip= "Regular buffer, averaging the closest and 2nd closest Z value for reducing biasing"; - - uiDefButC(block, MENU, B_REDR, "Classical %x0|Classic-Halfway %x2|Irregular %x1", 10,140,80,19,&la->buftype, 0, 0, 0, 0, tip); - } - } - uiBlockEndAlign(block); - - uiDefButBitS(block, TOG, LA_ONLYSHADOW, B_LAMPPRV,"OnlyShadow", 10,110,80,19,&la->mode, 0, 0, 0, 0, "Causes light to cast shadows only without illuminating objects"); - - if(la->type==LA_SPOT) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LA_SQUARE, B_LAMPREDRAW,"Square", 10,60,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles"); - uiDefButBitS(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,40,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the spotlight beam in degrees"); - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotBl ", 100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Sets the softness of the spotlight edge"); - uiBlockEndAlign(block); - - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Sets the intensity of the spotlight halo"); - - if(la->mode & LA_SHAD_BUF) { - if(ELEM(la->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY)) { - uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_SBUFF,"ShadowBufferSize:", 100,110,200,19, &la->bufsize,512,10240, 0, 0, "Sets the size of the shadow buffer to nearest multiple of 16"); - uiDefButS(block, ROW,B_NOP, "Box", 100,90,65,19, &la->filtertype, 0.0, LA_SHADBUF_BOX, 0, 0, "Apply Box filter for shadowbuffer samples"); - uiDefButS(block, ROW,B_NOP, "Tent", 165,90,65,19, &la->filtertype, 0.0, LA_SHADBUF_TENT, 0, 0, "Apply Tent filter for shadowbuffer samples"); - uiDefButS(block, ROW,B_NOP, "Gauss", 230,90,70,19, &la->filtertype, 0.0, LA_SHADBUF_GAUSS, 0, 0, "Apply Gauss filter for shadowbuffer samples"); - - // uiDefButS(block, ROW,B_NOP,"SubSamples: 1", 100,90,140,19, &la->buffers, 1.0, 1.0, 0, 0, "Amount of lampbuffer subsamples, a value of larger than 1 halves the shadowbuffer size"); - // uiDefButS(block, ROW,B_NOP,"4", 240,90,30,19, &la->buffers, 1.0, 4.0, 0, 0, "Amount of lampbuffer subsamples, this halves the actual shadowbuffer size"); - // uiDefButS(block, ROW,B_NOP,"9", 270,90,30,19, &la->buffers, 1.0, 9.0, 0, 0, "Amount of lampbuffer subsamples, this halves the shadowbuffer size"); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_LAMPREDRAW,"Samples:", 100,60,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples"); - uiDefButS(block, NUM,B_NOP,"Halo step:", 200,60,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency"); - uiDefButF(block, NUM,B_LAMPREDRAW,"Bias:", 100,40,100,19, &la->bias, 0.001, 5.0, 1, 0, "Sets the shadow map sampling bias"); - uiDefButF(block, NUM,B_LAMPREDRAW,"Soft:", 200,40,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area"); - } - else { /* LA_SHADBUF_IRREGULAR */ - uiDefButF(block, NUM,B_LAMPREDRAW,"Bias:", 100,40,100,19, &la->bias, 0.01, 5.0, 1, 0, "Sets the shadow map sampling bias"); - } - - uiBlockBeginAlign(block); - uiDefIconButBitC(block, TOG, LA_SHADBUF_AUTO_START, B_REDR, ICON_AUTO, 10, 10, 25, 19, &la->bufflag, 0.0, 0.0, 0, 0, "Automatic calculation of clipping-start, based on visible vertices"); - if(la->bufflag & LA_SHADBUF_AUTO_START) - uiDefBut(block, LABEL, B_NOP, "ClipSta: Auto", 35,10,115,19, NULL, 0, 0, 0, 0, ""); - else - uiDefButF(block, NUM,REDRAWVIEW3D,"ClipSta:", 35,10,115,19, &la->clipsta, 0.1*grid,1000.0*grid, 10, 0, "Sets the shadow map clip start: objects closer will not generate shadows"); - uiDefIconButBitC(block, TOG, LA_SHADBUF_AUTO_END, B_REDR, ICON_AUTO, 160, 10, 25, 19, &la->bufflag, 0.0, 0.0, 0, 0, "Automatic calculation of clipping-end, based on visible vertices"); - if(la->bufflag & LA_SHADBUF_AUTO_END) - uiDefBut(block, LABEL,B_NOP, "ClipEnd: Auto", 185,10,115,19, NULL, 0, 0, 0, 0, ""); - else - uiDefButF(block, NUM,REDRAWVIEW3D,"ClipEnd:", 185,10,115,19,&la->clipend, 1.0, 5000.0*grid, 100, 0, "Sets the shadow map clip end beyond which objects will not generate shadows"); - uiBlockEndAlign(block); - - } - } - if(ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && (la->mode & LA_SHAD_RAY)) { - - if (ELEM3(la->type, LA_SPOT, LA_SUN, LA_LOCAL)) { - if (la->ray_samp_method == LA_SAMP_CONSTANT) la->ray_samp_method = LA_SAMP_HALTON; - - uiDefButS(block, MENU, B_REDR, "Adaptive QMC %x1|Constant QMC %x2", - 100,110,200,19, &la->ray_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Adaptive QMC is fastest, Constant QMC is less noisy but slower"); - - uiDefButF(block, NUM,B_LAMPREDRAW,"Soft Size", 100,80,200,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size, doesn't affect energy amount"); - - uiDefButS(block, NUM,0,"Samples:", 100,60,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)"); - uiDefButF(block, NUM,0,"Threshold:", 100,40,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow"); - } - else if (la->type == LA_AREA) { - uiDefButS(block, MENU, B_REDR, "Adaptive QMC %x1|Constant QMC %x2|Constant Jittered %x0", - 100,180,200,19, &la->ray_samp_method, 0, 0, 0, 0, "Method for generating shadow samples: Adaptive QMC is fastest"); - - if(la->area_shape==LA_AREA_SQUARE) - uiDefButS(block, NUM,0,"Samples:", 100,150,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)"); - else if(la->area_shape==LA_AREA_CUBE) - uiDefButS(block, NUM,0,"Samples:", 100,130,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp x samp)"); - - if (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_BOX)) { - uiDefButS(block, NUM,0,"SamplesX:", 100,150,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of X samples taken extra"); - uiDefButS(block, NUM,0,"SamplesY:", 100,130,200,19, &la->ray_sampy, 1.0, 16.0, 100, 0, "Sets the amount of Y samples taken extra"); - if(la->area_shape==LA_AREA_BOX) - uiDefButS(block, NUM,0,"SamplesZ:", 100,110,200,19, &la->ray_sampz, 1.0, 8.0, 100, 0, "Sets the amount of Z samples taken extra"); - } - - if (la->ray_samp_method == LA_SAMP_CONSTANT) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, LA_SAMP_UMBRA, 0,"Umbra", 100,90,200,19,&la->ray_samp_type, 0, 0, 0, 0, "Emphasis parts that are fully shadowed"); - uiDefButBitS(block, TOG, LA_SAMP_DITHER, 0,"Dither", 100,70,100,19,&la->ray_samp_type, 0, 0, 0, 0, "Use 2x2 dithering for sampling"); - uiDefButBitS(block, TOG, LA_SAMP_JITTER, 0,"Noise", 200,70,100,19,&la->ray_samp_type, 0, 0, 0, 0, "Use noise for sampling"); - } else if (la->ray_samp_method == LA_SAMP_HALTON) { - uiDefButF(block, NUM,0,"Threshold:", 100,90,200,19, &la->adapt_thresh, 0.0, 1.0, 100, 0, "Threshold for adaptive sampling, to control what level is considered already in shadow"); - } - } - - - } - else uiDefBut(block, LABEL,0," ", 100,180,200,19,NULL, 0, 0, 0, 0, ""); - -} - -/* yafray: adaptation of lamp_panel_spot above with yafray specific parameters */ -static void lamp_panel_yafray(Object *ob, Lamp *la) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_yafray", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Yafray: Shadow and Photons", "Lamp", 640, 0, 318, 204)==0) return; - - /* hemis not used in yafray */ - if(la->type==LA_HEMI) return; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - /* photonlight params */ - if (la->type==LA_YF_PHOTON) { - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, 1, B_DIFF,"Use QMC",10,180,80,19,&la->YF_useqmc, 0, 0, 0, 0, "Use QMC sampling (sometimes visible patterns)"); - uiBlockSetCol(block, TH_AUTO); - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"Angle ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the photonlight beam in degrees"); - uiDefButI(block, NUM,B_DIFF,"photons:", 10,150,290,19, &la->YF_numphotons, 10000, 100000000, 0, 0, "Maximum number of photons to shoot"); - uiDefButI(block, NUM,B_DIFF,"search:", 10,130,290,19, &la->YF_numsearch, 100, 1000, 0, 0, "Number of photons to mix (blur)"); - uiDefButS(block, NUM,B_DIFF,"depth:", 10,100,290,19, &la->YF_phdepth, 1, 100, 0, 0, "Maximum caustic bounce depth"); - uiDefButF(block, NUM,B_DIFF,"Blur:", 10,70,290,19, &la->YF_causticblur, 0.01, 1.0, 1, 0, "Amount of caustics blurring (also depends on search)"); - return; - } - - uiBlockSetCol(block, TH_BUT_SETTING1); - - /* in yafray arealights always cast shadows, so ray shadow flag not needed */ - /* ray shadow also not used when halo for spot enabled */ - if ((la->type!=LA_AREA) && (!((la->type==LA_SPOT) && (la->mode & LA_HALO)))) - uiDefButBitS(block, TOG, LA_SHAD_RAY, B_SHADRAY,"Ray Shadow",10,180,80,19,&la->mode, 0, 0, 0, 0, "Use ray tracing for shadow"); - - /* in yafray the regular lamp can use shadowbuffers (softlight), used by spot with halo as well */ - /* to prevent clash with blender shadowbuf flag, a special flag is used for yafray */ - if (la->type==LA_LOCAL) { - uiDefButBitS(block, TOG, LA_YF_SOFT, B_SHADBUF, "Buf.Shadow",10,160,80,19,&la->mode, 0, 0, 0, 0, "Lets light produce shadows using shadow buffer"); - uiDefButF(block, NUM, B_DIFF, "GloInt:", 100,155,200,19, &la->YF_glowint, 0.0, 1.0, 1, 0, "Sets light glow intensity, 0 is off"); - uiDefButF(block, NUM, B_DIFF, "GloOfs:", 100,135,100,19, &la->YF_glowofs, 0.0, 2.0, 1, 0, "Sets light glow offset, the higher, the less 'peaked' the glow"); - uiDefButS(block, NUM, B_DIFF, "GlowType:", 200,135,100,19, &la->YF_glowtype, 0, 1, 1, 0, "Sets light glow type"); - } - - /* shadowbuffers used only for 'softlight' & spotlight with halo */ - if (((la->type==LA_LOCAL) && (la->mode & LA_YF_SOFT)) || ((la->type==LA_SPOT) && (la->mode & LA_HALO))) { - /* Shadow buffer size can be anything in yafray, but reasonable minimum is 128 */ - /* Maximum is 1024, since zbuf in yafray is float, no multiple of 16 restriction */ - uiDefButS(block, NUM,B_DIFF,"ShadowBufferSize:", 100,110,200,19, &la->YF_bufsize, 128, 1024, 0, 0, "Sets the size of the shadow buffer"); - - /* samples & halostep params only used for spotlight with halo */ - if ((la->type==LA_SPOT) && (la->mode & LA_HALO)) { - uiDefButS(block, NUM,B_DIFF,"Samples:", 100,30,100,19, &la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples"); - uiDefButS(block, NUM,B_DIFF,"Halo step:", 200,30,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Sets the volumetric halo sampling frequency"); - } - uiDefButF(block, NUM,B_DIFF,"Bias:", 100,10,100,19, &la->bias, 0.01, 5.0, 1, 0, "Sets the shadow map sampling bias"); - /* here can use the Blender soft param, since for yafray it has the same function as in Blender */ - uiDefButF(block, NUM,B_DIFF,"Soft:", 200,10,100,19, &la->soft,1.0,100.0, 100, 0, "Sets the size of the shadow sample area"); - } - else if ((la->type==LA_LOCAL) && (la->mode & LA_SHAD_RAY)) { - /* for spherelight, light radius */ - uiDefButF(block, NUM,B_DIFF,"Radius:", 200,10,100,19, &la->YF_ltradius, 0.0,100.0, 100, 0, "Sets the radius of the lightsource, 0 is same as pointlight"); - } - - if (la->type==LA_SPOT) { - - uiDefButBitS(block, TOG, LA_HALO, B_LAMPREDRAW,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Renders spotlight with a volumetric halo"); - - uiBlockSetCol(block, TH_AUTO); - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Sets the angle of the spotlight beam in degrees"); - uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotBl ", 100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Sets the softness of the spotlight edge"); - uiBlockEndAlign(block); - - if (la->mode & LA_HALO) uiDefButF(block, NUMSLI,0,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Sets the intensity of the spotlight halo"); - } - else if ((la->type==LA_AREA) || ((la->type==LA_LOCAL) && (la->mode & LA_SHAD_RAY))) { - /* area samples param also used for 'spherelight' */ - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_AUTO); - - uiDefButS(block, NUM,B_DIFF,"Samples:", 100,180,200,19, &la->ray_samp, 1.0, 16.0, 100, 0, "Sets the amount of samples taken extra (samp x samp)"); - - /* shadow sampling types not used in yafray, removed */ - } - else uiDefBut(block, LABEL,0," ", 100,180,200,19,NULL, 0, 0, 0, 0, ""); - -} - -static void lamp_panel_falloff(Object *ob, Lamp *la) -{ - uiBlock *block; - rctf butr; - short yco=PANEL_YMAX; - float grid= 0.0; - - /* name "Preview" is abused to detect previewrender offset panel */ - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_falloff", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Lamp", "Lamp"); - if(uiNewPanel(curarea, block, "Falloff Curve", "Lamp", PANELX, PANELY, PANELW, PANELH)==0) return; - - if(G.vd) grid= G.vd->grid; - if(grid<1.0) grid= 1.0; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - BLI_init_rctf(&butr, 10.0, 310.0, 10.0, (float)yco); - curvemap_buttons(block, la->curfalloff, 's', B_LFALLOFFCHANGED, B_LAMPREDRAW, &butr); - -} - -static void lamp_panel_lamp(Object *ob, Lamp *la) -{ - uiBlock *block; - float grid= 0.0; - short xco; - - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_lamp", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Lamp", "Lamp", 320, 0, 318, 204)==0) return; - - if(G.vd) grid= G.vd->grid; - if(grid<1.0) grid= 1.0; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockSetCol(block, TH_BUT_SETTING2); - xco= std_libbuttons(block, 8, 180, 0, NULL, B_LAMPBROWSE, ID_LA, 0, (ID *)la, (ID *)ob, &(G.buts->menunr), B_LAMPALONE, B_LAMPLOCAL, 0, 0, 0); - - uiBlockSetCol(block, TH_AUTO); - uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:", xco,180,300-xco,20,&la->dist, 0.01, 5000.0*grid, 100, 0, "Sets the distance value at which light intensity is half"); - - uiBlockBeginAlign(block); - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - if(la->type==LA_AREA) { - //uiDefButS(block, MENU, B_LAMPREDRAW, "Shape %t|Square %x0|Rect %x1|Cube %x2|Box %x3", - uiDefButS(block, MENU, B_LAMPREDRAW, "Shape %t|Square %x0|Rect %x1", - 10, 150, 100, 19, &la->area_shape, 0,0,0,0, "Sets area light shape"); - if (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_BOX)){ - uiDefButF(block, NUM,B_LAMPREDRAW,"SizeX ", 10,130,100,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size X, doesn't affect energy amount"); - uiDefButF(block, NUM,B_LAMPREDRAW,"SizeY ", 10,110,100,19, &la->area_sizey, 0.01, 100.0, 10, 0, "Area light size Y, doesn't affect energy amount"); - } - if(la->area_shape==LA_AREA_BOX) - uiDefButF(block, NUM,B_LAMPREDRAW,"SizeZ ", 10,90,100,19, &la->area_sizez, 0.01, 100.0, 10, 0, "Area light size Z, doesn't affect energy amount"); - if (ELEM(la->area_shape, LA_AREA_SQUARE, LA_AREA_CUBE)) - uiDefButF(block, NUM,B_LAMPREDRAW,"Size ", 10,130,100,19, &la->area_size, 0.01, 100.0, 10, 0, "Area light size, doesn't affect energy amount"); - } - else if( ELEM(la->type, LA_LOCAL, LA_SPOT)) { - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButS(block, MENU, B_LAMPREDRAW, "Falloff %t|Constant %x0|Inverse Linear %x1|Inverse Square %x2|Custom Curve %x3|Lin/Quad Weighted %x4|", - 10,150,100,19, &la->falloff_type, 0,0,0,0, "Lamp falloff - intensity decay with distance"); - uiDefButBitS(block, TOG, LA_SPHERE, REDRAWVIEW3D,"Sphere", 10,130,100,19,&la->mode, 0, 0, 0, 0, "Sets light intensity to zero for objects beyond the distance value"); - } - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, LA_LAYER, 0,"Layer", 10,70,100,19,&la->mode, 0, 0, 0, 0, "Illuminates objects in the same layer as the lamp only"); - uiDefButBitS(block, TOG, LA_NEG, B_LAMPPRV,"Negative", 10,50,100,19,&la->mode, 0, 0, 0, 0, "Sets lamp to cast negative light"); - uiDefButBitS(block, TOG, LA_NO_DIFF, 0,"No Diffuse", 10,30,100,19,&la->mode, 0, 0, 0, 0, "Disables diffuse shading of material illuminated by this lamp"); - uiDefButBitS(block, TOG, LA_NO_SPEC, 0,"No Specular", 10,10,100,19,&la->mode, 0, 0, 0, 0, "Disables specular shading of material illuminated by this lamp"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_AUTO); - uiDefButF(block, NUMSLI,B_LAMPPRV,"Energy ", 120,150,180,20, &(la->energy), 0.0, 10.0, 0, 0, "Sets the intensity of the light"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI,B_LAMPPRV,"R ", 120,120,180,20,&la->r, 0.0, 1.0, B_COLLAMP, 0, "Sets the red component of the light"); - uiDefButF(block, NUMSLI,B_LAMPPRV,"G ", 120,100,180,20,&la->g, 0.0, 1.0, B_COLLAMP, 0, "Sets the green component of the light"); - uiDefButF(block, NUMSLI,B_LAMPPRV,"B ", 120,80,180,20,&la->b, 0.0, 1.0, B_COLLAMP, 0, "Sets the blue component of the light"); - uiBlockEndAlign(block); - - uiDefButF(block, COL, B_LAMPPRV, "", 120,52,180,24, &la->r, 0, 0, 0, B_COLLAMP, ""); - - uiBlockBeginAlign(block); - if (ELEM(la->type, LA_LOCAL, LA_SPOT) && (la->falloff_type == LA_FALLOFF_SLIDERS)) { - uiDefButF(block, NUMSLI,B_LAMPPRV,"Linear ", 120,30,180,19,&la->att1, 0.0, 1.0, 0, 0, "Set the linear distance attenuatation for a quad lamp"); - uiDefButF(block, NUMSLI,B_LAMPPRV,"Quad ", 120,10,180,19,&la->att2, 0.0, 1.0, 0, 0, "Set the quadratic distance attenuatation for a quad lamp"); - } - else if(la->type==LA_AREA) { - if(la->k==0.0) la->k= 1.0; - uiDefButF(block, NUMSLI,0,"Gamma ", 120,10,180,19,&la->k, 0.001, 2.0, 100, 0, "Set the light gamma correction value"); - } -} - - -static void lamp_panel_preview(Object *ob, Lamp *la) -{ - uiBlock *block; - - /* name "Preview" is abused to detect previewrender offset panel */ - block= uiNewBlock(&curarea->uiblocks, "lamp_panel_preview", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Preview", "Lamp", 0, 0, 318, 204)==0) return; - - uiSetButLock(la->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - uiBlockSetDrawExtraFunc(block, BIF_previewdraw); - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_LAMPREDRAW,"Lamp", 200,175,80,25,&la->type,1.0,(float)LA_LOCAL, 0, 0, "Creates an omnidirectional point light source"); - uiDefButS(block, ROW,B_LAMPREDRAW,"Area", 200,150,80,25,&la->type,1.0,(float)LA_AREA, 0, 0, "Creates a directional area light source"); - uiDefButS(block, ROW,B_LAMPREDRAW,"Spot", 200,125,80,25,&la->type,1.0,(float)LA_SPOT, 0, 0, "Creates a directional cone light source"); - uiDefButS(block, ROW,B_LAMPREDRAW,"Sun", 200,100,80,25,&la->type,1.0,(float)LA_SUN, 0, 0, "Creates a constant direction parallel ray light source"); - uiDefButS(block, ROW,B_LAMPREDRAW,"Hemi", 200,75,80,25,&la->type,1.0,(float)LA_HEMI, 0, 0, "Creates a 180 degree constant light source"); - /* yafray: extra type, photonlight */ - if (G.scene->r.renderer==R_YAFRAY) - uiDefButS(block, ROW,B_LAMPREDRAW,"Photon", 200,50,80,25,&la->type,1.0,(float)LA_YF_PHOTON, 0, 0, "Creates a special caustics photon 'light', not a real lightsource, use with other lights"); -} - - -/* ****************** MATERIAL ***************** */ - - -void do_matbuts(unsigned short event) -{ - static short mtexcopied=0; - static MTex mtexcopybuf; - Material *ma; - MTex *mtex; - - /* all operations default on active material layer here */ - /* but this also gets called for lamp and world... */ - ma= G.buts->lockpoin; - if(ma && GS(ma->id.name)==ID_MA) - ma = editnode_get_active_material(ma); - else - ma= NULL; - - switch(event) { - case B_MAT_YF_PRESET: { - switch (ma->YF_preset) { - case 0: - /* normal mode, no reflection/refraction */ - ma->alpha = 1; - ma->mode &= ~(MA_RAYMIRROR+MA_RAYTRANSP+MA_ZTRA); - break; - case 1: { - /* clear glass */ - ma->alpha = 0.001; - ma->ray_mirror = 1; - ma->fresnel_mir_i = 5; - ma->mode |= (MA_RAYMIRROR+MA_RAYTRANSP); - ma->mode &= ~MA_ZTRA; - ma->filter = 0; - ma->ang = 1.5; - break; - } - case 2: { - /* color glass */ - ma->alpha = 0.001; - ma->ray_mirror = 1; - ma->fresnel_mir_i = 5; - ma->mode |= (MA_RAYMIRROR+MA_RAYTRANSP); - ma->mode &= ~MA_ZTRA; - ma->filter = 1; - ma->ang = 1.5; - break; - } - case 3: { - /* uniform reflect */ - ma->alpha = 1; - ma->ray_mirror = 1; - ma->fresnel_mir_i = 1; - ma->mode |= MA_RAYMIRROR; - ma->mode &= ~(MA_RAYTRANSP+MA_ZTRA); - break; - } - case 4: { - /* fresnel reflect */ - ma->alpha = 1; - ma->ray_mirror = 1; - ma->fresnel_mir_i = 5; - ma->mode |= MA_RAYMIRROR; - ma->mode &= ~(MA_RAYTRANSP+MA_ZTRA); - ma->ang = 3; - break; - } - } - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 0); - shade_buttons_change_3d(); - break; - } - case B_ACTCOL: - scrarea_queue_headredraw(curarea); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_MA); - break; - case B_MATFROM: - scrarea_queue_headredraw(curarea); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - // BIF_previewdraw(); push/pop! - break; - case B_MATPRV: - if(ma) end_render_material(ma); /// temporal... 3d preview - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 0); - shade_buttons_change_3d(); - break; - case B_LAMPPRV: - BIF_preview_changed(ID_LA); - allqueue(REDRAWBUTSSHADING, 0); - break; - case B_WORLDPRV: - BIF_preview_changed(ID_WO); - allqueue(REDRAWBUTSSHADING, 0); - break; - case B_WORLDPRV2: - BIF_preview_changed(ID_WO); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_MATHALO: - /* when halo is disabled, clear star flag, this is the same as MA_FACETEXTURE */ - /* same for 'xtreme alpha' which is 'only shadow' */ - if(ma) { - if((ma->mode & MA_HALO)==0) { - ma->mode &= ~(MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV); - } - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 0); - shade_buttons_change_3d(); - } - break; - case B_TEXCLEAR: - mtex= ma->mtex[(int) ma->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - ma->mtex[ (int) ma->texact ]= 0; - BIF_undo_push("Unlink material texture"); - if(ma) end_render_material(ma); /// temporal... 3d preview - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_MA); - } - break; - case B_MTEXCOPY: - if(ma && ma->mtex[(int)ma->texact] ) { - mtex= ma->mtex[(int)ma->texact]; - if(mtex->tex==NULL) { - error("No texture available"); - } - else { - memcpy(&mtexcopybuf, ma->mtex[(int)ma->texact], sizeof(MTex)); - mtexcopied= 1; - } - } - break; - case B_MTEXPASTE: - if(ma && mtexcopied && mtexcopybuf.tex) { - if(ma->mtex[(int)ma->texact]==NULL ) - ma->mtex[(int)ma->texact]= MEM_mallocN(sizeof(MTex), "mtex"); - else if(ma->mtex[(int)ma->texact]->tex) - ma->mtex[(int)ma->texact]->tex->id.us--; - - memcpy(ma->mtex[(int)ma->texact], &mtexcopybuf, sizeof(MTex)); - - id_us_plus((ID *)mtexcopybuf.tex); - BIF_undo_push("Paste mapping settings"); - BIF_preview_changed(ID_MA); - scrarea_queue_winredraw(curarea); - } - break; - case B_MATZTRANSP: - if(ma) { - ma->mode &= ~MA_RAYTRANSP; - //BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); /// temporal... 3d preview - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_MA); - } - break; - case B_MATRAYTRANSP: - if(ma) { - ma->mode &= ~MA_ZTRA; - if(ma) end_render_material(ma); /// temporal... 3d preview - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_MA); - } - break; - case B_MATCOLORBAND: - if(ma) { - if(ma->mode & MA_RAMP_COL) - if(ma->ramp_col==NULL) ma->ramp_col= add_colorband(0); - if(ma->mode & MA_RAMP_SPEC) - if(ma->ramp_spec==NULL) ma->ramp_spec= add_colorband(0); - - if(ma) end_render_material(ma); /// temporal... 3d preview - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_MA); - shade_buttons_change_3d(); - } - break; - case B_MAT_USENODES: - ma= G.buts->lockpoin; /* use base material instead */ - if(ma) { - if(ma->use_nodes && ma->nodetree==NULL) { - node_shader_default(ma); - } - if(ma) end_render_material(ma); /// temporal... 3d preview - BIF_preview_changed(ID_MA); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - } - break; - case B_MAT_VCOL_PAINT: - if(ma) { - ma->mode &= ~MA_VERTEXCOL; - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 0); - } - break; - case B_MAT_VCOL_LIGHT: - if(ma) { - ma->mode &= ~MA_VERTEXCOLP; - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 0); - } - break; - - case B_MAT_PARTICLE: - if(ma) { - Base *base; - Object *ob; - ParticleSystem *psys; - - base= G.scene->base.first; - while(base){ - if(base->object->type==OB_MESH) { - ob=base->object; - for(psys=ob->particlesystem.first; psys; psys=psys->next) { - if(psys && ma==give_current_material(ob,psys->part->omat)) { - psys->flag |= PSYS_INIT; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - base = base->next; - } - allqueue(REDRAWVIEW3D, 0); - } - } -} - -static void particle_recalc_material(void *ma_v, void *arg2) -{ - Material *ma = ma_v; - Base *base; - Object *ob; - ParticleSystem *psys; - - base= G.scene->base.first; - while(base){ - if(base->object->type==OB_MESH){ - ob=base->object; - for(psys=ob->particlesystem.first; psys; psys=psys->next){ - if(psys && ma==give_current_material(ob,psys->part->omat)){ - psys->recalc |= PSYS_INIT; - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - base = base->next; - } - allqueue(REDRAWVIEW3D, 0); -} - -/* if from nodes, hide options that are not available */ -static void material_panel_map_to(Object *ob, Material *ma, int from_nodes) -{ - uiBlock *block; - uiBut *but; - MTex *mtex; - ParticleSystem *psys; - int psys_mapto=0; - static short pattr=0; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_map_to", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Texture", "Material"); - if(uiNewPanel(curarea, block, "Map To", "Material", 1600, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - mtex= ma->mtex[ ma->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - } - - /* TEXTURE OUTPUT */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MTEX_STENCIL, B_MATPRV, "Stencil", 10,125,45,19, &(mtex->texflag), 0, 0, 0, 0, "Use this texture as a blending value on the next texture"); - uiDefButBitS(block, TOG, MTEX_NEGATIVE, B_MATPRV, "Neg", 55,125,30,19, &(mtex->texflag), 0, 0, 0, 0, "Inverts the values of the texture to reverse its effect"); - uiDefButBitS(block, TOG,MTEX_RGBTOINT, B_MATPRV, "No RGB", 85,125,60,19, &(mtex->texflag), 0, 0, 0, 0, "Converts texture RGB values to intensity (gray) values"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_MATPRV, "", 10,100,135,19, &(mtex->r), 0, 0, 0, B_MTEXCOL, ""); - - if(ma->colormodel==MA_HSV) { - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButF(block, HSVSLI, B_MATPRV, "H ", 10,80,135,19, &(mtex->r), 0.0, 0.9999, B_MTEXCOL, 0, ""); - uiDefButF(block, HSVSLI, B_MATPRV, "S ", 10,60,135,19, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, ""); - uiDefButF(block, HSVSLI, B_MATPRV, "V ", 10,40,135,19, &(mtex->r), 0.0001, 1.0, B_MTEXCOL, 0, ""); - uiBlockSetCol(block, TH_AUTO); - } - else { - uiDefButF(block, NUMSLI, B_MATPRV, "R ", 10,80,135,19, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_MATPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - uiDefButF(block, NUMSLI, B_MATPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); - } - uiBlockEndAlign(block); - - uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); - - /* MAP TO */ - uiBlockBeginAlign(block); - - /*check if material is being used by particles*/ - for(psys=ob->particlesystem.first; psys; psys=psys->next) - if(psys->part->omat==ob->actcol) - psys_mapto=1; - - if(psys_mapto && pattr) { - but=uiDefButBitS(block, TOG3, MAP_PA_TIME, B_MAT_PARTICLE, "Time", 10,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the emission time of particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - but=uiDefButBitS(block, TOG3, MAP_PA_LIFE, B_MAT_PARTICLE, "Life", 70,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the life time of particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - but=uiDefButBitS(block, TOG3, MAP_PA_DENS, B_MAT_PARTICLE, "Dens", 130,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the density of particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - uiDefButBitS(block, TOG3, MAP_PA_IVEL, B_MAT_PARTICLE, "IVel", 190,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the initial velocity of particles"); - uiDefButBitS(block, TOG3, MAP_PA_ROUGH, B_MAT_PARTICLE, "Rough", 250,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the roughness of child particles"); - - but=uiDefButBitS(block, TOG3, MAP_PA_SIZE, B_MAT_PARTICLE, "Size", 10,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the size of particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - but=uiDefButBitS(block, TOG3, MAP_PA_KINK, B_MAT_PARTICLE, "Kink", 70,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the kink of child particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - but=uiDefButBitS(block, TOG3, MAP_PA_LENGTH, B_MAT_PARTICLE, "Length",130,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the length of particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - but=uiDefButBitS(block, TOG3, MAP_PA_CLUMP, B_MAT_PARTICLE, "Clump", 190,160,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the clump of child particles"); - //uiButSetFunc(but, particle_recalc_material, ma, NULL); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, 1, B_MATPRV, "PAttr", 250,160,60,19, &pattr, 0, 0, 0, 0, "Display settings for particle attributes"); - uiBlockSetCol(block, TH_AUTO); - } - else { - uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic colour of the material"); - uiDefButBitS(block, TOG3, MAP_NORM, B_MATPRV, "Nor", 50,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the rendered normal"); - uiDefButBitS(block, TOG, MAP_COLSPEC, B_MATPRV, "Csp", 90,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the specularity colour"); - uiDefButBitS(block, TOG, MAP_COLMIR, B_MATPRV, "Cmir", 130,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the mirror colour"); - uiDefButBitS(block, TOG3, MAP_REF, B_MATPRV, "Ref", 180,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of the materials reflectivity"); - uiDefButBitS(block, TOG3, MAP_SPEC, B_MATPRV, "Spec", 220,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity"); - uiDefButBitS(block, TOG3, MAP_AMB, B_MATPRV, "Amb", 270,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of ambient"); - - if(psys_mapto) { - uiDefButBitS(block, TOG3, MAP_HAR, B_MATPRV, "Hard", 10,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value"); - uiDefButBitS(block, TOG3, MAP_RAYMIRR, B_MATPRV, "RayMir", 50,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the ray-mirror value"); - uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Alpha", 90,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value"); - uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 130,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); - uiDefButBitS(block, TOG3, MAP_TRANSLU, B_MATPRV, "TransLu", 180,160,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the layer blending value"); - if(from_nodes==0) - uiDefButBitS(block, TOG3, MAP_DISPLACE, B_MATPRV, "Disp", 220,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture displace the surface"); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitS(block, TOG, 1, B_MATPRV, "PAttr", 270,160,40,19, &pattr, 0, 0, 0, 0, "Display settings for particle attributes"); - uiBlockSetCol(block, TH_AUTO); - } - else { - uiDefButBitS(block, TOG3, MAP_HAR, B_MATPRV, "Hard", 10,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the hardness value"); - uiDefButBitS(block, TOG3, MAP_RAYMIRR, B_MATPRV, "RayMir", 60,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the ray-mirror value"); - uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Alpha", 110,160,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value"); - uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 160,160,45,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); - uiDefButBitS(block, TOG3, MAP_TRANSLU, B_MATPRV, "TransLu", 205,160,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the layer blending value"); - if(from_nodes==0) - uiDefButBitS(block, TOG3, MAP_DISPLACE, B_MATPRV, "Disp", 265,160,45,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture displace the surface"); - } - } - - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - but=uiDefButS(block, MENU, B_MATPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode"); - uiBlockEndAlign(block); - if(psys_mapto && mtex->pmapto & MAP_PA_INIT) - uiButSetFunc(but, particle_recalc_material, ma, NULL); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values"); - /* newnoise: increased range to 25, the constant offset for bumpmapping quite often needs a higher nor setting */ - uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 25.0, 0, 0, "Sets the amount the texture affects normal values"); - but=uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values"); - if(psys_mapto && mtex->pmapto & MAP_PA_INIT) - uiButSetFunc(but, particle_recalc_material, ma, NULL); - uiDefButF(block, NUMSLI, B_MATPRV, "Disp ", 155,40,155,19, &(mtex->dispfac), 0.0, 1.0, 0, 0, "Sets the amount the texture displaces the surface"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MAP_WARP, B_MATPRV, "Warp", 155,10,40,19, &(mtex->mapto), 0, 0, 0, 0, "Let the texture warp texture coordinates of next channels"); - uiDefButF(block, NUMSLI, B_MATPRV, "fac ", 195,10,115,19, &(mtex->warpfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects texture coordinates of next channels"); -} - -/* autocomplete callback for buttons */ -void autocomplete_uv(char *str, void *arg_v) -{ - Mesh *me; - CustomDataLayer *layer; - AutoComplete *autocpl; - int a; - - if(str[0]==0) - return; - - autocpl= autocomplete_begin(str, 32); - - /* search if str matches the beginning of name */ - for(me= G.main->mesh.first; me; me=me->id.next) - for(a=0, layer= me->fdata.layers; afdata.totlayer; a++, layer++) - if(layer->type == CD_MTFACE) - autocomplete_do_name(autocpl, layer->name); - - autocomplete_end(autocpl, str); -} - -int verify_valid_uv_name(char *str) -{ - Mesh *me; - CustomDataLayer *layer; - int a; - - if(str[0]==0) - return 1; - - /* search if str matches the name */ - for(me= G.main->mesh.first; me; me=me->id.next) - for(a=0, layer= me->fdata.layers; afdata.totlayer; a++, layer++) - if(layer->type == CD_MTFACE) - if(strcmp(layer->name, str)==0) - return 1; - - return 0; -} - -static void material_panel_map_input(Object *ob, Material *ma) -{ - uiBlock *block; - uiBut *but; - MTex *mtex; - int b; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_map_input", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Texture", "Material"); - if(uiNewPanel(curarea, block, "Map Input", "Material", 1280, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - mtex= ma->mtex[ ma->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - } - - /* TEXCO */ - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); - if(mtex->texco == TEXCO_UV) { - if(!verify_valid_uv_name(mtex->uvname)) - uiBlockSetCol(block, TH_REDALERT); - but=uiDefBut(block, TEX, B_MATPRV, "UV:", 750,180,158,18, mtex->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer"); - uiButSetCompleteFunc(but, autocomplete_uv, NULL); - uiBlockSetCol(block, TH_AUTO); - } - else - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), ""); - - uiDefButS(block, ROW, B_MATPRV, "UV", 630,160,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Uses UV coordinates for texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Orco", 670,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object"); - if( ob->particlesystem.first ) - uiDefButS(block, ROW, B_MATPRV, "Strand", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STRAND, 0, 0, "Uses normalized strand texture coordinate (1D)"); - else - uiDefButS(block, ROW, B_MATPRV, "Stick", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STICKY, 0, 0, "Uses mesh's sticky coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Win", 775,160,45,18, &(mtex->texco), 4.0, (float)TEXCO_WINDOW, 0, 0, "Uses screen coordinates as texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Nor", 820,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Uses normal vector as texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Refl", 864,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Uses reflection vector as texture coordinates"); - - uiDefButS(block, ROW, B_MATPRV, "Stress", 630,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_STRESS, 0, 0, "Uses the difference of edge lengths compared to original coordinates of the mesh"); - uiDefButS(block, ROW, B_MATPRV, "Tangent", 700,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_TANGENT, 0, 0, "Uses the optional tangent vector as texture coordinates"); - - /* COORDS */ - uiBlockBeginAlign(block); - uiDefButC(block, ROW, B_MATPRV, "Flat", 630,115,48,19, &(mtex->mapping), 5.0, (float)MTEX_FLAT, 0, 0, "Maps X and Y coordinates directly"); - uiDefButC(block, ROW, B_MATPRV, "Cube", 681,115,50,19, &(mtex->mapping), 5.0, (float)MTEX_CUBE, 0, 0, "Maps using the normal vector"); - uiDefButC(block, ROW, B_MATPRV, "Tube", 630,95,48,19, &(mtex->mapping), 5.0, (float)MTEX_TUBE, 0, 0, "Maps with Z as central axis (tube-like)"); - uiDefButC(block, ROW, B_MATPRV, "Sphe", 681,95,50,19, &(mtex->mapping), 5.0, (float)MTEX_SPHERE, 0, 0, "Maps with Z as central axis (sphere-like)"); - - uiBlockBeginAlign(block); - for(b=0; b<3; b++) { - char *cp; - if(b==0) cp= &(mtex->projx); - else if(b==1) cp= &(mtex->projy); - else cp= &(mtex->projz); - - uiDefButC(block, ROW, B_MATPRV, "", 630, 50-20*b, 24, 18, cp, 6.0+b, 0.0, 0, 0, ""); - uiDefButC(block, ROW, B_MATPRV, "X", 656, 50-20*b, 24, 18, cp, 6.0+b, 1.0, 0, 0, ""); - uiDefButC(block, ROW, B_MATPRV, "Y", 682, 50-20*b, 24, 18, cp, 6.0+b, 2.0, 0, 0, ""); - uiDefButC(block, ROW, B_MATPRV, "Z", 708, 50-20*b, 24, 18, cp, 6.0+b, 3.0, 0, 0, ""); - } - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "ofsX", 778,115,130,19, mtex->ofs, -10.0, 10.0, 10, 0, "Fine tunes texture mapping X coordinate"); - uiDefButF(block, NUM, B_MATPRV, "ofsY", 778,95,130,19, mtex->ofs+1, -10.0, 10.0, 10, 0, "Fine tunes texture mapping Y coordinate"); - uiDefButF(block, NUM, B_MATPRV, "ofsZ", 778,75,130,19, mtex->ofs+2, -10.0, 10.0, 10, 0, "Fine tunes texture mapping Z coordinate"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "sizeX", 778,50,130,19, mtex->size, -100.0, 100.0, 10, 0, "Sets scaling for the texture's X size"); - uiDefButF(block, NUM, B_MATPRV, "sizeY", 778,30,130,19, mtex->size+1, -100.0, 100.0, 10, 0, "Sets scaling for the texture's Y size"); - uiDefButF(block, NUM, B_MATPRV, "sizeZ", 778,10,130,19, mtex->size+2, -100.0, 100.0, 10, 0, "Sets scaling for the texture's Z size"); - uiBlockEndAlign(block); - -} - - -static void material_panel_texture(Object *ob, Material *ma) -{ - uiBlock *block; - uiBut *but; - MTex *mtex; - ID *id; - ParticleSystem *psys; - int loos, psys_mapto=0; - int a; - char str[64], *strp; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_texture", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Texture", "Material", 960, 0, 318, 204)==0) return; - uiClearButLock(); - - /*check if material is being used by particles*/ - for(psys=ob->particlesystem.first; psys; psys=psys->next) - if(psys->part->omat==ob->actcol) - psys_mapto=1; - - /* TEX CHANNELS */ - uiBlockSetCol(block, TH_BUT_NEUTRAL); - - uiBlockBeginAlign(block); - for(a= 0; amtex[a]; - if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos); - else strcpy(str, ""); - str[10]= 0; - uiDefButC(block, ROW, B_TEXCHANNEL, str, 10, 180-18*a, 70, 20, &(ma->texact), 3.0, (float)a, 0, 0, ""); - } - uiBlockEndAlign(block); - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - /* SEPTEX */ - uiBlockSetCol(block, TH_AUTO); - - for(a= 0; amtex[a]; - if(mtex && mtex->tex) { - but=uiDefIconButBitS(block, ICONTOGN, 1<septex, 0.0, 0.0, 0, 0, "Click to disable or enable this texture channel"); - - if(psys_mapto && ma->mtex[a]->mapto & MAP_PA_IVEL) - uiButSetFunc(but, particle_recalc_material, ma, NULL); - } - } - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_MTEXCOPY, ICON_COPYUP, 100,180,23,21, 0, 0, 0, 0, 0, "Copies the mapping settings to the buffer"); - uiDefIconBut(block, BUT, B_MTEXPASTE, ICON_PASTEUP, 125,180,23,21, 0, 0, 0, 0, 0, "Pastes the mapping settings from the buffer"); - uiBlockEndAlign(block); - uiBlockSetCol(block, TH_AUTO); - - mtex= ma->mtex[ ma->texact ]; - if(mtex==NULL) { - mtex= &emptytex; - default_mtex(mtex); - } - - /* TEXTUREBLOK SELECT */ - uiBlockSetCol(block, TH_BUT_SETTING2); - if(G.main->tex.first==NULL) - id= NULL; - else - id= (ID*) mtex->tex; - IDnames_to_pupstring(&strp, NULL, "ADD NEW %x32767", &(G.main->tex), id, &(G.buts->texnr)); - uiDefButS(block, MENU, B_EXTEXBROWSE, strp, 100,130,20,20, &(G.buts->texnr), 0, 0, 0, 0, "Selects an existing texture or creates new"); - MEM_freeN(strp); - - if(id) { - uiDefBut(block, TEX, B_IDNAME, "TE:", 100,150,163,20, id->name+2, 0.0, 21.0, 0, 0, "Displays name of the texture block: click to change"); - sprintf(str, "%d", id->us); - uiDefBut(block, BUT, 0, str, 196,130,21,20, 0, 0, 0, 0, 0, "Displays number of users of texture"); - uiDefIconBut(block, BUT, B_AUTOTEXNAME, ICON_AUTO, 241,130,21,20, 0, 0, 0, 0, 0, "Auto-assigns name to texture"); - if(id->lib) { - if(ma->id.lib) uiDefIconBut(block, BUT, 0, ICON_DATALIB, 219,130,21,20, 0, 0, 0, 0, 0, ""); - else uiDefIconBut(block, BUT, 0, ICON_PARLIB, 219,130,21,20, 0, 0, 0, 0, 0, ""); - } - uiBlockSetCol(block, TH_AUTO); - uiDefBut(block, BUT, B_TEXCLEAR, "Clear", 122, 130, 72, 20, 0, 0, 0, 0, 0, "Erases link to texture"); - - } - else - uiDefButS(block, TOG, B_EXTEXBROWSE, "Add New" ,100, 150, 163, 20, &(G.buts->texnr), -1.0, 32767.0, 0, 0, "Adds a new texture datablock"); - - // force no centering - uiDefBut(block, LABEL, 0, " ", 250, 10, 25, 20, 0, 0, 0, 0, 0, ""); - - uiBlockSetCol(block, TH_AUTO); -} - -static void material_panel_tramir(Material *ma) -{ - uiBlock *block; - short yco=PANEL_YMAX; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_tramir", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Shaders", "Material"); - if(uiNewPanel(curarea, block, "Mirror Transp", "Material", PANELX, PANELY, PANELW, PANELH+80)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - uiDefButBitI(block, TOG, MA_RAYMIRROR, B_MATPRV, "Ray Mirror", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "RayMir: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace"); - uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_mir), 0.0, 5.0, 10, 2, "Power of Fresnel for mirror reflection"); - uiDefButF(block, NUMSLI, B_MATPRV, "Fac: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_mir_i), 1.0, 5.0, 10, 2, "Blending factor for Fresnel"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Gloss: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->gloss_mir), 0.0, 1.0, 100, 0, "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections "); - uiDefButF(block, NUMSLI, B_MATPRV, "Aniso: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->aniso_gloss_mir), 0.0, 1.0, 100, 0, "The shape of the reflection, from 0. (circular) to 1.0 (fully stretched along the tangent)"); - uiDefButS(block, NUM, B_MATPRV, "Samples:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_mir), 1.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry reflections"); - uiDefButF(block, NUM, B_MATPRV, "Thresh: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->adapt_thresh_mir), 0.0, 1.0, 100, 0, "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped"); - uiBlockEndAlign(block); - - yco -= YSPACE; - uiDefButS(block, NUM, B_MATPRV, "Depth:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->ray_depth), 0.0, 10.0, 100, 0, "Maximum allowed number of light inter-reflections"); - - yco -= YSPACE; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "Max Dist:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->dist_mir), 0.0, 100.0, 100, 0, "Maximum distance of reflected rays. Reflections further than this range fade to sky color"); - uiDefButS(block, MENU, B_MATPRV, "Ray end fade-out: %t|Fade to Sky Color %x0|Fade to Material Color %x1", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->fadeto_mir), 0, 0, 0, 0, "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor."); - uiBlockEndAlign(block); - - yco=PANEL_YMAX; - - uiDefButBitI(block, TOG, MA_RAYTRANSP, B_MATRAYTRANSP,"Ray Transp", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparent refraction rendering"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "IOR: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->ang), 1.0, 3.0, 100, 2, "Sets angular index of refraction for raytraced refraction"); - uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_tra), 0.0, 5.0, 10, 2, "Power of Fresnel for mirror reflection"); - uiDefButF(block, NUMSLI, B_MATPRV, "Fac: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->fresnel_tra_i), 1.0, 5.0, 10, 2, "Blending factor for Fresnel"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Gloss: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->gloss_tra), 0.0, 1.0, 100, 0, "The clarity of the refraction. Values < 1.0 give diffuse, blurry reflections "); - uiDefButS(block, NUM, B_MATPRV, "Samples:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->samp_gloss_tra), 0.0, 1024.0, 100, 0, "Number of cone samples averaged for blurry refractions"); - uiDefButF(block, NUM, B_MATPRV, "Thresh: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->adapt_thresh_tra), 0.0, 1.0, 100, 0, "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiDefButS(block, NUM, B_MATPRV, "Depth:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->ray_depth_tra), 0.0, 10.0, 100, 0, "Maximum allowed number of light inter-refractions"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "Filter:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->filter), 0.0, 1.0, 10, 0, "Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption)"); - uiDefButF(block, NUMSLI, B_MATPRV, "Limit: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->tx_limit), 0.0, 100.0, 10, 2, "Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled)"); - uiDefButF(block, NUMSLI, B_MATPRV, "Falloff: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->tx_falloff), 0.1, 10.0, 10, 2, "Falloff power for transmissivity filter effect (1.0 is linear)"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->spectra), 0.0, 1.0, 0, 0, "Makes specular areas opaque on transparent materials"); -} - -/* yafray: adapted version of Blender's tramir panel. - * Only removed the buttons not needed, so only the ones that are important for yafray are left. - * Also re-arranged buttons for more room for extra parameters. - * With the exception of the material preset menu and the new parameters, - * most of blender's parameters are re-used without interfering with them. - */ -static void material_panel_tramir_yafray(Material *ma) -{ - uiBlock *block; - char *mstr = "Material presets %t|No Reflect/Transmit %x0|Clear Glass %x1|Color Glass %x2|Uniform Reflect %x3|Fresnel Reflect %x4"; - - /* better to use same name as original panel */ - block= uiNewBlock(&curarea->uiblocks, "material_panel_tramir", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Shaders", "Material"); - if(uiNewPanel(curarea, block, "Mirror Transp", "Material", 640, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - /* material preset menu */ - uiDefBut(block, LABEL, 0, "Mat.Preset", 20, 182, 100, 20, 0, 0.0, 0.0, 0, 0, ""); - uiDefButI(block, MENU, B_MAT_YF_PRESET, mstr, 110, 182, 200, 20, &ma->YF_preset, 0.0, 0.0, 0, 0, "Basic material presets to start with"); - - uiDefButBitI(block, TOG, MA_RAYMIRROR, B_MATPRV,"Ray Mirror", 10,160,100,20, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for mirror reflection rendering"); - uiDefButBitI(block, TOG, MA_RAYTRANSP, B_MATRAYTRANSP,"Ray Transp", 110,160,100,20, &(ma->mode), 0, 0, 0, 0, "Enables raytracing for transparency rendering"); - uiDefButBitI(block, TOG, MA_ZTRA, B_MATZTRANSP,"ZTransp", 210,160,100,20, &(ma->mode), 0, 0, 0, 0, "Use for objects with alphamap textures"); - - uiDefButF(block, NUMSLI, B_MATPRV, "rayMir ", 10,140,150,20, &(ma->ray_mirror), 0.0, 1.0, 100, 2, "Sets the amount mirror reflection for raytrace"); - uiDefButF(block, NUMSLI, B_MATPRV, "frsOfs ", 160,140,150,20, &(ma->fresnel_mir_i), 1.0, 5.0, 10, 2, "Fresnel offset, 1 is uniform mirror, 5 is fresnel mirror (IOR>1)"); - - /* ior has extended range up to 30, for use with total fresnel reflection */ - uiDefButF(block, NUMSLI, B_MATPRV, "IOR ", 10,115,150,20, &(ma->ang), 1.0, 30.0, 100, 2, "Sets the angular index of refraction for raytrace"); - - // parameters only used in ray_transp mode - if(ma->mode & MA_RAYTRANSP) { - // Filter - uiDefButF(block, NUM, B_MATPRV, "Filt:", 160,115,150,20, &(ma->filter), 0.0, 1.0, 10, 0, "Amount of filtering for transparent raytrace"); - - /* absorption color */ - uiDefBut(block, LABEL, 0, "Absorption Color", 10, 98, 150, 18, 0, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, COL, B_MATPRV, "", 10, 38, 30, 58, &ma->YF_ar, 0, 0, 0, B_MATCOL, "transmit absorption color, white is no absorption"); - uiDefButF(block, NUMSLI, B_MATPRV, "aR ", 40, 78, 120, 18, &ma->YF_ar, 1e-7f, 1.0, B_MATCOL, 0, ""); - uiDefButF(block, NUMSLI, B_MATPRV, "aG ", 40, 58, 120, 18, &ma->YF_ag, 1e-7f, 1.0, B_MATCOL, 0, ""); - uiDefButF(block, NUMSLI, B_MATPRV, "aB ", 40, 38, 120, 18, &ma->YF_ab, 1e-7f, 1.0, B_MATCOL, 0, ""); - uiDefButF(block, NUM, B_MATPRV, "Ds", 10, 18, 150, 18, &ma->YF_dscale, 1e-7f, 100.0, 10.0, 0, "absorption distance scale, 1 is one blender (world) unit of distance"); - - /* disperions parameters */ - uiDefBut(block, LABEL, 0, "Dispersion", 160, 98, 150, 18, 0, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, NUM, B_MATPRV, "Pwr ", 160, 78, 150, 18, &ma->YF_dpwr, 0.0, 1.0, 0.25, 0, "Dispersion power, the higher, the more dispersion, 0 is no dispersion"); - uiDefButI(block, NUM, B_MATPRV, "Samples ", 160, 58, 150, 18, &ma->YF_dsmp, 1.0, 100.0, 0, 0, "Dispersion samples, minimum at least 10, unless using jitter "); - uiDefButBitI(block, TOG, 1, B_MATPRV, "Jitter", 160, 38, 150, 18, &ma->YF_djit, 0.0, 1.0, 0, 0, "Enable jittering of wavelenghts, adds noise"); - } - -} - -static void material_sss_preset_cb(void *material_v, void *unused_v) -{ - static const float presets[11][7] = { - {0.909578, 0.905931, 0.665691, 6.961082, 6.400181, 1.895899, 1.300000}, - {0.429632, 0.210025, 0.167767, 11.605177, 3.883766, 1.754386, 1.300000}, - {0.439300, 0.216000, 0.141027, 9.435642, 3.347647, 1.790287, 1.300000}, - {0.986552, 0.942637, 0.827285, 15.027623, 4.663968, 2.541380, 1.300000}, - {0.221636, 0.007505, 0.002154, 4.761743, 0.574827, 0.394116, 1.300000}, - {0.925008, 0.905025, 0.884275, 8.509412, 5.566180, 3.951266, 1.500000}, - {0.855344, 0.740311, 0.291994, 14.266395, 7.227615, 2.036157, 1.300000}, - {0.889319, 0.888034, 0.795811, 18.424364, 10.443473, 3.501882, 1.300000}, - {0.573652, 0.312750, 0.174289, 3.673294, 1.366534, 0.682693, 1.300000}, - {0.748679, 0.570766, 0.467133, 4.821475, 1.693699, 1.089971, 1.300000}, - {0.947235, 0.931028, 0.851872, 10.898815, 6.575351, 2.508417, 1.300000}}; - - Material *ma= (Material*)material_v; - - if(ma->sss_preset==0) return; - - ma->sss_col[0]= presets[ma->sss_preset][0]; - ma->sss_col[1]= presets[ma->sss_preset][1]; - ma->sss_col[2]= presets[ma->sss_preset][2]; - ma->sss_radius[0]= presets[ma->sss_preset][3]; - ma->sss_radius[1]= presets[ma->sss_preset][4]; - ma->sss_radius[2]= presets[ma->sss_preset][5]; - ma->sss_ior= presets[ma->sss_preset][6]; -} - -static void material_sss_custom_set_cb(void *material_v, void *unused_v) -{ - Material *ma= (Material*)material_v; - - ma->sss_preset= 0; - allqueue(REDRAWNODE, 0); -} - -static void material_panel_sss(Material *ma) -{ - uiBlock *block; - uiBut *bt; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_sss", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Mirror Transp", "Material"); - if(uiNewPanel(curarea, block, "SSS", "Material", 640, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - uiDefButBitS(block, TOG, MA_DIFF_SSS, B_MATPRV,"Subsurface Scattering",10,180,180,20, &(ma->sss_flag), 0, 0, 0, 0, "Enables diffuse subsurface scattering"); - - bt=uiDefButS(block, MENU, B_MATPRV, "Apple %x1|Chicken %x2|Cream %x3|Ketchup %x4|Marble %x5|Potato %x6|Skim Milk %x7|Skin 1 %x8|Skin 2 %x9|Whole Milk %x10|Custom %x0", - 200,180,110,20, &ma->sss_preset, 0, 0, 0, 0, ""); - uiButSetFunc(bt, material_sss_preset_cb, ma, NULL); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "Scale:", 10,150,145,20, - &ma->sss_scale, 0.001, 1000, 1, 3, "Object scale"); - bt=uiDefButF(block, NUM, B_MATPRV, "Radius R", 10,130,145,20, - &ma->sss_radius[0], 0.0001, 10000, 1, 3, - "Mean red scattering path length"); - uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL); - bt=uiDefButF(block, NUM, B_MATPRV, "Radius G", 10,110,145,20, - &ma->sss_radius[1], 0.0001, 10000, 1, 3, - "Mean green scattering path length"); - uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL); - bt=uiDefButF(block, NUM, B_MATPRV, "Radius B", 10,90,145,20, - &ma->sss_radius[2], 0.0001, 10000, 1, 3, - "Mean blue scattering path length"); - uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL); - uiBlockEndAlign(block); - - bt=uiDefButF(block, NUM, B_MATPRV, "IOR:", 10,60,145,20, - &ma->sss_ior, 0.1, 2, 1, 3, "Index of refraction (higher values are denser)"); - uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "Error:", 10,30,145,20, - &ma->sss_error, 0.0001, 10, 1, 3, "Error tolerance (low values are slower and higher quality)"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - bt=uiDefButF(block, COL, B_MATPRV, "", 165,150,145,20, - &ma->sss_col[0], 0.0, 1.0, 0, 0, - "Scattering color"); - uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL); - uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 165,130,145,20, - &ma->sss_colfac, 0.0, 1.0, 0, 0, - "Blend factor for SSS colors"); - uiDefButF(block, NUMSLI, B_MATPRV, "Tex ", 165,110,145,20, - &ma->sss_texfac, 0.0, 1.0, 0, 0, - "Texture scattering factor"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Front ", 165,80,145,20, - &ma->sss_front, 0.0, 2.0, 0, 0, - "Front scattering weight"); - uiDefButF(block, NUMSLI, B_MATPRV, "Back ", 165,60,145,20, - &ma->sss_back, 0.0, 10.0, 0, 0, - "Back scattering weight"); - uiBlockEndAlign(block); -} - -static void material_panel_shading(Material *ma) -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_shading", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Shaders", "Material", 640, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - if(ma->mode & MA_HALO) { - uiDefButF(block, NUM, B_MATPRV, "HaloSize: ", 10,155,190,18, &(ma->hasize), 0.0, 100.0, 10, 3, "Sets the dimension of the halo"); - uiDefButS(block, NUMSLI, B_MATPRV, "Hard ", 10,135,190,18, &(ma->har), 1.0, 127.0, 0, 0, "Sets the hardness of the halo"); - uiDefButF(block, NUMSLI, B_MATPRV, "Add ", 10,115,190,18, &(ma->add), 0.0, 1.0, 0, 0, "Sets the strength of the add effect"); - - uiDefButS(block, NUM, B_MATPRV, "Rings: ", 10,90,90,18, &(ma->ringc), 0.0, 24.0, 0, 0, "Sets the number of rings rendered over the halo"); - uiDefButS(block, NUM, B_MATPRV, "Lines: ", 100,90,100,18, &(ma->linec), 0.0, 250.0, 0, 0, "Sets the number of star shaped lines rendered over the halo"); - uiDefButS(block, NUM, B_MATPRV, "Star: ", 10,70,90,18, &(ma->starc), 3.0, 50.0, 0, 0, "Sets the number of points on the star shaped halo"); - uiDefButC(block, NUM, B_MATPRV, "Seed: ", 100,70,100,18, &(ma->seed1), 0.0, 255.0, 0, 0, "Randomizes ring dimension and line location"); - if(ma->mode & MA_HALO_FLARE) { - uiDefButF(block, NUM, B_MATPRV, "FlareSize: ", 10,50,95,18, &(ma->flaresize), 0.1, 25.0, 10, 3, "Sets the factor by which the flare is larger than the halo"); - uiDefButF(block, NUM, B_MATPRV, "Sub Size: ", 100,50,100,18, &(ma->subsize), 0.1, 25.0, 10, 3, "Sets the dimension of the subflares, dots and circles"); - uiDefButF(block, NUMSLI, B_MATPRV, "Boost: ", 10,30,190,18, &(ma->flareboost), 0.1, 10.0, 10, 3, "Gives the flare extra strength"); - uiDefButC(block, NUM, B_MATPRV, "Fl.seed: ", 10,10,90,18, &(ma->seed2), 0.0, 255.0, 0, 0, "Specifies an offset in the flare seed table"); - uiDefButS(block, NUM, B_MATPRV, "Flares: ", 100,10,100,18, &(ma->flarec), 1.0, 32.0, 0, 0, "Sets the number of subflares"); - } - uiBlockSetCol(block, TH_BUT_SETTING1); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_HALO_FLARE, B_MATPRV, "Flare",245,142,65,28, &(ma->mode), 0, 0, 0, 0, "Renders halo as a lensflare"); - uiDefButBitI(block, TOG, MA_HALO_RINGS, B_MATPRV, "Rings", 245,123,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders rings over halo"); - uiDefButBitI(block, TOG, MA_HALO_LINES, B_MATPRV, "Lines", 245,104,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders star shaped lines over halo"); - uiDefButBitI(block, TOG, MA_STAR, B_MATPRV, "Star", 245,85,65, 18, &(ma->mode), 0, 0, 0, 0, "Renders halo as a star"); - uiDefButBitI(block, TOG, MA_HALOTEX, B_MATPRV, "HaloTex", 245,66,65, 18, &(ma->mode), 0, 0, 0, 0, "Gives halo a texture"); - uiDefButBitI(block, TOG, MA_HALOPUNO, B_MATPRV, "HaloPuno", 245,47,65, 18, &(ma->mode), 0, 0, 0, 0, "Uses the vertex normal to specify the dimension of the halo"); - uiDefButBitI(block, TOG, MA_HALO_XALPHA, B_MATPRV, "X Alpha", 245,28,65, 18, &(ma->mode), 0, 0, 0, 0, "Uses extreme alpha"); - uiDefButBitI(block, TOG, MA_HALO_SHADE, B_MATPRV, "Shaded", 245,9,65, 18, &(ma->mode), 0, 0, 0, 0, "Lets halo receive light and shadows"); - uiBlockEndAlign(block); - } - else { - char *str1= "Diffuse Shader%t|Lambert %x0|Oren-Nayar %x1|Toon %x2|Minnaert %x3|Fresnel %x4"; - char *str2= "Specular Shader%t|CookTorr %x0|Phong %x1|Blinn %x2|Toon %x3|WardIso %x4"; - - /* diff shader buttons */ - uiDefButS(block, MENU, B_MATPRV, str1, 9, 180,78,19, &(ma->diff_shader), 0.0, 0.0, 0, 0, "Creates a diffuse shader"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Ref ", 90,180,150,19, &(ma->ref), 0.0, 1.0, 0, 0, "Sets the amount of reflection"); - if(ma->diff_shader==MA_DIFF_ORENNAYAR) - uiDefButF(block, NUMSLI, B_MATPRV, "Rough:",90,160, 150,19, &(ma->roughness), 0.0, 3.14, 0, 0, "Sets Oren Nayar Roughness"); - else if(ma->diff_shader==MA_DIFF_TOON) { - uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 160,150,19, &(ma->param[0]), 0.0, 3.14, 0, 0, "Sets size of diffuse toon area"); - uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90,140,150,19, &(ma->param[1]), 0.0, 1.0, 0, 0, "Sets smoothness of diffuse toon area"); - } - else if(ma->diff_shader==MA_DIFF_MINNAERT) - uiDefButF(block, NUMSLI, B_MATPRV, "Dark:",90,160, 150,19, &(ma->darkness), 0.0, 2.0, 0, 0, "Sets Minnaert darkness"); - else if(ma->diff_shader==MA_DIFF_FRESNEL) { - uiDefButF(block, NUMSLI, B_MATPRV, "Fresnel:", 90, 160,150,19, &(ma->param[1]), 0.0, 5.0, 0, 0, "Power of Fresnel"); - uiDefButF(block, NUMSLI, B_MATPRV, "Fac:",90,140,150,19, &(ma->param[0]), 1.0, 5.0, 0, 0, "Blending factor"); - } - uiBlockEndAlign(block); - - /* spec shader buttons */ - uiDefButS(block, MENU, B_MATPRV, str2, 9,120,77,19, &(ma->spec_shader), 0.0, 0.0, 0, 0, "Creates a specular shader"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Spec ", 90,120,150,19, &(ma->spec), 0.0, 2.0, 0, 0, "Sets the degree of specularity"); - if ELEM3(ma->spec_shader, MA_SPEC_COOKTORR, MA_SPEC_PHONG, MA_SPEC_BLINN) { - uiDefButS(block, NUMSLI, B_MATPRV, "Hard:", 90, 100, 150,19, &(ma->har), 1.0, 511, 0, 0, "Sets the hardness of the specularity"); - } - if(ma->spec_shader==MA_SPEC_BLINN) - uiDefButF(block, NUMSLI, B_MATPRV, "Refr:", 90, 80,150,19, &(ma->refrac), 1.0, 10.0, 0, 0, "Sets the material's Index of Refraction"); - if(ma->spec_shader==MA_SPEC_TOON) { - uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 100,150,19, &(ma->param[2]), 0.0, 1.53, 0, 0, "Sets the size of specular toon area"); - uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90, 80,150,19, &(ma->param[3]), 0.0, 1.0, 0, 0, "Sets the smoothness of specular toon area"); - } - if(ma->spec_shader==MA_SPEC_WARDISO) - uiDefButF(block, NUMSLI, B_MATPRV, "rms:", 90, 100,150,19, &(ma->rms), 0.0, 0.4, 0, 0, "Sets the standard deviation of surface slope"); - /* default shading variables */ - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Tralu ", 9,30,150,19, &(ma->translucency), 0.0, 1.0, 100, 2, "Translucency, amount of diffuse shading of the back side"); - uiDefButF(block, NUMSLI, B_MATPRV, "SBias ", 159,30,151,19, &(ma->sbias), 0.0, 0.25, 10, 2, "Shadow bias, to prevent terminator problems on shadow boundary"); - uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,10,150,19, &(ma->amb), 0.0, 1.0, 0, 0, "Sets the amount of global ambient color the material receives"); - uiDefButF(block, NUMSLI, B_MATPRV, "Emit ", 159,10,151,19, &(ma->emit), 0.0, 2.0, 0, 0, "Sets the amount of light the material emits"); - uiBlockEndAlign(block); - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitI(block, TOG, MA_TANGENT_V, B_MATPRV, "Tangent V", 245,180,65,19, &(ma->mode), 0, 0, 0, 0, "Use the tangent vector in V direction for shading"); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_SHADOW, B_MATPRV, "Shadow", 245,140,65,19, &(ma->mode), 0, 0, 0, 0, "Makes material receive shadows"); - uiDefButBitI(block, TOG, MA_SHADOW_TRA, B_MATPRV, "TraShadow", 245,120,65,19, &(ma->mode), 0, 0, 0, 0, "Receives transparent shadows based at material color and alpha"); - uiDefButBitI(block, TOG, MA_ONLYSHADOW, B_MATPRV, "OnlyShad", 245,100,65,20, &(ma->mode), 0, 0, 0, 0, "Renders shadows on material as Alpha value"); - uiDefButBitI(block, TOG, MA_RAYBIAS, B_MATPRV, "Bias", 245,80,65,19, &(ma->mode), 0, 0, 0, 0, "Prevents ray traced shadow errors with phong interpolated normals (terminator problem)"); - - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_MATPRV, "GR:", 9, 55, 150, 19, &ma->group, "Limit Lighting to Lamps in this Group"); - uiDefButBitI(block, TOG, MA_GROUP_NOLAY, B_MATPRV, "Exclusive", 159,55, 85,20, &(ma->mode), 0, 0, 0, 0, "The material exclusively uses Lamps in this Group"); - } -} - -static void material_panel_ramps(Material *ma) -{ - uiBlock *block; - ColorBand *coba; - float *facp; - char *inputc, *methodc; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_ramps", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Material", "Material"); - if(uiNewPanel(curarea, block, "Ramps", "Material", 640, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButS(block, ROW, B_REDR, "Show Col Ramp",10,180,150,20, &ma->ramp_show, 0, 0, 0, 0, "Show ramp buttons for material diffuse color"); - uiDefButS(block, ROW, B_REDR, "Show Spec Ramp",160,180,150,20, &ma->ramp_show, 0, 1, 0, 0, "Show ramp buttons for material specular color"); - uiBlockSetCol(block, TH_AUTO); - - /* COLORBAND */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, ma->ramp_show?MA_RAMP_SPEC:MA_RAMP_COL, B_MATCOLORBAND, "Colorband",10,145,80,20, &ma->mode, 0, 0, 0, 0, "Toggles colorband ramp operations"); - - if(ma->mode & (ma->ramp_show?MA_RAMP_SPEC:MA_RAMP_COL)) { - if(ma->ramp_show==0) { - coba= ma->ramp_col; - inputc= &ma->rampin_col; - methodc= &ma->rampblend_col; - facp= &ma->rampfac_col; - } - else { - coba= ma->ramp_spec; - inputc= &ma->rampin_spec; - methodc= &ma->rampblend_spec; - facp= &ma->rampfac_spec; - } - draw_colorband_buts(block, coba, 10, 50, B_MATPRV); // aligns with previous button - - uiDefBut(block, LABEL, 0, "Input",10,30,90,20, NULL, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Method",100,30,90,20, NULL, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Factor",190,30,120,20, NULL, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButC(block, MENU, B_MATPRV, "Shader %x0|Energy %x1|Normal %x2|Result %x3",10,10,90,20, inputc, 0, 0, 0, 0, "Input for Ramp"); - uiDefButC(block, MENU, B_MATPRV, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Overlay %x9|Divide %x5|Difference %x6|Darken %x7|Lighten %x8|Dodge %x10|Burn %x11|Color %x15|Value %x14|Saturation %x13|Hue %x12",110,10,90,20, methodc, 0, 0, 0, 0, "Blending method for Ramp (uses alpha in Colorband)"); - uiDefButF(block, NUMSLI, B_MATPRV, "", 190,10,120,20, facp, 0.0, 1.0, 100, 0, "Blending factor (also uses alpha in Colorband)"); - } -} - -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *strand_menu(void *mat_v) -{ - Material *ma= mat_v; - uiBlock *block; - int buth=20, butw=230, butx=10, buty=160; - - block= uiNewBlock(&curarea->uiblocks, "strand menu", UI_EMBOSS, UI_HELV, curarea->win); - - if(ma->mode & MA_STR_B_UNITS) - buty += buth; - - /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", 0, 0, butw+20, buty+10, NULL, 0, 0, 0, 0, ""); - /* event return 0, to prevent menu to close */ - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_TANGENT_STR, 0, "Use Tangent Shading", butx,buty-=buth,butw,buth, &(ma->mode), 0, 0, 0, 0, "Uses direction of strands as normal for tangent-shading"); - uiDefButBitI(block, TOG, MA_STR_SURFDIFF, 0, "Surface Diffuse", butx,buty-=buth,butw/2,buth, &(ma->mode), 0, 0, 0, 0, "Make diffuse shading more similar to shading the surface"); - uiDefButF(block, NUM, 0, "Dist", butx+butw/2,buty,butw/2,buth, &ma->strand_surfnor, 0.0f, 10.0f, 2, 0, "Distance in Blender units over which to blend in the surface normal"); - - buty -= 5; - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_STR_B_UNITS, 0, "Use Blender Units", butx,buty-=buth,butw,buth, &(ma->mode), 0, 0, 0, 0, "Use actual Blender units for widths instead of pixels"); - if(ma->mode & MA_STR_B_UNITS){ - uiDefButF(block, NUMSLI, 0, "Start ", butx,buty-=buth, butw,buth, &ma->strand_sta, 0.0001, 2.0, 2, 0, "Start size of strands in Blender units"); - uiDefButF(block, NUMSLI, 0, "End ", butx,buty-=buth, butw,buth, &ma->strand_end, 0.0001, 1.0, 2, 0, "End size of strands in Blender units"); - uiDefButF(block, NUMSLI, 0, "Minimum ", butx,buty-=buth, butw,buth, &ma->strand_min, 0.001, 10.0, 0, 0, "Minimum size of strands in pixels"); - } - else{ - uiDefButF(block, NUMSLI, 0, "Start ", butx,buty-=buth, butw,buth, &ma->strand_sta, 0.25, 20.0, 2, 0, "Start size of strands in pixels"); - uiDefButF(block, NUMSLI, 0, "End ", butx,buty-=buth, butw,buth, &ma->strand_end, 0.25, 10.0, 2, 0, "End size of strands in pixels"); - } - uiDefButF(block, NUMSLI, 0, "Shape ", butx,buty-=buth, butw,buth, &ma->strand_ease, -0.9, 0.9, 2, 0, "Shape of strands, positive value makes it rounder, negative makes it spiky"); - uiDefBut(block, TEX, B_MATPRV, "UV:", butx,buty-=buth,butw,buth, ma->strand_uvname, 0, 31, 0, 0, "Set name of UV layer to override"); - - uiBlockSetDirection(block, UI_TOP); - BIF_preview_changed(ID_MA); - return block; -} - - -static void material_panel_material(Material *ma) -{ - uiBlock *block; - float *colpoin = NULL; - int rgbsel = 0; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_material", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Material", "Material", 320, 0, 318, 204)==0) return; - - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_MATCOPY, ICON_COPYUP, 262,200,XIC,YIC, 0, 0, 0, 0, 0, "Copies Material to the buffer"); - uiDefIconBut(block, BUT, B_MATPASTE, ICON_PASTEUP, 283,200,XIC,YIC, 0, 0, 0, 0, 0, "Pastes Material from the buffer"); - uiBlockEndAlign(block); - if(ma->dynamode & MA_DRAW_DYNABUTS) { - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_DIFF, "Restitut ", 128,120,175,20, &ma->reflect, 0.0, 1.0, 0, 0, "Elasticity of collisions"); - uiDefButF(block, NUMSLI, B_DIFF, "Friction ", 128,100 ,175,20, &ma->friction, 0.0, 100.0, 0, 0, "Coulomb friction coefficient"); - uiDefButF(block, NUMSLI, B_DIFF, "Fh Force ", 128,80 ,175,20, &ma->fh, 0.0, 1.0, 0, 0, "Upward spring force within the Fh area"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NOP, "Fh Damp ", 8,120,100,20, &ma->xyfrict, 0.0, 1.0, 10, 0, "Damping of the Fh spring force"); - uiDefButF(block, NUM, B_NOP, "Fh Dist ", 8,100 ,100,20, &ma->fhdist, 0.0, 20.0, 10, 0, "Height of the Fh area"); - uiDefButBitS(block, TOG, MA_FH_NOR, 0, "Fh Norm", 8,80 ,100,20, &ma->dynamode, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes"); - } - else { - if(!(ma->mode & MA_HALO)) { - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); - uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colors as extra light"); - uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colors with vertex colors"); - uiDefButBitI(block, TOG, MA_FACETEXTURE, B_REDR, "TexFace", 156,166,64,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces"); - if (ma->mode & MA_FACETEXTURE) uiDefButBitI(block, TOG, MA_FACETEXTURE_ALPHA, B_REDR, "A", 220,166,20,20, &(ma->mode), 0, 0, 0, 0, "Use alpha channel in 'TexFace' assigned images"); - uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 240,166,63,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow"); - - uiDefButBitI(block, TOG, MA_NOMIST, B_NOP, "No Mist", 8,146,74,20, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values"); - uiDefButBitI(block, TOG, MA_ENV, B_MATPRV, "Env", 82,146,74,20, &(ma->mode), 0, 0, 0, 0, "Causes faces to render with alpha zero: allows sky/backdrop to show through (only for solid faces)"); - uiDefButF(block, NUM, B_NOP, "Shad A ", 156,146,147,19, &ma->shad_alpha, 0.001, 1.0f, 100, 0, "Shadow casting alpha, only in use for Irregular Shadowbuffer"); - } - uiBlockSetCol(block, TH_AUTO); - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_MATPRV, "", 8,97,72,20, &(ma->r), 0, 0, 0, B_MATCOL, ""); - uiDefButF(block, COL, B_MATPRV, "", 8,77,72,20, &(ma->specr), 0, 0, 0, B_SPECCOL, ""); - uiDefButF(block, COL, B_MATPRV, "", 8,57,72,20, &(ma->mirr), 0, 0, 0, B_MIRCOL, ""); - - uiBlockBeginAlign(block); - if(ma->mode & MA_HALO) { - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the color of the halo with the RGB sliders"); - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the color of the lines with the RGB sliders"); - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the color of the rings with the RGB sliders"); - } - else { - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the diffuse color of the material"); - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular color of the material"); - uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror color of the material"); - } - - if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;} - else if(ma->rgbsel==1) {colpoin= &(ma->specr); rgbsel= B_SPECCOL;} - else if(ma->rgbsel==2) {colpoin= &(ma->mirr); rgbsel= B_MIRCOL;} - - if(ma->rgbsel==0 && (ma->mode & (MA_VERTEXCOLP|MA_FACETEXTURE) && !(ma->mode & MA_HALO))); - else if(ma->colormodel==MA_HSV) { - uiBlockSetCol(block, TH_BUT_SETTING1); - uiBlockBeginAlign(block); - uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,97,175,19, colpoin, 0.0, 0.9999, rgbsel, 0, ""); - uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,77,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, ""); - uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,57,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, ""); - uiBlockSetCol(block, TH_AUTO); - } - else { - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,97,175,19, colpoin, 0.0, 1.0, rgbsel, 0, ""); - uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,77,175,19, colpoin+1, 0.0, 1.0, rgbsel, 0, ""); - uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,57,175,19, colpoin+2, 0.0, 1.0, rgbsel, 0, ""); - } - uiBlockEndAlign(block); - if (ma->mode & (MA_FACETEXTURE) && ma->mode & (MA_FACETEXTURE_ALPHA)) ; - else uiDefButF(block, NUMSLI, B_MATPRV, "A ", 128,30,175,19, &ma->alpha, 0.0, 1.0, 0, 0, "Alpha"); - - } - uiBlockBeginAlign(block); - uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,30,38,19, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates color using red, green and blue"); - uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 46,30,38,19, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates color using hue, saturation and value"); - uiDefButBitS(block, TOG, MA_DRAW_DYNABUTS, REDRAWBUTSSHADING, "DYN", 84,30,39,19, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options"); - -} - -static void material_panel_nodes(Material *ma) -{ - bNode *node; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_nodes", UI_EMBOSS, UI_HELV, curarea->win); - uiNewPanelTabbed("Links and Pipeline", "Material"); - if(uiNewPanel(curarea, block, "Nodes", "Material", 640, 0, 318, 204)==0) return; - - node= editnode_get_active(ma->nodetree); - if(node==NULL) return; - /* we dont display the buttons here for the active material, is in links panel */ - if(node==editnode_get_active_idnode(ma->nodetree, ID_MA)) return; - - if(node->typeinfo->butfunc) { - /* we use butfunc to retrieve height for the butrect, but node->width is - used to calculate that too. Could be done smarter once */ - rctf rct; - rct.xmin= 10.0f; - rct.xmax= rct.xmin+node->width-NODE_DY; - rct.ymax= 155.0; - rct.ymin= rct.ymax - (float)node->typeinfo->butfunc(NULL, NULL, node, NULL); - node->typeinfo->butfunc(block, ma->nodetree, node, &rct); - } -} - -static void material_panel_links(Object *ob, Material *ma) -{ - uiBlock *block; - uiBut *but; - ID *id, *idn, *idfrom; - bNode *node=NULL; - float min; - short xco; - char str[30]; - - block= uiNewBlock(&curarea->uiblocks, "material_panel_links", UI_EMBOSS, UI_HELV, curarea->win); - /* 310 makes sorting code to put it right after preview panel */ - if(uiNewPanel(curarea, block, "Links and Pipeline", "Material", 310, 0, 318, 204)==0) return; - - /* Links from object to material/nodes */ - uiDefBut(block, ROUNDBOX, 0, "", 5, 90, 310, 110, NULL, 7.0, 0.0, 15 , 20, ""); - uiDefBut(block, LABEL, B_DIFF, "Link to Object", 10, 180, 300, 20, 0, 0, 0, 0, 0, ""); - - /* the main material browse but */ - buttons_active_id(&id, &idfrom); /* base material! */ - - uiBlockSetCol(block, TH_BUT_SETTING2); - xco= std_libbuttons(block, 10, 160, 0, NULL, B_MATBROWSE, ID_MA, 0, id, idfrom, &(G.buts->menunr), B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA); - - if(ma) uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - if(ma) - uiDefButC(block, TOG, B_MAT_USENODES, "Nodes", xco+5,160,300-xco-5,20, &ma->use_nodes, 0.0f, 0.0f, 0, 0, ""); - - if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */ - - uiBlockBeginAlign(block); - - /* id is the block from which the material is used */ - if( BTST(ob->colbits, ob->actcol-1) ) id= (ID *)ob; - else id= ob->data; - - /* indicate which one is linking a material */ - if(id) { - if(id->lib) - uiSetButLock(1, ERROR_LIBDATA_MESSAGE); - else - uiClearButLock(); - - strncpy(str, id->name, 2); - str[2]= ':'; str[3]= 0; - but= uiDefBut(block, TEX, B_IDNAME, str, 10,135,115,20, id->name+2, 0.0, 21.0, 0, 0, "Shows the block the material is linked to"); - uiButSetFunc(but, test_idbutton_cb, id->name, NULL); - } - - uiBlockSetCol(block, TH_BUT_ACTION); - uiDefButBitS(block, TOG, 1<<(ob->actcol-1), B_MATFROM, "OB", 125,135,32,20, &ob->colbits, 0, 0, 0, 0, "Links material to object"); - idn= ob->data; - strncpy(str, idn->name, 2); - str[2]= 0; - uiBlockSetCol(block, TH_BUT_SETTING); - uiDefButBitS(block, TOGN, 1<<(ob->actcol-1), B_MATFROM, str, 158,135,32,20, &ob->colbits, 0, 0, 0, 0, "Shows the block the material is linked to"); - uiBlockSetCol(block, TH_AUTO); - - sprintf(str, "%d Mat", ob->totcol); - if(ob->totcol) min= 1.0; else min= 0.0; - uiDefButC(block, NUM, B_ACTCOL, str, 190,135,110,20, &(ob->actcol), min, (float)ob->totcol, 0, 0, "Shows the number of materials on object and the active material"); - uiBlockEndAlign(block); - - if(ma==NULL) return; - uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); - - /* Active material node */ - if(ma->use_nodes) { - uiDefBut(block, LABEL, B_DIFF, "Active Material Node", 10, 115, 300, 20, 0, 0, 0, 0, 0, ""); - - if(ma) node= editnode_get_active_idnode(ma->nodetree, ID_MA); - if(node==NULL) { - node= editnode_get_active(ma->nodetree); - if(node && node->type!=SH_NODE_MATERIAL) - node= NULL; - } - if(node) { - rctf rct; - rct.xmin= 10.0f; - rct.xmax= 300.0f; - rct.ymax= 114.0f; - rct.ymin= 95.0f; - node->typeinfo->butfunc(block, ma->nodetree, node, &rct); - } - } - - /* main render pipeline settings */ - uiDefBut(block, LABEL, B_DIFF, "Render Pipeline", 10, 70, 300, 20, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, MA_HALO, B_MATHALO, "Halo", 10,50,100,19, &(ma->mode), 0, 0, 0, 0, "Renders material as a halo"); - uiDefButBitI(block, TOG, MA_ZTRA, B_MATZTRANSP,"ZTransp", 110,50,100,19, &(ma->mode), 0, 0, 0, 0, "Enables Z-Buffering of transparent faces"); - uiDefButF(block, NUM, B_DIFF, "Zoffs:", 210,50,100,19, &(ma->zoffs), 0.0, 100.0, 100, 0, "Gives faces an artificial offset in the Z buffer for Ztransp option"); - - uiDefButBitI(block, TOG, MA_FULL_OSA, 0, "Full Osa", 10,30,75,19, &(ma->mode), 0.0, 10.0, 0, 0, "Forces to render all OSA samples, for shading and texture antialiasing"); - uiDefButBitI(block, TOG, MA_WIRE, B_MATPRV, "Wire", 85,30,75,19, &(ma->mode), 0, 0, 0, 0, "Renders only the edges of faces as a wireframe"); - uiDefBlockBut(block, strand_menu, ma, "Strands", 160,30,75, 19, "Display strand settings for static particles"); - uiDefButBitI(block, TOG, MA_ZINV, B_MATPRV, "ZInvert", 236,30,75,19, &(ma->mode), 0, 0, 0, 0, "Renders material's faces with inverted Z Buffer"); - - uiDefButBitI(block, TOG, MA_RADIO, B_NOP, "Radio", 10,10,75,19, &(ma->mode), 0, 0, 0, 0, "Enables radiosity rendering for material"); - uiDefButBitI(block, TOG, MA_ONLYCAST, B_MATPRV,"OnlyCast", 85,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes faces cast shadows only, not rendered"); - uiDefButBitI(block, TOG, MA_TRACEBLE, B_NOP,"Traceable", 160,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material detectable by ray tracing"); - uiDefButBitI(block, TOG, MA_SHADBUF, B_MATPRV, "Shadbuf", 235,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material cast shadows from shadow buffer lamps"); - - -} - -static void material_panel_preview(Material *ma) -{ - uiBlock *block; - - /* name "Preview" is abused to detect previewrender offset panel */ - block= uiNewBlock(&curarea->uiblocks, "material_panel_preview", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Preview", "Material", 0, 0, 318, 204)==0) return; - - if(ma) { - G.buts->lockpoin= ma; /* BIF_previewdraw callback will read it */ - - uiBlockSetDrawExtraFunc(block, BIF_previewdraw); - - // label to force a boundbox for buttons not to be centered - uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, ""); - uiBlockSetCol(block, TH_BUT_NEUTRAL); - uiBlockBeginAlign(block); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATPLANE, 210,180,25,22, &(ma->pr_type), 10, MA_FLAT, 0, 0, "Preview type: Flat XY plane"); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210,158,25,22, &(ma->pr_type), 10, MA_SPHERE, 0, 0, "Preview type: Sphere"); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATCUBE, 210,136,25,22, &(ma->pr_type), 10, MA_CUBE, 0, 0, "Preview type: Cube"); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MONKEY, 210,114,25,22, &(ma->pr_type), 10, MA_MONKEY, 0, 0, "Preview type: Monkey"); - uiDefIconButC(block, ROW, B_MATPRV, ICON_HAIR, 210, 92,25,22, &(ma->pr_type), 10, MA_HAIR, 0, 0, "Preview type: Hair strands"); - uiDefIconButC(block, ROW, B_MATPRV, ICON_MATSPHERE, 210, 70,25,22, &(ma->pr_type), 10, MA_SPHERE_A, 0, 0, "Preview type: Large sphere with sky"); - uiBlockEndAlign(block); - - uiDefIconButBitC(block, TOG, SB_PRV_OSA, B_MATPRV, ICON_RING, 210, 10,25,22, &(G.buts->flag), 0, 0, 0, 0, "Preview uses OSA (oversampling)"); - } -} - -void material_panels() -{ - Material *ma; - MTex *mtex; - Object *ob= OBACT; - - if(ob==NULL) return; - - // type numbers are ordered - if((ob->typetype) { - int from_nodes= 0; - - ma= give_current_material(ob, ob->actcol); - - // always draw first 2 panels - material_panel_preview(ma); - material_panel_links(ob, ma); - - if(ma && ma->use_nodes) { - material_panel_nodes(ma); - from_nodes= 1; - } - - ma= editnode_get_active_material(ma); - if(ma) { - material_panel_material(ma); - material_panel_ramps(ma); - material_panel_shading(ma); - - if (G.scene->r.renderer==R_INTERN) - material_panel_tramir(ma); - else { - if(ma->YF_ar==0.f) { - ma->YF_ar = ma->YF_ag = ma->YF_ab = 1; - ma->YF_dscale = 1; - } - material_panel_tramir_yafray(ma); - } - - material_panel_sss(ma); - material_panel_texture(ob, ma); - - mtex= ma->mtex[ ma->texact ]; - if(mtex && mtex->tex) { - material_panel_map_input(ob, ma); - material_panel_map_to(ob, ma, from_nodes); - } - } - } -} - -void lamp_panels() -{ - Object *ob= OBACT; - Lamp *la; - - if(ob==NULL || ob->type!= OB_LAMP) return; - la= ob->data; - - lamp_panel_preview(ob, ob->data); - lamp_panel_lamp(ob, ob->data); - - if (ELEM(la->type, LA_SPOT, LA_LOCAL) && (la->falloff_type == LA_FALLOFF_CURVE)) - lamp_panel_falloff(ob, ob->data); - - /* switch to yafray lamp panel if yafray enabled */ - if (G.scene->r.renderer==R_INTERN) - lamp_panel_spot(ob, ob->data); - else { - /* init vars */ - if (la->YF_numphotons==0) la->YF_numphotons=1000; - if (la->YF_numsearch==0) la->YF_numsearch=10; - if (la->YF_phdepth==0) la->YF_phdepth=1; - if (la->YF_causticblur==0.0) la->YF_causticblur=0.001; - if (la->YF_bufsize==0) la->YF_bufsize=128; - /* spherelight radius default is zero, so nothing to do */ - lamp_panel_yafray(ob, la); - } - lamp_panel_texture(ob, ob->data); - lamp_panel_mapto(ob, ob->data); - -} - -void world_panels() -{ - World *wrld; - - wrld= G.scene->world; - - world_panel_preview(wrld); - world_panel_world(wrld); - - if(wrld) { - world_panel_mistaph(wrld); - world_panel_amb_occ(wrld); - world_panel_texture(wrld); - world_panel_mapto(wrld); - } -} - -void texture_panels() -{ - Material *ma=NULL; - Brush *br=NULL; - SculptData *sd=NULL; - Lamp *la=NULL; - World *wrld=NULL; - bNode *node=NULL; - Object *ob= OBACT; - MTex *mtex= NULL; - - if(G.buts->texfrom==0) { - if(ob) { - ma= give_current_material(ob, ob->actcol); - - if(ma && ma->use_nodes) { - node= editnode_get_active_idnode(ma->nodetree, ID_TE); - - if(node) - ma= NULL; - else { - ma= editnode_get_active_material(ma); - } - } - if(ma) mtex= ma->mtex[ ma->texact ]; - } - } - else if(G.buts->texfrom==1) { - wrld= G.scene->world; - if(wrld) mtex= wrld->mtex[ wrld->texact ]; - } - else if(G.buts->texfrom==2) { - if(ob && ob->type==OB_LAMP) { - la= ob->data; - mtex= la->mtex[ la->texact ]; - } - } - else if(G.buts->texfrom==3) { - if(G.f & G_SCULPTMODE) { - sd= &G.scene->sculptdata; - if(sd->texact != -1) - mtex= sd->mtex[sd->texact]; - } - else { - br= G.scene->toolsettings->imapaint.brush; - if(br) mtex= br->mtex[br->texact]; - } - } - - texture_panel_preview(mtex, ma || wrld || la || br || node || sd); // for 'from' buttons - - if(ma || wrld || la || br || node || sd) { - Tex *tex= NULL; - - texture_panel_texture(mtex, ma, wrld, la, node, br, sd); - - if(mtex) tex= mtex->tex; - else if(node) tex= (Tex *)node->id; - - if(tex) { - texture_panel_colors(tex); - - switch(tex->type) { - case TEX_IMAGE: - texture_panel_image(&tex->ima, &tex->iuser); - texture_panel_image_map(tex, mtex); - break; - case TEX_ENVMAP: - texture_panel_envmap(tex); - break; - case TEX_CLOUDS: - texture_panel_clouds(tex); - break; - case TEX_MARBLE: - texture_panel_marble(tex); - break; - case TEX_STUCCI: - texture_panel_stucci(tex); - break; - case TEX_WOOD: - texture_panel_wood(tex); - break; - case TEX_BLEND: - texture_panel_blend(tex); - break; - case TEX_MAGIC: - texture_panel_magic(tex); - break; - case TEX_PLUGIN: - texture_panel_plugin(tex); - break; - case TEX_NOISE: - // no panel! (e: not really true, is affected by noisedepth param) - break; - /* newnoise: musgrave panels */ - case TEX_MUSGRAVE: - texture_panel_musgrave(tex); - break; - case TEX_DISTNOISE: - texture_panel_distnoise(tex); - break; - /* newnoise: voronoi */ - case TEX_VORONOI: - texture_panel_voronoi(tex); - break; - } - } - } -} - -void radio_panels() -{ - Radio *rad; - int flag; - - rad= G.scene->radio; - if(rad==NULL) { - add_radio(); - rad= G.scene->radio; - } - - radio_panel_render(rad); - - flag= rad_phase(); - - radio_panel_tool(rad, flag); - if(flag) radio_panel_calculation(rad, flag); - - -} diff --git a/source/blender/src/cmap.tga.c b/source/blender/src/cmap.tga.c deleted file mode 100644 index da515b6b106..00000000000 --- a/source/blender/src/cmap.tga.c +++ /dev/null @@ -1,92 +0,0 @@ -/* DataToC output of file */ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -int datatoc_cmap_tga_size= 13400; -char datatoc_cmap_tga[]= {"\x00\x01\x01\x00\x00\x00\x01\x18\x00\x00\x00\x00\x9a\x00\x50\x00\x08\x08\xf3\xf3\xf3\xdb\xdb\xdb\xc4\xc4\xc4\xad\xad\xad\x96\x96\x96\x7f\x7f\x7f\x67\x67\x67\x50\x50\x50\x39\x39\x39\x22\x22\x22\x0b\x0b\x0b\xf4\xf4\xf4\xe6\xc8\xec\xe6\xa4\xec\xe6\x7f\xec\xe6\x5b\xec\xe6\x36\xec\xe6\x12\xec\xb3\xec\xec\xb3\xc8\xec\xb3\xa4\xec\xb3\x7f\xec\xb3\x5b\xec" \ -"\xb3\x36\xec\xb3\x12\xec\x80\xec\xec\x80\xc8\xec\x80\xa4\xec\x80\x7f\xec\x80\x5b\xec\x80\x36\xec\x80\x12\xec\x4d\xec\xec\x4d\xc8\xec\x4d\xa4\xec\x4d\x7f\xec\x4d\x5b\xec\x4d\x36\xec\x4d\x12\xec\x1a\xec\xec\x1a\xc8\xec\x1a\xa4\xec\x1a\x7f\xec\x1a\x5b\xec\x1a\x36\xec\x1a\x12\xec\xe6\xec\xc8\xe6\xc8\xc8\xe6\xa4\xc8\xe6\x7f\xc8\xe6\x5b\xc8\xe6\x36\xc8\xe6\x12\xc8\xb3\xec\xc8\xb3\xc8\xc8\xb3\xa4\xc8\xb3\x7f\xc8\xb3\x5b\xc8\xb3\x36\xc8\xb3\x12\xc8\x80\xec\xc8\x80\xc8\xc8\x80\xa4\xc8\x80\x7f\xc8\x80\x5b\xc8\x80\x36\xc8\x80\x12\xc8\x4d\xec\xc8\x4d\xc8\xc8\x4d\xa4\xc8\x4d\x7f\xc8\x4d\x5b\xc8\x4d\x36\xc8\x4d\x12\xc8\x1a\xec\xc8\x1a\xc8\xc8\x1a\xa4\xc8\x1a\x7f\xc8\x1a\x5b\xc8\x1a\x36\xc8\x1a\x12\xc8\xe6\xec\xa4\xe6\xc8\xa4\xe6\xa4\xa4\xe6\x7f\xa4\xe6\x5b\xa4\xe6\x36\xa4\xe6\x12\xa4\xb3\xec\xa4\xb3\xc8\xa4\xb3\xa4\xa4\xb3\x7f\xa4\xb3\x5b\xa4\xb3\x36\xa4\xb3\x12\xa4\x80\xec\xa4\x80\xc8\xa4\x80\xa4\xa4\x80\x7f\xa4\x80\x5b\xa4\x80\x36\xa4\x80\x12\xa4\x4d\xec\xa4\x4d\xc8\xa4\x4d\xa4\xa4\x4d\x7f\xa4\x4d\x5b\xa4\x4d\x36\xa4\x4d" \ -"\x12\xa4\x1a\xec\xa4\x1a\xc8\xa4\x1a\xa4\xa4\x1a\x7f\xa4\x1a\x5b\xa4\x1a\x36\xa4\x1a\x12\xa4\xe6\xec\x7f\xe6\xc8\x7f\xe6\xa4\x7f\xe6\x7f\x7f\xe6\x5b\x7f\xe6\x36\x7f\xe6\x12\x7f\xb3\xec\x7f\xb3\xc8\x7f\xb3\xa4\x7f\xb3\x7f\x7f\xb3\x5b\x7f\xb3\x36\x7f\xb3\x12\x7f\x80\xec\x7f\x80\xc8\x7f\x80\xa4\x7f\x80\x7f\x7f\x80\x5b\x7f\x80\x36\x7f\x80\x12\x7f\x4d\xec\x7f\x4d\xc8\x7f\x4d\xa4\x7f\x4d\x7f\x7f\x4d\x5b\x7f\x4d\x36\x7f\x4d\x12\x7f\x1a\xec\x7f\x1a\xc8\x7f\x1a\xa4\x7f\x1a\x7f\x7f\x1a\x5b\x7f\x1a\x36\x7f\x1a\x12\x7f\xe6\xec\x5b\xe6\xc8\x5b\xe6\xa4\x5b\xe6\x7f\x5b\xe6\x5b\x5b\xe6\x36\x5b\xe6\x12\x5b\xb3\xec\x5b\xb3\xc8\x5b\xb3\xa4\x5b\xb3\x7f\x5b\xb3\x5b\x5b\xb3\x36\x5b\xb3\x12\x5b\x80\xec\x5b\x80\xc8\x5b\x80\xa4\x5b\x80\x7f\x5b\x80\x5b\x5b\x80\x36\x5b\x80\x12\x5b\x4d\xec\x5b\x4d\xc8\x5b\x4d\xa4\x5b\x4d\x7f\x5b\x4d\x5b\x5b\x4d\x36\x5b\x4d\x12\x5b\x1a\xec\x5b\x1a\xc8\x5b\x1a\xa4\x5b\x1a\x7f\x5b\x1a\x5b\x5b\x1a\x36\x5b\x1a\x12\x5b\xe6\xec\x36\xe6\xc8\x36\xe6\xa4\x36\xe6\x7f\x36\xe6\x5b\x36\xe6\x36\x36\xe6\x12\x36\xb3\xec" \ -"\x36\xb3\xc8\x36\xb3\xa4\x36\xb3\x7f\x36\xb3\x5b\x36\xb3\x36\x36\xb3\x12\x36\x80\xec\x36\x80\xc8\x36\x80\xa4\x36\x80\x7f\x36\x80\x5b\x36\x80\x36\x36\x80\x12\x36\x4d\xec\x36\x4d\xc8\x36\x4d\xa4\x36\x4d\x7f\x36\x4d\x5b\x36\x4d\x36\x36\x4d\x12\x36\x1a\xec\x36\x1a\xc8\x36\x1a\xa4\x36\x1a\x7f\x36\x1a\x5b\x36\x1a\x36\x36\x1a\x12\x36\xe6\xec\x12\xe6\xc8\x12\xe6\xa4\x12\xe6\x7f\x12\xe6\x5b\x12\xe6\x36\x12\xe6\x12\x12\xb3\xec\x12\xb3\xc8\x12\xb3\xa4\x12\xb3\x7f\x12\xb3\x5b\x12\xb3\x36\x12\xb3\x12\x12\x80\xec\x12\x80\xc8\x12\x80\xa4\x12\x80\x7f\x12\x80\x5b\x12\x80\x36\x12\x80\x12\x12\x4d\xec\x12\x4d\xc8\x12\x4d\xa4\x12\x4d\x7f\x12\x4d\x5b\x12\x4d\x36\x12\x4d\x12\x12\x1a\xec\x12\x1a\xc8\x12\x1a\xa4\x12\x1a\x7f\x12\x1a\x5b\x12\x1a\x36\x12\x1a\x12\x12\x03\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02" \ -"\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \ -"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \ -"\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" \ -"\x0a\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xff\xff\xff\xff\xff\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\xff\xff\xff\xff\xff\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xdc\xdc\xdc\xdc\xdc" \ -"\xdc\xdc\xdc\xdc\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\x09\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x09\x09\x09\x09\xdb\xdb\xdb\xdb\xdb\xdb\x09\x09\x09\x09\x09\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\xdc\xdc\xdc\xdc" \ -"\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\x09\x09\x09\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x09\x09\x09\x09\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe" \ -"\xfe\xfe\xfe\xfe\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xfe\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\xdc\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9" \ -"\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2" \ -"\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6" \ -"\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf7\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xf8\xd5\xd5\xd5\xd5\xd5\xd5\xd5\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb8" \ -"\xb8\xb8\xb8\xb8\xb8\xb8\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xda\xda\xda\xda\xda\xda\xda\xda\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xf6\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\xab\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb2\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\xb9\x02\x04\x07\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\xdb\x02\x07\x96\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x94\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab" \ -"\xab\xab\xab\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x94\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5" \ -"\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x96\x95\x95\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x08\x02\x07\x96\x96\x96\x96\x96\x96\x95\x95" \ -"\x95\x95\x95\x95\x94\x94\x94\x94\x94\x94\x94\x93\x93\x93\x93\x93\x93\x93\x93\xb6\xb6\xb6\xb6\xb6\xb6\xb6\xd9\xd9\xd9\xd9\xd9\xd9\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xf5\xee\xee\xee\xee\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x88\x88\x88\x88\x88\x88\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x8f\x96\x96\x96\x96\x96\x96\x96\x96\x96\x02\x04\x07\x08\x08\x08\x08\x08\x08\x08\x08\x08\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab" \ -"\x88\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x92\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4" \ -"\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xed\xed\xee\xee\xee\xee\xef\xef\xef\xef\xef\xef\xef\xf0\xf0\xf0\xf0\xf0\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xf1\xce\xce\xce\xce\xab\xab\xab\xab\xab\xab\xab\x88\x88\x88\x88\x65\x65\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x72\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x02\x07\x73\x73\x73\x73\x73\x72" \ -"\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x73\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x73\x73\x73\x73\x73\x72\x72\x72\x72\x71\x71\x71\x71\x71\x71\x70\x70\x70\x70\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x6f\x92\x92\x92\x92\xb5\xb5\xb5\xb5\xb5\xb5\xd8\xd8\xd8\xd8\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xfb\xf4\xf4\xf4\xf4\xf4\xf4\xf4\xed\xed\xed\xed\xed\xed\xed\xe6\xe6\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81" \ -"\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x5e\x65\x65\x65\x65\x65\x65\x65\x65\x6c\x6c\x6c\x6c\x6c\x6c\x6c\x73\x73\x73\x73\x73\x73\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x50\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\xb0\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3" \ -"\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50" \ -"\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xe5\xe6\xe6\xe6\xe6\xe7\xe7\xe7\xe7\xe8\xe8\xe8\xe8\xe8\xe9\xe9\xe9\xe9\xea\xea\xea\xea\xea\xea\xea\xea\xc7\xc7\xc7\xc7\xa4\xa4\xa4\xa4\xa4\x81\x81\x81\x81\x5e\x5e\x5e\x5e\x3b\x3b\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x91\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x9d\x7a" \ -"\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x50\x50\x50\x50\x4f\x4f\x4f\x4e\x4e\x4e\x4e\x4e\x4d\x4d\x4d\x4d\x4c\x4c\x4c\x4c\x4b\x4b\x4b\x4b\x4b\x4b\x6e\x6e\x6e\x6e\x6e\x91\x91\x91\xb4\xb4\xb4\xb4\xb4\xd7\xd7\xd7\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xfa\xf3\xf3\xf3\xf3\xf3\xf3\xec\xec\xec\xec\xec\xec\xe5\xe5\xe5\xe5\xe5\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x3b\x3b\x3b\x3b\x3b\x42\x42\x42\x42\x42\x42\x49\x49\x49\x49\x49\x49\x50\x50\x50\x50\x50\x02\x04\x07\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x06\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2" \ -"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x57\x34\x34\x34\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d" \ -"\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe2\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a" \ -"\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x02\x07\x2d\x2d\x2d\x2d\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x05\x05\x05\x05\x85\x85\x85\x85\x85\x85\x85\x02\x07\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf9\xf2" \ -"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x02\x07\x2d\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe3\xe3\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x2d\x02\x04\x07\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x85\x02\x07" \ -"\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe3\xe3\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a" \ -"\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x2d\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf9\xf9\xf2\xf2\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xe3\xe3\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2d\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xf9\xf9\xf2\xf2" \ -"\xf2\xf2\xf2\xeb\xeb\xeb\xeb\xeb\xeb\xeb\xe4\xe4\xe4\xe4\xe4\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xde\xde\xde\xde\xdf\xdf\xdf\xdf\xdf\xe0\xe0\xe0\xe1\xe1\xe1\xe1\xe1\xe2\xe2\xe2\xc0\xc0\xc0\xc0\x9d\x9d\x9d\x9d\x7a\x7a\x7a\x7a\x57\x57\x57\x57\x34\x34\x34\x34\x11\x11\x11\x11\x11\x11\x11\x11\x18\x18\x18\x18\x18\x1f\x1f\x1f\x1f\x1f\x1f\x1f\x26\x26\x26\x26\x26\x2d\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x2c\x2c\x2c\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xd6\xd6\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x2c\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04" \ -"\x02\x07\x2c\x2c\x2b\x2b\x2b\x2b\x2b\x2a\x2a\x2a\x2a\x29\x29\x29\x29\x29\x28\x28\x28\x28\x27\x27\x27\x27\x27\x27\x4a\x4a\x4a\x4a\x4a\x6d\x6d\x6d\x6d\x6d\x90\x90\x90\x90\xb3\xb3\xb3\xb3\xd6\xd6\xd6\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x25\x25\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xcf\xcf\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\xbf\xbf\x9c\x9c\x9c\x9c\x79\x79" \ -"\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x25\x02\x04\x07\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x02\x07\x25\x24\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xcf\xcf\xcf\xcf\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbf\xbf\x9c\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x02\x07\x25\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xcf\xcf" \ -"\xcf\xcf\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc8\xc1\xc1\xc1\xc1\xc1\xc1\xba\xba\xba\xba\xba\xba\xba\xba\xbb\xbb\xbb\xbb\xbb\xbc\xbc\xbc\xbc\xbc\xbc\xbd\xbd\xbd\xbd\xbe\xbe\xbe\xbe\xbe\x9c\x9c\x9c\x9c\x9c\x79\x79\x79\x79\x56\x56\x56\x56\x56\x56\x33\x33\x33\x33\x33\x10\x10\x10\x10\x10\x10\x10\x10\x10\x17\x17\x17\x17\x17\x17\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x25\x25\x25\x25\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x02\x07\x24\x24\x24\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x24\x24\x02\x04\x07\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a\x5a" \ -"\x5a\x5a\x02\x07\x24\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x89\x89\x89\x89\x89\xac\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x24\x24\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x9b\x9b\x78\x78\x78" \ -"\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\xac\xac\xac\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x9b\x78\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x24\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x24\x23\x23\x23\x23\x23\x22\x22\x22\x22\x22\x22\x22\x21\x21\x21\x21\x21\x21\x20\x20\x20\x20\x20\x20\x20\x20\x20\x43\x43\x43\x43\x43\x43\x66\x66\x66\x66\x66\x66\x89\x89\x89\x89\x89\xac" \ -"\xac\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x9b\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x02\x07\x1d\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\xa5\xa5\xa5\xa5\xa5\xa5\xa5\xa5\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x9e\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x97\x98\x98\x98\x98\x98\x98\x98\x99\x99\x99\x99\x99\x99\x99\x9a\x9a\x9a\x9a\x9a\x9b\x78\x78\x78\x78\x55\x55\x55\x55\x55\x55\x55\x32\x32\x32\x32\x32\x32\x32\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x16\x16\x16\x16\x16\x16\x16\x16\x16\x1d\x1d\x1d\x1d\x1d\x1d\x1d\x02\x04\x07\x03\x03\x03\x03\x03\x03\x03" \ -"\x03\x03\x03\x03\x02\x07\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x54" \ -"\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1c\x1c\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f" \ -"\x5f\x82\x82\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x76\x77\x77\x77\x54\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x82\x82\x82\x82\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x7b\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x74\x75\x75\x75\x75\x75\x75\x75\x75\x75\x76\x76\x76\x76\x76\x76\x76\x76\x54\x54\x54\x54\x54\x54\x54\x54\x31\x31\x31\x31\x31\x31\x31\x31\x31\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x1c\x1c\x1c\x02\x04\x07\x02\x02\x02\x02\x02" \ -"\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x1b\x1b\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x1b\x1b\x1b\x1b\x1b\x1b\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x19\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x5f\x5f\x5f\x5f\x5f\x5f\x5f\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53" \ -"\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x07\x14\x14\x14\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x14\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35" \ -"\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01" \ -"\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x14\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x58\x58\x58\x58\x58\x58\x58\x58\x58\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x51\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x52\x53\x53\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x0d\x14\x14\x14\x14\x14\x14\x14\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f" \ -"\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x13\x13\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x13\x13\x13\x13\x13\x13\x01\x01\x01\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x12\x01\x01\x01" \ -"\x35\x35\x35\x35\x35\x35\x35\x35\x35\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x13\x13\x02\x04\x07\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x02\x07\x0c\x0c\x0c\x0c\x01\x01\x01\x01\x01\x01\x01\x12\x12\x12\x12\x12\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x12\x12\x12\x12\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x01\x01\x01\x01\x2f\x2f\x2f\x2f\x2f\x2f\x2f\x01\x01\x01\x01\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x02\x04\x07\x0b" \ -"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0c\x01\x01\x01\x01\x01\x01\x01\x01\x01\x12\x12\x12\x12\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x12\x12\x12\x12\x12\x01\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x01\x01\x01\x01\x01\x01\x01\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x01\x01\x01\x01\x01\x01\x01\x01\x01\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x01\x01\x01\x01\x01" \ -"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x01\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0c\x0c\x0c\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x2e\x2e\x2e\x2e\x2e\x2e\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0c\x0c\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" \ -"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04" \ -"\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" \ -"\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x04\x07\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x02\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x04\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x03\x01\x00\x14\x00\x3e\x33\x00\x00\x00\x01\x00\x00\x38\x42\x49\x4d\x03\xed\x00\x00\x00\x00\x00\x10\x00\x48\x00\x00\x00\x01\x00\x01\x00\x48\x00\x00\x00" \ -"\x01\x00\x01\x38\x42\x49\x4d\x03\xf3\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x38\x42\x49\x4d\x03\xf5\x00\x00\x00\x00\x00\x48\x00\x2f\x66\x66\x00\x01\x00\x6c\x66\x66\x00\x06\x00\x00\x00\x00\x00\x00\x00\x2f\x66\x66\x00\x01\x00\xa1\x99\x9a\x00\x06\x00\x00\x00\x00\x00\x00\x00\x32\x00\x00\x00\x01\x00\x5a\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x35\x00\x00\x00\x01\x00\x2d\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x38\x42\x49\x4d\x03\xf8\x00\x00\x00\x00\x00\x70\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\x00\x00\x32\x33\x00\x00\x54\x52\x55\x45\x56\x49\x53\x49\x4f\x4e\x2d\x58\x46\x49\x4c\x45\x2e" \ -"\x00"}; diff --git a/source/blender/src/cmovie.tga.c b/source/blender/src/cmovie.tga.c deleted file mode 100644 index 391c032168d..00000000000 --- a/source/blender/src/cmovie.tga.c +++ /dev/null @@ -1,205 +0,0 @@ -/* DataToC output of file */ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -int datatoc_cmovie_tga_size= 6247; -char datatoc_cmovie_tga[]= {"\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x34\x00\x20\x00\x01\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x17\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x50\x50\x50\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xac\xac\xac\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xa9\xa9\xa9\xff\x9c\x9c\x9c\xff\xa4\xa4\xa4" \ -"\xff\xb2\xb2\xb2\xff\x3b\x35\x35\xff\x58\x51\x51\xff\xa3\x9c\x9c\xff\x9a\x97\x97\xff\xb8\xb8\xb8\xff\xaf\xae\xae\xff\x47\x42\x42\xff\x86\x80\x80\xff\xb4\xb4\xb4\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x52\x52\x52\xff\x9f\x9f\x9f\xff\xa0\xa0\xa0\xff\xa9\xa9\xa9\xff\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x9c\x9c\x9c\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\x38\x32\x32\xff\x72\x6a\x6a\xff\x86\x80\x80\xff\xaf\xaf\xaf\xff\xb7\xb7\xb7\xff\x5d\x5a\x5a\xff\x4d\x46\x46\xff\x9a\x93\x93\xff\xb4\xb4\xb4\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x5a\x5a\x5a\xff\xb3\xb3\xb3\xff\xb4\xb4\xb4\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa2\xa2\xa2\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xad\xad\xad\xff\xb8\xb8\xb8\xff\x91\x8f\x8f\xff\x8e\x8b\x8b\xff\xad\xac\xac\xff\xb8\xb8\xb8\xff\x9a\x99\x99\xff\x33\x2c\x2c\xff\x84" \ -"\x7d\x7d\xff\x9e\x99\x99\xff\xb6\xb6\xb6\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x04\xb5\xb5\xb5\xff\xa3\xa3\xa3\xff\x9e\x9e\x9e\xff\xa7\xa7\xa7\xff\xb6\xb6\xb6\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\x92\x90\x90\xff\x43\x3b\x3b\xff\x7b\x74\x74\xff\xa0\x9d\x9d\xff\x89\xb7\xb7\xb7\xff\x01\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\x86\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x03\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xb7\xb7\xb7\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb6\xb6\xb6\xff\x91\x8f\x8f\xff\xa2\xa0\xa0\xff\x8b\xb7\xb7\xb7\xff\x87\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83" \ -"\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x89\xb8\xb8\xb8\xff\x01\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x8f\xb7\xb7\xb7\xff\x88\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xb1\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xff\x0c\x0c\x0c\xff\x81\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x85\xb8\xb8\xb8\xff\x00\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x8d\xb8\xb8\xb8\xff\x02\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x82\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c" \ -"\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x09\xb6\xb6\xb6\xff\xb2\xb2\xb2\xff\xae\xae\xae\xff\xa9\xa9\xa9\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\xa8\xa8\xa8\xff\xab\xab\xab\xff\xb2\xb2\xb2\xff\xb6\xb6\xb6\xff\x89\xb8\xb8\xb8\xff\x86\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x06\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa8\xa8\xa8\xff\xa0\xa0\xa0\xff\x85\x9c\x9c\x9c\xff\x05\x9e\x9e\x9e\xff\xa4\xa4\xa4\xff\xb0\xb0\xb0\xff\xb9\xb9\xb9\xff\xba\xba\xba\xff\xb9\xb9\xb9\xff\x86\xb8\xb8\xb8\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0" \ -"\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x04\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xae\xae\xae\xff\xa1\xa1\xa1\xff\x87\x9c\x9c\x9c\xff\x09\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\xa3\xa3\xa3\xff\xa9\xa9\xa9\xff\x9c\x9b\x9c\xff\x8c\x8a\x8b\xff\x7f\x7e\x7e\xff\x8c\x8a\x8b\xff\xa1\xa1\xa1\xff\xb5\xb5\xb5\xff\x83\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x03\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x87\x9c\x9c\x9c\xff\x0e\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\x9f\x9f\x9f\xff\x6e\x6c\x6c\xff\x36\x31\x32\xff\x21\x1b\x1c\xff\x20\x1a\x1b\xff\x1f\x19\x1a\xff\x1e\x19\x1a\xff\x24\x1f\x20\xff\x42\x3e\x3f\xff\x84\x83\x83\xff\xb2\xb2\xb2\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5c\x5c\x5c\xff\xb1\xb1\xb1\xff\xa0\xa0\xa0\xff\x88\x9c\x9c\x9c" \ -"\xff\x0d\x9d\x9d\x9d\xff\x96\x96\x96\xff\x42\x3e\x3f\xff\x21\x1b\x1c\xff\x1e\x22\x20\xff\x16\x3e\x34\xff\x10\x4f\x41\xff\x0e\x53\x44\xff\x10\x41\x35\xff\x14\x1f\x1c\xff\x19\x14\x15\xff\x1e\x19\x1a\xff\x45\x41\x42\xff\xa2\xa1\xa1\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x5a\x5a\x5a\xff\xa5\xa5\xa5\xff\x89\x9c\x9c\x9c\xff\x0e\x96\x96\x96\xff\x41\x3d\x3e\xff\x20\x1d\x1e\xff\x14\x4d\x3f\xff\x07\x98\x78\xff\x05\xaf\x8a\xff\x05\xbc\x94\xff\x05\xbb\x92\xff\x05\xba\x92\xff\x05\xa0\x7d\xff\x09\x62\x4d\xff\x10\x21\x1c\xff\x19\x14\x15\xff\x2f\x2a\x2b\xff\x99\x98\x99\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x05\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x55" \ -"\x55\x55\xff\x9d\x9d\x9d\xff\x88\x9c\x9c\x9c\xff\x10\x9b\x9b\x9b\xff\x48\x45\x46\xff\x20\x1b\x1c\xff\x11\x6a\x55\xff\x06\x9d\x79\xff\x06\xa8\x82\xff\x06\xb2\x8a\xff\x06\xc3\x96\xff\x06\xd1\xa4\xff\x06\xd0\xa3\xff\x06\xbd\x94\xff\x04\xad\x88\xff\x05\x88\x6a\xff\x0b\x37\x2c\xff\x16\x12\x12\xff\x31\x2d\x2e\xff\xa2\xa2\xa2\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x55\x55\x55\xff\x9e\x9e\x9e\xff\x88\x9c\x9c\x9c\xff\x11\x75\x74\x75\xff\x22\x1d\x1e\xff\x1a\x48\x3d\xff\x06\x9f\x7b\xff\x06\xaf\x8a\xff\x06\xb4\x8c\xff\x06\xc0\x95\xff\x08\xc9\x9c\xff\x09\xcd\xa3\xff\x08\xc5\x9b\xff\x07\xca\x9f\xff\x05\xba\x92\xff\x04\xa5\x81\xff\x04\x90\x71\xff\x0b\x33\x28\xff\x17\x12\x12\xff\x4d\x49\x4a\xff\xb3\xb3\xb3\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf" \ -"\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5b\x5b\x5b\xff\xb0\xb0\xb0\xff\xa2\xa2\xa2\xff\x86\x9c\x9c\x9c\xff\x12\x9b\x9b\x9b\xff\x3c\x39\x39\xff\x24\x1f\x20\xff\x0e\x92\x75\xff\x07\xab\x85\xff\x07\xaf\x88\xff\x07\xbd\x94\xff\x06\x97\x76\xff\x0b\x66\x4f\xff\x13\x3c\x33\xff\x19\x2d\x33\xff\x1d\x39\x46\xff\x17\x61\x5e\xff\x0b\x91\x77\xff\x04\x9d\x7b\xff\x05\x86\x69\xff\x0d\x20\x1b\xff\x1d\x18\x18\xff\x86\x84\x84\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xa7\xa7\xa7\xff\x86\x9c\x9c\x9c\xff\x13\x8e\x8e\x8e\xff\x27\x23\x23\xff\x1d\x4c\x42\xff\x09\xb3\x8d\xff\x08\xaf\x87\xff\x09\xbf\x95\xff\x08\x9e\x7d\xff\x0b\x48\x39\xff\x1a\x10\x14\xff\x23\x12\x2a\xff\x2c\x19\x47\xff\x2d\x1b\x56\xff\x2b\x1a\x59\xff\x26\x24\x58\xff\x12\x76\x6e\xff" \ -"\x04\xa3\x80\xff\x07\x63\x4d\xff\x13\x0f\x0f\xff\x42\x3e\x3f\xff\xb4\xb4\xb4\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x02\x5c\x5c\x5c\xff\xb6\xb6\xb6\xff\xa3\xa3\xa3\xff\x86\x9c\x9c\x9c\xff\x13\x9b\x9b\x9b\xff\x88\x92\x8f\xff\x0f\xa5\x83\xff\x0a\xba\x93\xff\x0b\xb5\x8d\xff\x0a\xc4\x9b\xff\x08\x6c\x57\xff\x14\x0f\x0e\xff\x1d\x10\x20\xff\x28\x18\x42\xff\x30\x1d\x5d\xff\x36\x21\x72\xff\x39\x23\x82\xff\x37\x23\x85\xff\x2e\x27\x72\xff\x0b\x9a\x82\xff\x04\x97\x74\xff\x0c\x20\x1a\xff\x20\x1a\x1c\xff\x9f\x9e\x9e\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5b\x5b\x5b\xff\xb3\xb3\xb3\xff\xa4\xa4\xa4\xff\x86\x9c\x9c\x9c\xff\x13\x9d\x9d\x9d\xff\x8b\xa2\x9b\xff\x11\xb9\x96\xff\x0e\xc7\xa0\xff\x0e\xc8\xa0\xff\x0b\xb4\x8e\xff\x0d\x3b\x30\xff\x16\x0b\x10\xff\x21\x14\x2f\xff\x2d\x1c\x52\xff\x36\x22\x70\xff\x4a\x33\x9c\xff\x5d\x45\xc1\xff\x59\x42" \ -"\xc9\xff\x43\x2d\xaa\xff\x1e\x65\x7c\xff\x04\xb5\x8e\xff\x08\x50\x40\xff\x20\x22\x22\xff\x86\x85\x85\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x02\x52\x52\x52\xff\xa1\xa1\xa1\xff\x9e\x9e\x9e\xff\x87\x9c\x9c\x9c\xff\x12\x88\xa4\x9d\xff\x14\xb6\x92\xff\x12\xbb\x95\xff\x12\xca\xa1\xff\x0f\xb0\x8a\xff\x0f\x2c\x24\xff\x18\x0c\x17\xff\x26\x15\x3c\xff\x33\x20\x67\xff\x47\x30\x94\xff\x71\x57\xd5\xff\xa3\x87\xfc\xff\x92\x76\xfc\xff\x5b\x41\xda\xff\x2d\x4d\x90\xff\x06\xbc\x92\xff\x05\xaa\x84\xff\x55\xaf\x98\xff\xbc\xbc\xbc\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x51\x51\x51\xff\x88\x9c\x9c" \ -"\x9c\xff\x13\x98\x97\x97\xff\x93\x9d\x9a\xff\x45\xb3\x99\xff\x17\xc9\xa1\xff\x17\xca\xa1\xff\x15\xca\xa3\xff\x11\x3c\x31\xff\x17\x0b\x19\xff\x26\x15\x44\xff\x34\x21\x6f\xff\x4f\x37\xa4\xff\x85\x6b\xf0\xff\xc1\xa3\xff\xff\xad\x8f\xff\xff\x66\x4a\xec\xff\x30\x49\x91\xff\x07\xca\x9f\xff\x06\xb7\x8e\xff\x49\xb8\x9e\xff\xbe\xbe\xbe\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x55\x55\x55\xff\x88\x9c\x9c\x9c\xff\x16\x7a\x79\x79\xff\x86\x7f\x7f\xff\xa6\xb6\xaf\xff\x23\xd0\xaa\xff\x1e\xdc\xb1\xff\x1d\xe3\xb8\xff\x15\x7e\x65\xff\x18\x0d\x17\xff\x24\x15\x3e\xff\x33\x1f\x6a\xff\x49\x32\x9e\xff\x6f\x54\xdf\xff\x95\x78\xfe\xff\x88\x69\xfe\xff\x5b\x3e\xdf\xff\x26\x76\x91\xff\x07\xcf\xa2\xff\x07\xb8\x90\xff\x4b\xb6\x9c\xff\xbf\xbf\xbf\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff" \ -"\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x05\x59\x59\x59\xff\xa2\xa2\xa2\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x99\x99\x99\xff\x83\x9c\x9c\x9c\xff\x16\x93\x93\x93\xff\x6c\x65\x65\xff\xc1\xba\xb9\xff\x4d\xd8\xb7\xff\x25\xe2\xb8\xff\x24\xe1\xb6\xff\x1f\xd1\xa8\xff\x17\x2a\x28\xff\x21\x14\x32\xff\x2f\x1c\x5b\xff\x3e\x28\x88\xff\x50\x37\xb6\xff\x5f\x42\xdc\xff\x60\x40\xe8\xff\x46\x43\xb6\xff\x12\xd5\xb8\xff\x07\xd3\xa6\xff\x09\x85\x69\xff\x57\x5e\x5a\xff\xab\xa8\xa8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x20\x5c\x5c\x5c\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x8f\x8f\x8f\xff\x4d\x48\x48\xff\x56\x50\x50\xff\x66\x62\x62\xff\x74\x71\x71\xff\x7f\x7c\x7c\xff\x8d\x8a\x8a\xff\x99\x99\x99\xff\x5d\x59\x59\xff\xc2\xba\xba\xff\xa2\xd7\xc9\xff\x2d\xdd\xb5\xff\x2b\xe9\xbf\xff\x29\xef\xc8\xff\x21\xb9\x99\xff\x1a\x28\x2e\xff\x24\x16\x3f\xff\x33\x20\x66" \ -"\xff\x3c\x24\x85\xff\x43\x2b\x9d\xff\x43\x40\xa8\xff\x1e\xbe\xb2\xff\x0a\xea\xba\xff\x07\xd6\xaa\xff\x0c\x53\x42\xff\x79\x72\x72\xff\xa9\xa6\xa6\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x1d\x5c\x5c\x5c\xff\xb6\xb6\xb6\xff\xa5\xa5\xa5\xff\x65\x62\x62\xff\x43\x3b\x3b\xff\x77\x6f\x6f\xff\xa0\x99\x99\xff\x9f\x98\x98\xff\x91\x8a\x8a\xff\x91\x8f\x8f\xff\x9b\x9b\x9b\xff\x7e\x7d\x7d\xff\x92\x8b\x8b\xff\xd7\xd4\xd2\xff\x5f\xda\xbd\xff\x30\xe0\xb9\xff\x2e\xd7\xb0\xff\x2b\xde\xb7\xff\x25\xbe\x9c\xff\x1f\x71\x63\xff\x21\x48\x55\xff\x26\x4d\x63\xff\x26\x88\x90\xff\x19\xe4\xc7\xff\x10\xeb\xbc\xff\x0b\xdd\xae\xff\x08\xb5\x8f\xff\x25\x34\x2f\xff\x96\x8f\x8f\xff\xb2\xb1\xb1\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff" \ -"\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x1d\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\x98\x98\x98\xff\x4d\x49\x49\xff\x5e\x57\x57\xff\x77\x70\x70\xff\x80\x7c\x7c\xff\x93\x92\x92\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x61\x5d\x5d\xff\xcb\xc4\xc4\xff\xca\xda\xd4\xff\x45\xd5\xb2\xff\x31\xd3\xae\xff\x2e\xd0\xab\xff\x2b\xdc\xb8\xff\x29\xe0\xb7\xff\x24\xd8\xae\xff\x20\xe0\xb7\xff\x1b\xea\xbe\xff\x15\xe5\xb7\xff\x10\xe3\xb5\xff\x0c\xd0\xa5\xff\x0d\x69\x55\xff\x70\x6a\x6a\xff\xa3\x9d\x9d\xff\xb8\xb7\xb7\xff\x82\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x0a\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x59\x59\x59\xff\xae\xae\xae\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xa2\xa2\xa2\xff\x90\x90\x90\xff\x97\x97\x97\xff\x84\x9c\x9c\x9c\xff\x10\x92\x92\x92\xff\x77\x73\x73\xff\xe0" \ -"\xd9\xd9\xff\xc7\xdd\xd6\xff\x4e\xce\xaf\xff\x33\xd8\xb4\xff\x2f\xd4\xb0\xff\x2a\xd4\xad\xff\x25\xda\xb1\xff\x21\xd0\xa8\xff\x1b\xda\xb2\xff\x15\xd7\xaf\xff\x0f\xc3\x9c\xff\x0d\x84\x6a\xff\x4f\x55\x52\xff\x9d\x96\x96\xff\xb1\xae\xae\xff\x83\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x1f\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe\xfe\xfe\xff\x4f\x4f\x4f\xff\xa3\xa3\xa3\xff\xb4\xb4\xb4\xff\xb8\xb8\xb8\xff\xb4\xb4\xb4\xff\xa7\xa7\xa7\xff\x9e\x9e\x9e\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9b\x9b\x9b\xff\x96\x96\x96\xff\x85\x83\x83\xff\x95\x94\x94\xff\x89\x89\x89\xff\x85\x80\x80\xff\xe8\xe0\xe0\xff\xd8\xe4\xdf\xff\x76\xdd\xc6\xff\x37\xcd\xab\xff\x2d\xcc\xa8\xff\x27\xd3\xae\xff\x21\xc7\xa1\xff\x1a\xbe\x97\xff\x13\xa6\x84\xff\x18\x73\x5f\xff\x5d\x61\x5f\xff\x9c\x95\x95\xff\xac\xa8\xa8\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8" \ -"\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x51\x51\x51\xff\xb0\xb0\xb0\xff\x82\xb8\xb8\xb8\xff\x16\xb6\xb6\xb6\xff\xaf\xaf\xaf\xff\x90\x90\x90\xff\x68\x65\x65\xff\x5a\x55\x55\xff\x63\x5d\x5d\xff\x88\x81\x81\xff\x9a\x9a\x9a\xff\x9c\x9c\x9c\xff\x8e\x8d\x8d\xff\x90\x8d\x8d\xff\xdf\xd8\xd8\xff\xee\xe7\xe7\xff\xcc\xda\xd4\xff\x8a\xcb\xbc\xff\x5b\xb5\x9f\xff\x48\xa0\x8b\xff\x4b\x8e\x7e\xff\x6b\x84\x7d\xff\x98\x92\x91\xff\xa5\x9e\x9e\xff\xae\xab\xab\xff\xb6\xb6\xb6\xff\x84\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x19\x59\x59\x59\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xae\xae\xae\xff\x8f\x8e\x8e\xff\x39\x32\x32\xff\x5f\x58\x58\xff\x91\x8a\x8a\xff\x98\x92\x92\xff\x9d\x9c\x9c\xff\xa7\xa7\xa7\xff\xa7\xa7\xa7\xff\xaa\xaa\xaa\xff\xad\xac\xac\xff\x9a\x9a\x9a\xff\xbf\xbb\xbb\xff\xd9\xd3\xd3\xff\xe2\xda\xda\xff\xd7\xcf\xcf\xff\xca\xc3\xc3\xff\xbf\xb8\xb8\xff" \ -"\xb8\xb1\xb1\xff\xb4\xaf\xaf\xff\xb5\xb3\xb3\xff\x86\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x17\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa4\xa4\xa4\xff\xa8\xa8\xa8\xff\x71\x6e\x6e\xff\x4a\x42\x42\xff\x7f\x78\x78\xff\x91\x8a\x8a\xff\xa3\xa1\xa1\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x8b\x89\x89\xff\xa1\x9e\x9e\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xab\xab\xab\xff\xb8\xb7\xb7\xff\xc1\xbe\xbe\xff\xc3\xc1\xc1\xff\xbd\xbb\xbb\xff\xb9\xb8\xb8\xff\x89\xb7\xb7\xb7\xff\x83\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x12\x5c\x5c\x5c\xff\xb4\xb4\xb4\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x9c\x9c\x9c\xff\xae\xae\xae\xff\xb3\xb3\xb3\xff\x84\x82\x82\xff\x7d\x7a\x7a\xff" \ -"\x98\x97\x97\xff\xb6\xb6\xb6\xff\xb8\xb8\xb8\xff\xb3\xb3\xb3\xff\x73\x71\x71\xff\x6a\x63\x63\xff\xaf\xae\xae\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\x97\x95\x95\xff\x8e\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x13\x58\x58\x58\xff\xa3\xa3\xa3\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\xa2\xa2\xa2\xff\xb4\xb4\xb4\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa4\xa4\xa4\xff\xa3\xa3\xa3\xff\xb6\xb6\xb6\xff\xa0\x9f\x9f\xff\x4f\x4a\x4a\xff\x56\x4e\x4e\xff\x95\x8f\x8f\xff\xb5\xb5\xb5\xff\xb8\xb8\xb8\xff\x8e\x8d\x8d\xff\x78\x72\x72\xff\xb6\xb5\xb5\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x17\xfe\xfe\xfe\xff\xfd\xfd\xfd\xff\xfd\xfd\xfd\xff\xfe" \ -"\xfe\xfe\xff\x50\x50\x50\xff\x9c\x9c\x9c\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xac\xac\xac\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xa9\xa9\xa9\xff\x9c\x9c\x9c\xff\xa4\xa4\xa4\xff\xb2\xb2\xb2\xff\x3b\x35\x35\xff\x58\x51\x51\xff\xa3\x9c\x9c\xff\x9a\x97\x97\xff\xb8\xb8\xb8\xff\xaf\xae\xae\xff\x47\x42\x42\xff\x86\x80\x80\xff\xb4\xb4\xb4\xff\x8c\xb7\xb7\xb7\xff\x84\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x52\x52\x52\xff\x9f\x9f\x9f\xff\xa0\xa0\xa0\xff\xa9\xa9\xa9\xff\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9d\x9d\x9d\xff\x9c\x9c\x9c\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\x38\x32\x32\xff\x72\x6a\x6a\xff\x86\x80\x80\xff\xaf\xaf\xaf\xff\xb7\xb7\xb7\xff\x5d\x5a\x5a\xff\x4d\x46\x46\xff\x9a\x93\x93\xff\xb4\xb4\xb4\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x13\x5a\x5a\x5a\xff\xb3\xb3\xb3\xff\xb4\xb4\xb4\xff\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\xb5\xb5\xb5\xff\xa2\xa2\xa2" \ -"\xff\x9c\x9c\x9c\xff\x9d\x9d\x9d\xff\xad\xad\xad\xff\xb8\xb8\xb8\xff\x91\x8f\x8f\xff\x8e\x8b\x8b\xff\xad\xac\xac\xff\xb8\xb8\xb8\xff\x9a\x99\x99\xff\x33\x2c\x2c\xff\x84\x7d\x7d\xff\x9e\x99\x99\xff\xb6\xb6\xb6\xff\x8b\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x04\xb5\xb5\xb5\xff\xa3\xa3\xa3\xff\x9e\x9e\x9e\xff\xa7\xa7\xa7\xff\xb6\xb6\xb6\xff\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\x92\x90\x90\xff\x43\x3b\x3b\xff\x7b\x74\x74\xff\xa0\x9d\x9d\xff\x89\xb7\xb7\xb7\xff\x01\xb6\xb6\xb6\xff\xb7\xb7\xb7\xff\x86\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x03\xb7\xb7\xb7\xff\xb3\xb3\xb3\xff\xb2\xb2\xb2\xff\xb7\xb7\xb7\xff" \ -"\x83\xb8\xb8\xb8\xff\x04\xb7\xb7\xb7\xff\xb7\xb7\xb7\xff\xb6\xb6\xb6\xff\x91\x8f\x8f\xff\xa2\xa0\xa0\xff\x8b\xb7\xb7\xb7\xff\x87\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x00\x5c\x5c\x5c\xff\x89\xb8\xb8\xb8\xff\x01\xb7\xb7\xb7\xff\xb8\xb8\xb8\xff\x8f\xb7\xb7\xb7\xff\x88\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xb1\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\xff\x0c\x0c\x0c\xff\x81\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x85\xb8\xb8\xb8\xff\x00\xb7\xb7\xb7\xff\x83\xb6\xb6\xb6\xff\x8d\xb8\xb8\xb8\xff\x02\xb7\xb7\xb7\xff\xb7\xb7" \ -"\xb7\xff\xb8\xb8\xb8\xff\x82\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x00\x5c\x5c\x5c\xff\x83\xb8\xb8\xb8\xff\x09\xb6\xb6\xb6\xff\xb2\xb2\xb2\xff\xae\xae\xae\xff\xa9\xa9\xa9\xff\xa6\xa6\xa6\xff\xa6\xa6\xa6\xff\xa8\xa8\xa8\xff\xab\xab\xab\xff\xb2\xb2\xb2\xff\xb6\xb6\xb6\xff\x89\xb8\xb8\xb8\xff\x86\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x03\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x06\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb8\xb8\xb8\xff\xb7\xb7\xb7\xff\xb1\xb1\xb1\xff\xa8\xa8\xa8\xff\xa0\xa0\xa0\xff\x85\x9c\x9c\x9c\xff\x05\x9e\x9e\x9e\xff\xa4\xa4\xa4\xff\xb0\xb0\xb0\xff\xb9\xb9\xb9\xff\xba\xba\xba\xff\xb9\xb9\xb9\xff\x86\xb8\xb8\xb8\xff\x85\xb7\xb7" \ -"\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x83\xe0\xe0\xe0\xff\x04\xdf\xdf\xdf\xff\xdf\xdf\xdf\xff\x0c\x0c\x0c\xff\x0c\x0c\x0c\xff\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x04\x5c\x5c\x5c\xff\xb8\xb8\xb8\xff\xb6\xb6\xb6\xff\xae\xae\xae\xff\xa1\xa1\xa1\xff\x87\x9c\x9c\x9c\xff\x09\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\xa3\xa3\xa3\xff\xa9\xa9\xa9\xff\x9c\x9b\x9c\xff\x8c\x8a\x8b\xff\x7f\x7e\x7e\xff\x8c\x8a\x8b\xff\xa1\xa1\xa1\xff\xb5\xb5\xb5\xff\x83\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x8b\x0c\x0c\x0c\xff\x83\xc3\x73\x00\xff\x03\x5c\x5c\x5c\xff\xb7\xb7\xb7\xff\xac\xac\xac\xff\x9f\x9f\x9f\xff\x87\x9c\x9c\x9c\xff\x0e\x9d\x9d\x9d\xff\xa0\xa0\xa0\xff\x9f\x9f\x9f\xff\x6e\x6c\x6c\xff\x36\x31\x32\xff\x21\x1b\x1c\xff\x20\x1a\x1b\xff\x1f\x19\x1a\xff\x1e\x19\x1a\xff\x24\x1f\x20\xff\x42\x3e\x3f\xff\x84\x83\x83\xff\xb2\xb2\xb2\xff\xb8\xb8\xb8" \ -"\xff\xb8\xb8\xb8\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x95\x0c\x0c\x0c\xff\x83\xe0\xb8\x7f\xff\x02\x5c\x5c\x5c\xff\xb1\xb1\xb1\xff\xa0\xa0\xa0\xff\x88\x9c\x9c\x9c\xff\x0d\x9d\x9d\x9d\xff\x96\x96\x96\xff\x42\x3e\x3f\xff\x21\x1b\x1c\xff\x1e\x22\x20\xff\x16\x3e\x34\xff\x10\x4f\x41\xff\x0e\x53\x44\xff\x10\x41\x35\xff\x14\x1f\x1c\xff\x19\x14\x15\xff\x1e\x19\x1a\xff\x45\x41\x42\xff\xa2\xa1\xa1\xff\x85\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x8b\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x01\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x83\x0c\x0c\x0c\xff\x83\xfe\xfe\xfe\xff\x01\x5a\x5a\x5a\xff\xa5\xa5\xa5\xff\x89\x9c\x9c\x9c\xff\x0e\x96\x96\x96\xff\x41\x3d\x3e\xff\x20\x1d\x1e\xff\x14\x4d\x3f\xff\x07\x98\x78\xff\x05\xaf\x8a\xff\x05\xbc\x94\xff\x05\xbb\x92\xff\x05\xba\x92\xff\x05\xa0\x7d\xff\x09\x62\x4d\xff\x10\x21\x1c\xff\x19\x14\x15\xff\x2f\x2a\x2b\xff\x99\x98\x99\xff\x84\xb7\xb7\xb7\xff\x85\xb8\xb8\xb8\xff\x83\x0c\x0c\x0c\xff\x00\x0d\x0d\x0d\xff\x82\xe0\xe0\xe0\xff\x02\xdf\xdf\xdf\xff\x0d\x0d\x0d\xff\x0c\x0c\x0c" \ -"\xff"}; - -/* these are not the monkeys you are looking for */ -int monkeyo= 4; -int monkeynv= 271; -int monkeynf= 250; -signed char monkeyv[271][3]= { -{-71,21,98},{-63,12,88},{-57,7,74},{-82,-3,79},{-82,4,92}, -{-82,17,100},{-92,21,102},{-101,12,95},{-107,7,83}, -{-117,31,84},{-109,31,95},{-96,31,102},{-92,42,102}, -{-101,50,95},{-107,56,83},{-82,66,79},{-82,58,92}, -{-82,46,100},{-71,42,98},{-63,50,88},{-57,56,74}, -{-47,31,72},{-55,31,86},{-67,31,97},{-66,31,99}, -{-70,43,100},{-82,48,103},{-93,43,105},{-98,31,105}, -{-93,20,105},{-82,31,106},{-82,15,103},{-70,20,100}, -{-127,55,95},{-127,45,105},{-127,-87,94},{-127,-41,100}, -{-127,-24,102},{-127,-99,92},{-127,52,77},{-127,73,73}, -{-127,115,-70},{-127,72,-109},{-127,9,-106},{-127,-49,-45}, -{-101,-24,72},{-87,-56,73},{-82,-89,73},{-80,-114,68}, -{-85,-121,67},{-104,-124,71},{-127,-126,74},{-71,-18,68}, -{-46,-5,69},{-21,19,57},{-17,55,76},{-36,62,80}, -{-64,77,88},{-86,97,94},{-107,92,97},{-119,63,96}, -{-106,53,99},{-111,39,98},{-101,12,95},{-79,2,90}, -{-64,8,86},{-47,24,83},{-45,38,83},{-50,48,85}, -{-72,56,92},{-95,60,97},{-127,-98,94},{-113,-92,94}, -{-112,-107,91},{-119,-113,89},{-127,-114,88},{-127,-25,96}, -{-127,-18,95},{-114,-19,95},{-111,-29,96},{-116,-37,95}, -{-76,-6,86},{-48,7,80},{-34,26,77},{-32,48,84}, -{-39,53,93},{-71,70,102},{-87,82,107},{-101,79,109}, -{-114,55,108},{-111,-13,104},{-100,-57,91},{-95,-90,88}, -{-93,-105,85},{-97,-117,81},{-106,-119,81},{-127,-121,82}, -{-127,6,93},{-127,27,98},{-85,61,95},{-106,18,96}, -{-110,27,97},{-112,-88,94},{-117,-57,96},{-127,-57,96}, -{-127,-42,95},{-115,-35,100},{-110,-29,102},{-113,-17,100}, -{-122,-16,100},{-127,-26,106},{-121,-19,104},{-115,-20,104}, -{-113,-29,106},{-117,-32,103},{-127,-37,103},{-94,-40,71}, -{-106,-31,91},{-104,-40,91},{-97,-32,71},{-127,-112,88}, -{-121,-111,88},{-115,-105,91},{-115,-95,93},{-127,-100,84}, -{-115,-96,85},{-115,-104,82},{-121,-109,81},{-127,-110,81}, -{-105,28,100},{-103,20,99},{-84,55,97},{-92,54,99}, -{-73,51,99},{-55,45,89},{-52,37,88},{-53,25,87}, -{-66,13,92},{-79,8,95},{-98,14,100},{-104,38,100}, -{-100,48,100},{-97,46,97},{-102,38,97},{-96,16,97}, -{-79,11,93},{-68,15,90},{-57,27,86},{-56,36,86}, -{-59,43,87},{-74,50,96},{-91,51,98},{-84,52,96}, -{-101,22,96},{-102,29,96},{-113,59,78},{-102,85,79}, -{-84,88,76},{-65,71,71},{-40,58,63},{-25,52,59}, -{-28,21,48},{-50,0,53},{-71,-12,60},{-127,115,37}, -{-127,126,-10},{-127,-25,-86},{-127,-59,24},{-127,-125,59}, -{-127,-103,44},{-127,-73,41},{-127,-62,36},{-18,30,7}, -{-17,41,-6},{-28,34,-56},{-68,56,-90},{-33,-6,9}, -{-51,-16,-21},{-45,-1,-55},{-84,7,-85},{-97,-45,52}, -{-104,-53,33},{-90,-91,49},{-95,-64,50},{-85,-117,51}, -{-109,-97,47},{-111,-69,46},{-106,-121,56},{-99,-36,55}, -{-100,-29,60},{-101,-22,64},{-100,-50,21},{-89,-40,-34}, -{-83,-19,-69},{-69,111,-49},{-69,119,-9},{-69,109,30}, -{-68,67,55},{-34,52,43},{-46,58,36},{-45,90,7}, -{-25,72,16},{-25,79,-15},{-45,96,-25},{-45,87,-57}, -{-25,69,-46},{-48,42,-75},{-65,3,-70},{-22,42,-26}, -{-75,-22,19},{-72,-25,-27},{-13,52,-30},{-28,-18,-16}, -{6,-13,-42},{37,7,-55},{46,41,-54},{31,65,-54}, -{4,61,-40},{3,53,-37},{25,56,-50},{35,37,-52}, -{28,10,-52},{5,-5,-39},{-21,-9,-17},{-9,46,-28}, -{-6,39,-37},{-14,-3,-27},{6,0,-47},{25,12,-57}, -{31,32,-57},{23,46,-56},{4,44,-46},{-19,37,-27}, -{-20,22,-35},{-30,12,-35},{-22,11,-35},{-19,2,-35}, -{-23,-2,-35},{-34,0,-9},{-35,-3,-22},{-35,5,-24}, -{-25,26,-27},{-13,31,-34},{-13,30,-41},{-23,-2,-41}, -{-18,2,-41},{-21,10,-41},{-29,12,-41},{-19,22,-41}, -{6,42,-53},{25,44,-62},{34,31,-63},{28,11,-62}, -{7,0,-54},{-14,-2,-34},{-5,37,-44},{-13,14,-42}, -{-7,8,-43},{1,16,-47},{-4,22,-45},{3,30,-48}, -{8,24,-49},{15,27,-50},{12,35,-50},{4,56,-62}, -{33,60,-70},{48,38,-64},{41,7,-68},{6,-11,-63}, -{-26,-16,-42},{-17,49,-49}, -}; - -signed char monkeyf[250][4]= { -{27,4,5,26}, {25,4,5,24}, {3,6,5,4}, {1,6,5,2}, {5,6,7,4}, -{3,6,7,2}, {5,8,7,6}, {3,8,7,4}, {7,8,9,6}, -{5,8,9,4}, {7,10,9,8}, {5,10,9,6}, {9,10,11,8}, -{7,10,11,6}, {9,12,11,10}, {7,12,11,8}, {11,6,13,12}, -{5,4,13,12}, {3,-2,13,12}, {-3,-4,13,12}, {-5,-10,13,12}, -{-11,-12,14,12}, {-13,-18,14,13}, {-19,4,5,13}, {10,12,4,4}, -{10,11,9,9}, {8,7,9,9}, {7,5,6,6}, {6,3,4,4}, -{5,1,2,2}, {4,-1,0,0}, {3,-3,-2,-2}, {22,67,68,23}, -{20,65,66,21}, {18,63,64,19}, {16,61,62,17}, {14,59,60,15}, -{12,19,48,57}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47}, -{18,19,48,47}, {18,19,48,47}, {18,19,48,47}, {18,19,48,47}, -{18,19,48,47}, {18,-9,-8,47}, {18,27,45,46}, {26,55,43,44}, -{24,41,42,54}, {22,39,40,23}, {20,37,38,21}, {18,35,36,19}, -{16,33,34,17}, {14,31,32,15}, {12,39,30,13}, {11,48,45,38}, -{8,36,-19,9}, {8,-20,44,47}, {42,45,46,43}, {18,19,40,39}, -{16,17,38,37}, {14,15,36,35}, {32,44,43,33}, {12,33,32,42}, -{19,44,43,42}, {40,41,42,-27}, {8,9,39,-28}, {15,43,42,16}, -{13,43,42,14}, {11,43,42,12}, {9,-30,42,10}, {37,12,38,-32}, -{-33,37,45,46}, {-33,40,41,39}, {38,40,41,37}, {36,40,41,35}, -{34,40,41,33}, {36,39,38,37}, {35,40,39,38}, {1,2,14,21}, -{1,2,40,13}, {1,2,40,39}, {1,24,12,39}, {-34,36,38,11}, -{35,38,36,37}, {-37,8,35,37}, {-11,-12,-45,40}, {-11,-12,39,38}, -{-11,-12,37,36}, {-11,-12,35,34}, {33,34,40,41}, {33,34,38,39}, -{33,34,36,37}, {33,-52,34,35}, {33,37,36,34}, {33,35,34,34}, -{8,7,37,36}, {-32,7,35,46}, {-34,-33,45,46}, {4,-33,43,34}, -{-34,-33,41,42}, {-34,-33,39,40}, {-34,-33,37,38}, {-34,-33,35,36}, -{-34,-33,33,34}, {-34,-33,31,32}, {-34,-4,28,30}, {-5,-34,28,27}, -{-35,-44,36,27}, {26,35,36,45}, {24,25,44,45}, {25,23,44,42}, -{25,24,41,40}, {25,24,39,38}, {25,24,37,36}, {25,24,35,34}, -{25,24,33,32}, {25,24,31,30}, {15,24,29,38}, {25,24,27,26}, -{23,12,37,26}, {11,12,35,36}, {-86,-59,36,-80}, {-60,-61,36,35}, -{-62,-63,36,35}, {-64,-65,36,35}, {-66,-67,36,35}, {-68,-69,36,35}, -{-70,-71,36,35}, {-72,-73,36,35}, {-74,-75,36,35}, {42,43,53,58}, -{40,41,57,56}, {38,39,55,57}, {-81,-80,37,56}, {-83,-82,55,52}, -{-85,-84,51,49}, {-87,-86,48,49}, {47,50,51,48}, {46,48,51,49}, -{43,46,49,44}, {-92,-91,45,42}, {-23,49,50,-20}, {-94,40,48,-24}, -{-96,-22,48,49}, {-97,48,21,-90}, {-100,36,50,23}, {22,49,48,-100}, -{-101,47,46,22}, {21,45,35,25}, {33,34,44,41}, {13,14,28,24}, -{-107,26,30,-106}, {14,46,45,15}, {14,44,43,-110}, {-111,42,23,-110}, -{6,7,45,46}, {45,44,47,46}, {45,46,47,48}, {47,46,49,48}, -{17,49,47,48}, {17,36,46,48}, {35,36,44,45}, {35,36,40,43}, -{35,36,38,39}, {-4,-3,37,35}, {-123,34,33,1}, {-9,-8,-7,-6}, -{-10,-7,32,-125}, {-127,-11,-126,-126}, {-7,-6,5,31}, {4,5,33,30}, -{4,39,33,32}, {4,35,32,38}, {20,21,39,38}, {4,37,38,5}, -{-11,-10,36,3}, {-11,15,14,35}, {13,16,34,34}, {-13,14,13,13}, -{-3,1,30,29}, {-3,28,29,1}, {-2,31,28,-1}, {12,13,27,30}, -{-2,26,12,12}, {35,29,42,36}, {34,35,36,33}, {32,35,36,31}, -{30,35,36,29}, {28,35,36,27}, {26,35,36,25}, {34,39,38,35}, -{32,39,38,33}, {30,39,38,31}, {28,39,38,29}, {26,39,38,27}, -{25,31,32,38}, {-18,-17,45,44}, {-18,17,28,44}, {-24,-20,42,-23}, -{11,35,27,14}, {25,28,39,41}, {37,41,40,38}, {34,40,36,35}, -{32,40,39,33}, {30,39,31,40}, {21,29,39,22}, {-31,37,28,4}, -{-32,33,35,36}, {32,33,34,34}, {18,35,36,48}, {34,25,40,35}, -{24,25,38,39}, {24,25,36,37}, {24,25,34,35}, {24,25,32,33}, -{24,13,41,31}, {17,11,41,35}, {15,16,34,35}, {13,14,34,35}, -{11,12,34,35}, {9,10,34,35}, {7,8,34,35}, {26,25,37,36}, -{35,36,37,38}, {37,36,39,38}, {37,38,39,40}, {25,31,36,39}, -{18,34,35,30}, {17,22,30,33}, {19,29,21,20}, {16,26,29,17}, -{24,29,28,25}, {22,31,28,23}, {20,31,30,21}, {18,31,30,19}, -{16,30,17,17}, {-21,-22,35,34}, {-21,-22,33,32}, {-21,-22,31,30}, -{-21,-22,29,28}, {-21,-22,27,26}, {-28,-22,25,31}, {24,28,29,30}, -{23,24,26,27}, {23,24,25,25}, {-69,-35,-32,27}, {-70,26,25,-66}, -{-68,-67,24,-33}, -}; diff --git a/source/blender/src/cre/license.jpeg.c b/source/blender/src/cre/license.jpeg.c deleted file mode 100644 index 880d3dbde2e..00000000000 --- a/source/blender/src/cre/license.jpeg.c +++ /dev/null @@ -1,38 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -int datatoc_tonize= 0; -char datatoc_ton[]= {0}; diff --git a/source/blender/src/cre/license_key.c b/source/blender/src/cre/license_key.c deleted file mode 100644 index 4daa7628f53..00000000000 --- a/source/blender/src/cre/license_key.c +++ /dev/null @@ -1,197 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include "license_key.h" -#include "keyed_functions.h" -#include "BKE_utildefines.h" -#include "BIF_screen.h" // splash -#include "BIF_toolbox.h" -#include -#include -#include "BLO_readfile.h" -//#include "BLO_keyStore.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -int LICENSE_KEY_VALID = TRUE; -int I_AM_PUBLISHER = TRUE; - -// Python stuff - -#include "Python.h" -#include "marshal.h" -#include "compile.h" /* to give us PyCodeObject */ -#include "eval.h" /* prototype for PyEval_EvalCode */ - -#include "BPY_extern.h" -#include "IMB_imbuf.h" - -Fptr g_functab[PYKEY_TABLEN]; -Fptr g_ptrtab[PYKEY_TABLEN]; - -static int g_seed[3] = PYKEY_SEED; -static PyObject *g_module_self; -static PyObject *g_main; - - -// end Python stuff - -// **************** PYTHON STUFF ************************** -/* ----------------------------------------------------- */ -/* this is the dummy functions to demonstrate */ - -int sticky_shoes(void *vp) -{ -#ifndef NDEBUG - printf("feature not enabled: Buy our Key NOW!\n"); -#endif - return 0; -} - -/* -int key_func1(void *vp) { - printf("function 1 called\n"); -} - -*/ -int key_return_true(void *vp) { -#ifndef NDEBUG - printf("function 2 called (return true)\n"); -#endif - return 1; -} - -/* ----------------------------------------------------- */ - -/* Declarations for objects of type Fplist */ - - -#ifndef NDEBUG -void feature1(void) -{ - Fptr f; - - printf("feature 2 called\n"); - f = g_ptrtab[KEY_FUNC2]; - if (f) f(0); -} - -void feature2(void) -{ - Fptr f; - - printf("feature 3 called\n"); - f = g_ptrtab[KEY_FUNC3]; - if (f) f(0); -} - -#endif - - -/* Initialization function for the module (*must* be called initprot) */ - -static void init_ftable(void) // initializes functiontable -{ - int i; - - g_functab[0] = &key_func1; - - for (i = 1; i < PYKEY_TABLEN; i++) - { - g_functab[i] = &sticky_shoes; - } - - // for debugging perposes - /* - for (i = 0; i < PYKEY_TABLEN; i++) - { - g_functab[i] = (Fptr *) (i + 100); - } - */ -} - - -static void init_ptable(void) // initializes functiontable -{ - int i; - - for (i = 0; i < PYKEY_TABLEN; i++) - { - g_ptrtab[i] = &sticky_shoes; - } -} - - -#ifdef NDEBUG -static void print_ptable(void) -{ - int i; - - for (i = 0; i < PYKEY_TABLEN; i++) - { - printf ("index[%02d] = %08x\n", i, g_ptrtab[i]); - } -} -#endif - -static void insertname(PyObject *m,PyObject *p, char *name) -{ -} - -/* initialisation */ -static void initprot() -{ - init_ftable(); // malloc - init_ptable(); // malloc -} - -// ******************************* KEY STUFF ********************* - -void create_key_name(char * keyname) -{ -} - -void checkhome() -{ - initprot(); // initialize module and function tables - -} - -void SHOW_LICENSE_KEY(void) -{ -} - -void loadKeyboard(char * name) -{ -} diff --git a/source/blender/src/cursors.c b/source/blender/src/cursors.c deleted file mode 100644 index ea10d2e9b3e..00000000000 --- a/source/blender/src/cursors.c +++ /dev/null @@ -1,840 +0,0 @@ -/** -* $Id$ -* -* ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. The Blender -* Foundation also sells licenses for use in proprietary software under -* the Blender License. See http://www.blender.org/BL/ for information -* about this. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -* -* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. -* All rights reserved. -* -* The Original Code is: all of this file. -* -* Contributor(s): none yet. -* -* ***** END GPL/BL DUAL LICENSE BLOCK ***** -*/ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_listBase.h" -#include "DNA_userdef_types.h" - -#include "BIF_cursors.h" -#include "BIF_resources.h" -#include "BIF_graphics.h" -#include "BIF_screen.h" - -#include "winlay.h" - - -/* ****************************************************************** -Cursor Description: - -Each bit represents a pixel, so 1 byte = 8 pixels, -the bytes go Left to Right. Top to bottom -the bits in a byte go right to left -(ie; 0x01, 0x80 represents a line of 16 pix with the first and last pix set.) - -A 0 in the bitmap = bg_color, a 1 fg_color -a 0 in the mask = transparent pix. - -Until 32x32 cursors are supported on all platforms, the size of the -small cursors MUST be 16x16. - -Large cursors have a MAXSIZE of 32x32. - -Other than that, the specified size of the cursors is just a guideline, -However, the char array that defines the BM and MASK must be byte aligned. -ie a 17x17 cursor needs 3 bytes (cols) * 17 bytes (rows) -(3 bytes = 17 bits rounded up to nearest whole byte). Pad extra bits -in mask with 0's. - -Setting big_bm=NULL disables the large version of the cursor. - -******************************************************************* - -There is a nice Python GUI utility that can be used for drawing cursors in -this format in the Blender source distribution, in -blender/source/tools/MakeCursor.py . Start it with $ python MakeCursor.py -It will copy its output to the console when you press 'Do it'. - -*/ - -/* Because defining a cursor mixes declarations and executable code - each cursor needs it's own scoping block or it would be split up - over several hundred lines of code. To enforce/document this better - I define 2 pretty braindead macros so it's obvious what the extra "[]" - are for */ - -#define BEGIN_CURSOR_BLOCK { -#define END_CURSOR_BLOCK } - -/* Cursor Globals */ -static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs */ -static short CurrentCursor=-1, LastCursor=-1; - -short GetBlenderCursor(void) { - return CurrentCursor; -} - -void SetBlenderCursor(short curs){ - Window *win; - - if ((curs=BC_NUMCURSORS)) return; - - win=winlay_get_active_window(); - - if (win==NULL) return; /* Can't set custom cursor before Window init */ - - LastCursor=CurrentCursor; - CurrentCursor=curs; - - if (curs==LASTCURSOR) curs=LastCursor; - - if (curs==SYSCURSOR) { /* System default Cursor */ - window_set_cursor(win, CURSOR_STD); - //set_cursor(CURSOR_STD); - } - else if ( (U.curssize==0) || (BlenderCursor[curs]->big_bm == NULL) ) { - window_set_custom_cursor_ex(win, BlenderCursor[curs], 0); - } - else { - window_set_custom_cursor_ex(win, BlenderCursor[curs], 1); - } -} - -/* unused no prototypes -short GetCurrentCursor(void){ - return(CurrentCursor); -} -*/ - -void InitCursorData(void){ - - /********************** NW_ARROW Cursor **************************/ -BEGIN_CURSOR_BLOCK - static char nw_sbm[]={ - 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00, - 0x21, 0x00, 0x41, 0x00, 0x81, 0x00, 0x01, 0x01, - 0x01, 0x02, 0xc1, 0x03, 0x49, 0x00, 0x8d, 0x00, - 0x8b, 0x00, 0x10, 0x01, 0x90, 0x01, 0x60, 0x00, - }; - - static char nw_smsk[]={ - 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, - 0x3f, 0x00, 0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, - 0xff, 0x03, 0xff, 0x03, 0x7f, 0x00, 0xff, 0x00, - 0xfb, 0x00, 0xf0, 0x01, 0xf0, 0x01, 0x60, 0x00, - }; - - static BCursor NWArrowCursor = { - /*small*/ - nw_sbm, nw_smsk, - 16, 16, - 6, 7, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_NW_ARROWCURSOR]=&NWArrowCursor; -END_CURSOR_BLOCK - - ///********************** NS_ARROW Cursor *************************/ -BEGIN_CURSOR_BLOCK - static char ns_sbm[]={ - 0x40, 0x01, 0x20, 0x02, 0x10, 0x04, 0x08, 0x08, - 0x04, 0x10, 0x3c, 0x1e, 0x20, 0x02, 0x20, 0x02, - 0x20, 0x02, 0x20, 0x02, 0x3c, 0x1e, 0x04, 0x10, - 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01 - }; - - static char ns_smsk[]={ - 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, - 0xfc, 0x1f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0, 0x03, - 0xe0, 0x03, 0xe0, 0x03, 0xfc, 0x1f, 0xfc, 0x1f, - 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01 - }; - - static BCursor NSArrowCursor = { - /*small*/ - ns_sbm, ns_smsk, - 16, 16, - 6, 7, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_NS_ARROWCURSOR]=&NSArrowCursor; - -END_CURSOR_BLOCK - /********************** EW_ARROW Cursor *************************/ -BEGIN_CURSOR_BLOCK - static char ew_sbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c, - 0x2c, 0x34, 0xe6, 0x67, 0x03, 0xc0, 0x01, 0x80, - 0x03, 0xc0, 0xe6, 0x67, 0x2c, 0x34, 0x38, 0x1c, - 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - - static char ew_smsk[]={ - 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x38, 0x1c, - 0x3c, 0x3c, 0xfe, 0x7f, 0xff, 0xff, 0x3f, 0xfc, - 0xff, 0xff, 0xfe, 0x7f, 0x3c, 0x3c, 0x38, 0x1c, - 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - - static BCursor EWArrowCursor = { - /*small*/ - ew_sbm, ew_smsk, - 16, 16, - 7, 6, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_EW_ARROWCURSOR]=&EWArrowCursor; -END_CURSOR_BLOCK - - /********************** Wait Cursor *****************************/ -BEGIN_CURSOR_BLOCK - static char wait_sbm[]={ - 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0x84, 0x21, - 0xc8, 0x13, 0xd0, 0x0b, 0xa0, 0x04, 0x20, 0x05, - 0xa0, 0x04, 0x10, 0x09, 0x88, 0x11, 0xc4, 0x23, - 0xe2, 0x47, 0xfa, 0x5f, 0x02, 0x40, 0xfe, 0x7f, - }; - - static char wait_smsk[]={ - 0xfe, 0x7f, 0xfe, 0x7f, 0x06, 0x60, 0x8c, 0x31, - 0xd8, 0x1b, 0xf0, 0x0f, 0xe0, 0x06, 0x60, 0x07, - 0xe0, 0x06, 0x30, 0x0d, 0x98, 0x19, 0xcc, 0x33, - 0xe6, 0x67, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, - }; - - static char wait_lbm[]={ - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30, - 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x18, - 0x18, 0xc0, 0x03, 0x0c, 0x30, 0x20, 0x07, 0x06, - 0x60, 0xf0, 0x0f, 0x03, 0xc0, 0xd0, 0x8d, 0x01, - 0x80, 0x79, 0xcf, 0x00, 0x00, 0xf3, 0x67, 0x00, - 0x00, 0x66, 0x37, 0x00, 0x00, 0x8c, 0x33, 0x00, - 0x00, 0x0c, 0x32, 0x00, 0x00, 0xcc, 0x33, 0x00, - 0x00, 0x8c, 0x30, 0x00, 0x00, 0x46, 0x61, 0x00, - 0x00, 0x03, 0xc3, 0x00, 0x80, 0x01, 0x83, 0x01, - 0xc0, 0xc0, 0x03, 0x03, 0x60, 0xa0, 0x05, 0x06, - 0x30, 0xf0, 0x0f, 0x0c, 0x18, 0xf8, 0x1d, 0x18, - 0x0c, 0x5c, 0x3f, 0x30, 0x0c, 0xff, 0x5f, 0x30, - 0x0c, 0xf7, 0xfe, 0x31, 0xcc, 0xfb, 0x9f, 0x33, - 0x0c, 0x00, 0x00, 0x30, 0x0c, 0x00, 0x00, 0x30, - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - }; - - static char wait_lmsk[]={ - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - 0x3c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x1e, - 0x78, 0xc0, 0x03, 0x0f, 0xf0, 0xa0, 0x87, 0x07, - 0xe0, 0xf1, 0xcf, 0x03, 0xc0, 0xf3, 0xef, 0x01, - 0x80, 0xff, 0xff, 0x00, 0x00, 0xff, 0x7f, 0x00, - 0x00, 0xfe, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, - 0x00, 0x3c, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, - 0x00, 0xbc, 0x3c, 0x00, 0x00, 0xde, 0x79, 0x00, - 0x00, 0x0f, 0xf3, 0x00, 0x80, 0x07, 0xe3, 0x01, - 0xc0, 0xc3, 0xc3, 0x03, 0xe0, 0xe1, 0x87, 0x07, - 0xf0, 0xf0, 0x0f, 0x0f, 0x78, 0xf8, 0x1f, 0x1e, - 0x3c, 0x7c, 0x3f, 0x3c, 0x3c, 0xff, 0x7f, 0x3c, - 0xbc, 0xff, 0xff, 0x3d, 0xfc, 0xfb, 0xbf, 0x3f, - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, - }; - - static BCursor WaitCursor = { - /*small*/ - wait_sbm, wait_smsk, - 16, 16, - 7, 7, - /*big*/ - wait_lbm, wait_lmsk, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_WAITCURSOR]=&WaitCursor; -END_CURSOR_BLOCK - - /********************** Cross Cursor ***************************/ -BEGIN_CURSOR_BLOCK - static char cross_sbm[]={ - 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x7e, 0x7e, - 0x7e, 0x7e, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00, - }; - - static char cross_smsk[]={ - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, - 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03, 0x7f, 0xfe, - 0x7f, 0xfe, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, - }; - static char cross_lbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, - 0x00, 0xc0, 0x03, 0x00, 0x00, 0x40, 0x02, 0x00, - 0x00, 0x78, 0x1e, 0x00, 0xfc, 0x1f, 0xf8, 0x3f, - 0xfc, 0x1f, 0xf8, 0x3f, 0x00, 0x78, 0x1e, 0x00, - 0x00, 0x40, 0x02, 0x00, 0x00, 0xc0, 0x03, 0x00, - 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }; - - static char cross_lmsk[]={ - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, - 0x00, 0xe0, 0x07, 0x00, 0x00, 0x70, 0x0e, 0x00, - 0x00, 0x78, 0x1e, 0x00, 0xff, 0x1f, 0xf8, 0xff, - 0xff, 0x1f, 0xf8, 0xff, 0x00, 0x78, 0x1e, 0x00, - 0x00, 0x70, 0x0e, 0x00, 0x00, 0xe0, 0x07, 0x00, - 0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, - }; - - static BCursor CrossCursor = { - /*small*/ - cross_sbm, cross_smsk, - 16, 16, - 7, 7, - /*big*/ - cross_lbm, cross_lmsk, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_CROSSCURSOR]=&CrossCursor; -END_CURSOR_BLOCK - - /********************** EditCross Cursor ***********************/ -BEGIN_CURSOR_BLOCK - static char editcross_sbm[]={ - 0x0e, 0x00, 0x11, 0x00, 0x1d, 0x00, 0x19, 0x03, - 0x1d, 0x03, 0x11, 0x03, 0x0e, 0x03, 0x00, 0x03, - 0xf8, 0x7c, 0xf8, 0x7c, 0x00, 0x03, 0x00, 0x03, - 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, - }; - - static char editcross_smsk[]={ - 0x0e, 0x00, 0x1f, 0x00, 0x1f, 0x03, 0x1f, 0x03, - 0x1f, 0x03, 0x1f, 0x03, 0x0e, 0x03, 0x80, 0x07, - 0xfc, 0xfc, 0xfc, 0xfc, 0x80, 0x07, 0x00, 0x03, - 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, - }; - - static BCursor EditCrossCursor = { - /*small*/ - editcross_sbm, editcross_smsk, - 16, 16, - 9, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_EDITCROSSCURSOR]=&EditCrossCursor; -END_CURSOR_BLOCK - - /********************** Box Select *************************/ -BEGIN_CURSOR_BLOCK - static char box_sbm[32]={ - 0x7f, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x06, - 0x41, 0x06, 0x41, 0x06, 0x7f, 0x06, 0x00, 0x06, - 0xe0, 0x79, 0xe0, 0x79, 0x00, 0x06, 0x00, 0x06, - 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, - }; - - static char box_smsk[32]={ - 0x7f, 0x00, 0x7f, 0x00, 0x63, 0x06, 0x63, 0x06, - 0x63, 0x06, 0x7f, 0x06, 0x7f, 0x06, 0x00, 0x0f, - 0xf0, 0xf9, 0xf0, 0xf9, 0x00, 0x0f, 0x00, 0x06, - 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, - - }; - - static BCursor BoxSelCursor = { - /*small*/ - box_sbm, box_smsk, - 16, 16, - 9, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_BOXSELCURSOR]=&BoxSelCursor; - -END_CURSOR_BLOCK - /********************** Knife Cursor ***********************/ -BEGIN_CURSOR_BLOCK - static char knife_sbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x2c, - 0x00, 0x5a, 0x00, 0x34, 0x00, 0x2a, 0x00, 0x17, - 0x80, 0x06, 0x40, 0x03, 0xa0, 0x03, 0xd0, 0x01, - 0x68, 0x00, 0x1c, 0x00, 0x06, 0x00, 0x00, 0x00 - }; - - static char knife_smsk[]={ - 0x00, 0x60, 0x00, 0xf0, 0x00, 0xfc, 0x00, 0xfe, - 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x7f, 0x80, 0x3f, - 0xc0, 0x0e, 0x60, 0x07, 0xb0, 0x07, 0xd8, 0x03, - 0xec, 0x01, 0x7e, 0x00, 0x1f, 0x00, 0x07, 0x00 - }; - - static char knife_lbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1c, - 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x7f, - 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0xc0, 0x5f, - 0x00, 0x00, 0xc0, 0x6f, 0x00, 0x00, 0xc0, 0x37, - 0x00, 0x00, 0xa8, 0x1b, 0x00, 0x00, 0x54, 0x0d, - 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x54, 0x00, - 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x53, 0x00, - 0x00, 0xc0, 0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, - 0x00, 0xd0, 0x0f, 0x00, 0x00, 0xe8, 0x07, 0x00, - 0x00, 0xf4, 0x07, 0x00, 0x00, 0xfa, 0x00, 0x00, - 0x00, 0x3d, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, - 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, - 0x30, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - }; - - static char knife_lmsk[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, - 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x7e, - 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x80, 0xff, - 0x00, 0x00, 0xc0, 0xbf, 0x00, 0x00, 0xe0, 0xdf, - 0x00, 0x00, 0xe0, 0xef, 0x00, 0x00, 0xf8, 0x77, - 0x00, 0x00, 0xfc, 0x3b, 0x00, 0x00, 0xfe, 0x1d, - 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xfe, 0x01, - 0x00, 0x00, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x00, - 0x00, 0xe0, 0x7f, 0x00, 0x00, 0xf0, 0x1f, 0x00, - 0x00, 0xd8, 0x1f, 0x00, 0x00, 0xec, 0x0f, 0x00, - 0x00, 0xf6, 0x0f, 0x00, 0x00, 0xfb, 0x06, 0x00, - 0x80, 0xbd, 0x01, 0x00, 0xc0, 0x6e, 0x00, 0x00, - 0xe0, 0x1b, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00, - 0xb8, 0x01, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, - 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - }; - - static BCursor KnifeCursor = { - /*small*/ - knife_sbm, knife_smsk, - 16, 16, - 0, 15, - /*big*/ - knife_lbm, knife_lmsk, - 32,32, - 0, 31, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_KNIFECURSOR]=&KnifeCursor; - -END_CURSOR_BLOCK - - /********************** Loop Select Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char vloop_sbm[]={ - 0x00, 0x00, 0x7e, 0x00, 0x3e, 0x00, 0x1e, 0x00, - 0x0e, 0x00, 0x66, 0x60, 0x62, 0x6f, 0x00, 0x00, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x00, 0x00, 0x60, 0x60, 0x60, 0x6f, 0x00, 0x00, -}; - -static char vloop_smsk[]={ - 0xff, 0x01, 0xff, 0x00, 0x7f, 0x00, 0x3f, 0x00, - 0xff, 0xf0, 0xff, 0xff, 0xf7, 0xff, 0xf3, 0xf0, - 0x61, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, - 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xf0, -}; - - - -static char vloop_lbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0x3f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, - 0xfc, 0x0f, 0x00, 0x00, 0xfc, 0x0f, 0x00, 0x00, - 0xfc, 0x03, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, - 0xfc, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, - 0x3c, 0x3c, 0x00, 0x3c, 0x3c, 0x3c, 0x00, 0x3c, - 0x0c, 0x3c, 0xff, 0x3c, 0x0c, 0x3c, 0xff, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, - 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, - 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, - 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, - 0x00, 0x3c, 0xff, 0x3c, 0x00, 0x3c, 0xff, 0x3c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static char vloop_lmsk[]={ - 0xff, 0xff, 0x03, 0x00, 0xff, 0xff, 0x03, 0x00, - 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, - 0xff, 0x3f, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, - 0xff, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, - 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x3f, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, - 0x0f, 0xff, 0x00, 0xff, 0x0f, 0xff, 0x00, 0xff, - 0x03, 0x3c, 0x00, 0x3c, 0x03, 0x3c, 0x00, 0x3c, - 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, - 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, - 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x3c, - 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, - 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, - 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, - 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, -}; - - - - static BCursor VLoopCursor = { - /*small*/ - vloop_sbm, vloop_smsk, - 16, 16, - 0, 0, - /*big*/ - vloop_lbm, vloop_lmsk, - 32,32, - 0, 0, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_VLOOPCURSOR]=&VLoopCursor; - -END_CURSOR_BLOCK - - - /********************** TextEdit Cursor ***********************/ -BEGIN_CURSOR_BLOCK - static char textedit_sbm[]={ - 0xe0, 0x03, 0x10, 0x04, 0x60, 0x03, 0x40, 0x01, - 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, - 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, - 0x40, 0x01, 0x60, 0x03, 0x10, 0x04, 0xe0, 0x03, - }; - - static char textedit_smsk[]={ - 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, 0xc0, 0x01, - 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, - 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, - 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xe0, 0x03, - }; - - static BCursor TextEditCursor = { - /*small*/ - textedit_sbm, textedit_smsk, - 16, 16, - 9, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_TEXTEDITCURSOR]=&TextEditCursor; -END_CURSOR_BLOCK - - - /********************** Paintbrush Cursor ***********************/ -BEGIN_CURSOR_BLOCK - static char paintbrush_sbm[]={ - - 0x00, 0xe0, 0x00, 0x98, 0x00, 0x44, 0x00, 0x42, - 0x00, 0x21, 0x80, 0x20, 0x40, 0x13, 0x40, 0x17, - 0xa0, 0x0b, 0x98, 0x05, 0x04, 0x02, 0x02, 0x01, - 0x02, 0x01, 0x02, 0x01, 0x81, 0x00, 0x7f, 0x00, - - - - }; - - static char paintbrush_smsk[]={ - 0x00, 0xe0, 0x00, 0xf8, 0x00, 0x7c, 0x00, 0x7e, - 0x00, 0x3f, 0x80, 0x3f, 0xc0, 0x1f, 0xc0, 0x1f, - 0xe0, 0x0f, 0xf8, 0x07, 0xfc, 0x03, 0xfe, 0x01, - 0xfe, 0x01, 0xfe, 0x01, 0xff, 0x00, 0x7f, 0x00, - - - }; - - static BCursor PaintBrushCursor = { - /*small*/ - paintbrush_sbm, paintbrush_smsk, - 16, 16, - 0, 15, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE - }; - - BlenderCursor[BC_PAINTBRUSHCURSOR]=&PaintBrushCursor; -END_CURSOR_BLOCK - - -/********************** Hand Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char hand_sbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x0d, - 0x98, 0x6d, 0x98, 0x6d, 0xb0, 0x6d, 0xb0, 0x6d, - 0xe0, 0x6f, 0xe6, 0x7f, 0xee, 0x7f, 0xfc, 0x3f, - 0xf8, 0x3f, 0xf0, 0x1f, 0xc0, 0x1f, 0xc0, 0x1f, -}; - -static char hand_smsk[]={ - 0x00, 0x00, 0x80, 0x01, 0xc0, 0x0f, 0xd8, 0x7f, - 0xfc, 0xff, 0xfc, 0xff, 0xf8, 0xff, 0xf8, 0xff, - 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, - 0xfc, 0x7f, 0xf8, 0x3f, 0xf0, 0x3f, 0xe0, 0x3f, -}; - - -static BCursor HandCursor = { - /*small*/ - hand_sbm, hand_smsk, - 16, 16, - 8, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE -}; - -BlenderCursor[BC_HANDCURSOR]=&HandCursor; - -END_CURSOR_BLOCK - -/********************** NSEW Scroll Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char nsewscroll_sbm[]={ - 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70, - 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00, -}; - -static char nsewscroll_smsk[]={ - 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07, - 0xc0, 0x03, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8, - 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0xc0, 0x03, - 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, -}; - - -static BCursor NSEWScrollCursor = { - /*small*/ - nsewscroll_sbm, nsewscroll_smsk, - 16, 16, - 8, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE -}; - -BlenderCursor[BC_NSEW_SCROLLCURSOR]=&NSEWScrollCursor; - -END_CURSOR_BLOCK - - -/********************** NS Scroll Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char nsscroll_sbm[]={ - 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xc0, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00, -}; - -static char nsscroll_smsk[]={ - 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xe0, 0x07, - 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, - 0xe0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, -}; - - -static BCursor NSScrollCursor = { - /*small*/ - nsscroll_sbm, nsscroll_smsk, - 16, 16, - 8, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE -}; - -BlenderCursor[BC_NS_SCROLLCURSOR]=&NSScrollCursor; - -END_CURSOR_BLOCK - - -/********************** EW Scroll Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char ewscroll_sbm[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0e, 0x70, - 0x0e, 0x70, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static char ewscroll_smsk[]={ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x30, 0x1e, 0x78, 0x1f, 0xf8, - 0x1f, 0xf8, 0x1e, 0x78, 0x0c, 0x30, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - - -static BCursor EWScrollCursor = { - /*small*/ - ewscroll_sbm, ewscroll_smsk, - 16, 16, - 8, 8, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE -}; - -BlenderCursor[BC_EW_SCROLLCURSOR]=&EWScrollCursor; - -END_CURSOR_BLOCK - -/********************** Eyedropper Cursor ***********************/ -BEGIN_CURSOR_BLOCK - -static char eyedropper_sbm[]={ - 0x00, 0x30, 0x00, 0x48, 0x00, 0x85, 0x80, 0x82, - 0x40, 0x40, 0x80, 0x20, 0x40, 0x11, 0xa0, 0x23, - 0xd0, 0x15, 0xe8, 0x0a, 0x74, 0x01, 0xb4, 0x00, - 0x4a, 0x00, 0x35, 0x00, 0x08, 0x00, 0x04, 0x00, -}; - -static char eyedropper_smsk[]={ - 0x00, 0x30, 0x00, 0x78, 0x00, 0xfd, 0x80, 0xff, - 0xc0, 0x7f, 0x80, 0x3f, 0xc0, 0x1f, 0xe0, 0x3f, - 0xf0, 0x1f, 0xf8, 0x0b, 0xfc, 0x01, 0xfc, 0x00, - 0x7e, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x04, 0x00, -}; - - -static BCursor EyedropperCursor = { - /*small*/ - eyedropper_sbm, eyedropper_smsk, - 16, 16, - 1, 15, - /*big*/ - NULL, NULL, - 32,32, - 15, 15, - /*color*/ - BC_BLACK, BC_WHITE -}; - -BlenderCursor[BC_EYEDROPPER_CURSOR]=&EyedropperCursor; - -END_CURSOR_BLOCK - -/********************** Put the cursors in the array ***********************/ - - - -} - - - diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c deleted file mode 100644 index 58dfdd89df2..00000000000 --- a/source/blender/src/drawaction.c +++ /dev/null @@ -1,1294 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Joshua Leung - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Drawing routines for the Action window type - */ - -/* System includes ----------------------------------------------------- */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -/* Types --------------------------------------------------------------- */ -#include "DNA_listBase.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_constraint_types.h" -#include "DNA_key_types.h" - -#include "BKE_action.h" -#include "BKE_depsgraph.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" - -/* Everything from source (BIF, BDR, BSE) ------------------------------ */ - -#include "BIF_editaction.h" -#include "BIF_editkey.h" -#include "BIF_editnla.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" - -#include "BDR_drawaction.h" -#include "BDR_editcurve.h" - -#include "BSE_drawnla.h" -#include "BSE_drawipo.h" -#include "BSE_editaction_types.h" -#include "BSE_editipo.h" -#include "BSE_time.h" -#include "BSE_view.h" - -/* 'old' stuff": defines and types, and own include -------------------- */ - -#include "blendef.h" -#include "mydevice.h" - -/********************************** Slider Stuff **************************** */ - -/* sliders for shapekeys */ -static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key) -{ - int i; - char str[64]; - float x, y; - uiBlock *block; - uiBut *but; - -#define XIC 20 -#define YIC 20 - - /* lets make the rvk sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375, curarea->winx-0.375, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS, UI_HELV, curarea->win); - - x = NAMEWIDTH + 1; - y = 0.0f; - - /* make the little 'open the sliders' widget */ - // should eventually be removed - BIF_ThemeColor(TH_FACE); // this slot was open... (???... Aligorith) - glRects(2, y + 2*CHANNELHEIGHT - 2, ACTWIDTH - 2, y + CHANNELHEIGHT + 2); - glColor3ub(0, 0, 0); - glRasterPos2f(4, y + CHANNELHEIGHT + 6); - BMF_DrawString(G.font, "Sliders"); - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (!(G.saction->flag & SACTION_SLIDERS)) { - ACTWIDTH = NAMEWIDTH; - but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_RIGHT, - NAMEWIDTH - XIC - 5, y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Show action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - - } - else { - but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_DOWN, - NAMEWIDTH - XIC - 5, y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Hide action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - - ACTWIDTH = NAMEWIDTH + SLIDERWIDTH; - - /* sliders are open so draw them */ - BIF_ThemeColor(TH_FACE); - - glRects(NAMEWIDTH, 0, NAMEWIDTH+SLIDERWIDTH, curarea->winy); - uiBlockSetEmboss(block, UI_EMBOSS); - for (i=1; i < key->totkey; i++) { - make_rvk_slider(block, ob, i, - x, y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys"); - - y-=CHANNELHEIGHT+CHANNELSKIP; - - /* see sliderval array in editkey.c */ - if(i >= 255) break; - } - } - uiDrawBlock(block); - -} - -static void icu_slider_func(void *voidicu, void *voidignore) -{ - /* the callback for the icu sliders ... copies the - * value from the icu->curval into a bezier at the - * right frame on the right ipo curve (creating both the - * ipo curve and the bezier if needed). - */ - IpoCurve *icu= voidicu; - BezTriple *bezt=NULL; - float cfra, icuval; - - cfra = frame_to_float(CFRA); - if (G.saction->pin==0 && OBACT) - cfra= get_action_frame(OBACT, cfra); - - /* if the ipocurve exists, try to get a bezier - * for this frame - */ - bezt = get_bezt_icu_time(icu, &cfra, &icuval); - - /* create the bezier triple if one doesn't exist, - * otherwise modify it's value - */ - if (bezt == NULL) { - insert_vert_icu(icu, cfra, icu->curval, 0); - } - else { - bezt->vec[1][1] = icu->curval; - } - - /* make sure the Ipo's are properly processed and - * redraw as necessary - */ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - - /* nla-update (in case this affects anything) */ - synchronize_action_strips(); - - /* do redraw pushes, and also the depsgraph flushes */ - if (OBACT->pose || ob_get_key(OBACT)) - DAG_object_flush_update(G.scene, OBACT, OB_RECALC); - else - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWBUTSALL, 0); -} - -static void make_icu_slider(uiBlock *block, IpoCurve *icu, - int x, int y, int w, int h, char *tip) -{ - /* create a slider for the ipo-curve*/ - uiBut *but; - - if(icu==NULL) return; - - if (IS_EQ(icu->slide_max, icu->slide_min)) { - if (IS_EQ(icu->ymax, icu->ymin)) { - if (ELEM(icu->blocktype, ID_CO, ID_KE)) { - /* hack for constraints and shapekeys (and maybe a few others) */ - icu->slide_min= 0.0; - icu->slide_max= 1.0; - } - else { - icu->slide_min= -100; - icu->slide_max= 100; - } - } - else { - icu->slide_min= icu->ymin; - icu->slide_max= icu->ymax; - } - } - if (icu->slide_min >= icu->slide_max) { - SWAP(float, icu->slide_min, icu->slide_max); - } - - but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "", - x, y , w, h, - &(icu->curval), icu->slide_min, icu->slide_max, - 10, 2, tip); - - uiButSetFunc(but, icu_slider_func, icu, NULL); - - // no hilite, the winmatrix is not correct later on... - uiButSetFlag(but, UI_NO_HILITE); -} - -/* sliders for ipo-curves of active action-channel */ -static void action_icu_buts(SpaceAction *saction) -{ - bAction *act= saction->action; - bActionChannel *achan; - bConstraintChannel *conchan; - IpoCurve *icu; - char str[64]; - float x, y; - uiBlock *block; - - /* lets make the action sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375, curarea->winx-0.375, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, - UI_EMBOSS, UI_HELV, curarea->win); - - x = NAMEWIDTH + 1; - y = 0.0f; - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (G.saction->flag & SACTION_SLIDERS) { - /* sliders are open so draw them */ - - /* draw backdrop first */ - BIF_ThemeColor(TH_FACE); // change this color... it's ugly - glRects(NAMEWIDTH, G.v2d->cur.ymin, NAMEWIDTH+SLIDERWIDTH, G.v2d->cur.ymax); - - uiBlockSetEmboss(block, UI_EMBOSS); - for (achan=act->chanbase.first; achan; achan= achan->next) { - if(VISIBLE_ACHAN(achan)) { - y-=CHANNELHEIGHT+CHANNELSKIP; - - if (EXPANDED_ACHAN(achan)) { - if (achan->ipo) { - y-=CHANNELHEIGHT+CHANNELSKIP; - - if (FILTER_IPO_ACHAN(achan)) { - for (icu= achan->ipo->curve.first; icu; icu=icu->next) { - if (achan->flag & ACHAN_HILIGHTED) { - make_icu_slider(block, icu, - x, y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of IPO-Curve"); - } - - y-=CHANNELHEIGHT+CHANNELSKIP; - } - } - } - - if (achan->constraintChannels.first) { - y-=CHANNELHEIGHT+CHANNELSKIP; - - if (FILTER_CON_ACHAN(achan)) { - for (conchan= achan->constraintChannels.first; conchan; conchan=conchan->next) { - if ((achan->flag & ACHAN_HILIGHTED) && EDITABLE_CONCHAN(conchan)) { - icu= (IpoCurve *)conchan->ipo->curve.first; - make_icu_slider(block, icu, - x, y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of Constraint Channel"); - } - - y-=CHANNELHEIGHT+CHANNELSKIP; - } - } - } - } - } - } - } - uiDrawBlock(block); -} - -/********************************** Current Frame **************************** */ - -void draw_cfra_action (void) -{ - Object *ob; - float vec[2]; - - /* Draw a light green line to indicate current frame */ - vec[0]= (G.scene->r.cfra); - vec[0]*= G.scene->r.framelen; - - vec[1]= G.v2d->cur.ymin; - BIF_ThemeColor(TH_CFRAME); - glLineWidth(2.0); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); - - /* Draw dark green line if slow-parenting/time-offset is enabled */ - ob= (G.scene->basact) ? (G.scene->basact->object) : 0; - if ((ob) && (ob->sf!=0.0) && (ob->ipoflag & OB_OFFS_OB)) { - vec[0]-= ob->sf; - - BIF_ThemeColorShade(TH_CFRAME, -30); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymin; - glVertex2fv(vec); - glEnd(); - } - - glLineWidth(1.0); -} - -/********************************** Left-Hand Panel + Generics **************************** */ - -/* left hand part */ -static void draw_channel_names(void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - short ofsx = 0, ofsy = 0; - float x= 0.0f, y= 0.0f; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* Clip to the scrollable area */ - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= curarea->winrct.xmin; - ofsy= curarea->winrct.ymin; - glViewport(ofsx, ofsy+G.v2d->mask.ymin, NAMEWIDTH, - (ofsy+G.v2d->mask.ymax) - - (ofsy+G.v2d->mask.ymin)); - glScissor(ofsx, ofsy+G.v2d->mask.ymin, NAMEWIDTH, - (ofsy+G.v2d->mask.ymax) - - (ofsy+G.v2d->mask.ymin)); - } - } - - /* prepare scaling for LHS panel */ - myortho2(0, NAMEWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); - - /* set default color back to black */ - glColor3ub(0x00, 0x00, 0x00); - - /* build list of channels to draw */ - filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through channels, and set up drawing depending on their type */ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - for (ale= act_data.first; ale; ale= ale->next) { - short indent= 0, offset= 0, sel= 0; - int expand= -1, protect = -1, special= -1, mute = -1; - char name[32]; - - /* determine what needs to be drawn */ - switch (ale->type) { - case ACTTYPE_ACHAN: /* action channel */ - { - bActionChannel *achan= (bActionChannel *)ale->data; - - indent = 0; - special = -1; - - if (EXPANDED_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - if (EDITABLE_ACHAN(achan)) - protect = ICON_UNLOCKED; - else - protect = ICON_LOCKED; - - if (achan->ipo) { - if (achan->ipo->muteipo) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - } - - sel = SEL_ACHAN(achan); - sprintf(name, achan->name); - } - break; - case ACTTYPE_CONCHAN: /* constraint channel */ - { - bConstraintChannel *conchan = (bConstraintChannel *)ale->data; - - indent = 2; - - if (EDITABLE_CONCHAN(conchan)) - protect = ICON_UNLOCKED; - else - protect = ICON_LOCKED; - - if (conchan->ipo) { - if (conchan->ipo->muteipo) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - } - - sel = SEL_CONCHAN(conchan); - sprintf(name, conchan->name); - } - break; - case ACTTYPE_ICU: /* ipo-curve channel */ - { - IpoCurve *icu = (IpoCurve *)ale->data; - - indent = 2; - protect = -1; // for now, until this can be supported by others - - if (icu->flag & IPO_MUTE) - mute = ICON_MUTE_IPO_ON; - else - mute = ICON_MUTE_IPO_OFF; - - sel = SEL_ICU(icu); - if (G.saction->pin) - sprintf(name, getname_ipocurve(icu, NULL)); - else - sprintf(name, getname_ipocurve(icu, OBACT)); - } - break; - case ACTTYPE_SHAPEKEY: /* shapekey channel */ - { - KeyBlock *kb = (KeyBlock *)ale->data; - - indent = 0; - special = -1; - - if (kb->name[0] == '\0') - sprintf(name, "Key %d", ale->index); - else - sprintf(name, kb->name); - } - break; - case ACTTYPE_FILLIPO: /* ipo expand widget */ - { - bActionChannel *achan = (bActionChannel *)ale->data; - - indent = 1; - special = geticon_ipo_blocktype(achan->ipo->blocktype); - - if (FILTER_IPO_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - sel = SEL_ACHAN(achan); - sprintf(name, "IPO Curves"); - } - break; - case ACTTYPE_FILLCON: /* constraint expand widget */ - { - bActionChannel *achan = (bActionChannel *)ale->data; - - indent = 1; - special = ICON_CONSTRAINT; - - if (FILTER_CON_ACHAN(achan)) - expand = ICON_TRIA_DOWN; - else - expand = ICON_TRIA_RIGHT; - - sel = SEL_ACHAN(achan); - sprintf(name, "Constraint"); - } - break; - } - - /* now, start drawing based on this information */ - /* draw backing strip behind channel name */ - BIF_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40)); - offset = 7 * indent; - glRectf(x+offset, y-CHANNELHEIGHT/2, (float)NAMEWIDTH, y+CHANNELHEIGHT/2); - - /* draw expand/collapse triangle */ - if (expand > 0) { - BIF_icon_draw(x+offset, y-CHANNELHEIGHT/2, expand); - offset += 17; - } - - /* draw special icon indicating type of ipo-blocktype? - * only for expand widgets for Ipo and Constraint Channels - */ - if (special > 0) { - offset = 24; - BIF_icon_draw(x+offset, y-CHANNELHEIGHT/2, special); - offset += 17; - } - - /* draw name */ - if (sel) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - offset += 3; - glRasterPos2f(x+offset, y-4); - BMF_DrawString(G.font, name); - - /* reset offset - for RHS of panel */ - offset = 0; - - /* draw protect 'lock' */ - if (protect > 0) { - offset = 16; - BIF_icon_draw(NAMEWIDTH-offset, y-CHANNELHEIGHT/2, protect); - } - - /* draw mute 'eye' */ - if (mute > 0) { - offset += 16; - BIF_icon_draw(NAMEWIDTH-offset, y-CHANNELHEIGHT/2, mute); - } - - /* adjust y-position for next one */ - y-=CHANNELHEIGHT+CHANNELSKIP; - } - - /* free tempolary channels */ - BLI_freelistN(&act_data); - - /* re-adjust view matrices for correct scaling */ - myortho2(0, NAMEWIDTH, 0, (ofsy+G.v2d->mask.ymax) - (ofsy+G.v2d->mask.ymin)); // Scaling -} - -/* sets or clears hidden flags */ -void check_action_context(SpaceAction *saction) -{ - bActionChannel *achan; - - if (saction->action==NULL) return; - - for (achan=saction->action->chanbase.first; achan; achan=achan->next) - achan->flag &= ~ACHAN_HIDDEN; - - if ((saction->pin==0) && ((saction->flag & SACTION_NOHIDE)==0) && (OBACT)) { - Object *ob= OBACT; - bPoseChannel *pchan; - bArmature *arm= ob->data; - - for (achan=saction->action->chanbase.first; achan; achan=achan->next) { - pchan= get_pose_channel(ob->pose, achan->name); - if (pchan) { - if ((pchan->bone->layer & arm->layer)==0) - achan->flag |= ACHAN_HIDDEN; - else if (pchan->bone->flag & BONE_HIDDEN_P) - achan->flag |= ACHAN_HIDDEN; - } - } - } -} - -static void draw_channel_strips(void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - rcti scr_rct; - gla2DDrawInfo *di; - float y, sta, end; - int act_start, act_end, dummy; - char col1[3], col2[3]; - - BIF_GetThemeColor3ubv(TH_SHADE2, col2); - BIF_GetThemeColor3ubv(TH_HILITE, col1); - - /* get editor data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - scr_rct.xmin= G.saction->area->winrct.xmin + G.saction->v2d.mask.xmin; - scr_rct.ymin= G.saction->area->winrct.ymin + G.saction->v2d.mask.ymin; - scr_rct.xmax= G.saction->area->winrct.xmin + G.saction->v2d.hor.xmax; - scr_rct.ymax= G.saction->area->winrct.ymin + G.saction->v2d.mask.ymax; - di= glaBegin2DDraw(&scr_rct, &G.v2d->cur); - - /* if in NLA there's a strip active, map the view */ - if (datatype == ACTCONT_ACTION) { - if (NLA_ACTION_SCALED) - map_active_strip(di, OBACT, 0); - - /* start and end of action itself */ - calc_action_range(data, &sta, &end, 0); - gla2DDrawTranslatePt(di, sta, 0.0f, &act_start, &dummy); - gla2DDrawTranslatePt(di, end, 0.0f, &act_end, &dummy); - - if (NLA_ACTION_SCALED) - map_active_strip(di, OBACT, 1); - } - - /* build list of channels to draw */ - filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - /* first backdrop strips */ - y = 0.0; - glEnable(GL_BLEND); - for (ale= act_data.first; ale; ale= ale->next) { - int frame1_x, channel_y, sel=0; - - /* determine if any need to draw channel */ - if (ale->datatype != ALE_NONE) { - /* determine if channel is selected */ - switch (ale->type) { - case ACTTYPE_ACHAN: - { - bActionChannel *achan = (bActionChannel *)ale->data; - sel = SEL_ACHAN(achan); - } - break; - case ACTTYPE_CONCHAN: - { - bConstraintChannel *conchan = (bConstraintChannel *)ale->data; - sel = SEL_CONCHAN(conchan); - } - break; - case ACTTYPE_ICU: - { - IpoCurve *icu = (IpoCurve *)ale->data; - sel = SEL_ICU(icu); - } - break; - } - - if (datatype == ACTCONT_ACTION) { - gla2DDrawTranslatePt(di, G.v2d->cur.xmin, y, &frame1_x, &channel_y); - - if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22); - else glColor4ub(col2[0], col2[1], col2[2], 0x22); - glRectf(frame1_x, channel_y-CHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+CHANNELHEIGHT/2); - - if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22); - else glColor4ub(col2[0], col2[1], col2[2], 0x22); - glRectf(act_start, channel_y-CHANNELHEIGHT/2, act_end, channel_y+CHANNELHEIGHT/2); - } - else if (datatype == ACTCONT_SHAPEKEY) { - gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y); - - /* all frames that have a frame number less than one - * get a desaturated orange background - */ - glColor4ub(col2[0], col2[1], col2[2], 0x22); - glRectf(0, channel_y-CHANNELHEIGHT/2, frame1_x, channel_y+CHANNELHEIGHT/2); - - /* frames one and higher get a saturated orange background */ - glColor4ub(col2[0], col2[1], col2[2], 0x44); - glRectf(frame1_x, channel_y-CHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+CHANNELHEIGHT/2); - } - } - - /* Increment the step */ - y-=CHANNELHEIGHT+CHANNELSKIP; - } - glDisable(GL_BLEND); - - if (NLA_ACTION_SCALED) - map_active_strip(di, OBACT, 0); - - /* draw keyframes */ - y = 0.0; - for (ale= act_data.first; ale; ale= ale->next) { - switch (ale->datatype) { - case ALE_IPO: - draw_ipo_channel(di, ale->key_data, y); - break; - case ALE_ICU: - draw_icu_channel(di, ale->key_data, y); - break; - } - - y-=CHANNELHEIGHT+CHANNELSKIP; - } - - /* free tempolary channels used for drawing */ - BLI_freelistN(&act_data); - - /* black line marking 'current frame' for Time-Slide transform mode */ - if (G.saction->flag & SACTION_MOVING) { - int frame1_x, channel_y; - - gla2DDrawTranslatePt(di, G.saction->timeslide, 0, &frame1_x, &channel_y); - cpack(0x0); - - glBegin(GL_LINES); - glVertex2f(frame1_x, G.v2d->mask.ymin - 100); - glVertex2f(frame1_x, G.v2d->mask.ymax); - glEnd(); - } - - glaEnd2DDraw(di); -} - -/* ********* action panel *********** */ - - -void do_actionbuts(unsigned short event) -{ - switch(event) { - case REDRAWVIEW3D: - allqueue(REDRAWVIEW3D, 0); - break; - case B_REDR: - allqueue(REDRAWACTION, 0); - break; - } -} - - -static void action_panel_properties(short cntrl) // ACTION_HANDLER_PROPERTIES -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "action_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(ACTION_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Transform Properties", "Action", 10, 230, 318, 204)==0) return; - - uiDefBut(block, LABEL, 0, "test text", 10,180,300,19, 0, 0, 0, 0, 0, ""); - -} - -static void action_blockhandlers(ScrArea *sa) -{ - SpaceAction *sact= sa->spacedata.first; - short a; - - for(a=0; ablockhandler[a]) { - - case ACTION_HANDLER_PROPERTIES: - action_panel_properties(sact->blockhandler[a+1]); - break; - - } - /* clear action value for event */ - sact->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); -} - -/* ************************* Action Editor Space ***************************** */ - -void drawactionspace(ScrArea *sa, void *spacedata) -{ - bAction *act = NULL; - Key *key = NULL; - void *data; - short datatype; - - short ofsx = 0, ofsy = 0; - float col[3]; - - /* this is unlikely to occur, but it may */ - if (G.saction == NULL) - return; - - /* warning: blocks need to be freed each time, handlers dont remove */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - /* only try to refresh action that's displayed if not pinned */ - if (G.saction->pin==0) { - /* TODO: allow more than one active action sometime? */ - if (OBACT) - G.saction->action = OBACT->action; - else - G.saction->action= NULL; - } - - /* get data */ - data = get_action_context(&datatype); - if (datatype == ACTCONT_ACTION) - act = data; - else if (datatype == ACTCONT_SHAPEKEY) - key = data; - - /* Lets make sure the width of the left hand of the screen - * is set to an appropriate value based on whether sliders - * are showing of not - */ - if ((data) && (G.saction->flag & SACTION_SLIDERS)) - ACTWIDTH = NAMEWIDTH + SLIDERWIDTH; - else - ACTWIDTH = NAMEWIDTH; - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy); - - /* background color for entire window (used in lefthand part though) */ - BIF_GetThemeColor3fv(TH_HEADER, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= curarea->winrct.xmin; - ofsy= curarea->winrct.ymin; - glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, - ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, - ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, - ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, - ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - } - } - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - /* Draw backdrop */ - calc_ipogrid(); - draw_ipogrid(); - - check_action_context(G.saction); - - /* Draw channel strips */ - draw_channel_strips(); - - /* reset matrices for stuff to be drawn on top of keys*/ - glViewport(ofsx+G.v2d->mask.xmin, - ofsy+G.v2d->mask.ymin, - ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, - ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, - ofsy+G.v2d->mask.ymin, - ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, - ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - - /* Draw current frame */ - draw_cfra_action(); - - /* Draw markers */ - draw_markers_timespace(0); - - /* Draw 'curtains' for preview */ - draw_anim_preview_timespace(); - - /* Draw scroll */ - mywinset(curarea->win); // reset scissor too - if (curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - if (G.v2d->scroll) drawscroll(0); - } - - /* Draw Left-Hand Panel if enough space in window */ - if (G.v2d->mask.xmin!=0) { - /* Draw channel names */ - draw_channel_names(); - - if(sa->winx > 50 + NAMEWIDTH + SLIDERWIDTH) { - if (act) { - /* if there is an action, draw sliders for its - * ipo-curve channels in the action window - */ - action_icu_buts(G.saction); - } - else if (key) { - /* if there is a mesh with rvk's selected, - * then draw the key frames in the action window - */ - meshactionbuts(G.saction, OBACT, key); - } - } - } - - mywinset(curarea->win); // reset scissor too - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - draw_area_emboss(sa); - - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, G.saction->blockscale, G.saction->blockscale, G.saction->blockscale); - action_blockhandlers(sa); - - curarea->win_swap= WIN_BACK_OK; -} - -/* *************************** Keyframe Drawing *************************** */ - -static void add_bezt_to_keycolumnslist(ListBase *keys, BezTriple *bezt) -{ - /* The equivilant of add_to_cfra_elem except this version - * makes ActKeyColumns - one of the two datatypes required - * for action editor drawing. - */ - ActKeyColumn *ak, *akn; - - if (!(keys) || !(bezt)) return; - - /* try to find a keyblock that starts on the previous beztriple */ - for (ak= keys->first; ak; ak= ak->next) { - /* do because of double keys */ - if (ak->cfra == bezt->vec[1][0]) { - /* set selection status and 'touched' status */ - if (BEZSELECTED(bezt)) ak->sel = SELECT; - ak->modified += 1; - - return; - } - else if (ak->cfra > bezt->vec[1][0]) break; - } - - /* add new block */ - akn= MEM_callocN(sizeof(ActKeyColumn), "ActKeyColumn"); - if (ak) BLI_insertlinkbefore(keys, ak, akn); - else BLI_addtail(keys, akn); - - akn->cfra= bezt->vec[1][0]; - akn->modified += 1; - - // TODO: handle type = bezt->h1 or bezt->h2 - akn->handle_type= 0; - - if (BEZSELECTED(bezt)) - akn->sel = SELECT; - else - akn->sel = 0; -} - -static void add_bezt_to_keyblockslist(ListBase *blocks, IpoCurve *icu, int index) -{ - /* The equivilant of add_to_cfra_elem except this version - * makes ActKeyBlocks - one of the two datatypes required - * for action editor drawing. - */ - ActKeyBlock *ab, *abn; - BezTriple *beztn=NULL, *prev=NULL; - BezTriple *bezt; - int v; - - /* get beztriples */ - beztn= (icu->bezt + index); - - for (v=0, bezt=icu->bezt; vtotvert; v++, bezt++) { - /* skip if beztriple is current */ - if (v != index) { - /* check if beztriple is immediately before */ - if (beztn->vec[1][0] > bezt->vec[1][0]) { - /* check if closer than previous was */ - if (prev) { - if (prev->vec[1][0] < bezt->vec[1][0]) - prev= bezt; - } - else { - prev= bezt; - } - } - } - } - - /* check if block needed - same value(s)? - * -> firstly, handles must have same central value as each other - * -> secondly, handles which control that section of the curve must be constant - */ - if ((!prev) || (!beztn)) return; - if (IS_EQ(beztn->vec[1][1], prev->vec[1][1])==0) return; - if (IS_EQ(beztn->vec[1][1], beztn->vec[0][1])==0) return; - if (IS_EQ(prev->vec[1][1], prev->vec[2][1])==0) return; - - /* try to find a keyblock that starts on the previous beztriple */ - for (ab= blocks->first; ab; ab= ab->next) { - /* check if alter existing block or add new block */ - if (ab->start == prev->vec[1][0]) { - /* set selection status and 'touched' status */ - if (BEZSELECTED(beztn)) ab->sel = SELECT; - ab->modified += 1; - - return; - } - else if (ab->start > prev->vec[1][0]) break; - } - - /* add new block */ - abn= MEM_callocN(sizeof(ActKeyBlock), "ActKeyBlock"); - if (ab) BLI_insertlinkbefore(blocks, ab, abn); - else BLI_addtail(blocks, abn); - - abn->start= prev->vec[1][0]; - abn->end= beztn->vec[1][0]; - abn->val= beztn->vec[1][1]; - - if (BEZSELECTED(prev) || BEZSELECTED(beztn)) - abn->sel = SELECT; - else - abn->sel = 0; - abn->modified = 1; -} - -/* helper function - find actkeycolumn that occurs on cframe */ -static ActKeyColumn *cfra_find_actkeycolumn (ListBase *keys, float cframe) -{ - ActKeyColumn *ak; - - if (keys==NULL) - return NULL; - - for (ak= keys->first; ak; ak= ak->next) { - if (ak->cfra == cframe) - return ak; - } - - return NULL; -} - -static void draw_keylist(gla2DDrawInfo *di, ListBase *keys, ListBase *blocks, float ypos) -{ - ActKeyColumn *ak; - ActKeyBlock *ab; - - glEnable(GL_BLEND); - - /* draw keyblocks */ - if (blocks) { - for (ab= blocks->first; ab; ab= ab->next) { - short startCurves, endCurves, totCurves; - - /* find out how many curves occur at each keyframe */ - ak= cfra_find_actkeycolumn(keys, ab->start); - startCurves = (ak)? ak->totcurve: 0; - - ak= cfra_find_actkeycolumn(keys, ab->end); - endCurves = (ak)? ak->totcurve: 0; - - /* only draw keyblock if it appears in at all of the keyframes at lowest end */ - if (!startCurves && !endCurves) - continue; - else - totCurves = (startCurves>endCurves)? endCurves: startCurves; - - if (ab->totcurve >= totCurves) { - int sc_xa, sc_ya; - int sc_xb, sc_yb; - - /* get co-ordinates of block */ - gla2DDrawTranslatePt(di, ab->start, ypos, &sc_xa, &sc_ya); - gla2DDrawTranslatePt(di, ab->end, ypos, &sc_xb, &sc_yb); - - /* draw block */ - if (ab->sel) - BIF_ThemeColor4(TH_STRIP_SELECT); - else - BIF_ThemeColor4(TH_STRIP); - glRectf(sc_xa, sc_ya-3, sc_xb, sc_yb+5); - } - } - } - - /* draw keys */ - if (keys) { - for (ak= keys->first; ak; ak= ak->next) { - int sc_x, sc_y; - - /* get co-ordinate to draw at */ - gla2DDrawTranslatePt(di, ak->cfra, ypos, &sc_x, &sc_y); - - if(ak->sel & 1) BIF_icon_draw_aspect(sc_x-7, sc_y-6, ICON_SPACE2, 1.0f); - else BIF_icon_draw_aspect(sc_x-7, sc_y-6, ICON_SPACE3, 1.0f); - } - } - - glDisable(GL_BLEND); -} - -void draw_object_channel(gla2DDrawInfo *di, Object *ob, float ypos) -{ - ListBase keys = {0, 0}; - ListBase blocks = {0, 0}; - - ob_to_keylist(ob, &keys, &blocks); - draw_keylist(di, &keys, &blocks, ypos); - - BLI_freelistN(&keys); - BLI_freelistN(&blocks); -} - -void draw_ipo_channel(gla2DDrawInfo *di, Ipo *ipo, float ypos) -{ - ListBase keys = {0, 0}; - ListBase blocks = {0, 0}; - - ipo_to_keylist(ipo, &keys, &blocks); - draw_keylist(di, &keys, &blocks, ypos); - - BLI_freelistN(&keys); - BLI_freelistN(&blocks); -} - -void draw_icu_channel(gla2DDrawInfo *di, IpoCurve *icu, float ypos) -{ - ListBase keys = {0, 0}; - ListBase blocks = {0, 0}; - - icu_to_keylist(icu, &keys, &blocks); - draw_keylist(di, &keys, &blocks, ypos); - - BLI_freelistN(&keys); - BLI_freelistN(&blocks); -} - -void draw_action_channel(gla2DDrawInfo *di, bAction *act, float ypos) -{ - ListBase keys = {0, 0}; - - action_to_keylist(act, &keys, NULL); - draw_keylist(di, &keys, NULL, ypos); - BLI_freelistN(&keys); -} - -/* --------------- Conversion: data -> keyframe list ------------------ */ - -void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks) -{ - bConstraintChannel *conchan; - - if (ob) { - /* Add object keyframes */ - if (ob->ipo) - ipo_to_keylist(ob->ipo, keys, blocks); - - /* Add constraint keyframes */ - for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next){ - if(conchan->ipo) - ipo_to_keylist(conchan->ipo, keys, blocks); - } - - /* Add object data keyframes */ - // TODO?? - } -} - -void icu_to_keylist(IpoCurve *icu, ListBase *keys, ListBase *blocks) -{ - BezTriple *bezt; - ActKeyColumn *ak; - ActKeyBlock *ab; - int v; - - if (icu && icu->totvert) { - /* loop through beztriples, making ActKeys and ActKeyBlocks */ - bezt= icu->bezt; - - for (v=0; vtotvert; v++, bezt++) { - add_bezt_to_keycolumnslist(keys, bezt); - if (blocks) add_bezt_to_keyblockslist(blocks, icu, v); - } - - /* update the number of curves that elements have appeared in */ - if (keys) { - for (ak= keys->first; ak; ak= ak->next) { - if (ak->modified) { - ak->modified = 0; - ak->totcurve += 1; - } - } - } - if (blocks) { - for (ab= blocks->first; ab; ab= ab->next) { - if (ab->modified) { - ab->modified = 0; - ab->totcurve += 1; - } - } - } - } -} - -void ipo_to_keylist(Ipo *ipo, ListBase *keys, ListBase *blocks) -{ - IpoCurve *icu; - - if (ipo) { - for (icu= ipo->curve.first; icu; icu= icu->next) - icu_to_keylist(icu, keys, blocks); - } -} - -void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks) -{ - bActionChannel *achan; - bConstraintChannel *conchan; - - if (act) { - /* loop through action channels */ - for (achan= act->chanbase.first; achan; achan= achan->next) { - /* firstly, add keys from action channel's ipo block */ - if (achan->ipo) - ipo_to_keylist(achan->ipo, keys, blocks); - - /* then, add keys from constraint channels */ - for (conchan= achan->constraintChannels.first; conchan; conchan= conchan->next) { - if (conchan->ipo) - ipo_to_keylist(achan->ipo, keys, blocks); - } - } - } -} - diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c deleted file mode 100644 index 9ec688b5d8d..00000000000 --- a/source/blender/src/drawarmature.c +++ /dev/null @@ -1,2279 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 by the Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_ID.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_object.h" -#include "BKE_ipo.h" -#include "BKE_utildefines.h" - -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_poseobject.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" - -#include "BDR_editobject.h" -#include "BDR_drawobject.h" -#include "BDR_drawaction.h" - -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "mydevice.h" -#include "blendef.h" -#include "nla.h" - -/* half the cube, in Y */ -static float cube[8][3] = { -{-1.0, 0.0, -1.0}, -{-1.0, 0.0, 1.0}, -{-1.0, 1.0, 1.0}, -{-1.0, 1.0, -1.0}, -{ 1.0, 0.0, -1.0}, -{ 1.0, 0.0, 1.0}, -{ 1.0, 1.0, 1.0}, -{ 1.0, 1.0, -1.0}, -}; - - -/* *************** Armature drawing, helper calls for parts ******************* */ - -static void drawsolidcube_size(float xsize, float ysize, float zsize) -{ - static GLuint displist=0; - float n[3]; - - glScalef(xsize, ysize, zsize); - - n[0]=0; n[1]=0; n[2]=0; - - if(displist==0) { - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - glBegin(GL_QUADS); - n[0]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]); - n[0]=0; - n[1]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]); - n[1]=0; - n[0]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]); - n[0]=0; - n[1]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]); - n[1]=0; - n[2]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]); - n[2]=0; - n[2]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]); - glEnd(); - - glEndList(); - } - else glCallList(displist); - -} - -static void drawcube_size(float xsize, float ysize, float zsize) -{ - static GLuint displist=0; - - glScalef(xsize, ysize, zsize); - - if(displist==0) { - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]); - glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); - glEnd(); - - glBegin(GL_LINES); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); - glVertex3fv(cube[2]); glVertex3fv(cube[6]); - glVertex3fv(cube[3]); glVertex3fv(cube[7]); - glEnd(); - - glEndList(); - } - else glCallList(displist); - -} - - -static void draw_bonevert(void) -{ - static GLuint displist=0; - - if(displist==0) { - GLUquadricObj *qobj; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - glPushMatrix(); - - qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - gluDisk( qobj, 0.0, 0.05, 16, 1); - - glRotatef (90, 0, 1, 0); - gluDisk( qobj, 0.0, 0.05, 16, 1); - - glRotatef (90, 1, 0, 0); - gluDisk( qobj, 0.0, 0.05, 16, 1); - - gluDeleteQuadric(qobj); - - glPopMatrix(); - glEndList(); - } - else glCallList(displist); -} - -static void draw_bonevert_solid(void) -{ - static GLuint displist=0; - - if(displist==0) { - GLUquadricObj *qobj; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); - gluSphere( qobj, 0.05, 8, 5); - glShadeModel(GL_FLAT); - gluDeleteQuadric(qobj); - - glEndList(); - } - else glCallList(displist); -} - -static void draw_bone_octahedral() -{ - static GLuint displist=0; - - if(displist==0) { - float vec[6][3]; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - vec[0][0]= vec[0][1]= vec[0][2]= 0.0; - vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0; - - vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1; - vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1; - vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1; - vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1; - - /* Section 1, sides */ - glBegin(GL_LINE_LOOP); - glVertex3fv(vec[0]); - glVertex3fv(vec[1]); - glVertex3fv(vec[5]); - glVertex3fv(vec[3]); - glVertex3fv(vec[0]); - glVertex3fv(vec[4]); - glVertex3fv(vec[5]); - glVertex3fv(vec[2]); - glEnd(); - - /* Section 1, square */ - glBegin(GL_LINE_LOOP); - glVertex3fv(vec[1]); - glVertex3fv(vec[2]); - glVertex3fv(vec[3]); - glVertex3fv(vec[4]); - glEnd(); - - glEndList(); - } - else glCallList(displist); -} - -static void draw_bone_solid_octahedral(void) -{ - static GLuint displist=0; - - if(displist==0) { - float vec[6][3], nor[3]; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - vec[0][0]= vec[0][1]= vec[0][2]= 0.0; - vec[5][0]= vec[5][2]= 0.0; vec[5][1]= 1.0; - - vec[1][0]= 0.1; vec[1][2]= 0.1; vec[1][1]= 0.1; - vec[2][0]= 0.1; vec[2][2]= -0.1; vec[2][1]= 0.1; - vec[3][0]= -0.1; vec[3][2]= -0.1; vec[3][1]= 0.1; - vec[4][0]= -0.1; vec[4][2]= 0.1; vec[4][1]= 0.1; - - - glBegin(GL_TRIANGLES); - /* bottom */ - CalcNormFloat(vec[2], vec[1], vec[0], nor); - glNormal3fv(nor); - glVertex3fv(vec[2]);glVertex3fv(vec[1]);glVertex3fv(vec[0]); - - CalcNormFloat(vec[3], vec[2], vec[0], nor); - glNormal3fv(nor); - glVertex3fv(vec[3]);glVertex3fv(vec[2]);glVertex3fv(vec[0]); - - CalcNormFloat(vec[4], vec[3], vec[0], nor); - glNormal3fv(nor); - glVertex3fv(vec[4]);glVertex3fv(vec[3]);glVertex3fv(vec[0]); - - CalcNormFloat(vec[1], vec[4], vec[0], nor); - glNormal3fv(nor); - glVertex3fv(vec[1]);glVertex3fv(vec[4]);glVertex3fv(vec[0]); - - /* top */ - CalcNormFloat(vec[5], vec[1], vec[2], nor); - glNormal3fv(nor); - glVertex3fv(vec[5]);glVertex3fv(vec[1]);glVertex3fv(vec[2]); - - CalcNormFloat(vec[5], vec[2], vec[3], nor); - glNormal3fv(nor); - glVertex3fv(vec[5]);glVertex3fv(vec[2]);glVertex3fv(vec[3]); - - CalcNormFloat(vec[5], vec[3], vec[4], nor); - glNormal3fv(nor); - glVertex3fv(vec[5]);glVertex3fv(vec[3]);glVertex3fv(vec[4]); - - CalcNormFloat(vec[5], vec[4], vec[1], nor); - glNormal3fv(nor); - glVertex3fv(vec[5]);glVertex3fv(vec[4]);glVertex3fv(vec[1]); - - glEnd(); - - glEndList(); - } - else glCallList(displist); -} - -/* *************** Armature drawing, bones ******************* */ - - -static void draw_bone_points(int dt, int armflag, unsigned int boneflag, int id) -{ - /* Draw root point if we are not connected */ - if (!(boneflag & BONE_CONNECTED)){ - if (id != -1) - glLoadName (id | BONESEL_ROOT); - - if(dt<=OB_WIRE) { - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - } - else - BIF_ThemeColor(TH_BONE_SOLID); - - if(dt>OB_WIRE) draw_bonevert_solid(); - else draw_bonevert(); - } - - /* Draw tip point */ - if (id != -1) - glLoadName (id | BONESEL_TIP); - - if(dt<=OB_WIRE) { - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - } - else { - BIF_ThemeColor(TH_BONE_SOLID); - } - - glTranslatef(0.0, 1.0, 0.0); - if(dt>OB_WIRE) draw_bonevert_solid(); - else draw_bonevert(); - glTranslatef(0.0, -1.0, 0.0); - -} - -/* 16 values of sin function (still same result!) */ -static float si[16] = { - 0.00000000, - 0.20129852, 0.39435585, - 0.57126821, 0.72479278, - 0.84864425, 0.93775213, - 0.98846832, 0.99871650, - 0.96807711, 0.89780453, - 0.79077573, 0.65137248, - 0.48530196, 0.29936312, - 0.10116832 -}; -/* 16 values of cos function (still same result!) */ -static float co[16] ={ - 1.00000000, - 0.97952994, 0.91895781, - 0.82076344, 0.68896691, - 0.52896401, 0.34730525, - 0.15142777, -0.05064916, - -0.25065253, -0.44039415, - -0.61210598, -0.75875812, - -0.87434661, -0.95413925, - -0.99486932 -}; - - - -/* smat, imat = mat & imat to draw screenaligned */ -static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag, bPoseChannel *pchan, EditBone *ebone) -{ - float head, tail, length, dist; - float *headvec, *tailvec, dirvec[3]; - - /* figure out the sizes of spheres */ - if(ebone) { - /* this routine doesn't call set_matrix_editbone() that calculates it */ - ebone->length = VecLenf(ebone->head, ebone->tail); - - length= ebone->length; - tail= ebone->rad_tail; - dist= ebone->dist; - if (ebone->parent && (ebone->flag & BONE_CONNECTED)) - head= ebone->parent->rad_tail; - else - head= ebone->rad_head; - headvec= ebone->head; - tailvec= ebone->tail; - } - else { - length= pchan->bone->length; - tail= pchan->bone->rad_tail; - dist= pchan->bone->dist; - if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) - head= pchan->parent->bone->rad_tail; - else - head= pchan->bone->rad_head; - headvec= pchan->pose_head; - tailvec= pchan->pose_tail; - } - - /* ***** draw it ***** */ - - /* move vector to viewspace */ - VecSubf(dirvec, tailvec, headvec); - Mat4Mul3Vecfl(smat, dirvec); - /* clear zcomp */ - dirvec[2]= 0.0; - /* move vector back */ - Mat4Mul3Vecfl(imat, dirvec); - - if(0.0f != Normalize(dirvec)) { - float norvec[3], vec1[3], vec2[3], vec[3]; - int a; - - //VecMulf(dirvec, head); - Crossf(norvec, dirvec, imat[2]); - - glBegin(GL_QUAD_STRIP); - - for(a=0; a<16; a++) { - vec[0]= - *(si+a) * dirvec[0] + *(co+a) * norvec[0]; - vec[1]= - *(si+a) * dirvec[1] + *(co+a) * norvec[1]; - vec[2]= - *(si+a) * dirvec[2] + *(co+a) * norvec[2]; - - vec1[0]= headvec[0] + head*vec[0]; - vec1[1]= headvec[1] + head*vec[1]; - vec1[2]= headvec[2] + head*vec[2]; - vec2[0]= headvec[0] + (head+dist)*vec[0]; - vec2[1]= headvec[1] + (head+dist)*vec[1]; - vec2[2]= headvec[2] + (head+dist)*vec[2]; - - glColor4ub(255, 255, 255, 50); - glVertex3fv(vec1); - //glColor4ub(255, 255, 255, 0); - glVertex3fv(vec2); - } - - for(a=15; a>=0; a--) { - vec[0]= *(si+a) * dirvec[0] + *(co+a) * norvec[0]; - vec[1]= *(si+a) * dirvec[1] + *(co+a) * norvec[1]; - vec[2]= *(si+a) * dirvec[2] + *(co+a) * norvec[2]; - - vec1[0]= tailvec[0] + tail*vec[0]; - vec1[1]= tailvec[1] + tail*vec[1]; - vec1[2]= tailvec[2] + tail*vec[2]; - vec2[0]= tailvec[0] + (tail+dist)*vec[0]; - vec2[1]= tailvec[1] + (tail+dist)*vec[1]; - vec2[2]= tailvec[2] + (tail+dist)*vec[2]; - - //glColor4ub(255, 255, 255, 50); - glVertex3fv(vec1); - //glColor4ub(255, 255, 255, 0); - glVertex3fv(vec2); - } - /* make it cyclic... */ - - vec[0]= - *(si) * dirvec[0] + *(co) * norvec[0]; - vec[1]= - *(si) * dirvec[1] + *(co) * norvec[1]; - vec[2]= - *(si) * dirvec[2] + *(co) * norvec[2]; - - vec1[0]= headvec[0] + head*vec[0]; - vec1[1]= headvec[1] + head*vec[1]; - vec1[2]= headvec[2] + head*vec[2]; - vec2[0]= headvec[0] + (head+dist)*vec[0]; - vec2[1]= headvec[1] + (head+dist)*vec[1]; - vec2[2]= headvec[2] + (head+dist)*vec[2]; - - //glColor4ub(255, 255, 255, 50); - glVertex3fv(vec1); - //glColor4ub(255, 255, 255, 0); - glVertex3fv(vec2); - - glEnd(); - } -} - - -/* smat, imat = mat & imat to draw screenaligned */ -static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) -{ - float head, tail, length; - float *headvec, *tailvec, dirvec[3]; - - /* figure out the sizes of spheres */ - if(ebone) { - /* this routine doesn't call set_matrix_editbone() that calculates it */ - ebone->length = VecLenf(ebone->head, ebone->tail); - - length= ebone->length; - tail= ebone->rad_tail; - if (ebone->parent && (boneflag & BONE_CONNECTED)) - head= ebone->parent->rad_tail; - else - head= ebone->rad_head; - headvec= ebone->head; - tailvec= ebone->tail; - } - else { - length= pchan->bone->length; - tail= pchan->bone->rad_tail; - if (pchan->parent && (boneflag & BONE_CONNECTED)) - head= pchan->parent->bone->rad_tail; - else - head= pchan->bone->rad_head; - headvec= pchan->pose_head; - tailvec= pchan->pose_tail; - } - - /* sphere root color */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - else if(armflag & ARM_POSEMODE) { - /* in black or selection color */ - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - - /* Draw root point if we are not connected */ - if (!(boneflag & BONE_CONNECTED)){ - if (id != -1) - glLoadName (id | BONESEL_ROOT); - - drawcircball(GL_LINE_LOOP, headvec, head, imat); - } - - /* Draw tip point */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - - if (id != -1) - glLoadName (id | BONESEL_TIP); - - drawcircball(GL_LINE_LOOP, tailvec, tail, imat); - - /* base */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_SELECT); - else BIF_ThemeColor(TH_WIRE); - } - - VecSubf(dirvec, tailvec, headvec); - - /* move vector to viewspace */ - Mat4Mul3Vecfl(smat, dirvec); - /* clear zcomp */ - dirvec[2]= 0.0; - /* move vector back */ - Mat4Mul3Vecfl(imat, dirvec); - - if(0.0f != Normalize(dirvec)) { - float norvech[3], norvect[3], vec[3]; - - VECCOPY(vec, dirvec); - - VecMulf(dirvec, head); - Crossf(norvech, dirvec, imat[2]); - - VecMulf(vec, tail); - Crossf(norvect, vec, imat[2]); - - if (id != -1) - glLoadName (id | BONESEL_BONE); - - glBegin(GL_LINES); - vec[0]= headvec[0] + norvech[0]; - vec[1]= headvec[1] + norvech[1]; - vec[2]= headvec[2] + norvech[2]; - glVertex3fv(vec); - vec[0]= tailvec[0] + norvect[0]; - vec[1]= tailvec[1] + norvect[1]; - vec[2]= tailvec[2] + norvect[2]; - glVertex3fv(vec); - vec[0]= headvec[0] - norvech[0]; - vec[1]= headvec[1] - norvech[1]; - vec[2]= headvec[2] - norvech[2]; - glVertex3fv(vec); - vec[0]= tailvec[0] - norvect[0]; - vec[1]= tailvec[1] - norvect[1]; - vec[2]= tailvec[2] - norvect[2]; - glVertex3fv(vec); - - glEnd(); - } -} - -/* does wire only for outline selecting */ -static void draw_sphere_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) -{ - GLUquadricObj *qobj; - float head, tail, length; - float fac1, fac2; - - glPushMatrix(); - qobj = gluNewQuadric(); - - /* figure out the sizes of spheres */ - if(ebone) { - length= ebone->length; - tail= ebone->rad_tail; - if (ebone->parent && (boneflag & BONE_CONNECTED)) - head= ebone->parent->rad_tail; - else - head= ebone->rad_head; - } - else { - length= pchan->bone->length; - tail= pchan->bone->rad_tail; - if (pchan->parent && (boneflag & BONE_CONNECTED)) - head= pchan->parent->bone->rad_tail; - else - head= pchan->bone->rad_head; - } - - /* move to z-axis space */ - glRotatef (-90.0f, 1.0f, 0.0f, 0.0f); - - if(dt==OB_SOLID) { - /* set up solid drawing */ - glEnable(GL_COLOR_MATERIAL); - glEnable(GL_LIGHTING); - - gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); - } - else { - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - } - - /* sphere root color */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColorShade(TH_BONE_SOLID, -30); - } - else if(armflag & ARM_POSEMODE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 10); - else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_BONE_POSE, -30); - else BIF_ThemeColorShade(TH_BONE_SOLID, -30); - - } - else if(dt==OB_SOLID) - BIF_ThemeColorShade(TH_BONE_SOLID, -30); - - /* Draw root point if we are not connected */ - if (!(boneflag & BONE_CONNECTED)){ - if (id != -1) - glLoadName (id | BONESEL_ROOT); - gluSphere( qobj, head, 16, 10); - } - - /* Draw tip point */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColorShade(TH_BONE_SOLID, -30); - } - - if (id != -1) - glLoadName (id | BONESEL_TIP); - - glTranslatef(0.0, 0.0, length); - gluSphere( qobj, tail, 16, 10); - glTranslatef(0.0, 0.0, -length); - - /* base */ - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_SELECT); - else BIF_ThemeColor(TH_BONE_SOLID); - } - else if(armflag & ARM_POSEMODE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_BONE_SOLID); - - } - else if(dt==OB_SOLID) - BIF_ThemeColor(TH_BONE_SOLID); - - fac1= (length-head)/length; - fac2= (length-tail)/length; - - if(length > head+tail) { - if (id != -1) - glLoadName (id | BONESEL_BONE); - - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(-1.0, -1.0); - - glTranslatef(0.0f, 0.0f, head); - gluCylinder(qobj, fac1*head + (1.0f-fac1)*tail, fac2*tail + (1.0f-fac2)*head, length-head-tail, 16, 1); - glTranslatef(0.0f, 0.0f, -head); - - glDisable(GL_POLYGON_OFFSET_FILL); - - /* draw sphere on extrema */ - glTranslatef(0.0f, 0.0f, length-tail); - gluSphere( qobj, fac2*tail + (1.0f-fac2)*head, 16, 10); - glTranslatef(0.0f, 0.0f, -length+tail); - - glTranslatef(0.0f, 0.0f, head); - gluSphere( qobj, fac1*head + (1.0f-fac1)*tail, 16, 10); - } - else { - /* 1 sphere in center */ - glTranslatef(0.0f, 0.0f, (head + length-tail)/2.0); - gluSphere( qobj, fac1*head + (1.0f-fac1)*tail, 16, 10); - } - - /* restore */ - if(dt==OB_SOLID) { - glShadeModel(GL_FLAT); - glDisable(GL_LIGHTING); - glDisable(GL_COLOR_MATERIAL); - } - - glPopMatrix(); - gluDeleteQuadric(qobj); -} - -static GLubyte bm_dot6[]= {0x0, 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x0}; -static GLubyte bm_dot8[]= {0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C}; - -static GLubyte bm_dot5[]= {0x0, 0x0, 0x10, 0x38, 0x7c, 0x38, 0x10, 0x0}; -static GLubyte bm_dot7[]= {0x0, 0x38, 0x7C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38}; - - -static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) -{ - float length; - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - if(pchan) - length= pchan->bone->length; - else - length= ebone->length; - - glPushMatrix(); - glScalef(length, length, length); - - /* this chunk not in object mode */ - if(armflag & (ARM_EDITMODE|ARM_POSEMODE)) { - glLineWidth(4.0); - if(armflag & ARM_POSEMODE) { - /* outline in black or selection color */ - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - else if (armflag & ARM_EDITMODE) { - BIF_ThemeColor(TH_WIRE); - } - - /* Draw root point if we are not connected */ - if (!(boneflag & BONE_CONNECTED)){ - if (G.f & G_PICKSEL) { // no bitmap in selection mode, crashes 3d cards... - glLoadName (id | BONESEL_ROOT); - glBegin(GL_POINTS); - glVertex3f(0.0f, 0.0f, 0.0f); - glEnd(); - } - else { - glRasterPos3f(0.0f, 0.0f, 0.0f); - glBitmap(8, 8, 4, 4, 0, 0, bm_dot8); - } - } - - if (id != -1) - glLoadName ((GLuint) id|BONESEL_BONE); - - glBegin(GL_LINES); - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(0.0f, 1.0f, 0.0f); - glEnd(); - - /* tip */ - if (G.f & G_PICKSEL) { // no bitmap in selection mode, crashes 3d cards... - glLoadName (id | BONESEL_TIP); - glBegin(GL_POINTS); - glVertex3f(0.0f, 1.0f, 0.0f); - glEnd(); - } - else { - glRasterPos3f(0.0f, 1.0f, 0.0f); - glBitmap(8, 8, 4, 4, 0, 0, bm_dot7); - } - - /* further we send no names */ - if (id != -1) - glLoadName (id & 0xFFFF); // object tag, for bordersel optim - - if(armflag & ARM_POSEMODE) { - /* inner part in background color or constraint */ - if(constflag) { - if(constflag & PCHAN_HAS_STRIDE) glColor3ub(0, 0, 200); - else if(constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0); - else if(constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0); - else if(constflag & PCHAN_HAS_CONST) glColor3ub(0, 255, 120); - else BIF_ThemeColor(TH_BONE_POSE); // PCHAN_HAS_ACTION - } - else BIF_ThemeColorShade(TH_BACK, -30); - } - } - - glLineWidth(2.0); - - /* Draw root point if we are not connected */ - if (!(boneflag & BONE_CONNECTED)){ - if ((G.f & G_PICKSEL)==0) { // no bitmap in selection mode, crashes 3d cards... - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_ROOTSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - glRasterPos3f(0.0f, 0.0f, 0.0f); - glBitmap(8, 8, 4, 4, 0, 0, bm_dot6); - } - } - - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_EDGE_SELECT); - else BIF_ThemeColorShade(TH_BACK, -30); - } - glBegin(GL_LINES); - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3f(0.0f, 1.0f, 0.0f); - glEnd(); - - /* tip */ - if ((G.f & G_PICKSEL)==0) { // no bitmap in selection mode, crashes 3d cards... - if(armflag & ARM_EDITMODE) { - if (boneflag & BONE_TIPSEL) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } - glRasterPos3f(0.0f, 1.0f, 0.0f); - glBitmap(8, 8, 4, 4, 0, 0, bm_dot5); - } - - glLineWidth(1.0); - - glPopMatrix(); -} - -static void draw_b_bone_boxes(int dt, bPoseChannel *pchan, float xwidth, float length, float zwidth) -{ - int segments= 0; - - if(pchan) segments= pchan->bone->segments; - - if(segments>1 && pchan) { - float dlen= length/(float)segments; - Mat4 *bbone= b_bone_spline_setup(pchan, 0); - int a; - - for(a=0; amat); - if(dt==OB_SOLID) drawsolidcube_size(xwidth, dlen, zwidth); - else drawcube_size(xwidth, dlen, zwidth); - glPopMatrix(); - } - } - else { - glPushMatrix(); - if(dt==OB_SOLID) drawsolidcube_size(xwidth, length, zwidth); - else drawcube_size(xwidth, length, zwidth); - glPopMatrix(); - } -} - -static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) -{ - float xwidth, length, zwidth; - - if(pchan) { - xwidth= pchan->bone->xwidth; - length= pchan->bone->length; - zwidth= pchan->bone->zwidth; - } - else { - xwidth= ebone->xwidth; - length= ebone->length; - zwidth= ebone->zwidth; - } - - /* draw points only if... */ - if(armflag & ARM_EDITMODE) { - /* move to unitspace */ - glPushMatrix(); - glScalef(length, length, length); - draw_bone_points(dt, armflag, boneflag, id); - glPopMatrix(); - length*= 0.95f; // make vertices visible - } - - /* colors for modes */ - if (armflag & ARM_POSEMODE) { - if(dt==OB_WIRE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - else - BIF_ThemeColor(TH_BONE_SOLID); - } - else if (armflag & ARM_EDITMODE) { - if(dt==OB_WIRE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColor(TH_EDGE_SELECT); - else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_EDGE_SELECT, -20); - else BIF_ThemeColor(TH_WIRE); - } - else - BIF_ThemeColor(TH_BONE_SOLID); - } - - if (id != -1) { - glLoadName ((GLuint) id|BONESEL_BONE); - } - - /* set up solid drawing */ - if(dt > OB_WIRE) { - glEnable(GL_COLOR_MATERIAL); - glEnable(GL_LIGHTING); - BIF_ThemeColor(TH_BONE_SOLID); - - draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth); - - /* disable solid drawing */ - glDisable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHTING); - } - else { // wire - if (armflag & ARM_POSEMODE){ - if(constflag) { - glEnable(GL_BLEND); - - if(constflag & PCHAN_HAS_STRIDE) glColor4ub(0, 0, 200, 80); - else if(constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80); - else if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80); - else if(constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80); - else BIF_ThemeColor4(TH_BONE_POSE); // PCHAN_HAS_ACTION - - draw_b_bone_boxes(OB_SOLID, pchan, xwidth, length, zwidth); - - glDisable(GL_BLEND); - - /* restore colors */ - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - } - - draw_b_bone_boxes(OB_WIRE, pchan, xwidth, length, zwidth); - } -} - -static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned int id, float length) -{ - - /* Draw a 3d octahedral bone, we use normalized space based on length, - for glDisplayLists */ - - glScalef(length, length, length); - - /* set up solid drawing */ - if(dt > OB_WIRE) { - glEnable(GL_COLOR_MATERIAL); - glEnable(GL_LIGHTING); - BIF_ThemeColor(TH_BONE_SOLID); - } - - /* colors for posemode */ - if (armflag & ARM_POSEMODE) { - if(dt==OB_WIRE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - else - BIF_ThemeColor(TH_BONE_SOLID); - } - - - draw_bone_points(dt, armflag, boneflag, id); - - /* now draw the bone itself */ - - if (id != -1) { - glLoadName ((GLuint) id|BONESEL_BONE); - } - - /* wire? */ - if(dt <= OB_WIRE) { - /* colors */ - if (armflag & ARM_EDITMODE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColor(TH_EDGE_SELECT); - else if (boneflag & BONE_SELECTED) BIF_ThemeColorShade(TH_EDGE_SELECT, -20); - else BIF_ThemeColor(TH_WIRE); - } - else if (armflag & ARM_POSEMODE){ - if(constflag) { - glEnable(GL_BLEND); - - if(constflag & PCHAN_HAS_STRIDE) glColor4ub(0, 0, 200, 80); - else if(constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80); - else if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80); - else if(constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80); - else BIF_ThemeColor4(TH_BONE_POSE); // PCHAN_HAS_ACTION - - draw_bone_solid_octahedral(); - glDisable(GL_BLEND); - - /* restore colors */ - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - } - draw_bone_octahedral(); - } - else { /* solid */ - - BIF_ThemeColor(TH_BONE_SOLID); - draw_bone_solid_octahedral(); - } - - /* disable solid drawing */ - if(dt>OB_WIRE) { - glDisable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHTING); - } -} - -static void draw_custom_bone(Object *ob, int dt, int armflag, int boneflag, unsigned int id, float length) -{ - - if(ob==NULL) return; - - glScalef(length, length, length); - - /* colors for posemode */ - if (armflag & ARM_POSEMODE) { - if (boneflag & BONE_ACTIVE) BIF_ThemeColorShade(TH_BONE_POSE, 40); - else if (boneflag & BONE_SELECTED) BIF_ThemeColor(TH_BONE_POSE); - else BIF_ThemeColor(TH_WIRE); - } - - if (id != -1) { - glLoadName ((GLuint) id|BONESEL_BONE); - } - - draw_object_instance(ob, dt, armflag & ARM_POSEMODE); -} - - -static void pchan_draw_IK_root_lines(bPoseChannel *pchan) -{ - bConstraint *con; - bPoseChannel *parchan; - - for(con= pchan->constraints.first; con; con= con->next) { - if(con->type == CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data = (bKinematicConstraint*)con->data; - int segcount= 0; - - setlinestyle(3); - glBegin(GL_LINES); - - /* exclude tip from chain? */ - if(!(data->flag & CONSTRAINT_IK_TIP)) - parchan= pchan->parent; - else - parchan= pchan; - - glVertex3fv(parchan->pose_tail); - - /* Find the chain's root */ - while (parchan->parent){ - segcount++; - if(segcount==data->rootbone || segcount>255) break; // 255 is weak - parchan= parchan->parent; - } - if(parchan) - glVertex3fv(parchan->pose_head); - - glEnd(); - setlinestyle(0); - } - } -} - -static void bgl_sphere_project(float ax, float az) -{ - float dir[3], sine, q3; - - sine= 1.0f-ax*ax-az*az; - q3= (sine < 0.0f)? 0.0f: 2.0f*sqrt(sine); - - dir[0]= -az*q3; - dir[1]= 1.0f-2.0f*sine; - dir[2]= ax*q3; - - glVertex3fv(dir); -} - -static void draw_dof_ellipse(float ax, float az) -{ - static float staticSine[16] = { - 0.0, 0.104528463268, 0.207911690818, 0.309016994375, - 0.406736643076, 0.5, 0.587785252292, 0.669130606359, - 0.743144825477, 0.809016994375, 0.866025403784, - 0.913545457643, 0.951056516295, 0.978147600734, - 0.994521895368, 1.0 - }; - - int i, j, n=16; - float x, z, px, pz; - - glEnable(GL_BLEND); - glDepthMask(0); - - glColor4ub(70, 70, 70, 50); - - glBegin(GL_QUADS); - pz= 0.0f; - for(i=1; idata; - bPoseChannel *pchan; - Bone *bone; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) { - if(bone->flag & BONE_SELECTED) { - if(bone->layer & arm->layer) { - if(pchan->ikflag & (BONE_IK_XLIMIT|BONE_IK_ZLIMIT)) { - if(pose_channel_in_IK_chain(ob, pchan)) { - float corner[4][3], posetrans[3], mat[4][4]; - float phi=0.0f, theta=0.0f, scale; - int a, i; - - /* in parent-bone pose, but own restspace */ - glPushMatrix(); - - VECCOPY(posetrans, pchan->pose_mat[3]); - glTranslatef(posetrans[0], posetrans[1], posetrans[2]); - - if(pchan->parent) { - Mat4CpyMat4(mat, pchan->parent->pose_mat); - mat[3][0]= mat[3][1]= mat[3][2]= 0.0f; - glMultMatrixf(mat); - } - - Mat4CpyMat3(mat, pchan->bone->bone_mat); - glMultMatrixf(mat); - - scale= bone->length*pchan->size[1]; - glScalef(scale, scale, scale); - - if(pchan->ikflag & BONE_IK_XLIMIT) { - if(pchan->ikflag & BONE_IK_ZLIMIT) { - float amin[3], amax[3]; - - for(i=0; i<3; i++) { - amin[i]= sin(pchan->limitmin[i]*M_PI/360.0); - amax[i]= sin(pchan->limitmax[i]*M_PI/360.0); - } - - glScalef(1.0, -1.0, 1.0); - if (amin[0] != 0.0 && amin[2] != 0.0) - draw_dof_ellipse(amin[0], amin[2]); - if (amin[0] != 0.0 && amax[2] != 0.0) - draw_dof_ellipse(amin[0], amax[2]); - if (amax[0] != 0.0 && amin[2] != 0.0) - draw_dof_ellipse(amax[0], amin[2]); - if (amax[0] != 0.0 && amax[2] != 0.0) - draw_dof_ellipse(amax[0], amax[2]); - glScalef(1.0, -1.0, 1.0); - } - } - - /* arcs */ - if(pchan->ikflag & BONE_IK_ZLIMIT) { - theta= 0.5*(pchan->limitmin[2]+pchan->limitmax[2]); - glRotatef(theta, 0.0f, 0.0f, 1.0f); - - glColor3ub(50, 50, 255); // blue, Z axis limit - glBegin(GL_LINE_STRIP); - for(a=-16; a<=16; a++) { - float fac= ((float)a)/16.0f; - phi= fac*(M_PI/360.0f)*(pchan->limitmax[2]-pchan->limitmin[2]); - - if(a==-16) i= 0; else i= 1; - corner[i][0]= sin(phi); - corner[i][1]= cos(phi); - corner[i][2]= 0.0f; - glVertex3fv(corner[i]); - } - glEnd(); - - glRotatef(-theta, 0.0f, 0.0f, 1.0f); - } - - if(pchan->ikflag & BONE_IK_XLIMIT) { - theta= 0.5*( pchan->limitmin[0]+pchan->limitmax[0]); - glRotatef(theta, 1.0f, 0.0f, 0.0f); - - glColor3ub(255, 50, 50); // Red, X axis limit - glBegin(GL_LINE_STRIP); - for(a=-16; a<=16; a++) { - float fac= ((float)a)/16.0f; - phi= 0.5f*M_PI + fac*(M_PI/360.0f)*(pchan->limitmax[0]-pchan->limitmin[0]); - - if(a==-16) i= 2; else i= 3; - corner[i][0]= 0.0f; - corner[i][1]= sin(phi); - corner[i][2]= cos(phi); - glVertex3fv(corner[i]); - } - glEnd(); - - glRotatef(-theta, 1.0f, 0.0f, 0.0f); - } - - glPopMatrix(); // out of cone, out of bone - } - } - } - } - } - } -} - -/* assumes object is Armature with pose */ -static void draw_pose_channels(Base *base, int dt) -{ - Object *ob= base->object; - bArmature *arm= ob->data; - bPoseChannel *pchan; - Bone *bone; - GLfloat tmp; - float smat[4][4], imat[4][4]; - int index= -1; - int do_dashed= 1; - short flag, constflag; - - /* hacky... prevent outline select from drawing dashed helplines */ - glGetFloatv(GL_LINE_WIDTH, &tmp); - if(tmp > 1.1) do_dashed= 0; - if (G.vd->flag & V3D_HIDE_HELPLINES) do_dashed= 0; - - /* precalc inverse matrix for drawing screen aligned */ - if(arm->drawtype==ARM_ENVELOPE) { - /* precalc inverse matrix for drawing screen aligned */ - mygetmatrix(smat); - Mat4MulFloat3(smat[0], 1.0f/VecLength(ob->obmat[0])); - Mat4Invert(imat, smat); - - /* and draw blended distances */ - if(arm->flag & ARM_POSEMODE) { - glEnable(GL_BLEND); - //glShadeModel(GL_SMOOTH); - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone && !(bone->flag & (BONE_HIDDEN_P|BONE_NO_DEFORM|BONE_HIDDEN_PG))) { - if(bone->flag & (BONE_SELECTED)) - if(bone->layer & arm->layer) - draw_sphere_bone_dist(smat, imat, bone->flag, pchan, NULL); - } - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - //glShadeModel(GL_FLAT); - } - } - - /* little speedup, also make sure transparent only draws once */ - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - - /* if solid we draw that first, with selection codes, but without names, axes etc */ - if(dt>OB_WIRE) { - if(arm->flag & ARM_POSEMODE) index= base->selcol; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) { - if(bone->layer & arm->layer) { - glPushMatrix(); - glMultMatrixf(pchan->pose_mat); - - /* catch exception for bone with hidden parent */ - flag= bone->flag; - if(bone->parent && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) - flag &= ~BONE_CONNECTED; - - if(pchan->custom && !(arm->flag & ARM_NO_CUSTOM)) - draw_custom_bone(pchan->custom, OB_SOLID, arm->flag, flag, index, bone->length); - else if(arm->drawtype==ARM_LINE) - ; /* nothing in solid */ - else if(arm->drawtype==ARM_ENVELOPE) - draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL); - else if(arm->drawtype==ARM_B_BONE) - draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, pchan, NULL); - else { - draw_bone(OB_SOLID, arm->flag, flag, 0, index, bone->length); - } - glPopMatrix(); - } - } - if (index!= -1) index+= 0x10000; // pose bones count in higher 2 bytes only - } - /* very very confusing... but in object mode, solid draw, we cannot do glLoadName yet, stick bones are drawn in next loop */ - if(arm->drawtype!=ARM_LINE) { - glLoadName (index & 0xFFFF); // object tag, for bordersel optim - index= -1; - } - } - - /* wire draw over solid only in posemode */ - if( dt<=OB_WIRE || (arm->flag & ARM_POSEMODE) || arm->drawtype==ARM_LINE) { - - /* draw line check first. we do selection indices */ - if (arm->drawtype==ARM_LINE) { - if (arm->flag & ARM_POSEMODE) index= base->selcol; - } - /* if solid && posemode, we draw again with polygonoffset */ - else if (dt>OB_WIRE && (arm->flag & ARM_POSEMODE)) - bglPolygonOffset(1.0); - else - /* and we use selection indices if not done yet */ - if (arm->flag & ARM_POSEMODE) index= base->selcol; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone && !(bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) { - if(bone->layer & arm->layer) { - if (do_dashed && bone->parent) { - /* Draw a line from our root to the parent's tip */ - if(!(bone->flag & BONE_CONNECTED) ){ - if (arm->flag & ARM_POSEMODE) { - glLoadName (index & 0xFFFF); // object tag, for bordersel optim - BIF_ThemeColor(TH_WIRE); - } - setlinestyle(3); - glBegin(GL_LINES); - glVertex3fv(pchan->pose_head); - glVertex3fv(pchan->parent->pose_tail); - glEnd(); - setlinestyle(0); - } - // Draw a line to IK root bone - if(arm->flag & ARM_POSEMODE) { - if(pchan->constflag & PCHAN_HAS_IK) { - if(bone->flag & BONE_SELECTED) { - - if(pchan->constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0); - else glColor3ub(200, 200, 50); // add theme! - - glLoadName (index & 0xFFFF); - pchan_draw_IK_root_lines(pchan); - } - } - } - } - - if(arm->drawtype!=ARM_ENVELOPE) { - glPushMatrix(); - glMultMatrixf(pchan->pose_mat); - } - - /* catch exception for bone with hidden parent */ - flag= bone->flag; - if(bone->parent && (bone->parent->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))) - flag &= ~BONE_CONNECTED; - - /* extra draw service for pose mode */ - constflag= pchan->constflag; - if(pchan->flag & (POSE_ROT|POSE_LOC|POSE_SIZE)) - constflag |= PCHAN_HAS_ACTION; - if(pchan->flag & POSE_STRIDE) - constflag |= PCHAN_HAS_STRIDE; - - if(pchan->custom && !(arm->flag & ARM_NO_CUSTOM)) { - if(dtcustom, OB_WIRE, arm->flag, flag, index, bone->length); - } - else if(arm->drawtype==ARM_ENVELOPE) { - if(dtflag, flag, constflag, index, pchan, NULL); - } - else if(arm->drawtype==ARM_LINE) - draw_line_bone(arm->flag, flag, constflag, index, pchan, NULL); - else if(arm->drawtype==ARM_B_BONE) - draw_b_bone(OB_WIRE, arm->flag, flag, constflag, index, pchan, NULL); - else { - draw_bone(OB_WIRE, arm->flag, flag, constflag, index, bone->length); - } - - if(arm->drawtype!=ARM_ENVELOPE) - glPopMatrix(); - } - } - if (index!= -1) index+= 0x10000; // pose bones count in higher 2 bytes only - } - /* restore things */ - if (arm->drawtype!=ARM_LINE && dt>OB_WIRE && (arm->flag & ARM_POSEMODE)) - bglPolygonOffset(0.0); - - } - - /* restore */ - glDisable(GL_CULL_FACE); - - /* draw DoFs */ - if (arm->flag & ARM_POSEMODE) - draw_pose_dofs(ob); - - /* finally names and axes */ - if(arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) { - // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing - if((G.f & G_PICKSEL) == 0) { - float vec[3]; - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if((pchan->bone->flag & (BONE_HIDDEN_P|BONE_HIDDEN_PG))==0) { - if(pchan->bone->layer & arm->layer) { - if (arm->flag & (ARM_EDITMODE|ARM_POSEMODE)) { - bone= pchan->bone; - if(bone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - } - else if(dt > OB_WIRE) BIF_ThemeColor(TH_TEXT); - - if (arm->flag & ARM_DRAWNAMES){ - VecMidf(vec, pchan->pose_head, pchan->pose_tail); - glRasterPos3fv(vec); - BMF_DrawString(G.font, " "); - BMF_DrawString(G.font, pchan->name); - } - /* Draw additional axes */ - if( (arm->flag & ARM_DRAWAXES) && (arm->flag & ARM_POSEMODE) ){ - glPushMatrix(); - glMultMatrixf(pchan->pose_mat); - glTranslatef(0.0f, pchan->bone->length, 0.0f); - drawaxes(0.25f*pchan->bone->length, 0, OB_ARROWS); - glPopMatrix(); - } - } - } - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - } - } - -} - -/* in editmode, we don't store the bone matrix... */ -static void set_matrix_editbone(EditBone *eBone) -{ - float delta[3],offset[3]; - float mat[3][3], bmat[4][4]; - - /* Compose the parent transforms (i.e. their translations) */ - VECCOPY (offset, eBone->head); - - glTranslatef (offset[0],offset[1],offset[2]); - - VecSubf(delta, eBone->tail, eBone->head); - - eBone->length = sqrt (delta[0]*delta[0] + delta[1]*delta[1] +delta[2]*delta[2]); - - vec_roll_to_mat3(delta, eBone->roll, mat); - Mat4CpyMat3(bmat, mat); - - glMultMatrixf (bmat); - -} - -static void draw_ebones(Object *ob, int dt) -{ - EditBone *eBone; - bArmature *arm= ob->data; - float smat[4][4], imat[4][4]; - unsigned int index; - int flag; - - /* envelope (deform distance) */ - if(arm->drawtype==ARM_ENVELOPE) { - /* precalc inverse matrix for drawing screen aligned */ - mygetmatrix(smat); - Mat4MulFloat3(smat[0], 1.0f/VecLength(ob->obmat[0])); - Mat4Invert(imat, smat); - - /* and draw blended distances */ - glEnable(GL_BLEND); - //glShadeModel(GL_SMOOTH); - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++){ - if(eBone->layer & arm->layer) - if(!(eBone->flag & (BONE_HIDDEN_A|BONE_NO_DEFORM))) - if(eBone->flag & (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL)) - draw_sphere_bone_dist(smat, imat, eBone->flag, NULL, eBone); - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - glDisable(GL_BLEND); - //glShadeModel(GL_FLAT); - } - - /* if solid we draw it first */ - if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) { - index= 0; - for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++){ - if(eBone->layer & arm->layer) { - if(!(eBone->flag & BONE_HIDDEN_A)) { - glPushMatrix(); - set_matrix_editbone(eBone); - - /* catch exception for bone with hidden parent */ - flag= eBone->flag; - if(eBone->parent && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) ) - flag &= ~BONE_CONNECTED; - - if(arm->drawtype==ARM_ENVELOPE) - draw_sphere_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone); - else if(arm->drawtype==ARM_B_BONE) - draw_b_bone(OB_SOLID, arm->flag, flag, 0, index, NULL, eBone); - else { - draw_bone(OB_SOLID, arm->flag, flag, 0, index, eBone->length); - } - - glPopMatrix(); - } - } - } - } - - /* if wire over solid, set offset */ - index= -1; - glLoadName(-1); - if(arm->drawtype==ARM_LINE) { - if(G.f & G_PICKSEL) - index= 0; - } - else if (dt>OB_WIRE) - bglPolygonOffset(1.0); - else if(arm->flag & ARM_EDITMODE) - index= 0; // do selection codes - - for (eBone=G.edbo.first; eBone; eBone=eBone->next){ - if(eBone->layer & arm->layer) { - if(!(eBone->flag & BONE_HIDDEN_A)) { - - /* catch exception for bone with hidden parent */ - flag= eBone->flag; - if(eBone->parent && ((eBone->parent->flag & BONE_HIDDEN_A) || (eBone->parent->layer & arm->layer)==0) ) - flag &= ~BONE_CONNECTED; - - if(arm->drawtype==ARM_ENVELOPE) { - if(dtflag, flag, 0, index, NULL, eBone); - } - else { - glPushMatrix(); - set_matrix_editbone(eBone); - - if(arm->drawtype==ARM_LINE) - draw_line_bone(arm->flag, flag, 0, index, NULL, eBone); - else if(arm->drawtype==ARM_B_BONE) - draw_b_bone(OB_WIRE, arm->flag, flag, 0, index, NULL, eBone); - else - draw_bone(OB_WIRE, arm->flag, flag, 0, index, eBone->length); - - glPopMatrix(); - } - - /* offset to parent */ - if (eBone->parent) { - BIF_ThemeColor(TH_WIRE); - glLoadName (-1); // -1 here is OK! - setlinestyle(3); - - glBegin(GL_LINES); - glVertex3fv(eBone->parent->tail); - glVertex3fv(eBone->head); - glEnd(); - - setlinestyle(0); - } - } - } - if(index!=-1) index++; - } - - /* restore */ - if(arm->drawtype==ARM_LINE); - else if (dt>OB_WIRE) bglPolygonOffset(0.0); - - /* finally names and axes */ - if(arm->flag & (ARM_DRAWNAMES|ARM_DRAWAXES)) { - // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing - if((G.f & G_PICKSEL) == 0) { - float vec[3]; - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++){ - if(eBone->layer & arm->layer) { - if(!(eBone->flag & BONE_HIDDEN_A)) { - - if(eBone->flag & BONE_SELECTED) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - - /* Draw name */ - if(arm->flag & ARM_DRAWNAMES){ - VecMidf(vec, eBone->head, eBone->tail); - glRasterPos3fv(vec); - BMF_DrawString(G.font, " "); - BMF_DrawString(G.font, eBone->name); - } - /* Draw additional axes */ - if(arm->flag & ARM_DRAWAXES){ - glPushMatrix(); - set_matrix_editbone(eBone); - glTranslatef(0.0f, eBone->length, 0.0f); - drawaxes(eBone->length*0.25f, 0, OB_ARROWS); - glPopMatrix(); - } - - } - } - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - } - } -} - -/* ****************************** Armature Visualisation ******************************** */ - -/* ---------- Paths --------- */ - -/* draw bone paths - * - in view space - */ -static void draw_pose_paths(Object *ob) -{ - bArmature *arm= ob->data; - bPoseChannel *pchan; - bAction *act; - bActionChannel *achan; - ActKeyColumn *ak; - ListBase keys; - float *fp, *fp_start; - int a, stepsize; - int sfra, efra, len; - - if (G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - glPushMatrix(); - glLoadMatrixf(G.vd->viewmat); - - /* version patch here - cannot access frame info from file reading */ - if (arm->pathsize == 0) arm->pathsize= 1; - stepsize = arm->pathsize; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (pchan->bone->layer & arm->layer) { - if (pchan->path) { - /* version patch here - cannot access frame info from file reading */ - if ((pchan->pathsf == 0) || (pchan->pathef == 0)) { - pchan->pathsf= SFRA; - pchan->pathef= EFRA; - } - - /* get frame ranges */ - if (arm->pathflag & ARM_PATH_ACFRA) { - int sind; - - /* With "Around Current", we only choose frames from around - * the current frame to draw. However, this range is still - * restricted by the limits of the original path. - */ - sfra= CFRA - arm->pathbc; - efra= CFRA + arm->pathac; - if (sfra < pchan->pathsf) sfra= pchan->pathsf; - if (efra > pchan->pathef) efra= pchan->pathef; - - len= efra - sfra; - - sind= sfra - pchan->pathsf; - fp_start= (pchan->path + (3*sind)); - } - else { - sfra= pchan->pathsf; - efra = sfra + pchan->pathlen; - len = pchan->pathlen; - fp_start = pchan->path; - } - - /* draw curve-line of path */ - glShadeModel(GL_SMOOTH); - - glBegin(GL_LINE_STRIP); - for (a=0, fp=fp_start; abone->flag & BONE_SELECTED) { - // intensity= 0.5; - intensity = SET_INTENSITY(sfra, a, CFRA, 0.25f, 0.75f); - } - else { - //intensity= 0.8; - intensity = SET_INTENSITY(sfra, a, CFRA, 0.68f, 0.92f); - } - BIF_ThemeColorBlend(TH_WIRE, TH_BACK, intensity); - } - else if ((a+sfra) > CFRA) { - /* blue - after cfra */ - if (pchan->bone->flag & BONE_SELECTED) { - //intensity = 0.5; - intensity = SET_INTENSITY(CFRA, a, efra, 0.25f, 0.75f); - } - else { - //intensity = 0.8; - intensity = SET_INTENSITY(CFRA, a, efra, 0.68f, 0.92f); - } - BIF_ThemeColorBlend(TH_BONE_POSE, TH_BACK, intensity); - } - else { - /* green - on cfra */ - if (pchan->bone->flag & BONE_SELECTED) { - intensity= 0.3; - } - else { - intensity= 0.8; - } - BIF_ThemeColorBlend(TH_CFRAME, TH_BACK, intensity); - } - - /* draw a vertex with this colour */ - glVertex3fv(fp); - } - - glEnd(); - glShadeModel(GL_FLAT); - - glPointSize(1.0); - - /* draw little black point at each frame - * NOTE: this is not really visible/noticable - */ - glBegin(GL_POINTS); - for (a=0, fp=fp_start; apathflag & ARM_PATH_FNUMS) { - for (a=0, fp=fp_start; a stepsize) && (a < len-stepsize)) { - if ((VecEqual(fp, fp-(stepsize*3))==0) || (VecEqual(fp, fp+(stepsize*3))==0)) { - glRasterPos3fv(fp); - sprintf(str, " %d\n", (a+sfra)); - BMF_DrawString(G.font, str); - } - } - } - } - - /* Keyframes - dots and numbers */ - if (arm->pathflag & ARM_PATH_KFRAS) { - /* build list of all keyframes in active action for pchan */ - keys.first = keys.last = NULL; - act= ob_get_action(ob); - if (act) { - achan= get_action_channel(act, pchan->name); - if (achan) - ipo_to_keylist(achan->ipo, &keys, NULL); - } - - /* Draw slightly-larger yellow dots at each keyframe */ - BIF_ThemeColor(TH_VERTEX_SELECT); - glPointSize(5.0); - - glBegin(GL_POINTS); - for (a=0, fp=fp_start; anext) { - if (ak->cfra == (a+sfra)) - glVertex3fv(fp); - } - } - glEnd(); - - glPointSize(1.0); - - /* Draw frame numbers of keyframes */ - if ((arm->pathflag & ARM_PATH_FNUMS) || (arm->pathflag & ARM_PATH_KFNOS)) { - for(a=0, fp=fp_start; anext) { - if (ak->cfra == (a+sfra)) { - char str[32]; - - glRasterPos3fv(fp); - sprintf(str, " %d\n", (a+sfra)); - BMF_DrawString(G.font, str); - } - } - } - } - - BLI_freelistN(&keys); - } - } - } - } - - if (G.vd->zbuf) glEnable(GL_DEPTH_TEST); - glPopMatrix(); -} - - -/* ---------- Ghosts --------- */ - -/* helper function for ghost drawing - sets/removes flags for temporarily - * hiding unselected bones while drawing ghosts - */ -static void ghost_poses_tag_unselected(Object *ob, short unset) -{ - bArmature *arm= ob->data; - bPose *pose= ob->pose; - bPoseChannel *pchan; - - /* don't do anything if no hiding any bones */ - if ((arm->flag & ARM_GHOST_ONLYSEL)==0) - return; - - /* loop over all pchans, adding/removing tags as appropriate */ - for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (arm->layer & pchan->bone->layer)) { - if (unset) { - /* remove tags from all pchans if cleaning up */ - pchan->bone->flag &= ~BONE_HIDDEN_PG; - } - else { - /* set tags on unselected pchans only */ - if ((pchan->bone->flag & BONE_SELECTED)==0) - pchan->bone->flag |= BONE_HIDDEN_PG; - } - } - } -} - -/* draw ghosts that occur within a frame range - * note: object should be in posemode - */ -static void draw_ghost_poses_range(Base *base) -{ - Object *ob= base->object; - bArmature *arm= ob->data; - bPose *posen, *poseo; - float start, end, stepsize, range, colfac; - int cfrao, flago, ipoflago; - - start = arm->ghostsf; - end = arm->ghostef; - if (end <= start) - return; - - stepsize= (float)(arm->ghostsize); - range= (float)(end - start); - - /* store values */ - ob->flag &= ~OB_POSEMODE; - cfrao= CFRA; - flago= arm->flag; - arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); - ipoflago= ob->ipoflag; - ob->ipoflag |= OB_DISABLE_PATH; - - /* copy the pose */ - poseo= ob->pose; - copy_pose(&posen, ob->pose, 1); - ob->pose= posen; - armature_rebuild_pose(ob, ob->data); /* child pointers for IK */ - ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */ - - glEnable(GL_BLEND); - if (G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - /* draw from first frame of range to last */ - for (CFRA= start; CFRAzbuf) glEnable(GL_DEPTH_TEST); - - ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */ - free_pose_channels(posen); - MEM_freeN(posen); - - /* restore */ - CFRA= cfrao; - ob->pose= poseo; - arm->flag= flago; - armature_rebuild_pose(ob, ob->data); - ob->flag |= OB_POSEMODE; - ob->ipoflag= ipoflago; -} - -/* draw ghosts on keyframes in action within range - * - object should be in posemode - */ -static void draw_ghost_poses_keys(Base *base) -{ - Object *ob= base->object; - bAction *act= ob_get_action(ob); - bArmature *arm= ob->data; - bPose *posen, *poseo; - ListBase keys= {NULL, NULL}; - ActKeyColumn *ak, *akn; - float start, end, range, colfac, i; - int cfrao, flago, ipoflago; - - start = arm->ghostsf; - end = arm->ghostef; - if (end <= start) - return; - - /* get keyframes - then clip to only within range */ - action_to_keylist(act, &keys, NULL); - range= 0; - for (ak= keys.first; ak; ak= akn) { - akn= ak->next; - - if ((ak->cfra < start) || (ak->cfra > end)) - BLI_freelinkN(&keys, ak); - else - range++; - } - if (range == 0) return; - - /* store values */ - ob->flag &= ~OB_POSEMODE; - cfrao= CFRA; - flago= arm->flag; - arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); - ipoflago= ob->ipoflag; - ob->ipoflag |= OB_DISABLE_PATH; - - /* copy the pose */ - poseo= ob->pose; - copy_pose(&posen, ob->pose, 1); - ob->pose= posen; - armature_rebuild_pose(ob, ob->data); /* child pointers for IK */ - ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */ - - glEnable(GL_BLEND); - if (G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - /* draw from first frame of range to last */ - for (ak=keys.first, i=0; ak; ak=ak->next, i++) { - colfac = i/range; - BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac))); - - CFRA= (int)ak->cfra; - - do_all_pose_actions(ob); - where_is_pose(ob); - draw_pose_channels(base, OB_WIRE); - } - glDisable(GL_BLEND); - if (G.vd->zbuf) glEnable(GL_DEPTH_TEST); - - ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */ - free_pose_channels(posen); - BLI_freelistN(&keys); - MEM_freeN(posen); - - /* restore */ - CFRA= cfrao; - ob->pose= poseo; - arm->flag= flago; - armature_rebuild_pose(ob, ob->data); - ob->flag |= OB_POSEMODE; - ob->ipoflag= ipoflago; -} - -/* draw ghosts around current frame - * - object is supposed to be armature in posemode - */ -static void draw_ghost_poses(Base *base) -{ - Object *ob= base->object; - bArmature *arm= ob->data; - bPose *posen, *poseo; - bActionStrip *strip; - float cur, start, end, stepsize, range, colfac, actframe, ctime; - int cfrao, maptime, flago, ipoflago; - - /* pre conditions, get an action with sufficient frames */ - if (ob->action==NULL) - return; - - calc_action_range(ob->action, &start, &end, 0); - if (start == end) - return; - - stepsize= (float)(arm->ghostsize); - range= (float)(arm->ghostep)*stepsize + 0.5f; /* plus half to make the for loop end correct */ - - /* we only map time for armature when an active strip exists */ - for (strip=ob->nlastrips.first; strip; strip=strip->next) - if (strip->flag & ACTSTRIP_ACTIVE) - break; - - maptime= (strip!=NULL); - - /* store values */ - ob->flag &= ~OB_POSEMODE; - cfrao= CFRA; - if (maptime) actframe= get_action_frame(ob, (float)CFRA); - else actframe= CFRA; - flago= arm->flag; - arm->flag &= ~(ARM_DRAWNAMES|ARM_DRAWAXES); - ipoflago= ob->ipoflag; - ob->ipoflag |= OB_DISABLE_PATH; - - /* copy the pose */ - poseo= ob->pose; - copy_pose(&posen, ob->pose, 1); - ob->pose= posen; - armature_rebuild_pose(ob, ob->data); /* child pointers for IK */ - ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */ - - glEnable(GL_BLEND); - if (G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - /* draw from darkest blend to lowest */ - for(cur= stepsize; cur= start && actframe+ctime <= end) { - if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe+ctime); - else CFRA= (int)floor(actframe+ctime); - - if (CFRA!=cfrao) { - do_all_pose_actions(ob); - where_is_pose(ob); - draw_pose_channels(base, OB_WIRE); - } - } - - ctime= cur + fmod((float)cfrao, stepsize) - stepsize+1.0f; /* ensures consistant stepping */ - colfac= ctime/range; - BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -128-(int)(120.0f*sqrt(colfac))); - - /* only within action range */ - if ((actframe-ctime >= start) && (actframe-ctime <= end)) { - if (maptime) CFRA= (int)get_action_frame_inv(ob, actframe-ctime); - else CFRA= (int)floor(actframe-ctime); - - if (CFRA != cfrao) { - do_all_pose_actions(ob); - where_is_pose(ob); - draw_pose_channels(base, OB_WIRE); - } - } - } - glDisable(GL_BLEND); - if (G.vd->zbuf) glEnable(GL_DEPTH_TEST); - - ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */ - free_pose_channels(posen); - MEM_freeN(posen); - - /* restore */ - CFRA= cfrao; - ob->pose= poseo; - arm->flag= flago; - armature_rebuild_pose(ob, ob->data); - ob->flag |= OB_POSEMODE; - ob->ipoflag= ipoflago; -} - -/* ********************************** Armature Drawing - Main ************************* */ - -/* called from drawobject.c, return 1 if nothing was drawn */ -int draw_armature(Base *base, int dt) -{ - Object *ob= base->object; - bArmature *arm= ob->data; - int retval= 0; - - if(dt>OB_WIRE && arm->drawtype!=ARM_LINE) { - /* we use color for solid lighting */ - glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR); - glEnable(GL_COLOR_MATERIAL); - glColor3ub(0,0,0); // clear spec - glDisable(GL_COLOR_MATERIAL); - - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); // only for lighting... - } - - /* arm->flag is being used to detect mode... */ - /* editmode? */ - if(ob==G.obedit || (G.obedit && ob->data==G.obedit->data)) { - if(ob==G.obedit) arm->flag |= ARM_EDITMODE; - draw_ebones(ob, dt); - arm->flag &= ~ARM_EDITMODE; - } - else{ - /* Draw Pose */ - if(ob->pose && ob->pose->chanbase.first) { - /* drawing posemode selection indices or colors only in these cases */ - if(!(base->flag & OB_FROMDUPLI)) { - if(G.f & G_PICKSEL) { - if(ob->flag & OB_POSEMODE) - arm->flag |= ARM_POSEMODE; - } - else if(ob->flag & OB_POSEMODE) { - if (arm->ghosttype == ARM_GHOST_RANGE) { - draw_ghost_poses_range(base); - } - else if (arm->ghosttype == ARM_GHOST_KEYS) { - draw_ghost_poses_keys(base); - } - else if (arm->ghosttype == ARM_GHOST_CUR) { - if (arm->ghostep) - draw_ghost_poses(base); - } - - if(ob==OBACT) - arm->flag |= ARM_POSEMODE; - else if(G.f & G_WEIGHTPAINT) - arm->flag |= ARM_POSEMODE; - - draw_pose_paths(ob); - } - } - draw_pose_channels(base, dt); - arm->flag &= ~ARM_POSEMODE; - - if(ob->flag & OB_POSEMODE) - BIF_ThemeColor(TH_WIRE); /* restore, for extra draw stuff */ - } - else retval= 1; - } - /* restore */ - glFrontFace(GL_CCW); - - return retval; -} - -/* *************** END Armature drawing ******************* */ - diff --git a/source/blender/src/drawdeps.c b/source/blender/src/drawdeps.c deleted file mode 100644 index d948f31009b..00000000000 --- a/source/blender/src/drawdeps.c +++ /dev/null @@ -1,316 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 Blender Foundation. - * All rights reserved. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef _WIN32 -#include "BLI_winstuff.h" -#endif - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_ID.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_action_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_interface.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" - -#include "BIF_oops.h" - -#include "BSE_drawipo.h" -#include "BSE_drawoops.h" -#include "MEM_guardedalloc.h" -#include "blendef.h" - - -#include "depsgraph_private.h" - -#ifdef WIN32 -#else -#include -#endif - - - -void boundbox_deps() -{ - DagNode *node; - float min[2], max[2]; - - if(G.soops==0) return; - - min[0]= 1000.0; - max[0]= -10000.0; - min[1]= 1000.0; - max[1]= -1000.0; - - node = getMainDag()->DagNode.first; - while(node) { - min[0]= MIN2(min[0], node->x); - max[0]= MAX2(max[0], node->x+OOPSX); - min[1]= MIN2(min[1], node->y); - max[1]= MAX2(max[1], node->y+OOPSY); - - node= node->next; - } - - G.v2d->tot.xmin= min[0]; - G.v2d->tot.xmax= max[0]; - G.v2d->tot.ymin= min[1]; - G.v2d->tot.ymax= max[1]; -} - -static unsigned int get_line_color(DagAdjList *child) -{ - switch (child->type) { - case DAG_RL_SCENE : - return 0x00000; - case DAG_RL_DATA : - return 0xFF0000; - case DAG_RL_OB_OB : - return 0x00FF00; - case DAG_RL_OB_DATA : - return 0xFFFF00; - case DAG_RL_DATA_OB : - return 0x000000; - case DAG_RL_DATA_DATA : - return 0x0000FF; - default : - return 0xFF00FF; - } - //return 0x00000; -} - - -static void draw_deps(DagNode *node) -{ - float v1[2], x1, y1, x2, y2; - unsigned int body, border; - short line= 0; - char str[32]; - DagAdjList *itA = node->child; - - x1= node->x; - x2= node->x+DEPSX; - y1= node->y; - y2= node->y+DEPSY; - - if(x2 < G.v2d->cur.xmin || x1 > G.v2d->cur.xmax) return; - if(y2 < G.v2d->cur.ymin || y1 > G.v2d->cur.ymax) return; - - body = give_oops_color(node->type, 0, &border); - - line= 0; -// border= 00; - cpack(body); - - glRectf(x1, y1, x2, y2); - - v1[0]= x1; - v1[1]= (y1+y2)/2 -0.3f; - sprintf(str, " %s", ((ID *) node->ob)->name+2); - - calc_oopstext(str, v1); - - /* ICON */ -// if(str[1] && oopscalex>1.1) { - draw_icon_oops(v1, node->type); -// } - - - cpack(0x0); - glRasterPos3f(v1[0], v1[1], 0.0); - BMF_DrawString(G.fonts, str); - - - if(line) setlinestyle(2); - cpack(border); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glRectf(x1, y1, x2, y2); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - if(line) setlinestyle(0); - - while (itA) { /* draw connection lines */ - cpack(get_line_color(itA)); - glBegin(GL_LINE_STRIP); - glVertex2f(node->x+DEPSX, node->y+ 0.5*DEPSY); - glVertex2f(itA->node->x, itA->node->y+ 0.5*DEPSY); - glEnd(); - itA = itA->next; - } - /* Draw the little rounded connection point */ - glColor3ub(0, 0, 0); - glPushMatrix(); - - glTranslatef(node->x , node->y+ 0.5*DEPSY, 0.0); - glutil_draw_filled_arc(-M_PI/2, M_PI, 0.07*DEPSX, 7); - - glPopMatrix(); - -} - -void draw_all_deps(void) -{ - DagNode *node; - DagForest *dag; - - dag = getMainDag(); - node = dag->DagNode.first; - //node = node->next; - while(node) { - draw_deps(node); - node = node->next; - } - free_forest(dag); - MEM_freeN(dag); - setMainDag(NULL); -} - - - - -int build_deps(short mask) -{ - Base *base; - Object *ob = NULL; - DagNode * node = NULL; - DagNode * node2 = NULL ; -DagNode * scenenode; - DagForest *dag; - -#ifdef DEPS_DEBUG - //timers - struct timeval tp1, tp2, tp3, tp4; - - gettimeofday(&tp1,NULL); -#endif - - DagNodeQueue *retqueue; - -// float y = 0; -// int maxlev = 0; - - if(G.soops==0) return -1; - - - // rebuilt each time for now - dag = getMainDag(); - if ( dag) - free_forest( dag ); - else { - dag = dag_init(); - setMainDag(dag); - } - - // add base node for scene. scene is always the first node in DAG - scenenode = dag_add_node(dag, G.scene); - set_node_xy(scenenode,0.0, 0.0); - /* blocks from this scene */ - - - /* targets in object struct yet to be added. should even they ? - struct Ipo *ipo; - ListBase nlastrips; - ListBase hooks; - */ - - - base= FIRSTBASE; - while(base) { // add all objects in any case - int addtoroot = 1; - - // graph_print_adj_list(); - ob= (Object *) base->object; - - node = dag_get_node(dag,ob); - - if ((ob->data) && (mask&DAG_RL_DATA)) { - node2 = dag_get_node(dag,ob->data); - dag_add_relation(dag,node,node2,DAG_RL_DATA); - node2->first_ancestor = ob; - node2->ancestor_count += 1; - - } - - if (addtoroot == 1 ) - dag_add_relation(dag,scenenode,node,DAG_RL_SCENE); - - base= base->next; - } - -//graph_print_adj_list(); -//fprintf(stderr,"building deps\n"); -#ifdef DEPS_DEBUG - gettimeofday(&tp2,NULL); -#endif - -//graph_bfs(); //set levels - -#ifdef DEPS_DEBUG -gettimeofday(&tp3,NULL); -#endif - - -retqueue = graph_dfs(); //set levels -#ifdef DEPS_DEBUG -gettimeofday(&tp4,NULL); -fprintf(stderr,"************************************\n"); -graph_print_queue_dist(retqueue); -//graph_print_queue(retqueue); - -fprintf(stderr,"TIME BUILD %d %d BFS %d %d DFS %d %d\n",tp2.tv_sec-tp1.tv_sec ,tp2.tv_usec-tp1.tv_usec - , tp3.tv_sec-tp2.tv_sec ,tp3.tv_usec-tp2.tv_usec - , tp4.tv_sec-tp3.tv_sec ,tp4.tv_usec-tp3.tv_usec); -#endif - -queue_delete(retqueue); - -//graph_print_adj_list(); -return 0; -} diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c deleted file mode 100644 index 65ee3077adb..00000000000 --- a/source/blender/src/drawimage.c +++ /dev/null @@ -1,2721 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Blender Foundation, 2002-2006 - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "DNA_brush_types.h" -#include "DNA_camera_types.h" -#include "DNA_color_types.h" -#include "DNA_image_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_brush.h" -#include "BKE_colortools.h" -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_image.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_object.h" - -#include "BDR_editface.h" -#include "BDR_drawobject.h" -#include "BDR_drawmesh.h" -#include "BDR_imagepaint.h" - -#include "BIF_cursors.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_mywindow.h" -#include "BIF_drawimage.h" -#include "BIF_resources.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_editsima.h" -#include "BIF_glutil.h" -#include "BIF_renderwin.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" -#include "BIF_editmesh.h" - -#include "BSE_drawipo.h" -#include "BSE_drawview.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" - -#include "RE_pipeline.h" -#include "BMF_Api.h" - -#include "PIL_time.h" - -/* Modules used */ -#include "mydevice.h" -#include "blendef.h" -#include "butspace.h" // event codes -#include "winlay.h" - -#include "interface.h" /* bad.... but preview code needs UI info. Will solve... (ton) */ - -static unsigned char *alloc_alpha_clone_image(int *width, int *height) -{ - Brush *brush = G.scene->toolsettings->imapaint.brush; - ImBuf *ibuf; - unsigned int size, alpha; - unsigned char *rect, *cp; - - if(!brush || !brush->clone.image) - return NULL; - - ibuf= BKE_image_get_ibuf(brush->clone.image, NULL); - - if(!ibuf || !ibuf->rect) - return NULL; - - rect= MEM_dupallocN(ibuf->rect); - if(!rect) - return NULL; - - *width= ibuf->x; - *height= ibuf->y; - - size= (*width)*(*height); - alpha= (unsigned char)255*brush->clone.alpha; - cp= rect; - - while(size-- > 0) { - cp[3]= alpha; - cp += 4; - } - - return rect; -} - -static int image_preview_active(ScrArea *sa, float *xim, float *yim) -{ - SpaceImage *sima= sa->spacedata.first; - - /* only when compositor shows, and image handler set */ - if(sima->image && sima->image->type==IMA_TYPE_COMPOSITE) { - short a; - - for(a=0; ablockhandler[a] == IMAGE_HANDLER_PREVIEW) { - if(xim) *xim= (G.scene->r.size*G.scene->r.xsch)/100; - if(yim) *yim= (G.scene->r.size*G.scene->r.ysch)/100; - return 1; - } - } - } - return 0; -} - - -/** - * Sets up the fields of the View2D member of the SpaceImage struct - * This routine can be called in two modes: - * mode == 'f': float mode (0.0 - 1.0) - * mode == 'p': pixel mode (0 - size) - * - * @param sima the image space to update - * @param mode the mode to use for the update - * @return void - * - */ -void calc_image_view(SpaceImage *sima, char mode) -{ - float xim=256, yim=256; - float x1, y1; - - if(image_preview_active(curarea, &xim, &yim)); - else if(sima->image) { - ImBuf *ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - float xuser_asp, yuser_asp; - - aspect_sima(sima, &xuser_asp, &yuser_asp); - if(ibuf) { - xim= ibuf->x * xuser_asp; - yim= ibuf->y * yuser_asp; - } - else if( sima->image->type==IMA_TYPE_R_RESULT ) { - /* not very important, just nice */ - xim= (G.scene->r.xsch*G.scene->r.size)/100; - yim= (G.scene->r.ysch*G.scene->r.size)/100; - } - } - - sima->v2d.tot.xmin= 0; - sima->v2d.tot.ymin= 0; - sima->v2d.tot.xmax= xim; - sima->v2d.tot.ymax= yim; - - sima->v2d.mask.xmin= sima->v2d.mask.ymin= 0; - sima->v2d.mask.xmax= curarea->winx; - sima->v2d.mask.ymax= curarea->winy; - - - /* Which part of the image space do we see? */ - /* Same calculation as in lrectwrite: area left and down*/ - x1= curarea->winrct.xmin+(curarea->winx-sima->zoom*xim)/2; - y1= curarea->winrct.ymin+(curarea->winy-sima->zoom*yim)/2; - - x1-= sima->zoom*sima->xof; - y1-= sima->zoom*sima->yof; - - /* relative display right */ - sima->v2d.cur.xmin= ((curarea->winrct.xmin - (float)x1)/sima->zoom); - sima->v2d.cur.xmax= sima->v2d.cur.xmin + ((float)curarea->winx/sima->zoom); - - /* relative display left */ - sima->v2d.cur.ymin= ((curarea->winrct.ymin-(float)y1)/sima->zoom); - sima->v2d.cur.ymax= sima->v2d.cur.ymin + ((float)curarea->winy/sima->zoom); - - if(mode=='f') { - sima->v2d.cur.xmin/= xim; - sima->v2d.cur.xmax/= xim; - sima->v2d.cur.ymin/= yim; - sima->v2d.cur.ymax/= yim; - } -} - -/* check for facelesect, and set active image */ -void what_image(SpaceImage *sima) -{ - MTFace *activetf; - - if( (sima->mode!=SI_TEXTURE) || - (sima->image && sima->image->source==IMA_SRC_VIEWER) || - (G.obedit != OBACT) || - (sima->pin) - ) { - return; - } - - /* viewer overrides uv editmode */ - if (EM_texFaceCheck()) { - sima->image= NULL; - - activetf = get_active_mtface(NULL, NULL, 1); /* partially selected face is ok */ - - if(activetf && activetf->mode & TF_TEX) { - if (!sima->pin) - sima->image= activetf->tpage; - - if(sima->flag & SI_EDITTILE); - else sima->curtile= activetf->tile; - - if(sima->image) { - if(activetf->mode & TF_TILES) - sima->image->tpageflag |= IMA_TILES; - else sima->image->tpageflag &= ~IMA_TILES; - } - } - } -} - -/* after a what_image(), this call will give ibufs, includes the spare image */ -ImBuf *imagewindow_get_ibuf(SpaceImage *sima) -{ - - if(G.sima->image) { - /* check for spare */ - if(sima->image->type==IMA_TYPE_R_RESULT && sima->showspare) - return sima->spare; - else - return BKE_image_get_ibuf(sima->image, &sima->iuser); - } - return NULL; -} - -extern int EM_texFaceCheck(void); /* from editmesh.c */ -/* called to assign images to UV faces */ -void image_changed(SpaceImage *sima, Image *image) -{ - MTFace *tface; - EditMesh *em = G.editMesh; - EditFace *efa; - ImBuf *ibuf = NULL; - short change = 0; - - if(image==NULL) { - sima->flag &= ~SI_DRAWTOOL; - } else { - ibuf = BKE_image_get_ibuf(image, NULL); - } - - if(sima->mode!=SI_TEXTURE) - return; - - /* skip assigning these procedural images... */ - if(image && (image->type==IMA_TYPE_R_RESULT || image->type==IMA_TYPE_COMPOSITE)) { - return; - } else if ((G.obedit) && - (G.obedit->type == OB_MESH) && - (G.editMesh) && - (G.editMesh->faces.first) - ) { - - /* Add a UV layer if there is none, editmode only */ - if ( !CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE) ) { - EM_add_data_layer(&em->fdata, CD_MTFACE); - CustomData_set_layer_active(&em->fdata, CD_MTFACE, 0); /* always zero because we have no other UV layers */ - change = 1; /* so we update the object, incase no faces are selected */ - - /* BIF_undo_push("New UV Texture"); - undo should be done by whatever changes the image */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (efa->h==0 && efa->f & SELECT) { - if (image) { - tface->tpage= image; - tface->mode |= TF_TEX; - - if(image->tpageflag & IMA_TILES) tface->mode |= TF_TILES; - else tface->mode &= ~TF_TILES; - - if(image->id.us==0) id_us_plus(&image->id); - else id_lib_extern(&image->id); - - if (tface->transp==TF_ADD) {} /* they obviously know what they are doing! - leave as is */ - else if (ibuf && ibuf->depth == 32) tface->transp = TF_ALPHA; - else tface->transp = TF_SOLID; - - } else { - tface->tpage= NULL; - tface->mode &= ~TF_TEX; - tface->transp = TF_SOLID; - } - change = 1; - } - } - } - /* change the space image after because simaFaceDraw_Check uses the space image - * to check if the face is displayed in UV-localview */ - sima->image = image; - - if (change) - object_uvs_changed(OBACT); - - allqueue(REDRAWBUTSEDIT, 0); -} -/* - * dotile - 1, set the tile flag (from the space image) - * 2, set the tile index for the faces. - * */ -void image_set_tile(SpaceImage *sima, int dotile) -{ - MTFace *tface; - EditMesh *em = G.editMesh; - EditFace *efa; - - if(!sima->image || sima->mode!=SI_TEXTURE || !EM_texFaceCheck()) - return; - - /* skip assigning these procedural images... */ - if(sima->image && (sima->image->type==IMA_TYPE_R_RESULT || sima->image->type==IMA_TYPE_COMPOSITE)) - return; - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (efa->h==0 && efa->f & SELECT) { - if (dotile==1) { - /* set tile flag */ - if (sima->image->tpageflag & IMA_TILES) { - tface->mode |= TF_TILES; - } else { - tface->mode &= ~TF_TILES; - } - } else if (dotile==2) { - /* set tile index */ - tface->tile= sima->curtile; - } - } - } - object_uvs_changed(OBACT); - allqueue(REDRAWBUTSEDIT, 0); -} - - - -void uvco_to_areaco(float *vec, short *mval) -{ - float x, y; - - mval[0]= IS_CLIPPED; - - x= (vec[0] - G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - y= (vec[1] - G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - - if(x>=0.0 && x<=1.0) { - if(y>=0.0 && y<=1.0) { - mval[0]= G.v2d->mask.xmin + x*(G.v2d->mask.xmax-G.v2d->mask.xmin); - mval[1]= G.v2d->mask.ymin + y*(G.v2d->mask.ymax-G.v2d->mask.ymin); - } - } -} - -void uvco_to_areaco_noclip(float *vec, int *mval) -{ - float x, y; - - mval[0]= IS_CLIPPED; - - x= (vec[0] - G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - y= (vec[1] - G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - - x= G.v2d->mask.xmin + x*(G.v2d->mask.xmax-G.v2d->mask.xmin); - y= G.v2d->mask.ymin + y*(G.v2d->mask.ymax-G.v2d->mask.ymin); - - mval[0]= x; - mval[1]= y; -} - -static void drawcursor_sima(float xuser_asp, float yuser_asp) -{ - int wi, hi; - float w, h; - - if (!G.obedit || !CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)) return; - - transform_width_height_tface_uv(&wi, &hi); - w = (((float)wi)/256.0f)*G.sima->zoom * xuser_asp; - h = (((float)hi)/256.0f)*G.sima->zoom * yuser_asp; - - cpack(0xFFFFFF); - glTranslatef(G.v2d->cursor[0], G.v2d->cursor[1], 0.0f); - fdrawline(-0.05/w, 0, 0, 0.05/h); - fdrawline(0, 0.05/h, 0.05/w, 0); - fdrawline(0.05/w, 0, 0, -0.05/h); - fdrawline(0, -0.05/h, -0.05/w, 0); - - setlinestyle(4); - cpack(0xFF); - fdrawline(-0.05/w, 0, 0, 0.05/h); - fdrawline(0, 0.05/h, 0.05/w, 0); - fdrawline(0.05/w, 0, 0, -0.05/h); - fdrawline(0, -0.05/h, -0.05/w, 0); - - - setlinestyle(0); - cpack(0x0); - fdrawline(-0.020/w, 0, -0.1/w, 0); - fdrawline(0.1/w, 0, .020/w, 0); - fdrawline(0, -0.020/h, 0, -0.1/h); - fdrawline(0, 0.1/h, 0, 0.020/h); - - setlinestyle(1); - cpack(0xFFFFFF); - fdrawline(-0.020/w, 0, -0.1/w, 0); - fdrawline(0.1/w, 0, .020/w, 0); - fdrawline(0, -0.020/h, 0, -0.1/h); - fdrawline(0, 0.1/h, 0, 0.020/h); - - glTranslatef(-G.v2d->cursor[0], -G.v2d->cursor[1], 0.0f); - setlinestyle(0); -} - -// checks if we are selecting only faces -int draw_uvs_face_check(void) -{ - if (G.sima==NULL) - return 0; - if (G.sima->flag & SI_SYNC_UVSEL && G.scene->selectmode == SCE_SELECT_FACE) - return 2; - if (G.sima->flag & SI_SELACTFACE) - return 1; - return 0; -} - -void tface_center(MTFace *tf, float cent[2], void * isquad) -{ - - if (isquad) { - cent[0] = (tf->uv[0][0] + tf->uv[1][0] + tf->uv[2][0] + tf->uv[3][0]) / 4.0; - cent[1] = (tf->uv[0][1] + tf->uv[1][1] + tf->uv[2][1] + tf->uv[3][1]) / 4.0; - } else { - cent[0] = (tf->uv[0][0] + tf->uv[1][0] + tf->uv[2][0]) / 3.0; - cent[1] = (tf->uv[0][1] + tf->uv[1][1] + tf->uv[2][1]) / 3.0; - } -} - -/* draws uv's in the image space */ -void draw_uvs_sima(void) -{ - MTFace *tface,*activetface = NULL; - EditMesh *em = G.editMesh; - EditFace *efa, *efa_act; - - char col1[4], col2[4]; - float pointsize; - int drawface; - - if (!G.obedit || !CustomData_has_layer(&em->fdata, CD_MTFACE)) - return; - - drawface = draw_uvs_face_check(); - - calc_image_view(G.sima, 'f'); /* float */ - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - glLoadIdentity(); - - - if(G.sima->flag & SI_DRAWTOOL) { - /* draws the grey mesh when painting */ - glColor3ub(112, 112, 112); - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - glBegin(GL_LINE_LOOP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - } - return; /* only draw shadow mesh */ - } else if (G.sima->flag & SI_DRAWSHADOW) { - /* draw shadow mesh - this is the mesh with the modifier applied */ - glColor3ub(112, 112, 112); - if ( em->derivedFinal && - em->derivedFinal->drawUVEdges && - CustomData_has_layer(&em->derivedFinal->faceData, CD_MTFACE) - ) { - /* we can use the existing final mesh */ - glColor3ub(112, 112, 112); - em->derivedFinal->drawUVEdges(em->derivedFinal); - } else { - DerivedMesh *finalDM, *cageDM; - - /* draw final mesh with modifiers applied */ - cageDM = editmesh_get_derived_cage_and_final(&finalDM, CD_MASK_BAREMESH | CD_MASK_MTFACE); - - if (finalDM->drawUVEdges && - DM_get_face_data_layer(finalDM, CD_MTFACE) && - /* When sync selection is enabled, all faces are drawn (except for hidden) - * so if cage is the same as the final, theres no point in drawing the shadowmesh. */ - !((G.sima->flag & SI_SYNC_UVSEL && cageDM==finalDM)) - ) { - glColor3ub(112, 112, 112); - finalDM->drawUVEdges(finalDM); - } - - if (cageDM != finalDM) - cageDM->release(cageDM); - finalDM->release(finalDM); - } - } - - activetface = get_active_mtface(&efa_act, NULL, 0); /* will be set to NULL if hidden */ - - /* draw transparent faces */ - if(G.f & G_DRAWFACES) { - BIF_GetThemeColor4ubv(TH_FACE, col1); - BIF_GetThemeColor4ubv(TH_FACE_SELECT, col2); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - - if (simaFaceDraw_Check(efa, tface)) { - efa->tmp.p = tface; - if (tface==activetface) continue; /* important the temp pointer is set above */ - if( simaFaceSel_Check(efa, tface) ) - glColor4ubv((GLubyte *)col2); - else - glColor4ubv((GLubyte *)col1); - - glBegin(efa->v4?GL_QUADS:GL_TRIANGLES); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - - } else { - if (tface == activetface) - activetface= NULL; - efa->tmp.p = NULL; - } - } - } else { - /* would be nice to do this within a draw loop but most below are optional, so it would involve too many checks */ - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - efa->tmp.p = tface; - } else { - if (tface == activetface) - activetface= NULL; - efa->tmp.p = NULL; - } - } - glDisable(GL_BLEND); - } - - if (activetface) { - GLubyte act_face_stipple[32*32/8] = DM_FACE_STIPPLE; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - BIF_ThemeColor4(TH_EDITMESH_ACTIVE); - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(act_face_stipple); - glBegin(efa_act->v4?GL_QUADS:GL_TRIANGLES); - glVertex2fv(activetface->uv[0]); - glVertex2fv(activetface->uv[1]); - glVertex2fv(activetface->uv[2]); - if(efa_act->v4) glVertex2fv(activetface->uv[3]); - glEnd(); - glDisable(GL_POLYGON_STIPPLE); - glDisable(GL_BLEND); - } - - if (G.sima->flag & SI_SMOOTH_UV) { - glEnable( GL_LINE_SMOOTH ); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - - switch (G.sima->dt_uv) { - case SI_UVDT_DASH: - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - cpack(0x111111); - glBegin(GL_LINE_LOOP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - - setlinestyle(2); - cpack(0x909090); - glBegin(GL_LINE_STRIP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2fv(tface->uv[0]); - if(efa->v4) glVertex2fv(tface->uv[3]); - else glVertex2fv(tface->uv[2]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - setlinestyle(0); - } - } - break; - case SI_UVDT_BLACK: /* black/white */ - case SI_UVDT_WHITE: - cpack((G.sima->dt_uv==SI_UVDT_WHITE) ? 0xFFFFFF : 0x0); - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - glBegin(GL_LINE_LOOP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - } - } - break; - case SI_UVDT_OUTLINE: - glLineWidth(3); - cpack(0x0); - - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - glBegin(GL_LINE_LOOP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - } - } - - glLineWidth(1); - cpack(0xFFFFFF); - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - glBegin(GL_LINE_LOOP); - glVertex2fv(tface->uv[0]); - glVertex2fv(tface->uv[1]); - glVertex2fv(tface->uv[2]); - if(efa->v4) glVertex2fv(tface->uv[3]); - glEnd(); - } - } - break; - } - - if (G.sima->flag & SI_SMOOTH_UV) { - glDisable( GL_LINE_SMOOTH); - glDisable(GL_BLEND); - } - - if (drawface) { - // draw UV face points - float cent[2]; - - - /* unselected faces's */ - pointsize = BIF_GetThemeValuef(TH_FACEDOT_SIZE); - // TODO - drawobject.c changes this value after - Investiagate! - glPointSize(pointsize); - - BIF_ThemeColor(TH_WIRE); - bglBegin(GL_POINTS); - for (efa= em->faces.first; efa; efa= efa->next) { - -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - if( ! simaFaceSel_Check(efa, tface) ) { - tface_center(tface, cent, (void *)efa->v4); - bglVertex2fv(cent); - } - } - } - bglEnd(); - /* selected faces's */ - BIF_ThemeColor(TH_FACE_DOT); - bglBegin(GL_POINTS); - for (efa= em->faces.first; efa; efa= efa->next) { - -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - if( simaFaceSel_Check(efa, tface) ) { - tface_center(tface, cent, (void *)efa->v4); - bglVertex2fv(cent); - } - } - } - bglEnd(); - } - - if (drawface != 2) { /* 2 means Mesh Face Mode */ - /* unselected uv's */ - BIF_ThemeColor(TH_VERTEX); - pointsize = BIF_GetThemeValuef(TH_VERTEX_SIZE); - glPointSize(pointsize); - - bglBegin(GL_POINTS); - for (efa= em->faces.first; efa; efa= efa->next) { - -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - if(simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]); - if(simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]); - if(simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]); - if(efa->v4) { - if(simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]); - } - } - } - bglEnd(); - - /* pinned uv's */ - /* give odd pointsizes odd pin pointsizes */ - glPointSize(pointsize*2 + (((int)pointsize % 2)? (-1): 0)); - cpack(0xFF); - - bglBegin(GL_POINTS); - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - if(tface->unwrap & TF_PIN1) bglVertex2fv(tface->uv[0]); - if(tface->unwrap & TF_PIN2) bglVertex2fv(tface->uv[1]); - if(tface->unwrap & TF_PIN3) bglVertex2fv(tface->uv[2]); - if(efa->v4) { - if(tface->unwrap & TF_PIN4) bglVertex2fv(tface->uv[3]); - } - } - } - bglEnd(); - - /* selected uv's */ - BIF_ThemeColor(TH_VERTEX_SELECT); - glPointSize(pointsize); - - bglBegin(GL_POINTS); - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - - /*this is a shortcut to do the same as above but a faster for drawing */ - if ((tface=(MTFace *)efa->tmp.p)) { - - if(!simaUVSel_Check(efa, tface, 0)); else bglVertex2fv(tface->uv[0]); - if(!simaUVSel_Check(efa, tface, 1)); else bglVertex2fv(tface->uv[1]); - if(!simaUVSel_Check(efa, tface, 2)); else bglVertex2fv(tface->uv[2]); - if(efa->v4) { - if(!simaUVSel_Check(efa, tface, 3)); else bglVertex2fv(tface->uv[3]); - } - } - } - bglEnd(); - } - glPointSize(1.0); -} - -static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty, short endx, short endy) -{ - unsigned int *rt, *rp, *rectmain; - short y, heigth, len; - - /* the right offset in rectot */ - - rt= ibuf->rect+ (starty*ibuf->x+ startx); - - len= (endx-startx); - heigth= (endy-starty); - - rp=rectmain= MEM_mallocN(heigth*len*sizeof(int), "rect"); - - for(y=0; yx; - rp+= len; - } - return rectmain; -} - -static void draw_image_transform(ImBuf *ibuf, float xuser_asp, float yuser_asp) -{ - if(G.moving) { - float aspx, aspy, center[3]; - - BIF_drawConstraint(); - - if(ibuf==0 || ibuf->rect==0 || ibuf->x==0 || ibuf->y==0) { - aspx= aspy= 1.0; - } - else { - aspx= (256.0/ibuf->x) * xuser_asp; - aspy= (256.0/ibuf->y) * yuser_asp; - } - BIF_getPropCenter(center); - - /* scale and translate the circle into place and draw it */ - glPushMatrix(); - glScalef(aspx, aspy, 1.0); - glTranslatef((1/aspx)*center[0] - center[0], - (1/aspy)*center[1] - center[1], 0.0); - - BIF_drawPropCircle(); - - glPopMatrix(); - } -} - -static void draw_image_view_icon(void) -{ - float xPos = 5.0; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - - if (G.sima->flag & SI_SYNC_UVSEL) { - /* take settings from the editmesh */ - if (G.scene->selectmode == SCE_SELECT_FACE || G.sima->flag & SI_SELACTFACE) { - BIF_icon_draw_aspect(xPos, 5.0, ICON_FACESEL_HLT, 1.0f); - } - - } else { - /* use the flags for UV mode - normal operation */ - if(G.sima->flag & SI_SELACTFACE) { - BIF_icon_draw_aspect(xPos, 5.0, ICON_FACESEL_HLT, 1.0f); - } - } - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); -} - -static void draw_image_view_tool(void) -{ - ToolSettings *settings= G.scene->toolsettings; - Brush *brush= settings->imapaint.brush; - short mval[2]; - float radius; - int draw= 0; - - if(brush) { - if(settings->imapaint.flag & IMAGEPAINT_DRAWING) { - if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL_DRAWING) - draw= 1; - } - else if(settings->imapaint.flag & IMAGEPAINT_DRAW_TOOL) - draw= 1; - - if(draw) { - getmouseco_areawin(mval); - - radius= brush->size*G.sima->zoom/2; - fdrawXORcirc(mval[0], mval[1], radius); - - if (brush->innerradius != 1.0) { - radius *= brush->innerradius; - fdrawXORcirc(mval[0], mval[1], radius); - } - } - } -} - -/* ************ panel stuff ************* */ - -/* this function gets the values for cursor and vertex number buttons */ -static void image_transform_but_attr(int *imx, int *imy, int *step, int *digits) /*, float *xcoord, float *ycoord)*/ -{ - ImBuf *ibuf= imagewindow_get_ibuf(G.sima); - if(ibuf) { - *imx= ibuf->x; - *imy= ibuf->y; - } - - if (G.sima->flag & SI_COORDFLOATS) { - *step= 1; - *digits= 3; - } - else { - *step= 100; - *digits= 2; - } -} - - -/* is used for both read and write... */ -void image_editvertex_buts(uiBlock *block) -{ - static float ocent[2]; - float cent[2]= {0.0, 0.0}; - int imx= 256, imy= 256; - int nactive= 0, step, digits; - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tf; - - if( is_uv_tface_editing_allowed_silent()==0 ) return; - - image_transform_but_attr(&imx, &imy, &step, &digits); - - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - - if (simaUVSel_Check(efa, tf, 0)) { - cent[0]+= tf->uv[0][0]; - cent[1]+= tf->uv[0][1]; - nactive++; - } - if (simaUVSel_Check(efa, tf, 1)) { - cent[0]+= tf->uv[1][0]; - cent[1]+= tf->uv[1][1]; - nactive++; - } - if (simaUVSel_Check(efa, tf, 2)) { - cent[0]+= tf->uv[2][0]; - cent[1]+= tf->uv[2][1]; - nactive++; - } - if (efa->v4 && simaUVSel_Check(efa, tf, 3)) { - cent[0]+= tf->uv[3][0]; - cent[1]+= tf->uv[3][1]; - nactive++; - } - } - } - - if(block) { // do the buttons - if (nactive) { - ocent[0]= cent[0]/nactive; - ocent[1]= cent[1]/nactive; - if (G.sima->flag & SI_COORDFLOATS) { - } else { - ocent[0] *= imx; - ocent[1] *= imy; - } - - //uiBlockBeginAlign(block); - if(nactive==1) { - uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, ""); - uiDefButF(block, NUM, B_TRANS_IMAGE, "Vertex Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, ""); - } - else { - uiDefButF(block, NUM, B_TRANS_IMAGE, "Median X:", 10, 10, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, ""); - uiDefButF(block, NUM, B_TRANS_IMAGE, "Median Y:", 165, 10, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, ""); - } - //uiBlockEndAlign(block); - } - } - else { // apply event - float delta[2]; - - cent[0]= cent[0]/nactive; - cent[1]= cent[1]/nactive; - - if (G.sima->flag & SI_COORDFLOATS) { - delta[0]= ocent[0]-cent[0]; - delta[1]= ocent[1]-cent[1]; - } - else { - delta[0]= ocent[0]/imx - cent[0]; - delta[1]= ocent[1]/imy - cent[1]; - } - - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if (simaUVSel_Check(efa, tf, 0)) { - tf->uv[0][0]+= delta[0]; - tf->uv[0][1]+= delta[1]; - } - if (simaUVSel_Check(efa, tf, 1)) { - tf->uv[1][0]+= delta[0]; - tf->uv[1][1]+= delta[1]; - } - if (simaUVSel_Check(efa, tf, 2)) { - tf->uv[2][0]+= delta[0]; - tf->uv[2][1]+= delta[1]; - } - if (efa->v4 && simaUVSel_Check(efa, tf, 3)) { - tf->uv[3][0]+= delta[0]; - tf->uv[3][1]+= delta[1]; - } - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - } -} - - -/* is used for both read and write... */ -void image_editcursor_buts(uiBlock *block) -{ - static float ocent[2]; - int imx= 256, imy= 256; - int step, digits; - - if( is_uv_tface_editing_allowed_silent()==0 ) return; - - image_transform_but_attr(&imx, &imy, &step, &digits); - - if(block) { // do the buttons - ocent[0]= G.v2d->cursor[0]; - ocent[1]= G.v2d->cursor[1]; - if (G.sima->flag & SI_COORDFLOATS) { - } else { - ocent[0] *= imx; - ocent[1] *= imy; - } - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_CURSOR_IMAGE, "Cursor X:", 165, 120, 145, 19, &ocent[0], -10*imx, 10.0*imx, step, digits, ""); - uiDefButF(block, NUM, B_CURSOR_IMAGE, "Cursor Y:", 165, 100, 145, 19, &ocent[1], -10*imy, 10.0*imy, step, digits, ""); - uiBlockEndAlign(block); - } - else { // apply event - if (G.sima->flag & SI_COORDFLOATS) { - G.v2d->cursor[0]= ocent[0]; - G.v2d->cursor[1]= ocent[1]; - } - else { - G.v2d->cursor[0]= ocent[0]/imx; - G.v2d->cursor[1]= ocent[1]/imy; - } - allqueue(REDRAWIMAGE, 0); - } -} - - -void image_info(Image *ima, ImBuf *ibuf, char *str) -{ - int ofs= 0; - - str[0]= 0; - - if(ima==NULL) return; - if(ibuf==NULL) { - sprintf(str, "Can not get an image"); - return; - } - - if(ima->source==IMA_SRC_MOVIE) { - ofs= sprintf(str, "Movie "); - if(ima->anim) - ofs+= sprintf(str+ofs, "%d frs", IMB_anim_get_duration(ima->anim)); - } - else - ofs= sprintf(str, "Image "); - - ofs+= sprintf(str+ofs, ": size %d x %d,", ibuf->x, ibuf->y); - - if(ibuf->rect_float) { - if(ibuf->channels!=4) { - sprintf(str+ofs, "%d float channel(s)", ibuf->channels); - } - else if(ibuf->depth==32) - strcat(str, " RGBA float"); - else - strcat(str, " RGB float"); - } - else { - if(ibuf->depth==32) - strcat(str, " RGBA byte"); - else - strcat(str, " RGB byte"); - } - if(ibuf->zbuf || ibuf->zbuf_float) - strcat(str, " + Z"); - -} - -static void image_panel_properties(short cntrl) // IMAGE_HANDLER_PROPERTIES -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "image_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Image Properties", "Image", 10, 10, 318, 204)==0) - return; - - /* note, it draws no bottom half in facemode, for vertex buttons */ - uiblock_image_panel(block, &G.sima->image, &G.sima->iuser, B_REDR, B_REDR); - image_editvertex_buts(block); -} - -static void image_panel_game_properties(short cntrl) // IMAGE_HANDLER_GAME_PROPERTIES -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "image_panel_game_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_GAME_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Real-time Properties", "Image", 10, 10, 318, 204)==0) - return; - - if (ibuf) { - char str[128]; - - image_info(G.sima->image, ibuf, str); - uiDefBut(block, LABEL, B_NOP, str, 10,180,300,19, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_TWINANIM, B_TWINANIM, "Anim", 10,150,140,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of animated texture"); - uiDefButS(block, NUM, B_TWINANIM, "Start:", 10,130,140,19, &G.sima->image->twsta, 0.0, 128.0, 0, 0, "Displays the start frame of an animated texture"); - uiDefButS(block, NUM, B_TWINANIM, "End:", 10,110,140,19, &G.sima->image->twend, 0.0, 128.0, 0, 0, "Displays the end frame of an animated texture"); - uiDefButS(block, NUM, B_NOP, "Speed", 10,90,140,19, &G.sima->image->animspeed, 1.0, 100.0, 0, 0, "Displays Speed of the animation in frames per second"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_TILES, B_SIMAGETILE, "Tiles", 160,150,140,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Toggles use of tilemode for faces (Shift LMB to pick the tile for selected faces)"); - uiDefButS(block, NUM, B_SIMA_REDR_IMA_3D, "X:", 160,130,70,19, &G.sima->image->xrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the X direction"); - uiDefButS(block, NUM, B_SIMA_REDR_IMA_3D, "Y:", 230,130,70,19, &G.sima->image->yrep, 1.0, 16.0, 0, 0, "Sets the degree of repetition in the Y direction"); - uiBlockBeginAlign(block); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, IMA_CLAMP_U, B_SIMA3DVIEWDRAW, "ClampX", 160,100,70,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating horizontaly"); - uiDefButBitS(block, TOG, IMA_CLAMP_V, B_SIMA3DVIEWDRAW, "ClampY", 230,100,70,19, &G.sima->image->tpageflag, 0, 0, 0, 0, "Disable texture repeating vertically"); - uiBlockEndAlign(block); - } -} - -//static void image_panel_transform_properties(short cntrl) // IMAGE_HANDLER_TRANSFORM_PROPERTIES -//{ -// uiBlock *block; -// -// block= uiNewBlock(&curarea->uiblocks, "image_transform_properties", UI_EMBOSS, UI_HELV, curarea->win); -// uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); -// uiSetPanelHandler(IMAGE_HANDLER_TRANSFORM_PROPERTIES); // for close and esc -// if(uiNewPanel(curarea, block, "Transform Properties", "Image", 10, 10, 318, 204)==0) -// return; -// -// image_editvertex_buts(block); -//} - -static void image_panel_view_properties(short cntrl) // IMAGE_HANDLER_VIEW_PROPERTIES -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "image_view_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_VIEW_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "View Properties", "Image", 10, 10, 318, 204)==0) - return; - - - uiDefButBitI(block, TOG, SI_DRAW_TILE, B_REDR, "Repeat Image", 10,160,140,19, &G.sima->flag, 0, 0, 0, 0, "Repeat/Tile the image display"); - uiDefButBitI(block, TOG, SI_COORDFLOATS, B_REDR, "Normalized Coords", 165,160,145,19, &G.sima->flag, 0, 0, 0, 0, "Display coords from 0.0 to 1.0 rather then in pixels"); - - - if (G.sima->image) { - uiDefBut(block, LABEL, B_NOP, "Image Display:", 10,140,140,19, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_REDR, "AspX:", 10,120,140,19, &G.sima->image->aspx, 0.1, 5000.0, 100, 0, "X Display Aspect for this image, does not affect renderingm 0 disables."); - uiDefButF(block, NUM, B_REDR, "AspY:", 10,100,140,19, &G.sima->image->aspy, 0.1, 5000.0, 100, 0, "X Display Aspect for this image, does not affect rendering 0 disables."); - uiBlockEndAlign(block); - } - - - if (EM_texFaceCheck()) { - uiDefBut(block, LABEL, B_NOP, "Draw Type:", 10, 20,120,19, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButC(block, ROW, B_REDR, "Dash", 10, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_DASH, 0, 0, "Dashed Wire UV drawtype"); - uiDefButC(block, ROW, B_REDR, "Black", 68, 0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_BLACK, 0, 0, "Black Wire UV drawtype"); - uiDefButC(block, ROW, B_REDR, "White", 126,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_WHITE, 0, 0, "White Wire UV drawtype"); - uiDefButC(block, ROW, B_REDR, "Outline", 184,0,58,19, &G.sima->dt_uv, 0.0, SI_UVDT_OUTLINE, 0, 0, "Outline Wire UV drawtype"); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, SI_SMOOTH_UV, B_REDR, "Smooth", 250,0,60,19, &G.sima->flag, 0, 0, 0, 0, "Display smooth lines in the UV view"); - } - image_editcursor_buts(block); -} - -static void image_panel_paint(short cntrl) // IMAGE_HANDLER_PAINT -{ - /* B_SIMABRUSHCHANGE only redraws and eats the mouse messages */ - /* so that LEFTMOUSE does not 'punch' through the floating panel */ - /* B_SIMANOTHING */ - ToolSettings *settings= G.scene->toolsettings; - Brush *brush= settings->imapaint.brush; - uiBlock *block; - ID *id; - int yco, xco, butw; - - block= uiNewBlock(&curarea->uiblocks, "image_panel_paint", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_PAINT); // for close and esc - if(uiNewPanel(curarea, block, "Image Paint", "Image", 10, 230, 318, 204)==0) - return; - - yco= 160; - - uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Draw", 0 ,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_DRAW, 0, 0, "Draw brush"); - uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Soften", 80 ,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SOFTEN, 0, 0, "Soften brush"); - uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Smear", 160,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_SMEAR, 0, 0, "Smear brush"); - uiDefButS(block, ROW, B_SIMABRUSHCHANGE, "Clone", 240,yco,80,19, &settings->imapaint.tool, 7.0, PAINT_TOOL_CLONE, 0, 0, "Clone brush, use RMB to drag source image"); - uiBlockEndAlign(block); - yco -= 30; - - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (ID*)settings->imapaint.brush; - xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMABRUSHBROWSE, ID_BR, 0, id, NULL, &(G.sima->menunr), 0, B_SIMABRUSHLOCAL, B_SIMABRUSHDELETE, 0, B_KEEPDATA); - uiBlockSetCol(block, TH_AUTO); - - if(brush && !brush->id.lib) { - butw= 320-(xco+10); - - uiDefButS(block, MENU, B_SIMANOTHING, "Mix %x0|Add %x1|Subtract %x2|Multiply %x3|Lighten %x4|Darken %x5|Erase Alpha %x6|Add Alpha %x7", xco+10,yco,butw,19, &brush->blend, 0, 0, 0, 0, "Blending method for applying brushes"); - - uiDefButBitS(block, TOG|BIT, BRUSH_TORUS, B_SIMABRUSHCHANGE, "Wrap", xco+10,yco-25,butw,19, &brush->flag, 0, 0, 0, 0, "Enables torus wrapping"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG|BIT, BRUSH_AIRBRUSH, B_SIMABRUSHCHANGE, "Airbrush", xco+10,yco-50,butw,19, &brush->flag, 0, 0, 0, 0, "Keep applying paint effect while holding mouse (spray)"); - uiDefButF(block, NUM, B_SIMANOTHING, "Rate ", xco+10,yco-70,butw,19, &brush->rate, 0.01, 1.0, 0, 0, "Number of paints per second for Airbrush"); - uiBlockEndAlign(block); - - yco -= 25; - - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_VPCOLSLI, "", 0,yco,200,19, brush->rgb, 0, 0, 0, 0, ""); - uiDefButF(block, NUMSLI, B_SIMANOTHING, "Opacity ", 0,yco-20,180,19, &brush->alpha, 0.0, 1.0, 0, 0, "The amount of pressure on the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_ALPHA_PRESSURE, B_SIMANOTHING, "P", 180,yco-20,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButI(block, NUMSLI, B_SIMANOTHING, "Size ", 0,yco-40,180,19, &brush->size, 1, 200, 0, 0, "The size of the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_SIZE_PRESSURE, B_SIMANOTHING, "P", 180,yco-40,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButF(block, NUMSLI, B_SIMANOTHING, "Falloff ", 0,yco-60,180,19, &brush->innerradius, 0.0, 1.0, 0, 0, "The fall off radius of the brush"); - uiDefButBitS(block, TOG|BIT, BRUSH_RAD_PRESSURE, B_SIMANOTHING, "P", 180,yco-60,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiDefButF(block, NUMSLI, B_SIMANOTHING, "Spacing ",0,yco-80,180,19, &brush->spacing, 1.0, 100.0, 0, 0, "Repeating paint on %% of brush diameter"); - uiDefButBitS(block, TOG|BIT, BRUSH_SPACING_PRESSURE, B_SIMANOTHING, "P", 180,yco-80,20,19, &brush->flag, 0, 0, 0, 0, "Enables pressure sensitivity for tablets"); - uiBlockEndAlign(block); - - yco -= 110; - - if(settings->imapaint.tool == PAINT_TOOL_CLONE) { - id= (ID*)brush->clone.image; - uiBlockSetCol(block, TH_BUT_SETTING2); - xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMACLONEBROWSE, ID_IM, 0, id, 0, &G.sima->menunr, 0, 0, B_SIMACLONEDELETE, 0, 0); - uiBlockSetCol(block, TH_AUTO); - if(id) { - butw= 320-(xco+5); - uiDefButF(block, NUMSLI, B_SIMABRUSHCHANGE, "B ",xco+5,yco,butw,19, &brush->clone.alpha , 0.0, 1.0, 0, 0, "Opacity of clone image display"); - } - } - else { - MTex *mtex= brush->mtex[brush->texact]; - - uiBlockSetCol(block, TH_BUT_SETTING2); - id= (mtex)? (ID*)mtex->tex: NULL; - xco= std_libbuttons(block, 0, yco, 0, NULL, B_SIMABTEXBROWSE, ID_TE, 0, id, NULL, &(G.sima->menunr), 0, 0, B_SIMABTEXDELETE, 0, 0); - /*uiDefButBitS(block, TOG|BIT, BRUSH_FIXED_TEX, B_SIMABRUSHCHANGE, "Fixed", xco+5,yco,butw,19, &brush->flag, 0, 0, 0, 0, "Keep texture origin in fixed position");*/ - uiBlockSetCol(block, TH_AUTO); - } - } - -#if 0 - uiDefButBitS(block, TOG|BIT, IMAGEPAINT_DRAW_TOOL_DRAWING, B_SIMABRUSHCHANGE, "TD", 0,1,50,19, &settings->imapaint.flag.flag, 0, 0, 0, 0, "Enables brush shape while drawing"); - uiDefButBitS(block, TOG|BIT, IMAGEPAINT_DRAW_TOOL, B_SIMABRUSHCHANGE, "TP", 50,1,50,19, &settings->imapaint.flag.flag, 0, 0, 0, 0, "Enables brush shape while not drawing"); -#endif -} - -static void image_panel_curves_reset(void *cumap_v, void *ibuf_v) -{ - CurveMapping *cumap = cumap_v; - int a; - - for(a=0; acm+a, &cumap->clipr); - - cumap->black[0]=cumap->black[1]=cumap->black[2]= 0.0f; - cumap->white[0]=cumap->white[1]=cumap->white[2]= 1.0f; - curvemapping_set_black_white(cumap, NULL, NULL); - - curvemapping_changed(cumap, 0); - curvemapping_do_ibuf(cumap, ibuf_v); - - allqueue(REDRAWIMAGE, 0); -} - - -static void image_panel_curves(short cntrl) // IMAGE_HANDLER_CURVES -{ - ImBuf *ibuf; - uiBlock *block; - uiBut *bt; - - /* and we check for spare */ - ibuf= imagewindow_get_ibuf(G.sima); - - block= uiNewBlock(&curarea->uiblocks, "image_panel_curves", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_CURVES); // for close and esc - if(uiNewPanel(curarea, block, "Curves", "Image", 10, 450, 318, 204)==0) - return; - - if (ibuf) { - rctf rect; - - if(G.sima->cumap==NULL) - G.sima->cumap= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); - - rect.xmin= 110; rect.xmax= 310; - rect.ymin= 10; rect.ymax= 200; - curvemap_buttons(block, G.sima->cumap, 'c', B_SIMACURVES, B_REDR, &rect); - - bt=uiDefBut(block, BUT, B_SIMARANGE, "Reset", 10, 160, 90, 19, NULL, 0.0f, 0.0f, 0, 0, "Reset Black/White point and curves"); - uiButSetFunc(bt, image_panel_curves_reset, G.sima->cumap, ibuf); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_SIMARANGE, "Min R:", 10, 120, 90, 19, G.sima->cumap->black, -1000.0f, 1000.0f, 10, 2, "Black level"); - uiDefButF(block, NUM, B_SIMARANGE, "Min G:", 10, 100, 90, 19, G.sima->cumap->black+1, -1000.0f, 1000.0f, 10, 2, "Black level"); - uiDefButF(block, NUM, B_SIMARANGE, "Min B:", 10, 80, 90, 19, G.sima->cumap->black+2, -1000.0f, 1000.0f, 10, 2, "Black level"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_SIMARANGE, "Max R:", 10, 50, 90, 19, G.sima->cumap->white, -1000.0f, 1000.0f, 10, 2, "White level"); - uiDefButF(block, NUM, B_SIMARANGE, "Max G:", 10, 30, 90, 19, G.sima->cumap->white+1, -1000.0f, 1000.0f, 10, 2, "White level"); - uiDefButF(block, NUM, B_SIMARANGE, "Max B:", 10, 10, 90, 19, G.sima->cumap->white+2, -1000.0f, 1000.0f, 10, 2, "White level"); - - } -} - -/* are there curves? curves visible? and curves do something? */ -static int image_curves_active(ScrArea *sa) -{ - SpaceImage *sima= sa->spacedata.first; - - if(sima->cumap) { - if(curvemapping_RGBA_does_something(sima->cumap)) { - short a; - for(a=0; ablockhandler[a] == IMAGE_HANDLER_CURVES) - return 1; - } - } - } - return 0; -} - -/* 0: disable preview - otherwise refresh preview -*/ -void image_preview_event(int event) -{ - int exec= 0; - - - if(event==0) { - G.scene->r.scemode &= ~R_COMP_CROP; - exec= 1; - } - else { - if(image_preview_active(curarea, NULL, NULL)) { - G.scene->r.scemode |= R_COMP_CROP; - exec= 1; - } - else - G.scene->r.scemode &= ~R_COMP_CROP; - } - - if(exec && G.scene->nodetree) { - /* should work when no node editor in screen..., so we execute right away */ - - ntreeCompositTagGenerators(G.scene->nodetree); - - G.afbreek= 0; - G.scene->nodetree->timecursor= set_timecursor; - G.scene->nodetree->test_break= blender_test_break; - - BIF_store_spare(); - - ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, 1); /* 1 is do_previews */ - - G.scene->nodetree->timecursor= NULL; - G.scene->nodetree->test_break= NULL; - - scrarea_do_windraw(curarea); - waitcursor(0); - - allqueue(REDRAWNODE, 1); - } -} - - -/* nothing drawn here, we use it to store values */ -static void preview_cb(struct ScrArea *sa, struct uiBlock *block) -{ - rctf dispf; - rcti *disprect= &G.scene->r.disprect; - int winx= (G.scene->r.size*G.scene->r.xsch)/100; - int winy= (G.scene->r.size*G.scene->r.ysch)/100; - short mval[2]; - - if(G.scene->r.mode & R_BORDER) { - winx*= (G.scene->r.border.xmax - G.scene->r.border.xmin); - winy*= (G.scene->r.border.ymax - G.scene->r.border.ymin); - } - - /* while dragging we need to update the rects, otherwise it doesn't end with correct one */ - - BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f); - ui_graphics_to_window_rct(sa->win, &dispf, disprect); - - /* correction for gla draw */ - BLI_translate_rcti(disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); - - calc_image_view(G.sima, 'p'); -// printf("winrct %d %d %d %d\n", disprect->xmin, disprect->ymin,disprect->xmax, disprect->ymax); - /* map to image space coordinates */ - mval[0]= disprect->xmin; mval[1]= disprect->ymin; - areamouseco_to_ipoco(G.v2d, mval, &dispf.xmin, &dispf.ymin); - mval[0]= disprect->xmax; mval[1]= disprect->ymax; - areamouseco_to_ipoco(G.v2d, mval, &dispf.xmax, &dispf.ymax); - - /* map to render coordinates */ - disprect->xmin= dispf.xmin; - disprect->xmax= dispf.xmax; - disprect->ymin= dispf.ymin; - disprect->ymax= dispf.ymax; - - CLAMP(disprect->xmin, 0, winx); - CLAMP(disprect->xmax, 0, winx); - CLAMP(disprect->ymin, 0, winy); - CLAMP(disprect->ymax, 0, winy); -// printf("drawrct %d %d %d %d\n", disprect->xmin, disprect->ymin,disprect->xmax, disprect->ymax); - -} - -static int is_preview_allowed(ScrArea *cur) -{ - SpaceImage *sima= cur->spacedata.first; - ScrArea *sa; - - /* check if another areawindow has preview set */ - for(sa=G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa!=cur && sa->spacetype==SPACE_IMAGE) { - if(image_preview_active(sa, NULL, NULL)) - return 0; - } - } - /* check image type */ - if(sima->image==NULL || sima->image->type!=IMA_TYPE_COMPOSITE) - return 0; - - return 1; -} - -static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVIEW -{ - uiBlock *block; - SpaceImage *sima= sa->spacedata.first; - int ofsx, ofsy; - - if(is_preview_allowed(sa)==0) { - rem_blockhandler(sa, IMAGE_HANDLER_PREVIEW); - G.scene->r.scemode &= ~R_COMP_CROP; /* quite weak */ - return; - } - - block= uiNewBlock(&sa->uiblocks, "image_panel_preview", UI_EMBOSS, UI_HELV, sa->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_PREVIEW); // for close and esc - - ofsx= -150+(sa->winx/2)/sima->blockscale; - ofsy= -100+(sa->winy/2)/sima->blockscale; - if(uiNewPanel(sa, block, "Preview", "Image", ofsx, ofsy, 300, 200)==0) return; - - uiBlockSetDrawExtraFunc(block, preview_cb); - -} - -static void image_blockhandlers(ScrArea *sa) -{ - SpaceImage *sima= sa->spacedata.first; - short a; - - /* warning; blocks need to be freed each time, handlers dont remove */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - for(a=0; ablockhandler[a]) { - - case IMAGE_HANDLER_PROPERTIES: - image_panel_properties(sima->blockhandler[a+1]); - break; - case IMAGE_HANDLER_GAME_PROPERTIES: - image_panel_game_properties(sima->blockhandler[a+1]); - break; -// case IMAGE_HANDLER_TRANSFORM_PROPERTIES: -// if (EM_texFaceCheck()) -// image_panel_transform_properties(sima->blockhandler[a+1]); -// break; - case IMAGE_HANDLER_VIEW_PROPERTIES: - image_panel_view_properties(sima->blockhandler[a+1]); - break; - case IMAGE_HANDLER_PAINT: - image_panel_paint(sima->blockhandler[a+1]); - break; - case IMAGE_HANDLER_CURVES: - image_panel_curves(sima->blockhandler[a+1]); - break; - case IMAGE_HANDLER_PREVIEW: - image_panel_preview(sa, sima->blockhandler[a+1]); - break; - } - /* clear action value for event */ - sima->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); -} - -void imagespace_composite_flipbook(ScrArea *sa) -{ - SpaceImage *sima= sa->spacedata.first; - ImBuf *ibuf; - int cfrao= G.scene->r.cfra; - int sfra, efra; - - if(sa->spacetype!=SPACE_IMAGE) - return; - if(sima->iuser.frames<2) - return; - if(G.scene->nodetree==NULL) - return; - - sfra= sima->iuser.sfra; - efra= sima->iuser.sfra + sima->iuser.frames-1; - G.scene->nodetree->test_break= blender_test_break; - - for(G.scene->r.cfra=sfra; G.scene->r.cfra<=efra; G.scene->r.cfra++) { - - set_timecursor(CFRA); - - BKE_image_all_free_anim_ibufs(CFRA); - ntreeCompositTagAnimated(G.scene->nodetree); - ntreeCompositExecTree(G.scene->nodetree, &G.scene->r, G.scene->r.cfra!=cfrao); /* 1 is no previews */ - - force_draw(0); - - ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - /* save memory in flipbooks */ - if(ibuf) - imb_freerectfloatImBuf(ibuf); - - if(blender_test_break()) - break; - } - G.scene->nodetree->test_break= NULL; - waitcursor(0); - - play_anim(0); - - allqueue(REDRAWNODE, 1); - allqueue(REDRAWIMAGE, 1); - - G.scene->r.cfra= cfrao; -} - -static void imagespace_grid(SpaceImage *sima) -{ - float gridsize, gridstep= 1.0f/32.0f; - float fac, blendfac; - - gridsize= sima->zoom; - - calc_image_view(sima, 'f'); - myortho2(sima->v2d.cur.xmin, sima->v2d.cur.xmax, sima->v2d.cur.ymin, sima->v2d.cur.ymax); - - BIF_ThemeColorShade(TH_BACK, 20); - glRectf(0.0, 0.0, 1.0, 1.0); - - if(gridsize<=0.0f) return; - - if(gridsize<1.0f) { - while(gridsize<1.0f) { - gridsize*= 4.0; - gridstep*= 4.0; - } - } - else { - while(gridsize>=4.0f) { - gridsize/= 4.0; - gridstep/= 4.0; - } - } - - /* the fine resolution level */ - blendfac= 0.25*gridsize - floor(0.25*gridsize); - CLAMP(blendfac, 0.0, 1.0); - BIF_ThemeColorShade(TH_BACK, (int)(20.0*(1.0-blendfac))); - - fac= 0.0f; - glBegin(GL_LINES); - while(fac<1.0) { - glVertex2f(0.0f, fac); - glVertex2f(1.0f, fac); - glVertex2f(fac, 0.0f); - glVertex2f(fac, 1.0f); - fac+= gridstep; - } - - /* the large resolution level */ - BIF_ThemeColor(TH_BACK); - - fac= 0.0f; - while(fac<1.0) { - glVertex2f(0.0f, fac); - glVertex2f(1.0f, fac); - glVertex2f(fac, 0.0f); - glVertex2f(fac, 1.0f); - fac+= 4.0*gridstep; - } - glEnd(); - -} - -static void sima_draw_alpha_backdrop(SpaceImage *sima, float x1, float y1, float xsize, float ysize) -{ - GLubyte checker_stipple[32*32/8] = - { - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 255,255,0,0,255,255,0,0,255,255,0,0,255,255,0,0, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - 0,0,255,255,0,0,255,255,0,0,255,255,0,0,255,255, \ - }; - - glColor3ub(100, 100, 100); - glRectf(x1, y1, x1 + sima->zoom*xsize, y1 + sima->zoom*ysize); - glColor3ub(160, 160, 160); - - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(checker_stipple); - glRectf(x1, y1, x1 + sima->zoom*xsize, y1 + sima->zoom*ysize); - glEnd(); - glDisable(GL_POLYGON_STIPPLE); - return; -} - -static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, unsigned int *recti) -{ - - /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ - if(G.order==B_ENDIAN) - glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti); - glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); -} - -static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, float *rectf) -{ - float *trectf= MEM_mallocN(rectx*recty*4, "temp"); - int a, b; - - for(a= rectx*recty -1, b= 4*a+3; a>=0; a--, b-=4) - trectf[a]= rectf[b]; - - glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, trectf); - MEM_freeN(trectf); - /* ogl trick below is slower... (on ATI 9600) */ -// glColorMask(1, 0, 0, 0); -// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+3); -// glColorMask(0, 1, 0, 0); -// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+2); -// glColorMask(0, 0, 1, 0); -// glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_FLOAT, rectf+1); -// glColorMask(1, 1, 1, 1); -} - -static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int *recti) -{ - if(recti==NULL) - return; - - /* zbuffer values are signed, so we need to shift color range */ - glPixelTransferf(GL_RED_SCALE, 0.5f); - glPixelTransferf(GL_GREEN_SCALE, 0.5f); - glPixelTransferf(GL_BLUE_SCALE, 0.5f); - glPixelTransferf(GL_RED_BIAS, 0.5f); - glPixelTransferf(GL_GREEN_BIAS, 0.5f); - glPixelTransferf(GL_BLUE_BIAS, 0.5f); - - glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_INT, recti); - - glPixelTransferf(GL_RED_SCALE, 1.0f); - glPixelTransferf(GL_GREEN_SCALE, 1.0f); - glPixelTransferf(GL_BLUE_SCALE, 1.0f); - glPixelTransferf(GL_RED_BIAS, 0.0f); - glPixelTransferf(GL_GREEN_BIAS, 0.0f); - glPixelTransferf(GL_BLUE_BIAS, 0.0f); -} - -static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, float *rect_float) -{ - float bias, scale, *rectf, clipend; - int a; - - if(rect_float==NULL) - return; - - if(G.scene->camera && G.scene->camera->type==OB_CAMERA) { - bias= ((Camera *)G.scene->camera->data)->clipsta; - clipend= ((Camera *)G.scene->camera->data)->clipend; - scale= 1.0f/(clipend-bias); - } - else { - bias= 0.1f; - scale= 0.01f; - clipend= 100.0f; - } - - rectf= MEM_mallocN(rectx*recty*4, "temp"); - for(a= rectx*recty -1; a>=0; a--) { - if(rect_float[a]>clipend) - rectf[a]= 0.0f; - else if(rect_float[a]spacedata.first; - rcti rect; - float colf[3]; - char *str= sima->showspare?sima->info_spare:sima->info_str; - - if(str==NULL) - return; - - rect= sa->winrct; - rect.ymin= rect.ymax-RW_HEADERY; - - glaDefine2DArea(&rect); - - /* clear header rect */ - BIF_GetThemeColor3fv(TH_BACK, colf); - glClearColor(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - - BIF_ThemeColor(TH_TEXT_HI); - glRasterPos2i(12, 5); - if(sima->showspare) { - BMF_DrawString(G.fonts, "(Previous)"); - glRasterPos2i(72, 5); - } - BMF_DrawString(G.fonts, str); -} - -void drawimagespace(ScrArea *sa, void *spacedata) -{ - SpaceImage *sima= spacedata; - ImBuf *ibuf= NULL; - Brush *brush; - float col[3]; - unsigned int *rect; - float x1, y1; - short sx, sy, dx, dy, show_render= 0, show_viewer= 0; - float xuser_asp, yuser_asp; - /* If derived data is used then make sure that object - * is up-to-date... might not be the case because updates - * are normally done in drawview and could get here before - * drawing a View3D. - */ - if (G.obedit && OBACT && (sima->flag & SI_DRAWSHADOW)) { - object_handle_update(OBACT); - } - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - if(sima->image && sima->image->source==IMA_SRC_VIEWER) { - show_viewer= 1; - if(sima->image->type==IMA_TYPE_R_RESULT) - show_render= 1; - } - what_image(sima); - - aspect_sima(sima, &xuser_asp, &yuser_asp); - - if(sima->image) { - - /* UGLY hack? until now iusers worked fine... but for flipbook viewer we need this */ - if(sima->image->type==IMA_TYPE_COMPOSITE) { - ImageUser *iuser= ntree_get_active_iuser(G.scene->nodetree); - if(iuser) { - BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0); - G.sima->iuser= *iuser; - } - } - /* and we check for spare */ - ibuf= imagewindow_get_ibuf(sima); - } - - if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) { - imagespace_grid(sima); - if(show_viewer==0) { - draw_uvs_sima(); - drawcursor_sima(xuser_asp, yuser_asp); - } - } - else { - float xim, yim, xoffs=0.0f, yoffs= 0.0f; - - if(image_preview_active(sa, &xim, &yim)) { - xoffs= G.scene->r.disprect.xmin; - yoffs= G.scene->r.disprect.ymin; - glColor3ub(0,0,0); - calc_image_view(sima, 'f'); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - glRectf(0.0f, 0.0f, 1.0f, 1.0f); - glLoadIdentity(); - } - else { - xim= ibuf->x * xuser_asp; yim= ibuf->y * yuser_asp; - } - - /* calc location */ - x1= sima->zoom*xoffs + ((float)sa->winx - sima->zoom*(float)xim)/2.0f; - y1= sima->zoom*yoffs + ((float)sa->winy - sima->zoom*(float)yim)/2.0f; - - x1-= sima->zoom*sima->xof; - y1-= sima->zoom*sima->yof; - - /* needed for gla draw */ - if(show_render) { - rcti rct= sa->winrct; - - imagewindow_draw_renderinfo(sa); /* calls glaDefine2DArea too */ - - rct.ymax-=RW_HEADERY; - glaDefine2DArea(&rct); - } - else glaDefine2DArea(&sa->winrct); - - glPixelZoom(sima->zoom * xuser_asp, sima->zoom * yuser_asp); - - if(sima->flag & SI_EDITTILE) { - /* create char buffer from float if needed */ - if(ibuf->rect_float && ibuf->rect==NULL) - IMB_rect_from_float(ibuf); - - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - - glPixelZoom(1.0, 1.0); - - dx= ibuf->x/sima->image->xrep; - dy= ibuf->y/sima->image->yrep; - sy= (sima->curtile / sima->image->xrep); - sx= sima->curtile - sy*sima->image->xrep; - - sx*= dx; - sy*= dy; - - calc_image_view(sima, 'p'); /* pixel */ - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - - cpack(0x0); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx, sy, sx+dx-1, sy+dy-1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - cpack(0xFFFFFF); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glRects(sx+1, sy+1, sx+dx, sy+dy); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - else if(sima->mode==SI_TEXTURE) { - - if(sima->image->tpageflag & IMA_TILES) { - - /* just leave this a while */ - if(sima->image->xrep<1) return; - if(sima->image->yrep<1) return; - - if(sima->curtile >= sima->image->xrep*sima->image->yrep) - sima->curtile = sima->image->xrep*sima->image->yrep - 1; - - dx= ibuf->x/sima->image->xrep; - dy= ibuf->y/sima->image->yrep; - - sy= (sima->curtile / sima->image->xrep); - sx= sima->curtile - sy*sima->image->xrep; - - sx*= dx; - sy*= dy; - - /* create char buffer from float if needed */ - if(ibuf->rect_float && ibuf->rect==NULL) - IMB_rect_from_float(ibuf); - - rect= get_part_from_ibuf(ibuf, sx, sy, sx+dx, sy+dy); - - /* rect= ibuf->rect; */ - for(sy= 0; sy+dy<=ibuf->y; sy+= dy) { - for(sx= 0; sx+dx<=ibuf->x; sx+= dx) { - glaDrawPixelsSafe(x1+sx*sima->zoom, y1+sy*sima->zoom, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect); - } - } - - MEM_freeN(rect); - } - else { - float x1_rep, y1_rep; - int x_rep, y_rep; - double time_current; - short loop_draw_ok = 0; - - if (sima->flag & SI_DRAW_TILE) { - loop_draw_ok= 1; - } - - time_current = PIL_check_seconds_timer(); - - for (x_rep= ((int)G.v2d->cur.xmin)-1; x_rep < G.v2d->cur.xmax; x_rep++) { - x1_rep=x1+ ((x_rep* ibuf->x * sima->zoom) *xuser_asp); - for (y_rep= ((int)G.v2d->cur.ymin)-1; y_rep < G.v2d->cur.ymax; y_rep++) { - y1_rep=y1+ ((y_rep * ibuf->y *sima->zoom) *yuser_asp); - - /* end repeating image loop */ - - if(!loop_draw_ok) { - y1_rep = y1; - x1_rep = x1; - } - - /*printf("Drawing %d %d zoom:%.6f (%.6f %.6f), (%.6f %.6f)\n", x_rep, y_rep, sima->zoom, G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax);*/ - - /* this part is generic image display */ - if(sima->flag & SI_SHOW_ALPHA) { - if(ibuf->rect) - sima_draw_alpha_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect); - else if(ibuf->rect_float && ibuf->channels==4) - sima_draw_alpha_pixelsf(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect_float); - } - else if(sima->flag & SI_SHOW_ZBUF && ((ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)) == 0)) { - if(ibuf->zbuf) - sima_draw_zbuf_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->zbuf); - else if(ibuf->zbuf_float) - sima_draw_zbuffloat_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->zbuf_float); - else if(ibuf->channels==1) - sima_draw_zbuffloat_pixels(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->rect_float); - } - else { - if(sima->flag & SI_USE_ALPHA) { - sima_draw_alpha_backdrop(sima, x1_rep, y1_rep, (float)ibuf->x, (float)ibuf->y); - glEnable(GL_BLEND); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - } - - /* detect if we need to redo the curve map. - ibuf->rect is zero for compositor and render results after change - convert to 32 bits always... drawing float rects isnt supported well (atis) - - NOTE: if float buffer changes, we have to manually remove the rect - */ - - if(ibuf->rect_float) { - if(ibuf->rect==NULL) { - if(image_curves_active(sa)) - curvemapping_do_ibuf(G.sima->cumap, ibuf); - else - IMB_rect_from_float(ibuf); - } - } - - if(ibuf->rect) - glaDrawPixelsSafe(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - // else - // glaDrawPixelsSafe(x1_rep, y1_rep, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float); - - if(sima->flag & SI_USE_ALPHA) - glDisable(GL_BLEND); - } - - /* only draw once */ - if(!loop_draw_ok) { - break; /* only draw once */ - } else if ((PIL_check_seconds_timer() - time_current) > 0.25) { - loop_draw_ok = 0; - break; - } - - /* tile draw loop */ - } - /* only draw once */ - if(!loop_draw_ok) break; - } - /* tile draw loop */ - - } - - brush= G.scene->toolsettings->imapaint.brush; - if(brush && (G.scene->toolsettings->imapaint.tool == PAINT_TOOL_CLONE)) { - int w, h; - unsigned char *clonerect; - - /* this is not very efficient, but glDrawPixels doesn't allow - drawing with alpha */ - clonerect= alloc_alpha_clone_image(&w, &h); - - if(clonerect) { - int offx, offy; - offx = sima->zoom*ibuf->x * + brush->clone.offset[0]; - offy = sima->zoom*ibuf->y * + brush->clone.offset[1]; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glaDrawPixelsSafe(x1 + offx, y1 + offy, w, h, w, GL_RGBA, GL_UNSIGNED_BYTE, clonerect); - glDisable(GL_BLEND); - - MEM_freeN(clonerect); - } - } - - glPixelZoom(1.0, 1.0); - - if(show_viewer==0) { - draw_uvs_sima(); - drawcursor_sima(xuser_asp, yuser_asp); - } - } - - glPixelZoom(1.0, 1.0); - - calc_image_view(sima, 'f'); /* float */ - } - - draw_image_transform(ibuf, xuser_asp, yuser_asp); - - mywinset(sa->win); /* restore scissor after gla call... */ - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - if(G.rendering==0) { - draw_image_view_tool(); - draw_image_view_icon(); - } - draw_area_emboss(sa); - - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, sima->blockscale, sima->blockscale, sima->blockscale); - if(!(G.rendering && show_render)) - image_blockhandlers(sa); - - sa->win_swap= WIN_BACK_OK; -} - -static void image_zoom_power_of_two(void) -{ - /* Make zoom a power of 2 */ - - G.sima->zoom = 1 / G.sima->zoom; - G.sima->zoom = log(G.sima->zoom) / log(2); - G.sima->zoom = ceil(G.sima->zoom); - G.sima->zoom = pow(2, G.sima->zoom); - G.sima->zoom = 1 / G.sima->zoom; -} - -static void image_zoom_set_factor(float zoomfac) -{ - SpaceImage *sima= curarea->spacedata.first; - int width, height; - - if (zoomfac <= 0.0f) - return; - - sima->zoom *= zoomfac; - - if (sima->zoom > 0.1f && sima->zoom < 4.0f) - return; - - /* check zoom limits */ - - calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where this should be 'p'?*/ - width= 256; - height= 256; - if (sima->image) { - ImBuf *ibuf= imagewindow_get_ibuf(sima); - - if (ibuf) { - float xim, yim; - /* I know a bit weak... but preview uses not actual image size */ - if(image_preview_active(curarea, &xim, &yim)) { - width= (int) xim; - height= (int) yim; - } - else { - width= ibuf->x; - height= ibuf->y; - } - } - } - width *= sima->zoom; - height *= sima->zoom; - - if ((width < 4) && (height < 4)) - sima->zoom /= zoomfac; - else if((curarea->winrct.xmax - curarea->winrct.xmin) <= sima->zoom) - sima->zoom /= zoomfac; - else if((curarea->winrct.ymax - curarea->winrct.ymin) <= sima->zoom) - sima->zoom /= zoomfac; -} - -void image_viewmove(int mode) -{ - short mval[2], mvalo[2], zoom0; - int oldcursor; - Window *win; - - getmouseco_sc(mvalo); - zoom0= G.sima->zoom; - - oldcursor=get_cursor(); - win=winlay_get_active_window(); - - SetBlenderCursor(BC_NSEW_SCROLLCURSOR); - - while(get_mbut()&(L_MOUSE|M_MOUSE)) { - - getmouseco_sc(mval); - - if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { - - if(mode==0) { - G.sima->xof += (mvalo[0]-mval[0])/G.sima->zoom; - G.sima->yof += (mvalo[1]-mval[1])/G.sima->zoom; - } - else if (mode==1) { - float factor; - - factor= 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/300.0; - image_zoom_set_factor(factor); - } - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else BIF_wait_for_statechange(); - } - window_set_cursor(win, oldcursor); - - if(image_preview_active(curarea, NULL, NULL)) { - /* recalculates new preview rect */ - scrarea_do_windraw(curarea); - image_preview_event(2); - } -} - -void image_viewzoom(unsigned short event, int invert) -{ - SpaceImage *sima= curarea->spacedata.first; - - if(event==WHEELDOWNMOUSE || event==PADMINUS) - image_zoom_set_factor((U.uiflag & USER_WHEELZOOMDIR)? 1.25: 0.8); - else if(event==WHEELUPMOUSE || event==PADPLUSKEY) - image_zoom_set_factor((U.uiflag & USER_WHEELZOOMDIR)? 0.8: 1.25); - else if(event==PAD1) - sima->zoom= 1.0; - else if(event==PAD2) - sima->zoom= (invert)? 2.0: 0.5; - else if(event==PAD4) - sima->zoom= (invert)? 4.0: 0.25; - else if(event==PAD8) - sima->zoom= (invert)? 8.0: 0.125; - - /* ensure pixel exact locations for draw */ - sima->xof= (int)sima->xof; - sima->yof= (int)sima->yof; - - if(image_preview_active(curarea, NULL, NULL)) { - /* recalculates new preview rect */ - scrarea_do_windraw(curarea); - image_preview_event(2); - } -} - -/** - * Updates the fields of the View2D member of the SpaceImage struct. - * Default behavior is to reset the position of the image and set the zoom to 1 - * If the image will not fit within the window rectangle, the zoom is adjusted - * - * @return void - * - */ -void image_home(void) -{ - ImBuf *ibuf; - int width, height, imgwidth, imgheight; - float zoomX, zoomY; - - if (curarea->spacetype != SPACE_IMAGE) return; - ibuf= imagewindow_get_ibuf(G.sima); - - if (ibuf == NULL) { - imgwidth = 256; - imgheight = 256; - } - else { - imgwidth = ibuf->x; - imgheight = ibuf->y; - } - - /* Check if the image will fit in the image with zoom==1 */ - width = curarea->winx; - height = curarea->winy; - if (((imgwidth >= width) || (imgheight >= height)) && - ((width > 0) && (height > 0))) { - /* Find the zoom value that will fit the image in the image space */ - zoomX = ((float)width) / ((float)imgwidth); - zoomY = ((float)height) / ((float)imgheight); - G.sima->zoom= MIN2(zoomX, zoomY); - - image_zoom_power_of_two(); - } - else { - G.sima->zoom= 1.0f; - } - - G.sima->xof= G.sima->yof= 0.0f; - - calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where this should be 'p'?*/ - /*calc_arearcts(curarea);*/ - scrarea_queue_winredraw(curarea); - scrarea_queue_winredraw(curarea); -} - -void image_viewcenter(void) -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - float size, min[2], max[2], d[2], xim=256.0f, yim=256.0f; - - if( is_uv_tface_editing_allowed()==0 ) return; - - if (!minmax_tface_uv(min, max)) return; - - if(ibuf) { - xim= ibuf->x; - yim= ibuf->y; - } - - G.sima->xof= (int) (((min[0] + max[0])*0.5f - 0.5f)*xim); - G.sima->yof= (int) (((min[1] + max[1])*0.5f - 0.5f)*yim); - - d[0] = max[0] - min[0]; - d[1] = max[1] - min[1]; - size= 0.5*MAX2(d[0], d[1])*MAX2(xim, yim)/256.0f; - - if(size<=0.01) size= 0.01; - - G.sima->zoom= 0.7/size; - - calc_image_view(G.sima, 'f'); /* was 'p' are there any cases where 'p' is still needed? */ - - scrarea_queue_winredraw(curarea); -} - - -/* *********************** render callbacks ***************** */ - -/* set on initialize render, only one render output to imagewindow can exist, so the global isnt dangerous yet :) */ -static ScrArea *image_area= NULL; - -/* can get as well the full picture, as the parts while rendering */ -static void imagewindow_progress(ScrArea *sa, RenderResult *rr, volatile rcti *renrect) -{ - SpaceImage *sima= sa->spacedata.first; - float x1, y1, *rectf= NULL; - unsigned int *rect32= NULL; - int ymin, ymax, xmin, xmax; - - /* if renrect argument, we only display scanlines */ - if(renrect) { - /* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */ - if(rr->renlay==NULL || renrect->ymax>=rr->recty) - return; - - /* xmin here is first subrect x coord, xmax defines subrect width */ - xmin = renrect->xmin; - xmax = renrect->xmax - xmin; - if (xmax<2) return; - - ymin= renrect->ymin; - ymax= renrect->ymax - ymin; - if(ymax<2) - return; - renrect->ymin= renrect->ymax; - } - else { - xmin = ymin = 0; - xmax = rr->rectx - 2*rr->crop; - ymax = rr->recty - 2*rr->crop; - } - - /* image window cruft */ - - /* find current float rect for display, first case is after composit... still weak */ - if(rr->rectf) - rectf= rr->rectf; - else { - if(rr->rect32) - rect32= (unsigned int *)rr->rect32; - else { - if(rr->renlay==NULL || rr->renlay->rectf==NULL) return; - rectf= rr->renlay->rectf; - } - } - if(rectf) { - /* if scanline updates... */ - rectf+= 4*(rr->rectx*ymin + xmin); - - /* when rendering more pixels than needed, we crop away cruft */ - if(rr->crop) - rectf+= 4*(rr->crop*rr->rectx + rr->crop); - } - - /* tilerect defines drawing offset from (0,0) */ - /* however, tilerect (xmin, ymin) is first pixel */ - x1 = sima->centx + (rr->tilerect.xmin + rr->crop + xmin)*sima->zoom; - y1 = sima->centy + (rr->tilerect.ymin + rr->crop + ymin)*sima->zoom; - - /* needed for gla draw */ - { rcti rct= sa->winrct; rct.ymax-= RW_HEADERY; glaDefine2DArea(&rct);} - - glPixelZoom(sima->zoom, sima->zoom); - - if(rect32) - glaDrawPixelsSafe(x1, y1, xmax, ymax, rr->rectx, GL_RGBA, GL_UNSIGNED_BYTE, rect32); - else - glaDrawPixelsSafe_to32(x1, y1, xmax, ymax, rr->rectx, rectf); - - glPixelZoom(1.0, 1.0); - -} - - -/* in render window; display a couple of scanlines of rendered image */ -/* NOTE: called while render, so no malloc allowed! */ -static void imagewindow_progress_display_cb(RenderResult *rr, volatile rcti *rect) -{ - - if (image_area) { - - imagewindow_progress(image_area, rr, rect); - - /* no screen_swapbuffers, prevent any other window to draw */ - myswapbuffers(); - } -} - -/* unused, init_display_cb is called on each render */ -static void imagewindow_clear_display_cb(RenderResult *rr) -{ - if (image_area) { - } -} - -/* returns biggest area that is not uv/image editor. Note that it uses buttons */ -/* window as the last possible alternative. */ -static ScrArea *biggest_non_image_area(void) -{ - ScrArea *sa, *big= NULL; - int size, maxsize= 0, bwmaxsize= 0; - short foundwin= 0; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->winx > 10 && sa->winy > 10) { - size= sa->winx*sa->winy; - if(sa->spacetype == SPACE_BUTS) { - if(foundwin == 0 && size > bwmaxsize) { - bwmaxsize= size; - big= sa; - } - } - else if(sa->spacetype != SPACE_IMAGE && size > maxsize) { - maxsize= size; - big= sa; - foundwin= 1; - } - } - } - - return big; -} - -static ScrArea *biggest_area(void) -{ - ScrArea *sa, *big= NULL; - int size, maxsize= 0; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - size= sa->winx*sa->winy; - if(size > maxsize) { - maxsize= size; - big= sa; - } - } - return big; -} - - -/* if R_DISPLAYIMAGE - use Image Window showing Render Result - else: turn largest non-image area into Image Window (not to frustrate texture or composite usage) - else: then we use Image Window anyway... - if R_DISPSCREEN - make a new temp fullscreen area with Image Window -*/ - -static ScrArea *find_area_showing_r_result(void) -{ - ScrArea *sa; - SpaceImage *sima; - - /* find an imagewindow showing render result */ - for(sa=G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_IMAGE) { - sima= sa->spacedata.first; - if(sima->image && sima->image->type==IMA_TYPE_R_RESULT) - break; - } - } - return sa; -} - -static ScrArea *imagewindow_set_render_display(void) -{ - ScrArea *sa; - SpaceImage *sima; - - sa= find_area_showing_r_result(); - - if(sa==NULL) { - /* find largest open non-image area */ - sa= biggest_non_image_area(); - if(sa) { - newspace(sa, SPACE_IMAGE); - sima= sa->spacedata.first; - - /* makes ESC go back to prev space */ - sima->flag |= SI_PREVSPACE; - } - else { - /* use any area of decent size */ - sa= biggest_area(); - if(sa->spacetype!=SPACE_IMAGE) { - newspace(sa, SPACE_IMAGE); - sima= sa->spacedata.first; - - /* makes ESC go back to prev space */ - sima->flag |= SI_PREVSPACE; - } - } - } - - sima= sa->spacedata.first; - - /* get the correct image, and scale it */ - sima->image= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); - - if(G.displaymode==R_DISPLAYSCREEN) { - if(sa->full==0) { - sima->flag |= SI_FULLWINDOW; - /* fullscreen works with lousy curarea */ - curarea= sa; - area_fullscreen(); - sa= curarea; - } - } - - return sa; -} - -static void imagewindow_init_display_cb(RenderResult *rr) -{ - - image_area= imagewindow_set_render_display(); - - if(image_area) { - SpaceImage *sima= image_area->spacedata.first; - - areawinset(image_area->win); - - if(sima->info_str==NULL) - sima->info_str= MEM_callocN(RW_MAXTEXT, "info str imagewin"); - - /* calc location using original size (tiles don't tell) */ - sima->centx= (image_area->winx - sima->zoom*(float)rr->rectx)/2.0f; - sima->centy= (image_area->winy - sima->zoom*(float)rr->recty)/2.0f; - - sima->centx-= sima->zoom*sima->xof; - sima->centy-= sima->zoom*sima->yof; - - drawimagespace(image_area, sima); - if(image_area->headertype) scrarea_do_headdraw(image_area); - - /* no screen_swapbuffers, prevent any other window to draw */ - myswapbuffers(); - - allqueue(REDRAWIMAGE, 0); /* redraw in end */ - } -} - -/* coming from BIF_toggle_render_display() */ -void imagewindow_toggle_render(void) -{ - ScrArea *sa; - - /* check if any imagewindow is showing temporal render output */ - for(sa=G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_IMAGE) { - SpaceImage *sima= sa->spacedata.first; - - if(sima->image && sima->image->type==IMA_TYPE_R_RESULT) - if(sima->flag & (SI_PREVSPACE|SI_FULLWINDOW)) - break; - } - } - if(sa) { - addqueue(sa->win, ESCKEY, 1); /* also returns from fullscreen */ - } - else { - sa= imagewindow_set_render_display(); - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } -} - -/* NOTE: called while render, so no malloc allowed! */ -static void imagewindow_renderinfo_cb(RenderStats *rs) -{ - - if(image_area) { - SpaceImage *sima= image_area->spacedata.first; - - if(rs) - make_renderinfo_string(rs, sima->info_str); - - imagewindow_draw_renderinfo(image_area); - - /* no screen_swapbuffers, prevent any other window to draw */ - myswapbuffers(); - } -} - -void imagewindow_render_callbacks(Render *re) -{ - RE_display_init_cb(re, imagewindow_init_display_cb); - RE_display_draw_cb(re, imagewindow_progress_display_cb); - RE_display_clear_cb(re, imagewindow_clear_display_cb); - RE_stats_draw_cb(re, imagewindow_renderinfo_cb); -} - -void imagewin_store_spare(void) -{ - ScrArea *sa= find_area_showing_r_result(); - - if(sa) { - ImBuf *ibuf; - SpaceImage *sima= sa->spacedata.first; - - if(sima->spare==NULL) - return; - - /* only store when it does not show spare */ - if(sima->showspare==0) - return; - sima->showspare= 0; - - /* free spare */ - IMB_freeImBuf(sima->spare); - - /* make a copy of render result */ - ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - sima->spare= IMB_dupImBuf(ibuf); - - if(sima->info_str) - BLI_strncpy(sima->info_spare, sima->info_str, RW_MAXTEXT); - - } -} - -/* context: in current image window? */ -void imagewindow_swap_render_rects(void) -{ - ScrArea *sa= find_area_showing_r_result(); - - if(sa) { - SpaceImage *sima= sa->spacedata.first; - ImBuf *ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - if(ibuf) { - - sima->showspare ^= 1; - - if(sima->spare==NULL) - sima->spare= IMB_allocImBuf(ibuf->x, ibuf->y, 32, 0, 0); - if(sima->info_spare==NULL) - sima->info_spare= MEM_callocN(RW_MAXTEXT, "info str imagewin"); - - allqueue(REDRAWIMAGE, 0); - } - } -} - diff --git a/source/blender/src/drawimasel.c b/source/blender/src/drawimasel.c deleted file mode 100644 index 88b6beb54c5..00000000000 --- a/source/blender/src/drawimasel.c +++ /dev/null @@ -1,735 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _WIN32 -#pragma warning (once : 4761) -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" - -#include "BLI_blenlib.h" -#include "BLI_storage_types.h" -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif - - -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_icons.h" -#include "BKE_utildefines.h" -#include "BIF_filelist.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_resources.h" -#include "BIF_language.h" - -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_previewrender.h" -#include "BIF_fsmenu.h" -#include "BIF_space.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "BSE_drawimasel.h" -#include "BSE_drawipo.h" /* for v2d functions */ -#include "BSE_view.h" - -#include "BLO_readfile.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "PIL_time.h" - -#include "blendef.h" -#include "mydevice.h" - -#include "interface.h" /* urm... for rasterpos_safe, roundbox */ - -#define BUTTONWIDTH 20 -#define BOOKMARKWIDTH_MAX 240 - -void calc_imasel_rcts(SpaceImaSel *simasel, int winx, int winy) -{ - int width = (int)16.0f*simasel->aspect; - int numtiles; - int numfiles = 0; - int tilewidth = simasel->prv_w + TILE_BORDER_X*4; - int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize; - - // complete area of the space - simasel->v2d.mask.xmin= simasel->v2d.mask.ymin = 0; - simasel->v2d.mask.xmax= winx; - simasel->v2d.mask.ymax= winy; - - // vertical scroll bar - simasel->v2d.vert= simasel->v2d.mask; - simasel->v2d.vert.xmax -= TILE_BORDER_X + 2; - simasel->v2d.vert.xmin= simasel->v2d.vert.xmax- width - TILE_BORDER_X - 2; - simasel->v2d.vert.ymax -= IMASEL_BUTTONS_HEIGHT + TILE_BORDER_Y + 2; - simasel->v2d.vert.ymin += TILE_BORDER_Y + 2; - // simasel->v2d.mask.xmax= simasel->v2d.vert.xmin; - - if (simasel->flag & FILE_BOOKMARKS) { - int bmwidth = (simasel->v2d.vert.xmin - simasel->v2d.mask.xmin)/4.0f; - if (bmwidth > BOOKMARKWIDTH_MAX) bmwidth = BOOKMARKWIDTH_MAX; - - simasel->bookmarkrect.xmin = simasel->v2d.mask.xmin + TILE_BORDER_X; - simasel->bookmarkrect.xmax = simasel->v2d.mask.xmin + bmwidth - TILE_BORDER_X; - simasel->bookmarkrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y; - simasel->bookmarkrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y; - - simasel->viewrect.xmin = simasel->bookmarkrect.xmax + TILE_BORDER_X; - simasel->viewrect.xmax = simasel->v2d.vert.xmin - TILE_BORDER_X; - simasel->viewrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y; - simasel->viewrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y; - } else { - simasel->viewrect.xmin = simasel->v2d.mask.xmin + TILE_BORDER_X; - simasel->viewrect.xmax = simasel->v2d.vert.xmin - TILE_BORDER_X; - simasel->viewrect.ymax = simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT - TILE_BORDER_Y; - simasel->viewrect.ymin = simasel->v2d.mask.ymin + TILE_BORDER_Y; - } - - simasel->numtilesx = (simasel->viewrect.xmax - simasel->viewrect.xmin) / tilewidth; - simasel->numtilesy = (simasel->viewrect.ymax - simasel->viewrect.ymin) / tileheight; - numtiles = simasel->numtilesx*simasel->numtilesy; - - if (simasel->files) { - numfiles = BIF_filelist_numfiles(simasel->files); - } - if (numtiles > numfiles) numtiles = numfiles; - - simasel->scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - if (numtiles < numfiles) { - simasel->scrollheight = ((float)numtiles / (float)numfiles)*simasel->scrollarea; - simasel->scrollarea -= simasel->scrollheight; - } else { - simasel->scrollheight = simasel->scrollarea; - } - if (simasel->scrollarea < 0) simasel->scrollarea = 0; -} - -void draw_imasel_scroll(SpaceImaSel *simasel) -{ - rcti scrollbar; - rcti scrollhandle; - - scrollbar.xmin= simasel->v2d.cur.xmin + simasel->v2d.vert.xmin; - scrollbar.ymin = simasel->v2d.cur.ymin + simasel->v2d.vert.ymin; - scrollbar.xmax= simasel->v2d.cur.xmin + simasel->v2d.vert.xmax; - scrollbar.ymax = simasel->v2d.cur.ymin + simasel->v2d.vert.ymax; - - scrollhandle.xmin= scrollbar.xmin; - scrollhandle.ymin = scrollbar.ymax - simasel->scrollpos -1; - scrollhandle.xmax= scrollbar.xmax-1; - scrollhandle.ymax = scrollbar.ymax - simasel->scrollpos - simasel->scrollheight; - - BIF_ThemeColor(TH_SHADE1); - glRecti(scrollbar.xmin, scrollbar.ymin, scrollbar.xmax, scrollbar.ymax); - uiEmboss(scrollbar.xmin-2, scrollbar.ymin-2, scrollbar.xmax+2, scrollbar.ymax+2, 1); - - BIF_ThemeColor(TH_SHADE2); - glRecti(scrollhandle.xmin, scrollhandle.ymin, scrollhandle.xmax, scrollhandle.ymax); - - uiEmboss(scrollhandle.xmin, scrollhandle.ymin, scrollhandle.xmax, scrollhandle.ymax, 1); -} - -static void draw_tile(SpaceImaSel *simasel, short sx, short sy, int colorid) -{ - /* TODO: BIF_ThemeColor seems to need this to show the color, not sure why? - elubie */ - glEnable(GL_BLEND); - glColor4ub(0, 0, 0, 100); - glDisable(GL_BLEND); - - BIF_ThemeColor4(colorid); - uiSetRoundBox(15); - uiRoundBox(sx+TILE_BORDER_X, sy - simasel->prv_h - TILE_BORDER_Y*3 - U.fontsize, sx + simasel->prv_w + TILE_BORDER_X*3, sy, 6); -} - -static float shorten_string(SpaceImaSel *simasel, char* string, float w) -{ - short shortened = 0; - float sw = 0; - - sw = BIF_GetStringWidth(simasel->curfont, string, 0); - while (sw>w) { - int slen = strlen(string); - string[slen-1] = '\0'; - sw = BIF_GetStringWidth(simasel->curfont, string, 0); - shortened = 1; - } - if (shortened) { - int slen = strlen(string); - if (slen > 3) { - BLI_strncpy(string+slen-3, "...", 4); - } - } - return sw; -} - -static void draw_file(SpaceImaSel *simasel, short sx, short sy, struct direntry *file) -{ - short soffs; - char fname[FILE_MAXFILE]; - float sw; - - BLI_strncpy(fname,file->relname, FILE_MAXFILE); - sw = shorten_string(simasel, fname, simasel->prv_w ); - soffs = (simasel->prv_w + TILE_BORDER_X*4 - sw) / 2; - - ui_rasterpos_safe(sx+soffs, sy - simasel->prv_h - TILE_BORDER_Y*2 - U.fontsize, simasel->aspect); -#ifdef WIN32 - BIF_DrawString(simasel->curfont, fname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8)); -#else - BIF_DrawString(simasel->curfont, fname, (U.transopts & USER_TR_MENUS)); -#endif -} - -static void draw_imasel_bookmarks(ScrArea *sa, SpaceImaSel *simasel) -{ - char bookmark[FILE_MAX]; - float sw; - - if (simasel->flag & FILE_BOOKMARKS) { - int nentries = fsmenu_get_nentries(); - int i; - short sx, sy; - int bmwidth; - int linestep = U.fontsize*3/2; - - sx = simasel->bookmarkrect.xmin + TILE_BORDER_X; - sy = simasel->bookmarkrect.ymax - TILE_BORDER_Y - linestep; - bmwidth = simasel->bookmarkrect.xmax - simasel->bookmarkrect.xmin - 2*TILE_BORDER_X; - - if (bmwidth < 0) return; - - for (i=0; i< nentries && sy > linestep ;++i) { - char *fname = fsmenu_get_entry(i); - char *sname = NULL; - - if (fname) { - int sl; - BLI_strncpy(bookmark, fname, FILE_MAX); - - sl = strlen(bookmark)-1; - if (bookmark[sl] == '\\' || bookmark[sl] == '/') { - bookmark[sl] = '\0'; - sl--; - } - while (sl) { - if (bookmark[sl] == '\\' || bookmark[sl] == '/'){ - sl++; - break; - }; - sl--; - } - sname = &bookmark[sl]; - sw = shorten_string(simasel, sname, bmwidth); - - - if (simasel->active_bookmark == i ) { - glEnable(GL_BLEND); - glColor4ub(0, 0, 0, 100); - glDisable(GL_BLEND); - BIF_ThemeColor(TH_HILITE); - uiSetRoundBox(15); - uiRoundBox(simasel->bookmarkrect.xmin + TILE_BORDER_X - 1, sy - linestep*0.25, simasel->bookmarkrect.xmax - TILE_BORDER_X + 1, sy + linestep*0.75, 6); - BIF_ThemeColor(TH_TEXT_HI); - } else { - BIF_ThemeColor(TH_TEXT); - } - ui_rasterpos_safe(sx, sy, simasel->aspect); -#ifdef WIN32 - BIF_DrawString(simasel->curfont, sname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8)); -#else - BIF_DrawString(simasel->curfont, sname, (U.transopts & USER_TR_MENUS)); -#endif - sy -= linestep; - } else { - cpack(0xB0B0B0); - sdrawline(sx, sy + U.fontsize/2 , sx + bmwidth, sy + U.fontsize/2); - cpack(0x303030); - sdrawline(sx, sy + 1 + U.fontsize/2 , sx + bmwidth, sy + 1 + U.fontsize/2); - sy -= linestep; - } - } - - uiEmboss(simasel->bookmarkrect.xmin, simasel->bookmarkrect.ymin, simasel->bookmarkrect.xmax-1, simasel->bookmarkrect.ymax-1, 1); - } -} - -static void draw_imasel_previews(ScrArea *sa, SpaceImaSel *simasel) -{ - static double lasttime= 0; - struct FileList* files = simasel->files; - int numfiles; - struct direntry *file; - int numtiles; - - int tilewidth = simasel->prv_w + TILE_BORDER_X*4; - int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize; - short sx, sy; - int do_load = 1; - - ImBuf* imb=0; - int i,j; - short type; - int colorid = 0; - int todo; - int fileoffset, rowoffset, columnoffset; - float scrollofs; - - - rcti viewrect = simasel->viewrect; - - if (!files) return; - /* Reload directory */ - BLI_strncpy(simasel->dir, BIF_filelist_dir(files), FILE_MAXDIR); - - type = BIF_filelist_gettype(simasel->files); - - if (BIF_filelist_empty(files)) - { - unsigned int filter = 0; - BIF_filelist_hidedot(simasel->files, simasel->flag & FILE_HIDE_DOT); - if (simasel->flag & FILE_FILTER) { - filter = simasel->filter ; - } else { - filter = 0; - } - - BIF_filelist_setfilter(simasel->files, filter); - BIF_filelist_readdir(files); - - if(simasel->sort!=FILE_SORTALPHA) BIF_filelist_sort(simasel->files, simasel->sort); - } - - BIF_filelist_imgsize(simasel->files,simasel->prv_w,simasel->prv_h); - - numfiles = BIF_filelist_numfiles(files); - numtiles = simasel->numtilesx*simasel->numtilesy; - - if (numtiles > numfiles) numtiles = numfiles; - - todo = 0; - if (lasttime < 0.001) lasttime = PIL_check_seconds_timer(); - - - if (simasel->numtilesx > 0) { - /* calculate the offset to start drawing */ - if ((numtiles < numfiles) && (simasel->scrollarea > 0)) { - fileoffset = numfiles*( (simasel->scrollpos) / simasel->scrollarea) + 0.5; - } else { - fileoffset = 0; - } - rowoffset = (fileoffset / simasel->numtilesx)*simasel->numtilesx; - columnoffset = fileoffset % simasel->numtilesx; - scrollofs = (float)tileheight*(float)columnoffset/(float)simasel->numtilesx; - } else { - rowoffset = 0; - scrollofs = 0; - } - /* add partially visible row */ - numtiles += simasel->numtilesx; - for (i=rowoffset, j=0 ; (i < numfiles) && (j < numtiles); ++i, ++j) - { - sx = simasel->v2d.cur.xmin + viewrect.xmin + (j % simasel->numtilesx)*tilewidth; - sy = simasel->v2d.cur.ymin + viewrect.ymax + (short)scrollofs - (viewrect.ymin + (j / simasel->numtilesx)*tileheight); - - file = BIF_filelist_file(files, i); - - if (simasel->active_file == i) { - colorid = TH_ACTIVE; - draw_tile(simasel, sx, sy, colorid); - } else if (file->flags & ACTIVE) { - colorid = TH_HILITE; - draw_tile(simasel, sx, sy, colorid); - } else { - /* - colorid = TH_PANEL; - draw_tile(simasel, sx, sy, colorid); - */ - } - - if ( type == FILE_MAIN) { - ID *id; - int icon_id = 0; - int idcode; - idcode= BIF_groupname_to_code(simasel->dir); - if (idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { - id = (ID *)file->poin; - icon_id = BKE_icon_getid(id); - } - if (icon_id) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - if (do_load) { - BIF_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 0); - } else { - BIF_icon_draw_preview(sx+2*TILE_BORDER_X, sy-simasel->prv_w-TILE_BORDER_X, icon_id, 1); - todo++; - } - - glDisable(GL_BLEND); - } - } - else { - if ( (file->flags & IMAGEFILE) || (file->flags & MOVIEFILE)) - { - if (do_load) { - BIF_filelist_loadimage(simasel->files, i); - } else { - todo++; - } - imb = BIF_filelist_getimage(simasel->files, i); - } else { - imb = BIF_filelist_getimage(simasel->files, i); - } - - if (imb) { - float fx = ((float)simasel->prv_w - (float)imb->x)/2.0f; - float fy = ((float)simasel->prv_h - (float)imb->y)/2.0f; - short dx = (short)(fx + 0.5f); - short dy = (short)(fy + 0.5f); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // glaDrawPixelsSafe((float)sx+8 + dx, (float)sy - imgwidth + dy - 8, imb->x, imb->y, imb->x, GL_RGBA, GL_UNSIGNED_BYTE, imb->rect); - glColor4f(1.0, 1.0, 1.0, 1.0); - glaDrawPixelsTex((float)sx+2*TILE_BORDER_X + dx, (float)sy - simasel->prv_h + dy - 2*TILE_BORDER_Y, imb->x, imb->y,GL_UNSIGNED_BYTE, imb->rect); - // glDisable(GL_BLEND); - imb = 0; - } - } - - if (type == FILE_MAIN) { - glColor3f(1.0f, 1.0f, 1.0f); - } - else { - if (S_ISDIR(file->type)) { - glColor3f(1.0f, 1.0f, 0.9f); - } - else if (file->flags & IMAGEFILE) { - BIF_ThemeColor(TH_SEQ_IMAGE); - } - else if (file->flags & MOVIEFILE) { - BIF_ThemeColor(TH_SEQ_MOVIE); - } - else if (file->flags & BLENDERFILE) { - BIF_ThemeColor(TH_SEQ_SCENE); - } - else { - if (simasel->active_file == i) { - BIF_ThemeColor(TH_GRID); /* grid used for active text */ - } else if (file->flags & ACTIVE) { - BIF_ThemeColor(TH_TEXT_HI); - } else { - BIF_ThemeColor(TH_TEXT); - } - } - } - - draw_file(simasel, sx, sy, file); - - if(do_load && (PIL_check_seconds_timer() - lasttime > 0.3)) { - lasttime= PIL_check_seconds_timer(); - do_load = 0; - } - } - - if (!do_load && todo > 0) /* we broke off loading */ - addafterqueue(sa->win, RENDERPREVIEW, 1); -} - - -/* in panel space! */ -static void imasel_imgdraw(ScrArea *sa, uiBlock *block) -{ - SpaceImaSel *simasel= sa->spacedata.first; - rctf dispf; - rcti winrect; - struct direntry *file; - char path[FILE_MAX]; - float tsize; - short ofsx=0; - short ofsy=0; - short ex, ey; - float scaledx, scaledy; - int index; - - BLI_init_rctf(&dispf, 0.0f, (block->maxx - block->minx)-0.0f, 0.0f, (block->maxy - block->miny)-0.0f); - ui_graphics_to_window_rct(sa->win, &dispf, &winrect); - - if (!simasel->img) { - BLI_join_dirfile(path, simasel->dir, simasel->file); - if (!BLI_exists(path)) - return; - - index = BIF_filelist_find(simasel->files, simasel->file); - if (index >= 0) { - file = BIF_filelist_file(simasel->files,index); - if (file->flags & IMAGEFILE || file->flags & MOVIEFILE) { - simasel->img = IMB_loadiffname(path, IB_rect); - - if (simasel->img) { - tsize = MIN2(winrect.xmax - winrect.xmin,winrect.ymax - winrect.ymin); - - if (simasel->img->x > simasel->img->y) { - scaledx = (float)tsize; - scaledy = ( (float)simasel->img->y/(float)simasel->img->x )*tsize; - ofsy = (scaledx - scaledy) / 2.0; - ofsx = 0; - } - else { - scaledy = (float)tsize; - scaledx = ( (float)simasel->img->x/(float)simasel->img->y )*tsize; - ofsx = (scaledy - scaledx) / 2.0; - ofsy = 0; - } - ex = (short)scaledx; - ey = (short)scaledy; - - IMB_scaleImBuf(simasel->img, ex, ey); - } - } - } - } - if (simasel->img == NULL) - return; - if(simasel->img->rect==NULL) - return; - - /* correction for gla draw */ - BLI_translate_rcti(&winrect, -curarea->winrct.xmin, -curarea->winrct.ymin); - - glaDefine2DArea(&sa->winrct); - glaDrawPixelsSafe(winrect.xmin+ofsx, winrect.ymin+ofsy, simasel->img->x, simasel->img->y, simasel->img->x, GL_RGBA, GL_UNSIGNED_BYTE, simasel->img->rect); -} - -static void imasel_panel_image(ScrArea *sa, short cntrl) -{ - uiBlock *block; - SpaceImaSel *simasel= sa->spacedata.first; - short w = 300; - short h = 300; - short offsx, offsy; - - if (simasel->img) { - w = simasel->img->x; - h = simasel->img->y; - } - - offsx = -150 + (simasel->v2d.mask.xmax - simasel->v2d.mask.xmin)/2; - offsy = -150 + (simasel->v2d.mask.ymax - simasel->v2d.mask.ymin)/2; - - block= uiNewBlock(&curarea->uiblocks, "imasel_panel_image", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMASEL_HANDLER_IMAGE); // for close and esc - if(uiNewPanel(curarea, block, "Image Preview", "Image Browser", offsx, offsy, w, h)==0) - return; - uiBlockSetDrawExtraFunc(block, imasel_imgdraw); -} - -static void imasel_blockhandlers(ScrArea *sa) -{ - SpaceImaSel *simasel= sa->spacedata.first; - short a; - - for(a=0; ablockhandler[a]) { - - case IMASEL_HANDLER_IMAGE: - imasel_panel_image(sa, simasel->blockhandler[a+1]); - break; - - } - /* clear action value for event */ - simasel->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); -} - - -static void draw_imasel_buttons(ScrArea *sa, SpaceImaSel* simasel) -{ - uiBlock *block; - int loadbutton; - char name[20]; - char *menu; - float slen; - float parentbut_width = 20; - float bookmarkbut_width = 0.0f; - int filebuty1, filebuty2; - - float xmin = simasel->v2d.mask.xmin + 10; - float xmax = simasel->v2d.mask.xmax - 10; - - filebuty1= simasel->v2d.mask.ymax - IMASEL_BUTTONS_HEIGHT; - filebuty2= filebuty1+IMASEL_BUTTONS_HEIGHT/2 -6; - - /* HEADER */ - sprintf(name, "win %d", sa->win); - block = uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->win); - - uiSetButLock( BIF_filelist_gettype(simasel->files)==FILE_MAIN && simasel->returnfunc, NULL); - - /* space available for load/save buttons? */ - slen = BIF_GetStringWidth(G.font, simasel->title, simasel->aspect); - loadbutton= slen > 60 ? slen + 20 : 80; /* MAX2(80, 20+BIF_GetStringWidth(G.font, simasel->title)); */ - if(simasel->v2d.mask.xmax-simasel->v2d.mask.xmin > loadbutton+20) { - if(simasel->title[0]==0) { - loadbutton= 0; - } - } - else { - loadbutton= 0; - } - - menu= fsmenu_build_menu(); - - if (menu[0]) { - bookmarkbut_width = parentbut_width; - } - - uiDefBut(block, TEX, B_FS_FILENAME,"", xmin+parentbut_width+bookmarkbut_width+2, filebuty1, xmax-xmin-loadbutton-parentbut_width-bookmarkbut_width, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, TEX, B_FS_DIRNAME,"", xmin+parentbut_width, filebuty2, xmax-xmin-loadbutton-parentbut_width, 21, simasel->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - - if(loadbutton) { - uiSetCurFont(block, UI_HELV); - uiDefBut(block, BUT,B_FS_LOAD, simasel->title, xmax-loadbutton, filebuty2, loadbutton, 21, simasel->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - uiDefBut(block, BUT,B_FS_CANCEL, "Cancel", xmax-loadbutton, filebuty1, loadbutton, 21, simasel->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - } - - if(menu[0]) { // happens when no .Bfs is there, and first time browse - uiDefButS(block, MENU,B_FS_DIR_MENU, menu, xmin, filebuty1, parentbut_width, 21, &simasel->menu, 0, 0, 0, 0, ""); - uiDefBut(block, BUT, B_FS_BOOKMARK, "B", xmin+22, filebuty1, bookmarkbut_width, 21, 0, 0, 0, 0, 0, "Bookmark current directory"); - } - MEM_freeN(menu); - - uiDefBut(block, BUT, B_FS_PARDIR, "P", xmin, filebuty2, parentbut_width, 21, 0, 0, 0, 0, 0, "Move to the parent directory (PKEY)"); - - uiDrawBlock(block); -} - - - -/* ************** main drawing function ************** */ - -void drawimaselspace(ScrArea *sa, void *spacedata) -{ - float col[3]; - SpaceImaSel *simasel= curarea->spacedata.first; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* HACK: somehow when going fullscreen, v2d isn't set correctly */ - simasel->v2d.cur.xmin= simasel->v2d.cur.ymin= 0.0f; - simasel->v2d.cur.xmax= sa->winx; - simasel->v2d.cur.ymax= sa->winy; - simasel->v2d.tot= simasel->v2d.cur; - test_view2d(G.v2d, sa->winx, sa->winy); - - calc_imasel_rcts(simasel, sa->winx, sa->winy); - - myortho2(simasel->v2d.cur.xmin, simasel->v2d.cur.xmax, simasel->v2d.cur.ymin, simasel->v2d.cur.ymax); - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - /* warning; blocks need to be freed each time, handlers dont remove */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - /* aspect+font, set each time */ - simasel->aspect= (simasel->v2d.cur.xmax - simasel->v2d.cur.xmin)/((float)sa->winx); - simasel->curfont= uiSetCurFont_ext(simasel->aspect); - - if (!simasel->files) { - simasel->files = BIF_filelist_new(); - BIF_filelist_setdir(simasel->files, simasel->dir); - BIF_filelist_settype(simasel->files, simasel->type); - } - - /* Buttons */ - draw_imasel_buttons(sa, simasel); - - /* scrollbar */ - draw_imasel_scroll(simasel); - - /* bookmarks */ - draw_imasel_bookmarks(sa, simasel); - - uiEmboss(simasel->viewrect.xmin, simasel->viewrect.ymin, simasel->v2d.mask.xmax-TILE_BORDER_X, simasel->viewrect.ymax, 1); - - - glScissor(sa->winrct.xmin + simasel->viewrect.xmin , - sa->winrct.ymin + simasel->viewrect.ymin, - simasel->viewrect.xmax - simasel->viewrect.xmin , - simasel->viewrect.ymax - simasel->viewrect.ymin); - - /* previews */ - draw_imasel_previews(sa, simasel); - - /* BIF_ThemeColor(TH_HEADER);*/ - /* glRecti(simasel->viewrect.xmin, simasel->viewrect.ymin, simasel->viewrect.xmax, simasel->viewrect.ymax);*/ - - /* restore viewport (not needed yet) */ - mywinset(sa->win); - - /* ortho at pixel level curarea */ - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - - draw_area_emboss(sa); - - imasel_blockhandlers(sa); - - curarea->win_swap= WIN_BACK_OK; -} diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c deleted file mode 100644 index fd3fa0df927..00000000000 --- a/source/blender/src/drawipo.c +++ /dev/null @@ -1,2730 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef _WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_sequence_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_utildefines.h" - -#include "BIF_cursors.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_glutil.h" -#include "BIF_editseq.h" -#include "BIF_editaction.h" -#include "BIF_language.h" - -#include "BSE_drawipo.h" -#include "BSE_view.h" -#include "BSE_editipo.h" -#include "BSE_editipo_types.h" -#include "BSE_editnla_types.h" -#include "BSE_time.h" - -#include "BPY_extern.h" - -#include "mydevice.h" -#include "blendef.h" -#include "butspace.h" // shouldnt be... -#include "interface.h" /* for ui_rasterpos_safe */ -#include "winlay.h" - -/* local define... also used in editipo ... */ -#define ISPOIN(a, b, c) ( (a->b) && (a->c) ) -#define ISPOIN3(a, b, c, d) ( (a->b) && (a->c) && (a->d) ) -#define ISPOIN4(a, b, c, d, e) ( (a->b) && (a->c) && (a->d) && (a->e) ) - - /* minimum pixels per gridstep */ -#define IPOSTEP 35 - -static float ipogrid_dx, ipogrid_dy, ipogrid_startx, ipogrid_starty; -static int ipomachtx, ipomachty; - -static int vertymin, vertymax, horxmin, horxmax; /* globals to test LEFTMOUSE for scrollbar */ - -static void scroll_prstr(float x, float y, float val, char dir, int disptype) -{ - int len, macht; - char str[32]; - - if(dir=='v') { - macht= ipomachty; - if ELEM(disptype, IPO_DISPDEGR, IPO_DISPTIME) { - macht+=1; - val *= 10; - } - } - else macht= ipomachtx; - - if (macht<=0) sprintf(str, "%.*f", 1-macht, val); - else sprintf(str, "%d", (int)floor(val + 0.375)); - - len= strlen(str); - if(dir=='h') x-= 4*len; - - if(dir=='v' && disptype==IPO_DISPDEGR) { - str[len]= 186; /* Degree symbol */ - str[len+1]= 0; - } - - ui_rasterpos_safe(x, y, 1.0); - BIF_DrawString(G.fonts, str, 0); -} - -static void step_to_grid(float *step, int *macht) -{ - float loga, rem; - - /* try to write step as a power of 10 */ - - loga= log10(*step); - *macht= (int)(loga); - - rem= loga- *macht; - rem= pow(10.0, rem); - - if(loga<0.0) { - if(rem < 0.2) rem= 0.2; - else if(rem < 0.5) rem= 0.5; - else rem= 1.0; - - *step= rem*pow(10.0, (float)*macht); - - // partial of a frame have no meaning - switch(curarea->spacetype) { - case SPACE_TIME: { - SpaceTime *stime= curarea->spacedata.first; - if(stime->flag & TIME_DRAWFRAMES) { - rem = 1.0; - *step = 1.0; - } - break; - } - case SPACE_SEQ: { - SpaceTime * sseq= curarea->spacedata.first; - if (sseq->flag & SEQ_DRAWFRAMES) { - rem = 1.0; - *step = 1.0; - } - } - default: - break; - } - - - - if(rem==1.0) (*macht)++; // prevents printing 1.0 2.0 3.0 etc - } - else { - if(rem < 2.0) rem= 2.0; - else if(rem < 5.0) rem= 5.0; - else rem= 10.0; - - *step= rem*pow(10.0, (float)*macht); - - (*macht)++; - if(rem==10.0) (*macht)++; // prevents printing 1.0 2.0 3.0 etc - } -} - -void calc_ipogrid() -{ - float space, pixels, secondiv=1.0; - int secondgrid= 0; - /* rule: gridstep is minimal IPOSTEP pixels */ - /* how large is IPOSTEP pixels? */ - - if(G.v2d==0) return; - - /* detect of we have seconds or frames, should become argument */ - - switch(curarea->spacetype) { - case SPACE_TIME: { - SpaceTime *stime= curarea->spacedata.first; - if(!(stime->flag & TIME_DRAWFRAMES)) { - secondgrid= 1; - secondiv= 0.01 * FPS; - } - break; - } - case SPACE_SEQ: { - SpaceSeq * sseq = curarea->spacedata.first; - if (!(sseq->flag & SEQ_DRAWFRAMES)) { - secondgrid = 1; - secondiv = 0.01 * FPS; - } - break; - } - case SPACE_ACTION: { - SpaceAction *saction = curarea->spacedata.first; - if (saction->flag & SACTION_DRAWTIME) { - secondgrid = 1; - secondiv = 0.01 * FPS; - } - break; - } - case SPACE_NLA: { - SpaceNla *snla = curarea->spacedata.first; - if (snla->flag & SNLA_DRAWTIME) { - secondgrid = 1; - secondiv = 0.01 * FPS; - } - break; - } - default: - break; - } - - space= G.v2d->cur.xmax - G.v2d->cur.xmin; - pixels= G.v2d->mask.xmax-G.v2d->mask.xmin; - - ipogrid_dx= IPOSTEP*space/(secondiv*pixels); - step_to_grid(&ipogrid_dx, &ipomachtx); - ipogrid_dx*= secondiv; - - if ELEM5(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME, SPACE_ACTION, SPACE_NLA) { - if(ipogrid_dx < 0.1) ipogrid_dx= 0.1; - ipomachtx-= 2; - if(ipomachtx<-2) ipomachtx= -2; - } - - space= (G.v2d->cur.ymax - G.v2d->cur.ymin); - pixels= curarea->winy; - ipogrid_dy= IPOSTEP*space/pixels; - step_to_grid(&ipogrid_dy, &ipomachty); - - if ELEM5(curarea->spacetype, SPACE_SEQ, SPACE_SOUND, SPACE_TIME, SPACE_ACTION, SPACE_NLA) { - if(ipogrid_dy < 1.0) ipogrid_dy= 1.0; - if(ipomachty<1) ipomachty= 1; - } - - ipogrid_startx= secondiv*(G.v2d->cur.xmin/secondiv - fmod(G.v2d->cur.xmin/secondiv, ipogrid_dx/secondiv)); - if(G.v2d->cur.xmin<0.0) ipogrid_startx-= ipogrid_dx; - - ipogrid_starty= (G.v2d->cur.ymin-fmod(G.v2d->cur.ymin, ipogrid_dy)); - if(G.v2d->cur.ymin<0.0) ipogrid_starty-= ipogrid_dy; - -} - -void draw_ipogrid(void) -{ - float vec1[2], vec2[2]; - int a, step; - - vec1[0]= vec2[0]= ipogrid_startx; - vec1[1]= ipogrid_starty; - vec2[1]= G.v2d->cur.ymax; - - step= (G.v2d->mask.xmax-G.v2d->mask.xmin+1)/IPOSTEP; - - BIF_ThemeColor(TH_GRID); - - for(a=0; aspacetype, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME); - else { - vec1[0]= ipogrid_startx; - vec1[1]= vec2[1]= ipogrid_starty; - vec2[0]= G.v2d->cur.xmax; - - step= (curarea->winy+1)/IPOSTEP; - - BIF_ThemeColor(TH_GRID); - for(a=0; a<=step; a++) { - glBegin(GL_LINE_STRIP); - glVertex2fv(vec1); glVertex2fv(vec2); - glEnd(); - vec2[1]= vec1[1]+= ipogrid_dy; - } - vec2[1]= vec1[1]-= 0.5*ipogrid_dy; - step++; - - if(curarea->spacetype==SPACE_IPO) { - BIF_ThemeColorShade(TH_GRID, 16); - for(a=0; aspacetype!=SPACE_ACTION && curarea->spacetype!=SPACE_NLA) - { /* Horizontal axis */ - vec1[0]= G.v2d->cur.xmin; - vec2[0]= G.v2d->cur.xmax; - vec1[1]= vec2[1]= 0.0; - glBegin(GL_LINE_STRIP); - - glVertex2fv(vec1); - glVertex2fv(vec2); - - glEnd(); - } - - /* Vertical axis */ - - vec1[1]= G.v2d->cur.ymin; - vec2[1]= G.v2d->cur.ymax; - vec1[0]= vec2[0]= 0.0; - glBegin(GL_LINE_STRIP); - glVertex2fv(vec1); glVertex2fv(vec2); - glEnd(); - - /* Limits box */ - if(curarea->spacetype==SPACE_IPO) { - if(G.sipo->blocktype==ID_SEQ) { - Sequence * last_seq = get_last_seq(); - float start = 0.0; - float end = 100.0; - - if (last_seq && - ((last_seq->flag & SEQ_IPO_FRAME_LOCKED) != 0)) { - start = last_seq->startdisp; - end = last_seq->enddisp; - } - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glRectf(start, 0.0, end, 1.0); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - else if(ELEM(G.sipo->blocktype, ID_CU, ID_CO)) { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glRectf(0.0, 1.0, G.v2d->cur.xmax, 1.0); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - } -} - -void areamouseco_to_ipoco(View2D *v2d, short *mval, float *x, float *y) -{ - float div, ofs; - - div= v2d->mask.xmax-v2d->mask.xmin; - ofs= v2d->mask.xmin; - - *x= v2d->cur.xmin+ (v2d->cur.xmax-v2d->cur.xmin)*(mval[0]-ofs)/div; - - div= v2d->mask.ymax-v2d->mask.ymin; - ofs= v2d->mask.ymin; - - *y= v2d->cur.ymin+ (v2d->cur.ymax-v2d->cur.ymin)*(mval[1]-ofs)/div; -} - -void ipoco_to_areaco(View2D *v2d, float *vec, short *mval) -{ - float x, y; - - mval[0]= IS_CLIPPED; - - x= (vec[0] - v2d->cur.xmin)/(v2d->cur.xmax-v2d->cur.xmin); - y= (vec[1] - v2d->cur.ymin)/(v2d->cur.ymax-v2d->cur.ymin); - - if(x>=0.0 && x<=1.0) { - if(y>=0.0 && y<=1.0) { - mval[0]= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin); - mval[1]= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin); - } - } -} - -void ipoco_to_areaco_noclip(View2D *v2d, float *vec, short *mval) -{ - float x, y; - - x= (vec[0] - v2d->cur.xmin)/(v2d->cur.xmax-v2d->cur.xmin); - y= (vec[1] - v2d->cur.ymin)/(v2d->cur.ymax-v2d->cur.ymin); - - x= v2d->mask.xmin + x*(v2d->mask.xmax-v2d->mask.xmin); - y= v2d->mask.ymin + y*(v2d->mask.ymax-v2d->mask.ymin); - - if(x<-32760) mval[0]= -32760; - else if(x>32760) mval[0]= 32760; - else mval[0]= x; - - if(y<-32760) mval[1]= -32760; - else if(y>32760) mval[1]= 32760; - else mval[1]= y; -} - -int in_ipo_buttons(void) -{ - short mval[2]; - - getmouseco_areawin(mval); - - if(mval[0]< G.v2d->mask.xmax) return 0; - else return 1; -} - -static View2D *spacelink_get_view2d(SpaceLink *sl) -{ - if(sl->spacetype==SPACE_IPO) - return &((SpaceIpo *)sl)->v2d; - else if(sl->spacetype==SPACE_SOUND) - return &((SpaceSound *)sl)->v2d; - if(sl->spacetype==SPACE_ACTION) - return &((SpaceAction *)sl)->v2d; - if(sl->spacetype==SPACE_NLA) - return &((SpaceNla *)sl)->v2d; - if(sl->spacetype==SPACE_TIME) - return &((SpaceTime *)sl)->v2d; - if(sl->spacetype==SPACE_SEQ) - return &((SpaceSeq *)sl)->v2d; - return NULL; -} - -/* copies changes in this view from or to all 2d views with lock option open */ -/* do not call this inside of drawing routines, to prevent eternal loops */ -void view2d_do_locks(ScrArea *cursa, int flag) -{ - ScrArea *sa; - View2D *v2d, *curv2d; - SpaceLink *sl; - - curv2d= spacelink_get_view2d(cursa->spacedata.first); - if(curv2d==NULL) return; - if((curv2d->flag & V2D_VIEWLOCK)==0) return; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa!=cursa) { - for(sl= sa->spacedata.first; sl; sl= sl->next) { - - v2d= spacelink_get_view2d(sl); - if(v2d) { - if(v2d->flag & V2D_VIEWLOCK) { - if(flag & V2D_LOCK_COPY) { - v2d->cur.xmin= curv2d->cur.xmin; - v2d->cur.xmax= curv2d->cur.xmax; - } - else { - curv2d->cur.xmin= v2d->cur.xmin; - curv2d->cur.xmax= v2d->cur.xmax; - scrarea_queue_winredraw(sa); - } - - if(flag & V2D_LOCK_REDRAW) { - if(sl == sa->spacedata.first) - scrarea_do_windraw(sa); - } - else - scrarea_queue_winredraw(sa); - } - } - } - } - } -} - -/* event based, note: curarea is in here... */ -void view2d_zoom(View2D *v2d, float factor, int winx, int winy) -{ - float dx= factor*(v2d->cur.xmax-v2d->cur.xmin); - float dy= factor*(v2d->cur.ymax-v2d->cur.ymin); - if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0) { - v2d->cur.xmin+= dx; - v2d->cur.xmax-= dx; - } - if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0) { - v2d->cur.ymin+= dy; - v2d->cur.ymax-= dy; - } - test_view2d(v2d, winx, winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); -} - - -void test_view2d(View2D *v2d, int winx, int winy) -{ - /* cur is not allowed to be larger than max, smaller than min, or outside of tot */ - rctf *cur, *tot; - float dx, dy, temp, fac, zoom; - - /* correct winx for scroll */ - if(v2d->scroll & L_SCROLL) winx-= SCROLLB; - if(v2d->scroll & B_SCROLL) winy-= SCROLLH; - if(v2d->scroll & B_SCROLLO) winy-= SCROLLH; /* B_SCROLL and B_SCROLLO are basically same thing */ - - /* header completely closed window */ - if(winy<=0) return; - - cur= &v2d->cur; - tot= &v2d->tot; - - dx= cur->xmax-cur->xmin; - dy= cur->ymax-cur->ymin; - - /* Reevan's test */ - if (v2d->keepzoom & V2D_LOCKZOOM_Y) - v2d->cur.ymax=v2d->cur.ymin+((float)winy); - - if (v2d->keepzoom & V2D_LOCKZOOM_X) - v2d->cur.xmax=v2d->cur.xmin+((float)winx); - - if(v2d->keepzoom) { - - zoom= ((float)winx)/dx; - - if(zoomminzoom || zoom>v2d->maxzoom) { - if(zoomminzoom) fac= zoom/v2d->minzoom; - else fac= zoom/v2d->maxzoom; - - dx*= fac; - temp= 0.5*(cur->xmax+cur->xmin); - - cur->xmin= temp-0.5*dx; - cur->xmax= temp+0.5*dx; - } - - zoom= ((float)winy)/dy; - - if(zoomminzoom || zoom>v2d->maxzoom) { - if(zoomminzoom) fac= zoom/v2d->minzoom; - else fac= zoom/v2d->maxzoom; - - dy*= fac; - temp= 0.5*(cur->ymax+cur->ymin); - cur->ymin= temp-0.5*dy; - cur->ymax= temp+0.5*dy; - } - } - else { - if(dxmin[0]) { - dx= G.v2d->min[0]; - temp= 0.5*(cur->xmax+cur->xmin); - cur->xmin= temp-0.5*dx; - cur->xmax= temp+0.5*dx; - } - else if(dx>G.v2d->max[0]) { - dx= G.v2d->max[0]; - temp= 0.5*(cur->xmax+cur->xmin); - cur->xmin= temp-0.5*dx; - cur->xmax= temp+0.5*dx; - } - - if(dymin[1]) { - dy= G.v2d->min[1]; - temp= 0.5*(cur->ymax+cur->ymin); - cur->ymin= temp-0.5*dy; - cur->ymax= temp+0.5*dy; - } - else if(dy>G.v2d->max[1]) { - dy= G.v2d->max[1]; - temp= 0.5*(cur->ymax+cur->ymin); - cur->ymin= temp-0.5*dy; - cur->ymax= temp+0.5*dy; - } - } - - if(v2d->keepaspect) { - short do_x=0, do_y=0; - - /* when a window edge changes, the aspect ratio can't be used to - find which is the best new 'cur' rect. thats why it stores 'old' */ - if(winx!=v2d->oldwinx) do_x= 1; - if(winy!=v2d->oldwiny) do_y= 1; - - dx= (cur->ymax-cur->ymin)/(cur->xmax-cur->xmin); - dy= ((float)winy)/((float)winx); - - if(do_x==do_y) { // both sizes change, ctrl+uparrow - if(do_x==1 && do_y==1) { - if( ABS(winx-v2d->oldwinx)>ABS(winy-v2d->oldwiny)) do_y= 0; - else do_x= 0; - } - else if( dy > 1.0) do_x= 0; else do_x= 1; - } - - if( do_x ) { - if (v2d->keeptot == 2 && winx < v2d->oldwinx) { - /* This is a special hack for the outliner, to ensure that the - * outliner contents will not eventually get pushed out of view - * when shrinking the view. - */ - cur->xmax -= cur->xmin; - cur->xmin= 0.0f; - } - else { - /* portrait window: correct for x */ - dx= cur->ymax-cur->ymin; - temp= (cur->xmax+cur->xmin); - - cur->xmin= temp/2.0 - 0.5*dx/dy; - cur->xmax= temp/2.0 + 0.5*dx/dy; - } - } - else { - dx= cur->xmax-cur->xmin; - temp= (cur->ymax+cur->ymin); - - cur->ymin= temp/2.0 - 0.5*dy*dx; - cur->ymax= temp/2.0 + 0.5*dy*dx; - } - - v2d->oldwinx= winx; - v2d->oldwiny= winy; - } - - if(v2d->keeptot) { - dx= cur->xmax-cur->xmin; - dy= cur->ymax-cur->ymin; - - if(dx > tot->xmax-tot->xmin) { - if(v2d->keepzoom==0) { - if(cur->xminxmin) cur->xmin= tot->xmin; - if(cur->xmax>tot->xmax) cur->xmax= tot->xmax; - } - else { - if(cur->xmax < tot->xmax) { - dx= tot->xmax-cur->xmax; - cur->xmin+= dx; - cur->xmax+= dx; - } - else if(cur->xmin > tot->xmin) { - dx= cur->xmin-tot->xmin; - cur->xmin-= dx; - cur->xmax-= dx; - } - } - } - else { - if(cur->xmin < tot->xmin) { - dx= tot->xmin-cur->xmin; - cur->xmin+= dx; - cur->xmax+= dx; - } - else if((v2d->keeptot!=2) && (cur->xmax > tot->xmax)) { - /* keeptot==2 is a special case for the outliner. see space.c, init_v2d_oops for details */ - dx= cur->xmax-tot->xmax; - cur->xmin-= dx; - cur->xmax-= dx; - } - } - - if(dy > tot->ymax-tot->ymin) { - if(v2d->keepzoom==0) { - if(cur->yminymin) cur->ymin= tot->ymin; - if(cur->ymax>tot->ymax) cur->ymax= tot->ymax; - } - else { - if(cur->ymax < tot->ymax) { - dy= tot->ymax-cur->ymax; - cur->ymin+= dy; - cur->ymax+= dy; - } - else if(cur->ymin > tot->ymin) { - dy= cur->ymin-tot->ymin; - cur->ymin-= dy; - cur->ymax-= dy; - } - } - } - else { - if(cur->ymin < tot->ymin) { - dy= tot->ymin-cur->ymin; - cur->ymin+= dy; - cur->ymax+= dy; - } - else if(cur->ymax > tot->ymax) { - dy= cur->ymax-tot->ymax; - cur->ymin-= dy; - cur->ymax-= dy; - } - } - } -} - -#define IPOBUTX 70 -static int calc_ipobuttonswidth(ScrArea *sa) -{ - SpaceIpo *sipo= sa->spacedata.first; - EditIpo *ei; - int ipowidth = IPOBUTX; - int a; - float textwidth = 0; - - /* default width when no space ipo or no channels */ - if (sipo == NULL) return IPOBUTX; - if ((sipo->totipo==0) || (sipo->editipo==NULL)) return IPOBUTX; - - ei= sipo->editipo; - - for(a=0; atotipo; a++, ei++) { - textwidth = BIF_GetStringWidth(G.font, ei->name, 0); - if (textwidth + 18 > ipowidth) - ipowidth = textwidth + 18; - } - return ipowidth; - -} - -void calc_scrollrcts(ScrArea *sa, View2D *v2d, int winx, int winy) -{ - v2d->mask.xmin= v2d->mask.ymin= 0; - v2d->mask.xmax= winx; - v2d->mask.ymax= winy; - - if(sa->spacetype==SPACE_ACTION) { - if(sa->winx > ACTWIDTH+50) { - v2d->mask.xmin+= ACTWIDTH; - v2d->hor.xmin+=ACTWIDTH; - } - } - else if(sa->spacetype==SPACE_NLA){ - if(sa->winx > NLAWIDTH+50) { - v2d->mask.xmin+= NLAWIDTH; - v2d->hor.xmin+=NLAWIDTH; - } - } - else if(sa->spacetype==SPACE_IPO) { - int ipobutx = calc_ipobuttonswidth(sa); - - v2d->mask.xmax-= ipobutx; - - if(v2d->mask.xmaxmask.xmax= winx; - } - - if(v2d->scroll) { - if(v2d->scroll & L_SCROLL) { - v2d->vert= v2d->mask; - v2d->vert.xmax= SCROLLB; - v2d->mask.xmin= SCROLLB; - } - else if(v2d->scroll & R_SCROLL) { - v2d->vert= v2d->mask; - v2d->vert.xmin= v2d->vert.xmax-SCROLLB; - v2d->mask.xmax= v2d->vert.xmin; - } - - if((v2d->scroll & B_SCROLL) || (v2d->scroll & B_SCROLLO)) { - v2d->hor= v2d->mask; - v2d->hor.ymax= SCROLLH; - v2d->mask.ymin= SCROLLH; - } - else if(v2d->scroll & T_SCROLL) { - v2d->hor= v2d->mask; - v2d->hor.ymin= v2d->hor.ymax-SCROLLH; - v2d->mask.ymax= v2d->hor.ymin; - } - } -} - - /* draws a line in left vertical scrollbar at the given height */ -static void draw_solution_line(View2D *v2d, float h) -{ - float vec[2]; - short mval[2]; - - vec[0]= v2d->cur.xmin; - vec[1]= h; - ipoco_to_areaco(v2d, vec, mval); - if(mval[0]!=IS_CLIPPED) { - glBegin(GL_LINES); - glVertex2f(v2d->vert.xmin, mval[1]); - glVertex2f(v2d->vert.xmax, mval[1]); - glEnd(); - } -} - -static void draw_solution(SpaceIpo *sipo) -{ - View2D *v2d= &sipo->v2d; - EditIpo *ei; - int a; - - if (!(v2d->scroll & VERT_SCROLL)) return; - - ei= sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - cpack(ei->col); - - /* DISPBITS ipos have 'multiple' values. */ - if(ei->disptype==IPO_DISPBITS) { - int b, val= ei->icu->curval; - - for (b=0; b<31; b++) - if (val & (1<icu->curval); - } - } - } -} - -/* used for drawing timeline */ -void draw_view2d_numbers_horiz(int drawframes) -{ - float fac, fac2, dfac, val; - - /* the numbers: convert ipogrid_startx and -dx to scroll coordinates */ - - fac= (ipogrid_startx- G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - fac= G.v2d->mask.xmin+fac*(G.v2d->mask.xmax-G.v2d->mask.xmin); - - dfac= (ipogrid_dx)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - dfac= dfac*(G.v2d->mask.xmax-G.v2d->mask.xmin); - - BIF_ThemeColor(TH_TEXT); - val= ipogrid_startx; - while(fac < G.v2d->mask.xmax) { - - if(drawframes) { - ipomachtx= 1; - scroll_prstr(fac, 2.0+(float)(G.v2d->mask.ymin), val, 'h', 0); - } - else { - fac2= val/FPS; - scroll_prstr(fac, 2.0+(float)(G.v2d->mask.ymin), fac2, 'h', 0); - } - - fac+= dfac; - val+= ipogrid_dx; - } -} - - -void drawscroll(int disptype) -{ - rcti vert, hor; - float fac, dfac, val, fac2, tim; - int darker, dark, light, lighter; - - vert= (G.v2d->vert); - hor= (G.v2d->hor); - - darker= -40; - dark= 0; - light= 20; - lighter= 50; - - if((G.v2d->scroll & HOR_SCROLL) || (G.v2d->scroll & HOR_SCROLLO)) { - - BIF_ThemeColorShade(TH_SHADE1, light); - glRecti(hor.xmin, hor.ymin, hor.xmax, hor.ymax); - - /* slider */ - fac= (G.v2d->cur.xmin- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin); - if(fac<0.0) fac= 0.0; - horxmin= hor.xmin+fac*(hor.xmax-hor.xmin); - - fac= (G.v2d->cur.xmax- G.v2d->tot.xmin)/(G.v2d->tot.xmax-G.v2d->tot.xmin); - if(fac>1.0) fac= 1.0; - horxmax= hor.xmin+fac*(hor.xmax-hor.xmin); - - if(horxmin > horxmax) horxmin= horxmax; - - BIF_ThemeColorShade(TH_SHADE1, dark); - glRecti(horxmin, hor.ymin, horxmax, hor.ymax); - - /* decoration bright line */ - BIF_ThemeColorShade(TH_SHADE1, lighter); - sdrawline(hor.xmin, hor.ymax, hor.xmax, hor.ymax); - - /* the numbers: convert ipogrid_startx and -dx to scroll coordinates */ - fac= (ipogrid_startx- G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - fac= hor.xmin+fac*(hor.xmax-hor.xmin); - - dfac= (ipogrid_dx)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - dfac= dfac*(hor.xmax-hor.xmin); - - BIF_ThemeColor(TH_TEXT); - val= ipogrid_startx; - while(fac < hor.xmax) { - - if(curarea->spacetype==SPACE_OOPS) { - /* Under no circumstances may the outliner/oops display numbers on its scrollbar - * Unfortunately, versions of Blender without this patch will hang on loading files with - * horizontally scrollable Outliners. - */ - break; - } - else if(curarea->spacetype==SPACE_SEQ) { - SpaceSeq * sseq = curarea->spacedata.first; - if (sseq->flag & SEQ_DRAWFRAMES) { - ipomachtx = 1; - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } else { - fac2= val/FPS; - tim= floor(fac2); - fac2= fac2-tim; - scroll_prstr(fac, 3.0+(float)(hor.ymin), tim+FPS*fac2/100.0, 'h', disptype); - } - } - else if (curarea->spacetype==SPACE_SOUND) { - SpaceSound *ssound= curarea->spacedata.first; - - if(ssound->flag & SND_DRAWFRAMES) { - ipomachtx= 1; - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - else { - fac2= val/FPS; - scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype); - } - } - else if (curarea->spacetype==SPACE_TIME) { - SpaceTime *stime= curarea->spacedata.first; - - if(stime->flag & TIME_DRAWFRAMES) { - ipomachtx= 1; - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - else { - fac2= val/FPS; - scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype); - } - } - else if (curarea->spacetype==SPACE_IPO) { - EditIpo *ei= get_active_editipo(); - - if(ei && ei->icu && ei->icu->driver) { - int adrcode= ei->icu->driver->adrcode; - - if(adrcode==OB_ROT_X || adrcode==OB_ROT_Y || adrcode==OB_ROT_Z) { - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'v', IPO_DISPDEGR); - } - else - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - else - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - else if (curarea->spacetype==SPACE_ACTION) { - SpaceAction *saction= curarea->spacedata.first; - - if (saction->flag & SACTION_DRAWTIME) { - fac2= val/FPS; - scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype); - } - else { - ipomachtx= 1; - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - } - else if (curarea->spacetype==SPACE_NLA) { - SpaceNla *snla= curarea->spacedata.first; - - if (snla->flag & SNLA_DRAWTIME) { - fac2= val/FPS; - scroll_prstr(fac, 3.0+(float)(hor.ymin), fac2, 'h', disptype); - } - else { - ipomachtx= 1; - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - } - else { - scroll_prstr(fac, 3.0+(float)(hor.ymin), val, 'h', disptype); - } - - fac+= dfac; - val+= ipogrid_dx; - } - } - - if(G.v2d->scroll & VERT_SCROLL) { - BIF_ThemeColorShade(TH_SHADE1, light); - glRecti(vert.xmin, vert.ymin, vert.xmax, vert.ymax); - - /* slider */ - fac= (G.v2d->cur.ymin- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin); - if(fac<0.0) fac= 0.0; - vertymin= vert.ymin+fac*(vert.ymax-vert.ymin); - - fac= (G.v2d->cur.ymax- G.v2d->tot.ymin)/(G.v2d->tot.ymax-G.v2d->tot.ymin); - if(fac>1.0) fac= 1.0; - vertymax= vert.ymin+fac*(vert.ymax-vert.ymin); - - if(vertymin > vertymax) vertymin= vertymax; - - BIF_ThemeColorShade(TH_SHADE1, dark); - glRecti(vert.xmin, vertymin, vert.xmax, vertymax); - - /* decoration black line */ - BIF_ThemeColorShade(TH_SHADE1, darker); - if(G.v2d->scroll & HOR_SCROLL) - sdrawline(vert.xmax, vert.ymin+SCROLLH, vert.xmax, vert.ymax); - else - sdrawline(vert.xmax, vert.ymin, vert.xmax, vert.ymax); - - /* the numbers: convert ipogrid_starty and -dy to scroll coordinates */ - fac= (ipogrid_starty- G.v2d->cur.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - fac= vert.ymin+SCROLLH+fac*(vert.ymax-vert.ymin-SCROLLH); - - dfac= (ipogrid_dy)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - dfac= dfac*(vert.ymax-vert.ymin-SCROLLH); - - if(curarea->spacetype==SPACE_OOPS); - else if(curarea->spacetype==SPACE_SEQ) { - BIF_ThemeColor(TH_TEXT); - val= ipogrid_starty; - fac+= 0.5*dfac; - while(fac < vert.ymax) { - scroll_prstr((float)(vert.xmax)-14.0, fac, val, 'v', disptype); - fac+= dfac; - val+= ipogrid_dy; - } - } - else if (curarea->spacetype==SPACE_NLA){ - } - else if (curarea->spacetype==SPACE_ACTION){ - /* No digits on vertical axis in action mode! */ - } - else { - BIF_ThemeColor(TH_TEXT); - val= ipogrid_starty; - while(fac < vert.ymax) { - scroll_prstr((float)(vert.xmax)-14.0, fac, val, 'v', disptype); - fac+= dfac; - val+= ipogrid_dy; - } - } - } -} - -static void draw_ipobuts(SpaceIpo *sipo) -{ - ScrArea *area= sipo->area; - View2D *v2d= &sipo->v2d; - Object *ob= OBACT; - uiBlock *block; - uiBut *but; - EditIpo *ei; - int a, y, sel, tot, ipobutx; - char naam[20]; - - if(area->winx< calc_ipobuttonswidth(area)) return; - - if(sipo->butofs) { - tot= 30+IPOBUTY*sipo->totipo; - if(totwiny) sipo->butofs= 0; - } - - ipobutx = calc_ipobuttonswidth(area); - - BIF_ThemeColor(TH_SHADE2); - glRects(v2d->mask.xmax, 0, area->winx, area->winy); - - cpack(0x0); - sdrawline(v2d->mask.xmax, 0, v2d->mask.xmax, area->winy); - - if(sipo->totipo==0) return; - if(sipo->editipo==0) return; - - sprintf(naam, "ipowin %d", area->win); - block= uiNewBlock(&area->uiblocks, naam, UI_EMBOSSN, UI_HELV, area->win); - - ei= sipo->editipo; - y= area->winy-30+sipo->butofs; - - if(ob && sipo->blocktype==ID_KE) { - int icon; - if(ob->shapeflag & OB_SHAPE_LOCK) icon= ICON_PIN_HLT; else icon= ICON_PIN_DEHLT; - uiDefIconButBitS(block, TOG, OB_SHAPE_LOCK, B_SETKEY, icon, - v2d->mask.xmax+18,y,25,20, &ob->shapeflag, 0, 0, 0, 0, "Always show the current Shape for this Object"); - y-= IPOBUTY; - } - - for(a=0; atotipo; a++, ei++, y-=IPOBUTY) { - // this button defines visiblity, bit zero of flag (IPO_VISIBLE) - but= uiDefButBitS(block, TOG, IPO_VISIBLE, a+1, ei->name, v2d->mask.xmax+18, y, ipobutx-15, IPOBUTY-1, &(ei->flag), 0, 0, 0, 0, ""); - // no hilite, its not visible, but most of all the winmatrix is not correct later on... - uiButSetFlag(but, UI_TEXT_LEFT|UI_NO_HILITE); - - // this fake button defines selection of curves - if(ei->icu) { - cpack(ei->col); - - glRects(v2d->mask.xmax+8, y+2, v2d->mask.xmax+15, y+IPOBUTY-2); - sel= ei->flag & (IPO_SELECT + IPO_EDIT); - - uiEmboss((float)(v2d->mask.xmax+8), (float)(y+2), (float)(v2d->mask.xmax+15), (float)(y+IPOBUTY-2), sel); - - if(ei->icu->driver) { - cpack(0x0); - fdrawbox((float)v2d->mask.xmax+11, (float)y+8, (float)v2d->mask.xmax+12.5, (float)y+9.5); - } - } - - if(ei->flag & IPO_ACTIVE) { - cpack(0x0); - fdrawbox(v2d->mask.xmax+7, y+1, v2d->mask.xmax+16, y+IPOBUTY-1); - } - } - uiDrawBlock(block); -} - -static void draw_ipovertices(int sel) -{ - EditIpo *ei; - BezTriple *bezt; - float v1[2]; - int val, ok, nr, a, b; - - if(G.f & G_PICKSEL) return; - - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - ei= G.sipo->editipo; - for(nr=0; nrtotipo; nr++, ei++) { - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - - if(G.sipo->showkey) { - if(sel) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - } else if(ei->flag & IPO_EDIT) { - if(sel) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - } else { - if(sel) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - - val= (ei->icu->flag & IPO_SELECT)!=0; - if(sel != val) continue; - } - - /* We can't change the color in the middle of - * GL_POINTS because then Blender will segfault - * on TNT2 / Linux with NVidia's drivers - * (at least up to ver. 4349) */ - - a= ei->icu->totvert; - bezt= ei->icu->bezt; - bglBegin(GL_POINTS); - - while(a--) { - - /* IPO_DISPBITS is used for displaying layer ipo types as well as modes */ - if(ei->disptype==IPO_DISPBITS) { - /*if (G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax) {*/ - ok= 0; - - if(ei->flag & IPO_EDIT) { - if( (bezt->f2 & SELECT) == sel ) ok= 1; - } - else ok= 1; - - if(ok) { - val= bezt->vec[1][1]; - b= 0; - v1[0]= bezt->vec[1][0]; - - while(b<31) { - if(val & (1<flag & IPO_EDIT) { - if(ei->icu->ipo==IPO_BEZ) { - /* Draw the editmode hendels for a bezier curve */ - if( (bezt->f1 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[0][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[0]); - - if( (bezt->f3 & SELECT) == sel)/* && G.v2d->cur.xmin < bezt->vec[2][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[2]); - - } - - if( (bezt->f2 & SELECT) == sel) /* && G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[1]); - - } - else { - /* draw only if in bounds */ - /*if (G.v2d->cur.xmin < bezt->vec[1][0] < G.v2d->cur.xmax)*/ - bglVertex3fv(bezt->vec[1]); - - } - } - - bezt++; - } - bglEnd(); - } - } - - glPointSize(1.0); -} - -static void draw_ipohandles(int sel) -{ - extern unsigned int nurbcol[]; - EditIpo *ei; - BezTriple *bezt; - float *fp; - unsigned int *col; - int a, b; - - if(sel) col= nurbcol+4; - else col= nurbcol; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if ISPOIN4(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu, disptype!=IPO_DISPBITS) { - if(ei->icu->ipo==IPO_BEZ) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - - if( (bezt->f2 & SELECT)==sel) { - fp= bezt->vec[0]; - cpack(col[bezt->h1]); - - glBegin(GL_LINE_STRIP); - glVertex2fv(fp); glVertex2fv(fp+3); - glEnd(); - cpack(col[bezt->h2]); - - glBegin(GL_LINE_STRIP); - glVertex2fv(fp+3); glVertex2fv(fp+6); - glEnd(); - } - else if( (bezt->f1 & 1)==sel) { - fp= bezt->vec[0]; - cpack(col[bezt->h1]); - - glBegin(GL_LINE_STRIP); - glVertex2fv(fp); glVertex2fv(fp+3); - glEnd(); - } - else if( (bezt->f3 & SELECT)==sel) { - fp= bezt->vec[1]; - cpack(col[bezt->h2]); - - glBegin(GL_LINE_STRIP); - glVertex2fv(fp); glVertex2fv(fp+3); - glEnd(); - } - - bezt++; - } - } - } - } -} - -int pickselcode; - -static void init_pickselcode(void) -{ - pickselcode= 1; -} - -static void draw_ipocurves(int sel) -{ - EditIpo *ei; - IpoCurve *icu; - BezTriple *bezt, *prevbezt; - float *fp, fac, data[120], v1[2], v2[2], v3[2], v4[2]; - float cycdx=0, cycdy=0, cycxofs, cycyofs; - int a, b, resol, cycount, val, nr; - - - ei= G.sipo->editipo; - for(nr=0; nrtotipo; nr++, ei++) { - if ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt) { - - if(G.f & G_PICKSEL) { - glLoadName(pickselcode++); - val= 1; - } - else { - val= (ei->flag & (IPO_SELECT+IPO_EDIT))!=0; - val= (val==sel); - } - - if(val) { - - cycyofs= cycxofs= 0.0; - cycount= 1; - - icu= ei->icu; - - /* curve */ - if(G.sipo->showkey) BIF_ThemeColor(TH_TEXT); - else cpack(ei->col); - - /* cyclic */ - if(icu->extrap & IPO_CYCL) { - cycdx= (icu->bezt+icu->totvert-1)->vec[1][0] - icu->bezt->vec[1][0]; - cycdy= (icu->bezt+icu->totvert-1)->vec[1][1] - icu->bezt->vec[1][1]; - if(cycdx>0.01) { - - while(icu->bezt->vec[1][0]+cycxofs > G.v2d->cur.xmin) { - cycxofs-= cycdx; - if(icu->extrap & IPO_DIR) cycyofs-= cycdy; - cycount++; - } - bezt= icu->bezt+(icu->totvert-1); - fac= 0.0; - while(bezt->vec[1][0]+fac < G.v2d->cur.xmax) { - cycount++; - fac+= cycdx; - } - } - } - - while(cycount--) { - - if(ei->disptype==IPO_DISPBITS) { - - /* lines */ - cpack(ei->col); - bezt= icu->bezt; - a= icu->totvert; - - while(a--) { - val= bezt->vec[1][1]; - b= 0; - - while(b<31) { - if(val & (1<extrap & IPO_CYCL) ; - else if(a==icu->totvert-1) { - v1[0]= G.v2d->cur.xmin+cycxofs; - glVertex2fv(v1); - } - v1[0]= bezt->vec[1][0]+cycxofs; - glVertex2fv(v1); - - if(a) v1[0]= (bezt+1)->vec[1][0]+cycxofs; - else if(icu->extrap & IPO_CYCL) ; - else v1[0]= G.v2d->cur.xmax+cycxofs; - - glVertex2fv(v1); - glEnd(); - } - b++; - } - bezt++; - } - - } - else { - - b= icu->totvert-1; - prevbezt= icu->bezt; - bezt= prevbezt+1; - - glBegin(GL_LINE_STRIP); - - /* extrapolate to left? */ - if( (icu->extrap & IPO_CYCL)==0) { - if(prevbezt->vec[1][0] > G.v2d->cur.xmin) { - v1[0]= G.v2d->cur.xmin; - if(icu->extrap==IPO_HORIZ || icu->ipo==IPO_CONST) v1[1]= prevbezt->vec[1][1]; - else { - fac= (prevbezt->vec[0][0]-prevbezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]); - if(fac!=0.0) fac= 1.0/fac; - v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[0][1]-prevbezt->vec[1][1]); - } - glVertex2fv(v1); - } - } - - if(b==0) { - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - } - - while(b--) { - if(icu->ipo==IPO_CONST) { - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - v1[0]= bezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - } - else if(icu->ipo==IPO_LIN) { - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - } - else { - /* resol not depending on horizontal resolution anymore, drivers for example... */ - if(icu->driver) resol= 32; - else resol= 3.0*sqrt(bezt->vec[1][0] - prevbezt->vec[1][0]); - - if(resol<2) { - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - } - else { - if(resol>32) resol= 32; - - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - v2[0]= prevbezt->vec[2][0]+cycxofs; - v2[1]= prevbezt->vec[2][1]+cycyofs; - - v3[0]= bezt->vec[0][0]+cycxofs; - v3[1]= bezt->vec[0][1]+cycyofs; - v4[0]= bezt->vec[1][0]+cycxofs; - v4[1]= bezt->vec[1][1]+cycyofs; - - correct_bezpart(v1, v2, v3, v4); - - forward_diff_bezier(v1[0], v2[0], v3[0], v4[0], data, resol, 3); - forward_diff_bezier(v1[1], v2[1], v3[1], v4[1], data+1, resol, 3); - - fp= data; - while(resol--) { - glVertex2fv(fp); - fp+= 3; - } - } - } - prevbezt= bezt; - bezt++; - - /* last point? */ - if(b==0) { - v1[0]= prevbezt->vec[1][0]+cycxofs; - v1[1]= prevbezt->vec[1][1]+cycyofs; - glVertex2fv(v1); - } - } - - /* extrapolate to right? */ - if( (icu->extrap & IPO_CYCL)==0) { - if(prevbezt->vec[1][0] < G.v2d->cur.xmax) { - v1[0]= G.v2d->cur.xmax; - if(icu->extrap==IPO_HORIZ || icu->ipo==IPO_CONST) v1[1]= prevbezt->vec[1][1]; - else { - fac= (prevbezt->vec[2][0]-prevbezt->vec[1][0])/(prevbezt->vec[1][0]-v1[0]); - if(fac!=0.0) fac= 1.0/fac; - v1[1]= prevbezt->vec[1][1]-fac*(prevbezt->vec[2][1]-prevbezt->vec[1][1]); - } - glVertex2fv(v1); - } - } - - glEnd(); - - } - cycxofs+= cycdx; - if(icu->extrap & IPO_DIR) cycyofs+= cycdy; - } - - /* line that indicates the end of a speed curve */ - if(G.sipo->blocktype==ID_CU && icu->adrcode==CU_SPEED) { - b= icu->totvert-1; - if(b) { - glColor3ub(0, 0, 0); - bezt= icu->bezt+b; - glBegin(GL_LINES); - glVertex2f(bezt->vec[1][0], 0.0); - glVertex2f(bezt->vec[1][0], bezt->vec[1][1]); - glEnd(); - } - } - } - } - } -} - -static int get_ipo_cfra_from_cfra(SpaceIpo * sipo, int cfra) -{ - if (sipo->blocktype==ID_SEQ) { - Sequence * seq = (Sequence*) sipo->from; - - if (!seq) { - return cfra; - } - - if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - return cfra; - } else { - float ctime= frame_to_float(cfra - seq->startdisp); - float div= (seq->enddisp - seq->startdisp)/100.0f; - - if(div == 0.0) { - return 0; - } else { - return ctime / div; - } - } - } else { - return cfra; - } -} - -static void draw_cfra(SpaceIpo *sipo) -{ - View2D *v2d= &sipo->v2d; - Object *ob; - float vec[2]; - - vec[0] = get_ipo_cfra_from_cfra(sipo, G.scene->r.cfra); - vec[0]*= G.scene->r.framelen; - - vec[1]= v2d->cur.ymin; - BIF_ThemeColor(TH_CFRAME); - glLineWidth(2.0); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); - - if(sipo->blocktype==ID_OB) { - ob= (G.scene->basact) ? (G.scene->basact->object) : 0; - if (ob && (ob->sf!=0.0) && (ob->ipoflag & OB_OFFS_OB) ) { - vec[0]-= ob->sf; - - BIF_ThemeColorShade(TH_HILITE, -30); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymin; - glVertex2fv(vec); - glEnd(); - } - } - - glLineWidth(1.0); -} - -static void draw_ipokey(SpaceIpo *sipo) -{ - IpoKey *ik; - - glBegin(GL_LINES); - for (ik= sipo->ipokey.first; ik; ik= ik->next) { - if(ik->flag & 1) glColor3ub(0xFF, 0xFF, 0x99); - else glColor3ub(0xAA, 0xAA, 0x55); - - glVertex2f(ik->val, G.v2d->cur.ymin); - glVertex2f(ik->val, G.v2d->cur.ymax); - } - glEnd(); -} - -static void draw_key(SpaceIpo *sipo, int visible) -{ - View2D *v2d= &sipo->v2d; - Key *key; - KeyBlock *kb, *act=NULL; - Object *ob= OBACT; - unsigned int col; - int index; - - key= ob_get_key((Object *)sipo->from); - if(key==NULL) - return; - - if(key->type== KEY_RELATIVE) if(visible==0) return; - - for(index=1, kb= key->block.first; kb; kb= kb->next, index++) { - if(kb->type==KEY_LINEAR) setlinestyle(2); - else if(kb->type==KEY_BSPLINE) setlinestyle(4); - else setlinestyle(0); - - if(kb==key->refkey) col= 0x22FFFF; - else col= 0xFFFF00; - - if(ob->shapenr!=index) col-= 0x225500; - else act= kb; - - cpack(col); - - glBegin(GL_LINE_STRIP); - glVertex2f(v2d->cur.xmin, kb->pos); - glVertex2f(v2d->cur.xmax, kb->pos); - glEnd(); - - } - - if(act) { - if(act->type==KEY_LINEAR) setlinestyle(2); - else if(act->type==KEY_BSPLINE) setlinestyle(4); - else setlinestyle(0); - - if(act==key->refkey) cpack(0x22FFFF); - else cpack(0xFFFF00); - - glBegin(GL_LINE_STRIP); - glVertex2f(v2d->cur.xmin, act->pos); - glVertex2f(v2d->cur.xmax, act->pos); - glEnd(); - } - - setlinestyle(0); -} - -/* ************************** buttons *********************** */ - - -#define B_SETSPEED 3401 -#define B_MUL_IPO 3402 -#define B_TRANS_IPO 3403 -#define B_IPO_NONE 3404 -#define B_IPO_DRIVER 3405 -#define B_IPO_REDR 3406 -#define B_IPO_DEPCHANGE 3407 -#define B_IPO_DRIVERTYPE 3408 - -static float hspeed= 0; - -static void boundbox_ipo_curves(SpaceIpo *si) -{ - EditIpo *ei; - Key *key; - KeyBlock *kb; - int a, first= 1; - - ei= si->editipo; - if(ei==0) - return; - - for(a=0; atotipo; a++, ei++) { - - if(ei->icu) { - if(ei->flag & IPO_VISIBLE) { - - boundbox_ipocurve(ei->icu, 0); - if(first) { - si->v2d.tot= ei->icu->totrct; - first= 0; - } - else BLI_union_rctf(&(si->v2d.tot), &(ei->icu->totrct)); - } - } - } - /* keylines? */ - if(si->blocktype==ID_KE) { - key= ob_get_key((Object *)si->from); - if(key && key->block.first) { - kb= key->block.first; - if(kb->pos < si->v2d.tot.ymin) si->v2d.tot.ymin= kb->pos; - kb= key->block.last; - if(kb->pos > si->v2d.tot.ymax) si->v2d.tot.ymax= kb->pos; - } - } - si->tot= si->v2d.tot; -} - - -/* is used for both read and write... */ -static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float max) -{ - Object *ob= OBACT; - EditIpo *ei; - BezTriple *bezt; - float median[3]; - int a, b, tot, iskey=0; - - median[0]= median[1]= median[2]= 0.0; - tot= 0; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - if( (ei->flag & IPO_EDIT) || G.sipo->showkey) { - - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - // all three selected - if(bezt->f2 & SELECT) { - VecAddf(median, median, bezt->vec[1]); - tot++; - } - else { - if(bezt->f1 & SELECT) { - VecAddf(median, median, bezt->vec[0]); - tot++; - } - if(bezt->f3 & SELECT) { - VecAddf(median, median, bezt->vec[2]); - tot++; - } - } - bezt++; - } - - } - } - } - } - /* check for keys */ - if(tot==0) { - if(G.sipo->blocktype==ID_KE) { - Key *key= ob_get_key((Object *)G.sipo->from); - KeyBlock *kb; - - if(key==NULL || ob->shapenr==0) return; - iskey= 1; - - kb= BLI_findlink(&key->block, ob->shapenr-1); - median[1]+= kb->pos; - tot++; - } - } - if(tot==0) return; - - median[0] /= (float)tot; - median[1] /= (float)tot; - median[2] /= (float)tot; - - if(block) { // buttons - - VECCOPY(si->median, median); - - uiBlockBeginAlign(block); - if(tot==1) { - if(iskey) - uiDefButF(block, NUM, B_TRANS_IPO, "Key Y:", 10, 80, 300, 19, &(si->median[1]), min, max, 10, 0, ""); - else { - uiDefButF(block, NUM, B_TRANS_IPO, "Vertex X:", 10, 100, 150, 19, &(si->median[0]), min, max, 100, 0, ""); - uiDefButF(block, NUM, B_TRANS_IPO, "Vertex Y:", 160, 100, 150, 19, &(si->median[1]), min, max, 100, 0, ""); - } - } - else { - if(iskey) - uiDefButF(block, NUM, B_TRANS_IPO, "Median Key Y:", 10, 80, 300, 19, &(si->median[1]), min, max, 10, 0, ""); - else { - uiDefButF(block, NUM, B_TRANS_IPO, "Median X:", 10, 100, 150, 19, &(si->median[0]), min, max, 100, 0, ""); - uiDefButF(block, NUM, B_TRANS_IPO, "Median Y:", 160, 100, 150, 19, &(si->median[1]), min, max, 100, 0, ""); - } - } - } - else if(iskey) { // apply - VecSubf(median, si->median, median); - - if(G.sipo->blocktype==ID_KE) { - Key *key= ob_get_key((Object *)G.sipo->from); - KeyBlock *kb; - - if(key==NULL || ob->shapenr==0) return; - - kb= BLI_findlink(&key->block, ob->shapenr-1); - kb->pos+= median[1]; - tot++; - - sort_keys(key); - } - } - else { - - VecSubf(median, si->median, median); - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - if( (ei->flag & IPO_EDIT) || G.sipo->showkey) { - - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - // all three selected - if(bezt->f2 & SELECT) { - VecAddf(bezt->vec[0], bezt->vec[0], median); - VecAddf(bezt->vec[1], bezt->vec[1], median); - VecAddf(bezt->vec[2], bezt->vec[2], median); - } - else { - if(bezt->f1 & SELECT) { - VecAddf(bezt->vec[0], bezt->vec[0], median); - } - if(bezt->f3 & SELECT) { - VecAddf(bezt->vec[2], bezt->vec[2], median); - } - } - bezt++; - } - - } - } - } - } - } -} - -void do_ipobuts(unsigned short event) -{ - Object *ob= OBACT; - EditIpo *ei; - - if(G.sipo->from==NULL) return; - - switch(event) { - case B_IPO_REDR: - ei= get_active_editipo(); - if(ei) { - if(ei->icu->driver) { - if (ei->icu->driver->type == IPO_DRIVER_TYPE_PYTHON) { - /* first del pydriver's global dict, just in case - * an available pydrivers.py module needs to be reloaded */ - BPY_pydriver_update(); - /* eval user's expression once for validity; update DAG */ - BPY_pydriver_eval(ei->icu->driver); - DAG_scene_sort(G.scene); - } - else if(G.sipo->blocktype==ID_KE || G.sipo->blocktype==ID_AC) - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - } - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - break; - case B_SETSPEED: - set_speed_editipo(hspeed); - break; - case B_MUL_IPO: - scale_editipo(); - allqueue(REDRAWIPO, 0); - break; - case B_TRANS_IPO: - ipo_editvertex_buts(NULL, G.sipo, 0.0, 0.0); - editipo_changed(G.sipo, 1); - allqueue(REDRAWIPO, 0); - break; - case B_SETKEY: - ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_IPO_DRIVER: - ei= get_active_editipo(); - if(ei) { - if(ei->icu==NULL) { - ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode); - if (!ei->icu) { - error("Could not add a driver to this curve, may be linked data!"); - break; - } - ei->flag |= IPO_SELECT; - ei->icu->flag= ei->flag; - } - if(ei->icu->driver) { - MEM_freeN(ei->icu->driver); - ei->icu->driver= NULL; - if(ei->icu->bezt==NULL) { - BLI_remlink( &(G.sipo->ipo->curve), ei->icu); - free_ipo_curve(ei->icu); - ei->icu= NULL; - } - } - else { - ei->icu->driver= MEM_callocN(sizeof(IpoDriver), "ipo driver"); - ei->icu->driver->blocktype= ID_OB; - ei->icu->driver->adrcode= OB_LOC_X; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - DAG_scene_sort(G.scene); - - BIF_undo_push("Add/Remove Ipo driver"); - } - break; - case B_IPO_DRIVERTYPE: - ei= get_active_editipo(); - if(ei) { - if(ei->icu->driver) { - IpoDriver *driver= ei->icu->driver; - - if(driver->type == IPO_DRIVER_TYPE_PYTHON) { - /* pydriver expression shouldn't reference own ob, - * so we need to store ob ptr to check against it */ - driver->ob= ob; - } - else { - driver->ob= NULL; - driver->blocktype= ID_OB; - driver->adrcode= OB_LOC_X; - driver->flag &= ~IPO_DRIVER_FLAG_INVALID; - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - DAG_scene_sort(G.scene); - - BIF_undo_push("Change Ipo driver type"); - } - break; - case B_IPO_DEPCHANGE: - ei= get_active_editipo(); - if(ei) { - if(ei->icu->driver) { - IpoDriver *driver= ei->icu->driver; - - if(driver->type == IPO_DRIVER_TYPE_PYTHON) { - } - else { - if(driver->ob) { - if(ob==driver->ob && G.sipo->bonename[0]==0) { - error("Cannot assign a Driver to own Object"); - driver->ob= NULL; - } - else { - /* check if type is still OK */ - if(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR); - else driver->blocktype= ID_OB; - } - } - } - DAG_scene_sort(G.scene); - - if(G.sipo->blocktype==ID_KE || G.sipo->blocktype==ID_AC) - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - } -} - -static char *ipodriver_modeselect_pup(Object *ob) -{ - static char string[265]; - char tmpstr[64]; - char formatstring[64]; - - strcpy(string, "Driver type: %t"); - - strcpy(formatstring, "|%s %%x%d %%i%d"); - - if(ob) { - sprintf(tmpstr,formatstring,"Object",ID_OB, ICON_OBJECT); - strcat(string,tmpstr); - } - if(ob && ob->type==OB_ARMATURE) { - sprintf(tmpstr,formatstring,"Pose",ID_AR, ICON_POSE_DEHLT); - strcat(string,tmpstr); - } - - return (string); -} - -static char *ipodriver_channelselect_pup(int is_armature) -{ - static char string[1024]; - char *tmp; - - strcpy(string, "Driver channel: %t"); - tmp= string+strlen(string); - - tmp+= sprintf(tmp, "|Loc X %%x%d", OB_LOC_X); - tmp+= sprintf(tmp, "|Loc Y %%x%d", OB_LOC_Y); - tmp+= sprintf(tmp, "|Loc Z %%x%d", OB_LOC_Z); - tmp+= sprintf(tmp, "|Rot X %%x%d", OB_ROT_X); - tmp+= sprintf(tmp, "|Rot Y %%x%d", OB_ROT_Y); - tmp+= sprintf(tmp, "|Rot Z %%x%d", OB_ROT_Z); - tmp+= sprintf(tmp, "|Scale X %%x%d", OB_SIZE_X); - tmp+= sprintf(tmp, "|Scale Y %%x%d", OB_SIZE_Y); - tmp+= sprintf(tmp, "|Scale Z %%x%d", OB_SIZE_Z); - if(is_armature) - tmp+= sprintf(tmp, "|Rotation Difference %%x%d", OB_ROT_DIFF); - - return (string); -} - -static void ipo_panel_properties(short cntrl) // IPO_HANDLER_PROPERTIES -{ - extern int totipo_curve; // editipo.c - uiBlock *block; - EditIpo *ei; - char name[48]; - - block= uiNewBlock(&curarea->uiblocks, "ipo_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IPO_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Transform Properties", "Ipo", 10, 230, 318, 204)==0) return; - - /* this is new panel height, newpanel doesnt force new size on existing panels */ - uiNewPanelHeight(block, 204); - - /* driver buttons first */ - ei= get_active_editipo(); - if(ei) { - - sprintf(name, "Driven Channel: %s", ei->name); - uiDefBut(block, LABEL, 0, name, 10, 265, 200, 19, NULL, 1.0, 0.0, 0, 0, ""); - - if(ei->icu && ei->icu->driver) { - IpoDriver *driver= ei->icu->driver; - - uiDefBut(block, BUT, B_IPO_DRIVER, "Remove", 210,265,100,20, NULL, 0.0f, 0.0f, 0, 0, "Remove Driver for this Ipo Channel"); - - uiBlockBeginAlign(block); - uiDefIconButS(block, TOG, B_IPO_DRIVERTYPE, ICON_PYTHON, 10,240,25,20, &driver->type, (float)IPO_DRIVER_TYPE_NORMAL, (float)IPO_DRIVER_TYPE_PYTHON, 0, 0, "Use a one-line Python Expression as Driver"); - - if(driver->type == IPO_DRIVER_TYPE_PYTHON) { - uiDefBut(block, TEX, B_IPO_REDR, "", 35,240,275,20, driver->name, 0, 127, 0, 0, "Python Expression"); - uiBlockEndAlign(block); - if(driver->flag & IPO_DRIVER_FLAG_INVALID) { - uiDefBut(block, LABEL, 0, "Error: invalid Python expression", - 5,215,230,19, NULL, 0, 0, 0, 0, ""); - } - } - else { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_IPO_DEPCHANGE, "OB:", 35, 240, 125, 20, &(driver->ob), "Driver Object"); - if(driver->ob) { - int icon=ICON_OBJECT; - - if(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR) { - icon = ICON_POSE_DEHLT; - uiDefBut(block, TEX, B_IPO_REDR, "BO:", 10,220,150,20, driver->name, 0, 31, 0, 0, "Bone name"); - - if(driver->adrcode==OB_ROT_DIFF) - uiDefBut(block, TEX, B_IPO_REDR, "BO:", 10,200,150,20, driver->name+DRIVER_NAME_OFFS, 0, 31, 0, 0, "Bone name for angular reference"); - - } - else driver->blocktype= ID_OB; /* safety when switching object button */ - - uiBlockBeginAlign(block); - uiDefIconTextButS(block, MENU, B_IPO_DEPCHANGE, icon, - ipodriver_modeselect_pup(driver->ob), 165,240,145,20, &(driver->blocktype), 0, 0, 0, 0, "Driver type"); - - uiDefButS(block, MENU, B_IPO_REDR, - ipodriver_channelselect_pup(driver->ob->type==OB_ARMATURE && driver->blocktype==ID_AR), - 165,220,145,20, &(driver->adrcode), 0, 0, 0, 0, "Driver channel"); - } - uiBlockEndAlign(block); - } - } - else { - uiDefBut(block, BUT, B_IPO_DRIVER, "Add Driver", 210,265,100,19, NULL, 0.0f, 0.0f, 0, 0, "Create a Driver for this Ipo Channel"); - } - } - else - uiDefBut(block, LABEL, 0, " ", 10, 265, 150, 19, NULL, 1.0, 0.0, 0, 0, ""); - - boundbox_ipo_curves(G.sipo); // should not be needed... transform/draw calls should update - - /* note ranges for buttons below are idiot... we need 2 ranges, one for sliding scale, one for real clip */ - if(G.sipo->ipo && G.sipo->ipo->curve.first && totipo_curve) { - extern int totipo_vertsel; // editipo.c - uiDefBut(block, LABEL, 0, "Visible curves", 160, 200, 150, 19, NULL, 1.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MUL_IPO, "Xmin:", 10, 180, 150, 19, &G.sipo->tot.xmin, G.sipo->tot.xmin-1000.0, MAXFRAMEF, 100, 0, ""); - uiDefButF(block, NUM, B_MUL_IPO, "Xmax:", 160, 180, 150, 19, &G.sipo->tot.xmax, G.sipo->tot.ymin-1000.0, MAXFRAMEF, 100, 0, ""); - - uiDefButF(block, NUM, B_MUL_IPO, "Ymin:", 10, 160, 150, 19, &G.sipo->tot.ymin, G.sipo->tot.ymin-1000.0, 5000.0, 100, 0, ""); - uiDefButF(block, NUM, B_MUL_IPO, "Ymax:", 160, 160, 150, 19, &G.sipo->tot.ymax, G.sipo->tot.ymin-1000.0, 5000.0, 100, 0, ""); - - /* SPEED BUTTON */ - if(totipo_vertsel) { - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_IPO_NONE, "Speed:", 10,130,150,19, &hspeed, 0.0, 180.0, 1, 0, ""); - uiDefBut(block, BUT, B_SETSPEED,"SET", 160,130,50,19, 0, 0, 0, 0, 0, ""); - } - } - - /* this one also does keypositions */ - if(G.sipo->ipo) ipo_editvertex_buts(block, G.sipo, -10000, MAXFRAMEF); -} - -static void ipo_blockhandlers(ScrArea *sa) -{ - SpaceIpo *sipo= sa->spacedata.first; - short a; - - /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */ - - for(a=0; ablockhandler[a]) { - - case IPO_HANDLER_PROPERTIES: - ipo_panel_properties(sipo->blockhandler[a+1]); - break; - - } - /* clear action value for event */ - sipo->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); - -} - - -void drawipospace(ScrArea *sa, void *spacedata) -{ - SpaceIpo *sipo= sa->spacedata.first; - View2D *v2d= &sipo->v2d; - EditIpo *ei; - float col[3]; - int ofsx, ofsy, a, disptype; - - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - uiFreeBlocksWin(&sa->uiblocks, sa->win); /* for panel handler to work */ - - test_editipo(0); /* test if current editipo is correct, make_editipo sets v2d->cur, call here because of calc_ipobuttonswidth() */ - - v2d->hor.xmax+=calc_ipobuttonswidth(sa); - calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy); - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - - if (sipo->pin) - glClearColor(col[0]+0.05,col[1],col[2], 0.0); // litepink - else - glClearColor(col[0],col[1],col[2], 0.0); - - glClear(GL_COLOR_BUFFER_BIT); - - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - if(v2d->scroll) { - ofsx= sa->winrct.xmin; // ivm mywin - ofsy= sa->winrct.ymin; - glViewport(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1); - glScissor(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1); - } - } - - myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); - - if(sipo->editipo) { - - /* correct scale for degrees? */ - disptype= -1; - ei= sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if(ei->flag & IPO_VISIBLE) { - if(disptype== -1) disptype= ei->disptype; - else if(disptype!=ei->disptype) disptype= 0; - } - } - - calc_ipogrid(); - draw_ipogrid(); - - draw_cfra(sipo); - - /* ipokeys */ - if(sipo->showkey) { - if(sipo->ipokey.first==0) make_ipokey(); - else update_ipokey_val(); - draw_ipokey(sipo); - } - - if(sipo->blocktype==ID_KE) { - ei= sipo->editipo; - draw_key(sipo, ei->flag & IPO_VISIBLE); - } - - /* map ipo-points for drawing if scaled ipo */ - if (NLA_IPO_SCALED) - actstrip_map_ipo_keys(OBACT, sipo->ipo, 0, 0); - - /* draw deselect */ - draw_ipocurves(0); - draw_ipohandles(0); - draw_ipovertices(0); - - /* draw select */ - draw_ipocurves(1); - draw_ipohandles(1); - draw_ipovertices(1); - - /* undo mapping of ipo-points for drawing if scaled ipo */ - if (NLA_IPO_SCALED) - actstrip_map_ipo_keys(OBACT, sipo->ipo, 1, 0); - - /* Draw 'curtains' for preview */ - draw_anim_preview_timespace(); - - /* draw markers */ - draw_markers_timespace(0); - - /* restore viewport */ - mywinset(sa->win); - - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - - /* ortho at pixel level sa */ - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - if(v2d->scroll) { - drawscroll(disptype); - draw_solution(sipo); - } - - draw_ipobuts(sipo); - } - } - else { - calc_ipogrid(); - draw_ipogrid(); - } - - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - draw_area_emboss(sa); - - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, sipo->blockscale, sipo->blockscale, sipo->blockscale); - /* only draw panels when relevant */ - if(sipo->editipo) ipo_blockhandlers(sa); - - sa->win_swap= WIN_BACK_OK; -} - -void scroll_ipobuts() -{ - int tot; - short yo, mval[2]; - - tot= 30+IPOBUTY*G.sipo->totipo; - if(totwiny) return; - - getmouseco_areawin(mval); - yo= mval[1]; - - while(get_mbut()&M_MOUSE) { - getmouseco_areawin(mval); - if(mval[1]!=yo) { - G.sipo->butofs+= (mval[1]-yo); - if(G.sipo->butofs<0) G.sipo->butofs= 0; - else if(G.sipo->butofs+curarea->winy>tot) G.sipo->butofs= tot-curarea->winy; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - yo= mval[1]; - } - else BIF_wait_for_statechange(); - } -} - -/* total mess function, especially with mousewheel, needs cleanup badly (ton) */ -int view2dzoom(unsigned short event) -{ - ScrArea *sa; - float fac, dx, dy, wtemp; - short mval[2], mvalo[2]; - short is_wheel= (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE); - - getmouseco_areawin(mvalo); - mval[0]= mvalo[0]; - mval[1]= mvalo[1]; - - while( (get_mbut()&(L_MOUSE|M_MOUSE)) || is_wheel ) { - - /* regular mousewheel: zoom regular - * alt-shift mousewheel: zoom y only - * alt-ctrl mousewheel: zoom x only - */ - if (event==WHEELUPMOUSE) { - if(U.uiflag & USER_WHEELZOOMDIR) - wtemp = -0.0375; - else - wtemp = 0.03; - if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3; - - dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case 0: - break; - case (LR_SHIFTKEY|LR_ALTKEY): - dx = 0; - break; - case (LR_CTRLKEY|LR_ALTKEY): - dy = 0; - break; - default: - if(curarea->spacetype==SPACE_BUTS); // exception - else return 0; - break; - } - } - else if (event==WHEELDOWNMOUSE) { - if(U.uiflag & USER_WHEELZOOMDIR) - wtemp = 0.03; - else - wtemp = -0.0375; - if(curarea->spacetype!=SPACE_BUTS) wtemp*= 3; - - dx= (float)(wtemp*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - dy= (float)(wtemp*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case 0: - break; - case (LR_SHIFTKEY|LR_ALTKEY): - dx = 0; - break; - case (LR_CTRLKEY|LR_ALTKEY): - dy = 0; - break; - default: - if(curarea->spacetype==SPACE_BUTS); - else return 0; - break; - } - } - else { - getmouseco_areawin(mval); - if(U.viewzoom==USER_ZOOM_SCALE) { - float dist; - - dist = (G.v2d->mask.xmax - G.v2d->mask.xmin)/2.0; - dx= 1.0-(fabs(mvalo[0]-dist)+2.0)/(fabs(mval[0]-dist)+2.0); - dx*= 0.5*(G.v2d->cur.xmax-G.v2d->cur.xmin); - - dist = (G.v2d->mask.ymax - G.v2d->mask.ymin)/2.0; - dy= 1.0-(fabs(mvalo[1]-dist)+2.0)/(fabs(mval[1]-dist)+2.0); - dy*= 0.5*(G.v2d->cur.ymax-G.v2d->cur.ymin); - - } - else { - fac= 0.01*(mval[0]-mvalo[0]); - dx= fac*(G.v2d->cur.xmax-G.v2d->cur.xmin); - fac= 0.01*(mval[1]-mvalo[1]); - dy= fac*(G.v2d->cur.ymax-G.v2d->cur.ymin); - - if(U.viewzoom==USER_ZOOM_CONT) { - dx/= 20.0; - dy/= 20.0; - } - } - } - - if (ELEM(event, WHEELUPMOUSE, WHEELDOWNMOUSE) || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - - if(U.viewzoom!=USER_ZOOM_CONT) { - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - - if( ELEM(curarea->spacetype, SPACE_NLA, SPACE_ACTION) ) { - if(mvalo[0] < G.v2d->mask.xmin) { - G.v2d->cur.ymin+= dy; - G.v2d->cur.ymax-= dy; - } - else { - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - } - } - else if (ELEM(curarea->spacetype, SPACE_SOUND, SPACE_TIME)) { - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - } - else if (curarea->spacetype == SPACE_SEQ) { - /* less sensitivity on y scale */ - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - if (!(ELEM(event, WHEELUPMOUSE, WHEELDOWNMOUSE))) { - G.v2d->cur.ymin+= dy/2; - G.v2d->cur.ymax-= dy/2; - } - } - else { - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - G.v2d->cur.ymin+= dy; - G.v2d->cur.ymax-= dy; - } - - test_view2d(G.v2d, curarea->winx, curarea->winy); /* cur min max rects */ - - sa= curarea; /* now when are you going to kill this one! */ - view2d_do_locks(curarea, V2D_LOCK_COPY|V2D_LOCK_REDRAW); - areawinset(sa->win); - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else BIF_wait_for_statechange(); - /* return if we were using the mousewheel - */ - if ( is_wheel ) return 1; - } - return 1; -} - -void center_currframe(void) -{ - /* place the current frame in the - * center of the 2D window. - */ - float width; - - width = G.v2d->cur.xmax - G.v2d->cur.xmin; - G.v2d->cur.xmin = CFRA - 0.5*(width); - G.v2d->cur.xmax = CFRA + 0.5*(width); - - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - - scrarea_queue_winredraw(curarea); -} - -/* total mess function, especially with mousewheel, needs cleanup badly (ton) */ -int view2dmove(unsigned short event) -{ - /* return 1 when something was done */ - float facx=0.0, facy=0.0, dx, dy, left=1.0, right=1.0; - short mval[2], mvalo[2], leftret=1, mousebut; - short is_wheel= (event==WHEELUPMOUSE) || (event==WHEELDOWNMOUSE); - int oldcursor, cursor; - Window *win; - - /* when wheel is used, we only draw it once */ - - /* try to do some zooming if the - * middlemouse and ctrl are pressed - * or if the mousewheel is being used. - * Return if zooming was done. - */ - - /* check for left mouse / right mouse button select */ - if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE; - else mousebut = L_MOUSE; - - if ( (G.qual & LR_CTRLKEY) || is_wheel ) { - /* patch for oops & buttonswin, standard scroll no zoom */ - if(curarea->spacetype==SPACE_OOPS) { - SpaceOops *soops= curarea->spacedata.first; - if(soops->type==SO_OUTLINER); - else if (view2dzoom(event)) { - return 0; - } - } - else if(curarea->spacetype==SPACE_BUTS && (G.qual & LR_CTRLKEY)==0); - else if (view2dzoom(event)) { - return 0; - } - } - - /* test where mouse is */ - getmouseco_areawin(mvalo); - /* initialize this too */ - mval[0]= mvalo[0]; - mval[1]= mvalo[1]; - - if ELEM7(curarea->spacetype, SPACE_IPO, SPACE_SEQ, SPACE_OOPS, SPACE_SOUND, SPACE_ACTION, SPACE_NLA, SPACE_TIME) { - - if( BLI_in_rcti(&G.v2d->mask, (int)mvalo[0], (int)mvalo[1]) ) { - facx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(float)(G.v2d->mask.xmax-G.v2d->mask.xmin); - facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - } - /* stoopid exception to allow scroll in lefthand side */ - else if(curarea->spacetype==SPACE_ACTION && BLI_in_rcti(&G.v2d->mask, ACTWIDTH+(int)mvalo[0], (int)mvalo[1]) ) { - facx= 0.0f; - facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - } - else if(curarea->spacetype==SPACE_NLA && BLI_in_rcti(&G.v2d->mask, NLAWIDTH+(int)mvalo[0], (int)mvalo[1]) ) { - facx= 0.0f; - facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - } - else if(IN_2D_VERT_SCROLL((int)mvalo)) { - facy= -(G.v2d->tot.ymax-G.v2d->tot.ymin)/(float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - if(get_mbut() & mousebut) { - /* which part of scrollbar should move? */ - if(mvalo[1]< (vertymin+vertymax)/2 ) right= 0.0; - else left= 0.0; - leftret= 0; - } - if(is_wheel) - facy= -facy; - } - else if(IN_2D_HORIZ_SCROLL((int)mvalo)) { - facx= -(G.v2d->tot.xmax-G.v2d->tot.xmin)/(float)(G.v2d->mask.xmax-G.v2d->mask.xmin); - if(get_mbut() & mousebut) { - /* which part of scrollbar should move? */ - if(mvalo[0]< (horxmin+horxmax)/2 ) right= 0.0; - else left= 0.0; - leftret= 0; - } - } - } - else { - facx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/(float)(curarea->winx); - facy= (G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)(curarea->winy); - } - - cursor = BC_NSEW_SCROLLCURSOR; - - /* no y move in audio & time */ - if ELEM(curarea->spacetype, SPACE_SOUND, SPACE_TIME) { - facy= 0.0; - cursor = BC_EW_SCROLLCURSOR; - } - - /* store the old cursor to temporarily change it */ - oldcursor=get_cursor(); - win=winlay_get_active_window(); - - - if(get_mbut() & mousebut && leftret) return 0; - if(facx==0.0 && facy==0.0) return 1; - - if (!is_wheel) SetBlenderCursor(cursor); - - while( (get_mbut()&(L_MOUSE|M_MOUSE)) || is_wheel) { - - /* If the mousewheel is used with shift key - * the scroll up and down. If the mousewheel - * is used with the ctrl key then scroll left - * and right. - */ - if (is_wheel) { - - if(event==WHEELDOWNMOUSE) { - facx= -facx; facy= -facy; - } - switch (G.qual & (LR_CTRLKEY|LR_SHIFTKEY|LR_ALTKEY)) { - case (LR_SHIFTKEY): - dx = 0.0; - dy= facy*20.0; - break; - case (LR_CTRLKEY): - dx= facx*20.0; - dy = 0.0; - break; - default: - if(curarea->spacetype==SPACE_OOPS) { - dx= 0.0; - dy= facy*20; - } - else if(curarea->spacetype==SPACE_BUTS) { - if(G.buts->align==BUT_HORIZONTAL) { - dx= facx*30; dy= 0.0; - } else { - dx= 0.0; dy= facy*30; - } - } - else return 0; - break; - } - } - else { - - - getmouseco_areawin(mval); - dx= facx*(mvalo[0]-mval[0]); - dy= facy*(mvalo[1]-mval[1]); - } - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || is_wheel) { - ScrArea *sa; - - G.v2d->cur.xmin+= left*dx; - G.v2d->cur.xmax+= right*dx; - G.v2d->cur.ymin+= left*dy; - G.v2d->cur.ymax+= right*dy; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - - sa= curarea; /* bad global */ - view2d_do_locks(curarea, V2D_LOCK_COPY|V2D_LOCK_REDRAW); - areawinset(sa->win); - - if(curarea->spacetype==SPACE_OOPS) - ((SpaceOops *)curarea->spacedata.first)->storeflag |= SO_TREESTORE_REDRAW; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - else BIF_wait_for_statechange(); - /* return if we were using the mousewheel - */ - if ( is_wheel ) return 1; - } - - window_set_cursor(win, oldcursor); - return 1; -} - -void view2dborder(void) -{ - -} - -EditIpo *select_proj_ipo(rctf *rectf, int event) -{ - EditIpo *ei; - float xmin, ymin, xmax, ymax; - /* this was IGLuint, but it's a useless typedef... */ - GLuint buffer[MAXPICKBUF]; - int a, b; - int hits; - unsigned int code; - short mval[2]; - - G.f |= G_PICKSEL; - - if(rectf==0) { - getmouseco_areawin(mval); - - mval[0]-= 6; mval[1]-= 6; - areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin); - mval[0]+= 12; mval[1]+= 12; - areamouseco_to_ipoco(G.v2d, mval, &xmax, &ymax); - - myortho2(xmin, xmax, ymin, ymax); - } - else myortho2(rectf->xmin, rectf->xmax, rectf->ymin, rectf->ymax); - - glSelectBuffer( MAXPICKBUF, buffer); - glRenderMode(GL_SELECT); - glInitNames(); /* whatfor? but otherwise it does not work */ - glPushName(-1); - - /* get rid of buttons view */ - glPushMatrix(); - glLoadIdentity(); - - init_pickselcode(); /* drawipo.c */ - draw_ipocurves(0); - - /* restore buttons view */ - glPopMatrix(); - - G.f -= G_PICKSEL; - - hits= glRenderMode(GL_RENDER); - glPopName(); /* see above (pushname) */ - if(hits<1) return 0; - - code= 1; - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if ISPOIN(ei, icu, flag & IPO_VISIBLE) { - if(rectf) { - for(b=0; bflag |= IPO_SELECT; - else ei->flag &= ~IPO_SELECT; - ei->icu->flag= ei->flag; - } - } - } - else { - /* also conversion for glSelect */ - if(code==buffer[ 3 ]) return ei; - } - code++; - } - } - return 0; -} diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c deleted file mode 100644 index df5334dd27d..00000000000 --- a/source/blender/src/drawmesh.c +++ /dev/null @@ -1,1222 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_edgehash.h" -#include "BLI_editVert.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "DNA_image_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_property_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_bmfont.h" -#include "BKE_displist.h" -#include "BKE_DerivedMesh.h" -#include "BKE_effect.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_property.h" -#include "BKE_utildefines.h" - -#include "BIF_editmesh.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" - -#include "BDR_editface.h" -#include "BDR_vpaint.h" -#include "BDR_drawmesh.h" - -#include "BSE_drawview.h" - -#include "blendef.h" -#include "nla.h" - -#ifndef GL_CLAMP_TO_EDGE -#define GL_CLAMP_TO_EDGE 0x812F -#endif - -//#include "glext.h" -/* some local functions */ -#if defined(GL_EXT_texture_object) && (!defined(__sun__) || (!defined(__sun))) && !defined(__APPLE__) && !defined(__linux__) && !defined(WIN32) - #define glBindTexture(A,B) glBindTextureEXT(A,B) - #define glGenTextures(A,B) glGenTexturesEXT(A,B) - #define glDeleteTextures(A,B) glDeleteTexturesEXT(A,B) - #define glPolygonOffset(A,B) glPolygonOffsetEXT(A,B) - -#else - -/* #define GL_FUNC_ADD_EXT GL_FUNC_ADD */ -/* #define GL_FUNC_REVERSE_SUBTRACT_EXT GL_FUNC_REVERSE_SUBTRACT */ -/* #define GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET */ - -#endif - - /* (n&(n-1)) zeros the least significant bit of n */ -static int is_pow2(int num) { - return ((num)&(num-1))==0; -} -static int smaller_pow2(int num) { - while (!is_pow2(num)) - num= num&(num-1); - return num; -} - -/* These are used to enable texture clamping */ -static int is_pow2_limit(int num) { - if (U.glreslimit != 0 && num > U.glreslimit) return 0; - return ((num)&(num-1))==0; -} - -static int smaller_pow2_limit(int num) { - if (U.glreslimit != 0 && num > U.glreslimit) - return U.glreslimit; - return smaller_pow2(num); -} - -static int fCurtile=0, fCurmode=0,fCurtileXRep=0,fCurtileYRep=0; -static Image *fCurpage=0; -static short fTexwindx, fTexwindy, fTexwinsx, fTexwinsy; -static int fDoMipMap = 1; -static int fLinearMipMap = 0; - -/* local prototypes --------------- */ -void update_realtime_textures(void); - - -/* static int source, dest; also not used */ - -/** - * Enables or disable mipmapping for realtime images. - * @param mipmap Turn mipmapping on (mipmap!=0) or off (mipmap==0). - */ -void set_mipmap(int mipmap) -{ - if (fDoMipMap != (mipmap != 0)) { - free_all_realtime_images(); - fDoMipMap = mipmap != 0; - } -} - -/** - * Returns the current setting for mipmapping. - */ -static int get_mipmap(void) -{ - return fDoMipMap && (!(G.f & G_TEXTUREPAINT)); -} - -/** - * Enables or disable linear mipmap setting for realtime images (textures). - * Note that this will will destroy all texture bindings in OpenGL. - * @see free_realtime_image() - * @param mipmap Turn linear mipmapping on (linear!=0) or off (linear==0). - */ -void set_linear_mipmap(int linear) -{ - if (fLinearMipMap != (linear != 0)) { - free_all_realtime_images(); - fLinearMipMap = linear != 0; - } -} - -/** - * Returns the current setting for linear mipmapping. - */ -int get_linear_mipmap(void) -{ - return fLinearMipMap; -} - - -/** - * Resets the realtime image cache variables. - */ -void clear_realtime_image_cache() -{ - fCurpage = NULL; - fCurtile = 0; - fCurmode = 0; - fCurtileXRep = 0; - fCurtileYRep = 0; -} - -/* REMEMBER! Changes here must go into my_set_tpage() as well */ -int set_tpage(MTFace *tface) -{ - static int alphamode= -1; - static MTFace *lasttface= 0; - Image *ima; - ImBuf *ibuf; - unsigned int *rect=NULL, *bind; - int tpx=0, tpy=0, tilemode, tileXRep,tileYRep; - - /* disable */ - if(tface==0) { - if(lasttface==0) return 0; - - lasttface= 0; - fCurtile= 0; - fCurpage= 0; - if(fCurmode!=0) { - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - } - fCurmode= 0; - fCurtileXRep=0; - fCurtileYRep=0; - alphamode= -1; - - glDisable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - glDisable ( GL_ALPHA_TEST ); - return 0; - } - lasttface= tface; - - if( alphamode != tface->transp) { - alphamode= tface->transp; - - if(alphamode) { - glEnable(GL_BLEND); - - if(alphamode==TF_ADD) { - glBlendFunc(GL_ONE, GL_ONE); - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ - } - else if(alphamode==TF_ALPHA) { - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* added after 2.45 to clip alpha */ - - /*if U.glalphaclip == 1.0, some cards go bonkers... turn off alpha test in this case*/ - if(U.glalphaclip == 1.0) glDisable(GL_ALPHA_TEST); - else{ - glEnable ( GL_ALPHA_TEST ); - glAlphaFunc ( GL_GREATER, U.glalphaclip ); - } - - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ - } - /* else { */ - /* glBlendFunc(GL_ONE, GL_ONE); */ - /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */ - /* } */ - } else { - glDisable(GL_BLEND); - glDisable ( GL_ALPHA_TEST ); - } - } - - ima= tface->tpage; - - /* Enable or disable reflection mapping */ - if (ima && (ima->flag & IMA_REFLECT)){ - -// glActiveTextureARB(GL_TEXTURE0_ARB); - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); - - glEnable(GL_TEXTURE_GEN_S); - glEnable(GL_TEXTURE_GEN_T); - - /* Handle multitexturing here */ - } - else{ - glDisable(GL_TEXTURE_GEN_S); - glDisable(GL_TEXTURE_GEN_T); - } - - tilemode= tface->mode & TF_TILES; - tileXRep = 0; - tileYRep = 0; - if (ima) { - tileXRep = ima->xrep; - tileYRep = ima->yrep; - } - - - if(ima==fCurpage && fCurtile==tface->tile && tilemode==fCurmode && fCurtileXRep==tileXRep && fCurtileYRep == tileYRep) return ima!=0; - - if(tilemode!=fCurmode || fCurtileXRep!=tileXRep || fCurtileYRep != tileYRep) { - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - - if(tilemode && ima!=NULL) - glScalef(ima->xrep, ima->yrep, 1.0); - - glMatrixMode(GL_MODELVIEW); - } - - if(ima==NULL || ima->ok==0) { - glDisable(GL_TEXTURE_2D); - - fCurtile= tface->tile; - fCurpage= 0; - fCurmode= tilemode; - fCurtileXRep = tileXRep; - fCurtileYRep = tileYRep; - - return 0; - } - - ibuf= BKE_image_get_ibuf(ima, NULL); - if(ibuf==NULL) { - - fCurtile= tface->tile; - fCurpage= 0; - fCurmode= tilemode; - fCurtileXRep = tileXRep; - fCurtileYRep = tileYRep; - - glDisable(GL_TEXTURE_2D); - return 0; - } - - if ((ibuf->rect==NULL) && ibuf->rect_float) - IMB_rect_from_float(ibuf); - - if(ima->tpageflag & IMA_TWINANIM) fCurtile= ima->lastframe; - else fCurtile= tface->tile; - - if(tilemode) { - if(ima->repbind==0) make_repbind(ima); - - if(fCurtile>=ima->totbind) fCurtile= 0; - - /* this happens when you change repeat buttons */ - if(ima->repbind) bind= ima->repbind+fCurtile; - else bind= &ima->bindcode; - - if(*bind==0) { - - fTexwindx= ibuf->x/ima->xrep; - fTexwindy= ibuf->y/ima->yrep; - - if(fCurtile>=ima->xrep*ima->yrep) fCurtile= ima->xrep*ima->yrep-1; - - fTexwinsy= fCurtile / ima->xrep; - fTexwinsx= fCurtile - fTexwinsy*ima->xrep; - - fTexwinsx*= fTexwindx; - fTexwinsy*= fTexwindy; - - tpx= fTexwindx; - tpy= fTexwindy; - - rect= ibuf->rect + fTexwinsy*ibuf->x + fTexwinsx; - } - } - else { - bind= &ima->bindcode; - - if(*bind==0) { - tpx= ibuf->x; - tpy= ibuf->y; - rect= ibuf->rect; - } - } - - if(*bind==0) { - int rectw= tpx, recth= tpy; - unsigned int *tilerect= NULL, *scalerect= NULL; - - /* - * Maarten: - * According to Ton this code is not needed anymore. It was used only - * in really old Blenders. - * Reevan: - * Actually it is needed for backwards compatibility. Simpledemo 6 does not display correctly without it. - */ -#if 1 - if (tilemode) { - int y; - - tilerect= MEM_mallocN(rectw*recth*sizeof(*tilerect), "tilerect"); - for (y=0; yx]; - unsigned int *tilerectrow= &tilerect[y*rectw]; - - memcpy(tilerectrow, rectrow, tpx*sizeof(*rectrow)); - } - - rect= tilerect; - } -#endif - if (!is_pow2_limit(rectw) || !is_pow2_limit(recth)) { - rectw= smaller_pow2_limit(rectw); - recth= smaller_pow2_limit(recth); - - scalerect= MEM_mallocN(rectw*recth*sizeof(*scalerect), "scalerect"); - gluScaleImage(GL_RGBA, tpx, tpy, GL_UNSIGNED_BYTE, rect, rectw, recth, GL_UNSIGNED_BYTE, scalerect); - rect= scalerect; - } - - glGenTextures(1, (GLuint *)bind); - - if((G.f & G_DEBUG) || !*bind) { - GLenum error = glGetError(); - printf("Texture: %s\n", ima->id.name+2); - printf("name: %d, tpx: %d\n", *bind, tpx); - printf("tile: %d, mode: %d\n", fCurtile, tilemode); - if (error) - printf("error: %s\n", gluErrorString(error)); - } - glBindTexture( GL_TEXTURE_2D, *bind); - - if (!get_mipmap()) - { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } else - { - int minfilter= fLinearMipMap?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST; - - gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, rectw, recth, GL_RGBA, GL_UNSIGNED_BYTE, rect); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - ima->tpageflag |= IMA_MIPMAP_COMPLETE; - } - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - if (tilerect) - MEM_freeN(tilerect); - if (scalerect) - MEM_freeN(scalerect); - } - else glBindTexture( GL_TEXTURE_2D, *bind); - - /* dont tile x/y as set the the game properties */ - if (ima->tpageflag & IMA_CLAMP_U) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - if (ima->tpageflag & IMA_CLAMP_V) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - - /* tag_image_time(ima);*/ /* Did this get lost in the image recode? */ - - glEnable(GL_TEXTURE_2D); - - fCurpage= ima; - fCurmode= tilemode; - fCurtileXRep = tileXRep; - fCurtileYRep = tileYRep; - - return 1; -} - -void update_realtime_image(Image *ima, int x, int y, int w, int h) -{ - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if (ima->repbind || get_mipmap() || !ima->bindcode || !ibuf || - (!is_pow2(ibuf->x) || !is_pow2(ibuf->y)) || - (w == 0) || (h == 0)) { - /* these special cases require full reload still */ - free_realtime_image(ima); - } - else { - int row_length = glaGetOneInteger(GL_UNPACK_ROW_LENGTH); - int skip_pixels = glaGetOneInteger(GL_UNPACK_SKIP_PIXELS); - int skip_rows = glaGetOneInteger(GL_UNPACK_SKIP_ROWS); - - if ((ibuf->rect==NULL) && ibuf->rect_float) - IMB_rect_from_float(ibuf); - - glBindTexture(GL_TEXTURE_2D, ima->bindcode); - - glPixelStorei(GL_UNPACK_ROW_LENGTH, ibuf->x); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x); - glPixelStorei(GL_UNPACK_SKIP_ROWS, y); - - glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_RGBA, - GL_UNSIGNED_BYTE, ibuf->rect); - - glPixelStorei(GL_UNPACK_ROW_LENGTH, row_length); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels); - glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows); - - if(ima->tpageflag & IMA_MIPMAP_COMPLETE) - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; - } -} - -void free_realtime_image(Image *ima) -{ - if(ima->bindcode) { - glDeleteTextures(1, (GLuint *)&ima->bindcode); - ima->bindcode= 0; - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; - } - if(ima->repbind) { - glDeleteTextures(ima->totbind, (GLuint *)ima->repbind); - - MEM_freeN(ima->repbind); - ima->repbind= NULL; - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; - } -} - -void free_all_realtime_images(void) -{ - Image* ima; - - for(ima=G.main->image.first; ima; ima=ima->id.next) - free_realtime_image(ima); -} - -/* these two functions are called on entering and exiting texture paint mode, - temporary disabling/enabling mipmapping on all images for quick texture - updates with glTexSubImage2D. images that didn't change don't have to be - re-uploaded to OpenGL */ -void texpaint_disable_mipmap(void) -{ - Image* ima; - - if(!fDoMipMap) - return; - - for(ima=G.main->image.first; ima; ima=ima->id.next) { - if(ima->bindcode) { - glBindTexture(GL_TEXTURE_2D, ima->bindcode); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - } -} - -void texpaint_enable_mipmap(void) -{ - Image* ima; - - if(!fDoMipMap) - return; - - for(ima=G.main->image.first; ima; ima=ima->id.next) { - if(ima->bindcode) { - if(ima->tpageflag & IMA_MIPMAP_COMPLETE) { - int minfilter= fLinearMipMap?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST; - - glBindTexture(GL_TEXTURE_2D, ima->bindcode); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else - free_realtime_image(ima); - } - } -} - -void make_repbind(Image *ima) -{ - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if(ibuf==NULL) return; - - if(ima->repbind) { - glDeleteTextures(ima->totbind, (GLuint *)ima->repbind); - MEM_freeN(ima->repbind); - ima->repbind= 0; - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; - } - ima->totbind= ima->xrep*ima->yrep; - if(ima->totbind>1) { - ima->repbind= MEM_callocN(sizeof(int)*ima->totbind, "repbind"); - } -} - -void update_realtime_textures() -{ - Image *ima; - - ima= G.main->image.first; - while(ima) { - if(ima->tpageflag & IMA_TWINANIM) { - if(ima->twend >= ima->xrep*ima->yrep) ima->twend= ima->xrep*ima->yrep-1; - - /* check: is bindcode not in the array? Free. (to do) */ - - ima->lastframe++; - if(ima->lastframe > ima->twend) ima->lastframe= ima->twsta; - - } - ima= ima->id.next; - } -} - -/***/ - - /* Flags for marked edges */ -enum { - eEdge_Visible = (1<<0), - eEdge_Select = (1<<1), -}; - - /* Creates a hash of edges to flags indicating - * adjacent tface select/active/etc flags. - */ -static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flags) -{ - int *flags_p; - - if (!BLI_edgehash_haskey(eh, v0, v1)) { - BLI_edgehash_insert(eh, v0, v1, 0); - } - - flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1); - *flags_p |= flags; -} - -EdgeHash *get_tface_mesh_marked_edge_info(Mesh *me) -{ - EdgeHash *eh = BLI_edgehash_new(); - int i; - MFace *mf; - MTFace *tf = NULL; - - for (i=0; itotface; i++) { - mf = &me->mface[i]; - if (me->mtface) - tf = &me->mtface[i]; - - if (mf->v3) { - if (!(mf->flag&ME_HIDE)) { - unsigned int flags = eEdge_Visible; - if (mf->flag&ME_FACE_SEL) flags |= eEdge_Select; - - get_marked_edge_info__orFlags(eh, mf->v1, mf->v2, flags); - get_marked_edge_info__orFlags(eh, mf->v2, mf->v3, flags); - if (mf->v4) { - get_marked_edge_info__orFlags(eh, mf->v3, mf->v4, flags); - get_marked_edge_info__orFlags(eh, mf->v4, mf->v1, flags); - } else { - get_marked_edge_info__orFlags(eh, mf->v3, mf->v1, flags); - } - } - } - } - - return eh; -} - - -static int draw_tfaces3D__setHiddenOpts(void *userData, int index) -{ - struct { Mesh *me; EdgeHash *eh; } *data = userData; - MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); - - if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) { - return 0; - } else if(G.f & G_DRAWEDGES){ - if (G.f&G_HIDDENEDGES) { - return 1; - } else { - return (flags & eEdge_Visible); - } - } else { - return (flags & eEdge_Select); - } -} -static int draw_tfaces3D__setSeamOpts(void *userData, int index) -{ - struct { Mesh *me; EdgeHash *eh; } *data = userData; - MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); - - if (med->flag&ME_SEAM) { - if (G.f&G_HIDDENEDGES) { - return 1; - } else { - return (flags & eEdge_Visible); - } - } else { - return 0; - } -} -static int draw_tfaces3D__setSelectOpts(void *userData, int index) -{ - struct { Mesh *me; EdgeHash *eh; } *data = userData; - MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); - - return flags & eEdge_Select; -} -static int draw_tfaces3D__setActiveOpts(void *userData, int index) -{ - struct { Mesh *me; EdgeHash *eh; } *data = userData; - MEdge *med = &data->me->medge[index]; - unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2); - - if (flags & eEdge_Select) { - return 1; - } else { - return 0; - } -} -static int draw_tfaces3D__drawFaceOpts(void *userData, int index) -{ - Mesh *me = (Mesh*)userData; - - MFace *mface = &me->mface[index]; - if (!(mface->flag&ME_HIDE) && (mface->flag&ME_FACE_SEL)) - return 2; /* Don't set color */ - else - return 0; -} -static void draw_tfaces3D(Object *ob, Mesh *me, DerivedMesh *dm) -{ - struct { Mesh *me; EdgeHash *eh; } data; - - data.me = me; - data.eh = get_tface_mesh_marked_edge_info(me); - - glEnable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); - bglPolygonOffset(1.0); - - /* Draw (Hidden) Edges */ - BIF_ThemeColor(TH_EDGE_FACESEL); - dm->drawMappedEdges(dm, draw_tfaces3D__setHiddenOpts, &data); - - /* Draw Seams */ - if(G.f & G_DRAWSEAMS) { - BIF_ThemeColor(TH_EDGE_SEAM); - glLineWidth(2); - - dm->drawMappedEdges(dm, draw_tfaces3D__setSeamOpts, &data); - - glLineWidth(1); - } - - /* Draw Selected Faces */ - if(G.f & G_DRAWFACES) { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - BIF_ThemeColor4(TH_FACE_SELECT); - - dm->drawMappedFacesTex(dm, draw_tfaces3D__drawFaceOpts, (void*)me); - - glDisable(GL_BLEND); - } - - bglPolygonOffset(1.0); - - /* Draw Stippled Outline for selected faces */ - glColor3ub(255, 255, 255); - setlinestyle(1); - dm->drawMappedEdges(dm, draw_tfaces3D__setSelectOpts, &data); - setlinestyle(0); - - dm->drawMappedEdges(dm, draw_tfaces3D__setActiveOpts, &data); - - bglPolygonOffset(0.0); // resets correctly now, even after calling accumulated offsets - - BLI_edgehash_free(data.eh, NULL); -} - -static int set_gl_light(Object *ob) -{ - Base *base; - Lamp *la; - int count; - /* float zero[4]= {0.0, 0.0, 0.0, 0.0}; */ - float vec[4]; - - vec[3]= 1.0; - - for(count=0; count<8; count++) glDisable(GL_LIGHT0+count); - - count= 0; - - base= FIRSTBASE; - while(base) { - if(base->object->type==OB_LAMP ) { - if(base->lay & G.vd->lay) { - if(base->lay & ob->lay) - { - la= base->object->data; - - glPushMatrix(); - glLoadMatrixf((float *)G.vd->viewmat); - - where_is_object_simul(base->object); - VECCOPY(vec, base->object->obmat[3]); - - if(la->type==LA_SUN) { - vec[0]= base->object->obmat[2][0]; - vec[1]= base->object->obmat[2][1]; - vec[2]= base->object->obmat[2][2]; - vec[3]= 0.0; - glLightfv(GL_LIGHT0+count, GL_POSITION, vec); - } - else { - vec[3]= 1.0; - glLightfv(GL_LIGHT0+count, GL_POSITION, vec); - glLightf(GL_LIGHT0+count, GL_CONSTANT_ATTENUATION, 1.0); - glLightf(GL_LIGHT0+count, GL_LINEAR_ATTENUATION, la->att1/la->dist); - /* post 2.25 engine supports quad lights */ - glLightf(GL_LIGHT0+count, GL_QUADRATIC_ATTENUATION, la->att2/(la->dist*la->dist)); - - if(la->type==LA_SPOT) { - vec[0]= -base->object->obmat[2][0]; - vec[1]= -base->object->obmat[2][1]; - vec[2]= -base->object->obmat[2][2]; - glLightfv(GL_LIGHT0+count, GL_SPOT_DIRECTION, vec); - glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, la->spotsize/2.0); - glLightf(GL_LIGHT0+count, GL_SPOT_EXPONENT, 128.0*la->spotblend); - } - else glLightf(GL_LIGHT0+count, GL_SPOT_CUTOFF, 180.0); - } - - vec[0]= la->energy*la->r; - vec[1]= la->energy*la->g; - vec[2]= la->energy*la->b; - vec[3]= 1.0; - glLightfv(GL_LIGHT0+count, GL_DIFFUSE, vec); - glLightfv(GL_LIGHT0+count, GL_SPECULAR, vec);//zero); - glEnable(GL_LIGHT0+count); - - glPopMatrix(); - - count++; - if(count>7) break; - } - } - } - base= base->next; - } - - return count; -} - -static Material *give_current_material_or_def(Object *ob, int matnr) -{ - extern Material defmaterial; // render module abuse... - Material *ma= give_current_material(ob, matnr); - - return ma?ma:&defmaterial; -} - -static int set_draw_settings_cached(int clearcache, int textured, MTFace *texface, int lit, Object *litob, int litmatnr, int doublesided) -{ - static int c_textured; - static int c_lit; - static int c_doublesided; - static MTFace *c_texface; - static Object *c_litob; - static int c_litmatnr; - static int c_badtex; - - if (clearcache) { - c_textured= c_lit= c_doublesided= -1; - c_texface= (MTFace*) -1; - c_litob= (Object*) -1; - c_litmatnr= -1; - c_badtex= 0; - } - - if (texface) { - lit = lit && (lit==-1 || texface->mode&TF_LIGHT); - textured = textured && (texface->mode&TF_TEX); - doublesided = texface->mode&TF_TWOSIDE; - } else { - textured = 0; - } - - if (doublesided!=c_doublesided) { - if (doublesided) glDisable(GL_CULL_FACE); - else glEnable(GL_CULL_FACE); - - c_doublesided= doublesided; - } - - if (textured!=c_textured || texface!=c_texface) { - if (textured ) { - c_badtex= !set_tpage(texface); - } else { - set_tpage(0); - c_badtex= 0; - } - c_textured= textured; - c_texface= texface; - } - - if (c_badtex) lit= 0; - if (lit!=c_lit || litob!=c_litob || litmatnr!=c_litmatnr) { - if (lit) { - Material *ma= give_current_material_or_def(litob, litmatnr+1); - float spec[4]; - - spec[0]= ma->spec*ma->specr; - spec[1]= ma->spec*ma->specg; - spec[2]= ma->spec*ma->specb; - spec[3]= 1.0; - - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_LIGHTING); - glEnable(GL_COLOR_MATERIAL); - } - else { - glDisable(GL_LIGHTING); - glDisable(GL_COLOR_MATERIAL); - } - c_lit= lit; - c_litob= litob; - c_litmatnr= litmatnr; - } - - return c_badtex; -} - -/* Icky globals, fix with userdata parameter */ - -struct TextureDrawState { - Object *ob; - int islit, istex; - unsigned char obcol[4]; -} Gtexdraw = {NULL, 0, 0, {0, 0, 0, 0}}; - -static void draw_textured_begin(Object *ob) -{ - unsigned char obcol[4]; - int istex, solidtex= 0; - - if(G.vd->drawtype==OB_SOLID || (ob==G.obedit && G.vd->drawtype!=OB_TEXTURE)) { - /* draw with default lights in solid draw mode and edit mode */ - solidtex= 1; - Gtexdraw.islit= -1; - } - else - /* draw with lights in the scene otherwise */ - Gtexdraw.islit= set_gl_light(ob); - - obcol[0]= CLAMPIS(ob->col[0]*255, 0, 255); - obcol[1]= CLAMPIS(ob->col[1]*255, 0, 255); - obcol[2]= CLAMPIS(ob->col[2]*255, 0, 255); - obcol[3]= CLAMPIS(ob->col[3]*255, 0, 255); - - glCullFace(GL_BACK); glEnable(GL_CULL_FACE); - if(solidtex || G.vd->drawtype==OB_TEXTURE) istex= 1; - else istex= 0; - - Gtexdraw.ob = ob; - Gtexdraw.istex = istex; - memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); - set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0); - glShadeModel(GL_SMOOTH); -} - -static void draw_textured_end() -{ - /* switch off textures */ - set_tpage(0); - - glShadeModel(GL_FLAT); - glDisable(GL_CULL_FACE); - - /* XXX, bad patch - default_gl_light() calls - * glLightfv(GL_LIGHT_POSITION, ...) which - * is transformed by the current matrix... we - * need to make sure that matrix is identity. - * - * It would be better if drawmesh.c kept track - * of and restored the light settings it changed. - * - zr - */ - glPushMatrix(); - glLoadIdentity(); - default_gl_light(); - glPopMatrix(); -} - - -static int draw_tface__set_draw(MTFace *tface, MCol *mcol, int matnr) -{ - if (tface && (tface->mode&TF_INVISIBLE)) return 0; - - if (tface && set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE)) { - glColor3ub(0xFF, 0x00, 0xFF); - return 2; /* Don't set color */ - } else if (tface && tface->mode&TF_OBCOL) { - glColor3ubv(Gtexdraw.obcol); - return 2; /* Don't set color */ - } else if (!mcol) { - if (tface) glColor3f(1.0, 1.0, 1.0); - else { - Material *ma= give_current_material(Gtexdraw.ob, matnr+1); - if(ma) glColor3f(ma->r, ma->g, ma->b); - else glColor3f(1.0, 1.0, 1.0); - } - return 2; /* Don't set color */ - } else { - return 1; /* Set color from mcol */ - } -} - -static int draw_tface_mapped__set_draw(void *userData, int index) -{ - Mesh *me = (Mesh*)userData; - MTFace *tface = (me->mtface)? &me->mtface[index]: NULL; - MFace *mface = (me->mface)? &me->mface[index]: NULL; - MCol *mcol = (me->mcol)? &me->mcol[index]: NULL; - int matnr = me->mface[index].mat_nr; - if (mface && mface->flag&ME_HIDE) return 0; - return draw_tface__set_draw(tface, mcol, matnr); -} - -static int draw_em_tf_mapped__set_draw(void *userData, int index) -{ - EditMesh *em = userData; - EditFace *efa = EM_get_face_for_index(index); - MTFace *tface; - MCol *mcol; - int matnr; - - if (efa==NULL || efa->h) - return 0; - - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - matnr = efa->mat_nr; - - return draw_tface__set_draw(tface, mcol, matnr); -} - -static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) -{ - Mesh *me = (Mesh*)userData; - MTFace *tface = (me->mtface)? &me->mtface[index]: NULL; - MFace *mface = (me->mface)? &me->mface[index]: NULL; - - if ((mface->flag&ME_HIDE) || (tface && (tface->mode&TF_INVISIBLE))) - return 0; - - *drawSmooth_r = 1; - return 1; -} - -static void draw_game_text_mesh(Object *ob, Mesh *me) -{ - DerivedMesh *ddm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH); - MFace *mface= me->mface; - MTFace *tface= me->mtface; - MCol *mcol= me->mcol; /* why does mcol exist? */ - bProperty *prop = get_property(ob, "Text"); - int a, start= 0, totface= me->totface; - - tface+= start; - mcol+= start*4; - for (a=start; amode; - int matnr= mf->mat_nr; - int mf_smooth= mf->flag & ME_SMOOTH; - - if (!(mf->flag&ME_HIDE) && !(mode&TF_INVISIBLE) && (mode&TF_BMFONT)) { - int badtex= set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE); - float v1[3], v2[3], v3[3], v4[3]; - char string[MAX_PROPSTRING]; - int characters, index; - ImBuf *ibuf; - float curpos; - - if (badtex) - continue; - - ddm->getVertCo(ddm, mf->v1, v1); - ddm->getVertCo(ddm, mf->v2, v2); - ddm->getVertCo(ddm, mf->v3, v3); - if (mf->v4) ddm->getVertCo(ddm, mf->v4, v4); - - // The BM_FONT handling code is duplicated in the gameengine - // Search for 'Frank van Beek' ;-) - // string = "Frank van Beek"; - - set_property_valstr(prop, string); - characters = strlen(string); - - ibuf= BKE_image_get_ibuf(tface->tpage, NULL); - if (ibuf == NULL) { - characters = 0; - } - - if (!mf_smooth) { - float nor[3]; - - CalcNormFloat(v1, v2, v3, nor); - - glNormal3fv(nor); - } - - curpos= 0.0; - glBegin(mf->v4?GL_QUADS:GL_TRIANGLES); - for (index = 0; index < characters; index++) { - float centerx, centery, sizex, sizey, transx, transy, movex, movey, advance; - int character = string[index]; - char *cp= NULL; - - // lets calculate offset stuff - // space starts at offset 1 - // character = character - ' ' + 1; - - matrixGlyph(ibuf, character, & centerx, ¢ery, &sizex, &sizey, &transx, &transy, &movex, &movey, &advance); - movex+= curpos; - - if (tface->mode & TF_OBCOL) - glColor3ubv(Gtexdraw.obcol); - else if (me->mcol) cp= (char *)mcol; - else glColor3ub(255, 255, 255); - - glTexCoord2f((tface->uv[0][0] - centerx) * sizex + transx, (tface->uv[0][1] - centery) * sizey + transy); - if (cp) glColor3ub(cp[3], cp[2], cp[1]); - glVertex3f(sizex * v1[0] + movex, sizey * v1[1] + movey, v1[2]); - - glTexCoord2f((tface->uv[1][0] - centerx) * sizex + transx, (tface->uv[1][1] - centery) * sizey + transy); - if (cp) glColor3ub(cp[7], cp[6], cp[5]); - glVertex3f(sizex * v2[0] + movex, sizey * v2[1] + movey, v2[2]); - - glTexCoord2f((tface->uv[2][0] - centerx) * sizex + transx, (tface->uv[2][1] - centery) * sizey + transy); - if (cp) glColor3ub(cp[11], cp[10], cp[9]); - glVertex3f(sizex * v3[0] + movex, sizey * v3[1] + movey, v3[2]); - - if(mf->v4) { - glTexCoord2f((tface->uv[3][0] - centerx) * sizex + transx, (tface->uv[3][1] - centery) * sizey + transy); - if (cp) glColor3ub(cp[15], cp[14], cp[13]); - glVertex3f(sizex * v4[0] + movex, sizey * v4[1] + movey, v4[2]); - } - - curpos+= advance; - } - glEnd(); - } - } - - ddm->release(ddm); -} - -void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect) -{ - Mesh *me= ob->data; - int editing= 0; - - /* correct for negative scale */ - if(ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW); - else glFrontFace(GL_CCW); - - /* draw the textured mesh */ - draw_textured_begin(ob); - -#ifdef WITH_VERSE - if(me->vnode) { - /* verse-blender doesn't support uv mapping of textures yet */ - dm->drawFacesTex(dm, NULL); - } - else { -#endif - if(ob==G.obedit) { - dm->drawMappedFacesTex(dm, draw_em_tf_mapped__set_draw, G.editMesh); - } else if(faceselect) { - if(G.f & G_WEIGHTPAINT) - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1); - else - dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me); - } - else - dm->drawFacesTex(dm, draw_tface__set_draw); -#ifdef WITH_VERSE - } -#endif - - /* draw game engine text hack - but not if we are editing the mesh */ - if (me->mtface && get_property(ob, "Text")) { - if(ob==G.obedit) - editing= 1; - else if(ob==OBACT) - if(FACESEL_PAINT_TEST) - editing= 1; - - if(!editing) - draw_game_text_mesh(ob, me); - } - - draw_textured_end(); - - /* draw edges and selected faces over textured mesh */ - if(!G.obedit && faceselect) - draw_tfaces3D(ob, me, dm); - - /* reset from negative scale correction */ - glFrontFace(GL_CCW); - - /* in editmode, the blend mode needs to be set incase it was ADD */ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -} - -void init_realtime_GL(void) -{ - glMatrixMode(GL_TEXTURE); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); -} - diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c deleted file mode 100644 index ea49c05b322..00000000000 --- a/source/blender/src/drawnla.c +++ /dev/null @@ -1,862 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef _WIN32 -#pragma warning (once : 4761) -#endif - -#include "BMF_Api.h" - -#include -#include -#include - -#include "DNA_view3d_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_object_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_action_types.h" -#include "DNA_nla_types.h" -#include "DNA_constraint_types.h" - -#include "BLI_blenlib.h" -#include "MEM_guardedalloc.h" - -#include "BKE_action.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" - -#include "BSE_drawnla.h" -#include "BSE_drawipo.h" -#include "BSE_editnla_types.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "BIF_editnla.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" - -#include "BDR_drawaction.h" -#include "BDR_editcurve.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -#define TESTBASE_SAFE(base) ((base)->flag & SELECT && ((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) - - -/* the left hand side with channels only */ -static void draw_nla_channels(void) -{ - bActionStrip *strip; - Base *base; - Object *ob; - float x, y; - short ofsx, ofsy = 0; - - myortho2(0, NLAWIDTH, G.v2d->cur.ymin, G.v2d->cur.ymax); // Scaling - - /* Clip to the scrollable area */ - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= curarea->winrct.xmin; - ofsy= curarea->winrct.ymin; - glViewport(ofsx, ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin)); - glScissor(ofsx, ofsy+G.v2d->mask.ymin, NLAWIDTH, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin)); - } - } - - glColor3ub(0x00, 0x00, 0x00); - - x = 0.0; - y = count_nla_levels(); - y*= (NLACHANNELHEIGHT+NLACHANNELSKIP); - - for (base=G.scene->base.first; base; base=base->next){ - if (nla_filter(base)) { - ob= base->object; - - BIF_ThemeColorShade(TH_HEADER, 20); - glRectf(x, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2); - - /* Draw the name / ipo timeline*/ - if (TESTBASE_SAFE(base)) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - glRasterPos2f(x+34, y-4); - BMF_DrawString(G.font, ob->id.name+2); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ; - - /* icon to indicate expanded or collapsed */ - if ((ob->nlastrips.first) || (ob->action)) { - if (ob->nlaflag & OB_NLA_COLLAPSED) - BIF_icon_draw(x+1, y-8, ICON_TRIA_RIGHT); - else - BIF_icon_draw(x+1, y-8, ICON_TRIA_DOWN); - } - - /* icon to indicate nla or action */ - if(ob->nlastrips.first && ob->action) { - if(ob->nlaflag & OB_NLA_OVERRIDE) - BIF_icon_draw(x+17, y-8, ICON_NLA); - else - BIF_icon_draw(x+17, y-8, ICON_ACTION); - } - - /* icon to indicate if ipo-channel muted */ - if (ob->ipo) { - if (ob->ipo->muteipo) - BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_ON); - else - BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_OFF); - } - - glDisable(GL_BLEND); - y-=NLACHANNELHEIGHT+NLACHANNELSKIP; - - /* check if object's nla strips are collapsed or not */ - if ((ob->nlaflag & OB_NLA_COLLAPSED)==0) { - /* Draw the action timeline */ - if (ob->action){ - BIF_ThemeColorShade(TH_HEADER, -20); - glRectf(x+19, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2); - - if (TESTBASE_SAFE(base)) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - glRasterPos2f(x+38, y-4); - BMF_DrawString(G.font, ob->action->id.name+2); - - /* icon for active action (no strip mapping) */ - for (strip = ob->nlastrips.first; strip; strip=strip->next) - if(strip->flag & ACTSTRIP_ACTIVE) break; - if(strip==NULL) { - glEnable(GL_BLEND); - BIF_icon_draw(x+5, y-8, ICON_DOT); - glDisable(GL_BLEND); - } - - y-=NLACHANNELHEIGHT+NLACHANNELSKIP; - } - - /* Draw the nla strips */ - for (strip = ob->nlastrips.first; strip; strip=strip->next){ - BIF_ThemeColorShade(TH_HEADER, -40); - glRectf(x+32, y-NLACHANNELHEIGHT/2, (float)NLAWIDTH, y+NLACHANNELHEIGHT/2); - - if (TESTBASE_SAFE(base)) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - - // why this test? check freeing mem when deleting strips? (ton) - if(strip->act) { - glRasterPos2f(x+48, y-4); - BMF_DrawString(G.font, strip->act->id.name+2); - - glEnable(GL_BLEND); - - if(strip->flag & ACTSTRIP_ACTIVE) - BIF_icon_draw(x+16, y-8, ICON_DOT); - - if(strip->modifiers.first) - BIF_icon_draw(x+34, y-8, ICON_MODIFIER); - - if(strip->flag & ACTSTRIP_MUTE) - BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_ON); - else - BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_MUTE_IPO_OFF); - - glDisable(GL_BLEND); - } - - y-=(NLACHANNELHEIGHT+NLACHANNELSKIP); - } - } - } - } - - myortho2(0, NLAWIDTH, 0, ( ofsy+G.v2d->mask.ymax)-( ofsy+G.v2d->mask.ymin)); // Scaling -} - -void map_active_strip(gla2DDrawInfo *di, Object *ob, int restore) -{ - static rctf stored; - - if(restore) - gla2DSetMap(di, &stored); - else { - rctf map; - - gla2DGetMap(di, &stored); - map= stored; - map.xmin= get_action_frame(ob, map.xmin); - map.xmax= get_action_frame(ob, map.xmax); - if(map.xmin==map.xmax) map.xmax+= 1.0; - gla2DSetMap(di, &map); - } -} - -/* the right hand side, with strips and keys */ -static void draw_nla_strips_keys(SpaceNla *snla) -{ - Base *base; - rcti scr_rct; - gla2DDrawInfo *di; - float y; - char col1[3], col2[3]; - - BIF_GetThemeColor3ubv(TH_SHADE2, col2); - BIF_GetThemeColor3ubv(TH_HILITE, col1); - - /* Draw strips */ - - scr_rct.xmin= snla->area->winrct.xmin + snla->v2d.mask.xmin; - scr_rct.ymin= snla->area->winrct.ymin + snla->v2d.mask.ymin; - scr_rct.xmax= snla->area->winrct.xmin + snla->v2d.hor.xmax; - scr_rct.ymax= snla->area->winrct.ymin + snla->v2d.mask.ymax; - di= glaBegin2DDraw(&scr_rct, &G.v2d->cur); - - y=count_nla_levels(); - y*= (NLACHANNELHEIGHT+NLACHANNELSKIP); - - for (base=G.scene->base.first; base; base=base->next){ - Object *ob= base->object; - bActionStrip *strip; - int frame1_x, channel_y; - - if (nla_filter(base)==0) - continue; - - /* Draw the field */ - glEnable (GL_BLEND); - if (TESTBASE_SAFE(base)) - glColor4ub (col1[0], col1[1], col1[2], 0x22); - else - glColor4ub (col2[0], col2[1], col2[2], 0x22); - - gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y); - glRectf(0, channel_y-NLACHANNELHEIGHT/2, frame1_x, channel_y+NLACHANNELHEIGHT/2); - - - if (TESTBASE_SAFE(base)) - glColor4ub (col1[0], col1[1], col1[2], 0x44); - else - glColor4ub (col2[0], col2[1], col2[2], 0x44); - glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2); - - glDisable (GL_BLEND); - - /* Draw the ipo keys */ - draw_object_channel(di, ob, y); - - y-=NLACHANNELHEIGHT+NLACHANNELSKIP; - - /* check if object nla-strips expanded or not */ - if (ob->nlaflag & OB_NLA_COLLAPSED) - continue; - - - /* Draw the action strip */ - if (ob->action) { - - /* Draw the field */ - glEnable (GL_BLEND); - if (TESTBASE_SAFE(base)) - glColor4ub (col1[0], col1[1], col1[2], 0x22); - else - glColor4ub (col2[0], col2[1], col2[2], 0x22); - - gla2DDrawTranslatePt(di, 1, y, &frame1_x, &channel_y); - glRectf(0, channel_y-NLACHANNELHEIGHT/2+4, frame1_x, channel_y+NLACHANNELHEIGHT/2-4); - - if (TESTBASE_SAFE(base)) - glColor4ub (col1[0], col1[1], col1[2], 0x44); - else - glColor4ub (col2[0], col2[1], col2[2], 0x44); - glRectf(frame1_x, channel_y-NLACHANNELHEIGHT/2+4, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2-4); - - glDisable (GL_BLEND); - - /* Draw the action keys, optionally corrected for active strip */ - map_active_strip(di, ob, 0); - draw_action_channel(di, ob->action, y); - map_active_strip(di, ob, 1); - - y-=NLACHANNELHEIGHT+NLACHANNELSKIP; - - } - - /* Draw the nla strips */ - for (strip=ob->nlastrips.first; strip; strip=strip->next){ - int stripstart, stripend; - int blendstart, blendend; - - /* Draw rect */ - if (strip->flag & ACTSTRIP_SELECT) - BIF_ThemeColor(TH_STRIP_SELECT); - else - BIF_ThemeColor(TH_STRIP); - - gla2DDrawTranslatePt(di, strip->start+strip->blendin, y, &stripstart, &channel_y); - gla2DDrawTranslatePt(di, strip->end-strip->blendout, y, &stripend, &channel_y); - glRectf(stripstart, channel_y-NLACHANNELHEIGHT/2+3, stripend, channel_y+NLACHANNELHEIGHT/2-3); - - if (strip->flag & ACTSTRIP_SELECT) - BIF_ThemeColorShade(TH_STRIP_SELECT, -60); - else - BIF_ThemeColorShade(TH_STRIP, -60); - - /* Draw blendin */ - if (strip->blendin>0){ - glBegin(GL_TRIANGLES); - - gla2DDrawTranslatePt(di, strip->start, y, &blendstart, &channel_y); - - glVertex2f(blendstart, channel_y-NLACHANNELHEIGHT/2+3); - glVertex2f(stripstart, channel_y+NLACHANNELHEIGHT/2-3); - glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); - - - glEnd(); - } - if (strip->blendout>0){ - glBegin(GL_TRIANGLES); - - gla2DDrawTranslatePt(di, strip->end, y, &blendend, &channel_y); - - glVertex2f(blendend, channel_y-NLACHANNELHEIGHT/2+3); - glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3); - glVertex2f(stripend, channel_y-NLACHANNELHEIGHT/2+3); - glEnd(); - } - - gla2DDrawTranslatePt(di, strip->start, y, &stripstart, &channel_y); - gla2DDrawTranslatePt(di, strip->end, y, &stripend, &channel_y); - - /* muted strip */ - if(strip->flag & ACTSTRIP_MUTE) { - glColor3f(1, 0, 0); - glBegin(GL_LINES); - glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); - glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3); - glEnd(); - } - - /* Draw border */ - glEnable (GL_BLEND); - glBegin(GL_LINE_STRIP); - glColor4f(1, 1, 1, 0.7); - - glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); - glVertex2f(stripstart, channel_y+NLACHANNELHEIGHT/2-3); - glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3); - glColor4f(0, 0, 0, 0.7); - glVertex2f(stripend, channel_y-NLACHANNELHEIGHT/2+3); - glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); - glEnd(); - - /* Show strip extension */ - if (strip->flag & ACTSTRIP_HOLDLASTFRAME){ - if (strip->flag & ACTSTRIP_SELECT) - BIF_ThemeColorShadeAlpha(TH_STRIP_SELECT, 0, -180); - else - BIF_ThemeColorShadeAlpha(TH_STRIP, 0, -180); - - glRectf(stripend, channel_y-NLACHANNELHEIGHT/2+4, G.v2d->hor.xmax, channel_y+NLACHANNELHEIGHT/2-2); - } - - /* Show repeat */ - if (strip->repeat > 1.0 && !(strip->flag & ACTSTRIP_USESTRIDE)){ - float rep = 1; - glBegin(GL_LINES); - while (reprepeat){ - /* Draw line */ - glColor4f(0, 0, 0, 0.5); - gla2DDrawTranslatePt(di, strip->start+(rep*((strip->end-strip->start)/strip->repeat)), y, &frame1_x, &channel_y); - glVertex2f(frame1_x, channel_y-NLACHANNELHEIGHT/2+4); - glVertex2f(frame1_x, channel_y+NLACHANNELHEIGHT/2-2); - - glColor4f(1.0, 1.0, 1.0, 0.5); - gla2DDrawTranslatePt(di, strip->start+(rep*((strip->end-strip->start)/strip->repeat)), y, &frame1_x, &channel_y); - glVertex2f(frame1_x+1, channel_y-NLACHANNELHEIGHT/2+4); - glVertex2f(frame1_x+1, channel_y+NLACHANNELHEIGHT/2-2); - rep+=1.0; - } - glEnd(); - - } - glDisable (GL_BLEND); - - y-=(NLACHANNELHEIGHT+NLACHANNELSKIP); - } - } - glaEnd2DDraw(di); - -} - -/* ******* panel *********** */ - -#define B_NLA_PANEL 121 -#define B_NLA_LOCK 122 -#define B_NLA_SCALE 123 -#define B_NLA_SCALE2 124 -#define B_NLA_MOD_ADD 125 -#define B_NLA_MOD_NEXT 126 -#define B_NLA_MOD_PREV 127 -#define B_NLA_MOD_DEL 128 -#define B_NLA_MOD_DEPS 129 - -/* For now just returns the first selected strip */ -bActionStrip *get_active_nlastrip(Object **obpp) -{ - Base *base; - bActionStrip *strip; - - for (base=G.scene->base.first; base; base=base->next){ - if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) { - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT) { - *obpp= base->object; - return strip; - } - } - } - } - - return NULL; -} - -void do_nlabuts(unsigned short event) -{ - Object *ob; - bActionStrip *strip; - - /* Determine if an nla strip has been selected */ - strip = get_active_nlastrip(&ob); - if (!strip) return; - - switch(event) { - case B_REDR: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWNLA, 0); - break; - case B_NLA_PANEL: - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWVIEW3D, 0); - break; - case B_NLA_SCALE: - { - float actlen= strip->actend - strip->actstart; - float mapping= strip->scale * strip->repeat; - - strip->end = (actlen * mapping) + strip->start; - - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWVIEW3D, 0); - } - break; - case B_NLA_SCALE2: - { - float actlen= strip->actend - strip->actstart; - float len= strip->end - strip->start; - - strip->scale= len / (actlen * strip->repeat); - - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWVIEW3D, 0); - } - break; - case B_NLA_LOCK: - synchronize_action_strips(); - - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWVIEW3D, 0); - break; - - case B_NLA_MOD_ADD: - { - bActionModifier *amod= MEM_callocN(sizeof(bActionModifier), "bActionModifier"); - - BLI_addtail(&strip->modifiers, amod); - strip->curmod= BLI_countlist(&strip->modifiers)-1; - allqueue (REDRAWNLA, 0); - } - break; - case B_NLA_MOD_DEL: - if(strip->modifiers.first) { - bActionModifier *amod= BLI_findlink(&strip->modifiers, strip->curmod); - BLI_remlink(&strip->modifiers, amod); - MEM_freeN(amod); - if(strip->curmod) strip->curmod--; - allqueue (REDRAWNLA, 0); - } - break; - case B_NLA_MOD_NEXT: - if(strip->curmod < BLI_countlist(&strip->modifiers)-1) - strip->curmod++; - allqueue (REDRAWNLA, 0); - break; - case B_NLA_MOD_PREV: - if(strip->curmod > 0) - strip->curmod--; - allqueue (REDRAWNLA, 0); - break; - case B_NLA_MOD_DEPS: - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); - break; - } -} - -static char *make_modifier_menu(ListBase *lb) -{ - bActionModifier *amod; - int index= 1; - char *str, item[64], *types[3]={"Deform", "Noise", "Oomph"}; - - for (amod = lb->first; amod; amod=amod->next, index++); - str= MEM_mallocN(index*64, "key string"); - str[0]= 0; - - index= 0; - for (amod = lb->first; amod; amod=amod->next, index++) { - sprintf (item, "|%s %s%%x%d", types[amod->type], amod->channel, index); - strcat(str, item); - } - - return str; -} - - -static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES -{ - Object *ob; - bActionStrip *strip; - uiBlock *block; - uiBut *but; - - block= uiNewBlock(&curarea->uiblocks, "nla_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(NLA_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Transform Properties", "NLA", 10, 230, 318, 224)==0) return; - - /* Determine if an nla strip has been selected */ - strip = get_active_nlastrip(&ob); - if (!strip) return; - - /* first labels, for simpler align code :) */ - uiDefBut(block, LABEL, 0, "Timeline Range:", 10,180,300,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Blending:", 10,120,150,19, 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL, 0, "Options:", 160,120,150,19, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NLA_PANEL, "Strip Start:", 10,160,150,19, &strip->start, -1000.0, strip->end-1, 100, 0, "First frame in the timeline"); - uiDefButF(block, NUM, B_NLA_SCALE2, "Strip End:", 160,160,150,19, &strip->end, strip->start+1, MAXFRAMEF, 100, 0, "Last frame in the timeline"); - - uiDefIconButBitS(block, ICONTOG, ACTSTRIP_LOCK_ACTION, B_NLA_LOCK, ICON_UNLOCKED, 10,140,20,19, &(strip->flag), 0, 0, 0, 0, "Toggles Action end/start to be automatic mapped to strip duration"); - if(strip->flag & ACTSTRIP_LOCK_ACTION) { - char str[40]; - sprintf(str, "Action Start: %.2f", strip->actstart); - uiDefBut(block, LABEL, B_NOP, str, 30,140,140,19, NULL, 0.0, 0.0, 0, 0, "First frame of the action to map to the playrange"); - sprintf(str, "Action End: %.2f", strip->actend); - uiDefBut(block, LABEL, B_NOP, str, 170,140,140,19, NULL, 0.0, 0.0, 0, 0, "Last frame of the action to map to the playrange"); - } - else { - uiDefButF(block, NUM, B_NLA_PANEL, "Action Start:", 30,140,140,19, &strip->actstart, -1000.0, strip->actend-1, 100, 0, "First frame of the action to map to the playrange"); - uiDefButF(block, NUM, B_NLA_PANEL, "Action End:", 170,140,140,19, &strip->actend, strip->actstart+1, MAXFRAMEF, 100, 0, "Last frame of the action to map to the playrange"); - } - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ACTSTRIP_AUTO_BLENDS, B_NLA_LOCK, "Auto-Blending", 10,100,145,19, &(strip->flag), 0, 0, 0, 0, "Toggles automatic calculation of blendin/out values"); - if (strip->flag & ACTSTRIP_AUTO_BLENDS) { - char str[32]; - sprintf(str, "In: %.2f", strip->blendin); - uiDefBut(block, LABEL, B_NOP, str, 10,80,77,19, NULL, 0.0, 0.0, 0, 0, "Number of frames of ease-in"); - sprintf(str, "Out: %.2f", strip->blendout); - uiDefBut(block, LABEL, B_NOP, str, 77,80,78,19, NULL, 0.0, 0.0, 0, 0, "Number of frames of ease-out"); - } - else { - uiDefButF(block, NUM, B_NLA_PANEL, "In:", 10,80,77,19, &strip->blendin, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-in"); - uiDefButF(block, NUM, B_NLA_PANEL, "Out:", 77,80,78,19, &strip->blendout, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-out"); - } - uiDefButBitS(block, TOG, ACTSTRIP_MUTE, B_NLA_PANEL, "Mute", 10,60,145,19, &strip->flag, 0, 0, 0, 0, "Toggles whether the strip contributes to the NLA solution"); - - uiBlockBeginAlign(block); - // FIXME: repeat and scale are too cramped! - uiDefButF(block, NUM, B_NLA_SCALE, "Repeat:", 160,100,75,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat"); - if ((strip->actend - strip->actstart) < 1.0f) { - uiBlockSetCol(block, TH_REDALERT); - uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Please run Alt-S to fix up this error"); - uiBlockSetCol(block, TH_AUTO); - } - else - uiDefButF(block, NUM, B_NLA_SCALE, "Scale:", 235,100,75,19, &strip->scale, 0.001, 1000.0f, 100, 0, "Amount the action should be scaled by"); - but= uiDefButC(block, TEX, B_NLA_PANEL, "OffsBone:", 160,80,150,19, strip->offs_bone, 0, 31.0f, 0, 0, "Name of Bone that defines offset for repeat"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - uiDefButBitS(block, TOG, ACTSTRIP_HOLDLASTFRAME, B_NLA_PANEL, "Hold", 160,60,75,19, &strip->flag, 0, 0, 0, 0, "Toggles whether to continue displaying the last frame past the end of the strip"); - uiDefButS(block, TOG, B_NLA_PANEL, "Add", 235,60,75,19, &strip->mode, 0, 0, 0, 0, "Toggles additive blending mode"); - - uiBlockEndAlign(block); - - uiDefButBitS(block, TOG, ACTSTRIP_USESTRIDE, B_NLA_PANEL, "Stride Path", 10, 30,140,19, &strip->flag, 0, 0, 0, 0, "Plays action based on path position & stride"); - - if (strip->offs_bone[0]) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEX, B_NLA_PANEL, "Use X", 160,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use X as an offset axis. Note that you can use multiple axes at once."); - uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEY, B_NLA_PANEL, "Use Y", 210,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use Y as an offset axis. Note that you can use multiple axes at once."); - uiDefButBitS(block, TOG, ACTSTRIP_CYCLIC_USEZ, B_NLA_PANEL, "Use Z", 260,30,50,19, &strip->flag, 0, 0, 0, 0, "Turn off automatic single-axis cycling and use Z as an offset axis. Note that you can use multiple axes at once."); - uiBlockEndAlign(block); - } - - if(ob->dup_group) - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_NLA_PANEL, "Target:", 160,30, 150, 19, &strip->object, "Target Object in this group"); - - if(strip->flag & ACTSTRIP_USESTRIDE) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_DISABLE_PATH, B_NLA_PANEL, "Disable", 10,0,60,19, &ob->ipoflag, 0, 0, 0, 0, "Disable path temporally, for editing cycles"); - - uiDefButF(block, NUM, B_NLA_PANEL, "Offs:", 70,0,120,19, &strip->actoffs, -500, 500.0, 100, 0, "Action offset in frames to tweak cycle of the action within the stride"); - uiDefButF(block, NUM, B_NLA_PANEL, "Stri:", 190,0,120,19, &strip->stridelen, 0.0001, 1000.0, 100, 0, "Distance covered by one complete cycle of the action specified in the Action Range"); - - uiDefButS(block, ROW, B_NLA_PANEL, "X", 10, -20, 33, 19, &strip->stride_axis, 1, 0, 0, 0, "Dominant axis for Stride Bone"); - uiDefButS(block, ROW, B_NLA_PANEL, "Y", 43, -20, 33, 19, &strip->stride_axis, 1, 1, 0, 0, "Dominant axis for Stride Bone"); - uiDefButS(block, ROW, B_NLA_PANEL, "Z", 76, -20, 34, 19, &strip->stride_axis, 1, 2, 0, 0, "Dominant axis for Stride Bone"); - - but= uiDefBut(block, TEX, B_NLA_PANEL, "Stride Bone:", 110, -20, 200, 19, strip->stridechannel, 1, 31, 0, 0, "Name of Bone used for stride"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - } - else { /* modifiers */ - bActionModifier *amod= BLI_findlink(&strip->modifiers, strip->curmod); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_NLA_MOD_ADD, "Add Modifier", 10,0,140,19, NULL, 0, 0, 0, 0, ""); - if(amod) { - char *strp= make_modifier_menu(&strip->modifiers); - - uiDefIconBut(block, BUT, B_NLA_MOD_NEXT, ICON_TRIA_LEFT, 150,0,20,19, NULL, 0, 0, 0, 0, "Previous Modifier"); - uiDefButS(block, MENU, B_NLA_PANEL, strp, 170,0,20,19, &strip->curmod, 0, 0, 0, 0, "Browse modifier"); - MEM_freeN(strp); - uiDefIconBut(block, BUT, B_NLA_MOD_PREV, ICON_TRIA_RIGHT, 190,0,20,19, NULL, 0, 0, 0, 0, "Next Modifier"); - uiDefButS(block, MENU, B_REDR, "Deform %x0|Noise %x1|Oomph %x2", 210,0,80,19, &amod->type, 0, 0, 0, 0, "Modifier type"); - uiDefIconBut(block, BUT, B_NLA_MOD_DEL, ICON_X, 290,0,20,19, NULL, 0, 0, 0, 0, "Delete Modifier"); - - if(amod->type==ACTSTRIP_MOD_DEFORM) { - but= uiDefBut(block, TEX, B_NLA_PANEL, "Chan:", 10, -20, 130, 19, amod->channel, 1, 31, 0, 0, "Name of channel used for modifier"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - uiDefButS(block, MENU, B_REDR, "All%x0|XY%x3|XZ%x2|YZ%x1", 140,-20,40,19, &amod->no_rot_axis, 0, 0, 0, 0, "Enable rotation axes (local for curve)"); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_NLA_MOD_DEPS, "Ob:", 180,-20, 130, 19, &amod->ob, "Curve Object"); - } -#if 0 /* this is not really ready for the primetime yet, but is here for testing */ - else if(amod->type==ACTSTRIP_MOD_NOISE) { - but= uiDefBut(block, TEX, B_NLA_PANEL, "Chan:", 10, -20, 130, 19, amod->channel, 1, 31, 0, 0, "Name of channel used for modifier"); - uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - uiDefButBitS(block, TOG, 1, B_NLA_PANEL, "L", 140, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Location of channel"); - uiDefButBitS(block, TOG, 2, B_NLA_PANEL, "R", 160, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Rotation of channel"); - uiDefButBitS(block, TOG, 4, B_NLA_PANEL, "S", 180, -20, 20, 19, &amod->channels, 0, 24, 0, 0, "Apply noise to Scaling of channel"); - uiDefButF(block, NUM, B_NLA_PANEL, "NSize:", 200,-20,55,19, &amod->noisesize, 0.0001, 2.0, 10, 0, "Sets scaling for noise input"); - uiDefButF(block, NUM, B_NLA_PANEL, "Turb:", 255,-20,55,19, &amod->turbul, 0.0, 200.0, 10, 0, "Sets the depth of the noise"); - } -#endif - else - uiDefBut(block, LABEL, B_NOP, "Ack! Not implemented.", 10, -20, 150, 19, NULL, 0, 0, 0, 0, ""); - - } - else { /* for panel aligning */ - uiBlockEndAlign(block); - uiDefBut(block, LABEL, B_NOP, " ", 10, -20, 150, 19, NULL, 0, 0, 0, 0, ""); - } - } -} - -static void nla_blockhandlers(ScrArea *sa) -{ - SpaceNla *snla= sa->spacedata.first; - short a; - - for(a=0; ablockhandler[a]) { - - case NLA_HANDLER_PROPERTIES: - nla_panel_properties(snla->blockhandler[a+1]); - break; - - } - /* clear action value for event */ - snla->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); -} - - -void drawnlaspace(ScrArea *sa, void *spacedata) -{ - float col[3]; - short ofsx = 0, ofsy = 0; - - uiFreeBlocksWin(&sa->uiblocks, sa->win); /* for panel handler to work */ - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) ; - - calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy); - - /* clear all, becomes the color for left part */ - BIF_GetThemeColor3fv(TH_HEADER, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= curarea->winrct.xmin; - ofsy= curarea->winrct.ymin; - glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - } - } - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - /* Draw backdrop */ - calc_ipogrid(); - draw_ipogrid(); - - /* the right hand side, with strips and keys */ - draw_nla_strips_keys(G.snla); - - - glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - - /* Draw current frame */ - draw_cfra_action(); - - /* draw markers */ - draw_markers_timespace(0); - - /* Draw preview 'curtains' */ - draw_anim_preview_timespace(); - - /* Draw scroll */ - mywinset(curarea->win); // reset scissor too - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - if(G.v2d->scroll) drawscroll(0); - } - if(G.v2d->mask.xmin!=0) { - /* Draw channel names */ - draw_nla_channels(); - } - mywinset(curarea->win); // reset scissor too - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - draw_area_emboss(sa); - - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, G.snla->blockscale, G.snla->blockscale, G.snla->blockscale); - nla_blockhandlers(sa); - - curarea->win_swap= WIN_BACK_OK; -} - -int count_nla_levels(void) -{ - Base *base; - int y= 0; - - for (base=G.scene->base.first; base; base=base->next) { - if (nla_filter(base)) { - /* object level */ - y++; - - /* nla strips for object collapsed? */ - if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) { - if(base->object->action) - y++; - - /* Nla strips */ - y+= BLI_countlist(&base->object->nlastrips); - } - } - } - - return y; -} - -int nla_filter (Base *base) -{ - Object *ob = base->object; - - if ((G.snla->flag & SNLA_ALLKEYED) || (base->lay & G.scene->lay)) { - if(ob->action || ob->nlastrips.first) - return 1; - - /* should become option */ - if (ob->ipo) - return 1; - - if (ob->constraintChannels.first) - return 1; - } - return 0; -} - diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c deleted file mode 100644 index b0c55d104f3..00000000000 --- a/source/blender/src/drawnode.c +++ /dev/null @@ -1,2886 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_color_types.h" -#include "DNA_customdata_types.h" -#include "DNA_ipo_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_node.h" -#include "BKE_object.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "CMP_node.h" -#include "SHD_node.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_language.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" - -#include "BSE_drawipo.h" -#include "BSE_node.h" -#include "BSE_view.h" - -#include "BMF_Api.h" - -#include "MEM_guardedalloc.h" - -#include "RE_pipeline.h" -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "butspace.h" -#include "interface.h" /* urm... for rasterpos_safe, roundbox */ -#include "mydevice.h" - -extern void autocomplete_uv(char *str, void *arg_v); -extern int verify_valid_uv_name(char *str); - -/* autocomplete callback for buttons */ -static void autocomplete_vcol(char *str, void *arg_v) -{ - Mesh *me; - CustomDataLayer *layer; - AutoComplete *autocpl; - int a; - - if(str[0]==0) - return; - - autocpl= autocomplete_begin(str, 32); - - /* search if str matches the beginning of name */ - for(me= G.main->mesh.first; me; me=me->id.next) - for(a=0, layer= me->fdata.layers; afdata.totlayer; a++, layer++) - if(layer->type == CD_MCOL) - autocomplete_do_name(autocpl, layer->name); - - autocomplete_end(autocpl, str); -} - -static int verify_valid_vcol_name(char *str) -{ - Mesh *me; - CustomDataLayer *layer; - int a; - - if(str[0]==0) - return 1; - - /* search if str matches the name */ - for(me= G.main->mesh.first; me; me=me->id.next) - for(a=0, layer= me->fdata.layers; afdata.totlayer; a++, layer++) - if(layer->type == CD_MCOL) - if(strcmp(layer->name, str)==0) - return 1; - - return 0; -} - -static void snode_drawstring(SpaceNode *snode, char *str, int okwidth) -{ - char drawstr[NODE_MAXSTR]; - int width; - - if(str[0]==0 || okwidth<4) return; - - BLI_strncpy(drawstr, str, NODE_MAXSTR); - width= snode->aspect*BIF_GetStringWidth(snode->curfont, drawstr, 0); - - if(width > okwidth) { - int len= strlen(drawstr)-1; - - while(width > okwidth && len>=0) { - drawstr[len]= 0; - - width= snode->aspect*BIF_GetStringWidth(snode->curfont, drawstr, 0); - len--; - } - if(len==0) return; - } - BIF_DrawString(snode->curfont, drawstr, 0); - -} - -/* ************** Socket callbacks *********** */ - -static void socket_vector_menu_cb(void *node_v, void *ntree_v) -{ - if(node_v && ntree_v) { - NodeTagChanged(ntree_v, node_v); - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+((bNode *)node_v)->nr); - } -} - -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *socket_vector_menu(void *socket_v) -{ - SpaceNode *snode= curarea->spacedata.first; - bNode *node; - bNodeSocket *sock= socket_v; - bNodeStack *ns= &sock->ns; - uiBlock *block; - uiBut *bt; - - /* a bit ugly... retrieve the node the socket comes from */ - for(node= snode->nodetree->nodes.first; node; node= node->next) { - bNodeSocket *sockt; - for(sockt= node->inputs.first; sockt; sockt= sockt->next) - if(sockt==sock) - break; - if(sockt) - break; - } - - block= uiNewBlock(&curarea->uiblocks, "socket menu", UI_EMBOSS, UI_HELV, curarea->win); - - /* use this for a fake extra empy space around the buttons */ - uiDefBut(block, LABEL, 0, "", -4, -4, 188, 68, NULL, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - bt= uiDefButF(block, NUMSLI, 0, "X ", 0,40,180,20, ns->vec, ns->min, ns->max, 10, 0, ""); - uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree); - bt= uiDefButF(block, NUMSLI, 0, "Y ", 0,20,180,20, ns->vec+1, ns->min, ns->max, 10, 0, ""); - uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree); - bt= uiDefButF(block, NUMSLI, 0, "Z ", 0,0,180,20, ns->vec+2, ns->min, ns->max, 10, 0, ""); - uiButSetFunc(bt, socket_vector_menu_cb, node, snode->nodetree); - - uiBlockSetDirection(block, UI_TOP); - - allqueue(REDRAWNODE, 0); - - return block; -} - -static void node_sync_cb(void *snode_v, void *node_v) -{ - SpaceNode *snode= snode_v; - - if(snode->treetype==NTREE_SHADER) { - nodeShaderSynchronizeID(node_v, 1); - allqueue(REDRAWBUTSSHADING, 0); - } -} - -/* ****************** GENERAL CALLBACKS FOR NODES ***************** */ - -static void node_ID_title_cb(void *node_v, void *unused_v) -{ - bNode *node= node_v; - - if(node->id) { - test_idbutton(node->id->name+2); /* library.c, verifies unique name */ - BLI_strncpy(node->name, node->id->name+2, 21); - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWOOPS, 0); - } -} - - -static void node_but_title_cb(void *node_v, void *but_v) -{ - bNode *node= node_v; - uiBut *bt= but_v; - BLI_strncpy(node->name, bt->drawstr, NODE_MAXSTR); - - allqueue(REDRAWNODE, 0); -} - - -/* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ - -static int node_buts_group(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block && node->id) { - uiBut *bt; - short width; - - uiBlockBeginAlign(block); - - /* name button */ - width= (short)(butr->xmax-butr->xmin - (node->id->us>1?19.0f:0.0f)); - bt= uiDefBut(block, TEX, B_NOP, "NT:", - butr->xmin, butr->ymin, width, 19, - node->id->name+2, 0.0, 19.0, 0, 0, "NodeTree name"); - uiButSetFunc(bt, node_ID_title_cb, node, NULL); - - /* user amount */ - if(node->id->us>1) { - char str1[32]; - sprintf(str1, "%d", node->id->us); - bt= uiDefBut(block, BUT, B_NOP, str1, - butr->xmax-19, butr->ymin, 19, 19, - NULL, 0, 0, 0, 0, "Displays number of users."); - //uiButSetFunc(bt, node_mat_alone_cb, node, NULL); - } - - uiBlockEndAlign(block); - } - return 19; -} - -static int node_buts_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores value */ - - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - sock->ns.vec, sock->ns.min, sock->ns.max, 10, 2, ""); - - } - return 20; -} - -static int node_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores value */ - if(sock) { - /* enforce square box drawing */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - uiDefButF(block, HSVCUBE, B_NODE_EXEC+node->nr, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, - sock->ns.vec, 0.0f, 1.0f, 3, 0, ""); - uiDefButF(block, HSVCUBE, B_NODE_EXEC+node->nr, "", - butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15, - sock->ns.vec, 0.0f, 1.0f, 2, 0, ""); - uiDefButF(block, COL, B_NOP, "", - butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12, - sock->ns.vec, 0.0, 0.0, -1, 0, ""); - /* the -1 above prevents col button to popup a color picker */ - - uiBlockSetEmboss(block, UI_EMBOSS); - } - } - return 30 + (int)(node->width-NODE_DY); -} - -static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - int a_but= (ntree->type==NTREE_COMPOSIT); - - /* blend type */ - uiBlockBeginAlign(block); - bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Mix %x0|Add %x1|Subtract %x3|Multiply %x2|Screen %x4|Overlay %x9|Divide %x5|Difference %x6|Darken %x7|Lighten %x8|Dodge %x10|Burn %x11|Color %x15|Value %x14|Saturation %x13|Hue %x12", - butr->xmin, butr->ymin, butr->xmax-butr->xmin -(a_but?20:0), 20, - &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); - /* Alpha option, composite */ - if(a_but) - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "A", - butr->xmax-20, butr->ymin, 20, 20, - &node->custom2, 0, 0, 0, 0, "Include Alpha of 2nd input in this operation"); - } - return 20; -} - -static int node_buts_time(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - CurveMapping *cumap= node->storage; - short dx= (short)((butr->xmax-butr->xmin)/2); - butr->ymin += 26; - - curvemap_buttons(block, node->storage, 's', B_NODE_EXEC+node->nr, B_REDR, butr); - - if(cumap) cumap->flag |= CUMA_DRAW_CFRA; - if(node->custom1custom2) - cumap->black[0]= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Sta:", - butr->xmin, butr->ymin-22, dx, 19, - &node->custom1, 1.0, 20000.0, 0, 0, "Start frame"); - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "End:", - butr->xmin+dx, butr->ymin-22, dx, 19, - &node->custom2, 1.0, 20000.0, 0, 0, "End frame"); - } - - return node->width-NODE_DY; -} - -static int node_buts_valtorgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - if(node->storage) { - draw_colorband_buts_small(block, node->storage, butr, B_NODE_EXEC+node->nr); - } - } - return 40; -} - -static int node_buts_curvevec(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - curvemap_buttons(block, node->storage, 'v', B_NODE_EXEC+node->nr, B_REDR, butr); - } - return (int)(node->width-NODE_DY); -} - -static int node_buts_curvecol(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - curvemap_buttons(block, node->storage, 'c', B_NODE_EXEC+node->nr, B_REDR, butr); - } - return (int)(node->width-NODE_DY); -} - -static int node_buts_normal(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - bNodeSocket *sock= node->outputs.first; /* first socket stores normal */ - - uiDefButF(block, BUT_NORMAL, B_NODE_EXEC+node->nr, "", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, butr->ymax-butr->ymin, - sock->ns.vec, 0.0f, 1.0f, 0, 0, ""); - - } - return (int)(node->width-NODE_DY); -} - -static void node_browse_tex_cb(void *ntree_v, void *node_v) -{ - bNodeTree *ntree= ntree_v; - bNode *node= node_v; - Tex *tex; - - if(node->menunr<1) return; - - if(node->id) { - node->id->us--; - node->id= NULL; - } - tex= BLI_findlink(&G.main->tex, node->menunr-1); - - node->id= &tex->id; - id_us_plus(node->id); - BLI_strncpy(node->name, node->id->name+2, 21); - - nodeSetActive(ntree, node); - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - NodeTagChanged(ntree, node); - - node->menunr= 0; -} - -static int node_buts_texture(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - char *strp; - - /* browse button texture */ - uiBlockBeginAlign(block); - IDnames_to_pupstring(&strp, NULL, "", &(G.main->tex), NULL, NULL); - node->menunr= 0; - bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp, - butr->xmin, butr->ymin, 20, 19, - &node->menunr, 0, 0, 0, 0, "Browse texture"); - uiButSetFunc(bt, node_browse_tex_cb, ntree, node); - if(strp) MEM_freeN(strp); - - if(node->id) { - bt= uiDefBut(block, TEX, B_NOP, "TE:", - butr->xmin+19, butr->ymin, butr->xmax-butr->xmin-19, 19, - node->id->name+2, 0.0, 19.0, 0, 0, "Texture name"); - uiButSetFunc(bt, node_ID_title_cb, node, NULL); - } - - } - return 19; -} - -static int node_buts_math(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - - bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Multiply %x2|Divide %x3|Sine %x4|Cosine %x5|Tangent %x6|Arcsine %x7|Arccosine %x8|Arctangent %x9|Power %x10|Logarithm %x11|Minimum %x12|Maximum %x13|Round %x14", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); - } - return 20; -} - - -/* ****************** BUTTON CALLBACKS FOR SHADER NODES ***************** */ - - -static void node_mat_alone_cb(void *node_v, void *unused) -{ - bNode *node= node_v; - - node->id= (ID *)copy_material((Material *)node->id); - - BIF_undo_push("Single user material"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWOOPS, 0); -} - -static void node_browse_mat_cb(void *ntree_v, void *node_v) -{ - bNodeTree *ntree= ntree_v; - bNode *node= node_v; - - if(node->menunr<1) return; - - if(node->menunr==32767) { /* code for Add New */ - if(node->id) { - /* make copy, but make sure it doesnt have the node tag nor nodes */ - Material *ma= (Material *)node->id; - ma->id.us--; - ma= copy_material(ma); - ma->use_nodes= 0; - if(ma->nodetree) { - ntreeFreeTree(ma->nodetree); - MEM_freeN(ma->nodetree); - } - ma->nodetree= NULL; - node->id= (ID *)ma; - } - else node->id= (ID *)add_material("MatNode"); - } - else { - if(node->id) node->id->us--; - node->id= BLI_findlink(&G.main->mat, node->menunr-1); - id_us_plus(node->id); - } - BLI_strncpy(node->name, node->id->name+2, 21); - - nodeSetActive(ntree, node); - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - BIF_preview_changed(ID_MA); - - node->menunr= 0; -} - -static void node_new_mat_cb(void *ntree_v, void *node_v) -{ - bNodeTree *ntree= ntree_v; - bNode *node= node_v; - - node->id= (ID *)add_material("MatNode"); - BLI_strncpy(node->name, node->id->name+2, 21); - - nodeSetActive(ntree, node); - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - BIF_preview_changed(ID_MA); - -} - -static void node_texmap_cb(void *texmap_v, void *unused_v) -{ - init_mapping(texmap_v); -} - -static int node_shader_buts_material(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - short dx= (short)((butr->xmax-butr->xmin)/3.0f), has_us= (node->id && node->id->us>1); - short dy= (short)butr->ymin; - char *strp; - - /* WATCH IT: we use this callback in material buttons, but then only want first row */ - if(butr->ymax-butr->ymin > 21.0f) dy+= 19; - - uiBlockBeginAlign(block); - if(node->id==NULL) uiBlockSetCol(block, TH_REDALERT); - else if(has_us) uiBlockSetCol(block, TH_BUT_SETTING1); - else uiBlockSetCol(block, TH_BUT_SETTING2); - - /* browse button */ - IDnames_to_pupstring(&strp, NULL, "ADD NEW %x32767", &(G.main->mat), NULL, NULL); - node->menunr= 0; - bt= uiDefButS(block, MENU, B_NOP, strp, - butr->xmin, dy, 19, 19, - &node->menunr, 0, 0, 0, 0, "Browses existing choices or adds NEW"); - uiButSetFunc(bt, node_browse_mat_cb, ntree, node); - if(strp) MEM_freeN(strp); - - /* Add New button */ - if(node->id==NULL) { - bt= uiDefBut(block, BUT, B_NOP, "Add New", - butr->xmin+19, dy, (short)(butr->xmax-butr->xmin-19.0f), 19, - NULL, 0.0, 0.0, 0, 0, "Add new Material"); - uiButSetFunc(bt, node_new_mat_cb, ntree, node); - uiBlockSetCol(block, TH_AUTO); - } - else { - /* name button */ - short width= (short)(butr->xmax-butr->xmin-19.0f - (has_us?19.0f:0.0f)); - bt= uiDefBut(block, TEX, B_NOP, "MA:", - butr->xmin+19, dy, width, 19, - node->id->name+2, 0.0, 19.0, 0, 0, "Material name"); - uiButSetFunc(bt, node_ID_title_cb, node, NULL); - - /* user amount */ - if(has_us) { - char str1[32]; - sprintf(str1, "%d", node->id->us); - bt= uiDefBut(block, BUT, B_NOP, str1, - butr->xmax-19, dy, 19, 19, - NULL, 0, 0, 0, 0, "Displays number of users. Click to make a single-user copy."); - uiButSetFunc(bt, node_mat_alone_cb, node, NULL); - } - - /* WATCH IT: we use this callback in material buttons, but then only want first row */ - if(butr->ymax-butr->ymin > 21.0f) { - /* node options */ - uiBlockSetCol(block, TH_AUTO); - uiDefButBitS(block, TOG, SH_NODE_MAT_DIFF, B_NODE_EXEC+node->nr, "Diff", - butr->xmin, butr->ymin, dx, 19, - &node->custom1, 0, 0, 0, 0, "Material Node outputs Diffuse"); - uiDefButBitS(block, TOG, SH_NODE_MAT_SPEC, B_NODE_EXEC+node->nr, "Spec", - butr->xmin+dx, butr->ymin, dx, 19, - &node->custom1, 0, 0, 0, 0, "Material Node outputs Specular"); - uiDefButBitS(block, TOG, SH_NODE_MAT_NEG, B_NODE_EXEC+node->nr, "Neg Normal", - butr->xmax-dx, butr->ymin, dx, 19, - &node->custom1, 0, 0, 0, 0, "Material Node uses inverted Normal"); - } - } - uiBlockEndAlign(block); - } - return 38; -} - -static int node_shader_buts_mapping(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - TexMapping *texmap= node->storage; - short dx= (short)((butr->xmax-butr->xmin)/7.0f); - short dy= (short)(butr->ymax-19); - - uiBlockSetFunc(block, node_texmap_cb, texmap, NULL); /* all buttons get this */ - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->loc, -1000.0f, 1000.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->loc+1, -1000.0f, 1000.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->loc+2, -1000.0f, 1000.0f, 10, 2, ""); - dy-= 19; - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->rot, -1000.0f, 1000.0f, 1000, 1, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->rot+1, -1000.0f, 1000.0f, 1000, 1, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->rot+2, -1000.0f, 1000.0f, 1000, 1, ""); - dy-= 19; - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->size, -1000.0f, 1000.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->size+1, -1000.0f, 1000.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->size+2, -1000.0f, 1000.0f, 10, 2, ""); - dy-= 25; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->min, -10.0f, 10.0f, 100, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->min+1, -10.0f, 10.0f, 100, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->min+2, -10.0f, 10.0f, 100, 2, ""); - dy-= 19; - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+dx, dy, 2*dx, 19, texmap->max, -10.0f, 10.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+3*dx, dy, 2*dx, 19, texmap->max+1, -10.0f, 10.0f, 10, 2, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", butr->xmin+5*dx, dy, 2*dx, 19, texmap->max+2, -10.0f, 10.0f, 10, 2, ""); - uiBlockEndAlign(block); - - /* labels/options */ - - dy= (short)(butr->ymax-19); - uiDefBut(block, LABEL, B_NOP, "Loc", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, ""); - dy-= 19; - uiDefBut(block, LABEL, B_NOP, "Rot", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, ""); - dy-= 19; - uiDefBut(block, LABEL, B_NOP, "Size", butr->xmin, dy, dx, 19, NULL, 0.0f, 0.0f, 0, 0, ""); - dy-= 25; - uiDefButBitI(block, TOG, TEXMAP_CLIP_MIN, B_NODE_EXEC+node->nr, "Min", butr->xmin, dy, dx-4, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, ""); - dy-= 19; - uiDefButBitI(block, TOG, TEXMAP_CLIP_MAX, B_NODE_EXEC+node->nr, "Max", butr->xmin, dy, dx-4, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, ""); - - } - return 5*19 + 6; -} - -static int node_shader_buts_vect_math(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - - bt=uiDefButS(block, MENU, B_NODE_EXEC, "Add %x0|Subtract %x1|Average %x2|Dot Product %x3 |Cross Product %x4|Normalize %x5", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); - } - return 20; -} - -static int node_shader_buts_geometry(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *but; - NodeGeometry *ngeo= (NodeGeometry*)node->storage; - - if(!verify_valid_uv_name(ngeo->uvname)) - uiBlockSetCol(block, TH_REDALERT); - but= uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "UV:", butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20, ngeo->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer"); - uiButSetCompleteFunc(but, autocomplete_uv, NULL); - uiBlockSetCol(block, TH_AUTO); - - if(!verify_valid_vcol_name(ngeo->colname)) - uiBlockSetCol(block, TH_REDALERT); - but= uiDefBut(block, TEX, B_NODE_EXEC+node->nr, "Col:", butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, ngeo->colname, 0, 31, 0, 0, "Set name of vertex color layer to use, default is active vertex color layer"); - uiButSetCompleteFunc(but, autocomplete_vcol, NULL); - uiBlockSetCol(block, TH_AUTO); - } - - return 40; -} - -/* only once called */ -static void node_shader_set_butfunc(bNodeType *ntype) -{ - switch(ntype->type) { - /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ - - case SH_NODE_MATERIAL: - case SH_NODE_MATERIAL_EXT: - ntype->butfunc= node_shader_buts_material; - break; - case SH_NODE_TEXTURE: - ntype->butfunc= node_buts_texture; - break; - case SH_NODE_NORMAL: - ntype->butfunc= node_buts_normal; - break; - case SH_NODE_CURVE_VEC: - ntype->butfunc= node_buts_curvevec; - break; - case SH_NODE_CURVE_RGB: - ntype->butfunc= node_buts_curvecol; - break; - case SH_NODE_MAPPING: - ntype->butfunc= node_shader_buts_mapping; - break; - case SH_NODE_VALUE: - ntype->butfunc= node_buts_value; - break; - case SH_NODE_RGB: - ntype->butfunc= node_buts_rgb; - break; - case SH_NODE_MIX_RGB: - ntype->butfunc= node_buts_mix_rgb; - break; - case SH_NODE_VALTORGB: - ntype->butfunc= node_buts_valtorgb; - break; - case SH_NODE_MATH: - ntype->butfunc= node_buts_math; - break; - case SH_NODE_VECT_MATH: - ntype->butfunc= node_shader_buts_vect_math; - break; - case SH_NODE_GEOMETRY: - ntype->butfunc= node_shader_buts_geometry; - break; - default: - ntype->butfunc= NULL; - } -} - -/* ****************** BUTTON CALLBACKS FOR COMPOSITE NODES ***************** */ - - - -static void node_browse_image_cb(void *ntree_v, void *node_v) -{ - bNodeTree *ntree= ntree_v; - bNode *node= node_v; - - nodeSetActive(ntree, node); - - if(node->menunr<1) return; - if(node->menunr==32767) { /* code for Load New */ - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_LOADIMAGE); - } - else { - if(node->id) node->id->us--; - node->id= BLI_findlink(&G.main->image, node->menunr-1); - id_us_plus(node->id); - - BLI_strncpy(node->name, node->id->name+2, 21); - - NodeTagChanged(ntree, node); - BKE_image_signal((Image *)node->id, node->storage, IMA_SIGNAL_USER_NEW_IMAGE); - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+node->nr); - } - node->menunr= 0; -} - -static void node_active_cb(void *ntree_v, void *node_v) -{ - nodeSetActive(ntree_v, node_v); -} -static void node_image_type_cb(void *node_v, void *unused) -{ - - allqueue(REDRAWNODE, 1); -} - -static char *node_image_type_pup(void) -{ - char *str= MEM_mallocN(256, "image type pup"); - int a; - - str[0]= 0; - - a= sprintf(str, "Image Type %%t|"); - a+= sprintf(str+a, " Image %%x%d %%i%d|", IMA_SRC_FILE, ICON_IMAGE_DEHLT); - a+= sprintf(str+a, " Movie %%x%d %%i%d|", IMA_SRC_MOVIE, ICON_SEQUENCE); - a+= sprintf(str+a, " Sequence %%x%d %%i%d|", IMA_SRC_SEQUENCE, ICON_IMAGE_COL); - a+= sprintf(str+a, " Generated %%x%d %%i%d", IMA_SRC_GENERATED, ICON_BLANK1); - - return str; -} - -/* copy from buttons_shading.c */ -static char *layer_menu(RenderResult *rr) -{ - RenderLayer *rl; - int len= 40 + 40*BLI_countlist(&rr->layers); - short a, nr; - char *str= MEM_callocN(len, "menu layers"); - - strcpy(str, "Layer %t"); - a= strlen(str); - for(nr=0, rl= rr->layers.first; rl; rl= rl->next, nr++) { - a+= sprintf(str+a, "|%s %%x%d", rl->name, nr); - } - - return str; -} - -static void image_layer_cb(void *ima_v, void *iuser_v) -{ - - ntreeCompositForceHidden(G.scene->nodetree); - BKE_image_multilayer_index(ima_v, iuser_v); - allqueue(REDRAWNODE, 0); -} - -static int node_composit_buts_image(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - ImageUser *iuser= node->storage; - - if(block) { - uiBut *bt; - short dy= (short)butr->ymax-19; - char *strp; - - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING2); - - /* browse button */ - IMAnames_to_pupstring(&strp, NULL, "LOAD NEW %x32767", &(G.main->image), NULL, NULL); - node->menunr= 0; - bt= uiDefButS(block, MENU, B_NOP, strp, - butr->xmin, dy, 19, 19, - &node->menunr, 0, 0, 0, 0, "Browses existing choices"); - uiButSetFunc(bt, node_browse_image_cb, ntree, node); - if(strp) MEM_freeN(strp); - - /* Add New button */ - if(node->id==NULL) { - bt= uiDefBut(block, BUT, B_NODE_LOADIMAGE, "Load New", - butr->xmin+19, dy, (short)(butr->xmax-butr->xmin-19.0f), 19, - NULL, 0.0, 0.0, 0, 0, "Add new Image"); - uiButSetFunc(bt, node_active_cb, ntree, node); - uiBlockSetCol(block, TH_AUTO); - } - else { - /* name button + type */ - Image *ima= (Image *)node->id; - short xmin= (short)butr->xmin, xmax= (short)butr->xmax; - short width= xmax - xmin - 45; - short icon= ICON_IMAGE_DEHLT; - - if(ima->source==IMA_SRC_MOVIE) icon= ICON_SEQUENCE; - else if(ima->source==IMA_SRC_SEQUENCE) icon= ICON_IMAGE_COL; - else if(ima->source==IMA_SRC_GENERATED) icon= ICON_BLANK1; - - bt= uiDefBut(block, TEX, B_NOP, "IM:", - xmin+19, dy, width, 19, - node->id->name+2, 0.0, 19.0, 0, 0, "Image name"); - uiButSetFunc(bt, node_ID_title_cb, node, NULL); - - /* buffer type option */ - strp= node_image_type_pup(); - bt= uiDefIconTextButS(block, MENU, B_NOP, icon, strp, - xmax-26, dy, 26, 19, - &ima->source, 0.0, 19.0, 0, 0, "Image type"); - uiButSetFunc(bt, node_image_type_cb, node, ima); - MEM_freeN(strp); - - if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE) ) { - width= (xmax-xmin)/2; - - dy-= 19; - uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "Frs:", - xmin, dy, width, 19, - &iuser->frames, 0.0, MAXFRAMEF, 0, 0, "Amount of images used in animation"); - uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "SFra:", - xmin+width, dy, width, 19, - &iuser->sfra, 1.0, MAXFRAMEF, 0, 0, "Start frame of animation"); - dy-= 19; - uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "Offs:", - xmin, dy, width, 19, - &iuser->offset, -MAXFRAMEF, MAXFRAMEF, 0, 0, "Offsets the number of the frame to use in the animation"); - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Cycl", - xmin+width, dy, width-20, 19, - &iuser->cycl, 0.0, 0.0, 0, 0, "Make animation go cyclic"); - uiDefIconButBitS(block, TOG, IMA_ANIM_ALWAYS, B_NODE_EXEC+node->nr, ICON_AUTO, - xmax-20, dy, 20, 19, - &iuser->flag, 0.0, 0.0, 0, 0, "Always refresh Image on frame changes"); - } - if( ima->type==IMA_TYPE_MULTILAYER && ima->rr) { - RenderLayer *rl= BLI_findlink(&ima->rr->layers, iuser->layer); - if(rl) { - width= (xmax-xmin); - dy-= 19; - strp= layer_menu(ima->rr); - bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp, - xmin, dy, width, 19, - &iuser->layer, 0.0, 10000.0, 0, 0, "Layer"); - uiButSetFunc(bt, image_layer_cb, ima, node->storage); - MEM_freeN(strp); - } - } - } - - } - if(node->id) { - Image *ima= (Image *)node->id; - int retval= 19; - - /* for each draw we test for anim refresh event */ - if(iuser->flag & IMA_ANIM_REFRESHED) { - iuser->flag &= ~IMA_ANIM_REFRESHED; - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_EXEC+node->nr); - } - - if( ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE) ) - retval+= 38; - if( ima->type==IMA_TYPE_MULTILAYER) - retval+= 19; - return retval; - } - else - return 19; -} - -/* if we use render layers from other scene, we make a nice title */ -static void set_render_layers_title(void *node_v, void *unused) -{ - bNode *node= node_v; - Scene *sce; - SceneRenderLayer *srl; - char str[64]; - - if(node->id) { - BLI_strncpy(str, node->id->name+2, 21); - strcat(str, "|"); - sce= (Scene *)node->id; - } - else { - str[0]= 0; - sce= G.scene; - } - srl= BLI_findlink(&sce->r.layers, node->custom1); - if(srl==NULL) { - node->custom1= 0; - srl= sce->r.layers.first; - } - - strcat(str, srl->name); - BLI_strncpy(node->name, str, 32); -} - -static char *scene_layer_menu(Scene *sce) -{ - SceneRenderLayer *srl; - int len= 40 + 40*BLI_countlist(&sce->r.layers); - short a, nr; - char *str= MEM_callocN(len, "menu layers"); - - strcpy(str, "Active Layer %t"); - a= strlen(str); - for(nr=0, srl= sce->r.layers.first; srl; srl= srl->next, nr++) { - a+= sprintf(str+a, "|%s %%x%d", srl->name, nr); - } - - return str; -} - -static void node_browse_scene_cb(void *ntree_v, void *node_v) -{ - bNodeTree *ntree= ntree_v; - bNode *node= node_v; - Scene *sce; - - if(node->menunr<1) return; - - if(node->id) { - node->id->us--; - node->id= NULL; - } - sce= BLI_findlink(&G.main->scene, node->menunr-1); - if(sce!=G.scene) { - node->id= &sce->id; - id_us_plus(node->id); - } - - set_render_layers_title(node, NULL); - nodeSetActive(ntree, node); - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - NodeTagChanged(ntree, node); - - node->menunr= 0; -} - - -static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - char *strp; - - /* browse button scene */ - uiBlockBeginAlign(block); - IDnames_to_pupstring(&strp, NULL, "", &(G.main->scene), NULL, NULL); - node->menunr= 0; - bt= uiDefButS(block, MENU, B_NOP, strp, - butr->xmin, butr->ymin, 20, 19, - &node->menunr, 0, 0, 0, 0, "Browse Scene to use RenderLayer from"); - uiButSetFunc(bt, node_browse_scene_cb, ntree, node); - if(strp) MEM_freeN(strp); - - /* browse button layer */ - strp= scene_layer_menu(node->id?(Scene *)node->id:G.scene); - if(node->id) - bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC+node->nr, ICON_SCENE_DEHLT, strp, - butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19, - &node->custom1, 0, 0, 0, 0, "Choose Render Layer"); - else - bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, strp, - butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19, - &node->custom1, 0, 0, 0, 0, "Choose Render Layer"); - uiButSetFunc(bt, set_render_layers_title, node, NULL); - MEM_freeN(strp); - - /* re-render */ - /* uses custom2, not the best implementation of the world... but we need it to work now :) */ - bt= uiDefIconButS(block, TOG, B_NODE_EXEC+node->nr, ICON_SCENE, - butr->xmax-20, butr->ymin, 20, 19, - &node->custom2, 0, 0, 0, 0, "Re-render this Layer"); - - } - return 19; -} - -static int node_composit_buts_blur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeBlurData *nbd= node->storage; - uiBut *bt; - short dy= butr->ymin+38; - short dx= (butr->xmax-butr->xmin)/2; - char str[256]; - - uiBlockBeginAlign(block); - sprintf(str, "Filter Type%%t|Flat %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|Fast Gauss%%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_FAST_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH); - uiDefButS(block, MENU, B_NODE_EXEC+node->nr,str, - butr->xmin, dy, dx*2, 19, - &nbd->filtertype, 0, 0, 0, 0, "Set sampling filter for blur"); - dy-=19; - if (nbd->filtertype != R_FILTER_FAST_GAUSS) { - uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Bokeh", - butr->xmin, dy, dx, 19, - &nbd->bokeh, 0, 0, 0, 0, "Uses circular filter, warning it's slow!"); - uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Gamma", - butr->xmin+dx, dy, dx, 19, - &nbd->gamma, 0, 0, 0, 0, "Applies filter on gamma corrected values"); - } else { - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - } - dy-=19; - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X:", - butr->xmin, dy, dx, 19, - &nbd->sizex, 0, 256, 0, 0, ""); - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y:", - butr->xmin+dx, dy, dx, 19, - &nbd->sizey, 0, 256, 0, 0, ""); - uiBlockEndAlign(block); - } - return 57; -} - -/* qdn: defocus node */ -static int node_composit_buts_defocus(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeDefocus *nqd = node->storage; - short dy = butr->ymin + 209; - short dx = butr->xmax - butr->xmin; - char* mstr1 = "Bokeh Type%t|Octagon %x8|Heptagon %x7|Hexagon %x6|Pentagon %x5|Square %x4|Triangle %x3|Disk %x0"; - - uiDefBut(block, LABEL, B_NOP, "Bokeh Type", butr->xmin, dy, dx, 19, NULL, 0, 0, 0, 0, ""); - uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mstr1, - butr->xmin, dy-19, dx, 19, - &nqd->bktype, 0, 0, 0, 0, "Bokeh type"); - if (nqd->bktype) { /* for some reason rotating a disk doesn't seem to work... ;) */ - uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Rotate:", - butr->xmin, dy-38, dx, 19, - &nqd->rotation, 0, 90, 0, 0, "Bokeh shape rotation offset in degrees"); - } - uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Gamma Correct", - butr->xmin, dy-57, dx, 19, - &nqd->gamco, 0, 0, 0, 0, "Enable gamma correction before and after main process"); - if (nqd->no_zbuf==0) { - // only needed for zbuffer input - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "fStop:", - butr->xmin, dy-76, dx, 19, - &nqd->fstop, 0.5, 128, 10, 0, "Amount of focal blur, 128=infinity=perfect focus, half the value doubles the blur radius"); - } - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Maxblur:", - butr->xmin, dy-95, dx, 19, - &nqd->maxblur, 0, 10000, 1000, 0, "blur limit, maximum CoC radius, 0=no limit"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BThreshold:", - butr->xmin, dy-114, dx, 19, - &nqd->bthresh, 0, 100, 100, 0, "CoC radius threshold, prevents background bleed on in-focus midground, 0=off"); - uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Preview", - butr->xmin, dy-142, dx, 19, - &nqd->preview, 0, 0, 0, 0, "Enable sampling mode, useful for preview when using low samplecounts"); - if (nqd->preview) { - /* only visible when sampling mode enabled */ - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Samples:", - butr->xmin, dy-161, dx, 19, - &nqd->samples, 16, 256, 0, 0, "Number of samples (16=grainy, higher=less noise)"); - } - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "No zbuffer", - butr->xmin, dy-190, dx, 19, - &nqd->no_zbuf, 0, 0, 0, 0, "Enable when using an image as input instead of actual zbuffer (auto enabled if node not image based, eg. time node)"); - if (nqd->no_zbuf) { - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Zscale:", - butr->xmin, dy-209, dx, 19, - &nqd->scale, 0, 1000, 100, 0, "Scales the Z input when not using a zbuffer, controls maximum blur designated by the color white or input value 1"); - } - } - return 228; -} - - -/* qdn: glare node */ -static int node_composit_buts_glare(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeGlare *ndg = node->storage; - short dy = butr->ymin + 152, dx = butr->xmax - butr->xmin; - char* mn1 = "Type%t|Ghosts%x3|Streaks%x2|Fog Glow%x1|Simple Star%x0"; - char* mn2 = "Quality/Speed%t|High/Slow%x0|Medium/Medium%x1|Low/Fast%x2"; - uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mn1, - butr->xmin, dy, dx, 19, - &ndg->type, 0, 0, 0, 0, "Glow/Flare/Bloom type"); - uiDefButC(block, MENU, B_NODE_EXEC+node->nr, mn2, - butr->xmin, dy-19, dx, 19, - &ndg->quality, 0, 0, 0, 0, - "Quality speed trade off, if not set to high quality, effect will be applied to low-res copy of source image"); - if (ndg->type != 1) { - uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Iterations:", - butr->xmin, dy-38, dx, 19, - &ndg->iter, 2, 5, 1, 0, - "higher values will generate longer/more streaks/ghosts"); - if (ndg->type != 0) - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "ColMod:", - butr->xmin, dy-57, dx, 19, - &ndg->colmod, 0, 1, 10, 0, - "Amount of Color Modulation, modulates colors of streaks and ghosts for a spectral dispersion effect"); - } - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Mix:", - butr->xmin, dy-76, dx, 19, - &ndg->mix, -1, 1, 10, 0, - "Mix balance, -1 is original image only, 0 is exact 50/50 mix, 1 is processed image only"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Threshold:", - butr->xmin, dy-95, dx, 19, - &ndg->threshold, 0, 1000, 10, 0, - "Brightness threshold, the glarefilter will be applied only to pixels brighter than this value"); - if ((ndg->type == 2) || (ndg->type == 0)) - { - if (ndg->type == 2) { - uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "streaks:", - butr->xmin, dy-114, dx, 19, - &ndg->angle, 2, 16, 1000, 0, - "Total number of streaks"); - uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "AngOfs:", - butr->xmin, dy-133, dx, 19, - &ndg->angle_ofs, 0, 180, 1000, 0, - "Streak angle rotation offset in degrees"); - } - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Fade:", - butr->xmin, dy-152, dx, 19, - &ndg->fade, 0.75, 1, 5, 0, - "Streak fade out factor"); - } - if (ndg->type == 0) - uiDefButC(block, TOG, B_NODE_EXEC+node->nr, "Rot45", - butr->xmin, dy-114, dx, 19, - &ndg->angle, 0, 0, 0, 0, - "simple star filter, add 45 degree rotation offset"); - if ((ndg->type == 1) || (ndg->type > 3)) // PBGH and fog glow - uiDefButC(block, NUM, B_NODE_EXEC+node->nr, "Size:", - butr->xmin, dy-114, dx, 19, - &ndg->size, 6, 9, 1000, 0, - "glow/glare size (not actual size, relative to initial size of bright area of pixels)"); - } - return 171; -} - -/* qdn: tonemap node */ -static int node_composit_buts_tonemap(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeTonemap *ntm = node->storage; - short dy = butr->ymin + 76, dx = butr->xmax - butr->xmin; - char* mn = "Type%t|R/D Photoreceptor%x1|Rh Simple%x0"; - - uiBlockBeginAlign(block); - uiDefButI(block, MENU, B_NODE_EXEC+node->nr, mn, - butr->xmin, dy, dx, 19, - &ntm->type, 0, 0, 0, 0, - "Tone mapping type"); - if (ntm->type == 0) { - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Key:", - butr->xmin, dy-19, dx, 19, - &ntm->key, 0, 1, 5, 0, - "The value the average luminance is mapped to"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Offset:", - butr->xmin, dy-38, dx, 19, - &ntm->offset, 0.001, 10, 5, 0, - "Tonemap offset, normally always 1, but can be used as an extra control to alter the brightness curve"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Gamma:", - butr->xmin, dy-57, dx, 19, - &ntm->gamma, 0.001, 3, 5, 0, - "Gamma factor, if not used, set to 1"); - } - else { - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Intensity:", - butr->xmin, dy-19, dx, 19, - &ntm->f, -8, 8, 10, 0, "if less than zero, darkens image, otherwise makes it brighter"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Contrast:", - butr->xmin, dy-38, dx, 19, - &ntm->m, 0, 1, 5, 0, "Set to 0 to use estimate from input image"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Adaptation:", - butr->xmin, dy-57, dx, 19, - &ntm->a, 0, 1, 5, 0, "if 0, global, if 1, based on pixel intensity"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "ColCorrect:", - butr->xmin, dy-76, dx, 19, - &ntm->c, 0, 1, 5, 0, "color correction, if 0, same for all channels, if 1, each independent"); - } - uiBlockEndAlign(block); - } - return 95; -} - -/* qdn: lens distortion node */ -static int node_composit_buts_lensdist(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeLensDist *nld = node->storage; - short dy = butr->ymin + 19, dx = butr->xmax - butr->xmin; - uiBlockBeginAlign(block); - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Projector", - butr->xmin, dy, dx, 19, - &nld->proj, 0, 0, 0, 0, - "Enable/disable projector mode, effect is applied in horizontal direction only"); - if (!nld->proj) { - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Jitter", - butr->xmin, dy-19, dx/2, 19, - &nld->jit, 0, 0, 0, 0, - "Enable/disable jittering, faster, but also noisier"); - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Fit", - butr->xmin+dx/2, dy-19, dx/2, 19, - &nld->fit, 0, 0, 0, 0, - "For positive distortion factor only, scale image such that black areas are not visible"); - } - uiBlockEndAlign(block); - } - return 38; -} - - -static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeBlurData *nbd= node->storage; - short dy= butr->ymin; - short dx= (butr->xmax-butr->xmin); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Samples:", - butr->xmin, dy+57, dx, 19, - &nbd->samples, 1, 256, 0, 0, "Amount of samples"); - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "MinSpeed:", - butr->xmin, dy+38, dx, 19, - &nbd->minspeed, 0, 1024, 0, 0, "Minimum speed for a pixel to be blurred, used to separate background from foreground"); - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "MaxSpeed:", - butr->xmin, dy+19, dx, 19, - &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BlurFac:", - butr->xmin, dy, dx, 19, - &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames"); - } - return 76; -} - -static int node_composit_buts_filter(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - - /* blend type */ - bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Soften %x0|Sharpen %x1|Laplace %x2|Sobel %x3|Prewitt %x4|Kirsch %x5|Shadow %x6", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); - } - return 20; -} - -static int node_composit_buts_flip(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt; - - /* flip x\y */ - bt=uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Flip X %x0|Flip Y %x1|Flip X & Y %x2", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_but_title_cb, node, bt); - } - return 20; -} - -static int node_composit_buts_crop(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeTwoXYs *ntxy= node->storage; - uiBut *bt; - char elementheight = 19; - short dx= (butr->xmax-butr->xmin)/2; - short dy= butr->ymax - elementheight; - short xymin= 0, xymax= 10000; - - uiBlockBeginAlign(block); - - /* crop image size toggle */ - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Crop Image Size", - butr->xmin, dy, dx*2, elementheight, - &node->custom1, 0, 0, 0, 0, "Crop the size of the input image."); - - dy-=elementheight; - - /* x1 */ - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X1:", - butr->xmin, dy, dx, elementheight, - &ntxy->x1, xymin, xymax, 0, 0, ""); - /* y1 */ - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y1:", - butr->xmin+dx, dy, dx, elementheight, - &ntxy->y1, xymin, xymax, 0, 0, ""); - - dy-=elementheight; - - /* x2 */ - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "X2:", - butr->xmin, dy, dx, elementheight, - &ntxy->x2, xymin, xymax, 0, 0, ""); - /* y2 */ - bt=uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Y2:", - butr->xmin+dx, dy, dx, elementheight, - &ntxy->y2, xymin, xymax, 0, 0, ""); - - uiBlockEndAlign(block); - } - return 60; -} - -static int node_composit_buts_splitviewer(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBlockBeginAlign(block); - - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "X", - butr->xmin, butr->ymin+19, (butr->xmax-butr->xmin)/2, 20, - &node->custom2, 0.0, 0.0, 0, 0, ""); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "Y", - butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin+19, (butr->xmax-butr->xmin)/2, 20, - &node->custom2, 0.0, 1.0, 0, 0, ""); - - uiDefButS(block, NUMSLI, B_NODE_EXEC+node->nr, "Split %: ", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, &node->custom1, 0, 100, 10, 0, ""); - } - return 40; -} - -static int node_composit_buts_map_value(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - TexMapping *texmap= node->storage; - short xstart= (short)butr->xmin; - short dy= (short)(butr->ymax-19.0f); - short dx= (short)(butr->xmax-butr->xmin)/2; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Offs:", xstart, dy, 2*dx, 19, texmap->loc, -1000.0f, 1000.0f, 10, 2, ""); - dy-= 19; - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Size:", xstart, dy, 2*dx, 19, texmap->size, -1000.0f, 1000.0f, 10, 3, ""); - dy-= 23; - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, TEXMAP_CLIP_MIN, B_NODE_EXEC+node->nr, "Min", xstart, dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", xstart+dx, dy, dx, 19, texmap->min, -1000.0f, 1000.0f, 10, 2, ""); - dy-= 19; - uiDefButBitI(block, TOG, TEXMAP_CLIP_MAX, B_NODE_EXEC+node->nr, "Max", xstart, dy, dx, 19, &texmap->flag, 0.0f, 0.0f, 0, 0, ""); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "", xstart+dx, dy, dx, 19, texmap->max, -1000.0f, 1000.0f, 10, 2, ""); - } - return 80; -} - -static int node_composit_buts_alphaover(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - - /* alpha type */ - uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "ConvertPremul", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 19, - &node->custom1, 0, 0, 0, 0, ""); - } - return 19; -} - -static int node_composit_buts_hue_sat(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeHueSat *nhs= node->storage; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Hue: ", - butr->xmin, butr->ymin+40.0f, butr->xmax-butr->xmin, 20, - &nhs->hue, 0.0f, 1.0f, 100, 0, ""); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Sat: ", - butr->xmin, butr->ymin+20.0f, butr->xmax-butr->xmin, 20, - &nhs->sat, 0.0f, 2.0f, 100, 0, ""); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Val: ", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &nhs->val, 0.0f, 2.0f, 100, 0, ""); - } - return 60; -} - -static int node_composit_buts_dilateerode(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Distance:", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom2, -100, 100, 0, 0, "Distance to grow/shrink (number of iterations)"); - } - return 20; -} - -static int node_composit_buts_diff_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - short sx= (butr->xmax-butr->xmin)/4; - short dx= (butr->xmax-butr->xmin)/3; - NodeChroma *c= node->storage; - - uiBlockBeginAlign(block); - /*color space selectors*/ - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"RGB", - butr->xmin,butr->ymin+60,sx,20, - &node->custom1,1,1, 0, 0, "RGB Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"HSV", - butr->xmin+sx,butr->ymin+60,sx,20, - &node->custom1,1,2, 0, 0, "HSV Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YUV", - butr->xmin+2*sx,butr->ymin+60,sx,20, - &node->custom1,1,3, 0, 0, "YUV Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YCC", - butr->xmin+3*sx,butr->ymin+60,sx,20, - &node->custom1,1,4, 0, 0, "YCbCr Color Space"); - /*channel tolorences*/ - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ", - butr->xmin, butr->ymin+40, dx, 20, - &c->t1, 0.0f, 1.0f, 100, 0, "Channel 1 Tolerance"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ", - butr->xmin+dx, butr->ymin+40, dx, 20, - &c->t2, 0.0f, 1.0f, 100, 0, "Channel 2 Tolorence"); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, " ", - butr->xmin+2*dx, butr->ymin+40, dx, 20, - &c->t3, 0.0f, 1.0f, 100, 0, "Channel 3 Tolorence"); - /*falloff parameters*/ - /* - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff Size ", - butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20, - &c->fsize, 0.0f, 1.0f, 100, 0, ""); - */ - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Falloff: ", - butr->xmin, butr->ymin+20, butr->xmax-butr->xmin, 20, - &c->fstrength, 0.0f, 1.0f, 100, 0, ""); - } - return 80; -} - -static int node_composit_buts_color_spill(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - short dx= (butr->xmax-butr->xmin)/3; - - NodeChroma *c=node->storage; - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "Enhance: ", - butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20, - &c->t1, 0.0f, 0.5f, 100, 2, "Adjusts how much selected channel is affected by color spill algorithm"); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "R", - butr->xmin,butr->ymin,dx,20, - &node->custom1,1,1, 0, 0, "Red Spill Suppression"); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "G", - butr->xmin+dx,butr->ymin,dx,20, - &node->custom1,1,2, 0, 0, "Green Spill Suppression"); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, "B", - butr->xmin+2*dx,butr->ymin,dx,20, - &node->custom1, 1, 3, 0, 0, "Blue Spill Suppression"); - uiBlockEndAlign(block); - } - return 60; - } - -static int node_composit_buts_chroma_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - short dx=(butr->xmax-butr->xmin)/2; - NodeChroma *c= node->storage; - uiBlockBeginAlign(block); - - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Acceptance ", - butr->xmin, butr->ymin+60, butr->xmax-butr->xmin, 20, - &c->t1, 1.0f, 80.0f, 100, 0, "Tolerance for colors to be considered a keying color"); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Cutoff ", - butr->xmin, butr->ymin+40, butr->xmax-butr->xmin, 20, - &c->t2, 0.0f, 30.0f, 100, 0, "Colors below this will be considered as exact matches for keying color"); - - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Lift ", - butr->xmin, butr->ymin+20, dx, 20, - &c->fsize, 0.0f, 1.0f, 100, 0, "Alpha Lift"); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Gain ", - butr->xmin+dx, butr->ymin+20, dx, 20, - &c->fstrength, 0.0f, 1.0f, 100, 0, "Alpha Gain"); - - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Shadow Adjust ", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &c->t3, 0.0f, 1.0f, 100, 0, "Adjusts the brightness of any shadows captured"); - - if(c->t2 > c->t1) - c->t2=c->t1; - } - return 80; -} - -static int node_composit_buts_channel_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - short sx= (butr->xmax-butr->xmin)/4; - short cx= (butr->xmax-butr->xmin)/3; - NodeChroma *c=node->storage; - char *c1, *c2, *c3; - - /*color space selectors*/ - uiBlockBeginAlign(block); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"RGB", - butr->xmin,butr->ymin+60,sx,20,&node->custom1,1,1, 0, 0, "RGB Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"HSV", - butr->xmin+sx,butr->ymin+60,sx,20,&node->custom1,1,2, 0, 0, "HSV Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YUV", - butr->xmin+2*sx,butr->ymin+60,sx,20,&node->custom1,1,3, 0, 0, "YUV Color Space"); - uiDefButS(block, ROW,B_NODE_EXEC+node->nr,"YCC", - butr->xmin+3*sx,butr->ymin+60,sx,20,&node->custom1,1,4, 0, 0, "YCbCr Color Space"); - - if (node->custom1==1) { - c1="R"; c2="G"; c3="B"; - } - else if(node->custom1==2){ - c1="H"; c2="S"; c3="V"; - } - else if(node->custom1==3){ - c1="Y"; c2="U"; c3="V"; - } - else { // if(node->custom1==4){ - c1="Y"; c2="Cb"; c3="Cr"; - } - - /*channel selector */ - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c1, - butr->xmin,butr->ymin+40,cx,20,&node->custom2,1, 1, 0, 0, "Channel 1"); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c2, - butr->xmin+cx,butr->ymin+40,cx,20,&node->custom2,1, 2, 0, 0, "Channel 2"); - uiDefButS(block, ROW, B_NODE_EXEC+node->nr, c3, - butr->xmin+cx+cx,butr->ymin+40,cx,20,&node->custom2, 1, 3, 0, 0, "Channel 3"); - - /*tolerance sliders */ - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "High ", - butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20, - &c->t1, 0.0f, 1.0f, 100, 0, "Values higher than this setting are 100% opaque"); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Low ", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &c->t2, 0.0f, 1.0f, 100, 0, "Values lower than this setting are 100% keyed"); - uiBlockEndAlign(block); - - /*keep t2 (low) less than t1 (high) */ - if(c->t2 > c->t1) { - c->t2=c->t1; - } - } - return 80; -} - -static int node_composit_buts_luma_matte(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeChroma *c=node->storage; - - /*tolerance sliders */ - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "High ", - butr->xmin, butr->ymin+20.0, butr->xmax-butr->xmin, 20, - &c->t1, 0.0f, 1.0f, 100, 0, "Values higher than this setting are 100% opaque"); - uiDefButF(block, NUMSLI, B_NODE_EXEC+node->nr, "Low ", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &c->t2, 0.0f, 1.0f, 100, 0, "Values lower than this setting are 100% keyed"); - uiBlockEndAlign(block); - - /*keep t2 (low) less than t1 (high) */ - if(c->t2 > c->t1) { - c->t2=c->t1; - } - } - return 40; -} - -static int node_composit_buts_map_uv(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "Alpha:", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 100, 0, 0, "Conversion percentage of UV differences to Alpha"); - } - return 20; -} - -static int node_composit_buts_id_mask(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiDefButS(block, NUM, B_NODE_EXEC+node->nr, "ID:", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 10000, 0, 0, "Pass Index number to convert to Alpha"); - } - return 20; -} - - -/* allocate sufficient! */ -static void node_imagetype_string(char *str) -{ - str += sprintf(str, "Save Image as: %%t|"); - str += sprintf(str, "Targa %%x%d|", R_TARGA); - str += sprintf(str, "Targa Raw %%x%d|", R_RAWTGA); - str += sprintf(str, "PNG %%x%d|", R_PNG); - str += sprintf(str, "BMP %%x%d|", R_BMP); - str += sprintf(str, "Jpeg %%x%d|", R_JPEG90); - str += sprintf(str, "Iris %%x%d|", R_IRIS); - str += sprintf(str, "Radiance HDR %%x%d|", R_RADHDR); - str += sprintf(str, "Cineon %%x%d|", R_CINEON); - str += sprintf(str, "DPX %%x%d|", R_DPX); - str += sprintf(str, "OpenEXR %%x%d", R_OPENEXR); -} - -static int node_composit_buts_file_output(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - NodeImageFile *nif= node->storage; - short x= (short)butr->xmin; - short y= (short)butr->ymin; - short w= (short)butr->xmax-butr->xmin; - char str[320]; - - node_imagetype_string(str); - - uiBlockBeginAlign(block); - - uiDefBut(block, TEX, B_NOP, "", - x, y+60, w, 20, - nif->name, 0.0f, 240.0f, 0, 0, ""); - - uiDefButS(block, MENU, B_NOP, str, - x, y+40, w, 20, - &nif->imtype, 0.0f, 1.0f, 0, 0, ""); - - if(nif->imtype==R_OPENEXR) { - uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_REDR, "Half", - x, y+20, w/2, 20, - &nif->subimtype, 0, 0, 0, 0, ""); - - uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4", - x+w/2, y+20, w/2, 20, - &nif->codec, 0, 0, 0, 0, ""); - } - else { - uiDefButS(block, NUM, B_NOP, "Quality: ", - x, y+20, w, 20, - &nif->quality, 10.0f, 100.0f, 10, 0, ""); - } - - /* start frame, end frame */ - uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "SFra: ", - x, y, w/2, 20, - &nif->sfra, 1, MAXFRAMEF, 10, 0, ""); - uiDefButI(block, NUM, B_NODE_EXEC+node->nr, "EFra: ", - x+w/2, y, w/2, 20, - &nif->efra, 1, MAXFRAMEF, 10, 0, ""); - - } - return 80; -} - -static void node_scale_cb(void *node_v, void *unused_v) -{ - bNode *node= node_v; - bNodeSocket *nsock; - - /* check the 2 inputs, and set them to reasonable values */ - for(nsock= node->inputs.first; nsock; nsock= nsock->next) { - if(ELEM(node->custom1, CMP_SCALE_RELATIVE, CMP_SCALE_SCENEPERCENT)) - nsock->ns.vec[0]= 1.0; - else { - if(nsock->next==NULL) - nsock->ns.vec[0]= (float)G.scene->r.ysch; - else - nsock->ns.vec[0]= (float)G.scene->r.xsch; - } - } -} - -static int node_composit_buts_scale(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBut *bt= uiDefButS(block, MENU, B_NODE_EXEC+node->nr, "Relative %x0|Absolute %x1|Scene Size % %x2|", - butr->xmin, butr->ymin, butr->xmax-butr->xmin, 20, - &node->custom1, 0, 0, 0, 0, "Scale new image to absolute pixel size, size relative to the incoming image, or using the 'percent' size of the scene"); - uiButSetFunc(bt, node_scale_cb, node, NULL); - } - return 20; -} - -static int node_composit_buts_invert(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) -{ - if(block) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, CMP_CHAN_RGB, B_NODE_EXEC+node->nr, "RGB", - butr->xmin, butr->ymin, (butr->xmax-butr->xmin)/2, 20, - &node->custom1, 0, 0, 0, 0, ""); - uiDefButBitS(block, TOG, CMP_CHAN_A, B_NODE_EXEC+node->nr, "A", - butr->xmin+(butr->xmax-butr->xmin)/2, butr->ymin, (butr->xmax-butr->xmin)/2, 20, - &node->custom1, 0, 0, 0, 0, ""); - uiBlockEndAlign(block); - } - return 20; -} - -/* only once called */ -static void node_composit_set_butfunc(bNodeType *ntype) -{ - switch(ntype->type) { - /* case NODE_GROUP: note, typeinfo for group is generated... see "XXX ugly hack" */ - - case CMP_NODE_IMAGE: - ntype->butfunc= node_composit_buts_image; - break; - case CMP_NODE_R_LAYERS: - ntype->butfunc= node_composit_buts_renderlayers; - break; - case CMP_NODE_NORMAL: - ntype->butfunc= node_buts_normal; - break; - case CMP_NODE_CURVE_VEC: - ntype->butfunc= node_buts_curvevec; - break; - case CMP_NODE_CURVE_RGB: - ntype->butfunc= node_buts_curvecol; - break; - case CMP_NODE_VALUE: - ntype->butfunc= node_buts_value; - break; - case CMP_NODE_RGB: - ntype->butfunc= node_buts_rgb; - break; - case CMP_NODE_FLIP: - ntype->butfunc= node_composit_buts_flip; - break; - case CMP_NODE_SPLITVIEWER: - ntype->butfunc= node_composit_buts_splitviewer; - break; - case CMP_NODE_MIX_RGB: - ntype->butfunc= node_buts_mix_rgb; - break; - case CMP_NODE_VALTORGB: - ntype->butfunc= node_buts_valtorgb; - break; - case CMP_NODE_CROP: - ntype->butfunc= node_composit_buts_crop; - break; - case CMP_NODE_BLUR: - ntype->butfunc= node_composit_buts_blur; - break; - /* qdn: defocus node */ - case CMP_NODE_DEFOCUS: - ntype->butfunc = node_composit_buts_defocus; - break; - /* qdn: glare node */ - case CMP_NODE_GLARE: - ntype->butfunc = node_composit_buts_glare; - break; - /* qdn: tonemap node */ - case CMP_NODE_TONEMAP: - ntype->butfunc = node_composit_buts_tonemap; - break; - /* qdn: lens distortion node */ - case CMP_NODE_LENSDIST: - ntype->butfunc = node_composit_buts_lensdist; - break; - case CMP_NODE_VECBLUR: - ntype->butfunc= node_composit_buts_vecblur; - break; - case CMP_NODE_FILTER: - ntype->butfunc= node_composit_buts_filter; - break; - case CMP_NODE_MAP_VALUE: - ntype->butfunc= node_composit_buts_map_value; - break; - case CMP_NODE_TIME: - ntype->butfunc= node_buts_time; - break; - case CMP_NODE_ALPHAOVER: - ntype->butfunc= node_composit_buts_alphaover; - break; - case CMP_NODE_HUE_SAT: - ntype->butfunc= node_composit_buts_hue_sat; - break; - case CMP_NODE_TEXTURE: - ntype->butfunc= node_buts_texture; - break; - case CMP_NODE_DILATEERODE: - ntype->butfunc= node_composit_buts_dilateerode; - break; - case CMP_NODE_OUTPUT_FILE: - ntype->butfunc= node_composit_buts_file_output; - break; - - case CMP_NODE_DIFF_MATTE: - ntype->butfunc=node_composit_buts_diff_matte; - break; - case CMP_NODE_COLOR_SPILL: - ntype->butfunc=node_composit_buts_color_spill; - break; - case CMP_NODE_CHROMA: - ntype->butfunc=node_composit_buts_chroma_matte; - break; - case CMP_NODE_SCALE: - ntype->butfunc= node_composit_buts_scale; - break; - case CMP_NODE_CHANNEL_MATTE: - ntype->butfunc= node_composit_buts_channel_matte; - break; - case CMP_NODE_LUMA_MATTE: - ntype->butfunc= node_composit_buts_luma_matte; - break; - case CMP_NODE_MAP_UV: - ntype->butfunc= node_composit_buts_map_uv; - break; - case CMP_NODE_ID_MASK: - ntype->butfunc= node_composit_buts_id_mask; - break; - case CMP_NODE_MATH: - ntype->butfunc= node_buts_math; - break; - case CMP_NODE_INVERT: - ntype->butfunc= node_composit_buts_invert; - break; - default: - ntype->butfunc= NULL; - } -} - - -/* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */ - -void init_node_butfuncs(void) -{ - bNodeType *ntype; - - /* shader nodes */ - ntype= node_all_shaders.first; - while(ntype) { - node_shader_set_butfunc(ntype); - ntype= ntype->next; - } - /* composit nodes */ - ntype= node_all_composit.first; - while(ntype) { - node_composit_set_butfunc(ntype); - ntype= ntype->next; - } -} - -/* ************** Generic drawing ************** */ - -static void draw_nodespace_grid(SpaceNode *snode) -{ - float start, step= 25.0f; - - BIF_ThemeColorShade(TH_BACK, -10); - - start= snode->v2d.cur.xmin -fmod(snode->v2d.cur.xmin, step); - - glBegin(GL_LINES); - for(; startv2d.cur.xmax; start+=step) { - glVertex2f(start, snode->v2d.cur.ymin); - glVertex2f(start, snode->v2d.cur.ymax); - } - - start= snode->v2d.cur.ymin -fmod(snode->v2d.cur.ymin, step); - for(; startv2d.cur.ymax; start+=step) { - glVertex2f(snode->v2d.cur.xmin, start); - glVertex2f(snode->v2d.cur.xmax, start); - } - - /* X and Y axis */ - BIF_ThemeColorShade(TH_BACK, -18); - glVertex2f(0.0f, snode->v2d.cur.ymin); - glVertex2f(0.0f, snode->v2d.cur.ymax); - glVertex2f(snode->v2d.cur.xmin, 0.0f); - glVertex2f(snode->v2d.cur.xmax, 0.0f); - - glEnd(); -} - -static void draw_nodespace_back(ScrArea *sa, SpaceNode *snode) -{ - - draw_nodespace_grid(snode); - - if(snode->flag & SNODE_BACKDRAW) { - Image *ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - if(ibuf) { - int x, y; - float zoom = 1.0; - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - glaDefine2DArea(&sa->winrct); - - if(ibuf->x > sa->winx || ibuf->y > sa->winy) { - float zoomx, zoomy; - zoomx= (float)sa->winx/ibuf->x; - zoomy= (float)sa->winy/ibuf->y; - zoom = MIN2(zoomx, zoomy); - } - - x = (sa->winx-zoom*ibuf->x)/2 + snode->xof; - y = (sa->winy-zoom*ibuf->y)/2 + snode->yof; - - glPixelZoom(zoom, zoom); - - glColor4f(1.0, 1.0, 1.0, 1.0); - if(ibuf->rect) - glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect); - else if(ibuf->channels==4) - glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, GL_FLOAT, ibuf->rect_float); - - glPixelZoom(1.0, 1.0); - - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - } - } -} - -/* nice AA filled circle */ -static void socket_circle_draw(float x, float y, float size, int type, int select) -{ - /* 16 values of sin function */ - static float si[16] = { - 0.00000000, 0.39435585,0.72479278,0.93775213, - 0.99871650,0.89780453,0.65137248,0.29936312, - -0.10116832,-0.48530196,-0.79077573,-0.96807711, - -0.98846832,-0.84864425,-0.57126821,-0.20129852 - }; - /* 16 values of cos function */ - static float co[16] ={ - 1.00000000,0.91895781,0.68896691,0.34730525, - -0.05064916,-0.44039415,-0.75875812,-0.95413925, - -0.99486932,-0.87434661,-0.61210598,-0.25065253, - 0.15142777,0.52896401,0.82076344,0.97952994, - }; - int a; - - if(select==0) { - if(type==-1) - glColor3ub(0, 0, 0); - else if(type==SOCK_VALUE) - glColor3ub(160, 160, 160); - else if(type==SOCK_VECTOR) - glColor3ub(100, 100, 200); - else if(type==SOCK_RGBA) - glColor3ub(200, 200, 40); - else - glColor3ub(100, 200, 100); - } - else { - if(type==SOCK_VALUE) - glColor3ub(200, 200, 200); - else if(type==SOCK_VECTOR) - glColor3ub(140, 140, 240); - else if(type==SOCK_RGBA) - glColor3ub(240, 240, 100); - else - glColor3ub(140, 240, 140); - } - - glBegin(GL_POLYGON); - for(a=0; a<16; a++) - glVertex2f(x+size*si[a], y+size*co[a]); - glEnd(); - - glColor4ub(0, 0, 0, 150); - glEnable(GL_BLEND); - glEnable( GL_LINE_SMOOTH ); - glBegin(GL_LINE_LOOP); - for(a=0; a<16; a++) - glVertex2f(x+size*si[a], y+size*co[a]); - glEnd(); - glDisable( GL_LINE_SMOOTH ); - glDisable(GL_BLEND); -} - -/* not a callback */ -static void node_draw_preview(bNodePreview *preview, rctf *prv) -{ - float xscale= (prv->xmax-prv->xmin)/((float)preview->xsize); - float yscale= (prv->ymax-prv->ymin)/((float)preview->ysize); - float tile= (prv->xmax - prv->xmin) / 10.0; - float x, y; - - /* draw checkerboard backdrop to show alpha */ - glColor3ub(120, 120, 120); - glRectf(prv->xmin, prv->ymin, prv->xmax, prv->ymax); - glColor3ub(160, 160, 160); - - for(y=prv->ymin; yymax; y+=tile*2) { - for(x=prv->xmin; xxmax; x+=tile*2) { - float tilex= tile, tiley= tile; - - if(x+tile > prv->xmax) - tilex= prv->xmax-x; - if(y+tile > prv->ymax) - tiley= prv->ymax-y; - - glRectf(x, y, x + tilex, y + tiley); - } - } - for(y=prv->ymin+tile; yymax; y+=tile*2) { - for(x=prv->xmin+tile; xxmax; x+=tile*2) { - float tilex= tile, tiley= tile; - - if(x+tile > prv->xmax) - tilex= prv->xmax-x; - if(y+tile > prv->ymax) - tiley= prv->ymax-y; - - glRectf(x, y, x + tilex, y + tiley); - } - } - - glPixelZoom(xscale, yscale); - glEnable(GL_BLEND); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */ - - glColor4f(1.0, 1.0, 1.0, 1.0); - glaDrawPixelsTex(prv->xmin, prv->ymin, preview->xsize, preview->ysize, GL_FLOAT, preview->rect); - - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glDisable(GL_BLEND); - glPixelZoom(1.0f, 1.0f); - - BIF_ThemeColorShadeAlpha(TH_BACK, -15, +100); - fdrawbox(prv->xmin, prv->ymin, prv->xmax, prv->ymax); - -} - -/* based on settings in node, sets drawing rect info. each redraw! */ -static void node_update_hidden(bNode *node) -{ - bNodeSocket *nsock; - float rad, drad, hiddenrad= HIDDEN_RAD; - int totin=0, totout=0, tot; - - /* calculate minimal radius */ - for(nsock= node->inputs.first; nsock; nsock= nsock->next) - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - totin++; - for(nsock= node->outputs.first; nsock; nsock= nsock->next) - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - totout++; - - tot= MAX2(totin, totout); - if(tot>4) { - hiddenrad += 5.0*(float)(tot-4); - } - - node->totr.xmin= node->locx; - node->totr.xmax= node->locx + 3*hiddenrad + node->miniwidth; - node->totr.ymax= node->locy + (hiddenrad - 0.5f*NODE_DY); - node->totr.ymin= node->totr.ymax - 2*hiddenrad; - - /* output sockets */ - rad=drad= M_PI/(1.0f + (float)totout); - - for(nsock= node->outputs.first; nsock; nsock= nsock->next) { - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - nsock->locx= node->totr.xmax - hiddenrad + sin(rad)*hiddenrad; - nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad; - rad+= drad; - } - } - - /* input sockets */ - rad=drad= - M_PI/(1.0f + (float)totin); - - for(nsock= node->inputs.first; nsock; nsock= nsock->next) { - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - nsock->locx= node->totr.xmin + hiddenrad + sin(rad)*hiddenrad; - nsock->locy= node->totr.ymin + hiddenrad + cos(rad)*hiddenrad; - rad+= drad; - } - } -} - -/* based on settings in node, sets drawing rect info. each redraw! */ -static void node_update(bNode *node) -{ - bNodeSocket *nsock; - float dy= node->locy; - - /* header */ - dy-= NODE_DY; - - /* little bit space in top */ - if(node->outputs.first) - dy-= NODE_DYS/2; - - /* output sockets */ - for(nsock= node->outputs.first; nsock; nsock= nsock->next) { - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - nsock->locx= node->locx + node->width; - nsock->locy= dy - NODE_DYS; - dy-= NODE_DY; - } - } - - node->prvr.xmin= node->butr.xmin= node->locx + NODE_DYS; - node->prvr.xmax= node->butr.xmax= node->locx + node->width- NODE_DYS; - - /* preview rect? */ - if(node->flag & NODE_PREVIEW) { - /* only recalculate size when there's a preview actually, otherwise we use stored result */ - if(node->preview && node->preview->rect) { - float aspect= 1.0f; - - if(node->preview && node->preview->xsize && node->preview->ysize) - aspect= (float)node->preview->ysize/(float)node->preview->xsize; - - dy-= NODE_DYS/2; - node->prvr.ymax= dy; - - if(aspect <= 1.0f) - node->prvr.ymin= dy - aspect*(node->width-NODE_DY); - else { - float dx= (node->width - NODE_DYS) - (node->width- NODE_DYS)/aspect; /* width correction of image */ - - node->prvr.ymin= dy - (node->width-NODE_DY); - - node->prvr.xmin+= 0.5*dx; - node->prvr.xmax-= 0.5*dx; - } - - dy= node->prvr.ymin - NODE_DYS/2; - - /* make sure that maximums are bigger or equal to minimums */ - if(node->prvr.xmax < node->prvr.xmin) SWAP(float, node->prvr.xmax, node->prvr.xmin); - if(node->prvr.ymax < node->prvr.ymin) SWAP(float, node->prvr.ymax, node->prvr.ymin); - } - else { - float oldh= node->prvr.ymax - node->prvr.ymin; - if(oldh==0.0f) - oldh= 0.6f*node->width-NODE_DY; - dy-= NODE_DYS/2; - node->prvr.ymax= dy; - node->prvr.ymin= dy - oldh; - dy= node->prvr.ymin - NODE_DYS/2; - } - } - - /* XXX ugly hack, typeinfo for group is generated */ - if(node->type == NODE_GROUP) - node->typeinfo->butfunc= node_buts_group; - - /* buttons rect? */ - if((node->flag & NODE_OPTIONS) && node->typeinfo->butfunc) { - dy-= NODE_DYS/2; - node->butr.ymax= dy; - node->butr.ymin= dy - (float)node->typeinfo->butfunc(NULL, NULL, node, NULL); - dy= node->butr.ymin - NODE_DYS/2; - } - - /* input sockets */ - for(nsock= node->inputs.first; nsock; nsock= nsock->next) { - if(!(nsock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - nsock->locx= node->locx; - nsock->locy= dy - NODE_DYS; - dy-= NODE_DY; - } - } - - /* little bit space in end */ - if(node->inputs.first || (node->flag & (NODE_OPTIONS|NODE_PREVIEW))==0 ) - dy-= NODE_DYS/2; - - node->totr.xmin= node->locx; - node->totr.xmax= node->locx + node->width; - node->totr.ymax= node->locy; - node->totr.ymin= dy; -} - -/* based on settings in node, sets drawing rect info. each redraw! */ -/* note: this assumes only 1 group at a time is drawn (linked data) */ -/* in node->totr the entire boundbox for the group is stored */ -static void node_update_group(bNode *gnode) -{ - bNodeTree *ngroup= (bNodeTree *)gnode->id; - bNode *node; - bNodeSocket *nsock; - rctf *rect= &gnode->totr; - int counter; - - /* center them, is a bit of abuse of locx and locy though */ - for(node= ngroup->nodes.first; node; node= node->next) { - node->locx+= gnode->locx; - node->locy+= gnode->locy; - if(node->flag & NODE_HIDDEN) - node_update_hidden(node); - else - node_update(node); - node->locx-= gnode->locx; - node->locy-= gnode->locy; - } - counter= 1; - for(node= ngroup->nodes.first; node; node= node->next) { - if(counter) { - *rect= node->totr; - counter= 0; - } - else - BLI_union_rctf(rect, &node->totr); - } - if(counter==1) return; /* should be prevented? */ - - rect->xmin-= NODE_DY; - rect->ymin-= NODE_DY; - rect->xmax+= NODE_DY; - rect->ymax+= NODE_DY; - - /* output sockets */ - for(nsock= gnode->outputs.first; nsock; nsock= nsock->next) { - nsock->locx= rect->xmax; - nsock->locy= nsock->tosock->locy; - } - - /* input sockets */ - for(nsock= gnode->inputs.first; nsock; nsock= nsock->next) { - nsock->locx= rect->xmin; - nsock->locy= nsock->tosock->locy; - } -} - -static void node_scaling_widget(int color_id, float aspect, float xmin, float ymin, float xmax, float ymax) -{ - float dx; - float dy; - - dx= 0.5f*(xmax-xmin); - dy= 0.5f*(ymax-ymin); - - BIF_ThemeColorShade(color_id, +30); - fdrawline(xmin, ymin, xmax, ymax); - fdrawline(xmin+dx, ymin, xmax, ymax-dy); - - BIF_ThemeColorShade(color_id, -10); - fdrawline(xmin, ymin+aspect, xmax, ymax+aspect); - fdrawline(xmin+dx, ymin+aspect, xmax, ymax-dy+aspect); -} - -static int node_get_colorid(bNode *node) -{ - if(node->typeinfo->nclass==NODE_CLASS_INPUT) - return TH_NODE_IN_OUT; - if(node->typeinfo->nclass==NODE_CLASS_OUTPUT) { - if(node->flag & NODE_DO_OUTPUT) - return TH_NODE_IN_OUT; - else - return TH_NODE; - } - if(node->typeinfo->nclass==NODE_CLASS_CONVERTOR) - return TH_NODE_CONVERTOR; - if(ELEM3(node->typeinfo->nclass, NODE_CLASS_OP_COLOR, NODE_CLASS_OP_VECTOR, NODE_CLASS_OP_FILTER)) - return TH_NODE_OPERATOR; - if(node->typeinfo->nclass==NODE_CLASS_GROUP) - return TH_NODE_GROUP; - return TH_NODE; -} - -static void node_draw_basis(ScrArea *sa, SpaceNode *snode, bNode *node) -{ - bNodeSocket *sock; - uiBlock *block= NULL; - uiBut *bt; - rctf *rct= &node->totr; - float slen, iconofs; - int ofs, color_id= node_get_colorid(node); - - uiSetRoundBox(15-4); - ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT); - - /* header */ - if(color_id==TH_NODE) - BIF_ThemeColorShade(color_id, -20); - else - BIF_ThemeColor(color_id); - - uiSetRoundBox(3); - uiRoundBox(rct->xmin, rct->ymax-NODE_DY, rct->xmax, rct->ymax, BASIS_RAD); - - /* show/hide icons, note this sequence is copied in editnode.c */ - iconofs= rct->xmax; - - if(node->typeinfo->flag & NODE_PREVIEW) { - int icon_id; - - if(node->flag & (NODE_ACTIVE_ID|NODE_DO_OUTPUT)) - icon_id= ICON_MATERIAL; - else - icon_id= ICON_MATERIAL_DEHLT; - iconofs-= 18.0f; - glEnable(GL_BLEND); - BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, icon_id, snode->aspect, -60); - glDisable(GL_BLEND); - } - if(node->type == NODE_GROUP) { - - iconofs-= 18.0f; - glEnable(GL_BLEND); - if(node->id->lib) { - glPixelTransferf(GL_GREEN_SCALE, 0.7f); - glPixelTransferf(GL_BLUE_SCALE, 0.3f); - BIF_icon_draw_aspect(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect); - glPixelTransferf(GL_GREEN_SCALE, 1.0f); - glPixelTransferf(GL_BLUE_SCALE, 1.0f); - } - else { - BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_NODE, snode->aspect, -60); - } - glDisable(GL_BLEND); - } - if(node->typeinfo->flag & NODE_OPTIONS) { - iconofs-= 18.0f; - glEnable(GL_BLEND); - BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_BUTS, snode->aspect, -60); - glDisable(GL_BLEND); - } - { /* always hide/reveil unused sockets */ - int shade; - - iconofs-= 18.0f; - if(node_has_hidden_sockets(node)) - shade= -40; - else - shade= -90; - glEnable(GL_BLEND); - BIF_icon_draw_aspect_blended(iconofs, rct->ymax-NODE_DY+2, ICON_PLUS, snode->aspect, shade); - glDisable(GL_BLEND); - } - - /* title */ - if(node->flag & SELECT) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10); - - /* open/close entirely? */ - ui_draw_tria_icon(rct->xmin+8.0f, rct->ymax-NODE_DY+4.0f, snode->aspect, 'v'); - - if(node->flag & SELECT) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - - ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect); - snode_drawstring(snode, node->name, (int)(iconofs - rct->xmin-18.0f)); - - /* body */ - BIF_ThemeColor4(TH_NODE); - glEnable(GL_BLEND); - uiSetRoundBox(8); - uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax-NODE_DY, BASIS_RAD); - glDisable(GL_BLEND); - - /* scaling indicator */ - node_scaling_widget(TH_NODE, snode->aspect, rct->xmax-BASIS_RAD*snode->aspect, rct->ymin, rct->xmax, rct->ymin+BASIS_RAD*snode->aspect); - - /* outline active emphasis */ - if(node->flag & NODE_ACTIVE) { - glEnable(GL_BLEND); - glColor4ub(200, 200, 200, 140); - uiSetRoundBox(15-4); - gl_round_box(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD); - glDisable(GL_BLEND); - } - - /* we make buttons for input sockets, if... */ - if(node->flag & NODE_OPTIONS) { - if(node->inputs.first || node->typeinfo->butfunc) { - char str[32]; - - /* make unique block name, also used for handling blocks in editnode.c */ - sprintf(str, "node buttons %p", node); - - block= uiNewBlock(&sa->uiblocks, str, UI_EMBOSS, UI_HELV, sa->win); - uiBlockSetFlag(block, UI_BLOCK_NO_HILITE); - if(snode->id) - uiSetButLock(snode->id->lib!=NULL, ERROR_LIBDATA_MESSAGE); - } - } - - /* hurmf... another candidate for callback, have to see how this works first */ - if(node->id && block && snode->treetype==NTREE_SHADER) - nodeShaderSynchronizeID(node, 0); - - /* socket inputs, buttons */ - for(sock= node->inputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - - if(block && sock->link==NULL) { - float *butpoin= sock->ns.vec; - - if(sock->type==SOCK_VALUE) { - bt= uiDefButF(block, NUM, B_NODE_EXEC+node->nr, sock->name, - (short)sock->locx+NODE_DYS, (short)(sock->locy)-9, (short)node->width-NODE_DY, 17, - butpoin, sock->ns.min, sock->ns.max, 10, 2, ""); - uiButSetFunc(bt, node_sync_cb, snode, node); - } - else if(sock->type==SOCK_VECTOR) { - uiDefBlockBut(block, socket_vector_menu, sock, sock->name, - (short)sock->locx+NODE_DYS, (short)sock->locy-9, (short)node->width-NODE_DY, 17, - ""); - } - else if(block && sock->type==SOCK_RGBA) { - short labelw= node->width-NODE_DY-40, width; - - if(labelw>0) width= 40; else width= node->width-NODE_DY; - - bt= uiDefButF(block, COL, B_NODE_EXEC+node->nr, "", - (short)(sock->locx+NODE_DYS), (short)sock->locy-8, width, 15, - butpoin, 0, 0, 0, 0, ""); - uiButSetFunc(bt, node_sync_cb, snode, node); - - if(labelw>0) uiDefBut(block, LABEL, 0, sock->name, - (short)(sock->locx+NODE_DYS) + 40, (short)sock->locy-8, labelw, 15, - NULL, 0, 0, 0, 0, ""); - } - } - else { - BIF_ThemeColor(TH_TEXT); - ui_rasterpos_safe(sock->locx+8.0f, sock->locy-5.0f, snode->aspect); - BIF_DrawString(snode->curfont, sock->name, 0); - } - } - } - - /* socket outputs */ - for(sock= node->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - - BIF_ThemeColor(TH_TEXT); - ofs= 0; - slen= snode->aspect*BIF_GetStringWidth(snode->curfont, sock->name, 0); - while(slen > node->width) { - ofs++; - slen= snode->aspect*BIF_GetStringWidth(snode->curfont, sock->name+ofs, 0); - } - ui_rasterpos_safe(sock->locx-8.0f-slen, sock->locy-5.0f, snode->aspect); - BIF_DrawString(snode->curfont, sock->name+ofs, 0); - } - } - - /* preview */ - if(node->flag & NODE_PREVIEW) - if(node->preview && node->preview->rect) - node_draw_preview(node->preview, &node->prvr); - - /* buttons */ - if(node->flag & NODE_OPTIONS) { - if(block) { - if(node->typeinfo->butfunc) { - node->typeinfo->butfunc(block, snode->nodetree, node, &node->butr); - } - uiDrawBlock(block); - } - } - -} - -void node_draw_hidden(SpaceNode *snode, bNode *node) -{ - bNodeSocket *sock; - rctf *rct= &node->totr; - float dx, centy= 0.5f*(rct->ymax+rct->ymin); - float hiddenrad= 0.5f*(rct->ymax-rct->ymin); - int color_id= node_get_colorid(node); - - /* shadow */ - uiSetRoundBox(15); - ui_dropshadow(rct, hiddenrad, snode->aspect, node->flag & SELECT); - - /* body */ - BIF_ThemeColor(color_id); - uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad); - - /* outline active emphasis */ - if(node->flag & NODE_ACTIVE) { - glEnable(GL_BLEND); - glColor4ub(200, 200, 200, 140); - gl_round_box(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, hiddenrad); - glDisable(GL_BLEND); - } - - /* title */ - if(node->flag & SELECT) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColorBlendShade(TH_TEXT, color_id, 0.4, 10); - - /* open entirely icon */ - ui_draw_tria_icon(rct->xmin+9.0f, centy-6.0f, snode->aspect, 'h'); - - if(node->flag & SELECT) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - - if(node->miniwidth>0.0f) { - ui_rasterpos_safe(rct->xmin+21.0f, centy-4.0f, snode->aspect); - snode_drawstring(snode, node->name, (int)(rct->xmax - rct->xmin-18.0f -12.0f)); - } - - /* scale widget thing */ - BIF_ThemeColorShade(color_id, -10); - dx= 10.0f; - fdrawline(rct->xmax-dx, centy-4.0f, rct->xmax-dx, centy+4.0f); - fdrawline(rct->xmax-dx-3.0f*snode->aspect, centy-4.0f, rct->xmax-dx-3.0f*snode->aspect, centy+4.0f); - - BIF_ThemeColorShade(color_id, +30); - dx-= snode->aspect; - fdrawline(rct->xmax-dx, centy-4.0f, rct->xmax-dx, centy+4.0f); - fdrawline(rct->xmax-dx-3.0f*snode->aspect, centy-4.0f, rct->xmax-dx-3.0f*snode->aspect, centy+4.0f); - - /* sockets */ - for(sock= node->inputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - } - - for(sock= node->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - } -} - -/* note; this is used for fake links in groups too */ -void node_draw_link(SpaceNode *snode, bNodeLink *link) -{ - float vec[4][3]; - float dist, spline_step, mx=0.0f, my=0.0f; - int curve_res, do_shaded= 1, th_col1= TH_WIRE, th_col2= TH_WIRE; - - if(link->fromnode==NULL && link->tonode==NULL) - return; - - /* this is dragging link */ - if(link->fromnode==NULL || link->tonode==NULL) { - short mval[2]; - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - BIF_ThemeColor(TH_WIRE); - do_shaded= 0; - } - else { - /* going to give issues once... */ - if(link->tosock->flag & SOCK_UNAVAIL) - return; - if(link->fromsock->flag & SOCK_UNAVAIL) - return; - - /* a bit ugly... but thats how we detect the internal group links */ - if(link->fromnode==link->tonode) { - BIF_ThemeColorBlend(TH_BACK, TH_WIRE, 0.25f); - do_shaded= 0; - } - else { - /* check cyclic */ - if(link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) { - if(link->fromnode->flag & SELECT) - th_col1= TH_EDGE_SELECT; - if(link->tonode->flag & SELECT) - th_col2= TH_EDGE_SELECT; - } - else { - BIF_ThemeColor(TH_REDALERT); - do_shaded= 0; - } - } - } - - vec[0][2]= vec[1][2]= vec[2][2]= vec[3][2]= 0.0; /* only 2d spline, set the Z to 0*/ - - /* in v0 and v3 we put begin/end points */ - if(link->fromnode) { - vec[0][0]= link->fromsock->locx; - vec[0][1]= link->fromsock->locy; - } - else { - vec[0][0]= mx; - vec[0][1]= my; - } - if(link->tonode) { - vec[3][0]= link->tosock->locx; - vec[3][1]= link->tosock->locy; - } - else { - vec[3][0]= mx; - vec[3][1]= my; - } - - dist= 0.5f*ABS(vec[0][0] - vec[3][0]); - - /* check direction later, for top sockets */ - vec[1][0]= vec[0][0]+dist; - vec[1][1]= vec[0][1]; - - vec[2][0]= vec[3][0]-dist; - vec[2][1]= vec[3][1]; - - if( MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > G.v2d->cur.xmax); /* clipped */ - else if ( MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < G.v2d->cur.xmin); /* clipped */ - else { - curve_res = 24; - - /* we can reuse the dist variable here to increment the GL curve eval amount*/ - dist = 1.0f/curve_res; - spline_step = 0.0f; - - glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]); - glBegin(GL_LINE_STRIP); - while (spline_step < 1.000001f) { - if(do_shaded) - BIF_ThemeColorBlend(th_col1, th_col2, spline_step); - glEvalCoord1f(spline_step); - spline_step += dist; - } - glEnd(); - } -} - -static void node_draw_nodetree(ScrArea *sa, SpaceNode *snode, bNodeTree *ntree) -{ - bNode *node; - bNodeLink *link; - int a; - - if(ntree==NULL) return; /* groups... */ - - /* node lines */ - glEnable(GL_BLEND); - glEnable( GL_LINE_SMOOTH ); - for(link= ntree->links.first; link; link= link->next) - node_draw_link(snode, link); - glDisable(GL_BLEND); - glDisable( GL_LINE_SMOOTH ); - - /* not selected first */ - for(a=0, node= ntree->nodes.first; node; node= node->next, a++) { - node->nr= a; /* index of node in list, used for exec event code */ - if(!(node->flag & SELECT)) { - if(node->flag & NODE_GROUP_EDIT); - else if(node->flag & NODE_HIDDEN) - node_draw_hidden(snode, node); - else - node_draw_basis(sa, snode, node); - } - } - - /* selected */ - for(node= ntree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - if(node->flag & NODE_GROUP_EDIT); - else if(node->flag & NODE_HIDDEN) - node_draw_hidden(snode, node); - else - node_draw_basis(sa, snode, node); - } - } -} - -/* fake links from groupnode to internal nodes */ -static void node_draw_group_links(SpaceNode *snode, bNode *gnode) -{ - bNodeLink fakelink; - bNodeSocket *sock; - - glEnable(GL_BLEND); - glEnable( GL_LINE_SMOOTH ); - - fakelink.tonode= fakelink.fromnode= gnode; - - for(sock= gnode->inputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(sock->tosock) { - fakelink.fromsock= sock; - fakelink.tosock= sock->tosock; - node_draw_link(snode, &fakelink); - } - } - } - - for(sock= gnode->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(sock->tosock) { - fakelink.tosock= sock; - fakelink.fromsock= sock->tosock; - node_draw_link(snode, &fakelink); - } - } - } - - glDisable(GL_BLEND); - glDisable( GL_LINE_SMOOTH ); -} - -/* groups are, on creation, centered around 0,0 */ -static void node_draw_group(ScrArea *sa, SpaceNode *snode, bNode *gnode) -{ - bNodeTree *ngroup= (bNodeTree *)gnode->id; - bNodeSocket *sock; - rctf rect= gnode->totr; - - /* backdrop header */ - glEnable(GL_BLEND); - uiSetRoundBox(3); - BIF_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70); - gl_round_box(GL_POLYGON, rect.xmin, rect.ymax, rect.xmax, rect.ymax+NODE_DY, BASIS_RAD); - - /* backdrop body */ - BIF_ThemeColorShadeAlpha(TH_BACK, -8, -70); - uiSetRoundBox(12); - gl_round_box(GL_POLYGON, rect.xmin, rect.ymin, rect.xmax, rect.ymax, BASIS_RAD); - - /* selection outline */ - uiSetRoundBox(15); - glColor4ub(200, 200, 200, 140); - glEnable( GL_LINE_SMOOTH ); - gl_round_box(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax+NODE_DY, BASIS_RAD); - glDisable( GL_LINE_SMOOTH ); - glDisable(GL_BLEND); - - /* backdrop title */ - BIF_ThemeColor(TH_TEXT_HI); - ui_rasterpos_safe(rect.xmin+8.0f, rect.ymax+5.0f, snode->aspect); - BIF_DrawString(snode->curfont, ngroup->id.name+2, 0); - - /* links from groupsockets to the internal nodes */ - node_draw_group_links(snode, gnode); - - /* group sockets */ - for(sock= gnode->inputs.first; sock; sock= sock->next) - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - for(sock= gnode->outputs.first; sock; sock= sock->next) - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock->locx, sock->locy, NODE_SOCKSIZE, sock->type, sock->flag & SELECT); - - /* and finally the whole tree */ - node_draw_nodetree(sa, snode, ngroup); -} - - -void drawnodespace(ScrArea *sa, void *spacedata) -{ - SpaceNode *snode= sa->spacedata.first; - float col[3]; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - calc_scrollrcts(sa, &(snode->v2d), sa->winx, sa->winy); - - myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax); - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - /* always free, blocks here have no unique identifier (1 block per node) */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - /* only set once */ - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glEnable(GL_MAP1_VERTEX_3); - - /* aspect+font, set each time */ - snode->aspect= (snode->v2d.cur.xmax - snode->v2d.cur.xmin)/((float)sa->winx); - snode->curfont= uiSetCurFont_ext(snode->aspect); - - /* backdrop */ - draw_nodespace_back(sa, snode); - - /* nodes */ - snode_set_context(snode); - - if(snode->nodetree) { - bNode *node; - - /* for now, we set drawing coordinates on each redraw */ - for(node= snode->nodetree->nodes.first; node; node= node->next) { - if(node->flag & NODE_GROUP_EDIT) - node_update_group(node); - else if(node->flag & NODE_HIDDEN) - node_update_hidden(node); - else - node_update(node); - } - - node_draw_nodetree(sa, snode, snode->nodetree); - - /* active group */ - for(node= snode->nodetree->nodes.first; node; node= node->next) { - if(node->flag & NODE_GROUP_EDIT) - node_draw_group(sa, snode, node); - } - } - - /* restore viewport (not needed yet) */ - mywinset(sa->win); - - /* ortho at pixel level curarea */ - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - draw_area_emboss(sa); - curarea->win_swap= WIN_BACK_OK; - - /* in the end, this is a delayed previewrender test, to allow buttons to be first */ - if(snode->flag & SNODE_DO_PREVIEW) { - addafterqueue(sa->win, RENDERPREVIEW, 1); - snode->flag &= ~SNODE_DO_PREVIEW; - } -} diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c deleted file mode 100644 index db2225f4823..00000000000 --- a/source/blender/src/drawobject.c +++ /dev/null @@ -1,5555 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "IMB_imbuf.h" - - -#include "MTC_matrixops.h" - -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_constraint_types.h" // for drawing constraint -#include "DNA_effect_types.h" -#include "DNA_ipo_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_meta_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -// FSPARTICLE -#include "DNA_object_fluidsim.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_edgehash.h" -#include "BLI_rand.h" - -#include "BKE_utildefines.h" -#include "BKE_curve.h" -#include "BKE_constraint.h" // for the get_constraint_target function -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_anim.h" //for the where_on_path function -#include "BKE_particle.h" -#include "BKE_utildefines.h" -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_editarmature.h" -#include "BIF_editdeform.h" -#include "BIF_editmesh.h" -#include "BIF_editparticle.h" -#include "BIF_glutil.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BDR_drawmesh.h" -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "BDR_sculptmode.h" -#include "BDR_vpaint.h" - -#include "BSE_drawview.h" -#include "BSE_node.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" - -#include "blendef.h" -#include "mydevice.h" -#include "nla.h" - -#include "BKE_deform.h" - -/* pretty stupid */ -/* extern Lattice *editLatt; already in BKE_lattice.h */ -/* editcurve.c */ -extern ListBase editNurb; -/* editmball.c */ -extern ListBase editelems; - -static void draw_bounding_volume(Object *ob); - -static void drawcube_size(float size); -static void drawcircle_size(float size); -static void draw_empty_sphere(float size); -static void draw_empty_cone(float size); - -/* ************* Setting OpenGL Material ************ */ - -// Materials start counting at # one.... -#define MAXMATBUF (MAXMAT + 1) -static float matbuf[MAXMATBUF][2][4]; -static int totmat_gl= 0; - -int set_gl_material(int nr) -{ - static int last_gl_matnr= -1; - static int last_ret_val= 1; - - /* prevent index to use un-initialized array items */ - if(nr>totmat_gl) nr= totmat_gl; - - if(nr<0) { - last_gl_matnr= -1; - last_ret_val= 1; - } - else if(nrtotcol==0) { - matbuf[0][0][0]= defmaterial.r; - matbuf[0][0][1]= defmaterial.g; - matbuf[0][0][2]= defmaterial.b; - matbuf[0][0][3]= 1.0; - - matbuf[0][1][0]= defmaterial.specr; - matbuf[0][1][1]= defmaterial.specg; - matbuf[0][1][2]= defmaterial.specb; - matbuf[0][1][3]= 1.0; - - /* do material 1 too, for displists! */ - QUATCOPY(matbuf[1][0], matbuf[0][0]); - QUATCOPY(matbuf[1][1], matbuf[0][1]); - } - - for(a=1; a<=ob->totcol; a++) { - ma= give_current_material(ob, a); - ma= editnode_get_active_material(ma); - if(ma==NULL) ma= &defmaterial; - - if(amode & MA_SHLESS) { - matbuf[a][0][0]= 2*ma->r; - matbuf[a][0][1]= 2*ma->g; - matbuf[a][0][2]= 2*ma->b; - } else { - matbuf[a][0][0]= (ma->ref+ma->emit)*ma->r; - matbuf[a][0][1]= (ma->ref+ma->emit)*ma->g; - matbuf[a][0][2]= (ma->ref+ma->emit)*ma->b; - } - - /* draw transparent, not in pick-select, nor editmode */ - if(check_alpha && !(G.f & G_PICKSEL) && (ob->dtx & OB_DRAWTRANSP) && !(G.obedit && G.obedit->data==ob->data)) { - if(G.vd->transp) { // drawing the transparent pass - if(ma->alpha==1.0) matbuf[a][0][3]= 0.0; // means skip solid - else matbuf[a][0][3]= ma->alpha; - } - else { // normal pass - if(ma->alpha==1.0) matbuf[a][0][3]= 1.0; - else { - matbuf[a][0][3]= 0.0; // means skip transparent - has_alpha= 1; // return value, to indicate adding to after-draw queue - } - } - } - else - matbuf[a][0][3]= 1.0; - - if (!(ma->mode & MA_SHLESS)) { - matbuf[a][1][0]= ma->spec*ma->specr; - matbuf[a][1][1]= ma->spec*ma->specg; - matbuf[a][1][2]= ma->spec*ma->specb; - matbuf[a][1][3]= 1.0; - } - } - } - - totmat_gl= ob->totcol; - set_gl_material(-1); // signal for static variable - return has_alpha; -} - - - /***/ -static unsigned int colortab[24]= - {0x0, 0xFF88FF, 0xFFBBFF, - 0x403000, 0xFFFF88, 0xFFFFBB, - 0x104040, 0x66CCCC, 0x77CCCC, - 0x104010, 0x55BB55, 0x66FF66, - 0xFFFFFF -}; - - -static float cube[8][3] = { - {-1.0, -1.0, -1.0}, - {-1.0, -1.0, 1.0}, - {-1.0, 1.0, 1.0}, - {-1.0, 1.0, -1.0}, - { 1.0, -1.0, -1.0}, - { 1.0, -1.0, 1.0}, - { 1.0, 1.0, 1.0}, - { 1.0, 1.0, -1.0}, -}; - -/* ----------------- OpenGL Circle Drawing - Tables for Optimised Drawing Speed ------------------ */ -/* 32 values of sin function (still same result!) */ -static float sinval[32] = { - 0.00000000, - 0.20129852, - 0.39435585, - 0.57126821, - 0.72479278, - 0.84864425, - 0.93775213, - 0.98846832, - 0.99871650, - 0.96807711, - 0.89780453, - 0.79077573, - 0.65137248, - 0.48530196, - 0.29936312, - 0.10116832, - -0.10116832, - -0.29936312, - -0.48530196, - -0.65137248, - -0.79077573, - -0.89780453, - -0.96807711, - -0.99871650, - -0.98846832, - -0.93775213, - -0.84864425, - -0.72479278, - -0.57126821, - -0.39435585, - -0.20129852, - 0.00000000 -}; - -/* 32 values of cos function (still same result!) */ -static float cosval[32] ={ - 1.00000000, - 0.97952994, - 0.91895781, - 0.82076344, - 0.68896691, - 0.52896401, - 0.34730525, - 0.15142777, - -0.05064916, - -0.25065253, - -0.44039415, - -0.61210598, - -0.75875812, - -0.87434661, - -0.95413925, - -0.99486932, - -0.99486932, - -0.95413925, - -0.87434661, - -0.75875812, - -0.61210598, - -0.44039415, - -0.25065253, - -0.05064916, - 0.15142777, - 0.34730525, - 0.52896401, - 0.68896691, - 0.82076344, - 0.91895781, - 0.97952994, - 1.00000000 -}; - -/* flag is same as for draw_object */ -void drawaxes(float size, int flag, char drawtype) -{ - int axis; - float v1[3]= {0.0, 0.0, 0.0}; - float v2[3]= {0.0, 0.0, 0.0}; - float v3[3]= {0.0, 0.0, 0.0}; - - switch(drawtype) { - - case OB_PLAINAXES: - for (axis=0; axis<3; axis++) { - float v1[3]= {0.0, 0.0, 0.0}; - float v2[3]= {0.0, 0.0, 0.0}; - - glBegin(GL_LINES); - - v1[axis]= size; - v2[axis]= -size; - glVertex3fv(v1); - glVertex3fv(v2); - - glEnd(); - } - break; - case OB_SINGLE_ARROW: - - glBegin(GL_LINES); - /* in positive z direction only */ - v1[2]= size; - glVertex3fv(v1); - glVertex3fv(v2); - glEnd(); - - /* square pyramid */ - glBegin(GL_TRIANGLES); - - v2[0]= size*0.035; v2[1] = size*0.035; - v3[0]= size*-0.035; v3[1] = size*0.035; - v2[2]= v3[2]= size*0.75; - - for (axis=0; axis<4; axis++) { - if (axis % 2 == 1) { - v2[0] *= -1; - v3[1] *= -1; - } else { - v2[1] *= -1; - v3[0] *= -1; - } - - glVertex3fv(v1); - glVertex3fv(v2); - glVertex3fv(v3); - - } - glEnd(); - - break; - case OB_CUBE: - drawcube_size(size); - break; - - case OB_CIRCLE: - drawcircle_size(size); - break; - - case OB_EMPTY_SPHERE: - draw_empty_sphere(size); - break; - - case OB_EMPTY_CONE: - draw_empty_cone(size); - break; - - case OB_ARROWS: - default: - for (axis=0; axis<3; axis++) { - float v1[3]= {0.0, 0.0, 0.0}; - float v2[3]= {0.0, 0.0, 0.0}; - int arrow_axis= (axis==0)?1:0; - - glBegin(GL_LINES); - - v2[axis]= size; - glVertex3fv(v1); - glVertex3fv(v2); - - v1[axis]= size*0.8; - v1[arrow_axis]= -size*0.125; - glVertex3fv(v1); - glVertex3fv(v2); - - v1[arrow_axis]= size*0.125; - glVertex3fv(v1); - glVertex3fv(v2); - - glEnd(); - - v2[axis]+= size*0.125; - glRasterPos3fv(v2); - - // patch for 3d cards crashing on glSelect for text drawing (IBM) - if((flag & DRAW_PICKING) == 0) { - if (axis==0) - BMF_DrawString(G.font, "x"); - else if (axis==1) - BMF_DrawString(G.font, "y"); - else - BMF_DrawString(G.font, "z"); - } - } - break; - } -} - -/* circle for object centers, special_color is for library or ob users */ -static void drawcentercircle(float *vec, int selstate, int special_color) -{ - View3D *v3d= G.vd; - float size; - - size= v3d->persmat[0][3]*vec[0]+ v3d->persmat[1][3]*vec[1]+ v3d->persmat[2][3]*vec[2]+ v3d->persmat[3][3]; - size*= v3d->pixsize*((float)U.obcenter_dia*0.5f); - - /* using gldepthfunc guarantees that it does write z values, but not checks for it, so centers remain visible independt order of drawing */ - if(v3d->zbuf) glDepthFunc(GL_ALWAYS); - glEnable(GL_BLEND); - - if(special_color) { -#ifdef WITH_VERSE - if (selstate==VERSE) glColor4ub(0x00, 0xFF, 0x00, 155); - else if (selstate==ACTIVE || selstate==SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155); -#else - if (selstate==ACTIVE || selstate==SELECT) glColor4ub(0x88, 0xFF, 0xFF, 155); -#endif - - else glColor4ub(0x55, 0xCC, 0xCC, 155); - } - else { - if (selstate == ACTIVE) BIF_ThemeColorShadeAlpha(TH_ACTIVE, 0, -80); - else if (selstate == SELECT) BIF_ThemeColorShadeAlpha(TH_SELECT, 0, -80); - else if (selstate == DESELECT) BIF_ThemeColorShadeAlpha(TH_TRANSFORM, 0, -80); - } - drawcircball(GL_POLYGON, vec, size, v3d->viewinv); - - BIF_ThemeColorShadeAlpha(TH_WIRE, 0, -30); - drawcircball(GL_LINE_LOOP, vec, size, v3d->viewinv); - - glDisable(GL_BLEND); - if(v3d->zbuf) glDepthFunc(GL_LEQUAL); -} - - -void drawsolidcube(float size) -{ - float n[3]; - - glPushMatrix(); - glScalef(size, size, size); - - n[0]=0; n[1]=0; n[2]=0; - glBegin(GL_QUADS); - n[0]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[1]); glVertex3fv(cube[2]); glVertex3fv(cube[3]); - n[0]=0; - glEnd(); - - glBegin(GL_QUADS); - n[1]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[0]); glVertex3fv(cube[4]); glVertex3fv(cube[5]); glVertex3fv(cube[1]); - n[1]=0; - glEnd(); - - glBegin(GL_QUADS); - n[0]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[4]); glVertex3fv(cube[7]); glVertex3fv(cube[6]); glVertex3fv(cube[5]); - n[0]=0; - glEnd(); - - glBegin(GL_QUADS); - n[1]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[3]); glVertex3fv(cube[2]); glVertex3fv(cube[6]); - n[1]=0; - glEnd(); - - glBegin(GL_QUADS); - n[2]= 1.0; - glNormal3fv(n); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); glVertex3fv(cube[6]); glVertex3fv(cube[2]); - n[2]=0; - glEnd(); - - glBegin(GL_QUADS); - n[2]= -1.0; - glNormal3fv(n); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); glVertex3fv(cube[0]); glVertex3fv(cube[3]); - glEnd(); - - glPopMatrix(); -} - -static void drawcube(void) -{ - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]); - glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[2]); glVertex3fv(cube[6]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[3]); glVertex3fv(cube[7]); - glEnd(); -} - -/* draws a cube on given the scaling of the cube, assuming that - * all required matrices have been set (used for drawing empties) - */ -static void drawcube_size(float size) -{ - glBegin(GL_LINE_STRIP); - glVertex3f(-size,-size,-size); glVertex3f(-size,-size,size);glVertex3f(-size,size,size); glVertex3f(-size,size,-size); - glVertex3f(-size,-size,-size); glVertex3f(size,-size,-size);glVertex3f(size,-size,size); glVertex3f(size,size,size); - glVertex3f(size,size,-size); glVertex3f(size,-size,-size); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3f(-size,-size,size); glVertex3f(size,-size,size); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3f(-size,size,size); glVertex3f(size,size,size); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3f(-size,size,-size); glVertex3f(size,size,-size); - glEnd(); -} - -/* this is an unused (old) cube-drawing function based on a given size */ -#if 0 -static void drawcube_size(float *size) -{ - - glPushMatrix(); - glScalef(size[0], size[1], size[2]); - - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[0]); glVertex3fv(cube[1]);glVertex3fv(cube[2]); glVertex3fv(cube[3]); - glVertex3fv(cube[0]); glVertex3fv(cube[4]);glVertex3fv(cube[5]); glVertex3fv(cube[6]); - glVertex3fv(cube[7]); glVertex3fv(cube[4]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[1]); glVertex3fv(cube[5]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[2]); glVertex3fv(cube[6]); - glEnd(); - - glBegin(GL_LINE_STRIP); - glVertex3fv(cube[3]); glVertex3fv(cube[7]); - glEnd(); - - glPopMatrix(); -} -#endif - -static void drawshadbuflimits(Lamp *la, float mat[][4]) -{ - float sta[3], end[3], lavec[3]; - - lavec[0]= -mat[2][0]; - lavec[1]= -mat[2][1]; - lavec[2]= -mat[2][2]; - Normalize(lavec); - - sta[0]= mat[3][0]+ la->clipsta*lavec[0]; - sta[1]= mat[3][1]+ la->clipsta*lavec[1]; - sta[2]= mat[3][2]+ la->clipsta*lavec[2]; - - end[0]= mat[3][0]+ la->clipend*lavec[0]; - end[1]= mat[3][1]+ la->clipend*lavec[1]; - end[2]= mat[3][2]+ la->clipend*lavec[2]; - - - glBegin(GL_LINE_STRIP); - glVertex3fv(sta); - glVertex3fv(end); - glEnd(); - - glPointSize(3.0); - bglBegin(GL_POINTS); - bglVertex3fv(sta); - bglVertex3fv(end); - bglEnd(); - glPointSize(1.0); -} - - - -static void spotvolume(float *lvec, float *vvec, float inp) -{ - /* camera is at 0,0,0 */ - float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle; - - Normalize(lvec); - Normalize(vvec); /* is this the correct vector ? */ - - Crossf(temp,vvec,lvec); /* equation for a plane through vvec en lvec */ - Crossf(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */ - - Normalize(plane); - - /* now we've got two equations: one of a cone and one of a plane, but we have - three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */ - - /* rotate around cross product vector of (0,0,1) and plane normal, dot product degrees */ - /* according definition, we derive cross product is (plane[1],-plane[0],0), en cos = plane[2]);*/ - - /* translating this comment to english didnt really help me understanding the math! :-) (ton) */ - - q[1] = plane[1] ; - q[2] = -plane[0] ; - q[3] = 0 ; - Normalize(&q[1]); - - angle = saacos(plane[2])/2.0; - co = cos(angle); - si = sqrt(1-co*co); - - q[0] = co; - q[1] *= si; - q[2] *= si; - q[3] = 0; - - QuatToMat3(q,mat1); - - /* rotate lamp vector now over acos(inp) degrees */ - - vvec[0] = lvec[0] ; - vvec[1] = lvec[1] ; - vvec[2] = lvec[2] ; - - Mat3One(mat2); - co = inp; - si = sqrt(1-inp*inp); - - mat2[0][0] = co; - mat2[1][0] = -si; - mat2[0][1] = si; - mat2[1][1] = co; - Mat3MulMat3(mat3,mat2,mat1); - - mat2[1][0] = si; - mat2[0][1] = -si; - Mat3MulMat3(mat4,mat2,mat1); - Mat3Transp(mat1); - - Mat3MulMat3(mat2,mat1,mat3); - Mat3MulVecfl(mat2,lvec); - Mat3MulMat3(mat2,mat1,mat4); - Mat3MulVecfl(mat2,vvec); - - return; -} - -static void drawlamp(Object *ob) -{ - Lamp *la; - View3D *v3d= G.vd; - float vec[3], lvec[3], vvec[3], circrad, x,y,z; - float pixsize, lampsize; - float imat[4][4], curcol[4]; - char col[4]; - - la= ob->data; - - /* we first draw only the screen aligned & fixed scale stuff */ - glPushMatrix(); - myloadmatrix(G.vd->viewmat); - - /* lets calculate the scale: */ - pixsize= v3d->persmat[0][3]*ob->obmat[3][0]+ v3d->persmat[1][3]*ob->obmat[3][1]+ v3d->persmat[2][3]*ob->obmat[3][2]+ v3d->persmat[3][3]; - pixsize*= v3d->pixsize; - lampsize= pixsize*((float)U.obcenter_dia*0.5f); - - /* and view aligned matrix: */ - Mat4CpyMat4(imat, G.vd->viewinv); - Normalize(imat[0]); - Normalize(imat[1]); - - /* for AA effects */ - glGetFloatv(GL_CURRENT_COLOR, curcol); - curcol[3]= 0.6; - glColor4fv(curcol); - - if(ob->id.us>1) { - if (ob==OBACT || (ob->flag & SELECT)) glColor4ub(0x88, 0xFF, 0xFF, 155); - else glColor4ub(0x77, 0xCC, 0xCC, 155); - } - - /* Inner Circle */ - VECCOPY(vec, ob->obmat[3]); - glEnable(GL_BLEND); - drawcircball(GL_LINE_LOOP, vec, lampsize, imat); - glDisable(GL_BLEND); - drawcircball(GL_POLYGON, vec, lampsize, imat); - - /* restore */ - if(ob->id.us>1) - glColor4fv(curcol); - - /* Outer circle */ - circrad = 3.0f*lampsize; - drawcircball(GL_LINE_LOOP, vec, circrad, imat); - - setlinestyle(3); - - /* draw dashed outer circle if shadow is on. remember some lamps can't have certain shadows! */ - if (la->type!=LA_HEMI) { - if ((la->mode & LA_SHAD_RAY) || - ((la->mode & LA_SHAD_BUF) && (la->type==LA_SPOT)) ) - { - drawcircball(GL_LINE_LOOP, vec, circrad + 3.0f*pixsize, imat); - } - } - - /* draw the pretty sun rays */ - if(la->type==LA_SUN) { - float v1[3], v2[3], mat[3][3]; - short axis; - - /* setup a 45 degree rotation matrix */ - VecRotToMat3(imat[2], M_PI/4.0f, mat); - - /* vectors */ - VECCOPY(v1, imat[0]); - VecMulf(v1, circrad*1.2f); - VECCOPY(v2, imat[0]); - VecMulf(v2, circrad*2.5f); - - /* center */ - glTranslatef(vec[0], vec[1], vec[2]); - - setlinestyle(3); - - glBegin(GL_LINES); - for (axis=0; axis<8; axis++) { - glVertex3fv(v1); - glVertex3fv(v2); - Mat3MulVecfl(mat, v1); - Mat3MulVecfl(mat, v2); - } - glEnd(); - - glTranslatef(-vec[0], -vec[1], -vec[2]); - - } - - if (la->type==LA_LOCAL) { - if(la->mode & LA_SPHERE) { - drawcircball(GL_LINE_LOOP, vec, la->dist, imat); - } - /* yafray: for photonlight also draw lightcone as for spot */ - } - - glPopMatrix(); /* back in object space */ - vec[0]= vec[1]= vec[2]= 0.0f; - - if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) { - lvec[0]=lvec[1]= 0.0; - lvec[2] = 1.0; - x = G.vd->persmat[0][2]; - y = G.vd->persmat[1][2]; - z = G.vd->persmat[2][2]; - vvec[0]= x*ob->obmat[0][0] + y*ob->obmat[0][1] + z*ob->obmat[0][2]; - vvec[1]= x*ob->obmat[1][0] + y*ob->obmat[1][1] + z*ob->obmat[1][2]; - vvec[2]= x*ob->obmat[2][0] + y*ob->obmat[2][1] + z*ob->obmat[2][2]; - - y = cos( M_PI*la->spotsize/360.0 ); - spotvolume(lvec, vvec, y); - x = -la->dist; - lvec[0] *= x ; - lvec[1] *= x ; - lvec[2] *= x; - vvec[0] *= x ; - vvec[1] *= x ; - vvec[2] *= x; - - /* draw the angled sides of the cone */ - glBegin(GL_LINE_STRIP); - glVertex3fv(vvec); - glVertex3fv(vec); - glVertex3fv(lvec); - glEnd(); - - z = x*sqrt(1.0 - y*y); - x *= y; - - /* draw the circle/square at the end of the cone */ - glTranslatef(0.0, 0.0 , x); - if(la->mode & LA_SQUARE) { - vvec[0]= fabs(z); - vvec[1]= fabs(z); - vvec[2]= 0.0; - glBegin(GL_LINE_LOOP); - glVertex3fv(vvec); - vvec[1]= -fabs(z); - glVertex3fv(vvec); - vvec[0]= -fabs(z); - glVertex3fv(vvec); - vvec[1]= fabs(z); - glVertex3fv(vvec); - glEnd(); - } - else circ(0.0, 0.0, fabs(z)); - - /* draw the circle/square representing spotbl */ - if(la->type==LA_SPOT) { - float spotblcirc = fabs(z)*(1 - pow(la->spotblend, 2)); - /* make sure the line is always visible - prevent it from reaching the outer border (or 0) - * values are kinda arbitrary - just what seemed to work well */ - if (spotblcirc == 0) spotblcirc = 0.15; - else if (spotblcirc == fabs(z)) spotblcirc = fabs(z) - 0.07; - circ(0.0, 0.0, spotblcirc); - } - - } - else if ELEM(la->type, LA_HEMI, LA_SUN) { - - /* draw the line from the circle along the dist */ - glBegin(GL_LINE_STRIP); - vec[2] = -circrad; - glVertex3fv(vec); - vec[2]= -la->dist; - glVertex3fv(vec); - glEnd(); - - if(la->type==LA_HEMI) { - /* draw the hemisphere curves */ - short axis, steps, dir; - float outdist, zdist, mul; - vec[0]=vec[1]=vec[2]= 0.0; - outdist = 0.14; mul = 1.4; dir = 1; - - setlinestyle(4); - /* loop over the 4 compass points, and draw each arc as a LINE_STRIP */ - for (axis=0; axis<4; axis++) { - float v[3]= {0.0, 0.0, 0.0}; - zdist = 0.02; - - glBegin(GL_LINE_STRIP); - - for (steps=0; steps<6; steps++) { - if (axis == 0 || axis == 1) { /* x axis up, x axis down */ - /* make the arcs start at the edge of the energy circle */ - if (steps == 0) v[0] = dir*circrad; - else v[0] = v[0] + dir*(steps*outdist); - } else if (axis == 2 || axis == 3) { /* y axis up, y axis down */ - /* make the arcs start at the edge of the energy circle */ - if (steps == 0) v[1] = dir*circrad; - else v[1] = v[1] + dir*(steps*outdist); - } - - v[2] = v[2] - steps*zdist; - - glVertex3fv(v); - - zdist = zdist * mul; - } - - glEnd(); - /* flip the direction */ - dir = -dir; - } - } - } else if(la->type==LA_AREA) { - setlinestyle(3); - if(la->area_shape==LA_AREA_SQUARE) - fdrawbox(-la->area_size*0.5, -la->area_size*0.5, la->area_size*0.5, la->area_size*0.5); - else if(la->area_shape==LA_AREA_RECT) - fdrawbox(-la->area_size*0.5, -la->area_sizey*0.5, la->area_size*0.5, la->area_sizey*0.5); - - glBegin(GL_LINE_STRIP); - glVertex3f(0.0,0.0,-circrad); - glVertex3f(0.0,0.0,-la->dist); - glEnd(); - } - - /* and back to viewspace */ - myloadmatrix(G.vd->viewmat); - VECCOPY(vec, ob->obmat[3]); - - setlinestyle(0); - - if(la->type==LA_SPOT && (la->mode & LA_SHAD_BUF) ) { - drawshadbuflimits(la, ob->obmat); - } - - BIF_GetThemeColor4ubv(TH_LAMP, col); - glColor4ub(col[0], col[1], col[2], col[3]); - - glEnable(GL_BLEND); - - if (vec[2]>0) vec[2] -= circrad; - else vec[2] += circrad; - - glBegin(GL_LINE_STRIP); - glVertex3fv(vec); - vec[2]= 0; - glVertex3fv(vec); - glEnd(); - - glPointSize(2.0); - glBegin(GL_POINTS); - glVertex3fv(vec); - glEnd(); - glPointSize(1.0); - - glDisable(GL_BLEND); - - /* restore for drawing extra stuff */ - glColor3fv(curcol); - -} - -static void draw_limit_line(float sta, float end, unsigned int col) -{ - glBegin(GL_LINES); - glVertex3f(0.0, 0.0, -sta); - glVertex3f(0.0, 0.0, -end); - glEnd(); - - glPointSize(3.0); - glBegin(GL_POINTS); - cpack(col); - glVertex3f(0.0, 0.0, -sta); - glVertex3f(0.0, 0.0, -end); - glEnd(); - glPointSize(1.0); -} - - -/* yafray: draw camera focus point (cross, similar to aqsis code in tuhopuu) */ -/* qdn: now also enabled for Blender to set focus point for defocus composit node */ -static void draw_focus_cross(float dist, float size) -{ - glBegin(GL_LINES); - glVertex3f(-size, 0.f, -dist); - glVertex3f(size, 0.f, -dist); - glVertex3f(0.f, -size, -dist); - glVertex3f(0.f, size, -dist); - glEnd(); -} - -/* flag similar to draw_object() */ -static void drawcamera(Object *ob, int flag) -{ - /* a standing up pyramid with (0,0,0) as top */ - Camera *cam; - World *wrld; - float vec[8][4], tmat[4][4], fac, facx, facy, depth; - int i; - - cam= ob->data; - - glDisable(GL_LIGHTING); - glDisable(GL_CULL_FACE); - - if(G.vd->persp>=2 && cam->type==CAM_ORTHO && ob==G.vd->camera) { - facx= 0.5*cam->ortho_scale*1.28; - facy= 0.5*cam->ortho_scale*1.024; - depth= -cam->clipsta-0.1; - } - else { - fac= cam->drawsize; - if(G.vd->persp>=2 && ob==G.vd->camera) fac= cam->clipsta+0.1; /* that way it's always visible */ - - depth= - fac*cam->lens/16.0; - facx= fac*1.28; - facy= fac*1.024; - } - - vec[0][0]= 0.0; vec[0][1]= 0.0; vec[0][2]= 0.001; /* GLBUG: for picking at iris Entry (well thats old!) */ - vec[1][0]= facx; vec[1][1]= facy; vec[1][2]= depth; - vec[2][0]= facx; vec[2][1]= -facy; vec[2][2]= depth; - vec[3][0]= -facx; vec[3][1]= -facy; vec[3][2]= depth; - vec[4][0]= -facx; vec[4][1]= facy; vec[4][2]= depth; - - glBegin(GL_LINE_LOOP); - glVertex3fv(vec[1]); - glVertex3fv(vec[2]); - glVertex3fv(vec[3]); - glVertex3fv(vec[4]); - glEnd(); - - - if(G.vd->persp>=2 && ob==G.vd->camera) return; - - glBegin(GL_LINE_STRIP); - glVertex3fv(vec[2]); - glVertex3fv(vec[0]); - glVertex3fv(vec[1]); - glVertex3fv(vec[4]); - glVertex3fv(vec[0]); - glVertex3fv(vec[3]); - glEnd(); - - - /* arrow on top */ - vec[0][2]= depth; - - - /* draw an outline arrow for inactive cameras and filled - * for active cameras. We actually draw both outline+filled - * for active cameras so the wire can be seen side-on */ - for (i=0;i<2;i++) { - if (i==0) glBegin(GL_LINE_LOOP); - else if (i==1 && (ob == G.vd->camera)) glBegin(GL_TRIANGLES); - else break; - - vec[0][0]= -0.7*cam->drawsize; - vec[0][1]= 1.1*cam->drawsize; - glVertex3fv(vec[0]); - - vec[0][0]= 0.0; - vec[0][1]= 1.8*cam->drawsize; - glVertex3fv(vec[0]); - - vec[0][0]= 0.7*cam->drawsize; - vec[0][1]= 1.1*cam->drawsize; - glVertex3fv(vec[0]); - - glEnd(); - } - - if(flag==0) { - if(cam->flag & (CAM_SHOWLIMITS+CAM_SHOWMIST)) { - myloadmatrix(G.vd->viewmat); - Mat4CpyMat4(vec, ob->obmat); - Mat4Ortho(vec); - mymultmatrix(vec); - - MTC_Mat4SwapMat4(G.vd->persmat, tmat); - mygetsingmatrix(G.vd->persmat); - - if(cam->flag & CAM_SHOWLIMITS) { - draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF); - /* qdn: was yafray only, now also enabled for Blender to be used with defocus composit node */ - draw_focus_cross(dof_camera(ob), cam->drawsize); - } - - wrld= G.scene->world; - if(cam->flag & CAM_SHOWMIST) - if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF); - - MTC_Mat4SwapMat4(G.vd->persmat, tmat); - } - } -} - -static void lattice_draw_verts(Lattice *lt, DispList *dl, short sel) -{ - BPoint *bp = lt->def; - float *co = dl?dl->verts:NULL; - int u, v, w; - - BIF_ThemeColor(sel?TH_VERTEX_SELECT:TH_VERTEX); - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - bglBegin(GL_POINTS); - - for(w=0; wpntsw; w++) { - int wxt = (w==0 || w==lt->pntsw-1); - for(v=0; vpntsv; v++) { - int vxt = (v==0 || v==lt->pntsv-1); - for(u=0; upntsu; u++, bp++, co+=3) { - int uxt = (u==0 || u==lt->pntsu-1); - if(!(lt->flag & LT_OUTSIDE) || uxt || vxt || wxt) { - if(bp->hide==0) { - if((bp->f1 & SELECT)==sel) { - bglVertex3fv(dl?co:bp->vec); - } - } - } - } - } - } - - glPointSize(1.0); - bglEnd(); -} - -void lattice_foreachScreenVert(void (*func)(void *userData, BPoint *bp, int x, int y), void *userData) -{ - int i, N = editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - DispList *dl = find_displist(&G.obedit->disp, DL_VERTS); - float *co = dl?dl->verts:NULL; - BPoint *bp = editLatt->def; - float pmat[4][4], vmat[4][4]; - short s[2]; - - view3d_get_object_project_mat(curarea, G.obedit, pmat, vmat); - - for (i=0; ihide==0) { - view3d_project_short_clip(curarea, dl?co:bp->vec, s, pmat, vmat); - func(userData, bp, s[0], s[1]); - } - } -} - -static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, int use_wcol) -{ - int index = ((w*lt->pntsv + v)*lt->pntsu) + u; - - if(use_wcol) { - float col[3]; - MDeformWeight *mdw= get_defweight (lt->dvert+index, use_wcol-1); - - weight_to_rgb(mdw?mdw->weight:0.0f, col, col+1, col+2); - glColor3fv(col); - } - - if (dl) { - glVertex3fv(&dl->verts[index*3]); - } else { - glVertex3fv(lt->def[index].vec); - } -} - -/* lattice color is hardcoded, now also shows weightgroup values in edit mode */ -static void drawlattice(Object *ob) -{ - Lattice *lt; - DispList *dl; - int u, v, w; - int use_wcol= 0; - - lt= (ob==G.obedit)?editLatt:ob->data; - dl= find_displist(&ob->disp, DL_VERTS); - if(ob==G.obedit) { - cpack(0x004000); - - if(ob->defbase.first && lt->dvert) { - use_wcol= ob->actdef; - glShadeModel(GL_SMOOTH); - } - } - - glBegin(GL_LINES); - for(w=0; wpntsw; w++) { - int wxt = (w==0 || w==lt->pntsw-1); - for(v=0; vpntsv; v++) { - int vxt = (v==0 || v==lt->pntsv-1); - for(u=0; upntsu; u++) { - int uxt = (u==0 || u==lt->pntsu-1); - - if(w && ((uxt || vxt) || !(lt->flag & LT_OUTSIDE))) { - drawlattice__point(lt, dl, u, v, w-1, use_wcol); - drawlattice__point(lt, dl, u, v, w, use_wcol); - } - if(v && ((uxt || wxt) || !(lt->flag & LT_OUTSIDE))) { - drawlattice__point(lt, dl, u, v-1, w, use_wcol); - drawlattice__point(lt, dl, u, v, w, use_wcol); - } - if(u && ((vxt || wxt) || !(lt->flag & LT_OUTSIDE))) { - drawlattice__point(lt, dl, u-1, v, w, use_wcol); - drawlattice__point(lt, dl, u, v, w, use_wcol); - } - } - } - } - glEnd(); - - /* restoration for weight colors */ - if(use_wcol) - glShadeModel(GL_FLAT); - - if(ob==G.obedit) { - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - lattice_draw_verts(lt, dl, 0); - lattice_draw_verts(lt, dl, 1); - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - } -} - -/* ***************** ******************** */ - -static void mesh_foreachScreenVert__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) -{ - struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } *data = userData; - EditVert *eve = EM_get_vert_for_index(index); - short s[2]; - - if (eve->h==0) { - if (data->clipVerts) { - view3d_project_short_clip(curarea, co, s, data->pmat, data->vmat); - } else { - view3d_project_short_noclip(curarea, co, s, data->pmat); - } - - data->func(data->userData, eve, s[0], s[1], index); - } -} -void mesh_foreachScreenVert(void (*func)(void *userData, EditVert *eve, int x, int y, int index), void *userData, int clipVerts) -{ - struct { void (*func)(void *userData, EditVert *eve, int x, int y, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } data; - DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); - - data.func = func; - data.userData = userData; - data.clipVerts = clipVerts; - - view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat); - - EM_init_index_arrays(1, 0, 0); - dm->foreachMappedVert(dm, mesh_foreachScreenVert__mapFunc, &data); - EM_free_index_arrays(); - - dm->release(dm); -} - -static void mesh_foreachScreenEdge__mapFunc(void *userData, int index, float *v0co, float *v1co) -{ - struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } *data = userData; - EditEdge *eed = EM_get_edge_for_index(index); - short s[2][2]; - - if (eed->h==0) { - if (data->clipVerts==1) { - view3d_project_short_clip(curarea, v0co, s[0], data->pmat, data->vmat); - view3d_project_short_clip(curarea, v1co, s[1], data->pmat, data->vmat); - } else { - view3d_project_short_noclip(curarea, v0co, s[0], data->pmat); - view3d_project_short_noclip(curarea, v1co, s[1], data->pmat); - - if (data->clipVerts==2) { - if (!(s[0][0]>=0 && s[0][1]>= 0 && s[0][0]winx && s[0][1]winy)) - if (!(s[1][0]>=0 && s[1][1]>= 0 && s[1][0]winx && s[1][1]winy)) - return; - } - } - - data->func(data->userData, eed, s[0][0], s[0][1], s[1][0], s[1][1], index); - } -} -void mesh_foreachScreenEdge(void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts) -{ - struct { void (*func)(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index); void *userData; int clipVerts; float pmat[4][4], vmat[4][4]; } data; - DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); - - data.func = func; - data.userData = userData; - data.clipVerts = clipVerts; - - view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat); - - EM_init_index_arrays(0, 1, 0); - dm->foreachMappedEdge(dm, mesh_foreachScreenEdge__mapFunc, &data); - EM_free_index_arrays(); - - dm->release(dm); -} - -static void mesh_foreachScreenFace__mapFunc(void *userData, int index, float *cent, float *no) -{ - struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; float pmat[4][4], vmat[4][4]; } *data = userData; - EditFace *efa = EM_get_face_for_index(index); - short s[2]; - - if (efa && efa->h==0 && efa->fgonf!=EM_FGON) { - view3d_project_short_clip(curarea, cent, s, data->pmat, data->vmat); - - data->func(data->userData, efa, s[0], s[1], index); - } -} -void mesh_foreachScreenFace(void (*func)(void *userData, EditFace *efa, int x, int y, int index), void *userData) -{ - struct { void (*func)(void *userData, EditFace *efa, int x, int y, int index); void *userData; float pmat[4][4], vmat[4][4]; } data; - DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); - - data.func = func; - data.userData = userData; - - view3d_get_object_project_mat(curarea, G.obedit, data.pmat, data.vmat); - - EM_init_index_arrays(0, 0, 1); - dm->foreachMappedFaceCenter(dm, mesh_foreachScreenFace__mapFunc, &data); - EM_free_index_arrays(); - - dm->release(dm); -} - -void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y), void *userData) -{ - float pmat[4][4], vmat[4][4]; - short s[2]; - Nurb *nu; - int i; - - view3d_get_object_project_mat(curarea, G.obedit, pmat, vmat); - - for (nu= editNurb.first; nu; nu=nu->next) { - if((nu->type & 7)==CU_BEZIER) { - for (i=0; ipntsu; i++) { - BezTriple *bezt = &nu->bezt[i]; - - if(bezt->hide==0) { - if (G.f & G_HIDDENHANDLES) { - view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat); - if (s[0] != IS_CLIPPED) - func(userData, nu, NULL, bezt, 1, s[0], s[1]); - } else { - view3d_project_short_clip(curarea, bezt->vec[0], s, pmat, vmat); - if (s[0] != IS_CLIPPED) - func(userData, nu, NULL, bezt, 0, s[0], s[1]); - view3d_project_short_clip(curarea, bezt->vec[1], s, pmat, vmat); - if (s[0] != IS_CLIPPED) - func(userData, nu, NULL, bezt, 1, s[0], s[1]); - view3d_project_short_clip(curarea, bezt->vec[2], s, pmat, vmat); - if (s[0] != IS_CLIPPED) - func(userData, nu, NULL, bezt, 2, s[0], s[1]); - } - } - } - } - else { - for (i=0; ipntsu*nu->pntsv; i++) { - BPoint *bp = &nu->bp[i]; - - if(bp->hide==0) { - view3d_project_short_clip(curarea, bp->vec, s, pmat, vmat); - func(userData, nu, bp, NULL, -1, s[0], s[1]); - } - } - } - } -} - -/* ************** DRAW MESH ****************** */ - -/* First section is all the "simple" draw routines, - * ones that just pass some sort of primitive to GL, - * with perhaps various options to control lighting, - * color, etc. - * - * These routines should not have user interface related - * logic!!! - */ - -static void draw_dm_face_normals__mapFunc(void *userData, int index, float *cent, float *no) -{ - EditFace *efa = EM_get_face_for_index(index); - - if (efa->h==0 && efa->fgonf!=EM_FGON) { - glVertex3fv(cent); - glVertex3f( cent[0] + no[0]*G.scene->editbutsize, - cent[1] + no[1]*G.scene->editbutsize, - cent[2] + no[2]*G.scene->editbutsize); - } -} -static void draw_dm_face_normals(DerivedMesh *dm) { - glBegin(GL_LINES); - dm->foreachMappedFaceCenter(dm, draw_dm_face_normals__mapFunc, 0); - glEnd(); -} - -static void draw_dm_face_centers__mapFunc(void *userData, int index, float *cent, float *no) -{ - EditFace *efa = EM_get_face_for_index(index); - int sel = *((int*) userData); - - if (efa->h==0 && efa->fgonf!=EM_FGON && (efa->f&SELECT)==sel) { - bglVertex3fv(cent); - } -} -static void draw_dm_face_centers(DerivedMesh *dm, int sel) -{ - bglBegin(GL_POINTS); - dm->foreachMappedFaceCenter(dm, draw_dm_face_centers__mapFunc, &sel); - bglEnd(); -} - -static void draw_dm_vert_normals__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) -{ - EditVert *eve = EM_get_vert_for_index(index); - - if (eve->h==0) { - glVertex3fv(co); - - if (no_f) { - glVertex3f( co[0] + no_f[0]*G.scene->editbutsize, - co[1] + no_f[1]*G.scene->editbutsize, - co[2] + no_f[2]*G.scene->editbutsize); - } else { - glVertex3f( co[0] + no_s[0]*G.scene->editbutsize/32767.0f, - co[1] + no_s[1]*G.scene->editbutsize/32767.0f, - co[2] + no_s[2]*G.scene->editbutsize/32767.0f); - } - } -} -static void draw_dm_vert_normals(DerivedMesh *dm) { - glBegin(GL_LINES); - dm->foreachMappedVert(dm, draw_dm_vert_normals__mapFunc, NULL); - glEnd(); -} - - /* Draw verts with color set based on selection */ -static void draw_dm_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) -{ - struct { int sel; EditVert *eve_act; } * data = userData; - EditVert *eve = EM_get_vert_for_index(index); - - if (eve->h==0 && (eve->f&SELECT)==data->sel) { - /* draw active larger - need to stop/start point drawing for this :/ */ - if (eve==data->eve_act) { - float size = BIF_GetThemeValuef(TH_VERTEX_SIZE); - BIF_ThemeColor4(TH_EDITMESH_ACTIVE); - - bglEnd(); - - glPointSize(size); - bglBegin(GL_POINTS); - bglVertex3fv(co); - bglEnd(); - - BIF_ThemeColor4(TH_VERTEX_SELECT); - glPointSize(size); - bglBegin(GL_POINTS); - } else { - bglVertex3fv(co); - } - } -} -static void draw_dm_verts(DerivedMesh *dm, int sel, EditVert *eve_act) -{ - struct { int sel; EditVert *eve_act; } data; - data.sel = sel; - data.eve_act = eve_act; - - bglBegin(GL_POINTS); - dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data); - bglEnd(); -} - - /* Draw edges with color set based on selection */ -static int draw_dm_edges_sel__setDrawOptions(void *userData, int index) -{ - EditEdge *eed = EM_get_edge_for_index(index); - //unsigned char **cols = userData, *col; - struct { unsigned char *baseCol, *selCol, *actCol; EditEdge *eed_act; } * data = userData; - unsigned char *col; - - if (eed->h==0) { - if (eed==data->eed_act) { - glColor4ubv(data->actCol); - } else { - if (eed->f&SELECT) { - col = data->selCol; - } else { - col = data->baseCol; - } - /* no alpha, this is used so a transparent color can disable drawing unselected edges in editmode */ - if (col[3]==0) return 0; - - glColor4ubv(col); - } - return 1; - } else { - return 0; - } -} -static void draw_dm_edges_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol, unsigned char *actCol, EditEdge *eed_act) -{ - struct { unsigned char *baseCol, *selCol, *actCol; EditEdge *eed_act; } data; - - data.baseCol = baseCol; - data.selCol = selCol; - data.actCol = actCol; - data.eed_act = eed_act; - dm->drawMappedEdges(dm, draw_dm_edges_sel__setDrawOptions, &data); -} - - /* Draw edges */ -static int draw_dm_edges__setDrawOptions(void *userData, int index) -{ - return EM_get_edge_for_index(index)->h==0; -} -static void draw_dm_edges(DerivedMesh *dm) -{ - dm->drawMappedEdges(dm, draw_dm_edges__setDrawOptions, NULL); -} - - /* Draw edges with color interpolated based on selection */ -static int draw_dm_edges_sel_interp__setDrawOptions(void *userData, int index) -{ - return EM_get_edge_for_index(index)->h==0; -} -static void draw_dm_edges_sel_interp__setDrawInterpOptions(void *userData, int index, float t) -{ - EditEdge *eed = EM_get_edge_for_index(index); - unsigned char **cols = userData; - unsigned char *col0 = cols[(eed->v1->f&SELECT)?1:0]; - unsigned char *col1 = cols[(eed->v2->f&SELECT)?1:0]; - - glColor4ub( col0[0] + (col1[0]-col0[0])*t, - col0[1] + (col1[1]-col0[1])*t, - col0[2] + (col1[2]-col0[2])*t, - col0[3] + (col1[3]-col0[3])*t); -} -static void draw_dm_edges_sel_interp(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol) -{ - unsigned char *cols[2]; - cols[0] = baseCol; - cols[1] = selCol; - dm->drawMappedEdgesInterp(dm, draw_dm_edges_sel_interp__setDrawOptions, draw_dm_edges_sel_interp__setDrawInterpOptions, cols); -} - - /* Draw only seam edges */ -static int draw_dm_edges_seams__setDrawOptions(void *userData, int index) -{ - EditEdge *eed = EM_get_edge_for_index(index); - - return (eed->h==0 && eed->seam); -} -static void draw_dm_edges_seams(DerivedMesh *dm) -{ - dm->drawMappedEdges(dm, draw_dm_edges_seams__setDrawOptions, NULL); -} - - /* Draw only sharp edges */ -static int draw_dm_edges_sharp__setDrawOptions(void *userData, int index) -{ - EditEdge *eed = EM_get_edge_for_index(index); - - return (eed->h==0 && eed->sharp); -} -static void draw_dm_edges_sharp(DerivedMesh *dm) -{ - dm->drawMappedEdges(dm, draw_dm_edges_sharp__setDrawOptions, NULL); -} - - - /* Draw faces with color set based on selection - * return 2 for the active face so it renders with stipple enabled */ -static int draw_dm_faces_sel__setDrawOptions(void *userData, int index, int *drawSmooth_r) -{ - struct { unsigned char *cols[3]; EditFace *efa_act; } * data = userData; - EditFace *efa = EM_get_face_for_index(index); - unsigned char *col; - - if (efa->h==0) { - if (efa == data->efa_act) { - glColor4ubv(data->cols[2]); - return 2; /* stipple */ - } else { - col = data->cols[(efa->f&SELECT)?1:0]; - if (col[3]==0) return 0; - glColor4ubv(col); - return 1; - } - } - return 0; -} - -/* also draws the active face */ -static void draw_dm_faces_sel(DerivedMesh *dm, unsigned char *baseCol, unsigned char *selCol, unsigned char *actCol, EditFace *efa_act) -{ - struct { unsigned char *cols[3]; EditFace *efa_act; } data; - data.cols[0] = baseCol; - data.cols[1] = selCol; - data.cols[2] = actCol; - data.efa_act = efa_act; - - dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, &data, 0); -} - -static int draw_dm_creases__setDrawOptions(void *userData, int index) -{ - EditEdge *eed = EM_get_edge_for_index(index); - - if (eed->h==0 && eed->crease!=0.0) { - BIF_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, eed->crease); - return 1; - } else { - return 0; - } -} -static void draw_dm_creases(DerivedMesh *dm) -{ - glLineWidth(3.0); - dm->drawMappedEdges(dm, draw_dm_creases__setDrawOptions, NULL); - glLineWidth(1.0); -} - -/* Second section of routines: Combine first sets to form fancy - * drawing routines (for example rendering twice to get overlays). - * - * Also includes routines that are basic drawing but are too - * specialized to be split out (like drawing creases or measurements). - */ - -/* EditMesh drawing routines*/ - -static void draw_em_fancy_verts(EditMesh *em, DerivedMesh *cageDM, EditVert *eve_act) -{ - int sel; - - if(G.vd->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select - - for (sel=0; sel<2; sel++) { - char col[4], fcol[4]; - int pass; - - BIF_GetThemeColor3ubv(sel?TH_VERTEX_SELECT:TH_VERTEX, col); - BIF_GetThemeColor3ubv(sel?TH_FACE_DOT:TH_WIRE, fcol); - - for (pass=0; pass<2; pass++) { - float size = BIF_GetThemeValuef(TH_VERTEX_SIZE); - float fsize = BIF_GetThemeValuef(TH_FACEDOT_SIZE); - - if (pass==0) { - if(G.vd->zbuf && !(G.vd->flag&V3D_ZBUF_SELECT)) { - glDisable(GL_DEPTH_TEST); - - glEnable(GL_BLEND); - } else { - continue; - } - - size = (size>2.1?size/2.0:size); - fsize = (fsize>2.1?fsize/2.0:fsize); - col[3] = fcol[3] = 100; - } else { - col[3] = fcol[3] = 255; - } - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - glPointSize(size); - glColor4ubv((GLubyte *)col); - draw_dm_verts(cageDM, sel, eve_act); - } - - if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) { - glPointSize(fsize); - glColor4ubv((GLubyte *)fcol); - draw_dm_face_centers(cageDM, sel); - } - - if (pass==0) { - glDisable(GL_BLEND); - glEnable(GL_DEPTH_TEST); - } - } - } - - if(G.vd->zbuf) glDepthMask(1); - glPointSize(1.0); -} - -static void draw_em_fancy_edges(DerivedMesh *cageDM, short sel_only, EditEdge *eed_act) -{ - int pass; - unsigned char wireCol[4], selCol[4], actCol[4]; - - /* since this function does transparant... */ - BIF_GetThemeColor3ubv(TH_EDGE_SELECT, (char *)selCol); - BIF_GetThemeColor3ubv(TH_WIRE, (char *)wireCol); - BIF_GetThemeColor3ubv(TH_EDITMESH_ACTIVE, (char *)actCol); - - /* when sel only is used, dont render wire, only selected, this is used for - * textured draw mode when the 'edges' option is disabled */ - if (sel_only) - wireCol[3] = 0; - - for (pass=0; pass<2; pass++) { - /* show wires in transparant when no zbuf clipping for select */ - if (pass==0) { - if (G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) { - glEnable(GL_BLEND); - glDisable(GL_DEPTH_TEST); - selCol[3] = 85; - if (!sel_only) wireCol[3] = 85; - } else { - continue; - } - } else { - selCol[3] = 255; - if (!sel_only) wireCol[3] = 255; - } - - if(G.scene->selectmode == SCE_SELECT_FACE) { - draw_dm_edges_sel(cageDM, wireCol, selCol, actCol, eed_act); - } - else if( (G.f & G_DRAWEDGES) || (G.scene->selectmode & SCE_SELECT_EDGE) ) { - if(cageDM->drawMappedEdgesInterp && (G.scene->selectmode & SCE_SELECT_VERTEX)) { - glShadeModel(GL_SMOOTH); - draw_dm_edges_sel_interp(cageDM, wireCol, selCol); - glShadeModel(GL_FLAT); - } else { - draw_dm_edges_sel(cageDM, wireCol, selCol, actCol, eed_act); - } - } - else { - if (!sel_only) { - glColor4ubv(wireCol); - draw_dm_edges(cageDM); - } - } - - if (pass==0) { - glDisable(GL_BLEND); - glEnable(GL_DEPTH_TEST); - } - } -} - -#ifdef WITH_VERSE -/* - * draw some debug info about verse mesh (vertex indexes, - * face indexes, status of ) - */ -static void draw_verse_debug(Object *ob, EditMesh *em) -{ - struct EditVert *eve=NULL; - struct EditFace *efa=NULL; - float v1[3], v2[3], v3[3], v4[3], fvec[3], col[3]; - char val[32]; - - if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) - glDisable(GL_DEPTH_TEST); - - if(G.vd->zbuf) bglPolygonOffset(5.0); - - BIF_GetThemeColor3fv(TH_TEXT, col); - /* make color a bit more red */ - if(col[0]> 0.5) {col[1]*=0.7; col[2]*= 0.7;} - else col[0]= col[0]*0.7 + 0.3; - glColor3fv(col); - - /* draw IDs of verse vertexes */ - for(eve = em->verts.first; eve; eve = eve->next) { - if(eve->vvert) { - VecLerpf(fvec, ob->loc, eve->co, 1.1); - glRasterPos3f(fvec[0], fvec[1], fvec[2]); - - sprintf(val, "%d", ((VerseVert*)eve->vvert)->id); - BMF_DrawString(G.fonts, val); - } - } - - /* draw IDs of verse faces */ - for(efa = em->faces.first; efa; efa = efa->next) { - if(efa->vface) { - VECCOPY(v1, efa->v1->co); - VECCOPY(v2, efa->v2->co); - VECCOPY(v3, efa->v3->co); - if(efa->v4) { - VECCOPY(v4, efa->v4->co); - glRasterPos3f(0.25*(v1[0]+v2[0]+v3[0]+v4[0]), - 0.25*(v1[1]+v2[1]+v3[1]+v4[1]), - 0.25*(v1[2]+v2[2]+v3[2]+v4[2])); - } - else { - glRasterPos3f((v1[0]+v2[0]+v3[0])/3, - (v1[1]+v2[1]+v3[1])/3, - (v1[2]+v2[2]+v3[2])/3); - } - - sprintf(val, "%d", ((VerseFace*)efa->vface)->id); - BMF_DrawString(G.fonts, val); - - } - } - - if(G.vd->zbuf) { - glEnable(GL_DEPTH_TEST); - bglPolygonOffset(0.0); - } -} -#endif - -static void draw_em_measure_stats(Object *ob, EditMesh *em) -{ - EditEdge *eed; - EditFace *efa; - float v1[3], v2[3], v3[3], v4[3]; - float fvec[3]; - char val[32]; /* Stores the measurement display text here */ - char conv_float[5]; /* Use a float conversion matching the grid size */ - float area, col[3]; /* area of the face, color of the text to draw */ - - /* make the precission of the pronted value proportionate to the gridsize */ - if ((G.vd->grid) < 0.01) - strcpy(conv_float, "%.6f"); - else if ((G.vd->grid) < 0.1) - strcpy(conv_float, "%.5f"); - else if ((G.vd->grid) < 1.0) - strcpy(conv_float, "%.4f"); - else if ((G.vd->grid) < 10.0) - strcpy(conv_float, "%.3f"); - else - strcpy(conv_float, "%.2f"); - - - if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) - glDisable(GL_DEPTH_TEST); - - if(G.vd->zbuf) bglPolygonOffset(5.0); - - if(G.f & G_DRAW_EDGELEN) { - BIF_GetThemeColor3fv(TH_TEXT, col); - /* make color a bit more red */ - if(col[0]> 0.5) {col[1]*=0.7; col[2]*= 0.7;} - else col[0]= col[0]*0.7 + 0.3; - glColor3fv(col); - - for(eed= em->edges.first; eed; eed= eed->next) { - /* draw non fgon edges, or selected edges, or edges next to selected verts while draging */ - if((eed->h != EM_FGON) && ((eed->f & SELECT) || (G.moving && ((eed->v1->f & SELECT) || (eed->v2->f & SELECT)) ))) { - VECCOPY(v1, eed->v1->co); - VECCOPY(v2, eed->v2->co); - - glRasterPos3f( 0.5*(v1[0]+v2[0]), 0.5*(v1[1]+v2[1]), 0.5*(v1[2]+v2[2])); - - if(G.vd->flag & V3D_GLOBAL_STATS) { - Mat4MulVecfl(ob->obmat, v1); - Mat4MulVecfl(ob->obmat, v2); - } - - sprintf(val, conv_float, VecLenf(v1, v2)); - BMF_DrawString( G.fonts, val); - } - } - } - - if(G.f & G_DRAW_FACEAREA) { - extern int faceselectedOR(EditFace *efa, int flag); // editmesh.h shouldn't be in this file... ok for now? - - BIF_GetThemeColor3fv(TH_TEXT, col); - /* make color a bit more green */ - if(col[1]> 0.5) {col[0]*=0.7; col[2]*= 0.7;} - else col[1]= col[1]*0.7 + 0.3; - glColor3fv(col); - - for(efa= em->faces.first; efa; efa= efa->next) { - if((efa->f & SELECT) || (G.moving && faceselectedOR(efa, SELECT)) ) { - VECCOPY(v1, efa->v1->co); - VECCOPY(v2, efa->v2->co); - VECCOPY(v3, efa->v3->co); - if (efa->v4) { - VECCOPY(v4, efa->v4->co); - } - if(G.vd->flag & V3D_GLOBAL_STATS) { - Mat4MulVecfl(ob->obmat, v1); - Mat4MulVecfl(ob->obmat, v2); - Mat4MulVecfl(ob->obmat, v3); - if (efa->v4) Mat4MulVecfl(ob->obmat, v4); - } - - if (efa->v4) - area= AreaQ3Dfl(v1, v2, v3, v4); - else - area = AreaT3Dfl(v1, v2, v3); - - sprintf(val, conv_float, area); - glRasterPos3fv(efa->cent); - BMF_DrawString( G.fonts, val); - } - } - } - - if(G.f & G_DRAW_EDGEANG) { - EditEdge *e1, *e2, *e3, *e4; - - BIF_GetThemeColor3fv(TH_TEXT, col); - /* make color a bit more blue */ - if(col[2]> 0.5) {col[0]*=0.7; col[1]*= 0.7;} - else col[2]= col[2]*0.7 + 0.3; - glColor3fv(col); - - for(efa= em->faces.first; efa; efa= efa->next) { - VECCOPY(v1, efa->v1->co); - VECCOPY(v2, efa->v2->co); - VECCOPY(v3, efa->v3->co); - if(efa->v4) { - VECCOPY(v4, efa->v4->co); - } - else { - VECCOPY(v4, v3); - } - if(G.vd->flag & V3D_GLOBAL_STATS) { - Mat4MulVecfl(ob->obmat, v1); - Mat4MulVecfl(ob->obmat, v2); - Mat4MulVecfl(ob->obmat, v3); - if (efa->v4) Mat4MulVecfl(ob->obmat, v4); - } - - e1= efa->e1; - e2= efa->e2; - e3= efa->e3; - if(efa->e4) e4= efa->e4; else e4= e3; - - /* Calculate the angles */ - - if( (e4->f & e1->f & SELECT) || (G.moving && (efa->v1->f & SELECT)) ) { - /* Vec 1 */ - sprintf(val,"%.3f", VecAngle3(v4, v1, v2)); - VecLerpf(fvec, efa->cent, efa->v1->co, 0.8); - glRasterPos3fv(fvec); - BMF_DrawString( G.fonts, val); - } - if( (e1->f & e2->f & SELECT) || (G.moving && (efa->v2->f & SELECT)) ) { - /* Vec 2 */ - sprintf(val,"%.3f", VecAngle3(v1, v2, v3)); - VecLerpf(fvec, efa->cent, efa->v2->co, 0.8); - glRasterPos3fv(fvec); - BMF_DrawString( G.fonts, val); - } - if( (e2->f & e3->f & SELECT) || (G.moving && (efa->v3->f & SELECT)) ) { - /* Vec 3 */ - if(efa->v4) - sprintf(val,"%.3f", VecAngle3(v2, v3, v4)); - else - sprintf(val,"%.3f", VecAngle3(v2, v3, v1)); - VecLerpf(fvec, efa->cent, efa->v3->co, 0.8); - glRasterPos3fv(fvec); - BMF_DrawString( G.fonts, val); - } - /* Vec 4 */ - if(efa->v4) { - if( (e3->f & e4->f & SELECT) || (G.moving && (efa->v4->f & SELECT)) ) { - sprintf(val,"%.3f", VecAngle3(v3, v4, v1)); - VecLerpf(fvec, efa->cent, efa->v4->co, 0.8); - glRasterPos3fv(fvec); - BMF_DrawString( G.fonts, val); - } - } - } - } - - if(G.vd->zbuf) { - glEnable(GL_DEPTH_TEST); - bglPolygonOffset(0.0); - } -} - -static int draw_em_fancy__setFaceOpts(void *userData, int index, int *drawSmooth_r) -{ - EditFace *efa = EM_get_face_for_index(index); - - if (efa->h==0) { - set_gl_material(efa->mat_nr+1); - return 1; - } else { - return 0; - } -} -static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, DerivedMesh *finalDM, int dt) -{ - Mesh *me = ob->data; - EditFace *efa_act = NULL; - EditEdge *eed_act = NULL; - EditVert *eve_act = NULL; - - if (G.editMesh->selected.last) { - EditSelection *ese = G.editMesh->selected.last; - if ( ese->type == EDITFACE ) { - efa_act = (EditFace *)ese->data; - } else if ( ese->type == EDITEDGE ) { - eed_act = (EditEdge *)ese->data; - } else if ( ese->type == EDITVERT ) { - eve_act = (EditVert *)ese->data; - } - } - - EM_init_index_arrays(1, 1, 1); - - if(dt>OB_WIRE) { - if( CHECK_OB_DRAWTEXTURE(G.vd, dt) ) { - draw_mesh_textured(ob, finalDM, 0); - } else { - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED); - - glEnable(GL_LIGHTING); - glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - - finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, 0, 0); - - glFrontFace(GL_CCW); - glDisable(GL_LIGHTING); - } - - // Setup for drawing wire over, disable zbuffer - // write to show selected edge wires better - BIF_ThemeColor(TH_WIRE); - - bglPolygonOffset(1.0); - glDepthMask(0); - } - else { - if (cageDM!=finalDM) { - BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.7); - finalDM->drawEdges(finalDM, 1); - } - } - - if((G.f & (G_DRAWFACES)) || FACESEL_PAINT_TEST) { /* transp faces */ - unsigned char col1[4], col2[4], col3[4]; - - BIF_GetThemeColor4ubv(TH_FACE, (char *)col1); - BIF_GetThemeColor4ubv(TH_FACE_SELECT, (char *)col2); - BIF_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, (char *)col3); - - glEnable(GL_BLEND); - glDepthMask(0); // disable write in zbuffer, needed for nice transp - - /* dont draw unselected faces, only selected, this is MUCH nicer when texturing */ - if CHECK_OB_DRAWTEXTURE(G.vd, dt) - col1[3] = 0; - - draw_dm_faces_sel(cageDM, col1, col2, col3, efa_act); - - glDisable(GL_BLEND); - glDepthMask(1); // restore write in zbuffer - } else if (efa_act) { - /* even if draw faces is off it would be nice to draw the stipple face - * Make all other faces zero alpha except for the active - * */ - unsigned char col1[4], col2[4], col3[4]; - col1[3] = col2[3] = 0; /* dont draw */ - BIF_GetThemeColor4ubv(TH_EDITMESH_ACTIVE, (char *)col3); - - glEnable(GL_BLEND); - glDepthMask(0); // disable write in zbuffer, needed for nice transp - - draw_dm_faces_sel(cageDM, col1, col2, col3, efa_act); - - glDisable(GL_BLEND); - glDepthMask(1); // restore write in zbuffer - - } - - /* here starts all fancy draw-extra over */ - if((G.f & G_DRAWEDGES)==0 && CHECK_OB_DRAWTEXTURE(G.vd, dt)) { - /* we are drawing textures and 'G_DRAWEDGES' is disabled, dont draw any edges */ - - /* only draw selected edges otherwise there is no way of telling if a face is selected */ - draw_em_fancy_edges(cageDM, 1, eed_act); - - } else { - if(G.f & G_DRAWSEAMS) { - BIF_ThemeColor(TH_EDGE_SEAM); - glLineWidth(2); - - draw_dm_edges_seams(cageDM); - - glColor3ub(0,0,0); - glLineWidth(1); - } - - if(G.f & G_DRAWSHARP) { - BIF_ThemeColor(TH_EDGE_SHARP); - glLineWidth(2); - - draw_dm_edges_sharp(cageDM); - - glColor3ub(0,0,0); - glLineWidth(1); - } - - if(G.f & G_DRAWCREASES) { - draw_dm_creases(cageDM); - } - - draw_em_fancy_edges(cageDM, 0, eed_act); - } - if(ob==G.obedit) { - retopo_matrix_update(G.vd); - - draw_em_fancy_verts(em, cageDM, eve_act); - - if(G.f & G_DRAWNORMALS) { - BIF_ThemeColor(TH_NORMAL); - draw_dm_face_normals(cageDM); - } - if(G.f & G_DRAW_VNORMALS) { - BIF_ThemeColor(TH_NORMAL); - draw_dm_vert_normals(cageDM); - } - - if(G.f & (G_DRAW_EDGELEN|G_DRAW_FACEAREA|G_DRAW_EDGEANG)) - draw_em_measure_stats(ob, em); -#ifdef WITH_VERSE - if(em->vnode && (G.f & G_DRAW_VERSE_DEBUG)) - draw_verse_debug(ob, em); -#endif - } - - if(dt>OB_WIRE) { - glDepthMask(1); - bglPolygonOffset(0.0); - } - - EM_free_index_arrays(); -} - -/* Mesh drawing routines */ - -static void draw_mesh_object_outline(Object *ob, DerivedMesh *dm) -{ - - if(G.vd->transp==0) { // not when we draw the transparent pass - glLineWidth(2.0); - glDepthMask(0); - - /* if transparent, we cannot draw the edges for solid select... edges have no material info. - drawFacesSolid() doesn't draw the transparent faces */ - if(ob->dtx & OB_DRAWTRANSP) { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - dm->drawFacesSolid(dm, set_gl_material); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - else { - dm->drawEdges(dm, 0); - } - - glLineWidth(1.0); - glDepthMask(1); - } -} - -static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) -{ - *drawSmooth_r = 1; - return 1; -} - -static void draw_mesh_fancy(Base *base, int dt, int flag) -{ - Object *ob= base->object; - Mesh *me = ob->data; - Material *ma= give_current_material(ob, 1); - int hasHaloMat = (ma && (ma->mode&MA_HALO)); - int draw_wire = ob->dtx&OB_DRAWWIRE; - int totvert, totedge, totface; - DispList *dl; - DerivedMesh *dm= mesh_get_derived_final(ob, get_viewedit_datamask()); - - if(!dm) - return; - -#ifdef WITH_VERSE - if(me->vnode) { - struct VNode *vnode = (VNode*)me->vnode; - struct VLayer *vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - struct VLayer *face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - if(vert_vlayer) totvert = vert_vlayer->dl.da.count; - else totvert = 0; - totedge = 0; /* total count of edge needn't to be zero, but verse doesn't know edges */ - if(face_vlayer) totface = face_vlayer->dl.da.count; - else totface = 0; - } - else { - totvert = dm->getNumVerts(dm); - totedge = dm->getNumEdges(dm); - totface = dm->getNumFaces(dm); - } -#else - totvert = dm->getNumVerts(dm); - totedge = dm->getNumEdges(dm); - totface = dm->getNumFaces(dm); -#endif - - /* vertexpaint, faceselect wants this, but it doesnt work for shaded? */ - if(dt!=OB_SHADED) - glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - - // Unwanted combination. - if (ob==OBACT && FACESEL_PAINT_TEST) draw_wire = 0; - - if(dt==OB_BOUNDBOX) { - draw_bounding_volume(ob); - } - else if(hasHaloMat || (totface==0 && totedge==0)) { - glPointSize(1.5); - dm->drawVerts(dm); - glPointSize(1.0); - } - else if(dt==OB_WIRE || totface==0) { - draw_wire = 1; - } - else if( (ob==OBACT && (G.f & G_TEXTUREPAINT || FACESEL_PAINT_TEST)) || - CHECK_OB_DRAWTEXTURE(G.vd, dt)) - { - int faceselect= (ob==OBACT && FACESEL_PAINT_TEST); - - if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !(G.f&G_PICKSEL || FACESEL_PAINT_TEST) && !draw_wire) { - draw_mesh_object_outline(ob, dm); - } - - draw_mesh_textured(ob, dm, faceselect); - - if(!faceselect) { - if(base->flag & SELECT) - BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); - else - BIF_ThemeColor(TH_WIRE); - - dm->drawLooseEdges(dm); - } - } - else if(dt==OB_SOLID ) { - - if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) { - draw_mesh_object_outline(ob, dm); - } - - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, me->flag & ME_TWOSIDED ); - - glEnable(GL_LIGHTING); - glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - - dm->drawFacesSolid(dm, set_gl_material); - - glFrontFace(GL_CCW); - glDisable(GL_LIGHTING); - - if(base->flag & SELECT) { - BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); - } else { - BIF_ThemeColor(TH_WIRE); - } - dm->drawLooseEdges(dm); - } - else if(dt==OB_SHADED) { - int do_draw= 1; /* to resolve all G.f settings below... */ - - if(ob==OBACT) { - do_draw= 0; - if( (G.f & G_WEIGHTPAINT)) { - set_gl_material(0); /* enforce defmaterial settings */ - - /* but set default spec */ - glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR); - glEnable(GL_COLOR_MATERIAL); /* according manpages needed */ - glColor3ub(120, 120, 120); - glDisable(GL_COLOR_MATERIAL); - /* diffuse */ - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_LIGHTING); - glEnable(GL_COLOR_MATERIAL); - - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me->mface, 1); - glDisable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHTING); - } - else if((G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) && me->mcol) { - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 1); - } - else if(G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) { - glColor3f(1.0f, 1.0f, 1.0f); - dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, NULL, 0); - } - else do_draw= 1; - } - if(do_draw) { - dl = ob->disp.first; - if (!dl || !dl->col1) { - /* release and reload derivedmesh because it might be freed in - shadeDispList due to a different datamask */ - dm->release(dm); - shadeDispList(base); - dl = find_displist(&ob->disp, DL_VERTCOL); - dm= mesh_get_derived_final(ob, get_viewedit_datamask()); - } - - if ((G.vd->flag&V3D_SELECT_OUTLINE) && (base->flag&SELECT) && !draw_wire) { - draw_mesh_object_outline(ob, dm); - } - - /* False for dupliframe objects */ - if (dl) { - unsigned int *obCol1 = dl->col1; - unsigned int *obCol2 = dl->col2; - - dm->drawFacesColored(dm, me->flag&ME_TWOSIDED, (unsigned char*) obCol1, (unsigned char*) obCol2); - } - - if(base->flag & SELECT) { - BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); - } else { - BIF_ThemeColor(TH_WIRE); - } - dm->drawLooseEdges(dm); - } - } - - /* set default draw color back for wire or for draw-extra later on */ - if (dt!=OB_WIRE) { - if(base->flag & SELECT) { - if(ob==OBACT && ob->flag & OB_FROMGROUP) - BIF_ThemeColor(TH_GROUP_ACTIVE); - else if(ob->flag & OB_FROMGROUP) - BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16); - else if(flag!=DRAW_CONSTCOLOR) - BIF_ThemeColor((ob==OBACT)?TH_ACTIVE:TH_SELECT); - else - glColor3ub(80,80,80); - } else { - if (ob->flag & OB_FROMGROUP) - BIF_ThemeColor(TH_GROUP); - else { - if(ob->dtx & OB_DRAWWIRE && flag==DRAW_CONSTCOLOR) - glColor3ub(80,80,80); - else - BIF_ThemeColor(TH_WIRE); - } - } - } - if (draw_wire) { - /* If drawing wire and drawtype is not OB_WIRE then we are - * overlaying the wires. - */ - - if (dt!=OB_WIRE) { - bglPolygonOffset(1.0); - glDepthMask(0); // disable write in zbuffer, selected edge wires show better - } - - dm->drawEdges(dm, (dt==OB_WIRE || totface==0)); - - if (dt!=OB_WIRE) { - glDepthMask(1); - bglPolygonOffset(0.0); - } - } - - dm->release(dm); -} - -/* returns 1 if nothing was drawn, for detecting to draw an object center */ -static int draw_mesh_object(Base *base, int dt, int flag) -{ - Object *ob= base->object; - Mesh *me= ob->data; - int has_alpha= 0, drawlinked= 0, retval= 0; - - if(G.obedit && ob!=G.obedit && ob->data==G.obedit->data) { - if(ob_get_key(ob)); - else drawlinked= 1; - } - - if(ob==G.obedit || drawlinked) { - DerivedMesh *finalDM, *cageDM; - - if (G.obedit!=ob) - finalDM = cageDM = editmesh_get_derived_base(); - else - cageDM = editmesh_get_derived_cage_and_final(&finalDM, - get_viewedit_datamask()); - - if(dt>OB_WIRE) init_gl_materials(ob, 0); // no transp in editmode, the fancy draw over goes bad then - draw_em_fancy(ob, G.editMesh, cageDM, finalDM, dt); - - if (G.obedit!=ob && finalDM) - finalDM->release(finalDM); - } - else if(!G.obedit && (G.f & G_SCULPTMODE) &&(G.scene->sculptdata.flags & SCULPT_DRAW_FAST) && - OBACT==ob && !sculpt_modifiers_active(ob)) { - sculptmode_draw_mesh(0); - } - else { - /* don't create boundbox here with mesh_get_bb(), the derived system will make it, puts deformed bb's OK */ - if(me->totface<=4 || boundbox_clip(ob->obmat, (ob->bb)? ob->bb: me->bb)) { - if(dt==OB_SOLID) has_alpha= init_gl_materials(ob, (base->flag & OB_FROMDUPLI)==0); - draw_mesh_fancy(base, dt, flag); - - if(me->totvert==0) retval= 1; - } - } - - /* init_gl_materials did the proper checking if this is needed */ - if(has_alpha) add_view3d_after(G.vd, base, V3D_TRANSP); - - return retval; -} - -/* ************** DRAW DISPLIST ****************** */ - -static int draw_index_wire= 1; -static int index3_nors_incr= 1; - -/* returns 1 when nothing was drawn */ -static int drawDispListwire(ListBase *dlbase) -{ - DispList *dl; - int parts, nr; - float *data; - - if(dlbase==NULL) return 1; - - glDisableClientState(GL_NORMAL_ARRAY); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - for(dl= dlbase->first; dl; dl= dl->next) { - if(dl->parts==0 || dl->nr==0) - continue; - - data= dl->verts; - - switch(dl->type) { - case DL_SEGM: - - glVertexPointer(3, GL_FLOAT, 0, data); - - for(parts=0; partsparts; parts++) - glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr); - - break; - case DL_POLY: - - glVertexPointer(3, GL_FLOAT, 0, data); - - for(parts=0; partsparts; parts++) - glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr); - - break; - case DL_SURF: - - glVertexPointer(3, GL_FLOAT, 0, data); - - for(parts=0; partsparts; parts++) { - if(dl->flag & DL_CYCL_U) - glDrawArrays(GL_LINE_LOOP, parts*dl->nr, dl->nr); - else - glDrawArrays(GL_LINE_STRIP, parts*dl->nr, dl->nr); - } - - for(nr=0; nrnr; nr++) { - int ofs= 3*dl->nr; - - data= ( dl->verts )+3*nr; - parts= dl->parts; - - if(dl->flag & DL_CYCL_V) glBegin(GL_LINE_LOOP); - else glBegin(GL_LINE_STRIP); - - while(parts--) { - glVertex3fv(data); - data+=ofs; - } - glEnd(); - - /* (ton) this code crashes for me when resolv is 86 or higher... no clue */ -// glVertexPointer(3, GL_FLOAT, sizeof(float)*3*dl->nr, data + 3*nr); -// if(dl->flag & DL_CYCL_V) -// glDrawArrays(GL_LINE_LOOP, 0, dl->parts); -// else -// glDrawArrays(GL_LINE_STRIP, 0, dl->parts); - } - break; - - case DL_INDEX3: - if(draw_index_wire) { - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index); - } - break; - - case DL_INDEX4: - if(draw_index_wire) { - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index); - } - break; - } - } - - glEnableClientState(GL_NORMAL_ARRAY); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - return 0; -} - -static void drawDispListsolid(ListBase *lb, Object *ob) -{ - DispList *dl; - float *data, curcol[4]; - float *ndata; - - if(lb==NULL) return; - - /* for drawing wire */ - glGetFloatv(GL_CURRENT_COLOR, curcol); - - glEnable(GL_LIGHTING); - - if(ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW); - else glFrontFace(GL_CCW); - - if(ob->type==OB_MBALL) { // mball always smooth shaded - glShadeModel(GL_SMOOTH); - } - - dl= lb->first; - while(dl) { - data= dl->verts; - ndata= dl->nors; - - switch(dl->type) { - case DL_SEGM: - if(ob->type==OB_SURF) { - int nr; - - glDisable(GL_LIGHTING); - glColor3fv(curcol); - - // glVertexPointer(3, GL_FLOAT, 0, dl->verts); - // glDrawArrays(GL_LINE_STRIP, 0, dl->nr); - - glBegin(GL_LINE_STRIP); - for(nr= dl->nr; nr; nr--, data+=3) - glVertex3fv(data); - glEnd(); - - glEnable(GL_LIGHTING); - } - break; - case DL_POLY: - if(ob->type==OB_SURF) { - int nr; - - BIF_ThemeColor(TH_WIRE); - glDisable(GL_LIGHTING); - - /* for some reason glDrawArrays crashes here in half of the platforms (not osx) */ - //glVertexPointer(3, GL_FLOAT, 0, dl->verts); - //glDrawArrays(GL_LINE_LOOP, 0, dl->nr); - - glBegin(GL_LINE_LOOP); - for(nr= dl->nr; nr; nr--, data+=3) - glVertex3fv(data); - glEnd(); - - glEnable(GL_LIGHTING); - break; - } - case DL_SURF: - - if(dl->index) { - set_gl_material(dl->col+1); - - if(dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH); - else glShadeModel(GL_FLAT); - - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glNormalPointer(GL_FLOAT, 0, dl->nors); - glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index); - } - break; - - case DL_INDEX3: - - set_gl_material(dl->col+1); - - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - - /* voor polys only one normal needed */ - if(index3_nors_incr==0) { - glDisableClientState(GL_NORMAL_ARRAY); - glNormal3fv(ndata); - } - else - glNormalPointer(GL_FLOAT, 0, dl->nors); - - glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index); - - if(index3_nors_incr==0) - glEnableClientState(GL_NORMAL_ARRAY); - - break; - - case DL_INDEX4: - - set_gl_material(dl->col+1); - - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glNormalPointer(GL_FLOAT, 0, dl->nors); - glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index); - - break; - } - dl= dl->next; - } - - glShadeModel(GL_FLAT); - glDisable(GL_LIGHTING); - glFrontFace(GL_CCW); -} - -static void drawDispListshaded(ListBase *lb, Object *ob) -{ - DispList *dl, *dlob; - unsigned int *cdata; - - if(lb==NULL) return; - - glShadeModel(GL_SMOOTH); - glDisableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - - dl= lb->first; - dlob= ob->disp.first; - while(dl && dlob) { - - cdata= dlob->col1; - if(cdata==NULL) break; - - switch(dl->type) { - case DL_SURF: - if(dl->index) { - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata); - glDrawElements(GL_QUADS, 4*dl->totindex, GL_UNSIGNED_INT, dl->index); - } - break; - - case DL_INDEX3: - - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata); - glDrawElements(GL_TRIANGLES, 3*dl->parts, GL_UNSIGNED_INT, dl->index); - break; - - case DL_INDEX4: - - glVertexPointer(3, GL_FLOAT, 0, dl->verts); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, cdata); - glDrawElements(GL_QUADS, 4*dl->parts, GL_UNSIGNED_INT, dl->index); - break; - } - - dl= dl->next; - dlob= dlob->next; - } - - glShadeModel(GL_FLAT); - glEnableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); -} - -/* returns 1 when nothing was drawn */ -static int drawDispList(Base *base, int dt) -{ - Object *ob= base->object; - ListBase *lb=0; - DispList *dl; - Curve *cu; - int solid, retval= 0; - - solid= (dt > OB_WIRE); - - switch(ob->type) { - case OB_FONT: - case OB_CURVE: - cu= ob->data; - - lb= &cu->disp; - - if(solid) { - dl= lb->first; - if(dl==NULL) return 1; - - if(dl->nors==0) addnormalsDispList(ob, lb); - index3_nors_incr= 0; - - if( displist_has_faces(lb)==0) { - draw_index_wire= 0; - drawDispListwire(lb); - draw_index_wire= 1; - } - else { - if(dt==OB_SHADED) { - if(ob->disp.first==0) shadeDispList(base); - drawDispListshaded(lb, ob); - } - else { - init_gl_materials(ob, 0); - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - drawDispListsolid(lb, ob); - } - if(ob==G.obedit && cu->bevobj==NULL && cu->taperobj==NULL) { - cpack(0); - draw_index_wire= 0; - drawDispListwire(lb); - draw_index_wire= 1; - } - } - index3_nors_incr= 1; - } - else { - draw_index_wire= 0; - retval= drawDispListwire(lb); - draw_index_wire= 1; - } - break; - case OB_SURF: - - lb= &((Curve *)ob->data)->disp; - - if(solid) { - dl= lb->first; - if(dl==NULL) return 1; - - if(dl->nors==NULL) addnormalsDispList(ob, lb); - - if(dt==OB_SHADED) { - if(ob->disp.first==NULL) shadeDispList(base); - drawDispListshaded(lb, ob); - } - else { - init_gl_materials(ob, 0); - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - - drawDispListsolid(lb, ob); - } - } - else { - retval= drawDispListwire(lb); - } - break; - case OB_MBALL: - - if( is_basis_mball(ob)) { - lb= &ob->disp; - if(lb->first==NULL) makeDispListMBall(ob); - if(lb->first==NULL) return 1; - - if(solid) { - - if(dt==OB_SHADED) { - dl= lb->first; - if(dl && dl->col1==0) shadeDispList(base); - drawDispListshaded(lb, ob); - } - else { - init_gl_materials(ob, 0); - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - - drawDispListsolid(lb, ob); - } - } - else{ - /* MetaBalls use DL_INDEX4 type of DispList */ - retval= drawDispListwire(lb); - } - } - break; - } - - return retval; -} - -/* ******************************** */ - - -static void draw_particle_system(Base *base, PartEff *paf) -{ - Object *ob= base->object; - Particle *pa; - float ptime, ctime, vec[3], vec1[3], mat[4][4]; - int a, totpart; - - pa= paf->keys; - // FSPARTICLE always rebuild fluid particle system upon change... - if( (pa==NULL) - || ( (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings) && (ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE)) - ) { - build_particle_system(ob); - pa= paf->keys; - if(pa==NULL) return; - } - - myloadmatrix(G.vd->viewmat); - /* flag abuse... but I need working code too now. This feature doesnt work for per frame animated objects */ - if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { - Mat4MulMat4(mat, paf->imat, ob->obmat); - mymultmatrix(mat); - } - - if(ob->ipoflag & OB_OFFS_PARTICLE) ptime= ob->sf; - else ptime= 0.0; - ctime= bsystem_time(ob, (float)(G.scene->r.cfra), ptime); - - glPointSize(1.0); - - if(paf->stype==PAF_VECT) glBegin(GL_LINES); - else glBegin(GL_POINTS); - - totpart= (paf->disp*paf->totpart)/100; - for(a=0; atotkey) { - - if(ctime > pa->time) { - if(ctime < pa->time+pa->lifetime) { - - if(paf->stype==PAF_VECT) { - where_is_particle(paf, pa, ctime, vec); - where_is_particle(paf, pa, ctime+1.0, vec1); - - glVertex3fv(vec); - glVertex3fv(vec1); - } - else { - where_is_particle(paf, pa, ctime, vec); - - glVertex3fv(vec); - } - } - } - } - glEnd(); - - myloadmatrix(G.vd->viewmat); - mymultmatrix(ob->obmat); // bring back local matrix for dtx -} - -static void draw_static_particle_system(Object *ob, PartEff *paf, int dt) -{ - Particle *pa; - float ctime, mtime, vec[3], veco[3]; - int a, use_norm=0, totpart; - - pa= paf->keys; - // FSPARTICLE always rebuild upon change... - if( (pa==NULL) - || ( (ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (ob->fluidsimSettings) && (ob->fluidsimSettings->type == OB_FLUIDSIM_PARTICLE)) - ) { - build_particle_system(ob); - pa= paf->keys; - if(pa==NULL) return; - } - - if(paf->stype==PAF_VECT) { - if(dt>OB_WIRE) { - - /* shaded/texture mode: we still draw solid, so have to set materials */ - if(dt>OB_SOLID) init_gl_materials(ob, 0); - - glEnable(GL_LIGHTING); - set_gl_material(paf->omat); - use_norm= 1; - } - } - else { - glPointSize(1.0); - glBegin(GL_POINTS); - } - - totpart= (paf->disp*paf->totpart)/100; - for(a=0; atotkey) { - - if(paf->stype==PAF_VECT) { - - glBegin(GL_LINE_STRIP); - where_is_particle(paf, pa, pa->time, veco); - - mtime= pa->time+pa->lifetime+paf->staticstep; - for(ctime= pa->time+paf->staticstep; ctimestaticstep) { - - where_is_particle(paf, pa, ctime, vec); - - if(use_norm) { - float no[3]; - VECSUB(no, vec, veco); - glNormal3fv(no); - } - glVertex3fv(veco); - VECCOPY(veco, vec); - } - - glVertex3fv(veco); - glEnd(); - } - else { - mtime= pa->time+pa->lifetime+paf->staticstep-1; - for(ctime= pa->time; ctimestaticstep) { - where_is_particle(paf, pa, ctime, vec); - glVertex3fv(vec); - } - } - } - if(paf->stype==PAF_VECT) { - glDisable(GL_LIGHTING); - } - else { - glEnd(); - } - -} - -/* unified drawing of all new particle systems draw types except dupli ob & group */ -/* mostly tries to use vertex arrays for speed */ - -/* 1. check that everything is ok & updated */ -/* 2. start initialising things */ -/* 3. initialize according to draw type */ -/* 4. allocate drawing data arrays */ -/* 5. start filling the arrays */ -/* 6. draw the arrays */ -/* 7. clean up */ -static void draw_new_particle_system(Base *base, ParticleSystem *psys) -{ - View3D *v3d= G.vd; - Object *ob=base->object; - ParticleSystemModifierData *psmd; - ParticleSettings *part; - ParticleData *pars, *pa; - ParticleKey state, *states=0; - ParticleCacheKey *cache=0; - Material *ma; - Object *bb_ob=0; - float vel[3], vec[3], vec2[3], imat[4][4], onevec[3]={0.0f,0.0f,0.0f}, bb_center[3]; - float timestep, pixsize=1.0, pa_size, pa_time, r_tilt; - float cfra=bsystem_time(ob,(float)CFRA,0.0); - float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3]; - int a, k, k_max=0, totpart, totpoint=0, draw_as, path_nbr=0; - int path_possible=0, keys_possible=0, draw_keys=0, totchild=0; - int select=ob->flag&SELECT; - GLint polygonmode[2]; - char val[32]; - -/* 1. */ - if(psys==0) - return; - - part=psys->part; - pars=psys->particles; - - if(part==0 || !psys_check_enabled(ob, psys)) - return; - - if(pars==0) return; - - if(!G.obedit && psys_in_edit_mode(psys) - && psys->flag & PSYS_HAIR_DONE && part->draw_as==PART_DRAW_PATH) - return; - - if(part->draw_as==PART_DRAW_NOT) return; - -/* 2. */ - if(part->phystype==PART_PHYS_KEYED){ - if(psys->flag & PSYS_FIRST_KEYED){ - if(psys->flag&PSYS_KEYED){ - select=psys_count_keyed_targets(ob,psys); - if(psys->totkeyed==0) - return; - } - } - else - return; - } - - if(select){ - select=0; - if(psys_get_current(ob)==psys) - select=1; - } - - psys->flag|=PSYS_DRAWING; - - if(!psys->childcache) - totchild=0; - else - totchild=psys->totchild*part->disp/100; - - ma= give_current_material(ob,part->omat); - - if(select) - cpack(0xFFFFFF); - else if(part->draw&PART_DRAW_MAT_COL) - glColor3f(ma->r,ma->g,ma->b); - else - cpack(0); - - psmd= psys_get_modifier(ob,psys); - - timestep= psys_get_timestep(part); - - myloadmatrix(G.vd->viewmat); - - if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { - float mat[4][4]; - Mat4MulMat4(mat, psys->imat, ob->obmat); - mymultmatrix(mat); - } - - totpart=psys->totpart; - draw_as=part->draw_as; - - if(part->flag&PART_ABS_TIME && part->ipo){ - calc_ipo(part->ipo, cfra); - execute_ipo((ID *)part, part->ipo); - } - - if(part->flag&PART_GLOB_TIME) - cfra=bsystem_time(0,(float)CFRA,0.0); - - if(psys->pathcache){ - path_possible=1; - keys_possible=1; - } - if(draw_as==PART_DRAW_PATH && path_possible==0) - draw_as=PART_DRAW_DOT; - - if(draw_as!=PART_DRAW_PATH && keys_possible && part->draw&PART_DRAW_KEYS){ - path_nbr=part->keys_step; - draw_keys=1; - } - -/* 3. */ - switch(draw_as){ - case PART_DRAW_DOT: - if(part->draw_size) - glPointSize(part->draw_size); - else - glPointSize(2.0); /* default dot size */ - break; - case PART_DRAW_CIRC: - /* calculate view aligned matrix: */ - Mat4CpyMat4(imat, G.vd->viewinv); - Normalize(imat[0]); - Normalize(imat[1]); - /* no break! */ - case PART_DRAW_CROSS: - case PART_DRAW_AXIS: - /* lets calculate the scale: */ - pixsize= v3d->persmat[0][3]*ob->obmat[3][0]+ v3d->persmat[1][3]*ob->obmat[3][1]+ v3d->persmat[2][3]*ob->obmat[3][2]+ v3d->persmat[3][3]; - pixsize*= v3d->pixsize; - if(part->draw_size==0.0) - pixsize*=2.0; - else - pixsize*=part->draw_size; - break; - case PART_DRAW_OB: - if(part->dup_ob==0) - draw_as=PART_DRAW_DOT; - else - draw_as=0; - break; - case PART_DRAW_GR: - if(part->dup_group==0) - draw_as=PART_DRAW_DOT; - else - draw_as=0; - break; - case PART_DRAW_BB: - if(G.vd->camera==0 && part->bb_ob==0){ - error("Billboards need an active camera or a target object!"); - - draw_as=part->draw_as=PART_DRAW_DOT; - - if(part->draw_size) - glPointSize(part->draw_size); - else - glPointSize(2.0); /* default dot size */ - } - else if(part->bb_ob) - bb_ob=part->bb_ob; - else - bb_ob=G.vd->camera; - - if(part->bb_alignbb_align]=1.0f; - break; - case PART_DRAW_PATH: - break; - } - if(part->draw & PART_DRAW_SIZE && part->draw_as!=PART_DRAW_CIRC){ - Mat4CpyMat4(imat, G.vd->viewinv); - Normalize(imat[0]); - Normalize(imat[1]); - } - -/* 4. */ - if(draw_as && draw_as!=PART_DRAW_PATH){ - if(draw_as!=PART_DRAW_CIRC){ - switch(draw_as){ - case PART_DRAW_AXIS: - cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_cdata"); - /* no break! */ - case PART_DRAW_CROSS: - vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_vdata"); - break; - case PART_DRAW_LINE: - vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*2*3*sizeof(float), "particle_vdata"); - break; - case PART_DRAW_BB: - vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata"); - ndata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata"); - break; - default: - vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*3*sizeof(float), "particle_vdata"); - } - } - - if(part->draw&PART_DRAW_VEL && draw_as!=PART_DRAW_LINE) - vedata=MEM_callocN((totpart+totchild)*2*3*(path_nbr+1)*sizeof(float), "particle_vedata"); - - vd=vdata; - ved=vedata; - cd=cdata; - nd=ndata; - - psys->lattice=psys_get_lattice(ob,psys); - } - - if(draw_as){ -/* 5. */ - for(a=0,pa=pars; adraw&PART_DRAW_PARENT)==0) continue; - if(pa->flag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) continue; - - pa_time=(cfra-pa->time)/pa->lifetime; - - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ - calc_ipo(part->ipo, 100*pa_time); - execute_ipo((ID *)part, part->ipo); - } - - pa_size=pa->size; - - r_tilt=1.0f+pa->r_ave[0]; - - if(path_nbr){ - cache=psys->pathcache[a]; - k_max=(int)(cache->steps); - } - } - else{ - ChildParticle *cpa= &psys->child[a-totpart]; - - pa_time=psys_get_child_time(psys,cpa,cfra); - - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ - calc_ipo(part->ipo, 100*pa_time); - execute_ipo((ID *)part, part->ipo); - } - - pa_size=psys_get_child_size(psys,cpa,cfra,0); - - r_tilt=2.0f*cpa->rand[2]; - if(path_nbr){ - cache=psys->childcache[a-totpart]; - k_max=(int)(cache->steps); - } - } - - if(draw_as!=PART_DRAW_PATH){ - int next_pa=0; - for(k=0; k<=path_nbr; k++){ - if(draw_keys){ - state.time=(float)k/(float)path_nbr; - psys_get_particle_on_path(ob,psys,a,&state,1); - } - else if(path_nbr){ - if(k<=k_max){ - VECCOPY(state.co,(cache+k)->co); - VECCOPY(state.vel,(cache+k)->vel); - QUATCOPY(state.rot,(cache+k)->rot); - } - else - continue; - } - else{ - state.time=cfra; - if(psys_get_particle_state(ob,psys,a,&state,0)==0){ - next_pa=1; - break; - } - } - - switch(draw_as){ - case PART_DRAW_DOT: - if(vd){ - VECCOPY(vd,state.co) vd+=3; - } - break; - case PART_DRAW_CROSS: - case PART_DRAW_AXIS: - vec[0]=2.0f*pixsize; - vec[1]=vec[2]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - cd[1]=cd[2]=cd[4]=cd[5]=0.0; - cd[0]=cd[3]=1.0; - cd[6]=cd[8]=cd[9]=cd[11]=0.0; - cd[7]=cd[10]=1.0; - cd[13]=cd[12]=cd[15]=cd[16]=0.0; - cd[14]=cd[17]=1.0; - cd+=18; - - VECCOPY(vec2,state.co); - } - else VECSUB(vec2,state.co,vec); - - VECADD(vec,state.co,vec); - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - - vec[1]=2.0f*pixsize; - vec[0]=vec[2]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - VECCOPY(vec2,state.co); - } - else VECSUB(vec2,state.co,vec); - - VECADD(vec,state.co,vec); - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - - vec[2]=2.0f*pixsize; - vec[0]=vec[1]=0.0; - QuatMulVecf(state.rot,vec); - if(draw_as==PART_DRAW_AXIS){ - VECCOPY(vec2,state.co); - } - else VECSUB(vec2,state.co,vec); - - VECADD(vec,state.co,vec); - - VECCOPY(vd,vec); vd+=3; - VECCOPY(vd,vec2); vd+=3; - break; - case PART_DRAW_LINE: - VECCOPY(vec,state.vel); - Normalize(vec); - if(part->draw & PART_DRAW_VEL_LENGTH) - VecMulf(vec,VecLength(state.vel)); - VECADDFAC(vd,state.co,vec,-part->draw_line[0]); vd+=3; - VECADDFAC(vd,state.co,vec,part->draw_line[1]); vd+=3; - break; - case PART_DRAW_CIRC: - drawcircball(GL_LINE_LOOP, state.co, pixsize, imat); - break; - case PART_DRAW_BB: - if(part->draw&PART_DRAW_BB_LOCK && part->bb_align==PART_BB_VIEW){ - VECCOPY(xvec,bb_ob->obmat[0]); - Normalize(xvec); - VECCOPY(yvec,bb_ob->obmat[1]); - Normalize(yvec); - VECCOPY(zvec,bb_ob->obmat[2]); - Normalize(zvec); - } - else if(part->bb_align==PART_BB_VEL){ - float temp[3]; - VECCOPY(temp,state.vel); - Normalize(temp); - VECSUB(zvec,bb_ob->obmat[3],state.co); - if(part->draw&PART_DRAW_BB_LOCK){ - float fac=-Inpf(zvec,temp); - VECADDFAC(zvec,zvec,temp,fac); - } - Normalize(zvec); - Crossf(xvec,temp,zvec); - Normalize(xvec); - Crossf(yvec,zvec,xvec); - } - else{ - VECSUB(zvec,bb_ob->obmat[3],state.co); - if(part->draw&PART_DRAW_BB_LOCK) - zvec[part->bb_align]=0.0f; - Normalize(zvec); - - if(part->bb_alignobmat[1],zvec); - Normalize(xvec); - Crossf(yvec,zvec,xvec); - } - - VECCOPY(vec,xvec); - VECCOPY(vec2,yvec); - - VecMulf(xvec,cos(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI)); - VecMulf(vec2,sin(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI)); - VECADD(xvec,xvec,vec2); - - VecMulf(yvec,cos(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI)); - VecMulf(vec,-sin(part->bb_tilt*(1.0f-part->bb_rand_tilt*r_tilt)*(float)M_PI)); - VECADD(yvec,yvec,vec); - - VecMulf(xvec,pa_size); - VecMulf(yvec,pa_size); - - VECADDFAC(bb_center,state.co,xvec,part->bb_offset[0]); - VECADDFAC(bb_center,bb_center,yvec,part->bb_offset[1]); - - VECADD(vd,bb_center,xvec); - VECADD(vd,vd,yvec); vd+=3; - - VECSUB(vd,bb_center,xvec); - VECADD(vd,vd,yvec); vd+=3; - - VECSUB(vd,bb_center,xvec); - VECSUB(vd,vd,yvec); vd+=3; - - VECADD(vd,bb_center,xvec); - VECSUB(vd,vd,yvec); vd+=3; - - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - VECCOPY(nd, zvec); nd+=3; - break; - } - - if(vedata){ - VECCOPY(ved,state.co); - ved+=3; - VECCOPY(vel,state.vel); - VecMulf(vel,timestep); - VECADD(ved,state.co,vel); - ved+=3; - } - - if(part->draw & PART_DRAW_SIZE){ - setlinestyle(3); - drawcircball(GL_LINE_LOOP, state.co, pa_size, imat); - setlinestyle(0); - } - - totpoint++; - } - if(next_pa) - continue; - if(part->draw&PART_DRAW_NUM){ - /* in path drawing state.co is the end point */ - glRasterPos3f(state.co[0], state.co[1], state.co[2]); - sprintf(val," %i",a); - BMF_DrawString(G.font, val); - } - } - } -/* 6. */ - - glGetIntegerv(GL_POLYGON_MODE, polygonmode); - glDisableClientState(GL_NORMAL_ARRAY); - - if(draw_as != PART_DRAW_CIRC){ - if(draw_as==PART_DRAW_PATH){ - ParticleCacheKey **cache, *path; - float *cd2=0,*cdata2=0; - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnable(GL_LIGHTING); - - if(part->draw&PART_DRAW_MAT_COL) { - glEnableClientState(GL_COLOR_ARRAY); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); - } - - if(totchild && (part->draw&PART_DRAW_PARENT)==0) - totpart=0; - - cache=psys->pathcache; - for(a=0, pa=psys->particles; aco); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); - glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1); - } - - cache=psys->childcache; - for(a=0; aco); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); - glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1); - } - - if(part->draw&PART_DRAW_MAT_COL) { - glDisable(GL_COLOR_ARRAY); - glDisable(GL_COLOR_MATERIAL); - } - - if(cdata2) - MEM_freeN(cdata2); - cd2=cdata2=0; - - glLineWidth(1.0f); - - /* draw particle edit mode key points*/ - } - - if(draw_as!=PART_DRAW_PATH){ - glDisableClientState(GL_COLOR_ARRAY); - - if(vdata){ - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vdata); - } - else - glDisableClientState(GL_VERTEX_ARRAY); - - if(ndata && MIN2(G.vd->drawtype, ob->dt)>OB_WIRE){ - glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(GL_FLOAT, 0, ndata); - glEnable(GL_LIGHTING); - } - else{ - glDisableClientState(GL_NORMAL_ARRAY); - glDisable(GL_LIGHTING); - } - - switch(draw_as){ - case PART_DRAW_AXIS: - case PART_DRAW_CROSS: - if(cdata){ - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(3, GL_FLOAT, 0, cdata); - } - glDrawArrays(GL_LINES, 0, 6*totpoint); - break; - case PART_DRAW_LINE: - glDrawArrays(GL_LINES, 0, 2*totpoint); - break; - case PART_DRAW_BB: - if(MIN2(G.vd->drawtype, ob->dt)<=OB_WIRE) - glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); - - glDrawArrays(GL_QUADS, 0, 4*totpoint); - break; - default: - glDrawArrays(GL_POINTS, 0, totpoint); - break; - } - } - - } - if(vedata){ - glDisableClientState(GL_COLOR_ARRAY); - cpack(0xC0C0C0); - - glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3, GL_FLOAT, 0, vedata); - - glDrawArrays(GL_LINES, 0, 2*totpoint); - } - - glPolygonMode(GL_FRONT, polygonmode[0]); - glPolygonMode(GL_BACK, polygonmode[1]); - } - -/* 7. */ - - glDisable(GL_LIGHTING); - glDisableClientState(GL_COLOR_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnable(GL_DEPTH_TEST); - - if(states) - MEM_freeN(states); - if(vdata) - MEM_freeN(vdata); - if(vedata) - MEM_freeN(vedata); - if(cdata) - MEM_freeN(cdata); - if(ndata) - MEM_freeN(ndata); - - psys->flag &= ~PSYS_DRAWING; - - if(psys->lattice){ - end_latt_deform(); - psys->lattice=0; - } - - myloadmatrix(G.vd->viewmat); - mymultmatrix(ob->obmat); // bring back local matrix for dtx -} - -static void draw_particle_edit(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit = psys->edit; - ParticleData *pa; - ParticleCacheKey **path; - ParticleEditKey *key; - ParticleEditSettings *pset = PE_settings(); - int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed; - char nosel[4], sel[4]; - float sel_col[3]; - float nosel_col[3]; - char val[32]; - - if(psys->pathcache==0){ - PE_hide_keys_time(psys,CFRA); - psys_cache_paths(ob,psys,CFRA,0); - } - - if(pset->flag & PE_SHOW_CHILD && psys->part->draw_as == PART_DRAW_PATH) { - if(psys->childcache==0) - psys_cache_child_paths(ob, psys, CFRA, 0); - } - else if(psys->childcache) - free_child_path_cache(psys); - - if((G.vd->flag & V3D_ZBUF_SELECT)==0) - glDisable(GL_DEPTH_TEST); - - myloadmatrix(G.vd->viewmat); - - BIF_GetThemeColor3ubv(TH_VERTEX_SELECT, sel); - BIF_GetThemeColor3ubv(TH_VERTEX, nosel); - sel_col[0]=(float)sel[0]/255.0f; - sel_col[1]=(float)sel[1]/255.0f; - sel_col[2]=(float)sel[2]/255.0f; - nosel_col[0]=(float)nosel[0]/255.0f; - nosel_col[1]=(float)nosel[1]/255.0f; - nosel_col[2]=(float)nosel[2]/255.0f; - - if(psys->childcache) - totchild = psys->totchildcache; - - /* draw paths */ - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - if(timed) - glEnable(GL_BLEND); - - if(pset->brushtype == PE_BRUSH_WEIGHT){ - glLineWidth(2.0f); - glEnableClientState(GL_COLOR_ARRAY); - glDisable(GL_LIGHTING); - } - - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); - - for(i=0, pa=psys->particles, path = psys->pathcache; ico); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); - - glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); - } - - glEnable(GL_LIGHTING); - - for(i=0, path=psys->childcache; ico); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); - - glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); - } - - glDisable(GL_COLOR_MATERIAL); - - /* draw edit vertices */ - if(G.scene->selectmode!=SCE_SELECT_PATH){ - glDisableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glDisable(GL_LIGHTING); - glPointSize(4.0f); - - if(G.scene->selectmode==SCE_SELECT_POINT){ - float *cd=0,*cdata=0; - cd=cdata=MEM_callocN(edit->totkeys*(timed?4:3)*sizeof(float), "particle edit color data"); - - for(i=0, pa=psys->particles; ikeys[i]; ktotkey; k++, key++){ - if(key->flag&PEK_SELECT){ - VECCOPY(cd,sel_col); - } - else{ - VECCOPY(cd,nosel_col); - } - if(timed) - *(cd+3) = (key->flag&PEK_HIDE)?0.0f:1.0f; - cd += (timed?4:3); - } - } - cd=cdata; - for(i=0, pa=psys->particles; iflag & PARS_HIDE)==0){ - glVertexPointer(3, GL_FLOAT, sizeof(ParticleEditKey), edit->keys[i]->world_co); - glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd); - glDrawArrays(GL_POINTS, 0, pa->totkey); - } - cd += (timed?4:3) * pa->totkey; - - if(pset->flag&PE_SHOW_TIME && (pa->flag&PARS_HIDE)==0){ - for(k=0, key=edit->keys[i]+k; ktotkey; k++, key++){ - if(key->flag & PEK_HIDE) continue; - - glRasterPos3fv(key->world_co); - sprintf(val," %.1f",*key->time); - BMF_DrawString(G.font, val); - } - } - } - if(cdata) - MEM_freeN(cdata); - cd=cdata=0; - } - else if(G.scene->selectmode == SCE_SELECT_END){ - for(i=0, pa=psys->particles; iflag & PARS_HIDE)==0){ - key = edit->keys[i] + pa->totkey - 1; - if(key->flag & PEK_SELECT) - glColor3fv(sel_col); - else - glColor3fv(nosel_col); - /* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/ - glBegin(GL_POINTS); - glVertex3fv(key->world_co); - glEnd(); - - if(pset->flag & PE_SHOW_TIME){ - glRasterPos3fv(key->world_co); - sprintf(val," %.1f",*key->time); - BMF_DrawString(G.font, val); - } - } - } - } - } - - glDisable(GL_BLEND); - glDisable(GL_LIGHTING); - glDisableClientState(GL_COLOR_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnable(GL_DEPTH_TEST); - glLineWidth(1.0f); - - mymultmatrix(ob->obmat); // bring back local matrix for dtx -} - -unsigned int nurbcol[8]= { - 0, 0x9090, 0x409030, 0x603080, 0, 0x40fff0, 0x40c033, 0xA090F0 }; - -static void tekenhandlesN(Nurb *nu, short sel) -{ - BezTriple *bezt; - float *fp; - unsigned int *col; - int a; - - if(nu->hide || (G.f & G_HIDDENHANDLES)) return; - - glBegin(GL_LINES); - - if( (nu->type & 7)==1) { - if(sel) col= nurbcol+4; - else col= nurbcol; - - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->hide==0) { - if( (bezt->f2 & SELECT)==sel) { - fp= bezt->vec[0]; - - cpack(col[bezt->h1]); - glVertex3fv(fp); - glVertex3fv(fp+3); - - cpack(col[bezt->h2]); - glVertex3fv(fp+3); - glVertex3fv(fp+6); - } - else if( (bezt->f1 & SELECT)==sel) { - fp= bezt->vec[0]; - - cpack(col[bezt->h1]); - glVertex3fv(fp); - glVertex3fv(fp+3); - } - else if( (bezt->f3 & SELECT)==sel) { - fp= bezt->vec[1]; - - cpack(col[bezt->h2]); - glVertex3fv(fp); - glVertex3fv(fp+3); - } - } - bezt++; - } - } - glEnd(); -} - -static void tekenvertsN(Nurb *nu, short sel) -{ - BezTriple *bezt; - BPoint *bp; - float size; - int a; - - if(nu->hide) return; - - if(sel) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - - size= BIF_GetThemeValuef(TH_VERTEX_SIZE); - glPointSize(size); - - bglBegin(GL_POINTS); - - if((nu->type & 7)==1) { - - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->hide==0) { - if (G.f & G_HIDDENHANDLES) { - if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]); - } else { - if((bezt->f1 & SELECT)==sel) bglVertex3fv(bezt->vec[0]); - if((bezt->f2 & SELECT)==sel) bglVertex3fv(bezt->vec[1]); - if((bezt->f3 & SELECT)==sel) bglVertex3fv(bezt->vec[2]); - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->hide==0) { - if((bp->f1 & SELECT)==sel) bglVertex3fv(bp->vec); - } - bp++; - } - } - - bglEnd(); - glPointSize(1.0); -} - -static void draw_editnurb(Object *ob, Nurb *nurb, int sel) -{ - Nurb *nu; - BPoint *bp, *bp1; - int a, b, ofs; - - nu= nurb; - while(nu) { - if(nu->hide==0) { - switch(nu->type & 7) { - case CU_POLY: - cpack(nurbcol[3]); - bp= nu->bp; - for(b=0; bpntsv; b++) { - if(nu->flagu & 1) glBegin(GL_LINE_LOOP); - else glBegin(GL_LINE_STRIP); - - for(a=0; apntsu; a++, bp++) { - glVertex3fv(bp->vec); - } - - glEnd(); - } - break; - case CU_NURBS: - - bp= nu->bp; - for(b=0; bpntsv; b++) { - bp1= bp; - bp++; - for(a=nu->pntsu-1; a>0; a--, bp++) { - if(bp->hide==0 && bp1->hide==0) { - if(sel) { - if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT ) ) { - cpack(nurbcol[5]); - - glBegin(GL_LINE_STRIP); - glVertex3fv(bp->vec); - glVertex3fv(bp1->vec); - glEnd(); - } - } - else { - if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ); - else { - cpack(nurbcol[1]); - - glBegin(GL_LINE_STRIP); - glVertex3fv(bp->vec); - glVertex3fv(bp1->vec); - glEnd(); - } - } - } - bp1= bp; - } - } - if(nu->pntsv > 1) { /* surface */ - - ofs= nu->pntsu; - for(b=0; bpntsu; b++) { - bp1= nu->bp+b; - bp= bp1+ofs; - for(a=nu->pntsv-1; a>0; a--, bp+=ofs) { - if(bp->hide==0 && bp1->hide==0) { - if(sel) { - if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ) { - cpack(nurbcol[7]); - - glBegin(GL_LINE_STRIP); - glVertex3fv(bp->vec); - glVertex3fv(bp1->vec); - glEnd(); - } - } - else { - if( (bp->f1 & SELECT) && ( bp1->f1 & SELECT) ); - else { - cpack(nurbcol[3]); - - glBegin(GL_LINE_STRIP); - glVertex3fv(bp->vec); - glVertex3fv(bp1->vec); - glEnd(); - } - } - } - bp1= bp; - } - } - - } - break; - } - } - nu= nu->next; - } -} - -static void drawnurb(Base *base, Nurb *nurb, int dt) -{ - Object *ob= base->object; - Curve *cu = ob->data; - Nurb *nu; - BevList *bl; - - retopo_matrix_update(G.vd); - - /* DispList */ - BIF_ThemeColor(TH_WIRE); - drawDispList(base, dt); - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - /* first non-selected handles */ - for(nu=nurb; nu; nu=nu->next) { - if((nu->type & 7)==CU_BEZIER) { - tekenhandlesN(nu, 0); - } - } - draw_editnurb(ob, nurb, 0); - draw_editnurb(ob, nurb, 1); - /* selected handles */ - for(nu=nurb; nu; nu=nu->next) { - if((nu->type & 7)==1) tekenhandlesN(nu, 1); - tekenvertsN(nu, 0); - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - - /* direction vectors for 3d curve paths - when at its lowest, dont render normals */ - if(cu->flag & CU_3D && G.scene->editbutsize > 0.0015) { - BIF_ThemeColor(TH_WIRE); - for (bl=cu->bev.first,nu=nurb; nu && bl; bl=bl->next,nu=nu->next) { - BevPoint *bevp= (BevPoint *)(bl+1); - int nr= bl->nr; - int skip= nu->resolu/16; - float fac; - - while (nr-->0) { /* accounts for empty bevel lists */ - float ox,oy,oz; // Offset perpendicular to the curve - float dx,dy,dz; // Delta along the curve - - fac = calc_curve_subdiv_radius(cu, nu, (bl->nr - nr)) * G.scene->editbutsize; - - ox = fac*bevp->mat[0][0]; - oy = fac*bevp->mat[0][1]; - oz = fac*bevp->mat[0][2]; - - dx = fac*bevp->mat[2][0]; - dy = fac*bevp->mat[2][1]; - dz = fac*bevp->mat[2][2]; - - glBegin(GL_LINE_STRIP); - glVertex3f(bevp->x - ox - dx, bevp->y - oy - dy, bevp->z - oz - dz); - glVertex3f(bevp->x, bevp->y, bevp->z); - glVertex3f(bevp->x + ox - dx, bevp->y + oy - dy, bevp->z + oz - dz); - glEnd(); - - bevp += skip+1; - nr -= skip; - } - } - } - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - for(nu=nurb; nu; nu=nu->next) { - tekenvertsN(nu, 1); - } - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); -} - -/* draw a sphere for use as an empty drawtype */ -static void draw_empty_sphere (float size) -{ - float cent=0; - GLUquadricObj *qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - - glPushMatrix(); - glTranslatef(cent, cent, cent); - glScalef(size, size, size); - gluSphere(qobj, 1.0, 8, 5); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - -/* draw a cone for use as an empty drawtype */ -static void draw_empty_cone (float size) -{ - float cent=0; - float radius; - GLUquadricObj *qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - - - glPushMatrix(); - - radius = size; - glTranslatef(cent,cent, cent); - glScalef(radius, 2.0*size, radius); - glRotatef(-90., 1.0, 0.0, 0.0); - gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - -/* draw points on curve speed handles */ -static void curve_draw_speed(Object *ob) -{ - Curve *cu= ob->data; - IpoCurve *icu; - BezTriple *bezt; - float loc[4], dir[3]; - int a; - - if(cu->ipo==NULL) - return; - - icu= cu->ipo->curve.first; - if(icu==NULL || icu->totvert<2) - return; - - glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) ); - bglBegin(GL_POINTS); - - for(a=0, bezt= icu->bezt; atotvert; a++, bezt++) { - if( where_on_path(ob, bezt->vec[1][1], loc, dir)) { - BIF_ThemeColor((bezt->f2 & SELECT) && ob==OBACT?TH_VERTEX_SELECT:TH_VERTEX); - bglVertex3fv(loc); - } - } - - glPointSize(1.0); - bglEnd(); -} - - -static void tekentextcurs(void) -{ - cpack(0); - - set_inverted_drawing(1); - glBegin(GL_QUADS); - glVertex2fv(G.textcurs[0]); - glVertex2fv(G.textcurs[1]); - glVertex2fv(G.textcurs[2]); - glVertex2fv(G.textcurs[3]); - glEnd(); - set_inverted_drawing(0); -} - -static void drawspiral(float *cent, float rad, float tmat[][4], int start) -{ - float vec[3], vx[3], vy[3]; - int a, tot=32; - char inverse=0; - - if (start < 0) { - inverse = 1; - start *= -1; - } - - VECCOPY(vx, tmat[0]); - VECCOPY(vy, tmat[1]); - VecMulf(vx, rad); - VecMulf(vy, rad); - - VECCOPY(vec, cent); - - if (inverse==0) { - for(a=0; a31) - start=-a + 1; - glBegin(GL_LINES); - glVertex3fv(vec); - vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)a/(float)tot) + *(cosval+a+start) * (vy[0] * (float)a/(float)tot); - vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)a/(float)tot) + *(cosval+a+start) * (vy[1] * (float)a/(float)tot); - vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)a/(float)tot) + *(cosval+a+start) * (vy[2] * (float)a/(float)tot); - glVertex3fv(vec); - glEnd(); - } - } - else { - a=0; - vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[0] * (float)(-a+31)/(float)tot); - vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[1] * (float)(-a+31)/(float)tot); - vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[2] * (float)(-a+31)/(float)tot); - for(a=0; a31) - start=-a + 1; - glBegin(GL_LINES); - glVertex3fv(vec); - vec[0]= cent[0] + *(sinval+a+start) * (vx[0] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[0] * (float)(-a+31)/(float)tot); - vec[1]= cent[1] + *(sinval+a+start) * (vx[1] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[1] * (float)(-a+31)/(float)tot); - vec[2]= cent[2] + *(sinval+a+start) * (vx[2] * (float)(-a+31)/(float)tot) + *(cosval+a+start) * (vy[2] * (float)(-a+31)/(float)tot); - glVertex3fv(vec); - glEnd(); - } - } -} - -/* draws a circle on x-z plane given the scaling of the circle, assuming that - * all required matrices have been set (used for drawing empties) - */ -static void drawcircle_size(float size) -{ - float x, y; - short degrees; - - glBegin(GL_LINE_LOOP); - - /* coordinates are: cos(degrees*11.25)=x, sin(degrees*11.25)=y, 0.0f=z */ - for (degrees=0; degrees<32; degrees++) { - x= *(cosval + degrees); - y= *(sinval + degrees); - - glVertex3f(x*size, 0.0f, y*size); - } - - glEnd(); - -} - -void drawcircball(int mode, float *cent, float rad, float tmat[][4]) -{ - float vec[3], vx[3], vy[3]; - int a, tot=32; - - VECCOPY(vx, tmat[0]); - VECCOPY(vy, tmat[1]); - VecMulf(vx, rad); - VecMulf(vy, rad); - - glBegin(mode); - for(a=0; aobject; - MetaBall *mb; - MetaElem *ml; - float imat[4][4], tmat[4][4]; - int code= 1; - - mb= ob->data; - - if(ob==G.obedit) { - BIF_ThemeColor(TH_WIRE); - if((G.f & G_PICKSEL)==0 ) drawDispList(base, dt); - ml= editelems.first; - } - else { - if((base->flag & OB_FROMDUPLI)==0) - drawDispList(base, dt); - ml= mb->elems.first; - } - - if(ml==NULL) return 1; - - /* in case solid draw, reset wire colors */ - if(ob!=G.obedit && (ob->flag & SELECT)) { - if(ob==OBACT) BIF_ThemeColor(TH_ACTIVE); - else BIF_ThemeColor(TH_SELECT); - } - else BIF_ThemeColor(TH_WIRE); - - mygetmatrix(tmat); - Mat4Invert(imat, tmat); - Normalize(imat[0]); - Normalize(imat[1]); - - while(ml) { - - /* draw radius */ - if(ob==G.obedit) { - if((ml->flag & SELECT) && (ml->flag & MB_SCALE_RAD)) cpack(0xA0A0F0); - else cpack(0x3030A0); - - if(G.f & G_PICKSEL) { - ml->selcol1= code; - glLoadName(code++); - } - } - drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad, imat); - - /* draw stiffness */ - if(ob==G.obedit) { - if((ml->flag & SELECT) && !(ml->flag & MB_SCALE_RAD)) cpack(0xA0F0A0); - else cpack(0x30A030); - - if(G.f & G_PICKSEL) { - ml->selcol2= code; - glLoadName(code++); - } - drawcircball(GL_LINE_LOOP, &(ml->x), ml->rad*atan(ml->s)/M_PI_2, imat); - } - - ml= ml->next; - } - return 0; -} - -static void draw_forcefield(Object *ob) -{ - PartDeflect *pd= ob->pd; - float imat[4][4], tmat[4][4]; - float vec[3]= {0.0, 0.0, 0.0}; - int curcol; - float size; - - if(ob!=G.obedit && (ob->flag & SELECT)) { - if(ob==OBACT) curcol= TH_ACTIVE; - else curcol= TH_SELECT; - } - else curcol= TH_WIRE; - - /* scale size of circle etc with the empty drawsize */ - if (ob->type == OB_EMPTY) size = ob->empty_drawsize; - else size = 1.0; - - /* calculus here, is reused in PFIELD_FORCE */ - mygetmatrix(tmat); - Mat4Invert(imat, tmat); -// Normalize(imat[0]); // we don't do this because field doesnt scale either... apart from wind! -// Normalize(imat[1]); - - if (pd->forcefield == PFIELD_WIND) { - float force_val; - - Mat4One(tmat); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.5); - - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra); - else - force_val = pd->f_strength; - force_val*= 0.1; - drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 0.5*force_val; - drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 1.0*force_val; - drawcircball(GL_LINE_LOOP, vec, size, tmat); - vec[2]= 1.5*force_val; - drawcircball(GL_LINE_LOOP, vec, size, tmat); - - } - else if (pd->forcefield == PFIELD_FORCE) { - float ffall_val; - - if (has_ipo_code(ob->ipo, OB_PD_FFALL)) - ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, G.scene->r.cfra); - else - ffall_val = pd->f_power; - - BIF_ThemeColorBlend(curcol, TH_BACK, 0.5); - drawcircball(GL_LINE_LOOP, vec, size, imat); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(1.5, (double)ffall_val)); - drawcircball(GL_LINE_LOOP, vec, size*1.5, imat); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.9 - 0.4 / pow(2.0, (double)ffall_val)); - drawcircball(GL_LINE_LOOP, vec, size*2.0, imat); - } - else if (pd->forcefield == PFIELD_VORTEX) { - float ffall_val, force_val; - - Mat4One(tmat); - if (has_ipo_code(ob->ipo, OB_PD_FFALL)) - ffall_val = IPO_GetFloatValue(ob->ipo, OB_PD_FFALL, G.scene->r.cfra); - else - ffall_val = pd->f_power; - - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - force_val = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra); - else - force_val = pd->f_strength; - - BIF_ThemeColorBlend(curcol, TH_BACK, 0.7); - if (force_val < 0) { - drawspiral(vec, size*1.0, tmat, 1); - drawspiral(vec, size*1.0, tmat, 16); - } - else { - drawspiral(vec, size*1.0, tmat, -1); - drawspiral(vec, size*1.0, tmat, -16); - } - } - else if (pd->forcefield == PFIELD_GUIDE && ob->type==OB_CURVE) { - Curve *cu= ob->data; - if((cu->flag & CU_PATH) && cu->path && cu->path->data) { - float mindist, guidevec1[4], guidevec2[3]; - - if (has_ipo_code(ob->ipo, OB_PD_FSTR)) - mindist = IPO_GetFloatValue(ob->ipo, OB_PD_FSTR, G.scene->r.cfra); - else - mindist = pd->f_strength; - - /*path end*/ - setlinestyle(3); - where_on_path(ob, 1.0f, guidevec1, guidevec2); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.5); - drawcircball(GL_LINE_LOOP, guidevec1, mindist, imat); - - /*path beginning*/ - setlinestyle(0); - where_on_path(ob, 0.0f, guidevec1, guidevec2); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.5); - drawcircball(GL_LINE_LOOP, guidevec1, mindist, imat); - - VECCOPY(vec, guidevec1); /* max center */ - } - } - - setlinestyle(3); - BIF_ThemeColorBlend(curcol, TH_BACK, 0.5); - - if(pd->falloff==PFIELD_FALL_SPHERE){ - /* as last, guide curve alters it */ - if(pd->flag & PFIELD_USEMAX) - drawcircball(GL_LINE_LOOP, vec, pd->maxdist, imat); - - if(pd->flag & PFIELD_USEMIN) - drawcircball(GL_LINE_LOOP, vec, pd->mindist, imat); - } - else if(pd->falloff==PFIELD_FALL_TUBE){ - float radius,distance; - - Mat4One(tmat); - - vec[0]=vec[1]=0.0f; - radius=(pd->flag&PFIELD_USEMAXR)?pd->maxrad:1.0f; - distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f; - vec[2]=distance; - distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance; - - if(pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR)) - drawtube(vec,radius,distance,tmat); - - radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f; - distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f; - vec[2]=distance; - distance=(pd->flag&PFIELD_POSZ)?-distance:-2.0f*distance; - - if(pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR)) - drawtube(vec,radius,distance,tmat); - } - else if(pd->falloff==PFIELD_FALL_CONE){ - float radius,distance; - - Mat4One(tmat); - - radius=(pd->flag&PFIELD_USEMAXR)?pd->maxrad:1.0f; - radius*=(float)M_PI/180.0f; - distance=(pd->flag&PFIELD_USEMAX)?pd->maxdist:0.0f; - - if(pd->flag & (PFIELD_USEMAX|PFIELD_USEMAXR)){ - drawcone(vec,distance*sin(radius),distance*cos(radius),tmat); - if((pd->flag & PFIELD_POSZ)==0) - drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat); - } - - radius=(pd->flag&PFIELD_USEMINR)?pd->minrad:1.0f; - radius*=(float)M_PI/180.0f; - distance=(pd->flag&PFIELD_USEMIN)?pd->mindist:0.0f; - - if(pd->flag & (PFIELD_USEMIN|PFIELD_USEMINR)){ - drawcone(vec,distance*sin(radius),distance*cos(radius),tmat); - if((pd->flag & PFIELD_POSZ)==0) - drawcone(vec,distance*sin(radius),-distance*cos(radius),tmat); - } - } - setlinestyle(0); -} - -static void draw_box(float vec[8][3]) -{ - glBegin(GL_LINE_STRIP); - glVertex3fv(vec[0]); glVertex3fv(vec[1]);glVertex3fv(vec[2]); glVertex3fv(vec[3]); - glVertex3fv(vec[0]); glVertex3fv(vec[4]);glVertex3fv(vec[5]); glVertex3fv(vec[6]); - glVertex3fv(vec[7]); glVertex3fv(vec[4]); - glEnd(); - - glBegin(GL_LINES); - glVertex3fv(vec[1]); glVertex3fv(vec[5]); - glVertex3fv(vec[2]); glVertex3fv(vec[6]); - glVertex3fv(vec[3]); glVertex3fv(vec[7]); - glEnd(); -} - -/* uses boundbox, function used by Ketsji */ -void get_local_bounds(Object *ob, float *center, float *size) -{ - BoundBox *bb= object_get_boundbox(ob); - - if(bb==NULL) { - center[0]= center[1]= center[2]= 0.0; - VECCOPY(size, ob->size); - } - else { - size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]); - size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]); - size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]); - - center[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0; - center[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0; - center[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0; - } -} - - - -static void draw_bb_quadric(BoundBox *bb, short type) -{ - float size[3], cent[3]; - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - - size[0]= 0.5*fabs(bb->vec[0][0] - bb->vec[4][0]); - size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]); - size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]); - - cent[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0; - cent[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0; - cent[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0; - - glPushMatrix(); - if(type==OB_BOUND_SPHERE) { - glTranslatef(cent[0], cent[1], cent[2]); - glScalef(size[0], size[1], size[2]); - gluSphere(qobj, 1.0, 8, 5); - } - else if(type==OB_BOUND_CYLINDER) { - float radius = size[0] > size[1] ? size[0] : size[1]; - glTranslatef(cent[0], cent[1], cent[2]-size[2]); - glScalef(radius, radius, 2.0*size[2]); - gluCylinder(qobj, 1.0, 1.0, 1.0, 8, 1); - } - else if(type==OB_BOUND_CONE) { - float radius = size[0] > size[1] ? size[0] : size[1]; - glTranslatef(cent[0], cent[2]-size[2], cent[1]); - glScalef(radius, 2.0*size[2], radius); - glRotatef(-90., 1.0, 0.0, 0.0); - gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1); - } - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - -static void draw_bounding_volume(Object *ob) -{ - BoundBox *bb=0; - - if(ob->type==OB_MESH) { - bb= mesh_get_bb(ob); - } - else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) { - bb= ( (Curve *)ob->data )->bb; - } - else if(ob->type==OB_MBALL) { - bb= ob->bb; - if(bb==0) { - makeDispListMBall(ob); - bb= ob->bb; - } - } - else { - drawcube(); - return; - } - - if(bb==0) return; - - if(ob->boundtype==OB_BOUND_BOX) draw_box(bb->vec); - else draw_bb_quadric(bb, ob->boundtype); - -} - -static void drawtexspace(Object *ob) -{ - float vec[8][3], loc[3], size[3]; - - if(ob->type==OB_MESH) { - mesh_get_texspace(ob->data, loc, NULL, size); - } - else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) { - Curve *cu= ob->data; - VECCOPY(size, cu->size); - VECCOPY(loc, cu->loc); - } - else if(ob->type==OB_MBALL) { - MetaBall *mb= ob->data; - VECCOPY(size, mb->size); - VECCOPY(loc, mb->loc); - } - else return; - - vec[0][0]=vec[1][0]=vec[2][0]=vec[3][0]= loc[0]-size[0]; - vec[4][0]=vec[5][0]=vec[6][0]=vec[7][0]= loc[0]+size[0]; - - vec[0][1]=vec[1][1]=vec[4][1]=vec[5][1]= loc[1]-size[1]; - vec[2][1]=vec[3][1]=vec[6][1]=vec[7][1]= loc[1]+size[1]; - - vec[0][2]=vec[3][2]=vec[4][2]=vec[7][2]= loc[2]-size[2]; - vec[1][2]=vec[2][2]=vec[5][2]=vec[6][2]= loc[2]+size[2]; - - setlinestyle(2); - - draw_box(vec); - - setlinestyle(0); -} - -/* draws wire outline */ -static void drawSolidSelect(Base *base) -{ - Object *ob= base->object; - - glLineWidth(2.0); - glDepthMask(0); - - if(ELEM3(ob->type, OB_FONT,OB_CURVE, OB_SURF)) { - Curve *cu = ob->data; - if (displist_has_faces(&cu->disp) && boundbox_clip(ob->obmat, cu->bb)) { - draw_index_wire= 0; - drawDispListwire(&cu->disp); - draw_index_wire= 1; - } - } else if (ob->type==OB_MBALL) { - if((base->flag & OB_FROMDUPLI)==0) - drawDispListwire(&ob->disp); - } - else if(ob->type==OB_ARMATURE) { - if(!(ob->flag & OB_POSEMODE)) { - draw_armature(base, OB_WIRE); - } - } - - glLineWidth(1.0); - glDepthMask(1); -} - -static void drawWireExtra(Object *ob) -{ - if(ob!=G.obedit && (ob->flag & SELECT)) { - if(ob==OBACT) { - if(ob->flag & OB_FROMGROUP) BIF_ThemeColor(TH_GROUP_ACTIVE); - else BIF_ThemeColor(TH_ACTIVE); - } - else if(ob->flag & OB_FROMGROUP) - BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16); - else - BIF_ThemeColor(TH_SELECT); - } - else { - if(ob->flag & OB_FROMGROUP) - BIF_ThemeColor(TH_GROUP); - else { - if(ob->dtx & OB_DRAWWIRE) { - glColor3ub(80,80,80); - } else { - BIF_ThemeColor(TH_WIRE); - } - } - } - - bglPolygonOffset(1.0); - glDepthMask(0); // disable write in zbuffer, selected edge wires show better - - if (ELEM3(ob->type, OB_FONT, OB_CURVE, OB_SURF)) { - Curve *cu = ob->data; - if (boundbox_clip(ob->obmat, cu->bb)) { - if (ob->type==OB_CURVE) - draw_index_wire= 0; - drawDispListwire(&cu->disp); - if (ob->type==OB_CURVE) - draw_index_wire= 1; - } - } else if (ob->type==OB_MBALL) { - drawDispListwire(&ob->disp); - } - - glDepthMask(1); - bglPolygonOffset(0.0); -} - -/* should be called in view space */ -static void draw_hooks(Object *ob) -{ - ModifierData *md; - float vec[3]; - - for (md=ob->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - HookModifierData *hmd = (HookModifierData*) md; - - VecMat4MulVecfl(vec, ob->obmat, hmd->cent); - - if(hmd->object) { - setlinestyle(3); - glBegin(GL_LINES); - glVertex3fv(hmd->object->obmat[3]); - glVertex3fv(vec); - glEnd(); - setlinestyle(0); - } - - glPointSize(3.0); - bglBegin(GL_POINTS); - bglVertex3fv(vec); - bglEnd(); - glPointSize(1.0); - } - } -} - - -// -void drawRBpivot(bRigidBodyJointConstraint *data){ - float radsPerDeg = 6.283185307179586232f / 360.f; - int axis; - float v1[3]= {data->pivX, data->pivY, data->pivZ}; - float eu[3]= {radsPerDeg*data->axX, radsPerDeg*data->axY, radsPerDeg*data->axZ}; - - - - float mat[4][4]; - EulToMat4(eu,mat); - glLineWidth (4.0f); - setlinestyle(2); - for (axis=0; axis<3; axis++) { - float dir[3] = {0,0,0}; - float v[3]= {data->pivX, data->pivY, data->pivZ}; - - dir[axis] = 1.f; - glBegin(GL_LINES); - Mat4MulVecfl(mat,dir); - v[0] += dir[0]; - v[1] += dir[1]; - v[2] += dir[2]; - glVertex3fv(v1); - glVertex3fv(v); - glEnd(); - glRasterPos3fv(v); - if (axis==0) - BMF_DrawString(G.font, "px"); - else if (axis==1) - BMF_DrawString(G.font, "py"); - else - BMF_DrawString(G.font, "pz"); - } - glLineWidth (1.0f); - setlinestyle(0); -} - -/* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR */ -void draw_object(Base *base, int flag) -{ - static int warning_recursive= 0; - Object *ob; - Curve *cu; - float cfraont; - float vec1[3], vec2[3]; - unsigned int col=0; - int sel, drawtype, colindex= 0, ipoflag; - int i, selstart, selend, empty_object=0; - short dt, dtx, zbufoff= 0; - - /* only once set now, will be removed too, should become a global standard */ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - ob= base->object; - - if (ob!=G.obedit) { - if (ob->restrictflag & OB_RESTRICT_VIEW) - return; - } - - /* xray delay? */ - if((flag & DRAW_PICKING)==0 && (base->flag & OB_FROMDUPLI)==0) { - /* don't do xray in particle mode, need the z-buffer */ - if(!(G.f & G_PARTICLEEDIT)) { - /* xray and transp are set when it is drawing the 2nd/3rd pass */ - if(!G.vd->xray && !G.vd->transp && (ob->dtx & OB_DRAWXRAY)) { - add_view3d_after(G.vd, base, V3D_XRAY); - return; - } - } - } - - /* draw keys? */ - if(base==(G.scene->basact) || (base->flag & (SELECT+BA_WAS_SEL))) { - if(flag==0 && warning_recursive==0 && ob!=G.obedit) { - if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { - ListBase elems; - CfraElem *ce; - float temp[7][3]; - - warning_recursive= 1; - - elems.first= elems.last= 0; - make_cfra_list(ob->ipo, &elems); - - cfraont= (G.scene->r.cfra); - drawtype= G.vd->drawtype; - if(drawtype>OB_WIRE) G.vd->drawtype= OB_WIRE; - sel= base->flag; - memcpy(temp, &ob->loc, 7*3*sizeof(float)); - - ipoflag= ob->ipoflag; - ob->ipoflag &= ~OB_OFFS_OB; - - set_no_parent_ipo(1); - disable_speed_curve(1); - - if ((ob->ipoflag & OB_DRAWKEYSEL)==0) { - ce= elems.first; - while(ce) { - if(!ce->sel) { - (G.scene->r.cfra)= ce->cfra/G.scene->r.framelen; - - base->flag= 0; - - where_is_object_time(ob, (G.scene->r.cfra)); - draw_object(base, 0); - } - ce= ce->next; - } - } - - ce= elems.first; - while(ce) { - if(ce->sel) { - (G.scene->r.cfra)= ce->cfra/G.scene->r.framelen; - - base->flag= SELECT; - - where_is_object_time(ob, (G.scene->r.cfra)); - draw_object(base, 0); - } - ce= ce->next; - } - - set_no_parent_ipo(0); - disable_speed_curve(0); - - base->flag= sel; - ob->ipoflag= ipoflag; - - /* restore icu->curval */ - (G.scene->r.cfra)= cfraont; - - memcpy(&ob->loc, temp, 7*3*sizeof(float)); - where_is_object(ob); - G.vd->drawtype= drawtype; - - BLI_freelistN(&elems); - - warning_recursive= 0; - } - } - } - - /* patch? children objects with a timeoffs change the parents. How to solve! */ - /* if( ((int)ob->ctime) != F_(G.scene->r.cfra)) where_is_object(ob); */ - - mymultmatrix(ob->obmat); - - /* which wire color */ - if((flag & DRAW_CONSTCOLOR) == 0) { - project_short(ob->obmat[3], &base->sx); - - if((G.moving & G_TRANSFORM_OBJ) && (base->flag & (SELECT+BA_WAS_SEL))) BIF_ThemeColor(TH_TRANSFORM); - else { - - if(ob->type==OB_LAMP) BIF_ThemeColor(TH_LAMP); - else BIF_ThemeColor(TH_WIRE); - - if((G.scene->basact)==base) { - if(base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_ACTIVE); - } - else { - if(base->flag & (SELECT+BA_WAS_SEL)) BIF_ThemeColor(TH_SELECT); - } - - // no theme yet - if(ob->id.lib) { - if(base->flag & (SELECT+BA_WAS_SEL)) colindex = 4; - else colindex = 3; - } - else if(warning_recursive==1) { - if(base->flag & (SELECT+BA_WAS_SEL)) { - if(G.scene->basact==base) colindex = 8; - else colindex= 7; - } - else colindex = 6; - } - else if(ob->flag & OB_FROMGROUP) { - if(base->flag & (SELECT+BA_WAS_SEL)) { - if(G.scene->basact==base) BIF_ThemeColor(TH_GROUP_ACTIVE); - else BIF_ThemeColorShade(TH_GROUP_ACTIVE, -16); - } - else BIF_ThemeColor(TH_GROUP); - colindex= 0; - } - - } - - if(colindex) { - col= colortab[colindex]; - cpack(col); - } - } - - /* maximum drawtype */ - dt= MIN2(G.vd->drawtype, ob->dt); - if(G.vd->zbuf==0 && dt>OB_WIRE) dt= OB_WIRE; - dtx= 0; - - /* faceselect exception: also draw solid when dt==wire, except in editmode */ - if(ob==OBACT && (G.f & (G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT))) { - if(ob->type==OB_MESH) { - - if(ob==G.obedit); - else { - dt= OB_SHADED; - - glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - if(dt=OB_BOUNDBOX ) { - - dtx= ob->dtx; - if(G.obedit==ob) { - // the only 2 extra drawtypes alowed in editmode - dtx= dtx & (OB_DRAWWIRE|OB_TEXSPACE); - } - - if(G.f & G_DRAW_EXT) { - if(ob->type==OB_EMPTY || ob->type==OB_CAMERA || ob->type==OB_LAMP) dt= OB_WIRE; - } - } - - /* draw outline for selected solid objects, mesh does itself */ - if((G.vd->flag & V3D_SELECT_OUTLINE) && ob->type!=OB_MESH) { - if(dt>OB_WIRE && dtdtx&OB_DRAWWIRE) && (ob->flag&SELECT) && !(flag&DRAW_PICKING)) { - drawSolidSelect(base); - } - } - } - - switch( ob->type) { - case OB_MESH: - if (!(base->flag&OB_RADIO)) { - empty_object= draw_mesh_object(base, dt, flag); - if(flag!=DRAW_CONSTCOLOR) dtx &= ~OB_DRAWWIRE; // mesh draws wire itself - - if(G.obedit!=ob && warning_recursive==0) { - PartEff *paf = give_parteff(ob); - - if(paf) { - if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */ - if(paf->flag & PAF_STATIC) draw_static_particle_system(ob, paf, dt); - else if((flag & DRAW_PICKING) == 0) draw_particle_system(base, paf); // selection errors happen to easy - if(col) cpack(col); - } - } - } - - break; - case OB_FONT: - cu= ob->data; - if (cu->disp.first==NULL) makeDispListCurveTypes(ob, 0); - if(ob==G.obedit) { - tekentextcurs(); - - if (cu->flag & CU_FAST) { - cpack(0xFFFFFF); - set_inverted_drawing(1); - drawDispList(base, OB_WIRE); - set_inverted_drawing(0); - } else { - drawDispList(base, dt); - } - - if (cu->linewidth != 0.0) { - cpack(0xff44ff); - BIF_ThemeColor(TH_WIRE); - VECCOPY(vec1, ob->orig); - VECCOPY(vec2, ob->orig); - vec1[0] += cu->linewidth; - vec2[0] += cu->linewidth; - vec1[1] += cu->linedist * cu->fsize; - vec2[1] -= cu->lines * cu->linedist * cu->fsize; - setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2fv(vec1); - glVertex2fv(vec2); - glEnd(); - setlinestyle(0); - } - - setlinestyle(3); - for (i=0; itotbox; i++) { - if (cu->tb[i].w != 0.0) { - if (i == (cu->actbox-1)) - BIF_ThemeColor(TH_ACTIVE); - else - BIF_ThemeColor(TH_WIRE); - vec1[0] = cu->tb[i].x; - vec1[1] = cu->tb[i].y + cu->fsize; - vec1[2] = 0.001; - glBegin(GL_LINE_STRIP); - glVertex3fv(vec1); - vec1[0] += cu->tb[i].w; - glVertex3fv(vec1); - vec1[1] -= cu->tb[i].h; - glVertex3fv(vec1); - vec1[0] -= cu->tb[i].w; - glVertex3fv(vec1); - vec1[1] += cu->tb[i].h; - glVertex3fv(vec1); - glEnd(); - } - } - setlinestyle(0); - - - if (getselection(&selstart, &selend) && selboxes) { - float selboxw; - - cpack(0xffffff); - set_inverted_drawing(1); - for (i=0; i<(selend-selstart+1); i++) { - SelBox *sb = &(selboxes[i]); - - if (i<(selend-selstart)) { - if (selboxes[i+1].y == sb->y) - selboxw= selboxes[i+1].x - sb->x; - else - selboxw= sb->w; - } - else { - selboxw= sb->w; - } - glBegin(GL_QUADS); - glVertex3f(sb->x, sb->y, 0.001); - glVertex3f(sb->x+selboxw, sb->y, 0.001); - glVertex3f(sb->x+selboxw, sb->y+sb->h, 0.001); - glVertex3f(sb->x, sb->y+sb->h, 0.001); - glEnd(); - } - set_inverted_drawing(0); - } - } - else if(dt==OB_BOUNDBOX) - draw_bounding_volume(ob); - else if(boundbox_clip(ob->obmat, cu->bb)) - empty_object= drawDispList(base, dt); - - break; - case OB_CURVE: - case OB_SURF: - cu= ob->data; - /* still needed for curves hidden in other layers. depgraph doesnt handle that yet */ - if (cu->disp.first==NULL) makeDispListCurveTypes(ob, 0); - - if(ob==G.obedit) { - drawnurb(base, editNurb.first, dt); - } - else if(dt==OB_BOUNDBOX) - draw_bounding_volume(ob); - else if(boundbox_clip(ob->obmat, cu->bb)) { - empty_object= drawDispList(base, dt); - - if(cu->path) - curve_draw_speed(ob); - } - break; - case OB_MBALL: - if(ob==G.obedit) - drawmball(base, dt); - else if(dt==OB_BOUNDBOX) - draw_bounding_volume(ob); - else - empty_object= drawmball(base, dt); - break; - case OB_EMPTY: - drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype); - break; - case OB_LAMP: - drawlamp(ob); - if(dtx || (base->flag & SELECT)) mymultmatrix(ob->obmat); - break; - case OB_CAMERA: - drawcamera(ob, flag); - break; - case OB_LATTICE: - drawlattice(ob); - break; - case OB_ARMATURE: - if(dt>OB_WIRE) set_gl_material(0); // we use defmaterial - empty_object= draw_armature(base, dt); - break; - default: - drawaxes(1.0, flag, OB_ARROWS); - } - if(ob->pd && ob->pd->forcefield) draw_forcefield(ob); - - /* code for new particle system */ - if(warning_recursive==0 && (flag & DRAW_PICKING)==0 && ob!=G.obedit){ - glDepthMask(GL_FALSE); - if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */ - if(ob->particlesystem.first) { - ParticleSystem *psys; - - for(psys=ob->particlesystem.first; psys; psys=psys->next) - draw_new_particle_system(base, psys); - - if(G.f & G_PARTICLEEDIT && ob==OBACT) { - psys= PE_get_current(ob); - if(psys && !G.obedit && psys_in_edit_mode(psys)) - draw_particle_edit(ob, psys); - } - } - if(col) cpack(col); - glDepthMask(GL_TRUE); - } - - { - bConstraint *con; - for(con=ob->constraints.first; con; con= con->next) - { - if(con->type==CONSTRAINT_TYPE_RIGIDBODYJOINT) - { - bRigidBodyJointConstraint *data = (bRigidBodyJointConstraint*)con->data; - if(data->flag&CONSTRAINT_DRAW_PIVOT) - drawRBpivot(data); - } - } - } - - /* draw extra: after normal draw because of makeDispList */ - if(dtx) { - if(G.f & G_SIMULATION); - else if(dtx & OB_AXIS) { - drawaxes(1.0f, flag, OB_ARROWS); - } - if(dtx & OB_BOUNDBOX) draw_bounding_volume(ob); - if(dtx & OB_TEXSPACE) drawtexspace(ob); - if(dtx & OB_DRAWNAME) { - /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */ - /* but, we also dont draw names for sets or duplicators */ - if(flag == 0) { - glRasterPos3f(0.0, 0.0, 0.0); - - BMF_DrawString(G.font, " "); - BMF_DrawString(G.font, ob->id.name+2); - } - } - /*if(dtx & OB_DRAWIMAGE) drawDispListwire(&ob->disp);*/ - if((dtx & OB_DRAWWIRE) && dt>=OB_SOLID) drawWireExtra(ob); - } - - if(dtgameflag & OB_ACTOR) && (ob->gameflag & OB_DYNAMIC)) { - float tmat[4][4], imat[4][4], vec[3]; - - vec[0]= vec[1]= vec[2]= 0.0; - mygetmatrix(tmat); - Mat4Invert(imat, tmat); - - setlinestyle(2); - drawcircball(GL_LINE_LOOP, vec, ob->inertia, imat); - setlinestyle(0); - } - } - - myloadmatrix(G.vd->viewmat); - - if(zbufoff) glDisable(GL_DEPTH_TEST); - - if(warning_recursive) return; - if(base->flag & (OB_FROMDUPLI|OB_RADIO)) return; - if(G.f & G_SIMULATION) return; - - /* object centers, need to be drawn in viewmat space for speed, but OK for picking select */ - if(ob!=OBACT || (G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) { - int do_draw_center= -1; /* defines below are zero or positive... */ - - if((G.scene->basact)==base) - do_draw_center= ACTIVE; - else if(base->flag & SELECT) - do_draw_center= SELECT; - else if(empty_object || (G.vd->flag & V3D_DRAW_CENTERS)) - do_draw_center= DESELECT; - - if(do_draw_center != -1) { - if(flag & DRAW_PICKING) { - /* draw a single point for opengl selection */ - glBegin(GL_POINTS); - glVertex3fv(ob->obmat[3]); - glEnd(); - } - else if((flag & DRAW_CONSTCOLOR)==0) { - /* we don't draw centers for duplicators and sets */ -#ifdef WITH_VERSE - if(ob->vnode) - drawcentercircle(ob->obmat[3], VERSE, 1); - else -#endif - drawcentercircle(ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us>1); - } - } - } - - /* not for sets, duplicators or picking */ - if(flag==0 && (!(G.vd->flag & V3D_HIDE_HELPLINES))) { - ListBase *list; - - /* draw hook center and offset line */ - if(ob!=G.obedit) draw_hooks(ob); - - /* help lines and so */ - if(ob!=G.obedit && ob->parent && (ob->parent->lay & G.vd->lay)) { - setlinestyle(3); - glBegin(GL_LINES); - glVertex3fv(ob->obmat[3]); - glVertex3fv(ob->orig); - glEnd(); - setlinestyle(0); - } - - /* Drawing the constraint lines */ - list = &ob->constraints; - if (list) { - bConstraint *curcon; - bConstraintOb *cob; - char col[4], col2[4]; - - BIF_GetThemeColor3ubv(TH_GRID, col); - make_axis_color(col, col2, 'z'); - glColor3ubv((GLubyte *)col2); - - cob= constraints_make_evalob(ob, NULL, CONSTRAINT_OBTYPE_OBJECT); - - for (curcon = list->first; curcon; curcon=curcon->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - if ((curcon->flag & CONSTRAINT_EXPAND) && (cti) && (cti->get_constraint_targets)) { - cti->get_constraint_targets(curcon, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - /* calculate target's matrix */ - if (cti->get_target_matrix) - cti->get_target_matrix(curcon, cob, ct, bsystem_time(ob, (float)(G.scene->r.cfra), ob->sf)); - else - Mat4One(ct->matrix); - - setlinestyle(3); - glBegin(GL_LINES); - glVertex3fv(ct->matrix[3]); - glVertex3fv(ob->obmat[3]); - glEnd(); - setlinestyle(0); - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(curcon, &targets, 1); - } - } - - constraints_clear_evalob(cob); - } - } - - free_old_images(); -} - -void draw_object_ext(Base *base) -{ - - if(G.vd==NULL || base==NULL) return; - - if(G.vd->drawtype > OB_WIRE) { - G.vd->zbuf= 1; - glEnable(GL_DEPTH_TEST); - } - - G.f |= G_DRAW_EXT; - - glDrawBuffer(GL_FRONT); - persp(PERSP_VIEW); - - if(G.vd->flag & V3D_CLIPPING) - view3d_set_clipping(G.vd); - - draw_object(base, 0); - - if(G.vd->flag & V3D_CLIPPING) - view3d_clr_clipping(); - - G.f &= ~G_DRAW_EXT; - - bglFlush(); /* reveil frontbuffer drawing */ - glDrawBuffer(GL_BACK); - - if(G.vd->zbuf) { - G.vd->zbuf= 0; - glDisable(GL_DEPTH_TEST); - } - curarea->win_swap= WIN_FRONT_OK; -} - -/* ***************** BACKBUF SEL (BBS) ********* */ - -static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) -{ - int offset = (long) userData; - EditVert *eve = EM_get_vert_for_index(index); - - if (eve->h==0) { - set_framebuffer_index_color(offset+index); - bglVertex3fv(co); - } -} -static int bbs_mesh_verts(DerivedMesh *dm, int offset) -{ - glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) ); - bglBegin(GL_POINTS); - dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(long) offset); - bglEnd(); - glPointSize(1.0); - - return offset + G.totvert; -} - -static int bbs_mesh_wire__setDrawOptions(void *userData, int index) -{ - int offset = (long) userData; - EditEdge *eed = EM_get_edge_for_index(index); - - if (eed->h==0) { - set_framebuffer_index_color(offset+index); - return 1; - } else { - return 0; - } -} -static int bbs_mesh_wire(DerivedMesh *dm, int offset) -{ - dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(long) offset); - - return offset + G.totedge; -} - -static int bbs_mesh_solid__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) -{ - if (EM_get_face_for_index(index)->h==0) { - if (userData) { - set_framebuffer_index_color(index+1); - } - return 1; - } else { - return 0; - } -} - -static void bbs_mesh_solid__drawCenter(void *userData, int index, float *cent, float *no) -{ - EditFace *efa = EM_get_face_for_index(index); - - if (efa->h==0 && efa->fgonf!=EM_FGON) { - set_framebuffer_index_color(index+1); - - bglVertex3fv(cent); - } -} - -/* two options, facecolors or black */ -static int bbs_mesh_solid_EM(DerivedMesh *dm, int facecol) -{ - cpack(0); - - if (facecol) { - dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(long) 1, 0); - - if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) { - glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE)); - - bglBegin(GL_POINTS); - dm->foreachMappedFaceCenter(dm, bbs_mesh_solid__drawCenter, NULL); - bglEnd(); - } - - return 1+G.totface; - } else { - dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*) 0, 0); - return 1; - } -} - -static int bbs_mesh_solid__setDrawOpts(void *userData, int index, int *drawSmooth_r) -{ - Mesh *me = userData; - - if (!(me->mface[index].flag&ME_HIDE)) { - set_framebuffer_index_color(index+1); - return 1; - } else { - return 0; - } -} - -static int bbs_mesh_wire__setDrawOpts(void *userData, int index) -{ - struct { Mesh *me; EdgeHash *eh; int offset; } *data = userData; - MEdge *med = data->me->medge + index; - unsigned long flags = (long)BLI_edgehash_lookup(data->eh, med->v1, med->v2); - - if (flags & 1) { - set_framebuffer_index_color(data->offset+index); - return 1; - } else - return 0; -} - -/* TODO remove this - since face select mode now only works with painting */ -static void bbs_mesh_solid(Object *ob) -{ - DerivedMesh *dm = mesh_get_derived_final(ob, get_viewedit_datamask()); - Mesh *me = (Mesh*)ob->data; - - glColor3ub(0, 0, 0); - dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, me, 0); - - /* draw edges for seam marking in faceselect mode, but not when painting, - so that painting doesn't get interrupted on an edge */ - if ((G.f & G_FACESELECT) && !(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))) { - struct { Mesh *me; EdgeHash *eh; int offset; } userData; - - userData.me = me; - userData.eh = get_tface_mesh_marked_edge_info(me); - userData.offset = userData.me->totface+1; - - bglPolygonOffset(1.0); - dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOpts, (void*)&userData); - bglPolygonOffset(0.0); - - BLI_edgehash_free(userData.eh, NULL); - } - - dm->release(dm); -} - -void draw_object_backbufsel(Object *ob) -{ - - mymultmatrix(ob->obmat); - - glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT); - glEnable(GL_DEPTH_TEST); - - switch( ob->type) { - case OB_MESH: - if(ob==G.obedit) { - DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); - - EM_init_index_arrays(1, 1, 1); - - em_solidoffs= bbs_mesh_solid_EM(dm, G.scene->selectmode & SCE_SELECT_FACE); - - bglPolygonOffset(1.0); - - // we draw edges always, for loop (select) tools - em_wireoffs= bbs_mesh_wire(dm, em_solidoffs); - - // we draw verts if vert select mode or if in transform (for snap). - if(G.scene->selectmode & SCE_SELECT_VERTEX || G.moving & G_TRANSFORM_EDIT) - em_vertoffs= bbs_mesh_verts(dm, em_wireoffs); - else em_vertoffs= em_wireoffs; - - bglPolygonOffset(0.0); - - dm->release(dm); - - EM_free_index_arrays(); - } - else bbs_mesh_solid(ob); - - break; - case OB_CURVE: - case OB_SURF: - break; - } - - myloadmatrix(G.vd->viewmat); -} - - -/* ************* draw object instances for bones, for example ****************** */ -/* assumes all matrices/etc set OK */ - -/* helper function for drawing object instances - meshes */ -static void draw_object_mesh_instance(Object *ob, int dt, int outline) -{ - DerivedMesh *dm=NULL, *edm=NULL; - - if(G.obedit && ob->data==G.obedit->data) - edm= editmesh_get_derived_base(); - else - dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); - - if(dt<=OB_WIRE) { - if(dm) - dm->drawEdges(dm, 1); - else if(edm) - edm->drawEdges(edm, 1); - } - else { - if(outline) - draw_mesh_object_outline(ob, dm?dm:edm); - - if(dm) - init_gl_materials(ob, 0); - else { - glEnable(GL_COLOR_MATERIAL); - BIF_ThemeColor(TH_BONE_SOLID); - glDisable(GL_COLOR_MATERIAL); - } - - glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0); - glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW); - glEnable(GL_LIGHTING); - - if(dm) - dm->drawFacesSolid(dm, set_gl_material); - else if(edm) - edm->drawMappedFaces(edm, NULL, NULL, 0); - - glDisable(GL_LIGHTING); - } - - if(edm) edm->release(edm); - if(dm) dm->release(dm); -} - -void draw_object_instance(Object *ob, int dt, int outline) -{ - if (ob == NULL) - return; - - switch (ob->type) { - case OB_MESH: - draw_object_mesh_instance(ob, dt, outline); - break; - case OB_EMPTY: - drawaxes(ob->empty_drawsize, 0, ob->empty_drawtype); - break; - } -} diff --git a/source/blender/src/drawoops.c b/source/blender/src/drawoops.c deleted file mode 100644 index ef32d2c7039..00000000000 --- a/source/blender/src/drawoops.c +++ /dev/null @@ -1,521 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_ID.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_language.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_outliner.h" -#include "BIF_resources.h" -#include "BIF_screen.h" - -/* #include "BIF_drawoops.h" bad name :(*/ -#include "BIF_oops.h" - -#include "BSE_drawipo.h" -#include "BSE_drawoops.h" - -float aspect; -void *font; - - -static float icon_width(); -float center_oops_text(char *str); - - -void boundbox_oops(short sel) -{ - Oops *oops; - float min[2], max[2]; - int ok= 0; - - if(G.soops==0) return; - - min[0]= 1000.0; - max[0]= -1000.0; - min[1]= 1000.0; - max[1]= -1000.0; - - oops= G.soops->oops.first; - while(oops) { - if ((oops->hide==0 && !sel) || (sel && oops->flag & SELECT )) { - ok= 1; - - min[0]= MIN2(min[0], oops->x); - max[0]= MAX2(max[0], oops->x+OOPSX); - min[1]= MIN2(min[1], oops->y); - max[1]= MAX2(max[1], oops->y+OOPSY); - } - oops= oops->next; - } - - if(ok==0) return; - - G.v2d->tot.xmin= min[0]; - G.v2d->tot.xmax= max[0]; - G.v2d->tot.ymin= min[1]; - G.v2d->tot.ymax= max[1]; - -} - -void give_oopslink_line(Oops *oops, OopsLink *ol, float *v1, float *v2) -{ - - if(ol->to && ol->to->hide==0) { - v1[0]= oops->x+ol->xof; - v1[1]= oops->y+ol->yof; - v2[0]= ol->to->x+OOPSX/2; - v2[1]= ol->to->y; - } - else if(ol->from && ol->from->hide==0) { - v1[0]= ol->from->x + ol->xof; - v1[1]= ol->from->y + ol->xof; - v2[0]= oops->x+OOPSX/2; - v2[1]= oops->y; - } -} - -void draw_oopslink(Oops *oops) -{ - OopsLink *ol; - float vec[4][3], dist, spline_step; - short curve_res; - - if(oops->type==ID_SCE || oops->type==ID_GR) { - if(oops->flag & SELECT) { - /* when using python Mesh to make meshes a file was saved - that had an oops with no ID, stops a segfault when looking for lib */ - if(oops->id && oops->id->lib) cpack(0x4080A0); - else cpack(0x808080); - } - else cpack(0x606060); - } - else { - if(oops->flag & SELECT) { - if(oops->id && oops->id->lib) cpack(0x11AAFF); - else cpack(0xFFFFFF); - } - else cpack(0x0); - } - - glEnable(GL_MAP1_VERTEX_3); - vec[0][2]= vec[1][2]= vec[2][2]= vec[3][2]= 0.0; /* only 2d spline, set the Z to 0*/ - - ol= oops->link.first; - while(ol) { - if(ol->to && ol->to->hide==0) { - - give_oopslink_line(oops, ol, vec[0], vec[3]); - - dist= 0.5*VecLenf(vec[0], vec[3]); - - /* check ol->xof and yof for direction */ - if(ol->xof == 0.0) { - vec[1][0]= vec[0][0]-dist; - vec[1][1]= vec[0][1]; - } - else if(ol->xof==OOPSX) { - vec[1][0]= vec[0][0]+dist; - vec[1][1]= vec[0][1]; - } - else { - vec[1][0]= vec[0][0]; - vec[1][1]= vec[0][1]+dist; - } - - /* v3 is always pointing down */ - vec[2][0]= vec[3][0]; - vec[2][1]= vec[3][1] - dist; - - if( MIN4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) > G.v2d->cur.xmax); /* clipped */ - else if ( MAX4(vec[0][0], vec[1][0], vec[2][0], vec[3][0]) < G.v2d->cur.xmin); /* clipped */ - else { - /* calculate a curve resolution to use based on the length of the curve.*/ - curve_res = MIN2(40, MAX2(2, 2*dist/aspect)); - - /* we can reuse the dist variable here to increment the GL curve eval amount*/ - dist = (float)1/curve_res; - spline_step = 0.0; - - glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]); - glBegin(GL_LINE_STRIP); - while (spline_step < 1.000001) { - glEvalCoord1f(spline_step); - spline_step += dist; - } - glEnd(); - } - - } - ol= ol->next; - } -} - -static float icon_width() -{ - /* change it in *one place* when you mess around */ - return 0.8*OOPSY; -} - -void draw_icon_oops(float *co, short type) -{ - BIFIconID icon; - float ofs; - - switch(type) { - default: return; - - case ID_OB: icon= ICON_OBJECT_HLT; break; - case ID_ME: icon= ICON_MESH_HLT; break; - case ID_CU: icon= ICON_CURVE_HLT; break; - case ID_MB: icon= ICON_MBALL_HLT; break; - case ID_LT: icon= ICON_LATTICE_HLT; break; - case ID_LA: icon= ICON_LAMP_HLT; break; - case ID_MA: icon= ICON_MATERIAL_HLT; break; - case ID_TE: icon= ICON_TEXTURE_HLT; break; - case ID_IP: icon= ICON_IPO_HLT; break; - case ID_LI: icon= ICON_LIBRARY_HLT; break; - case ID_IM: icon= ICON_IMAGE_HLT; break; - case ID_GR: icon= ICON_CIRCLE_DEHLT; break; - } - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* height of box is OOPSY...icon is centered vertically */ - ofs = (OOPSY - icon_width())/2.0; - BIF_icon_draw_aspect(co[0], co[1]+ofs, icon, icon_width()*aspect*ICON_DEFAULT_HEIGHT/OOPSY); - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); -} - -void mysbox(float x1, float y1, float x2, float y2) -{ - float vec[2]; - - glBegin(GL_LINE_LOOP); - vec[0]= x1; vec[1]= y1; - glVertex2fv(vec); - vec[0]= x2; - glVertex2fv(vec); - vec[1]= y2; - glVertex2fv(vec); - vec[0]= x1; - glVertex2fv(vec); - glEnd(); -} - -unsigned int give_oops_color(short type, short sel, unsigned int *border) -{ - unsigned int body; - /* also finds out if a dashed line should be drawn */ - - switch(type) { - case ID_OB: - body= 0x707070; break; - case ID_SCE: - body= 0x608060; break; - case ID_MA: - body= 0x808060; break; - case ID_TE: - body= 0x7080a0; break; - case ID_IP: - body= 0x906050; break; - case ID_LA: - body= 0x608080; break; - case ID_LI: - body= 0x2198DC; break; - case ID_IM: - body= 0x35659F; break; - case ID_GR: - body= 0x507050; break; - default: - body= 0x606070; break; - } - - if(sel) { - if(G.moving) *border= 0xf0f0f0; - else *border= 0xc0c0c0; - } - else *border= 0x0; - - - return body; -} - - -float center_oops_text(char *str) -/* gives x offset at which to draw oops text -- takes icon into account */ -{ - int len; - float width; - - len= strlen(str); - if(len < 1) return 0; - - /* center at box width of OOPSX */ - width= aspect*BIF_GetStringWidth(font, str, 0) + icon_width(); - - while(width > OOPSX && len >= 0) { - str[len] = 0; - width= aspect*BIF_GetStringWidth(font, str, 0) + icon_width(); - len--; - } - return (OOPSX - width)/2; -} - -void draw_oops(Oops *oops) -{ - OopsLink *ol; - float v1[2], x1, y1, x2, y2, f1, f2; - unsigned int body, border; - short line= 0; - char str[FILE_MAXDIR+FILE_MAXFILE+5]; - - x1= oops->x; - x2= oops->x+OOPSX; - y1= oops->y; - y2= oops->y+OOPSY; - - /* do clip */ - if(x2 < G.v2d->cur.xmin || x1 > G.v2d->cur.xmax) return; - if(y2 < G.v2d->cur.ymin || y1 > G.v2d->cur.ymax) return; - - body= give_oops_color(oops->type, oops->flag & SELECT, &border); - if(oops->id== (ID *)((G.scene->basact) ? (G.scene->basact->object) : 0)) line= 1; - else if(oops->id== (ID *)G.scene) line= 1; - - if (!oops->id) return; - - if(oops->id->us) { - cpack(body); - - glRectf(x1, y1, x2, y2); - } - - if(oops->id->lib) { - if(oops->id->flag & LIB_INDIRECT) cpack(0x1144FF); - else cpack(0x11AAFF); - - glRectf(x2-0.2*OOPSX, y2-0.2*OOPSX, x2-0.1*OOPSX, y2-0.1*OOPSX); - } - - v1[0]= x1; - v1[1] = y1; - - if(oops->type==ID_LI) { - sprintf(str, " %s", ((Library *)oops->id)->name); - } - else { - sprintf(str, " %s", oops->id->name+2); - } - - BIF_SetScale(aspect); - v1[0] += center_oops_text(str); - - draw_icon_oops(v1, oops->type); - v1[0] += icon_width(); - - v1[1] = y1+(y2-y1)/3.0; - if(oops->flag & SELECT) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - glRasterPos2f(v1[0], v1[1]); - BIF_RasterPos(v1[0], v1[1]); - BIF_SetScale(aspect); - BIF_DrawString(font, str, 0); - - - if(line) setlinestyle(2); - cpack(border); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glRectf(x1, y1, x2, y2); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - if(line) setlinestyle(0); - - /* connection blocks */ - ol= oops->link.first; - while(ol) { - - f1= x1+ol->xof; - f2= y1+ol->yof; - - body= give_oops_color(ol->type, oops->flag & SELECT, &border); - cpack(body); - - glRectf(f1-.2, f2-.2, f1+.2, f2+.2); - cpack(border); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glRectf(f1-.2, f2-.2, f1+.2, f2+.2); - - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - ol= ol->next; - } - - if(oops->flag & OOPS_REFER) { - /* Draw the little rounded connection point */ - glColor3ub(0, 0, 0); - glPushMatrix(); - - glTranslatef(oops->x + 0.5*OOPSX, oops->y, 0.0); - glutil_draw_filled_arc(0.0, M_PI, 0.05*OOPSX, 7); - - glPopMatrix(); - } -} - -void drawoopsspace(ScrArea *sa, void *spacedata) -{ - SpaceOops *soops= spacedata; - Oops *oops; - float col[3]; - - BIF_GetThemeColor3fv(TH_BACK, col); - - if(soops==0) return; - - /* darker background for oops */ - if(soops->type!=SO_OUTLINER) { - col[0] = col[0] * 0.75; col[1] = col[1] * 0.75; col[2] = col[2] * 0.75; - } - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - if(soops->type==SO_OUTLINER) draw_outliner(sa, soops); - else { - build_oops(); /* changed to become first call... */ - - boundbox_oops(0); - calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy); - - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - aspect= (G.v2d->cur.xmax - G.v2d->cur.xmin)/((float)sa->winx); - font= uiSetCurFont_ext(30*aspect); - - calc_ipogrid(); /* for scrollvariables */ - - /* drop shadow */ - BIF_ThemeColorShade(TH_BACK, -96); /* drop shadow color */ - glRectf(G.v2d->tot.xmin-1, G.v2d->tot.ymin-3, G.v2d->tot.xmax+3, - G.v2d->tot.ymax+1); - - /* light square in the center */ - BIF_GetThemeColor3fv(TH_BACK, col); - glColor3fv(col); - glRectf(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2, - G.v2d->tot.ymax+2); - - /* box around the oops. */ - cpack(0x0); - mysbox(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2, - G.v2d->tot.ymax+2); - - - /* Draw unselected oops links */ - for(oops= soops->oops.first; oops; oops = oops->next) { - if(oops->hide==0 && (oops->flag & SELECT)); else { - draw_oopslink(oops); - } - } - - /* Draw selected oops links */ - for(oops= soops->oops.first; oops; oops = oops->next) { - if(oops->hide==0 && (oops->flag & SELECT)) { - draw_oopslink(oops); - } - } - - for(oops= soops->oops.first; oops; oops = oops->next) { - if(oops->hide==0) { - if(oops->flag & SELECT); else draw_oops(oops); - } - } - - for(oops= soops->oops.first; oops; oops = oops->next) { - if(oops->hide==0) { - if(oops->flag & SELECT) draw_oops(oops); - } - } - } - - /* restore viewport */ - mywinset(curarea->win); - - /* ortho at pixel level curarea */ - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - if(soops->type==SO_OUTLINER) { - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - if(G.v2d->scroll) drawscroll(0); - } - } - draw_area_emboss(sa); - - curarea->win_swap= WIN_BACK_OK; -} - - - diff --git a/source/blender/src/drawscene.c b/source/blender/src/drawscene.c deleted file mode 100644 index 557083d2b97..00000000000 --- a/source/blender/src/drawscene.c +++ /dev/null @@ -1,135 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * drawing graphics and editing - */ - -#include - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_scene.h" - -#include "BDR_editobject.h" -#include "BDR_editface.h" -#include "BDR_sculptmode.h" -#include "BDR_vpaint.h" - -#include "BIF_space.h" -#include "BIF_drawscene.h" -#include "BIF_poseobject.h" - -#include "BSE_view.h" - -#include "radio.h" - -#include "blendef.h" /* old */ -#include "mydevice.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -void set_scene(Scene *sce) /* also see scene.c: set_scene_bg() */ -{ - bScreen *sc; - - /* ending all modes */ - if( G.obedit) - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - - exit_paint_modes(); - - G.scene= sce; - - sc= G.main->screen.first; - while(sc) { - if((U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) { - - if(sce != sc->scene) { - /* all areas endlocalview */ - ScrArea *sa= sc->areabase.first; - while(sa) { - endlocalview(sa); - sa= sa->next; - } - sc->scene= sce; - } - - } - sc= sc->id.next; - } - - copy_view3d_lock(0); /* space.c */ - - /* are there cameras in the views that are not in the scene? */ - sc= G.main->screen.first; - while(sc) { - if( (U.flag & USER_SCENEGLOBAL) || sc==G.curscreen) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_VIEW3D) { - View3D *v3d= (View3D*) sl; - if (!v3d->camera || !object_in_scene(v3d->camera, sce)) { - v3d->camera= scene_find_camera(sc->scene); - if (sc==G.curscreen) handle_view3d_lock(); - if (!v3d->camera && v3d->persp>1) v3d->persp= 1; - } - } - sl= sl->next; - } - sa= sa->next; - } - } - sc= sc->id.next; - } - - set_scene_bg(G.scene); - scene_update_for_newframe(G.scene, G.scene->lay); - - set_radglobal(); - - /* complete redraw */ - allqueue(REDRAWALL, 0); - allqueue(REDRAWDATASELECT, 0); /* does a remake */ -} - - diff --git a/source/blender/src/drawscript.c b/source/blender/src/drawscript.c deleted file mode 100644 index b009c3b8388..00000000000 --- a/source/blender/src/drawscript.c +++ /dev/null @@ -1,153 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: drawtext.c. - * - * Contributor(s): Willian Padovani Germano. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef _WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" -#include "PIL_time.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" - -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" -#include "BKE_text.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BPI_script.h" -#include "BPY_extern.h" - -#include "BIF_gl.h" -#include "BIF_keyval.h" -#include "BIF_interface.h" -#include "BIF_drawscript.h" -#include "BIF_editfont.h" -#include "BIF_spacetypes.h" -#include "BIF_usiblender.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_mywindow.h" - -#include "BSE_filesel.h" - -#include "mydevice.h" -#include "blendef.h" -#include "interface.h" - -void drawscriptspace(ScrArea *sa, void *spacedata); -void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -void drawscriptspace(ScrArea *sa, void *spacedata) -{ - SpaceScript *sc = curarea->spacedata.first; - Script *script = NULL; - - glClearColor(0.6, 0.6, 0.6, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - myortho2(-0.5, curarea->winrct.xmax-curarea->winrct.xmin-0.5, -0.5, curarea->winrct.ymax-curarea->winrct.ymin-0.5); - - if (!sc->script) return; - - script = sc->script; - - if (script->py_draw) { - BPY_spacescript_do_pywin_draw(sc); - } - /* quick hack for 2.37a for scripts that call the progress bar inside a - * file selector callback, to show previous space after finishing, w/o - * needing an event */ - else if (!script->flags && !script->py_event && !script->py_button) - addqueue(curarea->win, MOUSEX, 0); -} - -void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt) -{ - unsigned short event = evt->event; - short val = evt->val; - char ascii = evt->ascii; - SpaceScript *sc = curarea->spacedata.first; - Script *script = sc->script; - - if (script) { - if (script->py_event || script->py_button) - BPY_spacescript_do_pywin_event(sc, event, val, ascii); - - /* for file/image sel scripts: if user leaves file/image selection space, - * this frees the script (since it can't be accessed anymore): */ - else if (script->flags == SCRIPT_FILESEL) { - script->flags = 0; - script->lastspace = SPACE_SCRIPT; - } - - if (!script->flags) {/* finished with this script, let's free it */ - if (script->lastspace != SPACE_SCRIPT) - newspace (curarea, script->lastspace); - BPY_free_finished_script(script); - sc->script = NULL; - } - } - else { - if (event == QKEY) - if (val && (G.qual & LR_CTRLKEY) && okee("Quit Blender")) exit_usiblender(); - } - - return; -} - -void free_scriptspace (SpaceScript *sc) -{ - if (!sc) return; - - /*free buttons references*/ - if (sc->but_refs) { - BPy_Set_DrawButtonsList(sc->but_refs); - BPy_Free_DrawButtonsList(); - sc->but_refs = NULL; - } - sc->script = NULL; -} diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c deleted file mode 100644 index 6213b669530..00000000000 --- a/source/blender/src/drawseq.c +++ /dev/null @@ -1,1482 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "IMB_imbuf_types.h" - -#include "DNA_sequence_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_global.h" -#include "BKE_plugin_types.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" - -#include "BIF_cursors.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_drawseq.h" -#include "BIF_editseq.h" -#include "BIF_glutil.h" -#include "BIF_resources.h" -#include "BIF_space.h" -#include "BIF_interface.h" - -#include "BSE_view.h" -#include "BSE_drawipo.h" -#include "BSE_sequence.h" -#include "BSE_seqeffects.h" -#include "BSE_seqscopes.h" -#include "BSE_seqaudio.h" -#include "BSE_time.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "blendef.h" /* CFRA */ -#include "mydevice.h" /* REDRAWSEQ */ -#include "interface.h" -#include "winlay.h" - -#define SEQ_LEFTHANDLE 1 -#define SEQ_RIGHTHANDLE 2 - -#define SEQ_STRIP_OFSBOTTOM 0.2 -#define SEQ_STRIP_OFSTOP 0.8 - -int no_rightbox=0, no_leftbox= 0; -static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short direction); -static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq); -static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2); -static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2); -static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct SpaceSeq *sseq, int outline_tint, float pixelx); - -static char *give_seqname(Sequence *seq) -{ - if(seq->type==SEQ_META) return "Meta"; - else if(seq->type==SEQ_IMAGE) return "Image"; - else if(seq->type==SEQ_SCENE) return "Scene"; - else if(seq->type==SEQ_MOVIE) return "Movie"; - else if(seq->type==SEQ_RAM_SOUND) return "Audio (RAM)"; - else if(seq->type==SEQ_HD_SOUND) return "Audio (HD)"; - else if(seq->typestrip->dir; - else if(seq->type==SEQ_CROSS) return "Cross"; - else if(seq->type==SEQ_GAMCROSS) return "Gamma Cross"; - else if(seq->type==SEQ_ADD) return "Add"; - else if(seq->type==SEQ_SUB) return "Sub"; - else if(seq->type==SEQ_MUL) return "Mul"; - else if(seq->type==SEQ_ALPHAOVER) return "Alpha Over"; - else if(seq->type==SEQ_ALPHAUNDER) return "Alpha Under"; - else if(seq->type==SEQ_OVERDROP) return "Over Drop"; - else if(seq->type==SEQ_WIPE) return "Wipe"; - else if(seq->type==SEQ_GLOW) return "Glow"; - else if(seq->type==SEQ_TRANSFORM) return "Transform"; - else if(seq->type==SEQ_COLOR) return "Color"; - else if(seq->type==SEQ_SPEED) return "Speed"; - else if(seq->type==SEQ_PLUGIN) { - if(!(seq->flag & SEQ_EFFECT_NOT_LOADED) && - seq->plugin && seq->plugin->doit) return seq->plugin->pname; - return "Plugin"; - } - else return "Effect"; - -} -static void draw_cfra_seq(void) -{ - glColor3ub(0x30, 0x90, 0x50); - glLineWidth(2.0); - glBegin(GL_LINES); - glVertex2f(G.scene->r.cfra, G.v2d->cur.ymin); - glVertex2f(G.scene->r.cfra, G.v2d->cur.ymax); - glEnd(); - glLineWidth(1.0); -} - -static void get_seq_color3ubv(Sequence *seq, char *col) -{ - char blendcol[3]; - float hsv[3], rgb[3]; - SolidColorVars *colvars = (SolidColorVars *)seq->effectdata; - - switch(seq->type) { - case SEQ_IMAGE: - BIF_GetThemeColor3ubv(TH_SEQ_IMAGE, col); - break; - case SEQ_META: - BIF_GetThemeColor3ubv(TH_SEQ_META, col); - break; - case SEQ_MOVIE: - BIF_GetThemeColor3ubv(TH_SEQ_MOVIE, col); - break; - case SEQ_SCENE: - BIF_GetThemeColor3ubv(TH_SEQ_SCENE, col); - - if(seq->scene==G.scene) { - BIF_GetColorPtrBlendShade3ubv(col, col, col, 1.0, 20); - } - break; - - /* transitions */ - case SEQ_CROSS: - case SEQ_GAMCROSS: - case SEQ_WIPE: - /* slightly offset hue to distinguish different effects */ - BIF_GetThemeColor3ubv(TH_SEQ_TRANSITION, col); - - rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - - if (seq->type == SEQ_CROSS) hsv[0]+= 0.04; - if (seq->type == SEQ_GAMCROSS) hsv[0]+= 0.08; - if (seq->type == SEQ_WIPE) hsv[0]+= 0.12; - - if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); - break; - - /* effects */ - case SEQ_TRANSFORM: - case SEQ_SPEED: - case SEQ_ADD: - case SEQ_SUB: - case SEQ_MUL: - case SEQ_ALPHAOVER: - case SEQ_ALPHAUNDER: - case SEQ_OVERDROP: - case SEQ_GLOW: - /* slightly offset hue to distinguish different effects */ - BIF_GetThemeColor3ubv(TH_SEQ_EFFECT, col); - - rgb[0] = col[0]/255.0; rgb[1] = col[1]/255.0; rgb[2] = col[2]/255.0; - rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2); - - if (seq->type == SEQ_ADD) hsv[0]+= 0.04; - if (seq->type == SEQ_SUB) hsv[0]+= 0.08; - if (seq->type == SEQ_MUL) hsv[0]+= 0.12; - if (seq->type == SEQ_ALPHAOVER) hsv[0]+= 0.16; - if (seq->type == SEQ_ALPHAUNDER) hsv[0]+= 0.20; - if (seq->type == SEQ_OVERDROP) hsv[0]+= 0.24; - if (seq->type == SEQ_GLOW) hsv[0]+= 0.28; - if (seq->type == SEQ_TRANSFORM) hsv[0]+= 0.36; - - if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; - hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2); - col[0] = (char)(rgb[0]*255); col[1] = (char)(rgb[1]*255); col[2] = (char)(rgb[2]*255); - break; - case SEQ_COLOR: - if (colvars->col) { - col[0]= (char)(colvars->col[0]*255); - col[1]= (char)(colvars->col[1]*255); - col[2]= (char)(colvars->col[2]*255); - } else { - col[0] = col[1] = col[2] = 128; - } - break; - case SEQ_PLUGIN: - BIF_GetThemeColor3ubv(TH_SEQ_PLUGIN, col); - break; - case SEQ_HD_SOUND: - case SEQ_RAM_SOUND: - BIF_GetThemeColor3ubv(TH_SEQ_AUDIO, col); - blendcol[0] = blendcol[1] = blendcol[2] = 128; - if(seq->flag & SEQ_MUTE) BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20); - break; - default: - col[0] = 10; col[1] = 255; col[2] = 40; - } -} - -static void drawmeta_contents(Sequence *seqm, float x1, float y1, float x2, float y2) -{ - Sequence *seq; - float dx; - int nr; - char col[3]; - - nr= 0; - WHILE_SEQ(&seqm->seqbase) { - nr++; - } - END_SEQ - - dx= (x2-x1)/nr; - - WHILE_SEQ(&seqm->seqbase) { - get_seq_color3ubv(seq, col); - - glColor3ubv((GLubyte *)col); - - glRectf(x1, y1, x1+0.9*dx, y2); - - BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30); - glColor3ubv((GLubyte *)col); - - fdrawbox(x1, y1, x1+0.9*dx, y2); - - x1+= dx; - } - END_SEQ -} - -static void drawseqwave(Sequence *seq, float x1, float y1, float x2, float y2, int winx) -{ - /* - x1 is the starting x value to draw the wave, - x2 the end x value, same for y1 and y2 - winx is the zoom level. - */ - - float - f, /* floating point value used to store the X draw location for the wave lines when openGL drawing*/ - midy, /* fast access to the middle location (y1+y2)/2 */ - clipxmin, /* the minimum X value, clip this with the window */ - clipxmax, /* the maximum X value, clip this with the window */ - sample_step, /* steps to move per sample, floating value must later translate into an int */ - fsofs, /* steps to move per sample, floating value must later translate into an int */ - feofs_sofs, /* */ - sound_width, /* convenience: x2-x1 */ - wavemulti; /* scale the samples by this value when GL_LINE drawing so it renders the right height */ - - int - offset, /* initial offset value for the wave drawing */ - offset_next, /* when in the wave drawing loop this value is the samples intil the next vert */ - sofs, /* Constrained offset value (~3) for the wave, start */ - eofs, /* ditto, end */ - wavesample, /* inner loop storage if the current wave sample value, used to make the 2 values below */ - wavesamplemin, /* used for finding the min and max wave peaks */ - wavesamplemax, /* ditto */ - subsample_step=4; /* when the sample step is 4 every sample of - the wave is evaluated for min and max values used to draw the wave, - however this is slow ehrn zoomed out so when the sample step is above - 1 (the larger the further out the zoom is) so not evaluate all samples, only some. */ - - signed short* s; - bSound *sound; - Uint8 *stream; - - audio_makestream(seq->sound); - if(seq->sound==NULL || seq->sound->stream==NULL) return; - - if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0); - - sofs = ((int)( FRA2TIME(seq->startdisp-seq->start)*(float)G.scene->audio.mixrate*4.0 )) & (~3); - eofs = ((int)( FRA2TIME(seq->enddisp-seq->start)*(float)G.scene->audio.mixrate*4.0 )) & (~3); - - /* clip the drawing area to the screen bounds to save time */ - sample_step= (G.v2d->cur.xmax - G.v2d->cur.xmin)/winx; - clipxmin= MAX2(x1, G.v2d->cur.xmin); - clipxmax= MIN2(x2, G.v2d->cur.xmax); - - if (sample_step > 1) - subsample_step= ((int)(subsample_step*sample_step*8)) & (~3); - - /* for speedy access */ - midy = (y1+y2)/2; - fsofs= (float)sofs; - feofs_sofs= (float)(eofs-sofs); - sound_width= x2-x1; - sound = seq->sound; - stream = sound->stream; - wavemulti = (y2-y1)/196605; /*y2-y1 is the height*/ - wavesample=0; - - /* we need to get the starting offset value, excuse the duplicate code */ - f=clipxmin; - offset= (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); - - /* start the loop, draw a line per sample_step -sample_step is about 1 line drawn per pixel */ - glBegin(GL_LINES); - for (f=x1+sample_step; f<=clipxmax; f+=sample_step) { - - offset_next = (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); - if (f > G.v2d->cur.xmin) { - /* if this is close to the last sample just exit */ - if (offset_next >= sound->streamlen) break; - - wavesamplemin = 131070; - wavesamplemax = -131070; - - /*find with high and low of the waveform for this draw, - evaluate small samples to find this range */ - while (offset < offset_next) { - s = (signed short*)(stream+offset); - - wavesample = s[0]*2 + s[1]; - if (wavesamplemin>wavesample) - wavesamplemin=wavesample; - if (wavesamplemaxstartdisp; - x2= seq->enddisp; - - y1= seq->machine+SEQ_STRIP_OFSBOTTOM; - y2= seq->machine+SEQ_STRIP_OFSTOP; - - v2d = &sseq->v2d; - - /* clamp handles to defined size in pixel space */ - handsize = seq->handsize; - minhandle = 7; - maxhandle = 40; - CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx); - - /* set up co-ordinates/dimensions for either left or right handle */ - if (direction == SEQ_LEFTHANDLE) { - rx1 = x1; - rx2 = x1+handsize*0.75; - - v1[0]= x1+handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); - v2[0]= x1+handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); - v3[0]= v2[0] + handsize/4; v3[1]= (y1+y2)/2.0; - - whichsel = SEQ_LEFTSEL; - } else if (direction == SEQ_RIGHTHANDLE) { - rx1 = x2-handsize*0.75; - rx2 = x2; - - v1[0]= x2-handsize/4; v1[1]= y1+( ((y1+y2)/2.0 - y1)/2); - v2[0]= x2-handsize/4; v2[1]= y2-( ((y1+y2)/2.0 - y1)/2); - v3[0]= v2[0] - handsize/4; v3[1]= (y1+y2)/2.0; - - whichsel = SEQ_RIGHTSEL; - } - - /* draw! */ - if(seq->type < SEQ_EFFECT || - get_sequence_effect_num_inputs(seq->type) == 0) { - glEnable( GL_BLEND ); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - if(seq->flag & whichsel) glColor4ub(0, 0, 0, 80); - else if (seq->flag & SELECT) glColor4ub(255, 255, 255, 30); - else glColor4ub(0, 0, 0, 22); - - glRectf(rx1, y1, rx2, y2); - - if(seq->flag & whichsel) glColor4ub(255, 255, 255, 200); - else glColor4ub(0, 0, 0, 50); - - glEnable( GL_POLYGON_SMOOTH ); - glBegin(GL_TRIANGLES); - glVertex2fv(v1); glVertex2fv(v2); glVertex2fv(v3); - glEnd(); - - glDisable( GL_POLYGON_SMOOTH ); - glDisable( GL_BLEND ); - } - - if(G.moving || (seq->flag & whichsel)) { - cpack(0xFFFFFF); - if (direction == SEQ_LEFTHANDLE) { - sprintf(str, "%d", seq->startdisp); - glRasterPos3f(rx1, y1-0.15, 0.0); - } else { - sprintf(str, "%d", seq->enddisp - 1); - glRasterPos3f((x2-BMF_GetStringWidth(G.font, str)*pixelx), y2+0.05, 0.0); - } - BMF_DrawString(G.font, str); - } -} - -static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq) -{ - float x1, x2, y1, y2, pixely, a; - char col[3], blendcol[3]; - View2D *v2d; - - if(seq->type >= SEQ_EFFECT) return; - - x1= seq->startdisp; - x2= seq->enddisp; - - y1= seq->machine+SEQ_STRIP_OFSBOTTOM; - y2= seq->machine+SEQ_STRIP_OFSTOP; - - v2d = &sseq->v2d; - pixely = (v2d->cur.ymax - v2d->cur.ymin)/(v2d->mask.ymax - v2d->mask.ymin); - - blendcol[0] = blendcol[1] = blendcol[2] = 120; - - if(seq->startofs) { - glEnable( GL_BLEND ); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - get_seq_color3ubv(seq, col); - - if (seq->flag & SELECT) { - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); - glColor4ub(col[0], col[1], col[2], 170); - } else { - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0); - glColor4ub(col[0], col[1], col[2], 110); - } - - glRectf((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); - - if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255); - else glColor4ub(col[0], col[1], col[2], 160); - - fdrawbox((float)(seq->start), y1-SEQ_STRIP_OFSBOTTOM, x1, y1); //outline - - glDisable( GL_BLEND ); - } - if(seq->endofs) { - glEnable( GL_BLEND ); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - get_seq_color3ubv(seq, col); - - if (seq->flag & SELECT) { - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.3, -40); - glColor4ub(col[0], col[1], col[2], 170); - } else { - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.6, 0); - glColor4ub(col[0], col[1], col[2], 110); - } - - glRectf(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); - - if (seq->flag & SELECT) glColor4ub(col[0], col[1], col[2], 255); - else glColor4ub(col[0], col[1], col[2], 160); - - fdrawbox(x2, y2, (float)(seq->start+seq->len), y2+SEQ_STRIP_OFSBOTTOM); //outline - - glDisable( GL_BLEND ); - } - if(seq->startstill) { - get_seq_color3ubv(seq, col); - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40); - glColor3ubv((GLubyte *)col); - - draw_shadedstrip(seq, col, x1, y1, (float)(seq->start), y2); - - /* feint pinstripes, helps see exactly which is extended and which isn't, - * especially when the extension is very small */ - if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24); - else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16); - - glColor3ubv((GLubyte *)col); - - for(a=y1; a< y2; a+= pixely*2.0 ) { - fdrawline(x1, a, (float)(seq->start), a); - } - } - if(seq->endstill) { - get_seq_color3ubv(seq, col); - BIF_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.75, 40); - glColor3ubv((GLubyte *)col); - - draw_shadedstrip(seq, col, (float)(seq->start+seq->len), y1, x2, y2); - - /* feint pinstripes, helps see exactly which is extended and which isn't, - * especially when the extension is very small */ - if (seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24); - else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16); - - glColor3ubv((GLubyte *)col); - - for(a=y1; a< y2; a+= pixely*2.0 ) { - fdrawline((float)(seq->start+seq->len), a, x2, a); - } - } -} - -/* draw info text on a sequence strip */ -static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2) -{ - float v1[2], v2[2]; - int len, size; - char str[32 + FILE_MAXDIR+FILE_MAXFILE], *strp; - short mval[2]; - - v1[1]= y1; - v2[1]= y2; - - v1[0]= x1; - ipoco_to_areaco_noclip(G.v2d, v1, mval); - x1= mval[0]; - v2[0]= x2; - ipoco_to_areaco_noclip(G.v2d, v2, mval); - x2= mval[0]; - size= x2-x1; - - if(seq->name[2]) { - sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->name+2); - }else{ - if(seq->type == SEQ_META) { - sprintf(str, "%d | %s", seq->len, give_seqname(seq)); - } - else if(seq->type == SEQ_SCENE) { - if(seq->scene) sprintf(str, "%d | %s: %s", seq->len, give_seqname(seq), seq->scene->id.name+2); - else sprintf(str, "%d | %s", seq->len, give_seqname(seq)); - - } - else if(seq->type == SEQ_IMAGE) { - sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); - } - else if(seq->type & SEQ_EFFECT) { - int can_float = (seq->type != SEQ_PLUGIN) - || (seq->plugin && seq->plugin->version >= 4); - - if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3) - sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!"); - else if (seq->seq1 && seq->seq2) - sprintf(str, "%d | %s: %d>%d%s", seq->len, give_seqname(seq), seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!"); - else - sprintf(str, "%d | %s", seq->len, give_seqname(seq)); - } - else if (seq->type == SEQ_RAM_SOUND) { - sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name); - } - else if (seq->type == SEQ_HD_SOUND) { - sprintf(str, "%d | %s", seq->len, seq->strip->stripdata->name); - } - else if (seq->type == SEQ_MOVIE) { - sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); - } - } - - strp= str; - - while( (len= BMF_GetStringWidth(G.font, strp)) > size) { - if(len < 10) break; - if(strp[1]==0) break; - strp++; - } - - mval[0]= (x1+x2-len+1)/2; - mval[1]= 1; - areamouseco_to_ipoco(G.v2d, mval, &x1, &x2); - - if(seq->flag & SELECT) cpack(0xFFFFFF); - else cpack(0); - glRasterPos3f(x1, y1+SEQ_STRIP_OFSBOTTOM, 0.0); - BMF_DrawString(G.font, strp); -} - -/* draws a shaded strip, made from gradient + flat color + gradient */ -static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2) -{ - float ymid1, ymid2; - - ymid1 = (y2-y1)*0.25 + y1; - ymid2 = (y2-y1)*0.65 + y1; - - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -50); - else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 0); - - glColor3ubv((GLubyte *)col); - - glVertex2f(x1,y1); - glVertex2f(x2,y1); - - if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5); - else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -5); - - glColor3ubv((GLubyte *)col); - - glVertex2f(x2,ymid1); - glVertex2f(x1,ymid1); - - glEnd(); - - glRectf(x1, ymid1, x2, ymid2); - - glBegin(GL_QUADS); - - glVertex2f(x1,ymid2); - glVertex2f(x2,ymid2); - - if(seq->flag & SELECT) BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -15); - else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 25); - - glColor3ubv((GLubyte *)col); - - glVertex2f(x2,y2); - glVertex2f(x1,y2); - - glEnd(); - -} - -/* -Draw a sequence strip, bounds check alredy made -ScrArea is currently only used to get the windows width in pixels -so wave file sample drawing precission is zoom adjusted -*/ -static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outline_tint, float pixelx) -{ - float x1, x2, y1, y2; - char col[3], is_single_image; - - /* we need to know if this is a single image/color or not for drawing */ - is_single_image = (char)check_single_seq(seq); - - /* body */ - if(seq->startstill) x1= seq->start; - else x1= seq->startdisp; - y1= seq->machine+SEQ_STRIP_OFSBOTTOM; - if(seq->endstill) x2= seq->start+seq->len; - else x2= seq->enddisp; - y2= seq->machine+SEQ_STRIP_OFSTOP; - - - /* get the correct color per strip type*/ - get_seq_color3ubv(seq, col); - - /* draw the main strip body */ - if (is_single_image) /* single image */ - draw_shadedstrip(seq, col, seq_tx_get_final_left(seq), y1, seq_tx_get_final_right(seq), y2); - else /* normal operation */ - draw_shadedstrip(seq, col, x1, y1, x2, y2); - - /* draw additional info and controls */ - if (seq->type == SEQ_RAM_SOUND) - drawseqwave(seq, x1, y1, x2, y2, sa->winx); - - if (!is_single_image) - draw_seq_extensions(seq, sseq); - - draw_seq_handle(seq, sseq, pixelx, SEQ_LEFTHANDLE); - draw_seq_handle(seq, sseq, pixelx, SEQ_RIGHTHANDLE); - - /* draw the strip outline */ - x1= seq->startdisp; - x2= seq->enddisp; - - get_seq_color3ubv(seq, col); - if (G.moving && (seq->flag & SELECT)) { - if(seq->flag & SEQ_OVERLAP) { - col[0]= 255; col[1]= col[2]= 40; - } else BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 120); - } - - BIF_GetColorPtrBlendShade3ubv(col, col, col, 0.0, outline_tint); - - glColor3ubv((GLubyte *)col); - gl_round_box_shade(GL_LINE_LOOP, x1, y1, x2, y2, 0.0, 0.1, 0.0); - - - /* calculate if seq is long enough to print a name */ - x1= seq->startdisp+seq->handsize; - x2= seq->enddisp-seq->handsize; - - /* but first the contents of a meta */ - if(seq->type==SEQ_META) drawmeta_contents(seq, x1, y1+0.15, x2, y2-0.15); - - /* info text on the strip */ - if(x1cur.xmin) x1= G.v2d->cur.xmin; - else if(x1>G.v2d->cur.xmax) x1= G.v2d->cur.xmax; - if(x2cur.xmin) x2= G.v2d->cur.xmin; - else if(x2>G.v2d->cur.xmax) x2= G.v2d->cur.xmax; - - /* nice text here would require changing the view matrix for texture text */ - if( (x2-x1) / pixelx > 32) { - draw_seq_text(seq, x1, x2, y1, y2); - } -} - -static Sequence *special_seq_update= 0; - -void set_special_seq_update(int val) -{ - int x; - - /* if mouse over a sequence && LEFTMOUSE */ - if(val) { - special_seq_update= find_nearest_seq(&x); - } - else special_seq_update= 0; -} - - -static void draw_image_seq(ScrArea *sa) -{ - SpaceSeq *sseq; - struct ImBuf *ibuf; - int x1, y1, rectx, recty; - int free_ibuf = 0; - static int recursive= 0; - float zoom; - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - sseq= sa->spacedata.first; - if(sseq==0) return; - - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; - - /* BIG PROBLEM: the give_ibuf_seq() can call a rendering, which in turn calls redraws... - this shouldn't belong in a window drawing.... - So: solve this once event based. - Now we check for recursion, space type and active area again (ton) */ - - if(recursive) - return; - else { - recursive= 1; - if (special_seq_update) { - ibuf= give_ibuf_seq_direct( - rectx, recty, (G.scene->r.cfra), - special_seq_update); - } else if (!U.prefetchframes || (G.f & G_PLAYANIM) == 0) { - ibuf= (ImBuf *)give_ibuf_seq( - rectx, recty, (G.scene->r.cfra), - sseq->chanshown); - } else { - ibuf= (ImBuf *)give_ibuf_seq_threaded( - rectx, recty, (G.scene->r.cfra), - sseq->chanshown); - } - recursive= 0; - - /* HURMF! the give_ibuf_seq can call image display in this window */ - if(sa->spacetype!=SPACE_SEQ) - return; - if(sa!=curarea) { - areawinset(sa->win); - } - } - - if(ibuf==NULL) - return; - if(ibuf->rect_float && ibuf->rect==NULL) - IMB_rect_from_float(ibuf); - if(ibuf->rect==NULL) - return; - - if (sseq->mainb == SEQ_DRAW_IMG_WAVEFORM) { - ibuf = make_waveform_view_from_ibuf(ibuf); - free_ibuf = 1; - } else if (sseq->mainb == SEQ_DRAW_IMG_VECTORSCOPE) { - ibuf = make_vectorscope_view_from_ibuf(ibuf); - free_ibuf = 1; - } - - if (sseq->zoom > 0) { - zoom = sseq->zoom; - } else if (sseq->zoom == 0) { - zoom = 1.0; - } else { - zoom = -1.0/sseq->zoom; - } - - /* calc location */ - x1= (sa->winx-zoom*ibuf->x)/2 + sseq->xof; - y1= (sa->winy-zoom*ibuf->y)/2 + sseq->yof; - - /* needed for gla draw */ - glaDefine2DArea(&curarea->winrct); - - glPixelZoom(zoom * ((float)G.scene->r.xasp / (float)G.scene->r.yasp), zoom); - - glaDrawPixelsSafe(x1, y1, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - - glPixelZoom(1.0, 1.0); - - if (free_ibuf) { - IMB_freeImBuf(ibuf); - } - - sa->win_swap= WIN_BACK_OK; -} - -static void draw_extra_seqinfo(void) -{ - Sequence *last_seq = get_last_seq(); - StripElem *se, *last; - float xco, xfac, yco, yfac; - int sta, end; - char str[256]; - - if(last_seq==0) return; - - /* xfac: size of 1 pixel */ - xfac= G.v2d->cur.xmax - G.v2d->cur.xmin; - xfac/= (float)(G.v2d->mask.xmax-G.v2d->mask.xmin); - xco= G.v2d->cur.xmin+10*xfac; - - yfac= G.v2d->cur.ymax - G.v2d->cur.ymin; - yfac/= (float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - yco= G.v2d->cur.ymin+40*yfac; - - BIF_ThemeColor(TH_TEXT_HI); - - /* NAME */ - glRasterPos3f(xco, yco, 0.0); - strncpy(str, give_seqname(last_seq), 255); - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +10.0*xfac; - - if(last_seq->type==SEQ_SCENE && last_seq->scene) { - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, last_seq->scene->id.name+2); - xco += xfac*BMF_GetStringWidth(G.font, last_seq->scene->id.name+2) +30.0*xfac; - } - - /* LEN, dont bother with single images */ - if (check_single_seq(last_seq)==0) { - if(last_seq->type & SEQ_EFFECT) - sprintf(str, "len: %d From %d - %d", last_seq->len, last_seq->startdisp, last_seq->enddisp-1); - else - sprintf(str, "len: %d (%d)", last_seq->enddisp-last_seq->startdisp, last_seq->len); - - glRasterPos3f(xco, yco, 0.0); - - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +10.0*xfac; - } - - - if(last_seq->type==SEQ_IMAGE) { - if (last_seq->len > 1) { - /* CURRENT */ - se= give_stripelem(last_seq, (G.scene->r.cfra)); - if(se) { - sprintf(str, "Cur: %s%s", last_seq->strip->dir, se->name); - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +10.0*xfac; - } - - /* FIRST AND LAST */ - - if(last_seq->strip) { - se= last_seq->strip->stripdata; - last= se+last_seq->len-1; - if(last_seq->startofs) se+= last_seq->startofs; - if(last_seq->endofs) last-= last_seq->endofs; - - sprintf(str, "First: %s at %d Last: %s at %d", se->name, last_seq->startdisp, last->name, last_seq->enddisp-1); - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac; - } - } else { /* single image */ - if (last_seq->strip) { - sprintf(str, "Single: %s%s len: %d", last_seq->strip->dir, last_seq->strip->stripdata->name, last_seq->enddisp-last_seq->startdisp); - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac; - } - } - /* orig size */ - if(last_seq->strip) { - sprintf(str, "OrigSize: %d x %d", last_seq->strip->orx, last_seq->strip->ory); - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - xco += xfac*BMF_GetStringWidth(G.font, str) +30.0*xfac; - } - } - else if(last_seq->type==SEQ_MOVIE) { - - sta= last_seq->startofs; - end= last_seq->len-1-last_seq->endofs; - - sprintf(str, "%s %s%s First: %d at %d Last: %d at %d Cur: %d", - last_seq->name+2, last_seq->strip->dir, last_seq->strip->stripdata->name, - sta, last_seq->startdisp, end, last_seq->enddisp-1, (G.scene->r.cfra)-last_seq->startdisp); - - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - } - else if(last_seq->type==SEQ_SCENE) { - TStripElem * se= give_tstripelem(last_seq, (G.scene->r.cfra)); - if(se && last_seq->scene) { - sprintf(str, "Cur: %d First: %d Last: %d", last_seq->sfra+se->nr, last_seq->sfra, last_seq->sfra+last_seq->len-1); - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - } - } - else if(last_seq->type==SEQ_RAM_SOUND - || last_seq->type == SEQ_HD_SOUND) { - - sta= last_seq->startofs; - end= last_seq->len-1-last_seq->endofs; - - sprintf(str, "%s %s%s First: %d at %d Last: %d at %d Cur: %d Gain: %.2f dB Pan: %.2f", - last_seq->name+2, last_seq->strip->dir, last_seq->strip->stripdata->name, - sta, last_seq->startdisp, end, last_seq->enddisp-1, (G.scene->r.cfra)-last_seq->startdisp, - last_seq->level, last_seq->pan); - - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - } - else if(last_seq->type == SEQ_SPEED) { - SpeedControlVars * vars = - (SpeedControlVars*) last_seq->effectdata; - - if (vars) { - sprintf(str, "Last mapped frame: %d at %d", - vars->lastValidFrame, - vars->lastValidFrame - + last_seq->startdisp); - - glRasterPos3f(xco, yco, 0.0); - BMF_DrawString(G.font, str); - } - } -} - -void seq_reset_imageofs(SpaceSeq *sseq) -{ - sseq->xof = sseq->yof = sseq->zoom = 0; -} - -void seq_viewmove(SpaceSeq *sseq) -{ - ScrArea *sa; - short mval[2], mvalo[2]; - short rectx, recty, xmin, xmax, ymin, ymax, pad; - int oldcursor; - Window *win; - - sa = sseq->area; - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; - - pad = 10; - xmin = -(sa->winx/2) - rectx/2 + pad; - xmax = sa->winx/2 + rectx/2 - pad; - ymin = -(sa->winy/2) - recty/2 + pad; - ymax = sa->winy/2 + recty/2 - pad; - - getmouseco_sc(mvalo); - - oldcursor=get_cursor(); - win=winlay_get_active_window(); - - SetBlenderCursor(BC_NSEW_SCROLLCURSOR); - - while(get_mbut()&(L_MOUSE|M_MOUSE)) { - - getmouseco_sc(mval); - - if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { - - sseq->xof -= (mvalo[0]-mval[0]); - sseq->yof -= (mvalo[1]-mval[1]); - - /* prevent dragging image outside of the window and losing it! */ - CLAMP(sseq->xof, xmin, xmax); - CLAMP(sseq->yof, ymin, ymax); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else BIF_wait_for_statechange(); - } - window_set_cursor(win, oldcursor); -} - -#define SEQ_BUT_PLUGIN 1 -#define SEQ_BUT_RELOAD 2 -#define SEQ_BUT_EFFECT 3 -#define SEQ_BUT_RELOAD_ALL 4 - -void do_seqbuttons(short val) -{ - Sequence *last_seq = get_last_seq(); - - switch(val) { - case SEQ_BUT_PLUGIN: - case SEQ_BUT_EFFECT: - update_changed_seq_and_deps(last_seq, 0, 1); - break; - - case SEQ_BUT_RELOAD: - case SEQ_BUT_RELOAD_ALL: - update_seq_ipo_rect(last_seq); - update_seq_icu_rects(last_seq); - - free_imbuf_seq(); // frees all - - break; - } - - if (val == SEQ_BUT_RELOAD_ALL) { - allqueue(REDRAWALL, 0); - } else { - allqueue(REDRAWSEQ, 0); - } -} - -static void seq_panel_properties(short cntrl) // SEQ_HANDLER_PROPERTIES -{ - Sequence *last_seq = get_last_seq(); - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "seq_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(SEQ_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Strip Properties", "Seq", 10, 230, 318, 204)==0) return; - - if(last_seq==NULL) return; - - if(last_seq->type==SEQ_PLUGIN) { - PluginSeq *pis; - VarStruct *varstr; - int a, xco, yco; - - get_sequence_effect(last_seq);/* make sure, plugin is loaded */ - - uiDefBut(block, LABEL, 0, "Type: Plugin", 10,50,70,20, 0, 0, 0, 0, 0, ""); - - pis= last_seq->plugin; - if(pis->vars==0) return; - - varstr= pis->varstr; - if(varstr) { - for(a=0; avars; a++, varstr++) { - xco= 150*(a/6)+10; - yco= 125 - 20*(a % 6)+1; - uiDefBut(block, varstr->type, SEQ_BUT_PLUGIN, varstr->name, xco,yco,150,19, &(pis->data[a]), varstr->min, varstr->max, 100, 0, varstr->tip); - - } - } - uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, - SEQ_BUT_RELOAD_ALL, "IPO Frame locked", - 10,-40,150,19, &last_seq->flag, - 0.0, 1.0, 0, 0, - "Lock the IPO coordinates to the " - "global frame counter."); - - } - else if(last_seq->type==SEQ_IMAGE) { - - uiDefBut(block, LABEL, 0, "Type: Image", 10,160,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, B_NOP, "Name: ", 10,140,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Convert to Premul", 10,110,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha"); - uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); - - uiDefButBitS(block, TOG, SEQ_FLIPX, SEQ_BUT_RELOAD, "FlipX", 10,70,75,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Flip on the X axis"); - uiDefButBitS(block, TOG, SEQ_FLIPY, SEQ_BUT_RELOAD, "FlipY", 85,70,75,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Flip on the Y axis"); - - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors"); - uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Strobe:", 10,10,150,19, &last_seq->strobe, 1.0, 30.0, 100, 0, "Only display every nth frame"); - uiBlockEndAlign(block); - } - else if(last_seq->type==SEQ_META) { - - uiDefBut(block, LABEL, 0, "Type: Meta", 10,140,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - - } - else if(last_seq->type==SEQ_SCENE) { - - uiDefBut(block, LABEL, 0, "Type: Scene", 10,140,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); - } - else if(last_seq->type==SEQ_MOVIE) { - - if(last_seq->mul==0.0) last_seq->mul= 1.0; - - uiDefBut(block, LABEL, 0, "Type: Movie", 10,140,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, SEQ_MAKE_PREMUL, SEQ_BUT_RELOAD, "Make Premul Alpha ", 10,90,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Converts RGB values to become premultiplied with Alpha"); - uiDefButBitS(block, TOG, SEQ_FILTERY, SEQ_BUT_RELOAD, "FilterY ", 10,70,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "For video movies to remove fields"); - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Mul:", 10,50,150,19, &last_seq->mul, 0.001, 5.0, 100, 0, "Multiply colors"); - - uiDefButS(block, TOG|BIT|7, SEQ_BUT_RELOAD, "Reverse Frames", 10,30,150,19, &last_seq->flag, 0.0, 21.0, 100, 0, "Reverse frame order"); - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Strobe:", 10,10,150,19, &last_seq->strobe, 1.0, 30.0, 100, 0, "Only display every nth frame"); - uiDefButI(block, NUM, SEQ_BUT_RELOAD, "Preseek:", 10,-10,150,19, &last_seq->anim_preseek, 0.0, 50.0, 100, 0, "On MPEG-seeking preseek this many frames"); - uiBlockEndAlign(block); - } - else if(last_seq->type==SEQ_RAM_SOUND || - last_seq->type==SEQ_HD_SOUND) { - - uiDefBut(block, LABEL, 0, "Type: Audio", 10,140,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, 0, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, - SEQ_BUT_RELOAD_ALL, "IPO Frame locked", - 10,90,150,19, &last_seq->flag, - 0.0, 1.0, 0, 0, - "Lock the IPO coordinates to the " - "global frame counter."); - - uiDefButBitS(block, TOG, SEQ_MUTE, B_NOP, "Mute", 10,70,120,19, &last_seq->flag, 0.0, 21.0, 100, 0, ""); - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Gain (dB):", 10,50,150,19, &last_seq->level, -96.0, 6.0, 100, 0, ""); - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Pan:", 10,30,150,19, &last_seq->pan, -1.0, 1.0, 100, 0, ""); - uiBlockEndAlign(block); - } - else if(last_seq->type>=SEQ_EFFECT) { - uiDefBut(block, LABEL, 0, "Type: Effect", 10,140,150,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, B_NOP, "Name: ", 10,120,150,19, last_seq->name+2, 0.0, 21.0, 100, 0, ""); - - uiDefButBitS(block, TOG, SEQ_IPO_FRAME_LOCKED, - SEQ_BUT_RELOAD_ALL, "IPO Frame locked", - 10,90,150,19, &last_seq->flag, - 0.0, 1.0, 0, 0, - "Lock the IPO coordinates to the " - "global frame counter."); - - uiBlockBeginAlign(block); - if(last_seq->type==SEQ_WIPE){ - WipeVars *wipe = (WipeVars *)last_seq->effectdata; - char formatstring[256]; - - strncpy(formatstring, "Transition Type %t|Single Wipe%x0|Double Wipe %x1|Iris Wipe %x4|Clock Wipe %x5", 255); - uiDefButS(block, MENU,SEQ_BUT_EFFECT, formatstring, 10,65,220,22, &wipe->wipetype, 0, 0, 0, 0, "What type of wipe should be performed"); - uiDefButF(block, NUM,SEQ_BUT_EFFECT,"Blur:", 10,40,220,22, &wipe->edgeWidth,0.0,1.0, 1, 2, "The percent width of the blur edge"); - switch(wipe->wipetype){ /*Skip Types that do not require angle*/ - case DO_IRIS_WIPE: - case DO_CLOCK_WIPE: - break; - - default: - uiDefButF(block, NUM,SEQ_BUT_EFFECT,"Angle:", 10,15,220,22, &wipe->angle,-90.0,90.0, 1, 2, "The Angle of the Edge"); - } - uiDefButS(block, TOG,SEQ_BUT_EFFECT,"Wipe In", 10,-10,220,22, &wipe->forward,0,0, 0, 0, "Controls Primary Direction of Wipe"); - } - else if(last_seq->type==SEQ_GLOW){ - GlowVars *glow = (GlowVars *)last_seq->effectdata; - - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Threshold:", 10,70,150,19, &glow->fMini, 0.0, 1.0, 0, 0, "Trigger Intensity"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Clamp:", 10,50,150,19, &glow->fClamp, 0.0, 1.0, 0, 0, "Brightness limit of intensity"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Boost factor:", 10,30,150,19, &glow->fBoost, 0.0, 10.0, 0, 0, "Brightness multiplier"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "Blur distance:", 10,10,150,19, &glow->dDist, 0.5, 20.0, 0, 0, "Radius of glow effect"); - uiDefButI(block, NUM, B_NOP, "Quality:", 10,-5,150,19, &glow->dQuality, 1.0, 5.0, 0, 0, "Accuracy of the blur effect"); - uiDefButI(block, TOG, B_NOP, "Only boost", 10,-25,150,19, &glow->bNoComp, 0.0, 0.0, 0, 0, "Show the glow buffer only"); - } - else if(last_seq->type==SEQ_TRANSFORM){ - TransformVars *transform = (TransformVars *)last_seq->effectdata; - - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "xScale Start:", 10,70,150,19, &transform->ScalexIni, 0.0, 10.0, 0, 0, "X Scale Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "xScale End:", 160,70,150,19, &transform->ScalexFin, 0.0, 10.0, 0, 0, "X Scale End"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "yScale Start:", 10,50,150,19, &transform->ScaleyIni, 0.0, 10.0, 0, 0, "Y Scale Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "yScale End:", 160,50,150,19, &transform->ScaleyFin, 0.0, 10.0, 0, 0, "Y Scale End"); - - uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Percent", 10, 30, 150, 19, &transform->percent, 0.0, 1.0, 0.0, 0.0, "Percent Translate"); - uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Pixels", 160, 30, 150, 19, &transform->percent, 0.0, 0.0, 0.0, 0.0, "Pixels Translate"); - if(transform->percent==1){ - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -500.0, 500.0, 0, 0, "X Position Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -500.0, 500.0, 0, 0, "X Position End"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -500.0, 500.0, 0, 0, "Y Position Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -500.0, 500.0, 0, 0, "Y Position End"); - }else{ - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x Start:", 10,10,150,19, &transform->xIni, -10000.0, 10000.0, 0, 0, "X Position Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "x End:", 160,10,150,19, &transform->xFin, -10000.0, 10000.0, 0, 0, "X Position End"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y Start:", 10,-10,150,19, &transform->yIni, -10000.0, 10000.0, 0, 0, "Y Position Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "y End:", 160,-10,150,19, &transform->yFin, -10000.0, 10000.0, 0, 0, "Y Position End"); - - } - - - - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "rot Start:",10,-30,150,19, &transform->rotIni, 0.0, 360.0, 0, 0, "Rotation Start"); - uiDefButF(block, NUM, SEQ_BUT_EFFECT, "rot End:",160,-30,150,19, &transform->rotFin, 0.0, 360.0, 0, 0, "Rotation End"); - - uiDefButI(block, ROW, SEQ_BUT_EFFECT, "No Interpolat", 10, -50, 100, 19, &transform->interpolation, 0.0, 0.0, 0.0, 0.0, "No interpolation"); - uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Bilinear", 101, -50, 100, 19, &transform->interpolation, 0.0, 1.0, 0.0, 0.0, "Bilinear interpolation"); - uiDefButI(block, ROW, SEQ_BUT_EFFECT, "Bicubic", 202, -50, 100, 19, &transform->interpolation, 0.0, 2.0, 0.0, 0.0, "Bicubic interpolation"); - } else if(last_seq->type==SEQ_COLOR) { - SolidColorVars *colvars = (SolidColorVars *)last_seq->effectdata; - uiDefButF(block, COL, SEQ_BUT_RELOAD, "",10,90,150,19, colvars->col, 0, 0, 0, 0, ""); - } else if(last_seq->type==SEQ_SPEED){ - SpeedControlVars *sp = - (SpeedControlVars *)last_seq->effectdata; - - uiDefButF(block, NUM, SEQ_BUT_RELOAD, "Global Speed:", 10,70,150,19, &sp->globalSpeed, 0.0, 100.0, 0, 0, "Global Speed"); - - uiDefButBitI(block, TOG, SEQ_SPEED_INTEGRATE, - SEQ_BUT_RELOAD, - "IPO is velocity", - 10,50,150,19, &sp->flags, - 0.0, 1.0, 0, 0, - "Interpret the IPO value as a " - "velocity instead of a frame number"); - - uiDefButBitI(block, TOG, SEQ_SPEED_BLEND, - SEQ_BUT_RELOAD, - "Enable frame blending", - 10,30,150,19, &sp->flags, - 0.0, 1.0, 0, 0, - "Blend two frames into the " - "target for a smoother result"); - - uiDefButBitI(block, TOG, SEQ_SPEED_COMPRESS_IPO_Y, - SEQ_BUT_RELOAD, - "IPO value runs from [0..1]", - 10,10,150,19, &sp->flags, - 0.0, 1.0, 0, 0, - "Scale IPO value to get the " - "target frame number."); - } - - uiBlockEndAlign(block); - } -} - -static void seq_blockhandlers(ScrArea *sa) -{ - SpaceSeq *sseq= sa->spacedata.first; - short a; - - /* warning; blocks need to be freed each time, handlers dont remove (for ipo moved to drawipospace) */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - for(a=0; ablockhandler[a]) { - - case SEQ_HANDLER_PROPERTIES: - seq_panel_properties(sseq->blockhandler[a+1]); - break; - - } - /* clear action value for event */ - sseq->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); - -} - -void drawprefetchseqspace(ScrArea *sa, void *spacedata) -{ - SpaceSeq *sseq= sa->spacedata.first; - int rectx, recty; - - rectx= (G.scene->r.size*G.scene->r.xsch)/100; - recty= (G.scene->r.size*G.scene->r.ysch)/100; - - if(sseq->mainb) { - give_ibuf_prefetch_request( - rectx, recty, (G.scene->r.cfra), sseq->chanshown); - } -} - -void drawseqspace(ScrArea *sa, void *spacedata) -{ - SpaceSeq *sseq= sa->spacedata.first; - View2D *v2d= &sseq->v2d; - Editing *ed; - Sequence *seq; - float col[3]; - int ofsx, ofsy; - int i; - - ed= G.scene->ed; - - if(sseq->mainb) { - draw_image_seq(sa); - return; - } - - bwin_clear_viewmat(sa->win); /* clear buttons view */ - glLoadIdentity(); - - BIF_GetThemeColor3fv(TH_BACK, col); - if(ed && ed->metastack.first) glClearColor(col[0], col[1], col[2]-0.1, 0.0); - else glClearColor(col[0], col[1], col[2], 0.0); - - glClear(GL_COLOR_BUFFER_BIT); - - calc_scrollrcts(sa, v2d, sa->winx, sa->winy); - - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - if(v2d->scroll) { - ofsx= sa->winrct.xmin; /* because of mywin */ - ofsy= sa->winrct.ymin; - glViewport(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1); - glScissor(ofsx+v2d->mask.xmin, ofsy+v2d->mask.ymin, ( ofsx+v2d->mask.xmax-1)-(ofsx+v2d->mask.xmin)+1, ( ofsy+v2d->mask.ymax-1)-( ofsy+v2d->mask.ymin)+1); - } - } - - - myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax); - - BIF_ThemeColorShade(TH_BACK, -20); - glRectf(v2d->cur.xmin, 0.0, v2d->cur.xmax, 1.0); - - - boundbox_seq(); - calc_ipogrid(); - - /* Alternating horizontal stripes */ - i= MAX2(1, ((int)G.v2d->cur.ymin)-1); - - glBegin(GL_QUADS); - while (icur.ymax) { - if (((int)i) & 1) - BIF_ThemeColorShade(TH_BACK, -15); - else - BIF_ThemeColorShade(TH_BACK, -25); - - glVertex2f(v2d->cur.xmax, i); - glVertex2f(v2d->cur.xmin, i); - glVertex2f(v2d->cur.xmin, i+1); - glVertex2f(v2d->cur.xmax, i+1); - i+=1.0; - } - glEnd(); - - /* Force grid lines */ - i= MAX2(1, ((int)G.v2d->cur.ymin)-1); - glBegin(GL_LINES); - - while (icur.ymax) { - BIF_ThemeColor(TH_GRID); - glVertex2f(G.v2d->cur.xmax, i); - glVertex2f(G.v2d->cur.xmin, i); - i+=1.0; - } - glEnd(); - - - draw_ipogrid(); - draw_cfra_seq(); - - - /* sequences: first deselect */ - if(ed) { - Sequence *last_seq = get_last_seq(); - int sel = 0, j; - int outline_tint; - float pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin); - /* loop through twice, first unselected, then selected */ - for (j=0; j<2; j++) { - seq= ed->seqbasep->first; - if (j==0) outline_tint = -150; - else outline_tint = -60; - - while(seq) { /* bound box test, dont draw outside the view */ - if ( ((seq->flag & SELECT) == sel) || - seq == last_seq || - MIN2(seq->startdisp, seq->start) > v2d->cur.xmax || - MAX2(seq->enddisp, seq->start+seq->len) < v2d->cur.xmin || - seq->machine+1.0 < v2d->cur.ymin || - seq->machine > v2d->cur.ymax) - { - /* dont draw */ - } else { - draw_seq_strip(seq, sa, sseq, outline_tint, pixelx); - } - seq= seq->next; - } - sel= SELECT; /* draw selected next time round */ - } - /* draw the last selected last, removes some overlapping error */ - if (last_seq) { - draw_seq_strip(last_seq, sa, sseq, 120, pixelx); - } - } - - draw_extra_seqinfo(); - - /* Draw markers */ - draw_markers_timespace(1); - - /* restore viewport */ - mywinset(sa->win); - - /* ortho at pixel level sa */ - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - if(v2d->scroll) { - drawscroll(0); - } - } - - draw_area_emboss(sa); - - if(sseq->mainb==0) { - /* it is important to end a view in a transform compatible with buttons */ - bwin_scalematrix(sa->win, sseq->blockscale, sseq->blockscale, sseq->blockscale); - seq_blockhandlers(sa); - } - - sa->win_swap= WIN_BACK_OK; -} - - diff --git a/source/blender/src/drawsound.c b/source/blender/src/drawsound.c deleted file mode 100644 index 17d340b802c..00000000000 --- a/source/blender/src/drawsound.c +++ /dev/null @@ -1,240 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_gl.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_editsound.h" -#include "BIF_resources.h" - -#include "BSE_drawipo.h" -#include "BSE_time.h" -#include "BMF_Api.h" - -#include "blendef.h" - -/* local */ -void drawsoundspace(ScrArea *sa, void *spacedata); - -/*implementation */ -static void draw_wave(int startsamp, int endsamp, short sampdx, short offset, short *sp, float sampfac, float y) -{ - float min, max, v1[2], v2[3]; - int i, j, deltasp, value; /*deltasp, value: were both shorts but for music files 5min, zooming out cased a crash */ - - sp+= offset*startsamp; - - deltasp= offset*sampdx; - - glBegin(GL_LINES); - for(i=startsamp; i max) max= value; - } - v1[1]= y + 0.002*min; - v2[1]= y + 0.002*max; - - v1[0]=v2[0]= sampfac*i; - - glVertex2fv(v1); - glVertex2fv(v2); - } - glEnd(); -} - -static void draw_sample(bSample *sample) -{ - float sampxlen, sampfac; - int samples, startsamp, endsamp; - short *sp, sampdx; - - /* one sample is where in v2d space? (v2d space in frames!) */ - sampfac= FPS/(sample->rate); - - /* how many samples? */ - samples= sample->len/(sample->channels*(sample->bits/8)); - /* total len in v2d space */ - sampxlen= sampfac*samples; - - /* one pixel is how many samples? */ - sampdx= (samples*((G.v2d->cur.xmax-G.v2d->cur.xmin)/sampxlen))/curarea->winx; - - if(sampdx==0) sampdx= 1; - - /* start and and */ - startsamp = G.v2d->cur.xmin/sampfac; - CLAMP(startsamp, 0, samples-1); - endsamp= G.v2d->cur.xmax/sampfac; - CLAMP(endsamp, 0, samples-1); - endsamp-= sampdx; - - /* set 'tot' for sliders */ - G.v2d->tot.xmax= sampfac*samples; - - /* channels? */ - if(sample->channels==2) { - - cpack(0x905050); - sp= (short *)(sample->data); - draw_wave(startsamp, endsamp, sampdx, 2, sp, sampfac, 85.0); - - cpack(0x506890); - sp++; - draw_wave(startsamp, endsamp, sampdx, 2, sp, sampfac, 190.0); - } - else { - cpack(0x905050); - sp= (short *)(sample->data); - - draw_wave(startsamp, endsamp, sampdx, 1, sp, sampfac, 128.0); - } -} - -static void draw_cfra_sound(SpaceSound *ssound) -{ - float vec[2]; - - if(ssound->flag & SND_CFRA_NUM) { - short mval[2]; - float x, y; - char str[32]; - /* little box with frame */ - - getmouseco_areawin(mval); - - if(mval[1]>curarea->winy-10) mval[1]= curarea->winy - 13; - - if (curarea->winy < 25) { - if (mval[1]<17) mval[1]= 17; - } else if (mval[1]<22) mval[1]= 22; - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - - if(ssound->flag & SND_DRAWFRAMES) - sprintf(str, " %d\n", CFRA); - else sprintf(str, " %.2f\n", FRA2TIME(CFRA)); - - glRasterPos2f(x, y); - glColor3ub(0, 0, 0); - BMF_DrawString(G.font, str); - - } - - vec[0]= (G.scene->r.cfra); - vec[0]*= G.scene->r.framelen; - - vec[1]= G.v2d->cur.ymin; - BIF_ThemeColor(TH_CFRAME); - glLineWidth(2.0); - - glBegin(GL_LINE_STRIP); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); - - glLineWidth(1.0); -} - -void drawsoundspace(ScrArea *sa, void *spacedata) -{ - float col[3]; - short ofsx, ofsy; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - calc_scrollrcts(sa, G.v2d, curarea->winx, curarea->winy); - - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= curarea->winrct.xmin; /* because mywin */ - ofsy= curarea->winrct.ymin; - glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - } - } - - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - - /* boundbox_seq(); */ - calc_ipogrid(); - draw_ipogrid(); - - if (G.ssound->sound) { - sound_initialize_sample(G.ssound->sound); - draw_sample(G.ssound->sound->sample); - } - - draw_cfra_sound(spacedata); - draw_markers_timespace(0); - - /* restore viewport */ - mywinset(curarea->win); - - /* ortho at pixel level curarea */ - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - - if(curarea->winx>SCROLLB+10 && curarea->winy>SCROLLH+10) { - if(G.v2d->scroll) { - drawscroll(0); - } - } - - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - draw_area_emboss(sa); - curarea->win_swap= WIN_BACK_OK; -} diff --git a/source/blender/src/drawtext.c b/source/blender/src/drawtext.c deleted file mode 100644 index b4026746a35..00000000000 --- a/source/blender/src/drawtext.c +++ /dev/null @@ -1,2230 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef _WIN32 -#include -#else -#include -#include "BLI_winstuff.h" -#endif -#include "MEM_guardedalloc.h" -#include "PIL_time.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_text_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" -#include "BKE_text.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_keyval.h" -#include "BIF_interface.h" -#include "BIF_drawtext.h" -#include "BIF_editfont.h" -#include "BIF_spacetypes.h" -#include "BIF_usiblender.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" - -#include "BSE_filesel.h" - -#include "BPY_extern.h" - -#include "mydevice.h" -#include "blendef.h" - -#define TEXTXLOC 38 - -/* forward declarations */ - -void drawtextspace(ScrArea *sa, void *spacedata); -void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); -void txt_copy_selectbuffer (Text *text); -void txt_paste_clipboard(Text *text); /* blank on non Win32 */ -void txt_copy_clipboard(Text *text); /* blank on non Win32 */ -void do_brackets(); - -int check_bracket(char *string); -static int check_delim(char *string); -static int check_numbers(char *string); -static int check_builtinfuncs(char *string); -static int check_specialvars(char *string); - -static void *last_txt_find_string= NULL; - -static BMF_Font *spacetext_get_font(SpaceText *st) { - static BMF_Font *scr12= NULL; - static BMF_Font *scr15= NULL; - - switch (st->font_id) { - default: - case 0: - if (!scr12) - scr12= BMF_GetFont(BMF_kScreen12); - return scr12; - case 1: - if (!scr15) - scr15= BMF_GetFont(BMF_kScreen15); - return scr15; - } -} - -static int spacetext_get_fontwidth(SpaceText *st) { - return BMF_GetCharacterWidth(spacetext_get_font(st), ' '); -} - -static char *temp_char_buf= NULL; -static int *temp_char_accum= NULL; -static int temp_char_len= 0; -static int temp_char_pos= 0; - -static void temp_char_write(char c, int accum) { - if (temp_char_len==0 || temp_char_pos>=temp_char_len) { - char *nbuf; int *naccum; - int olen= temp_char_len; - - if (olen) temp_char_len*= 2; - else temp_char_len= 256; - - nbuf= MEM_mallocN(sizeof(*temp_char_buf)*temp_char_len, "temp_char_buf"); - naccum= MEM_mallocN(sizeof(*temp_char_accum)*temp_char_len, "temp_char_accum"); - - if (olen) { - memcpy(nbuf, temp_char_buf, olen); - memcpy(naccum, temp_char_accum, olen); - - MEM_freeN(temp_char_buf); - MEM_freeN(temp_char_accum); - } - - temp_char_buf= nbuf; - temp_char_accum= naccum; - } - - temp_char_buf[temp_char_pos]= c; - temp_char_accum[temp_char_pos]= accum; - - if (c==0) temp_char_pos= 0; - else temp_char_pos++; -} - -void free_txt_data(void) { - txt_free_cut_buffer(); - - if (last_txt_find_string) MEM_freeN(last_txt_find_string); - if (temp_char_buf) MEM_freeN(temp_char_buf); - if (temp_char_accum) MEM_freeN(temp_char_accum); -} - -static int render_string (SpaceText *st, char *in) { - int r = 0, i = 0; - - while(*in) { - if (*in=='\t') { - if (temp_char_pos && *(in-1)=='\t') i= st->tabnumber; - else if (st->tabnumber > 0) i= st->tabnumber - (temp_char_pos%st->tabnumber); - while(i--) temp_char_write(' ', r); - } else temp_char_write(*in, r); - - r++; - in++; - } - r= temp_char_pos; - temp_char_write(0, 0); - - return r; -} - -void get_format_string(SpaceText *st) -{ - Text *text = st->text; - TextLine *tmp; - char *in_line; - char format[2000], check[200], other[2]; - unsigned char c; - int a, b, len, spot, letter, tabs, mem_amount; - - if(!text) return; - tmp = text->lines.first; - - while(tmp) { - in_line = tmp->line; - - len = strlen(in_line); - /* weak code... but we dont want crashes (ton) */ - if(len>2000-1) { - if (tmp->format) MEM_freeN(tmp->format); - tmp->format= NULL; - } - else { - - spot = 0; - tabs = 0; - //see how many tabs we have - for(a = 0; a tabnumber)-tabs)+2)+len; // +2 for good measure - if (tmp->format) MEM_freeN(tmp->format); - tmp->format = MEM_mallocN(mem_amount, "Syntax_format"); - - for (a = 0; a < len; a++) { - c = (unsigned char) in_line[a]; - - check[0] = c; - check[1] = '\0'; - - if (check_delim(check)) - { - switch (c) { - case '\"': - if(in_line[a] == '\"' && in_line[a+1] == '\"' && in_line[a+2] == '\"') { - format[spot] = format[spot+1] = format[spot+2] = 'l'; - spot +=3; - a += 3; - while(in_line[a] != '\"' || in_line[a-1] != '\"' || in_line[a-2] != '\"') { - c = (unsigned char) in_line[a]; - if(a >= len) { - format[spot] = '\0'; - memcpy(tmp->format, format, strlen(format)); - if(!(tmp= tmp->next)) { - return; - } else { - in_line = tmp->line; - len = strlen(in_line); - tabs = 0; - for(b = 0; b tabnumber)-tabs)+2)+len; - if (tmp->format) MEM_freeN(tmp->format); - tmp->format = MEM_mallocN(mem_amount, "Syntax_format"); - a = 0; spot = 0; - } - } else { - if(c == '\t' || c == ' ') { - if(c == '\t') { - for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = ' '; - spot++; - } - a++; - } else { - format[spot] = ' '; - a++; spot++; - } - } else { - format[spot] = 'l'; - a++; spot++; - } - } - } - format[spot] = 'l'; - spot++; - } else { - format[spot] = 'l'; - a++; spot++; - while(in_line[a] != '\"') { - c = (unsigned char) in_line[a]; - if(a >= len) { - format[spot] = '\0'; - memcpy(tmp->format, format, strlen(format)); - if(!(tmp= tmp->next)) { - return; - } else { - in_line = tmp->line; - len = strlen(in_line); - for(b = 0; b tabnumber)-tabs)+2)+len; - if (tmp->format) MEM_freeN(tmp->format); - tmp->format = MEM_mallocN(mem_amount, "Syntax_format"); - a = 0; spot = 0; - } - } - if(c == '\t' || c == ' ') { - if(c == '\t') { - for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = ' '; - spot++; - } - a++; - } else { - format[spot] = ' '; - a++; spot++; - } - } else { - format[spot] = 'l'; - a++; spot++; - } - } - format[spot] = 'l'; - spot++; - } - break; - case '\'': - if(in_line[a] == '\'' && in_line[a+1] == '\'' && in_line[a+2] == '\'') { - format[spot] = format[spot+1] = format[spot+2] = 'l'; - spot +=3; - a += 3; - while(in_line[a] != '\'' || in_line[a-1] != '\'' || in_line[a-2] != '\'') { - c = (unsigned char) in_line[a]; - if(a >= len) { - format[spot] = '\0'; - memcpy(tmp->format, format, strlen(format)); - if(!(tmp= tmp->next)) { - return; - } else { - in_line = tmp->line; - len = strlen(in_line); - tabs = 0; - for(b = 0; b tabnumber)-tabs)+2)+len; - if (tmp->format) MEM_freeN(tmp->format); - tmp->format = MEM_mallocN(mem_amount, "Syntax_format"); - a = 0; spot = 0; - } - } else { - if(c == '\t' || c == ' ') { - if(c == '\t') { - for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = ' '; - spot++; - } - a++; - } else { - format[spot] = ' '; - a++; spot++; - } - } else { - format[spot] = 'l'; - a++; spot++; - } - } - } - format[spot] = 'l'; - spot++; - } else { - format[spot] = 'l'; - a++; spot++; - while(in_line[a] != '\'') { - c = (unsigned char) in_line[a]; - if(a >= len) { - format[spot] = '\0'; - memcpy(tmp->format, format, strlen(format)); - if(!(tmp= tmp->next)) { - return; - } else { - in_line = tmp->line; - len = strlen(in_line); - for(b = 0; b tabnumber)-tabs)+2)+len; - if (tmp->format) MEM_freeN(tmp->format); - tmp->format = MEM_mallocN(mem_amount, "Syntax_format"); - a = 0; spot = 0; - } - } - if(c == '\t' || c == ' ') { - if(c == '\t') { - for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = ' '; - spot++; - } - a++; - } else { - format[spot] = ' '; - a++; spot++; - } - } else { - format[spot] = 'l'; - a++; spot++; - } - } - format[spot] = 'l'; - spot++; - } - break; - case '#': - while(atabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = '#'; - spot++; - } - a++; - } else { - format[spot] = '#'; - a++; spot++; - } - } else { - format[spot] = '#'; - a++; spot++; - } - } - break; - case ' ': - format[spot] = ' '; - spot++; - break; - case '\t': - for(b = st->tabnumber-(spot%st->tabnumber); b > 0; b--) { - format[spot] = ' '; - spot++; - } - break; - default: - format[spot] = 'q'; - spot++; - - break; - } - } else if (check_numbers(check)) { - while (a < len) { - c = (unsigned char) in_line[a]; - other[0] = c; - other[1] = '\0'; - if (check_delim(other) && c != '.') { - a--; break; - } else { - format[spot] = 'n'; - a++; spot++; - } - } - } else { - letter = 0; - while (a < len) { - c = (unsigned char) in_line[a]; - other[0] = c; - other[1] = '\0'; - if (check_delim(other)) { - a--; - break; - } else { - check[letter] = (unsigned char) in_line[a]; - letter++; - a++; - } - } - check[letter] = '\0'; - if (check_builtinfuncs(check)) { - for (b = 0; b < strlen(check); b++) { - format[spot] = 'b'; - spot++; - } - } else if (check_specialvars(check)) { /*If TRUE then color and color next word*/ - for (b = 0; b < strlen(check); b++) { - format[spot] = 'b'; - spot++; - } - a++; - format[spot] = 'q'; - spot++; a++; - letter = 0; - while (a < len) { - c = (unsigned char) in_line[a]; - other[0] = c; - other[1] = '\0'; - if (check_delim(other)) { - a--; - break; - } else { - check[letter] = (unsigned char) in_line[a]; - letter++; - a++; - } - } - check[letter] = '\0'; - for (b = 0; b < strlen(check); b++) { - format[spot] = 'v'; - spot++; - } - }else { - for (b = 0; b < strlen(check); b++) { - format[spot] = 'q'; - spot++; - } - } - } - } - format[spot] = '\0'; - memcpy(tmp->format, format, strlen(format)); - } - - tmp = tmp->next; - } -} - -static int text_draw(SpaceText *st, char *str, int cshift, int maxwidth, int draw, int x, int y, char *format) { - int r=0, w= 0; - char *in; - int *acc; - - w= render_string(st, str); - if(wshowsyntax && format) { - int amount, a; - char out[2]; - format = format+cshift; - - amount = strlen(in); - - for(a = 0; a < amount; a++) { - out[0] = (unsigned char) in[a]; - out[1] = '\0'; - switch (format[a]) { - case 'l': - BIF_ThemeColor(TH_SYNTAX_L); - break; - case 'b': - BIF_ThemeColor(TH_SYNTAX_B); - break; - case '#': - BIF_ThemeColor(TH_SYNTAX_C); - break; - case 'v': - BIF_ThemeColor(TH_SYNTAX_V); - break; - case 'n': - BIF_ThemeColor(TH_SYNTAX_N); - break; - case 'q': - BIF_ThemeColor(TH_TEXT); - break; - default: - BIF_ThemeColor(TH_TEXT); - break; - } - glRasterPos2i(x, y); - BMF_DrawString(spacetext_get_font(st), out); - x = x+BMF_GetStringWidth(spacetext_get_font(st), out); - } - } else { - glRasterPos2i(x, y); - BMF_DrawString(spacetext_get_font(st), in); - } - } else { - while (w-- && *acc++ < maxwidth) { - r+= spacetext_get_fontwidth(st); - } - } - - if (cshift && r==0) return 0; - else if (st->showlinenrs) - return r+TXT_OFFSET+TEXTXLOC; - else - return r+TXT_OFFSET; -} - -static void set_cursor_to_pos (SpaceText *st, int x, int y, int sel) -{ - Text *text; - TextLine **linep; - int *charp; - int w; - - text= st->text; - - if(sel) { linep= &text->sell; charp= &text->selc; } - else { linep= &text->curl; charp= &text->curc; } - - y= (curarea->winy - y)/st->lheight; - - y-= txt_get_span(text->lines.first, *linep) - st->top; - - if (y>0) { - while (y-- != 0) if((*linep)->next) *linep= (*linep)->next; - } else if (y<0) { - while (y++ != 0) if((*linep)->prev) *linep= (*linep)->prev; - } - - if(st->showlinenrs) - x-= TXT_OFFSET+TEXTXLOC; - else - x-= TXT_OFFSET; - - if (x<0) x= 0; - x = (x/spacetext_get_fontwidth(st)) + st->left; - - w= render_string(st, (*linep)->line); - if(xlen; - - if(!sel) txt_pop_sel(text); -} - -static void draw_cursor(SpaceText *st) { - int h, x, i; - Text *text= st->text; - TextLine *linef, *linel; - int charf, charl; - - if (text->curl==text->sell && text->curc==text->selc) { - x= text_draw(st, text->curl->line, st->left, text->curc, 0, 0, 0, NULL); - - if (x) { - h= txt_get_span(text->lines.first, text->curl) - st->top; - - BIF_ThemeColor(TH_HILITE); - - glRecti(x-1, curarea->winy-st->lheight*(h)-2, x+1, curarea->winy-st->lheight*(h+1)-2); - } - } else { - int span= txt_get_span(text->curl, text->sell); - - if (span<0) { - linef= text->sell; - charf= text->selc; - - linel= text->curl; - charl= text->curc; - } else if (span>0) { - linef= text->curl; - charf= text->curc; - - linel= text->sell; - charl= text->selc; - } else { - linef= linel= text->curl; - - if (text->curcselc) { - charf= text->curc; - charl= text->selc; - } else { - charf= text->selc; - charl= text->curc; - } - } - - /* Walk to the beginning of visible text */ - h= txt_get_span(text->lines.first, linef) - st->top; - while (h++<-1 && linef!=linel) linef= linef->next; - - x= text_draw(st, linef->line, st->left, charf, 0, 0, 0, NULL); - - BIF_ThemeColor(TH_SHADE2); - - if(st->showlinenrs) { - if (!x) x= TXT_OFFSET + TEXTXLOC -4; - } else { - if (!x) x= TXT_OFFSET - 4; - } - - while (linef && linef != linel) { - h= txt_get_span(text->lines.first, linef) - st->top; - if (h>st->viewlines) break; - - glRecti(x, curarea->winy-st->lheight*(h)-2, curarea->winx, curarea->winy-st->lheight*(h+1)-2); - if(st->showlinenrs) - glRecti(TXT_OFFSET+TEXTXLOC-4, curarea->winy-st->lheight*(h+1)-2, TXT_OFFSET+TEXTXLOC, curarea->winy-st->lheight*(h+2)-2); - else - glRecti(TXT_OFFSET-4, curarea->winy-st->lheight*(h+1)-2, TXT_OFFSET, curarea->winy-st->lheight*(h+2)-2); - - if(st->showlinenrs) - x= TXT_OFFSET + TEXTXLOC; - else - x= TXT_OFFSET; - - linef= linef->next; - } - - h= txt_get_span(text->lines.first, linef) - st->top; - - i= text_draw(st, linel->line, st->left, charl, 0, 0, 0, NULL); - if(i) glRecti(x, curarea->winy-st->lheight*(h)-2, i, curarea->winy-st->lheight*(h+1)-2); - - } - - do_brackets(); - BIF_ThemeColor(TH_TEXT); -} - -static void calc_text_rcts(SpaceText *st) -{ - int lhlstart, lhlend, ltexth; - short barheight, barstart, hlstart, hlend, blank_lines; - short pix_available, pix_top_margin, pix_bottom_margin, pix_bardiff; - - pix_top_margin = 8; - pix_bottom_margin = 4; - pix_available = curarea->winy - pix_top_margin - pix_bottom_margin; - ltexth= txt_get_span(st->text->lines.first, st->text->lines.last); - blank_lines = st->viewlines / 2; - - /* when resizing a vieport with the bar at the bottom to a greater height more blank lines will be added */ - if (ltexth + blank_lines < st->top + st->viewlines) { - blank_lines = st->top + st->viewlines - ltexth; - } - - ltexth += blank_lines; - - barheight = (st->viewlines*pix_available) / ltexth; - pix_bardiff = 0; - if (barheight < 20) { - pix_bardiff = 20 - barheight; /* take into account the now non-linear sizing of the bar */ - barheight = 20; - } - barstart = ((pix_available - pix_bardiff) * st->top) / ltexth; - - st->txtbar.xmin = 5; - st->txtbar.xmax = 17; - st->txtbar.ymax = curarea->winy - pix_top_margin - barstart; - st->txtbar.ymin = st->txtbar.ymax - barheight; - - CLAMP(st->txtbar.ymin, pix_bottom_margin, curarea->winy - pix_top_margin); - CLAMP(st->txtbar.ymax, pix_bottom_margin, curarea->winy - pix_top_margin); - - st->pix_per_line= (float) ltexth/pix_available; - if (st->pix_per_line<.1) st->pix_per_line=.1f; - - lhlstart = MIN2(txt_get_span(st->text->lines.first, st->text->curl), - txt_get_span(st->text->lines.first, st->text->sell)); - lhlend = MAX2(txt_get_span(st->text->lines.first, st->text->curl), - txt_get_span(st->text->lines.first, st->text->sell)); - - hlstart = (lhlstart * pix_available) / ltexth; - hlend = (lhlend * pix_available) / ltexth; - - /* the scrollbar is non-linear sized */ - if (pix_bardiff > 0) { - /* the start of the highlight is in the current viewport */ - if (lhlstart >= st->top && lhlstart <= st->top + st->viewlines) { - /* speed the progresion of the start of the highlight through the scrollbar */ - hlstart = ( ( (pix_available - pix_bardiff) * lhlstart) / ltexth) + (pix_bardiff * (lhlstart - st->top) / st->viewlines); - } - else if (lhlstart > st->top + st->viewlines && hlstart < barstart + barheight && hlstart > barstart) { - /* push hl start down */ - hlstart = barstart + barheight; - } - else if (lhlend > st->top && lhlstart < st->top && hlstart > barstart) { - /*fill out start */ - hlstart = barstart; - } - - if (hlend <= hlstart) { - hlend = hlstart + 2; - } - - /* the end of the highlight is in the current viewport */ - if (lhlend >= st->top && lhlend <= st->top + st->viewlines) { - /* speed the progresion of the end of the highlight through the scrollbar */ - hlend = (((pix_available - pix_bardiff )*lhlend)/ltexth) + (pix_bardiff * (lhlend - st->top)/st->viewlines); - } - else if (lhlend < st->top && hlend >= barstart - 2 && hlend < barstart + barheight) { - /* push hl end up */ - hlend = barstart; - } - else if (lhlend > st->top + st->viewlines && lhlstart < st->top + st->viewlines && hlend < barstart + barheight) { - /* fill out end */ - hlend = barstart + barheight; - } - - if (hlend <= hlstart) { - hlstart = hlend - 2; - } - } - - if (hlend - hlstart < 2) { - hlend = hlstart + 2; - } - - st->txtscroll.xmin= 5; - st->txtscroll.xmax= 17; - st->txtscroll.ymax= curarea->winy - pix_top_margin - hlstart; - st->txtscroll.ymin= curarea->winy - pix_top_margin - hlend; - - CLAMP(st->txtscroll.ymin, pix_bottom_margin, curarea->winy - pix_top_margin); - CLAMP(st->txtscroll.ymax, pix_bottom_margin, curarea->winy - pix_top_margin); -} - -static void draw_textscroll(SpaceText *st) -{ - if (!st->text) return; - - calc_text_rcts(st); - - BIF_ThemeColorShade(TH_SHADE1, -20); - glRecti(2, 2, 20, curarea->winy-6); - uiEmboss(2, 2, 20, curarea->winy-6, 1); - - BIF_ThemeColor(TH_SHADE1); - glRecti(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax); - - BIF_ThemeColor(TH_SHADE2); - glRecti(st->txtscroll.xmin, st->txtscroll.ymin, st->txtscroll.xmax, st->txtscroll.ymax); - - uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); -} - -static void screen_skip(SpaceText *st, int lines) -{ - int last; - - if (!st) return; - if (st->spacetype != SPACE_TEXT) return; - if (!st->text) return; - - st->top += lines; - - last= txt_get_span(st->text->lines.first, st->text->lines.last); - last= last - (st->viewlines/2); - - if (st->top>last) st->top= last; - if (st->top<0) st->top= 0; -} - -/* - * mode 1 == view scroll - * mode 2 == scrollbar - */ -static void do_textscroll(SpaceText *st, int mode) -{ - short delta[2]= {0, 0}; - short mval[2], hold[2], old[2]; - - if (!st->text) return; - - calc_text_rcts(st); - - st->flags|= ST_SCROLL_SELECT; - - glDrawBuffer(GL_FRONT); - uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); - bglFlush(); - glDrawBuffer(GL_BACK); - - getmouseco_areawin(mval); - old[0]= hold[0]= mval[0]; - old[1]= hold[1]= mval[1]; - - while(get_mbut()&(L_MOUSE|M_MOUSE)) { - getmouseco_areawin(mval); - - if(old[0]!=mval[0] || old[1]!=mval[1]) { - if (mode==1) { - delta[0]= (hold[0]-mval[0])/spacetext_get_fontwidth(st); - delta[1]= (mval[1]-hold[1])/st->lheight; - } - else delta[1]= (hold[1]-mval[1])*st->pix_per_line; - - if (delta[0] || delta[1]) { - screen_skip(st, delta[1]); - st->left+= delta[0]; - if (st->left<0) st->left= 0; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - hold[0]=mval[0]; - hold[1]=mval[1]; - } - old[0]=mval[0]; - old[1]=mval[1]; - } else { - BIF_wait_for_statechange(); - } - } - st->flags^= ST_SCROLL_SELECT; - - glDrawBuffer(GL_FRONT); - uiEmboss(st->txtbar.xmin, st->txtbar.ymin, st->txtbar.xmax, st->txtbar.ymax, st->flags & ST_SCROLL_SELECT); - bglFlush(); - glDrawBuffer(GL_BACK); -} - -static void do_selection(SpaceText *st, int selecting) -{ - short mval[2], old[2]; - int sell, selc; - int linep2, charp2; - int first= 1; - - getmouseco_areawin(mval); - old[0]= mval[0]; - old[1]= mval[1]; - - if (!selecting) { - int curl= txt_get_span(st->text->lines.first, st->text->curl); - int curc= st->text->curc; - int linep2, charp2; - - set_cursor_to_pos(st, mval[0], mval[1], 0); - - linep2= txt_get_span(st->text->lines.first, st->text->curl); - charp2= st->text->selc; - - if (curl!=linep2 || curc!=charp2) - txt_undo_add_toop(st->text, UNDO_CTO, curl, curc, linep2, charp2); - } - - sell= txt_get_span(st->text->lines.first, st->text->sell); - selc= st->text->selc; - - while(get_mbut()&L_MOUSE) { - getmouseco_areawin(mval); - - if (mval[1]<0 || mval[1]>curarea->winy) { - int d= (old[1]-mval[1])*st->pix_per_line; - if (d) screen_skip(st, d); - - set_cursor_to_pos(st, mval[0], mval[1]<0?0:curarea->winy, 1); - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } else if (mval[0]<0 || mval[0]>curarea->winx) { - if (mval[0]>curarea->winx) st->left++; - else if (mval[0]<0 && st->left>0) st->left--; - - set_cursor_to_pos(st, mval[0], mval[1], 1); - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - PIL_sleep_ms(10); - } else if (first || old[0]!=mval[0] || old[1]!=mval[1]) { - set_cursor_to_pos(st, mval[0], mval[1], 1); - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - old[0]= mval[0]; - old[1]= mval[1]; - first= 1; - } else { - BIF_wait_for_statechange(); - } - } - - linep2= txt_get_span(st->text->lines.first, st->text->sell); - charp2= st->text->selc; - - if (sell!=linep2 || selc!=charp2) - txt_undo_add_toop(st->text, UNDO_STO, sell, selc, linep2, charp2); -} - -void drawtextspace(ScrArea *sa, void *spacedata) -{ - SpaceText *st= curarea->spacedata.first; - Text *text; - int i; - TextLine *tmp; - char linenr[12]; - float col[3]; - int linecount = 0; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375); - - draw_area_emboss(sa); - - text= st->text; - if(!text) return; - - /* Make sure all the positional pointers exist */ - if (!text->curl || !text->sell || !text->lines.first || !text->lines.last) - txt_clean_text(text); - - if(st->lheight) st->viewlines= (int) curarea->winy/st->lheight; - else st->viewlines= 0; - - if(st->showlinenrs) { - cpack(0x8c787c); - glRecti(23, 0, (st->lheight==15)?63:59, curarea->winy - 2); - } - - BIF_ThemeColor(TH_TEXT); - - draw_cursor(st); - - tmp= text->lines.first; - for (i= 0; itop && tmp; i++) { - tmp= tmp->next; - linecount++; - } - - if(st->showsyntax) { - if (tmp && !tmp->format) { - get_format_string(st); - } - } - - for (i=0; iviewlines && tmp; i++, tmp= tmp->next) { - if(st->showlinenrs) { - BIF_ThemeColor(TH_TEXT); - if(((float)(i + linecount + 1)/10000.0) < 1.0) { - sprintf(linenr, "%4d", i + linecount + 1); - glRasterPos2i(TXT_OFFSET - 7, curarea->winy-st->lheight*(i+1)); - } else { - sprintf(linenr, "%5d", i + linecount + 1); - glRasterPos2i(TXT_OFFSET - 11, curarea->winy-st->lheight*(i+1)); - } - BMF_DrawString(spacetext_get_font(st), linenr); - text_draw(st, tmp->line, st->left, 0, 1, TXT_OFFSET + TEXTXLOC, curarea->winy-st->lheight*(i+1), tmp->format); - } else - text_draw(st, tmp->line, st->left, 0, 1, TXT_OFFSET, curarea->winy-st->lheight*(i+1), tmp->format); - } - - draw_textscroll(st); - - curarea->win_swap= WIN_BACK_OK; -} - -/* Moves the view to the cursor location, - also used to make sure the view isnt outside the file */ -void pop_space_text (SpaceText *st) -{ - int i, x; - - if(!st) return; - if(!st->text) return; - if(!st->text->curl) return; - - i= txt_get_span(st->text->lines.first, st->text->curl); - if (st->top+st->viewlines <= i || st->top > i) { - st->top= i - st->viewlines/2; - } - - x= text_draw(st, st->text->curl->line, st->left, st->text->curc, 0, 0, 0, NULL); - - if (x==0 || x>curarea->winx) { - st->left= st->text->curc-0.5*(curarea->winx)/spacetext_get_fontwidth(st); - } - - if (st->top < 0) st->top= 0; - if (st->left <0) st->left= 0; -} - -void add_text_fs(char *file) /* bad but cant pass an as arg here */ -{ - SpaceText *st= curarea->spacedata.first; - Text *text; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text= add_text(file); - - st->text= text; - - st->top= 0; - - if (st->showsyntax) get_format_string(st); - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); -} - -void free_textspace(SpaceText *st) -{ - if (!st) return; - - st->text= NULL; -} - -static void save_mem_text(char *str) -{ - SpaceText *st= curarea->spacedata.first; - Text *text; - - if (!str) return; - - if (!st) return; - if (st->spacetype != SPACE_TEXT) return; - - text= st->text; - if(!text) return; - - if (text->name) MEM_freeN(text->name); - text->name= MEM_mallocN(strlen(str)+1, "textname"); - strcpy(text->name, str); - - text->flags ^= TXT_ISMEM; - - txt_write_file(text); -} - -void txt_write_file(Text *text) -{ - FILE *fp; - TextLine *tmp; - - /* Do we need to get a filename? */ - if (text->flags & TXT_ISMEM) { - if (text->name) - activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->name, save_mem_text); - else - activate_fileselect(FILE_SPECIAL, "SAVE TEXT FILE", text->id.name+2, save_mem_text); - return; - } - - /* Should we ask to save over? */ - if (text->flags & TXT_ISTMP) { - if (BLI_exists(text->name)) { - if (!okee("Save over")) return; - } else if (!okee("Create new file")) return; - - text->flags ^= TXT_ISTMP; - } - - fp= fopen(text->name, "w"); - if (fp==NULL) { - error("Unable to save file"); - return; - } - - tmp= text->lines.first; - while (tmp) { - if (tmp->next) fprintf(fp, "%s\n", tmp->line); - else fprintf(fp, "%s", tmp->line); - - tmp= tmp->next; - } - - fclose (fp); - - if (text->flags & TXT_ISDIRTY) text->flags ^= TXT_ISDIRTY; -} - -void unlink_text(Text *text) -{ - bScreen *scr; - ScrArea *area; - SpaceLink *sl; - - /* check if this text was used as script link: - * this check function unsets the pointers and returns how many - * script links used this Text */ - if (BPY_check_all_scriptlinks (text)) { - allqueue(REDRAWBUTSSCRIPT, 0); - } - - for (scr= G.main->screen.first; scr; scr= scr->id.next) { - for (area= scr->areabase.first; area; area= area->next) { - for (sl= area->spacedata.first; sl; sl= sl->next) { - if (sl->spacetype==SPACE_TEXT) { - SpaceText *st= (SpaceText*) sl; - - if (st->text==text) { - st->text= NULL; - st->top= 0; - - if (st==area->spacedata.first) { - scrarea_queue_redraw(area); - } - } - } - } - } - } -} - -int jumptoline_interactive(SpaceText *st) { - short nlines= txt_get_span(st->text->lines.first, st->text->lines.last)+1; - short tmp= txt_get_span(st->text->lines.first, st->text->curl)+1; - - if (button(&tmp, 1, nlines, "Jump to line:")) { - txt_move_toline(st->text, tmp-1, 0); - pop_space_text(st); - return 1; - } else { - return 0; - } -} - - -int bufferlength; -static char *copybuffer = NULL; - -void txt_copy_selectbuffer (Text *text) -{ - int length=0; - TextLine *tmp, *linef, *linel; - int charf, charl; - - if (!text) return; - if (!text->curl) return; - if (!text->sell) return; - - if (!txt_has_sel(text)) return; - - if (copybuffer) { - MEM_freeN(copybuffer); - copybuffer= NULL; - } - - if (text->curl==text->sell) { - linef= linel= text->curl; - - if (text->curc < text->selc) { - charf= text->curc; - charl= text->selc; - } else{ - charf= text->selc; - charl= text->curc; - } - } else if (txt_get_span(text->curl, text->sell)<0) { - linef= text->sell; - linel= text->curl; - - charf= text->selc; - charl= text->curc; - } else { - linef= text->curl; - linel= text->sell; - - charf= text->curc; - charl= text->selc; - } - - if (linef == linel) { - length= charl-charf; - - copybuffer= MEM_mallocN(length+1, "cut buffera"); - - BLI_strncpy(copybuffer, linef->line + charf, length+1); - } else { - length+= linef->len - charf; - length+= charl; - length++; /* For the '\n' */ - - tmp= linef->next; - while (tmp && tmp!= linel) { - length+= tmp->len+1; - tmp= tmp->next; - } - - copybuffer= MEM_mallocN(length+1, "cut bufferb"); - - strncpy(copybuffer, linef->line+ charf, linef->len-charf); - length= linef->len-charf; - - copybuffer[length++]='\n'; - - tmp= linef->next; - while (tmp && tmp!=linel) { - strncpy(copybuffer+length, tmp->line, tmp->len); - length+= tmp->len; - - copybuffer[length++]='\n'; - - tmp= tmp->next; - } - strncpy(copybuffer+length, linel->line, charl); - length+= charl; - - copybuffer[length]=0; - } - - bufferlength = length; -} - - -#ifdef _WIN32 -static char *unixNewLine(char *buffer) -{ - char *p, *p2, *output; - - /* we can afford the few extra bytes */ - output= MEM_callocN(strlen(buffer)+1, "unixnewline"); - for (p= buffer, p2= output; *p; p++) - if (*p != '\r') *(p2++)= *p; - - *p2= 0; - return(output); -} - -static char *winNewLine(char *buffer) -{ - char *p, *p2, *output; - int add= 0; - - for (p= buffer; *p; p++) - if (*p == '\n') add++; - - bufferlength= p-buffer+add+1; - output= MEM_callocN(bufferlength, "winnewline"); - for (p= buffer, p2= output; *p; p++, p2++) { - if (*p == '\n') { - *(p2++)= '\r'; *p2= '\n'; - } else *p2= *p; - } - *p2= 0; - - return(output); -} -#endif - - -void txt_paste_clipboard(Text *text) { -#ifdef _WIN32 - char * buffer = NULL; - - if ( OpenClipboard(NULL) ) { - HANDLE hData = GetClipboardData( CF_TEXT ); - buffer = (char*)GlobalLock( hData ); - if (buffer) { - buffer = unixNewLine(buffer); - if (buffer) txt_insert_buf(text, buffer); - } - GlobalUnlock( hData ); - CloseClipboard(); - MEM_freeN(buffer); - } -#endif -} - -void txt_copy_clipboard(Text *text) { -#ifdef _WIN32 - txt_copy_selectbuffer(text); - - if (OpenClipboard(NULL)) { - HLOCAL clipbuffer; - char* buffer; - - if (copybuffer) { - copybuffer = winNewLine(copybuffer); - - EmptyClipboard(); - clipbuffer = LocalAlloc(LMEM_FIXED,((bufferlength+1))); - buffer = (char *) LocalLock(clipbuffer); - - strncpy(buffer, copybuffer, bufferlength); - buffer[bufferlength] = '\0'; - LocalUnlock(clipbuffer); - SetClipboardData(CF_TEXT,clipbuffer); - } - CloseClipboard(); - } - - if (copybuffer) { - MEM_freeN(copybuffer); - copybuffer= NULL; - } -#endif -} - -/* - * again==0 show find panel or find - * again==1 find text again */ -void txt_find_panel(SpaceText *st, int again) -{ - Text *text=st->text; - char *findstr= last_txt_find_string; - - if (again==0) { - findstr= txt_sel_to_buf(text); - } else if (again==1) { - char buf[256]; - - if (findstr && strlen(findstr)<(sizeof(buf)-1)) - strcpy(buf, findstr); - else - buf[0]= 0; - - if (sbutton(buf, 0, sizeof(buf)-1, "Find: ") && buf[0]) - findstr= BLI_strdup(buf); - else - findstr= NULL; - } - - if (findstr!=last_txt_find_string) { - if (last_txt_find_string) - MEM_freeN(last_txt_find_string); - last_txt_find_string= findstr; - } - - if (findstr) { - if (txt_find_string(text, findstr)) - pop_space_text(st); - else - error("Not found: %s", findstr); - } -} - -void run_python_script(SpaceText *st) -{ - char *py_filename; - Text *text=st->text; - - if (!BPY_txt_do_python_Text(text)) { - int lineno = BPY_Err_getLinenumber(); - // jump to error if happened in current text: - py_filename = (char*) BPY_Err_getFilename(); - - /* st->text can become NULL: user called Blender.Load(blendfile) - * before the end of the script. */ - if (!st->text) return; - - if (!strcmp(py_filename, st->text->id.name+2)) { - error("Python script error, check console"); - if (lineno >= 0) { - txt_move_toline(text, lineno-1, 0); - txt_sel_line(text); - pop_space_text(st); - } - } else { - error("Error in other (possibly external) file, "\ - "check console"); - } - } -} - -static void set_tabs(Text *text) -{ - SpaceText *st = curarea->spacedata.first; - st->currtab_set = setcurr_tab(text); -} - -void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - char ascii= evt->ascii; - SpaceText *st= curarea->spacedata.first; - Text *text; - int do_draw=0, p; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - /* smartass code to prevent the CTRL/ALT events below from not working! */ - if(G.qual & (LR_ALTKEY|LR_CTRLKEY)) - if(!ispunct(ascii)) - ascii= 0; - - text= st->text; - - if (!text) { - if (event==RIGHTMOUSE) { - switch (pupmenu("File %t|New %x0|Open... %x1")) { - case 0: - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - case 1: - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - break; - } - } - if (val && !ELEM(G.qual, 0, LR_SHIFTKEY)) { - if (event==FKEY && G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { - switch (pupmenu("File %t|New %x0|Open... %x1")) { - case 0: - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - case 1: - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - break; - } - } - else if (event==QKEY) { - if (G.qual & LR_CTRLKEY) { - if(okee("Quit Blender")) exit_usiblender(); - } - } - else if (event==NKEY) { - if (G.qual & LR_ALTKEY) { - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - } - } - else if (event==OKEY) { - if (G.qual & LR_ALTKEY) { - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - } - } - } - return; - } - - if (event==LEFTMOUSE) { - if (val) { - short mval[2]; - set_tabs(text); - getmouseco_areawin(mval); - - if (mval[0]>2 && mval[0]<20 && mval[1]>2 && mval[1]winy-2) { - do_textscroll(st, 2); - } else { - do_selection(st, G.qual&LR_SHIFTKEY); - do_draw= 1; - } - } - } else if (event==MIDDLEMOUSE) { - if (val) { - do_textscroll(st, 1); - } - } else if (event==RIGHTMOUSE) { - if (val) { - p= pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3|Execute Script%x4"); - - switch(p) { - case 0: - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - - case 1: - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - break; - - case 3: - text->flags |= TXT_ISMEM; - - case 2: - txt_write_file(text); - do_draw= 1; - break; - case 4: - run_python_script(st); - do_draw= 1; - break; - default: - break; - } - } - } else if (ascii) { - if (txt_add_char(text, ascii)) { - if (st->showsyntax) get_format_string(st); - pop_space_text(st); - do_draw= 1; - } - } else if (val) { - switch (event) { - case AKEY: - if (G.qual & LR_ALTKEY) { - txt_move_bol(text, G.qual & LR_SHIFTKEY); - do_draw= 1; - pop_space_text(st); - } else if (G.qual & LR_CTRLKEY) { - txt_sel_all(text); - do_draw= 1; - } - break; /* BREAK A */ - case CKEY: - if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) { - if(G.qual & LR_SHIFTKEY) - txt_copy_clipboard(text); - else - txt_copy_sel(text); - - do_draw= 1; - } - break; /* BREAK C */ - case DKEY: - if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) { - //uncommenting - txt_order_cursors(text); - uncomment(text); - do_draw = 1; - if (st->showsyntax) get_format_string(st); - break; - } else if (G.qual == LR_CTRLKEY) { - txt_delete_char(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - } - break; /* BREAK D */ - case EKEY: - if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { - switch(pupmenu("Edit %t|Cut %x0|Copy %x1|Paste %x2|Print Cut Buffer %x3")) { - case 0: - txt_cut_sel(text); - do_draw= 1; - break; - case 1: - txt_copy_sel(text); - do_draw= 1; - break; - case 2: - txt_paste(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - break; - case 3: - txt_print_cutbuffer(); - break; - } - } - else if (G.qual == LR_CTRLKEY || G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) { - txt_move_eol(text, G.qual & LR_SHIFTKEY); - do_draw= 1; - pop_space_text(st); - } - break; /* BREAK E */ - case FKEY: - if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { - switch(pupmenu("File %t|New %x0|Open... %x1|Save %x2|Save As...%x3")) { - case 0: - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - case 1: - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - break; - case 3: - text->flags |= TXT_ISMEM; - case 2: - txt_write_file(text); - do_draw= 1; - break; - } - } - else if (G.qual == LR_ALTKEY) { - if (txt_has_sel(text)) { - txt_find_panel(st,0); - do_draw= 1; - } - } - else if (G.qual == (LR_ALTKEY|LR_CTRLKEY)) { /* always search button */ - txt_find_panel(st,1); - do_draw= 1; - } - break; /* BREAK F */ - case JKEY: - if (G.qual == LR_ALTKEY) { - do_draw= jumptoline_interactive(st); - } - break; /* BREAK J */ - case MKEY: - if (G.qual == LR_ALTKEY) { - txt_export_to_object(text); - do_draw= 1; - } - break; /* BREAK M */ - case NKEY: - if (G.qual == LR_ALTKEY) { - st->text= add_empty_text("Text"); - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - - } - break; /* BREAK N */ - case OKEY: - if (G.qual == LR_ALTKEY) { - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - } - break; /* BREAK O */ - case PKEY: - if (G.qual == LR_ALTKEY) { - run_python_script(st); - do_draw= 1; - } - break; /* BREAK P */ - case QKEY: - if(okee("Quit Blender")) exit_usiblender(); - break; /* BREAK Q */ - case RKEY: - if (G.qual == LR_ALTKEY) { - if (text->compiled) BPY_free_compiled_text(text); - text->compiled = NULL; - if (okee("Reopen text")) { - if (!reopen_text(text)) - error("Could not reopen file"); - if (st->showsyntax) get_format_string(st); - } - do_draw= 1; - } - break; /* BREAK R */ - case SKEY: - if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { - p= pupmenu("Select %t|" - "Select All %x0|" - "Select Line %x1|" - "Jump to Line %x3"); - switch(p) { - case 0: - txt_sel_all(text); - do_draw= 1; - break; - - case 1: - txt_sel_line(text); - do_draw= 1; - break; - - case 3: - do_draw= jumptoline_interactive(st); - break; - } - } - else if (G.qual & LR_ALTKEY) { - /* Event treatment CANNOT enter this if - if (G.qual & LR_SHIFTKEY) - if (text) text->flags |= TXT_ISMEM; - */ - txt_write_file(text); - do_draw= 1; - } - break; /* BREAK S */ - case UKEY: - //txt_print_undo(text); //debug buffer in console - if (G.qual == (LR_ALTKEY|LR_SHIFTKEY)) { - txt_do_redo(text); - do_draw= 1; - } - if (G.qual == LR_ALTKEY) { - txt_do_undo(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - } - break; /* BREAK U */ - case VKEY: - if (G.qual == (LR_ALTKEY| LR_SHIFTKEY)) { - switch(pupmenu("View %t|Top of File %x0|Bottom of File %x1|Page Up %x2|Page Down %x3")) { - case 0: - txt_move_bof(text, 0); - do_draw= 1; - pop_space_text(st); - break; - case 1: - txt_move_eof(text, 0); - do_draw= 1; - pop_space_text(st); - break; - case 2: - screen_skip(st, -st->viewlines); - do_draw= 1; - break; - case 3: - screen_skip(st, st->viewlines); - do_draw= 1; - break; - } - } - /* Support for both Alt-V and Ctrl-V for Paste, for backward compatibility reasons */ - else if (G.qual & LR_ALTKEY || G.qual & LR_CTRLKEY) { - /* Throwing in the Shift modifier Paste from the OS clipboard */ - if (G.qual & LR_SHIFTKEY) - txt_paste_clipboard(text); - else - txt_paste(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - } - break; /* BREAK V */ - case XKEY: - if (G.qual == LR_ALTKEY || G.qual == LR_CTRLKEY) { - txt_cut_sel(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - } - break; - case ZKEY: - if (G.qual & (LR_ALTKEY|LR_CTRLKEY|LR_COMMANDKEY)) { - if (G.qual & LR_SHIFTKEY) { - txt_do_redo(text); - } else { - txt_do_undo(text); - } - if (st->showsyntax) get_format_string(st); - do_draw= 1; - } - break; - case TABKEY: - if (G.qual & LR_SHIFTKEY) { - if (txt_has_sel(text)) { - txt_order_cursors(text); - unindent(text); - - } - } else { - if ( txt_has_sel(text)) { - txt_order_cursors(text); - indent(text); - } else { - txt_add_char(text, '\t'); - } - } - if (st->showsyntax) get_format_string(st); - pop_space_text(st); - do_draw= 1; - st->currtab_set = setcurr_tab(text); - break; - case RETKEY: - //double check tabs before splitting the line - st->currtab_set = setcurr_tab(text); - txt_split_curline(text); - { - int a = 0; - if (a < st->currtab_set) - { - while ( a < st->currtab_set) { - txt_add_char(text, '\t'); - a++; - } - } - } - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - break; - case BACKSPACEKEY: - txt_backspace_char(text); - set_tabs(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - break; - case DELKEY: - txt_delete_char(text); - if (st->showsyntax) get_format_string(st); - do_draw= 1; - pop_space_text(st); - st->currtab_set = setcurr_tab(text); - break; - case DOWNARROWKEY: - txt_move_down(text, G.qual & LR_SHIFTKEY); - set_tabs(text); - do_draw= 1; - pop_space_text(st); - break; - case LEFTARROWKEY: - if (G.qual & LR_COMMANDKEY) - txt_move_bol(text, G.qual & LR_SHIFTKEY); - else - txt_move_left(text, G.qual & LR_SHIFTKEY); - set_tabs(text); - do_draw= 1; - pop_space_text(st); - break; - case RIGHTARROWKEY: - if (G.qual & LR_COMMANDKEY) - txt_move_eol(text, G.qual & LR_SHIFTKEY); - else - txt_move_right(text, G.qual & LR_SHIFTKEY); - set_tabs(text); - do_draw= 1; - pop_space_text(st); - break; - case UPARROWKEY: - txt_move_up(text, G.qual & LR_SHIFTKEY); - set_tabs(text); - do_draw= 1; - pop_space_text(st); - break; - case PAGEDOWNKEY: - screen_skip(st, st->viewlines); - do_draw= 1; - break; - case PAGEUPKEY: - screen_skip(st, -st->viewlines); - do_draw= 1; - break; - case HOMEKEY: - txt_move_bol(text, G.qual & LR_SHIFTKEY); - do_draw= 1; - pop_space_text(st); - break; - case ENDKEY: - txt_move_eol(text, G.qual & LR_SHIFTKEY); - do_draw= 1; - pop_space_text(st); - break; - case WHEELUPMOUSE: - screen_skip(st, -U.wheellinescroll); - do_draw= 1; - break; - case WHEELDOWNMOUSE: - screen_skip(st, U.wheellinescroll); - do_draw= 1; - break; - } - } - - if (do_draw) { - ScrArea *sa; - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } - } -} - -void do_brackets(void) -{ - SpaceText *st = curarea->spacedata.first; - Text *text = st->text; - TextLine *tmp, *start; - char test[2]; - int d, pos, open, x, y, x2, y2, h=0; - - if(!text) return; - - tmp = text->curl; - start = text->curl; - - test[0] = (unsigned char) tmp->line[text->curc]; - test[1] = '\0'; - - d = check_bracket(test); - if (!d) /* If not pri char */ - { - test[0] = (unsigned char) tmp->line[text->curc-1]; - test[1] = '\0'; - d = check_bracket(test); - if(!d) { - return; /*If the current char or prev is not a bracket then return*/ - } else { /* current char */ - h= txt_get_span(text->lines.first, start) - st->top; - x = text_draw(st, start->line, st->left, text->curc-1, 0, 0, 0, NULL); - y = text_draw(st, start->line, st->left, text->curc, 0, 0, 0, NULL); - if (d < 4) { - pos = text->curc; - } else { - pos = text->curc-2; - } - } - } else { /* is pri char */ - h= txt_get_span(text->lines.first, start) - st->top; - x = text_draw(st, start->line, st->left, text->curc, 0, 0, 0, NULL); - y = text_draw(st, start->line, st->left, text->curc+1, 0, 0, 0, NULL); - if (d < 4) { - pos = text->curc+1; - } else { - pos = text->curc-1; - } - } - - if (d < 4) /*reading forward*/ - { - open = 1; - while ( tmp ) { - while (pos <= tmp->len) { - test[0] = (unsigned char) tmp->line[pos]; - test[1] = '\0'; - if(check_bracket(test) == d) { - open++; - } else if (check_bracket(test) == d+3) { - open--; - if (open == 0) { - BIF_ThemeColorBlend(TH_BACK, TH_SHADE2, 0.5); - glRecti(x, curarea->winy-st->lheight*(h)-2, y, curarea->winy-st->lheight*(h+1)-2); - - h= txt_get_span(text->lines.first, tmp) - st->top; - x2= text_draw(st, tmp->line, st->left, pos, 0, 0, 0, NULL); - y2= text_draw(st, tmp->line, st->left, pos+1, 0, 0, 0, NULL); - glRecti(x2, curarea->winy-st->lheight*(h)-2, y2, curarea->winy-st->lheight*(h+1)-2); - BIF_ThemeColor(TH_TEXT); - return; - } - } - pos++; - } - tmp = tmp->next; - pos = 0; - } - } else { /* reading back */ - open = 1; - while ( tmp ) { - while (pos >= 0) { - test[0] = (unsigned char) tmp->line[pos]; - test[1] = '\0'; - if(check_bracket(test) == d) { - open++; - } else if (check_bracket(test) == d-3) { - open--; - if (open == 0) { - BIF_ThemeColorBlend(TH_BACK, TH_SHADE2, 0.5); - glRecti(x, curarea->winy-st->lheight*(h)-2, y, curarea->winy-st->lheight*(h+1)-2); - - h= txt_get_span(text->lines.first, tmp) - st->top; - x2= text_draw(st, tmp->line, st->left, pos, 0, 0, 0, NULL); - y2= text_draw(st, tmp->line, st->left, pos+1, 0, 0, 0, NULL); - glRecti(x2, curarea->winy-st->lheight*(h)-2, y2, curarea->winy-st->lheight*(h+1)-2); - BIF_ThemeColor(TH_TEXT); - return; - } - } - pos--; - } - tmp = tmp->prev; - if (tmp) { - pos = tmp->len; - } - } - } - -} - -int check_bracket(char *string) -{ - int number, a = 0; - char other[][3] = {"(", "[", "{", ")", "]", "}"}; - - number = 6; - - while(a < number) { - if(strcmp(other[a], string) == 0) - { - return a+1; - } - a++; - } - return 0; -} - -static int check_builtinfuncs(char *string) -{ - int number = 30, a = 0; - - char builtinfuncs[][11] = {"and", "as", "assert", "break", "class", "continue", "def", - "del", "elif", "else", "except", "exec", "finally", - "for", "from", "global", "if", "import", "in", - "is", "lambda", "not", "or", "pass", "print", - "raise", "return", "try", "while", "yield"}; - - for( a = 0; a < number; a++) { - if(!strcmp(builtinfuncs[a], string)) - return 1; - } - return 0; -} - -static int check_specialvars(char *string) -{ - int number = 2, a = 0; - char specialvars[][7] = {"def", "class"}; - - for( a = 0; a < number; a++) { - if(!strcmp(specialvars[a], string)) - return a+1; - } - return 0; -} - -static int check_delim(char *string) -{ - int number = 28, a = 0; - char other[][3] = {"(", ")", ":", "\"", "\'", " ", "~", "!", "%", "^", "&", "*", "-", "+", "=", "[", "]", "{", "}", ";", "/", "<", ">", "|", ".", "#", "\t", ","}; - - for( a = 0; a < number; a++) { - if(!strcmp(other[a], string)) - return 1; - } - return 0; -} - -static int check_numbers(char *string) -{ - int number = 10, a = 0; - char other[][2] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; - - for( a = 0; a < number; a++) { - if(!strcmp(other[a], string)) - return 1; - } - return 0; -} - -void convert_tabs (struct SpaceText *st, int tab) -{ - Text *text = st->text; - TextLine *tmp; - char *check_line, *new_line, *format; - int a, j, extra, number; //unknown for now - - if (!text) return; - - tmp = text->lines.first; - - //first convert to all space, this make it alot easier to convert to tabs because there is no mixtures of ' ' && '\t' - while(tmp) { - check_line = tmp->line; - new_line = MEM_mallocN(render_string(st, check_line)+1, "Converted_Line"); - format = MEM_mallocN(render_string(st, check_line)+1, "Converted_Syntax_format"); - j = 0; - for (a=0; a < strlen(check_line); a++) { //foreach char in line - if(check_line[a] == '\t') { //checking for tabs - //get the number of spaces this tabs is showing - //i dont like doing it this way but will look into it later - new_line[j] = '\0'; - number = render_string(st, new_line); - new_line[j] = '\t'; - new_line[j+1] = '\0'; - number = render_string(st, new_line)-number; - for(extra = 0; extra < number; extra++) { - new_line[j] = ' '; - j++; - } - } else { - new_line[j] = check_line[a]; - ++j; - } - } - new_line[j] = '\0'; - // put new_line in the tmp->line spot still need to try and set the curc correctly - if (tmp->line) MEM_freeN(tmp->line); - if(tmp->format) MEM_freeN(tmp->format); - - tmp->line = new_line; - tmp->len = strlen(new_line); - tmp->format = format; - tmp = tmp->next; - } - - if (tab) // Converting to tabs - { //start over from the begining - tmp = text->lines.first; - - while(tmp) { - check_line = tmp->line; - extra = 0; - for (a = 0; a < strlen(check_line); a++) { - number = 0; - for (j = 0; j < st->tabnumber; j++) { - if ((a+j) <= strlen(check_line)) { //check to make sure we are not pass the end of the line - if(check_line[a+j] != ' ') { - number = 1; - } - } - } - if (!number) { //found all number of space to equal a tab - a = a+(st->tabnumber-1); - extra = extra+1; - } - } - - if ( extra > 0 ) { //got tabs make malloc and do what you have to do - new_line = MEM_mallocN(strlen(check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Line"); - format = MEM_mallocN(strlen(check_line)-(((st->tabnumber*extra)-extra)-1), "Converted_Syntax_format"); - extra = 0; //reuse vars - for (a = 0; a < strlen(check_line); a++) { - number = 0; - for (j = 0; j < st->tabnumber; j++) { - if ((a+j) <= strlen(check_line)) { //check to make sure we are not pass the end of the line - if(check_line[a+j] != ' ') { - number = 1; - } - } - } - if (!number) { //found all number of space to equal a tab - new_line[extra] = '\t'; - a = a+(st->tabnumber-1); - ++extra; - - } else { //not adding a tab - new_line[extra] = check_line[a]; - ++extra; - } - } - new_line[extra] = '\0'; - // put new_line in the tmp->line spot still need to try and set the curc correctly - if (tmp->line) MEM_freeN(tmp->line); - if(tmp->format) MEM_freeN(tmp->format); - - tmp->line = new_line; - tmp->len = strlen(new_line); - tmp->format = format; - } - tmp = tmp->next; - } - } -} diff --git a/source/blender/src/drawtime.c b/source/blender/src/drawtime.c deleted file mode 100644 index 3743d6c963e..00000000000 --- a/source/blender/src/drawtime.c +++ /dev/null @@ -1,454 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_sound_types.h" -#include "DNA_view2d_types.h" - -#include "BKE_ipo.h" -#include "BKE_object.h" -#include "BKE_material.h" -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_editaction.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_resources.h" -#include "BIF_language.h" - -#include "BSE_drawipo.h" -#include "BSE_view.h" - -#include "blendef.h" -#include "interface.h" /* for ui_rasterpos_safe */ - -#define TIMELINE_STIPPLE \ -{ \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, \ - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0 \ -} - -/* ---- prototypes ------ */ -void drawtimespace(ScrArea *, void *); - - -static void draw_cfra_time(SpaceTime *stime) -{ - float vec[2]; - - vec[0]= (G.scene->r.cfra); - vec[0]*= G.scene->r.framelen; - - vec[1]= G.v2d->cur.ymin; - BIF_ThemeColor(TH_CFRAME); // no theme, should be global color once... - glLineWidth(3.0); - - glBegin(GL_LINES); - glVertex2fv(vec); - vec[1]= G.v2d->cur.ymax; - glVertex2fv(vec); - glEnd(); - - glLineWidth(1.0); - - if(stime->flag & TIME_CFRA_NUM) { - short mval[2]; - float x, y; - float xscale, yscale; - char str[32]; - - /* little box with frame drawn beside */ - - glFlush(); // huhh... without this glColor won't work for the text... - getmouseco_areawin(mval); - - if(mval[1]>curarea->winy-10) mval[1]= curarea->winy - 13; - - if (curarea->winy < 25) { - if (mval[1]<17) mval[1]= 17; - } else if (mval[1]<22) mval[1]= 22; - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - - if(stime->flag & TIME_DRAWFRAMES) - sprintf(str, " %d", CFRA); - else sprintf(str, " %.2f", FRA2TIME(CFRA)); - - /* HACK! somehow the green color won't go away... */ - glColor4ub(0, 0, 0, 0); - BIF_ThemeColor(TH_TEXT); - - xscale = (G.v2d->mask.xmax-G.v2d->mask.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - yscale = (G.v2d->mask.ymax-G.v2d->mask.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - - /* because the frame number text is subject to the same scaling as the contents of the view */ - glScalef( 1.0/xscale, 1.0/yscale, 1.0); - - ui_rasterpos_safe(x * xscale, y * yscale, 1.0); - BIF_DrawString(G.fonts, str, 0); - glScalef(xscale, yscale, 1.0); - } - -} - -static void draw_marker(TimeMarker *marker, int lines) -{ - float xpos, ypixels, xscale, yscale; - - xpos = marker->frame; - /* no time correction for framelen! space is drawn with old values */ - - ypixels= G.v2d->mask.ymax-G.v2d->mask.ymin; - xscale = (G.v2d->mask.xmax-G.v2d->mask.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin); - yscale = (G.v2d->mask.ymax-G.v2d->mask.ymin)/(G.v2d->cur.ymax-G.v2d->cur.ymin); - - glScalef( 1.0/xscale, 1.0/yscale, 1.0); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* verticle line */ - if (lines) { - setlinestyle(3); - if(marker->flag & SELECT) - glColor4ub(255,255,255, 96); - else - glColor4ub(0,0,0, 96); - - glBegin(GL_LINES); - glVertex2f((xpos*xscale)+0.5, 12); - glVertex2f((xpos*xscale)+0.5, 34*yscale); /* a bit lazy but we know it cant be greater then 34 strips high*/ - glEnd(); - setlinestyle(0); - } - - /* 5 px to offset icon to align properly, space / pixels corrects for zoom */ - if(marker->flag & SELECT) - BIF_icon_draw(xpos*xscale-5.0, 12.0, ICON_MARKER_HLT); - else - BIF_icon_draw(xpos*xscale-5.0, 12.0, ICON_MARKER); - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - - /* and the marker name too, shifted slightly to the top-right */ - if(marker->name && marker->name[0]) { - if(marker->flag & SELECT) { - BIF_ThemeColor(TH_TEXT_HI); - ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0); - } - else { - BIF_ThemeColor(TH_TEXT); - if((marker->frame <= G.scene->r.cfra) && (marker->frame+5 > G.scene->r.cfra)) - ui_rasterpos_safe(xpos*xscale+4.0, (ypixels<=39.0)?(ypixels-10.0):29.0, 1.0); - else - ui_rasterpos_safe(xpos*xscale+4.0, 17.0, 1.0); - } - BIF_DrawString(G.font, marker->name, 0); - } - glScalef(xscale, yscale, 1.0); -} - -static void draw_markers_time(int lines) -{ - TimeMarker *marker; - - /* unselected markers are drawn at the first time */ - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(!(marker->flag & SELECT)) draw_marker(marker, lines); - } - - /* selected markers are drawn later ... selected markers have to cover unselected - * markers laying at the same position as selected markers - * (jiri: it is hack, it could be solved better) */ - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) draw_marker(marker, lines); - } -} - -void draw_markers_timespace(int lines) -{ - TimeMarker *marker; - float yspace, ypixels; - - /* move ortho view to align with slider in bottom */ - glTranslatef(0.0f, G.v2d->cur.ymin, 0.0f); - - /* bad hacks in drawing markers... inverse correct that as well */ - yspace= G.v2d->cur.ymax - G.v2d->cur.ymin; - ypixels= G.v2d->mask.ymax - G.v2d->mask.ymin; - glTranslatef(0.0f, -11.0*yspace/ypixels, 0.0f); - - /* unselected markers are drawn at the first time */ - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(!(marker->flag & SELECT)) draw_marker(marker, lines); - } - - /* selected markers are drawn later ... selected markers have to cover unselected - * markers laying at the same position as selected markers */ - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) draw_marker(marker, lines); - } - - glTranslatef(0.0f, -G.v2d->cur.ymin, 0.0f); - glTranslatef(0.0f, 11.0*yspace/ypixels, 0.0f); - -} - -void draw_anim_preview_timespace() -{ - /* only draw this if preview range is set */ - if (G.scene->r.psfra) { - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glEnable(GL_BLEND); - glColor4f(0, 0, 0, 0.4); - - if (PSFRA < PEFRA) { - glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax); - glRectf(PEFRA, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax); - } - else { - glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax); - } - - glDisable(GL_BLEND); - } -} - -static void draw_sfra_efra() -{ - BIF_ThemeColorShade(TH_BACK, -25); - - if (PSFRA < PEFRA) { - glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax); - glRectf(PEFRA, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax); - } - else { - glRectf(G.v2d->cur.xmin, G.v2d->cur.ymin, G.v2d->cur.xmax, G.v2d->cur.ymax); - } - - BIF_ThemeColorShade(TH_BACK, -60); - /* thin lines where the actual frames are */ - fdrawline(PSFRA, G.v2d->cur.ymin, PSFRA, G.v2d->cur.ymax); - fdrawline(PEFRA, G.v2d->cur.ymin, PEFRA, G.v2d->cur.ymax); - - glDisable(GL_BLEND); -} - -static void draw_mapoldnew() -{ - float anim_end; /* the end of the blender frames that are actually animated (map old)*/ - float frames_end; /* the end of the frames that get rendered and saved to disk (map new) */ - GLubyte timeline_stipple[32*32/8] = TIMELINE_STIPPLE; - - if (G.scene->r.framelen == 1.0) return; - - anim_end = PEFRA * G.scene->r.framelen; - frames_end = PEFRA; - - glEnable(GL_POLYGON_STIPPLE); - glPolygonStipple(timeline_stipple); - BIF_ThemeColorShade(TH_BACK, -65); - - if (anim_end < frames_end) - glRectf(anim_end, G.v2d->cur.ymin, frames_end, G.v2d->cur.ymax); - - glDisable(GL_POLYGON_STIPPLE); -} - -/*draw all the keys in a list (elems) as lines */ -static void draw_key_list(ListBase elems, char col[3]) -{ - CfraElem *ce; - float drawframe; - - ce= elems.first; - while(ce) { - drawframe = ce->cfra; //not correct for G.scene->r.framelen; - glColor3ub(col[0], col[1], col[2]); - - fdrawline(drawframe, G.v2d->cur.ymin, drawframe, G.v2d->cur.ymax); - - ce= ce->next; - } -} - -/* This function draws keyframes that the active object has (as long as - * it is not in EditMode). Some filters are available to optimise the - * drawing efficiency. - */ -static void draw_ob_keys() -{ - /* mostly copied from drawobject.c, draw_object() */ - SpaceTime *stime= curarea->spacedata.first; - ListBase elems= {0, 0}; - - Object *ob= OBACT; - short filter, ok; - char col[3]; - int a; - - if (ob && ob!=G.obedit) { - /* Object's IPO block - show all keys */ - if (ob->ipo) { - /* convert the ipo to a list of 'current frame elements' */ - elems.first= elems.last= NULL; - make_cfra_list(ob->ipo, &elems); - - /* draw the list of current frame elements */ - col[0] = 0xDD; col[1] = 0xD7; col[2] = 0x00; - draw_key_list(elems, col); - - BLI_freelistN(&elems); - } - - /* Object's Action block - may be filtered in some cases */ - if (ob->action) { - bAction *act = ob->action; - bActionChannel *achan; - - /* only apply filter if action is likely to be for pose channels + filter is on */ - filter= ((stime->flag & TIME_ONLYACTSEL) && - (ob->pose) && (ob->flag & OB_POSEMODE)); - - /* go through each channel in the action */ - for (achan=act->chanbase.first; achan; achan=achan->next) { - /* if filtering, check if this channel passes */ - if (filter) { - ok= (SEL_ACHAN(achan))? 1 : 0; - } - else ok= 1; - - /* convert the ipo to a list of 'current frame elements' */ - if (achan->ipo && ok) { - elems.first= elems.last= NULL; - make_cfra_list(achan->ipo, &elems); - - col[0] = 0x00; col[1] = 0x82; col[2] = 0x8B; - draw_key_list(elems, col); - - BLI_freelistN(&elems); - } - } - } - - /* Materials (only relevant for geometry objects) - some filtering might occur */ - filter= (stime->flag & TIME_ONLYACTSEL); - for (a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a+1); - - /* the only filter we apply right now is only showing the active material */ - if (filter) { - ok= (ob->actcol==a)? 1 : 0; - } - else ok= 1; - - if (ma && ma->ipo && ok) { - elems.first= elems.last= NULL; - make_cfra_list(ma->ipo, &elems); - - col[0] = 0xDD; col[1] = 0xA7; col[2] = 0x00; - draw_key_list(elems, col); - - BLI_freelistN(&elems); - } - } - } -} - -void drawtimespace(ScrArea *sa, void *spacedata) -{ - SpaceTime *stime= sa->spacedata.first; - float col[3]; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - calc_scrollrcts(sa, &(stime->v2d), curarea->winx, curarea->winy); - - myortho2(stime->v2d.cur.xmin, stime->v2d.cur.xmax, stime->v2d.cur.ymin, stime->v2d.cur.ymax); - - /* draw darkened area outside of active timeline - * frame range used is preview range or scene range - */ - draw_sfra_efra(); - draw_mapoldnew(); - - /* boundbox_seq(); */ - calc_ipogrid(); - draw_ipogrid(); - - draw_cfra_time(spacedata); - draw_ob_keys(); - draw_markers_time(0); - - /* restore viewport */ - mywinset(curarea->win); - - /* ortho at pixel level curarea */ - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - - /* the bottom with time values */ - BIF_ThemeColor(TH_HEADER); - glRectf(0.0f, 0.0f, (float)curarea->winx, 12.0f); - BIF_ThemeColorShade(TH_HEADER, 50); - fdrawline(0.0f, 12.0f, (float)curarea->winx, 12.0f); - draw_view2d_numbers_horiz(stime->flag & TIME_DRAWFRAMES); - - draw_area_emboss(sa); - curarea->win_swap= WIN_BACK_OK; -} diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c deleted file mode 100644 index 5568cc17231..00000000000 --- a/source/blender/src/drawview.c +++ /dev/null @@ -1,3633 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -//#define NAN_LINEAR_PHYSICS - -#include -#include - -#ifndef WIN32 -#include -#include -#else -#include -#endif - -#ifdef WIN32 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BMF_Api.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_camera_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_group_types.h" -#include "DNA_image_types.h" -#include "DNA_key_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_meta_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_force.h" -#include "DNA_object_types.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_anim.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_customdata.h" -#include "BKE_displist.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" -#include "BKE_lattice.h" -#include "BKE_library.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_pointcache.h" -#include "BKE_scene.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BIF_butspace.h" -#include "BIF_drawimage.h" -#include "BIF_editgroup.h" -#include "BIF_editarmature.h" -#include "BIF_editmesh.h" -#include "BIF_editparticle.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BDR_drawmesh.h" -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "BDR_vpaint.h" -#include "BDR_sculptmode.h" - -#include "BSE_drawview.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_seqaudio.h" -#include "BSE_sequence.h" -#include "BSE_trans_types.h" -#include "BSE_time.h" -#include "BSE_view.h" - -#include "BPY_extern.h" - -#include "RE_render_ext.h" - -#include "blendef.h" -#include "mydevice.h" -#include "butspace.h" // event codes - -#include "BIF_transform.h" - -#include "RE_pipeline.h" // make_stars - -#include "multires.h" - -/* For MULTISAMPLE_ARB #define. - Note that older systems like irix - may not have this, and will need a #ifdef - to disable it.*/ -/* #include "GL/glext.h" Disabled for release, to avoid possibly breaking platforms. - Instead, the define we need will just be #defined if it's not in the platform opengl.h. -*/ - -/* Modules used */ -#include "radio.h" - -/* locals */ -void drawname(Object *ob); - -static void star_stuff_init_func(void) -{ - cpack(-1); - glPointSize(1.0); - glBegin(GL_POINTS); -} -static void star_stuff_vertex_func(float* i) -{ - glVertex3fv(i); -} -static void star_stuff_term_func(void) -{ - glEnd(); -} - -void default_gl_light(void) -{ - int a; - - /* initialize */ - if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) { - U.light[0].flag= 1; - U.light[0].vec[0]= -0.3; U.light[0].vec[1]= 0.3; U.light[0].vec[2]= 0.9; - U.light[0].col[0]= 0.8; U.light[0].col[1]= 0.8; U.light[0].col[2]= 0.8; - U.light[0].spec[0]= 0.5; U.light[0].spec[1]= 0.5; U.light[0].spec[2]= 0.5; - U.light[0].spec[3]= 1.0; - - U.light[1].flag= 0; - U.light[1].vec[0]= 0.5; U.light[1].vec[1]= 0.5; U.light[1].vec[2]= 0.1; - U.light[1].col[0]= 0.4; U.light[1].col[1]= 0.4; U.light[1].col[2]= 0.8; - U.light[1].spec[0]= 0.3; U.light[1].spec[1]= 0.3; U.light[1].spec[2]= 0.5; - U.light[1].spec[3]= 1.0; - - U.light[2].flag= 0; - U.light[2].vec[0]= 0.3; U.light[2].vec[1]= -0.3; U.light[2].vec[2]= -0.2; - U.light[2].col[0]= 0.8; U.light[2].col[1]= 0.5; U.light[2].col[2]= 0.4; - U.light[2].spec[0]= 0.5; U.light[2].spec[1]= 0.4; U.light[2].spec[2]= 0.3; - U.light[2].spec[3]= 1.0; - } - - - glLightfv(GL_LIGHT0, GL_POSITION, U.light[0].vec); - glLightfv(GL_LIGHT0, GL_DIFFUSE, U.light[0].col); - glLightfv(GL_LIGHT0, GL_SPECULAR, U.light[0].spec); - - glLightfv(GL_LIGHT1, GL_POSITION, U.light[1].vec); - glLightfv(GL_LIGHT1, GL_DIFFUSE, U.light[1].col); - glLightfv(GL_LIGHT1, GL_SPECULAR, U.light[1].spec); - - glLightfv(GL_LIGHT2, GL_POSITION, U.light[2].vec); - glLightfv(GL_LIGHT2, GL_DIFFUSE, U.light[2].col); - glLightfv(GL_LIGHT2, GL_SPECULAR, U.light[2].spec); - - for(a=0; a<8; a++) { - if(a<3) { - if(U.light[a].flag) glEnable(GL_LIGHT0+a); - else glDisable(GL_LIGHT0+a); - - // clear stuff from other opengl lamp usage - glLightf(GL_LIGHT0+a, GL_SPOT_CUTOFF, 180.0); - glLightf(GL_LIGHT0+a, GL_CONSTANT_ATTENUATION, 1.0); - glLightf(GL_LIGHT0+a, GL_LINEAR_ATTENUATION, 0.0); - } - else glDisable(GL_LIGHT0+a); - } - - glDisable(GL_LIGHTING); - - glDisable(GL_COLOR_MATERIAL); -} - -/* also called when render 'ogl' */ -void init_gl_stuff(void) -{ - float mat_ambient[] = { 0.0, 0.0, 0.0, 0.0 }; - float mat_specular[] = { 0.5, 0.5, 0.5, 1.0 }; - float mat_shininess[] = { 35.0 }; - int a, x, y; - GLubyte pat[32*32]; - const GLubyte *patc= pat; - - - glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient); - glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular); - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess); - - default_gl_light(); - - /* no local viewer, looks ugly in ortho mode */ - /* glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, &one); */ - - glDepthFunc(GL_LEQUAL); - /* scaling matrices */ - glEnable(GL_NORMALIZE); - - glShadeModel(GL_FLAT); - - glDisable(GL_ALPHA_TEST); - glDisable(GL_BLEND); - glDisable(GL_DEPTH_TEST); - glDisable(GL_FOG); - glDisable(GL_LIGHTING); - glDisable(GL_LOGIC_OP); - glDisable(GL_STENCIL_TEST); - glDisable(GL_TEXTURE_1D); - glDisable(GL_TEXTURE_2D); - - /* default on, disable/enable should be local per function */ - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - glPixelTransferi(GL_MAP_COLOR, GL_FALSE); - glPixelTransferi(GL_RED_SCALE, 1); - glPixelTransferi(GL_RED_BIAS, 0); - glPixelTransferi(GL_GREEN_SCALE, 1); - glPixelTransferi(GL_GREEN_BIAS, 0); - glPixelTransferi(GL_BLUE_SCALE, 1); - glPixelTransferi(GL_BLUE_BIAS, 0); - glPixelTransferi(GL_ALPHA_SCALE, 1); - glPixelTransferi(GL_ALPHA_BIAS, 0); - - glPixelTransferi(GL_DEPTH_BIAS, 0); - glPixelTransferi(GL_DEPTH_SCALE, 1); - glDepthRange(0.0, 1.0); - - a= 0; - for(x=0; x<32; x++) { - for(y=0; y<4; y++) { - if( (x) & 1) pat[a++]= 0x88; - else pat[a++]= 0x22; - } - } - - glPolygonStipple(patc); - - - init_realtime_GL(); -} - -void circf(float x, float y, float rad) -{ - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_FILL); - - glPushMatrix(); - - glTranslatef(x, y, 0.); - - gluDisk( qobj, 0.0, rad, 32, 1); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - -void circ(float x, float y, float rad) -{ - GLUquadricObj *qobj = gluNewQuadric(); - - gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); - - glPushMatrix(); - - glTranslatef(x, y, 0.); - - gluDisk( qobj, 0.0, rad, 32, 1); - - glPopMatrix(); - - gluDeleteQuadric(qobj); -} - -/* ********** ********** */ - -static void draw_bgpic(void) -{ - BGpic *bgpic; - Image *ima; - ImBuf *ibuf= NULL; - float vec[4], fac, asp, zoomx, zoomy; - float x1, y1, x2, y2, cx, cy; - - bgpic= G.vd->bgpic; - if(bgpic==NULL) return; - - ima= bgpic->ima; - - if(ima) - ibuf= BKE_image_get_ibuf(ima, &bgpic->iuser); - if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL) ) - return; - if(ibuf->channels!=4) - return; - if(ibuf->rect==NULL) - IMB_rect_from_float(ibuf); - - if(G.vd->persp==2) { - rctf vb; - - calc_viewborder(G.vd, &vb); - - x1= vb.xmin; - y1= vb.ymin; - x2= vb.xmax; - y2= vb.ymax; - } - else { - float sco[2]; - - /* calc window coord */ - initgrabz(0.0, 0.0, 0.0); - window_to_3d(vec, 1, 0); - fac= MAX3( fabs(vec[0]), fabs(vec[1]), fabs(vec[1]) ); - fac= 1.0/fac; - - asp= ( (float)ibuf->y)/(float)ibuf->x; - - vec[0] = vec[1] = vec[2] = 0.0; - view3d_project_float(curarea, vec, sco, G.vd->persmat); - cx = sco[0]; - cy = sco[1]; - - x1= cx+ fac*(bgpic->xof-bgpic->size); - y1= cy+ asp*fac*(bgpic->yof-bgpic->size); - x2= cx+ fac*(bgpic->xof+bgpic->size); - y2= cy+ asp*fac*(bgpic->yof+bgpic->size); - } - - /* complete clip? */ - - if(x2 < 0 ) return; - if(y2 < 0 ) return; - if(x1 > curarea->winx ) return; - if(y1 > curarea->winy ) return; - - zoomx= (x2-x1)/ibuf->x; - zoomy= (y2-y1)/ibuf->y; - - /* for some reason; zoomlevels down refuses to use GL_ALPHA_SCALE */ - if(zoomx < 1.0f || zoomy < 1.0f) { - float tzoom= MIN2(zoomx, zoomy); - int mip= 0; - - if(ibuf->mipmap[0]==NULL) - IMB_makemipmap(ibuf, 0); - - while(tzoom < 1.0f && mip<8 && ibuf->mipmap[mip]) { - tzoom*= 2.0f; - zoomx*= 2.0f; - zoomy*= 2.0f; - mip++; - } - if(mip>0) - ibuf= ibuf->mipmap[mip-1]; - } - - if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - glaDefine2DArea(&curarea->winrct); - - glEnable(GL_BLEND); - - glPixelZoom(zoomx, zoomy); - glColor4f(1.0, 1.0, 1.0, 1.0-bgpic->blend); - glaDrawPixelsTex(x1, y1, ibuf->x, ibuf->y, GL_UNSIGNED_BYTE, ibuf->rect); - - glPixelZoom(1.0, 1.0); - glPixelTransferf(GL_ALPHA_SCALE, 1.0f); - - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - glDisable(GL_BLEND); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - - areawinset(curarea->win); // restore viewport / scissor -} - -static void drawgrid_draw(float wx, float wy, float x, float y, float dx) -{ - float fx, fy; - - x+= (wx); - y+= (wy); - fx= x/dx; - fx= x-dx*floor(fx); - - while(fx< curarea->winx) { - fdrawline(fx, 0.0, fx, (float)curarea->winy); - fx+= dx; - } - - fy= y/dx; - fy= y-dx*floor(fy); - - - while(fy< curarea->winy) { - fdrawline(0.0, fy, (float)curarea->winx, fy); - fy+= dx; - } - -} - -// not intern, called in editobject for constraint axis too -void make_axis_color(char *col, char *col2, char axis) -{ - if(axis=='x') { - col2[0]= col[0]>219?255:col[0]+36; - col2[1]= col[1]<26?0:col[1]-26; - col2[2]= col[2]<26?0:col[2]-26; - } - else if(axis=='y') { - col2[0]= col[0]<46?0:col[0]-36; - col2[1]= col[1]>189?255:col[1]+66; - col2[2]= col[2]<46?0:col[2]-36; - } - else { - col2[0]= col[0]<26?0:col[0]-26; - col2[1]= col[1]<26?0:col[1]-26; - col2[2]= col[2]>209?255:col[2]+46; - } - -} - -static void drawgrid(void) -{ - /* extern short bgpicmode; */ - float wx, wy, x, y, fw, fx, fy, dx; - float vec4[4]; - char col[3], col2[3]; - short sublines = G.vd->gridsubdiv; - - vec4[0]=vec4[1]=vec4[2]=0.0; - vec4[3]= 1.0; - Mat4MulVec4fl(G.vd->persmat, vec4); - fx= vec4[0]; - fy= vec4[1]; - fw= vec4[3]; - - wx= (curarea->winx/2.0); /* because of rounding errors, grid at wrong location */ - wy= (curarea->winy/2.0); - - x= (wx)*fx/fw; - y= (wy)*fy/fw; - - vec4[0]=vec4[1]=G.vd->grid; - vec4[2]= 0.0; - vec4[3]= 1.0; - Mat4MulVec4fl(G.vd->persmat, vec4); - fx= vec4[0]; - fy= vec4[1]; - fw= vec4[3]; - - dx= fabs(x-(wx)*fx/fw); - if(dx==0) dx= fabs(y-(wy)*fy/fw); - - glDepthMask(0); // disable write in zbuffer - - /* check zoom out */ - BIF_ThemeColor(TH_GRID); - persp(PERSP_WIN); - - if(dx<6.0) { - G.vd->gridview*= sublines; - dx*= sublines; - - if(dx<6.0) { - G.vd->gridview*= sublines; - dx*= sublines; - - if(dx<6.0) { - G.vd->gridview*= sublines; - dx*=sublines; - if(dx<6.0); - else { - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, dx); - } - } - else { // start blending out - BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0); - drawgrid_draw(wx, wy, x, y, dx); - - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, sublines*dx); - } - } - else { // start blending out (6 < dx < 60) - BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0); - drawgrid_draw(wx, wy, x, y, dx); - - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, sublines*dx); - } - } - else { - if(dx>60.0) { // start blending in - G.vd->gridview/= sublines; - dx/= sublines; - if(dx>60.0) { // start blending in - G.vd->gridview/= sublines; - dx/= sublines; - if(dx>60.0) { - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, dx); - } - else { - BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0); - drawgrid_draw(wx, wy, x, y, dx); - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, dx*sublines); - } - } - else { - BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0); - drawgrid_draw(wx, wy, x, y, dx); - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, dx*sublines); - } - } - else { - BIF_ThemeColorBlend(TH_BACK, TH_GRID, dx/60.0); - drawgrid_draw(wx, wy, x, y, dx); - BIF_ThemeColor(TH_GRID); - drawgrid_draw(wx, wy, x, y, dx*sublines); - } - } - - x+= (wx); - y+= (wy); - BIF_GetThemeColor3ubv(TH_GRID, col); - - setlinestyle(0); - - /* center cross */ - if(G.vd->view==3) make_axis_color(col, col2, 'y'); - else make_axis_color(col, col2, 'x'); - glColor3ubv((GLubyte *)col2); - - fdrawline(0.0, y, (float)curarea->winx, y); - - if(G.vd->view==7) make_axis_color(col, col2, 'y'); - else make_axis_color(col, col2, 'z'); - glColor3ubv((GLubyte *)col2); - - fdrawline(x, 0.0, x, (float)curarea->winy); - - glDepthMask(1); // enable write in zbuffer - persp(PERSP_VIEW); -} - - - -static void drawfloor(void) -{ - View3D *vd; - float vert[3], grid; - int a, gridlines, emphasise; - char col[3], col2[3]; - short draw_line = 0; - - vd= curarea->spacedata.first; - - vert[2]= 0.0; - - if(vd->gridlines<3) return; - - if(G.vd->zbuf && G.obedit) glDepthMask(0); // for zbuffer-select - - gridlines= vd->gridlines/2; - grid= gridlines*vd->grid; - - BIF_GetThemeColor3ubv(TH_GRID, col); - BIF_GetThemeColor3ubv(TH_BACK, col2); - - /* emphasise division lines lighter instead of darker, if background is darker than grid */ - if ( ((col[0]+col[1]+col[2])/3+10) > (col2[0]+col2[1]+col2[2])/3 ) - emphasise = 20; - else - emphasise = -10; - - /* draw the Y axis and/or grid lines */ - for(a= -gridlines;a<=gridlines;a++) { - if(a==0) { - /* check for the 'show Y axis' preference */ - if (vd->gridflag & V3D_SHOW_Y) { - make_axis_color(col, col2, 'y'); - glColor3ubv((GLubyte *)col2); - - draw_line = 1; - } else if (vd->gridflag & V3D_SHOW_FLOOR) { - BIF_ThemeColorShade(TH_GRID, emphasise); - } else { - draw_line = 0; - } - } else { - /* check for the 'show grid floor' preference */ - if (vd->gridflag & V3D_SHOW_FLOOR) { - if( (a % 10)==0) { - BIF_ThemeColorShade(TH_GRID, emphasise); - } - else BIF_ThemeColorShade(TH_GRID, 10); - - draw_line = 1; - } else { - draw_line = 0; - } - } - - if (draw_line) { - glBegin(GL_LINE_STRIP); - vert[0]= a*vd->grid; - vert[1]= grid; - glVertex3fv(vert); - vert[1]= -grid; - glVertex3fv(vert); - glEnd(); - } - } - - /* draw the X axis and/or grid lines */ - for(a= -gridlines;a<=gridlines;a++) { - if(a==0) { - /* check for the 'show X axis' preference */ - if (vd->gridflag & V3D_SHOW_X) { - make_axis_color(col, col2, 'x'); - glColor3ubv((GLubyte *)col2); - - draw_line = 1; - } else if (vd->gridflag & V3D_SHOW_FLOOR) { - BIF_ThemeColorShade(TH_GRID, emphasise); - } else { - draw_line = 0; - } - } else { - /* check for the 'show grid floor' preference */ - if (vd->gridflag & V3D_SHOW_FLOOR) { - if( (a % 10)==0) { - BIF_ThemeColorShade(TH_GRID, emphasise); - } - else BIF_ThemeColorShade(TH_GRID, 10); - - draw_line = 1; - } else { - draw_line = 0; - } - } - - if (draw_line) { - glBegin(GL_LINE_STRIP); - vert[1]= a*vd->grid; - vert[0]= grid; - glVertex3fv(vert ); - vert[0]= -grid; - glVertex3fv(vert); - glEnd(); - } - } - - /* draw the Z axis line */ - /* check for the 'show Z axis' preference */ - if (vd->gridflag & V3D_SHOW_Z) { - make_axis_color(col, col2, 'z'); - glColor3ubv((GLubyte *)col2); - - glBegin(GL_LINE_STRIP); - vert[0]= 0; - vert[1]= 0; - vert[2]= grid; - glVertex3fv(vert ); - vert[2]= -grid; - glVertex3fv(vert); - glEnd(); - } - - if(G.vd->zbuf && G.obedit) glDepthMask(1); - -} - -static void drawcursor(View3D *v3d) -{ - short mx,my,co[2]; - int flag; - - /* we dont want the clipping for cursor */ - flag= v3d->flag; - v3d->flag= 0; - project_short( give_cursor(), co); - v3d->flag= flag; - - mx = co[0]; - my = co[1]; - - if(mx!=IS_CLIPPED) { - setlinestyle(0); - cpack(0xFF); - circ((float)mx, (float)my, 10.0); - setlinestyle(4); - cpack(0xFFFFFF); - circ((float)mx, (float)my, 10.0); - setlinestyle(0); - cpack(0x0); - - sdrawline(mx-20, my, mx-5, my); - sdrawline(mx+5, my, mx+20, my); - sdrawline(mx, my-20, mx, my-5); - sdrawline(mx, my+5, mx, my+20); - } -} - -/* ********* custom clipping *********** */ - -static void view3d_draw_clipping(View3D *v3d) -{ - BoundBox *bb= v3d->clipbb; - - BIF_ThemeColorShade(TH_BACK, -8); - - glBegin(GL_QUADS); - - glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[3]); - glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[1]); - glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[5]); - glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[3]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[6]); - glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[2]); - glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[3]); - - glEnd(); -} - -void view3d_set_clipping(View3D *v3d) -{ - double plane[4]; - int a; - - for(a=0; a<4; a++) { - QUATCOPY(plane, v3d->clip[a]); - glClipPlane(GL_CLIP_PLANE0+a, plane); - glEnable(GL_CLIP_PLANE0+a); - } -} - -void view3d_clr_clipping(void) -{ - int a; - - for(a=0; a<4; a++) { - glDisable(GL_CLIP_PLANE0+a); - } -} - -int view3d_test_clipping(View3D *v3d, float *vec) -{ - /* vec in world coordinates, returns 1 if clipped */ - float view[3]; - - VECCOPY(view, vec); - - if(0.0f < v3d->clip[0][3] + INPR(view, v3d->clip[0])) - if(0.0f < v3d->clip[1][3] + INPR(view, v3d->clip[1])) - if(0.0f < v3d->clip[2][3] + INPR(view, v3d->clip[2])) - if(0.0f < v3d->clip[3][3] + INPR(view, v3d->clip[3])) - return 0; - - return 1; -} - -/* ********* end custom clipping *********** */ - -static void view3d_get_viewborder_size(View3D *v3d, float size_r[2]) -{ - float winmax= MAX2(v3d->area->winx, v3d->area->winy); - float aspect= (float) (G.scene->r.xsch*G.scene->r.xasp)/(G.scene->r.ysch*G.scene->r.yasp); - - if(aspect>1.0) { - size_r[0]= winmax; - size_r[1]= winmax/aspect; - } else { - size_r[0]= winmax*aspect; - size_r[1]= winmax; - } -} - -void calc_viewborder(struct View3D *v3d, rctf *viewborder_r) -{ - float zoomfac, size[2]; - float dx= 0.0f, dy= 0.0f; - - view3d_get_viewborder_size(v3d, size); - - /* magic zoom calculation, no idea what - * it signifies, if you find out, tell me! -zr - */ - /* simple, its magic dude! - * well, to be honest, this gives a natural feeling zooming - * with multiple keypad presses (ton) - */ - - zoomfac= (M_SQRT2 + v3d->camzoom/50.0); - zoomfac= (zoomfac*zoomfac)*0.25; - - size[0]= size[0]*zoomfac; - size[1]= size[1]*zoomfac; - - /* center in window */ - viewborder_r->xmin= 0.5*v3d->area->winx - 0.5*size[0]; - viewborder_r->ymin= 0.5*v3d->area->winy - 0.5*size[1]; - viewborder_r->xmax= viewborder_r->xmin + size[0]; - viewborder_r->ymax= viewborder_r->ymin + size[1]; - - dx= v3d->area->winx*G.vd->camdx*zoomfac*2.0f; - dy= v3d->area->winy*G.vd->camdy*zoomfac*2.0f; - - /* apply offset */ - viewborder_r->xmin-= dx; - viewborder_r->ymin-= dy; - viewborder_r->xmax-= dx; - viewborder_r->ymax-= dy; - - if(v3d->camera && v3d->camera->type==OB_CAMERA) { - Camera *cam= v3d->camera->data; - float w = viewborder_r->xmax - viewborder_r->xmin; - float h = viewborder_r->ymax - viewborder_r->ymin; - float side = MAX2(w, h); - - viewborder_r->xmin+= cam->shiftx*side; - viewborder_r->xmax+= cam->shiftx*side; - viewborder_r->ymin+= cam->shifty*side; - viewborder_r->ymax+= cam->shifty*side; - } -} - -void view3d_set_1_to_1_viewborder(View3D *v3d) -{ - float size[2]; - int im_width= (G.scene->r.size*G.scene->r.xsch)/100; - - view3d_get_viewborder_size(v3d, size); - - v3d->camzoom= (sqrt(4.0*im_width/size[0]) - M_SQRT2)*50.0; - v3d->camzoom= CLAMPIS(v3d->camzoom, -30, 300); -} - - -static void drawviewborder_flymode(void) -{ - /* draws 4 edge brackets that frame the safe area where the - mouse can move during fly mode without spinning the view */ - float x1, x2, y1, y2; - - x1= 0.45*(float)curarea->winx; - y1= 0.45*(float)curarea->winy; - x2= 0.55*(float)curarea->winx; - y2= 0.55*(float)curarea->winy; - cpack(0); - - - glBegin(GL_LINES); - /* bottom left */ - glVertex2f(x1,y1); - glVertex2f(x1,y1+5); - - glVertex2f(x1,y1); - glVertex2f(x1+5,y1); - - /* top right */ - glVertex2f(x2,y2); - glVertex2f(x2,y2-5); - - glVertex2f(x2,y2); - glVertex2f(x2-5,y2); - - /* top left */ - glVertex2f(x1,y2); - glVertex2f(x1,y2-5); - - glVertex2f(x1,y2); - glVertex2f(x1+5,y2); - - /* bottom right */ - glVertex2f(x2,y1); - glVertex2f(x2,y1+5); - - glVertex2f(x2,y1); - glVertex2f(x2-5,y1); - glEnd(); -} - - -static void drawviewborder(void) -{ - extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); // interface_panel.c - float fac, a; - float x1, x2, y1, y2; - float x3, y3, x4, y4; - rctf viewborder; - Camera *ca= NULL; - - if(G.vd->camera==NULL) - return; - if(G.vd->camera->type==OB_CAMERA) - ca = G.vd->camera->data; - - calc_viewborder(G.vd, &viewborder); - x1= viewborder.xmin; - y1= viewborder.ymin; - x2= viewborder.xmax; - y2= viewborder.ymax; - - /* passepartout, specified in camera edit buttons */ - if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT) && ca->passepartalpha > 0.000001) { - if (ca->passepartalpha == 1.0) { - glColor3f(0, 0, 0); - } else { - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - glEnable(GL_BLEND); - glColor4f(0, 0, 0, ca->passepartalpha); - } - if (x1 > 0.0) - glRectf(0.0, (float)curarea->winy, x1, 0.0); - if (x2 < (float)curarea->winx) - glRectf(x2, (float)curarea->winy, (float)curarea->winx, 0.0); - if (y2 < (float)curarea->winy) - glRectf(x1, (float)curarea->winy, x2, y2); - if (y2 > 0.0) - glRectf(x1, y1, x2, 0.0); - - glDisable(GL_BLEND); - } - - /* edge */ - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - setlinestyle(0); - BIF_ThemeColor(TH_BACK); - glRectf(x1, y1, x2, y2); - - setlinestyle(3); - BIF_ThemeColor(TH_WIRE); - glRectf(x1, y1, x2, y2); - - /* camera name - draw in highlighted text color */ - if (ca && (ca->flag & CAM_SHOWNAME)) { - BIF_ThemeColor(TH_TEXT_HI); - glRasterPos2f(x1, y1-15); - - BMF_DrawString(G.font, G.vd->camera->id.name+2); - BIF_ThemeColor(TH_WIRE); - } - - - /* border */ - if(G.scene->r.mode & R_BORDER) { - - cpack(0); - x3= x1+ G.scene->r.border.xmin*(x2-x1); - y3= y1+ G.scene->r.border.ymin*(y2-y1); - x4= x1+ G.scene->r.border.xmax*(x2-x1); - y4= y1+ G.scene->r.border.ymax*(y2-y1); - - cpack(0x4040FF); - glRectf(x3, y3, x4, y4); - } - - /* safety border */ - if (ca && (ca->flag & CAM_SHOWTITLESAFE)) { - fac= 0.1; - - a= fac*(x2-x1); - x1+= a; - x2-= a; - - a= fac*(y2-y1); - y1+= a; - y2-= a; - - BIF_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0); - - uiSetRoundBox(15); - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, 12.0); - } - - setlinestyle(0); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - -} - -void backdrawview3d(int test) -{ - struct Base *base; - -/*for 2.43 release, don't use glext and just define the constant. - this to avoid possibly breaking platforms before release.*/ -#ifndef GL_MULTISAMPLE_ARB - #define GL_MULTISAMPLE_ARB 0x809D -#endif - -#ifdef GL_MULTISAMPLE_ARB - int m; -#endif - - if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT); - else if(G.obedit && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)); - else { - G.vd->flag &= ~V3D_NEEDBACKBUFDRAW; - return; - } - - if( !(G.vd->flag & V3D_NEEDBACKBUFDRAW) ) return; - - if(test) { - if(qtest()) { - addafterqueue(curarea->win, BACKBUFDRAW, 1); - return; - } - } - persp(PERSP_VIEW); - - /*Disable FSAA for backbuffer selection. - - Only works if GL_MULTISAMPLE_ARB is defined by the header - file, which is should be for every OS that supports FSAA.*/ - -#ifdef GL_MULTISAMPLE_ARB - m = glIsEnabled(GL_MULTISAMPLE_ARB); - if (m) glDisable(GL_MULTISAMPLE_ARB); -#endif - -#ifdef __APPLE__ - glDrawBuffer(GL_AUX0); -#endif - if(G.vd->drawtype > OB_WIRE) G.vd->zbuf= TRUE; - curarea->win_swap &= ~WIN_BACK_OK; - - glDisable(GL_DITHER); - - glClearColor(0.0, 0.0, 0.0, 0.0); - if(G.vd->zbuf) { - glEnable(GL_DEPTH_TEST); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } - else { - glClear(GL_COLOR_BUFFER_BIT); - glDisable(GL_DEPTH_TEST); - } - - if(G.vd->flag & V3D_CLIPPING) - view3d_set_clipping(G.vd); - - G.f |= G_BACKBUFSEL; - - base= (G.scene->basact); - if(base && (base->lay & G.vd->lay)) { - draw_object_backbufsel(base->object); - } - - G.vd->flag &= ~V3D_NEEDBACKBUFDRAW; - - G.f &= ~G_BACKBUFSEL; - G.vd->zbuf= FALSE; - glDisable(GL_DEPTH_TEST); - glEnable(GL_DITHER); - -#ifdef __APPLE__ - glDrawBuffer(GL_BACK); /* we were in aux buffers */ -#endif - - if(G.vd->flag & V3D_CLIPPING) - view3d_clr_clipping(); - -#ifdef GL_MULTISAMPLE_ARB - if (m) glEnable(GL_MULTISAMPLE_ARB); -#endif - - /* it is important to end a view in a transform compatible with buttons */ - persp(PERSP_WIN); // set ortho - bwin_scalematrix(curarea->win, G.vd->blockscale, G.vd->blockscale, G.vd->blockscale); - -} - -void check_backbuf(void) -{ - if(G.vd->flag & V3D_NEEDBACKBUFDRAW) - backdrawview3d(0); -} - -/* samples a single pixel (copied from vpaint) */ -unsigned int sample_backbuf(int x, int y) -{ - unsigned int col; - - if(x>=curarea->winx || y>=curarea->winy) return 0; - x+= curarea->winrct.xmin; - y+= curarea->winrct.ymin; - - check_backbuf(); // actually not needed for apple - -#ifdef __APPLE__ - glReadBuffer(GL_AUX0); -#endif - glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); - glReadBuffer(GL_BACK); - - if(G.order==B_ENDIAN) SWITCH_INT(col); - - return framebuffer_to_index(col); -} - -/* reads full rect, converts indices */ -ImBuf *read_backbuf(short xmin, short ymin, short xmax, short ymax) -{ - unsigned int *dr, *rd; - struct ImBuf *ibuf, *ibuf1; - int a; - short xminc, yminc, xmaxc, ymaxc, xs, ys; - - /* clip */ - if(xmin<0) xminc= 0; else xminc= xmin; - if(xmax>=curarea->winx) xmaxc= curarea->winx-1; else xmaxc= xmax; - if(xminc > xmaxc) return NULL; - - if(ymin<0) yminc= 0; else yminc= ymin; - if(ymax>=curarea->winy) ymaxc= curarea->winy-1; else ymaxc= ymax; - if(yminc > ymaxc) return NULL; - - ibuf= IMB_allocImBuf((xmaxc-xminc+1), (ymaxc-yminc+1), 32, IB_rect,0); - - check_backbuf(); // actually not needed for apple - -#ifdef __APPLE__ - glReadBuffer(GL_AUX0); -#endif - glReadPixels(curarea->winrct.xmin+xminc, curarea->winrct.ymin+yminc, (xmaxc-xminc+1), (ymaxc-yminc+1), GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - glReadBuffer(GL_BACK); - - if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); - - a= (xmaxc-xminc+1)*(ymaxc-yminc+1); - dr= ibuf->rect; - while(a--) { - if(*dr) *dr= framebuffer_to_index(*dr); - dr++; - } - - /* put clipped result back, if needed */ - if(xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax) - return ibuf; - - ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect,0); - rd= ibuf->rect; - dr= ibuf1->rect; - - for(ys= ymin; ys<=ymax; ys++) { - for(xs= xmin; xs<=xmax; xs++, dr++) { - if( xs>=xminc && xs<=xmaxc && ys>=yminc && ys<=ymaxc) { - *dr= *rd; - rd++; - } - } - } - IMB_freeImBuf(ibuf); - return ibuf1; -} - -/* smart function to sample a rect spiralling outside, nice for backbuf selection */ -unsigned int sample_backbuf_rect(short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, unsigned int (*indextest)(unsigned int index)) -{ - struct ImBuf *buf; - unsigned int *bufmin, *bufmax, *tbuf; - int minx, miny; - int a, b, rc, nr, amount, dirvec[4][2]; - int distance=0; - unsigned int index = 0; - short indexok = 0; - - amount= (size-1)/2; - - minx = mval[0]-(amount+1); - miny = mval[1]-(amount+1); - buf = read_backbuf(minx, miny, minx+size-1, miny+size-1); - if (!buf) return 0; - - rc= 0; - - dirvec[0][0]= 1; dirvec[0][1]= 0; - dirvec[1][0]= 0; dirvec[1][1]= -size; - dirvec[2][0]= -1; dirvec[2][1]= 0; - dirvec[3][0]= 0; dirvec[3][1]= size; - - bufmin = buf->rect; - tbuf = buf->rect; - bufmax = buf->rect + size*size; - tbuf+= amount*size+ amount; - - for(nr=1; nr<=size; nr++) { - - for(a=0; a<2; a++) { - for(b=0; b=min && *tbuf=bufmax) { - goto exit; - } - } - rc++; - rc &= 3; - } - } - -exit: - IMB_freeImBuf(buf); - return index; -} - -void drawname(Object *ob) -{ - cpack(0x404040); - glRasterPos3f(0.0, 0.0, 0.0); - - BMF_DrawString(G.font, " "); - BMF_DrawString(G.font, ob->id.name+2); -} - - -static void draw_selected_name(Object *ob) -{ - char info[128]; - short offset=30; - - if(ob->type==OB_ARMATURE) { - bArmature *arm= ob->data; - char *name= NULL; - - if(ob==G.obedit) { - EditBone *ebo; - for (ebo=G.edbo.first; ebo; ebo=ebo->next){ - if ((ebo->flag & BONE_ACTIVE) && (ebo->layer & arm->layer)) { - name= ebo->name; - break; - } - } - } - else if(ob->pose && (ob->flag & OB_POSEMODE)) { - bPoseChannel *pchan; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if((pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) { - name= pchan->name; - break; - } - } - } - if(name) - sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, name); - else - sprintf(info, "(%d) %s", CFRA, ob->id.name+2); - } - else if(ob->type==OB_MESH) { - Key *key= NULL; - KeyBlock *kb = NULL; - char shapes[75]; - - shapes[0] = 0; - key = ob_get_key(ob); - if(key){ - kb = BLI_findlink(&key->block, ob->shapenr-1); - if(kb){ - sprintf(shapes, ": %s ", kb->name); - if(ob->shapeflag == OB_SHAPE_LOCK){ - sprintf(shapes, "%s (Pinned)",shapes); - } - } - } - sprintf(info, "(%d) %s %s", CFRA, ob->id.name+2, shapes); - } - else sprintf(info, "(%d) %s", CFRA, ob->id.name+2); - - BIF_ThemeColor(TH_TEXT_HI); - if (U.uiflag & USER_SHOW_ROTVIEWICON) - offset = 14 + (U.rvisize * 2); - - glRasterPos2i(offset, 10); - BMF_DrawString(G.fonts, info); -} - - -/* Draw a live substitute of the view icon, which is always shown */ -static void draw_view_axis(void) -{ - const float k = U.rvisize; /* axis size */ - const float toll = 0.5; /* used to see when view is quasi-orthogonal */ - const float start = k + 1.0; /* axis center in screen coordinates, x=y */ - float ydisp = 0.0; /* vertical displacement to allow obj info text */ - - /* rvibright ranges approx. from original axis icon color to gizmo color */ - float bright = U.rvibright / 15.0f; - - unsigned char col[3]; - unsigned char gridcol[3]; - float colf[3]; - - float vec[4]; - float dx, dy; - float h, s, v; - - BIF_GetThemeColor3ubv(TH_GRID, (char *)gridcol); - - /* X */ - vec[0] = vec[3] = 1; - vec[1] = vec[2] = 0; - QuatMulVecf(G.vd->viewquat, vec); - - make_axis_color((char *)gridcol, (char *)col, 'x'); - rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); - s = s<0.5 ? s+0.5 : 1.0; - v = 0.3; - v = (v<1.0-(bright) ? v+bright : 1.0); - hsv_to_rgb(h, s, v, colf, colf+1, colf+2); - glColor3fv(colf); - - dx = vec[0] * k; - dy = vec[1] * k; - fdrawline(start, start + ydisp, start + dx, start + dy + ydisp); - if (fabs(dx) > toll || fabs(dy) > toll) { - glRasterPos2i(start + dx + 2, start + dy + ydisp + 2); - BMF_DrawString(G.fonts, "x"); - } - - /* Y */ - vec[1] = vec[3] = 1; - vec[0] = vec[2] = 0; - QuatMulVecf(G.vd->viewquat, vec); - - make_axis_color((char *)gridcol, (char *)col, 'y'); - rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); - s = s<0.5 ? s+0.5 : 1.0; - v = 0.3; - v = (v<1.0-(bright) ? v+bright : 1.0); - hsv_to_rgb(h, s, v, colf, colf+1, colf+2); - glColor3fv(colf); - - dx = vec[0] * k; - dy = vec[1] * k; - fdrawline(start, start + ydisp, start + dx, start + dy + ydisp); - if (fabs(dx) > toll || fabs(dy) > toll) { - glRasterPos2i(start + dx + 2, start + dy + ydisp + 2); - BMF_DrawString(G.fonts, "y"); - } - - /* Z */ - vec[2] = vec[3] = 1; - vec[1] = vec[0] = 0; - QuatMulVecf(G.vd->viewquat, vec); - - make_axis_color((char *)gridcol, (char *)col, 'z'); - rgb_to_hsv(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, &h, &s, &v); - s = s<0.5 ? s+0.5 : 1.0; - v = 0.5; - v = (v<1.0-(bright) ? v+bright : 1.0); - hsv_to_rgb(h, s, v, colf, colf+1, colf+2); - glColor3fv(colf); - - dx = vec[0] * k; - dy = vec[1] * k; - fdrawline(start, start + ydisp, start + dx, start + dy + ydisp); - if (fabs(dx) > toll || fabs(dy) > toll) { - glRasterPos2i(start + dx + 2, start + dy + ydisp + 2); - BMF_DrawString(G.fonts, "z"); - } -} - - -static void draw_view_icon(void) -{ - BIFIconID icon; - - if(G.vd->view==7) icon= ICON_AXIS_TOP; - else if(G.vd->view==1) icon= ICON_AXIS_FRONT; - else if(G.vd->view==3) icon= ICON_AXIS_SIDE; - else return ; - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - BIF_icon_draw(5.0, 5.0, icon); - - glDisable(GL_BLEND); -} - -static void draw_viewport_name(ScrArea *sa) -{ - char *name = NULL; - char *printable = NULL; - - switch(G.vd->view) { - case 1: - if (G.vd->persp & V3D_PERSP_DO_3D_PERSP) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Persp" : "Front Persp"; - else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Back Ortho" : "Front Ortho"; - break; - case 3: - if (G.vd->persp & V3D_PERSP_DO_3D_PERSP) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Persp" : "Right Persp"; - else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Left Ortho" : "Right Ortho"; - break; - case 7: - if (G.vd->persp & V3D_PERSP_DO_3D_PERSP) - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Persp" : "Top Persp"; - else - name = (G.vd->flag2 & V3D_OPP_DIRECTION_NAME) ? "Bottom Ortho" : "Top Ortho"; - break; - default: - if (G.vd->persp==V3D_PERSP_USE_THE_CAMERA) { - if ((G.vd->camera) && (G.vd->camera->type == OB_CAMERA)) { - Camera *cam; - cam = G.vd->camera->data; - name = (cam->type != CAM_ORTHO) ? "Camera Persp" : "Camera Ortho"; - } else { - name = "Object as Camera"; - } - } else { - name = (G.vd->persp & V3D_PERSP_DO_3D_PERSP) ? "User Persp" : "User Ortho"; - } - } - - if (G.vd->localview) { - printable = malloc(strlen(name) + strlen(" (Local)_")); /* '_' gives space for '\0' */ - strcpy(printable, name); - strcat(printable, " (Local)"); - } else { - printable = name; - } - - if (printable) { - BIF_ThemeColor(TH_TEXT_HI); - glRasterPos2i(10, sa->winy-20); - BMF_DrawString(G.fonts, printable); - } - - if (G.vd->localview) { - free(printable); - } -} - -/* ******************* view3d space & buttons ************** */ - - -/* temporal struct for storing transform properties */ -typedef struct { - float ob_eul[4]; // used for quat too.... - float ob_scale[3]; // need temp space due to linked values - float ob_dims[3]; - short link_scale; - float ve_median[5]; - int curdef; - float *defweightp; -} TransformProperties; - -/* is used for both read and write... */ -static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *evedef=NULL; - EditEdge *eed; - MDeformVert *dvert=NULL; - TransformProperties *tfp= G.vd->properties_storage; - float median[5]; - int tot, totw, totweight, totedge; - char defstr[320]; - - median[0]= median[1]= median[2]= median[3]= median[4]= 0.0; - tot= totw= totweight= totedge= 0; - defstr[0]= 0; - - if(ob->type==OB_MESH) { - eve= em->verts.first; - while(eve) { - if(eve->f & 1) { - evedef= eve; - tot++; - VecAddf(median, median, eve->co); - } - eve= eve->next; - } - eed= em->edges.first; - while(eed) { - if((eed->f & SELECT)) { - totedge++; - median[3]+= eed->crease; - } - eed= eed->next; - } - - /* check for defgroups */ - if(evedef) - dvert= CustomData_em_get(&em->vdata, evedef->data, CD_MDEFORMVERT); - if(tot==1 && dvert && dvert->totweight) { - bDeformGroup *dg; - int i, max=1, init=1; - char str[320]; - - for (i=0; itotweight; i++){ - dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - if(dg) { - max+= snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr); - if(max<320) strcat(defstr, str); - } - else printf("oh no!\n"); - if(tfp->curdef==dvert->dw[i].def_nr) { - init= 0; - tfp->defweightp= &dvert->dw[i].weight; - } - } - - if(init) { // needs new initialized - tfp->curdef= dvert->dw[0].def_nr; - tfp->defweightp= &dvert->dw[0].weight; - } - } - } - else if(ob->type==OB_CURVE || ob->type==OB_SURF) { - extern ListBase editNurb; /* editcurve.c */ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->f2 & SELECT) { - VecAddf(median, median, bezt->vec[1]); - tot++; - median[4]+= bezt->weight; - totweight++; - } - else { - if(bezt->f1 & SELECT) { - VecAddf(median, median, bezt->vec[0]); - tot++; - } - if(bezt->f3 & SELECT) { - VecAddf(median, median, bezt->vec[2]); - tot++; - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - VecAddf(median, median, bp->vec); - median[3]+= bp->vec[3]; - totw++; - tot++; - median[4]+= bp->weight; - totweight++; - } - bp++; - } - } - nu= nu->next; - } - } - else if(ob->type==OB_LATTICE) { - BPoint *bp; - int a; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(bp->f1 & SELECT) { - VecAddf(median, median, bp->vec); - tot++; - median[4]+= bp->weight; - totweight++; - } - bp++; - } - } - - if(tot==0) return; - - median[0] /= (float)tot; - median[1] /= (float)tot; - median[2] /= (float)tot; - if(totedge) median[3] /= (float)totedge; - else if(totw) median[3] /= (float)totw; - if(totweight) median[4] /= (float)totweight; - - if(G.vd->flag & V3D_GLOBAL_STATS) - Mat4MulVecfl(ob->obmat, median); - - if(block) { // buttons - uiBlockBeginAlign(block); - if((ob->parent) && (ob->partype == PARBONE)) { - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Global", 160, 135, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Local", 230, 135, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays local values"); - } - else { - uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Global", 160, 150, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays global values"); - uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, REDRAWVIEW3D, "Local", 230, 150, 70, 19, &G.vd->flag, 0, 0, 0, 0, "Displays local values"); - } - - memcpy(tfp->ve_median, median, sizeof(tfp->ve_median)); - - uiBlockBeginAlign(block); - if(tot==1) { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex X:", 10, 110, 290, 19, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Y:", 10, 90, 290, 19, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Z:", 10, 70, 290, 19, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); - if(totw==1) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex W:", 10, 50, 290, 19, &(tfp->ve_median[3]), 0.01, 100.0, 10, 3, ""); - uiBlockEndAlign(block); - - if(defstr[0]) { - uiDefBut(block, LABEL, 1, "Vertex Deform Groups", 10, 40, 290, 20, NULL, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NOP, "Weight:", 10, 20, 150, 19, tfp->defweightp, 0.0f, 1.0f, 10, 3, "Weight value"); - uiDefButI(block, MENU, REDRAWVIEW3D, defstr, 160, 20, 140, 19, &tfp->curdef, 0.0, 0.0, 0, 0, "Current Vertex Group"); - uiBlockEndAlign(block); - } - else if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 10, 20, 290, 19, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); - - } - else { - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median X:", 10, 110, 290, 19, &(tfp->ve_median[0]), -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Y:", 10, 90, 290, 19, &(tfp->ve_median[1]), -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Z:", 10, 70, 290, 19, &(tfp->ve_median[2]), -lim, lim, 10, 3, ""); - if(totw==tot) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median W:", 10, 50, 290, 19, &(tfp->ve_median[3]), 0.01, 100.0, 10, 3, ""); - uiBlockEndAlign(block); - if(totweight) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 10, 20, 290, 19, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, "Weight is used for SoftBody Goal"); - } - - if(ob->type==OB_CURVE && (totw==0)) { /* bez curves have no w */ - uiBlockBeginAlign(block); - uiDefBut(block, BUT,B_SETPT_AUTO,"Auto", 10, 44, 72, 19, 0, 0, 0, 0, 0, "Auto handles (Shift H)"); - uiDefBut(block, BUT,B_SETPT_VECTOR,"Vector",82, 44, 73, 19, 0, 0, 0, 0, 0, "Vector handles (V)"); - uiDefBut(block, BUT,B_SETPT_ALIGN,"Align",155, 44, 73, 19, 0, 0, 0, 0, 0, "Align handles (H Toggles)"); - uiDefBut(block, BUT,B_SETPT_FREE,"Free", 227, 44, 72, 19, 0, 0, 0, 0, 0, "Align handles (H Toggles)"); - uiBlockEndAlign(block); - } - - if(totedge==1) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease W:", 10, 30, 290, 19, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, ""); - else if(totedge>1) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Crease W:", 10, 30, 290, 19, &(tfp->ve_median[3]), 0.0, 1.0, 10, 3, ""); - - } - else { // apply - - if(G.vd->flag & V3D_GLOBAL_STATS) { - Mat4Invert(ob->imat, ob->obmat); - Mat4MulVecfl(ob->imat, median); - Mat4MulVecfl(ob->imat, tfp->ve_median); - } - VecSubf(median, tfp->ve_median, median); - median[3]= tfp->ve_median[3]-median[3]; - median[4]= tfp->ve_median[4]-median[4]; - - if(ob->type==OB_MESH) { - - eve= em->verts.first; - while(eve) { - if(eve->f & 1) { - VecAddf(eve->co, eve->co, median); - } - eve= eve->next; - } - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { - /* ensure the median can be set to zero or one */ - if(tfp->ve_median[3]==0.0f) eed->crease= 0.0f; - else if(tfp->ve_median[3]==1.0f) eed->crease= 1.0f; - else { - eed->crease+= median[3]; - CLAMP(eed->crease, 0.0, 1.0); - } - } - } - - recalc_editnormals(); - } - else if(ob->type==OB_CURVE || ob->type==OB_SURF) { - extern ListBase editNurb; /* editcurve.c */ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==1) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->f2 & SELECT) { - VecAddf(bezt->vec[0], bezt->vec[0], median); - VecAddf(bezt->vec[1], bezt->vec[1], median); - VecAddf(bezt->vec[2], bezt->vec[2], median); - bezt->weight+= median[4]; - } - else { - if(bezt->f1 & SELECT) { - VecAddf(bezt->vec[0], bezt->vec[0], median); - } - if(bezt->f3 & SELECT) { - VecAddf(bezt->vec[2], bezt->vec[2], median); - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - VecAddf(bp->vec, bp->vec, median); - bp->vec[3]+= median[3]; - bp->weight+= median[4]; - } - bp++; - } - } - test2DNurb(nu); - testhandlesNurb(nu); /* test for bezier too */ - - nu= nu->next; - } - } - else if(ob->type==OB_LATTICE) { - BPoint *bp; - int a; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(bp->f1 & SELECT) { - VecAddf(bp->vec, bp->vec, median); - bp->weight+= median[4]; - } - bp++; - } - } - - BIF_undo_push("Transform properties"); - } -} - -/* assumes armature active */ -static void validate_bonebutton_cb(void *bonev, void *namev) -{ - Object *ob= OBACT; - - if(ob && ob->type==OB_ARMATURE) { - Bone *bone= bonev; - char oldname[32], newname[32]; - - /* need to be on the stack */ - BLI_strncpy(newname, bone->name, 32); - BLI_strncpy(oldname, (char *)namev, 32); - /* restore */ - BLI_strncpy(bone->name, oldname, 32); - - armature_bone_rename(ob->data, oldname, newname); // editarmature.c - allqueue(REDRAWALL, 0); - } -} - -static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim) -{ - uiBut *but; - bArmature *arm; - bPoseChannel *pchan; - Bone *bone= NULL; - TransformProperties *tfp= G.vd->properties_storage; - - arm = get_armature(OBACT); - if (!arm || !ob->pose) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone = pchan->bone; - if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer)) - break; - } - if (!pchan || !bone) return; - - if((ob->parent) && (ob->partype == PARBONE)) - but= uiDefBut (block, TEX, B_DIFF, "Bone:", 160, 130, 140, 19, bone->name, 1, 31, 0, 0, ""); - else - but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 140, 140, 19, bone->name, 1, 31, 0, 0, ""); - uiButSetFunc(but, validate_bonebutton_cb, bone, NULL); - - QuatToEul(pchan->quat, tfp->ob_eul); - tfp->ob_eul[0]*= 180.0/M_PI; - tfp->ob_eul[1]*= 180.0/M_PI; - tfp->ob_eul[2]*= 180.0/M_PI; - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, REDRAWVIEW3D, ICON_UNLOCKED, 10,140,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocX:", 30, 140, 120, 19, pchan->loc, -lim, lim, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, REDRAWVIEW3D, ICON_UNLOCKED, 10,120,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocY:", 30, 120, 120, 19, pchan->loc+1, -lim, lim, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,100,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocZ:", 30, 100, 120, 19, pchan->loc+2, -lim, lim, 100, 3, ""); - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 10,70,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotX:", 30, 70, 120, 19, tfp->ob_eul, -1000.0, 1000.0, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 10,50,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotY:", 30, 50, 120, 19, tfp->ob_eul+1, -1000.0, 1000.0, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,30,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL3, "RotZ:", 30, 30, 120, 19, tfp->ob_eul+2, -1000.0, 1000.0, 100, 3, ""); - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, REDRAWVIEW3D, ICON_UNLOCKED, 160,70,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleX:", 180, 70, 120, 19, pchan->size, -lim, lim, 10, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, REDRAWVIEW3D, ICON_UNLOCKED, 160,50,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleY:", 180, 50, 120, 19, pchan->size+1, -lim, lim, 10, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,30,20,19, &(pchan->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_ARMATUREPANEL2, "ScaleZ:", 180, 30, 120, 19, pchan->size+2, -lim, lim, 10, 3, ""); - uiBlockEndAlign(block); -} - -static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - uiBut *but; - TransformProperties *tfp= G.vd->properties_storage; - - ebone= G.edbo.first; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - if ((ebone->flag & BONE_ACTIVE) && (ebone->layer & arm->layer)) - break; - } - - if (!ebone) - return; - - if((ob->parent) && (ob->partype == PARBONE)) - but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 130, 140, 19, ebone->name, 1, 31, 0, 0, ""); - else - but= uiDefBut(block, TEX, B_DIFF, "Bone:", 160, 150, 140, 19, ebone->name, 1, 31, 0, 0, ""); - uiButSetFunc(but, validate_editbonebutton_cb, ebone, NULL); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadX:", 10, 70, 140, 19, ebone->head, -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadY:", 10, 50, 140, 19, ebone->head+1, -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadZ:", 10, 30, 140, 19, ebone->head+2, -lim, lim, 10, 3, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailX:", 160, 70, 140, 19, ebone->tail, -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailY:", 160, 50, 140, 19, ebone->tail+1, -lim, lim, 10, 3, ""); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailZ:", 160, 30, 140, 19, ebone->tail+2, -lim, lim, 10, 3, ""); - uiBlockEndAlign(block); - - tfp->ob_eul[0]= 180.0*ebone->roll/M_PI; - uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 140, 19, tfp->ob_eul, -lim, lim, 1000, 3, ""); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_ARMATUREPANEL1, "TailRadius:", 10, 150, 140, 19, &ebone->rad_tail, 0, lim, 10, 3, ""); - if (ebone->parent && ebone->flag & BONE_CONNECTED ) - uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadRadius:", 10, 130, 140, 19, &ebone->parent->rad_tail, 0, lim, 10, 3, ""); - else - uiDefButF(block, NUM, B_ARMATUREPANEL1, "HeadRadius:", 10, 130, 140, 19, &ebone->rad_head, 0, lim, 10, 3, ""); - uiBlockEndAlign(block); -} - -static void v3d_editmetaball_buts(uiBlock *block, Object *ob, float lim) -{ - extern MetaElem *lastelem; - - if(lastelem) { - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_RECALCMBALL, "LocX:", 10, 70, 140, 19, &lastelem->x, -lim, lim, 100, 3, ""); - uiDefButF(block, NUM, B_RECALCMBALL, "LocY:", 10, 50, 140, 19, &lastelem->y, -lim, lim, 100, 3, ""); - uiDefButF(block, NUM, B_RECALCMBALL, "LocZ:", 10, 30, 140, 19, &lastelem->z, -lim, lim, 100, 3, ""); - - uiBlockBeginAlign(block); - if(lastelem->type!=MB_BALL) - uiDefButF(block, NUM, B_RECALCMBALL, "dx:", 160, 70, 140, 19, &lastelem->expx, 0, lim, 100, 3, ""); - if((lastelem->type!=MB_BALL) && (lastelem->type!=MB_TUBE)) - uiDefButF(block, NUM, B_RECALCMBALL, "dy:", 160, 50, 140, 19, &lastelem->expy, 0, lim, 100, 3, ""); - if((lastelem->type==MB_ELIPSOID) || (lastelem->type==MB_CUBE)) - uiDefButF(block, NUM, B_RECALCMBALL, "dz:", 160, 30, 140, 19, &lastelem->expz, 0, lim, 100, 3, ""); - - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_RECALCMBALL, "Radius:", 10, 120, 140, 19, &lastelem->rad, 0, lim, 100, 3, "Size of the active metaball"); - uiDefButF(block, NUM, B_RECALCMBALL, "Stiffness:", 10, 100, 140, 19, &lastelem->s, 0, 10, 100, 3, "Stiffness of the active metaball"); - uiBlockEndAlign(block); - - uiDefButS(block, MENU, B_RECALCMBALL, "Type%t|Ball%x0|Tube%x4|Plane%x5|Elipsoid%x6|Cube%x7", 160, 120, 140, 19, &lastelem->type, 0.0, 0.0, 0, 0, "Set active element type"); - - } -} - -void do_viewbuts(unsigned short event) -{ - BoundBox *bb; - View3D *vd; - Object *ob= OBACT; - TransformProperties *tfp= G.vd->properties_storage; - - vd= G.vd; - if(vd==NULL) return; - - switch(event) { - - case B_OBJECTPANEL: - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 1); - break; - - case B_OBJECTPANELROT: - if(ob) { - ob->rot[0]= M_PI*tfp->ob_eul[0]/180.0; - ob->rot[1]= M_PI*tfp->ob_eul[1]/180.0; - ob->rot[2]= M_PI*tfp->ob_eul[2]/180.0; - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 1); - } - break; - - case B_OBJECTPANELSCALE: - if(ob) { - - /* link scale; figure out which axis changed */ - if (tfp->link_scale) { - float ratio, tmp, max = 0.0; - int axis; - - axis = 0; - max = fabs(tfp->ob_scale[0] - ob->size[0]); - tmp = fabs(tfp->ob_scale[1] - ob->size[1]); - if (tmp > max) { - axis = 1; - max = tmp; - } - tmp = fabs(tfp->ob_scale[2] - ob->size[2]); - if (tmp > max) { - axis = 2; - max = tmp; - } - - if (ob->size[axis] != tfp->ob_scale[axis]) { - if (fabs(ob->size[axis]) > FLT_EPSILON) { - ratio = tfp->ob_scale[axis] / ob->size[axis]; - ob->size[0] *= ratio; - ob->size[1] *= ratio; - ob->size[2] *= ratio; - } - } - } - else { - VECCOPY(ob->size, tfp->ob_scale); - - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 1); - } - break; - - case B_OBJECTPANELDIMS: - bb= object_get_boundbox(ob); - if(bb) { - float old_dims[3], scale[3], ratio, len[3]; - int axis; - - Mat4ToSize(ob->obmat, scale); - - len[0] = bb->vec[4][0] - bb->vec[0][0]; - len[1] = bb->vec[2][1] - bb->vec[0][1]; - len[2] = bb->vec[1][2] - bb->vec[0][2]; - - old_dims[0] = fabs(scale[0]) * len[0]; - old_dims[1] = fabs(scale[1]) * len[1]; - old_dims[2] = fabs(scale[2]) * len[2]; - - /* for each axis changed */ - for (axis = 0; axis<3; axis++) { - if (fabs(old_dims[axis] - tfp->ob_dims[axis]) > 0.0001) { - if (old_dims[axis] > 0.0) { - ratio = tfp->ob_dims[axis] / old_dims[axis]; - if (tfp->link_scale) { - ob->size[0] *= ratio; - ob->size[1] *= ratio; - ob->size[2] *= ratio; - break; - } - else { - ob->size[axis] *= ratio; - } - } - else { - if (len[axis] > 0) { - ob->size[axis] = tfp->ob_dims[axis] / len[axis]; - } - } - } - } - - /* prevent multiple B_OBJECTPANELDIMS events to keep scaling, cycling with TAB on buttons can cause that */ - VECCOPY(tfp->ob_dims, old_dims); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 1); - } - break; - - case B_OBJECTPANELMEDIAN: - if(ob) { - v3d_editvertex_buts(NULL, ob, 1.0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - } - break; - - /* note; this case also used for parbone */ - case B_OBJECTPANELPARENT: - if(ob) { - if(ob->id.lib || test_parent_loop(ob->parent, ob) ) - ob->parent= NULL; - else { - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSOBJECT, 0); - } - break; - - case B_ARMATUREPANEL1: - { - bArmature *arm= G.obedit->data; - EditBone *ebone, *child; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - if ((ebone->flag & BONE_ACTIVE) && (ebone->layer & arm->layer)) - break; - } - if (ebone) { - ebone->roll= M_PI*tfp->ob_eul[0]/180.0; - // Update our parent - if (ebone->parent && ebone->flag & BONE_CONNECTED){ - VECCOPY (ebone->parent->tail, ebone->head); - } - - // Update our children if necessary - for (child = G.edbo.first; child; child=child->next){ - if (child->parent == ebone && (child->flag & BONE_CONNECTED)){ - VECCOPY (child->head, ebone->tail); - } - } - if(arm->flag & ARM_MIRROR_EDIT) { - EditBone *eboflip= armature_bone_get_mirrored(ebone); - if(eboflip) { - eboflip->roll= -ebone->roll; - eboflip->head[0]= -ebone->head[0]; - eboflip->tail[0]= -ebone->tail[0]; - - // Update our parent - if (eboflip->parent && eboflip->flag & BONE_CONNECTED){ - VECCOPY (eboflip->parent->tail, eboflip->head); - } - - // Update our children if necessary - for (child = G.edbo.first; child; child=child->next){ - if (child->parent == eboflip && (child->flag & BONE_CONNECTED)){ - VECCOPY (child->head, eboflip->tail); - } - } - } - } - - allqueue(REDRAWVIEW3D, 1); - } - } - break; - case B_ARMATUREPANEL3: // rotate button on channel - { - bArmature *arm; - bPoseChannel *pchan; - Bone *bone; - float eul[3]; - - arm = get_armature(OBACT); - if (!arm || !ob->pose) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone = pchan->bone; - if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer)) - break; - } - if (!pchan) return; - - /* make a copy to eul[3], to allow TAB on buttons to work */ - eul[0]= M_PI*tfp->ob_eul[0]/180.0; - eul[1]= M_PI*tfp->ob_eul[1]/180.0; - eul[2]= M_PI*tfp->ob_eul[2]/180.0; - EulToQuat(eul, pchan->quat); - } - /* no break, pass on */ - case B_ARMATUREPANEL2: - { - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - } - break; - } -} - -static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT -{ - uiBlock *block; - uiBut *bt; - Object *ob= OBACT; - TransformProperties *tfp; - float lim; - static char hexcol[128]; - - if(ob==NULL) return; - - /* make sure we got storage */ - if(G.vd->properties_storage==NULL) - G.vd->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties"); - tfp= G.vd->properties_storage; - - block= uiNewBlock(&curarea->uiblocks, "view3d_panel_object", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_OBJECT); // for close and esc - - if((G.f & G_SCULPTMODE) && !G.obedit) { - if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 234)) - return; - } else if(G.f & G_PARTICLEEDIT && !G.obedit){ - if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 234)) - return; - } else { - if(!uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)) - return; - } - - uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - - if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) { - uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw - } - else { - bt= uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 21.0, 0, 0, ""); -#ifdef WITH_VERSE - if(ob->vnode) uiButSetFunc(bt, test_and_send_idbutton_cb, ob, ob->id.name); - else uiButSetFunc(bt, test_idbutton_cb, ob->id.name, NULL); -#else - uiButSetFunc(bt, test_idbutton_cb, ob->id.name, NULL); -#endif - - if((G.f & G_PARTICLEEDIT)==0) { - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_OBJECTPANELPARENT, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object"); - if((ob->parent) && (ob->partype == PARBONE)) { - bt= uiDefBut(block, TEX, B_OBJECTPANELPARENT, "ParBone:", 160, 160, 140, 20, ob->parsubstr, 0, 30, 0, 0, ""); - uiButSetCompleteFunc(bt, autocomplete_bone, (void *)ob->parent); - } - else { - strcpy(ob->parsubstr, ""); - } - uiBlockEndAlign(block); - } - } - - lim= 10000.0f*MAX2(1.0, G.vd->grid); - - if(ob==G.obedit) { - if(ob->type==OB_ARMATURE) v3d_editarmature_buts(block, ob, lim); - if(ob->type==OB_MBALL) v3d_editmetaball_buts(block, ob, lim); - else v3d_editvertex_buts(block, ob, lim); - } - else if(ob->flag & OB_POSEMODE) { - v3d_posearmature_buts(block, ob, lim); - } - else if(G.f & G_WEIGHTPAINT) { - uiNewPanelTitle(block, "Weight Paint Properties"); - weight_paint_buttons(block); - } - else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) { - extern VPaint Gvp; /* from vpaint */ - static float hsv[3], old[3]; // used as temp mem for picker - float *rgb= NULL; - ToolSettings *settings= G.scene->toolsettings; - - if(G.f & G_VERTEXPAINT) rgb= &Gvp.r; - else if(settings->imapaint.brush) rgb= settings->imapaint.brush->rgb; - - uiNewPanelTitle(block, "Paint Properties"); - if (rgb) - /* 'f' is for floating panel */ - uiBlockPickerButtons(block, rgb, hsv, old, hexcol, 'f', REDRAWBUTSEDIT); - } - else if(G.f & G_SCULPTMODE) { - uiNewPanelTitle(block, "Sculpt Properties"); - sculptmode_draw_interface_tools(block,10,150); - } else if(G.f & G_PARTICLEEDIT){ - uiNewPanelTitle(block, "Particle Edit Properties"); - particle_edit_buttons(block); - } else { - BoundBox *bb = NULL; - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, REDRAWVIEW3D, ICON_UNLOCKED, 10,150,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANEL, "LocX:", 30, 150, 120, 19, &(ob->loc[0]), -lim, lim, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, REDRAWVIEW3D, ICON_UNLOCKED, 10,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANEL, "LocY:", 30, 130, 120, 19, &(ob->loc[1]), -lim, lim, 100, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANEL, "LocZ:", 30, 110, 120, 19, &(ob->loc[2]), -lim, lim, 100, 3, ""); - - tfp->ob_eul[0]= 180.0*ob->rot[0]/M_PI; - tfp->ob_eul[1]= 180.0*ob->rot[1]/M_PI; - tfp->ob_eul[2]= 180.0*ob->rot[2]/M_PI; - - uiBlockBeginAlign(block); - if ((ob->parent) && (ob->partype == PARBONE)) { - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 160,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 180, 130, 120, 19, &(tfp->ob_eul[0]), -lim, lim, 1000, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 160,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 180, 110, 120, 19, &(tfp->ob_eul[1]), -lim, lim, 1000, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,90,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 180, 90, 120, 19, &(tfp->ob_eul[2]), -lim, lim, 1000, 3, ""); - - } - else { - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, REDRAWVIEW3D, ICON_UNLOCKED, 160,150,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 180, 150, 120, 19, &(tfp->ob_eul[0]), -lim, lim, 1000, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, REDRAWVIEW3D, ICON_UNLOCKED, 160,130,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 180, 130, 120, 19, &(tfp->ob_eul[1]), -lim, lim, 1000, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, REDRAWVIEW3D, ICON_UNLOCKED, 160,110,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 180, 110, 120, 19, &(tfp->ob_eul[2]), -lim, lim, 1000, 3, ""); - } - - tfp->ob_scale[0]= ob->size[0]; - tfp->ob_scale[1]= ob->size[1]; - tfp->ob_scale[2]= ob->size[2]; - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, REDRAWVIEW3D, ICON_UNLOCKED, 10,80,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleX:", 30, 80, 120, 19, &(tfp->ob_scale[0]), -lim, lim, 10, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, REDRAWVIEW3D, ICON_UNLOCKED, 10,60,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleY:", 30, 60, 120, 19, &(tfp->ob_scale[1]), -lim, lim, 10, 3, ""); - uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEZ, REDRAWVIEW3D, ICON_UNLOCKED, 10,40,20,19, &(ob->protectflag), 0, 0, 0, 0, "Protects this value from being Transformed"); - uiDefButF(block, NUM, B_OBJECTPANELSCALE, "ScaleZ:", 30, 40, 120, 19, &(tfp->ob_scale[2]), -lim, lim, 10, 3, ""); - uiBlockEndAlign(block); - - uiDefButS(block, TOG, REDRAWVIEW3D, "Link Scale", 10, 10, 140, 19, &(tfp->link_scale), 0, 1, 0, 0, "Scale values vary proportionally in all directions"); - - bb= object_get_boundbox(ob); - if (bb) { - float scale[3]; - - Mat4ToSize(ob->obmat, scale); - - tfp->ob_dims[0] = fabs(scale[0]) * (bb->vec[4][0] - bb->vec[0][0]); - tfp->ob_dims[1] = fabs(scale[1]) * (bb->vec[2][1] - bb->vec[0][1]); - tfp->ob_dims[2] = fabs(scale[2]) * (bb->vec[1][2] - bb->vec[0][2]); - - uiBlockBeginAlign(block); - if ((ob->parent) && (ob->partype == PARBONE)) { - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimX:", 160, 60, 140, 19, &(tfp->ob_dims[0]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimY:", 160, 40, 140, 19, &(tfp->ob_dims[1]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimZ:", 160, 20, 140, 19, &(tfp->ob_dims[2]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - - } - else { - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimX:", 160, 80, 140, 19, &(tfp->ob_dims[0]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimY:", 160, 60, 140, 19, &(tfp->ob_dims[1]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - uiDefButF(block, NUM, B_OBJECTPANELDIMS, "DimZ:", 160, 40, 140, 19, &(tfp->ob_dims[2]), 0.0, lim, 10, 3, "Manipulate bounding box size"); - } - - uiBlockEndAlign(block); - } - } - uiClearButLock(); -} - -static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND -{ - uiBlock *block; - View3D *vd; - - vd= G.vd; - - block= uiNewBlock(&curarea->uiblocks, "view3d_panel_background", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_BACKGROUND); // for close and esc - if(uiNewPanel(curarea, block, "Background Image", "View3d", 340, 10, 318, 204)==0) return; - - if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT) { - uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw - } - - if(vd->flag & V3D_DISPBGPIC) { - if(vd->bgpic==NULL) { - vd->bgpic= MEM_callocN(sizeof(BGpic), "bgpic"); - vd->bgpic->size= 5.0; - vd->bgpic->blend= 0.5; - vd->bgpic->iuser.fie_ima= 2; - vd->bgpic->iuser.ok= 1; - } - } - - if(!(vd->flag & V3D_DISPBGPIC)) { - uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use Background Image", 10, 180, 150, 20, &vd->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View"); - uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - } - else { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_DISPBGPIC, B_REDR, "Use", 10, 225, 50, 20, &vd->flag, 0, 0, 0, 0, "Display an image in the background of this 3D View"); - uiDefButF(block, NUMSLI, B_REDR, "Blend:", 60, 225, 150, 20, &vd->bgpic->blend, 0.0,1.0, 0, 0, "Set the transparency of the background image"); - uiDefButF(block, NUM, B_REDR, "Size:", 210, 225, 100, 20, &vd->bgpic->size, 0.1, 250.0*vd->grid, 100, 0, "Set the size (width) of the background image"); - - uiDefButF(block, NUM, B_REDR, "X Offset:", 10, 205, 150, 20, &vd->bgpic->xof, -250.0*vd->grid,250.0*vd->grid, 10, 2, "Set the horizontal offset of the background image"); - uiDefButF(block, NUM, B_REDR, "Y Offset:", 160, 205, 150, 20, &vd->bgpic->yof, -250.0*vd->grid,250.0*vd->grid, 10, 2, "Set the vertical offset of the background image"); - - uiblock_image_panel(block, &vd->bgpic->ima, &vd->bgpic->iuser, B_REDR, B_REDR); - } -} - - -static void view3d_panel_properties(short cntrl) // VIEW3D_HANDLER_SETTINGS -{ - uiBlock *block; - View3D *vd; - float *curs; - - vd= G.vd; - - block= uiNewBlock(&curarea->uiblocks, "view3d_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "View Properties", "View3d", 340, 30, 318, 254)==0) return; - - /* to force height */ - uiNewPanelHeight(block, 264); - - if(G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT)) { - uiBlockSetFlag(block, UI_BLOCK_FRONTBUFFER); // force old style frontbuffer draw - } - - uiDefBut(block, LABEL, 1, "Grid:", 10, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "Spacing:", 10, 200, 140, 19, &vd->grid, 0.001, 100.0, 10, 0, "Set the distance between grid lines"); - uiDefButS(block, NUM, REDRAWVIEW3D, "Lines:", 10, 180, 140, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of grid lines in perspective view"); - uiDefButS(block, NUM, REDRAWVIEW3D, "Divisions:", 10, 160, 140, 19, &vd->gridsubdiv, 1.0, 100.0, 100, 0, "Set the number of grid lines"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 1, "3D Display:", 160, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefButBitS(block, TOG, V3D_SHOW_FLOOR, REDRAWVIEW3D, "Grid Floor",160, 200, 150, 19, &vd->gridflag, 0, 0, 0, 0, "Show the grid floor in free camera mode"); - uiDefButBitS(block, TOG, V3D_SHOW_X, REDRAWVIEW3D, "X Axis", 160, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the X Axis line"); - uiDefButBitS(block, TOG, V3D_SHOW_Y, REDRAWVIEW3D, "Y Axis", 212, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the Y Axis line"); - uiDefButBitS(block, TOG, V3D_SHOW_Z, REDRAWVIEW3D, "Z Axis", 262, 176, 48, 19, &vd->gridflag, 0, 0, 0, 0, "Show the Z Axis line"); - - uiDefBut(block, LABEL, 1, "View Camera:", 10, 140, 140, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 120, 140, 19, &vd->lens, 10.0, 120.0, 100, 0, "The lens angle in perspective view"); - uiBlockBeginAlign(block); - uiDefButF(block, NUM, REDRAWVIEW3D, "Clip Start:", 10, 96, 140, 19, &vd->near, vd->grid/100.0, 100.0, 10, 0, "Set the beginning of the range in which 3D objects are displayed (perspective view)"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Clip End:", 10, 76, 140, 19, &vd->far, 1.0, 10000.0*vd->grid, 100, 0, "Set the end of the range in which 3D objects are displayed (perspective view)"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 1, "3D Cursor:", 160, 150, 140, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - curs= give_cursor(); - uiDefButF(block, NUM, REDRAWVIEW3D, "X:", 160, 130, 150, 22, curs, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "X co-ordinate of the 3D cursor"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Y:", 160, 108, 150, 22, curs+1, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Y co-ordinate of the 3D cursor"); - uiDefButF(block, NUM, REDRAWVIEW3D, "Z:", 160, 86, 150, 22, curs+2, -10000.0*vd->grid, 10000.0*vd->grid, 10, 0, "Z co-ordinate of the 3D cursor"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 1, "Display:", 10, 50, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, V3D_SELECT_OUTLINE, REDRAWVIEW3D, "Outline Selected", 10, 30, 140, 19, &vd->flag, 0, 0, 0, 0, "Highlight selected objects with an outline, in Solid, Shaded or Textured viewport shading modes"); - uiDefButBitS(block, TOG, V3D_DRAW_CENTERS, REDRAWVIEW3D, "All Object Centers", 10, 10, 140, 19, &vd->flag, 0, 0, 0, 0, "Draw the center points on all objects"); - uiDefButBitS(block, TOGN, V3D_HIDE_HELPLINES, REDRAWVIEW3D, "Relationship Lines", 10, -10, 140, 19, &vd->flag, 0, 0, 0, 0, "Draw dashed lines indicating Parent, Constraint, or Hook relationships"); - uiDefButBitS(block, TOG, V3D_SOLID_TEX, REDRAWVIEW3D, "Solid Tex", 10, -30, 140, 19, &vd->flag2, 0, 0, 0, 0, "Display textures in Solid draw type (Shift T)"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL, 1, "View Locking:", 160, 50, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, REDRAWVIEW3D, "Object:", 160, 30, 140, 19, &vd->ob_centre, "Lock view to center to this Object"); - uiDefBut(block, TEX, REDRAWVIEW3D, "Bone:", 160, 10, 140, 19, vd->ob_centre_bone, 1, 31, 0, 0, "If view locked to Object, use this Bone to lock to view to"); - -} - -static void view3d_panel_preview(ScrArea *sa, short cntrl) // VIEW3D_HANDLER_PREVIEW -{ - uiBlock *block; - View3D *v3d= sa->spacedata.first; - int ofsx, ofsy; - - block= uiNewBlock(&sa->uiblocks, "view3d_panel_preview", UI_EMBOSS, UI_HELV, sa->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc - - ofsx= -150+(sa->winx/2)/v3d->blockscale; - ofsy= -100+(sa->winy/2)/v3d->blockscale; - if(uiNewPanel(sa, block, "Preview", "View3d", ofsx, ofsy, 300, 200)==0) return; - - uiBlockSetDrawExtraFunc(block, BIF_view3d_previewdraw); - - if(G.scene->recalc & SCE_PRV_CHANGED) { - G.scene->recalc &= ~SCE_PRV_CHANGED; - //printf("found recalc\n"); - BIF_view3d_previewrender_free(sa->spacedata.first); - BIF_preview_changed(0); - } -} - - -static void view3d_blockhandlers(ScrArea *sa) -{ - View3D *v3d= sa->spacedata.first; - short a; - - /* warning; blocks need to be freed each time, handlers dont remove */ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - /*uv face-sel and wp mode when mixed with wire leave depth enabled causing - models to draw over the UI */ - glDisable(GL_DEPTH_TEST); - - for(a=0; ablockhandler[a]) { - - case VIEW3D_HANDLER_PROPERTIES: - view3d_panel_properties(v3d->blockhandler[a+1]); - break; - case VIEW3D_HANDLER_BACKGROUND: - view3d_panel_background(v3d->blockhandler[a+1]); - break; - case VIEW3D_HANDLER_OBJECT: - view3d_panel_object(v3d->blockhandler[a+1]); - break; - case VIEW3D_HANDLER_PREVIEW: - view3d_panel_preview(sa, v3d->blockhandler[a+1]); - break; - } - /* clear action value for event */ - v3d->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); - -} - -/* ****************** View3d afterdraw *************** */ - -typedef struct View3DAfter { - struct View3DAfter *next, *prev; - struct Base *base; - int type; -} View3DAfter; - -/* temp storage of Objects that need to be drawn as last */ -void add_view3d_after(View3D *v3d, Base *base, int type) -{ - View3DAfter *v3da= MEM_callocN(sizeof(View3DAfter), "View 3d after"); - - BLI_addtail(&v3d->afterdraw, v3da); - v3da->base= base; - v3da->type= type; -} - -/* clears zbuffer and draws it over */ -static void view3d_draw_xray(View3D *v3d, int flag) -{ - View3DAfter *v3da, *next; - int doit= 0; - - for(v3da= v3d->afterdraw.first; v3da; v3da= v3da->next) - if(v3da->type==V3D_XRAY) doit= 1; - - if(doit) { - if(v3d->zbuf) glClear(GL_DEPTH_BUFFER_BIT); - v3d->xray= TRUE; - - for(v3da= v3d->afterdraw.first; v3da; v3da= next) { - next= v3da->next; - if(v3da->type==V3D_XRAY) { - draw_object(v3da->base, flag); - BLI_remlink(&v3d->afterdraw, v3da); - MEM_freeN(v3da); - } - } - v3d->xray= FALSE; - } -} - -/* disables write in zbuffer and draws it over */ -static void view3d_draw_transp(View3D *v3d, int flag) -{ - View3DAfter *v3da, *next; - - glDepthMask(0); - v3d->transp= TRUE; - - for(v3da= v3d->afterdraw.first; v3da; v3da= next) { - next= v3da->next; - if(v3da->type==V3D_TRANSP) { - draw_object(v3da->base, flag); - BLI_remlink(&v3d->afterdraw, v3da); - MEM_freeN(v3da); - } - } - v3d->transp= FALSE; - - glDepthMask(1); - -} - -/* *********************** */ - -/* - In most cases call draw_dupli_objects, - draw_dupli_objects_color was added because when drawing set dupli's - we need to force the color -*/ -static void draw_dupli_objects_color(View3D *v3d, Base *base, int color) -{ - ListBase *lb; - DupliObject *dob; - Base tbase; - BoundBox *bb= NULL; - GLuint displist=0; - short transflag, use_displist= -1; /* -1 is initialize */ - char dt, dtx; - - if (base->object->restrictflag & OB_RESTRICT_VIEW) return; - - /* test if we can do a displist */ - if(base->object->transflag & OB_DUPLIGROUP) - use_displist= 0; - - tbase.flag= OB_FROMDUPLI|base->flag; - lb= object_duplilist(G.scene, base->object); - - for(dob= lb->first; dob; dob= dob->next) { - if(dob->no_draw); - else { - tbase.object= dob->ob; - - /* extra service: draw the duplicator in drawtype of parent */ - dt= tbase.object->dt; tbase.object->dt= base->object->dt; - dtx= tbase.object->dtx; tbase.object->dtx= base->object->dtx; - - /* negative scale flag has to propagate */ - transflag= tbase.object->transflag; - if(base->object->transflag & OB_NEG_SCALE) - tbase.object->transflag ^= OB_NEG_SCALE; - - BIF_ThemeColorBlend(color, TH_BACK, 0.5); - - /* generate displist, test for new object */ - if(use_displist==1 && dob->prev && dob->prev->ob!=dob->ob) { - use_displist= -1; - glDeleteLists(displist, 1); - } - /* generate displist */ - if(use_displist == -1) { - - /* lamp drawing messes with matrices, could be handled smarter... but this works */ - if(dob->ob->type==OB_LAMP) - use_displist= 0; - else { - /* disable boundbox check for list creation */ - object_boundbox_flag(dob->ob, OB_BB_DISABLED, 1); - /* need this for next part of code */ - bb= object_get_boundbox(dob->ob); - - Mat4One(dob->ob->obmat); /* obmat gets restored */ - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE); - draw_object(&tbase, DRAW_CONSTCOLOR); - glEndList(); - - use_displist= 1; - object_boundbox_flag(dob->ob, OB_BB_DISABLED, 0); - } - } - if(use_displist) { - mymultmatrix(dob->mat); - if(boundbox_clip(dob->mat, bb)) - glCallList(displist); - myloadmatrix(G.vd->viewmat); - } - else { - Mat4CpyMat4(dob->ob->obmat, dob->mat); - draw_object(&tbase, DRAW_CONSTCOLOR); - } - - tbase.object->dt= dt; - tbase.object->dtx= dtx; - tbase.object->transflag= transflag; - } - } - - /* Transp afterdraw disabled, afterdraw only stores base pointers, and duplis can be same obj */ - - free_object_duplilist(lb); /* does restore */ - - if(use_displist) - glDeleteLists(displist, 1); -} - -static void draw_dupli_objects(View3D *v3d, Base *base) -{ - /* define the color here so draw_dupli_objects_color can be called - * from the set loop */ - - int color= (base->flag & SELECT)?TH_SELECT:TH_WIRE; - /* debug */ - if(base->object->dup_group && base->object->dup_group->id.us<1) - color= TH_REDALERT; - - draw_dupli_objects_color(v3d, base, color); -} - -void view3d_update_depths(View3D *v3d) -{ - /* Create storage for, and, if necessary, copy depth buffer */ - if(!v3d->depths) v3d->depths= MEM_callocN(sizeof(ViewDepths),"ViewDepths"); - if(v3d->depths) { - ViewDepths *d= v3d->depths; - if(d->w != v3d->area->winx || - d->h != v3d->area->winy || - !d->depths) { - d->w= v3d->area->winx; - d->h= v3d->area->winy; - if(d->depths) - MEM_freeN(d->depths); - d->depths= MEM_mallocN(sizeof(float)*d->w*d->h,"View depths"); - d->damaged= 1; - } - - if(d->damaged) { - glReadPixels(v3d->area->winrct.xmin,v3d->area->winrct.ymin,d->w,d->h, - GL_DEPTH_COMPONENT,GL_FLOAT, d->depths); - - glGetDoublev(GL_DEPTH_RANGE,d->depth_range); - - d->damaged= 0; - } - } -} - -/* Enable sculpting in wireframe mode by drawing sculpt object only to the depth buffer */ -static void draw_sculpt_depths(View3D *v3d) -{ - Object *ob = OBACT; - - int dt= MIN2(v3d->drawtype, ob->dt); - if(v3d->zbuf==0 && dt>OB_WIRE) - dt= OB_WIRE; - if(dt == OB_WIRE) { - GLboolean depth_on; - int orig_vdt = v3d->drawtype; - int orig_zbuf = v3d->zbuf; - int orig_odt = ob->dt; - - glGetBooleanv(GL_DEPTH_TEST, &depth_on); - v3d->drawtype = ob->dt = OB_SOLID; - v3d->zbuf = 1; - - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - glEnable(GL_DEPTH_TEST); - draw_object(BASACT, 0); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - if(!depth_on) - glDisable(GL_DEPTH_TEST); - - v3d->drawtype = orig_vdt; - v3d->zbuf = orig_zbuf; - ob->dt = orig_odt; - } -} - -static void draw_viewport_fps(ScrArea *sa); - - -void drawview3dspace(ScrArea *sa, void *spacedata) -{ - View3D *v3d= spacedata; - Base *base; - Object *ob; - Scene *sce; - char retopo, sculpt; - Object *obact = OBACT; - - /* update all objects, ipos, matrices, displists, etc. Flags set by depgraph or manual, - no layer check here, gets correct flushed */ - /* sets first, we allow per definition current scene to have dependencies on sets */ - if(G.scene->set) { - for(SETLOOPER(G.scene->set, base)) - object_handle_update(base->object); // bke_object.h - } - - for(base= G.scene->base.first; base; base= base->next) - object_handle_update(base->object); // bke_object.h - - setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */ - setviewmatrixview3d(); /* note: calls where_is_object for camera... */ - - Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); - Mat4Invert(v3d->persinv, v3d->persmat); - Mat4Invert(v3d->viewinv, v3d->viewmat); - - /* calculate pixelsize factor once, is used for lamps and obcenters */ - { - float len1, len2, vec[3]; - - VECCOPY(vec, v3d->persinv[0]); - len1= Normalize(vec); - VECCOPY(vec, v3d->persinv[1]); - len2= Normalize(vec); - - v3d->pixsize= 2.0f*(len1>len2?len1:len2); - - /* correct for window size */ - if(sa->winx > sa->winy) v3d->pixsize/= (float)sa->winx; - else v3d->pixsize/= (float)sa->winy; - } - - if(v3d->drawtype > OB_WIRE) { - if(G.f & G_SIMULATION) - glClearColor(0.0, 0.0, 0.0, 0.0); - else { - float col[3]; - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - } - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glLoadIdentity(); - } - else { - float col[3]; - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - } - - myloadmatrix(v3d->viewmat); - persp(PERSP_STORE); // store correct view for persp(PERSP_VIEW) calls - - if(v3d->flag & V3D_CLIPPING) - view3d_draw_clipping(v3d); - - /* set zbuffer after we draw clipping region */ - if(v3d->drawtype > OB_WIRE) { - v3d->zbuf= TRUE; - glEnable(GL_DEPTH_TEST); - } - - // needs to be done always, gridview is adjusted in drawgrid() now - v3d->gridview= v3d->grid; - - if(v3d->view==0 || v3d->persp!=0) { - drawfloor(); - if(v3d->persp==2) { - if(G.scene->world) { - if(G.scene->world->mode & WO_STARS) { - RE_make_stars(NULL, star_stuff_init_func, star_stuff_vertex_func, - star_stuff_term_func); - } - } - if(v3d->flag & V3D_DISPBGPIC) draw_bgpic(); - } - } - else { - drawgrid(); - - if(v3d->flag & V3D_DISPBGPIC) { - draw_bgpic(); - } - } - - if(v3d->flag & V3D_CLIPPING) - view3d_set_clipping(v3d); - - /* draw set first */ - if(G.scene->set) { - for(SETLOOPER(G.scene->set, base)) { - - if(v3d->lay & base->lay) { - - BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); - draw_object(base, DRAW_CONSTCOLOR); - - if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects_color(v3d, base, TH_WIRE); - } - } - } - - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, DRAW_CONSTCOLOR); // clears zbuffer if it is used! - view3d_draw_transp(v3d, DRAW_CONSTCOLOR); - } - - /* then draw not selected and the duplis, but skip editmode object */ - for(base= G.scene->base.first; base; base= base->next) { - if(v3d->lay & base->lay) { - - /* dupli drawing */ - if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(v3d, base); - } - if((base->flag & SELECT)==0) { - if(base->object!=G.obedit) draw_object(base, 0); - } - } - } - - retopo= retopo_mesh_check() || retopo_curve_check(); - sculpt= (G.f & G_SCULPTMODE) && !G.obedit; - if(retopo) - view3d_update_depths(v3d); - - /* draw selected and editmode */ - for(base= G.scene->base.first; base; base= base->next) { - if(v3d->lay & base->lay) { - if (base->object==G.obedit || ( base->flag & SELECT) ) - draw_object(base, 0); - } - } - - if(!retopo && sculpt && !(obact && (obact->dtx & OB_DRAWXRAY))) { - draw_sculpt_depths(v3d); - view3d_update_depths(v3d); - } - - if(G.moving) { - BIF_drawConstraint(); - if(G.obedit || (G.f & G_PARTICLEEDIT)) - BIF_drawPropCircle(); // only editmode and particles have proportional edit - BIF_drawSnap(); - } - - if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); - - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, 0); // clears zbuffer if it is used! - view3d_draw_transp(v3d, 0); - - if(!retopo && sculpt && (obact && (OBACT->dtx & OB_DRAWXRAY))) { - draw_sculpt_depths(v3d); - view3d_update_depths(v3d); - } - - if(v3d->flag & V3D_CLIPPING) - view3d_clr_clipping(); - - BIF_draw_manipulator(sa); - - if(v3d->zbuf) { - v3d->zbuf= FALSE; - glDisable(GL_DEPTH_TEST); - } - - persp(PERSP_WIN); // set ortho - - /* Draw Sculpt Mode brush */ - if(!G.obedit && (G.f & G_SCULPTMODE) && area_is_active_area(v3d->area) && sculpt_session()) { - PropsetData *pd= sculpt_session()->propset; - short r1=100, r2=100, r3=100; - short mouse[2]; - - if(sculpt_data()->flags & SCULPT_INPUT_SMOOTH) - sculpt_stroke_draw(); - - if(pd) { - if(pd->mode == PropsetSize) { - r1= sculptmode_brush()->size; - r2= pd->origsize; - r3= r1; - } else if(pd->mode == PropsetStrength) { - r1= 200 - sculptmode_brush()->strength * 2; - r2= 200; - r3= 200; - } else if(pd->mode == PropsetTexRot) { - r1= r2= 200; - r3= 200; - } - - /* Draw brush with texture */ - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glBindTexture(GL_TEXTURE_2D, pd->tex); - - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - glPushMatrix(); - glTranslatef(pd->origloc[0], pd->origloc[1], 0); - glRotatef(tex_angle(), 0, 0, 1); - - glEnable(GL_TEXTURE_2D); - glBegin(GL_QUADS); - glColor4f(0,0,0,1); - glTexCoord2f(0,0); - glVertex2f(-r3, -r3); - glTexCoord2f(1,0); - glVertex2f(r3, -r3); - glTexCoord2f(1,1); - glVertex2f(r3, r3); - glTexCoord2f(0,1); - glVertex2f(-r3, r3); - glEnd(); - glDisable(GL_TEXTURE_2D); - - glPopMatrix(); - - if(r1 != r2) - fdrawXORcirc(pd->origloc[0], pd->origloc[1], r1); - fdrawXORcirc(pd->origloc[0], pd->origloc[1], r2); - - if(pd->mode == PropsetTexRot) { - const float ang= pd->origtexrot * (M_PI/180.0f); - getmouseco_areawin(mouse); - sdrawXORline(pd->origloc[0], pd->origloc[1], - pd->origloc[0]+200*cos(ang), pd->origloc[1]+200*sin(ang)); - sdrawXORline(pd->origloc[0], pd->origloc[1], mouse[0], mouse[1]); - } - } - else if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) { - short csc[2], car[2]; - getmouseco_sc(csc); - getmouseco_areawin(car); - if(csc[0] > v3d->area->winrct.xmin && - csc[1] > v3d->area->winrct.ymin && - csc[0] < v3d->area->winrct.xmax && - csc[1] < v3d->area->winrct.ymax) - fdrawXORcirc((float)car[0], (float)car[1], sculptmode_brush()->size); - } - } - - retopo_paint_view_update(v3d); - retopo_draw_paint_lines(); - - if(!G.obedit && OBACT && G.f&G_PARTICLEEDIT && area_is_active_area(v3d->area)){ - ParticleSystem *psys = PE_get_current(OBACT); - ParticleEditSettings *pset = PE_settings(); - - short c[2]; - if(psys && psys->edit && pset->brushtype>=0){ - getmouseco_areawin(c); - fdrawXORcirc((float)c[0], (float)c[1], (float)pset->brush[pset->brushtype].size); - } - } - - if(v3d->persp>1) drawviewborder(); - if(v3d->flag2 & V3D_FLYMODE) drawviewborder_flymode(); - if(!(G.f & G_PLAYANIM)) drawcursor(v3d); - if(U.uiflag & USER_SHOW_ROTVIEWICON) - draw_view_axis(); - else - draw_view_icon(); - - if(U.uiflag & USER_SHOW_FPS && G.f & G_PLAYANIM) { - draw_viewport_fps(sa); - } else if(U.uiflag & USER_SHOW_VIEWPORTNAME) { - draw_viewport_name(sa); - } - - ob= OBACT; - if(ob && (U.uiflag & USER_DRAWVIEWINFO)) - draw_selected_name(ob); - - draw_area_emboss(sa); - - /* it is important to end a view in a transform compatible with buttons */ - - bwin_scalematrix(sa->win, v3d->blockscale, v3d->blockscale, v3d->blockscale); - view3d_blockhandlers(sa); - - sa->win_swap= WIN_BACK_OK; - - if(G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || G.f & G_TEXTUREPAINT) { - v3d->flag |= V3D_NEEDBACKBUFDRAW; - addafterqueue(sa->win, BACKBUFDRAW, 1); - } - // test for backbuf select - if(G.obedit && v3d->drawtype>OB_WIRE && (v3d->flag & V3D_ZBUF_SELECT)) { - extern int afterqtest(short win, unsigned short evt); //editscreen.c - - v3d->flag |= V3D_NEEDBACKBUFDRAW; - if(afterqtest(sa->win, BACKBUFDRAW)==0) { - addafterqueue(sa->win, BACKBUFDRAW, 1); - } - } - - /* run any view3d draw handler script links */ - if (sa->scriptlink.totscript) - BPY_do_spacehandlers(sa, 0, SPACEHANDLER_VIEW3D_DRAW); - - /* run scene redraw script links */ - if((G.f & G_DOSCRIPTLINKS) && G.scene->scriptlink.totscript && - !during_script()) { - BPY_do_pyscript((ID *)G.scene, SCRIPT_REDRAW); - } - -} - - -void drawview3d_render(struct View3D *v3d, int winx, int winy, float winmat[][4]) -{ - Base *base; - Scene *sce; - float v3dwinmat[4][4]; - - if(!winmat) - setwinmatrixview3d(winx, winy, NULL); - - setviewmatrixview3d(); - myloadmatrix(v3d->viewmat); - - /* when winmat is not NULL, it overrides the regular window matrix */ - glMatrixMode(GL_PROJECTION); - if(winmat) - myloadmatrix(winmat); - mygetmatrix(v3dwinmat); - glMatrixMode(GL_MODELVIEW); - - Mat4MulMat4(v3d->persmat, v3d->viewmat, v3dwinmat); - Mat4Invert(v3d->persinv, v3d->persmat); - Mat4Invert(v3d->viewinv, v3d->viewmat); - - free_all_realtime_images(); - reshadeall_displist(); - - if(v3d->drawtype > OB_WIRE) { - v3d->zbuf= TRUE; - glEnable(GL_DEPTH_TEST); - } - - if(v3d->flag & V3D_CLIPPING) - view3d_set_clipping(v3d); - - if (v3d->drawtype==OB_TEXTURE && G.scene->world) { - glClearColor(G.scene->world->horr, G.scene->world->horg, G.scene->world->horb, 0.0); - } else { - float col[3]; - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - } - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - /* abuse! to make sure it doesnt draw the helpstuff */ - G.f |= G_SIMULATION; - - /* first draw set */ - if(G.scene->set) { - - for(SETLOOPER(G.scene->set, base)) { - if(v3d->lay & base->lay) { - if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE); - else { - where_is_object(base->object); - - BIF_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); - draw_object(base, DRAW_CONSTCOLOR); - - if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(v3d, base); - } - } - } - } - - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, DRAW_CONSTCOLOR); // clears zbuffer if it is used! - view3d_draw_transp(v3d, DRAW_CONSTCOLOR); - } - - /* first not selected and duplis */ - base= G.scene->base.first; - while(base) { - - if(v3d->lay & base->lay) { - if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE); - else { - - if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(v3d, base); - } - else if((base->flag & SELECT)==0) { - draw_object(base, 0); - } - } - } - - base= base->next; - } - - /* draw selected */ - base= G.scene->base.first; - while(base) { - - if ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) ) { - if ELEM3(base->object->type, OB_LAMP, OB_CAMERA, OB_LATTICE); - else draw_object(base, 0); - } - - base= base->next; - } - - if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); - - /* Transp and X-ray afterdraw stuff */ - view3d_draw_xray(v3d, 0); // clears zbuffer if it is used! - view3d_draw_transp(v3d, 0); - - if(v3d->flag & V3D_CLIPPING) - view3d_clr_clipping(); - - if(v3d->zbuf) { - v3d->zbuf= FALSE; - glDisable(GL_DEPTH_TEST); - } - - G.f &= ~G_SIMULATION; - - glFlush(); - - glLoadIdentity(); - - free_all_realtime_images(); -} - - -double tottime = 0.0; -static ScrArea *oldsa; -static double swaptime; -static int curmode; - -/* used for fps display */ -static double redrawtime; -static double lredrawtime; - -int update_time(void) -{ - static double ltime; - double time; - - if ((audiostream_pos() != CFRA) - && (G.scene->audio.flag & AUDIO_SYNC)) { - return 0; - } - - time = PIL_check_seconds_timer(); - - tottime += (time - ltime); - ltime = time; - return (tottime < 0.0); -} - -static void draw_viewport_fps(ScrArea *sa) -{ - float fps; - char printable[16]; - - - if (lredrawtime == redrawtime) - return; - - printable[0] = '\0'; - fps = (float)(1.0/(lredrawtime-redrawtime)); - - /* is this more then half a frame behind? */ - if (fps+0.5 < FPS) { - BIF_ThemeColor(TH_REDALERT); - sprintf(printable, "fps: %.2f", (float)fps); - } else { - BIF_ThemeColor(TH_TEXT_HI); - sprintf(printable, "fps: %i", (int)(fps+0.5)); - } - - glRasterPos2i(10, sa->winy-20); - BMF_DrawString(G.fonts, printable); -} - -static void inner_play_prefetch_frame(int mode, int cfra) -{ - ScrArea *sa; - int oldcfra = CFRA; - ScrArea *oldcurarea = curarea; - - if (!U.prefetchframes) { - return; - } - - CFRA = cfra; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa==oldsa) { - scrarea_do_winprefetchdraw(sa); - } - else if(mode & 1) { /* all view3d and seq spaces */ - if ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ) { - scrarea_do_winprefetchdraw(sa); - } - } - else if(mode & 4) { /* all seq spaces */ - if (sa->spacetype == SPACE_SEQ) { - scrarea_do_winprefetchdraw(sa); - } - } - - sa= sa->next; - } - - CFRA = oldcfra; - curarea = oldcurarea; -} - -static void inner_play_prefetch_startup(int mode) -{ - int i; - - if (!U.prefetchframes) { - return; - } - - seq_start_threads(); - - for (i = 0; i <= U.prefetchframes; i++) { - int cfra = CFRA + i; - inner_play_prefetch_frame(mode, cfra); - } - - seq_wait_for_prefetch_ready(); -} - -static void inner_play_prefetch_shutdown(int mode) -{ - if (!U.prefetchframes) { - return; - } - seq_stop_threads(); -} - -static int cached_dynamics(int sfra, int efra) -{ - Base *base = G.scene->base.first; - Object *ob; - ModifierData *md; - ParticleSystem *psys; - int i, stack_index=-1, cached=1; - - while(base && cached) { - ob = base->object; - if(ob->softflag & OB_SB_ENABLE && ob->soft) { - for(i=0, md=ob->modifiers.first; md; i++, md=md->next) { - if(md->type == eModifierType_Softbody) { - stack_index = i; - break; - } - } - for(i=sfra; i<=efra && cached; i++) - cached &= BKE_ptcache_id_exist(&ob->id,i,stack_index); - } - - for(psys=ob->particlesystem.first; psys; psys=psys->next) { - stack_index = modifiers_indexInObject(ob,(ModifierData*)psys_get_modifier(ob,psys)); - if(psys->part->type==PART_HAIR) { - if(psys->softflag & OB_SB_ENABLE && psys->soft); - else - stack_index = -1; - } - - if(stack_index >= 0) - for(i=sfra; i<=efra && cached; i++) - cached &= BKE_ptcache_id_exist(&ob->id,i,stack_index); - } - - base = base->next; - } - - return cached; -} -void inner_play_anim_loop(int init, int mode) -{ - ScrArea *sa; - static int last_cfra = -1; - static int cached = 0; - - /* init */ - if(init) { - oldsa= curarea; - swaptime= 1.0/FPS; - tottime= 0.0; - curmode= mode; - last_cfra = -1; - cached = cached_dynamics(PSFRA,PEFRA); - - redrawtime = 1.0/FPS; - lredrawtime = 0.0; - return; - } - - if (CFRA != last_cfra) { - int pf; - set_timecursor(CFRA); - - update_for_newframe_nodraw(1); /* adds no events in UI */ - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa==oldsa) { - scrarea_do_windraw(sa); - } - else if(curmode & 1) { /* all view3d and seq spaces */ - if ELEM(sa->spacetype, SPACE_VIEW3D, SPACE_SEQ) { - scrarea_do_windraw(sa); - } - } - else if(curmode & 4) { /* all seq spaces */ - if (sa->spacetype == SPACE_SEQ) { - scrarea_do_windraw(sa); - } - } - - sa= sa->next; - } - - if (last_cfra == -1) { - last_cfra = CFRA - 1; - } - - if (U.prefetchframes) { - pf = last_cfra; - - if (CFRA - last_cfra >= U.prefetchframes || - CFRA - last_cfra < 0) { - pf = CFRA - U.prefetchframes; - fprintf(stderr, - "SEQ-THREAD: Lost sync, " - "stopping threads, " - "back to skip mode...\n"); - seq_stop_threads(); - } else { - while (pf < CFRA) { - int c; - pf++; - c = pf + U.prefetchframes; - if (c >= PEFRA) { - c -= PEFRA; - c += PSFRA; - } - - inner_play_prefetch_frame(curmode, c); - } - } - - } - } - - last_cfra = CFRA; - - /* make sure that swaptime passed by */ - tottime -= swaptime; - while (update_time()) { - PIL_sleep_ms(1); - } - - if (CFRA >= PEFRA) { - if (tottime > 0.0) { - tottime = 0.0; - } - CFRA = PSFRA; - audiostream_stop(); - audiostream_start( CFRA ); - cached = cached_dynamics(PSFRA,PEFRA); - } else { - if (cached - && (G.scene->audio.flag & AUDIO_SYNC)) { - CFRA = audiostream_pos(); - } else { - CFRA++; - } - if (CFRA < last_cfra) { - fprintf(stderr, - "SEQ-THREAD: CFRA running backwards: %d\n", - CFRA); - } - } - -} - -/* play_anim: 'mode' defines where to play and if repeat is on (now bitfield): - * - mode & 1 : All view3d and seq areas - * - mode & 2 : No replay - * - mode & 4 : All seq areas - */ -int play_anim(int mode) -{ - ScrArea *sa, *oldsa; - int cfraont; - unsigned short event=0; - short val; - - /* patch for very very old scenes */ - if(SFRA==0) SFRA= 1; - if(EFRA==0) EFRA= 250; - - if(PSFRA>PEFRA) return 0; - - /* waitcursor(1); */ - G.f |= G_PLAYANIM; /* in sequence.c and view.c this is handled */ - - cfraont= CFRA; - oldsa= curarea; - - if (curarea && curarea->spacetype == SPACE_SEQ) { - SpaceSeq *sseq = curarea->spacedata.first; - if (sseq->mainb == 0) mode |= 4; - } - - inner_play_prefetch_startup(mode); - - update_time(); - - inner_play_anim_loop(1, mode); /* 1==init */ - - audiostream_start( CFRA ); - - /* forces all buffers to be OK for current frame (otherwise other windows get redrawn with CFRA+1) */ - curarea->win_swap= WIN_BACK_OK; - screen_swapbuffers(); - - while(TRUE) { - - if (U.uiflag & USER_SHOW_FPS) - lredrawtime = PIL_check_seconds_timer(); - - while(qtest()) { - - /* we test events first because of MKEY event */ - - event= extern_qread(&val); - if(event==ESCKEY) break; - else if(event==MIDDLEMOUSE) { - if(U.flag & USER_VIEWMOVE) { - if(G.qual & LR_SHIFTKEY) viewmove(0); - else if(G.qual & LR_CTRLKEY) viewmove(2); - else viewmove(1); - } - else { - if(G.qual & LR_SHIFTKEY) viewmove(1); - else if(G.qual & LR_CTRLKEY) viewmove(2); - else viewmove(0); - } - } - else if(event==MKEY) { - if(val) add_marker(CFRA-1); - } - } - if(ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break; - - inner_play_anim_loop(0, 0); - - - screen_swapbuffers(); - - if (U.uiflag & USER_SHOW_FPS) - redrawtime = lredrawtime; - - if((mode & 2) && CFRA==PEFRA) break; /* no replay */ - } - - if(event==SPACEKEY); - else CFRA= cfraont; - - inner_play_prefetch_shutdown(mode); - audiostream_stop(); - - if(oldsa!=curarea) areawinset(oldsa->win); - - /* restore all areas */ - sa= G.curscreen->areabase.first; - while(sa) { - if( ((mode & 1) && sa->spacetype==SPACE_VIEW3D) || sa==curarea) addqueue(sa->win, REDRAW, 1); - sa= sa->next; - } - - /* groups could have changed ipo */ - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - - /* restore for cfra */ - update_for_newframe_muted(); - - waitcursor(0); - G.f &= ~G_PLAYANIM; - - if (event==ESCKEY || event==SPACEKEY) return 1; - else return 0; -} diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c deleted file mode 100644 index fcd38ef16a7..00000000000 --- a/source/blender/src/edit.c +++ /dev/null @@ -1,1936 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "PIL_time.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_group_types.h" -#include "DNA_ipo_types.h" -#include "DNA_lattice_types.h" -#include "DNA_meta_types.h" -#include "DNA_mesh_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" /* for U.dupflag */ -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_linklist.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_anim.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_editmesh.h" -#include "BIF_editview.h" -#include "BIF_editarmature.h" -#include "BIF_editparticle.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BSE_edit.h" -#include "BSE_drawipo.h" -#include "BSE_drawview.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" - -#include "BDR_editobject.h" -#include "BDR_editmball.h" -#include "BDR_editcurve.h" - -/* old stuff */ -#include "blendef.h" -#include "mydevice.h" - -/*#include "armature.h"*/ -/* #include "edit.h" */ -#include "nla.h" -#include "transform.h" - -#ifdef __NLA -#include "BIF_editarmature.h" -#endif - - -/* circle selection callback */ -typedef void (*select_CBfunc)(short selecting, Object *editobj, short *mval, float rad); - -extern void obedit_selectionCB(short selecting, Object *editobj, - short *mval, float rad); -extern void uvedit_selectionCB(short selecting, Object *editobj, - short *mval, float rad); - -void circle_selectCB(select_CBfunc func); - -/* local protos ---------------*/ -void snap_curs_to_firstsel(void); - -/* flag==2 only border, flag==3 cross+border - flag==5 cross + border + start&end frame - */ -int get_border(rcti *rect, short flag) -{ - float dvec[4], fac1, fac2; - int retval=1; - unsigned short event= 0; - short mval[2], mvalo[4], val, x1, y1; - char str[64]; - - mywinset(G.curscreen->mainwin); - - /* slightly larger, 1 pixel at the edge */ - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - - /* removed my_get_frontbuffer, this crashes when it gets a part outside the screen */ - /* solved it with just a redraw! */ - - mywinset(curarea->win); - - glDrawBuffer(GL_FRONT); - persp(PERSP_WIN); - initgrabz(0.0, 0.0, 0.0); - - if(flag & 1) { - getmouseco_areawin(mvalo); - - /* draws the selection initial cross */ - sdrawXORline4(0, 0, mvalo[1], curarea->winx, mvalo[1]); - sdrawXORline4(1, mvalo[0], 0, mvalo[0], curarea->winy); - bglFlush(); - - while(TRUE) { - - /* selection loop while mouse pressed */ - getmouseco_areawin(mval); - - if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { - - /* aiming cross */ - sdrawXORline4(0, 0, mval[1], curarea->winx, mval[1]); - sdrawXORline4(1, mval[0], 0, mval[0], curarea->winy); - bglFlush(); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - event= extern_qread(&val); - - if(event && val) { - - /* for when a renderwindow is open, and a mouse cursor activates it */ - persp(PERSP_VIEW); - mywinset(curarea->win); - persp(PERSP_WIN); - - if(event==ESCKEY) { - retval= 0; - break; - } - else if(event==BKEY) { - /* b has been pressed twice: proceed with circle select */ - retval= 0; - break; - } - else if(event==LEFTMOUSE) break; - else if(event==MIDDLEMOUSE) break; - else if(event==RIGHTMOUSE) break; - } - else PIL_sleep_ms(10); - - } /* end while (TRUE) */ - - /* erase XORed lines */ - sdrawXORline4(-1, 0, 0, 0, 0); - } - else getmouseco_areawin(mval); - - if(retval) { - /* box select */ - x1= mval[0]; - y1= mval[1]; - - getmouseco_areawin(mvalo); - - sdrawXORline4(0, x1, y1, x1, mvalo[1]); - sdrawXORline4(1, x1, mvalo[1], mvalo[0], mvalo[1]); - sdrawXORline4(2, mvalo[0], mvalo[1], mvalo[0], y1); - sdrawXORline4(3, mvalo[0], y1, x1, y1); - bglFlush(); - - while(TRUE) { - getmouseco_areawin(mval); - if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { - - sdrawXORline4(0, x1, y1, x1, mval[1]); - sdrawXORline4(1, x1, mval[1], mval[0], mval[1]); - sdrawXORline4(2, mval[0], mval[1], mval[0], y1); - sdrawXORline4(3, mval[0], y1, x1, y1); - - /* draw size information in corner */ - if(curarea->spacetype==SPACE_VIEW3D) { - BIF_ThemeColor(TH_BACK); - glRecti(10, 25, 250, 40); - - if(G.vd->persp==0) { - window_to_3d(dvec, mvalo[0]-x1, mvalo[1]-y1); - - sprintf(str, "X %.4f Y %.4f Z %.4f Dia %.4f", dvec[0], dvec[1], dvec[2], sqrt(dvec[0]*dvec[0]+dvec[1]*dvec[1]+dvec[2]*dvec[2])); - glColor3f(0.0, 0.0, 0.0); - glRasterPos2i(15, 27); - BMF_DrawString(G.fonts, str); - glColor3f(0.7, 0.7, 0.7); - glRasterPos2i(16, 28); - BMF_DrawString(G.fonts, str); - } - else if(G.vd->persp==2) { - rctf vb; - - calc_viewborder(G.vd, &vb); - - fac1= (mvalo[0]-x1)/( (float) (vb.xmax-vb.xmin) ); - fac1*= 0.01*G.scene->r.size*G.scene->r.xsch; - - fac2= (mvalo[1]-y1)/( (float) (vb.ymax-vb.ymin) ); - fac2*= 0.01*G.scene->r.size*G.scene->r.ysch; - - sprintf(str, "X %.1f Y %.1f Dia %.1f", fabs(fac1), fabs(fac2), sqrt(fac1*fac1 + fac2*fac2) ); - glColor3f(0.0, 0.0, 0.0); - glRasterPos2i(15, 27); - BMF_DrawString(G.fonts, str); - glColor3f(0.7, 0.7, 0.7); - glRasterPos2i(16, 28); - BMF_DrawString(G.fonts, str); - } - } - else if(curarea->spacetype==SPACE_IPO) { - SpaceIpo *sipo= curarea->spacedata.first; - - BIF_ThemeColor(TH_BACK); - glRecti(20, 30, 170, 40); - - mvalo[2]= x1; - mvalo[3]= y1; - areamouseco_to_ipoco(&sipo->v2d, mval, dvec, dvec+1); - areamouseco_to_ipoco(&sipo->v2d, mvalo+2, dvec+2, dvec+3); - - if (flag == 5) { - /* setting preview range */ - if (dvec[0] < dvec[2]) - sprintf(str, "Preview Range: %d to %d", (int)dvec[0], (int)dvec[2]); - else - sprintf(str, "Preview Range: %d to %d", (int)dvec[2], (int)dvec[0]); - } - else - sprintf(str, "Time: %.4f Y %.4f", dvec[0]-dvec[2], dvec[1]-dvec[3]); - - BIF_ThemeColor(TH_BACK); - glRecti(14, 24, 165, 38); - - glColor3f(0.0, 0.0, 0.0); - glRasterPos2i(15, 27); - BMF_DrawString(G.fonts, str); - glColor3f(0.8, 0.8, 0.8); - glRasterPos2i(16, 28); - BMF_DrawString(G.fonts, str); - } - else if ((ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME)) && flag==5) { - /* only while setting preview range */ - View2D *v2d; - - switch (curarea->spacetype) - { - case SPACE_ACTION: - { - SpaceAction *saaction= curarea->spacedata.first; - v2d= &saaction->v2d; - } - break; - case SPACE_NLA: - { - SpaceNla *snla= curarea->spacedata.first; - v2d= &snla->v2d; - } - break; - default: - v2d= G.v2d; - break; - } - - mvalo[2]= x1; - mvalo[3]= y1; - areamouseco_to_ipoco(v2d, mval, dvec, dvec+1); - areamouseco_to_ipoco(v2d, mvalo+2, dvec+2, dvec+3); - - if (dvec[0] < dvec[2]) - sprintf(str, "Preview Range: %d to %d", (int)dvec[0], (int)dvec[2]); - else - sprintf(str, "Preview Range: %d to %d", (int)dvec[2], (int)dvec[0]); - - BIF_ThemeColor(TH_BACK); - glRecti(14, 24, 165, 38); - - glColor3f(0.0, 0.0, 0.0); - glRasterPos2i(15, 27); - BMF_DrawString(G.fonts, str); - glColor3f(0.8, 0.8, 0.8); - glRasterPos2i(16, 28); - BMF_DrawString(G.fonts, str); - } - - bglFlush(); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - - event= extern_qread(&val); - - if(event && val==0) { - /* still because of the renderwindow... */ - persp(PERSP_VIEW); - mywinset(curarea->win); - persp(PERSP_WIN); - - if(event==ESCKEY) { - retval= 0; - break; - } - else if(event==LEFTMOUSE) break; - else if(event==MIDDLEMOUSE) break; - else if(event==RIGHTMOUSE) break; - } - - } /* end while (TRUE) */ - sdrawXORline4(-1, 0, 0, 0, 0); - - if(retval) { - rect->xmin= x1; - rect->ymin= y1; - rect->xmax= mval[0]; - rect->ymax= mval[1]; - retval= event; - - /* normalize */ - if(rect->xmin>rect->xmax) SWAP(int, rect->xmin, rect->xmax); - if(rect->ymin>rect->ymax) SWAP(int, rect->ymin, rect->ymax); - - if(rect->xmin==rect->xmax) retval= 0; - if(rect->ymin==rect->ymax) retval= 0; - } - } - - - /* clear */ - if(event!=BKEY) { - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_IPO) { - scrarea_queue_winredraw(curarea); - } - else if ELEM3(curarea->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_TIME) { - scrarea_queue_winredraw(curarea); // only really needed for - } - } - - bglFlush(); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - - persp(PERSP_VIEW); - - /* pressed B again ? -> brush select */ - if(event==BKEY) { - setlinestyle(0); - switch (curarea->spacetype) { - case SPACE_VIEW3D: - if (G.obedit) { - if ELEM4(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) { - circle_selectCB(&obedit_selectionCB); - } - } - else if (FACESEL_PAINT_TEST) { - circle_selectCB(&obedit_selectionCB); - } - else if (G.f&G_PARTICLEEDIT) { - circle_selectCB(&PE_selectionCB); - } - return 0; - - case SPACE_IMAGE: // brush select in UV editor - circle_selectCB(&uvedit_selectionCB); - // this is a hack; we return 0 that the caller from get_border - // doesn't execute the selection code for border select.. - return 0; - } - } - return retval; -} - -void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selecting) -{ - static short no_mvalo=0; - - if(mval==NULL && mvalo==NULL) { /* signal */ - no_mvalo= 1; - return; - } - - persp(PERSP_WIN); - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - //setlinestyle(2); - - /* draw circle */ - if(mvalo && no_mvalo==0) { - fdrawXORcirc(mvalo[0], mvalo[1], rado); - } - - if(mval) { - fdrawXORcirc(mval[0], mval[1], rad); - } - //setlinestyle(0); - - bglFlush(); - persp(PERSP_VIEW); - glDrawBuffer(GL_BACK); - glReadBuffer(GL_BACK); - - no_mvalo= 0; -} - -/** This function does the same as editview.c:circle_select(), - * but the selection actions are defined by a callback, making - * it (hopefully) reusable for other windows than the 3D view. - */ - -void circle_selectCB(select_CBfunc callback) -{ - static float rad= 40.0; - float rado= rad; - int firsttime=1; - int escape= 0; - unsigned short event; - short mvalo[2], mval[2], val; - short selecting=0; - Object *obj; - - if(G.obedit) obj = G.obedit; - else obj = OBACT; - - mywinset(curarea->win); - - getmouseco_areawin(mvalo); - mval[0]= mvalo[0]; mval[1]= mvalo[1]; - - draw_sel_circle(mval, NULL, rad, 0.0, selecting); // draws frontbuffer, but sets backbuf again - - while(TRUE) { - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || rado!=rad || firsttime) { - firsttime= 0; - - if(selecting) { - callback(selecting, obj, mval, rad); - } - - draw_sel_circle(mval, mvalo, rad, rado, selecting); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - rado= rad; - - } - - while(qtest()) { - event= extern_qread(&val); - if (event) { - - /* for when another window is open and a mouse cursor activates it */ - if(event!=MOUSEY && event!=MOUSEX) mywinset(curarea->win); - - getmouseco_areawin(mval); // important to do here, trust events! - - switch(event) { - - case LEFTMOUSE: - case MIDDLEMOUSE: - if(val) selecting= event; - else selecting= 0; - firsttime= 1; - - break; - case PAGEUPKEY: - case WHEELDOWNMOUSE: - case PADPLUSKEY: - case EQUALKEY: - if(val) if(rad<200.0) rad*= 1.2; - break; - case PAGEDOWNKEY: - case WHEELUPMOUSE: - case PADMINUS: - case MINUSKEY: - if(val) if(rad>5.0) rad/= 1.2; - break; - - case ESCKEY: case SPACEKEY: case RIGHTMOUSE: case INPUTCHANGE: - case GKEY: case SKEY: case RKEY: case XKEY: case EKEY: case TABKEY: - escape= 1; - break; - - } - - if(escape) break; - } - } - PIL_sleep_ms(10); - - if(escape) break; - } - - /* clear circle */ - draw_sel_circle(NULL, mvalo, 0, rad, 1); - BIF_undo_push("Circle Select"); - countall(); - allqueue(REDRAWINFO, 0); -} - -static void count_object(Object *ob, int sel, int totob) -{ - Mesh *me; - Curve *cu; - DerivedMesh *dm; - int tot=0, totf=0; - - switch(ob->type) { - case OB_MESH: - G.totmesh+=totob; - me= get_mesh(ob); - if(me) { - int totvert, totedge, totface; - dm = mesh_get_derived_final(ob, get_viewedit_datamask()); - totvert = dm->getNumVerts(dm); - totedge = dm->getNumEdges(dm); - totface = dm->getNumFaces(dm); - - G.totvert+= totvert*totob; - G.totedge+= totedge*totob; - G.totface+= totface*totob; - if(sel) { - G.totvertsel+= totvert; - G.totfacesel+= totface; - } - } - break; - - case OB_LAMP: - G.totlamp+=totob; - break; - case OB_SURF: - case OB_CURVE: - case OB_FONT: - G.totcurve+=totob; - tot=totf= 0; - cu= ob->data; - if(cu->disp.first) - count_displist( &cu->disp, &tot, &totf); - tot*= totob; - totf*= totob; - G.totvert+= tot; - G.totface+= totf; - if(sel) { - G.totvertsel+= tot; - G.totfacesel+= totf; - } - break; - case OB_MBALL: - count_displist( &ob->disp, &tot, &totf); - tot*= totob; - totf*= totob; - G.totvert+= tot; - G.totface+= totf; - if(sel) { - G.totvertsel+= tot; - G.totfacesel+= totf; - } - break; - } - -} - -/* countall does statistics */ -/* is called on most actions, like select/add/delete/layermove */ -void countall() -{ - extern ListBase editNurb; - Base *base; - Object *ob= OBACT; - Mesh *me; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - MetaElem *ml; - struct EditBone *ebo; - int a; - - G.totvert= G.totvertsel= G.totedge= G.totedgesel= G.totfacesel= G.totface= G.totobj= - G.totmesh= G.totlamp= G.totcurve= G.totobjsel= G.totbone= G.totbonesel= 0; - - if(G.obedit) { - - if(G.obedit->type==OB_MESH) { - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - for(eve= em->verts.first; eve; eve= eve->next) { - G.totvert++; - if(eve->f & SELECT) G.totvertsel++; - } - for(eed= em->edges.first; eed; eed= eed->next) { - G.totedge++; - if(eed->f & SELECT) G.totedgesel++; - } - for(efa= em->faces.first; efa; efa= efa->next) { - G.totface++; - if(efa->f & SELECT) G.totfacesel++; - } - - EM_validate_selections(); - } - else if (G.obedit->type==OB_ARMATURE){ - for (ebo=G.edbo.first;ebo;ebo=ebo->next){ - G.totbone++; - - /* Sync selection to parent for connected children */ - if ((ebo->flag & BONE_CONNECTED) && ebo->parent){ - G.totvert--; - if (ebo->parent->flag & BONE_TIPSEL) - ebo->flag |= BONE_ROOTSEL; - else - ebo->flag &= ~BONE_ROOTSEL; - } - - if (ebo->flag & BONE_TIPSEL) - G.totvertsel++; - if (ebo->flag & BONE_ROOTSEL) - G.totvertsel++; - - if ((ebo->flag & BONE_TIPSEL) && (ebo->flag & BONE_ROOTSEL)) - ebo->flag |= BONE_SELECTED; - else - ebo->flag &= ~BONE_SELECTED; - - if(ebo->flag & BONE_SELECTED) G.totbonesel++; - - // If this is a connected child and it's parent is being moved, remove our root - if ((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL)){ - G.totvertsel--; - } - - G.totvert+=2; - } - } - else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT) { - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - G.totvert+=3; - if(bezt->f1) G.totvertsel++; - if(bezt->f2) G.totvertsel++; - if(bezt->f3) G.totvertsel++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - G.totvert++; - if(bp->f1 & SELECT) G.totvertsel++; - bp++; - } - } - nu= nu->next; - } - } - else if(G.obedit->type==OB_MBALL) { - /* editmball.c */ - extern ListBase editelems; /* go away ! */ - - ml= editelems.first; - while(ml) { - G.totvert++; - if(ml->flag & SELECT) G.totvertsel++; - ml= ml->next; - } - } - else if(G.obedit->type==OB_LATTICE) { - bp= editLatt->def; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - while(a--) { - G.totvert++; - if(bp->f1 & SELECT) G.totvertsel++; - bp++; - } - } - - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - return; - } - else if(ob && (ob->flag & OB_POSEMODE)) { - if(ob->pose) { - bArmature *arm= ob->data; - bPoseChannel *pchan; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - G.totbone++; - if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) - if(pchan->bone->layer & arm->layer) - G.totbonesel++; - } - } - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - return; - } - else if(FACESEL_PAINT_TEST) { - me= get_mesh((G.scene->basact) ? (G.scene->basact->object) : 0); - if(me) { - G.totface= me->totface; - G.totvert= me->totvert; - } - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - return; - } - - if(G.scene==NULL) return; - - base= (G.scene->base.first); - while(base) { - if(G.scene->lay & base->lay) { - ob= base->object; /* warning, ob not is obact anymore */ - - if(base->flag & SELECT) G.totobjsel++; - - if(ob->transflag & OB_DUPLIPARTS) { - ParticleSystem *psys; - ParticleSettings *part; - int step_nbr; - - for(psys=ob->particlesystem.first; psys; psys=psys->next){ - part=psys->part; - - //if(psys->flag&PSYS_BAKED && part->draw&PART_DRAW_KEYS) - // step_nbr=part->keys_step; - //else - step_nbr=1; - - if(part->draw_as==PART_DRAW_OB && part->dup_ob){ - int tot=count_particles(psys); - count_object(part->dup_ob, 0, tot*step_nbr); - } - else if(part->draw_as==PART_DRAW_GR && part->dup_group){ - GroupObject *go; - int tot, totgroup=0, cur=0; - - go= part->dup_group->gobject.first; - while(go){ - go=go->next; - totgroup++; - } - go= part->dup_group->gobject.first; - while(go){ - tot=count_particles_mod(psys,totgroup,cur); - count_object(go->ob, 0, tot*step_nbr); - cur++; - go=go->next; - } - } - } - - count_object(ob, base->flag & SELECT, 1); - G.totobj++; - } - else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) { - int tot= count_duplilist(ob->parent); - G.totobj+=tot; - count_object(ob, base->flag & SELECT, tot); - } - else if(ob->transflag & OB_DUPLIFRAMES) { - int tot= count_duplilist(ob); - G.totobj+=tot; - count_object(ob, base->flag & SELECT, tot); - } - else { - count_object(ob, base->flag & SELECT, 1); - G.totobj++; - } - } - base= base->next; - } - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ -} - -/* ************************************************** */ -/* ********************* old transform stuff ******** */ -/* ************************************************** */ - -static TransVert *transvmain=NULL; -static int tottrans= 0; - -/* copied from editobject.c, now uses (almost) proper depgraph */ -static void special_transvert_update(void) -{ - - if(G.obedit) { - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - if(G.obedit->type==OB_MESH) { -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); -#endif - recalc_editnormals(); // does face centers too - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - extern ListBase editNurb; - Nurb *nu= editNurb.first; - while(nu) { - test2DNurb(nu); - testhandlesNurb(nu); /* test for bezier too */ - nu= nu->next; - } - } - else if(G.obedit->type==OB_ARMATURE){ - bArmature *arm= G.obedit->data; - EditBone *ebo; - TransVert *tv= transvmain; - int a=0; - - /* Ensure all bone tails are correctly adjusted */ - for (ebo=G.edbo.first; ebo; ebo=ebo->next) { - /* adjust tip if both ends selected */ - if ((ebo->flag & BONE_ROOTSEL) && (ebo->flag & BONE_TIPSEL)) { - if (tv) { - float diffvec[3]; - - VecSubf(diffvec, tv->loc, tv->oldloc); - VecAddf(ebo->tail, ebo->tail, diffvec); - - a++; - if (anext) { - if ((ebo->flag & BONE_CONNECTED) && ebo->parent){ - /* If this bone has a parent tip that has been moved */ - if (ebo->parent->flag & BONE_TIPSEL){ - VECCOPY (ebo->head, ebo->parent->tail); - } - /* If this bone has a parent tip that has NOT been moved */ - else{ - VECCOPY (ebo->parent->tail, ebo->head); - } - } - } - if(arm->flag & ARM_MIRROR_EDIT) - transform_armature_mirror_update(); - } - else if(G.obedit->type==OB_LATTICE) { - if(editLatt->flag & LT_OUTSIDE) outside_lattice(editLatt); - } - } -} - -/* copied from editobject.c, needs to be replaced with new transform code still */ -/* mode: 1 = proportional, 2 = all joints (for bones only) */ -static void make_trans_verts(float *min, float *max, int mode) -{ - extern ListBase editNurb; - EditMesh *em = G.editMesh; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - TransVert *tv=NULL; - MetaElem *ml; - EditVert *eve; - EditBone *ebo; - float total, center[3], centroid[3]; - int a; - - tottrans= 0; // global! - - INIT_MINMAX(min, max); - centroid[0]=centroid[1]=centroid[2]= 0.0; - - /* note for transform refactor: dont rely on countall anymore... its ancient */ - /* I skip it for editmesh now (ton) */ - if(G.obedit->type!=OB_MESH) { - countall(); - if(mode) tottrans= G.totvert; - else tottrans= G.totvertsel; - - if(G.totvertsel==0) { - tottrans= 0; - return; - } - tv=transvmain= MEM_callocN(tottrans*sizeof(TransVert), "maketransverts"); - } - - /* we count again because of hide (old, not for mesh!) */ - tottrans= 0; - - if(G.obedit->type==OB_MESH) { - int proptrans= 0; - - // transform now requires awareness for select mode, so we tag the f1 flags in verts - tottrans= 0; - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0 && (eve->f & SELECT)) { - eve->f1= SELECT; - tottrans++; - } - else eve->f1= 0; - } - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - EditEdge *eed; - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0 && (eed->f & SELECT)) eed->v1->f1= eed->v2->f1= SELECT; - } - for(eve= em->verts.first; eve; eve= eve->next) if(eve->f1) tottrans++; - } - else { - EditFace *efa; - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0 && (efa->f & SELECT)) { - efa->v1->f1= efa->v2->f1= efa->v3->f1= SELECT; - if(efa->v4) efa->v4->f1= SELECT; - } - } - for(eve= em->verts.first; eve; eve= eve->next) if(eve->f1) tottrans++; - } - - /* proportional edit exception... */ - if((mode & 1) && tottrans) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0) { - eve->f1 |= 2; - proptrans++; - } - } - if(proptrans>tottrans) tottrans= proptrans; - } - - /* and now make transverts */ - if(tottrans) { - tv=transvmain= MEM_callocN(tottrans*sizeof(TransVert), "maketransverts"); - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f1) { - VECCOPY(tv->oldloc, eve->co); - tv->loc= eve->co; - if(eve->no[0]!=0.0 || eve->no[1]!=0.0 ||eve->no[2]!=0.0) - tv->nor= eve->no; // note this is a hackish signal (ton) - tv->flag= eve->f1 & SELECT; - tv++; - } - } - } - } - else if (G.obedit->type==OB_ARMATURE){ - bArmature *arm= G.obedit->data; - - for (ebo=G.edbo.first;ebo;ebo=ebo->next){ - if(ebo->layer & arm->layer) { - short tipsel= (ebo->flag & BONE_TIPSEL); - short rootsel= (ebo->flag & BONE_ROOTSEL); - short rootok= (!(ebo->parent && (ebo->flag & BONE_CONNECTED) && ebo->parent->flag & BONE_TIPSEL)); - - if ((tipsel && rootsel) || (rootsel)) { - /* Don't add the tip (unless mode & 2, for getting all joints), - * otherwise we get zero-length bones as tips will snap to the same - * location as heads. - */ - if (rootok) { - VECCOPY (tv->oldloc, ebo->head); - tv->loc= ebo->head; - tv->nor= NULL; - tv->flag= 1; - tv++; - tottrans++; - } - - if ((mode & 2) && (tipsel)) { - VECCOPY (tv->oldloc, ebo->tail); - tv->loc= ebo->tail; - tv->nor= NULL; - tv->flag= 1; - tv++; - tottrans++; - } - } - else if (tipsel) { - VECCOPY (tv->oldloc, ebo->tail); - tv->loc= ebo->tail; - tv->nor= NULL; - tv->flag= 1; - tv++; - tottrans++; - } - } - } - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if(bezt->hide==0) { - if((mode & 1) || (bezt->f1 & SELECT)) { - VECCOPY(tv->oldloc, bezt->vec[0]); - tv->loc= bezt->vec[0]; - tv->flag= bezt->f1 & SELECT; - tv++; - tottrans++; - } - if((mode & 1) || (bezt->f2 & SELECT)) { - VECCOPY(tv->oldloc, bezt->vec[1]); - tv->loc= bezt->vec[1]; - tv->val= &(bezt->alfa); - tv->oldval= bezt->alfa; - tv->flag= bezt->f2 & SELECT; - tv++; - tottrans++; - } - if((mode & 1) || (bezt->f3 & SELECT)) { - VECCOPY(tv->oldloc, bezt->vec[2]); - tv->loc= bezt->vec[2]; - tv->flag= bezt->f3 & SELECT; - tv++; - tottrans++; - } - } - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if(bp->hide==0) { - if((mode & 1) || (bp->f1 & SELECT)) { - VECCOPY(tv->oldloc, bp->vec); - tv->loc= bp->vec; - tv->val= &(bp->alfa); - tv->oldval= bp->alfa; - tv->flag= bp->f1 & SELECT; - tv++; - tottrans++; - } - } - bp++; - } - } - nu= nu->next; - } - } - else if(G.obedit->type==OB_MBALL) { - extern ListBase editelems; /* go away ! */ - ml= editelems.first; - while(ml) { - if(ml->flag & SELECT) { - tv->loc= &ml->x; - VECCOPY(tv->oldloc, tv->loc); - tv->val= &(ml->rad); - tv->oldval= ml->rad; - tv->flag= 1; - tv++; - tottrans++; - } - ml= ml->next; - } - } - else if(G.obedit->type==OB_LATTICE) { - bp= editLatt->def; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - while(a--) { - if((mode & 1) || (bp->f1 & SELECT)) { - if(bp->hide==0) { - VECCOPY(tv->oldloc, bp->vec); - tv->loc= bp->vec; - tv->flag= bp->f1 & SELECT; - tv++; - tottrans++; - } - } - bp++; - } - } - - /* cent etc */ - tv= transvmain; - total= 0.0; - for(a=0; aflag & SELECT) { - centroid[0]+= tv->oldloc[0]; - centroid[1]+= tv->oldloc[1]; - centroid[2]+= tv->oldloc[2]; - total+= 1.0; - DO_MINMAX(tv->oldloc, min, max); - } - } - if(total!=0.0) { - centroid[0]/= total; - centroid[1]/= total; - centroid[2]/= total; - } - - center[0]= (min[0]+max[0])/2.0; - center[1]= (min[1]+max[1])/2.0; - center[2]= (min[2]+max[2])/2.0; - -} - -void snap_sel_to_grid() -{ - extern float originmat[3][3]; /* object.c */ - TransVert *tv; - Base *base; - Object *ob; - float gridf, imat[3][3], bmat[3][3], vec[3]; - int a; - - gridf= G.vd->gridview; - - - if(G.obedit) { - tottrans= 0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(imat, bmat); - - tv= transvmain; - for(a=0; aloc); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, G.obedit->obmat[3]); - vec[0]= G.vd->gridview*floor(.5+ vec[0]/gridf); - vec[1]= G.vd->gridview*floor(.5+ vec[1]/gridf); - vec[2]= G.vd->gridview*floor(.5+ vec[2]/gridf); - VecSubf(vec, vec, G.obedit->obmat[3]); - - Mat3MulVecfl(imat, vec); - VECCOPY(tv->loc, vec); - - } - - special_transvert_update(); - - MEM_freeN(transvmain); - transvmain= 0; - - allqueue(REDRAWVIEW3D, 0); - return; - } - - base= (G.scene->base.first); - while(base) { - if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) { - ob= base->object; - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - bArmature *arm= ob->data; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->flag & BONE_SELECTED) { - if(pchan->bone->layer & arm->layer) { - if((pchan->bone->flag & BONE_CONNECTED)==0) { - float vecN[3], nLoc[3]; - - /* get nearest grid point to snap to */ - VECCOPY(nLoc, pchan->pose_mat[3]); - vec[0]= gridf * (float)(floor(.5+ nLoc[0]/gridf)); - vec[1]= gridf * (float)(floor(.5+ nLoc[1]/gridf)); - vec[2]= gridf * (float)(floor(.5+ nLoc[2]/gridf)); - - /* get bone-space location of grid point */ - armature_loc_pose_to_bone(pchan, vec, vecN); - - /* adjust location */ - VECCOPY(pchan->loc, vecN); - } - /* if the bone has a parent and is connected to the parent, - * don't do anything - will break chain unless we do auto-ik. - */ - } - } - } - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - - /* auto-keyframing */ - autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else { - ob->recalc |= OB_RECALC_OB; - - vec[0]= -ob->obmat[3][0]+G.vd->gridview*floor(.5+ ob->obmat[3][0]/gridf); - vec[1]= -ob->obmat[3][1]+G.vd->gridview*floor(.5+ ob->obmat[3][1]/gridf); - vec[2]= -ob->obmat[3][2]+G.vd->gridview*floor(.5+ ob->obmat[3][2]/gridf); - - if(ob->parent) { - where_is_object(ob); - - Mat3Inv(imat, originmat); - Mat3MulVecfl(imat, vec); - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } - else { - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } -#ifdef WITH_VERSE - if(ob->vnode) b_verse_send_transformation(ob); -#endif - - /* auto-keyframing */ - autokeyframe_ob_cb_func(ob, TFM_TRANSLATION); - } - } - - base= base->next; - } - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - allqueue(REDRAWVIEW3D, 0); -} - -void snap_sel_to_curs() -{ - extern float originmat[3][3]; /* object.c */ - TransVert *tv; - Base *base; - Object *ob; - float *curs, imat[3][3], bmat[3][3], vec[3]; - int a; - - curs= give_cursor(); - - if(G.obedit) { - tottrans= 0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(imat, bmat); - - tv= transvmain; - for(a=0; aobmat[3][0]; - vec[1]= curs[1]-G.obedit->obmat[3][1]; - vec[2]= curs[2]-G.obedit->obmat[3][2]; - - Mat3MulVecfl(imat, vec); - VECCOPY(tv->loc, vec); - } - - special_transvert_update(); - - MEM_freeN(transvmain); - transvmain= 0; - - allqueue(REDRAWVIEW3D, 0); - return; - } - - base= (G.scene->base.first); - while(base) { - if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) { - ob= base->object; - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - bArmature *arm= ob->data; - float cursp[3]; - - Mat4Invert(ob->imat, ob->obmat); - VECCOPY(cursp, curs); - Mat4MulVecfl(ob->imat, cursp); - - for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) { - if(pchan->bone->flag & BONE_SELECTED) { - if(pchan->bone->layer & arm->layer) { - if((pchan->bone->flag & BONE_CONNECTED)==0) { - float curspn[3]; - - /* get location of cursor in bone-space */ - armature_loc_pose_to_bone(pchan, cursp, curspn); - - /* calculate new position */ - VECCOPY(pchan->loc, curspn); - } - /* if the bone has a parent and is connected to the parent, - * don't do anything - will break chain unless we do auto-ik. - */ - } - } - } - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - - /* auto-keyframing */ - autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else { - ob->recalc |= OB_RECALC_OB; - - vec[0]= -ob->obmat[3][0] + curs[0]; - vec[1]= -ob->obmat[3][1] + curs[1]; - vec[2]= -ob->obmat[3][2] + curs[2]; - - if(ob->parent) { - where_is_object(ob); - - Mat3Inv(imat, originmat); - Mat3MulVecfl(imat, vec); - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } - else { - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } -#ifdef WITH_VERSE - if(ob->vnode) b_verse_send_transformation(ob); -#endif - - /* auto-keyframing */ - autokeyframe_ob_cb_func(ob, TFM_TRANSLATION); - } - } - - base= base->next; - } - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - allqueue(REDRAWVIEW3D, 0); -} - -void snap_curs_to_grid() -{ - float gridf, *curs; - - gridf= G.vd->gridview; - curs= give_cursor(); - - curs[0]= G.vd->gridview*floor(.5+curs[0]/gridf); - curs[1]= G.vd->gridview*floor(.5+curs[1]/gridf); - curs[2]= G.vd->gridview*floor(.5+curs[2]/gridf); - - allqueue(REDRAWVIEW3D, 0); -} - -void snap_curs_to_sel() -{ - TransVert *tv; - Base *base; - float *curs, bmat[3][3], vec[3], min[3], max[3], centroid[3]; - int count, a; - - curs= give_cursor(); - - count= 0; - INIT_MINMAX(min, max); - centroid[0]= centroid[1]= centroid[2]= 0.0; - - if(G.obedit) { - tottrans=0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 2); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - - tv= transvmain; - for(a=0; aloc); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, G.obedit->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - } - - if(G.vd->around==V3D_CENTROID) { - VecMulf(centroid, 1.0/(float)tottrans); - VECCOPY(curs, centroid); - } - else { - curs[0]= (min[0]+max[0])/2; - curs[1]= (min[1]+max[1])/2; - curs[2]= (min[2]+max[2])/2; - } - MEM_freeN(transvmain); - transvmain= 0; - } - else { - Object *ob= OBACT; - - if(ob && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; - bPoseChannel *pchan; - for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & BONE_SELECTED) { - VECCOPY(vec, pchan->pose_head); - Mat4MulVecfl(ob->obmat, vec); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - count++; - } - } - } - } - else { - for(base= G.scene->base.first; base; base= base->next) { - if(((base)->flag & SELECT) && ((base)->lay & G.vd->lay) ) { - VECCOPY(vec, base->object->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - count++; - } - } - } - if(count) { - if(G.vd->around==V3D_CENTROID) { - VecMulf(centroid, 1.0/(float)count); - VECCOPY(curs, centroid); - } - else { - curs[0]= (min[0]+max[0])/2; - curs[1]= (min[1]+max[1])/2; - curs[2]= (min[2]+max[2])/2; - } - } - } - allqueue(REDRAWVIEW3D, 0); -} - -void snap_curs_to_firstsel() -{ - TransVert *tv; - Base *base; - float *curs, bmat[3][3], vec[3], min[3], max[3], centroid[3]; - int count; - - curs= give_cursor(); - - count= 0; - INIT_MINMAX(min, max); - centroid[0]= centroid[1]= centroid[2]= 0.0; - - if(G.obedit) { - tottrans=0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - - tv= transvmain; - VECCOPY(vec, tv->loc); - /*Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, G.obedit->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max);*/ - - if(G.vd->around==V3D_CENTROID) { - VecMulf(vec, 1.0/(float)tottrans); - VECCOPY(curs, vec); - } - else { - curs[0]= vec[0]; - curs[1]= vec[1]; - curs[2]= vec[2]; - } - MEM_freeN(transvmain); - transvmain= 0; - } - else { - base= (G.scene->base.first); - while(base) { - if(((base)->flag & SELECT) && ((base)->lay & G.vd->lay) ) { - VECCOPY(vec, base->object->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - count++; - } - base= base->next; - } - if(count) { - if(G.vd->around==V3D_CENTROID) { - VecMulf(centroid, 1.0/(float)count); - VECCOPY(curs, centroid); - } - else { - curs[0]= (min[0]+max[0])/2; - curs[1]= (min[1]+max[1])/2; - curs[2]= (min[2]+max[2])/2; - } - } - } - allqueue(REDRAWVIEW3D, 0); -} - -void snap_to_center() -{ - extern float originmat[3][3]; - TransVert *tv; - Base *base; - Object *ob; - float snaploc[3], imat[3][3], bmat[3][3], vec[3], min[3], max[3], centroid[3]; - int count, a; - - /*calculate the snaplocation (centerpoint) */ - count= 0; - INIT_MINMAX(min, max); - centroid[0]= centroid[1]= centroid[2]= 0.0f; - snaploc[0]= snaploc[1]= snaploc[2]= 0.0f; - - if(G.obedit) { - tottrans= 0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(imat, bmat); - - tv= transvmain; - for(a=0; aloc); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, G.obedit->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - } - - if(G.vd->around==V3D_CENTROID) { - VecMulf(centroid, 1.0/(float)tottrans); - VECCOPY(snaploc, centroid); - } - else { - snaploc[0]= (min[0]+max[0])/2; - snaploc[1]= (min[1]+max[1])/2; - snaploc[2]= (min[2]+max[2])/2; - } - - MEM_freeN(transvmain); - transvmain= 0; - } - else { - base= (G.scene->base.first); - while(base) { - if(((base)->flag & SELECT) && ((base)->lay & G.vd->lay) ) { - ob= base->object; - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - bArmature *arm= ob->data; - - for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) { - if(pchan->bone->flag & BONE_SELECTED) { - if(pchan->bone->layer & arm->layer) { - VECCOPY(vec, pchan->pose_mat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - count++; - } - } - } - } - else { - /* not armature bones (i.e. objects) */ - VECCOPY(vec, base->object->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - count++; - } - } - base= base->next; - } - if(count) { - if(G.vd->around==V3D_CENTROID) { - VecMulf(centroid, 1.0/(float)count); - VECCOPY(snaploc, centroid); - } - else { - snaploc[0]= (min[0]+max[0])/2; - snaploc[1]= (min[1]+max[1])/2; - snaploc[2]= (min[2]+max[2])/2; - } - } - } - - /* Snap the selection to the snaplocation (duh!) */ - if(G.obedit) { - tottrans= 0; - - if ELEM6(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE, OB_MBALL) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return; - - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(imat, bmat); - - tv= transvmain; - for(a=0; aobmat[3][0]; - vec[1]= snaploc[1]-G.obedit->obmat[3][1]; - vec[2]= snaploc[2]-G.obedit->obmat[3][2]; - - Mat3MulVecfl(imat, vec); - VECCOPY(tv->loc, vec); - } - - special_transvert_update(); - - MEM_freeN(transvmain); - transvmain= 0; - - allqueue(REDRAWVIEW3D, 0); - return; - } - - base= (G.scene->base.first); - while(base) { - if( ( ((base)->flag & SELECT) && ((base)->lay & G.vd->lay) && ((base)->object->id.lib==0))) { - ob= base->object; - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - bArmature *arm= ob->data; - - for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) { - if(pchan->bone->flag & BONE_SELECTED) { - if(pchan->bone->layer & arm->layer) { - if((pchan->bone->flag & BONE_CONNECTED)==0) { - /* get location of cursor in bone-space */ - armature_loc_pose_to_bone(pchan, snaploc, vec); - - /* calculate new position */ - VECCOPY(pchan->loc, vec); - } - /* if the bone has a parent and is connected to the parent, - * don't do anything - will break chain unless we do auto-ik. - */ - } - } - } - - /* auto-keyframing */ - ob->pose->flag |= POSE_DO_UNLOCK; - autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else { - ob->recalc |= OB_RECALC_OB; - - vec[0]= -ob->obmat[3][0] + snaploc[0]; - vec[1]= -ob->obmat[3][1] + snaploc[1]; - vec[2]= -ob->obmat[3][2] + snaploc[2]; - - if(ob->parent) { - where_is_object(ob); - - Mat3Inv(imat, originmat); - Mat3MulVecfl(imat, vec); - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } - else { - ob->loc[0]+= vec[0]; - ob->loc[1]+= vec[1]; - ob->loc[2]+= vec[2]; - } -#ifdef WITH_VERSE - if(ob->vnode) b_verse_send_transformation(ob); -#endif - - /* auto-keyframing */ - autokeyframe_ob_cb_func(ob, TFM_TRANSLATION); - } - } - - base= base->next; - } - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - allqueue(REDRAWVIEW3D, 0); -} - - -void snapmenu() -{ - short event; - - event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Cursor-> Grid%x3|Cursor-> Selection%x4|Selection-> Center%x5"); - - switch (event) { - case 1: /*Selection to grid*/ - snap_sel_to_grid(); - BIF_undo_push("Snap selection to grid"); - break; - case 2: /*Selection to cursor*/ - snap_sel_to_curs(); - BIF_undo_push("Snap selection to cursor"); - break; - case 3: /*Cursor to grid*/ - snap_curs_to_grid(); - break; - case 4: /*Cursor to selection*/ - snap_curs_to_sel(); - break; - case 5: /*Selection to center of selection*/ - snap_to_center(); - BIF_undo_push("Snap selection to center"); - break; - } -} - - -#define MERGELIMIT 0.001 -void mergemenu(void) -{ - - short event; - int remCount = 0; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) - if(G.editMesh->selected.first && G.editMesh->selected.last && - ((EditSelection*)G.editMesh->selected.first)->type == EDITVERT && ((EditSelection*)G.editMesh->selected.last)->type == EDITVERT) - event = pupmenu("Merge %t|At First %x6|At Last%x1|At Center%x3|At Cursor%x4|Collapse%x2"); - else if (G.editMesh->selected.first && ((EditSelection*)G.editMesh->selected.first)->type == EDITVERT) - event = pupmenu("Merge %t|At First %x6|At Center%x3|At Cursor%x4|Collapse%x2"); - else if (G.editMesh->selected.last && ((EditSelection*)G.editMesh->selected.last)->type == EDITVERT) - event = pupmenu("Merge %t|At Last %x1|At Center%x3|At Cursor%x4|Collapse%x2"); - else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); - else event = pupmenu("Merge %t|At Center%x3|At Cursor%x4|Collapse%x2"); - switch (event) - { - case -1: - return; - case 3: - if(G.qual & LR_CTRLKEY) remCount = merge_target(0,1); - else remCount = merge_target(0,0); - BIF_undo_push("Merge at center"); - break; - case 4: - if(G.qual & LR_CTRLKEY) remCount = merge_target(1,1); - else remCount = merge_target(1,0); - BIF_undo_push("Merge at cursor"); - break; - case 1: - if(G.qual & LR_CTRLKEY) remCount = merge_firstlast(0,1); - else remCount = merge_firstlast(0,0); - BIF_undo_push("Merge at last selected"); - break; - case 6: - if(G.qual & LR_CTRLKEY) remCount = merge_firstlast(1,1); - else remCount = merge_firstlast(1,0); - BIF_undo_push("Merge at first selected"); - break; - case 2: - remCount = collapseEdges(); - BIF_undo_push("Collapse"); - break; - } - notice("Removed %d Vertices", remCount); - allqueue(REDRAWVIEW3D, 0); - countall(); -} -#undef MERGELIMIT - - -void delete_context_selected(void) -{ - if(G.obedit) { - if(G.obedit->type==OB_MESH) delete_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) delNurb(); - else if(G.obedit->type==OB_MBALL) delete_mball(); - else if (G.obedit->type==OB_ARMATURE) delete_armature(); - } - else if(G.f & G_PARTICLEEDIT){ - PE_delete_particle(); - } - else delete_obj(0); -} - -void duplicate_context_selected(void) -{ - if(G.obedit) { - if(G.obedit->type==OB_MESH) adduplicate_mesh(); - else if(G.obedit->type==OB_ARMATURE) adduplicate_armature(); - else if(G.obedit->type==OB_MBALL) adduplicate_mball(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) adduplicate_nurb(); - } - else if(G.f & G_PARTICLEEDIT); - else - adduplicate(0, U.dupflag); -} - -void toggle_shading(void) -{ - if(G.qual & LR_SHIFTKEY) { - if(G.qual & LR_ALTKEY) { - reshadeall_displist(); - G.vd->drawtype= OB_SHADED; - } - else { - if(G.vd->drawtype== OB_SHADED) G.vd->drawtype= OB_WIRE; - else G.vd->drawtype= OB_SHADED; - } - } - else if(G.qual & LR_ALTKEY) { - if(G.vd->drawtype== OB_TEXTURE) G.vd->drawtype= OB_SOLID; - else G.vd->drawtype= OB_TEXTURE; - } - else { - if(G.vd->drawtype==OB_SOLID || G.vd->drawtype==OB_SHADED) G.vd->drawtype= OB_WIRE; - else G.vd->drawtype= OB_SOLID; - } - - if(G.vd->drawtype != OB_WIRE && G.vd->depths) { - G.vd->depths->damaged= 1; - } -} - -int minmax_verts(float *min, float *max) -{ - TransVert *tv; - float centroid[3], vec[3], bmat[3][3]; - int a; - - tottrans=0; - if ELEM5(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE) - make_trans_verts(bmat[0], bmat[1], 0); - if(tottrans==0) return 0; - - Mat3CpyMat4(bmat, G.obedit->obmat); - - tv= transvmain; - for(a=0; aloc); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, G.obedit->obmat[3]); - VecAddf(centroid, centroid, vec); - DO_MINMAX(vec, min, max); - } - - MEM_freeN(transvmain); - transvmain= 0; - return 1; -} - diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c deleted file mode 100644 index cb032ddfb61..00000000000 --- a/source/blender/src/editaction.c +++ /dev/null @@ -1,3097 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): 2007, Joshua Leung (major rewrite of Action Editor) - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_constraint_types.h" -#include "DNA_key_types.h" -#include "DNA_mesh_types.h" -#include "DNA_nla_types.h" -#include "DNA_lattice_types.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" -#include "BKE_object.h" /* for where_is_object in obanim -> action baking */ - -#include "BIF_butspace.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editnla.h" -#include "BIF_editview.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" - -#include "BSE_edit.h" -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_editaction_types.h" -#include "BSE_editipo.h" -#include "BSE_time.h" -#include "BSE_trans_types.h" - -#include "BDR_drawaction.h" -#include "BDR_editobject.h" - -#include "mydevice.h" -#include "blendef.h" -#include "nla.h" - -/* **************************************************** */ -/* ACTION API */ - -/* this function adds a new Action block */ -bAction *add_empty_action (char *name) -{ - bAction *act; - - act= alloc_libblock(&G.main->action, ID_AC, name); - act->id.flag |= LIB_FAKEUSER; - act->id.us++; - - return act; -} - -/* generic get current action call, for action window context */ -bAction *ob_get_action (Object *ob) -{ - bActionStrip *strip; - - if(ob->action) - return ob->action; - - for (strip=ob->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_SELECT) - return strip->act; - } - return NULL; -} - -/* used by ipo, outliner, buttons to find the active channel */ -bActionChannel *get_hilighted_action_channel (bAction *action) -{ - bActionChannel *achan; - - if (!action) - return NULL; - - for (achan= action->chanbase.first; achan; achan= achan->next) { - if (VISIBLE_ACHAN(achan)) { - if (SEL_ACHAN(achan) && (achan->flag & ACHAN_HILIGHTED)) - return achan; - } - } - - return NULL; -} - -/* ----------------------------------------- */ - -void remake_action_ipos (bAction *act) -{ - bActionChannel *achan; - bConstraintChannel *conchan; - IpoCurve *icu; - - for (achan= act->chanbase.first; achan; achan= achan->next) { - if (achan->ipo) { - for (icu = achan->ipo->curve.first; icu; icu=icu->next) { - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } - } - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next){ - if (conchan->ipo) { - for (icu = conchan->ipo->curve.first; icu; icu=icu->next){ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } - } - } - } - - synchronize_action_strips(); -} - -/* **************************************************** */ -/* FILTER->EDIT STRUCTURES */ -/* - * This method involves generating a list of edit structures which enable - * tools to naively perform the actions they require without all the boiler-plate - * associated with loops within loops and checking for cases to ignore. - */ - -/* this function allocates memory for a new bActListElem struct for the - * provided action channel-data. - */ -bActListElem *make_new_actlistelem (void *data, short datatype, void *owner, short ownertype) -{ - bActListElem *ale= NULL; - - /* only allocate memory if there is data to convert */ - if (data) { - /* allocate and set generic data */ - ale= MEM_callocN(sizeof(bActListElem), "bActListElem"); - - ale->data= data; - ale->type= datatype; - ale->owner= owner; - ale->ownertype= ownertype; - - /* do specifics */ - switch (datatype) { - case ACTTYPE_ACHAN: - { - bActionChannel *achan= (bActionChannel *)data; - - ale->flag= achan->flag; - - if (achan->ipo) { - ale->key_data= achan->ipo; - ale->datatype= ALE_IPO; - } - else { - ale->key_data= NULL; - ale->datatype= ALE_NONE; - } - } - break; - case ACTTYPE_CONCHAN: - { - bConstraintChannel *conchan= (bConstraintChannel *)data; - - ale->flag= conchan->flag; - - if (conchan->ipo && conchan->ipo->curve.first) { - /* we assume that constraint ipo blocks only have 1 curve: - * INFLUENCE, so we pretend that a constraint channel is - * really just a Ipo-Curve channel instead. - */ - ale->key_data= conchan->ipo->curve.first; - ale->datatype= ALE_ICU; - } - else { - ale->key_data= NULL; - ale->datatype= ALE_NONE; - } - } - break; - case ACTTYPE_ICU: - { - IpoCurve *icu= (IpoCurve *)data; - - ale->flag= icu->flag; - ale->key_data= icu; - ale->datatype= ALE_ICU; - } - break; - - case ACTTYPE_FILLIPO: - case ACTTYPE_FILLCON: - { - bActionChannel *achan= (bActionChannel *)data; - - if (datatype == ACTTYPE_FILLIPO) - ale->flag= FILTER_IPO_ACHAN(achan); - else - ale->flag= FILTER_CON_ACHAN(achan); - - ale->key_data= NULL; - ale->datatype= ALE_NONE; - } - break; - case ACTTYPE_IPO: - { - ale->flag= 0; - ale->key_data= data; - ale->datatype= ALE_IPO; - } - break; - } - } - - /* return created datatype */ - return ale; -} - -/* ----------------------------------------- */ - -static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_mode) -{ - bActListElem *ale; - bActionChannel *achan; - bConstraintChannel *conchan; - IpoCurve *icu; - - /* loop over action channels, performing the necessary checks */ - for (achan= act->chanbase.first; achan; achan= achan->next) { - /* only work with this channel and its subchannels if it is visible */ - if (!(filter_mode & ACTFILTER_VISIBLE) || VISIBLE_ACHAN(achan)) { - /* only work with this channel and its subchannels if it is editable */ - if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_ACHAN(achan)) { - /* check if this achan should only be included if it is selected */ - if (!(filter_mode & ACTFILTER_SEL) || SEL_ACHAN(achan)) { - /* are we only interested in the ipo-curves? */ - if ((filter_mode & ACTFILTER_ONLYICU)==0) { - ale= make_new_actlistelem(achan, ACTTYPE_ACHAN, achan, ACTTYPE_ACHAN); - if (ale) BLI_addtail(act_data, ale); - } - } - else { - /* only consider selected channels - achan not selected */ - continue; - } - - /* check if expanded - if not, continue on to next action channel */ - if (EXPANDED_ACHAN(achan) == 0 && (filter_mode & ACTFILTER_ONLYICU)==0) - continue; - - /* ipo channels */ - if (achan->ipo) { - /* include ipo-expand widget? */ - if ((filter_mode & ACTFILTER_CHANNELS) && (filter_mode & ACTFILTER_ONLYICU)==0) { - ale= make_new_actlistelem(achan, ACTTYPE_FILLIPO, achan, ACTTYPE_ACHAN); - if (ale) BLI_addtail(act_data, ale); - } - - /* add ipo-curve channels? */ - if (FILTER_IPO_ACHAN(achan) || (filter_mode & ACTFILTER_ONLYICU)) { - /* loop through ipo-curve channels, adding them */ - for (icu= achan->ipo->curve.first; icu; icu=icu->next) { - ale= make_new_actlistelem(icu, ACTTYPE_ICU, achan, ACTTYPE_ACHAN); - if (ale) BLI_addtail(act_data, ale); - } - } - } - - /* constraint channels */ - if (achan->constraintChannels.first) { - /* include constraint-expand widget? */ - if ((filter_mode & ACTFILTER_CHANNELS) && (filter_mode & ACTFILTER_ONLYICU)==0) { - ale= make_new_actlistelem(achan, ACTTYPE_FILLCON, achan, ACTTYPE_ACHAN); - if (ale) BLI_addtail(act_data, ale); - } - - /* add constaint channels? */ - if (FILTER_CON_ACHAN(achan)) { - /* loop through constraint channels, checking and adding them */ - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) { - /* only work with this channel and its subchannels if it is editable */ - if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_CONCHAN(conchan)) { - /* check if this conchan should only be included if it is selected */ - if (!(filter_mode & ACTFILTER_SEL) || SEL_CONCHAN(conchan)) { - if ((filter_mode & ACTFILTER_ONLYICU)==0) { - ale= make_new_actlistelem(conchan, ACTTYPE_CONCHAN, achan, ACTTYPE_ACHAN); - if (ale) BLI_addtail(act_data, ale); - } - } - } - } - } - } - } - } - } -} - -static void actdata_filter_shapekey (ListBase *act_data, Key *key, int filter_mode) -{ - bActListElem *ale; - KeyBlock *kb; - IpoCurve *icu; - int i; - - /* are we filtering for display or editing */ - if (filter_mode & ACTFILTER_FORDRAWING) { - /* for display - loop over shapekeys, adding ipo-curve references where needed */ - kb= key->block.first; - - /* loop through possible shapekeys, manually creating entries */ - for (i= 1; i < key->totkey; i++) { - ale= MEM_callocN(sizeof(bActListElem), "bActListElem"); - kb = kb->next; - - ale->data= kb; - ale->type= ACTTYPE_SHAPEKEY; /* 'abused' usage of this type */ - ale->owner= key; - ale->ownertype= ACTTYPE_SHAPEKEY; - ale->datatype= ALE_NONE; - ale->index = i; - - if (key->ipo) { - for (icu= key->ipo->curve.first; icu; icu=icu->next) { - if (icu->adrcode == i) { - ale->key_data= icu; - ale->datatype= ALE_ICU; - break; - } - } - } - - BLI_addtail(act_data, ale); - } - } - else { - /* loop over ipo curves if present - for editing */ - if (key->ipo) { - if (filter_mode & ACTFILTER_IPOKEYS) { - ale= make_new_actlistelem(key->ipo, ACTTYPE_IPO, key, ACTTYPE_SHAPEKEY); - if (ale) BLI_addtail(act_data, ale); - } - else { - for (icu= key->ipo->curve.first; icu; icu=icu->next) { - ale= make_new_actlistelem(icu, ACTTYPE_ICU, key, ACTTYPE_SHAPEKEY); - if (ale) BLI_addtail(act_data, ale); - } - } - } - } -} - -/* This function filters the active data source to leave only the desired - * data types. 'Public' api call. - * *act_data: is a pointer to a ListBase, to which the filtered action data - * will be placed for use. - * filter_mode: how should the data be filtered - bitmapping accessed flags - */ -void actdata_filter (ListBase *act_data, int filter_mode, void *data, short datatype) -{ - /* only filter data if there's somewhere to put it */ - if (data && act_data) { - bActListElem *ale, *next; - - /* firstly filter the data */ - switch (datatype) { - case ACTCONT_ACTION: - actdata_filter_action(act_data, data, filter_mode); - break; - case ACTCONT_SHAPEKEY: - actdata_filter_shapekey(act_data, data, filter_mode); - break; - } - - /* remove any weedy entries */ - for (ale= act_data->first; ale; ale= next) { - next= ale->next; - - if (ale->type == ACTTYPE_NONE) - BLI_freelinkN(act_data, ale); - - if (filter_mode & ACTFILTER_IPOKEYS) { - if (ale->datatype != ALE_IPO) - BLI_freelinkN(act_data, ale); - else if (ale->key_data == NULL) - BLI_freelinkN(act_data, ale); - } - } - } -} - -/* **************************************************** */ -/* GENERAL ACTION TOOLS */ - - -/* gets the key data from the currently selected - * mesh/lattice. If a mesh is not selected, or does not have - * key data, then we return NULL (currently only - * returns key data for RVK type meshes). If there - * is an action that is pinned, return null - */ -/* Note: there's a similar function in key.c (ob_get_key) */ -Key *get_action_mesh_key(void) -{ - Object *ob; - Key *key; - - ob = OBACT; - if (ob == NULL) - return NULL; - - if (G.saction->pin) return NULL; - - if (ob->type==OB_MESH) - key = ((Mesh *)ob->data)->key; - else if (ob->type==OB_LATTICE) - key = ((Lattice *)ob->data)->key; - else - return NULL; - - if (key) { - if (key->type == KEY_RELATIVE) - return key; - } - - return NULL; -} - -/* TODO: kill this! */ -int get_nearest_key_num (Key *key, short *mval, float *x) -{ - /* returns the key num that cooresponds to the - * y value of the mouse click. Does not check - * if this is a valid keynum. Also gives the Ipo - * x coordinate. - */ - int num; - float y; - - areamouseco_to_ipoco(G.v2d, mval, x, &y); - num = (int) ((CHANNELHEIGHT/2 - y) / (CHANNELHEIGHT+CHANNELSKIP)); - - return (num + 1); -} - -/* this function is used to get a pointer to an action or shapekey - * datablock, thus simplying that process. - */ -/* this function is intended for use */ -void *get_nearest_act_channel (short mval[], short *ret_type) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - int clickmin, clickmax; - float x,y; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) { - *ret_type= ACTTYPE_NONE; - return NULL; - } - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP)); - clickmax = clickmin; - - if (clickmax < 0) { - *ret_type= ACTTYPE_NONE; - return NULL; - } - - /* filter data */ - filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - for (ale= act_data.first; ale; ale= ale->next) { - if (clickmax < 0) - break; - if (clickmin <= 0) { - /* found match */ - *ret_type= ale->type; - data= ale->data; - - BLI_freelistN(&act_data); - - return data; - } - --clickmin; - --clickmax; - } - - /* cleanup */ - BLI_freelistN(&act_data); - - *ret_type= ACTTYPE_NONE; - return NULL; -} - -/* used only by mouse_action. It is used to find the location of the nearest - * keyframe to where the mouse clicked, - */ -static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, bActionChannel **par) -{ - ListBase act_data = {NULL, NULL}; - ListBase act_keys = {NULL, NULL}; - bActListElem *ale; - ActKeyColumn *ak; - void *data; - short datatype; - int filter; - - rctf rectf; - float xmin, xmax, x, y; - int clickmin, clickmax; - short mval[2]; - short found = 0; - - getmouseco_areawin (mval); - - /* action-channel */ - *par= NULL; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) { - *ret_type= ACTTYPE_NONE; - return NULL; - } - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP)); - clickmax = clickmin; - - mval[0]-=7; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]+=14; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - /* if action is mapped in NLA, it returns a correction */ - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - xmin= get_action_frame(OBACT, rectf.xmin); - xmax= get_action_frame(OBACT, rectf.xmax); - } - else { - xmin= rectf.xmin; - xmax= rectf.xmax; - } - - if (clickmax < 0) { - *ret_type= ACTTYPE_NONE; - return NULL; - } - - /* filter data */ - filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - for (ale= act_data.first; ale; ale= ale->next) { - if (clickmax < 0) - break; - if (clickmin <= 0) { - /* found match */ - - /* make list of keyframes */ - if (ale->key_data) { - switch (ale->datatype) { - case ALE_IPO: - { - Ipo *ipo= (Ipo *)ale->key_data; - ipo_to_keylist(ipo, &act_keys, NULL); - } - break; - case ALE_ICU: - { - IpoCurve *icu= (IpoCurve *)ale->key_data; - icu_to_keylist(icu, &act_keys, NULL); - } - break; - } - } - - /* loop through keyframes, finding one that was clicked on */ - for (ak= act_keys.first; ak; ak= ak->next) { - if (IN_RANGE(ak->cfra, xmin, xmax)) { - *selx= ak->cfra; - found= 1; - break; - } - } - /* no matching keyframe found - set to mean frame value so it doesn't actually select anything */ - if (found == 0) - *selx= ((xmax+xmin) / 2); - - /* figure out what to return */ - if (datatype == ACTCONT_ACTION) { - *par= ale->owner; /* assume that this is an action channel */ - *ret_type= ale->type; - data = ale->data; - } - else if (datatype == ACTCONT_SHAPEKEY) { - data = ale->key_data; - *ret_type= ACTTYPE_ICU; - } - - /* cleanup tempolary lists */ - BLI_freelistN(&act_keys); - act_keys.first = act_keys.last = NULL; - - BLI_freelistN(&act_data); - - return data; - } - --clickmin; - --clickmax; - } - - /* cleanup */ - BLI_freelistN(&act_data); - - *ret_type= ACTTYPE_NONE; - return NULL; -} - -void *get_action_context (short *datatype) -{ - bAction *act; - Key *key; - - /* get pointers to active action/shapekey blocks */ - act = (G.saction)? G.saction->action: NULL; - key = get_action_mesh_key(); - - if (act) { - *datatype= ACTCONT_ACTION; - return act; - } - else if (key) { - *datatype= ACTCONT_SHAPEKEY; - return key; - } - else { - *datatype= ACTCONT_NONE; - return NULL; - } -} - -/* **************************************************** */ -/* TRANSFORM TOOLS */ - -/* main call to start transforming keyframes */ -void transform_action_keys (int mode, int dummy) -{ - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - switch (mode) { - case 'g': - { - initTransform(TFM_TIME_TRANSLATE, CTX_NONE); - Transform(); - } - break; - case 's': - { - initTransform(TFM_TIME_SCALE, CTX_NONE); - Transform(); - } - break; - case 't': - { - initTransform(TFM_TIME_SLIDE, CTX_NONE); - Transform(); - } - break; - case 'e': - { - initTransform(TFM_TIME_EXTEND, CTX_NONE); - Transform(); - } - break; - } -} - -/* ----------------------------------------- */ - -/* duplicate keyframes */ -void duplicate_action_keys (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through filtered data and duplicate selected keys */ - for (ale= act_data.first; ale; ale= ale->next) { - duplicate_ipo_keys((Ipo *)ale->key_data); - } - - /* free filtered list */ - BLI_freelistN(&act_data); - - /* now, go into transform-grab mode, to move keys */ - transform_action_keys('g', 0); -} - -/* this function is responsible for snapping the current frame to selected data */ -void snap_cfra_action() -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* snap current frame to selected data */ - snap_cfra_ipo_keys(NULL, -1); - - for (ale= act_data.first; ale; ale= ale->next) { - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); - snap_cfra_ipo_keys(ale->key_data, 0); - actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); - } - else - snap_cfra_ipo_keys(ale->key_data, 0); - } - BLI_freelistN(&act_data); - - snap_cfra_ipo_keys(NULL, 1); - - BIF_undo_push("Snap Current Frame to Keys"); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* this function is responsible for snapping keyframes to frame-times */ -void snap_action_keys(short mode) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - char str[32]; - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* determine mode */ - switch (mode) { - case 1: - strcpy(str, "Snap Keys To Nearest Frame"); - break; - case 2: - if (G.saction->flag & SACTION_DRAWTIME) - strcpy(str, "Snap Keys To Current Time"); - else - strcpy(str, "Snap Keys To Current Frame"); - break; - case 3: - strcpy(str, "Snap Keys To Nearest Marker"); - break; - case 4: - strcpy(str, "Snap Keys To Nearest Second"); - break; - default: - return; - } - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* snap to frame */ - for (ale= act_data.first; ale; ale= ale->next) { - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); - snap_ipo_keys(ale->key_data, mode); - actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); - } - else - snap_ipo_keys(ale->key_data, mode); - } - BLI_freelistN(&act_data); - - if (datatype == ACTCONT_ACTION) - remake_action_ipos(data); - - BIF_undo_push(str); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* this function is responsible for snapping keyframes to frame-times */ -void mirror_action_keys(short mode) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - char str[32]; - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* determine mode */ - switch (mode) { - case 1: - strcpy(str, "Mirror Keys Over Current Frame"); - break; - case 2: - strcpy(str, "Mirror Keys Over Y-Axis"); - break; - case 3: - strcpy(str, "Mirror Keys Over X-Axis"); - break; - case 4: - strcpy(str, "Mirror Keys Over Marker"); - break; - default: - return; - } - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* mirror */ - for (ale= act_data.first; ale; ale= ale->next) { - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); - mirror_ipo_keys(ale->key_data, mode); - actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); - } - else - mirror_ipo_keys(ale->key_data, mode); - } - BLI_freelistN(&act_data); - - if (datatype == ACTCONT_ACTION) - remake_action_ipos(data); - - BIF_undo_push(str); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* **************************************************** */ -/* ADD/REMOVE KEYFRAMES */ - -/* This function allows the user to insert keyframes on the current - * frame from the Action Editor, using the current values of the channels - * to be keyframed. - */ -void insertkey_action(void) -{ - void *data; - short datatype; - - Object *ob= OBACT; - short mode; - float cfra; - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - cfra = frame_to_float(CFRA); - - if (datatype == ACTCONT_ACTION) { - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - - /* ask user what to keyframe */ - mode = pupmenu("Insert Key%t|All Channels%x1|Only Selected Channels%x2"); - if (mode <= 0) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_ONLYICU ); - if (mode == 2) filter |= ACTFILTER_SEL; - - actdata_filter(&act_data, filter, data, datatype); - - /* loop through ipo curves retrieved */ - for (ale= act_data.first; ale; ale= ale->next) { - /* verify that this is indeed an ipo curve */ - if (ale->key_data && ale->owner) { - bActionChannel *achan= (bActionChannel *)ale->owner; - IpoCurve *icu= (IpoCurve *)ale->key_data; - - if (ob) - insertkey((ID *)ob, icu->blocktype, achan->name, NULL, icu->adrcode, 0); - else - insert_vert_icu(icu, cfra, icu->curval, 0); - } - } - - /* cleanup */ - BLI_freelistN(&act_data); - } - else if (datatype == ACTCONT_SHAPEKEY) { - Key *key= (Key *)data; - IpoCurve *icu; - - /* ask user if they want to insert a keyframe */ - mode = okee("Insert Keyframe?"); - if (mode <= 0) return; - - if (key->ipo) { - for (icu= key->ipo->curve.first; icu; icu=icu->next) { - insert_vert_icu(icu, cfra, icu->curval, 0); - } - } - } - - BIF_undo_push("Insert Key"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* delete selected keyframes */ -void delete_action_keys (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through filtered data and delete selected keys */ - for (ale= act_data.first; ale; ale= ale->next) { - delete_ipo_keys((Ipo *)ale->key_data); - } - - /* free filtered list */ - BLI_freelistN(&act_data); - - if (datatype == ACTCONT_ACTION) - remake_action_ipos(data); - - BIF_undo_push("Delete Action Keys"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* delete selected keyframes */ -void delete_action_channels (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale, *next; - bAction *act; - void *data; - short datatype; - int filter; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - if (datatype != ACTCONT_ACTION) return; - act= (bAction *)data; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_CHANNELS | ACTFILTER_SEL); - actdata_filter(&act_data, filter, data, datatype); - - /* remove irrelevant entries */ - for (ale= act_data.first; ale; ale= next) { - next= ale->next; - - if (ale->type != ACTTYPE_ACHAN) - BLI_freelinkN(&act_data, ale); - } - - /* clean up action channels */ - for (ale= act_data.first; ale; ale= next) { - bActionChannel *achan= (bActionChannel *)ale->data; - bConstraintChannel *conchan, *cnext; - next= ale->next; - - /* release reference to ipo users */ - if (achan->ipo) - achan->ipo->id.us--; - - for (conchan= achan->constraintChannels.first; conchan; conchan=cnext) { - cnext= conchan->next; - - if (conchan->ipo) - conchan->ipo->id.us--; - } - - /* free memory */ - BLI_freelistN(&achan->constraintChannels); - BLI_freelinkN(&act->chanbase, achan); - BLI_freelinkN(&act_data, ale); - } - - remake_action_ipos(data); - - BIF_undo_push("Delete Action Channels"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* 'Clean' IPO curves - remove any unnecessary keyframes */ -void clean_action (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype, ok; - - /* don't proceed any further if nothing to work on or user refuses */ - data= get_action_context(&datatype); - ok= fbutton(&G.scene->toolsettings->clean_thresh, - 0.0000001f, 1.0, 0.001, 0.1, - "Clean Threshold"); - if (!ok) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_SEL | ACTFILTER_ONLYICU); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through filtered data and clean curves */ - for (ale= act_data.first; ale; ale= ale->next) { - clean_ipo_curve((IpoCurve *)ale->key_data); - } - - /* admin and redraws */ - BLI_freelistN(&act_data); - - BIF_undo_push("Clean Action"); - allqueue(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); -} - -/* **************************************************** */ -/* COPY/PASTE FOR ACTIONS */ -/* - The copy/paste buffer currently stores a set of Action Channels, with temporary - * IPO-blocks, and also temporary IpoCurves which only contain the selected keyframes. - * - Only pastes between compatable data is possible (i.e. same achan->name, ipo-curve type, etc.) - */ - -/* globals for copy/paste data (like for other copy/paste buffers) */ -ListBase actcopybuf = {NULL, NULL}; - -/* This function frees any MEM_calloc'ed copy/paste buffer data */ -void free_actcopybuf () -{ - bActionChannel *achan, *anext; - bConstraintChannel *conchan, *cnext; - - for (achan= actcopybuf.first; achan; achan= anext) { - anext= achan->next; - - if (achan->ipo) { - free_ipo(achan->ipo); - MEM_freeN(achan->ipo); - } - - for (conchan=achan->constraintChannels.first; conchan; conchan=cnext) { - cnext= conchan->next; - - if (conchan->ipo) { - free_ipo(conchan->ipo); - MEM_freeN(conchan->ipo); - } - - BLI_freelinkN(&achan->constraintChannels, conchan); - } - - BLI_freelinkN(&actcopybuf, achan); - } -} - -/* This function adds data to the copy/paste buffer, freeing existing data first - * Only the selected action channels gets their selected keyframes copied. - */ -void copy_actdata () -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - /* clear buffer first */ - free_actcopybuf(); - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* assume that each of these is an ipo-block */ - for (ale= act_data.first; ale; ale= ale->next) { - bActionChannel *achan; - Ipo *ipo= ale->key_data; - Ipo *ipn; - IpoCurve *icu, *icn; - BezTriple *bezt; - int i; - - /* coerce an action-channel out of owner */ - if (ale->ownertype == ACTTYPE_ACHAN) { - bActionChannel *achanO= ale->owner; - achan= MEM_callocN(sizeof(bActionChannel), "ActCopyPasteAchan"); - strcpy(achan->name, achanO->name); - } - else if (ale->ownertype == ACTTYPE_SHAPEKEY) { - achan= MEM_callocN(sizeof(bActionChannel), "ActCopyPasteAchan"); - strcpy(achan->name, "#ACP_ShapeKey"); - } - else - continue; - BLI_addtail(&actcopybuf, achan); - - /* add constraint channel if needed, then add new ipo-block */ - if (ale->type == ACTTYPE_CONCHAN) { - bConstraintChannel *conchanO= ale->data; - bConstraintChannel *conchan; - - conchan= MEM_callocN(sizeof(bConstraintChannel), "ActCopyPasteConchan"); - strcpy(conchan->name, conchanO->name); - BLI_addtail(&achan->constraintChannels, conchan); - - conchan->ipo= ipn= MEM_callocN(sizeof(Ipo), "ActCopyPasteIpo"); - } - else { - achan->ipo= ipn= MEM_callocN(sizeof(Ipo), "ActCopyPasteIpo"); - } - ipn->blocktype = ipo->blocktype; - - /* now loop through curves, and only copy selected keyframes */ - for (icu= ipo->curve.first; icu; icu= icu->next) { - /* allocate a new curve */ - icn= MEM_callocN(sizeof(IpoCurve), "ActCopyPasteIcu"); - icn->blocktype = icu->blocktype; - icn->adrcode = icu->adrcode; - BLI_addtail(&ipn->curve, icn); - - /* find selected BezTriples to add to the buffer */ - for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) { - if (BEZSELECTED(bezt)) - insert_bezt_icu(icn, bezt); - } - } - } - - /* check if anything ended up in the buffer */ - if (actcopybuf.first==NULL || actcopybuf.last==NULL) - error("Nothing copied to buffer"); - - /* free temp memory */ - BLI_freelistN(&act_data); -} - -void paste_actdata () -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - /* check if buffer is empty */ - if (actcopybuf.first==NULL || actcopybuf.last==NULL) { - error("No data in buffer to paste"); - return; - } - - /* get data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* from selected channels */ - for (ale= act_data.first; ale; ale= ale->next) { - Ipo *ipo_src=NULL, *ipo_dst=ale->key_data; - bActionChannel *achan; - IpoCurve *ico, *icu; - BezTriple *bezt; - int i; - float offset= 0.0f; - short offsetInit= 1; - - /* find matching ipo-block */ - for (achan= actcopybuf.first; achan; achan= achan->next) { - /* try to match data */ - if (ale->ownertype == ACTTYPE_ACHAN) { - bActionChannel *achant= ale->owner; - - /* check if we have a corresponding action channel */ - if (strcmp(achan->name, achant->name)==0) { - /* check if this is a constraint channel */ - if (ale->type == ACTTYPE_CONCHAN) { - bConstraintChannel *conchant= ale->data; - bConstraintChannel *conchan; - - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) { - if (strcmp(conchan->name, conchant->name)==0) { - ipo_src= conchan->ipo; - break; - } - } - if (ipo_src) break; - } - else { - ipo_src= achan->ipo; - break; - } - } - } - else if (ale->ownertype == ACTTYPE_SHAPEKEY) { - /* check if this action channel is "#ACP_ShapeKey" */ - if (strcmp(achan->name, "#ACP_ShapeKey")==0) { - ipo_src= achan->ipo; - break; - } - } - } - - /* loop over curves, pasting keyframes */ - for (icu= ipo_dst->curve.first; icu; icu= icu->next) { - for (ico= ipo_src->curve.first; ico; ico= ico->next) { - /* only paste if compatable blocktype + adrcode */ - if ((ico->blocktype==icu->blocktype) && (ico->adrcode==icu->adrcode)) { - /* just start pasting, with the the first keyframe on the current frame, and so on */ - for (i=0, bezt=ico->bezt; i < ico->totvert; i++, bezt++) { - /* initialise offset (if not already done) */ - if (offsetInit) { - offset= CFRA - bezt->vec[1][0]; - offsetInit= 0; - } - - /* temporarily apply offset to src beztriple while copying */ - bezt->vec[0][0] += offset; - bezt->vec[1][0] += offset; - bezt->vec[2][0] += offset; - - /* insert the keyframe */ - insert_bezt_icu(icu, bezt); - - /* un-apply offset from src beztriple after copying */ - bezt->vec[0][0] -= offset; - bezt->vec[1][0] -= offset; - bezt->vec[2][0] -= offset; - } - - /* recalculate channel's handles? */ - calchandles_ipocurve(icu); - - /* done for this channel */ - break; - } - } - } - } - - /* free temp memory */ - BLI_freelistN(&act_data); - - /* undo and redraw stuff */ - allqueue(REDRAWVIEW3D, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); - BIF_undo_push("Paste Action Keyframes"); -} - -/* **************************************************** */ -/* VARIOUS SETTINGS */ - -/* This function combines several features related to setting - * various ipo extrapolation/interpolation - */ -void action_set_ipo_flags (short mode, short event) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* determine which set of processing we are doing */ - switch (mode) { - case SET_EXTEND_POPUP: - { - /* present popup menu for ipo extrapolation type */ - event - = pupmenu("Channel Extending Type %t|" - "Constant %x11|" - "Extrapolation %x12|" - "Cyclic %x13|" - "Cyclic extrapolation %x14"); - if (event < 1) return; - } - break; - case SET_IPO_POPUP: - { - /* present popup menu for ipo interpolation type */ - event - = pupmenu("Channel Ipo Type %t|" - "Constant %x1|" - "Linear %x2|" - "Bezier %x3"); - if (event < 1) return; - } - break; - - case SET_IPO_MENU: /* called from menus */ - case SET_EXTEND_MENU: - break; - - default: /* weird, unhandled case */ - return; - } - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_SEL | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through setting flags */ - for (ale= act_data.first; ale; ale= ale->next) { - Ipo *ipo= (Ipo *)ale->key_data; - - /* depending on the mode */ - switch (mode) { - case SET_EXTEND_POPUP: /* extrapolation */ - case SET_EXTEND_MENU: - { - switch (event) { - case SET_EXTEND_CONSTANT: - setexprap_ipoloop(ipo, IPO_HORIZ); - break; - case SET_EXTEND_EXTRAPOLATION: - setexprap_ipoloop(ipo, IPO_DIR); - break; - case SET_EXTEND_CYCLIC: - setexprap_ipoloop(ipo, IPO_CYCL); - break; - case SET_EXTEND_CYCLICEXTRAPOLATION: - setexprap_ipoloop(ipo, IPO_CYCLX); - break; - } - } - break; - case SET_IPO_POPUP: /* interpolation */ - case SET_IPO_MENU: - { - setipotype_ipo(ipo, event); - } - break; - } - } - - /* cleanup */ - BLI_freelistN(&act_data); - - if (datatype == ACTCONT_ACTION) - remake_action_ipos(data); - - BIF_undo_push("Set Ipo Type"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* this function sets the handles on keyframes */ -void sethandles_action_keys (int code) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop through setting flags */ - for (ale= act_data.first; ale; ale= ale->next) { - sethandles_ipo_keys((Ipo *)ale->key_data, code); - } - - /* cleanup */ - BLI_freelistN(&act_data); - if (datatype == ACTCONT_ACTION) - remake_action_ipos(data); - - BIF_undo_push("Set Handle Type"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* ----------------------------------------- */ - -/* this gets called when nkey is pressed (no Transform Properties panel yet) */ -static void numbuts_action () -{ - void *data; - short datatype; - - void *act_channel; - short chantype; - - bActionChannel *achan= NULL; - bConstraintChannel *conchan= NULL; - IpoCurve *icu= NULL; - KeyBlock *kb= NULL; - - short mval[2]; - - int but=0; - char str[64]; - short expand, protect, mute; - float slidermin, slidermax; - - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* figure out what is under cursor */ - getmouseco_areawin(mval); - if (mval[0] < NAMEWIDTH) - return; - act_channel= get_nearest_act_channel(mval, &chantype); - - /* create items for clever-numbut */ - if (chantype == ACTTYPE_ACHAN) { - /* Action Channel */ - achan= (bActionChannel *)act_channel; - - strcpy(str, achan->name); - protect= (achan->flag & ACHAN_PROTECTED); - expand = (achan->flag & ACHAN_EXPANDED); - mute = (achan->ipo)? (achan->ipo->muteipo): 0; - - add_numbut(but++, TEX, "ActChan: ", 0, 31, str, "Name of Action Channel"); - add_numbut(but++, TOG|SHO, "Expanded", 0, 24, &expand, "Action Channel is Expanded"); - add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted"); - add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); - } - else if (chantype == ACTTYPE_CONCHAN) { - /* Constraint Channel */ - conchan= (bConstraintChannel *)act_channel; - - strcpy(str, conchan->name); - protect= (conchan->flag & CONSTRAINT_CHANNEL_PROTECTED); - mute = (conchan->ipo)? (conchan->ipo->muteipo): 0; - - add_numbut(but++, TEX, "ConChan: ", 0, 29, str, "Name of Constraint Channel"); - add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted"); - add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); - } - else if (chantype == ACTTYPE_ICU) { - /* IPO Curve */ - icu= (IpoCurve *)act_channel; - - if (G.saction->pin) - sprintf(str, getname_ipocurve(icu, NULL)); - else - sprintf(str, getname_ipocurve(icu, OBACT)); - - if (IS_EQ(icu->slide_max, icu->slide_min)) { - if (IS_EQ(icu->ymax, icu->ymin)) { - icu->slide_min= -100.0; - icu->slide_max= 100.0; - } - else { - icu->slide_min= icu->ymin; - icu->slide_max= icu->ymax; - } - } - slidermin= icu->slide_min; - slidermax= icu->slide_max; - - //protect= (icu->flag & IPO_PROTECT); - mute = (icu->flag & IPO_MUTE); - - add_numbut(but++, NUM|FLO, "Slider Min:", -10000, slidermax, &slidermin, 0); - add_numbut(but++, NUM|FLO, "Slider Max:", slidermin, 10000, &slidermax, 0); - add_numbut(but++, TOG|SHO, "Muted", 0, 24, &mute, "Channel is Muted"); - //add_numbut(but++, TOG|SHO, "Protected", 0, 24, &protect, "Channel is Protected"); - } - else if (chantype == ACTTYPE_SHAPEKEY) { - /* Shape Key */ - kb= (KeyBlock *)act_channel; - - if (kb->name[0] == '\0') { - Key *key= (Key *)data; - int keynum= BLI_findindex(&key->block, kb); - - sprintf(str, "Key %d", keynum); - } - else - strcpy(str, kb->name); - - if (kb->slidermin >= kb->slidermax) { - kb->slidermin = 0.0; - kb->slidermax = 1.0; - } - - add_numbut(but++, TEX, "KB: ", 0, 24, str, - "Does this really need a tool tip?"); - add_numbut(but++, NUM|FLO, "Slider Min:", - -10000, kb->slidermax, &kb->slidermin, 0); - add_numbut(but++, NUM|FLO, "Slider Max:", - kb->slidermin, 10000, &kb->slidermax, 0); - } - else { - /* nothing under-cursor */ - return; - } - - /* draw clever-numbut */ - if (do_clever_numbuts(str, but, REDRAW)) { - /* restore settings based on type */ - if (icu) { - icu->slide_min= slidermin; - icu->slide_max= slidermax; - - //if (protect) icu->flag |= IPO_PROTECT; - //else icu->flag &= ~IPO_PROTECT; - if (mute) icu->flag |= IPO_MUTE; - else icu->flag &= ~IPO_MUTE; - } - else if (conchan) { - strcpy(conchan->name, str); - - if (protect) conchan->flag |= CONSTRAINT_CHANNEL_PROTECTED; - else conchan->flag &= ~CONSTRAINT_CHANNEL_PROTECTED; - - if (conchan->ipo) - conchan->ipo->muteipo = mute; - } - else if (achan) { - strcpy(achan->name, str); - - if (expand) achan->flag |= ACHAN_EXPANDED; - else achan->flag &= ~ACHAN_EXPANDED; - - if (protect) achan->flag |= ACHAN_PROTECTED; - else achan->flag &= ~ACHAN_PROTECTED; - - if (achan->ipo) - achan->ipo->muteipo = mute; - } - - allqueue(REDRAWACTION, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - } -} - - - -/* **************************************************** */ -/* CHANNEL SELECTION */ - -static void hilight_channel(bAction *act, bActionChannel *achan, short select) -{ - bActionChannel *curchan; - - if (!act) - return; - - for (curchan=act->chanbase.first; curchan; curchan=curchan->next) { - if (curchan==achan && select) - curchan->flag |= ACHAN_HILIGHTED; - else - curchan->flag &= ~ACHAN_HILIGHTED; - } -} - -/* messy call... */ -static void select_poseelement_by_name(char *name, int select) -{ - /* Syncs selection of channels with selection of object elements in posemode */ - Object *ob= OBACT; - bPoseChannel *pchan; - - if (!ob || ob->type!=OB_ARMATURE) - return; - - if(select==2) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - pchan->bone->flag &= ~(BONE_ACTIVE); - } - - pchan= get_pose_channel(ob->pose, name); - if(pchan) { - if(select) - pchan->bone->flag |= (BONE_SELECTED); - else - pchan->bone->flag &= ~(BONE_SELECTED); - if(select==2) - pchan->bone->flag |= (BONE_ACTIVE); - } -} - -/* apparently within active object context */ -/* called extern, like on bone selection */ -void select_actionchannel_by_name (bAction *act, char *name, int select) -{ - bActionChannel *achan; - - if (!act) - return; - - for (achan = act->chanbase.first; achan; achan= achan->next) { - if (!strcmp(achan->name, name)) { - if (select) { - achan->flag |= ACHAN_SELECTED; - hilight_channel(act, achan, 1); - } - else { - achan->flag &= ~ACHAN_SELECTED; - hilight_channel(act, achan, 0); - } - return; - } - } -} - -/* select_mode = SELECT_REPLACE - * = SELECT_ADD - * = SELECT_SUBTRACT - * = SELECT_INVERT - */ - -/* exported for outliner (ton) */ -/* apparently within active object context */ -int select_channel(bAction *act, bActionChannel *achan, int selectmode) -{ - /* Select the channel based on the selection mode */ - int flag; - - switch (selectmode) { - case SELECT_ADD: - achan->flag |= ACHAN_SELECTED; - break; - case SELECT_SUBTRACT: - achan->flag &= ~ACHAN_SELECTED; - break; - case SELECT_INVERT: - achan->flag ^= ACHAN_SELECTED; - break; - } - flag = (achan->flag & ACHAN_SELECTED) ? 1 : 0; - - hilight_channel(act, achan, flag); - select_poseelement_by_name(achan->name, flag); - - return flag; -} - -static int select_constraint_channel(bAction *act, - bConstraintChannel *conchan, - int selectmode) -{ - /* Select the constraint channel based on the selection mode */ - int flag; - - switch (selectmode) { - case SELECT_ADD: - conchan->flag |= CONSTRAINT_CHANNEL_SELECT; - break; - case SELECT_SUBTRACT: - conchan->flag &= ~CONSTRAINT_CHANNEL_SELECT; - break; - case SELECT_INVERT: - conchan->flag ^= CONSTRAINT_CHANNEL_SELECT; - break; - } - flag = (conchan->flag & CONSTRAINT_CHANNEL_SELECT) ? 1 : 0; - - return flag; -} - -int select_icu_channel(bAction *act, IpoCurve *icu, int selectmode) -{ - /* Select the channel based on the selection mode */ - int flag; - - switch (selectmode) { - case SELECT_ADD: - icu->flag |= IPO_SELECT; - break; - case SELECT_SUBTRACT: - icu->flag &= ~IPO_SELECT; - break; - case SELECT_INVERT: - icu->flag ^= IPO_SELECT; - break; - } - flag = (icu->flag & IPO_SELECT) ? 1 : 0; - return flag; -} - -/* ----------------------------------------- */ - -/* deselects action channels in given action */ -void deselect_actionchannels (bAction *act, short test) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter, sel=1; - - /* filter data */ - filter= ACTFILTER_VISIBLE; - actdata_filter(&act_data, filter, act, ACTCONT_ACTION); - - /* See if we should be selecting or deselecting */ - if (test) { - for (ale= act_data.first; ale; ale= ale->next) { - if (sel == 0) - break; - - switch (ale->type) { - case ACTTYPE_ACHAN: - if (ale->flag & ACHAN_SELECTED) - sel= 0; - break; - case ACTTYPE_CONCHAN: - if (ale->flag & CONSTRAINT_CHANNEL_SELECT) - sel=0; - break; - case ACTTYPE_ICU: - if (ale->flag & IPO_SELECT) - sel=0; - break; - } - } - } - else - sel= 0; - - /* Now set the flags */ - for (ale= act_data.first; ale; ale= ale->next) { - switch (ale->type) { - case ACTTYPE_ACHAN: - { - bActionChannel *achan= (bActionChannel *)ale->data; - - if (sel) - achan->flag |= ACHAN_SELECTED; - else - achan->flag &= ~ACHAN_SELECTED; - select_poseelement_by_name(achan->name, sel); - } - break; - case ACTTYPE_CONCHAN: - { - bConstraintChannel *conchan= (bConstraintChannel *)ale->data; - - if (sel) - conchan->flag |= CONSTRAINT_CHANNEL_SELECT; - else - conchan->flag &= ~CONSTRAINT_CHANNEL_SELECT; - } - break; - case ACTTYPE_ICU: - { - IpoCurve *icu= (IpoCurve *)ale->data; - - if (sel) - icu->flag |= IPO_SELECT; - else - icu->flag &= ~IPO_SELECT; - } - break; - } - } - - /* Cleanup */ - BLI_freelistN(&act_data); -} - -/* deselects channels in the action editor */ -void deselect_action_channels (short test) -{ - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* based on type */ - if (datatype == ACTCONT_ACTION) - deselect_actionchannels(data, test); - // should shapekey channels be allowed to do this? -} - -/* deselects keyframes in the action editor */ -void deselect_action_keys (short test, short sel) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* See if we should be selecting or deselecting */ - if (test) { - for (ale= act_data.first; ale; ale= ale->next) { - if (is_ipo_key_selected(ale->key_data)) { - sel= 0; - break; - } - } - } - - /* Now set the flags */ - for (ale= act_data.first; ale; ale= ale->next) { - set_ipo_key_selection(ale->key_data, sel); - } - - /* Cleanup */ - BLI_freelistN(&act_data); -} - -/* selects all keyframes in the action editor - per channel or time - * mode = 0: all in channel; mode = 1: all in frame - */ -void selectall_action_keys (short mval[], short mode, short select_mode) -{ - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - if (select_mode == SELECT_REPLACE) { - deselect_action_keys(0, 0); - select_mode = SELECT_ADD; - } - - /* depending on mode */ - switch (mode) { - case 0: /* all in channel*/ - { - void *act_channel; - short chantype; - - /* get channel, and act according to type */ - act_channel= get_nearest_act_channel(mval, &chantype); - switch (chantype) { - case ACTTYPE_ACHAN: - { - bActionChannel *achan= (bActionChannel *)act_channel; - select_ipo_bezier_keys(achan->ipo, select_mode); - } - break; - case ACTTYPE_CONCHAN: - { - bConstraintChannel *conchan= (bConstraintChannel *)act_channel; - select_ipo_bezier_keys(conchan->ipo, select_mode); - } - break; - case ACTTYPE_ICU: - { - IpoCurve *icu= (IpoCurve *)act_channel; - select_icu_bezier_keys(icu, select_mode); - } - break; - } - } - break; - case 1: /* all in frame */ - { - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - rcti rect; - rctf rectf; - - /* use bounding box to find kframe */ - rect.xmin = rect.xmax = mval[0]; - rect.ymin = rect.ymax = mval[1]; - - mval[0]= rect.xmin; - mval[1]= rect.ymin+2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - rectf.xmax= rectf.xmin; - rectf.ymax= rectf.ymin; - - rectf.xmin = rectf.xmin - 0.5; - rectf.xmax = rectf.xmax + 0.5; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* Now set the flags */ - for (ale= act_data.first; ale; ale= ale->next) - borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, select_mode); - - /* Cleanup */ - BLI_freelistN(&act_data); - } - break; - } - - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); -} - -void markers_selectkeys_between (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - float min, max; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* get extreme markers */ - get_minmax_markers(1, &min, &max); - if (min==max) return; - min -= 0.5f; - max += 0.5f; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* select keys in-between */ - for (ale= act_data.first; ale; ale= ale->next) { - if(NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); - borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); - actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); - } - else { - borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); - } - } - - /* Cleanup */ - BLI_freelistN(&act_data); -} - -void selectkeys_leftright (short leftright, short select_mode) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - float min, max; - - if (select_mode==SELECT_REPLACE) { - select_mode=SELECT_ADD; - deselect_action_keys(0, 0); - } - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - if (leftright==1) { - min = -MAXFRAMEF; - max = (float)CFRA+0.1f; - } - else { - min = (float)CFRA-0.1f; - max = MAXFRAMEF; - } - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* select keys to the right */ - for (ale= act_data.first; ale; ale= ale->next) { - if(NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - actstrip_map_ipo_keys(OBACT, ale->key_data, 0, 1); - borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); - actstrip_map_ipo_keys(OBACT, ale->key_data, 1, 1); - } - else { - borderselect_ipo_key(ale->key_data, min, max, SELECT_ADD); - } - } - - /* Cleanup */ - BLI_freelistN(&act_data); - - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - -} - - -/* ----------------------------------------- */ - -/* This function makes a list of the selected keyframes - * in the ipo curves it has been passed - */ -static void make_sel_cfra_list(Ipo *ipo, ListBase *elems) -{ - IpoCurve *icu; - - if (ipo == NULL) return; - - for(icu= ipo->curve.first; icu; icu= icu->next) { - BezTriple *bezt; - int a= 0; - - for (bezt=icu->bezt; atotvert; a++, bezt++) { - if (bezt && BEZSELECTED(bezt)) - add_to_cfra_elem(elems, bezt); - } - } -} - -/* This function selects all key frames in the same column(s) as a already selected key(s) - * or marker(s), or all the keyframes on a particular frame (triggered by a RMB on x-scrollbar) - */ -void column_select_action_keys(int mode) -{ - ListBase elems= {NULL, NULL}; - CfraElem *ce; - IpoCurve *icu; - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* build list of columns */ - switch (mode) { - case 1: /* list of selected keys */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - for (ale= act_data.first; ale; ale= ale->next) - make_sel_cfra_list(ale->key_data, &elems); - - BLI_freelistN(&act_data); - break; - case 2: /* list of selected markers */ - make_marker_cfra_list(&elems, 1); - - /* apply scaled action correction if needed */ - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - for (ce= elems.first; ce; ce= ce->next) - ce->cfra= get_action_frame(OBACT, ce->cfra); - } - break; - } - - /* loop through all of the keys and select additional keyframes - * based on the keys found to be selected above - */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_ONLYICU); - actdata_filter(&act_data, filter, data, datatype); - - for (ale= act_data.first; ale; ale= ale->next) { - for (ce= elems.first; ce; ce= ce->next) { - for (icu= ale->key_data; icu; icu= icu->next) { - BezTriple *bezt; - int verts = 0; - - for (bezt=icu->bezt; vertstotvert; bezt++, verts++) { - if (bezt) { - if( (int)(ce->cfra) == (int)(bezt->vec[1][0]) ) - bezt->f2 |= 1; - } - } - } - } - } - - BLI_freelistN(&act_data); - BLI_freelistN(&elems); -} - -/* some quick defines for borderselect modes */ -#define ACTEDIT_BORDERSEL_ALL 0 -#define ACTEDIT_BORDERSEL_FRA 1 -#define ACTEDIT_BORDERSEL_CHA 2 - -/* borderselect: for keyframes only */ -void borderselect_action (void) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - rcti rect; - rctf rectf; - int val, selectmode, mode; - int (*select_function)(BezTriple *); - short mval[2]; - float ymin, ymax; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* what should be selected (based on the starting location of cursor) */ - getmouseco_areawin(mval); - if (IN_2D_VERT_SCROLL(mval)) - mode = ACTEDIT_BORDERSEL_CHA; - else if (IN_2D_HORIZ_SCROLL(mval)) - mode = ACTEDIT_BORDERSEL_FRA; - else - mode = ACTEDIT_BORDERSEL_ALL; - - /* draw and handle the borderselect stuff (ui) and get the select rect */ - if ( (val = get_border(&rect, 3)) ) { - if (val == LEFTMOUSE) { - selectmode = SELECT_ADD; - select_function = select_bezier_add; - } - else { - selectmode = SELECT_SUBTRACT; - select_function = select_bezier_subtract; - } - - mval[0]= rect.xmin; - mval[1]= rect.ymin+2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax-2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - /* if action is mapped in NLA, it returns a correction */ - if (NLA_ACTION_SCALED && datatype==ACTCONT_ACTION) { - rectf.xmin= get_action_frame(OBACT, rectf.xmin); - rectf.xmax= get_action_frame(OBACT, rectf.xmax); - } - - ymax = CHANNELHEIGHT/2; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - /* loop over data, doing border select */ - for (ale= act_data.first; ale; ale= ale->next) { - ymin=ymax-(CHANNELHEIGHT+CHANNELSKIP); - - /* what gets selected depends on the mode (based on initial position of cursor) */ - switch (mode) { - case ACTEDIT_BORDERSEL_FRA: /* all in frame(s) */ - if (ale->key_data) { - if (ale->datatype == ALE_IPO) - borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, selectmode); - else if (ale->datatype == ALE_ICU) - borderselect_icu_key(ale->key_data, rectf.xmin, rectf.xmax, select_function); - } - break; - case ACTEDIT_BORDERSEL_CHA: /* all in channel(s) */ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) { - if (ale->key_data) { - if (ale->datatype == ALE_IPO) - select_ipo_bezier_keys(ale->key_data, selectmode); - else if (ale->datatype == ALE_ICU) - select_icu_bezier_keys(ale->key_data, selectmode); - } - } - break; - default: /* any keyframe inside region defined by region */ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) { - if (ale->key_data) { - if (ale->datatype == ALE_IPO) - borderselect_ipo_key(ale->key_data, rectf.xmin, rectf.xmax, selectmode); - else if (ale->datatype == ALE_ICU) - borderselect_icu_key(ale->key_data, rectf.xmin, rectf.xmax, select_function); - } - } - } - - ymax=ymin; - } - - /* cleanup */ - BLI_freelistN(&act_data); - - BIF_undo_push("Border Select Action"); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } -} - -/* **************************************************** */ -/* MOUSE-HANDLING */ - -/* right-hand side - mouse click */ -static void mouse_action (int selectmode) -{ - void *data; - short datatype; - - bAction *act= NULL; - bActionChannel *achan= NULL; - bConstraintChannel *conchan= NULL; - IpoCurve *icu= NULL; - TimeMarker *marker; - - void *act_channel; - short sel, act_type; - float selx; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - if (datatype == ACTCONT_ACTION) act= (bAction *)data; - - act_channel= get_nearest_action_key(&selx, &sel, &act_type, &achan); - marker=find_nearest_marker(1); - - if (act_channel) { - switch (act_type) { - case ACTTYPE_ICU: - icu= (IpoCurve *)act_channel; - break; - case ACTTYPE_CONCHAN: - conchan= (bConstraintChannel *)act_channel; - break; - case ACTTYPE_ACHAN: - achan= (bActionChannel *)act_channel; - break; - default: - return; - } - - if (selectmode == SELECT_REPLACE) { - selectmode = SELECT_ADD; - - deselect_action_keys(0, 0); - - if (datatype == ACTCONT_ACTION) { - deselect_action_channels(0); - - achan->flag |= ACHAN_SELECTED; - hilight_channel(act, achan, 1); - select_poseelement_by_name(achan->name, 2); /* 2 is activate */ - } - } - - if (icu) - select_icu_key(icu, selx, selectmode); - else if (conchan) - select_ipo_key(conchan->ipo, selx, selectmode); - else - select_ipo_key(achan->ipo, selx, selectmode); - - std_rmouse_transform(transform_action_keys); - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSALL, 0); - } - else if (marker) { - /* not channel, so maybe marker */ - if (selectmode == SELECT_REPLACE) { - deselect_markers(0, 0); - marker->flag |= SELECT; - } - else if (selectmode == SELECT_INVERT) { - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - } - else if (selectmode == SELECT_ADD) - marker->flag |= SELECT; - else if (selectmode == SELECT_SUBTRACT) - marker->flag &= ~SELECT; - - std_rmouse_transform(transform_markers); - - allqueue(REDRAWMARKER, 0); - } -} - -/* lefthand side - mouse-click */ -static void mouse_actionchannels (short mval[]) -{ - bAction *act= G.saction->action; - void *data, *act_channel; - short datatype, chantype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* get channel to work on */ - act_channel= get_nearest_act_channel(mval, &chantype); - - /* action to take depends on what channel we've got */ - switch (chantype) { - case ACTTYPE_ACHAN: - { - bActionChannel *achan= (bActionChannel *)act_channel; - - if (mval[0] >= (NAMEWIDTH-16)) { - /* toggle protect */ - achan->flag ^= ACHAN_PROTECTED; - } - else if ((mval[0] >= (NAMEWIDTH-32)) && (achan->ipo)) { - /* toggle mute */ - achan->ipo->muteipo = (achan->ipo->muteipo)? 0: 1; - } - else if (mval[0] <= 17) { - /* toggle expand */ - achan->flag ^= ACHAN_EXPANDED; - } - else { - /* select/deselect achan */ - if (G.qual & LR_SHIFTKEY) { - select_channel(act, achan, SELECT_INVERT); - } - else { - deselect_actionchannels(act, 0); - select_channel(act, achan, SELECT_ADD); - } - - /* messy... set active bone */ - select_poseelement_by_name(achan->name, 2); - } - } - break; - case ACTTYPE_FILLIPO: - { - bActionChannel *achan= (bActionChannel *)act_channel; - - achan->flag ^= ACHAN_SHOWIPO; - - if ((mval[0] > 24) && (achan->flag & ACHAN_SHOWIPO)) { - /* select+make active achan */ - deselect_actionchannels(act, 0); - select_channel(act, achan, SELECT_ADD); - - /* messy... set active bone */ - select_poseelement_by_name(achan->name, 2); - } - } - break; - case ACTTYPE_FILLCON: - { - bActionChannel *achan= (bActionChannel *)act_channel; - - achan->flag ^= ACHAN_SHOWCONS; - - if ((mval[0] > 24) && (achan->flag & ACHAN_SHOWCONS)) { - /* select+make active achan */ - deselect_actionchannels(act, 0); - select_channel(act, achan, SELECT_ADD); - - /* messy... set active bone */ - select_poseelement_by_name(achan->name, 2); - } - } - break; - case ACTTYPE_ICU: - { - IpoCurve *icu= (IpoCurve *)act_channel; - -#if 0 /* disabled until all ipo tools support this -------> */ - if (mval[0] >= (NAMEWIDTH-16)) { - /* toggle protection */ - icu->flag ^= IPO_PROTECT; - } -#endif /* <------- end of disabled code */ - if (mval[0] >= (NAMEWIDTH-16)) { - /* toggle mute */ - icu->flag ^= IPO_MUTE; - } - else { - /* select/deselect */ - select_icu_channel(act, icu, SELECT_INVERT); - } - } - break; - case ACTTYPE_CONCHAN: - { - bConstraintChannel *conchan= (bConstraintChannel *)act_channel; - - if (mval[0] >= (NAMEWIDTH-16)) { - /* toggle protection */ - conchan->flag ^= CONSTRAINT_CHANNEL_PROTECTED; - } - else if ((mval[0] >= (NAMEWIDTH-32)) && (conchan->ipo)) { - /* toggle mute */ - conchan->ipo->muteipo = (conchan->ipo->muteipo)? 0: 1; - } - else { - /* select/deselect */ - select_constraint_channel(act, conchan, SELECT_INVERT); - } - } - break; - default: - return; - } - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSALL, 0); -} - -/* **************************************************** */ -/* ACTION CHANNEL RE-ORDERING */ - -void top_sel_action () -{ - bAction *act; - bActionChannel *achan; - - /* Get the selected action, exit if none are selected */ - act = G.saction->action; - if (!act) return; - - for (achan= act->chanbase.first; achan; achan= achan->next){ - if (VISIBLE_ACHAN(achan)) { - if (SEL_ACHAN(achan) && !(achan->flag & ACHAN_MOVED)){ - /* take it out off the chain keep data */ - BLI_remlink (&act->chanbase, achan); - /* make it first element */ - BLI_insertlinkbefore(&act->chanbase, act->chanbase.first, achan); - achan->flag |= ACHAN_MOVED; - /* restart with rest of list */ - achan= achan->next; - } - } - } - /* clear temp flags */ - for (achan= act->chanbase.first; achan; achan= achan->next){ - achan->flag = achan->flag & ~ACHAN_MOVED; - } - - /* Clean up and redraw stuff */ - remake_action_ipos (act); - BIF_undo_push("Top Action channel"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -void up_sel_action () -{ - bAction *act; - bActionChannel *achan, *prev; - - /* Get the selected action, exit if none are selected */ - act = G.saction->action; - if (!act) return; - - for (achan=act->chanbase.first; achan; achan= achan->next) { - if (VISIBLE_ACHAN(achan)) { - if (SEL_ACHAN(achan) && !(achan->flag & ACHAN_MOVED)){ - prev = achan->prev; - if (prev) { - /* take it out off the chain keep data */ - BLI_remlink (&act->chanbase, achan); - /* push it up */ - BLI_insertlinkbefore(&act->chanbase, prev, achan); - achan->flag |= ACHAN_MOVED; - /* restart with rest of list */ - achan= achan->next; - } - } - } - } - /* clear temp flags */ - for (achan=act->chanbase.first; achan; achan= achan->next){ - achan->flag = achan->flag & ~ACHAN_MOVED; - } - - /* Clean up and redraw stuff */ - remake_action_ipos (act); - BIF_undo_push("Up Action channel"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -void down_sel_action () -{ - bAction *act; - bActionChannel *achan, *next; - - /* Get the selected action, exit if none are selected */ - act = G.saction->action; - if (!act) return; - - for (achan= act->chanbase.last; achan; achan= achan->prev) { - if (VISIBLE_ACHAN(achan)) { - if (SEL_ACHAN(achan) && !(achan->flag & ACHAN_MOVED)){ - next = achan->next; - if (next) next = next->next; - if (next) { - /* take it out off the chain keep data */ - BLI_remlink (&act->chanbase, achan); - /* move it down */ - BLI_insertlinkbefore(&act->chanbase, next, achan); - achan->flag |= ACHAN_MOVED; - } - else { - /* take it out off the chain keep data */ - BLI_remlink (&act->chanbase, achan); - /* add at end */ - BLI_addtail(&act->chanbase, achan); - achan->flag |= ACHAN_MOVED; - } - } - } - } - /* clear temp flags */ - for (achan= act->chanbase.first; achan; achan= achan->next){ - achan->flag = achan->flag & ~ACHAN_MOVED; - } - - /* Clean up and redraw stuff */ - remake_action_ipos (act); - BIF_undo_push("Down Action channel"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -void bottom_sel_action () -{ - bAction *act; - bActionChannel *achan; - - /* Get the selected action, exit if none are selected */ - act = G.saction->action; - if (!act) return; - - for (achan=act->chanbase.last; achan; achan= achan->prev) { - if (VISIBLE_ACHAN(achan)) { - if (SEL_ACHAN(achan) && !(achan->flag & ACHAN_MOVED)) { - /* take it out off the chain keep data */ - BLI_remlink (&act->chanbase, achan); - /* add at end */ - BLI_addtail(&act->chanbase, achan); - achan->flag |= ACHAN_MOVED; - } - } - } - /* clear temp flags */ - for (achan=act->chanbase.first; achan; achan= achan->next) { - achan->flag = achan->flag & ~ACHAN_MOVED; - } - - /* Clean up and redraw stuff */ - remake_action_ipos (act); - BIF_undo_push("Bottom Action channel"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA, 0); -} - -/* **************************************************** */ -/* EVENT HANDLING */ - -void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - extern void do_actionbuts(unsigned short event); // drawaction.c - SpaceAction *saction; - void *data; - short datatype; - float dx, dy; - int doredraw= 0; - int cfra; - short mval[2]; - unsigned short event= evt->event; - short val= evt->val; - short mousebut = L_MOUSE; - - if (curarea->win==0) return; - - saction= curarea->spacedata.first; - if (!saction) - return; - - data= get_action_context(&datatype); - - if (val) { - if ( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - getmouseco_areawin(mval); - - switch(event) { - case UI_BUT_EVENT: - do_actionbuts(val); // window itself - break; - - case HOMEKEY: - do_action_buttons(B_ACTHOME); // header - break; - - case AKEY: - if (mval[0]ACTWIDTH) { - if (G.qual == LR_CTRLKEY) { - deselect_markers (1, 0); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWSOUND, 0); - } - else { - deselect_action_keys (1, 1); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - } - } - break; - - case BKEY: - if (G.qual & LR_CTRLKEY) { - borderselect_markers(); - } - else { - if (mval[0]>ACTWIDTH) - borderselect_action(); - } - break; - - case CKEY: - /* scroll the window so the current - * frame is in the center. - */ - center_currframe(); - break; - - case DKEY: - if (mval[0]>ACTWIDTH) { - if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) - duplicate_marker(); - else if (G.qual == LR_SHIFTKEY) - duplicate_action_keys(); - } - break; - - case EKEY: - if (mval[0] >= ACTWIDTH) - transform_action_keys('e', 0); - break; - - case GKEY: - if (G.qual & LR_CTRLKEY) { - transform_markers('g', 0); - } - else { - if (mval[0]>=ACTWIDTH) - transform_action_keys('g', 0); - } - break; - - case HKEY: - if (G.qual & LR_SHIFTKEY) { - if (okee("Set Keys to Auto Handle")) - sethandles_action_keys(HD_AUTO); - } - else { - if (okee("Toggle Keys Aligned Handle")) - sethandles_action_keys(HD_ALIGN); - } - break; - - case KKEY: - if (G.qual & LR_CTRLKEY) { - markers_selectkeys_between(); - } - else { - val= (G.qual & LR_SHIFTKEY) ? 2 : 1; - column_select_action_keys(val); - } - - allqueue(REDRAWMARKER, 0); - break; - - case MKEY: - if (G.qual & LR_SHIFTKEY) { - /* mirror keyframes */ - if (data) { - if (G.saction->flag & SACTION_DRAWTIME) - val = pupmenu("Mirror Keys Over%t|Current Time%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4"); - else - val = pupmenu("Mirror Keys Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4"); - - mirror_action_keys(val); - } - } - else { - /* marker operations */ - if (G.qual == 0) - add_marker(CFRA); - else if (G.qual == LR_CTRLKEY) - rename_marker(); - else - break; - allqueue(REDRAWMARKER, 0); - } - break; - - case NKEY: - if(G.qual==0) { - numbuts_action(); - - /* no panel (yet). current numbuts are not easy to put in panel... */ - //add_blockhandler(curarea, ACTION_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - //scrarea_queue_winredraw(curarea); - } - break; - - case OKEY: - clean_action(); - break; - - case PKEY: - if (G.qual & LR_CTRLKEY) /* set preview range */ - anim_previewrange_set(); - else if (G.qual & LR_ALTKEY) /* clear preview range */ - anim_previewrange_clear(); - - allqueue(REDRAWMARKER, 0); - allqueue(REDRAWBUTSALL, 0); - break; - - case SKEY: - if (mval[0]>=ACTWIDTH) { - if (G.qual == (LR_SHIFTKEY|LR_CTRLKEY)) { - if (data) { - snap_cfra_action(); - } - } - else if (G.qual & LR_SHIFTKEY) { - if (data) { - if (G.saction->flag & SACTION_DRAWTIME) - val = pupmenu("Snap Keys To%t|Nearest Second%x4|Current Time%x2|Nearest Marker %x3"); - else - val = pupmenu("Snap Keys To%t|Nearest Frame%x1|Current Frame%x2|Nearest Marker %x3"); - - snap_action_keys(val); - } - } - else { - transform_action_keys('s', 0); - } - } - break; - - case TKEY: - if (G.qual & LR_SHIFTKEY) - action_set_ipo_flags(SET_IPO_POPUP, 0); - else if (G.qual & LR_CTRLKEY) { - val= pupmenu("Time value%t|Frames %x1|Seconds%x2"); - - if (val > 0) { - if (val == 2) saction->flag |= SACTION_DRAWTIME; - else saction->flag &= ~SACTION_DRAWTIME; - - doredraw= 1; - } - } - else - transform_action_keys ('t', 0); - break; - - case VKEY: - if (okee("Set Keys to Vector Handle")) - sethandles_action_keys(HD_VECT); - break; - - case PAGEUPKEY: - if (datatype == ACTCONT_ACTION) { - if(G.qual & LR_SHIFTKEY) - top_sel_action(); - else if (G.qual & LR_CTRLKEY) - up_sel_action(); - else - nextprev_marker(1); - } - else if (datatype == ACTCONT_SHAPEKEY) { - /* only jump to markers possible (key channels can't be moved yet) */ - nextprev_marker(1); - } - break; - case PAGEDOWNKEY: - if (datatype == ACTCONT_ACTION) { - if(G.qual & LR_SHIFTKEY) - bottom_sel_action(); - else if (G.qual & LR_CTRLKEY) - down_sel_action(); - else - nextprev_marker(-1); - } - else if (datatype == ACTCONT_SHAPEKEY) { - /* only jump to markers possible (key channels can't be moved yet) */ - nextprev_marker(-1); - } - break; - - case DELKEY: - case XKEY: - if (okee("Erase selected")) { - if (mval[0]= NAMEWIDTH) - remove_marker(); - - allqueue(REDRAWTIME, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWSOUND, 0); - } - break; - - /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, - * based on user preference USER_LMOUSESELECT - */ - case LEFTMOUSE: - if (view2dmove(LEFTMOUSE)) /* only checks for sliders */ - break; - else if ((G.v2d->mask.xmin==0) || (mval[0]>ACTWIDTH)) { - /* moving time-marker / current frame */ - do { - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra= (int)dx; - if (cfra < 1) cfra= 1; - - if (cfra != CFRA) { - CFRA= cfra; - update_for_newframe(); - force_draw_all(0); - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - break; - } - /* passed on as selection */ - case RIGHTMOUSE: - /* Clicking in the channel area */ - if ((G.v2d->mask.xmin) && (mval[0]winx, sa->winy); - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - - doredraw= 1; - break; - case PADMINUS: - view2d_zoom(G.v2d, -0.15, sa->winx, sa->winy); - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - - doredraw= 1; - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - } - } - - if(doredraw) addqueue(curarea->win, REDRAW, 1); - -} - -/* **************************************************** */ diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c deleted file mode 100644 index 8efa44213ed..00000000000 --- a/source/blender/src/editarmature.c +++ /dev/null @@ -1,4770 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * editarmature.c: Interface for creating and posing armature objects - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_ID.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_modifier_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_ghash.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_deform.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_object.h" -#include "BKE_subsurf.h" -#include "BKE_utildefines.h" -#include "BKE_modifier.h" - -#include "BIF_editaction.h" -#include "BIF_editmode_undo.h" -#include "BIF_editdeform.h" -#include "BIF_editarmature.h" -#include "BIF_editconstraint.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_meshlaplacian.h" -#include "BIF_meshtools.h" -#include "BIF_poseobject.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" - -#include "BDR_editobject.h" -#include "BDR_drawobject.h" - -#include "BSE_edit.h" -#include "BSE_view.h" -#include "BSE_trans_types.h" - -#include "PIL_time.h" - -#include "reeb.h" // FIX ME - -#include "mydevice.h" -#include "blendef.h" -#include "nla.h" - -extern float center[3], centroid[3]; /* Originally defined in editobject.c */ - -/* Macros */ -#define TEST_EDITARMATURE {if(G.obedit==0) return; if( (G.vd->lay & G.obedit->lay)==0 ) return;} - -/* prototypes for later */ -static EditBone *editbone_name_exists (ListBase *ebones, char *name); // proto for below - -/* **************** tools on Editmode Armature **************** */ - -/* converts Bones to EditBone list, used for tools as well */ -void make_boneList(ListBase* list, ListBase *bones, EditBone *parent) -{ - EditBone *eBone; - Bone *curBone; - float delta[3]; - float premat[3][3]; - float postmat[3][3]; - float imat[3][3]; - float difmat[3][3]; - - for (curBone=bones->first; curBone; curBone=curBone->next){ - eBone= MEM_callocN(sizeof(EditBone), "make_editbone"); - - /* Copy relevant data from bone to eBone */ - eBone->parent=parent; - BLI_strncpy (eBone->name, curBone->name, 32); - eBone->flag = curBone->flag; - - /* fix selection flags */ - if(eBone->flag & BONE_SELECTED) { - eBone->flag |= BONE_TIPSEL; - if(eBone->parent && (eBone->flag & BONE_CONNECTED)) - eBone->parent->flag |= BONE_TIPSEL; - else - eBone->flag |= BONE_ROOTSEL; - } - else - eBone->flag &= ~BONE_ROOTSEL; - - VECCOPY(eBone->head, curBone->arm_head); - VECCOPY(eBone->tail, curBone->arm_tail); - - eBone->roll= 0.0; - - /* roll fixing */ - VecSubf (delta, eBone->tail, eBone->head); - vec_roll_to_mat3(delta, 0.0, postmat); - - Mat3CpyMat4(premat, curBone->arm_mat); - - Mat3Inv(imat, postmat); - Mat3MulMat3(difmat, imat, premat); - - eBone->roll = atan2(difmat[2][0], difmat[2][2]); - - /* rest of stuff copy */ - eBone->length= curBone->length; - eBone->dist= curBone->dist; - eBone->weight= curBone->weight; - eBone->xwidth= curBone->xwidth; - eBone->zwidth= curBone->zwidth; - eBone->ease1= curBone->ease1; - eBone->ease2= curBone->ease2; - eBone->rad_head= curBone->rad_head; - eBone->rad_tail= curBone->rad_tail; - eBone->segments = curBone->segments; - eBone->layer = curBone->layer; - - BLI_addtail (list, eBone); - - /* Add children if necessary */ - if (curBone->childbase.first) - make_boneList (list, &curBone->childbase, eBone); - } -} - -/* nasty stuff for converting roll in editbones into bones */ -/* also sets restposition in armature (arm_mat) */ -static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist) -{ - Bone *curBone; - EditBone *ebone; - float premat[3][3]; - float postmat[3][3]; - float difmat[3][3]; - float imat[3][3]; - float delta[3]; - - for (curBone=bonelist->first; curBone; curBone=curBone->next) { - /* sets local matrix and arm_mat (restpos) */ - where_is_armature_bone(curBone, curBone->parent); - - /* Find the associated editbone */ - for (ebone = editbonelist->first; ebone; ebone=ebone->next) - if ((Bone*)ebone->temp == curBone) - break; - - if (ebone) { - /* Get the ebone premat */ - VecSubf (delta, ebone->tail, ebone->head); - vec_roll_to_mat3(delta, ebone->roll, premat); - - /* Get the bone postmat */ - Mat3CpyMat4(postmat, curBone->arm_mat); - - Mat3Inv(imat, premat); - Mat3MulMat3(difmat, imat, postmat); -#if 0 - printf ("Bone %s\n", curBone->name); - printmatrix4 ("premat", premat); - printmatrix4 ("postmat", postmat); - printmatrix4 ("difmat", difmat); - printf ("Roll = %f\n", (-atan2(difmat[2][0], difmat[2][2]) * (180.0/M_PI))); -#endif - curBone->roll = -atan2(difmat[2][0], difmat[2][2]); - - /* and set restposition again */ - where_is_armature_bone(curBone, curBone->parent); - } - fix_bonelist_roll (&curBone->childbase, editbonelist); - } -} - -/* converts the editbones back to the armature */ -void editbones_to_armature (ListBase *list, Object *ob) -{ - bArmature *arm; - EditBone *eBone, *neBone; - Bone *newBone; - Object *obt; - - arm = get_armature(ob); - if (!list) return; - if (!arm) return; - - /* armature bones */ - free_bones(arm); - - /* remove zero sized bones, this gives instable restposes */ - for (eBone=list->first; eBone; eBone= neBone) { - float len= VecLenf(eBone->head, eBone->tail); - neBone= eBone->next; - if(len <= FLT_EPSILON) { - EditBone *fBone; - - /* Find any bones that refer to this bone */ - for (fBone=list->first; fBone; fBone= fBone->next){ - if (fBone->parent==eBone) - fBone->parent= eBone->parent; - } - printf("Warning: removed zero sized bone: %s\n", eBone->name); - BLI_freelinkN (list, eBone); - } - } - - /* Copy the bones from the editData into the armature */ - for (eBone=list->first; eBone; eBone=eBone->next){ - newBone= MEM_callocN (sizeof(Bone), "bone"); - eBone->temp= newBone; /* Associate the real Bones with the EditBones */ - - BLI_strncpy (newBone->name, eBone->name, 32); - memcpy (newBone->head, eBone->head, sizeof(float)*3); - memcpy (newBone->tail, eBone->tail, sizeof(float)*3); - newBone->flag= eBone->flag; - if(eBone->flag & BONE_ACTIVE) newBone->flag |= BONE_SELECTED; /* important, editbones can be active with only 1 point selected */ - newBone->roll = 0.0f; - - newBone->weight = eBone->weight; - newBone->dist = eBone->dist; - - newBone->xwidth = eBone->xwidth; - newBone->zwidth = eBone->zwidth; - newBone->ease1= eBone->ease1; - newBone->ease2= eBone->ease2; - newBone->rad_head= eBone->rad_head; - newBone->rad_tail= eBone->rad_tail; - newBone->segments= eBone->segments; - newBone->layer = eBone->layer; - - } - - /* Fix parenting in a separate pass to ensure ebone->bone connections - are valid at this point */ - for (eBone=list->first;eBone;eBone=eBone->next) { - newBone= (Bone*) eBone->temp; - if (eBone->parent){ - newBone->parent=(Bone*) eBone->parent->temp; - BLI_addtail (&newBone->parent->childbase,newBone); - - { - float M_boneRest[3][3]; - float M_parentRest[3][3]; - float iM_parentRest[3][3]; - float delta[3]; - - /* Get the parent's matrix (rotation only) */ - VecSubf (delta, eBone->parent->tail, eBone->parent->head); - vec_roll_to_mat3(delta, eBone->parent->roll, M_parentRest); - - /* Get this bone's matrix (rotation only) */ - VecSubf (delta, eBone->tail, eBone->head); - vec_roll_to_mat3(delta, eBone->roll, M_boneRest); - - /* Invert the parent matrix */ - Mat3Inv(iM_parentRest, M_parentRest); - - /* Get the new head and tail */ - VecSubf (newBone->head, eBone->head, eBone->parent->tail); - VecSubf (newBone->tail, eBone->tail, eBone->parent->tail); - - Mat3MulVecfl(iM_parentRest, newBone->head); - Mat3MulVecfl(iM_parentRest, newBone->tail); - } - } - /* ...otherwise add this bone to the armature's bonebase */ - else - BLI_addtail (&arm->bonebase,newBone); - } - - /* Make a pass through the new armature to fix rolling */ - /* also builds restposition again (like where_is_armature) */ - fix_bonelist_roll (&arm->bonebase, list); - - /* so all users of this armature should get rebuilt */ - for (obt= G.main->object.first; obt; obt= obt->id.next) { - if(obt->data==arm) - armature_rebuild_pose(obt, arm); - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); -} - - - -void apply_rot_armature (Object *ob, float mat[3][3]) -{ - ListBase list; - EditBone *ebone; - bArmature *arm; - float scale = Mat3ToScalef(mat); /* store the scale of the matrix here to use on envelopes */ - arm = get_armature(ob); - - if (!arm) - return; - - /* Put the armature into editmode */ - list.first= list.last = NULL; - make_boneList(&list, &arm->bonebase, NULL); - - /* Do the rotations */ - for (ebone = list.first; ebone; ebone=ebone->next){ - Mat3MulVecfl(mat, ebone->head); - Mat3MulVecfl(mat, ebone->tail); - - ebone->rad_head *= scale; - ebone->rad_tail *= scale; - ebone->dist *= scale; - } - - /* Turn the list into an armature */ - editbones_to_armature(&list, ob); - - /* Free the editbones */ - if (list.first){ - BLI_freelistN (&list); - } -} - -/* 0 == do center, 1 == center new, 2 == center cursor */ -void docenter_armature (Object *ob, int centermode) -{ - ListBase list; - EditBone *ebone; - bArmature *arm; - float cent[3] = {0.0f, 0.0f, 0.0f}; - float min[3], max[3]; - float omat[3][3]; - - arm = get_armature(ob); - if (!arm) return; - - /* Put the armature into editmode */ - list.first= list.last = NULL; - make_boneList(&list, &arm->bonebase, NULL); - - /* Find the centerpoint */ - if (centermode == 2) { - VECCOPY(cent, give_cursor()); - Mat4Invert(ob->imat, ob->obmat); - Mat4MulVecfl(ob->imat, cent); - } - else { - INIT_MINMAX(min, max); - - for (ebone= list.first; ebone; ebone=ebone->next) { - DO_MINMAX(ebone->head, min, max); - DO_MINMAX(ebone->tail, min, max); - } - - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - } - - /* Do the adjustments */ - for (ebone= list.first; ebone; ebone=ebone->next){ - VecSubf(ebone->head, ebone->head, cent); - VecSubf(ebone->tail, ebone->tail, cent); - } - - /* Turn the list into an armature */ - editbones_to_armature(&list, ob); - - /* Free the editbones */ - if (list.first){ - BLI_freelistN(&list); - } - - /* Adjust object location for new centerpoint */ - if(centermode && G.obedit==0) { - Mat3CpyMat4(omat, ob->obmat); - - Mat3MulVecfl(omat, cent); - ob->loc[0]+= cent[0]; - ob->loc[1]+= cent[1]; - ob->loc[2]+= cent[2]; - } -} - -/* Helper function for armature joining - link fixing */ -static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChannel *pchan, EditBone *curbone) -{ - Object *ob; - bPose *pose; - bPoseChannel *pchant; - bConstraint *con; - - /* let's go through all objects in database */ - for (ob= G.main->object.first; ob; ob= ob->id.next) { - /* do some object-type specific things */ - if (ob->type == OB_ARMATURE) { - pose= ob->pose; - for (pchant= pose->chanbase.first; pchant; pchant= pchant->next) { - for (con= pchant->constraints.first; con; con= con->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(con); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - /* constraint targets */ - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if (ct->tar == srcArm) { - if (strcmp(ct->subtarget, "")==0) { - ct->tar = tarArm; - } - else if (strcmp(ct->subtarget, pchan->name)==0) { - ct->tar = tarArm; - strcpy(ct->subtarget, curbone->name); - } - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 0); - } - - /* action constraint? */ - if (con->type == CONSTRAINT_TYPE_ACTION) { - bActionConstraint *data= con->data; - bAction *act; - bActionChannel *achan; - - if (data->act) { - act= data->act; - - for (achan= act->chanbase.first; achan; achan= achan->next) { - if (strcmp(achan->name, pchan->name)==0) - BLI_strncpy(achan->name, curbone->name, 32); - } - } - } - - } - } - } - - /* fix object-level constraints */ - if (ob != srcArm) { - for (con= ob->constraints.first; con; con= con->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(con); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - /* constraint targets */ - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if (ct->tar == srcArm) { - if (strcmp(ct->subtarget, "")==0) { - ct->tar = tarArm; - } - else if (strcmp(ct->subtarget, pchan->name)==0) { - ct->tar = tarArm; - strcpy(ct->subtarget, curbone->name); - } - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 0); - } - } - } - - /* See if an object is parented to this armature */ - if (ob->parent && (ob->parent == srcArm)) { - /* Is object parented to a bone of this src armature? */ - if (ob->partype==PARBONE) { - /* bone name in object */ - if (!strcmp(ob->parsubstr, pchan->name)) - BLI_strncpy(ob->parsubstr, curbone->name, 32); - } - - /* make tar armature be new parent */ - ob->parent = tarArm; - } - } -} - -int join_armature(void) -{ - Object *ob; - bArmature *arm; - Base *base, *nextbase; - bPose *pose, *opose; - bPoseChannel *pchan, *pchann; - ListBase ebbase, eblist; - EditBone *curbone; - float mat[4][4], imat[4][4]; - - /* Ensure we're not in editmode and that the active object is an armature*/ - /* if(G.obedit) return; */ /* Alredy checked in join_menu() */ - - ob= OBACT; - if(ob->type!=OB_ARMATURE) return 0; - if (object_data_is_libdata(ob)) { - error_libdata(); - return 0; - } - arm= get_armature(ob); - - /* Get editbones of active armature to add editbones to */ - ebbase.first=ebbase.last= NULL; - make_boneList(&ebbase, &arm->bonebase, NULL); - pose= ob->pose; - - for (base=FIRSTBASE; base; base=nextbase) { - nextbase = base->next; - if (TESTBASE(base)){ - if ((base->object->type==OB_ARMATURE) && (base->object!=ob)){ - /* Make a list of editbones in current armature */ - eblist.first=eblist.last= NULL; - make_boneList (&eblist, &((bArmature*)base->object->data)->bonebase,NULL); - - /* Get Pose of current armature */ - opose= base->object->pose; - - /* Find the difference matrix */ - Mat4Invert(imat, ob->obmat); - Mat4MulMat4(mat, base->object->obmat, imat); - - /* Copy bones and posechannels from the object to the edit armature */ - for (pchan=opose->chanbase.first; pchan; pchan=pchann) { - pchann= pchan->next; - curbone= editbone_name_exists(&eblist, pchan->name); - - /* Get new name */ - unique_editbone_name (&ebbase, curbone->name); - - /* Transform the bone */ - { - float premat[4][4]; - float postmat[4][4]; - float difmat[4][4]; - float imat[4][4]; - float temp[3][3]; - float delta[3]; - - /* Get the premat */ - VecSubf (delta, curbone->tail, curbone->head); - vec_roll_to_mat3(delta, curbone->roll, temp); - - Mat4MulMat34 (premat, temp, mat); - - Mat4MulVecfl(mat, curbone->head); - Mat4MulVecfl(mat, curbone->tail); - - /* Get the postmat */ - VecSubf (delta, curbone->tail, curbone->head); - vec_roll_to_mat3(delta, curbone->roll, temp); - Mat4CpyMat3(postmat, temp); - - /* Find the roll */ - Mat4Invert (imat, premat); - Mat4MulMat4 (difmat, postmat, imat); - - curbone->roll -= atan2(difmat[2][0], difmat[2][2]); - - } - - /* Fix Constraints and Other Links to this Bone and Armature */ - joined_armature_fix_links(ob, base->object, pchan, curbone); - - /* Rename pchan */ - sprintf(pchan->name, curbone->name); - - /* Jump Ship! */ - BLI_remlink(&eblist, curbone); - BLI_addtail(&ebbase, curbone); - - BLI_remlink(&opose->chanbase, pchan); - BLI_addtail(&pose->chanbase, pchan); - } - - free_and_unlink_base(base); - } - } - } - - DAG_scene_sort(G.scene); // because we removed object(s) - - editbones_to_armature(&ebbase, ob); - if (ebbase.first) BLI_freelistN(&ebbase); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - return 1; -} - -/* **************** END tools on Editmode Armature **************** */ -/* **************** PoseMode & EditMode *************************** */ - -/* only for opengl selection indices */ -Bone *get_indexed_bone (Object *ob, int index) -{ - bPoseChannel *pchan; - int a= 0; - - if(ob->pose==NULL) return NULL; - index>>=16; // bone selection codes use left 2 bytes - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) { - if(a==index) return pchan->bone; - } - return NULL; -} - -/* See if there are any selected bones in this buffer */ -static void *get_bone_from_selectbuffer(Base *base, unsigned int *buffer, short hits, short findunsel) -{ - Object *ob= base->object; - Bone *bone; - EditBone *ebone; - void *firstunSel=NULL, *firstSel=NULL, *data; - unsigned int hitresult; - short i, takeNext=0, sel; - - for (i=0; i< hits; i++){ - hitresult = buffer[3+(i*4)]; - - if (!(hitresult & BONESEL_NOSEL)) { // -1 - if(hitresult & BONESEL_ANY) { // to avoid including objects in selection - - hitresult &= ~(BONESEL_ANY); - /* Determine what the current bone is */ - if (G.obedit==NULL || base->object!=G.obedit) { - /* no singular posemode, so check for correct object */ - if(base->selcol == (hitresult & 0xFFFF)) { - bone = get_indexed_bone(ob, hitresult); - - if (findunsel) - sel = (bone->flag & BONE_SELECTED); - else - sel = !(bone->flag & BONE_SELECTED); - - data = bone; - } - else { - data= NULL; - sel= 0; - } - } - else{ - ebone = BLI_findlink(&G.edbo, hitresult); - if (findunsel) - sel = (ebone->flag & BONE_SELECTED); - else - sel = !(ebone->flag & BONE_SELECTED); - - data = ebone; - } - - if(data) { - if (sel) { - if(!firstSel) firstSel= data; - takeNext=1; - } - else { - if (!firstunSel) - firstunSel=data; - if (takeNext) - return data; - } - } - } - } - } - - if (firstunSel) - return firstunSel; - else - return firstSel; -} - -/* used by posemode as well editmode */ -static void *get_nearest_bone (short findunsel) -{ - unsigned int buffer[MAXPICKBUF]; - short hits; - - persp(PERSP_VIEW); - - glInitNames(); - hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0); - - if (hits>0) - return get_bone_from_selectbuffer(BASACT, buffer, hits, findunsel); - - return NULL; -} - -/* used by posemode and editmode */ -void select_bone_parent (void) -{ - Object *ob; - bArmature *arm; - - /* get data */ - if (G.obedit) - ob= G.obedit; - else if (OBACT) - ob= OBACT; - else - return; - arm= (bArmature *)ob->data; - - /* determine which mode armature is in */ - if ((!G.obedit) && (ob->flag & OB_POSEMODE)) { - /* deal with pose channels */ - /* channels are sorted on dependency, so the loop below won't result in a flood-select */ - bPoseChannel *pchan=NULL; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - /* check if bone in original selection */ - if (pchan->bone->flag & BONE_SELECTED) { - bPoseChannel *chanpar= pchan->parent; - - /* check if any parent */ - if ((chanpar) && ((chanpar->bone->flag & BONE_SELECTED)==0)) { - chanpar->bone->flag |= BONE_SELECTED; - select_actionchannel_by_name (ob->action, pchan->name, 1); - } - } - } - } - else if (G.obedit) { - /* deal with editbones */ - EditBone *curbone, *parbone, *parpar; - - /* prevent floods */ - for (curbone= G.edbo.first; curbone; curbone= curbone->next) - curbone->temp= NULL; - - for (curbone= G.edbo.first; curbone; curbone= curbone->next) { - /* check if bone selected */ - if ((curbone->flag & BONE_SELECTED) && curbone->temp==NULL) { - parbone= curbone->parent; - - /* check if any parent */ - if ((parbone) && ((parbone->flag & BONE_SELECTED)==0)) { - /* select the parent bone */ - parbone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - - /* check if parent has parent */ - parpar= parbone->parent; - - if ((parpar) && (parbone->flag & BONE_CONNECTED)) { - parpar->flag |= BONE_TIPSEL; - } - /* tag this bone to not flood selection */ - parbone->temp= parbone; - } - } - } - - /* to be sure... */ - for (curbone= G.edbo.first; curbone; curbone= curbone->next) - curbone->temp= NULL; - - } - - /* undo + redraw pushes */ - countall(); // flushes selection! - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Select Parent"); -} - - -/* **************** END PoseMode & EditMode *************************** */ -/* **************** Posemode stuff ********************** */ - - -static void selectconnected_posebonechildren (Object *ob, Bone *bone) -{ - Bone *curBone; - - if (!(bone->flag & BONE_CONNECTED)) - return; - - select_actionchannel_by_name (ob->action, bone->name, !(G.qual & LR_SHIFTKEY)); - - if (G.qual & LR_SHIFTKEY) - bone->flag &= ~BONE_SELECTED; - else - bone->flag |= BONE_SELECTED; - - for (curBone=bone->childbase.first; curBone; curBone=curBone->next){ - selectconnected_posebonechildren (ob, curBone); - } -} - -/* within active object context */ -void selectconnected_posearmature(void) -{ - Bone *bone, *curBone, *next; - Object *ob= OBACT; - - if(!ob || !ob->pose) return; - - if (G.qual & LR_SHIFTKEY) - bone= get_nearest_bone(0); - else - bone = get_nearest_bone(1); - - if (!bone) - return; - - /* Select parents */ - for (curBone=bone; curBone; curBone=next){ - select_actionchannel_by_name (ob->action, curBone->name, !(G.qual & LR_SHIFTKEY)); - if (G.qual & LR_SHIFTKEY) - curBone->flag &= ~BONE_SELECTED; - else - curBone->flag |= BONE_SELECTED; - - if (curBone->flag & BONE_CONNECTED) - next=curBone->parent; - else - next=NULL; - } - - /* Select children */ - for (curBone=bone->childbase.first; curBone; curBone=next){ - selectconnected_posebonechildren (ob, curBone); - } - - countall(); // flushes selection! - - allqueue (REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Select connected"); - -} - -/* **************** END Posemode stuff ********************** */ -/* **************** EditMode stuff ********************** */ - -/* called in space.c */ -void selectconnected_armature(void) -{ - EditBone *bone, *curBone, *next; - - if (G.qual & LR_SHIFTKEY) - bone= get_nearest_bone(0); - else - bone= get_nearest_bone(1); - - if (!bone) - return; - - /* Select parents */ - for (curBone=bone; curBone; curBone=next){ - if (G.qual & LR_SHIFTKEY){ - curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - } - else{ - curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - } - - if (curBone->flag & BONE_CONNECTED) - next=curBone->parent; - else - next=NULL; - } - - /* Select children */ - while (bone){ - for (curBone=G.edbo.first; curBone; curBone=next){ - next = curBone->next; - if (curBone->parent == bone){ - if (curBone->flag & BONE_CONNECTED){ - if (G.qual & LR_SHIFTKEY) - curBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - else - curBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - bone=curBone; - break; - } - else{ - bone=NULL; - break; - } - } - } - if (!curBone) - bone=NULL; - - } - - countall(); // flushes selection! - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Select connected"); - -} - -/* does bones and points */ -/* note that BONE ROOT only gets drawn for root bones (or without IK) */ -static EditBone * get_nearest_editbonepoint (int findunsel, int *selmask) -{ - EditBone *ebone; - unsigned int buffer[MAXPICKBUF]; - unsigned int hitresult, besthitresult=BONESEL_NOSEL; - int i, mindep= 4; - short hits, mval[2]; - - persp(PERSP_VIEW); - - glInitNames(); - - getmouseco_areawin(mval); - hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-5, mval[1]-5, mval[0]+5, mval[1]+5); - if(hits==0) - hits= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-12, mval[1]-12, mval[0]+12, mval[1]+12); - - /* See if there are any selected bones in this group */ - if (hits>0) { - - if(hits==1) { - if (!(buffer[3] & BONESEL_NOSEL)) - besthitresult= buffer[3]; - } - else { - for (i=0; i< hits; i++) { - hitresult= buffer[3+(i*4)]; - if (!(hitresult & BONESEL_NOSEL)) { - int dep; - - ebone = BLI_findlink(&G.edbo, hitresult & ~BONESEL_ANY); - - /* clicks on bone points get advantage */ - if( hitresult & (BONESEL_ROOT|BONESEL_TIP)) { - /* but also the unselected one */ - if(findunsel) { - if( (hitresult & BONESEL_ROOT) && (ebone->flag & BONE_ROOTSEL)==0) - dep= 1; - else if( (hitresult & BONESEL_TIP) && (ebone->flag & BONE_TIPSEL)==0) - dep= 1; - else - dep= 2; - } - else dep= 2; - } - else { - /* bone found */ - if(findunsel) { - if((ebone->flag & BONE_SELECTED)==0) - dep= 2; - else - dep= 3; - } - else dep= 3; - } - if(dep < mindep) { - mindep= dep; - besthitresult= hitresult; - } - } - } - } - - if (!(besthitresult & BONESEL_NOSEL)) { - - ebone= BLI_findlink(&G.edbo, besthitresult & ~BONESEL_ANY); - - *selmask = 0; - if (besthitresult & BONESEL_ROOT) - *selmask |= BONE_ROOTSEL; - if (besthitresult & BONESEL_TIP) - *selmask |= BONE_TIPSEL; - if (besthitresult & BONESEL_BONE) - *selmask |= BONE_SELECTED; - return ebone; - } - } - *selmask = 0; - return NULL; -} - -static void delete_bone(EditBone* exBone) -{ - EditBone *curBone; - - /* Find any bones that refer to this bone */ - for (curBone=G.edbo.first;curBone;curBone=curBone->next){ - if (curBone->parent==exBone){ - curBone->parent=exBone->parent; - curBone->flag &= ~BONE_CONNECTED; - } - } - - BLI_freelinkN (&G.edbo,exBone); -} - -/* only editmode! */ -void delete_armature(void) -{ - bArmature *arm= G.obedit->data; - EditBone *curBone, *next; - bConstraint *con; - - TEST_EDITARMATURE; - if (okee("Erase selected bone(s)")==0) return; - - /* Select mirrored bones */ - if (arm->flag & ARM_MIRROR_EDIT) { - for (curBone=G.edbo.first; curBone; curBone=curBone->next) { - if (arm->layer & curBone->layer) { - if (curBone->flag & BONE_SELECTED) { - next = armature_bone_get_mirrored(curBone); - if (next) - next->flag |= BONE_SELECTED; - } - } - } - } - - /* First erase any associated pose channel */ - if (G.obedit->pose) { - bPoseChannel *chan, *next; - for (chan=G.obedit->pose->chanbase.first; chan; chan=next) { - next= chan->next; - curBone = editbone_name_exists (&G.edbo, chan->name); - - if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) { - free_constraints(&chan->constraints); - BLI_freelinkN (&G.obedit->pose->chanbase, chan); - } - else { - for (con= chan->constraints.first; con; con= con->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(con); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if (ct->tar == G.obedit) { - if (ct->subtarget[0]) { - curBone = editbone_name_exists(&G.edbo, ct->subtarget); - if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) { - con->flag |= CONSTRAINT_DISABLE; - ct->subtarget[0]= 0; - } - } - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 0); - } - } - } - } - } - - - for (curBone=G.edbo.first;curBone;curBone=next) { - next=curBone->next; - if (arm->layer & curBone->layer) - if (curBone->flag & BONE_SELECTED) - delete_bone(curBone); - } - - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - countall(); // flushes selection! - - BIF_undo_push("Delete bone(s)"); -} - -/* context: editmode armature */ -void mouse_armature(void) -{ - EditBone *nearBone = NULL, *ebone; - int selmask; - - nearBone= get_nearest_editbonepoint(1, &selmask); - if (nearBone) { - - if (!(G.qual & LR_SHIFTKEY)) { - deselectall_armature(0, 0); - } - - /* by definition the non-root connected bones have no root point drawn, - so a root selection needs to be delivered to the parent tip, - countall() (bad location) flushes these flags */ - - if(selmask & BONE_SELECTED) { - if(nearBone->parent && (nearBone->flag & BONE_CONNECTED)) { - /* click in a chain */ - if(G.qual & LR_SHIFTKEY) { - /* hold shift inverts this bone's selection */ - if(nearBone->flag & BONE_SELECTED) { - /* deselect this bone */ - nearBone->flag &= ~(BONE_TIPSEL|BONE_SELECTED); - /* only deselect parent tip if it is not selected */ - if(!(nearBone->parent->flag & BONE_SELECTED)) - nearBone->parent->flag &= ~BONE_TIPSEL; - } - else { - /* select this bone */ - nearBone->flag |= BONE_TIPSEL; - nearBone->parent->flag |= BONE_TIPSEL; - } - } - else { - /* select this bone */ - nearBone->flag |= BONE_TIPSEL; - nearBone->parent->flag |= BONE_TIPSEL; - } - } - else { - if(G.qual & LR_SHIFTKEY) { - /* hold shift inverts this bone's selection */ - if(nearBone->flag & BONE_SELECTED) - nearBone->flag &= ~(BONE_TIPSEL|BONE_ROOTSEL); - else - nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL); - } - else nearBone->flag |= (BONE_TIPSEL|BONE_ROOTSEL); - } - } - else { - if ((G.qual & LR_SHIFTKEY) && (nearBone->flag & selmask)) - nearBone->flag &= ~selmask; - else - nearBone->flag |= selmask; - } - - countall(); // flushes selection! - - if(nearBone) { - /* then now check for active status */ - for (ebone=G.edbo.first;ebone;ebone=ebone->next) ebone->flag &= ~BONE_ACTIVE; - if(nearBone->flag & BONE_SELECTED) nearBone->flag |= BONE_ACTIVE; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - - rightmouse_transform(); -} - -void free_editArmature(void) -{ - - /* Clear the editbones list */ - if (G.edbo.first){ - BLI_freelistN (&G.edbo); - } -} - -void remake_editArmature(void) -{ - if(okee("Reload original data")==0) return; - - make_editArmature(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSHEAD, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - -// BIF_undo_push("Delete bone"); - -} - -/* Put object in EditMode */ -void make_editArmature(void) -{ - bArmature *arm; - - if (G.obedit==0) return; - - free_editArmature(); - - arm= get_armature(G.obedit); - if (!arm) - return; - - make_boneList (&G.edbo, &arm->bonebase,NULL); -} - -/* put EditMode back in Object */ -void load_editArmature(void) -{ - bArmature *arm; - - arm= get_armature(G.obedit); - if (!arm) return; - - editbones_to_armature(&G.edbo, G.obedit); -} - -/* toggle==0: deselect - toggle==1: swap - toggle==2: only active tag -*/ -void deselectall_armature(int toggle, int doundo) -{ - bArmature *arm= G.obedit->data; - EditBone *eBone; - int sel=1; - - if(toggle==1) { - /* Determine if there are any selected bones - And therefore whether we are selecting or deselecting */ - for (eBone=G.edbo.first;eBone;eBone=eBone->next){ -// if(arm->layer & eBone->layer) { - if (eBone->flag & (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL)){ - sel=0; - break; - } -// } - } - } - else sel= toggle; - - /* Set the flags */ - for (eBone=G.edbo.first;eBone;eBone=eBone->next){ - if (sel==1) { - if(arm->layer & eBone->layer && (eBone->flag & BONE_HIDDEN_A)==0) { - eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); - if(eBone->parent) - eBone->parent->flag |= (BONE_TIPSEL); - } - } - else if (sel==2) - eBone->flag &= ~(BONE_ACTIVE); - else - eBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE); - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - - countall(); // flushes selection! - if (doundo) { - if (sel==1) BIF_undo_push("Select All"); - else BIF_undo_push("Deselect All"); - } -} - -/* Sets the roll value of selected bones, depending on the mode - * mode == 0: their z-axes point upwards - * mode == 1: their z-axes point towards 3d-cursor - */ -void auto_align_armature(short mode) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - EditBone *flipbone = NULL; - float delta[3]; - float curmat[3][3]; - float *cursor= give_cursor(); - - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { - if (arm->flag & ARM_MIRROR_EDIT) - flipbone = armature_bone_get_mirrored(ebone); - - if ((ebone->flag & BONE_SELECTED) || - (flipbone && flipbone->flag & BONE_SELECTED)) - { - /* specific method used to calculate roll depends on mode */ - if (mode == 1) { - /* Z-Axis point towards cursor */ - float mat[4][4], tmat[4][4], imat[4][4]; - float rmat[4][4], rot[3]; - float vec[3]; - - /* find the current bone matrix as a 4x4 matrix (in Armature Space) */ - VecSubf(delta, ebone->tail, ebone->head); - vec_roll_to_mat3(delta, ebone->roll, curmat); - Mat4CpyMat3(mat, curmat); - VECCOPY(mat[3], ebone->head); - - /* multiply bone-matrix by object matrix (so that bone-matrix is in WorldSpace) */ - Mat4MulMat4(tmat, mat, G.obedit->obmat); - Mat4Invert(imat, tmat); - - /* find position of cursor relative to bone */ - VecMat4MulVecfl(vec, imat, cursor); - - /* check that cursor is in usable position */ - if ((IS_EQ(vec[0], 0)==0) && (IS_EQ(vec[2], 0)==0)) { - /* Compute a rotation matrix around y */ - rot[1] = atan2(vec[0], vec[2]); - rot[0] = rot[2] = 0.0f; - EulToMat4(rot, rmat); - - /* Multiply the bone matrix by rotation matrix. This should be new bone-matrix */ - Mat4MulMat4(tmat, rmat, mat); - Mat3CpyMat4(curmat, tmat); - - /* Now convert from new bone-matrix, back to a roll value (in radians) */ - mat3_to_vec_roll(curmat, delta, &ebone->roll); - } - } - else { - /* Z-Axis Point Up */ - float xaxis[3]={1.0, 0.0, 0.0}, yaxis[3], zaxis[3]={0.0, 0.0, 1.0}; - float targetmat[3][3], imat[3][3], diffmat[3][3]; - - /* Find the current bone matrix */ - VecSubf(delta, ebone->tail, ebone->head); - vec_roll_to_mat3(delta, 0.0, curmat); - - /* Make new matrix based on y axis & z-up */ - VECCOPY (yaxis, curmat[1]); - - Mat3One(targetmat); - VECCOPY (targetmat[0], xaxis); - VECCOPY (targetmat[1], yaxis); - VECCOPY (targetmat[2], zaxis); - Mat3Ortho(targetmat); - - /* Find the difference between the two matrices */ - Mat3Inv(imat, targetmat); - Mat3MulMat3(diffmat, imat, curmat); - - ebone->roll = atan2(diffmat[2][0], diffmat[2][2]); - } - } - } - } -} - -/* **************** undo for armatures ************** */ - -static void undoBones_to_editBones(void *lbv) -{ - ListBase *lb= lbv; - EditBone *ebo, *newebo; - - BLI_freelistN(&G.edbo); - - /* copy */ - for(ebo= lb->first; ebo; ebo= ebo->next) { - newebo= MEM_dupallocN(ebo); - ebo->temp= newebo; - BLI_addtail(&G.edbo, newebo); - } - - /* set pointers */ - for(newebo= G.edbo.first; newebo; newebo= newebo->next) { - if(newebo->parent) newebo->parent= newebo->parent->temp; - } - /* be sure they dont hang ever */ - for(newebo= G.edbo.first; newebo; newebo= newebo->next) { - newebo->temp= NULL; - } -} - -static void *editBones_to_undoBones(void) -{ - ListBase *lb; - EditBone *ebo, *newebo; - - lb= MEM_callocN(sizeof(ListBase), "listbase undo"); - - /* copy */ - for(ebo= G.edbo.first; ebo; ebo= ebo->next) { - newebo= MEM_dupallocN(ebo); - ebo->temp= newebo; - BLI_addtail(lb, newebo); - } - - /* set pointers */ - for(newebo= lb->first; newebo; newebo= newebo->next) { - if(newebo->parent) newebo->parent= newebo->parent->temp; - } - - return lb; -} - -static void free_undoBones(void *lbv) -{ - ListBase *lb= lbv; - - BLI_freelistN(lb); - MEM_freeN(lb); -} - -/* and this is all the undo system needs to know */ -void undo_push_armature(char *name) -{ - undo_editmode_push(name, free_undoBones, undoBones_to_editBones, editBones_to_undoBones); -} - - - -/* **************** END EditMode stuff ********************** */ -/* *************** Adding stuff in editmode *************** */ - -/* default bone add, returns it selected, but without tail set */ -static EditBone *add_editbone(char *name) -{ - bArmature *arm= G.obedit->data; - - EditBone *bone= MEM_callocN(sizeof(EditBone), "eBone"); - - BLI_strncpy(bone->name, name, 32); - unique_editbone_name(&G.edbo, bone->name); - - BLI_addtail(&G.edbo, bone); - - bone->flag |= BONE_TIPSEL; - bone->weight= 1.0F; - bone->dist= 0.25F; - bone->xwidth= 0.1; - bone->zwidth= 0.1; - bone->ease1= 1.0; - bone->ease2= 1.0; - bone->rad_head= 0.10; - bone->rad_tail= 0.05; - bone->segments= 1; - bone->layer= arm->layer; - - return bone; -} - -static void add_primitive_bone(Object *ob, short newob) -{ - float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3]; - EditBone *bone; - - VECCOPY (curs, give_cursor()); - - /* Get inverse point for head and orientation for tail */ - Mat4Invert(G.obedit->imat, G.obedit->obmat); - Mat4MulVecfl(G.obedit->imat, curs); - - if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(obmat, G.vd->viewmat); - else Mat3One(obmat); - - Mat3CpyMat4(viewmat, G.obedit->obmat); - Mat3MulMat3(totmat, obmat, viewmat); - Mat3Inv(imat, totmat); - - deselectall_armature(0, 0); - - /* Create a bone */ - bone= add_editbone("Bone"); - - VECCOPY(bone->head, curs); - - if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED) - VecAddf(bone->tail, bone->head, imat[1]); // bone with unit length 1 - else - VecAddf(bone->tail, bone->head, imat[2]); // bone with unit length 1, pointing up Z - -} - -void add_primitiveArmature(int type) -{ - short newob=0; - - if(G.scene->id.lib) return; - - /* this function also comes from an info window */ - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - if(G.vd==NULL) return; - - G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT); - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - - check_editmode(OB_ARMATURE); - - /* If we're not the "obedit", make a new object and enter editmode */ - if(G.obedit==NULL) { - add_object(OB_ARMATURE); - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - - where_is_object(G.obedit); - - make_editArmature(); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - newob=1; - } - - /* no primitive support yet */ - add_primitive_bone(G.obedit, newob); - - countall(); // flushes selection! - - if ( (newob) && !(U.flag & USER_ADD_EDITMODE)) { - exit_editmode(2); - } - - allqueue(REDRAWALL, 0); - BIF_undo_push("Add primitive"); -} - -/* the ctrl-click method */ -void addvert_armature(void) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone, *newbone, *flipbone; - float *curs, mat[3][3],imat[3][3]; - int a, to_root= 0; - - TEST_EDITARMATURE; - - /* find the active or selected bone */ - for (ebone = G.edbo.first; ebone; ebone=ebone->next) - if(arm->layer & ebone->layer) - if(ebone->flag & (BONE_ACTIVE|BONE_TIPSEL)) break; - - if(ebone==NULL) { - for (ebone = G.edbo.first; ebone; ebone=ebone->next) - if(arm->layer & ebone->layer) - if(ebone->flag & (BONE_ACTIVE|BONE_ROOTSEL)) break; - - if(ebone==NULL) - return; - to_root= 1; - } - - deselectall_armature(0, 0); - - /* we re-use code for mirror editing... */ - flipbone= NULL; - if(arm->flag & ARM_MIRROR_EDIT) - flipbone= armature_bone_get_mirrored(ebone); - - for(a=0; a<2; a++) { - if(a==1) { - if(flipbone==NULL) - break; - else { - SWAP(EditBone *, flipbone, ebone); - } - } - - newbone= add_editbone(ebone->name); - newbone->flag |= BONE_ACTIVE; - - if(to_root) { - VECCOPY(newbone->head, ebone->head); - newbone->rad_head= ebone->rad_tail; - newbone->parent= ebone->parent; - } - else { - VECCOPY(newbone->head, ebone->tail); - newbone->rad_head= ebone->rad_tail; - newbone->parent= ebone; - newbone->flag |= BONE_CONNECTED; - } - - curs= give_cursor(); - VECCOPY(newbone->tail, curs); - VecSubf(newbone->tail, newbone->tail, G.obedit->obmat[3]); - - if(a==1) - newbone->tail[0]= -newbone->tail[0]; - - Mat3CpyMat4(mat, G.obedit->obmat); - Mat3Inv(imat, mat); - Mat3MulVecfl(imat, newbone->tail); - - newbone->length= VecLenf(newbone->head, newbone->tail); - newbone->rad_tail= newbone->length*0.05f; - newbone->dist= newbone->length*0.25f; - - } - - - countall(); - - BIF_undo_push("Add Bone"); - allqueue(REDRAWVIEW3D, 0); - - while(get_mbut()&R_MOUSE); -} - -/* adds an EditBone between the nominated locations (should be in the right space) */ -static EditBone *add_points_bone (float head[], float tail[]) -{ - EditBone *ebo; - - ebo= add_editbone("Bone"); - - VECCOPY(ebo->head, head); - VECCOPY(ebo->tail, tail); - - return ebo; -} - - -static EditBone *get_named_editbone(char *name) -{ - EditBone *eBone; - - if (name) - for (eBone=G.edbo.first; eBone; eBone=eBone->next){ - if (!strcmp (name, eBone->name)) - return eBone; - } - - return NULL; -} - -static void update_dup_subtarget(EditBone *dupBone) -{ - /* If an edit bone has been duplicated, lets - * update it's constraints if the subtarget - * they point to has also been duplicated - */ - EditBone *oldtarget, *newtarget; - bPoseChannel *chan; - bConstraint *curcon; - ListBase *conlist; - - - if ( (chan = verify_pose_channel(OBACT->pose, dupBone->name)) ) { - if ( (conlist = &chan->constraints) ) { - for (curcon = conlist->first; curcon; curcon=curcon->next) { - /* does this constraint have a subtarget in - * this armature? - */ - bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(curcon, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if ((ct->tar == G.obedit) && (ct->subtarget[0])) { - oldtarget = get_named_editbone(ct->subtarget); - if (oldtarget) { - /* was the subtarget bone duplicated too? If - * so, update the constraint to point at the - * duplicate of the old subtarget. - */ - if (oldtarget->flag & BONE_SELECTED){ - newtarget = (EditBone *) oldtarget->temp; - strcpy(ct->subtarget, newtarget->name); - } - } - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(curcon, &targets, 0); - } - } - } - } -} - - -void adduplicate_armature(void) -{ - bArmature *arm= G.obedit->data; - EditBone *eBone = NULL; - EditBone *curBone; - EditBone *firstDup=NULL; /* The beginning of the duplicated bones in the edbo list */ - - countall(); // flushes selection! - - /* Select mirrored bones */ - if (arm->flag & ARM_MIRROR_EDIT) { - for (curBone=G.edbo.first; curBone; curBone=curBone->next) { - if (arm->layer & curBone->layer) { - if (curBone->flag & BONE_SELECTED) { - eBone = armature_bone_get_mirrored(curBone); - if (eBone) - eBone->flag |= BONE_SELECTED; - } - } - } - } - - /* Find the selected bones and duplicate them as needed */ - for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next){ - if (arm->layer & curBone->layer) { - if (curBone->flag & BONE_SELECTED) { - - eBone=MEM_callocN(sizeof(EditBone), "addup_editbone"); - eBone->flag |= BONE_SELECTED; - - /* Copy data from old bone to new bone */ - memcpy (eBone, curBone, sizeof(EditBone)); - - curBone->temp = eBone; - eBone->temp = curBone; - - unique_editbone_name (&G.edbo, eBone->name); - BLI_addtail (&G.edbo, eBone); - if (!firstDup) - firstDup=eBone; - - /* Lets duplicate the list of constraints that the - * current bone has. - */ - if (OBACT->pose) { - bPoseChannel *chanold, *channew; - ListBase *listold, *listnew; - - chanold = verify_pose_channel (OBACT->pose, curBone->name); - if (chanold) { - listold = &chanold->constraints; - if (listold) { - /* WARNING: this creates a new posechannel, but there will not be an attached bone - * yet as the new bones created here are still 'EditBones' not 'Bones'. - */ - channew = - verify_pose_channel(OBACT->pose, eBone->name); - if (channew) { - /* copy transform locks */ - channew->protectflag = chanold->protectflag; - - /* ik (dof) settings */ - channew->ikflag = chanold->ikflag; - VECCOPY(channew->limitmin, chanold->limitmin); - VECCOPY(channew->limitmax, chanold->limitmax); - VECCOPY(channew->stiffness, chanold->stiffness); - channew->ikstretch= chanold->ikstretch; - - /* constraints */ - listnew = &channew->constraints; - copy_constraints (listnew, listold); - } - } - } - } - } - } - } - - /* Run though the list and fix the pointers */ - for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next){ - if(arm->layer & curBone->layer) { - if (curBone->flag & BONE_SELECTED){ - eBone=(EditBone*) curBone->temp; - - /* If this bone has no parent, - Set the duplicate->parent to NULL - */ - if (!curBone->parent){ - eBone->parent = NULL; - } - /* If this bone has a parent that IS selected, - Set the duplicate->parent to the curBone->parent->duplicate - */ - else if (curBone->parent->flag & BONE_SELECTED){ - eBone->parent=(EditBone*) curBone->parent->temp; - } - /* If this bone has a parent that IS not selected, - Set the duplicate->parent to the curBone->parent - */ - else { - eBone->parent=(EditBone*) curBone->parent; - eBone->flag &= ~BONE_CONNECTED; - } - - /* Lets try to fix any constraint subtargets that might - have been duplicated */ - update_dup_subtarget(eBone); - } - } - } - - /* Deselect the old bones and select the new ones */ - - for (curBone=G.edbo.first; curBone && curBone!=firstDup; curBone=curBone->next){ - if(arm->layer & curBone->layer) - curBone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL | BONE_ACTIVE); - } - - BIF_TransformSetUndo("Add Duplicate"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); -} - - - -/* *************** END Adding stuff in editmode *************** */ -/* ************** Add/Remove stuff in editmode **************** */ - -/* temporary data-structure for merge/fill bones */ -typedef struct EditBonePoint { - struct EditBonePoint *next, *prev; - - EditBone *head_owner; /* EditBone which uses this point as a 'head' point */ - EditBone *tail_owner; /* EditBone which uses this point as a 'tail' point */ - - float vec[3]; /* the actual location of the point in local/EditMode space */ -} EditBonePoint; - -/* find chain-tips (i.e. bones without children) */ -static void chains_find_tips (ListBase *list) -{ - EditBone *curBone, *ebo; - LinkData *ld; - - /* note: this is potentially very slow ... there's got to be a better way */ - for (curBone= G.edbo.first; curBone; curBone= curBone->next) { - short stop= 0; - - /* is this bone contained within any existing chain? (skip if so) */ - for (ld= list->first; ld; ld= ld->next) { - for (ebo= ld->data; ebo; ebo= ebo->parent) { - if (ebo == curBone) { - stop= 1; - break; - } - } - - if (stop) break; - } - /* skip current bone if it is part of an existing chain */ - if (stop) continue; - - /* is any existing chain part of the chain formed by this bone? */ - stop= 0; - for (ebo= curBone->parent; ebo; ebo= ebo->parent) { - for (ld= list->first; ld; ld= ld->next) { - if (ld->data == ebo) { - ld->data= curBone; - stop= 1; - break; - } - } - - if (stop) break; - } - /* current bone has already been added to a chain? */ - if (stop) continue; - - /* add current bone to a new chain */ - ld= MEM_callocN(sizeof(LinkData), "BoneChain"); - ld->data= curBone; - BLI_addtail(list, ld); - } -} - - -static void fill_add_joint (EditBone *ebo, short eb_tail, ListBase *points) -{ - EditBonePoint *ebp; - float vec[3]; - short found= 0; - - if (eb_tail) { - VECCOPY(vec, ebo->tail); - } - else { - VECCOPY(vec, ebo->head); - } - - // FIXME: this algorithm sucks... it misses things it shouldn't - for (ebp= points->first; ebp; ebp= ebp->next) { - if (VecEqual(ebp->vec, vec)) { - if (eb_tail) { - if ((ebp->head_owner) && (ebp->head_owner->parent == ebo)) { - /* so this bone's tail owner is this bone*/ - ebp->tail_owner= ebo; - found= 1; - break; - } - } - else { - if ((ebp->tail_owner) && (ebo->parent == ebp->tail_owner)) { - /* so this bone's head owner is this bone */ - ebp->head_owner= ebo; - found = 1; - break; - } - } - } - } - - /* allocate a new point if no existing point was related */ - if (found == 0) { - ebp= MEM_callocN(sizeof(EditBonePoint), "EditBonePoint"); - - if (eb_tail) { - VECCOPY(ebp->vec, ebo->tail); - ebp->tail_owner= ebo; - } - else { - VECCOPY(ebp->vec, ebo->head); - ebp->head_owner= ebo; - } - - BLI_addtail(points, ebp); - } -} - -/* bone adding between selected joints */ -void fill_bones_armature(void) -{ - bArmature *arm= G.obedit->data; - EditBone *ebo, *newbone=NULL; - ListBase points = {NULL, NULL}; - int count; - - /* loop over all bones, and only consider if visible */ - for (ebo= G.edbo.first; ebo; ebo= ebo->next) { - if ((arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A)) { - if (!(ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL)) - fill_add_joint(ebo, 0, &points); - if (ebo->flag & BONE_TIPSEL) - fill_add_joint(ebo, 1, &points); - } - } - - /* the number of joints determines how we fill: - * 1) between joint and cursor (joint=head, cursor=tail) - * 2) between the two joints (order is dependent on active-bone/hierachy) - * 3+) error (a smarter method involving finding chains needs to be worked out - */ - count= BLI_countlist(&points); - - if (count == 0) { - error("No joints selected"); - return; - } - else if (count == 1) { - EditBonePoint *ebp; - float curs[3]; - - /* Get Points - selected joint */ - ebp= (EditBonePoint *)points.first; - - /* Get points - cursor (tail) */ - VECCOPY (curs, give_cursor()); - - Mat4Invert(G.obedit->imat, G.obedit->obmat); - Mat4MulVecfl(G.obedit->imat, curs); - - /* Create a bone */ - newbone= add_points_bone(ebp->vec, curs); - } - else if (count == 2) { - EditBonePoint *ebp, *ebp2; - float head[3], tail[3]; - - /* check that the points don't belong to the same bone */ - ebp= (EditBonePoint *)points.first; - ebp2= ebp->next; - - if ((ebp->head_owner==ebp2->tail_owner) && (ebp->head_owner!=NULL)) { - error("Same bone selected..."); - BLI_freelistN(&points); - return; - } - if ((ebp->tail_owner==ebp2->head_owner) && (ebp->tail_owner!=NULL)) { - error("Same bone selected..."); - BLI_freelistN(&points); - return; - } - - /* find which one should be the 'head' */ - if ((ebp->head_owner && ebp2->head_owner) || (ebp->tail_owner && ebp2->tail_owner)) { - /* rule: whichever one is closer to 3d-cursor */ - float curs[3]; - float vecA[3], vecB[3]; - float distA, distB; - - /* get cursor location */ - VECCOPY (curs, give_cursor()); - - Mat4Invert(G.obedit->imat, G.obedit->obmat); - Mat4MulVecfl(G.obedit->imat, curs); - - /* get distances */ - VecSubf(vecA, ebp->vec, curs); - VecSubf(vecB, ebp2->vec, curs); - distA= VecLength(vecA); - distB= VecLength(vecB); - - /* compare distances - closer one therefore acts as direction for bone to go */ - if (distA < distB) { - VECCOPY(head, ebp2->vec); - VECCOPY(tail, ebp->vec); - } - else { - VECCOPY(head, ebp->vec); - VECCOPY(tail, ebp2->vec); - } - } - else if (ebp->head_owner) { - VECCOPY(head, ebp->vec); - VECCOPY(tail, ebp2->vec); - } - else if (ebp2->head_owner) { - VECCOPY(head, ebp2->vec); - VECCOPY(tail, ebp->vec); - } - - /* add new bone */ - newbone= add_points_bone(head, tail); - } - else { - // FIXME.. figure out a method for multiple bones - error("Too many points selected"); - printf("Points selected: %d \n", count); - BLI_freelistN(&points); - return; - } - - /* free points */ - BLI_freelistN(&points); - - /* undo + updates */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Fill Bones"); -} - -/* this function merges between two bones, removes them and those in-between, - * and adjusts the parent relationships for those in-between - */ -static void bones_merge(EditBone *start, EditBone *end, ListBase *chains) -{ - EditBone *ebo, *ebone, *newbone; - LinkData *chain; - float head[3], tail[3]; - - /* check if same bone */ - if (start == end) { - printf("Error: same bone! \n"); - printf("\tstart = %s, end = %s \n", start->name, end->name); - } - - /* step 1: add a new bone - * - head = head/tail of start (default head) - * - tail = head/tail of end (default tail) - * - parent = parent of start - */ - if ((start->flag & BONE_TIPSEL) && !(start->flag & (BONE_SELECTED|BONE_ACTIVE))) { - VECCOPY(head, start->tail); - } - else { - VECCOPY(head, start->head); - } - if ((end->flag & BONE_ROOTSEL) && !(end->flag & (BONE_SELECTED|BONE_ACTIVE))) { - VECCOPY(tail, end->head); - } - else { - VECCOPY(tail, end->tail); - } - newbone= add_points_bone(head, tail); - newbone->parent = start->parent; - - /* step 2: parent children of in-between bones to newbone */ - for (chain= chains->first; chain; chain= chain->next) { - /* ick: we need to check if parent of each bone in chain is */ - for (ebo= chain->data; ebo; ebo= ebo->parent) { - short found= 0; - - /* try to find which bone from the list to be removed, is the parent */ - for (ebone= end; ebone; ebone= ebone->parent) { - if (ebo->parent == ebone) { - found= 1; - break; - } - } - - /* adjust this bone's parent to newbone then */ - if (found) { - ebo->parent= newbone; - break; - } - } - } - - /* step 3: delete all bones between and including start and end */ - for (ebo= end; ebo; ebo= ebone) { - ebone= (ebo == start) ? (NULL) : (ebo->parent); - BLI_freelinkN(&G.edbo, ebo); - } -} - -/* bone merging - has a menu! */ -void merge_armature(void) -{ - bArmature *arm= G.obedit->data; - short val= 0; - - /* process a menu to determine how to merge */ - // TODO: there's room for more modes of merging stuff... - val= pupmenu("Merge Selected Bones%t|Within Chains%x1"); - if (val <= 0) return; - - if (val == 1) { - /* go down chains, merging bones */ - ListBase chains = {NULL, NULL}; - LinkData *chain, *nchain; - EditBone *ebo; - - /* get chains (ends on chains) */ - chains_find_tips(&chains); - if (chains.first == NULL) return; - - /* each 'chain' is the last bone in the chain (with no children) */ - for (chain= chains.first; chain; chain= nchain) { - EditBone *bstart= NULL, *bend= NULL; - - /* temporarily remove chain from list of chains */ - nchain= chain->next; - BLI_remlink(&chains, chain); - - /* only consider bones that are visible and selected */ - for (ebo= chain->data; ebo; ebo= ebo->parent) { - /* check if visible + selected */ - if ( (arm->layer & ebo->layer) && !(ebo->flag & BONE_HIDDEN_A) && - ((ebo->flag & BONE_CONNECTED) || (ebo->parent==NULL)) && - (ebo->flag & (BONE_SELECTED|BONE_ACTIVE)) ) - { - /* set either end or start (end gets priority, unless it is already set) */ - if (bend == NULL) - bend= ebo; - else - bstart= ebo; - } - else { - /* chain is broken... merge any continous segments then clear */ - if (bstart && bend) - bones_merge(bstart, bend, &chains); - - bstart = NULL; - bend = NULL; - } - } - - /* merge from bstart to bend if something not merged */ - if (bstart && bend) - bones_merge(bstart, bend, &chains); - - /* put back link */ - BLI_insertlinkbefore(&chains, nchain, chain); - } - - BLI_freelistN(&chains); - } - - /* undo + updates */ - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Merge Bones"); -} - -/* ************** END Add/Remove stuff in editmode ************ */ -/* *************** Tools in editmode *********** */ - - -void hide_selected_armature_bones(void) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - if(arm->layer & ebone->layer) { - if(ebone->flag & (BONE_SELECTED)) { - ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE); - ebone->flag |= BONE_HIDDEN_A; - } - } - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Hide Bones"); -} - -void hide_unselected_armature_bones(void) -{ - EditBone *ebone; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - bArmature *arm= G.obedit->data; - if(arm->layer & ebone->layer) { - if(ebone->flag & (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL)); - else { - ebone->flag &= ~BONE_ACTIVE; - ebone->flag |= BONE_HIDDEN_A; - } - } - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Hide Unselected Bones"); -} - -void show_all_armature_bones(void) -{ - EditBone *ebone; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - bArmature *arm= G.obedit->data; - if(arm->layer & ebone->layer) { - if(ebone->flag & BONE_HIDDEN_A) { - ebone->flag |= (BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL); - ebone->flag &= ~BONE_HIDDEN_A; - } - } - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Reveal Bones"); -} - -/* check for null, before calling! */ -static void bone_connect_to_existing_parent(EditBone *bone) -{ - bone->flag |= BONE_CONNECTED; - VECCOPY(bone->head, bone->parent->tail); - bone->rad_head = bone->parent->rad_tail; -} - -static void bone_connect_to_new_parent(EditBone *selbone, EditBone *actbone, short mode) -{ - EditBone *ebone; - float offset[3]; - - if ((selbone->parent) && (selbone->flag & BONE_CONNECTED)) - selbone->parent->flag &= ~(BONE_TIPSEL); - - /* make actbone the parent of selbone */ - selbone->parent= actbone; - - /* in actbone tree we cannot have a loop */ - for (ebone= actbone->parent; ebone; ebone= ebone->parent) { - if (ebone->parent==selbone) { - ebone->parent= NULL; - ebone->flag &= ~BONE_CONNECTED; - } - } - - if (mode == 1) { - /* Connected: Child bones will be moved to the parent tip */ - selbone->flag |= BONE_CONNECTED; - VecSubf(offset, actbone->tail, selbone->head); - - VECCOPY(selbone->head, actbone->tail); - selbone->rad_head= actbone->rad_tail; - - VecAddf(selbone->tail, selbone->tail, offset); - - /* offset for all its children */ - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - EditBone *par; - - for (par= ebone->parent; par; par= par->parent) { - if (par==selbone) { - VecAddf(ebone->head, ebone->head, offset); - VecAddf(ebone->tail, ebone->tail, offset); - break; - } - } - } - } - else { - /* Offset: Child bones will retain their distance from the parent tip */ - selbone->flag &= ~BONE_CONNECTED; - } -} - -void make_bone_parent(void) -{ - bArmature *arm= G.obedit->data; - EditBone *actbone, *ebone, *selbone; - EditBone *flipbone, *flippar; - short allchildbones= 0, foundselbone= 0; - short val; - - /* find active bone to parent to */ - for (actbone = G.edbo.first; actbone; actbone=actbone->next) { - if (arm->layer & actbone->layer) { - if (actbone->flag & BONE_ACTIVE) - break; - } - } - if (actbone == NULL) { - error("Needs an active bone"); - return; - } - - /* find selected bones */ - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) { - if ((ebone->flag & BONE_SELECTED) && (ebone != actbone)) { - foundselbone++; - if (ebone->parent != actbone) allchildbones= 1; - } - } - } - /* abort if no selected bones, and active bone doesn't have a parent to work with instead */ - if (foundselbone==0 && actbone->parent==NULL) { - error("Need selected bone(s)"); - return; - } - - /* 'Keep Offset' option is only displayed if it's likely to be useful */ - if (allchildbones) - val= pupmenu("Make Parent%t|Connected%x1|Keep Offset%x2"); - else - val= pupmenu("Make Parent%t|Connected%x1"); - - if (val < 1) return; - - if (foundselbone==0 && actbone->parent) { - /* When only the active bone is selected, and it has a parent, - * connect it to the parent, as that is the only possible outcome. - */ - bone_connect_to_existing_parent(actbone); - - if (arm->flag & ARM_MIRROR_EDIT) { - flipbone = armature_bone_get_mirrored(actbone); - if (flipbone) - bone_connect_to_existing_parent(flipbone); - } - } - else { - /* loop through all editbones, parenting all selected bones to the active bone */ - for (selbone = G.edbo.first; selbone; selbone=selbone->next) { - if (arm->layer & selbone->layer) { - if ((selbone->flag & BONE_SELECTED) && (selbone!=actbone)) { - /* parent selbone to actbone */ - bone_connect_to_new_parent(selbone, actbone, val); - - if (arm->flag & ARM_MIRROR_EDIT) { - /* - if there's a mirrored copy of selbone, try to find a mirrored copy of actbone - * (i.e. selbone="child.L" and actbone="parent.L", find "child.R" and "parent.R"). - * This is useful for arm-chains, for example parenting lower arm to upper arm - * - if there's no mirrored copy of actbone (i.e. actbone = "parent.C" or "parent") - * then just use actbone. Useful when doing upper arm to spine. - */ - flipbone = armature_bone_get_mirrored(selbone); - flippar = armature_bone_get_mirrored(actbone); - - if (flipbone) { - if (flippar) - bone_connect_to_new_parent(flipbone, flippar, val); - else - bone_connect_to_new_parent(flipbone, actbone, val); - } - } - } - } - } - } - - countall(); /* checks selection */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Make Parent"); - - return; -} - -static void editbone_clear_parent(EditBone *ebone, int mode) -{ - if (ebone->parent) { - /* for nice selection */ - ebone->parent->flag &= ~(BONE_TIPSEL); - } - - if(mode==1) ebone->parent= NULL; - ebone->flag &= ~BONE_CONNECTED; -} - -void clear_bone_parent(void) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - EditBone *flipbone = NULL; - short val; - - val= pupmenu("Clear Parent%t|Clear Parent%x1|Disconnect Bone%x2"); - - if(val<1) return; - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if(arm->layer & ebone->layer) { - if(ebone->flag & BONE_SELECTED) { - - if(arm->flag & ARM_MIRROR_EDIT) - flipbone = armature_bone_get_mirrored(ebone); - - if (flipbone) - editbone_clear_parent(flipbone, val); - editbone_clear_parent(ebone, val); - } - } - } - countall(); // checks selection - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Clear Parent"); -} - - -static EditBone *editbone_name_exists (ListBase *ebones, char *name) -{ - EditBone *eBone; - - if (ebones == NULL) ebones = &G.edbo; - - for (eBone=ebones->first; eBone; eBone=eBone->next){ - if (!strcmp (name, eBone->name)) - return eBone; - } - return NULL; -} - -/* note: there's a unique_bone_name() too! */ -void unique_editbone_name (ListBase *ebones, char *name) -{ - char tempname[64]; - int number; - char *dot; - - - if (editbone_name_exists(ebones, name)) { - - /* Strip off the suffix, if it's a number */ - number= strlen(name); - if(number && isdigit(name[number-1])) { - dot= strrchr(name, '.'); // last occurrance - if (dot) - *dot=0; - } - - for (number = 1; number <=999; number++){ - sprintf (tempname, "%s.%03d", name, number); - if (!editbone_name_exists(ebones, tempname)){ - BLI_strncpy (name, tempname, 32); - return; - } - } - } -} - -/* context; editmode armature */ -/* if forked && mirror-edit: makes two bones with flipped names */ -void extrude_armature(int forked) -{ - bArmature *arm= G.obedit->data; - EditBone *newbone, *ebone, *flipbone, *first=NULL; - int a, totbone= 0, do_extrude; - - TEST_EDITARMATURE; - - /* since we allow root extrude too, we have to make sure selection is OK */ - for (ebone = G.edbo.first; ebone; ebone=ebone->next){ - if(arm->layer & ebone->layer) { - if(ebone->flag & BONE_ROOTSEL) { - if(ebone->parent && (ebone->flag & BONE_CONNECTED)) { - if(ebone->parent->flag & BONE_TIPSEL) - ebone->flag &= ~BONE_ROOTSEL; - } - } - } - } - - /* Duplicate the necessary bones */ - for (ebone = G.edbo.first; ((ebone) && (ebone!=first)); ebone=ebone->next){ - if(arm->layer & ebone->layer) { - - /* we extrude per definition the tip */ - do_extrude= 0; - if (ebone->flag & (BONE_TIPSEL|BONE_SELECTED)) - do_extrude= 1; - else if(ebone->flag & BONE_ROOTSEL) { - /* but, a bone with parent deselected we do the root... */ - if(ebone->parent && (ebone->parent->flag & BONE_TIPSEL)); - else do_extrude= 2; - } - - if (do_extrude) { - - /* we re-use code for mirror editing... */ - flipbone= NULL; - if(arm->flag & ARM_MIRROR_EDIT) { - flipbone= armature_bone_get_mirrored(ebone); - if (flipbone) { - forked= 0; // we extrude 2 different bones - if(flipbone->flag & (BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED)) - /* don't want this bone to be selected... */ - flipbone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE); - } - if(flipbone==NULL && forked) - flipbone= ebone; - } - - for(a=0; a<2; a++) { - if(a==1) { - if(flipbone==NULL) - break; - else { - SWAP(EditBone *, flipbone, ebone); - } - } - - totbone++; - newbone = MEM_callocN(sizeof(EditBone), "extrudebone"); - - if(do_extrude==1) { - VECCOPY (newbone->head, ebone->tail); - VECCOPY (newbone->tail, newbone->head); - newbone->parent = ebone; - - newbone->flag = ebone->flag & BONE_TIPSEL; // copies it, in case mirrored bone - } - else { - VECCOPY(newbone->head, ebone->head); - VECCOPY(newbone->tail, ebone->head); - newbone->parent= ebone->parent; - - newbone->flag= BONE_TIPSEL; - } - - newbone->weight= ebone->weight; - newbone->dist= ebone->dist; - newbone->xwidth= ebone->xwidth; - newbone->zwidth= ebone->zwidth; - newbone->ease1= ebone->ease1; - newbone->ease2= ebone->ease2; - newbone->rad_head= ebone->rad_tail; // dont copy entire bone... - newbone->rad_tail= ebone->rad_tail; - newbone->segments= 1; - newbone->layer= ebone->layer; - - if(newbone->parent) newbone->flag |= BONE_CONNECTED; - - BLI_strncpy (newbone->name, ebone->name, 32); - - if(flipbone && forked) { // only set if mirror edit - if(strlen(newbone->name)<30) { - if(a==0) strcat(newbone->name, "_L"); - else strcat(newbone->name, "_R"); - } - } - unique_editbone_name(&G.edbo, newbone->name); - - /* Add the new bone to the list */ - BLI_addtail(&G.edbo, newbone); - if (!first) - first = newbone; - - /* restore ebone if we were flipping */ - if(a==1 && flipbone) - SWAP(EditBone *, flipbone, ebone); - - } - } - - /* Deselect the old bone */ - ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL|BONE_ACTIVE); - } - } - /* if only one bone, make this one active */ - if(totbone==1 && first) first->flag |= BONE_ACTIVE; - - /* Transform the endpoints */ - countall(); // flushes selection! - BIF_TransformSetUndo("Extrude"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); -} - -/* context; editmode armature */ -void subdivide_armature(int numcuts) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone, *newbone, *tbone, *mbone; - int a, i; - - if(numcuts < 1) return; - - for (mbone = G.edbo.last; mbone; mbone= mbone->prev) { - if(arm->layer & mbone->layer) { - if(mbone->flag & BONE_SELECTED) { - for(i=numcuts+1; i>1; i--) { - /* compute cut ratio first */ - float cutratio= 1/(float)i; - float cutratioI= 1-cutratio; - - /* take care of mirrored stuff */ - for(a=0; a<2; a++) { - float val1[3]; - float val2[3]; - float val3[3]; - - /* try to find mirrored bone on a != 0 */ - if(a) { - if(arm->flag & ARM_MIRROR_EDIT) - ebone= armature_bone_get_mirrored(mbone); - else ebone= NULL; - } - else - ebone= mbone; - - if(ebone) { - newbone= MEM_mallocN(sizeof(EditBone), "ebone subdiv"); - *newbone = *ebone; - BLI_addtail(&G.edbo, newbone); - - /* calculate location of newbone->head */ - VECCOPY(val1, ebone->head); - VECCOPY(val2, ebone->tail); - VECCOPY(val3, newbone->head); - - val3[0]= val1[0]*cutratio+val2[0]*cutratioI; - val3[1]= val1[1]*cutratio+val2[1]*cutratioI; - val3[2]= val1[2]*cutratio+val2[2]*cutratioI; - - VECCOPY(newbone->head, val3); - VECCOPY(newbone->tail, ebone->tail); - VECCOPY(ebone->tail, newbone->head); - - newbone->rad_head= 0.5*(ebone->rad_head+ebone->rad_tail); - ebone->rad_tail= newbone->rad_head; - - newbone->flag |= BONE_CONNECTED; - - unique_editbone_name (&G.edbo, newbone->name); - - /* correct parent bones */ - for (tbone = G.edbo.first; tbone; tbone=tbone->next){ - if(tbone->parent==ebone) - tbone->parent= newbone; - } - newbone->parent= ebone; - } - } - } - } - } - } - - if(numcuts==1) BIF_undo_push("Subdivide"); - else BIF_undo_push("Subdivide multi"); -} - -/* ***************** Pose tools ********************* */ - -void clear_armature(Object *ob, char mode) -{ - bPoseChannel *pchan; - bArmature *arm; - - arm=get_armature(ob); - - if (!arm) - return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) { - if(arm->layer & pchan->bone->layer) { - switch (mode) { - case 'r': - pchan->quat[1]=pchan->quat[2]=pchan->quat[3]=0.0F; pchan->quat[0]=1.0F; - break; - case 'g': - pchan->loc[0]=pchan->loc[1]=pchan->loc[2]=0.0F; - break; - case 's': - pchan->size[0]=pchan->size[1]=pchan->size[2]=1.0F; - break; - - } - - /* the current values from IPO's may not be zero, so tag as unkeyed */ - pchan->bone->flag |= BONE_UNKEYED; - } - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - /* no update for this object, this will execute the action again */ - /* is weak... like for ipo editing which uses ctime now... */ - where_is_pose (ob); - ob->recalc= 0; -} - -/* helper for function below */ -static int clear_active_flag(Object *ob, Bone *bone, void *data) -{ - bone->flag &= ~BONE_ACTIVE; - return 0; -} - - -/* called from editview.c, for mode-less pose selection */ -int do_pose_selectbuffer(Base *base, unsigned int *buffer, short hits) -{ - Object *ob= base->object; - Bone *nearBone; - - if (!ob || !ob->pose) return 0; - - nearBone= get_bone_from_selectbuffer(base, buffer, hits, 1); - - if (nearBone) { - bArmature *arm= ob->data; - - /* since we do unified select, we don't shift+select a bone if the armature object was not active yet */ - if (!(G.qual & LR_SHIFTKEY) || base!=BASACT){ - deselectall_posearmature(ob, 0, 0); - nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); - select_actionchannel_by_name(ob->action, nearBone->name, 1); - } - else { - if (nearBone->flag & BONE_SELECTED) { - /* if not active, we make it active */ - if((nearBone->flag & BONE_ACTIVE)==0) { - bone_looper(ob, arm->bonebase.first, NULL, clear_active_flag); - nearBone->flag |= BONE_ACTIVE; - } - else { - nearBone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); - select_actionchannel_by_name(ob->action, nearBone->name, 0); - } - } - else{ - bone_looper(ob, arm->bonebase.first, NULL, clear_active_flag); - - nearBone->flag |= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); - select_actionchannel_by_name(ob->action, nearBone->name, 1); - } - } - - /* in weightpaint we select the associated vertex group too */ - if(G.f & G_WEIGHTPAINT) { - if(nearBone->flag & BONE_ACTIVE) { - vertexgroup_select_by_name(OBACT, nearBone->name); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); /* To force action/constraint ipo update */ - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - - return nearBone!=NULL; - -} - -/* test==0: deselect all - test==1: swap select - test==2: only clear active tag -*/ -void deselectall_posearmature (Object *ob, int test, int doundo) -{ - bArmature *arm; - bPoseChannel *pchan; - int selectmode= 0; - - /* we call this from outliner too, but with OBACT set OK */ - if(!ob || !ob->pose) return; - arm= get_armature(ob); - - /* Determine if we're selecting or deselecting */ - if (test==1) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - if(pchan->bone->layer & arm->layer && !(pchan->bone->flag & BONE_HIDDEN_P)) - if(pchan->bone->flag & BONE_SELECTED) - break; - - if (pchan==NULL) - selectmode= 1; - } - else if(test==2) - selectmode= 2; - - /* Set the flags accordingly */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->layer & arm->layer && !(pchan->bone->flag & BONE_HIDDEN_P)) { - if(selectmode==0) pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); - else if(selectmode==1) pchan->bone->flag |= BONE_SELECTED; - else pchan->bone->flag &= ~BONE_ACTIVE; - } - } - - /* action editor */ - deselect_actionchannels(ob->action, 0); /* deselects for sure */ - if(selectmode==1) - deselect_actionchannels(ob->action, 1); /* swaps */ - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWACTION, 0); - - countall(); - - if (doundo) { - if (selectmode==1) BIF_undo_push("Select All"); - else BIF_undo_push("Deselect All"); - } -} - - -int bone_looper(Object *ob, Bone *bone, void *data, - int (*bone_func)(Object *, Bone *, void *)) -{ - - /* We want to apply the function bone_func to every bone - * in an armature -- feed bone_looper the first bone and - * a pointer to the bone_func and watch it go!. The int count - * can be useful for counting bones with a certain property - * (e.g. skinnable) - */ - int count = 0; - - if (bone) { - - /* only do bone_func if the bone is non null - */ - count += bone_func(ob, bone, data); - - /* try to execute bone_func for the first child - */ - count += bone_looper(ob, bone->childbase.first, data, - bone_func); - - /* try to execute bone_func for the next bone at this - * depth of the recursion. - */ - count += bone_looper(ob, bone->next, data, bone_func); - } - - return count; -} - - -static int bone_skinnable(Object *ob, Bone *bone, void *datap) -{ - /* Bones that are deforming - * are regarded to be "skinnable" and are eligible for - * auto-skinning. - * - * This function performs 2 functions: - * - * a) It returns 1 if the bone is skinnable. - * If we loop over all bones with this - * function, we can count the number of - * skinnable bones. - * b) If the pointer data is non null, - * it is treated like a handle to a - * bone pointer -- the bone pointer - * is set to point at this bone, and - * the pointer the handle points to - * is incremented to point to the - * next member of an array of pointers - * to bones. This way we can loop using - * this function to construct an array of - * pointers to bones that point to all - * skinnable bones. - */ - Bone ***hbone; - int a, segments; - struct { Object *armob; void *list; int heat; } *data = datap; - - if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) { - if (!(bone->flag & BONE_NO_DEFORM)) { - if(data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name)) - segments = bone->segments; - else - segments = 1; - - if (data->list != NULL) { - hbone = (Bone ***) &data->list; - - for(a=0; aflag & BONE_NO_DEFORM)) { - if (!get_named_vertexgroup(ob,bone->name)) { - add_defgroup_name(ob, bone->name); - return 1; - } - } - return 0; -} - -static int dgroup_skinnable(Object *ob, Bone *bone, void *datap) -{ - /* Bones that are deforming - * are regarded to be "skinnable" and are eligible for - * auto-skinning. - * - * This function performs 2 functions: - * - * a) If the bone is skinnable, it creates - * a vertex group for ob that has - * the name of the skinnable bone - * (if one doesn't exist already). - * b) If the pointer data is non null, - * it is treated like a handle to a - * bDeformGroup pointer -- the - * bDeformGroup pointer is set to point - * to the deform group with the bone's - * name, and the pointer the handle - * points to is incremented to point to the - * next member of an array of pointers - * to bDeformGroups. This way we can loop using - * this function to construct an array of - * pointers to bDeformGroups, all with names - * of skinnable bones. - */ - bDeformGroup ***hgroup, *defgroup; - int a, segments; - struct { Object *armob; void *list; int heat; } *data= datap; - - if(!(G.f & G_WEIGHTPAINT) || !(bone->flag & BONE_HIDDEN_P)) { - if (!(bone->flag & BONE_NO_DEFORM)) { - if(data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name)) - segments = bone->segments; - else - segments = 1; - - if(!(defgroup = get_named_vertexgroup(ob, bone->name))) - defgroup = add_defgroup_name(ob, bone->name); - - if (data->list != NULL) { - hgroup = (bDeformGroup ***) &data->list; - - for(a=0; atotvert; i++) { - iflip = (dgroupflip)? mesh_get_x_mirror_vert(ob, i): 0; - - /* for each skinnable bone */ - for (j=0; j < numbones; ++j) { - if(!selected[j]) - continue; - - bone = bonelist[j]; - dgroup = dgrouplist[j]; - - /* store the distance-factor from the vertex to the bone */ - distance = distfactor_to_bone (verts[i], root[j], tip[j], - bone->rad_head * scale, bone->rad_tail * scale, bone->dist * scale); - - /* add the vert to the deform group if weight!=0.0 */ - if (distance!=0.0) - add_vert_to_defgroup (ob, dgroup, i, distance, WEIGHT_REPLACE); - else - remove_vert_defgroup (ob, dgroup, i); - - /* do same for mirror */ - if (dgroupflip && dgroupflip[j] && iflip >= 0) { - if (distance!=0.0) - add_vert_to_defgroup (ob, dgroupflip[j], iflip, distance, - WEIGHT_REPLACE); - else - remove_vert_defgroup (ob, dgroupflip[j], iflip); - } - } - } -} - -void add_verts_to_dgroups(Object *ob, Object *par, int heat, int mirror) -{ - /* This functions implements the automatic computation of vertex group - * weights, either through envelopes or using a heat equilibrium. - * - * This function can be called both when parenting a mesh to an armature, - * or in weightpaint + posemode. In the latter case selection is taken - * into account and vertex weights can be mirrored. - * - * The mesh vertex positions used are either the final deformed coords - * from the derivedmesh in weightpaint mode, the final subsurf coords - * when parenting, or simply the original mesh coords. - */ - - bArmature *arm; - Bone **bonelist, *bone; - bDeformGroup **dgrouplist, **dgroupflip; - bDeformGroup *dgroup, *curdg; - bPoseChannel *pchan; - Mesh *mesh; - Mat4 *bbone = NULL; - float (*root)[3], (*tip)[3], (*verts)[3]; - int *selected; - int numbones, vertsfilled = 0, i, j, segments = 0; - int wpmode = (G.f & G_WEIGHTPAINT); - struct { Object *armob; void *list; int heat; } looper_data; - - /* If the parent object is not an armature exit */ - arm = get_armature(par); - if (!arm) - return; - - looper_data.armob = par; - looper_data.heat= heat; - looper_data.list= NULL; - - /* count the number of skinnable bones */ - numbones = bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable); - - if (numbones == 0) - return; - - /* create an array of pointer to bones that are skinnable - * and fill it with all of the skinnable bones */ - bonelist = MEM_callocN(numbones*sizeof(Bone *), "bonelist"); - looper_data.list= bonelist; - bone_looper(ob, arm->bonebase.first, &looper_data, bone_skinnable); - - /* create an array of pointers to the deform groups that - * coorespond to the skinnable bones (creating them - * as necessary. */ - dgrouplist = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgrouplist"); - dgroupflip = MEM_callocN(numbones*sizeof(bDeformGroup *), "dgroupflip"); - - looper_data.list= dgrouplist; - bone_looper(ob, arm->bonebase.first, &looper_data, dgroup_skinnable); - - /* create an array of root and tip positions transformed into - * global coords */ - root = MEM_callocN(numbones*sizeof(float)*3, "root"); - tip = MEM_callocN(numbones*sizeof(float)*3, "tip"); - selected = MEM_callocN(numbones*sizeof(int), "selected"); - - for (j=0; j < numbones; ++j) { - bone = bonelist[j]; - dgroup = dgrouplist[j]; - - /* handle bbone */ - if(heat) { - if(segments == 0) { - segments = 1; - bbone = NULL; - - if(par->pose && (pchan=get_pose_channel(par->pose, bone->name))) { - if(bone->segments > 1) { - segments = bone->segments; - bbone = b_bone_spline_setup(pchan, 1); - } - } - } - - segments--; - } - - /* compute root and tip */ - if(bbone) { - VECCOPY(root[j], bbone[segments].mat[3]); - Mat4MulVecfl(bone->arm_mat, root[j]); - if(segments+1 < bone->segments) { - VECCOPY(tip[j], bbone[segments+1].mat[3]) - Mat4MulVecfl(bone->arm_mat, tip[j]); - } - else - VECCOPY(tip[j], bone->arm_tail) - } - else { - VECCOPY(root[j], bone->arm_head); - VECCOPY(tip[j], bone->arm_tail); - } - - Mat4MulVecfl(par->obmat, root[j]); - Mat4MulVecfl(par->obmat, tip[j]); - - /* set selected */ - if(wpmode) { - if ((arm->layer & bone->layer) && (bone->flag & BONE_SELECTED)) - selected[j] = 1; - } - else - selected[j] = 1; - - /* find flipped group */ - if(mirror) { - char name[32]; - - BLI_strncpy(name, dgroup->name, 32); - // 0 = don't strip off number extensions - bone_flip_name(name, 0); - - for (curdg = ob->defbase.first; curdg; curdg=curdg->next) - if (!strcmp(curdg->name, name)) - break; - - dgroupflip[j] = curdg; - } - } - - /* create verts */ - mesh = (Mesh*)ob->data; - verts = MEM_callocN(mesh->totvert*sizeof(*verts), "closestboneverts"); - - if (wpmode) { - /* if in weight paint mode, use final verts from derivedmesh */ - DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); - - if(dm->foreachMappedVert) { - dm->foreachMappedVert(dm, add_vgroups__mapFunc, (void*)verts); - vertsfilled = 1; - } - - dm->release(dm); - } - else if (modifiers_findByType(ob, eModifierType_Subsurf)) { - /* is subsurf on? Lets use the verts on the limit surface then. - * = same amount of vertices as mesh, but vertices moved to the - * subsurfed position, like for 'optimal'. */ - subsurf_calculate_limit_positions(mesh, verts); - vertsfilled = 1; - } - - /* transform verts to global space */ - for (i=0; i < mesh->totvert; i++) { - if (!vertsfilled) - VECCOPY(verts[i], mesh->mvert[i].co) - Mat4MulVecfl(ob->obmat, verts[i]); - } - - /* compute the weights based on gathered vertices and bones */ - if (heat) - heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip, - root, tip, selected); - else - envelope_bone_weighting(ob, mesh, verts, numbones, bonelist, dgrouplist, - dgroupflip, root, tip, selected, Mat4ToScalef(par->obmat)); - - /* free the memory allocated */ - MEM_freeN(bonelist); - MEM_freeN(dgrouplist); - MEM_freeN(dgroupflip); - MEM_freeN(root); - MEM_freeN(tip); - MEM_freeN(selected); - MEM_freeN(verts); -} - -void create_vgroups_from_armature(Object *ob, Object *par) -{ - /* Lets try to create some vertex groups - * based on the bones of the parent armature. - */ - - bArmature *arm; - short mode; - - /* If the parent object is not an armature exit */ - arm = get_armature(par); - if (!arm) - return; - - /* Prompt the user on whether/how they want the vertex groups - * added to the child mesh */ - mode= pupmenu("Create Vertex Groups? %t|" - "Don't Create Groups %x1|" - "Name Groups %x2|" - "Create From Envelopes %x3|" - "Create From Bone Heat %x4|"); - switch (mode){ - case 2: - /* Traverse the bone list, trying to create empty vertex - * groups cooresponding to the bone. - */ - bone_looper(ob, arm->bonebase.first, NULL, - add_defgroup_unique_bone); - if (ob->type == OB_MESH) - create_dverts(ob->data); - - break; - - case 3: - case 4: - /* Traverse the bone list, trying to create vertex groups - * that are populated with the vertices for which the - * bone is closest. - */ - add_verts_to_dgroups(ob, par, (mode == 4), 0); - break; - - } -} - -static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr) -{ - bArmature *arm= ob->data; - - if(arm->layer & bone->layer) { - if (bone->flag & BONE_SELECTED) { - bone->flag |= BONE_HIDDEN_P; - bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE); - } - } - return 0; -} - -/* active object is armature */ -void hide_selected_pose_bones(void) -{ - bArmature *arm= OBACT->data; - - if (!arm) - return; - - bone_looper(OBACT, arm->bonebase.first, NULL, - hide_selected_pose_bone); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWACTION, 0); - BIF_undo_push("Hide Bones"); -} - -static int hide_unselected_pose_bone(Object *ob, Bone *bone, void *ptr) -{ - bArmature *arm= ob->data; - - if(arm->layer & bone->layer) { - if (~bone->flag & BONE_SELECTED) { - bone->flag |= BONE_HIDDEN_P; - bone->flag &= ~BONE_ACTIVE; - } - } - return 0; -} - -/* active object is armature */ -void hide_unselected_pose_bones(void) -{ - bArmature *arm; - - arm=get_armature (OBACT); - - if (!arm) - return; - - bone_looper(OBACT, arm->bonebase.first, NULL, - hide_unselected_pose_bone); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Hide Unselected Bone"); -} - -static int show_pose_bone(Object *ob, Bone *bone, void *ptr) -{ - bArmature *arm= ob->data; - - if(arm->layer & bone->layer) { - if (bone->flag & BONE_HIDDEN_P) { - bone->flag &= ~BONE_HIDDEN_P; - bone->flag |= BONE_SELECTED; - } - } - - return 0; -} - -/* active object is armature in posemode */ -void show_all_pose_bones(void) -{ - bArmature *arm; - - arm=get_armature (OBACT); - - if (!arm) - return; - - bone_looper(OBACT, arm->bonebase.first, NULL, - show_pose_bone); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Reveal Bones"); -} - - -/* ************* RENAMING DISASTERS ************ */ - -/* note: there's a unique_editbone_name() too! */ -void unique_bone_name (bArmature *arm, char *name) -{ - char tempname[64]; - int number; - char *dot; - - if (get_named_bone(arm, name)) { - - /* Strip off the suffix, if it's a number */ - number= strlen(name); - if(number && isdigit(name[number-1])) { - dot= strrchr(name, '.'); // last occurrance - if (dot) - *dot=0; - } - - for (number = 1; number <=999; number++){ - sprintf (tempname, "%s.%03d", name, number); - if (!get_named_bone(arm, tempname)){ - BLI_strncpy (name, tempname, 32); - return; - } - } - } -} - -#define MAXBONENAME 32 -/* helper call for below */ -static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldname, char *newname) -{ - bConstraint *curcon; - bConstraintTarget *ct; - - for (curcon = conlist->first; curcon; curcon=curcon->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(curcon); - ListBase targets = {NULL, NULL}; - - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(curcon, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if (ct->tar == ob) { - if (!strcmp(ct->subtarget, oldname) ) - BLI_strncpy(ct->subtarget, newname, MAXBONENAME); - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(curcon, &targets, 0); - } - } -} - -/* called by UI for renaming a bone */ -/* warning: make sure the original bone was not renamed yet! */ -/* seems messy, but thats what you get with not using pointers but channel names :) */ -void armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) -{ - Object *ob; - char newname[MAXBONENAME]; - char oldname[MAXBONENAME]; - - /* names better differ! */ - if(strncmp(oldnamep, newnamep, MAXBONENAME)) { - - /* we alter newname string... so make copy */ - BLI_strncpy(newname, newnamep, MAXBONENAME); - /* we use oldname for search... so make copy */ - BLI_strncpy(oldname, oldnamep, MAXBONENAME); - - /* now check if we're in editmode, we need to find the unique name */ - if(G.obedit && G.obedit->data==arm) { - EditBone *eBone; - - eBone= editbone_name_exists(&G.edbo, oldname); - if(eBone) { - unique_editbone_name (&G.edbo, newname); - BLI_strncpy(eBone->name, newname, MAXBONENAME); - } - else return; - } - else { - Bone *bone= get_named_bone (arm, oldname); - - if(bone) { - unique_bone_name (arm, newname); - BLI_strncpy(bone->name, newname, MAXBONENAME); - } - else return; - } - - /* do entire dbase */ - for(ob= G.main->object.first; ob; ob= ob->id.next) { - /* we have the object using the armature */ - if(arm==ob->data) { - Object *cob; - bAction *act; - bActionChannel *achan; - bActionStrip *strip; - - /* Rename action channel if necessary */ - act = ob->action; - if (act && !act->id.lib) { - /* Find the appropriate channel */ - achan= get_action_channel(act, oldname); - if(achan) BLI_strncpy(achan->name, newname, MAXBONENAME); - } - - /* Rename the pose channel, if it exists */ - if (ob->pose) { - bPoseChannel *pchan = get_pose_channel(ob->pose, oldname); - if (pchan) { - BLI_strncpy (pchan->name, newname, MAXBONENAME); - } - } - - /* check all nla-strips too */ - for (strip= ob->nlastrips.first; strip; strip= strip->next) { - /* Rename action channel if necessary */ - act = strip->act; - if (act && !act->id.lib) { - /* Find the appropriate channel */ - achan= get_action_channel(act, oldname); - if(achan) BLI_strncpy(achan->name, newname, MAXBONENAME); - } - } - - /* Update any object constraints to use the new bone name */ - for(cob= G.main->object.first; cob; cob= cob->id.next) { - if(cob->constraints.first) - constraint_bone_name_fix(ob, &cob->constraints, oldname, newname); - if (cob->pose) { - bPoseChannel *pchan; - for (pchan = cob->pose->chanbase.first; pchan; pchan=pchan->next) { - constraint_bone_name_fix(ob, &pchan->constraints, oldname, newname); - } - } - } - } - - /* See if an object is parented to this armature */ - if (ob->parent && (ob->parent->data == arm)) { - if(ob->partype==PARBONE) { - /* bone name in object */ - if (!strcmp(ob->parsubstr, oldname)) - BLI_strncpy(ob->parsubstr, newname, MAXBONENAME); - } - } - - if(modifiers_usesArmature(ob, arm)) { - bDeformGroup *dg; - /* bone name in defgroup */ - for (dg=ob->defbase.first; dg; dg=dg->next) { - if(!strcmp(dg->name, oldname)) - BLI_strncpy(dg->name, newname, MAXBONENAME); - } - } - } - } -} - -/* context editmode object */ -void armature_flip_names(void) -{ - bArmature *arm= G.obedit->data; - EditBone *ebone; - char newname[32]; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next) { - if(arm->layer & ebone->layer) { - if(ebone->flag & BONE_SELECTED) { - BLI_strncpy(newname, ebone->name, sizeof(newname)); - bone_flip_name(newname, 1); // 1 = do strip off number extensions - armature_bone_rename(G.obedit->data, ebone->name, newname); - } - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Flip names"); - -} - -/* context; editmode armature */ -EditBone *armature_bone_get_mirrored(EditBone *ebo) -{ - EditBone *eboflip= NULL; - char name[32]; - - BLI_strncpy(name, ebo->name, sizeof(name)); - bone_flip_name(name, 0); // 0 = don't strip off number extensions - - for (eboflip=G.edbo.first; eboflip; eboflip=eboflip->next) - if(ebo!=eboflip) - if (!strcmp (name, eboflip->name)) break; - - return eboflip; -} - -/* if editbone (partial) selected, copy data */ -/* context; editmode armature, with mirror editing enabled */ -void transform_armature_mirror_update(void) -{ - EditBone *ebo, *eboflip; - - for (ebo=G.edbo.first; ebo; ebo=ebo->next) { - /* no layer check, correct mirror is more important */ - if(ebo->flag & (BONE_TIPSEL|BONE_ROOTSEL)) { - - eboflip= armature_bone_get_mirrored(ebo); - - if(eboflip) { - /* we assume X-axis flipping for now */ - if(ebo->flag & BONE_TIPSEL) { - eboflip->tail[0]= -ebo->tail[0]; - eboflip->tail[1]= ebo->tail[1]; - eboflip->tail[2]= ebo->tail[2]; - eboflip->rad_tail= ebo->rad_tail; - } - if(ebo->flag & BONE_ROOTSEL) { - eboflip->head[0]= -ebo->head[0]; - eboflip->head[1]= ebo->head[1]; - eboflip->head[2]= ebo->head[2]; - eboflip->rad_head= ebo->rad_head; - } - if(ebo->flag & BONE_SELECTED) { - eboflip->dist= ebo->dist; - eboflip->roll= -ebo->roll; - eboflip->xwidth= ebo->xwidth; - eboflip->zwidth= ebo->zwidth; - } - } - } - } -} - - -/*****************************************************************************************************/ -/*************************************** SKELETON GENERATOR ******************************************/ -/*****************************************************************************************************/ - -/**************************************** SYMMETRY HANDLING ******************************************/ - -void markdownSymmetryArc(ReebArc *arc, ReebNode *node, int level); - -void mirrorAlongAxis(float v[3], float center[3], float axis[3]) -{ - float dv[3], pv[3]; - - VecSubf(dv, v, center); - Projf(pv, dv, axis); - VecMulf(pv, -2); - VecAddf(v, v, pv); -} - -/* Helper structure for radial symmetry */ -typedef struct RadialArc -{ - ReebArc *arc; - float n[3]; /* normalized vector joining the nodes of the arc */ -} RadialArc; - -void reestablishRadialSymmetry(ReebNode *node, int depth, float axis[3]) -{ - RadialArc *ring = NULL; - RadialArc *unit; - float limit = G.scene->toolsettings->skgen_symmetry_limit; - int symmetric = 1; - int count = 0; - int i; - - /* count the number of arcs in the symmetry ring */ - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - /* depth is store as a negative in flag. symmetry level is positive */ - if (connectedArc->flags == -depth) - { - count++; - } - } - - ring = MEM_callocN(sizeof(RadialArc) * count, "radial symmetry ring"); - unit = ring; - - /* fill in the ring */ - for (unit = ring, i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - /* depth is store as a negative in flag. symmetry level is positive */ - if (connectedArc->flags == -depth) - { - ReebNode *otherNode = OTHER_NODE(connectedArc, node); - float vec[3]; - - unit->arc = connectedArc; - - /* project the node to node vector on the symmetry plane */ - VecSubf(unit->n, otherNode->p, node->p); - Projf(vec, unit->n, axis); - VecSubf(unit->n, unit->n, vec); - - Normalize(unit->n); - - unit++; - } - } - - /* sort ring */ - for (i = 0; i < count - 1; i++) - { - float minAngle = 3; /* arbitrary high value, higher than 2, at least */ - int minIndex = -1; - int j; - - for (j = i + 1; j < count; j++) - { - float angle = Inpf(ring[i].n, ring[j].n); - - /* map negative values to 1..2 */ - if (angle < 0) - { - angle = 1 - angle; - } - - if (angle < minAngle) - { - minIndex = j; - minAngle = angle; - } - } - - /* swap if needed */ - if (minIndex != i + 1) - { - RadialArc tmp; - tmp = ring[i + 1]; - ring[i + 1] = ring[minIndex]; - ring[minIndex] = tmp; - } - } - - for (i = 0; i < count && symmetric; i++) - { - ReebNode *node1, *node2; - float tangent[3]; - float normal[3]; - float p[3]; - int j = (i + 1) % count; /* next arc in the circular list */ - - VecAddf(tangent, ring[i].n, ring[j].n); - Crossf(normal, tangent, axis); - - node1 = OTHER_NODE(ring[i].arc, node); - node2 = OTHER_NODE(ring[j].arc, node); - - VECCOPY(p, node2->p); - mirrorAlongAxis(p, node->p, normal); - - /* check if it's within limit before continuing */ - if (VecLenf(node1->p, p) > limit) - { - symmetric = 0; - } - - } - - if (symmetric) - { - /* first pass, merge incrementally */ - for (i = 0; i < count - 1; i++) - { - ReebNode *node1, *node2; - float tangent[3]; - float normal[3]; - int j = i + 1; - - VecAddf(tangent, ring[i].n, ring[j].n); - Crossf(normal, tangent, axis); - - node1 = OTHER_NODE(ring[i].arc, node); - node2 = OTHER_NODE(ring[j].arc, node); - - /* mirror first node and mix with the second */ - mirrorAlongAxis(node1->p, node->p, normal); - VecLerpf(node2->p, node2->p, node1->p, 1.0f / (j + 1)); - - /* Merge buckets - * there shouldn't be any null arcs here, but just to be safe - * */ - if (ring[i].arc->bcount > 0 && ring[j].arc->bcount > 0) - { - ReebArcIterator iter1, iter2; - EmbedBucket *bucket1 = NULL, *bucket2 = NULL; - - initArcIterator(&iter1, ring[i].arc, node); - initArcIterator(&iter2, ring[j].arc, node); - - bucket1 = nextBucket(&iter1); - bucket2 = nextBucket(&iter2); - - /* Make sure they both start at the same value */ - while(bucket1 && bucket1->val < bucket2->val) - { - bucket1 = nextBucket(&iter1); - } - - while(bucket2 && bucket2->val < bucket1->val) - { - bucket2 = nextBucket(&iter2); - } - - - for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2)) - { - bucket2->nv += bucket1->nv; /* add counts */ - - /* mirror on axis */ - mirrorAlongAxis(bucket1->p, node->p, normal); - /* add bucket2 in bucket1 */ - VecLerpf(bucket2->p, bucket2->p, bucket1->p, (float)bucket1->nv / (float)(bucket2->nv)); - } - } - } - - /* second pass, mirror back on previous arcs */ - for (i = count - 1; i > 0; i--) - { - ReebNode *node1, *node2; - float tangent[3]; - float normal[3]; - int j = i - 1; - - VecAddf(tangent, ring[i].n, ring[j].n); - Crossf(normal, tangent, axis); - - node1 = OTHER_NODE(ring[i].arc, node); - node2 = OTHER_NODE(ring[j].arc, node); - - /* copy first node than mirror */ - VECCOPY(node2->p, node1->p); - mirrorAlongAxis(node2->p, node->p, normal); - - /* Copy buckets - * there shouldn't be any null arcs here, but just to be safe - * */ - if (ring[i].arc->bcount > 0 && ring[j].arc->bcount > 0) - { - ReebArcIterator iter1, iter2; - EmbedBucket *bucket1 = NULL, *bucket2 = NULL; - - initArcIterator(&iter1, ring[i].arc, node); - initArcIterator(&iter2, ring[j].arc, node); - - bucket1 = nextBucket(&iter1); - bucket2 = nextBucket(&iter2); - - /* Make sure they both start at the same value */ - while(bucket1 && bucket1->val < bucket2->val) - { - bucket1 = nextBucket(&iter1); - } - - while(bucket2 && bucket2->val < bucket1->val) - { - bucket2 = nextBucket(&iter2); - } - - - for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2)) - { - /* copy and mirror back to bucket2 */ - bucket2->nv = bucket1->nv; - VECCOPY(bucket2->p, bucket1->p); - mirrorAlongAxis(bucket2->p, node->p, normal); - } - } - } - } - - MEM_freeN(ring); -} - -void reestablishAxialSymmetry(ReebNode *node, int depth, float axis[3]) -{ - ReebArc *arc1 = NULL; - ReebArc *arc2 = NULL; - ReebNode *node1 = NULL, *node2 = NULL; - float limit = G.scene->toolsettings->skgen_symmetry_limit; - float nor[3], vec[3], p[3]; - int i; - - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - /* depth is store as a negative in flag. symmetry level is positive */ - if (connectedArc->flags == -depth) - { - if (arc1 == NULL) - { - arc1 = connectedArc; - node1 = OTHER_NODE(arc1, node); - } - else - { - arc2 = connectedArc; - node2 = OTHER_NODE(arc2, node); - break; /* Can stop now, the two arcs have been found */ - } - } - } - - /* shouldn't happen, but just to be sure */ - if (node1 == NULL || node2 == NULL) - { - return; - } - - VecSubf(p, node1->p, node->p); - Crossf(vec, p, axis); - Crossf(nor, vec, axis); - - /* mirror node2 along axis */ - VECCOPY(p, node2->p); - mirrorAlongAxis(p, node->p, nor); - - /* check if it's within limit before continuing */ - if (VecLenf(node1->p, p) <= limit) - { - - /* average with node1 */ - VecAddf(node1->p, node1->p, p); - VecMulf(node1->p, 0.5f); - - /* mirror back on node2 */ - VECCOPY(node2->p, node1->p); - mirrorAlongAxis(node2->p, node->p, nor); - - /* Merge buckets - * there shouldn't be any null arcs here, but just to be safe - * */ - if (arc1->bcount > 0 && arc2->bcount > 0) - { - ReebArcIterator iter1, iter2; - EmbedBucket *bucket1 = NULL, *bucket2 = NULL; - - initArcIterator(&iter1, arc1, node); - initArcIterator(&iter2, arc2, node); - - bucket1 = nextBucket(&iter1); - bucket2 = nextBucket(&iter2); - - /* Make sure they both start at the same value */ - while(bucket1 && bucket1->val < bucket2->val) - { - bucket1 = nextBucket(&iter1); - } - - while(bucket2 && bucket2->val < bucket1->val) - { - bucket2 = nextBucket(&iter2); - } - - - for ( ;bucket1 && bucket2; bucket1 = nextBucket(&iter1), bucket2 = nextBucket(&iter2)) - { - bucket1->nv += bucket2->nv; /* add counts */ - - /* mirror on axis */ - mirrorAlongAxis(bucket2->p, node->p, nor); - /* add bucket2 in bucket1 */ - VecLerpf(bucket1->p, bucket1->p, bucket2->p, (float)bucket2->nv / (float)(bucket1->nv)); - - /* copy and mirror back to bucket2 */ - bucket2->nv = bucket1->nv; - VECCOPY(bucket2->p, bucket1->p); - mirrorAlongAxis(bucket2->p, node->p, nor); - } - } - } -} - -void markdownSecondarySymmetry(ReebNode *node, int depth, int level) -{ - float axis[3] = {0, 0, 0}; - int count = 0; - int i; - - /* Only reestablish spatial symmetry if needed */ - if (G.scene->toolsettings->skgen_options & SKGEN_SYMMETRY) - { - /* count the number of branches in this symmetry group - * and determinte the axis of symmetry - * */ - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - /* depth is store as a negative in flag. symmetry level is positive */ - if (connectedArc->flags == -depth) - { - count++; - } - /* If arc is on the axis */ - else if (connectedArc->flags == level) - { - VecAddf(axis, axis, connectedArc->v1->p); - VecSubf(axis, axis, connectedArc->v2->p); - } - } - - Normalize(axis); - - /* Split between axial and radial symmetry */ - if (count == 2) - { - reestablishAxialSymmetry(node, depth, axis); - } - else - { - reestablishRadialSymmetry(node, depth, axis); - } - } - - /* markdown secondary symetries */ - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - if (connectedArc->flags == -depth) - { - /* markdown symmetry for branches corresponding to the depth */ - markdownSymmetryArc(connectedArc, node, level + 1); - } - } -} - -void markdownSymmetryArc(ReebArc *arc, ReebNode *node, int level) -{ - int i; - arc->flags = level; - - node = OTHER_NODE(arc, node); - - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - if (connectedArc != arc) - { - ReebNode *connectedNode = OTHER_NODE(connectedArc, node); - - /* symmetry level is positive value, negative values is subtree depth */ - connectedArc->flags = -subtreeDepth(connectedNode, connectedArc); - } - } - - arc = NULL; - - for (i = 0; node->arcs[i] != NULL; i++) - { - int issymmetryAxis = 0; - ReebArc *connectedArc = node->arcs[i]; - - /* only arcs not already marked as symetric */ - if (connectedArc->flags < 0) - { - int j; - - /* true by default */ - issymmetryAxis = 1; - - for (j = 0; node->arcs[j] != NULL && issymmetryAxis == 1; j++) - { - ReebArc *otherArc = node->arcs[j]; - - /* different arc, same depth */ - if (otherArc != connectedArc && otherArc->flags == connectedArc->flags) - { - /* not on the symmetry axis */ - issymmetryAxis = 0; - } - } - } - - /* arc could be on the symmetry axis */ - if (issymmetryAxis == 1) - { - /* no arc as been marked previously, keep this one */ - if (arc == NULL) - { - arc = connectedArc; - } - else - { - /* there can't be more than one symmetry arc */ - arc = NULL; - break; - } - } - } - - /* go down the arc continuing the symmetry axis */ - if (arc) - { - markdownSymmetryArc(arc, node, level); - } - - - /* secondary symmetry */ - for (i = 0; node->arcs[i] != NULL; i++) - { - ReebArc *connectedArc = node->arcs[i]; - - /* only arcs not already marked as symetric and is not the next arc on the symmetry axis */ - if (connectedArc->flags < 0) - { - /* subtree depth is store as a negative value in the flag */ - markdownSecondarySymmetry(node, -connectedArc->flags, level); - } - } -} - -void markdownSymmetry(ReebGraph *rg) -{ - ReebNode *node; - ReebArc *arc; - /* only for Acyclic graphs */ - int cyclic = isGraphCyclic(rg); - - /* mark down all arcs as non-symetric */ - for (arc = rg->arcs.first; arc; arc = arc->next) - { - arc->flags = 0; - } - - /* mark down all nodes as not on the symmetry axis */ - for (node = rg->nodes.first; node; node = node->next) - { - node->flags = 0; - } - - /* node list is sorted, so lowest node is always the head (by design) */ - node = rg->nodes.first; - - /* only work on acyclic graphs and if only one arc is incident on the first node */ - if (cyclic == 0 && countConnectedArcs(rg, node) == 1) - { - arc = node->arcs[0]; - - markdownSymmetryArc(arc, node, 1); - - /* mark down non-symetric arcs */ - for (arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->flags < 0) - { - arc->flags = 0; - } - else - { - /* mark down nodes with the lowest level symmetry axis */ - if (arc->v1->flags == 0 || arc->v1->flags > arc->flags) - { - arc->v1->flags = arc->flags; - } - if (arc->v2->flags == 0 || arc->v2->flags > arc->flags) - { - arc->v2->flags = arc->flags; - } - } - } - } -} - -/**************************************** SUBDIVISION ALGOS ******************************************/ - -EditBone * subdivideByAngle(ReebArc *arc, ReebNode *head, ReebNode *tail) -{ - EditBone *lastBone = NULL; - if (G.scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) - { - ReebArcIterator iter; - EmbedBucket *current = NULL; - EmbedBucket *previous = NULL; - EditBone *child = NULL; - EditBone *parent = NULL; - EditBone *root = NULL; - float angleLimit = (float)cos(G.scene->toolsettings->skgen_angle_limit * M_PI / 180.0f); - - parent = add_editbone("Bone"); - parent->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - VECCOPY(parent->head, head->p); - - root = parent; - - for (initArcIterator(&iter, arc, head), previous = nextBucket(&iter), current = nextBucket(&iter); - current; - previous = current, current = nextBucket(&iter)) - { - float vec1[3], vec2[3]; - float len1, len2; - - VecSubf(vec1, previous->p, parent->head); - VecSubf(vec2, current->p, previous->p); - - len1 = Normalize(vec1); - len2 = Normalize(vec2); - - if (len1 > 0.0f && len2 > 0.0f && Inpf(vec1, vec2) < angleLimit) - { - VECCOPY(parent->tail, previous->p); - - child = add_editbone("Bone"); - VECCOPY(child->head, parent->tail); - child->parent = parent; - child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - - parent = child; /* new child is next parent */ - } - } - VECCOPY(parent->tail, tail->p); - - /* If the bone wasn't subdivided, delete it and return NULL - * to let subsequent subdivision methods do their thing. - * */ - if (parent == root) - { - delete_bone(parent); - parent = NULL; - } - - lastBone = parent; /* set last bone in the chain */ - } - - return lastBone; -} - -float calcCorrelation(ReebArc *arc, int start, int end, float v0[3], float n[3]) -{ - int len = 2 + abs(end - start); - - if (len > 2) - { - ReebArcIterator iter; - EmbedBucket *bucket = NULL; - float avg_t = 0.0f; - float s_t = 0.0f; - float s_xyz = 0.0f; - - /* First pass, calculate average */ - for (initArcIterator2(&iter, arc, start, end), bucket = nextBucket(&iter); - bucket; - bucket = nextBucket(&iter)) - { - float v[3]; - - VecSubf(v, bucket->p, v0); - avg_t += Inpf(v, n); - } - - avg_t /= Inpf(n, n); - avg_t += 1.0f; /* adding start (0) and end (1) values */ - avg_t /= len; - - /* Second pass, calculate s_xyz and s_t */ - for (initArcIterator2(&iter, arc, start, end), bucket = nextBucket(&iter); - bucket; - bucket = nextBucket(&iter)) - { - float v[3], d[3]; - float dt; - - VecSubf(v, bucket->p, v0); - Projf(d, v, n); - VecSubf(v, v, d); - - dt = VecLength(d) - avg_t; - - s_t += dt * dt; - s_xyz += Inpf(v, v); - } - - /* adding start(0) and end(1) values to s_t */ - s_t += (avg_t * avg_t) + (1 - avg_t) * (1 - avg_t); - - return 1.0f - s_xyz / s_t; - } - else - { - return 1.0f; - } -} - -EditBone * subdivideByCorrelation(ReebArc *arc, ReebNode *head, ReebNode *tail) -{ - ReebArcIterator iter; - float n[3]; - float CORRELATION_THRESHOLD = G.scene->toolsettings->skgen_correlation_limit; - EditBone *lastBone = NULL; - - /* init iterator to get start and end from head */ - initArcIterator(&iter, arc, head); - - /* Calculate overall */ - VecSubf(n, arc->buckets[iter.end].p, head->p); - - if (G.scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION && - calcCorrelation(arc, iter.start, iter.end, head->p, n) < CORRELATION_THRESHOLD) - { - EmbedBucket *bucket = NULL; - EmbedBucket *previous = NULL; - EditBone *child = NULL; - EditBone *parent = NULL; - int boneStart = iter.start; - - parent = add_editbone("Bone"); - parent->flag = BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - VECCOPY(parent->head, head->p); - - for (previous = nextBucket(&iter), bucket = nextBucket(&iter); - bucket; - previous = bucket, bucket = nextBucket(&iter)) - { - /* Calculate normal */ - VecSubf(n, bucket->p, parent->head); - - if (calcCorrelation(arc, boneStart, iter.index, parent->head, n) < CORRELATION_THRESHOLD) - { - VECCOPY(parent->tail, previous->p); - - child = add_editbone("Bone"); - VECCOPY(child->head, parent->tail); - child->parent = parent; - child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - - parent = child; // new child is next parent - boneStart = iter.index; // start from end - } - } - - VECCOPY(parent->tail, tail->p); - - lastBone = parent; /* set last bone in the chain */ - } - - return lastBone; -} - -float arcLengthRatio(ReebArc *arc) -{ - float arcLength = 0.0f; - float embedLength = 0.0f; - int i; - - arcLength = VecLenf(arc->v1->p, arc->v2->p); - - if (arc->bcount > 0) - { - /* Add the embedding */ - for ( i = 1; i < arc->bcount; i++) - { - embedLength += VecLenf(arc->buckets[i - 1].p, arc->buckets[i].p); - } - /* Add head and tail -> embedding vectors */ - embedLength += VecLenf(arc->v1->p, arc->buckets[0].p); - embedLength += VecLenf(arc->v2->p, arc->buckets[arc->bcount - 1].p); - } - else - { - embedLength = arcLength; - } - - return embedLength / arcLength; -} - -EditBone * subdivideByLength(ReebArc *arc, ReebNode *head, ReebNode *tail) -{ - EditBone *lastBone = NULL; - if ((G.scene->toolsettings->skgen_options & SKGEN_CUT_LENGTH) && - arcLengthRatio(arc) >= G.scene->toolsettings->skgen_length_ratio) - { - ReebArcIterator iter; - EmbedBucket *bucket = NULL; - EmbedBucket *previous = NULL; - EditBone *child = NULL; - EditBone *parent = NULL; - float lengthLimit = G.scene->toolsettings->skgen_length_limit; - int same = 0; - - parent = add_editbone("Bone"); - parent->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - VECCOPY(parent->head, head->p); - - initArcIterator(&iter, arc, head); - - bucket = nextBucket(&iter); - - while (bucket != NULL) - { - float *vec0 = NULL; - float *vec1 = bucket->p; - - /* first bucket. Previous is head */ - if (previous == NULL) - { - vec0 = head->p; - } - /* Previous is a valid bucket */ - else - { - vec0 = previous->p; - } - - /* If lengthLimit hits the current segment */ - if (VecLenf(vec1, parent->head) > lengthLimit) - { - if (same == 0) - { - float dv[3], off[3]; - float a, b, c, f; - - /* Solve quadratic distance equation */ - VecSubf(dv, vec1, vec0); - a = Inpf(dv, dv); - - VecSubf(off, vec0, parent->head); - b = 2 * Inpf(dv, off); - - c = Inpf(off, off) - (lengthLimit * lengthLimit); - - f = (-b + (float)sqrt(b * b - 4 * a * c)) / (2 * a); - - //printf("a %f, b %f, c %f, f %f\n", a, b, c, f); - - if (isnan(f) == 0 && f < 1.0f) - { - VECCOPY(parent->tail, dv); - VecMulf(parent->tail, f); - VecAddf(parent->tail, parent->tail, vec0); - } - else - { - VECCOPY(parent->tail, vec1); - } - } - else - { - float dv[3]; - - VecSubf(dv, vec1, vec0); - Normalize(dv); - - VECCOPY(parent->tail, dv); - VecMulf(parent->tail, lengthLimit); - VecAddf(parent->tail, parent->tail, parent->head); - } - - child = add_editbone("Bone"); - VECCOPY(child->head, parent->tail); - child->parent = parent; - child->flag |= BONE_CONNECTED|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - - parent = child; // new child is next parent - - same = 1; // mark as same - } - else - { - previous = bucket; - bucket = nextBucket(&iter); - same = 0; // Reset same - } - } - VECCOPY(parent->tail, tail->p); - - lastBone = parent; /* set last bone in the chain */ - } - - return lastBone; -} - -/***************************************** MAIN ALGORITHM ********************************************/ - -void generateSkeletonFromReebGraph(ReebGraph *rg) -{ - GHash *arcBoneMap = NULL; - ReebArc *arc = NULL; - ReebNode *node = NULL; - Object *src = NULL; - Object *dst = NULL; - - src = BASACT->object; - - if (G.obedit != NULL) - { - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo - } - - setcursor_space(SPACE_VIEW3D, CURSOR_WAIT); - - dst = add_object(OB_ARMATURE); - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - - /* Copy orientation from source */ - VECCOPY(dst->loc, src->obmat[3]); - Mat4ToEul(src->obmat, dst->rot); - Mat4ToSize(src->obmat, dst->size); - - where_is_object(G.obedit); - - make_editArmature(); - - arcBoneMap = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - - markdownSymmetry(rg); - - for (arc = rg->arcs.first; arc; arc = arc->next) - { - EditBone *lastBone = NULL; - ReebNode *head, *tail; - int i; - - /* Find out the direction of the arc through simple heuristics (in order of priority) : - * - * 1- Arcs on primary symmetry axis (flags == 1) point up (head: high weight -> tail: low weight) - * 2- Arcs starting on a primary axis point away from it (head: node on primary axis) - * 3- Arcs point down (head: low weight -> tail: high weight) - * - * Finally, the arc direction is stored in its flags: 1 (low -> high), -1 (high -> low) - */ - - /* if arc is a symmetry axis, internal bones go up the tree */ - if (arc->flags == 1 && arc->v2->degree != 1) - { - head = arc->v2; - tail = arc->v1; - - arc->flags = -1; /* mark arc direction */ - } - /* Bones point AWAY from the symmetry axis */ - else if (arc->v1->flags == 1) - { - head = arc->v1; - tail = arc->v2; - - arc->flags = 1; /* mark arc direction */ - } - else if (arc->v2->flags == 1) - { - head = arc->v2; - tail = arc->v1; - - arc->flags = -1; /* mark arc direction */ - } - /* otherwise, always go from low weight to high weight */ - else - { - head = arc->v1; - tail = arc->v2; - - arc->flags = 1; /* mark arc direction */ - } - - /* Loop over subdivision methods */ - for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) - { - switch(G.scene->toolsettings->skgen_subdivisions[i]) - { - case SKGEN_SUB_LENGTH: - lastBone = subdivideByLength(arc, head, tail); - break; - case SKGEN_SUB_ANGLE: - lastBone = subdivideByAngle(arc, head, tail); - break; - case SKGEN_SUB_CORRELATION: - lastBone = subdivideByCorrelation(arc, head, tail); - break; - } - } - - if (lastBone == NULL) - { - EditBone *bone; - bone = add_editbone("Bone"); - bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - - VECCOPY(bone->head, head->p); - VECCOPY(bone->tail, tail->p); - - /* set first and last bone, since there's only one */ - lastBone = bone; - } - - BLI_ghash_insert(arcBoneMap, arc, lastBone); - } - - /* Second pass, setup parent relationship between arcs */ - for (node = rg->nodes.first; node; node = node->next) - { - ReebArc *incomingArc = NULL; - int i; - - for (i = 0; node->arcs[i] != NULL; i++) - { - arc = node->arcs[i]; - - /* if arc is incoming into the node */ - if ((arc->v1 == node && arc->flags == -1) || (arc->v2 == node && arc->flags == 1)) - { - if (incomingArc == NULL) - { - incomingArc = arc; - /* loop further to make sure there's only one incoming arc */ - } - else - { - /* skip this node if more than one incomingArc */ - incomingArc = NULL; - break; /* No need to look further, we are skipping already */ - } - } - } - - if (incomingArc != NULL) - { - EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc); - - /* Look for outgoing arcs and parent their bones */ - for (i = 0; node->arcs[i] != NULL; i++) - { - arc = node->arcs[i]; - - /* if arc is outgoing from the node */ - if ((arc->v1 == node && arc->flags == 1) || (arc->v2 == node && arc->flags == -1)) - { - EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc); - - /* find the root bone */ - while(childBone->parent != NULL) - { - childBone = childBone->parent; - } - - childBone->parent = parentBone; - childBone->flag |= BONE_CONNECTED; - } - } - } - } - - BLI_ghash_free(arcBoneMap, NULL, NULL); - - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - - BIF_undo_push("Generate Skeleton"); -} - -void generateSkeleton(void) -{ - EditMesh *em = G.editMesh; - ReebGraph *rg = NULL; - int i; - - if (em == NULL) - return; - - setcursor_space(SPACE_VIEW3D, CURSOR_WAIT); - - if (weightFromDistance(em) == 0) - { - error("No selected vertex\n"); - return; - } - - weightToHarmonic(em); - - renormalizeWeight(em, 1.0f); - -//#ifdef DEBUG_REEB - weightToVCol(em); -//#endif - - rg = generateReebGraph(em, G.scene->toolsettings->skgen_resolution); - - verifyBuckets(rg); - - /* Remove arcs without embedding */ - filterNullReebGraph(rg); - - verifyBuckets(rg); - - - i = 1; - /* filter until there's nothing more to do */ - while (i == 1) - { - i = 0; /* no work done yet */ - - if (G.scene->toolsettings->skgen_options & SKGEN_FILTER_EXTERNAL) - { - i |= filterExternalReebGraph(rg, G.scene->toolsettings->skgen_threshold_external * G.scene->toolsettings->skgen_resolution); - } - - verifyBuckets(rg); - - if (G.scene->toolsettings->skgen_options & SKGEN_FILTER_INTERNAL) - { - i |= filterInternalReebGraph(rg, G.scene->toolsettings->skgen_threshold_internal * G.scene->toolsettings->skgen_resolution); - } - } - - verifyBuckets(rg); - - repositionNodes(rg); - - verifyBuckets(rg); - - /* Filtering might have created degree 2 nodes, so remove them */ - removeNormalNodes(rg); - - verifyBuckets(rg); - - for(i = 0; i < G.scene->toolsettings->skgen_postpro_passes; i++) - { - postprocessGraph(rg, G.scene->toolsettings->skgen_postpro); - } - - buildAdjacencyList(rg); - - sortNodes(rg); - - sortArcs(rg); - - generateSkeletonFromReebGraph(rg); - - freeGraph(rg); -} diff --git a/source/blender/src/editconstraint.c b/source/blender/src/editconstraint.c deleted file mode 100644 index e0588b4c2a0..00000000000 --- a/source/blender/src/editconstraint.c +++ /dev/null @@ -1,1103 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_text_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_ipo.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editconstraint.h" -#include "BIF_poseobject.h" -#include "BIF_interface.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BPY_extern.h" - -#include "blendef.h" -#include "nla.h" -#include "mydevice.h" - - -ListBase *get_active_constraint_channels (Object *ob, int forcevalid) -{ - char ipstr[64]; - - if (!ob) - return NULL; - - /* See if we are a bone constraint */ - if (ob->flag & OB_POSEMODE) { - bActionChannel *achan; - bPoseChannel *pchan; - - pchan = get_active_posechannel(ob); - if (pchan) { - - /* Make sure we have an action */ - if (!ob->action){ - if (!forcevalid) - return NULL; - - ob->action=add_empty_action("Action"); - } - - /* Make sure we have an actionchannel */ - achan = get_action_channel(ob->action, pchan->name); - if (!achan){ - if (!forcevalid) - return NULL; - - achan = MEM_callocN (sizeof(bActionChannel), "actionChannel"); - - strcpy (achan->name, pchan->name); - sprintf (ipstr, "%s.%s", ob->action->id.name+2, achan->name); - ipstr[23]=0; - achan->ipo= add_ipo(ipstr, ID_AC); - - BLI_addtail (&ob->action->chanbase, achan); - } - - return &achan->constraintChannels; - } - else return NULL; - } - /* else we return object constraints */ - else { - if(ob->ipoflag & OB_ACTION_OB) { - bActionChannel *achan = get_action_channel(ob->action, "Object"); - if(achan) - return &achan->constraintChannels; - else - return NULL; - } - - return &ob->constraintChannels; - } -} - - -/* if object in posemode, active bone constraints, else object constraints */ -ListBase *get_active_constraints(Object *ob) -{ - if (!ob) - return NULL; - - if (ob->flag & OB_POSEMODE) { - bPoseChannel *pchan; - - pchan = get_active_posechannel(ob); - if (pchan) - return &pchan->constraints; - } - else - return &ob->constraints; - - return NULL; -} - -/* single constraint */ -bConstraint *get_active_constraint(Object *ob) -{ - ListBase *lb= get_active_constraints(ob); - - if (lb) { - bConstraint *con; - for (con= lb->first; con; con=con->next) - if (con->flag & CONSTRAINT_ACTIVE) - return con; - } - return NULL; -} - -/* single channel, for ipo */ -bConstraintChannel *get_active_constraint_channel(Object *ob) -{ - bConstraint *con; - bConstraintChannel *chan; - - if (ob->flag & OB_POSEMODE) { - if(ob->action) { - bPoseChannel *pchan; - - pchan = get_active_posechannel(ob); - if (pchan) { - for (con= pchan->constraints.first; con; con= con->next) - if (con->flag & CONSTRAINT_ACTIVE) - break; - if (con) { - bActionChannel *achan = get_action_channel(ob->action, pchan->name); - if (achan) { - for (chan= achan->constraintChannels.first; chan; chan= chan->next) - if (!strcmp(chan->name, con->name)) - break; - return chan; - } - } - } - } - } - else { - for(con= ob->constraints.first; con; con= con->next) - if(con->flag & CONSTRAINT_ACTIVE) - break; - if(con) { - ListBase *lb= get_active_constraint_channels(ob, 0); - - if(lb) { - for(chan= lb->first; chan; chan= chan->next) - if(!strcmp(chan->name, con->name)) - break; - return chan; - } - } - } - - return NULL; -} - - -bConstraint *add_new_constraint(short type) -{ - bConstraint *con; - bConstraintTypeInfo *cti; - - con = MEM_callocN(sizeof(bConstraint), "constraint"); - - /* Set up a generic constraint datablock */ - con->type = type; - con->flag |= CONSTRAINT_EXPAND; - con->enforce = 1.0F; - strcpy(con->name, "Const"); - - /* Load the data for it */ - cti = constraint_get_typeinfo(con); - if (cti) { - con->data = MEM_callocN(cti->size, cti->structName); - - /* only constraints that change any settings need this */ - if (cti->new_data) - cti->new_data(con->data); - } - - return con; -} - -void add_constraint_to_object(bConstraint *con, Object *ob) -{ - ListBase *list; - list = &ob->constraints; - - if (list) { - unique_constraint_name(con, list); - BLI_addtail(list, con); - - con->flag |= CONSTRAINT_ACTIVE; - for (con= con->prev; con; con= con->prev) - con->flag &= ~CONSTRAINT_ACTIVE; - } -} - -/* checks validity of object pointers, and NULLs, - * if Bone doesnt exist it sets the CONSTRAINT_DISABLE flag - */ -static void test_constraints (Object *owner, const char substring[]) -{ - - bConstraint *curcon; - ListBase *conlist= NULL; - int type; - - if (owner==NULL) return; - - /* Check parents */ - /* Get the constraint list for this object */ - - if (strlen (substring)) { - switch (owner->type) { - case OB_ARMATURE: - type = CONSTRAINT_OBTYPE_BONE; - break; - default: - type = CONSTRAINT_OBTYPE_OBJECT; - break; - } - } - else - type = CONSTRAINT_OBTYPE_OBJECT; - - - switch (type) { - case CONSTRAINT_OBTYPE_OBJECT: - conlist = &owner->constraints; - break; - case CONSTRAINT_OBTYPE_BONE: - { - Bone *bone; - bPoseChannel *chan; - - bone = get_named_bone( ((bArmature *)owner->data ), substring ); - chan = get_pose_channel(owner->pose, substring); - if (bone && chan) { - conlist = &chan->constraints; - } - } - break; - } - - /* Check all constraints - is constraint valid? */ - if (conlist) { - for (curcon = conlist->first; curcon; curcon=curcon->next) { - curcon->flag &= ~CONSTRAINT_DISABLE; - - switch (curcon->type) { - case CONSTRAINT_TYPE_PYTHON: - { - bPythonConstraint *data = curcon->data; - - /* is there are valid script? */ - if (!data->text) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - else if (!BPY_is_pyconstraint(data->text)) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - /* does the constraint require target input... also validates targets */ - BPY_pyconstraint_update(owner, curcon); - } - break; - case CONSTRAINT_TYPE_ACTION: - { - bActionConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_LOCLIKE: - { - bLocateLikeConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_MINMAX: - { - bMinMaxConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_ROTLIKE: - { - bRotateLikeConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_SIZELIKE: - { - bSizeLikeConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_KINEMATIC: - { - bKinematicConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - } - else if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - } - - if (data->poletar && !exist_object(data->poletar)) { - data->poletar = NULL; - } - else if ( (data->poletar == owner) && - (!get_named_bone(get_armature(owner), - data->polesubtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - } - - } - break; - case CONSTRAINT_TYPE_TRACKTO: - { - bTrackToConstraint *data = curcon->data; - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->reserved2==data->reserved1) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->reserved2+3==data->reserved1) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_LOCKTRACK: - { - bLockTrackConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if (data->lockflag==data->trackflag) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->lockflag+3==data->trackflag) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_STRETCHTO: - { - bStretchToConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_FOLLOWPATH: - { - bFollowPathConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->tar->type != OB_CURVE) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->upflag==data->trackflag) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - if (data->upflag+3==data->trackflag) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - case CONSTRAINT_TYPE_CLAMPTO: - { - bClampToConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if (data->tar->type != OB_CURVE) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - else { - Curve *cu= data->tar->data; - - /* auto-set 'Path' setting on curve so this works */ - cu->flag |= CU_PATH; - } - } - break; - case CONSTRAINT_TYPE_TRANSFORM: - { - bTransformConstraint *data = curcon->data; - - if (!exist_object(data->tar)) { - data->tar = NULL; - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - - if ( (data->tar == owner) && - (!get_named_bone(get_armature(owner), - data->subtarget))) { - curcon->flag |= CONSTRAINT_DISABLE; - break; - } - } - break; - } - } - } -} - -static void test_bonelist_constraints (Object *owner, ListBase *list) -{ - Bone *bone; - - for (bone = list->first; bone; bone=bone->next) { - - test_constraints(owner, bone->name); - test_bonelist_constraints (owner, &bone->childbase); - } -} - -void object_test_constraints (Object *owner) -{ - test_constraints(owner, ""); - - if(owner->type==OB_ARMATURE) { - bArmature *arm; - arm = get_armature(owner); - if (arm) - test_bonelist_constraints (owner, &arm->bonebase); - } - -} - -/* helper function for add_constriant - sets the last target for the active constraint */ -static void set_constraint_nth_target(bConstraint *con, Object *target, char subtarget[], int index) -{ - bConstraintTypeInfo *cti= constraint_get_typeinfo(con); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - int num_targets, i; - - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - num_targets= BLI_countlist(&targets); - - if (index < 0) { - if (abs(index) < num_targets) - index= num_targets - abs(index); - else - index= num_targets - 1; - } - else if (index >= num_targets) { - index= num_targets - 1; - } - - for (ct=targets.first, i=0; ct; ct= ct->next, i++) { - if (i == index) { - ct->tar= target; - strcpy(ct->subtarget, subtarget); - break; - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 0); - } -} - -/* context: active object in posemode, active channel, optional selected channel */ -void add_constraint(int only_IK) -{ - Object *ob= OBACT, *obsel=NULL; - bPoseChannel *pchanact=NULL, *pchansel=NULL; - bConstraint *con=NULL; - Base *base; - short nr; - - /* paranoia checks */ - if(ob==NULL || ob==G.obedit) return; - - if(ob->pose && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; - - /* find active channel */ - pchanact= get_active_posechannel(ob); - if(pchanact==NULL) return; - - /* check protection */ - if(ob->proxy && (pchanact->bone->layer & arm->layer_protected)) { - error("Bone is Proxy protected"); - return; - } - - /* find selected bone */ - for(pchansel= ob->pose->chanbase.first; pchansel; pchansel= pchansel->next) { - if(pchansel!=pchanact) - if(pchansel->bone->flag & BONE_SELECTED) - if(pchansel->bone->layer & arm->layer) - break; - } - } - - /* find selected object */ - for(base= FIRSTBASE; base; base= base->next) - if( TESTBASE(base) && base->object!=ob ) - obsel= base->object; - - /* the only_IK caller has checked for posemode! */ - if(only_IK) { - for(con= pchanact->constraints.first; con; con= con->next) { - if(con->type==CONSTRAINT_TYPE_KINEMATIC) break; - } - if(con) { - error("Pose Channel already has IK"); - return; - } - - if(pchansel) - nr= pupmenu("Add IK Constraint%t|To Active Bone%x10"); - else if(obsel) - nr= pupmenu("Add IK Constraint%t|To Active Object%x10"); - else - nr= pupmenu("Add IK Constraint%t|To New Empty Object%x10|Without Target%x11"); - } - else { - if(pchanact) { - if(pchansel) - nr= pupmenu("Add Constraint to Active Bone%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18"); - else if(obsel && obsel->type==OB_CURVE) - nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17|Stretch To%x7|%l|Action%x16|Script%x18"); - else if(obsel) - nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18"); - else - nr= pupmenu("Add Constraint to New Empty Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|Stretch To%x7|%l|Action%x16|Script%x18"); - } - else { - if(obsel && obsel->type==OB_CURVE) - nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|Follow Path%x6|Clamp To%x17|%l|Action%x16|Script%x18"); - else if(obsel) - nr= pupmenu("Add Constraint to Active Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|%l|Action%x16|Script%x18"); - else - nr= pupmenu("Add Constraint to New Empty Object%t|Child Of%x19|Transformation%x20|%l|Copy Location%x1|Copy Rotation%x2|Copy Scale%x8|%l|Limit Location%x13|Limit Rotation%x14|Limit Scale%x15|%l|Track To%x3|Floor%x4|Locked Track%x5|%l|Action%x16|Script%x18"); - } - } - - if(nr<1) return; - - /* handle IK separate */ - if(nr==10 || nr==11) { - - /* prevent weird chains... */ - if(pchansel) { - bPoseChannel *pchan= pchanact; - while(pchan) { - if(pchan==pchansel) break; - pchan= pchan->parent; - } - if(pchan) { - error("IK root cannot be linked to IK tip"); - return; - } - pchan= pchansel; - while(pchan) { - if(pchan==pchanact) break; - pchan= pchan->parent; - } - if(pchan) { - error("IK tip cannot be linked to IK root"); - return; - } - } - - con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC); - BLI_addtail(&pchanact->constraints, con); - unique_constraint_name(con, &pchanact->constraints); - pchanact->constflag |= PCHAN_HAS_IK; // for draw, but also for detecting while pose solving - if(nr==11) pchanact->constflag |= PCHAN_HAS_TARGET; - } - else { - - if (nr==1) con = add_new_constraint(CONSTRAINT_TYPE_LOCLIKE); - else if (nr==2) con = add_new_constraint(CONSTRAINT_TYPE_ROTLIKE); - else if (nr==3) con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO); - else if (nr==4) con = add_new_constraint(CONSTRAINT_TYPE_MINMAX); - else if (nr==5) con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK); - else if (nr==6) { - Curve *cu= obsel->data; - cu->flag |= CU_PATH; - con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH); - } - else if (nr==7) con = add_new_constraint(CONSTRAINT_TYPE_STRETCHTO); - else if (nr==8) con = add_new_constraint(CONSTRAINT_TYPE_SIZELIKE); - else if (nr==13) con = add_new_constraint(CONSTRAINT_TYPE_LOCLIMIT); - else if (nr==14) con = add_new_constraint(CONSTRAINT_TYPE_ROTLIMIT); - else if (nr==15) con = add_new_constraint(CONSTRAINT_TYPE_SIZELIMIT); - else if (nr==16) { - /* TODO: add a popup-menu to display list of available actions to use (like for pyconstraints) */ - con = add_new_constraint(CONSTRAINT_TYPE_ACTION); - } - else if (nr==17) { - Curve *cu= obsel->data; - cu->flag |= CU_PATH; - con = add_new_constraint(CONSTRAINT_TYPE_CLAMPTO); - } - else if (nr==18) { - char *menustr; - int scriptint= 0; - - /* popup a list of usable scripts */ - menustr = buildmenu_pyconstraints(NULL, &scriptint); - scriptint = pupmenu(menustr); - MEM_freeN(menustr); - - /* only add constraint if a script was chosen */ - if (scriptint) { - /* add constraint */ - con = add_new_constraint(CONSTRAINT_TYPE_PYTHON); - validate_pyconstraint_cb(con->data, &scriptint); - - /* make sure target allowance is set correctly */ - BPY_pyconstraint_update(ob, con); - } - } - else if (nr==19) { - con = add_new_constraint(CONSTRAINT_TYPE_CHILDOF); - - /* if this constraint is being added to a posechannel, make sure - * the constraint gets evaluated in pose-space - */ - if (pchanact) { - con->ownspace = CONSTRAINT_SPACE_POSE; - con->flag |= CONSTRAINT_SPACEONCE; - } - } - else if (nr==20) con = add_new_constraint(CONSTRAINT_TYPE_TRANSFORM); - - if (con==NULL) return; /* paranoia */ - - if (pchanact) { - BLI_addtail(&pchanact->constraints, con); - unique_constraint_name(con, &pchanact->constraints); - pchanact->constflag |= PCHAN_HAS_CONST; /* for draw */ - } - else { - BLI_addtail(&ob->constraints, con); - unique_constraint_name(con, &ob->constraints); - } - } - - /* set the target */ - if (pchansel) { - set_constraint_nth_target(con, ob, pchansel->name, 0); - } - else if(obsel) { - set_constraint_nth_target(con, obsel, "", 0); - } - else if (ELEM4(nr, 11, 13, 14, 15)==0) { /* add new empty as target */ - Base *base= BASACT, *newbase; - Object *obt; - - obt= add_object(OB_EMPTY); - /* set layers OK */ - newbase= BASACT; - newbase->lay= base->lay; - obt->lay= newbase->lay; - - /* transform cent to global coords for loc */ - if (pchanact) { - if(only_IK) - VecMat4MulVecfl(obt->loc, ob->obmat, pchanact->pose_tail); - else - VecMat4MulVecfl(obt->loc, ob->obmat, pchanact->pose_head); - } - else - VECCOPY(obt->loc, ob->obmat[3]); - - set_constraint_nth_target(con, obt, "", 0); - - /* restore, add_object sets active */ - BASACT= base; - base->flag |= SELECT; - } - - /* active flag */ - con->flag |= CONSTRAINT_ACTIVE; - for(con= con->prev; con; con= con->prev) - con->flag &= ~CONSTRAINT_ACTIVE; - - DAG_scene_sort(G.scene); // sort order of objects - - if (pchanact) { - ob->pose->flag |= POSE_RECALC; // sort pose channels - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations - } - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); // and all its relations - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - if (only_IK) - BIF_undo_push("Add IK Constraint"); - else - BIF_undo_push("Add Constraint"); - -} - -void ob_clear_constraints(void) -{ - Object *ob= OBACT; - - /* paranoia checks */ - if(!ob) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)) return; - - if(okee("Clear Constraints")==0) return; - - free_constraints(&ob->constraints); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - BIF_undo_push("Clear Constraint(s)"); - -} - -/* con already has the new name */ -void rename_constraint(Object *ob, bConstraint *con, char *oldname) -{ - bConstraint *tcon; - bConstraintChannel *conchan; - ListBase *conlist= NULL; - int from_object= 0; - char *channame=""; - - /* get context by searching for con (primitive...) */ - for(tcon= ob->constraints.first; tcon; tcon= tcon->next) - if(tcon==con) - break; - - if(tcon) { - conlist= &ob->constraints; - channame= "Object"; - from_object= 1; - } - else if(ob->pose) { - bPoseChannel *pchan; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - for(tcon= pchan->constraints.first; tcon; tcon= tcon->next) { - if(tcon==con) - break; - } - if(tcon) - break; - } - if(tcon) { - conlist= &pchan->constraints; - channame= pchan->name; - } - } - - if(conlist==NULL) { - printf("rename constraint failed\n"); /* should not happen in UI */ - return; - } - - /* first make sure it's a unique name within context */ - unique_constraint_name (con, conlist); - - /* own channels */ - if(from_object) { - for(conchan= ob->constraintChannels.first; conchan; conchan= conchan->next) { - if( strcmp(oldname, conchan->name)==0 ) - BLI_strncpy(conchan->name, con->name, sizeof(conchan->name)); - } - } - /* own action */ - if(ob->action) { - bActionChannel *achan= get_action_channel(ob->action, channame); - if(achan) { - conchan= get_constraint_channel(&achan->constraintChannels, oldname); - if(conchan) - BLI_strncpy(conchan->name, con->name, sizeof(conchan->name)); - } - } - -} - -/* ********************** CONSTRAINT-SPECIFIC STUFF ********************* */ -/* ------------- PyConstraints ------------------ */ - -/* this callback sets the text-file to be used for selected menu item */ -void validate_pyconstraint_cb(void *arg1, void *arg2) -{ - bPythonConstraint *data = arg1; - Text *text; - int index = *((int *)arg2); - int i; - - /* innovative use of a for...loop to search */ - for (text=G.main->text.first, i=1; text && index!=i; i++, text=text->id.next); - data->text = text; -} - -/* this returns a string for the list of usable pyconstraint script names */ -char *buildmenu_pyconstraints(Text *con_text, int *pyconindex) -{ - Text *text; - char *menustr = MEM_callocN(128, "menustr pyconstraints"); - char *name, stmp[128]; - int buf = 128; - int used = strlen("Scripts: %t") + 1; - int i; - - sprintf(menustr, "%s", "Scripts: %t"); - - for (text=G.main->text.first, i=1; text; i++, text=text->id.next) { - /* this is important to ensure that right script is shown as active */ - if (text == con_text) *pyconindex = i; - - /* menu entry is length of name + 3(len(|%X)) + 6 characters for the int.*/ - if (BPY_is_pyconstraint(text)) { - name= text->id.name; - if (strlen(name)+used+10 >= buf) { - char *newbuf = MEM_callocN(buf+128, "menustr pyconstraints 2"); - memcpy(newbuf, menustr, used); - MEM_freeN(menustr); - menustr = newbuf; - buf += 128; - } - sprintf(stmp, "|%s%%x%d", name, i); - strcat(menustr, stmp); - used += strlen(name)+10; - } - } - - return menustr; -} - -/* this callback gets called when the 'refresh' button of a pyconstraint gets pressed */ -void update_pyconstraint_cb(void *arg1, void *arg2) -{ - Object *owner= (Object *)arg1; - bConstraint *con= (bConstraint *)arg2; - - if (owner && con) - BPY_pyconstraint_update(owner, con); -} - -/* ------------- Child-Of Constraint ------------------ */ - -/* ChildOf Constraint - set inverse callback */ -void childof_const_setinv (void *conv, void *unused) -{ - bChildOfConstraint *data= (bChildOfConstraint *)conv; - Object *ob= OBACT; - bPoseChannel *pchan= NULL; - - /* try to find a pose channel */ - if (ob && ob->pose) - pchan= get_active_posechannel(ob); - - /* calculate/set inverse matrix */ - if (pchan) { - bConstraintOb *cob; - float ctime= bsystem_time(ob, (float)G.scene->r.cfra, 0.0); /* not accurate... */ - float pmat[4][4], chmat[4][4], cimat[4][4]; - float vec0[3]={0,0,0}, vec1[3]={1,1,1}; - - /* make copies of pchan's original matrices (to be restored later) */ - Mat4CpyMat4(pmat, pchan->pose_mat); - Mat4CpyMat4(chmat, pchan->chan_mat); - Mat4CpyMat4(cimat, pchan->constinv); - - - /* clear pchan's transform (for constraint solving) */ - LocEulSizeToMat4(pchan->chan_mat, vec0, vec0, vec1); - Mat4MulMat4(pchan->pose_mat, pmat, cimat); - Mat4One(pchan->constinv); - Mat4One(data->invmat); - - - /* do constraint solving on pose-matrix containing no transforms - * N.B. code is copied from armature.c (where_is_pose_bone) - */ - cob= constraints_make_evalob(ob, pchan, CONSTRAINT_OBTYPE_BONE); - solve_constraints(&pchan->constraints, cob, ctime); - constraints_clear_evalob(cob); - - - /* parent-inverse matrix for this constraint is given by taking the - * local-space (i.e. without any standard parents + restpose) pose_matrix - * (that was calulated with no transforms applied), and inverting it. - */ - Mat4CpyMat4(pchan->constinv, pchan->pose_mat); - - constraint_mat_convertspace(ob, pchan, pchan->constinv, - CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); - - Mat4Invert(data->invmat, pchan->constinv); - - - /* restore original matrices of pchan */ - Mat4CpyMat4(pchan->pose_mat, pmat); - Mat4CpyMat4(pchan->chan_mat, chmat); - Mat4CpyMat4(pchan->constinv, cimat); - } - else if (ob) { - /* use what_does_parent to find inverse - just like for normal parenting. - * NOTE: what_does_parent uses a static workob defined in object.c - */ - what_does_parent(ob); - Mat4Invert(data->invmat, workob.obmat); - } - else - Mat4One(data->invmat); -} - -/* ChildOf Constraint - clear inverse callback */ -void childof_const_clearinv (void *conv, void *unused) -{ - bChildOfConstraint *data= (bChildOfConstraint *)conv; - - /* simply clear the matrix */ - Mat4One(data->invmat); -} diff --git a/source/blender/src/editcurve.c b/source/blender/src/editcurve.c deleted file mode 100644 index 8d845c4ba14..00000000000 --- a/source/blender/src/editcurve.c +++ /dev/null @@ -1,4632 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_dynstr.h" -#include "BLI_rand.h" - -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" -#include "BKE_library.h" -#include "BKE_ipo.h" -#include "BKE_depsgraph.h" -#include "BKE_curve.h" -#include "BKE_global.h" -#include "BKE_object.h" -#include "BKE_main.h" -#include "BKE_key.h" - -#include "BIF_editmode_undo.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_editkey.h" -#include "BIF_mywindow.h" -#include "BIF_interface.h" -#include "BIF_transform.h" -#include "BIF_retopo.h" - -#include "BSE_view.h" /* For persp... */ -#include "BSE_edit.h" - -#include "BDR_drawobject.h" -#include "BDR_editcurve.h" -#include "BDR_editobject.h" - -#include "mydevice.h" -#include "blendef.h" - -#include "BDR_editcurve.h" -/* still need to eradicate a few :( */ -#define callocstructN(x,y,name) (x*)MEM_callocN((y)* sizeof(x),name) - - -ListBase editNurb; -BPoint *lastselbp; -Nurb *lastnu; /* for selected */ - - -/* void freeNurblist(ListBase *lb); already declared in the kernel */ - -float nurbcircle[8][2]= { - {0.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {-1.0, 1.0}, - {0.0, 1.0}, { 1.0, 1.0}, { 1.0, 0.0}, { 1.0, -1.0} -}; - -/* ******************* SELECTION FUNCTIONS ********************* */ - -/* returns 1 in case (de)selection was successful */ -static short select_beztriple(BezTriple *bezt, short selstatus, short flag, short hidden) -{ - if(bezt) { - if((bezt->hide==0) || (hidden==1)) { - if(selstatus==1) { /* selects */ - bezt->f1 |= flag; - bezt->f2 |= flag; - bezt->f3 |= flag; - return 1; - } - else { /* deselects */ - bezt->f1 &= ~flag; - bezt->f2 &= ~flag; - bezt->f3 &= ~flag; - return 1; - } - } - } - - return 0; -} - -/* returns 1 in case (de)selection was successful */ -static short select_bpoint(BPoint *bp, short selstatus, short flag, short hidden) -{ - if(bp) { - if((bp->hide==0) || (hidden==1)) { - if(selstatus==1) { - bp->f1 |= flag; - return 1; - } - else { - bp->f1 &= ~flag; - return 1; - } - } - } - - return 0; -} - -static short swap_selection_beztriple(BezTriple *bezt) -{ - if(bezt->f2 & SELECT) - return select_beztriple(bezt, DESELECT, 1, VISIBLE); - else - return select_beztriple(bezt, SELECT, 1, VISIBLE); -} - -static short swap_selection_bpoint(BPoint *bp) -{ - if(bp->f1 & SELECT) - return select_bpoint(bp, DESELECT, 1, VISIBLE); - else - return select_bpoint(bp, SELECT, 1, VISIBLE); -} - -short isNurbsel(Nurb *nu) -{ - BezTriple *bezt; - BPoint *bp; - int a; - - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if( (bezt->f1 & SELECT) || (bezt->f2 & SELECT) || (bezt->f3 & SELECT) ) return 1; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if( (bp->f1 & SELECT) ) return 1; - bp++; - } - } - return 0; -} - -int isNurbsel_count(Nurb *nu) -{ - BezTriple *bezt; - BPoint *bp; - int a, sel=0; - - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if (BEZSELECTED_HIDDENHANDLES(bezt)) sel++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if( (bp->f1 & SELECT) ) sel++; - bp++; - } - } - return sel; -} - -/* ******************* PRINTS ********************* */ - -void printknots() -{ - Nurb *nu; - int a, num; - - for(nu= editNurb.first; nu; nu= nu->next) { - if(isNurbsel(nu) && (nu->type & 7)==CU_NURBS) { - if(nu->knotsu) { - num= KNOTSU(nu); - for(a=0;aknotsu[a]); - } - if(nu->knotsv) { - num= KNOTSV(nu); - for(a=0;aknotsv[a]); - } - } - } -} - -#if 0 -static void printweightsNurb__doPrint(void *userData, Nurb *nurb, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) -{ - char str[30]; - - if (bp && (bp->f1&1)) { - sprintf(str,"%2.2f", bp->vec[3]); - - cpack(0x737373); - glRasterPos2i(x-1, y-1); - BMF_DrawString(G.font, str); - - glRasterPos2i(x+1, y+1); - BMF_DrawString(G.font, str); - - cpack(0xFFFFFF); - glRasterPos2i(x, y); - BMF_DrawString(G.font, str); - } -} -static void printweightsNurb(void) -{ - if(G.obedit==0) return; - - persp(PERSP_WIN); - - glDrawBuffer(GL_FRONT); - nurbs_foreachScreenVert(printweightsNurb__doPrint, NULL); - glDrawBuffer(GL_BACK); - - persp(PERSP_VIEW); -} -#endif - - -/* ********************* LOAD and MAKE *************** */ - -void load_editNurb() -{ - /* load editNurb in object */ - Curve *cu= 0; - Nurb *nu, *newnu; - KeyBlock *actkey; - - if(G.obedit==0) return; - - if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - - G.totvert= count_curveverts(&editNurb); - - cu= G.obedit->data; - - /* are there keys? */ - actkey = ob_get_keyblock(G.obedit); - if(actkey) { - /* active key: the vertices */ - - if(G.totvert) { - if(actkey->data) MEM_freeN(actkey->data); - - actkey->data= MEM_callocN(cu->key->elemsize*G.totvert, "actkey->data"); - actkey->totelem= G.totvert; - - curve_to_key(cu, actkey, &editNurb); - } - } - - if(cu->key && actkey!=cu->key->refkey) { - ; - } - else { - freeNurblist(&(cu->nurb)); - - for(nu= editNurb.first; nu; nu= nu->next) { - newnu= duplicateNurb(nu); - BLI_addtail(&(cu->nurb), newnu); - - if((nu->type & 7)==CU_NURBS) { - if(nu->pntsu < nu->orderu) nu->orderu= nu->pntsu; - } - } - } - - } - - lastnu= NULL; /* for selected */ -} - -void make_editNurb() -{ - /* make copy of baseNurb in editNurb */ - Curve *cu=0; - Nurb *nu, *newnu; - KeyBlock *actkey; - - if(G.obedit==NULL) return; - - lastselbp= NULL; /* global for select row */ - - if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - freeNurblist(&editNurb); - - cu= G.obedit->data; - nu= cu->nurb.first; - - while(nu) { - newnu= duplicateNurb(nu); - test2DNurb(newnu); // after join, or any other creation of curve - BLI_addtail(&editNurb, newnu); - nu= nu->next; - } - - actkey = ob_get_keyblock(G.obedit); - if(actkey) { - strcpy(G.editModeTitleExtra, "(Key) "); - key_to_curve(actkey, cu, &editNurb); - } - } - else G.obedit= NULL; - - countall(); - - lastnu= NULL; /* for selected */ -} - -void remake_editNurb() -{ - - if(okee("Reload original data")==0) return; - - make_editNurb(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - - -void separate_nurb() -{ - Nurb *nu, *nu1; - Object *oldob; - Base *base, *oldbase; - Curve *cu; - ListBase editnurbo; - - if( G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return; - - if(okee("Separate")==0) return; - - waitcursor(1); - - cu= G.obedit->data; - if(cu->key) { - error("Can't separate a curve with vertex keys"); - return; - } - - /* we are going to trick everything as follows: - * 1. duplicate base: this is the new one, remember old pointer - * 2. set aside all NOT selected curves/nurbs - * 3. load_ebaseNurb(): this will be the new base - * 4. freelist and restore old nurbs - */ - - /* only edit-base selected */ - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->object==G.obedit) base->flag |= 1; - else base->flag &= ~1; - } - base= base->next; - } - - /* set aside: everything that is not selected */ - editnurbo.first= editnurbo.last= 0; - nu= editNurb.first; - while(nu) { - nu1= nu->next; - if(isNurbsel(nu)==0) { - BLI_remlink(&editNurb, nu); - BLI_addtail(&editnurbo, nu); - } - nu= nu1; - } - - oldob= G.obedit; - oldbase= BASACT; - - adduplicate(1, 0); /* no transform and zero so do get a linked dupli */ - - G.obedit= BASACT->object; /* basact is set in adduplicate() */ - - G.obedit->data= copy_curve(cu); - /* because new curve is a copy: reduce user count */ - cu->id.us--; - - load_editNurb(); - - BASACT->flag &= ~SELECT; - - if(editNurb.first) freeNurblist(&editNurb); - - editNurb= editnurbo; - - G.obedit= 0; /* displists behave different in edit mode */ - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); /* this is the separated one */ - DAG_object_flush_update(G.scene, oldob, OB_RECALC_DATA); /* this is the separated one */ - - G.obedit= oldob; - BASACT= oldbase; - BASACT->flag |= SELECT; - - waitcursor(0); - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - lastnu= NULL; /* for selected */ -} - -/* ******************* FLAGS ********************* */ - - -short isNurbselUV(Nurb *nu, int *u, int *v, int flag) -{ - /* return u!=-1: 1 row in u-direction selected. U has value between 0-pntsv - * return v!=-1: 1 collumn in v-direction selected. V has value between 0-pntsu - */ - BPoint *bp; - int a, b, sel; - - *u= *v= -1; - - bp= nu->bp; - for(b=0; bpntsv; b++) { - sel= 0; - for(a=0; apntsu; a++, bp++) { - if(bp->f1 & flag) sel++; - } - if(sel==nu->pntsu) { - if(*u== -1) *u= b; - else return 0; - } - else if(sel>1) return 0; /* because sel==1 is still ok */ - } - - for(a=0; apntsu; a++) { - sel= 0; - bp= nu->bp+a; - for(b=0; bpntsv; b++, bp+=nu->pntsu) { - if(bp->f1 & flag) sel++; - } - if(sel==nu->pntsv) { - if(*v== -1) *v= a; - else return 0; - } - else if(sel>1) return 0; - } - - if(*u==-1 && *v>-1) return 1; - if(*v==-1 && *u>-1) return 1; - return 0; -} - -void setflagsNurb(short flag) -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( (nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - bezt->f1= bezt->f2= bezt->f3= flag; - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - bp->f1= flag; - bp++; - } - } - } -} - -void rotateflagNurb(short flag, float *cent, float rotmat[][3]) -{ - /* all verts with (flag & 'flag') rotate */ - Nurb *nu; - BPoint *bp; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_NURBS) { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - - while(a--) { - if(bp->f1 & flag) { - bp->vec[0]-=cent[0]; - bp->vec[1]-=cent[1]; - bp->vec[2]-=cent[2]; - Mat3MulVecfl(rotmat, bp->vec); - bp->vec[0]+=cent[0]; - bp->vec[1]+=cent[1]; - bp->vec[2]+=cent[2]; - } - bp++; - } - } - } -} - - -void translateflagNurb(short flag, float *vec) -{ - /* all verts with ('flag' & flag) translate */ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( (nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if(bezt->f1 & flag) VecAddf(bezt->vec[0], bezt->vec[0], vec); - if(bezt->f2 & flag) VecAddf(bezt->vec[1], bezt->vec[1], vec); - if(bezt->f3 & flag) VecAddf(bezt->vec[2], bezt->vec[2], vec); - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if(bp->f1 & flag) VecAddf(bp->vec, bp->vec, vec); - bp++; - } - } - - test2DNurb(nu); - } -} - -void weightflagNurb(short flag, float w, int mode) /* mode==0: replace, mode==1: multiply */ -{ - Nurb *nu; - BPoint *bp; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_NURBS) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if(bp->f1 & flag) { - if(mode==1) bp->vec[3]*= w; - else bp->vec[3]= w; - } - bp++; - } - } - } -} - -void deleteflagNurb(short flag) -{ - Nurb *nu, *next; - BPoint *bp, *bpn, *newbp; - int a, b, newu, newv, sel; - - if(G.obedit && G.obedit->type==OB_SURF); - else return; - - lastselbp= NULL; - - nu= editNurb.first; - while(nu) { - next= nu->next; - - /* is entire nurb selected */ - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a) { - a--; - if(bp->f1 & flag); - else break; - bp++; - } - if(a==0) { - BLI_remlink(&editNurb, nu); - freeNurb(nu); - } - else { - /* is nurb in U direction selected */ - newv= nu->pntsv; - bp= nu->bp; - for(b=0; bpntsv; b++) { - sel= 0; - for(a=0; apntsu; a++, bp++) { - if(bp->f1 & flag) sel++; - } - if(sel==nu->pntsu) { - newv--; - } - else if(sel>=1) { - /* don't delete */ - break; - } - } - if(newv!=nu->pntsv && b==nu->pntsv) { - /* delete */ - bp= nu->bp; - bpn = newbp = - (BPoint*) MEM_mallocN(newv * nu->pntsu * sizeof(BPoint), "deleteNurb"); - for(b=0; bpntsv; b++) { - if((bp->f1 & flag)==0) { - memcpy(bpn, bp, nu->pntsu*sizeof(BPoint)); - bpn+= nu->pntsu; - } - bp+= nu->pntsu; - } - nu->pntsv= newv; - MEM_freeN(nu->bp); - nu->bp= newbp; - if(nu->orderv>nu->pntsv) nu->orderv= nu->pntsv; - - makeknots(nu, 2, nu->flagv>>1); - } - else { - /* is the nurb in V direction selected */ - newu= nu->pntsu; - for(a=0; apntsu; a++) { - bp= nu->bp+a; - sel= 0; - for(b=0; bpntsv; b++, bp+=nu->pntsu) { - if(bp->f1 & flag) sel++; - } - if(sel==nu->pntsv) { - newu--; - } - else if(sel>=1) { - /* don't delete */ - break; - } - } - if(newu!=nu->pntsu && a==nu->pntsu) { - /* delete */ - bp= nu->bp; - bpn = newbp = - (BPoint*) MEM_mallocN(newu * nu->pntsv * sizeof(BPoint), "deleteNurb"); - for(b=0; bpntsv; b++) { - for(a=0; apntsu; a++, bp++) { - if((bp->f1 & flag)==0) { - *bpn= *bp; - bpn++; - } - } - } - MEM_freeN(nu->bp); - nu->bp= newbp; - if(newu==1 && nu->pntsv>1) { /* make a U spline */ - nu->pntsu= nu->pntsv; - nu->pntsv= 1; - SWAP(short, nu->orderu, nu->orderv); - if(nu->orderu>nu->pntsu) nu->orderu= nu->pntsu; - if(nu->knotsv) MEM_freeN(nu->knotsv); - nu->knotsv= 0; - } - else { - nu->pntsu= newu; - if(nu->orderu>nu->pntsu) nu->orderu= nu->pntsu; - } - makeknots(nu, 1, nu->flagu>>1); - } - } - } - nu= next; - } -} - -short extrudeflagNurb(int flag) -{ - Nurb *nu; - BPoint *bp, *bpn, *newbp; - int ok= 0, a, u, v, len; - - if(G.obedit && G.obedit->type==OB_SURF); - else return 0; - - nu= editNurb.first; - while(nu) { - - if(nu->pntsv==1) { - bp= nu->bp; - a= nu->pntsu; - while(a) { - if(bp->f1 & flag); - else break; - bp++; - a--; - } - if(a==0) { - ok= 1; - newbp = - (BPoint*)MEM_mallocN(2 * nu->pntsu * sizeof(BPoint), "extrudeNurb1"); - memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint) ); - bp= newbp+ nu->pntsu; - memcpy(bp, nu->bp, nu->pntsu*sizeof(BPoint) ); - MEM_freeN(nu->bp); - nu->bp= newbp; - a= nu->pntsu; - while(a--) { - select_bpoint(bp, SELECT, flag, HIDDEN); - select_bpoint(newbp, DESELECT, flag, HIDDEN); - bp++; - newbp++; - } - - nu->pntsv= 2; - nu->orderv= 2; - makeknots(nu, 2, nu->flagv>>1); - } - } - else { - /* which row or collumn is selected */ - - if( isNurbselUV(nu, &u, &v, flag) ) { - - /* deselect all */ - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - select_bpoint(bp, DESELECT, flag, HIDDEN); - bp++; - } - - if(u==0 || u== nu->pntsv-1) { /* row in u-direction selected */ - ok= 1; - newbp = - (BPoint*) MEM_mallocN(nu->pntsu*(nu->pntsv + 1) - * sizeof(BPoint), "extrudeNurb1"); - if(u==0) { - len= nu->pntsv*nu->pntsu; - memcpy(newbp+nu->pntsu, nu->bp, len*sizeof(BPoint) ); - memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint) ); - bp= newbp; - } - else { - len= nu->pntsv*nu->pntsu; - memcpy(newbp, nu->bp, len*sizeof(BPoint) ); - memcpy(newbp+len, nu->bp+len-nu->pntsu, nu->pntsu*sizeof(BPoint) ); - bp= newbp+len; - } - - a= nu->pntsu; - while(a--) { - select_bpoint(bp, SELECT, flag, HIDDEN); - bp++; - } - - MEM_freeN(nu->bp); - nu->bp= newbp; - nu->pntsv++; - if(nu->resolv<3) nu->resolv++; - makeknots(nu, 2, nu->flagv>>1); - } - else if(v==0 || v== nu->pntsu-1) { /* collumn in v-direction selected */ - ok= 1; - bpn = newbp = - (BPoint*) MEM_mallocN((nu->pntsu + 1) * nu->pntsv * sizeof(BPoint), "extrudeNurb1"); - bp= nu->bp; - - for(a=0; apntsv; a++) { - if(v==0) { - *bpn= *bp; - bpn->f1 |= flag; - bpn++; - } - memcpy(bpn, bp, nu->pntsu*sizeof(BPoint)); - bp+= nu->pntsu; - bpn+= nu->pntsu; - if(v== nu->pntsu-1) { - *bpn= *(bp-1); - bpn->f1 |= flag; - bpn++; - } - } - - MEM_freeN(nu->bp); - nu->bp= newbp; - nu->pntsu++; - if(nu->resolu<3) nu->resolu++; - makeknots(nu, 1, nu->flagu>>1); - } - } - } - nu= nu->next; - } - - return ok; -} - -void adduplicateflagNurb(short flag) -{ - Nurb *nu, *newnu; - BezTriple *bezt, *bezt1; - BPoint *bp, *bp1; - int a, b, starta, enda, newu, newv; - char *usel; - - nu= editNurb.last; - while(nu) { - if( (nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - for(a=0; apntsu; a++) { - enda= -1; - starta= a; - while( (bezt->f1 & flag) || (bezt->f2 & flag) || (bezt->f3 & flag) ) { - select_beztriple(bezt, DESELECT, flag, HIDDEN); - enda=a; - if(a>=nu->pntsu-1) break; - a++; - bezt++; - } - if(enda>=starta) { - newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN"); - memcpy(newnu, nu, sizeof(Nurb)); - BLI_addtail(&editNurb, newnu); - lastnu= newnu; - newnu->pntsu= enda-starta+1; - newnu->bezt= - (BezTriple*)MEM_mallocN((enda - starta + 1) * sizeof(BezTriple), "adduplicateN"); - memcpy(newnu->bezt, nu->bezt+starta, newnu->pntsu*sizeof(BezTriple)); - - b= newnu->pntsu; - bezt1= newnu->bezt; - while(b--) { - select_beztriple(bezt1, SELECT, flag, HIDDEN); - bezt1++; - } - - if(nu->flagu & 1) { - if(starta!=0 || enda!=nu->pntsu-1) newnu->flagu--; - } - } - bezt++; - } - } - else if(nu->pntsv==1) { /* because UV Nurb has a different method for dupli */ - bp= nu->bp; - for(a=0; apntsu; a++) { - enda= -1; - starta= a; - while(bp->f1 & flag) { - select_bpoint(bp, DESELECT, flag, HIDDEN); - enda= a; - if(a>=nu->pntsu-1) break; - a++; - bp++; - } - if(enda>=starta) { - newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN3"); - memcpy(newnu, nu, sizeof(Nurb)); - lastnu= newnu; - BLI_addtail(&editNurb, newnu); - newnu->pntsu= enda-starta+1; - newnu->bp = (BPoint*)MEM_mallocN((enda-starta+1) * sizeof(BPoint), "adduplicateN4"); - memcpy(newnu->bp, nu->bp+starta, newnu->pntsu*sizeof(BPoint)); - - b= newnu->pntsu; - bp1= newnu->bp; - while(b--) { - select_bpoint(bp1, SELECT, flag, HIDDEN); - bp1++; - } - - if(nu->flagu & 1) { - if(starta!=0 || enda!=nu->pntsu-1) newnu->flagu--; - } - - /* knots */ - newnu->knotsu= 0; - makeknots(newnu, 1, newnu->flagu>>1); - } - bp++; - } - } - else { - /* a rectangular area in nurb has to be selected */ - if(isNurbsel(nu)) { - usel= MEM_callocN(nu->pntsu, "adduplicateN4"); - bp= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++, bp++) { - if(bp->f1 & flag) usel[b]++; - } - } - newu= 0; - newv= 0; - for(a=0; apntsu; a++) { - if(usel[a]) { - if(newv==0 || usel[a]==newv) { - newv= usel[a]; - newu++; - } - else { - newv= 0; - break; - } - } - } - if(newu==0 || newv==0) { - printf("Can't duplicate Nurb\n"); - } - else { - - if(newu==1) SWAP(short, newu, newv); - - newnu = (Nurb*)MEM_mallocN(sizeof(Nurb), "adduplicateN5"); - memcpy(newnu, nu, sizeof(Nurb)); - BLI_addtail(&editNurb, newnu); - lastnu= newnu; - newnu->pntsu= newu; - newnu->pntsv= newv; - newnu->bp = - (BPoint*)MEM_mallocN(newu * newv * sizeof(BPoint), "adduplicateN6"); - newnu->orderu= MIN2(nu->orderu, newu); - newnu->orderv= MIN2(nu->orderv, newv); - - bp= newnu->bp; - bp1= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++, bp1++) { - if(bp1->f1 & flag) { - memcpy(bp, bp1, sizeof(BPoint)); - select_bpoint(bp1, DESELECT, flag, HIDDEN); - bp++; - } - } - } - if(nu->pntsu==newnu->pntsu) { - newnu->knotsu= MEM_mallocN(sizeof(float)*KNOTSU(nu), "adduplicateN6"); - memcpy(newnu->knotsu, nu->knotsu, sizeof(float)*KNOTSU(nu)); - } - else { - newnu->knotsu= 0; - makeknots(newnu, 1, newnu->flagu>>1); - } - if(nu->pntsv==newnu->pntsv) { - newnu->knotsv= MEM_mallocN(sizeof(float)*KNOTSV(nu), "adduplicateN7"); - memcpy(newnu->knotsv, nu->knotsv, sizeof(float)*KNOTSV(nu)); - } - else { - newnu->knotsv= 0; - makeknots(newnu, 2, newnu->flagv>>1); - } - - } - MEM_freeN(usel); - } - } - - nu= nu->prev; - } - - /* lastnu changed */ - allqueue(REDRAWBUTSEDIT, 0); -} - - -void switchdirectionNurb2(void) -{ - Nurb *nu; - - if(G.vd==0 || !(G.obedit->lay & G.vd->lay)) - return; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( isNurbsel(nu) ) switchdirectionNurb(nu); - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Switch direction"); -} - -void switchdirection_knots(float *base, int tot) -{ - float *fp1, *fp2, *tempf; - int a; - - if(base==NULL || tot==0) return; - - /* reverse knots */ - a= tot; - fp1= base; - fp2= fp1+(a-1); - a/= 2; - while(fp1!=fp2 && a>0) { - SWAP(float, *fp1, *fp2); - a--; - fp1++; - fp2--; - } - /* and make in increasing order again */ - a= tot; - fp1= base; - fp2=tempf= MEM_mallocN(sizeof(float)*a, "switchdirect"); - while(a--) { - fp2[0]= fabs(fp1[1]-fp1[0]); - fp1++; - fp2++; - } - - a= tot-1; - fp1= base; - fp2= tempf; - fp1[0]= 0.0; - fp1++; - while(a--) { - fp1[0]= fp1[-1]+fp2[0]; - fp1++; - fp2++; - } - MEM_freeN(tempf); -} - -void setweightNurb(void) -{ - static float weight= 1.0f; - extern ListBase editNurb; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) { - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->bezt) { - for(bezt=nu->bezt, a=0; apntsu; a++, bezt++) { - if(bezt->f2 & SELECT) - bezt->weight= weight; - } - } - else if(nu->bp) { - for(bp=nu->bp, a=0; apntsu*nu->pntsv; a++, bp++) { - if(bp->f1 & SELECT) - bp->weight= weight; - } - } - } - } - BIF_undo_push("Set Curve Weight"); - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} - -void setradiusNurb( void ) -{ - static float radius= 1.0f; - extern ListBase editNurb; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - if(fbutton(&radius, 0.0001f, 10.0f, 10, 10, "Set Radius")) { - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->bezt) { - for(bezt=nu->bezt, a=0; apntsu; a++, bezt++) { - if(bezt->f2 & SELECT) - bezt->radius= radius; - } - } - else if(nu->bp) { - for(bp=nu->bp, a=0; apntsu*nu->pntsv; a++, bp++) { - if(bp->f1 & SELECT) - bp->radius= radius; - } - } - } - } - BIF_undo_push("Set Curve Radius"); - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ -} - - -/* TODO, make smoothing distance based */ -void smoothradiusNurb( void ) -{ - extern ListBase editNurb; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - /* use for smoothing */ - int last_sel; - int start_sel, end_sel; /* selection indicies, inclusive */ - float start_rad, end_rad, fac, range; - - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->bezt) { - - for (last_sel=0; last_sel < nu->pntsu; last_sel++) { - /* loop over selection segments of a curve, smooth each */ - - /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */ - start_sel = end_sel = -1; - for(bezt=nu->bezt+last_sel, a=last_sel; apntsu; a++, bezt++) { - if(bezt->f2 & SELECT) { - start_sel = a; - break; - } - } - /* incase there are no other selected verts */ - end_sel = start_sel; - for(bezt=nu->bezt+(start_sel+1), a=start_sel+1; apntsu; a++, bezt++) { - if((bezt->f2 & SELECT)==0) { - break; - } - end_sel = a; - } - - if (start_sel == -1) { - last_sel = nu->pntsu; /* next... */ - } else { - last_sel = end_sel; /* before we modify it */ - - /* now blend between start and end sel */ - start_rad = end_rad = -1.0; - - if (start_sel == end_sel) { - /* simple, only 1 point selected */ - if (start_sel>0) start_rad = (nu->bezt+start_sel-1)->radius; - if (end_sel!=-1 && end_sel < nu->pntsu) end_rad = (nu->bezt+start_sel+1)->radius; - - if (start_rad >= 0.0 && end_rad >= 0.0) (nu->bezt+start_sel)->radius = (start_rad + end_rad)/2; - else if (start_rad >= 0.0) (nu->bezt+start_sel)->radius = start_rad; - else if (end_rad >= 0.0) (nu->bezt+start_sel)->radius = end_rad; - } else { - /* if endpoints selected, then use them */ - if (start_sel==0) { - start_rad = (nu->bezt+start_sel)->radius; - start_sel++; /* we dont want to edit the selected endpoint */ - } else { - start_rad = (nu->bezt+start_sel-1)->radius; - } - if (end_sel==nu->pntsu-1) { - end_rad = (nu->bezt+end_sel)->radius; - end_sel--; /* we dont want to edit the selected endpoint */ - } else { - end_rad = (nu->bezt+end_sel+1)->radius; - } - - /* Now Blend between the points */ - range = (float)(end_sel - start_sel) + 2.0f; - for(bezt=nu->bezt+start_sel, a=start_sel; a<=end_sel; a++, bezt++) { - fac = (float)(1+a-start_sel) / range; - bezt->radius = start_rad*(1.0-fac) + end_rad*fac; - } - } - } - } - } else if (nu->bp) { - /* Same as above, keep these the same! */ - for (last_sel=0; last_sel < nu->pntsu; last_sel++) { - /* loop over selection segments of a curve, smooth each */ - - /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */ - start_sel = end_sel = -1; - for(bp=nu->bp+last_sel, a=last_sel; apntsu; a++, bp++) { - if(bp->f1 & SELECT) { - start_sel = a; - break; - } - } - /* incase there are no other selected verts */ - end_sel = start_sel; - for(bp=nu->bp+(start_sel+1), a=start_sel+1; apntsu; a++, bp++) { - if((bp->f1 & SELECT)==0) { - break; - } - end_sel = a; - } - - if (start_sel == -1) { - last_sel = nu->pntsu; /* next... */ - } else { - last_sel = end_sel; /* before we modify it */ - - /* now blend between start and end sel */ - start_rad = end_rad = -1.0; - - if (start_sel == end_sel) { - /* simple, only 1 point selected */ - if (start_sel>0) start_rad = (nu->bp+start_sel-1)->radius; - if (end_sel!=-1 && end_sel < nu->pntsu) end_rad = (nu->bp+start_sel+1)->radius; - - if (start_rad >= 0.0 && end_rad >= 0.0) (nu->bp+start_sel)->radius = (start_rad + end_rad)/2; - else if (start_rad >= 0.0) (nu->bp+start_sel)->radius = start_rad; - else if (end_rad >= 0.0) (nu->bp+start_sel)->radius = end_rad; - } else { - /* if endpoints selected, then use them */ - if (start_sel==0) { - start_rad = (nu->bp+start_sel)->radius; - start_sel++; /* we dont want to edit the selected endpoint */ - } else { - start_rad = (nu->bp+start_sel-1)->radius; - } - if (end_sel==nu->pntsu-1) { - end_rad = (nu->bp+end_sel)->radius; - end_sel--; /* we dont want to edit the selected endpoint */ - } else { - end_rad = (nu->bp+end_sel+1)->radius; - } - - /* Now Blend between the points */ - range = (float)(end_sel - start_sel) + 2.0f; - for(bp=nu->bp+start_sel, a=start_sel; a<=end_sel; a++, bp++) { - fac = (float)(1+a-start_sel) / range; - bp->radius = start_rad*(1.0-fac) + end_rad*fac; - } - } - } - } - } - } - BIF_undo_push("Smooth Curve Radius"); - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ -} - - - -/* **************** EDIT ************************ */ - -/* next == 1 -> select next */ -/* next == -1 -> select previous */ -/* cont == 1 -> select continuously */ -/* selstatus, inverts behaviour */ -static void select_adjacent_cp(short next, short cont, short selstatus) -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - short lastsel= 0, sel=0; - - if(next==0) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - lastsel=0; - if((nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - if(next < 0) bezt= (nu->bezt + (a-1)); - while(a--) { - if(a-abs(next) < 0) break; - sel= 0; - if((lastsel==0) && (bezt->hide==0) && ((bezt->f2 & SELECT) || (selstatus==0))) { - bezt+=next; - if(!(bezt->f2 & SELECT) || (selstatus==0)) { - sel= select_beztriple(bezt, selstatus, 1, VISIBLE); - if((sel==1) && (cont==0)) lastsel= 1; - } - } - else { - bezt+=next; - lastsel= 0; - } - /* move around in zigzag way so that we go through each */ - bezt-=(next-next/abs(next)); - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - if(next < 0) bp= (nu->bp + (a-1)); - while(a--) { - if(a-abs(next) < 0) break; - sel=0; - if((lastsel==0) && (bp->hide==0) && ((bp->f1 & SELECT) || (selstatus==0))) { - bp+=next; - if(!(bp->f1 & SELECT) || (selstatus==0)) { - sel= select_bpoint(bp, selstatus, 1, VISIBLE); - if((sel==1) && (cont==0)) lastsel= 1; - } - } - else { - bp+=next; - lastsel= 0; - } - /* move around in zigzag way so that we go through each */ - bp-=(next-next/abs(next)); - } - } - } -} - -static short nurb_has_selected_cps() -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if(bezt->hide==0) { - if((bezt->f1 & SELECT) - || (bezt->f2 & SELECT) - || (bezt->f3 & SELECT)) return 1; - } - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if((bp->hide==0) && (bp->f1 & SELECT)) return 1; - bp++; - } - } - } - - return 0; -} - -void deselectall_nurb() -{ - if(!G.vd || !(G.obedit->lay & G.vd->lay)) - return; - - if(nurb_has_selected_cps()) { /* deselect all */ - selectend_nurb(FIRST, 0, DESELECT); /* set first control points as unselected */ - select_adjacent_cp(1, 1, DESELECT); /* cascade selection */ - } - else { /* select all */ - selectend_nurb(FIRST, 0, SELECT); /* set first control points as selected */ - select_adjacent_cp(1, 1, SELECT); /* cascade selection */ - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Deselect all"); -} - -void hideNurb(int swap) -{ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a, sel; - - if(G.obedit==0) return; - - BIF_undo_push("Hide"); - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - sel= 0; - while(a--) { - if(BEZSELECTED_HIDDENHANDLES(bezt)) { - select_beztriple(bezt, DESELECT, 1, HIDDEN); - bezt->hide= 1; - } - if(bezt->hide) sel++; - bezt++; - } - if(sel==nu->pntsu) nu->hide= 1; - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - sel= 0; - while(a--) { - if(swap==0 && (bp->f1 & SELECT)) { - select_bpoint(bp, DESELECT, 1, HIDDEN); - bp->hide= 1; - } - else if(swap && (bp->f1 & SELECT)==0) { - select_bpoint(bp, DESELECT, 1, HIDDEN); - bp->hide= 1; - } - if(bp->hide) sel++; - bp++; - } - if(sel==nu->pntsu*nu->pntsv) nu->hide= 1; - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - -void revealNurb() -{ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - - if(G.obedit==0) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - nu->hide= 0; - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->hide) { - select_beztriple(bezt, SELECT, 1, HIDDEN); - bezt->hide= 0; - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->hide) { - select_bpoint(bp, SELECT, 1, HIDDEN); - bp->hide= 0; - } - bp++; - } - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Reveal"); - -} - -void selectswapNurb() -{ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - - if(G.obedit==0) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->hide==0) { - bezt->f2 ^= SELECT; /* always do the center point */ - if ((G.f & G_HIDDENHANDLES)==0) { - bezt->f1 ^= SELECT; - bezt->f3 ^= SELECT; - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - swap_selection_bpoint(bp); - bp++; - } - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select swap"); - -} - -/** Divide the line segments associated with the currently selected - * curve nodes (Bezier or NURB). If there are no valid segment - * selections within the current selection, nothing happens. - * - * @deffunc subdividenurb subdivideNurb(void) - * @return Nothing - * @param None -*/ -void subdivideNurb() -{ - Nurb *nu; - BezTriple *prevbezt, *bezt, *beztnew, *beztn; - BPoint *bp, *prevbp, *bpnew, *bpn; - float vec[15]; - int a, b, sel, amount, *usel, *vsel; - - // printf("*** subdivideNurb: entering subdivide\n"); - - for(nu= editNurb.first; nu; nu= nu->next) { - amount= 0; - if((nu->type & 7)==CU_BEZIER) { - /* - Insert a point into a 2D Bezier curve. - Endpoints are preserved. Otherwise, all selected and inserted points are - newly created. Old points are discarded. - */ - /* count */ - if(nu->flagu & 1) { - a= nu->pntsu; - bezt= nu->bezt; - prevbezt= bezt+(a-1); - } - else { - a= nu->pntsu-1; - prevbezt= nu->bezt; - bezt= prevbezt+1; - } - while(a--) { - if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) amount++; - prevbezt= bezt; - bezt++; - } - - if(amount) { - /* insert */ - beztnew = - (BezTriple*)MEM_mallocN((amount + nu->pntsu) * sizeof(BezTriple), "subdivNurb"); - beztn= beztnew; - if(nu->flagu & 1) { - a= nu->pntsu; - bezt= nu->bezt; - prevbezt= bezt+(a-1); - } - else { - a= nu->pntsu-1; - prevbezt= nu->bezt; - bezt= prevbezt+1; - } - while(a--) { - memcpy(beztn, prevbezt, sizeof(BezTriple)); - beztn++; - - if( BEZSELECTED_HIDDENHANDLES(prevbezt) && BEZSELECTED_HIDDENHANDLES(bezt) ) { - memcpy(beztn, bezt, sizeof(BezTriple)); - - /* midpoint subdividing */ - VecMidf(vec, prevbezt->vec[1], prevbezt->vec[2]); - VecMidf(vec+3, prevbezt->vec[2], bezt->vec[0]); - VecMidf(vec+6, bezt->vec[0], bezt->vec[1]); - - VecMidf(vec+9, vec, vec+3); - VecMidf(vec+12, vec+3, vec+6); - - /* change handle of prev beztn */ - VECCOPY((beztn-1)->vec[2], vec); - /* new point */ - VECCOPY(beztn->vec[0], vec+9); - VecMidf(beztn->vec[1], vec+9, vec+12); - VECCOPY(beztn->vec[2], vec+12); - /* handle of next bezt */ - if(a==0 && (nu->flagu & 1)) {VECCOPY(beztnew->vec[0], vec+6);} - else {VECCOPY(bezt->vec[0], vec+6);} - - beztn->radius = (prevbezt->radius + bezt->radius)/2.0f; - beztn->weight = (prevbezt->weight + bezt->weight)/2.0f; - - beztn++; - } - - prevbezt= bezt; - bezt++; - } - /* last point */ - if((nu->flagu & 1)==0) memcpy(beztn, prevbezt, sizeof(BezTriple)); - - MEM_freeN(nu->bezt); - nu->bezt= beztnew; - nu->pntsu+= amount; - - calchandlesNurb(nu); - } - } /* End of 'if((nu->type & 7)==CU_BEZIER)' */ - else if (nu->pntsv==1) { - /* - All flat lines (ie. co-planar), except flat Nurbs. Flat NURB curves - are handled together with the regular NURB plane division, as it - should be. I split it off just now, let's see if it is - stable... nzc 30-5-'00 - */ - /* count */ - if(nu->flagu & 1) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - prevbp= bp+(a-1); - } - else { - a= nu->pntsu-1; - prevbp= nu->bp; - bp= prevbp+1; - } - while(a--) { - if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) amount++; - prevbp= bp; - bp++; - } - - if(amount) { - /* insert */ - bpnew = - (BPoint*)MEM_mallocN((amount + nu->pntsu) * sizeof(BPoint), "subdivNurb2"); - bpn= bpnew; - - if(nu->flagu & 1) { - a= nu->pntsu; - bp= nu->bp; - prevbp= bp+(a-1); - } - else { - a= nu->pntsu-1; - prevbp= nu->bp; - bp= prevbp+1; - } - while(a--) { - memcpy(bpn, prevbp, sizeof(BPoint)); - bpn++; - - if( (bp->f1 & SELECT) && (prevbp->f1 & SELECT) ) { - // printf("*** subdivideNurb: insert 'linear' point\n"); - memcpy(bpn, bp, sizeof(BPoint)); - bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0; - bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0; - bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0; - bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0; - bpn++; - - } - prevbp= bp; - bp++; - } - if((nu->flagu & 1)==0) memcpy(bpn, prevbp, sizeof(BPoint)); /* last point */ - - MEM_freeN(nu->bp); - nu->bp= bpnew; - nu->pntsu+= amount; - - if(nu->type & 4) { - makeknots(nu, 1, nu->flagu>>1); - } - } - } /* End of 'else if(nu->pntsv==1)' */ - else if((nu->type & 7)==CU_NURBS) { - /* This is a very strange test ... */ - /** - Subdivide NURB surfaces - nzc 30-5-'00 - - - Subdivision of a NURB curve can be effected by adding a - control point (insertion of a knot), or by raising the - degree of the functions used to build the NURB. The - expression - - degree = #knots - #controlpoints + 1 (J Walter piece) - degree = #knots - #controlpoints (Blender - implementation) - ( this is confusing.... what is true? Another concern - is that the JW piece allows the curve to become - explicitly 1st order derivative discontinuous, while - this is not what we want here... ) - - is an invariant for a single NURB curve. Raising the degree - of the NURB is done elsewhere; the degree is assumed - constant during this opration. Degree is a property shared - by all controlpoints in a curve (even though it is stored - per control point - this can be misleading). - Adding a knot is done by searching for the place in the - knot vector where a certain knot value must be inserted, or - by picking an appropriate knot value between two existing - ones. The number of controlpoints that is influenced by the - insertion depends on the order of the curve. A certain - minimum number of knots is needed to form high-order - curves, as can be seen from the equation above. In Blender, - currently NURBs may be up to 6th order, so we modify at - most 6 points. One point is added. For an n-degree curve, - n points are discarded, and n+1 points inserted - (so effectively, n points are modified). (that holds for - the JW piece, but it seems not for our NURBs) - In practice, the knot spacing is copied, but the tail - (the points following the insertion point) need to be - offset to keep the knot series ascending. The knot series - is always a series of monotonically ascending integers in - Blender. When not enough control points are available to - fit the order, duplicates of the endpoints are added as - needed. - */ - /* selection-arrays */ - usel= MEM_callocN(sizeof(int)*nu->pntsu, "subivideNurb3"); - vsel= MEM_callocN(sizeof(int)*nu->pntsv, "subivideNurb3"); - sel= 0; - - /* Count the number of selected points. */ - bp= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++) { - if(bp->f1 & SELECT) { - usel[b]++; - vsel[a]++; - sel++; - } - bp++; - } - } - if( sel == (nu->pntsu*nu->pntsv) ) { /* subdivide entire nurb */ - /* Global subdivision is a special case of partial - subdivision. Strange it is considered separately... */ - bpn=bpnew= MEM_mallocN( (2*nu->pntsu-1)*(2*nu->pntsv-1)*sizeof(BPoint), "subdivideNurb4"); - bp= nu->bp; - /* first subdivide rows */ - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++) { - *bpn= *bp; - bpn++; - bp++; - if(bpntsu-1) { - *bpn= *bp; - prevbp= bp-1; - bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0; - bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0; - bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0; - bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0; - bpn++; - } - } - bpn+= (2*nu->pntsu-1); - } - /* now insert new */ - bpn= bpnew+(2*nu->pntsu-1); - bp= bpnew+(4*nu->pntsu-2); - prevbp= bpnew; - for(a=1; apntsv; a++) { - - for(b=0; b<2*nu->pntsu-1; b++) { - *bpn= *bp; - bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0; - bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0; - bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0; - bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0; - bpn++; - bp++; - prevbp++; - } - bp+= (2*nu->pntsu-1); - bpn+= (2*nu->pntsu-1); - prevbp+= (2*nu->pntsu-1); - } - MEM_freeN(nu->bp); - nu->bp= bpnew; - nu->pntsu= 2*nu->pntsu-1; - nu->pntsv= 2*nu->pntsv-1; - makeknots(nu, 1, nu->flagu>>1); - makeknots(nu, 2, nu->flagv>>1); - } /* End of 'if(sel== nu->pntsu*nu->pntsv)' (subdivide entire NURB) */ - else { - /* subdivide in v direction? */ - sel= 0; - for(a=0; apntsv-1; a++) { - if(vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu) sel++; - } - - if(sel) { /* V ! */ - bpn=bpnew= MEM_mallocN( (sel+nu->pntsv)*nu->pntsu*sizeof(BPoint), "subdivideNurb4"); - bp= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++) { - *bpn= *bp; - bpn++; - bp++; - } - if( (apntsv-1) && vsel[a]==nu->pntsu && vsel[a+1]==nu->pntsu ) { - prevbp= bp- nu->pntsu; - for(b=0; bpntsu; b++) { - /* - This simple bisection must be replaces by a - subtle resampling of a number of points. Our - task is made slightly easier because each - point in our curve is a separate data - node. (is it?) - */ - *bpn= *prevbp; - bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0; - bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0; - bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0; - bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0; - bpn++; - prevbp++; - bp++; - } - bp-= nu->pntsu; - } - } - MEM_freeN(nu->bp); - nu->bp= bpnew; - nu->pntsv+= sel; - makeknots(nu, 2, nu->flagv>>1); - } - else { - /* or in u direction? */ - sel= 0; - for(a=0; apntsu-1; a++) { - if(usel[a]==nu->pntsv && usel[a+1]==nu->pntsv) sel++; - } - - if(sel) { /* U ! */ - /* Inserting U points is sort of 'default' Flat curves only get */ - /* U points inserted in them. */ - bpn=bpnew= MEM_mallocN( (sel+nu->pntsu)*nu->pntsv*sizeof(BPoint), "subdivideNurb4"); - bp= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++) { - *bpn= *bp; - bpn++; - bp++; - if( (bpntsu-1) && usel[b]==nu->pntsv && usel[b+1]==nu->pntsv ) { - /* - One thing that bugs me here is that the - orders of things are not the same as in - the JW piece. Also, this implies that we - handle at most 3rd order curves? I miss - some symmetry here... - */ - prevbp= bp- 1; - *bpn= *prevbp; - bpn->vec[0]= (prevbp->vec[0]+bp->vec[0])/2.0; - bpn->vec[1]= (prevbp->vec[1]+bp->vec[1])/2.0; - bpn->vec[2]= (prevbp->vec[2]+bp->vec[2])/2.0; - bpn->vec[3]= (prevbp->vec[3]+bp->vec[3])/2.0; - bpn++; - } - } - } - MEM_freeN(nu->bp); - nu->bp= bpnew; - nu->pntsu+= sel; - makeknots(nu, 1, nu->flagu>>1); /* shift knots - forward */ - } - } - } - MEM_freeN(usel); - MEM_freeN(vsel); - - } /* End of 'if((nu->type & 7)==CU_NURBS)' */ - } - - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Subdivide"); - -} - -static void findnearestNurbvert__doClosest(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) -{ - struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; short dist, hpoint, select, mval[2]; } *data = userData; - - short flag; - short temp; - - if (bp) { - flag = bp->f1; - } else { - if (beztindex==0) { - flag = bezt->f1; - } else if (beztindex==1) { - flag = bezt->f2; - } else { - flag = bezt->f3; - } - } - - temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - if ((flag&1)==data->select) temp += 5; - if (bezt && beztindex==1) temp += 3; /* middle points get a small disadvantage */ - - if (tempdist) { - data->dist = temp; - - data->bp = bp; - data->bezt = bezt; - data->nurb = nu; - data->hpoint = bezt?beztindex:0; - } -} - -static short findnearestNurbvert(short sel, Nurb **nurb, BezTriple **bezt, BPoint **bp) -{ - /* sel==1: selected gets a disadvantage */ - /* in nurb and bezt or bp the nearest is written */ - /* return 0 1 2: handlepunt */ - struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; short dist, hpoint, select, mval[2]; } data = {0}; - - data.dist = 100; - data.hpoint = 0; - data.select = sel; - getmouseco_areawin(data.mval); - - nurbs_foreachScreenVert(findnearestNurbvert__doClosest, &data); - - *nurb = data.nurb; - *bezt = data.bezt; - *bp = data.bp; - - return data.hpoint; -} - - -static void findselectedNurbvert(Nurb **nu, BezTriple **bezt, BPoint **bp) -{ - /* in nu and (bezt or bp) selected are written if there's 1 sel. */ - /* if more points selected in 1 spline: return only nu, bezt and bp are 0 */ - Nurb *nu1; - BezTriple *bezt1; - BPoint *bp1; - int a; - - *nu= 0; - *bezt= 0; - *bp= 0; - for(nu1= editNurb.first; nu1; nu1= nu1->next) { - if((nu1->type & 7)==CU_BEZIER) { - bezt1= nu1->bezt; - a= nu1->pntsu; - while(a--) { - if( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) { - if(*nu!=0 && *nu!= nu1) { - *nu= 0; - *bp= 0; - *bezt= 0; - return; - } - else if(*bezt || *bp) { - *bp= 0; - *bezt= 0; - } - else { - *bezt= bezt1; - *nu= nu1; - } - } - bezt1++; - } - } - else { - bp1= nu1->bp; - a= nu1->pntsu*nu1->pntsv; - while(a--) { - if( bp1->f1 & 1 ) { - if(*nu!=0 && *nu!= nu1) { - *bp= 0; - *bezt= 0; - *nu= 0; - return; - } - else if(*bezt || *bp) { - *bp= 0; - *bezt= 0; - } - else { - *bp= bp1; - *nu= nu1; - } - } - bp1++; - } - } - } -} - -int convertspline(short type, Nurb *nu) -{ - BezTriple *bezt; - BPoint *bp; - int a, c, nr; - - if((nu->type & 7)==0) { /* Poly */ - if(type==CU_BEZIER) { /* to Bezier with vecthandles */ - nr= nu->pntsu; - bezt = - (BezTriple*)MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2"); - nu->bezt= bezt; - a= nr; - bp= nu->bp; - while(a--) { - VECCOPY(bezt->vec[1], bp->vec); - bezt->f1=bezt->f2=bezt->f3= bp->f1; - bezt->h1= bezt->h2= HD_VECT; - bezt->weight= bp->weight; - bezt->radius= bp->radius; - bp++; - bezt++; - } - MEM_freeN(nu->bp); - nu->bp= 0; - nu->pntsu= nr; - nu->type &= ~7; - nu->type |= 1; - calchandlesNurb(nu); - } - else if(type==4) { /* to Nurb */ - nu->type &= ~7; - nu->type+= 4; - nu->orderu= 4; - nu->flagu &= 1; - nu->flagu += 4; - makeknots(nu, 1, nu->flagu>>1); - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - bp->vec[3]= 1.0; - bp++; - } - } - } - else if((nu->type & 7)==CU_BEZIER) { /* Bezier */ - if(type==0 || type==4) { /* to Poly or Nurb */ - nr= 3*nu->pntsu; - nu->bp = MEM_callocN(nr * sizeof(BPoint), "setsplinetype"); - a= nu->pntsu; - bezt= nu->bezt; - bp= nu->bp; - while(a--) { - if(type==0 && bezt->h1==HD_VECT && bezt->h2==HD_VECT) { - /* vector handle becomes 1 poly vertice */ - VECCOPY(bp->vec, bezt->vec[1]); - bp->vec[3]= 1.0; - bp->f1= bezt->f2; - nr-= 2; - bp->radius= bezt->radius; - bp->weight= bezt->weight; - bp++; - } - else { - for(c=0;c<3;c++) { - VECCOPY(bp->vec, bezt->vec[c]); - bp->vec[3]= 1.0; - if(c==0) bp->f1= bezt->f1; - else if(c==1) bp->f1= bezt->f2; - else bp->f1= bezt->f3; - bp->radius= bezt->radius; - bp->weight= bezt->weight; - bp++; - } - } - bezt++; - } - MEM_freeN(nu->bezt); - nu->bezt= 0; - nu->pntsu= nr; - nu->pntsv= 1; - nu->orderu= 4; - nu->orderv= 1; - nu->type &= ~7; - nu->type+= type; - if(nu->flagu & 1) c= nu->orderu-1; - else c= 0; - if(type== 4) { - nu->flagu &= 1; - nu->flagu += 4; - makeknots(nu, 1, nu->flagu>>1); - } - } - } - else if( (nu->type & 7)==CU_NURBS) { - if(type==0) { /* to Poly */ - nu->type &= ~7; - if(nu->knotsu) MEM_freeN(nu->knotsu); /* python created nurbs have a knotsu of zero */ - nu->knotsu= 0; - if(nu->knotsv) MEM_freeN(nu->knotsv); - nu->knotsv= 0; - } - else if(type==CU_BEZIER) { /* to Bezier */ - nr= nu->pntsu/3; - - if(nr<2) - return 1; /* conversion impossible */ - else { - bezt = MEM_callocN(nr * sizeof(BezTriple), "setsplinetype2"); - nu->bezt= bezt; - a= nr; - bp= nu->bp; - while(a--) { - VECCOPY(bezt->vec[0], bp->vec); - bezt->f1= bp->f1; - bp++; - VECCOPY(bezt->vec[1], bp->vec); - bezt->f2= bp->f1; - bp++; - VECCOPY(bezt->vec[2], bp->vec); - bezt->f3= bp->f1; - bezt->radius= bp->radius; - bezt->weight= bp->weight; - bp++; - bezt++; - } - MEM_freeN(nu->bp); - nu->bp= 0; - MEM_freeN(nu->knotsu); - nu->knotsu= 0; - nu->pntsu= nr; - nu->type &= ~7; - nu->type+= 1; - } - } - } - return 0; -} - -void setsplinetype(short type) -{ - Nurb *nu; - - if(type==CU_CARDINAL || type==CU_BSPLINE) { - error("Not implemented yet"); - return; - } - - for(nu= editNurb.first; nu; nu= nu->next) { - if(isNurbsel(nu)) { - if (convertspline(type, nu)) - error("no conversion possible"); - } - } - BIF_undo_push("Set spline type"); - -} - -/* ******************** SKINNING LOFTING!!! ******************** */ - -void rotate_direction_nurb(Nurb *nu) -{ - BPoint *bp1, *bp2, *temp; - int u, v; - - SWAP(short, nu->pntsu, nu->pntsv); - SWAP(short, nu->orderu, nu->orderv); - SWAP(short, nu->resolu, nu->resolv); - SWAP(short, nu->flagu, nu->flagv); - - SWAP(float *, nu->knotsu, nu->knotsv); - switchdirection_knots(nu->knotsv, KNOTSV(nu) ); - - temp= MEM_dupallocN(nu->bp); - bp1= nu->bp; - for(v=0; vpntsv; v++) { - for(u=0; upntsu; u++, bp1++) { - bp2= temp + (nu->pntsu-u-1)*(nu->pntsv) + v; - *bp1= *bp2; - } - } - - MEM_freeN(temp); -} - -int is_u_selected(Nurb *nu, int u) -{ - BPoint *bp; - int v; - - /* what about resolu == 2? */ - bp= nu->bp+u; - for(v=0; vpntsv-1; v++, bp+=nu->pntsu) { - if(v) if(bp->f1 & SELECT) return 1; - } - - return 0; -} - -/* ******************************** */ - -typedef struct NurbSort { - struct NurbSort *next, *prev; - Nurb *nu; - float vec[3]; -} NurbSort; - -static ListBase nsortbase= {0, 0}; -/* static NurbSort *nusmain; */ /* this var seems to go unused... at least in this file */ - -void make_selection_list_nurb() -{ - ListBase nbase= {0, 0}; - NurbSort *nus, *nustest, *headdo, *taildo; - Nurb *nu; - BPoint *bp; - float dist, headdist, taildist; - int a; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( isNurbsel(nu) ) { - - nus = (NurbSort*)MEM_callocN(sizeof(NurbSort), "sort"); - BLI_addhead(&nbase, nus); - nus->nu= nu; - - bp= nu->bp; - a= nu->pntsu; - while(a--) { - VecAddf(nus->vec, nus->vec, bp->vec); - bp++; - } - VecMulf(nus->vec, 1.0/(float)nu->pntsu); - - - } - } - - /* just add the first one */ - nus= nbase.first; - BLI_remlink(&nbase, nus); - BLI_addtail( &nsortbase, nus); - - /* now add, either at head or tail, the closest one */ - while(nbase.first) { - - headdist= taildist= 1.0e30; - headdo= taildo= 0; - - nustest= nbase.first; - while(nustest) { - dist= VecLenf(nustest->vec, ((NurbSort *)nsortbase.first)->vec); - - if(distvec, ((NurbSort *)nsortbase.last)->vec); - - if(distnext; - } - - if(headdistpntsu-1) ); - else { - rotate_direction_nurb(nu1); - if( is_u_selected(nu1, nu1->pntsu-1) ); - else { - rotate_direction_nurb(nu1); - if( is_u_selected(nu1, nu1->pntsu-1) ); - else { - rotate_direction_nurb(nu1); - if( is_u_selected(nu1, nu1->pntsu-1) ); - else { - /* rotate again, now its OK! */ - if(nu1->pntsv!=1) rotate_direction_nurb(nu1); - return; - } - } - } - } - - /* 2nd nurbs: u = 0 selected */ - if( is_u_selected(nu2, 0) ); - else { - rotate_direction_nurb(nu2); - if( is_u_selected(nu2, 0) ); - else { - rotate_direction_nurb(nu2); - if( is_u_selected(nu2, 0) ); - else { - rotate_direction_nurb(nu2); - if( is_u_selected(nu2, 0) ); - else { - /* rotate again, now its OK! */ - if(nu1->pntsu==1) rotate_direction_nurb(nu1); - if(nu2->pntsv!=1) rotate_direction_nurb(nu2); - return; - } - } - } - } - - if( nu1->pntsv != nu2->pntsv ) { - error("Resolution doesn't match"); - return; - } - - /* ok, now nu1 has the rightmost collumn and nu2 the leftmost collumn selected */ - /* maybe we need a 'v' flip of nu2? */ - - bp1= nu1->bp+nu1->pntsu-1; - bp2= nu2->bp; - len1= 0.0; - - for(v=0; vpntsv; v++, bp1+=nu1->pntsu, bp2+=nu2->pntsu) { - len1+= VecLenf(bp1->vec, bp2->vec); - } - - bp1= nu1->bp + nu1->pntsu-1; - bp2= nu2->bp + nu2->pntsu*(nu2->pntsv-1); - len2= 0.0; - - for(v=0; vpntsv; v++, bp1+=nu1->pntsu, bp2-=nu2->pntsu) { - len2+= VecLenf(bp1->vec, bp2->vec); - } - - /* merge */ - origu= nu1->pntsu; - nu1->pntsu+= nu2->pntsu; - nu1->resolu+= nu2->pntsu; - if(nu1->resolv < nu2->resolv) nu1->resolv= nu2->resolv; - if(nu1->orderu<3) nu1->orderu++; - if(nu1->orderv<3) nu1->orderv++; - temp= nu1->bp; - nu1->bp= MEM_mallocN(nu1->pntsu*nu1->pntsv*sizeof(BPoint), "mergeBP"); - - bp= nu1->bp; - bp1= temp; - - for(v=0; vpntsv; v++) { - - /* switch direction? */ - if(len1bp + v*nu2->pntsu; - else bp2= nu2->bp + (nu1->pntsv-v-1)*nu2->pntsu; - - for(u=0; upntsu; u++, bp++) { - if(utype & 7)==4) { - /* merge knots */ - makeknots(nu1, 1, nu1->flagu>>1); - - /* make knots, for merged curved for example */ - makeknots(nu1, 2, nu1->flagv>>1); - } - - MEM_freeN(temp); - BLI_remlink(&editNurb, nu2); - freeNurb(nu2); -} - -void merge_nurb() -{ - NurbSort *nus1, *nus2; - int ok= 1; - - make_selection_list_nurb(); - - if(nsortbase.first == nsortbase.last) { - BLI_freelistN(&nsortbase); - error("Too few selections to merge"); - return; - } - - nus1= nsortbase.first; - nus2= nus1->next; - - /* resolution match, to avoid uv rotations */ - if(nus1->nu->pntsv==1) { - if(nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsu==nus2->nu->pntsv); - else ok= 0; - } - else if(nus2->nu->pntsv==1) { - if(nus2->nu->pntsu==nus1->nu->pntsu || nus2->nu->pntsu==nus1->nu->pntsv); - else ok= 0; - } - else if( nus1->nu->pntsu==nus2->nu->pntsu || nus1->nu->pntsv==nus2->nu->pntsv); - else if( nus1->nu->pntsu==nus2->nu->pntsv || nus1->nu->pntsv==nus2->nu->pntsu); - else { - ok= 0; - } - - if(ok==0) { - error("Resolution doesn't match"); - BLI_freelistN(&nsortbase); - return; - } - - while(nus2) { - merge_2_nurb(nus1->nu, nus2->nu); - nus2= nus2->next; - } - - BLI_freelistN(&nsortbase); - - countall(); - lastnu= NULL; - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Merge"); - -} - - -void addsegment_nurb() -{ - /* joins 2 curves */ - Nurb *nu, *nu1=0, *nu2=0; - BezTriple *bezt; - BPoint *bp; - float *fp, offset; - int a; - - /* first decide if this is a surface merge! */ - if(G.obedit->type==OB_SURF) nu= editNurb.first; - else nu= NULL; - - while(nu) { - if( isNurbsel(nu) ) { - - if(nu->pntsu>1 && nu->pntsv>1) break; - if(isNurbsel_count(nu)>1) break; - if(isNurbsel_count(nu)==1) { - /* only 1 selected, not first or last, a little complex, but intuitive */ - if(nu->pntsv==1) { - if( (nu->bp->f1 & SELECT) || ((nu->bp+nu->pntsu-1)->f1 & SELECT)); - else break; - } - } - } - nu= nu->next; - } - if(nu) { - merge_nurb(); - return; - } - - /* find both nurbs and points, nu1 will be put behind nu2 */ - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->flagu & 1)==0) { /* not cyclic */ - if( (nu->type & 7)==CU_BEZIER ) { - bezt= nu->bezt; - if(nu1==0) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ) nu1= nu; - else { - bezt= bezt+(nu->pntsu-1); - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - nu1= nu; - switchdirectionNurb(nu); - } - } - } - else if(nu2==0) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - nu2= nu; - switchdirectionNurb(nu); - } - else { - bezt= bezt+(nu->pntsu-1); - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - nu2= nu; - } - } - } - else break; - } - else if(nu->pntsv==1) { - bp= nu->bp; - if(nu1==0) { - if( bp->f1 & SELECT) nu1= nu; - else { - bp= bp+(nu->pntsu-1); - if( bp->f1 & SELECT ) { - nu1= nu; - switchdirectionNurb(nu); - } - } - } - else if(nu2==0) { - if( bp->f1 & SELECT ) { - nu2= nu; - switchdirectionNurb(nu); - } - else { - bp= bp+(nu->pntsu-1); - if( bp->f1 & SELECT ) { - nu2= nu; - } - } - } - else break; - } - } - } - - if((nu1 && nu2) && (nu1!=nu2)) { - if( nu1->type==nu2->type) { - if((nu1->type & 7)==CU_BEZIER) { - bezt = - (BezTriple*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BezTriple), "addsegmentN"); - memcpy(bezt, nu2->bezt, nu2->pntsu*sizeof(BezTriple)); - memcpy(bezt+nu2->pntsu, nu1->bezt, nu1->pntsu*sizeof(BezTriple)); - MEM_freeN(nu1->bezt); - nu1->bezt= bezt; - nu1->pntsu+= nu2->pntsu; - BLI_remlink(&editNurb, nu2); - freeNurb(nu2); - calchandlesNurb(nu1); - } - else { - bp = - (BPoint*)MEM_mallocN((nu1->pntsu+nu2->pntsu) * sizeof(BPoint), "addsegmentN2"); - memcpy(bp, nu2->bp, nu2->pntsu*sizeof(BPoint) ); - memcpy(bp+nu2->pntsu, nu1->bp, nu1->pntsu*sizeof(BPoint)); - MEM_freeN(nu1->bp); - nu1->bp= bp; - - a= nu1->pntsu+nu1->orderu; - - nu1->pntsu+= nu2->pntsu; - BLI_remlink(&editNurb, nu2); - - /* now join the knots */ - if((nu1->type & 7)==4) { - if(nu1->knotsu==NULL) { - makeknots(nu1, 1, nu1->flagu>>1); - } - else { - fp= MEM_mallocN(sizeof(float)*KNOTSU(nu1), "addsegment3"); - memcpy(fp, nu1->knotsu, sizeof(float)*a); - MEM_freeN(nu1->knotsu); - nu1->knotsu= fp; - - - offset= nu1->knotsu[a-1] +1.0; - fp= nu1->knotsu+a; - for(a=0; apntsu; a++, fp++) { - if(nu2->knotsu) - *fp= offset+nu2->knotsu[a+1]; - else - *fp = offset; - } - } - } - freeNurb(nu2); - } - } - - lastnu= NULL; /* for selected */ - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Add segment"); - - } - else error("Can't make segment"); -} - -void mouse_nurb() -{ - Nurb *nu; - BezTriple *bezt=0; - BPoint *bp=0; - short hand; - - hand= findnearestNurbvert(1, &nu, &bezt, &bp); - - if(bezt || bp) { - if((G.qual & LR_SHIFTKEY)==0) { - - setflagsNurb(0); - - if(bezt) { - - if(hand==1) select_beztriple(bezt, SELECT, 1, HIDDEN); - else if(hand==0) bezt->f1|= SELECT; - else bezt->f3|= SELECT; - } - else { - lastselbp= bp; - select_bpoint(bp, SELECT, 1, HIDDEN); - } - - allqueue(REDRAWVIEW3D, 0); - } - else { - if(bezt) { - if(hand==1) { - if(bezt->f2 & SELECT) select_beztriple(bezt, DESELECT, 1, HIDDEN); - else select_beztriple(bezt, SELECT, 1, HIDDEN); - } else if(hand==0) { - bezt->f1 ^= SELECT; - } else { - bezt->f3 ^= SELECT; - } - } - else { - if(bp->f1 & SELECT) select_bpoint(bp, DESELECT, 1, HIDDEN); - else { - select_bpoint(bp, SELECT, 1, HIDDEN); - lastselbp= bp; - } - } - - allqueue(REDRAWVIEW3D, 0); - - } - - countall(); - } - - rightmouse_transform(); - - if(nu!=lastnu) { - lastnu= nu; - allqueue(REDRAWBUTSEDIT, 0); - } - -} - -/* from what I can gather, the mode==0 magic number spins and bridges the nurbs based on the - * orientation of the global 3d view (yuck yuck!) mode==1 does the same, but doesn't bridge up - * up the new geometry, mode==2 now does the same as 0, but aligned to world axes, not the view. -*/ -static void spin_nurb(float *dvec, short mode) -{ - Nurb *nu; - float *curs, si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3]; - float cent[3],bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3]; - float persmat[3][3], persinv[3][3]; - short a,ok; - - if(G.vd==0 || G.obedit==0 || G.obedit->type!=OB_SURF) return; - if( (G.vd->lay & G.obedit->lay)==0 ) return; - - if (mode != 2) Mat3CpyMat4(persmat, G.vd->viewmat); - else Mat3One(persmat); - Mat3Inv(persinv, persmat); - - /* imat and center and size */ - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(imat, bmat); - - curs= give_cursor(); - VECCOPY(cent, curs); - VecSubf(cent, cent, G.obedit->obmat[3]); - Mat3MulVecfl(imat,cent); - - if(dvec || mode==2) { - n[0]=n[1]= 0.0; - n[2]= 1.0; - } else { - n[0]= G.vd->viewinv[2][0]; - n[1]= G.vd->viewinv[2][1]; - n[2]= G.vd->viewinv[2][2]; - Normalize(n); - } - - phi= M_PI/8.0; - q[0]= cos(phi); - si= sin(phi); - q[1]= n[0]*si; - q[2]= n[1]*si; - q[3]= n[2]*si; - QuatToMat3(q, cmat); - Mat3MulMat3(tmat, cmat, bmat); - Mat3MulMat3(rotmat, imat, tmat); - - Mat3One(scalemat1); - scalemat1[0][0]= sqrt(2.0); - scalemat1[1][1]= sqrt(2.0); - - Mat3MulMat3(tmat,persmat,bmat); - Mat3MulMat3(cmat,scalemat1,tmat); - Mat3MulMat3(tmat,persinv,cmat); - Mat3MulMat3(scalemat1,imat,tmat); - - Mat3One(scalemat2); - scalemat2[0][0]/= sqrt(2.0); - scalemat2[1][1]/= sqrt(2.0); - - Mat3MulMat3(tmat,persmat,bmat); - Mat3MulMat3(cmat,scalemat2,tmat); - Mat3MulMat3(tmat,persinv,cmat); - Mat3MulMat3(scalemat2,imat,tmat); - - ok= 1; - - for(a=0;a<7;a++) { - if(mode==0 || mode==2) ok= extrudeflagNurb(1); - else adduplicateflagNurb(1); - if(ok==0) { - error("Can't spin"); - break; - } - rotateflagNurb(1,cent,rotmat); - - if(mode==0 || mode==2) { - if( (a & 1)==0 ) { - rotateflagNurb(1,cent,scalemat1); - weightflagNurb(1, 0.25*sqrt(2.0), 1); - } - else { - rotateflagNurb(1,cent,scalemat2); - weightflagNurb(1, 4.0/sqrt(2.0), 1); - } - } - if(dvec) { - Mat3MulVecfl(bmat,dvec); - translateflagNurb(1,dvec); - } - } - - if(ok) { - for(nu= editNurb.first; nu; nu= nu->next) { - if(isNurbsel(nu)) { - nu->orderv= 4; - nu->flagv |= 1; - makeknots(nu, 2, nu->flagv>>1); - } - } - } - -} - -/* external one, for undo */ -void spinNurb(float *dvec, short mode) -{ - spin_nurb(dvec, mode); - BIF_undo_push("Spin"); -} - -void addvert_Nurb(int mode) -{ - Nurb *nu; - BezTriple *bezt, *newbezt = NULL; - BPoint *bp, *newbp = NULL; - float *curs, mat[3][3],imat[3][3], temp[3]; - - if(G.obedit==0 || G.vd == 0) return; - if( (G.vd->lay & G.obedit->lay)==0 ) return; - - Mat3CpyMat4(mat, G.obedit->obmat); - Mat3Inv(imat,mat); - - findselectedNurbvert(&nu, &bezt, &bp); - if(bezt==0 && bp==0) return; - - if((nu->type & 7)==CU_BEZIER) { - /* which bezpoint? */ - if(bezt== nu->bezt) { /* first */ - bezt->f1= bezt->f2= bezt->f3= 0; - newbezt = - (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb"); - memcpy(newbezt+1, bezt, nu->pntsu*sizeof(BezTriple)); - *newbezt= *bezt; - newbezt->f1= newbezt->f2= newbezt->f3= SELECT; - if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1; - else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */ - VECCOPY(temp, bezt->vec[1]); - MEM_freeN(nu->bezt); - nu->bezt= newbezt; - bezt= newbezt+1; - } - else if(bezt== (nu->bezt+nu->pntsu-1)) { /* last */ - bezt->f1= bezt->f2= bezt->f3= 0; - newbezt = - (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb"); - memcpy(newbezt, nu->bezt, nu->pntsu*sizeof(BezTriple)); - *(newbezt+nu->pntsu)= *bezt; - VECCOPY(temp, bezt->vec[1]); - MEM_freeN(nu->bezt); - nu->bezt= newbezt; - newbezt+= nu->pntsu; - newbezt->f1= newbezt->f2= newbezt->f3= SELECT; - if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1; - else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */ - bezt= nu->bezt+nu->pntsu-1; - } - else bezt= 0; - - if(bezt) { - nu->pntsu++; - - if(mode=='e') { - VECCOPY(newbezt->vec[0], bezt->vec[0]); - VECCOPY(newbezt->vec[1], bezt->vec[1]); - VECCOPY(newbezt->vec[2], bezt->vec[2]); - } - else { - curs= give_cursor(); - - VECCOPY(newbezt->vec[1], curs); - VecSubf(newbezt->vec[1],newbezt->vec[1],G.obedit->obmat[3]); - Mat3MulVecfl(imat,newbezt->vec[1]); - VecSubf(temp, newbezt->vec[1],temp); - VecAddf(newbezt->vec[0], bezt->vec[0],temp); - VecAddf(newbezt->vec[2], bezt->vec[2],temp); - calchandlesNurb(nu); - } - } - } - else if(nu->pntsv==1) { - /* which b-point? */ - if(bp== nu->bp) { /* first */ - bp->f1= 0; - newbp = - (BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb3"); - memcpy(newbp+1, bp, nu->pntsu*sizeof(BPoint)); - *newbp= *bp; - newbp->f1= 1; - MEM_freeN(nu->bp); - nu->bp= newbp; - bp= newbp + 1; - } - else if(bp== (nu->bp+nu->pntsu-1)) { /* last */ - bp->f1= 0; - newbp = - (BPoint*)MEM_callocN((nu->pntsu+1) * sizeof(BPoint), "addvert_Nurb4"); - memcpy(newbp, nu->bp, nu->pntsu*sizeof(BPoint)); - *(newbp+nu->pntsu)= *bp; - MEM_freeN(nu->bp); - nu->bp= newbp; - newbp+= nu->pntsu; - newbp->f1= 1; - bp= newbp - 1; - } - else bp= 0; - - if(bp) { - nu->pntsu++; - - if(nu->resolu<3) nu->resolu++; - makeknots(nu, 1, nu->flagu>>1); - - if(mode=='e') { - VECCOPY(newbp->vec, bp->vec); - } - else { - curs= give_cursor(); - - VECCOPY(newbp->vec, curs); - VecSubf(newbp->vec, newbp->vec, G.obedit->obmat[3]); - Mat3MulVecfl(imat,newbp->vec); - newbp->vec[3]= 1.0; - } - } - } - - retopo_do_all(); - - test2DNurb(nu); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - if(mode=='e') { - BIF_TransformSetUndo("Extrude"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); - } - else while(get_mbut()&R_MOUSE) BIF_wait_for_statechange(); - - if(mode!='e') { - /* dependencies with other objects, should become event */ - BIF_undo_push("Add vertex"); - - } -} - -void extrude_nurb() -{ - Nurb *nu; - int ok= 0; - - if(G.obedit && G.obedit->type==OB_SURF) { - - /* first test: curve? */ - for(nu= editNurb.first; nu; nu= nu->next) { - if(nu->pntsv==1 && isNurbsel_count(nu)==1 ) break; - } - if(nu) { - addvert_Nurb('e'); - } else { - ok= extrudeflagNurb(1); /* '1'= flag */ - - if(ok) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - countall(); - BIF_TransformSetUndo("Extrude"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); - } - } - } -} - - - -void makecyclicNurb() -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - float *fp; - int a, b, cyclmode=0; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( nu->pntsu>1 || nu->pntsv>1) { - if( (nu->type & 7)==0 ) { - a= nu->pntsu; - bp= nu->bp; - while(a--) { - if( bp->f1 & SELECT ) { - if(nu->flagu & CU_CYCLIC) nu->flagu--; - else nu->flagu++; - break; - } - bp++; - } - } - else if( (nu->type & 7)==CU_BEZIER ) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - if(nu->flagu & CU_CYCLIC) nu->flagu--; - else nu->flagu++; - break; - } - bezt++; - } - calchandlesNurb(nu); - } - else if(nu->pntsv==1 && (nu->type & 7)==CU_NURBS) { - a= nu->pntsu; - bp= nu->bp; - while(a--) { - if( bp->f1 & SELECT ) { - if(nu->flagu & CU_CYCLIC) nu->flagu--; - else { - nu->flagu++; - nu->flagu &= ~2; /* endpoint flag, fixme */ - fp= MEM_mallocN(sizeof(float)*KNOTSU(nu), "makecyclicN"); - b= (nu->orderu+nu->pntsu); - memcpy(fp, nu->knotsu, sizeof(float)*b); - MEM_freeN(nu->knotsu); - nu->knotsu= fp; - - makeknots(nu, 1, 0); /* 1==u 0==uniform */ - - } - break; - } - bp++; - } - } - else if(nu->type==CU_NURBS) { - if(cyclmode==0) { - cyclmode= pupmenu("Toggle %t|cyclic U%x1|cyclic V%x2"); - if(cyclmode < 1) return; - } - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - - if( bp->f1 & SELECT) { - if(cyclmode==1 && nu->pntsu>1) { - if(nu->flagu & CU_CYCLIC) nu->flagu--; - else { - nu->flagu++; - fp= MEM_mallocN(sizeof(float)*KNOTSU(nu), "makecyclicN"); - b= (nu->orderu+nu->pntsu); - memcpy(fp, nu->knotsu, sizeof(float)*b); - MEM_freeN(nu->knotsu); - nu->knotsu= fp; - - makeknots(nu, 1, 0); /* 1==u 0==uniform */ - } - } - if(cyclmode==2 && nu->pntsv>1) { - if(nu->flagv & 1) nu->flagv--; - else { - nu->flagv++; - fp= MEM_mallocN(sizeof(float)*KNOTSV(nu), "makecyclicN"); - b= (nu->orderv+nu->pntsv); - memcpy(fp, nu->knotsv, sizeof(float)*b); - MEM_freeN(nu->knotsv); - nu->knotsv= fp; - - makeknots(nu, 2, 0); /* 2==v 0==uniform */ - } - } - break; - } - bp++; - } - - } - } - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Cyclic"); -} - -void selectconnected_nurb() -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - findnearestNurbvert(1, &nu, &bezt, &bp); - if(bezt) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if(G.qual & LR_SHIFTKEY) select_beztriple(bezt, DESELECT, 1, VISIBLE); - else select_beztriple(bezt, SELECT, 1, VISIBLE); - bezt++; - } - } - else if(bp) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if(G.qual & LR_SHIFTKEY) select_bpoint(bp, DESELECT, 1, VISIBLE); - else select_bpoint(bp, SELECT, 1, VISIBLE); - bp++; - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select connected"); - -} - -void selectrow_nurb() -{ - static BPoint *last=0; - static int direction=0; - Nurb *nu; - BPoint *bp; - int u = 0, v = 0, a, b, ok=0; - - if(editNurb.first==0) return; - if(G.obedit==NULL || G.obedit->type!=OB_SURF) return; - if(lastselbp==NULL) return; - - /* find the correct nurb and toggle with u of v */ - for(nu= editNurb.first; nu; nu= nu->next) { - bp= nu->bp; - for(v=0; vpntsv; v++) { - for(u=0; upntsu; u++, bp++) { - if(bp==lastselbp) { - if(bp->f1 & SELECT) { - ok= 1; - break; - } - } - } - if(ok) break; - } - if(ok) { - if(last==lastselbp) { - direction= 1-direction; - setflagsNurb(0); - } - last= lastselbp; - - bp= nu->bp; - for(a=0; apntsv; a++) { - for(b=0; bpntsu; b++, bp++) { - if(direction) { - if(a==v) select_bpoint(bp, SELECT, 1, VISIBLE); - } - else { - if(b==u) select_bpoint(bp, SELECT, 1, VISIBLE); - } - } - } - countall(); - allqueue(REDRAWVIEW3D, 0); - return; - } - } - BIF_undo_push("Select Row"); - -} - -/* (de)selects first or last of visible part of each Nurb depending on selFirst */ -/* selFirst: defines the end of which to select */ -/* doswap: defines if selection state of each first/last control point is swapped */ -/* selstatus: selection status in case doswap is false */ -void selectend_nurb(short selfirst, short doswap, short selstatus) -{ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - short sel; - - if(G.obedit==0) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - sel= 0; - if((nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - - /* which point? */ - if(selfirst==0) { /* select last */ - bezt= (nu->bezt + (a-1)); - } - else { /* select first */ - bezt= nu->bezt; - } - - while(a--) { - if(doswap) sel= swap_selection_beztriple(bezt); - else sel= select_beztriple(bezt, selstatus, 1, VISIBLE); - - if(sel==1) break; - } - } - else { - a= nu->pntsu*nu->pntsv; - - /* which point? */ - if(selfirst==0) { /* select last */ - bp= (nu->bp + (a-1)); - } - else{ /* select first */ - bp= nu->bp; - } - - while(a--) { - if (bp->hide == 0) { - if(doswap) sel= swap_selection_bpoint(bp); - else sel= select_bpoint(bp, selstatus, 1, VISIBLE); - - if(sel==1) break; - } - } - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select/Deselect End"); -} - -void select_next_nurb() -{ - if(G.obedit==0) return; - - select_adjacent_cp(1, 0, SELECT); - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select Next"); -} - -void select_prev_nurb() -{ - if(G.obedit==0) return; - - select_adjacent_cp(-1, 0, SELECT); - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select Previous"); -} - -void select_more_nurb() -{ - Nurb *nu; - BPoint *bp, *tempbp; - int a; - short sel= 0; - short *selbpoints; - - if(G.obedit==0) return; - - /* note that NURBS surface is a special case because we mimic */ - /* the behaviour of "select more" of mesh tools. */ - /* The algorithm is designed to work in planar cases so it */ - /* may not be optimal always (example: end of NURBS sphere) */ - if(G.obedit->type==OB_SURF) { - for(nu= editNurb.first; nu; nu= nu->next) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - selbpoints= MEM_callocN(sizeof(short)*a-nu->pntsu, "selectlist"); - while(a > 0) { - if((selbpoints[a]!=1) && (bp->hide==0) && (bp->f1 & SELECT)) { - /* upper control point */ - if(a%nu->pntsu != 0) { - tempbp= bp-1; - if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE); - } - - /* left control point. select only if it is not selected already */ - if(a-nu->pntsu > 0) { - sel= 0; - tempbp= bp+nu->pntsu; - if(!(tempbp->f1 & SELECT)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE); - /* make sure selected bpoint is discarded */ - if(sel == 1) selbpoints[a-nu->pntsu]= 1; - } - - /* right control point */ - if(a+nu->pntsu < nu->pntsu*nu->pntsv) { - tempbp= bp-nu->pntsu; - if(!(tempbp->f1 & SELECT)) select_bpoint(tempbp, SELECT, 1, VISIBLE); - } - - /* lower control point. skip next bp in case selection was made */ - if(a%nu->pntsu != 1) { - sel= 0; - tempbp= bp+1; - if(!(tempbp->f1 & 1)) sel= select_bpoint(tempbp, SELECT, 1, VISIBLE); - if(sel) { - bp++; - a--; - } - } - } - - bp++; - a--; - } - - MEM_freeN(selbpoints); - } - } - else { - select_adjacent_cp(1, 0, SELECT); - select_adjacent_cp(-1, 0, SELECT); - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select More"); -} - -/* basic method: deselect if control point doesn't have all neighbours selected */ -void select_less_nurb() -{ - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int a; - short sel= 0, lastsel= 0; - short *selbpoints; - - if(G.obedit==0) return; - - if(G.obedit->type==OB_SURF) { - for(nu= editNurb.first; nu; nu= nu->next) { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - selbpoints= MEM_callocN(sizeof(short)*a, "selectlist"); - while(a--) { - if((bp->hide==0) && (bp->f1 & SELECT)) { - sel= 0; - - /* check if neighbours have been selected */ - /* edges of surface are an exception */ - if((a+1)%nu->pntsu==0) sel++; - else { - bp--; - if((selbpoints[a+1]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++; - bp++; - } - - if((a+1)%nu->pntsu==1) sel++; - else { - bp++; - if((bp->hide==0) && (bp->f1 & SELECT)) sel++; - bp--; - } - - if(a+1 > nu->pntsu*nu->pntsv-nu->pntsu) sel++; - else { - bp-=nu->pntsu; - if((selbpoints[a+nu->pntsu]==1) || ((bp->hide==0) && (bp->f1 & SELECT))) sel++; - bp+=nu->pntsu; - } - - if(a < nu->pntsu) sel++; - else { - bp+=nu->pntsu; - if((bp->hide==0) && (bp->f1 & SELECT)) sel++; - bp-=nu->pntsu; - } - - if(sel!=4) { - select_bpoint(bp, DESELECT, 1, VISIBLE); - selbpoints[a]= 1; - } - } - else lastsel= 0; - - bp++; - } - - MEM_freeN(selbpoints); - } - } - else { - for(nu= editNurb.first; nu; nu= nu->next) { - lastsel=0; - /* check what type of curve/nurb it is */ - if((nu->type & 7)==CU_BEZIER) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - if((bezt->hide==0) && (bezt->f2 & SELECT)) { - if(lastsel==1) sel= 1; - else sel= 0; - - /* check if neighbours have been selected */ - /* first and last are exceptions */ - if(a==nu->pntsu-1) sel++; - else { - bezt--; - if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++; - bezt++; - } - - if(a==0) sel++; - else { - bezt++; - if((bezt->hide==0) && (bezt->f2 & SELECT)) sel++; - bezt--; - } - - if(sel!=2) { - select_beztriple(bezt, DESELECT, 1, VISIBLE); - lastsel= 1; - } - else lastsel= 0; - } - else lastsel= 0; - - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - if((lastsel==0) && (bp->hide==0) && (bp->f1 & SELECT)) { - if(lastsel!=0) sel= 1; - else sel= 0; - - /* first and last are exceptions */ - if(a==nu->pntsu*nu->pntsv-1) sel++; - else { - bp--; - if((bp->hide==0) && (bp->f1 & SELECT)) sel++; - bp++; - } - - if(a==0) sel++; - else { - bp++; - if((bp->hide==0) && (bp->f1 & SELECT)) sel++; - bp--; - } - - if(sel!=2) { - select_bpoint(bp, DESELECT, 1, VISIBLE); - lastsel= 1; - } - else lastsel= 0; - } - else lastsel= 0; - - bp++; - } - } - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select Less"); -} - -/* this function could be moved elsewhere as it can be reused in other parts of the source needing randomized list */ -/* returns list containing -1 in indices that have been left out of the list. otherwise index contains reference */ -/* to next index. basically *list contains a linked list */ -static void generate_pickable_list(int *list, int size, int pickamount) -{ - int i, j, removable; - - BLI_srand( BLI_rand() ); /* random seed */ - - /* generate list in form 0->1, 1->2, 2->3, ... i-2->i-1, i->0 */ - for(i=0; inext) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(itemstobeselected[k] != -1) select_beztriple(bezt, SELECT, 1, VISIBLE); - k++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(itemstobeselected[k] != -1) select_bpoint(bp, SELECT, 1, VISIBLE); - k++; - bp++; - } - } - } - - MEM_freeN(itemstobeselected); - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select Random"); -} - -void select_every_nth_nurb() -{ - static short nfac= 2; - - if(!G.obedit) return; - - if(!button(&nfac, 2, 25,"N:")) return; - - select_adjacent_cp(nfac, 1, SELECT); - select_adjacent_cp(-nfac, 1, SELECT); - - countall(); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Select Every Nth"); -} - -void adduplicate_nurb() -{ - - if(G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return; - - adduplicateflagNurb(1); - - countall(); - BIF_TransformSetUndo("Add Duplicate"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); -} - -void delNurb() -{ - Nurb *nu, *next, *nu1; - BezTriple *bezt, *bezt1, *bezt2; - BPoint *bp, *bp1, *bp2; - int a; - short event, cut = 0; - - if(G.obedit==0 ) return; - if(G.vd==0 || (G.vd->lay & G.obedit->lay)==0 ) return; - - if(G.obedit->type==OB_SURF) event= pupmenu("Erase %t|Selected%x0|All%x2"); - else event= pupmenu("Erase %t|Selected%x0|Segment%x1|All%x2"); - - if(event== -1) return; - - if(G.obedit->type==OB_SURF) { - if(event==0) deleteflagNurb(1); - else freeNurblist(&editNurb); - - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Delete"); - - return; - } - - if(event==0) { - /* first loop, can we remove entire pieces? */ - nu= editNurb.first; - while(nu) { - next= nu->next; - if( (nu->type & 7)==CU_BEZIER ) { - bezt= nu->bezt; - a= nu->pntsu; - if(a) { - while(a) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ); - else break; - a--; - bezt++; - } - if(a==0) { - BLI_remlink(&editNurb, nu); - freeNurb(nu); - } - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - if(a) { - while(a) { - if(bp->f1 & SELECT); - else break; - a--; - bp++; - } - if(a==0) { - BLI_remlink(&editNurb, nu); - freeNurb(nu); - } - } - } - nu= next; - } - /* 2nd loop, delete small pieces: just for curves */ - nu= editNurb.first; - while(nu) { - next= nu->next; - event= 0; - if( (nu->type & 7)==CU_BEZIER ) { - bezt= nu->bezt; - for(a=0;apntsu;a++) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - memcpy(bezt, bezt+1, (nu->pntsu-a-1)*sizeof(BezTriple)); - nu->pntsu--; - a--; - event= 1; - } - else bezt++; - } - if(event) { - bezt1 = - (BezTriple*)MEM_mallocN((nu->pntsu) * sizeof(BezTriple), "delNurb"); - memcpy(bezt1, nu->bezt, (nu->pntsu)*sizeof(BezTriple) ); - MEM_freeN(nu->bezt); - nu->bezt= bezt1; - calchandlesNurb(nu); - } - } - else if(nu->pntsv==1) { - bp= nu->bp; - - for(a=0;apntsu;a++) { - if( bp->f1 & SELECT ) { - memcpy(bp, bp+1, (nu->pntsu-a-1)*sizeof(BPoint)); - nu->pntsu--; - a--; - event= 1; - } - else { - bp++; - } - } - if(event) { - bp1 = (BPoint*)MEM_mallocN(nu->pntsu * sizeof(BPoint), "delNurb2"); - memcpy(bp1, nu->bp, (nu->pntsu)*sizeof(BPoint) ); - MEM_freeN(nu->bp); - nu->bp= bp1; - } - makeknots(nu, 1, nu->flagu>>1); - } - nu= next; - } - } - else if(event==1) { /* erase segment */ - /* find the 2 selected points */ - bezt1= bezt2= 0; - bp1= bp2= 0; - nu= editNurb.first; - nu1= 0; - while(nu) { - next= nu->next; - if( (nu->type & 7)==CU_BEZIER ) { - bezt= nu->bezt; - for(a=0; apntsu-1; a++) { - if( BEZSELECTED_HIDDENHANDLES(bezt) ) { - bezt1= bezt; - bezt2= bezt+1; - if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) ; - else { /* maybe do not make cyclic */ - if(a==0 && (nu->flagu & 1) ) { - bezt2= bezt+(nu->pntsu-1); - if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) { - nu->flagu--; - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Delete"); - } - } - return; - } - cut= a; - nu1= nu; - break; - } - bezt++; - } - } - else if(nu->pntsv==1) { - bp= nu->bp; - for(a=0; apntsu-1; a++) { - if( bp->f1 & SELECT ) { - bp1= bp; - bp2= bp+1; - if( bp2->f1 & 1 ) ; - else { /* maybe do not make cyclic */ - if(a==0 && (nu->flagu & 1) ) { - bp2= bp+(nu->pntsu-1); - if( bp2->f1 & 1 ) { - nu->flagu--; - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Delete"); - } - } - return; - } - cut= a; - nu1= nu; - break; - } - bp++; - } - } - if(nu1) break; - - nu= nu->next; - } - if(nu1) { - if(bezt1) { - if(nu1->pntsu==2) { /* remove completely */ - BLI_remlink(&editNurb, nu); - freeNurb(nu); - } - else if(nu1->flagu & 1) { /* cyclic */ - bezt = - (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb1"); - memcpy(bezt, nu1->bezt,(cut+1)*sizeof(BezTriple)); - a= nu1->pntsu-cut-1; - memcpy(nu1->bezt, bezt2, a*sizeof(BezTriple)); - memcpy(nu1->bezt+a, bezt, (cut+1)*sizeof(BezTriple)); - nu1->flagu--; - MEM_freeN(bezt); - calchandlesNurb(nu); - } - else { /* add new curve */ - -/* seems to be an error here... but where? (a can become zero) */ - - nu = - (Nurb*)MEM_mallocN(sizeof(Nurb), "delNurb2"); - memcpy(nu, nu1, sizeof(Nurb)); - BLI_addtail(&editNurb, nu); - nu->bezt = - (BezTriple*)MEM_mallocN((cut+1) * sizeof(BezTriple), "delNurb3"); - memcpy(nu->bezt, nu1->bezt,(cut+1)*sizeof(BezTriple)); - a= nu1->pntsu-cut-1; - - bezt = - (BezTriple*)MEM_mallocN(a * sizeof(BezTriple), "delNurb4"); - memcpy(bezt, nu1->bezt+cut+1,a*sizeof(BezTriple)); - MEM_freeN(nu1->bezt); - nu1->bezt= bezt; - nu1->pntsu= a; - nu->pntsu= cut+1; - - - calchandlesNurb(nu); - calchandlesNurb(nu1); - } - } - else if(bp1) { - if(nu1->pntsu==2) { /* remove completely */ - BLI_remlink(&editNurb, nu); - freeNurb(nu); - } - else if(nu1->flagu & 1) { /* cyclic */ - bp = - (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb5"); - memcpy(bp, nu1->bp,(cut+1)*sizeof(BPoint)); - a= nu1->pntsu-cut-1; - memcpy(nu1->bp, bp2, a*sizeof(BPoint)); - memcpy(nu1->bp+a, bp, (cut+1)*sizeof(BPoint)); - nu1->flagu--; - MEM_freeN(bp); - } - else { /* add new curve */ - nu = (Nurb*)MEM_mallocN(sizeof(Nurb), "delNurb6"); - memcpy(nu, nu1, sizeof(Nurb)); - BLI_addtail(&editNurb, nu); - nu->bp = - (BPoint*)MEM_mallocN((cut+1) * sizeof(BPoint), "delNurb7"); - memcpy(nu->bp, nu1->bp,(cut+1)*sizeof(BPoint)); - a= nu1->pntsu-cut-1; - bp = - (BPoint*)MEM_mallocN(a * sizeof(BPoint), "delNurb8"); - memcpy(bp, nu1->bp+cut+1,a*sizeof(BPoint)); - MEM_freeN(nu1->bp); - nu1->bp= bp; - nu1->pntsu= a; - nu->pntsu= cut+1; - } - } - } - } - else if(event==2) { - freeNurblist(&editNurb); - } - - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Delete"); - -} - -void nurb_set_smooth(short event) -{ - Nurb *nu; - - if(G.obedit==0) return; - - if(G.obedit->type != OB_CURVE) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - if(isNurbsel(nu)) { - if(event==1) nu->flag |= CU_SMOOTH; - else if(event==0) nu->flag &= ~CU_SMOOTH; - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - - if(event==1) BIF_undo_push("Set Smooth"); - else if(event==0) BIF_undo_push("Set Solid"); -} - -int join_curve(int type) -{ - Base *base, *nextb; - Object *ob; - Curve *cu; - Nurb *nu, *newnu; - BezTriple *bezt; - BPoint *bp; - ListBase tempbase; - float imat[4][4], cmat[4][4]; - int a; - - ob= OBACT; - if (object_data_is_libdata(ob)) { - error_libdata(); - return 0; - } - - if(!G.vd || ob->type!=type) return 0; - if(ob->lay & G.vd->lay); else return 0; - tempbase.first= tempbase.last= 0; - - /* trasnform all selected curves inverse in obact */ - Mat4Invert(imat, ob->obmat); - - base= FIRSTBASE; - while(base) { - nextb= base->next; - if TESTBASE(base) { - if(base->object->type==type) { - if(base->object != ob) { - - cu= base->object->data; - - if(cu->nurb.first) { - /* watch it: switch order here really goes wrong */ - Mat4MulMat4(cmat, base->object->obmat, imat); - - nu= cu->nurb.first; - while(nu) { - newnu= duplicateNurb(nu); - BLI_addtail(&tempbase, newnu); - - if( (bezt= newnu->bezt) ) { - a= newnu->pntsu; - while(a--) { - Mat4MulVecfl(cmat, bezt->vec[0]); - Mat4MulVecfl(cmat, bezt->vec[1]); - Mat4MulVecfl(cmat, bezt->vec[2]); - bezt++; - } - } - if( (bp= newnu->bp) ) { - a= newnu->pntsu*nu->pntsv; - while(a--) { - Mat4MulVecfl(cmat, bp->vec); - bp++; - } - } - nu= nu->next; - } - } - - free_and_unlink_base(base); - } - } - } - base= nextb; - } - - cu= ob->data; - addlisttolist(&cu->nurb, &tempbase); - - DAG_scene_sort(G.scene); // because we removed object(s), call before editmode! - - enter_editmode(EM_WAITCURSOR); - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Join"); - return 1; -} - - - -Nurb *addNurbprim(int type, int stype, int newname) -/* type: &8= 2D; 0=poly,1 bez, 4 nurb - * stype: 0: 2/4 points curve - * 1: 8 points circle - * 2: 4x4 patch Nurb - * 3: tube 4:sphere 5:donut - * 6: 5 points, 5th order straight line (for anim path) - */ -{ - static int xzproj= 0; - Nurb *nu = NULL; - BezTriple *bezt; - BPoint *bp; - float *curs, cent[3],vec[3],imat[3][3],mat[3][3]; - float fac,cmat[3][3], grid; - int a, b; - - if (G.vd) grid = G.vd->grid; - else grid = 1.0; - - /* imat and center and size */ - if(G.obedit) { - - Mat3CpyMat4(mat, G.obedit->obmat); - curs= give_cursor(); - VECCOPY(cent, curs); - cent[0]-= G.obedit->obmat[3][0]; - cent[1]-= G.obedit->obmat[3][1]; - cent[2]-= G.obedit->obmat[3][2]; - - if (G.vd) { - if ( !(newname) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(imat, G.vd->viewmat); - else Mat3One(imat); - Mat3MulVecfl(imat, cent); - Mat3MulMat3(cmat, imat, mat); - Mat3Inv(imat, cmat); - } - setflagsNurb(0); - } - else { - Mat3One(imat); - cent[0]= cent[1]= cent[2]= 0.0; - } - - if ELEM5(stype, 0, 1, 2, 4, 6) { - nu = (Nurb*)MEM_callocN(sizeof(Nurb), "addNurbprim"); - nu->type= type; - nu->resolu= 12; - nu->resolv= 12; - } - - switch(stype) { - case 0: /* curve */ - if(newname) { - rename_id((ID *)G.obedit, "Curve"); - rename_id((ID *)G.obedit->data, "Curve"); - } - if((type & 7)==CU_BEZIER) { - nu->pntsu= 2; - nu->bezt = - (BezTriple*)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1"); - bezt= nu->bezt; - bezt->h1= bezt->h2= HD_ALIGN; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->radius = 1.0; - - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->vec[1][0]+= -grid; - bezt->vec[0][0]+= -1.5*grid; - bezt->vec[0][1]+= -0.5*grid; - bezt->vec[2][0]+= -0.5*grid; - bezt->vec[2][1]+= 0.5*grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat, bezt->vec[a]); - - bezt++; - bezt->h1= bezt->h2= HD_ALIGN; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->radius = bezt->weight = 1.0; - - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->vec[1][0]+= grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat, bezt->vec[a]); - - calchandlesNurb(nu); - } - else { - - nu->pntsu= 4; - nu->pntsv= 1; - nu->orderu= 4; - nu->bp= callocstructN(BPoint, 4, "addNurbprim3"); - - bp= nu->bp; - for(a=0;a<4;a++, bp++) { - VECCOPY(bp->vec, cent); - bp->vec[3]= 1.0; - bp->f1= SELECT; - bp->radius = bp->weight = 1.0; - } - - bp= nu->bp; - bp->vec[0]+= -1.5*grid; - bp++; - bp->vec[0]+= -grid; - bp->vec[1]+= grid; - bp++; - bp->vec[0]+= grid; - bp->vec[1]+= grid; - bp++; - bp->vec[0]+= 1.5*grid; - - bp= nu->bp; - for(a=0;a<4;a++, bp++) Mat3MulVecfl(imat,bp->vec); - - if((type & 7)==4) { - nu->knotsu= 0; /* makeknots allocates */ - makeknots(nu, 1, nu->flagu>>1); - } - - } - break; - case 6: /* 5 point path */ - nu->pntsu= 5; - nu->pntsv= 1; - nu->orderu= 5; - nu->flagu= 2; /* endpoint */ - nu->resolu= 32; - nu->bp= callocstructN(BPoint, 5, "addNurbprim3"); - - bp= nu->bp; - for(a=0;a<5;a++, bp++) { - VECCOPY(bp->vec, cent); - bp->vec[3]= 1.0; - bp->f1= SELECT; - bp->radius = bp->weight = 1.0; - } - - bp= nu->bp; - bp->vec[0]+= -2.0*grid; - bp++; - bp->vec[0]+= -grid; - bp++; bp++; - bp->vec[0]+= grid; - bp++; - bp->vec[0]+= 2.0*grid; - - bp= nu->bp; - for(a=0;a<5;a++, bp++) Mat3MulVecfl(imat,bp->vec); - - if((type & 7)==4) { - nu->knotsu= 0; /* makeknots allocates */ - makeknots(nu, 1, nu->flagu>>1); - } - - break; - case 1: /* circle */ - if(newname) { - rename_id((ID *)G.obedit, "CurveCircle"); - rename_id((ID *)G.obedit->data, "CurveCircle"); - } - if((type & 7)==CU_BEZIER) { - nu->pntsu= 4; - nu->bezt= callocstructN(BezTriple, 4, "addNurbprim1"); - nu->flagu= 1; - bezt= nu->bezt; - - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->h1= bezt->h2= HD_AUTO; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->vec[1][0]+= -grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]); - bezt->radius = bezt->weight = 1.0; - - bezt++; - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->h1= bezt->h2= HD_AUTO; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->vec[1][1]+= grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]); - bezt->radius = bezt->weight = 1.0; - - bezt++; - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->h1= bezt->h2= HD_AUTO; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->vec[1][0]+= grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]); - bezt->radius = bezt->weight = 1.0; - - bezt++; - for(a=0;a<3;a++) { - VECCOPY(bezt->vec[a], cent); - } - bezt->h1= bezt->h2= HD_AUTO; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->vec[1][1]+= -grid; - for(a=0;a<3;a++) Mat3MulVecfl(imat,bezt->vec[a]); - bezt->radius = bezt->weight = 1.0; - - calchandlesNurb(nu); - } - else if( (type & 7)==CU_NURBS ) { /* nurb */ - nu->pntsu= 8; - nu->pntsv= 1; - nu->orderu= 4; - nu->bp= callocstructN(BPoint, 8, "addNurbprim6"); - nu->flagu= 1; - bp= nu->bp; - - for(a=0; a<8; a++) { - bp->f1= SELECT; - VECCOPY(bp->vec, cent); - - if(xzproj==0) { - bp->vec[0]+= nurbcircle[a][0]*grid; - bp->vec[1]+= nurbcircle[a][1]*grid; - } - else { - bp->vec[0]+= 0.25*nurbcircle[a][0]*grid-.75*grid; - bp->vec[2]+= 0.25*nurbcircle[a][1]*grid; - } - if(a & 1) bp->vec[3]= 0.25*sqrt(2.0); - else bp->vec[3]= 1.0; - Mat3MulVecfl(imat,bp->vec); - bp->radius = bp->weight = 1.0; - - bp++; - } - - makeknots(nu, 1, nu->flagu>>1); - } - break; - case 2: /* 4x4 patch */ - if( (type & 7)==CU_NURBS ) { /* nurb */ - if(newname) { - rename_id((ID *)G.obedit, "Surf"); - rename_id((ID *)G.obedit->data, "Surf"); - } - - nu->pntsu= 4; - nu->pntsv= 4; - nu->orderu= 4; - nu->orderv= 4; - nu->flag= CU_SMOOTH; - nu->bp= callocstructN(BPoint, 4*4, "addNurbprim6"); - nu->flagu= 0; - nu->flagv= 0; - bp= nu->bp; - - for(a=0; a<4; a++) { - for(b=0; b<4; b++) { - VECCOPY(bp->vec, cent); - bp->f1= SELECT; - fac= (float)a -1.5; - bp->vec[0]+= fac*grid; - fac= (float)b -1.5; - bp->vec[1]+= fac*grid; - if(a==1 || a==2) if(b==1 || b==2) { - bp->vec[2]+= grid; - } - Mat3MulVecfl(imat,bp->vec); - bp->vec[3]= 1.0; - bp++; - } - } - - makeknots(nu, 1, nu->flagu>>1); - makeknots(nu, 2, nu->flagv>>1); - } - break; - case 3: /* tube */ - if( (type & 7)==CU_NURBS ) { - if(newname) { - rename_id((ID *)G.obedit, "SurfTube"); - rename_id((ID *)G.obedit->data, "SurfTube"); - } - - nu= addNurbprim(4, 1, newname); /* circle */ - nu->resolu= 32; - nu->flag= CU_SMOOTH; - BLI_addtail(&editNurb, nu); /* temporal for extrude and translate */ - vec[0]=vec[1]= 0.0; - vec[2]= -grid; - Mat3MulVecfl(imat, vec); - translateflagNurb(1, vec); - extrudeflagNurb(1); - vec[0]= -2*vec[0]; - vec[1]= -2*vec[1]; - vec[2]= -2*vec[2]; - translateflagNurb(1, vec); - - BLI_remlink(&editNurb, nu); - - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a-- >0) { - bp->f1 |= SELECT; - bp++; - } - } - break; - case 4: /* sphere */ - if( (type & 7)==CU_NURBS ) { - if(newname) { - rename_id((ID *)G.obedit, "SurfSphere"); - rename_id((ID *)G.obedit->data, "SurfSphere"); - } - - nu->pntsu= 5; - nu->pntsv= 1; - nu->orderu= 3; - nu->resolu= 24; - nu->resolv= 32; - nu->flag= CU_SMOOTH; - nu->bp= callocstructN(BPoint, 5, "addNurbprim6"); - nu->flagu= 0; - bp= nu->bp; - - for(a=0; a<5; a++) { - bp->f1= SELECT; - VECCOPY(bp->vec, cent); - bp->vec[0]+= nurbcircle[a][0]*grid; - bp->vec[2]+= nurbcircle[a][1]*grid; - if(a & 1) bp->vec[3]= 0.5*sqrt(2.0); - else bp->vec[3]= 1.0; - Mat3MulVecfl(imat,bp->vec); - bp++; - } - nu->flagu= 4; - makeknots(nu, 1, nu->flagu>>1); - - BLI_addtail(&editNurb, nu); /* temporal for spin */ - if(newname) spin_nurb(0, 2); - else spin_nurb(0, 0); - - makeknots(nu, 2, nu->flagv>>1); - - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a-- >0) { - bp->f1 |= SELECT; - bp++; - } - BLI_remlink(&editNurb, nu); - } - break; - case 5: /* donut */ - if( (type & 7)==CU_NURBS ) { - if(newname) { - rename_id((ID *)G.obedit, "SurfDonut"); - rename_id((ID *)G.obedit->data, "SurfDonut"); - } - - xzproj= 1; - nu= addNurbprim(4, 1, newname); /* circle */ - xzproj= 0; - nu->resolu= 24; - nu->resolv= 32; - nu->flag= CU_SMOOTH; - BLI_addtail(&editNurb, nu); /* temporal for extrude and translate */ - if(newname) spin_nurb(0, 2); - else spin_nurb(0, 0); - - BLI_remlink(&editNurb, nu); - - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a-- >0) { - bp->f1 |= SELECT; - bp++; - } - - } - break; - } - - /* always do: */ - nu->flag= CU_SMOOTH; - - test2DNurb(nu); - - return nu; -} - -void default_curve_ipo(Curve *cu) -{ - IpoCurve *icu; - BezTriple *bezt; - - if(cu->ipo) return; - - cu->ipo= add_ipo("CurveIpo", ID_CU); - - icu= MEM_callocN(sizeof(IpoCurve), "ipocurve"); - - icu->blocktype= ID_CU; - icu->adrcode= CU_SPEED; - icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ; - set_icu_vars(icu); - - BLI_addtail( &(cu->ipo->curve), icu); - - icu->bezt= bezt= MEM_callocN(2*sizeof(BezTriple), "defaultipo"); - icu->totvert= 2; - - bezt->hide= IPO_BEZ; - bezt->f1=bezt->f2= bezt->f3= SELECT; - bezt->h1= bezt->h2= HD_AUTO; - bezt++; - bezt->vec[1][0]= 100.0; - bezt->vec[1][1]= 1.0; - bezt->hide= IPO_BEZ; - bezt->f1=bezt->f2= bezt->f3= SELECT; - bezt->h1= bezt->h2= HD_AUTO; - - calchandles_ipocurve(icu); -} - -void add_primitiveCurve(int stype) -{ - Nurb *nu; - Curve *cu; - int type, newname= 0; - - if(G.vd==0) return; - if(G.scene->id.lib) return; - - /* this function also comes from an info window */ - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - - if(stype>=10 && stype<20) type= CU_2D+1; - else if(stype>=20 && stype<30) type= CU_2D+2; - else if(stype>=30 && stype<40) type= CU_2D+3; - else if(stype>=40 && stype<50) { - if(stype==46) type= 4; - else type= CU_2D+4; - } - else type= CU_2D; - - check_editmode(OB_CURVE); - - /* if no obedit: new object and enter editmode */ - if(G.obedit==NULL) { - add_object_draw(OB_CURVE); - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - - where_is_object(G.obedit); - - make_editNurb(); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - newname= 1; - - cu= G.obedit->data; - if(stype==46) { - cu->flag |= (CU_3D+CU_PATH); - - default_curve_ipo(cu); - } - } - else { - cu= G.obedit->data; - } - - if(cu->flag & CU_3D) type &= ~CU_2D; - - stype= (stype % 10); - - nu= addNurbprim(type, stype, newname); /* 2D */ - - BLI_addtail(&editNurb, nu); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - countall(); - - /* if a new object was created, it stores it in Curve, for reload original data and undo */ - if ( !(newname) || U.flag & USER_ADD_EDITMODE) { - if(newname) load_editNurb(); - } else { - exit_editmode(2); - } - - allqueue(REDRAWALL, 0); - - BIF_undo_push("Add Curve"); -} - -void add_primitiveNurb(int type) -{ - Nurb *nu; - int newname= 0; - - if(G.scene->id.lib) return; - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - - check_editmode(OB_SURF); - - /* if no obedit: new object and enter editmode */ - if(G.obedit==0) { - add_object_draw(OB_SURF); - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - - where_is_object(G.obedit); - - make_editNurb(); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - newname= 1; - } - - nu= addNurbprim(4, type, newname); - BLI_addtail(&editNurb,nu); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - countall(); - - /* if a new object was created, it stores it in Curve, for reload original data and undo */ - if ( !(newname) || U.flag & USER_ADD_EDITMODE) { - if(newname) load_editNurb(); - } else { - exit_editmode(2); - } - allqueue(REDRAWALL, 0); - - BIF_undo_push("Add Surface"); -} - - - -void clear_tilt() -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - int a; - - if(okee("Clear tilt")==0) return; - - for(nu= editNurb.first; nu; nu= nu->next) { - if( nu->bezt ) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(BEZSELECTED_HIDDENHANDLES(bezt)) bezt->alfa= 0.0; - bezt++; - } - } - else if(nu->bp) { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) bp->alfa= 0.0; - bp++; - } - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Clear tilt"); - -} - -int bezt_compare (const void *e1, const void *e2) -{ - BezTriple *b1 = *((BezTriple**)e1); - BezTriple *b2 = *((BezTriple**)e2); - - /* Check numerical values */ - float val = b1->vec[1][0] - b2->vec[1][0]; - - if (val<0) - return -1; - - if (val>0) - return 1; - - /* Check selected flags : Ensures that selected keys will be listed first */ - - if ((b1->f2 & SELECT) && !(b2->f2 & SELECT)) - return -1; - if (!(b1->f2 & SELECT) && (b2->f2 & SELECT)) - return 1; - - return 0; -} - - -/* **************** undo for curves ************** */ - -static void undoCurve_to_editCurve(void *lbv) -{ - ListBase *lb= lbv; - Nurb *nu, *newnu; - int nr, lastnunr= 0; - - /* we try to restore lastnu too, for buttons */ - for(nu= editNurb.first; nu; nu = nu->next, lastnunr++) if(nu==lastnu) break; - - freeNurblist(&editNurb); - - /* copy */ - for(nu= lb->first; nu; nu= nu->next) { - newnu= duplicateNurb(nu); - BLI_addtail(&editNurb, newnu); - } - /* restore */ - for(nr=0, lastnu= editNurb.first; lastnu; lastnu = lastnu->next, nr++) if(nr==lastnunr) break; - -} - -static void *editCurve_to_undoCurve(void) -{ - ListBase *lb; - Nurb *nu, *newnu; - - lb= MEM_callocN(sizeof(ListBase), "listbase undo"); - - /* copy */ - for(nu= editNurb.first; nu; nu= nu->next) { - newnu= duplicateNurb(nu); - BLI_addtail(lb, newnu); - } - return lb; -} - -static void free_undoCurve(void *lbv) -{ - ListBase *lb= lbv; - - freeNurblist(lb); - MEM_freeN(lb); -} - -/* and this is all the undo system needs to know */ -void undo_push_curve(char *name) -{ - undo_editmode_push(name, free_undoCurve, undoCurve_to_editCurve, editCurve_to_undoCurve); -} - - - -/***/ diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c deleted file mode 100644 index b4206a510aa..00000000000 --- a/source/blender/src/editdeform.c +++ /dev/null @@ -1,944 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Creator-specific support for vertex deformation groups - * Added: apply deform function (ton) - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_curve_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" - -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" -#include "BKE_deform.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" - -#include "BIF_interface.h" -#include "BIF_editdeform.h" -#include "BIF_editmesh.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_edit.h" - -#include "butspace.h" -#include "mydevice.h" -#include "editmesh.h" -#include "multires.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* only in editmode */ -void sel_verts_defgroup (int select) -{ - EditVert *eve; - Object *ob; - int i; - MDeformVert *dvert; - - ob= G.obedit; - - if (!ob) - return; - - switch (ob->type){ - case OB_MESH: - for (eve=G.editMesh->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->totweight){ - for (i=0; itotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)){ - if (select) eve->f |= SELECT; - else eve->f &= ~SELECT; - - break; - } - } - } - } - /* this has to be called, because this function operates on vertices only */ - if(select) EM_select_flush(); // vertices to edges/faces - else EM_deselect_flush(); - - break; - case OB_LATTICE: - if(editLatt->dvert) { - BPoint *bp; - int a, tot; - - dvert= editLatt->dvert; - - tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - for(a=0, bp= editLatt->def; atotweight; i++){ - if (dvert->dw[i].def_nr == (ob->actdef-1)) { - if(select) bp->f1 |= SELECT; - else bp->f1 &= ~SELECT; - - break; - } - } - } - } - break; - - default: - break; - } - - countall(); - -} - -/* check if deform vertex has defgroup index */ -MDeformWeight *get_defweight (MDeformVert *dv, int defgroup) -{ - int i; - - if (!dv || defgroup<0) - return NULL; - - for (i=0; itotweight; i++){ - if (dv->dw[i].def_nr == defgroup) - return dv->dw+i; - } - return NULL; -} - -/* Ensures that mv has a deform weight entry for - the specified defweight group */ -/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */ -MDeformWeight *verify_defweight (MDeformVert *dv, int defgroup) -{ - MDeformWeight *newdw; - - /* do this check always, this function is used to check for it */ - if (!dv || defgroup<0) - return NULL; - - newdw = get_defweight (dv, defgroup); - if (newdw) - return newdw; - - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=0.0f; - dv->dw[dv->totweight].def_nr=defgroup; - /* Group index */ - - dv->totweight++; - - return dv->dw+(dv->totweight-1); -} - -void add_defgroup (Object *ob) -{ - add_defgroup_name (ob, "Group"); -} - -bDeformGroup *add_defgroup_name (Object *ob, char *name) -{ - bDeformGroup *defgroup; - - if (!ob) - return NULL; - - defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); - - BLI_strncpy (defgroup->name, name, 32); - - BLI_addtail(&ob->defbase, defgroup); - unique_vertexgroup_name(defgroup, ob); - - ob->actdef = BLI_countlist(&ob->defbase); - - return defgroup; -} - -void duplicate_defgroup ( Object *ob ) -{ - bDeformGroup *dg, *cdg; - char name[32], s[32]; - MDeformWeight *org, *cpy; - MDeformVert *dvert; - Mesh *me; - int i, idg, icdg; - - if (ob->type != OB_MESH) - return; - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - BLI_snprintf (name, 32, "%s_copy", dg->name); - while (get_named_vertexgroup (ob, name)) { - if ((strlen (name) + 6) > 32) { - error ("Error: the name for the new group is > 32 characters"); - return; - } - strcpy (s, name); - BLI_snprintf (name, 32, "%s_copy", s); - } - - cdg = copy_defgroup (dg); - strcpy (cdg->name, name); - BLI_addtail (&ob->defbase, cdg); - - idg = (ob->actdef-1); - ob->actdef = BLI_countlist (&ob->defbase); - icdg = (ob->actdef-1); - - me = get_mesh (ob); - if (!me->dvert) - return; - - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert+i; - org = get_defweight (dvert, idg); - if (org) { - cpy = verify_defweight (dvert, icdg); - cpy->weight = org->weight; - } - } -} - -void del_defgroup_in_object_mode ( Object *ob ) -{ - bDeformGroup *dg; - MDeformVert *dvert; - Mesh *me; - int i, e; - - if ((!ob) || (ob->type != OB_MESH)) - return; - - dg = BLI_findlink (&ob->defbase, (ob->actdef-1)); - if (!dg) - return; - - me = get_mesh (ob); - if (me->dvert) { - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert + i; - if (dvert) { - if (get_defweight (dvert, (ob->actdef-1))) - remove_vert_defgroup (ob, dg, i); - } - } - - for (i = 0; i < me->totvert; i++) { - dvert = me->dvert+i; - if (dvert) { - for (e = 0; e < dvert->totweight; e++) { - if (dvert->dw[e].def_nr > (ob->actdef-1)) - dvert->dw[e].def_nr--; - } - } - } - } - - /* Update the active deform index if necessary */ - if (ob->actdef == BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, dg); -} - -void del_defgroup (Object *ob) -{ - bDeformGroup *defgroup; - int i; - - if (!ob) - return; - - if (!ob->actdef) - return; - - defgroup = BLI_findlink(&ob->defbase, ob->actdef-1); - if (!defgroup) - return; - - /* Make sure that no verts are using this group */ - remove_verts_defgroup(1); - - /* Make sure that any verts with higher indices are adjusted accordingly */ - if(ob->type==OB_MESH) { - EditMesh *em = G.editMesh; - EditVert *eve; - MDeformVert *dvert; - - for (eve=em->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert) - for (i=0; itotweight; i++) - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - } - else { - BPoint *bp; - MDeformVert *dvert= editLatt->dvert; - int a, tot; - - if (dvert) { - tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - for(a=0, bp= editLatt->def; atotweight; i++){ - if (dvert->dw[i].def_nr > (ob->actdef-1)) - dvert->dw[i].def_nr--; - } - } - } - } - - /* Update the active deform index if necessary */ - if (ob->actdef==BLI_countlist(&ob->defbase)) - ob->actdef--; - - /* Remove the group */ - BLI_freelinkN (&ob->defbase, defgroup); - - /* remove all dverts */ - if(ob->actdef==0) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - me->dvert= NULL; - } - else { - if (editLatt->dvert) { - MEM_freeN(editLatt->dvert); - editLatt->dvert= NULL; - } - } - } -} - -void create_dverts(ID *id) -{ - /* create deform verts - */ - - if( GS(id->name)==ID_ME) { - Mesh *me= (Mesh *)id; - me->dvert= CustomData_add_layer(&me->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, me->totvert); - } - else if( GS(id->name)==ID_LT) { - Lattice *lt= (Lattice *)id; - lt->dvert= MEM_callocN(sizeof(MDeformVert)*lt->pntsu*lt->pntsv*lt->pntsw, "lattice deformVert"); - } -} - -/* for mesh in object mode - lattice can be in editmode */ -void remove_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - /* This routine removes the vertex from the deform - * group with number def_nr. - * - * This routine is meant to be fast, so it is the - * responsibility of the calling routine to: - * a) test whether ob is non-NULL - * b) test whether ob is a mesh - * c) calculate def_nr - */ - - MDeformWeight *newdw; - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= ob->data; - - if(ob==G.obedit) - lt= editLatt; - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return; - - /* for all of the deform weights in the - * deform vert - */ - for (i=dvert->totweight - 1 ; i>=0 ; i--){ - - /* if the def_nr is the same as the one - * for our weight group then remove it - * from this deform vert. - */ - if (dvert->dw[i].def_nr == def_nr) { - dvert->totweight--; - - /* if there are still other deform weights - * attached to this vert then remove this - * deform weight, and reshuffle the others - */ - if (dvert->totweight) { - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), - "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, - sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - /* if there are no other deform weights - * left then just remove the deform weight - */ - else { - MEM_freeN (dvert->dw); - dvert->dw = NULL; - break; - } - } - } - -} - -/* for Mesh in Object mode */ -/* allows editmode for Lattice */ -void add_vert_defnr (Object *ob, int def_nr, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified number - */ - MDeformVert *dv= NULL; - MDeformWeight *newdw; - int i; - - /* get the vert */ - if(ob->type==OB_MESH) { - if(((Mesh*)ob->data)->dvert) - dv = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt; - - if(ob==G.obedit) - lt= editLatt; - else - lt= ob->data; - - if(lt->dvert) - dv = lt->dvert + vertnum; - } - - if(dv==NULL) - return; - - /* Lets first check to see if this vert is - * already in the weight group -- if so - * lets update it - */ - for (i=0; itotweight; i++){ - - /* if this weight cooresponds to the - * deform group, then add it using - * the assign mode provided - */ - if (dv->dw[i].def_nr == def_nr){ - - switch (assignmode) { - case WEIGHT_REPLACE: - dv->dw[i].weight=weight; - break; - case WEIGHT_ADD: - dv->dw[i].weight+=weight; - if (dv->dw[i].weight >= 1.0) - dv->dw[i].weight = 1.0; - break; - case WEIGHT_SUBTRACT: - dv->dw[i].weight-=weight; - /* if the weight is zero or less then - * remove the vert from the deform group - */ - if (dv->dw[i].weight <= 0.0) - remove_vert_def_nr(ob, def_nr, vertnum); - break; - } - return; - } - } - - /* if the vert wasn't in the deform group then - * we must take a different form of action ... - */ - - switch (assignmode) { - case WEIGHT_SUBTRACT: - /* if we are subtracting then we don't - * need to do anything - */ - return; - - case WEIGHT_REPLACE: - case WEIGHT_ADD: - /* if we are doing an additive assignment, then - * we need to create the deform weight - */ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dv->totweight+1), - "deformWeight"); - if (dv->dw){ - memcpy (newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); - MEM_freeN (dv->dw); - } - dv->dw=newdw; - - dv->dw[dv->totweight].weight=weight; - dv->dw[dv->totweight].def_nr=def_nr; - - dv->totweight++; - break; - } -} - -/* called while not in editmode */ -void add_vert_to_defgroup (Object *ob, bDeformGroup *dg, int vertnum, - float weight, int assignmode) -{ - /* add the vert to the deform group with the - * specified assign mode - */ - int def_nr; - - /* get the deform group number, exit if - * it can't be found - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* if there's no deform verts then - * create some - */ - if(ob->type==OB_MESH) { - if (!((Mesh*)ob->data)->dvert) - create_dverts(ob->data); - } - else if(ob->type==OB_LATTICE) { - if (!((Lattice*)ob->data)->dvert) - create_dverts(ob->data); - } - - /* call another function to do the work - */ - add_vert_defnr (ob, def_nr, vertnum, weight, assignmode); -} - -/* Only available in editmode */ -void assign_verts_defgroup (void) -{ - extern float editbutvweight; /* buttons.c */ - Object *ob; - EditVert *eve; - bDeformGroup *dg, *eg; - MDeformWeight *newdw; - MDeformVert *dvert; - int i, done; - - if(multires_level1_test()) return; - - ob= G.obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - if (!CustomData_has_layer(&G.editMesh->vdata, CD_MDEFORMVERT)) - EM_add_data_layer(&G.editMesh->vdata, CD_MDEFORMVERT); - - /* Go through the list of editverts and assign them */ - for (eve=G.editMesh->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && (eve->f & 1)){ - done=0; - /* See if this vert already has a reference to this group */ - /* If so: Change its weight */ - done=0; - for (i=0; itotweight; i++){ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - /* Find the actual group */ - if (eg==dg){ - dvert->dw[i].weight=editbutvweight; - done=1; - break; - } - } - /* If not: Add the group and set its weight */ - if (!done){ - newdw = MEM_callocN (sizeof(MDeformWeight)*(dvert->totweight+1), "deformWeight"); - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*dvert->totweight); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - - dvert->dw[dvert->totweight].weight= editbutvweight; - dvert->dw[dvert->totweight].def_nr= ob->actdef-1; - - dvert->totweight++; - - } - } - } - break; - case OB_LATTICE: - { - BPoint *bp; - int a, tot; - - if(editLatt->dvert==NULL) - create_dverts(&editLatt->id); - - tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - for(a=0, bp= editLatt->def; af1 & SELECT) - add_vert_defnr (ob, ob->actdef-1, a, editbutvweight, WEIGHT_REPLACE); - } - } - break; - default: - printf ("Assigning deformation groups to unknown object type\n"); - break; - } - -} - -/* mesh object mode, lattice can be in editmode */ -void remove_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - /* This routine removes the vertex from the specified - * deform group. - */ - - int def_nr; - - /* if the object is NULL abort - */ - if (!ob) - return; - - /* get the deform number that cooresponds - * to this deform group, and abort if it - * can not be found. - */ - def_nr = get_defgroup_num(ob, dg); - if (def_nr < 0) return; - - /* call another routine to do the work - */ - remove_vert_def_nr (ob, def_nr, vertnum); -} - -/* for mesh in object mode lattice can be in editmode */ -static float get_vert_def_nr (Object *ob, int def_nr, int vertnum) -{ - MDeformVert *dvert= NULL; - int i; - - /* get the deform vertices corresponding to the - * vertnum - */ - if(ob->type==OB_MESH) { - if( ((Mesh*)ob->data)->dvert ) - dvert = ((Mesh*)ob->data)->dvert + vertnum; - } - else if(ob->type==OB_LATTICE) { - Lattice *lt= ob->data; - - if(ob==G.obedit) - lt= editLatt; - - if(lt->dvert) - dvert = lt->dvert + vertnum; - } - - if(dvert==NULL) - return 0.0f; - - for(i=dvert->totweight-1 ; i>=0 ; i--) - if(dvert->dw[i].def_nr == def_nr) - return dvert->dw[i].weight; - - return 0.0f; -} - -/* mesh object mode, lattice can be in editmode */ -float get_vert_defgroup (Object *ob, bDeformGroup *dg, int vertnum) -{ - int def_nr; - - if(!ob) - return 0.0f; - - def_nr = get_defgroup_num(ob, dg); - if(def_nr < 0) return 0.0f; - - return get_vert_def_nr (ob, def_nr, vertnum); -} - -/* Only available in editmode */ -/* removes from active defgroup, if allverts==0 only selected vertices */ -void remove_verts_defgroup (int allverts) -{ - Object *ob; - EditVert *eve; - MDeformVert *dvert; - MDeformWeight *newdw; - bDeformGroup *dg, *eg; - int i; - - if(multires_level1_test()) return; - - ob= G.obedit; - - if (!ob) - return; - - dg=BLI_findlink(&ob->defbase, ob->actdef-1); - if (!dg){ - error ("No vertex group is active"); - return; - } - - switch (ob->type){ - case OB_MESH: - for (eve=G.editMesh->verts.first; eve; eve=eve->next){ - dvert= CustomData_em_get(&G.editMesh->vdata, eve->data, CD_MDEFORMVERT); - - if (dvert && dvert->dw && ((eve->f & 1) || allverts)){ - for (i=0; itotweight; i++){ - /* Find group */ - eg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); - if (eg == dg){ - dvert->totweight--; - if (dvert->totweight){ - newdw = MEM_mallocN (sizeof(MDeformWeight)*(dvert->totweight), "deformWeight"); - - if (dvert->dw){ - memcpy (newdw, dvert->dw, sizeof(MDeformWeight)*i); - memcpy (newdw+i, dvert->dw+i+1, sizeof(MDeformWeight)*(dvert->totweight-i)); - MEM_freeN (dvert->dw); - } - dvert->dw=newdw; - } - else{ - MEM_freeN (dvert->dw); - dvert->dw=NULL; - break; - } - } - } - } - } - break; - case OB_LATTICE: - - if(editLatt->dvert) { - BPoint *bp; - int a, tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - for(a=0, bp= editLatt->def; af1 & SELECT)) - remove_vert_defgroup (ob, dg, a); - } - } - break; - - default: - printf ("Removing deformation groups from unknown object type\n"); - break; - } -} - -void vertexgroup_select_by_name(Object *ob, char *name) -{ - bDeformGroup *curdef; - int actdef= 1; - - if(ob==NULL) return; - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ - if (!strcmp(curdef->name, name)) { - ob->actdef= actdef; - return; - } - } - ob->actdef=0; // this signals on painting to create a new one, if a bone in posemode is selected */ -} - -/* This function provides a shortcut for adding/removing verts from - * vertex groups. It is called by the Ctrl-G hotkey in EditMode for Meshes - * and Lattices. (currently only restricted to those two) - * It is only responsible for - */ -void vgroup_assign_with_menu(void) -{ - Object *ob= G.obedit; - int defCount; - int mode; - - /* prevent crashes */ - if (ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - - /* give user choices of adding to current/new or removing from current */ - if (defCount && ob->actdef) - mode = pupmenu("Vertex Groups %t|Add Selected to New Group %x1|Add Selected to Active Group %x2|Remove Selected from Active Group %x3"); - else - mode= pupmenu("Vertex Groups %t|Add Selected to New Group %x1"); - - /* handle choices */ - switch (mode) { - case 1: /* add to new group */ - add_defgroup(ob); - assign_verts_defgroup(); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Assign to vertex group"); - break; - case 2: /* add to current group */ - assign_verts_defgroup(); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Assign to vertex group"); - break; - case 3: /* remove from current group */ - remove_verts_defgroup(0); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Remove from vertex group"); - break; - } -} - -/* This function provides a shortcut for commonly used vertex group - * functions - change weight (not implemented), change active group, delete active group, - * when Ctrl-Shift-G is used in EditMode, for Meshes and Lattices (only for now). - */ -void vgroup_operation_with_menu(void) -{ - Object *ob= G.obedit; - int defCount; - int mode; - - /* prevent crashes and useless cases */ - if (ob==NULL) return; - - defCount= BLI_countlist(&ob->defbase); - if (defCount == 0) return; - - /* give user choices of adding to current/new or removing from current */ - if (ob->actdef) - mode = pupmenu("Vertex Groups %t|Change Active Group%x1|Delete Active Group%x2"); - else - mode= pupmenu("Vertex Groups %t|Change Active Group%x1"); - - /* handle choices */ - switch (mode) { - case 1: /* change active group*/ - { - char *menustr= get_vertexgroup_menustr(ob); - short nr; - - if (menustr) { - nr= pupmenu(menustr); - - if ((nr >= 1) && (nr <= defCount)) - ob->actdef= nr; - - MEM_freeN(menustr); - } - allqueue(REDRAWBUTSALL, 0); - } - break; - case 2: /* delete active group */ - { - del_defgroup(ob); - allqueue (REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Delete vertex group"); - } - break; - } -} - -/* ******************* other deform edit stuff ********** */ - -void object_apply_deform(Object *ob) -{ - notice("Apply Deformation now only availble in Modifier buttons"); -} - diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c deleted file mode 100644 index be3d9429d31..00000000000 --- a/source/blender/src/editface.c +++ /dev/null @@ -1,1437 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_heap.h" -#include "BLI_edgehash.h" -#include "BLI_editVert.h" - -#include "MTC_matrixops.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_image_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_brush.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" -#include "BKE_customdata.h" - -#include "BSE_view.h" -#include "BSE_edit.h" -#include "BSE_drawview.h" /* for backdrawview3d */ - -#include "BIF_editsima.h" -#include "BIF_editmesh.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_toolbox.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_space.h" /* for allqueue */ - -#include "BDR_drawmesh.h" -#include "BDR_editface.h" -#include "BDR_vpaint.h" - -#include "BDR_editface.h" -#include "BDR_vpaint.h" - -#include "mydevice.h" -#include "blendef.h" -#include "butspace.h" -#include "multires.h" - -#include "BSE_trans_types.h" - -#include "BDR_unwrapper.h" -#include "BDR_editobject.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -/* Pupmenu codes: */ -#define UV_CUBE_MAPPING 2 -#define UV_CYL_MAPPING 3 -#define UV_SPHERE_MAPPING 4 -#define UV_BOUNDS_MAPPING 5 -#define UV_RESET_MAPPING 6 -#define UV_WINDOW_MAPPING 7 -#define UV_UNWRAP_MAPPING 8 -#define UV_CYL_EX 32 -#define UV_SPHERE_EX 34 - -/* Some macro tricks to make pupmenu construction look nicer :-) - Sorry, just did it for fun. */ - -#define _STR(x) " " #x -#define STRING(x) _STR(x) - -#define MENUSTRING(string, code) string " %x" STRING(code) -#define MENUTITLE(string) string " %t|" - - -/* returns 0 if not found, otherwise 1 */ -int facesel_face_pick(Mesh *me, short *mval, unsigned int *index, short rect) -{ - if (!me || me->totface==0) - return 0; - - if (G.vd->flag & V3D_NEEDBACKBUFDRAW) { - check_backbuf(); - persp(PERSP_VIEW); - } - - if (rect) { - /* sample rect to increase changes of selecting, so that when clicking - on an edge in the backbuf, we can still select a face */ - int dist; - *index = sample_backbuf_rect(mval, 3, 1, me->totface+1, &dist,0,NULL); - } - else - /* sample only on the exact position */ - *index = sample_backbuf(mval[0], mval[1]); - - if ((*index)<=0 || (*index)>(unsigned int)me->totface) - return 0; - - (*index)--; - - return 1; -} - -/* returns 0 if not found, otherwise 1 */ -static int facesel_edge_pick(Mesh *me, short *mval, unsigned int *index) -{ - int dist; - unsigned int min = me->totface + 1; - unsigned int max = me->totface + me->totedge + 1; - - if (me->totedge == 0) - return 0; - - if (G.vd->flag & V3D_NEEDBACKBUFDRAW) { - check_backbuf(); - persp(PERSP_VIEW); - } - - *index = sample_backbuf_rect(mval, 50, min, max, &dist,0,NULL); - - if (*index == 0) - return 0; - - (*index)--; - - return 1; -} - -/* only operates on the edit object - this is all thats needed at the moment */ -static void uv_calc_center_vector(float *result, Object *ob, EditMesh *em) -{ - float min[3], max[3], *cursx; - - EditFace *efa; - switch (G.vd->around) - { - case V3D_CENTER: /* bounding box center */ - min[0]= min[1]= min[2]= 1e20f; - max[0]= max[1]= max[2]= -1e20f; - - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - DO_MINMAX(efa->v1->co, min, max); - DO_MINMAX(efa->v2->co, min, max); - DO_MINMAX(efa->v3->co, min, max); - if(efa->v4) DO_MINMAX(efa->v4->co, min, max); - } - } - VecMidf(result, min, max); - break; - case V3D_CURSOR: /*cursor center*/ - cursx= give_cursor(); - /* shift to objects world */ - result[0]= cursx[0]-ob->obmat[3][0]; - result[1]= cursx[1]-ob->obmat[3][1]; - result[2]= cursx[2]-ob->obmat[3][2]; - break; - case V3D_LOCAL: /*object center*/ - case V3D_CENTROID: /* multiple objects centers, only one object here*/ - default: - result[0]= result[1]= result[2]= 0.0; - break; - } -} - -static void uv_calc_map_matrix(float result[][4], Object *ob, float upangledeg, float sideangledeg, float radius) -{ - float rotup[4][4], rotside[4][4], viewmatrix[4][4], rotobj[4][4]; - float sideangle= 0.0, upangle= 0.0; - int k; - - /* get rotation of the current view matrix */ - Mat4CpyMat4(viewmatrix,G.vd->viewmat); - /* but shifting */ - for( k= 0; k< 4; k++) viewmatrix[3][k] =0.0; - - /* get rotation of the current object matrix */ - Mat4CpyMat4(rotobj,ob->obmat); - /* but shifting */ - for( k= 0; k< 4; k++) rotobj[3][k] =0.0; - - Mat4Clr(*rotup); - Mat4Clr(*rotside); - - /* compensate front/side.. against opengl x,y,z world definition */ - /* this is "kanonen gegen spatzen", a few plus minus 1 will do here */ - /* i wanted to keep the reason here, so we're rotating*/ - sideangle= M_PI * (sideangledeg + 180.0) /180.0; - rotside[0][0]= (float)cos(sideangle); - rotside[0][1]= -(float)sin(sideangle); - rotside[1][0]= (float)sin(sideangle); - rotside[1][1]= (float)cos(sideangle); - rotside[2][2]= 1.0f; - - upangle= M_PI * upangledeg /180.0; - rotup[1][1]= (float)cos(upangle)/radius; - rotup[1][2]= -(float)sin(upangle)/radius; - rotup[2][1]= (float)sin(upangle)/radius; - rotup[2][2]= (float)cos(upangle)/radius; - rotup[0][0]= (float)1.0/radius; - - /* calculate transforms*/ - Mat4MulSerie(result,rotup,rotside,viewmatrix,rotobj,NULL,NULL,NULL,NULL); -} - -static void uv_calc_shift_project(float *target, float *shift, float rotmat[][4], int projectionmode, float *source, float *min, float *max) -{ - float pv[3]; - - VecSubf(pv, source, shift); - Mat4MulVecfl(rotmat, pv); - - switch(projectionmode) { - case B_UVAUTO_CYLINDER: - tubemap(pv[0], pv[1], pv[2], &target[0],&target[1]); - /* split line is always zero */ - if (target[0] >= 1.0f) target[0] -= 1.0f; - break; - - case B_UVAUTO_SPHERE: - spheremap(pv[0], pv[1], pv[2], &target[0],&target[1]); - /* split line is always zero */ - if (target[0] >= 1.0f) target[0] -= 1.0f; - break; - - case 3: /* ortho special case for BOUNDS */ - target[0] = -pv[0]; - target[1] = pv[2]; - break; - - case 4: - { - /* very special case for FROM WINDOW */ - float pv4[4], dx, dy, x= 0.0, y= 0.0; - - dx= G.vd->area->winx; - dy= G.vd->area->winy; - - VecCopyf(pv4, source); - pv4[3] = 1.0; - - /* rotmat is the object matrix in this case */ - Mat4MulVec4fl(rotmat,pv4); - - /* almost project_short */ - Mat4MulVec4fl(G.vd->persmat,pv4); - if (fabs(pv4[3]) > 0.00001) { /* avoid division by zero */ - target[0] = dx/2.0 + (dx/2.0)*pv4[0]/pv4[3]; - target[1] = dy/2.0 + (dy/2.0)*pv4[1]/pv4[3]; - } - else { - /* scaling is lost but give a valid result */ - target[0] = dx/2.0 + (dx/2.0)*pv4[0]; - target[1] = dy/2.0 + (dy/2.0)*pv4[1]; - } - - /* G.vd->persmat seems to do this funky scaling */ - if(dx > dy) { - y= (dx-dy)/2.0; - dy = dx; - } - else { - x= (dy-dx)/2.0; - dx = dy; - } - target[0]= (x + target[0])/dx; - target[1]= (y + target[1])/dy; - - } - break; - - default: - target[0] = 0.0; - target[1] = 1.0; - } - - /* we know the values here and may need min_max later */ - /* max requests independand from min; not fastest but safest */ - if(min) { - min[0] = MIN2(target[0], min[0]); - min[1] = MIN2(target[1], min[1]); - } - if(max) { - max[0] = MAX2(target[0], max[0]); - max[1] = MAX2(target[1], max[1]); - } -} - -void calculate_uv_map(unsigned short mapmode) -{ - MTFace *tface; - Object *ob; - float dx, dy, rotatematrix[4][4], radius= 1.0, min[3], cent[3], max[3]; - float fac= 1.0, upangledeg= 0.0, sideangledeg= 90.0; - int i, b, mi, n; - - EditMesh *em = G.editMesh; - EditFace *efa; - - if(G.scene->toolsettings->uvcalc_mapdir==1) { - upangledeg= 90.0; - sideangledeg= 0.0; - } else { - upangledeg= 0.0; - if(G.scene->toolsettings->uvcalc_mapalign==1) sideangledeg= 0.0; - else sideangledeg= 90.0; - } - - /* add uvs if there not here */ - if (!EM_texFaceCheck()) { - if (em && em->faces.first) - EM_add_data_layer(&em->fdata, CD_MTFACE); - - if (!EM_texFaceCheck()) - return; - - /* select new UV's */ - if ((G.sima && G.sima->flag & SI_SYNC_UVSEL)==0) { - for(efa=em->faces.first; efa; efa=efa->next) { - MTFace *tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - simaFaceSel_Set(efa, tf); - } - } - } - - ob=OBACT; - - switch(mapmode) { - case B_UVAUTO_BOUNDS: - min[0]= min[1]= 10000000.0; - max[0]= max[1]= -10000000.0; - - cent[0] = cent[1] = cent[2] = 0.0; - uv_calc_map_matrix(rotatematrix, ob, upangledeg, sideangledeg, 1.0f); - - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - uv_calc_shift_project(tface->uv[0],cent,rotatematrix,3, efa->v1->co, min,max); - uv_calc_shift_project(tface->uv[1],cent,rotatematrix,3, efa->v2->co, min,max); - uv_calc_shift_project(tface->uv[2],cent,rotatematrix,3, efa->v3->co,min,max); - if(efa->v4) - uv_calc_shift_project(tface->uv[3],cent,rotatematrix,3, efa->v4->co,min,max); - } - } - - /* rescale UV to be in 1/1 */ - dx= (max[0]-min[0]); - dy= (max[1]-min[1]); - - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(efa->v4) b= 3; else b= 2; - for(; b>=0; b--) { - tface->uv[b][0]= ((tface->uv[b][0]-min[0])*fac)/dx; - tface->uv[b][1]= 1.0-fac+((tface->uv[b][1]-min[1])/* *fac */)/dy; - } - } - } - break; - - case B_UVAUTO_WINDOW: - cent[0] = cent[1] = cent[2] = 0.0; - Mat4CpyMat4(rotatematrix,ob->obmat); - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - uv_calc_shift_project(tface->uv[0],cent,rotatematrix,4, efa->v1->co, NULL,NULL); - uv_calc_shift_project(tface->uv[1],cent,rotatematrix,4, efa->v2->co, NULL,NULL); - uv_calc_shift_project(tface->uv[2],cent,rotatematrix,4, efa->v3->co, NULL,NULL); - if(efa->v4) - uv_calc_shift_project(tface->uv[3],cent,rotatematrix,4, efa->v4->co, NULL,NULL); - } - } - break; - - case B_UVAUTO_RESET: - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - default_uv(tface->uv, 1.0); - } - } - break; - - case B_UVAUTO_CYLINDER: - case B_UVAUTO_SPHERE: - uv_calc_center_vector(cent, ob, em); - - if(mapmode==B_UVAUTO_CYLINDER) radius = G.scene->toolsettings->uvcalc_radius; - - /* be compatible to the "old" sphere/cylinder mode */ - if (G.scene->toolsettings->uvcalc_mapdir== 2) - Mat4One(rotatematrix); - else - uv_calc_map_matrix(rotatematrix,ob,upangledeg,sideangledeg,radius); - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - uv_calc_shift_project(tface->uv[0],cent,rotatematrix,mapmode, efa->v1->co, NULL,NULL); - uv_calc_shift_project(tface->uv[1],cent,rotatematrix,mapmode, efa->v2->co, NULL,NULL); - uv_calc_shift_project(tface->uv[2],cent,rotatematrix,mapmode, efa->v3->co, NULL,NULL); - n = 3; - if(efa->v4) { - uv_calc_shift_project(tface->uv[3],cent,rotatematrix,mapmode, efa->v4->co, NULL,NULL); - n=4; - } - - mi = 0; - for (i = 1; i < n; i++) - if (tface->uv[i][0] > tface->uv[mi][0]) mi = i; - - for (i = 0; i < n; i++) { - if (i != mi) { - dx = tface->uv[mi][0] - tface->uv[i][0]; - if (dx > 0.5) tface->uv[i][0] += 1.0; - } - } - } - } - - break; - - case B_UVAUTO_CUBE: - { - /* choose x,y,z axis for projetion depending on the largest normal */ - /* component, but clusters all together around the center of map */ - float no[3]; - short cox, coy; - float *loc= ob->obmat[3]; - /*MVert *mv= me->mvert;*/ - float cubesize = G.scene->toolsettings->uvcalc_cubesize; - - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, no); - - no[0]= fabs(no[0]); - no[1]= fabs(no[1]); - no[2]= fabs(no[2]); - - cox=0; coy= 1; - if(no[2]>=no[0] && no[2]>=no[1]); - else if(no[1]>=no[0] && no[1]>=no[2]) coy= 2; - else { cox= 1; coy= 2; } - - tface->uv[0][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v1->co[cox]); - tface->uv[0][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v1->co[coy]); - dx = floor(tface->uv[0][0]); - dy = floor(tface->uv[0][1]); - tface->uv[0][0] -= dx; - tface->uv[0][1] -= dy; - tface->uv[1][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v2->co[cox]); - tface->uv[1][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v2->co[coy]); - tface->uv[1][0] -= dx; - tface->uv[1][1] -= dy; - tface->uv[2][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v3->co[cox]); - tface->uv[2][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v3->co[coy]); - tface->uv[2][0] -= dx; - tface->uv[2][1] -= dy; - if(efa->v4) { - tface->uv[3][0]= 0.5+0.5*cubesize*(loc[cox] + efa->v4->co[cox]); - tface->uv[3][1]= 0.5+0.5*cubesize*(loc[coy] + efa->v4->co[coy]); - tface->uv[3][0] -= dx; - tface->uv[3][1] -= dy; - } - } - } - break; - } - default: - return; - } /* end switch mapmode */ - - /* clipping and wrapping */ - if(G.sima && G.sima->flag & SI_CLIP_UV) { - for (efa= em->faces.first; efa; efa= efa->next) { - if (!(efa->f & SELECT)) continue; - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - - dx= dy= 0; - if(efa->v4) b= 3; else b= 2; - for(; b>=0; b--) { - while(tface->uv[b][0] + dx < 0.0) dx+= 0.5; - while(tface->uv[b][0] + dx > 1.0) dx-= 0.5; - while(tface->uv[b][1] + dy < 0.0) dy+= 0.5; - while(tface->uv[b][1] + dy > 1.0) dy-= 0.5; - } - - if(efa->v4) b= 3; else b= 2; - for(; b>=0; b--) { - tface->uv[b][0]+= dx; - CLAMP(tface->uv[b][0], 0.0, 1.0); - - tface->uv[b][1]+= dy; - CLAMP(tface->uv[b][1], 0.0, 1.0); - } - } - } - - BIF_undo_push("UV calculation"); - - object_uvs_changed(OBACT); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -/* last_sel, use em->act_face otherwise get the last selected face in the editselections - * at the moment, last_sel is mainly useful for gaking sure the space image dosnt flicker */ -MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol, short sloppy) -{ - EditMesh *em = G.editMesh; - EditFace *efa = NULL; - EditSelection *ese; - - if(!EM_texFaceCheck()) - return NULL; - - /* first check the active face */ - if (sloppy && em->act_face) { - efa = em->act_face; - } else { - ese = em->selected.last; - for (; ese; ese=ese->prev){ - if(ese->type == EDITFACE) { - efa = (EditFace *)ese->data; - - if (efa->h) efa= NULL; - else break; - } - } - } - - if (sloppy && !efa) { - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) - break; - } - } - - if (efa) { - if (mcol) { - if (CustomData_has_layer(&em->fdata, CD_MCOL)) - *mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - else - *mcol = NULL; - } - if (act_efa) *act_efa = efa; - return CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - } - if (act_efa) *act_efa= NULL; - if(mcol) *mcol = NULL; - return NULL; -} - -void default_uv(float uv[][2], float size) -{ - int dy; - - if(size>1.0) size= 1.0; - - dy= 1.0-size; - - uv[0][0]= 0; - uv[0][1]= size+dy; - - uv[1][0]= 0; - uv[1][1]= dy; - - uv[2][0]= size; - uv[2][1]= dy; - - uv[3][0]= size; - uv[3][1]= size+dy; -} - -void make_tfaces(Mesh *me) -{ - if(!me->mtface) { - if(me->mr) { - multires_add_layer(me, &me->mr->fdata, CD_MTFACE, - CustomData_number_of_layers(&me->fdata, CD_MTFACE)); - } - else { - me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, - NULL, me->totface); - } - } -} - -void reveal_tface() -{ - Mesh *me; - MFace *mface; - int a; - - me= get_mesh(OBACT); - if(me==0 || me->totface==0) return; - - mface= me->mface; - a= me->totface; - while(a--) { - if(mface->flag & ME_HIDE) { - mface->flag |= ME_FACE_SEL; - mface->flag -= ME_HIDE; - } - mface++; - } - - BIF_undo_push("Reveal face"); - - object_tface_flags_changed(OBACT, 0); -} - -void hide_tface() -{ - Mesh *me; - MFace *mface; - int a; - - me= get_mesh(OBACT); - if(me==0 || me->totface==0) return; - - if(G.qual & LR_ALTKEY) { - reveal_tface(); - return; - } - - mface= me->mface; - a= me->totface; - while(a--) { - if(mface->flag & ME_HIDE); - else { - if(G.qual & LR_SHIFTKEY) { - if( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE; - } - else { - if( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE; - } - } - if(mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL; - - mface++; - } - - BIF_undo_push("Hide face"); - - object_tface_flags_changed(OBACT, 0); -} - -void select_linked_tfaces(int mode) -{ - Object *ob; - Mesh *me; - short mval[2]; - unsigned int index=0; - - ob = OBACT; - me = get_mesh(ob); - if(me==0 || me->totface==0) return; - - if (mode==0 || mode==1) { - if (!(ob->lay & G.vd->lay)) - error("The active object is not in this layer"); - - getmouseco_areawin(mval); - if (!facesel_face_pick(me, mval, &index, 1)) return; - } - - select_linked_tfaces_with_seams(mode, me, index); -} - -void deselectall_tface() -{ - Mesh *me; - MFace *mface; - int a, sel; - - me= get_mesh(OBACT); - if(me==0) return; - - mface= me->mface; - a= me->totface; - sel= 0; - while(a--) { - if(mface->flag & ME_HIDE); - else if(mface->flag & ME_FACE_SEL) sel= 1; - mface++; - } - - mface= me->mface; - a= me->totface; - while(a--) { - if(mface->flag & ME_HIDE); - else { - if(sel) mface->flag &= ~ME_FACE_SEL; - else mface->flag |= ME_FACE_SEL; - } - mface++; - } - - BIF_undo_push("(De)select all faces"); - - object_tface_flags_changed(OBACT, 0); -} - -void selectswap_tface(void) -{ - Mesh *me; - MFace *mface; - int a; - - me= get_mesh(OBACT); - if(me==0) return; - - mface= me->mface; - a= me->totface; - while(a--) { - if(mface->flag & ME_HIDE); - else { - if(mface->flag & ME_FACE_SEL) mface->flag &= ~ME_FACE_SEL; - else mface->flag |= ME_FACE_SEL; - } - mface++; - } - - BIF_undo_push("Select inverse face"); - - object_tface_flags_changed(OBACT, 0); -} - -int minmax_tface(float *min, float *max) -{ - Object *ob; - Mesh *me; - MFace *mf; - MTFace *tf; - MVert *mv; - int a, ok=0; - float vec[3], bmat[3][3]; - - ob = OBACT; - if (ob==0) return ok; - me= get_mesh(ob); - if(me==0 || me->mtface==0) return ok; - - Mat3CpyMat4(bmat, ob->obmat); - - mv= me->mvert; - mf= me->mface; - tf= me->mtface; - for (a=me->totface; a>0; a--, mf++, tf++) { - if (mf->flag & ME_HIDE || !(mf->flag & ME_FACE_SEL)) - continue; - - VECCOPY(vec, (mv+mf->v1)->co); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, ob->obmat[3]); - DO_MINMAX(vec, min, max); - - VECCOPY(vec, (mv+mf->v2)->co); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, ob->obmat[3]); - DO_MINMAX(vec, min, max); - - VECCOPY(vec, (mv+mf->v3)->co); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, ob->obmat[3]); - DO_MINMAX(vec, min, max); - - if (mf->v4) { - VECCOPY(vec, (mv+mf->v4)->co); - Mat3MulVecfl(bmat, vec); - VecAddf(vec, vec, ob->obmat[3]); - DO_MINMAX(vec, min, max); - } - ok= 1; - } - return ok; -} - -#define ME_SEAM_DONE ME_SEAM_LAST /* reuse this flag */ - -static float seam_cut_cost(Mesh *me, int e1, int e2, int vert) -{ - MVert *v = me->mvert + vert; - MEdge *med1 = me->medge + e1, *med2 = me->medge + e2; - MVert *v1 = me->mvert + ((med1->v1 == vert)? med1->v2: med1->v1); - MVert *v2 = me->mvert + ((med2->v1 == vert)? med2->v2: med2->v1); - float cost, d1[3], d2[3]; - - cost = VecLenf(v1->co, v->co); - cost += VecLenf(v->co, v2->co); - - VecSubf(d1, v->co, v1->co); - VecSubf(d2, v2->co, v->co); - - cost = cost + 0.5f*cost*(2.0f - fabs(d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2])); - - return cost; -} - -static void seam_add_adjacent(Mesh *me, Heap *heap, int mednum, int vertnum, int *nedges, int *edges, int *prevedge, float *cost) -{ - int startadj, endadj = nedges[vertnum+1]; - - for (startadj = nedges[vertnum]; startadj < endadj; startadj++) { - int adjnum = edges[startadj]; - MEdge *medadj = me->medge + adjnum; - float newcost; - - if (medadj->flag & ME_SEAM_DONE) - continue; - - newcost = cost[mednum] + seam_cut_cost(me, mednum, adjnum, vertnum); - - if (cost[adjnum] > newcost) { - cost[adjnum] = newcost; - prevedge[adjnum] = mednum; - BLI_heap_insert(heap, newcost, (void*)adjnum); - } - } -} - -static int seam_shortest_path(Mesh *me, int source, int target) -{ - Heap *heap; - EdgeHash *ehash; - float *cost; - MEdge *med; - int a, *nedges, *edges, *prevedge, mednum = -1, nedgeswap = 0; - MFace *mf; - - /* mark hidden edges as done, so we don't use them */ - ehash = BLI_edgehash_new(); - - for (a=0, mf=me->mface; atotface; a++, mf++) { - if (!(mf->flag & ME_HIDE)) { - BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL); - BLI_edgehash_insert(ehash, mf->v2, mf->v3, NULL); - if (mf->v4) { - BLI_edgehash_insert(ehash, mf->v3, mf->v4, NULL); - BLI_edgehash_insert(ehash, mf->v4, mf->v1, NULL); - } - else - BLI_edgehash_insert(ehash, mf->v3, mf->v1, NULL); - } - } - - for (a=0, med=me->medge; atotedge; a++, med++) - if (!BLI_edgehash_haskey(ehash, med->v1, med->v2)) - med->flag |= ME_SEAM_DONE; - - BLI_edgehash_free(ehash, NULL); - - /* alloc */ - nedges = MEM_callocN(sizeof(*nedges)*me->totvert+1, "SeamPathNEdges"); - edges = MEM_mallocN(sizeof(*edges)*me->totedge*2, "SeamPathEdges"); - prevedge = MEM_mallocN(sizeof(*prevedge)*me->totedge, "SeamPathPrevious"); - cost = MEM_mallocN(sizeof(*cost)*me->totedge, "SeamPathCost"); - - /* count edges, compute adjacent edges offsets and fill adjacent edges */ - for (a=0, med=me->medge; atotedge; a++, med++) { - nedges[med->v1+1]++; - nedges[med->v2+1]++; - } - - for (a=1; atotvert; a++) { - int newswap = nedges[a+1]; - nedges[a+1] = nedgeswap + nedges[a]; - nedgeswap = newswap; - } - nedges[0] = nedges[1] = 0; - - for (a=0, med=me->medge; atotedge; a++, med++) { - edges[nedges[med->v1+1]++] = a; - edges[nedges[med->v2+1]++] = a; - - cost[a] = 1e20f; - prevedge[a] = -1; - } - - /* regular dijkstra shortest path, but over edges instead of vertices */ - heap = BLI_heap_new(); - BLI_heap_insert(heap, 0.0f, (void*)source); - cost[source] = 0.0f; - - while (!BLI_heap_empty(heap)) { - mednum = (int)BLI_heap_popmin(heap); - med = me->medge + mednum; - - if (mednum == target) - break; - - if (med->flag & ME_SEAM_DONE) - continue; - - med->flag |= ME_SEAM_DONE; - - seam_add_adjacent(me, heap, mednum, med->v1, nedges, edges, prevedge, cost); - seam_add_adjacent(me, heap, mednum, med->v2, nedges, edges, prevedge, cost); - } - - MEM_freeN(nedges); - MEM_freeN(edges); - MEM_freeN(cost); - BLI_heap_free(heap, NULL); - - for (a=0, med=me->medge; atotedge; a++, med++) - med->flag &= ~ME_SEAM_DONE; - - if (mednum != target) { - MEM_freeN(prevedge); - return 0; - } - - /* follow path back to source and mark as seam */ - if (mednum == target) { - short allseams = 1; - - mednum = target; - do { - med = me->medge + mednum; - if (!(med->flag & ME_SEAM)) { - allseams = 0; - break; - } - mednum = prevedge[mednum]; - } while (mednum != source); - - mednum = target; - do { - med = me->medge + mednum; - if (allseams) - med->flag &= ~ME_SEAM; - else - med->flag |= ME_SEAM; - mednum = prevedge[mednum]; - } while (mednum != -1); - } - - MEM_freeN(prevedge); - return 1; -} - -static void seam_select(Mesh *me, short *mval, short path) -{ - unsigned int index = 0; - MEdge *medge, *med; - int a, lastindex = -1; - - if (!facesel_edge_pick(me, mval, &index)) - return; - - for (a=0, med=me->medge; atotedge; a++, med++) { - if (med->flag & ME_SEAM_LAST) { - lastindex = a; - med->flag &= ~ME_SEAM_LAST; - break; - } - } - - medge = me->medge + index; - if (!path || (lastindex == -1) || (index == lastindex) || - !seam_shortest_path(me, lastindex, index)) - medge->flag ^= ME_SEAM; - medge->flag |= ME_SEAM_LAST; - - G.f |= G_DRAWSEAMS; - - if (G.rt == 8) - unwrap_lscm(1); - - BIF_undo_push("Mark Seam"); - - object_tface_flags_changed(OBACT, 1); -} - -void seam_edgehash_insert_face(EdgeHash *ehash, MFace *mf) -{ - BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL); - BLI_edgehash_insert(ehash, mf->v2, mf->v3, NULL); - if (mf->v4) { - BLI_edgehash_insert(ehash, mf->v3, mf->v4, NULL); - BLI_edgehash_insert(ehash, mf->v4, mf->v1, NULL); - } - else - BLI_edgehash_insert(ehash, mf->v3, mf->v1, NULL); -} - -void seam_mark_clear_tface(short mode) -{ - Mesh *me; - MFace *mf; - MEdge *med; - int a; - - me= get_mesh(OBACT); - if(me==0 || me->totface==0) return; - - if (mode == 0) - mode = pupmenu("Seams%t|Mark Border Seam %x1|Clear Seam %x2"); - - if (mode != 1 && mode != 2) - return; - - if (mode == 2) { - EdgeHash *ehash = BLI_edgehash_new(); - - for (a=0, mf=me->mface; atotface; a++, mf++) - if (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL)) - seam_edgehash_insert_face(ehash, mf); - - for (a=0, med=me->medge; atotedge; a++, med++) - if (BLI_edgehash_haskey(ehash, med->v1, med->v2)) - med->flag &= ~ME_SEAM; - - BLI_edgehash_free(ehash, NULL); - } - else { - /* mark edges that are on both selected and deselected faces */ - EdgeHash *ehash1 = BLI_edgehash_new(); - EdgeHash *ehash2 = BLI_edgehash_new(); - - for (a=0, mf=me->mface; atotface; a++, mf++) { - if ((mf->flag & ME_HIDE) || !(mf->flag & ME_FACE_SEL)) - seam_edgehash_insert_face(ehash1, mf); - else - seam_edgehash_insert_face(ehash2, mf); - } - - for (a=0, med=me->medge; atotedge; a++, med++) - if (BLI_edgehash_haskey(ehash1, med->v1, med->v2) && - BLI_edgehash_haskey(ehash2, med->v1, med->v2)) - med->flag |= ME_SEAM; - - BLI_edgehash_free(ehash1, NULL); - BLI_edgehash_free(ehash2, NULL); - } - - if (G.rt == 8) - unwrap_lscm(1); - - G.f |= G_DRAWSEAMS; - BIF_undo_push("Mark Seam"); - - object_tface_flags_changed(OBACT, 1); -} - -void face_select() -{ - Object *ob; - Mesh *me; - MFace *mface, *msel; - short mval[2]; - unsigned int a, index; - - /* Get the face under the cursor */ - ob = OBACT; - if (!(ob->lay & G.vd->lay)) { - error("The active object is not in this layer"); - } - me = get_mesh(ob); - getmouseco_areawin(mval); - - if (G.qual & LR_ALTKEY) { - seam_select(me, mval, (G.qual & LR_SHIFTKEY) != 0); - return; - } - - if (!facesel_face_pick(me, mval, &index, 1)) return; - - msel= (((MFace*)me->mface)+index); - if (msel->flag & ME_HIDE) return; - - /* clear flags */ - mface = me->mface; - a = me->totface; - if ((G.qual & LR_SHIFTKEY)==0) { - while (a--) { - mface->flag &= ~ME_FACE_SEL; - mface++; - } - } - - me->act_face = (int)index; - - if (G.qual & LR_SHIFTKEY) { - if (msel->flag & ME_FACE_SEL) - msel->flag &= ~ME_FACE_SEL; - else - msel->flag |= ME_FACE_SEL; - } - else msel->flag |= ME_FACE_SEL; - - /* image window redraw */ - - BIF_undo_push("Select UV face"); - - object_tface_flags_changed(OBACT, 1); -} - -void face_borderselect() -{ - Mesh *me; - MFace *mface; - rcti rect; - struct ImBuf *ibuf; - unsigned int *rt; - int a, sx, sy, index, val; - char *selar; - - me= get_mesh(OBACT); - if(me==0) return; - if(me->totface==0) return; - - val= get_border(&rect, 3); - - /* why readbuffer here? shouldn't be necessary (maybe a flush or so) */ - glReadBuffer(GL_BACK); -#ifdef __APPLE__ - glReadBuffer(GL_AUX0); /* apple only */ -#endif - - if(val) { - selar= MEM_callocN(me->totface+1, "selar"); - - sx= (rect.xmax-rect.xmin+1); - sy= (rect.ymax-rect.ymin+1); - if(sx*sy<=0) return; - - ibuf = IMB_allocImBuf(sx,sy,32,IB_rect,0); - rt = ibuf->rect; - glReadPixels(rect.xmin+curarea->winrct.xmin, rect.ymin+curarea->winrct.ymin, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf); - - a= sx*sy; - while(a--) { - if(*rt) { - index= framebuffer_to_index(*rt); - if(index<=me->totface) selar[index]= 1; - } - rt++; - } - - mface= me->mface; - for(a=1; a<=me->totface; a++, mface++) { - if(selar[a]) { - if(mface->flag & ME_HIDE); - else { - if(val==LEFTMOUSE) mface->flag |= ME_FACE_SEL; - else mface->flag &= ~ME_FACE_SEL; - } - } - } - - IMB_freeImBuf(ibuf); - MEM_freeN(selar); - - BIF_undo_push("Border Select UV face"); - - object_tface_flags_changed(OBACT, 0); - } -#ifdef __APPLE__ - glReadBuffer(GL_BACK); -#endif -} - -void uv_autocalc_tface() -{ - short mode, i=0, has_pymenu=0; /* pymenu must be bigger then UV_*_MAPPING */ - BPyMenu *pym; - char menu_number[3]; - - /* uvmenu, will add python items */ - char uvmenu[4096]=MENUTITLE("UV Calculation") - MENUSTRING("Unwrap", UV_UNWRAP_MAPPING) "|%l|" - - MENUSTRING("Cube Projection", UV_CUBE_MAPPING) "|" - MENUSTRING("Cylinder from View", UV_CYL_MAPPING) "|" - MENUSTRING("Sphere from View", UV_SPHERE_MAPPING) "|%l|" - - MENUSTRING("Project From View", UV_WINDOW_MAPPING) "|" - MENUSTRING("Project from View (Bounds)",UV_BOUNDS_MAPPING) "|%l|" - - MENUSTRING("Reset", UV_RESET_MAPPING); - - /* note that we account for the 10 previous entries with i+10: */ - for (pym = BPyMenuTable[PYMENU_UVCALCULATION]; pym; pym = pym->next, i++) { - - if (!has_pymenu) { - strcat(uvmenu, "|%l"); - has_pymenu = 1; - } - - strcat(uvmenu, "|"); - strcat(uvmenu, pym->name); - strcat(uvmenu, " %x"); - sprintf(menu_number, "%d", i+10); - strcat(uvmenu, menu_number); - } - - mode= pupmenu(uvmenu); - - if (mode >= 10) { - BPY_menu_do_python(PYMENU_UVCALCULATION, mode - 10); - return; - } - - switch(mode) { - case UV_CUBE_MAPPING: - calculate_uv_map(B_UVAUTO_CUBE); break; - case UV_CYL_MAPPING: - calculate_uv_map(B_UVAUTO_CYLINDER); break; - case UV_SPHERE_MAPPING: - calculate_uv_map(B_UVAUTO_SPHERE); break; - case UV_BOUNDS_MAPPING: - calculate_uv_map(B_UVAUTO_BOUNDS); break; - case UV_RESET_MAPPING: - calculate_uv_map(B_UVAUTO_RESET); break; - case UV_WINDOW_MAPPING: - calculate_uv_map(B_UVAUTO_WINDOW); break; - case UV_UNWRAP_MAPPING: - unwrap_lscm(0); break; - } -} - -/* Texture Paint */ - -void set_texturepaint() /* toggle */ -{ - Object *ob = OBACT; - Mesh *me = 0; - - scrarea_queue_headredraw(curarea); - if(ob==NULL) return; - - if (object_data_is_libdata(ob)) { - error_libdata(); - return; - } - - me= get_mesh(ob); - - if(me) - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if(G.f & G_TEXTUREPAINT) { - G.f &= ~G_TEXTUREPAINT; - texpaint_enable_mipmap(); - } - else if (me) { - G.f |= G_TEXTUREPAINT; - - if(me->mtface==NULL) - make_tfaces(me); - - brush_check_exists(&G.scene->toolsettings->imapaint.brush); - texpaint_disable_mipmap(); - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); -} - -static void texpaint_project(Object *ob, float *model, float *proj, float *co, float *pco) -{ - VECCOPY(pco, co); - pco[3]= 1.0f; - - Mat4MulVecfl(ob->obmat, pco); - Mat4MulVecfl((float(*)[4])model, pco); - Mat4MulVec4fl((float(*)[4])proj, pco); -} - -static void texpaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, float *co, float *w) -{ - float pv1[4], pv2[4], pv3[4], h[3], divw; - float model[16], proj[16], wmat[3][3], invwmat[3][3]; - GLint view[4]; - - /* compute barycentric coordinates */ - - /* get the needed opengl matrices */ - glGetIntegerv(GL_VIEWPORT, view); - glGetFloatv(GL_MODELVIEW_MATRIX, model); - glGetFloatv(GL_PROJECTION_MATRIX, proj); - view[0] = view[1] = 0; - - /* project the verts */ - texpaint_project(ob, model, proj, v1, pv1); - texpaint_project(ob, model, proj, v2, pv2); - texpaint_project(ob, model, proj, v3, pv3); - - /* do inverse view mapping, see gluProject man page */ - h[0]= (co[0] - view[0])*2.0f/view[2] - 1; - h[1]= (co[1] - view[1])*2.0f/view[3] - 1; - h[2]= 1.0f; - - /* solve for (w1,w2,w3)/perspdiv in: - h*perspdiv = Project*Model*(w1*v1 + w2*v2 + w3*v3) */ - - wmat[0][0]= pv1[0]; wmat[1][0]= pv2[0]; wmat[2][0]= pv3[0]; - wmat[0][1]= pv1[1]; wmat[1][1]= pv2[1]; wmat[2][1]= pv3[1]; - wmat[0][2]= pv1[3]; wmat[1][2]= pv2[3]; wmat[2][2]= pv3[3]; - - Mat3Inv(invwmat, wmat); - Mat3MulVecfl(invwmat, h); - - VECCOPY(w, h); - - /* w is still divided by perspdiv, make it sum to one */ - divw= w[0] + w[1] + w[2]; - if(divw != 0.0f) - VecMulf(w, 1.0f/divw); -} - -/* compute uv coordinates of mouse in face */ -void texpaint_pick_uv(Object *ob, Mesh *mesh, unsigned int faceindex, short *xy, float *uv) -{ - DerivedMesh *dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); - int *index = dm->getFaceDataArray(dm, CD_ORIGINDEX); - MTFace *tface = dm->getFaceDataArray(dm, CD_MTFACE), *tf; - int numfaces = dm->getNumFaces(dm), a; - float p[2], w[3], absw, minabsw; - MFace mf; - MVert mv[4]; - - minabsw = 1e10; - uv[0] = uv[1] = 0.0; - - persp(PERSP_VIEW); - - /* test all faces in the derivedmesh with the original index of the picked face */ - for (a = 0; a < numfaces; a++) { - if (index[a] == faceindex) { - dm->getFace(dm, a, &mf); - - dm->getVert(dm, mf.v1, &mv[0]); - dm->getVert(dm, mf.v2, &mv[1]); - dm->getVert(dm, mf.v3, &mv[2]); - if (mf.v4) - dm->getVert(dm, mf.v4, &mv[3]); - - tf= &tface[a]; - - p[0]= xy[0]; - p[1]= xy[1]; - - if (mf.v4) { - /* the triangle with the largest absolute values is the one - with the most negative weights */ - texpaint_tri_weights(ob, mv[0].co, mv[1].co, mv[3].co, p, w); - absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]); - if(absw < minabsw) { - uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[3][0]*w[2]; - uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[3][1]*w[2]; - minabsw = absw; - } - - texpaint_tri_weights(ob, mv[1].co, mv[2].co, mv[3].co, p, w); - absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]); - if (absw < minabsw) { - uv[0]= tf->uv[1][0]*w[0] + tf->uv[2][0]*w[1] + tf->uv[3][0]*w[2]; - uv[1]= tf->uv[1][1]*w[0] + tf->uv[2][1]*w[1] + tf->uv[3][1]*w[2]; - minabsw = absw; - } - } - else { - texpaint_tri_weights(ob, mv[0].co, mv[1].co, mv[2].co, p, w); - absw= fabs(w[0]) + fabs(w[1]) + fabs(w[2]); - if (absw < minabsw) { - uv[0]= tf->uv[0][0]*w[0] + tf->uv[1][0]*w[1] + tf->uv[2][0]*w[2]; - uv[1]= tf->uv[0][1]*w[0] + tf->uv[1][1]*w[1] + tf->uv[2][1]*w[2]; - minabsw = absw; - } - } - } - } - - dm->release(dm); -} diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c deleted file mode 100644 index 70365c9b234..00000000000 --- a/source/blender/src/editfont.c +++ /dev/null @@ -1,1291 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MTC_matrixops.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_vfont_types.h" -#include "DNA_scene_types.h" -#include "DNA_text_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_depsgraph.h" -#include "BKE_font.h" -#include "BKE_object.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" - -#include "BIF_editfont.h" -#include "BIF_editmode_undo.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_mywindow.h" - -#include "BDR_editobject.h" - -#include "mydevice.h" - -#include "blendef.h" - -#define MAXTEXT 32766 - -/* -- prototypes --------*/ -VFont *get_builtin_font(void); - -int textediting=0; - -extern struct SelBox *selboxes; /* from blenkernel/font.c */ - -static char findaccent(char char1, unsigned int code) -{ - char new= 0; - - if(char1=='a') { - if(code=='`') new= 224; - else if(code==39) new= 225; - else if(code=='^') new= 226; - else if(code=='~') new= 227; - else if(code=='"') new= 228; - else if(code=='o') new= 229; - else if(code=='e') new= 230; - else if(code=='-') new= 170; - } - else if(char1=='c') { - if(code==',') new= 231; - if(code=='|') new= 162; - } - else if(char1=='e') { - if(code=='`') new= 232; - else if(code==39) new= 233; - else if(code=='^') new= 234; - else if(code=='"') new= 235; - } - else if(char1=='i') { - if(code=='`') new= 236; - else if(code==39) new= 237; - else if(code=='^') new= 238; - else if(code=='"') new= 239; - } - else if(char1=='n') { - if(code=='~') new= 241; - } - else if(char1=='o') { - if(code=='`') new= 242; - else if(code==39) new= 243; - else if(code=='^') new= 244; - else if(code=='~') new= 245; - else if(code=='"') new= 246; - else if(code=='/') new= 248; - else if(code=='-') new= 186; - else if(code=='e') new= 143; - } - else if(char1=='s') { - if(code=='s') new= 167; - } - else if(char1=='u') { - if(code=='`') new= 249; - else if(code==39) new= 250; - else if(code=='^') new= 251; - else if(code=='"') new= 252; - } - else if(char1=='y') { - if(code==39) new= 253; - else if(code=='"') new= 255; - } - else if(char1=='A') { - if(code=='`') new= 192; - else if(code==39) new= 193; - else if(code=='^') new= 194; - else if(code=='~') new= 195; - else if(code=='"') new= 196; - else if(code=='o') new= 197; - else if(code=='e') new= 198; - } - else if(char1=='C') { - if(code==',') new= 199; - } - else if(char1=='E') { - if(code=='`') new= 200; - else if(code==39) new= 201; - else if(code=='^') new= 202; - else if(code=='"') new= 203; - } - else if(char1=='I') { - if(code=='`') new= 204; - else if(code==39) new= 205; - else if(code=='^') new= 206; - else if(code=='"') new= 207; - } - else if(char1=='N') { - if(code=='~') new= 209; - } - else if(char1=='O') { - if(code=='`') new= 210; - else if(code==39) new= 211; - else if(code=='^') new= 212; - else if(code=='~') new= 213; - else if(code=='"') new= 214; - else if(code=='/') new= 216; - else if(code=='e') new= 141; - } - else if(char1=='U') { - if(code=='`') new= 217; - else if(code==39) new= 218; - else if(code=='^') new= 219; - else if(code=='"') new= 220; - } - else if(char1=='Y') { - if(code==39) new= 221; - } - else if(char1=='1') { - if(code=='4') new= 188; - if(code=='2') new= 189; - } - else if(char1=='3') { - if(code=='4') new= 190; - } - else if(char1==':') { - if(code=='-') new= 247; - } - else if(char1=='-') { - if(code==':') new= 247; - if(code=='|') new= 135; - if(code=='+') new= 177; - } - else if(char1=='|') { - if(code=='-') new= 135; - if(code=='=') new= 136; - } - else if(char1=='=') { - if(code=='|') new= 136; - } - else if(char1=='+') { - if(code=='-') new= 177; - } - - if(new) return new; - else return char1; -} - -wchar_t *copybuf=NULL; -wchar_t *copybufinfo=NULL; - -static wchar_t *textbuf=NULL; -static CharInfo *textbufinfo=NULL; -static wchar_t *oldstr=NULL; -static CharInfo *oldstrinfo=NULL; - -void update_string(Curve *cu) -{ - int len; - - // Free the old curve string - MEM_freeN(cu->str); - - // Calculate the actual string length in UTF-8 variable characters - len = wcsleninu8(textbuf); - - // Alloc memory for UTF-8 variable char length string - cu->str = MEM_callocN(len + sizeof(wchar_t), "str"); - - // Copy the wchar to UTF-8 - wcs2utf8s(cu->str, textbuf); -} - -static int insert_into_textbuf(Curve *cu, unsigned long c) -{ - if (cu->lenlen; x>cu->pos; x--) textbuf[x]= textbuf[x-1]; - for(x= cu->len; x>cu->pos; x--) textbufinfo[x]= textbufinfo[x-1]; - textbuf[cu->pos]= c; - textbufinfo[cu->pos] = cu->curinfo; - textbufinfo[cu->pos].kern = 0; - if (G.obedit->actcol>0) - textbufinfo[cu->pos].mat_nr = G.obedit->actcol; - else - textbufinfo[cu->pos].mat_nr = 0; - - cu->pos++; - cu->len++; - textbuf[cu->len]='\0'; - - update_string(cu); - - return 1; - } else { - return 0; - } -} - -void add_lorem(void) -{ - char *p, *p2; - int i; - Curve *cu=G.obedit->data; - static char* lastlorem; - - if (lastlorem) - p= lastlorem; - else - p= BIF_lorem; - - i= rand()/(RAND_MAX/6)+4; - - for (p2=p; *p2 && i; p2++) { - insert_into_textbuf(cu, *p2); - if (*p2=='.') i--; - } - lastlorem = p2+1; - if (strlen(lastlorem)<5) lastlorem = BIF_lorem; - - insert_into_textbuf(cu, '\n'); - insert_into_textbuf(cu, '\n'); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} - -void load_3dtext_fs(char *file) -{ - FILE *fp; - int filelen; - char *strp; - Curve *cu=G.obedit->data; - - fp= fopen(file, "r"); - if (!fp) return; - - fseek(fp, 0L, SEEK_END); - filelen = ftell(fp); - fseek(fp, 0L, SEEK_SET); - - strp = MEM_callocN(filelen+4, "tempstr"); - - filelen = fread(strp, 1, filelen, fp); - fclose(fp); - strp[filelen]= 0; - - if(cu->len+filelenlen += tmplen; - cu->pos= cu->len; - } - MEM_freeN(strp); - - update_string(cu); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} - -VFont *get_builtin_font(void) -{ - VFont *vf; - - for (vf= G.main->vfont.first; vf; vf= vf->id.next) - if (BLI_streq(vf->name, "")) - return vf; - - return load_vfont(""); -} - - -void txt_export_to_object(struct Text *text) -{ - ID *id; - Curve *cu; - struct TextLine *tmp; - int nchars = 0; -// char sdir[FILE_MAXDIR]; -// char sfile[FILE_MAXFILE]; - - if(!text) return; - - id = (ID *)text; - - if (G.obedit && G.obedit->type==OB_FONT) return; - check_editmode(OB_FONT); - - add_object(OB_FONT); - - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - where_is_object(G.obedit); - - cu= G.obedit->data; - -/* -// renames object, careful with long filenames. - - if (text->name) { - //ID *find_id(char *type, char *name) - BLI_split_dirfile(text->name, sdir, sfile); -// rename_id((ID *)G.obedit, sfile); - rename_id((ID *)cu, sfile); - id->us++; - } -*/ - cu->vfont= get_builtin_font(); - cu->vfont->id.us++; - - tmp= text->lines.first; - while(cu->lenline) + 1; - tmp = tmp->next; - } - - if(cu->str) MEM_freeN(cu->str); - if(cu->strinfo) MEM_freeN(cu->strinfo); - - cu->str= MEM_mallocN(nchars+4, "str"); - cu->strinfo= MEM_callocN((nchars+4)*sizeof(CharInfo), "strinfo"); - cu->totbox= cu->actbox= 1; - cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox"); - cu->tb[0].w = cu->tb[0].h = 0.0; - - tmp= text->lines.first; - strcpy(cu->str, tmp->line); - cu->len= strlen(tmp->line); - cu->pos= cu->len; - - tmp= tmp->next; - - while(cu->lenstr, "\n"); - strcat(cu->str, tmp->line); - cu->len+= strlen(tmp->line) + 1; - cu->pos= cu->len; - tmp= tmp->next; - } - - make_editText(); - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); - - allqueue(REDRAWVIEW3D, 0); -} - - -void txt_export_to_objects(struct Text *text) -{ - ID *id; - Curve *cu; - struct TextLine *curline; - int nchars; - int linenum = 0; - float offset[3] = {0.0,0.0,0.0}; - - if(!text) return; - - id = (ID *)text; - - if (G.obedit && G.obedit->type==OB_FONT) return; - check_editmode(OB_FONT); - - curline = text->lines.first; - while(curline){ - /*skip lines with no text, but still make space for them*/ - if(curline->line[0] == '\0'){ - linenum++; - curline = curline->next; - continue; - } - - nchars = 0; - add_object(OB_FONT); - - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - where_is_object(G.obedit); - - /* Do the translation */ - offset[0] = 0; - offset[1] = -linenum; - offset[2] = 0; - - Mat4Mul3Vecfl(G.vd->viewinv,offset); - - G.obedit->loc[0] += offset[0]; - G.obedit->loc[1] += offset[1]; - G.obedit->loc[2] += offset[2]; - /* End Translation */ - - cu= G.obedit->data; - - cu->vfont= get_builtin_font(); - cu->vfont->id.us++; - - nchars = strlen(curline->line) + 1; - - if(cu->str) MEM_freeN(cu->str); - if(cu->strinfo) MEM_freeN(cu->strinfo); - - cu->str= MEM_mallocN(nchars+4, "str"); - cu->strinfo= MEM_callocN((nchars+4)*sizeof(CharInfo), "strinfo"); - cu->totbox= cu->actbox= 1; - cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox"); - cu->tb[0].w = cu->tb[0].h = 0.0; - - strcpy(cu->str, curline->line); - cu->len= strlen(curline->line); - cu->pos= cu->len; - - make_editText(); - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); - - linenum++; - curline = curline->next; - } - BIF_undo_push("Add Text as Objects"); - allqueue(REDRAWVIEW3D, 0); -} - -static short next_word(Curve *cu) -{ - short s; - for (s=cu->pos; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') && - (cu->str[s]!=1) && (cu->str[s]!='\r'); s++); - if (cu->str[s]) return(s+1); else return(s); -} - -static short prev_word(Curve *cu) -{ - short s; - - if (cu->pos==0) return(0); - for (s=cu->pos-2; (cu->str[s]) && (cu->str[s]!=' ') && (cu->str[s]!='\n') && - (cu->str[s]!=1) && (cu->str[s]!='\r'); s--); - if (cu->str[s]) return(s+1); else return(s); -} - - - -static int killselection(int ins) /* 1 == new character */ -{ - int selend, selstart, direction; - Curve *cu= G.obedit->data; - int offset = 0; - int getfrom; - - direction = getselection(&selstart, &selend); - if (direction) { - int size; - if (ins) offset = 1; - if (cu->pos >= selstart) cu->pos = selstart+offset; - if ((direction == -1) && ins) { - selstart++; - selend++; - } - getfrom = selend+offset; - if (ins==0) getfrom++; - size = (cu->len * sizeof(wchar_t)) - (selstart * sizeof(wchar_t)) + (offset*sizeof(wchar_t)); - memmove(textbuf+selstart, textbuf+getfrom, size); - memmove(textbufinfo+selstart, textbufinfo+getfrom, ((cu->len-selstart)+offset)*sizeof(CharInfo)); - cu->len -= (selend-selstart)+offset; - cu->selstart = cu->selend = 0; - } - return(direction); -} - -static void copyselection(void) -{ - int selstart, selend; - - if (getselection(&selstart, &selend)) { - memcpy(copybuf, textbuf+selstart, ((selend-selstart)+1)*sizeof(wchar_t)); - copybuf[(selend-selstart)+1]=0; - memcpy(copybufinfo, textbufinfo+selstart, ((selend-selstart)+1)*sizeof(CharInfo)); - } -} - -static void pasteselection(void) -{ - Curve *cu= G.obedit->data; - - int len= wcslen(copybuf); - - // Verify that the copy buffer => [copy buffer len] + cu->len < MAXTEXT - if(cu->len + len <= MAXTEXT) - { - if (len) { - int size = (cu->len * sizeof(wchar_t)) - (cu->pos*sizeof(wchar_t)) + sizeof(wchar_t); - memmove(textbuf+cu->pos+len, textbuf+cu->pos, size); - memcpy(textbuf+cu->pos, copybuf, len * sizeof(wchar_t)); - - memmove(textbufinfo+cu->pos+len, textbufinfo+cu->pos, (cu->len-cu->pos+1)*sizeof(CharInfo)); - memcpy(textbufinfo+cu->pos, copybufinfo, len*sizeof(CharInfo)); - - cu->len += len; - cu->pos += len; - } - } - else - { - error("Text too long"); - } -} - -int style_to_sel(int style, int toggle) -{ - int selstart, selend; - int i; - Curve *cu; - - if (G.obedit && (G.obedit->type == OB_FONT)) { - cu= G.obedit->data; - - if (getselection(&selstart, &selend)) { - for (i=selstart; i<=selend; i++) { - if (toggle==0) { - textbufinfo[i].flag &= ~style; - } else { - textbufinfo[i].flag |= style; - } - } - return 1; - } - } - return 0; -} - -int mat_to_sel(void) { - int selstart, selend; - int i; - Curve *cu; - - if (G.obedit && (G.obedit->type == OB_FONT)) { - cu= G.obedit->data; - - if (getselection(&selstart, &selend)) { - for (i=selstart; i<=selend; i++) { - textbufinfo[i].mat_nr = G.obedit->actcol; - } - return 1; - } - } - return 0; -} - -void do_textedit(unsigned short event, short val, unsigned long _ascii) -{ - Curve *cu; - static int accentcode= 0; - int x, doit=0, cursmove=0; - unsigned long ascii = _ascii; - short kern; - - cu= G.obedit->data; - - if(ascii) { - - /* handle case like TAB (TAB==9) */ - if( (ascii > 31 && ascii < 254 && ascii != 127) || (ascii==13) || (ascii==10) || (ascii==8)) { - - if(accentcode) { - if(cu->pos>0) textbuf[cu->pos-1]= findaccent(textbuf[cu->pos-1], ascii); - accentcode= 0; - } - else if(cu->len') ascii= 187; - else if(ascii=='<') ascii= 171; - } - if(ascii==1001) { - int file, filelen; - char *strp; - -/* this should be solved by clipboard support */ -#ifdef __WIN32_DISABLED - file= open("C:\\windows\\temp\\cutbuf", O_BINARY|O_RDONLY); -#else - file= open("/tmp/.cutbuffer", O_BINARY|O_RDONLY); -#endif - if(file>0) { - - filelen = BLI_filesize(file); - - strp= MEM_mallocN(filelen+4, "tempstr"); - read(file, strp, filelen); - close(file); - strp[filelen]= 0; - - if(cu->len+filelenlen += tmplen; - cu->pos= cu->len; - } - MEM_freeN(strp); - } - } - else { - insert_into_textbuf(cu, ascii); - } - } - - killselection(1); - - doit= 1; - } - else - { - insert_into_textbuf(cu, ascii); - doit = 1; - } - } - else if(val) { - cursmove= 0; - - switch(event) { - case ENDKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - while(cu->poslen) { - if( textbuf[cu->pos]==0) break; - if( textbuf[cu->pos]=='\n') break; - if( textbufinfo[cu->pos].flag & CU_WRAP ) break; - cu->pos++; - } - cursmove=FO_CURS; - break; - - case HOMEKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - while(cu->pos>0) { - if( textbuf[cu->pos-1]=='\n') break; - if( textbufinfo[cu->pos-1].flag & CU_WRAP ) break; - cu->pos--; - } - cursmove=FO_CURS; - break; - - case RETKEY: - if(G.qual & LR_CTRLKEY) { - insert_into_textbuf(cu, 1); - if (textbuf[cu->pos]!='\n') insert_into_textbuf(cu, '\n'); - } - else { - insert_into_textbuf(cu, '\n'); - } - cu->selstart = cu->selend = 0; - doit= 1; - break; - - case RIGHTARROWKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - if (G.qual & LR_CTRLKEY) { - cu->pos= next_word(cu); - cursmove= FO_CURS; - } - else if (G.qual & LR_ALTKEY) { - kern = textbufinfo[cu->pos-1].kern; - kern += 1; - if (kern>20) kern = 20; - textbufinfo[cu->pos-1].kern = kern; - doit = 1; - } - else { - cu->pos++; - cursmove= FO_CURS; - } - - break; - - case LEFTARROWKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - if (G.qual & LR_CTRLKEY) { - cu->pos= prev_word(cu); - cursmove= FO_CURS; - } - else if (G.qual & LR_ALTKEY) { - kern = textbufinfo[cu->pos-1].kern; - kern -= 1; - if (kern<-20) kern = -20; - textbufinfo[cu->pos-1].kern = kern; - doit = 1; - } - else { - cu->pos--; - cursmove=FO_CURS; - } - break; - - case UPARROWKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - if(G.qual & LR_ALTKEY) { - if (cu->pos && textbuf[cu->pos - 1] < 255) { - textbuf[cu->pos - 1]++; - doit= 1; - } - } - else cursmove=FO_CURSUP; - break; - - case PAGEUPKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - cursmove=FO_PAGEUP; - break; - - case DOWNARROWKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - if(G.qual & LR_ALTKEY) { - if (cu->pos && textbuf[cu->pos - 1] > 1) { - textbuf[cu->pos - 1]--; - doit= 1; - } - } - else cursmove= FO_CURSDOWN; - break; - - case PAGEDOWNKEY: - if ((G.qual & LR_SHIFTKEY) && (cu->selstart==0)) cu->selstart = cu->selend = cu->pos+1; - cursmove=FO_PAGEDOWN; - break; - - case BACKSPACEKEY: - if(cu->len!=0) { - if(G.qual & LR_ALTKEY) { - if(cu->pos>0) accentcode= 1; - } - else if (G.qual & LR_CTRLKEY) { - cu->len = cu->pos = 0; - textbuf[0]= 0; - doit= 1; - } - else { - if (killselection(0)==0) { - if (cu->pos>0) { - for(x=cu->pos;x<=cu->len;x++) textbuf[x-1]= textbuf[x]; - for(x=cu->pos;x<=cu->len;x++) textbufinfo[x-1]= textbufinfo[x]; - cu->pos--; - textbuf[--cu->len]='\0'; - doit=1; - } - } else doit=1; - } - } - break; - - case DELKEY: - if(cu->len!=0) { - if (killselection(0)==0) { - if(cu->poslen) { - for(x=cu->pos;xlen;x++) textbuf[x]= textbuf[x+1]; - for(x=cu->pos;xlen;x++) textbufinfo[x]= textbufinfo[x+1]; - textbuf[--cu->len]='\0'; - doit=1; - } - } else doit=1; - } - break; - - case IKEY: - if (G.qual & LR_CTRLKEY) { - cu->curinfo.flag ^= CU_ITALIC; - if (style_to_sel(CU_ITALIC, cu->curinfo.flag & CU_ITALIC)) doit= 1; - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case BKEY: - if (G.qual & LR_CTRLKEY) { - cu->curinfo.flag ^= CU_BOLD; - if (style_to_sel(CU_BOLD, cu->curinfo.flag & CU_BOLD)) doit= 1; - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case UKEY: - if (G.qual & LR_CTRLKEY) { - cu->curinfo.flag ^= CU_UNDERLINE; - if (style_to_sel(CU_UNDERLINE, cu->curinfo.flag & CU_UNDERLINE)) doit= 1; - allqueue(REDRAWBUTSEDIT, 0); - } - break; - - case XKEY: - if (G.qual & LR_CTRLKEY) { - copyselection(); - killselection(0); - doit= 1; - } - break; - - case CKEY: - if (G.qual & LR_CTRLKEY) { - copyselection(); - } - break; - - case VKEY: - if (G.qual & LR_CTRLKEY) { - pasteselection(); - doit= 1; - } - break; - - } - - if(cursmove) { - if ((G.qual & LR_SHIFTKEY)==0) { - if (cu->selstart) { - cu->selstart = cu->selend = 0; - update_string(cu); - text_to_curve(G.obedit, FO_SELCHANGE); - allqueue(REDRAWVIEW3D, 0); - } - } - if(cu->pos>cu->len) cu->pos= cu->len; - else if(cu->pos>=MAXTEXT) cu->pos= MAXTEXT; - else if(cu->pos<0) cu->pos= 0; - } - } - if(doit || cursmove) { - - if (cu->pos) { - cu->curinfo = textbufinfo[cu->pos-1]; - } else cu->curinfo = textbufinfo[0]; - - if (G.obedit->totcol>0) { - G.obedit->actcol = textbufinfo[cu->pos-1].mat_nr; - } - allqueue(REDRAWBUTSEDIT, 0); - update_string(cu); - text_to_curve(G.obedit, cursmove); - if (cursmove && (G.qual & LR_SHIFTKEY)) { - cu->selend = cu->pos; - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - if(cursmove==0) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - - BIF_undo_push("Textedit"); - allqueue(REDRAWVIEW3D, 0); - } -} - -void paste_unicodeText(char *filename) -{ - Curve *cu= G.obedit->data; - int filelen, doit= 0; - char *strp; - FILE *fp = NULL; - - fp= fopen(filename, "r"); - - if(fp) { - - fseek( fp, 0L, SEEK_END ); - filelen = ftell( fp ); - fseek( fp, 0L, SEEK_SET ); - - strp= MEM_mallocN(filelen+4, "tempstr"); - //fread() instead of read(), - //because windows read() converts text to DOS \r\n linebreaks - //causing double linebreaks in the 3d text - filelen = fread(strp, 1, filelen, fp); - fclose(fp); - strp[filelen]= 0; - - - if(cu->len+filelenlen += tmplen; - cu->pos= cu->len; - } - MEM_freeN(strp); - doit = 1; - } - if(doit) { - update_string(cu); - text_to_curve(G.obedit, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Paste text"); - } -} - -void paste_editText(void) -{ - Curve *cu= G.obedit->data; - int filelen, doit= 0; - char *strp; - FILE *fp = NULL; - -#ifdef WIN32 - fp= fopen("C:\\windows\\temp\\cutbuf.txt", "r"); - -// The following is more likely to work on all Win32 installations. -// suggested by Douglas Toltzman. Needs windows include files... -/* - char tempFileName[MAX_PATH]; - DWORD pathlen; - static const char cutbufname[]="cutbuf.txt"; - - if ((pathlen=GetTempPath(sizeof(tempFileName),tempFileName)) > 0 && - pathlen + sizeof(cutbufname) <= sizeof(tempFileName)) - { - strcat(tempFileName,cutbufname); - file= open(tempFileName, O_BINARY|O_RDONLY); - } -*/ -#else - fp= fopen("/tmp/.cutbuffer", "r"); -#endif - - if(fp) { - - fseek(fp, 0L, SEEK_END); - filelen = ftell( fp ); - fseek(fp, 0L, SEEK_SET); - - strp= MEM_mallocN(filelen+4, "tempstr"); - // fread() instead of read(), - // because windows read() converts text to DOS \r\n linebreaks - // causing double linebreaks in the 3d text - filelen = fread(strp, 1, filelen, fp); - fclose(fp); - strp[filelen]= 0; - - if(cu->len+filelenlen += tmplen; - cu->pos= cu->len; - } - MEM_freeN(strp); - doit = 1; - } - if(doit) { - update_string(cu); - text_to_curve(G.obedit, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Paste text"); - } -} - - -void make_editText(void) -{ - Curve *cu; - cu= G.obedit->data; - - if(textbuf==NULL) textbuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditbuf"); - if(textbufinfo==NULL) textbufinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "texteditbufinfo"); - if(copybuf==NULL) copybuf= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "texteditcopybuf"); - if(copybufinfo==NULL) copybufinfo= MEM_callocN((MAXTEXT+4)*sizeof(CharInfo), "texteditcopybufinfo"); - if(oldstr==NULL) oldstr= MEM_callocN((MAXTEXT+4)*sizeof(wchar_t), "oldstrbuf"); - - // Convert the original text to wchar_t - utf8towchar_(textbuf, cu->str); - wcscpy(oldstr, textbuf); - - cu->len= wcslen(textbuf); - - memcpy(textbufinfo, cu->strinfo, (cu->len)*sizeof(CharInfo)); - - oldstrinfo= cu->strinfo; - cu->strinfo= textbufinfo; - - if(cu->pos>cu->len) cu->pos= cu->len; - - if (cu->pos) { - cu->curinfo = textbufinfo[cu->pos-1]; - } else cu->curinfo = textbufinfo[0]; - - // Convert to UTF-8 - update_string(cu); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - textediting= 1; - BIF_undo_push("Original"); -} - - -void load_editText(void) -{ - Curve *cu; - - cu= G.obedit->data; - - MEM_freeN(oldstr); - oldstr= NULL; - MEM_freeN(oldstrinfo); - oldstrinfo= NULL; - - update_string(cu); - - cu->strinfo= MEM_callocN((cu->len+4)*sizeof(CharInfo), "texteditinfo"); - memcpy(cu->strinfo, textbufinfo, (cu->len)*sizeof(CharInfo)); - - cu->len= strlen(cu->str); - - /* this memory system is weak... */ - MEM_freeN(textbuf); - MEM_freeN(textbufinfo); - textbuf= NULL; - textbufinfo= NULL; - - if (selboxes) { - MEM_freeN(selboxes); - selboxes= NULL; - } - - textediting= 0; - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -} - - -void remake_editText(void) -{ - Curve *cu; - - if(okee("Reload original text")==0) return; - - // Copy the oldstr to textbuf temporary global variable - wcscpy(textbuf, oldstr); - - // Set the object length and position - cu= G.obedit->data; - cu->len= wcslen(textbuf); - if(cu->pos>cu->len) cu->pos= cu->len; - - update_string(cu); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - - BIF_undo_push("Reload"); -} - - -void free_editText(void) -{ - if(oldstr) MEM_freeN(oldstr); - if(oldstrinfo) MEM_freeN(oldstrinfo); - if(textbuf) MEM_freeN(textbuf); - textbuf = oldstr = NULL; - textbufinfo = oldstrinfo = NULL; - textediting= 0; -} - - -void add_primitiveFont(int dummy_argument) -{ - Curve *cu; - - if (G.obedit && G.obedit->type==OB_FONT) return; - check_editmode(OB_FONT); - - add_object_draw(OB_FONT); - base_init_from_view3d(BASACT, G.vd); - - where_is_object(BASACT->object); - - cu= BASACT->object->data; - - cu->vfont= cu->vfontb= cu->vfonti= cu->vfontbi= get_builtin_font(); - cu->vfont->id.us+=4; - cu->str= MEM_mallocN(12, "str"); - strcpy(cu->str, "Text"); - cu->pos= 4; - cu->strinfo= MEM_callocN(12*sizeof(CharInfo), "strinfo"); - cu->totbox= cu->actbox= 1; - cu->tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "textbox"); - cu->tb[0].w = cu->tb[0].h = 0.0; - - if (U.flag & USER_ADD_EDITMODE) - enter_editmode(EM_WAITCURSOR); - - allqueue(REDRAWALL, 0); -} - -void to_upper(void) -{ - Curve *cu; - int len, ok; - wchar_t *str; - - if(G.obedit==0) { - return; - } - - ok= 0; - cu= G.obedit->data; - - len= wcslen(textbuf); - str= textbuf; - while(len) { - if( *str>=97 && *str<=122) { - ok= 1; - *str-= 32; - } - len--; - str++; - } - - if(ok==0) { - len= wcslen(textbuf); - str= textbuf; - while(len) { - if( *str>=65 && *str<=90) { - *str+= 32; - } - len--; - str++; - } - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("To upper"); - - update_string(cu); -} - - -/* **************** undo for font object ************** */ - -static void undoFont_to_editFont(void *strv) -{ - Curve *cu= G.obedit->data; - char *str= strv; - - cu->pos= *((short *)str); - cu->len= *((short *)(str+2)); - - memcpy(textbuf, str+4, (cu->len+1)*sizeof(wchar_t)); - memcpy(textbufinfo, str+4 + (cu->len+1)*sizeof(wchar_t), cu->len*sizeof(CharInfo)); - - cu->selstart = cu->selend = 0; - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - update_string(cu); - - allqueue(REDRAWVIEW3D, 0); -} - -static void *editFont_to_undoFont(void) -{ - Curve *cu= G.obedit->data; - char *str; - - // The undo buffer includes [MAXTEXT+6]=actual string and [MAXTEXT+4]*sizeof(CharInfo)=charinfo - str= MEM_callocN((MAXTEXT+6)*sizeof(wchar_t) + (MAXTEXT+4)*sizeof(CharInfo), "string undo"); - - // Copy the string and string information - memcpy(str+4, textbuf, (cu->len+1)*sizeof(wchar_t)); - memcpy(str+4 + (cu->len+1)*sizeof(wchar_t), textbufinfo, cu->len*sizeof(CharInfo)); - - *((short *)str)= cu->pos; - *((short *)(str+2))= cu->len; - - return str; -} - -static void free_undoFont(void *strv) -{ - MEM_freeN(strv); -} - -/* and this is all the undo system needs to know */ -void undo_push_font(char *name) -{ - undo_editmode_push(name, free_undoFont, undoFont_to_editFont, editFont_to_undoFont); -} - - - -/***/ diff --git a/source/blender/src/editgroup.c b/source/blender/src/editgroup.c deleted file mode 100644 index b17e6efee1b..00000000000 --- a/source/blender/src/editgroup.c +++ /dev/null @@ -1,186 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_group_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_depsgraph.h" -#include "BKE_group.h" -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BIF_interface.h" -#include "BIF_editgroup.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "blendef.h" -#include "mydevice.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -void add_selected_to_group(Group *group) -{ - Base *base; - - for(base=FIRSTBASE; base; base= base->next) { - if TESTBASE(base) { - add_to_group(group, base->object); - base->object->flag |= OB_FROMGROUP; - base->flag |= OB_FROMGROUP; - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - DAG_scene_sort(G.scene); - BIF_undo_push("Add to Group"); -} - -void add_selected_to_act_ob_groups(void) -{ - Object *ob= OBACT, *obt; - Base *base; - Group *group; - - if (!ob) return; - - /* linking to same group requires its own loop so we can avoid - looking up the active objects groups each time */ - - group= G.main->group.first; - while(group) { - if(object_in_group(ob, group)) { - /* Assign groups to selected objects */ - base= FIRSTBASE; - while(base) { - if(TESTBASE(base)) { - obt= base->object; - add_to_group(group, obt); - obt->flag |= OB_FROMGROUP; - base->flag |= OB_FROMGROUP; - } - base= base->next; - } - } - group= group->id.next; - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - DAG_scene_sort(G.scene); - BIF_undo_push("Add to Active Objects Group"); -} - - -void rem_selected_from_group(void) -{ - Base *base; - Group *group; - - for(base=FIRSTBASE; base; base= base->next) { - if TESTBASE(base) { - - while( (group = find_group(base->object)) ) { - rem_from_group(group, base->object); - } - base->object->flag &= ~OB_FROMGROUP; - base->flag &= ~OB_FROMGROUP; - } - } - - DAG_scene_sort(G.scene); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - BIF_undo_push("Remove from Group"); -} - -void group_operation_with_menu(void) -{ - Group *group= NULL; - int mode; - - /* are there existing groups? */ - for(group= G.main->group.first; group; group= group->id.next) - if(group->id.lib==NULL) - break; - - if(group) - mode= pupmenu("Groups %t|Add to Existing Group %x3|Add to Active Objects Groups %x4|Add to New Group %x1|Remove from All Groups %x2"); - else - mode= pupmenu("Groups %t|Add to New Group %x1|Remove from All Groups %x2"); - - group_operation(mode); -} - -void group_operation(int mode) -{ - Group *group= NULL; - - /* are there existing groups? */ - for(group= G.main->group.first; group; group= group->id.next) - if(group->id.lib==NULL) - break; - - if(mode>0) { - if(group==NULL || mode==1) group= add_group( "Group" ); - if(mode==3) { - int tot= BLI_countlist(&G.main->group); - char *strp= MEM_callocN(tot*32 + 32, "group menu"), *strp1; - - strp1= strp; - for(tot=1, group= G.main->group.first; group; group= group->id.next, tot++) { - if(group->id.lib==NULL) { - strp1 += sprintf(strp1, "%s %%x%d|", group->id.name+2, tot); - } - } - tot= pupmenu(strp); - MEM_freeN(strp); - if(tot>0) group= BLI_findlink(&G.main->group, tot-1); - else return; - } - - if(mode==4) add_selected_to_act_ob_groups(); - else if(mode==1 || mode==3) add_selected_to_group(group); - else if(mode==2) rem_selected_from_group(); - } -} diff --git a/source/blender/src/editimasel.c b/source/blender/src/editimasel.c deleted file mode 100644 index cf6a86917b7..00000000000 --- a/source/blender/src/editimasel.c +++ /dev/null @@ -1,1156 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_depsgraph.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_storage_types.h" - -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif - -#include "DNA_armature_types.h" -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_texture_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vfont_types.h" -#include "DNA_view3d_types.h" - - -#include "BIF_filelist.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_imasel.h" -#include "BIF_gl.h" -#include "BIF_fsmenu.h" -#include "BIF_editview.h" -#include "BIF_toolbox.h" - -#include "BLO_readfile.h" - -#include "BPI_script.h" - -#include "BSE_drawipo.h" -#include "BSE_drawimasel.h" -#include "BSE_edit.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "mydevice.h" - -/* for events */ -#define NOTACTIVE 0 -#define ACTIVATE 1 -#define INACTIVATE 2 -/* for state of file */ -#define ACTIVE 2 - -static void imasel_select_objects(SpaceImaSel *simasel); - -static int imasel_has_func(SpaceImaSel *simasel) -{ - if(simasel->returnfunc || simasel->returnfunc_event || simasel->returnfunc_args) - return 1; - return 0; -} - -#if defined __BeOS -static int fnmatch(const char *pattern, const char *string, int flags) -{ - return 0; -} -#elif defined WIN32 && !defined _LIBC - /* use fnmatch included in blenlib */ - #include "BLI_fnmatch.h" -#else - #include -#endif - -static void imasel_split_file(SpaceImaSel *simasel, char *s1) -{ - char string[FILE_MAX], dir[FILE_MAX], file[FILE_MAX]; - - BLI_strncpy(string, s1, sizeof(string)); - - BLI_split_dirfile(string, dir, file); - - if(simasel->files) { - BIF_filelist_free(simasel->files); - } - BLI_strncpy(simasel->file, file, sizeof(simasel->file)); - BLI_strncpy(simasel->dir, dir, sizeof(simasel->dir)); - - BIF_filelist_setdir(simasel->files, dir); - - BLI_make_file_string(G.sce, simasel->dir, dir, ""); -} - -/**************** IMAGESELECT ******************************/ - -/* the complete call; pulldown menu, and three callback types */ -static void activate_imageselect_(int type, char *title, char *file, short *menup, char *pupmenu, - void (*func)(char *), - void (*func_event)(unsigned short), - void (*func_args)(char *, void *arg1, void *arg2), - void *arg1, void *arg2) -{ - SpaceImaSel *simasel; - char group[24], name[FILE_MAX], temp[FILE_MAX]; - - if(curarea==0) return; - if(curarea->win==0) return; - - newspace(curarea, SPACE_IMASEL); - scrarea_queue_winredraw(curarea); - - /* sometime double, when area already is SPACE_IMASEL with a different file name */ - if(curarea->headwin) addqueue(curarea->headwin, CHANGED, 1); - - name[2]= 0; - BLI_strncpy(name, file, sizeof(name)); - - simasel= curarea->spacedata.first; - - simasel->returnfunc= func; - simasel->returnfunc_event= func_event; - simasel->returnfunc_args= func_args; - simasel->arg1= arg1; - simasel->arg2= arg2; - - simasel->type= type; - simasel->scrollpos = 0.0f; - - if(simasel->pupmenu) - MEM_freeN(simasel->pupmenu); - simasel->pupmenu= pupmenu; - simasel->menup= menup; - - /* sfile->act is used for databrowse: double names of library objects */ - simasel->active_file= -1; - - if(!simasel->files) { - simasel->files = BIF_filelist_new(); - } - - if(G.relbase_valid && BLI_convertstringcode(name, G.sce, G.scene->r.cfra)) - simasel->flag |= FILE_STRINGCODE; - else - simasel->flag &= ~FILE_STRINGCODE; - - if (U.uiflag & USER_HIDE_DOT) - simasel->flag |= FILE_HIDE_DOT; - - if(type==FILE_MAIN) { - char *groupname; - - BLI_strncpy(simasel->file, name+2, sizeof(simasel->file)); - - groupname = BLO_idcode_to_name( GS(name) ); - if (groupname) { - BLI_strncpy(simasel->dir, groupname, sizeof(simasel->dir) - 1); - strcat(simasel->dir, "/"); - } - - /* free all */ - if (simasel->files) { - BIF_filelist_freelib(simasel->files); - BIF_filelist_free(simasel->files); - BIF_filelist_setdir(simasel->files, simasel->dir); - BIF_filelist_settype(simasel->files, type); - } - } - else if(type==FILE_LOADLIB) { - - if( BIF_filelist_islibrary(simasel->files, temp, group) ) { - /* force a reload of the library-filelist */ - BIF_filelist_free(simasel->files); - BIF_filelist_freelib(simasel->files); - BLI_strncpy(simasel->dir, name, sizeof(simasel->dir)); - BIF_filelist_setdir(simasel->files, simasel->dir); - BIF_filelist_settype(simasel->files, type); - } - else { - imasel_split_file(simasel, name); - BIF_filelist_freelib(simasel->files); - BIF_filelist_settype(simasel->files, type); - } - } - else { /* FILE_BLENDER */ - imasel_split_file(simasel, name); - BIF_filelist_settype(simasel->files, type); - - BLI_cleanup_dir(G.sce, simasel->dir); - - /* free: filelist and libfiledata became incorrect */ - BIF_filelist_freelib(simasel->files); - } - BLI_strncpy(simasel->title, title, sizeof(simasel->title)); - /* filetoname= 1; */ /* TODO: elubie - check what this means */ -} - -void activate_imageselect(int type, char *title, char *file, void (*func)(char *)) -{ - activate_imageselect_(type, title, file, NULL, NULL, func, NULL, NULL, NULL, NULL); -} - -void activate_imageselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *)) -{ - activate_imageselect_(type, title, file, menup, pupmenu, func, NULL, NULL, NULL, NULL); -} - -void activate_imageselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2) -{ - activate_imageselect_(type, title, file, NULL, NULL, NULL, NULL, func, arg1, arg2); -} - -void activate_databrowse_imasel(ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short)) -{ - ListBase *lb; - SpaceImaSel *simasel; - char str[32]; - - if(id==NULL) { - lb= wich_libbase(G.main, idcode); - id= lb->first; - } - - if(id) BLI_strncpy(str, id->name, sizeof(str)); - else return; - - activate_imageselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, func, NULL, NULL, NULL); - - simasel= curarea->spacedata.first; - simasel->retval= retval; - simasel->menup= menup; - - BIF_filelist_setipotype(simasel->files, fromcode); - BIF_filelist_hasfunc(simasel->files, imasel_has_func(simasel)); -} - - -static void set_active_file(SpaceImaSel *simasel, short x, short y) -{ - short tilex, tiley; - int active_tile; - int active_file; - int stridex; - struct direntry* file; - rcti viewrect = simasel->viewrect; - int fileoffset; - int rowoffset; - int rowleftover; - float scrollofs; - int numfiles; - int tilewidth = simasel->prv_w + TILE_BORDER_X*4; - int tileheight = simasel->prv_h + TILE_BORDER_Y*4 + U.fontsize; - - numfiles = BIF_filelist_numfiles(simasel->files); - - if (simasel->numtilesx > 0) { - fileoffset = numfiles*(simasel->scrollpos / simasel->scrollarea) + 0.5; - rowoffset = (fileoffset / simasel->numtilesx)*simasel->numtilesx; - rowleftover = fileoffset % simasel->numtilesx; - scrollofs = (float)tileheight*(float)rowleftover/(float)simasel->numtilesx; - - stridex = (viewrect.xmax - viewrect.xmin) / (tilewidth); - tilex = ( (x-viewrect.xmin)) / (tilewidth); - tiley = (viewrect.ymax - viewrect.ymin + scrollofs - y) / (tileheight); - if (tilex >= simasel->numtilesx) tilex = simasel->numtilesx-1; - if (tiley >= simasel->numtilesy+1) tiley = simasel->numtilesy; - if (tilex < 0) tilex=0; - if (tiley < 0) tiley = 0; - active_tile = tilex + stridex*tiley; - active_file = rowoffset + active_tile; - - if (active_file >= 0 && active_file < BIF_filelist_numfiles(simasel->files) ) - { - simasel->active_file = active_file; - if (simasel->selstate & ACTIVATE) { - file = BIF_filelist_file(simasel->files, simasel->active_file); - file->flags |= ACTIVE; - } - } else { - simasel->active_file = -1; - } - } else { - simasel->active_file = -1; - } -} - -static void set_active_bookmark(SpaceImaSel *simasel, short y) -{ - int nentries = fsmenu_get_nentries(); - short posy = simasel->bookmarkrect.ymax - TILE_BORDER_Y - y; - simasel->active_bookmark = ((float)posy / (U.fontsize*3.0f/2.0f)); - if (simasel->active_bookmark < 0 || simasel->active_bookmark > nentries) { - simasel->active_bookmark = -1; - } -} - -static void imasel_prevspace() -{ - SpaceImaSel *simasel; - - simasel= curarea->spacedata.first; - - /* cleanup */ - if(simasel->spacetype==SPACE_IMASEL) { - if(simasel->pupmenu) { - MEM_freeN(simasel->pupmenu); - simasel->pupmenu= NULL; - } - } - - if(simasel->next) { - - BLI_remlink(&curarea->spacedata, simasel); - BLI_addtail(&curarea->spacedata, simasel); - - simasel= curarea->spacedata.first; - - if (simasel->spacetype == SPACE_SCRIPT) { - SpaceScript *sc = (SpaceScript *)simasel; - if (sc->script) sc->script->flags &=~SCRIPT_FILESEL; - } - - newspace(curarea, simasel->spacetype); - } - else newspace(curarea, SPACE_INFO); -} - -static void free_imasel_spec(char *dir) -{ - /* all filesels with 'dir' are freed */ - bScreen *sc; - - sc= G.main->screen.first; - while(sc) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_FILE) { - SpaceImaSel *simasel= (SpaceImaSel*) sl; - if (BLI_streq(simasel->dir, dir)) { - BIF_filelist_free(simasel->files); - } - } - sl= sl->next; - } - sa= sa->next; - } - sc= sc->id.next; - } -} - -static void do_library_append(SpaceImaSel *simasel) -{ - Library *lib; - char dir[FILE_MAXDIR], group[32]; - - if ( BIF_filelist_islibrary(simasel->files, dir, group)==0 ) { - error("Not a library"); - } else if (!BIF_filelist_lib(simasel->files) ) { - error("Library not loaded"); - } else if (group[0]==0) { - error("Nothing indicated"); - } else if (BLI_streq(G.main->name, dir)) { - error("Cannot use current file as library"); - } else { - Object *ob; - int idcode = BIF_groupname_to_code(group); - - if((simasel->flag & FILE_LINK)==0) { - /* tag everything, all untagged data can be made local */ - ID *id; - ListBase *lbarray[MAX_LIBARRAY]; - int a; - - a= set_listbasepointers(G.main, lbarray); - while(a--) { - for(id= lbarray[a]->first; id; id= id->next) id->flag |= LIB_APPEND_TAG; - } - } - - BIF_filelist_append_library(simasel->files, dir, simasel->file, simasel->flag, idcode); - - /* DISPLISTS? */ - ob= G.main->object.first; - while(ob) { - if(ob->id.lib) { - ob->recalc |= OB_RECALC; - } - ob= ob->id.next; - } - - /* and now find the latest append lib file */ - lib= G.main->library.first; - while(lib) { - if (BLI_streq(dir, lib->filename)) break; - lib= lib->id.next; - } - - /* make local */ - if(lib) { - if((simasel->flag & FILE_LINK)==0) - all_local(lib,1); - } - - DAG_scene_sort(G.scene); - - /* in sfile->dir is the whole lib name */ - BLI_strncpy(G.lib, simasel->dir, sizeof(G.lib) ); - - } -} - -/* NOTE: this is called for file read, after the execfunc no UI memory is valid! */ -static void imasel_execute(SpaceImaSel *simasel) -{ - struct direntry *file; - char name[FILE_MAX]; - int a; - int n; - - imasel_prevspace(); - - if(simasel->type==FILE_LOADLIB) { - if(simasel->flag & FILE_STRINGCODE) { - if (!G.relbase_valid) { - okee("You have to save the .blend file before using relative paths! Using absolute path instead."); - simasel->flag &= ~FILE_STRINGCODE; - } - } - - do_library_append(simasel); - BIF_undo_push("Append from file"); - allqueue(REDRAWALL, 1); - } - else if(imasel_has_func(simasel)) { - fsmenu_insert_entry(simasel->dir, 1, 0); - - if(simasel->type==FILE_MAIN) { /* DATABROWSE */ - if (simasel->menup) { /* with value pointing to ID block index */ - int notfound = 1; - - /* Need special handling since hiding .* datablocks means that - simasel->active_file is no longer the same as files->nr. - - Also, toggle HIDE_DOT on and off can make simasel->active_file not longer - correct (meaning it doesn't point to the correct item in the filelist. - - simasel->file is always correct, so first with check if, for the item - corresponding to simasel->active_file, the name is the same. - - If it isn't (or if simasel->active_file is not good), go over filelist and take - the correct one. - - This means that selecting a datablock than hiding it makes it - unselectable. Not really a problem. - - - theeth - */ - - *simasel->menup= -1; - n = BIF_filelist_numfiles(simasel->files); - if(simasel->files) { - if( (simasel->active_file>=0) && (simasel->active_file < n) ) { - file = BIF_filelist_file(simasel->files, simasel->active_file); - if ( strcmp(file->relname, simasel->file)==0) { - notfound = 0; - *simasel->menup= file->nr; - } - } - if (notfound) { - for(a=0; afiles, a); - if( strcmp(file->relname, simasel->file)==0) { - *simasel->menup= file->nr; - break; - } - } - } - } - } - if(simasel->returnfunc_event) - simasel->returnfunc_event(simasel->retval); - else if(simasel->returnfunc_args) - simasel->returnfunc_args(NULL, simasel->arg1, simasel->arg2); - } - else { - if(strncmp(simasel->title, "Save", 4)==0) free_imasel_spec(simasel->dir); - if(strncmp(simasel->title, "Export", 6)==0) free_imasel_spec(simasel->dir); - - BLI_strncpy(name, simasel->dir, sizeof(name)); - strcat(name, simasel->file); - - if(simasel->flag & FILE_STRINGCODE) { - /* still weak, but we don't want saving files to make relative paths */ - if(G.relbase_valid && strncmp(simasel->title, "Save", 4)) { - BLI_makestringcode(G.sce, name); - } else { - /* if we don't have a valid relative base (.blend file hasn't been saved yet) - then we don't save the path as relative (for texture images, background image). - Warning message not shown when saving files (doesn't make sense there) - */ - if (strncmp(simasel->title, "Save", 4)) { - printf("Relative path setting has been ignored because .blend file hasn't been saved yet.\n"); - } - simasel->flag &= ~FILE_STRINGCODE; - } - } - if(simasel->returnfunc) - simasel->returnfunc(name); - else if(simasel->returnfunc_args) - simasel->returnfunc_args(name, simasel->arg1, simasel->arg2); - } - } -} - -static void do_imasel_buttons(short event, SpaceImaSel *simasel) -{ - char butname[FILE_MAX]; - - if (event == B_FS_FILENAME) { - if (strchr(simasel->file, '*') || strchr(simasel->file, '?') || strchr(simasel->file, '[')) { - int i, match = FALSE; - struct direntry *file; - int n = BIF_filelist_numfiles(simasel->files); - for (i = 2; i < n; i++) { - file = BIF_filelist_file(simasel->files, i); - if (fnmatch(simasel->file, file->relname, 0) == 0) { - file->flags |= ACTIVE; - match = TRUE; - } - } - if (match) simasel->file[0] = '\0'; - if(simasel->type==FILE_MAIN) imasel_select_objects(simasel); - scrarea_queue_winredraw(curarea); - } - } - else if(event== B_FS_DIRNAME) { - /* reuse the butname variable */ - BLI_cleanup_dir(G.sce, simasel->dir); - - BLI_make_file_string(G.sce, butname, simasel->dir, ""); - BLI_strncpy(simasel->dir, butname, sizeof(simasel->dir)); - - /* strip the trailing slash if its a real dir */ - if (strlen(butname)!=1) - butname[strlen(butname)-1]=0; - - /* updating the directory in the filelist */ - BIF_filelist_setdir(simasel->files, simasel->dir); - - if(simasel->type & FILE_UNIX) { - if (!BLI_exists(butname)) { - if (okee("Makedir")) { - BLI_recurdir_fileops(butname); - if (!BLI_exists(butname)) { - BIF_filelist_free(simasel->files); - BIF_filelist_parent(simasel->files); - BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80); - } - } else { - BIF_filelist_free(simasel->files); - BIF_filelist_parent(simasel->files); - BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80); - } - } - } - BIF_filelist_free(simasel->files); - simasel->file[0] = '\0'; - simasel->scrollpos = 0; - simasel->active_file = -1; - scrarea_queue_winredraw(curarea); - } - else if(event== B_FS_DIR_MENU) { - char *selected= fsmenu_get_entry(simasel->menu-1); - - /* which string */ - if (selected) { - BLI_strncpy(simasel->dir, selected, sizeof(simasel->dir)); - BLI_make_exist(simasel->dir); - BLI_cleanup_dir(G.sce, simasel->dir); - BIF_filelist_free(simasel->files); - BIF_filelist_setdir(simasel->files, simasel->dir); - simasel->file[0] = '\0'; - simasel->scrollpos = 0; - simasel->active_file = -1; - scrarea_queue_redraw(curarea); - } - - simasel->active_file = -1; - - } - else if(event== B_FS_PARDIR) { - BIF_filelist_free(simasel->files); - BIF_filelist_parent(simasel->files); - BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80); - simasel->file[0] = '\0'; - simasel->active_file = -1; - simasel->scrollpos = 0; - scrarea_queue_redraw(curarea); - } - else if(event== B_FS_LOAD) { - if(simasel->type) - imasel_execute(simasel); - } - else if(event== B_FS_CANCEL) - imasel_prevspace(); - else if(event== B_FS_LIBNAME) { - Library *lib= BLI_findlink(&G.main->library, simasel->menu); - if(lib) { - BLI_strncpy(simasel->dir, lib->filename, sizeof(simasel->dir)); - BLI_make_exist(simasel->dir); - BLI_cleanup_dir(G.sce, simasel->dir); - BIF_filelist_free(simasel->files); - BIF_filelist_setdir(simasel->files, simasel->dir); - simasel->file[0] = '\0'; - simasel->scrollpos = 0; - simasel->active_file = -1; - scrarea_queue_winredraw(curarea); - } - } else if(event== B_FS_BOOKMARK) { - char name[FILE_MAX]; - BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); - fsmenu_insert_entry(simasel->dir, 1, 1); - scrarea_queue_winredraw(curarea); - fsmenu_write_file(name); - } - -} - -static void imasel_home(ScrArea *sa, SpaceImaSel *simasel) -{ - simasel->v2d.cur.xmin= simasel->v2d.cur.ymin= 0.0f; - simasel->v2d.cur.xmax= sa->winx; - simasel->v2d.cur.ymax= sa->winy; - - simasel->v2d.tot= simasel->v2d.cur; - test_view2d(G.v2d, sa->winx, sa->winy); - -} - -static struct direntry* get_hilited_entry(SpaceImaSel *simasel) -{ - struct direntry *file; - file = BIF_filelist_file(simasel->files, simasel->active_file); - return file; -} - -static void do_filescroll(SpaceImaSel *simasel) -{ - short mval[2], oldy, yo; - float scrollarea, scrollstep; - - /* for beauty */ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - getmouseco_areawin(mval); - oldy= yo= mval[1]; - - while(get_mbut()&L_MOUSE) { - getmouseco_areawin(mval); - - if(yo!=mval[1]) { - scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - scrollstep = yo - mval[1]; - simasel->scrollpos += scrollstep; - - if (simasel->scrollpos<0) - simasel->scrollpos=0; - if (simasel->scrollpos > scrollarea - simasel->scrollheight) - simasel->scrollpos = scrollarea - simasel->scrollheight; - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - yo= mval[1]; - } - else BIF_wait_for_statechange(); - } - - /* for beauty */ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - -} - -/* ******************* DATA SELECT ********************* */ - -static void imasel_select_objects(SpaceImaSel *simasel) -{ - Object *ob; - Base *base; - Scene *sce; - struct direntry* file; - int a; - int totfile; - - /* only when F4 DATABROWSE */ - if(imasel_has_func(simasel)) return; - - totfile = BIF_filelist_numfiles(simasel->files); - - if( strcmp(simasel->dir, "Object/")==0 ) { - for(a=0; afiles, a); - ob= (Object *)file->poin; - - if(ob) { - if(file->flags & ACTIVE) ob->flag |= SELECT; - else ob->flag &= ~SELECT; - } - - } - base= FIRSTBASE; - while(base) { - base->flag= base->object->flag; - base= base->next; - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - } - else if( strcmp(simasel->dir, "Scene/")==0 ) { - - for(a=0; afiles, a); - sce= (Scene *)file->poin; - if(sce) { - if(file->flags & ACTIVE) sce->r.scemode |= R_BG_RENDER; - else sce->r.scemode &= ~R_BG_RENDER; - } - - } - allqueue(REDRAWBUTSSCENE, 0); - } -} - -static void active_imasel_object(SpaceImaSel *simasel) -{ - Object *ob; - struct direntry* file; - - /* only when F4 DATABROWSE */ - if(imasel_has_func(simasel)) return; - - if( strcmp(simasel->dir, "Object/")==0 ) { - int n = BIF_filelist_numfiles(simasel->files); - if(simasel->active_file >= 0 && simasel->active_file < n) { - file = BIF_filelist_file(simasel->files, simasel->active_file); - ob= (Object *)file->poin; - - if(ob) { - set_active_object(ob); - if(BASACT && BASACT->object==ob) { - BASACT->flag |= SELECT; - file->flags |= ACTIVE; - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - scrarea_queue_winredraw(curarea); - } - } - } - } -} - - - -void winqreadimaselspace(ScrArea *, void *, BWinEvent *); - - -void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - SpaceImaSel *simasel; - - char str[FILE_MAXDIR+FILE_MAXFILE+12]; - short mval[2]; - short do_draw = 0; - short do_headdraw = 0; - int numfiles; - struct direntry *file; - float scrollstep = 0; - float scrollarea; - - // if(val==0) return; - simasel= curarea->spacedata.first; - - if (!simasel->files) - return; - - if (BIF_filelist_empty(simasel->files)) - return; - - numfiles = BIF_filelist_numfiles(simasel->files); - - /* calc_scrollrcts(sa, &(simasel->v2d), sa->winx, sa->winy); */ - calc_imasel_rcts(simasel, sa->winx, sa->winy); - - /* prevent looping */ - if(simasel->selstate && !(get_mbut() & R_MOUSE)) simasel->selstate= 0; - - if(val) { - - if( event!=RETKEY && event!=PADENTER) - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - switch(event) { - - case UI_BUT_EVENT: - do_imasel_buttons(val, simasel); - break; - case RENDERPREVIEW: - do_draw= 1; - /* draw_imasel_previews(sa, simasel); */ - break; - case REDRAWIMASEL: - do_draw= 1; - break; - case WHEELDOWNMOUSE: - numfiles = BIF_filelist_numfiles(simasel->files); - scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)*simasel->numtilesx; - simasel->scrollpos += scrollstep; - if (simasel->scrollpos > scrollarea - simasel->scrollheight) - simasel->scrollpos = scrollarea - simasel->scrollheight; - do_draw= 1; - break; - case WHEELUPMOUSE: - numfiles = BIF_filelist_numfiles(simasel->files); - scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - scrollstep = ((scrollarea-simasel->scrollheight)/numfiles)*simasel->numtilesx; - simasel->scrollpos -= scrollstep; - if (simasel->scrollpos<0) - simasel->scrollpos=0; - do_draw= 1; - break; - case PAGEUPKEY: - numfiles = BIF_filelist_numfiles(simasel->files); - scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - scrollstep = ((scrollarea-simasel->scrollheight)/numfiles) - *simasel->numtilesx*simasel->numtilesy; - simasel->scrollpos -= scrollstep; - if (simasel->scrollpos<0) - simasel->scrollpos=0; - do_draw= 1; - break; - case PAGEDOWNKEY: - numfiles = BIF_filelist_numfiles(simasel->files); - scrollarea = ((float)simasel->v2d.vert.ymax - (float)simasel->v2d.vert.ymin); - scrollstep = ((scrollarea-simasel->scrollheight)/numfiles) - * simasel->numtilesx*simasel->numtilesy; - simasel->scrollpos += scrollstep; - if (simasel->scrollpos > scrollarea - simasel->scrollheight) - simasel->scrollpos = scrollarea - simasel->scrollheight; - do_draw= 1; - break; - case HOMEKEY: - simasel->scrollpos=0; - imasel_home(sa, simasel); - do_draw= 1; - break; - case ENDKEY: - simasel->scrollpos = simasel->scrollarea; - do_draw= 1; - break; - - case ESCKEY: - BIF_filelist_free(simasel->files); - imasel_prevspace(); - break; - case PERIODKEY: - BIF_filelist_free(simasel->files); - simasel->active_file = -1; - do_draw = 1; - break; - case LEFTMOUSE: - case MIDDLEMOUSE: - getmouseco_areawin(mval); - if(mval[0]>simasel->v2d.vert.xmin && mval[0]v2d.vert.xmax && mval[1]>simasel->v2d.vert.ymin && mval[1]v2d.vert.ymax) { - do_filescroll(simasel); - } - else if(mval[0]>simasel->viewrect.xmin && mval[0]viewrect.xmax - && mval[1]>simasel->viewrect.ymin && mval[1]viewrect.ymax) { - set_active_file(simasel, mval[0], mval[1]); - if (simasel->active_file >= 0 && simasel->active_file < numfiles) { - file = BIF_filelist_file(simasel->files, simasel->active_file); - - if(file && S_ISDIR(file->type)) { - strcat(simasel->dir, file->relname); - strcat(simasel->dir,"/"); - simasel->file[0] = '\0'; - BLI_cleanup_dir(G.sce, simasel->dir); - BIF_filelist_setdir(simasel->files, simasel->dir); - BIF_filelist_free(simasel->files); - simasel->active_file = -1; - simasel->scrollpos = 0; - do_draw = 1; - do_headdraw = 1; - } - else if (file) - { - if (file->relname) { - if (simasel->img) { - IMB_freeImBuf(simasel->img); - simasel->img = NULL; - } - BLI_strncpy(simasel->file, file->relname, FILE_MAXFILE); - if(event==MIDDLEMOUSE && BIF_filelist_gettype(simasel->files)) - imasel_execute(simasel); - } - - } - if(BIF_filelist_gettype(simasel->files)==FILE_MAIN) { - active_imasel_object(simasel); - } - - do_draw = 1; - } - } - else { - simasel->active_file = -1; - if (simasel->flag & FILE_BOOKMARKS) { - if(mval[0]>simasel->bookmarkrect.xmin && mval[0]bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]bookmarkrect.ymax) { - int nentries = fsmenu_get_nentries(); - - set_active_bookmark(simasel, mval[1]); - if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) { - char *selected= fsmenu_get_entry(simasel->active_bookmark); - /* which string */ - if (selected) { - BLI_strncpy(simasel->dir, selected, sizeof(simasel->dir)); - BLI_make_exist(simasel->dir); - BLI_cleanup_dir(G.sce, simasel->dir); - BIF_filelist_free(simasel->files); - BIF_filelist_setdir(simasel->files, simasel->dir); - simasel->file[0] = '\0'; - simasel->scrollpos = 0; - simasel->active_file = -1; - do_headdraw = 1; - } - } - } else { - simasel->active_bookmark = -1; - } - do_draw= 1; - } - } - break; - case RIGHTMOUSE: - getmouseco_areawin(mval); - if(mval[0]>simasel->viewrect.xmin && mval[0]viewrect.xmax - && mval[1]>simasel->viewrect.ymin && mval[1]viewrect.ymax) { - set_active_file(simasel, mval[0], mval[1]); - if(simasel->active_file >=0 && simasel->active_fileselstate = NOTACTIVE; - file = BIF_filelist_file(simasel->files, simasel->active_file); - if (file->flags & ACTIVE) { - file->flags &= ~ACTIVE; - simasel->selstate = INACTIVATE; - } - else { - file->flags |= ACTIVE; - simasel->selstate = ACTIVATE; - } - do_draw= 1; - } - } - break; - case MOUSEY: - case MOUSEX: - getmouseco_areawin(mval); - if(mval[0]>simasel->viewrect.xmin && mval[0]viewrect.xmax && mval[1]>simasel->viewrect.ymin && mval[1]viewrect.ymax) { - set_active_file(simasel, mval[0], mval[1]); - simasel->active_bookmark = -1; - if(simasel->active_file >=0 && simasel->active_filefiles, simasel->active_file); - if (simasel->selstate == INACTIVATE) { - file->flags &= ~ACTIVE; - } - else if (simasel->selstate == ACTIVATE) { - file->flags |= ACTIVE; - } - do_draw= 1; - } - } else { - simasel->active_file = -1; - if (simasel->flag & FILE_BOOKMARKS) { - if(mval[0]>simasel->bookmarkrect.xmin && mval[0]bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]bookmarkrect.ymax) { - set_active_bookmark(simasel, mval[1]); - } else { - simasel->active_bookmark = -1; - } - do_draw= 1; - } - } - break; - case AKEY: - BIF_filelist_swapselect(simasel->files); - if(simasel->type==FILE_MAIN) imasel_select_objects(simasel); - do_draw= 1; - break; - case BKEY: - toggle_blockhandler(sa, IMASEL_HANDLER_IMAGE, UI_PNL_UNSTOW); - scrarea_queue_winredraw(sa); - break; - case PKEY: - if(G.qual & LR_SHIFTKEY) { - extern char bprogname[]; /* usiblender.c */ - - sprintf(str, "%s -a \"%s%s\"", bprogname, simasel->dir, simasel->file); - system(str); - } - else - { - BIF_filelist_free(simasel->files); - BIF_filelist_parent(simasel->files); - BLI_strncpy(simasel->dir, BIF_filelist_dir(simasel->files), 80); - simasel->file[0] = '\0'; - simasel->active_file = -1; - simasel->scrollpos = 0; - do_headdraw = 1; - } - do_draw = 1; - break; - case XKEY: - getmouseco_areawin(mval); - if (simasel->flag & FILE_BOOKMARKS) { - if(mval[0]>simasel->bookmarkrect.xmin && mval[0]bookmarkrect.xmax && mval[1]>simasel->bookmarkrect.ymin && mval[1]bookmarkrect.ymax) { - int nentries = fsmenu_get_nentries(); - set_active_bookmark(simasel, mval[1]); - if (simasel->active_bookmark >= 0 && simasel->active_bookmark < nentries) { - char name[FILE_MAX]; - BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); - fsmenu_remove_entry(simasel->active_bookmark); - fsmenu_write_file(name); - simasel->active_bookmark = -1; - do_draw = 1; - } - } - } - break; - } - } - else if(event==RIGHTMOUSE) { - simasel->selstate = NOTACTIVE; - if(simasel->type==FILE_MAIN) imasel_select_objects(simasel); - } - else if(event==LEFTMOUSE) { - if(simasel->type==FILE_MAIN) { - getmouseco_areawin(mval); - set_active_file(simasel, mval[0], mval[1]); - } - } - /* XXX, stupid patch, curarea can become undone - * because of file loading... fixme zr - */ - if(curarea) { - if(do_draw) scrarea_queue_winredraw(curarea); - if(do_headdraw) scrarea_queue_headredraw(curarea); - } -} - - -/* copied from filesel.c */ -void clever_numbuts_imasel() -{ - SpaceImaSel *simasel; - char orgname[FILE_MAXDIR+FILE_MAXFILE+12]; - char filename[FILE_MAXDIR+FILE_MAXFILE+12]; - char newname[FILE_MAXDIR+FILE_MAXFILE+12]; - struct direntry *file; - int len; - - simasel= curarea->spacedata.first; - - if(BIF_filelist_gettype(simasel->files)==FILE_MAIN) return; - - len = 110; - file = get_hilited_entry(simasel); - - if (file != NULL && !(S_ISDIR(file->type))){ - - BLI_make_file_string(G.sce, orgname, simasel->dir, file->relname); - BLI_strncpy(filename, file->relname, sizeof(filename)); - - add_numbut(0, TEX, "", 0, len, filename, "Rename File"); - - if( do_clever_numbuts("Rename File", 1, REDRAW) ) { - BLI_make_file_string(G.sce, newname, simasel->dir, filename); - - if( strcmp(orgname, newname) != 0 ) { - BLI_rename(orgname, newname); - BIF_filelist_free(simasel->files); - } - } - - scrarea_queue_winredraw(curarea); - } -} diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c deleted file mode 100644 index 54aea493e88..00000000000 --- a/source/blender/src/editipo.c +++ /dev/null @@ -1,5790 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Blender Foundation, 2005. Full recode. - * Roland Hess, 2007. Visual Key refactor. - * - * ***** END GPL LICENSE BLOCK ***** - */ - - -/* this code feels over-complex, mostly because I choose in the past to devise a system - that converts the Ipo blocks (linked to Object, Material, etc), into a copy of that - data which is being worked on; the 'editipo'. - The editipo then can have 'ipokey' data, which is optimized for editing curves as if - it were key positions. This is still a great feature to work with, which makes ipo editing - in Blender still valuable. However, getting this beast under control was hard, even - for me... (ton) */ - -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" -#include "PIL_time.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_constraint_types.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_group_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_object_types.h" -#include "DNA_object_fluidsim.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_sequence_types.h" -#include "DNA_sound_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_anim.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_material.h" -#include "BKE_particle.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BIF_butspace.h" -#include "BIF_editaction.h" -#include "BIF_editconstraint.h" -#include "BIF_editkey.h" -#include "BIF_editnla.h" -#include "BIF_editseq.h" -#include "BIF_editview.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_poseobject.h" - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "BDR_editcurve.h" // for bezt_compare - -#include "BSE_trans_types.h" -#include "BSE_editipo_types.h" -#include "BSE_drawipo.h" -#include "BSE_editipo.h" -#include "BSE_edit.h" -#include "BSE_drawview.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" -#include "BSE_sequence.h" -#include "BSE_time.h" - -#include "blendef.h" -#include "mydevice.h" -#include "transform.h" - -extern int ob_ar[]; -extern int ma_ar[]; -extern int seq_ar[]; -extern int cu_ar[]; -extern int wo_ar[]; -extern int la_ar[]; -extern int cam_ar[]; -extern int snd_ar[]; -extern int ac_ar[]; -extern int co_ar[]; -extern int te_ar[]; -extern int fluidsim_ar[]; // NT -extern int part_ar[]; - -/* forwards */ -#define IPOTHRESH 0.9 - -/* tests if only one editipo is active */ -static void check_active_editipo(void) -{ - EditIpo *ei, *actei; - int a; - - actei= G.sipo->editipo; - if(actei) { - for(a=0; atotipo; a++, actei++) { - if(actei->flag & IPO_ACTIVE) - break; - } - if(actei==NULL) { - /* set visible active */ - for(a=0, ei=G.sipo->editipo; atotipo; a++, ei++) { - if(ei->flag & IPO_VISIBLE) - break; - } - if(ei==NULL) ei=G.sipo->editipo; - ei->flag |= IPO_ACTIVE; - if(ei->icu) ei->icu->flag |= IPO_ACTIVE; - } - else { - /* make sure no others are active */ - for(a=0, ei=G.sipo->editipo; atotipo; a++, ei++) { - if(ei!=actei) { - ei->flag &= ~IPO_ACTIVE; - if(ei->icu) ei->icu->flag &= ~IPO_ACTIVE; - } - } - } - } -} - -/* sets this ei channel active */ -static void set_active_editipo(EditIpo *actei) -{ - EditIpo *ei; - int a; - - for(a=0, ei=G.sipo->editipo; atotipo; a++, ei++) { - ei->flag &= ~IPO_ACTIVE; - if(ei->icu) ei->icu->flag &= ~IPO_ACTIVE; - } - actei->flag |= IPO_ACTIVE; - if(actei->icu) actei->icu->flag |= IPO_ACTIVE; -} - -EditIpo *get_active_editipo(void) -{ - EditIpo *ei; - int a; - - if(G.sipo==NULL) - return NULL; - - /* prevent confusing situations, like for sequencer */ - if(G.sipo->totipo==1) { - ei= G.sipo->editipo; - ei->flag |= IPO_ACTIVE; - return ei; - } - for(a=0, ei=G.sipo->editipo; atotipo; a++, ei++) - if(ei->flag & IPO_ACTIVE) - return ei; - - return NULL; -} - -static void set_active_key(int index) -{ - if(G.sipo->blocktype==ID_KE && G.sipo->from) { - Object *ob= (Object *)G.sipo->from; - Key *key= ob_get_key(ob); - - if(key) { - KeyBlock *curkb; - - curkb= BLI_findlink(&key->block, index-1); - if(curkb) { - ob->shapenr= index; - ob->shapeflag |= OB_SHAPE_TEMPLOCK; - - /* calc keypos */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } - } -} - -void editipo_changed(SpaceIpo *si, int doredraw) -{ - EditIpo *ei; - View2D *v2d; - Key *key; - KeyBlock *kb; - int a, first=1; - - ei= si->editipo; - if(ei==0) - return; - - for(a=0; atotipo; a++, ei++) { - - if(ei->icu) { - - /* twice because of ittererating new autohandle */ - calchandles_ipocurve(ei->icu); - calchandles_ipocurve(ei->icu); - - if(ei->flag & IPO_VISIBLE) { - - boundbox_ipocurve(ei->icu, 0); - sort_time_ipocurve(ei->icu); - if(first) { - si->v2d.tot= ei->icu->totrct; - first= 0; - } - else BLI_union_rctf(&(si->v2d.tot), &(ei->icu->totrct)); - } - } - } - - - v2d= &(si->v2d); - - /* keylines? */ - if(si->blocktype==ID_KE) { - key= ob_get_key((Object *)G.sipo->from); - if(key && key->block.first) { - kb= key->block.first; - if(kb->pos < v2d->tot.ymin) v2d->tot.ymin= kb->pos; - kb= key->block.last; - if(kb->pos > v2d->tot.ymax) v2d->tot.ymax= kb->pos; - } - } - - /* is there no curve? */ - if(first) { - v2d->tot.xmin= 0.0; - v2d->tot.xmax= EFRA; - v2d->tot.ymin= (float)-0.1; - v2d->tot.ymax= (float)1.1; - - if(si->blocktype==ID_SEQ) { - v2d->tot.xmin= -5.0; - v2d->tot.xmax= 105.0; - v2d->tot.ymin= (float)-0.1; - v2d->tot.ymax= (float)1.1; - } - } - - si->tot= v2d->tot; - - if(doredraw) { - /* if you always call do_ipo: you get problems with insertkey, for example - * when inserting only a 'loc' the 'ob->rot' value then is changed. - */ - - if(si->blocktype==ID_OB) { - /* clear delta loc,rot,size (when free/delete ipo) */ - clear_delta_obipo(si->ipo); - - } - - do_ipo(si->ipo); - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWBUTSOBJECT, 0); - - if(si->blocktype==ID_OB) { - Object *ob= (Object *)si->from; - if(ob) DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWNLA, 0); - } - - else if(si->blocktype==ID_MA) allqueue(REDRAWBUTSSHADING, 0); - else if(si->blocktype==ID_TE) allqueue(REDRAWBUTSSHADING, 0); - else if(si->blocktype==ID_WO) allqueue(REDRAWBUTSSHADING, 0); - else if(si->blocktype==ID_LA) allqueue(REDRAWBUTSSHADING, 0); -// else if(si->blocktype==ID_SO) allqueue(REDRAWBUTSSOUND, 0); - else if(si->blocktype==ID_CA) { - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - } - else if(si->blocktype==ID_SEQ) free_imbuf_seq_with_ipo(si->ipo); - else if(si->blocktype==ID_PO) { - Object *ob= OBACT; - if(ob && ob->pose) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } - else if(si->blocktype==ID_KE) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - else if(si->blocktype==ID_CU) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - else if(si->blocktype==ID_PA){ - Object *ob=OBACT; - ParticleSystem *psys = ob->particlesystem.first; - - /* find out if we need to initialize particles */ - for(; psys; psys=psys->next) { - if(psys->part->ipo==si->ipo) { - ei= si->editipo; - for(a=0; atotipo; a++, ei++) - if(ei->icu && ELEM3(ei->icu->adrcode,PART_EMIT_FREQ,PART_EMIT_LIFE,PART_EMIT_SIZE)) - psys_flush_settings(psys->part,PSYS_INIT,1); - } - } - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } - - if(si->showkey) make_ipokey(); - - if(si->actname[0]) - synchronize_action_strips(); -} - -void scale_editipo(void) -{ - /* comes from buttons, scale with G.sipo->tot rect */ - - EditIpo *ei; - BezTriple *bezt; - float facx, facy; - int a, b; - - facx= (G.sipo->tot.xmax-G.sipo->tot.xmin)/(G.sipo->v2d.tot.xmax-G.sipo->v2d.tot.xmin); - facy= (G.sipo->tot.ymax-G.sipo->tot.ymin)/(G.sipo->v2d.tot.ymax-G.sipo->v2d.tot.ymin); - - ei= G.sipo->editipo; - if(ei==0) return; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - - bezt->vec[0][0]= facx*(bezt->vec[0][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin; - bezt->vec[1][0]= facx*(bezt->vec[1][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin; - bezt->vec[2][0]= facx*(bezt->vec[2][0] - G.sipo->v2d.tot.xmin) + G.sipo->tot.xmin; - - bezt->vec[0][1]= facy*(bezt->vec[0][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin; - bezt->vec[1][1]= facy*(bezt->vec[1][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin; - bezt->vec[2][1]= facy*(bezt->vec[2][1] - G.sipo->v2d.tot.ymin) + G.sipo->tot.ymin; - - bezt++; - } - } - } - - editipo_changed(G.sipo, 1); - - BIF_undo_push("Scale Edit Ipo"); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); -} - -static void make_ob_editipo(Object *ob, SpaceIpo *si) -{ - EditIpo *ei; - int a, len, colipo=0; - char *name; - - if(ob->type==OB_MESH) colipo= 1; - - ei= si->editipo= MEM_callocN(OB_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= OB_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= ob_ar[a]; - - if ELEM6(ei->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, OB_DROT_X, OB_DROT_Y, OB_DROT_Z) ei->disptype= IPO_DISPDEGR; - else if(ei->adrcode==OB_LAY) ei->disptype= IPO_DISPBITS; - else if(ei->adrcode==OB_TIME) ei->disptype= IPO_DISPTIME; - - ei->col= ipo_rainbow(a, OB_TOTIPO); - - if(colipo) { - len= strlen(ei->name); - if(len) { - if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - } - } - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - - ei++; - } - //fprintf(stderr,"FSIMAKE_OPBJ call %d \n", si->totipo); -} - -static void make_part_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - if(si->from==0) return; - - ei= si->editipo= MEM_callocN(PART_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= PART_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= part_ar[a]; - - //if(ei->adrcode & MA_MAP1) { - // ei->adrcode-= MA_MAP1; - // ei->adrcode |= texchannel_to_adrcode(si->channel); - //} - //else { - // if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS; - //} - - ei->col= ipo_rainbow(a, PART_TOTIPO); - - //len= strlen(ei->name); - //if(len) { - // if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - // else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - // else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - //} - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -// copied from make_seq_editipo -static void make_fluidsim_editipo(SpaceIpo *si) // NT -{ - EditIpo *ei; - int a; - char *name; - ei= si->editipo= MEM_callocN(FLUIDSIM_TOTIPO*sizeof(EditIpo), "fluidsim_editipo"); - si->totipo = FLUIDSIM_TOTIPO; - for(a=0; aname, name); - ei->adrcode= fluidsim_ar[a]; - ei->col= ipo_rainbow(a, FLUIDSIM_TOTIPO); - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag = ei->icu->flag; - } - //else { ei->flag |= IPO_VISIBLE; } - //fprintf(stderr,"FSIMAKE eif%d,icuf%d icu%d %d|%d\n", ei->flag,ei->icu->flag, (int)ei->icu, IPO_VISIBLE,IPO_SELECT); - //fprintf(stderr,"FSIMAKE eif%d icu%d %d|%d\n", ei->flag, (int)ei->icu, IPO_VISIBLE,IPO_SELECT); - ei++; - } -} - -static void make_seq_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - ei= si->editipo= MEM_callocN(SEQ_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= SEQ_TOTIPO; - - - for(a=0; aname, name); - ei->adrcode= seq_ar[a]; - - ei->col= ipo_rainbow(a, SEQ_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - else ei->flag |= IPO_VISIBLE; - - ei++; - } -} - -static void make_cu_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - ei= si->editipo= MEM_callocN(CU_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= CU_TOTIPO; - - - for(a=0; aname, name); - ei->adrcode= cu_ar[a]; - - ei->col= ipo_rainbow(a, CU_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - else ei->flag |= IPO_VISIBLE; - - ei++; - } -} - -static void make_key_editipo(SpaceIpo *si) -{ - Key *key; - KeyBlock *kb=NULL; - EditIpo *ei; - int a; - - key= ob_get_key((Object *)G.sipo->from); - if(key==NULL) return; - - si->totipo= BLI_countlist(&key->block); - ei= si->editipo= MEM_callocN(si->totipo*sizeof(EditIpo), "editipo"); - - for(a=0, kb= key->block.first; atotipo; a++, ei++, kb= kb->next) { - - if(kb->name[0] != 0) strncpy(ei->name, kb->name, 31); // length both same - ei->adrcode= kb->adrcode; - - ei->col= ipo_rainbow(a, KEY_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - else if(a==0) - if(key && key->type==KEY_NORMAL) - ei->flag |= IPO_VISIBLE; - - /* active ipo is tied to active shape */ - { - Object *ob= OBACT; - if(a==ob->shapenr-1) - set_active_editipo(ei); - } - } - - ei= si->editipo; - if(key && key->type==KEY_RELATIVE) { - strcpy(ei->name, "----"); - } - else { - ei->flag |= IPO_VISIBLE; - } -} - -static void make_mat_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a, len; - char *name; - - if(si->from==0) return; - - ei= si->editipo= MEM_callocN(MA_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= MA_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= ma_ar[a]; - - if(ei->adrcode & MA_MAP1) { - ei->adrcode-= MA_MAP1; - ei->adrcode |= texchannel_to_adrcode(si->channel); - } - else { - if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS; - } - - ei->col= ipo_rainbow(a, MA_TOTIPO); - - len= strlen(ei->name); - if(len) { - if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - } - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -static void make_texture_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a, len; - char *name; - - if(si->from==0) return; - - ei= si->editipo= MEM_callocN(TE_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= TE_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= te_ar[a]; - - ei->col= ipo_rainbow(a, TE_TOTIPO); - - len= strlen(ei->name); - if(len) { - if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - } - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -static void make_world_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a, len; - char *name; - - if(si->from==0) return; - - ei= si->editipo= MEM_callocN(WO_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= WO_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= wo_ar[a]; - - if(ei->adrcode & MA_MAP1) { - ei->adrcode-= MA_MAP1; - ei->adrcode |= texchannel_to_adrcode(si->channel); - } - else { - if(ei->adrcode==MA_MODE) ei->disptype= IPO_DISPBITS; - } - - ei->col= ipo_rainbow(a, WO_TOTIPO); - - len= strlen(ei->name); - if(len) { - if( ei->name[ len-1 ]=='R') ei->col= 0x5050FF; - else if( ei->name[ len-1 ]=='G') ei->col= 0x50FF50; - else if( ei->name[ len-1 ]=='B') ei->col= 0xFF7050; - } - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -static void make_lamp_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - ei= si->editipo= MEM_callocN(LA_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= LA_TOTIPO; - - for(a=0; aname, name); - ei->adrcode= la_ar[a]; - - if(ei->adrcode & MA_MAP1) { - ei->adrcode-= MA_MAP1; - ei->adrcode |= texchannel_to_adrcode(si->channel); - } - - ei->col= ipo_rainbow(a, LA_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -static void make_camera_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - ei= si->editipo= MEM_callocN(CAM_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= CAM_TOTIPO; - - - for(a=0; aname, name); - ei->adrcode= cam_ar[a]; - - ei->col= ipo_rainbow(a, CAM_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -static int make_constraint_editipo(Ipo *ipo, EditIpo **si) -{ - EditIpo *ei; - int a; - char *name; - - ei= *si= MEM_callocN(CO_TOTIPO*sizeof(EditIpo), "editipo"); - - for(a=0; aname, name); - ei->adrcode= co_ar[a]; - - ei->col= ipo_rainbow(a, CO_TOTIPO); - - ei->icu= find_ipocurve(ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } - - return CO_TOTIPO; -} - -static int make_bone_editipo(Ipo *ipo, EditIpo **si) -{ - EditIpo *ei; - int a; - char *name; - - ei= *si= MEM_callocN(AC_TOTIPO*sizeof(EditIpo), "editipo"); - - for(a=0; aname, name); - ei->adrcode= ac_ar[a]; - - ei->col= ipo_rainbow(a, AC_TOTIPO); - - ei->icu= find_ipocurve(ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } - - return AC_TOTIPO; -} - -static void make_sound_editipo(SpaceIpo *si) -{ - EditIpo *ei; - int a; - char *name; - - ei= si->editipo= MEM_callocN(SND_TOTIPO*sizeof(EditIpo), "editipo"); - - si->totipo= SND_TOTIPO; - - - for(a=0; aname, name); - ei->adrcode= snd_ar[a]; - - ei->col= ipo_rainbow(a, SND_TOTIPO); - - ei->icu= find_ipocurve(si->ipo, ei->adrcode); - if(ei->icu) { - ei->flag= ei->icu->flag; - } - - ei++; - } -} - -/* only called in test_editipo() below */ -static void make_editipo(void) -{ - EditIpo *ei; - Object *ob; - rctf *rf; - int a; - - if(G.sipo->editipo) - MEM_freeN(G.sipo->editipo); - - G.sipo->editipo= NULL; - G.sipo->totipo= 0; - - if(G.sipo->from==NULL) return; - - ob= OBACT; - - if(G.sipo->ipo) G.sipo->showkey= G.sipo->ipo->showkey; - - if(G.sipo->blocktype==ID_SEQ) { - make_seq_editipo(G.sipo); - } - else if(G.sipo->blocktype==ID_WO) { - make_world_editipo(G.sipo); - } - else if(G.sipo->blocktype==ID_OB) { - if (ob) { - ob->ipowin= ID_OB; - make_ob_editipo(ob, G.sipo); - } - } - else if(G.sipo->blocktype==ID_MA) { - if (ob) { - ob->ipowin= ID_MA; - make_mat_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_CU) { - if (ob) { - ob->ipowin= ID_CU; - make_cu_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_KE) { - if (ob) { - ob->ipowin= ID_KE; - make_key_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_LA) { - if (ob) { - ob->ipowin= ID_LA; - make_lamp_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_TE) { - if (ob) { - ob->ipowin= ID_TE; - make_texture_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_CA) { - if (ob) { - ob->ipowin= ID_CA; - make_camera_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_SO) { - if (ob) { - ob->ipowin= ID_SO; - make_sound_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_CO){ - G.sipo->totipo = make_constraint_editipo(G.sipo->ipo, (EditIpo**)&G.sipo->editipo); - if (ob) { - ob->ipowin= ID_CO; - } - } - else if(G.sipo->blocktype==ID_PO) { - - G.sipo->totipo = make_bone_editipo(G.sipo->ipo, (EditIpo**)&G.sipo->editipo); - if (ob) { - ob->ipowin= ID_PO; - } - } - else if(G.sipo->blocktype==ID_FLUIDSIM) { - if (ob) { // NT - ob->ipowin= ID_FLUIDSIM; - make_fluidsim_editipo(G.sipo); - } - } - else if(G.sipo->blocktype==ID_PA) { - if (ob) { - ob->ipowin= ID_PA; - make_part_editipo(G.sipo); - } - } - - if(G.sipo->editipo==0) return; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if(ei->icu) ei->icu->flag= ei->flag; - } - editipo_changed(G.sipo, 0); - - /* sets globals, bad stuff but we need these variables in other parts of code */ - get_status_editipo(); - - if(G.sipo->ipo) { - - if (G.sipo->pin) - rf= &(G.sipo->v2d.cur); - else - rf= &(G.sipo->ipo->cur); - - if(rf->xminxmax && rf->yminymax) G.v2d->cur= *rf; - else ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur); - } - else { - ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur); - } - - view2d_do_locks(curarea, V2D_LOCK_COPY); -} - -/* evaluates context in the current UI */ -/* blocktype is type of ipo */ -/* from is the base pointer to find data to change (ob in case of action or pose) */ -/* bonename is for local bone ipos (constraint only now) */ -static void get_ipo_context(short blocktype, ID **from, Ipo **ipo, char *actname, char *constname, char *bonename) -{ - Object *ob= OBACT; - - *from= NULL; - *ipo= NULL; - - if(blocktype==ID_CO) { - if (ob) { - bConstraintChannel *chan; - bConstraint *con= get_active_constraint(ob); - - if(con) { - *from= &ob->id; - - BLI_strncpy(constname, con->name, 32); - - /* a bit hackish, but we want con->ipo to work */ - if(con->flag & CONSTRAINT_OWN_IPO) { - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan= get_active_posechannel(ob); - if(pchan) { - BLI_strncpy(bonename, pchan->name, 32); - *ipo= con->ipo; - } - } - } - else { - chan= get_active_constraint_channel(ob); - if(chan) { - *ipo= chan->ipo; - BLI_strncpy(constname, con->name, 32); - } - - /* set actname if in posemode */ - if(ob->action) { - if(ob->flag & OB_POSEMODE) { - bPoseChannel *pchan= get_active_posechannel(ob); - if(pchan) - BLI_strncpy(actname, pchan->name, 32); - } - else if(ob->ipoflag & OB_ACTION_OB) - strcpy(actname, "Object"); - } - } - } - } - } - else if(blocktype==ID_PO) { - if (ob && ob->action && ob->type==OB_ARMATURE) { - bPoseChannel *pchan= get_active_posechannel(ob); - - *from= (ID *)ob; - if (pchan) { - bActionChannel *achan; - - BLI_strncpy(actname, pchan->name, 32); /* also set when no channel yet */ - - achan= get_action_channel(ob->action, pchan->name); - if(achan) - *ipo= achan->ipo; - } - } - - } - else if(blocktype==ID_OB) { - if(ob) { - *from= (ID *)ob; - if(ob->ipoflag & OB_ACTION_OB) { - if (ob->action) { - bActionChannel *achan= get_action_channel(ob->action, "Object"); - if(achan) { - *ipo= achan->ipo; - BLI_strncpy(actname, achan->name, 32); - } - } - } - else { - *ipo= ob->ipo; - } - } - } - else if(blocktype==ID_SEQ) { - Sequence *last_seq = get_last_seq(); - - if(last_seq && ((last_seq->type & SEQ_EFFECT)||(last_seq->type == SEQ_HD_SOUND)||(last_seq->type == SEQ_RAM_SOUND))) { - *from= (ID *)last_seq; - *ipo= last_seq->ipo; - } - } - else if(blocktype==ID_WO) { - World *wo= G.scene->world; - *from= (ID *)wo; - if(wo) *ipo= wo->ipo; - } - else if(blocktype==ID_TE) { - if(ob) { - Tex *tex= give_current_texture(ob, ob->actcol); - *from= (ID *)tex; - if(tex) *ipo= tex->ipo; - } - } - else if(blocktype==ID_MA) { - if(ob) { - Material *ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - *from= (ID *)ma; - if(ma) *ipo= ma->ipo; - } - } - else if(blocktype==ID_KE) { - if(ob) { - Key *key= ob_get_key(ob); - - if(ob->ipoflag & OB_ACTION_KEY) { - if (ob->action) { - bActionChannel *achan= get_action_channel(ob->action, "Shape"); - if(achan) { - *ipo= achan->ipo; - BLI_strncpy(actname, achan->name, 32); - } - } - } - else if(key) *ipo= key->ipo; - - *from= (ID *)ob; - } - } - else if(blocktype==ID_CU) { - if(ob && ob->type==OB_CURVE) { - Curve *cu= ob->data; - *from= (ID *)cu; - *ipo= cu->ipo; - } - } - else if(blocktype==ID_LA) { - if(ob && ob->type==OB_LAMP) { - Lamp *la= ob->data; - *from= (ID *)la; - *ipo= la->ipo; - } - } - else if(blocktype==ID_CA) { - if(ob && ob->type==OB_CAMERA) { - Camera *ca= ob->data; - *from= (ID *)ca; - if(ca) *ipo= ca->ipo; - } - } - else if(blocktype==ID_SO) { - - // if (G.buts && G.buts->mainb == BUTS_SOUND) { - // bSound *sound = G.buts->lockpoin; - // *from= (ID *)sound; - // if(sound) *ipo= sound->ipo; - // } - } - else if(blocktype==ID_FLUIDSIM) { - if(ob && ( ob->fluidsimFlag & OB_FLUIDSIM_ENABLE)) { - FluidsimSettings *fss= ob->fluidsimSettings; - *from= (ID *)ob; - if(fss) *ipo= fss->ipo; - } - } - else if(blocktype==ID_PA) { - ParticleSystem *psys = psys_get_current(ob); - if(psys){ - *from= (ID *)ob; - *ipo= psys->part->ipo; - } - } -} - -/* called on each redraw, check if editipo data has to be remade */ -/* if doit already set, it always makes (in case no ipo exists, we need to see the channels */ -void test_editipo(int doit) -{ - - if(G.sipo->pin==0) { - Ipo *ipo; - ID *from; - char actname[32]="", constname[32]="", bonename[32]=""; - - get_ipo_context(G.sipo->blocktype, &from, &ipo, actname, constname, bonename); - - if(G.sipo->ipo != ipo) { - G.sipo->ipo= ipo; - if(ipo) G.v2d->cur= ipo->cur; - doit= 1; - } - if(G.sipo->from != from) { - G.sipo->from= from; - doit= 1; - } - if( strcmp(G.sipo->actname, actname)) { - BLI_strncpy(G.sipo->actname, actname, 32); - doit= 1; - } - if( strcmp(G.sipo->constname, constname)) { - BLI_strncpy(G.sipo->constname, constname, 32); - doit= 1; - } - if( strcmp(G.sipo->bonename, bonename)) { - BLI_strncpy(G.sipo->bonename, bonename, 32); - /* urmf; if bonename, then no action */ - if(bonename[0]) G.sipo->actname[0]= 0; - doit= 1; - } - - if(G.sipo->ipo) - G.sipo->ipo->cur = G.v2d->cur; - - } - - if(G.sipo->editipo==NULL || doit) { - make_editipo(); - } -} - -/* ****************** EditIpo ************************ */ - -int totipo_edit=0, totipo_sel=0, totipo_curve=0, totipo_vis=0, totipo_vert=0, totipo_vertsel=0, totipo_key=0, totipo_keysel=0; - -void get_status_editipo(void) -{ - EditIpo *ei; - IpoKey *ik; - BezTriple *bezt; - int a, b; - - totipo_vis= 0; - totipo_curve= 0; - totipo_sel= 0; - totipo_edit= 0; - totipo_vert= 0; - totipo_vertsel= 0; - totipo_key= 0; - totipo_keysel= 0; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - - ei= G.sipo->editipo; - if(ei==0) return; - for(a=0; atotipo; a++) { - if( ei->flag & IPO_VISIBLE ) { - totipo_vis++; - if(ei->flag & IPO_SELECT) totipo_sel++; - if(ei->icu && ei->icu->totvert) totipo_curve++; - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - - /* if showkey: do count the vertices (for grab) */ - if(G.sipo->showkey==0) totipo_edit++; - - if(ei->icu) { - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - if(ei->icu->ipo==IPO_BEZ) { - if(bezt->f1 & SELECT) totipo_vertsel++; - if(bezt->f3 & SELECT) totipo_vertsel++; - totipo_vert+= 2; - } - if(bezt->f2 & SELECT) totipo_vertsel++; - - totipo_vert++; - bezt++; - } - } - } - } - } - ei++; - } - - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - while(ik) { - totipo_key++; - if(ik->flag & 1) totipo_keysel++; - ik= ik->next; - } - } -} - -/* synchronize editipo flag with icu flag and ipokey flags */ -void update_editipo_flags(void) -{ - EditIpo *ei; - IpoKey *ik; - int a; - - ei= G.sipo->editipo; - if(ei) { - for(a=0; atotipo; a++, ei++) { - if(ei->icu) ei->icu->flag= ei->flag; - } - } - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - while(ik) { - for(a=0; atotipo; a++) { - if(ik->data[a]) { - if(ik->flag & 1) { - ik->data[a]->f1 |= SELECT; - ik->data[a]->f2 |= SELECT; - ik->data[a]->f3 |= SELECT; - } - else { - ik->data[a]->f1 &= ~SELECT; - ik->data[a]->f2 &= ~SELECT; - ik->data[a]->f3 &= ~SELECT; - } - } - } - ik= ik->next; - } - } -} - -/* sort of enter/leave editmode for curves */ -void set_editflag_editipo(void) -{ - EditIpo *ei; - int a; /* , tot= 0, ok= 0; */ - - /* after showkey immediately go to editing of selected points */ - if(G.sipo->showkey) { - G.sipo->showkey= 0; - if(G.sipo->ipo) G.sipo->ipo->showkey= 0; - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) ei->flag |= IPO_SELECT; - scrarea_queue_headredraw(curarea); - allqueue(REDRAWVIEW3D, 0); - } - - get_status_editipo(); - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if(ei->icu) { - if(ei->flag & IPO_VISIBLE) { - - if(totipo_edit==0 && (ei->flag & IPO_SELECT)) { - ei->flag |= IPO_EDIT; - ei->icu->flag= ei->flag; - } - else if(totipo_edit && (ei->flag & IPO_EDIT)) { - ei->flag -= IPO_EDIT; - ei->icu->flag= ei->flag; - } - else if(totipo_vis==1) { - if(ei->flag & IPO_EDIT) ei->flag -= IPO_EDIT; - else ei->flag |= IPO_EDIT; - ei->icu->flag= ei->flag; - } - } - } - } - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); -} - -static short findnearest_ipovert(IpoCurve **icu, BezTriple **bezt) -{ - /* selected verts get a disadvantage */ - /* in icu and (bezt or bp) the nearest is written */ - /* return 0 1 2: handlepunt */ - EditIpo *ei; - BezTriple *bezt1; - int dist= 100, temp, a, b; - short mval[2], hpoint=0, sco[3][2]; - - *icu= 0; - *bezt= 0; - - getmouseco_areawin(mval); - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu)) { - - if(ei->icu->bezt) { - bezt1= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - - ipoco_to_areaco_noclip(G.v2d, bezt1->vec[0], sco[0]); - ipoco_to_areaco_noclip(G.v2d, bezt1->vec[1], sco[1]); - ipoco_to_areaco_noclip(G.v2d, bezt1->vec[2], sco[2]); - - if(ei->disptype==IPO_DISPBITS) { - temp= abs(mval[0]- sco[1][0]); - } - else temp= abs(mval[0]- sco[1][0])+ abs(mval[1]- sco[1][1]); - - if( bezt1->f2 & SELECT) temp+=5; - if(tempicu; - } - - if(ei->disptype!=IPO_DISPBITS && ei->icu->ipo==IPO_BEZ) { - /* middle points get an advantage */ - temp= -3+abs(mval[0]- sco[0][0])+ abs(mval[1]- sco[0][1]); - if( bezt1->f1 & 1) temp+=5; - if(tempicu; - } - - temp= abs(mval[0]- sco[2][0])+ abs(mval[1]- sco[2][1]); - if( bezt1->f3 & 1) temp+=5; - if(tempicu; - } - } - bezt1++; - } - } - } - } - - return hpoint; -} - -void mouse_select_ipo(void) -{ - Object *ob; - KeyBlock *actkb=NULL; - EditIpo *ei, *actei= 0; - IpoCurve *icu; - IpoKey *ik, *actik; - BezTriple *bezt; - TimeMarker *marker; - float x, y, dist, mindist; - int a, oldflag = 0, hand, ok; - short mval[2], xo, yo; - - if(G.sipo->editipo==0) return; - - get_status_editipo(); - marker=find_nearest_marker(1); - - /* map ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0); - } - - if(G.sipo->showkey) { - getmouseco_areawin(mval); - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - actik= 0; - mindist= 1000.0; - ik= G.sipo->ipokey.first; - while(ik) { - dist= (float)(fabs(ik->val-x)); - if(ik->flag & 1) dist+= 1.0; - if(dist < mindist) { - actik= ik; - mindist= dist; - } - ik= ik->next; - } - if(actik) { - oldflag= actik->flag; - - if(G.qual & LR_SHIFTKEY); - else deselectall_editipo(); - - if(G.qual & LR_SHIFTKEY) { - if(oldflag & 1) actik->flag &= ~1; - else actik->flag |= 1; - } - else { - actik->flag |= 1; - } - } - } - else if(totipo_edit) { - - hand= findnearest_ipovert(&icu, &bezt); - - if(G.qual & LR_SHIFTKEY) { - if(bezt) { - if(hand==1) { - if(BEZSELECTED(bezt)) { - bezt->f1= bezt->f2= bezt->f3= 0; - } - else { - bezt->f1= bezt->f2= bezt->f3= SELECT; - } - } - else if(hand==0) { - if(bezt->f1 & SELECT) bezt->f1= 0; - else bezt->f1= SELECT; - } - else { - if(bezt->f3 & SELECT) bezt->f3= 0; - else bezt->f3= SELECT; - } - } - } - else { - deselectall_editipo(); - - if(bezt) { - if(hand==1) { - bezt->f1|= SELECT; bezt->f2|= SELECT; bezt->f3|= SELECT; - } - else if(hand==0) bezt->f1 |= SELECT; - else bezt->f3 |= SELECT; - } - } - } - else if (marker) { - /* select timeline marker */ - if ((G.qual & LR_SHIFTKEY)==0) { - oldflag= marker->flag; - deselect_markers(0, 0); - - if (oldflag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - } - else { - marker->flag |= SELECT; - } - } - else { - - /* vertex keys ? */ - if(G.sipo->blocktype==ID_KE && G.sipo->from) { - Key *key; - KeyBlock *kb, *curkb; - int i, index= 1; - - ob= (Object *)G.sipo->from; - key= ob_get_key(ob); - curkb= BLI_findlink(&key->block, ob->shapenr-1); - - ei= G.sipo->editipo; - if(key->type==KEY_NORMAL || (ei->flag & IPO_VISIBLE)) { - getmouseco_areawin(mval); - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - /* how much is 20 pixels? */ - mindist= (float)(20.0*(G.v2d->cur.ymax-G.v2d->cur.ymin)/(float)curarea->winy); - - for(i=1, kb= key->block.first; kb; kb= kb->next, i++) { - dist= (float)(fabs(kb->pos-y)); - if(kb==curkb) dist+= (float)0.01; - if(dist < mindist) { - actkb= kb; - mindist= dist; - index= i; - } - } - if(actkb) { - ok= TRUE; - if(G.obedit && actkb!=curkb) { - ok= okee("Copy key after leaving Edit Mode"); - } - if(ok) { - /* also does all keypos */ - deselectall_editipo(); - set_active_key(index); - set_active_editipo(ei+index-1); - } - } - } - } - - /* select curve */ - if(actkb==NULL) { - if(totipo_vis==1) { - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if(ei->icu) { - if(ei->flag & IPO_VISIBLE) actei= ei; - } - } - } - else if(totipo_vis>1) { - actei= select_proj_ipo(0, 0); - } - - if(actei) oldflag= actei->flag; - - if(G.qual & LR_SHIFTKEY); - else deselectall_editipo(); - - if(actei) { - if(G.qual & LR_SHIFTKEY) { - if(oldflag & IPO_SELECT) actei->flag &= ~IPO_SELECT; - else actei->flag |= IPO_SELECT; - } - else { - actei->flag |= IPO_SELECT; - } - set_active_editipo(actei); - } - } - } - - /* undo mapping of ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0); - } - - update_editipo_flags(); - - force_draw(0); - BIF_undo_push("Select Ipo"); - - if(G.sipo->showkey && G.sipo->blocktype==ID_OB) { - ob= OBACT; - if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0); - } - /* points inside of curve are drawn selected too */ - if(G.sipo->blocktype==ID_CU) - allqueue(REDRAWVIEW3D, 0); - - getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; - - while(get_mbut()&R_MOUSE) { - getmouseco_areawin(mval); - if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) { - - if (marker) { - transform_markers('g', 0); - } - else { - if(actkb) move_keys(OBACT); - else transform_ipo('g'); - } - - return; - } - BIF_wait_for_statechange(); - } -} - - -/* *********************************** */ - -/* handling of right-hand channel/curve buttons in ipo window */ -void do_ipowin_buts(short event) -{ - EditIpo *ei = NULL; - int a; - - /* without shift, all other channels are made invisible */ - if((G.qual & LR_SHIFTKEY)==0) { - if(event>G.sipo->totipo) return; - ei = G.sipo->editipo; - for(a=0; atotipo; a++) { - if(a!=event) ei->flag &= ~IPO_VISIBLE; - else ei->flag |= IPO_VISIBLE; - ei++; - } - } - - /* set active */ - if(event>=0 && eventtotipo) { - ei= G.sipo->editipo; // void pointer... - set_active_editipo(ei+event); - set_active_key(event+1); // only if there's a key, of course - } - scrarea_queue_winredraw(curarea); - - update_editipo_flags(); - get_status_editipo(); - - if(G.sipo->showkey) { - make_ipokey(); - if(G.sipo->blocktype==ID_OB) allqueue(REDRAWVIEW3D, 0); - } - -} - -/* the fake buttons to the left of channel names, for select/deselect curves */ -void do_ipo_selectbuttons(void) -{ - EditIpo *ei, *ei1; - int a, nr; - short mval[2]; - - if(G.sipo->showkey) return; - - /* do not allow editipo here: convert editipos to selected */ - get_status_editipo(); - if(totipo_edit) { - set_editflag_editipo(); - } - - /* which */ - getmouseco_areawin(mval); - - nr= -(mval[1]-curarea->winy+30-G.sipo->butofs-IPOBUTY)/IPOBUTY; - if(G.sipo->blocktype==ID_KE) nr--; /* keys show something else in first channel */ - - if(nr>=0 && nrtotipo) { - ei= G.sipo->editipo; - ei+= nr; - - set_active_editipo(ei); - set_active_key(nr+1); - - if(ei->icu) { - if((ei->flag & IPO_VISIBLE)==0) { - ei->flag |= IPO_VISIBLE|IPO_SELECT; - } - - if((G.qual & LR_SHIFTKEY)==0) { - ei1= G.sipo->editipo; - for(a=0; atotipo; a++) { - ei1->flag &= ~IPO_SELECT; - ei1++; - } - } - - if(ei->flag & IPO_SELECT) { - ei->flag &= ~IPO_SELECT; - } - else { - ei->flag |= IPO_SELECT; - } - - update_editipo_flags(); - scrarea_queue_winredraw(curarea); - } - } - BIF_undo_push("Select Ipo curve"); -} - -/* ********************************* Inserting keys ********************************************* */ - -/* depending type, it returns ipo, if needed it creates one */ -/* returns either action ipo or "real" ipo */ -/* arguments define full context; - - *from has to be set always, to Object in case of Actions - - blocktype defines available channels of Ipo struct (blocktype ID_OB can be in action too) - - if actname, use this to locate actionchannel, and optional constname - - if bonename, the constname is the ipo to the constraint -*/ - -/* note; check header_ipo.c, spaceipo_assign_ipo() too */ -Ipo *verify_ipo(ID *from, short blocktype, char *actname, char *constname, char *bonename) -{ - - if(from==NULL || from->lib) return NULL; - - /* first check action ipos */ - if(actname && actname[0]) { - Object *ob= (Object *)from; - bActionChannel *achan; - - if(GS(from->name)!=ID_OB) { - printf("called ipo system for action with wrong base pointer\n"); - return NULL; - } - - if(ob->action==NULL) - ob->action= add_empty_action("Action"); - - achan= verify_action_channel(ob->action, actname); - - if(achan) { - /* constraint exception */ - if(blocktype==ID_CO) { - bConstraintChannel *conchan= verify_constraint_channel(&achan->constraintChannels, constname); - if(conchan->ipo==NULL) { - conchan->ipo= add_ipo("CoIpo", ID_CO); - } - return conchan->ipo; - } - else { - if(achan->ipo==NULL) { - achan->ipo= add_ipo("ActIpo", blocktype); - } - - return achan->ipo; - } - } - } - else { - - switch(GS(from->name)) { - case ID_OB: - { - Object *ob= (Object *)from; - - /* constraint exception */ - if(blocktype==ID_CO) { - /* check the local constraint ipo */ - if(bonename && bonename[0] && ob->pose) { - bPoseChannel *pchan= get_pose_channel(ob->pose, bonename); - bConstraint *con; - for(con= pchan->constraints.first; con; con= con->next) - if(strcmp(con->name, constname)==0) - break; - if(con) { - if(con->ipo==NULL) { - con->ipo= add_ipo("CoIpo", ID_CO); - } - return con->ipo; - } - } - else { /* the actionchannel */ - bConstraintChannel *conchan= verify_constraint_channel(&ob->constraintChannels, constname); - if(conchan->ipo==NULL) { - conchan->ipo= add_ipo("CoIpo", ID_CO); - } - return conchan->ipo; - } - } - else if(blocktype==ID_OB) { - if(ob->ipo==NULL) { - ob->ipo= add_ipo("ObIpo", ID_OB); - } - return ob->ipo; - } - else if(blocktype==ID_KE) { - Key *key= ob_get_key((Object *)from); - - if(key) { - if(key->ipo==NULL) { - key->ipo= add_ipo("KeyIpo", ID_KE); - } - return key->ipo; - } - return NULL; - } - else if(blocktype== ID_FLUIDSIM) { - Object *ob= (Object *)from; - if(ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) { - FluidsimSettings *fss= ob->fluidsimSettings; - if(fss->ipo==NULL) { - fss->ipo= add_ipo("FluidsimIpo", ID_FLUIDSIM); - //fprintf(stderr,"FSIPO NEW!\n"); - } - return fss->ipo; - } - } - else if(blocktype== ID_PA){ - Object *ob= (Object *)from; - ParticleSystem *psys= psys_get_current(ob); - if(psys){ - if(psys->part->ipo==0) - psys->part->ipo= add_ipo("ParticleIpo", ID_PA); - return psys->part->ipo; - } - return NULL; - } - } - break; - case ID_MA: - { - Material *ma= (Material *)from; - - if(ma->ipo==NULL) { - ma->ipo= add_ipo("MatIpo", ID_MA); - } - return ma->ipo; - } - break; - case ID_TE: - { - Tex *tex= (Tex *)from; - - if(tex->ipo==NULL) { - tex->ipo= add_ipo("TexIpo", ID_TE); - } - return tex->ipo; - } - break; - case ID_SEQ: - { - Sequence *seq= (Sequence *)from; /* note, sequence is mimicing Id */ - - if((seq->type & SEQ_EFFECT)|| - (seq->type == SEQ_RAM_SOUND)|| - (seq->type == SEQ_HD_SOUND)) { - if(seq->ipo==NULL) { - seq->ipo= add_ipo("SeqIpo", ID_SEQ); - } - update_seq_ipo_rect(seq); - return seq->ipo; - } - } - break; - case ID_CU: - { - Curve *cu= (Curve *)from; - - if(cu->ipo==NULL) { - cu->ipo= add_ipo("CuIpo", ID_CU); - } - return cu->ipo; - } - break; - case ID_WO: - { - World *wo= (World *)from; - - if(wo->ipo==NULL) { - wo->ipo= add_ipo("WoIpo", ID_WO); - } - return wo->ipo; - } - break; - case ID_LA: - { - Lamp *la= (Lamp *)from; - - if(la->ipo==NULL) { - la->ipo= add_ipo("LaIpo", ID_LA); - } - return la->ipo; - } - break; - case ID_CA: - { - Camera *ca= (Camera *)from; - - if(ca->ipo==NULL) { - ca->ipo= add_ipo("CaIpo", ID_CA); - } - return ca->ipo; - } - break; - case ID_SO: - { - bSound *snd= (bSound *)from; - - if(snd->ipo==NULL) { - snd->ipo= add_ipo("SndIpo", ID_SO); - } - return snd->ipo; - } - } - } - - return NULL; -} - -/* returns and creates - * Make sure functions check for NULL or they will crash! - * */ -IpoCurve *verify_ipocurve(ID *from, short blocktype, char *actname, char *constname, char *bonename, int adrcode) -{ - Ipo *ipo; - IpoCurve *icu= NULL; - - /* return 0 if lib */ - /* creates ipo too */ - ipo= verify_ipo(from, blocktype, actname, constname, bonename); - - if(ipo && ipo->id.lib==NULL && from->lib==NULL) { - - for(icu= ipo->curve.first; icu; icu= icu->next) { - if(icu->adrcode==adrcode) break; - } - if(icu==NULL) { - icu= MEM_callocN(sizeof(IpoCurve), "ipocurve"); - - icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ; - if(ipo->curve.first==NULL) icu->flag |= IPO_ACTIVE; /* first one added active */ - - icu->blocktype= blocktype; - icu->adrcode= adrcode; - - set_icu_vars(icu); - - BLI_addtail( &(ipo->curve), icu); - - switch (GS(from->name)) { - case ID_SEQ: { - Sequence *seq= (Sequence *)from; - - update_seq_icu_rects(seq); - break; - } - } - } - } - - return icu; -} - -/* This function adds a given BezTriple to an IPO-Curve. It will allocate - * memory for the array if needed, and will insert the BezTriple into a - * suitable place in chronological order. - * - * NOTE: any recalculate of the IPO-Curve that needs to be done will need to - * be done by the caller. - */ -int insert_bezt_icu (IpoCurve *icu, BezTriple *bezt) -{ - BezTriple *newb, *beztd; - int i= 0; - - if (icu->bezt == NULL) { - icu->bezt= MEM_callocN(sizeof(BezTriple), "beztriple"); - *(icu->bezt)= *bezt; - icu->totvert= 1; - } - else { - beztd= icu->bezt; - for (i = 0; i <= icu->totvert; i++, beztd++) { - /* no double points - threshold to determine this should be good enough */ - if ((i < icu->totvert) && IS_EQT(beztd->vec[1][0], bezt->vec[1][0], 0.00001)) { - *(beztd)= *bezt; - break; - } - /* if we've reached the end of the icu array, or bezt is to be pasted before current */ - if (i==icu->totvert || beztd->vec[1][0] > bezt->vec[1][0]) { - newb= MEM_callocN( (icu->totvert+1)*sizeof(BezTriple), "beztriple"); - - /* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */ - if (i > 0) - memcpy(newb, icu->bezt, i*sizeof(BezTriple)); - - /* add beztriple to paste at index j */ - *(newb+i)= *bezt; - - /* add the beztriples that occur after the beztriple to be pasted (originally in icu) */ - if (i < icu->totvert) - memcpy(newb+i+1, icu->bezt+i, (icu->totvert-i)*sizeof(BezTriple)); - - MEM_freeN(icu->bezt); - icu->bezt= newb; - - icu->totvert++; - break; - } - } - } - - /* we need to return the index, so that some tools which do post-processing can - * detect where we added the BezTriple in the array - */ - return i; -} - -/* This function is a wrapper for insert_bezt_icu, and should be used when - * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere - * else yet. - * - * 'fast' - is only for the python API where importing BVH's would take an extreamly long time. - */ -void insert_vert_icu (IpoCurve *icu, float x, float y, short fast) -{ - BezTriple beztr; - int a, h1, h2; - - /* set all three points, for nicer start position */ - memset(&beztr, 0, sizeof(BezTriple)); - beztr.vec[0][0]= x; - beztr.vec[0][1]= y; - beztr.vec[1][0]= x; - beztr.vec[1][1]= y; - beztr.vec[2][0]= x; - beztr.vec[2][1]= y; - beztr.hide= IPO_BEZ; - beztr.f1= beztr.f2= beztr.f3= SELECT; - beztr.h1= beztr.h2= HD_AUTO; - - /* add temp beztriple to keyframes */ - a= insert_bezt_icu(icu, &beztr); - if (!fast) calchandles_ipocurve(icu); - - /* set handletype */ - if (icu->totvert > 2) { - BezTriple *bezt; - - h1= h2= HD_AUTO; - bezt= (icu->bezt + a); - - if (a > 0) h1= (bezt-1)->h2; - if (a < icu->totvert-1) h2= (bezt+1)->h1; - - bezt->h1= h1; - bezt->h2= h2; - - if (!fast) calchandles_ipocurve(icu); - } -} - -void add_vert_ipo(void) -{ - EditIpo *ei; - float x, y; - int val; - short mval[2]; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - if(G.sipo->showkey) { - G.sipo->showkey= 0; - free_ipokey(&G.sipo->ipokey); - } - - getmouseco_areawin(mval); - - if(mval[0]>G.v2d->mask.xmax) return; - - ei= get_active_editipo(); - if(ei==NULL) { - error("No active Ipo curve"); - return; - } - ei->flag |= IPO_VISIBLE; /* can happen it is active but not visible */ - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - - /* convert click-time to ipo-time */ - if (NLA_IPO_SCALED) { - x= get_action_frame(OBACT, x); - } - - if(ei->icu==NULL) { - if(G.sipo->from) { - ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode); - if (ei->icu) - ei->flag |= ei->icu->flag & IPO_AUTO_HORIZ; /* new curve could have been added, weak... */ - else - error("Cannot create an IPO curve, you may be using libdata"); - } - } - if(ei->icu==NULL) return; - - if(ei->disptype==IPO_DISPBITS) { - ei->icu->vartype= IPO_BITS; - val= (int)floor(y-0.5); - if(val<0) val= 0; - y= (float)(1 << val); - } - - insert_vert_icu(ei->icu, x, y, 0); - - /* to be sure: if icu was 0, or only 1 curve visible */ - ei->flag |= IPO_SELECT; - ei->icu->flag= ei->flag; - - editipo_changed(G.sipo, 1); - BIF_undo_push("Add Ipo vertex"); -} - -static void *get_context_ipo_poin(ID *id, int blocktype, char *actname, IpoCurve *icu, int *vartype) -{ - if(blocktype==ID_PO) { - if(GS(id->name)==ID_OB) { - Object *ob= (Object *)id; - bPoseChannel *pchan= get_pose_channel(ob->pose, actname); - - *vartype= IPO_FLOAT; - return get_pchan_ipo_poin(pchan, icu->adrcode); - } - return NULL; - } - else - return get_ipo_poin(id, icu, vartype); - -} - -#define KEYNEEDED_DONTADD 0 -#define KEYNEEDED_JUSTADD 1 -#define KEYNEEDED_DELPREV 2 -#define KEYNEEDED_DELNEXT 3 - -static int new_key_needed(IpoCurve *icu, float cFrame, float nValue) -{ - /* This function determines whether a new keyframe is needed */ - /* Cases where keyframes should not be added: - * 1. Keyframe to be added bewteen two keyframes with similar values - * 2. Keyframe to be added on frame where two keyframes are already situated - * 3. Keyframe lies at point that intersects the linear line between two keyframes - */ - - BezTriple *bezt=NULL, *prev=NULL; - int totCount, i; - float valA = 0.0f, valB = 0.0f; - - /* safety checking */ - if (!icu) return KEYNEEDED_JUSTADD; - totCount= icu->totvert; - if (totCount==0) return KEYNEEDED_JUSTADD; - - /* loop through checking if any are the same */ - bezt= icu->bezt; - for (i=0; ivec[1][0]; - beztVal= bezt->vec[1][1]; - - if (prev) { - /* there is a keyframe before the one currently being examined */ - - /* get previous time+value */ - prevPosi= prev->vec[1][0]; - prevVal= prev->vec[1][1]; - - /* keyframe to be added at point where there are already two similar points? */ - if (IS_EQ(prevPosi, cFrame) && IS_EQ(beztPosi, cFrame) && IS_EQ(beztPosi, prevPosi)) { - return KEYNEEDED_DONTADD; - } - - /* keyframe between prev+current points ? */ - if ((prevPosi <= cFrame) && (cFrame <= beztPosi)) { - /* is the value of keyframe to be added the same as keyframes on either side ? */ - if (IS_EQ(prevVal, nValue) && IS_EQ(beztVal, nValue) && IS_EQ(prevVal, beztVal)) { - return KEYNEEDED_DONTADD; - } - else { - float realVal; - - /* get real value of curve at that point */ - realVal= eval_icu(icu, cFrame); - - /* compare whether it's the same as proposed */ - if (IS_EQ(realVal, nValue)) - return KEYNEEDED_DONTADD; - else - return KEYNEEDED_JUSTADD; - } - } - - /* new keyframe before prev beztriple? */ - if (cFrame < prevPosi) { - /* A new keyframe will be added. However, whether the previous beztriple - * stays around or not depends on whether the values of previous/current - * beztriples and new keyframe are the same. - */ - if (IS_EQ(prevVal, nValue) && IS_EQ(beztVal, nValue) && IS_EQ(prevVal, beztVal)) - return KEYNEEDED_DELNEXT; - else - return KEYNEEDED_JUSTADD; - } - } - else { - /* just add a keyframe if there's only one keyframe - * and the new one occurs before the exisiting one does. - */ - if ((cFrame < beztPosi) && (totCount==1)) - return KEYNEEDED_JUSTADD; - } - - /* continue. frame to do not yet passed (or other conditions not met) */ - if (i < (totCount-1)) { - prev= bezt; - bezt++; - } - else - break; - } - - /* Frame in which to add a new-keyframe occurs after all other keys - * -> If there are at least two existing keyframes, then if the values of the - * last two keyframes and the new-keyframe match, the last existing keyframe - * gets deleted as it is no longer required. - * -> Otherwise, a keyframe is just added. 1.0 is added so that fake-2nd-to-last - * keyframe is not equal to last keyframe. - */ - bezt= (icu->bezt + (icu->totvert - 1)); - valA= bezt->vec[1][1]; - - if (prev) - valB= prev->vec[1][1]; - else - valB= bezt->vec[1][1] + 1.0f; - - if (IS_EQ(valA, nValue) && IS_EQ(valA, valB)) - return KEYNEEDED_DELPREV; - else - return KEYNEEDED_JUSTADD; -} - -/* a duplicate of insertkey that does not check for routing to insertmatrixkey - to avoid recursion problems */ -static void insertkey_nonrecurs(ID *id, int blocktype, char *actname, char *constname, int adrcode) -{ - IpoCurve *icu; - Object *ob; - void *poin= NULL; - float curval, cfra; - int vartype; - int matset=0; - - if (matset==0) { - icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode); - - if(icu) { - - poin= get_context_ipo_poin(id, blocktype, actname, icu, &vartype); - - if(poin) { - curval= read_ipo_poin(poin, vartype); - - cfra= frame_to_float(CFRA); - - /* if action is mapped in NLA, it returns a correction */ - if(actname && actname[0] && GS(id->name)==ID_OB) - cfra= get_action_frame((Object *)id, cfra); - - if( GS(id->name)==ID_OB ) { - ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - /* actually frametofloat calc again! */ - cfra-= ob->sf*G.scene->r.framelen; - } - } - - insert_vert_icu(icu, cfra, curval, 0); - } - } - } -} - -int insertmatrixkey(ID *id, int blocktype, char *actname, char *constname, int adrcode) -{ - int matindex=0; - /* branch on adrcode and blocktype, generating the proper matrix-based - values to send to insertfloatkey */ - if (GS(id->name)==ID_OB) { - Object *ob= (Object *)id; - - if ( blocktype==ID_OB ){ //working with an object - if ((ob)&&!(ob->parent)) { - if ((adrcode==OB_ROT_X)||(adrcode==OB_ROT_Y)||(adrcode==OB_ROT_Z)) { //get a rotation - float eul[3]; - switch (adrcode) { - case OB_ROT_X: - matindex=0; - break; - case OB_ROT_Y: - matindex=1; - break; - case OB_ROT_Z: - matindex=2; - break; - } - Mat4ToEul(ob->obmat, eul); - insertfloatkey(id, ID_OB, actname, NULL, adrcode, eul[matindex]*(5.72958)); - return 1; - } else if ((adrcode==OB_LOC_X)||(adrcode==OB_LOC_Y)||(adrcode==OB_LOC_Z)) {//get a translation - switch (adrcode) { - case OB_LOC_X: - matindex=0; - break; - case OB_LOC_Y: - matindex=1; - break; - case OB_LOC_Z: - matindex=2; - break; - } - insertfloatkey(id, ID_OB, actname, NULL, adrcode, ob->obmat[3][matindex]); - return 1; - } - } - } else if ( blocktype==ID_PO) { //working with a pose channel - bPoseChannel *pchan= get_pose_channel(ob->pose, actname); - if (pchan) { - if ((adrcode==AC_LOC_X)||(adrcode==AC_LOC_Y)||(adrcode==AC_LOC_Z)) { - switch (adrcode) { - case AC_LOC_X: - matindex=0; - break; - case AC_LOC_Y: - matindex=1; - break; - case AC_LOC_Z: - matindex=2; - break; - } - if (!(pchan->bone->parent)||((pchan->bone->parent)&&!(pchan->bone->flag&BONE_CONNECTED))) { /* don't use for non-connected child bones */ - float delta_mat[4][4]; - armature_mat_pose_to_delta(delta_mat, pchan->pose_mat, pchan->bone->arm_mat); - insertfloatkey(id, ID_PO, pchan->name, NULL, adrcode, delta_mat[3][matindex]); - return 1; - } - } else if ((adrcode==AC_QUAT_W)||(adrcode==AC_QUAT_X)||(adrcode==AC_QUAT_Y)||(adrcode==AC_QUAT_Z)) { - float tmat[4][4], trimat[3][3], localQuat[4]; - - switch (adrcode) { - case AC_QUAT_W: - matindex=0; - break; - case AC_QUAT_X: - matindex=1; - break; - case AC_QUAT_Y: - matindex=2; - break; - case AC_QUAT_Z: - matindex=3; - break; - } - - /* it should be reasonable to assume that we are keyframing on the active object, although it is not - * strictly required for this particular space conversion, arg1 must not be null for this to work - */ - Mat4CpyMat4(tmat, pchan->pose_mat); - constraint_mat_convertspace(OBACT, pchan, tmat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); - - Mat3CpyMat4(trimat, tmat); - Mat3ToQuat_is_ok(trimat, localQuat); - insertfloatkey(id, ID_PO, pchan->name, NULL, adrcode, localQuat[matindex]); - - return 1; - } - } - } - } - /* failed to set a matrix key -- use traditional, but the non-recursing version */ - insertkey_nonrecurs(id,blocktype,actname,constname,adrcode); - return 0; -} - -static int match_adr_constraint(ID * id, int blocktype, char *actname, int adrcode) -{ /* This function matches constraint blocks with adrcodes to see if the - visual keying method should be used. For example, an object looking to key - location and having a CopyLoc constraint would return true. */ - - Object *ob=NULL; - int foundmatch=0; - int searchtype=0; - bConstraint *conref=NULL, *con=NULL; - - /*Retrieve constraint list*/ - if( GS(id->name)==ID_OB ) - ob= (Object *)id; - if (ob) { - if (blocktype==ID_PO) { - bPoseChannel *pchan= get_pose_channel(ob->pose, actname); - conref=pchan->constraints.first; - } else if (blocktype==ID_OB) { - conref=ob->constraints.first; - } - - if (conref) { - /*Set search type: 1 is for translation contraints, 2 is for rotation*/ - if ((adrcode==OB_LOC_X)||(adrcode==OB_LOC_Y)||(adrcode==OB_LOC_Z)||(adrcode==AC_LOC_X)||(adrcode==AC_LOC_Y)||(adrcode==AC_LOC_Z)) { - searchtype=1; - } else if ((adrcode==OB_ROT_X)||(adrcode==OB_ROT_Y)||(adrcode==OB_ROT_Z)||(adrcode==AC_QUAT_W)||(adrcode==AC_QUAT_X)||(adrcode==AC_QUAT_Y)||(adrcode==AC_QUAT_Z)) { - searchtype=2; - } - - if (searchtype>0) { - for (con=conref; (con)&&(foundmatch==0); con=con->next) { - switch (con->type) { - /* match constraint types to which kinds of keying they would affect */ - case CONSTRAINT_TYPE_CHILDOF: - foundmatch=1; - break; - case CONSTRAINT_TYPE_TRACKTO: - if (searchtype==2) foundmatch=1; - break; - case CONSTRAINT_TYPE_FOLLOWPATH: - foundmatch=1; - break; - case CONSTRAINT_TYPE_ROTLIMIT: - if (searchtype==2) foundmatch=1; - break; - case CONSTRAINT_TYPE_LOCLIMIT: - if (searchtype==1) foundmatch=1; - break; - case CONSTRAINT_TYPE_ROTLIKE: - if (searchtype==2) foundmatch=1; - break; - case CONSTRAINT_TYPE_LOCLIKE: - if (searchtype==1) foundmatch=1; - break; - case CONSTRAINT_TYPE_LOCKTRACK: - if (searchtype==2) foundmatch=1; - break; - case CONSTRAINT_TYPE_DISTANCELIMIT: - if (searchtype==1) foundmatch=1; - break; - case CONSTRAINT_TYPE_MINMAX: - if (searchtype==1) foundmatch=1; - break; - case CONSTRAINT_TYPE_TRANSFORM: - foundmatch=1; - break; - default: - break; - } - } - } - } - } - - return foundmatch; - -} - -void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode, short fast) -{ - IpoCurve *icu; - Object *ob; - void *poin= NULL; - float curval, cfra; - int vartype; - int matset=0; - - if ((G.flags&G_AUTOMATKEYS)&&(match_adr_constraint(id, blocktype, actname, adrcode))) { - matset=insertmatrixkey(id, blocktype, actname, constname, adrcode); - } - if (matset==0) { - icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode); - - if(icu) { - - poin= get_context_ipo_poin(id, blocktype, actname, icu, &vartype); - - if(poin) { - curval= read_ipo_poin(poin, vartype); - - cfra= frame_to_float(CFRA); - - /* if action is mapped in NLA, it returns a correction */ - if(actname && actname[0] && GS(id->name)==ID_OB) - cfra= get_action_frame((Object *)id, cfra); - - if( GS(id->name)==ID_OB ) { - ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - /* actually frametofloat calc again! */ - cfra-= ob->sf*G.scene->r.framelen; - } - } - - insert_vert_icu(icu, cfra, curval, fast); - } - } - } -} - - - -/* This function is a 'smarter' version of the insert key code. - * It uses an auxilliary function to check whether a keyframe is really needed */ -void insertkey_smarter(ID *id, int blocktype, char *actname, char *constname, int adrcode) -{ - IpoCurve *icu; - Object *ob; - void *poin= NULL; - float curval, cfra; - int vartype; - int insert_mode; - - icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode); - - if(icu) { - - poin= get_context_ipo_poin(id, blocktype, actname, icu, &vartype); - - if(poin) { - curval= read_ipo_poin(poin, vartype); - - cfra= frame_to_float(CFRA); - - /* if action is mapped in NLA, it returns a correction */ - if(actname && actname[0] && GS(id->name)==ID_OB) - cfra= get_action_frame((Object *)id, cfra); - - if( GS(id->name)==ID_OB ) { - ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - /* actually frametofloat calc again! */ - cfra-= ob->sf*G.scene->r.framelen; - } - } - - /* check whether this curve really needs a new keyframe */ - insert_mode= new_key_needed(icu, cfra, curval); - - /* insert new keyframe at current frame */ - if (insert_mode) - insert_vert_icu(icu, cfra, curval, 0); - - /* delete keyframe immediately before/after newly added */ - switch (insert_mode) { - case KEYNEEDED_DELPREV: - delete_icu_key(icu, icu->totvert-2); - break; - case KEYNEEDED_DELNEXT: - delete_icu_key(icu, 1); - break; - } - } - } -} - -/* For inserting keys based on an arbitrary float value */ -void insertfloatkey(ID *id, int blocktype, char *actname, char *constname, int adrcode, float floatkey) -{ - IpoCurve *icu; - Object *ob; - void *poin= NULL; - float cfra; - int vartype; - - icu= verify_ipocurve(id, blocktype, actname, constname, NULL, adrcode); - - if(icu) { - - poin= get_context_ipo_poin(id, blocktype, actname, icu, &vartype); - - if(poin) { - - cfra= frame_to_float(CFRA); - - /* if action is mapped in NLA, it returns a correction */ - if(actname && actname[0] && GS(id->name)==ID_OB) - cfra= get_action_frame((Object *)id, cfra); - - if( GS(id->name)==ID_OB ) { - ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - /* actually frametofloat calc again! */ - cfra-= ob->sf*G.scene->r.framelen; - } - } - - /* insert new keyframe at current frame */ - insert_vert_icu(icu, cfra, floatkey, 0); - } - } -} - -void insertkey_editipo(void) -{ - EditIpo *ei; - IpoKey *ik; - ID *id; - float *fp, cfra, *insertvals; - int a, nr, ok, tot; - short event; - - ei= get_active_editipo(); - if(ei && ei->icu && ei->icu->driver) - event= pupmenu("Insert Curve %t|Default one-to-one mapping %x3"); - else if(G.sipo->showkey) - event= pupmenu("Insert Key Vertices %t|Current Frame %x1|Selected Keys %x2"); - else - event= pupmenu("Insert Key Vertices %t|Current Frame %x1"); - - if(event<1) return; - - if(event==3) { - IpoDriver *driver= ei->icu->driver; - - if(ei->icu->bezt) MEM_freeN(ei->icu->bezt); - ei->icu->totvert= 0; - ei->icu->bezt= NULL; - - insert_vert_icu(ei->icu, 0.0f, 0.0f, 0); - - if(ELEM3(driver->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) { - if(ei->disptype==IPO_DISPDEGR) - insert_vert_icu(ei->icu, 18.0f, 18.0f, 0); - else - insert_vert_icu(ei->icu, 18.0f, 1.0f, 0); - } - else - insert_vert_icu(ei->icu, 1.0f, 1.0f, 0); - - ei->flag |= IPO_SELECT|IPO_VISIBLE; - ei->icu->flag= ei->flag; - ei->icu->extrap= IPO_DIR; - - do_ipo_buttons(B_IPOHOME); - } - else { - ei= G.sipo->editipo; - for(nr=0; nrtotipo; nr++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - - ok= 0; - if(G.sipo->showkey) ok= 1; - else if(ei->flag & IPO_SELECT) ok= 1; - - if(ok) { - /* count amount */ - if(event==1) tot= 1; - else { - ik= G.sipo->ipokey.first; - tot= 0; - while(ik) { - if(ik->flag & 1) tot++; - ik= ik->next; - } - } - if(tot) { - - /* correction for ob timeoffs */ - cfra= frame_to_float(CFRA); - id= G.sipo->from; - if(id && GS(id->name)==ID_OB ) { - Object *ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - cfra-= ob->sf*G.scene->r.framelen; - } - } - else if(id && GS(id->name)==ID_SEQ) { - Sequence *last_seq = get_last_seq(); /* editsequence.c */ - - if(last_seq && (last_seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) { - cfra= (float)(100.0*(cfra-last_seq->startdisp)/((float)(last_seq->enddisp-last_seq->startdisp))); - } - } - - /* convert cfra to ipo-time */ - if (NLA_IPO_SCALED) { - cfra= get_action_frame(OBACT, cfra); - } - - insertvals= MEM_mallocN(sizeof(float)*2*tot, "insertkey_editipo"); - /* make sure icu->curval is correct */ - calc_ipo(G.sipo->ipo, cfra); - - if(event==1) { - insertvals[0]= cfra; - - insertvals[1]= ei->icu->curval; - } - else { - fp= insertvals; - ik= G.sipo->ipokey.first; - while(ik) { - if(ik->flag & 1) { - calc_ipo(G.sipo->ipo, ik->val); - - fp[0]= ik->val; - fp[1]= ei->icu->curval; - fp+= 2; - } - ik= ik->next; - } - } - fp= insertvals; - for(a=0; aicu, fp[0], fp[1], 0); - } - - MEM_freeN(insertvals); - calc_ipo(G.sipo->ipo, (float)CFRA); - } - } - } - } - } - BIF_undo_push("Insert Key Ipo"); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); -} - - -void common_insertkey(void) -{ - Base *base; - Object *ob; - Material *ma; - ID *id; - IpoCurve *icu; - World *wo; - Lamp *la; - Tex *te; - int tlay, map, event; - char menustr[256]; - - if(curarea->spacetype==SPACE_IPO) { - insertkey_editipo(); - } - else if(curarea->spacetype==SPACE_ACTION) { - insertkey_action(); - } - else if(curarea->spacetype==SPACE_BUTS) { - if(G.buts->mainb==CONTEXT_SHADING) { - int tab= G.buts->tab[CONTEXT_SHADING]; - - if(tab==TAB_SHADING_MAT) { - ma = G.buts->lockpoin; - ma = editnode_get_active_material(ma); - id = (ID *)ma; - - if(id) { - event= pupmenu("Insert Key %t|RGB%x0|Alpha%x1|Halo Size%x2|Mode %x3|All Color%x10|All Mirror%x14|Ofs%x12|Size%x13|All Mapping%x11"); - if(event== -1) return; - - map= texchannel_to_adrcode(ma->texact); - - if(event==0 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_COL_R, 0); - insertkey(id, ID_MA, NULL, NULL, MA_COL_G, 0); - insertkey(id, ID_MA, NULL, NULL, MA_COL_B, 0); - } - if(event==1 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_ALPHA, 0); - } - if(event==2 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_HASIZE, 0); - } - if(event==3 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_MODE, 0); - } - if(event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_R, 0); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_G, 0); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_B, 0); - insertkey(id, ID_MA, NULL, NULL, MA_REF, 0); - insertkey(id, ID_MA, NULL, NULL, MA_EMIT, 0); - insertkey(id, ID_MA, NULL, NULL, MA_AMB, 0); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC, 0); - insertkey(id, ID_MA, NULL, NULL, MA_HARD, 0); - insertkey(id, ID_MA, NULL, NULL, MA_MODE, 0); - insertkey(id, ID_MA, NULL, NULL, MA_TRANSLU, 0); - insertkey(id, ID_MA, NULL, NULL, MA_ADD, 0); - } - if(event==14) { - insertkey(id, ID_MA, NULL, NULL, MA_RAYM, 0); - insertkey(id, ID_MA, NULL, NULL, MA_FRESMIR, 0); - insertkey(id, ID_MA, NULL, NULL, MA_FRESMIRI, 0); - insertkey(id, ID_MA, NULL, NULL, MA_FRESTRA, 0); - insertkey(id, ID_MA, NULL, NULL, MA_FRESTRAI, 0); - } - if(event==12 || event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_X, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Y, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Z, 0); - } - if(event==13 || event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_X, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Y, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Z, 0); - } - if(event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_R, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_G, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_B, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_DVAR, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_COLF, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_NORF, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_VARF, 0); - insertkey(id, ID_MA, NULL, NULL, map+MAP_DISP, 0); - } - } - } - else if(tab==TAB_SHADING_WORLD) { - id= G.buts->lockpoin; - wo= G.buts->lockpoin; - if(id) { - event= pupmenu("Insert Key %t|Zenith RGB%x0|Horizon RGB%x1|Mist%x2|Stars %x3|Offset%x12|Size%x13"); - if(event== -1) return; - - map= texchannel_to_adrcode(wo->texact); - - if(event==0) { - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_R, 0); - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_G, 0); - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_B, 0); - } - if(event==1) { - insertkey(id, ID_WO, NULL, NULL, WO_HOR_R, 0); - insertkey(id, ID_WO, NULL, NULL, WO_HOR_G, 0); - insertkey(id, ID_WO, NULL, NULL, WO_HOR_B, 0); - } - if(event==2) { - insertkey(id, ID_WO, NULL, NULL, WO_MISI, 0); - insertkey(id, ID_WO, NULL, NULL, WO_MISTDI, 0); - insertkey(id, ID_WO, NULL, NULL, WO_MISTSTA, 0); - insertkey(id, ID_WO, NULL, NULL, WO_MISTHI, 0); - } - if(event==3) { - insertkey(id, ID_WO, NULL, NULL, WO_STAR_R, 0); - insertkey(id, ID_WO, NULL, NULL, WO_STAR_G, 0); - insertkey(id, ID_WO, NULL, NULL, WO_STAR_B, 0); - insertkey(id, ID_WO, NULL, NULL, WO_STARDIST, 0); - insertkey(id, ID_WO, NULL, NULL, WO_STARSIZE, 0); - } - if(event==12) { - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_X, 0); - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Y, 0); - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Z, 0); - } - if(event==13) { - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_X, 0); - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Y, 0); - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Z, 0); - } - } - } - else if(tab==TAB_SHADING_LAMP) { - id= G.buts->lockpoin; - la= G.buts->lockpoin; - if(id) { - event= pupmenu("Insert Key %t|RGB%x0|Energy%x1|Spot Size%x2|Offset%x12|Size%x13"); - if(event== -1) return; - - map= texchannel_to_adrcode(la->texact); - - if(event==0) { - insertkey(id, ID_LA, NULL, NULL, LA_COL_R, 0); - insertkey(id, ID_LA, NULL, NULL, LA_COL_G, 0); - insertkey(id, ID_LA, NULL, NULL, LA_COL_B, 0); - } - if(event==1) { - insertkey(id, ID_LA, NULL, NULL, LA_ENERGY, 0); - } - if(event==2) { - insertkey(id, ID_LA, NULL, NULL, LA_SPOTSI, 0); - } - if(event==12) { - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_X, 0); - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Y, 0); - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Z, 0); - } - if(event==13) { - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_X, 0); - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Y, 0); - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Z, 0); - } - - } - } - else if(tab==TAB_SHADING_TEX) { - id= G.buts->lockpoin; - te= G.buts->lockpoin; - if(id) { - event= pupmenu("Insert Key %t|Clouds%x0|Marble%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|DistortedNoise%x8|ColorFilter%x9"); - if(event== -1) return; - - if(event==0) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); - } - if(event==1) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2, 0); - } - if(event==2) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); - } - if(event==3) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); - insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2, 0); - } - if(event==4) { - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); - insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); - } - if(event==5) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - } - if(event==6) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MGH, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_LAC, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN, 0); - } - if(event==7) { - insertkey(id, ID_TE, NULL, NULL, TE_VNW1, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VNW2, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VNW3, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VNW4, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VNMEXP, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VN_DISTM, 0); - insertkey(id, ID_TE, NULL, NULL, TE_VN_COLT, 0); - insertkey(id, ID_TE, NULL, NULL, TE_ISCA, 0); - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); - } - if(event==8) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF, 0); - insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN, 0); - insertkey(id, ID_TE, NULL, NULL, TE_DISTA, 0); - } - if(event==9) { - insertkey(id, ID_TE, NULL, NULL, TE_COL_R, 0); - insertkey(id, ID_TE, NULL, NULL, TE_COL_G, 0); - insertkey(id, ID_TE, NULL, NULL, TE_COL_B, 0); - insertkey(id, ID_TE, NULL, NULL, TE_BRIGHT, 0); - insertkey(id, ID_TE, NULL, NULL, TE_CONTRA, 0); - } - } - } - } - else if(G.buts->mainb==CONTEXT_OBJECT) { - ob= OBACT; - if(ob) { - id= (ID *) (ob); - if(id) { - if(ob->type==OB_MESH) - event= pupmenu("Insert Key %t|Surface Damping%x0|Random Damping%x1|Permeability%x2|Force Strength%x3|Force Falloff%x4"); - else - event= pupmenu("Insert Key %t|Force Strength%x3|Force Falloff%x4"); - if(event == -1) return; - - if(event==0) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_SDAMP, 0); - } - if(event==1) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_RDAMP, 0); - } - if(event==2) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_PERM, 0); - } - if(event==3) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_FSTR, 0); - } - if(event==4) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_FFALL, 0); - } - if(event==5) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_FMAXD, 0); - } - } - } - } - else if(G.buts->mainb==CONTEXT_EDITING) { - ob= OBACT; - if(ob && ob->type==OB_CAMERA) { - id= G.buts->lockpoin; - if(id) { - /* yafray: insert key extended with aperture and focal distance */ - /* qdn: FocalDistance now enabled for Blender as wel, for use with defocus node */ - if (G.scene->r.renderer==R_INTERN) - event= pupmenu("Insert Key %t|Lens%x0|Clipping%x1|FocalDistance%x3|Viewplane Shift%x4"); - else - event= pupmenu("Insert Key %t|Lens%x0|Clipping%x1|Aperture%x2|FocalDistance%x3"); - if(event== -1) return; - - if(event==0) { - insertkey(id, ID_CA, NULL, NULL, CAM_LENS, 0); - } - else if(event==1) { - insertkey(id, ID_CA, NULL, NULL, CAM_STA, 0); - insertkey(id, ID_CA, NULL, NULL, CAM_END, 0); - } - else if(event==2) { - insertkey(id, ID_CA, NULL, NULL, CAM_YF_APERT, 0); - } - else if(event==3) { - insertkey(id, ID_CA, NULL, NULL, CAM_YF_FDIST, 0); - } - else if(event==4) { - insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_X, 0); - insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_Y, 0); - } - } - } - } - else if(FALSE /* && G.buts->mainb==BUTS_SOUND */) { - if(G.ssound) { - id= G.buts->lockpoin; - if(id) { - event= pupmenu("Insert Key %t|Volume%x0|Pitch%x1|Panning%x2|Attennuation%x3"); - if(event== -1) return; - - if(event==0) { - insertkey(id, ID_SO, NULL, NULL, SND_VOLUME, 0); - } - if(event==1) { - insertkey(id, ID_SO, NULL, NULL, SND_PITCH, 0); - } - if(event==2) { - insertkey(id, ID_SO, NULL, NULL, SND_PANNING, 0); - } - if(event==3) { - insertkey(id, ID_SO, NULL, NULL, SND_ATTEN, 0); - } - } - } - } - - BIF_undo_push("Insert Key Buttons"); - - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - - } - else if(curarea->spacetype==SPACE_VIEW3D) { - ob= OBACT; - - if (ob && (ob->flag & OB_POSEMODE)) { - bPoseChannel *pchan; - - set_pose_keys(ob); /* sets pchan->flag to POSE_KEY if bone selected, and clears if not */ - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) - if (pchan->flag & POSE_KEY) - break; - if(pchan==NULL) return; - strcpy(menustr, "Insert Key%t|Loc%x0|Rot%x1|Scale%x2|LocRot%x3|LocRotScale%x4|Avail%x9|Needed%x15|VisualLoc%x11|VisualRot%x12|VisualLocRot%x13"); - } - else { - base= FIRSTBASE; - while(base) { - if (TESTBASELIB(base)) break; - base= base->next; - } - if(base==NULL) return; - strcpy(menustr, "Insert Key%t|Loc%x0|Rot%x1|Scale%x2|LocRot%x3|LocRotScale%x4|Layer%x5|Avail%x9|Needed%x15|VisualLoc%x11|VisualRot%x12|VisualLocRot%x13"); - } - - if(ob) { - if(ob->type==OB_MESH) strcat(menustr, "| %x6|Mesh%x7"); - else if(ob->type==OB_LATTICE) strcat(menustr, "| %x6|Lattice%x7"); - else if(ob->type==OB_CURVE) strcat(menustr, "| %x6|Curve%x7"); - else if(ob->type==OB_SURF) strcat(menustr, "| %x6|Surface%x7"); - } - - event= pupmenu(menustr); - if(event== -1) return; - - if(event==7) { // ob != NULL - insert_shapekey(ob); - return; - } - - if (ob && (ob->flag & OB_POSEMODE)){ - bPoseChannel *pchan; - short recalc_bonepaths= 0; - - if (ob->action && ob->action->id.lib) { - error ("Can't key libactions"); - return; - } - - id= &ob->id; - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - if (pchan->flag & POSE_KEY) { - /* insert relevant keyframes */ - if(event==0 || event==3 ||event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); - } - if(event==1 || event==3 || event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); - } - if(event==2 || event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); - } - if (event==9 && ob->action) { - bActionChannel *achan; - - for (achan = ob->action->chanbase.first; achan; achan=achan->next){ - if (achan->ipo && !strcmp (achan->name, pchan->name)){ - for (icu = achan->ipo->curve.first; icu; icu=icu->next){ - insertkey(id, ID_PO, achan->name, NULL, icu->adrcode, 0); - } - break; - } - } - } - if(event==11 || event==13) { - int matok=0; - /* check one to make sure we're not trying to set visual loc keys on - bones inside of a chain, which only leads to tears. */ - matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_X); - insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y); - insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z); - - if (matok == 0) { - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); - } - } - if(event==12 || event==13) { - int matok=0; - /* check one to make sure we're not trying to set visual rot keys on - bones inside of a chain, which only leads to tears. */ - matok= insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W); - insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - - if (matok == 0) { - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); - } - } - if (event==15 && ob->action) { - bActionChannel *achan; - - for (achan = ob->action->chanbase.first; achan; achan=achan->next){ - if (achan->ipo && !strcmp (achan->name, pchan->name)){ - for (icu = achan->ipo->curve.first; icu; icu=icu->next){ - insertkey_smarter(id, ID_PO, achan->name, NULL, icu->adrcode); - } - break; - } - } - } - - /* clear unkeyed flag (it doesn't matter if it's set or not) */ - if (pchan->bone) - pchan->bone->flag &= ~BONE_UNKEYED; - - /* check if bone has a path */ - if (pchan->path) - recalc_bonepaths = 1; - } - } - - /* recalculate ipo handles, etc. */ - if(ob->action) - remake_action_ipos(ob->action); - - /* recalculate bone-paths on adding new keyframe? */ - // TODO: currently, there is no setting to turn this on/off globally - if (recalc_bonepaths) - pose_recalculate_paths(ob); - - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } - else { - base= FIRSTBASE; - while(base) { - if (TESTBASELIB(base)) { - char *actname= NULL; - - id= (ID *)(base->object); - - if(base->object->ipoflag & OB_ACTION_OB) - actname= "Object"; - - /* all curves in ipo deselect */ - if(base->object->ipo || base->object->action) { - if (base->object->ipo) { - icu= base->object->ipo->curve.first; - } - else { - bActionChannel *achan; - achan= get_action_channel(base->object->action, actname); - - if (achan && achan->ipo) - icu= achan->ipo->curve.first; - else - icu= NULL; - } - - while(icu) { - icu->flag &= ~IPO_SELECT; - - switch (event) { - case 9: - insertkey(id, ID_OB, actname, NULL, icu->adrcode, 0); - break; - case 15: - insertkey_smarter(id, ID_OB, actname, NULL, icu->adrcode); - break; - } - icu= icu->next; - } - } - - if(event==0 || event==3 ||event==4) { - insertkey(id, ID_OB, actname, NULL, OB_LOC_X, 0); - insertkey(id, ID_OB, actname, NULL, OB_LOC_Y, 0); - insertkey(id, ID_OB, actname, NULL, OB_LOC_Z, 0); - } - if(event==1 || event==3 ||event==4) { - insertkey(id, ID_OB, actname, NULL, OB_ROT_X, 0); - insertkey(id, ID_OB, actname, NULL, OB_ROT_Y, 0); - insertkey(id, ID_OB, actname, NULL, OB_ROT_Z, 0); - } - if(event==2 || event==4) { - insertkey(id, ID_OB, actname, NULL, OB_SIZE_X, 0); - insertkey(id, ID_OB, actname, NULL, OB_SIZE_Y, 0); - insertkey(id, ID_OB, actname, NULL, OB_SIZE_Z, 0); - } - if(event==5) { - /* remove localview */ - tlay= base->object->lay; - base->object->lay &= 0xFFFFFF; - insertkey(id, ID_OB, actname, NULL, OB_LAY, 0); - base->object->lay= tlay; - } - if(event==11 || event==13) { - insertmatrixkey(id, ID_OB, actname, NULL, OB_LOC_X); - insertmatrixkey(id, ID_OB, actname, NULL, OB_LOC_Y); - insertmatrixkey(id, ID_OB, actname, NULL, OB_LOC_Z); - } - if(event==12 || event==13) { - insertmatrixkey(id, ID_OB, actname, NULL, OB_ROT_X); - insertmatrixkey(id, ID_OB, actname, NULL, OB_ROT_Y); - insertmatrixkey(id, ID_OB, actname, NULL, OB_ROT_Z); - } - base->object->recalc |= OB_RECALC_OB; - } - base= base->next; - } - } - - if(event==0) BIF_undo_push("Insert Loc Key"); - else if(event==1) BIF_undo_push("Insert Rot Key"); - else if(event==2) BIF_undo_push("Insert Scale Key"); - else if(event==3) BIF_undo_push("Insert LocRot Key"); - else if(event==4) BIF_undo_push("Insert LocRotScale Key"); - else if(event==5) BIF_undo_push("Insert Layer Key"); - else if(event==7) BIF_undo_push("Insert Vertex Key"); - else if(event==9) BIF_undo_push("Insert Avail Key"); - else if(event==11) BIF_undo_push("Insert VisualLoc Key"); - else if(event==12) BIF_undo_push("Insert VisualRot Key"); - else if(event==13) BIF_undo_push("Insert VisualLocRot Key"); - else if(event==15) BIF_undo_push("Insert Needed Key"); - - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } - -} - -/* ****************************************************************************** */ - -void add_duplicate_editipo(void) -{ - Object *ob; - EditIpo *ei; - IpoCurve *icu; - BezTriple *bezt, *beztn, *newb; - int tot, a, b; - - get_status_editipo(); - if(totipo_vertsel==0) return; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - icu= ei->icu; - - /* how many points */ - tot= 0; - b= icu->totvert; - bezt= icu->bezt; - while(b--) { - if(bezt->f2 & SELECT) tot++; - bezt++; - } - - if(tot) { - icu->totvert+= tot; - newb= beztn= MEM_mallocN(icu->totvert*sizeof(BezTriple), "bezt"); - bezt= icu->bezt; - b= icu->totvert-tot; - while(b--) { - *beztn= *bezt; - if(bezt->f2 & SELECT) { - beztn->f1= beztn->f2= beztn->f3= 0; - beztn++; - *beztn= *bezt; - } - beztn++; - bezt++; - } - MEM_freeN(icu->bezt); - icu->bezt= newb; - - calchandles_ipocurve(icu); - } - } - } - } - - if(G.sipo->showkey) { - make_ipokey(); - if(G.sipo->blocktype==ID_OB) { - ob= OBACT; - if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0); - } - } - BIF_undo_push("Duplicate Ipo"); - transform_ipo('g'); -} - -void remove_doubles_ipo(void) -{ - EditIpo *ei; - IpoKey *ik, *ikn; - BezTriple *bezt, *newb, *new1; - float val; - int mode, a, b; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - - /* OR the curve is selected OR in editmode OR in keymode */ - mode= 0; - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) mode= 1; - else if(ei->flag & IPO_SELECT) mode= 2; - - if(mode) { - bezt= ei->icu->bezt; - newb= new1= MEM_mallocN(ei->icu->totvert*sizeof(BezTriple), "newbezt"); - *newb= *bezt; - b= ei->icu->totvert-1; - bezt++; - while(b--) { - - /* can we remove? */ - if(mode==2 || (bezt->f2 & SELECT)) { - - /* are the points different? */ - if( fabs( bezt->vec[1][0]-newb->vec[1][0] ) > 0.9 ) { - newb++; - *newb= *bezt; - } - else { - /* median */ - VecMidf(newb->vec[0], newb->vec[0], bezt->vec[0]); - VecMidf(newb->vec[1], newb->vec[1], bezt->vec[1]); - VecMidf(newb->vec[2], newb->vec[2], bezt->vec[2]); - - newb->h1= newb->h2= HD_FREE; - - ei->icu->totvert--; - } - - } - else { - newb++; - *newb= *bezt; - } - bezt++; - } - - MEM_freeN(ei->icu->bezt); - ei->icu->bezt= new1; - - calchandles_ipocurve(ei->icu); - } - } - } - - editipo_changed(G.sipo, 1); /* makes ipokeys again! */ - - /* remove double keys */ - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - ikn= ik->next; - - while(ik && ikn) { - if( (ik->flag & 1) && (ikn->flag & 1) ) { - if( fabs(ik->val-ikn->val) < 0.9 ) { - val= (float)((ik->val + ikn->val)/2.0); - - for(a=0; atotipo; a++) { - if(ik->data[a]) ik->data[a]->vec[1][0]= val; - if(ikn->data[a]) ikn->data[a]->vec[1][0]= val; - } - } - } - ik= ikn; - ikn= ikn->next; - - } - - editipo_changed(G.sipo, 1); /* makes ipokeys agian! */ - - } - deselectall_editipo(); -} - - -void clean_ipo(void) -{ - EditIpo *ei; - short ok; - int b; - - ok= fbutton(&G.scene->toolsettings->clean_thresh, - 0.0000001f, 1.0, 0.001, 0.1, - "Threshold"); - if (!ok) return; - - get_status_editipo(); - - ei= G.sipo->editipo; - for(b=0; btotipo; b++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - - ok= 0; - if(G.sipo->showkey) ok= 1; - else if(totipo_vert && (ei->flag & IPO_EDIT)) ok= 2; - else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok= 3; - - if(ok) { - /* only clean if ok */ - clean_ipo_curve(ei->icu); - } - } - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Clean IPO"); -} - -void clean_ipo_curve(IpoCurve *icu) -{ - BezTriple *old_bezts, *bezt, *beztn; - BezTriple *lastb; - int totCount, i; - float thresh; - - /* check if any points */ - if (icu == NULL || icu->totvert <= 1) - return; - - /* get threshold for match-testing */ - thresh= G.scene->toolsettings->clean_thresh; - - /* make a copy of the old BezTriples, and clear IPO curve */ - old_bezts = icu->bezt; - totCount = icu->totvert; - icu->bezt = NULL; - icu->totvert = 0; - - /* now insert first keyframe, as it should be ok */ - bezt = old_bezts; - insert_vert_icu(icu, bezt->vec[1][0], bezt->vec[1][1], 0); - - /* Loop through BezTriples, comparing them. Skip any that do - * not fit the criteria for "ok" points. - */ - for (i=1; ivec[1][0]; next[1]= beztn->vec[1][1]; - } - else { - beztn = NULL; - next[0] = next[1] = 0.0f; - } - lastb= (icu->bezt + (icu->totvert - 1)); - bezt= (old_bezts + i); - - /* get references for quicker access */ - prev[0] = lastb->vec[1][0]; prev[1] = lastb->vec[1][1]; - cur[0] = bezt->vec[1][0]; cur[1] = bezt->vec[1][1]; - - /* check if current bezt occurs at same time as last ok */ - if (IS_EQT(cur[0], prev[0], thresh)) { - /* If there is a next beztriple, and if occurs at the same time, only insert - * if there is a considerable distance between the points, and also if the - * current is further away than the next one is to the previous. - */ - if (beztn && (IS_EQT(cur[0], next[0], thresh)) && - (IS_EQT(next[1], prev[1], thresh)==0)) - { - /* only add if current is further away from previous */ - if (cur[1] > next[1]) { - if (IS_EQT(cur[1], prev[1], thresh) == 0) { - /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1], 0); - } - } - } - else { - /* only add if values are a considerable distance apart */ - if (IS_EQT(cur[1], prev[1], thresh) == 0) { - /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1], 0); - } - } - } - else { - /* checks required are dependent on whether this is last keyframe or not */ - if (beztn) { - /* does current have same value as previous and next? */ - if (IS_EQT(cur[1], prev[1], thresh) == 0) { - /* add new keyframe*/ - insert_vert_icu(icu, cur[0], cur[1], 0); - } - else if (IS_EQT(cur[1], next[1], thresh) == 0) { - /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1], 0); - } - } - else { - /* add if value doesn't equal that of previous */ - if (IS_EQT(cur[1], prev[1], thresh) == 0) { - /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1], 0); - } - } - } - } - - /* now free the memory used by the old BezTriples */ - if (old_bezts) - MEM_freeN(old_bezts); -} - -void smooth_ipo(void) -{ - EditIpo *ei; - short ok; - int b; - - get_status_editipo(); - - ei= G.sipo->editipo; - for(b=0; btotipo; b++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - - ok= 0; - if(G.sipo->showkey) ok= 1; - else if(totipo_vert && (ei->flag & IPO_EDIT)) ok= 2; - else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok= 3; - - if(ok) { - IpoCurve *icu= ei->icu; - BezTriple *bezt; - float meanValSum = 0.0f, meanVal; - float valDiff; - int i, totSel = 0; - - /* check if enough points */ - if (icu->totvert >= 3) { - /* first loop through - obtain average value */ - bezt= icu->bezt; - for (i=1; i < icu->totvert; i++, bezt++) { - if (BEZSELECTED(bezt)) { - /* line point's handles up with point's vertical position */ - bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1]; - if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN; - if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN; - - /* add value to total */ - meanValSum += bezt->vec[1][1]; - totSel++; - } - } - - /* calculate mean value */ - meanVal= meanValSum / totSel; - - /* second loop through - update point positions */ - bezt= icu->bezt; - for (i=0; i < icu->totvert; i++, bezt++) { - if (BEZSELECTED(bezt)) { - /* 1. calculate difference between the points - * 2. move point half-way along that distance - */ - if (bezt->vec[1][1] > meanVal) { - /* bezt val above mean */ - valDiff= bezt->vec[1][1] - meanVal; - bezt->vec[1][1]= meanVal + (valDiff / 2); - } - else { - /* bezt val below mean */ - valDiff= meanVal - bezt->vec[1][1]; - bezt->vec[1][1] = bezt->vec[1][1] + (valDiff / 2); - } - } - } - } - - /* recalc handles */ - calchandles_ipocurve(icu); - } - } - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Smooth IPO"); -} - -void join_ipo_menu(void) -{ - int mode = 0; - mode= pupmenu("Join %t|All Selected %x1|Selected Doubles %x2"); - - if (mode == -1) return; - - join_ipo(mode); -} - -void join_ipo(int mode) -{ - EditIpo *ei; - IpoKey *ik; - IpoCurve *icu; - BezTriple *bezt, *beztn, *newb; - float val; - int tot, a, b; - - get_status_editipo(); - - /* Mode events: - * All Selected: 1 - * Selected Doubles: 2 - */ - - if( mode==2 ) { - remove_doubles_ipo(); - return; - } - - /* first: multiple selected verts in 1 curve */ - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - icu= ei->icu; - - /* how many points */ - tot= 0; - b= icu->totvert; - bezt= icu->bezt; - while(b--) { - if(bezt->f2 & SELECT) tot++; - bezt++; - } - - if(tot>1) { - tot--; - icu->totvert-= tot; - - newb= MEM_mallocN(icu->totvert*sizeof(BezTriple), "bezt"); - /* the first point is the new one */ - beztn= newb+1; - tot= 0; - - bezt= icu->bezt; - b= icu->totvert+tot+1; - while(b--) { - - if(bezt->f2 & SELECT) { - if(tot==0) *newb= *bezt; - else { - VecAddf(newb->vec[0], newb->vec[0], bezt->vec[0]); - VecAddf(newb->vec[1], newb->vec[1], bezt->vec[1]); - VecAddf(newb->vec[2], newb->vec[2], bezt->vec[2]); - } - tot++; - } - else { - *beztn= *bezt; - beztn++; - } - bezt++; - } - - VecMulf(newb->vec[0], (float)(1.0/((float)tot))); - VecMulf(newb->vec[1], (float)(1.0/((float)tot))); - VecMulf(newb->vec[2], (float)(1.0/((float)tot))); - - MEM_freeN(icu->bezt); - icu->bezt= newb; - - sort_time_ipocurve(icu); - calchandles_ipocurve(icu); - } - } - } - } - - /* next: in keymode: join multiple selected keys */ - - editipo_changed(G.sipo, 1); /* makes ipokeys again! */ - - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - val= 0.0; - tot= 0; - while(ik) { - if(ik->flag & 1) { - for(a=0; atotipo; a++) { - if(ik->data[a]) { - val+= ik->data[a]->vec[1][0]; - break; - } - } - tot++; - } - ik= ik->next; - } - if(tot>1) { - val/= (float)tot; - - ik= G.sipo->ipokey.first; - while(ik) { - if(ik->flag & 1) { - for(a=0; atotipo; a++) { - if(ik->data[a]) { - ik->data[a]->vec[1][0]= val; - } - } - } - ik= ik->next; - } - editipo_changed(G.sipo, 0); - } - } - deselectall_editipo(); - BIF_undo_push("Join Ipo"); -} - -void ipo_snap_menu(void) -{ - short event; - - event= pupmenu("Snap %t|Horizontal %x1|To Next %x2|To Frame %x3|To Current Frame%x4"); - if(event < 1) return; - - ipo_snap(event); -} - -void ipo_snap(short event) -{ - EditIpo *ei; - BezTriple *bezt; - float dx = 0.0; - int a, b; - short ok, ok2; - - /* events: - * Horizontal : 1 - * To Next: 2 - * To Frame: 3 - * To Current Frame: 4 - */ - - get_status_editipo(); - - /* map ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0); - } - - ei= G.sipo->editipo; - for(b=0; btotipo; b++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - - ok2= 0; - if(G.sipo->showkey) ok2= 1; - else if(totipo_vert && (ei->flag & IPO_EDIT)) ok2= 2; - else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok2= 3; - - if(ok2) { - bezt= ei->icu->bezt; - a= ei->icu->totvert; - while(a--) { - ok= 0; - if(totipo_vert) { - if(bezt->f2 & SELECT) ok= 1; - } - else ok= 1; - - if(ok) { - if(event==1) { - bezt->vec[0][1]= bezt->vec[2][1]= bezt->vec[1][1]; - if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN; - if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN; - } - else if(event==2) { - if(a) { - bezt->vec[0][1]= bezt->vec[1][1]= bezt->vec[2][1]= (bezt+1)->vec[1][1]; - if(bezt->h1==HD_AUTO || bezt->h1==HD_VECT) bezt->h1= HD_ALIGN; - if(bezt->h2==HD_AUTO || bezt->h2==HD_VECT) bezt->h2= HD_ALIGN; - } - } - else if(event==3) { - bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5)); - } - else if(event==4) { /* to current frame */ - - if(ok2==1 || ok2==2) { - - if(G.sipo->blocktype==ID_SEQ) { - Sequence *seq; - - seq= (Sequence *)G.sipo->from; - if(seq && (seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) { - dx= (float)(CFRA-seq->startdisp); - dx= (float)(100.0*dx/((float)(seq->enddisp-seq->startdisp))); - - dx-= bezt->vec[1][0]; - } else { - dx= G.scene->r.framelen*CFRA - bezt->vec[1][0]; - } - } - else dx= G.scene->r.framelen*CFRA - bezt->vec[1][0]; - - bezt->vec[0][0]+= dx; - bezt->vec[1][0]+= dx; - bezt->vec[2][0]+= dx; - } - } - } - - bezt++; - } - calchandles_ipocurve(ei->icu); - } - } - } - - /* undo mapping of ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0); - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Snap Ipo"); -} - -void ipo_mirror_menu(void) -{ - int mode = 0; - mode= pupmenu("Mirror Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis%x3"); - - if (mode == -1) return; - - ipo_mirror(mode); -} - -void ipo_mirror(short mode) -{ - EditIpo *ei; - BezTriple *bezt; - - int a, b; - short ok, ok2, i; - float diff; - - /* what's this for? */ - get_status_editipo(); - - /* get edit ipo */ - ei= G.sipo->editipo; - if (!ei) return; - - /* map ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0); - } - - /* look throught ipo curves */ - for(b=0; btotipo; b++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, icu, icu->bezt)) { - - ok2= 0; - if(G.sipo->showkey) ok2= 1; - else if(totipo_vert && (ei->flag & IPO_EDIT)) ok2= 2; - else if(totipo_vert==0 && (ei->flag & IPO_SELECT)) ok2= 3; - - if(ok2) { - bezt= ei->icu->bezt; - a= ei->icu->totvert; - - /* loop through beztriples, mirroring them */ - while(a--) { - ok= 0; - if(totipo_vert) { - if(bezt->f2 & SELECT) ok= 1; - } - else ok= 1; - - if(ok) { - switch (mode) { - case 1: /* mirror over current frame */ - { - for (i=0; i<3; i++) { - diff= ((float)CFRA - bezt->vec[i][0]); - bezt->vec[i][0]= ((float)CFRA + diff); - } - } - break; - case 2: /* mirror over vertical axis (frame 0) */ - { - for (i=0; i<3; i++) { - diff= (0.0f - bezt->vec[i][0]); - bezt->vec[i][0]= (0.0f + diff); - } - } - break; - case 3: /* mirror over horizontal axis */ - { - for (i=0; i<3; i++) { - diff= (0.0f - bezt->vec[i][1]); - bezt->vec[i][1]= (0.0f + diff); - } - } - break; - } - } - - bezt++; - } - - /* sort out order and handles */ - sort_time_ipocurve(ei->icu); - calchandles_ipocurve(ei->icu); - } - } - } - - /* undo mapping of ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0); - } - - /* cleanup and undo push */ - editipo_changed(G.sipo, 1); - BIF_undo_push("Mirror Ipo"); -} - -/* - * When deleting an IPO curve from Python, check if the Ipo is being - * edited and if so clear the pointer to the old curve. - */ - -void del_ipoCurve ( IpoCurve * icu ) -{ - int i; - EditIpo *ei= G.sipo->editipo; - if (!ei) return; - - for(i=0; itotipo; i++, ei++) { - if ( ei->icu == icu ) { - ei->flag &= ~(IPO_SELECT | IPO_EDIT); - ei->icu= NULL; - return; - } - } -} - -void del_ipo(int need_check) -{ - EditIpo *ei; - BezTriple *bezt, *bezt1; - int a, b; - int del, event; - - get_status_editipo(); - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - - if(totipo_edit==0 && totipo_sel==0 && totipo_vertsel==0) { - if (need_check) { - if(okee("Erase selected keys")) - delete_key(OBACT); - } - else - delete_key(OBACT); - return; - } - - if (need_check) - if( okee("Erase selected")==0 ) return; - - // first round, can we delete entire parts? - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - - del= 0; - - if(G.sipo->showkey==0 && totipo_edit==0) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { - del= 1; - } - } - else { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - if(b) { - while(b) { - if( BEZSELECTED(bezt) ); - else break; - b--; - bezt++; - } - if(b==0) del= 1; - } - } - } - } - } - - if(del) { - if(ei->icu->driver==NULL) { - BLI_remlink( &(G.sipo->ipo->curve), ei->icu); - - free_ipo_curve(ei->icu); - - ei->flag &= ~IPO_SELECT; - ei->flag &= ~IPO_EDIT; - ei->icu= NULL; - } - else { - if(ei->icu->bezt) MEM_freeN(ei->icu->bezt); - ei->icu->bezt= NULL; - ei->icu->totvert= 0; - ei->flag &= ~IPO_EDIT; - } - } - } - - // 2nd round, small parts: just curves - ei= G.sipo->editipo; - for(b=0; btotipo; b++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - - event= 0; - if(ei->icu->bezt) { - - bezt= ei->icu->bezt; - for(a=0; aicu->totvert; a++) { - if( BEZSELECTED(bezt) ) { - memcpy(bezt, bezt+1, (ei->icu->totvert-a-1)*sizeof(BezTriple)); - ei->icu->totvert--; - a--; - event= 1; - } - else bezt++; - } - if(event) { - if(ei->icu->totvert) { - bezt1 = (BezTriple*) MEM_mallocN(ei->icu->totvert * sizeof(BezTriple), "delNurb"); - memcpy(bezt1, ei->icu->bezt, (ei->icu->totvert)*sizeof(BezTriple) ); - MEM_freeN(ei->icu->bezt); - ei->icu->bezt= bezt1; - } - else { - MEM_freeN(ei->icu->bezt); - ei->icu->bezt= NULL; - } - } - } - } - } - } - - get_status_editipo(); /* count again */ - check_active_editipo(); - - BIF_undo_push("Delete Ipo"); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); -} - -/* ******************** copy paste buffer ******************** */ -ListBase ipocopybuf={0, 0}; -int totipocopybuf=0; - -void free_ipocopybuf(void) -{ - IpoCurve *icu; - - while( (icu= ipocopybuf.first) ) { - BLI_remlink(&ipocopybuf, icu); - free_ipo_curve(icu); - } - totipocopybuf= 0; -} - -void copy_editipo(void) -{ - EditIpo *ei; - IpoCurve *icu; - int a; - - if(G.sipo->showkey) { - error("cannot copy\n"); - return; - } - - free_ipocopybuf(); - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if( (ei->flag & IPO_EDIT) || (ei->flag & IPO_SELECT) ) { - icu= MEM_callocN(sizeof(IpoCurve), "ipocopybuf"); - *icu= *(ei->icu); - BLI_addtail(&ipocopybuf, icu); - icu->bezt= MEM_dupallocN(icu->bezt); - icu->driver= MEM_dupallocN(icu->driver); - - totipocopybuf++; - } - } - } - - if(totipocopybuf==0) error("Copy buffer is empty"); -} - -void paste_editipo(void) -{ - EditIpo *ei; - IpoCurve *icu; - int a; - - if (G.sipo->showkey) return; - - if (totipocopybuf==0) return; - if (G.sipo->ipo==0) return; - if (G.sipo->ipo && G.sipo->ipo->id.lib) return; - - get_status_editipo(); - - if (totipo_vis==0) { - error("No visible channels"); - return; - } - else if (totipo_vis!=totipocopybuf && totipo_sel!=totipocopybuf) { - error("Incompatible paste"); - return; - } - - icu= ipocopybuf.first; - - for (a=0, ei=G.sipo->editipo; atotipo; a++, ei++) { - if (ei->flag & IPO_VISIBLE) { - /* don't attempt pasting if no valid buffer-curve to paste from anymore */ - if (icu == 0) return; - - /* if in editmode, paste keyframes */ - if (ei->flag & IPO_EDIT) { - BezTriple *bezt; - float offset= 0.0f; - short offsetInit= 0; - int i; - - /* make sure an ipo-curve exists (it may not, as this is an editipo) */ - ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode); - if (ei->icu == NULL) return; - - /* Copy selected beztriples from source icu onto this edit-icu, - * with all added keyframes being offsetted by the difference between - * the first source keyframe and the current frame. - */ - for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) { - /* skip if not selected */ - if (BEZSELECTED(bezt) == 0) continue; - - /* initialise offset (if not already done) */ - if (offsetInit==0) { - offset= CFRA - bezt->vec[1][0]; - offsetInit= 1; - } - /* temporarily apply offset to src beztriple while copying */ - bezt->vec[0][0] += offset; - bezt->vec[1][0] += offset; - bezt->vec[2][0] += offset; - - /* insert the keyframe */ - insert_bezt_icu(ei->icu, bezt); - - /* un-apply offset from src beztriple after copying */ - bezt->vec[0][0] -= offset; - bezt->vec[1][0] -= offset; - bezt->vec[2][0] -= offset; - } - - /* recalculate handles of curve that data was pasted into */ - calchandles_ipocurve(ei->icu); - - /* advance to next copy/paste buffer ipo-curve */ - icu= icu->next; - } - - /* otherwise paste entire curve data */ - else { - - /* make sure an ipo-curve exists (it may not, as this is an editipo) */ - ei->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei->adrcode); - if (ei->icu==NULL) return; - - /* clear exisiting dynamic memory (keyframes, driver) */ - if (ei->icu->bezt) MEM_freeN(ei->icu->bezt); - ei->icu->bezt= NULL; - if (ei->icu->driver) MEM_freeN(ei->icu->driver); - ei->icu->driver= NULL; - - ei->icu->totvert= icu->totvert; - ei->icu->flag= ei->flag= icu->flag; - ei->icu->extrap= icu->extrap; - ei->icu->ipo= icu->ipo; - - /* make a copy of the source icu's data */ - if (icu->bezt) - ei->icu->bezt= MEM_dupallocN(icu->bezt); - if (icu->driver) - ei->icu->driver= MEM_dupallocN(icu->driver); - - /* advance to next copy/paste buffer ipo-curve */ - icu= icu->next; - } - } - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Paste Ipo curves"); -} - -/* *********************** */ - - -static int find_other_handles(EditIpo *eicur, float ctime, BezTriple **beztar) -{ - EditIpo *ei; - BezTriple *bezt; - int a, b, c= 1, totvert; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if(ei!=eicur && ei->icu && (ei->flag & IPO_VISIBLE)) { - - bezt= ei->icu->bezt; - totvert= ei->icu->totvert; - - for(b=0; bvec[1][0] < ctime+IPOTHRESH && bezt->vec[1][0] > ctime-IPOTHRESH) { - if(c>2) return 0; - beztar[c]= bezt; - c++; - } - } - } - } - - if(c==3) return 1; - return 0; -} - -void set_speed_editipo(float speed) -{ - EditIpo *ei; - BezTriple *bezt, *beztar[3]; - float vec1[3], vec2[3]; - int a, b, totvert, didit=0, done_error = 0; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - - /* starting with 1 visible curve, selected point, associated points: do lencorr! */ - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - bezt= ei->icu->bezt; - totvert= ei->icu->totvert; - - for(b=0; bvec[1][0], beztar) ) { - beztar[0]->h1= beztar[0]->h2= HD_ALIGN; - beztar[1]->h1= beztar[1]->h2= HD_ALIGN; - beztar[2]->h1= beztar[2]->h2= HD_ALIGN; - - vec1[0]= (beztar[0]->vec[1][1] - beztar[0]->vec[0][1]) / (beztar[0]->vec[1][0] - beztar[0]->vec[0][0]) ; - vec2[0]= (beztar[0]->vec[1][1] - beztar[0]->vec[2][1]) / (beztar[0]->vec[2][0] - beztar[0]->vec[1][0]) ; - - vec1[1]= (beztar[1]->vec[1][1] - beztar[1]->vec[0][1]) / (beztar[1]->vec[1][0] - beztar[1]->vec[0][0]) ; - vec2[1]= (beztar[1]->vec[1][1] - beztar[1]->vec[2][1]) / (beztar[1]->vec[2][0] - beztar[1]->vec[1][0]) ; - - vec1[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[0][1]) / (beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ; - vec2[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[2][1]) / (beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ; - - Normalize(vec1); - Normalize(vec2); - - VecMulf(vec1, speed); - VecMulf(vec2, speed); - - beztar[0]->vec[0][1]= beztar[0]->vec[1][1] - vec1[0]*(beztar[0]->vec[1][0] - beztar[0]->vec[0][0]) ; - beztar[0]->vec[2][1]= beztar[0]->vec[1][1] - vec2[0]*(beztar[0]->vec[2][0] - beztar[0]->vec[1][0]) ; - - beztar[1]->vec[0][1]= beztar[1]->vec[1][1] - vec1[1]*(beztar[1]->vec[1][0] - beztar[1]->vec[0][0]) ; - beztar[1]->vec[2][1]= beztar[1]->vec[1][1] - vec2[1]*(beztar[1]->vec[2][0] - beztar[1]->vec[1][0]) ; - - beztar[2]->vec[0][1]= beztar[2]->vec[1][1] - vec1[2]*(beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ; - beztar[2]->vec[2][1]= beztar[2]->vec[1][1] - vec2[2]*(beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ; - - didit= 1; - } - else { - if (done_error==0) { - error("Only works for 3 visible curves with handles"); - } - done_error = 1; - } - } - } - break; - } - } - - if(didit==0) error("Did not set speed"); - - editipo_changed(G.sipo, 1); - BIF_undo_push("Set speed IPO"); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - -} - - -/* **************************************************** */ - -/* IPOKEY: - * - * there are three ways to use this system: - * 1. below: for drawing and editing in Ipo window - * 2. for drawing key positions in View3D (see ipo.c and drawobject.c) - * 3. editing keys in View3D (below and in editobject.c) - * - */ - - -void free_ipokey(ListBase *lb) -{ - IpoKey *ik; - - ik= lb->first; - while(ik) { - if(ik->data) MEM_freeN(ik->data); - ik= ik->next; - } - BLI_freelistN(lb); -} - - -void add_to_ipokey(ListBase *lb, BezTriple *bezt, int nr, int len) -{ - IpoKey *ik, *ikn; - - ik= lb->first; - while(ik) { - - if( ik->val==bezt->vec[1][0] ) { - if(ik->data[nr]==0) { /* double points! */ - ik->data[nr]= bezt; - if(bezt->f2 & SELECT) ik->flag= 1; - return; - } - } - else if(ik->val > bezt->vec[1][0]) break; - - ik= ik->next; - } - - ikn= MEM_callocN(sizeof(IpoKey), "add_to_ipokey"); - if(ik) BLI_insertlinkbefore(lb, ik, ikn); - else BLI_addtail(lb, ikn); - - ikn->data= MEM_callocN(sizeof(float *)*len, "add_to_ipokey"); - ikn->data[nr]= bezt; - ikn->val= bezt->vec[1][0]; - - if(bezt->f2 & SELECT) ikn->flag= 1; -} - -void make_ipokey(void) -{ - EditIpo *ei; - IpoKey *ik; - ListBase *lb; - BezTriple *bezt; - int a, b, sel, desel, totvert; - - lb= &G.sipo->ipokey; - free_ipokey(lb); - - ei= G.sipo->editipo; - if(ei==0) return; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - bezt= ei->icu->bezt; - totvert= ei->icu->totvert; - - for(b=0; btotipo); - } - - ei->flag &= ~IPO_SELECT; - ei->flag &= ~IPO_EDIT; - ei->icu->flag= ei->flag; - } - } - - /* test selectflags & scaling */ - ik= lb->first; - while(ik) { - sel= desel= 0; - for(a=0; atotipo; a++) { - if(ik->data[a]) { - bezt= ik->data[a]; - if(bezt->f2 & SELECT) sel++; - else desel++; - } - } - if(sel && desel) sel= 0; - for(a=0; atotipo; a++) { - if(ik->data[a]) { - bezt= ik->data[a]; - if(sel) { - bezt->f1 |= SELECT; - bezt->f2 |= SELECT; - bezt->f3 |= SELECT; - } - else { - bezt->f1 &= ~SELECT; - bezt->f2 &= ~SELECT; - bezt->f3 &= ~SELECT; - } - } - } - if(sel) ik->flag = 1; - else ik->flag= 0; - - /* map ipo-keys for drawing/editing if scaled ipo */ - if (NLA_IPO_SCALED) { - ik->val= get_action_frame_inv(OBACT, ik->val); - } - - ik= ik->next; - } - - get_status_editipo(); -} - -void make_ipokey_transform(Object *ob, ListBase *lb, int sel) -{ - IpoCurve *icu; - BezTriple *bezt; - IpoKey *ik; - int a, adrcode = 0, ok, dloc=0, drot=0, dsize=0; - - if(ob->ipo==NULL) return; - if(ob->ipo->showkey==0) return; - - /* test: are there delta curves? */ - icu= ob->ipo->curve.first; - while(icu) { - if(icu->flag & IPO_VISIBLE) { - switch(icu->adrcode) { - case OB_DLOC_X: - case OB_DLOC_Y: - case OB_DLOC_Z: - dloc= 1; - break; - case OB_DROT_X: - case OB_DROT_Y: - case OB_DROT_Z: - drot= 1; - break; - case OB_DSIZE_X: - case OB_DSIZE_Y: - case OB_DSIZE_Z: - dsize= 1; - break; - } - } - icu= icu->next; - } - - icu= ob->ipo->curve.first; - while(icu) { - if(icu->flag & IPO_VISIBLE) { - ok= 0; - - switch(icu->adrcode) { - case OB_DLOC_X: - case OB_DLOC_Y: - case OB_DLOC_Z: - case OB_DROT_X: - case OB_DROT_Y: - case OB_DROT_Z: - case OB_DSIZE_X: - case OB_DSIZE_Y: - case OB_DSIZE_Z: - ok= 1; - break; - - case OB_LOC_X: - case OB_LOC_Y: - case OB_LOC_Z: - if(dloc==0) ok= 1; - break; - case OB_ROT_X: - case OB_ROT_Y: - case OB_ROT_Z: - if(drot==0) ok= 1; - break; - case OB_SIZE_X: - case OB_SIZE_Y: - case OB_SIZE_Z: - if(dsize==0) ok= 1; - break; - } - if(ok) { - for(a=0; aadrcode==ob_ar[a]) { - adrcode= a; - break; - } - } - - bezt= icu->bezt; - a= icu->totvert; - while(a--) { - if(sel==0 || (bezt->f2 & SELECT)) { - add_to_ipokey(lb, bezt, adrcode, OB_TOTIPO); - } - bezt++; - } - } - } - icu= icu->next; - } - - - ik= lb->first; - while(ik) { - /* map ipo-keys for drawing/editing if scaled ipo */ - if (NLA_IPO_SCALED) { - ik->val= get_action_frame_inv(OBACT, ik->val); - } - - ik= ik->next; - } -} - -void update_ipokey_val(void) /* after moving vertices */ -{ - IpoKey *ik; - int a; - - ik= G.sipo->ipokey.first; - while(ik) { - for(a=0; atotipo; a++) { - if(ik->data[a]) { - ik->val= ik->data[a]->vec[1][0]; - - /* map ipo-keys for drawing/editing if scaled ipo */ - if (NLA_IPO_SCALED) { - ik->val= get_action_frame_inv(OBACT, ik->val); - } - break; - } - } - ik= ik->next; - } -} - -void set_tob_old(float *old, float *poin) -{ - old[0]= *(poin); - old[3]= *(poin-3); - old[6]= *(poin+3); -} - -void set_ipo_pointers_transob(IpoKey *ik, TransOb *tob) -{ - BezTriple *bezt; - int a, delta= 0; - - tob->locx= tob->locy= tob->locz= 0; - tob->rotx= tob->roty= tob->rotz= 0; - tob->sizex= tob->sizey= tob->sizez= 0; - - for(a=0; adata[a]) { - bezt= ik->data[a]; - - switch( ob_ar[a] ) { - case OB_LOC_X: - case OB_DLOC_X: - tob->locx= &(bezt->vec[1][1]); break; - case OB_LOC_Y: - case OB_DLOC_Y: - tob->locy= &(bezt->vec[1][1]); break; - case OB_LOC_Z: - case OB_DLOC_Z: - tob->locz= &(bezt->vec[1][1]); break; - - case OB_DROT_X: - delta= 1; - case OB_ROT_X: - tob->rotx= &(bezt->vec[1][1]); break; - case OB_DROT_Y: - delta= 1; - case OB_ROT_Y: - tob->roty= &(bezt->vec[1][1]); break; - case OB_DROT_Z: - delta= 1; - case OB_ROT_Z: - tob->rotz= &(bezt->vec[1][1]); break; - - case OB_SIZE_X: - case OB_DSIZE_X: - tob->sizex= &(bezt->vec[1][1]); break; - case OB_SIZE_Y: - case OB_DSIZE_Y: - tob->sizey= &(bezt->vec[1][1]); break; - case OB_SIZE_Z: - case OB_DSIZE_Z: - tob->sizez= &(bezt->vec[1][1]); break; - } - } - } - - /* oldvals for e.g. undo */ - if(tob->locx) set_tob_old(tob->oldloc, tob->locx); - if(tob->locy) set_tob_old(tob->oldloc+1, tob->locy); - if(tob->locz) set_tob_old(tob->oldloc+2, tob->locz); - - /* store first oldrot, for mapping curves ('1'=10 degrees) and correct calculation */ - if(tob->rotx) set_tob_old(tob->oldrot+3, tob->rotx); - if(tob->roty) set_tob_old(tob->oldrot+4, tob->roty); - if(tob->rotz) set_tob_old(tob->oldrot+5, tob->rotz); - - /* store the first oldsize, this is not allowed to be dsize! */ - if(tob->sizex) set_tob_old(tob->oldsize+3, tob->sizex); - if(tob->sizey) set_tob_old(tob->oldsize+4, tob->sizey); - if(tob->sizez) set_tob_old(tob->oldsize+5, tob->sizez); - - tob->flag= TOB_IPO; - if(delta) tob->flag |= TOB_IPODROT; -} - - - -static int float_to_frame (float frame) -{ - int to= (int) floor(0.5 + frame/G.scene->r.framelen ); - - return to; -} - -void movekey_ipo(int dir) /* only call external from view3d queue */ -{ - IpoKey *ik; - float toframe = 0.0; - int a; - - if(G.sipo->showkey==0) return; - - ik= G.sipo->ipokey.first; - if (dir==-1) { - while (ik && float_to_frame(ik->val)val; - ik= ik->next; - } - } else { - while (ik && float_to_frame(ik->val)<=CFRA) { - ik= ik->next; - } - if (ik) toframe= ik->val; - } - - a= float_to_frame(toframe); - - if (a!=CFRA && a>0) { - CFRA= a; - - update_for_newframe(); - } - - BIF_undo_push("Move Key"); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - -} - -void movekey_obipo(int dir) /* only call external from view3d queue */ -{ - Base *base; - Object *ob; - ListBase elems; - IpoKey *ik; - int a; - float toframe= CFRA; - - if (!G.vd) - return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - ob= base->object; - if(ob->ipo && ob->ipo->showkey) { - elems.first= elems.last= 0; - make_ipokey_transform(ob, &elems, 0); - - if(elems.first) { - ik= elems.first; - if (dir==-1) { - while (ik && float_to_frame(ik->val)val; - ik= ik->next; - } - } else { - while (ik && float_to_frame(ik->val)<=CFRA) { - ik= ik->next; - } - if (ik) toframe= ik->val; - } - - free_ipokey(&elems); - } - } - } - - base= base->next; - } - - a= float_to_frame(toframe); - - if (a!=CFRA && a>0) { - CFRA= a; - - update_for_newframe(); - } - - BIF_undo_push("Move Key"); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - -} -/* **************************************************** */ -/* IPO TRANSFORM TOOLS - * - * Only the helper functions are stored here these days. They are here as - * there are heaps of ugly globals which the IPO editor relies on. - * However, the actual transforms go through the transform system these days. - */ - -/* Helper function for make_ipo_transdata, which is reponsible for associating - * source data with transform data - */ -static void bezt_to_transdata (TransData *td, TransData2D *td2d, float *loc, float *cent, short selected, short onlytime) -{ - /* New location from td gets dumped onto the old-location of td2d, which then - * gets copied to the actual data at td2d->loc2d (bezt->vec[n]) - * - * Due to NLA scaling, we apply NLA scaling to some of the verts here, - * and then that scaling will be undone after transform is done. - */ - - if (NLA_IPO_SCALED) { - td2d->loc[0] = get_action_frame_inv(OBACT, loc[0]); - td2d->loc[1] = loc[1]; - td2d->loc[2] = 0.0f; - td2d->loc2d = loc; - - td->flag = 0; - td->loc = td2d->loc; - VECCOPY(td->center, cent); - VECCOPY(td->iloc, td->loc); - } - else { - td2d->loc[0] = loc[0]; - td2d->loc[1] = loc[1]; - td2d->loc[2] = 0.0f; - td2d->loc2d = loc; - - td->flag = 0; - td->loc = td2d->loc; - VECCOPY(td->center, cent); - VECCOPY(td->iloc, td->loc); - } - - memset(td->axismtx, 0, sizeof(td->axismtx)); - td->axismtx[2][2] = 1.0f; - - td->ext= NULL; td->tdi= NULL; td->val= NULL; - - if (selected) { - td->flag |= TD_SELECTED; - td->dist= 0.0; - } - else - td->dist= MAXFLOAT; - - if (onlytime) - td->flag |= TD_TIMEONLY; - - Mat3One(td->mtx); - Mat3One(td->smtx); -} - -/* This function is called by createTransIpoData and remake_ipo_transdata to - * create the TransData and TransData2D arrays for transform. The costly counting - * stage is only performed for createTransIpoData case, and is indicated by t->total==-1; - */ -void make_ipo_transdata (TransInfo *t) -{ - TransData *td = NULL; - TransData2D *td2d = NULL; - - EditIpo *ei; - BezTriple *bezt; - int a, b; - - /* countsel and propmode are used for proportional edit, which is not yet available */ - int count=0/*, countsel=0*/; - /*int propmode = t->flag & T_PROP_EDIT;*/ - - /* count data and allocate memory (if needed) */ - if (t->total == 0) { - /* count data first */ - if (totipo_vertsel) { - /* we're probably in editmode, so only selected verts */ - count= totipo_vertsel; - } - else if (totipo_edit==0 && totipo_sel!=0) { - /* we're not in editmode, so entire curves get moved */ - ei= G.sipo->editipo; - for (a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { - if (ei->icu->bezt && ei->icu->ipo==IPO_BEZ) - count+= 3*ei->icu->totvert; - else - count+= ei->icu->totvert; - } - } - if (count==0) return; - } - else { - /* this case should not happen */ - return; - } - - /* memory allocation */ - /*t->total= (propmode)? count: countsel;*/ - t->total= count; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (IPO Editor)"); - /* for each 2d vert a 3d vector is allocated, so that they can be treated just as if they were 3d verts */ - t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransData2D (IPO Editor)"); - } - - td= t->data; - td2d= t->data2d; - - /* add verts */ - if (totipo_vertsel) { - /* we're probably in editmode, so only selected verts */ - ei= G.sipo->editipo; - for (a=0; atotipo; a++, ei++) { - /* only consider those curves that are visible and are being edited/used for showkeys */ - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if ( (ei->flag & IPO_EDIT) || G.sipo->showkey) { - if (ei->icu->bezt) { - short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0; - bezt= ei->icu->bezt; - - for (b=0; b < ei->icu->totvert; b++, bezt++) { - /* only include handles if selected, and interpolaton mode uses beztriples */ - if (ei->icu->ipo==IPO_BEZ) { - if (bezt->f1 & SELECT) - bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime); - if (bezt->f3 & SELECT) - bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime); - } - - /* only include main vert if selected */ - if (bezt->f2 & SELECT) { - bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime); - } - } - } - } - } - } - } - else if (totipo_edit==0 && totipo_sel!=0) { - /* we're not in editmode, so entire curves get moved */ - ei= G.sipo->editipo; - for (a=0; atotipo; a++, ei++) { - /* only include curves that are visible and selected */ - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { - if (ei->icu->bezt) { - short onlytime= (ei->disptype==IPO_DISPBITS) ? 1 : (G.sipo->showkey) ? 1 : 0; - bezt= ei->icu->bezt; - b= ei->icu->totvert; - - for (b=0; b < ei->icu->totvert; b++, bezt++) { - /* only include handles if interpolation mode is bezier not bpoint */ - if (ei->icu->ipo==IPO_BEZ) { - bezt_to_transdata(td++, td2d++, bezt->vec[0], bezt->vec[1], 1, onlytime); - bezt_to_transdata(td++, td2d++, bezt->vec[2], bezt->vec[1], 1, onlytime); - } - - /* always include the main handle */ - bezt_to_transdata(td++, td2d++, bezt->vec[1], bezt->vec[1], 1, onlytime); - } - } - } - } - } -} - -/* ------------------------ */ - -/* struct for use in re-sorting BezTriples during IPO transform */ -typedef struct BeztMap { - BezTriple *bezt; - int oldIndex; /* index of bezt in icu->bezt array before sorting */ - int newIndex; /* index of bezt in icu->bezt array after sorting */ - short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */ -} BeztMap; - - -/* This function converts an IpoCurve's BezTriple array to a BeztMap array - * NOTE: this allocates memory that will need to get freed later - */ -static BeztMap *bezt_to_beztmaps (BezTriple *bezts, int totvert) -{ - BezTriple *bezt= bezts; - BeztMap *bezm, *bezms; - int i; - - /* allocate memory for this array */ - if (totvert==0 || bezts==NULL) - return NULL; - bezm= bezms= MEM_callocN(sizeof(BeztMap)*totvert, "BeztMaps"); - - /* assign beztriples to beztmaps */ - for (i=0; i < totvert; i++, bezm++, bezt++) { - bezm->bezt= bezt; - bezm->oldIndex= i; - bezm->newIndex= i; - } - - return bezms; -} - -/* This function copies the code of sort_time_ipocurve, but acts on BeztMap structs instead */ -static void sort_time_beztmaps (BeztMap *bezms, int totvert) -{ - BeztMap *bezm; - int i, ok= 1; - - /* keep repeating the process until nothing is out of place anymore */ - while (ok) { - ok= 0; - - bezm= bezms; - i= totvert; - while (i--) { - /* is current bezm out of order (i.e. occurs later than next)? */ - if (i > 0) { - if (bezm->bezt->vec[1][0] > (bezm+1)->bezt->vec[1][0]) { - bezm->newIndex++; - (bezm+1)->newIndex--; - - SWAP(BeztMap, *bezm, *(bezm+1)); - - ok= 1; - } - } - - /* do we need to check if the handles need to be swapped? - * optimisation: this only needs to be performed in the first loop - */ - if (bezm->swapHs == 0) { - if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && - (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) ) - { - /* handles need to be swapped */ - bezm->swapHs = 1; - } - else { - /* handles need to be cleared */ - bezm->swapHs = -1; - } - } - - bezm++; - } - } -} - -/* This function firstly adjusts the pointers that the transdata has to each BezTriple*/ -static void beztmap_to_data (TransInfo *t, EditIpo *ei, BeztMap *bezms, int totvert) -{ - BezTriple *bezts = ei->icu->bezt; - BeztMap *bezm; - TransData2D *td; - int i, j; - char *adjusted; - - /* dynamically allocate an array of chars to mark whether an TransData's - * pointers have been fixed already, so that we don't override ones that are - * already done - */ - adjusted= MEM_callocN(t->total, "beztmap_adjusted_map"); - - /* for each beztmap item, find if it is used anywhere */ - bezm= bezms; - for (i= 0; i < totvert; i++, bezm++) { - /* loop through transdata, testing if we have a hit - * for the handles (vec[0]/vec[2]), we must also check if they need to be swapped... - */ - td= t->data2d; - for (j= 0; j < t->total; j++, td++) { - /* skip item if already marked */ - if (adjusted[j] != 0) continue; - - if (totipo_vertsel) { - /* only selected verts */ - if (ei->icu->ipo==IPO_BEZ) { - if (bezm->bezt->f1 & SELECT) { - if (td->loc2d == bezm->bezt->vec[0]) { - if (bezm->swapHs == 1) - td->loc2d= (bezts + bezm->newIndex)->vec[2]; - else - td->loc2d= (bezts + bezm->newIndex)->vec[0]; - adjusted[j] = 1; - } - } - if (bezm->bezt->f3 & SELECT) { - if (td->loc2d == bezm->bezt->vec[2]) { - if (bezm->swapHs == 1) - td->loc2d= (bezts + bezm->newIndex)->vec[0]; - else - td->loc2d= (bezts + bezm->newIndex)->vec[2]; - adjusted[j] = 1; - } - } - } - if (bezm->bezt->f2 & SELECT) { - if (td->loc2d == bezm->bezt->vec[1]) { - td->loc2d= (bezts + bezm->newIndex)->vec[1]; - adjusted[j] = 1; - } - } - } - else { - /* whole curve */ - if (ei->icu->ipo==IPO_BEZ) { - if (td->loc2d == bezm->bezt->vec[0]) { - if (bezm->swapHs == 1) - td->loc2d= (bezts + bezm->newIndex)->vec[2]; - else - td->loc2d= (bezts + bezm->newIndex)->vec[0]; - adjusted[j] = 1; - } - - if (td->loc2d == bezm->bezt->vec[2]) { - if (bezm->swapHs == 1) - td->loc2d= (bezts + bezm->newIndex)->vec[0]; - else - td->loc2d= (bezts + bezm->newIndex)->vec[2]; - adjusted[j] = 1; - } - } - if (td->loc2d == bezm->bezt->vec[1]) { - td->loc2d= (bezts + bezm->newIndex)->vec[1]; - adjusted[j] = 1; - } - } - } - - } - - /* free temp memory used for 'adjusted' array */ - MEM_freeN(adjusted); -} - -/* This function is called by recalcData during the Transform loop to recalculate - * the handles of curves and sort the keyframes so that the curves draw correctly. - * It is only called if some keyframes have moved out of order. - */ -void remake_ipo_transdata (TransInfo *t) -{ - EditIpo *ei; - int a; - - /* sort and reassign verts */ - ei= G.sipo->editipo; - for (a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if (ei->icu->bezt) { - BeztMap *bezm; - - /* adjust transform-data pointers */ - bezm= bezt_to_beztmaps(ei->icu->bezt, ei->icu->totvert); - sort_time_beztmaps(bezm, ei->icu->totvert); - beztmap_to_data(t, ei, bezm, ei->icu->totvert); - - /* re-sort actual beztriples (perhaps this could be done using the beztmaps to save time?) */ - sort_time_ipocurve(ei->icu); - - /* free mapping stuff */ - MEM_freeN(bezm); - - /* make sure handles are all set correctly */ - testhandles_ipocurve(ei->icu); - } - } - } - - /* remake ipokeys */ - if (G.sipo->showkey) make_ipokey(); -} - -/* This function acts as the entrypoint for transforms in the IPO editor (as for - * the Action and NLA editors). The actual transform loop is not here anymore. - */ -void transform_ipo (int mode) -{ - short tmode; - - /* data-validation */ - if (G.sipo->ipo && G.sipo->ipo->id.lib) return; - if (G.sipo->editipo==0) return; - - /* convert ascii-based mode to transform system constants (mode) */ - switch (mode) { - case 'g': - tmode= TFM_TRANSLATION; - break; - case 'r': - tmode= TFM_ROTATION; - break; - case 's': - tmode= TFM_RESIZE; - break; - default: - tmode= 0; - return; - } - - /* the transform system method involved depends on the selection */ - get_status_editipo(); - if (totipo_vertsel) { - /* we're probably in editmode, so only selected verts - transform system */ - initTransform(tmode, CTX_NONE); - Transform(); - } - else if (totipo_edit==0 && totipo_sel!=0) { - /* we're not in editmode, so entire curves get moved - transform system*/ - initTransform(tmode, CTX_NONE); - Transform(); - } - else { - /* shapekey mode? special transform code */ - if (totipo_edit==0) - move_keys(OBACT); - return; - } - - /* cleanup */ - editipo_changed(G.sipo, 1); -} - -/**************************************************/ - -void filter_sampledata(float *data, int sfra, int efra) -{ - float *da; - int a; - - da= data+1; - for(a=sfra+1; aipo= IPO_LIN; - - if(icu->bezt) MEM_freeN(icu->bezt); - icu->bezt= NULL; - - tot= 1; /* first point */ - da= data+1; - for(a=sfra+1; atotvert= tot; - bezt= icu->bezt= MEM_callocN(tot*sizeof(BezTriple), "samplebezt"); - bezt->vec[1][0]= (float)sfra; - bezt->vec[1][1]= data[0]; - bezt++; - da= data+1; - for(a=sfra+1; avec[1][0]= (float)a; - bezt->vec[1][1]= da[0]; - bezt++; - } - } -} - -void ipo_record(void) -{ - /* only 1 or 2 active curves - * make a copy (ESC) - * - * reference point is the current situation (or 0) - * dx (dy) is the height correction factor - * CTRL: start record - */ - extern double tottime; - EditIpo *ei, *ei1=0, *ei2=0; - ScrArea *sa, *oldarea; -// Ipo *ipo; - Object *ob; - void *poin; - double swaptime; - float or1, or2 = 0.0, fac, *data1, *data2; - int type, a, afbreek=0, firsttime=1, cfrao, cfra, sfra, efra; - unsigned short event = 0; - short anim, val, xn, yn, mvalo[2], mval[2]; - char str[128]; - - if(G.sipo->from==NULL) return; - if(SFRA>=EFRA) return; - - anim= pupmenu("Record Mouse %t|Still %x1|Play Animation %x2"); - if(anim < 1) return; - if(anim!=2) anim= 0; - - ob= OBACT; - /* find the curves... */ - - ei= G.sipo->editipo; - for(a=0; atotipo; a++) { - if(ei->flag & IPO_VISIBLE) { - - if(ei1==0) ei1= ei; - else if(ei2==0) ei2= ei; - else { - error("Maximum 2 visible curves"); - return; - } - } - ei++; - } - - if(ei1==0) { - error("Select 1 or 2 channels"); - return; - } - - /* make curves ready, start values */ - if(ei1->icu==NULL) - ei1->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei1->adrcode); - if(ei1->icu==NULL) return; - - poin= get_ipo_poin(G.sipo->from, ei1->icu, &type); - if(poin) ei1->icu->curval= read_ipo_poin(poin, type); - or1= ei1->icu->curval; - ei1->icu->flag |= IPO_LOCK; - - if(ei2) { - if(ei2->icu==NULL) - ei2->icu= verify_ipocurve(G.sipo->from, G.sipo->blocktype, G.sipo->actname, G.sipo->constname, G.sipo->bonename, ei2->adrcode); - if(ei2->icu==NULL) return; - - poin= get_ipo_poin(G.sipo->from, ei2->icu, &type); - if(poin) ei2->icu->curval= read_ipo_poin(poin, type); - or2= ei2->icu->curval; - ei2->icu->flag |= IPO_LOCK; - } - fac= G.v2d->cur.ymax - G.v2d->cur.ymin; - fac/= (float)curarea->winy; - - /* which area */ - oldarea= curarea; - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->win) { - if(G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_LA) { - if(sa->spacetype==SPACE_BUTS) break; - } - else { - if(sa->spacetype==SPACE_VIEW3D) break; - } - } - sa= sa->next; - } - if(sa) areawinset(sa->win); - - /* can we? */ - while(get_mbut()&L_MOUSE) BIF_wait_for_statechange(); - data1= MEM_callocN(sizeof(float)*(EFRA-SFRA+1), "data1"); - data2= MEM_callocN(sizeof(float)*(EFRA-SFRA+1), "data2"); - - getmouseco_areawin(mvalo); - xn= mvalo[0]; yn= mvalo[1]; - waitcursor(1); - - tottime= 0.0; - swaptime= 1.0/FPS; - - cfrao= CFRA; - cfra=efra= SFRA; - sfra= EFRA; - - while(afbreek==0) { - - getmouseco_areawin(mval); - - if(mval[0]!= mvalo[0] || mval[1]!=mvalo[1] || firsttime || (G.qual & LR_CTRLKEY)) { - if(anim) CFRA= cfra; - else firsttime= 0; - - set_timecursor(cfra); - - /* do ipo: first all, then the specific ones */ - if(anim==2) { - do_ob_ipo(ob); - do_ob_key(ob); - } - - ei1->icu->curval= or1 + fac*(mval[0]-xn); - if(ei2) ei2->icu->curval= or2 + fac*(mval[1]-yn); - - do_ipo_nocalc(G.sipo->ipo); - - if(G.qual & LR_CTRLKEY) { - sprintf(str, "Recording... %d\n", cfra); - data1[ cfra-SFRA ]= ei1->icu->curval; - if(ei2) data2[ cfra-SFRA ]= ei2->icu->curval; - - sfra= MIN2(sfra, cfra); - efra= MAX2(efra, cfra); - } - else sprintf(str, "Mouse Recording. Use Ctrl to start. LeftMouse or Space to end"); - - do_ob_key(ob); - ob->recalc |= OB_RECALC; - - headerprint(str); - - if(sa) scrarea_do_windraw(sa); - - /* minimal wait swaptime */ - tottime -= swaptime; - while (update_time()) PIL_sleep_ms(1); - - screen_swapbuffers(); - - tottime= 0.0; - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - if(anim || (G.qual & LR_CTRLKEY)) { - cfra++; - if(cfra>EFRA) cfra= SFRA; - } - } - - while(qtest()) { - event= extern_qread(&val); - if(val) { - switch(event) { - case LEFTMOUSE: case ESCKEY: case SPACEKEY: case RETKEY: - afbreek= 1; - break; - } - } - if(afbreek) break; - } - } - - if(event!=ESCKEY) { - sampledata_to_ipocurve(data1+sfra-SFRA, sfra, efra, ei1->icu); - if(ei2) sampledata_to_ipocurve(data2+sfra-SFRA, sfra, efra, ei2->icu); - - /* not nice when this is on */ - if(G.sipo->showkey) { - G.sipo->showkey= 0; - free_ipokey(&G.sipo->ipokey); - } - } - else { - /* undo: start values */ - poin= get_ipo_poin(G.sipo->from, ei1->icu, &type); - if(poin) write_ipo_poin(poin, type, or1); - if(ei1->icu->bezt==NULL) { - BLI_remlink( &(G.sipo->ipo->curve), ei1->icu); - MEM_freeN(ei1->icu); - ei1->icu= NULL; - } - if(ei2) { - poin= get_ipo_poin(G.sipo->from, ei2->icu, &type); - if(poin) write_ipo_poin(poin, type, or2); - if(ei2->icu->bezt==NULL) { - BLI_remlink( &(G.sipo->ipo->curve), ei2->icu); - MEM_freeN(ei2->icu); - ei2->icu= NULL; - } - } - } - - if(ei1->icu) ei1->icu->flag &= ~IPO_LOCK; - if(ei2 && ei2->icu) ei2->icu->flag &= ~IPO_LOCK; - - editipo_changed(G.sipo, 0); - do_ipo(G.sipo->ipo); - waitcursor(0); - - allqueue(REDRAWVIEW3D, 0); - if(sa) scrarea_queue_headredraw(sa); /* headerprint */ - scrarea_queue_redraw(oldarea); - CFRA= cfrao; - - /* for the time being? */ - update_for_newframe(); - BIF_undo_push("Ipo Record"); - - MEM_freeN(data1); - MEM_freeN(data2); -} - -/* while transform, update for curves */ -void remake_object_ipos(Object *ob) -{ - IpoCurve *icu; - - if (!ob) - return; - if (!ob->ipo) - return; - - for (icu = ob->ipo->curve.first; icu; icu=icu->next){ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } -} - -/* Only delete the nominated keyframe from provided ipo-curve. - * Not recommended to be used many times successively. For that - * there is delete_ipo_keys(). */ -void delete_icu_key(IpoCurve *icu, int index) -{ - /* firstly check that index is valid */ - if (index < 0) - index *= -1; - if (index >= icu->totvert) - return; - if (!icu) return; - - /* Delete this key */ - memcpy (&icu->bezt[index], &icu->bezt[index+1], sizeof (BezTriple)*(icu->totvert-index-1)); - icu->totvert--; - - /* recalc handles */ - calchandles_ipocurve(icu); -} - -void delete_ipo_keys(Ipo *ipo) -{ - IpoCurve *icu, *next; - int i; - - if (!ipo) - return; - - for (icu=ipo->curve.first; icu; icu=next){ - next = icu->next; - for (i=0; itotvert; i++){ - if (icu->bezt[i].f2 & 1){ - // Delete the item - memcpy (&icu->bezt[i], &icu->bezt[i+1], sizeof (BezTriple)*(icu->totvert-i-1)); - icu->totvert--; - i--; - } - } - if (!icu->totvert){ - /* Delete the curve */ - BLI_remlink( &(ipo->curve), icu); - free_ipo_curve(icu); - } - } -} - - -int add_trans_ipo_keys(Ipo *ipo, TransVert *tv, int tvtot) -{ - int i; - IpoCurve *icu; - - if (!ipo) - return tvtot; - - for (icu=ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].f2 & 1){ - tv[tvtot+0].loc=icu->bezt[i].vec[0]; - tv[tvtot+1].loc=icu->bezt[i].vec[1]; - tv[tvtot+2].loc=icu->bezt[i].vec[2]; - - memcpy (&tv[tvtot+0].oldloc, icu->bezt[i].vec[0], sizeof (float)*3); - memcpy (&tv[tvtot+1].oldloc, icu->bezt[i].vec[1], sizeof (float)*3); - memcpy (&tv[tvtot+2].oldloc, icu->bezt[i].vec[2], sizeof (float)*3); - tvtot+=3; - } - } - } - - return tvtot; -} - -void duplicate_ipo_keys(Ipo *ipo) -{ - IpoCurve *icu; - int i; - BezTriple *newbezt; - - if (!ipo) - return; - - for (icu=ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - /* If a key is selected */ - if (icu->bezt[i].f2 & 1){ - /* Expand the list */ - newbezt = MEM_callocN(sizeof(BezTriple) * (icu->totvert+1), "beztriple"); - memcpy (newbezt, icu->bezt, sizeof(BezTriple) * (i+1)); - memcpy (newbezt+i+1, icu->bezt+i, sizeof(BezTriple)); - memcpy (newbezt+i+2, icu->bezt+i+1, sizeof (BezTriple) *(icu->totvert-(i+1))); - icu->totvert++; - MEM_freeN (icu->bezt); - icu->bezt=newbezt; - /* Unselect the current key*/ - icu->bezt[i].f1 &= ~ 1; - icu->bezt[i].f2 &= ~ 1; - icu->bezt[i].f3 &= ~ 1; - i++; - /* Select the copied key */ - icu->bezt[i].f1 |= 1; - icu->bezt[i].f2 |= 1; - icu->bezt[i].f3 |= 1; - - } - } - } -} - -void move_to_frame(void) -{ - EditIpo *ei; - BezTriple *bezt; - ID *id; - float cfra; - int a, b; - - if(G.sipo->editipo==0) return; - - ei= G.sipo->editipo; - - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if(G.sipo->showkey || (ei->flag & IPO_EDIT)) { - - if(ei->icu->bezt) { - - b= ei->icu->totvert; - bezt= ei->icu->bezt; - while(b--) { - if(BEZSELECTED(bezt)) { - - cfra= bezt->vec[1][0]/G.scene->r.framelen; - - id= G.sipo->from; - if(id && GS(id->name)==ID_OB ) { - Object *ob= (Object *)id; - if(ob->sf!=0.0 && (ob->ipoflag & OB_OFFS_OB) ) { - cfra+= ob->sf/G.scene->r.framelen; - } - } - CFRA= (int)floor(cfra+0.5); - - if(CFRA < 1) CFRA= 1; - update_for_newframe(); - - break; - } - bezt++; - } - } - } - } - } - BIF_undo_push("Set frame to selected Ipo vertex"); -} diff --git a/source/blender/src/editipo_lib.c b/source/blender/src/editipo_lib.c deleted file mode 100644 index 41044ad13d7..00000000000 --- a/source/blender/src/editipo_lib.c +++ /dev/null @@ -1,401 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Blender Foundation, 2005. Full recode - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* ********** General calls (minimal dependencies) for editing Ipos in Blender ************* */ - -#include - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_utildefines.h" - -#include "BIF_resources.h" - -#include "BSE_edit.h" -#include "BSE_editipo_types.h" -#include "BSE_editipo.h" -#include "BSE_drawipo.h" - -#include "blendef.h" -#include "mydevice.h" - -char *ob_ic_names[OB_TOTNAM] = { "LocX", "LocY", "LocZ", "dLocX", "dLocY", "dLocZ", - "RotX", "RotY", "RotZ", "dRotX", "dRotY", "dRotZ", - "ScaleX", "ScaleY", "ScaleZ", "dScaleX", "dScaleY", "dScaleZ", - "Layer", "Time", "ColR", "ColG", "ColB", "ColA", - "FStreng", "FFall", "RDamp", "Damping", "Perm", "FMaxD" }; - -char *co_ic_names[CO_TOTNAM] = { "Inf", "HeadTail" }; -char *mtex_ic_names[TEX_TOTNAM] = { "OfsX", "OfsY", "OfsZ", "SizeX", "SizeY", "SizeZ", - "texR", "texG", "texB", "DefVar", "Col", "Nor", "Var", - "Disp" }; -char *tex_ic_names[TE_TOTNAM] = { "NSize", "NDepth", "NType", "Turb", "Vnw1", "Vnw2", - "Vnw3", "Vnw4", "MinkMExp", "DistM", "ColT", "iScale", - "DistA", "MgType", "MgH", "Lacu", "Oct", "MgOff", - "MgGain", "NBase1", "NBase2", "ColR", "ColG", "ColB", "Bright", "Contras"}; -char *ma_ic_names[MA_TOTNAM] = { "R", "G", "B", "SpecR", "SpecG", "SpecB", "MirR", - "MirG", "MirB", "Ref", "Alpha", "Emit", "Amb", "Spec", - "Hard", "SpTra", "Ior", "Mode", "HaSize", "Translu", - "RayMir", "FresMir", "FresMirI", "FresTra", "FresTraI", - "TraGlow" }; -char *seq_ic_names[SEQ_TOTNAM] = { "Fac" }; -char *cu_ic_names[CU_TOTNAM] = { "Speed" }; -char *key_ic_names[KEY_TOTNAM] = { "Speed", "Key 1", "Key 2", "Key 3", "Key 4", "Key 5", - "Key 6", "Key 7", "Key 8", "Key 9", "Key 10", - "Key 11", "Key 12", "Key 13", "Key 14", "Key 15", - "Key 16", "Key 17", "Key 18", "Key 19", "Key 20", - "Key 21", "Key 22", "Key 23", "Key 24", "Key 25", - "Key 26", "Key 27", "Key 28", "Key 29", "Key 30", - "Key 31", "Key 32", "Key 33", "Key 34", "Key 35", - "Key 36", "Key 37", "Key 38", "Key 39", "Key 40", - "Key 41", "Key 42", "Key 43", "Key 44", "Key 45", - "Key 46", "Key 47", "Key 48", "Key 49", "Key 50", - "Key 51", "Key 52", "Key 53", "Key 54", "Key 55", - "Key 56", "Key 57", "Key 58", "Key 59", "Key 60", - "Key 61", "Key 62", "Key 63"}; -char *wo_ic_names[WO_TOTNAM] = { "HorR", "HorG", "HorB", "ZenR", "ZenG", "ZenB", "Expos", - "Misi", "MisDi", "MisSta", "MisHi", "StarR", "StarB", - "StarG", "StarDi", "StarSi" }; -char *la_ic_names[LA_TOTNAM] = { "Energ", "R", "G", "B", "Dist", "SpoSi", "SpoBl", - "Quad1", "Quad2", "HaInt" }; -/* yafray: two curve names added, 'Apert' for aperture, and 'FDist' for focal distance */ -char *cam_ic_names[CAM_TOTNAM] = { "Lens", "ClSta", "ClEnd", "Apert", "FDist", "ShiftX", "ShiftY" }; -char *snd_ic_names[SND_TOTNAM] = { "Vol", "Pitch", "Pan", "Atten" }; -char *ac_ic_names[AC_TOTNAM] = {"LocX", "LocY", "LocZ", "ScaleX", "ScaleY", - "ScaleZ", "QuatW", "QuatX", "QuatY", "QuatZ"}; -char *ic_name_empty[1] ={ "" }; -char *fluidsim_ic_names[FLUIDSIM_TOTNAM] = { "Fac-Visc", "Fac-Time", "GravX","GravY","GravZ", "VelX","VelY","VelZ", "Active" }; -char *part_ic_names[PART_TOTNAM] = { "E_Freq", "E_Life", "E_Speed", "E_Angular", "E_Size", -"Angular", "Size", "Drag", "Brown", "Damp", "Length", "Clump", -"GravX", "GravY", "GravZ", "KinkAmp", "KinkFreq", "KinkShape", "BBTilt"}; - -/* gets the appropriate icon for the given blocktype */ -int geticon_ipo_blocktype(short blocktype) -{ - switch (blocktype) { - case ID_OB: - return ICON_OBJECT; - case ID_PO: - return ICON_POSE_HLT; - case ID_KE: - return ICON_EDIT; - case ID_MA: - return ICON_MATERIAL; - case ID_WO: - return ICON_WORLD; - case ID_CU: - return ICON_CURVE; - case ID_CA: - return ICON_CAMERA; - case ID_LA: - return ICON_LAMP; - case ID_TE: - return ICON_TEXTURE; - case ID_CO: - return ICON_CONSTRAINT; - case ID_FLUIDSIM: - return ICON_WORLD; // uggh - default: - return 0; // what about blank icon? - } -} - -/* get name of ipo-curve - * - icu should be valid pointer - * - ob is only needed for a shapekey-related hack - */ -char *getname_ipocurve(IpoCurve *icu, Object *ob) -{ - switch (icu->blocktype) { - case ID_OB: - return getname_ob_ei(icu->adrcode, 0); /* dummy 2nd arg */ - case ID_PO: - return getname_ac_ei(icu->adrcode); - case ID_KE: - { - static char name[32]; - Key *key= ob_get_key(ob); - KeyBlock *kb= key_get_keyblock(key, icu->adrcode); - - /* only return name if it has been set, otherwise use - * default method using static string (Key #) - */ - if ((kb) && (kb->name[0] != '\0')) - return kb->name; /* return keyblock's name */ - - /* in case keyblock is not named or no key/keyblock was found */ - sprintf(name, "Key %d", icu->adrcode); - return name; - } - - default: /* fixme - add all of the other types! */ - return NULL; - } -} - -char *getname_ac_ei(int nr) -{ - switch(nr) { - case AC_LOC_X: - case AC_LOC_Y: - case AC_LOC_Z: - return ac_ic_names[nr-1]; - case AC_SIZE_X: - case AC_SIZE_Y: - case AC_SIZE_Z: - return ac_ic_names[nr-10]; - case AC_QUAT_X: - case AC_QUAT_Y: - case AC_QUAT_Z: - case AC_QUAT_W: - return ac_ic_names[nr-19]; - default: - return ic_name_empty[0]; /* empty */ - } -} - -char *getname_co_ei(int nr) -{ - switch(nr){ - case CO_ENFORCE: - case CO_HEADTAIL: - return co_ic_names[nr-1]; - } - return ic_name_empty[0]; -} - -char *getname_ob_ei(int nr, int colipo) -{ - if(nr>=OB_LOC_X && nr <= OB_PD_FMAXD) return ob_ic_names[nr-1]; - - return ic_name_empty[0]; -} - -char *getname_tex_ei(int nr) -{ - if(nr>=TE_NSIZE && nr<=TE_CONTRA) return tex_ic_names[nr-1]; - - return ic_name_empty[0]; -} - -char *getname_mtex_ei(int nr) -{ - if(nr>=MAP_OFS_X && nr<=MAP_DISP) return mtex_ic_names[nr-1]; - - return ic_name_empty[0]; -} - -char *getname_mat_ei(int nr) -{ - if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1))); - else { - if(nr>=MA_COL_R && nr<=MA_ADD) return ma_ic_names[nr-1]; - } - return ic_name_empty[0]; -} - -char *getname_world_ei(int nr) -{ - if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1))); - else { - if(nr>=WO_HOR_R && nr<=WO_STARSIZE) return wo_ic_names[nr-1]; - } - return ic_name_empty[0]; -} - -char *getname_seq_ei(int nr) -{ - if(nr == SEQ_FAC1) return seq_ic_names[nr-1]; - return ic_name_empty[0]; -} - -char *getname_cu_ei(int nr) -{ - if(nr==CU_SPEED) return cu_ic_names[nr-1]; - return ic_name_empty[0]; -} - -char *getname_la_ei(int nr) -{ - if(nr>=MA_MAP1) return getname_mtex_ei((nr & (MA_MAP1-1))); - else { - if(nr>=LA_ENERGY && nr<=LA_HALOINT) return la_ic_names[nr-1]; - } - return ic_name_empty[0]; -} - -char *getname_cam_ei(int nr) -{ - if(nr>=CAM_LENS && nr<=CAM_SHIFT_Y) return cam_ic_names[nr-1]; - return ic_name_empty[0]; -} - -char *getname_snd_ei(int nr) -{ - if(nr>=SND_VOLUME && nr<=SND_ATTEN) return snd_ic_names[nr-1]; - return ic_name_empty[0]; -} - -char *getname_fluidsim_ei(int nr) -{ - if(nr <= FLUIDSIM_TOTIPO) return fluidsim_ic_names[nr-1]; - return ic_name_empty[0]; -} -char *getname_part_ei(int nr) -{ - if(nr <= PART_TOTIPO) return part_ic_names[nr-1]; - return ic_name_empty[0]; -} - - -void boundbox_ipocurve(IpoCurve *icu, int selectedonly) -{ - BezTriple *bezt; - float vec[3]={0.0,0.0,0.0}; - float min[3], max[3]; - int a; - - if(icu->totvert) { - INIT_MINMAX(min, max); - - if(icu->bezt ) { - a= icu->totvert; - bezt= icu->bezt; - while(a--) { - if(icu->vartype & IPO_BITS) { - if((bezt->f2 & SELECT) || !selectedonly) { - vec[0]= bezt->vec[1][0]; - vec[1]= 0.0; - DO_MINMAX(vec, min, max); - - vec[1]= 16.0; - DO_MINMAX(vec, min, max); - } - } - else { - if((bezt->f1 & SELECT) || !selectedonly) { - if(icu->ipo==IPO_BEZ && a!=icu->totvert-1) - DO_MINMAX(bezt->vec[0], min, max); - } - if((bezt->f2 & SELECT) || !selectedonly) - DO_MINMAX(bezt->vec[1], min, max); - if((bezt->f3 & SELECT) || !selectedonly) { - if(icu->ipo==IPO_BEZ && a!=0) - DO_MINMAX(bezt->vec[2], min, max); - } - } - - bezt++; - } - } - if(min[0]==max[0]) max[0]= (float)(min[0]+1.0); - if(min[1]==max[1]) max[1]= (float)(min[1]+0.1); - - icu->totrct.xmin= min[0]; - icu->totrct.ymin= min[1]; - icu->totrct.xmax= max[0]; - icu->totrct.ymax= max[1]; - } - else { - icu->totrct.xmin= icu->totrct.ymin= 0.0; - icu->totrct.xmax= EFRA; - icu->totrct.ymax= 1.0; - } -} - -void boundbox_ipo(Ipo *ipo, rctf *bb, int selectedonly) -{ - IpoCurve *icu; - int first= 1; - - icu= ipo->curve.first; - while(icu) { - - boundbox_ipocurve(icu, selectedonly); - - if(first) { - *bb= icu->totrct; - first= 0; - } - else BLI_union_rctf(bb, &(icu->totrct)); - - icu= icu->next; - } -} - - -unsigned int ipo_rainbow(int cur, int tot) -{ - float dfac, fac, sat; - - dfac= (float)(1.0/( (float)tot+1.0)); - - /* this calculation makes 2 or 4 different cycles of rainbow colors */ - if(cur< tot/2) fac= (float)(cur*2.0f*dfac); - else fac= (float)((cur-tot/2)*2.0f*dfac +dfac); - if(tot > 32) fac= fac*1.95f; - if(fac>1.0f) fac-= 1.0f; - - if(fac>0.5f && fac<0.8f) sat= 0.4f; - else sat= 0.5f; - - return hsv_to_cpack(fac, sat, 1.0f); -} - -/* exported to python, hrms... (ton) */ -int texchannel_to_adrcode(int channel) -{ - switch(channel) { - case 0: return MA_MAP1; - case 1: return MA_MAP2; - case 2: return MA_MAP3; - case 3: return MA_MAP4; - case 4: return MA_MAP5; - case 5: return MA_MAP6; - case 6: return MA_MAP7; - case 7: return MA_MAP8; - case 8: return MA_MAP9; - case 9: return MA_MAP10; - default: return 0; - } -} - - - - diff --git a/source/blender/src/editipo_mods.c b/source/blender/src/editipo_mods.c deleted file mode 100644 index ae283ce8c0b..00000000000 --- a/source/blender/src/editipo_mods.c +++ /dev/null @@ -1,1403 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Blender Foundation, 2005. Full recode - * - * ***** END GPL LICENSE BLOCK ***** - */ - - -/* ********** Selection and set Handle code for editing Ipos in Blender ************* */ -/* - mouse_select_ipo() is in editipo.c -*/ - -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_global.h" -#include "BKE_action.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_utildefines.h" - -#include "BIF_editaction.h" -#include "BIF_interface.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_edit.h" -#include "BSE_editipo_types.h" -#include "BSE_editipo.h" -#include "BSE_drawipo.h" -#include "BSE_trans_types.h" -#include "BSE_time.h" - -#include "BDR_drawobject.h" - -#include "blendef.h" -#include "mydevice.h" - -extern int totipo_edit, totipo_sel, totipo_vertsel, totipo_vis; - -void ipo_toggle_showkey(void) -{ - if(G.sipo->showkey) G.sipo->showkey= 0; - else G.sipo->showkey= 1; - - free_ipokey(&G.sipo->ipokey); - if(G.sipo->ipo) G.sipo->ipo->showkey= G.sipo->showkey; - - BIF_undo_push("Toggle Show Key Ipo"); -} - -void swap_selectall_editipo(void) -{ - Object *ob; - EditIpo *ei; - IpoKey *ik; - BezTriple *bezt; - int a, b; /* , sel=0; */ - - get_status_editipo(); - - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - while(ik) { - if(totipo_vertsel) ik->flag &= ~1; - else ik->flag |= 1; - ik= ik->next; - } - update_editipo_flags(); - - if(G.sipo->showkey && G.sipo->blocktype==ID_OB ) { - ob= OBACT; - if(ob && (ob->ipoflag & OB_DRAWKEY)) draw_object_ext(BASACT); - } - } - else if(totipo_edit==0) { - ei= G.sipo->editipo; - if (ei){ - for(a=0; atotipo; a++) { - if( ei->flag & IPO_VISIBLE ) { - if(totipo_sel) ei->flag &= ~IPO_SELECT; - else ei->flag |= IPO_SELECT; - } - ei++; - } - update_editipo_flags(); - } - get_status_editipo(); - } - else { - ei= G.sipo->editipo; - for(a=0; atotipo; a++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu )) { - bezt= ei->icu->bezt; - if(bezt) { - b= ei->icu->totvert; - while(b--) { - if(totipo_vertsel) { - bezt->f1= bezt->f2= bezt->f3= 0; - } - else { - bezt->f1= bezt->f2= bezt->f3= SELECT; - } - bezt++; - } - } - } - ei++; - } - - } - - BIF_undo_push("Swap Select All Ipo"); - scrarea_queue_winredraw(curarea); - -} - -void swap_visible_editipo(void) -{ - EditIpo *ei; - Object *ob; - int a; /* , sel=0; */ - - get_status_editipo(); - - - ei= G.sipo->editipo; - for(a=0; atotipo; a++) { - if(totipo_vis==0) { - if(ei->icu) { - ei->flag |= IPO_VISIBLE; - ei->flag |= IPO_SELECT; - } - } - else - ei->flag &= ~IPO_VISIBLE; - ei++; - } - - update_editipo_flags(); - - if(G.sipo->showkey) { - - make_ipokey(); - - ob= OBACT; - if(ob && (ob->ipoflag & OB_DRAWKEY)) allqueue(REDRAWVIEW3D, 0); - } - - scrarea_queue_winredraw(curarea); - BIF_undo_push("Swap Visible Ipo"); -} - -void deselectall_editipo(void) -{ - EditIpo *ei; - IpoKey *ik; - BezTriple *bezt; - int a, b; /* , sel=0; */ - - get_status_editipo(); - - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - while(ik) { - ik->flag &= ~1; - ik= ik->next; - } - update_editipo_flags(); - - } - else if(totipo_edit==0) { - - ei= G.sipo->editipo; - for(a=0; atotipo; a++) { - if( ei->flag & IPO_VISIBLE ) { - ei->flag &= ~IPO_SELECT; - } - ei++; - } - update_editipo_flags(); - } - else { - ei= G.sipo->editipo; - for(a=0; atotipo; a++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu )) { - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - bezt->f1= bezt->f2= bezt->f3= 0; - bezt++; - } - } - } - ei++; - } - } - - BIF_undo_push("(De)select all Ipo"); - scrarea_queue_winredraw(curarea); -} - - -static int icu_keys_bezier_loop(IpoCurve *icu, - int (*bezier_function)(BezTriple *), - void (ipocurve_function)(struct IpoCurve *icu)) -{ - /* This loops through the beziers in the Ipocurve, and executes - * the generic user provided 'bezier_function' on each one. - * Optionally executes the generic function ipocurve_function on the - * IPO curve after looping (eg. calchandles_ipocurve) - */ - - int b; - BezTriple *bezt; - - b = icu->totvert; - bezt = icu->bezt; - - /* if bezier_function has been specified - * then loop through each bezier executing - * it. - */ - - if (bezier_function != NULL) { - while(b--) { - /* exit with return code 1 if the bezier function - * returns 1 (good for when you are only interested - * in finding the first bezier that - * satisfies a condition). - */ - if (bezier_function(bezt)) return 1; - bezt++; - } - } - - /* if ipocurve_function has been specified - * then execute it - */ - if (ipocurve_function != NULL) - ipocurve_function(icu); - - return 0; - -} - -static int ipo_keys_bezier_loop(Ipo *ipo, - int (*bezier_function)(BezTriple *), - void (ipocurve_function)(struct IpoCurve *icu)) -{ - /* This loops through the beziers that are attached to - * the selected keys on the Ipocurves of the Ipo, and executes - * the generic user provided 'bezier_function' on each one. - * Optionally executes the generic function ipocurve_function on a - * IPO curve after looping (eg. calchandles_ipocurve) - */ - - IpoCurve *icu; - - if(ipo==NULL) return 0; - - /* Loop through each curve in the Ipo - */ - for (icu=ipo->curve.first; icu; icu=icu->next){ - if (icu_keys_bezier_loop(icu,bezier_function, ipocurve_function)) - return 1; - } - - return 0; -} - -static int selected_bezier_loop(int (*looptest)(EditIpo *), - int (*bezier_function)(BezTriple *), - void (ipocurve_function)(struct IpoCurve *icu)) -{ - /* This loops through the beziers that are attached to - * selected keys in editmode in the IPO window, and executes - * the generic user-provided 'bezier_function' on each one - * that satisfies the 'looptest' function. Optionally executes - * the generic function ipocurve_function on a IPO curve - * after looping (eg. calchandles_ipocurve) - */ - - EditIpo *ei; - BezTriple *bezt; - int a, b; - - /* Get the first Edit Ipo from the selected Ipos - */ - ei= G.sipo->editipo; - - /* Loop throught all of the selected Ipo's - */ - for(a=0; atotipo; a++, ei++) { - /* Do a user provided test on the Edit Ipo - * to determine whether we want to process it - */ - if (looptest(ei)) { - /* Loop through the selected - * beziers on the Edit Ipo - */ - bezt = ei->icu->bezt; - b = ei->icu->totvert; - - /* if bezier_function has been specified - * then loop through each bezier executing - * it. - */ - if (bezier_function != NULL) { - while(b--) { - /* exit with return code 1 if the bezier function - * returns 1 (good for when you are only interested - * in finding the first bezier that - * satisfies a condition). - */ - if (bezier_function(bezt)) return 1; - bezt++; - } - } - - /* if ipocurve_function has been specified - * then execute it - */ - if (ipocurve_function != NULL) - ipocurve_function(ei->icu); - } - /* nufte flourdje zim ploopydu <-- random dutch looking comment ;) */ - /* looks more like russian to me! (ton) */ - } - - return 0; -} - -int select_bezier_add(BezTriple *bezt) -{ - /* Select the bezier triple */ - bezt->f1 |= SELECT; - bezt->f2 |= SELECT; - bezt->f3 |= SELECT; - return 0; -} - -int select_bezier_subtract(BezTriple *bezt) -{ - /* Deselect the bezier triple */ - bezt->f1 &= ~SELECT; - bezt->f2 &= ~SELECT; - bezt->f3 &= ~SELECT; - return 0; -} - -int select_bezier_invert(BezTriple *bezt) -{ - /* Invert the selection for the bezier triple */ - bezt->f2 ^= SELECT; - if ( bezt->f2 & SELECT ) { - bezt->f1 |= SELECT; - bezt->f3 |= SELECT; - } - else { - bezt->f1 &= ~SELECT; - bezt->f3 &= ~SELECT; - } - return 0; -} - -static int set_bezier_auto(BezTriple *bezt) -{ - /* Sets the selected bezier handles to type 'auto' - */ - - /* is a handle selected? If so - * set it to type auto - */ - if(bezt->f1 || bezt->f3) { - if(bezt->f1) bezt->h1= 1; /* the secret code for auto */ - if(bezt->f3) bezt->h2= 1; - - /* if the handles are not of the same type, set them - * to type free - */ - if(bezt->h1!=bezt->h2) { - if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE; - if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE; - } - } - return 0; -} - -static int set_bezier_vector(BezTriple *bezt) -{ - /* Sets the selected bezier handles to type 'vector' - */ - - /* is a handle selected? If so - * set it to type vector - */ - if(bezt->f1 || bezt->f3) { - if(bezt->f1) bezt->h1= 2; /* the code for vector */ - if(bezt->f3) bezt->h2= 2; - - /* if the handles are not of the same type, set them - * to type free - */ - if(bezt->h1!=bezt->h2) { - if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE; - if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE; - } - } - return 0; -} - -static int bezier_isfree(BezTriple *bezt) -{ - /* queries whether the handle should be set - * to type 'free' (I think) - */ - if(bezt->f1 && bezt->h1) return 1; - if(bezt->f3 && bezt->h2) return 1; - return 0; -} - -static int set_bezier_free(BezTriple *bezt) -{ - /* Sets selected bezier handles to type 'free' - */ - if(bezt->f1) bezt->h1= HD_FREE; - if(bezt->f3) bezt->h2= HD_FREE; - return 0; -} - -static int set_bezier_align(BezTriple *bezt) -{ - /* Sets selected bezier handles to type 'align' - */ - if(bezt->f1) bezt->h1= HD_ALIGN; - if(bezt->f3) bezt->h2= HD_ALIGN; - return 0; -} - -static int vis_edit_icu_bez(EditIpo *ei) -{ - /* A 4 part test for an EditIpo : - * is it a) visible - * b) in edit mode - * c) does it contain an Ipo Curve - * d) does that ipo curve have a bezier - * - * (The reason why I don't just use the macro - * is I need a pointer to a function.) - */ - return (ISPOIN4(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu, icu->bezt)); -} - -void select_ipo_bezier_keys(Ipo *ipo, int selectmode) -{ - /* Select all of the beziers in all - * of the Ipo curves belonging to the - * Ipo, using the selection mode. - */ - switch (selectmode) { - case SELECT_ADD: - ipo_keys_bezier_loop(ipo, select_bezier_add, NULL); - break; - case SELECT_SUBTRACT: - ipo_keys_bezier_loop(ipo, select_bezier_subtract, NULL); - break; - case SELECT_INVERT: - ipo_keys_bezier_loop(ipo, select_bezier_invert, NULL); - break; - } -} - -void select_icu_bezier_keys(IpoCurve *icu, int selectmode) -{ - /* Select all of the beziers in all - * of the Ipo curves belonging to the - * Ipo, using the selection mode. - */ - switch (selectmode) { - case SELECT_ADD: - icu_keys_bezier_loop(icu, select_bezier_add, NULL); - break; - case SELECT_SUBTRACT: - icu_keys_bezier_loop(icu, select_bezier_subtract, NULL); - break; - case SELECT_INVERT: - icu_keys_bezier_loop(icu, select_bezier_invert, NULL); - break; - } -} - -void sethandles_ipo_keys(Ipo *ipo, int code) -{ - /* this function lets you set bezier handles all to - * one type for some Ipo's (e.g. with hotkeys through - * the action window). - */ - - /* code==1: set autohandle */ - /* code==2: set vectorhandle */ - /* als code==3 (HD_ALIGN) toggelt het, vectorhandles worden HD_FREE */ - - switch(code) { - case 1: - /*** Set to auto ***/ - ipo_keys_bezier_loop(ipo, set_bezier_auto, - calchandles_ipocurve); - break; - case 2: - /*** Set to vector ***/ - ipo_keys_bezier_loop(ipo, set_bezier_vector, - calchandles_ipocurve); - break; - default: - if ( ipo_keys_bezier_loop(ipo, bezier_isfree, NULL) ) { - /*** Set to free ***/ - ipo_keys_bezier_loop(ipo, set_bezier_free, - calchandles_ipocurve); - } - else { - /*** Set to align ***/ - ipo_keys_bezier_loop(ipo, set_bezier_align, - calchandles_ipocurve); - } - break; - } -} - -static int snap_bezier_nearest(BezTriple *bezt) -{ - if(bezt->f2 & SELECT) - bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]+0.5)); - return 0; -} - -static int snap_bezier_nearestsec(BezTriple *bezt) -{ - float secf = FPS; - if(bezt->f2 & SELECT) - bezt->vec[1][0]= (float)(floor(bezt->vec[1][0]/secf + 0.5f) * secf); - return 0; -} - -static int snap_bezier_cframe(BezTriple *bezt) -{ - if(bezt->f2 & SELECT) - bezt->vec[1][0]= (float)CFRA; - return 0; -} - -static int snap_bezier_nearmarker(BezTriple *bezt) -{ - if(bezt->f2 & SELECT) - bezt->vec[1][0]= (float)find_nearest_marker_time(bezt->vec[1][0]); - - return 0; -} - -void snap_ipo_keys(Ipo *ipo, short snaptype) -{ - switch (snaptype) { - case 1: /* snap to nearest frame */ - ipo_keys_bezier_loop(ipo, snap_bezier_nearest, calchandles_ipocurve); - break; - case 2: /* snap to current frame */ - ipo_keys_bezier_loop(ipo, snap_bezier_cframe, calchandles_ipocurve); - break; - case 3: /* snap to nearest marker */ - ipo_keys_bezier_loop(ipo, snap_bezier_nearmarker, calchandles_ipocurve); - break; - case 4: /* snap to nearest second */ - ipo_keys_bezier_loop(ipo, snap_bezier_nearestsec, calchandles_ipocurve); - break; - default: /* just in case */ - ipo_keys_bezier_loop(ipo, snap_bezier_nearest, calchandles_ipocurve); - break; - } -} - -static int mirror_bezier_cframe(BezTriple *bezt) -{ - float diff; - - if(bezt->f2 & SELECT) { - diff= ((float)CFRA - bezt->vec[1][0]); - bezt->vec[1][0]= ((float)CFRA + diff); - } - - return 0; -} - -static int mirror_bezier_yaxis(BezTriple *bezt) -{ - float diff; - - if(bezt->f2 & SELECT) { - diff= (0.0f - bezt->vec[1][0]); - bezt->vec[1][0]= (0.0f + diff); - } - - return 0; -} - -static int mirror_bezier_xaxis(BezTriple *bezt) -{ - float diff; - - if(bezt->f2 & SELECT) { - diff= (0.0f - bezt->vec[1][1]); - bezt->vec[1][1]= (0.0f + diff); - } - - return 0; -} - -static int mirror_bezier_marker(BezTriple *bezt) -{ - static TimeMarker *marker; - static short initialised = 0; - float diff; - - /* In order for this mirror function to work without - * any extra arguments being added, we use the case - * of bezt==NULL to denote that we should find the - * marker to mirror over. The static pointer is safe - * to use this way, as it will be set to null after - * each cycle in which this is called. - */ - - if (bezt) { - /* mirroring time */ - if((bezt->f2 & SELECT) && (marker)) { - diff= (marker->frame - bezt->vec[1][0]); - bezt->vec[1][0]= (marker->frame + diff); - } - } - else { - /* initialisation time */ - if (initialised) { - /* reset everything for safety */ - marker = NULL; - initialised = 0; - } - else { - /* try to find a marker */ - for (marker= G.scene->markers.first; marker; marker=marker->next) { - if (marker->flag & SELECT) { - initialised = 1; - break; - } - } - - if (initialised == 0) - marker = NULL; - } - } - - return 0; -} - -void mirror_ipo_keys(Ipo *ipo, short mirror_type) -{ - switch (mirror_type) { - case 1: /* mirror over current frame */ - ipo_keys_bezier_loop(ipo, mirror_bezier_cframe, calchandles_ipocurve); - break; - case 2: /* mirror over frame 0 */ - ipo_keys_bezier_loop(ipo, mirror_bezier_yaxis, calchandles_ipocurve); - break; - case 3: /* mirror over value 0 */ - ipo_keys_bezier_loop(ipo, mirror_bezier_xaxis, calchandles_ipocurve); - break; - case 4: /* mirror over marker */ - mirror_bezier_marker(NULL); - ipo_keys_bezier_loop(ipo, mirror_bezier_marker, calchandles_ipocurve); - mirror_bezier_marker(NULL); - break; - default: /* just in case */ - ipo_keys_bezier_loop(ipo, mirror_bezier_yaxis, calchandles_ipocurve); - break; - } -} - -/* This function is called to calculate the average location of the - * selected keyframes, and place the current frame at that location. - * - * It must be called like so: - * snap_cfra_ipo_keys(NULL, -1); // initialise the static vars first - * for (ipo...) snap_cfra_ipo_keys(ipo, 0); // sum up keyframe times - * snap_cfra_ipo_keys(NULL, 1); // set current frame after taking average - */ -void snap_cfra_ipo_keys(Ipo *ipo, short mode) -{ - static int cfra; - static int tot; - - IpoCurve *icu; - BezTriple *bezt; - int a; - - - if (mode == -1) { - /* initialise a new snap-operation */ - cfra= 0; - tot= 0; - } - else if (mode == 1) { - /* set current frame - using average frame */ - if (tot != 0) - CFRA = cfra / tot; - } - else { - /* loop through keys in ipo, summing the frame - * numbers of those that are selected - */ - if (ipo == NULL) - return; - - for (icu= ipo->curve.first; icu; icu= icu->next) { - for (a=0, bezt=icu->bezt; a < icu->totvert; a++, bezt++) { - if (BEZSELECTED(bezt)) { - cfra += bezt->vec[1][0]; - tot++; - } - } - } - } -} - - -/* currently only used by some action editor tools, but may soon get used by ipo editor */ -/* restore = whether to map points back to ipo-time - * only_keys = whether to only adjust the location of the center point of beztriples - */ -void actstrip_map_ipo_keys(Object *ob, Ipo *ipo, short restore, short only_keys) -{ - IpoCurve *icu; - BezTriple *bezt; - int a; - - if (ipo==NULL) return; - - /* loop through all ipo curves, adjusting the times of the selected keys */ - for (icu= ipo->curve.first; icu; icu= icu->next) { - for (a=0, bezt=icu->bezt; atotvert; a++, bezt++) { - /* are the times being adjusted for editing, or has editing finished */ - if (restore) { - if (only_keys == 0) { - bezt->vec[0][0]= get_action_frame(ob, bezt->vec[0][0]); - bezt->vec[2][0]= get_action_frame(ob, bezt->vec[2][0]); - } - bezt->vec[1][0]= get_action_frame(ob, bezt->vec[1][0]); - } - else { - if (only_keys == 0) { - bezt->vec[0][0]= get_action_frame_inv(ob, bezt->vec[0][0]); - bezt->vec[2][0]= get_action_frame_inv(ob, bezt->vec[2][0]); - } - bezt->vec[1][0]= get_action_frame_inv(ob, bezt->vec[1][0]); - } - } - } -} - -static void ipo_curves_auto_horiz(void) -{ - EditIpo *ei; - int a, set= 1; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) - if(ei->flag & IPO_AUTO_HORIZ) set= 0; - } - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { - if(set) ei->flag |= IPO_AUTO_HORIZ; - else ei->flag &= ~IPO_AUTO_HORIZ; - } - } - update_editipo_flags(); -} - -void sethandles_ipo(int code) -{ - /* this function lets you set bezier handles all to - * one type for some selected keys in edit mode in the - * IPO window (e.g. with hotkeys) - */ - - /* code==1: set autohandle */ - /* code==2: set vectorhandle */ - /* als code==3 (HD_ALIGN) toggelt het, vectorhandles worden HD_FREE */ - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - - switch(code) { - case HD_AUTO: - /*** Set to auto ***/ - selected_bezier_loop(vis_edit_icu_bez, set_bezier_auto, - calchandles_ipocurve); - break; - case HD_VECT: - /*** Set to vector ***/ - selected_bezier_loop(vis_edit_icu_bez, set_bezier_vector, - calchandles_ipocurve); - break; - case HD_AUTO_ANIM: - /* set to enforce autohandles to be horizontal on extremes */ - ipo_curves_auto_horiz(); - - break; - default: - if (selected_bezier_loop(vis_edit_icu_bez, bezier_isfree, NULL) ) { - /*** Set to free ***/ - selected_bezier_loop(vis_edit_icu_bez, set_bezier_free, - calchandles_ipocurve); - } - else { - /*** Set to align ***/ - selected_bezier_loop(vis_edit_icu_bez, set_bezier_align, - calchandles_ipocurve); - } - break; - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Set handles Ipo"); -} - - -static void set_ipocurve_constant(struct IpoCurve *icu) { - /* Sets the type of the IPO curve to constant - */ - icu->ipo= IPO_CONST; -} - -static void set_ipocurve_linear(struct IpoCurve *icu) { - /* Sets the type of the IPO curve to linear - */ - icu->ipo= IPO_LIN; -} - -static void set_ipocurve_bezier(struct IpoCurve *icu) { - /* Sets the type of the IPO curve to bezier - */ - - /* dont regenerate hendels for bezier ipo curves */ - if (icu->ipo==IPO_BEZ) return; - - /* curve handels aren't generated for non bezier curve types */ - icu->ipo= IPO_BEZ; - calchandles_ipocurve(icu); -} - - -void setipotype_ipo(Ipo *ipo, int code) -{ - /* Sets the type of the each ipo curve in the - * Ipo to a value based on the code - */ - switch (code) { - case 1: - ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_constant); - break; - case 2: - ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_linear); - break; - case 3: - ipo_keys_bezier_loop(ipo, NULL, set_ipocurve_bezier); - break; - } -} - -void setexprap_ipoloop(Ipo *ipo, int code) -{ - IpoCurve *icu; - - /* Loop through each curve in the Ipo */ - for (icu=ipo->curve.first; icu; icu=icu->next) - icu->extrap= code; -} - -void set_ipotype(void) -{ - EditIpo *ei; - int a; - short event; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - if(G.sipo->showkey) return; - get_status_editipo(); - - if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) { - Key *key= ob_get_key((Object *)G.sipo->from); - Object *ob= OBACT; - KeyBlock *kb; - - if(key==NULL) return; - kb= BLI_findlink(&key->block, ob->shapenr-1); - if(kb==NULL) return; - - event= pupmenu("Key Type %t|Linear %x1|Cardinal %x2|B Spline %x3"); - if(event < 1) return; - - kb->type= 0; - if(event==1) kb->type= KEY_LINEAR; - if(event==2) kb->type= KEY_CARDINAL; - if(event==3) kb->type= KEY_BSPLINE; - } - else { - event= pupmenu("Ipo Type %t|Constant %x1|Linear %x2|Bezier %x3"); - if(event < 1) return; - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu)) { - if(event==1) ei->icu->ipo= IPO_CONST; - else if(event==2) ei->icu->ipo= IPO_LIN; - else ei->icu->ipo= IPO_BEZ; - } - } - } - BIF_undo_push("Set ipo type"); - scrarea_queue_winredraw(curarea); -} - -void borderselect_ipo(void) -{ - EditIpo *ei; - IpoKey *ik; - BezTriple *bezt; - rcti rect; - rctf rectf; - int a, b, val; - short mval[2]; - - get_status_editipo(); - - val= get_border(&rect, 3); - - if(val) { - /* map ipo-points for editing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0); - } - - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - if(G.sipo->showkey) { - ik= G.sipo->ipokey.first; - while(ik) { - if(rectf.xminval && rectf.xmax>ik->val) { - if(val==LEFTMOUSE) ik->flag |= 1; - else ik->flag &= ~1; - } - ik= ik->next; - } - update_editipo_flags(); - } - else if(totipo_edit==0) { - if(rect.xmineditipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_EDIT, icu)) { - if(ei->icu->bezt) { - b= ei->icu->totvert; - bezt= ei->icu->bezt; - while(b--) { - int bit= (val==LEFTMOUSE); - - if(BLI_in_rctf(&rectf, bezt->vec[0][0], bezt->vec[0][1])) - bezt->f1 = (bezt->f1&~SELECT) | bit; - if(BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1])) - bezt->f2 = (bezt->f2&~SELECT) | bit; - if(BLI_in_rctf(&rectf, bezt->vec[2][0], bezt->vec[2][1])) - bezt->f3 = (bezt->f3&~SELECT) | bit; - - bezt++; - } - } - } - } - } - - /* undo mapping of ipo-points for drawing if scaled ipo */ - if (NLA_IPO_SCALED) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0); - } - - BIF_undo_push("Border select Ipo"); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } -} - - - -void nextkey(ListBase *elems, int dir) -{ - IpoKey *ik, *previk; - int totsel; - - if(dir==1) ik= elems->last; - else ik= elems->first; - previk= 0; - totsel= 0; - - while(ik) { - - if(ik->flag) totsel++; - - if(previk) { - if(G.qual & LR_SHIFTKEY) { - if(ik->flag) previk->flag= 1; - } - else previk->flag= ik->flag; - } - - previk= ik; - if(dir==1) ik= ik->prev; - else ik= ik->next; - - if(G.qual & LR_SHIFTKEY); - else if(ik==0) previk->flag= 0; - } - - /* when no key select: */ - if(totsel==0) { - if(dir==1) ik= elems->first; - else ik= elems->last; - - if(ik) ik->flag= 1; - } -} - - -void nextkey_ipo(int dir) /* call from ipo queue */ -{ - IpoKey *ik; - int a; - - if(G.sipo->showkey==0) return; - - nextkey(&G.sipo->ipokey, dir); - - /* copy to beziers */ - ik= G.sipo->ipokey.first; - while(ik) { - for(a=0; atotipo; a++) { - if(ik->data[a]) ik->data[a]->f1= ik->data[a]->f2= ik->data[a]->f3= ik->flag; - } - ik= ik->next; - } - - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - if(G.sipo->blocktype == ID_OB) allqueue(REDRAWVIEW3D, 0); -} - -void nextkey_obipo(int dir) /* only call external from view3d queue */ -{ - Base *base; - Object *ob; - ListBase elems; - IpoKey *ik; - int a; - - if (!G.vd) { - error("Can't do this! Open a 3D window"); - return; - } - - /* problem: this doesnt work when you mix dLoc keys with Loc keys */ - - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - ob= base->object; - if( (ob->ipoflag & OB_DRAWKEY) && ob->ipo && ob->ipo->showkey) { - elems.first= elems.last= 0; - make_ipokey_transform(ob, &elems, 0); - - if(elems.first) { - - nextkey(&elems, dir); - - /* copy to beziers */ - ik= elems.first; - while(ik) { - for(a=0; adata[a]) ik->data[a]->f1= ik->data[a]->f2= ik->data[a]->f3= ik->flag; - } - ik= ik->next; - } - - free_ipokey(&elems); - } - } - } - - base= base->next; - } - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWVIEW3D, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); -} - -int is_ipo_key_selected(Ipo *ipo) -{ - int i; - IpoCurve *icu; - - if (!ipo) - return 0; - - for (icu=ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++) - if (BEZSELECTED(&icu->bezt[i])) - return 1; - } - - return 0; -} - -void set_ipo_key_selection(Ipo *ipo, int sel) -{ - int i; - IpoCurve *icu; - - if (!ipo) - return; - - for (icu=ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (sel == 2) { - icu->bezt[i].f1^=1; - icu->bezt[i].f2^=1; - icu->bezt[i].f3^=1; - } - else if (sel == 1){ - icu->bezt[i].f1|=1; - icu->bezt[i].f2|=1; - icu->bezt[i].f3|=1; - } - else{ - icu->bezt[i].f1&=~1; - icu->bezt[i].f2&=~1; - icu->bezt[i].f3&=~1; - } - } - } -} - -int fullselect_ipo_keys(Ipo *ipo) -{ - int i; - IpoCurve *icu; - int tvtot = 0; - - if (!ipo) - return tvtot; - - for (icu=ipo->curve.first; icu; icu=icu->next) { - for (i=0; itotvert; i++){ - if (icu->bezt[i].f2 & 1){ - tvtot+=3; - icu->bezt[i].f1 |= 1; - icu->bezt[i].f3 |= 1; - } - } - } - - return tvtot; -} - - -void borderselect_icu_key(IpoCurve *icu, float xmin, float xmax, - int (*select_function)(BezTriple *)) -{ - /* Selects all bezier triples in the Ipocurve - * between times xmin and xmax, using the selection - * function. - */ - - int i; - - /* loop through all of the bezier triples in - * the Ipocurve -- if the triple occurs between - * times xmin and xmax then select it using the selection - * function - */ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] < xmax ){ - select_function(&(icu->bezt[i])); - } - } -} - -void borderselect_ipo_key(Ipo *ipo, float xmin, float xmax, int selectmode) -{ - /* Selects all bezier triples in each Ipocurve of the - * Ipo between times xmin and xmax, using the selection mode. - */ - - IpoCurve *icu; - int (*select_function)(BezTriple *); - - /* If the ipo is no good then return */ - if (!ipo) - return; - - /* Set the selection function based on the - * selection mode. - */ - switch(selectmode) { - case SELECT_ADD: - select_function = select_bezier_add; - break; - case SELECT_SUBTRACT: - select_function = select_bezier_subtract; - break; - case SELECT_INVERT: - select_function = select_bezier_invert; - break; - default: - return; - } - - /* loop through all of the bezier triples in all - * of the Ipocurves -- if the triple occurs between - * times xmin and xmax then select it using the selection - * function - */ - for (icu=ipo->curve.first; icu; icu=icu->next){ - borderselect_icu_key(icu, xmin, xmax, select_function); - } -} - -void select_ipo_key(Ipo *ipo, float selx, int selectmode) -{ - /* Selects all bezier triples in each Ipocurve of the - * Ipo at time selx, using the selection mode. - */ - int i; - IpoCurve *icu; - int (*select_function)(BezTriple *); - - /* If the ipo is no good then return */ - if (!ipo) - return; - - /* Set the selection function based on the - * selection mode. - */ - switch(selectmode) { - case SELECT_ADD: - select_function = select_bezier_add; - break; - case SELECT_SUBTRACT: - select_function = select_bezier_subtract; - break; - case SELECT_INVERT: - select_function = select_bezier_invert; - break; - default: - return; - } - - /* loop through all of the bezier triples in all - * of the Ipocurves -- if the triple occurs at - * time selx then select it using the selection - * function - */ - for (icu=ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0]==selx){ - select_function(&(icu->bezt[i])); - } - } - } -} - -void select_icu_key(IpoCurve *icu, float selx, int selectmode) -{ - /* Selects all bezier triples in the Ipocurve - * at time selx, using the selection mode. - * This is kind of sloppy the obvious similarities - * with the above function, forgive me ... - */ - int i; - int (*select_function)(BezTriple *); - - /* If the icu is no good then return */ - if (!icu) - return; - - /* Set the selection function based on the - * selection mode. - */ - switch(selectmode) { - case SELECT_ADD: - select_function = select_bezier_add; - break; - case SELECT_SUBTRACT: - select_function = select_bezier_subtract; - break; - case SELECT_INVERT: - select_function = select_bezier_invert; - break; - default: - return; - } - - /* loop through all of the bezier triples in - * the Ipocurve -- if the triple occurs at - * time selx then select it using the selection - * function - */ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0]==selx){ - select_function(&(icu->bezt[i])); - } - } -} - -void set_exprap_ipo(int mode) -{ - EditIpo *ei; - int a; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - /* in case of keys: always ok */ - - ei= G.sipo->editipo; - for(a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - if( (ei->flag & IPO_EDIT) || (ei->flag & IPO_SELECT) || (G.sipo->showkey) ) { - ei->icu->extrap= mode; - } - } - } - - editipo_changed(G.sipo, 1); - BIF_undo_push("Set extrapolation Ipo"); -} diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c deleted file mode 100644 index 5cc193f8844..00000000000 --- a/source/blender/src/editkey.c +++ /dev/null @@ -1,777 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view2d_types.h" - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_editkey.h" -#include "BIF_editview.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_interface.h" - -#include "BSE_editipo.h" -#include "BSE_trans_types.h" - -#include "BDR_editobject.h" - -#include "blendef.h" -#include "mydevice.h" - -extern ListBase editNurb; /* in editcurve.c */ - -/* temporary storage for slider values */ -/* pretty bad static stuff... is secured in drawaction.c though */ -float meshslidervals[256] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; - -static IpoCurve *get_key_icu(Ipo *ipo, int keynum) -{ - /* return the Ipocurve that has the specified - * keynum as ardcode -- return NULL if no such - * curve exists. - */ - IpoCurve *icu; - - if (!ipo) - return NULL; - - for (icu = ipo->curve.first; icu ; icu = icu->next) { - if (!icu->adrcode) continue; - if (icu->adrcode == keynum) return icu; - } - - return NULL; -} - -BezTriple *get_bezt_icu_time(IpoCurve *icu, float *frame, float *val) -{ - /* this function tries to find a bezier that is within - * 0.25 time units from the specified frame. If there - * are more than one such beziers, it returns the - * closest one. - */ - int i; - float d, dmin = 0.25, newframe; - BezTriple *bezt = NULL; - - newframe = *frame; - - for (i=0; itotvert; i++){ - d = fabs(icu->bezt[i].vec[1][0] - *frame); - if (d < dmin) { - dmin = d; - newframe = icu->bezt[i].vec[1][0]; - *val = icu->bezt[i].vec[1][1]; - bezt = icu->bezt + i; - } - } - - *frame = newframe; - return bezt; -} - -static void rvk_slider_func(void *voidob, void *voidkeynum) -{ - /* the callback for the rvk sliders ... copies the - * value from the temporary array into a bezier at the - * right frame on the right ipo curve (creating both the - * ipo curve and the bezier if needed). - */ - Object *ob= voidob; - IpoCurve *icu=NULL; - BezTriple *bezt=NULL; - float cfra, rvkval; - int keynum = (long) voidkeynum; - - cfra = frame_to_float(CFRA); - - /* ipo on action or ob? */ - if(ob->ipoflag & OB_ACTION_KEY) - icu = verify_ipocurve(&ob->id, ID_KE, "Shape", NULL, NULL, keynum); - else - icu = verify_ipocurve(&ob->id, ID_KE, NULL, NULL, NULL, keynum); - - if (icu) { - /* if the ipocurve exists, try to get a bezier - * for this frame - */ - bezt = get_bezt_icu_time(icu, &cfra, &rvkval); - - /* create the bezier triple if one doesn't exist, - * otherwise modify it's value - */ - if (bezt == NULL) { - insert_vert_icu(icu, cfra, meshslidervals[keynum], 0); - } - else { - bezt->vec[1][1] = meshslidervals[keynum]; - } - - /* make sure the Ipo's are properly process and - * redraw as necessary - */ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - - ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else error("Cannot edit this Shape Key"); - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - allspace(REMAKEIPO, 0); -} - -static float getrvkval(Ipo *ipo, int keynum) -{ - /* get the value of the rvk from the - * ipo curve at the current time -- return 0 - * if no ipo curve exists - */ - IpoCurve *icu=NULL; - BezTriple *bezt=NULL; - float rvkval = 0.0; - float cfra; - - cfra = frame_to_float(CFRA); - icu = get_key_icu(ipo, keynum); - if (icu) { - bezt = get_bezt_icu_time(icu, &cfra, &rvkval); - if (!bezt) { - rvkval = eval_icu(icu, cfra); - } - } - - return rvkval; - -} - -void make_rvk_slider(uiBlock *block, Object *ob, int keynum, - int x, int y, int w, int h, char *tip) -{ - /* create a slider for the rvk */ - uiBut *but; - Ipo *ipo= NULL; - Key *key= ob_get_key(ob); - KeyBlock *kb; - float min, max; - int i; - - if(key==NULL) return; - - /* ipo on action or ob? */ - if(ob->ipoflag & OB_ACTION_KEY) { - if(ob->action) { - bActionChannel *achan; - - achan= get_action_channel(ob->action, "Shape"); - if(achan) ipo= achan->ipo; - } - } - else ipo= key->ipo; - - /* global array */ - meshslidervals[keynum] = getrvkval(ipo, keynum); - - kb= key->block.first; - for (i=0; inext; - - if ( (kb->slidermin >= kb->slidermax) ) { - kb->slidermin = 0.0; - kb->slidermax = 1.0; - } - - min = (kb->slidermin < meshslidervals[keynum]) ? - kb->slidermin: meshslidervals[keynum]; - - max = (kb->slidermax > meshslidervals[keynum]) ? - kb->slidermax: meshslidervals[keynum]; - - but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "", - x, y , w, h, - meshslidervals+keynum, min, max, 10, 2, tip); - - uiButSetFunc(but, rvk_slider_func, ob, (void *)(long)keynum); - // no hilite, the winmatrix is not correct later on... - uiButSetFlag(but, UI_NO_HILITE); - -} - -static void default_key_ipo(Key *key) -{ - IpoCurve *icu; - BezTriple *bezt; - - key->ipo= add_ipo("KeyIpo", ID_KE); - - icu= MEM_callocN(sizeof(IpoCurve), "ipocurve"); - - icu->blocktype= ID_KE; - icu->adrcode= KEY_SPEED; - icu->flag= IPO_VISIBLE|IPO_SELECT|IPO_AUTO_HORIZ; - set_icu_vars(icu); - - BLI_addtail( &(key->ipo->curve), icu); - - icu->bezt= bezt= MEM_callocN(2*sizeof(BezTriple), "defaultipo"); - icu->totvert= 2; - - bezt->hide= IPO_BEZ; - bezt->f1=bezt->f2= bezt->f3= SELECT; - bezt->h1= bezt->h2= HD_AUTO; - bezt++; - bezt->vec[1][0]= 100.0; - bezt->vec[1][1]= 1.0; - bezt->hide= IPO_BEZ; - bezt->f1=bezt->f2= bezt->f3= SELECT; - bezt->h1= bezt->h2= HD_AUTO; - - calchandles_ipocurve(icu); -} - - - -/* **************************************** */ - -void mesh_to_key(Mesh *me, KeyBlock *kb) -{ - MVert *mvert; - float *fp; - int a; - - if(me->totvert==0) return; - - if(kb->data) MEM_freeN(kb->data); - - kb->data= MEM_callocN(me->key->elemsize*me->totvert, "kb->data"); - kb->totelem= me->totvert; - - mvert= me->mvert; - fp= kb->data; - for(a=0; atotelem; a++, fp+=3, mvert++) { - VECCOPY(fp, mvert->co); - - } -} - -void key_to_mesh(KeyBlock *kb, Mesh *me) -{ - MVert *mvert; - float *fp; - int a, tot; - - mvert= me->mvert; - fp= kb->data; - - tot= MIN2(kb->totelem, me->totvert); - - for(a=0; aco, fp); - } -} - -static KeyBlock *add_keyblock(Key *key) -{ - KeyBlock *kb; - float curpos= -0.1; - int tot; - - kb= key->block.last; - if(kb) curpos= kb->pos; - - kb= MEM_callocN(sizeof(KeyBlock), "Keyblock"); - BLI_addtail(&key->block, kb); - kb->type= KEY_CARDINAL; - tot= BLI_countlist(&key->block); - if(tot==1) strcpy(kb->name, "Basis"); - else sprintf(kb->name, "Key %d", tot-1); - kb->adrcode= tot-1; - - key->totkey++; - if(key->totkey==1) key->refkey= kb; - - - if(key->type == KEY_RELATIVE) - kb->pos= curpos+0.1; - else { - curpos= bsystem_time(0, (float)CFRA, 0.0); - if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) { - curpos /= 100.0; - } - kb->pos= curpos; - - sort_keys(key); - } - return kb; -} - -void insert_meshkey(Mesh *me, short rel) -{ - Key *key; - KeyBlock *kb; - - if(me->key==NULL) { - me->key= add_key( (ID *)me); - - if(rel) - me->key->type = KEY_RELATIVE; - else - default_key_ipo(me->key); - } - key= me->key; - - kb= add_keyblock(key); - - mesh_to_key(me, kb); -} - -/* ******************** */ - -void latt_to_key(Lattice *lt, KeyBlock *kb) -{ - BPoint *bp; - float *fp; - int a, tot; - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - if(tot==0) return; - - if(kb->data) MEM_freeN(kb->data); - - kb->data= MEM_callocN(lt->key->elemsize*tot, "kb->data"); - kb->totelem= tot; - - bp= lt->def; - fp= kb->data; - for(a=0; atotelem; a++, fp+=3, bp++) { - VECCOPY(fp, bp->vec); - } -} - -void key_to_latt(KeyBlock *kb, Lattice *lt) -{ - BPoint *bp; - float *fp; - int a, tot; - - bp= lt->def; - fp= kb->data; - - tot= lt->pntsu*lt->pntsv*lt->pntsw; - tot= MIN2(kb->totelem, tot); - - for(a=0; avec, fp); - } - -} - -/* exported to python... hrms, should not, use object levels! (ton) */ -void insert_lattkey(Lattice *lt, short rel) -{ - Key *key; - KeyBlock *kb; - - if(lt->key==NULL) { - lt->key= add_key( (ID *)lt); - default_key_ipo(lt->key); - } - key= lt->key; - - kb= add_keyblock(key); - - latt_to_key(lt, kb); -} - -/* ******************************** */ - -void curve_to_key(Curve *cu, KeyBlock *kb, ListBase *nurb) -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - float *fp; - int a, tot; - - /* count */ - tot= count_curveverts(nurb); - if(tot==0) return; - - if(kb->data) MEM_freeN(kb->data); - - kb->data= MEM_callocN(cu->key->elemsize*tot, "kb->data"); - kb->totelem= tot; - - nu= nurb->first; - fp= kb->data; - while(nu) { - - if(nu->bezt) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - VECCOPY(fp, bezt->vec[0]); - fp+= 3; - VECCOPY(fp, bezt->vec[1]); - fp+= 3; - VECCOPY(fp, bezt->vec[2]); - fp+= 3; - fp[0]= bezt->alfa; - fp+= 3; /* alphas */ - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - VECCOPY(fp, bp->vec); - fp[3]= bp->alfa; - - fp+= 4; - bp++; - } - } - nu= nu->next; - } -} - -void key_to_curve(KeyBlock *kb, Curve *cu, ListBase *nurb) -{ - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - float *fp; - int a, tot; - - nu= nurb->first; - fp= kb->data; - - tot= count_curveverts(nurb); - - tot= MIN2(kb->totelem, tot); - - while(nu && tot>0) { - - if(nu->bezt) { - bezt= nu->bezt; - a= nu->pntsu; - while(a-- && tot>0) { - VECCOPY(bezt->vec[0], fp); - fp+= 3; - VECCOPY(bezt->vec[1], fp); - fp+= 3; - VECCOPY(bezt->vec[2], fp); - fp+= 3; - bezt->alfa= fp[0]; - fp+= 3; /* alphas */ - - tot-= 3; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a-- && tot>0) { - VECCOPY(bp->vec, fp); - bp->alfa= fp[3]; - - fp+= 4; - tot--; - bp++; - } - } - nu= nu->next; - } -} - - -void insert_curvekey(Curve *cu, short rel) -{ - Key *key; - KeyBlock *kb; - - if(cu->key==NULL) { - cu->key= add_key( (ID *)cu); - - if (rel) - cu->key->type = KEY_RELATIVE; - else - default_key_ipo(cu->key); - } - key= cu->key; - - kb= add_keyblock(key); - - if(editNurb.first) curve_to_key(cu, kb, &editNurb); - else curve_to_key(cu, kb, &cu->nurb); -} - - -/* ******************** */ - -void insert_shapekey(Object *ob) -{ - if(get_mesh(ob) && get_mesh(ob)->mr) { - error("Cannot create shape keys on a multires mesh."); - } - else { - Key *key; - - if(ob->type==OB_MESH) insert_meshkey(ob->data, 1); - else if ELEM(ob->type, OB_CURVE, OB_SURF) insert_curvekey(ob->data, 1); - else if(ob->type==OB_LATTICE) insert_lattkey(ob->data, 1); - - key= ob_get_key(ob); - ob->shapenr= BLI_countlist(&key->block); - - BIF_undo_push("Add Shapekey"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWBUTSEDIT, 0); - } -} - -void delete_key(Object *ob) -{ - KeyBlock *kb, *rkb; - Key *key; - IpoCurve *icu; - - key= ob_get_key(ob); - if(key==NULL) return; - - kb= BLI_findlink(&key->block, ob->shapenr-1); - - if(kb) { - for(rkb= key->block.first; rkb; rkb= rkb->next) - if(rkb->relative == ob->shapenr-1) - rkb->relative= 0; - - BLI_remlink(&key->block, kb); - key->totkey--; - if(key->refkey== kb) key->refkey= key->block.first; - - if(kb->data) MEM_freeN(kb->data); - MEM_freeN(kb); - - for(kb= key->block.first; kb; kb= kb->next) { - if(kb->adrcode>=ob->shapenr) - kb->adrcode--; - } - - if(key->ipo) { - - for(icu= key->ipo->curve.first; icu; icu= icu->next) { - if(icu->adrcode==ob->shapenr-1) { - BLI_remlink(&key->ipo->curve, icu); - free_ipo_curve(icu); - break; - } - } - for(icu= key->ipo->curve.first; icu; icu= icu->next) - if(icu->adrcode>=ob->shapenr) - icu->adrcode--; - } - - if(ob->shapenr>1) ob->shapenr--; - } - - if(key->totkey==0) { - if(GS(key->from->name)==ID_ME) ((Mesh *)key->from)->key= NULL; - else if(GS(key->from->name)==ID_CU) ((Curve *)key->from)->key= NULL; - else if(GS(key->from->name)==ID_LT) ((Lattice *)key->from)->key= NULL; - - free_libblock_us(&(G.main->key), key); - scrarea_queue_headredraw(curarea); /* ipo remove too */ - } - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - - BIF_undo_push("Delete Shapekey"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); -} - -void move_keys(Object *ob) -{ - Key *key; - KeyBlock *kb; - float div, dy, oldpos, vec[3], dvec[3]; - int afbreek=0, firsttime= 1; - unsigned short event = 0; - short mval[2], val, xo, yo; - char str[32]; - - if(G.sipo->blocktype!=ID_KE) return; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - if(G.sipo->editipo==NULL) return; - - key= ob_get_key(ob); - if(key==NULL) return; - - /* which kb is involved */ - kb= BLI_findlink(&key->block, ob->shapenr-1); - if(kb==NULL) return; - - oldpos= kb->pos; - - getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; - dvec[0]=dvec[1]=dvec[2]= 0.0; - - while(afbreek==0) { - getmouseco_areawin(mval); - if(mval[0]!=xo || mval[1]!=yo || firsttime) { - firsttime= 0; - - dy= (float)(mval[1]- yo); - - div= (float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - dvec[1]+= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div; - - VECCOPY(vec, dvec); - - apply_keyb_grid(vec, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); - apply_keyb_grid(vec+1, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); - - kb->pos= oldpos+vec[1]; - - sprintf(str, "Y: %.3f ", vec[1]); - headerprint(str); - - xo= mval[0]; - yo= mval[1]; - - force_draw(0); - } - else BIF_wait_for_statechange(); - - while(qtest()) { - event= extern_qread(&val); - if(val) { - switch(event) { - case ESCKEY: - case LEFTMOUSE: - case SPACEKEY: - afbreek= 1; - break; - default: - arrows_move_cursor(event); - } - } - } - } - - if(event==ESCKEY) { - kb->pos= oldpos; - } - - sort_keys(key); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - /* for boundbox */ - editipo_changed(G.sipo, 0); - - BIF_undo_push("Move Shapekey(s)"); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - scrarea_queue_redraw(curarea); -} diff --git a/source/blender/src/editlattice.c b/source/blender/src/editlattice.c deleted file mode 100644 index f3073cf886a..00000000000 --- a/source/blender/src/editlattice.c +++ /dev/null @@ -1,323 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * i.t.t. wat de naam doet vermoeden: ook algemene lattice (calc) functies - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_curve_types.h" -#include "DNA_key_types.h" -#include "DNA_lattice_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_lattice.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" - -#include "BIF_editlattice.h" -#include "BIF_editmode_undo.h" -#include "BIF_editkey.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BSE_edit.h" - -#include "BDR_editobject.h" -#include "BDR_drawobject.h" - -#include "blendef.h" -#include "mydevice.h" - -#include "BKE_armature.h" - -/* ***************************** */ - -void free_editLatt(void) -{ - if(editLatt) { - if(editLatt->def) MEM_freeN(editLatt->def); - if(editLatt->dvert) - free_dverts(editLatt->dvert, editLatt->pntsu*editLatt->pntsv*editLatt->pntsw); - - MEM_freeN(editLatt); - editLatt= NULL; - } -} - - -static void setflagsLatt(int flag) -{ - BPoint *bp; - int a; - - bp= editLatt->def; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - while(a--) { - if(bp->hide==0) { - bp->f1= flag; - } - bp++; - } -} - - - -void make_editLatt(void) -{ - Lattice *lt; - KeyBlock *actkey; - - free_editLatt(); - - lt= G.obedit->data; - - actkey = ob_get_keyblock(G.obedit); - if(actkey) { - strcpy(G.editModeTitleExtra, "(Key) "); - key_to_latt(actkey, lt); - } - - editLatt= MEM_dupallocN(lt); - editLatt->def= MEM_dupallocN(lt->def); - - if(lt->dvert) { - int tot= lt->pntsu*lt->pntsv*lt->pntsw; - editLatt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); - copy_dverts(editLatt->dvert, lt->dvert, tot); - } - - BIF_undo_push("original"); -} - - -void load_editLatt(void) -{ - Lattice *lt; - KeyBlock *actkey; - BPoint *bp; - float *fp; - int tot; - - lt= G.obedit->data; - - actkey = ob_get_keyblock(G.obedit); - if(actkey) { - /* active key: vertices */ - tot= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - if(actkey->data) MEM_freeN(actkey->data); - - fp=actkey->data= MEM_callocN(lt->key->elemsize*tot, "actkey->data"); - actkey->totelem= tot; - - bp= editLatt->def; - while(tot--) { - VECCOPY(fp, bp->vec); - fp+= 3; - bp++; - } - } - else { - - MEM_freeN(lt->def); - - lt->def= MEM_dupallocN(editLatt->def); - - lt->flag= editLatt->flag; - - lt->pntsu= editLatt->pntsu; - lt->pntsv= editLatt->pntsv; - lt->pntsw= editLatt->pntsw; - - lt->typeu= editLatt->typeu; - lt->typev= editLatt->typev; - lt->typew= editLatt->typew; - } - - if(lt->dvert) { - free_dverts(lt->dvert, lt->pntsu*lt->pntsv*lt->pntsw); - lt->dvert= NULL; - } - - if(editLatt->dvert) { - int tot= lt->pntsu*lt->pntsv*lt->pntsw; - - lt->dvert = MEM_mallocN (sizeof (MDeformVert)*tot, "Lattice MDeformVert"); - copy_dverts(lt->dvert, editLatt->dvert, tot); - } - -} - -void remake_editLatt(void) -{ - if(okee("Reload original data")==0) return; - - make_editLatt(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Reload original"); -} - - -void deselectall_Latt(void) -{ - BPoint *bp; - int a; - - bp= editLatt->def; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - allqueue(REDRAWVIEW3D, 0); - - while(a--) { - if(bp->hide==0) { - if(bp->f1) { - setflagsLatt(0); - countall(); - BIF_undo_push("(De)select all"); - return; - } - } - bp++; - } - setflagsLatt(1); - countall(); - BIF_undo_push("(De)select all"); -} - -static void findnearestLattvert__doClosest(void *userData, BPoint *bp, int x, int y) -{ - struct { BPoint *bp; short dist, select, mval[2]; } *data = userData; - float temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - - if ((bp->f1 & SELECT)==data->select) temp += 5; - if (tempdist) { - data->dist = temp; - - data->bp = bp; - } -} -static BPoint *findnearestLattvert(int sel) -{ - /* sel==1: selected gets a disadvantage */ - /* in nurb and bezt or bp the nearest is written */ - /* return 0 1 2: handlepunt */ - struct { BPoint *bp; short dist, select, mval[2]; } data = {0}; - - data.dist = 100; - data.select = sel; - getmouseco_areawin(data.mval); - - lattice_foreachScreenVert(findnearestLattvert__doClosest, &data); - - return data.bp; -} - - -void mouse_lattice(void) -{ - BPoint *bp=0; - - bp= findnearestLattvert(1); - - if(bp) { - if((G.qual & LR_SHIFTKEY)==0) { - - setflagsLatt(0); - bp->f1 |= SELECT; - - allqueue(REDRAWVIEW3D, 0); - } - else { - bp->f1 ^= SELECT; /* swap */ - allqueue(REDRAWVIEW3D, 0); - } - - countall(); - BIF_undo_push("Select"); - } - - rightmouse_transform(); - -} - - -/* **************** undo for lattice object ************** */ - -static void undoLatt_to_editLatt(void *defv) -{ - int a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - - memcpy(editLatt->def, defv, a*sizeof(BPoint)); -} - -static void *editLatt_to_undoLatt(void) -{ - - return MEM_dupallocN(editLatt->def); -} - -static void free_undoLatt(void *defv) -{ - MEM_freeN(defv); -} - -/* and this is all the undo system needs to know */ -void undo_push_lattice(char *name) -{ - undo_editmode_push(name, free_undoLatt, undoLatt_to_editLatt, editLatt_to_undoLatt); -} - - - -/***/ diff --git a/source/blender/src/editmball.c b/source/blender/src/editmball.c deleted file mode 100644 index 71fbf834c17..00000000000 --- a/source/blender/src/editmball.c +++ /dev/null @@ -1,544 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_rand.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_object.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" -#include "BIF_editmode_undo.h" -#include "BIF_transform.h" - -#include "BDR_editobject.h" -#include "BDR_editmball.h" - -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "blendef.h" -#include "mydevice.h" - -extern short editbutflag; - -ListBase editelems= {0, 0}; -MetaElem *lastelem; - -/* this function is called, when MetaBall Object is - * switched from object mode to edit mode */ -void make_editMball() -{ - MetaBall *mb; - MetaElem *ml, *newmb; - - BLI_freelistN(&editelems); - lastelem= 0; - - mb= G.obedit->data; - ml= mb->elems.first; - - while(ml) { - newmb= MEM_dupallocN(ml); - BLI_addtail(&editelems, newmb); - if(ml->flag & SELECT) lastelem= newmb; - - ml= ml->next; - } - - allqueue(REDRAWBUTSEDIT, 0); - - countall(); -} - -/* this function is called, when MetaBall Object switched from - * edit mode to object mode. List od MetaElements is copied - * from editelems to to object->data structure (mb->elems) */ -void load_editMball() -{ - /* load mball in object */ - MetaBall *mb; - MetaElem *ml, *newml; - - if(G.obedit==NULL) return; - - mb= G.obedit->data; - BLI_freelistN(&(mb->elems)); - - - ml= editelems.first; - while(ml) { - newml= MEM_dupallocN(ml); - BLI_addtail(&(mb->elems), newml); - - ml= ml->next; - } -} - -/* add new MetaElement primitive */ -void add_primitiveMball(int dummy_argument) -{ - MetaElem *ml; - float *curs, mat[3][3], cent[3], imat[3][3], cmat[3][3]; - short newob= 0; - - if(G.scene->id.lib) return; - - /* this function also comes from an info window */ - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - - check_editmode(OB_MBALL); - - /* if no obedit: new object and enter editmode */ - if(G.obedit==NULL) { - add_object_draw(OB_MBALL); - base_init_from_view3d(BASACT, G.vd); - G.obedit= BASACT->object; - - where_is_object(G.obedit); // need now, for imat - - make_editMball(); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - newob= 1; - } - - /* deselect */ - ml= editelems.first; - while(ml) { - ml->flag &= ~SELECT; - ml= ml->next; - } - - /* imat and center and size */ - Mat3CpyMat4(mat, G.obedit->obmat); - - curs= give_cursor(); - VECCOPY(cent, curs); - cent[0]-= G.obedit->obmat[3][0]; - cent[1]-= G.obedit->obmat[3][1]; - cent[2]-= G.obedit->obmat[3][2]; - - if (G.vd) { - Mat3CpyMat4(imat, G.vd->viewmat); - Mat3MulVecfl(imat, cent); - Mat3MulMat3(cmat, imat, mat); - Mat3Inv(imat,cmat); - - Mat3MulVecfl(imat, cent); - } - - ml= MEM_callocN(sizeof(MetaElem), "metaelem"); - BLI_addtail(&editelems, ml); - - ml->x= cent[0]; - ml->y= cent[1]; - ml->z= cent[2]; - ml->quat[0]= 1.0; - ml->quat[1]= 0.0; - ml->quat[2]= 0.0; - ml->quat[3]= 0.0; - ml->rad= 2.0; - ml->s= 2.0; - ml->flag= SELECT | MB_SCALE_RAD; - - switch(dummy_argument) { - case 1: - ml->type = MB_BALL; - ml->expx= ml->expy= ml->expz= 1.0; - break; - case 2: - ml->type = MB_TUBE; - ml->expx= ml->expy= ml->expz= 1.0; - break; - case 3: - ml->type = MB_PLANE; - ml->expx= ml->expy= ml->expz= 1.0; - break; - case 4: - ml->type = MB_ELIPSOID; - ml->expx= 1.2f; - ml->expy= 0.8f; - ml->expz= 1.0; - break; - case 5: - ml->type = MB_CUBE; - ml->expx= ml->expy= ml->expz= 1.0; - break; - default: - break; - } - - lastelem= ml; - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); // added ball can influence others - - countall(); - - /* if a new object was created, it stores it in Mball, for reload original data and undo */ - if ( !(newob) || (U.flag & USER_ADD_EDITMODE)) { - if(newob) load_editMball(); - } else { - exit_editmode(2); - } - - allqueue(REDRAWALL, 0); - BIF_undo_push("Add MetaElem"); -} - -/* deselect all MetaElements */ -void deselectall_mball() -{ - MetaElem *ml; - int sel= 0; - - ml= editelems.first; - while(ml) { - if(ml->flag & SELECT) break; - ml= ml->next; - } - - if(ml) sel= 1; - - ml= editelems.first; - while(ml) { - if(sel) ml->flag &= ~SELECT; - else ml->flag |= SELECT; - ml= ml->next; - } - - allqueue(REDRAWVIEW3D, 0); - countall(); - BIF_undo_push("Deselect MetaElem"); -} - -/* inverts metaball selection */ -void selectinverse_mball() -{ - MetaElem *ml; - - ml= editelems.first; - while(ml) { - if(ml->flag & SELECT) ml->flag &= ~SELECT; - else ml->flag |= SELECT; - ml= ml->next; - } - - allqueue(REDRAWVIEW3D, 0); - countall(); - BIF_undo_push("Invert MetaElem"); -} - -/* select random metaball selection */ -void selectrandom_mball() -{ - MetaElem *ml; - static short randfac= 50; - - if(!button(&randfac,0, 100,"Percentage:")) return; - - ml= editelems.first; - BLI_srand( BLI_rand() ); /* random seed */ - while(ml) { - if((BLI_frand() * 100) < randfac) ml->flag |= SELECT; - ml= ml->next; - } - - allqueue(REDRAWVIEW3D, 0); - countall(); - BIF_undo_push("Random MetaElem"); -} - -/* select MetaElement with mouse click (user can select radius circle or - * stiffness circle) */ -void mouse_mball() -{ - static MetaElem *startelem=0; - MetaElem *ml, *act=0; - int a, hits; - unsigned int buffer[MAXPICKBUF]; - - hits= view3d_opengl_select(buffer, MAXPICKBUF, 0, 0, 0, 0); - - /* does startelem exist? */ - ml= editelems.first; - while(ml) { - if(ml==startelem) break; - ml= ml->next; - } - if(ml==NULL) startelem= editelems.first; - - if(hits>0) { - ml= startelem; - while(ml) { - - for(a=0; aselcol1==buffer[ 4 * a + 3 ]){ - ml->flag |= MB_SCALE_RAD; - act= ml; - } - if(ml->selcol2==buffer[ 4 * a + 3 ]){ - ml->flag &= ~MB_SCALE_RAD; - act= ml; - } - - } - - if(act) break; - - ml= ml->next; - if(ml==NULL) ml= editelems.first; - if(ml==startelem) break; - } - if(act) { - if((G.qual & LR_SHIFTKEY)==0) { - deselectall_mball(); - if(act->flag & SELECT) deselectall_mball(); - act->flag |= SELECT; - } - else { - if(act->flag & SELECT) { - act->flag &= ~SELECT; - } - else act->flag |= SELECT; - } - lastelem= act; - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } - - allqueue(REDRAWBUTSOBJECT, 0); - countall(); - rightmouse_transform(); -} - -/* duplicate selected MetaElements */ -void adduplicate_mball() -{ - MetaElem *ml, *newml; - - ml= editelems.last; - while(ml) { - if(ml->flag & SELECT) { - newml= MEM_dupallocN(ml); - BLI_addtail(&editelems, newml); - lastelem= newml; - ml->flag &= ~SELECT; - } - ml= ml->prev; - } - - BIF_TransformSetUndo("Add Duplicate"); - countall(); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); - allqueue(REDRAWBUTSEDIT, 0); -} - -/* Delete all selected MetaElems (not MetaBall) */ -void delete_mball() -{ - MetaElem *ml, *next; - - if(okee("Erase selected")==0) return; - - ml= editelems.first; - while(ml) { - next= ml->next; - if(ml->flag & SELECT) { - if(lastelem==ml) lastelem= 0; - BLI_remlink(&editelems, ml); - MEM_freeN(ml); - } - ml= next; - } - - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - countall(); - BIF_undo_push("Delete MetaElem"); -} - -/* free all MetaElems from ListBase */ -void freeMetaElemlist(ListBase *lb) -{ - MetaElem *ml, *next; - - if(lb==NULL) return; - - ml= lb->first; - while(ml){ - next= ml->next; - BLI_remlink(lb, ml); - MEM_freeN(ml); - ml= next; - } - - lb->first= lb->last= NULL; - -} - -/* ************* undo for MetaBalls ************* */ - -static void undoMball_to_editMball(void *lbv) -{ - ListBase *lb= lbv; - MetaElem *ml, *newml; - unsigned int nr, lastmlnr= 0; - - /* we try to restore lastelem, which used in for example in button window */ - for(ml= editelems.first; ml; ml= ml->next, lastmlnr++) - if(lastelem==ml) break; - - freeMetaElemlist(&editelems); - - /* copy 'undo' MetaElems to 'edit' MetaElems */ - ml= lb->first; - while(ml){ - newml= MEM_dupallocN(ml); - BLI_addtail(&editelems, newml); - ml= ml->next; - } - - for(nr=0, lastelem= editelems.first; lastelem; lastelem= lastelem->next, nr++) - if(nr==lastmlnr) break; - - countall(); -} - -static void *editMball_to_undoMball(void) -{ - ListBase *lb; - MetaElem *ml, *newml; - - /* allocate memory for undo ListBase */ - lb= MEM_callocN(sizeof(ListBase), "listbase undo"); - lb->first= lb->last= NULL; - - /* copy contents of current ListBase to the undo ListBase */ - ml= editelems.first; - while(ml){ - newml= MEM_dupallocN(ml); - BLI_addtail(lb, newml); - ml= ml->next; - } - - return lb; -} - -/* free undo ListBase of MetaElems */ -static void free_undoMball(void *lbv) -{ - ListBase *lb= lbv; - - freeMetaElemlist(lb); - MEM_freeN(lb); -} - -/* this is undo system for MetaBalls */ -void undo_push_mball(char *name) -{ - undo_editmode_push(name, free_undoMball, undoMball_to_editMball, editMball_to_undoMball); -} - -/* Hide selected/unselected MetaElems */ -void hide_mball(char hide) -{ - MetaElem *ml; - - ml= editelems.first; - - while(ml){ - if(hide){ - if(!(ml->flag & SELECT)) - ml->flag |= MB_HIDE; - } - else{ - if(ml->flag & SELECT) - ml->flag |= MB_HIDE; - } - ml= ml->next; - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - countall(); - BIF_undo_push("Hide MetaElems"); -} - -/* Unhide all edited MetaElems */ -void reveal_mball(void) -{ - MetaElem *ml; - - ml= editelems.first; - - while(ml){ - ml->flag &= ~MB_HIDE; - ml= ml->next; - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - countall(); - BIF_undo_push("Unhide MetaElems"); -} - diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c deleted file mode 100644 index 15f4e652490..00000000000 --- a/source/blender/src/editmesh.c +++ /dev/null @@ -1,2205 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "DNA_customdata_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_screen_types.h" -#include "DNA_key_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_material_types.h" -#include "DNA_modifier_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_dynstr.h" -#include "BLI_rand.h" - -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_editkey.h" -#include "BIF_editmesh.h" -#include "BIF_editmode_undo.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_retopo.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BSE_view.h" -#include "BSE_edit.h" -#include "BSE_trans_types.h" - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "BDR_editface.h" -#include "BDR_vpaint.h" - -#include "LBM_fluidsim.h" - -#include "multires.h" -#include "mydevice.h" -#include "blendef.h" - -/* own include */ -#include "editmesh.h" - -/* - -editmesh.c: -- add/alloc/free data -- hashtables -- enter/exit editmode - -*/ - - -/* ***************** HASH ********************* */ - - -#define EDHASHSIZE (512*512) -#define EDHASH(a, b) (a % EDHASHSIZE) - - -/* ************ ADD / REMOVE / FIND ****************** */ - -/* used to bypass normal calloc with fast one */ -static void *(*callocvert)(size_t, size_t) = calloc; -static void *(*callocedge)(size_t, size_t) = calloc; -static void *(*callocface)(size_t, size_t) = calloc; - -EditVert *addvertlist(float *vec, EditVert *example) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - static int hashnr= 0; - - eve= callocvert(sizeof(EditVert), 1); - BLI_addtail(&em->verts, eve); - - if(vec) VECCOPY(eve->co, vec); - - eve->hash= hashnr++; - if( hashnr>=EDHASHSIZE) hashnr= 0; - - /* new verts get keyindex of -1 since they did not - * have a pre-editmode vertex order - */ - eve->keyindex = -1; -#ifdef WITH_VERSE - createVerseVert(eve); -#endif - - if(example) - CustomData_em_copy_data(&em->vdata, &em->vdata, example->data, &eve->data); - else - CustomData_em_set_default(&em->vdata, &eve->data); - - return eve; -} - -void free_editvert (EditVert *eve) -{ -#ifdef WITH_VERSE - if(eve->vvert) { - /* it prevents from removing all verse vertexes - * during entering edit mode ... messy solution */ - if(G.editMesh->vnode) - b_verse_send_vertex_delete(eve); - else - ((VerseVert*)eve->vvert)->vertex = NULL; - } -#endif - - EM_remove_selection(eve, EDITVERT); - CustomData_em_free_block(&G.editMesh->vdata, &eve->data); - if(eve->fast==0) - free(eve); -} - - -EditEdge *findedgelist(EditVert *v1, EditVert *v2) -{ - EditVert *v3; - struct HashEdge *he; - - /* swap ? */ - if( v1 > v2) { - v3= v2; - v2= v1; - v1= v3; - } - - if(G.editMesh->hashedgetab==NULL) - G.editMesh->hashedgetab= MEM_callocN(EDHASHSIZE*sizeof(struct HashEdge), "hashedgetab"); - - he= G.editMesh->hashedgetab + EDHASH(v1->hash, v2->hash); - - while(he) { - - if(he->eed && he->eed->v1==v1 && he->eed->v2==v2) return he->eed; - - he= he->next; - } - return 0; -} - -static void insert_hashedge(EditEdge *eed) -{ - /* assuming that eed is not in the list yet, and that a find has been done before */ - - struct HashEdge *first, *he; - - first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash); - - if( first->eed==0 ) { - first->eed= eed; - } - else { - he= &eed->hash; - he->eed= eed; - he->next= first->next; - first->next= he; - } -} - -static void remove_hashedge(EditEdge *eed) -{ - /* assuming eed is in the list */ - - struct HashEdge *first, *he, *prev=NULL; - - he=first= G.editMesh->hashedgetab + EDHASH(eed->v1->hash, eed->v2->hash); - - while(he) { - if(he->eed == eed) { - /* remove from list */ - if(he==first) { - if(first->next) { - he= first->next; - first->eed= he->eed; - first->next= he->next; - } - else he->eed= 0; - } - else { - prev->next= he->next; - } - return; - } - prev= he; - he= he->next; - } -} - -EditEdge *addedgelist(EditVert *v1, EditVert *v2, EditEdge *example) -{ - EditMesh *em = G.editMesh; - EditVert *v3; - EditEdge *eed; - int swap= 0; - - if(v1==v2) return NULL; - if(v1==NULL || v2==NULL) return NULL; - - /* swap ? */ - if(v1>v2) { - v3= v2; - v2= v1; - v1= v3; - swap= 1; - } - - /* find in hashlist */ - eed= findedgelist(v1, v2); - - if(eed==NULL) { - - eed= (EditEdge *)callocedge(sizeof(EditEdge), 1); - eed->v1= v1; - eed->v2= v2; - BLI_addtail(&em->edges, eed); - eed->dir= swap; - insert_hashedge(eed); - - /* copy edge data: - rule is to do this with addedgelist call, before addfacelist */ - if(example) { - eed->crease= example->crease; - eed->sharp = example->sharp; - eed->seam = example->seam; - eed->h |= (example->h & EM_FGON); - } - } - - return eed; -} - -void remedge(EditEdge *eed) -{ - EditMesh *em = G.editMesh; - - BLI_remlink(&em->edges, eed); - remove_hashedge(eed); -} - -void free_editedge(EditEdge *eed) -{ - EM_remove_selection(eed, EDITEDGE); - if(eed->fast==0){ - free(eed); - } -} - -void free_editface(EditFace *efa) -{ -#ifdef WITH_VERSE - if(efa->vface) { - /* it prevents from removing all verse faces - * during entering edit mode ... messy solution */ - if(G.editMesh->vnode) - b_verse_send_face_delete(efa); - else - ((VerseFace*)efa->vface)->face = NULL; - } -#endif - EM_remove_selection(efa, EDITFACE); - - if (G.editMesh->act_face==efa) - EM_set_actFace(NULL); - - CustomData_em_free_block(&G.editMesh->fdata, &efa->data); - if(efa->fast==0) - free(efa); -} - -void free_vertlist(ListBase *edve) -{ - EditVert *eve, *next; - - if (!edve) return; - - eve= edve->first; - while(eve) { - next= eve->next; - free_editvert(eve); - eve= next; - } - edve->first= edve->last= NULL; -} - -void free_edgelist(ListBase *lb) -{ - EditEdge *eed, *next; - - eed= lb->first; - while(eed) { - next= eed->next; - free_editedge(eed); - eed= next; - } - lb->first= lb->last= NULL; -} - -void free_facelist(ListBase *lb) -{ - EditFace *efa, *next; - - efa= lb->first; - while(efa) { - next= efa->next; - free_editface(efa); - efa= next; - } - lb->first= lb->last= NULL; -} - -EditFace *addfacelist(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, EditFace *example, EditFace *exampleEdges) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditEdge *e1, *e2=0, *e3=0, *e4=0; - - /* added sanity check... seems to happen for some tools, or for enter editmode for corrupted meshes */ - if(v1==v4 || v2==v4 || v3==v4) v4= NULL; - - /* add face to list and do the edges */ - if(exampleEdges) { - e1= addedgelist(v1, v2, exampleEdges->e1); - e2= addedgelist(v2, v3, exampleEdges->e2); - if(v4) e3= addedgelist(v3, v4, exampleEdges->e3); - else e3= addedgelist(v3, v1, exampleEdges->e3); - if(v4) e4= addedgelist(v4, v1, exampleEdges->e4); - } - else { - e1= addedgelist(v1, v2, NULL); - e2= addedgelist(v2, v3, NULL); - if(v4) e3= addedgelist(v3, v4, NULL); - else e3= addedgelist(v3, v1, NULL); - if(v4) e4= addedgelist(v4, v1, NULL); - } - - if(v1==v2 || v2==v3 || v1==v3) return NULL; - if(e2==0) return NULL; - - efa= (EditFace *)callocface(sizeof(EditFace), 1); - efa->v1= v1; - efa->v2= v2; - efa->v3= v3; - efa->v4= v4; - - efa->e1= e1; - efa->e2= e2; - efa->e3= e3; - efa->e4= e4; - - if(example) { - efa->mat_nr= example->mat_nr; - efa->flag= example->flag; - CustomData_em_copy_data(&em->fdata, &em->fdata, example->data, &efa->data); - } - else { - if (G.obedit && G.obedit->actcol) - efa->mat_nr= G.obedit->actcol-1; - - CustomData_em_set_default(&em->fdata, &efa->data); - } - - BLI_addtail(&em->faces, efa); - - if(efa->v4) { - CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n); - CalcCent4f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co); - } - else { - CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n); - CalcCent3f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co); - } - -#ifdef WITH_VERSE - createVerseFace(efa); -#endif - - return efa; -} - -/* ************************ end add/new/find ************ */ - -/* ************************ Edit{Vert,Edge,Face} utilss ***************************** */ - -/* some nice utility functions */ - -EditVert *editedge_getOtherVert(EditEdge *eed, EditVert *eve) -{ - if (eve==eed->v1) { - return eed->v2; - } else if (eve==eed->v2) { - return eed->v1; - } else { - return NULL; - } -} - -EditVert *editedge_getSharedVert(EditEdge *eed, EditEdge *eed2) -{ - if (eed->v1==eed2->v1 || eed->v1==eed2->v2) { - return eed->v1; - } else if (eed->v2==eed2->v1 || eed->v2==eed2->v2) { - return eed->v2; - } else { - return NULL; - } -} - -int editedge_containsVert(EditEdge *eed, EditVert *eve) -{ - return (eed->v1==eve || eed->v2==eve); -} - -int editface_containsVert(EditFace *efa, EditVert *eve) -{ - return (efa->v1==eve || efa->v2==eve || efa->v3==eve || (efa->v4 && efa->v4==eve)); -} - -int editface_containsEdge(EditFace *efa, EditEdge *eed) -{ - return (efa->e1==eed || efa->e2==eed || efa->e3==eed || (efa->e4 && efa->e4==eed)); -} - - -/* ************************ stuct EditMesh manipulation ***************************** */ - -/* fake callocs for fastmalloc below */ -static void *calloc_fastvert(size_t size, size_t nr) -{ - EditVert *eve= G.editMesh->curvert++; - eve->fast= 1; - return eve; -} -static void *calloc_fastedge(size_t size, size_t nr) -{ - EditEdge *eed= G.editMesh->curedge++; - eed->fast= 1; - return eed; -} -static void *calloc_fastface(size_t size, size_t nr) -{ - EditFace *efa= G.editMesh->curface++; - efa->fast= 1; - return efa; -} - -/* allocate 1 chunk for all vertices, edges, faces. These get tagged to - prevent it from being freed -*/ -static void init_editmesh_fastmalloc(EditMesh *em, int totvert, int totedge, int totface) -{ - if(totvert) em->allverts= MEM_callocN(totvert*sizeof(EditVert), "allverts"); - else em->allverts= NULL; - em->curvert= em->allverts; - - if(totedge==0) totedge= 4*totface; // max possible - - if(totedge) em->alledges= MEM_callocN(totedge*sizeof(EditEdge), "alledges"); - else em->alledges= NULL; - em->curedge= em->alledges; - - if(totface) em->allfaces= MEM_callocN(totface*sizeof(EditFace), "allfaces"); - else em->allfaces= NULL; - em->curface= em->allfaces; - - callocvert= calloc_fastvert; - callocedge= calloc_fastedge; - callocface= calloc_fastface; -} - -static void end_editmesh_fastmalloc(void) -{ - callocvert= calloc; - callocedge= calloc; - callocface= calloc; -} - -void free_editMesh(EditMesh *em) -{ -#ifdef WITH_VERSE - struct VNode *vnode=NULL; -#endif - if(em==NULL) return; - -#ifdef WITH_VERSE - if(em->vnode) { - vnode = (VNode*)em->vnode; - em->vnode = NULL; - } -#endif - - if(em->verts.first) free_vertlist(&em->verts); - if(em->edges.first) free_edgelist(&em->edges); - if(em->faces.first) free_facelist(&em->faces); - if(em->selected.first) BLI_freelistN(&(em->selected)); - - CustomData_free(&em->vdata, 0); - CustomData_free(&em->fdata, 0); - - if(em->derivedFinal) { - if (em->derivedFinal!=em->derivedCage) { - em->derivedFinal->needsFree= 1; - em->derivedFinal->release(em->derivedFinal); - } - em->derivedFinal= NULL; - } - if(em->derivedCage) { - em->derivedCage->needsFree= 1; - em->derivedCage->release(em->derivedCage); - em->derivedCage= NULL; - } - -#ifdef WITH_VERSE - if(vnode) { - em->vnode = (void*)vnode; - } -#endif - - /* DEBUG: hashtabs are slowest part of enter/exit editmode. here a testprint */ -#if 0 - if(em->hashedgetab) { - HashEdge *he, *hen; - int a, used=0, max=0, nr; - he= em->hashedgetab; - for(a=0; aeed) used++; - hen= he->next; - nr= 0; - while(hen) { - nr++; - hen= hen->next; - } - if(maxhashedgetab) MEM_freeN(em->hashedgetab); - em->hashedgetab= NULL; - - if(em->allverts) MEM_freeN(em->allverts); - if(em->alledges) MEM_freeN(em->alledges); - if(em->allfaces) MEM_freeN(em->allfaces); - - em->allverts= em->curvert= NULL; - em->alledges= em->curedge= NULL; - em->allfaces= em->curface= NULL; - - mesh_octree_table(NULL, NULL, 'e'); - - G.totvert= G.totface= 0; - - if(em->retopo_paint_data) retopo_free_paint_data(em->retopo_paint_data); - em->retopo_paint_data= NULL; -} - -/* on G.editMesh */ -static void editMesh_set_hash(void) -{ - EditEdge *eed; - - G.editMesh->hashedgetab= NULL; - - for(eed=G.editMesh->edges.first; eed; eed= eed->next) { - if( findedgelist(eed->v1, eed->v2)==NULL ) - insert_hashedge(eed); - } - -} - - -/* ************************ IN & OUT EDITMODE ***************************** */ - - -static void edge_normal_compare(EditEdge *eed, EditFace *efa1) -{ - EditFace *efa2; - float cent1[3], cent2[3]; - float inp; - - efa2 = eed->tmp.f; - if(efa1==efa2) return; - - inp= efa1->n[0]*efa2->n[0] + efa1->n[1]*efa2->n[1] + efa1->n[2]*efa2->n[2]; - if(inp<0.999 && inp >-0.999) eed->f2= 1; - - if(efa1->v4) CalcCent4f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co, efa1->v4->co); - else CalcCent3f(cent1, efa1->v1->co, efa1->v2->co, efa1->v3->co); - if(efa2->v4) CalcCent4f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co, efa2->v4->co); - else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co); - - VecSubf(cent1, cent2, cent1); - Normalize(cent1); - inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2]; - - if(inp < -0.001 ) eed->f1= 1; -} - -#if 0 -typedef struct { - EditEdge *eed; - float noLen,no[3]; - int adjCount; -} EdgeDrawFlagInfo; - -static int edgeDrawFlagInfo_cmp(const void *av, const void *bv) -{ - const EdgeDrawFlagInfo *a = av; - const EdgeDrawFlagInfo *b = bv; - - if (a->noLennoLen) return -1; - else if (a->noLen>b->noLen) return 1; - else return 0; -} -#endif - -static void edge_drawflags(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed, *e1, *e2, *e3, *e4; - EditFace *efa; - - /* - count number of times edges are used in faces: 0 en 1 time means draw edge - * - edges more than 1 time used: in *tmp.f is pointer to first face - * - check all faces, when normal differs to much: draw (flag becomes 1) - */ - - /* later on: added flags for 'cylinder' and 'sphere' intersection tests in old - game engine (2.04) - */ - - recalc_editnormals(); - - /* init */ - eve= em->verts.first; - while(eve) { - eve->f1= 1; /* during test it's set at zero */ - eve= eve->next; - } - eed= em->edges.first; - while(eed) { - eed->f2= eed->f1= 0; - eed->tmp.f = 0; - eed= eed->next; - } - - efa= em->faces.first; - while(efa) { - e1= efa->e1; - e2= efa->e2; - e3= efa->e3; - e4= efa->e4; - if(e1->f2<4) e1->f2+= 1; - if(e2->f2<4) e2->f2+= 1; - if(e3->f2<4) e3->f2+= 1; - if(e4 && e4->f2<4) e4->f2+= 1; - - if(e1->tmp.f == 0) e1->tmp.f = (void *) efa; - if(e2->tmp.f == 0) e2->tmp.f = (void *) efa; - if(e3->tmp.f ==0) e3->tmp.f = (void *) efa; - if(e4 && (e4->tmp.f == 0)) e4->tmp.f = (void *) efa; - - efa= efa->next; - } - - if(G.f & G_ALLEDGES) { - efa= em->faces.first; - while(efa) { - if(efa->e1->f2>=2) efa->e1->f2= 1; - if(efa->e2->f2>=2) efa->e2->f2= 1; - if(efa->e3->f2>=2) efa->e3->f2= 1; - if(efa->e4 && efa->e4->f2>=2) efa->e4->f2= 1; - - efa= efa->next; - } - } - else { - - /* handle single-edges for 'test cylinder flag' (old engine) */ - - eed= em->edges.first; - while(eed) { - if(eed->f2==1) eed->f1= 1; - eed= eed->next; - } - - /* all faces, all edges with flag==2: compare normal */ - efa= em->faces.first; - while(efa) { - if(efa->e1->f2==2) edge_normal_compare(efa->e1, efa); - else efa->e1->f2= 1; - if(efa->e2->f2==2) edge_normal_compare(efa->e2, efa); - else efa->e2->f2= 1; - if(efa->e3->f2==2) edge_normal_compare(efa->e3, efa); - else efa->e3->f2= 1; - if(efa->e4) { - if(efa->e4->f2==2) edge_normal_compare(efa->e4, efa); - else efa->e4->f2= 1; - } - efa= efa->next; - } - - /* sphere collision flag */ - - eed= em->edges.first; - while(eed) { - if(eed->f1!=1) { - eed->v1->f1= eed->v2->f1= 0; - } - eed= eed->next; - } - - } -} - -/* turns Mesh into editmesh */ -void make_editMesh() -{ - Mesh *me= G.obedit->data; - EditMesh *em= G.editMesh; - MFace *mface; - MVert *mvert; - MSelect *mselect; - KeyBlock *actkey; - EditVert *eve, **evlist, *eve1, *eve2, *eve3, *eve4; - EditFace *efa; - EditEdge *eed; - EditSelection *ese; - int tot, a, eekadoodle= 0; - -#ifdef WITH_VERSE - if(me->vnode){ - create_edit_mesh_from_geom_node(me->vnode); - return; - } -#endif - - /* because of reload */ - free_editMesh(em); - - em->act_face = NULL; - G.totvert= tot= me->totvert; - G.totedge= me->totedge; - G.totface= me->totface; - - if(tot==0) { - countall(); - return; - } - - /* initialize fastmalloc for editmesh */ - init_editmesh_fastmalloc(em, me->totvert, me->totedge, me->totface); - - actkey = ob_get_keyblock(G.obedit); - if(actkey) { - strcpy(G.editModeTitleExtra, "(Key) "); - key_to_mesh(actkey, me); - tot= actkey->totelem; - } - - /* make editverts */ - CustomData_copy(&me->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0); - mvert= me->mvert; - - evlist= (EditVert **)MEM_mallocN(tot*sizeof(void *),"evlist"); - for(a=0; aco, NULL); - evlist[a]= eve; - - // face select sets selection in next loop - if( (FACESEL_PAINT_TEST)==0 ) - eve->f |= (mvert->flag & 1); - - if (mvert->flag & ME_HIDE) eve->h= 1; - eve->no[0]= mvert->no[0]/32767.0; - eve->no[1]= mvert->no[1]/32767.0; - eve->no[2]= mvert->no[2]/32767.0; - - /* lets overwrite the keyindex of the editvert - * with the order it used to be in before - * editmode - */ - eve->keyindex = a; - - CustomData_to_em_block(&me->vdata, &em->vdata, a, &eve->data); - } - - if(actkey && actkey->totelem!=me->totvert); - else { - MEdge *medge= me->medge; - - CustomData_copy(&me->edata, &em->edata, CD_MASK_EDITMESH, CD_CALLOC, 0); - /* make edges */ - for(a=0; atotedge; a++, medge++) { - eed= addedgelist(evlist[medge->v1], evlist[medge->v2], NULL); - /* eed can be zero when v1 and v2 are identical, dxf import does this... */ - if(eed) { - eed->crease= ((float)medge->crease)/255.0; - - if(medge->flag & ME_SEAM) eed->seam= 1; - if(medge->flag & ME_SHARP) eed->sharp = 1; - if(medge->flag & SELECT) eed->f |= SELECT; - if(medge->flag & ME_FGON) eed->h= EM_FGON; // 2 different defines! - if(medge->flag & ME_HIDE) eed->h |= 1; - if(G.scene->selectmode==SCE_SELECT_EDGE) - EM_select_edge(eed, eed->f & SELECT); // force edge selection to vertices, seems to be needed ... - CustomData_to_em_block(&me->edata,&em->edata, a, &eed->data); - } - } - - CustomData_copy(&me->fdata, &em->fdata, CD_MASK_EDITMESH, CD_CALLOC, 0); - - /* make faces */ - mface= me->mface; - - for(a=0; atotface; a++, mface++) { - eve1= evlist[mface->v1]; - eve2= evlist[mface->v2]; - if(!mface->v3) eekadoodle= 1; - eve3= evlist[mface->v3]; - if(mface->v4) eve4= evlist[mface->v4]; else eve4= NULL; - - efa= addfacelist(eve1, eve2, eve3, eve4, NULL, NULL); - - if(efa) { - CustomData_to_em_block(&me->fdata, &em->fdata, a, &efa->data); - - efa->mat_nr= mface->mat_nr; - efa->flag= mface->flag & ~ME_HIDE; - - /* select and hide face flag */ - if(mface->flag & ME_FACE_SEL) { - efa->f |= SELECT; - } - if(mface->flag & ME_HIDE) efa->h= 1; - - if((FACESEL_PAINT_TEST) && (efa->f & SELECT)) - EM_select_face(efa, 1); /* flush down */ - - if (a==me->act_face) - em->act_face = efa; - } - } - } - - if(eekadoodle) - error("This Mesh has old style edgecodes, please put it in the bugtracker!"); - - MEM_freeN(evlist); - - end_editmesh_fastmalloc(); // resets global function pointers - - if(me->mselect){ - //restore editselections - EM_init_index_arrays(1,1,1); - mselect = me->mselect; - - for(a=0; atotselect; a++, mselect++){ - /*check if recorded selection is still valid, if so copy into editmesh*/ - if( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ){ - ese = MEM_callocN(sizeof(EditSelection), "Edit Selection"); - ese->type = mselect->type; - if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(mselect->index); else - if(ese->type == EDITEDGE) ese->data = EM_get_edge_for_index(mselect->index); else - if(ese->type == EDITFACE) ese->data = EM_get_face_for_index(mselect->index); - BLI_addtail(&(em->selected),ese); - } - } - EM_free_index_arrays(); - } - /* this creates coherent selections. also needed for older files */ - EM_selectmode_set(); - /* paranoia check to enforce hide rules */ - EM_hide_reset(); - /* sets helper flags which arent saved */ - EM_fgon_flags(); - - countall(); - -} - -/* makes Mesh out of editmesh */ -void load_editMesh(void) -{ - EditMesh *em = G.editMesh; - Mesh *me= G.obedit->data; - MVert *mvert, *oldverts; - MEdge *medge; - MFace *mface; - MSelect *mselect; - EditVert *eve; - EditFace *efa; - EditEdge *eed; - EditSelection *ese; - float *fp, *newkey, *oldkey, nor[3]; - int i, a, ototvert, totedge=0; - -#ifdef WITH_VERSE - if(em->vnode) { - struct VNode *vnode = (VNode*)em->vnode; - ((VGeomData*)vnode->data)->editmesh = NULL; - em->vnode = NULL; - } -#endif - - countall(); - - /* this one also tests of edges are not in faces: */ - /* eed->f2==0: not in face, f2==1: draw it */ - /* eed->f1 : flag for dynaface (cylindertest, old engine) */ - /* eve->f1 : flag for dynaface (sphere test, old engine) */ - /* eve->f2 : being used in vertexnormals */ - edge_drawflags(); - - eed= em->edges.first; - while(eed) { - totedge++; - eed= eed->next; - } - - /* new Vertex block */ - if(G.totvert==0) mvert= NULL; - else mvert= MEM_callocN(G.totvert*sizeof(MVert), "loadeditMesh vert"); - - /* new Edge block */ - if(totedge==0) medge= NULL; - else medge= MEM_callocN(totedge*sizeof(MEdge), "loadeditMesh edge"); - - /* new Face block */ - if(G.totface==0) mface= NULL; - else mface= MEM_callocN(G.totface*sizeof(MFace), "loadeditMesh face"); - - /* lets save the old verts just in case we are actually working on - * a key ... we now do processing of the keys at the end */ - oldverts= me->mvert; - ototvert= me->totvert; - - /* don't free this yet */ - CustomData_set_layer(&me->vdata, CD_MVERT, NULL); - - /* free custom data */ - CustomData_free(&me->vdata, me->totvert); - CustomData_free(&me->edata, me->totedge); - CustomData_free(&me->fdata, me->totface); - - /* add new custom data */ - me->totvert= G.totvert; - me->totedge= totedge; - me->totface= G.totface; - - CustomData_copy(&em->vdata, &me->vdata, CD_MASK_MESH, CD_CALLOC, me->totvert); - CustomData_copy(&em->edata, &me->edata, CD_MASK_MESH, CD_CALLOC, me->totedge); - CustomData_copy(&em->fdata, &me->fdata, CD_MASK_MESH, CD_CALLOC, me->totface); - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, mvert, me->totvert); - CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, medge, me->totedge); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, mface, me->totface); - mesh_update_customdata_pointers(me); - - /* the vertices, use ->tmp.l as counter */ - eve= em->verts.first; - a= 0; - - while(eve) { - VECCOPY(mvert->co, eve->co); - mvert->mat_nr= 255; /* what was this for, halos? */ - - /* vertex normal */ - VECCOPY(nor, eve->no); - VecMulf(nor, 32767.0); - VECCOPY(mvert->no, nor); - - /* note: it used to remove me->dvert when it was not in use, cancelled - that... annoying when you have a fresh vgroup */ - CustomData_from_em_block(&em->vdata, &me->vdata, eve->data, a); - - eve->tmp.l = a++; /* counter */ - - mvert->flag= 0; - if(eve->f1==1) mvert->flag |= ME_SPHERETEST; - mvert->flag |= (eve->f & SELECT); - if (eve->h) mvert->flag |= ME_HIDE; - -#ifdef WITH_VERSE - if(eve->vvert) { - ((VerseVert*)eve->vvert)->vertex = NULL; - eve->vvert = NULL; - } -#endif - eve= eve->next; - mvert++; - } - - /* the edges */ - a= 0; - eed= em->edges.first; - while(eed) { - medge->v1= (unsigned int) eed->v1->tmp.l; - medge->v2= (unsigned int) eed->v2->tmp.l; - - medge->flag= (eed->f & SELECT) | ME_EDGERENDER; - if(eed->f2<2) medge->flag |= ME_EDGEDRAW; - if(eed->f2==0) medge->flag |= ME_LOOSEEDGE; - if(eed->sharp) medge->flag |= ME_SHARP; - if(eed->seam) medge->flag |= ME_SEAM; - if(eed->h & EM_FGON) medge->flag |= ME_FGON; // different defines yes - if(eed->h & 1) medge->flag |= ME_HIDE; - - medge->crease= (char)(255.0*eed->crease); - CustomData_from_em_block(&em->edata, &me->edata, eed->data, a); - - eed->tmp.l = a++; - - medge++; - eed= eed->next; - } - - /* the faces */ - a = 0; - efa= em->faces.first; - i = 0; - me->act_face = -1; - while(efa) { - mface= &((MFace *) me->mface)[i]; - - mface->v1= (unsigned int) efa->v1->tmp.l; - mface->v2= (unsigned int) efa->v2->tmp.l; - mface->v3= (unsigned int) efa->v3->tmp.l; - if (efa->v4) mface->v4 = (unsigned int) efa->v4->tmp.l; - - mface->mat_nr= efa->mat_nr; - - mface->flag= efa->flag; - /* bit 0 of flag is already taken for smooth... */ - - if(efa->h) { - mface->flag |= ME_HIDE; - mface->flag &= ~ME_FACE_SEL; - } else { - if(efa->f & 1) mface->flag |= ME_FACE_SEL; - else mface->flag &= ~ME_FACE_SEL; - } - - /* mat_nr in vertex */ - if(me->totcol>1) { - mvert= me->mvert+mface->v1; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; - mvert= me->mvert+mface->v2; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; - mvert= me->mvert+mface->v3; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; - if(mface->v4) { - mvert= me->mvert+mface->v4; - if(mvert->mat_nr == (char)255) mvert->mat_nr= mface->mat_nr; - } - } - - /* watch: efa->e1->f2==0 means loose edge */ - - if(efa->e1->f2==1) { - efa->e1->f2= 2; - } - if(efa->e2->f2==1) { - efa->e2->f2= 2; - } - if(efa->e3->f2==1) { - efa->e3->f2= 2; - } - if(efa->e4 && efa->e4->f2==1) { - efa->e4->f2= 2; - } - - CustomData_from_em_block(&em->fdata, &me->fdata, efa->data, i); - - /* no index '0' at location 3 or 4 */ - test_index_face(mface, &me->fdata, i, efa->v4?4:3); - - if (EM_get_actFace() == efa) - me->act_face = a; - -#ifdef WITH_VERSE - if(efa->vface) { - ((VerseFace*)efa->vface)->face = NULL; - efa->vface = NULL; - } -#endif - efa->tmp.l = a++; - i++; - efa= efa->next; - } - - /* patch hook indices and vertex parents */ - { - Object *ob; - ModifierData *md; - EditVert *eve, **vertMap = NULL; - int i,j; - - for (ob=G.main->object.first; ob; ob=ob->id.next) { - if (ob->parent==G.obedit && ELEM(ob->partype, PARVERT1,PARVERT3)) { - - /* duplicate code from below, make it function later...? */ - if (!vertMap) { - vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap"); - - for (eve=em->verts.first; eve; eve=eve->next) { - if (eve->keyindex!=-1) - vertMap[eve->keyindex] = eve; - } - } - if(ob->par1 < ototvert) { - eve = vertMap[ob->par1]; - if(eve) ob->par1= eve->tmp.l; - } - if(ob->par2 < ototvert) { - eve = vertMap[ob->par2]; - if(eve) ob->par2= eve->tmp.l; - } - if(ob->par3 < ototvert) { - eve = vertMap[ob->par3]; - if(eve) ob->par3= eve->tmp.l; - } - - } - if (ob->data==me) { - for (md=ob->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - HookModifierData *hmd = (HookModifierData*) md; - - if (!vertMap) { - vertMap = MEM_callocN(sizeof(*vertMap)*ototvert, "vertMap"); - - for (eve=em->verts.first; eve; eve=eve->next) { - if (eve->keyindex!=-1) - vertMap[eve->keyindex] = eve; - } - } - - for (i=j=0; itotindex; i++) { - if(hmd->indexar[i] < ototvert) { - eve = vertMap[hmd->indexar[i]]; - - if (eve) { - hmd->indexar[j++] = eve->tmp.l; - } - } - else j++; - } - - hmd->totindex = j; - } - } - } - } - - if (vertMap) MEM_freeN(vertMap); - } - - /* are there keys? */ - if(me->key) { - KeyBlock *currkey, *actkey = ob_get_keyblock(G.obedit); - - /* Lets reorder the key data so that things line up roughly - * with the way things were before editmode */ - currkey = me->key->block.first; - while(currkey) { - - fp= newkey= MEM_callocN(me->key->elemsize*G.totvert, "currkey->data"); - oldkey = currkey->data; - - eve= em->verts.first; - - i = 0; - mvert = me->mvert; - while(eve) { - if (eve->keyindex >= 0 && eve->keyindex < currkey->totelem) { // valid old vertex - if(currkey == actkey) { - if (actkey == me->key->refkey) { - VECCOPY(fp, mvert->co); - } - else { - VECCOPY(fp, mvert->co); - if(oldverts) { - VECCOPY(mvert->co, oldverts[eve->keyindex].co); - } - } - } - else { - if(oldkey) { - VECCOPY(fp, oldkey + 3 * eve->keyindex); - } - } - } - else { - VECCOPY(fp, mvert->co); - } - fp+= 3; - ++i; - ++mvert; - eve= eve->next; - } - currkey->totelem= G.totvert; - if(currkey->data) MEM_freeN(currkey->data); - currkey->data = newkey; - - currkey= currkey->next; - } - } - - if(oldverts) MEM_freeN(oldverts); - - i = 0; - for(ese=em->selected.first; ese; ese=ese->next) i++; - me->totselect = i; - if(i==0) mselect= NULL; - else mselect= MEM_callocN(i*sizeof(MSelect), "loadeditMesh selections"); - - if(me->mselect) MEM_freeN(me->mselect); - me->mselect= mselect; - - for(ese=em->selected.first; ese; ese=ese->next){ - mselect->type = ese->type; - if(ese->type == EDITVERT) mselect->index = ((EditVert*)ese->data)->tmp.l; - else if(ese->type == EDITEDGE) mselect->index = ((EditEdge*)ese->data)->tmp.l; - else if(ese->type == EDITFACE) mselect->index = ((EditFace*)ese->data)->tmp.l; - mselect++; - } - - /* to be sure: clear ->tmp.l pointers */ - eve= em->verts.first; - while(eve) { - eve->tmp.l = 0; - eve= eve->next; - } - - eed= em->edges.first; - while(eed) { - eed->tmp.l = 0; - eed= eed->next; - } - - efa= em->faces.first; - while(efa) { - efa->tmp.l = 0; - efa= efa->next; - } - - /* remake softbody of all users */ - if(me->id.us>1) { - Base *base; - for(base= G.scene->base.first; base; base= base->next) { - if(base->object->data==me) { - base->object->softflag |= OB_SB_REDO; - base->object->recalc |= OB_RECALC_DATA; - } - } - } - - mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); -} - -void remake_editMesh(void) -{ - make_editMesh(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Undo all changes"); -} - -/* *************** (partial exit editmode) *************/ - - -void separatemenu(void) -{ - short event; - - if(G.editMesh->verts.first==NULL) return; - - event = pupmenu("Separate %t|Selected%x1|All Loose Parts%x2|By Material%x3"); - - if (event==0) return; - waitcursor(1); - - switch (event) { - case 1: - separate_mesh(); - break; - case 2: - separate_mesh_loose(); - break; - case 3: - separate_material(); - break; - } - waitcursor(0); -} - -void separate_material(void) -{ - EditMesh *em = G.editMesh; - unsigned char curr_mat; - Mesh *me; - - if(multires_test()) return; - - me= get_mesh(G.obedit); - if(me->key) { - error("Can't separate with vertex keys"); - return; - } - - if(G.obedit && em) { - if(G.obedit->type == OB_MESH) { - for (curr_mat = 1; curr_mat < G.obedit->totcol; ++curr_mat) { - /* clear selection, we're going to use that to select material group */ - EM_clear_flag_all(SELECT); - /* select the material */ - editmesh_select_by_material(curr_mat); - /* and now separate */ - separate_mesh(); - } - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -} - -void separate_mesh(void) -{ - EditMesh *em = G.editMesh; - EditMesh emcopy; - EditVert *eve, *v1; - EditEdge *eed, *e1; - EditFace *efa, *vl1; - Object *oldob; - Mesh *me, *men; - Base *base, *oldbase; - ListBase edve, eded, edvl; -#ifdef WITH_VERSE - struct VNode *vnode = NULL; -#endif - - TEST_EDITMESH - if(multires_test()) return; - - waitcursor(1); - - me= get_mesh(G.obedit); - if(me->key) { - error("Can't separate with vertex keys"); - return; - } - - /* blender crashes in derivedmesh drawing if I don't do this... but why? - Anyhoo, this function is horrible anyway (ton) - the fluidsimFlag also has to be reset btw. (n_t) */ - if(G.obedit->fluidsimSettings) { - fluidsimSettingsFree(G.obedit->fluidsimSettings); - G.obedit->fluidsimSettings = NULL; - G.obedit->fluidsimFlag = 0; - } - - if(em->selected.first) BLI_freelistN(&(em->selected)); /* clear the selection order */ - - EM_selectmode_set(); // enforce full consistant selection flags - - /* we are going to abuse the system as follows: - * 1. add a duplicate object: this will be the new one, we remember old pointer - * 2: then do a split if needed. - * 3. put apart: all NOT selected verts, edges, faces - * 4. call load_editMesh(): this will be the new object - * 5. freelist and get back old verts, edges, facs - */ - - /* make only obedit selected */ - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->object==G.obedit) base->flag |= SELECT; - else base->flag &= ~SELECT; - } - base= base->next; - } - -#ifdef WITH_VERSE - if(G.editMesh->vnode) { - vnode = G.editMesh->vnode; - G.editMesh->vnode = NULL; - } -#endif - /* no test for split, split doesn't split when a loose part is selected */ - /* SPLIT: first make duplicate */ - adduplicateflag(SELECT); - -#ifdef WITH_VERSE - if(vnode) { - G.editMesh->vnode = vnode; - } -#endif - /* SPLIT: old faces have 3x flag 128 set, delete these ones */ - delfaceflag(128); - - /* since we do tricky things with verts/edges/faces, this makes sure all is selected coherent */ - EM_selectmode_set(); - - /* set apart: everything that is not selected */ - edve.first= edve.last= eded.first= eded.last= edvl.first= edvl.last= 0; - eve= em->verts.first; - while(eve) { - v1= eve->next; - if((eve->f & SELECT)==0) { - BLI_remlink(&em->verts, eve); - BLI_addtail(&edve, eve); -#ifdef WITH_VERSE - if(eve->vvert) { - ((VerseVert*)eve->vvert)->vertex = NULL; - eve->vvert = NULL; - } -#endif - } - - eve= v1; - } - eed= em->edges.first; - while(eed) { - e1= eed->next; - if((eed->f & SELECT)==0) { - BLI_remlink(&em->edges, eed); - BLI_addtail(&eded, eed); - } - eed= e1; - } - efa= em->faces.first; - while(efa) { - vl1= efa->next; - if((efa->f & SELECT)==0) { - BLI_remlink(&em->faces, efa); - BLI_addtail(&edvl, efa); -#ifdef WITH_VERSE - if(efa->vface) { - ((VerseFace*)efa->vface)->face = NULL; - efa->vface = NULL; - } -#endif - } - efa= vl1; - } - - oldob= G.obedit; - oldbase= BASACT; - -#ifdef WITH_VERSE - if(G.obedit->vnode) { - vnode = G.obedit->vnode; - G.obedit->vnode = NULL; - } -#endif - adduplicate(1, 0); /* notrans and a linked duplicate */ - -#ifdef WITH_VERSE - if(vnode) { - G.obedit->vnode = vnode; - } -#endif - - G.obedit= BASACT->object; /* basact was set in adduplicate() */ - - men= copy_mesh(me); - set_mesh(G.obedit, men); - /* because new mesh is a copy: reduce user count */ - men->id.us--; - - load_editMesh(); - - BASACT->flag &= ~SELECT; - - /* we cannot free the original buffer... */ - emcopy= *G.editMesh; - emcopy.allverts= NULL; - emcopy.alledges= NULL; - emcopy.allfaces= NULL; - emcopy.derivedFinal= emcopy.derivedCage= NULL; - memset(&emcopy.vdata, 0, sizeof(emcopy.vdata)); - memset(&emcopy.fdata, 0, sizeof(emcopy.fdata)); - free_editMesh(&emcopy); - - em->verts= edve; - em->edges= eded; - em->faces= edvl; - - /* hashedges are freed now, make new! */ - editMesh_set_hash(); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - G.obedit= oldob; - BASACT= oldbase; - BASACT->flag |= SELECT; - - waitcursor(0); - - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -} - -void separate_mesh_loose(void) -{ - EditMesh *em = G.editMesh; - EditMesh emcopy; - EditVert *eve, *v1; - EditEdge *eed, *e1; - EditFace *efa, *vl1; - Object *oldob=NULL; - Mesh *me, *men; - Base *base, *oldbase; - ListBase edve, eded, edvl; - int vertsep=0; - short done=0, check=1; -#ifdef WITH_VERSE - struct VNode *vnode = NULL; -#endif - - me= get_mesh(G.obedit); -#ifdef WITH_VERSE - if(me->vnode) { - error("Can't separate a mesh shared at verse server"); - return; - } -#endif - if(me->key) { - error("Can't separate a mesh with vertex keys"); - return; - } - - /* same problem as in separate_mesh above (n_t) */ - if(G.obedit->fluidsimSettings) { - fluidsimSettingsFree(G.obedit->fluidsimSettings); - G.obedit->fluidsimSettings = NULL; - G.obedit->fluidsimFlag = 0; - } - - TEST_EDITMESH - if(multires_test()) return; - waitcursor(1); - - /* we are going to abuse the system as follows: - * 1. add a duplicate object: this will be the new one, we remember old pointer - * 2: then do a split if needed. - * 3. put apart: all NOT selected verts, edges, faces - * 4. call load_editMesh(): this will be the new object - * 5. freelist and get back old verts, edges, facs - */ - - while(!done){ - vertsep=check=1; - - countall(); - - /* make only obedit selected */ - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->object==G.obedit) base->flag |= SELECT; - else base->flag &= ~SELECT; - } - base= base->next; - } - - /*--------- Select connected-----------*/ - - EM_clear_flag_all(SELECT); - - /* Select a random vert to start with */ - eve= em->verts.first; - eve->f |= SELECT; - - while(check==1) { - check= 0; - eed= em->edges.first; - while(eed) { - if(eed->h==0) { - if(eed->v1->f & SELECT) { - if( (eed->v2->f & SELECT)==0 ) { - eed->v2->f |= SELECT; - vertsep++; - check= 1; - } - } - else if(eed->v2->f & SELECT) { - if( (eed->v1->f & SELECT)==0 ) { - eed->v1->f |= SELECT; - vertsep++; - check= SELECT; - } - } - } - eed= eed->next; - } - } - /*----------End of select connected--------*/ - - - /* If the amount of vertices that is about to be split == the total amount - of verts in the mesh, it means that there is only 1 unconnected object, so we don't have to separate - */ - if(G.totvert==vertsep) done=1; - else{ - /* No splitting: select connected goes fine */ - - EM_select_flush(); // from verts->edges->faces - - /* set apart: everything that is not selected */ - edve.first= edve.last= eded.first= eded.last= edvl.first= edvl.last= 0; - eve= em->verts.first; - while(eve) { - v1= eve->next; - if((eve->f & SELECT)==0) { - BLI_remlink(&em->verts, eve); - BLI_addtail(&edve, eve); -#ifdef WITH_VERSE - if(eve->vvert) { - b_verse_send_vertex_delete(eve); - } -#endif - } - eve= v1; - } - eed= em->edges.first; - while(eed) { - e1= eed->next; - if( (eed->f & SELECT)==0 ) { - BLI_remlink(&em->edges, eed); - BLI_addtail(&eded, eed); - } - eed= e1; - } - efa= em->faces.first; - while(efa) { - vl1= efa->next; - if( (efa->f & SELECT)==0 ) { - BLI_remlink(&em->faces, efa); - BLI_addtail(&edvl, efa); -#ifdef WITH_VERSE - if(efa->vface) { - b_verse_send_face_delete(efa); - } -#endif - } - efa= vl1; - } - - oldob= G.obedit; - oldbase= BASACT; - -#ifdef WITH_VERSE - if(G.obedit->vnode) { - vnode = G.obedit->vnode; - G.obedit->vnode = NULL; - } -#endif - adduplicate(1, 0); /* notrans and a linked duplicate*/ -#ifdef WITH_VERSE - if(vnode) { - G.obedit->vnode = vnode; - } -#endif - - G.obedit= BASACT->object; /* basact was set in adduplicate() */ - - men= copy_mesh(me); - set_mesh(G.obedit, men); - /* because new mesh is a copy: reduce user count */ - men->id.us--; - - load_editMesh(); - - BASACT->flag &= ~SELECT; - - /* we cannot free the original buffer... */ - emcopy= *G.editMesh; - emcopy.allverts= NULL; - emcopy.alledges= NULL; - emcopy.allfaces= NULL; - emcopy.derivedFinal= emcopy.derivedCage= NULL; - memset(&emcopy.vdata, 0, sizeof(emcopy.vdata)); - memset(&emcopy.fdata, 0, sizeof(emcopy.fdata)); - free_editMesh(&emcopy); - - em->verts= edve; - em->edges= eded; - em->faces= edvl; - - /* hashedges are freed now, make new! */ - editMesh_set_hash(); - - G.obedit= oldob; - BASACT= oldbase; - BASACT->flag |= SELECT; - - } - } - - /* unselect the vertices that we (ab)used for the separation*/ - EM_clear_flag_all(SELECT); - - waitcursor(0); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - -/* ******************************************** */ - -/* *************** UNDO ***************************** */ -/* new mesh undo, based on pushing editmesh data itself */ -/* reuses same code as for global and curve undo... unify that (ton) */ - -/* only one 'hack', to save memory it doesn't store the first push, but does a remake editmesh */ - -/* a compressed version of editmesh data */ - -typedef struct EditVertC -{ - float no[3]; - float co[3]; - unsigned char f, h; - int keyindex; -} EditVertC; - -typedef struct EditEdgeC -{ - int v1, v2; - unsigned char f, h, seam, sharp, pad; - short crease, fgoni; -} EditEdgeC; - -typedef struct EditFaceC -{ - int v1, v2, v3, v4; - unsigned char mat_nr, flag, f, h, fgonf; - short pad1; -} EditFaceC; - -typedef struct EditSelectionC{ - short type; - int index; -}EditSelectionC; - -typedef struct EM_MultiresUndo { - int users; - Multires *mr; -} EM_MultiresUndo; - -typedef struct UndoMesh { - EditVertC *verts; - EditEdgeC *edges; - EditFaceC *faces; - EditSelectionC *selected; - int totvert, totedge, totface, totsel; - short selectmode; - RetopoPaintData *retopo_paint_data; - char retopo_mode; - CustomData vdata, edata, fdata; - EM_MultiresUndo *mru; -} UndoMesh; - -/* for callbacks */ - -static void free_undoMesh(void *umv) -{ - UndoMesh *um= umv; - - if(um->verts) MEM_freeN(um->verts); - if(um->edges) MEM_freeN(um->edges); - if(um->faces) MEM_freeN(um->faces); - if(um->selected) MEM_freeN(um->selected); - if(um->retopo_paint_data) retopo_free_paint_data(um->retopo_paint_data); - CustomData_free(&um->vdata, um->totvert); - CustomData_free(&um->edata, um->totedge); - CustomData_free(&um->fdata, um->totface); - if(um->mru) { - --um->mru->users; - if(um->mru->users==0) { - multires_free(um->mru->mr); - um->mru->mr= NULL; - MEM_freeN(um->mru); - } - } - MEM_freeN(um); -} - -static void *editMesh_to_undoMesh(void) -{ - EditMesh *em= G.editMesh; - UndoMesh *um; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - EditSelection *ese; - EditVertC *evec=NULL; - EditEdgeC *eedc=NULL; - EditFaceC *efac=NULL; - EditSelectionC *esec=NULL; - int a; - - um= MEM_callocN(sizeof(UndoMesh), "undomesh"); - - um->selectmode = G.scene->selectmode; - - for(eve=em->verts.first; eve; eve= eve->next) um->totvert++; - for(eed=em->edges.first; eed; eed= eed->next) um->totedge++; - for(efa=em->faces.first; efa; efa= efa->next) um->totface++; - for(ese=em->selected.first; ese; ese=ese->next) um->totsel++; - /* malloc blocks */ - - if(um->totvert) evec= um->verts= MEM_callocN(um->totvert*sizeof(EditVertC), "allvertsC"); - if(um->totedge) eedc= um->edges= MEM_callocN(um->totedge*sizeof(EditEdgeC), "alledgesC"); - if(um->totface) efac= um->faces= MEM_callocN(um->totface*sizeof(EditFaceC), "allfacesC"); - if(um->totsel) esec= um->selected= MEM_callocN(um->totsel*sizeof(EditSelectionC), "allselections"); - - if(um->totvert) CustomData_copy(&em->vdata, &um->vdata, CD_MASK_EDITMESH, CD_CALLOC, um->totvert); - if(um->totedge) CustomData_copy(&em->edata, &um->edata, CD_MASK_EDITMESH, CD_CALLOC, um->totedge); - if(um->totface) CustomData_copy(&em->fdata, &um->fdata, CD_MASK_EDITMESH, CD_CALLOC, um->totface); - - /* now copy vertices */ - a = 0; - for(eve=em->verts.first; eve; eve= eve->next, evec++, a++) { - VECCOPY(evec->co, eve->co); - VECCOPY(evec->no, eve->no); - - evec->f= eve->f; - evec->h= eve->h; - evec->keyindex= eve->keyindex; - eve->tmp.l = a; /*store index*/ - - CustomData_from_em_block(&em->vdata, &um->vdata, eve->data, a); - } - - /* copy edges */ - a = 0; - for(eed=em->edges.first; eed; eed= eed->next, eedc++, a++) { - eedc->v1= (int)eed->v1->tmp.l; - eedc->v2= (int)eed->v2->tmp.l; - eedc->f= eed->f; - eedc->h= eed->h; - eedc->seam= eed->seam; - eedc->sharp= eed->sharp; - eedc->crease= (short)(eed->crease*255.0); - eedc->fgoni= eed->fgoni; - eed->tmp.l = a; /*store index*/ - CustomData_from_em_block(&em->edata, &um->edata, eed->data, a); - - } - - /* copy faces */ - a = 0; - for(efa=em->faces.first; efa; efa= efa->next, efac++, a++) { - efac->v1= (int)efa->v1->tmp.l; - efac->v2= (int)efa->v2->tmp.l; - efac->v3= (int)efa->v3->tmp.l; - if(efa->v4) efac->v4= (int)efa->v4->tmp.l; - else efac->v4= -1; - - efac->mat_nr= efa->mat_nr; - efac->flag= efa->flag; - efac->f= efa->f; - efac->h= efa->h; - efac->fgonf= efa->fgonf; - - efa->tmp.l = a; /*store index*/ - - CustomData_from_em_block(&em->fdata, &um->fdata, efa->data, a); - } - - a = 0; - for(ese=em->selected.first; ese; ese=ese->next, esec++){ - esec->type = ese->type; - if(ese->type == EDITVERT) a = esec->index = ((EditVert*)ese->data)->tmp.l; - else if(ese->type == EDITEDGE) a = esec->index = ((EditEdge*)ese->data)->tmp.l; - else if(ese->type == EDITFACE) a = esec->index = ((EditFace*)ese->data)->tmp.l; - } - - um->retopo_paint_data= retopo_paint_data_copy(em->retopo_paint_data); - um->retopo_mode= G.scene->toolsettings->retopo_mode; - - { - Multires *mr= get_mesh(G.obedit)->mr; - UndoMesh *prev= undo_editmode_get_prev(G.obedit); - - um->mru= NULL; - - if(mr) { - if(prev && prev->mru && prev->mru->mr && prev->mru->mr->current == mr->current) { - um->mru= prev->mru; - ++um->mru->users; - } - else { - um->mru= MEM_callocN(sizeof(EM_MultiresUndo), "EM_MultiresUndo"); - um->mru->users= 1; - um->mru->mr= multires_copy(mr); - } - } - } - - return um; -} - -static void undoMesh_to_editMesh(void *umv) -{ - UndoMesh *um= (UndoMesh*)umv; - EditMesh *em= G.editMesh; - EditVert *eve, **evar=NULL; - EditEdge *eed; - EditFace *efa; - EditSelection *ese; - EditVertC *evec; - EditEdgeC *eedc; - EditFaceC *efac; - EditSelectionC *esec; - int a=0; - -#ifdef WITH_VERSE - struct VNode *vnode = G.editMesh->vnode; - if(vnode) { - /* send delete command to all verse vertexes and verse face ... - * verse mesh will be recreated from new edit mesh */ - destroy_versemesh(vnode); - } -#endif - G.scene->selectmode = um->selectmode; - - free_editMesh(G.editMesh); - - /* malloc blocks */ - memset(em, 0, sizeof(EditMesh)); - - init_editmesh_fastmalloc(em, um->totvert, um->totedge, um->totface); - -#ifdef WITH_VERSE - G.editMesh->vnode = vnode; -#endif - - CustomData_free(&em->vdata, 0); - CustomData_free(&em->edata, 0); - CustomData_free(&em->fdata, 0); - - CustomData_copy(&um->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0); - CustomData_copy(&um->edata, &em->edata, CD_MASK_EDITMESH, CD_CALLOC, 0); - CustomData_copy(&um->fdata, &em->fdata, CD_MASK_EDITMESH, CD_CALLOC, 0); - - /* now copy vertices */ - - if(um->totvert) evar= MEM_mallocN(um->totvert*sizeof(EditVert *), "vertex ar"); - for(a=0, evec= um->verts; atotvert; a++, evec++) { - eve= addvertlist(evec->co, NULL); - evar[a]= eve; - - VECCOPY(eve->no, evec->no); - eve->f= evec->f; - eve->h= evec->h; - eve->keyindex= evec->keyindex; - - CustomData_to_em_block(&um->vdata, &em->vdata, a, &eve->data); - } - - /* copy edges */ - for(a=0, eedc= um->edges; atotedge; a++, eedc++) { - eed= addedgelist(evar[eedc->v1], evar[eedc->v2], NULL); - - eed->f= eedc->f; - eed->h= eedc->h; - eed->seam= eedc->seam; - eed->sharp= eedc->sharp; - eed->fgoni= eedc->fgoni; - eed->crease= ((float)eedc->crease)/255.0; - CustomData_to_em_block(&um->edata, &em->edata, a, &eed->data); - } - - /* copy faces */ - for(a=0, efac= um->faces; atotface; a++, efac++) { - if(efac->v4 != -1) - efa= addfacelist(evar[efac->v1], evar[efac->v2], evar[efac->v3], evar[efac->v4], NULL, NULL); - else - efa= addfacelist(evar[efac->v1], evar[efac->v2], evar[efac->v3], NULL, NULL ,NULL); - - efa->mat_nr= efac->mat_nr; - efa->flag= efac->flag; - efa->f= efac->f; - efa->h= efac->h; - efa->fgonf= efac->fgonf; - - CustomData_to_em_block(&um->fdata, &em->fdata, a, &efa->data); - } - - end_editmesh_fastmalloc(); - if(evar) MEM_freeN(evar); - - G.totvert = um->totvert; - G.totedge = um->totedge; - G.totface = um->totface; - /*restore stored editselections*/ - if(um->totsel){ - EM_init_index_arrays(1,1,1); - for(a=0, esec= um->selected; atotsel; a++, esec++){ - ese = MEM_callocN(sizeof(EditSelection), "Edit Selection"); - ese->type = esec->type; - if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(esec->index); else - if(ese->type == EDITEDGE) ese->data = EM_get_edge_for_index(esec->index); else - if(ese->type == EDITFACE) ese->data = EM_get_face_for_index(esec->index); - BLI_addtail(&(em->selected),ese); - } - EM_free_index_arrays(); - } - - retopo_free_paint(); - em->retopo_paint_data= retopo_paint_data_copy(um->retopo_paint_data); - G.scene->toolsettings->retopo_mode= um->retopo_mode; - if(G.scene->toolsettings->retopo_mode) { - if(G.vd->depths) G.vd->depths->damaged= 1; - retopo_queue_updates(G.vd); - retopo_paint_view_update(G.vd); - } - - { - Mesh *me= get_mesh(G.obedit); - multires_free(me->mr); - me->mr= NULL; - if(um->mru && um->mru->mr) me->mr= multires_copy(um->mru->mr); - } -} - - -/* and this is all the undo system needs to know */ -void undo_push_mesh(char *name) -{ - undo_editmode_push(name, free_undoMesh, undoMesh_to_editMesh, editMesh_to_undoMesh); -} - - - -/* *************** END UNDO *************/ - -static EditVert **g_em_vert_array = NULL; -static EditEdge **g_em_edge_array = NULL; -static EditFace **g_em_face_array = NULL; - -void EM_init_index_arrays(int forVert, int forEdge, int forFace) -{ - EditVert *eve; - EditEdge *eed; - EditFace *efa; - int i; - - if (forVert) { - g_em_vert_array = MEM_mallocN(sizeof(*g_em_vert_array)*G.totvert, "em_v_arr"); - - for (i=0,eve=G.editMesh->verts.first; eve; i++,eve=eve->next) - g_em_vert_array[i] = eve; - } - - if (forEdge) { - g_em_edge_array = MEM_mallocN(sizeof(*g_em_edge_array)*G.totedge, "em_e_arr"); - - for (i=0,eed=G.editMesh->edges.first; eed; i++,eed=eed->next) - g_em_edge_array[i] = eed; - } - - if (forFace) { - g_em_face_array = MEM_mallocN(sizeof(*g_em_face_array)*G.totface, "em_f_arr"); - - for (i=0,efa=G.editMesh->faces.first; efa; i++,efa=efa->next) - g_em_face_array[i] = efa; - } -} - -void EM_free_index_arrays(void) -{ - if (g_em_vert_array) MEM_freeN(g_em_vert_array); - if (g_em_edge_array) MEM_freeN(g_em_edge_array); - if (g_em_face_array) MEM_freeN(g_em_face_array); - g_em_vert_array = NULL; - g_em_edge_array = NULL; - g_em_face_array = NULL; -} - -EditVert *EM_get_vert_for_index(int index) -{ - return g_em_vert_array?g_em_vert_array[index]:NULL; -} - -EditEdge *EM_get_edge_for_index(int index) -{ - return g_em_edge_array?g_em_edge_array[index]:NULL; -} - -EditFace *EM_get_face_for_index(int index) -{ - return g_em_face_array?g_em_face_array[index]:NULL; -} - -/* can we edit UV's for this mesh?*/ -int EM_texFaceCheck(void) -{ - /* some of these checks could be a touch overkill */ - if ( (G.obedit) && - (G.obedit->type == OB_MESH) && - (G.editMesh) && - (G.editMesh->faces.first) && - (CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE))) - return 1; - return 0; -} - -/* can we edit colors for this mesh?*/ -int EM_vertColorCheck(void) -{ - /* some of these checks could be a touch overkill */ - if ( (G.obedit) && - (G.obedit->type == OB_MESH) && - (G.editMesh) && - (G.editMesh->faces.first) && - (CustomData_has_layer(&G.editMesh->fdata, CD_MCOL))) - return 1; - return 0; -} - diff --git a/source/blender/src/editmesh_add.c b/source/blender/src/editmesh_add.c deleted file mode 100644 index 8fb21549172..00000000000 --- a/source/blender/src/editmesh_add.c +++ /dev/null @@ -1,1349 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - - -#include "BIF_editmesh.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BDR_editobject.h" - -#include "BSE_view.h" -#include "BSE_edit.h" - -#include "blendef.h" -#include "multires.h" -#include "mydevice.h" - -#include "editmesh.h" - -/* bpymenu */ -#include "BPY_extern.h" -#include "BPY_menus.h" - -static float icovert[12][3] = { - {0,0,-200}, - {144.72, -105.144,-89.443}, - {-55.277, -170.128,-89.443}, - {-178.885,0,-89.443}, - {-55.277,170.128,-89.443}, - {144.72,105.144,-89.443}, - {55.277,-170.128,89.443}, - {-144.72,-105.144,89.443}, - {-144.72,105.144,89.443}, - {55.277,170.128,89.443}, - {178.885,0,89.443}, - {0,0,200} -}; -static short icoface[20][3] = { - {1,0,2}, - {1,0,5}, - {2,0,3}, - {3,0,4}, - {4,0,5}, - {1,5,10}, - {2,1,6}, - {3,2,7}, - {4,3,8}, - {5,4,9}, - {10,1,6}, - {6,2,7}, - {7,3,8}, - {8,4,9}, - {9,5,10}, - {6,10,11}, - {7,6,11}, - {8,7,11}, - {9,8,11}, - {10,9,11} -}; - -static void get_view_aligned_coordinate(float *fp) -{ - float dvec[3]; - short mx, my, mval[2]; - - getmouseco_areawin(mval); - mx= mval[0]; - my= mval[1]; - - project_short_noclip(fp, mval); - - initgrabz(fp[0], fp[1], fp[2]); - - if(mval[0]!=IS_CLIPPED) { - window_to_3d(dvec, mval[0]-mx, mval[1]-my); - VecSubf(fp, fp, dvec); - } -} - -void add_click_mesh(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *v1; - float min[3], max[3]; - int done= 0; - - TEST_EDITMESH - if(multires_test()) return; - - INIT_MINMAX(min, max); - - for(v1= em->verts.first;v1; v1=v1->next) { - if(v1->f & SELECT) { - DO_MINMAX(v1->co, min, max); - done= 1; - } - } - - /* call extrude? */ - if(done) { - EditEdge *eed; - float vec[3], cent[3], mat[3][3]; - float nor[3]= {0.0, 0.0, 0.0}; - - /* check for edges that are half selected, use for rotation */ - done= 0; - for(eed= em->edges.first; eed; eed= eed->next) { - if( (eed->v1->f & SELECT)+(eed->v2->f & SELECT) == SELECT ) { - if(eed->v1->f & SELECT) VecSubf(vec, eed->v1->co, eed->v2->co); - else VecSubf(vec, eed->v2->co, eed->v1->co); - VecAddf(nor, nor, vec); - done= 1; - } - } - if(done) Normalize(nor); - - /* center */ - VecAddf(cent, min, max); - VecMulf(cent, 0.5f); - VECCOPY(min, cent); - - Mat4MulVecfl(G.obedit->obmat, min); // view space - get_view_aligned_coordinate(min); - Mat4Invert(G.obedit->imat, G.obedit->obmat); - Mat4MulVecfl(G.obedit->imat, min); // back in object space - - VecSubf(min, min, cent); - - /* calculate rotation */ - Mat3One(mat); - if(done) { - float dot; - - VECCOPY(vec, min); - Normalize(vec); - dot= INPR(vec, nor); - - if( fabs(dot)<0.999) { - float cross[3], si, q1[4]; - - Crossf(cross, nor, vec); - Normalize(cross); - dot= 0.5f*saacos(dot); - si= (float)sin(dot); - q1[0]= (float)cos(dot); - q1[1]= cross[0]*si; - q1[2]= cross[1]*si; - q1[3]= cross[2]*si; - - QuatToMat3(q1, mat); - } - } - - extrudeflag(SELECT, nor); - rotateflag(SELECT, cent, mat); - translateflag(SELECT, min); - - recalc_editnormals(); - } - else { - float mat[3][3],imat[3][3]; - float *curs= give_cursor(); - - eve= addvertlist(0, NULL); - - Mat3CpyMat4(mat, G.obedit->obmat); - Mat3Inv(imat, mat); - - VECCOPY(eve->co, curs); - VecSubf(eve->co, eve->co, G.obedit->obmat[3]); - - Mat3MulVecfl(imat, eve->co); - - eve->f= SELECT; - } - - retopo_do_all(); - - countall(); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) { - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); - } -#endif - - BIF_undo_push("Add vertex/edge/face"); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - while(get_mbut()&R_MOUSE); - -} - -/* selected faces get hidden edges */ -static void make_fgon(int make) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditEdge *eed; - EditVert *eve; - float *nor=NULL; // reference - int done=0; - - if(!make) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - efa->fgonf= 0; - efa->e1->h &= ~EM_FGON; - efa->e2->h &= ~EM_FGON; - efa->e3->h &= ~EM_FGON; - if(efa->e4) efa->e4->h &= ~EM_FGON; - } - } - allqueue(REDRAWVIEW3D, 0); - EM_fgon_flags(); // redo flags and indices for fgons - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Clear FGon"); - return; - } - - /* tagging edges. rule is: - - edge used by exactly 2 selected faces - - no vertices allowed with only tagged edges (return) - - face normals are allowed to difffer - - */ - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; // amount of selected - eed->f2= 0; // amount of unselected - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - if(nor==NULL) nor= efa->n; - if(efa->e1->f1 < 3) efa->e1->f1++; - if(efa->e2->f1 < 3) efa->e2->f1++; - if(efa->e3->f1 < 3) efa->e3->f1++; - if(efa->e4 && efa->e4->f1 < 3) efa->e4->f1++; - } - else { - if(efa->e1->f2 < 3) efa->e1->f2++; - if(efa->e2->f2 < 3) efa->e2->f2++; - if(efa->e3->f2 < 3) efa->e3->f2++; - if(efa->e4 && efa->e4->f2 < 3) efa->e4->f2++; - } - } - // now eed->f1 becomes tagged edge - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f1==2 && eed->f2==0) eed->f1= 1; - else eed->f1= 0; - } - - // no vertices allowed with only tagged edges - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f1) { - eed->v1->f1 |= 1; - eed->v2->f1 |= 1; - } - else { - eed->v1->f1 |= 2; - eed->v2->f1 |= 2; - } - } - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f1==1) break; - } - if(eve) { - error("Cannot make polygon with interior vertices"); - return; - } - - // check for faces - if(nor==NULL) { - error("No faces selected to make FGon"); - return; - } - - // and there we go - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f1) { - eed->h |= EM_FGON; - done= 1; - } - } - - if(done==0) { - error("Didn't find FGon to create"); - } - else { - EM_fgon_flags(); // redo flags and indices for fgons - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Make FGon"); - } -} - -/* precondition; 4 vertices selected, check for 4 edges and create face */ -static EditFace *addface_from_edges(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed, *eedar[4]={NULL, NULL, NULL, NULL}; - EditVert *v1=NULL, *v2=NULL, *v3=NULL, *v4=NULL; - int a; - - /* find the 4 edges */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { - if(eedar[0]==NULL) eedar[0]= eed; - else if(eedar[1]==NULL) eedar[1]= eed; - else if(eedar[2]==NULL) eedar[2]= eed; - else eedar[3]= eed; - - } - } - - - if(eedar[3]) { - /* first 2 points */ - v1= eedar[0]->v1; - v2= eedar[0]->v2; - - /* find the 2 edges connected to first edge */ - for(a=1; a<4; a++) { - if( eedar[a]->v1 == v2) v3= eedar[a]->v2; - else if(eedar[a]->v2 == v2) v3= eedar[a]->v1; - else if( eedar[a]->v1 == v1) v4= eedar[a]->v2; - else if(eedar[a]->v2 == v1) v4= eedar[a]->v1; - } - - /* verify if last edge exists */ - if(v3 && v4) { - for(a=1; a<4; a++) { - if( eedar[a]->v1==v3 && eedar[a]->v2==v4) break; - if( eedar[a]->v2==v3 && eedar[a]->v1==v4) break; - } - if(a!=4) { - return addfacelist(v1, v2, v3, v4, NULL, NULL); - } - } - } - return NULL; -} - -/* this also allows to prevent triangles being made in quads */ -static int compareface_overlaps(EditFace *vl1, EditFace *vl2) -{ - EditVert *v1, *v2, *v3, *v4; - int equal= 0; - - v1= vl2->v1; - v2= vl2->v2; - v3= vl2->v3; - v4= vl2->v4; - - if(vl1==vl2) return 0; - - if(v4==NULL && vl1->v4==NULL) { - if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1) equal++; - if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2) equal++; - if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3) equal++; - } - else { - if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1 || vl1->v4==v1) equal++; - if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2 || vl1->v4==v2) equal++; - if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3 || vl1->v4==v3) equal++; - if(vl1->v1==v4 || vl1->v2==v4 || vl1->v3==v4 || vl1->v4==v4) equal++; - } - - if(v4 && vl1->v4) { - if(equal==4) return 1; - } - else - if(equal>=3) return 1; - - return 0; -} - -/* checks for existance, and for tria overlapping inside quad */ -static EditFace *exist_face_overlaps(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4) -{ - EditMesh *em = G.editMesh; - EditFace *efa, efatest; - - efatest.v1= v1; - efatest.v2= v2; - efatest.v3= v3; - efatest.v4= v4; - - efa= em->faces.first; - while(efa) { - if(compareface_overlaps(&efatest, efa)) return efa; - efa= efa->next; - } - return NULL; -} - -/* will be new face smooth or solid? depends on smoothness of face neighbours - * of new face, if function return 1, then new face will be smooth, when functio - * will return zero, then new face will be solid */ -static void fix_new_face(EditFace *eface) -{ - struct EditMesh *em = G.editMesh; - struct EditFace *efa; - struct EditEdge *eed=NULL; - struct EditVert *v1 = eface->v1, *v2 = eface->v2, *v3 = eface->v3, *v4 = eface->v4; - struct EditVert *ev1=NULL, *ev2=NULL; - short smooth=0; /* "total smoothnes" of faces in neighbourhood */ - short coef; /* "weight" of smoothness */ - short count=0; /* number of edges with same direction as eface */ - short vi00=0, vi01=0, vi10=0, vi11=0; /* vertex indexes */ - - efa = em->faces.first; - - while(efa) { - - if(efa==eface) { - efa = efa->next; - continue; - } - - coef = 0; - ev1 = ev2 = NULL; - eed = NULL; - - if(efa->v1==v1 || efa->v2==v1 || efa->v3==v1 || efa->v4==v1) { - ev1 = v1; - coef++; - } - if(efa->v1==v2 || efa->v2==v2 || efa->v3==v2 || efa->v4==v2) { - if(ev1) ev2 = v2; - else ev1 = v2; - coef++; - } - if(efa->v1==v3 || efa->v2==v3 || efa->v3==v3 || efa->v4==v3) { - if(coef<2) { - if(ev1) ev2 = v3; - else ev1 = v3; - } - coef++; - } - if((v4) && (efa->v1==v4 || efa->v2==v4 || efa->v3==v4 || efa->v4==v4)) { - if(ev1 && coef<2) ev2 = v4; - coef++; - } - - /* "democracy" of smoothness */ - if(efa->flag & ME_SMOOTH) - smooth += coef; - else - smooth -= coef; - - /* try to find edge using vertexes ev1 and ev2 */ - if((ev1) && (ev2) && (ev1!=ev2)) eed = findedgelist(ev1, ev2); - - /* has bordering edge of efa same direction as edge of eface ? */ - if(eed) { - if(eed->v1==v1) vi00 = 1; - else if(eed->v1==v2) vi00 = 2; - else if(eed->v1==v3) vi00 = 3; - else if(v4 && eed->v1==v4) vi00 = 4; - - if(eed->v2==v1) vi01 = 1; - else if(eed->v2==v2) vi01 = 2; - else if(eed->v2==v3) vi01 = 3; - else if(v4 && eed->v2==v4) vi01 = 4; - - if(v4) { - if(vi01==1 && vi00==4) vi00 = 0; - if(vi01==4 && vi00==1) vi01 = 0; - } - else { - if(vi01==1 && vi00==3) vi00 = 0; - if(vi01==3 && vi00==1) vi01 = 0; - } - - if(eed->v1==efa->v1) vi10 = 1; - else if(eed->v1==efa->v2) vi10 = 2; - else if(eed->v1==efa->v3) vi10 = 3; - else if(efa->v4 && eed->v1==efa->v4) vi10 = 4; - - if(eed->v2==efa->v1) vi11 = 1; - else if(eed->v2==efa->v2) vi11 = 2; - else if(eed->v2==efa->v3) vi11 = 3; - else if(efa->v4 && eed->v2==efa->v4) vi11 = 4; - - if(efa->v4) { - if(vi11==1 && vi10==4) vi10 = 0; - if(vi11==4 && vi10==1) vi11 = 0; - } - else { - if(vi11==1 && vi10==3) vi10 = 0; - if(vi11==3 && vi10==1) vi11 = 0; - } - - if(((vi00>vi01) && (vi10>vi11)) || - ((vi00next; - } - - /* set up smoothness according voting of face in neighbourhood */ - if(smooth >= 0) - eface->flag |= ME_SMOOTH; - else - eface->flag &= ~ME_SMOOTH; - - /* flip face, when too much "face normals" in neighbourhood is different */ - if(count > 0) { - flipface(eface); -#ifdef WITH_VERSE - if(eface->vface) { - struct VNode *vnode; - struct VLayer *vlayer; - vnode = (VNode*)((Mesh*)G.obedit->data)->vnode; - vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - add_item_to_send_queue(&(vlayer->queue), (void*)eface->vface, VERSE_FACE); - } -#endif - } -} - -void addfaces_from_edgenet() -{ - EditVert *eve1, *eve2, *eve3, *eve4; - EditMesh *em= G.editMesh; - - for(eve1= em->verts.first; eve1; eve1= eve1->next) { - for(eve2= em->verts.first; (eve1->f & 1) && eve2; eve2= eve2->next) { - if(findedgelist(eve1,eve2)) { - for(eve3= em->verts.first; (eve2->f & 1) && eve3; eve3= eve3->next) { - if((eve2!=eve3 && (eve3->f & 1) && findedgelist(eve1,eve3))) { - EditEdge *sh_edge= NULL; - EditVert *sh_vert= NULL; - - sh_edge= findedgelist(eve2,eve3); - - if(sh_edge) { /* Add a triangle */ - if(!exist_face_overlaps(eve1,eve2,eve3,NULL)) - fix_new_face(addfacelist(eve1,eve2,eve3,NULL,NULL,NULL)); - } - else { /* Check for a shared vertex */ - for(eve4= em->verts.first; eve4; eve4= eve4->next) { - if(eve4!=eve1 && eve4!=eve2 && eve4!=eve3 && (eve4->f & 1) && - !findedgelist(eve1,eve4) && findedgelist(eve2,eve4) && - findedgelist(eve3,eve4)) { - sh_vert= eve4; - break; - } - } - - if(sh_vert) { - if(sh_vert) { - if(!exist_face_overlaps(eve1,eve2,eve4,eve3)) - fix_new_face(addfacelist(eve1,eve2,eve4,eve3,NULL,NULL)); - } - } - } - } - } - } - } - } - - countall(); - - EM_select_flush(); - - BIF_undo_push("Add faces"); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - -void addedgeface_mesh(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *neweve[4]; - EditEdge *eed; - EditFace *efa; - short amount=0; - - if( (G.vd->lay & G.obedit->lay)==0 ) return; - if(multires_test()) return; - - /* how many selected ? */ - if(G.scene->selectmode & SCE_SELECT_EDGE) { - /* in edge mode finding selected vertices means flushing down edge codes... */ - /* can't make face with only edge selection info... */ - EM_selectmode_set(); - } - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - amount++; - if(amount>4) break; - neweve[amount-1]= eve; - } - } - - if(amount==2) { - eed= addedgelist(neweve[0], neweve[1], NULL); - EM_select_edge(eed, 1); - BIF_undo_push("Add edge"); - allqueue(REDRAWVIEW3D, 0); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - return; - } - else if(amount > 4) { - - /* Python Menu */ - BPyMenu *pym; - char menu_number[3]; - int i=0, has_pymenu=0, ret; - - /* facemenu, will add python items */ - char facemenu[4096]= "Make Faces%t|Auto%x1|Make FGon%x2|Clear FGon%x3"; - - /* note that we account for the 10 previous entries with i+4: */ - for (pym = BPyMenuTable[PYMENU_MESHFACEKEY]; pym; pym = pym->next, i++) { - - if (!has_pymenu) { - strcat(facemenu, "|%l"); - has_pymenu = 1; - } - - strcat(facemenu, "|"); - strcat(facemenu, pym->name); - strcat(facemenu, " %x"); - sprintf(menu_number, "%d", i+4); - strcat(facemenu, menu_number); - } - - ret= pupmenu(facemenu); - - if(ret==1) addfaces_from_edgenet(); - else if(ret==2) make_fgon(1); - else if(ret==3) make_fgon(0); - else if (ret >= 4) { - BPY_menu_do_python(PYMENU_MESHFACEKEY, ret - 4); - return; - } - return; - } - else if(amount<2) { - error("Incorrect number of vertices to make edge/face"); - return; - } - - efa= NULL; // check later - - if(amount==3) { - - if(exist_face_overlaps(neweve[0], neweve[1], neweve[2], NULL)==0) { - efa= addfacelist(neweve[0], neweve[1], neweve[2], 0, NULL, NULL); - EM_select_face(efa, 1); - } - else error("The selected vertices already form a face"); - } - else if(amount==4) { - /* this test survives when theres 2 triangles */ - if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) { - int tria= 0; - - /* remove trias if they exist, 4 cases.... */ - if(exist_face(neweve[0], neweve[1], neweve[2], NULL)) tria++; - if(exist_face(neweve[0], neweve[1], neweve[3], NULL)) tria++; - if(exist_face(neweve[0], neweve[2], neweve[3], NULL)) tria++; - if(exist_face(neweve[1], neweve[2], neweve[3], NULL)) tria++; - - if(tria==2) join_triangles(); - else if(exist_face_overlaps(neweve[0], neweve[1], neweve[2], neweve[3])==0) { - /* If there are 4 Verts, But more selected edges, we need to call addfaces_from_edgenet */ - EditEdge *eedcheck; - int count; - count = 0; - for(eedcheck= em->edges.first; eedcheck; eedcheck= eedcheck->next) { - if(eedcheck->f & SELECT) { - count++; - } - } - - if(count++ > 4){ - addfaces_from_edgenet(); - return; - } else { - /* if 4 edges exist, we just create the face, convex or not */ - efa= addface_from_edges(); - if(efa==NULL) { - /* the order of vertices can be anything, 6 cases to check */ - if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) { - efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL); - } - else if( convex(neweve[0]->co, neweve[2]->co, neweve[3]->co, neweve[1]->co) ) { - efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], NULL, NULL); - } - else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) { - efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL); - } - - else if( convex(neweve[1]->co, neweve[2]->co, neweve[3]->co, neweve[0]->co) ) { - efa= addfacelist(neweve[1], neweve[2], neweve[3], neweve[0], NULL, NULL); - } - else if( convex(neweve[1]->co, neweve[3]->co, neweve[0]->co, neweve[2]->co) ) { - efa= addfacelist(neweve[1], neweve[3], neweve[0], neweve[2], NULL, NULL); - } - else if( convex(neweve[1]->co, neweve[3]->co, neweve[2]->co, neweve[0]->co) ) { - efa= addfacelist(neweve[1], neweve[3], neweve[2], neweve[0], NULL, NULL); - } - else error("The selected vertices form a concave quad"); - } - } - } - else error("The selected vertices already form a face"); - } - else error("The selected vertices already form a face"); - } - - if(efa) { - EM_select_face(efa, 1); - - fix_new_face(efa); - - recalc_editnormals(); - BIF_undo_push("Add face"); - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - - -void adduplicate_mesh(void) -{ - - TEST_EDITMESH - if(multires_test()) return; - - waitcursor(1); - - adduplicateflag(SELECT); - - waitcursor(0); - countall(); - - /* We need to force immediate calculation here because - * transform may use derived objects (which are now stale). - * - * This shouldn't be necessary, derived queries should be - * automatically building this data if invalid. Or something. - */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - object_handle_update(G.obedit); - - BIF_TransformSetUndo("Add Duplicate"); - initTransform(TFM_TRANSLATION, CTX_NO_PET); - Transform(); -} - -/* check whether an object to add mesh to exists, if not, create one -* returns 1 if new object created, else 0 */ -int confirm_objectExists( Mesh **me, float mat[][3] ) -{ - int newob = 0; - - /* deselectall */ - EM_clear_flag_all(SELECT); - - /* if no obedit: new object and enter editmode */ - if(G.obedit==NULL) { - /* add_object actually returns an object ! :-) - But it also stores the added object struct in - G.scene->basact->object (BASACT->object) */ - - add_object_draw(OB_MESH); - - G.obedit= BASACT->object; - - where_is_object(G.obedit); - - make_editMesh(); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - newob= 1; - } - *me = G.obedit->data; - - /* imat and center and size */ - Mat3CpyMat4(mat, G.obedit->obmat); - - return newob; -} - -void make_prim(int type, float imat[3][3], int tot, int seg, - int subdiv, float dia, float d, int ext, int fill, - float cent[3]) -{ - /* - * type - for the type of shape - * dia - the radius for cone,sphere cylinder etc. - * d - depth for the cone - * ext - ? - * fill - end capping, and option to fill in circle - * cent[3] - center of the data. - * */ - - EditMesh *em = G.editMesh; - EditVert *eve, *v1=NULL, *v2, *v3, *v4=NULL, *vtop, *vdown; - float phi, phid, vec[3]; - float q[4], cmat[3][3], nor[3]= {0.0, 0.0, 0.0}; - short a, b; - - phid= 2*M_PI/tot; - phi= .25*M_PI; - - switch(type) { - case 10: /* grid */ - /* clear flags */ - eve= em->verts.first; - while(eve) { - eve->f= 0; - eve= eve->next; - } - /* one segment first: the X axis */ - phi= 1.0; - phid= 2.0/((float)tot-1); - for(a=0;af= 1+2+4; - if (a) { - addedgelist(eve->prev, eve, NULL); - } - phi-=phid; - } - /* extrude and translate */ - vec[0]= vec[2]= 0.0; - vec[1]= dia*phid; - Mat3MulVecfl(imat, vec); - for(a=0;averts.first; - while(eve) { - eve->f= 0; - eve= eve->next; - } - - /* one segment first */ - phi= 0; - phid/=2; - for(a=0; a<=tot; a++) { - vec[0]= dia*sin(phi); - vec[1]= 0.0; - vec[2]= dia*cos(phi); - eve= addvertlist(vec, NULL); - eve->f= 1+2+4; - if(a==0) v1= eve; - else addedgelist(eve->prev, eve, NULL); - phi+= phid; - } - - /* extrude and rotate */ - phi= M_PI/seg; - q[0]= cos(phi); - q[3]= sin(phi); - q[1]=q[2]= 0; - QuatToMat3(q, cmat); - - for(a=0; aco, cmat); - } - - removedoublesflag(4, 0, 0.0001); - - /* and now do imat */ - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - VecAddf(eve->co,eve->co,cent); - Mat3MulVecfl(imat,eve->co); - } - eve= eve->next; - } - break; - case 12: /* Icosphere */ - { - EditVert *eva[12]; - EditEdge *eed; - - /* clear all flags */ - eve= em->verts.first; - while(eve) { - eve->f= 0; - eve= eve->next; - } - dia/=200; - for(a=0;a<12;a++) { - vec[0]= dia*icovert[a][0]; - vec[1]= dia*icovert[a][1]; - vec[2]= dia*icovert[a][2]; - eva[a]= addvertlist(vec, NULL); - eva[a]->f= 1+2; - } - for(a=0;a<20;a++) { - EditFace *evtemp; - v1= eva[ icoface[a][0] ]; - v2= eva[ icoface[a][1] ]; - v3= eva[ icoface[a][2] ]; - evtemp = addfacelist(v1, v2, v3, 0, NULL, NULL); - evtemp->e1->f = 1+2; - evtemp->e2->f = 1+2; - evtemp->e3->f = 1+2; - } - - dia*=200; - for(a=1; averts.first; - while(eve) { - if(eve->f & 2) { - VecAddf(eve->co,eve->co,cent); - Mat3MulVecfl(imat,eve->co); - } - eve= eve->next; - } - - // Clear the flag 2 from the edges - for(eed=em->edges.first;eed;eed=eed->next){ - if(eed->f & 2){ - eed->f &= !2; - } - } - } - break; - case 13: /* Monkey */ - { - extern int monkeyo, monkeynv, monkeynf; - extern signed char monkeyf[][4]; - extern signed char monkeyv[][3]; - EditVert **tv= MEM_mallocN(sizeof(*tv)*monkeynv*2, "tv"); - EditFace *efa; - int i; - - for (i=0; if |= SELECT; - tv[monkeynv+i]= (fabs(v[0]= -v[0])<0.001)?tv[i]:addvertlist(v, NULL); - tv[monkeynv+i]->f |= SELECT; - } - for (i=0; iverts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - VecAddf(eve->co,eve->co,cent); - Mat3MulVecfl(imat,eve->co); - } - } - recalc_editnormals(); - } - break; - default: /* all types except grid, sphere... */ - if(ext==0 && type!=7) d= 0; - - /* vertices */ - vtop= vdown= v1= v2= 0; - for(b=0; b<=ext; b++) { - for(a=0; af= SELECT; - if(a==0) { - if(b==0) v1= eve; - else v2= eve; - } - phi+=phid; - } - d= -d; - } - /* center vertices */ - /* type 7, a cone can only have 1 one side filled - * if the cone has no capping, dont add vtop */ - if((fill && type>1) || type == 7) { - VECCOPY(vec,cent); - vec[2]-= -d; - Mat3MulVecfl(imat,vec); - vdown= addvertlist(vec, NULL); - if((ext || type==7) && fill) { - VECCOPY(vec,cent); - vec[2]-= d; - Mat3MulVecfl(imat,vec); - vtop= addvertlist(vec, NULL); - } - } else { - vdown= v1; - vtop= v2; - } - if(vtop) vtop->f= SELECT; - if(vdown) vdown->f= SELECT; - - /* top and bottom face */ - if(fill || type==7) { - if(tot==4 && (type==0 || type==1)) { - v3= v1->next->next; - if(ext) v4= v2->next->next; - - addfacelist(v3, v1->next, v1, v3->next, NULL, NULL); - if(ext) addfacelist(v2, v2->next, v4, v4->next, NULL, NULL); - - } - else { - v3= v1; - v4= v2; - for(a=1; anext, 0, NULL, NULL); - v3= v3->next; - if(ext && fill) { - addfacelist(vtop, v4, v4->next, 0, NULL, NULL); - v4= v4->next; - } - } - if(type>1) { - addfacelist(vdown, v3, v1, 0, NULL, NULL); - if(ext) addfacelist(vtop, v4, v2, 0, NULL, NULL); - } - } - } - else if(type==4) { /* we need edges for a circle */ - v3= v1; - for(a=1;anext, NULL); - v3= v3->next; - } - addedgelist(v3, v1, NULL); - } - /* side faces */ - if(ext) { - v3= v1; - v4= v2; - for(a=1; anext, v4->next, v4, NULL, NULL); - v3= v3->next; - v4= v4->next; - } - addfacelist(v3, v1, v2, v4, NULL, NULL); - } - else if(type==7 && fill) { - /* add the bottom flat area of the cone - * if capping is disabled dont bother */ - v3= v1; - for(a=1; anext, v3, 0, NULL, NULL); - v3= v3->next; - } - addfacelist(vtop, v1, v3, 0, NULL, NULL); - } - } - /* simple selection flush OK, based on fact it's a single model */ - EM_select_flush(); /* flushes vertex -> edge -> face selection */ - - if(type!=0 && type!=13) - righthandfaces(1); /* otherwise monkey has eyes in wrong direction */ -} - -void add_primitiveMesh(int type) -{ - Mesh *me; - float *curs, d, dia, phi, phid, cent[3], imat[3][3], mat[3][3]; - float cmat[3][3]; - static int tot=32, seg=32, subdiv=2, - /* so each type remembers its fill setting */ - fill_circle=0, fill_cone=1, fill_cylinder=1; - - int ext=0, fill=0, totoud, newob=0; - char *undostr="Add Primitive"; - char *name=NULL; - - if(G.scene->id.lib) return; - - /* this function also comes from an info window */ - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - if(G.vd==0) return; - - if (G.obedit && G.obedit->type==OB_MESH && multires_test()) return; - - /* if editmode exists for other type, it exits */ - check_editmode(OB_MESH); - - if(G.f & (G_VERTEXPAINT+G_TEXTUREPAINT)) { - G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT); - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - } - - totoud= tot; /* store, and restore when cube/plane */ - - dia= G.vd->grid; - d= G.vd->grid; - - /* ext==extrudeflag, tot==amount of vertices in basis */ - switch(type) { - case 0: /* plane */ - tot= 4; - ext= 0; - fill= 1; - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Plane"; - undostr="Add Plane"; - break; - case 1: /* cube */ - tot= 4; - ext= 1; - fill= 1; - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Cube"; - undostr="Add Cube"; - break; - case 4: /* circle */ - add_numbut(0, NUM|INT, "Vertices:", 3, 500, &tot, NULL); - add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - add_numbut(2, TOG|INT, "Fill", 0, 0, &(fill_circle), NULL); - if (!(do_clever_numbuts("Add Circle", 3, REDRAW))) return; - ext= 0; - fill = fill_circle; - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Circle"; - undostr="Add Circle"; - break; - case 5: /* cylinder */ - d*=2; - add_numbut(0, NUM|INT, "Vertices:", 2, 500, &tot, NULL); - add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - add_numbut(2, NUM|FLO, "Depth:", 0.001*G.vd->grid, 100*G.vd->grid, &d, NULL); - add_numbut(3, TOG|INT, "Cap Ends", 0, 0, &(fill_cylinder), NULL); - if (!(do_clever_numbuts("Add Cylinder", 4, REDRAW))) return; - ext= 1; - fill = fill_cylinder; - d/=2; - newob = confirm_objectExists( &me, mat ); - if(newob) { - if (fill) name = "Cylinder"; - else name = "Tube"; - } - undostr="Add Cylinder"; - break; - case 7: /* cone */ - d*=2; - add_numbut(0, NUM|INT, "Vertices:", 2, 500, &tot, NULL); - add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - add_numbut(2, NUM|FLO, "Depth:", 0.001*G.vd->grid, 100*G.vd->grid, &d, NULL); - add_numbut(3, TOG|INT, "Cap End", 0, 0, &(fill_cone), NULL); - if (!(do_clever_numbuts("Add Cone", 4, REDRAW))) return; - d/=2; - ext= 0; - fill = fill_cone; - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Cone"; - undostr="Add Cone"; - break; - case 10: /* grid */ - add_numbut(0, NUM|INT, "X res:", 3, 1000, &tot, NULL); - add_numbut(1, NUM|INT, "Y res:", 3, 1000, &seg, NULL); - if (!(do_clever_numbuts("Add Grid", 2, REDRAW))) return; - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Grid"; - undostr="Add Grid"; - break; - case 11: /* UVsphere */ - add_numbut(0, NUM|INT, "Segments:", 3, 500, &seg, NULL); - add_numbut(1, NUM|INT, "Rings:", 3, 500, &tot, NULL); - add_numbut(2, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - - if (!(do_clever_numbuts("Add UV Sphere", 3, REDRAW))) return; - - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Sphere"; - undostr="Add UV Sphere"; - break; - case 12: /* Icosphere */ - add_numbut(0, NUM|INT, "Subdivision:", 1, 8, &subdiv, NULL); - add_numbut(1, NUM|FLO, "Radius:", 0.001*G.vd->grid, 100*G.vd->grid, &dia, NULL); - if (!(do_clever_numbuts("Add Ico Sphere", 2, REDRAW))) return; - - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Sphere"; - undostr="Add Ico Sphere"; - break; - case 13: /* Monkey */ - newob = confirm_objectExists( &me, mat ); - if(newob) name = "Suzanne"; - undostr="Add Monkey"; - break; - default: - newob = confirm_objectExists( &me, mat ); - break; - } - - if( name!=NULL ) { - rename_id((ID *)G.obedit, name ); - rename_id((ID *)me, name ); - } - - d = -d; - curs= give_cursor(); - VECCOPY(cent, curs); - cent[0]-= G.obedit->obmat[3][0]; - cent[1]-= G.obedit->obmat[3][1]; - cent[2]-= G.obedit->obmat[3][2]; - - if ( !(newob) || U.flag & USER_ADD_VIEWALIGNED) Mat3CpyMat4(imat, G.vd->viewmat); - else Mat3One(imat); - Mat3MulVecfl(imat, cent); - Mat3MulMat3(cmat, imat, mat); - Mat3Inv(imat,cmat); - - - if(type == 0 || type == 1) /* plane, cube (diameter of 1.41 makes it unit size) */ - dia *= sqrt(2.0); - - phid= 2*M_PI/tot; - phi= .25*M_PI; - - make_prim(type, imat, tot, seg, subdiv, dia, d, ext, fill, cent); - - if(type<2) tot = totoud; - - /* simple selection flush OK, based on fact it's a single model */ - EM_select_flush(); // flushes vertex -> edge -> face selection - - if(type!=0 && type!=13) righthandfaces(1); /* otherwise monkey has eyes in wrong direction... */ - countall(); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - /* if a new object was created, it stores it in Mesh, for reload original data and undo */ - if ( !(newob) || U.flag & USER_ADD_EDITMODE) { - if(newob) load_editMesh(); - } else { - exit_editmode(2); - } - - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ - allqueue(REDRAWALL, 0); - - BIF_undo_push(undostr); -} - diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c deleted file mode 100644 index d9b8fa93eb9..00000000000 --- a/source/blender/src/editmesh_lib.c +++ /dev/null @@ -1,2239 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - -editmesh_lib: generic (no UI, no menus) operations/evaluators for editmesh data - -*/ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" - -#include "BIF_editmesh.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BSE_edit.h" - -#include "editmesh.h" - -/* this replaces the active flag used in uv/face mode */ -void EM_set_actFace(EditFace *efa) -{ - G.editMesh->act_face = efa; -} - -EditFace * EM_get_actFace(void) -{ - return G.editMesh->act_face; -} - -/* ********* Selection History ************ */ -static int EM_check_selection(void *data) -{ - EditSelection *ese; - - for(ese = G.editMesh->selected.first; ese; ese = ese->next){ - if(ese->data == data) return 1; - } - - return 0; -} - -void EM_remove_selection(void *data, int type) -{ - EditSelection *ese; - for(ese=G.editMesh->selected.first; ese; ese = ese->next){ - if(ese->data == data){ - BLI_freelinkN(&(G.editMesh->selected),ese); - break; - } - } -} - -void EM_store_selection(void *data, int type) -{ - EditSelection *ese; - if(!EM_check_selection(data)){ - ese = (EditSelection*) MEM_callocN( sizeof(EditSelection), "Edit Selection"); - ese->type = type; - ese->data = data; - BLI_addtail(&(G.editMesh->selected),ese); - } -} - -void EM_validate_selections(void) -{ - EditSelection *ese, *nextese; - EditMesh *em = G.editMesh; - ese = em->selected.first; - while(ese){ - nextese = ese->next; - if(ese->type == EDITVERT && !(((EditVert*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); - else if(ese->type == EDITEDGE && !(((EditEdge*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); - else if(ese->type == EDITFACE && !(((EditFace*)ese->data)->f & SELECT)) BLI_freelinkN(&(em->selected), ese); - ese = nextese; - } -} - -static void EM_strip_selections(void) -{ - EditSelection *ese, *nextese; - if(!(G.scene->selectmode & SCE_SELECT_VERTEX)){ - ese = G.editMesh->selected.first; - while(ese){ - nextese = ese->next; - if(ese->type == EDITVERT) BLI_freelinkN(&(G.editMesh->selected),ese); - ese = nextese; - } - } - if(!(G.scene->selectmode & SCE_SELECT_EDGE)){ - ese=G.editMesh->selected.first; - while(ese){ - nextese = ese->next; - if(ese->type == EDITEDGE) BLI_freelinkN(&(G.editMesh->selected), ese); - ese = nextese; - } - } - if(!(G.scene->selectmode & SCE_SELECT_FACE)){ - ese=G.editMesh->selected.first; - while(ese){ - nextese = ese->next; - if(ese->type == EDITFACE) BLI_freelinkN(&(G.editMesh->selected), ese); - ese = nextese; - } - } -} - -/* generic way to get data from an EditSelection type -These functions were written to be used by the Modifier widget when in Rotate about active mode, -but can be used anywhere. -EM_editselection_center -EM_editselection_normal -EM_editselection_plane -*/ -void EM_editselection_center(float *center, EditSelection *ese) -{ - if (ese->type==EDITVERT) { - EditVert *eve= ese->data; - VecCopyf(center, eve->co); - } else if (ese->type==EDITEDGE) { - EditEdge *eed= ese->data; - VecAddf(center, eed->v1->co, eed->v2->co); - VecMulf(center, 0.5); - } else if (ese->type==EDITFACE) { - EditFace *efa= ese->data; - VecCopyf(center, efa->cent); - } -} - -void EM_editselection_normal(float *normal, EditSelection *ese) -{ - if (ese->type==EDITVERT) { - EditVert *eve= ese->data; - VecCopyf(normal, eve->no); - } else if (ese->type==EDITEDGE) { - EditEdge *eed= ese->data; - float plane[3]; /* need a plane to correct the normal */ - float vec[3]; /* temp vec storage */ - - VecAddf(normal, eed->v1->no, eed->v2->no); - VecSubf(plane, eed->v2->co, eed->v1->co); - - /* the 2 vertex normals will be close but not at rightangles to the edge - for rotate about edge we want them to be at right angles, so we need to - do some extra colculation to correct the vert normals, - we need the plane for this */ - Crossf(vec, normal, plane); - Crossf(normal, plane, vec); - Normalize(normal); - - } else if (ese->type==EDITFACE) { - EditFace *efa= ese->data; - VecCopyf(normal, efa->n); - } -} - -/* Calculate a plane that is rightangles to the edge/vert/faces normal -also make the plane run allong an axis that is related to the geometry, -because this is used for the manipulators Y axis.*/ -void EM_editselection_plane(float *plane, EditSelection *ese) -{ - if (ese->type==EDITVERT) { - EditVert *eve= ese->data; - float vec[3]={0,0,0}; - - if (ese->prev) { /*use previously selected data to make a usefull vertex plane */ - EM_editselection_center(vec, ese->prev); - VecSubf(plane, vec, eve->co); - } else { - /* make a fake plane thats at rightangles to the normal - we cant make a crossvec from a vec thats the same as the vec - unlikely but possible, so make sure if the normal is (0,0,1) - that vec isnt the same or in the same direction even.*/ - if (eve->no[0]<0.5) vec[0]=1; - else if (eve->no[1]<0.5) vec[1]=1; - else vec[2]=1; - Crossf(plane, eve->no, vec); - } - } else if (ese->type==EDITEDGE) { - EditEdge *eed= ese->data; - - /*the plane is simple, it runs allong the edge - however selecting different edges can swap the direction of the y axis. - this makes it less likely for the y axis of the manipulator - (running along the edge).. to flip less often. - at least its more pradictable */ - if (eed->v2->co[1] > eed->v1->co[1]) /*check which to do first */ - VecSubf(plane, eed->v2->co, eed->v1->co); - else - VecSubf(plane, eed->v1->co, eed->v2->co); - - } else if (ese->type==EDITFACE) { - EditFace *efa= ese->data; - float vec[3]; - if (efa->v4) { /*if its a quad- set the plane along the 2 longest edges.*/ - float vecA[3], vecB[3]; - VecSubf(vecA, efa->v4->co, efa->v3->co); - VecSubf(vecB, efa->v1->co, efa->v2->co); - VecAddf(plane, vecA, vecB); - - VecSubf(vecA, efa->v1->co, efa->v4->co); - VecSubf(vecB, efa->v2->co, efa->v3->co); - VecAddf(vec, vecA, vecB); - /*use the biggest edge length*/ - if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2]) - VecCopyf(plane, vec); - } else { - /*start with v1-2 */ - VecSubf(plane, efa->v1->co, efa->v2->co); - - /*test the edge between v2-3, use if longer */ - VecSubf(vec, efa->v2->co, efa->v3->co); - if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2]) - VecCopyf(plane, vec); - - /*test the edge between v1-3, use if longer */ - VecSubf(vec, efa->v3->co, efa->v1->co); - if (plane[0]*plane[0]+plane[1]*plane[1]+plane[2]*plane[2] < vec[0]*vec[0]+vec[1]*vec[1]+vec[2]*vec[2]) - VecCopyf(plane, vec); - } - } - Normalize(plane); -} - - - -void EM_select_face(EditFace *efa, int sel) -{ - if(sel) { - efa->f |= SELECT; - efa->e1->f |= SELECT; - efa->e2->f |= SELECT; - efa->e3->f |= SELECT; - if(efa->e4) efa->e4->f |= SELECT; - efa->v1->f |= SELECT; - efa->v2->f |= SELECT; - efa->v3->f |= SELECT; - if(efa->v4) efa->v4->f |= SELECT; - } - else { - efa->f &= ~SELECT; - efa->e1->f &= ~SELECT; - efa->e2->f &= ~SELECT; - efa->e3->f &= ~SELECT; - if(efa->e4) efa->e4->f &= ~SELECT; - efa->v1->f &= ~SELECT; - efa->v2->f &= ~SELECT; - efa->v3->f &= ~SELECT; - if(efa->v4) efa->v4->f &= ~SELECT; - } -} - -void EM_select_edge(EditEdge *eed, int sel) -{ - if(sel) { - eed->f |= SELECT; - eed->v1->f |= SELECT; - eed->v2->f |= SELECT; - } - else { - eed->f &= ~SELECT; - eed->v1->f &= ~SELECT; - eed->v2->f &= ~SELECT; - } -} - -void EM_select_face_fgon(EditFace *efa, int val) -{ - EditMesh *em = G.editMesh; - short index=0; - - if(efa->fgonf==0) EM_select_face(efa, val); - else { - if(efa->e1->fgoni) index= efa->e1->fgoni; - if(efa->e2->fgoni) index= efa->e2->fgoni; - if(efa->e3->fgoni) index= efa->e3->fgoni; - if(efa->v4 && efa->e4->fgoni) index= efa->e4->fgoni; - - if(index==0) printf("wrong fgon select\n"); - - // select all ngon faces with index - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->fgonf) { - if(efa->e1->fgoni==index || efa->e2->fgoni==index || - efa->e3->fgoni==index || (efa->e4 && efa->e4->fgoni==index) ) { - EM_select_face(efa, val); - } - } - } - } -} - - -/* only vertices */ -int faceselectedOR(EditFace *efa, int flag) -{ - if ((efa->v1->f | efa->v2->f | efa->v3->f | (efa->v4?efa->v4->f:0))&flag) { - return 1; - } else { - return 0; - } -} - -// replace with (efa->f & SELECT) -int faceselectedAND(EditFace *efa, int flag) -{ - if ((efa->v1->f & efa->v2->f & efa->v3->f & (efa->v4?efa->v4->f:flag))&flag) { - return 1; - } else { - return 0; - } -} - -int EM_nfaces_selected(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - int count= 0; - - for (efa= em->faces.first; efa; efa= efa->next) - if (efa->f & SELECT) - count++; - - return count; -} - -#if 0 -static int EM_nedges(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - int count= 0; - - for (eed= em->edges.first; eed; eed= eed->next) count++; - return count; -} -#endif - -int EM_nvertices_selected(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - int count= 0; - - for (eve= em->verts.first; eve; eve= eve->next) - if (eve->f & SELECT) - count++; - - return count; -} - -void EM_clear_flag_all(int flag) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - for (eve= em->verts.first; eve; eve= eve->next) eve->f &= ~flag; - for (eed= em->edges.first; eed; eed= eed->next) eed->f &= ~flag; - for (efa= em->faces.first; efa; efa= efa->next) efa->f &= ~flag; - - if(flag & SELECT) BLI_freelistN(&(G.editMesh->selected)); -} - -void EM_set_flag_all(int flag) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - for (eve= em->verts.first; eve; eve= eve->next) if(eve->h==0) eve->f |= flag; - for (eed= em->edges.first; eed; eed= eed->next) if(eed->h==0) eed->f |= flag; - for (efa= em->faces.first; efa; efa= efa->next) if(efa->h==0) efa->f |= flag; - -} - -/* flush for changes in vertices only */ -void EM_deselect_flush(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->f & eed->v2->f & SELECT); - else eed->f &= ~SELECT; - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->v4) { - if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT ); - else efa->f &= ~SELECT; - } - else { - if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT ); - else efa->f &= ~SELECT; - } - } -} - - -/* flush selection to edges & faces */ - -/* this only based on coherent selected vertices, for example when adding new - objects. call clear_flag_all() before you select vertices to be sure it ends OK! - -*/ - -void EM_select_flush(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->f & eed->v2->f & SELECT) eed->f |= SELECT; - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->v4) { - if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT ) efa->f |= SELECT; - } - else { - if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT ) efa->f |= SELECT; - } - } -} - -/* when vertices or edges can be selected, also make fgon consistant */ -static void check_fgons_selection() -{ - EditMesh *em = G.editMesh; - EditFace *efa, *efan; - EditEdge *eed; - ListBase *lbar; - int sel, desel, index, totfgon= 0; - - /* count amount of fgons */ - for(eed= em->edges.first; eed; eed= eed->next) - if(eed->fgoni>totfgon) totfgon= eed->fgoni; - - if(totfgon==0) return; - - lbar= MEM_callocN((totfgon+1)*sizeof(ListBase), "listbase array"); - - /* put all fgons in lbar */ - for(efa= em->faces.first; efa; efa= efan) { - efan= efa->next; - index= efa->e1->fgoni; - if(index==0) index= efa->e2->fgoni; - if(index==0) index= efa->e3->fgoni; - if(index==0 && efa->e4) index= efa->e4->fgoni; - if(index) { - BLI_remlink(&em->faces, efa); - BLI_addtail(&lbar[index], efa); - } - } - - /* now check the fgons */ - for(index=1; index<=totfgon; index++) { - /* we count on vertices/faces/edges being set OK, so we only have to set ngon itself */ - sel= desel= 0; - for(efa= lbar[index].first; efa; efa= efa->next) { - if(efa->e1->fgoni==0) { - if(efa->e1->f & SELECT) sel++; - else desel++; - } - if(efa->e2->fgoni==0) { - if(efa->e2->f & SELECT) sel++; - else desel++; - } - if(efa->e3->fgoni==0) { - if(efa->e3->f & SELECT) sel++; - else desel++; - } - if(efa->e4 && efa->e4->fgoni==0) { - if(efa->e4->f & SELECT) sel++; - else desel++; - } - - if(sel && desel) break; - } - - if(sel && desel) sel= 0; - else if(sel) sel= 1; - else sel= 0; - - /* select/deselect and put back */ - for(efa= lbar[index].first; efa; efa= efa->next) { - if(sel) efa->f |= SELECT; - else efa->f &= ~SELECT; - } - addlisttolist(&em->faces, &lbar[index]); - } - - MEM_freeN(lbar); -} - - -/* flush to edges & faces */ - -/* based on select mode it selects edges/faces - assumed is that verts/edges/faces were properly selected themselves - with the calls above -*/ - -void EM_selectmode_flush(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - - // flush to edges & faces - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->f & eed->v2->f & SELECT) eed->f |= SELECT; - else eed->f &= ~SELECT; - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->v4) { - if(efa->v1->f & efa->v2->f & efa->v3->f & efa->v4->f & SELECT) efa->f |= SELECT; - else efa->f &= ~SELECT; - } - else { - if(efa->v1->f & efa->v2->f & efa->v3->f & SELECT) efa->f |= SELECT; - else efa->f &= ~SELECT; - } - } - } - // flush to faces - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e4) { - if(efa->e1->f & efa->e2->f & efa->e3->f & efa->e4->f & SELECT) efa->f |= SELECT; - else efa->f &= ~SELECT; - } - else { - if(efa->e1->f & efa->e2->f & efa->e3->f & SELECT) efa->f |= SELECT; - else efa->f &= ~SELECT; - } - } - } - // make sure selected faces have selected edges too, for extrude (hack?) - else if(G.scene->selectmode & SCE_SELECT_FACE) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) EM_select_face(efa, 1); - } - } - check_fgons_selection(); - -} - -void EM_convertsel(short oldmode, short selectmode) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - /*clear flags*/ - for(eve= em->verts.first; eve; eve= eve->next) eve->f1 = 0; - for(eed= em->edges.first; eed; eed= eed->next) eed->f1 = 0; - for(efa= em->faces.first; efa; efa= efa->next) efa->f1 = 0; - - /*have to find out what the selectionmode was previously*/ - if(oldmode == SCE_SELECT_VERTEX) { - if(selectmode == SCE_SELECT_EDGE){ - /*select all edges associated with every selected vertex*/ - for(eed= em->edges.first; eed; eed= eed->next){ - if(eed->v1->f&SELECT) eed->f1 = 1; - else if(eed->v2->f&SELECT) eed->f1 = 1; - } - - for(eed= em->edges.first; eed; eed= eed->next){ - if(eed->f1 == 1) EM_select_edge(eed,1); - } - } - else if(selectmode == SCE_SELECT_FACE){ - /*select all faces associated with every selected vertex*/ - for(efa= em->faces.first; efa; efa= efa->next){ - if(efa->v1->f&SELECT) efa->f1 = 1; - else if(efa->v2->f&SELECT) efa->f1 = 1; - else if(efa->v3->f&SELECT) efa->f1 = 1; - else{ - if(efa->v4){ - if(efa->v4->f&SELECT) efa->f1 =1; - } - } - } - for(efa= em->faces.first; efa; efa= efa->next){ - if(efa->f1 == 1) EM_select_face(efa,1); - } - } - } - - if(oldmode == SCE_SELECT_EDGE){ - if(selectmode == SCE_SELECT_FACE){ - for(efa= em->faces.first; efa; efa= efa->next){ - if(efa->e1->f&SELECT) efa->f1 = 1; - else if(efa->e2->f&SELECT) efa->f1 = 1; - else if(efa->e3->f&SELECT) efa->f1 = 1; - else if(efa->e4){ - if(efa->e4->f&SELECT) efa->f1 = 1; - } - } - for(efa= em->faces.first; efa; efa= efa->next){ - if(efa->f1 == 1) EM_select_face(efa,1); - } - } - } - - check_fgons_selection(); -} - -/* when switching select mode, makes sure selection is consistant for editing */ -/* also for paranoia checks to make sure edge or face mode works */ -void EM_selectmode_set(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - EM_strip_selections(); /*strip EditSelections from em->selected that are not relevant to new mode*/ - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - /* vertices -> edges -> faces */ - for (eed= em->edges.first; eed; eed= eed->next) eed->f &= ~SELECT; - for (efa= em->faces.first; efa; efa= efa->next) efa->f &= ~SELECT; - - EM_select_flush(); - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - /* deselect vertices, and select again based on edge select */ - for(eve= em->verts.first; eve; eve= eve->next) eve->f &= ~SELECT; - for(eed= em->edges.first; eed; eed= eed->next) - if(eed->f & SELECT) EM_select_edge(eed, 1); - /* selects faces based on edge status */ - EM_selectmode_flush(); - } - else if(G.scene->selectmode & SCE_SELECT_FACE) { - /* deselect eges, and select again based on face select */ - for(eed= em->edges.first; eed; eed= eed->next) EM_select_edge(eed, 0); - - for(efa= em->faces.first; efa; efa= efa->next) - if(efa->f & SELECT) EM_select_face(efa, 1); - } -} - -/* paranoia check, actually only for entering editmode. rule: -- vertex hidden, always means edge is hidden too -- edge hidden, always means face is hidden too -- face hidden, dont change anything -*/ -void EM_hide_reset(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - - for(eed= em->edges.first; eed; eed= eed->next) - if(eed->v1->h || eed->v2->h) eed->h |= 1; - - for(efa= em->faces.first; efa; efa= efa->next) - if((efa->e1->h & 1) || (efa->e2->h & 1) || (efa->e3->h & 1) || (efa->e4 && (efa->e4->h & 1))) - efa->h= 1; - -} - -void EM_data_interp_from_verts(EditVert *v1, EditVert *v2, EditVert *eve, float fac) -{ - EditMesh *em= G.editMesh; - void *src[2]; - float w[2]; - - if (v1->data && v2->data) { - src[0]= v1->data; - src[1]= v2->data; - w[0] = 1.0f-fac; - w[1] = fac; - - CustomData_em_interp(&em->vdata, src, w, NULL, 2, eve->data); - } -} - -void EM_data_interp_from_faces(EditFace *efa1, EditFace *efa2, EditFace *efan, int i1, int i2, int i3, int i4) -{ - EditMesh *em= G.editMesh; - float w[2][4][4]; - void *src[2]; - int count = (efa2)? 2: 1; - - if (efa1->data) { - /* set weights for copying from corners directly to other corners */ - memset(w, 0, sizeof(w)); - - w[i1/4][0][i1%4]= 1.0f; - w[i2/4][1][i2%4]= 1.0f; - w[i3/4][2][i3%4]= 1.0f; - if (i4 != -1) - w[i4/4][3][i4%4]= 1.0f; - - src[0]= efa1->data; - src[1]= (efa2)? efa2->data: NULL; - - CustomData_em_interp(&em->fdata, src, NULL, (float*)w, count, efan->data); - } -} - -EditFace *EM_face_from_faces(EditFace *efa1, EditFace *efa2, int i1, int i2, int i3, int i4) -{ - EditFace *efan; - EditVert **v[2]; - - v[0]= &efa1->v1; - v[1]= (efa2)? &efa2->v1: NULL; - - efan= addfacelist(v[i1/4][i1%4], v[i2/4][i2%4], v[i3/4][i3%4], - (i4 == -1)? 0: v[i4/4][i4%4], efa1, NULL); - - EM_data_interp_from_faces(efa1, efa2, efan, i1, i2, i3, i4); - - return efan; -} - -static void update_data_blocks(CustomData *olddata, CustomData *data) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - EditVert *eve; - void *block; - - if (data == &G.editMesh->vdata) { - for(eve= em->verts.first; eve; eve= eve->next) { - block = NULL; - CustomData_em_set_default(data, &block); - CustomData_em_copy_data(olddata, data, eve->data, &block); - CustomData_em_free_block(olddata, &eve->data); - eve->data= block; - } - } - else if (data == &G.editMesh->fdata) { - for(efa= em->faces.first; efa; efa= efa->next) { - block = NULL; - CustomData_em_set_default(data, &block); - CustomData_em_copy_data(olddata, data, efa->data, &block); - CustomData_em_free_block(olddata, &efa->data); - efa->data= block; - } - } -} - -void EM_add_data_layer(CustomData *data, int type) -{ - CustomData olddata; - - olddata= *data; - olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL; - CustomData_add_layer(data, type, CD_CALLOC, NULL, 0); - - update_data_blocks(&olddata, data); - if (olddata.layers) MEM_freeN(olddata.layers); -} - -void EM_free_data_layer(CustomData *data, int type) -{ - CustomData olddata; - - olddata= *data; - olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL; - CustomData_free_layer_active(data, type, 0); - - update_data_blocks(&olddata, data); - if (olddata.layers) MEM_freeN(olddata.layers); -} - -/* ******** EXTRUDE ********* */ - -static void add_normal_aligned(float *nor, float *add) -{ - if( INPR(nor, add) < 0.0 ) - VecSubf(nor, nor, add); - else - VecAddf(nor, nor, add); -} - -static void set_edge_directions_f2(int val) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - int do_all= 1; - - /* edge directions are used for extrude, to detect direction of edges that make new faces */ - /* we have set 'f2' flags in edges that need to get a direction set (e.g. get new face) */ - /* the val argument differs... so we need it as arg */ - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - do_all= 0; - if(efa->e1->f2e1->v1 == efa->v1) efa->e1->dir= 0; - else efa->e1->dir= 1; - } - if(efa->e2->f2e2->v1 == efa->v2) efa->e2->dir= 0; - else efa->e2->dir= 1; - } - if(efa->e3->f2e3->v1 == efa->v3) efa->e3->dir= 0; - else efa->e3->dir= 1; - } - if(efa->e4 && efa->e4->f2e4->v1 == efa->v4) efa->e4->dir= 0; - else efa->e4->dir= 1; - } - } - } - /* ok, no faces done... then we at least set it for exterior edges */ - if(do_all) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e1->v1 == efa->v1) efa->e1->dir= 0; - else efa->e1->dir= 1; - if(efa->e2->v1 == efa->v2) efa->e2->dir= 0; - else efa->e2->dir= 1; - if(efa->e3->v1 == efa->v3) efa->e3->dir= 0; - else efa->e3->dir= 1; - if(efa->e4) { - if(efa->e4->v1 == efa->v4) efa->e4->dir= 0; - else efa->e4->dir= 1; - } - } - } -} - -/* individual face extrude */ -/* will use vertex normals for extrusion directions, so *nor is unaffected */ -short extrudeflag_face_indiv(short flag, float *nor) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *v1, *v2, *v3, *v4; - EditEdge *eed; - EditFace *efa, *nextfa; - - if(G.obedit==0 || get_mesh(G.obedit)==0) return 0; - - /* selected edges with 1 or more selected face become faces */ - /* selected faces each makes new faces */ - /* always remove old faces, keeps volumes manifold */ - /* select the new extrusion, deselect old */ - - /* step 1; init, count faces in edges */ - recalc_editnormals(); - - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; // new select flag - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f2= 0; // amount of unselected faces - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT); - else { - efa->e1->f2++; - efa->e2->f2++; - efa->e3->f2++; - if(efa->e4) efa->e4->f2++; - } - } - - /* step 2: make new faces from faces */ - for(efa= em->faces.last; efa; efa= efa->prev) { - if(efa->f & SELECT) { - v1= addvertlist(efa->v1->co, efa->v1); - v2= addvertlist(efa->v2->co, efa->v2); - v3= addvertlist(efa->v3->co, efa->v3); - - v1->f1= v2->f1= v3->f1= 1; - VECCOPY(v1->no, efa->n); - VECCOPY(v2->no, efa->n); - VECCOPY(v3->no, efa->n); - if(efa->v4) { - v4= addvertlist(efa->v4->co, efa->v4); - v4->f1= 1; - VECCOPY(v4->no, efa->n); - } - else v4= NULL; - - /* side faces, clockwise */ - addfacelist(efa->v2, v2, v1, efa->v1, efa, NULL); - addfacelist(efa->v3, v3, v2, efa->v2, efa, NULL); - if(efa->v4) { - addfacelist(efa->v4, v4, v3, efa->v3, efa, NULL); - addfacelist(efa->v1, v1, v4, efa->v4, efa, NULL); - } - else { - addfacelist(efa->v1, v1, v3, efa->v3, efa, NULL); - } - /* top face */ - addfacelist(v1, v2, v3, v4, efa, NULL); - } - } - - /* step 3: remove old faces */ - efa= em->faces.first; - while(efa) { - nextfa= efa->next; - if(efa->f & SELECT) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextfa; - } - - /* step 4: redo selection */ - EM_clear_flag_all(SELECT); - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f1) eve->f |= SELECT; - } - - EM_select_flush(); - - return 'n'; -} - - -/* extrudes individual edges */ -/* nor is filled with constraint vector */ -short extrudeflag_edges_indiv(short flag, float *nor) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - for(eve= em->verts.first; eve; eve= eve->next) eve->tmp.v = NULL; - for(eed= em->edges.first; eed; eed= eed->next) { - eed->tmp.f = NULL; - eed->f2= ((eed->f & flag)!=0); - } - - set_edge_directions_f2(2); - - /* sample for next loop */ - for(efa= em->faces.first; efa; efa= efa->next) { - efa->e1->tmp.f = efa; - efa->e2->tmp.f = efa; - efa->e3->tmp.f = efa; - if(efa->e4) efa->e4->tmp.f = efa; - } - /* make the faces */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & flag) { - if(eed->v1->tmp.v == NULL) - eed->v1->tmp.v = addvertlist(eed->v1->co, eed->v1); - if(eed->v2->tmp.v == NULL) - eed->v2->tmp.v = addvertlist(eed->v2->co, eed->v2); - - if(eed->dir==1) - addfacelist(eed->v1, eed->v2, - eed->v2->tmp.v, eed->v1->tmp.v, - eed->tmp.f, NULL); - else - addfacelist(eed->v2, eed->v1, - eed->v1->tmp.v, eed->v2->tmp.v, - eed->tmp.f, NULL); - - /* for transform */ - if(eed->tmp.f) { - efa = eed->tmp.f; - if (efa->f & SELECT) add_normal_aligned(nor, efa->n); - } - } - } - Normalize(nor); - - /* set correct selection */ - EM_clear_flag_all(SELECT); - for(eve= em->verts.last; eve; eve= eve->prev) { - if(eve->tmp.v) { - eve->tmp.v->f |= flag; - } - } - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->f & eed->v2->f & flag) eed->f |= flag; - } - - if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // g is grab - return 'n'; // n is for normal constraint -} - -/* extrudes individual vertices */ -short extrudeflag_verts_indiv(short flag, float *nor) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - - /* make the edges */ - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & flag) { - eve->tmp.v = addvertlist(eve->co, eve); - addedgelist(eve, eve->tmp.v, NULL); - } - else eve->tmp.v = NULL; - } - - /* set correct selection */ - EM_clear_flag_all(SELECT); - - for(eve= em->verts.last; eve; eve= eve->prev) - if (eve->tmp.v) - eve->tmp.v->f |= flag; - - return 'g'; // g is grab -} - - -/* this is actually a recode of extrudeflag(), using proper edge/face select */ -/* hurms, doesnt use 'flag' yet, but its not called by primitive making stuff anyway */ -static short extrudeflag_edge(short flag, float *nor) -{ - /* all select edges/faces: extrude */ - /* old select is cleared, in new ones it is set */ - EditMesh *em = G.editMesh; - EditVert *eve, *nextve; - EditEdge *eed, *nexted; - EditFace *efa, *nextfa; - short del_old= 0; - ModifierData *md; - - if(G.obedit==0 || get_mesh(G.obedit)==0) return 0; - - md = G.obedit->modifiers.first; - - /* selected edges with 0 or 1 selected face become faces */ - /* selected faces generate new faces */ - - /* if *one* selected face has edge with unselected face; remove old selected faces */ - - /* if selected edge is not used anymore; remove */ - /* if selected vertex is not used anymore: remove */ - - /* select the new extrusion, deselect old */ - - - /* step 1; init, count faces in edges */ - recalc_editnormals(); - - for(eve= em->verts.first; eve; eve= eve->next) { - eve->tmp.v = NULL; - eve->f1= 0; - } - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; // amount of unselected faces - eed->f2= 0; // amount of selected faces - if(eed->f & SELECT) { - eed->v1->f1= 1; // we call this 'selected vertex' now - eed->v2->f1= 1; - } - eed->tmp.f = NULL; // here we tuck face pointer, as sample - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - efa->e1->f2++; - efa->e2->f2++; - efa->e3->f2++; - if(efa->e4) efa->e4->f2++; - - // sample for next loop - efa->e1->tmp.f = efa; - efa->e2->tmp.f = efa; - efa->e3->tmp.f = efa; - if(efa->e4) efa->e4->tmp.f = efa; - } - else { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - - /* If a mirror modifier with clipping is on, we need to adjust some - * of the cases above to handle edges on the line of symmetry. - */ - for (; md; md=md->next) { - if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - - if(mmd->flag & MOD_MIR_CLIPPING) { - float mtx[4][4]; - if (mmd->mirror_ob) { - float imtx[4][4]; - Mat4Invert(imtx, mmd->mirror_ob->obmat); - Mat4MulMat4(mtx, G.obedit->obmat, imtx); - } - - for (eed= em->edges.first; eed; eed= eed->next) { - if(eed->f2 == 1) { - float co1[3], co2[3]; - - VecCopyf(co1, eed->v1->co); - VecCopyf(co2, eed->v2->co); - - if (mmd->mirror_ob) { - VecMat4MulVecfl(co1, mtx, co1); - VecMat4MulVecfl(co2, mtx, co2); - } - - if (mmd->flag & MOD_MIR_AXIS_X) - if ( (fabs(co1[0]) < mmd->tolerance) && - (fabs(co2[0]) < mmd->tolerance) ) - ++eed->f2; - - if (mmd->flag & MOD_MIR_AXIS_Y) - if ( (fabs(co1[1]) < mmd->tolerance) && - (fabs(co2[1]) < mmd->tolerance) ) - ++eed->f2; - - if (mmd->flag & MOD_MIR_AXIS_Z) - if ( (fabs(co1[2]) < mmd->tolerance) && - (fabs(co2[2]) < mmd->tolerance) ) - ++eed->f2; - } - } - } - } - } - - set_edge_directions_f2(2); - - /* step 1.5: if *one* selected face has edge with unselected face; remove old selected faces */ - for(efa= em->faces.last; efa; efa= efa->prev) { - if(efa->f & SELECT) { - if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1 || (efa->e4 && efa->e4->f1)) { - del_old= 1; - break; - } - } - } - - /* step 2: make new faces from edges */ - for(eed= em->edges.last; eed; eed= eed->prev) { - if(eed->f & SELECT) { - if(eed->f2<2) { - if(eed->v1->tmp.v == NULL) - eed->v1->tmp.v = addvertlist(eed->v1->co, eed->v1); - if(eed->v2->tmp.v == NULL) - eed->v2->tmp.v = addvertlist(eed->v2->co, eed->v2); - - /* if del_old, the preferred normal direction is exact - * opposite as for keep old faces - */ - if(eed->dir!=del_old) - addfacelist(eed->v1, eed->v2, - eed->v2->tmp.v, eed->v1->tmp.v, - eed->tmp.f, NULL); - else - addfacelist(eed->v2, eed->v1, - eed->v1->tmp.v, eed->v2->tmp.v, - eed->tmp.f, NULL); - } - } - } - - /* step 3: make new faces from faces */ - for(efa= em->faces.last; efa; efa= efa->prev) { - if(efa->f & SELECT) { - if (efa->v1->tmp.v == NULL) - efa->v1->tmp.v = addvertlist(efa->v1->co, efa->v1); - if (efa->v2->tmp.v ==NULL) - efa->v2->tmp.v = addvertlist(efa->v2->co, efa->v2); - if (efa->v3->tmp.v ==NULL) - efa->v3->tmp.v = addvertlist(efa->v3->co, efa->v3); - if (efa->v4 && (efa->v4->tmp.v == NULL)) - efa->v4->tmp.v = addvertlist(efa->v4->co, efa->v4); - - if(del_old==0) { // keep old faces means flipping normal - if(efa->v4) - addfacelist(efa->v4->tmp.v, efa->v3->tmp.v, - efa->v2->tmp.v, efa->v1->tmp.v, efa, efa); - else - addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, - efa->v1->tmp.v, NULL, efa, efa); - } - else { - if(efa->v4) - addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, - efa->v3->tmp.v, efa->v4->tmp.v, efa, efa); - else - addfacelist(efa->v1->tmp.v, efa->v2->tmp.v, - efa->v3->tmp.v, NULL, efa, efa); - } - - /* for transform */ - add_normal_aligned(nor, efa->n); - } - } - - if(del_old) { - /* step 4: remove old faces, if del_old */ - efa= em->faces.first; - while(efa) { - nextfa= efa->next; - if(efa->f & SELECT) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextfa; - } - - /* step 5: remove selected unused edges */ - /* start tagging again */ - for(eed= em->edges.first; eed; eed= eed->next) eed->f1=0; - for(efa= em->faces.first; efa; efa= efa->next) { - efa->e1->f1= 1; - efa->e2->f1= 1; - efa->e3->f1= 1; - if(efa->e4) efa->e4->f1= 1; - } - /* remove */ - eed= em->edges.first; - while(eed) { - nexted= eed->next; - if(eed->f & SELECT) { - if(eed->f1==0) { - remedge(eed); - free_editedge(eed); - } - } - eed= nexted; - } - - /* step 6: remove selected unused vertices */ - for(eed= em->edges.first; eed; eed= eed->next) - eed->v1->f1= eed->v2->f1= 0; - - eve= em->verts.first; - while(eve) { - nextve= eve->next; - if(eve->f1) { - // hack... but we need it for step 7, redoing selection - if(eve->tmp.v) eve->tmp.v->tmp.v= eve->tmp.v; - - BLI_remlink(&em->verts, eve); - free_editvert(eve); - } - eve= nextve; - } - } - - Normalize(nor); // translation normal grab - - /* step 7: redo selection */ - EM_clear_flag_all(SELECT); - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->tmp.v) { - eve->tmp.v->f |= SELECT; - } - } - - EM_select_flush(); - - if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // grab - return 'n'; // normal constraint -} - -short extrudeflag_vert(short flag, float *nor) -{ - /* all verts/edges/faces with (f & 'flag'): extrude */ - /* from old verts, 'flag' is cleared, in new ones it is set */ - EditMesh *em = G.editMesh; - EditVert *eve, *v1, *v2, *v3, *v4, *nextve; - EditEdge *eed, *e1, *e2, *e3, *e4, *nexted; - EditFace *efa, *efa2, *nextvl; - short sel=0, del_old= 0, is_face_sel=0; - ModifierData *md; - - if(G.obedit==0 || get_mesh(G.obedit)==0) return 0; - - md = G.obedit->modifiers.first; - - /* clear vert flag f1, we use this to detect a loose selected vertice */ - eve= em->verts.first; - while(eve) { - if(eve->f & flag) eve->f1= 1; - else eve->f1= 0; - eve= eve->next; - } - /* clear edges counter flag, if selected we set it at 1 */ - eed= em->edges.first; - while(eed) { - if( (eed->v1->f & flag) && (eed->v2->f & flag) ) { - eed->f2= 1; - eed->v1->f1= 0; - eed->v2->f1= 0; - } - else eed->f2= 0; - - eed->f1= 1; /* this indicates it is an 'old' edge (in this routine we make new ones) */ - eed->tmp.f = NULL; /* used as sample */ - - eed= eed->next; - } - - /* we set a flag in all selected faces, and increase the associated edge counters */ - - efa= em->faces.first; - while(efa) { - efa->f1= 0; - - if(faceselectedAND(efa, flag)) { - e1= efa->e1; - e2= efa->e2; - e3= efa->e3; - e4= efa->e4; - - if(e1->f2 < 3) e1->f2++; - if(e2->f2 < 3) e2->f2++; - if(e3->f2 < 3) e3->f2++; - if(e4 && e4->f2 < 3) e4->f2++; - - efa->f1= 1; - is_face_sel= 1; // for del_old - } - else if(faceselectedOR(efa, flag)) { - e1= efa->e1; - e2= efa->e2; - e3= efa->e3; - e4= efa->e4; - - if( (e1->v1->f & flag) && (e1->v2->f & flag) ) e1->f1= 2; - if( (e2->v1->f & flag) && (e2->v2->f & flag) ) e2->f1= 2; - if( (e3->v1->f & flag) && (e3->v2->f & flag) ) e3->f1= 2; - if( e4 && (e4->v1->f & flag) && (e4->v2->f & flag) ) e4->f1= 2; - } - - // sample for next loop - efa->e1->tmp.f = efa; - efa->e2->tmp.f = efa; - efa->e3->tmp.f = efa; - if(efa->e4) efa->e4->tmp.f = efa; - - efa= efa->next; - } - - set_edge_directions_f2(3); - - /* the current state now is: - eve->f1==1: loose selected vertex - - eed->f2==0 : edge is not selected, no extrude - eed->f2==1 : edge selected, is not part of a face, extrude - eed->f2==2 : edge selected, is part of 1 face, extrude - eed->f2==3 : edge selected, is part of more faces, no extrude - - eed->f1==0: new edge - eed->f1==1: edge selected, is part of selected face, when eed->f==3: remove - eed->f1==2: edge selected, part of a partially selected face - - efa->f1==1 : duplicate this face - */ - - /* If a mirror modifier with clipping is on, we need to adjust some - * of the cases above to handle edges on the line of symmetry. - */ - for (; md; md=md->next) { - if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - - if(mmd->flag & MOD_MIR_CLIPPING) { - float mtx[4][4]; - if (mmd->mirror_ob) { - float imtx[4][4]; - Mat4Invert(imtx, mmd->mirror_ob->obmat); - Mat4MulMat4(mtx, G.obedit->obmat, imtx); - } - - for (eed= em->edges.first; eed; eed= eed->next) { - if(eed->f2 == 2) { - float co1[3], co2[3]; - - VecCopyf(co1, eed->v1->co); - VecCopyf(co2, eed->v2->co); - - if (mmd->mirror_ob) { - VecMat4MulVecfl(co1, mtx, co1); - VecMat4MulVecfl(co2, mtx, co2); - } - - if (mmd->flag & MOD_MIR_AXIS_X) - if ( (fabs(co1[0]) < mmd->tolerance) && - (fabs(co2[0]) < mmd->tolerance) ) - ++eed->f2; - - if (mmd->flag & MOD_MIR_AXIS_Y) - if ( (fabs(co1[1]) < mmd->tolerance) && - (fabs(co2[1]) < mmd->tolerance) ) - ++eed->f2; - if (mmd->flag & MOD_MIR_AXIS_Z) - if ( (fabs(co1[2]) < mmd->tolerance) && - (fabs(co2[2]) < mmd->tolerance) ) - ++eed->f2; - } - } - } - } - } - - /* copy all selected vertices, */ - /* write pointer to new vert in old struct at eve->tmp.v */ - eve= em->verts.last; - while(eve) { - eve->f &= ~128; /* clear, for later test for loose verts */ - if(eve->f & flag) { - sel= 1; - v1= addvertlist(0, NULL); - - VECCOPY(v1->co, eve->co); - v1->f= eve->f; - eve->f-= flag; - eve->tmp.v = v1; - } - else eve->tmp.v = 0; - eve= eve->prev; - } - - if(sel==0) return 0; - - /* all edges with eed->f2==1 or eed->f2==2 become faces */ - - /* if del_old==1 then extrude is in partial geometry, to keep it manifold. - verts with f1==0 and (eve->f & 128)==0) are removed - edges with eed->f2>2 are removed - faces with efa->f1 are removed - if del_old==0 the extrude creates a volume. - */ - - /* find if we delete old faces */ - if(is_face_sel) { - for(eed= em->edges.first; eed; eed= eed->next) { - if( (eed->f2==1 || eed->f2==2) ) { - if(eed->f1==2) { - del_old= 1; - break; - } - } - } - } - - eed= em->edges.last; - while(eed) { - nexted= eed->prev; - if( eed->f2<3) { - eed->v1->f |= 128; /* = no loose vert! */ - eed->v2->f |= 128; - } - if( (eed->f2==1 || eed->f2==2) ) { - - /* if del_old, the preferred normal direction is exact opposite as for keep old faces */ - if(eed->dir != del_old) - efa2 = addfacelist(eed->v1, eed->v2, - eed->v2->tmp.v, eed->v1->tmp.v, - eed->tmp.f, NULL); - else - efa2 = addfacelist(eed->v2, eed->v1, - eed->v1->tmp.v, eed->v2->tmp.v, - eed->tmp.f, NULL); - - /* Needs smarter adaption of existing creases. - * If addedgelist is used, make sure seams are set to 0 on these - * new edges, since we do not want to add any seams on extrusion. - */ - efa2->e1->crease= eed->crease; - efa2->e2->crease= eed->crease; - efa2->e3->crease= eed->crease; - if(efa2->e4) efa2->e4->crease= eed->crease; - } - - eed= nexted; - } - if(del_old) { - eed= em->edges.first; - while(eed) { - nexted= eed->next; - if(eed->f2==3 && eed->f1==1) { - remedge(eed); - free_editedge(eed); - } - eed= nexted; - } - } - /* duplicate faces, if necessary remove old ones */ - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - if(efa->f1 & 1) { - - v1 = efa->v1->tmp.v; - v2 = efa->v2->tmp.v; - v3 = efa->v3->tmp.v; - if(efa->v4) - v4 = efa->v4->tmp.v; - else - v4= 0; - - /* hmm .. not sure about edges here */ - if(del_old==0) // if we keep old, we flip normal - efa2= addfacelist(v3, v2, v1, v4, efa, efa); - else - efa2= addfacelist(v1, v2, v3, v4, efa, efa); - - /* for transform */ - add_normal_aligned(nor, efa->n); - - if(del_old) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - } - efa= nextvl; - } - - Normalize(nor); // for grab - - /* for all vertices with eve->tmp.v!=0 - if eve->f1==1: make edge - if flag!=128 : if del_old==1: remove - */ - eve= em->verts.last; - while(eve) { - nextve= eve->prev; - if(eve->tmp.v) { - if(eve->f1==1) addedgelist(eve, eve->tmp.v, NULL); - else if( (eve->f & 128)==0) { - if(del_old) { - BLI_remlink(&em->verts,eve); - free_editvert(eve); - eve= NULL; - } - } - } - if(eve) { - eve->f &= ~128; - } - eve= nextve; - } - // since its vertex select mode now, it also deselects higher order - EM_selectmode_flush(); - - if(nor[0]==0.0 && nor[1]==0.0 && nor[2]==0.0) return 'g'; // g is grab, for correct undo print - return 'n'; -} - -/* generic extrude */ -short extrudeflag(short flag, float *nor) -{ - if(G.scene->selectmode & SCE_SELECT_VERTEX) - return extrudeflag_vert(flag, nor); - else - return extrudeflag_edge(flag, nor); - -} - -void rotateflag(short flag, float *cent, float rotmat[][3]) -{ - /* all verts with (flag & 'flag') rotate */ - EditMesh *em = G.editMesh; - EditVert *eve; - - eve= em->verts.first; - while(eve) { - if(eve->f & flag) { - eve->co[0]-=cent[0]; - eve->co[1]-=cent[1]; - eve->co[2]-=cent[2]; - Mat3MulVecfl(rotmat,eve->co); - eve->co[0]+=cent[0]; - eve->co[1]+=cent[1]; - eve->co[2]+=cent[2]; - } - eve= eve->next; - } -} - -void translateflag(short flag, float *vec) -{ - /* all verts with (flag & 'flag') translate */ - EditMesh *em = G.editMesh; - EditVert *eve; - - eve= em->verts.first; - while(eve) { - if(eve->f & flag) { - eve->co[0]+=vec[0]; - eve->co[1]+=vec[1]; - eve->co[2]+=vec[2]; - } - eve= eve->next; - } -} - -/* helper call for below */ -static EditVert *adduplicate_vertex(EditVert *eve, int flag) -{ - /* FIXME: copy deformation weight from eve ok here? */ - EditVert *v1= addvertlist(eve->co, eve); - - v1->f= eve->f; - eve->f-= flag; - eve->f|= 128; - - eve->tmp.v = v1; - - return v1; -} - -/* old selection has flag 128 set, and flag 'flag' cleared -new selection has flag 'flag' set */ -void adduplicateflag(int flag) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *v1, *v2, *v3, *v4; - EditEdge *eed, *newed; - EditFace *efa, *newfa; - - EM_clear_flag_all(128); - EM_selectmode_set(); // paranoia check, selection now is consistant - - /* vertices first */ - for(eve= em->verts.last; eve; eve= eve->prev) { - - if(eve->f & flag) - adduplicate_vertex(eve, flag); - else - eve->tmp.v = NULL; - } - - /* copy edges, note that vertex selection can be independent of edge */ - for(eed= em->edges.last; eed; eed= eed->prev) { - if( eed->f & flag ) { - v1 = eed->v1->tmp.v; - if(v1==NULL) v1= adduplicate_vertex(eed->v1, flag); - v2 = eed->v2->tmp.v; - if(v2==NULL) v2= adduplicate_vertex(eed->v2, flag); - - newed= addedgelist(v1, v2, eed); - - newed->f= eed->f; - eed->f -= flag; - eed->f |= 128; - } - } - - /* then duplicate faces, again create new vertices if needed */ - for(efa= em->faces.last; efa; efa= efa->prev) { - if(efa->f & flag) { - v1 = efa->v1->tmp.v; - if(v1==NULL) v1= adduplicate_vertex(efa->v1, flag); - v2 = efa->v2->tmp.v; - if(v2==NULL) v2= adduplicate_vertex(efa->v2, flag); - v3 = efa->v3->tmp.v; - if(v3==NULL) v3= adduplicate_vertex(efa->v3, flag); - if(efa->v4) { - v4 = efa->v4->tmp.v; - if(v4==NULL) v4= adduplicate_vertex(efa->v4, flag); - } - else v4= NULL; - - newfa= addfacelist(v1, v2, v3, v4, efa, efa); - - newfa->f= efa->f; - efa->f -= flag; - efa->f |= 128; - } - } - - EM_fgon_flags(); // redo flags and indices for fgons -} - -void delfaceflag(int flag) -{ - EditMesh *em = G.editMesh; - /* delete all faces with 'flag', including loose edges and loose vertices */ - /* this is maybe a bit weird, but this function is used for 'split' and 'separate' */ - /* in remaining vertices/edges 'flag' is cleared */ - EditVert *eve,*nextve; - EditEdge *eed, *nexted; - EditFace *efa,*nextvl; - - /* to detect loose edges, we put f2 flag on 1 */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & flag) eed->f2= 1; - else eed->f2= 0; - } - - /* delete faces */ - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - if(efa->f & flag) { - - efa->e1->f2= 1; - efa->e2->f2= 1; - efa->e3->f2= 1; - if(efa->e4) { - efa->e4->f2= 1; - } - - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - - /* all remaining faces: make sure we keep the edges */ - for(efa= em->faces.first; efa; efa= efa->next) { - efa->e1->f2= 0; - efa->e2->f2= 0; - efa->e3->f2= 0; - if(efa->e4) { - efa->e4->f2= 0; - } - } - - /* remove tagged edges, and clear remaining ones */ - eed= em->edges.first; - while(eed) { - nexted= eed->next; - - if(eed->f2==1) { - remedge(eed); - free_editedge(eed); - } - else { - eed->f &= ~flag; - eed->v1->f &= ~flag; - eed->v2->f &= ~flag; - } - eed= nexted; - } - - /* vertices with 'flag' now are the loose ones, and will be removed */ - eve= em->verts.first; - while(eve) { - nextve= eve->next; - if(eve->f & flag) { - BLI_remlink(&em->verts, eve); - free_editvert(eve); - } - eve= nextve; - } - -} - -/* ********************* */ -#if 0 -static int check_vnormal_flip(float *n, float *vnorm) -{ - float inp; - - inp= n[0]*vnorm[0]+n[1]*vnorm[1]+n[2]*vnorm[2]; - - /* angles 90 degrees: dont flip */ - if(inp> -0.000001) return 0; - - return 1; -} -#endif - -void flipface(EditFace *efa) -{ - if(efa->v4) { - SWAP(EditVert *, efa->v2, efa->v4); - SWAP(EditEdge *, efa->e1, efa->e4); - SWAP(EditEdge *, efa->e2, efa->e3); - EM_data_interp_from_faces(efa, NULL, efa, 0, 3, 2, 1); - } - else { - SWAP(EditVert *, efa->v2, efa->v3); - SWAP(EditEdge *, efa->e1, efa->e3); - efa->e2->dir= 1-efa->e2->dir; - EM_data_interp_from_faces(efa, NULL, efa, 0, 2, 1, 3); - } - - if(efa->v4) CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n); - else CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n); -} - - -void flip_editnormals(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - efa= em->faces.first; - while(efa) { - if( efa->f & SELECT ){ - flipface(efa); - } - efa= efa->next; - } -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif -} - -/* does face centers too */ -void recalc_editnormals(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditVert *eve; - - for(eve= em->verts.first; eve; eve=eve->next) { - eve->no[0] = eve->no[1] = eve->no[2] = 0.0; - } - - for(efa= em->faces.first; efa; efa=efa->next) { - if(efa->v4) { - CalcNormFloat4(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, efa->n); - CalcCent4f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co); - VecAddf(efa->v4->no, efa->v4->no, efa->n); - } - else { - CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n); - CalcCent3f(efa->cent, efa->v1->co, efa->v2->co, efa->v3->co); - } - VecAddf(efa->v1->no, efa->v1->no, efa->n); - VecAddf(efa->v2->no, efa->v2->no, efa->n); - VecAddf(efa->v3->no, efa->v3->no, efa->n); - } - - /* following Mesh convention; we use vertex coordinate itself for normal in this case */ - for(eve= em->verts.first; eve; eve=eve->next) { - if (Normalize(eve->no)==0.0) { - VECCOPY(eve->no, eve->co); - Normalize(eve->no); - } - } -} - -int compareface(EditFace *vl1, EditFace *vl2) -{ - EditVert *v1, *v2, *v3, *v4; - - if(vl1->v4 && vl2->v4) { - v1= vl2->v1; - v2= vl2->v2; - v3= vl2->v3; - v4= vl2->v4; - - if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1 || vl1->v4==v1) { - if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2 || vl1->v4==v2) { - if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3 || vl1->v4==v3) { - if(vl1->v1==v4 || vl1->v2==v4 || vl1->v3==v4 || vl1->v4==v4) { - return 1; - } - } - } - } - } - else if(vl1->v4==0 && vl2->v4==0) { - v1= vl2->v1; - v2= vl2->v2; - v3= vl2->v3; - - if(vl1->v1==v1 || vl1->v2==v1 || vl1->v3==v1) { - if(vl1->v1==v2 || vl1->v2==v2 || vl1->v3==v2) { - if(vl1->v1==v3 || vl1->v2==v3 || vl1->v3==v3) { - return 1; - } - } - } - } - - return 0; -} - -/* checks for existance, not tria overlapping inside quad */ -EditFace *exist_face(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4) -{ - EditMesh *em = G.editMesh; - EditFace *efa, efatest; - - efatest.v1= v1; - efatest.v2= v2; - efatest.v3= v3; - efatest.v4= v4; - - efa= em->faces.first; - while(efa) { - if(compareface(&efatest, efa)) return efa; - efa= efa->next; - } - return NULL; -} - -/* evaluate if entire quad is a proper convex quad */ -int convex(float *v1, float *v2, float *v3, float *v4) -{ - float nor[3], nor1[3], nor2[3], vec[4][2]; - - /* define projection, do both trias apart, quad is undefined! */ - CalcNormFloat(v1, v2, v3, nor1); - CalcNormFloat(v1, v3, v4, nor2); - nor[0]= ABS(nor1[0]) + ABS(nor2[0]); - nor[1]= ABS(nor1[1]) + ABS(nor2[1]); - nor[2]= ABS(nor1[2]) + ABS(nor2[2]); - - if(nor[2] >= nor[0] && nor[2] >= nor[1]) { - vec[0][0]= v1[0]; vec[0][1]= v1[1]; - vec[1][0]= v2[0]; vec[1][1]= v2[1]; - vec[2][0]= v3[0]; vec[2][1]= v3[1]; - vec[3][0]= v4[0]; vec[3][1]= v4[1]; - } - else if(nor[1] >= nor[0] && nor[1]>= nor[2]) { - vec[0][0]= v1[0]; vec[0][1]= v1[2]; - vec[1][0]= v2[0]; vec[1][1]= v2[2]; - vec[2][0]= v3[0]; vec[2][1]= v3[2]; - vec[3][0]= v4[0]; vec[3][1]= v4[2]; - } - else { - vec[0][0]= v1[1]; vec[0][1]= v1[2]; - vec[1][0]= v2[1]; vec[1][1]= v2[2]; - vec[2][0]= v3[1]; vec[2][1]= v3[2]; - vec[3][0]= v4[1]; vec[3][1]= v4[2]; - } - - /* linetests, the 2 diagonals have to instersect to be convex */ - if( IsectLL2Df(vec[0], vec[2], vec[1], vec[3]) > 0 ) return 1; - return 0; -} - - -/* ********************* Fake Polgon support (FGon) ***************** */ - - -/* results in: - - faces having ->fgonf flag set (also for draw) - - edges having ->fgoni index set (for select) -*/ - -float EM_face_area(EditFace *efa) -{ - if(efa->v4) return AreaQ3Dfl(efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co); - else return AreaT3Dfl(efa->v1->co, efa->v2->co, efa->v3->co); -} - -float EM_face_perimeter(EditFace *efa) -{ - if(efa->v4) return - VecLenf(efa->v1->co, efa->v2->co)+ - VecLenf(efa->v2->co, efa->v3->co)+ - VecLenf(efa->v3->co, efa->v4->co)+ - VecLenf(efa->v4->co, efa->v1->co); - - else return - VecLenf(efa->v1->co, efa->v2->co)+ - VecLenf(efa->v2->co, efa->v3->co)+ - VecLenf(efa->v3->co, efa->v1->co); -} - -void EM_fgon_flags(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa, *efan, *efamax; - EditEdge *eed; - ListBase listb={NULL, NULL}; - float size, maxsize; - short done, curindex= 1; - - // for each face with fgon edge AND not fgon flag set - for(eed= em->edges.first; eed; eed= eed->next) eed->fgoni= 0; // index - for(efa= em->faces.first; efa; efa= efa->next) efa->fgonf= 0; // flag - - // for speed & simplicity, put fgon face candidates in new listbase - efa= em->faces.first; - while(efa) { - efan= efa->next; - if( (efa->e1->h & EM_FGON) || (efa->e2->h & EM_FGON) || - (efa->e3->h & EM_FGON) || (efa->e4 && (efa->e4->h & EM_FGON)) ) { - BLI_remlink(&em->faces, efa); - BLI_addtail(&listb, efa); - } - efa= efan; - } - - // find an undone face with fgon edge - for(efa= listb.first; efa; efa= efa->next) { - if(efa->fgonf==0) { - - // init this face - efa->fgonf= EM_FGON; - if(efa->e1->h & EM_FGON) efa->e1->fgoni= curindex; - if(efa->e2->h & EM_FGON) efa->e2->fgoni= curindex; - if(efa->e3->h & EM_FGON) efa->e3->fgoni= curindex; - if(efa->e4 && (efa->e4->h & EM_FGON)) efa->e4->fgoni= curindex; - - // we search for largest face, to give facedot drawing rights - maxsize= EM_face_area(efa); - efamax= efa; - - // now flush curendex over edges and set faceflags - done= 1; - while(done==1) { - done= 0; - - for(efan= listb.first; efan; efan= efan->next) { - if(efan->fgonf==0) { - // if one if its edges has index set, do other too - if( (efan->e1->fgoni==curindex) || (efan->e2->fgoni==curindex) || - (efan->e3->fgoni==curindex) || (efan->e4 && (efan->e4->fgoni==curindex)) ) { - - efan->fgonf= EM_FGON; - if(efan->e1->h & EM_FGON) efan->e1->fgoni= curindex; - if(efan->e2->h & EM_FGON) efan->e2->fgoni= curindex; - if(efan->e3->h & EM_FGON) efan->e3->fgoni= curindex; - if(efan->e4 && (efan->e4->h & EM_FGON)) efan->e4->fgoni= curindex; - - size= EM_face_area(efan); - if(size>maxsize) { - efamax= efan; - maxsize= size; - } - done= 1; - } - } - } - } - - efamax->fgonf |= EM_FGON_DRAW; - curindex++; - - } - } - - // put fgon face candidates back in listbase - efa= listb.first; - while(efa) { - efan= efa->next; - BLI_remlink(&listb, efa); - BLI_addtail(&em->faces, efa); - efa= efan; - } - - // remove fgon flags when edge not in fgon (anymore) - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->fgoni==0) eed->h &= ~EM_FGON; - } - -} - -/* editmesh vertmap, copied from intern.mesh.c - * if do_face_idx_array is 0 it means we need to run it as well as freeing - * */ - -UvVertMap *make_uv_vert_map_EM(int selected, int do_face_idx_array, float *limit) -{ - EditMesh *em = G.editMesh; - EditVert *ev; - EditFace *efa; - int totverts; - - /* vars from original func */ - UvVertMap *vmap; - UvMapVert *buf; - MTFace *tf; - unsigned int a; - int i, totuv, nverts; - - if (do_face_idx_array) - EM_init_index_arrays(0, 0, 1); - - /* we need the vert */ - for (ev= em->verts.first, totverts=0; ev; ev= ev->next, totverts++) { - ev->tmp.l = totverts; - } - - totuv = 0; - - /* generate UvMapVert array */ - for (efa= em->faces.first; efa; efa= efa->next) - if(!selected || ((!efa->h) && (efa->f & SELECT))) - totuv += (efa->v4)? 4: 3; - - if(totuv==0) - return NULL; - - vmap= (UvVertMap*)MEM_mallocN(sizeof(*vmap), "UvVertMap"); - if (!vmap) - return NULL; - - vmap->vert= (UvMapVert**)MEM_callocN(sizeof(*vmap->vert)*totverts, "UvMapVert*"); - buf= vmap->buf= (UvMapVert*)MEM_mallocN(sizeof(*vmap->buf)*totuv, "UvMapVert"); - - if (!vmap->vert || !vmap->buf) { - free_uv_vert_map(vmap); - return NULL; - } - - for (a=0, efa= em->faces.first; efa; a++, efa= efa->next) { - if(!selected || ((!efa->h) && (efa->f & SELECT))) { - nverts= (efa->v4)? 4: 3; - - for(i=0; itfindex= i; - buf->f= a; - buf->separate = 0; - - buf->next= vmap->vert[(*(&efa->v1 + i))->tmp.l]; - vmap->vert[(*(&efa->v1 + i))->tmp.l]= buf; - - buf++; - } - } - } - - /* sort individual uvs for each vert */ - for(a=0, ev=em->verts.first; ev; a++, ev= ev->next) { - UvMapVert *newvlist= NULL, *vlist=vmap->vert[a]; - UvMapVert *iterv, *v, *lastv, *next; - float *uv, *uv2, uvdiff[2]; - - while(vlist) { - v= vlist; - vlist= vlist->next; - v->next= newvlist; - newvlist= v; - - efa = EM_get_face_for_index(v->f); - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - uv = tf->uv[v->tfindex]; - - lastv= NULL; - iterv= vlist; - - while(iterv) { - next= iterv->next; - efa = EM_get_face_for_index(iterv->f); - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - uv2 = tf->uv[iterv->tfindex]; - - Vec2Subf(uvdiff, uv2, uv); - - if(fabs(uv[0]-uv2[0]) < limit[0] && fabs(uv[1]-uv2[1]) < limit[1]) { - if(lastv) lastv->next= next; - else vlist= next; - iterv->next= newvlist; - newvlist= iterv; - } - else - lastv=iterv; - - iterv= next; - } - - newvlist->separate = 1; - } - - vmap->vert[a]= newvlist; - } - - if (do_face_idx_array) - EM_free_index_arrays(); - - return vmap; -} - -UvMapVert *get_uv_map_vert_EM(UvVertMap *vmap, unsigned int v) -{ - return vmap->vert[v]; -} - -void free_uv_vert_map_EM(UvVertMap *vmap) -{ - if (vmap) { - if (vmap->vert) MEM_freeN(vmap->vert); - if (vmap->buf) MEM_freeN(vmap->buf); - MEM_freeN(vmap); - } -} - diff --git a/source/blender/src/editmesh_loop.c b/source/blender/src/editmesh_loop.c deleted file mode 100644 index c44a0607464..00000000000 --- a/source/blender/src/editmesh_loop.c +++ /dev/null @@ -1,954 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - -editmesh_loop: tools with own drawing subloops, select, knife, subdiv - -*/ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_view3d_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_ghash.h" - -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_cursors.h" -#include "BIF_editmesh.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BSE_view.h" -#include "BSE_edit.h" -#include "BSE_drawview.h" - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "PIL_time.h" - -#include "mydevice.h" -#include "blendef.h" - -#include "editmesh.h" - -/* next 2 includes for knife tool... shouldnt be! (ton) */ -#include "GHOST_C-api.h" -#include "winlay.h" - - -/* New LoopCut */ -static void edgering_sel(EditEdge *startedge, int select, int previewlines) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - EditVert *v[2][2]; - float co[2][3]; - int looking= 1,i; - - /* in eed->f1 we put the valence (amount of faces in edge) */ - /* in eed->f2 we put tagged flag as correct loop */ - /* in efa->f1 we put tagged flag as correct to select */ - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; - eed->f2= 0; - } - for(efa= em->faces.first; efa; efa= efa->next) { - efa->f1= 0; - if(efa->h==0) { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - - // tag startedge OK - startedge->f2= 1; - - while(looking) { - looking= 0; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e4 && efa->f1==0 && efa->h == 0) { // not done quad - if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { // valence ok - - // if edge tagged, select opposing edge and mark face ok - if(efa->e1->f2) { - efa->e3->f2= 1; - efa->f1= 1; - looking= 1; - } - else if(efa->e2->f2) { - efa->e4->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e3->f2) { - efa->e1->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e4->f2) { - efa->e2->f2= 1; - efa->f1= 1; - looking= 1; - } - } - } - } - } - - if(previewlines > 0 && select == 0){ - persp(PERSP_VIEW); - glPushMatrix(); - mymultmatrix(G.obedit->obmat); - //glColor3ub(0, 255, 255); - //glBegin(GL_LINES); - //glVertex3f(nearest->v1->co[0],nearest->v1->co[1],nearest->v1->co[2]); - //glVertex3f(nearest->v2->co[0],nearest->v2->co[1],nearest->v2->co[2]); - //glEnd(); - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->v4 == NULL) { continue; } - if(efa->h == 0){ - if(efa->e1->f2 == 1){ - if(efa->e1->h == 1 || efa->e3->h == 1 ) - continue; - - v[0][0] = efa->v1; - v[0][1] = efa->v2; - v[1][0] = efa->v4; - v[1][1] = efa->v3; - } else if(efa->e2->f2 == 1){ - if(efa->e2->h == 1 || efa->e4->h == 1) - continue; - v[0][0] = efa->v2; - v[0][1] = efa->v3; - v[1][0] = efa->v1; - v[1][1] = efa->v4; - } else { continue; } - - for(i=1;i<=previewlines;i++){ - co[0][0] = (v[0][1]->co[0] - v[0][0]->co[0])*(i/((float)previewlines+1))+v[0][0]->co[0]; - co[0][1] = (v[0][1]->co[1] - v[0][0]->co[1])*(i/((float)previewlines+1))+v[0][0]->co[1]; - co[0][2] = (v[0][1]->co[2] - v[0][0]->co[2])*(i/((float)previewlines+1))+v[0][0]->co[2]; - - co[1][0] = (v[1][1]->co[0] - v[1][0]->co[0])*(i/((float)previewlines+1))+v[1][0]->co[0]; - co[1][1] = (v[1][1]->co[1] - v[1][0]->co[1])*(i/((float)previewlines+1))+v[1][0]->co[1]; - co[1][2] = (v[1][1]->co[2] - v[1][0]->co[2])*(i/((float)previewlines+1))+v[1][0]->co[2]; - glColor3ub(255, 0, 255); - glBegin(GL_LINES); - glVertex3f(co[0][0],co[0][1],co[0][2]); - glVertex3f(co[1][0],co[1][1],co[1][2]); - glEnd(); - } - } - } - glPopMatrix(); - } else { - - /* (de)select the edges */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f2) EM_select_edge(eed, select); - } - } -} -void CutEdgeloop(int numcuts) -{ - EditMesh *em = G.editMesh; - EditEdge *nearest=NULL, *eed; - float fac; - int keys = 0, holdnum=0, selectmode, dist; - short mvalo[2] = {0,0}, mval[2]; - short event, val, choosing=1, cancel=0, cuthalf = 0, smooth=0; - short hasHidden = 0; - char msg[128]; - - selectmode = G.scene->selectmode; - - if(G.scene->selectmode & SCE_SELECT_FACE){ - G.scene->selectmode = SCE_SELECT_EDGE; - EM_selectmode_set(); - } - - - BIF_undo_push("Loopcut Begin"); - while(choosing && !cancel){ - getmouseco_areawin(mval); - if (mval[0] != mvalo[0] || mval[1] != mvalo[1]) { - mvalo[0] = mval[0]; - mvalo[1] = mval[1]; - dist= 50; - nearest = findnearestedge(&dist); // returns actual distance in dist - scrarea_do_windraw(curarea); // after findnearestedge, backbuf! - - sprintf(msg,"Number of Cuts: %d",numcuts); - if(smooth){ - sprintf(msg,"%s (S)mooth: on",msg); - } else { - sprintf(msg,"%s (S)mooth: off",msg); - } - - headerprint(msg); - /* Need to figure preview */ - if(nearest){ - edgering_sel(nearest, 0, numcuts); - } - screen_swapbuffers(); - - /* backbuffer refresh for non-apples (no aux) */ -#ifndef __APPLE__ - if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) { - backdrawview3d(0); - } -#endif - } - else PIL_sleep_ms(10); // idle - - - while(qtest()) - { - val=0; - event= extern_qread(&val); - if(val && (event == MOUSEX || event == MOUSEY)){ ; } - else if(val && ((event==LEFTMOUSE || event==RETKEY) || (event == MIDDLEMOUSE || event==PADENTER))) - { - if(event == MIDDLEMOUSE){ - cuthalf = 1; - } - if (nearest==NULL) - cancel = 1; - choosing=0; - mvalo[0] = -1; - } - else if(val && (event==ESCKEY || event==RIGHTMOUSE )) - { - choosing=0; - cancel = 1; - mvalo[0] = -1; - } - else if(val && (event==PADPLUSKEY || event==WHEELUPMOUSE)) - { - numcuts++; - mvalo[0] = -1; - } - else if(val && (event==PADMINUS || event==WHEELDOWNMOUSE)) - { - if(numcuts > 1){ - numcuts--; - mvalo[0] = -1; - } - } - else if(val && event==SKEY) - { - if(smooth){smooth=0;} - else { smooth=1; } - mvalo[0] = -1; - } - - else if(val){ - holdnum = -1; - switch(event){ - case PAD9: - case NINEKEY: - holdnum = 9; break; - case PAD8: - case EIGHTKEY: - holdnum = 8;break; - case PAD7: - case SEVENKEY: - holdnum = 7;break; - case PAD6: - case SIXKEY: - holdnum = 6;break; - case PAD5: - case FIVEKEY: - holdnum = 5;break; - case PAD4: - case FOURKEY: - holdnum = 4;break; - case PAD3: - case THREEKEY: - holdnum = 3; break; - case PAD2: - case TWOKEY: - holdnum = 2;break; - case PAD1: - case ONEKEY: - holdnum = 1; break; - case PAD0: - case ZEROKEY: - holdnum = 0;break; - case BACKSPACEKEY: - holdnum = -2;break; - } - if(holdnum >= 0 && numcuts*10 < 130){ - if(keys == 0){ // first level numeric entry - if(holdnum > 0){ - numcuts = holdnum; - keys++; - } - } else if(keys > 0){//highrt level numeric entry - numcuts *= 10; - numcuts += holdnum; - keys++; - } - } else if (holdnum == -2){// backspace - if (keys > 1){ - numcuts /= 10; - keys--; - } else { - numcuts=1; - keys = 0; - } - } - mvalo[0] = -1; - break; - } // End Numeric Entry - } //End while(qtest()) - } // End Choosing - scrarea_queue_winredraw(curarea); - - if(cancel){ - return; - } - /* clean selection */ - for(eed=em->edges.first; eed; eed = eed->next){ - EM_select_edge(eed,0); - } - /* select edge ring */ - edgering_sel(nearest, 1, 0); - - /* now cut the loops */ - if(smooth){ - fac= 1.0f; - if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; - fac= 0.292f*fac; - esubdivideflag(SELECT,fac,B_SMOOTH,numcuts,SUBDIV_SELECT_LOOPCUT); - } else { - esubdivideflag(SELECT,0,0,numcuts,SUBDIV_SELECT_LOOPCUT); - } - /* if this was a single cut, enter edgeslide mode */ - if(numcuts == 1 && hasHidden == 0){ - if(cuthalf) - EdgeSlide(1,0.0); - else { - if(EdgeSlide(0,0.0) == -1){ - BIF_undo(); - } - } - } - - if(G.scene->selectmode != selectmode){ - G.scene->selectmode = selectmode; - EM_selectmode_set(); - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); -#endif - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - return; -} - - -/* *************** LOOP SELECT ************* */ -#if 0 -static short edgeFaces(EditEdge *e) -{ - EditMesh *em = G.editMesh; - EditFace *search=NULL; - short count = 0; - - search = em->faces.first; - while(search){ - if((search->e1 == e || search->e2 == e) || (search->e3 == e || search->e4 == e)) - count++; - search = search->next; - } - return count; -} -#endif - -/* this utility function checks to see if 2 edit edges share a face, - returns 1 if they do - returns 0 if they do not, or if the function is passed the same edge 2 times -*/ -short sharesFace(EditEdge* e1, EditEdge* e2) -{ - EditMesh *em = G.editMesh; - EditFace *search=NULL; - - search = em->faces.first; - if (e1 == e2){ - return 0 ; - } - while(search){ - if( - ((search->e1 == e1 || search->e2 == e1) || (search->e3 == e1 || search->e4 == e1)) && - ((search->e1 == e2 || search->e2 == e2) || (search->e3 == e2 || search->e4 == e2)) - ) { - return 1; - } - search = search->next; - } - return 0; -} - - -/* ***************** TRAIL ************************ - -Read a trail of mouse coords and return them as an array of CutCurve structs -len returns number of mouse coords read before commiting with RETKEY -It is up to the caller to free the block when done with it, - -XXX Is only used here, so local inside this file (ton) - */ - -#define TRAIL_POLYLINE 1 /* For future use, They don't do anything yet */ -#define TRAIL_FREEHAND 2 -#define TRAIL_MIXED 3 /* (1|2) */ -#define TRAIL_AUTO 4 -#define TRAIL_MIDPOINTS 8 - -typedef struct CutCurve { - float x; - float y; -} CutCurve; - -static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash *gh) -{ - CutCurve *curve,*temp; - EditVert *snapvert; - float *scr, mval[2], lastx=0, lasty=0; - int i=0, j, blocks=1, lasti=0; - int dist, tolerance; - short event, val, qual, vsnap=0, ldown=0, restart=0, rubberband=0; - short mval1[2], lockaxis=0, lockx=0, locky=0, oldmode; - - *len=0; - tolerance = 75; - - curve=(CutCurve *)MEM_callocN(1024*sizeof(CutCurve), "MouseTrail"); - - if (!curve) { - printf("failed to allocate memory in get_mouse_trail()\n"); - return(NULL); - } - mywinset(curarea->win); - - - if(cutmode != KNIFE_MULTICUT){ - /*redraw backbuffer if in zbuffered selection mode but not vertex selection*/ - if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) { - oldmode = G.scene->selectmode; - G.scene->selectmode = SCE_SELECT_VERTEX; - backdrawview3d(0); - G.scene->selectmode = oldmode; - } - glDrawBuffer(GL_FRONT); - headerprint("(LMB) draw, (Ctrl held while drawing) snap to vertex, (MMB) constrain to x/y screen axis, (Enter) cut " - "(with Ctrl to select cut line), (Esc) cancel"); - } - else{ - glDrawBuffer(GL_FRONT); - headerprint("(LMB) draw, (MMB) constrain to x/y screen axis, (Enter) cut (with Ctrl to select cut line), (Esc) cancel"); - } - - persp(PERSP_WIN); - - glColor3ub(255, 0, 255); - - while(TRUE) { - - event=extern_qread(&val); /* Enter or RMB indicates finish */ - if(val) { - if(event==RETKEY || event==PADENTER) break; - } - - if( event==ESCKEY || event==RIGHTMOUSE ) { - if (curve) MEM_freeN(curve); - *len=0; - bglFlush(); - glDrawBuffer(GL_BACK); - return(NULL); - break; - } - - if (rubberband) { /* rubberband mode, undraw last rubberband */ - glLineWidth(2.0); - sdrawXORline((int)curve[i-1].x, (int)curve[i-1].y,(int)mval[0],(int) mval[1]); - glLineWidth(1.0); - glFlush(); - rubberband=0; - } - - /*handle vsnap*/ - vsnap = 0; - if(cutmode != KNIFE_MULTICUT){ - qual = get_qual(); - if(qual & LR_CTRLKEY) vsnap = 1; - } - - if(vsnap){ - persp(PERSP_VIEW); - dist = tolerance; - snapvert = findnearestvert(&dist, SELECT, 0); - glColor3ub(255, 0, 255); - glDrawBuffer(GL_FRONT); - persp(PERSP_WIN); - if(snapvert && (dist < tolerance)){ - scr = BLI_ghash_lookup(gh, snapvert); - mval[0] = scr[0]; - mval[1] = scr[1]; - } - else{ - getmouseco_areawin(mval1); - mval[0] = (float)mval1[0]; - mval[1] = (float)mval1[1]; - } - } - - else{ - getmouseco_areawin(mval1); - mval[0] = (float)mval1[0]; - mval[1] = (float)mval1[1]; - } - - - if (lockaxis==1) mval[1]=locky; - if (lockaxis==2) mval[0]=lockx; - - if ( ((i==0) || (mval[0]!=curve[i-1].x) || (mval[1]!=curve[i-1].y)) - && (get_mbut() & L_MOUSE) ){ /* record changes only, if LMB down */ - - lastx=curve[i].x=mval[0]; - lasty=curve[i].y=mval[1]; - - lockaxis=0; - - i++; - - ldown=1; - if (restart) { - for(j=1;j abs(curve[i-1].y-mval[1])) lockaxis=1; - else lockaxis=2; - - if (lockaxis) { - lockx=lastx; - locky=lasty; - } - } - - if ((i>1)&&(i!=lasti)) { /*Draw recorded part of curve */ - sdrawline((int)curve[i-2].x, (int)curve[i-2].y, (int)curve[i-1].x, (int)curve[i-1].y); - glFlush(); - } - - if ((i==lasti)&&(i>0)) { /*Draw rubberband */ - glLineWidth(2.0); - sdrawXORline((int)curve[i-1].x, (int)curve[i-1].y,(int)mval[0], (int)mval[1]); - glLineWidth(1.0); - glFlush(); - rubberband=1; - } - lasti=i; - - if (i>=blocks*1024) { /* reallocate data if out of room */ - temp=curve; - curve=(CutCurve *)MEM_callocN((blocks+1)*1024*sizeof(CutCurve), "MouseTrail"); - if (!curve) { - printf("failed to re-allocate memory in get_mouse_trail()\n"); - return(NULL); - } - memcpy(curve, temp, blocks*1024*sizeof(CutCurve)); - blocks++; - MEM_freeN(temp); - } - } - - bglFlush(); - glDrawBuffer(GL_BACK); - persp(PERSP_VIEW); - - *len=i; - - return(curve); -} - - - - -/* ******************************************************************** */ -/* Knife Subdivide Tool. Subdivides edges intersected by a mouse trail - drawn by user. - - Currently mapped to KKey when in MeshEdit mode. - Usage: - Hit Shift K, Select Centers or Exact - Hold LMB down to draw path, hit RETKEY. - ESC cancels as expected. - - Contributed by Robert Wenzlaff (Det. Thorn). -*/ - -/* prototype */ -static float seg_intersect(struct EditEdge * e, CutCurve *c, int len, char mode, struct GHash *gh); - -void KnifeSubdivide(char mode) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditVert *eve; - CutCurve *curve; - Window *win; - - struct GHash *gh; - int oldcursor, len=0; - float isect=0.0; - short numcuts=1; - float *scr, co[4]; - - if (G.obedit==0) return; - - if (EM_nvertices_selected() < 2) { - error("No edges are selected to operate on"); - return; - } - - if (mode==KNIFE_PROMPT) { - short val= pupmenu("Cut Type %t|Exact Line%x1|Midpoints%x2|Multicut%x3"); - if(val<1) return; - mode = val; // warning, mode is char, pupmenu returns -1 with ESC - } - - if(mode == KNIFE_MULTICUT) { - if(button(&numcuts, 2, 128, "Number of Cuts:")==0) return; - } - - /* Set a knife cursor here */ - oldcursor=get_cursor(); - - win=winlay_get_active_window(); - - SetBlenderCursor(BC_KNIFECURSOR); - - for(eed=em->edges.first; eed; eed= eed->next) eed->tmp.fp = 0.0; /*store percentage of edge cut for KNIFE_EXACT here.*/ - - /*the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer*/ - gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - for(eve=em->verts.first; eve; eve=eve->next){ - scr = MEM_mallocN(sizeof(float)*2, "Vertex Screen Coordinates"); - VECCOPY(co, eve->co); - co[3]= 1.0; - Mat4MulVec4fl(G.obedit->obmat, co); - project_float(co,scr); - BLI_ghash_insert(gh, eve, scr); - eve->f1 = 0; /*store vertex intersection flag here*/ - - } - - curve=get_mouse_trail(&len, TRAIL_MIXED, mode, gh); - - if (curve && len && mode){ - eed= em->edges.first; - while(eed) { - if( eed->v1->f & eed->v2->f & SELECT ){ // NOTE: uses vertex select, subdiv doesnt do edges yet - isect=seg_intersect(eed, curve, len, mode, gh); - if (isect) eed->f2= 1; - else eed->f2=0; - eed->tmp.fp= isect; - //printf("isect=%i\n", isect); - } - else { - eed->f2=0; - eed->f1=0; - } - eed= eed->next; - } - - if (mode==KNIFE_EXACT) esubdivideflag(1, 0, B_KNIFE|B_PERCENTSUBD,1,SUBDIV_SELECT_ORIG); - else if (mode==KNIFE_MIDPOINT) esubdivideflag(1, 0, B_KNIFE,1,SUBDIV_SELECT_ORIG); - else if (mode==KNIFE_MULTICUT) esubdivideflag(1, 0, B_KNIFE,numcuts,SUBDIV_SELECT_ORIG); - - eed=em->edges.first; - while(eed){ - eed->f2=0; - eed->f1=0; - eed=eed->next; - } - } - /* Return to old cursor and flags...*/ - - addqueue(curarea->win, REDRAW, 0); - window_set_cursor(win, oldcursor); - BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN); - if (curve) MEM_freeN(curve); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - BIF_undo_push("Knife"); -} - -/* seg_intersect() Determines if and where a mouse trail intersects an EditEdge */ - -static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct GHash *gh) -{ -#define MAXSLOPE 100000 - float x11, y11, x12=0, y12=0, x2max, x2min, y2max; - float y2min, dist, lastdist=0, xdiff2, xdiff1; - float m1, b1, m2, b2, x21, x22, y21, y22, xi; - float yi, x1min, x1max, y1max, y1min, perc=0; - float *scr; - float threshold; - int i; - - //threshold = 0.000001; /*tolerance for vertex intersection*/ - threshold = G.scene->toolsettings->select_thresh / 100; - - /* Get screen coords of verts */ - scr = BLI_ghash_lookup(gh, e->v1); - x21=scr[0]; - y21=scr[1]; - - scr = BLI_ghash_lookup(gh, e->v2); - x22=scr[0]; - y22=scr[1]; - - xdiff2=(x22-x21); - if (xdiff2) { - m2=(y22-y21)/xdiff2; - b2= ((x22*y21)-(x21*y22))/xdiff2; - } - else { - m2=MAXSLOPE; /* Verticle slope */ - b2=x22; - } - - /*check for *exact* vertex intersection first*/ - if(mode!=KNIFE_MULTICUT){ - for (i=0; i0){ - x11=x12; - y11=y12; - } - else { - x11=c[i].x; - y11=c[i].y; - } - x12=c[i].x; - y12=c[i].y; - - /*test e->v1*/ - if((x11 == x21 && y11 == y21) || (x12 == x21 && y12 == y21)){ - e->v1->f1 = 1; - perc = 0; - return(perc); - } - /*test e->v2*/ - else if((x11 == x22 && y11 == y22) || (x12 == x22 && y12 == y22)){ - e->v2->f1 = 1; - perc = 0; - return(perc); - } - } - } - - /*now check for edge interesect (may produce vertex intersection as well)*/ - for (i=0; i0){ - x11=x12; - y11=y12; - } - else { - x11=c[i].x; - y11=c[i].y; - } - x12=c[i].x; - y12=c[i].y; - - /* Perp. Distance from point to line */ - if (m2!=MAXSLOPE) dist=(y12-m2*x12-b2);/* /sqrt(m2*m2+1); Only looking for */ - /* change in sign. Skip extra math */ - else dist=x22-x12; - - if (i==0) lastdist=dist; - - /* if dist changes sign, and intersect point in edge's Bound Box*/ - if ((lastdist*dist)<=0){ - xdiff1=(x12-x11); /* Equation of line between last 2 points */ - if (xdiff1){ - m1=(y12-y11)/xdiff1; - b1= ((x12*y11)-(x11*y12))/xdiff1; - } - else{ - m1=MAXSLOPE; - b1=x12; - } - x2max=MAX2(x21,x22)+0.001; /* prevent missed edges */ - x2min=MIN2(x21,x22)-0.001; /* due to round off error */ - y2max=MAX2(y21,y22)+0.001; - y2min=MIN2(y21,y22)-0.001; - - /* Found an intersect, calc intersect point */ - if (m1==m2){ /* co-incident lines */ - /* cut at 50% of overlap area*/ - x1max=MAX2(x11, x12); - x1min=MIN2(x11, x12); - xi= (MIN2(x2max,x1max)+MAX2(x2min,x1min))/2.0; - - y1max=MAX2(y11, y12); - y1min=MIN2(y11, y12); - yi= (MIN2(y2max,y1max)+MAX2(y2min,y1min))/2.0; - } - else if (m2==MAXSLOPE){ - xi=x22; - yi=m1*x22+b1; - } - else if (m1==MAXSLOPE){ - xi=x12; - yi=m2*x12+b2; - } - else { - xi=(b1-b2)/(m2-m1); - yi=(b1*m2-m1*b2)/(m2-m1); - } - - /* Intersect inside bounding box of edge?*/ - if ((xi>=x2min)&&(xi<=x2max)&&(yi<=y2max)&&(yi>=y2min)){ - /*test for vertex intersect that may be 'close enough'*/ - if(mode!=KNIFE_MULTICUT){ - if(xi <= (x21 + threshold) && xi >= (x21 - threshold)){ - if(yi <= (y21 + threshold) && yi >= (y21 - threshold)){ - e->v1->f1 = 1; - perc = 0; - break; - } - } - if(xi <= (x22 + threshold) && xi >= (x22 - threshold)){ - if(yi <= (y22 + threshold) && yi >= (y22 - threshold)){ - e->v2->f1 = 1; - perc = 0; - break; - } - } - } - if ((m2<=1.0)&&(m2>=-1.0)) perc = (xi-x21)/(x22-x21); - else perc=(yi-y21)/(y22-y21); /*lower slope more accurate*/ - //isect=32768.0*(perc+0.0000153); /* Percentage in 1/32768ths */ - break; - } - } - lastdist=dist; - } - return(perc); -} - -void LoopMenu() /* Called by KKey */ -{ - short ret; - - ret=pupmenu("Loop/Cut Menu %t|Loop Cut (CTRL-R)%x2|" - "Knife (Exact) %x3|Knife (Midpoints)%x4|Knife (Multicut)%x5"); - - switch (ret){ - case 2: - CutEdgeloop(1); - break; - case 3: - KnifeSubdivide(KNIFE_EXACT); - break; - case 4: - KnifeSubdivide(KNIFE_MIDPOINT); - break; - case 5: - KnifeSubdivide(KNIFE_MULTICUT); - break; - } - -} - diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c deleted file mode 100644 index b165a141daa..00000000000 --- a/source/blender/src/editmesh_mods.c +++ /dev/null @@ -1,4139 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - -editmesh_mods.c, UI level access, no geometry changes - -*/ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "MTC_matrixops.h" - -#include "DNA_mesh_types.h" -#include "DNA_material_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_texture_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_rand.h" - -#include "BKE_displist.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_material.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_editmesh.h" -#include "BIF_resources.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_editsima.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" - -#include "BSE_drawview.h" -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "RE_render_ext.h" /* externtex */ - -#include "multires.h" -#include "mydevice.h" -#include "blendef.h" - -#include "editmesh.h" - - -/* ****************************** MIRROR **************** */ - -void EM_select_mirrored(void) -{ - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - EditMesh *em = G.editMesh; - EditVert *eve, *v1; - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - v1= editmesh_get_x_mirror_vert(G.obedit, eve->co); - if(v1) { - eve->f &= ~SELECT; - v1->f |= SELECT; - } - } - } - } -} - -void EM_automerge(int update) { - int len; - if (G.scene->automerge) { - if (G.obedit && G.obedit->type==OB_MESH) { - len = removedoublesflag(1, 1, G.scene->toolsettings->doublimit); - if (len) { - G.totvert -= len; /* saves doing a countall */ - if (update) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - } - } - } -} - -/* ****************************** SELECTION ROUTINES **************** */ - -unsigned int em_solidoffs=0, em_wireoffs=0, em_vertoffs=0; /* set in drawobject.c ... for colorindices */ - -/* facilities for border select and circle select */ -static char *selbuf= NULL; - -/* opengl doesn't support concave... */ -static void draw_triangulated(short mcords[][2], short tot) -{ - ListBase lb={NULL, NULL}; - DispList *dl; - float *fp; - int a; - - /* make displist */ - dl= MEM_callocN(sizeof(DispList), "poly disp"); - dl->type= DL_POLY; - dl->parts= 1; - dl->nr= tot; - dl->verts= fp= MEM_callocN(tot*3*sizeof(float), "poly verts"); - BLI_addtail(&lb, dl); - - for(a=0; atype==DL_INDEX3) { - int *index; - - a= dl->parts; - fp= dl->verts; - index= dl->index; - glBegin(GL_TRIANGLES); - while(a--) { - glVertex3fv(fp+3*index[0]); - glVertex3fv(fp+3*index[1]); - glVertex3fv(fp+3*index[2]); - index+= 3; - } - glEnd(); - } - - freedisplist(&lb); -} - - -/* reads rect, and builds selection array for quick lookup */ -/* returns if all is OK */ -int EM_init_backbuf_border(short xmin, short ymin, short xmax, short ymax) -{ - struct ImBuf *buf; - unsigned int *dr; - int a; - - if(G.obedit==NULL || G.vd->drawtypeflag & V3D_ZBUF_SELECT)==0) return 0; - if(em_vertoffs==0) return 0; - - buf= read_backbuf(xmin, ymin, xmax, ymax); - if(buf==NULL) return 0; - - dr = buf->rect; - - /* build selection lookup */ - selbuf= MEM_callocN(em_vertoffs+1, "selbuf"); - - a= (xmax-xmin+1)*(ymax-ymin+1); - while(a--) { - if(*dr>0 && *dr<=em_vertoffs) - selbuf[*dr]= 1; - dr++; - } - IMB_freeImBuf(buf); - return 1; -} - -int EM_check_backbuf(unsigned int index) -{ - if(selbuf==NULL) return 1; - if(index>0 && index<=em_vertoffs) - return selbuf[index]; - return 0; -} - -void EM_free_backbuf(void) -{ - if(selbuf) MEM_freeN(selbuf); - selbuf= NULL; -} - -/* mcords is a polygon mask - - grab backbuffer, - - draw with black in backbuffer, - - grab again and compare - returns 'OK' -*/ -int EM_mask_init_backbuf_border(short mcords[][2], short tot, short xmin, short ymin, short xmax, short ymax) -{ - unsigned int *dr, *drm; - struct ImBuf *buf, *bufmask; - int a; - - /* method in use for face selecting too */ - if(G.obedit==NULL) { - if(FACESEL_PAINT_TEST); - else return 0; - } - else if(G.vd->drawtypeflag & V3D_ZBUF_SELECT)==0) return 0; - - if(em_vertoffs==0) return 0; - - buf= read_backbuf(xmin, ymin, xmax, ymax); - if(buf==NULL) return 0; - - dr = buf->rect; - - /* draw the mask */ -#ifdef __APPLE__ - glDrawBuffer(GL_AUX0); -#endif - glDisable(GL_DEPTH_TEST); - - persp(PERSP_WIN); - glColor3ub(0, 0, 0); - - /* yah, opengl doesn't do concave... tsk! */ - draw_triangulated(mcords, tot); - - glBegin(GL_LINE_LOOP); /* for zero sized masks, lines */ - for(a=0; arect; - if(bufmask==NULL) return 0; /* only when mem alloc fails, go crash somewhere else! */ - - /* build selection lookup */ - selbuf= MEM_callocN(em_vertoffs+1, "selbuf"); - - a= (xmax-xmin+1)*(ymax-ymin+1); - while(a--) { - if(*dr>0 && *dr<=em_vertoffs && *drm==0) selbuf[*dr]= 1; - dr++; drm++; - } - IMB_freeImBuf(buf); - IMB_freeImBuf(bufmask); - return 1; - -} - -/* circle shaped sample area */ -int EM_init_backbuf_circle(short xs, short ys, short rads) -{ - struct ImBuf *buf; - unsigned int *dr; - short xmin, ymin, xmax, ymax, xc, yc; - int radsq; - - /* method in use for face selecting too */ - if(G.obedit==NULL) { - if(FACESEL_PAINT_TEST); - else return 0; - } - else if(G.vd->drawtypeflag & V3D_ZBUF_SELECT)==0) return 0; - if(em_vertoffs==0) return 0; - - xmin= xs-rads; xmax= xs+rads; - ymin= ys-rads; ymax= ys+rads; - buf= read_backbuf(xmin, ymin, xmax, ymax); - if(buf==NULL) return 0; - - dr = buf->rect; - - /* build selection lookup */ - selbuf= MEM_callocN(em_vertoffs+1, "selbuf"); - radsq= rads*rads; - for(yc= -rads; yc<=rads; yc++) { - for(xc= -rads; xc<=rads; xc++, dr++) { - if(xc*xc + yc*yc < radsq) { - if(*dr>0 && *dr<=em_vertoffs) selbuf[*dr]= 1; - } - } - } - - IMB_freeImBuf(buf); - return 1; - -} - -static void findnearestvert__doClosest(void *userData, EditVert *eve, int x, int y, int index) -{ - struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } *data = userData; - - if (data->pass==0) { - if (index<=data->lastIndex) - return; - } else { - if (index>data->lastIndex) - return; - } - - if (data->dist>3) { - int temp = abs(data->mval[0] - x) + abs(data->mval[1]- y); - if ((eve->f&1) == data->select) { - if (data->strict == 1) - return; - else - temp += 5; - } - - if (tempdist) { - data->dist = temp; - data->closest = eve; - data->closestIndex = index; - } - } -} - - - - -static unsigned int findnearestvert__backbufIndextest(unsigned int index){ - EditVert *eve = BLI_findlink(&G.editMesh->verts, index-1); - if(eve && (eve->f & SELECT)) return 0; - return 1; -} -/** - * findnearestvert - * - * dist (in/out): minimal distance to the nearest and at the end, actual distance - * sel: selection bias - * if SELECT, selected vertice are given a 5 pixel bias to make them farter than unselect verts - * if 0, unselected vertice are given the bias - * strict: if 1, the vertice corresponding to the sel parameter are ignored and not just biased - */ -EditVert *findnearestvert(int *dist, short sel, short strict) -{ - short mval[2]; - - getmouseco_areawin(mval); - if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)){ - int distance; - unsigned int index; - EditVert *eve; - - if(strict) index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, strict, findnearestvert__backbufIndextest); - else index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, 0, NULL); - - eve = BLI_findlink(&G.editMesh->verts, index-1); - - if(eve && distance < *dist) { - *dist = distance; - return eve; - } else { - return NULL; - } - - } - else { - struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } data; - static int lastSelectedIndex=0; - static EditVert *lastSelected=NULL; - - if (lastSelected && BLI_findlink(&G.editMesh->verts, lastSelectedIndex)!=lastSelected) { - lastSelectedIndex = 0; - lastSelected = NULL; - } - - data.lastIndex = lastSelectedIndex; - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.select = sel; - data.dist = *dist; - data.strict = strict; - data.closest = NULL; - data.closestIndex = 0; - - data.pass = 0; - mesh_foreachScreenVert(findnearestvert__doClosest, &data, 1); - - if (data.dist>3) { - data.pass = 1; - mesh_foreachScreenVert(findnearestvert__doClosest, &data, 1); - } - - *dist = data.dist; - lastSelected = data.closest; - lastSelectedIndex = data.closestIndex; - - return data.closest; - } -} - -/* returns labda for closest distance v1 to line-piece v2-v3 */ -static float labda_PdistVL2Dfl( float *v1, float *v2, float *v3) -{ - float rc[2], len; - - rc[0]= v3[0]-v2[0]; - rc[1]= v3[1]-v2[1]; - len= rc[0]*rc[0]+ rc[1]*rc[1]; - if(len==0.0f) - return 0.0f; - - return ( rc[0]*(v1[0]-v2[0]) + rc[1]*(v1[1]-v2[1]) )/len; -} - -/* note; uses G.vd, so needs active 3d window */ -static void findnearestedge__doClosest(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) -{ - struct { float mval[2]; int dist; EditEdge *closest; } *data = userData; - float v1[2], v2[2]; - int distance; - - v1[0] = x0; - v1[1] = y0; - v2[0] = x1; - v2[1] = y1; - - distance= PdistVL2Dfl(data->mval, v1, v2); - - if(eed->f & SELECT) distance+=5; - if(distance < data->dist) { - if(G.vd->flag & V3D_CLIPPING) { - float labda= labda_PdistVL2Dfl(data->mval, v1, v2); - float vec[3]; - - vec[0]= eed->v1->co[0] + labda*(eed->v2->co[0] - eed->v1->co[0]); - vec[1]= eed->v1->co[1] + labda*(eed->v2->co[1] - eed->v1->co[1]); - vec[2]= eed->v1->co[2] + labda*(eed->v2->co[2] - eed->v1->co[2]); - Mat4MulVecfl(G.obedit->obmat, vec); - - if(view3d_test_clipping(G.vd, vec)==0) { - data->dist = distance; - data->closest = eed; - } - } - else { - data->dist = distance; - data->closest = eed; - } - } -} -EditEdge *findnearestedge(int *dist) -{ - short mval[2]; - - getmouseco_areawin(mval); - - if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) { - int distance; - unsigned int index = sample_backbuf_rect(mval, 50, em_solidoffs, em_wireoffs, &distance,0, NULL); - EditEdge *eed = BLI_findlink(&G.editMesh->edges, index-1); - - if (eed && distance<*dist) { - *dist = distance; - return eed; - } else { - return NULL; - } - } - else { - struct { float mval[2]; int dist; EditEdge *closest; } data; - - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.dist = *dist; - data.closest = NULL; - - mesh_foreachScreenEdge(findnearestedge__doClosest, &data, 2); - - *dist = data.dist; - return data.closest; - } -} - -static void findnearestface__getDistance(void *userData, EditFace *efa, int x, int y, int index) -{ - struct { short mval[2]; int dist; EditFace *toFace; } *data = userData; - - if (efa==data->toFace) { - int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - - if (tempdist) - data->dist = temp; - } -} -static void findnearestface__doClosest(void *userData, EditFace *efa, int x, int y, int index) -{ - struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } *data = userData; - - if (data->pass==0) { - if (index<=data->lastIndex) - return; - } else { - if (index>data->lastIndex) - return; - } - - if (data->dist>3) { - int temp = abs(data->mval[0]-x) + abs(data->mval[1]-y); - - if (tempdist) { - data->dist = temp; - data->closest = efa; - data->closestIndex = index; - } - } -} -static EditFace *findnearestface(int *dist) -{ - short mval[2]; - - getmouseco_areawin(mval); - - if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) { - unsigned int index = sample_backbuf(mval[0], mval[1]); - EditFace *efa = BLI_findlink(&G.editMesh->faces, index-1); - - if (efa) { - struct { short mval[2]; int dist; EditFace *toFace; } data; - - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.dist = 0x7FFF; /* largest short */ - data.toFace = efa; - - mesh_foreachScreenFace(findnearestface__getDistance, &data); - - if(G.scene->selectmode == SCE_SELECT_FACE || data.dist<*dist) { /* only faces, no dist check */ - *dist= data.dist; - return efa; - } - } - - return NULL; - } - else { - struct { short mval[2], pass; int dist, lastIndex, closestIndex; EditFace *closest; } data; - static int lastSelectedIndex=0; - static EditFace *lastSelected=NULL; - - if (lastSelected && BLI_findlink(&G.editMesh->faces, lastSelectedIndex)!=lastSelected) { - lastSelectedIndex = 0; - lastSelected = NULL; - } - - data.lastIndex = lastSelectedIndex; - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.dist = *dist; - data.closest = NULL; - data.closestIndex = 0; - - data.pass = 0; - mesh_foreachScreenFace(findnearestface__doClosest, &data); - - if (data.dist>3) { - data.pass = 1; - mesh_foreachScreenFace(findnearestface__doClosest, &data); - } - - *dist = data.dist; - lastSelected = data.closest; - lastSelectedIndex = data.closestIndex; - - return data.closest; - } -} - -/* for interactivity, frontbuffer draw in current window */ -static void draw_dm_mapped_vert__mapFunc(void *theVert, int index, float *co, float *no_f, short *no_s) -{ - if (EM_get_vert_for_index(index)==theVert) { - bglVertex3fv(co); - } -} -static void draw_dm_mapped_vert(DerivedMesh *dm, EditVert *eve) -{ - EM_init_index_arrays(1, 0, 0); - bglBegin(GL_POINTS); - dm->foreachMappedVert(dm, draw_dm_mapped_vert__mapFunc, eve); - bglEnd(); - EM_free_index_arrays(); -} - -static int draw_dm_mapped_edge__setDrawOptions(void *theEdge, int index) -{ - return EM_get_edge_for_index(index)==theEdge; -} -static void draw_dm_mapped_edge(DerivedMesh *dm, EditEdge *eed) -{ - EM_init_index_arrays(0, 1, 0); - dm->drawMappedEdges(dm, draw_dm_mapped_edge__setDrawOptions, eed); - EM_free_index_arrays(); -} - -static void draw_dm_mapped_face_center__mapFunc(void *theFace, int index, float *cent, float *no) -{ - if (EM_get_face_for_index(index)==theFace) { - bglVertex3fv(cent); - } -} -static void draw_dm_mapped_face_center(DerivedMesh *dm, EditFace *efa) -{ - EM_init_index_arrays(0, 0, 1); - bglBegin(GL_POINTS); - dm->foreachMappedFaceCenter(dm, draw_dm_mapped_face_center__mapFunc, efa); - bglEnd(); - EM_free_index_arrays(); -} - -static void unified_select_draw(EditVert *eve, EditEdge *eed, EditFace *efa) -{ - DerivedMesh *dm = editmesh_get_derived_cage(CD_MASK_BAREMESH); - - glDrawBuffer(GL_FRONT); - - persp(PERSP_VIEW); - - if(G.vd->flag & V3D_CLIPPING) - view3d_set_clipping(G.vd); - - glPushMatrix(); - mymultmatrix(G.obedit->obmat); - - /* face selected */ - if(efa) { - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - if(efa->f & SELECT) BIF_ThemeColor(TH_VERTEX_SELECT); - else BIF_ThemeColor(TH_VERTEX); - - bglBegin(GL_POINTS); - bglVertex3fv(efa->v1->co); - bglVertex3fv(efa->v2->co); - bglVertex3fv(efa->v3->co); - if(efa->v4) bglVertex3fv(efa->v4->co); - bglEnd(); - } - - if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) { - if(efa->fgonf==0) { - BIF_ThemeColor((efa->f & SELECT)?TH_EDGE_SELECT:TH_WIRE); - - draw_dm_mapped_edge(dm, efa->e1); - draw_dm_mapped_edge(dm, efa->e2); - draw_dm_mapped_edge(dm, efa->e3); - if (efa->e4) { - draw_dm_mapped_edge(dm, efa->e4); - } - } - } - - if( CHECK_OB_DRAWFACEDOT(G.scene, G.vd, G.obedit->dt) ) { - if(efa->fgonf==0) { - glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE)); - BIF_ThemeColor((efa->f & SELECT)?TH_FACE_DOT:TH_WIRE); - - draw_dm_mapped_face_center(dm, efa); - } - } - } - /* edge selected */ - if(eed) { - if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_FACE)) { - BIF_ThemeColor((eed->f & SELECT)?TH_EDGE_SELECT:TH_WIRE); - - draw_dm_mapped_edge(dm, eed); - } - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - BIF_ThemeColor((eed->f & SELECT)?TH_VERTEX_SELECT:TH_VERTEX); - - draw_dm_mapped_vert(dm, eed->v1); - draw_dm_mapped_vert(dm, eed->v2); - } - } - if(eve) { - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE)); - - BIF_ThemeColor((eve->f & SELECT)?TH_VERTEX_SELECT:TH_VERTEX); - - draw_dm_mapped_vert(dm, eve); - } - } - - glPointSize(1.0); - glPopMatrix(); - - bglFlush(); - glDrawBuffer(GL_BACK); - - if(G.vd->flag & V3D_CLIPPING) - view3d_clr_clipping(); - - /* signal that frontbuf differs from back */ - curarea->win_swap= WIN_FRONT_OK; - - dm->release(dm); -} - - -/* best distance based on screen coords. - use g.scene->selectmode to define how to use - selected vertices and edges get disadvantage - return 1 if found one -*/ -static int unified_findnearest(EditVert **eve, EditEdge **eed, EditFace **efa) -{ - int dist= 75; - - *eve= NULL; - *eed= NULL; - *efa= NULL; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) - *eve= findnearestvert(&dist, SELECT, 0); - if(G.scene->selectmode & SCE_SELECT_FACE) - *efa= findnearestface(&dist); - - dist-= 20; /* since edges select lines, we give dots advantage of 20 pix */ - if(G.scene->selectmode & SCE_SELECT_EDGE) - *eed= findnearestedge(&dist); - - /* return only one of 3 pointers, for frontbuffer redraws */ - if(*eed) { - *efa= NULL; *eve= NULL; - } - else if(*efa) { - *eve= NULL; - } - - return (*eve || *eed || *efa); -} - -/* this as a way to compare the ares, perim of 2 faces thay will scale to different sizes - *0.5 so smaller faces arnt ALWAYS selected with a thresh of 1.0 */ -#define SCALE_CMP(a,b) ((a+a*thresh >= b) && (a-(a*thresh*0.5) <= b)) - -/* **************** GROUP SELECTS ************** */ -/* selects new faces/edges/verts based on the - existing selection - -FACES GROUP - mode 1: same material - mode 2: same image - mode 3: same area - mode 4: same perimeter - mode 5: same normal - mode 6: same co-planer -*/ -int facegroup_select(short mode) -{ - EditMesh *em = G.editMesh; - EditFace *efa, *base_efa=NULL; - unsigned int selcount=0; /*count how many new faces we select*/ - - /*deselcount, count how many deselected faces are left, so we can bail out early - also means that if there are no deselected faces, we can avoid a lot of looping */ - unsigned int deselcount=0; - - short ok=0; - float thresh=G.scene->toolsettings->select_thresh; - - for(efa= em->faces.first; efa; efa= efa->next) { - if (!efa->h) { - if (efa->f & SELECT) { - efa->f1=1; - ok=1; - } else { - efa->f1=0; - deselcount++; /* a deselected face we may select later */ - } - } - } - - if (!ok || !deselcount) /* no data selected OR no more data to select */ - return 0; - - /*if mode is 3 then record face areas, 4 record perimeter */ - if (mode==3) { - for(efa= em->faces.first; efa; efa= efa->next) { - efa->tmp.fp= EM_face_area(efa); - } - } else if (mode==4) { - for(efa= em->faces.first; efa; efa= efa->next) { - efa->tmp.fp= EM_face_perimeter(efa); - } - } - - for(base_efa= em->faces.first; base_efa; base_efa= base_efa->next) { - if (base_efa->f1) { /* This was one of the faces originaly selected */ - if (mode==1) { /* same material */ - for(efa= em->faces.first; efa; efa= efa->next) { - if ( - !(efa->f & SELECT) && - !efa->h && - base_efa->mat_nr == efa->mat_nr - ) { - EM_select_face(efa, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==2) { /* same image */ - MTFace *tf, *base_tf; - - base_tf = (MTFace*)CustomData_em_get(&em->fdata, base_efa->data, - CD_MTFACE); - - if(!base_tf) - return selcount; - - for(efa= em->faces.first; efa; efa= efa->next) { - if (!(efa->f & SELECT) && !efa->h) { - tf = (MTFace*)CustomData_em_get(&em->fdata, efa->data, - CD_MTFACE); - - if(base_tf->tpage == tf->tpage) { - EM_select_face(efa, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } else if (mode==3 || mode==4) { /* same area OR same perimeter, both use the same temp var */ - for(efa= em->faces.first; efa; efa= efa->next) { - if ( - (!(efa->f & SELECT) && !efa->h) && - SCALE_CMP(base_efa->tmp.fp, efa->tmp.fp) - ) { - EM_select_face(efa, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==5) { /* same normal */ - float angle; - for(efa= em->faces.first; efa; efa= efa->next) { - if (!(efa->f & SELECT) && !efa->h) { - angle= VecAngle2(base_efa->n, efa->n); - if (angle/180.0<=thresh) { - EM_select_face(efa, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } else if (mode==6) { /* same planer */ - float angle, base_dot, dot; - base_dot= Inpf(base_efa->cent, base_efa->n); - for(efa= em->faces.first; efa; efa= efa->next) { - if (!(efa->f & SELECT) && !efa->h) { - angle= VecAngle2(base_efa->n, efa->n); - if (angle/180.0<=thresh) { - dot=Inpf(efa->cent, base_efa->n); - if (fabs(base_dot-dot) <= thresh) { - EM_select_face(efa, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } - } - } - } /* end base_efa loop */ - return selcount; -} - - -/* -EDGE GROUP - mode 1: same length - mode 2: same direction - mode 3: same number of face users - mode 4: similar face angles. - mode 5: similar crease - mode 6: similar seam - mode 7: similar sharp -*/ - -/* this function is only used by edgegroup_select's edge angle */ - - - -int edgegroup_select(short mode) -{ - EditMesh *em = G.editMesh; - EditEdge *eed, *base_eed=NULL; - unsigned int selcount=0; /* count how many new edges we select*/ - - /*count how many visible selected edges there are, - so we can return when there are none left */ - unsigned int deselcount=0; - - short ok=0; - float thresh=G.scene->toolsettings->select_thresh; - - for(eed= em->edges.first; eed; eed= eed->next) { - if (!eed->h) { - if (eed->f & SELECT) { - eed->f1=1; - ok=1; - } else { - eed->f1=0; - deselcount++; - } - /* set all eed->tmp.l to 0 we use it later. - for counting face users*/ - eed->tmp.l=0; - eed->f2=0; /* only for mode 4, edge animations */ - } - } - - if (!ok || !deselcount) /* no data selected OR no more data to select*/ - return 0; - - if (mode==1) { /*store length*/ - for(eed= em->edges.first; eed; eed= eed->next) { - if (!eed->h) /* dont calc data for hidden edges*/ - eed->tmp.fp= VecLenf(eed->v1->co, eed->v2->co); - } - } else if (mode==3) { /*store face users*/ - EditFace *efa; - /* cound how many faces each edge uses use tmp->l */ - for(efa= em->faces.first; efa; efa= efa->next) { - efa->e1->tmp.l++; - efa->e2->tmp.l++; - efa->e3->tmp.l++; - if (efa->e4) efa->e4->tmp.l++; - } - } else if (mode==4) { /*store edge angles */ - EditFace *efa; - int j; - /* cound how many faces each edge uses use tmp.l */ - for(efa= em->faces.first; efa; efa= efa->next) { - /* here we use the edges temp data to assign a face - if a face has alredy been assigned (eed->f2==1) - we calculate the angle between the current face and - the edges previously found face. - store the angle in eed->tmp.fp (loosing the face eed->tmp.f) - but tagging eed->f2==2, so we know not to look at it again. - This only works for edges that connect to 2 faces. but its good enough - */ - - /* se we can loop through face edges*/ - j=0; - eed= efa->e1; - while (j<4) { - if (j==1) eed= efa->e2; - else if (j==2) eed= efa->e3; - else if (j==3) { - eed= efa->e4; - if (!eed) - break; - } /* done looping */ - - if (!eed->h) { /* dont calc data for hidden edges*/ - if (eed->f2==2) - break; - else if (eed->f2==0) /* first access, assign the face */ - eed->tmp.f= efa; - else if (eed->f2==1) /* second, we assign the angle*/ - eed->tmp.fp= VecAngle2(eed->tmp.f->n, efa->n)/180; - eed->f2++; /* f2==0 no face assigned. f2==1 one face found. f2==2 angle calculated.*/ - } - j++; - } - } - } - - for(base_eed= em->edges.first; base_eed; base_eed= base_eed->next) { - if (base_eed->f1) { - if (mode==1) { /* same length */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - SCALE_CMP(base_eed->tmp.fp, eed->tmp.fp) - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==2) { /* same direction */ - float base_dir[3], dir[3], angle; - VecSubf(base_dir, base_eed->v1->co, base_eed->v2->co); - for(eed= em->edges.first; eed; eed= eed->next) { - if (!(eed->f & SELECT) && !eed->h) { - VecSubf(dir, eed->v1->co, eed->v2->co); - angle= VecAngle2(base_dir, dir); - - if (angle>90) /* use the smallest angle between the edges */ - angle= fabs(angle-180.0f); - - if (angle/90.0<=thresh) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } else if (mode==3) { /* face users */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - base_eed->tmp.l==eed->tmp.l - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==4 && base_eed->f2==2) { /* edge angles, f2==2 means the edge has an angle. */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - eed->f2==2 && - (fabs(base_eed->tmp.fp-eed->tmp.fp)<=thresh) - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==5) { /* edge crease */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - (fabs(base_eed->crease-eed->crease) <= thresh) - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==6) { /* edge seam */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - (eed->seam == base_eed->seam) - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==7) { /* edge sharp */ - for(eed= em->edges.first; eed; eed= eed->next) { - if ( - !(eed->f & SELECT) && - !eed->h && - (eed->sharp == base_eed->sharp) - ) { - EM_select_edge(eed, 1); - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } - } - return selcount; -} - - -/* -VERT GROUP - mode 1: same normal - mode 2: same number of face users - mode 3: same vertex groups -*/ -int vertgroup_select(short mode) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *base_eve=NULL; - - unsigned int selcount=0; /* count how many new edges we select*/ - - /*count how many visible selected edges there are, - so we can return when there are none left */ - unsigned int deselcount=0; - - short ok=0; - float thresh=G.scene->toolsettings->select_thresh; - - for(eve= em->verts.first; eve; eve= eve->next) { - if (!eve->h) { - if (eve->f & SELECT) { - eve->f1=1; - ok=1; - } else { - eve->f1=0; - deselcount++; - } - /* set all eve->tmp.l to 0 we use them later.*/ - eve->tmp.l=0; - } - - } - - if (!ok || !deselcount) /* no data selected OR no more data to select*/ - return 0; - - - if (mode==2) { /* store face users */ - EditFace *efa; - - /* count how many faces each edge uses use tmp->l */ - for(efa= em->faces.first; efa; efa= efa->next) { - efa->v1->tmp.l++; - efa->v2->tmp.l++; - efa->v3->tmp.l++; - if (efa->v4) efa->v4->tmp.l++; - } - } - - - for(base_eve= em->verts.first; base_eve; base_eve= base_eve->next) { - if (base_eve->f1) { - - if (mode==1) { /* same normal */ - float angle; - for(eve= em->verts.first; eve; eve= eve->next) { - if (!(eve->f & SELECT) && !eve->h) { - angle= VecAngle2(base_eve->no, eve->no); - if (angle/180.0<=thresh) { - eve->f |= SELECT; - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } - } else if (mode==2) { /* face users */ - for(eve= em->verts.first; eve; eve= eve->next) { - if ( - !(eve->f & SELECT) && - !eve->h && - base_eve->tmp.l==eve->tmp.l - ) { - eve->f |= SELECT; - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - } - } - } else if (mode==3) { /* vertex groups */ - MDeformVert *dvert, *base_dvert; - short i, j; /* weight index */ - - base_dvert= CustomData_em_get(&em->vdata, base_eve->data, - CD_MDEFORMVERT); - - if (!base_dvert || base_dvert->totweight == 0) - return selcount; - - for(eve= em->verts.first; eve; eve= eve->next) { - dvert= CustomData_em_get(&em->vdata, eve->data, - CD_MDEFORMVERT); - - if (dvert && !(eve->f & SELECT) && !eve->h && dvert->totweight) { - /* do the extra check for selection in the following if, so were not - checking verts that may be alredy selected */ - for (i=0; base_dvert->totweight >i && !(eve->f & SELECT); i++) { - for (j=0; dvert->totweight >j; j++) { - if (base_dvert->dw[i].def_nr==dvert->dw[j].def_nr) { - eve->f |= SELECT; - selcount++; - deselcount--; - if (!deselcount) /*have we selected all posible faces?, if so return*/ - return selcount; - break; - } - } - } - } - } - } - } - } /* end basevert loop */ - return selcount; -} - -/* EditMode menu triggered from space.c by pressing Shift+G -handles face/edge vert context and -facegroup_select/edgegroup_select/vertgroup_select do all the work -*/ - -void select_mesh_group_menu() -{ - short ret; - int selcount, first_item=1, multi=0; - char str[512] = "Select Similar "; /* total max length is 404 at the moment */ - - if (!ELEM3(G.scene->selectmode, SCE_SELECT_VERTEX, SCE_SELECT_EDGE, SCE_SELECT_FACE)) { - multi=1; - } - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if (multi) strcat(str, "%t|Vertices%x-1|"); - else strcat(str, "Vertices %t|"); - strcat(str, " Normal %x1| Face Users %x2| Shared Vertex Groups%x3"); - first_item=0; - } - - if(G.scene->selectmode & SCE_SELECT_EDGE) { - if (multi) { - if (first_item) strcat(str, "%t|Edges%x-1|"); - else strcat(str, "|%l|Edges%x-1|"); - } else strcat(str, "Edges %t|"); - - strcat(str, " Length %x10| Direction %x20| Face Users%x30| Face Angle%x40| Crease%x50| Seam%x60| Sharp%x70"); - first_item=0; - } - - if(G.scene->selectmode & SCE_SELECT_FACE) { - if (multi) { - strcat(str, "|%l|Faces%x-1|"); - } else strcat(str, "Faces %t|"); - strcat(str, " Material %x100| Image %x200| Area %x300| Perimeter %x400| Normal %x500| Co-Planar %x600"); - - } - - ret= pupmenu(str); - if (ret<1) return; - - if (ret<10) { - selcount= vertgroup_select(ret); - if (selcount) { /* update if data was selected */ - EM_select_flush(); /* so that selected verts, go onto select faces */ - G.totvertsel += selcount; - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Similar Vertices"); - } - return; - } - - if (ret<100) { - selcount= edgegroup_select(ret/10); - - if (selcount) { /* update if data was selected */ - /*EM_select_flush();*/ /* dont use because it can end up selecting more edges and is not usefull*/ - G.totedgesel+=selcount; - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Similar Edges"); - } - return; - } - - if (ret<1000) { - selcount= facegroup_select(ret/100); - if (selcount) { /* update if data was selected */ - G.totfacesel+=selcount; - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Similar Faces"); - } - return; - } -} - -int mesh_layers_menu_charlen(CustomData *data, int type) -{ - int i, len = 0; - /* see if there is a duplicate */ - for(i=0; itotlayer; i++) { - if((&data->layers[i])->type == type) { - /* we could count the chars here but we'll just assumeme each - * is 32 chars with some room for the menu text - 40 should be fine */ - len+=40; - } - } - return len; -} - -/* this function adds menu text into an existing string. - * this string's size should be allocated with mesh_layers_menu_charlen */ -void mesh_layers_menu_concat(CustomData *data, int type, char *str) { - int i, count = 0; - char *str_pt = str; - CustomDataLayer *layer; - - /* see if there is a duplicate */ - for(i=0; itotlayer; i++) { - layer = &data->layers[i]; - if(layer->type == type) { - str_pt += sprintf(str_pt, "%s%%x%d|", layer->name, count); - count++; - } - } -} - -int mesh_layers_menu(CustomData *data, int type) { - int ret; - char *str_pt, *str; - - str_pt = str = MEM_mallocN(mesh_layers_menu_charlen(data, type) + 18, "layer menu"); - str[0] = '\0'; - - str_pt += sprintf(str_pt, "Layers%%t|"); - - mesh_layers_menu_concat(data, type, str_pt); - - ret = pupmenu(str); - MEM_freeN(str); - return ret; -} - -/* ctrl+c in mesh editmode */ -void mesh_copy_menu(void) -{ - EditMesh *em = G.editMesh; - EditSelection *ese; - short ret, change=0; - - if (!em) return; - - ese = em->selected.last; - - if (!ese) return; - - if(ese->type == EDITVERT) { - /*EditVert *ev, *ev_act = (EditVert*)ese->data; - ret= pupmenu("");*/ - } else if(ese->type == EDITEDGE) { - EditEdge *eed, *eed_act = (EditEdge*)ese->data; - float vec[3], vec_mid[3], eed_len, eed_len_act; - - ret= pupmenu("Copy Active Edge to Selected%t|Crease%x1|Length%x2"); - if (ret<1) return; - - eed_len_act = VecLenf(eed_act->v1->co, eed_act->v2->co); - - switch (ret) { - case 1: /* copy crease */ - for(eed=em->edges.first; eed; eed=eed->next) { - if (eed->f & SELECT && eed != eed_act && eed->crease != eed_act->crease) { - eed->crease = eed_act->crease; - change = 1; - } - } - break; - - case 2: /* copy length */ - - for(eed=em->edges.first; eed; eed=eed->next) { - if (eed->f & SELECT && eed != eed_act) { - - eed_len = VecLenf(eed->v1->co, eed->v2->co); - - if (eed_len == eed_len_act) continue; - /* if this edge is zero length we cont do anything with it*/ - if (eed_len == 0.0f) continue; - if (eed_len_act == 0.0f) { - VecAddf(vec_mid, eed->v1->co, eed->v2->co); - VecMulf(vec_mid, 0.5); - VECCOPY(eed->v1->co, vec_mid); - VECCOPY(eed->v2->co, vec_mid); - } else { - /* copy the edge length */ - VecAddf(vec_mid, eed->v1->co, eed->v2->co); - VecMulf(vec_mid, 0.5); - - /* SCALE 1 */ - VecSubf(vec, eed->v1->co, vec_mid); - VecMulf(vec, eed_len_act/eed_len); - VecAddf(eed->v1->co, vec, vec_mid); - - /* SCALE 2 */ - VecSubf(vec, eed->v2->co, vec_mid); - VecMulf(vec, eed_len_act/eed_len); - VecAddf(eed->v2->co, vec, vec_mid); - } - change = 1; - } - } - - if (change) - recalc_editnormals(); - - - break; - } - - } else if(ese->type == EDITFACE) { - EditFace *efa, *efa_act = (EditFace*)ese->data; - MTFace *tf, *tf_act; - MCol *mcol, *mcol_act; - - ret= pupmenu( - "Copy Face Selected%t|" - "Active Material%x1|Active Image%x2|Active UV Coords%x3|" - "Active Mode%x4|Active Transp%x5|Active Vertex Colors%x6|%l|" - - "TexFace UVs from layer%x7|" - "TexFace Images from layer%x8|" - "TexFace All from layer%x9|" - "Vertex Colors from layer%x10"); - - if (ret<1) return; - - tf_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MTFACE); - mcol_act = CustomData_em_get(&em->fdata, efa_act->data, CD_MCOL); - - switch (ret) { - case 1: /* copy material */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa->mat_nr != efa_act->mat_nr) { - efa->mat_nr = efa_act->mat_nr; - change = 1; - } - } - break; - case 2: /* copy image */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (tf_act->tpage) { - tf->tpage = tf_act->tpage; - tf->mode |= TF_TEX; - } else { - tf->tpage = NULL; - tf->mode &= ~TF_TEX; - } - tf->tile= tf_act->tile; - change = 1; - } - } - break; - - case 3: /* copy UV's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, tf_act->uv, sizeof(tf->uv)); - change = 1; - } - } - break; - case 4: /* mode's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->mode= tf_act->mode; - change = 1; - } - } - break; - case 5: /* copy transp's */ - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->transp= tf_act->transp; - change = 1; - } - } - break; - - case 6: /* copy vcols's */ - if (!mcol_act) { - error("mesh has no color layers"); - return; - } else { - /* guess the 4th color if needs be */ - float val =- 1; - - if (!efa_act->v4) { - /* guess the othe vale, we may need to use it - * - * Modifying the 4th value of the mcol is ok here since its not seen - * on a triangle - * */ - val = ((float)(mcol_act->r + (mcol_act+1)->r + (mcol_act+2)->r)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->r = (char)val; - - val = ((float)(mcol_act->g + (mcol_act+1)->g + (mcol_act+2)->g)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->g = (char)val; - - val = ((float)(mcol_act->b + (mcol_act+1)->b + (mcol_act+2)->b)) / 3; CLAMP(val, 0, 255); - (mcol_act+3)->b = (char)val; - } - - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT && efa != efa_act) { - /* TODO - make copy from tri to quad guess the 4th vert */ - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - memcpy(mcol, mcol_act, sizeof(MCol)*4); - change = 1; - } - } - } - - break; - - - /* copy from layer */ - case 7: - case 8: - case 9: - if (!tf_act) { - error("mesh has no uv/image layers"); - return; - } else if (CustomData_number_of_layers(&em->fdata, CD_MTFACE)<2) { - error("mesh does not have multiple uv/image layers"); - return; - } else { - int layer_orig_idx, layer_idx; - - layer_idx = mesh_layers_menu(&em->fdata, CD_MTFACE); - if (layer_idx<0) return; - - /* warning, have not updated mesh pointers however this is not needed since we swicth back */ - layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MTFACE); - if (layer_idx==layer_orig_idx) - return; - - /* get the tfaces */ - CustomData_set_layer_active(&em->fdata, CD_MTFACE, (int)layer_idx); - /* store the tfaces in our temp */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - } - } - CustomData_set_layer_active(&em->fdata, CD_MTFACE, layer_orig_idx); - } - break; - - case 10: /* select vcol layers - make sure this stays in sync with above code */ - if (!mcol_act) { - error("mesh has no color layers"); - return; - } else if (CustomData_number_of_layers(&em->fdata, CD_MCOL)<2) { - error("mesh does not have multiple color layers"); - return; - } else { - int layer_orig_idx, layer_idx; - - layer_idx = mesh_layers_menu(&em->fdata, CD_MCOL); - if (layer_idx<0) return; - - /* warning, have not updated mesh pointers however this is not needed since we swicth back */ - layer_orig_idx = CustomData_get_active_layer(&em->fdata, CD_MCOL); - if (layer_idx==layer_orig_idx) - return; - - /* get the tfaces */ - CustomData_set_layer_active(&em->fdata, CD_MCOL, (int)layer_idx); - /* store the tfaces in our temp */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - efa->tmp.p = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - } - } - CustomData_set_layer_active(&em->fdata, CD_MCOL, layer_orig_idx); - - } - break; - } - - /* layer copy only - sanity checks done above */ - switch (ret) { - case 7: /* copy UV's only */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, tf_act->uv, sizeof(tf->uv)); - change = 1; - } - } - break; - case 8: /* copy image settings only */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (tf_act->tpage) { - tf->tpage = tf_act->tpage; - tf->mode |= TF_TEX; - } else { - tf->tpage = NULL; - tf->mode &= ~TF_TEX; - } - tf->tile= tf_act->tile; - change = 1; - } - } - break; - case 9: /* copy all tface info */ - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf_act = (MTFace *)efa->tmp.p; /* not active but easier to use this way */ - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - memcpy(tf->uv, ((MTFace *)efa->tmp.p)->uv, sizeof(tf->uv)); - tf->tpage = tf_act->tpage; - tf->mode = tf_act->mode; - tf->transp = tf_act->transp; - change = 1; - } - } - break; - case 10: - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - mcol_act = (MCol *)efa->tmp.p; - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - memcpy(mcol, mcol_act, sizeof(MCol)*4); - change = 1; - } - } - break; - } - - } - - if (change) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - if(ese->type == EDITVERT) BIF_undo_push("Copy Vert Attribute"); - else if (ese->type == EDITEDGE) BIF_undo_push("Copy Edge Attribute"); - else if (ese->type == EDITFACE) BIF_undo_push("Copy Face Attribute"); - } - -} - - -/* **************** LOOP SELECTS *************** */ - -/* selects quads in loop direction of indicated edge */ -/* only flush over edges with valence <= 2 */ -void faceloop_select(EditEdge *startedge, int select) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - int looking= 1; - - /* in eed->f1 we put the valence (amount of faces in edge) */ - /* in eed->f2 we put tagged flag as correct loop */ - /* in efa->f1 we put tagged flag as correct to select */ - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; - eed->f2= 0; - } - for(efa= em->faces.first; efa; efa= efa->next) { - efa->f1= 0; - if(efa->h==0) { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - - /* tag startedge OK*/ - startedge->f2= 1; - - while(looking) { - looking= 0; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e4 && efa->f1==0) { /* not done quad */ - if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { /* valence ok */ - - /* if edge tagged, select opposing edge and mark face ok */ - if(efa->e1->f2) { - efa->e3->f2= 1; - efa->f1= 1; - looking= 1; - } - else if(efa->e2->f2) { - efa->e4->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e3->f2) { - efa->e1->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e4->f2) { - efa->e2->f2= 1; - efa->f1= 1; - looking= 1; - } - } - } - } - } - - /* (de)select the faces */ - if(select!=2) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f1) EM_select_face(efa, select); - } - } -} - - -/* helper for edgeloop_select, checks for eed->f2 tag in faces */ -static int edge_not_in_tagged_face(EditEdge *eed) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - if(efa->e1==eed || efa->e2==eed || efa->e3==eed || efa->e4==eed) { /* edge is in face */ - if(efa->e1->f2 || efa->e2->f2 || efa->e3->f2 || (efa->e4 && efa->e4->f2)) { /* face is tagged */ - return 0; - } - } - } - } - return 1; -} - -/* selects or deselects edges that: -- if edges has 2 faces: - - has vertices with valence of 4 - - not shares face with previous edge -- if edge has 1 face: - - has vertices with valence 4 - - not shares face with previous edge - - but also only 1 face -- if edge no face: - - has vertices with valence 2 -*/ -static void edgeloop_select(EditEdge *starteed, int select) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - int looking= 1; - - /* in f1 we put the valence (amount of edges in a vertex, or faces in edge) */ - /* in eed->f2 and efa->f1 we put tagged flag as correct loop */ - for(eve= em->verts.first; eve; eve= eve->next) { - eve->f1= 0; - eve->f2= 0; - } - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; - eed->f2= 0; - if((eed->h & 1)==0) { /* fgon edges add to valence too */ - eed->v1->f1++; eed->v2->f1++; - } - } - for(efa= em->faces.first; efa; efa= efa->next) { - efa->f1= 0; - if(efa->h==0) { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - - /* looped edges & vertices get tagged f2 */ - starteed->f2= 1; - if(starteed->v1->f1<5) starteed->v1->f2= 1; - if(starteed->v2->f1<5) starteed->v2->f2= 1; - /* sorry, first edge isnt even ok */ - if(starteed->v1->f2==0 && starteed->v2->f2==0) looking= 0; - - while(looking) { - looking= 0; - - /* find correct valence edges which are not tagged yet, but connect to tagged one */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0 && eed->f2==0) { /* edge not hidden, not tagged */ - if( (eed->v1->f1<5 && eed->v1->f2) || (eed->v2->f1<5 && eed->v2->f2)) { /* valence of vertex OK, and is tagged */ - /* new edge is not allowed to be in face with tagged edge */ - if(edge_not_in_tagged_face(eed)) { - if(eed->f1==starteed->f1) { /* same amount of faces */ - looking= 1; - eed->f2= 1; - if(eed->v2->f1<5) eed->v2->f2= 1; - if(eed->v1->f1<5) eed->v1->f2= 1; - } - } - } - } - } - } - /* and we do the select */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f2) EM_select_edge(eed, select); - } -} - -/* - Almostly exactly the same code as faceloop select -*/ -static void edgering_select(EditEdge *startedge, int select){ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - int looking= 1; - - /* in eed->f1 we put the valence (amount of faces in edge) */ - /* in eed->f2 we put tagged flag as correct loop */ - /* in efa->f1 we put tagged flag as correct to select */ - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; - eed->f2= 0; - } - for(efa= em->faces.first; efa; efa= efa->next) { - efa->f1= 0; - if(efa->h==0) { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - - /* tag startedge OK */ - startedge->f2= 1; - - while(looking) { - looking= 0; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e4 && efa->f1==0 && !efa->h) { /* not done quad */ - if(efa->e1->f1<=2 && efa->e2->f1<=2 && efa->e3->f1<=2 && efa->e4->f1<=2) { /* valence ok */ - - /* if edge tagged, select opposing edge and mark face ok */ - if(efa->e1->f2) { - efa->e3->f2= 1; - efa->f1= 1; - looking= 1; - } - else if(efa->e2->f2) { - efa->e4->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e3->f2) { - efa->e1->f2= 1; - efa->f1= 1; - looking= 1; - } - if(efa->e4->f2) { - efa->e2->f2= 1; - efa->f1= 1; - looking= 1; - } - } - } - } - } - - /* (de)select the edges */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f2) EM_select_edge(eed, select); - } -} - -void loop_multiselect(int looptype) -{ - EditEdge *eed; - EditEdge **edarray; - int edindex, edfirstcount; - - /*edarray = MEM_mallocN(sizeof(*edarray)*G.totedgesel,"edge array");*/ - edarray = MEM_mallocN(sizeof(EditEdge*)*G.totedgesel,"edge array"); - edindex = 0; - edfirstcount = G.totedgesel; - - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(eed->f&SELECT){ - edarray[edindex] = eed; - edindex += 1; - } - } - - if(looptype){ - for(edindex = 0; edindex < edfirstcount; edindex +=1){ - eed = edarray[edindex]; - edgering_select(eed,SELECT); - } - countall(); - EM_selectmode_flush(); - BIF_undo_push("Edge Ring Multi-Select"); - } - else{ - for(edindex = 0; edindex < edfirstcount; edindex +=1){ - eed = edarray[edindex]; - edgeloop_select(eed,SELECT); - } - countall(); - EM_selectmode_flush(); - BIF_undo_push("Edge Loop Multi-Select"); - } - MEM_freeN(edarray); - allqueue(REDRAWVIEW3D,0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); -} - -/* ***************** MAIN MOUSE SELECTION ************** */ - -/* just to have the functions nice together */ -static void mouse_mesh_loop(void) -{ - EditEdge *eed; - int select= 1; - int dist= 50; - - eed= findnearestedge(&dist); - if(eed) { - - if((G.qual & LR_SHIFTKEY)==0) EM_clear_flag_all(SELECT); - - if((eed->f & SELECT)==0) select=1; - else if(G.qual & LR_SHIFTKEY) select=0; - - if(G.scene->selectmode & SCE_SELECT_FACE) { - faceloop_select(eed, select); - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - if(G.qual == (LR_CTRLKEY | LR_ALTKEY) || G.qual == (LR_CTRLKEY | LR_ALTKEY |LR_SHIFTKEY)) - edgering_select(eed, select); - else if(G.qual & LR_ALTKEY) - edgeloop_select(eed, select); - } - else if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if(G.qual == (LR_CTRLKEY | LR_ALTKEY) || G.qual == (LR_CTRLKEY | LR_ALTKEY |LR_SHIFTKEY)) - edgering_select(eed, select); - else if(G.qual & LR_ALTKEY) - edgeloop_select(eed, select); - } - - /* frontbuffer draw of last selected only */ - unified_select_draw(NULL, eed, NULL); - - EM_selectmode_flush(); - countall(); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - } -} - - -/* here actual select happens */ -void mouse_mesh(void) -{ - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - if(G.qual & LR_ALTKEY) mouse_mesh_loop(); - else if(unified_findnearest(&eve, &eed, &efa)) { - - if((G.qual & LR_SHIFTKEY)==0) EM_clear_flag_all(SELECT); - - if(efa) { - /* set the last selected face */ - EM_set_actFace(efa); - - if( (efa->f & SELECT)==0 ) { - EM_store_selection(efa, EDITFACE); - EM_select_face_fgon(efa, 1); - } - else if(G.qual & LR_SHIFTKEY) { - EM_remove_selection(efa, EDITFACE); - EM_select_face_fgon(efa, 0); - } - } - else if(eed) { - if((eed->f & SELECT)==0) { - EM_store_selection(eed, EDITEDGE); - EM_select_edge(eed, 1); - } - else if(G.qual & LR_SHIFTKEY) { - EM_remove_selection(eed, EDITEDGE); - EM_select_edge(eed, 0); - } - } - else if(eve) { - if((eve->f & SELECT)==0) { - eve->f |= SELECT; - EM_store_selection(eve, EDITVERT); - } - else if(G.qual & LR_SHIFTKEY){ - EM_remove_selection(eve, EDITVERT); - eve->f &= ~SELECT; - } - } - - /* frontbuffer draw of last selected only */ - unified_select_draw(eve, eed, efa); - - EM_selectmode_flush(); - countall(); - - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) { - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); /* for the texture face panel */ - } - if (efa && efa->mat_nr != G.obedit->actcol-1) { - G.obedit->actcol= efa->mat_nr+1; - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSSHADING, 0); - BIF_preview_changed(ID_MA); - } - } - - rightmouse_transform(); -} - - -void selectconnected_mesh_all(void) -{ - EditMesh *em = G.editMesh; - EditVert *v1,*v2; - EditEdge *eed; - short done=1, toggle=0; - - if(em->edges.first==0) return; - - while(done==1) { - done= 0; - - toggle++; - if(toggle & 1) eed= em->edges.first; - else eed= em->edges.last; - - while(eed) { - v1= eed->v1; - v2= eed->v2; - if(eed->h==0) { - if(v1->f & SELECT) { - if( (v2->f & SELECT)==0 ) { - v2->f |= SELECT; - done= 1; - } - } - else if(v2->f & SELECT) { - if( (v1->f & SELECT)==0 ) { - v1->f |= SELECT; - done= 1; - } - } - } - if(toggle & 1) eed= eed->next; - else eed= eed->prev; - } - } - - /* now use vertex select flag to select rest */ - EM_select_flush(); - - countall(); - - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Connected (All)"); -} - -void selectconnected_mesh(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *v1, *v2; - EditEdge *eed; - EditFace *efa; - short done=1, sel, toggle=0; - - if(em->edges.first==0) return; - - if( unified_findnearest(&eve, &eed, &efa)==0 ) { - error("Nothing indicated "); - return; - } - - sel= 1; - if(G.qual & LR_SHIFTKEY) sel=0; - - /* clear test flags */ - for(v1= em->verts.first; v1; v1= v1->next) v1->f1= 0; - - /* start vertex/face/edge */ - if(eve) eve->f1= 1; - else if(eed) eed->v1->f1= eed->v2->f1= 1; - else efa->v1->f1= efa->v2->f1= efa->v3->f1= 1; - - /* set flag f1 if affected */ - while(done==1) { - done= 0; - toggle++; - - if(toggle & 1) eed= em->edges.first; - else eed= em->edges.last; - - while(eed) { - v1= eed->v1; - v2= eed->v2; - - if(eed->h==0) { - if(v1->f1 && v2->f1==0) { - v2->f1= 1; - done= 1; - } - else if(v1->f1==0 && v2->f1) { - v1->f1= 1; - done= 1; - } - } - - if(toggle & 1) eed= eed->next; - else eed= eed->prev; - } - } - - /* now use vertex f1 flag to select/deselect */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->f1 && eed->v2->f1) - EM_select_edge(eed, sel); - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->v1->f1 && efa->v2->f1 && efa->v3->f1 && (efa->v4==NULL || efa->v4->f1)) - EM_select_face(efa, sel); - } - /* no flush needed, connected geometry is done */ - - countall(); - - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - BIF_undo_push("Select Linked"); - -} - -/* for use with selectconnected_delimit_mesh only! */ -#define is_edge_delimit_ok(eed) ((eed->tmp.l == 1) && (eed->seam==0)) -#define is_face_tag(efa) is_edge_delimit_ok(efa->e1) || is_edge_delimit_ok(efa->e2) || is_edge_delimit_ok(efa->e3) || (efa->v4 && is_edge_delimit_ok(efa->e4)) - -#define face_tag(efa)\ - if(efa->v4) efa->tmp.l= efa->e1->tmp.l= efa->e2->tmp.l= efa->e3->tmp.l= efa->e4->tmp.l= 1;\ - else efa->tmp.l= efa->e1->tmp.l= efa->e2->tmp.l= efa->e3->tmp.l= 1; - -/* all - 1) use all faces for extending the selection 2) only use the mouse face - * sel - 1) select 0) deselect - * */ -static void selectconnected_delimit_mesh__internal(short all, short sel) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - short done=1, change=0; - int dist = 75; - EditEdge *eed; - if(em->faces.first==0) return; - - /* flag all edges as off*/ - for(eed= em->edges.first; eed; eed= eed->next) - eed->tmp.l=0; - - if (all) { - for(efa= em->faces.first; efa; efa= efa->next) { - if (efa->f & SELECT) { - face_tag(efa); - } else { - efa->tmp.l = 0; - } - } - } else { - EditFace *efa_mouse = findnearestface(&dist); - - if( !efa_mouse ) { - error("Nothing indicated "); - return; - } - - for(efa= em->faces.first; efa; efa= efa->next) { - efa->tmp.l = 0; - } - efa_mouse->tmp.l = 1; - face_tag(efa_mouse); - } - - while(done==1) { - done= 0; - /* simple algo - select all faces that have a selected edge - * this intern selects the edge, repeat until nothing is left to do */ - for(efa= em->faces.first; efa; efa= efa->next) { - if ((efa->tmp.l == 0) && (!efa->h)) { - if (is_face_tag(efa)) { - face_tag(efa); - done= 1; - } - } - } - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if (efa->tmp.l) { - if (sel) { - if (!(efa->f & SELECT)) { - EM_select_face(efa, 1); - change = 1; - } - } else { - if (efa->f & SELECT) { - EM_select_face(efa, 0); - change = 1; - } - } - } - } - - if (!change) - return; - - if (!sel) /* make sure de-selecting faces didnt de-select the verts/edges connected to selected faces, this is common with boundries */ - for(efa= em->faces.first; efa; efa= efa->next) - if (efa->f & SELECT) - EM_select_face(efa, 1); - - countall(); - - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - BIF_undo_push("Select Linked Delimeted"); - -} - -#undef is_edge_delimit_ok -#undef is_face_tag -#undef face_tag - -void selectconnected_delimit_mesh(void) -{ - selectconnected_delimit_mesh__internal(0, ((G.qual & LR_SHIFTKEY)==0)); -} -void selectconnected_delimit_mesh_all(void) -{ - selectconnected_delimit_mesh__internal(1, 1); -} - - -/* swap is 0 or 1, if 1 it hides not selected */ -void hide_mesh(int swap) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - int a; - - if(G.obedit==0) return; - - /* hide happens on least dominant select mode, and flushes up, not down! (helps preventing errors in subsurf) */ - /* - vertex hidden, always means edge is hidden too - - edge hidden, always means face is hidden too - - face hidden, only set face hide - - then only flush back down what's absolute hidden - */ - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eve= em->verts.first; eve; eve= eve->next) { - if((eve->f & SELECT)!=swap) { - eve->f &= ~SELECT; - eve->h= 1; - } - } - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->v1->h || eed->v2->h) { - eed->h |= 1; - eed->f &= ~SELECT; - } - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e1->h & 1 || efa->e2->h & 1 || efa->e3->h & 1 || (efa->e4 && efa->e4->h & 1)) { - efa->h= 1; - efa->f &= ~SELECT; - } - } - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - - for(eed= em->edges.first; eed; eed= eed->next) { - if((eed->f & SELECT)!=swap) { - eed->h |= 1; - EM_select_edge(eed, 0); - } - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->e1->h & 1 || efa->e2->h & 1 || efa->e3->h & 1 || (efa->e4 && efa->e4->h & 1)) { - efa->h= 1; - efa->f &= ~SELECT; - } - } - } - else { - - for(efa= em->faces.first; efa; efa= efa->next) { - if((efa->f & SELECT)!=swap) { - efa->h= 1; - EM_select_face(efa, 0); - } - } - } - - /* flush down, only whats 100% hidden */ - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(eed= em->edges.first; eed; eed= eed->next) eed->f1= 0; - - if(G.scene->selectmode & SCE_SELECT_FACE) { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h) a= 1; else a= 2; - efa->e1->f1 |= a; - efa->e2->f1 |= a; - efa->e3->f1 |= a; - if(efa->e4) efa->e4->f1 |= a; - } - } - - if(G.scene->selectmode >= SCE_SELECT_EDGE) { - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f1==1) eed->h |= 1; - if(eed->h & 1) a= 1; else a= 2; - eed->v1->f1 |= a; - eed->v2->f1 |= a; - } - } - - if(G.scene->selectmode >= SCE_SELECT_VERTEX) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f1==1) eve->h= 1; - } - } - - G.totedgesel= G.totfacesel= G.totvertsel= 0; - allqueue(REDRAWVIEW3D, 0); - if(EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Hide"); -} - - -void reveal_mesh(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - if(G.obedit==0) return; - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h) { - eve->h= 0; - eve->f |= SELECT; - } - } - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h & 1) { - eed->h &= ~1; - if(G.scene->selectmode & SCE_SELECT_VERTEX); - else EM_select_edge(eed, 1); - } - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h) { - efa->h= 0; - if(G.scene->selectmode & (SCE_SELECT_EDGE|SCE_SELECT_VERTEX)); - else EM_select_face(efa, 1); - } - } - - EM_fgon_flags(); /* redo flags and indices for fgons */ - EM_selectmode_flush(); - countall(); - - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Reveal"); -} - -/* TODO - improve this with sync sel and selection flushing */ -void hide_tface_uv(int swap) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - /* call the mesh function if we are in mesh sync sel */ - if (G.sima->flag & SI_SYNC_UVSEL) { - hide_mesh(swap); - return; - } - - if(swap) { - for (efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if((tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3))==0) { - if(!efa->v4) - EM_select_face(efa, 0); - else if(!(tface->flag & TF_SEL4)) - EM_select_face(efa, 0); - } - } - } - } else { - for (efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) - EM_select_face(efa, 0); - else if(efa->v4 && tface->flag & TF_SEL4) - EM_select_face(efa, 0); - } - } - } - - /*deselects too many but ok for now*/ - EM_deselect_flush(); - EM_validate_selections(); - - BIF_undo_push("Hide UV"); - - object_tface_flags_changed(OBACT, 0); -} - -void reveal_tface_uv(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - /* call the mesh function if we are in mesh sync sel */ - if (G.sima->flag & SI_SYNC_UVSEL) { - reveal_mesh(); - return; - } - - for (efa= em->faces.first; efa; efa= efa->next) { - if (!(efa->h)) { - if (!(efa->f & SELECT)) { - EM_select_face(efa, 1); - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tface->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } - } - } - - EM_selectmode_flush(); - - BIF_undo_push("Reveal UV"); - - object_tface_flags_changed(OBACT, 0); -} - -void select_faces_by_numverts(int numverts) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - /* Selects trias/qiads or isolated verts, and edges that do not have 2 neighboring - * faces - */ - - /* for loose vertices/edges, we first select all, loop below will deselect */ - if(numverts==5) - EM_set_flag_all(SELECT); - else if(G.scene->selectmode!=SCE_SELECT_FACE) { - error("Only works in face selection mode"); - return; - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if (efa->e4) { - EM_select_face(efa, (numverts==4) ); - } - else { - EM_select_face(efa, (numverts==3) ); - } - } - - countall(); - addqueue(curarea->win, REDRAW, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - if (numverts==3) - BIF_undo_push("Select Triangles"); - else if (numverts==4) - BIF_undo_push("Select Quads"); - else - BIF_undo_push("Select non-Triangles/Quads"); -} - -void select_sharp_edges(void) -{ - /* Find edges that have exactly two neighboring faces, - * check the angle between those faces, and if angle is - * small enough, select the edge - */ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - EditFace **efa1; - EditFace **efa2; - long edgecount = 0, i; - static short sharpness = 135; - float fsharpness; - - if(G.scene->selectmode==SCE_SELECT_FACE) { - error("Doesn't work in face selection mode"); - return; - } - - if(button(&sharpness,0, 180,"Max Angle:")==0) return; - /* if faces are at angle 'sharpness', then the face normals - * are at angle 180.0 - 'sharpness' (convert to radians too) - */ - fsharpness = ((180.0 - sharpness) * M_PI) / 180.0; - - i=0; - /* count edges, use tmp.l */ - eed= em->edges.first; - while(eed) { - edgecount++; - eed->tmp.l = i; - eed= eed->next; - ++i; - } - - /* for each edge, we want a pointer to two adjacent faces */ - efa1 = MEM_callocN(edgecount*sizeof(EditFace *), - "pairs of edit face pointers"); - efa2 = MEM_callocN(edgecount*sizeof(EditFace *), - "pairs of edit face pointers"); - -#define face_table_edge(eed) { \ - i = eed->tmp.l; \ - if (i != -1) { \ - if (efa1[i]) { \ - if (efa2[i]) { \ - /* invalidate, edge has more than two neighbors */ \ - eed->tmp.l = -1; \ - } \ - else { \ - efa2[i] = efa; \ - } \ - } \ - else { \ - efa1[i] = efa; \ - } \ - } \ - } - - /* find the adjacent faces of each edge, we want only two */ - efa= em->faces.first; - while(efa) { - face_table_edge(efa->e1); - face_table_edge(efa->e2); - face_table_edge(efa->e3); - if (efa->e4) { - face_table_edge(efa->e4); - } - efa= efa->next; - } - -#undef face_table_edge - - eed = em->edges.first; - while(eed) { - i = eed->tmp.l; - if (i != -1) { - /* edge has two or less neighboring faces */ - if ( (efa1[i]) && (efa2[i]) ) { - /* edge has exactly two neighboring faces, check angle */ - float angle; - angle = saacos(efa1[i]->n[0]*efa2[i]->n[0] + - efa1[i]->n[1]*efa2[i]->n[1] + - efa1[i]->n[2]*efa2[i]->n[2]); - if (fabs(angle) >= fsharpness) - EM_select_edge(eed, 1); - } - } - - eed= eed->next; - } - - MEM_freeN(efa1); - MEM_freeN(efa2); - - countall(); - addqueue(curarea->win, REDRAW, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - BIF_undo_push("Select Sharp Edges"); -} - -void select_linked_flat_faces(void) -{ - /* Find faces that are linked to selected faces that are - * relatively flat (angle between faces is higher than - * specified angle) - */ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - EditFace **efa1; - EditFace **efa2; - long edgecount = 0, i, faceselcount=0, faceselcountold=0; - static short sharpness = 135; - float fsharpness; - - if(G.scene->selectmode!=SCE_SELECT_FACE) { - error("Only works in face selection mode"); - return; - } - - if(button(&sharpness,0, 180,"Min Angle:")==0) return; - /* if faces are at angle 'sharpness', then the face normals - * are at angle 180.0 - 'sharpness' (convert to radians too) - */ - fsharpness = ((180.0 - sharpness) * M_PI) / 180.0; - - i=0; - /* count edges, use tmp.l */ - eed= em->edges.first; - while(eed) { - edgecount++; - eed->tmp.l = i; - eed= eed->next; - ++i; - } - - /* for each edge, we want a pointer to two adjacent faces */ - efa1 = MEM_callocN(edgecount*sizeof(EditFace *), - "pairs of edit face pointers"); - efa2 = MEM_callocN(edgecount*sizeof(EditFace *), - "pairs of edit face pointers"); - -#define face_table_edge(eed) { \ - i = eed->tmp.l; \ - if (i != -1) { \ - if (efa1[i]) { \ - if (efa2[i]) { \ - /* invalidate, edge has more than two neighbors */ \ - eed->tmp.l = -1; \ - } \ - else { \ - efa2[i] = efa; \ - } \ - } \ - else { \ - efa1[i] = efa; \ - } \ - } \ - } - - /* find the adjacent faces of each edge, we want only two */ - efa= em->faces.first; - while(efa) { - face_table_edge(efa->e1); - face_table_edge(efa->e2); - face_table_edge(efa->e3); - if (efa->e4) { - face_table_edge(efa->e4); - } - - /* while were at it, count the selected faces */ - if (efa->f & SELECT) ++faceselcount; - - efa= efa->next; - } - -#undef face_table_edge - - eed= em->edges.first; - while(eed) { - i = eed->tmp.l; - if (i != -1) { - /* edge has two or less neighboring faces */ - if ( (efa1[i]) && (efa2[i]) ) { - /* edge has exactly two neighboring faces, check angle */ - float angle; - angle = saacos(efa1[i]->n[0]*efa2[i]->n[0] + - efa1[i]->n[1]*efa2[i]->n[1] + - efa1[i]->n[2]*efa2[i]->n[2]); - /* invalidate: edge too sharp */ - if (fabs(angle) >= fsharpness) - eed->tmp.l = -1; - } - else { - /* invalidate: less than two neighbors */ - eed->tmp.l = -1; - } - } - - eed= eed->next; - } - -#define select_flat_neighbor(eed) { \ - i = eed->tmp.l; \ - if (i!=-1) { \ - if (! (efa1[i]->f & SELECT) ) { \ - EM_select_face(efa1[i], 1); \ - ++faceselcount; \ - } \ - if (! (efa2[i]->f & SELECT) ) { \ - EM_select_face(efa2[i], 1); \ - ++faceselcount; \ - } \ - } \ - } - - while (faceselcount != faceselcountold) { - faceselcountold = faceselcount; - - efa= em->faces.first; - while(efa) { - if (efa->f & SELECT) { - select_flat_neighbor(efa->e1); - select_flat_neighbor(efa->e2); - select_flat_neighbor(efa->e3); - if (efa->e4) { - select_flat_neighbor(efa->e4); - } - } - efa= efa->next; - } - } - -#undef select_flat_neighbor - - MEM_freeN(efa1); - MEM_freeN(efa2); - - countall(); - addqueue(curarea->win, REDRAW, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Linked Flat Faces"); -} - -void select_non_manifold(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - /* Selects isolated verts, and edges that do not have 2 neighboring - * faces - */ - - if(G.scene->selectmode==SCE_SELECT_FACE) { - error("Doesn't work in face selection mode"); - return; - } - - eve= em->verts.first; - while(eve) { - /* this will count how many edges are connected - * to this vert */ - eve->f1= 0; - eve= eve->next; - } - - eed= em->edges.first; - while(eed) { - /* this will count how many faces are connected to - * this edge */ - eed->f1= 0; - /* increase edge count for verts */ - ++eed->v1->f1; - ++eed->v2->f1; - eed= eed->next; - } - - efa= em->faces.first; - while(efa) { - /* increase face count for edges */ - ++efa->e1->f1; - ++efa->e2->f1; - ++efa->e3->f1; - if (efa->e4) - ++efa->e4->f1; - efa= efa->next; - } - - /* select verts that are attached to an edge that does not - * have 2 neighboring faces */ - eed= em->edges.first; - while(eed) { - if (eed->h==0 && eed->f1 != 2) { - EM_select_edge(eed, 1); - } - eed= eed->next; - } - - /* select isolated verts */ - eve= em->verts.first; - while(eve) { - if (eve->f1 == 0) { - if (!eve->h) eve->f |= SELECT; - } - eve= eve->next; - } - - countall(); - addqueue(curarea->win, REDRAW, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select Non Manifold"); -} - -void selectswap_mesh(void) /* UI level */ -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0) { - if(eve->f & SELECT) eve->f &= ~SELECT; - else eve->f|= SELECT; - } - } - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - EM_select_edge(eed, !(eed->f & SELECT)); - } - } - } - else { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - EM_select_face(efa, !(efa->f & SELECT)); - } - } - } - - EM_selectmode_flush(); - - countall(); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - BIF_undo_push("Select Swap"); - -} - -void deselectall_mesh(void) /* this toggles!!!, UI level */ -{ - - if(G.obedit->lay & G.vd->lay) { - - if( EM_nvertices_selected() ) { - EM_clear_flag_all(SELECT); - BIF_undo_push("Deselect All"); - } - else { - EM_set_flag_all(SELECT); - BIF_undo_push("Select All"); - } - - countall(); - - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - allqueue(REDRAWVIEW3D, 0); - } -} - -void select_more(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) eve->f1= 1; - else eve->f1 = 0; - } - - /* set f1 flags in vertices to select 'more' */ - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - if (eed->v1->f & SELECT) - eed->v2->f1 = 1; - if (eed->v2->f & SELECT) - eed->v1->f1 = 1; - } - } - - /* new selected edges, but not in facemode */ - if(G.scene->selectmode <= SCE_SELECT_EDGE) { - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - if(eed->v1->f1 && eed->v2->f1) EM_select_edge(eed, 1); - } - } - } - /* new selected faces */ - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - if(efa->v1->f1 && efa->v2->f1 && efa->v3->f1 && (efa->v4==NULL || efa->v4->f1)) - EM_select_face(efa, 1); - } - } - - countall(); - addqueue(curarea->win, REDRAW, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Select More"); -} - -void select_less(void) -{ - EditMesh *em = G.editMesh; - EditEdge *eed; - EditFace *efa; - - if(G.scene->selectmode <= SCE_SELECT_EDGE) { - /* eed->f1 == 1: edge with a selected and deselected vert */ - - for(eed= em->edges.first; eed; eed= eed->next) { - eed->f1= 0; - if(eed->h==0) { - - if ( !(eed->v1->f & SELECT) && (eed->v2->f & SELECT) ) - eed->f1= 1; - if ( (eed->v1->f & SELECT) && !(eed->v2->f & SELECT) ) - eed->f1= 1; - } - } - - /* deselect edges with flag set */ - for(eed= em->edges.first; eed; eed= eed->next) { - if (eed->h==0 && eed->f1 == 1) { - EM_select_edge(eed, 0); - } - } - EM_deselect_flush(); - - } - else { - /* deselect faces with 1 or more deselect edges */ - /* eed->f1 == mixed selection edge */ - for(eed= em->edges.first; eed; eed= eed->next) eed->f1= 0; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - if(efa->f & SELECT) { - efa->e1->f1 |= 1; - efa->e2->f1 |= 1; - efa->e3->f1 |= 1; - if(efa->e4) efa->e4->f1 |= 1; - } - else { - efa->e1->f1 |= 2; - efa->e2->f1 |= 2; - efa->e3->f1 |= 2; - if(efa->e4) efa->e4->f1 |= 2; - } - } - } - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - if(efa->e1->f1==3 || efa->e2->f1==3 || efa->e3->f1==3 || (efa->e4 && efa->e4->f1==3)) { - EM_select_face(efa, 0); - } - } - } - EM_selectmode_flush(); - - } - - countall(); - BIF_undo_push("Select Less"); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); -} - - -void selectrandom_mesh(void) /* randomly selects a user-set % of vertices/edges/faces */ -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - static short randfac = 50; - - if(G.obedit==NULL || (G.obedit->lay & G.vd->lay)==0) return; - - /* Get the percentage of vertices to randomly select as 'randfac' */ - if(button(&randfac,0, 100,"Percentage:")==0) return; - - BLI_srand( BLI_rand() ); /* random seed */ - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0) { - if ( (BLI_frand() * 100) < randfac) - eve->f |= SELECT; - } - } - EM_selectmode_flush(); - countall(); - BIF_undo_push("Select Random: Vertices"); - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - if ( (BLI_frand() * 100) < randfac) - EM_select_edge(eed, 1); - } - } - EM_selectmode_flush(); - countall(); - BIF_undo_push("Select Random:Edges"); - } - else { - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0) { - if ( (BLI_frand() * 100) < randfac) - EM_select_face(efa, 1); - } - } - - EM_selectmode_flush(); - countall(); - BIF_undo_push("Select Random:Faces"); - } - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); -} - -void editmesh_select_by_material(int index) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - for (efa=em->faces.first; efa; efa= efa->next) { - if (efa->mat_nr==index) { - EM_select_face(efa, 1); - } - } - - EM_selectmode_flush(); -} - -void editmesh_deselect_by_material(int index) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - for (efa=em->faces.first; efa; efa= efa->next) { - if (efa->mat_nr==index) { - EM_select_face(efa, 0); - } - } - - EM_selectmode_flush(); -} - -void EM_selectmode_menu(void) -{ - int val; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) pupmenu_set_active(1); - else if(G.scene->selectmode & SCE_SELECT_EDGE) pupmenu_set_active(2); - else pupmenu_set_active(3); - - val= pupmenu("Select Mode%t|Vertices|Edges|Faces"); - - - if(val>0) { - if(val==1){ - G.scene->selectmode= SCE_SELECT_VERTEX; - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Vertex"); - } - else if(val==2){ - if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_EDGE); - G.scene->selectmode= SCE_SELECT_EDGE; - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Edge"); - } - - else{ - if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_FACE); - G.scene->selectmode= SCE_SELECT_FACE; - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Vertex"); - } - - allqueue(REDRAWVIEW3D, 1); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - } -} - -/* ************************* SEAMS AND EDGES **************** */ - -void editmesh_mark_seam(int clear) -{ - EditMesh *em= G.editMesh; - EditEdge *eed; - - if(multires_level1_test()) return; - - /* auto-enable seams drawing */ - if(clear==0) { - if(!(G.f & G_DRAWSEAMS)) { - G.f |= G_DRAWSEAMS; - allqueue(REDRAWBUTSEDIT, 0); - } - } - - if(clear) { - eed= em->edges.first; - while(eed) { - if((eed->h==0) && (eed->f & SELECT)) { - eed->seam = 0; - } - eed= eed->next; - } - BIF_undo_push("Mark Seam"); - } - else { - eed= em->edges.first; - while(eed) { - if((eed->h==0) && (eed->f & SELECT)) { - eed->seam = 1; - } - eed= eed->next; - } - BIF_undo_push("Clear Seam"); - } - - allqueue(REDRAWVIEW3D, 0); -} - -void editmesh_mark_sharp(int set) -{ - EditMesh *em= G.editMesh; - EditEdge *eed; - -#if 0 - /* auto-enable sharp edge drawing */ - if(set) { - if(!(G.f & G_DRAWSEAMS)) { - G.f |= G_DRAWSEAMS; - allqueue(REDRAWBUTSEDIT, 0); - } - } -#endif - - if(multires_level1_test()) return; - - if(set) { - eed= em->edges.first; - while(eed) { - if(!eed->h && (eed->f & SELECT)) eed->sharp = 1; - eed = eed->next; - } - } else { - eed= em->edges.first; - while(eed) { - if(!eed->h && (eed->f & SELECT)) eed->sharp = 0; - eed = eed->next; - } - } - - allqueue(REDRAWVIEW3D, 0); -} - -void BME_Menu() { - short ret; - ret= pupmenu("BME modeller%t|Select Edges of Vert%x1"); - - switch(ret) - { - case 1: - //BME_edges_of_vert(); - break; - } -} - - - -void Vertex_Menu() { - short ret; - ret= pupmenu("Vertex Specials%t|Remove Doubles%x1|Merge%x2|Smooth %x3|Select Vertex Path%x4|Blend From Shape%x5|Propagate To All Shapes%x6"); - - switch(ret) - { - case 1: - notice("Removed %d Vertices", removedoublesflag(1, 0, G.scene->toolsettings->doublimit)); - BIF_undo_push("Remove Doubles"); - break; - case 2: - mergemenu(); - break; - case 3: - vertexsmooth(); - break; - case 4: - pathselect(); - BIF_undo_push("Select Vertex Path"); - break; - case 5: - shape_copy_select_from(); - break; - case 6: - shape_propagate(); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - - -void Edge_Menu() { - short ret; - - ret= pupmenu("Edge Specials%t|Mark Seam %x1|Clear Seam %x2|Rotate Edge CW%x3|Rotate Edge CCW%x4|Loopcut%x6|Edge Slide%x5|Edge Loop Select%x7|Edge Ring Select%x8|Loop to Region%x9|Region to Loop%x10|Mark Sharp%x11|Clear Sharp%x12"); - - switch(ret) - { - case 1: - editmesh_mark_seam(0); - break; - case 2: - editmesh_mark_seam(1); - break; - case 3: - edge_rotate_selected(2); - break; - case 4: - edge_rotate_selected(1); - break; - case 5: - EdgeSlide(0,0.0); - BIF_undo_push("EdgeSlide"); - break; - case 6: - CutEdgeloop(1); - BIF_undo_push("Loopcut New"); - break; - case 7: - loop_multiselect(0); - break; - case 8: - loop_multiselect(1); - break; - case 9: - loop_to_region(); - break; - case 10: - region_to_loop(); - break; - case 11: - editmesh_mark_sharp(1); - BIF_undo_push("Mark Sharp"); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 12: - editmesh_mark_sharp(0); - BIF_undo_push("Clear Sharp"); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - -void Face_Menu() { - short ret; - ret= pupmenu( - "Face Specials%t|Flip Normals%x1|Bevel%x2|Shade Smooth%x3|Shade Flat%x4|" - "Triangulate (Ctrl T)%x5|Quads from Triangles (Alt J)%x6|Flip Triangle Edges (Ctrl Shift F)%x7|%l|" - "Face Mode Set%x8|Face Mode Clear%x9|%l|" - "UV Rotate (Shift - CCW)%x10|UV Mirror (Shift - Switch Axis)%x11|" - "Color Rotate (Shift - CCW)%x12|Color Mirror (Shift - Switch Axis)%x13"); - - switch(ret) - { - case 1: - flip_editnormals(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Flip Normals"); - allqueue(REDRAWVIEW3D, 0); - break; - case 2: - bevel_menu(); - break; - case 3: - mesh_set_smooth_faces(1); - break; - case 4: - mesh_set_smooth_faces(0); - break; - - case 5: /* Quads to Tris */ - convert_to_triface(0); - allqueue(REDRAWVIEW3D, 0); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 6: /* Tris to Quads */ - join_triangles(); - break; - case 7: /* Flip triangle edges */ - edge_flip(); - break; - case 8: - mesh_set_face_flags(1); - break; - case 9: - mesh_set_face_flags(0); - break; - - /* uv texface options */ - case 10: - mesh_rotate_uvs(); - break; - case 11: - mesh_mirror_uvs(); - break; - case 12: - mesh_rotate_colors(); - break; - case 13: - mesh_mirror_colors(); - break; - } - /* some items crashed because this is in the original W menu but not here. should really manage this better */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - - -/* **************** NORMALS ************** */ - -void righthandfaces(int select) /* makes faces righthand turning */ -{ - EditMesh *em = G.editMesh; - EditEdge *eed, *ed1, *ed2, *ed3, *ed4; - EditFace *efa, *startvl; - float maxx, nor[3], cent[3]; - int totsel, found, foundone, direct, turn, tria_nr; - - /* based at a select-connected to witness loose objects */ - - /* count per edge the amount of faces */ - - /* find the ultimate left, front, upper face (not manhattan dist!!) */ - /* also evaluate both triangle cases in quad, since these can be non-flat */ - - /* put normal to the outside, and set the first direction flags in edges */ - - /* then check the object, and set directions / direction-flags: but only for edges with 1 or 2 faces */ - /* this is in fact the 'select connected' */ - - /* in case (selected) faces were not done: start over with 'find the ultimate ...' */ - - waitcursor(1); - - eed= em->edges.first; - while(eed) { - eed->f2= 0; /* edge direction */ - eed->f1= 0; /* counter */ - eed= eed->next; - } - - /* count faces and edges */ - totsel= 0; - efa= em->faces.first; - while(efa) { - if(select==0 || (efa->f & SELECT) ) { - efa->f1= 1; - totsel++; - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->v4) efa->e4->f1++; - } - else efa->f1= 0; - - efa= efa->next; - } - - while(totsel>0) { - /* from the outside to the inside */ - - efa= em->faces.first; - startvl= NULL; - maxx= -1.0e10; - tria_nr= 0; - - while(efa) { - if(efa->f1) { - CalcCent3f(cent, efa->v1->co, efa->v2->co, efa->v3->co); - cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2]; - - if(cent[0]>maxx) { - maxx= cent[0]; - startvl= efa; - tria_nr= 0; - } - if(efa->v4) { - CalcCent3f(cent, efa->v1->co, efa->v3->co, efa->v4->co); - cent[0]= cent[0]*cent[0] + cent[1]*cent[1] + cent[2]*cent[2]; - - if(cent[0]>maxx) { - maxx= cent[0]; - startvl= efa; - tria_nr= 1; - } - } - } - efa= efa->next; - } - - if (startvl==NULL) - startvl= em->faces.first; - - /* set first face correct: calc normal */ - - if(tria_nr==1) { - CalcNormFloat(startvl->v1->co, startvl->v3->co, startvl->v4->co, nor); - CalcCent3f(cent, startvl->v1->co, startvl->v3->co, startvl->v4->co); - } else { - CalcNormFloat(startvl->v1->co, startvl->v2->co, startvl->v3->co, nor); - CalcCent3f(cent, startvl->v1->co, startvl->v2->co, startvl->v3->co); - } - /* first normal is oriented this way or the other */ - if(select) { - if(select==2) { - if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] > 0.0) flipface(startvl); - } - else { - if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl); - } - } - else if(cent[0]*nor[0]+cent[1]*nor[1]+cent[2]*nor[2] < 0.0) flipface(startvl); - - - eed= startvl->e1; - if(eed->v1==startvl->v1) eed->f2= 1; - else eed->f2= 2; - - eed= startvl->e2; - if(eed->v1==startvl->v2) eed->f2= 1; - else eed->f2= 2; - - eed= startvl->e3; - if(eed->v1==startvl->v3) eed->f2= 1; - else eed->f2= 2; - - eed= startvl->e4; - if(eed) { - if(eed->v1==startvl->v4) eed->f2= 1; - else eed->f2= 2; - } - - startvl->f1= 0; - totsel--; - - /* test normals */ - found= 1; - direct= 1; - while(found) { - found= 0; - if(direct) efa= em->faces.first; - else efa= em->faces.last; - while(efa) { - if(efa->f1) { - turn= 0; - foundone= 0; - - ed1= efa->e1; - ed2= efa->e2; - ed3= efa->e3; - ed4= efa->e4; - - if(ed1->f2) { - if(ed1->v1==efa->v1 && ed1->f2==1) turn= 1; - if(ed1->v2==efa->v1 && ed1->f2==2) turn= 1; - foundone= 1; - } - else if(ed2->f2) { - if(ed2->v1==efa->v2 && ed2->f2==1) turn= 1; - if(ed2->v2==efa->v2 && ed2->f2==2) turn= 1; - foundone= 1; - } - else if(ed3->f2) { - if(ed3->v1==efa->v3 && ed3->f2==1) turn= 1; - if(ed3->v2==efa->v3 && ed3->f2==2) turn= 1; - foundone= 1; - } - else if(ed4 && ed4->f2) { - if(ed4->v1==efa->v4 && ed4->f2==1) turn= 1; - if(ed4->v2==efa->v4 && ed4->f2==2) turn= 1; - foundone= 1; - } - - if(foundone) { - found= 1; - totsel--; - efa->f1= 0; - - if(turn) { - if(ed1->v1==efa->v1) ed1->f2= 2; - else ed1->f2= 1; - if(ed2->v1==efa->v2) ed2->f2= 2; - else ed2->f2= 1; - if(ed3->v1==efa->v3) ed3->f2= 2; - else ed3->f2= 1; - if(ed4) { - if(ed4->v1==efa->v4) ed4->f2= 2; - else ed4->f2= 1; - } - - flipface(efa); - - } - else { - if(ed1->v1== efa->v1) ed1->f2= 1; - else ed1->f2= 2; - if(ed2->v1==efa->v2) ed2->f2= 1; - else ed2->f2= 2; - if(ed3->v1==efa->v3) ed3->f2= 1; - else ed3->f2= 2; - if(ed4) { - if(ed4->v1==efa->v4) ed4->f2= 1; - else ed4->f2= 2; - } - } - } - } - if(direct) efa= efa->next; - else efa= efa->prev; - } - direct= 1-direct; - } - } - - recalc_editnormals(); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - waitcursor(0); -} - - -/* ********** ALIGN WITH VIEW **************** */ - - -static void editmesh_calc_selvert_center(float cent_r[3]) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - int nsel= 0; - - cent_r[0]= cent_r[1]= cent_r[0]= 0.0; - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - cent_r[0]+= eve->co[0]; - cent_r[1]+= eve->co[1]; - cent_r[2]+= eve->co[2]; - nsel++; - } - } - - if (nsel) { - cent_r[0]/= nsel; - cent_r[1]/= nsel; - cent_r[2]/= nsel; - } -} - -static int mface_is_selected(MFace *mf) -{ - return (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL)); -} - - /* XXX, code for both these functions should be abstract, - * then unified, then written for other things (like objects, - * which would use same as vertices method), then added - * to interface! Hoera! - zr - */ -void faceselect_align_view_to_selected(View3D *v3d, Mesh *me, int axis) -{ - float norm[3]; - int i, totselected = 0; - - norm[0]= norm[1]= norm[2]= 0.0; - for (i=0; itotface; i++) { - MFace *mf= ((MFace*) me->mface) + i; - - if (mface_is_selected(mf)) { - float *v1, *v2, *v3, fno[3]; - - v1= me->mvert[mf->v1].co; - v2= me->mvert[mf->v2].co; - v3= me->mvert[mf->v3].co; - if (mf->v4) { - float *v4= me->mvert[mf->v4].co; - CalcNormFloat4(v1, v2, v3, v4, fno); - } else { - CalcNormFloat(v1, v2, v3, fno); - } - - norm[0]+= fno[0]; - norm[1]+= fno[1]; - norm[2]+= fno[2]; - - totselected++; - } - } - - if (totselected == 0) - error("No faces selected."); - else - view3d_align_axis_to_vector(v3d, axis, norm); -} - -/* helper for below, to survive non-uniform scaled objects */ -static void face_getnormal_obspace(EditFace *efa, float *fno) -{ - float vec[4][3]; - - VECCOPY(vec[0], efa->v1->co); - Mat4Mul3Vecfl(G.obedit->obmat, vec[0]); - VECCOPY(vec[1], efa->v2->co); - Mat4Mul3Vecfl(G.obedit->obmat, vec[1]); - VECCOPY(vec[2], efa->v3->co); - Mat4Mul3Vecfl(G.obedit->obmat, vec[2]); - if(efa->v4) { - VECCOPY(vec[3], efa->v4->co); - Mat4Mul3Vecfl(G.obedit->obmat, vec[3]); - - CalcNormFloat4(vec[0], vec[1], vec[2], vec[3], fno); - } - else CalcNormFloat(vec[0], vec[1], vec[2], fno); -} - - -void editmesh_align_view_to_selected(View3D *v3d, int axis) -{ - EditMesh *em = G.editMesh; - int nselverts= EM_nvertices_selected(); - float norm[3]={0.0, 0.0, 0.0}; /* used for storing the mesh normal */ - - if (nselverts==0) { - error("No faces or vertices selected."); - } - else if (EM_nfaces_selected()) { - EditFace *efa; - for (efa= em->faces.first; efa; efa= efa->next) { - if (faceselectedAND(efa, SELECT)) { - float fno[3]; - - face_getnormal_obspace(efa, fno); - norm[0]+= fno[0]; - norm[1]+= fno[1]; - norm[2]+= fno[2]; - } - } - - view3d_align_axis_to_vector(v3d, axis, norm); - } - else if (nselverts>2) { - float cent[3]; - EditVert *eve, *leve= NULL; - - editmesh_calc_selvert_center(cent); - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - if (leve) { - float tno[3]; - CalcNormFloat(cent, leve->co, eve->co, tno); - - /* XXX, fixme, should be flipped intp a - * consistent direction. -zr - */ - norm[0]+= tno[0]; - norm[1]+= tno[1]; - norm[2]+= tno[2]; - } - leve= eve; - } - } - - Mat4Mul3Vecfl(G.obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, axis, norm); - } - else if (nselverts==2) { /* Align view to edge (or 2 verts) */ - EditVert *eve, *leve= NULL; - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - if (leve) { - norm[0]= leve->co[0] - eve->co[0]; - norm[1]= leve->co[1] - eve->co[1]; - norm[2]= leve->co[2] - eve->co[2]; - break; /* we know there are only 2 verts so no need to keep looking */ - } - leve= eve; - } - } - Mat4Mul3Vecfl(G.obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, axis, norm); - } - else if (nselverts==1) { /* Align view to vert normal */ - EditVert *eve; - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - norm[0]= eve->no[0]; - norm[1]= eve->no[1]; - norm[2]= eve->no[2]; - break; /* we know this is the only selected vert, so no need to keep looking */ - } - } - Mat4Mul3Vecfl(G.obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, axis, norm); - } -} - -/* **************** VERTEX DEFORMS *************** */ - -void vertexsmooth(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - float *adror, *adr, fac; - float fvec[3]; - int teller=0; - ModifierData *md= G.obedit->modifiers.first; - - if(G.obedit==0) return; - - /* count */ - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) teller++; - eve= eve->next; - } - if(teller==0) return; - - adr=adror= (float *)MEM_callocN(3*sizeof(float *)*teller, "vertsmooth"); - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - eve->tmp.p = (void*)adr; - eve->f1= 0; - eve->f2= 0; - adr+= 3; - } - eve= eve->next; - } - - /* if there is a mirror modifier with clipping, flag the verts that - * are within tolerance of the plane(s) of reflection - */ - for (; md; md=md->next) { - if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - - if(mmd->flag & MOD_MIR_CLIPPING) { - for (eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - - switch(mmd->axis){ - case 0: - if (fabs(eve->co[0]) < mmd->tolerance) - eve->f2 |= 1; - break; - case 1: - if (fabs(eve->co[1]) < mmd->tolerance) - eve->f2 |= 2; - break; - case 2: - if (fabs(eve->co[2]) < mmd->tolerance) - eve->f2 |= 4; - break; - } - } - } - } - } - } - - eed= em->edges.first; - while(eed) { - if( (eed->v1->f & SELECT) || (eed->v2->f & SELECT) ) { - fvec[0]= (eed->v1->co[0]+eed->v2->co[0])/2.0; - fvec[1]= (eed->v1->co[1]+eed->v2->co[1])/2.0; - fvec[2]= (eed->v1->co[2]+eed->v2->co[2])/2.0; - - if((eed->v1->f & SELECT) && eed->v1->f1<255) { - eed->v1->f1++; - VecAddf(eed->v1->tmp.p, eed->v1->tmp.p, fvec); - } - if((eed->v2->f & SELECT) && eed->v2->f1<255) { - eed->v2->f1++; - VecAddf(eed->v2->tmp.p, eed->v2->tmp.p, fvec); - } - } - eed= eed->next; - } - - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - if(eve->f1) { - adr = eve->tmp.p; - fac= 0.5/(float)eve->f1; - - eve->co[0]= 0.5*eve->co[0]+fac*adr[0]; - eve->co[1]= 0.5*eve->co[1]+fac*adr[1]; - eve->co[2]= 0.5*eve->co[2]+fac*adr[2]; - - /* clip if needed by mirror modifier */ - if (eve->f2) { - if (eve->f2 & 1) { - eve->co[0]= 0.0f; - } - if (eve->f2 & 2) { - eve->co[1]= 0.0f; - } - if (eve->f2 & 4) { - eve->co[2]= 0.0f; - } - } - } - eve->tmp.p= NULL; - } - eve= eve->next; - } - MEM_freeN(adror); - - recalc_editnormals(); - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_verseverts_with_editverts(G.editMesh->vnode); -#endif - BIF_undo_push("Vertex Smooth"); -} - -void vertexnoise(void) -{ - EditMesh *em = G.editMesh; - Material *ma; - Tex *tex; - EditVert *eve; - float b2, ofs, vec[3]; - - if(G.obedit==0) return; - - ma= give_current_material(G.obedit, G.obedit->actcol); - if(ma==0 || ma->mtex[0]==0 || ma->mtex[0]->tex==0) { - return; - } - tex= ma->mtex[0]->tex; - - ofs= tex->turbul/200.0; - - eve= (struct EditVert *)em->verts.first; - while(eve) { - if(eve->f & SELECT) { - - if(tex->type==TEX_STUCCI) { - - b2= BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]); - if(tex->stype) ofs*=(b2*b2); - vec[0]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0]+ofs, eve->co[1], eve->co[2])); - vec[1]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1]+ofs, eve->co[2])); - vec[2]= 0.2*(b2-BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]+ofs)); - - VecAddf(eve->co, eve->co, vec); - } - else { - float tin, dum; - externtex(ma->mtex[0], eve->co, &tin, &dum, &dum, &dum, &dum); - eve->co[2]+= 0.05*tin; - } - } - eve= eve->next; - } - - recalc_editnormals(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_verseverts_with_editverts(G.editMesh->vnode); -#endif - BIF_undo_push("Vertex Noise"); -} - -void vertices_to_sphere(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - Object *ob= OBACT; - float *curs, len, vec[3], cent[3], fac, facm, imat[3][3], bmat[3][3]; - int tot; - short perc=100; - - if(ob==0) return; - TEST_EDITMESH - - if(button(&perc, 1, 100, "Percentage:")==0) return; - - fac= perc/100.0; - facm= 1.0-fac; - - Mat3CpyMat4(bmat, ob->obmat); - Mat3Inv(imat, bmat); - - /* center */ - curs= give_cursor(); - cent[0]= curs[0]-ob->obmat[3][0]; - cent[1]= curs[1]-ob->obmat[3][1]; - cent[2]= curs[2]-ob->obmat[3][2]; - Mat3MulVecfl(imat, cent); - - len= 0.0; - tot= 0; - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - tot++; - len+= VecLenf(cent, eve->co); - } - eve= eve->next; - } - len/=tot; - - if(len==0.0) len= 10.0; - - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - vec[0]= eve->co[0]-cent[0]; - vec[1]= eve->co[1]-cent[1]; - vec[2]= eve->co[2]-cent[2]; - - Normalize(vec); - - eve->co[0]= fac*(cent[0]+vec[0]*len) + facm*eve->co[0]; - eve->co[1]= fac*(cent[1]+vec[1]*len) + facm*eve->co[1]; - eve->co[2]= fac*(cent[2]+vec[2]*len) + facm*eve->co[2]; - - } - eve= eve->next; - } - - recalc_editnormals(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_verseverts_with_editverts(G.editMesh->vnode); -#endif - BIF_undo_push("To Sphere"); -} - diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c deleted file mode 100644 index 1992ea8468a..00000000000 --- a/source/blender/src/editmesh_tools.c +++ /dev/null @@ -1,6800 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Johnny Matthews, Geoffrey Bantle. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - -editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise in mods.c - -*/ - -#include -#include -#include - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" -#include "DNA_mesh_types.h" -#include "DNA_material_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_view3d_types.h" -#include "DNA_key_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_rand.h" -#include "BLI_ghash.h" -#include "BLI_linklist.h" -#include "BLI_heap.h" - -#include "BKE_depsgraph.h" -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_mesh.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_cursors.h" -#include "BIF_editmesh.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_resources.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" - -#include "BSE_view.h" -#include "BSE_edit.h" - -#include "blendef.h" -#include "multires.h" -#include "mydevice.h" - -#include "editmesh.h" - -#include "MTC_vectorops.h" - -#include "PIL_time.h" - -/* local prototypes ---------------*/ -void bevel_menu(void); -static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa); - -/********* qsort routines *********/ - - -typedef struct xvertsort { - float x; - EditVert *v1; -} xvertsort; - -static int vergxco(const void *v1, const void *v2) -{ - const xvertsort *x1=v1, *x2=v2; - - if( x1->x > x2->x ) return 1; - else if( x1->x < x2->x) return -1; - return 0; -} - -struct facesort { - unsigned long x; - struct EditFace *efa; -}; - - -static int vergface(const void *v1, const void *v2) -{ - const struct facesort *x1=v1, *x2=v2; - - if( x1->x > x2->x ) return 1; - else if( x1->x < x2->x) return -1; - return 0; -} - - -/* *********************************** */ - -void convert_to_triface(int direction) -{ - EditMesh *em = G.editMesh; - EditFace *efa, *efan, *next; - float fac; - - if(multires_test()) return; - - efa= em->faces.last; - while(efa) { - next= efa->prev; - if(efa->v4) { - if(efa->f & SELECT) { - /* choose shortest diagonal for split */ - fac= VecLenf(efa->v1->co, efa->v3->co) - VecLenf(efa->v2->co, efa->v4->co); - /* this makes sure exact squares get split different in both cases */ - if( (direction==0 && fac0.0f) ) { - efan= EM_face_from_faces(efa, NULL, 0, 1, 2, -1); - if(efa->f & SELECT) EM_select_face(efan, 1); - efan= EM_face_from_faces(efa, NULL, 0, 2, 3, -1); - if(efa->f & SELECT) EM_select_face(efan, 1); - } - else { - efan= EM_face_from_faces(efa, NULL, 0, 1, 3, -1); - if(efa->f & SELECT) EM_select_face(efan, 1); - efan= EM_face_from_faces(efa, NULL, 1, 2, 3, -1); - if(efa->f & SELECT) EM_select_face(efan, 1); - } - - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - } - efa= next; - } - - EM_fgon_flags(); // redo flags and indices for fgons - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - BIF_undo_push("Convert Quads to Triangles"); - -} - -int removedoublesflag(short flag, short automerge, float limit) /* return amount */ -{ - /* - flag - Test with vert->flags - automerge - Alternative operation, merge unselected into selected. - Used for "Auto Weld" mode. warning. - limit - Quick manhattan distance between verts. - */ - - EditMesh *em = G.editMesh; - /* all verts with (flag & 'flag') are being evaluated */ - EditVert *eve, *v1, *nextve; - EditEdge *eed, *e1, *nexted; - EditFace *efa, *nextvl; - xvertsort *sortblock, *sb, *sb1; - struct facesort *vlsortblock, *vsb, *vsb1; - int a, b, test, amount; - - if(multires_test()) return 0; - - - /* flag 128 is cleared, count */ - - /* Normal non weld operation */ - eve= em->verts.first; - amount= 0; - while(eve) { - eve->f &= ~128; - if(eve->h==0 && (automerge || (eve->f & flag))) amount++; - eve= eve->next; - } - if(amount==0) return 0; - - /* allocate memory and qsort */ - sb= sortblock= MEM_mallocN(sizeof(xvertsort)*amount,"sortremovedoub"); - eve= em->verts.first; - while(eve) { - if(eve->h==0 && (automerge || (eve->f & flag))) { - sb->x= eve->co[0]+eve->co[1]+eve->co[2]; - sb->v1= eve; - sb++; - } - eve= eve->next; - } - qsort(sortblock, amount, sizeof(xvertsort), vergxco); - - - /* test for doubles */ - sb= sortblock; - if (automerge) { - for(a=0; av1; - if( (eve->f & 128)==0 ) { - sb1= sb+1; - for(b=a+1; bf & 128)==0; b++, sb1++) { - if(sb1->x - sb->x > limit) break; - - /* when automarge, only allow unselected->selected */ - v1= sb1->v1; - if( (v1->f & 128)==0 ) { - if ((eve->f & flag)==0 && (v1->f & flag)==1) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && - (float)fabs(v1->co[1]-eve->co[1])<=limit && - (float)fabs(v1->co[2]-eve->co[2])<=limit) - { /* unique bit */ - eve->f|= 128; - eve->tmp.v = v1; - } - } else if( (eve->f & flag)==1 && (v1->f & flag)==0 ) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && - (float)fabs(v1->co[1]-eve->co[1])<=limit && - (float)fabs(v1->co[2]-eve->co[2])<=limit) - { /* unique bit */ - v1->f|= 128; - v1->tmp.v = eve; - } - } - } - } - } - } - } else { - for(a=0; av1; - if( (eve->f & 128)==0 ) { - sb1= sb+1; - for(b=a+1; bx - sb->x > limit) break; - v1= sb1->v1; - - /* second test: is vertex allowed */ - if( (v1->f & 128)==0 ) { - if( (float)fabs(v1->co[0]-eve->co[0])<=limit && - (float)fabs(v1->co[1]-eve->co[1])<=limit && - (float)fabs(v1->co[2]-eve->co[2])<=limit) - { - v1->f|= 128; - v1->tmp.v = eve; - } - } - } - } - } - } - MEM_freeN(sortblock); - - if (!automerge) - for(eve = em->verts.first; eve; eve=eve->next) - if((eve->f & flag) && (eve->f & 128)) - EM_data_interp_from_verts(eve, eve->tmp.v, eve->tmp.v, 0.5f); - - /* test edges and insert again */ - eed= em->edges.first; - while(eed) { - eed->f2= 0; - eed= eed->next; - } - eed= em->edges.last; - while(eed) { - nexted= eed->prev; - - if(eed->f2==0) { - if( (eed->v1->f & 128) || (eed->v2->f & 128) ) { - remedge(eed); - - if(eed->v1->f & 128) eed->v1 = eed->v1->tmp.v; - if(eed->v2->f & 128) eed->v2 = eed->v2->tmp.v; - e1= addedgelist(eed->v1, eed->v2, eed); - - if(e1) e1->f2= 1; - if(e1!=eed) free_editedge(eed); - } - } - eed= nexted; - } - - /* first count amount of test faces */ - efa= (struct EditFace *)em->faces.first; - amount= 0; - while(efa) { - efa->f1= 0; - if(efa->v1->f & 128) efa->f1= 1; - else if(efa->v2->f & 128) efa->f1= 1; - else if(efa->v3->f & 128) efa->f1= 1; - else if(efa->v4 && (efa->v4->f & 128)) efa->f1= 1; - - if(efa->f1==1) amount++; - efa= efa->next; - } - - /* test faces for double vertices, and if needed remove them */ - efa= (struct EditFace *)em->faces.first; - while(efa) { - nextvl= efa->next; - if(efa->f1==1) { - - if(efa->v1->f & 128) efa->v1= efa->v1->tmp.v; - if(efa->v2->f & 128) efa->v2= efa->v2->tmp.v; - if(efa->v3->f & 128) efa->v3= efa->v3->tmp.v; - if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->tmp.v; - - test= 0; - if(efa->v1==efa->v2) test+=1; - if(efa->v2==efa->v3) test+=2; - if(efa->v3==efa->v1) test+=4; - if(efa->v4==efa->v1) test+=8; - if(efa->v3==efa->v4) test+=16; - if(efa->v2==efa->v4) test+=32; - - if(test) { - if(efa->v4) { - if(test==1 || test==2) { - efa->v2= efa->v3; - efa->v3= efa->v4; - efa->v4= 0; - - EM_data_interp_from_faces(efa, NULL, efa, 0, 2, 3, 3); - - test= 0; - } - else if(test==8 || test==16) { - efa->v4= 0; - test= 0; - } - else { - BLI_remlink(&em->faces, efa); - free_editface(efa); - amount--; - } - } - else { - BLI_remlink(&em->faces, efa); - free_editface(efa); - amount--; - } - } - - if(test==0) { - /* set edge pointers */ - efa->e1= findedgelist(efa->v1, efa->v2); - efa->e2= findedgelist(efa->v2, efa->v3); - if(efa->v4==0) { - efa->e3= findedgelist(efa->v3, efa->v1); - efa->e4= 0; - } - else { - efa->e3= findedgelist(efa->v3, efa->v4); - efa->e4= findedgelist(efa->v4, efa->v1); - } - } - } - efa= nextvl; - } - - /* double faces: sort block */ - /* count again, now all selected faces */ - amount= 0; - efa= em->faces.first; - while(efa) { - efa->f1= 0; - if(faceselectedOR(efa, 1)) { - efa->f1= 1; - amount++; - } - efa= efa->next; - } - - if(amount) { - /* double faces: sort block */ - vsb= vlsortblock= MEM_mallocN(sizeof(struct facesort)*amount, "sortremovedoub"); - efa= em->faces.first; - while(efa) { - if(efa->f1 & 1) { - if(efa->v4) vsb->x= (unsigned long) MIN4( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3, (unsigned long)efa->v4); - else vsb->x= (unsigned long) MIN3( (unsigned long)efa->v1, (unsigned long)efa->v2, (unsigned long)efa->v3); - - vsb->efa= efa; - vsb++; - } - efa= efa->next; - } - - qsort(vlsortblock, amount, sizeof(struct facesort), vergface); - - vsb= vlsortblock; - for(a=0; aefa; - if( (efa->f1 & 128)==0 ) { - vsb1= vsb+1; - - for(b=a+1; bx != vsb1->x) break; - - /* second test: is test permitted? */ - efa= vsb1->efa; - if( (efa->f1 & 128)==0 ) { - if( compareface(efa, vsb->efa)) efa->f1 |= 128; - - } - vsb1++; - } - } - vsb++; - } - - MEM_freeN(vlsortblock); - - /* remove double faces */ - efa= (struct EditFace *)em->faces.first; - while(efa) { - nextvl= efa->next; - if(efa->f1 & 128) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - } - - /* remove double vertices */ - a= 0; - eve= (struct EditVert *)em->verts.first; - while(eve) { - nextve= eve->next; - if(automerge || eve->f & flag) { - if(eve->f & 128) { - a++; - BLI_remlink(&em->verts, eve); - free_editvert(eve); - } - } - eve= nextve; - } - -#ifdef WITH_VERSE - if((a>0) && (G.editMesh->vnode)) { - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); - } -#endif - - return a; /* amount */ -} - -/* called from buttons */ -static void xsortvert_flag__doSetX(void *userData, EditVert *eve, int x, int y, int index) -{ - xvertsort *sortblock = userData; - - sortblock[index].x = x; -} -void xsortvert_flag(int flag) -{ - EditMesh *em = G.editMesh; - /* all verts with (flag & 'flag') are sorted */ - EditVert *eve; - xvertsort *sortblock; - ListBase tbase; - int i, amount = BLI_countlist(&em->verts); - - if(multires_test()) return; - - sortblock = MEM_callocN(sizeof(xvertsort)*amount,"xsort"); - for (i=0,eve=em->verts.first; eve; i++,eve=eve->next) - if(eve->f & flag) - sortblock[i].v1 = eve; - mesh_foreachScreenVert(xsortvert_flag__doSetX, sortblock, 0); - qsort(sortblock, amount, sizeof(xvertsort), vergxco); - - /* make temporal listbase */ - tbase.first= tbase.last= 0; - for (i=0; iverts, eve); - BLI_addtail(&tbase, eve); - } - } - - addlisttolist(&em->verts, &tbase); - - MEM_freeN(sortblock); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - BIF_undo_push("Xsort"); - -} - -/* called from buttons */ -void hashvert_flag(int flag) -{ - /* switch vertex order using hash table */ - EditMesh *em = G.editMesh; - EditVert *eve; - struct xvertsort *sortblock, *sb, onth, *newsort; - ListBase tbase; - int amount, a, b; - - if(multires_test()) return; - - /* count */ - eve= em->verts.first; - amount= 0; - while(eve) { - if(eve->f & flag) amount++; - eve= eve->next; - } - if(amount==0) return; - - /* allocate memory */ - sb= sortblock= (struct xvertsort *)MEM_mallocN(sizeof(struct xvertsort)*amount,"sortremovedoub"); - eve= em->verts.first; - while(eve) { - if(eve->f & flag) { - sb->v1= eve; - sb++; - } - eve= eve->next; - } - - BLI_srand(1); - - sb= sortblock; - for(a=0; a=0 && bv1; - BLI_remlink(&em->verts, eve); - BLI_addtail(&tbase, eve); - sb++; - } - - addlisttolist(&em->verts, &tbase); - - MEM_freeN(sortblock); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - BIF_undo_push("Hash"); - -} - -/* generic extern called extruder */ -void extrude_mesh(void) -{ - float nor[3]= {0.0, 0.0, 0.0}; - short nr, transmode= 0; - - TEST_EDITMESH - if(multires_test()) return; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if(G.totvertsel==0) nr= 0; - else if(G.totvertsel==1) nr= 4; - else if(G.totedgesel==0) nr= 4; - else if(G.totfacesel==0) - nr= pupmenu("Extrude %t|Only Edges%x3|Only Vertices%x4"); - else if(G.totfacesel==1) - nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3|Only Vertices%x4"); - else - nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3|Only Vertices%x4"); - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - if (G.totedgesel==0) nr = 0; - else if (G.totedgesel==1) nr = 3; - else if(G.totfacesel==0) nr = 3; - else if(G.totfacesel==1) - nr= pupmenu("Extrude %t|Region %x1|Only Edges%x3"); - else - nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2|Only Edges%x3"); - } - else { - if (G.totfacesel == 0) nr = 0; - else if (G.totfacesel == 1) nr = 1; - else - nr= pupmenu("Extrude %t|Region %x1||Individual Faces %x2"); - } - - if(nr<1) return; - - if(nr==1) transmode= extrudeflag(SELECT, nor); - else if(nr==4) transmode= extrudeflag_verts_indiv(SELECT, nor); - else if(nr==3) transmode= extrudeflag_edges_indiv(SELECT, nor); - else transmode= extrudeflag_face_indiv(SELECT, nor); - - if(transmode==0) { - error("No valid selection"); - } - else { - EM_fgon_flags(); - countall(); - - /* We need to force immediate calculation here because - * transform may use derived objects (which are now stale). - * - * This shouldn't be necessary, derived queries should be - * automatically building this data if invalid. Or something. - */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - object_handle_update(G.obedit); - - /* individual faces? */ - BIF_TransformSetUndo("Extrude"); - if(nr==2) { - initTransform(TFM_SHRINKFATTEN, CTX_NO_PET|CTX_NO_MIRROR); - Transform(); - } - else { - initTransform(TFM_TRANSLATION, CTX_NO_PET|CTX_NO_MIRROR); - if(transmode=='n') { - Mat4MulVecfl(G.obedit->obmat, nor); - VecSubf(nor, nor, G.obedit->obmat[3]); - BIF_setSingleAxisConstraint(nor, "along normal"); - } - Transform(); - } - } - -} - -void split_mesh(void) -{ - - TEST_EDITMESH - if(multires_test()) return; - - if(okee(" Split ")==0) return; - - waitcursor(1); - - /* make duplicate first */ - adduplicateflag(SELECT); - /* old faces have flag 128 set, delete them */ - delfaceflag(128); - recalc_editnormals(); - - waitcursor(0); - - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - BIF_undo_push("Split"); - -} - -void extrude_repeat_mesh(int steps, float offs) -{ - float dvec[3], tmat[3][3], bmat[3][3], nor[3]= {0.0, 0.0, 0.0}; - short a; - - TEST_EDITMESH - if(multires_test()) return; - - /* dvec */ - dvec[0]= G.vd->persinv[2][0]; - dvec[1]= G.vd->persinv[2][1]; - dvec[2]= G.vd->persinv[2][2]; - Normalize(dvec); - dvec[0]*= offs; - dvec[1]*= offs; - dvec[2]*= offs; - - /* base correction */ - Mat3CpyMat4(bmat, G.obedit->obmat); - Mat3Inv(tmat, bmat); - Mat3MulVecfl(tmat, dvec); - - for(a=0; aobmat); - Mat3Inv(imat,bmat); - - curs= give_cursor(); - VECCOPY(cent, curs); - cent[0]-= G.obedit->obmat[3][0]; - cent[1]-= G.obedit->obmat[3][1]; - cent[2]-= G.obedit->obmat[3][2]; - Mat3MulVecfl(imat, cent); - - phi= degr*M_PI/360.0; - phi/= steps; - if(G.scene->toolsettings->editbutflag & B_CLOCKWISE) phi= -phi; - - if(dvec) { - n[0]= G.vd->viewinv[1][0]; - n[1]= G.vd->viewinv[1][1]; - n[2]= G.vd->viewinv[1][2]; - } else { - n[0]= G.vd->viewinv[2][0]; - n[1]= G.vd->viewinv[2][1]; - n[2]= G.vd->viewinv[2][2]; - } - Normalize(n); - - q[0]= (float)cos(phi); - si= (float)sin(phi); - q[1]= n[0]*si; - q[2]= n[1]*si; - q[3]= n[2]*si; - QuatToMat3(q, cmat); - - Mat3MulMat3(tmat,cmat,bmat); - Mat3MulMat3(bmat,imat,tmat); - - if(mode==0) if(G.scene->toolsettings->editbutflag & B_KEEPORIG) adduplicateflag(1); - ok= 1; - - for(a=0;averts.first; - while(eve) { - nextve= eve->next; - if(eve->f & SELECT) { - BLI_remlink(&em->verts,eve); - free_editvert(eve); - } - eve= nextve; - } - } - recalc_editnormals(); - - EM_fgon_flags(); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - - if(dvec==NULL) BIF_undo_push("Spin"); -} - -void screw_mesh(int steps, int turns) -{ - EditMesh *em = G.editMesh; - EditVert *eve,*v1=0,*v2=0; - EditEdge *eed; - float dvec[3], nor[3]; - - TEST_EDITMESH - if(multires_test()) return; - - /* clear flags */ - eve= em->verts.first; - while(eve) { - eve->f1= 0; - eve= eve->next; - } - /* edges set flags in verts */ - eed= em->edges.first; - while(eed) { - if(eed->v1->f & SELECT) { - if(eed->v2->f & SELECT) { - /* watch: f1 is a byte */ - if(eed->v1->f1<2) eed->v1->f1++; - if(eed->v2->f1<2) eed->v2->f1++; - } - } - eed= eed->next; - } - /* find two vertices with eve->f1==1, more or less is wrong */ - eve= em->verts.first; - while(eve) { - if(eve->f1==1) { - if(v1==0) v1= eve; - else if(v2==0) v2= eve; - else { - v1=0; - break; - } - } - eve= eve->next; - } - if(v1==0 || v2==0) { - error("You have to select a string of connected vertices too"); - return; - } - - /* calculate dvec */ - dvec[0]= ( (v1->co[0]- v2->co[0]) )/(steps); - dvec[1]= ( (v1->co[1]- v2->co[1]) )/(steps); - dvec[2]= ( (v1->co[2]- v2->co[2]) )/(steps); - - VECCOPY(nor, G.obedit->obmat[2]); - - if(nor[0]*dvec[0]+nor[1]*dvec[1]+nor[2]*dvec[2]>0.000) { - dvec[0]= -dvec[0]; - dvec[1]= -dvec[1]; - dvec[2]= -dvec[2]; - } - - spin_mesh(turns*steps, turns*360, dvec, 0); - - BIF_undo_push("Spin"); -} - - -static void erase_edges(ListBase *l) -{ - EditEdge *ed, *nexted; - - ed = (EditEdge *) l->first; - while(ed) { - nexted= ed->next; - if( (ed->v1->f & SELECT) || (ed->v2->f & SELECT) ) { - remedge(ed); - free_editedge(ed); - } - ed= nexted; - } -} - -static void erase_faces(ListBase *l) -{ - EditFace *f, *nextf; - - f = (EditFace *) l->first; - - while(f) { - nextf= f->next; - if( faceselectedOR(f, SELECT) ) { - BLI_remlink(l, f); - free_editface(f); - } - f = nextf; - } -} - -static void erase_vertices(ListBase *l) -{ - EditVert *v, *nextv; - - v = (EditVert *) l->first; - while(v) { - nextv= v->next; - if(v->f & 1) { - BLI_remlink(l, v); - free_editvert(v); - } - v = nextv; - } -} - -void delete_mesh(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa, *nextvl; - EditVert *eve,*nextve; - EditEdge *eed,*nexted; - short event; - int count; - char *str="Erase"; - - TEST_EDITMESH - if(multires_test()) return; - - event= pupmenu("Erase %t|Vertices%x10|Edges%x1|Faces%x2|All%x3|Edges & Faces%x4|Only Faces%x5|Edge Loop%x6"); - if(event<1) return; - - if(event==10 ) { - str= "Erase Vertices"; - erase_edges(&em->edges); - erase_faces(&em->faces); - erase_vertices(&em->verts); - } - else if(event==6) { - if(!EdgeLoopDelete()) { - BIF_undo(); - } - } - else if(event==4) { - str= "Erase Edges & Faces"; - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - /* delete only faces with 1 or more edges selected */ - count= 0; - if(efa->e1->f & SELECT) count++; - if(efa->e2->f & SELECT) count++; - if(efa->e3->f & SELECT) count++; - if(efa->e4 && (efa->e4->f & SELECT)) count++; - if(count) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - eed= em->edges.first; - while(eed) { - nexted= eed->next; - if(eed->f & SELECT) { - remedge(eed); - free_editedge(eed); - } - eed= nexted; - } - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - event=0; - if( efa->v1->f & SELECT) event++; - if( efa->v2->f & SELECT) event++; - if( efa->v3->f & SELECT) event++; - if(efa->v4 && (efa->v4->f & SELECT)) event++; - - if(event>1) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - } - else if(event==1) { - str= "Erase Edges"; - // faces first - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - event=0; - if( efa->e1->f & SELECT) event++; - if( efa->e2->f & SELECT) event++; - if( efa->e3->f & SELECT) event++; - if(efa->e4 && (efa->e4->f & SELECT)) event++; - - if(event) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - eed= em->edges.first; - while(eed) { - nexted= eed->next; - if(eed->f & SELECT) { - remedge(eed); - free_editedge(eed); - } - eed= nexted; - } - /* to remove loose vertices: */ - eed= em->edges.first; - while(eed) { - if( eed->v1->f & SELECT) eed->v1->f-=SELECT; - if( eed->v2->f & SELECT) eed->v2->f-=SELECT; - eed= eed->next; - } - eve= em->verts.first; - while(eve) { - nextve= eve->next; - if(eve->f & SELECT) { - BLI_remlink(&em->verts,eve); - free_editvert(eve); - } - eve= nextve; - } - - } - else if(event==2) { - str="Erase Faces"; - delfaceflag(SELECT); - } - else if(event==3) { - str= "Erase All"; - if(em->verts.first) free_vertlist(&em->verts); - if(em->edges.first) free_edgelist(&em->edges); - if(em->faces.first) free_facelist(&em->faces); - if(em->selected.first) BLI_freelistN(&(em->selected)); - } - else if(event==5) { - str= "Erase Only Faces"; - efa= em->faces.first; - while(efa) { - nextvl= efa->next; - if(efa->f & SELECT) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - efa= nextvl; - } - } - - EM_fgon_flags(); // redo flags and indices for fgons - - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push(str); -} - - -/* Got this from scanfill.c. You will need to juggle around the - * callbacks for the scanfill.c code a bit for this to work. */ -void fill_mesh(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve,*v1; - EditEdge *eed,*e1,*nexted; - EditFace *efa,*nextvl, *efan; - short ok; - - if(G.obedit==0 || (G.obedit->type!=OB_MESH)) return; - if(multires_test()) return; - - waitcursor(1); - - /* copy all selected vertices */ - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) { - v1= BLI_addfillvert(eve->co); - eve->tmp.v= v1; - v1->tmp.v= eve; - v1->xs= 0; // used for counting edges - } - eve= eve->next; - } - /* copy all selected edges */ - eed= em->edges.first; - while(eed) { - if( (eed->v1->f & SELECT) && (eed->v2->f & SELECT) ) { - e1= BLI_addfilledge(eed->v1->tmp.v, eed->v2->tmp.v); - e1->v1->xs++; - e1->v2->xs++; - } - eed= eed->next; - } - /* from all selected faces: remove vertices and edges to prevent doubles */ - /* all edges add values, faces subtract, - then remove edges with vertices ->xs<2 */ - efa= em->faces.first; - ok= 0; - while(efa) { - nextvl= efa->next; - if( faceselectedAND(efa, 1) ) { - efa->v1->tmp.v->xs--; - efa->v2->tmp.v->xs--; - efa->v3->tmp.v->xs--; - if(efa->v4) efa->v4->tmp.v->xs--; - ok= 1; - - } - efa= nextvl; - } - if(ok) { /* there are faces selected */ - eed= filledgebase.first; - while(eed) { - nexted= eed->next; - if(eed->v1->xs<2 || eed->v2->xs<2) { - BLI_remlink(&filledgebase,eed); - } - eed= nexted; - } - } - - if(BLI_edgefill(0, (G.obedit && G.obedit->actcol)?(G.obedit->actcol-1):0)) { - efa= fillfacebase.first; - while(efa) { - /* normals default pointing up */ - efan= addfacelist(efa->v3->tmp.v, efa->v2->tmp.v, - efa->v1->tmp.v, 0, NULL, NULL); - if(efan) EM_select_face(efan, 1); - efa= efa->next; - } - } - - BLI_end_edgefill(); - - waitcursor(0); - EM_select_flush(); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - BIF_undo_push("Fill"); -} -/*GB*/ -/*-------------------------------------------------------------------------------*/ -/*--------------------------- Edge Based Subdivide ------------------------------*/ - -#define EDGENEW 2 -#define FACENEW 2 -#define EDGEINNER 4 -#define EDGEOLD 8 - -/*used by faceloop cut to select only edges valid for edge slide*/ -#define DOUBLEOPFILL 16 - -/* calculates offset for co, based on fractal, sphere or smooth settings */ -static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float perc) -{ - float vec1[3], fac; - - if(beauty & B_SMOOTH) { - /* we calculate an offset vector vec1[], to be added to *co */ - float len, fac, nor[3], nor1[3], nor2[3]; - - VecSubf(nor, edge->v1->co, edge->v2->co); - len= 0.5f*Normalize(nor); - - VECCOPY(nor1, edge->v1->no); - VECCOPY(nor2, edge->v2->no); - - /* cosine angle */ - fac= nor[0]*nor1[0] + nor[1]*nor1[1] + nor[2]*nor1[2] ; - - vec1[0]= fac*nor1[0]; - vec1[1]= fac*nor1[1]; - vec1[2]= fac*nor1[2]; - - /* cosine angle */ - fac= -nor[0]*nor2[0] - nor[1]*nor2[1] - nor[2]*nor2[2] ; - - vec1[0]+= fac*nor2[0]; - vec1[1]+= fac*nor2[1]; - vec1[2]+= fac*nor2[2]; - - vec1[0]*= rad*len; - vec1[1]*= rad*len; - vec1[2]*= rad*len; - - co[0] += vec1[0]; - co[1] += vec1[1]; - co[2] += vec1[2]; - } - else { - if(rad > 0.0) { /* subdivide sphere */ - Normalize(co); - co[0]*= rad; - co[1]*= rad; - co[2]*= rad; - } - else if(rad< 0.0) { /* fractal subdivide */ - fac= rad* VecLenf(edge->v1->co, edge->v2->co); - vec1[0]= fac*(float)(0.5-BLI_drand()); - vec1[1]= fac*(float)(0.5-BLI_drand()); - vec1[2]= fac*(float)(0.5-BLI_drand()); - VecAddf(co, co, vec1); - } - - } -} - -/* assumes in the edge is the correct interpolated vertices already */ -/* percent defines the interpolation, rad and beauty are for special options */ -/* results in new vertex with correct coordinate, vertex normal and weight group info */ -static EditVert *subdivide_edge_addvert(EditEdge *edge, float rad, int beauty, float percent) -{ - EditVert *ev; - float co[3]; - - co[0] = (edge->v2->co[0]-edge->v1->co[0])*percent + edge->v1->co[0]; - co[1] = (edge->v2->co[1]-edge->v1->co[1])*percent + edge->v1->co[1]; - co[2] = (edge->v2->co[2]-edge->v1->co[2])*percent + edge->v1->co[2]; - - /* offset for smooth or sphere or fractal */ - alter_co(co, edge, rad, beauty, percent); - - ev = addvertlist(co, NULL); - - /* vert data (vgroups, ..) */ - EM_data_interp_from_verts(edge->v1, edge->v2, ev, percent); - - /* normal */ - ev->no[0] = (edge->v2->no[0]-edge->v1->no[0])*percent + edge->v1->no[0]; - ev->no[1] = (edge->v2->no[1]-edge->v1->no[1])*percent + edge->v1->no[1]; - ev->no[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2]; - Normalize(ev->no); - - return ev; -} - -static void flipvertarray(EditVert** arr, short size) -{ - EditVert *hold; - int i; - - for(i=0; iv1->co, *v2 = source->v2->co, *v3 = source->v3->co; - float *v4 = source->v4? source->v4->co: NULL; - float w[4][4]; - - CustomData_em_copy_data(&em->fdata, &em->fdata, source->data, &target->data); - - target->mat_nr = source->mat_nr; - target->flag = source->flag; - target->h = source->h; - - InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v1->co, w[0]); - InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v2->co, w[1]); - InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v3->co, w[2]); - if (target->v4) - InterpWeightsQ3Dfl(v1, v2, v3, v4, target->v4->co, w[3]); - - CustomData_em_interp(&em->fdata, &source->data, NULL, (float*)w, 1, target->data); -} - -static void fill_quad_single(EditFace *efa, struct GHash *gh, int numcuts, int seltype) -{ - EditEdge *cedge=NULL; - EditVert *v[4], **verts; - EditFace *hold; - short start=0, end, left, right, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} - else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} - - // Point verts to the array of new verts for cedge - verts = BLI_ghash_lookup(gh, cedge); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);} - end = (start+1)%4; - left = (start+2)%4; - right = (start+3)%4; - - /* - We should have something like this now - - end start - 3 2 1 0 - |---*---*---| - | | - | | - | | - ------------- - left right - - where start,end,left, right are indexes of EditFace->v1, etc (stored in v) - and 0,1,2... are the indexes of the new verts stored in verts - - We will fill this case like this or this depending on even or odd cuts - - |---*---*---| |---*---| - | / \ | | / \ | - | / \ | | / \ | - |/ \| |/ \| - ------------- --------- - */ - - // Make center face - if(vertsize % 2 == 0) { - hold = addfacelist(verts[(vertsize-1)/2],verts[((vertsize-1)/2)+1],v[left],v[right], NULL,NULL); - hold->e2->f2 |= EDGEINNER; - hold->e4->f2 |= EDGEINNER; - }else{ - hold = addfacelist(verts[(vertsize-1)/2],v[left],v[right],NULL, NULL,NULL); - hold->e1->f2 |= EDGEINNER; - hold->e3->f2 |= EDGEINNER; - } - facecopy(efa,hold); - - // Make side faces - for(i=0;i<(vertsize-1)/2;i++) { - hold = addfacelist(verts[i],verts[i+1],v[right],NULL,NULL,NULL); - facecopy(efa,hold); - if(i+1 != (vertsize-1)/2) { - if(seltype == SUBDIV_SELECT_INNER) { - hold->e2->f2 |= EDGEINNER; - } - } - hold = addfacelist(verts[vertsize-2-i],verts[vertsize-1-i],v[left],NULL,NULL,NULL); - facecopy(efa,hold); - if(i+1 != (vertsize-1)/2) { - if(seltype == SUBDIV_SELECT_INNER) { - hold->e3->f2 |= EDGEINNER; - } - } - } -} - -static void fill_tri_single(EditFace *efa, struct GHash *gh, int numcuts, int seltype) -{ - EditEdge *cedge=NULL; - EditVert *v[3], **verts; - EditFace *hold; - short start=0, end, op, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - - if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} - - // Point verts to the array of new verts for cedge - verts = BLI_ghash_lookup(gh, cedge); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0] != v[start]) {flipvertarray(verts,numcuts+2);} - end = (start+1)%3; - op = (start+2)%3; - - /* - We should have something like this now - - end start - 3 2 1 0 - |---*---*---| - \ | - \ | - \ | - \ | - \ | - \ | - |op - - where start,end,op are indexes of EditFace->v1, etc (stored in v) - and 0,1,2... are the indexes of the new verts stored in verts - - We will fill this case like this or this depending on even or odd cuts - - 3 2 1 0 - |---*---*---| - \ \ \ | - \ \ \ | - \ \ \ | - \ \ \| - \ \\| - \ | - |op - */ - - // Make side faces - for(i=0;i<(vertsize-1);i++) { - hold = addfacelist(verts[i],verts[i+1],v[op],NULL,NULL,NULL); - if(i+1 != vertsize-1) { - if(seltype == SUBDIV_SELECT_INNER) { - hold->e2->f2 |= EDGEINNER; - } - } - facecopy(efa,hold); - } -} - -static void fill_quad_double_op(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[2]={NULL, NULL}; - EditVert *v[4], **verts[2]; - EditFace *hold; - short start=0, end, left, right, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT) { cedge[0] = efa->e1; cedge[1] = efa->e3; start = 0;} - else if(efa->e2->f & SELECT) { cedge[0] = efa->e2; cedge[1] = efa->e4; start = 1;} - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - end = (start+1)%4; - left = (start+2)%4; - right = (start+3)%4; - if(verts[1][0] != v[left]) {flipvertarray(verts[1],numcuts+2);} - /* - We should have something like this now - - end start - 3 2 1 0 - |---*---*---| - | | - | | - | | - |---*---*---| - 0 1 2 3 - left right - - We will fill this case like this or this depending on even or odd cuts - - |---*---*---| - | | | | - | | | | - | | | | - |---*---*---| - */ - - // Make side faces - for(i=0;ie2->f2 |= EDGEINNER; - hold->e2->f2 |= DOUBLEOPFILL; - } - facecopy(efa,hold); - } -} - -static void fill_quad_double_adj_path(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[2]={NULL, NULL}; - EditVert *v[4], **verts[2]; - EditFace *hold; - short start=0, start2=0, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1;} - if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2;} - if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3;} - if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0;} - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - /* - We should have something like this now - - end start - 3 2 1 0 - start2 0|---*---*---| - | | - 1* | - | | - 2* | - | | - end2 3|-----------| - - We will fill this case like this or this depending on even or odd cuts - |---*---*---| - | / / / | - * / / | - | / / | - * / | - | / | - |-----------| - */ - - // Make outside tris - hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); - /* when ctrl is depressed, only want verts on the cutline selected */ - if (G.qual != LR_CTRLKEY) - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - hold = addfacelist(verts[0][0],verts[1][vertsize-1],v[(start2+2)%4],NULL,NULL,NULL); - /* when ctrl is depressed, only want verts on the cutline selected */ - if (G.qual != LR_CTRLKEY) - hold->e1->f2 |= EDGEINNER; - facecopy(efa,hold); - //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) { - // hold->e1->h |= EM_FGON; - //} - // Make side faces - - for(i=0;ie2->f2 |= EDGEINNER; - facecopy(efa,hold); - } - //EM_fgon_flags(); - -} - -static void fill_quad_double_adj_fan(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[2]={NULL, NULL}; - EditVert *v[4], *op=NULL, **verts[2]; - EditFace *hold; - short start=0, start2=0, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;} - if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;} - if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;} - if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;} - - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - /* - We should have something like this now - - end start - 3 2 1 0 - start2 0|---*---*---| - | | - 1* | - | | - 2* | - | | - end2 3|-----------|op - - We will fill this case like this or this (warning horrible ascii art follows) - |---*---*---| - | \ \ \ | - *---\ \ \ | - | \ \ \ \| - *---- \ \ \ | - | --- \\\| - |-----------| - */ - - for(i=0;i<=numcuts;i++) { - hold = addfacelist(op,verts[1][numcuts-i],verts[1][numcuts-i+1],NULL,NULL,NULL); - hold->e1->f2 |= EDGEINNER; - facecopy(efa,hold); - - hold = addfacelist(op,verts[0][i],verts[0][i+1],NULL,NULL,NULL); - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - } -} - -static void fill_quad_double_adj_inner(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[2]={NULL, NULL}; - EditVert *v[4], *op=NULL, **verts[2],**inner; - EditFace *hold; - short start=0, start2=0, vertsize,i; - float co[3]; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1; op = efa->v4;} - if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2; op = efa->v1;} - if(efa->e3->f & SELECT && efa->e4->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e4; start = 2; start2 = 3; op = efa->v2;} - if(efa->e4->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e4; cedge[1] = efa->e1; start = 3; start2 = 0; op = efa->v3;} - - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - /* - We should have something like this now - - end start - 3 2 1 0 - start2 0|---*---*---| - | | - 1* | - | | - 2* | - | | - end2 3|-----------|op - - We will fill this case like this or this (warning horrible ascii art follows) - |---*-----*---| - | * / | - * \ / | - | * | - | / \ | - * \ | - | \ | - |-------------| - */ - - // Add Inner Vert(s) - inner = MEM_mallocN(sizeof(EditVert*)*numcuts,"New inner verts"); - - for(i=0;ico[0] + verts[1][i+1]->co[0] ) / 2 ; - co[1] = (verts[0][numcuts-i]->co[1] + verts[1][i+1]->co[1] ) / 2 ; - co[2] = (verts[0][numcuts-i]->co[2] + verts[1][i+1]->co[2] ) / 2 ; - inner[i] = addvertlist(co, NULL); - inner[i]->f2 |= EDGEINNER; - - EM_data_interp_from_verts(verts[0][numcuts-i], verts[1][i+1], inner[i], 0.5f); - } - - // Add Corner Quad - hold = addfacelist(verts[0][numcuts+1],verts[1][1],inner[0],verts[0][numcuts],NULL,NULL); - hold->e2->f2 |= EDGEINNER; - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - // Add Bottom Quads - hold = addfacelist(verts[0][0],verts[0][1],inner[numcuts-1],op,NULL,NULL); - hold->e2->f2 |= EDGEINNER; - facecopy(efa,hold); - - hold = addfacelist(op,inner[numcuts-1],verts[1][numcuts],verts[1][numcuts+1],NULL,NULL); - hold->e2->f2 |= EDGEINNER; - facecopy(efa,hold); - - //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) { - // hold->e1->h |= EM_FGON; - //} - // Add Fill Quads (if # cuts > 1) - - for(i=0;ie1->f2 |= EDGEINNER; - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - - hold = addfacelist(inner[i],inner[i+1],verts[0][numcuts-1-i],verts[0][numcuts-i],NULL,NULL); - hold->e2->f2 |= EDGEINNER; - hold->e4->f2 |= EDGEINNER; - facecopy(efa,hold); - - //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) { - // hold->e1->h |= EM_FGON; - //} - } - - //EM_fgon_flags(); - - MEM_freeN(inner); -} - -static void fill_tri_double(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[2]={NULL, NULL}; - EditVert *v[3], **verts[2]; - EditFace *hold; - short start=0, start2=0, vertsize,i; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - - if(efa->e1->f & SELECT && efa->e2->f & SELECT) {cedge[0] = efa->e1; cedge[1] = efa->e2; start = 0; start2 = 1;} - if(efa->e2->f & SELECT && efa->e3->f & SELECT) {cedge[0] = efa->e2; cedge[1] = efa->e3; start = 1; start2 = 2;} - if(efa->e3->f & SELECT && efa->e1->f & SELECT) {cedge[0] = efa->e3; cedge[1] = efa->e1; start = 2; start2 = 0;} - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - /* - We should have something like this now - - end start - 3 2 1 0 - start2 0|---*---*---| - | / - 1* / - | / - 2* / - | / - end2 3| - - We will fill this case like this or this depending on even or odd cuts - |---*---*---| - | / / / - * / / - | / / - * / - | / - | - */ - - // Make outside tri - hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - // Make side faces - - for(i=0;ie2->f2 |= EDGEINNER; - facecopy(efa,hold); - } -} - -static void fill_quad_triple(EditFace *efa, struct GHash *gh, int numcuts) -{ - EditEdge *cedge[3]={0}; - EditVert *v[4], **verts[3]; - EditFace *hold; - short start=0, start2=0, start3=0, vertsize, i, repeats; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(!(efa->e1->f & SELECT)) { - cedge[0] = efa->e2; - cedge[1] = efa->e3; - cedge[2] = efa->e4; - start = 1;start2 = 2;start3 = 3; - } - if(!(efa->e2->f & SELECT)) { - cedge[0] = efa->e3; - cedge[1] = efa->e4; - cedge[2] = efa->e1; - start = 2;start2 = 3;start3 = 0; - } - if(!(efa->e3->f & SELECT)) { - cedge[0] = efa->e4; - cedge[1] = efa->e1; - cedge[2] = efa->e2; - start = 3;start2 = 0;start3 = 1; - } - if(!(efa->e4->f & SELECT)) { - cedge[0] = efa->e1; - cedge[1] = efa->e2; - cedge[2] = efa->e3; - start = 0;start2 = 1;start3 = 2; - } - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, cedge[0]); - verts[1] = BLI_ghash_lookup(gh, cedge[1]); - verts[2] = BLI_ghash_lookup(gh, cedge[2]); - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != v[start]) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != v[start2]) {flipvertarray(verts[1],numcuts+2);} - if(verts[2][0] != v[start3]) {flipvertarray(verts[2],numcuts+2);} - /* - We should have something like this now - - start2 - 3 2 1 0 - start3 0|---*---*---|3 - | | - 1* *2 - | | - 2* *1 - | | - 3|-----------|0 start - - We will fill this case like this or this depending on even or odd cuts - there are a couple of differences. For odd cuts, there is a tri in the - middle as well as 1 quad at the bottom (not including the extra quads - for odd cuts > 1 - - For even cuts, there is a quad in the middle and 2 quads on the bottom - - they are numbered here for clarity - - 1 outer tris and bottom quads - 2 inner tri or quad - 3 repeating quads - - |---*---*---*---| - |1/ / \ \ 1| - |/ 3 / \ 3 \| - * / 2 \ * - | / \ | - |/ \ | - *---------------* - | 3 | - | | - *---------------* - | | - | 1 | - | | - |---------------| - - |---*---*---*---*---| - | 1/ / \ \ 1| - | / / \ \ | - |/ 3 / \ 3 \| - * / \ * - | / \ | - | / 2 \ | - |/ \| - *-------------------* - | | - | 3 | - | | - *-------------------* - | | - | 1 | - | | - *-------------------* - | | - | 1 | - | | - |-------------------| - - */ - - // Make outside tris - hold = addfacelist(verts[0][vertsize-2],verts[0][vertsize-1],verts[1][1],NULL,NULL,NULL); - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - hold = addfacelist(verts[1][vertsize-2],verts[1][vertsize-1],verts[2][1],NULL,NULL,NULL); - hold->e3->f2 |= EDGEINNER; - facecopy(efa,hold); - // Make bottom quad - hold = addfacelist(verts[0][0],verts[0][1],verts[2][vertsize-2],verts[2][vertsize-1],NULL,NULL); - hold->e2->f2 |= EDGEINNER; - facecopy(efa,hold); - //If it is even cuts, add the 2nd lower quad - if(numcuts % 2 == 0) { - hold = addfacelist(verts[0][1],verts[0][2],verts[2][vertsize-3],verts[2][vertsize-2],NULL,NULL); - hold->e2->f2 |= EDGEINNER; - facecopy(efa,hold); - // Also Make inner quad - hold = addfacelist(verts[1][numcuts/2],verts[1][(numcuts/2)+1],verts[2][numcuts/2],verts[0][(numcuts/2)+1],NULL,NULL); - hold->e3->f2 |= EDGEINNER; - //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) { - // hold->e3->h |= EM_FGON; - //} - facecopy(efa,hold); - repeats = (numcuts / 2) -1; - } else { - // Make inner tri - hold = addfacelist(verts[1][(numcuts/2)+1],verts[2][(numcuts/2)+1],verts[0][(numcuts/2)+1],NULL,NULL,NULL); - hold->e2->f2 |= EDGEINNER; - //if(G.scene->toolsettings->editbutflag & B_AUTOFGON) { - // hold->e2->h |= EM_FGON; - //} - facecopy(efa,hold); - repeats = ((numcuts+1) / 2)-1; - } - - // cuts for 1 and 2 do not have the repeating quads - if(numcuts < 3) {repeats = 0;} - for(i=0;ie2->f2 |= EDGEINNER; - facecopy(efa,hold); - hold = addfacelist(verts[1][vertsize-i-3],verts[1][vertsize-i-2],verts[2][i+1],verts[2][i+2],NULL,NULL); - hold->e4->f2 |= EDGEINNER; - facecopy(efa,hold); - } - // Do repeating bottom quads - for(i=0;ie2->f2 |= EDGEINNER; - facecopy(efa,hold); - } - //EM_fgon_flags(); -} - -static void fill_quad_quadruple(EditFace *efa, struct GHash *gh, int numcuts, float rad, int beauty) -{ - EditVert **verts[4], ***innerverts; - EditFace *hold; - EditEdge temp; - short vertsize, i, j; - - // Point verts[0] and [1] to the array of new verts for cedge[0] and cedge[1] - verts[0] = BLI_ghash_lookup(gh, efa->e1); - verts[1] = BLI_ghash_lookup(gh, efa->e2); - verts[2] = BLI_ghash_lookup(gh, efa->e3); - verts[3] = BLI_ghash_lookup(gh, efa->e4); - - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != efa->v1) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} - if(verts[2][0] == efa->v3) {flipvertarray(verts[2],numcuts+2);} - if(verts[3][0] == efa->v4) {flipvertarray(verts[3],numcuts+2);} - /* - We should have something like this now - 1 - - 3 2 1 0 - 0|---*---*---|0 - | | - 1* *1 - 2 | | 4 - 2* *2 - | | - 3|---*---*---|3 - 3 2 1 0 - - 3 - // we will fill a 2 dim array of editvert*s to make filling easier - // the innervert order is shown - - 0 0---1---2---3 - | | | | - 1 0---1---2---3 - | | | | - 2 0---1---2---3 - | | | | - 3 0---1---2---3 - - */ - innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"quad-quad subdiv inner verts outer array"); - for(i=0;ie1->f2 = EDGENEW; - hold->e2->f2 = EDGENEW; - hold->e3->f2 = EDGENEW; - hold->e4->f2 = EDGENEW; - - if(i != 0) { hold->e1->f2 |= EDGEINNER; } - if(j != 0) { hold->e2->f2 |= EDGEINNER; } - if(i != numcuts) { hold->e3->f2 |= EDGEINNER; } - if(j != numcuts) { hold->e4->f2 |= EDGEINNER; } - - facecopy(efa,hold); - } - } - // Clean up our dynamic multi-dim array - for(i=0;ie1); - verts[1] = BLI_ghash_lookup(gh, efa->e2); - verts[2] = BLI_ghash_lookup(gh, efa->e3); - - //This is the index size of the verts array - vertsize = numcuts+2; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0][0] != efa->v1) {flipvertarray(verts[0],numcuts+2);} - if(verts[1][0] != efa->v2) {flipvertarray(verts[1],numcuts+2);} - if(verts[2][0] != efa->v3) {flipvertarray(verts[2],numcuts+2);} - /* - We should have something like this now - 3 - - 3 2 1 0 - 0|---*---*---|3 - | / - 1 1* *2 - | / - 2* *1 2 - | / - 3|/ - 0 - - we will fill a 2 dim array of editvert*s to make filling easier - - 3 - - 0 0---1---2---3---4 - | / | / |/ | / - 1 0---1----2---3 - 1 | / | / | / - 2 0----1---2 2 - | / | / - |/ |/ - 3 0---1 - | / - |/ - 4 0 - - */ - - innerverts = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"tri-tri subdiv inner verts outer array"); - for(i=0;ie1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - if(i != 0) { hold->e1->f2 |= EDGEINNER; } - if(j != 0) { hold->e2->f2 |= EDGEINNER; } - if(j+1 != (numcuts+1)-i) {hold->e3->f2 |= EDGEINNER;} - - facecopy(efa,hold); - //if there are more to come, we do the 2nd - if(j+1 <= numcuts-i) { - hold = addfacelist(innerverts[i+1][j],innerverts[i+1][j+1],innerverts[i][j+1],NULL,NULL,NULL); - facecopy(efa,hold); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - } - } - } - - // Clean up our dynamic multi-dim array - for(i=0;iv1, efa->v2, efa->v3, 0, efa, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e3->f2 |= EDGEINNER; - facecopy(efa, hold); - - hold= addfacelist(efa->v1, efa->v3, efa->v4, 0, efa, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e1->f2 |= EDGEINNER; - facecopy(efa, hold); - } - else{ - hold= addfacelist(efa->v1, efa->v2, efa->v4, 0, efa, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e2->f2 |= EDGEINNER; - facecopy(efa, hold); - - hold= addfacelist(efa->v2, efa->v3, efa->v4, 0, efa, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e3->f2 |= EDGEINNER; - facecopy(efa, hold); - } -} - -static void fill_quad_singlevert(EditFace *efa, struct GHash *gh) -{ - EditEdge *cedge=NULL; - EditVert *v[4], **verts; - EditFace *hold; - short start=0, end, left, right, vertsize; - - v[0] = efa->v1; - v[1] = efa->v2; - v[2] = efa->v3; - v[3] = efa->v4; - - if(efa->e1->f & SELECT) { cedge = efa->e1; start = 0;} - else if(efa->e2->f & SELECT) { cedge = efa->e2; start = 1;} - else if(efa->e3->f & SELECT) { cedge = efa->e3; start = 2;} - else if(efa->e4->f & SELECT) { cedge = efa->e4; start = 3;} - - // Point verts to the array of new verts for cedge - verts = BLI_ghash_lookup(gh, cedge); - //This is the index size of the verts array - vertsize = 3; - - // Is the original v1 the same as the first vert on the selected edge? - // if not, the edge is running the opposite direction in this face so flip - // the array to the correct direction - - if(verts[0] != v[start]) {flipvertarray(verts,3);} - end = (start+1)%4; - left = (start+2)%4; - right = (start+3)%4; - -/* - We should have something like this now - - end start - 2 1 0 - |-----*-----| - | | - | | - | | - ------------- - left right - - where start,end,left, right are indexes of EditFace->v1, etc (stored in v) - and 0,1,2 are the indexes of the new verts stored in verts. We fill like - this, depending on whether its vertex 'left' or vertex 'right' thats - been knifed through... - - |---*---| |---*---| - | / | | \ | - | / | | \ | - |/ | | \| - X-------- --------X -*/ - - if(v[left]->f1){ - //triangle is composed of cutvert, end and left - hold = addfacelist(verts[1],v[end],v[left],NULL, NULL,NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e3->f2 |= EDGEINNER; - facecopy(efa, hold); - - //quad is composed of cutvert, left, right and start - hold = addfacelist(verts[1],v[left],v[right],v[start], NULL, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e4->f2 |= EDGENEW; - hold->e1->f2 |= EDGEINNER; - facecopy(efa, hold); - } - else if(v[right]->f1){ - //triangle is composed of cutvert, right and start - hold = addfacelist(verts[1],v[right],v[start], NULL, NULL, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e1->f2 |= EDGEINNER; - facecopy(efa, hold); - //quad is composed of cutvert, end, left, right - hold = addfacelist(verts[1],v[end], v[left], v[right], NULL, NULL); - hold->e1->f2 |= EDGENEW; - hold->e2->f2 |= EDGENEW; - hold->e3->f2 |= EDGENEW; - hold->e4->f2 |= EDGENEW; - hold->e4->f2 |= EDGEINNER; - facecopy(efa, hold); - } - -} - -// This function takes an example edge, the current point to create and -// the total # of points to create, then creates the point and return the -// editvert pointer to it. -static EditVert *subdivideedgenum(EditEdge *edge, int curpoint, int totpoint, float rad, int beauty) -{ - EditVert *ev; - float percent; - - if (beauty & (B_PERCENTSUBD) && totpoint == 1) - //percent=(float)(edge->tmp.l)/32768.0f; - percent= edge->tmp.fp; - else - percent= (float)curpoint/(float)(totpoint+1); - - ev= subdivide_edge_addvert(edge, rad, beauty, percent); - ev->f = edge->v1->f; - - return ev; -} - -void esubdivideflag(int flag, float rad, int beauty, int numcuts, int seltype) -{ - EditMesh *em = G.editMesh; - EditFace *ef; - EditEdge *eed, *cedge, *sort[4]; - EditVert **templist; - struct GHash *gh; - float length[4], v1mat[3], v2mat[3], v3mat[3], v4mat[3]; - int i, j, edgecount, touchcount, facetype,hold; - - if(multires_test()) return; - - //Set faces f1 to 0 cause we need it later - for(ef=em->faces.first;ef;ef = ef->next) { - ef->f1 = 0; - } - - //Flush vertex flags upward to the edges - for(eed = em->edges.first;eed;eed = eed->next) { - //if(eed->f & flag && eed->v1->f == eed->v2->f) { - // eed->f |= eed->v1->f; - // } - eed->f2 = 0; - if(eed->f & flag) { - eed->f2 |= EDGEOLD; - } - } - - - // We store an array of verts for each edge that is subdivided, - // we put this array as a value in a ghash which is keyed by the EditEdge* - - // Now for beauty subdivide deselect edges based on length - if(beauty & B_BEAUTY) { - for(ef = em->faces.first;ef;ef = ef->next) { - if(!ef->v4) { - continue; - } - if(ef->f & SELECT) { - VECCOPY(v1mat, ef->v1->co); - VECCOPY(v2mat, ef->v2->co); - VECCOPY(v3mat, ef->v3->co); - VECCOPY(v4mat, ef->v4->co); - Mat4Mul3Vecfl(G.obedit->obmat, v1mat); - Mat4Mul3Vecfl(G.obedit->obmat, v2mat); - Mat4Mul3Vecfl(G.obedit->obmat, v3mat); - Mat4Mul3Vecfl(G.obedit->obmat, v4mat); - - length[0] = VecLenf(v1mat, v2mat); - length[1] = VecLenf(v2mat, v3mat); - length[2] = VecLenf(v3mat, v4mat); - length[3] = VecLenf(v4mat, v1mat); - sort[0] = ef->e1; - sort[1] = ef->e2; - sort[2] = ef->e3; - sort[3] = ef->e4; - - - // Beauty Short Edges - if(beauty & B_BEAUTY_SHORT) { - for(j=0;j<2;j++) { - hold = -1; - for(i=0;i<4;i++) { - if(length[i] < 0) { - continue; - } else if(hold == -1) { - hold = i; - } else { - if(length[hold] < length[i]) { - hold = i; - } - } - } - sort[hold]->f &= ~SELECT; - sort[hold]->f2 |= EDGENEW; - length[hold] = -1; - } - } - - // Beauty Long Edges - else { - for(j=0;j<2;j++) { - hold = -1; - for(i=0;i<4;i++) { - if(length[i] < 0) { - continue; - } else if(hold == -1) { - hold = i; - } else { - if(length[hold] > length[i]) { - hold = i; - } - } - } - sort[hold]->f &= ~SELECT; - sort[hold]->f2 |= EDGENEW; - length[hold] = -1; - } - } - } - } - } - - gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - - // If we are knifing, We only need the selected edges that were cut, so deselect if it was not cut - if(beauty & B_KNIFE) { - for(eed= em->edges.first;eed;eed=eed->next) { - if( eed->tmp.fp == 0 ) { - EM_select_edge(eed,0); - } - } - } - // So for each edge, if it is selected, we allocate an array of size cuts+2 - // so we can have a place for the v1, the new verts and v2 - for(eed=em->edges.first;eed;eed = eed->next) { - if(eed->f & flag) { - templist = MEM_mallocN(sizeof(EditVert*)*(numcuts+2),"vertlist"); - templist[0] = eed->v1; - for(i=0;if2 = EDGENEW; - } - templist[i+1] = eed->v2; - //Do the last edge too - cedge = addedgelist(templist[i],templist[i+1],eed); - cedge->f2 = EDGENEW; - // Now that the edge is subdivided, we can put its verts in the ghash - BLI_ghash_insert(gh, eed, templist); - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - // Now for each face in the mesh we need to figure out How many edges were cut - // and which filling method to use for that face - for(ef = em->faces.first;ef;ef = ef->next) { - edgecount = 0; - facetype = 3; - if(ef->e1->f & flag) {edgecount++;} - if(ef->e2->f & flag) {edgecount++;} - if(ef->e3->f & flag) {edgecount++;} - if(ef->v4) { - facetype = 4; - if(ef->e4->f & flag) {edgecount++;} - } - if(facetype == 4) { - switch(edgecount) { - case 0: - if(beauty & B_KNIFE && numcuts == 1){ - /*Test for when knifing through two opposite verts but no edges*/ - touchcount = 0; - if(ef->v1->f1) touchcount++; - if(ef->v2->f1) touchcount++; - if(ef->v3->f1) touchcount++; - if(ef->v4->f1) touchcount++; - if(touchcount == 2){ - if(ef->v1->f1 && ef->v3->f1){ - ef->f1 = SELECT; - fill_quad_doublevert(ef, 1, 3); - } - else if(ef->v2->f1 && ef->v4->f1){ - ef->f1 = SELECT; - fill_quad_doublevert(ef, 2, 4); - } - } - } - break; - - case 1: - if(beauty & B_KNIFE && numcuts == 1){ - /*Test for when knifing through an edge and one vert*/ - touchcount = 0; - if(ef->v1->f1) touchcount++; - if(ef->v2->f1) touchcount++; - if(ef->v3->f1) touchcount++; - if(ef->v4->f1) touchcount++; - - if(touchcount == 1){ - if( (ef->e1->f & flag && ( !ef->e1->v1->f1 && !ef->e1->v2->f1 )) || - (ef->e2->f & flag && ( !ef->e2->v1->f1 && !ef->e2->v2->f1 )) || - (ef->e3->f & flag && ( !ef->e3->v1->f1 && !ef->e3->v2->f1 )) || - (ef->e4->f & flag && ( !ef->e4->v1->f1 && !ef->e4->v2->f1 )) ){ - - ef->f1 = SELECT; - fill_quad_singlevert(ef, gh); - } - else{ - ef->f1 = SELECT; - fill_quad_single(ef, gh, numcuts, seltype); - } - } - else{ - ef->f1 = SELECT; - fill_quad_single(ef, gh, numcuts, seltype); - } - } - else{ - ef->f1 = SELECT; - fill_quad_single(ef, gh, numcuts, seltype); - } - break; - case 2: ef->f1 = SELECT; - // if there are 2, we check if edge 1 and 3 are either both on or off that way - // we can tell if the selected pair is Adjacent or Opposite of each other - if((ef->e1->f & flag && ef->e3->f & flag) || - (ef->e2->f & flag && ef->e4->f & flag)) { - fill_quad_double_op(ef, gh, numcuts); - }else{ - switch(G.scene->toolsettings->cornertype) { - case 0: fill_quad_double_adj_path(ef, gh, numcuts); break; - case 1: fill_quad_double_adj_inner(ef, gh, numcuts); break; - case 2: fill_quad_double_adj_fan(ef, gh, numcuts); break; - } - - } - break; - case 3: ef->f1 = SELECT; - fill_quad_triple(ef, gh, numcuts); - break; - case 4: ef->f1 = SELECT; - fill_quad_quadruple(ef, gh, numcuts, rad, beauty); - break; - } - } else { - switch(edgecount) { - case 0: break; - case 1: ef->f1 = SELECT; - fill_tri_single(ef, gh, numcuts, seltype); - break; - case 2: ef->f1 = SELECT; - fill_tri_double(ef, gh, numcuts); - break; - case 3: ef->f1 = SELECT; - fill_tri_triple(ef, gh, numcuts, rad, beauty); - break; - } - } - } - - // Delete Old Edges and Faces - for(eed = em->edges.first;eed;eed = eed->next) { - if(BLI_ghash_haskey(gh,eed)) { - eed->f1 = SELECT; - } else { - eed->f1 = 0; - } - } - free_tagged_edges_faces(em->edges.first, em->faces.first); - - if(seltype == SUBDIV_SELECT_ORIG && G.qual != LR_CTRLKEY) { - for(eed = em->edges.first;eed;eed = eed->next) { - if(eed->f2 & EDGENEW || eed->f2 & EDGEOLD) { - eed->f |= flag; - EM_select_edge(eed,1); - - }else{ - eed->f &= !flag; - EM_select_edge(eed,0); - } - } - } else if ((seltype == SUBDIV_SELECT_INNER || seltype == SUBDIV_SELECT_INNER_SEL)|| G.qual == LR_CTRLKEY) { - for(eed = em->edges.first;eed;eed = eed->next) { - if(eed->f2 & EDGEINNER) { - eed->f |= flag; - EM_select_edge(eed,1); - if(eed->v1->f & EDGEINNER) eed->v1->f |= SELECT; - if(eed->v2->f & EDGEINNER) eed->v2->f |= SELECT; - }else{ - eed->f &= !flag; - EM_select_edge(eed,0); - } - } - } else if(seltype == SUBDIV_SELECT_LOOPCUT){ - for(eed = em->edges.first;eed;eed = eed->next) { - if(eed->f2 & DOUBLEOPFILL){ - eed->f |= flag; - EM_select_edge(eed,1); - }else{ - eed->f &= !flag; - EM_select_edge(eed,0); - } - } - } - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eed = em->edges.first;eed;eed = eed->next) { - if(eed->f & SELECT) { - eed->v1->f |= SELECT; - eed->v2->f |= SELECT; - } - } - } - - //fix hide flags for edges. First pass, hide edges of hidden faces - for(ef=em->faces.first; ef; ef=ef->next){ - if(ef->h){ - ef->e1->h |= 1; - ef->e2->h |= 1; - ef->e3->h |= 1; - if(ef->e4) ef->e4->h |= 1; - } - } - //second pass: unhide edges of visible faces adjacent to hidden faces - for(ef=em->faces.first; ef; ef=ef->next){ - if(ef->h == 0){ - ef->e1->h &= ~1; - ef->e2->h &= ~1; - ef->e3->h &= ~1; - if(ef->e4) ef->e4->h &= ~1; - } - } - - // Free the ghash and call MEM_freeN on all the value entries to return - // that memory - BLI_ghash_free(gh, NULL, (GHashValFreeFP)MEM_freeN); - - EM_selectmode_flush(); - for(ef=em->faces.first;ef;ef = ef->next) { - if(ef->e4) { - if( (ef->e1->f & SELECT && ef->e2->f & SELECT) && - (ef->e3->f & SELECT && ef->e4->f & SELECT) ) { - ef->f |= SELECT; - } - } else { - if( (ef->e1->f & SELECT && ef->e2->f & SELECT) && ef->e3->f & SELECT) { - ef->f |= SELECT; - } - } - } - - recalc_editnormals(); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -} - -static int count_selected_edges(EditEdge *ed) -{ - int totedge = 0; - while(ed) { - ed->tmp.p = 0; - if( ed->f & SELECT ) totedge++; - ed= ed->next; - } - return totedge; -} - -/* hurms, as if this makes code readable! It's pointerpointer hiding... (ton) */ -typedef EditFace *EVPtr; -typedef EVPtr EVPTuple[2]; - -/** builds EVPTuple array efaa of face tuples (in fact pointers to EditFaces) - sharing one edge. - arguments: selected edge list, face list. - Edges will also be tagged accordingly (see eed->f2) */ - -static int collect_quadedges(EVPTuple *efaa, EditEdge *eed, EditFace *efa) -{ - EditEdge *e1, *e2, *e3; - EVPtr *evp; - int i = 0; - - /* run through edges, if selected, set pointer edge-> facearray */ - while(eed) { - eed->f2= 0; - eed->f1= 0; - if( eed->f & SELECT ) { - eed->tmp.p = (EditVert *) (&efaa[i]); - i++; - } - else eed->tmp.p = NULL; - - eed= eed->next; - } - - - /* find edges pointing to 2 faces by procedure: - - - run through faces and their edges, increase - face counter e->f1 for each face - */ - - while(efa) { - efa->f1= 0; - if(efa->v4==0 && (efa->f & SELECT)) { /* if selected triangle */ - e1= efa->e1; - e2= efa->e2; - e3= efa->e3; - if(e1->f2<3 && e1->tmp.p) { - if(e1->f2<2) { - evp= (EVPtr *) e1->tmp.p; - evp[(int)e1->f2] = efa; - } - e1->f2+= 1; - } - if(e2->f2<3 && e2->tmp.p) { - if(e2->f2<2) { - evp= (EVPtr *) e2->tmp.p; - evp[(int)e2->f2]= efa; - } - e2->f2+= 1; - } - if(e3->f2<3 && e3->tmp.p) { - if(e3->f2<2) { - evp= (EVPtr *) e3->tmp.p; - evp[(int)e3->f2]= efa; - } - e3->f2+= 1; - } - } - else { - /* set to 3 to make sure these are not flipped or joined */ - efa->e1->f2= 3; - efa->e2->f2= 3; - efa->e3->f2= 3; - if (efa->e4) efa->e4->f2= 3; - } - - efa= efa->next; - } - return i; -} - - -/* returns vertices of two adjacent triangles forming a quad - - can be righthand or lefthand - - 4-----3 - |\ | - | \ 2 | <- efa1 - | \ | - efa-> | 1 \ | - | \| - 1-----2 - -*/ -#define VTEST(face, num, other) \ - (face->v##num != other->v1 && face->v##num != other->v2 && face->v##num != other->v3) - -static void givequadverts(EditFace *efa, EditFace *efa1, EditVert **v1, EditVert **v2, EditVert **v3, EditVert **v4, int *vindex) -{ - if VTEST(efa, 1, efa1) { - *v1= efa->v1; - *v2= efa->v2; - vindex[0]= 0; - vindex[1]= 1; - } - else if VTEST(efa, 2, efa1) { - *v1= efa->v2; - *v2= efa->v3; - vindex[0]= 1; - vindex[1]= 2; - } - else if VTEST(efa, 3, efa1) { - *v1= efa->v3; - *v2= efa->v1; - vindex[0]= 2; - vindex[1]= 0; - } - - if VTEST(efa1, 1, efa) { - *v3= efa1->v1; - *v4= efa1->v2; - vindex[2]= 0; - vindex[3]= 1; - } - else if VTEST(efa1, 2, efa) { - *v3= efa1->v2; - *v4= efa1->v3; - vindex[2]= 1; - vindex[3]= 2; - } - else if VTEST(efa1, 3, efa) { - *v3= efa1->v3; - *v4= efa1->v1; - vindex[2]= 2; - vindex[3]= 0; - } - else - *v3= *v4= NULL; -} - -/* Helper functions for edge/quad edit features*/ -static void untag_edges(EditFace *f) -{ - f->e1->f1 = 0; - f->e2->f1 = 0; - f->e3->f1 = 0; - if (f->e4) f->e4->f1 = 0; -} - -/** remove and free list of tagged edges and faces */ -static void free_tagged_edges_faces(EditEdge *eed, EditFace *efa) -{ - EditMesh *em= G.editMesh; - EditEdge *nexted; - EditFace *nextvl; - - while(efa) { - nextvl= efa->next; - if(efa->f1) { - BLI_remlink(&em->faces, efa); - free_editface(efa); - } - else - /* avoid deleting edges that are still in use */ - untag_edges(efa); - efa= nextvl; - } - - while(eed) { - nexted= eed->next; - if(eed->f1) { - remedge(eed); - free_editedge(eed); - } - eed= nexted; - } -} - -/* note; the EM_selectmode_set() calls here illustrate how badly constructed it all is... from before the - edge/face flags, with very mixed results.... */ -void beauty_fill(void) -{ - EditMesh *em = G.editMesh; - EditVert *v1, *v2, *v3, *v4; - EditEdge *eed, *nexted; - EditEdge dia1, dia2; - EditFace *efa, *w; - // void **efaar, **efaa; - EVPTuple *efaar; - EVPtr *efaa; - float len1, len2, len3, len4, len5, len6, opp1, opp2, fac1, fac2; - int totedge, ok, notbeauty=8, onedone, vindex[4]; - - if(multires_test()) return; - - /* - all selected edges with two faces - * - find the faces: store them in edges (using datablock) - * - per edge: - test convex - * - test edge: flip? - * - if true: remedge, addedge, all edges at the edge get new face pointers - */ - - EM_selectmode_set(); // makes sure in selectmode 'face' the edges of selected faces are selected too - - totedge = count_selected_edges(em->edges.first); - if(totedge==0) return; - - /* temp block with face pointers */ - efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "beautyfill"); - - while (notbeauty) { - notbeauty--; - - ok = collect_quadedges(efaar, em->edges.first, em->faces.first); - - /* there we go */ - onedone= 0; - - eed= em->edges.first; - while(eed) { - nexted= eed->next; - - /* f2 is set in collect_quadedges() */ - if(eed->f2==2 && eed->h==0) { - - efaa = (EVPtr *) eed->tmp.p; - - /* none of the faces should be treated before, nor be part of fgon */ - ok= 1; - efa= efaa[0]; - if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; - if(efa->fgonf) ok= 0; - efa= efaa[1]; - if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; - if(efa->fgonf) ok= 0; - - if(ok) { - /* test convex */ - givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); - if(v1 && v2 && v3 && v4) { - if( convex(v1->co, v2->co, v3->co, v4->co) ) { - - /* test edges */ - if( (v1) > (v3) ) { - dia1.v1= v3; - dia1.v2= v1; - } - else { - dia1.v1= v1; - dia1.v2= v3; - } - - if( (v2) > (v4) ) { - dia2.v1= v4; - dia2.v2= v2; - } - else { - dia2.v1= v2; - dia2.v2= v4; - } - - /* testing rule: - * the area divided by the total edge lengths - */ - - len1= VecLenf(v1->co, v2->co); - len2= VecLenf(v2->co, v3->co); - len3= VecLenf(v3->co, v4->co); - len4= VecLenf(v4->co, v1->co); - len5= VecLenf(v1->co, v3->co); - len6= VecLenf(v2->co, v4->co); - - opp1= AreaT3Dfl(v1->co, v2->co, v3->co); - opp2= AreaT3Dfl(v1->co, v3->co, v4->co); - - fac1= opp1/(len1+len2+len5) + opp2/(len3+len4+len5); - - opp1= AreaT3Dfl(v2->co, v3->co, v4->co); - opp2= AreaT3Dfl(v2->co, v4->co, v1->co); - - fac2= opp1/(len2+len3+len6) + opp2/(len4+len1+len6); - - ok= 0; - if(fac1 > fac2) { - if(dia2.v1==eed->v1 && dia2.v2==eed->v2) { - eed->f1= 1; - efa= efaa[0]; - efa->f1= 1; - efa= efaa[1]; - efa->f1= 1; - - w= EM_face_from_faces(efaa[0], efaa[1], - vindex[0], vindex[1], 4+vindex[2], -1); - w->f |= SELECT; - - - w= EM_face_from_faces(efaa[0], efaa[1], - vindex[0], 4+vindex[2], 4+vindex[3], -1); - w->f |= SELECT; - - onedone= 1; - } - } - else if(fac1 < fac2) { - if(dia1.v1==eed->v1 && dia1.v2==eed->v2) { - eed->f1= 1; - efa= efaa[0]; - efa->f1= 1; - efa= efaa[1]; - efa->f1= 1; - - - w= EM_face_from_faces(efaa[0], efaa[1], - vindex[1], 4+vindex[2], 4+vindex[3], -1); - w->f |= SELECT; - - - w= EM_face_from_faces(efaa[0], efaa[1], - vindex[0], 4+vindex[1], 4+vindex[3], -1); - w->f |= SELECT; - - onedone= 1; - } - } - } - } - } - - } - eed= nexted; - } - - free_tagged_edges_faces(em->edges.first, em->faces.first); - - if(onedone==0) break; - - EM_selectmode_set(); // new edges/faces were added - } - - MEM_freeN(efaar); - - EM_select_flush(); - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - BIF_undo_push("Beauty Fill"); -} - - -/* ******************** BEGIN TRIANGLE TO QUAD ************************************* */ -static float measure_facepair(EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4, float limit){ - - /*gives a 'weight' to a pair of triangles that join an edge to decide how good a join they would make*/ - /*Note: this is more complicated than it needs to be and should be cleaned up...*/ - float measure = 0.0, noA1[3], noA2[3], noB1[3], noB2[3], normalADiff, normalBDiff, - edgeVec1[3], edgeVec2[3], edgeVec3[3], edgeVec4[3], diff, - minarea, maxarea, areaA, areaB; - - /*First Test: Normal difference*/ - CalcNormFloat(v1->co, v2->co, v3->co, noA1); - CalcNormFloat(v1->co, v3->co, v4->co, noA2); - - if(noA1[0] == noA2[0] && noA1[1] == noA2[1] && noA1[2] == noA2[2]) normalADiff = 0.0; - else normalADiff = VecAngle2(noA1, noA2); - //if(!normalADiff) normalADiff = 179; - CalcNormFloat(v2->co, v3->co, v4->co, noB1); - CalcNormFloat(v4->co, v1->co, v2->co, noB2); - - if(noB1[0] == noB2[0] && noB1[1] == noB2[1] && noB1[2] == noB2[2]) normalBDiff = 0.0; - else normalBDiff = VecAngle2(noB1, noB2); - //if(!normalBDiff) normalBDiff = 179; - - measure += (normalADiff/360) + (normalBDiff/360); - if(measure > limit) return measure; - - /*Second test: Colinearity*/ - VecSubf(edgeVec1, v1->co, v2->co); - VecSubf(edgeVec2, v2->co, v3->co); - VecSubf(edgeVec3, v3->co, v4->co); - VecSubf(edgeVec4, v4->co, v1->co); - - diff = 0.0; - - diff = ( - fabs(VecAngle2(edgeVec1, edgeVec2) - 90) + - fabs(VecAngle2(edgeVec2, edgeVec3) - 90) + - fabs(VecAngle2(edgeVec3, edgeVec4) - 90) + - fabs(VecAngle2(edgeVec4, edgeVec1) - 90)) / 360; - if(!diff) return 0.0; - - measure += diff; - if(measure > limit) return measure; - - /*Third test: Concavity*/ - areaA = AreaT3Dfl(v1->co, v2->co, v3->co) + AreaT3Dfl(v1->co, v3->co, v4->co); - areaB = AreaT3Dfl(v2->co, v3->co, v4->co) + AreaT3Dfl(v4->co, v1->co, v2->co); - - if(areaA <= areaB) minarea = areaA; - else minarea = areaB; - - if(areaA >= areaB) maxarea = areaA; - else maxarea = areaB; - - if(!maxarea) measure += 1; - else measure += (1 - (minarea / maxarea)); - - return measure; -} - -#define T2QUV_LIMIT 0.005 -#define T2QCOL_LIMIT 3 -static int compareFaceAttribs(EditFace *f1, EditFace *f2, EditEdge *eed) -{ - /*Test to see if the per-face attributes for the joining edge match within limit*/ - MTFace *tf1, *tf2; - unsigned int *col1, *col2; - short i,attrok=0, flag = G.scene->toolsettings->editbutflag, fe1[2], fe2[2]; - - tf1 = CustomData_em_get(&G.editMesh->fdata, f1->data, CD_MTFACE); - tf2 = CustomData_em_get(&G.editMesh->fdata, f2->data, CD_MTFACE); - - col1 = CustomData_em_get(&G.editMesh->fdata, f1->data, CD_MCOL); - col2 = CustomData_em_get(&G.editMesh->fdata, f2->data, CD_MCOL); - - /*store indices for faceedges*/ - f1->v1->f1 = 0; - f1->v2->f1 = 1; - f1->v3->f1 = 2; - - fe1[0] = eed->v1->f1; - fe1[1] = eed->v2->f1; - - f2->v1->f1 = 0; - f2->v2->f1 = 1; - f2->v3->f1 = 2; - - fe2[0] = eed->v1->f1; - fe2[1] = eed->v2->f1; - - /*compare faceedges for each face attribute. Additional per face attributes can be added later*/ - /*do UVs*/ - if(flag & B_JOINTRIA_UV){ - - if(tf1 == NULL || tf2 == NULL) attrok |= B_JOINTRIA_UV; - else if(tf1->tpage != tf2->tpage); /*do nothing*/ - else{ - for(i = 0; i < 2; i++){ - if(tf1->uv[fe1[i]][0] + T2QUV_LIMIT > tf2->uv[fe2[i]][0] && tf1->uv[fe1[i]][0] - T2QUV_LIMIT < tf2->uv[fe2[i]][0] && - tf1->uv[fe1[i]][1] + T2QUV_LIMIT > tf2->uv[fe2[i]][1] && tf1->uv[fe1[i]][1] - T2QUV_LIMIT < tf2->uv[fe2[i]][1]) attrok |= B_JOINTRIA_UV; - } - } - } - - /*do VCOLs*/ - if(flag & B_JOINTRIA_VCOL){ - if(!col1 || !col2) attrok |= B_JOINTRIA_VCOL; - else{ - char *f1vcol, *f2vcol; - for(i = 0; i < 2; i++){ - f1vcol = (char *)&(col1[fe1[i]]); - f2vcol = (char *)&(col2[fe2[i]]); - - /*compare f1vcol with f2vcol*/ - if( f1vcol[1] + T2QCOL_LIMIT > f2vcol[1] && f1vcol[1] - T2QCOL_LIMIT < f2vcol[1] && - f1vcol[2] + T2QCOL_LIMIT > f2vcol[2] && f1vcol[2] - T2QCOL_LIMIT < f2vcol[2] && - f1vcol[3] + T2QCOL_LIMIT > f2vcol[3] && f1vcol[3] - T2QCOL_LIMIT < f2vcol[3]) attrok |= B_JOINTRIA_VCOL; - } - } - } - - if( ((attrok & B_JOINTRIA_UV) == (flag & B_JOINTRIA_UV)) && ((attrok & B_JOINTRIA_VCOL) == (flag & B_JOINTRIA_VCOL)) ) return 1; - return 0; -} - -static int fplcmp(const void *v1, const void *v2) -{ - const EditEdge *e1= *((EditEdge**)v1), *e2=*((EditEdge**)v2); - - if( e1->crease > e2->crease) return 1; - else if( e1->crease < e2->crease) return -1; - - return 0; -} - -/*Bitflags for edges.*/ -#define T2QDELETE 1 -#define T2QCOMPLEX 2 -#define T2QJOIN 4 -void join_triangles(void) -{ - EditMesh *em=G.editMesh; - EditVert *v1, *v2, *v3, *v4, *eve; - EditEdge *eed, **edsortblock = NULL, **edb = NULL; - EditFace *efa; - EVPTuple *efaar = NULL; - EVPtr *efaa = NULL; - float *creases = NULL; - float measure; /*Used to set tolerance*/ - float limit = G.scene->toolsettings->jointrilimit; - int i, ok, totedge=0, totseledge=0, complexedges, vindex[4]; - - /*test for multi-resolution data*/ - if(multires_test()) return; - - /*if we take a long time on very dense meshes we want waitcursor to display*/ - waitcursor(1); - - totseledge = count_selected_edges(em->edges.first); - if(totseledge==0) return; - - /*abusing crease value to store weights for edge pairs. Nasty*/ - for(eed=em->edges.first; eed; eed=eed->next) totedge++; - if(totedge) creases = MEM_callocN(sizeof(float) * totedge, "Join Triangles Crease Array"); - for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++){ - creases[i] = eed->crease; - eed->crease = 0.0; - } - - /*clear temp flags*/ - for(eve=em->verts.first; eve; eve=eve->next) eve->f1 = eve->f2 = 0; - for(eed=em->edges.first; eed; eed=eed->next) eed->f2 = eed->f1 = 0; - for(efa=em->faces.first; efa; efa=efa->next) efa->f1 = efa->tmp.l = 0; - - /*For every selected 2 manifold edge, create pointers to its two faces.*/ - efaar= (EVPTuple *) MEM_callocN(totseledge * sizeof(EVPTuple), "Tri2Quad"); - ok = collect_quadedges(efaar, em->edges.first, em->faces.first); - complexedges = 0; - - if(ok){ - - - /*clear tmp.l flag and store number of faces that are selected and coincident to current face here.*/ - for(eed=em->edges.first; eed; eed=eed->next){ - /* eed->f2 is 2 only if this edge is part of exactly two - triangles, and both are selected, and it has EVPTuple assigned */ - if(eed->f2 == 2){ - efaa= (EVPtr *) eed->tmp.p; - efaa[0]->tmp.l++; - efaa[1]->tmp.l++; - } - } - - for(eed=em->edges.first; eed; eed=eed->next){ - if(eed->f2 == 2){ - efaa= (EVPtr *) eed->tmp.p; - v1 = v2 = v3 = v4 = NULL; - givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); - if(v1 && v2 && v3 && v4){ - /*test if simple island first. This mimics 2.42 behaviour and the tests are less restrictive.*/ - if(efaa[0]->tmp.l == 1 && efaa[1]->tmp.l == 1){ - if( convex(v1->co, v2->co, v3->co, v4->co) ){ - eed->f1 |= T2QJOIN; - efaa[0]->f1 = 1; //mark for join - efaa[1]->f1 = 1; //mark for join - } - } - else{ - - /* The face pair is part of a 'complex' island, so the rules for dealing with it are more involved. - Depending on what options the user has chosen, this face pair can be 'thrown out' based upon the following criteria: - - 1: the two faces do not share the same material - 2: the edge joining the two faces is marked as sharp. - 3: the two faces UV's do not make a good match - 4: the two faces Vertex colors do not make a good match - - If the face pair passes all the applicable tests, it is then given a 'weight' with the measure_facepair() function. - This measures things like concavity, colinearity ect. If this weight is below the threshold set by the user - the edge joining them is marked as being 'complex' and will be compared against other possible pairs which contain one of the - same faces in the current pair later. - - This technique is based upon an algorithm that Campbell Barton developed for his Tri2Quad script that was previously part of - the python scripts bundled with Blender releases. - */ - - if(G.scene->toolsettings->editbutflag & B_JOINTRIA_SHARP && eed->sharp); /*do nothing*/ - else if(G.scene->toolsettings->editbutflag & B_JOINTRIA_MAT && efaa[0]->mat_nr != efaa[1]->mat_nr); /*do nothing*/ - else if(((G.scene->toolsettings->editbutflag & B_JOINTRIA_UV) || (G.scene->toolsettings->editbutflag & B_JOINTRIA_VCOL)) && - compareFaceAttribs(efaa[0], efaa[1], eed) == 0); /*do nothing*/ - else{ - measure = measure_facepair(v1, v2, v3, v4, limit); - if(measure < limit){ - complexedges++; - eed->f1 |= T2QCOMPLEX; - eed->crease = measure; /*we dont mark edges for join yet*/ - } - } - } - } - } - } - - /*Quicksort the complex edges according to their weighting*/ - if(complexedges){ - edsortblock = edb = MEM_callocN(sizeof(EditEdge*) * complexedges, "Face Pairs quicksort Array"); - for(eed = em->edges.first; eed; eed=eed->next){ - if(eed->f1 & T2QCOMPLEX){ - *edb = eed; - edb++; - } - } - qsort(edsortblock, complexedges, sizeof(EditEdge*), fplcmp); - /*now go through and mark the edges who get the highest weighting*/ - for(edb=edsortblock, i=0; i < complexedges; edb++, i++){ - efaa = (EVPtr *)((*edb)->tmp.p); /*suspect!*/ - if( !efaa[0]->f1 && !efaa[1]->f1){ - efaa[0]->f1 = 1; //mark for join - efaa[1]->f1 = 1; //mark for join - (*edb)->f1 |= T2QJOIN; - } - } - } - - /*finally go through all edges marked for join (simple and complex) and create new faces*/ - for(eed=em->edges.first; eed; eed=eed->next){ - if(eed->f1 & T2QJOIN){ - efaa= (EVPtr *)eed->tmp.p; - v1 = v2 = v3 = v4 = NULL; - givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); - if((v1 && v2 && v3 && v4) && (exist_face(v1, v2, v3, v4)==0)){ /*exist_face is very slow! Needs to be adressed.*/ - /*flag for delete*/ - eed->f1 |= T2QDELETE; - /*create new quad and select*/ - efa = EM_face_from_faces(efaa[0], efaa[1], vindex[0], vindex[1], 4+vindex[2], 4+vindex[3]); - EM_select_face(efa,1); - } - else{ - efaa[0]->f1 = 0; - efaa[1]->f1 = 0; - } - } - } - } - - /*free data and cleanup*/ - if(creases){ - for(eed=em->edges.first, i = 0; eed; eed=eed->next, i++) eed->crease = creases[i]; - MEM_freeN(creases); - } - for(eed=em->edges.first; eed; eed=eed->next){ - if(eed->f1 & T2QDELETE) eed->f1 = 1; - else eed->f1 = 0; - } - free_tagged_edges_faces(em->edges.first, em->faces.first); - if(efaar) MEM_freeN(efaar); - if(edsortblock) MEM_freeN(edsortblock); - - EM_selectmode_flush(); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - #ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); - #endif - waitcursor(0); - BIF_undo_push("Convert Triangles to Quads"); -} -/* ******************** END TRIANGLE TO QUAD ************************************* */ - -#define FACE_MARKCLEAR(f) (f->f1 = 1) - -/* quick hack, basically a copy of beauty_fill */ -void edge_flip(void) -{ - EditMesh *em = G.editMesh; - EditVert *v1, *v2, *v3, *v4; - EditEdge *eed, *nexted; - EditFace *efa, *w; - //void **efaar, **efaa; - EVPTuple *efaar; - EVPtr *efaa; - int totedge, ok, vindex[4]; - - /* - all selected edges with two faces - * - find the faces: store them in edges (using datablock) - * - per edge: - test convex - * - test edge: flip? - - if true: remedge, addedge, all edges at the edge get new face pointers - */ - - EM_selectmode_flush(); // makes sure in selectmode 'face' the edges of selected faces are selected too - - totedge = count_selected_edges(em->edges.first); - if(totedge==0) return; - - /* temporary array for : edge -> face[1], face[2] */ - efaar= (EVPTuple *) MEM_callocN(totedge * sizeof(EVPTuple), "edgeflip"); - - ok = collect_quadedges(efaar, em->edges.first, em->faces.first); - - eed= em->edges.first; - while(eed) { - nexted= eed->next; - - if(eed->f2==2) { /* points to 2 faces */ - - efaa= (EVPtr *) eed->tmp.p; - - /* don't do it if flagged */ - - ok= 1; - efa= efaa[0]; - if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; - efa= efaa[1]; - if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1) ok= 0; - - if(ok) { - /* test convex */ - givequadverts(efaa[0], efaa[1], &v1, &v2, &v3, &v4, vindex); - -/* - 4-----3 4-----3 - |\ | | /| - | \ 1 | | 1 / | - | \ | -> | / | - | 0 \ | | / 0 | - | \| |/ | - 1-----2 1-----2 -*/ - /* make new faces */ - if (v1 && v2 && v3) { - if( convex(v1->co, v2->co, v3->co, v4->co) ) { - if(exist_face(v1, v2, v3, v4)==0) { - /* outch this may break seams */ - w= EM_face_from_faces(efaa[0], efaa[1], vindex[0], - vindex[1], 4+vindex[2], -1); - - EM_select_face(w, 1); - - /* outch this may break seams */ - w= EM_face_from_faces(efaa[0], efaa[1], vindex[0], - 4+vindex[2], 4+vindex[3], -1); - - EM_select_face(w, 1); - } - /* tag as to-be-removed */ - FACE_MARKCLEAR(efaa[1]); - FACE_MARKCLEAR(efaa[0]); - eed->f1 = 1; - - } /* endif test convex */ - } - } - } - eed= nexted; - } - - /* clear tagged edges and faces: */ - free_tagged_edges_faces(em->edges.first, em->faces.first); - - MEM_freeN(efaar); - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - BIF_undo_push("Flip Triangle Edges"); - -} - -static void edge_rotate(EditEdge *eed,int dir) -{ - EditMesh *em = G.editMesh; - EditVert **verts[2]; - EditFace *face[2], *efa, *newFace[2]; - EditEdge **edges[2], **hiddenedges, *srchedge; - int facecount, p1, p2, p3, p4, fac1, fac2, i, j; - int numhidden, numshared, p[2][4]; - - /* check to make sure that the edge is only part of 2 faces */ - facecount = 0; - for(efa = em->faces.first;efa;efa = efa->next) { - if((efa->e1 == eed || efa->e2 == eed) || (efa->e3 == eed || efa->e4 == eed)) { - if(facecount >= 2) { - /* more than two faces with this edge */ - return; - } - else { - face[facecount] = efa; - facecount++; - } - } - } - - if(facecount < 2) - return; - - /* how many edges does each face have */ - if(face[0]->e4) fac1= 4; - else fac1= 3; - - if(face[1]->e4) fac2= 4; - else fac2= 3; - - /* make a handy array for verts and edges */ - verts[0]= &face[0]->v1; - edges[0]= &face[0]->e1; - verts[1]= &face[1]->v1; - edges[1]= &face[1]->e1; - - /* we don't want to rotate edges between faces that share more than one edge */ - numshared= 0; - for(i=0; i 1) - return; - - /* coplaner faces only please */ - if(Inpf(face[0]->n,face[1]->n) <= 0.000001) - return; - - /* we want to construct an array of vertex indicis in both faces, starting at - the last vertex of the edge being rotated. - - first we find the two vertices that lie on the rotating edge - - then we make sure they are ordered according to the face vertex order - - and then we construct the array */ - p1= p2= p3= p4= 0; - - for(i=0; i<4; i++) { - if(eed->v1 == verts[0][i]) p1 = i; - if(eed->v2 == verts[0][i]) p2 = i; - if(eed->v1 == verts[1][i]) p3 = i; - if(eed->v2 == verts[1][i]) p4 = i; - } - - if((p1+1)%fac1 == p2) - SWAP(int, p1, p2); - if((p3+1)%fac2 == p4) - SWAP(int, p3, p4); - - for (i = 0; i < 4; i++) { - p[0][i]= (p1 + i)%fac1; - p[1][i]= (p3 + i)%fac2; - } - - /* create an Array of the Edges who have h set prior to rotate */ - numhidden = 0; - for(srchedge = em->edges.first;srchedge;srchedge = srchedge->next) - if(srchedge->h && ((srchedge->v1->f & SELECT) || (srchedge->v2->f & SELECT))) - numhidden++; - - hiddenedges = MEM_mallocN(sizeof(EditVert*)*numhidden+1, "RotateEdgeHiddenVerts"); - if(!hiddenedges) { - error("Malloc Was not happy!"); - return; - } - - numhidden = 0; - for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next) - if(srchedge->h && (srchedge->v1->f & SELECT || srchedge->v2->f & SELECT)) - hiddenedges[numhidden++] = srchedge; - - /* create the 2 new faces */ - if(fac1 == 3 && fac2 == 3) { - /* no need of reverse setup */ - - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1); - } - else if(fac1 == 4 && fac2 == 3) { - if(dir == 1) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], -1); - } else if (dir == 2) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][2], 4+p[1][1], p[0][0], p[0][1]); - newFace[1]= EM_face_from_faces(face[1], face[0], 4+p[0][2], p[1][0], p[1][1], -1); - - verts[0][p[0][2]]->f |= SELECT; - verts[1][p[1][1]]->f |= SELECT; - } - } - else if(fac1 == 3 && fac2 == 4) { - if(dir == 1) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], 4+p[1][1], -1); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]); - } else if (dir == 2) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][0], p[0][1], 4+p[1][2], -1); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], 4+p[0][1], 4+p[0][2]); - - verts[0][p[0][1]]->f |= SELECT; - verts[1][p[1][2]]->f |= SELECT; - } - - } - else if(fac1 == 4 && fac2 == 4) { - if(dir == 1) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][1], p[0][2], p[0][3], 4+p[1][1]); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][1], p[1][2], p[1][3], 4+p[0][1]); - } else if (dir == 2) { - newFace[0]= EM_face_from_faces(face[0], face[1], p[0][2], p[0][3], 4+p[1][1], 4+p[1][2]); - newFace[1]= EM_face_from_faces(face[1], face[0], p[1][2], p[1][3], 4+p[0][1], 4+p[0][2]); - - verts[0][p[0][2]]->f |= SELECT; - verts[1][p[1][2]]->f |= SELECT; - } - } - else - return; /* This should never happen */ - - if(dir == 1 || (fac1 == 3 && fac2 == 3)) { - verts[0][p[0][1]]->f |= SELECT; - verts[1][p[1][1]]->f |= SELECT; - } - - /* copy old edge's flags to new center edge*/ - for(srchedge=em->edges.first;srchedge;srchedge=srchedge->next) { - if((srchedge->v1->f & SELECT) && (srchedge->v2->f & SELECT)) { - srchedge->f = eed->f; - srchedge->h = eed->h; - srchedge->dir = eed->dir; - srchedge->seam = eed->seam; - srchedge->crease = eed->crease; - } - } - - /* resetting hidden flag */ - for(numhidden--; numhidden>=0; numhidden--) - hiddenedges[numhidden]->h= 1; - - /* check for orhphan edges */ - for(srchedge=em->edges.first; srchedge; srchedge=srchedge->next) - srchedge->f1= -1; - - /* cleanup */ - MEM_freeN(hiddenedges); - - /* get rid of the old edge and faces*/ - remedge(eed); - free_editedge(eed); - BLI_remlink(&em->faces, face[0]); - free_editface(face[0]); - BLI_remlink(&em->faces, face[1]); - free_editface(face[1]); -} - -/* only accepts 1 selected edge, or 2 selected faces */ -void edge_rotate_selected(int dir) -{ - EditEdge *eed; - EditFace *efa; - short edgeCount = 0; - - /*clear new flag for new edges, count selected edges */ - for(eed= G.editMesh->edges.first; eed; eed= eed->next) { - eed->f1= 0; - eed->f2 &= ~2; - if(eed->f & SELECT) edgeCount++; - } - - if(edgeCount>1) { - /* more selected edges, check faces */ - for(efa= G.editMesh->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - } - edgeCount= 0; - for(eed= G.editMesh->edges.first; eed; eed= eed->next) { - if(eed->f1==2) edgeCount++; - } - if(edgeCount==1) { - for(eed= G.editMesh->edges.first; eed; eed= eed->next) { - if(eed->f1==2) { - edge_rotate(eed,dir); - break; - } - } - } - else error("Select one edge or two adjacent faces"); - } - else if(edgeCount==1) { - for(eed= G.editMesh->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { - EM_select_edge(eed, 0); - edge_rotate(eed,dir); - break; - } - } - } - else error("Select one edge or two adjacent faces"); - - - /* flush selected vertices (again) to edges/faces */ - EM_select_flush(); - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - -#ifdef WITH_VERSE - if(G.editMesh->vnode) - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); -#endif - - BIF_undo_push("Rotate Edge"); -} - -/******************* BEVEL CODE STARTS HERE ********************/ - -static void bevel_displace_vec(float *midvec, float *v1, float *v2, float *v3, float d, float no[3]) -{ - float a[3], c[3], n_a[3], n_c[3], mid[3], ac, ac2, fac; - - VecSubf(a, v1, v2); - VecSubf(c, v3, v2); - - Crossf(n_a, a, no); - Normalize(n_a); - Crossf(n_c, no, c); - Normalize(n_c); - - Normalize(a); - Normalize(c); - ac = Inpf(a, c); - - if (ac == 1 || ac == -1) { - midvec[0] = midvec[1] = midvec[2] = 0; - return; - } - ac2 = ac * ac; - fac = (float)sqrt((ac2 + 2*ac + 1)/(1 - ac2) + 1); - VecAddf(mid, n_c, n_a); - Normalize(mid); - VecMulf(mid, d * fac); - VecAddf(mid, mid, v2); - VecCopyf(midvec, mid); -} - -/* Finds the new point using the sinus law to extrapolate a triangle - Lots of sqrts which would not be good for a real time algo - Using the mid point of the extrapolation of both sides - Useless for coplanar quads, but that doesn't happen too often */ -static void fix_bevel_wrap(float *midvec, float *v1, float *v2, float *v3, float *v4, float d, float no[3]) -{ - float a[3], b[3], c[3], l_a, l_b, l_c, s_a, s_b, s_c, Pos1[3], Pos2[3], Dir[3]; - - VecSubf(a, v3, v2); - l_a = Normalize(a); - VecSubf(b, v4, v3); - Normalize(b); - VecSubf(c, v1, v2); - Normalize(c); - - s_b = Inpf(a, c); - s_b = (float)sqrt(1 - (s_b * s_b)); - s_a = Inpf(b, c); - s_a = (float)sqrt(1 - (s_a * s_a)); - VecMulf(a, -1); - s_c = Inpf(a, b); - s_c = (float)sqrt(1 - (s_c * s_c)); - - l_b = s_b * l_a / s_a; - l_c = s_c * l_a / s_a; - - VecMulf(b, l_b); - VecMulf(c, l_c); - - VecAddf(Pos1, v2, c); - VecAddf(Pos2, v3, b); - - VecAddf(Dir, Pos1, Pos2); - VecMulf(Dir, 0.5); - - bevel_displace_vec(midvec, v3, Dir, v2, d, no); - -} - - -static char detect_wrap(float *o_v1, float *o_v2, float *v1, float *v2, float *no) -{ - float o_a[3], a[3], o_c[3], c[3]; - - VecSubf(o_a, o_v1, o_v2); - VecSubf(a, v1, v2); - - Crossf(o_c, o_a, no); - Crossf(c, a, no); - - if (Inpf(c, o_c) <= 0) - return 1; - else - return 0; -} - -// Detects and fix a quad wrapping after the resize -// Arguments are the orginal verts followed by the final verts and then the bevel size and the normal -static void fix_bevel_quad_wrap(float *o_v1, float *o_v2, float *o_v3, float *o_v4, float *v1, float *v2, float *v3, float *v4, float d, float *no) -{ - float vec[3]; - char wrap[4]; - - // Quads can wrap partially. Watch out - wrap[0] = detect_wrap(o_v1, o_v2, v1, v2, no); // Edge 1-2 - wrap[1] = detect_wrap(o_v2, o_v3, v2, v3, no); // Edge 2-3 - wrap[2] = detect_wrap(o_v3, o_v4, v3, v4, no); // Edge 3-4 - wrap[3] = detect_wrap(o_v4, o_v1, v4, v1, no); // Edge 4-1 - - // Edge 1 inverted - if (wrap[0] == 1 && wrap[1] == 0 && wrap[2] == 0 && wrap[3] == 0) { - fix_bevel_wrap(vec, o_v2, o_v3, o_v4, o_v1, d, no); - VECCOPY(v1, vec); - VECCOPY(v2, vec); - } - // Edge 2 inverted - else if (wrap[0] == 0 && wrap[1] == 1 && wrap[2] == 0 && wrap[3] == 0) { - fix_bevel_wrap(vec, o_v3, o_v4, o_v1, o_v2, d, no); - VECCOPY(v2, vec); - VECCOPY(v3, vec); - } - // Edge 3 inverted - else if (wrap[0] == 0 && wrap[1] == 0 && wrap[2] == 1 && wrap[3] == 0) { - fix_bevel_wrap(vec, o_v4, o_v1, o_v2, o_v3, d, no); - VECCOPY(v3, vec); - VECCOPY(v4, vec); - } - // Edge 4 inverted - else if (wrap[0] == 0 && wrap[1] == 0 && wrap[2] == 0 && wrap[3] == 1) { - fix_bevel_wrap(vec, o_v1, o_v2, o_v3, o_v4, d, no); - VECCOPY(v4, vec); - VECCOPY(v1, vec); - } - // Edge 2 and 4 inverted - else if (wrap[0] == 0 && wrap[1] == 1 && wrap[2] == 0 && wrap[3] == 1) { - VecAddf(vec, v2, v3); - VecMulf(vec, 0.5); - VECCOPY(v2, vec); - VECCOPY(v3, vec); - VecAddf(vec, v1, v4); - VecMulf(vec, 0.5); - VECCOPY(v1, vec); - VECCOPY(v4, vec); - } - // Edge 1 and 3 inverted - else if (wrap[0] == 1 && wrap[1] == 0 && wrap[2] == 1 && wrap[3] == 0) { - VecAddf(vec, v1, v2); - VecMulf(vec, 0.5); - VECCOPY(v1, vec); - VECCOPY(v2, vec); - VecAddf(vec, v3, v4); - VecMulf(vec, 0.5); - VECCOPY(v3, vec); - VECCOPY(v4, vec); - } - // Totally inverted - else if (wrap[0] == 1 && wrap[1] == 1 && wrap[2] == 1 && wrap[3] == 1) { - VecAddf(vec, v1, v2); - VecAddf(vec, vec, v3); - VecAddf(vec, vec, v4); - VecMulf(vec, 0.25); - VECCOPY(v1, vec); - VECCOPY(v2, vec); - VECCOPY(v3, vec); - VECCOPY(v4, vec); - } - -} - -// Detects and fix a tri wrapping after the resize -// Arguments are the orginal verts followed by the final verts and the normal -// Triangles cannot wrap partially (not in this situation -static void fix_bevel_tri_wrap(float *o_v1, float *o_v2, float *o_v3, float *v1, float *v2, float *v3, float *no) -{ - if (detect_wrap(o_v1, o_v2, v1, v2, no)) { - float vec[3]; - VecAddf(vec, o_v1, o_v2); - VecAddf(vec, vec, o_v3); - VecMulf(vec, 1.0f/3.0f); - VECCOPY(v1, vec); - VECCOPY(v2, vec); - VECCOPY(v3, vec); - } -} - -static void bevel_shrink_faces(float d, int flag) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - float vec[3], no[3], v1[3], v2[3], v3[3], v4[3]; - - /* move edges of all faces with efa->f1 & flag closer towards their centers */ - efa= em->faces.first; - while (efa) { - if (efa->f1 & flag) { - VECCOPY(v1, efa->v1->co); - VECCOPY(v2, efa->v2->co); - VECCOPY(v3, efa->v3->co); - VECCOPY(no, efa->n); - if (efa->v4 == NULL) { - bevel_displace_vec(vec, v1, v2, v3, d, no); - VECCOPY(efa->v2->co, vec); - bevel_displace_vec(vec, v2, v3, v1, d, no); - VECCOPY(efa->v3->co, vec); - bevel_displace_vec(vec, v3, v1, v2, d, no); - VECCOPY(efa->v1->co, vec); - - fix_bevel_tri_wrap(v1, v2, v3, efa->v1->co, efa->v2->co, efa->v3->co, no); - } else { - VECCOPY(v4, efa->v4->co); - bevel_displace_vec(vec, v1, v2, v3, d, no); - VECCOPY(efa->v2->co, vec); - bevel_displace_vec(vec, v2, v3, v4, d, no); - VECCOPY(efa->v3->co, vec); - bevel_displace_vec(vec, v3, v4, v1, d, no); - VECCOPY(efa->v4->co, vec); - bevel_displace_vec(vec, v4, v1, v2, d, no); - VECCOPY(efa->v1->co, vec); - - fix_bevel_quad_wrap(v1, v2, v3, v4, efa->v1->co, efa->v2->co, efa->v3->co, efa->v4->co, d, no); - } - } - efa= efa->next; - } -} - -static void bevel_shrink_draw(float d, int flag) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - float vec[3], no[3], v1[3], v2[3], v3[3], v4[3], fv1[3], fv2[3], fv3[3], fv4[3]; - - /* move edges of all faces with efa->f1 & flag closer towards their centers */ - efa= em->faces.first; - while (efa) { - VECCOPY(v1, efa->v1->co); - VECCOPY(v2, efa->v2->co); - VECCOPY(v3, efa->v3->co); - VECCOPY(no, efa->n); - if (efa->v4 == NULL) { - bevel_displace_vec(vec, v1, v2, v3, d, no); - VECCOPY(fv2, vec); - bevel_displace_vec(vec, v2, v3, v1, d, no); - VECCOPY(fv3, vec); - bevel_displace_vec(vec, v3, v1, v2, d, no); - VECCOPY(fv1, vec); - - fix_bevel_tri_wrap(v1, v2, v3, fv1, fv2, fv3, no); - - glBegin(GL_LINES); - glVertex3fv(fv1); - glVertex3fv(fv2); - glEnd(); - glBegin(GL_LINES); - glVertex3fv(fv2); - glVertex3fv(fv3); - glEnd(); - glBegin(GL_LINES); - glVertex3fv(fv1); - glVertex3fv(fv3); - glEnd(); - } else { - VECCOPY(v4, efa->v4->co); - bevel_displace_vec(vec, v4, v1, v2, d, no); - VECCOPY(fv1, vec); - bevel_displace_vec(vec, v1, v2, v3, d, no); - VECCOPY(fv2, vec); - bevel_displace_vec(vec, v2, v3, v4, d, no); - VECCOPY(fv3, vec); - bevel_displace_vec(vec, v3, v4, v1, d, no); - VECCOPY(fv4, vec); - - fix_bevel_quad_wrap(v1, v2, v3, v4, fv1, fv2, fv3, fv4, d, no); - - glBegin(GL_LINES); - glVertex3fv(fv1); - glVertex3fv(fv2); - glEnd(); - glBegin(GL_LINES); - glVertex3fv(fv2); - glVertex3fv(fv3); - glEnd(); - glBegin(GL_LINES); - glVertex3fv(fv3); - glVertex3fv(fv4); - glEnd(); - glBegin(GL_LINES); - glVertex3fv(fv1); - glVertex3fv(fv4); - glEnd(); - } - efa= efa->next; - } -} - -static void bevel_mesh(float bsize, int allfaces) -{ - EditMesh *em = G.editMesh; -//#define BEV_DEBUG -/* Enables debug printfs and assigns material indices: */ -/* 2 = edge quad */ -/* 3 = fill polygon (vertex clusters) */ - - EditFace *efa, *example; //, *nextvl; - EditEdge *eed, *eed2; - EditVert *neweve[1024], *eve, *eve2, *eve3, *v1, *v2, *v3, *v4; //, *eve4; - //short found4, search; - //float f1, f2, f3, f4; - float cent[3], min[3], max[3]; - int a, b, c; - float limit= 0.001f; - - if(multires_test()) return; - - waitcursor(1); - - removedoublesflag(1, 0, limit); - - /* tag all original faces */ - efa= em->faces.first; - while (efa) { - efa->f1= 0; - if (faceselectedAND(efa, 1)||allfaces) { - efa->f1= 1; - efa->v1->f |= 128; - efa->v2->f |= 128; - efa->v3->f |= 128; - if (efa->v4) efa->v4->f |= 128; - } - efa->v1->f &= ~64; - efa->v2->f &= ~64; - efa->v3->f &= ~64; - if (efa->v4) efa->v4->f &= ~64; - - efa= efa->next; - } - -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: split\n"); -#endif - - efa= em->faces.first; - while (efa) { - if (efa->f1 & 1) { - efa->f1-= 1; - v1= addvertlist(efa->v1->co, efa->v1); - v1->f= efa->v1->f & ~128; - efa->v1->tmp.v = v1; - - v1= addvertlist(efa->v2->co, efa->v2); - v1->f= efa->v2->f & ~128; - efa->v2->tmp.v = v1; - - v1= addvertlist(efa->v3->co, efa->v3); - v1->f= efa->v3->f & ~128; - efa->v3->tmp.v = v1; - - if (efa->v4) { - v1= addvertlist(efa->v4->co, efa->v4); - v1->f= efa->v4->f & ~128; - efa->v4->tmp.v = v1; - } - - /* Needs better adaption of creases? */ - addedgelist(efa->e1->v1->tmp.v, - efa->e1->v2->tmp.v, - efa->e1); - addedgelist(efa->e2->v1->tmp.v, - efa->e2->v2->tmp.v, - efa->e2); - addedgelist(efa->e3->v1->tmp.v, - efa->e3->v2->tmp.v, - efa->e3); - if (efa->e4) addedgelist(efa->e4->v1->tmp.v, - efa->e4->v2->tmp.v, - efa->e4); - - if(efa->v4) { - v1 = efa->v1->tmp.v; - v2 = efa->v2->tmp.v; - v3 = efa->v3->tmp.v; - v4 = efa->v4->tmp.v; - addfacelist(v1, v2, v3, v4, efa,NULL); - } else { - v1= efa->v1->tmp.v; - v2= efa->v2->tmp.v; - v3= efa->v3->tmp.v; - addfacelist(v1, v2, v3, 0, efa,NULL); - } - - efa= efa-> next; - } else { - efa= efa->next; - } - } - - for(efa= em->faces.first; efa; efa= efa->next) { - if( (efa->v1->f & 128) && (efa->v2->f & 128) && (efa->v3->f & 128) ) { - if(efa->v4==NULL || (efa->v4->f & 128)) efa->f |= 128; - } - } - - delfaceflag(128); // works with face flag now - - /* tag all faces for shrink*/ - efa= em->faces.first; - while (efa) { - if (faceselectedAND(efa, 1)||allfaces) { - efa->f1= 2; - } - efa= efa->next; - } - -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: make edge quads\n"); -#endif - - /* find edges that are on each other and make quads between them */ - - eed= em->edges.first; - while(eed) { - eed->f2= eed->f1= 0; - if ( ((eed->v1->f & eed->v2->f) & 1) || allfaces) - eed->f1 |= 4; /* original edges */ - eed->tmp.v = 0; - eed= eed->next; - } - - eed= em->edges.first; - while (eed) { - if ( ((eed->f1 & 2)==0) && (eed->f1 & 4) ) { - eed2= em->edges.first; - while (eed2) { - if ( (eed2 != eed) && ((eed2->f1 & 2)==0) && (eed->f1 & 4) ) { - if ( - (eed->v1 != eed2->v1) && - (eed->v1 != eed2->v2) && - (eed->v2 != eed2->v1) && - (eed->v2 != eed2->v2) && ( - ( VecCompare(eed->v1->co, eed2->v1->co, limit) && - VecCompare(eed->v2->co, eed2->v2->co, limit) ) || - ( VecCompare(eed->v1->co, eed2->v2->co, limit) && - VecCompare(eed->v2->co, eed2->v1->co, limit) ) ) ) - { - -#ifdef BEV_DEBUG - fprintf(stderr, "bevel_mesh: edge quad\n"); -#endif - - eed->f1 |= 2; /* these edges are finished */ - eed2->f1 |= 2; - - example= NULL; - efa= em->faces.first; /* search example face (for mat_nr, ME_SMOOTH, ...) */ - while (efa) { - if ( (efa->e1 == eed) || - (efa->e2 == eed) || - (efa->e3 == eed) || - (efa->e4 && (efa->e4 == eed)) ) { - example= efa; - efa= NULL; - } - if (efa) efa= efa->next; - } - - neweve[0]= eed->v1; neweve[1]= eed->v2; - neweve[2]= eed2->v1; neweve[3]= eed2->v2; - - if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) { - efa= NULL; - - if (VecCompare(eed->v1->co, eed2->v2->co, limit)) { - efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], example,NULL); - } else { - efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], example,NULL); - } - - if(efa) { - float inp; - CalcNormFloat(efa->v1->co, efa->v2->co, efa->v3->co, efa->n); - inp= efa->n[0]*G.vd->viewmat[0][2] + efa->n[1]*G.vd->viewmat[1][2] + efa->n[2]*G.vd->viewmat[2][2]; - if(inp < 0.0) flipface(efa); -#ifdef BEV_DEBUG - efa->mat_nr= 1; -#endif - } else fprintf(stderr,"bevel_mesh: error creating face\n"); - } - eed2= NULL; - } - } - if (eed2) eed2= eed2->next; - } - } - eed= eed->next; - } - - eed= em->edges.first; - while(eed) { - eed->f2= eed->f1= 0; - eed->f1= 0; - eed->v1->f1 &= ~1; - eed->v2->f1 &= ~1; - eed->tmp.v = 0; - eed= eed->next; - } - -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: find clusters\n"); -#endif - - /* Look for vertex clusters */ - - eve= em->verts.first; - while (eve) { - eve->f &= ~(64|128); - eve->tmp.v = NULL; - eve= eve->next; - } - - /* eve->f: 128: first vertex in a list (->tmp.v) */ - /* 64: vertex is in a list */ - - eve= em->verts.first; - while (eve) { - eve2= em->verts.first; - eve3= NULL; - while (eve2) { - if ((eve2 != eve) && ((eve2->f & (64|128))==0)) { - if (VecCompare(eve->co, eve2->co, limit)) { - if ((eve->f & (128|64)) == 0) { - /* fprintf(stderr,"Found vertex cluster:\n *\n *\n"); */ - eve->f |= 128; - eve->tmp.v = eve2; - eve3= eve2; - } else if ((eve->f & 64) == 0) { - /* fprintf(stderr," *\n"); */ - if (eve3) eve3->tmp.v = eve2; - eve2->f |= 64; - eve3= eve2; - } - } - } - eve2= eve2->next; - if (!eve2) { - if (eve3) eve3->tmp.v = NULL; - } - } - eve= eve->next; - } - -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: shrink faces\n"); -#endif - - bevel_shrink_faces(bsize, 2); - -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: fill clusters\n"); -#endif - - /* Make former vertex clusters faces */ - - eve= em->verts.first; - while (eve) { - eve->f &= ~64; - eve= eve->next; - } - - eve= em->verts.first; - while (eve) { - if (eve->f & 128) { - eve->f &= ~128; - a= 0; - neweve[a]= eve; - eve2 = eve->tmp.v; - while (eve2) { - a++; - neweve[a]= eve2; - eve2 = eve2->tmp.v; - } - a++; - efa= NULL; - if (a>=3) { - example= NULL; - efa= em->faces.first; /* search example face */ - while (efa) { - if ( (efa->v1 == neweve[0]) || - (efa->v2 == neweve[0]) || - (efa->v3 == neweve[0]) || - (efa->v4 && (efa->v4 == neweve[0])) ) { - example= efa; - efa= NULL; - } - if (efa) efa= efa->next; - } -#ifdef BEV_DEBUG - fprintf(stderr,"bevel_mesh: Making %d-gon\n", a); -#endif - if (a>4) { - cent[0]= cent[1]= cent[2]= 0.0; - INIT_MINMAX(min, max); - for (b=0; bco); - DO_MINMAX(neweve[b]->co, min, max); - } - cent[0]= (min[0]+max[0])/2; - cent[1]= (min[1]+max[1])/2; - cent[2]= (min[2]+max[2])/2; - eve2= addvertlist(cent, NULL); - eve2->f |= 1; - eed= em->edges.first; - while (eed) { - c= 0; - for (b=0; bv1) || (neweve[b]==eed->v2)) c++; - if (c==2) { - if(exist_face(eed->v1, eed->v2, eve2, 0)==0) { - efa= addfacelist(eed->v1, eed->v2, eve2, 0, example,NULL); -#ifdef BEV_DEBUG - efa->mat_nr= 2; -#endif - } - } - eed= eed->next; - } - } else if (a==4) { - if(exist_face(neweve[0], neweve[1], neweve[2], neweve[3])==0) { - /* the order of vertices can be anything, three cases to check */ - if( convex(neweve[0]->co, neweve[1]->co, neweve[2]->co, neweve[3]->co) ) { - efa= addfacelist(neweve[0], neweve[1], neweve[2], neweve[3], NULL, NULL); - } - else if( convex(neweve[0]->co, neweve[2]->co, neweve[3]->co, neweve[1]->co) ) { - efa= addfacelist(neweve[0], neweve[2], neweve[3], neweve[1], NULL, NULL); - } - else if( convex(neweve[0]->co, neweve[2]->co, neweve[1]->co, neweve[3]->co) ) { - efa= addfacelist(neweve[0], neweve[2], neweve[1], neweve[3], NULL, NULL); - } - } - } - else if (a==3) { - if(exist_face(neweve[0], neweve[1], neweve[2], 0)==0) - efa= addfacelist(neweve[0], neweve[1], neweve[2], 0, example, NULL); - } - if(efa) { - float inp; - CalcNormFloat(neweve[0]->co, neweve[1]->co, neweve[2]->co, efa->n); - inp= efa->n[0]*G.vd->viewmat[0][2] + efa->n[1]*G.vd->viewmat[1][2] + efa->n[2]*G.vd->viewmat[2][2]; - if(inp < 0.0) flipface(efa); -#ifdef BEV_DEBUG - efa->mat_nr= 2; -#endif - } - } - } - eve= eve->next; - } - - eve= em->verts.first; - while (eve) { - eve->f1= 0; - eve->f &= ~(128|64); - eve->tmp.v= NULL; - eve= eve->next; - } - - recalc_editnormals(); - waitcursor(0); - countall(); - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - removedoublesflag(1, 0, limit); - - /* flush selected vertices to edges/faces */ - EM_select_flush(); - -#undef BEV_DEBUG -} - -static void bevel_mesh_recurs(float bsize, short recurs, int allfaces) -{ - float d; - short nr; - - d= bsize; - for (nr=0; nrofs[0], -G.vd->ofs[1], -G.vd->ofs[2]); - window_to_3d(center, mval[0], mval[1]); - - if(button(&recurs, 1, 4, "Recursion:")==0) return; - - for (nr=0; nrobmat); - - glColor3ub(255, 255, 0); - - // PREVIEW CODE GOES HERE - bevel_shrink_draw(drawd, 2); - - /* restore matrix transform */ - glPopMatrix(); - - sprintf(str, "Bevel Size: %.4f LMB to confirm, RMB to cancel, SPACE to input directly.", drawd); - headerprint(str); - - /* this also verifies other area/windows for clean swap */ - screen_swapbuffers(); - - persp(PERSP_WIN); - - glDrawBuffer(GL_FRONT); - - BIF_ThemeColor(TH_WIRE); - - setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(mval); - glVertex2sv(oval); - glEnd(); - setlinestyle(0); - - persp(PERSP_VIEW); - bglFlush(); // flush display for frontbuffer - glDrawBuffer(GL_BACK); - } - while(qtest()) { - short val=0; - event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle - - /* val==0 on key-release event */ - if(val && (event==ESCKEY || event==RIGHTMOUSE || event==LEFTMOUSE || event==RETKEY || event==ESCKEY)) { - if (event==RIGHTMOUSE || event==ESCKEY) - Canceled = 1; - Finished = 1; - } - else if (val && event==SPACEKEY) { - if (fbutton(&d, 0.000, 10.000, 10, 0, "Width:")!=0) { - drawd = d * fac; - Finished = 1; - } - } - else if (val) { - /* On any other keyboard event, recalc */ - Recalc = 1; - } - - } - } - if (Canceled==0) { - SetBlenderCursor(BC_WAITCURSOR); - bevel_mesh_recurs(drawd/fac, recurs, 1); - righthandfaces(1); - SetBlenderCursor(SYSCURSOR); - BIF_undo_push("Bevel"); - } -} - -/* *********** END BEVEL *********/ - -typedef struct SlideVert { - EditEdge *up,*down; - EditVert origvert; -} SlideVert; - -int EdgeLoopDelete(void) { - if(!EdgeSlide(1, 1)) { - return 0; - } - select_more(); - removedoublesflag(1,0, 0.001); - EM_select_flush(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - return 1; -} - -int EdgeSlide(short immediate, float imperc) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditEdge *eed,*first=NULL,*last=NULL, *temp = NULL; - EditVert *ev, *nearest; - LinkNode *edgelist = NULL, *vertlist=NULL, *look; - GHash *vertgh; - SlideVert *tempsv; - float perc = 0, percp = 0,vertdist, projectMat[4][4], viewMat[4][4]; - float shiftlabda= 0.0f,len = 0.0f; - int i = 0,j, numsel, numadded=0, timesthrough = 0, vertsel=0, prop=1, cancel = 0,flip=0; - int wasshift = 0; - short event, draw=1; - short mval[2], mvalo[2]; - char str[128]; - float labda = 0.0f; - - view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat); - - mvalo[0] = -1; mvalo[1] = -1; - numsel =0; - - // Get number of selected edges and clear some flags - for(eed=em->edges.first;eed;eed=eed->next) { - eed->f1 = 0; - eed->f2 = 0; - if(eed->f & SELECT) numsel++; - } - - for(ev=em->verts.first;ev;ev=ev->next) { - ev->f1 = 0; - } - - //Make sure each edge only has 2 faces - // make sure loop doesn't cross face - for(efa=em->faces.first;efa;efa=efa->next) { - int ct = 0; - if(efa->e1->f & SELECT) { - ct++; - efa->e1->f1++; - if(efa->e1->f1 > 2) { - error("3+ face edge"); - return 0; - } - } - if(efa->e2->f & SELECT) { - ct++; - efa->e2->f1++; - if(efa->e2->f1 > 2) { - error("3+ face edge"); - return 0; - } - } - if(efa->e3->f & SELECT) { - ct++; - efa->e3->f1++; - if(efa->e3->f1 > 2) { - error("3+ face edge"); - return 0; - } - } - if(efa->e4 && efa->e4->f & SELECT) { - ct++; - efa->e4->f1++; - if(efa->e4->f1 > 2) { - error("3+ face edge"); - return 0; - } - } - // Make sure loop is not 2 edges of same face - if(ct > 1) { - error("loop crosses itself"); - return 0; - } - } - // Get # of selected verts - for(ev=em->verts.first;ev;ev=ev->next) { - if(ev->f & SELECT) vertsel++; - } - - // Test for multiple segments - if(vertsel > numsel+1) { - error("Was not a single edge loop"); - return 0; - } - - // Get the edgeloop in order - mark f1 with SELECT once added - for(eed=em->edges.first;eed;eed=eed->next) { - if((eed->f & SELECT) && !(eed->f1 & SELECT)) { - // If this is the first edge added, just put it in - if(!edgelist) { - BLI_linklist_prepend(&edgelist,eed); - numadded++; - first = eed; - last = eed; - eed->f1 = SELECT; - } else { - if(editedge_getSharedVert(eed, last)) { - BLI_linklist_append(&edgelist,eed); - eed->f1 = SELECT; - numadded++; - last = eed; - } else if(editedge_getSharedVert(eed, first)) { - BLI_linklist_prepend(&edgelist,eed); - eed->f1 = SELECT; - numadded++; - first = eed; - } - } - } - if(eed->next == NULL && numadded != numsel) { - eed=em->edges.first; - timesthrough++; - } - - // It looks like there was an unexpected case - Hopefully should not happen - if(timesthrough >= numsel*2) { - BLI_linklist_free(edgelist,NULL); - error("could not order loop"); - return 0; - } - } - - // Put the verts in order in a linklist - look = edgelist; - while(look) { - eed = look->link; - if(!vertlist) { - if(look->next) { - temp = look->next->link; - - //This is the first entry takes care of extra vert - if(eed->v1 != temp->v1 && eed->v1 != temp->v2) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } else { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } - } else { - //This is the case that we only have 1 edge - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } - } - // for all the entries - if(eed->v1->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v1); - eed->v1->f1 = 1; - } else if(eed->v2->f1 != 1) { - BLI_linklist_append(&vertlist,eed->v2); - eed->v2->f1 = 1; - } - look = look->next; - } - - // populate the SlideVerts - - vertgh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp); - look = vertlist; - while(look) { - i=0; - j=0; - ev = look->link; - tempsv = (struct SlideVert*)MEM_mallocN(sizeof(struct SlideVert),"SlideVert"); - tempsv->up = NULL; - tempsv->down = NULL; - tempsv->origvert.co[0] = ev->co[0]; - tempsv->origvert.co[1] = ev->co[1]; - tempsv->origvert.co[2] = ev->co[2]; - tempsv->origvert.no[0] = ev->no[0]; - tempsv->origvert.no[1] = ev->no[1]; - tempsv->origvert.no[2] = ev->no[2]; - // i is total edges that vert is on - // j is total selected edges that vert is on - - for(eed=em->edges.first;eed;eed=eed->next) { - if(eed->v1 == ev || eed->v2 == ev) { - i++; - if(eed->f & SELECT) { - j++; - } - } - } - // If the vert is in the middle of an edge loop, it touches 2 selected edges and 2 unselected edges - if(i == 4 && j == 2) { - for(eed=em->edges.first;eed;eed=eed->next) { - if(editedge_containsVert(eed, ev)) { - if(!(eed->f & SELECT)) { - if(!tempsv->up) { - tempsv->up = eed; - } else if (!(tempsv->down)) { - tempsv->down = eed; - } - } - } - } - } - // If it is on the end of the loop, it touches 1 selected and as least 2 more unselected - if(i >= 3 && j == 1) { - for(eed=em->edges.first;eed;eed=eed->next) { - if(editedge_containsVert(eed, ev) && eed->f & SELECT) { - for(efa = em->faces.first;efa;efa=efa->next) { - if(editface_containsEdge(efa, eed)) { - if(editedge_containsVert(efa->e1, ev) && efa->e1 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e1; - } else if (!(tempsv->down)) { - tempsv->down = efa->e1; - } - } - if(editedge_containsVert(efa->e2, ev) && efa->e2 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e2; - } else if (!(tempsv->down)) { - tempsv->down = efa->e2; - } - } - if(editedge_containsVert(efa->e3, ev) && efa->e3 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e3; - } else if (!(tempsv->down)) { - tempsv->down = efa->e3; - } - } - if(efa->e4) { - if(editedge_containsVert(efa->e4, ev) && efa->e4 != eed) { - if(!tempsv->up) { - tempsv->up = efa->e4; - } else if (!(tempsv->down)) { - tempsv->down = efa->e4; - } - } - } - - } - } - } - } - } - if(i > 4 && j == 2) { - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - return 0; - } - BLI_ghash_insert(vertgh,ev,tempsv); - - look = look->next; - } - - // make sure the UPs nad DOWNs are 'faceloops' - // Also find the nearest slidevert to the cursor - getmouseco_areawin(mval); - look = vertlist; - nearest = NULL; - vertdist = -1; - while(look) { - if(look->next != NULL) { - SlideVert *sv; - - tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - sv = BLI_ghash_lookup(vertgh,(EditVert*)look->next->link); - - if(!tempsv->up || !tempsv->down) { - error("Missing rails"); - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - return 0; - } - - if(G.f & G_DRAW_EDGELEN) { - if(!(tempsv->up->f & SELECT)) { - tempsv->up->f |= SELECT; - tempsv->up->f2 |= 16; - } else { - tempsv->up->f2 |= ~16; - } - if(!(tempsv->down->f & SELECT)) { - tempsv->down->f |= SELECT; - tempsv->down->f2 |= 16; - } else { - tempsv->down->f2 |= ~16; - } - } - - if(sv) { - float tempdist, co[2]; - - if(!sharesFace(tempsv->up,sv->up)) { - EditEdge *swap; - swap = sv->up; - sv->up = sv->down; - sv->down = swap; - } - - view3d_project_float(curarea, tempsv->origvert.co, co, projectMat); - - tempdist = sqrt(pow(co[0] - mval[0],2)+pow(co[1] - mval[1],2)); - - if(vertdist < 0) { - vertdist = tempdist; - nearest = (EditVert*)look->link; - } else if ( tempdist < vertdist ) { - vertdist = tempdist; - nearest = (EditVert*)look->link; - } - } - } - - - - look = look->next; - } - // we should have enough info now to slide - - len = 0.0f; - - percp = -1; - while(draw) { - /* For the % calculation */ - short mval[2]; - float rc[2]; - float v2[2], v3[2]; - EditVert *centerVert, *upVert, *downVert; - - - - getmouseco_areawin(mval); - - if (!immediate && (mval[0] == mvalo[0] && mval[1] == mvalo[1])) { - PIL_sleep_ms(10); - } else { - - mvalo[0] = mval[0]; - mvalo[1] = mval[1]; - - //Adjust Edgeloop - if(immediate) { - perc = imperc; - } - percp = perc; - if(prop) { - look = vertlist; - while(look) { - EditVert *tempev; - ev = look->link; - tempsv = BLI_ghash_lookup(vertgh,ev); - - tempev = editedge_getOtherVert((perc>=0)?tempsv->up:tempsv->down, ev); - VecLerpf(ev->co, tempsv->origvert.co, tempev->co, fabs(perc)); - - look = look->next; - } - } - else { - //Non prop code - look = vertlist; - while(look) { - float newlen; - ev = look->link; - tempsv = BLI_ghash_lookup(vertgh,ev); - newlen = (len / VecLenf(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co)); - if(newlen > 1.0) {newlen = 1.0;} - if(newlen < 0.0) {newlen = 0.0;} - if(flip == 0) { - VecLerpf(ev->co, editedge_getOtherVert(tempsv->down,ev)->co, editedge_getOtherVert(tempsv->up,ev)->co, fabs(newlen)); - } else{ - VecLerpf(ev->co, editedge_getOtherVert(tempsv->up,ev)->co, editedge_getOtherVert(tempsv->down,ev)->co, fabs(newlen)); - } - look = look->next; - } - - } - - tempsv = BLI_ghash_lookup(vertgh,nearest); - - centerVert = editedge_getSharedVert(tempsv->up, tempsv->down); - upVert = editedge_getOtherVert(tempsv->up, centerVert); - downVert = editedge_getOtherVert(tempsv->down, centerVert); - // Highlight the Control Edges - - scrarea_do_windraw(curarea); - persp(PERSP_VIEW); - glPushMatrix(); - mymultmatrix(G.obedit->obmat); - - glColor3ub(0, 255, 0); - glBegin(GL_LINES); - glVertex3fv(upVert->co); - glVertex3fv(downVert->co); - glEnd(); - - if(prop == 0) { - // draw start edge for non-prop - glPointSize(5); - glBegin(GL_POINTS); - glColor3ub(255,0,255); - if(flip) { - glVertex3fv(upVert->co); - } else { - glVertex3fv(downVert->co); - } - glEnd(); - } - - - glPopMatrix(); - - view3d_project_float(curarea, upVert->co, v2, projectMat); - view3d_project_float(curarea, downVert->co, v3, projectMat); - - /* Determine the % on which the loop should be cut */ - - rc[0]= v3[0]-v2[0]; - rc[1]= v3[1]-v2[1]; - len= rc[0]*rc[0]+ rc[1]*rc[1]; - if (len==0) {len = 0.0001;} - - if ((G.qual & LR_SHIFTKEY)==0) { - wasshift = 0; - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len; - } - else { - if (wasshift==0) { - wasshift = 1; - shiftlabda = labda; - } - labda= ( rc[0]*((mval[0]-v2[0])) + rc[1]*((mval[1]-v2[1])) )/len / 10.0 + shiftlabda; - } - - - if(labda<=0.0) labda=0.0; - else if(labda>=1.0)labda=1.0; - - perc=((1-labda)*2)-1; - - if(G.qual == 0) { - perc *= 100; - perc = floor(perc); - perc /= 100; - } else if (G.qual == LR_CTRLKEY) { - perc *= 10; - perc = floor(perc); - perc /= 10; - } - if(prop) { - sprintf(str, "(P)ercentage: %f", perc); - } else { - len = VecLenf(upVert->co,downVert->co)*((perc+1)/2); - if(flip == 1) { - len = VecLenf(upVert->co,downVert->co) - len; - } - sprintf(str, "Non (P)rop Length: %f, Press (F) to flip control side", len); - } - - - - headerprint(str); - screen_swapbuffers(); - } - if(!immediate) { - while(qtest()) { - short val=0; - event= extern_qread(&val); // extern_qread stores important events for the mainloop to handle - - /* val==0 on key-release event */ - if (val) { - if(ELEM(event, ESCKEY, RIGHTMOUSE)) { - prop = 1; // Go back to prop mode - imperc = 0; // This is the % that gets set for immediate - immediate = 1; //Run through eval code 1 more time - cancel = 1; // Return -1 - mvalo[0] = -1; - } else if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)) { - draw = 0; // End looping now - } else if(event==MIDDLEMOUSE) { - perc = 0; - immediate = 1; - } else if(event==PKEY) { - (prop == 1) ? (prop = 0):(prop = 1); - mvalo[0] = -1; - } else if(event==FKEY) { - (flip == 1) ? (flip = 0):(flip = 1); - mvalo[0] = -1; - } else if(ELEM(event, RIGHTARROWKEY, WHEELUPMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { - if(nearest == (EditVert*)look->link) { - if(look->next == NULL) { - nearest = (EditVert*)vertlist->link; - } else { - nearest = (EditVert*)look->next->link; - } - mvalo[0] = -1; - break; - } - look = look->next; - } - } else if(ELEM(event, LEFTARROWKEY, WHEELDOWNMOUSE)) { // Scroll through Control Edges - look = vertlist; - while(look) { - if(look->next) { - if(look->next->link == nearest) { - nearest = (EditVert*)look->link; - mvalo[0] = -1; - break; - } - } else { - if((EditVert*)vertlist->link == nearest) { - nearest = look->link; - mvalo[0] = -1; - break; - } - } - look = look->next; - } - } - } - } - } else { - draw = 0; - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - - - if(G.f & G_DRAW_EDGELEN) { - look = vertlist; - while(look) { - tempsv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); - if(tempsv != NULL) { - tempsv->up->f &= !SELECT; - tempsv->down->f &= !SELECT; - } - look = look->next; - } - } - - force_draw(0); - - EM_automerge(0); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - scrarea_queue_winredraw(curarea); - - //BLI_ghash_free(edgesgh, freeGHash, NULL); - BLI_ghash_free(vertgh, NULL, (GHashValFreeFP)MEM_freeN); - BLI_linklist_free(vertlist,NULL); - BLI_linklist_free(edgelist,NULL); - - if(cancel == 1) { - return -1; - } - else { -#ifdef WITH_VERSE - if(G.editMesh->vnode) { - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); - } -#endif - } - return 1; -} - -/* -------------------- More tools ------------------ */ - -void mesh_set_face_flags(short mode) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - short m_tex=0, m_tiles=0, m_shared=0, m_light=0, m_invis=0, m_collision=0, m_twoside=0, m_obcolor=0; - short flag = 0, change = 0; - - if (!EM_texFaceCheck()) { - error("not a mesh with uv/image layers"); - return; - } - - add_numbut(0, TOG|SHO, "Texture", 0, 0, &m_tex, NULL); - add_numbut(1, TOG|SHO, "Tiles", 0, 0, &m_tiles, NULL); - add_numbut(2, TOG|SHO, "Shared", 0, 0, &m_shared, NULL); - add_numbut(3, TOG|SHO, "Light", 0, 0, &m_light, NULL); - add_numbut(4, TOG|SHO, "Invisible", 0, 0, &m_invis, NULL); - add_numbut(5, TOG|SHO, "Collision", 0, 0, &m_collision, NULL); - add_numbut(6, TOG|SHO, "Twoside", 0, 0, &m_twoside, NULL); - add_numbut(7, TOG|SHO, "ObColor", 0, 0, &m_obcolor, NULL); - - if (!do_clever_numbuts((mode ? "Set Flags" : "Clear Flags"), 8, REDRAW)) - return; - - if (m_tex) flag |= TF_TEX; - if (m_tiles) flag |= TF_TILES; - if (m_shared) flag |= TF_SHAREDCOL; - if (m_light) flag |= TF_LIGHT; - if (m_invis) flag |= TF_INVISIBLE; - if (m_collision) flag |= TF_DYNAMIC; - if (m_twoside) flag |= TF_TWOSIDE; - if (m_obcolor) flag |= TF_OBCOL; - - efa= em->faces.first; - while(efa) { - if(efa->f & SELECT) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (mode) tface->mode |= flag; - else tface->mode &= ~flag; - } - efa= efa->next; - } - - if (change) { - BIF_undo_push((mode ? "Set Flags" : "Clear Flags")); - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - } -} - -void mesh_set_smooth_faces(short event) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - if(G.obedit==0) return; - - if(G.obedit->type != OB_MESH) return; - - efa= em->faces.first; - while(efa) { - if(efa->f & SELECT) { - if(event==1) efa->flag |= ME_SMOOTH; - else if(event==0) efa->flag &= ~ME_SMOOTH; - } - efa= efa->next; - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - - if(event==1) BIF_undo_push("Set Smooth"); - else if(event==0) BIF_undo_push("Set Solid"); -} - -/* helper to find edge for edge_rip */ -static float mesh_rip_edgedist(float mat[][4], float *co1, float *co2, short *mval) -{ - float vec1[3], vec2[3], mvalf[2]; - - view3d_project_float(curarea, co1, vec1, mat); - view3d_project_float(curarea, co2, vec2, mat); - mvalf[0]= (float)mval[0]; - mvalf[1]= (float)mval[1]; - - return PdistVL2Dfl(mvalf, vec1, vec2); -} - -/* helper for below */ -static void mesh_rip_setface(EditFace *sefa) -{ - /* put new vertices & edges in best face */ - if(sefa->v1->tmp.v) sefa->v1= sefa->v1->tmp.v; - if(sefa->v2->tmp.v) sefa->v2= sefa->v2->tmp.v; - if(sefa->v3->tmp.v) sefa->v3= sefa->v3->tmp.v; - if(sefa->v4 && sefa->v4->tmp.v) sefa->v4= sefa->v4->tmp.v; - - sefa->e1= addedgelist(sefa->v1, sefa->v2, sefa->e1); - sefa->e2= addedgelist(sefa->v2, sefa->v3, sefa->e2); - if(sefa->v4) { - sefa->e3= addedgelist(sefa->v3, sefa->v4, sefa->e3); - sefa->e4= addedgelist(sefa->v4, sefa->v1, sefa->e4); - } - else - sefa->e3= addedgelist(sefa->v3, sefa->v1, sefa->e3); - -} - -/* based on mouse cursor position, it defines how is being ripped */ -void mesh_rip(void) -{ - extern void faceloop_select(EditEdge *startedge, int select); - EditMesh *em = G.editMesh; - EditVert *eve, *nextve; - EditEdge *eed, *seed= NULL; - EditFace *efa, *sefa= NULL; - float projectMat[4][4], viewMat[4][4], vec[3], dist, mindist; - short doit= 1, mval[2],propmode,prop; - - propmode = G.scene->prop_mode; - G.scene->prop_mode = 0; - prop = G.scene->proportional; - G.scene->proportional = 0; - - /* select flush... vertices are important */ - EM_selectmode_set(); - - getmouseco_areawin(mval); - view3d_get_object_project_mat(curarea, G.obedit, projectMat, viewMat); - - /* find best face, exclude triangles and break on face select or faces with 2 edges select */ - mindist= 1000000.0f; - for(efa= em->faces.first; efa; efa=efa->next) { - if( efa->f & 1) - break; - if(efa->v4 && faceselectedOR(efa, SELECT) ) { - int totsel=0; - - if(efa->e1->f & SELECT) totsel++; - if(efa->e2->f & SELECT) totsel++; - if(efa->e3->f & SELECT) totsel++; - if(efa->e4->f & SELECT) totsel++; - - if(totsel>1) - break; - view3d_project_float(curarea, efa->cent, vec, projectMat); - dist= sqrt( (vec[0]-mval[0])*(vec[0]-mval[0]) + (vec[1]-mval[1])*(vec[1]-mval[1]) ); - if(distverts.last; eve; eve= eve->prev) { - eve->tmp.v = NULL; - if(eve->f & SELECT) { - eve->tmp.v = addvertlist(eve->co, eve); - eve->f &= ~SELECT; - eve->tmp.v->f |= SELECT; - } - } - - /* find the best candidate edge */ - /* or one of sefa edges is selected... */ - if(sefa->e1->f & SELECT) seed= sefa->e2; - if(sefa->e2->f & SELECT) seed= sefa->e1; - if(sefa->e3->f & SELECT) seed= sefa->e2; - if(sefa->e4 && sefa->e4->f & SELECT) seed= sefa->e3; - - /* or we do the distance trick */ - if(seed==NULL) { - mindist= 1000000.0f; - if(sefa->e1->v1->tmp.v || sefa->e1->v2->tmp.v) { - dist = mesh_rip_edgedist(projectMat, - sefa->e1->v1->co, - sefa->e1->v2->co, mval); - if(diste1; - mindist= dist; - } - } - if(sefa->e2->v1->tmp.v || sefa->e2->v2->tmp.v) { - dist = mesh_rip_edgedist(projectMat, - sefa->e2->v1->co, - sefa->e2->v2->co, mval); - if(diste2; - mindist= dist; - } - } - if(sefa->e3->v1->tmp.v || sefa->e3->v2->tmp.v) { - dist= mesh_rip_edgedist(projectMat, - sefa->e3->v1->co, - sefa->e3->v2->co, mval); - if(diste3; - mindist= dist; - } - } - if(sefa->e4 && (sefa->e4->v1->tmp.v || sefa->e4->v2->tmp.v)) { - dist= mesh_rip_edgedist(projectMat, - sefa->e4->v1->co, - sefa->e4->v2->co, mval); - if(diste4; - mindist= dist; - } - } - } - - if(seed==NULL) { // never happens? - error("No proper edge found to start"); - return; - } - - faceloop_select(seed, 2); // tmp abuse for finding all edges that need duplicated, returns OK faces with f1 - - /* duplicate edges in the loop, with at least 1 vertex selected, needed for selection flip */ - for(eed = em->edges.last; eed; eed= eed->prev) { - eed->tmp.v = NULL; - if((eed->v1->tmp.v) || (eed->v2->tmp.v)) { - EditEdge *newed; - - newed= addedgelist(eed->v1->tmp.v?eed->v1->tmp.v:eed->v1, - eed->v2->tmp.v?eed->v2->tmp.v:eed->v2, eed); - if(eed->f & SELECT) { - eed->f &= ~SELECT; - newed->f |= SELECT; - } - eed->tmp.v = (EditVert *)newed; - } - } - - /* first clear edges to help finding neighbours */ - for(eed = em->edges.last; eed; eed= eed->prev) eed->f1= 0; - - /* put new vertices & edges && flag in best face */ - mesh_rip_setface(sefa); - - /* starting with neighbours of best face, we loop over the seam */ - sefa->f1= 2; - doit= 1; - while(doit) { - doit= 0; - - for(efa= em->faces.first; efa; efa=efa->next) { - /* new vert in face */ - if (efa->v1->tmp.v || efa->v2->tmp.v || - efa->v3->tmp.v || (efa->v4 && efa->v4->tmp.v)) { - /* face is tagged with loop */ - if(efa->f1==1) { - mesh_rip_setface(efa); - efa->f1= 2; - doit= 1; - } - } - } - } - - /* remove loose edges, that were part of a ripped face */ - for(eve = em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(eed = em->edges.last; eed; eed= eed->prev) eed->f1= 0; - for(efa= em->faces.first; efa; efa=efa->next) { - efa->e1->f1= 1; - efa->e2->f1= 1; - efa->e3->f1= 1; - if(efa->e4) efa->e4->f1= 1; - } - - for(eed = em->edges.last; eed; eed= seed) { - seed= eed->prev; - if(eed->f1==0) { - if(eed->v1->tmp.v || eed->v2->tmp.v || - (eed->v1->f & SELECT) || (eed->v2->f & SELECT)) { - remedge(eed); - free_editedge(eed); - eed= NULL; - } - } - if(eed) { - eed->v1->f1= 1; - eed->v2->f1= 1; - } - } - - /* and remove loose selected vertices, that got duplicated accidentally */ - for(eve = em->verts.first; eve; eve= nextve) { - nextve= eve->next; - if(eve->f1==0 && (eve->tmp.v || (eve->f & SELECT))) { - BLI_remlink(&em->verts,eve); - free_editvert(eve); - } - } - - countall(); // apparently always needed when adding stuff, derived mesh - -#ifdef WITH_VERSE - if(G.editMesh->vnode) { - sync_all_verseverts_with_editverts((VNode*)G.editMesh->vnode); - sync_all_versefaces_with_editfaces((VNode*)G.editMesh->vnode); - } -#endif - - BIF_TransformSetUndo("Rip"); - initTransform(TFM_TRANSLATION, 0); - Transform(); - - G.scene->prop_mode = propmode; - G.scene->proportional = prop; -} - -void shape_propagate(){ - EditMesh *em = G.editMesh; - EditVert *ev = NULL; - Mesh* me = (Mesh*)G.obedit->data; - Key* ky = NULL; - KeyBlock* kb = NULL; - Base* base=NULL; - - - if(me->key){ - ky = me->key; - } else { - error("Object Has No Key"); - return; - } - - if(ky->block.first){ - for(ev = em->verts.first; ev ; ev = ev->next){ - if(ev->f & SELECT){ - for(kb=ky->block.first;kb;kb = kb->next){ - float *data; - data = kb->data; - VECCOPY(data+(ev->keyindex*3),ev->co); - } - } - } - } else { - error("Object Has No Blendshapes"); - return; - } - - //TAG Mesh Objects that share this data - for(base = G.scene->base.first; base; base = base->next){ - if(base->object && base->object->data == me){ - base->object->recalc = OB_RECALC_DATA; - } - } - - BIF_undo_push("Propagate Blendshape Verts"); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - return; -} - -void shape_copy_from_lerp(KeyBlock* thisBlock, KeyBlock* fromBlock) -{ - EditMesh *em = G.editMesh; - EditVert *ev = NULL; - short mval[2], curval[2], event = 0, finished = 0, canceled = 0, fullcopy=0 ; - float perc = 0; - char str[64]; - float *data, *odata; - - data = fromBlock->data; - odata = thisBlock->data; - - getmouseco_areawin(mval); - curval[0] = mval[0] + 1; curval[1] = mval[1] + 1; - - while (finished == 0) - { - getmouseco_areawin(mval); - if (mval[0] != curval[0] || mval[1] != curval[1]) - { - - if(mval[0] > curval[0]) - perc += 0.1; - else if(mval[0] < curval[0]) - perc -= 0.1; - - if(perc < 0) perc = 0; - if(perc > 1) perc = 1; - - curval[0] = mval[0]; - curval[1] = mval[1]; - - if(fullcopy == 1){ - perc = 1; - } - - for(ev = em->verts.first; ev ; ev = ev->next){ - if(ev->f & SELECT){ - VecLerpf(ev->co,odata+(ev->keyindex*3),data+(ev->keyindex*3),perc); - } - } - sprintf(str,"Blending at %d%c MMB to Copy at 100%c",(int)(perc*100),'%','%'); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - headerprint(str); - force_draw(0); - - if(fullcopy == 1){ - break; - } - - } else { - PIL_sleep_ms(10); - } - - while(qtest()) { - short val=0; - event= extern_qread(&val); - if(val){ - if(ELEM3(event, PADENTER, LEFTMOUSE, RETKEY)){ - finished = 1; - } - else if (event == MIDDLEMOUSE){ - fullcopy = 1; - } - else if (ELEM3(event,ESCKEY,RIGHTMOUSE,RIGHTMOUSE)){ - canceled = 1; - finished = 1; - } - } - } - } - if(!canceled) - BIF_undo_push("Copy Blendshape Verts"); - else - for(ev = em->verts.first; ev ; ev = ev->next){ - if(ev->f & SELECT){ - VECCOPY(ev->co, odata+(ev->keyindex*3)); - } - } - return; -} - - - -void shape_copy_select_from() -{ - Mesh* me = (Mesh*)G.obedit->data; - EditMesh *em = G.editMesh; - EditVert *ev = NULL; - int totverts = 0,curshape = G.obedit->shapenr; - - Key* ky = NULL; - KeyBlock *kb = NULL,*thisBlock = NULL; - int maxlen=32, nr=0, a=0; - char *menu; - - if(me->key){ - ky = me->key; - } else { - error("Object Has No Key"); - return; - } - - if(ky->block.first){ - for(kb=ky->block.first;kb;kb = kb->next){ - maxlen += 40; // Size of a block name - if(a == curshape-1){ - thisBlock = kb; - } - - a++; - } - a=0; - menu = MEM_callocN(maxlen, "Copy Shape Menu Text"); - strcpy(menu, "Copy Vert Positions from Shape %t|"); - for(kb=ky->block.first;kb;kb = kb->next){ - if(a != curshape-1){ - sprintf(menu,"%s %s %cx%d|",menu,kb->name,'%',a); - } - a++; - } - nr = pupmenu_col(menu, 20); - MEM_freeN(menu); - } else { - error("Object Has No Blendshapes"); - return; - } - - a = 0; - - for(kb=ky->block.first;kb;kb = kb->next){ - if(a == nr){ - - for(ev = em->verts.first;ev;ev = ev->next){ - totverts++; - } - - if(me->totvert != totverts){ - error("Shape Has had Verts Added/Removed, please cycle editmode before copying"); - return; - } - shape_copy_from_lerp(thisBlock,kb); - - return; - } - a++; - } - return; -} - -/* Collection Routines|Currently used by the improved merge code*/ -/* buildEdge_collection() creates a list of lists*/ -/* these lists are filled with edges that are topologically connected.*/ -/* This whole tool needs to be redone, its rather poorly implemented...*/ - -typedef struct Collection{ - struct Collection *next, *prev; - int index; - ListBase collectionbase; -} Collection; - -typedef struct CollectedEdge{ - struct CollectedEdge *next, *prev; - EditEdge *eed; -} CollectedEdge; - -#define MERGELIMIT 0.000001 - -static void build_edgecollection(ListBase *allcollections) -{ - EditEdge *eed; - Collection *edgecollection, *newcollection; - CollectedEdge *newedge; - - int currtag = 1; - short ebalanced = 0; - short collectionfound = 0; - - for (eed=G.editMesh->edges.first; eed; eed = eed->next){ - eed->tmp.l = 0; - eed->v1->tmp.l = 0; - eed->v2->tmp.l = 0; - } - - /*1st pass*/ - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(eed->f&SELECT){ - eed->v1->tmp.l = currtag; - eed->v2->tmp.l = currtag; - currtag +=1; - } - } - - /*2nd pass - Brute force. Loop through selected faces until there are no 'unbalanced' edges left (those with both vertices 'tmp.l' tag matching */ - while(ebalanced == 0){ - ebalanced = 1; - for(eed=G.editMesh->edges.first; eed; eed = eed->next){ - if(eed->f&SELECT){ - if(eed->v1->tmp.l != eed->v2->tmp.l) /*unbalanced*/{ - if(eed->v1->tmp.l > eed->v2->tmp.l && eed->v2->tmp.l !=0) eed->v1->tmp.l = eed->v2->tmp.l; - else if(eed->v1 != 0) eed->v2->tmp.l = eed->v1->tmp.l; - ebalanced = 0; - } - } - } - } - - /*3rd pass, set all the edge flags (unnessecary?)*/ - for(eed=G.editMesh->edges.first; eed; eed = eed->next){ - if(eed->f&SELECT) eed->tmp.l = eed->v1->tmp.l; - } - - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(eed->f&SELECT){ - if(allcollections->first){ - for(edgecollection = allcollections->first; edgecollection; edgecollection=edgecollection->next){ - if(edgecollection->index == eed->tmp.l){ - newedge = MEM_mallocN(sizeof(CollectedEdge), "collected edge"); - newedge->eed = eed; - BLI_addtail(&(edgecollection->collectionbase), newedge); - collectionfound = 1; - break; - } - else collectionfound = 0; - } - } - if(allcollections->first == NULL || collectionfound == 0){ - newcollection = MEM_mallocN(sizeof(Collection), "element collection"); - newcollection->index = eed->tmp.l; - newcollection->collectionbase.first = 0; - newcollection->collectionbase.last = 0; - - newedge = MEM_mallocN(sizeof(CollectedEdge), "collected edge"); - newedge->eed = eed; - - BLI_addtail(&(newcollection->collectionbase), newedge); - BLI_addtail(allcollections, newcollection); - } - } - - } -} - -static void freecollections(ListBase *allcollections) -{ - struct Collection *curcollection; - - for(curcollection = allcollections->first; curcollection; curcollection = curcollection->next) - BLI_freelistN(&(curcollection->collectionbase)); - BLI_freelistN(allcollections); -} - -/*Begin UV Edge Collapse Code - Like Edge subdivide, Edge Collapse should handle UV's intelligently, but since UV's are a per-face attribute, normal edge collapse will fail - in areas such as the boundries of 'UV islands'. So for each edge collection we need to build a set of 'welded' UV vertices and edges for it. - The welded UV edges can then be sorted and collapsed. -*/ -typedef struct wUV{ - struct wUV *next, *prev; - ListBase nodes; - float u, v; /*cached copy of UV coordinates pointed to by nodes*/ - EditVert *eve; - int f; -} wUV; - -typedef struct wUVNode{ - struct wUVNode *next, *prev; - float *u; /*pointer to original tface data*/ - float *v; /*pointer to original tface data*/ -} wUVNode; - -typedef struct wUVEdge{ - struct wUVEdge *next, *prev; - float v1uv[2], v2uv[2]; /*nasty.*/ - struct wUV *v1, *v2; /*oriented same as editedge*/ - EditEdge *eed; - int f; -} wUVEdge; - -typedef struct wUVEdgeCollect{ /*used for grouping*/ - struct wUVEdgeCollect *next, *prev; - wUVEdge *uved; - int id; -} wUVEdgeCollect; - -static void append_weldedUV(EditFace *efa, EditVert *eve, int tfindex, ListBase *uvverts) -{ - wUV *curwvert, *newwvert; - wUVNode *newnode; - int found; - MTFace *tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - - found = 0; - - for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){ - if(curwvert->eve == eve && curwvert->u == tf->uv[tfindex][0] && curwvert->v == tf->uv[tfindex][1]){ - newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node"); - newnode->u = &(tf->uv[tfindex][0]); - newnode->v = &(tf->uv[tfindex][1]); - BLI_addtail(&(curwvert->nodes), newnode); - found = 1; - break; - } - } - - if(!found){ - newnode = MEM_callocN(sizeof(wUVNode), "Welded UV Vert Node"); - newnode->u = &(tf->uv[tfindex][0]); - newnode->v = &(tf->uv[tfindex][1]); - - newwvert = MEM_callocN(sizeof(wUV), "Welded UV Vert"); - newwvert->u = *(newnode->u); - newwvert->v = *(newnode->v); - newwvert->eve = eve; - - BLI_addtail(&(newwvert->nodes), newnode); - BLI_addtail(uvverts, newwvert); - - } -} - -static void build_weldedUVs(ListBase *uvverts) -{ - EditFace *efa; - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - if(efa->v1->f1) append_weldedUV(efa, efa->v1, 0, uvverts); - if(efa->v2->f1) append_weldedUV(efa, efa->v2, 1, uvverts); - if(efa->v3->f1) append_weldedUV(efa, efa->v3, 2, uvverts); - if(efa->v4 && efa->v4->f1) append_weldedUV(efa, efa->v4, 3, uvverts); - } -} - -static void append_weldedUVEdge(EditFace *efa, EditEdge *eed, ListBase *uvedges) -{ - wUVEdge *curwedge, *newwedge; - int v1tfindex, v2tfindex, found; - MTFace *tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - - found = 0; - - if(eed->v1 == efa->v1) v1tfindex = 0; - else if(eed->v1 == efa->v2) v1tfindex = 1; - else if(eed->v1 == efa->v3) v1tfindex = 2; - else /* if(eed->v1 == efa->v4) */ v1tfindex = 3; - - if(eed->v2 == efa->v1) v2tfindex = 0; - else if(eed->v2 == efa->v2) v2tfindex = 1; - else if(eed->v2 == efa->v3) v2tfindex = 2; - else /* if(eed->v2 == efa->v4) */ v2tfindex = 3; - - for(curwedge=uvedges->first; curwedge; curwedge=curwedge->next){ - if(curwedge->eed == eed && curwedge->v1uv[0] == tf->uv[v1tfindex][0] && curwedge->v1uv[1] == tf->uv[v1tfindex][1] && curwedge->v2uv[0] == tf->uv[v2tfindex][0] && curwedge->v2uv[1] == tf->uv[v2tfindex][1]){ - found = 1; - break; //do nothing, we don't need another welded uv edge - } - } - - if(!found){ - newwedge = MEM_callocN(sizeof(wUVEdge), "Welded UV Edge"); - newwedge->v1uv[0] = tf->uv[v1tfindex][0]; - newwedge->v1uv[1] = tf->uv[v1tfindex][1]; - newwedge->v2uv[0] = tf->uv[v2tfindex][0]; - newwedge->v2uv[1] = tf->uv[v2tfindex][1]; - newwedge->eed = eed; - - BLI_addtail(uvedges, newwedge); - } -} - -static void build_weldedUVEdges(ListBase *uvedges, ListBase *uvverts) -{ - wUV *curwvert; - wUVEdge *curwedge; - EditFace *efa; - - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - if(efa->e1->f1) append_weldedUVEdge(efa, efa->e1, uvedges); - if(efa->e2->f1) append_weldedUVEdge(efa, efa->e2, uvedges); - if(efa->e3->f1) append_weldedUVEdge(efa, efa->e3, uvedges); - if(efa->e4 && efa->e4->f1) append_weldedUVEdge(efa, efa->e4, uvedges); - } - - - //link vertices: for each uvedge, search uvverts to populate v1 and v2 pointers - for(curwedge=uvedges->first; curwedge; curwedge=curwedge->next){ - for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){ - if(curwedge->eed->v1 == curwvert->eve && curwedge->v1uv[0] == curwvert->u && curwedge->v1uv[1] == curwvert->v){ - curwedge->v1 = curwvert; - break; - } - } - for(curwvert=uvverts->first; curwvert; curwvert=curwvert->next){ - if(curwedge->eed->v2 == curwvert->eve && curwedge->v2uv[0] == curwvert->u && curwedge->v2uv[1] == curwvert->v){ - curwedge->v2 = curwvert; - break; - } - } - } -} - -static void free_weldedUVs(ListBase *uvverts) -{ - wUV *curwvert; - for(curwvert = uvverts->first; curwvert; curwvert=curwvert->next) BLI_freelistN(&(curwvert->nodes)); - BLI_freelistN(uvverts); -} - -static void collapse_edgeuvs(void) -{ - ListBase uvedges, uvverts, allcollections; - wUVEdge *curwedge; - wUVNode *curwnode; - wUVEdgeCollect *collectedwuve, *newcollectedwuve; - Collection *wuvecollection, *newcollection; - int curtag, balanced, collectionfound= 0, vcount; - float avg[2]; - - if (!EM_texFaceCheck()) - return; - - uvverts.first = uvverts.last = uvedges.first = uvedges.last = allcollections.first = allcollections.last = NULL; - - build_weldedUVs(&uvverts); - build_weldedUVEdges(&uvedges, &uvverts); - - curtag = 0; - - for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){ - curwedge->v1->f = curtag; - curwedge->v2->f = curtag; - curtag +=1; - } - - balanced = 0; - while(!balanced){ - balanced = 1; - for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){ - if(curwedge->v1->f != curwedge->v2->f){ - if(curwedge->v1->f > curwedge->v2->f) curwedge->v1->f = curwedge->v2->f; - else curwedge->v2->f = curwedge->v1->f; - balanced = 0; - } - } - } - - for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next) curwedge->f = curwedge->v1->f; - - - for(curwedge=uvedges.first; curwedge; curwedge=curwedge->next){ - if(allcollections.first){ - for(wuvecollection = allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){ - if(wuvecollection->index == curwedge->f){ - newcollectedwuve = MEM_callocN(sizeof(wUVEdgeCollect), "Collected Welded UV Edge"); - newcollectedwuve->uved = curwedge; - BLI_addtail(&(wuvecollection->collectionbase), newcollectedwuve); - collectionfound = 1; - break; - } - - else collectionfound = 0; - } - } - if(allcollections.first == NULL || collectionfound == 0){ - newcollection = MEM_callocN(sizeof(Collection), "element collection"); - newcollection->index = curwedge->f; - newcollection->collectionbase.first = 0; - newcollection->collectionbase.last = 0; - - newcollectedwuve = MEM_callocN(sizeof(wUVEdgeCollect), "Collected Welded UV Edge"); - newcollectedwuve->uved = curwedge; - - BLI_addtail(&(newcollection->collectionbase), newcollectedwuve); - BLI_addtail(&allcollections, newcollection); - } - } - - for(wuvecollection=allcollections.first; wuvecollection; wuvecollection=wuvecollection->next){ - - vcount = avg[0] = avg[1] = 0; - - for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){ - avg[0] += collectedwuve->uved->v1uv[0]; - avg[1] += collectedwuve->uved->v1uv[1]; - - avg[0] += collectedwuve->uved->v2uv[0]; - avg[1] += collectedwuve->uved->v2uv[1]; - - vcount +=2; - - } - - avg[0] /= vcount; avg[1] /= vcount; - - for(collectedwuve= wuvecollection->collectionbase.first; collectedwuve; collectedwuve = collectedwuve->next){ - for(curwnode=collectedwuve->uved->v1->nodes.first; curwnode; curwnode=curwnode->next){ - *(curwnode->u) = avg[0]; - *(curwnode->v) = avg[1]; - } - for(curwnode=collectedwuve->uved->v2->nodes.first; curwnode; curwnode=curwnode->next){ - *(curwnode->u) = avg[0]; - *(curwnode->v) = avg[1]; - } - } - } - - free_weldedUVs(&uvverts); - BLI_freelistN(&uvedges); - freecollections(&allcollections); -} - -/*End UV Edge collapse code*/ - -static void collapseuvs(void) -{ - EditFace *efa; - MTFace *tf; - int uvcount; - float uvav[2]; - - if (!EM_texFaceCheck()) - return; - - uvcount = 0; - uvav[0] = 0; - uvav[1] = 0; - - for(efa = G.editMesh->faces.first; efa; efa=efa->next){ - tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - - if(efa->v1->f1){ - uvav[0] += tf->uv[0][0]; - uvav[1] += tf->uv[0][1]; - uvcount += 1; - } - if(efa->v2->f1){ - uvav[0] += tf->uv[1][0]; - uvav[1] += tf->uv[1][1]; - uvcount += 1; - } - if(efa->v3->f1){ - uvav[0] += tf->uv[2][0]; - uvav[1] += tf->uv[2][1]; - uvcount += 1; - } - if(efa->v4 && efa->v4->f1){ - uvav[0] += tf->uv[3][0]; - uvav[1] += tf->uv[3][1]; - uvcount += 1; - } - } - - if(uvcount > 0) { - uvav[0] /= uvcount; - uvav[1] /= uvcount; - - for(efa = G.editMesh->faces.first; efa; efa=efa->next){ - tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - - if(efa->v1->f1){ - tf->uv[0][0] = uvav[0]; - tf->uv[0][1] = uvav[1]; - } - if(efa->v2->f1){ - tf->uv[1][0] = uvav[0]; - tf->uv[1][1] = uvav[1]; - } - if(efa->v3->f1){ - tf->uv[2][0] = uvav[0]; - tf->uv[2][1] = uvav[1]; - } - if(efa->v4 && efa->v4->f1){ - tf->uv[3][0] = uvav[0]; - tf->uv[3][1] = uvav[1]; - } - } - } -} - -int collapseEdges(void) -{ - EditVert *eve; - EditEdge *eed; - - ListBase allcollections; - CollectedEdge *curredge; - Collection *edgecollection; - - int totedges, groupcount, mergecount,vcount; - float avgcount[3]; - - allcollections.first = 0; - allcollections.last = 0; - - mergecount = 0; - - if(multires_test()) return 0; - - build_edgecollection(&allcollections); - groupcount = BLI_countlist(&allcollections); - - - for(edgecollection = allcollections.first; edgecollection; edgecollection = edgecollection->next){ - totedges = BLI_countlist(&(edgecollection->collectionbase)); - mergecount += totedges; - avgcount[0] = 0; avgcount[1] = 0; avgcount[2] = 0; - - vcount = 0; - - for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){ - avgcount[0] += ((EditEdge*)curredge->eed)->v1->co[0]; - avgcount[1] += ((EditEdge*)curredge->eed)->v1->co[1]; - avgcount[2] += ((EditEdge*)curredge->eed)->v1->co[2]; - - avgcount[0] += ((EditEdge*)curredge->eed)->v2->co[0]; - avgcount[1] += ((EditEdge*)curredge->eed)->v2->co[1]; - avgcount[2] += ((EditEdge*)curredge->eed)->v2->co[2]; - - vcount +=2; - } - - avgcount[0] /= vcount; avgcount[1] /=vcount; avgcount[2] /= vcount; - - for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){ - VECCOPY(((EditEdge*)curredge->eed)->v1->co,avgcount); - VECCOPY(((EditEdge*)curredge->eed)->v2->co,avgcount); - } - - if (EM_texFaceCheck()) { - /*uv collapse*/ - for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0; - for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0; - for(curredge = edgecollection->collectionbase.first; curredge; curredge = curredge->next){ - curredge->eed->v1->f1 = 1; - curredge->eed->v2->f1 = 1; - curredge->eed->f1 = 1; - } - collapse_edgeuvs(); - } - - } - freecollections(&allcollections); - removedoublesflag(1, 0, MERGELIMIT); - /*get rid of this!*/ - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - return mergecount; -} - -int merge_firstlast(int first, int uvmerge) -{ - EditVert *eve,*mergevert; - EditSelection *ese; - - if(multires_test()) return 0; - - /* do sanity check in mergemenu in edit.c ?*/ - if(first == 0){ - ese = G.editMesh->selected.last; - mergevert= (EditVert*)ese->data; - } - else{ - ese = G.editMesh->selected.first; - mergevert = (EditVert*)ese->data; - } - - if(mergevert->f&SELECT){ - for (eve=G.editMesh->verts.first; eve; eve=eve->next){ - if (eve->f&SELECT) - VECCOPY(eve->co,mergevert->co); - } - } - - if(uvmerge && CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)){ - - for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0; - for(eve=G.editMesh->verts.first; eve; eve=eve->next){ - if(eve->f&SELECT) eve->f1 = 1; - } - collapseuvs(); - } - - countall(); - return removedoublesflag(1, 0, MERGELIMIT); -} - -int merge_target(int target, int uvmerge) -{ - EditVert *eve; - - if(multires_test()) return 0; - - if(target) snap_sel_to_curs(); - else snap_to_center(); - - if(uvmerge && CustomData_has_layer(&G.editMesh->fdata, CD_MTFACE)){ - for(eve=G.editMesh->verts.first; eve; eve=eve->next) eve->f1 = 0; - for(eve=G.editMesh->verts.first; eve; eve=eve->next){ - if(eve->f&SELECT) eve->f1 = 1; - } - collapseuvs(); - } - - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - return removedoublesflag(1, 0, MERGELIMIT); - -} -#undef MERGELIMIT - -typedef struct PathNode{ - int u; - int visited; - ListBase edges; -} PathNode; - -typedef struct PathEdge{ - struct PathEdge *next, *prev; - int v; - float w; -} PathEdge; - -void pathselect(void) -{ - EditVert *eve, *s, *t; - EditEdge *eed; - EditSelection *ese; - PathEdge *newpe, *currpe; - PathNode *currpn; - PathNode *Q; - int v, *previous, pathvert, pnindex; /*pnindex redundant?*/ - int unbalanced, totnodes; - short physical; - float *cost; - Heap *heap; /*binary heap for sorting pointers to PathNodes based upon a 'cost'*/ - - s = t = NULL; - - countall(); /*paranoid?*/ - - ese = ((EditSelection*)G.editMesh->selected.last); - if(ese && ese->type == EDITVERT && ese->prev && ese->prev->type == EDITVERT){ - physical= pupmenu("Distance Method? %t|Edge Length%x1|Topological%x0"); - - t = (EditVert*)ese->data; - s = (EditVert*)ese->prev->data; - - /*need to find out if t is actually reachable by s....*/ - for(eve=G.editMesh->verts.first; eve; eve=eve->next){ - eve->f1 = 0; - } - - s->f1 = 1; - - unbalanced = 1; - totnodes = 1; - while(unbalanced){ - unbalanced = 0; - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(!eed->h){ - if(eed->v1->f1 && !eed->v2->f1){ - eed->v2->f1 = 1; - totnodes++; - unbalanced = 1; - } - else if(eed->v2->f1 && !eed->v1->f1){ - eed->v1->f1 = 1; - totnodes++; - unbalanced = 1; - } - } - } - } - - - - if(s->f1 && t->f1){ /*t can be reached by s*/ - Q = MEM_callocN(sizeof(PathNode)*totnodes, "Path Select Nodes"); - totnodes = 0; - for(eve=G.editMesh->verts.first; eve; eve=eve->next){ - if(eve->f1){ - Q[totnodes].u = totnodes; - Q[totnodes].edges.first = 0; - Q[totnodes].edges.last = 0; - Q[totnodes].visited = 0; - eve->tmp.p = &(Q[totnodes]); - totnodes++; - } - else eve->tmp.p = NULL; - } - - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(!eed->h){ - if(eed->v1->f1){ - currpn = ((PathNode*)eed->v1->tmp.p); - - newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge"); - newpe->v = ((PathNode*)eed->v2->tmp.p)->u; - if(physical){ - newpe->w = VecLenf(eed->v1->co, eed->v2->co); - } - else newpe->w = 1; - newpe->next = 0; - newpe->prev = 0; - BLI_addtail(&(currpn->edges), newpe); - } - if(eed->v2->f1){ - currpn = ((PathNode*)eed->v2->tmp.p); - newpe = MEM_mallocN(sizeof(PathEdge), "Path Edge"); - newpe->v = ((PathNode*)eed->v1->tmp.p)->u; - if(physical){ - newpe->w = VecLenf(eed->v1->co, eed->v2->co); - } - else newpe->w = 1; - newpe->next = 0; - newpe->prev = 0; - BLI_addtail(&(currpn->edges), newpe); - } - } - } - - heap = BLI_heap_new(); - cost = MEM_callocN(sizeof(float)*totnodes, "Path Select Costs"); - previous = MEM_callocN(sizeof(int)*totnodes, "PathNode indices"); - - for(v=0; v < totnodes; v++){ - cost[v] = 1000000; - previous[v] = -1; /*array of indices*/ - } - - pnindex = ((PathNode*)s->tmp.p)->u; - cost[pnindex] = 0; - BLI_heap_insert(heap, 0.0f, (void*)pnindex); - - while( !BLI_heap_empty(heap) ){ - - pnindex = (int)BLI_heap_popmin(heap); - currpn = &(Q[pnindex]); - - if(currpn == (PathNode*)t->tmp.p) /*target has been reached....*/ - break; - - for(currpe=currpn->edges.first; currpe; currpe=currpe->next){ - if(!Q[currpe->v].visited){ - if( cost[currpe->v] > (cost[currpn->u ] + currpe->w) ){ - cost[currpe->v] = cost[currpn->u] + currpe->w; - previous[currpe->v] = currpn->u; - Q[currpe->v].visited = 1; - BLI_heap_insert(heap, cost[currpe->v], (void*)currpe->v); - } - } - } - } - - pathvert = ((PathNode*)t->tmp.p)->u; - while(pathvert != -1){ - for(eve=G.editMesh->verts.first; eve; eve=eve->next){ - if(eve->f1){ - if( ((PathNode*)eve->tmp.p)->u == pathvert) eve->f |= SELECT; - } - } - pathvert = previous[pathvert]; - } - - for(v=0; v < totnodes; v++) BLI_freelistN(&(Q[v].edges)); - MEM_freeN(Q); - MEM_freeN(cost); - MEM_freeN(previous); - BLI_heap_free(heap, NULL); - EM_select_flush(); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - } - } - else{ - error("Path Selection requires that exactly two vertices be selected"); - return; - } -} - -void region_to_loop(void) -{ - EditEdge *eed; - EditFace *efa; - - if(G.totfacesel){ - for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0; - - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - if(efa->f&SELECT){ - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) - efa->e4->f1++; - } - } - - EM_clear_flag_all(SELECT); - - for(eed=G.editMesh->edges.first; eed; eed=eed->next){ - if(eed->f1 == 1) EM_select_edge(eed, 1); - } - - G.scene->selectmode = SCE_SELECT_EDGE; - EM_selectmode_set(); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Face Region to Edge Loop"); - - } -} - -static int validate_loop(Collection *edgecollection) -{ - EditEdge *eed; - EditFace *efa; - CollectedEdge *curredge; - - /*1st test*/ - for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){ - curredge->eed->v1->f1 = 0; - curredge->eed->v2->f1 = 0; - } - for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){ - curredge->eed->v1->f1++; - curredge->eed->v2->f1++; - } - for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){ - if(curredge->eed->v1->f1 > 2) return(0); else - if(curredge->eed->v2->f1 > 2) return(0); - } - - /*2nd test*/ - for(eed = G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = 0; - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - efa->e1->f1++; - efa->e2->f1++; - efa->e3->f1++; - if(efa->e4) efa->e4->f1++; - } - for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next){ - if(curredge->eed->f1 > 2) return(0); - } - return(1); -} - -static int loop_bisect(Collection *edgecollection){ - - EditFace *efa, *sf1, *sf2; - EditEdge *eed, *sed; - CollectedEdge *curredge; - int totsf1, totsf2, unbalanced,balancededges; - - for(eed=G.editMesh->edges.first; eed; eed=eed->next) eed->f1 = eed->f2 = 0; - for(efa=G.editMesh->faces.first; efa; efa=efa->next) efa->f1 = 0; - - for(curredge = (CollectedEdge*)edgecollection->collectionbase.first; curredge; curredge=curredge->next) curredge->eed->f1 = 1; - - sf1 = sf2 = NULL; - sed = ((CollectedEdge*)edgecollection->collectionbase.first)->eed; - - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - if(sf2) break; - else if(sf1){ - if(efa->e1 == sed || efa->e2 == sed || efa->e3 == sed || ( (efa->e4) ? efa->e4 == sed : 0) ) sf2 = efa; - } - else{ - if(efa->e1 == sed || efa->e2 == sed || efa->e3 == sed || ( (efa->e4) ? efa->e4 == sed : 0) ) sf1 = efa; - } - } - - if(sf1==NULL || sf2==NULL) - return(-1); - - if(!(sf1->e1->f1)) sf1->e1->f2 = 1; - if(!(sf1->e2->f1)) sf1->e2->f2 = 1; - if(!(sf1->e3->f1)) sf1->e3->f2 = 1; - if(sf1->e4 && !(sf1->e4->f1)) sf1->e4->f2 = 1; - sf1->f1 = 1; - totsf1 = 1; - - if(!(sf2->e1->f1)) sf2->e1->f2 = 2; - if(!(sf2->e2->f1)) sf2->e2->f2 = 2; - if(!(sf2->e3->f1)) sf2->e3->f2 = 2; - if(sf2->e4 && !(sf2->e4->f1)) sf2->e4->f2 = 2; - sf2->f1 = 2; - totsf2 = 1; - - /*do sf1*/ - unbalanced = 1; - while(unbalanced){ - unbalanced = 0; - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - balancededges = 0; - if(efa->f1 == 0){ - if(efa->e1->f2 == 1 || efa->e2->f2 == 1 || efa->e3->f2 == 1 || ( (efa->e4) ? efa->e4->f2 == 1 : 0) ){ - balancededges += efa->e1->f2 = (efa->e1->f1) ? 0 : 1; - balancededges += efa->e2->f2 = (efa->e2->f1) ? 0 : 1; - balancededges += efa->e3->f2 = (efa->e3->f1) ? 0 : 1; - if(efa->e4) balancededges += efa->e4->f2 = (efa->e4->f1) ? 0 : 1; - if(balancededges){ - unbalanced = 1; - efa->f1 = 1; - totsf1++; - } - } - } - } - } - - /*do sf2*/ - unbalanced = 1; - while(unbalanced){ - unbalanced = 0; - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - balancededges = 0; - if(efa->f1 == 0){ - if(efa->e1->f2 == 2 || efa->e2->f2 == 2 || efa->e3->f2 == 2 || ( (efa->e4) ? efa->e4->f2 == 2 : 0) ){ - balancededges += efa->e1->f2 = (efa->e1->f1) ? 0 : 2; - balancededges += efa->e2->f2 = (efa->e2->f1) ? 0 : 2; - balancededges += efa->e3->f2 = (efa->e3->f1) ? 0 : 2; - if(efa->e4) balancededges += efa->e4->f2 = (efa->e4->f1) ? 0 : 2; - if(balancededges){ - unbalanced = 1; - efa->f1 = 2; - totsf2++; - } - } - } - } - } - - if(totsf1 < totsf2) return(1); - else return(2); -} - -void loop_to_region(void) -{ - EditFace *efa; - ListBase allcollections={NULL,NULL}; - Collection *edgecollection; - int testflag; - - build_edgecollection(&allcollections); - - for(edgecollection = (Collection *)allcollections.first; edgecollection; edgecollection=edgecollection->next){ - if(validate_loop(edgecollection)){ - testflag = loop_bisect(edgecollection); - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ - if(efa->f1 == testflag){ - if(efa->f&SELECT) EM_select_face(efa, 0); - else EM_select_face(efa,1); - } - } - } - } - - for(efa=G.editMesh->faces.first; efa; efa=efa->next){ /*fix this*/ - if(efa->f&SELECT) EM_select_face(efa,1); - } - - countall(); - freecollections(&allcollections); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - BIF_undo_push("Edge Loop to Face Region"); -} - - -/* texface and vertex color editmode tools for the face menu */ - -void mesh_rotate_uvs(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - short change = 0, ccw; - MTFace *tf; - float u1, v1; - - if (!EM_texFaceCheck()) { - error("mesh has no uv/image layers"); - return; - } - - ccw = (G.qual == LR_SHIFTKEY); - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - u1= tf->uv[0][0]; - v1= tf->uv[0][1]; - - if (ccw) { - if(efa->v4) { - tf->uv[0][0]= tf->uv[3][0]; - tf->uv[0][1]= tf->uv[3][1]; - - tf->uv[3][0]= tf->uv[2][0]; - tf->uv[3][1]= tf->uv[2][1]; - } else { - tf->uv[0][0]= tf->uv[2][0]; - tf->uv[0][1]= tf->uv[2][1]; - } - - tf->uv[2][0]= tf->uv[1][0]; - tf->uv[2][1]= tf->uv[1][1]; - - tf->uv[1][0]= u1; - tf->uv[1][1]= v1; - } else { - tf->uv[0][0]= tf->uv[1][0]; - tf->uv[0][1]= tf->uv[1][1]; - - tf->uv[1][0]= tf->uv[2][0]; - tf->uv[1][1]= tf->uv[2][1]; - - if(efa->v4) { - tf->uv[2][0]= tf->uv[3][0]; - tf->uv[2][1]= tf->uv[3][1]; - - tf->uv[3][0]= u1; - tf->uv[3][1]= v1; - } - else { - tf->uv[2][0]= u1; - tf->uv[2][1]= v1; - } - } - change = 1; - } - } - - if (change) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Rotate UV face"); - } -} - -void mesh_mirror_uvs(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - short change = 0; - MTFace *tf; - float u1, v1; - - if (!EM_texFaceCheck()) { - error("mesh has no uv/image layers"); - return; - } - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - u1= tf->uv[0][0]; - v1= tf->uv[0][1]; - if(efa->v4) { - tf->uv[0][0]= tf->uv[3][0]; - tf->uv[0][1]= tf->uv[3][1]; - - tf->uv[3][0]= u1; - tf->uv[3][1]= v1; - - u1= tf->uv[1][0]; - v1= tf->uv[1][1]; - - tf->uv[1][0]= tf->uv[2][0]; - tf->uv[1][1]= tf->uv[2][1]; - - tf->uv[2][0]= u1; - tf->uv[2][1]= v1; - } - else { - tf->uv[0][0]= tf->uv[2][0]; - tf->uv[0][1]= tf->uv[2][1]; - tf->uv[2][0]= u1; - tf->uv[2][1]= v1; - } - change = 1; - } - } - - if (change) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Mirror UV face"); - } -} - -void mesh_rotate_colors(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - short change = 0, ccw; - MCol tmpcol, *mcol; - if (!EM_vertColorCheck()) { - error("mesh has no color layers"); - return; - } - - ccw = (G.qual == LR_SHIFTKEY); - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - tmpcol= mcol[0]; - - if (ccw) { - if(efa->v4) { - mcol[0]= mcol[3]; - mcol[3]= mcol[2]; - } else { - mcol[0]= mcol[2]; - } - mcol[2]= mcol[1]; - mcol[1]= tmpcol; - } else { - mcol[0]= mcol[1]; - mcol[1]= mcol[2]; - - if(efa->v4) { - mcol[2]= mcol[3]; - mcol[3]= tmpcol; - } - else - mcol[2]= tmpcol; - } - change = 1; - } - } - - if (change) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Rotate Color face"); - } -} - -void mesh_mirror_colors(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - short change = 0; - MCol tmpcol, *mcol; - if (!EM_vertColorCheck()) { - error("mesh has no color layers"); - return; - } - - for(efa=em->faces.first; efa; efa=efa->next) { - if (efa->f & SELECT) { - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - tmpcol= mcol[0]; - - mcol[0]= mcol[1]; - mcol[1]= mcol[2]; - - if(efa->v4) { - mcol[2]= mcol[3]; - mcol[3]= tmpcol; - } - else { - mcol[2]= tmpcol; - } - change = 1; - } - } - - if (change) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Mirror Color face"); - } -} diff --git a/source/blender/src/editmode_undo.c b/source/blender/src/editmode_undo.c deleted file mode 100644 index 22a399ae1e2..00000000000 --- a/source/blender/src/editmode_undo.c +++ /dev/null @@ -1,348 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_object.h" - -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" - -#include "BKE_utildefines.h" - -#include "BIF_editmesh.h" -#include "BIF_interface.h" -#include "BIF_screen.h" -#include "BIF_resources.h" -#include "BIF_toolbox.h" -#include "BIF_space.h" - -#include "BDR_editcurve.h" - -#include "BSE_edit.h" - -#include "mydevice.h" - -/* ***************** generic editmode undo system ********************* */ -/* - -Add this in your local code: - -void undo_editmode_push(char *name, - void (*freedata)(void *), // pointer to function freeing data - void (*to_editmode)(void *), // data to editmode conversion - void * (*from_editmode)(void)) // editmode to data conversion - - -Further exported for UI is: - -void undo_editmode_step(int step); // undo and redo -void undo_editmode_clear(void) // free & clear all data -void undo_editmode_menu(void) // history menu - - -*/ -/* ********************************************************************* */ - -/* local prototypes --------------- */ - void undo_editmode_step(int step); // undo and redo - void undo_editmode_clear(void); // free & clear all data - void undo_editmode_menu(void); // history menu - void undo_editmode_push(char *name, void (*freedata)(void *), - void (*to_editmode)(void *), void *(*from_editmode)(void)); - struct uiBlock *editmode_undohistorymenu(void *arg_unused); - - - -#define MAXUNDONAME 64 -typedef struct UndoElem { - struct UndoElem *next, *prev; - ID id; // copy of editmode object ID - Object *ob; // pointer to edited object - int type; // type of edited object - void *undodata; - char name[MAXUNDONAME]; - void (*freedata)(void *); - void (*to_editmode)(void *); - void * (*from_editmode)(void); -} UndoElem; - -static ListBase undobase={NULL, NULL}; -static UndoElem *curundo= NULL; - - -/* ********************* xtern api calls ************* */ - -static void undo_restore(UndoElem *undo) -{ - if(undo) { - waitcursor(1); - undo->to_editmode(undo->undodata); - waitcursor(0); - - countall(); - } -} - -/* name can be a dynamic string */ -void undo_editmode_push(char *name, void (*freedata)(void *), - void (*to_editmode)(void *), void *(*from_editmode)(void)) -{ - UndoElem *uel; - int nr; - - /* at first here was code to prevent an "original" key to be insterted twice - this was giving conflicts for example when mesh changed due to keys or apply */ - - /* remove all undos after (also when curundo==NULL) */ - while(undobase.last != curundo) { - uel= undobase.last; - BLI_remlink(&undobase, uel); - uel->freedata(uel->undodata); - MEM_freeN(uel); - } - - /* make new */ - curundo= uel= MEM_callocN(sizeof(UndoElem), "undo file"); - strncpy(uel->name, name, MAXUNDONAME-1); - BLI_addtail(&undobase, uel); - - uel->freedata= freedata; - uel->to_editmode= to_editmode; - uel->from_editmode= from_editmode; - - /* and limit amount to the maximum */ - nr= 0; - uel= undobase.last; - while(uel) { - nr++; - if(nr==U.undosteps) break; - uel= uel->prev; - } - if(uel) { - while(undobase.first!=uel) { - UndoElem *first= undobase.first; - BLI_remlink(&undobase, first); - first->freedata(first->undodata); - MEM_freeN(first); - } - } - - /* copy */ - curundo->undodata= curundo->from_editmode(); - curundo->ob= G.obedit; - curundo->id= G.obedit->id; - curundo->type= G.obedit->type; -} - - -/* helper to remove clean other objects from undo stack */ -static void undo_clean_stack(void) -{ - UndoElem *uel, *next; - int mixed= 0; - - /* global undo changes pointers, so we also allow identical names */ - /* side effect: when deleting/renaming object and start editing new one with same name */ - - uel= undobase.first; - while(uel) { - next= uel->next; - - /* for when objects are converted, renamed, or global undo changes pointers... */ - if(uel->type==G.obedit->type && strcmp(uel->id.name, G.obedit->id.name)==0) { - uel->ob= G.obedit; - } - else { - mixed= 1; - BLI_remlink(&undobase, uel); - uel->freedata(uel->undodata); - MEM_freeN(uel); - } - - uel= next; - } - - if(mixed) curundo= undobase.last; -} - -/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */ -void undo_editmode_step(int step) -{ - - /* prevent undo to happen on wrong object, stack can be a mix */ - undo_clean_stack(); - - if(step==0) { - undo_restore(curundo); - } - else if(step==1) { - - if(curundo==NULL || curundo->prev==NULL) error("No more steps to undo"); - else { - if(G.f & G_DEBUG) printf("undo %s\n", curundo->name); - curundo= curundo->prev; - undo_restore(curundo); - } - } - else { - /* curundo has to remain current situation! */ - - if(curundo==NULL || curundo->next==NULL) error("No more steps to redo"); - else { - undo_restore(curundo->next); - curundo= curundo->next; - if(G.f & G_DEBUG) printf("redo %s\n", curundo->name); - } - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); -} - -void undo_editmode_clear(void) -{ - UndoElem *uel; - - uel= undobase.first; - while(uel) { - uel->freedata(uel->undodata); - uel= uel->next; - } - BLI_freelistN(&undobase); - curundo= NULL; -} - -/* based on index nr it does a restore */ -static void undo_number(int nr) -{ - UndoElem *uel; - int a=1; - - for(uel= undobase.first; uel; uel= uel->next, a++) { - if(a==nr) break; - } - curundo= uel; - undo_editmode_step(0); -} - -/* ************** for interaction with menu/pullown */ - -void undo_editmode_menu(void) -{ - UndoElem *uel; - DynStr *ds= BLI_dynstr_new(); - short event; - char *menu; - - undo_clean_stack(); // removes other objects from it - - BLI_dynstr_append(ds, "Editmode Undo History %t"); - - for(uel= undobase.first; uel; uel= uel->next) { - BLI_dynstr_append(ds, "|"); - BLI_dynstr_append(ds, uel->name); - } - - menu= BLI_dynstr_get_cstring(ds); - BLI_dynstr_free(ds); - - event= pupmenu_col(menu, 20); - MEM_freeN(menu); - - if(event>0) undo_number(event); -} - -static void do_editmode_undohistorymenu(void *arg, int event) -{ - - if(G.obedit==NULL || event<1) return; - - if (event==1) { - if(G.obedit->type==OB_MESH) remake_editMesh(); - } - else undo_number(event-1); - - allqueue(REDRAWVIEW3D, 0); -} - -uiBlock *editmode_undohistorymenu(void *arg_unused) -{ - uiBlock *block; - UndoElem *uel; - short yco = 20, menuwidth = 120; - short item=2; - - undo_clean_stack(); // removes other objects from it - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_undohistorymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_editmode_undohistorymenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo All Changes", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - for(uel= undobase.first; uel; uel= uel->next, item++) { - if (uel==curundo) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, uel->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, (float)item, ""); - if (uel==curundo) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void *undo_editmode_get_prev(Object *ob) -{ - UndoElem *ue= undobase.last; - if(ue && ue->prev && ue->prev->ob==ob) return ue->prev->undodata; - return NULL; -} diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c deleted file mode 100644 index fc79c265f8d..00000000000 --- a/source/blender/src/editnla.c +++ /dev/null @@ -1,2054 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL ***** - * - * This file is a horrible mess: An attmept to cram some - * final functionality into blender before it is too late. - * - * Hopefully it can be tidied up at a later date... -*/ - -#include -#include -#include - -#include "PIL_time.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "DNA_action_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_nla_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_action.h" -#include "BKE_blender.h" -#include "BKE_depsgraph.h" -#include "BKE_group.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_nla.h" -#include "BKE_utildefines.h" - -#include "BIF_screen.h" -#include "BIF_interface.h" -#include "BIF_butspace.h" -#include "BIF_space.h" -#include "BIF_mywindow.h" -#include "BIF_editview.h" -#include "BIF_toolbox.h" -#include "BIF_editnla.h" -#include "BIF_editaction.h" -#include "BIF_transform.h" - -#include "BSE_editipo.h" -#include "BSE_editnla_types.h" -#include "BSE_headerbuttons.h" -#include "BSE_drawipo.h" -#include "BSE_editaction_types.h" -#include "BSE_trans_types.h" -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BDR_editobject.h" -#include "BSE_drawnla.h" -#include "BSE_time.h" - -#include "blendef.h" -#include "mydevice.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -/* Note: A lot of these pretty much duplicate the behaviour of the -action windows. The functions should be shared, not copy-pasted */ - -static void mouse_nla(int selectmode); -static Base *get_nearest_nlachannel_ob_key (float *index, short *sel); -static bAction *get_nearest_nlachannel_ac_key (float *index, short *sel); -static Base *get_nearest_nlastrip (bActionStrip **rstrip, short *sel); -static void mouse_nlachannels(short mval[2]); - -/* ******************** SPACE: NLA ********************** */ - -void shift_nlastrips_up(void) { - - Base *base; - bActionStrip *strip, *prevstrip; - - for (base=G.scene->base.first; base; base=base->next) { - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - for (strip = base->object->nlastrips.first; - strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT) { - if ( (prevstrip = strip->prev) ) { - if (prevstrip->prev) - prevstrip->prev->next = strip; - if (strip->next) - strip->next->prev = prevstrip; - strip->prev = prevstrip->prev; - prevstrip->next = strip->next; - strip->next = prevstrip; - prevstrip->prev = strip; - - if (prevstrip == base->object->nlastrips.first) - base->object->nlastrips.first = strip; - if (strip == base->object->nlastrips.last) - base->object->nlastrips.last = prevstrip; - - strip = prevstrip; - } - else { - break; - } - } - } - } - BIF_undo_push("Shift NLA strip"); - allqueue (REDRAWNLA, 0); - -} - -void shift_nlastrips_down(void) { - - Base *base; - bActionStrip *strip, *nextstrip; - - for (base=G.scene->base.first; base; base=base->next) { - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - for (strip = base->object->nlastrips.last; - strip; strip=strip->prev){ - if (strip->flag & ACTSTRIP_SELECT) { - if ( (nextstrip = strip->next) ) { - if (nextstrip->next) - nextstrip->next->prev = strip; - if (strip->prev) - strip->prev->next = nextstrip; - strip->next = nextstrip->next; - nextstrip->prev = strip->prev; - strip->prev = nextstrip; - nextstrip->next = strip; - - if (nextstrip == base->object->nlastrips.last) - base->object->nlastrips.last = strip; - if (strip == base->object->nlastrips.first) - base->object->nlastrips.first = nextstrip; - - strip = nextstrip; - } - else { - break; - } - } - } - } - - BIF_undo_push("Shift NLA strips"); - allqueue (REDRAWNLA, 0); -} - -void synchronize_action_strips(void) -{ - Base *base; - bActionStrip *strip; - - for (base=G.scene->base.first; base; base=base->next) { - /* step 1: adjust strip-lengths */ - for (strip = base->object->nlastrips.last; strip; strip=strip->prev) { - if (strip->flag & ACTSTRIP_LOCK_ACTION) { - float actstart, actend; - - calc_action_range(strip->act, &actstart, &actend, 1); - - if ((strip->actstart!=actstart) || (strip->actend!=actend)) { - float offset = strip->scale * (actstart - strip->actstart); - float actlen = actend - actstart; - - strip->start += offset; - strip->end = (strip->scale * strip->repeat * actlen) + strip->start; - - strip->actstart= actstart; - strip->actend= actend; - } - } - } - - /* step 2: adjust blendin/out values for each strip if option is turned on */ - for (strip= base->object->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_AUTO_BLENDS) { - bActionStrip *prev= strip->prev; - bActionStrip *next= strip->next; - float pr[2], nr[2]; - - strip->blendin = 0.0f; - strip->blendout = 0.0f; - - /* setup test ranges */ - if (prev && next) { - /* init range for previous strip */ - pr[0]= prev->start; - pr[1]= prev->end; - - /* init range for next strip */ - nr[0]= next->start; - nr[1]= next->end; - } - else if (prev) { - /* next strip's range is same as previous strip's range */ - pr[0] = nr[0] = prev->start; - pr[1] = nr[1] = prev->end; - } - else if (next) { - /* previous strip's range is same as next strip's range */ - pr[0] = nr[0] = next->start; - pr[1] = nr[1] = next->end; - } - else { - /* there shouldn't be any more strips to loop through for this operation */ - break; - } - - /* test various cases */ - if ( IN_RANGE(pr[1], strip->start, strip->end) && - (IN_RANGE(pr[0], strip->start, strip->end)==0) ) - { - /* previous strip intersects start of current */ - - if ( IN_RANGE(nr[1], strip->start, strip->end) && - (IN_RANGE(nr[0], strip->start, strip->end)==0) ) - { - /* next strip also intersects start of current */ - if (nr[1] < pr[1]) - strip->blendin= nr[1] - strip->start; - else - strip->blendin= pr[1] - strip->start; - } - else if (IN_RANGE(nr[0], strip->start, strip->end) && - (IN_RANGE(nr[1], strip->start, strip->end)==0)) - { - /* next strip intersects end of current */ - strip->blendout= strip->end - nr[0]; - strip->blendin= pr[1] - strip->start; - } - else { - /* only previous strip intersects current */ - strip->blendin= pr[1] - strip->start; - } - } - else if (IN_RANGE(pr[0], strip->start, strip->end) && - (IN_RANGE(pr[1], strip->start, strip->end)==0) ) - { - /* previous strip intersects end of current */ - - if ( IN_RANGE(nr[0], strip->start, strip->end) && - (IN_RANGE(nr[1], strip->start, strip->end)==0) ) - { - /* next strip also intersects end of current */ - if (nr[1] > pr[1]) - strip->blendout= strip->end - nr[0]; - else - strip->blendout= strip->end - pr[0]; - } - else if (IN_RANGE(nr[1], strip->start, strip->end) && - (IN_RANGE(nr[0], strip->start, strip->end)==0)) - { - /* next strip intersects start of current */ - strip->blendin= nr[1] - strip->start; - strip->blendout= strip->end - pr[0]; - } - else { - /* only previous strip intersects current */ - strip->blendout= strip->end - pr[0]; - } - } - else if (IN_RANGE(nr[1], strip->start, strip->end) && - (IN_RANGE(nr[0], strip->start, strip->end)==0) ) - { - /* next strip intersects start of current */ - - if ( IN_RANGE(pr[1], strip->start, strip->end) && - (IN_RANGE(pr[0], strip->start, strip->end)==0) ) - { - /* previous strip also intersects start of current */ - if (pr[1] < nr[1]) - strip->blendin= pr[1] - strip->start; - else - strip->blendin= nr[1] - strip->start; - } - else if (IN_RANGE(pr[0], strip->start, strip->end) && - (IN_RANGE(pr[1], strip->start, strip->end)==0)) - { - /* previous strip intersects end of current */ - strip->blendout= strip->end - pr[0]; - strip->blendin= nr[1] - strip->start; - } - else { - /* only next strip intersects current */ - strip->blendin= nr[1] - strip->start; - } - } - else if (IN_RANGE(nr[0], strip->start, strip->end) && - (IN_RANGE(nr[1], strip->start, strip->end)==0) ) - { - /* next strip intersects end of current */ - - if ( IN_RANGE(pr[0], strip->start, strip->end) && - (IN_RANGE(pr[1], strip->start, strip->end)==0) ) - { - /* previous strip also intersects end of current */ - if (pr[1] > nr[1]) - strip->blendout= strip->end - pr[0]; - else - strip->blendout= strip->end - nr[0]; - } - else if (IN_RANGE(pr[1], strip->start, strip->end) && - (IN_RANGE(pr[0], strip->start, strip->end)==0)) - { - /* previous strip intersects start of current */ - strip->blendin= pr[1] - strip->start; - strip->blendout= strip->end - nr[0]; - } - else { - /* only next strip intersects current */ - strip->blendout= strip->end - nr[0]; - } - } - - /* make sure blending stays in ranges */ - CLAMP(strip->blendin, 0, (strip->end-strip->start)); - CLAMP(strip->blendout, 0, (strip->end-strip->start)); - } - } - } - -} - -void reset_action_strips(int val) -{ - Base *base; - bActionStrip *strip; - - for (base=G.scene->base.first; base; base=base->next) { - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - for (strip = base->object->nlastrips.last; strip; strip=strip->prev) { - if (strip->flag & ACTSTRIP_SELECT) { - switch (val) { - case 1: - { - /* clear scaling - reset to 1.0 without touching keys */ - float actlen= (strip->actend - strip->actstart); - - strip->scale= 1.0f; - strip->end= (strip->repeat * actlen) + strip->start; - } - break; - case 2: - { - /* reset action-range */ - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); - } - break; - case 3: - { - /* apply scale to keys - scale is reset to 1.0f, but keys stay at the same times */ - bActionChannel *achan; - - if (strip->act) { - for (achan= strip->act->chanbase.first; achan; achan= achan->next) { - actstrip_map_ipo_keys(base->object, achan->ipo, 0, 0); - } - - /* now we can reset scale */ - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); - strip->scale= 1.0f; - strip->end = (strip->repeat * (strip->actend - strip->actstart)) + strip->start; - } - } - break; - } - base->object->ctime= -1234567.0f; // evil! - DAG_object_flush_update(G.scene, base->object, OB_RECALC_OB|OB_RECALC_DATA); - } - } - } - BIF_undo_push("Reset NLA strips"); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); -} - -void snap_action_strips(int snap_mode) -{ - Base *base; - bActionStrip *strip; - - for (base=G.scene->base.first; base; base=base->next) { - /* object has ipo - these keyframes should be able to be snapped, even if strips are collapsed */ - if (base->object->ipo) { - snap_ipo_keys(base->object->ipo, snap_mode); - } - - /* object is collapsed - action and nla strips not shown/editable */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* snap action strips */ - for (strip = base->object->nlastrips.last; strip; strip=strip->prev) { - if (strip->flag & ACTSTRIP_SELECT) { - if (snap_mode==1) { - /* nearest frame */ - strip->start= floor(strip->start+0.5); - strip->end= floor(strip->end+0.5); - } - else if (snap_mode==2) { - /* current frame */ - float diff; - if (CFRA < strip->start) { - diff = (strip->start - CFRA); - strip->start -= diff; - strip->end -= diff; - } - else { - diff = (CFRA - strip->start); - strip->start += diff; - strip->end += diff; - } - } - else if (snap_mode==3) { - /* nearest second */ - float secf = FPS; - strip->start= (float)(floor(strip->start/secf + 0.5f) * secf); - strip->end= (float)(floor(strip->end/secf + 0.5f) * secf); - } - } - } - - /* object has action */ - if (base->object->action) { - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - - /* filter action data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, base->object->action, ACTCONT_ACTION); - - /* snap to frame */ - for (ale= act_data.first; ale; ale= ale->next) { - actstrip_map_ipo_keys(base->object, ale->key_data, 0, 1); - snap_ipo_keys(ale->key_data, snap_mode); - actstrip_map_ipo_keys(base->object, ale->key_data, 1, 1); - } - BLI_freelistN(&act_data); - - remake_action_ipos(base->object->action); - } - } - BIF_undo_push("Snap NLA strips"); - allqueue (REDRAWVIEW3D, 0); - allqueue (REMAKEIPO, 0); - allqueue (REDRAWIPO, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); -} - -static void set_active_strip(Object *ob, bActionStrip *act) -{ - bActionStrip *strip; - - for (strip = ob->nlastrips.first; strip; strip=strip->next) - strip->flag &= ~ACTSTRIP_ACTIVE; - - if(act) { - act->flag |= ACTSTRIP_ACTIVE; - - if(ob->action!=act->act) { - if(ob->action) ob->action->id.us--; - if(act->act->id.lib) { - ob->action= NULL; - } - else { - ob->action= act->act; - id_us_plus(&ob->action->id); - } - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - ob->ctime= -1234567.0f; // eveil! - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); - } - } -} - -void convert_nla(void) -{ - bActionStrip *strip; - Object *ob= OBACT; - char str[128]; - short event; - - if ((ob==NULL)||(ob->action==NULL)) { - error("Need active Object to convert Action to NLA Strip"); - return; - } - - sprintf(str, "Convert Action%%t|%s to NLA Strip%%x1", ob->action->id.name+2); - event = pupmenu(str); - - if (event==1) { - if (ob->action) { - deselect_nlachannel_keys(0); - strip = convert_action_to_strip(ob); //creates a new NLA strip from the action in given object - set_active_strip(ob, strip); - BIF_undo_push("Convert NLA"); - allqueue (REDRAWNLA, 0); - } - } -} - -static void add_nla_block(short event) -{ - Object *ob= OBACT; - bAction *act=NULL; - bActionStrip *strip; - int cur; - - if (event!=-1){ - for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){ - if (cur==event){ - break; - } - } - } - - /* Bail out if no action was chosen */ - if (!act){ - return; - } - - /* Initialize the new action block */ - strip = MEM_callocN(sizeof(bActionStrip), "bActionStrip"); - - deselect_nlachannel_keys(0); - - /* Link the action to the strip */ - strip->act = act; - id_us_plus(&act->id); - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); - strip->start = G.scene->r.cfra; /* could be mval[0] another time... */ - strip->end = strip->start + (strip->actend-strip->actstart); - /* simple prevention of zero strips */ - if(strip->start>strip->end-2) - strip->end= strip->start+100; - strip->repeat = 1.0; - - strip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION; - - find_stridechannel(ob, strip); - set_active_strip(ob, strip); - strip->object= group_get_member_with_action(ob->dup_group, act); - if(strip->object) - id_lib_extern(&strip->object->id); /* checks lib data, sets correct flag for saving then */ - - if(ob->nlastrips.first == NULL) - ob->nlaflag |= OB_NLA_OVERRIDE; - - BLI_addtail(&ob->nlastrips, strip); - - BIF_undo_push("Add NLA strip"); -} - -static void add_nla_block_by_name(char name[32], Object *ob, short hold, short add, float repeat) -{ - bAction *act=NULL; - bActionStrip *strip; - int cur; - - if (name){ - for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){ - if (strcmp(name,act->id.name)==0) { - break; - } - } - } - - /* Bail out if no action was chosen */ - if (!act){ - return; - } - - /* Initialize the new action block */ - strip = MEM_callocN(sizeof(bActionStrip), "bActionStrip"); - - deselect_nlachannel_keys(0); - - /* Link the action to the strip */ - strip->act = act; - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); - strip->start = G.scene->r.cfra; /* could be mval[0] another time... */ - strip->end = strip->start + (strip->actend-strip->actstart); - /* simple prevention of zero strips */ - if(strip->start>strip->end-2) - strip->end= strip->start+100; - - strip->flag = ACTSTRIP_SELECT|ACTSTRIP_LOCK_ACTION; //|ACTSTRIP_USEMATCH; - - if (hold==1) - strip->flag = strip->flag|ACTSTRIP_HOLDLASTFRAME; - - if (add==1) - strip->mode = ACTSTRIPMODE_ADD; - - find_stridechannel(ob, strip); - - set_active_strip(ob, strip); - - strip->repeat = repeat; - - act->id.us++; - - if(ob->nlastrips.first == NULL) - ob->nlaflag |= OB_NLA_OVERRIDE; - - BLI_addtail(&ob->nlastrips, strip); -} - -static void add_nla_databrowse_callback(unsigned short val) -{ - /* val is not used, databrowse needs it to optional pass an event */ - short event; - - if(OBACT==NULL) return; - - event= G.snla->menunr; /* set by databrowse or pupmenu */ - - add_nla_block(event); -} - -/* Adds strip to to active Object */ -void add_nlablock(void) -{ - Object *ob= OBACT; - short event; - short nr=0; - char *str, title[64]; - - if(ob==NULL) { - error("Need active Object to add NLA strips"); - return; - } - - sprintf(title, "Add Action strip to: %s", ob->id.name+2); - - /* Popup action menu */ - IDnames_to_pupstring(&str, title, NULL, &G.main->action, (ID *)G.scene, &nr); - - if(nr==-2) { - MEM_freeN(str); - - activate_databrowse((ID *)NULL, ID_AC, 0, 0, &G.snla->menunr, - add_nla_databrowse_callback ); - - return; - } - else { - event = pupmenu_col(str, 20); - MEM_freeN(str); - add_nla_block(event); - } -} - -/* Creates a new action, and makes a new actionstrip of that */ -void add_empty_nlablock(void) -{ - Object *ob= OBACT; - bAction *act= NULL; - bActionStrip *strip; - - /* check for active object first - will add strip to active object */ - if (ob == NULL) - return; - - /* make new action */ - if ((ob->type == OB_ARMATURE) && (ob->flag & OB_POSEMODE)) - act= add_empty_action("ObAction"); - else - act= add_empty_action("Action"); - - /* make a new strip for it */ - add_nla_block_by_name(act->id.name, ob, 0, 1, 1.0f); - strip= ob->nlastrips.last; - - /* change some settings of the strip - try to avoid bad scaling */ - if ((EFRA-CFRA) < 100) { - strip->flag |= ACTSTRIP_AUTO_BLENDS; - strip->flag &= ~ACTSTRIP_LOCK_ACTION; - strip->actstart = CFRA; - strip->actend = CFRA + 100; - - strip->start = CFRA; - strip->end = CFRA + 100; - } - else { - strip->flag |= ACTSTRIP_AUTO_BLENDS; - strip->flag &= ~ACTSTRIP_LOCK_ACTION; - strip->actstart = CFRA; - strip->actend = EFRA; - - strip->start = CFRA; - strip->end = EFRA; - } - - BIF_undo_push("Add NLA strip"); -} - -/* Adds strip to to active Object */ -static void relink_active_strip(void) -{ - Object *ob= OBACT; - bActionStrip *strip; - bAction *act; - short event; - short cur; - char *str; - - if(ob==NULL) return; - if(ob->nlaflag & OB_NLA_COLLAPSED) return; - - for (strip = ob->nlastrips.first; strip; strip=strip->next) - if(strip->flag & ACTSTRIP_ACTIVE) - break; - - if(strip==NULL) return; - - /* Popup action menu */ - IDnames_to_pupstring(&str, "Relink Action strip", NULL, &G.main->action, (ID *)G.scene, NULL); - if(str) { - event = pupmenu_col(str, 20); - MEM_freeN(str); - - for (cur = 1, act=G.main->action.first; act; act=act->id.next, cur++){ - if (cur==event){ - break; - } - } - - if(act) { - if(strip->act) strip->act->id.us--; - strip->act = act; - id_us_plus(&act->id); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } - } -} - - - -/* Left hand side of channels display, selects objects */ -static void mouse_nlachannels(short mval[2]) -{ - bActionStrip *strip= NULL; - Base *base; - Object *ob=NULL; - float x,y; - int click, obclick=0, actclick=0; - int wsize; - - wsize = (count_nla_levels ()*(NLACHANNELHEIGHT+NLACHANNELSKIP)); - wsize+= NLACHANNELHEIGHT/2; - - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - click = (int)floor( ((float)wsize - y) / (NLACHANNELHEIGHT+NLACHANNELSKIP)); - - if (click<0) - return; - - for (base = G.scene->base.first; base; base=base->next){ - if (nla_filter(base)) { - ob= base->object; - - /* See if this is a base selected */ - if (click==0) { - obclick= 1; - break; - } - click--; - - /* see if any strips under object */ - if ((ob->nlaflag & OB_NLA_COLLAPSED)==0) { - /* See if this is an action */ - if (ob->action){ - if (click==0) { - actclick= 1; - break; - } - click--; - } - - /* See if this is an nla strip */ - if(ob->nlastrips.first) { - for (strip = ob->nlastrips.first; strip; strip=strip->next){ - if (click==0) break; - click--; - } - if (strip && click==0) break; - } - } - } - } - - if (!base) - return; - - /* Handle object strip selection */ - if (G.qual & LR_SHIFTKEY) { - if (base->flag & SELECT) base->flag &= ~SELECT; - else base->flag |= SELECT; - } - else { - deselect_nlachannels (0); // Auto clear - base->flag |= SELECT; - } - ob->flag= base->flag; - - if(base!=BASACT) set_active_base(base); - - if(actclick) /* de-activate all strips */ - set_active_strip(ob, NULL); - else if(strip) { - if(mval[0] >= (NLAWIDTH-16)) /* toggle strip muting */ - strip->flag ^= ACTSTRIP_MUTE; - else /* set action */ - set_active_strip(ob, strip); - } - - /* icon toggles beside strip */ - if (obclick && mval[0]<20) { - /* collapse option for NLA object strip */ - ob->nlaflag ^= OB_NLA_COLLAPSED; - } - else if(obclick && mval[0]<36) { - /* override option for NLA */ - ob->nlaflag ^= OB_NLA_OVERRIDE; - } - else if((obclick) && (ob->ipo) && (mval[0] >= (NLAWIDTH-16))) { - /* mute Object IPO-block */ - ob->ipo->muteipo = (ob->ipo->muteipo)? 0: 1; - } - - ob->ctime= -1234567.0f; // eveil! - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - -} - -void deselect_nlachannel_keys (int test) -{ - Base *base; - int sel=1; - bActionChannel *chan; - bActionStrip *strip; - bConstraintChannel *conchan; - - /* Determine if this is selection or deselection */ - if (test){ - for (base=G.scene->base.first; base && sel; base=base->next){ - /* Test object ipos */ - if (is_ipo_key_selected(base->object->ipo)){ - sel = 0; - break; - } - - /* Test object constraint ipos */ - if (sel){ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){ - if (is_ipo_key_selected(conchan->ipo)){ - sel=0; - break; - } - } - } - - /* check if collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Test action ipos */ - if (sel){ - if (base->object->action){ - for (chan=base->object->action->chanbase.first; chan; chan=chan->next){ - if (is_ipo_key_selected(chan->ipo)){ - sel=0; - break; - } - - /* Test action constraints */ - if (sel){ - for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){ - if (is_ipo_key_selected(conchan->ipo)){ - sel=0; - break; - } - } - } - } - } - } - - /* Test NLA strips */ - if (sel){ - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT){ - sel = 0; - break; - } - } - } - } - } - else - sel=0; - - - /* Set the flags */ - for (base=G.scene->base.first; base; base=base->next){ - /* Set the object ipos */ - set_ipo_key_selection(base->object->ipo, sel); - - /* Set the object constraint ipos */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){ - set_ipo_key_selection(conchan->ipo, sel); - } - - /* check if collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Set the action ipos */ - if (base->object->action){ - for (chan=base->object->action->chanbase.first; chan; chan=chan->next){ - set_ipo_key_selection(chan->ipo, sel); - /* Set the action constraint ipos */ - for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) - set_ipo_key_selection(conchan->ipo, sel); - } - } - - /* Set the nlastrips */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - if (sel) - strip->flag |= ACTSTRIP_SELECT; - else - strip->flag &= ~ACTSTRIP_SELECT; - } - } -} - -/* very bad call! */ -static void recalc_all_ipos(void) -{ - Ipo *ipo; - IpoCurve *icu; - - /* Go to each ipo */ - for (ipo=G.main->ipo.first; ipo; ipo=ipo->id.next){ - for (icu = ipo->curve.first; icu; icu=icu->next){ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } - } -} - -void transform_nlachannel_keys(int mode, int dummy) -{ - switch (mode) { - case 'g': - { - initTransform(TFM_TIME_TRANSLATE, CTX_NONE); - Transform(); - } - break; - case 's': - { - initTransform(TFM_TIME_SCALE, CTX_NONE); - Transform(); - } - break; - case 'e': - { - initTransform(TFM_TIME_EXTEND, CTX_NONE); - Transform(); - } - break; - } -} - -void delete_nlachannel_keys(void) -{ - Base *base; - bActionChannel *chan; - bConstraintChannel *conchan; - bActionStrip *strip, *nextstrip; - - for (base = G.scene->base.first; base; base=base->next){ - /* Delete object ipos */ - delete_ipo_keys(base->object->ipo); - - /* Delete object constraint keys */ - for(conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next) - delete_ipo_keys(conchan->ipo); - - /* skip actions and nlastrips if object collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Delete NLA strips */ - for (strip = base->object->nlastrips.first; strip; strip=nextstrip){ - nextstrip=strip->next; - if (strip->flag & ACTSTRIP_SELECT){ - free_actionstrip(strip); - BLI_remlink(&base->object->nlastrips, strip); - MEM_freeN(strip); - } - } - - /* Delete action ipos */ - if (base->object->action){ - for (chan=base->object->action->chanbase.first; chan; chan=chan->next){ - if (EDITABLE_ACHAN(chan)) - delete_ipo_keys(chan->ipo); - - /* Delete action constraint keys */ - for(conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){ - if (EDITABLE_CONCHAN(conchan)) - delete_ipo_keys(conchan->ipo); - } - } - } - } - - recalc_all_ipos(); // bad - synchronize_action_strips(); - - BIF_undo_push("Delete NLA keys"); - allspace(REMAKEIPO,0); - allqueue (REDRAWVIEW3D, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); -} - -void duplicate_nlachannel_keys(void) -{ - Base *base; - bActionChannel *chan; - bConstraintChannel *conchan; - bActionStrip *strip, *laststrip; - - /* Find selected items */ - for (base = G.scene->base.first; base; base=base->next){ - /* Duplicate object keys */ - duplicate_ipo_keys(base->object->ipo); - - /* Duplicate object constraint keys */ - for(conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next) - duplicate_ipo_keys(conchan->ipo); - - /* skip actions and nlastrips if object collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Duplicate nla strips */ - laststrip = base->object->nlastrips.last; - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT){ - bActionStrip *newstrip; - - copy_actionstrip(&newstrip, &strip); - - BLI_addtail(&base->object->nlastrips, newstrip); - - strip->flag &= ~ACTSTRIP_SELECT; - newstrip->flag |= ACTSTRIP_SELECT; - set_active_strip(base->object, newstrip); - - } - if (strip==laststrip) - break; - } - - /* Duplicate actionchannel keys */ - if (base->object->action){ - for (chan=base->object->action->chanbase.first; chan; chan=chan->next){ - if (EDITABLE_ACHAN(chan)) - duplicate_ipo_keys(chan->ipo); - - /* Duplicate action constraint keys */ - for(conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) { - if (EDITABLE_CONCHAN(conchan)) - duplicate_ipo_keys(conchan->ipo); - } - } - } - } - - BIF_undo_push("Duplicate NLA"); - transform_nlachannel_keys ('g', 0); -} - -void borderselect_nla(void) -{ - Base *base; - rcti rect; - rctf rectf; - int val, selectmode; - short mval[2]; - float ymin, ymax; - bActionStrip *strip; - bConstraintChannel *conchan; - - if ( (val = get_border (&rect, 3)) ){ - if (val == LEFTMOUSE) - selectmode = SELECT_ADD; - else - selectmode = SELECT_SUBTRACT; - - mval[0]= rect.xmin; - mval[1]= rect.ymin+2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax-2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - ymax = count_nla_levels(); - ymax*= (NLACHANNELHEIGHT+NLACHANNELSKIP); - ymax+= (NLACHANNELHEIGHT+NLACHANNELSKIP)/2; - - for (base=G.scene->base.first; base; base=base->next){ - if (nla_filter(base)) { - - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* Check object ipos */ - if (base->object->ipo){ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) - borderselect_ipo_key(base->object->ipo, rectf.xmin, rectf.xmax, - selectmode); - } - /* Check object constraint ipos */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) - borderselect_ipo_key(conchan->ipo, rectf.xmin, rectf.xmax, - selectmode); - } - - ymax=ymin; - - /* skip actions and nlastrips if object collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Check action ipos */ - if (base->object->action){ - bActionChannel *chan; - float xmin, xmax; - - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* if action is mapped in NLA, it returns a correction */ - xmin= get_action_frame(base->object, rectf.xmin); - xmax= get_action_frame(base->object, rectf.xmax); - - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){ - for (chan=base->object->action->chanbase.first; chan; chan=chan->next){ - borderselect_ipo_key(chan->ipo, xmin, xmax, selectmode); - /* Check action constraint ipos */ - for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) - borderselect_ipo_key(conchan->ipo, xmin, xmax, selectmode); - } - } - - ymax=ymin; - } /* End of if action */ - - /* Skip nlastrips */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - // - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){ - if (!((rectf.xmaxstart) || (rectf.xmin>strip->end))){ - if (val==1) - strip->flag |= ACTSTRIP_SELECT; - else - strip->flag &= ~ACTSTRIP_SELECT; - } - } - - ymax=ymin; - } - } - } - BIF_undo_push("Border select NLA"); - allqueue(REDRAWMARKER, 0); - } -} - -/* right hand side of window, does ipokeys, actionkeys or strips */ -static void mouse_nla(int selectmode) -{ - Base *base; - bAction *act; - bActionChannel *chan; - bActionStrip *rstrip; - bConstraintChannel *conchan; - TimeMarker *marker; - float selx; - short mval[2]; - short sel, isdone=0; - - getmouseco_areawin (mval); - - /* Try object ipo or ob-constraint ipo selection */ - base= get_nearest_nlachannel_ob_key(&selx, &sel); - marker=find_nearest_marker(1); - if (base) { - isdone= 1; - - if (selectmode == SELECT_REPLACE){ - deselect_nlachannel_keys(0); - selectmode = SELECT_ADD; - } - - select_ipo_key(base->object->ipo, selx, selectmode); - - /* Try object constraint selection */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next) - select_ipo_key(conchan->ipo, selx, selectmode); - } - else if (marker) { - /* marker */ - if (selectmode == SELECT_REPLACE) { - deselect_markers(0, 0); - marker->flag |= SELECT; - } - else if (selectmode == SELECT_INVERT) { - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - } - else if (selectmode == SELECT_ADD) - marker->flag |= SELECT; - else if (selectmode == SELECT_SUBTRACT) - marker->flag &= ~SELECT; - - std_rmouse_transform(transform_markers); - - allqueue(REDRAWMARKER, 0); - } - else { - /* Try action ipo selection */ - act= get_nearest_nlachannel_ac_key(&selx, &sel); - if (act) { - isdone= 1; - - if (selectmode == SELECT_REPLACE){ - deselect_nlachannel_keys(0); - selectmode = SELECT_ADD; - } - - for (chan=act->chanbase.first; chan; chan=chan->next) { - select_ipo_key(chan->ipo, selx, selectmode); - /* Try action constraint selection */ - for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) - select_ipo_key(conchan->ipo, selx, selectmode); - } - } - else { - - /* Try nla strip selection */ - base= get_nearest_nlastrip(&rstrip, &sel); - if (base){ - isdone= 1; - - if (!(G.qual & LR_SHIFTKEY)){ - deselect_nlachannel_keys(0); - sel = 0; - } - - if (sel) - rstrip->flag &= ~ACTSTRIP_SELECT; - else - rstrip->flag |= ACTSTRIP_SELECT; - - set_active_strip(base->object, rstrip); - - if(base!=BASACT) set_active_base(base); - } - } - } - - if(isdone) { - std_rmouse_transform(transform_nlachannel_keys); - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWNLA, 0); - } -} - -/* This function is currently more complicated than it seems like it should be. -* However, this will be needed once the nla strip timeline is more complex */ -static Base *get_nearest_nlastrip (bActionStrip **rstrip, short *sel) -{ - Base *base, *firstbase=NULL; - bActionStrip *strip, *firststrip=NULL, *foundstrip=NULL; - rctf rectf; - float ymin, ymax; - short mval[2]; - short foundsel = 0; - - getmouseco_areawin (mval); - - mval[0]-=7; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - - mval[0]+=14; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - ymax = count_nla_levels(); - ymax*=(NLACHANNELHEIGHT + NLACHANNELSKIP); - ymax+= NLACHANNELHEIGHT/2; - - for (base = G.scene->base.first; base; base=base->next){ - if (nla_filter(base)) { - - /* Skip object ipos */ - ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* check if skip strips if collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Skip action ipos */ - if (base->object->action) - ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* the strips */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next){ - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - /* Do Ytest */ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){ - /* Do XTest */ - if (!((rectf.xmaxstart) || (rectf.xmin>strip->end))){ - if (!firstbase){ - firstbase=base; - firststrip=strip; - *sel = strip->flag & ACTSTRIP_SELECT; - } - - if (strip->flag & ACTSTRIP_SELECT){ - if (!foundsel){ - foundsel=1; - foundstrip = strip; - } - } - else if (foundsel && strip != foundstrip){ - *rstrip=strip; - *sel = 0; - return base; - } - } - } - ymax=ymin; - } - } - } - *rstrip=firststrip; - return firstbase; -} - -static Base *get_nearest_nlachannel_ob_key (float *index, short *sel) -{ - Base *base; - IpoCurve *icu; - Base *firstbase=NULL; - bConstraintChannel *conchan; - int foundsel=0; - float firstvertx=-1, foundx=-1; - int i; - short mval[2]; - float ymin, ymax; - rctf rectf; - - *index=0; - - getmouseco_areawin (mval); - - mval[0]-=7; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - - mval[0]+=14; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - ymax = count_nla_levels(); - - ymax*= (NLACHANNELHEIGHT + NLACHANNELSKIP); - ymax+= NLACHANNELHEIGHT/2; - - *sel=0; - - for (base=G.scene->base.first; base; base=base->next){ - if (nla_filter(base)) { - - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* Handle object ipo selection */ - if (base->object->ipo){ - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){ - for (icu=base->object->ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0] > rectf.xmin && icu->bezt[i].vec[1][0] <= rectf.xmax ){ - if (!firstbase){ - firstbase=base; - firstvertx=icu->bezt[i].vec[1][0]; - *sel = icu->bezt[i].f2 & 1; - } - - if (icu->bezt[i].f2 & 1){ - if (!foundsel){ - foundsel=1; - foundx = icu->bezt[i].vec[1][0]; - } - } - else if (foundsel && icu->bezt[i].vec[1][0] != foundx){ - *index=icu->bezt[i].vec[1][0]; - *sel = 0; - return base; - } - } - } - } - } - } - /* Handle object constraint ipos */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next){ - if ( !((ymax < rectf.ymin) || (ymin > rectf.ymax)) && conchan->ipo){ - for (icu=conchan->ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0] > rectf.xmin && icu->bezt[i].vec[1][0] <= rectf.xmax ){ - if (!firstbase){ - firstbase=base; - firstvertx=icu->bezt[i].vec[1][0]; - *sel = icu->bezt[i].f2 & 1; - } - - if (icu->bezt[i].f2 & 1){ - if (!foundsel){ - foundsel=1; - foundx = icu->bezt[i].vec[1][0]; - } - } - else if (foundsel && icu->bezt[i].vec[1][0] != foundx){ - *index=icu->bezt[i].vec[1][0]; - *sel = 0; - return base; - } - } - } - } - } - } - - ymax=ymin; - - /* Skip actions and nlastrips if object is collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Skip action ipos */ - if (base->object->action){ - ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP); - } - /* Skip nlastrips */ - ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP)*BLI_countlist(&base->object->nlastrips); - } - } - - *index=firstvertx; - return firstbase; -} - -static bAction *get_nearest_nlachannel_ac_key (float *index, short *sel) -{ - Base *base; - IpoCurve *icu; - bAction *firstact=NULL; - bActionChannel *chan; - bConstraintChannel *conchan; - rctf rectf; - float firstvert=-1, foundx=-1; - float ymin, ymax, xmin, xmax; - int i; - int foundsel=0; - short mval[2]; - - *index=0; - - getmouseco_areawin (mval); - - mval[0]-=7; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - - mval[0]+=14; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - ymax = count_nla_levels(); - - ymax*= (NLACHANNELHEIGHT + NLACHANNELSKIP); - ymax+= NLACHANNELHEIGHT/2; - - *sel=0; - - for (base=G.scene->base.first; base; base=base->next){ - /* Handle object ipo selection */ - if (nla_filter(base)) { - - /* Skip object ipo and ob-constraint ipo */ - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - - /* skip this object if it is collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - ymax=ymin; - - /* Handle action ipos */ - if (base->object->action){ - bAction *act= base->object->action; - - /* if action is mapped in NLA, it returns a correction */ - xmin= get_action_frame(base->object, rectf.xmin); - xmax= get_action_frame(base->object, rectf.xmax); - - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))){ - for (chan=act->chanbase.first; chan; chan=chan->next){ - if(chan->ipo) { - for (icu=chan->ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] <= xmax ){ - if (!firstact){ - firstact= act; - firstvert=icu->bezt[i].vec[1][0]; - *sel = icu->bezt[i].f2 & 1; - } - - if (icu->bezt[i].f2 & 1){ - if (!foundsel){ - foundsel=1; - foundx = icu->bezt[i].vec[1][0]; - } - } - else if (foundsel && icu->bezt[i].vec[1][0] != foundx){ - *index=icu->bezt[i].vec[1][0]; - *sel = 0; - return act; - } - } - } - } - } - - for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next){ - ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP); - if ( !((ymax < rectf.ymin) || (ymin > rectf.ymax)) && conchan->ipo){ - for (icu=conchan->ipo->curve.first; icu; icu=icu->next){ - for (i=0; itotvert; i++){ - if (icu->bezt[i].vec[1][0] > xmin && icu->bezt[i].vec[1][0] <= xmax ){ - if (!firstact){ - firstact=base->object->action; - firstvert=icu->bezt[i].vec[1][0]; - *sel = icu->bezt[i].f2 & 1; - } - - if (icu->bezt[i].f2 & 1){ - if (!foundsel){ - foundsel=1; - foundx = icu->bezt[i].vec[1][0]; - } - } - else if (foundsel && icu->bezt[i].vec[1][0] != foundx){ - *index=icu->bezt[i].vec[1][0]; - *sel = 0; - return base->object->action; - } - } - } - } - } - ymax=ymin; - } - - - } - } - ymax=ymin; - } - - /* Skip nlastrips */ - ymax-=(NLACHANNELHEIGHT+NLACHANNELSKIP)*BLI_countlist(&base->object->nlastrips); - } - } - - *index=firstvert; - return firstact; -} - -void deselect_nlachannels(int test) -{ - Base *base; - int sel = 1; - - if (test){ - for (base=G.scene->base.first; base; base=base->next){ - /* Check base flags for previous selection */ - if (base->flag & SELECT){ - sel=0; - break; - } - } - } - else - sel = 0; - - /* Select objects */ - for (base=G.scene->base.first; base; base=base->next){ - if (sel){ - if (nla_filter(base)) - base->flag |= SELECT; - } - else - base->flag &= ~SELECT; - - base->object->flag= base->flag; - } -} - -static Object *get_object_from_active_strip(void) { - - Base *base; - bActionStrip *strip; - - for (base=G.scene->base.first; base; base=base->next) { - if ((base->object->nlaflag & OB_NLA_COLLAPSED)==0) { - for (strip = base->object->nlastrips.first; - strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT) { - return base->object; - } - } - } - } - return NULL; -} - - -void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - SpaceNla *snla = curarea->spacedata.first; - int doredraw= 0; - short mval[2]; - float dx,dy; - int cfra; - short mousebut = L_MOUSE; - Object *ob; //in shift-B / bake - - if (curarea->win==0) return; - if (!snla) return; - - if(val) { - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - getmouseco_areawin(mval); - - switch(event) { - case UI_BUT_EVENT: - do_nlabuts(val); // in drawnla.c - break; - - case HOMEKEY: - do_nla_buttons(B_NLAHOME); - break; - - case EQUALKEY: - shift_nlastrips_up(); - break; - - case PAGEUPKEY: - if (G.qual & LR_CTRLKEY) - shift_nlastrips_up(); - else { - nextprev_marker(1); - allqueue(REDRAWMARKER, 0); - } - break; - - case MINUSKEY: - shift_nlastrips_down(); - break; - - case PAGEDOWNKEY: - if (G.qual & LR_CTRLKEY) - shift_nlastrips_down(); - else { - nextprev_marker(-1); - allqueue(REDRAWMARKER, 0); - } - break; - - case AKEY: - if (G.qual & LR_SHIFTKEY){ - add_nlablock(); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWVIEW3D, 0); - } - else if (G.qual & LR_CTRLKEY) { - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - } - else{ - if (mval[0]>=NLAWIDTH) - deselect_nlachannel_keys(1); - else{ - deselect_nlachannels(1); - allqueue (REDRAWVIEW3D, 0); - } - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - BIF_undo_push("(De)select all NLA"); - } - break; - - case BKEY: - if (G.qual & LR_SHIFTKEY){ - bake_all_to_action(); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWVIEW3D, 0); - BIF_undo_push("Bake All To Action"); - ob = get_object_from_active_strip(); - //build_match_caches(ob); - } - else if (G.qual & LR_CTRLKEY) - borderselect_markers(); - else - borderselect_nla(); - break; - - case CKEY: - if(G.qual==LR_CTRLKEY) { - if(okee("Copy Modifiers")) - copy_action_modifiers(); - } - else convert_nla(); - break; - - case DKEY: - if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY) && mval[0]>=NLAWIDTH) { - duplicate_marker(); - } - else if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){ - duplicate_nlachannel_keys(); - update_for_newframe_muted(); - } - - break; - - case EKEY: - if (mval[0] >= NLAWIDTH) { - transform_nlachannel_keys ('e', 0); - update_for_newframe_muted(); - } - break; - - case GKEY: - if (mval[0]>=NLAWIDTH) { - if (G.qual & LR_CTRLKEY) { - transform_markers('g', 0); - } - else { - transform_nlachannel_keys ('g', 0); - update_for_newframe_muted(); - } - } - break; - - case MKEY: - /* marker operations */ - if (G.qual == 0) - add_marker(CFRA); - else if (G.qual == LR_CTRLKEY) - rename_marker(); - else - break; - allqueue(REDRAWMARKER, 0); - break; - - case NKEY: - if(G.qual==0) { - toggle_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - scrarea_queue_winredraw(curarea); - } - else if (G.qual & LR_SHIFTKEY) { - add_empty_nlablock(); - } - break; - case LKEY: - relink_active_strip(); - break; - - case PKEY: - if (G.qual & LR_CTRLKEY) /* set preview range */ - anim_previewrange_set(); - else if (G.qual & LR_ALTKEY) /* clear preview range */ - anim_previewrange_clear(); - allqueue(REDRAWMARKER, 0); - break; - - case SKEY: - if (G.qual==LR_ALTKEY) { - val= pupmenu("Action Strip Scale%t|Reset Strip Scale%x1|Remap Action Start/End%x2|Apply Scale%x3"); - if (val > 0) - reset_action_strips(val); - } - else if (G.qual & LR_SHIFTKEY) { - if (snla->flag & SNLA_DRAWTIME) - val= pupmenu("Snap To%t|Nearest Second%x3|Current Time%x2"); - else - val= pupmenu("Snap To%t|Nearest Frame%x1|Current Frame%x2"); - if (ELEM3(val, 1, 2, 3)) - snap_action_strips(val); - } - else { - if (mval[0]>=NLAWIDTH) - transform_nlachannel_keys ('s', 0); - update_for_newframe_muted(); - } - break; - - case TKEY: - if (G.qual & LR_CTRLKEY) { - val= pupmenu("Time value%t|Frames %x1|Seconds%x2"); - - if (val > 0) { - if (val == 2) snla->flag |= SNLA_DRAWTIME; - else snla->flag &= ~SNLA_DRAWTIME; - - doredraw= 1; - } - } - break; - - case DELKEY: - case XKEY: - if (mval[0]>=NLAWIDTH) { - if (okee("Erase selected?")) { - delete_nlachannel_keys(); - update_for_newframe_muted(); - - remove_marker(); - - allqueue(REDRAWMARKER, 0); - } - } - break; - - /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, - * based on user preference USER_LMOUSESELECT - */ - case LEFTMOUSE: - if(view2dmove(LEFTMOUSE)) - break; // only checks for sliders - else if (mval[0]>=snla->v2d.mask.xmin) { - do { - getmouseco_areawin(mval); - - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra= (int)dx; - if(cfra< 1) cfra= 1; - - if( cfra!=CFRA ) { - CFRA= cfra; - update_for_newframe(); - force_draw_all(0); - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - break; - } - /* else pass on! */ - case RIGHTMOUSE: - if (mval[0]>=snla->v2d.mask.xmin) { - if(G.qual & LR_SHIFTKEY) - mouse_nla(SELECT_INVERT); - else - mouse_nla(SELECT_REPLACE); - } - else - mouse_nlachannels(mval); - break; - - case PADPLUSKEY: - view2d_zoom(G.v2d, 0.1154, sa->winx, sa->winy); - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case PADMINUS: - view2d_zoom(G.v2d, -0.15, sa->winx, sa->winy); - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - } - } - - if(doredraw) scrarea_queue_winredraw(curarea); -} - -void bake_all_to_action(void) -{ - Object *ob; - bAction *newAction; - Ipo *ipo; - ID *id; - short hold, add; - float repeat; - - /* burn object-level motion into a new action */ - ob = get_object_from_active_strip(); - if (ob) { - if (ob->flag&OB_ARMATURE) { - //newAction = bake_obIPO_to_action(ob); - newAction = NULL; - if (newAction) { - /* unlink the object's IPO */ - ipo=ob->ipo; - if (ipo) { - id = &ipo->id; - if (id->us > 0) - id->us--; - ob->ipo = NULL; - } - - /* add the new Action to NLA as a strip */ - hold=1; - add=1; - repeat=1.0; - printf("about to add nla block...\n"); - add_nla_block_by_name(newAction->id.name, ob, hold, add, repeat); - BIF_undo_push("Add NLA strip"); - } - } - } -} - -void copy_action_modifiers(void) -{ - bActionStrip *strip, *actstrip; - Object *ob= OBACT; - - if(ob==NULL) - return; - - /* active strip */ - for (actstrip=ob->nlastrips.first; actstrip; actstrip=actstrip->next) - if(actstrip->flag & ACTSTRIP_ACTIVE) - break; - if(actstrip==NULL) - return; - - /* copy to selected items */ - for (strip=ob->nlastrips.first; strip; strip=strip->next){ - if (strip->flag & ACTSTRIP_SELECT) { - if(strip!=actstrip) { - if (strip->modifiers.first) - BLI_freelistN(&strip->modifiers); - if (actstrip->modifiers.first) - duplicatelist (&strip->modifiers, &actstrip->modifiers); - } - } - } - - BIF_undo_push("Copy Action Modifiers"); - allqueue(REDRAWNLA, 0); - DAG_scene_flush_update(G.scene, screen_view3d_layers()); -} - diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c deleted file mode 100644 index a14b0ccc389..00000000000 --- a/source/blender/src/editnode.c +++ /dev/null @@ -1,2244 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_action_types.h" -#include "DNA_color_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_node_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_colortools.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_node.h" -#include "BKE_material.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" - -#include "BIF_cursors.h" -#include "BIF_editview.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_renderwin.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BDR_editobject.h" - -#include "RE_pipeline.h" -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "butspace.h" -#include "PIL_time.h" -#include "mydevice.h" -#include "winlay.h" - - -/* currently called from BIF_preview_changed */ -void snode_tag_dirty(SpaceNode *snode) -{ - bNode *node; - - if(snode->treetype==NTREE_SHADER) { - if(snode->nodetree) { - for(node= snode->nodetree->nodes.first; node; node= node->next) { - if(node->type==SH_NODE_OUTPUT) - node->lasty= 0; - } - snode->flag |= SNODE_DO_PREVIEW; /* this adds an afterqueue on a redraw, to allow button previews to work first */ - } - } - allqueue(REDRAWNODE, 1); -} - -static void shader_node_previewrender(ScrArea *sa, SpaceNode *snode) -{ - bNode *node; - - if(snode->id==NULL) return; - if( ((Material *)snode->id )->use_nodes==0 ) return; - - for(node= snode->nodetree->nodes.first; node; node= node->next) { - if(node->type==SH_NODE_OUTPUT) { - if(node->flag & NODE_DO_OUTPUT) { - if(node->lastylasty; - - ri.curtile = 0; - ri.tottile = 0; - ri.rect = NULL; - ri.pr_rectx = PREVIEW_RENDERSIZE; - ri.pr_recty = PREVIEW_RENDERSIZE; - - BIF_previewrender(snode->id, &ri, NULL, PR_DO_RENDER); /* sends redraw event */ - if(ri.rect) MEM_freeN(ri.rect); - - /* when not finished... */ - if(ri.curtilewin, RENDERPREVIEW, 1); -// if(test!=node->lasty) -// printf("node rendered to %d\n", node->lasty); - - break; - } - } - } - } -} - - -static void snode_handle_recalc(SpaceNode *snode) -{ - if(snode->treetype==NTREE_SHADER) { - BIF_preview_changed(ID_MA); /* signals buttons windows and node editors */ - } - else if(snode->treetype==NTREE_COMPOSIT) { - if(G.scene->use_nodes) { - snode->nodetree->timecursor= set_timecursor; - G.afbreek= 0; - snode->nodetree->test_break= blender_test_break; - - BIF_store_spare(); - - ntreeCompositExecTree(snode->nodetree, &G.scene->r, 1); /* 1 is do_previews */ - - snode->nodetree->timecursor= NULL; - snode->nodetree->test_break= NULL; - waitcursor(0); - - allqueue(REDRAWNODE, 1); - allqueue(REDRAWIMAGE, 1); - if(G.scene->r.scemode & R_DOCOMP) { - BIF_redraw_render_rect(); /* seems to screwup display? */ - mywinset(curarea->win); - } - } - } -} - -static void shader_node_event(SpaceNode *snode, short event) -{ - switch(event) { - case B_REDR: - allqueue(REDRAWNODE, 1); - break; - default: - /* B_NODE_EXEC */ - snode_handle_recalc(snode); - break; - - } -} - -static void load_node_image(char *str) /* called from fileselect */ -{ - SpaceNode *snode= curarea->spacedata.first; - bNode *node= nodeGetActive(snode->edittree); - Image *ima= NULL; - - ima= BKE_add_image_file(str); - if(ima) { - if(node->id) - node->id->us--; - - node->id= &ima->id; - id_us_plus(node->id); - - BLI_strncpy(node->name, node->id->name+2, 21); - - BKE_image_signal(ima, node->storage, IMA_SIGNAL_RELOAD); - - NodeTagChanged(snode->edittree, node); - snode_handle_recalc(snode); - allqueue(REDRAWNODE, 0); - } -} - -static bNode *snode_get_editgroup(SpaceNode *snode) -{ - bNode *gnode; - - /* get the groupnode */ - for(gnode= snode->nodetree->nodes.first; gnode; gnode= gnode->next) - if(gnode->flag & NODE_GROUP_EDIT) - break; - return gnode; -} - -/* node has to be of type 'render layers' */ -/* is a bit clumsy copying renderdata here... scene nodes use render size of current render */ -static void composite_node_render(SpaceNode *snode, bNode *node) -{ - RenderData rd; - Scene *scene= NULL; - int scemode, actlay; - - /* the button press won't show up otherwise, button hilites disabled */ - force_draw(0); - - if(node->id && node->id!=(ID *)G.scene) { - scene= G.scene; - set_scene_bg((Scene *)node->id); - rd= G.scene->r; - G.scene->r.xsch= scene->r.xsch; - G.scene->r.ysch= scene->r.ysch; - G.scene->r.size= scene->r.size; - G.scene->r.mode &= ~(R_BORDER|R_DOCOMP); - G.scene->r.mode |= scene->r.mode & R_BORDER; - G.scene->r.border= scene->r.border; - } - - scemode= G.scene->r.scemode; - actlay= G.scene->r.actlay; - - G.scene->r.scemode |= R_SINGLE_LAYER; - G.scene->r.actlay= node->custom1; - - BIF_do_render(0); - - G.scene->r.scemode= scemode; - G.scene->r.actlay= actlay; - - node->custom2= 0; - - if(scene) { - G.scene->r= rd; - set_scene_bg(scene); - } -} - -static void composit_node_event(SpaceNode *snode, short event) -{ - - switch(event) { - case B_REDR: - allqueue(REDRAWNODE, 1); - break; - case B_NODE_LOADIMAGE: - { - bNode *node= nodeGetActive(snode->edittree); - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if(node->id) - strcpy(name, ((Image *)node->id)->name); - else strcpy(name, U.textudir); - if (G.qual & LR_CTRLKEY) { - activate_imageselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image); - } else { - activate_fileselect(FILE_SPECIAL, "SELECT IMAGE", name, load_node_image); - } - break; - } - case B_NODE_TREE_EXEC: - snode_handle_recalc(snode); - break; - default: - /* B_NODE_EXEC */ - { - bNode *node= BLI_findlink(&snode->edittree->nodes, event-B_NODE_EXEC); - if(node) { - NodeTagChanged(snode->edittree, node); - NodeTagIDChanged(snode->nodetree, node->id); /* Scene-layer nodes, texture nodes, image nodes, all can be used many times */ - - /* not the best implementation of the world... but we need it to work now :) */ - if(node->type==CMP_NODE_R_LAYERS && node->custom2) { - composite_node_render(snode, node); - /* new event, a render can go fullscreen and open new window */ - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - } - else { - node= snode_get_editgroup(snode); - if(node) - NodeTagIDChanged(snode->nodetree, node->id); - - snode_handle_recalc(snode); - } - } - } - } -} - - -/* assumes nothing being done in ntree yet, sets the default in/out node */ -/* called from shading buttons or header */ -void node_shader_default(Material *ma) -{ - bNode *in, *out; - bNodeSocket *fromsock, *tosock; - - /* but lets check it anyway */ - if(ma->nodetree) { - printf("error in shader initialize\n"); - return; - } - - ma->nodetree= ntreeAddTree(NTREE_SHADER); - - out= nodeAddNodeType(ma->nodetree, SH_NODE_OUTPUT, NULL); - out->locx= 300.0f; out->locy= 300.0f; - - in= nodeAddNodeType(ma->nodetree, SH_NODE_MATERIAL, NULL); - in->locx= 10.0f; in->locy= 300.0f; - nodeSetActive(ma->nodetree, in); - - /* only a link from color to color */ - fromsock= in->outputs.first; - tosock= out->inputs.first; - nodeAddLink(ma->nodetree, in, fromsock, out, tosock); - - ntreeSolveOrder(ma->nodetree); /* needed for pointers */ -} - -/* assumes nothing being done in ntree yet, sets the default in/out node */ -/* called from shading buttons or header */ -void node_composit_default(Scene *sce) -{ - bNode *in, *out; - bNodeSocket *fromsock, *tosock; - - /* but lets check it anyway */ - if(sce->nodetree) { - printf("error in composit initialize\n"); - return; - } - - sce->nodetree= ntreeAddTree(NTREE_COMPOSIT); - - out= nodeAddNodeType(sce->nodetree, CMP_NODE_COMPOSITE, NULL); - out->locx= 300.0f; out->locy= 400.0f; - - in= nodeAddNodeType(sce->nodetree, CMP_NODE_R_LAYERS, NULL); - in->locx= 10.0f; in->locy= 400.0f; - nodeSetActive(sce->nodetree, in); - - /* links from color to color */ - fromsock= in->outputs.first; - tosock= out->inputs.first; - nodeAddLink(sce->nodetree, in, fromsock, out, tosock); - - ntreeSolveOrder(sce->nodetree); /* needed for pointers */ - - ntreeCompositForceHidden(sce->nodetree); -} - -/* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */ -void snode_set_context(SpaceNode *snode) -{ - Object *ob= OBACT; - bNode *node= NULL; - - snode->nodetree= NULL; - snode->id= snode->from= NULL; - - if(snode->treetype==NTREE_SHADER) { - /* need active object, or we allow pinning... */ - if(ob) { - Material *ma= give_current_material(ob, ob->actcol); - if(ma) { - snode->from= material_from(ob, ob->actcol); - snode->id= &ma->id; - snode->nodetree= ma->nodetree; - } - } - } - else if(snode->treetype==NTREE_COMPOSIT) { - snode->from= NULL; - snode->id= &G.scene->id; - - /* bit clumsy but reliable way to see if we draw first time */ - if(snode->nodetree==NULL) - ntreeCompositForceHidden(G.scene->nodetree); - - snode->nodetree= G.scene->nodetree; - } - - /* find editable group */ - if(snode->nodetree) - for(node= snode->nodetree->nodes.first; node; node= node->next) - if(node->flag & NODE_GROUP_EDIT) - break; - - if(node && node->id) - snode->edittree= (bNodeTree *)node->id; - else - snode->edittree= snode->nodetree; -} - -/* on activate image viewer, check if we show it */ -static void node_active_image(Image *ima) -{ - ScrArea *sa; - SpaceImage *sima= NULL; - - /* find an imagewindow showing render result */ - for(sa=G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_IMAGE) { - sima= sa->spacedata.first; - if(sima->image && sima->image->source!=IMA_SRC_VIEWER) - break; - } - } - if(sa && sima) { - sima->image= ima; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } -} - - -static void node_set_active(SpaceNode *snode, bNode *node) -{ - - nodeSetActive(snode->edittree, node); - - if(node->type!=NODE_GROUP) { - - /* tree specific activate calls */ - if(snode->treetype==NTREE_SHADER) { - - /* when we select a material, active texture is cleared, for buttons */ - if(node->id && GS(node->id->name)==ID_MA) - nodeClearActiveID(snode->edittree, ID_TE); - if(node->id) - BIF_preview_changed(-1); /* temp hack to force texture preview to update */ - - allqueue(REDRAWBUTSSHADING, 1); - allqueue(REDRAWIPO, 0); - } - else if(snode->treetype==NTREE_COMPOSIT) { - /* make active viewer, currently only 1 supported... */ - if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) { - bNode *tnode; - int was_output= node->flag & NODE_DO_OUTPUT; - - for(tnode= snode->edittree->nodes.first; tnode; tnode= tnode->next) - if( ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) - tnode->flag &= ~NODE_DO_OUTPUT; - - node->flag |= NODE_DO_OUTPUT; - if(was_output==0) { - bNode *gnode; - - NodeTagChanged(snode->edittree, node); - - /* if inside group, tag entire group */ - gnode= snode_get_editgroup(snode); - if(gnode) - NodeTagIDChanged(snode->nodetree, gnode->id); - - snode_handle_recalc(snode); - } - - /* addnode() doesnt link this yet... */ - node->id= (ID *)BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); - } - else if(node->type==CMP_NODE_IMAGE) { - if(node->id) - node_active_image((Image *)node->id); - } - else if(node->type==CMP_NODE_R_LAYERS) { - if(node->id==NULL || node->id==(ID *)G.scene) { - G.scene->r.actlay= node->custom1; - allqueue(REDRAWBUTSSCENE, 0); - } - } - } - } -} - -void snode_make_group_editable(SpaceNode *snode, bNode *gnode) -{ - bNode *node; - - /* make sure nothing has group editing on */ - for(node= snode->nodetree->nodes.first; node; node= node->next) - node->flag &= ~NODE_GROUP_EDIT; - - if(gnode==NULL) { - /* with NULL argument we do a toggle */ - if(snode->edittree==snode->nodetree) - gnode= nodeGetActive(snode->nodetree); - } - - if(gnode && gnode->type==NODE_GROUP && gnode->id) { - if(gnode->id->lib) { - if(okee("Make Group Local")) - ntreeMakeLocal((bNodeTree *)gnode->id); - else - return; - } - gnode->flag |= NODE_GROUP_EDIT; - snode->edittree= (bNodeTree *)gnode->id; - - /* deselect all other nodes, so we can also do grabbing of entire subtree */ - for(node= snode->nodetree->nodes.first; node; node= node->next) - node->flag &= ~SELECT; - gnode->flag |= SELECT; - - } - else - snode->edittree= snode->nodetree; - - ntreeSolveOrder(snode->nodetree); - - /* finally send out events for new active node */ - if(snode->treetype==NTREE_SHADER) { - allqueue(REDRAWBUTSSHADING, 0); - - BIF_preview_changed(-1); /* temp hack to force texture preview to update */ - } - - allqueue(REDRAWNODE, 0); -} - -void node_ungroup(SpaceNode *snode) -{ - bNode *gnode; - - /* are we inside of a group? */ - gnode= snode_get_editgroup(snode); - if(gnode) - snode_make_group_editable(snode, NULL); - - gnode= nodeGetActive(snode->edittree); - if(gnode==NULL) return; - - if(gnode->type!=NODE_GROUP) - error("Not a group"); - else { - if(nodeGroupUnGroup(snode->edittree, gnode)) { - - BIF_undo_push("Deselect all nodes"); - allqueue(REDRAWNODE, 0); - } - else - error("Can't ungroup"); - } -} - -/* when links in groups change, inputs/outputs change, nodes added/deleted... */ -static void snode_verify_groups(SpaceNode *snode) -{ - bNode *gnode; - - gnode= snode_get_editgroup(snode); - - /* does all materials */ - if(gnode) - nodeVerifyGroup((bNodeTree *)gnode->id); - -} - -static void node_addgroup(SpaceNode *snode) -{ - bNodeTree *ngroup; - int tot= 0, offs, val; - char *strp; - - if(snode->edittree!=snode->nodetree) { - error("Can not add a Group in a Group"); - return; - } - - /* construct menu with choices */ - for(ngroup= G.main->nodetree.first; ngroup; ngroup= ngroup->id.next) { - if(ngroup->type==snode->treetype) - tot++; - } - if(tot==0) { - error("No groups available in database"); - return; - } - strp= MEM_mallocN(32*tot+32, "menu"); - strcpy(strp, "Add Group %t"); - offs= strlen(strp); - - for(tot=0, ngroup= G.main->nodetree.first; ngroup; ngroup= ngroup->id.next, tot++) { - if(ngroup->type==snode->treetype) - offs+= sprintf(strp+offs, "|%s %%x%d", ngroup->id.name+2, tot); - } - - val= pupmenu(strp); - if(val>=0) { - ngroup= BLI_findlink(&G.main->nodetree, val); - if(ngroup) { - bNode *node= nodeAddNodeType(snode->edittree, NODE_GROUP, ngroup); - - /* generics */ - if(node) { - float locx, locy; - short mval[2]; - - node_deselectall(snode, 0); - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &locx, &locy); - - node->locx= locx; - node->locy= locy + 60.0f; // arbitrary.. so its visible - node->flag |= SELECT; - - id_us_plus(node->id); - - node_set_active(snode, node); - BIF_undo_push("Add Node"); - } - } - } - MEM_freeN(strp); -} - - -/* ************************** Node generic ************** */ - -/* allows to walk the list in order of visibility */ -static bNode *next_node(bNodeTree *ntree) -{ - static bNode *current=NULL, *last= NULL; - - if(ntree) { - /* set current to the first selected node */ - for(current= ntree->nodes.last; current; current= current->prev) - if(current->flag & NODE_SELECT) - break; - - /* set last to the first unselected node */ - for(last= ntree->nodes.last; last; last= last->prev) - if((last->flag & NODE_SELECT)==0) - break; - - if(current==NULL) - current= last; - - return NULL; - } - /* no nodes, or we are ready */ - if(current==NULL) - return NULL; - - /* now we walk the list backwards, but we always return current */ - if(current->flag & NODE_SELECT) { - bNode *node= current; - - /* find previous selected */ - current= current->prev; - while(current && (current->flag & NODE_SELECT)==0) - current= current->prev; - - /* find first unselected */ - if(current==NULL) - current= last; - - return node; - } - else { - bNode *node= current; - - /* find previous unselected */ - current= current->prev; - while(current && (current->flag & NODE_SELECT)) - current= current->prev; - - return node; - } - - return NULL; -} - -/* is rct in visible part of node? */ -static bNode *visible_node(SpaceNode *snode, rctf *rct) -{ - bNode *tnode; - - for(next_node(snode->edittree); (tnode=next_node(NULL));) { - if(BLI_isect_rctf(&tnode->totr, rct, NULL)) - break; - } - return tnode; -} - -void snode_home(ScrArea *sa, SpaceNode *snode) -{ - bNode *node; - int first= 1; - - snode->v2d.cur.xmin= snode->v2d.cur.ymin= 0.0f; - snode->v2d.cur.xmax= sa->winx; - snode->v2d.cur.xmax= sa->winy; - - if(snode->edittree) { - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(first) { - first= 0; - snode->v2d.cur= node->totr; - } - else { - BLI_union_rctf(&snode->v2d.cur, &node->totr); - } - } - } - snode->v2d.tot= snode->v2d.cur; - - snode->xof = snode->yof = 0.0; - - test_view2d(G.v2d, sa->winx, sa->winy); - -} - -void snode_zoom_out(ScrArea *sa) -{ - float dx; - - dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin-= dx; - G.v2d->cur.xmax+= dx; - dx= (float)(0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - G.v2d->cur.ymin-= dx; - G.v2d->cur.ymax+= dx; - test_view2d(G.v2d, sa->winx, sa->winy); -} - -void snode_zoom_in(ScrArea *sa) -{ - float dx; - - dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - dx= (float)(0.1154*(G.v2d->cur.ymax-G.v2d->cur.ymin)); - G.v2d->cur.ymin+= dx; - G.v2d->cur.ymax-= dx; - test_view2d(G.v2d, sa->winx, sa->winy); -} - -static void snode_bg_viewmove(SpaceNode *snode) -{ - ScrArea *sa; - Image *ima; - ImBuf *ibuf; - Window *win; - short mval[2], mvalo[2]; - short rectx, recty, xmin, xmax, ymin, ymax, pad; - int oldcursor; - - ima= BKE_image_verify_viewer(IMA_TYPE_COMPOSITE, "Viewer Node"); - ibuf= BKE_image_get_ibuf(ima, NULL); - - sa = snode->area; - - if(ibuf) { - rectx = ibuf->x; - recty = ibuf->y; - } else { - rectx = recty = 1; - } - - pad = 10; - xmin = -(sa->winx/2) - rectx/2 + pad; - xmax = sa->winx/2 + rectx/2 - pad; - ymin = -(sa->winy/2) - recty/2 + pad; - ymax = sa->winy/2 + recty/2 - pad; - - getmouseco_sc(mvalo); - - /* store the old cursor to temporarily change it */ - oldcursor=get_cursor(); - win=winlay_get_active_window(); - - SetBlenderCursor(BC_NSEW_SCROLLCURSOR); - - while(get_mbut()&(L_MOUSE|M_MOUSE)) { - - getmouseco_sc(mval); - - if(mvalo[0]!=mval[0] || mvalo[1]!=mval[1]) { - - snode->xof -= (mvalo[0]-mval[0]); - snode->yof -= (mvalo[1]-mval[1]); - - /* prevent dragging image outside of the window and losing it! */ - CLAMP(snode->xof, xmin, xmax); - CLAMP(snode->yof, ymin, ymax); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else BIF_wait_for_statechange(); - } - - window_set_cursor(win, oldcursor); -} - -/* checks mouse position, and returns found node/socket */ -/* type is SOCK_IN and/or SOCK_OUT */ -static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, int in_out) -{ - bNode *node; - bNodeSocket *sock; - rctf rect; - short mval[2]; - - getmouseco_areawin(mval); - - /* check if we click in a socket */ - for(node= snode->edittree->nodes.first; node; node= node->next) { - - areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin); - - rect.xmin -= NODE_SOCKSIZE+3; - rect.ymin -= NODE_SOCKSIZE+3; - rect.xmax = rect.xmin + 2*NODE_SOCKSIZE+6; - rect.ymax = rect.ymin + 2*NODE_SOCKSIZE+6; - - if (!(node->flag & NODE_HIDDEN)) { - /* extra padding inside and out - allow dragging on the text areas too */ - if (in_out == SOCK_IN) { - rect.xmax += NODE_SOCKSIZE; - rect.xmin -= NODE_SOCKSIZE*4; - } else if (in_out == SOCK_OUT) { - rect.xmax += NODE_SOCKSIZE*4; - rect.xmin -= NODE_SOCKSIZE; - } - } - - if(in_out & SOCK_IN) { - for(sock= node->inputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(BLI_in_rctf(&rect, sock->locx, sock->locy)) { - if(node == visible_node(snode, &rect)) { - *nodep= node; - *sockp= sock; - return 1; - } - } - } - } - } - if(in_out & SOCK_OUT) { - for(sock= node->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(BLI_in_rctf(&rect, sock->locx, sock->locy)) { - if(node == visible_node(snode, &rect)) { - *nodep= node; - *sockp= sock; - return 1; - } - } - } - } - } - } - return 0; -} - -/* ********************* transform ****************** */ - -/* releases on event, only intern (for extern see below) */ -/* we need argument ntree to allow operations on edittree or nodetree */ -static void transform_nodes(bNodeTree *ntree, char mode, char *undostr) -{ - bNode *node; - float mxstart, mystart, mx, my, *oldlocs, *ol; - int cont=1, tot=0, cancel=0, firsttime=1; - short mval[2], mvalo[2]; - - /* count total */ - for(node= ntree->nodes.first; node; node= node->next) - if(node->flag & SELECT) tot++; - - if(tot==0) return; - - /* store oldlocs */ - ol= oldlocs= MEM_mallocN(sizeof(float)*2*tot, "oldlocs transform"); - for(node= ntree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - ol[0]= node->locx; ol[1]= node->locy; - ol+= 2; - } - } - - getmouseco_areawin(mvalo); - areamouseco_to_ipoco(G.v2d, mvalo, &mxstart, &mystart); - - while(cont) { - - getmouseco_areawin(mval); - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) { - - firsttime= 0; - - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - for(ol= oldlocs, node= ntree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - node->locx= ol[0] + mx-mxstart; - node->locy= ol[1] + my-mystart; - ol+= 2; - } - } - - force_draw(0); - } - else - PIL_sleep_ms(10); - - while (qtest()) { - short val; - unsigned short event= extern_qread(&val); - - switch (event) { - case LEFTMOUSE: - case SPACEKEY: - case RETKEY: - cont=0; - break; - case ESCKEY: - case RIGHTMOUSE: - if(val) { - cancel=1; - cont=0; - } - break; - default: - if(val) arrows_move_cursor(event); - break; - } - } - - } - - if(cancel) { - for(ol= oldlocs, node= ntree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - node->locx= ol[0]; - node->locy= ol[1]; - ol+= 2; - } - } - - } - else - BIF_undo_push(undostr); - - allqueue(REDRAWNODE, 1); - MEM_freeN(oldlocs); -} - -/* external call, also for callback */ -void node_transform_ext(int mode, int unused) -{ - SpaceNode *snode= curarea->spacedata.first; - - transform_nodes(snode->edittree, 'g', "Move Node"); -} - - -/* releases on event, only 1 node */ -static void scale_node(SpaceNode *snode, bNode *node) -{ - float mxstart, mystart, mx, my, oldwidth; - int cont=1, cancel=0; - short mval[2], mvalo[2]; - - /* store old */ - if(node->flag & NODE_HIDDEN) - oldwidth= node->miniwidth; - else - oldwidth= node->width; - - getmouseco_areawin(mvalo); - areamouseco_to_ipoco(G.v2d, mvalo, &mxstart, &mystart); - - while(cont) { - - getmouseco_areawin(mval); - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - if(node->flag & NODE_HIDDEN) { - node->miniwidth= oldwidth + mx-mxstart; - CLAMP(node->miniwidth, 0.0f, 100.0f); - } - else { - node->width= oldwidth + mx-mxstart; - CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth); - } - - force_draw(0); - } - else - PIL_sleep_ms(10); - - while (qtest()) { - short val; - unsigned short event= extern_qread(&val); - - switch (event) { - case LEFTMOUSE: - case SPACEKEY: - case RETKEY: - cont=0; - break; - case ESCKEY: - case RIGHTMOUSE: - if(val) { - cancel=1; - cont=0; - } - break; - } - } - - } - - if(cancel) { - node->width= oldwidth; - } - else - BIF_undo_push("Scale Node"); - - allqueue(REDRAWNODE, 1); -} - - - -/* ********************** select ******************** */ - -/* used in buttons to check context, also checks for edited groups */ -bNode *editnode_get_active_idnode(bNodeTree *ntree, short id_code) -{ - bNode *node; - - /* check for edited group */ - for(node= ntree->nodes.first; node; node= node->next) - if(node->flag & NODE_GROUP_EDIT) - break; - if(node) - return nodeGetActiveID((bNodeTree *)node->id, id_code); - else - return nodeGetActiveID(ntree, id_code); -} - -/* used in buttons to check context, also checks for edited groups */ -Material *editnode_get_active_material(Material *ma) -{ - if(ma && ma->use_nodes && ma->nodetree) { - bNode *node= editnode_get_active_idnode(ma->nodetree, ID_MA); - if(node) - return (Material *)node->id; - else - return NULL; - } - return ma; -} - -/* used in buttons to check context, also checks for edited groups */ -bNode *editnode_get_active(bNodeTree *ntree) -{ - bNode *node; - - /* check for edited group */ - for(node= ntree->nodes.first; node; node= node->next) - if(node->flag & NODE_GROUP_EDIT) - break; - if(node) - return nodeGetActive((bNodeTree *)node->id); - else - return nodeGetActive(ntree); -} - - -/* no undo here! */ -void node_deselectall(SpaceNode *snode, int swap) -{ - bNode *node; - - if(swap) { - for(node= snode->edittree->nodes.first; node; node= node->next) - if(node->flag & SELECT) - break; - if(node==NULL) { - for(node= snode->edittree->nodes.first; node; node= node->next) - node->flag |= SELECT; - allqueue(REDRAWNODE, 0); - return; - } - /* else pass on to deselect */ - } - - for(node= snode->edittree->nodes.first; node; node= node->next) - node->flag &= ~SELECT; - - allqueue(REDRAWNODE, 0); -} - -int node_has_hidden_sockets(bNode *node) -{ - bNodeSocket *sock; - - for(sock= node->inputs.first; sock; sock= sock->next) - if(sock->flag & SOCK_HIDDEN) - return 1; - for(sock= node->outputs.first; sock; sock= sock->next) - if(sock->flag & SOCK_HIDDEN) - return 1; - return 0; -} - - -static void node_hide_unhide_sockets(SpaceNode *snode, bNode *node) -{ - bNodeSocket *sock; - - /* unhide all */ - if( node_has_hidden_sockets(node) ) { - for(sock= node->inputs.first; sock; sock= sock->next) - sock->flag &= ~SOCK_HIDDEN; - for(sock= node->outputs.first; sock; sock= sock->next) - sock->flag &= ~SOCK_HIDDEN; - } - else { - bNode *gnode= snode_get_editgroup(snode); - - /* hiding inside group should not break links in other group users */ - if(gnode) { - nodeGroupSocketUseFlags((bNodeTree *)gnode->id); - for(sock= node->inputs.first; sock; sock= sock->next) - if(!(sock->flag & SOCK_IN_USE)) - if(sock->link==NULL) - sock->flag |= SOCK_HIDDEN; - for(sock= node->outputs.first; sock; sock= sock->next) - if(!(sock->flag & SOCK_IN_USE)) - if(nodeCountSocketLinks(snode->edittree, sock)==0) - sock->flag |= SOCK_HIDDEN; - } - else { - /* hide unused sockets */ - for(sock= node->inputs.first; sock; sock= sock->next) { - if(sock->link==NULL) - sock->flag |= SOCK_HIDDEN; - } - for(sock= node->outputs.first; sock; sock= sock->next) { - if(nodeCountSocketLinks(snode->edittree, sock)==0) - sock->flag |= SOCK_HIDDEN; - } - } - } - - allqueue(REDRAWNODE, 1); - snode_verify_groups(snode); - BIF_undo_push("Hide/Unhide sockets"); - -} - -static int do_header_node(SpaceNode *snode, bNode *node, float mx, float my) -{ - rctf totr= node->totr; - - totr.ymin= totr.ymax-20.0f; - - totr.xmax= totr.xmin+15.0f; - if(BLI_in_rctf(&totr, mx, my)) { - node->flag |= NODE_HIDDEN; - allqueue(REDRAWNODE, 0); - return 1; - } - - totr.xmax= node->totr.xmax; - totr.xmin= totr.xmax-18.0f; - if(node->typeinfo->flag & NODE_PREVIEW) { - if(BLI_in_rctf(&totr, mx, my)) { - node->flag ^= NODE_PREVIEW; - allqueue(REDRAWNODE, 0); - return 1; - } - totr.xmin-=18.0f; - } - if(node->type == NODE_GROUP) { - if(BLI_in_rctf(&totr, mx, my)) { - snode_make_group_editable(snode, node); - return 1; - } - totr.xmin-=18.0f; - } - if(node->typeinfo->flag & NODE_OPTIONS) { - if(BLI_in_rctf(&totr, mx, my)) { - node->flag ^= NODE_OPTIONS; - allqueue(REDRAWNODE, 0); - return 1; - } - totr.xmin-=18.0f; - } - /* hide unused sockets */ - if(BLI_in_rctf(&totr, mx, my)) { - node_hide_unhide_sockets(snode, node); - } - - - totr= node->totr; - totr.xmin= totr.xmax-10.0f; - totr.ymax= totr.ymin+10.0f; - if(BLI_in_rctf(&totr, mx, my)) { - scale_node(snode, node); - return 1; - } - return 0; -} - -static int do_header_hidden_node(SpaceNode *snode, bNode *node, float mx, float my) -{ - rctf totr= node->totr; - - totr.xmax= totr.xmin+15.0f; - if(BLI_in_rctf(&totr, mx, my)) { - node->flag &= ~NODE_HIDDEN; - allqueue(REDRAWNODE, 0); - return 1; - } - - totr.xmax= node->totr.xmax; - totr.xmin= node->totr.xmax-15.0f; - if(BLI_in_rctf(&totr, mx, my)) { - scale_node(snode, node); - return 1; - } - return 0; -} - - -/* return 0: nothing done */ -static int node_mouse_select(SpaceNode *snode, unsigned short event) -{ - bNode *node; - float mx, my; - short mval[2]; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - - for(next_node(snode->edittree); (node=next_node(NULL));) { - - /* first check for the headers or scaling widget */ - if(node->flag & NODE_HIDDEN) { - if(do_header_hidden_node(snode, node, mx, my)) - return 1; - } - else { - if(do_header_node(snode, node, mx, my)) - return 1; - } - - /* node body */ - if(BLI_in_rctf(&node->totr, mx, my)) - break; - } - if(node) { - if((G.qual & LR_SHIFTKEY)==0) - node_deselectall(snode, 0); - - if(G.qual & LR_SHIFTKEY) { - if(node->flag & SELECT) - node->flag &= ~SELECT; - else - node->flag |= SELECT; - } - else - node->flag |= SELECT; - - node_set_active(snode, node); - - /* not so nice (no event), but function below delays redraw otherwise */ - force_draw(0); - - std_rmouse_transform(node_transform_ext); /* does undo push for select */ - - return 1; - } - return 0; -} - -/* return 0, nothing done */ -static int node_mouse_groupheader(SpaceNode *snode) -{ - bNode *gnode; - float mx, my; - short mval[2]; - - gnode= snode_get_editgroup(snode); - if(gnode==NULL) return 0; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - - /* click in header or outside? */ - if(BLI_in_rctf(&gnode->totr, mx, my)==0) { - rctf rect= gnode->totr; - - rect.ymax += NODE_DY; - if(BLI_in_rctf(&rect, mx, my)==0) - snode_make_group_editable(snode, NULL); /* toggles, so exits editmode */ - else - transform_nodes(snode->nodetree, 'g', "Move group"); - - return 1; - } - return 0; -} - -static int node_socket_hilights(SpaceNode *snode, int in_out) -{ - bNode *node; - bNodeSocket *sock, *tsock, *socksel= NULL; - float mx, my; - short mval[2], redraw= 0; - - if(snode->edittree==NULL) return 0; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &mx, &my); - - /* deselect socks */ - for(node= snode->edittree->nodes.first; node; node= node->next) { - for(sock= node->inputs.first; sock; sock= sock->next) { - if(sock->flag & SELECT) { - sock->flag &= ~SELECT; - redraw++; - socksel= sock; - } - } - for(sock= node->outputs.first; sock; sock= sock->next) { - if(sock->flag & SELECT) { - sock->flag &= ~SELECT; - redraw++; - socksel= sock; - } - } - } - - if(find_indicated_socket(snode, &node, &tsock, in_out)) { - tsock->flag |= SELECT; - if(redraw==1 && tsock==socksel) redraw= 0; - else redraw= 1; - } - - return redraw; -} - -void node_border_select(SpaceNode *snode) -{ - bNode *node; - rcti rect; - rctf rectf; - short val, mval[2]; - - if ( (val = get_border(&rect, 3)) ) { - - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(BLI_isect_rctf(&rectf, &node->totr, NULL)) { - if(val==LEFTMOUSE) - node->flag |= SELECT; - else - node->flag &= ~SELECT; - } - } - allqueue(REDRAWNODE, 1); - BIF_undo_push("Border select nodes"); - } -} - -/* ****************** Add *********************** */ - -void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag) -{ - bNodeSocket *sock, *sockfrom[8]; - bNode *node, *nodefrom[8]; - int totsock= 0, socktype=0; - - if(node_to==NULL || node_to->inputs.first==NULL) - return; - - /* no inputs for node allowed (code it) */ - - /* connect first 1 socket type now */ - for(sock= node_to->inputs.first; sock; sock= sock->next) - if(socktypetype) - socktype= sock->type; - - - /* find potential sockets, max 8 should work */ - for(node= snode->edittree->nodes.first; node; node= node->next) { - if((node->flag & flag) && node!=node_to) { - for(sock= node->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - sockfrom[totsock]= sock; - nodefrom[totsock]= node; - totsock++; - if(totsock>7) - break; - } - } - } - if(totsock>7) - break; - } - - /* now just get matching socket types and create links */ - for(sock= node_to->inputs.first; sock; sock= sock->next) { - int a; - - for(a=0; atype==sockfrom[a]->type && sock->type==socktype) { - nodeAddLink(snode->edittree, nodefrom[a], sockfrom[a], node_to, sock); - sockfrom[a]= NULL; - break; - } - } - } - } - - ntreeSolveOrder(snode->edittree); -} - -/* can be called from menus too, but they should do own undopush and redraws */ -bNode *node_add_node(SpaceNode *snode, int type, float locx, float locy) -{ - bNode *node= NULL, *gnode; - - node_deselectall(snode, 0); - - if(type>=NODE_GROUP_MENU) { - if(snode->edittree!=snode->nodetree) { - error("Can not add a Group in a Group"); - return NULL; - } - else { - bNodeTree *ngroup= BLI_findlink(&G.main->nodetree, type-NODE_GROUP_MENU); - if(ngroup) - node= nodeAddNodeType(snode->edittree, NODE_GROUP, ngroup); - } - } - else - node= nodeAddNodeType(snode->edittree, type, NULL); - - /* generics */ - if(node) { - node->locx= locx; - node->locy= locy + 60.0f; // arbitrary.. so its visible - node->flag |= SELECT; - - gnode= snode_get_editgroup(snode); - if(gnode) { - node->locx -= gnode->locx; - node->locy -= gnode->locy; - } - - snode_verify_groups(snode); - node_set_active(snode, node); - - if(node->id) - id_us_plus(node->id); - - if(snode->nodetree->type==NTREE_COMPOSIT) - ntreeCompositForceHidden(snode->edittree); - - NodeTagChanged(snode->edittree, node); - } - return node; -} - -void node_adduplicate(SpaceNode *snode) -{ - - ntreeCopyTree(snode->edittree, 1); /* 1 == internally selected nodes */ - - ntreeSolveOrder(snode->edittree); - snode_verify_groups(snode); - snode_handle_recalc(snode); - - transform_nodes(snode->edittree, 'g', "Duplicate"); -} - -#if 0 -static void node_insert_convertor(SpaceNode *snode, bNodeLink *link) -{ - bNode *newnode= NULL; - - if(link->fromsock->type==SOCK_RGBA && link->tosock->type==SOCK_VALUE) { - if(snode->edittree->type==NTREE_SHADER) - newnode= node_add_node(snode, SH_NODE_RGBTOBW, 0.0f, 0.0f); - else if(snode->edittree->type==NTREE_COMPOSIT) - newnode= node_add_node(snode, CMP_NODE_RGBTOBW, 0.0f, 0.0f); - else - newnode= NULL; - } - else if(link->fromsock->type==SOCK_VALUE && link->tosock->type==SOCK_RGBA) { - if(snode->edittree->type==NTREE_SHADER) - newnode= node_add_node(snode, SH_NODE_VALTORGB, 0.0f, 0.0f); - else if(snode->edittree->type==NTREE_COMPOSIT) - newnode= node_add_node(snode, CMP_NODE_VALTORGB, 0.0f, 0.0f); - else - newnode= NULL; - } - - if(newnode) { - /* dangerous assumption to use first in/out socks, but thats fine for now */ - newnode->flag |= NODE_HIDDEN; - newnode->locx= 0.5f*(link->fromsock->locx + link->tosock->locx); - newnode->locy= 0.5f*(link->fromsock->locy + link->tosock->locy) + HIDDEN_RAD; - - nodeAddLink(snode->edittree, newnode, newnode->outputs.first, link->tonode, link->tosock); - link->tonode= newnode; - link->tosock= newnode->inputs.first; - } -} - -#endif - -/* loop that adds a nodelink, called by function below */ -/* in_out = starting socket */ -static int node_add_link_drag(SpaceNode *snode, bNode *node, bNodeSocket *sock, int in_out) -{ - bNode *tnode; - bNodeSocket *tsock= NULL; - bNodeLink *link= NULL; - short mval[2], mvalo[2], firsttime=1; /* firsttime reconnects a link broken by caller */ - - /* we make a temporal link */ - if(in_out==SOCK_OUT) - link= nodeAddLink(snode->edittree, node, sock, NULL, NULL); - else - link= nodeAddLink(snode->edittree, NULL, NULL, node, sock); - - getmouseco_areawin(mvalo); - while (get_mbut() & L_MOUSE) { - - getmouseco_areawin(mval); - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) { - firsttime= 0; - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - if(in_out==SOCK_OUT) { - if(find_indicated_socket(snode, &tnode, &tsock, SOCK_IN)) { - if(nodeFindLink(snode->edittree, sock, tsock)==NULL) { - if(tnode!=node && link->tonode!=tnode && link->tosock!= tsock) { - link->tonode= tnode; - link->tosock= tsock; - ntreeSolveOrder(snode->edittree); /* for interactive red line warning */ - } - } - } - else { - link->tonode= NULL; - link->tosock= NULL; - } - } - else { - if(find_indicated_socket(snode, &tnode, &tsock, SOCK_OUT)) { - if(nodeFindLink(snode->edittree, sock, tsock)==NULL) { - if(nodeCountSocketLinks(snode->edittree, tsock) < tsock->limit) { - if(tnode!=node && link->fromnode!=tnode && link->fromsock!= tsock) { - link->fromnode= tnode; - link->fromsock= tsock; - ntreeSolveOrder(snode->edittree); /* for interactive red line warning */ - } - } - } - } - else { - link->fromnode= NULL; - link->fromsock= NULL; - } - } - /* hilight target sockets only */ - node_socket_hilights(snode, in_out==SOCK_OUT?SOCK_IN:SOCK_OUT); - - force_draw(0); - } - else BIF_wait_for_statechange(); - } - - /* remove link? */ - if(link->tonode==NULL || link->fromnode==NULL) { - nodeRemLink(snode->edittree, link); - } - else { - bNodeLink *tlink; - - /* send changed events for original tonode and new */ - if(link->tonode) - NodeTagChanged(snode->edittree, link->tonode); - - /* we might need to remove a link */ - if(in_out==SOCK_OUT) { - if(tsock && nodeCountSocketLinks(snode->edittree, link->tosock) > tsock->limit) { - - for(tlink= snode->edittree->links.first; tlink; tlink= tlink->next) { - if(link!=tlink && tlink->tosock==link->tosock) - break; - } - if(tlink) { - /* is there a free input socket with same type? */ - for(tsock= tlink->tonode->inputs.first; tsock; tsock= tsock->next) { - if(tsock->type==tlink->fromsock->type) - if(nodeCountSocketLinks(snode->edittree, tsock) < tsock->limit) - break; - } - if(tsock) - tlink->tosock= tsock; - else { - nodeRemLink(snode->edittree, tlink); - } - } - } - } - } - - ntreeSolveOrder(snode->edittree); - snode_verify_groups(snode); - snode_handle_recalc(snode); - - allqueue(REDRAWNODE, 0); - BIF_undo_push("Add link"); - - return 1; -} - -/* return 1 when socket clicked */ -static int node_add_link(SpaceNode *snode) -{ - bNode *node; - bNodeLink *link; - bNodeSocket *sock; - - /* output indicated? */ - if(find_indicated_socket(snode, &node, &sock, SOCK_OUT)) { - if(nodeCountSocketLinks(snode->edittree, sock)limit) - return node_add_link_drag(snode, node, sock, SOCK_OUT); - else { - /* find if we break a link */ - for(link= snode->edittree->links.first; link; link= link->next) { - if(link->fromsock==sock) - break; - } - if(link) { - node= link->tonode; - sock= link->tosock; - nodeRemLink(snode->edittree, link); - return node_add_link_drag(snode, node, sock, SOCK_IN); - } - } - } - /* or an input? */ - else if(find_indicated_socket(snode, &node, &sock, SOCK_IN)) { - if(nodeCountSocketLinks(snode->edittree, sock)limit) - return node_add_link_drag(snode, node, sock, SOCK_IN); - else { - /* find if we break a link */ - for(link= snode->edittree->links.first; link; link= link->next) { - if(link->tosock==sock) - break; - } - if(link) { - /* send changed event to original tonode */ - if(link->tonode) - NodeTagChanged(snode->edittree, link->tonode); - - node= link->fromnode; - sock= link->fromsock; - nodeRemLink(snode->edittree, link); - return node_add_link_drag(snode, node, sock, SOCK_OUT); - } - } - } - - return 0; -} - -void node_delete(SpaceNode *snode) -{ - bNode *node, *next; - - for(node= snode->edittree->nodes.first; node; node= next) { - next= node->next; - if(node->flag & SELECT) { - /* check id user here, nodeFreeNode is called for free dbase too */ - if(node->id) - node->id->us--; - nodeFreeNode(snode->edittree, node); - } - } - - snode_verify_groups(snode); - snode_handle_recalc(snode); - BIF_undo_push("Delete nodes"); - allqueue(REDRAWNODE, 1); -} - -void node_hide(SpaceNode *snode) -{ - bNode *node; - int nothidden=0, ishidden=0; - - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - if(node->flag & NODE_HIDDEN) - ishidden++; - else - nothidden++; - } - } - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(node->flag & SELECT) { - if( (ishidden && nothidden) || ishidden==0) - node->flag |= NODE_HIDDEN; - else - node->flag &= ~NODE_HIDDEN; - } - } - BIF_undo_push("Hide nodes"); - allqueue(REDRAWNODE, 1); -} - -void node_insert_key(SpaceNode *snode) -{ - bNode *node= editnode_get_active(snode->edittree); - - if(node->type==CMP_NODE_TIME) { - if(node->custom1custom2) { - - CurveMapping *cumap= node->storage; - float fval, curval; - - curval= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1); - fval= curvemapping_evaluateF(cumap, 0, curval); - - if(fbutton(&fval, 0.0f, 1.0f, 10, 10, "Insert Value")) { - curvemap_insert(cumap->cm, curval, fval); - - BIF_undo_push("Insert key in Time node"); - allqueue(REDRAWNODE, 1); - } - } - } -} - -void node_select_linked(SpaceNode *snode, int out) -{ - bNodeLink *link; - bNode *node; - - /* NODE_TEST is the free flag */ - for(node= snode->edittree->nodes.first; node; node= node->next) - node->flag &= ~NODE_TEST; - - for(link= snode->edittree->links.first; link; link= link->next) { - if(out) { - if(link->fromnode->flag & NODE_SELECT) - link->tonode->flag |= NODE_TEST; - } - else { - if(link->tonode->flag & NODE_SELECT) - link->fromnode->flag |= NODE_TEST; - } - } - - for(node= snode->edittree->nodes.first; node; node= node->next) - if(node->flag & NODE_TEST) - node->flag |= NODE_SELECT; - - BIF_undo_push("Select Linked nodes"); - allqueue(REDRAWNODE, 1); -} - -static void node_border_link_delete(SpaceNode *snode) -{ - rcti rect; - short val, mval[2], mvalo[2]; - - /* to make this work more friendly, we first wait for a mouse move */ - getmouseco_areawin(mvalo); - while (get_mbut() & L_MOUSE) { - getmouseco_areawin(mval); - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) - break; - else BIF_wait_for_statechange(); - } - if((get_mbut() & L_MOUSE)==0) - return; - - /* now change cursor and draw border */ - setcursor_space(SPACE_NODE, CURSOR_VPAINT); - - if ( (val = get_border(&rect, 2)) ) { - if(rect.xminv2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(&snode->v2d, mval, &rectf.xmax, &rectf.ymax); - - myortho2(rectf.xmin, rectf.xmax, rectf.ymin, rectf.ymax); - - glSelectBuffer(256, buffer); - glRenderMode(GL_SELECT); - glInitNames(); - glPushName(-1); - - /* draw links */ - for(link= snode->edittree->links.first; link; link= link->next) { - glLoadName(code++); - node_draw_link(snode, link); - } - - hits= glRenderMode(GL_RENDER); - glPopName(); - if(hits>0) { - int a; - for(a=0; aedittree->links, buffer[ (4 * a) + 3]); - if(link) - link->fromnode= NULL; /* first tag for delete, otherwise indices are wrong */ - } - for(link= snode->edittree->links.first; link; link= next) { - next= link->next; - if(link->fromnode==NULL) { - NodeTagChanged(snode->edittree, link->tonode); - nodeRemLink(snode->edittree, link); - } - } - ntreeSolveOrder(snode->edittree); - snode_verify_groups(snode); - snode_handle_recalc(snode); - } - allqueue(REDRAWNODE, 0); - BIF_undo_push("Erase links"); - } - } - - setcursor_space(SPACE_NODE, CURSOR_STD); -} - -/* goes over all scenes, reads render layerss */ -void node_read_renderlayers(SpaceNode *snode) -{ - Scene *scene; - bNode *node; - - /* first tag scenes unread */ - for(scene= G.main->scene.first; scene; scene= scene->id.next) - scene->id.flag |= LIB_DOIT; - - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS) { - ID *id= node->id; - if(id==NULL) id= (ID *)G.scene; - if(id->flag & LIB_DOIT) { - RE_ReadRenderResult(G.scene, (Scene *)id); - ntreeCompositTagRender((Scene *)id); - id->flag &= ~LIB_DOIT; - } - } - } - - snode_handle_recalc(snode); -} - -/* called from header_info, when deleting a scene - * goes over all scenes other than the input, checks if they have - * render layer nodes referencing the to-be-deleted scene, and - * resets them to NULL. */ -void clear_scene_in_nodes(Scene *sce) -{ - Scene *sce1; - bNode *node; - - sce1= G.main->scene.first; - while(sce1) { - if(sce1!=sce) { - if (sce1->nodetree) { - for(node= sce1->nodetree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS) { - Scene *nodesce= (Scene *)node->id; - - if (nodesce==sce) node->id = NULL; - } - } - } - } - sce1= sce1->id.next; - } -} - - -/* gets active viewer user */ -struct ImageUser *ntree_get_active_iuser(bNodeTree *ntree) -{ - bNode *node; - - if(ntree) - for(node= ntree->nodes.first; node; node= node->next) - if( ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) - if(node->flag & NODE_DO_OUTPUT) - return node->storage; - return NULL; -} - -void imagepaint_composite_tags(bNodeTree *ntree, Image *image, ImageUser *iuser) -{ - bNode *node; - - if(ntree==NULL) - return; - - /* search for renderresults */ - if(image->type==IMA_TYPE_R_RESULT) { - for(node= ntree->nodes.first; node; node= node->next) { - if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) { - /* imageuser comes from ImageWin, so indexes are offset 1 */ - if(node->custom1==iuser->layer-1) - NodeTagChanged(ntree, node); - } - } - } - else { - for(node= ntree->nodes.first; node; node= node->next) { - if(node->id== &image->id) - NodeTagChanged(ntree, node); - } - } -} - -/* ********************** */ - -void node_make_group(SpaceNode *snode) -{ - bNode *gnode; - - if(snode->edittree!=snode->nodetree) { - error("Can not add a new Group in a Group"); - return; - } - - /* for time being... is too complex to handle */ - if(snode->treetype==NTREE_COMPOSIT) { - for(gnode=snode->nodetree->nodes.first; gnode; gnode= gnode->next) { - if(gnode->flag & SELECT) - if(gnode->type==CMP_NODE_R_LAYERS) - break; - } - if(gnode) { - error("Can not add RenderLayer in a Group"); - return; - } - } - - gnode= nodeMakeGroupFromSelected(snode->nodetree); - if(gnode==NULL) { - error("Can not make Group"); - } - else { - nodeSetActive(snode->nodetree, gnode); - ntreeSolveOrder(snode->nodetree); - allqueue(REDRAWNODE, 0); - BIF_undo_push("Make Node Group"); - } -} - -/* ******************** main event loop ****************** */ - -/* special version to prevent overlapping buttons, has a bit of hack... */ -/* yes, check for example composit_node_event(), file window use... */ -static int node_uiDoBlocks(ScrArea *sa, short event) -{ - SpaceNode *snode= sa->spacedata.first; - ListBase *lb= &sa->uiblocks; - ListBase listb= *lb; - bNode *node; - rctf rect; - void *prev, *next; - int retval= UI_NOTHING; - short mval[2]; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &rect.xmin, &rect.ymin); - - /* this happens after filesel usage... */ - if(lb->first==NULL) { - return UI_NOTHING; - } - - rect.xmin -= 2.0f; - rect.ymin -= 2.0f; - rect.xmax = rect.xmin + 4.0f; - rect.ymax = rect.ymin + 4.0f; - - for(node= snode->edittree->nodes.first; node; node= node->next) { - uiBlock *block; - char str[32]; - - /* retreive unique block name, see also drawnode.c */ - sprintf(str, "node buttons %p", node); - block= uiGetBlock(str, sa); - - if(block) { - if(node == visible_node(snode, &rect)) { - - /* when there's menus, the prev pointer becomes zero! */ - prev= ((struct Link *)block)->prev; - next= ((struct Link *)block)->next; - ((struct Link *)block)->prev= NULL; - ((struct Link *)block)->next= NULL; - - lb->first= lb->last= block; - retval= uiDoBlocks(lb, event, 1); - - ((struct Link *)block)->prev= prev; - ((struct Link *)block)->next= next; - - break; - } - } - } - - *lb= listb; - - return retval; -} - -void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - SpaceNode *snode= spacedata; - unsigned short event= evt->event; - short val= evt->val, doredraw=0, fromlib= 0; - - if(sa->win==0) return; - if(snode->nodetree==NULL) return; - - if(val) { - - if( node_uiDoBlocks(sa, event)!=UI_NOTHING ) event= 0; - - fromlib= (snode->id && snode->id->lib); - - switch(event) { - case LEFTMOUSE: - if(fromlib) { - if(node_mouse_groupheader(snode)==0) - node_mouse_select(snode, event); - } - else { - if(node_add_link(snode)==0) - if(node_mouse_groupheader(snode)==0) - if(node_mouse_select(snode, event)==0) - node_border_link_delete(snode); - } - break; - - case RIGHTMOUSE: - if(!node_mouse_select(snode, event)) - toolbox_n(); - - break; - case MIDDLEMOUSE: - if (G.qual==LR_SHIFTKEY) { - snode_bg_viewmove(snode); - } else { - view2dmove(event); - } - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - - case MOUSEY: - doredraw= node_socket_hilights(snode, SOCK_IN|SOCK_OUT); - break; - - case UI_BUT_EVENT: - /* future: handlerize this! */ - if(snode->treetype==NTREE_SHADER) - shader_node_event(snode, val); - else if(snode->treetype==NTREE_COMPOSIT) - composit_node_event(snode, val); - break; - - case RENDERPREVIEW: - if(snode->treetype==NTREE_SHADER) - shader_node_previewrender(sa, snode); - break; - - case PADPLUSKEY: - snode_zoom_in(sa); - doredraw= 1; - break; - case PADMINUS: - snode_zoom_out(sa); - doredraw= 1; - break; - case HOMEKEY: - snode_home(sa, snode); - doredraw= 1; - break; - case TABKEY: - if(fromlib) fromlib= -1; - else snode_make_group_editable(snode, NULL); - break; - - case AKEY: - if(G.qual==LR_SHIFTKEY) { - if(fromlib) fromlib= -1; - else toolbox_n_add(); - } - else if(G.qual==0) { - node_deselectall(snode, 1); - BIF_undo_push("Deselect all nodes"); - } - break; - case BKEY: - if(G.qual==0) - node_border_select(snode); - break; - case CKEY: /* sort again, showing cyclics */ - ntreeSolveOrder(snode->edittree); - doredraw= 1; - break; - case DKEY: - if(G.qual==LR_SHIFTKEY) { - if(fromlib) fromlib= -1; - else node_adduplicate(snode); - } - break; - case EKEY: - snode_handle_recalc(snode); - break; - case GKEY: - if(fromlib) fromlib= -1; - else { - if(G.qual==LR_CTRLKEY) { - if(okee("Make Group")) - node_make_group(snode); - } - else if(G.qual==LR_ALTKEY) { - if(okee("Ungroup")) - node_ungroup(snode); - } - else if(G.qual==LR_SHIFTKEY) { - node_addgroup(snode); - } - else - transform_nodes(snode->edittree, 'g', "Move Node"); - } - break; - case HKEY: - node_hide(snode); - break; - case IKEY: - node_insert_key(snode); - break; - case LKEY: - node_select_linked(snode, G.qual==LR_SHIFTKEY); - break; - case RKEY: - if(okee("Read saved Render Layers")) - node_read_renderlayers(snode); - break; - case DELKEY: - case XKEY: - if(fromlib) fromlib= -1; - else node_delete(snode); - break; - } - } - - if(fromlib==-1) - error_libdata(); - if(doredraw) - scrarea_queue_winredraw(sa); - if(doredraw==2) - scrarea_queue_headredraw(sa); -} - - diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c deleted file mode 100644 index c563548759c..00000000000 --- a/source/blender/src/editobject.c +++ /dev/null @@ -1,5620 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/** - * Theorie: (matrices) A x B x C == A x ( B x C x Binv) x B - * ofwel: OB x PAR x EDIT = OB x (PAR x EDIT x PARinv) x PAR - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" -#include "PIL_time.h" - -#include "BMF_Api.h" - - -#include "IMB_imbuf_types.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_group_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_meta_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_fluidsim.h" -#include "DNA_object_force.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_particle_types.h" -#include "DNA_property_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_vfont_types.h" -#include "DNA_world_types.h" -#include "DNA_modifier_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_ghash.h" - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_customdata.h" -#include "BKE_blender.h" -#include "BKE_booleanops.h" -#include "BKE_curve.h" -#include "BKE_displist.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_ipo.h" -#include "BKE_image.h" -#include "BKE_key.h" -#include "BKE_lattice.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_nla.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_property.h" -#include "BKE_sca.h" -#include "BKE_scene.h" -#include "BKE_softbody.h" -#include "BKE_subsurf.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" -#include "BKE_modifier.h" - -#include "BIF_butspace.h" -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_editfont.h" -#include "BIF_editlattice.h" -#include "BIF_editmesh.h" -#include "BIF_editoops.h" -#include "BIF_editparticle.h" -#include "BIF_editview.h" -#include "BIF_editarmature.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_toets.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_filesel.h" /* For activate_databrowse() */ -#include "BSE_view.h" -#include "BSE_drawview.h" -#include "BSE_trans_types.h" -#include "BSE_editipo_types.h" - -#include "BDR_vpaint.h" -#include "BDR_sculptmode.h" -#include "BDR_editface.h" -#include "BDR_editmball.h" -#include "BDR_editobject.h" -#include "BDR_drawobject.h" -#include "BDR_editcurve.h" -#include "BDR_unwrapper.h" - -#include -#include "mydevice.h" -#include "nla.h" - -#include "blendef.h" -#include "butspace.h" -#include "multires.h" -#include "BIF_transform.h" - -#include "BIF_poseobject.h" - - -/* --------------------------------- */ - -void exit_paint_modes(void) -{ - if(G.f & G_VERTEXPAINT) set_vpaint(); - if(G.f & G_TEXTUREPAINT) set_texturepaint(); - if(G.f & G_WEIGHTPAINT) set_wpaint(); - if(G.f & G_SCULPTMODE) set_sculptmode(); - if(G.f & G_PARTICLEEDIT) PE_set_particle_edit(); - - G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_SCULPTMODE+G_PARTICLEEDIT); -} - -void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff */ -{ - Object *ob; - - exit_paint_modes(); - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - - if ELEM3(curarea->spacetype, SPACE_VIEW3D, SPACE_BUTS, SPACE_INFO) { - if (G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */ - ob= add_object(type); - set_active_base(BASACT); - base_init_from_view3d(BASACT, G.vd); - - /* only undo pushes on objects without editmode... */ - if(type==OB_EMPTY) BIF_undo_push("Add Empty"); - else if(type==OB_LAMP) { - BIF_undo_push("Add Lamp"); - reshadeall_displist(); /* only frees */ - } - else if(type==OB_LATTICE) BIF_undo_push("Add Lattice"); - else if(type==OB_CAMERA) BIF_undo_push("Add Camera"); - - allqueue(REDRAWVIEW3D, 0); - } - - redraw_test_buttons(OBACT); - - allqueue(REDRAWALL, 0); - - deselect_all_area_oops(); - set_select_flag_oops(); - - DAG_scene_sort(G.scene); - allqueue(REDRAWINFO, 1); /* 1, because header->win==0! */ -} - -void add_objectLamp(short type) -{ - Lamp *la; - - /* this function also comes from an info window */ - if ELEM(curarea->spacetype, SPACE_VIEW3D, SPACE_INFO); else return; - - if(G.obedit==0) { - add_object_draw(OB_LAMP); - base_init_from_view3d(BASACT, G.vd); - } - - la = BASACT->object->data; - la->type = type; - - allqueue(REDRAWALL, 0); -} - -/* remove base from a specific scene */ -/* note: now unlinks constraints as well */ -void free_and_unlink_base_from_scene(Scene *scene, Base *base) -{ - BLI_remlink(&scene->base, base); - free_libblock_us(&G.main->object, base->object); - MEM_freeN(base); -} - -/* remove base from the current scene */ -void free_and_unlink_base(Base *base) -{ - if (base==BASACT) - BASACT= NULL; - free_and_unlink_base_from_scene(G.scene, base); -} - -void delete_obj(int ok) -{ - Base *base; - int islamp= 0; - - if(G.obedit) return; - if(G.scene->id.lib) return; - - base= FIRSTBASE; - while(base) { - Base *nbase= base->next; - - if TESTBASE(base) { - if(ok==0) { - /* Shift Del is global delete */ - if (G.qual & LR_SHIFTKEY) { - if(!okee("Erase selected Object(s) Globally")) return; - ok= 2; - } else { - if(!okee("Erase selected Object(s)")) return; - ok= 1; - } - } - - exit_paint_modes(); - - if(base->object->type==OB_LAMP) islamp= 1; -#ifdef WITH_VERSE - if(base->object->vnode) b_verse_delete_object(base->object); -#endif - if (ok==2) { - Scene *scene; - Base *base_other; - - for (scene= G.main->scene.first; scene; scene= scene->id.next) { - if (scene != G.scene && !(scene->id.lib)) { - base_other= object_in_scene( base->object, scene ); - if (base_other) { - if (base_other == scene->basact) scene->basact= NULL; /* in case the object was active */ - free_and_unlink_base_from_scene( scene, base_other ); - } - } - } - } - - /* remove from current scene only */ - free_and_unlink_base(base); - } - - base= nbase; - } - countall(); - - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - - if(islamp) reshadeall_displist(); /* only frees displist */ - - redraw_test_buttons(OBACT); - allqueue(REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWDATASELECT, 0); - allspace(OOPS_TEST, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - - DAG_scene_sort(G.scene); - - BIF_undo_push("Delete object(s)"); -} - -static int return_editmesh_indexar(int *tot, int **indexar, float *cent) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - int *index, nr, totvert=0; - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) totvert++; - } - if(totvert==0) return 0; - - *indexar= index= MEM_mallocN(4*totvert, "hook indexar"); - *tot= totvert; - nr= 0; - cent[0]= cent[1]= cent[2]= 0.0; - - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - *index= nr; index++; - VecAddf(cent, cent, eve->co); - } - nr++; - } - - VecMulf(cent, 1.0f/(float)totvert); - - return totvert; -} - -static int return_editmesh_vgroup(char *name, float *cent) -{ - EditMesh *em = G.editMesh; - MDeformVert *dvert; - EditVert *eve; - int i, totvert=0; - - cent[0]= cent[1]= cent[2]= 0.0; - - if(G.obedit->actdef) { - - /* find the vertices */ - for(eve= em->verts.first; eve; eve= eve->next) { - dvert= CustomData_em_get(&em->vdata, eve->data, CD_MDEFORMVERT); - - if(dvert) { - for(i=0; itotweight; i++){ - if(dvert->dw[i].def_nr == (G.obedit->actdef-1)) { - totvert++; - VecAddf(cent, cent, eve->co); - } - } - } - } - if(totvert) { - bDeformGroup *defGroup = BLI_findlink(&G.obedit->defbase, G.obedit->actdef-1); - strcpy(name, defGroup->name); - VecMulf(cent, 1.0f/(float)totvert); - return 1; - } - } - - return 0; -} - -static void select_editmesh_hook(HookModifierData *hmd) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - int index=0, nr=0; - - for(eve= em->verts.first; eve; eve= eve->next, nr++) { - if(nr==hmd->indexar[index]) { - eve->f |= SELECT; - if(index < hmd->totindex-1) index++; - } - } - EM_select_flush(); -} - -static int return_editlattice_indexar(int *tot, int **indexar, float *cent) -{ - BPoint *bp; - int *index, nr, totvert=0, a; - - /* count */ - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(bp->f1 & SELECT) { - if(bp->hide==0) totvert++; - } - bp++; - } - - if(totvert==0) return 0; - - *indexar= index= MEM_mallocN(4*totvert, "hook indexar"); - *tot= totvert; - nr= 0; - cent[0]= cent[1]= cent[2]= 0.0; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(bp->f1 & SELECT) { - if(bp->hide==0) { - *index= nr; index++; - VecAddf(cent, cent, bp->vec); - } - } - bp++; - nr++; - } - - VecMulf(cent, 1.0f/(float)totvert); - - return totvert; -} - -static void select_editlattice_hook(HookModifierData *hmd) -{ - BPoint *bp; - int index=0, nr=0, a; - - /* count */ - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(hmd->indexar[index]==nr) { - bp->f1 |= SELECT; - if(index < hmd->totindex-1) index++; - } - nr++; - bp++; - } -} - -static int return_editcurve_indexar(int *tot, int **indexar, float *cent) -{ - extern ListBase editNurb; - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int *index, a, nr, totvert=0; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->f1 & SELECT) totvert++; - if(bezt->f2 & SELECT) totvert++; - if(bezt->f3 & SELECT) totvert++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) totvert++; - bp++; - } - } - } - if(totvert==0) return 0; - - *indexar= index= MEM_mallocN(4*totvert, "hook indexar"); - *tot= totvert; - nr= 0; - cent[0]= cent[1]= cent[2]= 0.0; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(bezt->f1 & SELECT) { - *index= nr; index++; - VecAddf(cent, cent, bezt->vec[0]); - } - nr++; - if(bezt->f2 & SELECT) { - *index= nr; index++; - VecAddf(cent, cent, bezt->vec[1]); - } - nr++; - if(bezt->f3 & SELECT) { - *index= nr; index++; - VecAddf(cent, cent, bezt->vec[2]); - } - nr++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - *index= nr; index++; - VecAddf(cent, cent, bp->vec); - } - nr++; - bp++; - } - } - } - - VecMulf(cent, 1.0f/(float)totvert); - - return totvert; -} - -static void select_editcurve_hook(HookModifierData *hmd) -{ - extern ListBase editNurb; - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - int index=0, a, nr=0; - - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(nr == hmd->indexar[index]) { - bezt->f1 |= SELECT; - if(indextotindex-1) index++; - } - nr++; - if(nr == hmd->indexar[index]) { - bezt->f2 |= SELECT; - if(indextotindex-1) index++; - } - nr++; - if(nr == hmd->indexar[index]) { - bezt->f3 |= SELECT; - if(indextotindex-1) index++; - } - nr++; - - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(nr == hmd->indexar[index]) { - bp->f1 |= SELECT; - if(indextotindex-1) index++; - } - nr++; - bp++; - } - } - } -} - -void hook_select(HookModifierData *hmd) -{ - if(G.obedit->type==OB_MESH) select_editmesh_hook(hmd); - else if(G.obedit->type==OB_LATTICE) select_editlattice_hook(hmd); - else if(G.obedit->type==OB_CURVE) select_editcurve_hook(hmd); - else if(G.obedit->type==OB_SURF) select_editcurve_hook(hmd); -} - -int hook_getIndexArray(int *tot, int **indexar, char *name, float *cent_r) -{ - *indexar= NULL; - *tot= 0; - name[0]= 0; - - switch(G.obedit->type) { - case OB_MESH: - /* check selected vertices first */ - if( return_editmesh_indexar(tot, indexar, cent_r)) return 1; - else return return_editmesh_vgroup(name, cent_r); - case OB_CURVE: - case OB_SURF: - return return_editcurve_indexar(tot, indexar, cent_r); - case OB_LATTICE: - return return_editlattice_indexar(tot, indexar, cent_r); - default: - return 0; - } -} - -void add_hook(void) -{ - ModifierData *md = NULL; - HookModifierData *hmd = NULL; - Object *ob=NULL; - int mode; - - if(G.obedit==NULL) return; - - if(modifiers_findByType(G.obedit, eModifierType_Hook)) - mode= pupmenu("Hooks %t|Add, To New Empty %x1|Add, To Selected Object %x2|Remove... %x3|Reassign... %x4|Select... %x5|Clear Offset...%x6"); - else - mode= pupmenu("Hooks %t|Add, New Empty %x1|Add, To Selected Object %x2"); - - if(mode<1) return; - - /* preconditions */ - - if(mode==2) { /* selected object */ - Base *base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - ob= base->object; - break; - } - } - base= base->next; - } - if(ob==NULL) { - error("Requires selected Object"); - return; - } - } - else if(mode!=1) { - int maxlen=0, a, nr; - char *cp; - - /* make pupmenu with hooks */ - for(md=G.obedit->modifiers.first; md; md= md->next) { - if (md->type==eModifierType_Hook) - maxlen+=32; - } - - if(maxlen==0) { - error("Object has no hooks yet"); - return; - } - - cp= MEM_callocN(maxlen+32, "temp string"); - if(mode==3) strcpy(cp, "Remove %t|"); - else if(mode==4) strcpy(cp, "Reassign %t|"); - else if(mode==5) strcpy(cp, "Select %t|"); - else if(mode==6) strcpy(cp, "Clear Offset %t|"); - - for(md=G.obedit->modifiers.first; md; md= md->next) { - if (md->type==eModifierType_Hook) { - strcat(cp, md->name); - strcat(cp, " |"); - } - } - - nr= pupmenu(cp); - MEM_freeN(cp); - - if(nr<1) return; - - a= 1; - for(md=G.obedit->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - if(a==nr) break; - a++; - } - } - - hmd = (HookModifierData*) md; - ob= hmd->object; - } - - /* do it, new hooks or reassign */ - if(mode==1 || mode==2 || mode==4) { - float cent[3]; - int tot, ok, *indexar; - char name[32]; - - ok = hook_getIndexArray(&tot, &indexar, name, cent); - - if(ok==0) { - error("Requires selected vertices or active Vertex Group"); - } - else { - - if(mode==1) { - Base *base= BASACT, *newbase; - - ob= add_object(OB_EMPTY); - /* set layers OK */ - newbase= BASACT; - newbase->lay= base->lay; - ob->lay= newbase->lay; - - /* transform cent to global coords for loc */ - VecMat4MulVecfl(ob->loc, G.obedit->obmat, cent); - - /* restore, add_object sets active */ - BASACT= base; - } - /* if mode is 2 or 4, ob has been set */ - - /* new hook */ - if(mode==1 || mode==2) { - ModifierData *md = G.obedit->modifiers.first; - - while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) { - md = md->next; - } - - hmd = (HookModifierData*) modifier_new(eModifierType_Hook); - BLI_insertlinkbefore(&G.obedit->modifiers, md, hmd); - sprintf(hmd->modifier.name, "Hook-%s", ob->id.name+2); - } - else if (hmd->indexar) MEM_freeN(hmd->indexar); /* reassign, hook was set */ - - hmd->object= ob; - hmd->indexar= indexar; - VECCOPY(hmd->cent, cent); - hmd->totindex= tot; - BLI_strncpy(hmd->name, name, 32); - - if(mode==1 || mode==2) { - /* matrix calculus */ - /* vert x (obmat x hook->imat) x hook->obmat x ob->imat */ - /* (parentinv ) */ - - where_is_object(ob); - - Mat4Invert(ob->imat, ob->obmat); - /* apparently this call goes from right to left... */ - Mat4MulSerie(hmd->parentinv, ob->imat, G.obedit->obmat, NULL, - NULL, NULL, NULL, NULL, NULL); - } - } - } - else if(mode==3) { /* remove */ - BLI_remlink(&G.obedit->modifiers, md); - modifier_free(md); - } - else if(mode==5) { /* select */ - hook_select(hmd); - } - else if(mode==6) { /* clear offset */ - where_is_object(ob); /* ob is hook->parent */ - - Mat4Invert(ob->imat, ob->obmat); - /* this call goes from right to left... */ - Mat4MulSerie(hmd->parentinv, ob->imat, G.obedit->obmat, NULL, - NULL, NULL, NULL, NULL, NULL); - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - DAG_scene_sort(G.scene); - - BIF_undo_push("Add hook"); -} - -void make_track(void) -{ - Base *base; - short mode=0; - - if(G.scene->id.lib) return; - if(G.obedit) { - return; - } - if(BASACT==0) return; - - mode= pupmenu("Make Track %t|TrackTo Constraint %x1|LockTrack Constraint %x2|Old Track %x3"); - if (mode == 0){ - return; - } - else if (mode == 1){ - bConstraint *con; - bTrackToConstraint *data; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - con = add_new_constraint(CONSTRAINT_TYPE_TRACKTO); - strcpy (con->name, "AutoTrack"); - - data = con->data; - data->tar = BASACT->object; - base->object->recalc |= OB_RECALC; - - /* Lamp and Camera track differently by default */ - if (base->object->type == OB_LAMP || base->object->type == OB_CAMERA) { - data->reserved1 = TRACK_nZ; - data->reserved2 = UP_Y; - } - - add_constraint_to_object(con, base->object); - } - } - base= base->next; - } - - } - else if (mode == 2){ - bConstraint *con; - bLockTrackConstraint *data; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - con = add_new_constraint(CONSTRAINT_TYPE_LOCKTRACK); - strcpy (con->name, "AutoTrack"); - - data = con->data; - data->tar = BASACT->object; - base->object->recalc |= OB_RECALC; - - /* Lamp and Camera track differently by default */ - if (base->object->type == OB_LAMP || base->object->type == OB_CAMERA) { - data->trackflag = TRACK_nZ; - data->lockflag = LOCK_Y; - } - - add_constraint_to_object(con, base->object); - } - } - base= base->next; - } - - } - else if (mode == 3){ - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - base->object->track= BASACT->object; - base->object->recalc |= OB_RECALC; - } - } - base= base->next; - } - } - - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); - DAG_scene_sort(G.scene); - - BIF_undo_push("Make Track"); -} - -void apply_obmat(Object *ob) -{ - float mat[3][3], imat[3][3], tmat[3][3]; - - /* from obmat to loc rot size */ - - if(ob==0) return; - Mat3CpyMat4(mat, ob->obmat); - - VECCOPY(ob->loc, ob->obmat[3]); - - if(ob->transflag & OB_QUAT) { - Mat3ToQuat(mat, ob->quat); - QuatToMat3(ob->quat, tmat); - } - else { - Mat3ToEul(mat, ob->rot); - EulToMat3(ob->rot, tmat); - } - Mat3Inv(imat, tmat); - - Mat3MulMat3(tmat, imat, mat); - - ob->size[0]= tmat[0][0]; - ob->size[1]= tmat[1][1]; - ob->size[2]= tmat[2][2]; - -} - -void clear_parent(void) -{ - Object *par; - Base *base; - int mode; - - if(G.obedit) return; - if(G.scene->id.lib) return; - - mode= pupmenu("OK? %t|Clear Parent %x1|Clear and Keep Transformation (Clear Track) %x2|Clear Parent Inverse %x3"); - - if(mode<1) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - par= NULL; - if(mode==1 || mode==2) { - par= base->object->parent; - base->object->parent= NULL; - base->object->recalc |= OB_RECALC; - - if(mode==2) { - base->object->track= NULL; - apply_obmat(base->object); - } - } - else if(mode==3) { - Mat4One(base->object->parentinv); - base->object->recalc |= OB_RECALC; - } - } - base= base->next; - } - - DAG_scene_sort(G.scene); - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Clear Parent"); -} - -void clear_track(void) -{ - Base *base; - int mode; - - if(G.obedit) return; - if(G.scene->id.lib) return; - - mode= pupmenu("OK? %t|Clear Track %x1| Clear Track and Keep Transform %x2"); - - if(mode<1) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - base->object->track= NULL; - base->object->recalc |= OB_RECALC; - - if(mode==2) { - apply_obmat(base->object); - } - } - base= base->next; - } - - DAG_scene_sort(G.scene); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Clear Track"); -} - -void clear_object(char mode) -{ - Base *base; - Object *ob; - float *v1, *v3, mat[3][3]; - int armature_clear= 0; - char *str=NULL; - - if(G.obedit) return; - if(G.scene->id.lib) return; - - if(mode=='r') str= "Clear rotation"; - else if(mode=='g') str= "Clear location"; - else if(mode=='s') str= "Clear scale"; - else if(mode=='o') str= "Clear origin"; - else return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - ob= base->object; - - if ((ob->flag & OB_POSEMODE)) { - /* only clear pose transforms if: - * - with a mesh in weightpaint mode, it's related armature needs to be cleared - * - with clearing transform of object being edited at the time - */ - if ((G.f & G_WEIGHTPAINT) || ob==OBACT) { - clear_armature(ob, mode); - armature_clear= 1; /* silly system to prevent another dag update, so no action applied */ - } - } - else if((G.f & G_WEIGHTPAINT)==0) { - - if(mode=='r') { - memset(ob->rot, 0, 3*sizeof(float)); - memset(ob->drot, 0, 3*sizeof(float)); - QuatOne(ob->quat); - QuatOne(ob->dquat); -#ifdef WITH_VERSE - if(ob->vnode) { - struct VNode *vnode = (VNode*)ob->vnode; - ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY; - b_verse_send_transformation(ob); - } -#endif - - } - else if(mode=='g') { - memset(ob->loc, 0, 3*sizeof(float)); - memset(ob->dloc, 0, 3*sizeof(float)); -#ifdef WITH_VERSE - if(ob->vnode) { - struct VNode *vnode = (VNode*)ob->vnode; - ((VObjectData*)vnode->data)->flag |= POS_SEND_READY; - b_verse_send_transformation(ob); - } -#endif - - } - else if(mode=='s') { - memset(ob->dsize, 0, 3*sizeof(float)); - ob->size[0]= 1.0; - ob->size[1]= 1.0; - ob->size[2]= 1.0; -#ifdef WITH_VERSE - if(ob->vnode) { - struct VNode *vnode = (VNode*)ob->vnode; - ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY; - b_verse_send_transformation(ob); - } -#endif - - } - else if(mode=='o') { - if(ob->parent) { - v1= ob->loc; - v3= ob->parentinv[3]; - - Mat3CpyMat4(mat, ob->parentinv); - VECCOPY(v3, v1); - v3[0]= -v3[0]; - v3[1]= -v3[1]; - v3[2]= -v3[2]; - Mat3MulVecfl(mat, v3); - } - } - - ob->recalc |= OB_RECALC_OB; - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - if(armature_clear==0) /* in this case flush was done */ - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - BIF_undo_push(str); -} - -void reset_slowparents(void) -{ - /* back to original locations */ - Base *base; - - base= FIRSTBASE; - while(base) { - if(base->object->parent) { - if(base->object->partype & PARSLOW) { - base->object->partype -= PARSLOW; - where_is_object(base->object); - base->object->partype |= PARSLOW; - } - } - base= base->next; - } -} - -void set_slowparent(void) -{ - Base *base; - - if( okee("Set slow parent")==0 ) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base->object->parent) base->object->partype |= PARSLOW; - } - base= base->next; - } - BIF_undo_push("Slow parent"); -} - -void make_vertex_parent(void) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - Base *base; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - Object *par, *ob; - int a, v1=0, v2=0, v3=0, v4=0, nr=1; - - /* we need 1 to 3 selected vertices */ - - if(G.obedit->type==OB_MESH) { - eve= em->verts.first; - while(eve) { - if(eve->f & 1) { - if(v1==0) v1= nr; - else if(v2==0) v2= nr; - else if(v3==0) v3= nr; - else if(v4==0) v4= nr; - else break; - } - nr++; - eve= eve->next; - } - } - else if ELEM(G.obedit->type, OB_SURF, OB_CURVE) { - extern ListBase editNurb; - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - if(BEZSELECTED_HIDDENHANDLES(bezt)) { - if(v1==0) v1= nr; - else if(v2==0) v2= nr; - else if(v3==0) v3= nr; - else if(v4==0) v4= nr; - else break; - } - nr++; - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - if(v1==0) v1= nr; - else if(v2==0) v2= nr; - else if(v3==0) v3= nr; - else if(v4==0) v4= nr; - else break; - } - nr++; - bp++; - } - } - nu= nu->next; - } - } - else if(G.obedit->type==OB_LATTICE) { - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - bp= editLatt->def; - while(a--) { - if(bp->f1 & SELECT) { - if(v1==0) v1= nr; - else if(v2==0) v2= nr; - else if(v3==0) v3= nr; - else if(v4==0) v4= nr; - else break; - } - nr++; - bp++; - } - } - - if(v4 || !((v1 && v2==0 && v3==0) || (v1 && v2 && v3)) ) { - error("Select either 1 or 3 vertices to parent to"); - return; - } - - if(okee("Make vertex parent")==0) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - - ob= base->object; - ob->recalc |= OB_RECALC; - par= BASACT->object->parent; - - while(par) { - if(par==ob) break; - par= par->parent; - } - if(par) { - error("Loop in parents"); - } - else { - ob->parent= BASACT->object; - if(v3) { - ob->partype= PARVERT3; - ob->par1= v1-1; - ob->par2= v2-1; - ob->par3= v3-1; - - /* inverse parent matrix */ - what_does_parent(ob); - Mat4Invert(ob->parentinv, workob.obmat); - clear_workob(); - } - else { - ob->partype= PARVERT1; - ob->par1= v1-1; - - /* inverse parent matrix */ - what_does_parent(ob); - Mat4Invert(ob->parentinv, workob.obmat); - clear_workob(); - } - } - } - } - base= base->next; - } - allqueue(REDRAWVIEW3D, 0); - - DAG_scene_sort(G.scene); - /* BIF_undo_push(str); not, conflicts with editmode undo... */ -} - -static Object *group_objects_menu(Group *group) -{ - GroupObject *go; - int len= 0; - short a, nr; - char *str; - - for(go= group->gobject.first; go; go= go->next) { - if(go->ob) - len++; - } - if(len==0) return NULL; - - str= MEM_callocN(40+32*len, "menu"); - - strcpy(str, "Make Proxy for: %t"); - a= strlen(str); - for(nr=1, go= group->gobject.first; go; go= go->next, nr++) { - a+= sprintf(str+a, "|%s %%x%d", go->ob->id.name+2, nr); - } - - a= pupmenu_col(str, 20); - MEM_freeN(str); - if(a>0) { - go= BLI_findlink(&group->gobject, a-1); - return go->ob; - } - return NULL; -} - - -/* adds empty object to become local replacement data of a library-linked object */ -void make_proxy(void) -{ - Object *ob= OBACT; - Object *gob= NULL; - - if(G.scene->id.lib) return; - if(ob==NULL) return; - - - if(ob->dup_group && ob->dup_group->id.lib) { - gob= ob; - /* gives menu with list of objects in group */ - ob= group_objects_menu(ob->dup_group); - } - else if(ob->id.lib) { - if(okee("Make Proxy Object")==0) - return; - } - else { - error("Can only make proxy for a referenced object or group"); - return; - } - - if(ob) { - Object *newob; - Base *newbase, *oldbase= BASACT; - char name[32]; - - newob= add_object(OB_EMPTY); - if(gob) - strcpy(name, gob->id.name+2); - else - strcpy(name, ob->id.name+2); - strcat(name, "_proxy"); - rename_id(&newob->id, name); - - /* set layers OK */ - newbase= BASACT; /* add_object sets active... */ - newbase->lay= oldbase->lay; - newob->lay= newbase->lay; - - /* remove base, leave user count of object, it gets linked in object_make_proxy */ - if(gob==NULL) { - BLI_remlink(&G.scene->base, oldbase); - MEM_freeN(oldbase); - } - object_make_proxy(newob, ob, gob); - - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, newob, OB_RECALC); - allqueue(REDRAWALL, 0); - BIF_undo_push("Make Proxy Object"); - } -} - -int test_parent_loop(Object *par, Object *ob) -{ - /* test if 'ob' is a parent somewhere in par's parents */ - - if(par==0) return 0; - if(ob == par) return 1; - - return test_parent_loop(par->parent, ob); - -} - -void make_parent(void) -{ - Base *base; - Object *par; - bPoseChannel *pchan= NULL; - short qual, mode=0; - - if(G.scene->id.lib) return; - if(G.obedit) { - if ELEM4(G.obedit->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) make_vertex_parent(); - else if (G.obedit->type==OB_ARMATURE) make_bone_parent(); - return; - } - if(BASACT==0) return; - - qual= G.qual; - par= BASACT->object; - - if(par->type == OB_LATTICE){ - mode= pupmenu("Make Parent %t|Normal Parent %x1|Lattice Deform %x2"); - if(mode<=0){ - return; - } - else if(mode==1) { - mode= PAROBJECT; - } - else if(mode==2) { - mode= PARSKEL; - } - } - else if(par->type == OB_CURVE){ - mode= pupmenu("Make Parent %t|Normal Parent %x1|Follow Path %x2|Curve Deform %x3|Path Constraint %x4"); - if(mode<=0){ - return; - } - else if(mode==1) { - mode= PAROBJECT; - } - else if(mode==2) { - Curve *cu= par->data; - - mode= PAROBJECT; - if((cu->flag & CU_PATH)==0) { - cu->flag |= CU_PATH|CU_FOLLOW; - makeDispListCurveTypes(par, 0); /* force creation of path data */ - } - else cu->flag |= CU_FOLLOW; - } - else if(mode==3) { - mode= PARSKEL; - } - else if(mode==4) { - bConstraint *con; - bFollowPathConstraint *data; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - float cmat[4][4], vec[3]; - - con = add_new_constraint(CONSTRAINT_TYPE_FOLLOWPATH); - strcpy (con->name, "AutoPath"); - - data = con->data; - data->tar = BASACT->object; - - add_constraint_to_object(con, base->object); - - get_constraint_target_matrix(con, 0, CONSTRAINT_OBTYPE_OBJECT, NULL, cmat, G.scene->r.cfra - base->object->sf); - VecSubf(vec, base->object->obmat[3], cmat[3]); - - base->object->loc[0] = vec[0]; - base->object->loc[1] = vec[1]; - base->object->loc[2] = vec[2]; - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - DAG_scene_sort(G.scene); - BIF_undo_push("Make Parent"); - return; - } - } - else if(par->type == OB_ARMATURE){ - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - if(ELEM(base->object->type, OB_MESH, OB_LATTICE)) { - if(par->flag & OB_POSEMODE) - mode= pupmenu("Make Parent To%t|Bone %x1|Armature %x2|Object %x3"); - else - mode= pupmenu("Make Parent To%t|Armature %x2|Object %x3"); - break; - } - else { - if(par->flag & OB_POSEMODE) - mode= pupmenu("Make Parent To %t|Bone %x1|Object %x3"); - else - mode= pupmenu("Make Parent To %t|Object %x3"); - break; - } - } - } - base= base->next; - } - - switch (mode){ - case 1: - mode=PARBONE; - pchan= get_active_posechannel(par); - - if(pchan==NULL) { - error("No active Bone"); - allqueue(REDRAWVIEW3D, 0); - return; - } - - break; - case 2: - mode=PARSKEL; - break; - case 3: - mode=PAROBJECT; - break; - default: - return; - } - } - else { - if(qual & LR_SHIFTKEY) { - if(okee("Make parent without inverse")==0) return; - } - else { - if(qual & LR_ALTKEY) { - if(okee("Make vertex parent")==0) return; - } - else if(okee("Make parent")==0) return; - - /* now we'll clearparentandkeeptransform all objects */ - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT && base->object->parent) { - base->object->parent= NULL; - apply_obmat(base->object); - } - } - base= base->next; - } - } - } - - par->recalc |= OB_RECALC_OB; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base!=BASACT) { - - if( test_parent_loop(par, base->object) ) { - error("Loop in parents"); - } - else { - - base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA; - - /* the ifs below are horrible code (ton) */ - - if (par->type==OB_ARMATURE) { - base->object->partype= mode; - if (pchan) - strcpy (base->object->parsubstr, pchan->name); - else - base->object->parsubstr[0]=0; - } - else { - if(qual & LR_ALTKEY) { - base->object->partype= PARVERT1; - } - else if(ELEM(par->type, OB_CURVE, OB_LATTICE)) { - base->object->partype= mode; - } - else { - base->object->partype= PAROBJECT; - } - } - - base->object->parent= par; - - /* calculate inverse parent matrix? */ - if( (qual & LR_SHIFTKEY) ) { - /* not... */ - Mat4One(base->object->parentinv); - memset(base->object->loc, 0, 3*sizeof(float)); - } - else { - if(mode==PARSKEL && base->object->type==OB_MESH && par->type == OB_ARMATURE) { - /* Prompt the user as to whether he wants to - * add some vertex groups based on the bones - * in the parent armature. - */ - create_vgroups_from_armature(base->object, - par); - - base->object->partype= PAROBJECT; - what_does_parent(base->object); - Mat4One (base->object->parentinv); - base->object->partype= mode; - } - else - what_does_parent(base->object); - Mat4Invert(base->object->parentinv, workob.obmat); - } - } - } - } - base= base->next; - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - - DAG_scene_sort(G.scene); - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - BIF_undo_push("make Parent"); -} - - -void enter_editmode(int wc) -{ - Base *base; - Object *ob; - Mesh *me; - bArmature *arm; - int ok= 0; - - if(G.scene->id.lib) return; - base= BASACT; - if(base==0) return; - if((G.vd==NULL || (base->lay & G.vd->lay))==0) return; - - strcpy(G.editModeTitleExtra, ""); - - ob= base->object; - if(ob->data==0) return; - - if (object_data_is_libdata(ob)) { - error_libdata(); - return; - } - - if(wc) waitcursor(1); - - if(ob->type==OB_MESH) { - me= get_mesh(ob); - if( me==0 ) return; - if(me->pv) sculptmode_pmv_off(me); - ok= 1; - G.obedit= ob; - make_editMesh(); - allqueue(REDRAWBUTSLOGIC, 0); - /*if(G.f & G_FACESELECT) allqueue(REDRAWIMAGE, 0);*/ - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - } - if (ob->type==OB_ARMATURE){ - arm= base->object->data; - if (!arm) return; - /* - * The function object_data_is_libdata make a problem here, the - * check for ob->proxy return 0 and let blender enter to edit mode - * this causa a crash when you try leave the edit mode. - * The problem is that i can't remove the ob->proxy check from - * object_data_is_libdata that prevent the bugfix #6614, so - * i add this little hack here. - */ - if(arm->id.lib) { - error_libdata(); - return; - } - ok=1; - G.obedit=ob; - make_editArmature(); - /* to ensure all goes in restposition and without striding */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC); - - allqueue (REDRAWVIEW3D,0); - } - else if(ob->type==OB_FONT) { - G.obedit= ob; - ok= 1; - make_editText(); - } - else if(ob->type==OB_MBALL) { - G.obedit= ob; - ok= 1; - make_editMball(); - } - else if(ob->type==OB_LATTICE) { - G.obedit= ob; - ok= 1; - make_editLatt(); - } - else if(ob->type==OB_SURF || ob->type==OB_CURVE) { - ok= 1; - G.obedit= ob; - make_editNurb(); - } - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - countall(); - - if(ok) { - setcursor_space(SPACE_VIEW3D, CURSOR_EDIT); - - allqueue(REDRAWVIEW3D, 1); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - } - else G.obedit= NULL; - - if(wc) waitcursor(0); - - scrarea_queue_headredraw(curarea); -} - -void exit_editmode(int flag) /* freedata==0 at render, 1= freedata, 2= do undo buffer too */ -{ - Object *ob; - int freedata = flag & EM_FREEDATA; - - if(G.obedit==NULL) return; - - if(flag & EM_WAITCURSOR) waitcursor(1); - if(G.obedit->type==OB_MESH) { - - /* temporal */ - countall(); - - if(EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - if(retopo_mesh_paint_check()) - retopo_end_okee(); - - if(G.totvert>MESH_MAX_VERTS) { - error("Too many vertices"); - return; - } - load_editMesh(); - - if(freedata) free_editMesh(G.editMesh); - - if(G.f & G_WEIGHTPAINT) - mesh_octree_table(G.obedit, NULL, 'e'); - } - else if (G.obedit->type==OB_ARMATURE){ - load_editArmature(); - if (freedata) free_editArmature(); - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - extern ListBase editNurb; - load_editNurb(); - if(freedata) freeNurblist(&editNurb); - } - else if(G.obedit->type==OB_FONT && freedata) { - load_editText(); - } - else if(G.obedit->type==OB_LATTICE) { - load_editLatt(); - if(freedata) free_editLatt(); - } - else if(G.obedit->type==OB_MBALL) { - extern ListBase editelems; - load_editMball(); - if(freedata) BLI_freelistN(&editelems); - } - - ob= G.obedit; - - /* for example; displist make is different in editmode */ - if(freedata) G.obedit= NULL; - - /* total remake of softbody data */ - if(modifiers_isSoftbodyEnabled(ob)) { - if (ob->soft && ob->soft->keys) { - notice("Erase Baked SoftBody"); - } - - sbObjectToSoftbody(ob); - } - - if(ob->type==OB_MESH && get_mesh(ob)->mr) - multires_edge_level_update(ob, get_mesh(ob)); - - /* also flush ob recalc, doesn't take much overhead, but used for particles */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); - - if(freedata) { - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - } - - countall(); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - - scrarea_queue_headredraw(curarea); - - if(G.obedit==NULL && (flag & EM_FREEUNDO)) - BIF_undo_push("Editmode"); - - if(flag & EM_WAITCURSOR) waitcursor(0); -} - -void check_editmode(int type) -{ - - if (G.obedit==0 || G.obedit->type==type) return; - - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */ -} - -/* 0 == do center, 1 == center new, 2 == center cursor */ - -void docenter(int centermode) -{ - EditMesh *em = G.editMesh; - Base *base; - Object *ob; - Mesh *me, *tme; - Curve *cu; -/* BezTriple *bezt; - BPoint *bp; */ - Nurb *nu, *nu1; - EditVert *eve; - float cent[3], centn[3], min[3], max[3], omat[3][3]; - int a, total= 0; - - /* keep track of what is changed */ - int tot_change=0, tot_lib_error=0, tot_key_error=0, tot_multiuser_arm_error=0; - MVert *mvert; - - if(G.scene->id.lib || G.vd==NULL) return; - - cent[0]= cent[1]= cent[2]= 0.0; - - if(G.obedit) { - - INIT_MINMAX(min, max); - - if(G.obedit->type==OB_MESH) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(G.vd->around==V3D_CENTROID) { - total++; - VECADD(cent, cent, eve->co); - } - else { - DO_MINMAX(eve->co, min, max); - } - } - - if(G.vd->around==V3D_CENTROID) { - VecMulf(cent, 1.0f/(float)total); - } - else { - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - } - - for(eve= em->verts.first; eve; eve= eve->next) { - VecSubf(eve->co, eve->co, cent); - } - - recalc_editnormals(); - tot_change++; - } - } - - /* reset flags */ - for (base=FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) - base->object->flag &= ~OB_DONE; - } - - for (me= G.main->mesh.first; me; me= me->id.next) { - me->flag &= ~ME_ISDONE; - } - - base= FIRSTBASE; - while(base) { - - if TESTBASELIB(base) { - if((base->object->flag & OB_DONE)==0) { - base->object->flag |= OB_DONE; - - if(base->object->id.lib) { - tot_lib_error++; - } - else if(G.obedit==0 && (me=get_mesh(base->object)) ) { - - if(me->key) { - /*error("Can't change the center of a mesh with vertex keys"); - return;*/ - tot_key_error++; - } else if (me->id.lib) { - tot_lib_error++; - } else { - if(centermode==2) { - VECCOPY(cent, give_cursor()); - Mat4Invert(base->object->imat, base->object->obmat); - Mat4MulVecfl(base->object->imat, cent); - } else { - INIT_MINMAX(min, max); - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - DO_MINMAX(mvert->co, min, max); - } - - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - } - - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - VecSubf(mvert->co, mvert->co, cent); - } - me->flag |= ME_ISDONE; - - if(centermode) { - Mat3CpyMat4(omat, base->object->obmat); - - VECCOPY(centn, cent); - Mat3MulVecfl(omat, centn); - base->object->loc[0]+= centn[0]; - base->object->loc[1]+= centn[1]; - base->object->loc[2]+= centn[2]; - - /* other users? */ - ob= G.main->object.first; - while(ob) { - if((ob->flag & OB_DONE)==0) { - tme= get_mesh(ob); - - if(tme==me) { - - ob->flag |= OB_DONE; - ob->recalc= OB_RECALC_OB|OB_RECALC_DATA; - - Mat3CpyMat4(omat, ob->obmat); - VECCOPY(centn, cent); - Mat3MulVecfl(omat, centn); - ob->loc[0]+= centn[0]; - ob->loc[1]+= centn[1]; - ob->loc[2]+= centn[2]; - - if(tme && (tme->flag & ME_ISDONE)==0) { - mvert= tme->mvert; - for(a=0; atotvert; a++, mvert++) { - VecSubf(mvert->co, mvert->co, cent); - } - tme->flag |= ME_ISDONE; - } - } - } - - ob= ob->id.next; - } - } - tot_change++; - } - } - else if ELEM(base->object->type, OB_CURVE, OB_SURF) { - - /* totally weak code here... (ton) */ - if(G.obedit==base->object) { - extern ListBase editNurb; - nu1= editNurb.first; - cu= G.obedit->data; - } - else { - cu= base->object->data; - nu1= cu->nurb.first; - } - - if (cu->id.lib) { - tot_lib_error++; - } else { - if(centermode==2) { - VECCOPY(cent, give_cursor()); - Mat4Invert(base->object->imat, base->object->obmat); - Mat4MulVecfl(base->object->imat, cent); - - /* don't allow Z change if curve is 2D */ - if( !( cu->flag & CU_3D ) ) - cent[2] = 0.0; - } else { - INIT_MINMAX(min, max); - - nu= nu1; - while(nu) { - minmaxNurb(nu, min, max); - nu= nu->next; - } - - cent[0]= (min[0]+max[0])/2.0f; - cent[1]= (min[1]+max[1])/2.0f; - cent[2]= (min[2]+max[2])/2.0f; - } - - nu= nu1; - while(nu) { - if( (nu->type & 7)==1) { - a= nu->pntsu; - while (a--) { - VecSubf(nu->bezt[a].vec[0], nu->bezt[a].vec[0], cent); - VecSubf(nu->bezt[a].vec[1], nu->bezt[a].vec[1], cent); - VecSubf(nu->bezt[a].vec[2], nu->bezt[a].vec[2], cent); - } - } - else { - a= nu->pntsu*nu->pntsv; - while (a--) - VecSubf(nu->bp[a].vec, nu->bp[a].vec, cent); - } - nu= nu->next; - } - - if(centermode && G.obedit==0) { - Mat3CpyMat4(omat, base->object->obmat); - - Mat3MulVecfl(omat, cent); - base->object->loc[0]+= cent[0]; - base->object->loc[1]+= cent[1]; - base->object->loc[2]+= cent[2]; - } - - tot_change++; - if(G.obedit) { - if (centermode==0) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - break; - } - } - } - else if(base->object->type==OB_FONT) { - /* get from bb */ - - cu= base->object->data; - - if(cu->bb==0) { - /* do nothing*/ - } else if (cu->id.lib) { - tot_lib_error++; - } else { - cu->xof= -0.5f*( cu->bb->vec[4][0] - cu->bb->vec[0][0]); - cu->yof= -0.5f -0.5f*( cu->bb->vec[0][1] - cu->bb->vec[2][1]); /* extra 0.5 is the height of above line */ - - /* not really ok, do this better once! */ - cu->xof /= cu->fsize; - cu->yof /= cu->fsize; - - allqueue(REDRAWBUTSEDIT, 0); - tot_change++; - } - } - else if(base->object->type==OB_ARMATURE) { - bArmature *arm = base->object->data; - - if (arm->id.lib) { - tot_lib_error++; - } else if(arm->id.us>1) { - /*error("Can't apply to a multi user armature"); - return;*/ - tot_multiuser_arm_error++; - } else { - /* Function to recenter armatures in editarmature.c - * Bone + object locations are handled there. - */ - docenter_armature(base->object, centermode); - tot_change++; - if(G.obedit) - break; - } - } - base->object->recalc= OB_RECALC_OB|OB_RECALC_DATA; - } - } - base= base->next; - } - if (tot_change) { - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Do Center"); - } - - /* Warn if any errors occured */ - if (tot_lib_error+tot_key_error+tot_multiuser_arm_error) { - char err[512]; - sprintf(err, "Warning %i Object(s) Not Centered, %i Changed:", tot_lib_error+tot_key_error+tot_multiuser_arm_error, tot_change); - - if (tot_lib_error) - sprintf(err+strlen(err), "|%i linked library objects", tot_lib_error); - if (tot_key_error) - sprintf(err+strlen(err), "|%i mesh key object(s)", tot_key_error); - if (tot_multiuser_arm_error) - sprintf(err+strlen(err), "|%i multiuser armature object(s)", tot_multiuser_arm_error); - - error(err); - } -} - -void docenter_new(void) -{ - if(G.scene->id.lib) return; - - if(G.obedit) { - error("Unable to center new in Edit Mode"); - } - else { - docenter(1); - } -} - -void docenter_cursor(void) -{ - if(G.scene->id.lib) return; - - if(G.obedit) { - error("Unable to center cursor in Edit Mode"); - } - else { - docenter(2); - } -} - -void movetolayer(void) -{ - Base *base; - unsigned int lay= 0, local; - int islamp= 0; - - if(G.scene->id.lib) return; - - base= FIRSTBASE; - while(base) { - if TESTBASE(base) lay |= base->lay; - base= base->next; - } - if(lay==0) return; - lay &= 0xFFFFFF; - - if(lay==0) return; - - if(G.vd->localview) { - /* now we can move out of localview. */ - if (!okee("Move from localview")) return; - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - lay= base->lay & ~G.vd->lay; - base->lay= lay; - base->object->lay= lay; - base->object->flag &= ~SELECT; - base->flag &= ~SELECT; - if(base->object->type==OB_LAMP) islamp= 1; - } - base= base->next; - } - } else { - if( movetolayer_buts(&lay, NULL)==0 ) return; - - /* normal non localview operation */ - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - /* upper byte is used for local view */ - local= base->lay & 0xFF000000; - base->lay= lay + local; - base->object->lay= lay; - if(base->object->type==OB_LAMP) islamp= 1; - } - base= base->next; - } - } - if(islamp) reshadeall_displist(); /* only frees */ - - /* warning, active object may be hidden now */ - - countall(); - DAG_scene_sort(G.scene); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWINFO, 0); - - BIF_undo_push("Move to layer"); -} - -/* THIS IS BAD CODE! do not bring back before it has a real implementation (ton) */ -void split_font() -{ - Object *ob = OBACT; - Base *oldbase = BASACT; - Curve *cu= ob->data; - char *p= cu->str; - int slen= strlen(p); - int i; - - for (i = 0; i<=slen; p++, i++) { - adduplicate(1, U.dupflag); - cu= OBACT->data; - cu->sepchar = i+1; - text_to_curve(OBACT, 0); /* pass 1: only one letter, adapt position */ - text_to_curve(OBACT, 0); /* pass 2: remake */ - freedisplist(&OBACT->disp); - makeDispListCurveTypes(OBACT, 0); - - OBACT->flag &= ~SELECT; - BASACT->flag &= ~SELECT; - oldbase->flag |= SELECT; - oldbase->object->flag |= SELECT; - set_active_base(oldbase); - } -} - -void special_editmenu(void) -{ - static short numcuts= 2; - Object *ob= OBACT; - float fac; - int nr,ret; - short randfac; - - if(ob==NULL) return; - - if(G.obedit==NULL) { - - if(ob->flag & OB_POSEMODE) { - pose_special_editmenu(); - } - else if(FACESEL_PAINT_TEST) { - Mesh *me= get_mesh(ob); - MTFace *tface; - MFace *mface; - int a; - - if(me==0 || me->mtface==0) return; - - nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5| TwoSide%x6|Clr Tex%x7| Shared%x8| Light%x9| Invisible%x10| Collision%x11| TwoSide%x12"); - - tface= me->mtface; - mface= me->mface; - for(a=me->totface; a>0; a--, tface++, mface++) { - if(mface->flag & ME_FACE_SEL) { - switch(nr) { - case 1: - tface->mode |= TF_TEX; break; - case 2: - tface->mode |= TF_SHAREDCOL; break; - case 3: - tface->mode |= TF_LIGHT; break; - case 4: - tface->mode |= TF_INVISIBLE; break; - case 5: - tface->mode |= TF_DYNAMIC; break; - case 6: - tface->mode |= TF_TWOSIDE; break; - case 7: - tface->mode &= ~TF_TEX; - tface->tpage= 0; - break; - case 8: - tface->mode &= ~TF_SHAREDCOL; break; - case 9: - tface->mode &= ~TF_LIGHT; break; - case 10: - tface->mode &= ~TF_INVISIBLE; break; - case 11: - tface->mode &= ~TF_DYNAMIC; break; - case 12: - tface->mode &= ~TF_TWOSIDE; break; - } - } - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Change texture face"); - } - else if(G.f & G_VERTEXPAINT) { - Mesh *me= get_mesh(ob); - - if(me==0 || (me->mcol==NULL && me->mtface==NULL) ) return; - - nr= pupmenu("Specials%t|Shared VertexCol%x1"); - if(nr==1) { - - do_shared_vertexcol(me); - - BIF_undo_push("Shared VertexCol"); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - else if(G.f & G_WEIGHTPAINT) { - Object *par= modifiers_isDeformedByArmature(ob); - - if(par && (par->flag & OB_POSEMODE)) { - nr= pupmenu("Specials%t|Apply Bone Envelopes to Vertex Groups %x1|Apply Bone Heat Weights to Vertex Groups %x2"); - - if(nr==1 || nr==2) - pose_adds_vgroups(ob, (nr == 2)); - } - } - else if(G.f & G_PARTICLEEDIT) { - ParticleSystem *psys = PE_get_current(ob); - ParticleEditSettings *pset = PE_settings(); - - if(!psys) - return; - - if(G.scene->selectmode & SCE_SELECT_POINT) - nr= pupmenu("Specials%t|Rekey%x1|Subdivide%x2|Select First%x3|Select Last%x4|Remove Doubles%x5"); - else - nr= pupmenu("Specials%t|Rekey%x1|Remove Doubles%x5"); - - switch(nr) { - case 1: - if(button(&pset->totrekey, 2, 100, "Number of Keys:")==0) return; - waitcursor(1); - PE_rekey(); - break; - case 2: - PE_subdivide(); - break; - case 3: - PE_select_root(); - break; - case 4: - PE_select_tip(); - break; - case 5: - PE_remove_doubles(); - break; - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - if(nr>0) waitcursor(0); - } - else { - Base *base, *base_select= NULL; - - /* Get the active object mesh. */ - Mesh *me= get_mesh(ob); - - /* Booleans, if the active object is a mesh... */ - if (me && ob->id.lib==NULL) { - - /* Bring up a little menu with the boolean operation choices on. */ - nr= pupmenu("Boolean Tools%t|Intersect%x1|Union%x2|Difference%x3|Add Intersect Modifier%x4|Add Union Modifier%x5|Add Difference Modifier%x6"); - - if (nr > 0) { - /* user has made a choice of a menu element. - All of the boolean functions require 2 mesh objects - we search through the object list to find the other - selected item and make sure it is distinct and a mesh. */ - - for(base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { - if(base->object != ob) base_select= base; - } - } - - if (base_select) { - if (get_mesh(base_select->object)) { - if(nr <= 3){ - waitcursor(1); - ret = NewBooleanMesh(BASACT,base_select,nr); - if (ret==0) { - error("An internal error occurred"); - } else if(ret==-1) { - error("Selected meshes must have faces to perform boolean operations"); - } else if (ret==-2) { - error("Both meshes must be a closed mesh"); - } - else BIF_undo_push("Boolean"); - waitcursor(0); - } else { - BooleanModifierData *bmd = NULL; - bmd = (BooleanModifierData *)modifier_new(eModifierType_Boolean); - BLI_addtail(&ob->modifiers, bmd); - bmd->object = base_select->object; - bmd->modifier.mode |= eModifierMode_Realtime; - switch(nr){ - case 4: bmd->operation = eBooleanModifierOp_Intersect; break; - case 5: bmd->operation = eBooleanModifierOp_Union; break; - case 6: bmd->operation = eBooleanModifierOp_Difference; break; - } - do_common_editbuts(B_CHANGEDEP); - BIF_undo_push("Add Boolean modifier"); - } - } else { - error("Please select 2 meshes"); - } - } else { - error("Please select 2 meshes"); - } - } - - allqueue(REDRAWVIEW3D, 0); - } - else if (ob->type == OB_FONT) { - /* removed until this gets a decent implementation (ton) */ -/* nr= pupmenu("Split %t|Characters%x1"); - if (nr > 0) { - switch(nr) { - case 1: split_font(); - } - } -*/ - } - } - } - else if(G.obedit->type==OB_MESH) { - /* This is all that is needed, since all other functionality is in Ctrl+ V/E/F but some users didnt like, so for now have the old/big menu */ - /* - nr= pupmenu("Subdivide Mesh%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x4"); - switch(nr) { - case 1: - waitcursor(1); - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, 1, 0); - - BIF_undo_push("ESubdivide Single"); - break; - case 2: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, numcuts, 0); - BIF_undo_push("ESubdivide"); - break; - case 3: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - waitcursor(1); - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag, numcuts, 0); - BIF_undo_push("Subdivide Fractal"); - break; - - case 4: - fac= 1.0f; - if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; - fac= 0.292f*fac; - - waitcursor(1); - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); - BIF_undo_push("Subdivide Smooth"); - break; - } - */ - - nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Blend From Shape%x16|Propagate To All Shapes%x17|Select Vertex Path%x18"); - - switch(nr) { - case 1: - waitcursor(1); - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, 1, 0); - - BIF_undo_push("ESubdivide Single"); - break; - case 2: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag, numcuts, 0); - BIF_undo_push("ESubdivide"); - break; - case 3: - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - waitcursor(1); - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag, numcuts, 0); - BIF_undo_push("Subdivide Fractal"); - break; - - case 12: /* smooth */ - /* if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; */ - fac= 1.0f; - if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return; - fac= 0.292f*fac; - - waitcursor(1); - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag | B_SMOOTH, 1, 0); - BIF_undo_push("Subdivide Smooth"); - break; - - case 4: - mergemenu(); - break; - case 5: - notice("Removed %d Vertices", removedoublesflag(1, 0, G.scene->toolsettings->doublimit)); - BIF_undo_push("Remove Doubles"); - break; - case 6: - hide_mesh(0); - break; - case 7: - reveal_mesh(); - break; - case 8: - selectswap_mesh(); - break; - case 9: - flip_editnormals(); - BIF_undo_push("Flip Normals"); - break; - case 10: - vertexsmooth(); - break; - case 11: - bevel_menu(); - break; - case 14: - mesh_set_smooth_faces(1); - break; - case 15: - mesh_set_smooth_faces(0); - break; - case 16: - shape_copy_select_from(); - break; - case 17: - shape_propagate(); - break; - case 18: - pathselect(); - BIF_undo_push("Select Vertex Path"); - break; - } - - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - - if(nr>0) waitcursor(0); - - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - - nr= pupmenu("Specials%t|Subdivide%x1|Switch Direction%x2|Set Goal Weight %x3|Set Radius %x4|Smooth Radius %x5"); - - switch(nr) { - case 1: - subdivideNurb(); - break; - case 2: - switchdirectionNurb2(); - break; - case 3: - setweightNurb(); - break; - case 4: - setradiusNurb(); - break; - case 5: - smoothradiusNurb(); - break; - } - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - else if(G.obedit->type==OB_ARMATURE) { - nr= pupmenu("Specials%t|Subdivide %x1|Subdivide Multi%x2|Flip Left-Right Names%x3"); - if(nr==1) - subdivide_armature(1); - if(nr==2) { - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); - subdivide_armature(numcuts); - } - else if(nr==3) - armature_flip_names(); - } - else if(G.obedit->type==OB_LATTICE) { - static float weight= 1.0f; - if(fbutton(&weight, 0.0f, 1.0f, 10, 10, "Set Weight")) { - int a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - BPoint *bp= editLatt->def; - - while(a--) { - if(bp->f1 & SELECT) - bp->weight= weight; - bp++; - } - } - } - - countall(); - allqueue(REDRAWVIEW3D, 0); - -} - -static void curvetomesh(Object *ob) -{ - Curve *cu; - DispList *dl; - - ob->flag |= OB_DONE; - cu= ob->data; - - dl= cu->disp.first; - if(dl==0) makeDispListCurveTypes(ob, 0); /* force creation */ - - nurbs_to_mesh(ob); /* also does users */ - if (ob->type != OB_MESH) { - error("can't convert curve to mesh"); - } else { - object_free_modifiers(ob); - } -} - -void convertmenu(void) -{ - Base *base, *basen=NULL, *basact, *basedel=NULL; - Object *obact, *ob, *ob1; - Curve *cu; - Nurb *nu; - MetaBall *mb; - Mesh *me; - int ok=0, nr = 0, a; - - if(G.scene->id.lib) return; - - obact= OBACT; - if(obact==0) return; - if(!obact->flag & SELECT) return; - if(G.obedit) return; - - basact= BASACT; /* will be restored */ - - if(obact->type==OB_FONT) { - nr= pupmenu("Convert Font to%t|Curve%x1|Curve (Single filling group)%x2|Mesh%x3"); - if(nr>0) ok= 1; - } - else if(obact->type==OB_MBALL) { - nr= pupmenu("Convert Metaball to%t|Mesh (keep original)%x1|Mesh (Delete Original)%x2"); - if(nr>0) ok= 1; - } - else if(obact->type==OB_CURVE) { - nr= pupmenu("Convert Curve to%t|Mesh"); - if(nr>0) ok= 1; - } - else if(obact->type==OB_SURF) { - nr= pupmenu("Convert Nurbs Surface to%t|Mesh"); - if(nr>0) ok= 1; - } - else if(obact->type==OB_MESH) { - nr= pupmenu("Convert Modifiers to%t|Mesh (Keep Original)%x1|Mesh (Delete Original)%x2"); - if(nr>0) ok= 1; - } - if(ok==0) return; - - /* don't forget multiple users! */ - - /* reset flags */ - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - base->object->flag &= ~OB_DONE; - } - base= base->next; - } - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - - ob= base->object; - - if(ob->flag & OB_DONE); - else if(ob->type==OB_MESH && ob->modifiers.first) { /* converting a mesh with no modifiers causes a segfault */ - DerivedMesh *dm; - - basedel = base; - - ob->flag |= OB_DONE; - - ob1= copy_object(ob); - ob1->recalc |= OB_RECALC; - - basen= MEM_mallocN(sizeof(Base), "duplibase"); - *basen= *base; - BLI_addhead(&G.scene->base, basen); /* addhead: otherwise eternal loop */ - basen->object= ob1; - basen->flag |= SELECT; - base->flag &= ~SELECT; - ob->flag &= ~SELECT; - - /* decrement original mesh's usage count */ - me= ob1->data; - me->id.us--; - - /* make a new copy of the mesh */ - ob1->data= copy_mesh(me); - G.totmesh++; - - /* make new mesh data from the original copy */ - dm= mesh_get_derived_final(ob1, CD_MASK_MESH); - /* dm= mesh_create_derived_no_deform(ob1, NULL); this was called original (instead of get_derived). man o man why! (ton) */ - - DM_to_mesh(dm, ob1->data); - - dm->release(dm); - object_free_modifiers(ob1); /* after derivedmesh calls! */ - - /* If the original object is active then make this object active */ - if (ob == obact) { - set_active_base( basen ); - basact = basen; - } - } - else if(ob->type==OB_FONT) { - ob->flag |= OB_DONE; - - ob->type= OB_CURVE; - cu= ob->data; - - if(cu->vfont) { - cu->vfont->id.us--; - cu->vfont= 0; - } - if(cu->vfontb) { - cu->vfontb->id.us--; - cu->vfontb= 0; - } - if(cu->vfonti) { - cu->vfonti->id.us--; - cu->vfonti= 0; - } - if(cu->vfontbi) { - cu->vfontbi->id.us--; - cu->vfontbi= 0; - } - /* other users */ - if(cu->id.us>1) { - ob1= G.main->object.first; - while(ob1) { - if(ob1->data==cu) { - ob1->type= OB_CURVE; - ob1->recalc |= OB_RECALC; - } - ob1= ob1->id.next; - } - } - if (nr==2 || nr==3) { - nu= cu->nurb.first; - while(nu) { - nu->charidx= 0; - nu= nu->next; - } - } - if (nr==3) { - curvetomesh(ob); - } - } - else if ELEM(ob->type, OB_CURVE, OB_SURF) { - if(nr==1) { - curvetomesh(ob); - } - } - else if(ob->type==OB_MBALL) { - - if(nr==1 || nr == 2) { - ob= find_basis_mball(ob); - - if(ob->disp.first && !(ob->flag&OB_DONE)) { - basedel = base; - - ob->flag |= OB_DONE; - - ob1= copy_object(ob); - ob1->recalc |= OB_RECALC; - - basen= MEM_mallocN(sizeof(Base), "duplibase"); - *basen= *base; - BLI_addhead(&G.scene->base, basen); /* addhead: othwise eternal loop */ - basen->object= ob1; - basen->flag |= SELECT; - basedel->flag &= ~SELECT; - ob->flag &= ~SELECT; - - mb= ob1->data; - mb->id.us--; - - ob1->data= add_mesh("Mesh"); - G.totmesh++; - ob1->type= OB_MESH; - - me= ob1->data; - me->totcol= mb->totcol; - if(ob1->totcol) { - me->mat= MEM_dupallocN(mb->mat); - for(a=0; atotcol; a++) id_us_plus((ID *)me->mat[a]); - } - - mball_to_mesh(&ob->disp, ob1->data); - - /* So we can see the wireframe */ - BASACT= basen; - - /* If the original object is active then make this object active */ - if (ob == obact) { - set_active_base( basen ); - basact = basen; - } - - } - } - } - } - base= base->next; - if(basedel != NULL && nr == 2) { - if(basedel==basact) - basact= NULL; - free_and_unlink_base(basedel); - } - basedel = NULL; - } - - /* texspace and normals */ - if(!basen) BASACT= base; - - enter_editmode(EM_WAITCURSOR); - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */ - BASACT= basact; - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allspace(OOPS_TEST, 0); - allqueue(REDRAWBUTSEDIT, 0); - BIF_undo_push("Convert Object"); - - DAG_scene_sort(G.scene); -} - -/* Change subdivision or particle properties of mesh object ob, if level==-1 - * then toggle subsurf, else set to level set allows to toggle multiple - * selections */ - -static void object_has_subdivision_particles(Object *ob, int *havesubdiv, int *havepart, int depth) -{ - if(ob->type==OB_MESH) { - if(modifiers_findByType(ob, eModifierType_Subsurf)) - *havesubdiv= 1; - if(modifiers_findByType(ob, eModifierType_ParticleSystem)) - *havepart= 1; - } - - if(ob->dup_group && depth <= 4) { - GroupObject *go; - - for(go= ob->dup_group->gobject.first; go; go= go->next) - object_has_subdivision_particles(go->ob, havesubdiv, havepart, depth+1); - } -} - -static void object_flip_subdivison_particles(Object *ob, int *set, int level, int mode, int particles, int depth) -{ - ModifierData *md; - - if(ob->type==OB_MESH) { - if(particles) { - for(md=ob->modifiers.first; md; md=md->next) { - if(md->type == eModifierType_ParticleSystem) { - ParticleSystemModifierData *psmd = (ParticleSystemModifierData*)md; - - if(*set == -1) - *set= psmd->modifier.mode&(mode); - - if (*set) - psmd->modifier.mode &= ~(mode); - else - psmd->modifier.mode |= (mode); - } - } - } - else { - md = modifiers_findByType(ob, eModifierType_Subsurf); - - if (md) { - SubsurfModifierData *smd = (SubsurfModifierData*) md; - - if (level == -1) { - if(*set == -1) - *set= smd->modifier.mode&(mode); - - if (*set) - smd->modifier.mode &= ~(mode); - else - smd->modifier.mode |= (mode); - } else { - smd->levels = level; - } - } - else if(depth == 0 && *set != 0) { - SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf); - - BLI_addtail(&ob->modifiers, smd); - - if (level!=-1) { - smd->levels = level; - } - - if(*set == -1) - *set= 1; - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - - if(ob->dup_group && depth<=4) { - GroupObject *go; - - for(go= ob->dup_group->gobject.first; go; go= go->next) - object_flip_subdivison_particles(go->ob, set, level, mode, particles, depth+1); - } -} - -/* Change subdivision properties of mesh object ob, if -* level==-1 then toggle subsurf, else set to level. -*/ - -void flip_subdivison(int level) -{ - Base *base; - int set= -1; - int mode, pupmode, particles= 0, havesubdiv= 0, havepart= 0; - - if(G.qual & LR_ALTKEY) - mode= eModifierMode_Realtime; - else - mode= eModifierMode_Render|eModifierMode_Realtime; - - if(level == -1) { - for(base= G.scene->base.first; base; base= base->next) - if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) - object_has_subdivision_particles(base->object, &havesubdiv, &havepart, 0); - } - else - havesubdiv= 1; - - if(havesubdiv && havepart) { - pupmode= pupmenu("Switch%t|Subsurf %x1|Particle Systems %x2"); - if(pupmode <= 0) - return; - else if(pupmode == 2) - particles= 1; - } - else if(havepart) - particles= 1; - - for(base= G.scene->base.first; base; base= base->next) - if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) - object_flip_subdivison_particles(base->object, &set, level, mode, particles, 0); - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - if(particles) - BIF_undo_push("Switch particles on/off"); - else - BIF_undo_push("Switch subsurf on/off"); -} - -static void copymenu_properties(Object *ob) -{ - bProperty *prop, *propn, *propc; - Base *base; - int nr, tot=0; - char *str; - - prop= ob->prop.first; - while(prop) { - tot++; - prop= prop->next; - } - - if(tot==0) { - error("No properties in the active object to copy"); - return; - } - - str= MEM_callocN(24+32*tot, "copymenu prop"); - - strcpy(str, "Copy Property %t"); - - tot= 0; - prop= ob->prop.first; - while(prop) { - tot++; - strcat(str, " |"); - strcat(str, prop->name); - prop= prop->next; - } - - nr= pupmenu(str); - if(nr>0) { - tot= 0; - prop= ob->prop.first; - while(prop) { - tot++; - if(tot==nr) break; - prop= prop->next; - } - if(prop) { - propc= prop; - - base= FIRSTBASE; - while(base) { - if(base != BASACT) { - if(TESTBASELIB(base)) { - prop= get_property(base->object, propc->name); - if(prop) { - free_property(prop); - BLI_remlink(&base->object->prop, prop); - } - propn= copy_property(propc); - BLI_addtail(&base->object->prop, propn); - } - } - base= base->next; - } - } - } - MEM_freeN(str); - allqueue(REDRAWVIEW3D, 0); - - BIF_undo_push("Copy properties"); -} - -static void copymenu_logicbricks(Object *ob) -{ - Base *base; - - base= FIRSTBASE; - while(base) { - if(base->object != ob) { - if(TESTBASELIB(base)) { - - /* first: free all logic */ - free_sensors(&base->object->sensors); - unlink_controllers(&base->object->controllers); - free_controllers(&base->object->controllers); - unlink_actuators(&base->object->actuators); - free_actuators(&base->object->actuators); - - /* now copy it, this also works without logicbricks! */ - clear_sca_new_poins_ob(ob); - copy_sensors(&base->object->sensors, &ob->sensors); - copy_controllers(&base->object->controllers, &ob->controllers); - copy_actuators(&base->object->actuators, &ob->actuators); - set_sca_new_poins_ob(base->object); - - /* some menu settings */ - base->object->scavisflag= ob->scavisflag; - base->object->scaflag= ob->scaflag; - - } - } - base= base->next; - } - BIF_undo_push("Copy logic"); -} - -static void copymenu_modifiers(Object *ob) -{ - Base *base; - int i, event; - char str[512]; - char *errorstr= NULL; - - strcpy(str, "Copy Modifiers %t"); - - sprintf(str+strlen(str), "|All%%x%d|%%l", NUM_MODIFIER_TYPES); - - for (i=eModifierType_None+1; iflags&eModifierTypeFlag_AcceptsCVs) || - (ob->type==OB_MESH && (mti->flags&eModifierTypeFlag_AcceptsMesh))) { - sprintf(str+strlen(str), "|%s%%x%d", mti->name, i); - } - } - - event = pupmenu(str); - if(event<=0) return; - - for (base= FIRSTBASE; base; base= base->next) { - if(base->object != ob) { - if(TESTBASELIB(base)) { - ModifierData *md; - - base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA; - - if (base->object->type==ob->type) { - /* copy all */ - if (event==NUM_MODIFIER_TYPES) { - object_free_modifiers(base->object); - - for (md=ob->modifiers.first; md; md=md->next) { - if (md->type!=eModifierType_Hook) { - ModifierData *nmd = modifier_new(md->type); - modifier_copyData(md, nmd); - BLI_addtail(&base->object->modifiers, nmd); - } - } - } else { - /* copy specific types */ - ModifierData *md, *mdn; - - /* remove all with type 'event' */ - for (md=base->object->modifiers.first; md; md=mdn) { - mdn= md->next; - if(md->type==event) { - BLI_remlink(&base->object->modifiers, md); - modifier_free(md); - } - } - - /* copy all with type 'event' */ - for (md=ob->modifiers.first; md; md=md->next) { - if (md->type==event) { - - mdn = modifier_new(event); - BLI_addtail(&base->object->modifiers, mdn); - - modifier_copyData(md, mdn); - } - } - } - } - else - errorstr= "Did not copy modifiers to other Object types"; - } - } - } - - if(errorstr) notice(errorstr); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - DAG_scene_sort(G.scene); - - BIF_undo_push("Copy modifiers"); -} - -/* both pointers should exist */ -static void copy_texture_space(Object *to, Object *ob) -{ - float *poin1= NULL, *poin2= NULL; - int texflag= 0; - - if(ob->type==OB_MESH) { - texflag= ((Mesh *)ob->data)->texflag; - poin2= ((Mesh *)ob->data)->loc; - } - else if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - texflag= ((Curve *)ob->data)->texflag; - poin2= ((Curve *)ob->data)->loc; - } - else if(ob->type==OB_MBALL) { - texflag= ((MetaBall *)ob->data)->texflag; - poin2= ((MetaBall *)ob->data)->loc; - } - else - return; - - if(to->type==OB_MESH) { - ((Mesh *)to->data)->texflag= texflag; - poin1= ((Mesh *)to->data)->loc; - } - else if (ELEM3(to->type, OB_CURVE, OB_SURF, OB_FONT)) { - ((Curve *)to->data)->texflag= texflag; - poin1= ((Curve *)to->data)->loc; - } - else if(to->type==OB_MBALL) { - ((MetaBall *)to->data)->texflag= texflag; - poin1= ((MetaBall *)to->data)->loc; - } - else - return; - - memcpy(poin1, poin2, 9*sizeof(float)); /* this was noted in DNA_mesh, curve, mball */ - - if(to->type==OB_MESH) ; - else if(to->type==OB_MBALL) tex_space_mball(to); - else tex_space_curve(to->data); - -} - -void copy_attr(short event) -{ - Object *ob; - Base *base; - Curve *cu, *cu1; - Nurb *nu; - int do_scene_sort= 0; - - if(G.scene->id.lib) return; - - if(!(ob=OBACT)) return; - - if(G.obedit) { - /* obedit_copymenu(); */ - return; - } - if(event==9) { - copymenu_properties(ob); - return; - } - else if(event==10) { - copymenu_logicbricks(ob); - return; - } - else if(event==24) { - copymenu_modifiers(ob); - return; - } - - base= FIRSTBASE; - while(base) { - if(base != BASACT) { - if(TESTBASELIB(base)) { - base->object->recalc |= OB_RECALC_OB; - - if(event==1) { /* loc */ - VECCOPY(base->object->loc, ob->loc); - VECCOPY(base->object->dloc, ob->dloc); - } - else if(event==2) { /* rot */ - VECCOPY(base->object->rot, ob->rot); - VECCOPY(base->object->drot, ob->drot); - VECCOPY(base->object->quat, ob->quat); - VECCOPY(base->object->dquat, ob->dquat); - } - else if(event==3) { /* size */ - VECCOPY(base->object->size, ob->size); - VECCOPY(base->object->dsize, ob->dsize); - } - else if(event==4) { /* drawtype */ - base->object->dt= ob->dt; - base->object->dtx= ob->dtx; - base->object->empty_drawtype= ob->empty_drawtype; - base->object->empty_drawsize= ob->empty_drawsize; - } - else if(event==5) { /* time offs */ - base->object->sf= ob->sf; - } - else if(event==6) { /* dupli */ - base->object->dupon= ob->dupon; - base->object->dupoff= ob->dupoff; - base->object->dupsta= ob->dupsta; - base->object->dupend= ob->dupend; - - base->object->transflag &= ~OB_DUPLI; - base->object->transflag |= (ob->transflag & OB_DUPLI); - - base->object->dup_group= ob->dup_group; - if(ob->dup_group) - id_us_plus((ID *)ob->dup_group); - } - else if(event==7) { /* mass */ - base->object->mass= ob->mass; - } - else if(event==8) { /* damping */ - base->object->damping= ob->damping; - base->object->rdamping= ob->rdamping; - } - else if(event==17) { /* tex space */ - copy_texture_space(base->object, ob); - } - else if(event==18) { /* font settings */ - - if(base->object->type==ob->type) { - cu= ob->data; - cu1= base->object->data; - - cu1->spacemode= cu->spacemode; - cu1->spacing= cu->spacing; - cu1->linedist= cu->linedist; - cu1->shear= cu->shear; - cu1->fsize= cu->fsize; - cu1->xof= cu->xof; - cu1->yof= cu->yof; - cu1->textoncurve= cu->textoncurve; - cu1->wordspace= cu->wordspace; - cu1->ulpos= cu->ulpos; - cu1->ulheight= cu->ulheight; - if(cu1->vfont) cu1->vfont->id.us--; - cu1->vfont= cu->vfont; - id_us_plus((ID *)cu1->vfont); - if(cu1->vfontb) cu1->vfontb->id.us--; - cu1->vfontb= cu->vfontb; - id_us_plus((ID *)cu1->vfontb); - if(cu1->vfonti) cu1->vfonti->id.us--; - cu1->vfonti= cu->vfonti; - id_us_plus((ID *)cu1->vfonti); - if(cu1->vfontbi) cu1->vfontbi->id.us--; - cu1->vfontbi= cu->vfontbi; - id_us_plus((ID *)cu1->vfontbi); - - text_to_curve(base->object, 0); /* needed? */ - - - strcpy(cu1->family, cu->family); - - base->object->recalc |= OB_RECALC_DATA; - } - } - else if(event==19) { /* bevel settings */ - - if ELEM(base->object->type, OB_CURVE, OB_FONT) { - cu= ob->data; - cu1= base->object->data; - - cu1->bevobj= cu->bevobj; - cu1->taperobj= cu->taperobj; - cu1->width= cu->width; - cu1->bevresol= cu->bevresol; - cu1->ext1= cu->ext1; - cu1->ext2= cu->ext2; - - base->object->recalc |= OB_RECALC_DATA; - } - } - else if(event==25) { /* curve resolution */ - - if ELEM(base->object->type, OB_CURVE, OB_FONT) { - cu= ob->data; - cu1= base->object->data; - - cu1->resolu= cu->resolu; - cu1->resolu_ren= cu->resolu_ren; - - nu= cu1->nurb.first; - - while(nu) { - nu->resolu= cu1->resolu; - nu= nu->next; - } - - base->object->recalc |= OB_RECALC_DATA; - } - } - else if(event==20) { /* particle settings */ - PartEff *pa1, *pa2; - char *p1, *p2; - - pa1= give_parteff(ob); - pa2= give_parteff(base->object); - - if(pa1==0 && pa2) { - BLI_remlink( &(base->object->effect), pa2); - free_effect( (Effect *) pa2); - } - else if(pa1 && pa2==0) { - free_effects(&(base->object->effect)); - copy_effects(&(base->object->effect), &ob->effect); - build_particle_system(base->object); - } - else if(pa1 && pa2) { - if(pa2->keys) MEM_freeN(pa2->keys); - - p1= (char *)pa1; p2= (char *)pa2; - memcpy( p2+8, p1+8, sizeof(PartEff) - 8); - pa2->keys= 0; - - build_particle_system(base->object); - } - } - else if(event==21){ - if (base->object->type==OB_MESH) { - ModifierData *md = modifiers_findByType(ob, eModifierType_Subsurf); - - if (md) { - ModifierData *tmd = modifiers_findByType(base->object, eModifierType_Subsurf); - - if (!tmd) { - tmd = modifier_new(eModifierType_Subsurf); - BLI_addtail(&base->object->modifiers, tmd); - } - - modifier_copyData(md, tmd); - base->object->recalc |= OB_RECALC_DATA; - } - } - } - else if(event==22) { - /* Clear the constraints on the target */ - free_constraints(&base->object->constraints); - free_constraint_channels(&base->object->constraintChannels); - - /* Copy the constraint channels over */ - copy_constraints(&base->object->constraints, &ob->constraints); - if (U.dupflag& USER_DUP_IPO) - copy_constraint_channels(&base->object->constraintChannels, &ob->constraintChannels); - else - clone_constraint_channels (&base->object->constraintChannels, &ob->constraintChannels); - - do_scene_sort= 1; - } - else if(event==23) { - base->object->softflag= ob->softflag; - if(base->object->soft) sbFree(base->object->soft); - - base->object->soft= copy_softbody(ob->soft); - - if (!modifiers_findByType(base->object, eModifierType_Softbody)) { - BLI_addhead(&base->object->modifiers, modifier_new(eModifierType_Softbody)); - } - } - else if(event==26) { - copy_nlastrips(&base->object->nlastrips, &ob->nlastrips); - } - else if(event==27) { /* autosmooth */ - if (base->object->type==OB_MESH) { - Mesh *me= ob->data; - Mesh *cme= base->object->data; - cme->smoothresh= me->smoothresh; - if(me->flag & ME_AUTOSMOOTH) - cme->flag |= ME_AUTOSMOOTH; - else - cme->flag &= ~ME_AUTOSMOOTH; - } - } - else if(event==28) { /* UV orco */ - if ELEM(base->object->type, OB_CURVE, OB_SURF) { - cu= ob->data; - cu1= base->object->data; - - if(cu->flag & CU_UV_ORCO) - cu1->flag |= CU_UV_ORCO; - else - cu1->flag &= ~CU_UV_ORCO; - } - } - else if(event==29) { /* protected bits */ - base->object->protectflag= ob->protectflag; - } - else if(event==30) { /* index object */ - base->object->index= ob->index; - } - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - if(do_scene_sort) - DAG_scene_sort(G.scene); - - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - if(event==20) { - allqueue(REDRAWBUTSOBJECT, 0); - } - - BIF_undo_push("Copy Attributes"); -} - -void copy_attr_menu() -{ - Object *ob; - short event; - char str[512]; - - if(!(ob=OBACT)) return; - - if (G.obedit) { - if (ob->type == OB_MESH) - mesh_copy_menu(); - return; - } - - /* Object Mode */ - - /* If you change this menu, don't forget to update the menu in header_view3d.c - * view3d_edit_object_copyattrmenu() and in toolbox.c - */ - - strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l"); - - strcat (str, "|Object Constraints%x22"); - strcat (str, "|NLA Strips%x26"); - - if ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL) { - strcat(str, "|Texture Space%x17"); - } - - if(ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19"); - if(ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19|UV Orco%x28"); - - if((ob->type == OB_FONT) || (ob->type == OB_CURVE)) { - strcat(str, "|Curve Resolution%x25"); - } - - if(ob->type==OB_MESH){ - strcat(str, "|Subsurf Settings%x21|AutoSmooth%x27"); - } - - if( give_parteff(ob) ) strcat(str, "|Particle Settings%x20"); - - if(ob->soft) strcat(str, "|Soft Body Settings%x23"); - - strcat(str, "|Pass Index%x30"); - - if(ob->type==OB_MESH || ob->type==OB_CURVE || ob->type==OB_LATTICE || ob->type==OB_SURF){ - strcat(str, "|Modifiers ...%x24"); - } - - event= pupmenu(str); - if(event<= 0) return; - - copy_attr(event); -} - - -void link_to_scene(unsigned short nr) -{ - Scene *sce= (Scene*) BLI_findlink(&G.main->scene, G.curscreen->scenenr-1); - Base *base, *nbase; - - if(sce==0) return; - if(sce->id.lib) return; - - base= FIRSTBASE; - while(base) { - if(TESTBASE(base)) { - - nbase= MEM_mallocN( sizeof(Base), "newbase"); - *nbase= *base; - BLI_addhead( &(sce->base), nbase); - id_us_plus((ID *)base->object); - } - base= base->next; - } -} - -void make_links_menu() -{ - Object *ob; - short event=0; - char str[140]; - - if(!(ob=OBACT)) return; - - strcpy(str, "Make Links %t|To Scene...%x1|%l|Object Ipo%x4"); - - if(ob->type==OB_MESH) - strcat(str, "|Mesh Data%x2|Materials%x3"); - else if(ob->type==OB_CURVE) - strcat(str, "|Curve Data%x2|Materials%x3"); - else if(ob->type==OB_FONT) - strcat(str, "|Text Data%x2|Materials%x3"); - else if(ob->type==OB_SURF) - strcat(str, "|Surface Data%x2|Materials%x3"); - else if(ob->type==OB_MBALL) - strcat(str, "|Materials%x3"); - else if(ob->type==OB_CAMERA) - strcat(str, "|Camera Data%x2"); - else if(ob->type==OB_LAMP) - strcat(str, "|Lamp Data%x2"); - else if(ob->type==OB_LATTICE) - strcat(str, "|Lattice Data%x2"); - else if(ob->type==OB_ARMATURE) - strcat(str, "|Armature Data%x2"); - - event= pupmenu(str); - - if(event<= 0) return; - - make_links(event); -} - -void make_links(short event) -{ - Object *ob, *obt; - Base *base, *nbase, *sbase; - Scene *sce = NULL; - ID *id; - int a; - short nr=0; - char *strp; - - if(!(ob=OBACT)) return; - - if(event==1) { - IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), 0, &nr); - - if(nr == -2) { - MEM_freeN(strp); - - activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE, &(G.curscreen->scenenr), link_to_scene ); - - return; - } - else { - event= pupmenu_col(strp, 20); - MEM_freeN(strp); - - if(event<= 0) return; - - nr= 1; - sce= G.main->scene.first; - while(sce) { - if(nr==event) break; - nr++; - sce= sce->id.next; - } - if(sce==G.scene) { - error("This is the current scene"); - return; - } - if(sce==0 || sce->id.lib) return; - - /* remember: is needed below */ - event= 1; - } - } - - /* All non group linking */ - base= FIRSTBASE; - while(base) { - if(event==1 || base != BASACT) { - - obt= base->object; - - if(TESTBASE(base)) { - - if(event==1) { /* to scene */ - - /* test if already linked */ - sbase= sce->base.first; - while(sbase) { - if(sbase->object==base->object) break; - sbase= sbase->next; - } - if(sbase) { /* remove */ - base= base->next; - continue; - } - - nbase= MEM_mallocN( sizeof(Base), "newbase"); - *nbase= *base; - BLI_addhead( &(sce->base), nbase); - id_us_plus((ID *)base->object); - } - } - if(TESTBASELIB(base)) { - if(event==2 || event==5) { /* obdata */ - if(ob->type==obt->type) { - - id= obt->data; - id->us--; - - id= ob->data; - id_us_plus(id); - obt->data= id; - - /* if amount of material indices changed: */ - test_object_materials(obt->data); - - obt->recalc |= OB_RECALC_DATA; - } - } - else if(event==4) { /* ob ipo */ - if(obt->ipo) obt->ipo->id.us--; - obt->ipo= ob->ipo; - if(obt->ipo) { - id_us_plus((ID *)obt->ipo); - do_ob_ipo(obt); - } - } - else if(event==6) { - if(ob->dup_group) ob->dup_group->id.us--; - obt->dup_group= ob->dup_group; - if(obt->dup_group) { - id_us_plus((ID *)obt->dup_group); - obt->transflag |= OB_DUPLIGROUP; - } - } - else if(event==3) { /* materials */ - - /* new approach, using functions from kernel */ - for(a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a+1); - assign_material(obt, ma, a+1); /* also works with ma==NULL */ - } - } - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSHEAD, 0); - - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - BIF_undo_push("Create links"); -} - -void apply_object() -{ - Base *base, *basact; - Object *ob; - Mesh *me; - Curve *cu; - Nurb *nu; - BPoint *bp; - BezTriple *bezt; - MVert *mvert; - float mat[3][3]; - int a; - - if(G.scene->id.lib) return; - if(G.obedit) return; - basact= BASACT; - - if(G.qual & LR_SHIFTKEY) { - ob= OBACT; - if(ob==0) return; - - if(ob->transflag & OB_DUPLI) { - make_duplilist_real(); - } - else { - if(okee("Apply deformation")) { - object_apply_deform(ob); - BIF_undo_push("Apply deformation"); - } - } - allqueue(REDRAWVIEW3D, 0); - - return; - } - - if(okee("Apply scale and rotation")==0) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - ob= base->object; - - if(ob->type==OB_MESH) { - object_to_mat3(ob, mat); - me= ob->data; - - if(me->id.us>1) { - error("Can't apply to a multi user mesh"); - return; - } - if(me->key) { - error("Can't apply to a mesh with vertex keys"); - return; - } - - mvert= me->mvert; - for(a=0; atotvert; a++, mvert++) { - Mat3MulVecfl(mat, mvert->co); - } - ob->size[0]= ob->size[1]= ob->size[2]= 1.0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0; - QuatOne(ob->quat); - - where_is_object(ob); - - /* texspace and normals */ - BASACT= base; - enter_editmode(EM_WAITCURSOR); - BIF_undo_push("Applied object"); /* editmode undo itself */ - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */ - BASACT= basact; - - } - else if (ob->type==OB_ARMATURE){ - bArmature *arm; - - object_to_mat3(ob, mat); - arm= ob->data; - if(arm->id.us>1) { - error("Can't apply to a multi user armature"); - return; - } - - apply_rot_armature (ob, mat); - /* Reset the object's transforms */ - ob->size[0]= ob->size[1]= ob->size[2]= 1.0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0; - QuatOne(ob->quat); - - where_is_object(ob); - } - else if ELEM(ob->type, OB_CURVE, OB_SURF) { - float scale; - object_to_mat3(ob, mat); - scale = Mat3ToScalef(mat); - cu= ob->data; - - if(cu->id.us>1) { - error("Can't apply to a multi user curve"); - return; - } - if(cu->key) { - error("Can't apply to a curve with vertex keys"); - return; - } - - nu= cu->nurb.first; - while(nu) { - if( (nu->type & 7)==1) { - a= nu->pntsu; - bezt= nu->bezt; - while(a--) { - Mat3MulVecfl(mat, bezt->vec[0]); - Mat3MulVecfl(mat, bezt->vec[1]); - Mat3MulVecfl(mat, bezt->vec[2]); - bezt->radius *= scale; - bezt++; - } - } - else { - a= nu->pntsu*nu->pntsv; - bp= nu->bp; - while(a--) { - Mat3MulVecfl(mat, bp->vec); - bp++; - } - } - nu= nu->next; - } - - ob->size[0]= ob->size[1]= ob->size[2]= 1.0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0.0; - QuatOne(ob->quat); - - where_is_object(ob); - - /* texspace and normals */ - BASACT= base; - enter_editmode(EM_WAITCURSOR); - BIF_undo_push("Applied object"); /* editmode undo itself */ - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */ - BASACT= basact; - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Apply object"); -} - - - -/* ************ GENERAL *************** */ - - -/* now only used in 2d spaces, like ipo, nla, sima... */ -void apply_keyb_grid(float *val, float fac1, float fac2, float fac3, int invert) -{ - /* fac1 is for 'nothing', fac2 for CTRL, fac3 for SHIFT */ - int ctrl; - - if(invert) { - if(G.qual & LR_CTRLKEY) ctrl= 0; - else ctrl= 1; - } - else ctrl= (G.qual & LR_CTRLKEY); - - if(ctrl && (G.qual & LR_SHIFTKEY)) { - if(fac3!= 0.0) *val= fac3*floor(*val/fac3 +.5); - } - else if(ctrl) { - if(fac2!= 0.0) *val= fac2*floor(*val/fac2 +.5); - } - else { - if(fac1!= 0.0) *val= fac1*floor(*val/fac1 +.5); - } -} - -int cylinder_intersect_test(void) -{ - EditMesh *em = G.editMesh; - float *oldloc, speed[3], s, t, labda, labdacor, dist, len, len2, axis[3], *base, rc[3], n[3], o[3]; - EditVert *v1; - - v1= em->verts.first; - - base= v1->co; - v1= v1->next; - VecSubf(axis, v1->co, base); - - v1= v1->next; - oldloc= v1->co; - v1= v1->next; - VecSubf(speed, v1->co, oldloc); - - VecSubf(rc, oldloc, base); - - /* the axis */ - len2= Normalize(axis); - - Crossf(n, speed, axis); - len= Normalize(n); - if(len==0.0) return 0; - - dist= fabs( rc[0]*n[0] + rc[1]*n[1] + rc[2]*n[2] ); - - if( dist>=G.scene->editbutsize ) return 0; - - Crossf(o, rc, axis); - t= -(o[0]*n[0] + o[1]*n[1] + o[2]*n[2])/len; - - Crossf(o, n, axis); - s= fabs(sqrt(G.scene->editbutsize*G.scene->editbutsize-dist*dist) / (o[0]*speed[0] + o[1]*speed[1] + o[2]*speed[2])); - - labdacor= t-s; - labda= t+s; - - /* two cases with no intersection point */ - if(labdacor>=1.0 && labda>=1.0) return 0; - if(labdacor<=0.0 && labda<=0.0) return 0; - - /* calc normal */ - /* intersection: */ - - rc[0]= oldloc[0] + labdacor*speed[0] - base[0]; - rc[1]= oldloc[1] + labdacor*speed[1] - base[1]; - rc[2]= oldloc[2] + labdacor*speed[2] - base[2]; - - s= (rc[0]*axis[0] + rc[1]*axis[1] + rc[2]*axis[2]) ; - - if(s<0.0 || s>len2) return 0; - - n[0]= (rc[0] - s*axis[0]); - n[1]= (rc[1] - s*axis[1]); - n[2]= (rc[2] - s*axis[2]); - - printf("var1: %f, var2: %f, var3: %f\n", labdacor, len2, s); - printf("var1: %f, var2: %f, var3: %f\n", rc[0], rc[1], rc[2]); - printf("var1: %f, var2: %f, var3: %f\n", n[0], n[1], n[2]); - - return 1; -} - -int sphere_intersect_test(void) -{ - EditMesh *em = G.editMesh; - float *oldloc, speed[3], labda, labdacor, len, bsq, u, disc, *base, rc[3]; - EditVert *v1; - - v1= em->verts.first; - base= v1->co; - - v1= v1->next; - oldloc= v1->co; - - v1= v1->next; - VecSubf(speed, v1->co, oldloc); - len= Normalize(speed); - if(len==0.0) return 0; - - VecSubf(rc, oldloc, base); - bsq= rc[0]*speed[0] + rc[1]*speed[1] + rc[2]*speed[2]; - u= rc[0]*rc[0] + rc[1]*rc[1] + rc[2]*rc[2] - G.scene->editbutsize*G.scene->editbutsize; - - disc= bsq*bsq - u; - - if(disc>=0.0) { - disc= sqrt(disc); - labdacor= (-bsq - disc)/len; /* entry point */ - labda= (-bsq + disc)/len; - - printf("var1: %f, var2: %f, var3: %f\n", labdacor, labda, G.scene->editbutsize); - } - else return 0; - - /* intersection and normal */ - rc[0]= oldloc[0] + labdacor*speed[0] - base[0]; - rc[1]= oldloc[1] + labdacor*speed[1] - base[1]; - rc[2]= oldloc[2] + labdacor*speed[2] - base[2]; - - - return 1; -} - - -void std_rmouse_transform(void (*xf_func)(int, int)) -{ - short mval[2]; - short xo, yo; - short timer=0; - short mousebut; - - /* check for left mouse select/right mouse select */ - - if(curarea->spacetype==SPACE_NODE) - mousebut = L_MOUSE|R_MOUSE; - else if (U.flag & USER_LMOUSESELECT) - mousebut = L_MOUSE; - else - mousebut = R_MOUSE; - - getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; - - while(get_mbut() & mousebut) { - getmouseco_areawin(mval); - if(abs(mval[0]-xo)+abs(mval[1]-yo) > 10) { - if(curarea->spacetype==SPACE_VIEW3D) { -#ifdef TWEAK_MODE - initTransform(TFM_TRANSLATION, CTX_TWEAK); -#else - initTransform(TFM_TRANSLATION, CTX_NONE); -#endif - Transform(); - } - else if(curarea->spacetype==SPACE_IMAGE) { - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - } - else if(xf_func) - xf_func('g', 0); - - while(get_mbut() & mousebut) BIF_wait_for_statechange(); - return; - } - else { - PIL_sleep_ms(10); - timer++; - if(timer>=10*U.tb_rightmouse) { - if(curarea->spacetype==SPACE_VIEW3D) { - toolbox_n(); - return; - } - } - } - } - /* if gets here it's a select */ - BIF_undo_push("Select"); -} - -void rightmouse_transform(void) -{ - std_rmouse_transform(NULL); -} - - -/* ************************************** */ - - -static void single_object_users__forwardModifierLinks(void *userData, Object *ob, Object **obpoin) -{ - ID_NEW(*obpoin); -} -void single_object_users(int flag) -{ - Base *base; - Object *ob, *obn; - - clear_sca_new_poins(); /* sensor/contr/act */ - - /* duplicate */ - base= FIRSTBASE; - while(base) { - ob= base->object; - - if( (base->flag & flag)==flag) { - - if(ob->id.lib==NULL && ob->id.us>1) { - - obn= copy_object(ob); - ob->id.us--; - base->object= obn; - } - } - base= base->next; - } - - ID_NEW(G.scene->camera); - if(G.vd) ID_NEW(G.vd->camera); - - /* object pointers */ - base= FIRSTBASE; - while(base) { - ob= base->object; - if(ob->id.lib==NULL) { - if( (base->flag & flag)==flag) { - - relink_constraints(&base->object->constraints); - if (base->object->pose){ - bPoseChannel *chan; - for (chan = base->object->pose->chanbase.first; chan; chan=chan->next){ - relink_constraints(&chan->constraints); - } - } - modifiers_foreachObjectLink(base->object, single_object_users__forwardModifierLinks, NULL); - - ID_NEW(ob->parent); - ID_NEW(ob->track); - } - } - base= base->next; - } - - set_sca_new_poins(); -} - -void new_id_matar(Material **matar, int totcol) -{ - ID *id; - int a; - - for(a=0; alib==0) { - if(id->newid) { - matar[a]= (Material *)id->newid; - id_us_plus(id->newid); - id->us--; - } - else if(id->us>1) { - matar[a]= copy_material(matar[a]); - id->us--; - id->newid= (ID *)matar[a]; - } - } - } -} - -void single_obdata_users(int flag) -{ - Object *ob; - Lamp *la; - Curve *cu; - Camera *cam; - Base *base; - Mesh *me; - ID *id; - int a; - -#ifdef WITH_VERSE - base= FIRSTBASE; - while(base) { - ob= base->object; - if(ob->vnode) { - error("Can't make data single user, when data are shared at verse server"); - return; - } - base = base->next; - } -#endif - - base= FIRSTBASE; - while(base) { - ob= base->object; - if(ob->id.lib==NULL && (base->flag & flag)==flag ) { - id= ob->data; - - if(id && id->us>1 && id->lib==0) { - ob->recalc= OB_RECALC_DATA; - - switch(ob->type) { - case OB_LAMP: - if(id && id->us>1 && id->lib==NULL) { - ob->data= la= copy_lamp(ob->data); - for(a=0; amtex[a]) { - ID_NEW(la->mtex[a]->object); - } - } - } - break; - case OB_CAMERA: - ob->data= copy_camera(ob->data); - break; - case OB_MESH: - me= ob->data= copy_mesh(ob->data); - if(me && me->key) - ipo_idnew(me->key->ipo); /* drivers */ - break; - case OB_MBALL: - ob->data= copy_mball(ob->data); - break; - case OB_CURVE: - case OB_SURF: - case OB_FONT: - ob->data= cu= copy_curve(ob->data); - ID_NEW(cu->bevobj); - ID_NEW(cu->taperobj); - break; - case OB_LATTICE: - ob->data= copy_lattice(ob->data); - break; - case OB_ARMATURE: - ob->recalc |= OB_RECALC_DATA; - ob->data= copy_armature(ob->data); - armature_rebuild_pose(ob, ob->data); - break; - default: - printf("ERROR single_obdata_users: %s\n", id->name); - error("Read console"); - return; - } - - id->us--; - id->newid= ob->data; - - } - - id= (ID *)ob->action; - if (id && id->us>1 && id->lib==NULL){ - if(id->newid){ - ob->action= (bAction *)id->newid; - id_us_plus(id->newid); - } - else { - ob->action= copy_action(ob->action); - id->us--; - id->newid=(ID *)ob->action; - } - } - id= (ID *)ob->ipo; - if(id && id->us>1 && id->lib==NULL) { - if(id->newid) { - ob->ipo= (Ipo *)id->newid; - id_us_plus(id->newid); - } - else { - ob->ipo= copy_ipo(ob->ipo); - id->us--; - id->newid= (ID *)ob->ipo; - } - ipo_idnew(ob->ipo); /* drivers */ - } - /* other ipos */ - switch(ob->type) { - case OB_LAMP: - la= ob->data; - if(la->ipo && la->ipo->id.us>1) { - la->ipo->id.us--; - la->ipo= copy_ipo(la->ipo); - ipo_idnew(la->ipo); /* drivers */ - } - break; - case OB_CAMERA: - cam= ob->data; - if(cam->ipo && cam->ipo->id.us>1) { - cam->ipo->id.us--; - cam->ipo= copy_ipo(cam->ipo); - ipo_idnew(cam->ipo); /* drivers */ - } - break; - } - - } - base= base->next; - } - - me= G.main->mesh.first; - while(me) { - ID_NEW(me->texcomesh); - me= me->id.next; - } -} - - -void single_mat_users(int flag) -{ - Object *ob; - Base *base; - Material *ma, *man; - Tex *tex; - int a, b; - - - base= FIRSTBASE; - while(base) { - ob= base->object; - if(ob->id.lib==NULL && (flag==0 || (base->flag & SELECT)) ) { - - for(a=1; a<=ob->totcol; a++) { - ma= give_current_material(ob, a); - if(ma) { - /* do not test for LIB_NEW: this functions guaranteed delivers single_users! */ - - if(ma->id.us>1) { - man= copy_material(ma); - - man->id.us= 0; - assign_material(ob, man, a); - - if(ma->ipo) { - man->ipo= copy_ipo(ma->ipo); - ma->ipo->id.us--; - ipo_idnew(ma->ipo); /* drivers */ - } - - for(b=0; bmtex[b] && ma->mtex[b]->tex) { - tex= ma->mtex[b]->tex; - if(tex->id.us>1) { - ma->mtex[b]->tex= copy_texture(tex); - tex->id.us--; - } - } - } - - } - } - } - } - base= base->next; - } -} - -void do_single_tex_user(Tex **from) -{ - Tex *tex, *texn; - - tex= *from; - if(tex==0) return; - - if(tex->id.newid) { - *from= (Tex *)tex->id.newid; - id_us_plus(tex->id.newid); - tex->id.us--; - } - else if(tex->id.us>1) { - texn= copy_texture(tex); - tex->id.newid= (ID *)texn; - tex->id.us--; - *from= texn; - } - -} - -void single_tex_users_expand() -{ - /* only when 'parent' blocks are LIB_NEW */ - Material *ma; - Lamp *la; - World *wo; - int b; - - ma= G.main->mat.first; - while(ma) { - if(ma->id.flag & LIB_NEW) { - for(b=0; bmtex[b] && ma->mtex[b]->tex) { - do_single_tex_user( &(ma->mtex[b]->tex) ); - } - } - } - ma= ma->id.next; - } - - la= G.main->lamp.first; - while(la) { - if(la->id.flag & LIB_NEW) { - for(b=0; bmtex[b] && la->mtex[b]->tex) { - do_single_tex_user( &(la->mtex[b]->tex) ); - } - } - } - la= la->id.next; - } - wo= G.main->world.first; - while(wo) { - if(wo->id.flag & LIB_NEW) { - for(b=0; bmtex[b] && wo->mtex[b]->tex) { - do_single_tex_user( &(wo->mtex[b]->tex) ); - } - } - } - wo= wo->id.next; - } -} - -void single_mat_users_expand(void) -{ - /* only when 'parent' blocks are LIB_NEW */ - - Object *ob; - Mesh *me; - Curve *cu; - MetaBall *mb; - Material *ma; - int a; - - ob= G.main->object.first; - while(ob) { - if(ob->id.flag & LIB_NEW) { - new_id_matar(ob->mat, ob->totcol); - } - ob= ob->id.next; - } - - me= G.main->mesh.first; - while(me) { - if(me->id.flag & LIB_NEW) { - new_id_matar(me->mat, me->totcol); - } - me= me->id.next; - } - - cu= G.main->curve.first; - while(cu) { - if(cu->id.flag & LIB_NEW) { - new_id_matar(cu->mat, cu->totcol); - } - cu= cu->id.next; - } - - mb= G.main->mball.first; - while(mb) { - if(mb->id.flag & LIB_NEW) { - new_id_matar(mb->mat, mb->totcol); - } - mb= mb->id.next; - } - - /* material imats */ - ma= G.main->mat.first; - while(ma) { - if(ma->id.flag & LIB_NEW) { - for(a=0; amtex[a]) { - ID_NEW(ma->mtex[a]->object); - } - } - } - ma= ma->id.next; - } -} - -void single_user(void) -{ - int nr; - - if(G.scene->id.lib) return; - - clear_id_newpoins(); - - nr= pupmenu("Make Single User%t|Object|Object & ObData|Object & ObData & Materials+Tex|Materials+Tex"); - if(nr>0) { - - if(nr==1) single_object_users(1); - - else if(nr==2) { - single_object_users(1); - single_obdata_users(1); - } - else if(nr==3) { - single_object_users(1); - single_obdata_users(1); - single_mat_users(1); /* also tex */ - - } - else if(nr==4) { - single_mat_users(1); - } - - clear_id_newpoins(); - - countall(); - allqueue(REDRAWALL, 0); - BIF_undo_push("Single user"); - } -} - -/* ************************************************************* */ - -/* helper for below, ma was checked to be not NULL */ -static void make_local_makelocalmaterial(Material *ma) -{ - ID *id; - int b; - - make_local_material(ma); - - for(b=0; bmtex[b] && ma->mtex[b]->tex) { - make_local_texture(ma->mtex[b]->tex); - } - } - - id= (ID *)ma->ipo; - if(id && id->lib) make_local_ipo(ma->ipo); - - /* nodetree? XXX */ -} - -void make_local_menu(void) -{ - int mode; - - /* If you modify this menu, please remember to update view3d_edit_object_makelocalmenu - * in header_view3d.c and the menu in toolbox.c - */ - - if(G.scene->id.lib) return; - - mode = pupmenu("Make Local%t|Selected Objects %x1|Selected Objects and Data %x2|All %x3"); - - if (mode <= 0) return; - - make_local(mode); -} - -void make_local(int mode) -{ - Base *base; - Object *ob; - bActionStrip *strip; - Material *ma, ***matarar; - Lamp *la; - Curve *cu; - ID *id; - int a, b; - - /* WATCH: the function new_id(..) re-inserts the id block!!! */ - if(G.scene->id.lib) return; - - if(mode==3) { - all_local(NULL, 0); /* NULL is all libs */ - allqueue(REDRAWALL, 0); - return; - } - else if(mode<1) return; - - clear_id_newpoins(); - - base= FIRSTBASE; - while(base) { - ob= base->object; - if( (base->flag & SELECT)) { - if(ob->id.lib) { - make_local_object(ob); - } - } - base= base->next; - } - - /* maybe object pointers */ - base= FIRSTBASE; - while(base) { - ob= base->object; - if( (base->flag & SELECT)) { - if(ob->id.lib==NULL) { - ID_NEW(ob->parent); - ID_NEW(ob->track); - } - } - base= base->next; - } - - base= FIRSTBASE; - while(base) { - ob= base->object; - if( (base->flag & SELECT) ) { - - id= ob->data; - - if(id && mode>1) { - - switch(ob->type) { - case OB_LAMP: - make_local_lamp((Lamp *)id); - - la= ob->data; - id= (ID *)la->ipo; - if(id && id->lib) make_local_ipo(la->ipo); - - break; - case OB_CAMERA: - make_local_camera((Camera *)id); - break; - case OB_MESH: - make_local_mesh((Mesh *)id); - make_local_key( ((Mesh *)id)->key ); - break; - case OB_MBALL: - make_local_mball((MetaBall *)id); - break; - case OB_CURVE: - case OB_SURF: - case OB_FONT: - cu= (Curve *)id; - make_local_curve(cu); - id= (ID *)cu->ipo; - if(id && id->lib) make_local_ipo(cu->ipo); - make_local_key( cu->key ); - break; - case OB_LATTICE: - make_local_lattice((Lattice *)id); - make_local_key( ((Lattice *)id)->key ); - break; - case OB_ARMATURE: - make_local_armature ((bArmature *)id); - break; - } - } - id= (ID *)ob->ipo; - if(id && id->lib) make_local_ipo(ob->ipo); - - id= (ID *)ob->action; - if(id && id->lib) make_local_action(ob->action); - - for (strip=ob->nlastrips.first; strip; strip=strip->next) { - if(strip->act && strip->act->id.lib) - make_local_action(strip->act); - } - - } - base= base->next; - } - - if(mode>1) { - base= FIRSTBASE; - while(base) { - ob= base->object; - if(base->flag & SELECT ) { - - if(ob->type==OB_LAMP) { - la= ob->data; - for(b=0; bmtex[b] && la->mtex[b]->tex) { - make_local_texture(la->mtex[b]->tex); - } - } - } - else { - - for(a=0; atotcol; a++) { - ma= ob->mat[a]; - if(ma) - make_local_makelocalmaterial(ma); - } - - matarar= (Material ***)give_matarar(ob); - if (matarar) { - for(a=0; atotcol; a++) { - ma= (*matarar)[a]; - if(ma) - make_local_makelocalmaterial(ma); - } - } - } - } - base= base->next; - } - } - - allqueue(REDRAWALL, 0); - BIF_undo_push("Make local"); -} - -static void copy_object__forwardModifierLinks(void *userData, Object *ob, - ID **idpoin) -{ - /* this is copied from ID_NEW; it might be better to have a macro */ - if(*idpoin && (*idpoin)->newid) *idpoin = (*idpoin)->newid; -} - - -/* after copying objects, copied data should get new pointers */ -static void copy_object_set_idnew(int dupflag) -{ - Base *base; - Object *ob; - Material *ma, *mao; - ID *id; - Ipo *ipo; - bActionStrip *strip; - int a; - - /* check object pointers */ - for(base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { - ob= base->object; - relink_constraints(&ob->constraints); - if (ob->pose){ - bPoseChannel *chan; - for (chan = ob->pose->chanbase.first; chan; chan=chan->next){ - relink_constraints(&chan->constraints); - } - } - modifiers_foreachIDLink(ob, copy_object__forwardModifierLinks, NULL); - ID_NEW(ob->parent); - ID_NEW(ob->track); - ID_NEW(ob->proxy); - ID_NEW(ob->proxy_group); - - for(strip= ob->nlastrips.first; strip; strip= strip->next) { - bActionModifier *amod; - for(amod= strip->modifiers.first; amod; amod= amod->next) - ID_NEW(amod->ob); - } - } - } - - /* materials */ - if( dupflag & USER_DUP_MAT) { - mao= G.main->mat.first; - while(mao) { - if(mao->id.newid) { - - ma= (Material *)mao->id.newid; - - if(dupflag & USER_DUP_TEX) { - for(a=0; amtex[a]) { - id= (ID *)ma->mtex[a]->tex; - if(id) { - ID_NEW_US(ma->mtex[a]->tex) - else ma->mtex[a]->tex= copy_texture(ma->mtex[a]->tex); - id->us--; - } - } - } - } - id= (ID *)ma->ipo; - if(id) { - ID_NEW_US(ma->ipo) - else ma->ipo= copy_ipo(ma->ipo); - id->us--; - } - } - mao= mao->id.next; - } - } - - /* lamps */ - if( dupflag & USER_DUP_IPO) { - Lamp *la= G.main->lamp.first; - while(la) { - if(la->id.newid) { - Lamp *lan= (Lamp *)la->id.newid; - id= (ID *)lan->ipo; - if(id) { - ID_NEW_US(lan->ipo) - else lan->ipo= copy_ipo(lan->ipo); - id->us--; - } - } - la= la->id.next; - } - } - - /* ipos */ - ipo= G.main->ipo.first; - while(ipo) { - if(ipo->id.lib==NULL && ipo->id.newid) { - Ipo *ipon= (Ipo *)ipo->id.newid; - IpoCurve *icu; - for(icu= ipon->curve.first; icu; icu= icu->next) { - if(icu->driver) { - ID_NEW(icu->driver->ob); - } - } - } - ipo= ipo->id.next; - } - - set_sca_new_poins(); - - clear_id_newpoins(); - -} - -/* This function duplicated the current visible selection, its used by Duplicate and Linked Duplicate -Alt+D/Shift+D as well as Pythons Object.Duplicate(), it takes -mode: - 0: Duplicate with transform, Redraw. - 1: Duplicate, no transform, Redraw - 2: Duplicate, no transform, no redraw (Only used by python) -if true the user will not be dropped into grab mode directly after and.. -dupflag: a flag made from constants declared in DNA_userdef_types.h - The flag tells adduplicate() weather to copy data linked to the object, or to reference the existing data. - U.dupflag for default operations or you can construct a flag as python does - if the dupflag is 0 then no data will be copied (linked duplicate) */ - -void adduplicate(int mode, int dupflag) -{ - Base *base, *basen; - Material ***matarar; - Object *ob, *obn; - ID *id; - int a, didit; - - if(G.scene->id.lib) return; - clear_id_newpoins(); - clear_sca_new_poins(); /* sensor/contr/act */ - - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - - ob= base->object; - if(ob->flag & OB_POSEMODE) { - ; /* nothing? */ - } - else { - obn= copy_object(ob); - obn->recalc |= OB_RECALC; - - basen= MEM_mallocN(sizeof(Base), "duplibase"); - *basen= *base; - BLI_addhead(&G.scene->base, basen); /* addhead: prevent eternal loop */ - basen->object= obn; - base->flag &= ~SELECT; - - if(basen->flag & OB_FROMGROUP) { - Group *group; - for(group= G.main->group.first; group; group= group->id.next) { - if(object_in_group(ob, group)) - add_to_group(group, obn); - } - obn->flag |= OB_FROMGROUP; /* this flag is unset with copy_object() */ - } - - if(BASACT==base) BASACT= basen; - - /* duplicates using userflags */ - - if(dupflag & USER_DUP_IPO) { - bConstraintChannel *chan; - id= (ID *)obn->ipo; - - if(id) { - ID_NEW_US( obn->ipo) - else obn->ipo= copy_ipo(obn->ipo); - id->us--; - } - /* Handle constraint ipos */ - for (chan=obn->constraintChannels.first; chan; chan=chan->next){ - id= (ID *)chan->ipo; - if(id) { - ID_NEW_US( chan->ipo) - else chan->ipo= copy_ipo(chan->ipo); - id->us--; - } - } - } - if(dupflag & USER_DUP_ACT){ /* Not buttons in the UI to modify this, add later? */ - id= (ID *)obn->action; - if (id){ - ID_NEW_US(obn->action) - else{ - obn->action= copy_action(obn->action); - } - id->us--; - } - } - if(dupflag & USER_DUP_MAT) { - for(a=0; atotcol; a++) { - id= (ID *)obn->mat[a]; - if(id) { - ID_NEW_US(obn->mat[a]) - else obn->mat[a]= copy_material(obn->mat[a]); - id->us--; - } - } - } - - id= obn->data; - didit= 0; - - switch(obn->type) { - case OB_MESH: - if(dupflag & USER_DUP_MESH) { - ID_NEW_US2( obn->data ) - else { - obn->data= copy_mesh(obn->data); - - if(obn->fluidsimSettings) { - obn->fluidsimSettings->orgMesh = (Mesh *)obn->data; - } - - didit= 1; - } - id->us--; - } - break; - case OB_CURVE: - if(dupflag & USER_DUP_CURVE) { - ID_NEW_US2(obn->data ) - else { - obn->data= copy_curve(obn->data); - didit= 1; - } - id->us--; - } - break; - case OB_SURF: - if(dupflag & USER_DUP_SURF) { - ID_NEW_US2( obn->data ) - else { - obn->data= copy_curve(obn->data); - didit= 1; - } - id->us--; - } - break; - case OB_FONT: - if(dupflag & USER_DUP_FONT) { - ID_NEW_US2( obn->data ) - else { - obn->data= copy_curve(obn->data); - didit= 1; - } - id->us--; - } - break; - case OB_MBALL: - if(dupflag & USER_DUP_MBALL) { - ID_NEW_US2(obn->data ) - else { - obn->data= copy_mball(obn->data); - didit= 1; - } - id->us--; - } - break; - case OB_LAMP: - if(dupflag & USER_DUP_LAMP) { - ID_NEW_US2(obn->data ) - else obn->data= copy_lamp(obn->data); - id->us--; - } - break; - - case OB_ARMATURE: - obn->recalc |= OB_RECALC_DATA; - if(obn->pose) obn->pose->flag |= POSE_RECALC; - - if(dupflag & USER_DUP_ARM) { - ID_NEW_US2(obn->data ) - else { - obn->data= copy_armature(obn->data); - armature_rebuild_pose(obn, obn->data); - didit= 1; - } - id->us--; - } - - break; - - case OB_LATTICE: - if(dupflag!=0) { - ID_NEW_US2(obn->data ) - else obn->data= copy_lattice(obn->data); - id->us--; - } - break; - case OB_CAMERA: - if(dupflag!=0) { - ID_NEW_US2(obn->data ) - else obn->data= copy_camera(obn->data); - id->us--; - } - break; - } - - if(dupflag & USER_DUP_MAT) { - matarar= give_matarar(obn); - if(didit && matarar) { - for(a=0; atotcol; a++) { - id= (ID *)(*matarar)[a]; - if(id) { - ID_NEW_US( (*matarar)[a] ) - else (*matarar)[a]= copy_material((*matarar)[a]); - - id->us--; - } - } - } - } -#ifdef WITH_VERSE - /* send new created object to verse server, - * when original object was linked with object node */ - if(ob->vnode) { - b_verse_duplicate_object(((VNode*)ob->vnode)->session, ob, obn); - } -#endif - } - - } - base= base->next; - } - - copy_object_set_idnew(dupflag); - - DAG_scene_sort(G.scene); - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - - countall(); - if(mode==0) { - BIF_TransformSetUndo("Add Duplicate"); - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - } - set_active_base(BASACT); - if(mode!=2) { /* mode of 2 is used by python to avoid unrequested redraws */ - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); /* also oops */ - allqueue(REDRAWIPO, 0); /* also oops */ - } -} - -void make_duplilist_real() -{ - Base *base, *basen; - Object *ob; - /* extern ListBase duplilist; */ - - if(okee("Make dupli objects real")==0) return; - - clear_id_newpoins(); - - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - - if(base->object->transflag & OB_DUPLI) { - ListBase *lb= object_duplilist(G.scene, base->object); - DupliObject *dob; - - for(dob= lb->first; dob; dob= dob->next) { - ob= copy_object(dob->ob); - /* font duplis can have a totcol without material, we get them from parent - * should be implemented better... - */ - if(ob->mat==NULL) ob->totcol= 0; - - basen= MEM_dupallocN(base); - basen->flag &= ~OB_FROMDUPLI; - BLI_addhead(&G.scene->base, basen); /* addhead: othwise eternal loop */ - basen->object= ob; - ob->ipo= NULL; /* make sure apply works */ - ob->parent= ob->track= NULL; - ob->disp.first= ob->disp.last= NULL; - ob->transflag &= ~OB_DUPLI; - - Mat4CpyMat4(ob->obmat, dob->mat); - apply_obmat(ob); - } - - copy_object_set_idnew(0); - - free_object_duplilist(lb); - - base->object->transflag &= ~OB_DUPLI; - } - } - base= base->next; - } - - DAG_scene_sort(G.scene); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - - BIF_undo_push("Make duplicates real"); -} - -void selectlinks_menu(void) -{ - Object *ob; - int nr; - - ob= OBACT; - if(ob==0) return; - - /* If you modify this menu, please remember to update view3d_select_linksmenu - * in header_view3d.c and the menu in toolbox.c - */ - nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4|DupliGroup%x5"); - - if (nr <= 0) return; - - selectlinks(nr); -} - -void selectlinks(int nr) -{ - Object *ob; - Base *base; - void *obdata = NULL; - Ipo *ipo = NULL; - Material *mat = NULL, *mat1; - Tex *tex=0; - int a, b; - short changed = 0; - /* events (nr): - * Object Ipo: 1 - * ObData: 2 - * Current Material: 3 - * Current Texture: 4 - * DupliGroup: 5 - */ - - - ob= OBACT; - if(ob==0) return; - - if(nr==1) { - ipo= ob->ipo; - if(ipo==0) return; - } - else if(nr==2) { - if(ob->data==0) return; - obdata= ob->data; - } - else if(nr==3 || nr==4) { - mat= give_current_material(ob, ob->actcol); - if(mat==0) return; - if(nr==4) { - if(mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex; - if(tex==0) return; - } - } - else if(nr==5) { - if(ob->dup_group==NULL) return; - } - else return; - - base= FIRSTBASE; - while(base) { - if (BASE_SELECTABLE(base) && !(base->flag & SELECT)) { - if(nr==1) { - if(base->object->ipo==ipo) base->flag |= SELECT; - changed = 1; - } - else if(nr==2) { - if(base->object->data==obdata) base->flag |= SELECT; - changed = 1; - } - else if(nr==3 || nr==4) { - ob= base->object; - - for(a=1; a<=ob->totcol; a++) { - mat1= give_current_material(ob, a); - if(nr==3) { - if(mat1==mat) base->flag |= SELECT; - changed = 1; - } - else if(mat1 && nr==4) { - for(b=0; bmtex[b]) { - if(tex==mat1->mtex[b]->tex) { - base->flag |= SELECT; - changed = 1; - } - } - } - } - } - } - else if(nr==5) { - if(base->object->dup_group==ob->dup_group) { - base->flag |= SELECT; - changed = 1; - } - } - base->object->flag= base->flag; - } - base= base->next; - } - - if (changed) { - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Select linked"); - } -} - -void image_aspect(void) -{ - /* all selected objects with an image map: scale in image aspect */ - Base *base; - Object *ob; - Material *ma; - Tex *tex; - float x, y, space; - int a, b, done; - - if(G.obedit) return; - if(G.scene->id.lib) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - ob= base->object; - done= 0; - - for(a=1; a<=ob->totcol; a++) { - ma= give_current_material(ob, a); - if(ma) { - for(b=0; bmtex[b] && ma->mtex[b]->tex) { - tex= ma->mtex[b]->tex; - if(tex->type==TEX_IMAGE && tex->ima) { - ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, NULL); - - /* texturespace */ - space= 1.0; - if(ob->type==OB_MESH) { - float size[3]; - mesh_get_texspace(ob->data, NULL, NULL, size); - space= size[0]/size[1]; - } - else if ELEM3(ob->type, OB_CURVE, OB_FONT, OB_SURF) { - Curve *cu= ob->data; - space= cu->size[0]/cu->size[1]; - } - - x= ibuf->x/space; - y= ibuf->y; - - if(x>y) ob->size[0]= ob->size[1]*x/y; - else ob->size[1]= ob->size[0]*y/x; - - done= 1; - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - } - if(done) break; - } - } - if(done) break; - } - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Image aspect"); -} - -void set_ob_ipoflags(void) -{ - Base *base; - int set= 1; - - if (!G.vd) { - error("Can't do this! Open a 3D window"); - return; - } - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base->object->ipoflag & OB_DRAWKEY) { - set= 0; - break; - } - } - base= base->next; - } - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(set) { - base->object->ipoflag |= OB_DRAWKEY; - if(base->object->ipo) base->object->ipo->showkey= 1; - } - else { - base->object->ipoflag &= ~OB_DRAWKEY; - if(base->object->ipo) base->object->ipo->showkey= 0; - } - } - base= base->next; - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); -} - -void select_select_keys(void) -{ - Base *base; - IpoCurve *icu; - BezTriple *bezt; - int a; - - if (!G.vd) { - error("Can't do this! Open a 3D window"); - return; - } - - if(G.scene->id.lib) return; - - if(okee("Show and select all keys")==0) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base->object->ipo) { - base->object->ipoflag |= OB_DRAWKEY; - base->object->ipo->showkey= 1; - icu= base->object->ipo->curve.first; - while(icu) { - a= icu->totvert; - bezt= icu->bezt; - while(a--) { - bezt->f1 |= SELECT; - bezt->f2 |= SELECT; - bezt->f3 |= SELECT; - bezt++; - } - icu= icu->next; - } - } - } - base= base->next; - } - - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWVIEW3D, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - - BIF_undo_push("Select keys"); - -} - - -int vergbaseco(const void *a1, const void *a2) -{ - Base **x1, **x2; - - x1= (Base **) a1; - x2= (Base **) a2; - - if( (*x1)->sy > (*x2)->sy ) return 1; - else if( (*x1)->sy < (*x2)->sy) return -1; - else if( (*x1)->sx > (*x2)->sx ) return 1; - else if( (*x1)->sx < (*x2)->sx ) return -1; - - return 0; -} - - -void auto_timeoffs(void) -{ - Base *base, **basesort, **bs; - float start, delta; - int tot=0, a; - short offset=25; - - if(BASACT==0 || G.vd==NULL) return; - if(button(&offset, 0, 1000,"Total time")==0) return; - - /* make array of all bases, xco yco (screen) */ - base= FIRSTBASE; - while(base) { - if(TESTBASELIB(base)) { - tot++; - } - base= base->next; - } - - delta= (float)offset/(float)tot; - start= OBACT->sf; - - bs= basesort= MEM_mallocN(sizeof(void *)*tot,"autotimeoffs"); - base= FIRSTBASE; - - while(base) { - if(TESTBASELIB(base)) { - *bs= base; - bs++; - } - base= base->next; - } - qsort(basesort, tot, sizeof(void *), vergbaseco); - - bs= basesort; - for(a=0; aobject->sf= start; - start+= delta; - - bs++; - } - MEM_freeN(basesort); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); -} - -void texspace_edit(void) -{ - Base *base; - int nr=0; - - /* first test if from visible and selected objects - * texspacedraw is set: - */ - - if(G.obedit) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - break; - } - base= base->next; - } - - if(base==0) { - return; - } - - nr= pupmenu("Texture Space %t|Grab/Move%x1|Size%x2"); - if(nr<1) return; - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - base->object->dtx |= OB_TEXSPACE; - } - base= base->next; - } - - - if(nr==1) { - initTransform(TFM_TRANSLATION, CTX_TEXTURE); - Transform(); - } - else if(nr==2) { - initTransform(TFM_RESIZE, CTX_TEXTURE); - Transform(); - } - else if(nr==3) { - initTransform(TFM_ROTATION, CTX_TEXTURE); - Transform(); - } -} - -/* ******************************************************************** */ -/* Mirror function in Edit Mode */ - -void mirrormenu(void) -{ - short mode = 0; - - - if(G.f & G_PARTICLEEDIT) { - PE_mirror_x(0); - } - else if (G.obedit==0) { - mode=pupmenu("Mirror Axis %t|X Local%x4|Y Local%x5|Z Local%x6|"); - - if (mode==-1) return; /* return */ - Mirror(mode); /* separating functionality from interface | call*/ - } - else { - mode=pupmenu("Mirror Axis %t|X Global%x1|Y Global%x2|Z Global%x3|%l|X Local%x4|Y Local%x5|Z Local%x6|%l|X View%x7|Y View%x8|Z View%x9|"); - - if (mode==-1) return; /* return */ - Mirror(mode); /* separating functionality from interface | call*/ - } -} - -void hookmenu(void) -{ - /* only called in object mode */ - short event, changed=0; - Object *ob; - Base *base; - ModifierData *md; - HookModifierData *hmd; - - event= pupmenu("Modify Hooks for Selected...%t|Reset Offset%x1|Recenter at Cursor%x2"); - if (event==-1) return; - if (event==2 && !(G.vd)) { - error("Cannot perform this operation without a 3d view"); - return; - } - - for (base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { - for (md = base->object->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - ob = base->object; - hmd = (HookModifierData*) md; - - /* - * Copied from modifiers_cursorHookCenter and - * modifiers_clearHookOffset, should consolidate - * */ - - if (event==1) { - if(hmd->object) { - Mat4Invert(hmd->object->imat, hmd->object->obmat); - Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); - - changed= 1; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } else { - float *curs = give_cursor(); - float bmat[3][3], imat[3][3]; - - where_is_object(ob); - - Mat3CpyMat4(bmat, ob->obmat); - Mat3Inv(imat, bmat); - - curs= give_cursor(); - hmd->cent[0]= curs[0]-ob->obmat[3][0]; - hmd->cent[1]= curs[1]-ob->obmat[3][1]; - hmd->cent[2]= curs[2]-ob->obmat[3][2]; - Mat3MulVecfl(imat, hmd->cent); - - changed= 1; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - } - } - - if (changed) { - if (event==1) - BIF_undo_push("Clear hook offset for selected"); - else if (event==2) - BIF_undo_push("Hook cursor center for selected"); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } -} - -/* - * Returns true if the Object is a from an external blend file (libdata) - */ -int object_is_libdata(Object *ob) -{ - if (!ob) return 0; - if (ob->proxy) return 0; - if (ob->id.lib) return 1; - return 0; -} - - -/* - * Returns true if the Object data is a from an external blend file (libdata) - */ -int object_data_is_libdata(Object *ob) -{ - if (!ob) return 0; - if (ob->proxy) return 0; - if (ob->id.lib) return 1; - if (!ob->data) return 0; - if (((ID *)ob->data)->lib) return 1; - return 0; -} - -void hide_objects(int select) -{ - Base *base; - short changed = 0, changed_act = 0; - for(base = FIRSTBASE; base; base=base->next){ - if(TESTBASELIB(base)==select){ - base->flag &= ~SELECT; - base->object->flag = base->flag; - base->object->restrictflag |= OB_RESTRICT_VIEW; - changed = 1; - if (base==BASACT) { - BASACT= NULL; - changed_act = 1; - } - } - } - if (changed) { - if(select) BIF_undo_push("Hide Selected Objects"); - else if(select) BIF_undo_push("Hide Unselected Objects"); - DAG_scene_sort(G.scene); - allqueue(REDRAWVIEW3D,0); - allqueue(REDRAWOOPS,0); - allqueue(REDRAWDATASELECT,0); - if (changed_act) { /* these spaces depend on the active object */ - allqueue(REDRAWBUTSALL,0); - allqueue(REDRAWIPO,0); - allqueue(REDRAWACTION,0); - } - countall(); - } -} - -void show_objects(void) -{ - Base *base; - int changed = 0; - for(base = FIRSTBASE; base; base=base->next){ - if((base->lay & G.vd->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) { - base->flag |= SELECT; - base->object->flag = base->flag; - base->object->restrictflag &= ~OB_RESTRICT_VIEW; - changed = 1; - } - } - if (changed) { - BIF_undo_push("Unhide Objects"); - DAG_scene_sort(G.scene); - allqueue(REDRAWVIEW3D,0); - allqueue(REDRAWOOPS,0); - countall(); - } -} diff --git a/source/blender/src/editoops.c b/source/blender/src/editoops.c deleted file mode 100644 index cb654646d0f..00000000000 --- a/source/blender/src/editoops.c +++ /dev/null @@ -1,675 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_material_types.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" - -#include "BKE_global.h" -#include "BKE_scene.h" -#include "BKE_library.h" -#include "BKE_material.h" -#include "BKE_utildefines.h" - -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_editoops.h" -#include "BIF_editview.h" -#include "BIF_drawscene.h" -#include "BIF_mywindow.h" -#include "BIF_toolbox.h" -#include "BIF_interface.h" - -#include "BDR_editobject.h" - -#include "BSE_edit.h" -#include "BSE_drawipo.h" - -#include "blendef.h" -#include "mydevice.h" - - -typedef struct TransOops { - float *loc; - float oldloc[2]; -} TransOops; - -struct ID *idt; - - -static void oops_to_select_objects(void) -{ - Oops *oops; - Base *base; - Object *ob; - - if(G.soops==0) return; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->type==ID_OB) { - ob= (Object *)oops->id; - if ((ob->restrictflag & OB_RESTRICT_VIEW)==0) { - if(oops->flag & SELECT) ob->flag |= SELECT; - else ob->flag &= ~SELECT; - } - } - } - oops= oops->next; - } - base= FIRSTBASE; - while(base) { - if(base->flag != base->object->flag) { - base->flag= base->object->flag; - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); -} - -void swap_select_all_oops(void) -{ - Oops *oops; - int sel= 0; - - if(G.soops==0) return; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & SELECT) { - sel= 1; - break; - } - } - oops= oops->next; - } - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(sel) oops->flag &= ~SELECT; - else oops->flag |= SELECT; - } - oops= oops->next; - } - - oops_to_select_objects(); /* also redraw */ - - G.soops->lockpoin= NULL; -} - -/* never used... check CVS 1.12 for the code */ -/* static void select_swap_oops(void) */ - -static void deselect_all_oops(void) -{ - Oops *oops; - - if(G.soops==0) return; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - oops->flag &= ~SELECT; - } - oops= oops->next; - } - G.soops->lockpoin= NULL; -} - -void set_select_flag_oops(void) /* all areas */ -{ - SpaceOops *so; - ScrArea *sa; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_OOPS) { - so= sa->spacedata.first; - so->flag |= SO_NEWSELECTED; - } - sa= sa->next; - } - if(G.soops) G.soops->lockpoin= NULL; -} - -void deselect_all_area_oops(void) /* all areas */ -{ - SpaceOops *so; - Oops *oops; - ScrArea *sa; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_OOPS) { - so= sa->spacedata.first; - - oops= so->oops.first; - while(oops) { - oops->flag &= ~SELECT; - oops= oops->next; - } - } - sa= sa->next; - } - - if(G.soops) G.soops->lockpoin= NULL; -} - -void transform_oops(int mode, int context) -{ - TransOops *transmain, *tv; - Oops *oops; - float dx, dy, div, dvec[3], cent[3], min[3], max[3]; - float sizefac, size[2], xref=1.0, yref=1.0; - int a, tot= 0, midtog= 0; - unsigned short event = 0; - short firsttime= 1, proj = 0, afbreek=0, xc, yc, xo, yo, xn, yn, mval[2]; - short val; - char str[32]; - - if(G.soops==0) return; - - /* which oopses... */ - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & SELECT) { - tot++; - } - } - oops= oops->next; - } - - if(tot==0) return; - - G.moving= 1; - - INIT_MINMAX(min, max); - - tv=transmain= MEM_callocN(tot*sizeof(TransOops), "transmain"); - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & SELECT) { - tv->loc= &oops->x; - tv->oldloc[0]= tv->loc[0]; - tv->oldloc[1]= tv->loc[1]; - DO_MINMAX2(tv->loc, min, max); - tv++; - } - } - oops= oops->next; - } - - cent[0]= (min[0]+max[0])/2.0; - cent[1]= (min[1]+max[1])/2.0; - - ipoco_to_areaco_noclip(G.v2d, cent, mval); - xc= mval[0]; - yc= mval[1]; - - getmouseco_areawin(mval); - xo= xn= mval[0]; - yo= yn= mval[1]; - dvec[0]= dvec[1]= 0.0; - - sizefac= sqrt( (float)((yc-yn)*(yc-yn)+(xn-xc)*(xn-xc)) ); - if(sizefac<2.0) sizefac= 2.0; - - while(afbreek==0) { - getmouseco_areawin(mval); - if(mval[0]!=xo || mval[1]!=yo || firsttime) { - - if(mode=='g') { - - dx= mval[0]- xo; - dy= mval[1]- yo; - - div= G.v2d->mask.xmax-G.v2d->mask.xmin; - dvec[0]+= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/div; - - div= G.v2d->mask.ymax-G.v2d->mask.ymin; - dvec[1]+= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div; - - if(midtog) dvec[proj]= 0.0; - - tv= transmain; - for(a=0; aloc[0]= tv->oldloc[0]+dvec[0]; - tv->loc[1]= tv->oldloc[1]+dvec[1]; - - } - - sprintf(str, "X: %.2f Y: %.2f ", dvec[0], dvec[1]); - headerprint(str); - } - else if(mode=='s') { - size[0]=size[1]= (sqrt( (float)((yc-mval[1])*(yc-mval[1])+(mval[0]-xc)*(mval[0]-xc)) ))/sizefac; - - if(midtog) size[proj]= 1.0; - size[0]*= xref; - size[1]*= yref; - - tv= transmain; - for(a=0; aloc[0]= size[0]*(tv->oldloc[0]-cent[0])+ cent[0]; - tv->loc[1]= size[1]*(tv->oldloc[1]-cent[1])+ cent[1]; - - } - - sprintf(str, "sizeX: %.3f sizeY: %.3f ", size[0], size[1]); - headerprint(str); - } - - - xo= mval[0]; - yo= mval[1]; - - force_draw(0); - - firsttime= 0; - - } - else BIF_wait_for_statechange(); - - while(qtest()) { - event= extern_qread(&val); - if(val) { - switch(event) { - case ESCKEY: - case RIGHTMOUSE: - case LEFTMOUSE: - case SPACEKEY: - case RETKEY: - afbreek= 1; - break; - case MIDDLEMOUSE: - - midtog= ~midtog; - if(midtog) { - if( abs(mval[0]-xn) > abs(mval[1]-yn)) proj= 1; - else proj= 0; - firsttime= 1; - } - - break; - default: - arrows_move_cursor(event); - } - } - if(afbreek) break; - } - } - - if(event==ESCKEY || event==RIGHTMOUSE) { - tv= transmain; - for(a=0; aloc[0]= tv->oldloc[0]; - tv->loc[1]= tv->oldloc[1]; - } - } - MEM_freeN(transmain); - - G.moving= 0; - - scrarea_queue_redraw(curarea); -} - -static Oops *find_nearest_oops(void) -{ - Oops *oops; - float x, y; - short mval[2]; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide == 0) { - if(oops->x <=x && oops->x+OOPSX >= x) { - if(oops->y <=y && oops->y+OOPSY >= y) { - return oops; - } - } - } - oops= oops->next; - } - return 0; -} - -static void do_activate_oops(Oops *oops) -{ - Base *base; - Object *ob; - - switch(oops->type) { - case ID_SCE: - if(oops->id) set_scene((Scene *)oops->id); - break; - case ID_OB: - base= FIRSTBASE; - while(base) { - if(base->object == (Object *)oops->id) break; - base= base->next; - } - if(base) { - if(G.obedit==NULL) set_active_base(base); /* editview.c */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWINFO, 1); - } - break; - case ID_MA: - ob= OBACT; - if(ob && oops->id) { - assign_material(ob, (Material *)oops->id, ob->actcol); - allqueue(REDRAWBUTSSHADING, 0); - scrarea_queue_winredraw(curarea); - } - break; - - case ID_IM: - if(oops->id && G.sima) { - /* only set if the new image isnt alredy active */ - if ((ID *)G.sima->image != oops->id) { - G.sima->image = (Image *)oops->id; - allqueue(REDRAWIMAGE, 0); - scrarea_queue_winredraw(curarea); - } - } - break; - /* - case ID_IP: - if(oops->id && G.sipo) { - *//* only set if the new ipo isnt alredy active *//* - if ((ID *)G.sipo->ipo != oops->id) { - G.sipo->ipo = (Ipo *)oops->id; - allqueue(REDRAWIPO, 0); - scrarea_queue_winredraw(curarea); - } - } - break; - */ - } -} - -void mouse_select_oops(void) -{ - Oops *oops; - extern float oopslastx, oopslasty; /* oops.c */ - - if(G.soops==0) return; - - /* which oopses... */ - oops= G.soops->oops.first; - - oops= find_nearest_oops(); - if(oops==0) return; - - if((G.qual & LR_SHIFTKEY)==0) deselect_all_oops(); - - if(oops) { - /* last_seq= seq; */ - - if(G.qual==0) { - oops->flag |= SELECT; - } - else { - if(oops->flag & SELECT) { - oops->flag &= ~SELECT; - } - else { - oops->flag |= SELECT; - } - } - - oopslastx= oops->x; - oopslasty= oops->y; - - if(G.qual & LR_CTRLKEY) do_activate_oops(oops); - G.soops->lockpoin= oops; - } - - oops_to_select_objects(); /* also redraw */ - scrarea_queue_headredraw(curarea); - - force_draw(1); - - std_rmouse_transform(transform_oops); -} - -void borderselect_oops(void) -{ - Oops *oops; - rcti rect; - rctf rectf, rq; - int val; - short mval[2]; - - if(G.soops==0) return; - - val= get_border(&rect, 3); - - if(val) { - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide == 0) { - - rq.xmin= oops->x; - rq.xmax= oops->x+OOPSX; - rq.ymin= oops->y; - rq.ymax= oops->y+OOPSY; - - if(BLI_isect_rctf(&rq, &rectf, 0)) { - if(val==LEFTMOUSE) { - oops->flag |= SELECT; - } - else { - oops->flag &= ~SELECT; - } - } - } - oops= oops->next; - } - - oops_to_select_objects(); /* also redraw */ - } -} - -static void select_oops_lib(ID *id) -{ - Oops *oops; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->id->lib== (Library *)id) oops->flag |= OOPS_DOSELECT; - } - oops= oops->next; - } -} - -void select_linked_oops(void) -{ - Oops *oops; - OopsLink *ol; - - if(G.soops==0) return; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & SELECT) { - if(oops->type==ID_LI) select_oops_lib(oops->id); - ol= oops->link.first; - while(ol) { - if(ol->to && ol->to->hide==0) ol->to->flag |= OOPS_DOSELECT; - ol= ol->next; - } - } - } - oops= oops->next; - } - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & OOPS_DOSELECT) { - oops->flag |= SELECT; - oops->flag &= ~OOPS_DOSELECT; - } - } - oops= oops->next; - } - - oops_to_select_objects(); /* also redraw */ - -} - -void select_backlinked_oops(void) -{ - Oops *oops; - OopsLink *ol; - - if(G.soops==0) return; - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if( (oops->flag & SELECT)==0) { - ol= oops->link.first; - while(ol) { - if(ol->to && ol->to->hide==0) { - if(ol->to->flag & SELECT) oops->flag |= OOPS_DOSELECT; - } - ol= ol->next; - } - } - } - oops= oops->next; - } - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - if(oops->flag & OOPS_DOSELECT) { - oops->flag |= SELECT; - oops->flag &= ~OOPS_DOSELECT; - } - } - oops= oops->next; - } - - oops_to_select_objects(); /* also redraw */ - -} - - -void clever_numbuts_oops() -{ - Oops *oops; - Object *ob; - char str1[10]; - static char naam[256]; - static char naam2[256]; - static short doit; - int len; - - if(G.soops->lockpoin) { - oops= G.soops->lockpoin; - ob = (Object *)oops->id; - if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name); - else strcpy(naam, oops->id->name); - - strcpy(naam2, naam+2); - str1[0]= oops->id->name[0]; - str1[1]= oops->id->name[1]; - str1[2]= ':'; - str1[3]= 0; - if(strcmp(str1, "SC:")==0) strcpy(str1, "SCE:"); - else if(strcmp(str1, "SR:")==0) strcpy(str1, "SCR:"); - -// if( GS(id->name)==ID_IP) len= 110; -// else len= 120; - len = 110; - - add_numbut(0, TEX, str1, 0, len, naam2, "Rename Object"); - if((oops->type==ID_OB || oops->type==ID_ME) && ob->type != OB_EMPTY) { - // add_numbut(1, TEX, str1, 0, len, naam2, "Name Object"); - add_numbut(1, TOG|SHO, "Rename Linked Data", 0, 0, &doit, "Rename corresponding Datablock as well"); - do_clever_numbuts("Rename Datablock", 2, REDRAW); - } else { - do_clever_numbuts("Rename Datablock", 1, REDRAW); - } - - rename_id((ID *)oops->id, naam2); - } -} diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c deleted file mode 100644 index f07012c463d..00000000000 --- a/source/blender/src/editparticle.c +++ /dev/null @@ -1,3141 +0,0 @@ -/* editparticle.c - * - * - * $Id: editparticle.c $ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2007 by Janne Karhu. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_scene_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_force.h" -#include "DNA_object_types.h" -#include "DNA_vec_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_bad_level_calls.h" -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" - -#include "BKE_global.h" -#include "BKE_object.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_particle.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" - -#include "BSE_edit.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" -#include "BLI_kdtree.h" -#include "BLI_rand.h" - -#include "PIL_time.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_editparticle.h" -#include "BIF_editview.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_view.h" - -#include "BDR_editobject.h" //rightmouse_transform() -#include "BDR_drawobject.h" - -#include "blendef.h" -#include "mydevice.h" - -static void ParticleUndo_clear(ParticleSystem *psys); - -#define LOOP_PARTICLES(i,pa) for(i=0, pa=psys->particles; iedit)for(k=0, key=psys->edit->keys[i]; ktotkey; k++, key++) - -void PE_free_particle_edit(ParticleSystem *psys) -{ - ParticleEdit *edit=psys->edit; - int i, totpart=psys->totpart; - - if(edit==0) return; - - ParticleUndo_clear(psys); - - if(edit->keys){ - for(i=0; ikeys[i]) - MEM_freeN(edit->keys[i]); - } - MEM_freeN(edit->keys); - } - - if(edit->mirror_cache) - MEM_freeN(edit->mirror_cache); - - if(edit->emitter_cosnos){ - MEM_freeN(edit->emitter_cosnos); - edit->emitter_cosnos=0; - } - - if(edit->emitter_field){ - BLI_kdtree_free(edit->emitter_field); - edit->emitter_field=0; - } - - MEM_freeN(edit); - - psys->edit=NULL; -} -/************************************************/ -/* Edit Mode Helpers */ -/************************************************/ -int PE_can_edit(ParticleSystem *psys) -{ - return (psys && psys->edit && (G.f & G_PARTICLEEDIT)); -} - -ParticleEditSettings *PE_settings() -{ - return &G.scene->toolsettings->particle; -} - -void PE_change_act(void *ob_v, void *act_v) -{ - Object *ob = ob_v; - ParticleSystem *psys; - short act = *((short*)act_v) - 1; - - if((psys=psys_get_current(ob))) - psys->flag &= ~PSYS_CURRENT; - - if(act>=0){ - if((psys=BLI_findlink(&ob->particlesystem,act))) { - psys->flag |= PSYS_CURRENT; - - if(psys_check_enabled(ob, psys)) { - if(G.f & G_PARTICLEEDIT && !psys->edit) - PE_create_particle_edit(ob, psys); - PE_recalc_world_cos(ob, psys); - } - } - } -} - -/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */ -ParticleSystem *PE_get_current(Object *ob) -{ - ParticleSystem *psys; - - if(ob==NULL) - return NULL; - - psys= ob->particlesystem.first; - while(psys){ - if(psys->flag & PSYS_CURRENT) - break; - psys=psys->next; - } - - if(psys==NULL && ob->particlesystem.first){ - psys=ob->particlesystem.first; - psys->flag |= PSYS_CURRENT; - } - - if(psys && psys_check_enabled(ob, psys) && ob == OBACT && (G.f & G_PARTICLEEDIT)) - if(psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) - if(psys->edit == NULL) - PE_create_particle_edit(ob, psys); - - return psys; -} -/* returns -1 if no system has PSYS_CURRENT flag */ -short PE_get_current_num(Object *ob) -{ - short num=0; - ParticleSystem *psys = ob->particlesystem.first; - - while(psys){ - if(psys->flag & PSYS_CURRENT) - return num; - num++; - psys=psys->next; - } - - return -1; -} - -void PE_hide_keys_time(ParticleSystem *psys, float cfra) -{ - ParticleData *pa; - ParticleEditKey *key; - ParticleEditSettings *pset=PE_settings(); - int i,k,totpart=psys->totpart; - - if(pset->draw_timed && G.scene->selectmode==SCE_SELECT_POINT){ - LOOP_PARTICLES(i,pa){ - LOOP_KEYS(k,key){ - if(fabs(cfra-*key->time) < pset->draw_timed) - key->flag &= ~PEK_HIDE; - else{ - key->flag |= PEK_HIDE; - key->flag &= ~PEK_SELECT; - } - } - } - } - else{ - LOOP_PARTICLES(i,pa){ - LOOP_KEYS(k,key){ - key->flag &= ~PEK_HIDE; - } - } - } -} - -static int key_inside_circle(short mco[2], float rad, float co[3], float *distance) -{ - float dx,dy,dist; - short vertco[2]; - - project_short(co,vertco); - dx=(float)(mco[0]-vertco[0]); - dy=(float)(mco[1]-vertco[1]); - dist=(float)sqrt((double)(dx*dx + dy*dy)); - - if(dist<=rad){ - if(distance) *distance=dist; - return 1; - } - else - return 0; -} -static int key_inside_rect(rcti *rect, float co[3]) -{ - short vertco[2]; - - project_short(co,vertco); - - if(vertco[0] > rect->xmin && vertco[0] < rect->xmax && - vertco[1] > rect->ymin && vertco[1] < rect->ymax) - return 1; - else - return 0; -} -static int test_key_depth(float *co, bglMats *mats){ - double ux, uy, uz; - float depth; - short wco[3], x,y; - - if((G.vd->flag & V3D_ZBUF_SELECT)==0) return 1; - - gluProject(co[0],co[1],co[2], mats->modelview, mats->projection, - (GLint *)mats->viewport, &ux, &uy, &uz ); - - project_short(co,wco); - - x=wco[0]; - y=wco[1]; - - if(G.vd->depths && xdepths->w && ydepths->h){ - if((float)uz>G.vd->depths->depths[y*G.vd->depths->w+x]) - return 0; - else - return 1; - } - else{ - x+= (short)curarea->winrct.xmin; - y+= (short)curarea->winrct.ymin; - - glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth); - - if((float)uz>depth) - return 0; - else - return 1; - } -} - -static int particle_is_selected(ParticleSystem *psys, ParticleData *pa) -{ - ParticleEditKey *key; - int sel, i, k; - - if(pa->flag&PARS_HIDE) return 0; - - sel=0; - i= pa - psys->particles; - LOOP_KEYS(k,key) - if(key->flag&PEK_SELECT) - return 1; - - return 0; -} - -/*-----iterators over editable particles-----*/ -static void for_mouse_hit_keys(int nearest, ParticleSystem *psys, void (*func)(ParticleSystem *psys, int pa_index, int key_index, void *userData), void *userData){ - /* these are allways the first in this userData */ - struct { short *mval; float rad; rcti *rect;} *data = userData; - ParticleData *pa; - ParticleEditKey *key; - bglMats mats; - int i,k, totpart, nearest_pa=-1, nearest_key=-1; - float dist=data->rad; - - if(psys==0 || G.scene->selectmode==SCE_SELECT_PATH) return; - - totpart=psys->totpart; - - bgl_get_mats(&mats); - - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - - if(G.scene->selectmode==SCE_SELECT_END){ - key=psys->edit->keys[i]+pa->totkey-1; - - if(nearest){ - if(key_inside_circle(data->mval,dist,key->world_co,&dist) && test_key_depth(key->world_co,&mats)){ - nearest_pa=i; - nearest_key=pa->totkey-1; - } - } - else if(((data->mval)? - key_inside_circle(data->mval,data->rad,key->world_co,0): - key_inside_rect(data->rect,key->world_co)) && test_key_depth(key->world_co,&mats)) - func(psys,i,pa->totkey-1,userData); - } - else{ - key=psys->edit->keys[i]; - - LOOP_KEYS(k,key){ - if(key->flag&PEK_HIDE) continue; - - if(nearest){ - if(key_inside_circle(data->mval,dist,key->world_co,&dist) && test_key_depth(key->world_co,&mats)){ - nearest_pa=i; - nearest_key=k; - } - } - else if(((data->mval)? - key_inside_circle(data->mval,data->rad,key->world_co,0): - key_inside_rect(data->rect,key->world_co)) && test_key_depth(key->world_co,&mats)) - func(psys,i,k,userData); - } - } - } - if(nearest && nearest_pa>-1){ - func(psys,nearest_pa,nearest_key,userData); - } -} -static void foreach_mouse_hit_element(int selected, ParticleSystem *psys,void (*func)(ParticleSystem *psys, int index, void *userData), void *userData){ - /* these are allways the first in this userData */ - struct { short *mval; float rad; rcti* rect; float dist;} *data = userData; - ParticleData *pa; - ParticleEditKey *key; - bglMats mats; - int i,k, totpart; - - if(psys==0) return; - - totpart=psys->totpart; - - bgl_get_mats(&mats); - - if(G.scene->selectmode==SCE_SELECT_PATH) - selected=0; - - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - - if(G.scene->selectmode==SCE_SELECT_END){ - key=psys->edit->keys[i]+pa->totkey-1; - if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)) - func(psys,i,userData); - } - else{ - LOOP_KEYS(k,key){ - if(key->flag&PEK_HIDE) continue; - - if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)){ - func(psys,i,userData); - break; - } - } - } - } -} -static void foreach_mouse_hit_key(int selected, ParticleSystem *psys,void (*func)(ParticleSystem *psys, float mat[][4], float imat[][4], int bel_index, int key_index, void *userData), void *userData){ - /* these are allways the first in this userData */ - struct { Object *ob; short *mval; float rad; rcti* rect; float dist;} *data = userData; - ParticleData *pa; - ParticleEditKey *key; - ParticleSystemModifierData *psmd=0; - bglMats mats; - int i,k, totpart; - float mat[4][4], imat[4][4]; - - if(psys==0) return; - - psmd=psys_get_modifier(data->ob,psys); - - totpart=psys->totpart; - - bgl_get_mats(&mats); - - if(G.scene->selectmode==SCE_SELECT_PATH) - selected=0; - - Mat4One(imat); - Mat4One(mat); - - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - - psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, pa, mat); - //psys_geometry_mat(psmd->dm,pa,tmat); - //Mat4MulMat4(mat,tmat,data->ob->obmat); - Mat4Invert(imat,mat); - - if(G.scene->selectmode==SCE_SELECT_END){ - key=psys->edit->keys[i]+pa->totkey-1; - if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)) - func(psys,mat,imat,i,pa->totkey-1,userData); - } - else{ - LOOP_KEYS(k,key){ - if(key->flag&PEK_HIDE) continue; - - if(key_inside_circle(data->mval,data->rad,key->world_co,&data->dist) && (selected==0 || key->flag&PEK_SELECT) && test_key_depth(key->world_co,&mats)){ - func(psys,mat,imat,i,k,userData); - } - } - } - } -} -static void foreach_selected_element(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int index, void *userData), void *userData){ - ParticleData *pa; - int i,totpart; - - if(psys==0) return; - - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa) - if(particle_is_selected(psys, pa)) - func(psys,i,userData); -} -static void foreach_selected_key(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int pa_index, int key_index, void *userData), void *userData){ - ParticleData *pa; - ParticleEditKey *key; - int i,k,totpart; - - if(psys==0) return; - - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(pa->flag&PARS_HIDE) continue; - - key=psys->edit->keys[i]; - LOOP_KEYS(k,key){ - if(key->flag&PEK_SELECT) - func(psys,i,k,userData); - } - } -} -void PE_foreach_element(ParticleSystem *psys, void (*func)(ParticleSystem *psys, int index, void *userData), void *userData) -{ - int i,totpart; - - if(psys==0) return; - - totpart=psys->totpart; - - for(i=0; itotpart; - - LOOP_PARTICLES(i,pa){ - if(pa->flag&PARS_HIDE) continue; - - key=psys->edit->keys[i]; - if(G.scene->selectmode==SCE_SELECT_POINT){ - for(k=0; ktotkey; k++,key++){ - if(key->flag&PEK_SELECT) - sel++; - } - } - else if(G.scene->selectmode==SCE_SELECT_END){ - key+=pa->totkey-1; - if(key->flag&PEK_SELECT) - sel++; - } - } - return sel; -} - -/************************************************/ -/* Particle Edit Mirroring */ -/************************************************/ - -static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit; - ParticleData *pa; - ParticleSystemModifierData *psmd; - KDTree *tree; - KDTreeNearest nearest; - float mat[4][4], co[3]; - int i, index, totpart; - - edit= psys->edit; - psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; - - tree= BLI_kdtree_new(totpart); - - /* insert particles into kd tree */ - LOOP_PARTICLES(i,pa) { - psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); - BLI_kdtree_insert(tree, i, co, NULL); - } - - BLI_kdtree_balance(tree); - - /* lookup particles and set in mirror cache */ - if(!edit->mirror_cache) - edit->mirror_cache= MEM_callocN(sizeof(int)*totpart, "PE mirror cache"); - - LOOP_PARTICLES(i,pa) { - psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); - co[0]= -co[0]; - - index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest); - - /* this needs a custom threshold still, duplicated for editmode mirror */ - if(index != -1 && index != i && (nearest.dist <= 0.0002f)) - edit->mirror_cache[i]= index; - else - edit->mirror_cache[i]= -1; - } - - /* make sure mirrors are in two directions */ - LOOP_PARTICLES(i,pa) { - if(edit->mirror_cache[i]) { - index= edit->mirror_cache[i]; - if(edit->mirror_cache[index] != i) - edit->mirror_cache[i]= -1; - } - } - - BLI_kdtree_free(tree); -} - -static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa) -{ - HairKey *hkey, *mhkey; - ParticleEditKey *key, *mkey; - ParticleEdit *edit; - float mat[4][4], mmat[4][4], immat[4][4]; - int i, mi, k; - - edit= psys->edit; - i= pa - psys->particles; - - /* find mirrored particle if needed */ - if(!mpa) { - if(!edit->mirror_cache) - PE_update_mirror_cache(ob, psys); - - mi= edit->mirror_cache[i]; - if(mi == -1) - return; - mpa= psys->particles + mi; - } - else - mi= mpa - psys->particles; - - /* make sure they have the same amount of keys */ - if(pa->totkey != mpa->totkey) { - if(mpa->hair) MEM_freeN(mpa->hair); - if(edit->keys[mi]) MEM_freeN(edit->keys[mi]); - - mpa->hair= MEM_dupallocN(pa->hair); - edit->keys[mi]= MEM_dupallocN(edit->keys[i]); - mpa->totkey= pa->totkey; - - mhkey= mpa->hair; - mkey= edit->keys[mi]; - for(k=0; ktotkey; k++, mkey++, mhkey++) { - mkey->co= mhkey->co; - mkey->time= &mhkey->time; - mkey->flag &= PEK_SELECT; - } - } - - /* mirror positions and tags */ - psys_mat_hair_to_orco(ob, dm, psys->part->from, pa, mat); - psys_mat_hair_to_orco(ob, dm, psys->part->from, mpa, mmat); - Mat4Invert(immat, mmat); - - hkey=pa->hair; - mhkey=mpa->hair; - key= edit->keys[i]; - mkey= edit->keys[mi]; - for(k=0; ktotkey; k++, hkey++, mhkey++, key++, mkey++) { - VECCOPY(mhkey->co, hkey->co); - Mat4MulVecfl(mat, mhkey->co); - mhkey->co[0]= -mhkey->co[0]; - Mat4MulVecfl(immat, mhkey->co); - - if(key->flag & PEK_TAG) - mkey->flag |= PEK_TAG; - } - - if(pa->flag & PARS_TAG) - mpa->flag |= PARS_TAG; - if(pa->flag & PARS_EDIT_RECALC) - mpa->flag |= PARS_EDIT_RECALC; -} - -static void PE_apply_mirror(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit; - ParticleData *pa; - ParticleSystemModifierData *psmd; - int i, totpart; - - edit= psys->edit; - psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; - - /* we delay settings the PARS_EDIT_RECALC for mirrored particles - * to avoid doing mirror twice */ - LOOP_PARTICLES(i,pa) { - if(pa->flag & PARS_EDIT_RECALC) { - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); - - if(edit->mirror_cache[i] != -1) - psys->particles[edit->mirror_cache[i]].flag &= ~PARS_EDIT_RECALC; - } - } - - LOOP_PARTICLES(i,pa) - if(pa->flag & PARS_EDIT_RECALC) - if(edit->mirror_cache[i] != -1) - psys->particles[edit->mirror_cache[i]].flag |= PARS_EDIT_RECALC; - - edit->totkeys= psys_count_keys(psys); -} - -/************************************************/ -/* Edit Calculation */ -/************************************************/ -/* tries to stop edited particles from going through the emitter's surface */ -static void PE_deflect_emitter(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; - ParticleEditSettings *pset = PE_settings(); - ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); - int i,k,totpart,index; - float *vec, *nor, dvec[3], dot, dist_1st; - float hairimat[4][4], hairmat[4][4]; - - if(psys==0) - return; - - if((pset->flag & PE_DEFLECT_EMITTER)==0) - return; - - edit=psys->edit; - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, hairmat); - - LOOP_KEYS(k,key){ - Mat4MulVecfl(hairmat, key->co); - } - //} - - //LOOP_PARTICLES(i,pa){ - key=psys->edit->keys[i]+1; - - dist_1st=VecLenf((key-1)->co,key->co); - dist_1st*=0.75f*pset->emitterdist; - - for(k=1; ktotkey; k++, key++){ - index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL); - - vec=edit->emitter_cosnos +index*6; - nor=vec+3; - - VecSubf(dvec, key->co, vec); - - dot=Inpf(dvec,nor); - VECCOPY(dvec,nor); - - if(dot>0.0f){ - if(dotco,key->co,dvec); - } - } - else{ - Normalize(dvec); - VecMulf(dvec,dist_1st-dot); - VecAddf(key->co,key->co,dvec); - } - if(k==1) - dist_1st*=1.3333f; - } - //} - - //LOOP_PARTICLES(i,pa){ - - Mat4Invert(hairimat,hairmat); - - LOOP_KEYS(k,key){ - Mat4MulVecfl(hairimat, key->co); - } - } -} -/* force set distances between neighbouring keys */ -void PE_apply_lengths(ParticleSystem *psys) -{ - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; - ParticleEditSettings *pset=PE_settings(); - int i,k,totpart; - float dv1[3]; - - if(psys==0) - return; - - if((pset->flag & PE_KEEP_LENGTHS)==0) - return; - - edit=psys->edit; - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - for(k=1, key=edit->keys[i] + 1; ktotkey; k++, key++){ - VecSubf(dv1, key->co, (key - 1)->co); - Normalize(dv1); - VecMulf(dv1, (key - 1)->length); - VecAddf(key->co, (key - 1)->co, dv1); - } - } -} -/* try to find a nice solution to keep distances between neighbouring keys */ -static void PE_iterate_lengths(ParticleSystem *psys) -{ - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; - ParticleEditSettings *pset=PE_settings(); - int i, j, k,totpart; - float tlen; - float dv0[3] = {0.0f, 0.0f, 0.0f}; - float dv1[3] = {0.0f, 0.0f, 0.0f}; - float dv2[3] = {0.0f, 0.0f, 0.0f}; - - if(psys==0) - return; - - if((pset->flag & PE_KEEP_LENGTHS)==0) - return; - - edit=psys->edit; - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - for(j=1; jtotkey; j++){ - float mul = 1.0f / (float)pa->totkey; - - if(pset->flag & PE_LOCK_FIRST){ - key = edit->keys[i] + 1; - k = 1; - dv1[0] = dv1[1] = dv1[2] = 0.0; - } - else{ - key = edit->keys[i]; - k = 0; - dv0[0] = dv0[1] = dv0[2] = 0.0; - } - - for(; ktotkey; k++, key++){ - if(k){ - VecSubf(dv0, (key - 1)->co, key->co); - tlen = Normalize(dv0); - VecMulf(dv0, (mul * (tlen - (key - 1)->length))); - } - - if(k < pa->totkey - 1){ - VecSubf(dv2, (key + 1)->co, key->co); - tlen = Normalize(dv2); - VecMulf(dv2, mul * (tlen - key->length)); - } - - if(k){ - VecAddf((key-1)->co,(key-1)->co,dv1); - } - - VECADD(dv1,dv0,dv2); - } - } - } -} -/* set current distances to be kept between neighbouting keys */ -static void recalc_lengths(ParticleSystem *psys) -{ - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; - - if(psys==0) - return; - - totpart = psys->totpart; - - LOOP_PARTICLES(i,pa){ - key = psys->edit->keys[i]; - for(k=0; ktotkey-1; k++, key++){ - key->length = VecLenf(key->co, (key + 1)->co); - } - } -} -/* calculate and store key locations in world coordinates */ -void PE_recalc_world_cos(Object *ob, ParticleSystem *psys) -{ - ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; - float hairmat[4][4]; - - if(psys==0) - return; - - totpart = psys->totpart; - - LOOP_PARTICLES(i,pa){ - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - - LOOP_KEYS(k,key){ - VECCOPY(key->world_co,key->co); - Mat4MulVecfl(hairmat, key->world_co); - } - } -} -/* calculate a tree for finding nearest emitter's vertice */ -static void recalc_emitter_field(Object *ob, ParticleSystem *psys) -{ - DerivedMesh *dm=psys_get_modifier(ob,psys)->dm; - ParticleEdit *edit = psys->edit; - MFace *mface; - MVert *mvert; - float *vec, *nor; - int i, totface, totvert; - - if(edit->emitter_cosnos) - MEM_freeN(edit->emitter_cosnos); - - BLI_kdtree_free(edit->emitter_field); - - totface=dm->getNumFaces(dm); - totvert=dm->getNumVerts(dm); - - edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos"); - - edit->emitter_field= BLI_kdtree_new(totface); - - vec=edit->emitter_cosnos; - nor=vec+3; - - mvert=dm->getVertDataArray(dm,CD_MVERT); - for(i=0; igetFaceData(dm,i,CD_MFACE); - - mvert=dm->getVertData(dm,mface->v1,CD_MVERT); - VECCOPY(vec,mvert->co); - VECCOPY(nor,mvert->no); - - mvert=dm->getVertData(dm,mface->v2,CD_MVERT); - VECADD(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); - - mvert=dm->getVertData(dm,mface->v3,CD_MVERT); - VECADD(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); - - if (mface->v4){ - mvert=dm->getVertData(dm,mface->v4,CD_MVERT); - VECADD(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); - - VecMulf(vec,0.25); - } - else - VecMulf(vec,0.3333f); - - Normalize(nor); - - BLI_kdtree_insert(edit->emitter_field, i, vec, NULL); - } - - BLI_kdtree_balance(edit->emitter_field); -} - -void PE_update_selection(Object *ob, int useflag) -{ - ParticleSystem *psys= PE_get_current(ob); - ParticleEdit *edit= psys->edit; - ParticleEditSettings *pset= PE_settings(); - ParticleSettings *part= psys->part; - ParticleData *pa; - HairKey *hkey; - ParticleEditKey *key; - float cfra= CFRA; - int i, k, totpart; - - totpart= psys->totpart; - - /* flag all particles to be updated if not using flag */ - if(!useflag) - LOOP_PARTICLES(i,pa) - pa->flag |= PARS_EDIT_RECALC; - - /* flush edit key flag to hair key flag to preserve selection - * on save */ - LOOP_PARTICLES(i,pa) { - key = edit->keys[i]; - - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, key++) - hkey->editflag= key->flag; - } - - psys_cache_paths(ob, psys, CFRA, 1); - - if(part->childtype && (pset->flag & PE_SHOW_CHILD)) - psys_cache_child_paths(ob, psys, cfra, 1); - - /* disable update flag */ - LOOP_PARTICLES(i,pa) - pa->flag &= ~PARS_EDIT_RECALC; -} - -void PE_update_object(Object *ob, int useflag) -{ - ParticleSystem *psys= PE_get_current(ob); - ParticleEditSettings *pset= PE_settings(); - ParticleSettings *part= psys->part; - ParticleData *pa; - float cfra= CFRA; - int i, totpart= psys->totpart; - - /* flag all particles to be updated if not using flag */ - if(!useflag) - LOOP_PARTICLES(i,pa) - pa->flag |= PARS_EDIT_RECALC; - - /* do post process on particle edit keys */ - PE_iterate_lengths(psys); - PE_deflect_emitter(ob,psys); - PE_apply_lengths(psys); - if(pset->flag & PE_X_MIRROR) - PE_apply_mirror(ob,psys); - PE_recalc_world_cos(ob,psys); - PE_hide_keys_time(psys,cfra); - - /* regenerate path caches */ - psys_cache_paths(ob, psys, cfra, 1); - - if(part->childtype && (pset->flag & PE_SHOW_CHILD)) - psys_cache_child_paths(ob, psys, cfra, 1); - - /* disable update flag */ - LOOP_PARTICLES(i,pa) - pa->flag &= ~PARS_EDIT_RECALC; -} - -/* initialize needed data for bake edit */ -void PE_create_particle_edit(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit=psys->edit; - ParticleData *pa; - ParticleEditKey *key; - HairKey *hkey; - int i,k, totpart=psys->totpart, alloc=1; - - if((psys->flag & PSYS_EDITED)==0) - return; - - if(edit){ - int newtotkeys = psys_count_keys(psys); - if(newtotkeys == edit->totkeys) - alloc=0; - } - - if(alloc){ - if(edit){ - error("ParticleEdit exists allready! Poke jahka!"); - PE_free_particle_edit(psys); - } - - edit=psys->edit=MEM_callocN(sizeof(ParticleEdit), "PE_create_particle_edit"); - - edit->keys=MEM_callocN(totpart*sizeof(ParticleEditKey*),"ParticleEditKey array"); - - LOOP_PARTICLES(i,pa){ - key = edit->keys[i] = MEM_callocN(pa->totkey*sizeof(ParticleEditKey),"ParticleEditKeys"); - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, key++){ - key->co = hkey->co; - key->time = &hkey->time; - key->flag= hkey->editflag; - } - } - - edit->totkeys = psys_count_keys(psys); - } - - recalc_lengths(psys); - recalc_emitter_field(ob, psys); - PE_recalc_world_cos(ob, psys); - - if(alloc) { - ParticleUndo_clear(psys); - PE_undo_push("Original"); - } -} - -/* toggle particle mode on & off */ -void PE_set_particle_edit(void) -{ - Object *ob= OBACT; - ParticleSystem *psys = PE_get_current(ob); - - scrarea_queue_headredraw(curarea); - - //if(!ob || ob->id.lib) return; /* is the id.lib test needed? -jahka*/ - if(ob==0 || psys==0) return; - - if(psys==0){ - if(ob->particlesystem.first){ - psys=ob->particlesystem.first; - psys->flag |= PSYS_CURRENT; - } - else - return; - } - - if((G.f & G_PARTICLEEDIT)==0){ - if(psys && psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) { - if(psys_check_enabled(ob, psys)) { - if(psys->edit==0) - PE_create_particle_edit(ob, psys); - PE_recalc_world_cos(ob, psys); - } - } - - G.f |= G_PARTICLEEDIT; - } - else{ - G.f &= ~G_PARTICLEEDIT; - - if(psys->soft) - psys->softflag |= OB_SB_REDO; - } - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); /* including header */ - allqueue(REDRAWBUTSOBJECT, 0); -} -/************************************************/ -/* Edit Selections */ -/************************************************/ -/*-----selection callbacks-----*/ -static void select_key(ParticleSystem *psys, int pa_index, int key_index, void *userData) -{ - struct { short *mval; float rad; rcti* rect; int select; } *data = userData; - ParticleData *pa = psys->particles + pa_index; - ParticleEditKey *key = psys->edit->keys[pa_index] + key_index; - - if(data->select) - key->flag|=PEK_SELECT; - else - key->flag&=~PEK_SELECT; - - pa->flag |= PARS_EDIT_RECALC; -} -static void select_keys(ParticleSystem *psys, int pa_index, int key_index, void *userData) -{ - struct { short *mval; float rad; rcti* rect; int select; } *data = userData; - ParticleData *pa = psys->particles + pa_index; - ParticleEditKey *key = psys->edit->keys[pa_index]; - int k; - - for(k=0; ktotkey; k++,key++){ - if(data->select) - key->flag|=PEK_SELECT; - else - key->flag&=~PEK_SELECT; - } - - pa->flag |= PARS_EDIT_RECALC; -} -static void toggle_key_select(ParticleSystem *psys, int pa_index, int key_index, void *userData) -{ - ParticleData *pa = psys->particles + pa_index; - - if(psys->edit->keys[pa_index][key_index].flag&PEK_SELECT) - psys->edit->keys[pa_index][key_index].flag&=~PEK_SELECT; - else - psys->edit->keys[pa_index][key_index].flag|=PEK_SELECT; - - pa->flag |= PARS_EDIT_RECALC; -} -static void select_root(ParticleSystem *psys, int index, void *userData) -{ - psys->edit->keys[index]->flag |= PEK_SELECT; -} - -static void select_tip(ParticleSystem *psys, int index, void *userData) -{ - ParticleData *pa = psys->particles + index; - ParticleEditKey *key = psys->edit->keys[index] + pa->totkey-1; - - key->flag |= PEK_SELECT; -} -static void select_more_keys(ParticleSystem *psys, int index, void *userData) -{ - ParticleEdit *edit = psys->edit; - ParticleData *pa = psys->particles+index; - ParticleEditKey *key; - int k; - - for(k=0,key=edit->keys[index]; ktotkey; k++,key++){ - if(key->flag&PEK_SELECT) continue; - - if(k==0){ - if((key+1)->flag&PEK_SELECT) - key->flag |= PEK_TO_SELECT; - } - else if(k==pa->totkey-1){ - if((key-1)->flag&PEK_SELECT) - key->flag |= PEK_TO_SELECT; - } - else{ - if(((key-1)->flag | (key+1)->flag) & PEK_SELECT) - key->flag |= PEK_TO_SELECT; - } - } - - for(k=0,key=edit->keys[index]; ktotkey; k++,key++){ - if(key->flag&PEK_TO_SELECT){ - key->flag &= ~PEK_TO_SELECT; - key->flag |= PEK_SELECT; - } - } -} - -static void select_less_keys(ParticleSystem *psys, int index, void *userData) -{ - ParticleEdit *edit = psys->edit; - ParticleData *pa = psys->particles+index; - ParticleEditKey *key; - int k; - - for(k=0,key=edit->keys[index]; ktotkey; k++,key++){ - if((key->flag&PEK_SELECT)==0) continue; - - if(k==0){ - if(((key+1)->flag&PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; - } - else if(k==pa->totkey-1){ - if(((key-1)->flag&PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; - } - else{ - if((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; - } - } - - for(k=0,key=edit->keys[index]; ktotkey; k++,key++){ - if(key->flag&PEK_TO_SELECT) - key->flag &= ~(PEK_TO_SELECT|PEK_SELECT); - } -} - -/*-----using above callbacks-----*/ -void PE_deselectall(void) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEdit *edit = 0; - ParticleData *pa; - ParticleEditKey *key; - int i,k,totpart, sel = 0; - - if(!PE_can_edit(psys)) return; - - edit = psys->edit; - - totpart = psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k,key){ - if(key->flag&PEK_SELECT){ - sel = 1; - key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - } - } - - if(sel==0){ - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k,key){ - if(!(key->flag & PEK_SELECT)) { - key->flag |= PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - } - } - } - - PE_update_selection(ob, 1); - - BIF_undo_push("(De)select all keys"); - allqueue(REDRAWVIEW3D, 1); -} -void PE_mouse_particles(void) -{ - struct { short *mval; float rad; rcti* rect; int select; } data; - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEdit *edit = 0; - ParticleData *pa; - ParticleEditKey *key; - short mval[2]; - int i,k,totpart; - - if(!PE_can_edit(psys)) return; - - edit = psys->edit; - - totpart = psys->totpart; - - bglFlush(); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - persp(PERSP_VIEW); - - if(G.qual != LR_SHIFTKEY) - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k,key){ - if(key->flag & PEK_SELECT) { - key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - } - } - - getmouseco_areawin(mval); - - data.mval=mval; - data.rad=75.0f; - data.rect=0; - data.select=0; - - for_mouse_hit_keys(1,psys,toggle_key_select,&data); - - PE_update_selection(ob, 1); - - rightmouse_transform(); - - allqueue(REDRAWVIEW3D, 1); -} -void PE_select_root() -{ - Object *ob=OBACT; - ParticleSystem *psys = PE_get_current(ob); - - if(!PE_can_edit(psys)) return; - - PE_foreach_element(psys,select_root,NULL); - BIF_undo_push("Select first"); -} -void PE_select_tip() -{ - Object *ob=OBACT; - ParticleSystem *psys = PE_get_current(ob); - - if(!PE_can_edit(psys)) return; - - PE_foreach_element(psys,select_tip,NULL); - BIF_undo_push("Select last"); -} -void PE_select_linked(void) -{ - struct { short *mval; float rad; rcti* rect; int select; } data; - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - short mval[2]; - - if(!PE_can_edit(psys)) return; - - getmouseco_areawin(mval); - - data.mval=mval; - data.rad=75.0f; - data.rect=0; - data.select=(G.qual != LR_SHIFTKEY); - - for_mouse_hit_keys(1,psys,select_keys,&data); - - PE_update_selection(ob, 1); - - BIF_undo_push("Select linked keys"); - - allqueue(REDRAWVIEW3D, 1); - return; -} -void PE_borderselect(void) -{ - struct { short *mval; float rad; rcti* rect; int select; } data; - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - rcti rect; - int val; - - if(!PE_can_edit(psys)) return; - - setlinestyle(2); - val= get_border(&rect, 3); - setlinestyle(0); - - if(val==0) return; - - data.mval=0; - data.rect=▭ - data.select=(val==LEFTMOUSE); - - for_mouse_hit_keys(0,psys,select_key,&data); - - PE_update_selection(ob, 1); - - BIF_undo_push("Select keys"); - - allqueue(REDRAWVIEW3D, 1); - return; -} -void PE_selectionCB(short selecting, Object *editobj, short *mval, float rad) -{ - struct { short *mval; float rad; rcti* rect; int select; } data; - ParticleSystem *psys = PE_get_current(OBACT); - - if(!PE_can_edit(psys)) return; - - data.mval=mval; - data.rad=rad; - data.rect=0; - data.select=(selecting==LEFTMOUSE); - - for_mouse_hit_keys(0,psys,select_key,&data); - - draw_sel_circle(0, 0, 0, 0, 0); /* signal */ - force_draw(0); -} -void PE_do_lasso_select(short mcords[][2], short moves, short select) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleSystemModifierData *psmd; - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; - float co[3], mat[4][4]; - short vertco[2]; - int i, k, totpart; - - if(!PE_can_edit(psys)) return; - - psmd= psys_get_modifier(ob, psys); - edit=psys->edit; - totpart=psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(pa->flag & PARS_HIDE) continue; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - - if(G.scene->selectmode==SCE_SELECT_POINT){ - LOOP_KEYS(k,key){ - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - project_short(co,vertco); - if(lasso_inside(mcords,moves,vertco[0],vertco[1])){ - if(select && !(key->flag & PEK_SELECT)) { - key->flag|=PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - else if(key->flag & PEK_SELECT) { - key->flag&=~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - } - } - } - else if(G.scene->selectmode==SCE_SELECT_END){ - key = edit->keys[i] + pa->totkey - 1; - - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - project_short(co,vertco); - if(lasso_inside(mcords,moves,vertco[0],vertco[1])){ - if(select && !(key->flag & PEK_SELECT)) { - key->flag|=PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - else if(key->flag & PEK_SELECT) { - key->flag&=~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } - } - } - } - - PE_update_selection(ob, 1); - - BIF_undo_push("Lasso select particles"); - - allqueue(REDRAWVIEW3D, 1); -} -void PE_hide(int mode) -{ - ParticleSystem *psys = PE_get_current(OBACT); - ParticleEdit *edit; - ParticleData *pa; - int i,totpart; - - if(!PE_can_edit(psys)) return; - - edit = psys->edit; - totpart = psys->totpart; - - if(mode == 0){ /* reveal all particles */ - LOOP_PARTICLES(i,pa){ - pa->flag &= ~PARS_HIDE; - } - } - else if(mode == 1){ /* hide unselected particles */ - LOOP_PARTICLES(i,pa) - if(particle_is_selected(psys, pa)) - pa->flag |= PARS_HIDE; - } - else{ /* hide selected particles */ - LOOP_PARTICLES(i,pa) - if(particle_is_selected(psys, pa)) - pa->flag |= PARS_HIDE; - } - - BIF_undo_push("(Un)hide elements"); - - allqueue(REDRAWVIEW3D, 1); -} -void PE_select_less(void) -{ - ParticleSystem *psys = PE_get_current(OBACT); - - if(!PE_can_edit(psys)) return; - - PE_foreach_element(psys,select_less_keys,NULL); - - BIF_undo_push("Select less"); - allqueue(REDRAWVIEW3D, 1); -} -void PE_select_more(void) -{ - ParticleSystem *psys = PE_get_current(OBACT); - - if(!PE_can_edit(psys)) return; - - PE_foreach_element(psys,select_more_keys,NULL); - - BIF_undo_push("Select more"); - allqueue(REDRAWVIEW3D, 1); -} -/************************************************/ -/* Edit Rekey */ -/************************************************/ -static void rekey_element(ParticleSystem *psys, int index, void *userData) -{ - struct { Object *ob; float dval; } *data = userData; - ParticleData *pa = psys->particles + index; - ParticleEdit *edit = psys->edit; - ParticleEditSettings *pset = PE_settings(); - ParticleKey state; - HairKey *key, *new_keys; - ParticleEditKey *ekey; - float dval, sta, end; - int k; - - pa->flag |= PARS_REKEY; - - key = new_keys = MEM_callocN(pset->totrekey * sizeof(HairKey),"Hair re-key keys"); - - /* root and tip stay the same */ - VECCOPY(key->co, pa->hair->co); - VECCOPY((key + pset->totrekey - 1)->co, (pa->hair + pa->totkey - 1)->co); - - sta = key->time = pa->hair->time; - end = (key + pset->totrekey - 1)->time = (pa->hair + pa->totkey - 1)->time; - dval = (end - sta) / (float)(pset->totrekey - 1); - - /* interpolate new keys from old ones */ - for(k=1,key++; ktotrekey-1; k++,key++) { - state.time = (float)k / (float)(pset->totrekey-1); - psys_get_particle_on_path(data->ob, psys, index, &state, 0); - VECCOPY(key->co, state.co); - key->time = sta + k * dval; - } - - /* replace keys */ - if(pa->hair) - MEM_freeN(pa->hair); - pa->hair = new_keys; - - pa->totkey=pset->totrekey; - - if(edit->keys[index]) - MEM_freeN(edit->keys[index]); - ekey = edit->keys[index] = MEM_callocN(pa->totkey * sizeof(ParticleEditKey),"Hair re-key edit keys"); - - for(k=0, key=pa->hair; ktotkey; k++, key++, ekey++) { - ekey->co = key->co; - ekey->time = &key->time; - } - - pa->flag &= ~PARS_REKEY; - pa->flag |= PARS_EDIT_RECALC; -} -void PE_rekey(void) -{ - Object *ob=OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEditSettings *pset = PE_settings(); - struct { Object *ob; float dval; } data; - - if(!PE_can_edit(psys)) return; - - data.ob = ob; - data.dval = 1.0f / (float)(pset->totrekey-1); - - foreach_selected_element(psys,rekey_element,&data); - - psys->edit->totkeys = psys_count_keys(psys); - - recalc_lengths(psys); - - PE_update_object(ob, 1); - - BIF_undo_push("Re-key particles"); -} -static void rekey_element_to_time(int index, float path_time) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEdit *edit=0; - ParticleData *pa; - ParticleKey state; - HairKey *new_keys, *key; - ParticleEditKey *ekey; - int k; - - if(psys==0) return; - - edit = psys->edit; - - pa = psys->particles + index; - - pa->flag |= PARS_REKEY; - - key = new_keys = MEM_dupallocN(pa->hair); - - /* interpolate new keys from old ones (roots stay the same) */ - for(k=1, key++; k < pa->totkey; k++, key++) { - state.time = path_time * (float)k / (float)(pa->totkey-1); - psys_get_particle_on_path(ob, psys, index, &state, 0); - VECCOPY(key->co, state.co); - } - - /* replace hair keys */ - if(pa->hair) - MEM_freeN(pa->hair); - pa->hair = new_keys; - - /* update edit pointers */ - for(k=0, key=pa->hair, ekey=edit->keys[index]; ktotkey; k++, key++, ekey++) { - ekey->co = key->co; - ekey->time = &key->time; - } - - pa->flag &= ~PARS_REKEY; -} -static int remove_tagged_elements(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit = psys->edit; - ParticleEditSettings *pset = PE_settings(); - ParticleData *pa, *npa=0, *new_pars=0; - ParticleEditKey **key, **nkey=0, **new_keys=0; - ParticleSystemModifierData *psmd; - int i, totpart, new_totpart = psys->totpart, removed = 0; - - if(pset->flag & PE_X_MIRROR) { - /* mirror tags */ - psmd = psys_get_modifier(ob, psys); - totpart = psys->totpart; - - LOOP_PARTICLES(i,pa) - if(pa->flag & PARS_TAG) - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); - } - - for(i=0, pa=psys->particles; itotpart; i++, pa++) { - if(pa->flag & PARS_TAG) { - new_totpart--; - removed++; - } - } - - if(new_totpart != psys->totpart) { - if(new_totpart) { - npa = new_pars = MEM_callocN(new_totpart * sizeof(ParticleData), "ParticleData array"); - nkey = new_keys = MEM_callocN(new_totpart * sizeof(ParticleEditKey *), "ParticleEditKey array"); - } - - pa = psys->particles; - key = edit->keys; - for(i=0; itotpart; i++, pa++, key++) { - if(pa->flag & PARS_TAG) { - if(*key) - MEM_freeN(*key); - if(pa->hair) - MEM_freeN(pa->hair); - } - else { - memcpy(npa, pa, sizeof(ParticleData)); - memcpy(nkey, key, sizeof(ParticleEditKey*)); - npa++; - nkey++; - } - } - - if(psys->particles) MEM_freeN(psys->particles); - psys->particles = new_pars; - - if(edit->keys) MEM_freeN(edit->keys); - edit->keys = new_keys; - - if(edit->mirror_cache) { - MEM_freeN(edit->mirror_cache); - edit->mirror_cache = NULL; - } - - psys->totpart = new_totpart; - - edit->totkeys = psys_count_keys(psys); - } - - return removed; -} -static void remove_tagged_keys(Object *ob, ParticleSystem *psys) -{ - ParticleEdit *edit = psys->edit; - ParticleEditSettings *pset = PE_settings(); - ParticleData *pa; - HairKey *key, *nkey, *new_keys=0; - ParticleEditKey *ekey; - ParticleSystemModifierData *psmd; - int i, k, totpart = psys->totpart; - short new_totkey; - - if(pset->flag & PE_X_MIRROR) { - /* mirror key tags */ - psmd = psys_get_modifier(ob, psys); - - LOOP_PARTICLES(i,pa) { - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) { - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); - break; - } - } - } - } - - LOOP_PARTICLES(i,pa) { - new_totkey = pa->totkey; - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) - new_totkey--; - } - /* we can't have elements with less than two keys*/ - if(new_totkey < 2) - pa->flag |= PARS_TAG; - } - remove_tagged_elements(ob, psys); - - totpart = psys->totpart; - - LOOP_PARTICLES(i,pa) { - new_totkey = pa->totkey; - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) - new_totkey--; - } - if(new_totkey != pa->totkey) { - key = pa->hair; - nkey = new_keys = MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys"); - - for(k=0, ekey=edit->keys[i]; kflag & PEK_TAG && key < pa->hair + pa->totkey) { - key++; - ekey++; - } - - if(key < pa->hair + pa->totkey) { - VECCOPY(nkey->co, key->co); - nkey->time = key->time; - nkey->weight = key->weight; - } - } - if(pa->hair) - MEM_freeN(pa->hair); - - pa->hair = new_keys; - - pa->totkey=new_totkey; - - if(edit->keys[i]) - MEM_freeN(edit->keys[i]); - ekey = edit->keys[i] = MEM_callocN(new_totkey*sizeof(ParticleEditKey), "particle edit keys"); - - for(k=0, key=pa->hair; ktotkey; k++, key++, ekey++) { - ekey->co = key->co; - ekey->time = &key->time; - } - } - } - - edit->totkeys = psys_count_keys(psys); -} -/* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */ -static void subdivide_element(ParticleSystem *psys, int index, void *userData) -{ - struct { Object *ob; } *data = userData; - ParticleEdit *edit = psys->edit; - ParticleData *pa = psys->particles + index; - - ParticleKey state; - HairKey *key, *nkey, *new_keys; - ParticleEditKey *ekey, *nekey, *new_ekeys; - - int k; - short totnewkey=0; - float endtime; - - for(k=0, ekey=edit->keys[index]; ktotkey-1; k++,ekey++){ - if(ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT) - totnewkey++; - } - - if(totnewkey==0) return; - - pa->flag |= PARS_REKEY; - - nkey = new_keys = MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys"); - nekey = new_ekeys = MEM_callocN((pa->totkey+totnewkey)*(sizeof(ParticleEditKey)),"Hair subdivide edit keys"); - endtime = pa->hair[pa->totkey-1].time; - - for(k=0, key=pa->hair, ekey=edit->keys[index]; ktotkey-1; k++, key++, ekey++){ - - memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(ParticleEditKey)); - - nekey->co = nkey->co; - nekey->time = &nkey->time; - - nkey++; - nekey++; - - if(ekey->flag & PEK_SELECT && (ekey+1)->flag & PEK_SELECT){ - nkey->time= (key->time + (key+1)->time)*0.5f; - state.time = (endtime != 0.0f)? nkey->time/endtime: 0.0f; - psys_get_particle_on_path(data->ob, psys, index, &state, 0); - VECCOPY(nkey->co, state.co); - - nekey->co= nkey->co; - nekey->time= &nkey->time; - nekey->flag |= PEK_SELECT; - - nekey++; - nkey++; - } - } - /*tip still not copied*/ - memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(ParticleEditKey)); - - nekey->co = nkey->co; - nekey->time = &nkey->time; - - if(pa->hair) - MEM_freeN(pa->hair); - pa->hair = new_keys; - - if(edit->keys[index]) - MEM_freeN(edit->keys[index]); - - edit->keys[index] = new_ekeys; - - pa->totkey += totnewkey; - pa->flag |= PARS_EDIT_RECALC; - pa->flag &= ~PARS_REKEY; -} -void PE_subdivide(void) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - struct { Object *ob; } data; - - if(!PE_can_edit(psys)) return; - - data.ob= ob; - PE_foreach_element(psys,subdivide_element,&data); - - psys->edit->totkeys = psys_count_keys(psys); - - recalc_lengths(psys); - PE_recalc_world_cos(ob, psys); - - PE_update_object(ob, 1); - - BIF_undo_push("Subdivide hair(s)"); -} -void PE_remove_doubles(void) -{ - Object *ob=OBACT; - ParticleSystem *psys=PE_get_current(ob); - ParticleEditSettings *pset=PE_settings(); - ParticleData *pa; - ParticleEdit *edit; - ParticleSystemModifierData *psmd; - KDTree *tree; - KDTreeNearest nearest[10]; - float mat[4][4], co[3]; - int i, n, totn, removed, totpart, flag, totremoved; - - if(!PE_can_edit(psys)) return; - - edit= psys->edit; - psmd= psys_get_modifier(ob, psys); - totremoved= 0; - - do { - removed= 0; - - totpart= psys->totpart; - tree=BLI_kdtree_new(totpart); - - /* insert particles into kd tree */ - LOOP_PARTICLES(i,pa) { - if(particle_is_selected(psys, pa)) { - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); - BLI_kdtree_insert(tree, i, co, NULL); - } - } - - BLI_kdtree_balance(tree); - - /* tag particles to be removed */ - LOOP_PARTICLES(i,pa) { - if(particle_is_selected(psys, pa)) { - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); - - totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest); - - for(n=0; n i && nearest[n].dist < 0.0002f) { - if(!(pa->flag & PARS_TAG)) { - pa->flag |= PARS_TAG; - removed++; - } - } - } - } - } - - BLI_kdtree_free(tree); - - /* remove tagged particles - don't do mirror here! */ - flag= pset->flag; - pset->flag &= ~PE_X_MIRROR; - remove_tagged_elements(ob, psys); - pset->flag= flag; - totremoved += removed; - } while(removed); - - if(totremoved) - notice("Removed: %d", totremoved); - - PE_recalc_world_cos(ob, psys); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Remove double particles"); -} - -/************************************************/ -/* Edit Brushes */ -/************************************************/ -static void brush_comb(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData) -{ - struct {Object *ob; short *mval; float rad; rcti* rect; float dist; float *dvec; float combfac;} *data = userData; - ParticleData *pa= &psys->particles[pa_index]; - ParticleEditSettings *pset= PE_settings(); - HairKey *key = pa->hair + key_index; - float cvec[3], fac; - - if(pset->flag & PE_LOCK_FIRST && key_index == 0) return; - - fac = (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac); - - VECCOPY(cvec,data->dvec); - Mat4Mul3Vecfl(imat,cvec); - VecMulf(cvec, fac); - VECADD(key->co, key->co, cvec); - - pa->flag |= PARS_EDIT_RECALC; -} -static void brush_cut(ParticleSystem *psys, int index, void *userData) -{ - struct { short *mval; float rad; rcti* rect; int selected; float cutfac;} *data = userData; - ParticleData *pa= &psys->particles[index]; - ParticleCacheKey *key = psys->pathcache[index]; - float rad2, cut_time = 1.0; - float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv; - int k, cut, keys = (int)pow(2.0, (double)psys->part->draw_step); - short vertco[2]; - - /* blunt scissors */ - if(BLI_frand() > data->cutfac) return; - - rad2 = data->rad * data->rad; - - cut=0; - - project_short(key->co, vertco); - x0 = (float)vertco[0]; - x1 = (float)vertco[1]; - - o0 = (float)data->mval[0]; - o1 = (float)data->mval[1]; - - xo0 = x0 - o0; - xo1 = x1 - o1; - - /* check if root is inside circle */ - if(xo0*xo0 + xo1*xo1 < rad2) { - cut_time = -1.0f; - cut = 1; - } - else { - /* calculate path time closest to root that was inside the circle */ - for(k=1, key++; k<=keys; k++, key++){ - project_short(key->co, vertco); - - v0 = (float)vertco[0] - x0; - v1 = (float)vertco[1] - x1; - - dv = v0*v0 + v1*v1; - - d = (v0*xo1 - v1*xo0); - - d = dv * rad2 - d*d; - - if(d > 0.0f) { - d = sqrt(d); - - cut_time = -(v0*xo0 + v1*xo1 + d); - - if(cut_time > 0.0f) { - cut_time /= dv; - - if(cut_time < 1.0f) { - cut_time += (float)(k-1); - cut_time /= (float)keys; - cut = 1; - break; - } - } - } - - x0 = (float)vertco[0]; - x1 = (float)vertco[1]; - - xo0 = x0 - o0; - xo1 = x1 - o1; - } - } - - if(cut) { - if(cut_time < 0.0f) { - pa->flag |= PARS_TAG; - } - else { - rekey_element_to_time(index, cut_time); - pa->flag |= PARS_EDIT_RECALC; - } - } -} -static void brush_length(ParticleSystem *psys, int index, void *userData) -{ - struct { short *mval; float rad; rcti* rect; float dist; float growfac; } *data = userData; - ParticleData *pa = &psys->particles[index]; - HairKey *key; - float dvec[3],pvec[3]; - int k; - - key = pa->hair; - VECCOPY(pvec,key->co); - - for(k=1, key++; ktotkey; k++,key++){ - VECSUB(dvec,key->co,pvec); - VECCOPY(pvec,key->co); - VecMulf(dvec,data->growfac); - VECADD(key->co,(key-1)->co,dvec); - } - - pa->flag |= PARS_EDIT_RECALC; -} -static void brush_puff(ParticleSystem *psys, int index, void *userData) -{ - struct { short *mval; float rad; rcti* rect; float dist; - Object *ob; DerivedMesh *dm; float pufffac; int invert; } *data = userData; - ParticleData *pa = &psys->particles[index]; - ParticleEdit *edit = psys->edit; - HairKey *key; - float mat[4][4], imat[4][4]; - float lastco[3], rootco[3], co[3], nor[3], kco[3], dco[3], fac, length; - int k; - - psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, pa, mat); - Mat4Invert(imat,mat); - - /* find root coordinate and normal on emitter */ - key = pa->hair; - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - - index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL); - if(index == -1) return; - - VECCOPY(rootco, co); - VecCopyf(nor, &psys->edit->emitter_cosnos[index*6+3]); - Normalize(nor); - length= 0.0f; - - fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac); - fac *= 0.025f; - if(data->invert) - fac= -fac; - - for(k=1, key++; ktotkey; k++, key++){ - /* compute position as if hair was standing up straight */ - VECCOPY(lastco, co); - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - length += VecLenf(lastco, co); - - VECADDFAC(kco, rootco, nor, length); - - /* blend between the current and straight position */ - VECSUB(dco, kco, co); - VECADDFAC(co, co, dco, fac); - - VECCOPY(key->co, co); - Mat4MulVecfl(imat, key->co); - } - - pa->flag |= PARS_EDIT_RECALC; -} -static void brush_smooth_get(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData) -{ - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} *data = userData; - ParticleData *pa= &psys->particles[pa_index]; - HairKey *key = pa->hair + key_index; - - if(key_index){ - float dvec[3]; - - VecSubf(dvec,key->co,(key-1)->co); - Mat4Mul3Vecfl(mat,dvec); - VECADD(data->vec,data->vec,dvec); - data->tot++; - } -} -static void brush_smooth_do(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData) -{ - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} *data = userData; - ParticleData *pa= &psys->particles[pa_index]; - HairKey *key = pa->hair + key_index; - float vec[3], dvec[3]; - - if(key_index){ - VECCOPY(vec,data->vec); - Mat4Mul3Vecfl(imat,vec); - - VecSubf(dvec,key->co,(key-1)->co); - - VECSUB(dvec,vec,dvec); - VecMulf(dvec,data->smoothfac); - - VECADD(key->co,key->co,dvec); - } - - pa->flag |= PARS_EDIT_RECALC; -} -#define EXPERIMENTAL_DEFORM_ONLY_PAINTING 1 -static void brush_add(Object *ob, ParticleSystem *psys, short *mval, short number) -{ - ParticleData *add_pars = MEM_callocN(number*sizeof(ParticleData),"ParticleData add"); - ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); - ParticleEditSettings *pset= PE_settings(); - ParticleEdit *edit = psys->edit; - int i, k, n = 0, totpart = psys->totpart; - short dmx = 0, dmy = 0; - short mx = mval[0] - curarea->winx / 2, my = mval[1] - curarea->winy / 2; - float co1[3], co2[3], vec[4], min_d, imat[4][4]; - float framestep, timestep = psys_get_timestep(psys->part); - short size = pset->brush[PE_BRUSH_ADD].size; - short size2 = size*size; -#if EXPERIMENTAL_DEFORM_ONLY_PAINTING - DerivedMesh *dm=0; -#endif - Mat4Invert(imat,ob->obmat); - - BLI_srandom(psys->seed+mval[0]+mval[1]); - - /* painting onto the deformed mesh, could be an option? */ -#if EXPERIMENTAL_DEFORM_ONLY_PAINTING - if (psmd->dm->deformedOnly) - dm = psmd->dm; - else - dm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH); -#endif - for(i=0; i1){ - dmx=dmy=size; - while(dmx*dmx+dmy*dmy>size2){ - dmx=(short)((2.0f*BLI_frand()-1.0f)*size); - dmy=(short)((2.0f*BLI_frand()-1.0f)*size); - } - } - - /* create intersection coordinates in view Z direction at mouse coordinates */ - /* Thanks to who ever wrote the "Mouse Location 3D Space" tutorial in "Blender 3D: Blending Into Python/Cookbook". */ - if(G.vd->persp){ - vec[0]= (2.0f*(mx+dmx)/curarea->winx); - vec[1]= (2.0f*(my+dmy)/curarea->winy); - vec[2]= -1.0f; - vec[3]= 1.0f; - - Mat4MulVec4fl(G.vd->persinv, vec); - VecMulf(vec, 1.0f/vec[3]); - - VECCOPY(co1, G.vd->viewinv[3]); - VECSUB(vec, vec, co1); - Normalize(vec); - - VECADDFAC(co1, G.vd->viewinv[3], vec, G.vd->near); - VECADDFAC(co2, G.vd->viewinv[3], vec, G.vd->far); - } - else { - vec[0] = 2.0f*(mx+dmx)/curarea->winx; - vec[1] = 2.0f*(my+dmy)/curarea->winy; - vec[2] = 0.0f; - vec[3] = 1.0f; - - Mat4MulVec4fl(G.vd->persinv,vec); - - VECADDFAC(co1,vec,G.vd->viewinv[2],1000.0f); - VECADDFAC(co2,vec,G.vd->viewinv[2],-1000.0f); - } - - Mat4MulVecfl(imat,co1); - Mat4MulVecfl(imat,co2); - min_d=2.0; - - /* warning, returns the derived mesh face */ -#if EXPERIMENTAL_DEFORM_ONLY_PAINTING - if(psys_intersect_dm(ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) { - add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,add_pars[n].num,add_pars[n].fuv,NULL); - n++; - } -#else -#if 0 - if (psmd->dm->deformedOnly) { - if(psys_intersect_dm(ob,psmd->dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)){ - n++; - } - } else { - /* we need to test against the cage mesh, because 1) its faster and 2) then we can avoid converting the fuv back which is not simple */ - if(psys_intersect_dm(ob,psmd->dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)){ - MFace *mface; - float fuv_mod[3] = {0.0, 0.0, 0.0}; - OrigSpaceFace *osface; - - mface= psmd->dm->getFaceData(psmd->dm,add_pars[n].num,CD_MFACE); - osface= psmd->dm->getFaceData(psmd->dm, add_pars[n].num, CD_ORIGSPACE); - - add_pars[n].fuv[2]=0.0; - - /* use the original index for num and the derived index for num_dmcache */ - add_pars[n].num_dmcache = add_pars[n].num; - add_pars[n].num = *(int *)psmd->dm->getFaceData(psmd->dm, add_pars[n].num, CD_ORIGINDEX); - - /* This is totally unaceptable code (fakeing mesh dara) but changing the target function isnt really nice either, do this temporarily */ - if (1) { /* Evilness*/ - MFace mface_fake; - MVert mvert_fake[4]; - //int test1,test2; - //test1 = add_pars[n].num_dmcache; - //test2 = add_pars[n].num; - - mvert_fake[0].co[2] = mvert_fake[1].co[2] = mvert_fake[2].co[2] = mvert_fake[3].co[2] = 0.0; - - mface_fake.v1 = 0; - mface_fake.v2 = 1; - mface_fake.v3 = 2; - - if (mface->v4) { - mface_fake.v4 = 3; - } else { - mface_fake.v4 = 0; - } - - Vec2Copyf(mvert_fake[0].co, osface->uv[0]); - Vec2Copyf(mvert_fake[1].co, osface->uv[1]); - Vec2Copyf(mvert_fake[2].co, osface->uv[2]); - Vec2Copyf(mvert_fake[3].co, osface->uv[3]); - //printf("before %f %f %i %i\n", add_pars[n].fuv[0], add_pars[n].fuv[1], test1, test2); - psys_interpolate_face(&mvert_fake, &mface_fake, NULL, &add_pars[n].fuv, &fuv_mod, NULL, NULL, NULL); - - /* Apply as the UV */ - Vec2Copyf(add_pars[n].fuv, fuv_mod); - //printf("after %f %f\n", add_pars[n].fuv[0], add_pars[n].fuv[1]); - } - /* Make a fake face, for calculating the derived face's fuv on the original face */ - //PointInFace2DUV(mface->v4, osface->uv[0], osface->uv[1], osface->uv[2], osface->uv[3], add_pars[n].fuv, fuv_mod); - //Vec2Copyf(add_pars[n].fuv, fuv_mod); - - n++; - } - } -#endif -#endif - } - if(n){ - int newtotpart=totpart+n; - float hairmat[4][4], cur_co[3]; - KDTree *tree=0; - ParticleData *pa, *new_pars = MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new"); - ParticleEditKey *ekey, **key, **new_keys = MEM_callocN(newtotpart*sizeof(ParticleEditKey *),"ParticleEditKey array new"); - HairKey *hkey; - - /* save existing elements */ - memcpy(new_pars, psys->particles, totpart * sizeof(ParticleData)); - memcpy(new_keys, edit->keys, totpart * sizeof(ParticleEditKey*)); - - /* change old arrays to new ones */ - if(psys->particles) MEM_freeN(psys->particles); - psys->particles = new_pars; - - if(edit->keys) MEM_freeN(edit->keys); - edit->keys = new_keys; - - if(edit->mirror_cache) { - MEM_freeN(edit->mirror_cache); - edit->mirror_cache = NULL; - } - - /* create tree for interpolation */ - if(pset->flag & PE_INTERPOLATE_ADDED && psys->totpart){ - tree=BLI_kdtree_new(psys->totpart); - - for(i=0, pa=psys->particles; idm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,cur_co,0,0,0,0,0); - BLI_kdtree_insert(tree, i, cur_co, NULL); - } - - BLI_kdtree_balance(tree); - } - - psys->totpart = newtotpart; - - /* create new elements */ - pa = psys->particles + totpart; - key = edit->keys + totpart; - - for(i=totpart; ihair = MEM_callocN(pset->totaddkey * sizeof(HairKey), "BakeKey key add"); - ekey = *key = MEM_callocN(pset->totaddkey * sizeof(ParticleEditKey), "ParticleEditKey add"); - pa->totkey = pset->totaddkey; - - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, ekey++) { - ekey->co = hkey->co; - ekey->time = &hkey->time; - } - - initialize_particle(pa,i,ob,psys,psmd); - reset_particle(pa,psys,psmd,ob,0.0,1.0,0,0,0); - pa->flag |= PARS_EDIT_RECALC; - if(pset->flag & PE_X_MIRROR) - pa->flag |= PARS_TAG; /* signal for duplicate */ - - framestep = pa->lifetime/(float)(pset->totaddkey-1); - - if(tree){ - HairKey *hkey; - ParticleKey key[3]; - KDTreeNearest ptn[3]; - int w, maxw; - float maxd, mind, dd, totw=0.0, weight[3]; - - psys_particle_on_dm(ob,psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,0,0); - maxw = BLI_kdtree_find_n_nearest(tree,3,co1,NULL,ptn); - - maxd = ptn[maxw-1].dist; - mind = ptn[0].dist; - dd = maxd - mind; - - for(w=0; wtotaddkey; k++) { - hkey = pa->hair + k; - hkey->time = pa->time + k * framestep; - - key[0].time = hkey->time/ 100.0f; - psys_get_particle_on_path(ob, psys, ptn[0].index, key, 0); - VecMulf(key[0].co, weight[0]); - - if(maxw>1) { - key[1].time = key[0].time; - psys_get_particle_on_path(ob, psys, ptn[1].index, key + 1, 0); - VecMulf(key[1].co, weight[1]); - VECADD(key[0].co, key[0].co, key[1].co); - - if(maxw>2) { - key[2].time = key[0].time; - psys_get_particle_on_path(ob, psys, ptn[2].index, key + 2, 0); - VecMulf(key[2].co, weight[2]); - VECADD(key[0].co, key[0].co, key[2].co); - } - } - - if(k==0) - VECSUB(co1, pa->state.co, key[0].co); - - VECADD(pa->hair[k].co, key[0].co, co1); - - pa->hair[k].time = key[0].time; - } - } - else{ - for(k=0, hkey=pa->hair; ktotaddkey; k++, hkey++) { - VECADDFAC(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep); - pa->hair[k].time += k * framestep; - } - } - for(k=0, hkey=pa->hair; ktotaddkey; k++, hkey++) { - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - Mat4Invert(imat,hairmat); - Mat4MulVecfl(imat, hkey->co); - } - } - edit->totkeys = psys_count_keys(psys); - - if(tree) - BLI_kdtree_free(tree); - } - if(add_pars) - MEM_freeN(add_pars); - -/* painting onto the deformed mesh, could be an option? */ -#if EXPERIMENTAL_DEFORM_ONLY_PAINTING - if (!psmd->dm->deformedOnly) - dm->release(dm); -#endif -} -static void brush_weight(ParticleSystem *psys, float mat[][4], float imat[][4], int pa_index, int key_index, void *userData) -{ - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float weightfac;} *data = userData; - ParticleData *pa; - - /* roots have full weight allways */ - if(key_index) { - pa= &psys->particles[pa_index]; - pa->hair[key_index].weight = data->weightfac; - pa->flag |= PARS_EDIT_RECALC; - } -} - -/* returns 0 if no brush was used */ -int PE_brush_particles(void) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleEdit *edit; - ParticleEditSettings *pset = PE_settings(); - ParticleSystemModifierData *psmd; - ParticleBrushData *brush; - float vec1[3], vec2[3]; - short mval[2], mvalo[2], firsttime = 1, dx, dy; - int selected = 0, flip, removed = 0; - - if(!PE_can_edit(psys)) return 0; - - edit = psys->edit; - psmd= psys_get_modifier(ob, psys); - - flip= (get_qual() == LR_SHIFTKEY); - - if(pset->brushtype<0) return 0; - brush= &pset->brush[pset->brushtype]; - - initgrabz(ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2]); - - getmouseco_areawin(mvalo); - - mval[0] = mvalo[0]; mval[1] = mvalo[1]; - - while(get_mbut() & L_MOUSE){ - bglFlush(); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - persp(PERSP_VIEW); - - dx=mval[0]-mvalo[0]; - dy=mval[1]-mvalo[1]; - if(((pset->brushtype == PE_BRUSH_ADD) ? - (sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0)) - || firsttime){ - firsttime = 0; - - selected = (short)count_selected_keys(psys); - - switch(pset->brushtype){ - case PE_BRUSH_COMB: - { - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float *dvec; float combfac;} data; - - data.ob = ob; - data.mval = mval; - data.rad = (float)brush->size; - - data.combfac = (float)(brush->strength - 50) / 50.0f; - if(data.combfac < 0.0f) - data.combfac = 1.0f - 9.0f * data.combfac; - else - data.combfac = 1.0f - data.combfac; - - Mat4Invert(ob->imat, ob->obmat); - - window_to_3d(vec1, mvalo[0], mvalo[1]); - window_to_3d(vec2, mval[0], mval[1]); - VECSUB(vec1, vec2, vec1); - data.dvec = vec1; - - foreach_mouse_hit_key(selected, psys,brush_comb, &data); - break; - } - case PE_BRUSH_CUT: - { - struct { short *mval; float rad; rcti* rect; int selected; float cutfac;} data; - - data.mval = mval; - data.rad = (float)brush->size; - - data.selected = selected; - - data.cutfac = (float)(brush->strength / 100.0f); - - if(selected) - foreach_selected_element(psys, brush_cut, &data); - else - PE_foreach_element(psys, brush_cut, &data); - - removed= remove_tagged_elements(ob, psys); - if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); - break; - } - case PE_BRUSH_LENGTH: - { - struct { short *mval; float rad; rcti* rect; float dist; float growfac; } data; - - data.mval = mval; - - data.rad = (float)brush->size; - data.growfac = (float)brush->strength / 5000.0f; - - if(brush->invert ^ flip) - data.growfac = 1.0f - data.growfac; - else - data.growfac = 1.0f + data.growfac; - - foreach_mouse_hit_element(selected, psys, brush_length, &data); - - if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); - break; - } - case PE_BRUSH_PUFF: - { - struct { short *mval; float rad; rcti* rect; float dist; - Object *ob; DerivedMesh *dm; float pufffac; int invert; } data; - - data.ob = ob; - data.dm = psmd->dm; - data.mval = mval; - data.rad = (float)brush->size; - - data.pufffac = (float)(brush->strength - 50) / 50.0f; - if(data.pufffac < 0.0f) - data.pufffac = 1.0f - 9.0f * data.pufffac; - else - data.pufffac = 1.0f - data.pufffac; - - data.invert= (brush->invert ^ flip); - Mat4Invert(ob->imat, ob->obmat); - - foreach_mouse_hit_element(selected, psys, brush_puff, &data); - break; - } - case PE_BRUSH_ADD: - if(psys->part->from==PART_FROM_FACE){ - brush_add(ob, psys, mval, brush->strength); - if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); - } - break; - case PE_BRUSH_WEIGHT: - { - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float weightfac;} data; - - data.ob = ob; - data.mval = mval; - data.rad = (float)brush->size; - - data.weightfac = (float)(brush->strength / 100.0f); - - foreach_mouse_hit_key(selected, psys, brush_weight, &data); - break; - } - case PE_BRUSH_SMOOTH: - { - struct { Object *ob; short *mval; float rad; rcti* rect; float dist; float vec[3]; int tot; float smoothfac;} data; - - data.ob = ob; - data.mval = mval; - data.rad = (float)brush->size; - - data.vec[0] = data.vec[1] = data.vec[2] = 0.0f; - data.tot = 0; - - data.smoothfac = (float)(brush->strength / 100.0f); - - Mat4Invert(ob->imat, ob->obmat); - - foreach_mouse_hit_key(selected, psys, brush_smooth_get, &data); - - if(data.tot){ - VecMulf(data.vec, 1.0f / (float)data.tot); - foreach_mouse_hit_key(selected, psys, brush_smooth_do, &data); - } - - break; - } - } - if((pset->flag & PE_KEEP_LENGTHS)==0) - recalc_lengths(psys); - - if(pset->brushtype == PE_BRUSH_ADD || removed) { - if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR)) - PE_mirror_x(1); - PE_recalc_world_cos(ob,psys); - psys_free_path_cache(psys); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else - PE_update_object(ob, 1); - - mvalo[0] = mval[0]; - mvalo[1] = mval[1]; - } - - force_draw(0); - - PIL_sleep_ms(10); - - getmouseco_areawin(mval); - } - allqueue(REDRAWVIEW3D, 1); - - BIF_undo_push("Brush edit particles"); - - return 1; -} -static void set_delete_particle(ParticleSystem *psys, int index, void *userData) -{ - psys->particles[index].flag |= PARS_TAG; -} -static void set_delete_particle_key(ParticleSystem *psys, int pa_index, int key_index, void *userData) -{ - psys->edit->keys[pa_index][key_index].flag |= PEK_TAG; -} -void PE_delete_particle(void) -{ - Object *ob=OBACT; - ParticleSystem *psys = PE_get_current(ob); - short event=0; - - if(!PE_can_edit(psys)) return; - - event= pupmenu("Erase %t|Particle%x2|Key%x1"); - - if(event<1) return; - - if(event==1){ - foreach_selected_key(psys, set_delete_particle_key, 0); - remove_tagged_keys(ob, psys); - recalc_lengths(psys); - } - else if(event==2){ - foreach_selected_element(psys, set_delete_particle, 0); - remove_tagged_elements(ob, psys); - recalc_lengths(psys); - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Delete particles/keys"); -} - -void PE_mirror_x(int tagged) -{ - Object *ob=OBACT; - Mesh *me= (Mesh*)(ob->data); - ParticleSystemModifierData *psmd; - ParticleSystem *psys = PE_get_current(ob); - ParticleEdit *edit; - ParticleData *pa, *newpa, *new_pars; - ParticleEditKey *ekey, **newkey, **key, **new_keys; - HairKey *hkey; - int *mirrorfaces; - int i, k, rotation, totpart, newtotpart; - - if(!PE_can_edit(psys)) return; - - edit= psys->edit; - psmd= psys_get_modifier(ob, psys); - - mirrorfaces= mesh_get_x_mirror_faces(ob); - - if(!edit->mirror_cache) - PE_update_mirror_cache(ob, psys); - - totpart= psys->totpart; - newtotpart= psys->totpart; - LOOP_PARTICLES(i,pa) { - if(pa->flag&PARS_HIDE) continue; - - if(!tagged) { - if(particle_is_selected(psys, pa)) { - if(edit->mirror_cache[i] != -1) { - /* already has a mirror, don't need to duplicate */ - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); - continue; - } - else - pa->flag |= PARS_TAG; - } - } - - if((pa->flag & PARS_TAG) && mirrorfaces[pa->num*2] != -1) - newtotpart++; - } - - if(newtotpart != psys->totpart) { - /* allocate new arrays and copy existing */ - new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new"); - new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey*), "ParticleEditKey new"); - - memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData)); - memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*)); - - if(psys->particles) MEM_freeN(psys->particles); - psys->particles= new_pars; - - if(edit->keys) MEM_freeN(edit->keys); - edit->keys= new_keys; - - if(edit->mirror_cache) { - MEM_freeN(edit->mirror_cache); - edit->mirror_cache= NULL; - } - - psys->totpart= newtotpart; - - /* create new elements */ - pa= psys->particles; - newpa= psys->particles + totpart; - key= edit->keys; - newkey= edit->keys + totpart; - - for(i=0; iflag&PARS_HIDE) continue; - - if(!(pa->flag & PARS_TAG) || mirrorfaces[pa->num*2] == -1) - continue; - - /* duplicate */ - *newpa= *pa; - if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair); - if(pa->keys) newpa->keys= MEM_dupallocN(pa->keys); - if(*key) *newkey= MEM_dupallocN(*key); - - /* rotate weights according to vertex index rotation */ - rotation= mirrorfaces[pa->num*2+1]; - newpa->fuv[0]= pa->fuv[2]; - newpa->fuv[1]= pa->fuv[1]; - newpa->fuv[2]= pa->fuv[0]; - newpa->fuv[3]= pa->fuv[3]; - while(rotation-- > 0) - if(me->mface[pa->num].v4) - SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]) - else - SHIFT3(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2]) - - /* assign face inddex */ - newpa->num= mirrorfaces[pa->num*2]; - newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL); - - /* update edit key pointers */ - ekey= *newkey; - for(k=0, hkey=newpa->hair; ktotkey; k++, hkey++, ekey++) { - ekey->co= hkey->co; - ekey->time= &hkey->time; - } - - /* map key positions as mirror over x axis */ - PE_mirror_particle(ob, psmd->dm, psys, pa, newpa); - - newpa++; - newkey++; - } - - edit->totkeys = psys_count_keys(psys); - } - - for(pa=psys->particles, i=0; itotpart; i++, pa++) - pa->flag &= ~PARS_TAG; - - MEM_freeN(mirrorfaces); - - if(!tagged) { - PE_recalc_world_cos(ob,psys); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - BIF_undo_push("Mirror particles"); - } -} - -void PE_selectbrush_menu(void) -{ - ParticleEditSettings *pset= PE_settings(); - int val; - - pupmenu_set_active(pset->brushtype); - - val= pupmenu("Select Brush%t|None %x0|Comb %x1|Smooth %x7|Weight %x6|Add %x5|Length %x3|Puff %x4|Cut %x2"); - - if(val>=0) { - pset->brushtype= val-1; - allqueue(REDRAWVIEW3D, 1); - } -} - -/************************************************/ -/* Particle Edit Undo */ -/************************************************/ -static void free_ParticleUndo(ParticleUndo *undo) -{ - ParticleData *pa; - int i; - - for(i=0, pa=undo->particles; itotpart; i++, pa++) { - if(pa->hair) - MEM_freeN(pa->hair); - if(undo->keys[i]) - MEM_freeN(undo->keys[i]); - } - if(undo->keys) - MEM_freeN(undo->keys); - - if(undo->particles) - MEM_freeN(undo->particles); - - //if(undo->emitter_cosnos) - // MEM_freeN(undo->emitter_cosnos); -} -static void make_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo) -{ - ParticleData *pa,*upa; - int i; - - undo->totpart = psys->totpart; - undo->totkeys = psys->edit->totkeys; - - upa = undo->particles = MEM_dupallocN(psys->particles); - undo->keys = MEM_dupallocN(psys->edit->keys); - - for(i=0, pa=psys->particles; itotpart; i++, pa++, upa++) { - upa->hair = MEM_dupallocN(pa->hair); - undo->keys[i] = MEM_dupallocN(psys->edit->keys[i]); - /* no need to update edit key->co & key->time pointers here */ - } -} -static void get_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo) -{ - ParticleData *pa, *upa; - ParticleEditKey *key; - HairKey *hkey; - int i, k, totpart = psys->totpart; - - LOOP_PARTICLES(i,pa) { - if(pa->hair) - MEM_freeN(pa->hair); - - if(psys->edit->keys[i]) - MEM_freeN(psys->edit->keys[i]); - } - if(psys->particles) - MEM_freeN(psys->particles); - if(psys->edit->keys) - MEM_freeN(psys->edit->keys); - if(psys->edit->mirror_cache) { - MEM_freeN(psys->edit->mirror_cache); - psys->edit->mirror_cache= NULL; - } - - pa = psys->particles = MEM_dupallocN(undo->particles); - psys->edit->keys = MEM_dupallocN(undo->keys); - - for(i=0,upa=undo->particles; itotpart; i++, upa++, pa++){ - hkey = pa->hair = MEM_dupallocN(upa->hair); - key = psys->edit->keys[i] = MEM_dupallocN(undo->keys[i]); - for(k=0; ktotkey; k++, hkey++, key++) { - key->co = hkey->co; - key->time = &hkey->time; - } - } - - psys->totpart = undo->totpart; - psys->edit->totkeys = undo->totkeys; -} -void PE_undo_push(char *str) -{ - ParticleSystem *psys = PE_get_current(OBACT); - ParticleEdit *edit = 0; - ParticleUndo *undo; - int nr; - - if(!PE_can_edit(psys)) return; - edit = psys->edit; - - /* remove all undos after (also when curundo==NULL) */ - while(edit->undo.last != edit->curundo) { - undo= edit->undo.last; - BLI_remlink(&edit->undo, undo); - free_ParticleUndo(undo); - MEM_freeN(undo); - } - - /* make new */ - edit->curundo= undo= MEM_callocN(sizeof(ParticleUndo), "particle undo file"); - strncpy(undo->name, str, 64-1); - BLI_addtail(&edit->undo, undo); - - /* and limit amount to the maximum */ - nr= 0; - undo= edit->undo.last; - while(undo) { - nr++; - if(nr==U.undosteps) break; - undo= undo->prev; - } - if(undo) { - while(edit->undo.first!=undo) { - ParticleUndo *first= edit->undo.first; - BLI_remlink(&edit->undo, first); - free_ParticleUndo(first); - MEM_freeN(first); - } - } - - /* copy */ - make_ParticleUndo(psys,edit->curundo); -} -void PE_undo_step(int step) -{ - ParticleSystem *psys = PE_get_current(OBACT); - ParticleEdit *edit = 0; - - if(!PE_can_edit(psys)) return; - edit=psys->edit; - - if(step==0) { - get_ParticleUndo(psys,edit->curundo); - } - else if(step==1) { - - if(edit->curundo==NULL || edit->curundo->prev==NULL) error("No more steps to undo"); - else { - if(G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name); - edit->curundo= edit->curundo->prev; - get_ParticleUndo(psys, edit->curundo); - } - } - else { - /* curundo has to remain current situation! */ - - if(edit->curundo==NULL || edit->curundo->next==NULL) error("No more steps to redo"); - else { - get_ParticleUndo(psys, edit->curundo->next); - edit->curundo= edit->curundo->next; - if(G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name); - } - } - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); -} -static void ParticleUndo_number(ParticleEdit *edit, int nr) -{ - ParticleUndo *undo; - int a=1; - - for(undo= edit->undo.first; undo; undo= undo->next, a++) { - if(a==nr) break; - } - edit->curundo= undo; - PE_undo_step(0); -} -static void ParticleUndo_clear(ParticleSystem *psys) -{ - ParticleUndo *undo; - ParticleEdit *edit; - - if(psys==0) return; - - edit = psys->edit; - - if(edit==0) return; - - undo= edit->undo.first; - while(undo) { - free_ParticleUndo(undo); - undo= undo->next; - } - BLI_freelistN(&edit->undo); - edit->curundo= NULL; -} -void PE_undo(void) -{ - PE_undo_step(1); -} -void PE_redo(void) -{ - PE_undo_step(-1); -} -void PE_undo_menu(void) -{ - ParticleSystem *psys = PE_get_current(OBACT); - ParticleEdit *edit = 0; - ParticleUndo *undo; - DynStr *ds; - short event; - char *menu; - - if(!PE_can_edit(psys)) return; - edit = psys->edit; - - ds= BLI_dynstr_new(); - - BLI_dynstr_append(ds, "Particlemode Undo History %t"); - - for(undo= edit->undo.first; undo; undo= undo->next) { - BLI_dynstr_append(ds, "|"); - BLI_dynstr_append(ds, undo->name); - } - - menu= BLI_dynstr_get_cstring(ds); - BLI_dynstr_free(ds); - - event= pupmenu_col(menu, 20); - MEM_freeN(menu); - - if(event>0) ParticleUndo_number(edit,event); -} - -void PE_get_colors(char sel[4], char nosel[4]) -{ - BIF_GetThemeColor3ubv(TH_EDGE_SELECT, sel); - BIF_GetThemeColor3ubv(TH_WIRE, nosel); -} - -int PE_minmax(float *min, float *max) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleSystemModifierData *psmd; - ParticleData *pa; - ParticleEditKey *key; - float co[3], mat[4][4]; - int i, k, totpart, ok = 0; - - if(!PE_can_edit(psys)) return ok; - - psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; - - LOOP_PARTICLES(i,pa){ - if(pa->flag&PARS_HIDE) continue; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - - LOOP_KEYS(k,key){ - if(key->flag&PEK_SELECT) { - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - DO_MINMAX(co, min, max); - ok= 1; - } - } - } - - if(!ok) { - minmax_object(ob, min, max); - ok= 1; - } - - return ok; -} - diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c deleted file mode 100644 index 35c0692510d..00000000000 --- a/source/blender/src/editscreen.c +++ /dev/null @@ -1,3818 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * All screen functions that are related to the interface - * handling and drawing. Might be split up as well later... - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "nla.h" - -#include -#include -#include /* isprint */ -#include -#include - -#include "GHOST_Types.h" - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_action_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_sound_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BLO_writefile.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_blender.h" -#include "BKE_screen.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_cursors.h" -#include "BIF_drawscene.h" -#include "BIF_editsound.h" -#include "BIF_glutil.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_mainqueue.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" -#include "BIF_renderwin.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" -#include "BIF_keyval.h" -#include "BIF_resources.h" - -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_seqaudio.h" -#include "BSE_view.h" - -#include "BPY_extern.h" -#include "mydevice.h" -#include "blendef.h" - -#include "winlay.h" - -/* TIPS: - * - * - WATCH THE EDGES, VERTICES HAVE TO BE IN ORDER... - (lowest pointer first). Otherwise unpredictable effects! - * - problem: flags here are not nicely implemented. After usage - always reset to zero. - */ - -/* comment added to test orange branch */ - -static void testareas(void); -static void area_autoplayscreen(void); -static void wait_for_event(void); - - -/* ********* Globals *********** */ - -static Window *mainwin= NULL; -static int prefsizx= 0, prefsizy= 0, prefstax= 0, prefstay= 0, start_maximized= 1; -static short dodrawscreen= 1; -static ScrArea *areawinar[MAXWIN]; -static ScrArea *g_activearea= NULL; -short winqueue_break= 0; -ScrArea *curarea= 0; - -/* prototypes -------------------*/ -int afterqtest(short win, unsigned short evt); -unsigned short screen_qread(short *val, char *ascii); -void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii); -static void drawscredge_area(ScrArea *sa); - -/**********************************************************************/ - -extern int textediting; - -static void screen_set_cursor(bScreen *sc) -{ - if (sc->winakt>3) { - ScrArea *sa= areawinar[sc->winakt]; - - set_cursor(sa->cursor); - } else { - set_cursor(CURSOR_STD); - } -} - -void waitcursor(int val) -{ - if(G.curscreen) { - if(val) { - set_cursor(CURSOR_WAIT); - } else { - screen_set_cursor(G.curscreen); - } - } -} - -static int choose_cursor(ScrArea *sa) -{ - if (sa->spacetype==SPACE_VIEW3D) { - if(G.obedit) return CURSOR_EDIT; - else if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)) - return CURSOR_VPAINT; - else if(FACESEL_PAINT_TEST) return CURSOR_FACESEL; - else if(G.f & G_SCULPTMODE) return CURSOR_EDIT; - else if(G.f & G_PARTICLEEDIT) return CURSOR_EDIT; - else return CURSOR_STD; - } - else if (sa->spacetype==SPACE_TEXT) { - return CURSOR_TEXTEDIT; - } - else { - return CURSOR_STD; - } -} - -void wich_cursor(ScrArea *sa) -{ - sa->cursor= choose_cursor(sa); - - /* well... the waitcursor() is not a state, so this call will cancel it out */ - if(get_cursor()!=CURSOR_WAIT) - screen_set_cursor(G.curscreen); -} - - -void setcursor_space(int spacetype, short cur) -{ - bScreen *sc; - ScrArea *sa; - - for (sc= G.main->screen.first; sc; sc= sc->id.next) - for (sa= sc->areabase.first; sa; sa= sa->next) - if(sa->spacetype==spacetype) - sa->cursor= cur; - - screen_set_cursor(G.curscreen); -} - - -/* ********* IN/OUT ************* */ - -void getmouseco_sc(short *mval) /* screen coordinates */ -{ - getmouse(mval); -} - -/* mouse_cursor called during a script (via Window.QHandle) need - * this function for getmouseco_areawin to work: */ -void set_g_activearea(ScrArea *sa) -{ - if (sa) g_activearea = sa; -} - -void getmouseco_areawin(short *mval) /* internal area coordinates */ -{ - getmouseco_sc(mval); - - if(g_activearea && g_activearea->win) { - mval[0]-= g_activearea->winrct.xmin; - mval[1]-= g_activearea->winrct.ymin; - } -} - -void getmouseco_headwin(short *mval) /* internal area coordinates */ -{ - getmouseco_sc(mval); - - if(g_activearea && g_activearea->headwin) { - mval[0]-= g_activearea->headrct.xmin; - mval[1]-= g_activearea->headrct.ymin; - } -} - -void headerprint(char *str) -{ - if(curarea->headertype) { - areawinset(curarea->headwin); - - headerbox(curarea); - - BIF_ThemeColor(TH_MENU_TEXT); /* better than cpack(0x0) color no? (desoto) */ - glRasterPos2i(20+curarea->headbutofs, 6); - BMF_DrawString(G.font, str); - - curarea->head_swap= WIN_BACK_OK; - areawinset(curarea->win); - } - else { - // dunno... thats for later (ton) - } -} - -/* *********** STUFF ************** */ - -static int scredge_is_horizontal(ScrEdge *se) -{ - return (se->v1->vec.y == se->v2->vec.y); -} - -static ScrEdge *screen_find_active_scredge(bScreen *sc, short *mval) -{ - ScrEdge *se; - - for (se= sc->edgebase.first; se; se= se->next) { - if (scredge_is_horizontal(se)) { - short min, max; - min= MIN2(se->v1->vec.x, se->v2->vec.x); - max= MAX2(se->v1->vec.x, se->v2->vec.x); - - if (abs(mval[1]-se->v1->vec.y)<=2 && mval[0] >= min && mval[0]<=max) - return se; - } - else { - short min, max; - min= MIN2(se->v1->vec.y, se->v2->vec.y); - max= MAX2(se->v1->vec.y, se->v2->vec.y); - - if (abs(mval[0]-se->v1->vec.x)<=2 && mval[1] >= min && mval[1]<=max) - return se; - } - } - - return NULL; -} - -void areawinset(short win) -{ - if(win>3) { - curarea= areawinar[win]; - if(curarea==0) { - printf("error in areawinar %d ,areawinset\n", win); - return; - } - - BIF_SetTheme(curarea); - - switch(curarea->spacetype) { - case SPACE_VIEW3D: - G.vd= curarea->spacedata.first; - break; - case SPACE_IPO: - G.sipo= curarea->spacedata.first; - G.v2d= &G.sipo->v2d; - break; - case SPACE_BUTS: - G.buts= curarea->spacedata.first; - G.v2d= &G.buts->v2d; - break; - case SPACE_SEQ: { - SpaceSeq *sseq= curarea->spacedata.first; - G.v2d= &sseq->v2d; - break; - } - case SPACE_OOPS: - G.soops= curarea->spacedata.first; - G.v2d= &G.soops->v2d; - break; - case SPACE_IMAGE: - G.sima= curarea->spacedata.first; - G.v2d= &G.sima->v2d; - break; - case SPACE_SOUND: - G.ssound= curarea->spacedata.first; - G.v2d= &G.ssound->v2d; - break; - case SPACE_ACTION: - G.saction= curarea->spacedata.first; - G.v2d= &G.saction->v2d; - break; - case SPACE_NLA: - G.snla= curarea->spacedata.first; - G.v2d= &G.snla->v2d; - break; - case SPACE_TIME: - { - SpaceTime *stime= curarea->spacedata.first; - G.v2d= &stime->v2d; - } - break; - case SPACE_NODE: - { - SpaceNode *snode= curarea->spacedata.first; - G.v2d= &snode->v2d; - } - break; - case SPACE_IMASEL: - { - SpaceImaSel *simasel= curarea->spacedata.first; - G.v2d= &simasel->v2d; - } - default: - break; - } - } - - if(win) mywinset(win); -} - -#define SCR_BACK 0.55 -#define SCR_ROUND 12 - -void headerbox(ScrArea *area) -{ - float width= area->winx; - int active=0; - - glClearColor(SCR_BACK, SCR_BACK, SCR_BACK, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - active= area_is_active_area(area); - - if(active) BIF_ThemeColor(TH_HEADER); - else BIF_ThemeColor(TH_HEADERDESEL); - - /* weird values here... is because of window matrix that centers buttons */ - if(area->headertype==HEADERTOP) { - uiSetRoundBox(3); - uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active); - } - else { - uiSetRoundBox(12); - uiRoundBoxEmboss(-0.5+area->headbutofs, -3.5, width-1.5+area->headbutofs, HEADERY+10, SCR_ROUND, active); - } - - uiSetRoundBox(15); -} - -int area_is_active_area(ScrArea *area) -{ - return (g_activearea && area==g_activearea); -} - -void scrarea_do_headdraw(ScrArea *area) -{ - if (area->headertype) { - areawinset(area->headwin); - - headerbox(area); - - /* we make scissor test slightly smaller not to destroy rounded headers */ - glScissor(area->headrct.xmin+5, area->headrct.ymin, area->winx-10, HEADERY); - - switch(area->spacetype) { - case SPACE_FILE: file_buttons(); break; - case SPACE_INFO: info_buttons(); break; - case SPACE_VIEW3D: view3d_buttons(); break; - case SPACE_IPO: ipo_buttons(); break; - case SPACE_BUTS: buts_buttons(); break; - case SPACE_SEQ: seq_buttons(); break; - case SPACE_IMAGE: image_buttons(); break; - case SPACE_IMASEL: imasel_buttons(); break; - case SPACE_OOPS: oops_buttons(); break; - case SPACE_TEXT: text_buttons(); break; - case SPACE_SCRIPT:script_buttons(); break; - case SPACE_SOUND: sound_buttons(); break; - case SPACE_ACTION: action_buttons(); break; - case SPACE_NLA: nla_buttons(); break; - case SPACE_TIME: time_buttons(area); break; - case SPACE_NODE: node_buttons(area); break; - } - uiClearButLock(); - - //glScissor(area->winrct.xmin, area->winrct.xmax, area->winx, area->winy); - area->head_swap= WIN_BACK_OK; - } -} -void scrarea_do_headchange(ScrArea *area) -{ - float ofs= area->headbutofs; - - if (area->headertype==HEADERDOWN) { - bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -3.375, area->headrct.ymax-area->headrct.ymin-3.375+1.0); - } else if (area->headertype==HEADERTOP) { - bwin_ortho2(area->headwin, -0.375+ofs, area->headrct.xmax-area->headrct.xmin-0.375+ofs, -2.375-1.0, area->headrct.ymax-area->headrct.ymin-2.375); - } -} - - -static void openheadwin(ScrArea *sa); -static void closeheadwin(ScrArea *sa); - -static void scrarea_change_headertype(ScrArea *sa, int newtype) -{ - sa->headertype= newtype; - - if (!newtype) { - if (sa->headwin) { - uiFreeBlocksWin(&sa->uiblocks, sa->headwin); - closeheadwin(sa); - } - } else { - if (!sa->headwin) { - openheadwin(sa); - } - } - - testareas(); - mainqenter(DRAWEDGES, 1); - winqueue_break= 1; -} - -static void headmenu(ScrArea *sa) -{ - short val= pupmenu("Header %t|Top%x2|Bottom %x1|No Header %x0"); - - if(val> -1) { - scrarea_change_headertype(sa, val); - } -} - -static void addqueue_ext(short win, unsigned short event, short val, char ascii) -{ - if (win<4 || !areawinar[win]) { - /* other win ids are for mainwin & renderwin */ - } - else { - BWinEvent evt; - - memset(&evt, 0, sizeof(evt)); - evt.event= event; - evt.val= val; - evt.ascii= ascii; - - bwin_qadd(win, &evt); - } -} - -void addqueue(short win, unsigned short event, short val) -{ - addqueue_ext(win, event, val, 0); -} - -void scrarea_queue_winredraw(ScrArea *area) -{ - addqueue(area->win, REDRAW, 1); -} -void scrarea_queue_headredraw(ScrArea *area) -{ - if (area->headwin) addqueue(area->headwin, REDRAW, 1); -} -void scrarea_queue_redraw(ScrArea *area) -{ - scrarea_queue_winredraw(area); - scrarea_queue_headredraw(area); -} - -static void scrollheader(ScrArea *area); -static void scrarea_dispatch_header_events(ScrArea *sa) -{ - ScrArea *tempsa; - BWinEvent evt; - short do_redraw=0, do_change=0; - - areawinset(sa->headwin); - - while(bwin_qread(sa->headwin, &evt)) { - if(evt.val) { - if( uiDoBlocks(&curarea->uiblocks, evt.event, 1)!=UI_NOTHING ) evt.event= 0; - - switch(evt.event) { - case UI_BUT_EVENT: - do_headerbuttons(evt.val); - break; - - case LEFTMOUSE: - if (G.qual & LR_CTRLKEY) { - window_lower(mainwin); - } else { - window_raise(mainwin); - } - break; - - case MIDDLEMOUSE: - scrollheader(sa); - break; - case RIGHTMOUSE: - headmenu(sa); - break; - case REDRAW: - do_redraw= 1; - break; - case CHANGED: - sa->head_swap= 0; - do_change= 1; - do_redraw= 1; - break; - default: - if (winqueue_break == 0) { - scrarea_do_winhandle(sa, &evt); - if (winqueue_break == 0) areawinset(sa->headwin); - } - } - - if(winqueue_break) return; - } - } - - /* test: does window still exist? */ - tempsa= areawinar[sa->headwin]; - if(tempsa==0) return; - - /* this functional separation does not work as well as i expected... */ - if(do_change) scrarea_do_headchange(sa); - if(do_redraw) scrarea_do_headdraw(sa); -} - -static void scrarea_dispatch_events(ScrArea *sa) -{ - ScrArea *tempsa; - BWinEvent evt; - short do_redraw=0, do_change=0; - - if(sa!=curarea || sa->win!=mywinget()) areawinset(sa->win); - - while(bwin_qread(sa->win, &evt)) { - if(evt.event==REDRAW) { - do_redraw= 1; - } - else if(evt.event==CHANGED) { - sa->win_swap= 0; - do_change= 1; - do_redraw= 1; - } - else { - scrarea_do_winhandle(sa, &evt); - } - - if(winqueue_break) return; - } - - /* test: does window still exist */ - tempsa= areawinar[sa->win]; - if(tempsa==0) return; - - if (do_change || do_redraw) { - areawinset(sa->win); - if(do_change) - scrarea_do_winchange(curarea); - if(do_redraw) - scrarea_do_windraw(curarea); - } -} - -/***/ - - -void markdirty_all() -{ - ScrArea *sa; - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->win) { - scrarea_queue_winredraw(sa); - sa->win_swap &= ~WIN_FRONT_OK; - } - if(sa->headwin) { - scrarea_queue_headredraw(sa); - sa->head_swap &= ~WIN_FRONT_OK; - } - } -} - -/* but no redraw! */ -void markdirty_all_back(void) -{ - ScrArea *sa; - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->win) { - sa->win_swap &= ~WIN_BACK_OK; - } - if(sa->headwin) { - sa->head_swap &= ~WIN_BACK_OK; - } - } - - /* if needed; backbuffer selection redraw */ - if(G.vd) G.vd->flag |= V3D_NEEDBACKBUFDRAW; - -} - -void markdirty_win_back(short winid) -{ - ScrArea *sa= areawinar[winid]; - if(sa) { - if(sa->win==winid) sa->win_swap &= ~WIN_BACK_OK; - else sa->head_swap &= ~WIN_BACK_OK; - } -} - - -int is_allowed_to_change_screen(bScreen *new) -{ - /* not when curscreen is full - * not when obedit && old->scene!=new->scene - */ - - if(new==0) return 0; - if(G.curscreen->full != SCREENNORMAL) return 0; - if(curarea->full) return 0; - if(G.obedit) { - if(G.curscreen->scene!=new->scene) return 0; - } - return 1; -} - -void splash(void *data, int datasize, char *string) -{ - ImBuf *bbuf; - int oldwin; - short val; - - bbuf= IMB_ibImageFromMemory((int *)data, datasize, IB_rect); - - if (bbuf) { - oldwin = mywinget(); - mywinset(G.curscreen->mainwin); - - if (string) { - int x, y, maxy; - unsigned int *rect; - - rect = bbuf->rect; - maxy = MIN2(bbuf->y, 18); - - for (y = 0; y < maxy; y++) { - for (x = 0; x < bbuf->x; x++) { - *rect = 0xffffffff; - rect++; - } - } - } - glDrawBuffer(GL_FRONT); - - uiDrawBoxShadow(200, (prefsizx-bbuf->x)/2, (prefsizy-bbuf->y)/2, (prefsizx+bbuf->x)/2, (prefsizy+bbuf->y)/2); - - glRasterPos2i((prefsizx-bbuf->x)/2, (prefsizy-bbuf->y)/2); - glDrawPixels(bbuf->x, bbuf->y, GL_RGBA, GL_UNSIGNED_BYTE, bbuf->rect); - - if (string) { - void *font; - int width; - - if (BMF_GetStringWidth(font= G.font, string) > bbuf->x) - if (BMF_GetStringWidth(font= G.fonts, string) > bbuf->x) - font= G.fontss; - - width= BMF_GetStringWidth(font, string); - - glColor3ub(0, 0, 0); - glRasterPos2i((prefsizx-width)/2, (prefsizy-bbuf->y)/2 + 6); - BMF_DrawString(font, string); - } - - bglFlush(); - glDrawBuffer(GL_BACK); - - IMB_freeImBuf(bbuf); - - // flush input buffers .... - // this might break some things - - while (get_mbut()) { - BIF_wait_for_statechange(); - } - while(qtest()) { - extern_qread(&val); - } - - wait_for_event(); - - mywinset(oldwin); - markdirty_all(); - mainqenter(DRAWEDGES, 1); - } -} - -static void moveareas(ScrEdge *edge); -static void joinarea_interactive(ScrArea *area, ScrEdge *onedge); -static void splitarea_interactive(ScrArea *area, ScrEdge *onedge); -static ScrArea *test_edge_area(ScrArea *sa, ScrEdge *se); -static ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2); - -static int isjoinable(ScrArea *area, ScrEdge *onedge) -{ - struct ScrArea *sa1 = area, *sa2; - struct ScrEdge *se; - - sa1 = test_edge_area(sa1, onedge); - if(sa1==0) return 0; - - /* find directions with same edge */ - sa2= G.curscreen->areabase.first; - while(sa2) { - if(sa2 != sa1) { - se= screen_findedge(G.curscreen, sa2->v1, sa2->v2); - if(onedge==se) return 1; - se= screen_findedge(G.curscreen, sa2->v2, sa2->v3); - if(onedge==se) return 1; - se= screen_findedge(G.curscreen, sa2->v3, sa2->v4); - if(onedge==se) return 1; - se= screen_findedge(G.curscreen, sa2->v4, sa2->v1); - if(onedge==se) return 1; - } - sa2= sa2->next; - } - - return 0; -} - -static void screen_edge_edit_event(ScrArea *actarea, ScrEdge *actedge, short evt, short val) -{ - if (val) { - // don't allow users to edit full screens - if (actarea && actarea->full) - return; - - if (evt==LEFTMOUSE) { - moveareas(actedge); - } else if (evt==MIDDLEMOUSE || evt==RIGHTMOUSE) { - int edgeop; - char str[64] = "Split Area%x1|"; - - if(isjoinable(actarea, actedge)) strcat(str, "Join Areas%x2|"); - if (actarea->headertype) strcat(str, "No Header%x3"); - else strcat(str, "Add Header%x3"); - - edgeop= pupmenu(str); - if (edgeop==1) splitarea_interactive(actarea, actedge); - else if (edgeop==2) joinarea_interactive(actarea, actedge); - else if (edgeop==3) scrarea_change_headertype(actarea, - actarea->headertype?0:HEADERDOWN); - } - else blenderqread(evt, val); // global hotkeys - } -} - -/***/ - -extern void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey); -void test_scale_screen(bScreen *); - -static void resize_screens(int x, int y, int w, int h) { - prefstax= x; - prefstay= y; - prefsizx= w; - prefsizy= h; - - test_scale_screen(G.curscreen); - testareas(); -} - -static void init_mainwin(void) -{ - int orx, ory, sizex, sizey; - - glEnable(GL_SCISSOR_TEST); - - window_get_position(mainwin, &orx, &ory); - window_get_size(mainwin, &sizex, &sizey); - - /* XXX, temporary stupid fix for minimize at windows */ - if (!sizex && !sizey) { - return; - } - - mywindow_init_mainwin(mainwin, orx, ory, sizex, sizey); - resize_screens(orx, ory, sizex, sizey); -} - -/***/ - -static short afterqueue[MAXQUEUE][3]; -static int nafterqitems= 0; - -void addafterqueue(short win, unsigned short evt, short val) -{ - if (nafterqitemsr.cfra); -} - -static short ext_reshape= 0, ext_redraw=0, ext_inputchange=0, ext_mousemove=0, ext_undopush=0; - -static void flush_extqd_events(void) { - if (ext_inputchange) { - mainqenter(INPUTCHANGE, ext_inputchange); - } else if (ext_reshape) { - mainqenter(RESHAPE, ext_redraw); - } else if (ext_redraw) { - mainqenter(REDRAW, ext_redraw); - } else if (ext_undopush) { - mainqenter(UNDOPUSH, ext_undopush); - } else if (ext_mousemove) { - short mouse[2]; - - getmouseco_sc(mouse); - - mainqenter(MOUSEX, mouse[0]); - mainqenter(MOUSEY, mouse[1]); - } - - ext_inputchange= ext_reshape= ext_redraw= ext_mousemove= ext_undopush= 0; -} - -int qtest(void) -{ - if (!mainqtest()) { - winlay_process_events(0); - } - - return mainqtest(); -} - - /* return true if events are waiting anywhere */ -int anyqtest(void) -{ - ScrArea *sa; - - if (nafterqitems || qtest()) return 1; - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if (bwin_qtest(sa->win)) return 1; - if (sa->headwin && bwin_qtest(sa->headwin)) return 1; - } - - return 0; -} - -static void wait_for_event(void) -{ - while (!mainqtest()) { - winlay_process_events(1); - } -} - -unsigned short screen_qread(short *val, char *ascii) -{ - unsigned short event; - - wait_for_event(); - - event= mainqread(val, ascii); - - if(event==RIGHTSHIFTKEY || event==LEFTSHIFTKEY) { - if(*val) G.qual |= LR_SHIFTKEY; - else G.qual &= ~LR_SHIFTKEY; - } - else if(event==RIGHTALTKEY || event==LEFTALTKEY) { - if(*val) G.qual |= LR_ALTKEY; - else G.qual &= ~LR_ALTKEY; - } - else if(event==RIGHTCTRLKEY || event==LEFTCTRLKEY) { - if(*val) G.qual |= LR_CTRLKEY; - else G.qual &= ~LR_CTRLKEY; - } - else if(event==COMMANDKEY) { // OSX - if(*val) G.qual |= LR_COMMANDKEY; - else G.qual &= ~LR_COMMANDKEY; - } - - return event; -} - -unsigned short extern_qread_ext(short *val, char *ascii) -{ - /* stores last INPUTCHANGE and last REDRAW */ - unsigned short event; - - event= screen_qread(val, ascii); - if(event==RESHAPE) ext_reshape= *val; - else if(event==REDRAW) ext_redraw= *val; - else if(event==UNDOPUSH) ext_undopush= *val; - else if(event==INPUTCHANGE) ext_inputchange= *val; - else if(event==MOUSEY || event==MOUSEX) ext_mousemove= 1; - else if((G.qual & (LR_CTRLKEY|LR_ALTKEY)) && event==F3KEY) { - if(*val) { - BIF_screendump(0); - return ESCKEY; /* go out of menu, if that was set */ - } - } - - return event; -} -unsigned short extern_qread(short *val) -{ - char ascii; - return extern_qread_ext(val, &ascii); -} - -int blender_test_break(void) -{ - if (!G.background) { - static double ltime= 0; - double curtime= PIL_check_seconds_timer(); - - /* only check for breaks every 10 milliseconds - * if we get called more often. - */ - if ((curtime-ltime)>.001) { - ltime= curtime; - - while(qtest()) { - short val; - if (extern_qread(&val) == ESCKEY) { - G.afbreek= 1; - } - } - } - } - - return (G.afbreek==1); -} - -void reset_autosave(void) { - window_set_timer(mainwin, U.savetime*60*1000, AUTOSAVE_FILE); -} - -/* ************ handlers ************** */ - -/* don't know yet how the handlers will evolve, for simplicity -i choose for an array with eventcodes, this saves in a file! -*/ -void add_screenhandler(bScreen *sc, short eventcode, short val) -{ - short a; - - // find empty spot - for(a=0; ahandler[a]==eventcode ) { - sc->handler[a+1]= val; - break; - } - else if( sc->handler[a]==0) { - sc->handler[a]= eventcode; - sc->handler[a+1]= val; - break; - } - } - if(a==SCREEN_MAXHANDLER) printf("error; max (4) screen handlers reached!\n"); -} - -void rem_screenhandler(bScreen *sc, short eventcode) -{ - short a; - - for(a=0; ahandler[a]==eventcode) { - sc->handler[a]= 0; - break; - } - } -} - -int has_screenhandler(bScreen *sc, short eventcode) -{ - short a; - - for(a=0; ahandler[a]==eventcode) { - return 1; - } - } - return 0; -} - -static void animated_screen(bScreen *sc, short val) -{ - if ((val & TIME_WITH_SEQ_AUDIO)) { - if(CFRA>=PEFRA) { - CFRA= PSFRA; - audiostream_stop(); - audiostream_start( CFRA ); - } - else { - int cfra = audiostream_pos(); - if(cfra <= CFRA) CFRA++; - else CFRA= cfra; - } - } - else { - CFRA++; - if(CFRA > PEFRA) CFRA= PSFRA; - } - - update_for_newframe_nodraw(1); - - if(val & TIME_ALL_3D_WIN) - allqueue(REDRAWVIEW3D, 0); - else if(val & TIME_LEFTMOST_3D_WIN) { - ScrArea *sa= sc->areabase.first, *samin=NULL; - int min= 10000; - for(; sa; sa= sa->next) { - if(sa->spacetype==SPACE_VIEW3D) { - if(sa->winrct.xmin - sa->winrct.ymin < min) { - samin= sa; - min= sa->winrct.xmin - sa->winrct.ymin; - } - } - } - if(samin) scrarea_queue_winredraw(samin); - } - if(val & TIME_ALL_ANIM_WIN) allqueue(REDRAWANIM, 0); - if(val & TIME_ALL_BUTS_WIN) allqueue(REDRAWBUTSALL, 0); - if(val & TIME_SEQ) { - allqueue(REDRAWSEQ, 0); - } - - allqueue(REDRAWTIME, 0); -} - -/* because we still have to cope with subloops, this function is called -in viewmove() for example too */ - -/* returns 1 if something was handled */ -/* restricts to frames-per-second setting for frequency of updates */ -int do_screenhandlers(bScreen *sc) -{ - static double ltime=0.0; - double swaptime, time; - short a, done= 0; - - time = PIL_check_seconds_timer(); - swaptime= 1.0/FPS; - - /* only now do the handlers */ - if(swaptime < time-ltime || ltime==0.0) { - - ltime= time; - - for(a=0; ahandler[a]) { - case SCREEN_HANDLER_ANIM: - animated_screen(sc, sc->handler[a+1]); - done= 1; - break; - case SCREEN_HANDLER_PYTHON: - done= 1; - break; - case SCREEN_HANDLER_VERSE: -#ifdef WITH_VERSE - b_verse_update(); -#endif - - done= 1; - break; - } - } - } - else if( qtest()==0) PIL_sleep_ms(5); // 5 milliseconds pause, for idle - - /* separate check for if we need to add to afterqueue */ - /* is only to keep mainqueue awqke */ - for(a=0; ahandler[a]) { - ScrArea *sa= sc->areabase.first; - if(sa->headwin) addafterqueue(sa->headwin, SCREEN_HANDLER, 1); - else addafterqueue(sa->win, SCREEN_HANDLER, 1); - } - } - - return done; -} - -/* ****** end screen handlers ************ */ - -static void drawscreen(void) -{ - ScrArea *sa; - - mywinset(G.curscreen->mainwin); - myortho2(-0.375, (float)G.curscreen->sizex-0.375, -0.375, (float)G.curscreen->sizey-0.375); - - sa= G.curscreen->areabase.first; - while(sa) { - drawscredge_area(sa); - sa= sa->next; - } - - /* this double draw patch seems to be needed for certain sgi's (octane, indigo2) */ -#if defined(__sgi) || defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) - glDrawBuffer(GL_FRONT); - - sa= G.curscreen->areabase.first; - while(sa) { - drawscredge_area(sa); - sa= sa->next; - } - - glDrawBuffer(GL_BACK); -#endif -} - -static void screen_dispatch_events(void) { - int events_remaining= 1; - ScrArea *sa; - - window_make_active(mainwin); // added it here instead of screenmain (ton) - - while (events_remaining) { - events_remaining= 0; - - winqueue_break= 0; - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - /* first check header, then rest. Header sometimes has initialization code */ - if (sa->headwin && bwin_qtest(sa->headwin)) { - scrarea_dispatch_header_events(sa); - events_remaining= 1; - } - if (winqueue_break) break; - - if (bwin_qtest(sa->win)) { - scrarea_dispatch_events(sa); - events_remaining= 1; - } - if (winqueue_break) break; - } - - if (winqueue_break) break; - } - - /* winqueue_break isnt the best of all solutions... but it is called on switching screens, - so drawing should wait for all redraw/init events to be handled */ - if (winqueue_break==0) { - if (dodrawscreen) { - drawscreen(); - dodrawscreen= 0; - } - - screen_swapbuffers(); - do_screenhandlers(G.curscreen); - } -} - -static ScrArea *screen_find_area_for_pt(bScreen *sc, short *mval) -{ - ScrArea *sa; - - /* hotspot area of 1 pixel extra */ - - for (sa= sc->areabase.first; sa; sa= sa->next) { - if( sa->totrct.xmin + 1 < mval[0] ) - if( sa->totrct.ymin + 1 < mval[1] ) - if( sa->totrct.xmax - 1 > mval[0] ) - if( sa->totrct.ymax - 1 > mval[1] ) - return sa; - } - return NULL; -} - -/* ugly yah, will disappear on better event system */ -/* is called from interface.c after button events */ -static char delayed_undo_name[64]; -void screen_delayed_undo_push(char *name) -{ - strncpy(delayed_undo_name, name, 63); - mainqenter(UNDOPUSH, 1); -} - -void screenmain(void) -{ - int has_input= 1; - int firsttime = 1; - int onload_script = 0; - - window_make_active(mainwin); - - while (1) { - unsigned short event; - short val, towin; - char ascii; - - flush_extqd_events(); - if (nafterqitems && !qtest()) { - append_afterqueue(); - event= val= ascii= 0; - } else { - event= screen_qread(&val, &ascii); - } - - // window_make_active(mainwin); // (only for inputchange, removed, (ton)) - - if (event==INPUTCHANGE) { - window_make_active(mainwin); - G.qual= get_qual(); - } - - /* If the main window is active, find the current active ScrArea - * underneath the mouse cursor, updating the headers & cursor for - * the appropriate internal window if things have changed. - * - * If the main window is not active, deactivate the internal - * window. - */ - if (has_input || g_activearea==NULL || G.curscreen->winakt) { - ScrArea *newactarea; - int newactwin; - short mval[2]; - - getmouseco_sc(mval); - newactarea= screen_find_area_for_pt(G.curscreen, mval); - - if (newactarea) { - if (BLI_in_rcti(&newactarea->headrct, mval[0], mval[1])) { - newactwin= newactarea->headwin; - set_cursor(CURSOR_STD); - } else { - newactwin= newactarea->win; - } - } else { - newactwin= 0; - } - - if (newactarea && (newactarea != g_activearea)) { - if (g_activearea) scrarea_queue_headredraw(g_activearea); - scrarea_queue_headredraw(newactarea); - if (!(BLI_in_rcti(&newactarea->headrct, mval[0], mval[1]))) /* header always gets std cursor */ - set_cursor(newactarea->cursor); - g_activearea= newactarea; - } - /* when you move mouse from header to window, buttons can remain hilited otherwise */ - if(newactwin != G.curscreen->winakt) { - if (g_activearea) scrarea_queue_headredraw(g_activearea); - } - G.curscreen->winakt= newactwin; - - if (G.curscreen->winakt) { - areawinset(G.curscreen->winakt); - if (!(BLI_in_rcti(&newactarea->headrct, mval[0], mval[1]))) /* header always gets std cursor */ - set_cursor(choose_cursor(g_activearea)); - } - } - else { - if (g_activearea) { - scrarea_queue_headredraw(g_activearea); - } - g_activearea= NULL; - G.curscreen->winakt= 0; - } - - towin= 0; - if (event==WINCLOSE) { - exit_usiblender(); - } - else if (event==DRAWEDGES) { - dodrawscreen= 1; - } - else if (event==RESHAPE) { - init_mainwin(); - markdirty_all(); - dodrawscreen= 1; - } - else if (event==REDRAW) { - markdirty_all(); - dodrawscreen= 1; - } - else if( event==UNDOPUSH) { - BIF_undo_push(delayed_undo_name); - } - else if (event==AUTOSAVE_FILE) { - BIF_write_autosave(); - } - else if (event==LOAD_FILE) { - BIF_read_file(ext_load_str); - sound_initialize_sounds(); - } - else if ((event==ONLOAD_SCRIPT) && BPY_has_onload_script()) { - /* event queued in setup_app_data() in blender.c, where G.f is checked */ - onload_script = 1; - firsttime = 1; /* see last 'if' in this function */ - } - else { - towin= 1; - } - - if (!g_activearea) { - towin= 0; - } - else if (event==QKEY) { - if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT); - else { - if(val && (G.qual & LR_CTRLKEY)) { - if(okee("Quit Blender")) exit_usiblender(); - } - towin= 0; - } - } - else if (event==RIGHTARROWKEY) { - if(textediting==0 && val && (G.qual & LR_CTRLKEY)) { - bScreen *sc= G.curscreen->id.next; - - /* if screen is last, set it to first */ - if(sc == NULL) - sc= G.main->screen.first; - - if(is_allowed_to_change_screen(sc)) setscreen(sc); - g_activearea= NULL; - towin= 0; - } - } - else if (event==LEFTARROWKEY) { - if(textediting==0 && val && (G.qual & LR_CTRLKEY)) { - bScreen *sc= G.curscreen->id.prev; - - /* if screen is first, set it to last */ - if(sc == NULL) - sc= G.main->screen.last; - - if(is_allowed_to_change_screen(sc)) setscreen(sc); - g_activearea= NULL; - towin= 0; - } - } - else if (!G.curscreen->winakt) { - ScrEdge *actedge; - short mval[2]; - - getmouseco_sc(mval); - actedge= screen_find_active_scredge(G.curscreen, mval); - - if (actedge) { - if (scredge_is_horizontal(actedge)) { - set_cursor(CURSOR_Y_MOVE); - } else { - set_cursor(CURSOR_X_MOVE); - } - // this does global hotkeys too - screen_edge_edit_event(g_activearea, actedge, event, val); - } else { - set_cursor(CURSOR_STD); - } - - towin= 0; - } - else if (event==ZKEY) { - if(val && G.qual==(LR_ALTKEY|LR_SHIFTKEY|LR_CTRLKEY)) { - extern void set_debug_swapbuffers_ovveride(bScreen *sc, int mode); - - int which= pupmenu("Swapbuffers%t|Simple|Debug|DebugSwap|Redraw|Default|KillSwap"); - - switch (which) { - case 1: set_debug_swapbuffers_ovveride(G.curscreen, 's'); break; - case 2: set_debug_swapbuffers_ovveride(G.curscreen, 'd'); break; - case 3: set_debug_swapbuffers_ovveride(G.curscreen, 'f'); break; - case 4: set_debug_swapbuffers_ovveride(G.curscreen, 'r'); break; - case 5: set_debug_swapbuffers_ovveride(G.curscreen, 0); break; - case 6: - if (g_activearea) { - g_activearea->head_swap= 0; - g_activearea->win_swap= 0; - } - break; - } - towin= 0; - } - } - else if (event==SPACEKEY) { - if ((g_activearea->spacetype!=SPACE_TEXT) && - ( !((g_activearea->spacetype==SPACE_VIEW3D) && ((G.obedit) && G.obedit->type==OB_FONT)) ) && - val && - (G.qual & LR_SHIFTKEY)) { - area_fullscreen(); - g_activearea= NULL; - towin= 0; - } - else { - if((G.obedit && G.obedit->type==OB_FONT && g_activearea->spacetype==SPACE_VIEW3D)||g_activearea->spacetype==SPACE_TEXT||g_activearea->spacetype==SPACE_SCRIPT||g_activearea->spacetype==SPACE_SEQ); - else if(G.qual==0) { - if(val) toolbox_n(); - towin= 0; - } - } - } - else if(ELEM(event, UPARROWKEY, DOWNARROWKEY)) { - if(val && (G.qual & LR_CTRLKEY)) { - area_fullscreen(); - g_activearea= NULL; - towin= 0; - } - } - - if (towin && event) { - if (blenderqread(event, val)) // the global keys - addqueue_ext(G.curscreen->winakt, event, val, ascii); - } - - /* only process subwindow queue's once the - * main queue has been emptyied. - */ - event= qtest(); - if (event==0 || event==EXECUTE) { - screen_dispatch_events(); - } - - if(G.f & G_DEBUG) { - GLenum error = glGetError(); - if (error) - printf("GL error: %s\n", gluErrorString(error)); - } - /* Bizar hack. The event queue has mutated... */ - if ( (firsttime) && (event == 0) ) { - - if (onload_script) { - /* OnLoad scriptlink */ - BPY_do_pyscript(&G.scene->id, SCRIPT_ONLOAD); - onload_script = 0; - } - else if (G.fileflags & G_FILE_AUTOPLAY) { - // SET AUTOPLAY in G.flags for - // other fileloads - - G.flags |= G_FILE_AUTOPLAY; - area_autoplayscreen(); - - // Let The Games Begin - // fake a 'p' keypress - - mainqenter(PKEY, 1); - } else { - extern char datatoc_splash_jpg[]; - extern int datatoc_splash_jpg_size; - - //if (! ((G.main->versionfile >= G.version) - // || G.save_over)) { - splash((void *)datatoc_splash_jpg, - datatoc_splash_jpg_size, NULL); - //} - } - firsttime = 0; - } - } -} - -#if 0 -//#ifdef _WIN32 // FULLSCREEN -void mainwindow_toggle_fullscreen(int fullscreen) -{ - if (fullscreen) U.uiflag |= USER_FLIPFULLSCREEN; - else U.uiflag &= ~USER_FLIPFULLSCREEN; - - window_toggle_fullscreen(mainwin, fullscreen); -} -#endif - -void mainwindow_raise(void) -{ - if(mainwin) - window_raise(mainwin); -} - -void mainwindow_make_active(void) -{ - if(mainwin) - window_make_active(mainwin); -} - -void mainwindow_close(void) -{ - if(mainwin) - window_destroy(mainwin); - mainwin= NULL; -} - -void mainwindow_set_filename_to_title(char *filename) -{ - char str[FILE_MAXDIR + FILE_MAXFILE]; - char dir[FILE_MAXDIR]; - char file[FILE_MAXFILE]; - - BLI_split_dirfile(filename, dir, file); - - if(BLI_streq(file, ".B.blend") || filename[0] =='\0') - sprintf(str, "Blender"); - else - sprintf(str, "Blender [%s]", filename); - - window_set_title(mainwin, str); -} - -/* ********* AREAS ************* */ - -void setprefsize(int stax, int stay, int sizx, int sizy, int maximized) -{ - int scrwidth, scrheight; - - winlay_get_screensize(&scrwidth, &scrheight); - - if(sizx<320) sizx= 320; - if(sizy<256) sizy= 256; - - if(stay+sizy>scrheight) { - fprintf(stderr," height prob \n"); - sizy= scrheight-stay; - } - - if(sizx<320 || sizy<256) { - printf("ERROR: illegal prefsize\n"); - return; - } - - prefstax= stax; - prefstay= stay; - prefsizx= sizx; - prefsizy= sizy; - - start_maximized= maximized; -} - - -static ScrVert *screen_addvert(bScreen *sc, short x, short y) -{ - ScrVert *sv= MEM_callocN(sizeof(ScrVert), "addscrvert"); - sv->vec.x= x; - sv->vec.y= y; - - BLI_addtail(&sc->vertbase, sv); - return sv; -} - -static void sortscrvert(ScrVert **v1, ScrVert **v2) -{ - ScrVert *tmp; - - if (*v1 > *v2) { - tmp= *v1; - *v1= *v2; - *v2= tmp; - } -} - -static ScrEdge *screen_addedge(bScreen *sc, ScrVert *v1, ScrVert *v2) -{ - ScrEdge *se= MEM_callocN(sizeof(ScrEdge), "addscredge"); - - sortscrvert(&v1, &v2); - se->v1= v1; - se->v2= v2; - - BLI_addtail(&sc->edgebase, se); - return se; -} - -static ScrEdge *screen_findedge(bScreen *sc, ScrVert *v1, ScrVert *v2) -{ - ScrEdge *se; - - sortscrvert(&v1, &v2); - for (se= sc->edgebase.first; se; se= se->next) - if(se->v1==v1 && se->v2==v2) - return se; - - return NULL; -} - -static void removedouble_scrverts(void) -{ - ScrVert *v1, *verg; - ScrEdge *se; - ScrArea *sa; - - verg= G.curscreen->vertbase.first; - while(verg) { - if(verg->newv==0) { /* !!! */ - v1= verg->next; - while(v1) { - if(v1->newv==0) { /* !?! */ - if(v1->vec.x==verg->vec.x && v1->vec.y==verg->vec.y) { - /* printf("doublevert\n"); */ - v1->newv= verg; - } - } - v1= v1->next; - } - } - verg= verg->next; - } - - /* replace pointers in edges and faces */ - se= G.curscreen->edgebase.first; - while(se) { - if(se->v1->newv) se->v1= se->v1->newv; - if(se->v2->newv) se->v2= se->v2->newv; - /* edges changed: so.... */ - sortscrvert(&(se->v1), &(se->v2)); - se= se->next; - } - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->v1->newv) sa->v1= sa->v1->newv; - if(sa->v2->newv) sa->v2= sa->v2->newv; - if(sa->v3->newv) sa->v3= sa->v3->newv; - if(sa->v4->newv) sa->v4= sa->v4->newv; - sa= sa->next; - } - - /* remove */ - verg= G.curscreen->vertbase.first; - while(verg) { - v1= verg->next; - if(verg->newv) { - BLI_remlink(&G.curscreen->vertbase, verg); - MEM_freeN(verg); - } - verg= v1; - } - -} - -static void removenotused_scrverts(void) -{ - ScrVert *sv, *svn; - ScrEdge *se; - - /* we assume edges are ok */ - - se= G.curscreen->edgebase.first; - while(se) { - se->v1->flag= 1; - se->v2->flag= 1; - se= se->next; - } - - sv= G.curscreen->vertbase.first; - while(sv) { - svn= sv->next; - if(sv->flag==0) { - BLI_remlink(&G.curscreen->vertbase, sv); - MEM_freeN(sv); - } - else sv->flag= 0; - sv= svn; - } -} - -static void removedouble_scredges(void) -{ - ScrEdge *verg, *se, *sn; - - /* compare */ - verg= G.curscreen->edgebase.first; - while(verg) { - se= verg->next; - while(se) { - sn= se->next; - if(verg->v1==se->v1 && verg->v2==se->v2) { - BLI_remlink(&G.curscreen->edgebase, se); - MEM_freeN(se); - } - se= sn; - } - verg= verg->next; - } -} - -static void removenotused_scredges(void) -{ - ScrEdge *se, *sen; - ScrArea *sa; - int a=0; - - /* sets flags when edge is used in area */ - sa= G.curscreen->areabase.first; - while(sa) { - se= screen_findedge(G.curscreen, sa->v1, sa->v2); - if(se==0) printf("error: area %d edge 1 bestaat niet\n", a); - else se->flag= 1; - se= screen_findedge(G.curscreen, sa->v2, sa->v3); - if(se==0) printf("error: area %d edge 2 bestaat niet\n", a); - else se->flag= 1; - se= screen_findedge(G.curscreen, sa->v3, sa->v4); - if(se==0) printf("error: area %d edge 3 bestaat niet\n", a); - else se->flag= 1; - se= screen_findedge(G.curscreen, sa->v4, sa->v1); - if(se==0) printf("error: area %d edge 4 bestaat niet\n", a); - else se->flag= 1; - sa= sa->next; - a++; - } - se= G.curscreen->edgebase.first; - while(se) { - sen= se->next; - if(se->flag==0) { - BLI_remlink(&G.curscreen->edgebase, se); - MEM_freeN(se); - } - else se->flag= 0; - se= sen; - } -} - -void calc_arearcts(ScrArea *sa) -{ - - if(sa->v1->vec.x>0) sa->totrct.xmin= sa->v1->vec.x+1; - else sa->totrct.xmin= sa->v1->vec.x; - if(sa->v4->vec.xsizex-1) sa->totrct.xmax= sa->v4->vec.x-1; - else sa->totrct.xmax= sa->v4->vec.x; - - if(sa->v1->vec.y>0) sa->totrct.ymin= sa->v1->vec.y+1; - else sa->totrct.ymin= sa->v1->vec.y; - if(sa->v2->vec.ysizey-1) sa->totrct.ymax= sa->v2->vec.y-1; - else sa->totrct.ymax= sa->v2->vec.y; - - sa->winrct= sa->totrct; - sa->headrct= sa->totrct; - if(sa->headertype) { - if(sa->headertype==HEADERDOWN) { - sa->headrct.ymax= sa->headrct.ymin+HEADERY; - sa->winrct.ymin= sa->headrct.ymax+1; - } - else if(sa->headertype==HEADERTOP) { - sa->headrct.ymin= sa->headrct.ymax-HEADERY; - sa->winrct.ymax= sa->headrct.ymin-1; - } - } - else { - sa->headrct.ymax= sa->headrct.ymin; - } - if(sa->winrct.ymin>sa->winrct.ymax) sa->winrct.ymin= sa->winrct.ymax; - - /* for speedup */ - sa->winx= sa->winrct.xmax-sa->winrct.xmin+1; - sa->winy= sa->winrct.ymax-sa->winrct.ymin+1; -} - -static void openheadwin(ScrArea *sa) -{ - sa->headwin= myswinopen(G.curscreen->mainwin, - sa->headrct.xmin, sa->headrct.xmax, sa->headrct.ymin, sa->headrct.ymax); - - glMatrixMode(GL_MODELVIEW); - - areawinar[sa->headwin]= sa; /* otherwise addqueue does not work */ - - scrarea_do_headchange(sa); /* headchange is no callback, apply right away. this is for render-to-imagewindow... this can be called on startup by sequencer, which invokes redraw before all events are handled. bad stuff... */ - addqueue(sa->headwin, CHANGED, 1); -} - -static void openareawin(ScrArea *sa) -{ - sa->win= myswinopen(G.curscreen->mainwin, - sa->winrct.xmin, sa->winrct.xmax, sa->winrct.ymin, sa->winrct.ymax); - - areawinar[sa->win]= sa; /* otherwise addqueue does not work */ - addqueue(sa->win, CHANGED, 1); -} - -static void closeheadwin(ScrArea *sa) -{ - if(sa->headwin) mywinclose(sa->headwin); - sa->headwin= 0; -} - -static void closeareawin(ScrArea *sa) -{ - uiFreeBlocksWin(&sa->uiblocks, sa->win); - - if(sa->win) mywinclose(sa->win); - sa->win= 0; -} - -static void del_area(ScrArea *sa) -{ - closeareawin(sa); - closeheadwin(sa); - - freespacelist(sa); - - uiFreeBlocks(&sa->uiblocks); - uiFreePanels(&sa->panels); - - BPY_free_scriptlink(&sa->scriptlink); - - if(sa==curarea) curarea= NULL; - if(sa==g_activearea) g_activearea= NULL; -} - -/* sa2 to sa1, we swap spaces for fullscreen to keep all allocated data */ -static void copy_areadata(ScrArea *sa1, ScrArea *sa2, int swap_space) -{ - Panel *pa1, *pa2, *patab; - ScriptLink *slink1 = &sa1->scriptlink, *slink2 = &sa2->scriptlink; - - sa1->headertype= sa2->headertype; - sa1->spacetype= sa2->spacetype; - Mat4CpyMat4(sa1->winmat, sa2->winmat); - - if(swap_space) { - SWAP(ListBase, sa1->spacedata, sa2->spacedata); - /* exception: ensure preview is reset */ - if(sa1->spacetype==SPACE_VIEW3D) - BIF_view3d_previewrender_free(sa1->spacedata.first); - } - else { - freespacelist(sa1); - duplicatespacelist(sa1, &sa1->spacedata, &sa2->spacedata); - } - - BLI_freelistN(&sa1->panels); - duplicatelist(&sa1->panels, &sa2->panels); - - /* space handler script links */ - if (slink1->totscript) { - MEM_freeN(slink1->scripts); - MEM_freeN(slink1->flag); - slink1->totscript = 0; - } - if (slink2->totscript) { - slink1->scripts = MEM_dupallocN(slink2->scripts); - slink1->flag = MEM_dupallocN(slink2->flag); - slink1->totscript = slink2->totscript; - } - - /* copy pointers */ - pa1= sa1->panels.first; - while(pa1) { - - patab= sa1->panels.first; - pa2= sa2->panels.first; - while(patab) { - if( pa1->paneltab == pa2) { - pa1->paneltab = patab; - break; - } - patab= patab->next; - pa2= pa2->next; - } - pa1= pa1->next; - } -} - -static ScrArea *screen_addarea(bScreen *sc, ScrVert *v1, ScrVert *v2, ScrVert *v3, ScrVert *v4, short headertype, short spacetype) -{ - ScrArea *sa= MEM_callocN(sizeof(ScrArea), "addscrarea"); - sa->cursor= CURSOR_STD; - sa->v1= v1; - sa->v2= v2; - sa->v3= v3; - sa->v4= v4; - sa->headertype= headertype; - sa->spacetype= spacetype; - - calc_arearcts(sa); - - if (sa->headertype) openheadwin(sa); - openareawin(sa); - - BLI_addtail(&sc->areabase, sa); - return sa; -} - -static int rcti_eq(rcti *a, rcti *b) { - return ((a->xmin==b->xmin && a->xmax==b->xmax) && - (a->ymin==b->ymin && a->ymax==b->ymax)); -} - -static void testareas(void) -{ - ScrArea *sa, *next; - - /* test for header, if removed, or moved */ - /* test for window, if removed, or moved */ - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - rcti oldhr= sa->headrct; - rcti oldwr= sa->winrct; - - next= sa->next; - - calc_arearcts(sa); - - /* ilegally scaled down area.... */ - if(sa->totrct.xmin>=sa->totrct.xmax || sa->totrct.ymin>=sa->totrct.ymax) { - del_area(sa); - BLI_remlink(&G.curscreen->areabase, sa); - MEM_freeN(sa); - printf("Warning, removed zero sized window from screen %s\n", G.curscreen->id.name+2); - } - else { - /* test header */ - if (sa->headwin) { - if (!rcti_eq(&oldhr, &sa->headrct)) { - mywinposition(sa->headwin, sa->headrct.xmin, sa->headrct.xmax, sa->headrct.ymin, sa->headrct.ymax); - addqueue(sa->headwin, CHANGED, 1); - } - - if(sa->headbutlenwinx) { - sa->headbutofs= 0; - addqueue(sa->headwin, CHANGED, 1); - } - else if(sa->headbutofs+sa->winx > sa->headbutlen) { - sa->headbutofs= sa->headbutlen-sa->winx; - addqueue(sa->headwin, CHANGED, 1); - } - } - - if (!rcti_eq(&oldwr, &sa->winrct)) { - SpaceLink *sl= sa->spacedata.first; - - mywinposition(sa->win, sa->winrct.xmin, sa->winrct.xmax, sa->winrct.ymin, sa->winrct.ymax); - addqueue(sa->win, CHANGED, 1); - - /* exception handling... probably we need generic event */ - for(; sl; sl= sl->next) - if(sl->spacetype==SPACE_VIEW3D) - BIF_view3d_previewrender_free((View3D *)sl); - } - } - } - - /* remake global windowarray */ - memset(areawinar, 0, sizeof(void *)*MAXWIN); - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - areawinar[sa->headwin]= sa; - areawinar[sa->win]= sa; - } - - /* test if winakt is OK */ - if( areawinar[G.curscreen->winakt]==0) G.curscreen->winakt= 0; -} - -static ScrArea *test_edge_area(ScrArea *sa, ScrEdge *se) -{ - /* test if edge is in area, if not, - then find an area that has it */ - - ScrEdge *se1=0, *se2=0, *se3=0, *se4=0; - - if(sa) { - se1= screen_findedge(G.curscreen, sa->v1, sa->v2); - se2= screen_findedge(G.curscreen, sa->v2, sa->v3); - se3= screen_findedge(G.curscreen, sa->v3, sa->v4); - se4= screen_findedge(G.curscreen, sa->v4, sa->v1); - } - if(se1!=se && se2!=se && se3!=se && se4!=se) { - - sa= G.curscreen->areabase.first; - while(sa) { - /* a bit optimise? */ - if(se->v1==sa->v1 || se->v1==sa->v2 || se->v1==sa->v3 || se->v1==sa->v4) { - se1= screen_findedge(G.curscreen, sa->v1, sa->v2); - se2= screen_findedge(G.curscreen, sa->v2, sa->v3); - se3= screen_findedge(G.curscreen, sa->v3, sa->v4); - se4= screen_findedge(G.curscreen, sa->v4, sa->v1); - if(se1==se || se2==se || se3==se || se4==se) return sa; - } - sa= sa->next; - } - } - - return sa; /* is null when not find */ -} - -ScrArea *closest_bigger_area(void) -{ - ScrArea *sa, *big=0; - float cent[3], vec[3],len, len1, len2, len3, dist=1000; - short mval[2]; - - getmouseco_sc(mval); - - cent[0]= mval[0]; - cent[1]= mval[1]; - cent[2]= vec[2]= 0; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa!=curarea) { - if(sa->winy>=curarea->winy) { - - /* mimimum of the 4 corners */ - vec[0]= sa->v1->vec.x; vec[1]= sa->v1->vec.y; - len= VecLenf(vec, cent); - vec[0]= sa->v2->vec.x; vec[1]= sa->v2->vec.y; - len1= VecLenf(vec, cent); - vec[0]= sa->v3->vec.x; vec[1]= sa->v3->vec.y; - len2= VecLenf(vec, cent); - vec[0]= sa->v4->vec.x; vec[1]= sa->v4->vec.y; - len3= VecLenf(vec, cent); - - len= MIN4(len, len1, len2, len3); - - /* plus center */ - vec[0]= (sa->v2->vec.x+sa->v3->vec.x)/2; - vec[1]= (sa->v1->vec.y+sa->v2->vec.y)/2; - - len+= 0.5*VecLenf(vec, cent); - - /* min size */ - len-= sa->winy+sa->winx; - - if(lennext; - } - - if(big) return big; - else return curarea; -} - -/* ************ SCREEN MANAGEMENT ************** */ - -static int statechanged= 0; -void BIF_wait_for_statechange(void) -{ - if (!statechanged) { - /* Safety, don't wait more than 0.1 seconds */ - double stime= PIL_check_seconds_timer(); - while (!statechanged) { - winlay_process_events(1); - if ((PIL_check_seconds_timer()-stime)>0.1) break; - } - statechanged= 0; - } - else PIL_sleep_ms(3); /* statechanged can be set '1' while holding mousebutton, causing locks */ - -} -void getmouse(short *mval) -{ - winlay_process_events(0); - window_get_mouse(mainwin, mval); -} -short get_qual(void) -{ - winlay_process_events(0); - return window_get_qual(mainwin); -} -short get_mbut(void) -{ - winlay_process_events(0); - return window_get_mbut(mainwin); -} - -/* return values of tablet data related functions are documented - * in the Window struct, ghostwinlay.c */ -float get_pressure(void) -{ - winlay_process_events(0); - return window_get_pressure(mainwin); -} -void get_tilt(float *xtilt, float *ytilt) -{ - winlay_process_events(0); - window_get_tilt(mainwin, xtilt, ytilt); -} -short get_activedevice(void) -{ - winlay_process_events(0); - return window_get_activedevice(mainwin); -} - -void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii) -{ - - statechanged= 1; - - /* accept the extended ascii set (ton) */ - if( !val || ascii<32 ) { - ascii= '\0'; - } - - mainqenter_ext(evt, val, ascii); -} - -/* ScrVert ordering in a ScrArea: - -2---------3 -| | -| | -1---------4 - -*/ - -static bScreen *addscreen(char *name) /* use setprefsize() if you want something else than a full windpw */ -{ - /* this function sets variabele G.curscreen, - * that global is about used everywhere! - */ - bScreen *sc; - ScrVert *sv1, *sv2, *sv3, *sv4; - short startx, starty, endx, endy; - - sc= G.curscreen= alloc_libblock(&G.main->screen, ID_SCR, name); - - if (!prefsizx) { - prefstax= 0; - prefstay= 0; - - winlay_get_screensize(&prefsizx, &prefsizy); - } - - startx= prefstax; - starty= prefstay; - endx= prefstax+prefsizx-1; - endy= prefstay+prefsizy-1; - - sc->startx= startx; sc->starty= starty; - sc->endx= endx; sc->endy= endy; - sc->sizex= sc->endx-sc->startx+1; - sc->sizey= sc->endy-sc->starty+1; - - sc->scene= G.scene; - - if (!mainwin) { - if (G.windowstate == G_WINDOWSTATE_FULLSCREEN) - mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, G_WINDOWSTATE_FULLSCREEN); - else - mainwin= window_open("Blender", sc->startx, sc->starty, sc->sizex, sc->sizey, start_maximized); - - if (!mainwin) { - printf("ERROR: Unable to open Blender window\n"); - exit(1); - } - - window_set_handler(mainwin, add_to_mainqueue, NULL); - init_mainwin(); - mywinset(1); - - /* for visual speed, but still needed? */ - glClearColor(.55, .55, .55, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - window_swap_buffers(mainwin); - - /* this is unneeded and with large monitors can be a - * pain so commenting out */ - /* warp_pointer(sc->sizex/2, sc->sizey/2); */ - - mainqenter(REDRAW, 1); - } - - sc->mainwin= 1; - - sv1= screen_addvert(sc, 0, 0); - sv2= screen_addvert(sc, 0, sc->endy-sc->starty); - sv3= screen_addvert(sc, sc->sizex-1, sc->sizey-1); - sv4= screen_addvert(sc, sc->sizex-1, 0); - - screen_addedge(sc, sv1, sv2); - screen_addedge(sc, sv2, sv3); - screen_addedge(sc, sv3, sv4); - screen_addedge(sc, sv4, sv1); - - screen_addarea(sc, sv1, sv2, sv3, sv4, HEADERDOWN, SPACE_INFO); - - G.curscreen= sc; - - return sc; -} - -void setscreen(bScreen *sc) -{ - bScreen *sc1; - ScrArea *sa; - short mval[2]; - - if(sc->full) { /* find associated full */ - sc1= G.main->screen.first; - while(sc1) { - sa= sc1->areabase.first; - if(sa->full==sc) { - sc= sc1; - break; - } - sc1= sc1->id.next; - } - if(sc1==0) printf("setscreen error\n"); - } - - /* de-activate G.curscreen */ - if (G.curscreen && G.curscreen != sc) { - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->win) mywinclose(sa->win); - sa->win= 0; - if(sa->headwin) mywinclose(sa->headwin); - sa->headwin= 0; - - uiFreeBlocks(&sa->uiblocks); - - sa= sa->next; - } - } - else if(G.curscreen) markdirty_all(); /* at least redraw */ - - if (G.curscreen != sc) { - mywinset(sc->mainwin); - } - - G.curscreen= sc; - - for (sa= sc->areabase.first; sa; sa= sa->next) { - /* XXX, fixme zr */ -/* if (sa->win || sa->headwin) */ -/* printf("error in setscreen (win): %d, %d\n", sa->win, sa->headwin); */ - if (!sa->win) - openareawin(sa); - if (!sa->headwin && sa->headertype) - openheadwin(sa); - } - - /* recalculate winakt */ - getmouseco_sc(mval); - - test_scale_screen(sc); - testareas(); - - for(sa= sc->areabase.first; sa; sa= sa->next) { - SpaceLink *sl; - - for(sl= sa->spacedata.first; sl; sl= sl->next) { - sl->area= sa; - - if(sl->spacetype==SPACE_OOPS) { - SpaceOops *soops= (SpaceOops *) sl; - - /* patch for old files */ - if(soops->v2d.cur.xmin==soops->v2d.cur.xmax) { - init_v2d_oops(sa, soops); - } - } - else if(sl->spacetype==SPACE_BUTS) { - SpaceButs *sbuts= (SpaceButs *)sl; - sbuts->re_align= 1; // force an align call, maybe new panels were added, also for after file reading - } - } - - sa->cursor= CURSOR_STD; - } - - if(G.scene!=sc->scene) - set_scene(sc->scene); - - countall(); - - G.curscreen->winakt= 0; - curarea= sc->areabase.first; - - mainqenter(DRAWEDGES, 1); - dodrawscreen= 1; /* patch! even gets lost,,,? */ - - winqueue_break= 1; /* means leave queue everywhere */ -} - -static void splitarea(ScrArea *sa, char dir, float fac); - -void area_fullscreen(void) /* with curarea */ -{ - /* this function toggles: if area is full then the parent will be restored */ - bScreen *sc, *oldscreen; - ScrArea *sa, *newa, *old; - short headertype, fulltype; - - if(curarea->full) { - sc= curarea->full; /* the old screen */ - fulltype = sc->full; - - // refuse to go out of SCREENAUTOPLAY as long as G_FLAGS_AUTOPLAY - // is set - - if (fulltype != SCREENAUTOPLAY || (G.flags & G_FILE_AUTOPLAY) == 0) { - sc->full= 0; - - /* find old area */ - old= sc->areabase.first; - while(old) { - if(old->full) break; - old= old->next; - } - if(old==0) {error("something wrong in areafullscreen"); return;} - - if (fulltype == SCREENAUTOPLAY) { - // in autoplay screens the headers are disabled by - // default. So use the old headertype instead - headertype = old->headertype; - } else { - // normal fullscreen. Use current headertype - headertype = curarea->headertype; - } - - copy_areadata(old, curarea, 1); /* 1 = swap spacelist */ - old->headertype = headertype; - - old->full= 0; - - unlink_screen(G.curscreen); - free_libblock(&G.main->screen, G.curscreen); - G.curscreen= NULL; - - setscreen(sc); - } - - } - else { - /* is there only 1 area? */ - if(G.curscreen->areabase.first==G.curscreen->areabase.last) return; - if(curarea->spacetype==SPACE_INFO) return; - - G.curscreen->full = SCREENFULL; - - old= curarea; - oldscreen= G.curscreen; - sc= addscreen("temp"); /* this sets G.curscreen */ - - splitarea( (ScrArea *)sc->areabase.first, 'h', 0.99); - newa= sc->areabase.first; - newspace(newa->next, SPACE_INFO); - - curarea= old; - G.curscreen= oldscreen; /* needed because of setscreen */ - - /* copy area */ - copy_areadata(newa, curarea, 1); /* 1 = swap spacelist */ - - curarea->full= oldscreen; - newa->full= oldscreen; - newa->next->full= oldscreen; - - setscreen(sc); - wich_cursor(newa); - } - - /* there's also events in queue for this, but we call fullscreen for render output - now, and that doesn't go back to queue. Bad code, but doesn't hurt... (ton) */ - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - scrarea_do_headchange(sa); - scrarea_do_winchange(sa); - } - /* bad code #2: setscreen() ends with first area active. fullscreen render assumes this too */ - curarea= sc->areabase.first; - - retopo_force_update(); -} - -static void area_autoplayscreen(void) -{ - bScreen *sc, *oldscreen; - ScrArea *newa, *old, *sa; - - if (curarea->full) { - area_fullscreen(); - } - - if (curarea->full == NULL) { - sa = G.curscreen->areabase.first; - while (sa) { - if (sa->spacetype == SPACE_VIEW3D) { - break; - } - sa= sa->next; - } - - if (sa) { - areawinset(sa->win); - G.curscreen->full = SCREENAUTOPLAY; - - old= curarea; - oldscreen= G.curscreen; - sc= addscreen("temp"); /* this sets G.curscreen */ - - newa= sc->areabase.first; - - curarea= old; - G.curscreen= oldscreen; /* because of setscreen */ - - /* copy area settings */ - copy_areadata(newa, curarea, 1); /* swap spacedata */ - newa->headertype= 0; - - curarea->full= oldscreen; - newa->full= oldscreen; - - setscreen(sc); - wich_cursor(newa); - } - } -} - -static void copy_screen(bScreen *to, bScreen *from) -{ - ScrVert *s1, *s2; - ScrEdge *se; - ScrArea *sa, *saf; - - /* free 'to' */ - free_screen(to); - winqueue_break= 1; /* leave queues everywhere */ - - duplicatelist(&to->vertbase, &from->vertbase); - duplicatelist(&to->edgebase, &from->edgebase); - duplicatelist(&to->areabase, &from->areabase); - - s1= from->vertbase.first; - s2= to->vertbase.first; - while(s1) { - s1->newv= s2; - s2= s2->next; - s1= s1->next; - } - se= to->edgebase.first; - while(se) { - se->v1= se->v1->newv; - se->v2= se->v2->newv; - sortscrvert(&(se->v1), &(se->v2)); - se= se->next; - } - - sa= to->areabase.first; - saf= from->areabase.first; - while(sa) { - sa->v1= sa->v1->newv; - sa->v2= sa->v2->newv; - sa->v3= sa->v3->newv; - sa->v4= sa->v4->newv; - sa->win= 0; - sa->headwin= 0; - - sa->spacedata.first= sa->spacedata.last= NULL; - sa->uiblocks.first= sa->uiblocks.last= NULL; - sa->panels.first= sa->panels.last= NULL; - sa->scriptlink.totscript= 0; - - copy_areadata(sa, saf, 0); - - sa= sa->next; - saf= saf->next; - } - - /* put at zero (needed?) */ - s1= from->vertbase.first; - while(s1) { - s1->newv= 0; - s1= s1->next; - } -} - -void duplicate_screen(void) -{ - bScreen *sc, *oldscreen; - - if(G.curscreen->full != SCREENNORMAL) return; - - /* make new screen: */ - - oldscreen= G.curscreen; - sc= addscreen(oldscreen->id.name+2); /* this sets G.curscreen */ - copy_screen(sc, oldscreen); - - G.curscreen= oldscreen; - setscreen(sc); - -} - - -/* ************ END SCREEN MANAGEMENT ************** */ -/* ************ JOIN/SPLIT/MOVE ************** */ - -typedef struct point{ - float x,y; -}_point; - -/* draw vertical shape visualising future joining (left as well - * right direction of future joining) */ -static void draw_horizontal_join_shape(ScrArea *sa, char dir) -{ - _point points[10]; - short i; - float w, h; - float width = sa->v3->vec.x - sa->v1->vec.x; - float height = sa->v3->vec.y - sa->v1->vec.y; - - if(heightv1->vec.x; - points[0].y = sa->v1->vec.y + height/2; - - points[1].x = sa->v1->vec.x; - points[1].y = sa->v1->vec.y; - - points[2].x = sa->v4->vec.x - w; - points[2].y = sa->v4->vec.y; - - points[3].x = sa->v4->vec.x - w; - points[3].y = sa->v4->vec.y + height/2 - 2*h; - - points[4].x = sa->v4->vec.x - 2*w; - points[4].y = sa->v4->vec.y + height/2; - - points[5].x = sa->v4->vec.x - w; - points[5].y = sa->v4->vec.y + height/2 + 2*h; - - points[6].x = sa->v3->vec.x - w; - points[6].y = sa->v3->vec.y; - - points[7].x = sa->v2->vec.x; - points[7].y = sa->v2->vec.y; - - points[8].x = sa->v4->vec.x; - points[8].y = sa->v4->vec.y + height/2 - h; - - points[9].x = sa->v4->vec.x; - points[9].y = sa->v4->vec.y + height/2 + h; - - if(dir=='l') { - /* when direction is left, then we flip direction of arrow */ - float cx = sa->v1->vec.x + width; - for(i=0;i<10;i++) { - points[i].x -= cx; - points[i].x = -points[i].x; - points[i].x += sa->v1->vec.x; - } - } - - glBegin(GL_POLYGON); - for(i=0;i<5;i++) - glVertex2f(points[i].x, points[i].y); - glEnd(); - glBegin(GL_POLYGON); - for(i=4;i<8;i++) - glVertex2f(points[i].x, points[i].y); - glVertex2f(points[0].x, points[0].y); - glEnd(); - - glRectf(points[2].x, points[2].y, points[8].x, points[8].y); - glRectf(points[6].x, points[6].y, points[9].x, points[9].y); -} - -/* draw vertical shape visualising future joining (up/down direction) */ -static void draw_vertical_join_shape(ScrArea *sa, char dir) -{ - _point points[10]; - short i; - float w, h; - float width = sa->v3->vec.x - sa->v1->vec.x; - float height = sa->v3->vec.y - sa->v1->vec.y; - - if(heightv1->vec.x + width/2; - points[0].y = sa->v3->vec.y; - - points[1].x = sa->v2->vec.x; - points[1].y = sa->v2->vec.y; - - points[2].x = sa->v1->vec.x; - points[2].y = sa->v1->vec.y + h; - - points[3].x = sa->v1->vec.x + width/2 - 2*w; - points[3].y = sa->v1->vec.y + h; - - points[4].x = sa->v1->vec.x + width/2; - points[4].y = sa->v1->vec.y + 2*h; - - points[5].x = sa->v1->vec.x + width/2 + 2*w; - points[5].y = sa->v1->vec.y + h; - - points[6].x = sa->v4->vec.x; - points[6].y = sa->v4->vec.y + h; - - points[7].x = sa->v3->vec.x; - points[7].y = sa->v3->vec.y; - - points[8].x = sa->v1->vec.x + width/2 - w; - points[8].y = sa->v1->vec.y; - - points[9].x = sa->v1->vec.x + width/2 + w; - points[9].y = sa->v1->vec.y; - - if(dir=='u') { - /* when direction is up, then we flip direction of arrow */ - float cy = sa->v1->vec.y + height; - for(i=0;i<10;i++) { - points[i].y -= cy; - points[i].y = -points[i].y; - points[i].y += sa->v1->vec.y; - } - } - - glBegin(GL_POLYGON); - for(i=0;i<5;i++) - glVertex2f(points[i].x, points[i].y); - glEnd(); - glBegin(GL_POLYGON); - for(i=4;i<8;i++) - glVertex2f(points[i].x, points[i].y); - glVertex2f(points[0].x, points[0].y); - glEnd(); - - glRectf(points[2].x, points[2].y, points[8].x, points[8].y); - glRectf(points[6].x, points[6].y, points[9].x, points[9].y); -} - -/* draw join shape due to direction of joining */ -static void draw_join_shape(ScrArea *sa, char dir) -{ - if(dir=='u' || dir=='d') - draw_vertical_join_shape(sa, dir); - else - draw_horizontal_join_shape(sa, dir); -} - -/* draw screen area darker with arrow (visualisation of future joining) */ -static void scrarea_draw_shape_dark(ScrArea *sa, char dir) -{ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glColor4ub(0, 0, 0, 105); - draw_join_shape(sa, dir); - glDisable(GL_BLEND); -} - -/* draw screen area ligher with arrow shape ("eraser" of previous dark shape) */ -static void scrarea_draw_shape_light(ScrArea *sa, char dir) -{ - glBlendFunc(GL_DST_COLOR, GL_SRC_ALPHA); - glEnable(GL_BLEND); - /* value 181 was hardly computed: 181~105 */ - glColor4ub(255, 255, 255, 181); - draw_join_shape(sa, dir); - glDisable(GL_BLEND); -} - -static void joinarea_interactive(ScrArea *area, ScrEdge *onedge) -{ - struct ScrArea *sa1 = area, *sa2, *scr; - struct ScrArea *up=0, *down=0, *right=0, *left=0; - struct ScrEdge *se; - unsigned short event; - short ok=0, val=0, mval[2]; - char dir=0; - - sa1 = test_edge_area(sa1, onedge); - if(sa1==0) return; - - /* find directions with same edge */ - sa2= G.curscreen->areabase.first; - while(sa2) { - if(sa2 != sa1) { - se= screen_findedge(G.curscreen, sa2->v1, sa2->v2); - if(onedge==se) right= sa2; - se= screen_findedge(G.curscreen, sa2->v2, sa2->v3); - if(onedge==se) down= sa2; - se= screen_findedge(G.curscreen, sa2->v3, sa2->v4); - if(onedge==se) left= sa2; - se= screen_findedge(G.curscreen, sa2->v4, sa2->v1); - if(onedge==se) up= sa2; - } - sa2= sa2->next; - } - - if(left) val++; - if(up) val++; - if(right) val++; - if(down) val++; - - if(val==0) return; - else if(val==1) { - if(left) { - right = sa1; - sa2 = left; - dir = 'h'; - } - else if(right) { - left = sa1; - sa2 = right; - dir = 'h'; - } - else if(up) { - down = sa1; - sa2= up; - dir = 'v'; - } - else if(down) { - up = sa1; - sa2 = down; - dir = 'v'; - } - } - - mywinset(G.curscreen->mainwin); - - /* initial set up screen area asigned for destroying */ - scr = sa2; - - /* set up standard cursor */ - set_cursor(CURSOR_STD); - - /* should already have a good matrix */ - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - - /* to prevent flickering after clicking at "Join Areas " */ - getmouseco_sc(mval); - if(dir=='h') { - if(scr==left && mval[0]>=onedge->v1->vec.x) scr = right; - else if(scr==right && mval[0]v1->vec.x) scr = left; - } - else if(dir=='v') { - if(scr==down && mval[1]>=onedge->v1->vec.y) scr = up; - else if(scr==up && mval[1]v1->vec.y) scr = down; - } - - /* draw scr screen area with dark shape */ - if(scr==left) - scrarea_draw_shape_dark(scr,'r'); - else if(scr==right) - scrarea_draw_shape_dark(scr,'l'); - else if(scr==up) - scrarea_draw_shape_dark(scr,'d'); - else if(scr==down) - scrarea_draw_shape_dark(scr,'u'); - bglFlush(); - - /* "never ending loop" of interactive selection */ - while(!ok) { - getmouseco_sc(mval); - - /* test if position of mouse is on the "different side" of - * "joining edge" */ - if(dir=='h') { - if(scr==left && mval[0]>=onedge->v1->vec.x) { - scrarea_draw_shape_light(scr,'r'); - scr = right; - scrarea_draw_shape_dark(scr,'l'); - } - else if(scr==right && mval[0]v1->vec.x) { - scrarea_draw_shape_light(scr,'l'); - scr = left; - scrarea_draw_shape_dark(scr,'r'); - } - } - else if(dir=='v') { - if(scr==down && mval[1]>=onedge->v1->vec.y) { - scrarea_draw_shape_light(scr,'u'); - scr = up; - scrarea_draw_shape_dark(scr,'d'); - } - else if(scr==up && mval[1]v1->vec.y){ - scrarea_draw_shape_light(scr,'d'); - scr = down; - scrarea_draw_shape_dark(scr,'u'); - } - } - - - /* get pressed keys and mouse buttons */ - event = extern_qread(&val); - - /* confirm joining of two screen areas */ - if(val && event==LEFTMOUSE) ok= 1; - - /* cancel joining of joining */ - if(val && (event==ESCKEY || event==RIGHTMOUSE)) ok= -1; - - bglFlush(); - } - - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - - /* joining af screen areas was confirmed ... proceed joining */ - if(ok==1) { - if(sa2!=scr) { - sa1 = sa2; - sa2 = scr; - } - - if(sa2==left) { - sa1->v1= sa2->v1; - sa1->v2= sa2->v2; - screen_addedge(G.curscreen, sa1->v2, sa1->v3); - screen_addedge(G.curscreen, sa1->v1, sa1->v4); - } - else if(sa2==up) { - sa1->v2= sa2->v2; - sa1->v3= sa2->v3; - screen_addedge(G.curscreen, sa1->v1, sa1->v2); - screen_addedge(G.curscreen, sa1->v3, sa1->v4); - } - else if(sa2==right) { - sa1->v3= sa2->v3; - sa1->v4= sa2->v4; - screen_addedge(G.curscreen, sa1->v2, sa1->v3); - screen_addedge(G.curscreen, sa1->v1, sa1->v4); - } - else if(sa2==down) { - sa1->v1= sa2->v1; - sa1->v4= sa2->v4; - screen_addedge(G.curscreen, sa1->v1, sa1->v2); - screen_addedge(G.curscreen, sa1->v3, sa1->v4); - } - - del_area(sa2); - BLI_remlink(&G.curscreen->areabase, sa2); - MEM_freeN(sa2); - - removedouble_scredges(); - removenotused_scredges(); - removenotused_scrverts(); - - testareas(); - mainqenter(DRAWEDGES, 1); - - /* test cursor en inputwindow */ - mainqenter(MOUSEY, -1); - } -} - -static short testsplitpoint(ScrArea *sa, char dir, float fac) -/* return 0: no split possible */ -/* else return (integer) screencoordinate split point */ -{ - short x, y; - - /* area big enough? */ - if(sa->v4->vec.x- sa->v1->vec.x <= 2*AREAMINX) return 0; - if(sa->v2->vec.y- sa->v1->vec.y <= 2*AREAMINY) return 0; - - /* to be sure */ - if(fac<0.0) fac= 0.0; - if(fac>1.0) fac= 1.0; - - if(dir=='h') { - y= sa->v1->vec.y+ fac*(sa->v2->vec.y- sa->v1->vec.y); - - if(sa->v2->vec.y==G.curscreen->sizey-1 && sa->v2->vec.y- y < HEADERY) - y= sa->v2->vec.y- HEADERY; - - else if(sa->v1->vec.y==0 && y- sa->v1->vec.y < HEADERY) - y= sa->v1->vec.y+ HEADERY; - - else if(y- sa->v1->vec.y < AREAMINY) y= sa->v1->vec.y+ AREAMINY; - else if(sa->v2->vec.y- y < AREAMINY) y= sa->v2->vec.y- AREAMINY; - else y-= (y % AREAGRID); - - return y; - } - else { - x= sa->v1->vec.x+ fac*(sa->v4->vec.x- sa->v1->vec.x); - if(x- sa->v1->vec.x < AREAMINX) x= sa->v1->vec.x+ AREAMINX; - else if(sa->v4->vec.x- x < AREAMINX) x= sa->v4->vec.x- AREAMINX; - else x-= (x % AREAGRID); - - return x; - } -} - -static void splitarea(ScrArea *sa, char dir, float fac) -{ - bScreen *sc; - ScrArea *newa=NULL; - ScrVert *sv1, *sv2; - short split; - - if(sa==0) return; - - split= testsplitpoint(sa, dir, fac); - if(split==0) return; - - sc= G.curscreen; - - areawinset(sa->win); - - if(dir=='h') { - /* new vertices */ - sv1= screen_addvert(sc, sa->v1->vec.x, split); - sv2= screen_addvert(sc, sa->v4->vec.x, split); - - /* new edges */ - screen_addedge(sc, sa->v1, sv1); - screen_addedge(sc, sv1, sa->v2); - screen_addedge(sc, sa->v3, sv2); - screen_addedge(sc, sv2, sa->v4); - screen_addedge(sc, sv1, sv2); - - /* new areas: top */ - newa= screen_addarea(sc, sv1, sa->v2, sa->v3, sv2, sa->headertype, sa->spacetype); - copy_areadata(newa, sa, 0); - - /* area below */ - sa->v2= sv1; - sa->v3= sv2; - - } - else { - /* new vertices */ - sv1= screen_addvert(sc, split, sa->v1->vec.y); - sv2= screen_addvert(sc, split, sa->v2->vec.y); - - /* new edges */ - screen_addedge(sc, sa->v1, sv1); - screen_addedge(sc, sv1, sa->v4); - screen_addedge(sc, sa->v2, sv2); - screen_addedge(sc, sv2, sa->v3); - screen_addedge(sc, sv1, sv2); - - /* new areas: left */ - newa= screen_addarea(sc, sa->v1, sa->v2, sv2, sv1, sa->headertype, sa->spacetype); - copy_areadata(newa, sa, 0); - - /* area right */ - sa->v1= sv1; - sa->v2= sv2; - } - - if(sa->spacetype==SPACE_BUTS) { - addqueue(sa->win, UI_BUT_EVENT, B_BUTSHOME); - addqueue(newa->win, UI_BUT_EVENT, B_BUTSHOME); - } - - /* remove double vertices en edges */ - removedouble_scrverts(); - removedouble_scredges(); - removenotused_scredges(); - - mainqenter(DRAWEDGES, 1); - dodrawscreen= 1; /* patch! event gets lost,,,? */ - testareas(); -} - -static void scrarea_draw_splitpoint(ScrArea *sa, char dir, float fac) -{ - int split= testsplitpoint(sa, dir, fac); - - if (split) { - if(dir=='h') { - sdrawXORline(sa->totrct.xmin, split, sa->totrct.xmax, split); - sdrawXORline(sa->totrct.xmin, split-1, sa->totrct.xmax, split-1); - } else { - sdrawXORline(split, sa->totrct.ymin, split, sa->totrct.ymax); - sdrawXORline(split-1, sa->totrct.ymin, split-1, sa->totrct.ymax); - } - } -} - -static void splitarea_interactive(ScrArea *area, ScrEdge *onedge) -{ - ScrArea *scr, *sa= area; - float fac= 0.0; - unsigned short event; - short ok= 0, val, split = 0, mval[2], mvalo[2]= {-1, -1}, first= 1; - char dir; - - if(sa->win==0) return; - if(sa->full) return; - if(myswinopen_allowed()==0) { - error("Max amount of subwindows reached"); - return; - } - - dir= scredge_is_horizontal(onedge)?'v':'h'; - - mywinset(G.curscreen->mainwin); - /* should already have a good matrix */ - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - - /* keep track of grid and minsize */ - while(ok==0) { - getmouseco_sc(mval); - - /* this part of code allows to choose, what window will be splited */ - /* cursor is out of the current ScreenArea */ - if((mval[0] < sa->v1->vec.x) || (mval[0] > sa->v3->vec.x) || - (mval[1] < sa->v1->vec.y) || (mval[1] > sa->v3->vec.y)){ - scr= (ScrArea*)G.curscreen->areabase.first; - while(scr){ - if((mval[0] > scr->v1->vec.x) && (mval[0] < scr->v4->vec.x) && - (mval[1] < scr->v2->vec.y) && (mval[1] > scr->v1->vec.y)){ - /* test: is ScreenArea enough big for splitting */ - short tsplit= testsplitpoint(scr, dir, fac); - if(tsplit){ - split = tsplit; - /* delete old line from previous ScreenArea */ - if(!first) scrarea_draw_splitpoint(sa, dir, fac); - sa= scr; - first= 1; - break; - } - } - scr= scr->next; - } - } - - if (first || (dir=='v' && mval[0]!=mvalo[0]) || (dir=='h' && mval[1]!=mvalo[1])) { - if (!first) { - scrarea_draw_splitpoint(sa, dir, fac); - } - - if(dir=='h') { - fac= mval[1]- (sa->v1->vec.y); - fac/= sa->v2->vec.y- sa->v1->vec.y; - } else { - fac= mval[0]- sa->v1->vec.x; - fac/= sa->v4->vec.x- sa->v1->vec.x; - } - - split= testsplitpoint(sa, dir, fac); - if (split) { - scrarea_draw_splitpoint(sa, dir, fac); - } else { - ok= -1; - } - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - first= 0; - } - - event= extern_qread(&val); - - /* change direction of splitting between horizontal and vertical - * patch was offered by Guillaume */ - if(val && (event==TABKEY || event==MIDDLEMOUSE)) { - scrarea_draw_splitpoint(sa, dir, fac); - if(dir=='h') { - dir='v'; - set_cursor(CURSOR_Y_MOVE); - } else { - dir='h'; - set_cursor(CURSOR_X_MOVE); - } - first= 1; - } - - if(val && event==LEFTMOUSE) { - if(dir=='h') { - fac= split- (sa->v1->vec.y); - fac/= sa->v2->vec.y- sa->v1->vec.y; - } - else { - fac= split- sa->v1->vec.x; - fac/= sa->v4->vec.x- sa->v1->vec.x; - } - ok= 1; - } - if(val && (event==ESCKEY || event==RIGHTMOUSE)) { - ok= -1; - } - bglFlush(); - } - - if (!first) { - scrarea_draw_splitpoint(sa, dir, fac); - bglFlush(); - } - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - - if(ok==1) { - splitarea(sa, dir, fac); - mainqenter(DRAWEDGES, 1); - dodrawscreen= 1; /* patch! event gets lost,,,? */ - } -} - -View3D *find_biggest_view3d(void) -{ - ScrArea *sa= find_biggest_area_of_type(SPACE_VIEW3D); - - if (sa) { - return (View3D*) sa->spacedata.first; - } else { - return NULL; - } -} - -ScrArea *find_biggest_area_of_type(int spacecode) -{ - ScrArea *sa, *biggest= NULL; - int bigsize= 0; - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if (spacecode==0 || sa->spacetype==spacecode) { - int x= sa->v3->vec.x - sa->v1->vec.x; - int y= sa->v3->vec.y - sa->v1->vec.y; - int size= x*x + y*y; - - if (!biggest || size>bigsize) { - biggest= sa; - bigsize= size; - } - } - } - - return biggest; -} - -ScrArea *find_biggest_area(void) -{ - return find_biggest_area_of_type(0); -} - -static void select_connected_scredge(bScreen *sc, ScrEdge *edge) -{ - ScrEdge *se; - ScrVert *sv; - int oneselected; - char dir; - - /* select connected, only in the right direction */ - /* 'dir' is the direction of EDGE */ - - if(edge->v1->vec.x==edge->v2->vec.x) dir= 'v'; - else dir= 'h'; - - sv= sc->vertbase.first; - while(sv) { - sv->flag= 0; - sv= sv->next; - } - - edge->v1->flag= 1; - edge->v2->flag= 1; - - oneselected= 1; - while(oneselected) { - se= sc->edgebase.first; - oneselected= 0; - while(se) { - if(se->v1->flag + se->v2->flag==1) { - if(dir=='h') if(se->v1->vec.y==se->v2->vec.y) { - se->v1->flag= se->v2->flag= 1; - oneselected= 1; - } - if(dir=='v') if(se->v1->vec.x==se->v2->vec.x) { - se->v1->flag= se->v2->flag= 1; - oneselected= 1; - } - } - se= se->next; - } - } -} - -void test_scale_screen(bScreen *sc) -/* test if screen vertices should be scaled */ -/* also check offset */ -{ - ScrVert *sv=0; - ScrEdge *se; - ScrArea *sa, *san; - int yval; - float facx, facy, tempf, min[2], max[2]; - - sc->startx= prefstax; - sc->starty= prefstay; - sc->endx= prefstax+prefsizx-1; - sc->endy= prefstay+prefsizy-1; - - /* calculate size */ - sv= sc->vertbase.first; - min[0]= min[1]= 0.0; - max[0]= sc->sizex; - max[1]= sc->sizey; - while(sv) { - min[0]= MIN2(min[0], sv->vec.x); - min[1]= MIN2(min[1], sv->vec.y); - max[0]= MAX2(max[0], sv->vec.x); - max[1]= MAX2(max[1], sv->vec.y); - sv= sv->next; - } - - /* always make 0.0 left under */ - sv= sc->vertbase.first; - while(sv) { - sv->vec.x -= min[0]; - sv->vec.y -= min[1]; - sv= sv->next; - } - - - sc->sizex= max[0]-min[0]; - sc->sizey= max[1]-min[1]; - - if(sc->sizex!= prefsizx || sc->sizey!= prefsizy) { - facx= prefsizx; - facx/= (float)sc->sizex; - facy= prefsizy; - facy/= (float)sc->sizey; - - /* make sure it fits! */ - sv= sc->vertbase.first; - while(sv) { - tempf= ((float)sv->vec.x)*facx; - sv->vec.x= (short)(tempf+0.5); - sv->vec.x+= AREAGRID-1; - sv->vec.x-= (sv->vec.x % AREAGRID); - - CLAMP(sv->vec.x, 0, prefsizx); - - tempf= ((float)sv->vec.y )*facy; - sv->vec.y= (short)(tempf+0.5); - sv->vec.y+= AREAGRID-1; - sv->vec.y-= (sv->vec.y % AREAGRID); - - CLAMP(sv->vec.y, 0, prefsizy); - - sv= sv->next; - } - - sc->sizex= prefsizx; - sc->sizey= prefsizy; - } - - /* test for collapsed areas. This could happen in some blender version... */ - sa= sc->areabase.first; - while(sa) { - san= sa->next; - if(sa->v1==sa->v2 || sa->v3==sa->v4 || sa->v2==sa->v3) { - del_area(sa); - BLI_remlink(&sc->areabase, sa); - MEM_freeN(sa); - } - sa= san; - } - - /* make each window at least HEADERY high */ - sa= sc->areabase.first; - while(sa) { - - if(sa->v1->vec.y+HEADERY > sa->v2->vec.y) { - /* lower edge */ - se= screen_findedge(sc, sa->v4, sa->v1); - if(se && sa->v1!=sa->v2 ) { - select_connected_scredge(sc, se); - - /* all selected vertices get the right offset */ - yval= sa->v2->vec.y-HEADERY; - sv= sc->vertbase.first; - while(sv) { - /* if is a collapsed area */ - if(sv!=sa->v2 && sv!=sa->v3) { - if(sv->flag) sv->vec.y= yval; - } - sv= sv->next; - } - } - } - - sa= sa->next; - } - -} - -static void draw_front_xor_dirdist_line(char dir, int dist, int start, int end) -{ - if (dir=='h') { - sdrawXORline(start, dist, end, dist); - sdrawXORline(start, dist+1, end, dist+1); - } else { - sdrawXORline(dist, start, dist, end); - sdrawXORline(dist+1, start, dist+1, end); - } -} - -static void moveareas(ScrEdge *edge) -{ - ScrVert *v1; - ScrArea *sa; - short mvalo[2], mval_prev=-1; - short edge_start, edge_end, edge_position; - short bigger, smaller, headery, areaminy; - int delta, doit; - char dir; - - if(edge->border) return; - - dir= scredge_is_horizontal(edge)?'h':'v'; - - select_connected_scredge(G.curscreen, edge); - - edge_position= (dir=='h')?edge->v1->vec.y:edge->v1->vec.x; - edge_start= 10000; - edge_end= -10000; - for (v1= G.curscreen->vertbase.first; v1; v1= v1->next) { - if (v1->flag) { - if (dir=='h') { - edge_start= MIN2(edge_start, v1->vec.x); - edge_end= MAX2(edge_end, v1->vec.x); - } else { - edge_start= MIN2(edge_start, v1->vec.y); - edge_end= MAX2(edge_end, v1->vec.y); - } - } - } - - /* now all verices with 'flag==1' are the ones that can be moved. */ - /* we check all areas and test for free space with MINSIZE */ - bigger= smaller= 10000; - sa= G.curscreen->areabase.first; - while(sa) { - if(dir=='h') { /* if top or down edge selected, test height */ - if(sa->headertype) { - headery= HEADERY; - areaminy= AREAMINY; - } - else { - headery= 0; - areaminy= AREAMINY; /*areaminy= EDGEWIDTH;*/ - } - - if(sa->v1->flag && sa->v4->flag) { - int y1; - if(sa->v2->vec.y==G.curscreen->sizey-1) /* top edge */ - y1= sa->v2->vec.y - sa->v1->vec.y-headery-EDGEWIDTH; - else - y1= sa->v2->vec.y - sa->v1->vec.y-areaminy; - bigger= MIN2(bigger, y1); - } - else if(sa->v2->flag && sa->v3->flag) { - int y1; - if(sa->v1->vec.y==0) /* bottom edge */ - y1= sa->v2->vec.y - sa->v1->vec.y-headery-EDGEWIDTH; - else - y1= sa->v2->vec.y - sa->v1->vec.y-areaminy; - smaller= MIN2(smaller, y1); - } - } - else { /* if left or right edge selected, test width */ - if(sa->v1->flag && sa->v2->flag) { - int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX; - bigger= MIN2(bigger, x1); - } - else if(sa->v3->flag && sa->v4->flag) { - int x1= sa->v4->vec.x - sa->v1->vec.x-AREAMINX; - smaller= MIN2(smaller, x1); - } - } - sa= sa->next; - } - - mywinset(G.curscreen->mainwin); - - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - - doit= delta= 0; - getmouseco_sc(mvalo); - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - - while (!doit) { - short val; - unsigned short event= extern_qread(&val); - - if (event==MOUSEY) { - short mval[2]; - - getmouseco_sc(mval); - if ((dir=='h' && mval_prev != mval[1]) || (dir=='v' && mval_prev != mval[0])) { - /* update the previous val with this one for comparison next loop */ - if (dir=='h') mval_prev = mval[1]; - else mval_prev = mval[0]; - - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - - delta= (dir=='h')?(mval[1]-mvalo[1]):(mval[0]-mvalo[0]); - delta= CLAMPIS(delta, -smaller, bigger); - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - bglFlush(); - } - } - else if (event==LEFTMOUSE) { - doit= 1; - } - else if (val) { - if (ELEM(event, ESCKEY, RIGHTMOUSE)) - doit= -1; - else if (ELEM(event, SPACEKEY, RETKEY)) - doit= 1; - } - else BIF_wait_for_statechange(); - - } - draw_front_xor_dirdist_line(dir, edge_position+delta, edge_start, edge_end); - bglFlush(); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - - if (doit==1) { - for (v1= G.curscreen->vertbase.first; v1; v1= v1->next) { - if (v1->flag) { - /* that way a nice AREAGRID */ - if((dir=='v') && v1->vec.x>0 && v1->vec.xsizex-1) { - v1->vec.x+= delta; - if(delta != bigger && delta != -smaller) v1->vec.x-= (v1->vec.x % AREAGRID); - } - if((dir=='h') && v1->vec.y>0 && v1->vec.ysizey-1) { - v1->vec.y+= delta; - - v1->vec.y+= AREAGRID-1; - v1->vec.y-= (v1->vec.y % AREAGRID); - - /* prevent too small top header */ - if(v1->vec.y > G.curscreen->sizey-HEADERY) - v1->vec.y= G.curscreen->sizey-HEADERY; - } - } - v1->flag= 0; - } - - removedouble_scrverts(); - removedouble_scredges(); - testareas(); - } - - mainqenter(DRAWEDGES, 1); - dodrawscreen= 1; /* patch! event gets lost,,,? */ -} - -static void scrollheader(ScrArea *area) -{ - short mval[2], mvalo[2]; - - if(area->headbutlenwinx) { - area->headbutofs= 0; - } - else if(area->headbutofs+area->winx > area->headbutlen) { - area->headbutofs= area->headbutlen-area->winx; - } - - getmouseco_sc(mvalo); - - while(get_mbut() & M_MOUSE) { - getmouseco_sc(mval); - if(mval[0]!=mvalo[0]) { - area->headbutofs-= (mval[0]-mvalo[0]); - - if(area->headbutlen-area->winx < area->headbutofs) area->headbutofs= area->headbutlen-area->winx; - if(area->headbutofs<0) area->headbutofs= 0; - - scrarea_do_headchange(area); - scrarea_do_headdraw(area); - - screen_swapbuffers(); - - mvalo[0]= mval[0]; - } else { - BIF_wait_for_statechange(); - } - } -} - -int select_area(int spacetype) -{ - /* call from edit routines, when there are more areas - * of type 'spacetype', you can indicate an area manually - */ - ScrArea *sa, *sact = NULL; - int tot=0; - unsigned short event = 0; - short val, mval[2]; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==spacetype) { - sact= sa; - tot++; - } - sa= sa->next; - } - - if(tot==0) { - error("Can't do this! Open correct window"); - return 0; - } - - if(tot==1) { - if(curarea!=sact) areawinset(sact->win); - return 1; - } - else if(tot>1) { - set_cursor(CURSOR_HELP); - while(1) { - event= extern_qread(&val); - - if (val) { - if(event==ESCKEY) break; - if(event==LEFTMOUSE) break; - if(event==SPACEKEY) break; - } else { - BIF_wait_for_statechange(); - } - } - screen_set_cursor(G.curscreen); - - /* recalculate winakt */ - getmouseco_sc(mval); - - if(event==LEFTMOUSE) { - ScrArea *sa= screen_find_area_for_pt(G.curscreen, mval); - - if (sa &&sa->spacetype==spacetype) { - G.curscreen->winakt= sa->win; - areawinset(G.curscreen->winakt); - } else { - error("Wrong window"); - return 0; - } - } - } - - if(event==LEFTMOUSE) return 1; - else return 0; -} - -/* ************ END JOIN/SPLIT/MOVE ************** */ -/* **************** DRAW SCREENEDGES ***************** */ - - -void draw_area_emboss(ScrArea *sa) -{ - - /* set transp line */ - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - /* right */ - glColor4ub(0,0,0, 50); - sdrawline(sa->winx-1, 0, sa->winx-1, sa->winy-1); - - /* bottom */ - if(sa->headertype!=HEADERDOWN) { - glColor4ub(0,0,0, 80); - sdrawline(0, 0, sa->winx-1, 0); - } - - /* top */ - if(sa->headertype!=HEADERTOP) { - glColor4ub(255,255,255, 60); - sdrawline(0, sa->winy-1, sa->winx-1, sa->winy-1); - } - /* left */ - glColor4ub(255,255,255, 50); - sdrawline(0, 0, 0, sa->winy); - - glDisable( GL_BLEND ); -} - - -void drawscredge_area(ScrArea *sa) -{ - short x1= sa->v1->vec.x; - short y1= sa->v1->vec.y; - short x2= sa->v3->vec.x; - short y2= sa->v3->vec.y; - - /* this to fill the (undrawn) edge area with back color first */ - glColor3f(SCR_BACK,SCR_BACK,SCR_BACK); - sdrawline(x2, y1, x2, y2); - sdrawline(x1, y1, x2, y1); - - cpack(0x0); - - /* Simple hack to make sure round corners arntdrawn with the minimal theme, - * Nothing wrong with it IMHO, but just be aware its used so the following - * if's never compare true with HEADERTOP or HEADERDOWN */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL) - sa->headertype = -sa->headertype; - - /* right border area */ - if(sa->headertype==HEADERTOP) sdrawline(x2, y1, x2, y2-SCR_ROUND+1); - else if(sa->headertype==HEADERDOWN) sdrawline(x2, y1+SCR_ROUND-1, x2, y2); - else sdrawline(x2, y1, x2, y2); - - /* left border area */ - if(x1>0) { // otherwise it draws the emboss of window over - if(sa->headertype==HEADERTOP) sdrawline(x1, y1, x1, y2-SCR_ROUND+1); - else if(sa->headertype==HEADERDOWN) sdrawline(x1, y1+SCR_ROUND-1, x1, y2); - else sdrawline(x1, y1, x1, y2); - } - /* top border area */ - if(sa->headertype==HEADERTOP) sdrawline(x1+SCR_ROUND-3, y2, x2-SCR_ROUND+3, y2); - else sdrawline(x1, y2, x2, y2); - - /* bottom border area */ - if(sa->headertype==HEADERDOWN) sdrawline(x1+SCR_ROUND-3, y1, x2-SCR_ROUND+3, y1); - else sdrawline(x1, y1, x2, y1); - - /* restore real header type */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL) - sa->headertype = -sa->headertype; -} - -/* ********************************* */ - -/* for depgraph updating, all layers visible in a screen */ -unsigned int screen_view3d_layers(void) -{ - ScrArea *sa; - int layer= G.scene->lay; /* as minimum this */ - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_VIEW3D) - layer |= ((View3D *)sa->spacedata.first)->lay; - } - return layer; -} - -bScreen *default_twosplit() -{ - bScreen *sc= addscreen("screen"); - ScrArea *sa; - - splitarea( (ScrArea *)sc->areabase.first, 'h', 0.99); - sa= sc->areabase.first; - newspace(sa, SPACE_VIEW3D); - newspace(sa->next, SPACE_INFO); - - return sc; -} - -void initscreen(void) -{ - default_twosplit(); -} - -static int curcursor; - -int get_cursor(void) { - return curcursor; -} - -void set_cursor(int curs) { - if (G.background == 0) { - if (curs!=curcursor) { - curcursor= curs; - window_set_cursor(mainwin, curs); - } - } -} - -void unlink_screen(bScreen *sc) { - ScrArea *sa; - - for (sa= sc->areabase.first; sa; sa= sa->next) - del_area(sa); -} - -void warp_pointer(int x, int y) -{ - window_warp_pointer(mainwin, x, y); -} - -void set_timecursor(int nr) -{ - /* 10 8x8 digits */ - static char number_bitmaps[10][8]= { - {0, 56, 68, 68, 68, 68, 68, 56}, - {0, 24, 16, 16, 16, 16, 16, 56}, - {0, 60, 66, 32, 16, 8, 4, 126}, - {0, 124, 32, 16, 56, 64, 66, 60}, - {0, 32, 48, 40, 36, 126, 32, 32}, - {0, 124, 4, 60, 64, 64, 68, 56}, - {0, 56, 4, 4, 60, 68, 68, 56}, - {0, 124, 64, 32, 16, 8, 8, 8}, - {0, 60, 66, 66, 60, 66, 66, 60}, - {0, 56, 68, 68, 120, 64, 68, 56} - }; - unsigned char mask[16][2]; - unsigned char bitmap[16][2]; - int i, idx; - - memset(&bitmap, 0x00, sizeof(bitmap)); - memset(&mask, 0xFF, sizeof(mask)); - - /* print number bottom right justified */ - for (idx= 3; nr && idx>=0; idx--) { - char *digit= number_bitmaps[nr%10]; - int x = idx%2; - int y = idx/2; - - for (i=0; i<8; i++) - bitmap[i + y*8][x]= digit[i]; - nr/= 10; - } - - curcursor= CURSOR_NONE; - window_set_custom_cursor(mainwin, mask, bitmap, 7, 7); - BIF_renderwin_set_custom_cursor(mask, bitmap); -} diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c deleted file mode 100644 index c3264812c4b..00000000000 --- a/source/blender/src/editseq.c +++ /dev/null @@ -1,3705 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_storage_types.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_ipo_types.h" -#include "DNA_curve_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_sequence_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" -#include "DNA_sound_types.h" - -#include "BKE_utildefines.h" -#include "BKE_plugin_types.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_scene.h" - -#include "BIF_space.h" -#include "BIF_interface.h" -#include "BIF_screen.h" -#include "BIF_drawseq.h" -#include "BIF_editseq.h" -#include "BIF_mywindow.h" -#include "BIF_toolbox.h" -#include "BIF_writemovie.h" -#include "BIF_editview.h" -#include "BIF_scrarea.h" -#include "BIF_editsound.h" -#include "BIF_imasel.h" - -#include "BSE_edit.h" -#include "BSE_sequence.h" -#include "BSE_seqeffects.h" -#include "BSE_filesel.h" -#include "BSE_drawipo.h" -#include "BSE_seqaudio.h" -#include "BSE_time.h" - -#include "BDR_editobject.h" - -#include "blendef.h" -#include "mydevice.h" - -static Sequence *_last_seq=0; -static int _last_seq_init=0; - -#ifdef WIN32 -char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "c:\\"; -#else -char last_imagename[FILE_MAXDIR+FILE_MAXFILE]= "/"; -#endif - -char last_sounddir[FILE_MAXDIR+FILE_MAXFILE]= ""; - -#define SEQ_DESEL ~(SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL) - -static int test_overlap_seq(Sequence *); -static void shuffle_seq(Sequence *); - -typedef struct TransSeq { - int start, machine; - int startstill, endstill; - int startdisp, enddisp; - int startofs, endofs; - int final_left, final_right; - int len; -} TransSeq; - -Sequence *get_last_seq() -{ - if(!_last_seq_init) { - Editing *ed; - Sequence *seq; - - ed= G.scene->ed; - if(!ed) return NULL; - - for(seq= ed->seqbasep->first; seq; seq=seq->next) - if(seq->flag & SELECT) - _last_seq= seq; - - _last_seq_init = 1; - } - - return _last_seq; -} - -void set_last_seq(Sequence *seq) -{ - _last_seq = seq; - _last_seq_init = 1; -} - -void clear_last_seq(Sequence *seq) -{ - _last_seq = NULL; - _last_seq_init = 0; -} - -Sequence *get_forground_frame_seq(int frame) -{ - Editing *ed; - Sequence *seq, *best_seq=NULL; - int best_machine = -1; - ed= G.scene->ed; - if(!ed) return NULL; - - for (seq=ed->seqbasep->first; seq; seq= seq->next) { - if(seq->startdisp > frame || seq->enddisp <= frame) - continue; - /* only use elements you can see - not */ - if (ELEM6(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_MOVIE_AND_HD_SOUND, SEQ_COLOR)) { - if (seq->machine > best_machine) { - best_seq = seq; - best_machine = seq->machine; - } - } - } - return best_seq; -} - -/* seq funcs's for transforming internally - notice the difference between start/end and left/right. - - left and right are the bounds at which the setuence is rendered, -start and end are from the start and fixed length of the sequence. -*/ -int seq_tx_get_start(Sequence *seq) { - return seq->start; -} -int seq_tx_get_end(Sequence *seq) -{ - return seq->start+seq->len; -} - -int seq_tx_get_final_left(Sequence *seq) -{ - return (seq->start - seq->startstill) + seq->startofs; -} -int seq_tx_get_final_right(Sequence *seq) -{ - return ((seq->start+seq->len) + seq->endstill) - seq->endofs; -} - -void seq_tx_set_final_left(Sequence *seq, int val) -{ - if (val < (seq)->start) { - seq->startstill = abs(val - (seq)->start); - (seq)->startofs = 0; - } else { - seq->startofs = abs(val - (seq)->start); - seq->startstill = 0; - } -} - -void seq_tx_set_final_right(Sequence *seq, int val) -{ - if (val > (seq)->start + (seq)->len) { - seq->endstill = abs(val - (seq->start + (seq)->len)); - (seq)->endofs = 0; - } else { - seq->endofs = abs(val - ((seq)->start + (seq)->len)); - seq->endstill = 0; - } -} - -/* check if one side can be transformed */ -int seq_tx_check_left(Sequence *seq) -{ - if (seq->flag & SELECT) { - if (seq->flag & SEQ_LEFTSEL) - return 1; - else if (seq->flag & SEQ_RIGHTSEL) - return 0; - - return 1; /* selected and neither left or right handles are, so let us move both */ - } - return 0; -} - -int seq_tx_check_right(Sequence *seq) -{ - if (seq->flag & SELECT) { - if (seq->flag & SEQ_RIGHTSEL) - return 1; - else if (seq->flag & SEQ_LEFTSEL) - return 0; - - return 1; /* selected and neither left or right handles are, so let us move both */ - } - return 0; -} - -/* used so we can do a quick check for single image seq - since they work a bit differently to normal image seq's (during transform) */ -int check_single_seq(Sequence *seq) -{ - if ( seq->len==1 && (seq->type == SEQ_IMAGE || seq->type == SEQ_COLOR)) - return 1; - else - return 0; -} - -static void fix_single_image_seq(Sequence *seq) -{ - int left, start, offset; - if (!check_single_seq(seq)) - return; - - /* make sure the image is always at the start since there is only one, - adjusting its start should be ok */ - left = seq_tx_get_final_left(seq); - start = seq->start; - if (start != left) { - offset = left - start; - seq_tx_set_final_left( seq, seq_tx_get_final_left(seq) - offset ); - seq_tx_set_final_right( seq, seq_tx_get_final_right(seq) - offset ); - seq->start += offset; - } -} - -static void change_plugin_seq(char *str) /* called from fileselect */ -{ - struct SeqEffectHandle sh; - Sequence *last_seq= get_last_seq(); - - if(last_seq && last_seq->type != SEQ_PLUGIN) return; - - sh = get_sequence_effect(last_seq); - sh.free(last_seq); - sh.init_plugin(last_seq, str); - - last_seq->machine = MAX3(last_seq->seq1->machine, - last_seq->seq2->machine, - last_seq->seq3->machine); - - if( test_overlap_seq(last_seq) ) shuffle_seq(last_seq); - - BIF_undo_push("Load/Change Plugin, Sequencer"); -} - - -void boundbox_seq(void) -{ - Sequence *seq; - Editing *ed; - float min[2], max[2]; - - ed= G.scene->ed; - if(ed==0) return; - - min[0]= 0.0; - max[0]= EFRA+1; - min[1]= 0.0; - max[1]= 8.0; - - seq= ed->seqbasep->first; - while(seq) { - - if( min[0] > seq->startdisp-1) min[0]= seq->startdisp-1; - if( max[0] < seq->enddisp+1) max[0]= seq->enddisp+1; - if( max[1] < seq->machine+2.0) max[1]= seq->machine+2.0; - - seq= seq->next; - } - - G.v2d->tot.xmin= min[0]; - G.v2d->tot.xmax= max[0]; - G.v2d->tot.ymin= min[1]; - G.v2d->tot.ymax= max[1]; - -} - -int sequence_is_free_transformable(Sequence * seq) -{ - return seq->type < SEQ_EFFECT - || (get_sequence_effect_num_inputs(seq->type) == 0); -} - -char mouse_cfra_side( int frame ) { - short mval[2]; - float xmouse, ymouse; - getmouseco_areawin(mval); - - /* choose the side based on which side of the playhead the mouse is on */ - areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse); - return (xmouse > frame) ? 'R' : 'L'; -} - -Sequence *find_neighboring_sequence(Sequence *test, int lr, int sel) { -/* looks to the left on lr==1, to the right on lr==2 - sel - 0==unselected, 1==selected, -1==done care*/ - Sequence *seq; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return 0; - - if (sel>0) sel = SELECT; - - seq= ed->seqbasep->first; - while(seq) { - if( (seq!=test) && - (test->machine==seq->machine) && - (test->depth==seq->depth) && - ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel==0 && (seq->flag & SELECT)==0) )) - { - switch (lr) { - case 1: - if (test->startdisp == (seq->enddisp)) { - return seq; - } - break; - case 2: - if (test->enddisp == (seq->startdisp)) { - return seq; - } - break; - } - } - seq= seq->next; - } - return NULL; -} - -Sequence *find_next_prev_sequence(Sequence *test, int lr, int sel) { -/* looks to the left on lr==1, to the right on lr==2 - sel - 0==unselected, 1==selected, -1==done care*/ - Sequence *seq,*best_seq = NULL; - Editing *ed; - - int dist, best_dist; - best_dist = MAXFRAME*2; - - ed= G.scene->ed; - if(ed==0) return 0; - - if (sel) sel = SELECT; - - seq= ed->seqbasep->first; - while(seq) { - if( (seq!=test) && - (test->machine==seq->machine) && - (test->depth==seq->depth) && - ((sel == -1) || (sel==(seq->flag & SELECT)))) - { - dist = MAXFRAME*2; - - switch (lr) { - case 1: - if (seq->enddisp <= test->startdisp) { - dist = test->enddisp - seq->startdisp; - } - break; - case 2: - if (seq->startdisp >= test->enddisp) { - dist = seq->startdisp - test->enddisp; - } - break; - } - - if (dist==0) { - best_seq = seq; - break; - } else if (dist < best_dist) { - best_dist = dist; - best_seq = seq; - } - } - seq= seq->next; - } - return best_seq; /* can be null */ -} - - -Sequence *find_nearest_seq(int *hand) -{ - Sequence *seq; - Editing *ed; - float x, y; - short mval[2]; - float pixelx; - float handsize; - float displen; - View2D *v2d = G.v2d; - *hand= 0; - - ed= G.scene->ed; - if(ed==0) return 0; - - pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin); - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - - seq= ed->seqbasep->first; - - while(seq) { - if(seq->machine == (int)y) { - /* check for both normal strips, and strips that have been flipped horizontally */ - if( ((seq->startdisp < seq->enddisp) && (seq->startdisp<=x && seq->enddisp>=x)) || - ((seq->startdisp > seq->enddisp) && (seq->startdisp>=x && seq->enddisp<=x)) ) - { - if(sequence_is_free_transformable(seq)) { - - /* clamp handles to defined size in pixel space */ - - handsize = seq->handsize; - displen = (float)abs(seq->startdisp - seq->enddisp); - - if (displen / pixelx > 16) { /* dont even try to grab the handles of small strips */ - /* Set the max value to handle to 1/3 of the total len when its less then 28. - * This is important because otherwise selecting handles happens even when you click in the middle */ - - if ((displen/3) < 30*pixelx) { - handsize = displen/3; - } else { - CLAMP(handsize, 7*pixelx, 30*pixelx); - } - - if( handsize+seq->startdisp >=x ) - *hand= 1; - else if( -handsize+seq->enddisp <=x ) - *hand= 2; - } - } - return seq; - } - } - seq= seq->next; - } - return 0; -} - -void update_seq_ipo_rect(Sequence * seq) -{ - float start; - float end; - - if (!seq || !seq->ipo) { - return; - } - start = -5.0; - end = 105.0; - - /* Adjust IPO window to sequence and - avoid annoying snap-back to startframe - when Lock Time is on */ - if (G.v2d->flag & V2D_VIEWLOCK) { - if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - start = -5.0 + seq->startdisp; - end = 5.0 + seq->enddisp; - } else { - start = (float)G.scene->r.sfra - 0.1; - end = G.scene->r.efra; - } - } - - seq->ipo->cur.xmin= start; - seq->ipo->cur.xmax= end; -} - -void update_seq_icu_rects(Sequence * seq) -{ - IpoCurve *icu= NULL; - struct SeqEffectHandle sh; - - if (!seq || !seq->ipo) { - return; - } - - if(!(seq->type & SEQ_EFFECT)) { - return; - } - - sh = get_sequence_effect(seq); - - for(icu= seq->ipo->curve.first; icu; icu= icu->next) { - sh.store_icu_yrange(seq, icu->adrcode, &icu->ymin, &icu->ymax); - } -} - -static int test_overlap_seq(Sequence *test) -{ - Sequence *seq; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return 0; - - seq= ed->seqbasep->first; - while(seq) { - if(seq!=test) { - if(test->machine==seq->machine) { - if(test->depth==seq->depth) { - if( (test->enddisp <= seq->startdisp) || (test->startdisp >= seq->enddisp) ); - else return 1; - } - } - } - seq= seq->next; - } - return 0; -} - -static void shuffle_seq(Sequence *test) -{ - Editing *ed; - Sequence *seq; - int a, start; - - ed= G.scene->ed; - if(ed==0) return; - - /* is there more than 1 select: only shuffle y */ - a=0; - seq= ed->seqbasep->first; - while(seq) { - if(seq->flag & SELECT) a++; - seq= seq->next; - } - - if(a<2 && test->type==SEQ_IMAGE) { - start= test->start; - - for(a= 1; a<50; a++) { - test->start= start+a; - calc_sequence(test); - if( test_overlap_seq(test)==0) return; - test->start= start-a; - calc_sequence(test); - if( test_overlap_seq(test)==0) return; - } - test->start= start; - } - - test->machine++; - calc_sequence(test); - while( test_overlap_seq(test) ) { - if(test->machine >= MAXSEQ) { - error("There is no more space to add a sequence strip"); - - BLI_remlink(ed->seqbasep, test); - free_sequence(test); - return; - } - test->machine++; - calc_sequence(test); - } -} - -static int seq_is_parent(Sequence *par, Sequence *seq) -{ - return ((par->seq1 == seq) || (par->seq2 == seq) || (par->seq3 == seq)); -} - -static int seq_is_predecessor(Sequence *pred, Sequence *seq) -{ - if(pred == seq) return 0; - else if(seq_is_parent(pred, seq)) return 1; - else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1; - else if(pred->seq2 && seq_is_predecessor(pred->seq2, seq)) return 1; - else if(pred->seq3 && seq_is_predecessor(pred->seq3, seq)) return 1; - - return 0; -} - -static void deselect_all_seq(void) -{ - Sequence *seq; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return; - - WHILE_SEQ(ed->seqbasep) { - seq->flag &= SEQ_DESEL; - } - END_SEQ - - BIF_undo_push("(De)select all Strips, Sequencer"); -} - -static void recurs_sel_seq(Sequence *seqm) -{ - Sequence *seq; - - seq= seqm->seqbase.first; - while(seq) { - - if(seqm->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL)) seq->flag &= SEQ_DESEL; - else if(seqm->flag & SELECT) seq->flag |= SELECT; - else seq->flag &= SEQ_DESEL; - - if(seq->seqbase.first) recurs_sel_seq(seq); - - seq= seq->next; - } -} - -void swap_select_seq(void) -{ - Sequence *seq; - Editing *ed; - int sel=0; - - ed= G.scene->ed; - if(ed==0) return; - - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) sel= 1; - } - END_SEQ - - WHILE_SEQ(ed->seqbasep) { - /* always deselect all to be sure */ - seq->flag &= SEQ_DESEL; - if(sel==0) seq->flag |= SELECT; - } - END_SEQ - - allqueue(REDRAWSEQ, 0); - BIF_undo_push("Swap Selected Strips, Sequencer"); - -} - -void select_channel_direction(Sequence *test,int lr) { -/* selects all strips in a channel to one direction of the passed strip */ - Sequence *seq; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return; - - seq= ed->seqbasep->first; - while(seq) { - if(seq!=test) { - if (test->machine==seq->machine) { - if(test->depth==seq->depth) { - if (((lr==1)&&(test->startdisp > (seq->startdisp)))||((lr==2)&&(test->startdisp < (seq->startdisp)))) { - seq->flag |= SELECT; - recurs_sel_seq(seq); - } - } - } - } - seq= seq->next; - } - test->flag |= SELECT; - recurs_sel_seq(test); -} - -void select_dir_from_last(int lr) -{ - Sequence *seq=get_last_seq(); - if (seq==NULL) - return; - - select_channel_direction(seq,lr); - allqueue(REDRAWSEQ, 0); - - if (lr==1) BIF_undo_push("Select Strips to the Left, Sequencer"); - else BIF_undo_push("Select Strips to the Right, Sequencer"); -} - -void select_surrounding_handles(Sequence *test) -{ - Sequence *neighbor; - - neighbor=find_neighboring_sequence(test, 1, -1); - if (neighbor) { - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_RIGHTSEL; - } - neighbor=find_neighboring_sequence(test, 2, -1); - if (neighbor) { - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_LEFTSEL; - } - test->flag |= SELECT; -} - -void select_surround_from_last() -{ - Sequence *seq=get_last_seq(); - - if (seq==NULL) - return; - - select_surrounding_handles(seq); - allqueue(REDRAWSEQ, 0); - BIF_undo_push("Select Surrounding Handles, Sequencer"); -} - -void select_neighbor_from_last(int lr) -{ - Sequence *seq=get_last_seq(); - Sequence *neighbor; - int change = 0; - if (seq) { - neighbor=find_neighboring_sequence(seq, lr, -1); - if (neighbor) { - switch (lr) { - case 1: - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_RIGHTSEL; - seq->flag |= SEQ_LEFTSEL; - break; - case 2: - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_LEFTSEL; - seq->flag |= SEQ_RIGHTSEL; - break; - } - seq->flag |= SELECT; - change = 1; - } - } - if (change) { - allqueue(REDRAWSEQ, 0); - - if (lr==1) BIF_undo_push("Select Left Handles, Sequencer"); - else BIF_undo_push("Select Right Handles, Sequencer"); - } -} - -void mouse_select_seq(void) -{ - Sequence *seq,*neighbor; - int hand,seldir; - TimeMarker *marker; - - marker=find_nearest_marker(1); - - if (marker) { - int oldflag; - /* select timeline marker */ - if (G.qual & LR_SHIFTKEY) { - oldflag= marker->flag; - deselect_markers(0, 0); - - if (oldflag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - } - else { - marker->flag |= SELECT; - } - allqueue(REDRAWMARKER, 0); - force_draw(0); - - BIF_undo_push("Select Strips, Sequencer"); - - } else { - - seq= find_nearest_seq(&hand); - if(!(G.qual & LR_SHIFTKEY)&&!(G.qual & LR_ALTKEY)&&!(G.qual & LR_CTRLKEY)) deselect_all_seq(); - - if(seq) { - set_last_seq(seq); - - if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) { - if(seq->strip) { - strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1); - } - } else - if (seq->type == SEQ_HD_SOUND || seq->type == SEQ_RAM_SOUND) { - if(seq->strip) { - strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1); - } - } - - if((G.qual & LR_SHIFTKEY) && (seq->flag & SELECT)) { - if(hand==0) seq->flag &= SEQ_DESEL; - else if(hand==1) { - if(seq->flag & SEQ_LEFTSEL) - seq->flag &= ~SEQ_LEFTSEL; - else seq->flag |= SEQ_LEFTSEL; - } - else if(hand==2) { - if(seq->flag & SEQ_RIGHTSEL) - seq->flag &= ~SEQ_RIGHTSEL; - else seq->flag |= SEQ_RIGHTSEL; - } - } - else { - seq->flag |= SELECT; - if(hand==1) seq->flag |= SEQ_LEFTSEL; - if(hand==2) seq->flag |= SEQ_RIGHTSEL; - } - - /* On Ctrl-Alt selection, select the strip and bordering handles */ - if ((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) { - if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq(); - seq->flag |= SELECT; - select_surrounding_handles(seq); - - /* Ctrl signals Left, Alt signals Right - First click selects adjacent handles on that side. - Second click selects all strips in that direction. - If there are no adjacent strips, it just selects all in that direction. */ - } else if (((G.qual & LR_CTRLKEY) || (G.qual & LR_ALTKEY)) && (seq->flag & SELECT)) { - - if (G.qual & LR_CTRLKEY) seldir=1; - else seldir=2; - neighbor=find_neighboring_sequence(seq, seldir, -1); - if (neighbor) { - switch (seldir) { - case 1: - if ((seq->flag & SEQ_LEFTSEL)&&(neighbor->flag & SEQ_RIGHTSEL)) { - if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq(); - select_channel_direction(seq,1); - } else { - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_RIGHTSEL; - seq->flag |= SEQ_LEFTSEL; - } - break; - case 2: - if ((seq->flag & SEQ_RIGHTSEL)&&(neighbor->flag & SEQ_LEFTSEL)) { - if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq(); - select_channel_direction(seq,2); - } else { - neighbor->flag |= SELECT; - recurs_sel_seq(neighbor); - neighbor->flag |= SEQ_LEFTSEL; - seq->flag |= SEQ_RIGHTSEL; - } - break; - } - } else { - if (!(G.qual & LR_SHIFTKEY)) deselect_all_seq(); - select_channel_direction(seq,seldir); - } - } - - recurs_sel_seq(seq); - } - force_draw(0); - - if(get_last_seq()) allqueue(REDRAWIPO, 0); - BIF_undo_push("Select Strips, Sequencer"); - - std_rmouse_transform(transform_seq_nomarker); - } - - /* marker transform */ - if (marker) { - short mval[2], xo, yo; - getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; - - while(get_mbut()&R_MOUSE) { - getmouseco_areawin(mval); - if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) { - transform_markers('g', 0); - allqueue(REDRAWMARKER, 0); - return; - } - BIF_wait_for_statechange(); - } - } -} - - -Sequence *alloc_sequence(ListBase *lb, int cfra, int machine) -{ - Sequence *seq; - - /*ed= G.scene->ed;*/ - - seq= MEM_callocN( sizeof(Sequence), "addseq"); - BLI_addtail(lb, seq); - - set_last_seq(seq); - - *( (short *)seq->name )= ID_SEQ; - seq->name[2]= 0; - - seq->flag= SELECT; - seq->start= cfra; - seq->machine= machine; - seq->mul= 1.0; - - return seq; -} - -static Sequence *sfile_to_sequence(SpaceFile *sfile, int cfra, int machine, int last) -{ - Sequence *seq; - Strip *strip; - StripElem *se; - int totsel, a; - char name[160]; - - /* are there selected files? */ - totsel= 0; - for(a=0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if( (sfile->filelist[a].type & S_IFDIR)==0 ) { - totsel++; - } - } - } - - if(last) { - /* if not, a file handed to us? */ - if(totsel==0 && sfile->file[0]) totsel= 1; - } - - if(totsel==0) return 0; - - /* make seq */ - seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - seq->len= totsel; - - if(totsel==1) { - seq->startstill= 25; - seq->endstill= 24; - } - - calc_sequence(seq); - - if(sfile->flag & FILE_STRINGCODE) { - strcpy(name, sfile->dir); - BLI_makestringcode(G.sce, name); - } else { - strcpy(name, sfile->dir); - } - - /* strip and stripdata */ - seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len= totsel; - strip->us= 1; - strncpy(strip->dir, name, FILE_MAXDIR-1); - strip->stripdata= se= MEM_callocN(totsel*sizeof(StripElem), "stripelem"); - - for(a=0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if( (sfile->filelist[a].type & S_IFDIR)==0 ) { - strncpy(se->name, sfile->filelist[a].relname, FILE_MAXFILE-1); - se++; - } - } - } - /* no selected file: */ - if(totsel==1 && se==strip->stripdata) { - strncpy(se->name, sfile->file, FILE_MAXFILE-1); - } - - /* last active name */ - strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1); - - return seq; -} - - -static int sfile_to_mv_sequence_load(SpaceFile *sfile, int cfra, - int machine, int index ) -{ - Sequence *seq; - struct anim *anim; - Strip *strip; - StripElem *se; - int totframe; - char name[160]; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - totframe= 0; - - strncpy(str, sfile->dir, FILE_MAXDIR-1); - if(index<0) - strncat(str, sfile->file, FILE_MAXDIR-1); - else - strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1); - - /* is it a movie? */ - anim = openanim(str, IB_rect); - if(anim==0) { - error("The selected file is not a movie or " - "FFMPEG-support not compiled in!"); - return(cfra); - } - - totframe= IMB_anim_get_duration(anim); - - /* make seq */ - seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - seq->len= totframe; - seq->type= SEQ_MOVIE; - seq->anim= anim; - seq->anim_preseek = IMB_anim_get_preseek(anim); - - calc_sequence(seq); - - if(sfile->flag & FILE_STRINGCODE) { - strcpy(name, sfile->dir); - BLI_makestringcode(G.sce, name); - } else { - strcpy(name, sfile->dir); - } - - /* strip and stripdata */ - seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len= totframe; - strip->us= 1; - strncpy(strip->dir, name, FILE_MAXDIR-1); - strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); - - /* name movie in first strip */ - if(index<0) - strncpy(se->name, sfile->file, FILE_MAXFILE-1); - else - strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1); - - /* last active name */ - strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1); - return(cfra+totframe); -} - -static void sfile_to_mv_sequence(SpaceFile *sfile, int cfra, int machine) -{ - int a, totsel; - - totsel= 0; - for(a= 0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if ((sfile->filelist[a].type & S_IFDIR)==0) { - totsel++; - } - } - } - - if((totsel==0) && (sfile->file[0])) { - cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, -1); - return; - } - - if(totsel==0) return; - - /* ok. check all the select file, and load it. */ - for(a= 0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if ((sfile->filelist[a].type & S_IFDIR)==0) { - /* load and update current frame. */ - cfra= sfile_to_mv_sequence_load(sfile, cfra, machine, a); - } - } - } -} - -static Sequence *sfile_to_ramsnd_sequence(SpaceFile *sfile, - int cfra, int machine) -{ - Sequence *seq; - bSound *sound; - Strip *strip; - StripElem *se; - double totframe; - char name[160]; - char str[256]; - - totframe= 0.0; - - strncpy(str, sfile->dir, FILE_MAXDIR-1); - strncat(str, sfile->file, FILE_MAXFILE-1); - - sound= sound_new_sound(str); - if (!sound || sound->sample->type == SAMPLE_INVALID) { - error("Unsupported audio format"); - return 0; - } - if (sound->sample->bits != 16) { - error("Only 16 bit audio is supported"); - return 0; - } - sound->id.us=1; - sound->flags |= SOUND_FLAGS_SEQUENCE; - audio_makestream(sound); - - totframe= (int) ( ((float)(sound->streamlen-1)/ - ( (float)G.scene->audio.mixrate*4.0 ))* FPS); - - /* make seq */ - seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - seq->len= totframe; - seq->type= SEQ_RAM_SOUND; - seq->sound = sound; - - calc_sequence(seq); - - if(sfile->flag & FILE_STRINGCODE) { - strcpy(name, sfile->dir); - BLI_makestringcode(G.sce, name); - } else { - strcpy(name, sfile->dir); - } - - /* strip and stripdata */ - seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len= totframe; - strip->us= 1; - strncpy(strip->dir, name, FILE_MAXDIR-1); - strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); - - /* name sound in first strip */ - strncpy(se->name, sfile->file, FILE_MAXFILE-1); - - /* last active name */ - strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1); - - return seq; -} - -static int sfile_to_hdsnd_sequence_load(SpaceFile *sfile, int cfra, - int machine, int index) -{ - Sequence *seq; - struct hdaudio *hdaudio; - Strip *strip; - StripElem *se; - int totframe; - char name[160]; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - totframe= 0; - - strncpy(str, sfile->dir, FILE_MAXDIR-1); - if(index<0) - strncat(str, sfile->file, FILE_MAXDIR-1); - else - strncat(str, sfile->filelist[index].relname, FILE_MAXDIR-1); - - /* is it a sound file? */ - hdaudio = sound_open_hdaudio(str); - if(hdaudio==0) { - error("The selected file is not a sound file or " - "FFMPEG-support not compiled in!"); - return(cfra); - } - - totframe= sound_hdaudio_get_duration(hdaudio, FPS); - - /* make seq */ - seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - seq->len= totframe; - seq->type= SEQ_HD_SOUND; - seq->hdaudio= hdaudio; - - calc_sequence(seq); - - if(sfile->flag & FILE_STRINGCODE) { - strcpy(name, sfile->dir); - BLI_makestringcode(G.sce, name); - } else { - strcpy(name, sfile->dir); - } - - /* strip and stripdata */ - seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len= totframe; - strip->us= 1; - strncpy(strip->dir, name, FILE_MAXDIR-1); - strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); - - /* name movie in first strip */ - if(index<0) - strncpy(se->name, sfile->file, FILE_MAXFILE-1); - else - strncpy(se->name, sfile->filelist[index].relname, FILE_MAXFILE-1); - - /* last active name */ - strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1); - return(cfra+totframe); -} - -static void sfile_to_hdsnd_sequence(SpaceFile *sfile, int cfra, int machine) -{ - int totsel, a; - - totsel= 0; - for(a= 0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if((sfile->filelist[a].type & S_IFDIR)==0) { - totsel++; - } - } - } - - if((totsel==0) && (sfile->file[0])) { - cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, -1); - return; - } - - if(totsel==0) return; - - /* ok, check all the select file, and load it. */ - for(a= 0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - if((sfile->filelist[a].type & S_IFDIR)==0) { - /* load and update current frame. */ - cfra= sfile_to_hdsnd_sequence_load(sfile, cfra, machine, a); - } - } - } -} - - -static void add_image_strips(char *name) -{ - SpaceFile *sfile; - struct direntry *files; - float x, y; - int a, totfile, cfra, machine; - short mval[2]; - - deselect_all_seq(); - - /* restore windowmatrices */ - areawinset(curarea->win); - drawseqspace(curarea, curarea->spacedata.first); - - /* search sfile */ - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if(sfile==0) return; - - /* where will it be */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - waitcursor(1); - - /* also read contents of directories */ - files= sfile->filelist; - totfile= sfile->totfile; - sfile->filelist= 0; - sfile->totfile= 0; - - for(a=0; adir, files[a].relname, FILE_MAXFILE-1); - strcat(sfile->dir,"/"); - read_dir(sfile); - - /* select all */ - swapselect_file(sfile); - - if ( sfile_to_sequence(sfile, cfra, machine, 0) ) machine++; - - parent(sfile); - } - } - } - - sfile->filelist= files; - sfile->totfile= totfile; - - /* read directory itself */ - sfile_to_sequence(sfile, cfra, machine, 1); - - waitcursor(0); - - BIF_undo_push("Add Image Strip, Sequencer"); - transform_seq_nomarker('g', 0); - -} - -static void add_movie_strip(char *name) -{ - SpaceFile *sfile; - float x, y; - int cfra, machine; - short mval[2]; - - deselect_all_seq(); - - /* restore windowmatrices */ - areawinset(curarea->win); - drawseqspace(curarea, curarea->spacedata.first); - - /* search sfile */ - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if(sfile==0) return; - - /* where will it be */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - waitcursor(1); - - /* read directory itself */ - sfile_to_mv_sequence(sfile, cfra, machine); - - waitcursor(0); - - BIF_undo_push("Add Movie Strip, Sequencer"); - transform_seq_nomarker('g', 0); - -} - -static void add_movie_and_hdaudio_strip(char *name) -{ - SpaceFile *sfile; - float x, y; - int cfra, machine; - short mval[2]; - - deselect_all_seq(); - - /* restore windowmatrices */ - areawinset(curarea->win); - drawseqspace(curarea, curarea->spacedata.first); - - /* search sfile */ - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if(sfile==0) return; - - /* where will it be */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - waitcursor(1); - - /* read directory itself */ - sfile_to_hdsnd_sequence(sfile, cfra, machine); - sfile_to_mv_sequence(sfile, cfra, machine); - - waitcursor(0); - - BIF_undo_push("Add Movie and HD-Audio Strip, Sequencer"); - transform_seq_nomarker('g', 0); - -} - -static void add_sound_strip_ram(char *name) -{ - SpaceFile *sfile; - float x, y; - int cfra, machine; - short mval[2]; - - deselect_all_seq(); - - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if (sfile==0) return; - - /* where will it be */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - waitcursor(1); - - sfile_to_ramsnd_sequence(sfile, cfra, machine); - - waitcursor(0); - - BIF_undo_push("Add Sound (RAM) Strip, Sequencer"); - transform_seq_nomarker('g', 0); -} - -static void add_sound_strip_hd(char *name) -{ - SpaceFile *sfile; - float x, y; - int cfra, machine; - short mval[2]; - - deselect_all_seq(); - - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if (sfile==0) return; - - /* where will it be */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - waitcursor(1); - - sfile_to_hdsnd_sequence(sfile, cfra, machine); - - waitcursor(0); - - BIF_undo_push("Add Sound (HD) Strip, Sequencer"); - transform_seq_nomarker('g', 0); -} - -#if 0 -static void reload_sound_strip(char *name) -{ - Editing *ed; - Sequence *seq, *seqact; - SpaceFile *sfile; - Sequence *last_seq= get_last_seq(); - - ed= G.scene->ed; - - if(last_seq==0 || last_seq->type!=SEQ_SOUND) return; - seqact= last_seq; /* last_seq changes in alloc_sequence */ - - /* search sfile */ - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if(sfile==0) return; - - waitcursor(1); - - seq = sfile_to_snd_sequence(sfile, seqact->start, seqact->machine); - printf("seq->type: %i\n", seq->type); - if(seq && seq!=seqact) { - /* i'm not sure about this one, seems to work without it -- sgefant */ - free_strip(seqact->strip); - - seqact->strip= seq->strip; - - seqact->len= seq->len; - calc_sequence(seqact); - - seq->strip= 0; - free_sequence(seq); - BLI_remlink(ed->seqbasep, seq); - - seq= ed->seqbasep->first; - - } - - waitcursor(0); - - allqueue(REDRAWSEQ, 0); -} -#endif - -static void reload_image_strip(char *name) -{ - Editing *ed; - Sequence *seq, *seqact; - SpaceFile *sfile; - Sequence *last_seq= get_last_seq(); - - ed= G.scene->ed; - - if(last_seq==0 || last_seq->type!=SEQ_IMAGE) return; - seqact= last_seq; /* last_seq changes in alloc_sequence */ - - /* search sfile */ - sfile= scrarea_find_space_of_type(curarea, SPACE_FILE); - if(sfile==0) return; - - waitcursor(1); - - seq= sfile_to_sequence(sfile, seqact->start, seqact->machine, 1); - if(seq && seq!=seqact) { - free_strip(seqact->strip); - - seqact->strip= seq->strip; - - seqact->len= seq->len; - calc_sequence(seqact); - - seq->strip= 0; - free_sequence(seq); - BLI_remlink(ed->seqbasep, seq); - - update_changed_seq_and_deps(seqact, 1, 1); - } - waitcursor(0); - - allqueue(REDRAWSEQ, 0); -} - -static int event_to_efftype(int event) -{ - if(event==2) return SEQ_CROSS; - if(event==3) return SEQ_GAMCROSS; - if(event==4) return SEQ_ADD; - if(event==5) return SEQ_SUB; - if(event==6) return SEQ_MUL; - if(event==7) return SEQ_ALPHAOVER; - if(event==8) return SEQ_ALPHAUNDER; - if(event==9) return SEQ_OVERDROP; - if(event==10) return SEQ_PLUGIN; - if(event==13) return SEQ_WIPE; - if(event==14) return SEQ_GLOW; - if(event==15) return SEQ_TRANSFORM; - if(event==16) return SEQ_COLOR; - if(event==17) return SEQ_SPEED; - return 0; -} - -static int seq_effect_find_selected(Editing *ed, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3) -{ - Sequence *seq1= 0, *seq2= 0, *seq3= 0, *seq; - - if (!activeseq) - seq2= get_last_seq(); - - for(seq=ed->seqbasep->first; seq; seq=seq->next) { - if(seq->flag & SELECT) { - if (seq->type == SEQ_RAM_SOUND - || seq->type == SEQ_HD_SOUND) { - error("Can't apply effects to " - "audio sequence strips"); - return 0; - } - if((seq != activeseq) && (seq != seq2)) { - if(seq2==0) seq2= seq; - else if(seq1==0) seq1= seq; - else if(seq3==0) seq3= seq; - else { - error("Can't apply effect to more than 3 sequence strips"); - return 0; - } - } - } - } - - /* make sequence selection a little bit more intuitive - for 3 strips: the last-strip should be sequence3 */ - if (seq3 != 0 && seq2 != 0) { - Sequence *tmp = seq2; - seq2 = seq3; - seq3 = tmp; - } - - - switch(get_sequence_effect_num_inputs(type)) { - case 0: - seq1 = seq2 = seq3 = 0; - break; - case 1: - if(seq2==0) { - error("Need at least one selected sequence strip"); - return 0; - } - if(seq1==0) seq1= seq2; - if(seq3==0) seq3= seq2; - case 2: - if(seq1==0 || seq2==0) { - error("Need 2 selected sequence strips"); - return 0; - } - if(seq3==0) seq3= seq2; - } - - *selseq1= seq1; - *selseq2= seq2; - *selseq3= seq3; - - return 1; -} - -static int add_seq_effect(int type, char *str) -{ - Editing *ed; - Sequence *newseq, *seq1, *seq2, *seq3; - Strip *strip; - float x, y; - int cfra, machine; - short mval[2]; - struct SeqEffectHandle sh; - - if(G.scene->ed==0) return 0; - ed= G.scene->ed; - - if(!seq_effect_find_selected(ed, NULL, event_to_efftype(type), &seq1, &seq2, &seq3)) - return 0; - - deselect_all_seq(); - - /* where will it be (cfra is not realy needed) */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - /* allocate and initialize */ - newseq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - newseq->type= event_to_efftype(type); - - sh = get_sequence_effect(newseq); - - newseq->seq1= seq1; - newseq->seq2= seq2; - newseq->seq3= seq3; - - sh.init(newseq); - - if (!seq1) { - newseq->len= 1; - newseq->startstill= 25; - newseq->endstill= 24; - } - - calc_sequence(newseq); - - newseq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strip->len= newseq->len; - strip->us= 1; - if(newseq->len>0) - strip->stripdata= MEM_callocN(newseq->len*sizeof(StripElem), "stripelem"); - - /* initialize plugin */ - if(newseq->type == SEQ_PLUGIN) { - sh.init_plugin(newseq, str); - - if(newseq->plugin==0) { - BLI_remlink(ed->seqbasep, newseq); - free_sequence(newseq); - set_last_seq(NULL); - return 0; - } - } - - /* set find a free spot to but the strip */ - if (newseq->seq1) { - newseq->machine= MAX3(newseq->seq1->machine, - newseq->seq2->machine, - newseq->seq3->machine); - } - if(test_overlap_seq(newseq)) shuffle_seq(newseq); - - update_changed_seq_and_deps(newseq, 1, 1); - - /* push undo and go into grab mode */ - if(newseq->type == SEQ_PLUGIN) { - BIF_undo_push("Add Plugin Strip, Sequencer"); - } else { - BIF_undo_push("Add Effect Strip, Sequencer"); - } - - transform_seq_nomarker('g', 0); - - return 1; -} - -static void load_plugin_seq(char *str) /* called from fileselect */ -{ - add_seq_effect(10, str); -} - -void add_sequence(int type) -{ - Editing *ed; - Sequence *seq; - Strip *strip; - Scene *sce; - float x, y; - int cfra, machine; - short nr, event, mval[2]; - char *str; - - if (type >= 0){ - /* bypass pupmenu for calls from menus (aphex) */ - switch(type){ - case SEQ_SCENE: - event = 101; - break; - case SEQ_IMAGE: - event = 1; - break; - case SEQ_MOVIE: - event = 102; - break; - case SEQ_RAM_SOUND: - event = 103; - break; - case SEQ_HD_SOUND: - event = 104; - break; - case SEQ_MOVIE_AND_HD_SOUND: - event = 105; - break; - case SEQ_PLUGIN: - event = 10; - break; - case SEQ_CROSS: - event = 2; - break; - case SEQ_ADD: - event = 4; - break; - case SEQ_SUB: - event = 5; - break; - case SEQ_ALPHAOVER: - event = 7; - break; - case SEQ_ALPHAUNDER: - event = 8; - break; - case SEQ_GAMCROSS: - event = 3; - break; - case SEQ_MUL: - event = 6; - break; - case SEQ_OVERDROP: - event = 9; - break; - case SEQ_WIPE: - event = 13; - break; - case SEQ_GLOW: - event = 14; - break; - case SEQ_TRANSFORM: - event = 15; - break; - case SEQ_COLOR: - event = 16; - break; - case SEQ_SPEED: - event = 17; - break; - default: - event = 0; - break; - } - } - else { - event= pupmenu("Add Sequence Strip%t" - "|Image Sequence%x1" - "|Movie%x102" -#ifdef WITH_FFMPEG - "|Movie + Audio (HD)%x105" - "|Audio (RAM)%x103" - "|Audio (HD)%x104" -#else - "|Audio (Wav)%x103" -#endif - "|Scene%x101" - "|Plugin%x10" - "|Cross%x2" - "|Gamma Cross%x3" - "|Add%x4" - "|Sub%x5" - "|Mul%x6" - "|Alpha Over%x7" - "|Alpha Under%x8" - "|Alpha Over Drop%x9" - "|Wipe%x13" - "|Glow%x14" - "|Transforms%x15" - "|Color Generator%x16" - "|Speed Control%x17"); - } - - if(event<1) return; - - if(G.scene->ed==0) { - ed= G.scene->ed= MEM_callocN( sizeof(Editing), "addseq"); - ed->seqbasep= &ed->seqbase; - } - else ed= G.scene->ed; - - switch(event) { - case 1: - /* Image Dosnt work at the moment - TODO */ - //if(G.qual & LR_CTRLKEY) - // activate_imageselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips); - //else - activate_fileselect(FILE_SPECIAL, "Select Images", last_imagename, add_image_strips); - break; - case 105: - activate_fileselect(FILE_SPECIAL, "Select Movie+Audio", last_imagename, add_movie_and_hdaudio_strip); - break; - case 102: - - activate_fileselect(FILE_SPECIAL, "Select Movie", last_imagename, add_movie_strip); - break; - case 101: - /* new menu: */ - IDnames_to_pupstring(&str, NULL, NULL, &G.main->scene, (ID *)G.scene, NULL); - - event= pupmenu_col(str, 20); - - if(event> -1) { - nr= 1; - sce= G.main->scene.first; - while(sce) { - if( event==nr) break; - nr++; - sce= sce->id.next; - } - if(sce) { - - deselect_all_seq(); - - /* where ? */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &x, &y); - cfra= (int)(x+0.5); - machine= (int)(y+0.5); - - seq= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, cfra, machine); - seq->type= SEQ_SCENE; - seq->scene= sce; - seq->sfra= sce->r.sfra; - seq->len= sce->r.efra - sce->r.sfra + 1; - - seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); - strncpy(seq->name + 2, sce->id.name + 2, - sizeof(seq->name) - 2); - strip->len= seq->len; - strip->us= 1; - if(seq->len>0) strip->stripdata= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); - - BIF_undo_push("Add Scene Strip, Sequencer"); - transform_seq_nomarker('g', 0); - } - } - MEM_freeN(str); - - break; - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 13: - case 14: - case 15: - case 16: - case 17: - if(get_last_seq()==0 && - get_sequence_effect_num_inputs( event_to_efftype(event))> 0) - error("Need at least one active sequence strip"); - else if(event==10) - activate_fileselect(FILE_SPECIAL, "Select Plugin", U.plugseqdir, load_plugin_seq); - else - add_seq_effect(event, NULL); - - break; - case 103: - if (!last_sounddir[0]) strncpy(last_sounddir, U.sounddir, FILE_MAXDIR-1); - activate_fileselect(FILE_SPECIAL, "Select Audio (RAM)", last_sounddir, add_sound_strip_ram); - break; - case 104: - if (!last_sounddir[0]) strncpy(last_sounddir, U.sounddir, FILE_MAXDIR-1); - activate_fileselect(FILE_SPECIAL, "Select Audio (HD)", last_sounddir, add_sound_strip_hd); - break; - } -} - -void change_sequence(void) -{ - Sequence *last_seq= get_last_seq(); - Scene *sce; - short event; - - if(last_seq==0) return; - - if(last_seq->type & SEQ_EFFECT) { - event = pupmenu("Change Effect%t" - "|Switch A <-> B %x1" - "|Switch B <-> C %x10" - "|Plugin%x11" - "|Recalculate%x12" - "|Cross%x2" - "|Gamma Cross%x3" - "|Add%x4" - "|Sub%x5" - "|Mul%x6" - "|Alpha Over%x7" - "|Alpha Under%x8" - "|Alpha Over Drop%x9" - "|Wipe%x13" - "|Glow%x14" - "|Transform%x15" - "|Color Generator%x16" - "|Speed Control%x17"); - if(event > 0) { - if(event==1) { - SWAP(Sequence *,last_seq->seq1,last_seq->seq2); - } - else if(event==10) { - SWAP(Sequence *,last_seq->seq2,last_seq->seq3); - } - else if(event==11) { - activate_fileselect( - FILE_SPECIAL, "Select Plugin", - U.plugseqdir, change_plugin_seq); - } - else if(event==12); - /* recalculate: only new_stripdata */ - else { - /* free previous effect and init new effect */ - struct SeqEffectHandle sh; - - if (get_sequence_effect_num_inputs( - last_seq->type) - < get_sequence_effect_num_inputs( - event_to_efftype(event))) { - error("New effect needs more " - "input strips!"); - } else { - sh = get_sequence_effect(last_seq); - sh.free(last_seq); - - last_seq->type - = event_to_efftype(event); - - sh = get_sequence_effect(last_seq); - sh.init(last_seq); - } - } - - update_changed_seq_and_deps(last_seq, 0, 1); - allqueue(REDRAWSEQ, 0); - BIF_undo_push("Change Strip Effect, Sequencer"); - } - } - else if(last_seq->type == SEQ_IMAGE) { - if(okee("Change images")) { - activate_fileselect(FILE_SPECIAL, - "Select Images", - last_imagename, - reload_image_strip); - } - } - else if(last_seq->type == SEQ_MOVIE) { - ; - } - else if(last_seq->type == SEQ_SCENE) { - event= pupmenu("Change Scene%t|Update Start and End"); - - if(event==1) { - sce= last_seq->scene; - - last_seq->len= sce->r.efra - sce->r.sfra + 1; - last_seq->sfra= sce->r.sfra; - - /* bad code to change seq->len? update_changed_seq_and_deps() expects the strip->len to be OK */ - new_tstripdata(last_seq); - - update_changed_seq_and_deps(last_seq, 1, 1); - - allqueue(REDRAWSEQ, 0); - } - } - -} - -void reload_sequence(void) -{ - Editing *ed= G.scene->ed; - Sequence *seq; - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - update_changed_seq_and_deps(seq, 0, 1); - } - } - END_SEQ - allqueue(REDRAWSEQ, 0); -} - -void reassign_inputs_seq_effect() -{ - Editing *ed= G.scene->ed; - Sequence *seq1, *seq2, *seq3, *last_seq = get_last_seq(); - - if(last_seq==0 || !(last_seq->type & SEQ_EFFECT)) return; - if(ed==0) return; - - if(!seq_effect_find_selected(ed, last_seq, last_seq->type, &seq1, &seq2, &seq3)) - return; - - /* see reassigning would create a cycle */ - if(seq_is_predecessor(seq1, last_seq) || seq_is_predecessor(seq2, last_seq) || - seq_is_predecessor(seq3, last_seq)) { - error("Can't reassign inputs: no cycles allowed"); - return; - } - - last_seq->seq1 = seq1; - last_seq->seq2 = seq2; - last_seq->seq3 = seq3; - - update_changed_seq_and_deps(last_seq, 1, 1); - - allqueue(REDRAWSEQ, 0); -} - -static Sequence *del_seq_find_replace_recurs(Sequence *seq) -{ - Sequence *seq1, *seq2, *seq3; - - /* try to find a replacement input sequence, and flag for later deletion if - no replacement can be found */ - - if(!seq) - return NULL; - else if(!(seq->type & SEQ_EFFECT)) - return ((seq->flag & SELECT)? NULL: seq); - else if(!(seq->flag & SELECT)) { - /* try to find replacement for effect inputs */ - seq1= del_seq_find_replace_recurs(seq->seq1); - seq2= del_seq_find_replace_recurs(seq->seq2); - seq3= del_seq_find_replace_recurs(seq->seq3); - - if(seq1==seq->seq1 && seq2==seq->seq2 && seq3==seq->seq3); - else if(seq1 || seq2 || seq3) { - seq->seq1= (seq1)? seq1: (seq2)? seq2: seq3; - seq->seq2= (seq2)? seq2: (seq1)? seq1: seq3; - seq->seq3= (seq3)? seq3: (seq1)? seq1: seq2; - - update_changed_seq_and_deps(seq, 1, 1); - } - else - seq->flag |= SELECT; /* mark for delete */ - } - - if (seq->flag & SELECT) { - if((seq1 = del_seq_find_replace_recurs(seq->seq1))) return seq1; - if((seq2 = del_seq_find_replace_recurs(seq->seq2))) return seq2; - if((seq3 = del_seq_find_replace_recurs(seq->seq3))) return seq3; - else return NULL; - } - else - return seq; -} - -static void recurs_del_seq_flag(ListBase *lb, short flag, short deleteall) -{ - Sequence *seq, *seqn; - Sequence *last_seq = get_last_seq(); - - seq= lb->first; - while(seq) { - seqn= seq->next; - if((seq->flag & flag) || deleteall) { - if(seq->type==SEQ_RAM_SOUND && seq->sound) - seq->sound->id.us--; - - BLI_remlink(lb, seq); - if(seq==last_seq) set_last_seq(0); - if(seq->type==SEQ_META) recurs_del_seq_flag(&seq->seqbase, flag, 1); - if(seq->ipo) seq->ipo->id.us--; - free_sequence(seq); - } - seq= seqn; - } -} - -void del_seq(void) -{ - Sequence *seq; - MetaStack *ms; - Editing *ed; - - if(okee("Erase selected")==0) return; - - ed= G.scene->ed; - if(ed==0) return; - - /* free imbufs of all dependent strips */ - for(seq=ed->seqbasep->first; seq; seq=seq->next) - if(seq->flag & SELECT) - update_changed_seq_and_deps(seq, 1, 0); - - /* for effects, try to find a replacement input */ - for(seq=ed->seqbasep->first; seq; seq=seq->next) - if((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT)) - del_seq_find_replace_recurs(seq); - - /* delete all selected strips */ - recurs_del_seq_flag(ed->seqbasep, SELECT, 0); - - /* updates lengths etc */ - seq= ed->seqbasep->first; - while(seq) { - calc_sequence(seq); - seq= seq->next; - } - - /* free parent metas */ - ms= ed->metastack.last; - while(ms) { - ms->parseq->strip->len= 0; /* force new alloc */ - calc_sequence(ms->parseq); - ms= ms->prev; - } - - BIF_undo_push("Delete Strip(s), Sequencer"); - allqueue(REDRAWSEQ, 0); -} - -static Sequence *dupli_seq(Sequence *seq) { - Sequence *seqn = NULL; - - if(seq->type==SEQ_META) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = 0; - seqn->strip->tstripdata = 0; - - seqn->seqbase.first= seqn->seqbase.last= 0; - /* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */ - /* - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase);*/ - } - else if(seq->type == SEQ_SCENE) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = 0; - seqn->strip->tstripdata = 0; - } - else if(seq->type == SEQ_MOVIE) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = - MEM_dupallocN(seq->strip->stripdata); - seqn->strip->tstripdata = 0; - seqn->anim= 0; - } - else if(seq->type == SEQ_RAM_SOUND) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = - MEM_dupallocN(seq->strip->stripdata); - seqn->strip->tstripdata = 0; - - seqn->anim= 0; - seqn->sound->id.us++; - if(seqn->ipo) seqn->ipo->id.us++; - } - else if(seq->type == SEQ_HD_SOUND) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = - MEM_dupallocN(seq->strip->stripdata); - seqn->strip->tstripdata = 0; - seqn->anim= 0; - seqn->hdaudio = 0; - if(seqn->ipo) seqn->ipo->id.us++; - } else if(seq->type == SEQ_IMAGE) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = - MEM_dupallocN(seq->strip->stripdata); - seqn->strip->tstripdata = 0; - } else if(seq->type >= SEQ_EFFECT) { - seqn= MEM_dupallocN(seq); - seq->tmp= seqn; - - if(seq->seq1 && seq->seq1->tmp) seqn->seq1= seq->seq1->tmp; - if(seq->seq2 && seq->seq2->tmp) seqn->seq2= seq->seq2->tmp; - if(seq->seq3 && seq->seq3->tmp) seqn->seq3= seq->seq3->tmp; - - if(seqn->ipo) seqn->ipo->id.us++; - - if (seq->type & SEQ_EFFECT) { - struct SeqEffectHandle sh; - sh = get_sequence_effect(seq); - if(sh.copy) - sh.copy(seq, seqn); - } - - seqn->strip= MEM_dupallocN(seq->strip); - seqn->strip->stripdata = 0; - seqn->strip->tstripdata = 0; - - } else { - fprintf(stderr, "Aiiiiekkk! sequence type not " - "handled in duplicate!\nExpect a crash" - " now...\n"); - } - - return seqn; -} - -static void recurs_dupli_seq(ListBase *old, ListBase *new) -{ - Sequence *seq; - Sequence *seqn = 0; - Sequence *last_seq = get_last_seq(); - - for(seq= old->first; seq; seq= seq->next) { - seq->tmp= NULL; - if(seq->flag & SELECT) { - seqn = dupli_seq(seq); - if (seqn) { /*should never fail */ - seq->flag &= SEQ_DESEL; - seqn->flag &= ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); - - BLI_addtail(new, seqn); - if(seq->type==SEQ_META) - recurs_dupli_seq(&seq->seqbase,&seqn->seqbase); - - if (seq == last_seq) { - set_last_seq(seqn); - } - } - } - } -} - -/* like duplicate, but only duplicate and cut overlapping strips, - * strips to the left of the cutframe are ignored and strips to the right are moved into the new list */ -static void recurs_cut_seq(ListBase *old, ListBase *new, int cutframe) -{ - Sequence *seq, *seq_next; - Sequence *seqn = 0; - - TransSeq ts; - - seq= old->first; - - while(seq) { - seq_next = seq->next; /* we need this because we may remove seq */ - - seq->tmp= NULL; - if(seq->flag & SELECT) { - if(cutframe > seq->startdisp && cutframe < seq->enddisp) { - - /* backup values */ - ts.start= seq->start; - ts.machine= seq->machine; - ts.startstill= seq->startstill; - ts.endstill= seq->endstill; - ts.startdisp= seq->startdisp; - ts.enddisp= seq->enddisp; - ts.startofs= seq->startofs; - ts.endofs= seq->endofs; - ts.len= seq->len; - - /* First Strip! */ - /* strips with extended stillfames before */ - if(seq->type!=SEQ_META) { - - if ((seq->startstill) && (cutframe start)) { - seq->start= cutframe -1; - seq->startstill= cutframe -seq->startdisp -1; - seq->len= 1; - seq->endstill= 0; - } - - /* normal strip */ - else if ((cutframe >=seq->start)&&(cutframe <=(seq->start+seq->len))) { - seq->endofs = (seq->start+seq->len) - cutframe; - } - - /* strips with extended stillframes after */ - else if (((seq->start+seq->len) < cutframe) && (seq->endstill)) { - seq->endstill -= seq->enddisp - cutframe; - } - - calc_sequence(seq); - } - - /* Duplicate AFTER the first change */ - seqn = dupli_seq(seq); - - if (seqn) { /* should never fail */ - seqn->flag |= SELECT; - - - BLI_addtail(new, seqn); - - /* dont transform meta's - just do their children then recalc */ - if(seq->type==SEQ_META) { - recurs_cut_seq(&seq->seqbase,&seqn->seqbase, cutframe); - } else { - /* Second Strip! */ - /* strips with extended stillframes before */ - if ((seqn->startstill) && (cutframe == seqn->start + 1)) { - seqn->start = ts.start; - seqn->startstill= ts.start- cutframe; - seqn->len = ts.len; - seqn->endstill = ts.endstill; - } - - /* normal strip */ - else if ((cutframe>=seqn->start)&&(cutframe<=(seqn->start+seqn->len))) { - seqn->startstill = 0; - seqn->startofs = cutframe - ts.start; - seqn->endofs = ts.endofs; - seqn->endstill = ts.endstill; - } - - /* strips with extended stillframes after */ - else if (((seqn->start+seqn->len) < cutframe) && (seqn->endstill)) { - seqn->start = cutframe - ts.len +1; - seqn->startofs = ts.len-1; - seqn->endstill = ts.enddisp - cutframe -1; - seqn->startstill = 0; - } - } - - if(seq->type==SEQ_META) /* account for strips within changing */ - calc_sequence(seq); - - calc_sequence(seqn); - } - } else if (seq->enddisp <= cutframe) { - /* do nothing */ - } else if (seq->startdisp >= cutframe) { - /* move into new list */ - BLI_remlink(old, seq); - BLI_addtail(new, seq); - } - } - seq = seq_next; - } -} - -void seq_cut(int cutframe) -{ - Editing *ed; - ListBase newlist; - char side; - ed= G.scene->ed; - if(ed==0) return; - - newlist.first= newlist.last= NULL; - - recurs_cut_seq(ed->seqbasep, &newlist, cutframe); - - if (newlist.first) { /* simple check to see if anything was done */ - Sequence *seq; - addlisttolist(ed->seqbasep, &newlist); - - - /* change the selection, not strictly needed but nice */ - side = mouse_cfra_side(cutframe); - - WHILE_SEQ(ed->seqbasep) { - if (side=='L') { - if ( seq->startdisp >= cutframe ) { - seq->flag &= ~SELECT; - } - } else { - if ( seq->enddisp <= cutframe ) { - seq->flag &= ~SELECT; - } - } - } - END_SEQ; - - /* as last: */ - sort_seq(); - - allqueue(REDRAWSEQ, 0); - BIF_undo_push("Cut Strips, Sequencer"); - } -} - -void add_duplicate_seq(void) -{ - Editing *ed; - ListBase new; - - ed= G.scene->ed; - if(ed==0) return; - - new.first= new.last= 0; - - recurs_dupli_seq(ed->seqbasep, &new); - addlisttolist(ed->seqbasep, &new); - - BIF_undo_push("Add Duplicate, Sequencer"); - transform_seq_nomarker('g', 0); -} - -int insert_gap(int gap, int cfra) -{ - Sequence *seq; - Editing *ed; - int done=0; - - /* all strips >= cfra are shifted */ - ed= G.scene->ed; - if(ed==0) return 0; - - WHILE_SEQ(ed->seqbasep) { - if(seq->startdisp >= cfra) { - seq->start+= gap; - calc_sequence(seq); - done= 1; - } - } - END_SEQ - - return done; -} - -void touch_seq_files(void) -{ - Sequence *seq; - Editing *ed; - char str[256]; - - /* touch all strips with movies */ - ed= G.scene->ed; - if(ed==0) return; - - if(okee("Touch and print selected movies")==0) return; - - waitcursor(1); - - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - if(seq->type==SEQ_MOVIE) { - if(seq->strip && seq->strip->stripdata) { - BLI_make_file_string(G.sce, str, seq->strip->dir, seq->strip->stripdata->name); - BLI_touch(seq->name); - } - } - - } - } - END_SEQ - - waitcursor(0); -} - -void set_filter_seq(void) -{ - Sequence *seq; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return; - - if(okee("Set FilterY")==0) return; - - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - if(seq->type==SEQ_MOVIE) { - seq->flag |= SEQ_FILTERY; - } - - } - } - END_SEQ - -} - -void seq_remap_paths(void) -{ - Sequence *seq, *last_seq = get_last_seq(); - Editing *ed; - char from[FILE_MAX], to[FILE_MAX], stripped[FILE_MAX]; - - ed= G.scene->ed; - if(ed==NULL || last_seq==NULL) - return; - - BLI_strncpy(from, last_seq->strip->dir, FILE_MAX); - if (0==sbutton(from, 0, sizeof(from)-1, "From: ")) - return; - - strcpy(to, from); - if (0==sbutton(to, 0, sizeof(to)-1, "To: ")) - return; - - if (strcmp(to, from)==0) - return; - - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - if(strncmp(seq->strip->dir, from, strlen(from))==0) { - printf("found %s\n", seq->strip->dir); - - /* strip off the beginning */ - stripped[0]= 0; - BLI_strncpy(stripped, seq->strip->dir + strlen(from), FILE_MAX); - - /* new path */ - BLI_strncpy(seq->strip->dir, to, FILE_MAX); - strcat(seq->strip->dir, stripped); - printf("new %s\n", seq->strip->dir); - } - } - } - END_SEQ - - BIF_undo_push("Remap Paths, Sequencer"); - allqueue(REDRAWSEQ, 0); -} - - -void no_gaps(void) -{ - Editing *ed; - int cfra, first= 0, done; - - ed= G.scene->ed; - if(ed==0) return; - - for(cfra= CFRA; cfra<=EFRA; cfra++) { - if(first==0) { - if( evaluate_seq_frame(cfra) ) first= 1; - } - else { - done= 1; - while( evaluate_seq_frame(cfra) == 0) { - done= insert_gap(-1, cfra); - if(done==0) break; - } - if(done==0) break; - } - } - - BIF_undo_push("No Gaps, Sequencer"); - allqueue(REDRAWSEQ, 0); -} - - -/* ****************** META ************************* */ - -void make_meta(void) -{ - Sequence *seq, *seqm, *next; - Editing *ed; - int tot; - - ed= G.scene->ed; - if(ed==0) return; - - /* is there more than 1 select */ - tot= 0; - seq= ed->seqbasep->first; - while(seq) { - if(seq->flag & SELECT) { - tot++; - if (seq->type == SEQ_RAM_SOUND) { - error("Can't make Meta Strip from audio"); - return; - } - } - seq= seq->next; - } - if(tot < 2) return; - - if(okee("Make Meta Strip")==0) return; - - /* test relationships */ - seq= ed->seqbasep->first; - while(seq) { - if(seq->flag & SELECT) { - if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && - (seq->seq1->flag & SELECT)==0) tot= 0; - if(seq->seq2 && - (seq->seq2->flag & SELECT)==0) tot= 0; - if(seq->seq3 && - (seq->seq3->flag & SELECT)==0) tot= 0; - } - } - else if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && - (seq->seq1->flag & SELECT)) tot= 0; - if(seq->seq2 && - (seq->seq2->flag & SELECT)) tot= 0; - if(seq->seq3 && - (seq->seq3->flag & SELECT)) tot= 0; - } - if(tot==0) break; - seq= seq->next; - } - if(tot==0) { - error("Please select all related strips"); - return; - } - - /* remove all selected from main list, and put in meta */ - - seqm= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, 1, 1); - seqm->type= SEQ_META; - seqm->flag= SELECT; - - seq= ed->seqbasep->first; - while(seq) { - next= seq->next; - if(seq!=seqm && (seq->flag & SELECT)) { - BLI_remlink(ed->seqbasep, seq); - BLI_addtail(&seqm->seqbase, seq); - } - seq= next; - } - calc_sequence(seqm); - - seqm->strip= MEM_callocN(sizeof(Strip), "metastrip"); - seqm->strip->len= seqm->len; - seqm->strip->us= 1; - - set_meta_stripdata(seqm); - - if( test_overlap_seq(seqm) ) shuffle_seq(seqm); - - BIF_undo_push("Make Meta Strip, Sequencer"); - allqueue(REDRAWSEQ, 0); -} - -static int seq_depends_on_meta(Sequence *seq, Sequence *seqm) -{ - if (seq == seqm) return 1; - else if (seq->seq1 && seq_depends_on_meta(seq->seq1, seqm)) return 1; - else if (seq->seq2 && seq_depends_on_meta(seq->seq2, seqm)) return 1; - else if (seq->seq3 && seq_depends_on_meta(seq->seq3, seqm)) return 1; - else return 0; -} - -void un_meta(void) -{ - Editing *ed; - Sequence *seq, *last_seq = get_last_seq(); - - ed= G.scene->ed; - if(ed==0) return; - - if(last_seq==0 || last_seq->type!=SEQ_META) return; - - if(okee("Un Meta Strip")==0) return; - - addlisttolist(ed->seqbasep, &last_seq->seqbase); - - last_seq->seqbase.first= 0; - last_seq->seqbase.last= 0; - - BLI_remlink(ed->seqbasep, last_seq); - free_sequence(last_seq); - - /* emtpy meta strip, delete all effects depending on it */ - for(seq=ed->seqbasep->first; seq; seq=seq->next) - if((seq->type & SEQ_EFFECT) && seq_depends_on_meta(seq, last_seq)) - seq->flag |= SEQ_FLAG_DELETE; - - recurs_del_seq_flag(ed->seqbasep, SEQ_FLAG_DELETE, 0); - - /* test for effects and overlap */ - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - seq->flag &= ~SEQ_OVERLAP; - if( test_overlap_seq(seq) ) { - shuffle_seq(seq); - } - } - } - END_SEQ; - - sort_seq(); - - BIF_undo_push("Un-Make Meta Strip, Sequencer"); - allqueue(REDRAWSEQ, 0); - -} - -void exit_meta(void) -{ - Sequence *seq; - MetaStack *ms; - Editing *ed; - - ed= G.scene->ed; - if(ed==0) return; - - if(ed->metastack.first==0) return; - - ms= ed->metastack.last; - BLI_remlink(&ed->metastack, ms); - - ed->seqbasep= ms->oldbasep; - - /* recalc entire meta */ - set_meta_stripdata(ms->parseq); - - /* recalc all: the meta can have effects connected to it */ - seq= ed->seqbasep->first; - while(seq) { - calc_sequence(seq); - seq= seq->next; - } - - set_last_seq(ms->parseq); - - ms->parseq->flag= SELECT; - recurs_sel_seq(ms->parseq); - - MEM_freeN(ms); - allqueue(REDRAWSEQ, 0); - - BIF_undo_push("Exit Meta Strip, Sequence"); -} - - -void enter_meta(void) -{ - MetaStack *ms; - Editing *ed; - Sequence *last_seq= get_last_seq(); - - ed= G.scene->ed; - if(ed==0) return; - - if(last_seq==0 || last_seq->type!=SEQ_META || last_seq->flag==0) { - exit_meta(); - return; - } - - ms= MEM_mallocN(sizeof(MetaStack), "metastack"); - BLI_addtail(&ed->metastack, ms); - ms->parseq= last_seq; - ms->oldbasep= ed->seqbasep; - - ed->seqbasep= &last_seq->seqbase; - - set_last_seq(NULL); - allqueue(REDRAWSEQ, 0); - BIF_undo_push("Enter Meta Strip, Sequence"); -} - - -/* ****************** END META ************************* */ - -static int seq_get_snaplimit(void) -{ - /* fake mouse coords to get the snap value - a bit lazy but its only done once pre transform */ - float xmouse, ymouse, x; - short mval[2] = {24, 0}; /* 24 screen px snap */ - areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse); - x = xmouse; - mval[0] = 0; - areamouseco_to_ipoco(G.v2d, mval, &xmouse, &ymouse); - return (int)(x - xmouse); -} - -/* use to impose limits when dragging/extending - so impossible situations dont happen */ -static void transform_grab_xlimits(Sequence *seq, int leftflag, int rightflag) -{ - if(leftflag) { - if (seq_tx_get_final_left(seq) >= seq_tx_get_final_right(seq)) { - seq_tx_set_final_left(seq, seq_tx_get_final_right(seq)-1); - } - - if (check_single_seq(seq)==0) { - if (seq_tx_get_final_left(seq) >= seq_tx_get_end(seq)) { - seq_tx_set_final_left(seq, seq_tx_get_end(seq)-1); - } - - /* dosnt work now - TODO */ - /* - if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq)) { - int ofs; - ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq); - seq->start -= ofs; - seq_tx_set_final_left(seq, seq_tx_get_final_left(seq) + ofs ); - }*/ - - } - } - - if(rightflag) { - if (seq_tx_get_final_right(seq) <= seq_tx_get_final_left(seq)) { - seq_tx_set_final_right(seq, seq_tx_get_final_left(seq)+1); - } - - if (check_single_seq(seq)==0) { - if (seq_tx_get_final_right(seq) <= seq_tx_get_start(seq)) { - seq_tx_set_final_right(seq, seq_tx_get_start(seq)+1); - } - } - } - - /* sounds cannot be extended past their endpoints */ - if (seq->type == SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND) { - seq->startstill= 0; - seq->endstill= 0; - } -} - -void transform_seq(int mode, int context) -{ - SpaceSeq *sseq= curarea->spacedata.first; - Sequence *seq, *last_seq; - Editing *ed; - float dx, dy, dvec[2], div; - TransSeq *transmain, *ts; - int totstrip=0, firsttime=1, afbreek=0, midtog= 0, proj= 0; - int ix, iy; /* these values are used for storing the mouses offset from its original location */ - int ix_old = 0; - unsigned short event = 0; - short mval[2], val, xo, yo, xn, yn; - char str[32]; - char side= 'L'; /* for extend mode only - use to know which side to extend on */ - char marker_moved=0; /* if we mvoed a marker, redraw all marker views */ - /* used for extend in a number of places */ - int cfra = CFRA; - - /* for snapping */ - char snapskip = 0, snap, snap_old= 0; - int snapdist_max = seq_get_snaplimit(); - /* at the moment there are only 4 possible snap points, - - last_seq (start,end) - - selected bounds (start/end) - - last_seq (next/prev) - - current frame */ - int snap_points[4], snap_point_num = 0; - int j; /* loop on snap_points */ - - /* for markers */ - int *oldframe = NULL, totmark=0, a; - TimeMarker *marker; - - /* looping on sequences, WHILE_SEQ macro allocates memory each time */ - int totseq_index, seq_index; - Sequence **seqar = 0; - - if(mode!='g' && mode!='e') return; /* from gesture */ - - /* which seqs are involved */ - ed= G.scene->ed; - if(ed==0) return; - - /* Build the sequence array once, be sure to free it */ - build_seqar( ed->seqbasep, &seqar, &totseq_index ); - - if (seqar) { - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) totstrip++; - } - } - - if (sseq->flag & SEQ_MARKER_TRANS) { - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) totmark++; - } - } - - if(totstrip==0 && totmark==0) { - if(seqar) MEM_freeN(seqar); - return; - } - - G.moving= 1; - - last_seq = get_last_seq(); - - ts=transmain= MEM_callocN(totstrip*sizeof(TransSeq), "transseq"); - - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - ts->start= seq->start; - ts->machine= seq->machine; - ts->startstill= seq->startstill; - ts->endstill= seq->endstill; - ts->startofs= seq->startofs; - ts->endofs= seq->endofs; - - /* for extend only */ - if (mode=='e') { - ts->final_left = seq_tx_get_final_left(seq); - ts->final_right = seq_tx_get_final_right(seq); - } - ts++; - } - } - - getmouseco_areawin(mval); - - /* choose the side based on which side of the playhead the mouse is on */ - if (mode=='e') - side = mouse_cfra_side(cfra); - - /* Markers */ - if (sseq->flag & SEQ_MARKER_TRANS && totmark) { - oldframe= MEM_mallocN(totmark*sizeof(int), "marker array"); - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - if (mode=='e') { - - /* when extending, invalidate markers on the other side by using an invalid frame value */ - if ((side == 'L' && marker->frame > cfra) || (side == 'R' && marker->frame < cfra)) { - oldframe[a] = MAXFRAME+1; - } else { - oldframe[a]= marker->frame; - } - } else { - oldframe[a]= marker->frame; - } - a++; - } - } - } - - xo=xn= mval[0]; - yo=yn= mval[1]; - dvec[0]= dvec[1]= 0.0; - - while(afbreek==0) { - getmouseco_areawin(mval); - G.qual = get_qual(); - snap = (G.qual & LR_CTRLKEY) ? 1 : 0; - - if(mval[0]!=xo || mval[1]!=yo || firsttime || snap != snap_old) { - if (firsttime) { - snap_old = snap; - firsttime= 0; - } - - /* run for either grab or extend */ - dx= mval[0]- xo; - dy= mval[1]- yo; - - div= G.v2d->mask.xmax-G.v2d->mask.xmin; - dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/div; - - div= G.v2d->mask.ymax-G.v2d->mask.ymin; - dy= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div; - - if(G.qual & LR_SHIFTKEY) { - if(dx>1.0) dx= 1.0; else if(dx<-1.0) dx= -1.0; - } - - dvec[0]+= dx; - dvec[1]+= dy; - - if(midtog) dvec[proj]= 0.0; - ix= floor(dvec[0]+0.5); - iy= floor(dvec[1]+0.5); - - ts= transmain; - - /* SNAP! use the active Seq */ - snap = G.qual & LR_CTRLKEY ? 1 : 0; - - if (!snap) { - snapskip = 0; - } else { - int dist; - int snap_ofs= 0; - int snap_dist= snapdist_max; - - /* Get sequence points to snap to the markers */ - - snap_point_num=0; - if (last_seq && (last_seq->flag & SELECT)) { /* active seq bounds */ - if(seq_tx_check_left(last_seq)) - snap_points[snap_point_num++] = seq_tx_get_final_left(last_seq); - if(seq_tx_check_right(last_seq)) - snap_points[snap_point_num++] = seq_tx_get_final_right(last_seq); - - } - if (totstrip > 1) { /* selection bounds */ - int bounds_left = MAXFRAME*2; - int bounds_right = -(MAXFRAME*2); - - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - if(seq_tx_check_left(seq)) - bounds_left = MIN2(bounds_left, seq_tx_get_final_left(seq)); - if(seq_tx_check_right(seq)) - bounds_right = MAX2(bounds_right,seq_tx_get_final_right(seq)); - } - } - - /* its possible there were no points to set on either side */ - if (bounds_left != MAXFRAME*2) - snap_points[snap_point_num++] = bounds_left; - if (bounds_right != -(MAXFRAME*2)) - snap_points[snap_point_num++] = bounds_right; - } - - - /* Define so we can snap to other points without hassle */ - -#define TESTSNAP(test_frame)\ - for(j=0; jmarkers.first; marker; a++, marker= marker->next) { - - /* dont snap to a marker on the wrong extend side */ - if (mode=='e' && ((side == 'L' && marker->frame > cfra) || (side == 'R' && marker->frame < cfra))) - continue; - - /* when we are moving markers, dont snap to selected markers, durr */ - if ((sseq->flag & SEQ_MARKER_TRANS)==0 || (marker->flag & SELECT)==0) { - - /* loop over the sticky points - max 4 */ - TESTSNAP(marker->frame); - if (snap_dist == 0) break; /* alredy snapped? - stop looking */ - } - } - - if (snap_dist) { - TESTSNAP(cfra); - } - - /* check seq's next to the active also - nice for quick snapping */ - if (snap_dist && last_seq && seq_tx_check_left(last_seq)) { - seq = find_next_prev_sequence(last_seq, 1, 0); /* left */ - if(seq && !seq_tx_check_right(seq)) - TESTSNAP(seq_tx_get_final_right(seq)); - } - - if (snap_dist && last_seq && seq_tx_check_right(last_seq)) { - seq = find_next_prev_sequence(last_seq, 2, 0); /* right */ - if(seq && !seq_tx_check_left(seq)) - TESTSNAP(seq_tx_get_final_left(seq)); - } - -#undef TESTSNAP - - if (abs(ix_old-ix) >= snapdist_max) { - /* mouse has moved out of snap range */ - snapskip = 0; - } else if (snap_dist==0) { - /* nowhere to move, dont do anything */ - snapskip = 1; - } else if (snap_dist < snapdist_max) { - /* do the snapping by adjusting the mouse offset value */ - ix = ix_old + snap_ofs; - } - } - - if (mode=='g' && !snapskip) { - /* Grab */ - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - int myofs; - // SEQ_DEBUG_INFO(seq); - - /* X Transformation */ - if(seq->flag & SEQ_LEFTSEL) { - myofs = (ts->startofs - ts->startstill); - seq_tx_set_final_left(seq, ts->start + (myofs + ix)); - } - if(seq->flag & SEQ_RIGHTSEL) { - myofs = (ts->endstill - ts->endofs); - seq_tx_set_final_right(seq, ts->start + seq->len + (myofs + ix)); - } - transform_grab_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL); - - if( (seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0 ) { - if(sequence_is_free_transformable(seq)) seq->start= ts->start+ ix; - - /* Y Transformation */ - if(seq->depth==0) seq->machine= ts->machine+ iy; - - if(seq->machine<1) seq->machine= 1; - else if(seq->machine>= MAXSEQ) seq->machine= MAXSEQ; - } - calc_sequence(seq); - ts++; - } - } - - /* Markers */ - if (sseq->flag & SEQ_MARKER_TRANS) { - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - marker->frame= oldframe[a] + ix; - marker_moved=1; - a++; - } - } - } - - /* Extend, grabs one side of the current frame */ - } else if (mode=='e' && !snapskip) { - int myofs; /* offset from start of the seq clip */ - int xnew, final_left, final_right; /* just to store results from seq_tx_get_final_left/right */ - - /* we dont use seq side selection flags for this, - instead we need to calculate which sides to move - based on its initial position from the cursor */ - int move_left, move_right; - - /* Extend, Similar to grab but operate on one side of the cursor */ - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - /* only move the contents of the metastrip otherwise the transformation is applied twice */ - if (sequence_is_free_transformable(seq) && seq->type != SEQ_META) { - - move_left = move_right = 0; - - //SEQ_DEBUG_INFO(seq); - - final_left = seq_tx_get_final_left(seq); - final_right = seq_tx_get_final_right(seq); - - /* Only X Axis moving */ - - /* work out which sides to move first */ - if (side=='L') { - if (final_left <= cfra || ts->final_left <= cfra) move_left = 1; - if (final_right <= cfra || ts->final_right <= cfra) move_right = 1; - } else { - if (final_left >= cfra || ts->final_left >= cfra) move_left = 1; - if (final_right >= cfra || ts->final_right >= cfra) move_right = 1; - } - - if (move_left && move_right) { - /* simple move - dont need to do anything complicated */ - seq->start= ts->start+ ix; - } else { - if (side=='L') { - if (move_left) { - - /* Similar to other funcs */ - myofs = (ts->startofs - ts->startstill); - xnew = ts->start + (ix + myofs); - - /* make sure the we dont resize down to 0 or less in size - also include the startstill so the contense dosnt go outside the bounds, - if the seq->startofs is 0 then its ignored */ - - /* TODO remove, add check to transform_grab_xlimits, works ok for now */ - if (xnew + seq->startstill > final_right-1) { - xnew = (final_right-1) - seq->startstill; - } - /* Note, this is the only case where the start needs to be adjusted - since its not needed when modifying the end or when moving the entire sequence */ - //seq->start = ts->start+ix; // This works when xnew is not clamped, line below takes clamping into account - seq->start= xnew - myofs; /* TODO see above */ - /* done with unique stuff */ - - seq_tx_set_final_left(seq, xnew); - transform_grab_xlimits(seq, 1, 0); - - /* Special case again - setting the end back to what it was */ - seq_tx_set_final_right(seq, final_right); - } - if (move_right) { - myofs = (ts->endstill - ts->endofs); - xnew = ts->start + seq->len + (myofs + ix); - seq_tx_set_final_right(seq, xnew); - transform_grab_xlimits(seq, 0, 1); - } - } else { /* R */ - if (move_left) { - myofs = (ts->startofs - ts->startstill); - xnew = ts->start + (myofs + ix); - seq_tx_set_final_left(seq, xnew); - transform_grab_xlimits(seq, 1, 0); - } - if (move_right) { - myofs = (ts->endstill - ts->endofs); - xnew = ts->start + seq->len + (myofs + ix); - seq_tx_set_final_right(seq, xnew); - transform_grab_xlimits(seq, 0, 1); - } - } - } - } - calc_sequence(seq); - ts++; - } - } - - /* markers */ - if (sseq->flag & SEQ_MARKER_TRANS) { - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {\ - if (marker->flag & SELECT) { - if(oldframe[a] != MAXFRAME+1) { - marker->frame= oldframe[a] + ix; - marker_moved=1; - } - a++; - } - } - } - } - - sprintf(str, "X: %d Y: %d ", ix, iy); - headerprint(str); - - /* remember the last value for snapping, - only set if we are not currently snapped, - prevents locking on a keyframe */ - if (!snapskip) - ix_old = ix; - - /* just to tell if ctrl was pressed, this means we get a recalc when pressing ctrl */ - snap_old = snap; - - /* rememver last mouse values so we can skip transform when nothing happens */ - xo= mval[0]; - yo= mval[1]; - - /* test for effect and overlap */ - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - seq->flag &= ~SEQ_OVERLAP; - if( test_overlap_seq(seq) ) { - seq->flag |= SEQ_OVERLAP; - } - } - else if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq); - else if(seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq); - else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq); - } - } - - force_draw(0); - - } - else BIF_wait_for_statechange(); - - while(qtest()) { - event= extern_qread(&val); - if(val) { - switch(event) { - case ESCKEY: - case LEFTMOUSE: - case RIGHTMOUSE: - case SPACEKEY: - case RETKEY: - afbreek= 1; - break; - case MIDDLEMOUSE: - midtog= ~midtog; - if(midtog) { - if( abs(mval[0]-xn) > abs(mval[1]-yn)) proj= 1; - else proj= 0; - firsttime= 1; - } - break; - default: - arrows_move_cursor(event); - } - } - if(afbreek) break; - } - } - - if((event==ESCKEY) || (event==RIGHTMOUSE)) { - - ts= transmain; - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - if(seq->flag & SELECT) { - seq->start= ts->start; - seq->machine= ts->machine; - seq->startstill= ts->startstill; - seq->endstill= ts->endstill; - seq->startofs= ts->startofs; - seq->endofs= ts->endofs; - - calc_sequence(seq); - seq->flag &= ~SEQ_OVERLAP; - - ts++; - } else if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(seq); - else if(seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(seq); - else if(seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(seq); - } - } - - /* Markers */ - if (sseq->flag & SEQ_MARKER_TRANS) { - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if (marker->flag & SELECT) { - if(oldframe[a] != MAXFRAME+1) { - marker->frame= oldframe[a]; - } - a++; - } - } - marker_moved = 0; - } - } else { - - /* images, effects and overlap */ - for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { - - /* fixes single image strips - makes sure their start is not out of bounds - ideally this would be done during transform since data is rendered at that time - however it ends up being a lot messier! - Campbell */ - fix_single_image_seq(seq); - - if(seq->type == SEQ_META) { - calc_sequence(seq); - seq->flag &= ~SEQ_OVERLAP; - if( test_overlap_seq(seq) ) shuffle_seq(seq); - } - else if(seq->flag & SELECT) { - calc_sequence(seq); - seq->flag &= ~SEQ_OVERLAP; - if( test_overlap_seq(seq) ) shuffle_seq(seq); - } - else if(seq->type & SEQ_EFFECT) calc_sequence(seq); - } - - /* as last: */ - sort_seq(); - } - - /* free sequence array */ - if(seqar) MEM_freeN(seqar); - - G.moving= 0; - MEM_freeN(transmain); - - if (sseq->flag & SEQ_MARKER_TRANS && totmark) - MEM_freeN(oldframe); - - if (mode=='g') - BIF_undo_push("Transform Grab, Sequencer"); - else if (mode=='e') - BIF_undo_push("Transform Extend, Sequencer"); - - if (marker_moved) - allqueue(REDRAWMARKER, 0); - else - allqueue(REDRAWSEQ, 0); -} - -/* since grab can move markers, we must turn this off before adding a new sequence - I am not so happy with this, but the baddness in contained here - Campbell */ -void transform_seq_nomarker(int mode, int context) { - SpaceSeq *sseq= curarea->spacedata.first; - int flag_back; - if (!sseq) return; /* should never happen */ - flag_back = sseq->flag; - sseq->flag &= ~SEQ_MARKER_TRANS; - - transform_seq(mode, context); - - sseq->flag = flag_back; -} - -void seq_separate_images(void) -{ - Editing *ed; - Sequence *seq, *seq_new, *seq_next; - Strip *strip_new; - StripElem *se, *se_new; - int start_ofs, cfra, frame_end; - static int step= 1; - - add_numbut(0, NUM|INT, "Image Duration:", 1, 256, &step, NULL); - if (!do_clever_numbuts("Separate Images", 1, REDRAW)) - return; - - ed= G.scene->ed; - if(ed==0) return; - - seq= ed->seqbasep->first; - - while (seq) { - if((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) { - /* remove seq so overlap tests dont conflict, - see free_sequence below for the real free'ing */ - seq_next = seq->next; - BLI_remlink(ed->seqbasep, seq); - if(seq->ipo) seq->ipo->id.us--; - - start_ofs = cfra = seq_tx_get_final_left(seq); - frame_end = seq_tx_get_final_right(seq); - - while (cfra < frame_end) { - /* new seq */ - se = give_stripelem(seq, cfra); - - seq_new= alloc_sequence(((Editing *)G.scene->ed)->seqbasep, start_ofs, seq->machine); - seq_new->type= SEQ_IMAGE; - seq_new->len = 1; - seq_new->endstill = step-1; - - /* new strip */ - seq_new->strip= strip_new= MEM_callocN(sizeof(Strip)*1, "strip"); - strip_new->len= 1; - strip_new->us= 1; - strncpy(strip_new->dir, seq->strip->dir, FILE_MAXDIR-1); - - /* new stripdata */ - strip_new->stripdata= se_new= MEM_callocN(sizeof(StripElem)*1, "stripelem"); - strncpy(se_new->name, se->name, FILE_MAXFILE-1); - calc_sequence(seq_new); - seq_new->flag &= ~SEQ_OVERLAP; - if (test_overlap_seq(seq_new)) { - shuffle_seq(seq_new); - } - - cfra++; - start_ofs += step; - } - - free_sequence(seq); - seq = seq->next; - } else { - seq = seq->next; - } - } - - /* as last: */ - sort_seq(); - BIF_undo_push("Separate Image Strips, Sequencer"); - allqueue(REDRAWSEQ, 0); -} - -/* run recursivly to select linked */ -static int select_more_less_seq__internal(int sel, int linked) { - Editing *ed; - Sequence *seq, *neighbor; - int change=0; - int isel; - - ed= G.scene->ed; - if(ed==0) return 0; - - if (sel) { - sel = SELECT; - isel = 0; - } else { - sel = 0; - isel = SELECT; - } - - if (!linked) { - /* if not linked we only want to touch each seq once, newseq */ - for(seq= ed->seqbasep->first; seq; seq= seq->next) { - seq->tmp = NULL; - } - } - - for(seq= ed->seqbasep->first; seq; seq= seq->next) { - if((int)(seq->flag & SELECT) == sel) { - if ((linked==0 && seq->tmp)==0) { - /* only get unselected nabours */ - neighbor = find_neighboring_sequence(seq, 1, isel); - if (neighbor) { - if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);} - else neighbor->flag &= ~SELECT; - if (linked==0) neighbor->tmp = (Sequence *)1; - change = 1; - } - neighbor = find_neighboring_sequence(seq, 2, isel); - if (neighbor) { - if (sel) {neighbor->flag |= SELECT; recurs_sel_seq(neighbor);} - else neighbor->flag &= ~SELECT; - if (linked==0) neighbor->tmp = (void *)1; - change = 1; - } - } - } - } - - return change; -} - -void select_less_seq(void) -{ - if (select_more_less_seq__internal(0, 0)) { - BIF_undo_push("Select Less, Sequencer"); - allqueue(REDRAWSEQ, 0); - } -} - -void select_more_seq(void) -{ - if (select_more_less_seq__internal(1, 0)) { - BIF_undo_push("Select More, Sequencer"); - allqueue(REDRAWSEQ, 0); - } -} - -/* TODO not all modes supported - if you feel like being picky, add them! ;) */ -void select_linked_seq(int mode) { - Editing *ed; - Sequence *seq, *mouse_seq; - int selected, hand; - - ed= G.scene->ed; - if(ed==0) return; - - /* replace current selection */ - if (mode==0 || mode==2) { - /* this works like UV, not mesh */ - if (mode==0) { - mouse_seq= find_nearest_seq(&hand); - if (!mouse_seq) - return; /* user error as with mesh?? */ - - for(seq= ed->seqbasep->first; seq; seq= seq->next) { - seq->flag &= ~SELECT; - } - mouse_seq->flag |= SELECT; - recurs_sel_seq(mouse_seq); - } - - selected = 1; - while (selected) { - selected = select_more_less_seq__internal(1, 1); - } - BIF_undo_push("Select Linked, Sequencer"); - allqueue(REDRAWSEQ, 0); - } - /* TODO - more modes... */ -} - -void seq_snap_menu(void) -{ - short event; - - event= pupmenu("Snap %t|To Current Frame%x1"); - if(event < 1) return; - - seq_snap(event); -} - -void seq_snap(short event) -{ - Editing *ed; - Sequence *seq; - - ed= G.scene->ed; - if(ed==0) return; - - /* problem: contents of meta's are all shifted to the same position... */ - - /* also check metas */ - WHILE_SEQ(ed->seqbasep) { - if (seq->flag & SELECT && sequence_is_free_transformable(seq)) { - if((seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0) { - seq->start= CFRA-seq->startofs+seq->startstill; - } else { - if(seq->flag & SEQ_LEFTSEL) { - seq_tx_set_final_left(seq, CFRA); - } else { /* SEQ_RIGHTSEL */ - seq_tx_set_final_right(seq, CFRA); - } - transform_grab_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL); - } - calc_sequence(seq); - } - } - END_SEQ - - /* test for effects and overlap */ - WHILE_SEQ(ed->seqbasep) { - if(seq->flag & SELECT) { - seq->flag &= ~SEQ_OVERLAP; - if( test_overlap_seq(seq) ) { - shuffle_seq(seq); - } - } - else if(seq->type & SEQ_EFFECT) { - if(seq->seq1 && (seq->seq1->flag & SELECT)) - calc_sequence(seq); - else if(seq->seq2 && (seq->seq2->flag & SELECT)) - calc_sequence(seq); - else if(seq->seq3 && (seq->seq3->flag & SELECT)) - calc_sequence(seq); - } - } - END_SEQ; - - /* as last: */ - sort_seq(); - - BIF_undo_push("Snap Strips, Sequencer"); - allqueue(REDRAWSEQ, 0); -} - -void borderselect_seq(void) -{ - Sequence *seq; - Editing *ed; - rcti rect; - rctf rectf, rq; - int val; - short mval[2]; - - ed= G.scene->ed; - if(ed==0) return; - - val= get_border(&rect, 3); - - if(val) { - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - seq= ed->seqbasep->first; - while(seq) { - - if(seq->startstill) rq.xmin= seq->start; - else rq.xmin= seq->startdisp; - rq.ymin= seq->machine+0.2; - if(seq->endstill) rq.xmax= seq->start+seq->len; - else rq.xmax= seq->enddisp; - rq.ymax= seq->machine+0.8; - - if(BLI_isect_rctf(&rq, &rectf, 0)) { - if(val==LEFTMOUSE) { - seq->flag |= SELECT; - } - else { - seq->flag &= ~SELECT; - } - recurs_sel_seq(seq); - } - - seq= seq->next; - } - - BIF_undo_push("Border Select, Sequencer"); - addqueue(curarea->win, REDRAW, 1); - } -} diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c deleted file mode 100644 index eb70a32b5a9..00000000000 --- a/source/blender/src/editsima.c +++ /dev/null @@ -1,2436 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_image_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" // only for uvedit_selectionCB() (struct Object) -#include "DNA_packedFile_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_colortools.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_image.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_object.h" -#include "BKE_packedFile.h" -#include "BKE_utildefines.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_drawimage.h" -#include "BIF_editview.h" -#include "BIF_editsima.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" -#include "BIF_writeimage.h" -#include "BIF_editmesh.h" - -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BSE_trans_types.h" - -#include "BDR_editobject.h" -#include "BDR_unwrapper.h" - -#include "BMF_Api.h" - -#include "RE_pipeline.h" - -#include "blendef.h" -#include "multires.h" -#include "mydevice.h" -#include "editmesh.h" - -/* local prototypes */ -void sel_uvco_inside_radius(short , EditFace *efa, MTFace *, int , float *, float *, short); -void uvedit_selectionCB(short , Object *, short *, float ); /* used in edit.c*/ - -void object_uvs_changed(Object *ob) -{ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -void object_tface_flags_changed(Object *ob, int updateButtons) -{ - if (updateButtons) allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -int is_uv_tface_editing_allowed_silent(void) -{ - if(!EM_texFaceCheck()) return 0; - if(G.sima->mode!=SI_TEXTURE) return 0; - if(multires_level1_test()) return 0; - return 1; -} - -int is_uv_tface_editing_allowed(void) -{ - if(!G.obedit) error("Enter Edit Mode to perform this action"); - - return is_uv_tface_editing_allowed_silent(); -} - -void get_connected_limit_tface_uv(float *limit) -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - if(ibuf && ibuf->x > 0 && ibuf->y > 0) { - limit[0]= 0.05/(float)ibuf->x; - limit[1]= 0.05/(float)ibuf->y; - } - else - limit[0]= limit[1]= 0.05/256.0; -} - -void be_square_tface_uv(EditMesh *em) -{ - EditFace *efa; - MTFace *tface; - /* if 1 vertex selected: doit (with the selected vertex) */ - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->v4) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) { - if( tface->uv[1][0] == tface->uv[2][0] ) { - tface->uv[1][1]= tface->uv[0][1]; - tface->uv[3][0]= tface->uv[0][0]; - } - else { - tface->uv[1][0]= tface->uv[0][0]; - tface->uv[3][1]= tface->uv[0][1]; - } - - } - if (simaUVSel_Check(efa, tface, 1)) { - if( tface->uv[2][1] == tface->uv[3][1] ) { - tface->uv[2][0]= tface->uv[1][0]; - tface->uv[0][1]= tface->uv[1][1]; - } - else { - tface->uv[2][1]= tface->uv[1][1]; - tface->uv[0][0]= tface->uv[1][0]; - } - - } - if (simaUVSel_Check(efa, tface, 2)) { - if( tface->uv[3][0] == tface->uv[0][0] ) { - tface->uv[3][1]= tface->uv[2][1]; - tface->uv[1][0]= tface->uv[2][0]; - } - else { - tface->uv[3][0]= tface->uv[2][0]; - tface->uv[1][1]= tface->uv[2][1]; - } - } - if (simaUVSel_Check(efa, tface, 3)) { - if( tface->uv[0][1] == tface->uv[1][1] ) { - tface->uv[0][0]= tface->uv[3][0]; - tface->uv[2][1]= tface->uv[3][1]; - } - else { - tface->uv[0][1]= tface->uv[3][1]; - tface->uv[2][0]= tface->uv[3][0]; - } - - } - } - } - } -} - -void transform_aspect_ratio_tface_uv(float *aspx, float *aspy) -{ - int w, h; - float xuser_asp, yuser_asp; - - aspect_sima(G.sima, &xuser_asp, &yuser_asp); - - transform_width_height_tface_uv(&w, &h); - *aspx= (float)w/256.0f * xuser_asp; - *aspy= (float)h/256.0f * yuser_asp; -} - -void transform_width_height_tface_uv(int *width, int *height) -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - - if(ibuf) { - *width= ibuf->x; - *height= ibuf->y; - } - else { - *width= 256; - *height= 256; - } -} - -void mirror_tface_uv(char mirroraxis) -{ - if (mirroraxis == 'x') - Mirror(1); /* global x */ - else if (mirroraxis == 'y') - Mirror(2); /* global y */ -} - -void mirrormenu_tface_uv(void) -{ - short mode= 0; - - if( is_uv_tface_editing_allowed()==0 ) return; - - mode= pupmenu("Mirror%t|X Axis%x1|Y Axis%x2|"); - - if(mode==-1) return; - - if(mode==1) mirror_tface_uv('x'); - else if(mode==2) mirror_tface_uv('y'); - - BIF_undo_push("Mirror UV"); -} - -void weld_align_tface_uv(char tool) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - float cent[2]; - - if( is_uv_tface_editing_allowed()==0 ) return; - cent_tface_uv(cent, 0); - - if(tool == 'x' || tool == 'w') { - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) - tface->uv[0][0]= cent[0]; - if (simaUVSel_Check(efa, tface, 1)) - tface->uv[1][0]= cent[0]; - if (simaUVSel_Check(efa, tface, 2)) - tface->uv[2][0]= cent[0]; - if (efa->v4 && simaUVSel_Check(efa, tface, 3)) - tface->uv[3][0]= cent[0]; - } - } - } - - if(tool == 'y' || tool == 'w') { - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) - tface->uv[0][1]= cent[1]; - if (simaUVSel_Check(efa, tface, 1)) - tface->uv[1][1]= cent[1]; - if (simaUVSel_Check(efa, tface, 2)) - tface->uv[2][1]= cent[1]; - if (efa->v4 && simaUVSel_Check(efa, tface, 3)) - tface->uv[3][1]= cent[1]; - } - } - } - - object_uvs_changed(OBACT); -} - -// just for averaging UV's -typedef struct UVVertAverage { - float uv[2]; - int count; -} UVVertAverage; - -void stitch_vert_uv_tface(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditVert *eve; - MTFace *tface; - int count; - UVVertAverage *uv_average, *uvav; - - if( is_uv_tface_editing_allowed()==0 ) return; - - // index and count verts - for (count=0, eve=em->verts.first; eve; count++, eve= eve->next) { - eve->tmp.l = count; - } - - uv_average = MEM_callocN(sizeof(UVVertAverage) * count, "Stitch"); - - // gather uv averages per vert - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) { - uvav = uv_average + efa->v1->tmp.l; - uvav->count++; - uvav->uv[0] += tface->uv[0][0]; - uvav->uv[1] += tface->uv[0][1]; - } - if (simaUVSel_Check(efa, tface, 1)) { - uvav = uv_average + efa->v2->tmp.l; - uvav->count++; - uvav->uv[0] += tface->uv[1][0]; - uvav->uv[1] += tface->uv[1][1]; - } - if (simaUVSel_Check(efa, tface, 2)) { - uvav = uv_average + efa->v3->tmp.l; - uvav->count++; - uvav->uv[0] += tface->uv[2][0]; - uvav->uv[1] += tface->uv[2][1]; - } - if (efa->v4 && simaUVSel_Check(efa, tface, 3)) { - uvav = uv_average + efa->v4->tmp.l; - uvav->count++; - uvav->uv[0] += tface->uv[3][0]; - uvav->uv[1] += tface->uv[3][1]; - } - } - } - - // apply uv welding - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) { - uvav = uv_average + efa->v1->tmp.l; - tface->uv[0][0] = uvav->uv[0]/uvav->count; - tface->uv[0][1] = uvav->uv[1]/uvav->count; - } - if (simaUVSel_Check(efa, tface, 1)) { - uvav = uv_average + efa->v2->tmp.l; - tface->uv[1][0] = uvav->uv[0]/uvav->count; - tface->uv[1][1] = uvav->uv[1]/uvav->count; - } - if (simaUVSel_Check(efa, tface, 2)) { - uvav = uv_average + efa->v3->tmp.l; - tface->uv[2][0] = uvav->uv[0]/uvav->count; - tface->uv[2][1] = uvav->uv[1]/uvav->count; - } - if (efa->v4 && simaUVSel_Check(efa, tface, 3)) { - uvav = uv_average + efa->v4->tmp.l; - tface->uv[3][0] = uvav->uv[0]/uvav->count; - tface->uv[3][1] = uvav->uv[1]/uvav->count; - } - } - } - MEM_freeN(uv_average); - object_uvs_changed(OBACT); -} - -void weld_align_menu_tface_uv(void) -{ - short mode= 0; - - if( is_uv_tface_editing_allowed()==0 ) return; - - mode= pupmenu("Weld/Align%t|Weld%x1|Align X%x2|Align Y%x3"); - - if(mode==-1) return; - if(mode==1) weld_align_tface_uv('w'); - else if(mode==2) weld_align_tface_uv('x'); - else if(mode==3) weld_align_tface_uv('y'); - - if(mode==1) BIF_undo_push("Weld UV"); - else if(mode==2 || mode==3) BIF_undo_push("Align UV"); -} - -void select_invert_tface_uv(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - if (G.sima->flag & SI_SYNC_UVSEL) { - /* Warning, this is not that good (calling editmode stuff from UV), - TODO look into changing it */ - selectswap_mesh(); - return; - } else { - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - tface->flag ^= TF_SEL1; - tface->flag ^= TF_SEL2; - tface->flag ^= TF_SEL3; - if(efa->v4) tface->flag ^= TF_SEL4; - } - } - } - BIF_undo_push("Select Inverse UV"); - - allqueue(REDRAWIMAGE, 0); -} - -void select_swap_tface_uv(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - int sel=0; - - if( is_uv_tface_editing_allowed()==0 ) return; - - if (G.sima->flag & SI_SYNC_UVSEL) { - deselectall_mesh(); - return; - } else { - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if(tface->flag & (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4)) { - sel= 1; - break; - } - } - } - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if(efa->v4) { - if(sel) tface->flag &= ~(TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4); - else tface->flag |= (TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4); - } - else { - if(sel) tface->flag &= ~(TF_SEL1+TF_SEL2+TF_SEL3+TF_SEL4); - else tface->flag |= (TF_SEL1+TF_SEL2+TF_SEL3); - } - } - } - } - BIF_undo_push("Select swap"); - - allqueue(REDRAWIMAGE, 0); -} - -static int msel_hit(float *limit, unsigned int *hitarray, unsigned int vertexid, float **uv, float *uv2, int sticky) -{ - int i; - for(i=0; i< 4; i++) { - if(hitarray[i] == vertexid) { - if(sticky == 2) { - if(fabs(uv[i][0]-uv2[0]) < limit[0] && - fabs(uv[i][1]-uv2[1]) < limit[1]) - return 1; - } - else return 1; - } - } - return 0; -} - -static void find_nearest_tface(MTFace **nearesttf, EditFace **nearestefa) -{ - EditMesh *em= G.editMesh; - MTFace *tf; - EditFace *efa; - int i, nverts, mindist, dist, fcenter[2], uval[2]; - short mval[2]; - - getmouseco_areawin(mval); - - mindist= 0x7FFFFFF; - *nearesttf= NULL; - *nearestefa= NULL; - - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - fcenter[0]= fcenter[1]= 0; - nverts= efa->v4? 4: 3; - for(i=0; iuv[i], uval); - fcenter[0] += uval[0]; - fcenter[1] += uval[1]; - } - - fcenter[0] /= nverts; - fcenter[1] /= nverts; - - dist= abs(mval[0]- fcenter[0])+ abs(mval[1]- fcenter[1]); - if (dist < mindist) { - *nearesttf= tf; - *nearestefa= efa; - mindist= dist; - } - } - } -} - -static int nearest_uv_between(MTFace *tf, int nverts, int id, short *mval, int *uval) -{ - float m[3], v1[3], v2[3], c1, c2; - int id1, id2; - - id1= (id+nverts-1)%nverts; - id2= (id+nverts+1)%nverts; - - m[0] = (float)(mval[0]-uval[0]); - m[1] = (float)(mval[1]-uval[1]); - Vec2Subf(v1, tf->uv[id1], tf->uv[id]); - Vec2Subf(v2, tf->uv[id2], tf->uv[id]); - - /* m and v2 on same side of v-v1? */ - c1= v1[0]*m[1] - v1[1]*m[0]; - c2= v1[0]*v2[1] - v1[1]*v2[0]; - - if (c1*c2 < 0.0f) - return 0; - - /* m and v1 on same side of v-v2? */ - c1= v2[0]*m[1] - v2[1]*m[0]; - c2= v2[0]*v1[1] - v2[1]*v1[0]; - - return (c1*c2 >= 0.0f); -} - -void find_nearest_uv(MTFace **nearesttf, EditFace **nearestefa, unsigned int *nearestv, int *nearestuv) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - MTFace *tf; - int i, nverts, mindist, dist, uval[2]; - short mval[2]; - - getmouseco_areawin(mval); - - mindist= 0x7FFFFFF; - if (nearesttf) *nearesttf= NULL; - if (nearestefa) *nearestefa= NULL; - - if (nearestv) { - EditVert *ev; - for (i=0, ev=em->verts.first; ev; ev = ev->next, i++) - ev->tmp.l = i; - } - - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - nverts= efa->v4? 4: 3; - for(i=0; iuv[i], uval); - dist= abs(mval[0]-uval[0]) + abs(mval[1]-uval[1]); - - if (simaUVSel_Check(efa, tf, i)) - dist += 5; - - if(dist<=mindist) { - if(dist==mindist) - if (!nearest_uv_between(tf, nverts, i, mval, uval)) - continue; - - mindist= dist; - *nearestuv= i; - - if (nearesttf) *nearesttf= tf; - if (nearestefa) *nearestefa= efa; - if (nearestv) { - if (i==0) *nearestv= efa->v1->tmp.l; - else if (i==1) *nearestv= efa->v2->tmp.l; - else if (i==2) *nearestv= efa->v3->tmp.l; - else *nearestv= efa->v4->tmp.l; - } - } - } - } - } -} - -void mouse_select_sima(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tf, *nearesttf; - EditFace *nearestefa=NULL; - int a, selectsticky, actface, nearestuv, i; - char sticky= 0; - short flush = 0; /* 0 == dont flush, 1 == sel, -1 == desel; only use when selection sync is enabled */ - unsigned int hitv[4], nearestv; - float *hituv[4], limit[2]; - - if( is_uv_tface_editing_allowed()==0 ) return; - - get_connected_limit_tface_uv(limit); - - if (G.sima->flag & SI_SYNC_UVSEL) { - /* copy from mesh */ - if (G.scene->selectmode == SCE_SELECT_FACE) { - actface= 1; - sticky= 0; - } else { - actface= (G.qual & LR_ALTKEY || G.sima->flag & SI_SELACTFACE); - sticky= 2; - } - } else { - /* normal operation */ - actface= (G.qual & LR_ALTKEY || G.sima->flag & SI_SELACTFACE); - - switch(G.sima->sticky) { - case SI_STICKY_LOC: - sticky=2; - break; - case SI_STICKY_DISABLE: - sticky=0; - break; - case SI_STICKY_VERTEX: - if(G.qual & LR_CTRLKEY) { - sticky=0; - } else { - sticky=1; - } - break; - } - } - - if(actface) { - find_nearest_tface(&nearesttf, &nearestefa); - if(nearesttf==NULL) - return; - - EM_set_actFace(nearestefa); - - for (i=0; i<4; i++) - hituv[i]= nearesttf->uv[i]; - - hitv[0]= nearestefa->v1->tmp.l; - hitv[1]= nearestefa->v2->tmp.l; - hitv[2]= nearestefa->v3->tmp.l; - - if (nearestefa->v4) hitv[3]= nearestefa->v4->tmp.l; - else hitv[3]= 0xFFFFFFFF; - } - else { - find_nearest_uv(&nearesttf, &nearestefa, &nearestv, &nearestuv); - if(nearesttf==NULL) - return; - - if(sticky) { - for(i=0; i<4; i++) - hitv[i]= 0xFFFFFFFF; - hitv[nearestuv]= nearestv; - hituv[nearestuv]= nearesttf->uv[nearestuv]; - } - } - - if(G.qual & LR_SHIFTKEY) { - /* (de)select face */ - if(actface) { - if(simaFaceSel_Check(nearestefa, nearesttf)) { - simaFaceSel_UnSet(nearestefa, nearesttf); - selectsticky= 0; - } - else { - simaFaceSel_Set(nearestefa, nearesttf); - selectsticky= 1; - } - flush = -1; - } - /* (de)select uv node */ - else { - if (simaUVSel_Check(nearestefa, nearesttf, nearestuv)) { - simaUVSel_UnSet(nearestefa, nearesttf, nearestuv); - selectsticky= 0; - } - else { - simaUVSel_Set(nearestefa, nearesttf, nearestuv); - selectsticky= 1; - } - flush = 1; - } - - /* (de)select sticky uv nodes */ - if(sticky || actface) { - EditVert *ev; - - for (a=0, ev=em->verts.first; ev; ev = ev->next, a++) - ev->tmp.l = a; - - /* deselect */ - if(selectsticky==0) { - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - /*if(nearesttf && tf!=nearesttf) tf->flag &=~ TF_ACTIVE;*/ /* TODO - deal with editmesh active face */ - if (!sticky) continue; - - if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky)) - simaUVSel_UnSet(efa, tf, 0); - if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky)) - simaUVSel_UnSet(efa, tf, 1); - if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky)) - simaUVSel_UnSet(efa, tf, 2); - if (efa->v4) - if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky)) - simaUVSel_UnSet(efa, tf, 3); - } - } - flush = -1; - } - /* select */ - else { - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if (!sticky) continue; - if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky)) - simaUVSel_Set(efa, tf, 0); - if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky)) - simaUVSel_Set(efa, tf, 1); - if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky)) - simaUVSel_Set(efa, tf, 2); - if (efa->v4) - if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky)) - simaUVSel_Set(efa, tf, 3); - } - } - EM_set_actFace(nearestefa); - flush = 1; - } - } - } - else { - /* select face and deselect other faces */ - if(actface) { - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - simaFaceSel_UnSet(efa, tf); - } - if(nearesttf) { - simaFaceSel_Set(nearestefa, nearesttf); - EM_set_actFace(nearestefa); - } - - } - - /* deselect uvs, and select sticky uvs */ - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if(!actface) simaFaceSel_UnSet(efa, tf); - if(!sticky) continue; - - if(msel_hit(limit, hitv, efa->v1->tmp.l, hituv, tf->uv[0], sticky)) - simaUVSel_Set(efa, tf, 0); - if(msel_hit(limit, hitv, efa->v2->tmp.l, hituv, tf->uv[1], sticky)) - simaUVSel_Set(efa, tf, 1); - if(msel_hit(limit, hitv, efa->v3->tmp.l, hituv, tf->uv[2], sticky)) - simaUVSel_Set(efa, tf, 2); - if(efa->v4) - if(msel_hit(limit, hitv, efa->v4->tmp.l, hituv, tf->uv[3], sticky)) - simaUVSel_Set(efa, tf, 3); - flush= 1; - } - } - - if(!actface) { - simaUVSel_Set(nearestefa, nearesttf, nearestuv); - flush= 1; - } - } - - force_draw(1); - - if (G.sima->flag & SI_SYNC_UVSEL) { - /* flush for mesh selection */ - if (G.scene->selectmode != SCE_SELECT_FACE) { - if (flush==1) EM_select_flush(); - else if (flush==-1) EM_deselect_flush(); - } - allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */ - } - - BIF_undo_push("Select UV"); - rightmouse_transform(); -} - -void borderselect_sima(short whichuvs) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - rcti rect; - rctf rectf; - int val, ok = 1; - short mval[2], select; - - if( is_uv_tface_editing_allowed()==0) return; - - val= get_border(&rect, 3); - select = (val==LEFTMOUSE) ? 1 : 0; - - if(val) { - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - if (draw_uvs_face_check() && whichuvs != UV_SELECT_PINNED) { - float cent[2]; - ok = 0; - for (efa= em->faces.first; efa; efa= efa->next) { - /* assume not touched */ - efa->tmp.l = 0; - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - tface_center(tface, cent, (void *)efa->v4); - if(BLI_in_rctf(&rectf, cent[0], cent[1])) { - efa->tmp.l = ok = 1; - } - } - } - /* (de)selects all tagged faces and deals with sticky modes */ - if (ok) - uvface_setsel__internal(select); - } else { - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (whichuvs == UV_SELECT_ALL || (G.sima->flag & SI_SYNC_UVSEL) ) { - /* SI_SYNC_UVSEL - cant do pinned selection */ - if(BLI_in_rctf(&rectf, tface->uv[0][0], tface->uv[0][1])) { - if(select) simaUVSel_Set(efa, tface, 0); - else simaUVSel_UnSet(efa, tface, 0); - } - if(BLI_in_rctf(&rectf, tface->uv[1][0], tface->uv[1][1])) { - if(select) simaUVSel_Set(efa, tface, 1); - else simaUVSel_UnSet(efa, tface, 1); - } - if(BLI_in_rctf(&rectf, tface->uv[2][0], tface->uv[2][1])) { - if(select) simaUVSel_Set(efa, tface, 2); - else simaUVSel_UnSet(efa, tface, 2); - } - if(efa->v4 && BLI_in_rctf(&rectf, tface->uv[3][0], tface->uv[3][1])) { - if(select) simaUVSel_Set(efa, tface, 3); - else simaUVSel_UnSet(efa, tface, 3); - } - } else if (whichuvs == UV_SELECT_PINNED) { - if ((tface->unwrap & TF_PIN1) && - BLI_in_rctf(&rectf, tface->uv[0][0], tface->uv[0][1])) { - - if(select) simaUVSel_Set(efa, tface, 0); - else simaUVSel_UnSet(efa, tface, 0); - } - if ((tface->unwrap & TF_PIN2) && - BLI_in_rctf(&rectf, tface->uv[1][0], tface->uv[1][1])) { - - if(select) simaUVSel_Set(efa, tface, 1); - else simaUVSel_UnSet(efa, tface, 1); - } - if ((tface->unwrap & TF_PIN3) && - BLI_in_rctf(&rectf, tface->uv[2][0], tface->uv[2][1])) { - - if(select) simaUVSel_Set(efa, tface, 2); - else simaUVSel_UnSet(efa, tface, 2); - } - if ((efa->v4) && (tface->unwrap & TF_PIN4) && BLI_in_rctf(&rectf, tface->uv[3][0], tface->uv[3][1])) { - if(select) simaUVSel_Set(efa, tface, 3); - else simaUVSel_UnSet(efa, tface, 3); - } - } - } - } - } - if (ok) { - /* make sure newly selected vert selection is updated*/ - if (G.sima->flag & SI_SYNC_UVSEL) { - if (G.scene->selectmode != SCE_SELECT_FACE) { - if (select) EM_select_flush(); - else EM_deselect_flush(); - } - } - allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */ - - BIF_undo_push("Border select UV"); - scrarea_queue_winredraw(curarea); - } - } -} - -int snap_uv_sel_to_curs(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - short change = 0; - - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) VECCOPY2D(tface->uv[0], G.v2d->cursor); - if (simaUVSel_Check(efa, tface, 1)) VECCOPY2D(tface->uv[1], G.v2d->cursor); - if (simaUVSel_Check(efa, tface, 2)) VECCOPY2D(tface->uv[2], G.v2d->cursor); - if (efa->v4) - if (simaUVSel_Check(efa, tface, 3)) VECCOPY2D(tface->uv[3], G.v2d->cursor); - change = 1; - } - } - return change; -} - -int snap_uv_sel_to_adj_unsel(void) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - EditVert *eve; - MTFace *tface; - short change = 0; - int count = 0; - float *coords; - short *usercount, users; - - /* set all verts to -1 : an unused index*/ - for (eve= em->verts.first; eve; eve= eve->next) - eve->tmp.l=-1; - - /* index every vert that has a selected UV using it, but only once so as to - * get unique indicies and to count how much to malloc */ - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0) && efa->v1->tmp.l==-1) efa->v1->tmp.l= count++; - if (simaUVSel_Check(efa, tface, 1) && efa->v2->tmp.l==-1) efa->v2->tmp.l= count++; - if (simaUVSel_Check(efa, tface, 2) && efa->v3->tmp.l==-1) efa->v3->tmp.l= count++; - if (efa->v4) - if (simaUVSel_Check(efa, tface, 3) && efa->v4->tmp.l==-1) efa->v4->tmp.l= count++; - change = 1; - - /* optional speedup */ - efa->tmp.p = tface; - } else { - efa->tmp.p = NULL; - } - } - - coords = MEM_callocN(sizeof(float)*count*2, "snap to adjacent coords"); - usercount = MEM_callocN(sizeof(short)*count, "snap to adjacent counts"); - - /* add all UV coords from visible, unselected UV coords as well as counting them to average later */ - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - if ((tface=(MTFace *)efa->tmp.p)) { - - /* is this an unselected UV we can snap to? */ - if (efa->v1->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 0))) { - coords[efa->v1->tmp.l*2] += tface->uv[0][0]; - coords[(efa->v1->tmp.l*2)+1] += tface->uv[0][1]; - usercount[efa->v1->tmp.l]++; - change = 1; - } - if (efa->v2->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 1))) { - coords[efa->v2->tmp.l*2] += tface->uv[1][0]; - coords[(efa->v2->tmp.l*2)+1] += tface->uv[1][1]; - usercount[efa->v2->tmp.l]++; - change = 1; - } - if (efa->v3->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 2))) { - coords[efa->v3->tmp.l*2] += tface->uv[2][0]; - coords[(efa->v3->tmp.l*2)+1] += tface->uv[2][1]; - usercount[efa->v3->tmp.l]++; - change = 1; - } - - if (efa->v4) { - if (efa->v4->tmp.l >= 0 && (!simaUVSel_Check(efa, tface, 3))) { - coords[efa->v4->tmp.l*2] += tface->uv[3][0]; - coords[(efa->v4->tmp.l*2)+1] += tface->uv[3][1]; - usercount[efa->v4->tmp.l]++; - change = 1; - } - } - } - } - - /* no other verts selected, bail out */ - if (!change) { - MEM_freeN(coords); - MEM_freeN(usercount); - return change; - } - - /* copy the averaged unselected UVs back to the selected UVs */ - for (efa= em->faces.first; efa; efa= efa->next) { -// tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); -// if (simaFaceDraw_Check(efa, tface)) { - if ((tface=(MTFace *)efa->tmp.p)) { - - if ( simaUVSel_Check(efa, tface, 0) && - efa->v1->tmp.l >= 0 && - (users = usercount[efa->v1->tmp.l]) - ) { - tface->uv[0][0] = coords[efa->v1->tmp.l*2] / users; - tface->uv[0][1] = coords[(efa->v1->tmp.l*2)+1] / users; - } - - if ( simaUVSel_Check(efa, tface, 1) && - efa->v2->tmp.l >= 0 && - (users = usercount[efa->v2->tmp.l]) - ) { - tface->uv[1][0] = coords[efa->v2->tmp.l*2] / users; - tface->uv[1][1] = coords[(efa->v2->tmp.l*2)+1] / users; - } - - if ( simaUVSel_Check(efa, tface, 2) && - efa->v3->tmp.l >= 0 && - (users = usercount[efa->v3->tmp.l]) - ) { - tface->uv[2][0] = coords[efa->v3->tmp.l*2] / users; - tface->uv[2][1] = coords[(efa->v3->tmp.l*2)+1] / users; - } - - if (efa->v4) { - if ( simaUVSel_Check(efa, tface, 3) && - efa->v4->tmp.l >= 0 && - (users = usercount[efa->v4->tmp.l]) - ) { - tface->uv[3][0] = coords[efa->v4->tmp.l*2] / users; - tface->uv[3][1] = coords[(efa->v4->tmp.l*2)+1] / users; - } - } - } - } - - MEM_freeN(coords); - MEM_freeN(usercount); - return change; -} - -void snap_coord_to_pixel(float *uvco, float w, float h) -{ - uvco[0] = ((float) ((int)((uvco[0]*w) + 0.5))) / w; - uvco[1] = ((float) ((int)((uvco[1]*h) + 0.5))) / h; -} - -int snap_uv_sel_to_pixels(void) /* warning, sanity checks must alredy be done */ -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - int wi, hi; - float w, h; - short change = 0; - - transform_width_height_tface_uv(&wi, &hi); - w = (float)wi; - h = (float)hi; - - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (simaUVSel_Check(efa, tface, 0)) snap_coord_to_pixel(tface->uv[0], w, h); - if (simaUVSel_Check(efa, tface, 1)) snap_coord_to_pixel(tface->uv[1], w, h); - if (simaUVSel_Check(efa, tface, 2)) snap_coord_to_pixel(tface->uv[2], w, h); - if (efa->v4) - if (simaUVSel_Check(efa, tface, 3)) snap_coord_to_pixel(tface->uv[3], w, h); - change = 1; - } - } - return change; -} - -void snap_uv_curs_to_pixels(void) -{ - int wi, hi; - float w, h; - - transform_width_height_tface_uv(&wi, &hi); - w = (float)wi; - h = (float)hi; - snap_coord_to_pixel(G.v2d->cursor, w, h); -} - -int snap_uv_curs_to_sel(void) -{ - if( is_uv_tface_editing_allowed()==0 ) return 0; - return cent_tface_uv(G.v2d->cursor, 0); -} - -void snap_menu_sima(void) -{ - short event; - if( is_uv_tface_editing_allowed()==0 || !G.v2d) return; /* !G.v2d should never happen */ - - event = pupmenu("Snap %t|Selection -> Pixels%x1|Selection -> Cursor%x2|Selection -> Adjacent Unselected%x3|Cursor -> Pixel%x4|Cursor -> Selection%x5"); - switch (event) { - case 1: - if (snap_uv_sel_to_pixels()) { - BIF_undo_push("Snap UV Selection to Pixels"); - object_uvs_changed(OBACT); - } - break; - case 2: - if (snap_uv_sel_to_curs()) { - BIF_undo_push("Snap UV Selection to Cursor"); - object_uvs_changed(OBACT); - } - break; - case 3: - if (snap_uv_sel_to_adj_unsel()) { - BIF_undo_push("Snap UV Selection to Cursor"); - object_uvs_changed(OBACT); - } - break; - case 4: - snap_uv_curs_to_pixels(); - scrarea_queue_winredraw(curarea); - break; - case 5: - if (snap_uv_curs_to_sel()) - allqueue(REDRAWIMAGE, 0); - break; - } -} - - -/** This is an ugly function to set the Tface selection flags depending - * on whether its UV coordinates are inside the normalized - * area with radius rad and offset offset. These coordinates must be - * normalized to 1.0 - * Just for readability... - */ - -void sel_uvco_inside_radius(short sel, EditFace *efa, MTFace *tface, int index, float *offset, float *ell, short select_index) -{ - // normalized ellipse: ell[0] = scaleX, - // [1] = scaleY - - float *uv = tface->uv[index]; - float x, y, r2; - - x = (uv[0] - offset[0]) * ell[0]; - y = (uv[1] - offset[1]) * ell[1]; - - r2 = x * x + y * y; - if (r2 < 1.0) { - if (sel == LEFTMOUSE) simaUVSel_Set(efa, tface, select_index); - else simaUVSel_UnSet(efa, tface, select_index); - } -} - -// see below: -/** gets image dimensions of the 2D view 'v' */ -static void getSpaceImageDimension(SpaceImage *sima, float *xy) -{ - ImBuf *ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - - if (ibuf) { - xy[0] = ibuf->x * sima->zoom; - xy[1] = ibuf->y * sima->zoom; - } else { - xy[0] = 256 * sima->zoom; - xy[1] = 256 * sima->zoom; - } -} - -/** Callback function called by circle_selectCB to enable - * brush select in UV editor. - */ - -void uvedit_selectionCB(short selecting, Object *editobj, short *mval, float rad) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - float offset[2]; - MTFace *tface; - float ellipse[2]; // we need to deal with ellipses, as - // non square textures require for circle - // selection. this ellipse is normalized; r = 1.0 - - getSpaceImageDimension(curarea->spacedata.first, ellipse); - ellipse[0] /= rad; - ellipse[1] /= rad; - - areamouseco_to_ipoco(G.v2d, mval, &offset[0], &offset[1]); - - if (selecting) { - for (efa= em->faces.first; efa; efa= efa->next) { - tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - sel_uvco_inside_radius(selecting, efa, tface, 0, offset, ellipse, 0); - sel_uvco_inside_radius(selecting, efa, tface, 1, offset, ellipse, 1); - sel_uvco_inside_radius(selecting, efa, tface, 2, offset, ellipse, 2); - if (efa->v4) - sel_uvco_inside_radius(selecting, efa, tface, 3, offset, ellipse, 3); - } - - if(G.f & G_DRAWFACES) { /* full redraw only if necessary */ - draw_sel_circle(0, 0, 0, 0, 0); /* signal */ - force_draw(0); - } - else { /* force_draw() is no good here... */ - glDrawBuffer(GL_FRONT); - draw_uvs_sima(); - bglFlush(); - glDrawBuffer(GL_BACK); - } - - - if (selecting == LEFTMOUSE) EM_select_flush(); - else EM_deselect_flush(); - - if (G.sima->lock && (G.sima->flag & SI_SYNC_UVSEL)) - force_draw_plus(SPACE_VIEW3D, 0); - } -} - - -void mouseco_to_curtile(void) -{ - float fx, fy; - short mval[2]; - - if( is_uv_tface_editing_allowed()==0) return; - - if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) { - - G.sima->flag |= SI_EDITTILE; - - while(get_mbut()&L_MOUSE) { - - calc_image_view(G.sima, 'f'); - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &fx, &fy); - - if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) { - - fx= (fx)*G.sima->image->xrep; - fy= (fy)*G.sima->image->yrep; - - mval[0]= fx; - mval[1]= fy; - - G.sima->curtile= mval[1]*G.sima->image->xrep + mval[0]; - } - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - - G.sima->flag &= ~SI_EDITTILE; - - image_set_tile(G.sima, 2); - - allqueue(REDRAWVIEW3D, 0); - scrarea_queue_winredraw(curarea); - } -} - -/* Could be used for other 2D views also */ -void mouseco_to_cursor_sima(void) -{ - short mval[2]; - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &G.v2d->cursor[0], &G.v2d->cursor[1]); - scrarea_queue_winredraw(curarea); -} - -void stitch_limit_uv_tface(void) -{ - MTFace *tf; - int a, vtot; - float newuv[2], limit[2]; - UvMapVert *vlist, *iterv; - EditMesh *em = G.editMesh; - EditVert *ev; - EditFace *efa; - - struct UvVertMap *vmap; - - - if(is_uv_tface_editing_allowed()==0) - return; - if(G.sima->flag & SI_SYNC_UVSEL) { - error("Can't stitch when Sync Mesh Selection is enabled"); - return; - } - - limit[0]= limit[1]= 20.0; - add_numbut(0, NUM|FLO, "Limit:", 0.1, 1000.0, &limit[0], NULL); - if (!do_clever_numbuts("Stitch UVs", 1, REDRAW)) - return; - - limit[0]= limit[1]= limit[0]/256.0; - if(G.sima->image) { - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - - if(ibuf && ibuf->x > 0 && ibuf->y > 0) { - limit[1]= limit[0]/(float)ibuf->y; - limit[0]= limit[0]/(float)ibuf->x; - } - } - - /*vmap= make_uv_vert_map(me->mface, tf, me->totface, me->totvert, 1, limit);*/ - EM_init_index_arrays(0, 0, 1); - vmap= make_uv_vert_map_EM(1, 0, limit); - if(vmap == NULL) - return; - - for(a=0, ev= em->verts.first; ev; a++, ev= ev->next) { - vlist= get_uv_map_vert_EM(vmap, a); - - while(vlist) { - newuv[0]= 0; newuv[1]= 0; - vtot= 0; - - for(iterv=vlist; iterv; iterv=iterv->next) { - if((iterv != vlist) && iterv->separate) - break; - efa = EM_get_face_for_index(iterv->f); - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - - if (tf[iterv->f].flag & TF_SEL_MASK(iterv->tfindex)) { - newuv[0] += tf->uv[iterv->tfindex][0]; - newuv[1] += tf->uv[iterv->tfindex][1]; - vtot++; - } - } - - if (vtot > 1) { - newuv[0] /= vtot; newuv[1] /= vtot; - - for(iterv=vlist; iterv; iterv=iterv->next) { - if((iterv != vlist) && iterv->separate) - break; - efa = EM_get_face_for_index(iterv->f); - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (tf->flag & TF_SEL_MASK(iterv->tfindex)) { - tf->uv[iterv->tfindex][0]= newuv[0]; - tf->uv[iterv->tfindex][1]= newuv[1]; - } - } - } - vlist= iterv; - } - } - - free_uv_vert_map_EM(vmap); - EM_free_index_arrays(); - - if(G.sima->flag & SI_BE_SQUARE) be_square_tface_uv(em); - - BIF_undo_push("Stitch UV"); - - object_uvs_changed(OBACT); -} - -void select_linked_tface_uv(int mode) /* TODO */ -{ - EditMesh *em= G.editMesh; - EditFace *efa, *nearestefa=NULL; - MTFace *tf, *nearesttf=NULL; - UvVertMap *vmap; - UvMapVert *vlist, *iterv, *startv; - unsigned int *stack, stacksize= 0, nearestv; - char *flag; - int a, nearestuv, i, nverts, j; - float limit[2]; - if(is_uv_tface_editing_allowed()==0) - return; - - if(G.sima->flag & SI_SYNC_UVSEL) { - error("Can't select linked when Sync Mesh Selection is enabled"); - return; - } - - if (mode == 2) { - nearesttf= NULL; - nearestuv= 0; - } - if (mode!=2) { - find_nearest_uv(&nearesttf, &nearestefa, &nearestv, &nearestuv); - if(nearesttf==NULL) - return; - } - - get_connected_limit_tface_uv(limit); - vmap= make_uv_vert_map_EM(1, 1, limit); - if(vmap == NULL) - return; - - stack= MEM_mallocN(sizeof(*stack)* BLI_countlist(&em->faces), "UvLinkStack"); - flag= MEM_callocN(sizeof(*flag)*BLI_countlist(&em->faces), "UvLinkFlag"); - - if (mode == 2) { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) { - stack[stacksize]= a; - stacksize++; - flag[a]= 1; - } - } - } - } else { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(tf == nearesttf) { - stack[stacksize]= a; - stacksize++; - flag[a]= 1; - break; - } - } - } - - while(stacksize > 0) { - stacksize--; - a= stack[stacksize]; - - for (j=0, efa= em->faces.first; efa; efa= efa->next, j++) { - if (j==a) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - break; - } - } - - nverts= efa->v4? 4: 3; - - for(i=0; iv1 + i))->tmp.l); - - startv= vlist; - - for(iterv=vlist; iterv; iterv=iterv->next) { - if(iterv->separate) - startv= iterv; - if(iterv->f == a) - break; - } - - for(iterv=startv; iterv; iterv=iterv->next) { - if((startv != iterv) && (iterv->separate)) - break; - else if(!flag[iterv->f]) { - flag[iterv->f]= 1; - stack[stacksize]= iterv->f;; - stacksize++; - } - } - } - } - - if(mode==0 || mode==2) { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if(flag[a]) - tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - else - tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } - } - else if(mode==1) { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - if(flag[a]) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (efa->v4) { - if((tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4))) - break; - } - else if(tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) - break; - } - } - - if (efa) { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - if(flag[a]) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } - } - } - else { - for (a=0, efa= em->faces.first; efa; efa= efa->next, a++) { - if(flag[a]) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } - } - } - } - - MEM_freeN(stack); - MEM_freeN(flag); - free_uv_vert_map_EM(vmap); - - BIF_undo_push("Select linked UV"); - scrarea_queue_winredraw(curarea); -} - -void unlink_selection(void) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - if(G.sima->flag & SI_SYNC_UVSEL) { - error("Can't select unlinked when Sync Mesh Selection is enabled"); - return; - } - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if(efa->v4) { - if(~tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4)) - tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } else { - if(~tface->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) - tface->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3); - } - } - } - - BIF_undo_push("Unlink UV selection"); - scrarea_queue_winredraw(curarea); -} - -/* this function sets the selection on tagged faces - * This is needed because setting the selection on a face is done in - * a number of places but it also needs to respect the sticky modes - * for the UV verts - dealing with the sticky modes is best done in a seperate function - * - * de-selects faces that have been tagged on efa->tmp.l - */ -void uvface_setsel__internal(short select) -{ - - /* All functions calling this should call - * draw_uvs_face_check() - */ - - - /* selecting UV Faces with some modes requires us to change - * the selection in other faces (depending on the stickt mode) - * - * This only needs to be done when the Mesh is not used for selection - * (So for sticky modes - vertex or location based) - * */ - - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tf; - int nverts, i; - - if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_VERTEX) { - /* tag all verts as untouched, - * then touch the ones that have a face center in the loop - * and select all MTFace UV's that use a touched vert */ - - EditVert *eve; - - for (eve= em->verts.first; eve; eve= eve->next) - eve->tmp.l = 0; - - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->tmp.l) { - if (efa->v4) { - efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= efa->v4->tmp.l=1; - } else { - efa->v1->tmp.l= efa->v2->tmp.l= efa->v3->tmp.l= 1; - } - } - } - /* now select tagged verts */ - for (efa= em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - nverts= efa->v4? 4: 3; - for(i=0; iv1 + i))->tmp.l) { - if (select) { - simaUVSel_Set(efa, tf, i); - } else { - simaUVSel_UnSet(efa, tf, i); - } - } - } - } - } else if ((G.sima->flag & SI_SYNC_UVSEL)==0 && G.sima->sticky == SI_STICKY_LOC) { - EditFace *efa_vlist; - MTFace *tf_vlist; - UvMapVert *vlist, *start_vlist=NULL, *vlist_iter; - struct UvVertMap *vmap; - float limit[2]; - int efa_index; - //EditVert *eve; /* removed vert counting for now */ - //int a; - - get_connected_limit_tface_uv(limit); - - EM_init_index_arrays(0, 0, 1); - vmap= make_uv_vert_map_EM(0, 0, limit); - - /* verts are numbered above in make_uv_vert_map_EM, make sure this stays true! */ - /*for (a=0, eve= em->verts.first; eve; a++, eve= eve->next) - eve->tmp.l = a; */ - - if(vmap == NULL) - return; - - for (efa_index=0, efa= em->faces.first; efa; efa_index++, efa= efa->next) { - if (efa->tmp.l) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - nverts= efa->v4? 4: 3; - for(i=0; iv1 + i))->tmp.l); - - while (vlist_iter) { - if (vlist_iter->separate) - start_vlist = vlist_iter; - - if (efa_index == vlist_iter->f) { - break; - } - vlist_iter = vlist_iter->next; - } - - vlist_iter = start_vlist; - while (vlist_iter) { - - if (vlist_iter != start_vlist && vlist_iter->separate) - break; - - if (efa_index != vlist_iter->f) { - efa_vlist = EM_get_face_for_index(vlist_iter->f); - tf_vlist = CustomData_em_get(&em->fdata, efa_vlist->data, CD_MTFACE); - - if (select) { - simaUVSel_Set(efa_vlist, tf_vlist, vlist_iter->tfindex); - } else { - simaUVSel_UnSet(efa_vlist, tf_vlist, vlist_iter->tfindex); - } - } - vlist_iter = vlist_iter->next; - } - } - } - } - EM_free_index_arrays(); - free_uv_vert_map_EM(vmap); - - } else { /* SI_STICKY_DISABLE or G.sima->flag & SI_SYNC_UVSEL */ - for (efa= em->faces.first; efa; efa= efa->next) { - if (efa->tmp.l) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (select) { - simaFaceSel_Set(efa, tf); - } else { - simaFaceSel_UnSet(efa, tf); - } - } - } - } -} - -void pin_tface_uv(int mode) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if(mode ==1) { - if(simaUVSel_Check(efa, tface, 0)) tface->unwrap |= TF_PIN1; - if(simaUVSel_Check(efa, tface, 1)) tface->unwrap |= TF_PIN2; - if(simaUVSel_Check(efa, tface, 2)) tface->unwrap |= TF_PIN3; - if(efa->v4) - if(simaUVSel_Check(efa, tface, 3)) tface->unwrap |= TF_PIN4; - } - else if (mode ==0) { - if(simaUVSel_Check(efa, tface, 0)) tface->unwrap &= ~TF_PIN1; - if(simaUVSel_Check(efa, tface, 1)) tface->unwrap &= ~TF_PIN2; - if(simaUVSel_Check(efa, tface, 2)) tface->unwrap &= ~TF_PIN3; - if(efa->v4) - if(simaUVSel_Check(efa, tface, 3)) tface->unwrap &= ~TF_PIN4; - } - } - } - - BIF_undo_push("Pin UV"); - scrarea_queue_winredraw(curarea); -} - -void select_pinned_tface_uv(void) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - MTFace *tface; - - if( is_uv_tface_editing_allowed()==0 ) return; - - for (efa= em->faces.first; efa; efa= efa->next) { - tface = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tface)) { - if (tface->unwrap & TF_PIN1) simaUVSel_Set(efa, tface, 0); - if (tface->unwrap & TF_PIN2) simaUVSel_Set(efa, tface, 1); - if (tface->unwrap & TF_PIN3) simaUVSel_Set(efa, tface, 2); - if(efa->v4) { - if (tface->unwrap & TF_PIN4) simaUVSel_Set(efa, tface, 3); - } - - } - } - - if (G.sima->flag & SI_SYNC_UVSEL) { - allqueue(REDRAWVIEW3D, 0); /* mesh selection has changed */ - } - - BIF_undo_push("Select Pinned UVs"); - scrarea_queue_winredraw(curarea); -} - -int minmax_tface_uv(float *min, float *max) -{ - EditMesh *em= G.editMesh; - EditFace *efa; - MTFace *tf; - int sel; - - if( is_uv_tface_editing_allowed()==0 ) return 0; - - INIT_MINMAX2(min, max); - - sel= 0; - for (efa= em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if (simaUVSel_Check(efa, tf, 0)) DO_MINMAX2(tf->uv[0], min, max); - if (simaUVSel_Check(efa, tf, 1)) DO_MINMAX2(tf->uv[1], min, max); - if (simaUVSel_Check(efa, tf, 2)) DO_MINMAX2(tf->uv[2], min, max); - if (efa->v4 && (simaUVSel_Check(efa, tf, 3))) DO_MINMAX2(tf->uv[3], min, max); - sel = 1; - } - } - return sel; -} - -int cent_tface_uv(float *cent, int mode) -{ - float min[2], max[2]; - short change= 0; - - if (mode==0) { - if (minmax_tface_uv(min, max)) - change = 1; - - } else if (mode==1) { - EditFace *efa; - MTFace *tf; - INIT_MINMAX2(min, max); - - for (efa= G.editMesh->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&G.editMesh->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if (simaUVSel_Check(efa, tf, 0)) { DO_MINMAX2(tf->uv[0], min, max); change= 1;} - if (simaUVSel_Check(efa, tf, 1)) { DO_MINMAX2(tf->uv[1], min, max); change= 1;} - if (simaUVSel_Check(efa, tf, 2)) { DO_MINMAX2(tf->uv[2], min, max); change= 1;} - if (efa->v4 && (simaUVSel_Check(efa, tf, 3))) { DO_MINMAX2(tf->uv[3], min, max); change= 1;} - } - } - } - - if (change) { - cent[0]= (min[0]+max[0])/2.0; - cent[1]= (min[1]+max[1])/2.0; - return 1; - } - return 0; -} - -static void sima_show_info(int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf) -{ - short ofs; - char str[256]; - - ofs= sprintf(str, "X: %d Y: %d ", x, y); - if(cp) - ofs+= sprintf(str+ofs, "| R: %d G: %d B: %d A: %d ", cp[0], cp[1], cp[2], cp[3]); - if(fp) { - if(channels==4) - ofs+= sprintf(str+ofs, "| R: %.3f G: %.3f B: %.3f A: %.3f ", fp[0], fp[1], fp[2], fp[3]); - else if(channels==1) - ofs+= sprintf(str+ofs, "| Val: %.3f ", fp[0]); - else if(channels==3) - ofs+= sprintf(str+ofs, "| R: %.3f G: %.3f B: %.3f ", fp[0], fp[1], fp[2]); - } - if(zp) - ofs+= sprintf(str+ofs, "| Z: %.4f ", 0.5+0.5*( ((float)*zp)/(float)0x7fffffff)); - if(zpf) - ofs+= sprintf(str+ofs, "| Z: %.3f ", *zpf); - - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - glColor4f(.0,.0,.0,.25); - glRectf(0.0, 0.0, curarea->winx, 30.0); - glDisable(GL_BLEND); - - glColor3ub(255, 255, 255); - glRasterPos2i(10, 10); - - BMF_DrawString(G.fonts, str); - -} - -void sima_sample_color(void) -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - float fx, fy; - short mval[2], mvalo[2], firsttime=1; - - if(ibuf==NULL) - return; - - calc_image_view(G.sima, 'f'); - getmouseco_areawin(mvalo); - - while(get_mbut() & L_MOUSE) { - - getmouseco_areawin(mval); - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) { - firsttime= 0; - areamouseco_to_ipoco(G.v2d, mval, &fx, &fy); - - if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) { - float *fp= NULL, *zpf= NULL; - int *zp= NULL; - char *cp= NULL; - - int x= (int) (fx*ibuf->x); - int y= (int) (fy*ibuf->y); - - if(x>=ibuf->x) x= ibuf->x-1; - if(y>=ibuf->y) y= ibuf->y-1; - - if(ibuf->rect) - cp= (char *)(ibuf->rect + y*ibuf->x + x); - if(ibuf->zbuf) - zp= ibuf->zbuf + y*ibuf->x + x; - if(ibuf->zbuf_float) - zpf= ibuf->zbuf_float + y*ibuf->x + x; - if(ibuf->rect_float) - fp= (ibuf->rect_float + (ibuf->channels)*(y*ibuf->x + x)); - - if(G.sima->cumap) { - float vec[3]; - if(fp==NULL) { - fp= vec; - vec[0]= (float)cp[0]/255.0f; - vec[1]= (float)cp[1]/255.0f; - vec[2]= (float)cp[2]/255.0f; - } - - if(ibuf->channels==4) { - if(G.qual & LR_CTRLKEY) { - curvemapping_set_black_white(G.sima->cumap, NULL, fp); - curvemapping_do_ibuf(G.sima->cumap, ibuf); - } - else if(G.qual & LR_SHIFTKEY) { - curvemapping_set_black_white(G.sima->cumap, fp, NULL); - curvemapping_do_ibuf(G.sima->cumap, ibuf); - } - } - } - - scrarea_do_windraw(curarea); - myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); - glLoadIdentity(); - sima_show_info(ibuf->channels, x, y, cp, fp, zp, zpf); - screen_swapbuffers(); - } - - } - BIF_wait_for_statechange(); - } - - scrarea_queue_winredraw(curarea); -} - -/* Image functions */ - -static void load_image_filesel(char *str) /* called from fileselect */ -{ - Image *ima= NULL; - - ima= BKE_add_image_file(str); - if(ima) { - BKE_image_signal(ima, &G.sima->iuser, IMA_SIGNAL_RELOAD); - image_changed(G.sima, ima); - } - BIF_undo_push("Load image UV"); - allqueue(REDRAWIMAGE, 0); -} - -static void replace_image_filesel(char *str) /* called from fileselect */ -{ - if (!G.sima->image) - return; - - strncpy(G.sima->image->name, str, sizeof(G.sima->image->name)-1); /* we cant do much if the str is longer then 240 :/ */ - BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_RELOAD); - BIF_undo_push("Replace image UV"); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} - - -static void save_image_doit(char *name) -{ - Image *ima= G.sima->image; - ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser); - int len; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - if (ibuf) { - BLI_strncpy(str, name, sizeof(str)); - - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - - if(G.scene->r.scemode & R_EXTENSION) - BKE_add_image_extension(str, G.sima->imtypenr); - - if (saveover(str)) { - - /* enforce user setting for RGB or RGBA, but skip BW */ - if(G.scene->r.planes==32) - ibuf->depth= 32; - else if(G.scene->r.planes==24) - ibuf->depth= 24; - - waitcursor(1); - if(G.sima->imtypenr==R_MULTILAYER) { - RenderResult *rr= BKE_image_get_renderresult(ima); - if(rr) { - RE_WriteRenderResult(rr, str, G.scene->r.quality); - - BLI_strncpy(ima->name, name, sizeof(ima->name)); - BLI_strncpy(ibuf->name, str, sizeof(ibuf->name)); - - /* should be function? nevertheless, saving only happens here */ - for(ibuf= ima->ibufs.first; ibuf; ibuf= ibuf->next) - ibuf->userflags &= ~IB_BITMAPDIRTY; - - } - else error("Did not write, no Multilayer Image"); - } - else if (BKE_write_ibuf(ibuf, str, G.sima->imtypenr, G.scene->r.subimtype, G.scene->r.quality)) { - BLI_strncpy(ima->name, name, sizeof(ima->name)); - BLI_strncpy(ibuf->name, str, sizeof(ibuf->name)); - - ibuf->userflags &= ~IB_BITMAPDIRTY; - - /* change type? */ - if( ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER)) { - ima->source= IMA_SRC_FILE; - ima->type= IMA_TYPE_IMAGE; - } - if(ima->type==IMA_TYPE_R_RESULT) - ima->type= IMA_TYPE_IMAGE; - - /* name image as how we saved it */ - len= strlen(str); - while (len > 0 && str[len - 1] != '/' && str[len - 1] != '\\') len--; - rename_id(&ima->id, str+len); - } - else { - error("Couldn't write image: %s", str); - } - - allqueue(REDRAWHEADERS, 0); - allqueue(REDRAWBUTSSHADING, 0); - - waitcursor(0); - } - } -} - -void open_image_sima(short imageselect) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if(G.sima->image) - strcpy(name, G.sima->image->name); - else - strcpy(name, U.textudir); - - if(imageselect) - activate_imageselect(FILE_SPECIAL, "Open Image", name, load_image_filesel); - else - activate_fileselect(FILE_SPECIAL, "Open Image", name, load_image_filesel); -} - -void replace_image_sima(short imageselect) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if(G.sima->image) - strcpy(name, G.sima->image->name); - else - strcpy(name, U.textudir); - - if(imageselect) - activate_imageselect(FILE_SPECIAL, "Replace Image", name, replace_image_filesel); - else - activate_fileselect(FILE_SPECIAL, "Replace Image", name, replace_image_filesel); -} - - -static char *filesel_imagetype_string(Image *ima) -{ - char *strp, *str= MEM_callocN(14*32, "menu for filesel"); - - strp= str; - str += sprintf(str, "Save Image as: %%t|"); - str += sprintf(str, "Targa %%x%d|", R_TARGA); - str += sprintf(str, "Targa Raw %%x%d|", R_RAWTGA); - str += sprintf(str, "PNG %%x%d|", R_PNG); - str += sprintf(str, "BMP %%x%d|", R_BMP); - str += sprintf(str, "Jpeg %%x%d|", R_JPEG90); - str += sprintf(str, "Iris %%x%d|", R_IRIS); - if(G.have_libtiff) - str += sprintf(str, "Tiff %%x%d|", R_TIFF); - str += sprintf(str, "Radiance HDR %%x%d|", R_RADHDR); - str += sprintf(str, "Cineon %%x%d|", R_CINEON); - str += sprintf(str, "DPX %%x%d|", R_DPX); -#ifdef WITH_OPENEXR - str += sprintf(str, "OpenEXR %%x%d|", R_OPENEXR); - /* saving sequences of multilayer won't work, they copy buffers */ - if(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER); - else str += sprintf(str, "MultiLayer %%x%d|", R_MULTILAYER); -#endif - return strp; -} - -/* always opens fileselect */ -void save_as_image_sima(void) -{ - Image *ima = G.sima->image; - ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser); - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if (ima) { - strcpy(name, ima->name); - - if (ibuf) { - char *strp; - - strp= filesel_imagetype_string(ima); - - /* cant save multilayer sequence, ima->rr isn't valid for a specific frame */ - if(ima->rr && !(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER)) - G.sima->imtypenr= R_MULTILAYER; - else if(ima->type==IMA_TYPE_R_RESULT) - G.sima->imtypenr= G.scene->r.imtype; - else G.sima->imtypenr= BKE_ftype_to_imtype(ibuf->ftype); - - activate_fileselect_menu(FILE_SPECIAL, "Save Image", name, strp, &G.sima->imtypenr, save_image_doit); - } - } -} - -/* if exists, saves over without fileselect */ -void save_image_sima(void) -{ - Image *ima = G.sima->image; - ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser); - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if (ima) { - strcpy(name, ima->name); - - if (ibuf) { - if (BLI_exists(ibuf->name)) { - if(BKE_image_get_renderresult(ima)) - G.sima->imtypenr= R_MULTILAYER; - else - G.sima->imtypenr= BKE_ftype_to_imtype(ibuf->ftype); - - save_image_doit(ibuf->name); - } - else - save_as_image_sima(); - } - } -} - -void save_image_sequence_sima(void) -{ - ImBuf *ibuf; - int tot= 0; - char di[FILE_MAX], fi[FILE_MAX]; - - if(G.sima->image==NULL) - return; - if(G.sima->image->source!=IMA_SRC_SEQUENCE) - return; - if(G.sima->image->type==IMA_TYPE_MULTILAYER) { - error("Cannot save Multilayer Sequences"); - return; - } - - /* get total */ - for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next) - if(ibuf->userflags & IB_BITMAPDIRTY) - tot++; - - if(tot==0) { - notice("No Images have been changed"); - return; - } - /* get a filename for menu */ - for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next) - if(ibuf->userflags & IB_BITMAPDIRTY) - break; - - BLI_strncpy(di, ibuf->name, FILE_MAX); - BLI_splitdirstring(di, fi); - - sprintf(fi, "%d Image(s) will be saved in %s", tot, di); - if(okee(fi)) { - - for(ibuf= G.sima->image->ibufs.first; ibuf; ibuf= ibuf->next) { - if(ibuf->userflags & IB_BITMAPDIRTY) { - char name[FILE_MAX]; - BLI_strncpy(name, ibuf->name, sizeof(name)); - - BLI_convertstringcode(name, G.sce, 0); - - if(0 == IMB_saveiff(ibuf, name, IB_rect | IB_zbuf | IB_zbuffloat)) { - error("Could not write image", name); - break; - } - printf("Saved: %s\n", ibuf->name); - ibuf->userflags &= ~IB_BITMAPDIRTY; - } - } - } -} - -void reload_image_sima(void) -{ - if (G.sima ) { - BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_RELOAD); - /* image_changed(G.sima, 0); - do we really need this? */ - } - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - BIF_preview_changed(ID_TE); -} - -void new_image_sima(void) -{ - static int width= 1024, height= 1024; - static short uvtestgrid= 0; - static float color[] = {0, 0, 0, 1}; - char name[22]; - Image *ima; - - strcpy(name, "Untitled"); - - add_numbut(0, TEX, "Name:", 0, 21, name, NULL); - add_numbut(1, NUM|INT, "Width:", 1, 16384, &width, NULL); - add_numbut(2, NUM|INT, "Height:", 1, 16384, &height, NULL); - add_numbut(3, COL, "", 0, 0, &color, NULL); - add_numbut(4, NUM|FLO, "Alpha:", 0.0, 1.0, &color[3], NULL); - add_numbut(5, TOG|SHO, "UV Test Grid", 0, 0, &uvtestgrid, NULL); - if (!do_clever_numbuts("New Image", 6, REDRAW)) - return; - - ima = BKE_add_image_size(width, height, name, uvtestgrid, color); - image_changed(G.sima, ima); - BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE); - BIF_undo_push("Add image"); - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} - -void pack_image_sima() -{ - Image *ima = G.sima->image; - - if (ima) { - if(ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE) { - if (ima->packedfile) { - if (G.fileflags & G_AUTOPACK) - if (okee("Disable AutoPack?")) - G.fileflags &= ~G_AUTOPACK; - - if ((G.fileflags & G_AUTOPACK) == 0) { - unpackImage(ima, PF_ASK); - BIF_undo_push("Unpack image"); - } - } - else { - ImBuf *ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser); - if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { - if(okee("Can't pack painted image. Use Repack as PNG?")) - BKE_image_memorypack(ima); - } - else { - ima->packedfile = newPackedFile(ima->name); - BIF_undo_push("Pack image"); - } - } - - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWHEADERS, 0); - } - } -} - - - -/* goes over all ImageUsers, and sets frame numbers if auto-refresh is set */ -void BIF_image_update_frame(void) -{ - Tex *tex; - - /* texture users */ - for(tex= G.main->tex.first; tex; tex= tex->id.next) { - if(tex->type==TEX_IMAGE && tex->ima) - if(ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) - if(tex->iuser.flag & IMA_ANIM_ALWAYS) - BKE_image_user_calc_imanr(&tex->iuser, G.scene->r.cfra, 0); - - } - /* image window, compo node users */ - if(G.curscreen) { - ScrArea *sa; - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_VIEW3D) { - View3D *v3d= sa->spacedata.first; - if(v3d->bgpic) - if(v3d->bgpic->iuser.flag & IMA_ANIM_ALWAYS) - BKE_image_user_calc_imanr(&v3d->bgpic->iuser, G.scene->r.cfra, 0); - } - else if(sa->spacetype==SPACE_IMAGE) { - SpaceImage *sima= sa->spacedata.first; - if(sima->iuser.flag & IMA_ANIM_ALWAYS) - BKE_image_user_calc_imanr(&sima->iuser, G.scene->r.cfra, 0); - } - else if(sa->spacetype==SPACE_NODE) { - SpaceNode *snode= sa->spacedata.first; - if((snode->treetype==NTREE_COMPOSIT) && (snode->nodetree)) { - bNode *node; - for(node= snode->nodetree->nodes.first; node; node= node->next) { - if(node->id && node->type==CMP_NODE_IMAGE) { - Image *ima= (Image *)node->id; - ImageUser *iuser= node->storage; - if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) - if(iuser->flag & IMA_ANIM_ALWAYS) - BKE_image_user_calc_imanr(iuser, G.scene->r.cfra, 0); - } - } - } - } - } - } -} - -void aspect_sima(SpaceImage *sima, float *x, float *y) -{ - *x = *y = 1.0; - - if( (sima->image == 0) || - (sima->image->type == IMA_TYPE_R_RESULT) || - (sima->image->type == IMA_TYPE_COMPOSITE) || - (sima->image->tpageflag & IMA_TILES) || - (sima->image->aspx==0.0 || sima->image->aspy==0.0) - ) { - return; - } - - /* x is always 1 */ - *y = sima->image->aspy / sima->image->aspx; -} - - -/* Face selection tests - Keep these together */ - -/* this checks weather a face is drarn without the local image check */ -int simaFaceDraw_Check_nolocal( EditFace *efa ) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - return (efa->h==0); - } else { - return (efa->h==0 && efa->f & SELECT); - } - return 0; -} - -int simaFaceDraw_Check( EditFace *efa, MTFace *tf ) -{ - if (G.sima && G.sima->flag & SI_LOCAL_UV) { - if (tf->tpage==G.sima->image) { - return simaFaceDraw_Check_nolocal(efa); - } else { - return 0; - } - } else { - return simaFaceDraw_Check_nolocal(efa); - } -} - -int simaFaceSel_Check( struct EditFace *efa, struct MTFace *tf ) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - return (efa->f & SELECT); - } else { - return (!(~tf->flag & (TF_SEL1|TF_SEL2|TF_SEL3)) &&(!efa->v4 || tf->flag & TF_SEL4)); - } -} - -void simaFaceSel_Set( struct EditFace *efa, struct MTFace *tf ) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - EM_select_face(efa, 1); - } else { - tf->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } -} - -void simaFaceSel_UnSet( struct EditFace *efa, struct MTFace *tf ) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - EM_select_face(efa, 0); - } else { - tf->flag &= ~(TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4); - } -} - -int simaUVSel_Check( struct EditFace *efa, struct MTFace *tf, int i) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - if (G.scene->selectmode == SCE_SELECT_FACE) { - return efa->f & SELECT; - } else { - return (*(&efa->v1 + i))->f & SELECT; - } - } else { - return tf->flag & TF_SEL_MASK(i); - } -} - -void simaUVSel_Set( struct EditFace *efa, struct MTFace *tf, int i) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - if (G.scene->selectmode == SCE_SELECT_FACE) { - EM_select_face(efa, 1); - } else { - (*(&efa->v1 + i))->f |= SELECT; - } - } else { - tf->flag |= TF_SEL_MASK(i); - } -} - -void simaUVSel_UnSet( struct EditFace *efa, struct MTFace *tf, int i) -{ - if (G.sima && G.sima->flag & SI_SYNC_UVSEL) { - if (G.scene->selectmode == SCE_SELECT_FACE) { - EM_select_face(efa, 0); - } else { - (*(&efa->v1 + i))->f &= ~SELECT; - } - } else { - tf->flag &= ~TF_SEL_MASK(i); - } -} diff --git a/source/blender/src/editsound.c b/source/blender/src/editsound.c deleted file mode 100644 index befcd574ac4..00000000000 --- a/source/blender/src/editsound.c +++ /dev/null @@ -1,1063 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#define __USE_XOPEN /* Needed for swab on linux */ -#include -#undef __USE_XOPEN -#else - -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_sound.h" -#include "BKE_library.h" -#include "BKE_packedFile.h" - -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_interface.h" -#include "BIF_editsound.h" -#include "BIF_mywindow.h" -#include "BIF_toolbox.h" - -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "BDR_editobject.h" - -#include "blendef.h" - -#include "mydevice.h" - -#include "SND_C-api.h" -#include "SND_DependKludge.h" - -#include "SYS_System.h" - -#include "PIL_time.h" - - -/* this might move to the external header */ -void* sound_get_libraryinterface(void); - -static SND_SceneHandle ghSoundScene=NULL; -static SND_AudioDeviceInterfaceHandle ghAudioDeviceInterface=NULL; - -/* que? why only here? because of the type define? */ -bSound *sound_find_sound(char *id_name); -void sound_read_wav_data(bSound * sound, PackedFile * pf); -void sound_stop_sound(void *object, bSound *sound); -void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); -/* void sound_stop_all_sounds(void); already in BIF_editsound.h */ - - - -/* Right. Now for some implementation: */ -void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - SpaceSound *ssound= spacedata; - unsigned short event= evt->event; - short val= evt->val; - float dx, dy; - int doredraw= 0, cfra, first = 0; - short mval[2], nr; - short mousebut = L_MOUSE; - - if(curarea->win==0) return; - - if(val) { - - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - switch(event) { - case LEFTMOUSE: - ssound->flag |= SND_CFRA_NUM; - do { - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra = (int)dx; - if(cfra< 1) cfra= 1; - - if( cfra!=CFRA || first ) - { - first= 0; - CFRA= cfra; - update_for_newframe(); - force_draw_plus(SPACE_VIEW3D, 1); - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - ssound->flag &= ~SND_CFRA_NUM; - - doredraw= 1; - - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - case RIGHTMOUSE: - { - TimeMarker *marker; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - marker = find_nearest_marker(0); - if (marker) { - if ((G.qual & LR_SHIFTKEY)==0) - deselect_markers(0, 0); - - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - } - - force_draw(0); - std_rmouse_transform(transform_markers); - } - break; - - case PADPLUSKEY: - dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case PADMINUS: - dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin-= dx; - G.v2d->cur.xmax+= dx; - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case HOMEKEY: - do_sound_buttons(B_SOUNDHOME); - break; - - case PAGEUPKEY: /* cfra to next marker */ - nextprev_marker(1); - break; - case PAGEDOWNKEY: /* cfra to prev marker */ - nextprev_marker(-1); - break; - - case AKEY: /* select/deselect all */ - deselect_markers(1, 0); - - allqueue(REDRAWMARKER, 0); - break; - - case BKEY: /* borderselect markers */ - borderselect_markers(); - break; - - case DKEY: /* duplicate selected marker(s) */ - if (G.qual & LR_SHIFTKEY) { - duplicate_marker(); - - allqueue(REDRAWMARKER, 0); - } - break; - - case GKEY: - transform_markers('g', 0); - break; - - case MKEY: /* add marker or rename first selected */ - if (G.qual & LR_CTRLKEY) - rename_marker(); - else - add_marker(CFRA); - - allqueue(REDRAWMARKER, 0); - break; - - case TKEY: /* toggle time display */ - nr= pupmenu("Time value%t|Frames %x1|Seconds%x2"); - if (nr>0) { - if(nr==1) ssound->flag |= SND_DRAWFRAMES; - else ssound->flag &= ~SND_DRAWFRAMES; - doredraw= 1; - } - - break; - - case DELKEY: /* delete selected markers */ - case XKEY: - if (okee("Erase selected")) { - remove_marker(); - allqueue(REDRAWMARKER, 0); - } - break; - } - } - - if(doredraw) - scrarea_queue_winredraw(curarea); -} - - - -void sound_initialize_sounds(void) -{ - bSound *sound; - - if(ghSoundScene) { - - /* clear the soundscene */ - SND_RemoveAllSounds(ghSoundScene); - SND_RemoveAllSamples(ghSoundScene); - } - - /* initialize sample blocks (doesnt call audio system, needs to be done once after load */ - sound = G.main->sound.first; - while (sound) { - sound_sample_is_null(sound); - sound = (bSound *) sound->id.next; - } -} - - - -bSound *sound_make_copy(bSound *originalsound) -{ - bSound *sound = NULL; - char name[160]; - int len; - - if(ghSoundScene==NULL) sound_init_audio(); - - /* only copy sounds that are sounds */ - if (originalsound) - { - /* do some name magic */ - strcpy(name, originalsound->name); - len = strlen(name); - while ((len > 0) && (name[len - 1] != '/') && (name[len - 1] != '\\')) - len--; - - /* allocate the needed memory */ - sound = alloc_libblock(&G.main->sound, ID_SO, name + len); - - /* create a soundobject */ - sound->snd_sound = SND_CreateSound(); - - /* set the samplename */ - strcpy(sound->name, name); - SND_SetSampleName(sound->snd_sound, sound->name); - - /* add the new object to the soundscene */ - SND_AddSound(ghSoundScene, sound->snd_sound); - - /* and copy the data from the original */ - sound->attenuation = originalsound->attenuation; - sound->distance = originalsound->distance; - sound->max_gain = originalsound->max_gain; - sound->min_gain = originalsound->min_gain; - sound->newpackedfile = originalsound->newpackedfile; - sound->panning = originalsound->panning; - sound->pitch = originalsound->pitch; - sound->sample = originalsound->sample; - sound->volume = originalsound->volume; - - if (originalsound->flags & SOUND_FLAGS_3D) - sound->flags |= SOUND_FLAGS_3D; - else - sound->flags &= ~SOUND_FLAGS_3D; - } - - return sound; -} - - - -void sound_initialize_sample(bSound *sound) -{ - if(ghSoundScene==NULL) sound_init_audio(); - - if (sound && sound->sample == NULL) - sound_sample_is_null(sound); -} - - -void sound_read_wav_data(bSound *sound, PackedFile *pf) -{ - int i, temp; - short shortbuf, *temps; - int longbuf; - char buffer[25]; - char *data = NULL; - char *tempc; - bSample *sample = NULL; - int channels, rate, bits, len; - - /* prepare for the worst... */ - sound->sample->type = SAMPLE_INVALID; - - rewindPackedFile(pf); - - /* check to see if it is a file in "RIFF WAVE fmt" format */ - if (readPackedFile(pf, buffer, 16) != 16) { - if (G.f & G_DEBUG) printf("File too short\n"); - return; - } - - if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) { - readPackedFile(pf, &i, 4);// start of data - if(G.order==B_ENDIAN) - SWITCH_INT(i); - - /* read the sampleformat */ - readPackedFile(pf, &shortbuf, 2); - if(G.order==B_ENDIAN) { - SWITCH_SHORT(shortbuf); - } - - /* read the number of channels */ - readPackedFile(pf, &shortbuf, 2); - - if(G.order==B_ENDIAN) { - SWITCH_SHORT(shortbuf); - } - - /* check the number of channels */ - if(shortbuf != 1 && shortbuf != 2) { - if (G.f & G_DEBUG) printf("Unsupported number of channels\n"); - return; - } - channels = shortbuf; - - /* read the samplerate */ - readPackedFile(pf, &longbuf, 4); - - - if(G.order==B_ENDIAN) - SWITCH_INT(longbuf); - rate = longbuf; - - /* read the bitrate */ - // Ton's way - readPackedFile(pf, &temp, 4); - - if(G.order==B_ENDIAN) - SWITCH_INT(temp); - - if(channels && rate) - bits= 8*temp/(rate * channels); - - // Frank's way - - readPackedFile(pf, &shortbuf, 2); - readPackedFile(pf, &shortbuf, 2); - if(G.order==B_ENDIAN) { - SWITCH_SHORT(shortbuf); - } - bits = shortbuf; - - seekPackedFile(pf, i-16, SEEK_CUR); - readPackedFile(pf, buffer, 4); - /* check if we have a 'data' chunk */ - while(memcmp(buffer, "data", 4)!=0) { - if (readPackedFile(pf, &i, 4) != 4) - break; - - if(G.order==B_ENDIAN) - SWITCH_INT(i); - - seekPackedFile(pf, i, SEEK_CUR); - if (readPackedFile(pf, buffer, 4) != 4) - break; - } - - /* guess not */ - if (memcmp(buffer, "data", 4) !=0) { - if (G.f & G_DEBUG) printf("No data found\n"); - } - /* or maybe we do! */ - else { - readPackedFile(pf, &longbuf, 4); - if(G.order==B_ENDIAN) SWITCH_INT(longbuf); - - /* handle 8 and 16 bit samples differently */ - /* intrr: removed, longbuf is length in bytes, not samples */ - if (bits == 16) - data = (char *)MEM_mallocN(longbuf, "sample data"); - else - data = (char *)MEM_mallocN(longbuf*2, "sample data"); - - len = longbuf /*/ 4.0*/; /* for some strange reason the sample length is off by a factor of 4... */ - /* intrr's comment: Funny eh, how one 16-bit stereo sample is 4 bytes? :-) */ - - if(data) { - readPackedFile(pf, data, len); - /* data is only used to draw! */ - if (bits == 8) { - temps = (short *) data; - tempc = (char *) data; - for (i = len - 1; i >= 0; i--) - temps[i] = tempc[i] << 8; - } - else { - if(G.order==B_ENDIAN) { - swab(data, data, len); - } - } - /* fill the sound with the found data */ - sample = sound->sample; - sample->channels = channels; - sample->rate = rate; - sample->bits = bits; - sample->len = len; - sample->data = data; - sample->type = SAMPLE_WAV; - } - } - } - else { - sound->sample->type = SAMPLE_INVALID; - if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name); - } -} - - - -/* ugly, but it works (for now) */ -static int sound_get_filetype_from_header(bSound *sound, PackedFile *pf) -{ - int filetype = SAMPLE_INVALID; - int i; - char buffer[25]; - short shortbuf; - - rewindPackedFile(pf); - - if (readPackedFile(pf, buffer, 16) != 16) { - if (G.f & G_DEBUG) printf("File too short\n"); - return filetype; - } - - if(!(memcmp(buffer, "RIFF", 4) && memcmp(&(buffer[8]), "WAVEfmt ", 8))) { - readPackedFile(pf, &i, 4); - if(G.order==B_ENDIAN) - SWITCH_INT(i); - - /* read the sampleformat */ - readPackedFile(pf, &shortbuf, 2); - if(G.order==B_ENDIAN) { - char s_i, *p_i; - p_i= (char *)&(shortbuf); - s_i= p_i[0]; - p_i[0]= p_i[1]; - p_i[1]= s_i; - } - - if (shortbuf == SND_WAVE_FORMAT_PCM) { - filetype = SAMPLE_WAV; - } - else - /* only fmod supports compressed wav */ -#ifdef USE_FMOD - { - /* and only valid publishers may use compressed wav */ - switch (shortbuf) - { - case SND_WAVE_FORMAT_ADPCM: - case SND_WAVE_FORMAT_ALAW: - case SND_WAVE_FORMAT_MULAW: - case SND_WAVE_FORMAT_DIALOGIC_OKI_ADPCM: - case SND_WAVE_FORMAT_CONTROL_RES_VQLPC: - case SND_WAVE_FORMAT_GSM_610: - case SND_WAVE_FORMAT_MPEG3: - filetype = SAMPLE_WAV; - break; - default: -#endif - { - filetype = SAMPLE_INVALID; - if (G.f & G_DEBUG) printf("Unsupported wav compression\n"); - } - } -#ifdef USE_FMOD - } - } - else if (!memcmp(buffer, "OggS", 4)) { - filetype = SAMPLE_OGG_VORBIS; - } - else if ((!memcmp(buffer, "ID3", 3)) || (!memcmp(buffer, "", 2))) { - filetype = SAMPLE_MP3; - } -#endif - else { - filetype = SAMPLE_INVALID; - if (G.f & G_DEBUG) printf("Unsupported sound format: %s\n", sound->name); - } - - return filetype; -} - - - -static int check_filetype(bSound *sound, PackedFile *pf) -{ -// char* pdest; - sound->sample->type = SAMPLE_INVALID; -/* - // parse the name for the extension to see what kind of sample it is - pdest = strrchr(sound->sample->name, '.'); - - // a simple check to see what kind of sample we're dealing with - if (stricmp(pdest, ".wav") == 0) - sound->sample->type = SAMPLE_WAV; - -#ifdef USE_FMOD - if (stricmp(pdest, ".mp2") == 0) - sound->sample->type = SAMPLE_MP2; - if (stricmp(pdest, ".mp3") == 0) - sound->sample->type = SAMPLE_MP3; - if (stricmp(pdest, ".ogg") == 0) - sound->sample->type = SAMPLE_OGG_VORBIS; - if (stricmp(pdest, ".raw") == 0) - sound->sample->type = SAMPLE_RAW; - if (stricmp(pdest, ".wma") == 0) - sound->sample->type = SAMPLE_WMA; - if (stricmp(pdest, ".asf") == 0) - sound->sample->type = SAMPLE_ASF; -#endif -*/ - sound->sample->type = sound_get_filetype_from_header(sound, pf); - - /* get some info from the sample */ - switch (sound->sample->type) { - case SAMPLE_WAV: - { - sound_read_wav_data(sound, pf); - break; - } - case SAMPLE_OGG_VORBIS: - case SAMPLE_MP3: - case SAMPLE_MP2: - case SAMPLE_RAW: - case SAMPLE_WMA: - case SAMPLE_ASF: - break; - default: - { - if (G.f & G_DEBUG) printf("No valid sample: %s\n", sound->name); - break; - } - } - - return sound->sample->type; -} - - - -int sound_load_sample(bSound *sound) -{ - int result = FALSE; - PackedFile *pf; - int freePF = FALSE; - int buffer = -1; - - if(ghSoundScene==NULL) sound_init_audio(); - - /* check the sample (valid?) */ - if (sound->sample->type == SAMPLE_UNKNOWN || sound->snd_sound == NULL) { - /* find... */ - pf = sound_find_packedfile(sound); - - /* ...or create a (temp)packedfile */ - if (pf == NULL) { - pf = newPackedFile(sound->name); - - /* if autopack is off, free the pf afterwards */ - if ((G.fileflags & G_AUTOPACK) == 0) - freePF = TRUE; - } - - /* if we have a valid pf... */ - if (pf) { - /* check the content of the pf */ - check_filetype(sound, pf); - - /* check if the sampletype is supported */ - if (sound->sample->type != SAMPLE_INVALID && sound->sample->type != SAMPLE_UNKNOWN) { - /* register the sample at the audiodevice */ - buffer = SND_AddSample(ghSoundScene, sound->sample->name, pf->data, pf->size); - - /* create a soundobject */ - sound->snd_sound = SND_CreateSound(); - SND_SetSampleName(sound->snd_sound, sound->sample->name); - - /* add the soundobject to the soundscene */ - if (SND_CheckBuffer(ghSoundScene, sound->snd_sound)) - SND_AddSound(ghSoundScene, sound->snd_sound); - else - if (G.f & G_DEBUG) printf("error: sample didn't load properly\n"); - - /* if it was places in buffer[0] or higher, it succeeded */ - if (buffer >= 0) - result = TRUE; - } - /* if not, free the pf */ - else { - freePF = TRUE; - } - - /* if you want it freed, make it so */ - if (freePF) { - freePackedFile(pf); - pf = NULL; - } - /* or else connect the pf to the sound and sample */ -// else { - sound->newpackedfile = pf; - sound->sample->packedfile = pf; -// } - } - else { - if (G.f & G_DEBUG) printf("%s: File not found!\n", sound->name); - sound->sample->type = SAMPLE_INVALID; - } - } - /* if the sample ain't invalid, we're ready to go! */ - else if (sound->sample->type != SAMPLE_INVALID) { - result = TRUE; - } - - return result; -} - - - -bSound *sound_new_sound(char *name) -{ - bSound *sound = NULL; - int len, file; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - if(ghSoundScene==NULL) sound_init_audio(); - - if (!G.scene->audio.mixrate) G.scene->audio.mixrate = 44100; - /* convert the name to absolute path */ - strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - - /* check if the sample on disk can be opened */ - file = open(str, O_BINARY|O_RDONLY); - - if (file != -1) { - close(file); - - - /* do some name magic */ - len = strlen(name); - while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\') - len--; - - /* allocate some memory for the sound */ - sound = alloc_libblock(&G.main->sound, ID_SO, name + len); - strcpy(sound->name, name); - - /* intialize and check the sample */ - sound_initialize_sample(sound); - - /* load the sample & check if this blender supports the sound format */ -// sound_load_sample(sound); - - if (sound->sample->type == SAMPLE_INVALID) { - free_libblock(&G.main->sound, sound); - sound = NULL; - } - else - { - sound->volume = 1.0; - sound->attenuation = 1.0; - sound->distance = 1.0; - sound->min_gain = 0.0; - sound->max_gain = 1.0; - } - } - - return (sound); -} - - - -int sound_set_sample(bSound *sound, bSample *sample) -{ - int result = TRUE; - - if(ghSoundScene==NULL) sound_init_audio(); - - /* delete the soundobject */ - if (sound->snd_sound) { - SND_RemoveSound(ghSoundScene, sound->snd_sound); - sound->snd_sound = NULL; - } - - /* connect the sample to the sound */ - sound->sample = sample; - sound->newpackedfile = NULL; - - if (sound->sample) { - - /* and set the right pf */ - sound->newpackedfile = sample->packedfile; - - /* if the sampletype is unknown initialize it */ - if (sound->sample->type == SAMPLE_UNKNOWN) { - sound_initialize_sample(sound); - - /* load the sample & check if this blender supports the sound format */ - if (!sound_load_sample(sound)) { - result = FALSE; - } - } - } - - return result; -} - - - -bSample *sound_new_sample(bSound *sound) -{ - bSample *sample = NULL; - int len; - char *name; - - if (sound != NULL) { - name = sound->name; - len = strlen(name); - /* do some name magic */ - while (len > 0 && name[len - 1] != '/' && name[len - 1] != '\\') - len--; - - /* allocate the memory for the sample */ - sample = MEM_callocN(sizeof(bSample), "sample"); - BLI_strncpy(sample->id.name+2, name+len, 20); - BLI_addtail(samples, sample); /* samples is ugly global */ - - sample->data = &sample->fakedata[0]; - sample->type = SAMPLE_UNKNOWN; - - /* some default settings. We get divide by zero if these values are not set */ - sample->channels = 1; - sample->rate = 44100; - sample->bits = 16; - sample->alindex = SAMPLE_INVALID; - - /* convert sound->name to abolute filename */ - strcpy(sample->name, sound->name); - BLI_convertstringcode(sample->name, G.sce, G.scene->r.cfra); - - /* connect the pf to the sample */ - if (sound->newpackedfile) - sample->packedfile = sound->newpackedfile; - else - sample->packedfile = sound_find_packedfile(sound); - } - - return(sample); -} - - - -/* find a sample that might already be loaded */ -bSample *sound_find_sample(bSound *sound) -{ - bSample *sample; - char name[FILE_MAXDIR + FILE_MAXFILE]; - char samplename[FILE_MAXDIR + FILE_MAXFILE]; - - // convert sound->name to abolute filename - strcpy(name, sound->name); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - - /* search through the list of loaded samples */ - sample = samples->first; - while (sample) { - strcpy(samplename, sample->name); - BLI_convertstringcode(samplename, G.sce, G.scene->r.cfra); - - if (strcmp(name, samplename) == 0) { - break; - } - sample = sample->id.next; - } - - return (sample); -} - - - -int sound_sample_is_null(bSound *sound) -{ - int result = FALSE; - bSample *sample; - - if(ghSoundScene==NULL) sound_init_audio(); - - /* find the right sample or else create one */ - if (sound->sample == NULL) { - /* find... */ - sample = sound_find_sample(sound); - - /* or a new one? */ - if (sample == NULL) - sample = sound_new_sample(sound); - - if (sound_set_sample(sound, sample)) - result = TRUE; - } - - return result; -} - - - -void sound_stop_all_sounds(void) -{ -#if GAMEBLENDER == 1 - if(ghSoundScene) { - SND_StopAllSounds(ghSoundScene); - SND_Proceed(ghAudioDeviceInterface, ghSoundScene); - } -#endif -} - - - -void sound_end_all_sounds(void) -{ -#if GAMEBLENDER == 1 - if(ghSoundScene) { - sound_stop_all_sounds(); - SND_RemoveAllSounds(ghSoundScene); - } -#endif -} - - - -void sound_play_sound(bSound *sound) -{ -#if GAMEBLENDER == 1 - if(ghSoundScene==NULL) sound_init_audio(); - - /* first check if we want sound or not */ - SND_IsPlaybackWanted(ghSoundScene); - - /* stop all previous sounds */ - SND_StopAllSounds(ghSoundScene); - - if (sound != NULL && sound->sample != NULL) - { - /* load the sample if needed */ - if (sound_load_sample(sound)) - { - /* set all kinds of parameters */ - SND_SetListenerGain(ghSoundScene, G.listener->gain); - SND_SetDopplerFactor(ghSoundScene, G.listener->dopplerfactor); - SND_SetDopplerVelocity(ghSoundScene, G.listener->dopplervelocity); - - SND_SetGain((SND_ObjectHandle)sound->snd_sound, (sound->volume)); - SND_SetPitch((SND_ObjectHandle)sound->snd_sound, (exp((sound->pitch / 12.0) * log(2.0)))); - - if (sound->flags & SOUND_FLAGS_LOOP) - { - SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_NORMAL); -#ifdef SOUND_UNDER_DEVELOPMENT -/* SND_SetLoopPoints((SND_ObjectHandle)sound->snd_sound, sound->loopstart, sound->loopend); -*/ -#endif - if (sound->flags & SOUND_FLAGS_BIDIRECTIONAL_LOOP) - SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_BIDIRECTIONAL); - else - SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_NORMAL); - - } - else - { - SND_SetLoopMode((SND_ObjectHandle)sound->snd_sound, SND_LOOP_OFF); - } - - if (sound->flags & SOUND_FLAGS_3D) - { - SND_SetRollOffFactor((SND_ObjectHandle)sound->snd_sound, sound->attenuation); - SND_SetReferenceDistance((SND_ObjectHandle)sound->snd_sound, sound->distance); - SND_SetMinimumGain((SND_ObjectHandle)sound->snd_sound, sound->min_gain); - SND_SetMaximumGain((SND_ObjectHandle)sound->snd_sound, sound->max_gain); - } - else - { - SND_SetRollOffFactor((SND_ObjectHandle)sound->snd_sound, 0); - SND_SetReferenceDistance((SND_ObjectHandle)sound->snd_sound, 1); - SND_SetMinimumGain((SND_ObjectHandle)sound->snd_sound, 1); - SND_SetMaximumGain((SND_ObjectHandle)sound->snd_sound, 1); - } - - if (G.f & G_DEBUG) printf("Set pitch to: %f\n", SND_GetPitch((SND_ObjectHandle)sound->snd_sound)); - if (G.f & G_DEBUG) printf("Set gain to: %f\n", SND_GetGain((SND_ObjectHandle)sound->snd_sound)); - if (G.f & G_DEBUG) printf("Set looping to: %d\n", SND_GetLoopMode((SND_ObjectHandle)sound->snd_sound)); - - /* play the sound */ - SND_StartSound(ghSoundScene, (SND_ObjectHandle)sound->snd_sound); - - /* update the device */ - SND_Proceed(ghAudioDeviceInterface, ghSoundScene); - } - } - else - { - if (G.f & G_DEBUG) - { - printf("uninitialized sound !\n"); - if (sound) - { - printf("sound: %p\n", sound); - if (sound->sample) - { - printf("sample: %p\n", sound->sample); - if (sound->snd_sound) - printf("hSoundObject: %p\n", sound->snd_sound); - } - } - else - { - printf("sound == NULL\n"); - } - } - } -#endif -} - - - -bSound *sound_find_sound(char *id_name) -{ - bSound *sound; - - // look for sound with same *id* name - sound = G.main->sound.first; - while (sound) - { - if (strcmp(sound->id.name + 2, id_name) == 0) - break; - - sound = sound->id.next; - } - - return sound; -} - -void sound_init_audio(void) -{ - int noaudio; - SYS_SystemHandle hSystem = NULL; - - if(ghSoundScene==NULL) { - hSystem = SYS_GetSystem(); - noaudio = SYS_GetCommandLineInt(hSystem,"noaudio",0); - - if (noaudio)/*(noaudio) intrr: disable game engine audio (openal) */ - SND_SetDeviceType(snd_e_dummydevice); - - ghAudioDeviceInterface = SND_GetAudioDevice(); - ghSoundScene = SND_CreateScene(ghAudioDeviceInterface); - // also called after read new file, but doesnt work when no audio initialized - sound_initialize_sounds(); - } -} - - -int sound_get_mixrate(void) -{ - return MIXRATE; -} - - -void sound_exit_audio(void) -{ - if(ghSoundScene) { - SND_DeleteScene(ghSoundScene); - SND_ReleaseDevice(); - ghSoundScene = NULL; - } -} diff --git a/source/blender/src/edittime.c b/source/blender/src/edittime.c deleted file mode 100644 index f5c6fe5a95e..00000000000 --- a/source/blender/src/edittime.c +++ /dev/null @@ -1,1008 +0,0 @@ -/** - * $Id: BIF_edittime.c - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_ipo_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_ipo.h" -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_library.h" - -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_interface.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_editaction.h" - -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "BDR_editobject.h" - -#include "blendef.h" - -#include "mydevice.h" - -#include "PIL_time.h" - -/* declarations */ -void winqreadtimespace(ScrArea *, void *, BWinEvent *); - -/* ************* Marker API **************** */ - -/* add TimeMarker at curent frame */ -void add_marker(int frame) -{ - TimeMarker *marker; - - /* two markers can't be at the same place */ - for(marker= G.scene->markers.first; marker; marker= marker->next) - if(marker->frame == frame) return; - /* deselect all */ - for(marker= G.scene->markers.first; marker; marker= marker->next) - marker->flag &= ~SELECT; - - marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker"); - marker->flag= SELECT; - marker->frame= frame; - BLI_addtail(&(G.scene->markers), marker); - - BIF_undo_push("Add Marker"); -} - - - -/* remove selected TimeMarkers */ -void remove_marker(void) -{ - TimeMarker *marker, *nmarker; - short changed= 0; - - for(marker= G.scene->markers.first; marker; marker= nmarker) { - nmarker= marker->next; - if(marker->flag & SELECT) { - BLI_freelinkN(&(G.scene->markers), marker); - changed= 1; - } - } - - if (changed) - BIF_undo_push("Remove Marker"); -} - -/* rename first selected TimeMarker */ -void rename_marker(void) -{ - TimeMarker *marker; - char name[64]; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - strcpy(name, marker->name); - if (sbutton(name, 0, sizeof(name)-1, "Name: ")) - BLI_strncpy(marker->name, name, sizeof(marker->name)); - break; - } - } - -// BIF_undo_push("Rename Marker"); -} - -/* duplicate selected TimeMarkers */ -void duplicate_marker(void) -{ - TimeMarker *marker, *newmarker; - - /* go through the list of markers, duplicate selected markers and add duplicated copies - * to the begining of the list (unselect original markers) */ - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT){ - /* unselect selected marker */ - marker->flag &= ~SELECT; - /* create and set up new marker */ - newmarker = MEM_callocN(sizeof(TimeMarker), "TimeMarker"); - newmarker->flag= SELECT; - newmarker->frame= marker->frame; - BLI_strncpy(newmarker->name, marker->name, sizeof(marker->name)); - /* new marker is added to the begining of list */ - BLI_addhead(&(G.scene->markers), newmarker); - } - } - - transform_markers('g', 0); -} - -void transform_markers(int mode, int smode) // mode and smode unused here, for callback -{ - SpaceLink *slink= curarea->spacedata.first; - SpaceTime *stime= curarea->spacedata.first; - SpaceAction *saction = curarea->spacedata.first; - TimeMarker *marker, *selmarker=NULL; - float dx, fac; - int a, ret_val= 0, totmark=0, *oldframe, offs, firsttime=1; - unsigned short event; - short val, pmval[2], mval[2], mvalo[2]; - char str[32]; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) totmark++; - } - if(totmark==0) return; - - oldframe= MEM_mallocN(totmark*sizeof(int), "marker array"); - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - oldframe[a]= marker->frame; - selmarker= marker; // used for hederprint - a++; - } - } - - dx= G.v2d->mask.xmax-G.v2d->mask.xmin; - dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/dx; - - getmouseco_areawin(pmval); - mvalo[0]= pmval[0]; - - while(ret_val == 0) { - - getmouseco_areawin(mval); - - if (mval[0] != mvalo[0] || firsttime) { - mvalo[0]= mval[0]; - firsttime= 0; - - fac= (((float)(mval[0] - pmval[0]))*dx); - - if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) - apply_keyb_grid(&fac, 0.0, FPS, 0.1*FPS, 0); - else - apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); - offs= (int)fac; - - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - marker->frame= oldframe[a] + offs; - a++; - } - } - - if(totmark==1) { // we print current marker value - if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) { - if (stime->flag & TIME_DRAWFRAMES) - sprintf(str, "Marker %d offset %d", selmarker->frame, offs); - else - sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); - } - else if (slink->spacetype == SPACE_ACTION) { - if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); - else - sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); - } - else { - sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); - } - } - else { - if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) { - if (stime->flag & TIME_DRAWFRAMES) - sprintf(str, "Marker offset %d ", offs); - else - sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); - } - else if (slink->spacetype == SPACE_ACTION) { - if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); - else - sprintf(str, "Marker offset %.2f ", (double)(offs)); - } - else { - sprintf(str, "Marker offset %.2f ", (double)(offs)); - } - } - headerprint(str); - - force_draw(0); // areas identical to this, 0 = no header - } - else PIL_sleep_ms(10); // idle - - /* emptying queue and reading events */ - while( qtest() ) { - event= extern_qread(&val); - - if(val) { - if(event==ESCKEY || event==RIGHTMOUSE) ret_val= 2; - else if(event==LEFTMOUSE || event==RETKEY || event==SPACEKEY) ret_val= 1; - } - } - } - - /* restore? */ - if(ret_val==2) { - for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) { - if(marker->flag & SELECT) { - marker->frame= oldframe[a]; - a++; - } - } - } - else { - BIF_undo_push("Move Markers"); - } - MEM_freeN(oldframe); - allqueue(REDRAWMARKER, 0); -} - -/* select/deselect all TimeMarkers - * test - based on current selections? - * sel - selection status to set all markers to if blanket apply status - */ -void deselect_markers(short test, short sel) -{ - TimeMarker *marker; - - /* check if need to find out whether to how to select markers */ - if (test) { - /* dependant on existing selection */ - /* determine if select all or deselect all */ - sel = 1; - for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (marker->flag & SELECT) { - sel = 0; - break; - } - } - - /* do selection */ - for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (sel == 2) { - marker->flag ^= SELECT; - } - else if (sel == 1) { - if ((marker->flag & SELECT)==0) - marker->flag |= SELECT; - } - else { - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - } - } - } - else { - /* not dependant on existing selection */ - for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (sel==2) { - marker->flag ^= SELECT; - } - else if (sel==1) { - if ((marker->flag & SELECT)==0) - marker->flag |= SELECT; - } - else { - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - } - } - } -} - -static void borderselect_markers_func(float xmin, float xmax, int selectmode) -{ - TimeMarker *marker; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if ((marker->frame > xmin) && (marker->frame <= xmax)) { - switch (selectmode) { - case SELECT_ADD: - if ((marker->flag & SELECT) == 0) - marker->flag |= SELECT; - break; - case SELECT_SUBTRACT: - if (marker->flag & SELECT) - marker->flag &= ~SELECT; - break; - } - } - } -} - -/* border-select markers */ -void borderselect_markers(void) -{ - rcti rect; - rctf rectf; - int val, selectmode; - short mval[2]; - - if ( (val = get_border(&rect, 3)) ){ - if (val == LEFTMOUSE) - selectmode = SELECT_ADD; - else - selectmode = SELECT_SUBTRACT; - - mval[0]= rect.xmin; - mval[1]= rect.ymin+2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax-2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - /* do markers */ - borderselect_markers_func(rectf.xmin, rectf.xmax, selectmode); - - BIF_undo_push("Border Select Markers"); - allqueue(REDRAWMARKER, 0); - } -} - -void nextprev_marker(short dir) -{ - TimeMarker *marker, *cur=NULL, *first, *last; - int mindist= MAXFRAME, dist; - - first= last= G.scene->markers.first; - for(marker= G.scene->markers.first; marker; marker= marker->next) { - /* find closest to current frame first */ - dist= (marker->frame/G.scene->r.framelen) - CFRA; - if(dir==1 && dist>0 && distframe > last->frame) last= marker; - if(marker->frame < first->frame) first= marker; - } - - if(cur==NULL) { - if(dir==1) cur= first; - else cur= last; - } - if(cur) { - CFRA= cur->frame/G.scene->r.framelen; - update_for_newframe(); - allqueue(REDRAWALL, 0); - } -} - -void get_minmax_markers(short sel, float *first, float *last) -{ - TimeMarker *marker; - ListBase *markers; - float min, max; - int selcount = 0; - - markers= &(G.scene->markers); - - if (sel) - for (marker= markers->first; marker; marker= marker->next) { - if (marker->flag & SELECT) - selcount++; - } - else { - selcount= BLI_countlist(markers); - } - - if (markers->first && markers->last) { - min= ((TimeMarker *)markers->first)->frame; - max= ((TimeMarker *)markers->last)->frame; - } - else { - *first = 0.0f; - *last = 0.0f; - return; - } - - if (selcount > 1) { - for (marker= markers->first; marker; marker= marker->next) { - if (sel) { - if (marker->flag & SELECT) { - if (marker->frame < min) - min= marker->frame; - else if (marker->frame > max) - max= marker->frame; - } - } - else { - if (marker->frame < min) - min= marker->frame; - else if (marker->frame > max) - max= marker->frame; - } - } - } - - *first= min; - *last= max; -} - -TimeMarker *find_nearest_marker(int clip_y) -{ - TimeMarker *marker; - float xmin, xmax; - rctf rectf; - short mval[2]; - - getmouseco_areawin (mval); - - /* first clip selection in Y */ - if((clip_y) && (mval[1] > 30)) - return NULL; - - mval[0]-=7; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]+=14; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - xmin= rectf.xmin; - xmax= rectf.xmax; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - if ((marker->frame > xmin) && (marker->frame <= xmax)) { - return marker; - } - } - - return NULL; -} - -/* Adds a marker to list of cfra elems */ -void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel) -{ - CfraElem *ce, *cen; - - /* should this one only be considered if it is selected? */ - if ((only_sel) && ((marker->flag & SELECT)==0)) - return; - - /* try to find a previous cfra elem */ - ce= lb->first; - while(ce) { - - if( ce->cfra==marker->frame ) { - /* do because of double keys */ - if(marker->flag & SELECT) ce->sel= marker->flag; - return; - } - else if(ce->cfra > marker->frame) break; - - ce= ce->next; - } - - cen= MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem"); - if(ce) BLI_insertlinkbefore(lb, ce, cen); - else BLI_addtail(lb, cen); - - cen->cfra= marker->frame; - cen->sel= marker->flag; -} - -/* This function makes a list of all the markers. The only_sel - * argument is used to specify whether only the selected markers - * are added. - */ -void make_marker_cfra_list(ListBase *lb, short only_sel) -{ - TimeMarker *marker; - - for (marker= G.scene->markers.first; marker; marker= marker->next) { - add_marker_to_cfra_elem(lb, marker, only_sel); - } -} - -int find_nearest_marker_time(float dx) -{ - TimeMarker *marker, *nearest= NULL; - float dist, min_dist= 1000000; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - dist = ABS((float)marker->frame - dx); - if(dist < min_dist){ - min_dist= dist; - nearest= marker; - } - } - - if(nearest) return nearest->frame; - else return (int)floor(dx); -} - -/* *********** End Markers - Markers API *************** */ -/* select/deselect TimeMarker at current frame */ -static void select_timeline_marker_frame(int frame, unsigned char shift) -{ - TimeMarker *marker; - int select=0; - - for(marker= G.scene->markers.first; marker; marker= marker->next) { - /* if Shift is not set, then deselect Markers */ - if(!shift) marker->flag &= ~SELECT; - /* this way a not-shift select will allways give 1 selected marker */ - if((marker->frame == frame) && (!select)) { - if(marker->flag & SELECT) - marker->flag &= ~SELECT; - else - marker->flag |= SELECT; - select = 1; - } - } -} - -/* *********** end Markers - TimeLine *************** */ - -/* set the animation preview range of scene */ -void anim_previewrange_set() -{ - extern float get_action_frame(Object *ob, float cframe); - rcti rect; - rctf rectf; - short val, mval[2]; - - /* set range by drawing border-select rectangle */ - if ( (val = get_border(&rect, 5)) ) { - /* get frame numbers */ - mval[0]= rect.xmin; - mval[1]= rect.ymin+2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax-2; - areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax); - - /* set preview-range */ - if (rectf.xmin < 1) rectf.xmin = 1.0f; - if (rectf.xmax < 1) rectf.xmax = 1.0f; - G.scene->r.psfra= rectf.xmin; - G.scene->r.pefra= rectf.xmax; - - BIF_undo_push("Set anim-preview range"); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWBUTSALL, 0); - } -} - -/* clear the animation preview range for scene */ -void anim_previewrange_clear() -{ - G.scene->r.psfra = 0; - G.scene->r.pefra = 0; - - BIF_undo_push("Clear anim-preview range"); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWBUTSALL, 0); -} - -/* ************ end Animation Preview Range ********** */ - - -static int float_to_frame(float frame) -{ - int to= (int) floor(0.5 + frame/G.scene->r.framelen ); - - return to; -} - -static float find_closest_cfra_elem(ListBase elems, int dir, float closest) -{ - CfraElem *ce; - - for(ce= elems.first; ce; ce= ce->next) { - if (dir==-1) { - if( float_to_frame(ce->cfra)cfra > closest) || (closest == CFRA)) { - closest= ce->cfra; - } - } - } - else { - if(float_to_frame(ce->cfra)>CFRA) { - if ((ce->cfra < closest) || (closest == CFRA)) { - closest= ce->cfra; - } - } - } - } - return closest; -} - -void nextprev_timeline_key(short dir) -{ - /*mostly copied from drawobject.c, draw_object() AND editipo.c, movekey_obipo() */ - Object *ob; - bActionChannel *achan; - bAction *act; - ListBase elems; - float closest= CFRA; - int a; - - if (OBACT) { - ob = OBACT; - - if(ob) { - if(ob!=G.obedit) { - if(ob->ipo) { - /* convert the ipo to a list of 'current frame elements' */ - - elems.first= elems.last= NULL; - make_cfra_list(ob->ipo, &elems); - - closest= find_closest_cfra_elem(elems, dir, closest); - - BLI_freelistN(&elems); - } - - if(ob->action) { - act = ob->action; - /* go through each channel in the action */ - for (achan=act->chanbase.first; achan; achan=achan->next){ - /* convert the ipo to a list of 'current frame elements' */ - - if(achan->ipo) { - elems.first= elems.last= NULL; - make_cfra_list(achan->ipo, &elems); - - closest= find_closest_cfra_elem(elems, dir, closest); - - BLI_freelistN(&elems); - } - } - } - - for(a=0; atotcol; a++) { - Material *ma= give_current_material(ob, a+1); - if(ma && ma->ipo) { - elems.first= elems.last= NULL; - make_cfra_list(ma->ipo, &elems); - - closest= find_closest_cfra_elem(elems, dir, closest); - - BLI_freelistN(&elems); - } - } - } - } - - a= float_to_frame(closest); - - if (a!=CFRA) { - CFRA= a; - update_for_newframe(); - } - - BIF_undo_push("Next/Prev Key"); - allqueue(REDRAWALL, 0); - } -} - -/* return the current marker for this frame, -we can have more then 1 marker per frame, this just returns the first :/ */ -TimeMarker *get_frame_marker(int frame) -{ - TimeMarker *marker, *best_marker = NULL; - int best_frame = -MAXFRAME*2; - for (marker= G.scene->markers.first; marker; marker= marker->next) { - if (marker->frame==frame) { - return marker; - } - - if ( marker->frame > best_frame && marker->frame < frame) { - best_marker = marker; - best_frame = marker->frame; - } - } - - return best_marker; -} - - -void timeline_frame_to_center(void) -{ - float dtime; - - dtime= CFRA*(G.scene->r.framelen) - (G.v2d->cur.xmin + G.v2d->cur.xmax)/2.0; - G.v2d->cur.xmin += dtime; - G.v2d->cur.xmax += dtime; - scrarea_queue_winredraw(curarea); -} - -/* copy of this is actually in editscreen.c, but event based */ -static void timeline_force_draw(short val) -{ - ScrArea *sa, *tempsa, *samin= NULL; - int dodraw; - - if(val & TIME_LEFTMOST_3D_WIN) { - ScrArea *sa= G.curscreen->areabase.first; - int min= 10000; - for(; sa; sa= sa->next) { - if(sa->spacetype==SPACE_VIEW3D) { - if(sa->winrct.xmin - sa->winrct.ymin < min) { - samin= sa; - min= sa->winrct.xmin - sa->winrct.ymin; - } - } - } - } - - tempsa= curarea; - sa= G.curscreen->areabase.first; - while(sa) { - dodraw= 0; - if(sa->spacetype==SPACE_VIEW3D) { - if(sa==samin || (val & TIME_ALL_3D_WIN)) dodraw= 1; - } - else if(ELEM6(sa->spacetype, SPACE_NLA, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION, SPACE_SOUND)) { - if(val & TIME_ALL_ANIM_WIN) dodraw= 1; - } - else if(sa->spacetype==SPACE_BUTS) { - if(val & TIME_ALL_BUTS_WIN) dodraw= 1; - } - else if(sa->spacetype==SPACE_IMAGE) { - if (val & TIME_ALL_IMAGE_WIN) dodraw = 1; - } - else if(sa->spacetype==SPACE_SEQ) { - if (val & TIME_SEQ) dodraw = 1; - } - else if(sa->spacetype==SPACE_TIME) dodraw= 2; - - if(dodraw) { - areawinset(sa->win); - scrarea_do_windraw(sa); - if(dodraw==2) scrarea_do_headdraw(sa); - } - sa= sa->next; - } - areawinset(tempsa->win); - - screen_swapbuffers(); - -} - -/* ***************************** */ - -/* Right. Now for some implementation: */ -void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - SpaceTime *stime= spacedata; - unsigned short event= evt->event; - short val= evt->val; - float dx, dy; - int doredraw= 0, cfra, first = 0; - short mval[2], nr; - short mousebut = L_MOUSE; - - if(sa->win==0) return; - - if(val) { - - if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - switch(event) { - case LEFTMOUSE: - stime->flag |= TIME_CFRA_NUM; - do { - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra = (int)dx; - if(cfra< MINFRAME) cfra= MINFRAME; - - if( cfra!=CFRA || first ) - { - first= 0; - CFRA= cfra; - update_for_newframe_nodraw(0); // 1= nosound - timeline_force_draw(stime->redraws); - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - - stime->flag &= ~TIME_CFRA_NUM; - allqueue(REDRAWALL, 0); - break; - - case RIGHTMOUSE: /* select/deselect marker */ - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &dx, &dy); - - cfra= find_nearest_marker_time(dx); - - if (G.qual && LR_SHIFTKEY) - select_timeline_marker_frame(cfra, 1); - else - select_timeline_marker_frame(cfra, 0); - - force_draw(0); - std_rmouse_transform(transform_markers); - - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - case PADPLUSKEY: - dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin+= dx; - G.v2d->cur.xmax-= dx; - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case PADMINUS: - dx= (float)(0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin)); - G.v2d->cur.xmin-= dx; - G.v2d->cur.xmax+= dx; - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - doredraw= 1; - break; - case HOMEKEY: - first= G.scene->r.sfra; - if(first >= G.scene->r.efra) first= G.scene->r.efra; - G.v2d->cur.xmin=G.v2d->tot.xmin= (float)first-2; - G.v2d->cur.xmax=G.v2d->tot.xmax= (float)G.scene->r.efra+2; - doredraw= 1; - break; - - case PAGEUPKEY: /* next keyframe */ - if(G.qual==LR_CTRLKEY) - nextprev_timeline_key(1); - else - nextprev_marker(1); - break; - case PAGEDOWNKEY: /* prev keyframe */ - if(G.qual==LR_CTRLKEY) - nextprev_timeline_key(-1); - else - nextprev_marker(-1); - break; - - case AKEY: - /* deselect all TimeMarkers */ - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - break; - case BKEY: - /* borderselect markers */ - borderselect_markers(); - break; - case DKEY: - if(G.qual==LR_SHIFTKEY) - duplicate_marker(); - break; - case CKEY: - timeline_frame_to_center(); - break; - case GKEY: /* move marker */ - transform_markers('g', 0); - break; - case EKEY: /* set end frame */ - if (G.scene->r.psfra) { - if (CFRA < G.scene->r.psfra) - G.scene->r.psfra= CFRA; - G.scene->r.pefra= CFRA; - } - else - G.scene->r.efra = CFRA; - allqueue(REDRAWALL, 1); - break; - case MKEY: /* add, rename marker */ - if (G.qual & LR_CTRLKEY) - rename_marker(); - else - add_marker(CFRA); - allqueue(REDRAWMARKER, 0); - break; - case PKEY: /* preview-range stuff */ - if (G.qual & LR_CTRLKEY) /* set preview range */ - anim_previewrange_set(); - else if (G.qual & LR_ALTKEY) /* clear preview range */ - anim_previewrange_clear(); - break; - case SKEY: /* set start frame */ - if (G.scene->r.psfra) { - if (G.scene->r.pefra < CFRA) - G.scene->r.pefra= CFRA; - G.scene->r.psfra= CFRA; - } - else - G.scene->r.sfra = CFRA; - allqueue(REDRAWALL, 1); - break; - case TKEY: /* popup menu */ - nr= pupmenu("Time value%t|Frames %x1|Seconds%x2"); - if (nr>0) { - if(nr==1) stime->flag |= TIME_DRAWFRAMES; - else stime->flag &= ~TIME_DRAWFRAMES; - doredraw= 1; - } - break; - case DELKEY: - case XKEY: - if( okee("Erase selected")==0 ) break; - - remove_marker(); - allqueue(REDRAWMARKER, 0); - break; - } - } - - if(doredraw) - scrarea_queue_winredraw(sa); -} - - diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c deleted file mode 100644 index b3252487fa6..00000000000 --- a/source/blender/src/editview.c +++ /dev/null @@ -1,2777 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * cursor/gestures/selecteren - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "MEM_guardedalloc.h" - -#include "IMB_imbuf.h" -#include "PIL_time.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_camera_types.h" -#include "DNA_group_types.h" -#include "DNA_lattice_types.h" -#include "DNA_meta_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" -#include "DNA_ipo_types.h" /* for fly mode recording */ - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BKE_armature.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_lattice.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_object.h" /* fly mode where_is_object to get camera location */ -#include "BKE_particle.h" -#include "BKE_utildefines.h" -#include "BKE_customdata.h" - -#include "BIF_drawimage.h" -#include "BIF_butspace.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editparticle.h" -#include "BIF_editgroup.h" -#include "BIF_editmesh.h" -#include "BIF_editoops.h" -#include "BIF_editsima.h" -#include "BIF_editview.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_previewrender.h" /* use only so fly mode can preview when its done */ -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BDR_editobject.h" /* For headerprint */ -#include "BDR_sculptmode.h" -#include "BDR_vpaint.h" -#include "BDR_editface.h" -#include "BDR_drawobject.h" -#include "BDR_editcurve.h" - -#include "BSE_edit.h" -#include "BSE_view.h" /* give_cursor() */ -#include "BSE_editipo.h" -#include "BSE_drawview.h" - -#include "editmesh.h" /* borderselect uses it... */ -#include "blendef.h" -#include "mydevice.h" - -#include "BIF_transform.h" -#include "BIF_toets.h" /* persptoetsen */ - -extern ListBase editNurb; /* originally from exports.h, memory from editcurve.c*/ -/* editmball.c */ -extern ListBase editelems; - -/* fly mode uses this */ -extern void setcameratoview3d(void); - -/* local prototypes */ - -void EM_backbuf_checkAndSelectVerts(EditMesh *em, int select) -{ - EditVert *eve; - int index= em_wireoffs; - - for(eve= em->verts.first; eve; eve= eve->next, index++) { - if(eve->h==0) { - if(EM_check_backbuf(index)) { - eve->f = select?(eve->f|1):(eve->f&~1); - } - } - } -} - -void EM_backbuf_checkAndSelectEdges(EditMesh *em, int select) -{ - EditEdge *eed; - int index= em_solidoffs; - - for(eed= em->edges.first; eed; eed= eed->next, index++) { - if(eed->h==0) { - if(EM_check_backbuf(index)) { - EM_select_edge(eed, select); - } - } - } -} - -void EM_backbuf_checkAndSelectFaces(EditMesh *em, int select) -{ - EditFace *efa; - int index= 1; - - for(efa= em->faces.first; efa; efa= efa->next, index++) { - if(efa->h==0) { - if(EM_check_backbuf(index)) { - EM_select_face_fgon(efa, select); - } - } - } -} - -void EM_backbuf_checkAndSelectTFaces(Mesh *me, int select) -{ - MFace *mface = me->mface; - int a; - - if (mface) { - for(a=1; a<=me->totface; a++, mface++) { - if(EM_check_backbuf(a)) { - mface->flag = select?(mface->flag|ME_FACE_SEL):(mface->flag&~ME_FACE_SEL); - } - } - } -} - -void arrows_move_cursor(unsigned short event) -{ - short mval[2]; - - getmouseco_sc(mval); - - if(event==UPARROWKEY) { - warp_pointer(mval[0], mval[1]+1); - } else if(event==DOWNARROWKEY) { - warp_pointer(mval[0], mval[1]-1); - } else if(event==LEFTARROWKEY) { - warp_pointer(mval[0]-1, mval[1]); - } else if(event==RIGHTARROWKEY) { - warp_pointer(mval[0]+1, mval[1]); - } -} - -/* simple API for object selection, rather than just using the flag - * this takes into account the 'restrict selection in 3d view' flag. - * deselect works always, the restriction just prevents selection */ -void select_base_v3d(Base *base, short mode) -{ - if (base) { - if (mode==BA_SELECT) { - if (!(base->object->restrictflag & OB_RESTRICT_SELECT)) - if (mode==BA_SELECT) base->flag |= SELECT; - } - else if (mode==BA_DESELECT) { - base->flag &= ~SELECT; - } - } -} - -/* *********************** GESTURE AND LASSO ******************* */ - -/* helper also for borderselect */ -static int edge_fully_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) -{ - return BLI_in_rcti(rect, x1, y1) && BLI_in_rcti(rect, x2, y2); -} - -static int edge_inside_rect(rcti *rect, short x1, short y1, short x2, short y2) -{ - int d1, d2, d3, d4; - - /* check points in rect */ - if(edge_fully_inside_rect(rect, x1, y1, x2, y2)) return 1; - - /* check points completely out rect */ - if(x1xmin && x2xmin) return 0; - if(x1>rect->xmax && x2>rect->xmax) return 0; - if(y1ymin && y2ymin) return 0; - if(y1>rect->ymax && y2>rect->ymax) return 0; - - /* simple check lines intersecting. */ - d1= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymin ); - d2= (y1-y2)*(x1- rect->xmin ) + (x2-x1)*(y1- rect->ymax ); - d3= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymax ); - d4= (y1-y2)*(x1- rect->xmax ) + (x2-x1)*(y1- rect->ymin ); - - if(d1<0 && d2<0 && d3<0 && d4<0) return 0; - if(d1>0 && d2>0 && d3>0 && d4>0) return 0; - - return 1; -} - - -#define MOVES_GESTURE 50 -#define MOVES_LASSO 500 - -int lasso_inside(short mcords[][2], short moves, short sx, short sy) -{ - /* we do the angle rule, define that all added angles should be about zero or 2*PI */ - float angletot=0.0, len, dot, ang, cross, fp1[2], fp2[2]; - int a; - short *p1, *p2; - - if(sx==IS_CLIPPED) - return 0; - - p1= mcords[moves-1]; - p2= mcords[0]; - - /* first vector */ - fp1[0]= (float)(p1[0]-sx); - fp1[1]= (float)(p1[1]-sy); - len= sqrt(fp1[0]*fp1[0] + fp1[1]*fp1[1]); - fp1[0]/= len; - fp1[1]/= len; - - for(a=0; a 4.0 ) return 1; - return 0; -} - -/* edge version for lasso select. we assume boundbox check was done */ -static int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1) -{ - short v1[2], v2[2]; - int a; - - if(x0==IS_CLIPPED || x1==IS_CLIPPED) - return 0; - - v1[0] = x0, v1[1] = y0; - v2[0] = x1, v2[1] = y1; - - /* check points in lasso */ - if(lasso_inside(mcords, moves, v1[0], v1[1])) return 1; - if(lasso_inside(mcords, moves, v2[0], v2[1])) return 1; - - /* no points in lasso, so we have to intersect with lasso edge */ - - if( IsectLL2Ds(mcords[0], mcords[moves-1], v1, v2) > 0) return 1; - for(a=0; a 0) return 1; - } - - return 0; -} - - -/* warning; lasso select with backbuffer-check draws in backbuf with persp(PERSP_WIN) - and returns with persp(PERSP_VIEW). After lasso select backbuf is not OK -*/ -static void do_lasso_select_pose(Object *ob, short mcords[][2], short moves, short select) -{ - bPoseChannel *pchan; - float vec[3]; - short sco1[2], sco2[2]; - - if(ob->type!=OB_ARMATURE || ob->pose==NULL) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - VECCOPY(vec, pchan->pose_head); - Mat4MulVecfl(ob->obmat, vec); - project_short(vec, sco1); - VECCOPY(vec, pchan->pose_tail); - Mat4MulVecfl(ob->obmat, vec); - project_short(vec, sco2); - - if(lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) { - if(select) pchan->bone->flag |= BONE_SELECTED; - else pchan->bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED); - } - } -} - - -static void do_lasso_select_objects(short mcords[][2], short moves, short select) -{ - Base *base; - - for(base= G.scene->base.first; base; base= base->next) { - if(base->lay & G.vd->lay) { - project_short(base->object->obmat[3], &base->sx); - if(lasso_inside(mcords, moves, base->sx, base->sy)) { - - if(select) select_base_v3d(base, BA_SELECT); - else select_base_v3d(base, BA_DESELECT); - base->object->flag= base->flag; - } - if(base->object->flag & OB_POSEMODE) { - do_lasso_select_pose(base->object, mcords, moves, select); - } - } - } -} - -static void lasso_select_boundbox(rcti *rect, short mcords[][2], short moves) -{ - short a; - - rect->xmin= rect->xmax= mcords[0][0]; - rect->ymin= rect->ymax= mcords[0][1]; - - for(a=1; axmin) rect->xmin= mcords[a][0]; - else if(mcords[a][0]>rect->xmax) rect->xmax= mcords[a][0]; - if(mcords[a][1]ymin) rect->ymin= mcords[a][1]; - else if(mcords[a][1]>rect->ymax) rect->ymax= mcords[a][1]; - } -} - -static void do_lasso_select_mesh__doSelectVert(void *userData, EditVert *eve, int x, int y, int index) -{ - struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) { - eve->f = data->select?(eve->f|1):(eve->f&~1); - } -} -static void do_lasso_select_mesh__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) -{ - struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; - - if (EM_check_backbuf(em_solidoffs+index)) { - if (data->pass==0) { - if ( edge_fully_inside_rect(data->rect, x0, y0, x1, y1) && - lasso_inside(data->mcords, data->moves, x0, y0) && - lasso_inside(data->mcords, data->moves, x1, y1)) { - EM_select_edge(eed, data->select); - data->done = 1; - } - } else { - if (lasso_inside_edge(data->mcords, data->moves, x0, y0, x1, y1)) { - EM_select_edge(eed, data->select); - } - } - } -} -static void do_lasso_select_mesh__doSelectFace(void *userData, EditFace *efa, int x, int y, int index) -{ - struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y) && lasso_inside(data->mcords, data->moves, x, y)) { - EM_select_face_fgon(efa, data->select); - } -} - -static void do_lasso_select_mesh(short mcords[][2], short moves, short select) -{ - struct { rcti *rect; short (*mcords)[2], moves, select, pass, done; } data; - EditMesh *em = G.editMesh; - rcti rect; - int bbsel; - - lasso_select_boundbox(&rect, mcords, moves); - - data.rect = ▭ - data.mcords = mcords; - data.moves = moves; - data.select = select; - data.done = 0; - data.pass = 0; - - bbsel= EM_mask_init_backbuf_border(mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax); - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if (bbsel) { - EM_backbuf_checkAndSelectVerts(em, select); - } else { - mesh_foreachScreenVert(do_lasso_select_mesh__doSelectVert, &data, 1); - } - } - if(G.scene->selectmode & SCE_SELECT_EDGE) { - /* Does both bbsel and non-bbsel versions (need screen cos for both) */ - - data.pass = 0; - mesh_foreachScreenEdge(do_lasso_select_mesh__doSelectEdge, &data, 0); - - if (data.done==0) { - data.pass = 1; - mesh_foreachScreenEdge(do_lasso_select_mesh__doSelectEdge, &data, 0); - } - } - - if(G.scene->selectmode & SCE_SELECT_FACE) { - if (bbsel) { - EM_backbuf_checkAndSelectFaces(em, select); - } else { - mesh_foreachScreenFace(do_lasso_select_mesh__doSelectFace, &data); - } - } - - EM_free_backbuf(); - EM_selectmode_flush(); -} - -/* this is an exception in that its the only lasso that dosnt use the 3d view (uses space image view) */ -static void do_lasso_select_mesh_uv(short mcords[][2], short moves, short select) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - MTFace *tf; - int screenUV[2], nverts, i, ok = 1; - rcti rect; - - lasso_select_boundbox(&rect, mcords, moves); - - if (draw_uvs_face_check()) { /* Face Center Sel */ - float cent[2]; - ok = 0; - for (efa= em->faces.first; efa; efa= efa->next) { - /* assume not touched */ - efa->tmp.l = 0; - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if ((select) != (simaFaceSel_Check(efa, tf))) { - tface_center(tf, cent, (void *)efa->v4); - uvco_to_areaco_noclip(cent, screenUV); - if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { - efa->tmp.l = ok = 1; - } - } - } - /* (de)selects all tagged faces and deals with sticky modes */ - if (ok) - uvface_setsel__internal(select); - - } else { /* Vert Sel*/ - for (efa= em->faces.first; efa; efa= efa->next) { - tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - nverts= efa->v4? 4: 3; - for(i=0; iuv[i], screenUV); - if (BLI_in_rcti(&rect, screenUV[0], screenUV[1]) && lasso_inside(mcords, moves, screenUV[0], screenUV[1])) { - if (select) { - simaUVSel_Set(efa, tf, i); - } else { - simaUVSel_UnSet(efa, tf, i); - } - } - } - } - } - } - } - if (ok && G.sima->flag & SI_SYNC_UVSEL) { - if (select) EM_select_flush(); - else EM_deselect_flush(); - } -} - -static void do_lasso_select_curve__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) -{ - struct { short (*mcords)[2]; short moves; short select; } *data = userData; - - if (lasso_inside(data->mcords, data->moves, x, y)) { - if (bp) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } else { - if (G.f & G_HIDDENHANDLES) { - /* can only be beztindex==0 here since handles are hidden */ - bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT); - } else { - if (beztindex==0) { - bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT); - } else if (beztindex==1) { - bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT); - } else { - bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT); - } - } - } - } -} -static void do_lasso_select_curve(short mcords[][2], short moves, short select) -{ - struct { short (*mcords)[2]; short moves; short select; } data; - - data.mcords = mcords; - data.moves = moves; - data.select = select; - - nurbs_foreachScreenVert(do_lasso_select_curve__doSelect, &data); -} - -static void do_lasso_select_lattice__doSelect(void *userData, BPoint *bp, int x, int y) -{ - struct { short (*mcords)[2]; short moves; short select; } *data = userData; - - if (lasso_inside(data->mcords, data->moves, x, y)) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } -} -static void do_lasso_select_lattice(short mcords[][2], short moves, short select) -{ - struct { short (*mcords)[2]; short moves; short select; } data; - - data.mcords = mcords; - data.moves = moves; - data.select = select; - - lattice_foreachScreenVert(do_lasso_select_lattice__doSelect, &data); -} - -static void do_lasso_select_armature(short mcords[][2], short moves, short select) -{ - EditBone *ebone; - float vec[3]; - short sco1[2], sco2[2], didpoint; - - for (ebone=G.edbo.first; ebone; ebone=ebone->next) { - - VECCOPY(vec, ebone->head); - Mat4MulVecfl(G.obedit->obmat, vec); - project_short(vec, sco1); - VECCOPY(vec, ebone->tail); - Mat4MulVecfl(G.obedit->obmat, vec); - project_short(vec, sco2); - - didpoint= 0; - if(lasso_inside(mcords, moves, sco1[0], sco1[1])) { - if(select) ebone->flag |= BONE_ROOTSEL; - else ebone->flag &= ~BONE_ROOTSEL; - didpoint= 1; - } - if(lasso_inside(mcords, moves, sco2[0], sco2[1])) { - if(select) ebone->flag |= BONE_TIPSEL; - else ebone->flag &= ~BONE_TIPSEL; - didpoint= 1; - } - /* if one of points selected, we skip the bone itself */ - if(didpoint==0 && lasso_inside_edge(mcords, moves, sco1[0], sco1[1], sco2[0], sco2[1])) { - if(select) ebone->flag |= BONE_TIPSEL|BONE_ROOTSEL|BONE_SELECTED; - else ebone->flag &= ~(BONE_ACTIVE|BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL); - } - } - countall(); /* abused for flushing selection */ -} - -static void do_lasso_select_facemode(short mcords[][2], short moves, short select) -{ - Mesh *me; - rcti rect; - - me= get_mesh(OBACT); - if(me==NULL || me->mtface==NULL) return; - if(me->totface==0) return; - - em_vertoffs= me->totface+1; /* max index array */ - - lasso_select_boundbox(&rect, mcords, moves); - EM_mask_init_backbuf_border(mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax); - - EM_backbuf_checkAndSelectTFaces(me, select); - - EM_free_backbuf(); - - object_tface_flags_changed(OBACT, 0); -} - -static void do_lasso_select(short mcords[][2], short moves, short select) -{ - if(G.obedit==NULL) { - if(FACESEL_PAINT_TEST) - do_lasso_select_facemode(mcords, moves, select); - else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) - ; - else if(G.f & G_PARTICLEEDIT) - PE_do_lasso_select(mcords, moves, select); - else - do_lasso_select_objects(mcords, moves, select); - } - else if(G.obedit->type==OB_MESH) { - if(curarea->spacetype==SPACE_VIEW3D) { - do_lasso_select_mesh(mcords, moves, select); - } else if (EM_texFaceCheck()){ - do_lasso_select_mesh_uv(mcords, moves, select); - } - } else if(G.obedit->type==OB_CURVE || G.obedit->type==OB_SURF) - do_lasso_select_curve(mcords, moves, select); - else if(G.obedit->type==OB_LATTICE) - do_lasso_select_lattice(mcords, moves, select); - else if(G.obedit->type==OB_ARMATURE) - do_lasso_select_armature(mcords, moves, select); - - BIF_undo_push("Lasso select"); - - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - allqueue(REDRAWVIEW3D, 0); - countall(); -} - -/* un-draws and draws again */ -static void draw_lasso_select(short mcords[][2], short moves, short end) -{ - int a; - - setlinestyle(2); - /* clear draw */ - if(moves>1) { - for(a=1; a<=moves-1; a++) { - sdrawXORline(mcords[a-1][0], mcords[a-1][1], mcords[a][0], mcords[a][1]); - } - sdrawXORline(mcords[moves-1][0], mcords[moves-1][1], mcords[0][0], mcords[0][1]); - } - if(!end) { - /* new draw */ - for(a=1; a<=moves; a++) { - sdrawXORline(mcords[a-1][0], mcords[a-1][1], mcords[a][0], mcords[a][1]); - } - sdrawXORline(mcords[moves][0], mcords[moves][1], mcords[0][0], mcords[0][1]); - } - setlinestyle(0); -} - - -static char interpret_move(short mcord[][2], int count) -{ - float x1, x2, y1, y2, d1, d2, inp, sq, mouse[MOVES_GESTURE][2]; - int i, j, dir = 0; - - if (count <= 10) return ('g'); - - /* from short to float (drawing is with shorts) */ - for(j=0; j 0; j--){ - x1 = mouse[1][0]; - y1 = mouse[1][1]; - for (i = 2; i < count; i++){ - x2 = mouse[i-1][0]; - y2 = mouse[i-1][1]; - mouse[i-1][0] = ((x1 + mouse[i][0]) /4.0) + (x2 / 2.0); - mouse[i-1][1] = ((y1 + mouse[i][1]) /4.0) + (y2 / 2.0); - x1 = x2; - y1 = y2; - } - } - - /* make overview of directions */ - for (i = 0; i <= count - 2; i++){ - x1 = mouse[i][0] - mouse[i + 1][0]; - y1 = mouse[i][1] - mouse[i + 1][1]; - - if (x1 < -0.5){ - if (y1 < -0.5) dir |= 32; - else if (y1 > 0.5) dir |= 128; - else dir |= 64; - } else if (x1 > 0.5){ - if (y1 < -0.5) dir |= 8; - else if (y1 > 0.5) dir |= 2; - else dir |= 4; - } else{ - if (y1 < -0.5) dir |= 16; - else if (y1 > 0.5) dir |= 1; - else dir |= 0; - } - } - - /* move all crosses to the right */ - for (i = 7; i>=0 ; i--){ - if (dir & 128) dir = (dir << 1) + 1; - else break; - } - dir &= 255; - for (i = 7; i>=0 ; i--){ - if ((dir & 1) == 0) dir >>= 1; - else break; - } - - /* in theory: 1 direction: straight line - * multiple sequential directions: circle - * non-sequential, and 1 bit set in upper 4 bits: size - */ - switch(dir){ - case 1: - return ('g'); - break; - case 3: - case 7: - x1 = mouse[0][0] - mouse[count >> 1][0]; - y1 = mouse[0][1] - mouse[count >> 1][1]; - x2 = mouse[count >> 1][0] - mouse[count - 1][0]; - y2 = mouse[count >> 1][1] - mouse[count - 1][1]; - d1 = (x1 * x1) + (y1 * y1); - d2 = (x2 * x2) + (y2 * y2); - sq = sqrt(d1); - x1 /= sq; - y1 /= sq; - sq = sqrt(d2); - x2 /= sq; - y2 /= sq; - inp = (x1 * x2) + (y1 * y2); - /*printf("%f\n", inp);*/ - if (inp > 0.9) return ('g'); - else return ('r'); - break; - case 15: - case 31: - case 63: - case 127: - case 255: - return ('r'); - break; - default: - /* for size at least one of the higher bits has to be set */ - if (dir < 16) return ('r'); - else return ('s'); - } - - return (0); -} - - -/* return 1 to denote gesture did something, also does lasso */ -int gesture(void) -{ - unsigned short event=0; - int i= 1, end= 0, a; - short mcords[MOVES_LASSO][2]; /* the larger size */ - short mval[2], val, timer=0, mousebut, lasso=0, maxmoves; - - if (U.flag & USER_LMOUSESELECT) mousebut = R_MOUSE; - else mousebut = L_MOUSE; - - /* check for lasso */ - if(G.qual & LR_CTRLKEY) { - if(curarea->spacetype==SPACE_VIEW3D) { - if(G.obedit==NULL) { - if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) return 0; - } - lasso= 1; - } else if (curarea->spacetype==SPACE_IMAGE) { - if(G.obedit) { - lasso= 1; - } - } - } - - glDrawBuffer(GL_FRONT); - persp(PERSP_WIN); /* ortho at pixel level */ - - getmouseco_areawin(mval); - - mcords[0][0] = mval[0]; - mcords[0][1] = mval[1]; - - if(lasso) maxmoves= MOVES_LASSO; - else maxmoves= MOVES_GESTURE; - - while(get_mbut() & mousebut) { - - if(qtest()) event= extern_qread(&val); - else if(i==1) { - /* not drawing yet... check for toolbox */ - PIL_sleep_ms(10); - timer++; - if(timer>=10*U.tb_leftmouse) { - glDrawBuffer(GL_BACK); /* !! */ - toolbox_n(); - return 1; - } - } - - switch (event) { - case MOUSEY: - getmouseco_areawin(mval); - if( abs(mval[0]-mcords[i-1][0])>3 || abs(mval[1]-mcords[i-1][1])>3 ) { - mcords[i][0] = mval[0]; - mcords[i][1] = mval[1]; - - if(i) { - if(lasso) draw_lasso_select(mcords, i, 0); - else sdrawXORline(mcords[i-1][0], mcords[i-1][1], mcords[i][0], mcords[i][1]); - bglFlush(); - } - i++; - } - break; - case MOUSEX: - break; - case LEFTMOUSE: - break; - default: - if(event) end= 1; /* blender returns 0 */ - break; - } - if (i == maxmoves || end == 1) break; - } - - /* clear */ - if(lasso) draw_lasso_select(mcords, i, 1); - else for(a=1; a 2) { - if(lasso) do_lasso_select(mcords, i, (G.qual & LR_SHIFTKEY)==0); - else { - i = interpret_move(mcords, i); - - if(i) { - if(curarea->spacetype==SPACE_IPO) transform_ipo(i); - else if(curarea->spacetype==SPACE_OOPS) transform_oops('g', 0); - else { - int context; - - if(curarea->spacetype==SPACE_IMAGE) context= CTX_NONE; - else context= CTX_NONE; - - if(i=='g') { - initTransform(TFM_TRANSLATION, context); - Transform(); - } - else if(i=='r') { - initTransform(TFM_ROTATION, context); - Transform(); - } - else { - initTransform(TFM_RESIZE, context); - Transform(); - } - } - } - } - return 1; - } - return 0; -} - -void mouse_cursor(void) -{ - float dx, dy, fz, *fp = NULL, dvec[3], oldcurs[3]; - short mval[2], mx, my, lr_click=0; - - if(gesture()) return; - - getmouseco_areawin(mval); - - mx= mval[0]; - my= mval[1]; - - fp= give_cursor(); - - if(G.obedit && ((G.qual & LR_CTRLKEY) || get_mbut()&R_MOUSE )) lr_click= 1; - VECCOPY(oldcurs, fp); - - project_short_noclip(fp, mval); - - initgrabz(fp[0], fp[1], fp[2]); - - if(mval[0]!=IS_CLIPPED) { - - window_to_3d(dvec, mval[0]-mx, mval[1]-my); - VecSubf(fp, fp, dvec); - - } - else { - - dx= ((float)(mx-(curarea->winx/2)))*G.vd->zfac/(curarea->winx/2); - dy= ((float)(my-(curarea->winy/2)))*G.vd->zfac/(curarea->winy/2); - - fz= G.vd->persmat[0][3]*fp[0]+ G.vd->persmat[1][3]*fp[1]+ G.vd->persmat[2][3]*fp[2]+ G.vd->persmat[3][3]; - fz= fz/G.vd->zfac; - - fp[0]= (G.vd->persinv[0][0]*dx + G.vd->persinv[1][0]*dy+ G.vd->persinv[2][0]*fz)-G.vd->ofs[0]; - fp[1]= (G.vd->persinv[0][1]*dx + G.vd->persinv[1][1]*dy+ G.vd->persinv[2][1]*fz)-G.vd->ofs[1]; - fp[2]= (G.vd->persinv[0][2]*dx + G.vd->persinv[1][2]*dy+ G.vd->persinv[2][2]*fz)-G.vd->ofs[2]; - } - - allqueue(REDRAWVIEW3D, 1); - - if(lr_click) { - if(G.obedit->type==OB_MESH) add_click_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) addvert_Nurb(0); - else if (G.obedit->type==OB_ARMATURE) addvert_armature(); - VECCOPY(fp, oldcurs); - } - -} - -void deselectall(void) /* is toggle */ -{ - Base *base; - int a=0, ok=0; - - base= FIRSTBASE; - while(base) { - /* is there a visible selected object */ - if(base->lay & G.vd->lay && - (base->object->restrictflag & OB_RESTRICT_VIEW)==0 && - (base->object->restrictflag & OB_RESTRICT_SELECT)==0 - ) { - if (base->flag & SELECT) { - ok= a= 1; - break; - } else { - ok=1; - } - } - base= base->next; - } - - if (!ok) return; - - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay && - (base->object->restrictflag & OB_RESTRICT_VIEW)==0 && - (base->object->restrictflag & OB_RESTRICT_SELECT)==0 - ) { - if(a) - select_base_v3d(base, BA_DESELECT); - else - select_base_v3d(base, BA_SELECT); - base->object->flag= base->flag; - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWNLA, 0); - - countall(); - BIF_undo_push("(De)select all"); -} - -/* inverts object selection */ -void selectswap(void) -{ - Base *base; - - for(base= FIRSTBASE; base; base= base->next) { - if(base->lay & G.vd->lay && - (base->object->restrictflag & OB_RESTRICT_VIEW)==0 - ) { - if TESTBASE(base) - select_base_v3d(base, BA_DESELECT); - else - select_base_v3d(base, BA_SELECT); - base->object->flag= base->flag; - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWNLA, 0); - - countall(); - BIF_undo_push("Select Inverse"); -} - - -/* selects all objects of a particular type, on currently visible layers */ -void selectall_type(short obtype) -{ - Base *base; - - base= FIRSTBASE; - while(base) { - if((base->lay & G.vd->lay) && - (base->object->type == obtype) && - (base->object->restrictflag & OB_RESTRICT_VIEW)==0 - ) { - select_base_v3d(base, BA_SELECT); - base->object->flag= base->flag; - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWNLA, 0); - - countall(); - BIF_undo_push("Select all per type"); -} -/* selects all objects on a particular layer */ -void selectall_layer(unsigned int layernum) -{ - Base *base; - - base= FIRSTBASE; - while(base) { - if(base->lay == (1<< (layernum -1)) && - (base->object->restrictflag & OB_RESTRICT_VIEW)==0 - ) { - select_base_v3d(base, BA_SELECT); - base->object->flag= base->flag; - } - base= base->next; - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWNLA, 0); - - countall(); - BIF_undo_push("Select all per layer"); -} - -static void deselectall_except(Base *b) /* deselect all except b */ -{ - Base *base; - - base= FIRSTBASE; - while(base) { - if (base->flag & SELECT) { - if(b!=base) { - select_base_v3d(base, BA_DESELECT); - base->object->flag= base->flag; - } - } - base= base->next; - } -} - -#if 0 -/* smart function to sample a rect spiralling outside, nice for backbuf selection */ -static unsigned int samplerect(unsigned int *buf, int size, unsigned int dontdo) -{ - Base *base; - unsigned int *bufmin,*bufmax; - int a,b,rc,tel,aantal,dirvec[4][2],maxob; - unsigned int retval=0; - - base= LASTBASE; - if(base==0) return 0; - maxob= base->selcol; - - aantal= (size-1)/2; - rc= 0; - - dirvec[0][0]= 1; - dirvec[0][1]= 0; - dirvec[1][0]= 0; - dirvec[1][1]= -size; - dirvec[2][0]= -1; - dirvec[2][1]= 0; - dirvec[3][0]= 0; - dirvec[3][1]= size; - - bufmin= buf; - bufmax= buf+ size*size; - buf+= aantal*size+ aantal; - - for(tel=1;tel<=size;tel++) { - - for(a=0;a<2;a++) { - for(b=0;b=bufmax) return retval; - } - rc++; - rc &= 3; - } - } - return retval; -} -#endif - -void set_active_base(Base *base) -{ - Base *tbase; - - /* activating a non-mesh, should end a couple of modes... */ - if(base && base->object->type!=OB_MESH) - exit_paint_modes(); - - /* sets scene->basact */ - BASACT= base; - - if(base) { - - /* signals to buttons */ - redraw_test_buttons(base->object); - - /* signal to ipo */ - allqueue(REDRAWIPO, base->object->ipowin); - - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWNODE, 0); - - /* signal to action */ - select_actionchannel_by_name(base->object->action, "Object", 1); - - /* disable temporal locks */ - for(tbase=FIRSTBASE; tbase; tbase= tbase->next) { - if(base!=tbase && (tbase->object->shapeflag & OB_SHAPE_TEMPLOCK)) { - tbase->object->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, tbase->object, OB_RECALC_DATA); - } - } - } -} - -void set_active_object(Object *ob) -{ - Base *base; - - for(base= FIRSTBASE; base; base= base->next) { - if(base->object==ob) { - set_active_base(base); - return; - } - } -} - -static void select_all_from_groups(Base *basact) -{ - Group *group; - GroupObject *go; - int deselect= basact->flag & SELECT; - - for(group= G.main->group.first; group; group= group->id.next) { - if(object_in_group(basact->object, group)) { - for(go= group->gobject.first; go; go= go->next) { - if(deselect) go->ob->flag &= ~SELECT; - else { - if ((go->ob->restrictflag & OB_RESTRICT_SELECT)==0 && - (go->ob->restrictflag & OB_RESTRICT_VIEW)==0) - go->ob->flag |= SELECT; - } - } - } - } - /* sync bases */ - for(basact= G.scene->base.first; basact; basact= basact->next) { - if(basact->object->flag & SELECT) - select_base_v3d(basact, BA_SELECT); - else - select_base_v3d(basact, BA_DESELECT); - } -} - -/* The max number of menu items in an object select menu */ -#define SEL_MENU_SIZE 22 - -static Base *mouse_select_menu(unsigned int *buffer, int hits, short *mval) -{ - Base *baseList[SEL_MENU_SIZE]={NULL}; /*baseList is used to store all possible bases to bring up a menu */ - Base *base; - short baseCount = 0; - char menuText[20 + SEL_MENU_SIZE*32] = "Select Object%t"; /* max ob name = 22 */ - char str[32]; - - for(base=FIRSTBASE; base; base= base->next) { - if BASE_SELECTABLE(base) { - baseList[baseCount] = NULL; - - /* two selection methods, the CTRL select uses max dist of 15 */ - if(buffer) { - int a; - for(a=0; aselcol==buffer[ (4 * a) + 3 ]) baseList[baseCount] = base; - } - } - else { - int temp, dist=15; - - project_short(base->object->obmat[3], &base->sx); - - temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]); - if(tempobject->id.name+2, baseCount+1); /* max ob name == 22 */ - strcat(menuText, str); - baseCount++; - } - } - } - } - - if(baseCount<=1) return baseList[0]; - else { - baseCount = pupmenu(menuText); - - if (baseCount != -1) { /* If nothing is selected then dont do anything */ - return baseList[baseCount-1]; - } - else return NULL; - } -} - -/* we want a select buffer with bones, if there are... */ -/* so check three selection levels and compare */ -static short mixed_bones_object_selectbuffer(unsigned int *buffer, short *mval) -{ - int offs; - short a, hits15, hits9=0, hits5=0; - short has_bones15=0, has_bones9=0, has_bones5=0; - - hits15= view3d_opengl_select(buffer, MAXPICKBUF, mval[0]-14, mval[1]-14, mval[0]+14, mval[1]+14); - if(hits15>0) { - for(a=0; a0) { - for(a=0; a0) { - for(a=0; a0) { - offs= 4*hits15 + 4*hits9; - memcpy(buffer, buffer+offs, 4*offs); - return hits5; - } - if(hits9>0) { - offs= 4*hits15; - memcpy(buffer, buffer+offs, 4*offs); - return hits9; - } - return hits15; - } - - return 0; -} - -void mouse_select(void) -{ - Base *base, *startbase=NULL, *basact=NULL, *oldbasact=NULL; - unsigned int buffer[MAXPICKBUF]; - int temp, a, dist=100; - short hits, mval[2]; - - /* always start list from basact in wire mode */ - startbase= FIRSTBASE; - if(BASACT && BASACT->next) startbase= BASACT->next; - - getmouseco_areawin(mval); - - /* This block uses the control key to make the object selected by its center point rather then its contents */ - if(G.obedit==0 && (G.qual & LR_CTRLKEY)) { - - /* note; shift+alt goes to group-flush-selecting */ - if(G.qual == (LR_ALTKEY|LR_CTRLKEY)) - basact= mouse_select_menu(NULL, 0, mval); - else { - base= startbase; - while(base) { - if BASE_SELECTABLE(base) { - project_short(base->object->obmat[3], &base->sx); - - temp= abs(base->sx -mval[0]) + abs(base->sy -mval[1]); - if(base==BASACT) temp+=10; - if(tempnext; - - if(base==0) base= FIRSTBASE; - if(base==startbase) break; - } - } - } - else { - /* if objects have posemode set, the bones are in the same selection buffer */ - - hits= mixed_bones_object_selectbuffer(buffer, mval); - - if(hits>0) { - int has_bones= 0; - - for(a=0; adrawtype>OB_WIRE) { - donearest= 1; - if( ABS(mval[0]-lastmval[0])<3 && ABS(mval[1]-lastmval[1])<3) { - if(!has_bones) /* hrms, if theres bones we always do nearest */ - donearest= 0; - } - } - lastmval[0]= mval[0]; lastmval[1]= mval[1]; - - if(donearest) { - unsigned int min= 0xFFFFFFFF; - int selcol= 0, notcol=0; - - - if(has_bones) { - /* we skip non-bone hits */ - for(a=0; a buffer[4*a+1] && (buffer[4*a+3] & 0xFFFF0000) ) { - min= buffer[4*a+1]; - selcol= buffer[4*a+3] & 0xFFFF; - } - } - } - else { - /* only exclude active object when it is selected... */ - if(BASACT && (BASACT->flag & SELECT) && hits>1) notcol= BASACT->selcol; - - for(a=0; a buffer[4*a+1] && notcol!=(buffer[4*a+3] & 0xFFFF)) { - min= buffer[4*a+1]; - selcol= buffer[4*a+3] & 0xFFFF; - } - } - } - - base= FIRSTBASE; - while(base) { - if(base->lay & G.vd->lay) { - if(base->selcol==selcol) break; - } - base= base->next; - } - if(base) basact= base; - } - else { - - base= startbase; - while(base) { - /* skip objects with select restriction, to prevent prematurely ending this loop - * with an un-selectable choice */ - if (base->object->restrictflag & OB_RESTRICT_SELECT) { - base=base->next; - if(base==NULL) base= FIRSTBASE; - if(base==startbase) break; - } - - if(base->lay & G.vd->lay) { - for(a=0; aselcol== (buffer[(4*a)+3] & 0xFFFF)) - basact= base; - } - } - else { - if(base->selcol== (buffer[(4*a)+3] & 0xFFFF)) - basact= base; - } - } - } - - if(basact) break; - - base= base->next; - if(base==NULL) base= FIRSTBASE; - if(base==startbase) break; - } - } - } - - if(has_bones && basact) { - if( do_pose_selectbuffer(basact, buffer, hits) ) { /* then bone is found */ - - /* we make the armature selected: - not-selected active object in posemode won't work well for tools */ - basact->flag|= SELECT; - basact->object->flag= basact->flag; - - /* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */ - if(G.f & G_WEIGHTPAINT) { - /* prevent activating */ - basact= NULL; - } - } - /* prevent bone selecting to pass on to object selecting */ - if(basact==BASACT) - basact= NULL; - } - } - } - - /* so, do we have something selected? */ - if(basact) { - - if(G.obedit) { - /* only do select */ - deselectall_except(basact); - select_base_v3d(basact, BA_SELECT); - } - /* also prevent making it active on mouse selection */ - else if BASE_SELECTABLE(basact) { - - oldbasact= BASACT; - BASACT= basact; - - if((G.qual & LR_SHIFTKEY)==0) { - deselectall_except(basact); - select_base_v3d(basact, BA_SELECT); - } - else if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)) { - select_all_from_groups(basact); - } - else { - if(basact->flag & SELECT) { - if(basact==oldbasact) - select_base_v3d(basact, BA_DESELECT); - } - else select_base_v3d(basact, BA_SELECT); - } - - /* copy */ - basact->object->flag= basact->flag; - - if(oldbasact != basact) { - set_active_base(basact); - } - - /* for visual speed, only in wire mode */ - if(G.vd->drawtype==OB_WIRE) { - /* however, not for posemodes */ - if(basact->object->flag & OB_POSEMODE); - else if(oldbasact && (oldbasact->object->flag & OB_POSEMODE)); - else { - if(oldbasact && oldbasact != basact && (oldbasact->lay & G.vd->lay)) - draw_object_ext(oldbasact); - draw_object_ext(basact); - } - } - - allqueue(REDRAWBUTSLOGIC, 0); - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWHEADERS, 0); /* To force display update for the posebutton */ - } - /* also because multiple 3d windows can be open */ - allqueue(REDRAWVIEW3D, 0); - - } - - countall(); - - rightmouse_transform(); /* does undo push! */ -} - -/* ------------------------------------------------------------------------- */ - -static int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2) -{ - int radsq= rad*rad; - float v1[2], v2[2], v3[2]; - - /* check points in circle itself */ - if( (x1-centx)*(x1-centx) + (y1-centy)*(y1-centy) <= radsq ) return 1; - if( (x2-centx)*(x2-centx) + (y2-centy)*(y2-centy) <= radsq ) return 1; - - /* pointdistline */ - v3[0]= centx; - v3[1]= centy; - v1[0]= x1; - v1[1]= y1; - v2[0]= x2; - v2[1]= y2; - - if( PdistVL2Dfl(v3, v1, v2) < (float)rad ) return 1; - - return 0; -} - -static void do_nurbs_box_select__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) -{ - struct { rcti *rect; int select; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y)) { - if (bp) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } else { - if (G.f & G_HIDDENHANDLES) { - /* can only be beztindex==0 here since handles are hidden */ - bezt->f1 = bezt->f2 = bezt->f3 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT); - } else { - if (beztindex==0) { - bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT); - } else if (beztindex==1) { - bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT); - } else { - bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT); - } - } - } - } -} -static void do_nurbs_box_select(rcti *rect, int select) -{ - struct { rcti *rect; int select; } data; - - data.rect = rect; - data.select = select; - - nurbs_foreachScreenVert(do_nurbs_box_select__doSelect, &data); -} - -static void do_lattice_box_select__doSelect(void *userData, BPoint *bp, int x, int y) -{ - struct { rcti *rect; int select; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y)) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } -} -static void do_lattice_box_select(rcti *rect, int select) -{ - struct { rcti *rect; int select, pass, done; } data; - - data.rect = rect; - data.select = select; - - lattice_foreachScreenVert(do_lattice_box_select__doSelect, &data); -} - -static void do_mesh_box_select__doSelectVert(void *userData, EditVert *eve, int x, int y, int index) -{ - struct { rcti *rect; short select, pass, done; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y)) { - eve->f = data->select?(eve->f|1):(eve->f&~1); - } -} -static void do_mesh_box_select__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) -{ - struct { rcti *rect; short select, pass, done; } *data = userData; - - if(EM_check_backbuf(em_solidoffs+index)) { - if (data->pass==0) { - if (edge_fully_inside_rect(data->rect, x0, y0, x1, y1)) { - EM_select_edge(eed, data->select); - data->done = 1; - } - } else { - if (edge_inside_rect(data->rect, x0, y0, x1, y1)) { - EM_select_edge(eed, data->select); - } - } - } -} -static void do_mesh_box_select__doSelectFace(void *userData, EditFace *efa, int x, int y, int index) -{ - struct { rcti *rect; short select, pass, done; } *data = userData; - - if (BLI_in_rcti(data->rect, x, y)) { - EM_select_face_fgon(efa, data->select); - } -} -static void do_mesh_box_select(rcti *rect, int select) -{ - struct { rcti *rect; short select, pass, done; } data; - EditMesh *em = G.editMesh; - int bbsel; - - data.rect = rect; - data.select = select; - data.pass = 0; - data.done = 0; - - bbsel= EM_init_backbuf_border(rect->xmin, rect->ymin, rect->xmax, rect->ymax); - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if (bbsel) { - EM_backbuf_checkAndSelectVerts(em, select); - } else { - mesh_foreachScreenVert(do_mesh_box_select__doSelectVert, &data, 1); - } - } - if(G.scene->selectmode & SCE_SELECT_EDGE) { - /* Does both bbsel and non-bbsel versions (need screen cos for both) */ - - data.pass = 0; - mesh_foreachScreenEdge(do_mesh_box_select__doSelectEdge, &data, 0); - - if (data.done==0) { - data.pass = 1; - mesh_foreachScreenEdge(do_mesh_box_select__doSelectEdge, &data, 0); - } - } - - if(G.scene->selectmode & SCE_SELECT_FACE) { - if(bbsel) { - EM_backbuf_checkAndSelectFaces(em, select); - } else { - mesh_foreachScreenFace(do_mesh_box_select__doSelectFace, &data); - } - } - - EM_free_backbuf(); - - EM_selectmode_flush(); -} - -/** - * Does the 'borderselect' command. (Select verts based on selecting with a - * border: key 'b'). All selecting seems to be done in the get_border part. - */ -void borderselect(void) -{ - rcti rect; - Base *base; - MetaElem *ml; - unsigned int buffer[MAXPICKBUF]; - int a, index; - short hits, val; - - if(G.obedit==NULL && (FACESEL_PAINT_TEST)) { - face_borderselect(); - return; - } - else if(G.obedit==NULL && (G.f & G_PARTICLEEDIT)) { - PE_borderselect(); - return; - } - - a = 0; -#ifdef __APPLE__ - a = is_a_really_crappy_intel_card(); -#endif - if (!a) setlinestyle(2); - val= get_border(&rect, 3); - if (!a) setlinestyle(0); - - if(val==0) { - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - return; - } - - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - do_mesh_box_select(&rect, (val==LEFTMOUSE)); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - do_nurbs_box_select(&rect, val==LEFTMOUSE); - allqueue(REDRAWVIEW3D, 0); - } - else if(G.obedit->type==OB_MBALL) { - hits= view3d_opengl_select(buffer, MAXPICKBUF, rect.xmin, rect.ymin, rect.xmax, rect.ymax); - - ml= editelems.first; - - while(ml) { - for(a=0; aselcol1==buffer[ (4 * a) + 3 ]) { - ml->flag |= MB_SCALE_RAD; - if(val==LEFTMOUSE) ml->flag |= SELECT; - else ml->flag &= ~SELECT; - break; - } - if(ml->selcol2==buffer[ (4 * a) + 3 ]) { - ml->flag &= ~MB_SCALE_RAD; - if(val==LEFTMOUSE) ml->flag |= SELECT; - else ml->flag &= ~SELECT; - break; - } - } - ml= ml->next; - } - allqueue(REDRAWVIEW3D, 0); - } - else if(G.obedit->type==OB_ARMATURE) { - EditBone *ebone; - - /* clear flag we use to detect point was affected */ - for(ebone= G.edbo.first; ebone; ebone= ebone->next) - ebone->flag &= ~BONE_DONE; - - hits= view3d_opengl_select(buffer, MAXPICKBUF, rect.xmin, rect.ymin, rect.xmax, rect.ymax); - - /* first we only check points inside the border */ - for (a=0; aflag |= BONE_DONE; - if (val==LEFTMOUSE) ebone->flag |= BONE_TIPSEL; - else ebone->flag &= ~BONE_TIPSEL; - } - - if (index & BONESEL_ROOT) { - ebone->flag |= BONE_DONE; - if (val==LEFTMOUSE) ebone->flag |= BONE_ROOTSEL; - else ebone->flag &= ~BONE_ROOTSEL; - } - } - } - - /* now we have to flush tag from parents... */ - for(ebone= G.edbo.first; ebone; ebone= ebone->next) { - if(ebone->parent && (ebone->flag & BONE_CONNECTED)) { - if(ebone->parent->flag & BONE_DONE) - ebone->flag |= BONE_DONE; - } - } - - /* only select/deselect entire bones when no points where in the rect */ - for (a=0; aflag & BONE_DONE)) { - if (val==LEFTMOUSE) - ebone->flag |= (BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED); - else - ebone->flag &= ~(BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED); - } - } - } - } - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWVIEW3D, 0); - } - else if(G.obedit->type==OB_LATTICE) { - do_lattice_box_select(&rect, val==LEFTMOUSE); - allqueue(REDRAWVIEW3D, 0); - } - } - else { /* no editmode, unified for bones and objects */ - Bone *bone; - unsigned int *vbuffer=NULL; /* selection buffer */ - unsigned int *col; /* color in buffer */ - short selecting = 0; - Object *ob= OBACT; - int bone_only; - - if((ob) && (ob->flag & OB_POSEMODE)) - bone_only= 1; - else - bone_only= 0; - - if (val==LEFTMOUSE) - selecting = 1; - - /* selection buffer now has bones potentially too, so we add MAXPICKBUF */ - vbuffer = MEM_mallocN(4 * (G.totobj+MAXPICKBUF) * sizeof(unsigned int), "selection buffer"); - hits= view3d_opengl_select(vbuffer, 4*(G.totobj+MAXPICKBUF), rect.xmin, rect.ymin, rect.xmax, rect.ymax); - /* - LOGIC NOTES (theeth): - The buffer and ListBase have the same relative order, which makes the selection - very simple. Loop through both data sets at the same time, if the color - is the same as the object, we have a hit and can move to the next color - and object pair, if not, just move to the next object, - keeping the same color until we have a hit. - - The buffer order is defined by OGL standard, hopefully no stupid GFX card - does it incorrectly. - */ - - if (hits>0) { /* no need to loop if there's no hit */ - base= FIRSTBASE; - col = vbuffer + 3; - while(base && hits) { - Base *next = base->next; - if(base->lay & G.vd->lay) { - while (base->selcol == (*col & 0xFFFF)) { /* we got an object */ - - if(*col & 0xFFFF0000) { /* we got a bone */ - bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY)); - if(bone) { - if(selecting) { - bone->flag |= BONE_SELECTED; - select_actionchannel_by_name(base->object->action, bone->name, 1); - } - else { - bone->flag &= ~(BONE_ACTIVE|BONE_SELECTED); - select_actionchannel_by_name(base->object->action, bone->name, 0); - } - } - } - else if(!bone_only) { - if (selecting) - select_base_v3d(base, BA_SELECT); - else - select_base_v3d(base, BA_DESELECT); - - base->object->flag= base->flag; - } - - col+=4; /* next color */ - hits--; - if(hits==0) break; - } - } - - base= next; - } - } - /* frontbuffer flush */ - bglFlush(); - - MEM_freeN(vbuffer); - - allqueue(REDRAWDATASELECT, 0); - allqueue(REDRAWBUTSLOGIC, 0); - allqueue(REDRAWNLA, 0); - } - - countall(); - - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWINFO, 0); - - BIF_undo_push("Border select"); - -} /* end of borderselect() */ - -/* ------------------------------------------------------------------------- */ - -/** The following functions are quick & dirty callback functions called - * on the Circle select function (press B twice in Editmode) - * They were torn out of the circle_select to make the latter more reusable - * The callback version of circle_select (called circle_selectCB) was moved - * to edit.c because of it's (wanted) generality. - - XXX These callback functions are still dirty, because they call globals... - */ - -static void mesh_selectionCB__doSelectVert(void *userData, EditVert *eve, int x, int y, int index) -{ - struct { short select, mval[2]; float radius; } *data = userData; - int mx = x - data->mval[0], my = y - data->mval[1]; - float r = sqrt(mx*mx + my*my); - - if (r<=data->radius) { - eve->f = data->select?(eve->f|1):(eve->f&~1); - } -} -static void mesh_selectionCB__doSelectEdge(void *userData, EditEdge *eed, int x0, int y0, int x1, int y1, int index) -{ - struct { short select, mval[2]; float radius; } *data = userData; - - if (edge_inside_circle(data->mval[0], data->mval[1], (short) data->radius, x0, y0, x1, y1)) { - EM_select_edge(eed, data->select); - } -} -static void mesh_selectionCB__doSelectFace(void *userData, EditFace *efa, int x, int y, int index) -{ - struct { short select, mval[2]; float radius; } *data = userData; - int mx = x - data->mval[0], my = y - data->mval[1]; - float r = sqrt(mx*mx + my*my); - - if (r<=data->radius) { - EM_select_face_fgon(efa, data->select); - } -} -static void mesh_selectionCB(int selecting, Object *editobj, short *mval, float rad) -{ - struct { short select, mval[2]; float radius; } data; - EditMesh *em = G.editMesh; - int bbsel; - - if(!G.obedit && (FACESEL_PAINT_TEST)) { - Mesh *me = get_mesh(OBACT); - - if (me) { - em_vertoffs= me->totface+1; /* max index array */ - - bbsel= EM_init_backbuf_circle(mval[0], mval[1], (short)(rad+1.0)); - EM_backbuf_checkAndSelectTFaces(me, selecting==LEFTMOUSE); - EM_free_backbuf(); - - object_tface_flags_changed(OBACT, 0); - } - - return; - } - - bbsel= EM_init_backbuf_circle(mval[0], mval[1], (short)(rad+1.0)); - - data.select = (selecting==LEFTMOUSE); - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.radius = rad; - - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - if(bbsel) { - EM_backbuf_checkAndSelectVerts(em, selecting==LEFTMOUSE); - } else { - mesh_foreachScreenVert(mesh_selectionCB__doSelectVert, &data, 1); - } - } - - if(G.scene->selectmode & SCE_SELECT_EDGE) { - if (bbsel) { - EM_backbuf_checkAndSelectEdges(em, selecting==LEFTMOUSE); - } else { - mesh_foreachScreenEdge(mesh_selectionCB__doSelectEdge, &data, 0); - } - } - - if(G.scene->selectmode & SCE_SELECT_FACE) { - if(bbsel) { - EM_backbuf_checkAndSelectFaces(em, selecting==LEFTMOUSE); - } else { - mesh_foreachScreenFace(mesh_selectionCB__doSelectFace, &data); - } - } - - EM_free_backbuf(); - EM_selectmode_flush(); -} - - -static void nurbscurve_selectionCB__doSelect(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y) -{ - struct { short select, mval[2]; float radius; } *data = userData; - int mx = x - data->mval[0], my = y - data->mval[1]; - float r = sqrt(mx*mx + my*my); - - if (r<=data->radius) { - if (bp) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } else { - if (beztindex==0) { - bezt->f1 = data->select?(bezt->f1|SELECT):(bezt->f1&~SELECT); - } else if (beztindex==1) { - bezt->f2 = data->select?(bezt->f2|SELECT):(bezt->f2&~SELECT); - } else { - bezt->f3 = data->select?(bezt->f3|SELECT):(bezt->f3&~SELECT); - } - } - } -} -static void nurbscurve_selectionCB(int selecting, Object *editobj, short *mval, float rad) -{ - struct { short select, mval[2]; float radius; } data; - - data.select = (selecting==LEFTMOUSE); - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.radius = rad; - - nurbs_foreachScreenVert(nurbscurve_selectionCB__doSelect, &data); -} - - -static void latticecurve_selectionCB__doSelect(void *userData, BPoint *bp, int x, int y) -{ - struct { short select, mval[2]; float radius; } *data = userData; - int mx = x - data->mval[0], my = y - data->mval[1]; - float r = sqrt(mx*mx + my*my); - - if (r<=data->radius) { - bp->f1 = data->select?(bp->f1|SELECT):(bp->f1&~SELECT); - } -} -static void lattice_selectionCB(int selecting, Object *editobj, short *mval, float rad) -{ - struct { short select, mval[2]; float radius; } data; - - data.select = (selecting==LEFTMOUSE); - data.mval[0] = mval[0]; - data.mval[1] = mval[1]; - data.radius = rad; - - lattice_foreachScreenVert(latticecurve_selectionCB__doSelect, &data); -} - -/** Callbacks for selection in Editmode */ - -void obedit_selectionCB(short selecting, Object *editobj, short *mval, float rad) -{ - switch(editobj->type) { - case OB_MESH: - mesh_selectionCB(selecting, editobj, mval, rad); - break; - case OB_CURVE: - case OB_SURF: - nurbscurve_selectionCB(selecting, editobj, mval, rad); - break; - case OB_LATTICE: - lattice_selectionCB(selecting, editobj, mval, rad); - break; - default: - return; - } - - draw_sel_circle(0, 0, 0, 0, 0); /* signal */ - force_draw(0); -} - -void set_render_border(void) -{ - rcti rect; - short val; - - val= get_border(&rect, 3); - if(val) { - rctf vb; - - calc_viewborder(G.vd, &vb); - - G.scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin); - G.scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin); - G.scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin); - G.scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin); - - CLAMP(G.scene->r.border.xmin, 0.0, 1.0); - CLAMP(G.scene->r.border.ymin, 0.0, 1.0); - CLAMP(G.scene->r.border.xmax, 0.0, 1.0); - CLAMP(G.scene->r.border.ymax, 0.0, 1.0); - - allqueue(REDRAWVIEWCAM, 1); - - /* drawing a border surrounding the entire camera view switches off border rendering - * or the border covers no pixels */ - if ((G.scene->r.border.xmin <= 0.0 && G.scene->r.border.xmax >= 1.0 && - G.scene->r.border.ymin <= 0.0 && G.scene->r.border.ymax >= 1.0) || - (G.scene->r.border.xmin == G.scene->r.border.xmax || - G.scene->r.border.ymin == G.scene->r.border.ymax )) - { - G.scene->r.mode &= ~R_BORDER; - } else { - G.scene->r.mode |= R_BORDER; - } - - allqueue(REDRAWBUTSSCENE, 1); - } -} - -void view3d_border_zoom(void) -{ - /* Zooms in on a border drawn by the user */ - rcti rect; - short val; - float dvec[3], vb[2], xscale, yscale, scale; - - /* SMOOTHVIEW */ - float new_dist; - float new_ofs[3]; - - /* doesn't work fine for perspective */ - if(G.vd->persp==1) - return; - - val = get_border(&rect, 3); //box select input - if(val) - { - /* find the current window width and height */ - vb[0] = G.vd->area->winx; - vb[1] = G.vd->area->winy; - - new_dist = G.vd->dist; - new_ofs[0] = G.vd->ofs[0]; - new_ofs[1] = G.vd->ofs[1]; - new_ofs[2] = G.vd->ofs[2]; - - /* convert the drawn rectangle into 3d space */ - initgrabz(-new_ofs[0], -new_ofs[1], -new_ofs[2]); - - window_to_3d(dvec, (rect.xmin+rect.xmax-vb[0])/2, (rect.ymin+rect.ymax-vb[1])/2); - - /* center the view to the center of the rectangle */ - VecSubf(new_ofs, new_ofs, dvec); - - /* work out the ratios, so that everything selected fits when we zoom */ - xscale = ((rect.xmax-rect.xmin)/vb[0]); - yscale = ((rect.ymax-rect.ymin)/vb[1]); - scale = (xscale >= yscale)?xscale:yscale; - - /* zoom in as required, or as far as we can go */ - new_dist = ((new_dist*scale) >= 0.001*G.vd->grid)? new_dist*scale:0.001*G.vd->grid; - - smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL); - - } -} - -void fly(void) -{ - /* - fly mode - Shift+F - a fly loop where the user can move move the view as if they are flying - */ - float speed=0.0, /* the speed the view is moving per redraw */ - mat[3][3], /* 3x3 copy of the view matrix so we can move allong the view axis */ - dvec[3]={0,0,0}, /* this is the direction thast added to the view offset per redraw */ - dvec_old[3]={0,0,0}, /* old for some lag */ - dvec_tmp[3]={0,0,0}, /* old for some lag */ - dvec_lag=0.0, /* old for some lag */ - - /* Camera Uprighting variables */ - roll, /* similar to the angle between the camera's up and the Z-up, but its very rough so just roll*/ - upvec[3]={0,0,0}, /* stores the view's up vector */ - - dist_backup, /* backup the views distance since we use a zero dist for fly mode */ - rot_backup[4], /* backup the views quat incase the user cancels flying in non camera mode */ - ofs_backup[3], /* backup the views offset incase the user cancels flying in non camera mode */ - moffset[2], /* mouse offset from the views center */ - tmp_quat[4], /* used for rotating the view */ - winxf, winyf, /* scale the mouse movement by this value - scales mouse movement to the view size */ - time_redraw, time_redraw_clamped, time_wheel; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */ - - /* time_lastwheel is used to accelerate when using the mousewheel a lot */ - double time_current, time_lastdraw, time_currwheel, time_lastwheel; - - short val, /* used for toets to see if a buttons pressed */ - cent_orig[2], /* view center */ - cent[2], /* view center modified */ - mval[2], /* mouse location */ - action=0, /* while zero stay in fly mode and wait for action, also used to see if we accepted or canceled 1:ok 2:Cancel */ - xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */ - unsigned short - toets; /* for reading the event */ - unsigned char - apply_rotation= 1, /* if the user presses shift they can look about without movinf the direction there looking*/ - axis= 2, /* Axis index to move allong by default Z to move allong the view */ - persp_backup, /* remember if were ortho or not, only used for restoring the view if it was a ortho view */ - pan_view=0; /* if true, pan the view instead of rotating */ - - /* relative view axis locking - xlock, zlock - 0; disabled - 1; enabled but not checking because mouse hasnt moved outside the margin since locking was checked an not needed - when the mouse moves, locking is set to 2 so checks are done. - 2; mouse moved and checking needed, if no view altering is donem its changed back to 1 */ - short xlock=0, zlock=0; - float xlock_momentum=0.0f, zlock_momentum=0.0f; /* nicer dynamics */ - - /* for recording */ - int playing_anim = has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM); - int cfra = -1; /*so the first frame always has a key added */ - char *actname=""; - - if(curarea->spacetype!=SPACE_VIEW3D) return; - - if(G.vd->persp==2 && G.vd->camera->id.lib) { - error("Cannot fly a camera from an external library"); - return; - } - - if(G.vd->ob_centre) { - error("Cannot fly when the view is locked to an object"); - return; - } - - - /* detect weather to start with Z locking */ - upvec[0]=1; upvec[1]=0; upvec[2]=0; - Mat3CpyMat4(mat, G.vd->viewinv); - Mat3MulVecfl(mat, upvec); - if (fabs(upvec[2]) < 0.1) - zlock = 1; - upvec[0]=0; upvec[1]=0; upvec[2]=0; - - persp_backup= G.vd->persp; - dist_backup= G.vd->dist; - if (G.vd->persp==2) { /* Camera */ - if(G.vd->camera->constraints.first) { - error("Cannot fly an object with constraints"); - return; - } - - /* store the origoinal camera loc and rot */ - VECCOPY(ofs_backup, G.vd->camera->loc); - VECCOPY(rot_backup, G.vd->camera->rot); - - where_is_object(G.vd->camera); - VECCOPY(G.vd->ofs, G.vd->camera->obmat[3]); - VecMulf(G.vd->ofs, -1.0f); /*flip the vector*/ - - G.vd->dist=0.0; - G.vd->viewbut=0; - - /* used for recording */ - if(G.vd->camera->ipoflag & OB_ACTION_OB) - actname= "Object"; - - } else { - /* perspective or ortho */ - if (G.vd->persp==0) - G.vd->persp= 1; /*if ortho projection, make perspective */ - QUATCOPY(rot_backup, G.vd->viewquat); - VECCOPY(ofs_backup, G.vd->ofs); - G.vd->dist= 0.0; - - upvec[2]=dist_backup; /*x and y are 0*/ - Mat3MulVecfl(mat, upvec); - VecSubf(G.vd->ofs, G.vd->ofs, upvec); - /*Done with correcting for the dist*/ - } - - /* the dist defines a vector that is infront of the offset - to rotate the view about. - this is no good for fly mode because we - want to rotate about the viewers center. - but to correct the dist removal we must - alter offset so the view dosent jump. */ - - xmargin= (short)((float)(curarea->winx)/20.0); - ymargin= (short)((float)(curarea->winy)/20.0); - - cent_orig[0]= curarea->winrct.xmin+(curarea->winx)/2; - cent_orig[1]= curarea->winrct.ymin+(curarea->winy)/2; - - warp_pointer(cent_orig[0], cent_orig[1]); - - /* we have to rely on events to give proper mousecoords after a warp_pointer */ - mval[0]= cent[0]= (curarea->winx)/2; - mval[1]= cent[1]= (curarea->winy)/2; - /* window size minus margin - use this to get the mouse range for rotation */ - winxf= (float)(curarea->winx)-(xmargin*2); - winyf= (float)(curarea->winy)-(ymargin*2); - - - time_lastdraw= time_lastwheel= PIL_check_seconds_timer(); - - G.vd->flag2 |= V3D_FLYMODE; /* so we draw the corner margins */ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - while(action==0) { /* keep flying, no acton taken */ - while(qtest()) { - toets= extern_qread(&val); - - if(val) { - if(toets==MOUSEY) getmouseco_areawin(mval); - else if(toets==ESCKEY || toets==RIGHTMOUSE) { - action= 2; /* Canceled */ - break; - } else if(toets==SPACEKEY || toets==LEFTMOUSE) { - action= 1; /* Accepted */ - break; - } else if(toets==PADPLUSKEY || toets==EQUALKEY || toets==WHEELUPMOUSE) { - time_currwheel= PIL_check_seconds_timer(); - time_wheel = (float)(time_currwheel - time_lastwheel); - time_lastwheel = time_currwheel; - /*printf("Wheel %f\n", time_wheel);*/ - /*Mouse wheel delays range from 0.5==slow to 0.01==fast*/ - time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */ - - if (speed<0) speed=0; - else { - if (G.qual & LR_SHIFTKEY) - speed+= G.vd->grid*time_wheel*0.1; - else - speed+= G.vd->grid*time_wheel; - } - - } else if(toets==PADMINUS || toets==MINUSKEY || toets==WHEELDOWNMOUSE) { - time_currwheel= PIL_check_seconds_timer(); - time_wheel = (float)(time_currwheel - time_lastwheel); - time_lastwheel = time_currwheel; - time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */ - - if (speed>0) speed=0; - else { - if (G.qual & LR_SHIFTKEY) - speed-= G.vd->grid*time_wheel*0.1; - else - speed-= G.vd->grid*time_wheel; - } - - } else if (toets==MIDDLEMOUSE) { - /* make it so the camera direction dosent follow the view - good for flying backwards! - Only when MMB is held */ - - /*apply_rotation=0;*/ - pan_view= 1; - - /* impliment WASD keys */ - } else if(toets==WKEY) { - if (speed<0) speed=-speed; /* flip speed rather then stopping, game like motion */ - else speed+= G.vd->grid; /* increse like mousewheel if were alredy moving in that difection*/ - axis= 2; - } else if(toets==SKEY) { /*SAME as above but flipped */ - if (speed>0) speed=-speed; - else speed-= G.vd->grid; - axis= 2; - - } else if(toets==AKEY) { - if (speed<0) speed=-speed; - axis= 0; - } else if(toets==DKEY) { - if (speed>0) speed=-speed; - axis= 0; - } else if(toets==FKEY) { - if (speed<0) speed=-speed; - axis= 1; - } else if(toets==RKEY) { - if (speed>0) speed=-speed; - axis= 1; - - /* axis locking */ - } else if(toets==XKEY) { - if (xlock) xlock=0; - else { - xlock = 2; - xlock_momentum = 0.0; - } - } else if(toets==ZKEY) { - if (zlock) zlock=0; - else { - zlock = 2; - zlock_momentum = 0.0; - } - } - - } else { - /* mouse buttons lifted */ - if (toets==MIDDLEMOUSE && pan_view) { - /*apply_rotation=1;*/ - warp_pointer(cent_orig[0], cent_orig[1]); - pan_view= 0; - } - } - } - if(action != 0) break; - - moffset[0]= mval[0]-cent[0]; - moffset[1]= mval[1]-cent[1]; - - /* enforce a view margin */ - if (moffset[0]>xmargin) moffset[0]-=xmargin; - else if (moffset[0]<-xmargin)moffset[0]+=xmargin; - else moffset[0]=0; - - if (moffset[1]>ymargin) moffset[1]-=ymargin; - else if (moffset[1]<-ymargin)moffset[1]+=ymargin; - else moffset[1]=0; - - /* scale the mouse offset so the distance the mouse moves isnt linear */ - if (moffset[0]) { - moffset[0]= moffset[0]/winxf; - moffset[0]= moffset[0]*fabs(moffset[0]); - } - - if (moffset[1]) { - moffset[1]= moffset[1]/winyf; - moffset[1]= moffset[1]*fabs(moffset[1]); - } - - /* Should we redraw? */ - if(speed!=0.0 || moffset[0] || moffset[1] || zlock || xlock || dvec[0] || dvec[1] || dvec[2] ) { - - time_current= PIL_check_seconds_timer(); - time_redraw= (float)(time_current-time_lastdraw); - time_redraw_clamped= MIN2(0.05, time_redraw); /* clamt the redraw time to avoid jitter in roll correction */ - time_lastdraw= time_current; - /*fprintf(stderr, "%f\n", time_redraw);*/ /* 0.002 is a small redraw 0.02 is larger */ - - /* Scale the time to use shift to scale the speed down- just like - shift slows many other areas of blender down */ - if (G.qual & LR_SHIFTKEY) - speed= speed * (1-time_redraw_clamped); - - Mat3CpyMat4(mat, G.vd->viewinv); - - if (pan_view) { - /* pan only */ - dvec_tmp[0]= -moffset[0]; - dvec_tmp[1]= -moffset[1]; - dvec_tmp[2]= 0; - - if (G.qual & LR_SHIFTKEY) { - dvec_tmp[0] *= 0.1; - dvec_tmp[1] *= 0.1; - } - - Mat3MulVecfl(mat, dvec_tmp); - VecMulf(dvec_tmp, time_redraw*200.0 * G.vd->grid); - - } else { - /* rotate about the X axis- look up/down */ - if (moffset[1]) { - upvec[0]=1; - upvec[1]=0; - upvec[2]=0; - Mat3MulVecfl(mat, upvec); - VecRotToQuat( upvec, (float)moffset[1]*-time_redraw*20, tmp_quat); /* Rotate about the relative up vec */ - QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat); - - if (xlock) xlock = 2; /*check for rotation*/ - if (zlock) zlock = 2; - xlock_momentum= 0.0; - } - - /* rotate about the Y axis- look left/right */ - if (moffset[0]) { - - if (zlock) { - upvec[0]=0; - upvec[1]=0; - upvec[2]=1; - } else { - upvec[0]=0; - upvec[1]=1; - upvec[2]=0; - Mat3MulVecfl(mat, upvec); - } - - VecRotToQuat( upvec, (float)moffset[0]*time_redraw*20, tmp_quat); /* Rotate about the relative up vec */ - QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat); - - if (xlock) xlock = 2;/*check for rotation*/ - if (zlock) zlock = 2; - } - - if (zlock==2) { - upvec[0]=1; - upvec[1]=0; - upvec[2]=0; - Mat3MulVecfl(mat, upvec); - - /*make sure we have some z rolling*/ - if (fabs(upvec[2]) > 0.00001) { - roll= upvec[2]*5; - upvec[0]=0; /*rotate the view about this axis*/ - upvec[1]=0; - upvec[2]=1; - - Mat3MulVecfl(mat, upvec); - VecRotToQuat( upvec, roll*time_redraw_clamped*zlock_momentum*0.1, tmp_quat); /* Rotate about the relative up vec */ - QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat); - - zlock_momentum += 0.05; - } else { - zlock=1; /* dont check until the view rotates again */ - zlock_momentum= 0.0; - } - } - - if (xlock==2 && moffset[1]==0) { /*only apply xcorrect when mouse isnt applying x rot*/ - upvec[0]=0; - upvec[1]=0; - upvec[2]=1; - Mat3MulVecfl(mat, upvec); - /*make sure we have some z rolling*/ - if (fabs(upvec[2]) > 0.00001) { - roll= upvec[2]*-5; - - upvec[0]=1; /*rotate the view about this axis*/ - upvec[1]=0; - upvec[2]=0; - - Mat3MulVecfl(mat, upvec); - - VecRotToQuat( upvec, roll*time_redraw_clamped*xlock_momentum*0.1, tmp_quat); /* Rotate about the relative up vec */ - QuatMul(G.vd->viewquat, G.vd->viewquat, tmp_quat); - - xlock_momentum += 0.05; - } else { - xlock=1; /* see above */ - xlock_momentum= 0.0; - } - } - - - if (apply_rotation) { - /* Normal operation */ - /* define dvec, view direction vector */ - dvec_tmp[0]= dvec_tmp[1]= dvec_tmp[2]= 0; - /* move along the current axis */ - dvec_tmp[axis]= 1.0f; - - Mat3MulVecfl(mat, dvec_tmp); - - VecMulf(dvec_tmp, speed*time_redraw*0.25); - } - } - - /* impose a directional lag */ - dvec_lag = 1.0/(1+(time_redraw*5)); - dvec[0] = dvec_tmp[0]*(1-dvec_lag) + dvec_old[0]*dvec_lag; - dvec[1] = dvec_tmp[1]*(1-dvec_lag) + dvec_old[1]*dvec_lag; - dvec[2] = dvec_tmp[2]*(1-dvec_lag) + dvec_old[2]*dvec_lag; - - - if (G.vd->persp==2) { - if (G.vd->camera->protectflag & OB_LOCK_LOCX) - dvec[0] = 0.0; - if (G.vd->camera->protectflag & OB_LOCK_LOCY) - dvec[1] = 0.0; - if (G.vd->camera->protectflag & OB_LOCK_LOCZ) - dvec[2] = 0.0; - } - - VecAddf(G.vd->ofs, G.vd->ofs, dvec); - if (zlock && xlock) - headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X on/Z on, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB"); - else if (zlock) - headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X off/Z on, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB"); - else if (xlock) - headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X on/Z off, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB"); - else - headerprint("FlyKeys Speed:(+/- | Wheel), Upright Axis:X off/Z off, Slow:Shift, Direction:WASDRF, Ok:LMB, Pan:MMB, Cancel:RMB"); - - do_screenhandlers(G.curscreen); /* advance the next frame */ - - /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to teh view */ - if (G.vd->persp==2) { - G.vd->persp= 1; /*set this so setviewmatrixview3d uses the ofs and quat instead of the camera */ - setviewmatrixview3d(); - setcameratoview3d(); - G.vd->persp= 2; - - /* record the motion */ - if (G.flags & G_RECORDKEYS && (!playing_anim || cfra != G.scene->r.cfra)) { - cfra = G.scene->r.cfra; - - if (xlock || zlock || moffset[0] || moffset[1]) { - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_X, 0); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Y, 0); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Z, 0); - } - if (speed) { - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_X, 0); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Y, 0); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z, 0); - } - } - } - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } else - /*were not redrawing but we need to update the time else the view will jump */ - time_lastdraw= PIL_check_seconds_timer(); - /* end drawing */ - VECCOPY(dvec_old, dvec); - } - - G.vd->dist= dist_backup; - - /* Revert to original view? */ - if (action == 2) { /* action == 2 means the user pressed Esc of RMB, and not to apply view to camera */ - if (persp_backup==2) { /* a camera view */ - G.vd->viewbut=1; - VECCOPY(G.vd->camera->loc, ofs_backup); - VECCOPY(G.vd->camera->rot, rot_backup); - DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB); - } else { - /* Non Camera we need to reset the view back to the original location bacause the user canceled*/ - QUATCOPY(G.vd->viewquat, rot_backup); - VECCOPY(G.vd->ofs, ofs_backup); - G.vd->persp= persp_backup; - } - } - else if (persp_backup==2) { /* camera */ - float mat3[3][3]; - Mat3CpyMat4(mat3, G.vd->camera->obmat); - Mat3ToCompatibleEul(mat3, G.vd->camera->rot, rot_backup); - - DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB); - - if (G.flags & G_RECORDKEYS) { - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWTIME, 0); - } - } - else { /* not camera */ - /* Apply the fly mode view */ - /*restore the dist*/ - upvec[0]= upvec[1]= 0; - upvec[2]=dist_backup; /*x and y are 0*/ - Mat3CpyMat4(mat, G.vd->viewinv); - Mat3MulVecfl(mat, upvec); - VecAddf(G.vd->ofs, G.vd->ofs, upvec); - /*Done with correcting for the dist */ - } - - G.vd->flag2 &= ~V3D_FLYMODE; - allqueue(REDRAWVIEW3D, 0); - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); /* not working at the moment not sure why */ -} - -void view3d_edit_clipping(View3D *v3d) -{ - - if(v3d->flag & V3D_CLIPPING) { - v3d->flag &= ~V3D_CLIPPING; - scrarea_queue_winredraw(curarea); - if(v3d->clipbb) MEM_freeN(v3d->clipbb); - v3d->clipbb= NULL; - } - else { - rcti rect; - double mvmatrix[16]; - double projmatrix[16]; - double xs, ys, p[3]; - GLint viewport[4]; - short val; - - /* get border in window coords */ - setlinestyle(2); - val= get_border(&rect, 3); - setlinestyle(0); - if(val==0) return; - - v3d->flag |= V3D_CLIPPING; - v3d->clipbb= MEM_mallocN(sizeof(BoundBox), "clipbb"); - - /* convert border to 3d coordinates */ - - /* Get the matrices needed for gluUnProject */ - glGetIntegerv(GL_VIEWPORT, viewport); - glGetDoublev(GL_MODELVIEW_MATRIX, mvmatrix); - glGetDoublev(GL_PROJECTION_MATRIX, projmatrix); - - /* near zero floating point values can give issues with gluUnProject - in side view on some implementations */ - if(fabs(mvmatrix[0]) < 1e-6) mvmatrix[0]= 0.0; - if(fabs(mvmatrix[5]) < 1e-6) mvmatrix[5]= 0.0; - - /* Set up viewport so that gluUnProject will give correct values */ - viewport[0] = 0; - viewport[1] = 0; - - /* four clipping planes and bounding volume */ - /* first do the bounding volume */ - for(val=0; val<4; val++) { - - xs= (val==0||val==3)?rect.xmin:rect.xmax; - ys= (val==0||val==1)?rect.ymin:rect.ymax; - - gluUnProject(xs, ys, 0.0, mvmatrix, projmatrix, viewport, &p[0], &p[1], &p[2]); - VECCOPY(v3d->clipbb->vec[val], p); - - gluUnProject(xs, ys, 1.0, mvmatrix, projmatrix, viewport, &p[0], &p[1], &p[2]); - VECCOPY(v3d->clipbb->vec[4+val], p); - } - - /* then plane equations */ - for(val=0; val<4; val++) { - - CalcNormFloat(v3d->clipbb->vec[val], v3d->clipbb->vec[val==3?0:val+1], v3d->clipbb->vec[val+4], - v3d->clip[val]); - - v3d->clip[val][3]= - v3d->clip[val][0]*v3d->clipbb->vec[val][0] - - v3d->clip[val][1]*v3d->clipbb->vec[val][1] - - v3d->clip[val][2]*v3d->clipbb->vec[val][2]; - } - } -} - diff --git a/source/blender/src/eventdebug.c b/source/blender/src/eventdebug.c deleted file mode 100644 index 6c6a137a789..00000000000 --- a/source/blender/src/eventdebug.c +++ /dev/null @@ -1,195 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ -#include "mydevice.h" -#include "blendef.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -char *event_to_string(short); - -char *event_to_string(short evt) { -#define smap(evt) case evt: return #evt - switch (evt) { - default: return ""; - smap(CHANGED); - smap(DRAWEDGES); - smap(BACKBUFDRAW); - smap(EXECUTE); - smap(LOAD_FILE); - smap(RESHAPE); - smap(UI_BUT_EVENT); - smap(REDRAWVIEW3D); - smap(REDRAWVIEWCAM); - smap(REDRAWHEADERS); - smap(REDRAWVIEW3D_Z); - smap(REDRAWALL); - smap(REDRAWINFO); - smap(RENDERPREVIEW); - smap(REDRAWIPO); - smap(REDRAWDATASELECT); - smap(REDRAWSEQ); - smap(REDRAWIMAGE); - smap(REDRAWOOPS); - smap(REDRAWIMASEL); - smap(AFTERIMASELIMA); - smap(AFTERIMASELGET); - smap(AFTERIMAWRITE); - smap(IMALEFTMOUSE); - smap(AFTERPIBREAD); - smap(REDRAWTEXT); - smap(REDRAWSCRIPT); - smap(REDRAWACTION); - smap(LEFTMOUSE); - smap(MIDDLEMOUSE); - smap(RIGHTMOUSE); - smap(MOUSEX); - smap(MOUSEY); - smap(TIMER0); - smap(TIMER1); - smap(TIMER2); - smap(TIMER3); - smap(KEYBD); - smap(RAWKEYBD); - smap(REDRAW); - smap(INPUTCHANGE); - smap(QFULL); - smap(WINFREEZE); - smap(WINTHAW); - smap(WINCLOSE); - smap(WINQUIT); - smap(Q_FIRSTTIME); - smap(AKEY); - smap(BKEY); - smap(CKEY); - smap(DKEY); - smap(EKEY); - smap(FKEY); - smap(GKEY); - smap(HKEY); - smap(IKEY); - smap(JKEY); - smap(KKEY); - smap(LKEY); - smap(MKEY); - smap(NKEY); - smap(OKEY); - smap(PKEY); - smap(QKEY); - smap(RKEY); - smap(SKEY); - smap(TKEY); - smap(UKEY); - smap(VKEY); - smap(WKEY); - smap(XKEY); - smap(YKEY); - smap(ZKEY); - smap(ZEROKEY); - smap(ONEKEY); - smap(TWOKEY); - smap(THREEKEY); - smap(FOURKEY); - smap(FIVEKEY); - smap(SIXKEY); - smap(SEVENKEY); - smap(EIGHTKEY); - smap(NINEKEY); - smap(CAPSLOCKKEY); - smap(LEFTCTRLKEY); - smap(LEFTALTKEY); - smap(RIGHTALTKEY); - smap(RIGHTCTRLKEY); - smap(RIGHTSHIFTKEY); - smap(LEFTSHIFTKEY); - smap(ESCKEY); - smap(TABKEY); - smap(RETKEY); - smap(SPACEKEY); - smap(LINEFEEDKEY); - smap(BACKSPACEKEY); - smap(DELKEY); - smap(SEMICOLONKEY); - smap(PERIODKEY); - smap(COMMAKEY); - smap(QUOTEKEY); - smap(ACCENTGRAVEKEY); - smap(MINUSKEY); - smap(SLASHKEY); - smap(BACKSLASHKEY); - smap(EQUALKEY); - smap(LEFTBRACKETKEY); - smap(RIGHTBRACKETKEY); - smap(LEFTARROWKEY); - smap(DOWNARROWKEY); - smap(RIGHTARROWKEY); - smap(UPARROWKEY); - smap(PAD0); - smap(PAD1); - smap(PAD2); - smap(PAD3); - smap(PAD4); - smap(PAD5); - smap(PAD6); - smap(PAD7); - smap(PAD8); - smap(PAD9); - smap(PADPERIOD); - smap(PADSLASHKEY); - smap(PADASTERKEY); - smap(PADMINUS); - smap(PADENTER); - smap(PADPLUSKEY); - smap(F1KEY); - smap(F2KEY); - smap(F3KEY); - smap(F4KEY); - smap(F5KEY); - smap(F6KEY); - smap(F7KEY); - smap(F8KEY); - smap(F9KEY); - smap(F10KEY); - smap(F11KEY); - smap(F12KEY); - smap(PAUSEKEY); - smap(INSERTKEY); - smap(HOMEKEY); - smap(PAGEUPKEY); - smap(PAGEDOWNKEY); - smap(ENDKEY); - smap(REDRAWNLA); - smap(ONLOAD_SCRIPT); - } - #undef smap -} diff --git a/source/blender/src/filelist.c b/source/blender/src/filelist.c deleted file mode 100644 index 59430ef8778..00000000000 --- a/source/blender/src/filelist.c +++ /dev/null @@ -1,1135 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2007 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - - -/* global includes */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_linklist.h" -#include "BLI_storage_types.h" - -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BIF_filelist.h" -#include "BKE_library.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BLO_readfile.h" - -#include "DNA_space_types.h" -#include "DNA_ipo_types.h" -#include "DNA_ID.h" -#include "DNA_object_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_texture_types.h" -#include "DNA_world_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" -#include "IMB_thumbs.h" - -#include "PIL_time.h" - -#include "datatoc.h" - -/* Elubie: VERY, really very ugly and evil! Remove asap!!! */ -/* for state of file */ -#define ACTIVE 2 - -/* max length of library group name within filesel */ -#define GROUP_MAX 32 - -typedef struct FileList -{ - struct direntry *filelist; - int *fidx; - - int numfiles; - int numfiltered; - char dir[FILE_MAXDIR]; - short type; - short ipotype; - struct BlendHandle *libfiledata; - int has_func; - short prv_w; - short prv_h; - short hide_dot; - unsigned int filter; -} FileList; - -int BIF_groupname_to_code(char *group) -{ - char buf[32]; - char *lslash; - - BLI_strncpy(buf, group, 31); - lslash= BLI_last_slash(buf); - if (lslash) - lslash[0]= '\0'; - - return BLO_idcode_from_name(buf); -} - - -#define SPECIAL_IMG_SIZE 48 -#define SPECIAL_IMG_ROWS 4 -#define SPECIAL_IMG_COLS 4 - -#define SPECIAL_IMG_FOLDER 0 -#define SPECIAL_IMG_PARENT 1 -#define SPECIAL_IMG_REFRESH 2 -#define SPECIAL_IMG_BLENDFILE 3 -#define SPECIAL_IMG_SOUNDFILE 4 -#define SPECIAL_IMG_MOVIEFILE 5 -#define SPECIAL_IMG_PYTHONFILE 6 -#define SPECIAL_IMG_TEXTFILE 7 -#define SPECIAL_IMG_FONTFILE 8 -#define SPECIAL_IMG_UNKNOWNFILE 9 -#define SPECIAL_IMG_MAX SPECIAL_IMG_UNKNOWNFILE + 1 - -static ImBuf* gSpecialFileImages[SPECIAL_IMG_MAX]; - - -/* ******************* SORT ******************* */ - -static int compare_name(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - return (BLI_strcasecmp(entry1->relname,entry2->relname)); -} - -static int compare_date(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1; - if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1; - - else return BLI_strcasecmp(entry1->relname,entry2->relname); -} - -static int compare_size(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - if ( entry1->s.st_size < entry2->s.st_size) return 1; - if ( entry1->s.st_size > entry2->s.st_size) return -1; - else return BLI_strcasecmp(entry1->relname,entry2->relname); -} - -static int compare_extension(const void *a1, const void *a2) { - const struct direntry *entry1=a1, *entry2=a2; - char *sufix1, *sufix2; - char *nil=""; - - if (!(sufix1= strstr (entry1->relname, ".blend.gz"))) - sufix1= strrchr (entry1->relname, '.'); - if (!(sufix2= strstr (entry2->relname, ".blend.gz"))) - sufix2= strrchr (entry2->relname, '.'); - if (!sufix1) sufix1= nil; - if (!sufix2) sufix2= nil; - - /* type is is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - if( strcmp(entry2->relname, "..")==0 ) return (-1); - - return (BLI_strcasecmp(sufix1, sufix2)); -} - -void BIF_filelist_filter(FileList* filelist) -{ - char dir[FILE_MAX], group[GROUP_MAX]; - int num_filtered = 0; - int i, j; - - if (!filelist->filelist) - return; - - if ( ( (filelist->type == FILE_LOADLIB) && BIF_filelist_islibrary(filelist, dir, group)) - || (filelist->type == FILE_MAIN) ) { - filelist->filter = 0; - } - - if (!filelist->filter) { - if (filelist->fidx) { - MEM_freeN(filelist->fidx); - filelist->fidx = NULL; - } - filelist->fidx = (int *)MEM_callocN(filelist->numfiles*sizeof(int), "filteridx"); - for (i = 0; i < filelist->numfiles; ++i) { - filelist->fidx[i] = i; - } - filelist->numfiltered = filelist->numfiles; - return; - } - - // How many files are left after filter ? - for (i = 0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].flags & filelist->filter) { - num_filtered++; - } - else if (filelist->filelist[i].type & S_IFDIR) { - if (filelist->filter & FOLDERFILE) { - num_filtered++; - } - } - } - - if (filelist->fidx) { - MEM_freeN(filelist->fidx); - filelist->fidx = NULL; - } - filelist->fidx = (int *)MEM_callocN(num_filtered*sizeof(int), "filteridx"); - filelist->numfiltered = num_filtered; - - for (i = 0, j=0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].flags & filelist->filter) { - filelist->fidx[j++] = i; - } - else if (filelist->filelist[i].type & S_IFDIR) { - if (filelist->filter & FOLDERFILE) { - filelist->fidx[j++] = i; - } - } - } -} - -void BIF_filelist_init_icons() -{ - short x, y, k; - ImBuf *bbuf; - ImBuf *ibuf; - bbuf = IMB_ibImageFromMemory((int *)datatoc_prvicons, datatoc_prvicons_size, IB_rect); - if (bbuf) { - for (y=0; yrect[k*SPECIAL_IMG_SIZE], &bbuf->rect[(k+y*SPECIAL_IMG_SIZE)*SPECIAL_IMG_SIZE*SPECIAL_IMG_COLS+x*SPECIAL_IMG_SIZE], SPECIAL_IMG_SIZE*sizeof(int)); - } - gSpecialFileImages[tile] = ibuf; - } - } - } - IMB_freeImBuf(bbuf); - } - -} - -void BIF_filelist_free_icons() -{ - int i; - for (i=0; i < SPECIAL_IMG_MAX; ++i) { - IMB_freeImBuf(gSpecialFileImages[i]); - gSpecialFileImages[i] = NULL; - } -} - -struct FileList* BIF_filelist_new() -{ - FileList* p = MEM_callocN( sizeof(FileList), "filelist" ); - p->filelist = 0; - p->numfiles = 0; - p->dir[0] = '\0'; - p->libfiledata = 0; - p->type = 0; - p->has_func = 0; - p->filter = 0; - return p; -} - -struct FileList* BIF_filelist_copy(struct FileList* filelist) -{ - FileList* p = BIF_filelist_new(); - BLI_strncpy(p->dir, filelist->dir, FILE_MAXDIR); - p->filelist = NULL; - p->fidx = NULL; - p->type = filelist->type; - p->ipotype = filelist->ipotype; - p->has_func = filelist->has_func; - - return p; -} - -void BIF_filelist_free(struct FileList* filelist) -{ - int i; - - if (!filelist) { - printf("Attemtping to delete empty filelist.\n"); - return; - } - - if (filelist->fidx) { - MEM_freeN(filelist->fidx); - filelist->fidx = NULL; - } - - for (i = 0; i < filelist->numfiles; ++i) { - if (filelist->filelist[i].image) { - IMB_freeImBuf(filelist->filelist[i].image); - } - filelist->filelist[i].image = 0; - if (filelist->filelist[i].relname) - MEM_freeN(filelist->filelist[i].relname); - filelist->filelist[i].relname = 0; - if (filelist->filelist[i].string) - MEM_freeN(filelist->filelist[i].string); - filelist->filelist[i].string = 0; - } - - filelist->numfiles = 0; - free(filelist->filelist); - filelist->filelist = 0; - filelist->filter = 0; - filelist->numfiltered =0; -} - -void BIF_filelist_freelib(struct FileList* filelist) -{ - if(filelist->libfiledata) - BLO_blendhandle_close(filelist->libfiledata); - filelist->libfiledata= 0; -} - -struct BlendHandle *BIF_filelist_lib(struct FileList* filelist) -{ - return filelist->libfiledata; -} - -int BIF_filelist_numfiles(struct FileList* filelist) -{ - return filelist->numfiltered; -} - -const char * BIF_filelist_dir(struct FileList* filelist) -{ - return filelist->dir; -} - -void BIF_filelist_setdir(struct FileList* filelist, const char *dir) -{ - BLI_strncpy(filelist->dir, dir, FILE_MAXDIR); -} - -void BIF_filelist_imgsize(struct FileList* filelist, short w, short h) -{ - filelist->prv_w = w; - filelist->prv_h = h; -} - -void BIF_filelist_loadimage(struct FileList* filelist, int index) -{ - ImBuf *imb = NULL; - int imgwidth = filelist->prv_w; - int imgheight = filelist->prv_h; - short ex, ey, dx, dy; - float scaledx, scaledy; - int fidx = 0; - - if ( (index < 0) || (index >= filelist->numfiltered) ) { - return; - } - fidx = filelist->fidx[index]; - - if (!filelist->filelist[fidx].image) - { - if (filelist->type != FILE_MAIN) - { - if ( filelist->filelist[fidx].flags & IMAGEFILE ) { - imb = IMB_thumb_manage(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL, THB_SOURCE_IMAGE); - } else if ( filelist->filelist[fidx].flags & MOVIEFILE ) { - imb = IMB_thumb_manage(filelist->dir, filelist->filelist[fidx].relname, THB_NORMAL, THB_SOURCE_MOVIE); - if (!imb) { - /* remember that file can't be loaded via IMB_open_anim */ - filelist->filelist[fidx].flags &= ~MOVIEFILE; - filelist->filelist[fidx].flags |= MOVIEFILE_ICON; - } - } - if (imb) { - if (imb->x > imb->y) { - scaledx = (float)imgwidth; - scaledy = ( (float)imb->y/(float)imb->x )*imgwidth; - } - else { - scaledy = (float)imgheight; - scaledx = ( (float)imb->x/(float)imb->y )*imgheight; - } - ex = (short)scaledx; - ey = (short)scaledy; - - dx = imgwidth - ex; - dy = imgheight - ey; - - IMB_scaleImBuf(imb, ex, ey); - - } - filelist->filelist[fidx].image = imb; - - } - } -} - -struct ImBuf * BIF_filelist_getimage(struct FileList* filelist, int index) -{ - ImBuf* ibuf = NULL; - int fidx = 0; - if ( (index < 0) || (index >= filelist->numfiltered) ) { - return NULL; - } - fidx = filelist->fidx[index]; - ibuf = filelist->filelist[fidx].image; - - if (ibuf == NULL) { - struct direntry *file = &filelist->filelist[fidx]; - if (file->type & S_IFDIR) { - if ( strcmp(filelist->filelist[fidx].relname, "..") == 0) { - ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT]; - } else if ( strcmp(filelist->filelist[fidx].relname, ".") == 0) { - ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH]; - } else { - ibuf = gSpecialFileImages[SPECIAL_IMG_FOLDER]; - } - } else { - ibuf = gSpecialFileImages[SPECIAL_IMG_UNKNOWNFILE]; - } - - if (file->flags & BLENDERFILE) { - ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE]; - } else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) { - ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE]; - } else if (file->flags & SOUNDFILE) { - ibuf = gSpecialFileImages[SPECIAL_IMG_SOUNDFILE]; - } else if (file->flags & PYSCRIPTFILE) { - ibuf = gSpecialFileImages[SPECIAL_IMG_PYTHONFILE]; - } else if (file->flags & FTFONTFILE) { - ibuf = gSpecialFileImages[SPECIAL_IMG_FONTFILE]; - } else if (file->flags & TEXTFILE) { - ibuf = gSpecialFileImages[SPECIAL_IMG_TEXTFILE]; - } - } - return ibuf; -} - -struct direntry * BIF_filelist_file(struct FileList* filelist, int index) -{ - int fidx = 0; - - if ( (index < 0) || (index >= filelist->numfiltered) ) { - return NULL; - } - fidx = filelist->fidx[index]; - - return &filelist->filelist[fidx]; -} - -int BIF_filelist_find(struct FileList* filelist, char *file) -{ - int index = -1; - int i; - int fidx = -1; - - if (!filelist->fidx) - return fidx; - - - for (i = 0; i < filelist->numfiles; ++i) { - if ( strcmp(filelist->filelist[i].relname, file) == 0) { - index = i; - break; - } - } - - for (i = 0; i < filelist->numfiltered; ++i) { - if (filelist->fidx[i] == index) { - fidx = i; - break; - } - } - return fidx; -} - -void BIF_filelist_hidedot(struct FileList* filelist, short hide) -{ - filelist->hide_dot = hide; -} - -void BIF_filelist_setfilter(struct FileList* filelist, unsigned int filter) -{ - filelist->filter = filter; -} - -void BIF_filelist_readdir(struct FileList* filelist) -{ - char wdir[FILE_MAXDIR]; - int finished = 0; - - if (!filelist) return; - filelist->fidx = 0; - filelist->filelist = 0; - - if(filelist->type==FILE_MAIN) { - BIF_filelist_from_main(filelist); - finished = 1; - } else if(filelist->type==FILE_LOADLIB) { - BLI_cleanup_dir(G.sce, filelist->dir); - BIF_filelist_from_library(filelist); - if(filelist->libfiledata) { - finished = 1; - } - } - - if (!finished) { - BLI_getwdN(wdir); - - BLI_cleanup_dir(G.sce, filelist->dir); - BLI_hide_dot_files(filelist->hide_dot); - filelist->numfiles = BLI_getdir(filelist->dir, &(filelist->filelist)); - - chdir(wdir); - BIF_filelist_setfiletypes(filelist, G.have_quicktime); - BIF_filelist_filter(filelist); - - } -} - -int BIF_filelist_empty(struct FileList* filelist) -{ - return filelist->filelist == 0; -} - -void BIF_filelist_parent(struct FileList* filelist) -{ -#ifdef WIN32 - char c = '\\'; -#else - char c = '/'; -#endif - char *dir = filelist->dir; - size_t len = strlen(dir); - - while( (len > 0) && (dir[len-1] == c) ) - { - --len; - dir[len] = '\0'; - } - while ( (len > 0) && (dir[len-1] != c) ) - { - --len; - dir[len] = '\0'; - } - if (len == 0) - { - dir[0] = c; dir[1] = '\0'; - } -#ifdef WIN32 - strcat(filelist->dir, "\\"); -#else - strcat(filelist->dir, "/"); -#endif - - BLI_cleanup_dir(G.sce, filelist->dir); - BLI_make_exist(filelist->dir); - BIF_filelist_readdir(filelist); -} - -void BIF_filelist_setfiletypes(struct FileList* filelist, short has_quicktime) -{ - struct direntry *file; - int num; - - file= filelist->filelist; - - for(num=0; numnumfiles; num++, file++) { - file->flags= 0; - file->type= file->s.st_mode; /* restore the mess below */ - - /* Don't check extensions for directories */ - if (file->type & S_IFDIR) - continue; - - - - if(BLO_has_bfile_extension(file->relname)) { - file->flags |= BLENDERFILE; - if(filelist->type==FILE_LOADLIB) { - char name[FILE_MAXDIR+FILE_MAXFILE]; - BLI_strncpy(name, filelist->dir, sizeof(name)); - strcat(name, file->relname); - - /* prevent current file being used as acceptable dir */ - if (BLI_streq(G.main->name, name)==0) { - file->type &= ~S_IFMT; - file->type |= S_IFDIR; - } - } - } else if(BLI_testextensie(file->relname, ".py")) { - file->flags |= PYSCRIPTFILE; - } else if(BLI_testextensie(file->relname, ".txt")) { - file->flags |= TEXTFILE; - } else if( BLI_testextensie(file->relname, ".ttf") - || BLI_testextensie(file->relname, ".ttc") - || BLI_testextensie(file->relname, ".pfb") - || BLI_testextensie(file->relname, ".otf") - || BLI_testextensie(file->relname, ".otc")) { - file->flags |= FTFONTFILE; - } else if (has_quicktime){ - if( BLI_testextensie(file->relname, ".int") - || BLI_testextensie(file->relname, ".inta") - || BLI_testextensie(file->relname, ".jpg") - || BLI_testextensie(file->relname, ".jpeg") - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".rgba") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".gif") - || BLI_testextensie(file->relname, ".psd") - || BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff") - || BLI_testextensie(file->relname, ".pct") - || BLI_testextensie(file->relname, ".pict") - || BLI_testextensie(file->relname, ".pntg") //macpaint - || BLI_testextensie(file->relname, ".qtif") - || BLI_testextensie(file->relname, ".sgi") -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif -#ifdef WITH_OPENEXR - || BLI_testextensie(file->relname, ".exr") -#endif - ) { - file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".flc") - || BLI_testextensie(file->relname, ".mov") - || BLI_testextensie(file->relname, ".movie") - || BLI_testextensie(file->relname, ".mp4") - || BLI_testextensie(file->relname, ".m4v") - || BLI_testextensie(file->relname, ".mv")) { - file->flags |= MOVIEFILE; - } - else if(BLI_testextensie(file->relname, ".wav")) { - file->flags |= SOUNDFILE; - } - } else { // no quicktime - if(BLI_testextensie(file->relname, ".int") - || BLI_testextensie(file->relname, ".inta") - || BLI_testextensie(file->relname, ".jpg") - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".rgba") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff") -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif -#ifdef WITH_OPENEXR - || BLI_testextensie(file->relname, ".exr") -#endif - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".sgi")) { - file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".mp4") - || BLI_testextensie(file->relname, ".mv")) { - file->flags |= MOVIEFILE; - } - else if(BLI_testextensie(file->relname, ".wav")) { - file->flags |= SOUNDFILE; - } - } - } -} - -void BIF_filelist_swapselect(struct FileList* filelist) -{ - struct direntry *file; - int num, act= 0; - - file= filelist->filelist; - for(num=0; numnumfiles; num++, file++) { - if(file->flags & ACTIVE) { - act= 1; - break; - } - } - file= filelist->filelist+2; - for(num=2; numnumfiles; num++, file++) { - if(act) file->flags &= ~ACTIVE; - else file->flags |= ACTIVE; - } -} - -int BIF_filelist_islibrary(struct FileList* filelist, char* dir, char* group) -{ - /* return ok when a blenderfile, in dir is the filename, - * in group the type of libdata - */ - int len; - char *fd; - - strcpy(dir, filelist->dir); - len= strlen(dir); - if(len<7) return 0; - if( dir[len-1] != '/' && dir[len-1] != '\\') return 0; - - group[0]= 0; - dir[len-1]= 0; - - /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); - - if(fd==0) return 0; - *fd= 0; - if(BLO_has_bfile_extension(fd+1)) { - *fd= '/'; - } - else { - char *gp = fd+1; // in case we have a .blend file, gp points to the group - - /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); - if (!fd || !BLO_has_bfile_extension(fd+1)) return 0; - - /* now we know that we are in a blend file and it is safe to - assume that gp actually points to a group */ - BLI_strncpy(group, gp, GROUP_MAX); - } - return 1; -} - -void BIF_filelist_from_library(struct FileList* filelist) -{ - LinkNode *l, *names, *previews; - struct ImBuf* ima; - int ok, i, nnames, idcode; - char filename[FILE_MAXDIR+FILE_MAXFILE]; - char dir[FILE_MAXDIR], group[GROUP_MAX]; - - filelist->type = FILE_LOADLIB; - - /* name test */ - ok= BIF_filelist_islibrary(filelist, dir, group); - if (!ok) { - /* free */ - if(filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata); - filelist->libfiledata= 0; - return; - } - - BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI - - /* there we go */ - /* for the time being only read filedata when libfiledata==0 */ - if (filelist->libfiledata==0) { - filelist->libfiledata= BLO_blendhandle_from_file(dir); - if(filelist->libfiledata==0) return; - } - - idcode= BIF_groupname_to_code(group); - - // memory for strings is passed into filelist[i].relname - // and free'd in freefilelist - previews = NULL; - if (idcode) { - previews= BLO_blendhandle_get_previews(filelist->libfiledata, idcode); - names= BLO_blendhandle_get_datablock_names(filelist->libfiledata, idcode); - /* ugh, no rewind, need to reopen */ - BLO_blendhandle_close(filelist->libfiledata); - filelist->libfiledata= BLO_blendhandle_from_file(dir); - - } else { - names= BLO_blendhandle_get_linkable_groups(filelist->libfiledata); - } - - nnames= BLI_linklist_length(names); - - filelist->numfiles= nnames + 2; - filelist->filelist= malloc(filelist->numfiles * sizeof(*filelist->filelist)); - memset(filelist->filelist, 0, filelist->numfiles * sizeof(*filelist->filelist)); - - filelist->filelist[0].relname= BLI_strdup("."); - filelist->filelist[0].type |= S_IFDIR; - filelist->filelist[1].relname= BLI_strdup(".."); - filelist->filelist[1].type |= S_IFDIR; - - for (i=0, l= names; inext) { - char *blockname= l->link; - - filelist->filelist[i + 2].relname= BLI_strdup(blockname); - if (!idcode) - filelist->filelist[i + 2].type |= S_IFDIR; - } - - if(previews) { - for (i=0, l= previews; inext) { - PreviewImage *img= l->link; - - if (img) { - unsigned int w = img->w[PREVIEW_MIPMAP_LARGE]; - unsigned int h = img->h[PREVIEW_MIPMAP_LARGE]; - unsigned int *rect = img->rect[PREVIEW_MIPMAP_LARGE]; - - /* first allocate imbuf for copying preview into it */ - if (w > 0 && h > 0 && rect) { - ima = IMB_allocImBuf(w, h, 32, IB_rect, 0); - memcpy(ima->rect, rect, w*h*sizeof(unsigned int)); - filelist->filelist[i + 2].image = ima; - filelist->filelist[i + 2].flags = IMAGEFILE; - } - } - } - } - - BLI_linklist_free(names, free); - if (previews) BLI_linklist_free(previews, (void(*)(void*)) MEM_freeN); - - BIF_filelist_sort(filelist, FILE_SORTALPHA); - - BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change - - filelist->filter = 0; - BIF_filelist_filter(filelist); -} - -void BIF_filelist_append_library(struct FileList *filelist, char *dir, char *file, short flag, int idcode) -{ - BLO_library_append_(&filelist->libfiledata, filelist->filelist, filelist->numfiles, dir, file, flag, idcode); -} - -void BIF_filelist_from_main(struct FileList *filelist) -{ - ID *id; - struct direntry *files, *firstlib = NULL; - ListBase *lb; - int a, fake, idcode, ok, totlib, totbl; - - filelist->type = FILE_MAIN; - - if(filelist->dir[0]=='/') filelist->dir[0]= 0; - - if(filelist->dir[0]) { - idcode= BIF_groupname_to_code(filelist->dir); - if(idcode==0) filelist->dir[0]= 0; - } - - if( filelist->dir[0]==0) { - - /* make directories */ - filelist->numfiles= 23; - filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)); - - for(a=0; anumfiles; a++) { - memset( &(filelist->filelist[a]), 0 , sizeof(struct direntry)); - filelist->filelist[a].type |= S_IFDIR; - } - - filelist->filelist[0].relname= BLI_strdup(".."); - filelist->filelist[1].relname= BLI_strdup("."); - filelist->filelist[2].relname= BLI_strdup("Scene"); - filelist->filelist[3].relname= BLI_strdup("Object"); - filelist->filelist[4].relname= BLI_strdup("Mesh"); - filelist->filelist[5].relname= BLI_strdup("Curve"); - filelist->filelist[6].relname= BLI_strdup("Metaball"); - filelist->filelist[7].relname= BLI_strdup("Material"); - filelist->filelist[8].relname= BLI_strdup("Texture"); - filelist->filelist[9].relname= BLI_strdup("Image"); - filelist->filelist[10].relname= BLI_strdup("Ika"); - filelist->filelist[11].relname= BLI_strdup("Wave"); - filelist->filelist[12].relname= BLI_strdup("Lattice"); - filelist->filelist[13].relname= BLI_strdup("Lamp"); - filelist->filelist[14].relname= BLI_strdup("Camera"); - filelist->filelist[15].relname= BLI_strdup("Ipo"); - filelist->filelist[16].relname= BLI_strdup("World"); - filelist->filelist[17].relname= BLI_strdup("Screen"); - filelist->filelist[18].relname= BLI_strdup("VFont"); - filelist->filelist[19].relname= BLI_strdup("Text"); - filelist->filelist[20].relname= BLI_strdup("Armature"); - filelist->filelist[21].relname= BLI_strdup("Action"); - filelist->filelist[22].relname= BLI_strdup("NodeTree"); - BIF_filelist_sort(filelist, FILE_SORTALPHA); - } - else { - - /* make files */ - idcode= BIF_groupname_to_code(filelist->dir); - - lb= wich_libbase(G.main, idcode ); - if(lb==0) return; - - id= lb->first; - filelist->numfiles= 0; - while(id) { - - if(filelist->has_func && idcode==ID_IP) { - if(filelist->ipotype== ((Ipo *)id)->blocktype) filelist->numfiles++; - } - else if (!filelist->hide_dot || id->name[2] != '.') { - filelist->numfiles++; - } - - id= id->next; - } - - if(!filelist->has_func) filelist->numfiles+= 2; - filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)); - - files = filelist->filelist; - - if(!filelist->has_func) { - memset( &(filelist->filelist[0]), 0 , sizeof(struct direntry)); - filelist->filelist[0].relname= BLI_strdup("."); - filelist->filelist[0].type |= S_IFDIR; - memset( &(filelist->filelist[1]), 0 , sizeof(struct direntry)); - filelist->filelist[1].relname= BLI_strdup(".."); - filelist->filelist[1].type |= S_IFDIR; - - files+= 2; - } - - id= lb->first; - totlib= totbl= 0; - - while(id) { - - ok= 0; - if(filelist->has_func && idcode==ID_IP) { - if(filelist->ipotype== ((Ipo *)id)->blocktype) ok= 1; - } - else ok= 1; - - if(ok) { - /* TODO: hide dot files - elubie */ - memset( files, 0 , sizeof(struct direntry)); - if(id->lib==NULL) - files->relname= BLI_strdup(id->name+2); - else { - files->relname= MEM_mallocN(FILE_MAXDIR+FILE_MAXFILE+32, "filename for lib"); - sprintf(files->relname, "%s | %s", id->lib->name, id->name+2); - } - /* files->type |= S_IFDIR; */ - if(!filelist->has_func) { /* F4 DATA BROWSE */ - if(idcode==ID_OB) { - if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVE; - } - else if(idcode==ID_SCE) { - if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVE; - } - } - files->nr= totbl+1; - files->poin= id; - fake= id->flag & LIB_FAKEUSER; - if(idcode == ID_MA || idcode == ID_TE || idcode == ID_LA || idcode == ID_WO || idcode == ID_IM) { - files->flags |= IMAGEFILE; - } - if(id->lib && fake) sprintf(files->extra, "LF %d", id->us); - else if(id->lib) sprintf(files->extra, "L %d", id->us); - else if(fake) sprintf(files->extra, "F %d", id->us); - else sprintf(files->extra, " %d", id->us); - - if(id->lib) { - if(totlib==0) firstlib= files; - totlib++; - } - - files++; - totbl++; - } - - id= id->next; - } - - /* only qsort of library blocks */ - if(totlib>1) { - qsort(firstlib, totlib, sizeof(struct direntry), compare_name); - } - } - filelist->filter = 0; - BIF_filelist_filter(filelist); -} - - -void BIF_filelist_settype(struct FileList* filelist, int type) -{ - filelist->type = type; -} - -short BIF_filelist_gettype(struct FileList* filelist) -{ - return filelist->type; -} - -void BIF_filelist_sort(struct FileList* filelist, short sort) -{ - struct direntry *file; - int num;/* , act= 0; */ - - switch(sort) { - case FILE_SORTALPHA: - qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_name); - break; - case FILE_SORTDATE: - qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_date); - break; - case FILE_SORTSIZE: - qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_size); - break; - case FILE_SORTEXTENS: - qsort(filelist->filelist, filelist->numfiles, sizeof(struct direntry), compare_extension); - } - - file= filelist->filelist; - for(num=0; numnumfiles; num++, file++) { - file->flags &= ~HILITE; - } - BIF_filelist_filter(filelist); -} - - -void BIF_filelist_setipotype(struct FileList* filelist, short ipotype) -{ - filelist->ipotype = ipotype; -} - -void BIF_filelist_hasfunc(struct FileList* filelist, int has_func) -{ - filelist->has_func = has_func; -} - diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c deleted file mode 100644 index d4e41e56e75..00000000000 --- a/source/blender/src/filesel.c +++ /dev/null @@ -1,2611 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include -#include -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#ifdef WIN32 -#include -#include -#include "BLI_winstuff.h" -#else -#include -#include -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_linklist.h" -#include "BLI_storage_types.h" -#include "BLI_dynstr.h" - -#include "IMB_imbuf.h" - -#include "DNA_armature_types.h" -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_texture_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vfont_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_action.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_utildefines.h" - -#include "BIF_editview.h" -#include "BIF_filelist.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_language.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" - -#include "BLO_readfile.h" - -#include "BDR_editcurve.h" -#include "BDR_editobject.h" - -#include "BPI_script.h" -#include "BSE_filesel.h" -#include "BSE_view.h" - -#include "mydevice.h" -#include "blendef.h" -#include "nla.h" - -#include "BIF_fsmenu.h" /* include ourselves */ - -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif - -#if defined __BeOS -static int fnmatch(const char *pattern, const char *string, int flags) -{ - return 0; -} -#elif defined WIN32 && !defined _LIBC - /* use fnmatch included in blenlib */ - #include "BLI_fnmatch.h" -#else - #include -#endif - -#ifndef WIN32 -#include -#endif - -#define FILESELHEAD 60 -#define FILESEL_DY 16 - -/* for events */ -#define NOTACTIVE 0 -#define ACTIVATE 1 -#define INACTIVATE 2 -/* for state of file */ -#define ACTIVE 2 - -#define STARTSWITH(x, y) (strncmp(x, y, sizeof(x) - 1) == 0) - -/* button events */ -#define B_FS_FILENAME 1 -#define B_FS_DIRNAME 2 -#define B_FS_DIR_MENU 3 -#define B_FS_PARDIR 4 -#define B_FS_LOAD 5 -#define B_FS_CANCEL 6 -#define B_FS_LIBNAME 7 - -/* max length of library group name within filesel */ -#define GROUP_MAX 32 - -static int is_a_library(SpaceFile *sfile, char *dir, char *group); -static void do_library_append(SpaceFile *sfile); -static void library_to_filelist(SpaceFile *sfile); -static void filesel_select_objects(struct SpaceFile *sfile); -static void active_file_object(struct SpaceFile *sfile); -static int groupname_to_code(char *group); - -extern void countall(void); - -/* very bad local globals */ - -static rcti scrollrct, textrct, bar; -static int filebuty1, filebuty2, page_ofs, collumwidth, selecting=0; -static int filetoname= 0; -static float pixels_to_ofs; -static char otherdir[FILE_MAX]; -static ScrArea *otherarea; - -/* ******************* SORT ******************* */ - -static int compare_name(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - return (BLI_strcasecmp(entry1->relname,entry2->relname)); -} - -static int compare_date(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1; - if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1; - - else return BLI_strcasecmp(entry1->relname,entry2->relname); -} - -static int compare_size(const void *a1, const void *a2) -{ - const struct direntry *entry1=a1, *entry2=a2; - - /* type is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - - if ( entry1->s.st_size < entry2->s.st_size) return 1; - if ( entry1->s.st_size > entry2->s.st_size) return -1; - else return BLI_strcasecmp(entry1->relname,entry2->relname); -} - -static int compare_extension(const void *a1, const void *a2) { - const struct direntry *entry1=a1, *entry2=a2; - char *sufix1, *sufix2; - char *nil=""; - - if (!(sufix1= strstr (entry1->relname, ".blend.gz"))) - sufix1= strrchr (entry1->relname, '.'); - if (!(sufix2= strstr (entry2->relname, ".blend.gz"))) - sufix2= strrchr (entry2->relname, '.'); - if (!sufix1) sufix1= nil; - if (!sufix2) sufix2= nil; - - /* type is is equal to stat.st_mode */ - - if (S_ISDIR(entry1->type)){ - if (S_ISDIR(entry2->type)==0) return (-1); - } else{ - if (S_ISDIR(entry2->type)) return (1); - } - if (S_ISREG(entry1->type)){ - if (S_ISREG(entry2->type)==0) return (-1); - } else{ - if (S_ISREG(entry2->type)) return (1); - } - if ((entry1->type & S_IFMT) < (entry2->type & S_IFMT)) return (-1); - if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1); - - /* make sure "." and ".." are always first */ - if( strcmp(entry1->relname, ".")==0 ) return (-1); - if( strcmp(entry2->relname, ".")==0 ) return (1); - if( strcmp(entry1->relname, "..")==0 ) return (-1); - if( strcmp(entry2->relname, "..")==0 ) return (-1); - - return (BLI_strcasecmp(sufix1, sufix2)); -} - -/* **************************************** */ -static int filesel_has_func(SpaceFile *sfile) -{ - if(sfile->returnfunc || sfile->returnfunc_event || sfile->returnfunc_args) - return 1; - return 0; -} - -void filesel_statistics(SpaceFile *sfile, int *totfile, int *selfile, float *totlen, float *sellen) -{ - double len; - int a; - - *totfile= *selfile= 0; - *totlen= *sellen= 0; - - if(sfile->filelist==0) return; - - for(a=0; atotfile; a++) { - if( (sfile->filelist[a].type & S_IFDIR)==0 ) { - (*totfile) ++; - - len = sfile->filelist[a].s.st_size; - (*totlen) += (float)(len/1048576.0); - - if(sfile->filelist[a].flags & ACTIVE) { - (*selfile) ++; - (*sellen) += (float)(len/1048576.0); - } - } - } -} - -/* *************** HELP FUNCTIONS ******************* */ - - -/* not called when browsing .blend itself */ -void test_flags_file(SpaceFile *sfile) -{ - struct direntry *file; - int num; - - file= sfile->filelist; - - for(num=0; numtotfile; num++, file++) { - file->flags= 0; - file->type= file->s.st_mode; /* restore the mess below */ - - /* Don't check extensions for directories */ - if (file->type & S_IFDIR) - continue; - - if(sfile->type==FILE_BLENDER || sfile->type==FILE_LOADLIB) { - if(BLO_has_bfile_extension(file->relname)) { - file->flags |= BLENDERFILE; - - if(sfile->type==FILE_LOADLIB) { - char name[FILE_MAX]; - BLI_strncpy(name, sfile->dir, sizeof(name)); - strcat(name, file->relname); - - /* prevent current file being used as acceptable dir */ - if (BLI_streq(G.main->name, name)==0) { - file->type &= ~S_IFMT; - file->type |= S_IFDIR; - } - } - } - } else if (sfile->type==FILE_SPECIAL || sfile->type==FILE_LOADFONT){ - if(BLI_testextensie(file->relname, ".py")) { - file->flags |= PYSCRIPTFILE; - } else if( BLI_testextensie(file->relname, ".ttf") - || BLI_testextensie(file->relname, ".ttc") - || BLI_testextensie(file->relname, ".pfb") - || BLI_testextensie(file->relname, ".otf") - || BLI_testextensie(file->relname, ".otc")) { - file->flags |= FTFONTFILE; - } else if (G.have_libtiff && - (BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff"))) { - file->flags |= IMAGEFILE; - } else if (BLI_testextensie(file->relname, ".exr")) { - file->flags |= IMAGEFILE; - } else if (G.have_quicktime){ - if( BLI_testextensie(file->relname, ".jpg") - || BLI_testextensie(file->relname, ".jpeg") - || BLI_testextensie(file->relname, ".hdr") - || BLI_testextensie(file->relname, ".exr") - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".gif") - || BLI_testextensie(file->relname, ".psd") - || BLI_testextensie(file->relname, ".tif") - || BLI_testextensie(file->relname, ".tiff") - || BLI_testextensie(file->relname, ".pct") - || BLI_testextensie(file->relname, ".pict") - || BLI_testextensie(file->relname, ".pntg") //macpaint - || BLI_testextensie(file->relname, ".qtif") - || BLI_testextensie(file->relname, ".cin") - || BLI_testextensie(file->relname, ".dpx") - || BLI_testextensie(file->relname, ".sgi")) { - file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".flc") - || BLI_testextensie(file->relname, ".dv") - || BLI_testextensie(file->relname, ".mov") - || BLI_testextensie(file->relname, ".movie") - || BLI_testextensie(file->relname, ".mv")) { - file->flags |= MOVIEFILE; - } - } else { // no quicktime - if(BLI_testextensie(file->relname, ".jpg") - || BLI_testextensie(file->relname, ".hdr") - || BLI_testextensie(file->relname, ".exr") - || BLI_testextensie(file->relname, ".tga") - || BLI_testextensie(file->relname, ".rgb") - || BLI_testextensie(file->relname, ".bmp") - || BLI_testextensie(file->relname, ".png") -#ifdef WITH_DDS - || BLI_testextensie(file->relname, ".dds") -#endif - || BLI_testextensie(file->relname, ".iff") - || BLI_testextensie(file->relname, ".lbm") - || BLI_testextensie(file->relname, ".cin") - || BLI_testextensie(file->relname, ".dpx") - || BLI_testextensie(file->relname, ".sgi")) { - file->flags |= IMAGEFILE; - } - else if(BLI_testextensie(file->relname, ".avi") - || BLI_testextensie(file->relname, ".mv")) { - file->flags |= MOVIEFILE; - } - else if(BLI_testextensie(file->relname, ".wav")) { - file->flags |= SOUNDFILE; - } - } - } - } -} - - -void sort_filelist(SpaceFile *sfile) -{ - struct direntry *file; - int num;/* , act= 0; */ - - switch(sfile->sort) { - case FILE_SORTALPHA: - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name); - break; - case FILE_SORTDATE: - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_date); - break; - case FILE_SORTSIZE: - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_size); - break; - case FILE_SORTEXTENS: - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_extension); - } - - sfile->act= -1; - - file= sfile->filelist; - for(num=0; numtotfile; num++, file++) { - file->flags &= ~HILITE; - } - -} - -void read_dir(SpaceFile *sfile) -{ - int num, len; - char wdir[FILE_MAX]; - - /* sfile->act is used for example in databrowse: double names of library objects */ - sfile->act= -1; - - if(sfile->type==FILE_MAIN) { - main_to_filelist(sfile); - return; - } - else if(sfile->type==FILE_LOADLIB) { - library_to_filelist(sfile); - if(sfile->libfiledata) return; - } - - BLI_hide_dot_files(sfile->flag & FILE_HIDE_DOT); - - BLI_getwdN(wdir); - sfile->totfile= BLI_getdir(sfile->dir, &(sfile->filelist)); - chdir(wdir); - - if(sfile->sort!=FILE_SORTALPHA) sort_filelist(sfile); - - sfile->maxnamelen= 0; - - for (num=0; numtotfile; num++) { - - len = BMF_GetStringWidth(G.font, sfile->filelist[num].relname); - if (len > sfile->maxnamelen) sfile->maxnamelen = len; - - if(filetoname) { - if(strcmp(sfile->file, sfile->filelist[num].relname)==0) { - - sfile->ofs= num-( sfile->collums*(curarea->winy-FILESELHEAD-20)/(2*FILESEL_DY)); - filetoname= 0; - } - } - } - test_flags_file(sfile); - - filetoname= 0; -} - -void freefilelist(SpaceFile *sfile) -{ - int num; - - num= sfile->totfile-1; - - if (sfile->filelist==0) return; - - for(; num>=0; num--){ - MEM_freeN(sfile->filelist[num].relname); - - if (sfile->filelist[num].string) MEM_freeN(sfile->filelist[num].string); - } - free(sfile->filelist); - sfile->filelist= 0; -} - -static void split_sfile(SpaceFile *sfile, char *s1) -{ - char string[FILE_MAX], dir[FILE_MAX], file[FILE_MAX]; - - BLI_strncpy(string, s1, sizeof(string)); - - BLI_split_dirfile(string, dir, file); - - if(sfile->filelist) { - if(strcmp(dir, sfile->dir)!=0) { - freefilelist(sfile); - } - else test_flags_file(sfile); - } - BLI_strncpy(sfile->file, file, sizeof(sfile->file)); - - BLI_make_file_string(G.sce, sfile->dir, dir, ""); -} - - -void parent(SpaceFile *sfile) -{ - short a; - char *dir; - - /* if databrowse: no parent */ - if(sfile->type==FILE_MAIN && filesel_has_func(sfile)) return; - - dir= sfile->dir; - -#ifdef WIN32 - if( (a = strlen(dir)) ) { /* remove all '/' at the end */ - while(dir[a-1] == '\\') { - a--; - dir[a] = 0; - if (a<=0) break; - } - } - if( (a = strlen(dir)) ) { /* then remove all until '/' */ - while(dir[a-1] != '\\') { - a--; - dir[a] = 0; - if (a<=0) break; - } - } - if( (a = strlen(dir)) ) { - if (dir[a-1] != '\\') strcat(dir,"\\"); - } - else if(sfile->type!=FILE_MAIN) { - get_default_root(dir); - } -#else - if( (a = strlen(dir)) ) { /* remove all '/' at the end */ - while(dir[a-1] == '/') { - a--; - dir[a] = 0; - if (a<=0) break; - } - } - if( (a = strlen(dir)) ) { /* then remove until '/' */ - while(dir[a-1] != '/') { - a--; - dir[a] = 0; - if (a<=0) break; - } - } - if ( (a = strlen(dir)) ) { - if (dir[a-1] != '/') strcat(dir,"/"); - } - else if(sfile->type!=FILE_MAIN) strcpy(dir,"/"); -#endif - - /* to be sure */ - BLI_make_exist(sfile->dir); - - freefilelist(sfile); - sfile->ofs= 0; - scrarea_queue_winredraw(curarea); -} - -void swapselect_file(SpaceFile *sfile) -{ - struct direntry *file; - int num, act= 0; - - file= sfile->filelist; - for(num=0; numtotfile; num++, file++) { - if(file->flags & ACTIVE) { - act= 1; - break; - } - } - file= sfile->filelist+2; - for(num=2; numtotfile; num++, file++) { - if(act) file->flags &= ~ACTIVE; - else file->flags |= ACTIVE; - } -} - -static int find_active_file(SpaceFile *sfile, short x, short y) -{ - int ofs; - - if(y > textrct.ymax) y= textrct.ymax; - if(y <= textrct.ymin) y= textrct.ymin+1; - - ofs= (x-textrct.xmin)/collumwidth; - if(ofs<0) ofs= 0; - ofs*= (textrct.ymax-textrct.ymin); - - return sfile->ofs+ (ofs+textrct.ymax-y)/FILESEL_DY; - -} - - -/* ********************** DRAW ******************************* */ - -static void calc_file_rcts(SpaceFile *sfile) -{ - int tot, h, len; - float fac, start, totfile; - - scrollrct.xmin= 15; - scrollrct.xmax= 35; - scrollrct.ymin= 10; - scrollrct.ymax= curarea->winy-10-FILESELHEAD; - - textrct.xmin= scrollrct.xmax+10; - textrct.xmax= curarea->winx-10; - textrct.ymin= scrollrct.ymin; - textrct.ymax= scrollrct.ymax; - - if(textrct.xmax-textrct.xmin <60) textrct.xmax= textrct.xmin+60; - - len= (textrct.ymax-textrct.ymin) % FILESEL_DY; - textrct.ymin+= len; - scrollrct.ymin+= len; - - filebuty1= curarea->winy-FILESELHEAD; - filebuty2= filebuty1+FILESELHEAD/2 -6; - - - /* amount of collums */ - len= sfile->maxnamelen+25; - - if(sfile->type==FILE_MAIN) len+= 100; - else if(sfile->flag & FILE_SHOWSHORT) len+= 100; - else len+= 380; - - sfile->collums= (textrct.xmax-textrct.xmin)/len; - - if(sfile->collums<1) sfile->collums= 1; - else if(sfile->collums>8) sfile->collums= 8; - - /* this flag aint yet defined in user menu, needed? */ -// if((U.flag & USER_FSCOLLUM)==0) sfile->collums= 1; - - collumwidth= (textrct.xmax-textrct.xmin)/sfile->collums; - - - totfile= sfile->totfile + 0.5f; - - tot= (int)(FILESEL_DY*totfile); - if(tot) fac= ((float)sfile->collums*(scrollrct.ymax-scrollrct.ymin))/( (float)tot); - else fac= 1.0; - - if(sfile->ofs<0) sfile->ofs= 0; - - if(tot) start= ( (float)sfile->ofs)/(totfile); - else start= 0.0; - if(fac>1.0) fac= 1.0f; - - if(start+fac>1.0) { - sfile->ofs= (short)ceil((1.0-fac)*totfile); - start= ( (float)sfile->ofs)/(totfile); - fac= 1.0f-start; - } - - bar.xmin= scrollrct.xmin+2; - bar.xmax= scrollrct.xmax-2; - h= (scrollrct.ymax-scrollrct.ymin)-4; - bar.ymax= (int)(scrollrct.ymax-2- start*h); - bar.ymin= (int)(bar.ymax- fac*h); - - pixels_to_ofs= (totfile)/(float)(h+3); - page_ofs= (int)(fac*totfile); -} - -int filescrollselect= 0; - -static void draw_filescroll(SpaceFile *sfile) -{ - - if(scrollrct.ymin+10 >= scrollrct.ymax) return; - - BIF_ThemeColor(TH_BACK); - glRecti(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax); - - uiEmboss(scrollrct.xmin, scrollrct.ymin, scrollrct.xmax, scrollrct.ymax, 1); - - BIF_ThemeColor(TH_HEADER); - glRecti(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2); - - uiEmboss(bar.xmin+2, bar.ymin+2, bar.xmax-2, bar.ymax-2, filescrollselect); - -} - -static void linerect(int id, int x, int y) -{ - if(id & ACTIVE) { - if(id & HILITE) BIF_ThemeColorShade(TH_HILITE, 20); - else BIF_ThemeColor(TH_HILITE); - } - else if(id & HILITE) BIF_ThemeColorShade(TH_BACK, 20); - else BIF_ThemeColor(TH_BACK); - - glRects(x-17, y-3, x+collumwidth-21, y+11); - -} - -static void print_line(SpaceFile *sfile, struct direntry *files, int x, int y) -{ - int boxcol=0; - char *s; - - boxcol= files->flags & (HILITE + ACTIVE); - - if(boxcol) { - linerect(boxcol, x, y); - } - - // this is where the little boxes in the file view are being drawn according to the file type - if(files->flags & BLENDERFILE) { - cpack(0xA0A0); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & PSXFILE) { - cpack(0xA060B0); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & IMAGEFILE) { - cpack(0xF08040); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & MOVIEFILE) { - cpack(0x70A070); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & PYSCRIPTFILE) { - cpack(0x4477dd); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & SOUNDFILE) { - cpack(0xa0a000); - glRects(x-14, y, x-8, y+7); - } - else if(files->flags & FTFONTFILE) { - cpack(0xff2371); - glRects(x-14, y, x-8, y+7); - } - - if(S_ISDIR(files->type)) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - - s = files->string; - if(s) { - glRasterPos2i(x, y); -#ifdef WITH_ICONV - { - struct LANGMenuEntry *lme; - lme = find_language(U.language); - - if ((lme !=NULL) && (!strcmp(lme->code, "ja_JP") || - !strcmp(lme->code, "zh_CN"))) - { - BIF_RasterPos((float)x, (float)y); -#ifdef WIN32 - BIF_DrawString(G.font, files->relname, ((U.transopts & USER_TR_MENUS) | CONVERT_TO_UTF8)); -#else - BIF_DrawString(G.font, files->relname, (U.transopts & USER_TR_MENUS)); -#endif - } else { - BMF_DrawString(G.font, files->relname); - } - } -#else - BMF_DrawString(G.font, files->relname); -#endif /* WITH_ICONV */ - - x += sfile->maxnamelen + 100; - - glRasterPos2i(x - BMF_GetStringWidth(G.font, files->size), y); - BMF_DrawString(G.font, files->size); - - if(sfile->flag & FILE_SHOWSHORT) return; - -#ifndef WIN32 - /* rwx rwx rwx */ - x += 20; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->mode1); - - x += 30; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->mode2); - - x += 30; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->mode3); - - /* owner time date */ - x += 30; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->owner); -#endif - - x += 60; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->time); - - x += 50; glRasterPos2i(x, y); - BMF_DrawString(G.font, files->date); - } - else { - glRasterPos2i(x, y); - BMF_DrawString(G.font, files->relname); - - if(files->nr) { /* extra info */ - x+= sfile->maxnamelen+20; - glRasterPos2i(x, y); - BMF_DrawString(G.font, files->extra); - } - } -} - - -static int calc_filesel_line(SpaceFile *sfile, int nr, int *valx, int *valy) -{ - /* get screen coordinate of a line */ - int val, coll; - - nr-= sfile->ofs; - - /* amount of lines */ - val= (textrct.ymax-textrct.ymin)/FILESEL_DY; - if (val == 0) coll = 0; - else coll= nr/val; - nr -= coll*val; - - *valy= textrct.ymax-FILESEL_DY+3 - nr*FILESEL_DY; - *valx= coll*collumwidth + textrct.xmin+20; - - if(nr<0 || coll > sfile->collums) return 0; - return 1; -} - -static void set_active_file(SpaceFile *sfile, int act) -{ - struct direntry *file; - int num, redraw= 0; - unsigned int newflag; - int old=0, newi=0; - - file= sfile->filelist; - if(file==0) return; - - for(num=0; numtotfile; num++, file++) { - if(num==act) { - - if(selecting && num>1) { - newflag= HILITE | (file->flags & ~ACTIVE); - if(selecting==ACTIVATE) newflag |= ACTIVE; - - if(file->flags != newflag) redraw|= 1; - file->flags= newflag; - } - else { - if(file->flags & HILITE); - else { - file->flags |= HILITE; - redraw|= 2; - newi= num; - } - } - } - else { - if(file->flags & HILITE) { - file->flags &= ~HILITE; - redraw|= 2; - old= num; - } - } - - } - // removed frontbuffer draw here - if(redraw) { - scrarea_queue_winredraw(curarea); - } -} - - -static void draw_filetext(SpaceFile *sfile) -{ - struct direntry *files; - int a, x, y; - short mval[2]; - - if(textrct.ymin+10 >= textrct.ymax) return; - - - /* box */ - BIF_ThemeColor(TH_BACK); - glRecti(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax); - - /* collums */ - x= textrct.xmin+collumwidth; - for(a=1; acollums; a++, x+= collumwidth) { - cpack(0x303030); - sdrawline(x, textrct.ymin, x, textrct.ymax); - cpack(0xB0B0B0); - sdrawline(x+1, textrct.ymin, x+1, textrct.ymax); - } - - if(sfile->filelist==0) return; - - /* test: if mouse is not in area: clear HILITE */ - getmouseco_areawin(mval); - - if(mval[0]<0 || mval[0]>curarea->winx) { - files= sfile->filelist+sfile->ofs; - for(a= sfile->ofs; atotfile; a++, files++) files->flags &= ~HILITE; - } - - files= sfile->filelist+sfile->ofs; - for(a= sfile->ofs; atotfile; a++, files++) { - - if( calc_filesel_line(sfile, a, &x, &y)==0 ) break; - print_line(sfile, files, x, y); - } - - /* clear drawing errors, with text at the right hand side: */ - BIF_ThemeColor(TH_HEADER); - glRecti(textrct.xmax, textrct.ymin, textrct.xmax+10, textrct.ymax); - uiEmboss(textrct.xmin, textrct.ymin, textrct.xmax, textrct.ymax, 1); -} - -static char *library_string(void) -{ - Library *lib; - char *str; - int nr=0, tot= BLI_countlist(&G.main->library); - - if(tot==0) return NULL; - str= MEM_callocN(tot*(FILE_MAXDIR+FILE_MAX), "filesel lib menu"); - - for(tot=0, lib= G.main->library.first; lib; lib= lib->id.next, nr++) { - tot+= sprintf(str+tot, "%s %%x%d|", lib->name, nr); - } - return str; -} - -void drawfilespace(ScrArea *sa, void *spacedata) -{ - SpaceFile *sfile; - uiBlock *block; - float col[3]; - int act, loadbutton; - short mval[2]; - char name[20]; - char *menu, *strp= NULL; - - myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); - - BIF_GetThemeColor3fv(TH_HEADER, col); // basic undrawn color is border - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - sfile= sa->spacedata.first; - if(sfile->filelist==NULL) { - read_dir(sfile); - - calc_file_rcts(sfile); - - /* calculate act */ - getmouseco_areawin(mval); - act= find_active_file(sfile, mval[0], mval[1]); - if(act>=0 && acttotfile) - sfile->filelist[act].flags |= HILITE; - } - else calc_file_rcts(sfile); - - /* check if we load library, extra button */ - if(sfile->type==FILE_LOADLIB) - strp= library_string(); - - /* HEADER */ - sprintf(name, "win %d", sa->win); - block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->win); - - /* browse 1 datablock */ - uiSetButLock( sfile->type==FILE_MAIN && filesel_has_func(sfile), NULL); - - /* space available for load/save buttons? */ - loadbutton= MAX2(80, 20+BMF_GetStringWidth(G.font, sfile->title)); - if(textrct.xmax-textrct.xmin > loadbutton+20) { - if(sfile->title[0]==0) loadbutton= 0; - } - else loadbutton= 0; - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, B_FS_DIRNAME,"", textrct.xmin + (strp?20:0), filebuty2, textrct.xmax-textrct.xmin-loadbutton - (strp?20:0), 21, sfile->dir, 0.0, (float)FILE_MAXDIR-1, 0, 0, "Directory, enter a directory and press enter to create it"); /* Directory input */ - if(loadbutton) { - uiSetCurFont(block, UI_HELV); - uiDefBut(block, BUT, B_FS_LOAD, sfile->title, textrct.xmax-loadbutton, filebuty2, loadbutton, 21, sfile->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - } - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, B_FS_FILENAME,"", textrct.xmin, filebuty1, textrct.xmax-textrct.xmin-loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "File, increment version number with (+/-)"); /* File input */ - if(loadbutton) { - uiSetCurFont(block, UI_HELV); - uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", textrct.xmax-loadbutton, filebuty1, loadbutton, 21, sfile->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, ""); - } - uiBlockEndAlign(block); - - menu= fsmenu_build_menu(); - if(menu[0]) /* happens when no .Bfs is there, and first time browse */ - uiDefButS(block, MENU, B_FS_DIR_MENU, menu, scrollrct.xmin, filebuty1, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, ""); - MEM_freeN(menu); - - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_FS_PARDIR, "P", scrollrct.xmin, filebuty2, scrollrct.xmax-scrollrct.xmin, 21, 0, 0, 0, 0, 0, "Move to the parent directory (PKEY)"); - if(strp) { - uiDefIconTextButS(block, MENU, B_FS_LIBNAME, ICON_LIBRARY_DEHLT, strp, scrollrct.xmin+20, filebuty2, scrollrct.xmax-scrollrct.xmin, 21, &sfile->menu, 0, 0, 0, 0, ""); - MEM_freeN(strp); - } - - uiDrawBlock(block); - - draw_filescroll(sfile); - draw_filetext(sfile); - - /* others diskfree etc ? */ - scrarea_queue_headredraw(sa); - - myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375); - draw_area_emboss(sa); - - sa->win_swap= WIN_BACK_OK; -} - - -static void do_filescroll(SpaceFile *sfile) -{ - short mval[2], oldy, yo; - - calc_file_rcts(sfile); - - filescrollselect= 1; - - /* for beauty */ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - getmouseco_areawin(mval); - oldy= yo= mval[1]; - - while(get_mbut()&L_MOUSE) { - getmouseco_areawin(mval); - - if(yo!=mval[1]) { - int dy= floor(0.5+((float)(oldy-mval[1]))*pixels_to_ofs); - - if(dy) { - sfile->ofs+= dy; - if(sfile->ofs<0) { - sfile->ofs= 0; - oldy= mval[1]; - } - else oldy= floor(0.5+ (float)oldy - (float)dy/pixels_to_ofs); - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - } - - yo= mval[1]; - } - else BIF_wait_for_statechange(); - } - filescrollselect= 0; - - /* for beauty */ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - -} - -static void do_filescrollwheel(SpaceFile *sfile, int move) -{ - // by phase - int lines, rt; - - calc_file_rcts(sfile); - - lines = (int)(textrct.ymax-textrct.ymin)/FILESEL_DY; - rt = lines * sfile->collums; - - if(sfile->totfile > rt) { - sfile->ofs+= move; - if( sfile->ofs + rt > sfile->totfile + 1) - sfile->ofs = sfile->totfile - rt + 1; - } - - if(sfile->ofs<0) { - sfile->ofs= 0; - } -} - -/* the complete call; pulldown menu, and three callback types */ -static void activate_fileselect_(int type, char *title, char *file, short *menup, char *pupmenu, - void (*func)(char *), - void (*func_event)(unsigned short), - void (*func_args)(char *, void *arg1, void *arg2), - void *arg1, void *arg2) -{ - SpaceFile *sfile; - char group[GROUP_MAX], name[FILE_MAX], temp[FILE_MAX]; - - if(curarea==0) return; - if(curarea->win==0) return; - - newspace(curarea, SPACE_FILE); - scrarea_queue_winredraw(curarea); - - /* sometime double, when area already is SPACE_FILE with a different file name */ - if(curarea->headwin) addqueue(curarea->headwin, CHANGED, 1); - - name[2]= 0; - BLI_strncpy(name, file, sizeof(name)); - - sfile= curarea->spacedata.first; - - sfile->returnfunc= func; - sfile->returnfunc_event= func_event; - sfile->returnfunc_args= func_args; - sfile->arg1= arg1; - sfile->arg2= arg2; - - sfile->type= type; - sfile->ofs= 0; - - if(sfile->pupmenu) - MEM_freeN(sfile->pupmenu); - sfile->pupmenu= pupmenu; - sfile->menup= menup; - - /* sfile->act is used for databrowse: double names of library objects */ - sfile->act= -1; - - if(G.relbase_valid && BLI_convertstringcode(name, G.sce, G.scene->r.cfra)) - sfile->flag |= FILE_STRINGCODE; - else - sfile->flag &= ~FILE_STRINGCODE; - - if (U.uiflag & USER_HIDE_DOT) - sfile->flag |= FILE_HIDE_DOT; - - if(type==FILE_MAIN) { - char *groupname; - - BLI_strncpy(sfile->file, name+2, sizeof(sfile->file)); - - groupname = BLO_idcode_to_name( GS(name) ); - if (groupname) { - BLI_strncpy(sfile->dir, groupname, sizeof(sfile->dir) - 1); - strcat(sfile->dir, "/"); - } - - /* free all */ - if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata); - sfile->libfiledata= 0; - - freefilelist(sfile); - } - else if(type==FILE_LOADLIB) { - BLI_strncpy(sfile->dir, name, sizeof(sfile->dir)); - if( is_a_library(sfile, temp, group) ) { - /* force a reload of the library-filelist */ - freefilelist(sfile); - } - else { - split_sfile(sfile, name); - if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata); - sfile->libfiledata= NULL; - } - } - else { /* FILE_BLENDER or FILE_LOADFONT */ - split_sfile(sfile, name); /* test filelist too */ - BLI_cleanup_dir(G.sce, sfile->dir); - - /* free: filelist and libfiledata became incorrect */ - if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata); - sfile->libfiledata= 0; - } - BLI_strncpy(sfile->title, title, sizeof(sfile->title)); - filetoname= 1; -} - -void activate_fileselect(int type, char *title, char *file, void (*func)(char *)) -{ - activate_fileselect_(type, title, file, NULL, NULL, func, NULL, NULL, NULL, NULL); -} - -void activate_fileselect_menu(int type, char *title, char *file, char *pupmenu, short *menup, void (*func)(char *)) -{ - activate_fileselect_(type, title, file, menup, pupmenu, func, NULL, NULL, NULL, NULL); -} - -void activate_fileselect_args(int type, char *title, char *file, void (*func)(char *, void *, void *), void *arg1, void *arg2) -{ - activate_fileselect_(type, title, file, NULL, NULL, NULL, NULL, func, arg1, arg2); -} - -void activate_databrowse(ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short)) -{ - ListBase *lb; - SpaceFile *sfile; - char str[32]; - - if(id==NULL) { - lb= wich_libbase(G.main, idcode); - id= lb->first; - } - - if(id) BLI_strncpy(str, id->name, sizeof(str)); - else return; - - activate_fileselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, func, NULL, NULL, NULL); - - sfile= curarea->spacedata.first; - sfile->retval= retval; - sfile->ipotype= fromcode; -} - -void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short *menup, void (*func)(char *, void *, void *), void *arg1, void *arg2) -{ - ListBase *lb; - SpaceFile *sfile; - char str[32]; - - if(id==NULL) { - lb= wich_libbase(G.main, idcode); - id= lb->first; - } - - if(id) BLI_strncpy(str, id->name, sizeof(str)); - else return; - - activate_fileselect_(FILE_MAIN, "SELECT DATABLOCK", str, menup, NULL, NULL, NULL, func, arg1, arg2); - - sfile= curarea->spacedata.first; - sfile->ipotype= fromcode; -} - -void filesel_prevspace() -{ - SpaceFile *sfile= curarea->spacedata.first; - - /* cleanup */ - if(sfile->spacetype==SPACE_FILE) { - if(sfile->pupmenu) { - MEM_freeN(sfile->pupmenu); - sfile->pupmenu= NULL; - } - } - - if(sfile->next) { - - BLI_remlink(&curarea->spacedata, sfile); - BLI_addtail(&curarea->spacedata, sfile); - - sfile= curarea->spacedata.first; - - if (sfile->spacetype == SPACE_SCRIPT) { - SpaceScript *sc = (SpaceScript *)sfile; - if (sc->script) sc->script->flags &=~SCRIPT_FILESEL; - } - - newspace(curarea, sfile->spacetype); - } - else newspace(curarea, SPACE_INFO); -} - -static int countselect(SpaceFile *sfile) -{ - int a, count=0; - - for(a=0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - count++; - } - } - return count; -} - -static int getotherdir(void) -{ - ScrArea *sa; - SpaceFile *sfile=0; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa!=curarea) { - if(sa->spacetype==SPACE_FILE) { - - /* already found one */ - if(sfile) return 0; - - sfile= sa->spacedata.first; - - if(sfile->type & FILE_UNIX) { - otherarea= sa; - BLI_make_file_string(G.sce, otherdir, sfile->dir, ""); - } - else sfile= 0; - } - } - sa= sa->next; - } - if(sfile) return 1; - return 0; -} - -static void reread_other_fs(void) -{ - SpaceFile *sfile; - - /* watch it: only call when getotherdir returned OK */ - - sfile= otherarea->spacedata.first; - freefilelist(sfile); - scrarea_queue_winredraw(otherarea); -} - - -void free_filesel_spec(char *dir) -{ - /* all filesels with 'dir' are freed */ - bScreen *sc; - - sc= G.main->screen.first; - while(sc) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_FILE) { - SpaceFile *sfile= (SpaceFile*) sl; - if (BLI_streq(sfile->dir, dir)) { - freefilelist(sfile); - } - } - sl= sl->next; - } - sa= sa->next; - } - sc= sc->id.next; - } -} - -/* NOTE: this is called for file read, after the execfunc no UI memory is valid! */ -static void filesel_execute(SpaceFile *sfile) -{ - struct direntry *files; - char name[FILE_MAX]; - int a; - - filesel_prevspace(); - - if(sfile->type==FILE_LOADLIB) { - if(sfile->flag & FILE_STRINGCODE) { - if (!G.relbase_valid) { - okee("You have to save the .blend file before using relative paths! Using absolute path instead."); - sfile->flag &= ~FILE_STRINGCODE; - } - } - - do_library_append(sfile); - BIF_undo_push("Append from file"); - allqueue(REDRAWALL, 1); - } - else if(filesel_has_func(sfile)) { - fsmenu_insert_entry(sfile->dir, 1, 0); - - if(sfile->type==FILE_MAIN) { /* DATABROWSE */ - if (sfile->menup) { /* with value pointing to ID block index */ - int notfound = 1; - - /* Need special handling since hiding .* datablocks means that - sfile->act is no longer the same as files->nr. - - Also, toggle HIDE_DOT on and off can make sfile->act not longer - correct (meaning it doesn't point to the correct item in the filelist. - - sfile->file is always correct, so first with check if, for the item - corresponding to sfile->act, the name is the same. - - If it isn't (or if sfile->act is not good), go over filelist and take - the correct one. - - This means that selecting a datablock than hiding it makes it - unselectable. Not really a problem. - - - theeth - */ - - *sfile->menup= -1; - - if(sfile->act>=0) { - if(sfile->filelist) { - files= sfile->filelist+sfile->act; - if ( strcmp(files->relname, sfile->file)==0) { - notfound = 0; - *sfile->menup= files->nr; - } - } - } - if (notfound) { - for(a=0; atotfile; a++) { - if( strcmp(sfile->filelist[a].relname, sfile->file)==0) { - *sfile->menup= sfile->filelist[a].nr; - break; - } - } - } - } - if(sfile->returnfunc_event) - sfile->returnfunc_event(sfile->retval); - else if(sfile->returnfunc_args) - sfile->returnfunc_args(NULL, sfile->arg1, sfile->arg2); - } - else { - if(strncmp(sfile->title, "Save", 4)==0) free_filesel_spec(sfile->dir); - if(strncmp(sfile->title, "Export", 6)==0) free_filesel_spec(sfile->dir); - - BLI_strncpy(name, sfile->dir, sizeof(name)); - strcat(name, sfile->file); - - if(sfile->flag & FILE_STRINGCODE) { - /* still weak, but we don't want saving files to make relative paths */ - if(G.relbase_valid && strncmp(sfile->title, "Save", 4)) { - BLI_makestringcode(G.sce, name); - } else { - /* if we don't have a valid relative base (.blend file hasn't been saved yet) - then we don't save the path as relative (for texture images, background image). - Warning message not shown when saving files (doesn't make sense there) - */ - if (strncmp(sfile->title, "Save", 4)) { - printf("Relative path setting has been ignored because .blend file hasn't been saved yet.\n"); - } - sfile->flag &= ~FILE_STRINGCODE; - } - } - if(sfile->returnfunc) - sfile->returnfunc(name); - else if(sfile->returnfunc_args) - sfile->returnfunc_args(name, sfile->arg1, sfile->arg2); - } - } -} - -static void do_filesel_buttons(short event, SpaceFile *sfile) -{ - char butname[FILE_MAX]; - - if (event == B_FS_FILENAME) { - if (strchr(sfile->file, '*') || strchr(sfile->file, '?') || strchr(sfile->file, '[')) { - int i, match = FALSE; - - for (i = 2; i < sfile->totfile; i++) { - if (fnmatch(sfile->file, sfile->filelist[i].relname, 0) == 0) { - sfile->filelist[i].flags |= ACTIVE; - match = TRUE; - } - } - if (match) sfile->file[0] = '\0'; - if(sfile->type==FILE_MAIN) filesel_select_objects(sfile); - scrarea_queue_winredraw(curarea); - } - } - else if(event== B_FS_DIRNAME) { - /* reuse the butname variable */ - BLI_cleanup_dir(G.sce, sfile->dir); - - BLI_make_file_string(G.sce, butname, sfile->dir, ""); - BLI_strncpy(sfile->dir, butname, sizeof(sfile->dir)); - - /* strip the trailing slash if its a real dir */ - if (strlen(butname)!=1) - butname[strlen(butname)-1]=0; - - if(sfile->type & FILE_UNIX) { - if (!BLI_exists(butname)) { - if (okee("Makedir")) { - BLI_recurdir_fileops(butname); - if (!BLI_exists(butname)) parent(sfile); - } else parent(sfile); - } - } - freefilelist(sfile); - sfile->ofs= 0; - scrarea_queue_winredraw(curarea); - } - else if(event== B_FS_DIR_MENU) { - char *selected= fsmenu_get_entry(sfile->menu-1); - - /* which string */ - if (selected) { - BLI_strncpy(sfile->dir, selected, sizeof(sfile->dir)); - BLI_make_exist(sfile->dir); - BLI_cleanup_dir(G.sce, sfile->dir); - freefilelist(sfile); - sfile->ofs= 0; - scrarea_queue_winredraw(curarea); - } - - sfile->act= -1; - - } - else if(event== B_FS_PARDIR) - parent(sfile); - else if(event== B_FS_LOAD) { - if(sfile->type) - filesel_execute(sfile); - } - else if(event== B_FS_CANCEL) - filesel_prevspace(); - else if(event== B_FS_LIBNAME) { - Library *lib= BLI_findlink(&G.main->library, sfile->menu); - if(lib) { - BLI_strncpy(sfile->dir, lib->filename, sizeof(sfile->dir)); - BLI_make_exist(sfile->dir); - BLI_cleanup_dir(G.sce, sfile->dir); - freefilelist(sfile); - sfile->ofs= 0; - scrarea_queue_winredraw(curarea); - sfile->act= -1; - } - } - -} - -/****/ - -typedef void (*ReplaceFP)(ID *oldblock, ID *newblock); - -static void change_id_link(void *linkpv, void *newlinkv) { - ID **linkp= (ID**) linkpv; - ID *newlink= newlinkv; - - if (*linkp) { - (*linkp)->us--; - } - (*linkp)= newlink; - if (newlink) { - id_us_plus(newlink); - } -} - -static void replace_image(ID *oldblock, ID *newblock) { - Image *oldima= (Image*) oldblock; - Image *newima= (Image*) newblock; - bScreen *sc; - Scene *sce; - Tex *tex; - Mesh *me; - - for (tex= G.main->tex.first; tex; tex= tex->id.next) { - if (tex->env && tex->env->type == ENV_LOAD && tex->env->ima == oldima) - change_id_link(&tex->env->ima, newima); - if (tex->ima == oldima) - change_id_link(&tex->ima, newima); - } - - for (sce= G.main->scene.first; sce; sce= sce->id.next) { - if (sce->ima == oldima) - change_id_link(&sce->ima, newima); - } - - for (sc= G.main->screen.first; sc; sc= sc->id.next) { - ScrArea *sa; - - for (sa= sc->areabase.first; sa; sa= sa->next) { - SpaceLink *sl; - - for (sl= sa->spacedata.first; sl; sl= sl->next) { - if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d= (View3D*) sl; - BGpic *bgp= v3d->bgpic; - - if (bgp && bgp->ima == oldima) - change_id_link(&bgp->ima, newima); - } else if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima= (SpaceImage*) sl; - - if (sima->image == oldima) - change_id_link(&sima->image, newima); - } - } - } - } - - for (me= G.main->mesh.first; me; me= me->id.next) { - int i, a; - MTFace *tface; - - for(i=0; ifdata.totlayer; i++) { - if(me->fdata.layers[i].type == CD_MTFACE) { - tface= (MTFace*)me->fdata.layers[i].data; - - for (a=0; atotface; a++, tface++) { - if (tface->tpage == oldima) { - /* not change_id_link, tpage's aren't owners :( - * see hack below. - */ - tface->tpage= newima; - } - } - } - } - } - - /* Nasty hack, necessary because tpages don't act - * as a user, so there lots of image user count - * munging occurs... this will ensure the image - * really dies. - */ - oldima->id.us= 0; -} - -static void replace_material(ID *oldblock, ID *newblock) -{ - Material *old= (Material*) oldblock; - Material *new= (Material*) newblock; - Material ***matarar; - ID *id; - Object *ob; - int a; - - ob= G.main->object.first; - while(ob) { - if(ob->totcol && ob->id.lib==0) { - matarar= give_matarar(ob); - for(a=1; a<=ob->totcol; a++) { - if(ob->mat[a-1] == old) { - if(old) old->id.us--; - id_us_plus((ID *)new); - ob->mat[a-1]= new; - } - id= ob->data; - if( (*matarar)[a-1] == old && id->lib==0) { - if(old) old->id.us--; - id_us_plus((ID *)new); - (*matarar)[a-1]= new; - } - } - } - ob= ob->id.next; - } -} - -static ReplaceFP get_id_replace_function(int idcode) { - switch (idcode) { - case ID_MA: - return &replace_material; - case ID_IM: - return &replace_image; - default: - return NULL; - } -} - -static void databrowse_replace(SpaceFile *sfile, int idcode) -{ - ReplaceFP replace_func= get_id_replace_function(idcode); - - if (!replace_func) { - error("Replacing %s blocks is unsupported", BLO_idcode_to_name(idcode)); - } else if (sfile->act==-1) { - error("Select target with leftmouse"); - } else { - ID *target= (ID*) sfile->filelist[sfile->act].poin; - - if (target) { - char buf[128]; - - sprintf(buf, "Replace with %s: %s", BLO_idcode_to_name(idcode), target->name+2); - - if (okee(buf)) { - int i; - - for (i = 0; i totfile; i++) - if ((sfile->filelist[i].flags&ACTIVE) && sfile->filelist[i].poin!=target) - replace_func(sfile->filelist[i].poin, target); - } - } - } - - freefilelist(sfile); - scrarea_queue_winredraw(curarea); -} - -static void fs_fake_users(SpaceFile *sfile) -{ - ID *id; - int a; - - /* only for F4 DATABROWSE */ - if(filesel_has_func(sfile)) return; - - for(a=0; atotfile; a++) { - if(sfile->filelist[a].flags & ACTIVE) { - id= (ID *)sfile->filelist[a].poin; - if(id) { - if( id->flag & LIB_FAKEUSER) { - id->flag -= LIB_FAKEUSER; - id->us--; - } - else { - id->flag |= LIB_FAKEUSER; - id->us++; - } - } - } - } - freefilelist(sfile); - scrarea_queue_winredraw(curarea); -} - - -static int get_hilited_entry(SpaceFile *sfile) -{ - int a; - - for(a=0; atotfile; a++) { - if(sfile->filelist[a].flags & HILITE) { - return a; - } - } - return -1; -} - - -void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - static int acto=0; - SpaceFile *sfile; - int act, do_draw= 0, i, test, ret = 0; - short qual, mval[2]; - char str[FILE_MAX+12]; - - sfile= curarea->spacedata.first; - if(sfile==0) return; - if(sfile->filelist==0) { - return; - } - - if(curarea->win==0) return; - calc_file_rcts(sfile); - getmouseco_areawin(mval); - - /* prevent looping */ - if(selecting && !(get_mbut() & R_MOUSE)) selecting= 0; - - if(val) { - - if( event!=RETKEY && event!=PADENTER) - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - switch(event) { - - case UI_BUT_EVENT: - do_filesel_buttons(val, sfile); - break; - - case WHEELDOWNMOUSE: - do_filescrollwheel(sfile, U.wheellinescroll); - act= find_active_file(sfile, mval[0], mval[1]); - set_active_file(sfile, act); - do_draw= 1; - break; - case WHEELUPMOUSE: - do_filescrollwheel(sfile, -U.wheellinescroll); - act= find_active_file(sfile, mval[0], mval[1]); - set_active_file(sfile, act); - do_draw= 1; - break; - - case LEFTMOUSE: - case MIDDLEMOUSE: - if(mval[0]>scrollrct.xmin && mval[0]scrollrct.ymin && mval[1]textrct.xmin && mval[0]textrct.ymin && mval[1]act is used in databrowse: double names of library objects */ - - sfile->act= act= find_active_file(sfile, mval[0], mval[1]); - - if(act>=0 && acttotfile) { - if(S_ISDIR(sfile->filelist[act].type)) { - /* the path is too long and we are not going up! */ - if (strcmp(sfile->filelist[act].relname, ".") && - strcmp(sfile->filelist[act].relname, "..") && - strlen(sfile->dir) + strlen(sfile->filelist[act].relname) >= FILE_MAXDIR ) - { - error("Path too long, cannot enter this directory"); - } else { - strcat(sfile->dir, sfile->filelist[act].relname); - strcat(sfile->dir,"/"); - BLI_cleanup_dir(G.sce, sfile->dir); - freefilelist(sfile); - sfile->ofs= 0; - do_draw= 1; - } - } - else { - if( strcmp(sfile->file, sfile->filelist[act].relname)) { - char tmpstr[240]; - do_draw= 1; - BLI_strncpy(sfile->file, sfile->filelist[act].relname, sizeof(sfile->file)); - if (sfile->f_fp) { - sprintf (tmpstr, "%s%s", sfile->dir, sfile->file); - /* printf ("%s\n", tmpstr); */ - #ifdef INTERNATIONAL - if (!FTF_GetNewFont ((const unsigned char *)tmpstr, 0, U.fontsize)) - error ("No font file"); - #endif - } - } - if(event==MIDDLEMOUSE && sfile->type) filesel_execute(sfile); - } - } - } - break; - case RIGHTMOUSE: - act= find_active_file(sfile, mval[0], mval[1]); - acto= act; - if(act>=0 && acttotfile) { - - if (sfile->filelist[act].flags & ACTIVE) { - sfile->filelist[act].flags &= ~ACTIVE; - selecting = INACTIVATE; - } - else { - test= sfile->filelist[act].relname[0]; - if (act>=2 || test!='.') sfile->filelist[act].flags |= ACTIVE; - - selecting = ACTIVATE; - } - do_draw= 1; - } - break; - case MOUSEY: - act= find_active_file(sfile, mval[0], mval[1]); - if (act!=acto) { - set_active_file(sfile, act); - } - if(selecting && act!=acto) { - - while(1) { - if (acto >= 2 && acto < sfile->totfile) { - if (selecting == ACTIVATE) sfile->filelist[acto].flags |= ACTIVE; - else if (selecting == INACTIVATE) sfile->filelist[acto].flags &= ~ACTIVE; - } - if (acto < act) acto++; - else if (acto > act) acto--; - else break; - - } - - } - acto= act; - break; - - case PAGEUPKEY: - sfile->ofs-= page_ofs; - do_draw= 1; - break; - case PAGEDOWNKEY: - sfile->ofs+= page_ofs; - do_draw= 1; - break; - case HOMEKEY: - sfile->ofs= 0; - do_draw= 1; - break; - case ENDKEY: - sfile->ofs= sfile->totfile; - do_draw= 1; - break; - - case AKEY: - swapselect_file(sfile); - if(sfile->type==FILE_MAIN) filesel_select_objects(sfile); - do_draw= 1; - break; - - case BKEY: - case CKEY: - case LKEY: - if(event==LKEY && sfile->type==FILE_MAIN && (G.qual & LR_CTRLKEY)) { - databrowse_replace(sfile, groupname_to_code(sfile->dir)); - break; - } - /* pass */ - case MKEY: - if(sfile->type==FILE_MAIN) break; - - if(!countselect(sfile)) { - error("No files selected"); - break; - } - - if(!getotherdir()) { - error("No second fileselect"); - break; - } - - if (!strcmp(sfile->dir, otherdir)) { - error("Same directories"); - break; - } - - if(event==BKEY) sprintf(str, "Backup to %s", otherdir); - else if(event==CKEY) sprintf(str, "Copy to %s", otherdir); - else if(event==LKEY) sprintf(str, "Linked copy to %s", otherdir); - else if(event==MKEY) sprintf(str, "Move to %s", otherdir); - - if (!okee(str)) break; - - for (i = 0; itotfile; i++){ - if (sfile->filelist[i].flags & ACTIVE) { - BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[i].relname); - - if(event==BKEY) ret= BLI_backup(sfile->filelist[i].relname, sfile->dir, otherdir); - else if(event==CKEY) ret= BLI_copy_fileops(str, otherdir); - else if(event==LKEY) ret= BLI_link(str, otherdir); - else if(event==MKEY) ret= BLI_move(str, otherdir); - - if (ret) {error("Command failed, see console"); break;} - else sfile->filelist[i].flags &= ~ACTIVE; - } - } - do_draw= 1; - if(event==BKEY || event==MKEY) - freefilelist(sfile); - - reread_other_fs(); - - break; - - case XKEY: - test = get_hilited_entry(sfile); - - if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){ - BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[test].relname); - - if( okee("Remove %s", str) ) { - ret = BLI_delete(str, 0, 0); - if (ret) { - error("Command failed, see console"); - } else { - freefilelist(sfile); - do_draw= 1; - } - } - } - break; - - case RKEY: - if(sfile->type==FILE_MAIN) { - databrowse_replace(sfile, groupname_to_code(sfile->dir)); - break; - } - /* pass to TKEY! */ - - case TKEY: - if(sfile->type==FILE_MAIN) break; - - if(!countselect(sfile)) { - error("No files selected"); - break; - } - - if(event==TKEY) sprintf(str, "Touch"); - else if(event==RKEY) sprintf(str, "Remove from %s", sfile->dir); - - qual= G.qual; /* because after okee() you released the SHIFT */ - if (!okee(str)) break; - - for (i = 0; i totfile; i++) { - if (sfile->filelist[i].flags & ACTIVE) { - BLI_make_file_string(G.sce, str, sfile->dir, sfile->filelist[i].relname); - - if(event==TKEY) ret= BLI_touch(str); - else if(event==RKEY) { - if(qual & LR_SHIFTKEY) ret= BLI_delete(str, 0, 1); - else if(S_ISDIR(sfile->filelist[i].type)) ret= BLI_delete(str, 1, 0); - else ret= BLI_delete(str, 0, 0); - } - - if (ret) {error("Command failed, see console"); break;} - else sfile->filelist[i].flags &= ~ACTIVE; - } - } - do_draw= 1; - freefilelist(sfile); - - break; - - case PKEY: - if(G.qual & LR_SHIFTKEY) { - extern char bprogname[]; /* usiblender.c */ -#ifdef WIN32 - sprintf(str, "%s -a \"%s%s\"", bprogname, sfile->dir, sfile->file); -#else - sprintf(str, "\"%s\" -a \"%s%s\"", bprogname, sfile->dir, sfile->file); -#endif - system(str); - } - else - parent(sfile); - - break; - - case IKEY: - if(sfile->type==FILE_MAIN) break; - - sprintf(str, "$IMAGEEDITOR %s%s", sfile->dir, sfile->file); - system(str); - break; - - case EKEY: - if(sfile->type==FILE_MAIN) break; - - sprintf(str, "$WINEDITOR %s%s", sfile->dir, sfile->file); - system(str); - break; - - case FKEY: - if(sfile->type==FILE_MAIN) { - fs_fake_users(sfile); - } - break; - - case PADPLUSKEY: - case EQUALKEY: - if (G.qual & LR_CTRLKEY) BLI_newname(sfile->file, +100); - else if (G.qual & LR_SHIFTKEY) BLI_newname(sfile->file, +10); - else BLI_newname(sfile->file, +1); - - do_draw= 1; - break; - - case PADMINUS: - case MINUSKEY: - if (G.qual & LR_CTRLKEY) BLI_newname(sfile->file, -100); - else if (G.qual & LR_SHIFTKEY) BLI_newname(sfile->file, -10); - else BLI_newname(sfile->file, -1); - - do_draw= 1; - break; - - case BACKSLASHKEY: - case SLASHKEY: - if(sfile->type==FILE_MAIN) break; - -#ifdef WIN32 - BLI_strncpy(sfile->dir, "\\", sizeof(sfile->dir)); -#else - BLI_strncpy(sfile->dir, "/", sizeof(sfile->dir)); -#endif - freefilelist(sfile); - sfile->ofs= 0; - do_draw= 1; - break; - case PERIODKEY: - freefilelist(sfile); - do_draw= 1; - break; - case ESCKEY: - filesel_prevspace(); - break; - case PADENTER: - case RETKEY: - if(sfile->type) filesel_execute(sfile); - break; - } - } - else if(event==RIGHTMOUSE) { - selecting = NOTACTIVE; - if(sfile->type==FILE_MAIN) filesel_select_objects(sfile); - } - else if(event==LEFTMOUSE) { - if(sfile->type==FILE_MAIN) active_file_object(sfile); - } - - /* XXX, stupid patch, curarea can become undone - * because of file loading... fixme zr - */ - if(do_draw && curarea) scrarea_queue_winredraw(curarea); -} - - - - -/* ************* LIBRARY FILESEL ******************* */ - -static int groupname_to_code(char *group) -{ - char buf[GROUP_MAX]; - char *lslash; - - BLI_strncpy(buf, group, GROUP_MAX); - lslash= BLI_last_slash(buf); - if (lslash) - lslash[0]= '\0'; - - return BLO_idcode_from_name(buf); -} - -static int is_a_library(SpaceFile *sfile, char *dir, char *group) -{ - /* return ok when a blenderfile, in dir is the filename, - * in group the type of libdata - */ - int len; - char *fd; - - strcpy(dir, sfile->dir); - len= strlen(dir); - if(len<7) return 0; - if( dir[len-1] != '/' && dir[len-1] != '\\') return 0; - - group[0]= 0; - dir[len-1]= 0; - - /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); - - if(fd==0) return 0; - *fd= 0; - if(BLO_has_bfile_extension(fd+1)) { - /* the last part of the dir is a .blend file, no group follows */ - *fd= '/'; /* put back the removed slash separating the dir and the .blend file name */ - } - else { - char *gp = fd+1; // in case we have a .blend file, gp points to the group - - /* Find the last slash */ - fd= (strrchr(dir, '/')>strrchr(dir, '\\'))?strrchr(dir, '/'):strrchr(dir, '\\'); - if (!fd || !BLO_has_bfile_extension(fd+1)) return 0; - - /* now we know that we are in a blend file and it is safe to - assume that gp actually points to a group */ - if (BLI_streq("Screen", gp)==0) - BLI_strncpy(group, gp, GROUP_MAX); - } - return 1; -} - -static void do_library_append(SpaceFile *sfile) -{ - Library *lib; - char dir[FILE_MAX], group[GROUP_MAX]; - - if ( is_a_library(sfile, dir, group)==0 ) { - error("Not a library"); - } else if (!sfile->libfiledata) { - error("Library not loaded"); - } else if (group[0]==0) { - error("Nothing indicated"); - } else if (BLI_streq(G.main->name, dir)) { - error("Cannot use current file as library"); - } else { - Object *ob; - int idcode = groupname_to_code(group); - - if((sfile->flag & FILE_LINK)==0) - /* tag everything, all untagged data can be made local */ - flag_all_listbases_ids(LIB_APPEND_TAG, 1); - - BLO_library_append(sfile, dir, idcode); - - /* DISPLISTS? */ - ob= G.main->object.first; - while(ob) { - if(ob->id.lib) { - ob->recalc |= OB_RECALC; - } - ob= ob->id.next; - } - - /* and now find the latest append lib file */ - lib= G.main->library.first; - while(lib) { - if (BLI_streq(dir, lib->filename)) break; - lib= lib->id.next; - } - - /* make local */ - if(lib && (sfile->flag & FILE_LINK)==0) { - all_local(lib, 1); - /* important we unset, otherwise these object wont - * link into other scenes from this blend file */ - flag_all_listbases_ids(LIB_APPEND_TAG, 0); - } - - DAG_scene_sort(G.scene); - - /* in sfile->dir is the whole lib name */ - BLI_strncpy(G.lib, sfile->dir, sizeof(G.lib) ); - } -} - -static void library_to_filelist(SpaceFile *sfile) -{ - LinkNode *l, *names; - int ok, i, nnames, idcode; - char filename[FILE_MAX]; - char dir[FILE_MAX], group[GROUP_MAX]; - - /* name test */ - ok= is_a_library(sfile, dir, group); - if (!ok) { - /* free */ - if(sfile->libfiledata) BLO_blendhandle_close(sfile->libfiledata); - sfile->libfiledata= 0; - return; - } - - BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI - - /* there we go */ - /* for the time being only read filedata when libfiledata==0 */ - if (sfile->libfiledata==0) { - sfile->libfiledata= BLO_blendhandle_from_file(dir); // this sets G.sce, we dont want it - - if(sfile->libfiledata==0) return; - } - - idcode= groupname_to_code(group); - - // memory for strings is passed into filelist[i].relname - // and free'd in freefilelist - if (idcode) { - names= BLO_blendhandle_get_datablock_names(sfile->libfiledata, idcode); - } else { - names= BLO_blendhandle_get_linkable_groups(sfile->libfiledata); - } - - nnames= BLI_linklist_length(names); - - sfile->totfile= nnames + 2; - sfile->filelist= malloc(sfile->totfile * sizeof(*sfile->filelist)); - memset(sfile->filelist, 0, sfile->totfile * sizeof(*sfile->filelist)); - - sfile->filelist[0].relname= BLI_strdup("."); - sfile->filelist[0].type |= S_IFDIR; - sfile->filelist[1].relname= BLI_strdup(".."); - sfile->filelist[1].type |= S_IFDIR; - - for (i=0, l= names; inext) { - char *blockname= BLI_strdup(l->link); - - sfile->filelist[i + 2].relname= blockname; - if (!idcode) - sfile->filelist[i + 2].type |= S_IFDIR; - } - - BLI_linklist_free(names, free); - - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name); - - sfile->maxnamelen= 0; - for(i=0; itotfile; i++) { - int len = BMF_GetStringWidth(G.font, sfile->filelist[i].relname); - if (len > sfile->maxnamelen) - sfile->maxnamelen = len; - } - - BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change - -} - -/* ******************* DATA SELECT ********************* */ - -static void filesel_select_objects(SpaceFile *sfile) -{ - Object *ob; - Base *base; - Scene *sce; - int a; - - /* only when F4 DATABROWSE */ - if(filesel_has_func(sfile)) return; - - if( strcmp(sfile->dir, "Object/")==0 ) { - for(a=0; atotfile; a++) { - - ob= (Object *)sfile->filelist[a].poin; - - if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) { - if(sfile->filelist[a].flags & ACTIVE) ob->flag |= SELECT; - else ob->flag &= ~SELECT; - } - - } - base= FIRSTBASE; - while(base) { - base->flag= base->object->flag; - base= base->next; - } - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - } - else if( strcmp(sfile->dir, "Scene/")==0 ) { - - for(a=0; atotfile; a++) { - - sce= (Scene *)sfile->filelist[a].poin; - if(sce) { - if(sfile->filelist[a].flags & ACTIVE) sce->r.scemode |= R_BG_RENDER; - else sce->r.scemode &= ~R_BG_RENDER; - } - - } - allqueue(REDRAWBUTSSCENE, 0); - } -} - -static void active_file_object(SpaceFile *sfile) -{ - Object *ob; - - /* only when F4 DATABROWSE */ - if(filesel_has_func(sfile)) return; - - if( strcmp(sfile->dir, "Object/")==0 ) { - if(sfile->act >= 0) { - - ob= (Object *)sfile->filelist[sfile->act].poin; - - if(ob && (ob->flag & OB_RESTRICT_VIEW)==0) { - set_active_object(ob); - if(BASACT && BASACT->object==ob) { - BASACT->flag |= SELECT; - sfile->filelist[sfile->act].flags |= ACTIVE; - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - scrarea_queue_winredraw(curarea); - } - } - } - } -} - - -void main_to_filelist(SpaceFile *sfile) -{ - ID *id; - struct direntry *files, *firstlib = NULL; - ListBase *lb; - int a, fake, idcode, len, ok, totlib, totbl; - short hide = 0; - - if (sfile->flag & FILE_HIDE_DOT) - hide = 1; - - if(sfile->dir[0]=='/') sfile->dir[0]= 0; - - if(sfile->dir[0]) { - idcode= groupname_to_code(sfile->dir); - if(idcode==0) sfile->dir[0]= 0; - } - - if( sfile->dir[0]==0) { - - /* make directories */ - sfile->totfile= 24; - sfile->filelist= (struct direntry *)malloc(sfile->totfile * sizeof(struct direntry)); - - for(a=0; atotfile; a++) { - memset( &(sfile->filelist[a]), 0 , sizeof(struct direntry)); - sfile->filelist[a].type |= S_IFDIR; - } - - sfile->filelist[0].relname= BLI_strdup(".."); - sfile->filelist[1].relname= BLI_strdup("."); - sfile->filelist[2].relname= BLI_strdup("Scene"); - sfile->filelist[3].relname= BLI_strdup("Group"); - sfile->filelist[4].relname= BLI_strdup("Object"); - sfile->filelist[5].relname= BLI_strdup("Mesh"); - sfile->filelist[6].relname= BLI_strdup("Curve"); - sfile->filelist[7].relname= BLI_strdup("Metaball"); - sfile->filelist[8].relname= BLI_strdup("Material"); - sfile->filelist[9].relname= BLI_strdup("Texture"); - sfile->filelist[10].relname= BLI_strdup("Image"); - sfile->filelist[11].relname= BLI_strdup("Wave"); - sfile->filelist[12].relname= BLI_strdup("Lattice"); - sfile->filelist[13].relname= BLI_strdup("Lamp"); - sfile->filelist[14].relname= BLI_strdup("Camera"); - sfile->filelist[15].relname= BLI_strdup("Ipo"); - sfile->filelist[16].relname= BLI_strdup("World"); - sfile->filelist[17].relname= BLI_strdup("Screen"); - sfile->filelist[18].relname= BLI_strdup("VFont"); - sfile->filelist[19].relname= BLI_strdup("Text"); - sfile->filelist[20].relname= BLI_strdup("Armature"); - sfile->filelist[21].relname= BLI_strdup("Action"); - sfile->filelist[22].relname= BLI_strdup("NodeTree"); - sfile->filelist[23].relname= BLI_strdup("Brush"); - - qsort(sfile->filelist, sfile->totfile, sizeof(struct direntry), compare_name); - } - else { - - /* make files */ - idcode= groupname_to_code(sfile->dir); - - lb= wich_libbase(G.main, idcode ); - if(lb==0) return; - - id= lb->first; - sfile->totfile= 0; - while(id) { - if(filesel_has_func(sfile) && idcode==ID_IP) { - if(sfile->ipotype== ((Ipo *)id)->blocktype) sfile->totfile++; - } - else if (hide==0 || id->name[2] != '.') - sfile->totfile++; - - id= id->next; - } - - if(!filesel_has_func(sfile)) sfile->totfile+= 2; - sfile->filelist= (struct direntry *)malloc(sfile->totfile * sizeof(struct direntry)); - - files= sfile->filelist; - - if(!filesel_has_func(sfile)) { - memset( &(sfile->filelist[0]), 0 , sizeof(struct direntry)); - sfile->filelist[0].relname= BLI_strdup("."); - sfile->filelist[0].type |= S_IFDIR; - memset( &(sfile->filelist[1]), 0 , sizeof(struct direntry)); - sfile->filelist[1].relname= BLI_strdup(".."); - sfile->filelist[1].type |= S_IFDIR; - - files+= 2; - } - - id= lb->first; - totlib= totbl= 0; - - while(id) { - - ok= 0; - if(filesel_has_func(sfile) && idcode==ID_IP) { - if(sfile->ipotype== ((Ipo *)id)->blocktype) ok= 1; - } - else ok= 1; - - if(ok) { - - if (hide==0 || id->name[2] != '.') { - memset( files, 0 , sizeof(struct direntry)); - if(id->lib==NULL) - files->relname= BLI_strdup(id->name+2); - else { - char tmp[FILE_MAX], fi[FILE_MAXFILE]; - BLI_strncpy(tmp, id->lib->name, FILE_MAX); - BLI_splitdirstring(tmp, fi); - files->relname= MEM_mallocN(FILE_MAXFILE+32, "filename for lib"); - sprintf(files->relname, "%s / %s", fi, id->name+2); - } - - if(!filesel_has_func(sfile)) { /* F4 DATA BROWSE */ - if(idcode==ID_OB) { - if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVE; - } - else if(idcode==ID_SCE) { - if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVE; - } - } - files->nr= totbl+1; - files->poin= id; - fake= id->flag & LIB_FAKEUSER; - - if(id->lib && fake) sprintf(files->extra, "LF %d", id->us); - else if(id->lib) sprintf(files->extra, "L %d", id->us); - else if(fake) sprintf(files->extra, "F %d", id->us); - else sprintf(files->extra, " %d", id->us); - - if(id->lib) { - if(totlib==0) firstlib= files; - totlib++; - } - - files++; - } - totbl++; - } - - id= id->next; - } - - /* only qsort of libraryblokken */ - if(totlib>1) { - qsort(firstlib, totlib, sizeof(struct direntry), compare_name); - } - } - - sfile->maxnamelen= 0; - for(a=0; atotfile; a++) { - len = BMF_GetStringWidth(G.font, sfile->filelist[a].relname); - if (len > sfile->maxnamelen) sfile->maxnamelen = len; - - if(filetoname) { - if( strcmp(sfile->file, sfile->filelist[a].relname)==0) { - sfile->ofs= a-( sfile->collums*(curarea->winy-FILESELHEAD-10)/(2*FILESEL_DY)); - filetoname= 0; - if(filesel_has_func(sfile)) sfile->filelist[a].flags |= ACTIVE; - } - } - } -} - - -void clever_numbuts_filesel() -{ - SpaceFile *sfile; - char orgname[FILE_MAX+12]; - char filename[FILE_MAX+12]; - char newname[FILE_MAX+12]; - int test; - int len; - - sfile= curarea->spacedata.first; - - if(sfile->type==FILE_MAIN) return; - - len = 110; - test = get_hilited_entry(sfile); - - if (test != -1 && !(S_ISDIR(sfile->filelist[test].type))){ - BLI_make_file_string(G.sce, orgname, sfile->dir, sfile->filelist[test].relname); - BLI_strncpy(filename, sfile->filelist[test].relname, sizeof(filename)); - - add_numbut(0, TEX, "", 0, len, filename, "Rename File"); - - if( do_clever_numbuts("Rename File", 1, REDRAW) ) { - BLI_make_file_string(G.sce, newname, sfile->dir, filename); - - if( strcmp(orgname, newname) != 0 ) { - BLI_rename(orgname, newname); - freefilelist(sfile); - } - } - - scrarea_queue_winredraw(curarea); - } -} - diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c deleted file mode 100644 index e9609d40570..00000000000 --- a/source/blender/src/fluidsim.c +++ /dev/null @@ -1,1147 +0,0 @@ -/** - * fluidsim.c - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) Blender Foundation - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - - -#include -#include -#include - - -#include "MEM_guardedalloc.h" - -/* types */ -#include "DNA_curve_types.h" -#include "DNA_object_types.h" -#include "DNA_object_fluidsim.h" -#include "DNA_key_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_lattice_types.h" -#include "DNA_scene_types.h" -#include "DNA_camera_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "MTC_matrixops.h" - -#include "BKE_customdata.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_key.h" -#include "BKE_scene.h" -#include "BKE_object.h" -#include "BKE_softbody.h" -#include "BKE_utildefines.h" -#include "BKE_DerivedMesh.h" -#include "BKE_ipo.h" -#include "LBM_fluidsim.h" -// warning - double elbeem.h in intern/extern... -#include "elbeem.h" - -#include "BLI_editVert.h" -#include "BIF_editdeform.h" -#include "BIF_gl.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_cursors.h" -#include "BIF_interface.h" -#include "BSE_headerbuttons.h" - -#include "mydevice.h" -#include "blendef.h" -#include "SDL.h" -#include "SDL_thread.h" -#include "SDL_mutex.h" -#include - -#ifdef WIN32 /* Windos */ -//#include "BLI_winstuff.h" -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif -// SDL redefines main for SDL_main, not needed here... -#undef main - -#ifdef __APPLE__ /* MacOS X */ -#undef main -#endif - -// from DerivedMesh.c -void initElbeemMesh(struct Object *ob, int *numVertices, float **vertices, int *numTriangles, int **triangles, int useGlobalCoords); - -/* from header info.c */ -extern int start_progress_bar(void); -extern void end_progress_bar(void); -extern int progress_bar(float done, char *busy_info); - -double fluidsimViscosityPreset[6] = { - -1.0, /* unused */ - -1.0, /* manual */ - 1.0e-6, /* water */ - 5.0e-5, /* some (thick) oil */ - 2.0e-3, /* ca. honey */ - -1.0 /* end */ -}; - -char* fluidsimViscosityPresetString[6] = { - "UNUSED", /* unused */ - "UNUSED", /* manual */ - " = 1.0 * 10^-6", /* water */ - " = 5.0 * 10^-5", /* some (thick) oil */ - " = 2.0 * 10^-3", /* ca. honey */ - "INVALID" /* end */ -}; - -typedef struct { - DerivedMesh dm; - - // similar to MeshDerivedMesh - struct Object *ob; // pointer to parent object - float *extverts, *nors; // face normals, colors? - Mesh *fsmesh; // mesh struct to display (either surface, or original one) - char meshFree; // free the mesh afterwards? (boolean) -} fluidsimDerivedMesh; - - - -/* enable/disable overall compilation */ -#ifndef DISABLE_ELBEEM - - -/* ********************** fluid sim settings struct functions ********************** */ - -/* allocates and initializes general main data */ -FluidsimSettings *fluidsimSettingsNew(struct Object *srcob) -{ - //char blendDir[FILE_MAXDIR], blendFile[FILE_MAXFILE]; - FluidsimSettings *fss; - - /* this call uses derivedMesh methods... */ - if(srcob->type!=OB_MESH) return NULL; - - fss= MEM_callocN( sizeof(FluidsimSettings), "fluidsimsettings memory"); - - fss->type = 0; - fss->show_advancedoptions = 0; - - fss->resolutionxyz = 50; - fss->previewresxyz = 25; - fss->realsize = 0.03; - fss->guiDisplayMode = 2; // preview - fss->renderDisplayMode = 3; // render - - fss->viscosityMode = 2; // default to water - fss->viscosityValue = 1.0; - fss->viscosityExponent = 6; - fss->gravx = 0.0; - fss->gravy = 0.0; - fss->gravz = -9.81; - fss->animStart = 0.0; - fss->animEnd = 0.30; - fss->gstar = 0.005; // used as normgstar - fss->maxRefine = -1; - // maxRefine is set according to resolutionxyz during bake - - // fluid/inflow settings - fss->iniVelx = - fss->iniVely = - fss->iniVelz = 0.0; - - /* elubie: changed this to default to the same dir as the render output - to prevent saving to C:\ on Windows */ - BLI_strncpy(fss->surfdataPath, U.tempdir, FILE_MAX); - fss->orgMesh = (Mesh *)srcob->data; - fss->meshSurface = NULL; - fss->meshBB = NULL; - fss->meshSurfNormals = NULL; - - // first init of bounding box - fss->bbStart[0] = 0.0; - fss->bbStart[1] = 0.0; - fss->bbStart[2] = 0.0; - fss->bbSize[0] = 1.0; - fss->bbSize[1] = 1.0; - fss->bbSize[2] = 1.0; - fluidsimGetAxisAlignedBB(srcob->data, srcob->obmat, fss->bbStart, fss->bbSize, &fss->meshBB); - - // todo - reuse default init from elbeem! - fss->typeFlags = 0; - fss->domainNovecgen = 0; - fss->volumeInitType = 1; // volume - fss->partSlipValue = 0.0; - - fss->generateTracers = 0; - fss->generateParticles = 0.0; - fss->surfaceSmoothing = 1.0; - fss->surfaceSubdivs = 1.0; - fss->particleInfSize = 0.0; - fss->particleInfAlpha = 0.0; - - return fss; -} - -/* duplicate struct, analogous to free */ -static Mesh *fluidsimCopyMesh(Mesh *me) -{ - Mesh *dup = MEM_dupallocN(me); - - CustomData_copy(&me->vdata, &dup->vdata, CD_MASK_MESH, CD_DUPLICATE, me->totvert); - CustomData_copy(&me->edata, &dup->edata, CD_MASK_MESH, CD_DUPLICATE, me->totedge); - CustomData_copy(&me->fdata, &dup->fdata, CD_MASK_MESH, CD_DUPLICATE, me->totface); - - return dup; -} - -FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) -{ - FluidsimSettings *dupfss; - - if(!fss) return NULL; - dupfss = MEM_dupallocN(fss); - - if(fss->meshSurface) - dupfss->meshSurface = fluidsimCopyMesh(fss->meshSurface); - if(fss->meshBB) - dupfss->meshBB = fluidsimCopyMesh(fss->meshBB); - - if(fss->meshSurfNormals) dupfss->meshSurfNormals = MEM_dupallocN(fss->meshSurfNormals); - - return dupfss; -} - -/* free struct */ -static void fluidsimFreeMesh(Mesh *me) -{ - CustomData_free(&me->vdata, me->totvert); - CustomData_free(&me->edata, me->totedge); - CustomData_free(&me->fdata, me->totface); - - MEM_freeN(me); -} - -void fluidsimSettingsFree(FluidsimSettings *fss) -{ - if(fss->meshSurface) { - fluidsimFreeMesh(fss->meshSurface); - fss->meshSurface = NULL; - } - if(fss->meshBB) { - fluidsimFreeMesh(fss->meshBB); - fss->meshBB = NULL; - } - - if(fss->meshSurfNormals){ MEM_freeN(fss->meshSurfNormals); fss->meshSurfNormals=NULL; } - - MEM_freeN(fss); -} - - -/* helper function */ -void fluidsimGetGeometryObjFilename(struct Object *ob, char *dst) { //, char *srcname) { - //snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name); - snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name); -} - - - - -/* ******************************************************************************** */ -/* ********************** fluid sim channel helper functions ********************** */ -/* ******************************************************************************** */ - -// no. of entries for the two channel sizes -#define CHANNEL_FLOAT 1 -#define CHANNEL_VEC 3 - -#define FS_FREE_ONECHANNEL(c,str) { \ - if(c){ MEM_freeN(c); c=NULL; } \ -} // end ONE CHANN, debug: fprintf(stderr,"freeing " str " \n"); - -#define FS_FREE_CHANNELS { \ - FS_FREE_ONECHANNEL(timeAtIndex,"timeAtIndex");\ - FS_FREE_ONECHANNEL(timeAtFrame,"timeAtFrame");\ - FS_FREE_ONECHANNEL(channelDomainTime,"channelDomainTime"); \ - FS_FREE_ONECHANNEL(channelDomainGravity,"channelDomainGravity");\ - FS_FREE_ONECHANNEL(channelDomainViscosity,"channelDomainViscosity");\ - for(i=0;i<256;i++) { \ - FS_FREE_ONECHANNEL(channelObjMove[i][0],"channelObjMove0"); \ - FS_FREE_ONECHANNEL(channelObjMove[i][1],"channelObjMove1"); \ - FS_FREE_ONECHANNEL(channelObjMove[i][2],"channelObjMove2"); \ - FS_FREE_ONECHANNEL(channelObjInivel[i],"channelObjInivel"); \ - FS_FREE_ONECHANNEL(channelObjActive[i],"channelObjActive"); \ - } \ -} // end FS FREE CHANNELS - - -// simplify channels before printing -// for API this is done anyway upon init -#if 0 -static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char *str, int entries) -{ - int i,j; - int channelSize = paramsize; - - if(entries==3) { - elbeemSimplifyChannelVec3( channel, &channelSize); - } else if(entries==1) { - elbeemSimplifyChannelFloat( channel, &channelSize); - } else { - // invalid, cant happen? - } - - fprintf(file, " CHANNEL %s = \n", str); - for(i=0; ir.framelen; - if((entries<1) || (entries>3)) { - printf("fluidsimInitChannel::Error - invalid no. of entries: %d\n",entries); - entries = 1; - } - - cstr = "fluidsiminit_channelfloat"; - if(entries>1) cstr = "fluidsiminit_channelvec"; - channel = MEM_callocN( size* (entries+1)* sizeof(float), cstr ); - - if(ipo) { - for(j=0; jcurval; - } - } else { - for(i=1; i<=size; i++) { channel[(i-1)*(entries+1) + j] = defaults[j]; } - } - //printf("fluidsimInitChannel entry:%d , ",j); for(i=1; i<=size; i++) { printf(" val%d:%f ",i, channel[(i-1)*(entries+1) + j] ); } printf(" \n"); // DEBUG - } - // set time values - for(i=1; i<=size; i++) { - channel[(i-1)*(entries+1) + entries] = time[i]; - } - - *setchannel = channel; -} - -static void fluidsimInitMeshChannel(float **setchannel, int size, Object *obm, int vertices, float *time) { - float *channel = NULL; - int mallsize = size* (3*vertices+1); - int frame,i; - int numVerts=0, numTris=0; - int setsize = 3*vertices+1; - - channel = MEM_callocN( mallsize* sizeof(float), "fluidsim_meshchannel" ); - - //fprintf(stderr,"\n\nfluidsimInitMeshChannel size%d verts%d mallsize%d \n\n\n",size,vertices,mallsize); - for(frame=1; frame<=size; frame++) { - float *verts=NULL; - int *tris=NULL; - G.scene->r.cfra = frame; - scene_update_for_newframe(G.scene, G.scene->lay); - - initElbeemMesh(obm, &numVerts, &verts, &numTris, &tris, 1); - //fprintf(stderr,"\nfluidsimInitMeshChannel frame%d verts%d/%d \n\n",frame,vertices,numVerts); - for(i=0; i<3*vertices;i++) { - channel[(frame-1)*setsize + i] = verts[i]; - //fprintf(stdout," frame%d vert%d=%f \n",frame,i,verts[i]); - //if(i%3==2) fprintf(stdout,"\n"); - } - channel[(frame-1)*setsize + setsize-1] = time[frame]; - - MEM_freeN(verts); - MEM_freeN(tris); - } - *setchannel = channel; -} - - -/* ******************************************************************************** */ -/* ********************** simulation thread ************************* */ -/* ******************************************************************************** */ - -SDL_mutex *globalBakeLock=NULL; -int globalBakeState = 0; // 0 everything ok, -1 abort simulation, -2 sim error, 1 sim done -int globalBakeFrame = 0; - -// run simulation in seperate thread -static int fluidsimSimulateThread(void *unused) { // *ptr) { - //char* fnameCfgPath = (char*)(ptr); - int ret=0; - - ret = elbeemSimulate(); - SDL_mutexP(globalBakeLock); - if(globalBakeState==0) { - if(ret==0) { - // if no error, set to normal exit - globalBakeState = 1; - } else { - // simulation failed, display error - globalBakeState = -2; - } - } - SDL_mutexV(globalBakeLock); - return ret; -} - - -int runSimulationCallback(void *data, int status, int frame) { - //elbeemSimulationSettings *settings = (elbeemSimulationSettings*)data; - //printf("elbeem blender cb s%d, f%d, domainid:%d \n", status,frame, settings->domainId ); // DEBUG - - if(!globalBakeLock) return FLUIDSIM_CBRET_ABORT; - if(status==FLUIDSIM_CBSTATUS_NEWFRAME) { - SDL_mutexP(globalBakeLock); - globalBakeFrame = frame-1; - SDL_mutexV(globalBakeLock); - } - - //if((frameCounter==3) && (!frameStop)) { frameStop=1; return 1; } - - SDL_mutexP(globalBakeLock); - if(globalBakeState!=0) { - return FLUIDSIM_CBRET_ABORT; - } - SDL_mutexV(globalBakeLock); - return FLUIDSIM_CBRET_CONTINUE; -} - - -/* ******************************************************************************** */ -/* ********************** write fluidsim config to file ************************* */ -/* ******************************************************************************** */ - -void fluidsimBake(struct Object *ob) -{ - FILE *fileCfg; - int i; - struct Object *fsDomain = NULL; - FluidsimSettings *domainSettings; - struct Object *obit = NULL; /* object iterator */ - int origFrame = G.scene->r.cfra; - char debugStrBuffer[256]; - int dirExist = 0; - int gridlevels = 0; - int simAborted = 0; // was the simulation aborted by user? - int doExportOnly = 0; - char *exportEnvStr = "BLENDER_ELBEEMEXPORTONLY"; - const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp - //char *channelNames[3] = { "translation","rotation","scale" }; - - char *suffixConfig = "fluidsim.cfg"; - char *suffixSurface = "fluidsurface"; - char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings - char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings - char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access - int outStringsChanged = 0; // modified? copy back before baking - int haveSomeFluid = 0; // check if any fluid objects are set - - // config vars, inited before either export or run... - double calcViscosity = 0.0; - int noFrames; - double aniFrameTime; - float aniFrlen; - int channelObjCount; - float *bbStart = NULL; - float *bbSize = NULL; - float domainMat[4][4]; - float invDomMat[4][4]; - // channel data - int allchannelSize; // fixed by no. of frames - int startFrame = 1; // dont use G.scene->r.sfra here, always start with frame 1 - // easy frame -> sim time calc - float *timeAtFrame=NULL, *timeAtIndex=NULL; - // domain - float *channelDomainTime = NULL; - float *channelDomainViscosity = NULL; - float *channelDomainGravity = NULL; - // objects (currently max. 256 objs) - float *channelObjMove[256][3]; // object movments , 0=trans, 1=rot, 2=scale - float *channelObjInivel[256]; // initial velocities - float *channelObjActive[256]; // obj active channel - - if(getenv(strEnvName)) { - int dlevel = atoi(getenv(strEnvName)); - elbeemSetDebugLevel(dlevel); - snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); - elbeemDebugOut(debugStrBuffer); - } - if(getenv(exportEnvStr)) { - doExportOnly = atoi(getenv(exportEnvStr)); - snprintf(debugStrBuffer,256,"fluidsimBake::msg: Exporting mode set to '%d' due to envvar '%s'\n",doExportOnly, exportEnvStr); - elbeemDebugOut(debugStrBuffer); - } - - // make sure it corresponds to startFrame setting - // old: noFrames = G.scene->r.efra - G.scene->r.sfra +1; - noFrames = G.scene->r.efra - 0; - if(noFrames<=0) { - pupmenu("Fluidsim Bake Error%t|No frames to export - check your animation range settings. Aborted%x0"); - return; - } - - /* no object pointer, find in selected ones.. */ - if(!ob) { - Base *base; - for(base=G.scene->base.first; base; base= base->next) { - if ( ((base)->flag & SELECT) - // ignore layer setting for now? && ((base)->lay & G.vd->lay) - ) { - if((!ob)&&(base->object->fluidsimFlag & OB_FLUIDSIM_ENABLE)&&(base->object->type==OB_MESH)) { - if(base->object->fluidsimSettings->type == OB_FLUIDSIM_DOMAIN) { - ob = base->object; - } - } - } - } - // no domains found? - if(!ob) return; - } - - /* check if there's another domain... */ - for(obit= G.main->object.first; obit; obit= obit->id.next) { - if((obit->fluidsimFlag & OB_FLUIDSIM_ENABLE)&&(obit->type==OB_MESH)) { - if(obit->fluidsimSettings->type == OB_FLUIDSIM_DOMAIN) { - if(obit != ob) { - //snprintf(debugStrBuffer,256,"fluidsimBake::warning - More than one domain!\n"); elbeemDebugOut(debugStrBuffer); - pupmenu("Fluidsim Bake Error%t|There should be only one domain object! Aborted%x0"); - return; - } - } - } - } - /* these both have to be valid, otherwise we wouldnt be here */ - /* dont use ob here after...*/ - fsDomain = ob; - domainSettings = ob->fluidsimSettings; - ob = NULL; - /* rough check of settings... */ - if(domainSettings->previewresxyz > domainSettings->resolutionxyz) { - snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz); - elbeemDebugOut(debugStrBuffer); - domainSettings->previewresxyz = domainSettings->resolutionxyz; - } - // set adaptive coarsening according to resolutionxyz - // this should do as an approximation, with in/outflow - // doing this more accurate would be overkill - // perhaps add manual setting? - if(domainSettings->maxRefine <0) { - if(domainSettings->resolutionxyz>128) { - gridlevels = 2; - } else - if(domainSettings->resolutionxyz>64) { - gridlevels = 1; - } else { - gridlevels = 0; - } - } else { - gridlevels = domainSettings->maxRefine; - } - snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); - elbeemDebugOut(debugStrBuffer); - - // check if theres any fluid - // abort baking if not... - for(obit= G.main->object.first; obit; obit= obit->id.next) { - if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && - (obit->type==OB_MESH) && ( - (obit->fluidsimSettings->type == OB_FLUIDSIM_FLUID) || - (obit->fluidsimSettings->type == OB_FLUIDSIM_INFLOW) ) - ) { - haveSomeFluid = 1; - } - } - if(!haveSomeFluid) { - pupmenu("Fluidsim Bake Error%t|No fluid objects in scene... Aborted%x0"); - return; - } - - // prepare names... - strncpy(targetDir, domainSettings->surfdataPath, FILE_MAXDIR); - strncpy(newSurfdataPath, domainSettings->surfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce, 0); // fixed #frame-no - - strcpy(targetFile, targetDir); - strcat(targetFile, suffixConfig); - if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file - // make sure all directories exist - // as the bobjs use the same dir, this only needs to be checked - // for the cfg output - BLI_make_existing_file(targetFile); - - // check selected directory - // simply try to open cfg file for writing to test validity of settings - fileCfg = fopen(targetFile, "w"); - if(fileCfg) { - dirExist = 1; fclose(fileCfg); - // remove cfg dummy from directory test - if(!doExportOnly) { BLI_delete(targetFile, 0,0); } - } - - if((strlen(targetDir)<1) || (!dirExist)) { - char blendDir[FILE_MAXDIR+FILE_MAXFILE], blendFile[FILE_MAXDIR+FILE_MAXFILE]; - // invalid dir, reset to current/previous - strcpy(blendDir, G.sce); - BLI_splitdirstring(blendDir, blendFile); - if(strlen(blendFile)>6){ - int len = strlen(blendFile); - if( (blendFile[len-6]=='.')&& (blendFile[len-5]=='b')&& (blendFile[len-4]=='l')&& - (blendFile[len-3]=='e')&& (blendFile[len-2]=='n')&& (blendFile[len-1]=='d') ){ - blendFile[len-6] = '\0'; - } - } - // todo... strip .blend ? - snprintf(newSurfdataPath,FILE_MAXFILE+FILE_MAXDIR,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); - - snprintf(debugStrBuffer,256,"fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath); - elbeemDebugOut(debugStrBuffer); - outStringsChanged=1; - } - - // check if modified output dir is ok - if(outStringsChanged) { - char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256]; - int selection=0; - strcpy(dispmsg,"Output settings set to: '"); - strcat(dispmsg, newSurfdataPath); - strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0"); - - // ask user if thats what he/she wants... - selection = pupmenu(dispmsg); - if(selection<1) return; // 0 from menu, or -1 aborted - strcpy(targetDir, newSurfdataPath); - strncpy(domainSettings->surfdataPath, newSurfdataPath, FILE_MAXDIR); - BLI_convertstringcode(targetDir, G.sce, 0); // fixed #frame-no - } - - // -------------------------------------------------------------------------------------------- - // dump data for start frame - // CHECK more reasonable to number frames according to blender? - // dump data for frame 0 - G.scene->r.cfra = startFrame; - scene_update_for_newframe(G.scene, G.scene->lay); - - // init common export vars for both file export and run - for(i=0; i<256; i++) { - channelObjMove[i][0] = channelObjMove[i][1] = channelObjMove[i][2] = NULL; - channelObjInivel[i] = NULL; - channelObjActive[i] = NULL; - } - allchannelSize = G.scene->r.efra; // always use till last frame - aniFrameTime = (domainSettings->animEnd - domainSettings->animStart)/(double)noFrames; - // blender specific - scale according to map old/new settings in anim panel: - aniFrlen = G.scene->r.framelen; - if(domainSettings->viscosityMode==1) { - /* manual mode, visc=value/(10^-vexp) */ - calcViscosity = (1.0/pow(10.0,domainSettings->viscosityExponent)) * domainSettings->viscosityValue; - } else { - calcViscosity = fluidsimViscosityPreset[ domainSettings->viscosityMode ]; - } - - bbStart = fsDomain->fluidsimSettings->bbStart; - bbSize = fsDomain->fluidsimSettings->bbSize; - fluidsimGetAxisAlignedBB(fsDomain->data, fsDomain->obmat, bbStart, bbSize, &domainSettings->meshBB); - - // always init - { int timeIcu[1] = { FLUIDSIM_TIME }; - float timeDef[1] = { 1. }; - int gravIcu[3] = { FLUIDSIM_GRAV_X, FLUIDSIM_GRAV_Y, FLUIDSIM_GRAV_Z }; - float gravDef[3]; - int viscIcu[1] = { FLUIDSIM_VISC }; - float viscDef[1] = { 1. }; - - gravDef[0] = domainSettings->gravx; - gravDef[1] = domainSettings->gravy; - gravDef[2] = domainSettings->gravz; - - // time channel is a bit special, init by hand... - timeAtIndex = MEM_callocN( (allchannelSize+1)*1*sizeof(float), "fluidsiminit_timeatindex"); - for(i=0; i<=G.scene->r.efra; i++) { - timeAtIndex[i] = (float)(i-startFrame); - } - fluidsimInitChannel( &channelDomainTime, allchannelSize, timeAtIndex, timeIcu,timeDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB - // time channel is a multiplicator for aniFrameTime - if(channelDomainTime) { - for(i=0; ianimStart; // start at index 1 - if(channelDomainTime) { - for(i=2; i<=allchannelSize; i++) { - timeAtFrame[i] = timeAtFrame[i-1]+channelDomainTime[(i-1)*2+0]; - } - } else { - for(i=2; i<=allchannelSize; i++) { timeAtFrame[i] = timeAtFrame[i-1]+aniFrameTime; } - } - - fluidsimInitChannel( &channelDomainViscosity, allchannelSize, timeAtFrame, viscIcu,viscDef, domainSettings->ipo, CHANNEL_FLOAT ); // NDEB - if(channelDomainViscosity) { - for(i=0; iipo, CHANNEL_VEC ); - } // domain channel init - - // init obj movement channels - channelObjCount=0; - for(obit= G.main->object.first; obit; obit= obit->id.next) { - //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG - if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && - (obit->type==OB_MESH) && - (obit->fluidsimSettings->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH - (obit->fluidsimSettings->type != OB_FLUIDSIM_PARTICLE) ) { - - // cant use fluidsimInitChannel for obj channels right now, due - // to the special DXXX channels, and the rotation specialities - IpoCurve *icuex[3][3]; - //IpoCurve *par_icuex[3][3]; - int icuIds[3][3] = { - {OB_LOC_X, OB_LOC_Y, OB_LOC_Z}, - {OB_ROT_X, OB_ROT_Y, OB_ROT_Z}, - {OB_SIZE_X, OB_SIZE_Y, OB_SIZE_Z} - }; - // relative ipos - IpoCurve *icudex[3][3]; - //IpoCurve *par_icudex[3][3]; - int icudIds[3][3] = { - {OB_DLOC_X, OB_DLOC_Y, OB_DLOC_Z}, - {OB_DROT_X, OB_DROT_Y, OB_DROT_Z}, - {OB_DSIZE_X, OB_DSIZE_Y, OB_DSIZE_Z} - }; - int j,k; - float vals[3] = {0.0,0.0,0.0}; - int o = channelObjCount; - int inivelIcu[3] = { FLUIDSIM_VEL_X, FLUIDSIM_VEL_Y, FLUIDSIM_VEL_Z }; - float inivelDefs[3]; - int activeIcu[1] = { FLUIDSIM_ACTIVE }; - float activeDefs[1] = { 1 }; // default to on - - inivelDefs[0] = obit->fluidsimSettings->iniVelx; - inivelDefs[1] = obit->fluidsimSettings->iniVely; - inivelDefs[2] = obit->fluidsimSettings->iniVelz; - - // check & init loc,rot,size - for(j=0; j<3; j++) { - for(k=0; k<3; k++) { - icuex[j][k] = find_ipocurve(obit->ipo, icuIds[j][k] ); - icudex[j][k] = find_ipocurve(obit->ipo, icudIds[j][k] ); - //if(obit->parent) { - //par_icuex[j][k] = find_ipocurve(obit->parent->ipo, icuIds[j][k] ); - //par_icudex[j][k] = find_ipocurve(obit->parent->ipo, icudIds[j][k] ); - //} - } - } - - for(j=0; j<3; j++) { - channelObjMove[o][j] = MEM_callocN( allchannelSize*4*sizeof(float), "fluidsiminit_objmovchannel"); - for(i=1; i<=allchannelSize; i++) { - - for(k=0; k<3; k++) { - if(icuex[j][k]) { - // IPO exists, use it ... - calc_icu(icuex[j][k], aniFrlen*((float)i) ); - vals[k] = icuex[j][k]->curval; - if(obit->parent) { - // add parent transform, multiply scaling, add trafo&rot - //calc_icu(par_icuex[j][k], aniFrlen*((float)i) ); - //if(j==2) { vals[k] *= par_icuex[j][k]->curval; } - //else { vals[k] += par_icuex[j][k]->curval; } - } - } else { - // use defaults from static values - float setval=0.0; - if(j==0) { - setval = obit->loc[k]; - if(obit->parent){ setval += obit->parent->loc[k]; } - } else if(j==1) { - setval = ( 180.0*obit->rot[k] )/( 10.0*M_PI ); - if(obit->parent){ setval = ( 180.0*(obit->rot[k]+obit->parent->rot[k]) )/( 10.0*M_PI ); } - } else { - setval = obit->size[k]; - if(obit->parent){ setval *= obit->parent->size[k]; } - } - vals[k] = setval; - } - if(icudex[j][k]) { - calc_icu(icudex[j][k], aniFrlen*((float)i) ); - //vals[k] += icudex[j][k]->curval; - // add transform, multiply scaling, add trafo&rot - if(j==2) { vals[k] *= icudex[j][k]->curval; } - else { vals[k] += icudex[j][k]->curval; } - if(obit->parent) { - // add parent transform, multiply scaling, add trafo&rot - //calc_icu(par_icuex[j][k], aniFrlen*((float)i) ); - //if(j==2) { vals[k] *= par_icudex[j][k]->curval; } - //else { vals[k] += par_icudex[j][k]->curval; } - } - } - } // k - - for(k=0; k<3; k++) { - float set = vals[k]; - if(j==1) { // rot is downscaled by 10 for ipo !? - set = 360.0 - (10.0*set); - } - channelObjMove[o][j][(i-1)*4 + k] = set; - } // k - channelObjMove[o][j][(i-1)*4 + 3] = timeAtFrame[i]; - } - } - - fluidsimInitChannel( &channelObjInivel[o], allchannelSize, timeAtFrame, inivelIcu,inivelDefs, obit->fluidsimSettings->ipo, CHANNEL_VEC ); - fluidsimInitChannel( &channelObjActive[o], allchannelSize, timeAtFrame, activeIcu,activeDefs, obit->fluidsimSettings->ipo, CHANNEL_FLOAT ); - - channelObjCount++; - - } - } - - // init trafo matrix - MTC_Mat4CpyMat4(domainMat, fsDomain->obmat); - if(!Mat4Invert(invDomMat, domainMat)) { - snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); - elbeemDebugOut(debugStrBuffer); - // FIXME add fatal msg - FS_FREE_CHANNELS; - return; - } - - - // -------------------------------------------------------------------------------------------- - // start writing / exporting - strcpy(targetFile, targetDir); - strcat(targetFile, suffixConfig); - if(!doExportOnly) { strcat(targetFile,".tmp"); } // dont overwrite/delete original file - // make sure these directories exist as well - if(outStringsChanged) { - BLI_make_existing_file(targetFile); - } - - if(!doExportOnly) { - SDL_Thread *simthr = NULL; - - // perform simulation with El'Beem api and SDL threads - elbeemSimulationSettings fsset; - elbeemResetSettings(&fsset); - fsset.version = 1; - - // setup global settings - for(i=0 ; i<3; i++) fsset.geoStart[i] = bbStart[i]; - for(i=0 ; i<3; i++) fsset.geoSize[i] = bbSize[i]; - // simulate with 50^3 - fsset.resolutionxyz = (int)domainSettings->resolutionxyz; - fsset.previewresxyz = (int)domainSettings->previewresxyz; - // 10cm water domain - fsset.realsize = domainSettings->realsize; - fsset.viscosity = calcViscosity; - // earth gravity - fsset.gravity[0] = domainSettings->gravx; - fsset.gravity[1] = domainSettings->gravy; - fsset.gravity[2] = domainSettings->gravz; - // simulate 5 frames, each 0.03 seconds, output to ./apitest_XXX.bobj.gz - fsset.animStart = domainSettings->animStart; - fsset.aniFrameTime = aniFrameTime; - fsset.noOfFrames = noFrames - 1; // is otherwise subtracted in parser - strcpy(targetFile, targetDir); - strcat(targetFile, suffixSurface); - // defaults for compressibility and adaptive grids - fsset.gstar = domainSettings->gstar; - fsset.maxRefine = domainSettings->maxRefine; // check <-> gridlevels - fsset.generateParticles = domainSettings->generateParticles; - fsset.numTracerParticles = domainSettings->generateTracers; - fsset.surfaceSmoothing = domainSettings->surfaceSmoothing; - fsset.surfaceSubdivs = domainSettings->surfaceSubdivs; - fsset.farFieldSize = domainSettings->farFieldSize; - strcpy( fsset.outputPath, targetFile); - - // domain channels - fsset.channelSizeFrameTime = - fsset.channelSizeViscosity = - fsset.channelSizeGravity = allchannelSize; - fsset.channelFrameTime = channelDomainTime; - fsset.channelViscosity = channelDomainViscosity; - fsset.channelGravity = channelDomainGravity; - - fsset.runsimCallback = &runSimulationCallback; - fsset.runsimUserData = &fsset; - - if( (domainSettings->typeFlags&OB_FSBND_NOSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_NOSLIP; - else if((domainSettings->typeFlags&OB_FSBND_PARTSLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_PARTSLIP; - else if((domainSettings->typeFlags&OB_FSBND_FREESLIP)) fsset.domainobsType = FLUIDSIM_OBSTACLE_FREESLIP; - fsset.domainobsPartslip = domainSettings->partSlipValue; - fsset.generateVertexVectors = (domainSettings->domainNovecgen==0); - - // init blender trafo matrix - // fprintf(stderr,"elbeemInit - mpTrafo:\n"); - { int j; - for(i=0; i<4; i++) { - for(j=0; j<4; j++) { - fsset.surfaceTrafo[i*4+j] = invDomMat[j][i]; - // fprintf(stderr,"elbeemInit - mpTrafo %d %d = %f (%d) \n", i,j, fsset.surfaceTrafo[i*4+j] , (i*4+j) ); - } - } } - - // init solver with settings - elbeemInit(); - elbeemAddDomain(&fsset); - - // init objects - channelObjCount = 0; - for(obit= G.main->object.first; obit; obit= obit->id.next) { - //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG - if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && // if has to match 3 places! // CHECKMATCH - (obit->type==OB_MESH) && - (obit->fluidsimSettings->type != OB_FLUIDSIM_DOMAIN) && - (obit->fluidsimSettings->type != OB_FLUIDSIM_PARTICLE) - ) { - float *verts=NULL; - int *tris=NULL; - int numVerts=0, numTris=0; - int o = channelObjCount; - int deform = (obit->fluidsimSettings->domainNovecgen); // misused value - // todo - use blenderInitElbeemMesh - elbeemMesh fsmesh; - elbeemResetMesh( &fsmesh ); - fsmesh.type = obit->fluidsimSettings->type;; - // get name of object for debugging solver - fsmesh.name = obit->id.name; - - initElbeemMesh(obit, &numVerts, &verts, &numTris, &tris, 0); - fsmesh.numVertices = numVerts; - fsmesh.numTriangles = numTris; - fsmesh.vertices = verts; - fsmesh.triangles = tris; - - fsmesh.channelSizeTranslation = - fsmesh.channelSizeRotation = - fsmesh.channelSizeScale = - fsmesh.channelSizeInitialVel = - fsmesh.channelSizeActive = allchannelSize; - - fsmesh.channelTranslation = channelObjMove[o][0]; - fsmesh.channelRotation = channelObjMove[o][1]; - fsmesh.channelScale = channelObjMove[o][2]; - fsmesh.channelActive = channelObjActive[o]; - if( (fsmesh.type == OB_FLUIDSIM_FLUID) || - (fsmesh.type == OB_FLUIDSIM_INFLOW) ) { - fsmesh.channelInitialVel = channelObjInivel[o]; - fsmesh.localInivelCoords = ((obit->fluidsimSettings->typeFlags&OB_FSINFLOW_LOCALCOORD)?1:0); - } - - if( (obit->fluidsimSettings->typeFlags&OB_FSBND_NOSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_NOSLIP; - else if((obit->fluidsimSettings->typeFlags&OB_FSBND_PARTSLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_PARTSLIP; - else if((obit->fluidsimSettings->typeFlags&OB_FSBND_FREESLIP)) fsmesh.obstacleType = FLUIDSIM_OBSTACLE_FREESLIP; - fsmesh.obstaclePartslip = obit->fluidsimSettings->partSlipValue; - fsmesh.volumeInitType = obit->fluidsimSettings->volumeInitType; - fsmesh.obstacleImpactFactor = obit->fluidsimSettings->surfaceSmoothing; // misused value - - // animated meshes - if(deform) { - fsmesh.channelSizeVertices = allchannelSize; - fluidsimInitMeshChannel( &fsmesh.channelVertices, allchannelSize, obit, numVerts, timeAtFrame); - G.scene->r.cfra = startFrame; - scene_update_for_newframe(G.scene, G.scene->lay); - // remove channels - fsmesh.channelTranslation = - fsmesh.channelRotation = - fsmesh.channelScale = NULL; - } - - elbeemAddMesh(&fsmesh); - - if(verts) MEM_freeN(verts); - if(tris) MEM_freeN(tris); - if(fsmesh.channelVertices) MEM_freeN(fsmesh.channelVertices); - channelObjCount++; - } // valid mesh - } // objects - //domainSettings->type = OB_FLUIDSIM_DOMAIN; // enable for bake display again - //fsDomain->fluidsimFlag = OB_FLUIDSIM_ENABLE; // disable during bake - - globalBakeLock = SDL_CreateMutex(); - // set to neutral, -1 means user abort, -2 means init error - globalBakeState = 0; - globalBakeFrame = 0; - simthr = SDL_CreateThread(fluidsimSimulateThread, targetFile); - - if(!simthr) { - snprintf(debugStrBuffer,256,"fluidsimBake::error: Unable to create thread... running without one.\n"); - elbeemDebugOut(debugStrBuffer); - set_timecursor(0); - elbeemSimulate(); - } else { - int done = 0; - unsigned short event=0; - short val; - float noFramesf = (float)noFrames; - float percentdone = 0.0; - int lastRedraw = -1; - - start_progress_bar(); - - while(done==0) { - char busy_mess[80]; - - waitcursor(1); - - // lukep we add progress bar as an interim mesure - percentdone = globalBakeFrame / noFramesf; - sprintf(busy_mess, "baking fluids %d / %d |||", globalBakeFrame, (int) noFramesf); - progress_bar(percentdone, busy_mess ); - - SDL_Delay(2000); // longer delay to prevent frequent redrawing - SDL_mutexP(globalBakeLock); - if(globalBakeState != 0) done = 1; // 1=ok, <0=error/abort - SDL_mutexV(globalBakeLock); - - while(qtest()) { - event = extern_qread(&val); - if(event == ESCKEY) { - // abort... - SDL_mutexP(globalBakeLock); - done = -1; - globalBakeFrame = 0; - globalBakeState = -1; - simAborted = 1; - SDL_mutexV(globalBakeLock); - break; - } - } - - // redraw the 3D for showing progress once in a while... - if(lastRedraw!=globalBakeFrame) { - ScrArea *sa; - G.scene->r.cfra = startFrame+globalBakeFrame; - lastRedraw = globalBakeFrame; - update_for_newframe_muted(); - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype == SPACE_VIEW3D) { scrarea_do_windraw(sa); } - sa= sa->next; - } - screen_swapbuffers(); - } // redraw - } - SDL_WaitThread(simthr,NULL); - end_progress_bar(); - } - SDL_DestroyMutex(globalBakeLock); - globalBakeLock = NULL; - } // El'Beem API init, thread creation - // -------------------------------------------------------------------------------------------- - else - { // write config file to be run with command line simulator - pupmenu("Fluidsim Bake Message%t|Config file export not supported.%x0"); - } // config file export done! - - // -------------------------------------------------------------------------------------------- - FS_FREE_CHANNELS; - - // go back to "current" blender time - waitcursor(0); - G.scene->r.cfra = origFrame; - scene_update_for_newframe(G.scene, G.scene->lay); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - - if(!simAborted) { - char fsmessage[512]; - char elbeemerr[256]; - strcpy(fsmessage,"Fluidsim Bake Error: "); - // check if some error occurred - if(globalBakeState==-2) { - strcat(fsmessage,"Failed to initialize [Msg: "); - - elbeemGetErrorString(elbeemerr); - strcat(fsmessage,elbeemerr); - - strcat(fsmessage,"] |OK%x0"); - pupmenu(fsmessage); - } // init error - } -} - - -#else /* DISABLE_ELBEEM */ - -/* compile dummy functions for disabled fluid sim */ - -FluidsimSettings *fluidsimSettingsNew(struct Object *srcob) { - return NULL; -} - -void fluidsimSettingsFree(FluidsimSettings *fss) { -} - -FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *fss) { - return NULL; -} - -/* only compile dummy functions */ -void fluidsimBake(struct Object *ob) { -} - -#endif /* DISABLE_ELBEEM */ - diff --git a/source/blender/src/fsmenu.c b/source/blender/src/fsmenu.c deleted file mode 100644 index 319fb8de48f..00000000000 --- a/source/blender/src/fsmenu.c +++ /dev/null @@ -1,257 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_linklist.h" -#include "BLI_dynstr.h" -#include "BIF_usiblender.h" - - -#include "BIF_fsmenu.h" /* include ourselves */ - - -/* FSMENU HANDLING */ - - /* FSMenuEntry's without paths indicate seperators */ -typedef struct _FSMenuEntry FSMenuEntry; -struct _FSMenuEntry { - FSMenuEntry *next; - - char *path; - short save; -}; - -static FSMenuEntry *fsmenu= 0; - -int fsmenu_get_nentries(void) -{ - FSMenuEntry *fsme; - int count= 0; - - for (fsme= fsmenu; fsme; fsme= fsme->next) - count++; - - return count; -} -int fsmenu_is_entry_a_seperator(int idx) -{ - FSMenuEntry *fsme; - - for (fsme= fsmenu; fsme && idx; fsme= fsme->next) - idx--; - - return (fsme && !fsme->path)?1:0; -} -char *fsmenu_get_entry(int idx) -{ - FSMenuEntry *fsme; - - for (fsme= fsmenu; fsme && idx; fsme= fsme->next) - idx--; - - return fsme?fsme->path:NULL; -} -char *fsmenu_build_menu(void) -{ - DynStr *ds= BLI_dynstr_new(); - FSMenuEntry *fsme; - char *menustr; - - for (fsme= fsmenu; fsme; fsme= fsme->next) { - if (!fsme->path) { - /* clean consecutive seperators and ignore trailing ones */ - if (fsme->next) { - if (fsme->next->path) { - BLI_dynstr_append(ds, "%l|"); - } else { - FSMenuEntry *next= fsme->next; - fsme->next= next->next; - MEM_freeN(next); - } - } - } else { - if (fsme->save) { - BLI_dynstr_append(ds, "o "); - } else { - BLI_dynstr_append(ds, " "); - } - BLI_dynstr_append(ds, fsme->path); - if (fsme->next) BLI_dynstr_append(ds, "|"); - } - } - - menustr= BLI_dynstr_get_cstring(ds); - BLI_dynstr_free(ds); - return menustr; -} -static FSMenuEntry *fsmenu_get_last_separator(void) -{ - FSMenuEntry *fsme, *lsep=NULL; - - for (fsme= fsmenu; fsme; fsme= fsme->next) - if (!fsme->path) - lsep= fsme; - - return lsep; -} - -static FSMenuEntry *fsmenu_get_first_separator(void) -{ - FSMenuEntry *fsme, *lsep=NULL; - - for (fsme= fsmenu; fsme; fsme= fsme->next) - if (!fsme->path) { - lsep= fsme; - break; - } - - return lsep; -} - -void fsmenu_insert_entry(char *path, int sorted, short save) -{ - FSMenuEntry *prev; - FSMenuEntry *fsme; - - if (save) { - prev = fsmenu_get_first_separator(); - } else { - prev = fsmenu_get_last_separator(); - } - fsme= prev?prev->next:fsmenu; - - for (; fsme; prev= fsme, fsme= fsme->next) { - if (fsme->path) { - if (BLI_streq(path, fsme->path)) { - return; - } else if (sorted && strcmp(path, fsme->path)<0) { - break; - } - } else { - // if we're bookmarking this, file should come - // before the last separator, only automatically added - // current dir go after the last sep. - if (save) { - break; - } - } - } - - fsme= MEM_mallocN(sizeof(*fsme), "fsme"); - fsme->path= BLI_strdup(path); - fsme->save = save; - - if (prev) { - fsme->next= prev->next; - prev->next= fsme; - } else { - fsme->next= fsmenu; - fsmenu= fsme; - } -} -void fsmenu_append_separator(void) -{ - if (fsmenu) { - FSMenuEntry *fsme= fsmenu; - - while (fsme->next) fsme= fsme->next; - - fsme->next= MEM_mallocN(sizeof(*fsme), "fsme"); - fsme->next->next= NULL; - fsme->next->path= NULL; - } -} -void fsmenu_remove_entry(int idx) -{ - FSMenuEntry *prev= NULL, *fsme= fsmenu; - - for (fsme= fsmenu; fsme && idx; prev= fsme, fsme= fsme->next) - idx--; - - if (fsme) { - /* you should only be able to remove entries that were - not added by default, like windows drives. - also separators (where path == NULL) shouldn't be removed */ - if (fsme->save && fsme->path) { - - /* remove fsme from list */ - if (prev) { - prev->next= fsme->next; - } else { - fsmenu= fsme->next; - } - /* free entry */ - MEM_freeN(fsme->path); - MEM_freeN(fsme); - } - } -} - -void fsmenu_write_file(const char *filename) -{ - FSMenuEntry *fsme= fsmenu; - - FILE *fp = fopen(filename, "w"); - if (!fp) return; - - for (fsme= fsmenu; fsme; fsme= fsme->next) { - if (fsme->path && fsme->save) { - fprintf(fp, "%s\n", fsme->path); - } - } - fclose(fp); -} - -void fsmenu_free(void) -{ - FSMenuEntry *fsme= fsmenu; - - while (fsme) { - FSMenuEntry *n= fsme->next; - - if (fsme->path) MEM_freeN(fsme->path); - MEM_freeN(fsme); - - fsme= n; - } -} - - - diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c deleted file mode 100644 index 597a23a20d7..00000000000 --- a/source/blender/src/ghostwinlay.c +++ /dev/null @@ -1,835 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_listBase.h" -#include "DNA_userdef_types.h" /* U.flag & TWOBUTTONMOUSE */ - -#include "BLI_blenlib.h" - -#include "GHOST_C-api.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_usiblender.h" -#include "BIF_cursors.h" - -#include "mydevice.h" -#include "blendef.h" - -#include "winlay.h" - -#ifdef __APPLE__ -#include -#define __CARBONSOUND__ - /* XXX BIG WARNING: carbon.h should not be included in blender/src code, it conflicts with struct ID */ -#define ID ID_ -#include - -/*declarations*/ -int checkAppleVideoCard(void); -void getMacAvailableBounds(short *, short *, short *, short *); - -#endif -/// - -struct _Window { - GHOST_WindowHandle ghostwin; - - /* Handler and private data for handler */ - WindowHandlerFP handler; - void *user_data; - - /* Window state */ - int size[2], position[2]; - int active, visible; - - /* Last known mouse/button/qualifier state */ - int lmouse[2]; - int lqual; /* (LR_SHFTKEY, LR_CTRLKEY, LR_ALTKEY, LR_COMMANDKEY) */ - int lmbut; /* (L_MOUSE, M_MOUSE, R_MOUSE) */ - - /* xtilt and ytilt represent how much the pen is tilted away from - * vertically upright in either the X or Y direction, with X and Y the - * axes of the tablet surface. - * In other words, Xtilt and Ytilt are components of a vector created by projecting - * the pen's angle in 3D space vertically downwards on to the XY plane - * --Matt - */ - float pressure; /* tablet pressure - 0.0 (no pressure) to 1.0 (full pressure) */ - /* mouse clicks and non-contacting stylus buttons generate pressure of 0.0. */ - float xtilt, ytilt; /* tablet tilt value - x and y components of 3D angle - * ranging from 0.0 (pen upright) to 1.0 (pen fully leaning over) */ - short activedevice; /* Active input device currently in use (DEV_MOUSE, DEV_STYLUS, DEV_ERASER) */ - - - /* Tracks the faked mouse button, if non-zero it is - * the event number of the last faked button. - */ - int faked_mbut; - - GHOST_TimerTaskHandle timer; - int timer_event; -}; - -/// - -#ifdef __APPLE__ - -/* to avoid killing small end comps, we want to allow - blender to start maximised if all the followings are true : - - Renderer is OpenGL capable - - Hardware acceleration - - VRAM > 16 Mo - - we will bail out if VRAM is less than 8Mo - */ - -static int macPrefState = 0; - -int checkAppleVideoCard(void) { - long theErr; - unsigned long display_mask; - CGLRendererInfoObj rend; - long nrend; - int j; - long value; - long maxvram = 0; /* we get always more than 1 renderer, check one, at least, has 8 Mo */ - - display_mask = CGDisplayIDToOpenGLDisplayMask (CGMainDisplayID() ); - - theErr = CGLQueryRendererInfo( display_mask, &rend, &nrend); - if (theErr == 0) { - theErr = CGLDescribeRenderer (rend, 0, kCGLRPRendererCount, &nrend); - if (theErr == 0) { - for (j = 0; j < nrend; j++) { - theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value); - if (value > maxvram) - maxvram = value; - if ((theErr == 0) && (value >= 20000000)) { - theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value); - if ((theErr == 0) && (value != 0)) { - theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value); - if ((theErr == 0) && (value != 0)) { - /*fprintf(stderr,"make it big\n");*/ - CGLDestroyRendererInfo (rend); - macPrefState = 8; - return 1; - } - } - } - } - } - } - if (maxvram < 7500000 ) { /* put a standard alert and quit*/ - SInt16 junkHit; - char inError[] = "* Not enough VRAM "; - char inText[] = "* blender needs at least 8Mb "; - inError[0] = 16; - inText[0] = 28; - - fprintf(stderr, " vram is %li . not enough, aborting\n", maxvram); - StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit); - abort(); - } - CGLDestroyRendererInfo (rend); - return 0; -} - -void getMacAvailableBounds(short *top, short *left, short *bottom, short *right) { - Rect outAvailableRect; - - GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect); - - *top = outAvailableRect.top; - *left = outAvailableRect.left; - *bottom = outAvailableRect.bottom; - *right = outAvailableRect.right; -} - -#endif - - -static GHOST_SystemHandle g_system= 0; - - /* Some simple ghost <-> blender conversions */ - -static GHOST_TStandardCursor convert_cursor(int curs) { - switch(curs) { - default: - case CURSOR_STD: return GHOST_kStandardCursorDefault; - case CURSOR_VPAINT: return GHOST_kStandardCursorRightArrow; - case CURSOR_FACESEL: return GHOST_kStandardCursorRightArrow; - case CURSOR_WAIT: return GHOST_kStandardCursorWait; - case CURSOR_EDIT: return GHOST_kStandardCursorCrosshair; - case CURSOR_HELP: return GHOST_kStandardCursorHelp; - case CURSOR_X_MOVE: return GHOST_kStandardCursorLeftRight; - case CURSOR_Y_MOVE: return GHOST_kStandardCursorUpDown; - case CURSOR_PENCIL: return GHOST_kStandardCursorPencil; - } -} - -static int convert_mbut(GHOST_TButtonMask but) { - if (but == GHOST_kButtonMaskLeft) { - return LEFTMOUSE; - } else if (but == GHOST_kButtonMaskRight) { - return RIGHTMOUSE; - } else { - return MIDDLEMOUSE; - } -} - -static int convert_key(GHOST_TKey key) { - if (key>=GHOST_kKeyA && key<=GHOST_kKeyZ) { - return (AKEY + ((int) key - GHOST_kKeyA)); - } else if (key>=GHOST_kKey0 && key<=GHOST_kKey9) { - return (ZEROKEY + ((int) key - GHOST_kKey0)); - } else if (key>=GHOST_kKeyNumpad0 && key<=GHOST_kKeyNumpad9) { - return (PAD0 + ((int) key - GHOST_kKeyNumpad0)); - } else if (key>=GHOST_kKeyF1 && key<=GHOST_kKeyF12) { - return (F1KEY + ((int) key - GHOST_kKeyF1)); - } else { - switch (key) { - case GHOST_kKeyBackSpace: return BACKSPACEKEY; - case GHOST_kKeyTab: return TABKEY; - case GHOST_kKeyLinefeed: return LINEFEEDKEY; - case GHOST_kKeyClear: return 0; - case GHOST_kKeyEnter: return RETKEY; - - case GHOST_kKeyEsc: return ESCKEY; - case GHOST_kKeySpace: return SPACEKEY; - case GHOST_kKeyQuote: return QUOTEKEY; - case GHOST_kKeyComma: return COMMAKEY; - case GHOST_kKeyMinus: return MINUSKEY; - case GHOST_kKeyPeriod: return PERIODKEY; - case GHOST_kKeySlash: return SLASHKEY; - - case GHOST_kKeySemicolon: return SEMICOLONKEY; - case GHOST_kKeyEqual: return EQUALKEY; - - case GHOST_kKeyLeftBracket: return LEFTBRACKETKEY; - case GHOST_kKeyRightBracket: return RIGHTBRACKETKEY; - case GHOST_kKeyBackslash: return BACKSLASHKEY; - case GHOST_kKeyAccentGrave: return ACCENTGRAVEKEY; - - case GHOST_kKeyLeftShift: return LEFTSHIFTKEY; - case GHOST_kKeyRightShift: return RIGHTSHIFTKEY; - case GHOST_kKeyLeftControl: return LEFTCTRLKEY; - case GHOST_kKeyRightControl: return RIGHTCTRLKEY; - case GHOST_kKeyCommand: return COMMANDKEY; - case GHOST_kKeyLeftAlt: return LEFTALTKEY; - case GHOST_kKeyRightAlt: return RIGHTALTKEY; - - case GHOST_kKeyCapsLock: return CAPSLOCKKEY; - case GHOST_kKeyNumLock: return 0; - case GHOST_kKeyScrollLock: return 0; - - case GHOST_kKeyLeftArrow: return LEFTARROWKEY; - case GHOST_kKeyRightArrow: return RIGHTARROWKEY; - case GHOST_kKeyUpArrow: return UPARROWKEY; - case GHOST_kKeyDownArrow: return DOWNARROWKEY; - - case GHOST_kKeyPrintScreen: return 0; - case GHOST_kKeyPause: return PAUSEKEY; - - case GHOST_kKeyInsert: return INSERTKEY; - case GHOST_kKeyDelete: return DELKEY; - case GHOST_kKeyHome: return HOMEKEY; - case GHOST_kKeyEnd: return ENDKEY; - case GHOST_kKeyUpPage: return PAGEUPKEY; - case GHOST_kKeyDownPage: return PAGEDOWNKEY; - - case GHOST_kKeyNumpadPeriod: return PADPERIOD; - case GHOST_kKeyNumpadEnter: return PADENTER; - case GHOST_kKeyNumpadPlus: return PADPLUSKEY; - case GHOST_kKeyNumpadMinus: return PADMINUS; - case GHOST_kKeyNumpadAsterisk: return PADASTERKEY; - case GHOST_kKeyNumpadSlash: return PADSLASHKEY; - - case GHOST_kKeyGrLess: return GRLESSKEY; - - case GHOST_kKeyUnknown: return UNKNOWNKEY; - - default: - return 0; - } - } -} - - /***/ - - -static Window *window_new(GHOST_WindowHandle ghostwin) -{ - Window *win= MEM_callocN(sizeof(*win), "Window"); - win->ghostwin= ghostwin; - - return win; -} - -static void window_handle(Window *win, short event, short val) -{ - if (win->handler) { - win->handler(win, win->user_data, event, val, 0); - } -} - -static void window_handle_ext(Window *win, short event, short val, short extra) -{ - if (win->handler) { - win->handler(win, win->user_data, event, val, extra); - } -} - -static void window_free(Window *win) -{ - MEM_freeN(win); -} - - /***/ - -static Window *active_gl_window= NULL; - -Window *window_open(char *title, int posx, int posy, int sizex, int sizey, int start_maximized) -{ - GHOST_WindowHandle ghostwin; - GHOST_TWindowState inital_state; - int scr_w, scr_h; - - winlay_get_screensize(&scr_w, &scr_h); - posy= (scr_h-posy-sizey); - - if (start_maximized == G_WINDOWSTATE_FULLSCREEN) - inital_state = start_maximized?GHOST_kWindowStateFullScreen:GHOST_kWindowStateNormal; - else - inital_state = start_maximized?GHOST_kWindowStateMaximized:GHOST_kWindowStateNormal; -#ifdef __APPLE__ - inital_state += macPrefState; -#endif - - ghostwin= GHOST_CreateWindow(g_system, - title, - posx, posy, sizex, sizey, - inital_state, - GHOST_kDrawingContextTypeOpenGL, - 0 /* no stereo */); - - if (ghostwin) { - Window *win= window_new(ghostwin); - - if (win) { - GHOST_SetWindowUserData(ghostwin, win); - - win->position[0]= posx; - win->position[1]= posy; - win->size[0]= sizex; - win->size[1]= sizey; - - win->lmouse[0]= win->size[0]/2; - win->lmouse[1]= win->size[1]/2; - - - } else { - GHOST_DisposeWindow(g_system, ghostwin); - } - - return win; - } else { - return NULL; - } -} - -void window_set_handler(Window *win, WindowHandlerFP handler, void *user_data) -{ - win->handler= handler; - win->user_data= user_data; -} - -static void window_timer_proc(GHOST_TimerTaskHandle timer, GHOST_TUns64 time) -{ - Window *win= GHOST_GetTimerTaskUserData(timer); - - win->handler(win, win->user_data, win->timer_event, 0, 0); -} - -void window_set_timer(Window *win, int delay_ms, int event) -{ - if (win->timer) GHOST_RemoveTimer(g_system, win->timer); - - win->timer_event= event; - win->timer= GHOST_InstallTimer(g_system, delay_ms, delay_ms, window_timer_proc, win); -} - -void window_destroy(Window *win) { - if (active_gl_window==win) { - active_gl_window= NULL; - } - - if (win->timer) { - GHOST_RemoveTimer(g_system, win->timer); - win->timer= NULL; - } - - GHOST_DisposeWindow(g_system, win->ghostwin); - window_free(win); -} - -void window_set_cursor(Window *win, int curs) { - if (curs==CURSOR_NONE) { - GHOST_SetCursorVisibility(win->ghostwin, 0); - } else { - GHOST_SetCursorVisibility(win->ghostwin, 1); - - /* detect if we use system cursor or Blender cursor */ - switch(curs) { - case CURSOR_TEXTEDIT: - SetBlenderCursor(BC_TEXTEDITCURSOR); - break; - case CURSOR_VPAINT: - SetBlenderCursor(BC_PAINTBRUSHCURSOR); - break; - default: - GHOST_SetCursorShape(win->ghostwin, convert_cursor(curs)); - } - } -} - -void window_set_custom_cursor(Window *win, unsigned char mask[16][2], - unsigned char bitmap[16][2], int hotx, int hoty) { - GHOST_SetCustomCursorShape(win->ghostwin, bitmap, mask, hotx, hoty); -} - -void window_set_custom_cursor_ex(Window *win, BCursor *cursor, int useBig) { - if (useBig) { - GHOST_SetCustomCursorShapeEx(win->ghostwin, - (GHOST_TUns8 *)cursor->big_bm, (GHOST_TUns8 *)cursor->big_mask, - cursor->big_sizex,cursor->big_sizey, - cursor->big_hotx,cursor->big_hoty, - cursor->fg_color, cursor->bg_color); - } else { - GHOST_SetCustomCursorShapeEx(win->ghostwin, - (GHOST_TUns8 *)cursor->small_bm, (GHOST_TUns8 *)cursor->small_mask, - cursor->small_sizex,cursor->small_sizey, - cursor->small_hotx,cursor->small_hoty, - cursor->fg_color, cursor->bg_color); - } -} - -void window_make_active(Window *win) { - if (win != active_gl_window) { - win->lmbut= 0; /* keeps hanging when mousepressed while other window opened */ - active_gl_window= win; - GHOST_ActivateWindowDrawingContext(win->ghostwin); - } -} - -void window_swap_buffers(Window *win) { - GHOST_SwapWindowBuffers(win->ghostwin); -} - -static int query_qual(char qual) { - GHOST_TModifierKeyMask left, right; - int val= 0; - - if (qual=='s') { - left= GHOST_kModifierKeyLeftShift; - right= GHOST_kModifierKeyRightShift; - } else if (qual=='c') { - left= GHOST_kModifierKeyLeftControl; - right= GHOST_kModifierKeyRightControl; - } else if (qual=='C') { - left= right= GHOST_kModifierKeyCommand; - } else { - left= GHOST_kModifierKeyLeftAlt; - right= GHOST_kModifierKeyRightAlt; - } - - GHOST_GetModifierKeyState(g_system, left, &val); - if (!val) - GHOST_GetModifierKeyState(g_system, right, &val); - - return val; -} - -static int change_bit(int val, int bit, int to_on) { - return to_on?(val|bit):(val&~bit); -} - -static void update_tablet_data(Window *win, Window *ghostwin) { - const GHOST_TabletData *td= GHOST_GetTabletData(ghostwin); - - /* if there's tablet data from an active tablet device then use it, - * otherwise set all tablet related data to default */ - if ((td != NULL) && ELEM(td->Active, DEV_STYLUS, DEV_ERASER)) { - win->activedevice = (short)td->Active; - win->pressure = td->Pressure; - win->xtilt = td->Xtilt; - win->ytilt = td->Ytilt; - } else { - win->activedevice = DEV_MOUSE; - win->pressure = 0.0; - win->xtilt = win->ytilt = 0.0; - } -} - - -static int event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) -{ - GHOST_TEventType type= GHOST_GetEventType(evt); - - if (type == GHOST_kEventQuit) { - exit_usiblender(); - } else { - GHOST_WindowHandle ghostwin= GHOST_GetEventWindow(evt); - GHOST_TEventDataPtr data= GHOST_GetEventData(evt); - Window *win; - - if (!ghostwin) { - // XXX - should be checked, why are we getting an event here, and - // what is it? - - return 1; - } else if (!GHOST_ValidWindow(g_system, ghostwin)) { - // XXX - should be checked, why are we getting an event here, and - // what is it? - - return 1; - } else { - win= GHOST_GetWindowUserData(ghostwin); - } - - switch (type) { - case GHOST_kEventCursorMove: { - if(win->active == 1) { - GHOST_TEventCursorData *cd= data; - - int cx, cy; - - GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy); - win->lmouse[0]= cx; - win->lmouse[1]= (win->size[1]-1) - cy; - - update_tablet_data(win, ghostwin); - window_handle(win, MOUSEX, win->lmouse[0]); - window_handle(win, MOUSEY, win->lmouse[1]); - } - break; - } - case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { - GHOST_TEventButtonData *bd= data; - int val= (type==GHOST_kEventButtonDown); - int bbut= convert_mbut(bd->button); - - if (bbut==LEFTMOUSE) { - if (val) { - if (win->lqual & LR_COMMANDKEY) { - bbut= win->faked_mbut= RIGHTMOUSE; - } else if ((win->lqual & LR_ALTKEY) && (U.flag & USER_TWOBUTTONMOUSE)) { - /* finally, it actually USES the userpref! :) -intrr */ - bbut= win->faked_mbut= MIDDLEMOUSE; - } - } else { - if (win->faked_mbut) { - bbut= win->faked_mbut; - win->faked_mbut= 0; - } - } - } - - if (bbut==LEFTMOUSE) { - win->lmbut= change_bit(win->lmbut, L_MOUSE, val); - } else if (bbut==MIDDLEMOUSE) { - win->lmbut= change_bit(win->lmbut, M_MOUSE, val); - } else { - win->lmbut= change_bit(win->lmbut, R_MOUSE, val); - } - - update_tablet_data(win, ghostwin); - window_handle(win, bbut, val); - - break; - } - - case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { - GHOST_TEventKeyData *kd= data; - int val= (type==GHOST_kEventKeyDown); - int bkey= convert_key(kd->key); - - if (bkey) { - if (bkey==LEFTSHIFTKEY || bkey==RIGHTSHIFTKEY) { - win->lqual= change_bit(win->lqual, LR_SHIFTKEY, val); - } else if (bkey==LEFTCTRLKEY || bkey==RIGHTCTRLKEY) { - win->lqual= change_bit(win->lqual, LR_CTRLKEY, val); - } else if (bkey==LEFTALTKEY || bkey==RIGHTALTKEY) { - win->lqual= change_bit(win->lqual, LR_ALTKEY, val); - } else if (bkey==COMMANDKEY) { - win->lqual= change_bit(win->lqual, LR_COMMANDKEY, val); - } - - window_handle_ext(win, bkey, val, kd->ascii); - } - - break; - } - - case GHOST_kEventWheel: { - GHOST_TEventWheelData* wheelData = (GHOST_TEventWheelData*) data; - if (wheelData->z > 0) { - window_handle(win, WHEELUPMOUSE, 1); - } else { - window_handle(win, WHEELDOWNMOUSE, 1); - } - break; - } - - case GHOST_kEventWindowDeactivate: - case GHOST_kEventWindowActivate: { - win->active= (type==GHOST_kEventWindowActivate); - window_handle(win, INPUTCHANGE, win->active); - - if (win->active) { - if ((win->lqual & LR_SHIFTKEY) && !query_qual('s')) { - win->lqual= change_bit(win->lqual, LR_SHIFTKEY, 0); - window_handle(win, LEFTSHIFTKEY, 0); - } - if ((win->lqual & LR_CTRLKEY) && !query_qual('c')) { - win->lqual= change_bit(win->lqual, LR_CTRLKEY, 0); - window_handle(win, LEFTCTRLKEY, 0); - } - if ((win->lqual & LR_ALTKEY) && !query_qual('a')) { - win->lqual= change_bit(win->lqual, LR_ALTKEY, 0); - window_handle(win, LEFTALTKEY, 0); - } - if ((win->lqual & LR_COMMANDKEY) && !query_qual('C')) { - win->lqual= change_bit(win->lqual, LR_COMMANDKEY, 0); - window_handle(win, LR_COMMANDKEY, 0); - } - - /* - * XXX quick hack so OSX version works better - * when the window is clicked on (focused). - * - * it used to pass on the old win->lmouse value, - * which causes a wrong click in Blender. - * Actually, a 'focus' click should not be passed - * on to blender... (ton) - */ - if(1) { /* enables me to add locals */ - int cx, cy, wx, wy; - GHOST_GetCursorPosition(g_system, &wx, &wy); - - GHOST_ScreenToClient(win->ghostwin, wx, wy, &cx, &cy); - win->lmouse[0]= cx; - win->lmouse[1]= (win->size[1]-1) - cy; - window_handle(win, MOUSEX, win->lmouse[0]); - window_handle(win, MOUSEY, win->lmouse[1]); - } - } - - break; - } - case GHOST_kEventWindowClose: { - window_handle(win, WINCLOSE, 1); - break; - } - case GHOST_kEventWindowUpdate: { - window_handle(win, REDRAW, 1); - break; - } - case GHOST_kEventWindowSize: { - GHOST_RectangleHandle client_rect; - int l, t, r, b, scr_w, scr_h; - - client_rect= GHOST_GetClientBounds(win->ghostwin); - GHOST_GetRectangle(client_rect, &l, &t, &r, &b); - - GHOST_DisposeRectangle(client_rect); - - winlay_get_screensize(&scr_w, &scr_h); - win->position[0]= l; - win->position[1]= scr_h - b - 1; - win->size[0]= r-l; - win->size[1]= b-t; - - window_handle(win, RESHAPE, 1); - break; - } - case GHOST_kEventUnknown: - case GHOST_kEventQuit: - case GHOST_kNumEventTypes: - break; - } - } - - return 1; -} - -char *window_get_title(Window *win) { - char *title= GHOST_GetTitle(win->ghostwin); - char *mem_title= BLI_strdup(title); - free(title); - - return mem_title; -} - -void window_set_title(Window *win, char *title) { - GHOST_SetTitle(win->ghostwin, title); -} - -short window_get_qual(Window *win) -{ - int qual= 0; - - if( query_qual('s')) qual |= LR_SHIFTKEY; - if( query_qual('a')) qual |= LR_ALTKEY; - if( query_qual('c')) qual |= LR_CTRLKEY; - return qual; -// return win->lqual; -} - -short window_get_mbut(Window *win) { - return win->lmbut; -} - -void window_get_mouse(Window *win, short *mval) { - mval[0]= win->lmouse[0]; - mval[1]= win->lmouse[1]; -} - -float window_get_pressure(Window *win) { - return win->pressure; -} - -void window_get_tilt(Window *win, float *xtilt, float *ytilt) { - *xtilt= win->xtilt; - *ytilt= win->ytilt; -} - -short window_get_activedevice(Window *win) { - return win->activedevice; -} - -void window_get_position(Window *win, int *posx_r, int *posy_r) { - *posx_r= win->position[0]; - *posy_r= win->position[1]; -} - -void window_get_size(Window *win, int *width_r, int *height_r) { - *width_r= win->size[0]; - *height_r= win->size[1]; -} - -void window_set_size(Window *win, int width, int height) { - GHOST_SetClientSize(win->ghostwin, width, height); -} - -void window_lower(Window *win) { - GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderBottom); -} - -void window_raise(Window *win) { - GHOST_SetWindowOrder(win->ghostwin, GHOST_kWindowOrderTop); -#ifdef _WIN32 - markdirty_all(); /* to avoid redraw errors in fullscreen mode (aphex) */ -#endif -} - -#if 0 -//#ifdef _WIN32 //FULLSCREEN -void window_toggle_fullscreen(Window *win, int fullscreen) { - /* these two lines make sure front and backbuffer are equal. for swapbuffers */ - markdirty_all(); - screen_swapbuffers(); - - if(fullscreen) - GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateFullScreen); - else - GHOST_SetWindowState(win->ghostwin, GHOST_kWindowStateMaximized); -} -#endif - -void window_warp_pointer(Window *win, int x, int y) { - int oldx=x, oldy=y; - - y= win->size[1] - y - 1; - GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y); - GHOST_SetCursorPosition(g_system, x, y); - - /* on OSX (for example) the setcursor doesnt create event */ - win->lmouse[0]= oldx; - win->lmouse[1]= oldy; -} - -void window_queue_redraw(Window *win) { - GHOST_InvalidateWindow(win->ghostwin); // ghost will send back a redraw to blender -} - -/***/ - -void winlay_process_events(int wait_for_event) { - GHOST_ProcessEvents(g_system, wait_for_event); - GHOST_DispatchEvents(g_system); -} - -void winlay_get_screensize(int *width_r, int *height_r) { - unsigned int uiwidth; - unsigned int uiheight; - - if (!g_system) { - GHOST_EventConsumerHandle consumer= GHOST_CreateEventConsumer(event_proc, NULL); - - g_system= GHOST_CreateSystem(); - GHOST_AddEventConsumer(g_system, consumer); - } - - GHOST_GetMainDisplayDimensions(g_system, &uiwidth, &uiheight); - *width_r= uiwidth; - *height_r= uiheight; -} - -Window *winlay_get_active_window(void) { - return active_gl_window; -} diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c deleted file mode 100644 index 13922bb7eef..00000000000 --- a/source/blender/src/glutil.c +++ /dev/null @@ -1,695 +0,0 @@ - - -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_vec_types.h" -#include "DNA_listBase.h" - -#include "BKE_utildefines.h" - -#include "BLI_arithb.h" -#include "BLI_threads.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" - -#ifndef GL_CLAMP_TO_EDGE -#define GL_CLAMP_TO_EDGE 0x812F -#endif - - - /* Invert line handling */ - -#define glToggle(mode, onoff) (((onoff)?glEnable:glDisable)(mode)) - -void set_inverted_drawing(int enable) -{ - glLogicOp(enable?GL_INVERT:GL_COPY); - - /* Use GL_BLEND_EQUATION_EXT on sgi (if we have it), - * apparently GL_COLOR_LOGIC_OP doesn't work on O2? - * Is this an sgi bug or our bug? - */ -#if defined(__sgi) && defined(GL_BLEND_EQUATION_EXT) - glBlendEquationEXT(enable?GL_LOGIC_OP:GL_FUNC_ADD_EXT); - glToggle(GL_BLEND, enable); -#else - glToggle(GL_COLOR_LOGIC_OP, enable); -#endif - - glToggle(GL_DITHER, !enable); -} - -void sdrawXORline(int x0, int y0, int x1, int y1) -{ - if(x0==x1 && y0==y1) return; - - set_inverted_drawing(1); - - glBegin(GL_LINES); - glVertex2i(x0, y0); - glVertex2i(x1, y1); - glEnd(); - - set_inverted_drawing(0); -} - -void glutil_draw_front_xor_line(int x0, int y0, int x1, int y1) -{ - glReadBuffer(GL_FRONT); - glDrawBuffer(GL_FRONT); - sdrawXORline(x0, y0, x1, y1); - glFlush(); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_BACK); - -} - -void sdrawXORline4(int nr, int x0, int y0, int x1, int y1) -{ - static short old[4][2][2]; - static char flags[4]= {0, 0, 0, 0}; - - /* with builtin memory, max 4 lines */ - - set_inverted_drawing(1); - - glBegin(GL_LINES); - if(nr== -1) { /* flush */ - for (nr=0; nr<4; nr++) { - if (flags[nr]) { - glVertex2sv(old[nr][0]); - glVertex2sv(old[nr][1]); - flags[nr]= 0; - } - } - } else { - if(nr>=0 && nr<4) { - if(flags[nr]) { - glVertex2sv(old[nr][0]); - glVertex2sv(old[nr][1]); - } - - old[nr][0][0]= x0; - old[nr][0][1]= y0; - old[nr][1][0]= x1; - old[nr][1][1]= y1; - - flags[nr]= 1; - } - - glVertex2i(x0, y0); - glVertex2i(x1, y1); - } - glEnd(); - - set_inverted_drawing(0); -} - -void fdrawXORellipse(float xofs, float yofs, float hw, float hh) -{ - if(hw==0) return; - - set_inverted_drawing(1); - - glPushMatrix(); - glTranslatef(xofs, yofs, 0.0); - glScalef(1,hh/hw,1); - glutil_draw_lined_arc(0.0, M_PI*2.0, hw, 20); - glPopMatrix(); - - set_inverted_drawing(0); -} -void fdrawXORcirc(float xofs, float yofs, float rad) -{ - set_inverted_drawing(1); - - glPushMatrix(); - glTranslatef(xofs, yofs, 0.0); - glutil_draw_lined_arc(0.0, M_PI*2.0, rad, 20); - glPopMatrix(); - - set_inverted_drawing(0); -} - -void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments) { - int i; - - glBegin(GL_TRIANGLE_FAN); - glVertex2f(0.0, 0.0); - for (i=0; i=1.0f?255: (char)(255.0f*val)) -void glaDrawPixelsSafe_to32(float fx, float fy, int img_w, int img_h, int row_w, float *rectf) -{ - float *rf; - int x, y; - char *rect32, *rc; - - /* copy imgw-imgh to a temporal 32 bits rect */ - if(img_w<1 || img_h<1) return; - - rc= rect32= MEM_mallocN(img_w*img_h*sizeof(int), "temp 32 bits"); - - for(y=0; y0 && draw_h>0) { - int old_row_length = glaGetOneInteger(GL_UNPACK_ROW_LENGTH); - - /* Don't use safe RasterPos (slower) if we can avoid it. */ - if (rast_x>=0 && rast_y>=0) { - glRasterPos2f(rast_x, rast_y); - } else { - glaRasterPosSafe2f(rast_x, rast_y, 0, 0); - } - - glPixelStorei(GL_UNPACK_ROW_LENGTH, row_w); - if(format==GL_LUMINANCE || format==GL_RED) { - if(type==GL_FLOAT) { - float *f_rect= (float *)rect; - glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x)); - } - else if(type==GL_INT || type==GL_UNSIGNED_INT) { - int *i_rect= (int *)rect; - glDrawPixels(draw_w, draw_h, format, type, i_rect + (off_y*row_w + off_x)); - } - } - else { /* RGBA */ - if(type==GL_FLOAT) { - float *f_rect= (float *)rect; - glDrawPixels(draw_w, draw_h, format, type, f_rect + (off_y*row_w + off_x)*4); - } - else if(type==GL_UNSIGNED_BYTE) { - unsigned char *uc_rect= (unsigned char *) rect; - glDrawPixels(draw_w, draw_h, format, type, uc_rect + (off_y*row_w + off_x)*4); - } - } - - glPixelStorei(GL_UNPACK_ROW_LENGTH, old_row_length); - } -} - -/* 2D Drawing Assistance */ - -void glaDefine2DArea(rcti *screen_rect) -{ - int sc_w= screen_rect->xmax - screen_rect->xmin; - int sc_h= screen_rect->ymax - screen_rect->ymin; - - glViewport(screen_rect->xmin, screen_rect->ymin, sc_w, sc_h); - glScissor(screen_rect->xmin, screen_rect->ymin, sc_w, sc_h); - - /* The 0.375 magic number is to shift the matrix so that - * both raster and vertex integer coordinates fall at pixel - * centers properly. For a longer discussion see the OpenGL - * Programming Guide, Appendix H, Correctness Tips. - */ - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, sc_w, 0.0, sc_h, -1, 1); - glTranslatef(0.375, 0.375, 0.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - -struct gla2DDrawInfo { - int orig_vp[4], orig_sc[4]; - float orig_projmat[16], orig_viewmat[16]; - - rcti screen_rect; - rctf world_rect; - - float wo_to_sc[2]; -}; - -void gla2DGetMap(gla2DDrawInfo *di, rctf *rect) -{ - *rect= di->world_rect; -} - -void gla2DSetMap(gla2DDrawInfo *di, rctf *rect) -{ - int sc_w, sc_h; - float wo_w, wo_h; - - di->world_rect= *rect; - - sc_w= (di->screen_rect.xmax-di->screen_rect.xmin); - sc_h= (di->screen_rect.ymax-di->screen_rect.ymin); - wo_w= (di->world_rect.xmax-di->world_rect.xmin); - wo_h= (di->world_rect.ymax-di->world_rect.ymin); - - di->wo_to_sc[0]= sc_w/wo_w; - di->wo_to_sc[1]= sc_h/wo_h; -} - - -gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect) -{ - gla2DDrawInfo *di= MEM_mallocN(sizeof(*di), "gla2DDrawInfo"); - int sc_w, sc_h; - float wo_w, wo_h; - - glGetIntegerv(GL_VIEWPORT, (GLint *)di->orig_vp); - glGetIntegerv(GL_SCISSOR_BOX, (GLint *)di->orig_sc); - glGetFloatv(GL_PROJECTION_MATRIX, (GLfloat *)di->orig_projmat); - glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *)di->orig_viewmat); - - di->screen_rect= *screen_rect; - if (world_rect) { - di->world_rect= *world_rect; - } else { - di->world_rect.xmin= di->screen_rect.xmin; - di->world_rect.ymin= di->screen_rect.ymin; - di->world_rect.xmax= di->screen_rect.xmax; - di->world_rect.ymax= di->screen_rect.ymax; - } - - sc_w= (di->screen_rect.xmax-di->screen_rect.xmin); - sc_h= (di->screen_rect.ymax-di->screen_rect.ymin); - wo_w= (di->world_rect.xmax-di->world_rect.xmin); - wo_h= (di->world_rect.ymax-di->world_rect.ymin); - - di->wo_to_sc[0]= sc_w/wo_w; - di->wo_to_sc[1]= sc_h/wo_h; - - glaDefine2DArea(&di->screen_rect); - - return di; -} - -void gla2DDrawTranslatePt(gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r) -{ - *sc_x_r= (wo_x - di->world_rect.xmin)*di->wo_to_sc[0]; - *sc_y_r= (wo_y - di->world_rect.ymin)*di->wo_to_sc[1]; -} -void gla2DDrawTranslatePtv(gla2DDrawInfo *di, float world[2], int screen_r[2]) -{ - screen_r[0]= (world[0] - di->world_rect.xmin)*di->wo_to_sc[0]; - screen_r[1]= (world[1] - di->world_rect.ymin)*di->wo_to_sc[1]; -} - -void glaEnd2DDraw(gla2DDrawInfo *di) -{ - glViewport(di->orig_vp[0], di->orig_vp[1], di->orig_vp[2], di->orig_vp[3]); - glScissor(di->orig_vp[0], di->orig_vp[1], di->orig_vp[2], di->orig_vp[3]); - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(di->orig_projmat); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(di->orig_viewmat); - - MEM_freeN(di); -} - -/* **************** glPoint hack ************************ */ - -static int curmode=0; -static int pointhack=0; -static GLubyte Squaredot[16] = { 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff}; - -void bglBegin(int mode) -{ - curmode= mode; - - if(mode==GL_POINTS) { - float value[4]; - glGetFloatv(GL_POINT_SIZE_RANGE, value); - if(value[1]<2.0) { - glGetFloatv(GL_POINT_SIZE, value); - pointhack= floor(value[0]+0.5); - if(pointhack>4) pointhack= 4; - } - else glBegin(mode); - } -} - - -void bglVertex3fv(float *vec) -{ - switch(curmode) { - case GL_POINTS: - if(pointhack) { - glRasterPos3fv(vec); - glBitmap(pointhack, pointhack, (float)pointhack/2.0, (float)pointhack/2.0, 0.0, 0.0, Squaredot); - } - else glVertex3fv(vec); - break; - } -} - -void bglVertex3f(float x, float y, float z) -{ - switch(curmode) { - case GL_POINTS: - if(pointhack) { - glRasterPos3f(x, y, z); - glBitmap(pointhack, pointhack, (float)pointhack/2.0, (float)pointhack/2.0, 0.0, 0.0, Squaredot); - } - else glVertex3f(x, y, z); - break; - } -} - -void bglVertex2fv(float *vec) -{ - switch(curmode) { - case GL_POINTS: - if(pointhack) { - glRasterPos2fv(vec); - glBitmap(pointhack, pointhack, (float)pointhack/2, pointhack/2, 0.0, 0.0, Squaredot); - } - else glVertex2fv(vec); - break; - } -} - - -void bglEnd(void) -{ - if(pointhack) pointhack= 0; - else glEnd(); - -} - -/* Uses current OpenGL state to get view matrices for gluProject/gluUnProject */ -void bgl_get_mats(bglMats *mats) -{ - const double badvalue= 1.0e-6; - - glGetDoublev(GL_MODELVIEW_MATRIX, mats->modelview); - glGetDoublev(GL_PROJECTION_MATRIX, mats->projection); - glGetIntegerv(GL_VIEWPORT, (GLint *)mats->viewport); - - /* Very strange code here - it seems that certain bad values in the - modelview matrix can cause gluUnProject to give bad results. */ - if(mats->modelview[0] < badvalue && - mats->modelview[0] > -badvalue) - mats->modelview[0]= 0; - if(mats->modelview[5] < badvalue && - mats->modelview[5] > -badvalue) - mats->modelview[5]= 0; - - /* Set up viewport so that gluUnProject will give correct values */ - mats->viewport[0] = 0; - mats->viewport[1] = 0; -} - -/* *************** glPolygonOffset hack ************* */ - -// both temporal, so here for now (ton) -#include "BKE_global.h" -#include "DNA_view3d_types.h" - -/* dist is only for ortho now... */ -void bglPolygonOffset(float dist) -{ - static float winmat[16], offset=0.0; - - if(dist!=0.0) { - float offs; - - // glEnable(GL_POLYGON_OFFSET_FILL); - // glPolygonOffset(-1.0, -1.0); - - /* hack below is to mimic polygon offset */ - glMatrixMode(GL_PROJECTION); - glGetFloatv(GL_PROJECTION_MATRIX, (float *)winmat); - - /* dist is from camera to center point */ - - if(winmat[15]>0.5) offs= 0.00001*dist*G.vd->dist; // ortho tweaking - else offs= 0.0005*dist; // should be clipping value or so... - - winmat[14]-= offs; - offset+= offs; - - glLoadMatrixf(winmat); - glMatrixMode(GL_MODELVIEW); - } - else { - - glMatrixMode(GL_PROJECTION); - winmat[14]+= offset; - offset= 0.0; - glLoadMatrixf(winmat); - glMatrixMode(GL_MODELVIEW); - } -} - -int is_a_really_crappy_intel_card(void) -{ - static int well_is_it= -1; - - /* Do you understand the implication? Do you? */ - if (well_is_it==-1) - well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "Intel Inc.") == 0); - - return well_is_it; -} - -void bglFlush(void) -{ - glFlush(); -#ifdef __APPLE__ - if(is_a_really_crappy_intel_card()) - myswapbuffers(); //hack to get mac intel graphics to show frontbuffer -#endif -} - - diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c deleted file mode 100644 index b655671a051..00000000000 --- a/source/blender/src/hddaudio.c +++ /dev/null @@ -1,577 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Peter Schlaile 2005 - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WITH_FFMPEG -#include -#include -#include -#if LIBAVFORMAT_VERSION_INT < (49 << 16) -#define FFMPEG_OLD_FRAME_RATE 1 -#else -#define FFMPEG_CODEC_IS_POINTER 1 -#endif -#endif - -#include "MEM_guardedalloc.h" - -#include "BIF_editsound.h" - -#include "blendef.h" - -#ifdef WITH_FFMPEG -extern void do_init_ffmpeg(); -#endif - -struct hdaudio { - int sample_rate; - int channels; - int audioStream; - -#ifdef WITH_FFMPEG - char * filename; - AVCodec *pCodec; - AVFormatContext *pFormatCtx; - AVCodecContext *pCodecCtx; - int frame_position; - int frame_duration; - int frame_alloc_duration; - int decode_pos; - int frame_size; - short * decode_cache; - short * decode_cache_zero; - short * resample_cache; - int decode_cache_size; - int target_channels; - int target_rate; - int resample_samples_written; - int resample_samples_in; - ReSampleContext *resampler; -#else - - -#endif -}; - -#ifdef WITH_FFMPEG -#ifdef FFMPEG_CODEC_IS_POINTER -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return stream->codec; -} -#else -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return &stream->codec; -} -#endif -#endif - -struct hdaudio * sound_open_hdaudio(char * filename) -{ -#ifdef WITH_FFMPEG - struct hdaudio * rval; - int i, audioStream; - - AVCodec *pCodec; - AVFormatContext *pFormatCtx; - AVCodecContext *pCodecCtx; - - do_init_ffmpeg(); - - if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) { - return 0; - } - - if(av_find_stream_info(pFormatCtx)<0) { - av_close_input_file(pFormatCtx); - return 0; - } - - dump_format(pFormatCtx, 0, filename, 0); - - - /* Find the first audio stream */ - audioStream=-1; - for(i=0; inb_streams; i++) - if(get_codec_from_stream(pFormatCtx->streams[i]) - ->codec_type == CODEC_TYPE_AUDIO) - { - audioStream=i; - break; - } - - if(audioStream == -1) { - av_close_input_file(pFormatCtx); - return 0; - } - - pCodecCtx = get_codec_from_stream(pFormatCtx->streams[audioStream]); - - /* Find the decoder for the audio stream */ - pCodec = avcodec_find_decoder(pCodecCtx->codec_id); - if(pCodec == NULL) { - av_close_input_file(pFormatCtx); - return 0; - } - - if(avcodec_open(pCodecCtx, pCodec)<0) { - av_close_input_file(pFormatCtx); - return 0; - } - - rval = (struct hdaudio *)MEM_mallocN(sizeof(struct hdaudio), - "hdaudio struct"); - - rval->filename = strdup(filename); - rval->sample_rate = pCodecCtx->sample_rate; - rval->channels = pCodecCtx->channels; - - rval->pFormatCtx = pFormatCtx; - rval->pCodecCtx = pCodecCtx; - rval->pCodec = pCodec; - rval->audioStream = audioStream; - rval->frame_position = -10; - - rval->frame_duration = AV_TIME_BASE / 10; - rval->frame_alloc_duration = AV_TIME_BASE; - rval->decode_cache_size = - (long long) rval->sample_rate * rval->channels - * rval->frame_alloc_duration / AV_TIME_BASE - * 2; - - rval->decode_cache = (short*) MEM_mallocN( - rval->decode_cache_size * sizeof(short) - + AVCODEC_MAX_AUDIO_FRAME_SIZE, - "hdaudio decode cache"); - rval->decode_cache_zero = rval->decode_cache; - rval->decode_pos = 0; - rval->target_channels = -1; - rval->target_rate = -1; - rval->resampler = 0; - rval->resample_cache = 0; - rval->resample_samples_written = 0; - rval->resample_samples_in = 0; - return rval; -#else - return 0; -#endif -} - -struct hdaudio * sound_copy_hdaudio(struct hdaudio * c) -{ -#ifdef WITH_FFMPEG - return sound_open_hdaudio(c->filename); -#else - return 0; -#endif -} - -long sound_hdaudio_get_duration(struct hdaudio * hdaudio, double frame_rate) -{ -#ifdef WITH_FFMPEG - return hdaudio->pFormatCtx->duration * frame_rate / AV_TIME_BASE; -#else - return 0; -#endif -} - -#ifdef WITH_FFMPEG -static void sound_hdaudio_extract_small_block( - struct hdaudio * hdaudio, - short * target_buffer, - int sample_position /* units of target_rate */, - int target_rate, - int target_channels, - int nb_samples /* in target */) -{ - AVPacket packet; - int frame_position; - int frame_size = (long long) target_rate - * hdaudio->frame_duration / AV_TIME_BASE; - int in_frame_size = (long long) hdaudio->sample_rate - * hdaudio->frame_duration / AV_TIME_BASE; - int rate_conversion = - (target_rate != hdaudio->sample_rate) - || (target_channels != hdaudio->channels); - int sample_ofs = target_channels * (sample_position % frame_size); - - frame_position = sample_position / frame_size; - - if (hdaudio == 0) return; - - if (rate_conversion) { - if (hdaudio->resampler && - (hdaudio->target_rate != target_rate - || hdaudio->target_channels != target_channels)) { - audio_resample_close(hdaudio->resampler); - hdaudio->resampler = 0; - } - if (!hdaudio->resampler) { - hdaudio->resampler = audio_resample_init( - target_channels, hdaudio->channels, - target_rate, hdaudio->sample_rate); - hdaudio->target_rate = target_rate; - hdaudio->target_channels = target_channels; - if (hdaudio->resample_cache) { - MEM_freeN(hdaudio->resample_cache); - } - - - hdaudio->resample_cache = (short*) MEM_mallocN( - (long long) - hdaudio->target_channels - * frame_size * 2 - * sizeof(short), - "hdaudio resample cache"); - if (frame_position == hdaudio->frame_position) { - hdaudio->resample_samples_in = - in_frame_size * 7 / 4; - hdaudio->resample_samples_written - = audio_resample( - hdaudio->resampler, - hdaudio->resample_cache, - hdaudio->decode_cache_zero, - in_frame_size * 7 / 4); - } - } - } - - if (frame_position == hdaudio->frame_position + 1 - && in_frame_size * hdaudio->channels <= hdaudio->decode_pos) { - int bl_size = in_frame_size * hdaudio->channels; - int decode_pos = hdaudio->decode_pos; - - hdaudio->frame_position = frame_position; - - memmove(hdaudio->decode_cache, - hdaudio->decode_cache + bl_size, - (decode_pos - bl_size) * sizeof(short)); - - decode_pos -= bl_size; - - memset(hdaudio->decode_cache + decode_pos, 0, - (hdaudio->decode_cache_size - decode_pos) - * sizeof(short)); - - - while(av_read_frame(hdaudio->pFormatCtx, &packet) >= 0) { - int data_size; - int len; - uint8_t *audio_pkt_data; - int audio_pkt_size; - - if(packet.stream_index != hdaudio->audioStream) { - av_free_packet(&packet); - continue; - } - - audio_pkt_data = packet.data; - audio_pkt_size = packet.size; - - while (audio_pkt_size > 0) { - len = avcodec_decode_audio( - hdaudio->pCodecCtx, - hdaudio->decode_cache - + decode_pos, - &data_size, - audio_pkt_data, - audio_pkt_size); - if (len <= 0) { - audio_pkt_size = 0; - break; - } - - audio_pkt_size -= len; - audio_pkt_data += len; - - if (data_size <= 0) { - continue; - } - - decode_pos += data_size / sizeof(short); - if (decode_pos + data_size - / sizeof(short) - > hdaudio->decode_cache_size) { - break; - } - } - av_free_packet(&packet); - - if (decode_pos + data_size / sizeof(short) - > hdaudio->decode_cache_size) { - break; - } - } - - if (rate_conversion) { - int written = hdaudio->resample_samples_written - * target_channels; - int ofs = target_channels * frame_size; - int recycle = written - ofs; - int next_in = in_frame_size - + (3.0/4.0 - - (double) recycle / (double) - (frame_size * target_channels) - ) * in_frame_size; - - memmove(hdaudio->resample_cache, - hdaudio->resample_cache + ofs, - recycle * sizeof(short)); - - hdaudio->resample_samples_written - = audio_resample( - hdaudio->resampler, - hdaudio->resample_cache + recycle, - hdaudio->decode_cache_zero - + hdaudio->resample_samples_in - * hdaudio->channels - - bl_size, - next_in) - + recycle / target_channels; - - hdaudio->resample_samples_in = next_in; - } - - hdaudio->decode_pos = decode_pos; - } - - if (frame_position != hdaudio->frame_position) { - long decode_pos = 0; - long long st_time = hdaudio->pFormatCtx - ->streams[hdaudio->audioStream]->start_time; - double time_base = - av_q2d(hdaudio->pFormatCtx - ->streams[hdaudio->audioStream]->time_base); - long long pos = (long long) frame_position * AV_TIME_BASE - * hdaudio->frame_duration / AV_TIME_BASE; - - long long seek_pos; - - hdaudio->frame_position = frame_position; - - if (st_time == AV_NOPTS_VALUE) { - st_time = 0; - } - - pos += st_time * AV_TIME_BASE * time_base; - - /* seek a little bit before the target position, - (ffmpeg seek algorithm doesn't seem to work always as - specified...) - */ - - seek_pos = pos - (AV_TIME_BASE - * hdaudio->frame_duration - / AV_TIME_BASE / 10); - if (seek_pos < 0) { - seek_pos = pos; - } - - av_seek_frame(hdaudio->pFormatCtx, -1, - seek_pos, - AVSEEK_FLAG_ANY | AVSEEK_FLAG_BACKWARD); - avcodec_flush_buffers(hdaudio->pCodecCtx); - - memset(hdaudio->decode_cache, 0, - hdaudio->decode_cache_size * sizeof(short)); - - hdaudio->decode_cache_zero = hdaudio->decode_cache; - - while(av_read_frame(hdaudio->pFormatCtx, &packet) >= 0) { - int data_size; - int len; - uint8_t *audio_pkt_data; - int audio_pkt_size; - - if(packet.stream_index != hdaudio->audioStream) { - av_free_packet(&packet); - continue; - } - - audio_pkt_data = packet.data; - audio_pkt_size = packet.size; - - if (!hdaudio->decode_cache_zero - && audio_pkt_size > 0) { - long long diff; - - if (packet.pts == AV_NOPTS_VALUE) { - fprintf(stderr, - "hdaudio: audio " - "pts=NULL audio " - "distortion!\n"); - diff = 0; - } else { - long long pts = packet.pts; - long long spts = (long long) ( - pos / time_base / AV_TIME_BASE - + 0.5); - diff = spts - pts; - if (diff < 0) { - fprintf(stderr, - "hdaudio: " - "negative seek: " - "%lld < %lld " - "(pos=%lld) " - "audio distortion!!\n", - spts, pts, pos); - diff = 0; - } - } - - - diff *= hdaudio->sample_rate * time_base; - diff *= hdaudio->channels; - - if (diff > hdaudio->decode_cache_size / 2) { - fprintf(stderr, - "hdaudio: audio " - "diff too large!!\n"); - diff = 0; - } - - hdaudio->decode_cache_zero - = hdaudio->decode_cache + diff; - } - - while (audio_pkt_size > 0) { - len = avcodec_decode_audio( - hdaudio->pCodecCtx, - hdaudio->decode_cache - + decode_pos, - &data_size, - audio_pkt_data, - audio_pkt_size); - if (len <= 0) { - audio_pkt_size = 0; - break; - } - - audio_pkt_size -= len; - audio_pkt_data += len; - - if (data_size <= 0) { - continue; - } - - decode_pos += data_size / sizeof(short); - if (decode_pos + data_size - / sizeof(short) - > hdaudio->decode_cache_size) { - break; - } - } - - av_free_packet(&packet); - - if (decode_pos + data_size / sizeof(short) - > hdaudio->decode_cache_size) { - break; - } - } - if (rate_conversion) { - hdaudio->resample_samples_written - = audio_resample(hdaudio->resampler, - hdaudio->resample_cache, - hdaudio->decode_cache_zero, - in_frame_size * 7 / 4); - hdaudio->resample_samples_in = - in_frame_size * 7 / 4; - } - hdaudio->decode_pos = decode_pos; - } - - memcpy(target_buffer, (rate_conversion - ? hdaudio->resample_cache - : hdaudio->decode_cache_zero) + sample_ofs, - nb_samples * target_channels * sizeof(short)); -} -#endif - - -void sound_hdaudio_extract(struct hdaudio * hdaudio, - short * target_buffer, - int sample_position /* units of target_rate */, - int target_rate, - int target_channels, - int nb_samples /* in target */) -{ -#ifdef WITH_FFMPEG - long long max_samples = (long long) target_rate - * hdaudio->frame_duration / AV_TIME_BASE / 4; - - while (nb_samples > max_samples) { - sound_hdaudio_extract_small_block(hdaudio, target_buffer, - sample_position, - target_rate, - target_channels, - max_samples); - target_buffer += max_samples * target_channels; - sample_position += max_samples; - nb_samples -= max_samples; - } - if (nb_samples > 0) { - sound_hdaudio_extract_small_block(hdaudio, target_buffer, - sample_position, - target_rate, - target_channels, - nb_samples); - } -#else - -#endif -} - -void sound_close_hdaudio(struct hdaudio * hdaudio) -{ -#ifdef WITH_FFMPEG - - if (hdaudio) { - avcodec_close(hdaudio->pCodecCtx); - av_close_input_file(hdaudio->pFormatCtx); - MEM_freeN (hdaudio->decode_cache); - if (hdaudio->resample_cache) { - MEM_freeN(hdaudio->resample_cache); - } - free(hdaudio->filename); - MEM_freeN (hdaudio); - } -#else - -#endif -} - diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c deleted file mode 100644 index 9e858cb8307..00000000000 --- a/source/blender/src/header_action.c +++ /dev/null @@ -1,1285 +0,0 @@ -/** - * header_action.c oct-2003 - * - * Functions to draw the "Action Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): 2007, Joshua Leung (Action Editor recode) - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_ID.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BIF_editaction.h" -#include "BIF_interface.h" -#include "BIF_poseobject.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" - -#include "BDR_drawaction.h" -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "nla.h" - -#include "blendef.h" -#include "mydevice.h" - -/* enums declaring constants that are used as menu event codes */ - -enum { - ACTMENU_VIEW_CENTERVIEW= 0, - ACTMENU_VIEW_AUTOUPDATE, - ACTMENU_VIEW_PLAY3D, - ACTMENU_VIEW_PLAYALL, - ACTMENU_VIEW_ALL, - ACTMENU_VIEW_MAXIMIZE, - ACTMENU_VIEW_LOCK, - ACTMENU_VIEW_SLIDERS, - ACTMENU_VIEW_NEXTMARKER, - ACTMENU_VIEW_PREVMARKER, - ACTMENU_VIEW_TIME, - ACTMENU_VIEW_NOHIDE -}; - -enum { - ACTMENU_SEL_BORDER = 0, - ACTMENU_SEL_BORDERM, - ACTMENU_SEL_ALL_KEYS, - ACTMENU_SEL_ALL_CHAN, - ACTMENU_SEL_ALL_MARKERS, - ACTMENU_SEL_INVERSE_KEYS, - ACTMENU_SEL_INVERSE_MARKERS, - ACTMENU_SEL_LEFTKEYS, - ACTMENU_SEL_RIGHTKEYS -}; - -enum { - ACTMENU_SEL_COLUMN_KEYS = 1, - ACTMENU_SEL_COLUMN_MARKERSCOLUMN, - ACTMENU_SEL_COLUMN_MARKERSBETWEEN -}; - -enum { - ACTMENU_KEY_DUPLICATE = 0, - ACTMENU_KEY_DELETE, - ACTMENU_KEY_CLEAN -}; - -enum { - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP = 0, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_TOP, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_BOTTOM -}; - -enum { - ACTMENU_KEY_TRANSFORM_MOVE = 0, - ACTMENU_KEY_TRANSFORM_SCALE, - ACTMENU_KEY_TRANSFORM_SLIDE, - ACTMENU_KEY_TRANSFORM_EXTEND -}; - -enum { - ACTMENU_KEY_HANDLE_AUTO = 0, - ACTMENU_KEY_HANDLE_ALIGN, - ACTMENU_KEY_HANDLE_FREE, - ACTMENU_KEY_HANDLE_VECTOR -}; - -enum { - ACTMENU_KEY_INTERP_CONST = 0, - ACTMENU_KEY_INTERP_LINEAR, - ACTMENU_KEY_INTERP_BEZIER -}; - -enum { - ACTMENU_KEY_EXTEND_CONST = 0, - ACTMENU_KEY_EXTEND_EXTRAPOLATION, - ACTMENU_KEY_EXTEND_CYCLIC, - ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION -}; - -enum { - ACTMENU_KEY_SNAP_NEARFRAME = 1, - ACTMENU_KEY_SNAP_CURFRAME, - ACTMENU_KEY_SNAP_NEARMARK, - ACTMENU_KEY_SNAP_NEARTIME, - ACTMENU_KEY_SNAP_CFRA2KEY, -}; - -enum { - ACTMENU_KEY_MIRROR_CURFRAME = 1, - ACTMENU_KEY_MIRROR_YAXIS, - ACTMENU_KEY_MIRROR_XAXIS, - ACTMENU_KEY_MIRROR_MARKER -}; - -enum { - ACTMENU_MARKERS_ADD = 0, - ACTMENU_MARKERS_DUPLICATE, - ACTMENU_MARKERS_DELETE, - ACTMENU_MARKERS_NAME, - ACTMENU_MARKERS_MOVE -}; - -void do_action_buttons(unsigned short event) -{ - Object *ob= OBACT; - - switch(event) { - case B_ACTHOME: /* HOMEKEY in Action Editor */ - /* Find X extents */ - G.v2d->cur.xmin = 0; - G.v2d->cur.ymin=-SCROLLB; - - if (G.saction->action) { - float extra; - - calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0); - if (G.saction->pin==0 && ob) { - G.v2d->cur.xmin= get_action_frame_inv(ob, G.v2d->cur.xmin); - G.v2d->cur.xmax= get_action_frame_inv(ob, G.v2d->cur.xmax); - } - extra= 0.05*(G.v2d->cur.xmax - G.v2d->cur.xmin); - G.v2d->cur.xmin-= extra; - G.v2d->cur.xmax+= extra; - - if (G.v2d->cur.xmin==G.v2d->cur.xmax) { - G.v2d->cur.xmax= -5; - G.v2d->cur.xmax= 100; - } - } - else { /* shapekeys and/or no action */ - G.v2d->cur.xmin= -5.0; - G.v2d->cur.xmax= 65.0; - } - - G.v2d->cur.ymin= -75.0; - G.v2d->cur.ymax= 5.0; - - G.v2d->tot= G.v2d->cur; - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - - addqueue (curarea->win, REDRAW, 1); - - break; - - /* copy/paste/paste-flip buttons in 3d-view header in PoseMode */ - case B_ACTCOPY: - copy_posebuf(); - allqueue(REDRAWVIEW3D, 1); - break; - case B_ACTPASTE: - paste_posebuf(0); - allqueue(REDRAWVIEW3D, 1); - break; - case B_ACTPASTEFLIP: - paste_posebuf(1); - allqueue(REDRAWVIEW3D, 1); - break; - - /* copy/paste buttons in Action Editor header */ - case B_ACTCOPYKEYS: - copy_actdata(); - break; - case B_ACTPASTEKEYS: - paste_actdata(); - break; - - case B_ACTPIN: /* __PINFAKE */ -/* if (G.saction->flag & SACTION_PIN) { - if (G.saction->action) - G.saction->action->id.us ++; - } - else { - if (G.saction->action) - G.saction->action->id.us --; - } -*/ /* end PINFAKE */ - allqueue(REDRAWACTION, 1); - break; - } -} - -static void do_action_viewmenu(void *arg, int event) -{ - extern int play_anim(int mode); - - switch(event) { - case ACTMENU_VIEW_CENTERVIEW: /* Center View to Current Frame */ - center_currframe(); - break; - case ACTMENU_VIEW_AUTOUPDATE: /* Update Automatically */ - if (BTST(G.saction->lock, 0)) - G.saction->lock = BCLR(G.saction->lock, 0); - else - G.saction->lock = BSET(G.saction->lock, 0); - break; - case ACTMENU_VIEW_PLAY3D: /* Play Back Animation */ - play_anim(0); - break; - case ACTMENU_VIEW_PLAYALL: /* Play Back Animation in All */ - play_anim(1); - break; - case ACTMENU_VIEW_ALL: /* View All */ - do_action_buttons(B_ACTHOME); - break; - case ACTMENU_VIEW_LOCK: - G.v2d->flag ^= V2D_VIEWLOCK; - if(G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0); - break; - case ACTMENU_VIEW_SLIDERS: /* Show sliders (when applicable) */ - G.saction->flag ^= SACTION_SLIDERS; - break; - case ACTMENU_VIEW_MAXIMIZE: /* Maximize Window */ - /* using event B_FULL */ - break; - case ACTMENU_VIEW_NEXTMARKER: /* jump to next marker */ - nextprev_marker(1); - break; - case ACTMENU_VIEW_PREVMARKER: /* jump to previous marker */ - nextprev_marker(-1); - break; - case ACTMENU_VIEW_TIME: /* switch between frames and seconds display */ - G.saction->flag ^= SACTION_DRAWTIME; - break; - case ACTMENU_VIEW_NOHIDE: /* Show hidden channels */ - G.saction->flag ^= SACTION_NOHIDE; - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *action_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_viewmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_action_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Center View to Current Frame|C", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_CENTERVIEW, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.saction->flag & SACTION_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Frames|Ctrl T", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TIME, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Show Seconds|Ctrl T", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_TIME, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_SLIDERS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Sliders|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_SLIDERS, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.saction->flag & SACTION_NOHIDE)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Show Hidden Channels|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_NOHIDE, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_LOCK, ""); - - uiDefIconTextBut(block, BUTM, 1, BTST(G.saction->lock, 0)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Update Automatically|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_AUTOUPDATE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Next Marker|PageUp", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTMARKER, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Jump To Prev Marker|PageDown", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVMARKER, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PLAY3D, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_PLAYALL, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "View All|Home", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, - ACTMENU_VIEW_ALL, ""); - - if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, - "Maximize Window|Ctrl UpArrow", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_VIEW_MAXIMIZE, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, - "Tile Window|Ctrl DownArrow", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_VIEW_MAXIMIZE, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_action_selectmenu_columnmenu(void *arg, int event) -{ - SpaceAction *saction; - bAction *act; - Key *key; - - saction = curarea->spacedata.first; - if (!saction) return; - - act = saction->action; - key = get_action_mesh_key(); - -#if 0 // actionrewite - if (event == ACTMENU_SEL_COLUMN_MARKERSBETWEEN) { - markers_selectkeys_between(); - } - else if (ELEM(event, ACTMENU_SEL_COLUMN_KEYS, ACTMENU_SEL_COLUMN_MARKERSCOLUMN)) { - if (act) - column_select_actionkeys(act, event); - else if (key) - column_select_shapekeys(key, event); - } - else - return; -#endif // actionrewite - - allqueue(REDRAWTIME, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWSOUND, 0); -} - -static uiBlock *action_selectmenu_columnmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_selectmenu_columnmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_selectmenu_columnmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Selected Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "On Selected Markers|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSCOLUMN, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Between Selected Markers|Ctrl K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_COLUMN_MARKERSBETWEEN, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_selectmenu(void *arg, int event) -{ - SpaceAction *saction; - bAction *act; - Key *key; - - saction = curarea->spacedata.first; - if (!saction) return; - - act = saction->action; - key = get_action_mesh_key(); - - switch(event) - { - case ACTMENU_SEL_BORDER: /* Border Select */ - borderselect_action(); - break; - - case ACTMENU_SEL_BORDERM: /* Border Select */ - borderselect_markers(); - break; - - case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */ - deselect_action_keys(1, 1); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - break; - - case ACTMENU_SEL_ALL_CHAN: /* Select/Deselect All Channels */ - deselect_action_channels(1); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - break; - - case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */ - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - break; - - case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */ - deselect_action_keys(0, 2); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - break; - - case ACTMENU_SEL_INVERSE_MARKERS: /* invert selection of markers */ - deselect_markers(0, 2); - allqueue(REDRAWMARKER, 0); - break; - - case ACTMENU_SEL_LEFTKEYS: - selectkeys_leftright(1, SELECT_REPLACE); - break; - - case ACTMENU_SEL_RIGHTKEYS: - selectkeys_leftright(0, SELECT_REPLACE); - break; - } -} - -static uiBlock *action_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_selectmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_action_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Keys|B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDER, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Border Select Markers|Ctrl B", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_BORDERM, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Keys|A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Markers|Ctrl A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_MARKERS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Select/Deselect All Channels", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_ALL_CHAN, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse Keys", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_KEYS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Inverse Markers", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_INVERSE_MARKERS, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Back In Time|Alt RMB", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_LEFTKEYS, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Ahead In Time|Alt RMB", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_SEL_RIGHTKEYS, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_selectmenu_columnmenu, - NULL, ICON_RIGHTARROW_THIN, "Column Select Keys", 0, yco-=20, 120, 20, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_action_keymenu_transformmenu(void *arg, int event) -{ - switch (event) - { - case ACTMENU_KEY_TRANSFORM_MOVE: - transform_action_keys('g', 0); - break; - case ACTMENU_KEY_TRANSFORM_SCALE: - transform_action_keys('s', 0); - break; - case ACTMENU_KEY_TRANSFORM_SLIDE: - transform_action_keys('t', 0); - break; - case ACTMENU_KEY_TRANSFORM_EXTEND: - transform_action_keys('e', 0); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_transformmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_MOVE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Grab/Extend from Frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_EXTEND, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_SCALE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Time Slide|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_TRANSFORM_SLIDE, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_handlemenu(void *arg, int event) -{ - switch (event) { - case ACTMENU_KEY_HANDLE_AUTO: - sethandles_action_keys(HD_AUTO); - break; - - case ACTMENU_KEY_HANDLE_ALIGN: - case ACTMENU_KEY_HANDLE_FREE: - /* OK, this is kinda dumb, need to fix the - * toggle crap in sethandles_ipo_keys() - */ - sethandles_action_keys(HD_ALIGN); - break; - - case ACTMENU_KEY_HANDLE_VECTOR: - sethandles_action_keys(HD_VECT); - break; - } -} - -static uiBlock *action_keymenu_handlemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_handlemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_handlemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Auto|Shift H", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_AUTO, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Aligned|H", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_ALIGN, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Free|H", 0, yco-=20, menuwidth, - 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_FREE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Vector|V", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_HANDLE_VECTOR, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_intpolmenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_INTERP_CONST: - action_set_ipo_flags(SET_IPO_MENU, SET_IPO_CONSTANT); - break; - case ACTMENU_KEY_INTERP_LINEAR: - action_set_ipo_flags(SET_IPO_MENU, SET_IPO_LINEAR); - break; - case ACTMENU_KEY_INTERP_BEZIER: - action_set_ipo_flags(SET_IPO_MENU, SET_IPO_BEZIER); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_intpolmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_intpolmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_intpolmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Constant|Shift T, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_CONST, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Linear|Shift T, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_LINEAR, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Bezier|Shift T, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_INTERP_BEZIER, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_extendmenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_EXTEND_CONST: - action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CONSTANT); - break; - case ACTMENU_KEY_EXTEND_EXTRAPOLATION: - action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_EXTRAPOLATION); - break; - case ACTMENU_KEY_EXTEND_CYCLIC: - action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLIC); - break; - case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION: - action_set_ipo_flags(SET_EXTEND_MENU, SET_EXTEND_CYCLICEXTRAPOLATION); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_extendmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_extendmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_extendmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Constant", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CONST, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Extrapolation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_EXTRAPOLATION, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Cyclic", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CYCLIC, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Cyclic Extrapolation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_chanposmenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN: - down_sel_action(); - break; - case ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP: - up_sel_action(); - break; - case ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_TOP: - top_sel_action(); - break; - case ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_BOTTOM: - bottom_sel_action(); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_chanposmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_chanposmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_chanposmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move Up|Ctrl Page Up", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move Down|Ctrl Page Down", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move to Top|Shift Page Up", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_TOP, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Move to Bottom|Shift Page Down", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_BOTTOM, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_snapmenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_SNAP_NEARFRAME: - case ACTMENU_KEY_SNAP_CURFRAME: - case ACTMENU_KEY_SNAP_NEARMARK: - case ACTMENU_KEY_SNAP_NEARTIME: - snap_action_keys(event); - break; - - case ACTMENU_KEY_SNAP_CFRA2KEY: - snap_cfra_action(); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_snapmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_snapmenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_snapmenu, NULL); - - if (G.saction->flag & SACTION_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Second|Shift S, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARTIME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Current Time|Shift S, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_CURFRAME, ""); - - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Frame|Shift S, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARFRAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Current Frame|Shift S, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_CURFRAME, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Key -> Nearest Marker|Shift S, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARMARK, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Current Frame -> Key|Ctrl Shift S", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_SNAP_NEARMARK, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu_mirrormenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_KEY_MIRROR_CURFRAME: - case ACTMENU_KEY_MIRROR_YAXIS: - mirror_action_keys(event); - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *action_keymenu_mirrormenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu_mirrormenu", - UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_action_keymenu_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Current Frame|Shift M, 1", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_CURFRAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Vertical Axis|Shift M, 2", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_YAXIS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Horizontal Axis|Shift M, 3", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_XAXIS, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Selected Marker|Shift M, 4", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_MIRROR_MARKER, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_action_keymenu(void *arg, int event) -{ - SpaceAction *saction; - bAction *act; - Key *key; - - saction = curarea->spacedata.first; - if (!saction) return; - - act = saction->action; - key = get_action_mesh_key(); - - switch(event) - { - case ACTMENU_KEY_DUPLICATE: - duplicate_action_keys(); - break; - case ACTMENU_KEY_DELETE: - delete_action_keys (); - break; - case ACTMENU_KEY_CLEAN: - clean_action(); - break; - } -} - -static uiBlock *action_keymenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_keymenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_action_keymenu, NULL); - - uiDefIconTextBlockBut(block, action_keymenu_transformmenu, - NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_snapmenu, - NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBlockBut(block, action_keymenu_mirrormenu, - NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Duplicate|Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DUPLICATE, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Delete|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_DELETE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Clean Action|O", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, - ACTMENU_KEY_CLEAN, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_keymenu_handlemenu, - NULL, ICON_RIGHTARROW_THIN, - "Handle Type", 0, yco-=20, 120, 20, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, action_keymenu_extendmenu, - NULL, ICON_RIGHTARROW_THIN, - "Extend Mode", 0, yco-=20, 120, 20, ""); - uiDefIconTextBlockBut(block, action_keymenu_intpolmenu, - NULL, ICON_RIGHTARROW_THIN, - "Interpolation Mode", 0, yco-=20, 120, 20, ""); - uiDefIconTextBlockBut(block, action_keymenu_chanposmenu, - NULL, ICON_RIGHTARROW_THIN, - "Channel Ordering", 0, yco-=20, 120, 20, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_action_markermenu(void *arg, int event) -{ - switch(event) - { - case ACTMENU_MARKERS_ADD: - add_marker(CFRA); - break; - case ACTMENU_MARKERS_DUPLICATE: - duplicate_marker(); - break; - case ACTMENU_MARKERS_DELETE: - remove_marker(); - break; - case ACTMENU_MARKERS_NAME: - rename_marker(); - break; - case ACTMENU_MARKERS_MOVE: - transform_markers('g', 0); - break; - } - - allqueue(REDRAWMARKER, 0); -} - -static uiBlock *action_markermenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "action_markermenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_action_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void action_buttons(void) -{ - uiBlock *block; - short xco, xmax; - char name[256]; - Object *ob; - ID *from; - - if (G.saction == NULL) - return; - - /* copied from drawactionspace.... */ - if (!G.saction->pin) { - if (OBACT) - G.saction->action = OBACT->action; - else - G.saction->action= NULL; - } - - sprintf(name, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, name, - UI_EMBOSS, UI_HELV, curarea->headwin); - - if (area_is_active_area(curarea)) - uiBlockSetCol(block, TH_HEADER); - else - uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_ACTION; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco, 0, XIC+10, YIC, - &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type. " - "Click for menu of available types."); - - xco += XIC + 14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if (curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Show pulldown menus"); - } - else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if ((curarea->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, action_viewmenu, NULL, - "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, action_selectmenu, NULL, - "Select", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block, action_markermenu, NULL, - "Marker", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Key"); - uiDefPulldownBut(block, action_keymenu, NULL, - "Key", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* NAME ETC */ - ob= OBACT; - from = (ID *)ob; - - xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin, - B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action, - from, &(G.saction->actnr), B_ACTALONE, - B_ACTLOCAL, B_ACTIONDELETE, 0, 0); - - uiClearButLock(); - - /* draw AUTOSNAP */ - xco += 8; - - if (G.saction->flag & SACTION_DRAWTIME) { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Keyframes %t|Off %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for keyframes when transforming"); - } - else { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Keyframes %t|Off %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.saction->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for keyframes when transforming"); - } - - xco += (70 + 8); - - /* COPY PASTE */ - uiBlockBeginAlign(block); - if (curarea->headertype==HEADERTOP) { - uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYUP, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); - } - else { - uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer"); - } - uiBlockEndAlign(block); - xco += (XIC + 8); - - /* draw LOCK */ - uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco, 0, XIC, YIC, - &(G.saction->lock), 0, 0, 0, 0, - "Updates other affected window spaces automatically " - "to reflect changes in real time"); - - /* always as last */ - curarea->headbutlen = xco + 2*XIC; - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c deleted file mode 100644 index 07a63a46903..00000000000 --- a/source/blender/src/header_buttonswin.c +++ /dev/null @@ -1,729 +0,0 @@ -/** - * header_buttonswin.c oct-2003 - * - * Functions to draw the "Buttons Window" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_ID.h" -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_world_types.h" - -#include "BIF_editconstraint.h" -#include "BIF_interface.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_butspace.h" - -#include "BKE_armature.h" -#include "BKE_blender.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_node.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BSE_drawipo.h" -#include "BSE_node.h" -#include "BSE_headerbuttons.h" - -#include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" - -#include "blendef.h" -#include "mydevice.h" -#include "butspace.h" - -Material matcopybuf; - -void clear_matcopybuf(void) -{ - memset(&matcopybuf, 0, sizeof(Material)); -} - -void free_matcopybuf(void) -{ - extern MTex mtexcopybuf; /* buttons.c */ - int a; - - for(a=0; awin==0) return; - - switch(event) { - case B_BUTSHOME: - uiSetPanel_view2d(curarea); - G.v2d->cur= G.v2d->tot; - test_view2d(G.v2d, curarea->winx, curarea->winy); - - /* we always put in left/top */ - dy= G.v2d->tot.ymax - G.v2d->cur.ymax; - G.v2d->cur.ymin += dy; - G.v2d->cur.ymax += dy; - dx= G.v2d->tot.xmin - G.v2d->cur.xmin; - G.v2d->cur.xmin += dx; - G.v2d->cur.xmax += dx; - - scrarea_queue_winredraw(curarea); - break; - case B_BUTSPREVIEW: - BIF_preview_changed(ID_TE); - G.buts->oldkeypress = 0; - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - case B_CONTEXT_SWITCH: - G.buts->oldkeypress = 0; - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - case B_MATCOPY: - if(G.buts->lockpoin) { - ma= G.buts->lockpoin; - if(matcopied) free_matcopybuf(); - - memcpy(&matcopybuf, ma, sizeof(Material)); - if(matcopybuf.ramp_col) matcopybuf.ramp_col= MEM_dupallocN(matcopybuf.ramp_col); - if(matcopybuf.ramp_spec) matcopybuf.ramp_spec= MEM_dupallocN(matcopybuf.ramp_spec); - - for(a=0; anodetree, 0); - matcopied= 1; - } - break; - case B_MATPASTE: - if(matcopied && G.buts->lockpoin) { - ma= G.buts->lockpoin; - - /* free current mat */ - if(ma->ramp_col) MEM_freeN(ma->ramp_col); - if(ma->ramp_spec) MEM_freeN(ma->ramp_spec); - for(a=0; amtex[a]; - if(mtex && mtex->tex) mtex->tex->id.us--; - if(mtex) MEM_freeN(mtex); - } - - if(ma->nodetree) { - ntreeFreeTree(ma->nodetree); - MEM_freeN(ma->nodetree); - } - - id= (ma->id); - memcpy(ma, &matcopybuf, sizeof(Material)); - (ma->id)= id; - - if(matcopybuf.ramp_col) ma->ramp_col= MEM_dupallocN(matcopybuf.ramp_col); - if(matcopybuf.ramp_spec) ma->ramp_spec= MEM_dupallocN(matcopybuf.ramp_spec); - - for(a=0; amtex[a]; - if(mtex) { - ma->mtex[a]= MEM_dupallocN(mtex); - if(mtex->tex) id_us_plus((ID *)mtex->tex); - } - } - - ma->nodetree= ntreeCopyTree(matcopybuf.nodetree, 0); - - BIF_preview_changed(ID_MA); - BIF_undo_push("Paste material settings"); - scrarea_queue_winredraw(curarea); - } - break; - case B_MESHTYPE: - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - break; - } -} - -void buttons_active_id(ID **id, ID **idfrom) -{ - Object *ob= OBACT; - Material *ma; - - *id= NULL; - *idfrom= (ID *)ob; - - if(G.buts->mainb==CONTEXT_SCENE) { - int tab= G.buts->tab[CONTEXT_SCENE]; - - if(tab==TAB_SCENE_RENDER) *id= (ID *)G.scene; - else if(tab==TAB_SCENE_SOUND) { - ID *search; - - // validate lockpoin, maybe its not a sound - if (G.buts->lockpoin) { - search = G.main->sound.first; - while (search) { - if (search == G.buts->lockpoin) { - break; - } - search = search->next; - } - if (search == NULL) { - *id = G.main->sound.first; - } else { - *id = search; - } - } - else { - *id = G.main->sound.first; - } - - } - } - else if(G.buts->mainb==CONTEXT_SHADING) { - int tab= G.buts->tab[CONTEXT_SHADING]; - - if(tab==TAB_SHADING_LAMP) { - if(ob && ob->type==OB_LAMP) { - *id= ob->data; - } - } - else if(tab==TAB_SHADING_MAT) { - if(ob && (ob->typetype) { - *id= (ID *)give_current_material(ob, ob->actcol); - *idfrom= material_from(ob, ob->actcol); - } - } - else if(tab==TAB_SHADING_WORLD) { - *id= (ID *)G.scene->world; - *idfrom= (ID *)G.scene; - } - else if(tab==TAB_SHADING_TEX) { - MTex *mtex; - - if(G.buts->mainbo==G.buts->mainb && G.buts->tabo!=tab) { - if(G.buts->tabo==TAB_SHADING_LAMP) G.buts->texfrom= 2; - else if(G.buts->tabo==TAB_SHADING_WORLD) G.buts->texfrom= 1; - else if(G.buts->tabo==TAB_SHADING_MAT) G.buts->texfrom= 0; - } - - if(G.buts->texfrom==0) { - if(ob && ob->typetype) { - bNode *node= NULL; - - ma= give_current_material(ob, ob->actcol); - if(ma && ma->use_nodes) - node= editnode_get_active_idnode(ma->nodetree, ID_TE); - - if(node) { - *idfrom= NULL; - *id= node->id; - } - else { - ma= editnode_get_active_material(ma); - *idfrom= (ID *)ma; - if(ma) { - mtex= ma->mtex[ ma->texact ]; - if(mtex) *id= (ID *)mtex->tex; - } - } - } - } - else if(G.buts->texfrom==1) { - World *wrld= G.scene->world; - *idfrom= (ID *)wrld; - if(wrld) { - mtex= wrld->mtex[ wrld->texact]; - if(mtex) *id= (ID *)mtex->tex; - } - } - else if(G.buts->texfrom==2) { - Lamp *la; - if(ob && ob->type==OB_LAMP) { - la= ob->data; - *idfrom= (ID *)la; - mtex= la->mtex[ la->texact]; - if(mtex) *id= (ID *)mtex->tex; - } - } - else if(G.buts->texfrom==3) { - if(G.f & G_SCULPTMODE) { - if(G.scene->sculptdata.texact != -1) { - mtex= G.scene->sculptdata.mtex[G.scene->sculptdata.texact]; - if(mtex) *id= (ID*)mtex->tex; - } - } else { - Brush *brush= G.scene->toolsettings->imapaint.brush; - if (brush) { - mtex= brush->mtex[brush->texact]; - if(mtex) *id= (ID*)mtex->tex; - } - } - } - } - } - else if(G.buts->mainb==CONTEXT_OBJECT || G.buts->mainb==CONTEXT_LOGIC) { - if(ob) { - *idfrom= (ID *)G.scene; - *id= (ID *)ob; - } - } - else if(G.buts->mainb==CONTEXT_EDITING) { - if(ob && ob->data) { - *id= ob->data; - } - } -} - -static void do_buts_view_shadingmenu(void *arg, int event) -{ - G.buts->mainb = CONTEXT_SHADING; - - allqueue(REDRAWBUTSALL, 0); -} - - -static uiBlock *buts_view_shadingmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "buts_view_shadingmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_buts_view_shadingmenu, NULL); - - if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Lamp|F5", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_LAMP, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Lamp|F5", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_LAMP, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Material|F5", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_MAT, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Material|F5", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_MAT, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Texture|F6", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_TEX, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Texture|F6", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_TEX, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_RAD)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Radiosity", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_RAD, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Radiosity", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_RAD, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SHADING) && (G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "World|F8", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_WORLD, 1.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "World|F8", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SHADING]), (float)TAB_SHADING_WORLD, 1.0, 0, 10, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_buts_view_scenemenu(void *arg, int event) -{ - G.buts->mainb = CONTEXT_SCENE; - - allqueue(REDRAWBUTSALL, 0); -} - - -static uiBlock *buts_view_scenemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "buts_view_scenemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_buts_view_scenemenu, NULL); - - if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_RENDER)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Render|F10", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_RENDER, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Render|F10", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_RENDER, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_ANIM)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Animation", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_ANIM, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Animation", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_ANIM, 0.0, 0, 10, ""); - } - - if((G.buts->mainb == CONTEXT_SCENE) && (G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND)) { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Sound", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SOUND, 0.0, 0, 10, ""); - } else { - uiDefIconTextButC(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Sound", - 0, yco-=20, menuwidth, 19, &(G.buts->tab[CONTEXT_SCENE]), (float)TAB_SCENE_SOUND, 0.0, 0, 10, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_buts_view_alignmenu(void *arg, int event) -{ - SpaceButs *sbuts= curarea->spacedata.first; - - switch(event) { - case 0: /* panel alignment */ - case 1: - case 2: - sbuts->align= event; - if(event) { - uiAlignPanelStep(curarea, 1.0); - do_buts_buttons(B_BUTSHOME); - } - break; - } - - allqueue(REDRAWBUTSALL, 0); -} - - -static uiBlock *buts_view_alignmenu(void *arg_unused) -{ - SpaceButs *sbuts= curarea->spacedata.first; - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "buts_view_alignmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_buts_view_alignmenu, NULL); - - if (sbuts->align == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Horizontal", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - if (sbuts->align == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Vertical", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Vertical", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - if (sbuts->align == 0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Free", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Free", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_buts_viewmenu(void *arg, int event) -{ - SpaceButs *sbuts= curarea->spacedata.first; - - switch(event) { - case 1: /* zoom in */ - view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy); - break; - case 2: /* zoom out */ - view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy); - break; - case 3: /* View All */ - do_buts_buttons(B_BUTSHOME); - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 10: /* empty for the context events */ - break; - } - allqueue(REDRAWBUTSALL, 0); -} - -static uiBlock *buts_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "buts_viewmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_buts_viewmenu, NULL); - - if(G.buts->mainb==CONTEXT_LOGIC) { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Logic|F4", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), CONTEXT_LOGIC, 0.0, 0, 10, ""); - } else { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Logic|F4", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), CONTEXT_LOGIC, 0.0, 0, 10, ""); - } - - if(G.buts->mainb==CONTEXT_SCRIPT) { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Script", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_SCRIPT, 0.0, 0, 10, ""); - } else { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Script", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_SCRIPT, 0.0, 0, 10, ""); - } - - uiDefIconTextBlockBut(block, buts_view_shadingmenu, NULL, ICON_RIGHTARROW_THIN, "Shading", 0, yco-=20, 120, 19, ""); - - if(G.buts->mainb==CONTEXT_OBJECT) { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Object|F7", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_OBJECT, 0.0, 0, 10, ""); - } else { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Object|F7", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_OBJECT, 0.0, 0, 10, ""); - } - - if(G.buts->mainb==CONTEXT_EDITING) { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_HLT, "Editing|F9", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_EDITING, 0.0, 0, 10, ""); - } else { - uiDefIconTextButS(block, BUTM, B_REDR, ICON_CHECKBOX_DEHLT, "Editing|F9", - 0, yco-=20, menuwidth, 19, &(G.buts->mainb), (float)CONTEXT_EDITING, 0.0, 0, 10, ""); - } - - uiDefIconTextBlockBut(block, buts_view_scenemenu, NULL, ICON_RIGHTARROW_THIN, "Scene", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, buts_view_alignmenu, NULL, ICON_RIGHTARROW_THIN, "Align", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void buts_buttons(void) -{ - uiBlock *block; - ID *id, *idfrom; - short xco, xmax, t_base= 0; - char naam[20]; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_BUTS; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco, 0, XIC+10, YIC, - &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type. " - "Click for menu of available types."); - - xco += XIC + 14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if (curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Show pulldown menus"); - } - else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("Panels"); - uiDefPulldownBut(block, buts_viewmenu, NULL, - "Panels", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - - /* FULL WINDOW */ -// if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); -// else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); - - /* HOME */ -// uiDefIconBut(block, BUT, B_BUTSHOME, ICON_HOME, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms window to home view showing all items (HOMEKEY)"); -// xco+=XIC; - - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_GAME, xco, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_LOGIC, 0, 0, "Logic (F4) "); - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCRIPT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SCRIPT, 0, 0, "Script "); - uiDefIconButS(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL_DEHLT,xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SHADING, 0, 0, "Shading (F5) "); - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_OBJECT, 0, 0, "Object (F7) "); - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_EDIT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_EDITING, 0, 0, "Editing (F9) "); - uiDefIconButS(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE_DEHLT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SCENE, 0, 0, "Scene (F10) "); - - xco+= XIC; - - /* select the context to be drawn, per contex/tab the actual context is tested */ - uiBlockSetEmboss(block, UI_EMBOSS); // normal - switch(G.buts->mainb) { - case CONTEXT_SCENE: - uiBlockBeginAlign(block); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SCENE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons "); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_ANIM, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_ANIM, 0, 0, "Anim/playback buttons"); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_SOUND, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SOUND, 0, 0, "Sound block buttons"); - - break; - case CONTEXT_OBJECT: - uiBlockBeginAlign(block); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_OBJECT, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_OBJECT, 0, 0, "Object buttons "); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PHYSICS, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PHYSICS, 0, 0, "Physics buttons"); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_PARTICLES, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_OBJECT]), 1.0, (float)TAB_OBJECT_PARTICLE, 0, 0, "Particle buttons"); - - break; - case CONTEXT_SHADING: - uiBlockBeginAlign(block); - uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_LAMP, 0, 0, "Lamp buttons"); - uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_MAT, 0, 0, "Material buttons"); - uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_TEX, 0, 0, "Texture buttons(F6)"); - uiDefIconButC(block, ROW, B_CONTEXT_SWITCH, ICON_RADIO,xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_RAD, 0, 0, "Radiosity buttons"); - uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_WORLD, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_WORLD, 0, 0, "World buttons"); - - break; - case CONTEXT_EDITING: - - break; - case CONTEXT_SCRIPT: - - break; - case CONTEXT_LOGIC: - - break; - } - - uiBlockEndAlign(block); - - xco+=XIC; - uiDefButI(block, NUM, B_NEWFRAME, "", (xco+20),0,60,YIC, &(G.scene->r.cfra), 1.0, MAXFRAMEF, 0, 0, "Displays Current Frame of animation. Click to change."); - xco+= 80; - - buttons_active_id(&id, &idfrom); - G.buts->lockpoin= id; - - /* always do as last */ - uiDrawBlock(block); - curarea->headbutlen= xco; -} diff --git a/source/blender/src/header_filesel.c b/source/blender/src/header_filesel.c deleted file mode 100644 index 999fa2733af..00000000000 --- a/source/blender/src/header_filesel.c +++ /dev/null @@ -1,194 +0,0 @@ -/** - * header_filesel.c oct-2003 - * - * Functions to draw the "File Browser" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_ID.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" - -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_language.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BLI_blenlib.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" - -#include "blendef.h" -#include "mydevice.h" - -void do_file_buttons(short event) -{ - SpaceFile *sfile; - - if(curarea->win==0) return; - sfile= curarea->spacedata.first; - - switch(event) { - case B_SORTFILELIST: - sort_filelist(sfile); - scrarea_queue_winredraw(curarea); - break; - case B_RELOADDIR: - freefilelist(sfile); - scrarea_queue_winredraw(curarea); - break; - } - -} - -void file_buttons(void) -{ - SpaceFile *sfile; - uiBlock *block; - float df, totlen, sellen; - short xco, xcotitle; - int totfile, selfile; - char naam[256]; - - sfile= curarea->spacedata.first; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_FILE; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - - xco+= XIC+22; - - /* FULL WINDOW */ - if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); - else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); - - /* SORT TYPE */ - xco+=XIC; - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTALPHA, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically"); - uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTBYEXT, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 3.0, 0, 0, "Sorts files by extension"); - uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTTIME, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 1.0, 0, 0, "Sorts files by time"); - uiDefIconButS(block, ROW, B_SORTFILELIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &sfile->sort, 1.0, 2.0, 0, 0, "Sorts files by size"); - uiBlockEndAlign(block); - - cpack(0x0); - xco+=XIC+10; - - xcotitle= xco; - xco+= BIF_GetStringWidth(G.font, sfile->title, (U.transopts & USER_TR_BUTTONS)); - - if(sfile->pupmenu && sfile->menup) { - uiDefButS(block, MENU, B_NOP, sfile->pupmenu, xco+10,0,90,20, sfile->menup, 0, 0, 0, 0, ""); - xco+= 100; - } - uiBlockBeginAlign(block); - uiDefIconButBitS(block, ICONTOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_LONGDISPLAY,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Toggles long info"); - uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &sfile->flag, 0, 0, 0, 0, "Hides dot files"); - uiBlockEndAlign(block); - - uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); - - xco+=90; - - if(sfile->type==FILE_LOADLIB) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Copies selected data into current project"); - uiDefButBitS(block, TOG, FILE_LINK, B_REDR, "Link", xco+=100,0,100,YIC, &sfile->flag, 0, 0, 0, 0, "Creates a link to selected data from current project"); - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, FILE_AUTOSELECT, B_REDR, "Autosel", xco+=125,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Autoselect imported objects"); - uiDefButBitS(block, TOG, FILE_ACTIVELAY, B_REDR, "Active Layer", xco+=65,0,80,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) in active layer"); - uiDefButBitS(block, TOG, FILE_ATCURSOR, B_REDR, "At Cursor", xco+=80,0,65,YIC, &sfile->flag, 0, 0, 0, 0, "Append object(s) at cursor, use centroid if more than one object is selected"); - uiBlockEndAlign(block); - - xco+= 100; // scroll - - } else if(sfile->type==FILE_BLENDER) { - uiDefButBitI(block, TOGN, G_FILE_NO_UI, B_REDR, "Load UI", xco+=XIC,0,80,YIC, &G.fileflags, 0, 0, 0, 0, "Load the UI setup as well as the scene data"); - - xco+= 100; // scroll - } - #ifdef INTERNATIONAL - else if(sfile->type==FILE_LOADFONT) { - uiDefIconButBitS(block, TOG, FILE_SHOWSHORT, B_SORTFILELIST, ICON_FONTPREVIEW, xco+= XIC, 0, XIC, YIC, &sfile->f_fp, 0, 0, 0, 0, "Activate font preview"); - if (sfile->f_fp) - uiDefButC(block, FTPREVIEW, 0, "Font preview", xco+= XIC, 0, 100, YIC, sfile->fp_str, (float)0, (float)16, 0, 0, "Font preview"); - - xco+= 100; // scroll - } - #endif - - uiDrawBlock(block); - - glRasterPos2f((float)xcotitle, 5.0); - BIF_RasterPos((float)xcotitle, 5.0); // stupid texture fonts - BIF_ThemeColor(TH_TEXT); - BIF_DrawString(uiBlockGetCurFont(block), sfile->title, (U.transopts & USER_TR_BUTTONS)); - - if(sfile->type==FILE_UNIX) { - df= BLI_diskfree(sfile->dir)/(1048576.0); - - filesel_statistics(sfile, &totfile, &selfile, &totlen, &sellen); - - sprintf(naam, "Free: %.3f MB Files: (%d) %d (%.3f) %.3f MB", df, selfile,totfile, sellen, totlen); - - cpack(0x0); - glRasterPos2f((float)xco, 5.0); - BIF_RasterPos((float)xco, 5.0); // texture fonts - - BIF_DrawString(G.font, naam, 0); - } - - /* always do as last */ - curarea->headbutlen= xco+2*XIC; -} diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c deleted file mode 100644 index 5b8c33309a0..00000000000 --- a/source/blender/src/header_image.c +++ /dev/null @@ -1,1305 +0,0 @@ -/** - * header_image.c oct-2003 - * - * Functions to draw the "UV/Image Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_brush_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_customdata_types.h" /* for UV layer menu */ - -#include "BLI_blenlib.h" - -#include "BDR_drawmesh.h" -#include "BDR_unwrapper.h" - -#include "BKE_brush.h" -#include "BKE_colortools.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" -#include "BLI_editVert.h" /* for UV layer menu */ -#include "BKE_customdata.h" /* ditto */ - -#include "BIF_butspace.h" -#include "BIF_drawimage.h" -#include "BIF_editsima.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_transform.h" -#include "BIF_toolbox.h" -#include "BIF_editmesh.h" - -#include "BSE_drawview.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_trans_types.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "IMB_imbuf_types.h" - -#include "RE_pipeline.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -void do_image_buttons(unsigned short event) -{ - ToolSettings *settings= G.scene->toolsettings; - ID *id, *idtest; - int nr; - - if(curarea->win==0) return; - - if(event<=100) { - if(event<=50) do_global_buttons2(event); - else do_global_buttons(event); - return; - } - - switch(event) { - case B_SIMAPIN: - allqueue (REDRAWIMAGE, 0); - break; - case B_SIMAGEHOME: - image_home(); - break; - - case B_SIMABROWSE: - if(G.sima->imanr== -2) { - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE, - &G.sima->imanr, do_image_buttons); - } else { - activate_databrowse((ID *)G.sima->image, ID_IM, 0, B_SIMABROWSE, - &G.sima->imanr, do_image_buttons); - } - return; - } - if(G.sima->imanr < 0) break; - - nr= 1; - id= (ID *)G.sima->image; - - idtest= BLI_findlink(&G.main->image, G.sima->imanr-1); - if(idtest==NULL) { /* no new */ - return; - } - - if(idtest!=id) { - G.sima->image= (Image *)idtest; - if(idtest->us==0) idtest->us= 1; - BKE_image_signal(G.sima->image, &G.sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE); - allqueue(REDRAWIMAGE, 0); - } - /* also when image is the same: assign! 0==no tileflag: */ - image_changed(G.sima, (Image *)idtest); - BIF_undo_push("Assign image UV"); - - break; - case B_SIMAGETILE: - image_set_tile(G.sima, 1); /* 1: only tileflag */ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_SIMA3DVIEWDRAW: - allqueue(REDRAWVIEW3D, 0); - break; - case B_SIMA_REDR_IMA_3D: - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - break; - case B_SIMAGEPAINTTOOL: - if(G.sima->flag & SI_DRAWTOOL) - /* add new brush if none exists */ - brush_check_exists(&G.scene->toolsettings->imapaint.brush); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - break; - - case B_SIMAPACKIMA: - pack_image_sima(); - break; - - case B_SIMA_REPACK: - BKE_image_memorypack(G.sima->image); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMA_USE_ALPHA: - G.sima->flag &= ~(SI_SHOW_ALPHA|SI_SHOW_ZBUF); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMA_SHOW_ALPHA: - G.sima->flag &= ~(SI_USE_ALPHA|SI_SHOW_ZBUF); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMA_SHOW_ZBUF: - G.sima->flag &= ~(SI_SHOW_ALPHA|SI_USE_ALPHA); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_SIMARELOAD: - reload_image_sima(); - break; - case B_SIMAGELOAD: - open_image_sima(0); - break; - case B_SIMANAME: - if(G.sima->image) { - Image *ima; - char str[FILE_MAXDIR+FILE_MAXFILE]; - - /* name in ima has been changed by button! */ - BLI_strncpy(str, G.sima->image->name, sizeof(str)); - ima= BKE_add_image_file(str); - if(ima) { - BKE_image_signal(ima, &G.sima->iuser, IMA_SIGNAL_RELOAD); - image_changed(G.sima, ima); - } - BIF_undo_push("Load image"); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SIMAMULTI: - if(G.sima && G.sima->image) { - BKE_image_multilayer_index(G.sima->image->rr, &G.sima->iuser); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_TRANS_IMAGE: - image_editvertex_buts(NULL); - break; - case B_CURSOR_IMAGE: - image_editcursor_buts(NULL); - break; - - case B_TWINANIM: - { - Image *ima; - int nr; - - ima = G.sima->image; - if (ima) { - if(ima->flag & IMA_TWINANIM) { - nr= ima->xrep*ima->yrep; - if(ima->twsta>=nr) ima->twsta= 1; - if(ima->twend>=nr) ima->twend= nr-1; - if(ima->twsta>ima->twend) ima->twsta= 1; - allqueue(REDRAWIMAGE, 0); - } - } - break; - } - case B_SIMACLONEBROWSE: - if (settings->imapaint.brush) - if (brush_clone_image_set_nr(settings->imapaint.brush, G.sima->menunr)) - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMACLONEDELETE: - if (settings->imapaint.brush) - if (brush_clone_image_delete(settings->imapaint.brush)) - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMABRUSHCHANGE: - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case B_SIMACURVES: - curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima)); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMARANGE: - curvemapping_set_black_white(G.sima->cumap, NULL, NULL); - curvemapping_do_ibuf(G.sima->cumap, imagewindow_get_ibuf(G.sima)); - allqueue(REDRAWIMAGE, 0); - break; - - case B_SIMABRUSHBROWSE: - if(G.sima->menunr==-2) { - activate_databrowse((ID*)settings->imapaint.brush, ID_BR, 0, B_SIMABRUSHBROWSE, &G.sima->menunr, do_global_buttons); - break; - } - else if(G.sima->menunr < 0) break; - - if(brush_set_nr(&settings->imapaint.brush, G.sima->menunr)) { - BIF_undo_push("Browse Brush"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - break; - case B_SIMABRUSHDELETE: - if(brush_delete(&settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush"); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - break; - case B_KEEPDATA: - brush_toggle_fake_user(settings->imapaint.brush); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - break; - case B_SIMABRUSHLOCAL: - if(settings->imapaint.brush && settings->imapaint.brush->id.lib) { - if(okee("Make local")) { - make_local_brush(settings->imapaint.brush); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } - break; - case B_SIMABTEXBROWSE: - if(settings->imapaint.brush) { - Brush *brush= settings->imapaint.brush; - - if(G.sima->menunr==-2) { - MTex *mtex= brush->mtex[brush->texact]; - ID *id= (ID*)((mtex)? mtex->tex: NULL); - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons); - } else { - activate_databrowse(id, ID_TE, 0, B_SIMABTEXBROWSE, &G.sima->menunr, do_image_buttons); - } - break; - } - else if(G.sima->menunr < 0) break; - - if(brush_texture_set_nr(brush, G.sima->menunr)) { - BIF_undo_push("Browse Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_SIMABTEXDELETE: - if(settings->imapaint.brush) { - if (brush_texture_delete(settings->imapaint.brush)) { - BIF_undo_push("Unlink Brush Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); - } - } - break; - case B_SIMA_PLAY: - play_anim(0); - break; - case B_SIMA_RECORD: - imagespace_composite_flipbook(curarea); - break; - } -} - -static void do_image_buttons_set_uvlayer_callback(void *act, void *data) -{ - CustomData_set_layer_active(&G.editMesh->fdata, CD_MTFACE, *((int *)act)); - - BIF_undo_push("Set Active UV Texture"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWIMAGE, 0); -} - -static void do_image_view_viewnavmenu(void *arg, int event) -{ - switch(event) { - case 1: /* Zoom In */ - image_viewzoom(PADPLUSKEY, 0); - break; - case 2: /* Zoom Out */ - image_viewzoom(PADMINUS, 0); - break; - case 3: /* Zoom 8:1 */ - image_viewzoom(PAD8, 0); - break; - case 4: /* Zoom 4:1 */ - image_viewzoom(PAD4, 0); - break; - case 5: /* Zoom 2:1 */ - image_viewzoom(PAD2, 0); - break; - case 6: /* Zoom 1:1 */ - image_viewzoom(PAD1, 0); - break; - case 7: /* Zoom 1:2 */ - image_viewzoom(PAD2, 1); - break; - case 8: /* Zoom 1:4 */ - image_viewzoom(PAD4, 1); - break; - case 9: /* Zoom 1:8 */ - image_viewzoom(PAD8, 1); - break; - } - allqueue(REDRAWIMAGE, 0); -} - -static uiBlock *image_view_viewnavmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "image_view_viewnavmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_view_viewnavmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:8|Shift+NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:4|Shift+NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:2|Shift+NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 1:1|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 2:1|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 4:1|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom 8:1|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_image_viewmenu(void *arg, int event) -{ - - switch(event) { - case 0: /* Update Automatically */ - if(G.sima->lock) G.sima->lock = 0; - else G.sima->lock = 1; - break; - case 1: /* View All */ - do_image_buttons(B_SIMAGEHOME); - break; - case 2: /* Maximize Window */ - /* using event B_FULL */ - break; - case 4: /* Realtime Panel... */ - add_blockhandler(curarea, IMAGE_HANDLER_VIEW_PROPERTIES, UI_PNL_UNSTOW); - break; - case 5: /* Draw Shadow Mesh */ - G.sima->flag ^= SI_DRAWSHADOW; - allqueue(REDRAWIMAGE, 0); - break; - case 6: /* Draw Faces */ - G.f ^= G_DRAWFACES; - allqueue(REDRAWIMAGE, 0); - break; - case 7: /* Properties Panel */ - add_blockhandler(curarea, IMAGE_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 8: /* Paint Panel... */ - add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW); - break; - case 9: - image_viewcenter(); - case 10: /* Display Normalized Coordinates */ - G.sima->flag ^= SI_COORDFLOATS; - allqueue(REDRAWIMAGE, 0); - break; - case 11: /* Curves Panel... */ - add_blockhandler(curarea, IMAGE_HANDLER_CURVES, UI_PNL_UNSTOW); - break; - case 12: /* composite preview */ - toggle_blockhandler(curarea, IMAGE_HANDLER_PREVIEW, 0); - scrarea_queue_winredraw(curarea); - break; - case 13: /* Realtime Panel... */ - add_blockhandler(curarea, IMAGE_HANDLER_GAME_PROPERTIES, UI_PNL_UNSTOW); - break; - case 14: /* Draw active image UV's only*/ - G.sima->flag ^= SI_LOCAL_UV; - allqueue(REDRAWIMAGE, 0); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *image_viewmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "image_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_image_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Real-time Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Composite Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); - - if(G.sima->flag & SI_COORDFLOATS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Display Normalized Coordinates|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Display Normalized Coordinates|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - if(G.f & G_DRAWFACES) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Draw Faces", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Draw Faces|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - if(G.sima->flag & SI_DRAWSHADOW) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Draw Shadow Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Draw Shadow Mesh|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.sima->flag & SI_LOCAL_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - if(!(G.sima->flag & SI_LOCAL_UV)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, image_view_viewnavmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, ""); - - if(G.sima->lock) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_image_selectmenu(void *arg, int event) -{ - switch(event) - { - case 0: /* Border Select */ - borderselect_sima(UV_SELECT_ALL); - break; - case 8: /* Border Select Pinned */ - borderselect_sima(UV_SELECT_PINNED); - break; - case 1: /* Select/Deselect All */ - select_swap_tface_uv(); - break; - case 9: /* Select Inverse */ - select_invert_tface_uv(); - break; - case 2: /* Unlink Selection */ - unlink_selection(); - break; - case 3: /* Linked UVs */ - select_linked_tface_uv(2); - break; - case 6: /* Toggle Active Face Select */ - if(G.sima->flag & SI_SELACTFACE) - G.sima->flag &= ~SI_SELACTFACE; - else - G.sima->flag |= SI_SELACTFACE; - allqueue(REDRAWIMAGE, 0); - break; - case 7: /* Pinned UVs */ - select_pinned_tface_uv(); - break; - } -} - -static uiBlock *image_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "image_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_image_selectmenu, NULL); - - - if ((G.sima->flag & SI_SYNC_UVSEL)==0 || (G.sima->flag & SI_SYNC_UVSEL && (G.scene->selectmode != SCE_SELECT_FACE))) { - if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Pinned|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unlink Selection|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pinned UVs|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked UVs|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_image_image_rtmappingmenu(void *arg, int event) -{ - switch(event) { - case 0: /* UV Co-ordinates */ - G.sima->image->flag &= ~IMA_REFLECT; - break; - case 1: /* Reflection */ - G.sima->image->flag |= IMA_REFLECT; - break; - } - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *image_image_rtmappingmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_image_rtmappingmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_image_rtmappingmenu, NULL); - - if (G.sima->image->flag & IMA_REFLECT) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "UV Co-ordinates", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Reflection", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "UV Co-ordinates", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Reflection", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_imagemenu(void *arg, int event) -{ - /* events >=20 are registered bpython scripts */ - if (event >= 20) BPY_menu_do_python(PYMENU_IMAGE, event - 20); - - switch(event) - { - case 0: - open_image_sima((G.qual==LR_CTRLKEY)); - break; - case 1: - replace_image_sima((G.qual==LR_CTRLKEY)); - break; - case 2: - pack_image_sima(); - break; - case 4: /* Texture Painting */ - brush_check_exists(&G.scene->toolsettings->imapaint.brush); - if(G.sima->flag & SI_DRAWTOOL) G.sima->flag &= ~SI_DRAWTOOL; - else G.sima->flag |= SI_DRAWTOOL; - allqueue(REDRAWBUTSSHADING, 0); - break; - case 5: - save_as_image_sima(); - break; - case 6: - reload_image_sima(); - break; - case 7: - new_image_sima(); - break; - case 8: - save_image_sima(); - break; - case 9: - save_image_sequence_sima(); - break; - case 10: - BKE_image_memorypack(G.sima->image); - allqueue(REDRAWIMAGE, 0); - break; - } -} - -static uiBlock *image_imagemenu(void *arg_unused) -{ - ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); - uiBlock *block; - short yco= 0, menuwidth=150; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "image_imagemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_image_imagemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New...|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.sima->image) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Replace...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - if(G.sima->image->source==IMA_SRC_SEQUENCE) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Changed Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.sima->image->packedfile) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - } - - /* only for dirty && specific image types */ - if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - if( ELEM(G.sima->image->source, IMA_SRC_FILE, IMA_SRC_GENERATED)) - if(G.sima->image->type!=IMA_TYPE_MULTILAYER) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Image as PNG", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=7, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.sima->flag & SI_DRAWTOOL) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Texture Painting", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Texture Painting", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=7, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, image_image_rtmappingmenu, NULL, ICON_RIGHTARROW_THIN, "Realtime Texture Mapping", 0, yco-=20, 120, 19, ""); - // uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Realtime Texture Animation|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - } - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_IMAGE]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i+20, - pym->tooltip?pym->tooltip:pym->filename); - } - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 80); - - return block; -} - -static void do_image_uvs_showhidemenu(void *arg, int event) -{ - switch(event) { - case 4: /* show hidden faces */ - reveal_tface_uv(); - break; - case 5: /* hide selected faces */ - hide_tface_uv(0); - break; - case 6: /* hide deselected faces */ - hide_tface_uv(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *image_uvs_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_uvs_propfalloffmenu(void *arg, int event) -{ - G.scene->prop_mode= event; - allqueue(REDRAWVIEW3D, 1); -} - -static uiBlock *image_uvs_propfalloffmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_propfalloffmenu, NULL); - - if (G.scene->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - if (G.scene->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - if (G.scene->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - if (G.scene->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - if (G.scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - if (G.scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_uvs_transformmenu(void *arg, int event) -{ - switch(event) { - case 0: /* Grab */ - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - break; - case 1: /* Rotate */ - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - break; - case 2: /* Scale */ - initTransform(TFM_RESIZE, CTX_NONE); - Transform(); - break; - } -} - -static uiBlock *image_uvs_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_uvs_mirrormenu(void *arg, int event) -{ - switch(event) { - case 0: /* X axis */ - mirror_tface_uv('x'); - break; - case 1: /* Y axis */ - mirror_tface_uv('y'); - break; - } - - BIF_undo_push("Mirror UV"); -} - -static uiBlock *image_uvs_mirrormenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Axis|M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Axis|M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_uvs_weldalignmenu(void *arg, int event) -{ - switch(event) { - case 0: /* Weld */ - weld_align_tface_uv('w'); - break; - case 1: /* Align X */ - weld_align_tface_uv('x'); - break; - case 2: /* Align Y */ - weld_align_tface_uv('y'); - break; - } - - if(event==0) BIF_undo_push("Weld UV"); - else if(event==1 || event==2) BIF_undo_push("Align UV"); -} - -static uiBlock *image_uvs_weldalignmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_weldalignmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_weldalignmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Weld|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align X|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Y|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_image_uvs_scriptsmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_UV, event); - - allqueue(REDRAWIMAGE, 0); -} - -static uiBlock *image_uvs_scriptsmenu (void *args_unused) -{ - uiBlock *block; - BPyMenu *pym; - int i= 0; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvs_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_image_uvs_scriptsmenu, NULL); - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_UV]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i, - pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_image_uvsmenu(void *arg, int event) -{ - - switch(event) { -// case 0: /* UV Transform Properties Panel... */ -// add_blockhandler(curarea, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_UNSTOW); -// break; - case 1: /* UVs Constrained Rectangular */ - if(G.sima->flag & SI_BE_SQUARE) G.sima->flag &= ~SI_BE_SQUARE; - else G.sima->flag |= SI_BE_SQUARE; - break; - case 2: /* UVs Clipped to Image Size */ - if(G.sima->flag & SI_CLIP_UV) G.sima->flag &= ~SI_CLIP_UV; - else G.sima->flag |= SI_CLIP_UV; - break; - case 3: /* Limit Stitch UVs */ - stitch_limit_uv_tface(); - break; - case 4: /* Stitch UVs */ - stitch_vert_uv_tface(); - break; - case 5: /* Proportional Edit (toggle) */ - if(G.scene->proportional) - G.scene->proportional= 0; - else - G.scene->proportional= 1; - break; - case 7: /* UVs Snap to Pixel */ - G.sima->flag ^= SI_PIXELSNAP; - break; - case 8: - pin_tface_uv(1); - break; - case 9: - pin_tface_uv(0); - break; - case 10: - unwrap_lscm(0); - break; - case 11: - if(G.sima->flag & SI_LIVE_UNWRAP) G.sima->flag &= ~SI_LIVE_UNWRAP; - else G.sima->flag |= SI_LIVE_UNWRAP; - break; - case 12: - minimize_stretch_tface_uv(); - break; - case 13: - pack_charts_tface_uv(); - break; - } -} - -static uiBlock *image_uvsmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "image_uvsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_image_uvsmenu, NULL); - - //uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - if(G.sima->flag & SI_PIXELSNAP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap to Pixels|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - if(G.sima->flag & SI_BE_SQUARE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Quads Constrained Rectangular|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Quads Constrained Rectangular|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - if(G.sima->flag & SI_CLIP_UV) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Layout Clipped to Image Size|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Layout Clipped to Image Size|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.sima->flag & SI_LIVE_UNWRAP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Live Unwrap Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Live Unwrap Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unwrap|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpin|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pin|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack Charts|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Minimize Stretch|Ctrl V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Limit Stitch...|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Stitch|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, image_uvs_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, image_uvs_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, image_uvs_weldalignmenu, NULL, ICON_RIGHTARROW_THIN, "Weld/Align", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.scene->proportional) - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefIconTextBlockBut(block, image_uvs_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, image_uvs_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Faces", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, image_uvs_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void image_buttons(void) -{ - Image *ima; - ImBuf *ibuf; - uiBlock *block; - short xco, xmax; - char naam[256], *menuname; - char is_render; /* true if the image is a render or composite */ - - int allow_pin= B_SIMAPIN; - - /* This should not be a static var */ - static int headerbuttons_packdummy; - - - is_render = ((G.sima->image!=NULL) && ((G.sima->image->type == IMA_TYPE_R_RESULT) || (G.sima->image->type == IMA_TYPE_COMPOSITE))); - - headerbuttons_packdummy = 0; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - what_image(G.sima); - ima= G.sima->image; - ibuf= BKE_image_get_ibuf(ima, &G.sima->iuser); - - curarea->butspacetype= SPACE_IMAGE; - - xco = 8; - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Current Window Type. Click for menu of available types."); - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, image_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) { - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, image_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - - if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - menuname= "Image*"; - else - menuname= "Image"; - xmax= GetButStringLength(menuname); - uiDefPulldownBut(block, image_imagemenu, NULL, menuname, xco, -2, xmax-3, 24, ""); - xco+= xmax; - if((EM_texFaceCheck()) && !(ima && (G.sima->flag & SI_DRAWTOOL))) { - xmax= GetButStringLength("UVs"); - uiDefPulldownBut(block, image_uvsmenu, NULL, "UVs", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - } - - /* other buttons: */ - uiBlockSetEmboss(block, UI_EMBOSS); - - if (is_render) - allow_pin = 0; - - xco= 8 + std_libbuttons(block, xco, 0, allow_pin, &G.sima->pin, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0); - - if( ima && !ELEM3(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE, IMA_SRC_VIEWER) && ima->ok) { - - if (ima->packedfile) { - headerbuttons_packdummy = 1; - } - if (ima->packedfile && ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) - uiDefIconButBitI(block, TOG, 1, B_SIMA_REPACK, ICON_UGLYPACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Re-Pack this image as PNG"); - else - uiDefIconButBitI(block, TOG, 1, B_SIMAPACKIMA, ICON_PACKAGE, xco,0,XIC,YIC, &headerbuttons_packdummy, 0, 0, 0, 0, "Pack/Unpack this image"); - - xco+= XIC+8; - } - - /* UV EditMode buttons, not painting or rencering or compositing */ - if ( EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0 && !is_render) { - uiBut *ubut; - int layercount; - - uiDefIconTextButS(block, ICONTEXTROW, B_NOP, ICON_ROTATE, - "Pivot: %t|Bounding Box Center %x0|Median Point %x3|2D Cursor %x1", - xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0, - "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period)"); - xco+= XIC + 18; - - uiBlockBeginAlign(block); - uiDefIconButBitI(block, TOGN, SI_SYNC_UVSEL, B_REDR, ICON_NO_GO_LEFT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Mesh independant selection"); - xco+= XIC; - if ((G.sima->flag & SI_SYNC_UVSEL)==0) { - - /* would use these if const's could go in strings - * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */ - ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC, - "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2", - xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0, - "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)"); - xco+= XIC + 16; - - } else { - xco+= 6; - } - uiBlockEndAlign(block); - - /* Snap copied right out of view3d header */ - uiBlockBeginAlign(block); - - if (G.scene->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)"); - xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); - xco+= 70; - } else { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); - xco+= XIC; - } - - uiBlockEndAlign(block); - xco+= 10; - /* end snap */ - - /* Layer Menu */ - layercount = CustomData_number_of_layers(&G.editMesh->fdata, CD_MTFACE); - if (layercount>1 && layercount < 12) { /* could allow any number but limit of 11 means no malloc needed */ - static int act; - char str_menu[384], *str_pt; /*384 allows for 11 layers */ - - - act = CustomData_get_active_layer(&G.editMesh->fdata, CD_MTFACE); - - /*str_pt = (char *)MEM_mallocN(layercount*40 , "uvmenu"); str[0]='\0';*/ - str_pt = str_menu; - str_pt[0]='\0'; - mesh_layers_menu_concat(&G.editMesh->fdata, CD_MTFACE, str_pt); - ubut = uiDefButI(block, MENU, B_NOP, str_menu ,xco,0,85,YIC, &act, 0, 0, 0, 0, "Active UV Layer for editing"); - uiButSetFunc(ubut, do_image_buttons_set_uvlayer_callback, &act, NULL); - - /*MEM_freeN(str);*/ - xco+= 90; - } - } - - if (ima) { - RenderResult *rr= BKE_image_get_renderresult(ima); - - xco+= 8; - - if(rr) { - uiBlockBeginAlign(block); - uiblock_layer_pass_buttons(block, rr, &G.sima->iuser, B_REDR, xco, 0, 160); - uiBlockEndAlign(block); - xco+= 166; - } - uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button"); - - xco+= XIC+8; - - uiBlockBeginAlign(block); - if(ibuf==NULL || ibuf->channels==4) { - uiDefIconButBitI(block, TOG, SI_USE_ALPHA, B_SIMA_USE_ALPHA, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha"); - xco+= XIC; - uiDefIconButBitI(block, TOG, SI_SHOW_ALPHA, B_SIMA_SHOW_ALPHA, ICON_DOT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws only alpha"); - xco+= XIC; - } - if(ibuf) { - if(ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels==1)) { - uiDefIconButBitI(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values"); - xco+= XIC; - } - } - xco+= 8; - - uiBlockBeginAlign(block); - if(ima->type==IMA_TYPE_COMPOSITE) { - uiDefIconBut(block, BUT, B_SIMA_RECORD, ICON_REC, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Record Composite"); - xco+= XIC; - } - if((ima->type==IMA_TYPE_COMPOSITE) || ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) { - uiDefIconBut(block, BUT, B_SIMA_PLAY, ICON_PLAY, xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play"); - xco+= XIC; - } - uiBlockEndAlign(block); - xco+= 8; - } - - /* draw LOCK */ - uiDefIconButS(block, ICONTOG, 0, ICON_UNLOCKED, xco,0,XIC,YIC, &(G.sima->lock), 0, 0, 0, 0, "Updates other affected window spaces automatically to reflect changes in real time"); - - /* Always do this last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} - diff --git a/source/blender/src/header_imasel.c b/source/blender/src/header_imasel.c deleted file mode 100644 index 1402e8c244e..00000000000 --- a/source/blender/src/header_imasel.c +++ /dev/null @@ -1,211 +0,0 @@ -/** - * header_imasel.c oct-2003 - * - * Functions to draw the "Image Browser" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" - -#include "BIF_filelist.h" -#include "BIF_gl.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_language.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BSE_headerbuttons.h" - -#include "blendef.h" - - -void do_imasel_buttons(short event) -{ - SpaceImaSel *simasel; - - simasel= curarea->spacedata.first; - - if(curarea->win==0) return; - - switch(event) { - case B_SORTIMASELLIST: - BIF_filelist_sort(simasel->files, simasel->sort); - scrarea_queue_winredraw(curarea); - break; - - case B_RELOADIMASELDIR: - BIF_filelist_free(simasel->files); - scrarea_queue_winredraw(curarea); - break; - case B_FILTERIMASELDIR: - if (simasel->flag & FILE_FILTER) { - BIF_filelist_setfilter(simasel->files,simasel->filter); - BIF_filelist_filter(simasel->files); - scrarea_queue_winredraw(curarea); - } else { - BIF_filelist_setfilter(simasel->files,0); - BIF_filelist_filter(simasel->files); - scrarea_queue_winredraw(curarea); - } - break; - } -} - -void imasel_buttons(void) -{ - SpaceImaSel *simasel; - uiBlock *block; - short xco, xcotitle; - char naam[256]; - char dir[FILE_MAXDIR], group[32]; - short type; - int do_filter = 0; - - simasel= curarea->spacedata.first; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_IMASEL; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - - xco+= XIC+22; - - /* FULL WINDOW */ - if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, ""); - else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, ""); - - /* SORT TYPE */ - xco+=XIC; - uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTALPHA, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 0.0, 0, 0, "Sorts files alphabetically"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTBYEXT, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 3.0, 0, 0, "Sorts files by extension"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTTIME, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 1.0, 0, 0, "Sorts files by time"); - uiDefIconButS(block, ROW, B_SORTIMASELLIST, ICON_SORTSIZE, xco+=XIC,0,XIC,YIC, &simasel->sort, 1.0, 2.0, 0, 0, "Sorts files by size"); - uiBlockEndAlign(block); - - cpack(0x0); - xco+=XIC+10; - uiDefIconButBitS(block, TOG, FILE_BOOKMARKS, B_RELOADIMASELDIR, ICON_BOOKMARKS,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Toggles Bookmarks on/off"); - xco+=XIC+10; - - xcotitle= xco; - xco+= BIF_GetStringWidth(G.font, simasel->title, (U.transopts & USER_TR_BUTTONS)); - - if(simasel->pupmenu && simasel->menup) { - uiDefButS(block, MENU, B_NOP, simasel->pupmenu, xco+10,0,90,20, simasel->menup, 0, 0, 0, 0, ""); - xco+= 100; - } - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, FILE_HIDE_DOT, B_RELOADIMASELDIR, ICON_GHOST,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Hides dot files"); - uiBlockEndAlign(block); - xco+=20; - - type = simasel->type; - if (type == FILE_LOADLIB) { - do_filter = !BIF_filelist_islibrary(simasel->files, dir, group); - } else { - do_filter = (type != FILE_MAIN); - } - if ( do_filter ) { - uiDefIconButBitS(block, TOG, FILE_FILTER, B_FILTERIMASELDIR, ICON_SORTBYEXT,xco+=XIC,0,XIC,YIC, &simasel->flag, 0, 0, 0, 0, "Filter files"); - if (simasel->flag & FILE_FILTER) { - xco+=4; - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, IMAGEFILE, B_FILTERIMASELDIR, ICON_IMAGE_COL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show images"); - uiDefIconButBitS(block, TOG, BLENDERFILE, B_FILTERIMASELDIR, ICON_BLENDER,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show .blend files"); - uiDefIconButBitS(block, TOG, MOVIEFILE, B_FILTERIMASELDIR, ICON_SEQUENCE,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show movies"); - uiDefIconButBitS(block, TOG, PYSCRIPTFILE, B_FILTERIMASELDIR, ICON_PYTHON,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show python scripts"); - uiDefIconButBitS(block, TOG, FTFONTFILE, B_FILTERIMASELDIR, ICON_SYNTAX,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show fonts"); - uiDefIconButBitS(block, TOG, SOUNDFILE, B_FILTERIMASELDIR, ICON_SOUND,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show sound files"); - uiDefIconButBitS(block, TOG, TEXTFILE, B_FILTERIMASELDIR, ICON_TEXT,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show text files"); - uiDefIconButBitS(block, TOG, FOLDERFILE, B_FILTERIMASELDIR, ICON_FILESEL,xco+=XIC,0,XIC,YIC, &simasel->filter, 0, 0, 0, 0, "Show folders"); - uiBlockEndAlign(block); - } - } - - uiDefButBitS(block, TOG, FILE_STRINGCODE, 0, "Relative Paths", xco+=XIC+20,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Makes sure returned paths are relative to the current .blend file"); - xco+=90; - - if(simasel->type==FILE_LOADLIB) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOGN, FILE_LINK, B_REDR, "Append", xco+=XIC,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Copies selected data into current project"); - uiDefButBitS(block, TOG, FILE_LINK, B_REDR, "Link", xco+=100,0,100,YIC, &simasel->flag, 0, 0, 0, 0, "Creates a link to selected data from current project"); - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, FILE_AUTOSELECT, B_REDR, "Autosel", xco+=125,0,65,YIC, &simasel->flag, 0, 0, 0, 0, "Autoselect imported objects"); - uiDefButBitS(block, TOG, FILE_ACTIVELAY, B_REDR, "Active Layer", xco+=65,0,80,YIC, &simasel->flag, 0, 0, 0, 0, "Append object(s) in active layer"); - uiDefButBitS(block, TOG, FILE_ATCURSOR, B_REDR, "At Cursor", xco+=80,0,65,YIC, &simasel->flag, 0, 0, 0, 0, "Append object(s) at cursor, use centroid if more than one object is selected"); - uiBlockEndAlign(block); - - xco+= 100; // scroll - - } else if(simasel->type==FILE_BLENDER) { - uiDefButBitI(block, TOGN, G_FILE_NO_UI, B_REDR, "Load UI", xco+=XIC,0,80,YIC, &G.fileflags, 0, 0, 0, 0, "Load the UI setup as well as the scene data"); - - xco+= 100; // scroll - } - - glRasterPos2f((float)xcotitle, 5.0); - BIF_RasterPos((float)xcotitle, 5.0); // stupid texture fonts - BIF_ThemeColor(TH_TEXT); - BIF_DrawString(uiBlockGetCurFont(block), simasel->title, (U.transopts & USER_TR_BUTTONS)); - - /* always do as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c deleted file mode 100644 index 174a5c683f0..00000000000 --- a/source/blender/src/header_info.c +++ /dev/null @@ -1,2181 +0,0 @@ -/** - * header_info.c oct-2003 - * - * Functions to draw the "User Preferences" window header - * and handle user events sent to it. - * - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_group_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_lamp_types.h" -#include "DNA_object_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_world_types.h" - -#include "BDR_editcurve.h" -#include "BDR_editmball.h" -#include "BDR_editobject.h" -#include "BDR_editface.h" -#include "BDR_vpaint.h" - -#include "BIF_editarmature.h" -#include "BIF_editfont.h" -#include "BIF_editmesh.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_language.h" -#include "BIF_mainqueue.h" -#include "BIF_meshtools.h" -#include "BIF_previewrender.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" -#include "BIF_writeimage.h" -#include "BIF_drawscene.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BKE_blender.h" -#include "BKE_depsgraph.h" -#include "BKE_exotic.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_node.h" -#include "BKE_packedFile.h" -#include "BKE_scene.h" -#include "BKE_world.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_bpath.h" -#include "BLO_writefile.h" - -#include "BSE_editipo.h" -#include "BSE_filesel.h" -#include "BIF_imasel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" -#include "BSE_sequence.h" -#include "BSE_edit.h" - -#include "IMB_imbuf_types.h" - -#include "MEM_guardedalloc.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "blendef.h" -#include "interface.h" -#include "mydevice.h" - -extern char versionstr[]; /* from blender.c */ - -/*----------------------------------*/ -/* Progress bar vars and functions: */ - -/* strubi shamelessly abused the status line as a progress bar... - * feel free to kill him after release */ - -static int g_progress_bar = 0; -static char *g_progress_info = 0; -static float g_done; - -int start_progress_bar(void) -{ - g_progress_bar = 1; - return 1; // we never fail (yet) -} - -void end_progress_bar(void) -{ - g_progress_bar = 0; -} - -static void update_progress_bar(float done, char *info) -{ - g_done = done; - g_progress_info = info; -} - -/** Progress bar - 'done': a value between 0.0 and 1.0, showing progress - 'info': a info text what is currently being done - - Make sure that the progress bar is always called with: - done = 0.0 first - and - done = 1.0 last -- or alternatively use: - - start_progressbar(); - do_stuff_and_callback_progress_bar(); - end_progressbar(); -*/ - -int progress_bar(float done, char *busy_info) -{ - ScrArea *sa; - short val; - - /* User break (ESC) */ - while (qtest()) { - if (extern_qread(&val) == ESCKEY) - return 0; - } - if (done == 0.0) { - start_progress_bar(); - } else if (done > 0.99) { - end_progress_bar(); - } - - sa= G.curscreen->areabase.first; - while(sa) { - if (sa->spacetype == SPACE_INFO) { - update_progress_bar(done, busy_info); - - curarea = sa; - - scrarea_do_headdraw(curarea); - areawinset(curarea->win); - sa->head_swap= WIN_BACK_OK; - screen_swapbuffers(); - } - sa = sa->next; - } - return 1; -} -/* -- End of progress bar definitions ------- */ - -extern char temp_dir[]; /* XXXXX BAD BAD BAD from exotic.c */ - -void write_vrml_fs() -{ - if(G.obedit) { - error("Can't save VRML. Press TAB to leave EditMode"); - } - else { - if(temp_dir[0]==0) strcpy(temp_dir, G.sce); - - activate_fileselect(FILE_SPECIAL, "Export VRML 1.0", temp_dir, write_vrml); - } -} - -void write_dxf_fs() -{ - if(G.obedit) { - error("Can't save DXF. Press TAB to leave EditMode"); - } - else { - - if(temp_dir[0]==0) strcpy(temp_dir, G.sce); - - activate_fileselect(FILE_SPECIAL, "Export DXF", temp_dir, write_dxf); - } -} - -void write_stl_fs() -{ - if(G.obedit) { - error("Can't save STL. Press TAB to leave EditMode"); - } - else { - - if(temp_dir[0]==0) strcpy(temp_dir, G.sce); - - activate_fileselect(FILE_SPECIAL, "Export STL", temp_dir, write_stl); - } -} -/* ------------ */ - -int buttons_do_unpack() -{ - int how; - char menu[2048]; - char *line = menu; - int ret_value = RET_OK, count = 0; - - count = countPackedFiles(); - - if(!count) { - pupmenu("No packed files. Autopack disabled"); - return ret_value; - } - if (count == 1) - line += sprintf(line, "Unpack 1 file%%t"); - else - line += sprintf(line, "Unpack %d files%%t", count); - - line += sprintf(line, "|Use files in current directory (create when necessary)%%x%d", PF_USE_LOCAL); - line += sprintf(line, "|Write files to current directory (overwrite existing files)%%x%d", PF_WRITE_LOCAL); - line += sprintf(line, "|%%l|Use files in original location (create when necessary)%%x%d", PF_USE_ORIGINAL); - line += sprintf(line, "|Write files to original location (overwrite existing files)%%x%d", PF_WRITE_ORIGINAL); - line += sprintf(line, "|%%l|Disable AutoPack, keep all packed files %%x%d", PF_KEEP); - line += sprintf(line, "|Ask for each file %%x%d", PF_ASK); - - how = pupmenu(menu); - - if(how == -1) - ret_value = RET_CANCEL; - else { - if (how != PF_KEEP) unpackAll(how); - G.fileflags &= ~G_AUTOPACK; - } - - return ret_value; -} - -/* here, because of all creator stuff */ - -Scene *copy_scene(Scene *sce, int level) -{ - /* level 0: al objects shared - * level 1: al object-data shared - * level 2: full copy - */ - Scene *scen; - Base *base, *obase; - - /* level 0 */ - scen= copy_libblock(sce); - duplicatelist(&(scen->base), &(sce->base)); - - clear_id_newpoins(); - - id_us_plus((ID *)scen->world); - id_us_plus((ID *)scen->set); - - scen->ed= NULL; - scen->radio= NULL; - scen->theDag= NULL; - scen->toolsettings= MEM_dupallocN(sce->toolsettings); - - duplicatelist(&(scen->markers), &(sce->markers)); - duplicatelist(&(scen->r.layers), &(sce->r.layers)); - - scen->nodetree= ntreeCopyTree(sce->nodetree, 0); - - obase= sce->base.first; - base= scen->base.first; - while(base) { - id_us_plus(&base->object->id); - if(obase==sce->basact) scen->basact= base; - - obase= obase->next; - base= base->next; - } - - if(level==0) return scen; - - /* level 1 */ - G.scene= scen; - - single_object_users(0); - - /* camera */ - ID_NEW(G.scene->camera); - - /* level 2 */ - if(level>=2) { - if(scen->world) { - id_us_plus(&scen->world->id); - scen->world= copy_world(scen->world); - } - single_obdata_users(0); - single_mat_users_expand(); - single_tex_users_expand(); - - scen->radio= MEM_dupallocN(sce->radio); - - } - - clear_id_newpoins(); - - BPY_copy_scriptlink(&sce->scriptlink); - // make a private copy of the avicodecdata - - if (sce->r.avicodecdata) { - - scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata); - scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat); - scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms); - } - - // make a private copy of the qtcodecdata - - if (sce->r.qtcodecdata) { - scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata); - scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms); - } - - return scen; -} - -void do_info_buttons(unsigned short event) -{ - bScreen *sc, *oldscreen; - Scene *sce, *sce1; - ScrArea *sa; - int nr; - - switch(event) { - case B_INFOSCR: /* menu select screen */ - - if( G.curscreen->screennr== -2) { - if(curarea->winy <50) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - activate_databrowse((ID *)G.curscreen, ID_SCR, 0, B_INFOSCR, - &G.curscreen->screennr, do_info_buttons); - return; - } - if( G.curscreen->screennr < 0) return; - - sc= G.main->screen.first; - nr= 1; - while(sc) { - if(nr==G.curscreen->screennr) { - if(is_allowed_to_change_screen(sc)) setscreen(sc); - else error("Unable to perform function in EditMode"); - break; - } - nr++; - sc= sc->id.next; - } - /* last item: NEW SCREEN */ - if(sc==0) { - nr= pupmenu("New Screen%t|Empty%x1|Duplicate%x2"); - - if(nr==1) default_twosplit(); - if(nr==2) duplicate_screen(); - } - break; - case B_INFODELSCR: -/*do this event only with buttons, so it can never be called with full-window*/ - - if(G.curscreen->id.prev) sc= G.curscreen->id.prev; - else if(G.curscreen->id.next) sc= G.curscreen->id.next; - else return; - if(okee("Delete current screen")) { - /* find new G.curscreen */ - - oldscreen= G.curscreen; - setscreen(sc); /* this test if sc has a full */ - unlink_screen(oldscreen); - free_libblock(&G.main->screen, oldscreen); - } - scrarea_queue_headredraw(curarea); - - break; - case B_INFOSCE: /* menu select scene */ - - if( G.curscreen->scenenr== -2) { - if(curarea->winy <50) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - activate_databrowse((ID *)G.scene, ID_SCE, 0, B_INFOSCE, - &G.curscreen->scenenr, do_info_buttons); - return; - } - if( G.curscreen->scenenr < 0) return; - - sce= G.main->scene.first; - nr= 1; - while(sce) { - if(nr==G.curscreen->scenenr) { - if(sce!=G.scene) set_scene(sce); - break; - } - nr++; - sce= sce->id.next; - } - /* last item: NEW SCENE */ - if(sce==0) { - nr= pupmenu("Add scene%t|Empty|Link Objects|Link ObData|Full Copy"); - if(nr<= 0) return; - if(nr==1) { - ListBase lb; - - sce= add_scene(G.scene->id.name+2); - /* pretty bad ass copying here. we should use copy_scene to do all (ton) */ - lb= sce->r.layers; - sce->r= G.scene->r; - sce->r.layers= lb; -#ifdef _WIN32 - if (sce->r.avicodecdata) { - sce->r.avicodecdata = MEM_dupallocN(G.scene->r.avicodecdata); - sce->r.avicodecdata->lpFormat = MEM_dupallocN(G.scene->r.avicodecdata->lpFormat); - sce->r.avicodecdata->lpParms = MEM_dupallocN(G.scene->r.avicodecdata->lpParms); - } -#endif -#ifdef WITH_QUICKTIME - if (sce->r.qtcodecdata) { - sce->r.qtcodecdata = MEM_dupallocN(G.scene->r.qtcodecdata); - sce->r.qtcodecdata->cdParms = MEM_dupallocN(G.scene->r.qtcodecdata->cdParms); - } -#endif - } - else sce= copy_scene(G.scene, nr-2); - - set_scene(sce); - } - countall(); - BIF_preview_changed(ID_TE); - - break; - case B_INFODELSCE: - - if(G.scene->id.prev) sce= G.scene->id.prev; - else if(G.scene->id.next) sce= G.scene->id.next; - else return; - if(okee("Delete current scene")) { - /* Note, anything besides free_libblock needs to be added in - * Python Scene.c for Blender.Scene.Unlink() */ - - - /* exit modes... could become single call once */ - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); - exit_paint_modes(); - - /* check all sets */ - for (sce1= G.main->scene.first; sce1; sce1= sce1->id.next) { - if(sce1->set == G.scene) sce1->set= 0; - } - - /* check all sequences */ - clear_scene_in_allseqs(G.scene); - - /* check render layer nodes in other scenes */ - clear_scene_in_nodes(G.scene); - - /* al screens */ - - for (sc= G.main->screen.first; sc; sc= sc->id.next ) { - if(sc->scene == G.scene) sc->scene= sce; - } - free_libblock(&G.main->scene, G.scene); - set_scene(sce); - countall(); - } - - break; - } -} - -static void check_packAll() -{ - // first check for dirty images - Image *ima; - - for(ima = G.main->image.first; ima; ima= ima->id.next) { - if (ima->ibufs.first) { /* XXX FIX */ - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - - if (ibuf && (ibuf->userflags &= IB_BITMAPDIRTY)) - break; - } - } - - if (ima == NULL || okee("Some images are painted on. These changes will be lost. Continue ?")) { - packAll(); - G.fileflags |= G_AUTOPACK; - } -} - -static int write_runtime(char *str, char *exename) -{ - char *freestr= NULL; - char *ext = 0; - -#ifdef _WIN32 - ext = ".exe"; -#endif - -#ifdef __APPLE__ - ext = ".app"; -#endif - if (ext && (!BLI_testextensie(str, ext))) { - freestr= MEM_mallocN(strlen(str) + strlen(ext) + 1, "write_runtime_check"); - sprintf(freestr,"%s%s", str, ext); - str= freestr; - } - - if (!BLI_exists(str) || saveover(str)) - BLO_write_runtime(str, exename); - - if (freestr) - MEM_freeN(freestr); - - return 0; -} - -static void write_runtime_check_dynamic(char *str) -{ - write_runtime(str, "blenderdynplayer.exe"); -} - -static void write_runtime_check(char *str) -{ - char player[128]; - - strcpy(player, "blenderplayer"); - -#ifdef _WIN32 - strcat(player, ".exe"); -#endif - -#ifdef __APPLE__ - strcat(player, ".app"); -#endif - - write_runtime(str, player); -} -/* end keyed functions */ - -/************************** MAIN MENU *****************************/ -/************************** FILE *****************************/ - - -static void do_info_file_importmenu(void *arg, int event) -{ - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* events >=3 are registered bpython scripts */ - if (event >= 3) { - BPY_menu_do_python(PYMENU_IMPORT, event - 3); - BIF_undo_push("Import file"); - } - else { - switch(event) { - - case 0: /* DXF */ - activate_fileselect(FILE_BLENDER, "Import DXF", G.sce, BIF_read_file); - break; - case 1: /* VRML 1.0 */ - activate_fileselect(FILE_BLENDER, "Import VRML 1.0", G.sce, BIF_read_file); - break; - case 2: /* STL */ - activate_fileselect(FILE_BLENDER, "Import STL", G.sce, BIF_read_file); - break; - - } - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_file_importmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_file_importmenu, NULL); - //uiBlockSetXOfs(block, -50); // offset to parent button - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "VRML 1.0...", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "DXF...", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "STL...", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for (pym = BPyMenuTable[PYMENU_IMPORT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+3, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_info_file_exportmenu(void *arg, int event) -{ - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* events >=3 are registered bpython scripts */ - if (event >= 3) BPY_menu_do_python(PYMENU_EXPORT, event - 3); - - else switch(event) { - - case 0: - write_vrml_fs(); - break; - case 1: - write_dxf_fs(); - break; - case 2: - write_stl_fs(); - break; - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_file_exportmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "exportmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_file_exportmenu, NULL); - //uiBlockSetXOfs(block, -50); // offset to parent button - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "VRML 1.0...|Ctrl F2", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "DXF...|Shift F2", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "STL...", - 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - /* note that we acount for the 3 previous entries with i+3: */ - for (pym = BPyMenuTable[PYMENU_EXPORT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i+3, - pym->tooltip?pym->tooltip:pym->filename); - } - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -#ifdef WITH_VERSE - -extern ListBase session_list; - -static void do_verse_filemenu(void *arg, int event) -{ - char address[64]; /* lenght of domain name is 63 characters or less */ - VerseSession *session = NULL; - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - switch(event) { - case 0: - waitcursor(1); - printf("Connecting to localhost!\n"); - b_verse_connect("localhost"); - waitcursor(0); - break; - case 1: - address[0] = '\0'; - if(sbutton(address, 0, 63, "Server:")) { - waitcursor(1); - printf("Connecting to %s\n", address); - b_verse_connect(address); - waitcursor(0); - } - break; - case 2: - session = session_menu(); - if(session) { - printf("Disconnecting session: %s!\n", session->address); - end_verse_session(session); - } - break; - case 3: - printf("Disconnecting all sessions!\n"); - end_all_verse_sessions(); - break; - case 4: - printf("sending get to master server\n"); - b_verse_ms_get(); - break; - } -} - -static uiBlock *verse_filemenu(void *unusedargs) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "verse_filemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_verse_filemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect to localhost", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connect ...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - if(session_list.first != NULL) { - if(session_list.first != session_list.last) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect ...", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect all", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Disconnect", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } - - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Get Servers", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -#endif - -static void do_info_filemenu(void *arg, int event) -{ - ScrArea *sa; - char dir[FILE_MAXDIR]; - - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* these are no defines, easier this way, the codes are in the function below */ - switch(event) { - case 0: - if (okee("Erase All")) { - if (!BIF_read_homefile(0)) - error("No file ~/.B.blend"); - } - break; - case 1: /* open */ - activate_fileselect(FILE_BLENDER, "Open", G.sce, BIF_read_file); - break; - case 3: /* append */ - activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0); - break; - case 4: /* save */ - strcpy(dir, G.sce); - untitled(dir); - activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file); - break; - case 5: - strcpy(dir, G.sce); - if (untitled(dir)) { - activate_fileselect(FILE_BLENDER, "Save As", dir, BIF_write_file); - } else { - BIF_write_file(dir); - free_filesel_spec(dir); - } - break; - case 6: /* save image */ - BIF_save_rendered_image_fs(); - break; - case 7: - activate_imageselect(FILE_LOADLIB, "Load Library", G.lib, 0); - break; - case 22: /* save runtime */ - activate_fileselect(FILE_SPECIAL, "Save Runtime", "", write_runtime_check); - break; - case 23: /* save dynamic runtime */ - activate_fileselect(FILE_SPECIAL, "Save Dynamic Runtime", "", write_runtime_check_dynamic); - break; - case 24: - BIF_screendump(0); - break; - case 25: - BIF_screendump(1); - break; - case 13: - exit_usiblender(); - break; - case 15: /* recover previous session */ - { - extern short winqueue_break; /* editscreen.c */ - int save_over; - char str[FILE_MAXDIR+FILE_MAXFILE]; - char scestr[FILE_MAXDIR+FILE_MAXFILE]; - - strcpy(scestr, G.sce); /* temporal store */ - save_over = G.save_over; - BLI_make_file_string("/", str, U.tempdir, "quit.blend"); - BKE_read_file(str, NULL); - G.save_over = save_over; - strcpy(G.sce, scestr); - - winqueue_break= 1; /* leave queues everywhere */ - - BKE_reset_undo(); - BKE_write_undo("original"); /* save current state */ - refresh_interface_font(); - } - break; - case 31: /* save default settings */ - BIF_write_homefile(); - break; - case 32: - if (okee("Erase All")) { - if (!BIF_read_homefile(1)) - error("Can't read data from memory!"); - } - break; - case 35: /* compress toggle */ - U.flag ^= (USER_FILECOMPRESS); - break; - } - - allqueue(REDRAWINFO, 0); -} - -static void do_info_operecentmenu(void *arg, int event) -{ - struct RecentFile *recent; - - if(event==0 && G.sce[0]) { - BIF_read_file(G.sce); - } - else { /* Global */ - recent = BLI_findlink(&(G.recent_files), event-1); - BIF_read_file(recent->filename); - } -} - -static uiBlock *info_openrecentmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120, i; - struct RecentFile *recent; - - block= uiNewBlock(&curarea->uiblocks, "info_openrecentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_operecentmenu, NULL); - - if (G.sce[0]) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, G.sce, 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - } - - for (recent = G.recent_files.first, i=0; inext, i++) { - if (strcmp(recent->filename, G.sce)!=0) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, recent->filename, 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, i+1, ""); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_info_externalfiles(void *arg, int event) -{ - switch (event) { - - case 1: /* pack data */ - check_packAll(); - break; -#if 0 - case 2: /* unpack to current dir */ - unpackAll(PF_WRITE_LOCAL); - G.fileflags &= ~G_AUTOPACK; - break; -#endif - case 3: /* unpack data */ - if (buttons_do_unpack() != RET_CANCEL) { - /* Clear autopack bit only if user selected one of the unpack options */ - G.fileflags &= ~G_AUTOPACK; - } - break; - case 10: /* make all paths relative */ - if (G.relbase_valid) { - int tot,changed,failed,linked; - char str[512]; - makeFilesRelative(&tot, &changed, &failed, &linked); - sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked); - pupmenu(str); - } else { - pupmenu("Can't set relative paths with an unsaved blend file"); - } - break; - case 11: /* check images exist */ - { - /* Its really text but only care about the name */ - ID *btxt = (ID *)checkMissingFiles(); - - if (btxt) { - char str[128]; - sprintf(str, "Missing files listed in Text \"%s\"", btxt->name+2); - error(str); - } else { - okee("No external files missing"); - } - } - break; - case 12: /* search for referenced files that are not available */ - activate_fileselect(FILE_SPECIAL, "Find Missing Files", "", findMissingFiles); - break; - } - - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_externalfiles(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "info_externalfiles", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_externalfiles, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pack into Blend", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); -#if 0 - uiDefBut(block, BUTM, 1, "Unpack Data to current dir", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, "Removes all packed files from the project and saves them to the current directory"); -#endif - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpack into Files...", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make all Paths Relative", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Report Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Missing Files", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static uiBlock *info_filemenu(void *arg_unused) -{ - uiBlock *block; - short yco=0; - short menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "info_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_filemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Ctrl X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); -#ifdef WITH_VERSE - uiDefIconTextBlockBut(block, verse_filemenu, NULL, ICON_RIGHTARROW_THIN, "Verse", 0, yco-=20, menuwidth, 19, ""); -#endif - uiDefIconTextBlockBut(block, info_openrecentmenu, NULL, ICON_RIGHTARROW_THIN, "Open Recent",0, yco-=20, 120, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recover Last Session", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Ctrl W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...|F2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if(U.flag & USER_FILECOMPRESS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Compress File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 35, "Enable file compression"); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Image...|F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dump Subwindow|Ctrl F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dump Screen|Ctrl Shift F3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); -#if GAMEBLENDER == 1 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); -#ifdef _WIN32 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Dynamic Runtime...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); -#endif -#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save Default Settings|Ctrl U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 31, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Load Factory Settings", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 32, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link|Shift F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Append or Link (Image Browser)|Ctrl F1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBlockBut(block, info_file_importmenu, NULL, ICON_RIGHTARROW_THIN, "Import", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, info_file_exportmenu, NULL, ICON_RIGHTARROW_THIN, "Export", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_externalfiles, NULL, ICON_RIGHTARROW_THIN, "External Data",0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Quit Blender|Ctrl Q", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - return block; -} - -/**************************** ADD ******************************/ - -void do_info_add_meshmenu(void *arg, int event) -{ - if (event>=20) { - BPY_menu_do_python(PYMENU_ADDMESH, event - 20); - } else { - switch(event) { - case 0: - /* Plane */ - add_primitiveMesh(0); - break; - case 1: - /* Cube */ - add_primitiveMesh(1); - break; - case 2: - /* Circle */ - add_primitiveMesh(4); - break; - case 3: - /* UVsphere */ - add_primitiveMesh(11); - break; - case 4: - /* IcoSphere */ - add_primitiveMesh(12); - break; - case 5: - /* Cylinder */ - add_primitiveMesh(5); - break; - case 7: - /* Cone */ - add_primitiveMesh(7); - break; - case 8: - /* Grid */ - add_primitiveMesh(10); - break; - case 9: - /* Monkey */ - add_primitiveMesh(13); - break; - default: - break; - } - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_add_meshmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - - /* Python Menu */ - BPyMenu *pym; - int i=0; - - block= uiNewBlock(&curarea->uiblocks, "add_meshmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_meshmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plane|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cube|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UVsphere", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "IcoSphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cylinder|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cone|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grid|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Monkey|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 9, ""); - - - pym = BPyMenuTable[PYMENU_ADDMESH]; - if (pym) { - uiDefIconTextBut(block, SEPR, 0, ICON_BLANK1, "", 0, yco-=6, 160, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for (; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, i+20, pym->tooltip?pym->tooltip:pym->filename); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_info_add_curvemenu(void *arg, int event) -{ - - switch(event) { - case 0: - /* Bezier Curve */ - add_primitiveCurve(10); - break; - case 1: - /* Bezier Circle */ - add_primitiveCurve(11); - break; - case 2: - /* NURB Curve */ - add_primitiveCurve(40); - break; - case 3: - /* NURB Circle */ - add_primitiveCurve(41); - break; - case 4: - /* Path */ - add_primitiveCurve(46); - break; - default: - break; - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_add_curvemenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - - block= uiNewBlock(&curarea->uiblocks, "add_curvemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_curvemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Path|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - - -void do_info_add_surfacemenu(void *arg, int event) -{ - - switch(event) { - case 0: - /* Curve */ - add_primitiveNurb(0); - break; - case 1: - /* Circle */ - add_primitiveNurb(1); - break; - case 2: - /* Surface */ - add_primitiveNurb(2); - break; - case 3: - /* Tube */ - add_primitiveNurb(3); - break; - case 4: - /* Sphere */ - add_primitiveNurb(4); - break; - case 5: - /* Donut */ - add_primitiveNurb(5); - break; - default: - break; - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_add_surfacemenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - - block= uiNewBlock(&curarea->uiblocks, "add_surfacemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_surfacemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Curve|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Circle|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Surface|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Tube", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Sphere|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NURBS Donut|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_info_add_metamenu(void *arg, int event) -{ - - switch(event) { - case 0: - /* Ball */ - add_primitiveMball(1); - break; - case 1: - /* Tube */ - add_primitiveMball(2); - break; - case 2: - /* Plane */ - add_primitiveMball(3); - break; - case 3: - /* Elipsoid */ - add_primitiveMball(4); - break; - case 4: - /* Cube */ - add_primitiveMball(5); - break; - default: - break; - } - allqueue(REDRAWINFO, 0); -} - - -static uiBlock *info_add_metamenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short xco= 0; - - block= uiNewBlock(&curarea->uiblocks, "add_metamenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_metamenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,"Meta Ball|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Tube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Plane|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Ellipsoid|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta Cube|", 0, xco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_info_add_lampmenu(void *arg, int event) -{ - - switch(event) { - case 0: /* lamp */ - add_objectLamp(LA_LOCAL); - break; - case 1: /* sun */ - add_objectLamp(LA_SUN); - break; - case 2: /* spot */ - add_objectLamp(LA_SPOT); - break; - case 3: /* hemi */ - add_objectLamp(LA_HEMI); - break; - case 4: /* area */ - add_objectLamp(LA_AREA); - break; - case 5: /* YafRay photon lamp */ - if (G.scene->r.renderer==R_YAFRAY) - add_objectLamp(LA_YF_PHOTON); - break; - default: - break; - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_add_lampmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - - block= uiNewBlock(&curarea->uiblocks, "add_lampmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_lampmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Sun|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spot|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hemi|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Area|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - if (G.scene->r.renderer==R_YAFRAY) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Photon|", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_info_add_groupmenu(void *arg, int event) -{ - Object *ob; - - add_object_draw(OB_EMPTY); - ob= OBACT; - - ob->dup_group= BLI_findlink(&G.main->group, event); - if(ob->dup_group) { - id_us_plus((ID *)ob->dup_group); - ob->transflag |= OB_DUPLIGROUP; - DAG_scene_sort(G.scene); - } -} - - -static uiBlock *info_add_groupmenu(void *arg_unused) -{ - Group *group; - uiBlock *block; - short yco= 0; - int a; - - block= uiNewBlock(&curarea->uiblocks, "add_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_add_groupmenu, NULL); - - for(a=0, group= G.main->group.first; group; group= group->id.next, a++) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, group->id.name+2, 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, a, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_info_addmenu(void *arg, int event) -{ - switch(event) { - case 0: - /* Mesh */ - break; - case 1: - /* Curve */ - break; - case 2: - /* Surface */ - break; - case 3: - /* Metaball */ - break; - case 4: - /* Text (argument is discarded) */ - add_primitiveFont(event); - break; - case 5: - /* Empty */ - add_object_draw(OB_EMPTY); - break; - case 6: - /* Camera */ - add_object_draw(OB_CAMERA); - break; - case 8: - /* Armature */ - add_primitiveArmature(OB_ARMATURE); - break; - case 9: - /* Lattice */ - add_object_draw(OB_LATTICE); - break; - case 10: - /* group instance not yet */ - break; - default: - break; - } - allqueue(REDRAWINFO, 0); -} - - -static uiBlock *info_addmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - - block= uiNewBlock(&curarea->uiblocks, "addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_addmenu, NULL); - - uiDefIconTextBlockBut(block, info_add_meshmenu, NULL, ICON_RIGHTARROW_THIN, "Mesh", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, info_add_curvemenu, NULL, ICON_RIGHTARROW_THIN, "Curve", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, info_add_surfacemenu, NULL, ICON_RIGHTARROW_THIN, "Surface", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, info_add_metamenu, NULL, ICON_RIGHTARROW_THIN, "Meta", 0, yco-=20, 120, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBlockBut(block, info_add_lampmenu, NULL, ICON_RIGHTARROW_THIN, "Lamp", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 120, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, 120, 19, NULL, 0.0, 0.0, 1, 9, ""); - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - return block; -} - -/************************** GAME *****************************/ - - -static void do_info_gamemenu(void *arg, int event) -{ - switch (event) { - case G_FILE_ENABLE_ALL_FRAMES: - case G_FILE_DIAPLAY_LISTS: - case G_FILE_SHOW_FRAMERATE: - case G_FILE_SHOW_DEBUG_PROPS: - case G_FILE_AUTOPLAY: - case G_FILE_GAME_TO_IPO: - case G_FILE_GAME_MAT: - case G_FILE_SHOW_PHYSICS: - G.fileflags ^= event; - break; - default: - ; /* ignore the rest */ - } -} - -static uiBlock *info_gamemenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - short menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "gamemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_gamemenu, NULL); - - uiDefIconTextBut(block, BUTM, B_STARTGAME, ICON_BLANK1, "Start Game|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, ""); - - - if(G.fileflags & G_FILE_ENABLE_ALL_FRAMES) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enable All Frames", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_ENABLE_ALL_FRAMES, ""); - } - - if(G.fileflags & G_FILE_GAME_TO_IPO) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, ""); - } else { - - if(G.fileflags & G_FILE_DIAPLAY_LISTS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DIAPLAY_LISTS, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Generate Display Lists", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_DIAPLAY_LISTS, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Record Game Physics to IPO", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_TO_IPO, ""); - } - - if(G.fileflags & G_FILE_GAME_MAT) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Use Blender Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Use Blender Materials", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_GAME_MAT, ""); - } - - - - if(G.fileflags & G_FILE_SHOW_FRAMERATE) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Framerate and Profile", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_FRAMERATE, ""); - } - - - if(G.fileflags & G_FILE_SHOW_PHYSICS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Physics Visualization", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_PHYSICS, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Physics Visualization", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_PHYSICS, ""); - } - - if(G.fileflags & G_FILE_SHOW_DEBUG_PROPS) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Debug Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_SHOW_DEBUG_PROPS, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 1, 0, ""); - - if(G.fileflags & G_FILE_AUTOPLAY) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Autostart", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, G_FILE_AUTOPLAY, ""); - } - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 70); - - return block; -} -/************************** TIMELINE *****************************/ - -static void do_info_timelinemenu(void *arg, int event) -{ - /* needed to check for valid selected objects */ - Base *base=NULL; - Object *ob=NULL; - //char file[FILE_MAXDIR+FILE_MAXFILE]; - - base= BASACT; - if (base) ob= base->object; - - switch(event) { - case 1: - /* Show Keyframes */ - if (!ob) error("Select an object before showing its keyframes"); - else set_ob_ipoflags(); - break; - case 2: - /* Show and select Keyframes */ - if (!ob) error("Select an object before showing and selecting its keyframes"); - else select_select_keys(); - break; - case 3: - /* select next keyframe */ - if (!ob) error("Select an object before selecting its next keyframe"); - else nextkey_obipo(1); - break; - case 4: - /* select previous keyframe */ - if (!ob) error("Select an object before selecting its previous keyframe"); - else nextkey_obipo(-1); - break; - case 5: - /* next keyframe */ - if (!ob) error("Select an object before going to its next keyframe"); - else movekey_obipo(1); - break; - case 6: - /* previous keyframe */ - if (!ob) error("Select an object before going to its previous keyframe"); - else movekey_obipo(-1); - break; - case 7: - /* next frame */ - CFRA++; - update_for_newframe(); - break; - case 8: - /* previous frame */ - CFRA--; - if(CFRA<1) CFRA=1; - update_for_newframe(); - break; - case 9: - /* forward 10 frames */ - CFRA+= 10; - update_for_newframe(); - break; - case 10: - /* back 10 frames */ - CFRA-= 10; - if(CFRA<1) CFRA=1; - update_for_newframe(); - break; - case 11: - /* end frame */ - CFRA= EFRA; - update_for_newframe(); - break; - case 12: - /* start frame */ - CFRA= SFRA; - update_for_newframe(); - break; - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_timelinemenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - char str[26]; - short yco= 0; - short menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "timelinemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_timelinemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Keyframes|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show and Select Keyframes|Shift K",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Next Keyframe|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Previous Keyframe|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Keyframe|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Keyframe|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Next Frame|RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Previous Frame|LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - sprintf(str, "Forward %d Frames|UpArrow", G.scene->jumpframe); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - sprintf(str, "Back %d Frames|DownArrow", G.scene->jumpframe); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "End Frame|Shift RightArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Start Frame|Shift LeftArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - return block; -} - -/************************** RENDER *****************************/ - -void do_info_render_bakemenu(void *arg, int event) -{ - - objects_bake_render(event); - - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_render_bakemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0; - - block= uiNewBlock(&curarea->uiblocks, "render_bakemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_render_bakemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Full Render|Ctrl Alt B, 1", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ambient Occlusion|Ctrl Alt B, 2", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Normals|Ctrl Alt B, 3", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Only|Ctrl Alt B, 4", 0, yco-=20, 160, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_info_rendermenu(void *arg, int event) -{ - ScrArea *sa; - extern void playback_anim(); - - /* events >=10 are registered bpython scripts */ - if (event >= 10) { - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } - - BPY_menu_do_python(PYMENU_RENDER, event - 10); - BIF_undo_push("Rendering Script"); - } - else { - switch(event) { - - case 0: - BIF_do_render(0); - break; - case 1: - BIF_do_render(1); - break; - - /* note: dont use select_area() for setting active areas for opengl render */ - /* its hackish and instable... code here was removed */ - - case 4: - BIF_toggle_render_display(); - break; - case 5: - playback_anim(); - break; - case 6: - /* dodgy hack turning on SHIFT key to do a proper render border select - set_render_border(); only works when 3d window active - - This code copied from toolbox.c, only works when 3d window is cameraview */ - - if(select_area(SPACE_VIEW3D)) { - mainqenter(LEFTSHIFTKEY, 1); - mainqenter(BKEY, 1); - mainqenter(BKEY, 0); - mainqenter(EXECUTE, 1); - mainqenter(LEFTSHIFTKEY, 0); - } - - break; - - case 7: - extern_set_butspace(F10KEY, 0); - break; - } - } - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_rendermenu(void *arg_unused) -{ - uiBlock *block; - BPyMenu *pym; - short yco= 0; - short menuwidth=120; - int i=0; - - block= uiNewBlock(&curarea->uiblocks, "rendermenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_rendermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Current Frame|F12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Animation|Ctrl F12", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_render_bakemenu, NULL, ICON_RIGHTARROW_THIN, "Bake Render Meshes", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Render Buffer|F11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Rendered Animation|Ctrl F11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Render Border|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Render Settings|F10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for (pym = BPyMenuTable[PYMENU_RENDER]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - return block; -} - -/************************** HELP *****************************/ - -static void do_info_help_websitesmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_HELPWEBSITES, event); - - allqueue(REDRAWVIEW3D, 0); -} - - -static uiBlock *info_help_websitesmenu(void *arg_unused) -{ - uiBlock *block; - BPyMenu *pym; - short yco = 20, menuwidth = 120; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "info_help_websitesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_help_websitesmenu, NULL); - - for (pym = BPyMenuTable[PYMENU_HELPWEBSITES]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_info_help_systemmenu(void *arg, int event) -{ - /* events >=10 are registered bpython scripts */ - if (event >= 10) BPY_menu_do_python(PYMENU_HELPSYSTEM, event - 10); - else { - switch(event) { - - case 1: /* Benchmark */ - /* dodgy hack turning on CTRL ALT SHIFT key to do a benchmark - * rather than copying lines and lines of code from toets.c :( - */ - - if(select_area(SPACE_VIEW3D)) { - mainqenter(LEFTSHIFTKEY, 1); - mainqenter(LEFTCTRLKEY, 1); - mainqenter(LEFTALTKEY, 1); - mainqenter(TKEY, 1); - mainqenter(TKEY, 0); - mainqenter(EXECUTE, 1); - mainqenter(LEFTSHIFTKEY, 0); - mainqenter(LEFTCTRLKEY, 0); - mainqenter(LEFTALTKEY, 0); - } - break; - } - } - - allqueue(REDRAWVIEW3D, 0); -} - - -static uiBlock *info_help_systemmenu(void *arg_unused) -{ - uiBlock *block; - BPyMenu *pym; - short yco = 20, menuwidth = 120; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "info_help_systemmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_info_help_systemmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Benchmark", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - for (pym = BPyMenuTable[PYMENU_HELPSYSTEM]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_info_helpmenu(void *arg, int event) -{ - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= find_biggest_area_of_type(SPACE_SCRIPT); - if (!sa) sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* events >=10 are registered bpython scripts */ - if (event >= 10) BPY_menu_do_python(PYMENU_HELP, event - 10); - else { - switch(event) { - - case 0: /* About Blender */ - break; - } - } - - allqueue(REDRAWINFO, 0); -} - -static uiBlock *info_helpmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0; - short menuwidth=120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "info_helpmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_info_helpmenu, NULL); - - uiDefIconTextBut(block, BUTM, B_SHOWSPLASH, ICON_BLANK1, "About Blender...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for (pym = BPyMenuTable[PYMENU_HELP]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i+10, pym->tooltip?pym->tooltip:pym->filename); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_help_websitesmenu, NULL, ICON_RIGHTARROW_THIN, "Websites", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, info_help_systemmenu, NULL, ICON_RIGHTARROW_THIN, "System", 0, yco-=20, 120, 19, ""); - - uiBlockSetDirection(block, UI_DOWN); - uiTextBoundsBlock(block, 80); - - return block; -} - -/************************** END MAIN MENU *****************************/ -/* ugly global yes, for renderwin.c to write to */ -char info_time_str[32]=""; - -static void info_text(int x, int y) -{ - Object *ob= OBACT; - extern float hashvectf[]; - extern unsigned long mem_in_use, mmap_in_use; - unsigned int swatch_color; - float fac1, fac2, fac3; - char infostr[300], memstr[64]; - char *headerstr, *s; - int hsize; - - s= memstr + sprintf(memstr," | Mem:%.2fM ", ((mem_in_use-mmap_in_use)>>10)/1024.0); - if(mmap_in_use) - sprintf(s,"(%.2fM) ", ((mmap_in_use)>>10)/1024.0); - - - if(G.obedit) { - s = infostr; - - s+= sprintf(s, "%s", G.editModeTitleExtra); - if(G.obedit->type==OB_MESH) { - if(G.scene->selectmode & SCE_SELECT_VERTEX) - s+= sprintf(s,"Ve:%d-%d | Ed:%d-%d | Fa:%d-%d", - G.totvertsel, G.totvert, G.totedgesel, G.totedge, G.totfacesel, G.totface); - else if(G.scene->selectmode & SCE_SELECT_EDGE) - s+= sprintf(s,"Ed:%d-%d | Fa:%d-%d", - G.totedgesel, G.totedge, G.totfacesel, G.totface); - else - s+= sprintf(s,"Fa:%d-%d", G.totfacesel, G.totface); - } - else if(G.obedit->type==OB_ARMATURE) { - s+= sprintf(s,"Ve:%d-%d | Bo:%d-%d", G.totvertsel, G.totvert, G.totbonesel, G.totbone); - } - else { - s+= sprintf(s,"Ve:%d-%d", G.totvertsel, G.totvert); - } - - strcat(s, memstr); - } - else if(ob && (ob->flag & OB_POSEMODE)) { - sprintf(infostr,"Bo:%d-%d %s", - G.totbonesel, G.totbone, memstr); - } - else { - sprintf(infostr,"Ve:%d | Fa:%d | Ob:%d-%d | La:%d %s | Time:%s | ", - G.totvert, G.totface, G.totobj, G.totobjsel, G.totlamp, memstr, info_time_str); - } - if(ob) { - strcat(infostr, ob->id.name+2); - } - - if (g_progress_bar && g_progress_info) { - headerstr= g_progress_info; - } else { - headerstr= versionstr; - } - - if (g_progress_bar) { - hsize = 4 + (138.0 * g_done); - fac1 = 0.5 * g_done; /* do some rainbow colors on progress */ - fac2 = 1.0; - fac3 = 0.9; - } else { - hsize= 30+BIF_GetStringWidth(G.font, headerstr, (U.transopts & USER_TR_BUTTONS)); - - /* promise! Never change these lines again! (zr & ton did!) */ - fac1= fabs(hashvectf[ 2*G.version+4]); - fac2= 0.5+0.1*hashvectf[ G.version+3]; - fac3= 0.7; - } - - swatch_color= hsv_to_cpack(fac1, fac2, fac3); - - cpack( swatch_color ); - glRecti(x-24, y-6, x-30+hsize, y+14); - - glColor3ub(0, 0, 0); /* makes text black colored rect */ - - glRasterPos2i(x, y); - BIF_RasterPos(x, y); - - BIF_DrawString(G.font, headerstr, (U.transopts & USER_TR_MENUS)); - hsize= BIF_GetStringWidth(G.font, headerstr, (U.transopts & USER_TR_BUTTONS)); - - BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */ - - glRasterPos2i(x+hsize+10, y); - BIF_RasterPos(x+hsize+10, y); - - BIF_DrawString(G.font, infostr, (U.transopts & USER_TR_MENUS)); -} - -void info_buttons(void) -{ - uiBlock *block; - short xco= 42; - int xmax; - - block= uiNewBlock(&curarea->uiblocks, "header info", UI_EMBOSSN, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - - uiBlockSetEmboss(block, UI_EMBOSSP); - - /* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted - * menu is drawn wider than it should be. The ypos of -1 is to make it properly fill the - * height of the header */ - xmax= GetButStringLength("File"); - uiDefPulldownBut(block, info_filemenu, NULL, "File", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, info_addmenu, NULL, "Add", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - xmax= GetButStringLength("Timeline"); - uiDefPulldownBut(block, info_timelinemenu, NULL, "Timeline", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - xmax= GetButStringLength("Game"); - uiDefPulldownBut(block, info_gamemenu, NULL, "Game", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - xmax= GetButStringLength("Render"); - uiDefPulldownBut(block, info_rendermenu, NULL, "Render", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - xmax= GetButStringLength("Help"); - uiDefPulldownBut(block, info_helpmenu, NULL, "Help", xco, -1, xmax-3, 22, ""); - xco+= xmax; - - } - - /* pack icon indicates a packed file */ - - if (G.fileflags & G_AUTOPACK) { - uiBlockSetEmboss(block, UI_EMBOSSN); - uiDefIconBut(block, LABEL, 0, ICON_PACKAGE, xco, 0, XIC, YIC, &G.fileflags, 0.0, 0.0, 0, 0, "Indicates this is a Packed file. See File menu."); - xco += XIC; - } - - if (curarea->full == 0) { - curarea->butspacetype= SPACE_INFO; - uiBlockSetEmboss(block, UI_EMBOSS); - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), 8,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - - /* STD SCREEN BUTTONS */ - xco= std_libbuttons(block, xco, 0, 0, NULL, B_INFOSCR, ID_SCR, 0, (ID *)G.curscreen, 0, &G.curscreen->screennr, 1, 1, B_INFODELSCR, 0, 0); - - xco +=8; - - /* STD SCENE BUTTONS */ - xco= std_libbuttons(block, xco, 0, 0, NULL, B_INFOSCE, ID_SCE, 0, (ID *)G.scene, 0, &G.curscreen->scenenr, 1, 1, B_INFODELSCE, 0, 0); - } - else xco= 430; - -BIF_SetScale(block->aspect); - info_text(xco+24, 6); - - uiBlockSetEmboss(block, UI_EMBOSSN); - uiDefIconBut(block, BUT, B_SHOWSPLASH, ICON_BLENDER, xco+2, 0,XIC,YIC, 0, 0, 0, 0, 0, "Click to display Splash Screen"); - - /* always do as last */ - curarea->headbutlen= xco+2*XIC; - -#if 0 -// #ifdef _WIN32 // FULLSCREEN - if(U.uiflag & USER_FLIPFULLSCREEN) { - uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_WINDOW, - (short)(curarea->winx-XIC-5), 0,XIC,YIC, - 0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */ - } else { - uiDefIconBut(block, BUT, B_FLIPFULLSCREEN, ICON_WINDOW_FULLSCREEN, - (short)(curarea->winx-XIC-5), 0,XIC,YIC, - 0, 0, 0, 0, 0, "Toggles Blender to fullscreen mode");/* dir */ - } -#endif - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c deleted file mode 100644 index 4f98e966f8c..00000000000 --- a/source/blender/src/header_ipo.c +++ /dev/null @@ -1,1408 +0,0 @@ -/** - * header_ipo.c oct-2003 - * - * Functions to draw the "Ipo Curve Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_action_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_constraint_types.h" -#include "DNA_ID.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_object_types.h" -#include "DNA_object_fluidsim.h" -#include "DNA_particle_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_space_types.h" -#include "DNA_sequence_types.h" -#include "DNA_sound_types.h" -#include "DNA_world_types.h" - -#include "BKE_action.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_particle.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" - -#include "BSE_drawipo.h" -#include "BSE_editipo_types.h" -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "BIF_editaction.h" -#include "BIF_editconstraint.h" -#include "BIF_interface.h" -#include "BIF_mainqueue.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "nla.h" - -#include "blendef.h" -#include "mydevice.h" - -extern int totipo_edit, totipo_sel; - -/* headerbutton call, assuming full context is set */ -/* it aligns with editipo.c, verify_ipo */ -void spaceipo_assign_ipo(SpaceIpo *si, Ipo *ipo) -{ - if(si->from==NULL || si->from->lib) return; - - if(ipo) ipo->id.us++; - - /* first check action ipos */ - if(si->actname && si->actname[0]) { - Object *ob= (Object *)si->from; - bActionChannel *achan; - - if(ob->action) { - achan= verify_action_channel(ob->action, si->actname); - - if(achan) { - /* constraint exception */ - if(si->blocktype==ID_CO) { - bConstraintChannel *conchan= get_constraint_channel(&achan->constraintChannels, si->constname); - if(conchan) { - if(conchan->ipo) - conchan->ipo->id.us--; - conchan->ipo= ipo; - } - } - else { - if(achan->ipo) - achan->ipo->id.us--; - achan->ipo= ipo; - } - } - } - } - else { - switch(GS(si->from->name)) { - case ID_OB: - { - Object *ob= (Object *)si->from; - /* constraint exception */ - if(si->blocktype==ID_CO) { - /* check the local constraint ipo */ - if(si->bonename && si->bonename[0] && ob->pose) { - bPoseChannel *pchan= get_pose_channel(ob->pose, si->bonename); - bConstraint *con; - - for(con= pchan->constraints.first; con; con= con->next) - if(strcmp(con->name, si->constname)==0) - break; - if(con) { - if(con->ipo) - con->ipo->id.us--; - con->ipo= ipo; - } - } - else { - bConstraintChannel *conchan= get_constraint_channel(&ob->constraintChannels, si->constname); - if(conchan) { - if(conchan->ipo) - conchan->ipo->id.us--; - conchan->ipo= ipo; - } - } - } - else if(si->blocktype==ID_FLUIDSIM) { // NT - if( (ob->fluidsimSettings) && - (ob->fluidsimSettings->ipo) ) { - // decrement users counter - ob->fluidsimSettings->ipo->id.us--; - } - ob->fluidsimSettings->ipo = ipo; - } - else if(si->blocktype==ID_PA) { - ParticleSystem *psys=psys_get_current(ob); - if(psys){ - if(psys->part->ipo){ - psys->part->ipo->id.us--; - } - psys->part->ipo = ipo; - } - } - else if(si->blocktype==ID_OB) { - if(ob->ipo) - ob->ipo->id.us--; - ob->ipo= ipo; - } - } - break; - case ID_MA: - { - Material *ma= (Material *)si->from; - - if(ma->ipo) - ma->ipo->id.us--; - ma->ipo= ipo; - } - break; - case ID_TE: - { - Tex *tex= (Tex *)si->from; - - if(tex->ipo) - tex->ipo->id.us--; - tex->ipo= ipo; - } - break; - case ID_SEQ: - { - Sequence *seq= (Sequence *)si->from; /* note, sequence is mimicing Id */ - - if((seq->type & SEQ_EFFECT) - || (seq->type == SEQ_RAM_SOUND) - || (seq->type == SEQ_HD_SOUND)) { - if(seq->ipo) - seq->ipo->id.us--; - seq->ipo= ipo; - } - } - break; - case ID_CU: - { - Curve *cu= (Curve *)si->from; - - if(cu->ipo) - cu->ipo->id.us--; - cu->ipo= ipo; - } - break; - case ID_KE: - { - Key *key= (Key *)si->from; - - if(key->ipo) - key->ipo->id.us--; - key->ipo= ipo; - } - break; - case ID_WO: - { - World *wo= (World *)si->from; - - if(wo->ipo) - wo->ipo->id.us--; - wo->ipo= ipo; - } - break; - case ID_LA: - { - Lamp *la= (Lamp *)si->from; - - if(la->ipo) - la->ipo->id.us--; - la->ipo= ipo; - } - break; - case ID_CA: - { - Camera *ca= (Camera *)si->from; - - if(ca->ipo) - ca->ipo->id.us--; - ca->ipo= ipo; - } - break; - case ID_SO: - { - bSound *snd= (bSound *)si->from; - - if(snd->ipo) - snd->ipo->id.us--; - snd->ipo= ipo; - } - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWBUTSALL, 0); - -} - - -static void do_ipo_editmenu_transformmenu(void *arg, int event) -{ - switch(event) - { - case 0: /* grab/move */ - transform_ipo('g'); - break; - case 1: /* rotate */ - transform_ipo('r'); - break; - case 2: /* scale */ - transform_ipo('s'); - break; - } -} - -static uiBlock *ipo_editmenu_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_ipo_editmenu_snapmenu(void *arg, int event) -{ - switch(event) { - case 1: /* Horizontal */ - case 2: /* To Next */ - case 3: /* To Frame */ - case 4: /* To Current Frame */ - ipo_snap(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *ipo_editmenu_snapmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_snapmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Horizontal|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Next|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Frame|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Current Frame|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_ipo_editmenu_mirrormenu(void *arg, int event) -{ - switch(event) { - case 1: /* mirror over current frame */ - case 2: /* mirror over frame 0 */ - case 3: /* mirror over horizontal axis */ - ipo_mirror(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *ipo_editmenu_mirrormenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Current Frame|Shift M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Vertical Axis|Shift M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Horizontal Axis|Shift M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_ipo_editmenu_joinmenu(void *arg, int event) -{ - switch(event) { - case 1: /* All Selected */ - case 2: /* Selected Doubles */ - join_ipo(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *ipo_editmenu_joinmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_joinmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_joinmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Selected|Ctrl J, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Doubles|Ctrl J, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_ipo_editmenu_keymenu(void *arg, int event) -{ - Key *key; - KeyBlock *kb; - Object *ob= OBACT; - - if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) { - key= ob_get_key((Object *)G.sipo->from); - if(key==NULL) return; - - kb= BLI_findlink(&key->block, ob->shapenr-1); - kb->type= 0; - switch(event){ - case 0: - kb->type= KEY_LINEAR; - break; - case 1: - kb->type= KEY_CARDINAL; - break; - case 2: - kb->type= KEY_BSPLINE; - break; - } - } -} - -static uiBlock *ipo_editmenu_keymenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_keymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_keymenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linear|T, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cardinal|T, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "BSpline|T, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; - -} - -static void do_ipo_editmenu_handlemenu(void *arg, int event) -{ - switch(event){ - case 0: - sethandles_ipo(HD_AUTO); - break; - case 1: - case 2: - sethandles_ipo(HD_ALIGN); - break; - case 3: - sethandles_ipo(HD_VECT); - break; - case 4: - sethandles_ipo(HD_AUTO_ANIM); - break; - } -} - -static uiBlock *ipo_editmenu_handlemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_handlemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_handlemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Clamped|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Aligned|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Free|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_ipo_editmenu_intpolmenu(void *arg, int event) -{ - EditIpo *ei; - int a; - - get_status_editipo(); - - ei = G.sipo->editipo; - - switch(event) - { - case 0: - for(a=0; atotipo; a++, ei++) { - if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) { - ei->icu->ipo= IPO_CONST; - } - } - break; - case 1: - for(a=0; atotipo; a++, ei++) { - if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) { - ei->icu->ipo= IPO_LIN; - } - } - break; - case 2: - for(a=0; atotipo; a++, ei++) { - if ISPOIN3(ei, flag & IPO_VISIBLE, flag & IPO_SELECT, icu) { - ei->icu->ipo= IPO_BEZ; - } - } - break; - } - - scrarea_queue_winredraw(curarea); -} - -static uiBlock *ipo_editmenu_intpolmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_intpolmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_intpolmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant|T, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linear|T, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bezier|T, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_ipo_editmenu_extendmenu(void *arg, int event) -{ - switch(event) - { - case 0: - do_ipo_buttons(B_IPOCONT); - break; - case 1: - do_ipo_buttons(B_IPOEXTRAP); - break; - case 2: - do_ipo_buttons(B_IPOCYCLIC); - break; - case 3: - do_ipo_buttons(B_IPOCYCLICX); - break; - } -} - -static uiBlock *ipo_editmenu_extendmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_extendmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_ipo_editmenu_extendmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrapolation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic Extrapolation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - - -static void do_ipo_editmenu(void *arg, int event) -{ - switch(event) - { - case 0: - del_ipo(1); - break; - case 1: - add_duplicate_editipo(); - break; - case 2: - ipo_record(); - break; - case 3: - mainqenter(IKEY, 1); - break; - case 4 : - add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 5: - //join_ipo(); - break; - case 6: - /*IPO Editmode*/ - set_editflag_editipo(); - break; - case 7: - sethandles_ipo(HD_AUTO_ANIM); - break; - case 8: /* clean ipo */ - clean_ipo(); - break; - case 9: /* smooth ipo */ - smooth_ipo(); - break; - } -} - -static uiBlock *ipo_editmenu(void *arg_unused) -{ - uiBlock *block; - EditIpo *ei; - short yco= 0, menuwidth=120; - int a,isedit = 0; - - get_status_editipo(); - - ei = G.sipo->editipo; - - block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_ipo_editmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefIconTextBlockBut(block, ipo_editmenu_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - - uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefIconTextBlockBut(block, ipo_editmenu_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - /*Look to see if any ipos are being edited, so there can be a check next to the menu option*/ - for(a=0; atotipo; a++, ei++) { - if(ei->icu) { - if(ei->flag & IPO_VISIBLE) { - if(totipo_edit && (ei->flag & IPO_EDIT)) { - isedit = 1; - break; - } - } - } - } - if(isedit) - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Edit Selected|TAB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Edit Selected|TAB", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - ei = get_active_editipo(); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(ei && ei->icu && ei->icu->driver) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert 1:1 Curve...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe...|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Record Mouse Movement|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clean IPO Curves|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth IPO Curves|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, ipo_editmenu_joinmenu, NULL, ICON_RIGHTARROW_THIN, "Join", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Auto Clamped Handles|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - if (!G.sipo->showkey){ - uiDefIconTextBlockBut(block, ipo_editmenu_extendmenu, NULL, ICON_RIGHTARROW_THIN, "Extend Mode", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, ipo_editmenu_intpolmenu, NULL, ICON_RIGHTARROW_THIN, "Interpolation Mode ", 0, yco-=20, 120, 20, ""); - if(ei != NULL && (ei->flag & IPO_EDIT)) - uiDefIconTextBlockBut(block, ipo_editmenu_handlemenu, NULL, ICON_RIGHTARROW_THIN, "Handle Type", 0, yco-=20, 120, 19, ""); - if(G.sipo->blocktype==ID_KE && totipo_edit==0 && totipo_sel==0) - uiDefIconTextBlockBut(block, ipo_editmenu_keymenu, NULL, ICON_RIGHTARROW_THIN, "Key Type", 0, yco-=20, 120, 19, ""); - } - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_ipo_viewmenu(void *arg, int event) -{ - extern int play_anim(int mode); - - switch(event) - { - case 1: - do_ipo_buttons(B_IPOHOME); - break; - case 2: - ipo_toggle_showkey(); - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - allqueue(REDRAWVIEW3D, 0); - break; - case 3: - move_to_frame(); - break; - case 4: - mainqenter(PADPLUSKEY,1); - break; - case 5: - mainqenter(PADMINUS,1); - break; - case 6: /* Play Animation */ - play_anim(0); - break; - case 7: /* Play Animation in All */ - play_anim(1); - break; - case 8: - add_blockhandler(curarea, IPO_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 9: - G.v2d->flag ^= V2D_VIEWLOCK; - if(G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0); - break; - case 10: /* center view to current frame */ - center_currframe(); - scrarea_queue_winredraw(curarea); - break; - case 11: - do_ipo_buttons(B_IPOVIEWCENTER); - break; - } -} - -static uiBlock *ipo_viewmenu(void *arg_unused) -{ - uiBlock *block; - EditIpo *ei; - short yco= 0, menuwidth=120; - - ei = get_active_editipo(); - - block= uiNewBlock(&curarea->uiblocks, "ipo_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_ipo_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Channel Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - if (G.sipo->showkey) - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Keys|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Animation in 3D View|Alt Shift A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center on Current Frame|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - if (ei != NULL && (ei->flag & IPO_EDIT)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Current Frame to Selected|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,20, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_ipo_selectmenu(void *arg, int event) -{ - switch(event) - { - case 0: - borderselect_ipo(); - break; - case 1: - swap_selectall_editipo(); - break; - case 2: - borderselect_markers(); - allqueue(REDRAWMARKER, 0); - break; - case 3: - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - break; - } -} - -static uiBlock *ipo_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_ipo_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Markers|Ctrl B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_ipo_markermenu(void *arg, int event) -{ - switch(event) - { - case 1: - add_marker(CFRA); - break; - case 2: - duplicate_marker(); - break; - case 3: - remove_marker(); - break; - case 4: - rename_marker(); - break; - case 5: - transform_markers('g', 0); - break; - } - - allqueue(REDRAWMARKER, 0); -} - -static uiBlock *ipo_markermenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_ipo_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static char *ipo_modeselect_pup(void) -{ - Object *ob= OBACT; - static char formatstring[] = "|%s %%x%d %%i%d"; - static char string[1024]; - char *str = string; - - str += sprintf(str, "Ipo type: %%t"); - - if(ob) - str += sprintf(str,formatstring, "Object",ID_OB, ICON_OBJECT); - - if(ob && give_current_material(ob, ob->actcol)) // check for material - str += sprintf(str,formatstring, "Material",ID_MA, ICON_MATERIAL); - - if(G.scene->world) - str += sprintf(str,formatstring, "World",ID_WO, ICON_WORLD); - - if(ob && ob->type==OB_CURVE) - str += sprintf(str,formatstring, "Path",ID_CU, ICON_CURVE); - - if(ob && ob->type==OB_CAMERA) - str += sprintf(str,formatstring, "Camera",ID_CA, ICON_CAMERA); - - if(ob && ob->type==OB_LAMP) - str += sprintf(str,formatstring, "Lamp",ID_LA, ICON_LAMP); - - if(ob && give_current_texture(ob, ob->actcol)) - str += sprintf(str,formatstring, "Texture",ID_TE, ICON_TEXTURE); - - if(ob){ - if ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_LATTICE) - str += sprintf(str,formatstring, "Shape",ID_KE, ICON_EDIT); - if (ob->type==OB_ARMATURE) - str += sprintf(str,formatstring, "Pose",ID_PO, ICON_POSE_HLT); -#ifdef __CON_IPO - str += sprintf(str,formatstring, "Constraint",ID_CO, ICON_CONSTRAINT); -#endif - if(ob->fluidsimFlag & OB_FLUIDSIM_ENABLE) { - str += sprintf(str,formatstring,"Fluidsim",ID_FLUIDSIM, ICON_WORLD); - } - - if(ob->particlesystem.first) { - str += sprintf(str,formatstring,"Particles",ID_PA, ICON_PARTICLES); - } - } - - str += sprintf(str,formatstring, "Sequence",ID_SEQ, ICON_SEQUENCE); - - return (string); -} - -void do_ipo_buttons(short event) -{ - EditIpo *ei; - View2D *v2d; - rcti rect; - Object *ob= OBACT; - float xmin, ymin, dx, dy; - int a, val, first; - short mval[2]; - - if(curarea->win==0) return; - - switch(event) { - case B_IPOVIEWCENTER: - case B_IPOHOME: - - /* boundbox */ - - v2d= &(G.sipo->v2d); - first= 1; - - ei= G.sipo->editipo; - if(ei==0) return; - - /* map ipo-points for drawing if scaled ipo */ - if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 0, 0); - } - - for(a=0; atotipo; a++, ei++) { - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - - boundbox_ipocurve(ei->icu, (event==B_IPOVIEWCENTER)); - - if(first) { - v2d->tot= ei->icu->totrct; - first= 0; - } - else BLI_union_rctf(&(v2d->tot), &(ei->icu->totrct)); - } - } - - /* undo mapping of ipo-points for drawing if scaled ipo */ - if (OBACT && OBACT->action && G.sipo->pin==0 && G.sipo->actname) { - actstrip_map_ipo_keys(OBACT, G.sipo->ipo, 1, 0); - } - - /* speciale home */ - if(G.qual & LR_SHIFTKEY) { - v2d->tot.xmin= SFRA; - v2d->tot.xmax= EFRA; - } - - /* zoom out a bit */ - dx= 0.10*(v2d->tot.xmax-v2d->tot.xmin); - dy= 0.10*(v2d->tot.ymax-v2d->tot.ymin); - - if(dxmin[0]) dx= v2d->min[0]; - if(dymin[1]) dy= v2d->min[1]; - - v2d->cur.xmin= v2d->tot.xmin- dx; - v2d->cur.xmax= v2d->tot.xmax+ dx; - v2d->cur.ymin= v2d->tot.ymin- dy; - v2d->cur.ymax= v2d->tot.ymax+ dy; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - if(G.sipo->ipo) G.sipo->ipo->cur = G.v2d->cur; - - scrarea_queue_winredraw(curarea); - break; - case B_IPOBORDER: - val= get_border(&rect, 3); - if(val) { - mval[0]= rect.xmin; - mval[1]= rect.ymin; - areamouseco_to_ipoco(G.v2d, mval, &xmin, &ymin); - mval[0]= rect.xmax; - mval[1]= rect.ymax; - areamouseco_to_ipoco(G.v2d, mval, &(G.v2d->cur.xmax), &(G.v2d->cur.ymax)); - G.v2d->cur.xmin= xmin; - G.v2d->cur.ymin= ymin; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - scrarea_queue_winredraw(curarea); - } - break; - - case B_IPOPIN: - allqueue (REDRAWIPO, 0); - break; - - case B_IPOCOPY: - copy_editipo(); - break; - case B_IPOPASTE: - paste_editipo(); - break; - case B_IPOCONT: - set_exprap_ipo(IPO_HORIZ); - break; - case B_IPOEXTRAP: - set_exprap_ipo(IPO_DIR); - break; - case B_IPOCYCLIC: - set_exprap_ipo(IPO_CYCL); - break; - case B_IPOCYCLICX: - set_exprap_ipo(IPO_CYCLX); - break; - case B_IPOMAIN: - /* pass 1 to enforce a refresh when there's no Ipo */ - test_editipo(1); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - if(ob) ob->ipowin= G.sipo->blocktype; - break; - case B_IPOSHOWKEY: - /* reverse value because of winqread */ - G.sipo->showkey= 1-G.sipo->showkey; - ipo_toggle_showkey(); - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - allqueue(REDRAWVIEW3D, 0); - break; - case B_VIEW2DZOOM: - view2dzoom(event); - scrarea_queue_headredraw(curarea); - break; - case B_IPO_ACTION_OB: - if(ob && G.sipo->from && G.sipo->pin==0) { - if(ob->ipoflag & OB_ACTION_OB) { /* check if channel exists, and flip ipo link */ - bActionChannel *achan; - - if(has_ipo_code(ob->ipo, OB_LAY)) - notice("Note: Layer Ipo doesn't work in Actions"); - - if(ob->action==NULL) - ob->action= add_empty_action("ObAction"); - achan= verify_action_channel(ob->action, "Object"); - if(achan->ipo==NULL && ob->ipo) { - achan->ipo= ob->ipo; - ob->ipo= NULL; - } - - /* object constraints */ - if(ob->constraintChannels.first) { - free_constraint_channels(&achan->constraintChannels); - achan->constraintChannels= ob->constraintChannels; - ob->constraintChannels.first= ob->constraintChannels.last= NULL; - } - } - else if(ob->action) { - bActionChannel *achan= get_action_channel(ob->action, "Object"); - if(achan) { - - if(achan->ipo && ob->ipo==NULL) { - ob->ipo= achan->ipo; - achan->ipo= NULL; - } - - /* object constraints */ - if(achan->constraintChannels.first) { - free_constraint_channels(&ob->constraintChannels); - ob->constraintChannels= achan->constraintChannels; - achan->constraintChannels.first= achan->constraintChannels.last= NULL; - } - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWNLA, 0); - } - break; - - case B_IPO_ACTION_KEY: - if(ob && G.sipo->from && G.sipo->pin==0) { - Key *key= ob_get_key(ob); - if(key) { - if(ob->ipoflag & OB_ACTION_KEY) { /* check if channel exists, and flip ipo link */ - bActionChannel *achan; - - if(ob->action==NULL) - ob->action= add_empty_action("ShapeAction"); - achan= verify_action_channel(ob->action, "Shape"); - if(achan->ipo==NULL && key->ipo) { - achan->ipo= key->ipo; - key->ipo= NULL; - } - } - else if(ob->action) { - bActionChannel *achan= get_action_channel(ob->action, "Shape"); - if(achan) { - if(achan->ipo && key->ipo==NULL) { - key->ipo= achan->ipo; - achan->ipo= NULL; - } - } - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWNLA, 0); - } - } - break; - case B_IPOVIEWALL: - /* set visible active */ - for(a=0, ei=G.sipo->editipo; atotipo; a++, ei++) { - if (ei->icu) ei->flag |= IPO_VISIBLE; - else ei->flag &= ~IPO_VISIBLE; - } - break; - case B_IPOREDRAW: - DAG_object_flush_update(G.scene, ob, OB_RECALC); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - break; - } -} - -void ipo_buttons(void) -{ - Object *ob; - EditIpo *ei; - uiBlock *block; - short xco,xmax; - char naam[20]; - int icon=0, allow_pin= B_IPOPIN; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_IPO; - - xco = 8; - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - xco+= XIC+14; - - test_editipo(0); /* test if current editipo is OK, make_editipo sets v2d->cur */ - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - /* pull down menus */ - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - uiBlockSetEmboss(block, UI_EMBOSSP); - - ei = get_active_editipo(); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block,ipo_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block,ipo_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - if (G.sipo->showkey) { - xmax= GetButStringLength("Key"); - uiDefPulldownBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, ""); - } - else if(ei != NULL && (ei->flag & IPO_EDIT)) { - xmax= GetButStringLength("Point"); - uiDefPulldownBut(block,ipo_editmenu, NULL, "Point", xco, -2, xmax-3, 24, ""); - } - else { - xmax= GetButStringLength("Curve"); - uiDefPulldownBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, ""); - } - xco+=xmax; - } - - /* end of pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSS); - - ob= OBACT; - - /* action switch option, only when active object is there and no pin */ - uiSetButLock(G.sipo->pin, "Can't change because of pinned data"); - - /* define whether ipos are on Object or on action */ - if(ob) { - static short fake1= 1; - - uiBlockBeginAlign(block); - - if(G.sipo->blocktype==ID_OB) { - uiDefIconButBitS(block, TOG, OB_ACTION_OB, B_IPO_ACTION_OB, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not"); - xco+= XIC; - } - else if(G.sipo->blocktype==ID_KE) { - uiDefIconButBitS(block, TOG, OB_ACTION_KEY, B_IPO_ACTION_KEY, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not"); - xco+= XIC; - } - else if(G.sipo->blocktype==ID_CO) { - - if(ob->pose==NULL) - uiDefIconButBitS(block, TOG, OB_ACTION_OB, B_IPO_ACTION_OB, ICON_ACTION, xco,0,XIC,YIC, &(ob->ipoflag), 0, 0, 0, 0, "Sets Ipo to be included in an Action or not"); - else { - bConstraint *con= get_active_constraint(ob); - if(con) - uiDefIconButBitS(block, TOGN, CONSTRAINT_OWN_IPO, B_IPOREDRAW, ICON_ACTION, xco,0,XIC,YIC, &con->flag, 0, 0, 0, 0, - (con->flag & CONSTRAINT_OWN_IPO)?"Ipo is connected to Constraint itself":"Ipo is connected to Pose Action" - ); - } - xco+= XIC; - } - else if(G.sipo->blocktype==ID_PO) { /* only to indicate we have action ipos */ - uiSetButLock(1, "Pose Action Ipo cannot be switched"); - uiDefIconButS(block, TOG, 1, ICON_ACTION, xco,0,XIC,YIC, &fake1, 0, 0, 0, 0, "Ipo is connected to Pose Action"); - xco+= XIC; - } - uiClearButLock(); - } - - /* ipo muting */ - if (G.sipo->ipo) { - uiDefIconButS(block, ICONTOG, 1, ICON_MUTE_IPO_OFF, xco,0,XIC,YIC, &(G.sipo->ipo->muteipo), 0, 0, 0, 0, "Mute IPO-block"); - xco += XIC; - } - - /* mainmenu, only when data is there and no pin */ - uiSetButLock(G.sipo->pin, "Can't change because of pinned data"); - - if (G.sipo->blocktype == ID_OB) - icon = ICON_OBJECT; - else if (G.sipo->blocktype == ID_MA) - icon = ICON_MATERIAL; - else if (G.sipo->blocktype == ID_WO) - icon = ICON_WORLD; - else if (G.sipo->blocktype == ID_CU) - icon = ICON_ANIM; - else if (G.sipo->blocktype == ID_CA) - icon = ICON_CAMERA; - else if (G.sipo->blocktype == ID_LA) - icon = ICON_LAMP; - else if (G.sipo->blocktype == ID_KE) - icon = ICON_EDIT; - else if (G.sipo->blocktype == ID_PO) - icon = ICON_POSE_HLT; - else if (G.sipo->blocktype == ID_CO) - icon = ICON_CONSTRAINT; - else if (G.sipo->blocktype == ID_SEQ) - icon = ICON_SEQUENCE; - else if(G.sipo->blocktype == ID_TE) - icon = ICON_TEXTURE; - else if(G.sipo->blocktype == ID_FLUIDSIM) - icon = ICON_WORLD; - else if(G.sipo->blocktype == ID_PA) - icon = ICON_PARTICLES; - - uiDefIconTextButS(block, MENU, B_IPOMAIN, icon, ipo_modeselect_pup(), xco,0,100,20, &(G.sipo->blocktype), 0, 0, 0, 0, "Show IPO type"); - - xco += 85; - - if(G.sipo->blocktype==ID_MA) { - uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Material texture."); - xco-= 4; - } - if(G.sipo->blocktype==ID_WO) { - uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active World texture."); - xco-= 4; - } - - if(G.sipo->blocktype==ID_LA) { - uiDefButS(block, NUM, B_IPOMAIN, "", xco+=XIC,0,XIC-4,YIC, &G.sipo->channel, 0.0, MAX_MTEX-1.0, 0, 0, "Channel Number of the active Lamp texture. "); - xco-= 4; - } - - uiBlockEndAlign(block); - - uiClearButLock(); - - /* if(G.sipo->blocktype==ID_SEQ) - allow_pin= 0; */ - xco= std_libbuttons(block, (short)(xco+1.5*XIC), 0, allow_pin, &G.sipo->pin, B_IPOBROWSE, ID_IP, - G.sipo->blocktype, (ID*)G.sipo->ipo, G.sipo->from, &(G.sipo->menunr), B_IPOALONE, B_IPOLOCAL, B_IPODELETE, 0, B_KEEPDATA); - - /* COPY PASTE */ - xco-= XIC/2; - uiBlockBeginAlign(block); - if(curarea->headertype==HEADERTOP) { - uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer"); - uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, ERROR_LIBDATA_MESSAGE); - uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer"); - } - else { - uiDefIconBut(block, BUT, B_IPOCOPY, ICON_COPYDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected curves to the buffer"); - uiSetButLock(G.sipo->ipo && G.sipo->ipo->id.lib, ERROR_LIBDATA_MESSAGE); - uiDefIconBut(block, BUT, B_IPOPASTE, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the curves from the buffer"); - } - uiBlockEndAlign(block); - xco+=XIC/2; - - uiClearButLock(); - - /* ZOOMBORDER */ - uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area"); - - xco+=XIC/2; - - /* draw LOCK */ - uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.sipo->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time"); - - /* always do as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_nla.c b/source/blender/src/header_nla.c deleted file mode 100644 index 3b614ebfb7c..00000000000 --- a/source/blender/src/header_nla.c +++ /dev/null @@ -1,566 +0,0 @@ -/** - * header_nla.c oct-2003 - * - * Functions to draw the "NLA Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_ID.h" -#include "DNA_nla_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_utildefines.h" - -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_editnla.h" -#include "BIF_editaction.h" -#include "BIF_toolbox.h" - -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -//#include "nla.h" - -#include "blendef.h" -#include "mydevice.h" - -void do_nla_buttons(unsigned short event) -{ - View2D *v2d; - - switch(event){ - case B_NLAHOME: - // Find X extents - v2d= &(G.snla->v2d); - - /* i tried to understand nla/action drawing to reveil a 'tot' rect, impossible code! (ton) */ - v2d->cur.xmin = G.scene->r.sfra-5; - v2d->cur.xmax = G.scene->r.efra+5; - v2d->cur.ymin= -SCROLLB; - v2d->cur.ymax= 5; // at least stuff is visiable then? - - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - addqueue (curarea->win, REDRAW, 1); - break; - } -} - - -static void do_nla_viewmenu(void *arg, int event) -{ - extern int play_anim(int mode); - - switch(event) { - case 0: /* Update Automatically */ - if(BTST(G.snla->lock, 0)) G.snla->lock = BCLR(G.snla->lock, 0); - else G.snla->lock = BSET(G.snla->lock, 0); - break; - case 1: /* Play Back Animation */ - play_anim(0); - break; - case 2: /* Play Back Animation in 3D View */ - play_anim(1); - break; - case 3: /* View All */ - do_nla_buttons(B_NLAHOME); - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 5: /* Update automatically */ - G.v2d->flag ^= V2D_VIEWLOCK; - if(G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0); - break; - case 6: /* Show all objects that have keyframes? */ - G.snla->flag ^= SNLA_ALLKEYED; - break; - case 7: /* Show timing in Frames or Seconds */ - G.snla->flag ^= SNLA_DRAWTIME; - break; - } -} - -static uiBlock *nla_viewmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "nla_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_nla_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, (G.snla->flag & SNLA_ALLKEYED)?ICON_CHECKBOX_DEHLT:ICON_CHECKBOX_HLT, - "Only Objects On Visible Layers|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - if (G.snla->flag & SNLA_DRAWTIME) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(BTST(G.snla->lock, 0)) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Update Automatically|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_nla_selectmenu(void *arg, int event) -{ - - switch(event) - { - case 0: /* Border Select */ - borderselect_nla(); - break; - case 1: /* Select/Deselect All Keys */ - deselect_nlachannel_keys(1); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - break; - case 2: /* Select/Deselect All Channel */ - deselect_nlachannels(1); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); - break; - case 3: /* Select/Deselect All Markers */ - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - break; - case 4: /* Borderselect markers */ - borderselect_markers(); - break; - } -} - -static uiBlock *nla_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "nla_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_nla_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Markers|Ctrl B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Keys|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Channels", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_nla_strip_snapmenu(void *arg, int event) -{ - snap_action_strips(event); - - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); -} - -static uiBlock *nla_strip_snapmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "nla_strip_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_nla_strip_snapmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nearest Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Current Frame|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_nla_strip_transformmenu(void *arg, int event) -{ - switch(event) { - case 0: /* grab/move */ - transform_nlachannel_keys('g', 0); - update_for_newframe_muted(); - break; - case 1: /* scale */ - transform_nlachannel_keys('s', 0); - update_for_newframe_muted(); - break; - case 2: /* extend */ - transform_nlachannel_keys('e', 0); - update_for_newframe_muted(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *nla_strip_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "nla_strip_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_nla_strip_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Extend from Frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_nla_stripmenu(void *arg, int event) -{ - switch(event) - { - case 0: /* Strip Properties */ - add_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 1: /* Add Action Strip */ - add_nlablock(); - break; - case 2: /* Duplicate */ - duplicate_nlachannel_keys(); - update_for_newframe_muted(); - break; - case 3: /* Delete Strips */ - if (okee("Erase selected strips and/or keys")) { - delete_nlachannel_keys (); - update_for_newframe_muted(); - } - break; - case 5: /* Convert Action to NLA Strip */ - convert_nla(); - break; - case 6: /* Move Up */ - shift_nlastrips_up(); - break; - case 7: /* Move Down */ - shift_nlastrips_down(); - break; - case 8: /* reset scale */ - reset_action_strips(1); - break; - case 9: /* reset start/end of action */ - reset_action_strips(2); - break; - case 10: /* add new action as new action strip */ - add_empty_nlablock(); - break; - case 11: /* apply scale */ - reset_action_strips(3); - break; - } -} - -static uiBlock *nla_stripmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "nla_stripmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_nla_stripmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strip Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, nla_strip_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, ""); - uiDefIconTextBlockBut(block, nla_strip_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Strip Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Action Start/End|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Strip Scaling|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Action Strip|Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Blank Action Strip|Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Action to NLA Strip|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Down|Ctrl Page Down", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Up|Ctrl Page Up", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_nla_markermenu(void *arg, int event) -{ - switch(event) - { - case 1: - add_marker(CFRA); - break; - case 2: - duplicate_marker(); - break; - case 3: - remove_marker(); - break; - case 4: - rename_marker(); - break; - case 5: - transform_markers('g', 0); - break; - } - - allqueue(REDRAWMARKER, 0); -} - -static uiBlock *nla_markermenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "nla_markermenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_nla_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void nla_buttons(void) -{ - SpaceNla *snla; - short xco, xmax; - char naam[20]; - uiBlock *block; - - snla= curarea->spacedata.first; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_NLA; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, nla_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, nla_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block, nla_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Strip"); - uiDefPulldownBut(block, nla_stripmenu, NULL, "Strip", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - - /* draw AUTOSNAP */ - xco += 8; - - if (G.snla->flag & SNLA_DRAWTIME) { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Strips/Keyframes %t|Off %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.snla->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for strips and keyframes when transforming"); - } - else { - uiDefButS(block, MENU, B_REDR, - "Auto-Snap Strips/Keyframes %t|Off %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", - xco,0,70,YIC, &(G.snla->autosnap), 0, 1, 0, 0, - "Auto-snapping mode for strips and keyframes when transforming"); - } - - xco += (70 + 8); - - /* FULL WINDOW */ - - -// xco = 8; - -// uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - -// xco+= XIC+22; - - /* FULL WINDOW */ -// if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); -// else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); - - /* HOME */ -// uiDefIconBut(block, BUT, B_NLAHOME, ICON_HOME, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms window to home view showing all items (HOMEKEY)"); -// xco+= XIC; - - /* IMAGE */ -// uiDefIconButS(block, TOG, B_REDR, ICON_IMAGE_COL, xco+=XIC,0,XIC,YIC, &sseq->mainb, 0, 0, 0, 0, "Toggles image display"); - - /* ZOOM en BORDER */ -// xco+= XIC; -// uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, xco+=XIC,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zoom view (CTRL+MiddleMouse)"); -// uiDefIconBut(block, BUT, B_NLABORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zoom view to area"); - - /* draw LOCK */ -// xco+= XIC/2; - - xco += 8; - - uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco,0,XIC,YIC, &(snla->lock), 0, 0, 0, 0, "Toggles forced redraw of other windows to reflect changes in real time"); - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_node.c b/source/blender/src/header_node.c deleted file mode 100644 index ebdd42690f5..00000000000 --- a/source/blender/src/header_node.c +++ /dev/null @@ -1,673 +0,0 @@ -/** - * - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "DNA_ID.h" -#include "DNA_material_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" - -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_butspace.h" - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_node.h" - -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -void do_node_buttons(ScrArea *sa, unsigned short event) -{ - SpaceNode *snode= sa->spacedata.first; - Material *ma; - - switch(event) { - case B_NODE_USEMAT: - ma= (Material *)snode->id; - if(ma) { - if(ma->use_nodes && ma->nodetree==NULL) { - node_shader_default(ma); - snode_set_context(snode); - } - BIF_preview_changed(ID_MA); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - } - break; - - case B_NODE_USESCENE: - if(G.scene->use_nodes) { - if(G.scene->nodetree==NULL) - node_composit_default(G.scene); - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - } - snode_set_context(snode); - allqueue(REDRAWNODE, 0); - break; - } -} - -static void do_node_viewmenu(void *arg, int event) -{ - SpaceNode *snode= curarea->spacedata.first; - - switch(event) { - case 1: /* Zoom in */ - snode_zoom_in(curarea); - break; - case 2: /* View all */ - snode_zoom_out(curarea); - break; - case 3: /* View all */ - snode_home(curarea, snode); - break; - } - allqueue(REDRAWNODE, 0); -} - -static uiBlock *node_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "node_viewmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_node_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_node_selectmenu(void *arg, int event) -{ - SpaceNode *snode= curarea->spacedata.first; - - /* functions in editnode.c assume there's a tree */ - if(snode->nodetree==NULL) - return; - - switch(event) { - case 1: /* border select */ - node_border_select(snode); - break; - case 2: /* select/deselect all */ - node_deselectall(snode, 1); - break; - case 3: /* select linked in */ - node_select_linked(snode, 0); - break; - case 4: /* select linked out */ - node_select_linked(snode, 1); - break; - } - allqueue(REDRAWNODE, 0); -} - -static uiBlock *node_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "node_selectmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_node_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked From|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked To|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_node_addmenu(void *arg, int event) -{ - SpaceNode *snode= curarea->spacedata.first; - bNode *node; - float locx, locy; - short mval[2]; - - /* store selection in temp test flag */ - for(node= snode->edittree->nodes.first; node; node= node->next) { - if(node->flag & NODE_SELECT) node->flag |= NODE_TEST; - else node->flag &= ~NODE_TEST; - } - - getmouseco_areawin(mval); - areamouseco_to_ipoco(G.v2d, mval, &locx, &locy); - node= node_add_node(snode, event, locx, locy); - - /* uses test flag */ - snode_autoconnect(snode, node, NODE_TEST); - - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - - BIF_undo_push("Add Node"); - -} - -static void node_make_addmenu(SpaceNode *snode, int nodeclass, uiBlock *block) -{ - bNodeTree *ntree; - int tot= 0, a; - short yco= 0, menuwidth=120; - - ntree = snode->nodetree; - if(ntree) { - /* mostly taken from toolbox.c, node_add_sublevel() */ - if(ntree) { - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= G.main->nodetree.first; - for(; ngroup; ngroup= ngroup->id.next) - if(ngroup->type==ntree->type) - tot++; - } - else { - bNodeType *type = ntree->alltypes.first; - while(type) { - if(type->nclass == nodeclass) - tot++; - type= type->next; - } - } - } - - if(tot==0) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - return; - } - - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= G.main->nodetree.first; - for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) { - if(ngroup->type==ntree->type) { - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, (ngroup->id.name+2), 0, - yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, NODE_GROUP_MENU+tot, ""); - a++; - } - } - } - else { - bNodeType *type; - for(a=0, type= ntree->alltypes.first; type; type=type->next) { - if( type->nclass == nodeclass ) { - printf("node %s\n", type->name); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0, - yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, type->type, ""); - a++; - } - } - } - } else { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - return; - } -} - -static uiBlock *node_add_inputmenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_inputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_INPUT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_outputmenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_outputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_OUTPUT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_colormenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_colormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_OP_COLOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_vectormenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_vectormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_OP_VECTOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_filtermenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_filtermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_OP_FILTER, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_convertermenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_convertermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_CONVERTOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_mattemenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_mattemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_MATTE, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_distortmenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_distortmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_DISTORT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -static uiBlock *node_add_groupmenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "node_add_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(snode, NODE_CLASS_GROUP, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static uiBlock *node_addmenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "node_addmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - if(snode->treetype==NTREE_SHADER) { - uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - } - else if(snode->treetype==NTREE_COMPOSIT) { - uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_filtermenu, NULL, ICON_RIGHTARROW_THIN, "Filter", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_mattemenu, NULL, ICON_RIGHTARROW_THIN, "Matte", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - - } else - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_node_nodemenu(void *arg, int event) -{ - SpaceNode *snode= curarea->spacedata.first; - int fromlib=0; - - /* functions in editnode.c assume there's a tree */ - if(snode->nodetree==NULL) - return; - fromlib= (snode->id && snode->id->lib); - - switch(event) { - case 1: /* grab/move */ - node_transform_ext(0,0); - break; - case 2: /* duplicate */ - if(fromlib) fromlib= -1; - else node_adduplicate(snode); - break; - case 3: /* delete */ - if(fromlib) fromlib= -1; - else node_delete(snode); - break; - case 4: /* make group */ - node_make_group(snode); - break; - case 5: /* ungroup */ - node_ungroup(snode); - break; - case 6: /* edit group */ - if(fromlib) fromlib= -1; - else snode_make_group_editable(snode, NULL); - break; - case 7: /* hide/unhide */ - node_hide(snode); - break; - case 8: /* read saved render layers */ - node_read_renderlayers(snode); - break; - case 9: /* show cyclic */ - ntreeSolveOrder(snode->edittree); - break; - case 10: /* execute */ - addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - break; - } - - if(fromlib==-1) error_libdata(); - allqueue(REDRAWNODE, 0); -} - -static uiBlock *node_nodemenu(void *arg_unused) -{ - SpaceNode *snode= curarea->spacedata.first; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "node_nodemenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_node_nodemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Group|Ctrl G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ungroup|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edit Group|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide/Unhide|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(snode->treetype==NTREE_COMPOSIT) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Execute Composite|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Read Saved Render Results|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Cyclic Dependencies|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void node_buttons(ScrArea *sa) -{ - SpaceNode *snode= sa->spacedata.first; - uiBlock *block; - short xco, xmax; - char name[256]; - - sprintf(name, "header %d", sa->headwin); - block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->headwin); - - if(area_is_active_area(sa)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - sa->butspacetype= SPACE_NODE; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco, 0, XIC+10, YIC, - &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type"); - - xco += XIC + 14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if (sa->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, "Show pulldown menus"); - } - else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, "Hide pulldown menus"); - } - xco+=XIC; - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, node_viewmenu, NULL, - "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, node_selectmenu, NULL, - "Select", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, node_addmenu, NULL, - "Add", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Node"); - uiDefPulldownBut(block, node_nodemenu, NULL, - "Node", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* main type choosing */ - uiBlockBeginAlign(block); - uiDefIconButI(block, ROW, B_REDR, ICON_MATERIAL_DEHLT, xco,2,XIC,YIC-2, - &(snode->treetype), 2, 0, 0, 0, "Material Nodes"); - xco+= XIC; - uiDefIconButI(block, ROW, B_REDR, ICON_IMAGE_DEHLT, xco,2,XIC,YIC-2, - &(snode->treetype), 2, 1, 0, 0, "Composite Nodes"); - xco+= 2*XIC; - uiBlockEndAlign(block); - - /* find and set the context */ - snode_set_context(snode); - - if(snode->treetype==NTREE_SHADER) { - if(snode->from) { - /* 0, NULL -> pin */ - xco= std_libbuttons(block, xco, 0, 0, NULL, B_MATBROWSE, ID_MA, 1, snode->id, snode->from, &(snode->menunr), - B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA); - - if(snode->id) { - Material *ma= (Material *)snode->id; - uiDefButC(block, TOG, B_NODE_USEMAT, "Use Nodes", xco+5,0,70,19, &ma->use_nodes, 0.0f, 0.0f, 0, 0, ""); - xco+=80; - } - } - } - else if(snode->treetype==NTREE_COMPOSIT) { - uiDefButS(block, TOG, B_NODE_USESCENE, "Use Nodes", xco+5,0,70,19, &G.scene->use_nodes, 0.0f, 0.0f, 0, 0, "Indicate this Scene will use Nodes and execute them while editing"); - xco+= 80; - uiDefButBitS(block, TOG, R_COMP_FREE, B_NOP, "Free Unused", xco+5,0,80,19, &G.scene->r.scemode, 0.0f, 0.0f, 0, 0, "Free Nodes that are not used while composite"); - xco+= 80; - uiDefButBitS(block, TOG, SNODE_BACKDRAW, REDRAWNODE, "Backdrop", xco+5,0,80,19, &snode->flag, 0.0f, 0.0f, 0, 0, "Use active Viewer Node output as backdrop"); - xco+= 80; - } - - /* always as last */ - sa->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c deleted file mode 100644 index 7bfbf0ee667..00000000000 --- a/source/blender/src/header_oops.c +++ /dev/null @@ -1,578 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: not all of this file anymore. - * - * Contributor(s): Blender Foundation. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" -#include "BIF_language.h" - -#include "DNA_ID.h" -#include "DNA_oops_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_editoops.h" -#include "BIF_oops.h" -#include "BIF_outliner.h" -#include "BIF_space.h" - -#include "BSE_drawipo.h" -#include "BSE_drawoops.h" -#include "BSE_headerbuttons.h" - -#include "blendef.h" - -#include "BKE_depsgraph.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -static int viewmovetemp = 0; - -void do_oops_buttons(short event) -{ - float dx, dy; - - /* used for maximize hack */ - int win_width, win_height; - float aspect_win, aspect_oops, oops_width, oops_height, oops_x_mid, oops_y_mid; - - - if(curarea->win==0) return; - - if (event == B_NEWOOPS) { - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - G.soops->lockpoin= 0; - } else { /* must be either B_OOPSHOME or B_OOPSVIEWSEL */ - init_v2d_oops(curarea, curarea->spacedata.first); // forces min/max to be reset - if (event == B_OOPSHOME) { - boundbox_oops(0); /* Test all oops blocks */ - } else { - boundbox_oops(1); /* Test only selected oops blocks */ - } - - - /* Hack to work with test_view2d in drawipo.c - Modify the bounding box so it is maximized to the window aspect - so viewing all oops blocks isnt limited to hoz/vert only. - Cant modify drawipo.c because many other functions use this hos/vert operation - Campbell*/ - - win_width= curarea->winrct.xmax - curarea->winrct.xmin; - win_height= curarea->winrct.ymax - curarea->winrct.ymin; - - oops_width = G.v2d->tot.xmax - G.v2d->tot.xmin; - oops_height = G.v2d->tot.ymax - G.v2d->tot.ymin; - - oops_x_mid = (G.v2d->tot.xmax + G.v2d->tot.xmin)*0.5; - oops_y_mid = (G.v2d->tot.ymax + G.v2d->tot.ymin)*0.5; - /* wide windows will be above 1, skinny below 1 */ - aspect_win= (float)win_width / (float)win_height; - aspect_oops = (float)oops_width / (float)oops_height; - if (aspect_win>aspect_oops) {/* the window is wider then the oops bounds, increase the oops width */ - G.v2d->tot.xmin = oops_x_mid - ((oops_x_mid-G.v2d->tot.xmin) * (aspect_win/aspect_oops) ); /* scale the min */ - G.v2d->tot.xmax = oops_x_mid + ((G.v2d->tot.xmax-oops_x_mid) * (aspect_win/aspect_oops) );/* scale the max */ - } else { /* the window is skinnier then the oops bounds, increase the oops height */ - G.v2d->tot.ymin = oops_y_mid - ((oops_y_mid-G.v2d->tot.ymin) * (aspect_oops/aspect_win) ); /* scale the min */ - G.v2d->tot.ymax = oops_y_mid + ((G.v2d->tot.ymax-oops_y_mid) * (aspect_oops/aspect_win) );/* scale the max */ - } - - /* maybe we should restore the correct values? - do next of its needed */ - /* end hack */ - - - - G.v2d->cur= G.v2d->tot; - dx= 0.15*(G.v2d->cur.xmax-G.v2d->cur.xmin); - dy= 0.15*(G.v2d->cur.ymax-G.v2d->cur.ymin); - G.v2d->cur.xmin-= dx; - G.v2d->cur.xmax+= dx; - G.v2d->cur.ymin-= dy; - G.v2d->cur.ymax+= dy; - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - } -} - -static void do_oops_viewmenu(void *arg, int event) -{ - SpaceOops *soops= curarea->spacedata.first; - - switch(event) { - case 0: /* Shuffle Selected Blocks */ - shuffle_oops(); - break; - case 1: /* Shrink Selected Blocks */ - shrink_oops(); - break; - case 2: /* View All */ - do_oops_buttons(B_OOPSHOME); - break; - case 3: /* View All */ - do_oops_buttons(B_OOPSVIEWSEL); - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 5: /* show outliner */ - if(soops->type==SO_OOPS || soops->type==SO_DEPSGRAPH) soops->type= SO_OUTLINER; - else soops->type= SO_OOPS; - init_v2d_oops(curarea, soops); - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - case 6: - outliner_toggle_visible(curarea); - break; - case 7: - outliner_show_hierarchy(curarea); - break; - case 8: - outliner_show_active(curarea); - break; - case 9: - outliner_one_level(curarea, 1); - break; - case 10: - outliner_one_level(curarea, -1); - break; -#ifdef SHOWDEPGRAPH - case 11: - // show deps - { - SpaceOops *soops= curarea->spacedata.first; - if(soops->type==SO_OOPS) { - soops->type= SO_DEPSGRAPH; - soops->deps_flags = DAG_RL_ALL_BUT_DATA_MASK; - } else - soops->type= SO_OOPS; - init_v2d_oops(curarea, soops); - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - } - break; -#endif - case 12: - if (soops->flag & SO_HIDE_RESTRICTCOLS) soops->flag &= ~SO_HIDE_RESTRICTCOLS; - else soops->flag |= SO_HIDE_RESTRICTCOLS; - break; - } -} - -static uiBlock *oops_viewmenu(void *arg_unused) -{ - SpaceOops *soops= curarea->spacedata.first; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "oops_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_oops_viewmenu, NULL); - - if(soops->type==SO_OOPS) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); -#ifdef SHOWDEPGRAPH - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Dependancies", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); -#endif - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shuffle Selected Blocks|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink Selected Blocks|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } -#ifdef SHOWDEPGRAPH - else if(soops->type==SO_DEPSGRAPH) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Outliner", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - } -#endif - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Oops Schematic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (soops->flag & SO_HIDE_RESTRICTCOLS) - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Show Restriction Columns", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Show Restriction Columns", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Expand One Level|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse One Level|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show/Hide All", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hierarchy|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Active|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - - -static void do_oops_selectmenu(void *arg, int event) -{ - - switch(event) - { - case 0: /* Border Select */ - borderselect_oops(); - break; - case 1: /* Select/Deselect All */ - swap_select_all_oops(); - break; - case 2: /* Linked to Selected */ - select_linked_oops(); - break; - case 3: /* Users of Selected */ - select_backlinked_oops(); - break; - } -} - -static uiBlock *oops_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "oops_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_oops_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked to Selected|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Users of Selected|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_oops_blockmenu(void *arg, int event) -{ - switch(event) - { - case 0: /* grab/move */ - transform_oops('g', 0); - break; - case 1: /* scale */ - transform_oops('s', 0); - break; - } -} - -static uiBlock *oops_blockmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_oops_blockmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_oops_searchmenu(void *arg, int event) -{ - int search_flags = OL_FIND, again = 0; - - switch(event) - { - case 0: /* plain new find */ - search_flags = OL_FIND; - break; - case 1: /* case sensitive */ - search_flags = OL_FIND_CASE; - break; - case 2: /* full search */ - search_flags = OL_FIND_COMPLETE; - break; - case 3: /* full case sensitive */ - search_flags = OL_FIND_COMPLETE_CASE; - break; - case 4: /* again */ - again = 1; - break; - default: /* nothing valid */ - return; - } - - /* run search */ - outliner_find_panel(curarea, again, search_flags); -} - -static uiBlock *oops_searchmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "oops_searchmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_oops_searchmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find (Case Sensitive)|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Complete|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Complete (Case Sensitive)|Ctrl Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Again|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void oops_buttons(void) -{ - SpaceOops *soops; - Oops *oops; - uiBlock *block; - short xco, xmax; - char naam[256]; - - soops= curarea->spacedata.first; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_OOPS; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Show pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, oops_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - if(soops->type==SO_OOPS) { - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Block"); - uiDefPulldownBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - } - else { - xmax= GetButStringLength("Search"); - uiDefPulldownBut(block, oops_searchmenu, NULL, "Search", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - if(soops->type==SO_OOPS) { - /* ZOOM and BORDER */ - uiBlockBeginAlign(block); - uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, (short)(xco),0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view (Ctrl MiddleMouse)"); - uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, (short)(xco+=XIC),0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to area"); - uiBlockEndAlign(block); - - xco+= 8; - - /* VISIBLE */ - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OOPS_LAY, B_NEWOOPS, "Layer", (short)(xco+=XIC),0,XIC+20,YIC, &soops->visiflag, 0, 0, 0, 0, "Only show object datablocks on visible layers"); - xco+= 20; - uiDefIconButBitS(block, TOG, OOPS_SCE, B_NEWOOPS, ICON_SCENE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Scene datablocks"); - uiDefIconButBitS(block, TOG, OOPS_OB, B_NEWOOPS, ICON_OBJECT_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Object datablocks"); - uiDefIconButBitS(block, TOG, OOPS_ME, B_NEWOOPS, ICON_MESH_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Mesh datablocks"); - uiDefIconButBitS(block, TOG, OOPS_CU, B_NEWOOPS, ICON_CURVE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Curve/Surface/Font datablocks"); - uiDefIconButBitS(block, TOG, OOPS_MB, B_NEWOOPS, ICON_MBALL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Metaball datablocks"); - uiDefIconButBitS(block, TOG, OOPS_LT, B_NEWOOPS, ICON_LATTICE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lattice datablocks"); - uiDefIconButBitS(block, TOG, OOPS_LA, B_NEWOOPS, ICON_LAMP_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Lamp datablocks"); - uiDefIconButBitS(block, TOG, OOPS_MA, B_NEWOOPS, ICON_MATERIAL_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Material datablocks"); - uiDefIconButBitS(block, TOG, OOPS_TE, B_NEWOOPS, ICON_TEXTURE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Texture datablocks"); - uiDefIconButBitS(block, TOG, OOPS_IP, B_NEWOOPS, ICON_IPO_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Ipo datablocks"); - uiDefIconButBitS(block, TOG, OOPS_IM, B_NEWOOPS, ICON_IMAGE_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Image datablocks"); - uiDefIconButBitS(block, TOG, OOPS_GR, B_NEWOOPS, ICON_CIRCLE_DEHLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Group datablocks"); - uiDefIconButBitS(block, TOG, OOPS_LI, B_NEWOOPS, ICON_LIBRARY_HLT, (short)(xco+=XIC),0,XIC,YIC, &soops->visiflag, 0, 0, 0, 0, "Displays Library datablocks"); - - - uiBlockEndAlign(block); - - /* name */ - if(G.soops->lockpoin) { - oops= G.soops->lockpoin; - if(oops->type==ID_LI) strcpy(naam, ((Library *)oops->id)->name); - else strcpy(naam, oops->id->name); - - cpack(0x0); - BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */ - BIF_SetScale(1.0); - glRasterPos2i(xco+=XIC+10, 5); - BIF_RasterPos(xco+=XIC+10, 5); - BIF_DrawString(G.font, naam, 0); - - } - } -#ifdef SHOWDEPGRAPH - else if(soops->type==SO_DEPSGRAPH) { - // cpack colors : 0x00FF00 0xFF0000 0xFFFF00 0x000000 0x0000FF 0x00FFFF - static unsigned char colr[21] ={0x00, 0xFF, 0x00, - 0x00, 0x00, 0xFF, - 0x00, 0xFF, 0xFF, - 0x00, 0x00, 0x00, - 0xFF, 0x00, 0x00, - 0xFF, 0xFF, 0x00, - 0xFF, 0x00, 0x00}; - - uiDefButC( block, COL, 0, "", (short)(xco+=10),0, 5,YIC, colr, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|2, B_REDR, "parent", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "parent"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+3, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|1, B_REDR, "data", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "data"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+6, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|3, B_REDR, "track", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "track"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+9, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|4, B_REDR, "path", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "path"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+12, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|5, B_REDR, "cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "constraint"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+15, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|6, B_REDR, "hook.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "hook"); - uiDefButC( block, COL, 0, "", (short)(xco+=60),0, 5,YIC, colr+18, 0, 1, 0, 0, ""); - uiDefButS( block, TOG|BIT|7, B_REDR, "d cons.", (short)(xco+=7),0, 50,YIC, &soops->deps_flags, 0, 1, 0, 0, "d cons"); - } -#endif - else { - if(G.main->library.first) -#ifdef WITH_VERSE - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); -#else - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); -#endif /* WITH_VERSE */ - else -#ifdef WITH_VERSE - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); -#else - uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4", xco, 0, 100, 20, &soops->outlinevis, 0, 0, 0, 0, ""); -#endif /* WITH_VERSE */ - } - - /* always do as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} - diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c deleted file mode 100644 index 98f18c4e2ac..00000000000 --- a/source/blender/src/header_script.c +++ /dev/null @@ -1,280 +0,0 @@ -/** - * header_script.c nov-2003 - * - * Functions to draw the "Script Window" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Willian P. Germano. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BLI_blenlib.h" - -#include "BSE_headerbuttons.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_sca.h" -#include "BSE_filesel.h" - -#include "BPI_script.h" -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "blendef.h" -#include "mydevice.h" - -/* ********************** SCRIPT ****************************** */ - -/* action executed after clicking in Scripts menu */ -static void do_scripts_submenus(void *int_arg, int event) -{ - int menutype = (long)int_arg; - - BPY_menu_do_python (menutype, event); - - //allqueue(REDRAWSCRIPT, 0); -} - -static uiBlock *script_scripts_submenus(void *int_menutype) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - BPyMenu *pym; - int i = 0, menutype = (long)int_menutype; - - if ((menutype < 0) || (menutype > PYMENU_SCRIPTS_MENU_TOTAL)) - return NULL; - - block= uiNewBlock(&curarea->uiblocks, "scriptsscriptssubmenus", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_scripts_submenus, int_menutype); - - for (pym = BPyMenuTable[menutype]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_script_scriptsmenu(void *arg, int event) -{ - ScrArea *sa; - - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - /* these are no defines, easier this way, the codes are in the function below */ - switch(event) { - case 0: /* update menus */ - BPyMenu_RemoveAllEntries(); - if (BPyMenu_Init(1) == -1) error("Invalid scripts dir: check console"); - break; - } - -// allqueue(REDRAWSCRIPT, 0); -} - -/* Scripts menu */ -static uiBlock *script_scriptsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 0, menuwidth = 120; - int i; - - block= uiNewBlock(&curarea->uiblocks, "script_scriptsmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL); - - for (i = 0; i < PYMENU_SCRIPTS_MENU_TOTAL; i++) { - uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(long)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Update Menus", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "Use when a scripts folder or its contents are modified"); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_script_buttons(unsigned short event) -{ - SpaceScript *sc= curarea->spacedata.first; - ID *id, *idtest; - int nr= 1; - Script *script = sc->script; - - if (!sc) return; - if (sc->spacetype != SPACE_SCRIPT) return; - - switch (event) { - case B_SCRIPTBROWSE: - if (sc->menunr==-2) { - activate_databrowse((ID *)script, ID_SCR, 0, B_SCRIPTBROWSE, - &sc->menunr, do_script_buttons); - break; - } - - if(sc->menunr < 0) break; - - nr = 1; - id = (ID *)script; - - idtest= G.main->script.first; - while(idtest) { - if(nr==sc->menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest!=id) { - sc->script= (Script *)idtest; - - allqueue(REDRAWSCRIPT, 0); - allqueue(REDRAWHEADERS, 0); - } - break; - case B_SCRIPT2PREV: - if(sc->next) { - BLI_remlink(&curarea->spacedata, sc); - BLI_addtail(&curarea->spacedata, sc); - sc = curarea->spacedata.first; - newspace(curarea, sc->spacetype); - } - break; - } - - return; -} - -void script_buttons(void) -{ - uiBlock *block; - SpaceScript *sc= curarea->spacedata.first; - short xco = 8, xmax; - char naam[256]; - - if (!sc || sc->spacetype != SPACE_SCRIPT) return; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_SCRIPT; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, - SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu" - " of available types."); - xco += XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - /* pull down menus */ - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("Scripts"); - uiDefPulldownBut(block,script_scriptsmenu, NULL, "Scripts", xco, 0, xmax, 20, ""); - xco+=xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockBeginAlign(block); - uiDefIconBut(block, BUT, B_SCRIPT2PREV, ICON_GO_LEFT, xco+=XIC, 0, XIC, YIC, - 0, 0, 0, 0, 0, "Returns to previous window"); - - /* FULL WINDOW */ - if(curarea->full) - uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco+=XIC,0,XIC,YIC, 0, 0, - 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); - else - uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco+=XIC,0,XIC,YIC, 0, 0, - 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); - uiBlockEndAlign(block); - - /* STD SCRIPT BUTTONS */ - xco += 2*XIC; - xco= std_libbuttons(block, xco, 0, 0, NULL, B_SCRIPTBROWSE, ID_SCRIPT, 0, (ID*)sc->script, 0, &(sc->menunr), 0, 0, 0, 0, 0); - - /* always as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} - - -/* ********************** SCRIPT ****************************** */ - diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c deleted file mode 100644 index e26ab4a157a..00000000000 --- a/source/blender/src/header_seq.c +++ /dev/null @@ -1,729 +0,0 @@ -/** - * header_seq.c oct-2003 - * - * Functions to draw the "Video Sequence Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" -#include "BIF_language.h" - -#include "DNA_ID.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_sequence_types.h" -#include "DNA_space_types.h" -#include "BLI_blenlib.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BIF_drawseq.h" -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_editseq.h" -#include "BSE_drawipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_sequence.h" -#include "BSE_time.h" -#include "blendef.h" -#include "mydevice.h" - -static int viewmovetemp = 0; - -static void do_seq_viewmenu(void *arg, int event) -{ - extern int play_anim(int mode); - Sequence * last_seq = get_last_seq(); - SpaceSeq * sseq = curarea->spacedata.first; - - switch(event) - { - case 1: /* Play Back Animation */ - play_anim(0); - break; - case 2: /* Play Back Animation in All */ - play_anim(1); - break; - case 3: - do_seq_buttons(B_SEQHOME); - break; - case 4: - if(last_seq) { - CFRA= last_seq->startdisp; - G.v2d->cur.xmin= last_seq->startdisp- (last_seq->len/20); - G.v2d->cur.xmax= last_seq->enddisp+ (last_seq->len/20); - update_for_newframe(); - } - break; - case 5: /* Lock time */ - G.v2d->flag ^= V2D_VIEWLOCK; - if (G.v2d->flag & V2D_VIEWLOCK) { - view2d_do_locks(curarea, 0); - } - break; - case 6: /* Draw time/frames */ - sseq->flag ^= SEQ_DRAWFRAMES; - break; - } -} - -static uiBlock *seq_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - SpaceSeq * sseq = curarea->spacedata.first; - - block= uiNewBlock(&curarea->uiblocks, "seq_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_seq_viewmenu, NULL); - - if (sseq->mainb == 0) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation " - "in all Sequence Areas|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation " - "in this window|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Play Back Animation in all " - "3D Views and Sequence Areas|Alt Shift A", - 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - - /* Lock Time */ - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - /* Draw time or frames.*/ - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(sseq->flag & SEQ_DRAWFRAMES) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0,0, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_seq_selectmenu(void *arg, int event) -{ - switch(event) - { - case 0: - borderselect_seq(); - break; - case 1: - swap_select_seq(); - break; - case 2: - select_dir_from_last(1); - break; - case 3: - select_dir_from_last(2); - break; - case 4: - select_surround_from_last(); - break; - case 5: - select_neighbor_from_last(1); - break; - case 6: - select_neighbor_from_last(2); - break; - case 7: - select_linked_seq(2); - break; - } -} - -static uiBlock *seq_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "seq_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_seq_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strips to the Left", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strips to the Right", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surrounding Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Left Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Right Handles", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_seq_addmenu_effectmenu(void *arg, int event) -{ - switch(event) - { - case 0: - add_sequence(SEQ_ADD); - break; - case 1: - add_sequence(SEQ_SUB); - break; - case 2: - add_sequence(SEQ_MUL); - break; - case 3: - add_sequence(SEQ_CROSS); - break; - case 4: - add_sequence(SEQ_GAMCROSS); - break; - case 5: - add_sequence(SEQ_ALPHAOVER); - break; - case 6: - add_sequence(SEQ_ALPHAUNDER); - break; - case 7: - add_sequence(SEQ_OVERDROP); - break; - case 8: - add_sequence(SEQ_PLUGIN); - break; - case 9: - add_sequence(SEQ_WIPE); - break; - case 10: - add_sequence(SEQ_GLOW); - break; - case 11: - add_sequence(SEQ_TRANSFORM); - break; - case 12: - add_sequence(SEQ_COLOR); - break; - case 13: - add_sequence(SEQ_SPEED); - break; - } -} - -static uiBlock *seq_addmenu_effectmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "seq_addmenu_effectmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_seq_addmenu_effectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subtract", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Multiply", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cross", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Gamma Cross", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Under", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Alpha Over Drop", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Wipe", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Glow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Color Generator", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Speed Control", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Plugin...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - - -static void do_seq_addmenu(void *arg, int event) -{ - switch(event) - { - case 0: - add_sequence(SEQ_IMAGE); - break; - case 1: - add_sequence(SEQ_MOVIE); - break; - case 2: - add_sequence(SEQ_RAM_SOUND); - break; - case 3: - add_sequence(SEQ_HD_SOUND); - break; - case 4: - add_sequence(SEQ_SCENE); - break; - case 5: - add_sequence(SEQ_MOVIE_AND_HD_SOUND); - break; - } -} - -static uiBlock *seq_addmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "seq_addmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_seq_addmenu, NULL); - - uiDefIconTextBlockBut(block, seq_addmenu_effectmenu, NULL, ICON_RIGHTARROW_THIN, "Effect", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - -#ifdef WITH_FFMPEG - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (RAM)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); -#else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Audio (Wav)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); -#endif - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scene", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Images", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); -#ifdef WITH_FFMPEG - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Movie + Audio (HD)", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); -#endif - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_seq_editmenu(void *arg, int event) -{ - SpaceSeq *sseq; - - sseq= curarea->spacedata.first; - - switch(event) - { - case 1: /* Change Strip... */ - change_sequence(); - break; - case 2: /* Make Meta Strip */ - make_meta(); - break; - case 3: /* Separate Meta Strip */ - un_meta(); - break; - case 4: /* Properties... */ - add_blockhandler(curarea, SEQ_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 5: /* Duplicate */ - add_duplicate_seq(); - break; - case 6: /* Delete */ - del_seq(); - break; - case 7: /* Grab/Extend */ - transform_seq('e', 0); - break; - case 8: - set_filter_seq(); - break; - case 9: - enter_meta(); - break; - case 10: - exit_meta(); - break; - case 11: /* grab/move */ - transform_seq('g', 0); - break; - case 12: /* Snap to Current Frame */ - seq_snap(event); - break; - case 13: /* Cut at Current Frame */ - seq_cut(CFRA); - break; - case 14: - reassign_inputs_seq_effect(); - break; - case 15: - seq_remap_paths(); - break; - case 16: - seq_separate_images(); - break; - case 17: - reload_sequence(); - break; - } -} - -static uiBlock *seq_editmenu(void *arg_unused) -{ - uiBlock *block; - Editing *ed; - short yco= 0, menuwidth=120; - Sequence * last_seq = get_last_seq(); - - ed = G.scene->ed; - - block= uiNewBlock(&curarea->uiblocks, "seq_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_seq_editmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Strip Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Extend from frame|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap to Current Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut at Current Frame|K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate Images to Strips|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - if (last_seq != NULL && last_seq->type != SEQ_MOVIE) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(last_seq->type >= SEQ_EFFECT) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Effect...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reassign Inputs|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - } - else if(last_seq->type == SEQ_IMAGE) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Image...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Change Scene...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - if(last_seq->type==SEQ_IMAGE) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remap Paths...|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - - } - - if (last_seq != NULL && last_seq->type == SEQ_MOVIE) { -/* uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Filter Y|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); */ - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remap Paths...|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - } - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Meta Strip...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate Meta Strip...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - if ((ed != NULL) && (ed->metastack.first > 0)){ - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Enter/Exit Meta Strip|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - } - else { - if (last_seq != NULL && last_seq->type == SEQ_META) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Enter/Exit Meta Strip|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - } - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload Strip Data...|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_seq_markermenu(void *arg, int event) -{ - SpaceSeq *sseq= curarea->spacedata.first; - - switch(event) - { - case 1: - add_marker(CFRA); - break; - case 2: - duplicate_marker(); - break; - case 3: - remove_marker(); - break; - case 4: - rename_marker(); - break; - case 5: - transform_markers('g', 0); - break; - case 6: - sseq->flag ^= SEQ_MARKER_TRANS; - break; - - } - - allqueue(REDRAWMARKER, 0); -} - -static uiBlock *seq_markermenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - SpaceSeq *sseq= curarea->spacedata.first; - - block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_seq_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|Ctrl Alt M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Ctrl G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, (sseq->flag & SEQ_MARKER_TRANS)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Transform Markers", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_seq_buttons(short event) -{ - Editing *ed; - SpaceSeq *sseq= curarea->spacedata.first; - - ed= G.scene->ed; - if(ed==0) return; - - switch(event) { - case B_SEQHOME: - if(sseq->mainb) - seq_reset_imageofs(sseq); - else { - G.v2d->cur= G.v2d->tot; - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - } - scrarea_queue_winredraw(curarea); - break; - case B_SEQCLEAR: - free_imbuf_seq(); - allqueue(REDRAWSEQ, 1); - break; - } -} - -void seq_buttons() -{ - SpaceSeq *sseq; - short xco; - char naam[20]; - uiBlock *block; - short xmax; - - sseq= curarea->spacedata.first; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_SEQ; - - xco = 8; - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - - /* pull down menus */ - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block,seq_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block,seq_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block,seq_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, ""); - xco+=xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, seq_addmenu, NULL, "Add", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Strip"); - uiDefPulldownBut(block, seq_editmenu, NULL, "Strip", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - /* end of pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSS); - } - - /* IMAGE */ - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SEQ_SEQUENCER, - "Image Preview: %t" - "|Sequence %x0" - "|Image Preview %x1" - "|Luma Waveform %x2" - "|Chroma Vectorscope %x3", - xco,0,XIC+10,YIC, &sseq->mainb, 0.0, 3.0, - 0, 0, - "Shows the sequence output image preview"); - - xco+= 8 + XIC+10; - - /* CHANNEL shown in 3D preview */ - if(sseq->mainb) { - int minchan = 0; - - if (G.scene->ed && ((Editing*)G.scene->ed)->metastack.first) - minchan = -BLI_countlist(&((Editing*)G.scene->ed)->metastack); - - uiDefButS(block, NUM, B_REDR, "Chan:", - xco, 0, 3.5 * XIC,YIC, - &sseq->chanshown, minchan, MAXSEQ, 0, 0, - "The channel number shown in the image preview. 0 is the result of all strips combined."); - - xco+= 8 + XIC*3.5; - } - - - /* ZOOM and BORDER */ - xco+= 8; - uiBlockBeginAlign(block); - uiDefIconButI(block, TOG, B_VIEW2DZOOM, ICON_VIEWZOOM, xco,0,XIC,YIC, &viewmovetemp, 0, 0, 0, 0, "Zooms view in and out (Ctrl MiddleMouse)"); - uiDefIconBut(block, BUT, B_IPOBORDER, ICON_BORDERMOVE, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Zooms view to fit area"); - uiBlockEndAlign(block); - - /* CLEAR MEM */ - xco+= 8; - - /* CLEAR MEM */ - xco+= 8; - uiDefBut(block, BUT, B_SEQCLEAR, "Refresh", xco+=XIC,0,3*XIC,YIC, 0, 0, 0, 0, 0, "Clears all buffered images in memory"); - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_sound.c b/source/blender/src/header_sound.c deleted file mode 100644 index c2fb72d7d17..00000000000 --- a/source/blender/src/header_sound.c +++ /dev/null @@ -1,444 +0,0 @@ -/** - * header_sound.c oct-2003 - * - * Functions to draw the "Audio Timeline" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" -#include "BIF_language.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_sound_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" - -#include "BIF_editsound.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_butspace.h" - -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BSE_drawipo.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_time.h" - -#include "blendef.h" -#include "mydevice.h" - -void do_sound_buttons(unsigned short event) -{ - ID *id, *idtest; - int nr; - char name[256]; - - switch(event) { - - case B_SOUNDBROWSE: - if(G.ssound->sndnr== -2) { - activate_databrowse((ID *)G.ssound->sound, ID_SO, 0, - B_SOUNDBROWSE, &G.ssound->sndnr, do_sound_buttons); - return; - } - if (G.ssound->sndnr < 0) break; - if (G.ssound->sndnr == 32766) { - if (G.ssound && G.ssound->sound) strcpy(name, G.ssound->sound->name); - else strcpy(name, U.sounddir); - activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, - load_space_sound); - } else { - nr= 1; - id= (ID *)G.ssound->sound; - - idtest= G.main->sound.first; - while(idtest) { - if(nr==G.ssound->sndnr) { - break; - } - nr++; - idtest= idtest->next; - } - - if(idtest==0) { /* no new */ - return; - } - - if(idtest!=id) { - G.ssound->sound= (bSound *)idtest; - if(idtest->us==0) idtest->us= 1; - allqueue(REDRAWSOUND, 0); - } - } - - break; - case B_SOUNDBROWSE2: - id = (ID *)G.buts->lockpoin; - if(G.buts->texnr == -2) { - activate_databrowse(id, ID_SO, 0, B_SOUNDBROWSE2, - &G.buts->texnr, do_sound_buttons); - return; - } - if (G.buts->texnr < 0) break; - if (G.buts->texnr == 32766) { - if (id) strcpy(name, ((bSound *)id)->name); - else strcpy(name, U.sounddir); - activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, load_sound_buttons); - } - else { - nr= 1; - - idtest= G.main->sound.first; - while (idtest) { - if(nr == G.buts->texnr) { - break; - } - nr++; - idtest = idtest->next; - } - - if (idtest == 0) { /* geen new */ - return; - } - - if (idtest != id) { - G.buts->lockpoin = (bSound *)idtest; - if(idtest->us==0) idtest->us= 1; - allqueue(REDRAWBUTSSCENE, 0); - } - } - break; - - case B_SOUNDHOME: - if(G.ssound->sound==NULL) { - G.v2d->tot.xmin= G.scene->r.sfra; - G.v2d->tot.xmax= G.scene->r.efra; - } - G.v2d->cur= G.v2d->tot; - test_view2d(G.v2d, curarea->winx, curarea->winy); - view2d_do_locks(curarea, V2D_LOCK_COPY); - scrarea_queue_winredraw(curarea); - break; - } -} - -static void do_sound_viewmenu(void *arg, int event) -{ - extern int play_anim(int mode); - - switch(event) { - case 1: /* Play Back Animation */ - play_anim(0); - break; - case 2: /* Play Back Animation in All */ - play_anim(1); - break; - case 3: /* View All */ - do_sound_buttons(B_SOUNDHOME); - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 5: /* jump to next marker */ - nextprev_marker(1); - break; - case 6: /* jump to previous marker */ - nextprev_marker(-1); - break; - case 7: - G.v2d->flag ^= V2D_VIEWLOCK; - if(G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *sound_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "sound_viewmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_sound_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_sound_markermenu(void *arg, int event) -{ - switch(event) - { - case 1: - add_marker(CFRA); - break; - case 2: - duplicate_marker(); - break; - case 3: - remove_marker(); - break; - case 4: - rename_marker(); - break; - case 5: - transform_markers('g', 0); - break; - } - - allqueue(REDRAWMARKER, 0); -} - -static uiBlock *sound_markermenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "sound_markermenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_sound_markermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - - -void sound_buttons(void) -{ - uiBlock *block; - short xco, xmax; - char naam[256]; - char ch[20]; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_SOUND; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco, 0, XIC+10, YIC, - &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type. " - "Click for menu of available types."); - - xco += XIC + 14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if (curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Show pulldown menus"); - } - else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, - "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, sound_viewmenu, NULL, - "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Marker"); - uiDefPulldownBut(block, sound_markermenu, NULL, - "Marker", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - xco= std_libbuttons(block, xco+8, 0, 0, NULL, B_SOUNDBROWSE, ID_SO, 0, (ID *)G.ssound->sound, 0, &(G.ssound->sndnr), 1, 0, 0, 0, 0); - - if(G.ssound->sound) { - bSound *sound= G.ssound->sound; - - if (sound->sample && sound->sample->len) - { - if (sound->sample->channels == 1) - strcpy(ch, "Mono"); - else if (sound->sample->channels == 2) - strcpy(ch, "Stereo"); - else - strcpy(ch, "Unknown"); - - sprintf(naam, "Sample: %s, %d bit, %d Hz, %d samples", ch, sound->sample->bits, sound->sample->rate, sound->sample->len); - cpack(0x0); - glRasterPos2i(xco+10, 5); - BMF_DrawString(uiBlockGetCurFont(block), naam); - } - else - { - sprintf(naam, "No sample info available."); - cpack(0x0); - glRasterPos2i(xco+10, 5); - BMF_DrawString(uiBlockGetCurFont(block), naam); - } - - } - - /* always as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} - -/* the next two functions are also called from fileselect: */ - -void load_space_sound(char *str) -{ - bSound *sound; - - sound= sound_new_sound(str); - if (sound) { - if (G.ssound) { - G.ssound->sound= sound; - } - } else { - error("Not a valid sample: %s", str); - } - - allqueue(REDRAWSOUND, 0); - allqueue(REDRAWBUTSLOGIC, 0); -} - -void load_sound_buttons(char *str) -{ - bSound *sound; - - sound= sound_new_sound(str); - if (sound) { - if (curarea && curarea->spacetype==SPACE_BUTS) { - if (G.buts->mainb == CONTEXT_SCENE) { - if( G.buts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND ) - G.buts->lockpoin = sound; - } - } - } - else { - error("Not a valid sample: %s", str); - } - - allqueue(REDRAWBUTSSCENE, 0); -} diff --git a/source/blender/src/header_text.c b/source/blender/src/header_text.c deleted file mode 100644 index 728edc76a9c..00000000000 --- a/source/blender/src/header_text.c +++ /dev/null @@ -1,847 +0,0 @@ -/** - * header_text.c oct-2003 - * - * Functions to draw the "Text Editor" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" -#include "BIF_language.h" - -#include "BSE_headerbuttons.h" - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_text_types.h" -#include "DNA_constraint_types.h" -#include "DNA_action_types.h" - -#include "BIF_drawtext.h" -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_sca.h" -#include "BKE_text.h" -#include "BKE_depsgraph.h" - -#include "BSE_filesel.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "blendef.h" -#include "mydevice.h" - -void do_text_buttons(unsigned short event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - ID *id, *idtest; - int nr= 1; - Text *text; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - switch (event) { - case B_TEXTBROWSE: - if (st->menunr==-2) { - activate_databrowse((ID *)st->text, ID_TXT, 0, B_TEXTBROWSE, - &st->menunr, do_text_buttons); - break; - } - if(st->menunr < 0) break; - - text= st->text; - - nr= 1; - id= (ID *)text; - - if (st->menunr==32767) { - st->text= (Text *)add_empty_text( "Text" ); - - st->top= 0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - } - else if (st->menunr==32766) { - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - return; - } - else { - idtest= G.main->text.first; - while(idtest) { - if(nr==st->menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new text */ - activate_fileselect(FILE_SPECIAL, "Open Text File", - G.sce, add_text_fs); - return; - } - if(idtest!=id) { - st->text= (Text *)idtest; - st->top= 0; - - pop_space_text(st); - if (st->showsyntax) get_format_string(st); - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - } - } - break; - - case B_TEXTDELETE: - { - Object *obt; - bConstraint *con; - int update; - - text= st->text; - if (!text) return; - - /* make the previous text active, if its not there make the next text active */ - if (st->text->id.prev) { - st->text = st->text->id.prev; - pop_space_text(st); - } else if (st->text->id.next) { - st->text = st->text->id.next; - pop_space_text(st); - } - - /*check all pyconstraints*/ - for (obt=G.main->object.first; obt; obt=obt->id.next) { - update = 0; - if(obt->type==OB_ARMATURE && obt->pose) { - bPoseChannel *pchan; - for(pchan= obt->pose->chanbase.first; pchan; pchan= pchan->next) { - for (con = pchan->constraints.first; con; con=con->next) { - if (con->type==CONSTRAINT_TYPE_PYTHON) { - bPythonConstraint *data = con->data; - if (data->text==text) data->text = NULL; - update = 1; - - } - } - } - } - for (con = obt->constraints.first; con; con=con->next) { - if (con->type==CONSTRAINT_TYPE_PYTHON) { - bPythonConstraint *data = con->data; - if (data->text==text) data->text = NULL; - update = 1; - } - } - - if (update) { - DAG_object_flush_update(G.scene, obt, OB_RECALC_DATA); - } - } - - BPY_clear_bad_scriptlinks(text); - free_text_controllers(text); - - unlink_text(text); - free_libblock(&G.main->text, text); - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - - /*for if any object constraints were changed.*/ - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Delete Text"); - } - break; - -/* - case B_TEXTSTORE: - st->text->flags ^= TXT_ISEXT; - - allqueue(REDRAWHEADERS, 0); - break; -*/ - case B_TEXTLINENUM: - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - - case B_TEXTFONT: - switch(st->font_id) { - case 0: - st->lheight= 12; break; - case 1: - st->lheight= 15; - break; - } - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - - break; - case B_TAB_NUMBERS: - if (st->showsyntax) get_format_string(st); - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - case B_SYNTAX: - if (st->showsyntax) { - get_format_string(st); - } - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - } -} - -static void do_text_template_scriptsmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_SCRIPTTEMPLATE, event); - - allqueue(REDRAWIMAGE, 0); -} - -static uiBlock *text_template_scriptsmenu (void *args_unused) -{ - uiBlock *block; - BPyMenu *pym; - int i= 0; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "text_template_scriptsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_text_template_scriptsmenu, NULL); - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_SCRIPTTEMPLATE]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i, - pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -/* action executed after clicking in File menu */ -static void do_text_filemenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - ScrArea *sa; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text= st->text; - - switch(event) { - case 1: - st->text= add_empty_text( "Text" ); - st->top=0; - - allqueue(REDRAWTEXT, 0); - allqueue(REDRAWHEADERS, 0); - break; - case 2: - activate_fileselect(FILE_SPECIAL, "Open Text File", G.sce, add_text_fs); - break; - case 3: - if (text->compiled) BPY_free_compiled_text(text); - text->compiled = NULL; - if (okee("Reopen Text")) { - if (!reopen_text(text)) { - error("Could not reopen file"); - } - if (st->showsyntax) get_format_string(st); - } - break; - case 5: - text->flags |= TXT_ISMEM; - case 4: - txt_write_file(text); - break; - case 6: - run_python_script(st); - break; - case 7: - { - Object *ob; - bConstraint *con; - short update; - - /* check all pyconstraints */ - for (ob= G.main->object.first; ob; ob= ob->id.next) { - update = 0; - if (ob->type==OB_ARMATURE && ob->pose) { - bPoseChannel *pchan; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - for (con = pchan->constraints.first; con; con= con->next) { - if (con->type==CONSTRAINT_TYPE_PYTHON) { - bPythonConstraint *data = con->data; - if (data->text==text) BPY_pyconstraint_update(ob, con); - update = 1; - - } - } - } - } - for (con = ob->constraints.first; con; con= con->next) { - if (con->type==CONSTRAINT_TYPE_PYTHON) { - bPythonConstraint *data = con->data; - if (data->text==text) BPY_pyconstraint_update(ob, con); - update = 1; - } - } - - if (update) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - break; - default: - break; - } - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } -} - -/* action executed after clicking in Edit menu */ -static void do_text_editmenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - ScrArea *sa; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text= st->text; - - switch(event) { - case 1: - txt_do_undo(text); - break; - case 2: - txt_do_redo(text); - break; - case 3: - txt_cut_sel(text); - pop_space_text(st); - break; - case 4: - txt_copy_sel(text); - break; - case 5: - txt_paste(text); - if (st->showsyntax) get_format_string(st); - break; - case 6: - txt_print_cutbuffer(); - break; - case 7: - jumptoline_interactive(st); - break; - case 8: - txt_find_panel(st,1); - break; - case 9: - txt_find_panel(st,0); - break; - default: - break; - } - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } -} - -/* action executed after clicking in View menu */ -static void do_text_editmenu_viewmenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - ScrArea *sa; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text = st->text; - - switch(event) { - case 1: - txt_move_bof(text, 0); - pop_space_text(st); - break; - case 2: - txt_move_eof(text, 0); - pop_space_text(st); - break; - default: - break; - } - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } -} - -/* action executed after clicking in Select menu */ -static void do_text_editmenu_selectmenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - ScrArea *sa; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text = st->text; - - switch(event) { - case 1: - txt_sel_all(text); - break; - case 2: - txt_sel_line(text); - break; - default: - break; - } - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } -} - -/* action executed after clicking in Format menu */ -static void do_text_formatmenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - ScrArea *sa; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text = st->text; - - switch(event) { - case 3: - if (txt_has_sel(text)) { - txt_order_cursors(text); - indent(text); - break; - } - else { - txt_add_char(text, '\t'); - break; - } - case 4: - if ( txt_has_sel(text)) { - txt_order_cursors(text); - unindent(text); - break; - } - break; - case 5: - if ( txt_has_sel(text)) { - txt_order_cursors(text); - comment(text); - if (st->showsyntax) get_format_string(st); - break; - } - break; - case 6: - if ( txt_has_sel(text)) { - txt_order_cursors(text); - uncomment(text); - if (st->showsyntax) get_format_string(st); - break; - } - break; - default: - break; - } - - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceText *st= sa->spacedata.first; - if (st && st->spacetype==SPACE_TEXT) { - scrarea_queue_redraw(sa); - } - } -} - -/* View menu */ -static uiBlock *text_editmenu_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "text_editmenu_viewmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_text_editmenu_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Top of File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bottom of File", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -/* Select menu */ -static uiBlock *text_editmenu_selectmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "text_editmenu_selectmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_text_editmenu_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select All|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Line", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -void do_text_formatmenu_convert(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - switch(event) { - case 1: convert_tabs(st, 0); break; - case 2: convert_tabs(st, 1); break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *text_formatmenu_convert(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "do_text_formatmenu_convert", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_text_formatmenu_convert, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Spaces", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "Converts script whitespace to spaces based on Tab:"); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Tabs", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "Converts script whitespace to tabs based on Tab:"); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -/* Format menu */ -static uiBlock *text_formatmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "text_formatmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_text_formatmenu, NULL); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Indent|Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unindent|Shift Tab", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Comment", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Uncomment|Ctrl Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, text_formatmenu_convert, NULL, ICON_RIGHTARROW_THIN, "Convert whitespace", 0, yco-=20, menuwidth, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - - -/* action executed after clicking in Object to 3d Sub Menu */ -void do_text_editmenu_to3dmenu(void *arg, int event) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text; - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text = st->text; - - switch(event) { - case 1: txt_export_to_object(text); break; - case 2: txt_export_to_objects(text); break; - } - allqueue(REDRAWVIEW3D, 0); -} - -/* Object to 3d Sub Menu */ -static uiBlock *text_editmenu_to3dmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "do_text_editmenu_to3dmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_text_editmenu_to3dmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "One Object | Alt-M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "One Object Per Line", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - - -/* Edit menu */ -static uiBlock *text_editmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "text_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_text_editmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo|Ctrl Shift Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cut|Alt X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Print Cut Buffer", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, text_editmenu_viewmenu, NULL, ICON_RIGHTARROW_THIN, "View|Alt Shift V ", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, text_editmenu_selectmenu, NULL, ICON_RIGHTARROW_THIN, "Select|Alt Shift S ", 0, yco-=20, 120, 19, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump...|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find...|Alt Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Find Again|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, text_editmenu_to3dmenu, NULL, ICON_RIGHTARROW_THIN, "Text to 3d Object", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -/* File menu */ -static uiBlock *text_filemenu(void *arg_unused) -{ - SpaceText *st= curarea->spacedata.first; /* bad but cant pass as an arg here */ - Text *text= st->text; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "text_filemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_text_filemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "New|Alt N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Open...|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - - if(text) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reopen|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Save As...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Run Python Script|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - if (BPY_is_pyconstraint(text)) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Refresh All PyConstraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - - uiDefIconTextBlockBut(block, text_template_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Script Templates", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -/* header */ -void text_buttons(void) -{ - uiBlock *block; - SpaceText *st= curarea->spacedata.first; - Text *text; - short xco, xmax; - char naam[256]; - - if (st==NULL || st->spacetype != SPACE_TEXT) return; - - text = st->text; - - sprintf(naam, "header %d", curarea->headwin); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_TEXT; - - xco = 8; - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - /* pull down menus */ - if((curarea->flag & HEADER_NO_PULLDOWN)==0) { - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("File"); - uiDefPulldownBut(block,text_filemenu, NULL, "File", xco, 0, xmax, 20, ""); - xco+=xmax; - - if(text) { - xmax= GetButStringLength("Edit"); - uiDefPulldownBut(block,text_editmenu, NULL, "Edit", xco, 0, xmax, 20, ""); - xco+=xmax; - - xmax= GetButStringLength("Format"); - uiDefPulldownBut(block,text_formatmenu, NULL, "Format", xco, 0, xmax, 20, ""); - xco+=xmax; - } - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco += 10; - - /* FULL WINDOW */ - uiBlockBeginAlign(block); - if(curarea->full) uiDefIconBut(block, BUT,B_FULL, ICON_SPLITSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Returns to multiple views window (CTRL+Up arrow)"); - else uiDefIconBut(block, BUT,B_FULL, ICON_FULLSCREEN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Makes current window full screen (CTRL+Down arrow)"); - - uiDefIconButI(block, ICONTOG, B_TEXTLINENUM, ICON_LONGDISPLAY, xco+=XIC,0,XIC,YIC, &st->showlinenrs, 0, 0, 0, 0, "Displays line numbers"); - - uiDefIconButI(block, ICONTOG, B_SYNTAX, ICON_SYNTAX, xco+=XIC,0,XIC,YIC, &st->showsyntax, 0, 0, 0, 0, "Enables Syntax Highlighting"); - uiBlockEndAlign(block); - - /* STD TEXT BUTTONS */ - xco+= 2*XIC; - xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXTBROWSE, ID_TXT, 0, (ID*)st->text, 0, &(st->menunr), 0, 0, B_TEXTDELETE, 0, 0); - - /* - if (st->text) { - if (st->text->flags & TXT_ISDIRTY && (st->text->flags & TXT_ISEXT || !(st->text->flags & TXT_ISMEM))) - uiDefIconBut(block, BUT,0, ICON_ERROR, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "The text has been changed"); - if (st->text->flags & TXT_ISEXT) - uiDefBut(block, BUT,B_TEXTSTORE, ICON(), xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Stores text in project file"); - else - uiDefBut(block, BUT,B_TEXTSTORE, ICON(), xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Disables storing of text in project file"); - xco+=10; - } - */ - - xco+=XIC; - if(st->font_id>1) st->font_id= 0; - uiDefButI(block, MENU, B_TEXTFONT, "Screen 12 %x0|Screen 15%x1", xco,0,100,YIC, &st->font_id, 0, 0, 0, 0, "Displays available fonts"); - xco+=110; - - uiDefButI(block, NUM, B_TAB_NUMBERS, "Tab:", xco, 0, XIC+50, YIC, &st->tabnumber, 2, 8, 0, 0, "Set spacing of Tab"); - xco+= XIC+50; - - /* always as last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c deleted file mode 100644 index 53b22fc4e39..00000000000 --- a/source/blender/src/header_time.c +++ /dev/null @@ -1,539 +0,0 @@ -/** - * - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_ID.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_view2d_types.h" -#include "DNA_userdef_types.h" - -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_butspace.h" - -#include "BKE_global.h" -#include "BKE_main.h" - -#include "BSE_drawipo.h" -#include "BSE_drawview.h" -#include "BSE_editipo.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_seqaudio.h" -#include "BSE_time.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -void do_time_buttons(ScrArea *sa, unsigned short event) -{ - SpaceTime *stime= sa->spacedata.first; - - switch(event) { - - case B_TL_REW: - CFRA= PSFRA; - update_for_newframe(); - break; - case B_TL_PLAY: - add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws); - if(stime->redraws & TIME_WITH_SEQ_AUDIO) - audiostream_start( CFRA ); - - break; - case B_TL_STOP: - rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM); - if(stime->redraws & TIME_WITH_SEQ_AUDIO) - audiostream_stop(); - allqueue(REDRAWALL, 0); - - break; - case B_TL_FF: - /* end frame */ - CFRA= PEFRA; - update_for_newframe(); - break; - case B_TL_PREVKEY: - /* previous keyframe */ - nextprev_timeline_key(-1); - break; - case B_TL_NEXTKEY: - /* next keyframe */ - nextprev_timeline_key(1); - break; - - case B_TL_PREVIEWON: - if (G.scene->r.psfra) { - /* turn on preview range */ - G.scene->r.psfra= G.scene->r.sfra; - G.scene->r.pefra= G.scene->r.efra; - } - else { - /* turn off preview range */ - G.scene->r.psfra= 0; - G.scene->r.pefra= 0; - } - BIF_undo_push("Set anim-preview range"); - allqueue(REDRAWALL, 0); - break; - } -} - -static void do_time_redrawmenu(void *arg, int event) -{ - SpaceTime *stime= curarea->spacedata.first; - - if(event < 1001) { - - stime->redraws ^= event; - /* update handler when it's running */ - if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM)) - add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws); - } - else { - if(event==1001) { - button(&G.scene->r.frs_sec,1,120,"FPS:"); - } - } -} - - -static uiBlock *time_redrawmenu(void *arg_unused) -{ - SpaceTime *stime= curarea->spacedata.first; - uiBlock *block; - short yco= 0, menuwidth=120, icon; - char str[32]; - - block= uiNewBlock(&curarea->uiblocks, "time_redrawmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_time_redrawmenu, NULL); - - if(stime->redraws & TIME_LEFTMOST_3D_WIN) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "Top-Left 3D Window", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_LEFTMOST_3D_WIN, ""); - - if(stime->redraws & TIME_ALL_3D_WIN) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "All 3D Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_3D_WIN, ""); - - if(stime->redraws & TIME_ALL_ANIM_WIN) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "Animation Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_ANIM_WIN, ""); - - if(stime->redraws & TIME_ALL_BUTS_WIN) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "Buttons Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_BUTS_WIN, ""); - - if(stime->redraws & TIME_ALL_IMAGE_WIN) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "Image Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_ALL_IMAGE_WIN, ""); - - /* Add sequencer only redraw*/ - if(stime->redraws & TIME_SEQ) icon= ICON_CHECKBOX_HLT; - else icon= ICON_CHECKBOX_DEHLT; - uiDefIconTextBut(block, BUTM, 1, icon, "Sequencer Windows", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, TIME_SEQ, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - sprintf(str, "Set Frames/Sec (%d/%f)", G.scene->r.frs_sec, G.scene->r.frs_sec_base); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1001, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_time_viewmenu(void *arg, int event) -{ - SpaceTime *stime= curarea->spacedata.first; - int first; - - switch(event) { - case 2: /* Play Back Animation */ - add_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM, stime->redraws); - break; - case 3: /* View All */ - first= G.scene->r.sfra; - if(first >= G.scene->r.efra) first= G.scene->r.efra; - G.v2d->cur.xmin=G.v2d->tot.xmin= (float)first-2; - G.v2d->cur.xmax=G.v2d->tot.xmax= (float)G.scene->r.efra+2; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 5: /* show time or frames */ - stime->flag ^= TIME_DRAWFRAMES; - break; - case 6: - nextprev_marker(1); - break; - case 7: - nextprev_marker(-1); - break; - case 8: - nextprev_timeline_key(1); - break; - case 9: - nextprev_timeline_key(-1); - break; - case 10: - timeline_frame_to_center(); - break; - case 11: - G.v2d->flag ^= V2D_VIEWLOCK; - if(G.v2d->flag & V2D_VIEWLOCK) - view2d_do_locks(curarea, 0); - break; - case 12: /* only show keyframes from selected data */ - stime->flag ^= TIME_ONLYACTSEL; - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *time_viewmenu(void *arg_unused) -{ - SpaceTime *stime= curarea->spacedata.first; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "time_viewmenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_time_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(stime->flag & TIME_DRAWFRAMES) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefIconTextBut(block, BUTM, 1, (stime->flag & TIME_ONLYACTSEL)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - - if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_time_framemenu(void *arg, int event) -{ - switch(event) { - case 1: /*Set as Start */ - if (G.scene->r.psfra) { - if (G.scene->r.pefra < CFRA) - G.scene->r.pefra= CFRA; - G.scene->r.psfra= CFRA; - } - else - G.scene->r.sfra = CFRA; - allqueue(REDRAWALL, 1); - break; - case 2: /* Set as End */ - if (G.scene->r.psfra) { - if (CFRA < G.scene->r.psfra) - G.scene->r.psfra= CFRA; - G.scene->r.pefra= CFRA; - } - else - G.scene->r.efra = CFRA; - allqueue(REDRAWALL, 1); - break; - case 3: /* Add Marker */ - add_marker(CFRA); - break; - case 4: /* Remove Marker */ - remove_marker(); - break; - case 5: /* Rename Marker */ - rename_marker(); - break; - case 6: /* Grab Marker */ - transform_markers('g', 0); - break; - case 7: /* duplicate marker */ - duplicate_marker(); - break; - } - allqueue(REDRAWTIME, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWSOUND, 0); -} - -static uiBlock *time_framemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "time_framemenu", - UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_time_framemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Shift D", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as Start|S", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as End|E", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void time_buttons(ScrArea *sa) -{ - SpaceTime *stime= sa->spacedata.first; - uiBlock *block; - short xco, xmax; - char name[256]; - - sprintf(name, "header %d", sa->headwin); - block= uiNewBlock(&sa->uiblocks, name, UI_EMBOSS, UI_HELV, sa->headwin); - - if(area_is_active_area(sa)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - sa->butspacetype= SPACE_TIME; - - xco = 8; - - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, - windowtype_pup(), xco, 0, XIC+10, YIC, - &(sa->butspacetype), 1.0, SPACEICONMAX, 0, 0, - "Displays Current Window Type. " - "Click for menu of available types."); - - xco += XIC + 14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if (sa->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, - "Show pulldown menus"); - } - else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, - ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(sa->flag), 0, 0, 0, 0, - "Hide pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, time_viewmenu, NULL, - "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - xmax= GetButStringLength("Frame"); - uiDefPulldownBut(block, time_framemenu, NULL, - "Frame", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Playback"); - uiDefPulldownBut(block, time_redrawmenu, NULL, - "Playback", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockBeginAlign(block); - - uiDefButI(block, TOG, B_TL_PREVIEWON,"Preview", - xco,0, XIC, YIC, - &G.scene->r.psfra,0, 1, 0, 0, - "Show settings for frame range of animation preview"); - - xco += XIC; - - if (G.scene->r.psfra) { - uiDefButI(block, NUM, REDRAWALL,"Start:", - xco,0, 4.5*XIC, YIC, - &G.scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0, - "The start frame of the animation preview"); - - xco += 4.5*XIC; - - uiDefButI(block, NUM, REDRAWALL,"End:", - xco,0,4.5*XIC,YIC, - &G.scene->r.pefra,PSFRA,MAXFRAMEF, 0, 0, - "The end frame of the animation preview"); - } - else { - uiDefButI(block, NUM, REDRAWALL,"Start:", - xco,0, 4.5*XIC, YIC, - &G.scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0, - "The start frame of the animation"); - - xco += 4.5*XIC; - - uiDefButI(block, NUM, REDRAWALL,"End:", - xco,0,4.5*XIC,YIC, - &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0, - "The end frame of the animation"); - } - uiBlockEndAlign(block); - - xco += 4.5*XIC+16; - - uiDefButI(block, NUM, B_NEWFRAME, "", - xco,0,3.5*XIC,YIC, - &(G.scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0, - "Displays Current Frame of animation. Click to change."); - - xco += 3.5*XIC+16; - - uiDefIconBut(block, BUT, B_TL_REW, ICON_REW, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)"); - xco+= XIC+4; - uiDefIconBut(block, BUT, B_TL_PREVKEY, ICON_PREV_KEYFRAME, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to previous keyframe (Ctrl PageDown)"); - xco+= XIC+4; - - if(has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM)) - uiDefIconBut(block, BUT, B_TL_STOP, ICON_PAUSE, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Stop Playing Timeline"); - else - uiDefIconBut(block, BUT, B_TL_PLAY, ICON_PLAY, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Play Timeline "); - - xco+= XIC+4; - uiDefIconBut(block, BUT, B_TL_NEXTKEY, ICON_NEXT_KEYFRAME, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to next keyframe (Ctrl PageUp)"); - xco+= XIC+4; - uiDefIconBut(block, BUT, B_TL_FF, ICON_FF, - xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)"); - xco+= XIC+8; - - uiDefIconButBitI(block, TOG, G_RECORDKEYS, REDRAWINFO, ICON_REC, - xco, 0, XIC, YIC, &(G.flags), 0, 0, 0, 0, "Automatically insert keyframes in Object and Action Ipo curves"); - - xco+= XIC+16; - - uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER, - xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor"); - - /* always as last */ - sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon - - uiDrawBlock(block); -} diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c deleted file mode 100644 index 95f24c34098..00000000000 --- a/source/blender/src/header_view3d.c +++ /dev/null @@ -1,5489 +0,0 @@ -/* - * header_view3d.c oct-2003 - * - * Functions to draw the "3D Viewport" window header - * and handle user events sent to it. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BMF_Api.h" -#include "BIF_language.h" - -#include "MEM_guardedalloc.h" - -#include "DNA_armature_types.h" -#include "DNA_ID.h" -#include "DNA_image_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_text_types.h" /* for space handlers */ -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" /* U.smooth_viewtx */ - -#include "BKE_action.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_effect.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_particle.h" -#include "BKE_utildefines.h" /* for VECCOPY */ - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_view.h" -#include "BSE_drawview.h" - -#include "BDR_editcurve.h" -#include "BDR_editface.h" -#include "BDR_editmball.h" -#include "BDR_editobject.h" -#include "BDR_sculptmode.h" -#include "BDR_imagepaint.h" -#include "BDR_vpaint.h" - -#include "BIF_editlattice.h" -#include "BIF_editarmature.h" -#include "BIF_editparticle.h" -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_editfont.h" -#include "BIF_editgroup.h" -#include "BIF_editmesh.h" -#include "BIF_editmode_undo.h" -#include "BIF_editview.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_mainqueue.h" -#include "BIF_meshtools.h" -#include "BIF_poseobject.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_transform.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "blendef.h" -#include "multires.h" -#include "mydevice.h" -#include "butspace.h" - -#include "BIF_poseobject.h" - -/* View3d->modeselect - * This is a bit of a dodgy hack to enable a 'mode' menu with icons+labels - * rather than those buttons. - * I know the implementation's not good - it's an experiment to see if this - * approach would work well - * - * This can be cleaned when I make some new 'mode' icons. - */ - -#define V3D_OBJECTMODE_SEL ICON_OBJECT -#define V3D_EDITMODE_SEL ICON_EDITMODE_HLT -#define V3D_SCULPTMODE_SEL ICON_SCULPTMODE_HLT -#define V3D_FACESELECT_SEL ICON_FACESEL_HLT /* this is not a mode anymore - just a switch */ -#define V3D_VERTEXPAINTMODE_SEL ICON_VPAINT_HLT -#define V3D_TEXTUREPAINTMODE_SEL ICON_TPAINT_HLT -#define V3D_WEIGHTPAINTMODE_SEL ICON_WPAINT_HLT -#define V3D_POSEMODE_SEL ICON_POSE_HLT -#define V3D_PARTICLEEDITMODE_SEL ICON_ANIM - -#define TEST_EDITMESH if(G.obedit==0) return; \ - if( (G.vd->lay & G.obedit->lay)==0 ) return; - -void do_layer_buttons(short event) -{ - static int oldlay= 1; - - if(G.vd==0) return; - if(G.vd->localview) return; - - if(event==-1 && (G.qual & LR_CTRLKEY)) { - G.vd->scenelock= !G.vd->scenelock; - do_view3d_buttons(B_SCENELOCK); - } else if (event==-1) { - if(G.vd->lay== (1<<20)-1) { - if(G.qual & LR_SHIFTKEY) G.vd->lay= oldlay; - } - else { - oldlay= G.vd->lay; - G.vd->lay= (1<<20)-1; - } - - if(G.vd->scenelock) handle_view3d_lock(); - scrarea_queue_winredraw(curarea); - - /* new layers might need unflushed events events */ - DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */ - } - else { - if(G.qual & LR_ALTKEY) { - if(event<11) event+= 10; - } - if(G.qual & LR_SHIFTKEY) { - if(G.vd->lay & (1<lay -= (1<lay += (1<spacetype==SPACE_OOPS) allqueue(REDRAWVIEW3D, 1); /* 1==also do headwin */ - if(G.vd->drawtype == OB_SHADED) reshadeall_displist(); - allqueue(REDRAWNLA, 0); -} - -static void do_view3d_view_camerasmenu(void *arg, int event) -{ - Base *base; - int i=1; - - if (event == 1) { - /* Set Active Object as Active Camera */ - /* ugly hack alert */ - G.qual |= LR_CTRLKEY; - persptoetsen(PAD0); - G.qual &= ~LR_CTRLKEY; - } else { - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - if (event==i) { - - if (G.vd->camera == base->object && G.vd->persp==2) - return; - - if (U.smooth_viewtx) { - /* move 3d view to camera view */ - float orig_ofs[3], orig_lens = G.vd->lens; - VECCOPY(orig_ofs, G.vd->ofs); - - if (G.vd->camera && G.vd->persp==2) - view_settings_from_ob(G.vd->camera, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens); - - G.vd->camera = base->object; - handle_view3d_lock(); - G.vd->persp= 2; - G.vd->view= 0; - - smooth_view_to_camera(G.vd); - - /* restore values */ - VECCOPY(G.vd->ofs, orig_ofs); - G.vd->lens = orig_lens; - } else { - G.vd->camera= base->object; - handle_view3d_lock(); - G.vd->persp= 2; - G.vd->view= 0; - } - break; - } - } - } - } - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_view_camerasmenu(void *arg_unused) -{ - Base *base; - uiBlock *block; - short yco= 0, menuwidth=120; - int i=1; - char camname[48]; - - block= uiNewBlock(&curarea->uiblocks, "view3d_view_camerasmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - strcpy(camname, base->object->id.name+2); - if (base->object == G.scene->camera) strcat(camname, " (Active)"); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, ""); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_view_cameracontrolsmenu(void *arg, int event) -{ - switch(event) { - case 0: /* Orbit Left */ - persptoetsen(PAD4); - break; - case 1: /* Orbit Right */ - persptoetsen(PAD6); - break; - case 2: /* Orbit Up */ - persptoetsen(PAD8); - break; - case 3: /* Orbit Down */ - persptoetsen(PAD2); - break; - case 4: /* Pan left */ - /* ugly hack alert */ - G.qual |= LR_CTRLKEY; - persptoetsen(PAD4); - G.qual &= ~LR_CTRLKEY; - break; - case 5: /* Pan right */ - /* ugly hack alert */ - G.qual |= LR_CTRLKEY; - persptoetsen(PAD6); - G.qual &= ~LR_CTRLKEY; - break; - case 6: /* Pan up */ - /* ugly hack alert */ - G.qual |= LR_CTRLKEY; - persptoetsen(PAD8); - G.qual &= ~LR_CTRLKEY; - break; - case 7: /* Pan down */ - /* ugly hack alert */ - G.qual |= LR_CTRLKEY; - persptoetsen(PAD2); - G.qual &= ~LR_CTRLKEY; - break; - case 8: /* Zoom In */ - persptoetsen(PADPLUSKEY); - break; - case 9: /* Zoom Out */ - persptoetsen(PADMINUS); - break; - case 10: /* Reset Zoom */ - persptoetsen(PADENTER); - break; - case 11: /* Camera Fly mode */ - fly(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_view_cameracontrolsmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_view_cameracontrolsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_view_alignviewmenu(void *arg, int event) -{ - View3D *v3d= curarea->spacedata.first; - float *curs; - - switch(event) { - - case 0: /* Align View to Selected (edit/faceselect mode) */ - case 1: - case 2: - if ((G.obedit) && (G.obedit->type == OB_MESH)) { - editmesh_align_view_to_selected(v3d, event); - } else if (FACESEL_PAINT_TEST) { - Object *obact= OBACT; - if (obact && obact->type==OB_MESH) { - Mesh *me= obact->data; - - if (me->mtface) { - faceselect_align_view_to_selected(v3d, me, event); - addqueue(v3d->area->win, REDRAW, 1); - } - } - } - break; - case 3: /* Center View to Cursor */ - curs= give_cursor(); - G.vd->ofs[0]= -curs[0]; - G.vd->ofs[1]= -curs[1]; - G.vd->ofs[2]= -curs[2]; - scrarea_queue_winredraw(curarea); - break; - case 4: /* Align Active Camera to View */ - /* This ugly hack is a symptom of the nasty persptoetsen function, - * but at least it works for now. - */ - G.qual |= LR_CTRLKEY|LR_ALTKEY; - persptoetsen(PAD0); - G.qual &= ~(LR_CTRLKEY|LR_ALTKEY); - break; - case 5: /* Align View to Selected (object mode) */ - mainqenter(PADASTERKEY, 1); - break; - case 6: /* Center View and Cursor to Origin */ - view3d_home(1); - curs= give_cursor(); - curs[0]=curs[1]=curs[2]= 0.0; - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_view_alignviewmenu(void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_view_alignviewmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if (((G.obedit) && (G.obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_view_spacehandlers(void *arg, int event) -{ - Text *text = G.main->text.first; - unsigned short menu_evt_num = 0; - - if (event > 0) { - while (text) { - if (++menu_evt_num == event) { - - if (BPY_has_spacehandler(text, curarea)) - BPY_del_spacehandler(text, curarea); - else - BPY_add_spacehandler(text, curarea, SPACE_VIEW3D); - - break; - } - text = text->id.next; - } - } - - allqueue(REDRAWVIEW3D, 1); -} - -static uiBlock *view3d_view_spacehandlers(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - Text *text = G.main->text.first; - ScrArea *sa = curarea; - unsigned short handlertype; - int icontype, slinks_num = 0; - unsigned short menu_evt_num = 0; - char menustr[64]; - static char msg_tog_on[] = "Click to enable"; - static char msg_tog_off[]= "Click to disable"; - char *tip = NULL; - - block= uiNewBlock(&curarea->uiblocks, "view3d_view_spacehandlers", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_view_spacehandlers, NULL); - - while (text) { - menu_evt_num++; - handlertype = BPY_is_spacehandler(text, SPACE_VIEW3D); - - if (handlertype) { - slinks_num++; - - /* mark text as script, so we can remove its link if its header - * becomes corrupt and it's not recognized anymore */ - if (!(text->flags & TXT_ISSCRIPT)) text->flags |= TXT_ISSCRIPT; - - if (handlertype == SPACEHANDLER_VIEW3D_EVENT) - BLI_strncpy(menustr, "Event: ", 8); - else - BLI_strncpy(menustr, "Draw: ", 8); - BLI_strncpy(menustr+7, text->id.name+2, 22); - - if (BPY_has_spacehandler(text, sa)) { - icontype = ICON_CHECKBOX_HLT; - tip = msg_tog_off; - } - else { - icontype = ICON_CHECKBOX_DEHLT; - tip = msg_tog_on; - } - - uiDefIconTextBut(block, BUTM, 1, icontype, menustr, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, menu_evt_num, tip); - } - else if (text->flags & TXT_ISSCRIPT) { - /* if bit set, text was a space handler, but its header got corrupted, - * so we need to remove the link here */ - BPY_del_spacehandler(text, sa); - text->flags &=~TXT_ISSCRIPT; - } - - text = text->id.next; - } - - if (slinks_num == 0) { - uiDefIconTextBut(block, BUTM, 1, ICON_SCRIPT, "None Available", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, -1, "None of the texts in the Text Editor is a 3D View space handler"); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_view3d_viewmenu(void *arg, int event) -{ - View3D *v3d= curarea->spacedata.first; - - switch(event) { - case 0: /* User */ - G.vd->viewbut = 0; - G.vd->persp = 1; - break; - case 1: /* Camera */ - persptoetsen(PAD0); - break; - case 2: /* Top */ - persptoetsen(PAD7); - break; - case 3: /* Front */ - persptoetsen(PAD1); - break; - case 4: /* Side */ - persptoetsen(PAD3); - break; - case 5: /* Perspective */ - G.vd->persp=1; - break; - case 6: /* Orthographic */ - G.vd->persp=0; - break; - case 7: /* Local View */ - G.vd->localview= 1; - initlocalview(); - break; - case 8: /* Global View */ - G.vd->localview= 0; - endlocalview(curarea); - break; - case 9: /* View All (Home) */ - view3d_home(0); - break; - case 11: /* View Selected */ - centerview(); - break; - case 13: /* Play Back Animation */ - play_anim(0); - break; - case 15: /* Background Image... */ - add_blockhandler(curarea, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW); - break; - case 16: /* View Panel */ - add_blockhandler(curarea, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 17: /* Set Clipping Border */ - view3d_edit_clipping(v3d); - break; - case 18: /* render preview */ - toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0); - break; - case 19: /* zoom within border */ - view3d_border_zoom(); - break; - } - allqueue(REDRAWVIEW3D, 1); -} - -static uiBlock *view3d_viewmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - View3D *v3d= curarea->spacedata.first; - - block= uiNewBlock(&curarea->uiblocks, "view3d_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if ((G.vd->viewbut == 0) && !(G.vd->persp == 2)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - if (G.vd->persp == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - if (G.vd->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - if (G.vd->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - if (G.vd->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.vd->persp==1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - if(G.vd->persp==0) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - if(!G.vd->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(v3d->flag & V3D_CLIPPING) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - if (v3d->persp==0) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - if(!curarea->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -void do_view3d_select_object_typemenu(void *arg, int event) -{ - - extern void selectall_type(short obtype); - - switch(event) { - case 1: /* Mesh */ - selectall_type(OB_MESH); - break; - case 2: /* Curve */ - selectall_type(OB_CURVE); - break; - case 3: /* Surface */ - selectall_type(OB_SURF); - break; - case 4: /* Meta */ - selectall_type(OB_MBALL); - break; - case 5: /* Armature */ - selectall_type(OB_ARMATURE); - break; - case 6: /* Lattice */ - selectall_type(OB_LATTICE); - break; - case 7: /* Text */ - selectall_type(OB_FONT); - break; - case 8: /* Empty */ - selectall_type(OB_EMPTY); - break; - case 9: /* Camera */ - selectall_type(OB_CAMERA); - break; - case 10: /* Lamp */ - selectall_type(OB_LAMP); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_object_typemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_typemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_select_object_typemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_select_object_layermenu(void *arg, int event) -{ - extern void selectall_layer(unsigned int layernum); - - switch(event) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - selectall_layer(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_object_layermenu(void *arg_unused) -{ - uiBlock *block; - short xco= 0, yco = 20, menuwidth = 22; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_layermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_select_object_layermenu, NULL); - - uiDefBut(block, BUTM, 1, "1", xco, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefBut(block, BUTM, 1, "2", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefBut(block, BUTM, 1, "3", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefBut(block, BUTM, 1, "4", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefBut(block, BUTM, 1, "5", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - xco += 6; - uiDefBut(block, BUTM, 1, "6", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefBut(block, BUTM, 1, "7", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefBut(block, BUTM, 1, "8", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefBut(block, BUTM, 1, "9", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefBut(block, BUTM, 1, "10", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - xco = 0; - uiDefBut(block, BUTM, 1, "11", xco, yco-=24, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefBut(block, BUTM, 1, "12", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefBut(block, BUTM, 1, "13", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefBut(block, BUTM, 1, "14", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefBut(block, BUTM, 1, "15", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - xco += 6; - uiDefBut(block, BUTM, 1, "16", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - uiDefBut(block, BUTM, 1, "17", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefBut(block, BUTM, 1, "18", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefBut(block, BUTM, 1, "19", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - uiDefBut(block, BUTM, 1, "20", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, ""); - - uiBlockSetDirection(block, UI_RIGHT); - /*uiTextBoundsBlock(block, 100);*/ - return block; -} - -void do_view3d_select_object_linkedmenu(void *arg, int event) -{ - switch(event) { - case 1: /* Object Ipo */ - case 2: /* ObData */ - case 3: /* Current Material */ - case 4: /* Current Texture */ - selectlinks(event); - break; - } - countall(); - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_object_linkedmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_linkedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_select_object_linkedmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Shift L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData|Shift L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Material|Shift L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture|Shift L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_select_object_groupedmenu(void *arg, int event) -{ - switch(event) { - case 1: /* Children */ - case 2: /* Immediate Children */ - case 3: /* Parent */ - case 4: /* Siblings */ - case 5: /* Type */ - case 6: /* Objects on Shared Layers */ - case 7: /* Objects in Same Group */ - case 8: /* Object Hooks*/ - case 9: /* Object PassIndex*/ - select_object_grouped((short)event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_object_groupedmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_object_groupedmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_select_object_groupedmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Children|Shift G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Immediate Children|Shift G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Parent|Shift G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Siblings (Shared Parent)|Shift G, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects of Same Type|Shift G, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift G, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects in Same Group|Shift G, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Hooks|Shift G, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object PassIndex|Shift G, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_select_objectmenu(void *arg, int event) -{ - switch(event) { - - case 0: /* border select */ - borderselect(); - break; - case 1: /* Select/Deselect All */ - deselectall(); - break; - case 2: /* inverse */ - selectswap(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_objectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_objectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_select_object_typemenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Type", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_select_meshmenu(void *arg, int event) -{ -/* extern void borderselect(void);*/ - - switch(event) { - - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_mesh(); - break; - case 3: /* Inverse */ - selectswap_mesh(); - break; - case 4: /* select linked vertices */ - selectconnected_mesh_all(); - break; - case 5: /* select random */ - selectrandom_mesh(); - break; - case 7: /* select more */ - select_more(); - break; - case 8: /* select less */ - select_less(); - break; - case 9: /* select non-manifold */ - select_non_manifold(); - break; - case 11: /* select triangles */ - select_faces_by_numverts(3); - break; - case 12: /* select quads */ - select_faces_by_numverts(4); - break; - case 13: /* select non-triangles/quads */ - select_faces_by_numverts(5); - break; - case 14: /* select sharp edges */ - select_sharp_edges(); - break; - case 15: /* select linked flat faces */ - select_linked_flat_faces(); - break; - - case 16: /* path select */ - pathselect(); - BIF_undo_push("Path Select"); - break; - case 17: /* edge loop select */ - loop_multiselect(0); - break; - case 18: /* edge ring select */ - loop_multiselect(1); - break; - case 19: /* loop to region */ - loop_to_region(); - break; - case 20: /* region to loop */ - region_to_loop(); - break; - case 21: /* Select grouped */ - select_mesh_group_menu(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - - -static uiBlock *view3d_select_meshmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_meshmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Non-Manifold|Ctrl Alt Shift M", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Sharp Edges|Ctrl Alt Shift S", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Linked Flat Faces|Ctrl Alt Shift F", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Triangles|Ctrl Alt Shift 3", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Quads|Ctrl Alt Shift 4", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Non-Triangles/Quads|Ctrl Alt Shift 5", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, - "Similar to Selection...|Shift G", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Vertices|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vertex Path|W Alt 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Loop|Ctrl E 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Edge Ring|Ctrl E 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, - menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop to Region|Ctrl E 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Region to Loop|Ctrl E 9", 0, yco-=20, menuwidth, 20, NULL, 0.0, 0.0, 1, 20, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_select_curvemenu(void *arg, int event) -{ -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_nurb(); - break; - case 3: /* Inverse */ - selectswapNurb(); - break; - /* select connected control points */ - /*case 4: - G.qual |= LR_CTRLKEY; - select_connected_nurb(); - G.qual &= ~LR_CTRLKEY; - break;*/ - case 5: /* select row (nurb) */ - selectrow_nurb(); - break; - case 7: /* select/deselect first */ - selectend_nurb(FIRST, 1, DESELECT); - break; - case 8: /* select/deselect last */ - selectend_nurb(LAST, 1, DESELECT); - break; - case 9: /* select more */ - select_more_nurb(); - break; - case 10: /* select less */ - select_less_nurb(); - break; - case 11: /* select next */ - select_next_nurb(); - break; - case 12: /* select previous */ - select_prev_nurb(); - break; - case 13: /* select random */ - select_random_nurb(); - break; - case 14: /* select every nth */ - select_every_nth_nurb(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - - -static uiBlock *view3d_select_curvemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_curvemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Every Nth", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - - if (OBACT->type == OB_SURF) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Control Point Row|Shift R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - } - else { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect First", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Next", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Previous", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */ - /*uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Connected Control Points|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");*/ - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_select_metaballmenu(void *arg, int event) -{ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_mball(); - break; - case 3: /* Inverse */ - selectinverse_mball(); - break; - case 4: /* Select Random */ - selectrandom_mball(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - - -static uiBlock *view3d_select_metaballmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_metaballmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Random...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_select_latticemenu(void *arg, int event) -{ -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_Latt(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_latticemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_latticemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_select_armaturemenu(void *arg, int event) -{ -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_armature(1, 1); - break; - case 3: /* Select Parent(s) */ - select_bone_parent(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_armaturemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_select_pose_armaturemenu(void *arg, int event) -{ -/* extern void borderselect(void);*/ - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_posearmature(OBACT, 1, 1); - break; - case 3: - pose_select_constraint_target(); - break; - case 4: - select_bone_parent(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_pose_armaturemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_pose_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Constraint Target|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Parent(s)|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_select_faceselmenu(void *arg, int event) -{ - /* events >= 6 are registered bpython scripts */ - if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6); - - switch(event) { - case 0: /* border select */ - borderselect(); - break; - case 2: /* Select/Deselect all */ - deselectall_tface(); - break; - case 3: /* Select Inverse */ - selectswap_tface(); - break; - case 4: /* Select Linked */ - select_linked_tfaces(2); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_faceselmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_faceselmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Faces|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - /* note that we account for the 6 previous entries with i+6: */ - for (pym = BPyMenuTable[PYMENU_FACESELECT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, i+6, - pym->tooltip?pym->tooltip:pym->filename); - } - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_edit_snapmenu(void *arg, int event) -{ - switch(event) { - case 1: /* Selection to grid */ - snap_sel_to_grid(); - break; - case 2: /* Selection to cursor */ - snap_sel_to_curs(); - break; - case 3: /* Cursor to grid */ - snap_curs_to_grid(); - break; - case 4: /* Cursor to selection */ - snap_curs_to_sel(); - break; - case 5: /* Selection to center of selection*/ - snap_to_center(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_snapmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_snapmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Grid|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Cursor|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Selection|Shift S, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_transform_moveaxismenu(void *arg, int event) -{ - float mat[3][3]; - - Mat3One(mat); - - switch(event) - { - case 0: /* X Global */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[0], " X"); - Transform(); - break; - case 1: /* Y Global */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[1], " Y"); - Transform(); - break; - case 2: /* Z Global */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[2], " Z"); - Transform(); - break; - case 3: /* X Local */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setLocalAxisConstraint('X', " X"); - Transform(); - break; - case 4: /* Y Local */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setLocalAxisConstraint('Y', " Y"); - Transform(); - break; - case 5: /* Z Local */ - initTransform(TFM_TRANSLATION, CTX_NONE); - BIF_setLocalAxisConstraint('Z', " Z"); - Transform(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_transform_moveaxismenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_transform_moveaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_transform_moveaxismenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|G, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|G, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|G, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|G, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|G, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|G, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_transform_rotateaxismenu(void *arg, int event) -{ - float mat[3][3]; - - Mat3One(mat); - - switch(event) - { - case 0: /* X Global */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[0], " X"); - Transform(); - break; - case 1: /* Y Global */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[1], " Y"); - Transform(); - break; - case 2: /* Z Global */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setSingleAxisConstraint(mat[2], " Z"); - Transform(); - break; - case 3: /* X Local */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setLocalAxisConstraint('X', " X"); - Transform(); - break; - case 4: /* Y Local */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setLocalAxisConstraint('Y', " Y"); - Transform(); - break; - case 5: /* Z Local */ - initTransform(TFM_ROTATION, CTX_NONE); - BIF_setLocalAxisConstraint('Z', " Z"); - Transform(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_transform_rotateaxismenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_transform_rotateaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_transform_rotateaxismenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|R, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|R, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|R, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|R, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|R, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|R, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_transform_scaleaxismenu(void *arg, int event) -{ - float mat[3][3]; - - Mat3One(mat); - - switch(event) - { - case 0: /* X Global */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setSingleAxisConstraint(mat[0], " X"); - Transform(); - break; - case 1: /* Y Global */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setSingleAxisConstraint(mat[1], " Y"); - Transform(); - break; - case 2: /* Z Global */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setSingleAxisConstraint(mat[2], " Z"); - Transform(); - break; - case 3: /* X Local */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setLocalAxisConstraint('X', " X"); - Transform(); - break; - case 4: /* Y Local */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setLocalAxisConstraint('X', " X"); - Transform(); - break; - case 5: /* Z Local */ - initTransform(TFM_RESIZE, CTX_NONE); - BIF_setLocalAxisConstraint('X', " X"); - Transform(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_transform_scaleaxismenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_transform_scaleaxismenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_transform_scaleaxismenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|S, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|S, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|S, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|S, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|S, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|S, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_transformmenu(void *arg, int event) -{ - switch(event) { - case 1: - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - break; - case 2: - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - break; - case 3: - initTransform(TFM_RESIZE, CTX_NONE); - Transform(); - break; - case 4: - image_aspect(); - break; - case 5: - initTransform(TFM_TOSPHERE, CTX_NONE); - Transform(); - break; - case 6: - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 7: - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 8: - initTransform(TFM_PUSHPULL, CTX_NONE); - Transform(); - break; - case 9: - if (G.obedit) { - if (G.obedit->type == OB_MESH) - initTransform(TFM_SHRINKFATTEN, CTX_NONE); - Transform(); - } else error("Only meshes can be shrinked/fattened"); - break; - case 10: - docenter(0); - break; - case 11: - docenter_new(); - break; - case 12: - docenter_cursor(); - break; - case 13: - initTransform(TFM_TILT, CTX_NONE); - Transform(); - break; - case 14: - initTransform(TFM_CURVE_SHRINKFATTEN, CTX_NONE); - Transform(); - break; - case 15: - G.scene->snap_flag &= ~SCE_SNAP; - break; - case 16: - G.scene->snap_flag |= SCE_SNAP; - break; - case 17: - G.scene->snap_target = SCE_SNAP_TARGET_CLOSEST; - break; - case 18: - G.scene->snap_target = SCE_SNAP_TARGET_CENTER; - break; - case 19: - G.scene->snap_target = SCE_SNAP_TARGET_MEDIAN; - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, view3d_transform_moveaxismenu, NULL, ICON_RIGHTARROW_THIN, "Grab/Move on Axis", 0, yco-=20, 120, 19, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBlockBut(block, view3d_transform_rotateaxismenu, NULL, ICON_RIGHTARROW_THIN, "Rotate on Axis", 0, yco-=20, 120, 19, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBlockBut(block, view3d_transform_scaleaxismenu, NULL, ICON_RIGHTARROW_THIN, "Scale on Axis", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.obedit) { - if (G.obedit->type == OB_MESH) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - else if (G.obedit->type == OB_CURVE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Radius|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - } - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Sphere|Ctrl Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - if (G.obedit) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl Shift Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Push/Pull|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - if (!G.obedit) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale to Image Aspect Ratio|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData to Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - if (!G.obedit) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center New", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } - - if (G.obedit != NULL && G.obedit->type==OB_MESH) - { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (G.scene->snap_flag & SCE_SNAP) - { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - } - else - { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - switch(G.scene->snap_target) - { - case SCE_SNAP_TARGET_CLOSEST: - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - break; - case SCE_SNAP_TARGET_CENTER: - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - break; - case SCE_SNAP_TARGET_MEDIAN: - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - break; - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_object_mirrormenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - Mirror(event + 3); /* + 3 because the first three modes are global*/ - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_object_mirrormenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_object_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_object_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_transformmenu(void *arg, int event) -{ - switch(event) { - case 0: /* clear origin */ - clear_object('o'); - break; - case 1: /* clear scale */ - clear_object('s'); - break; - case 2: /* clear rotation */ - clear_object('r'); - break; - case 3: /* clear location */ - clear_object('g'); - break; - case 4: - if(OBACT) object_apply_deform(OBACT); - break; - case 5: /* make duplis real */ - make_duplilist_real(); - break; - case 6: /* apply scale/rotation or deformation */ - apply_object(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Duplicates Real|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_makelocalmenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - make_local(event); - break; - } -} - -static uiBlock *view3d_edit_object_makelocalmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_makelocalmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_makelocalmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects|L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects and Data|L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All|L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_makelinksmenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - case 4: - make_links((short)event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_makelinksmenu(void *arg_unused) -{ - Object *ob=NULL; - - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_makelinksmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_makelinksmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Scene...|Ctrl L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Ctrl L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if ((ob=OBACT)) { - - if(ob->type==OB_MESH) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } else if(ob->type==OB_CURVE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } else if(ob->type==OB_FONT) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } else if(ob->type==OB_SURF) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } else if(ob->type==OB_MBALL) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - } else if(ob->type==OB_CAMERA) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - } else if(ob->type==OB_LAMP) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - } else if(ob->type==OB_LATTICE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - } else if(ob->type==OB_ARMATURE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_singleusermenu(void *arg, int event) -{ - switch(event) { - case 1: /* Object */ - single_object_users(1); - break; - case 2: /* Object & ObData */ - single_object_users(1); - single_obdata_users(1); - break; - case 3: /* Object & ObData & Materials+Tex */ - single_object_users(1); - single_obdata_users(1); - single_mat_users(1); /* also tex */ - break; - case 4: /* Materials+Tex */ - single_mat_users(1); - break; - } - - clear_id_newpoins(); - countall(); - - allqueue(REDRAWALL, 0); -} - -static uiBlock *view3d_edit_object_singleusermenu(void *arg_unused) -{ - - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_singleusermenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_singleusermenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object|U, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData|U, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData & Materials+Tex|U, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_copyattrmenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 29: - case 30: - copy_attr((short)event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_copyattrmenu(void *arg_unused) -{ - Object *ob=NULL; - - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_copyattrmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_copyattrmenu, NULL); - - ob= OBACT; - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Location|Ctrl C, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotation|Ctrl C, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Size|Ctrl C, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Drawtype|Ctrl C, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Time Offset|Ctrl C, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dupli|Ctrl C, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Protected Transform |Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 29, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Constraints|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NLA Strips|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 26, ""); - - if (ob) { - - if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || - (ob->type == OB_FONT) || (ob->type == OB_MBALL)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Space|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - } - - if(ob->type == OB_FONT) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Font Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); - } - if(ob->type == OB_CURVE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, ""); - } - - if(ob->type==OB_MESH) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subsurf Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Modifiers ...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, ""); - } - - if( give_parteff(ob) ) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Particle Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, ""); - } - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Pass Index|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 30, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - - -static void do_view3d_edit_object_parentmenu(void *arg, int event) -{ - switch(event) { - case 0: /* clear parent */ - clear_parent(); - break; - case 1: /* make parent */ - make_parent(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_parentmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_parentmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_groupmenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - group_operation(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_groupmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_groupmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_groupmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to Existing Group|Ctrl G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add to New Group|Ctrl G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove from All Groups|Ctrl G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_trackmenu(void *arg, int event) -{ - switch(event) { - case 0: /* clear track */ - clear_track(); - break; - case 1: /* make track */ - make_track(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_trackmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_trackmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_trackmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Track...|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Track...|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_constraintsmenu(void *arg, int event) -{ - switch(event) { - case 1: /* add constraint */ - add_constraint(0); - break; - case 2: /* clear constraint */ - ob_clear_constraints(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_constraintsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_constraintsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_constraintsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_showhidemenu(void *arg, int event) -{ - - switch(event) { - - case 0: /* show objects */ - show_objects(); - break; - case 1: /* hide selected objects */ - hide_objects(1); - break; - case 2: /* hide deselected objects */ - hide_objects(0); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_object_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_object_scriptsmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_OBJECT, event); - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_object_scriptsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "v3d_eobject_pymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_object_scriptsmenu, NULL); - - for (pym = BPyMenuTable[PYMENU_OBJECT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -#ifdef WITH_VERSE -extern ListBase session_list; -#endif - -static void do_view3d_edit_objectmenu(void *arg, int event) -{ - /* needed to check for valid selected objects */ - Base *base=NULL; - Object *ob=NULL; -#ifdef WITH_VERSE - struct VerseSession *session=NULL; -#endif - - base= BASACT; - if (base) ob= base->object; - - switch(event) { - - case 0: /* transform properties*/ - mainqenter(NKEY, 1); - break; - case 1: /* delete */ - delete_context_selected(); - break; - case 2: /* duplicate */ - duplicate_context_selected(); - break; - case 3: /* duplicate linked */ - adduplicate(0, 0); - break; - case 5: /* make single user */ - single_user(); - break; - case 7: /* boolean operation */ - special_editmenu(); - break; - case 8: /* join objects */ - join_menu(); - break; - case 9: /* convert object type */ - convertmenu(); - break; - case 10: /* move to layer */ - movetolayer(); - break; - case 11: /* insert keyframe */ - common_insertkey(); - break; - case 15: /* Object Panel */ - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; -#ifdef WITH_VERSE - case 16: /* Share Object at Verse server */ - if(session_list.first != session_list.last) session = session_menu(); - else session = session_list.first; - if(session) b_verse_push_object(session, ob); - break; -#endif - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_objectmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_objectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_objectmenu, NULL); - -#ifdef WITH_VERSE - if(session_list.first != NULL) { - Base *base = BASACT; - Object *ob = NULL; - if (base) ob= base->object; - - if(ob && (ob->type == OB_MESH) && (!ob->vnode)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - } -#endif - - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - - uiDefIconTextBlockBut(block, view3d_edit_object_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear/Apply", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Linked|Alt D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_object_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_trackmenu, NULL, ICON_RIGHTARROW_THIN, "Track", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (OBACT && OBACT->type == OB_MESH) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Join Objects|Ctrl J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Objects", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - - -static void do_view3d_edit_propfalloffmenu(void *arg, int event) -{ - - G.scene->prop_mode= event; - - allqueue(REDRAWVIEW3D, 1); -} - -static uiBlock *view3d_edit_propfalloffmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_propfalloffmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_propfalloffmenu, NULL); - - if (G.scene->prop_mode==PROP_SMOOTH) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Smooth|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SMOOTH, ""); - if (G.scene->prop_mode==PROP_SPHERE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sphere|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SPHERE, ""); - if (G.scene->prop_mode==PROP_ROOT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Root|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_ROOT, ""); - if (G.scene->prop_mode==PROP_SHARP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Sharp|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_SHARP, ""); - if (G.scene->prop_mode==PROP_LIN) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Linear|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_LIN, ""); - if (G.scene->prop_mode==PROP_RANDOM) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Random|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_RANDOM, ""); - if (G.scene->prop_mode==PROP_CONST) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Constant|Shift O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, PROP_CONST, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - - -void do_view3d_edit_mesh_verticesmenu(void *arg, int event) -{ - - switch(event) { - int count; - - case 0: /* make vertex parent */ - make_parent(); - break; - case 1: /* remove doubles */ - count= removedoublesflag(1, 0, G.scene->toolsettings->doublimit); - notice("Removed: %d", count); - if (count) { /* only undo and redraw if an action is taken */ - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Rem Doubles"); - } - break; - case 2: /* smooth */ - vertexsmooth(); - break; - case 3: /* separate */ - separate_mesh(); - break; - case 4: /*split */ - split_mesh(); - break; - case 5: /*merge */ - mergemenu(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 6: /* add hook */ - add_hook(); - break; - case 7: /* rip */ - mesh_rip(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_verticesmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_verticesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_verticesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge...|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rip|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Split|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Smooth|W, Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles|W, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -extern void editmesh_mark_sharp(int set); /* declared in editmesh_mods.c */ - -void do_view3d_edit_mesh_edgesmenu(void *arg, int event) -{ - float fac; - short randfac; - - switch(event) { - - case 0: /* subdivide smooth */ - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag | B_SMOOTH,1,0); - BIF_undo_push("Subdivide Smooth"); - break; - case 1: /*subdivide fractal */ - randfac= 10; - if(button(&randfac, 1, 100, "Rand fac:")==0) return; - fac= -( (float)randfac )/100; - esubdivideflag(1, fac, G.scene->toolsettings->editbutflag,1,0); - BIF_undo_push("Subdivide Fractal"); - break; - case 2: /* subdivide */ - esubdivideflag(1, 0.0, G.scene->toolsettings->editbutflag,1,0); - BIF_undo_push("Subdivide"); - break; - case 3: /* knife subdivide */ - KnifeSubdivide(KNIFE_PROMPT); - break; - case 4: /* Loop subdivide */ - CutEdgeloop(1); - break; - case 5: /* Make Edge/Face */ - addedgeface_mesh(); - break; - case 6: - bevel_menu(); - break; - case 7: /* Mark Seam */ - editmesh_mark_seam(0); - break; - case 8: /* Clear Seam */ - editmesh_mark_seam(1); - break; - case 9: /* Cease SubSurf */ - if(!multires_level1_test()) { - initTransform(TFM_CREASE, CTX_EDGE); - Transform(); - } - break; - case 10: /* Rotate Edge */ - edge_rotate_selected(2); - break; - case 11: /* Rotate Edge */ - edge_rotate_selected(1); - break; - case 12: /* Edgeslide */ - EdgeSlide(0,0.0); - break; - case 13: /* Edge Loop Delete */ - EdgeLoopDelete(); - break; - case 14: /*Collapse Edges*/ - collapseEdges(); - BIF_undo_push("Collapse"); - break; - case 15: - editmesh_mark_sharp(1); - BIF_undo_push("Mark Sharp"); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 16: - editmesh_mark_sharp(0); - BIF_undo_push("Clear Sharp"); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_edgesmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_edgesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_edgesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel|W, Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Loop Subdivide...|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Knife Subdivide...|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Fractal|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Smooth|W, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Sharp|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Edge CCW|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_mesh_facesmenu(void *arg, int event) -{ - switch(event) { - case 0: /* Fill Faces */ - fill_mesh(); - break; - case 1: /* Beauty Fill Faces */ - beauty_fill(); - break; - case 2: /* Quads to Tris */ - convert_to_triface(0); - allqueue(REDRAWVIEW3D, 0); - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 3: /* Tris to Quads */ - join_triangles(); - break; - case 4: /* Flip triangle edges */ - edge_flip(); - break; - case 5: /* Make Edge/Face */ - addedgeface_mesh(); - break; - case 6: /* Set Smooth */ - mesh_set_smooth_faces(1); - break; - case 7: /* Set Solid */ - mesh_set_smooth_faces(0); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_facesmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_facesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_facesmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Beautify Fill|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Quads to Triangles|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Triangles to Quads|Alt J", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Triangle Edges|Ctrl Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Smooth|W, Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Solid|W, Alt 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_mesh_normalsmenu(void *arg, int event) -{ - switch(event) { - case 0: /* flip */ - flip_editnormals(); - break; - case 1: /* recalculate inside */ - righthandfaces(2); - break; - case 2: /* recalculate outside */ - righthandfaces(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_normalsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_normalsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_normalsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Outside|Ctrl N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Recalculate Inside|Ctrl Shift N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip|W, 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_mirrormenu(void *arg, int event) -{ - switch(event) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - Mirror(event); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mirrormenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X View|Ctrl M, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y View|Ctrl M, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z View|Ctrl M, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_mesh_showhidemenu(void *arg, int event) -{ - - switch(event) { - - case 0: /* show hidden vertices */ - reveal_mesh(); - break; - case 1: /* hide selected vertices */ - hide_mesh(0); - break; - case 2: /* hide deselected vertices */ - hide_mesh(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mesh_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_mesh_scriptsmenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_MESH, event); - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mesh_scriptsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - BPyMenu *pym; - int i = 0; - - block= uiNewBlock(&curarea->uiblocks, "v3d_emesh_pymenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL); - - for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_view3d_edit_meshmenu(void *arg, int event) -{ -#ifdef WITH_VERSE - struct VerseSession *session; -#endif - - switch(event) { - - case 0: /* Undo Editing */ - BIF_undo(); - break; - case 1: /* Redo Editing */ - BIF_redo(); - break; - case 2: /* transform properties */ - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, 0); - break; - case 4: /* insert keyframe */ - common_insertkey(); - break; - case 5: /* Extrude */ - extrude_mesh(); - break; - case 6: /* duplicate */ - duplicate_context_selected(); - break; - case 7: /* make edge face */ - addedgeface_mesh(); - break; - case 8: /* delete */ - delete_context_selected(); - break; - case 9: /* Shrink/Fatten Along Normals */ - initTransform(TFM_SHRINKFATTEN, CTX_NONE); - Transform(); - break; - case 10: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 11: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 12: /* proportional edit (toggle) */ - if(G.scene->proportional) G.scene->proportional= 0; - else G.scene->proportional= 1; - break; - case 13: /* automerge edit (toggle) */ - if(G.scene->automerge) G.scene->automerge= 0; - else G.scene->automerge= 1; - break; -#ifdef WITH_VERSE - case 14: - if(session_list.first != session_list.last) session = session_menu(); - else session = session_list.first; - if(session) b_verse_push_object(session, G.obedit); - break; -#endif - case 15: - uv_autocalc_tface(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_meshmenu(void *arg_unused) -{ - - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_meshmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_meshmenu, NULL); - -#ifdef WITH_VERSE - if((session_list.first != NULL) && (!G.obedit->vnode)) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Share at Verse Server", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } -#endif - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo Editing|Ctrl Shift Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Edge/Face|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_mesh_verticesmenu, NULL, ICON_RIGHTARROW_THIN, "Vertices", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_edgesmenu, NULL, ICON_RIGHTARROW_THIN, "Edges", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_facesmenu, NULL, ICON_RIGHTARROW_THIN, "Faces", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_normalsmenu, NULL, ICON_RIGHTARROW_THIN, "Normals", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - - - if(G.scene->proportional) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - } - uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.scene->automerge) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "AutoMerge Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "AutoMerge Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - } - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_mesh_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Vertices", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_edit_curve_controlpointsmenu(void *arg, int event) -{ - switch(event) { - case 0: /* tilt */ - initTransform(TFM_TILT, CTX_NONE); - Transform(); - break; - case 1: /* clear tilt */ - clear_tilt(); - break; - case 2: /* Free */ - sethandlesNurb(3); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 3: /* vector */ - sethandlesNurb(2); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 4: /* smooth */ - sethandlesNurb(1); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 5: /* make vertex parent */ - make_parent(); - break; - case 6: /* add hook */ - add_hook(); - break; - case 7: - separate_nurb(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_curve_controlpointsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_controlpointsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_curve_controlpointsmenu, NULL); - - if (OBACT->type == OB_CURVE) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Tilt|Alt T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Separate|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Automatic|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Free/Aligned|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Vector|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_curve_segmentsmenu(void *arg, int event) -{ - switch(event) { - case 0: /* subdivide */ - subdivideNurb(); - break; - case 1: /* switch direction */ - switchdirectionNurb2(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_curve_segmentsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_segmentsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_curve_segmentsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Direction", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_curve_showhidemenu(void *arg, int event) -{ - switch(event) { - case 10: /* show hidden control points */ - revealNurb(); - break; - case 11: /* hide selected control points */ - hideNurb(0); - break; - case 12: /* hide deselected control points */ - hideNurb(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_curve_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curve_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_curve_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|Alt Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - if (OBACT->type == OB_SURF) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Control Points|Alt Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} -static void do_view3d_edit_curvemenu(void *arg, int event) -{ - switch(event) { - - case 0: /* Undo Editing */ - remake_editNurb(); - break; - case 1: /* transformation properties */ - mainqenter(NKEY, 1); - break; - case 2: /* insert keyframe */ - common_insertkey(); - break; - case 4: /* extrude */ - if (OBACT->type == OB_CURVE) { - addvert_Nurb('e'); - } else if (OBACT->type == OB_SURF) { - extrude_nurb(); - } - break; - case 5: /* duplicate */ - duplicate_context_selected(); - break; - case 6: /* make segment */ - addsegment_nurb(); - break; - case 7: /* toggle cyclic */ - makecyclicNurb(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - break; - case 8: /* delete */ - delete_context_selected(); - break; - case 9: /* proportional edit (toggle) */ - if(G.scene->proportional) G.scene->proportional= 0; - else G.scene->proportional= 1; - break; - case 13: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 14: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 15: - uv_autocalc_tface(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_curvemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_curvemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_curvemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reload Original|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Segment|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Toggle Cyclic|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_curve_controlpointsmenu, NULL, ICON_RIGHTARROW_THIN, "Control Points", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_curve_segmentsmenu, NULL, ICON_RIGHTARROW_THIN, "Segments", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.scene->proportional) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - } - uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_curve_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Control Points", 0, yco-=20, menuwidth, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_edit_mball_showhidemenu(void *arg, int event) -{ - switch(event) { - case 10: /* show hidden control points */ - reveal_mball(); - break; - case 11: /* hide selected control points */ - hide_mball(0); - break; - case 12: /* hide deselected control points */ - hide_mball(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_mball_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_mball_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_mball_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} -static void do_view3d_edit_metaballmenu(void *arg, int event) -{ - switch(event) { - case 1: /* undo */ - BIF_undo(); - break; - case 2: /* redo */ - BIF_redo(); - break; - case 3: /* duplicate */ - duplicate_context_selected(); - break; - case 4: /* delete */ - delete_context_selected(); - break; - case 5: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 6: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 7: /* Transform Properties */ - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, 0); - break; - case 8: - uv_autocalc_tface(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_metaballmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_metaballmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_metaballmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Redo Editing|Shift Ctrl Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N",0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_mball_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Hide MetaElems", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_edit_text_charsmenu(void *arg, int event) -{ - switch(event) { - case 0: /* copyright */ - do_textedit(0,0,169); - break; - case 1: /* registered trademark */ - do_textedit(0,0,174); - break; - case 2: /* degree sign */ - do_textedit(0,0,176); - break; - case 3: /* Multiplication Sign */ - do_textedit(0,0,215); - break; - case 4: /* Circle */ - do_textedit(0,0,138); - break; - case 5: /* superscript 1 */ - do_textedit(0,0,185); - break; - case 6: /* superscript 2 */ - do_textedit(0,0,178); - break; - case 7: /* superscript 3 */ - do_textedit(0,0,179); - break; - case 8: /* double >> */ - do_textedit(0,0,187); - break; - case 9: /* double << */ - do_textedit(0,0,171); - break; - case 10: /* Promillage */ - do_textedit(0,0,139); - break; - case 11: /* dutch florin */ - do_textedit(0,0,164); - break; - case 12: /* british pound */ - do_textedit(0,0,163); - break; - case 13: /* japanese yen*/ - do_textedit(0,0,165); - break; - case 14: /* german S */ - do_textedit(0,0,223); - break; - case 15: /* spanish question mark */ - do_textedit(0,0,191); - break; - case 16: /* spanish exclamation mark */ - do_textedit(0,0,161); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_text_charsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_text_charsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_text_charsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copyright|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Registered Trademark|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Degree Sign|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Multiplication Sign|Alt x", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Circle|Alt .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 1|Alt 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 2|Alt 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Superscript 3|Alt 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double >>|Alt >", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Double <<|Alt <", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Promillage|Alt %", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dutch Florin|Alt F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "British Pound|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Japanese Yen|Alt Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "German S|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Question Mark|Alt ?", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Spanish Exclamation Mark|Alt !", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - -static void do_view3d_edit_textmenu(void *arg, int event) -{ - switch(event) { - - case 0: /* Undo Editing */ - remake_editText(); - break; - case 1: /* paste from file buffer */ - paste_editText(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_textmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_textmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_textmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste From Buffer File|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_text_charsmenu, NULL, ICON_RIGHTARROW_THIN, "Special Characters", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_edit_latticemenu(void *arg, int event) -{ - switch(event) { - - case 0: /* Undo Editing */ - remake_editLatt(); - break; - case 2: /* insert keyframe */ - common_insertkey(); - break; - case 3: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 4: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 5: /* proportional edit (toggle) */ - if(G.scene->proportional) G.scene->proportional= 0; - else G.scene->proportional= 1; - break; - case 6: - uv_autocalc_tface(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_latticemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_latticemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_latticemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "UV Unwrap|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.scene->proportional) { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Proportional Editing|O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - } - uiDefIconTextBlockBut(block, view3d_edit_propfalloffmenu, NULL, ICON_RIGHTARROW_THIN, "Proportional Falloff", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_edit_armature_parentmenu(void *arg, int event) -{ - switch(event) { - case 1: - make_bone_parent(); - break; - case 2: - clear_bone_parent(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_armature_parentmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armature_parentmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_armature_parentmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Parent...|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Parent...|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_edit_armature_rollmenu(void *arg, int event) -{ - if (event == 1 || event == 2) - /* set roll based on aligning z-axis */ - auto_align_armature(event); - else if (event == 3) { - /* interactively set bone roll */ - initTransform(TFM_BONE_ROLL, CTX_NONE); - Transform(); - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_edit_armature_rollmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armature_rollmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_edit_armature_rollmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Roll (Z-Axis Up)|Ctrl N, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Roll to Cursor|Ctrl N, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Roll|Ctrl R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_edit_armaturemenu(void *arg, int event) -{ - static short numcuts= 2; - - switch(event) { - - case 0: /* Undo Editing */ - remake_editArmature(); - break; - case 1: /* transformation properties */ - mainqenter(NKEY, 1); - break; - case 3: /* extrude */ - extrude_armature(0); - break; - case 4: /* duplicate */ - duplicate_context_selected(); - break; - case 5: /* delete */ - delete_context_selected(); - break; - case 6: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 7: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - case 10: /* forked! */ - extrude_armature(1); - break; - case 12: /* subdivide */ - subdivide_armature(1); - break; - case 13: /* flip left and right names */ - armature_flip_names(); - break; - case 15: /* subdivide multi */ - if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; - waitcursor(1); - subdivide_armature(numcuts); - break; - case 16: /* Alt-S transform (BoneSize) */ - initTransform(TFM_BONESIZE, CTX_NONE); - Transform(); - break; - case 17: /* move to layer */ - pose_movetolayer(); - break; - case 18: /* merge bones */ - merge_armature(); - break; - } - - allqueue(REDRAWVIEW3D, 0); -} - - - -static void do_view3d_scripts_armaturemenu(void *arg, int event) -{ - BPY_menu_do_python(PYMENU_SCRIPTTEMPLATE, event); - - allqueue(REDRAWIMAGE, 0); -} - -static uiBlock *view3d_scripts_armaturemenu(void *args_unused) -{ - uiBlock *block; - BPyMenu *pym; - int i= 0; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_scripts_armaturemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_scripts_armaturemenu, NULL); - - /* note that we acount for the N previous entries with i+20: */ - for (pym = BPyMenuTable[PYMENU_ARMATURE]; pym; pym = pym->next, i++) { - - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, - NULL, 0.0, 0.0, 1, i, - pym->tooltip?pym->tooltip:pym->filename); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} - - -static uiBlock *view3d_edit_armaturemenu(void *arg_unused) -{ - bArmature *arm= G.obedit->data; - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_edit_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_edit_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_armature_rollmenu, NULL, ICON_RIGHTARROW_THIN, "Bone Roll", 0, yco-=20, 120, 19, ""); - - if (arm->drawtype==ARM_ENVELOPE) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Envelope Distance|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - else if (arm->drawtype==ARM_B_BONE) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale B-Bone Width|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - if(arm->flag & ARM_MIRROR_EDIT) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrude Forked|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate|Shift D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Merge|Alt M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Fill Between Joints|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Multi|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Left & Right Names|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_edit_armature_parentmenu, NULL, ICON_RIGHTARROW_THIN, "Parent", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_scripts_armaturemenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_view3d_pose_armature_transformmenu(void *arg, int event) -{ - Object *ob= OBACT; - - switch(event) { - case 0: /* clear origin */ - clear_object('o'); - break; - case 1: /* clear scale */ - clear_object('s'); - break; - case 2: /* clear rotation */ - clear_object('r'); - break; - case 3: /* clear location */ - clear_object('g'); - break; - case 4: /* clear user transform */ - rest_pose(ob->pose); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Pose, Clear User Transform"); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armature_transformmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_pose_armature_transformmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Location|Alt G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Rotation|Alt R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Scale|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_pose_armature_showhidemenu(void *arg, int event) -{ - - switch(event) { - - case 0: /* show hidden bones */ - show_all_pose_bones(); - break; - case 1: /* hide selected bones */ - hide_selected_pose_bones(); - break; - case 2: /* hide deselected bones */ - hide_unselected_pose_bones(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armature_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_pose_armature_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_pose_armature_ikmenu(void *arg, int event) -{ - - switch(event) { - - case 1: - pose_add_IK(); - break; - case 2: - pose_clear_IK(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armature_ikmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_ikmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_pose_armature_ikmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add IK to Bone...|Ctrl I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear IK...|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_pose_armature_constraintsmenu(void *arg, int event) -{ - - switch(event) { - - case 1: - add_constraint(0); - break; - case 2: - pose_clear_constraints(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armature_constraintsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_constraintsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_pose_armature_constraintsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Constraint to Bone...|Ctrl Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Constraints...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_pose_armature_motionpathsmenu(void *arg, int event) -{ - - switch(event) { - - case 1: - pose_calculate_path(OBACT); - break; - case 2: - pose_clear_paths(OBACT); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armature_motionpathsmenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armature_motionpathsmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_pose_armature_motionpathsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Calculate Paths|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear All Paths|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_pose_armaturemenu(void *arg, int event) -{ - Object *ob; - ob=OBACT; - - switch(event) { - - case 0: /* transform properties */ - mainqenter(NKEY, 1); - break; - case 1: /* copy current pose */ - copy_posebuf(); - break; - case 2: /* paste pose */ - paste_posebuf(0); - break; - case 3: /* paste flipped pose */ - paste_posebuf(1); - break; - case 4: /* insert keyframe */ - common_insertkey(); - break; - case 5: - pose_copy_menu(); - break; - case 9: - pose_flip_names(); - break; - case 13: - if(ob && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; - if( (arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) { - initTransform(TFM_BONESIZE, CTX_NONE); - Transform(); - break; - } - } - break; - case 14: /* move bone to layer / change armature layer */ - pose_movetolayer(); - break; - case 15: - pose_relax(); - break; - } - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_pose_armaturemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_pose_armaturemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_pose_armaturemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_pose_armature_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Clear Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Envelope Distance|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Current Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Paste Flipped Pose", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_pose_armature_motionpathsmenu, NULL, ICON_RIGHTARROW_THIN, "Motion Paths", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_pose_armature_ikmenu, NULL, ICON_RIGHTARROW_THIN, "Inverse Kinematics", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_pose_armature_constraintsmenu, NULL, ICON_RIGHTARROW_THIN, "Constraints", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip L/R Names|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Switch Armature Layers|Shift M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Bone To Layer|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_pose_armature_showhidemenu, - NULL, ICON_RIGHTARROW_THIN, "Show/Hide Bones", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -/* vertex paint menu */ -static void do_view3d_vpaintmenu(void *arg, int event) -{ - /* events >= 2 are registered bpython scripts */ - if (event >= 2) BPY_menu_do_python(PYMENU_VERTEXPAINT, event - 2); - - switch(event) { - case 0: /* undo vertex painting */ - BIF_undo(); - break; - case 1: /* set vertex colors/weight */ - if(FACESEL_PAINT_TEST) - clear_vpaint_selectedfaces(); - else /* we know were in vertex paint mode */ - clear_vpaint(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_vpaintmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - BPyMenu *pym; - int i=0; - - block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_vpaintmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - /* note that we account for the 2 previous entries with i+2: - even if the last item isnt displayed, it dosent matter */ - for (pym = BPyMenuTable[PYMENU_VERTEXPAINT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, i+2, - pym->tooltip?pym->tooltip:pym->filename); - } - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - - -/* texture paint menu (placeholder, no items yet??) */ -static void do_view3d_tpaintmenu(void *arg, int event) -{ - switch(event) { - case 0: /* undo image painting */ - imagepaint_undo(); - break; - } - - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_tpaintmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_tpaintmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Texture Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - - -static void do_view3d_wpaintmenu(void *arg, int event) -{ - Object *ob= OBACT; - - /* events >= 3 are registered bpython scripts */ - if (event >= 4) BPY_menu_do_python(PYMENU_WEIGHTPAINT, event - 4); - - switch(event) { - case 0: /* undo weight painting */ - BIF_undo(); - break; - case 1: /* set vertex colors/weight */ - clear_wpaint_selectedfaces(); - break; - case 2: /* vgroups from envelopes */ - pose_adds_vgroups(ob, 0); - break; - case 3: /* vgroups from bone heat */ - pose_adds_vgroups(ob, 1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_wpaintmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120, menunr=1; - BPyMenu *pym; - int i=0; - - block= uiNewBlock(&curarea->uiblocks, "view3d_paintmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_wpaintmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Heat Weights to Vertex Groups|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Envelopes to Vertex Groups|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if (FACESEL_PAINT_TEST) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Weight|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - menunr++; - } - - /* note that we account for the 4 previous entries with i+4: - even if the last item isnt displayed, it dosent matter */ - for (pym = BPyMenuTable[PYMENU_WEIGHTPAINT]; pym; pym = pym->next, i++) { - uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, i+4, - pym->tooltip?pym->tooltip:pym->filename); - } - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_sculpt_inputmenu(void *arg, int event) -{ - SculptData *sd= &G.scene->sculptdata; - short val; - - switch(event) { - case 0: - sd->flags ^= SCULPT_INPUT_SMOOTH; - break; - case 1: - val= sd->tablet_size; - if(button(&val,0,10,"Tablet Size:")==0) return; - sd->tablet_size= val; - break; - case 2: - val= sd->tablet_strength; - if(button(&val,0,10,"Tablet Strength:")==0) return; - sd->tablet_strength= val; - break; - } - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); -} - -void do_view3d_sculptmenu(void *arg, int event) -{ - SculptData *sd= &G.scene->sculptdata; - BrushData *br= sculptmode_brush(); - switch(event) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - sd->brush_type= event+1; - break; - case 7: - br->airbrush= !br->airbrush; break; - case 8: - sd->symm ^= SYMM_X; break; - case 9: - sd->symm ^= SYMM_Y; break; - case 10: - sd->symm ^= SYMM_Z; break; - case 11: - if(G.vd) - G.vd->pivot_last= !G.vd->pivot_last; - break; - case 12: - sd->flags ^= SCULPT_DRAW_FAST; - break; - case 13: - sd->flags ^= SCULPT_DRAW_BRUSH; - break; - case 14: - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; - case 15: - sculptmode_propset_init(PropsetTexRot); - break; - case 16: - sculptmode_propset_init(PropsetStrength); - break; - case 17: - sculptmode_propset_init(PropsetSize); - break; - case 18: - br->dir= br->dir==1 ? 2 : 1; break; - } - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); -} - -uiBlock *view3d_sculpt_inputmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth= 120; - SculptData *sd= &G.scene->sculptdata; - - block= uiNewBlock(&curarea->uiblocks, "view3d_sculpt_inputmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_sculpt_inputmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_INPUT_SMOOTH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth Stroke", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Size Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tablet Strength Adjust", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -uiBlock *view3d_sculptmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth= 120; - SculptData *sd= &G.scene->sculptdata; - const BrushData *br= sculptmode_brush(); - - block= uiNewBlock(&curarea->uiblocks, "view3d_sculptmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_sculptmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Sculpt Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_sculpt_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input Settings", 0, yco-=20, 120, 19, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_BRUSH) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Display Brush", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ((sd->flags & SCULPT_DRAW_FAST) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Partial Redraw", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - if(G.vd) - uiDefIconTextBut(block, BUTM, 1, (G.vd->pivot_last ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pivot Last", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale Brush|F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strengthen Brush|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate Brush|Ctrl F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_Z ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Z Symmetry|Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_Y ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Y Symmetry|Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->symm & SYMM_X ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "X Symmetry|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, ""); - - if(sd->brush_type!=GRAB_BRUSH) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, (br->airbrush ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Airbrush|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - - if(sd->brush_type!=SMOOTH_BRUSH && sd->brush_type!=FLATTEN_BRUSH) { - uiDefIconTextBut(block, BUTM, 1, (br->dir==1 ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Add|V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, ""); - } - } - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==FLATTEN_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Flatten|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==LAYER_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Layer|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==GRAB_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Grab|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==INFLATE_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Inflate|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==PINCH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Pinch|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==SMOOTH_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Smooth|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, (sd->brush_type==DRAW_BRUSH ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT), "Draw|D", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - -static void do_view3d_facesel_showhidemenu(void *arg, int event) -{ - switch(event) { - case 4: /* show hidden faces */ - reveal_tface(); - break; - case 5: /* hide selected faces */ - hide_tface(); - break; - case 6: /* hide deselected faces */ - G.qual |= LR_SHIFTKEY; - hide_tface(); - G.qual &= ~LR_SHIFTKEY; - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_facesel_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_facesel_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden Faces|Alt H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected Faces|H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected Faces|Shift H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -static void do_view3d_faceselmenu(void *arg, int event) -{ - switch(event) { - case 0: /* set vertex colors */ - clear_vpaint_selectedfaces(); - break; - case 1: /* mark border seam */ - seam_mark_clear_tface(1); - break; - case 2: /* clear seam */ - seam_mark_clear_tface(2); - break; - } - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -static uiBlock *view3d_faceselmenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_faceselmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Border Seam|Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_facesel_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Faces", 0, yco-=20, 120, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_select_particlemenu(void *arg, int event) -{ - /* events >= 6 are registered bpython scripts */ - if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6); - - switch(event) { - case 0: - PE_borderselect(); - break; - case 1: - PE_deselectall(); - break; - case 2: - PE_select_root(); - break; - case 3: - PE_select_tip(); - break; - case 4: - PE_select_more(); - break; - case 5: - PE_select_less(); - break; - case 7: - PE_select_linked(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_select_particlemenu(void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_select_particlemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_select_particlemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", - 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked|L", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Last|W, 4", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select First|W, 3", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", - 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "More|Ctrl NumPad +", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Less|Ctrl NumPad -", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - -void do_view3d_particle_showhidemenu(void *arg, int event) -{ - switch(event) { - case 1: /* show hidden */ - PE_hide(0); - break; - case 2: /* hide selected */ - PE_hide(2); - break; - case 3: /* hide deselected */ - PE_hide(1); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static uiBlock *view3d_particle_showhidemenu(void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_particle_showhidemenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetButmFunc(block, do_view3d_particle_showhidemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Hidden|Alt H", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Selected|H", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Hide Deselected|Shift H", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} - -void do_view3d_particlemenu(void *arg, int event) -{ - ParticleEditSettings *pset= PE_settings(); - - switch(event) { - case 1: - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; - case 2: - if(button(&pset->totrekey, 2, 100, "Number of Keys:")==0) return; - PE_rekey(); - break; - case 3: - PE_subdivide(); - break; - case 4: - PE_delete_particle(); - break; - case 5: - PE_mirror_x(0); - break; - case 6: - pset->flag ^= PE_X_MIRROR; - break; - case 7: - PE_remove_doubles(); - break; - } - - allqueue(REDRAWVIEW3D, 0); -} - -uiBlock *view3d_particlemenu(void *arg_unused) -{ - uiBlock *block; - ParticleEditSettings *pset= PE_settings(); - short yco= 0, menuwidth= 120; - - block= uiNewBlock(&curarea->uiblocks, "view3d_particlemenu", UI_EMBOSSP, UI_HELV, curarea->headwin); - uiBlockSetButmFunc(block, do_view3d_particlemenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Remove Doubles|W, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete...|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - if(G.scene->selectmode & SCE_SELECT_POINT) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rekey|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_particle_showhidemenu, NULL, ICON_RIGHTARROW_THIN, "Show/Hide Particles", 0, yco-=20, menuwidth, 19, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} - - -static char *view3d_modeselect_pup(void) -{ - Object *ob= OBACT; - static char string[1024]; - static char formatstr[] = "|%s %%x%d %%i%d"; - char *str = string; - - str += sprintf(str, "Mode: %%t"); - - str += sprintf(str, formatstr, "Object Mode", V3D_OBJECTMODE_SEL, ICON_OBJECT); - - if(ob==NULL) return string; - - /* if active object is editable */ - if ( ((ob->type == OB_MESH) || (ob->type == OB_ARMATURE) - || (ob->type == OB_CURVE) || (ob->type == OB_SURF) || (ob->type == OB_FONT) - || (ob->type == OB_MBALL) || (ob->type == OB_LATTICE))) { - - str += sprintf(str, formatstr, "Edit Mode", V3D_EDITMODE_SEL, ICON_EDITMODE_HLT); - } - - if (ob->type == OB_MESH) { - - str += sprintf(str, formatstr, "Sculpt Mode", V3D_SCULPTMODE_SEL, ICON_SCULPTMODE_HLT); - /*str += sprintf(str, formatstr, "Face Select", V3D_FACESELECTMODE_SEL, ICON_FACESEL_HLT);*/ - str += sprintf(str, formatstr, "Vertex Paint", V3D_VERTEXPAINTMODE_SEL, ICON_VPAINT_HLT); - str += sprintf(str, formatstr, "Texture Paint", V3D_TEXTUREPAINTMODE_SEL, ICON_TPAINT_HLT); - str += sprintf(str, formatstr, "Weight Paint", V3D_WEIGHTPAINTMODE_SEL, ICON_WPAINT_HLT); - } - - - /* if active object is an armature */ - if (ob->type==OB_ARMATURE) { - str += sprintf(str, formatstr, "Pose Mode", V3D_POSEMODE_SEL, ICON_POSE_HLT); - } - - if (ob->particlesystem.first) { - str += sprintf(str, formatstr, "Particle Mode", V3D_PARTICLEEDITMODE_SEL, ICON_PHYSICS); - } - - return (string); -} - - -static char *drawtype_pup(void) -{ - static char string[512]; - char *str = string; - - str += sprintf(str, "%s", "Draw type: %t"); - str += sprintf(str, "%s", "|Bounding Box %x1"); - str += sprintf(str, "%s", "|Wireframe %x2"); - str += sprintf(str, "%s", "|Solid %x3"); - str += sprintf(str, "%s", "|Shaded %x4"); - str += sprintf(str, "%s", "|Textured %x5"); - return string; -} -static char *around_pup(void) -{ - static char string[512]; - char *str = string; - - str += sprintf(str, "%s", "Pivot: %t"); - str += sprintf(str, "%s", "|Bounding Box Center %x0"); - str += sprintf(str, "%s", "|Median Point %x3"); - str += sprintf(str, "%s", "|3D Cursor %x1"); - str += sprintf(str, "%s", "|Individual Centers %x2"); - if ((G.obedit) && (G.obedit->type == OB_MESH)) - str += sprintf(str, "%s", "|Active Vert/Edge/Face %x4"); - else - str += sprintf(str, "%s", "|Active Object %x4"); - return string; -} - -static char *propfalloff_pup(void) -{ - static char string[512]; - char *str = string; - - str += sprintf(str, "%s", "Falloff: %t"); - str += sprintf(str, "%s", "|Smooth Falloff%x0"); - str += sprintf(str, "%s", "|Sphere Falloff%x1"); - str += sprintf(str, "%s", "|Root Falloff%x2"); - str += sprintf(str, "%s", "|Sharp Falloff%x3"); - str += sprintf(str, "%s", "|Linear Falloff%x4"); - str += sprintf(str, "%s", "|Random Falloff%x6"); - str += sprintf(str, "%s", "|Constant, No Falloff%x5"); - return string; -} - - -void do_view3d_buttons(short event) -{ - Object *ob= OBACT; - int bit; - - /* watch it: if curarea->win does not exist, check that when calling direct drawing routines */ - - switch(event) { - case B_HOME: - view3d_home(0); - break; - case B_SCENELOCK: - if(G.vd->scenelock) { - G.vd->lay= G.scene->lay; - /* seek for layact */ - bit= 0; - while(bit<32) { - if(G.vd->lay & (1<layact= 1<camera= G.scene->camera; - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - } - break; - - case B_LOCALVIEW: - if(G.vd->localview) initlocalview(); - else { - endlocalview(curarea); - /* new layers might need unflushed events events */ - DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes*/ - } - scrarea_queue_headredraw(curarea); - break; - - case B_VIEWBUT: - - if(G.vd->viewbut==1) persptoetsen(PAD7); - else if(G.vd->viewbut==2) persptoetsen(PAD1); - else if(G.vd->viewbut==3) persptoetsen(PAD3); - break; - - case B_PERSP: - - if(G.vd->persp==2) persptoetsen(PAD0); - else { - G.vd->persp= 1-G.vd->persp; - persptoetsen(PAD5); - } - - break; - case B_PROPTOOL: - allqueue(REDRAWHEADERS, 0); - break; - case B_VIEWRENDER: - if (curarea->spacetype==SPACE_VIEW3D) { - BIF_do_ogl_render(curarea->spacedata.first, G.qual!=0 ); - } - break; - case B_STARTGAME: - if (select_area(SPACE_VIEW3D)) { - start_game(); - } - break; - case B_MODESELECT: - if (G.vd->modeselect == V3D_OBJECTMODE_SEL) { - - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(ob) exit_posemode(); /* exit posemode for active object */ - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - } - else if (G.vd->modeselect == V3D_EDITMODE_SEL) { - if(!G.obedit) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - enter_editmode(EM_WAITCURSOR); - BIF_undo_push("Original"); /* here, because all over code enter_editmode is abused */ - } - } - else if (G.vd->modeselect == V3D_SCULPTMODE_SEL) { - if (!(G.f & G_SCULPTMODE)) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(G.obedit) exit_editmode(2); /* exit editmode and undo */ - - set_sculptmode(); - } - } - else if (G.vd->modeselect == V3D_VERTEXPAINTMODE_SEL) { - if (!(G.f & G_VERTEXPAINT)) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - - set_vpaint(); - } - } - else if (G.vd->modeselect == V3D_TEXTUREPAINTMODE_SEL) { - if (!(G.f & G_TEXTUREPAINT)) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - - set_texturepaint(); - } - } - else if (G.vd->modeselect == V3D_WEIGHTPAINTMODE_SEL) { - if (!(G.f & G_WEIGHTPAINT) && (ob && ob->type == OB_MESH) ) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - - set_wpaint(); - } - } - else if (G.vd->modeselect == V3D_POSEMODE_SEL) { - - if (ob) { - G.vd->flag &= ~V3D_MODE; - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - - enter_posemode(); - } - } - else if(G.vd->modeselect == V3D_PARTICLEEDITMODE_SEL){ - if (!(G.f & G_PARTICLEEDIT)) { - G.vd->flag &= ~V3D_MODE; - exit_paint_modes(); - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* exit editmode and undo */ - - PE_set_particle_edit(); - } - } - allqueue(REDRAWVIEW3D, 1); - break; - - case B_AROUND: - handle_view3d_around(); /* copies to other 3d windows */ - allqueue(REDRAWVIEW3D, 1); - break; - - case B_SEL_VERT: - if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0) - G.scene->selectmode= SCE_SELECT_VERTEX; - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Vertex"); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */ - break; - case B_SEL_EDGE: - if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0){ - if( (G.scene->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX){ - if(G.qual==LR_CTRLKEY) EM_convertsel(SCE_SELECT_VERTEX,SCE_SELECT_EDGE); - } - G.scene->selectmode = SCE_SELECT_EDGE; - } - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Edge"); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */ - break; - case B_SEL_FACE: - if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0){ - if( ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE)){ - if(G.qual==LR_CTRLKEY) EM_convertsel((G.scene->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE); - } - G.scene->selectmode = SCE_SELECT_FACE; - } - EM_selectmode_set(); - countall(); - BIF_undo_push("Selectmode Set: Face"); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWIMAGE, 0); /* only needed in cases where mesh and UV selection are in sync */ - break; - - case B_SEL_PATH: - G.scene->selectmode= SCE_SELECT_PATH; - BIF_undo_push("Selectmode Set: Path"); - allqueue(REDRAWVIEW3D, 1); - break; - case B_SEL_POINT: - G.scene->selectmode = SCE_SELECT_POINT; - BIF_undo_push("Selectmode Set: Point"); - allqueue(REDRAWVIEW3D, 1); - break; - case B_SEL_END: - G.scene->selectmode = SCE_SELECT_END; - BIF_undo_push("Selectmode Set: End point"); - allqueue(REDRAWVIEW3D, 1); - break; - - case B_MAN_TRANS: - if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0) - G.vd->twtype= V3D_MANIP_TRANSLATE; - allqueue(REDRAWVIEW3D, 1); - break; - case B_MAN_ROT: - if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0) - G.vd->twtype= V3D_MANIP_ROTATE; - allqueue(REDRAWVIEW3D, 1); - break; - case B_MAN_SCALE: - if( (G.qual & LR_SHIFTKEY)==0 || G.vd->twtype==0) - G.vd->twtype= V3D_MANIP_SCALE; - allqueue(REDRAWVIEW3D, 1); - break; - - default: - - if(event>=B_LAY && eventlay!=0 && (G.qual & LR_SHIFTKEY)) { - - /* but do find active layer */ - - bit= event-B_LAY; - if( G.vd->lay & (1<layact= 1<lay & G.vd->layact) == 0) { - bit= 0; - while(bit<32) { - if(G.vd->lay & (1<layact= 1<lay= 1<layact= G.vd->lay; - scrarea_queue_headredraw(curarea); - } - - if(G.vd->scenelock) handle_view3d_lock(); - - scrarea_queue_winredraw(curarea); - countall(); - - /* new layers might need unflushed events events */ - DAG_scene_update_flags(G.scene, G.vd->lay); /* tags all that moves and flushes */ - - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWNLA, 0); - } - break; - } -} - -static void view3d_header_pulldowns(uiBlock *block, short *xcoord) -{ - Object *ob= OBACT; - short xmax, xco= *xcoord; - - /* pull down menus */ - uiBlockSetEmboss(block, UI_EMBOSSP); - - /* compensate for local mode when setting up the viewing menu/iconrow values */ - if(G.vd->view==7) G.vd->viewbut= 1; - else if(G.vd->view==1) G.vd->viewbut= 2; - else if(G.vd->view==3) G.vd->viewbut= 3; - else G.vd->viewbut= 0; - - - /* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted - * menu is drawn wider than it should be. The ypos of -2 is to make it properly fill the - * height of the header */ - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, view3d_viewmenu, NULL, "View", xco, -2, xmax-3, 24, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - if (G.obedit) { - if (ob && ob->type == OB_MESH) { - uiDefPulldownBut(block, view3d_select_meshmenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } else if (ob && (ob->type == OB_CURVE || ob->type == OB_SURF)) { - uiDefPulldownBut(block, view3d_select_curvemenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } else if (ob && ob->type == OB_FONT) { - uiDefPulldownBut(block, view3d_select_meshmenu, NULL, "Select", xco, -2, xmax-3, 24, ""); - } else if (ob && ob->type == OB_MBALL) { - uiDefPulldownBut(block, view3d_select_metaballmenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } else if (ob && ob->type == OB_LATTICE) { - uiDefPulldownBut(block, view3d_select_latticemenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } else if (ob && ob->type == OB_ARMATURE) { - uiDefPulldownBut(block, view3d_select_armaturemenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } - } else if (FACESEL_PAINT_TEST) { - if (ob && ob->type == OB_MESH) { - uiDefPulldownBut(block, view3d_select_faceselmenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } - } else if ((G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_WEIGHTPAINT)) { - uiDefBut(block, LABEL,0,"", xco, 0, xmax, 20, 0, 0, 0, 0, 0, ""); - } else if (G.f & G_PARTICLEEDIT) { - uiDefPulldownBut(block, view3d_select_particlemenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } else { - - if (ob && (ob->flag & OB_POSEMODE)) - uiDefPulldownBut(block, view3d_select_pose_armaturemenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - else - uiDefPulldownBut(block, view3d_select_objectmenu, NULL, "Select", xco,-2, xmax-3, 24, ""); - } - xco+= xmax; - - if (G.obedit) { - if (ob && ob->type == OB_MESH) { - xmax= GetButStringLength("Mesh"); - uiDefPulldownBut(block, view3d_edit_meshmenu, NULL, "Mesh", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_CURVE) { - xmax= GetButStringLength("Curve"); - uiDefPulldownBut(block, view3d_edit_curvemenu, NULL, "Curve", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_SURF) { - xmax= GetButStringLength("Surface"); - uiDefPulldownBut(block, view3d_edit_curvemenu, NULL, "Surface", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_FONT) { - xmax= GetButStringLength("Text"); - uiDefPulldownBut(block, view3d_edit_textmenu, NULL, "Text", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_MBALL) { - xmax= GetButStringLength("Metaball"); - uiDefPulldownBut(block, view3d_edit_metaballmenu, NULL, "Metaball", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_LATTICE) { - xmax= GetButStringLength("Lattice"); - uiDefPulldownBut(block, view3d_edit_latticemenu, NULL, "Lattice", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } else if (ob && ob->type == OB_ARMATURE) { - xmax= GetButStringLength("Armature"); - uiDefPulldownBut(block, view3d_edit_armaturemenu, NULL, "Armature", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - - } - else if (G.f & G_WEIGHTPAINT) { - xmax= GetButStringLength("Paint"); - uiDefPulldownBut(block, view3d_wpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - else if (G.f & G_VERTEXPAINT) { - xmax= GetButStringLength("Paint"); - uiDefPulldownBut(block, view3d_vpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - else if (G.f & G_TEXTUREPAINT) { - xmax= GetButStringLength("Paint"); - uiDefPulldownBut(block, view3d_tpaintmenu, NULL, "Paint", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - else if( G.f & G_SCULPTMODE) { - xmax= GetButStringLength("Sculpt"); - uiDefPulldownBut(block, view3d_sculptmenu, NULL, "Sculpt", xco, -2, xmax-3, 24, ""); - xco+= xmax; - } - else if (FACESEL_PAINT_TEST) { - if (ob && ob->type == OB_MESH) { - xmax= GetButStringLength("Face"); - uiDefPulldownBut(block, view3d_faceselmenu, NULL, "Face", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - } - else if(G.f & G_PARTICLEEDIT) { - xmax= GetButStringLength("Particle"); - uiDefPulldownBut(block, view3d_particlemenu, NULL, "Particle", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - else { - if (ob && (ob->flag & OB_POSEMODE)) { - xmax= GetButStringLength("Pose"); - uiDefPulldownBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - else { - xmax= GetButStringLength("Object"); - uiDefPulldownBut(block, view3d_edit_objectmenu, NULL, "Object", xco,-2, xmax-3, 24, ""); - xco+= xmax; - } - } - - *xcoord= xco; -} - -void view3d_buttons(void) -{ - uiBlock *block; - Object *ob= OBACT; - int a; - short xco = 0; - - block= uiNewBlock(&curarea->uiblocks, "header view3d", UI_EMBOSS, UI_HELV, curarea->headwin); - - if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER); - else uiBlockSetCol(block, TH_HEADERDESEL); - - curarea->butspacetype= SPACE_VIEW3D; - - xco = 8; - uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types."); - xco+= XIC+14; - - uiBlockSetEmboss(block, UI_EMBOSSN); - if(curarea->flag & HEADER_NO_PULLDOWN) { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus"); - } else { - uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN, - xco,2,XIC,YIC-2, - &(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus"); - } - uiBlockSetEmboss(block, UI_EMBOSS); - xco+=XIC; - - if((curarea->flag & HEADER_NO_PULLDOWN)==0) - view3d_header_pulldowns(block, &xco); - - /* other buttons: */ - uiBlockSetEmboss(block, UI_EMBOSS); - - /* mode */ - G.vd->modeselect = V3D_OBJECTMODE_SEL; - - if (G.obedit) G.vd->modeselect = V3D_EDITMODE_SEL; - else if(ob && (ob->flag & OB_POSEMODE)) G.vd->modeselect = V3D_POSEMODE_SEL; - else if (G.f & G_SCULPTMODE) G.vd->modeselect = V3D_SCULPTMODE_SEL; - else if (G.f & G_WEIGHTPAINT) G.vd->modeselect = V3D_WEIGHTPAINTMODE_SEL; - else if (G.f & G_VERTEXPAINT) G.vd->modeselect = V3D_VERTEXPAINTMODE_SEL; - else if (G.f & G_TEXTUREPAINT) G.vd->modeselect = V3D_TEXTUREPAINTMODE_SEL; - /*else if(G.f & G_FACESELECT) G.vd->modeselect = V3D_FACESELECTMODE_SEL;*/ - else if(G.f & G_PARTICLEEDIT) G.vd->modeselect = V3D_PARTICLEEDITMODE_SEL; - - G.vd->flag &= ~V3D_MODE; - - /* not sure what the G.vd->flag is useful for now... modeselect is confusing */ - if(G.obedit) G.vd->flag |= V3D_EDITMODE; - if(ob && (ob->flag & OB_POSEMODE)) G.vd->flag |= V3D_POSEMODE; - if(G.f & G_VERTEXPAINT) G.vd->flag |= V3D_VERTEXPAINT; - if(G.f & G_WEIGHTPAINT) G.vd->flag |= V3D_WEIGHTPAINT; - if (G.f & G_TEXTUREPAINT) G.vd->flag |= V3D_TEXTUREPAINT; - if(FACESEL_PAINT_TEST) G.vd->flag |= V3D_FACESELECT; - - uiDefIconTextButS(block, MENU, B_MODESELECT, (G.vd->modeselect),view3d_modeselect_pup() , - xco,0,126,20, &(G.vd->modeselect), 0, 0, 0, 0, "Mode (Hotkeys: Tab, V, Ctrl Tab)"); - - xco+= 126+8; - - /* DRAWTYPE */ - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_BBOX, drawtype_pup(), xco,0,XIC+10,YIC, &(G.vd->drawtype), 1.0, 5.0, 0, 0, "Viewport Shading (Hotkeys: Z, Shift Z, Ctrl Z, Alt Z"); - - /* around */ - xco+= XIC+18; - - uiBlockBeginAlign(block); - - if(retopo_mesh_paint_check()) { - RetopoPaintData *rpd= get_retopo_paint_data(); - if(rpd) { - ToolSettings *ts= G.scene->toolsettings; - - uiDefButC(block,ROW,B_REDR,"Pen",xco,0,40,20,&ts->retopo_paint_tool,6.0,RETOPO_PEN,0,0,""); - xco+=40; - uiDefButC(block,ROW,B_REDR,"Line",xco,0,40,20,&ts->retopo_paint_tool,6.0,RETOPO_LINE,0,0,""); - xco+=40; - uiDefButC(block,ROW,B_REDR,"Ellipse",xco,0,60,20,&ts->retopo_paint_tool,6.0,RETOPO_ELLIPSE,0,0,""); - xco+=65; - - uiBlockBeginAlign(block); - if(ts->retopo_paint_tool == RETOPO_PEN) { - uiDefButC(block,TOG,B_NOP,"Hotspot",xco,0,60,20, &ts->retopo_hotspot, 0,0,0,0,"Show hotspots at line ends to allow line continuation"); - xco+=80; - } - else if(ts->retopo_paint_tool == RETOPO_LINE) { - uiDefButC(block,NUM,B_NOP,"LineDiv",xco,0,80,20,&ts->line_div,1,50,0,0,"Subdivisions per retopo line"); - xco+=80; - } - else if(ts->retopo_paint_tool == RETOPO_ELLIPSE) { - uiDefButC(block,NUM,B_NOP,"EllDiv",xco,0,80,20,&ts->ellipse_div,3,50,0,0,"Subdivisions per retopo ellipse"); - xco+=80; - } - xco+=5; - - uiBlockEndAlign(block); - } - } else { - if (G.obedit==NULL && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT|G_SCULPTMODE))) { - uiDefIconButBitI(block, TOG, G_FACESELECT, B_REDR, ICON_FACESEL_HLT,xco,0,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)"); - xco+= XIC+10; - } else { - /* Manipulators arnt used in weight paint mode */ - uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.vd->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period, Ctrl Period, Alt Period)"); - - xco+= XIC+10; - - uiDefIconButBitS(block, TOG, V3D_ALIGN, B_AROUND, ICON_ALIGN, - xco,0,XIC,YIC, - &G.vd->flag, 0, 0, 0, 0, "Move object centers only"); - uiBlockEndAlign(block); - - xco+= XIC+8; - - /* Transform widget / manipulators */ - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, V3D_USE_MANIPULATOR, B_REDR, ICON_MANIPUL,xco,0,XIC,YIC, &G.vd->twflag, 0, 0, 0, 0, "Use 3d transform manipulator (Ctrl Space)"); - xco+= XIC; - - if(G.vd->twflag & V3D_USE_MANIPULATOR) { - uiDefIconButBitS(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode (Ctrl Alt G)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode (Ctrl Alt R)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, xco,0,XIC,YIC, &G.vd->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode (Ctrl Alt S)"); - xco+= XIC; - } - uiDefButS(block, MENU, B_NOP, "Orientation%t|Global%x0|Local%x1|Normal%x2|View%x3",xco,0,70,YIC, &G.vd->twmode, 0, 0, 0, 0, "Transform Orientation (Alt Space)"); - xco+= 70; - uiBlockEndAlign(block); - xco+= 8; - } - - /* LAYERS */ - if(G.obedit==NULL && G.vd->localview==0) { - uiBlockBeginAlign(block); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<lay), 0, 0, 0, 0, "Toggles Layer visibility (Num, Shift Num)"); - for(a=0; a<5; a++) - uiDefButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, "",(short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)"); - - xco+= 5; - uiBlockBeginAlign(block); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<lay), 0, 0, 0, 0, "Toggles Layer visibility (Num, Shift Num)"); - for(a=5; a<10; a++) - uiDefButBitI(block, TOG, 1<<(a+10), B_LAY+10+a, "",(short)(xco+a*(XIC/2)), 0, XIC/2, (YIC)/2, &(G.vd->lay), 0, 0, 0, 0, "Toggles Layer visibility (Alt Num, Alt Shift Num)"); - - uiBlockEndAlign(block); - - xco+= (a-2)*(XIC/2)+3; - - /* LOCK */ - uiDefIconButS(block, ICONTOG, B_SCENELOCK, ICON_UNLOCKED, xco+=XIC,0,XIC,YIC, &(G.vd->scenelock), 0, 0, 0, 0, "Locks Active Camera and layers to Scene (Ctrl `)"); - xco+= XIC+10; - - } - - /* proportional falloff */ - if((G.obedit && (G.obedit->type == OB_MESH || G.obedit->type == OB_CURVE || G.obedit->type == OB_SURF || G.obedit->type == OB_LATTICE)) || G.f & G_PARTICLEEDIT) { - - uiBlockBeginAlign(block); - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_PROP_OFF, "Proportional %t|Off %x0|On %x1|Connected %x2", xco,0,XIC+10,YIC, &(G.scene->proportional), 0, 1.0, 0, 0, "Proportional Edit Falloff (Hotkeys: O, Alt O) "); - xco+= XIC+10; - - if(G.scene->proportional) { - uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SMOOTHCURVE, propfalloff_pup(), xco,0,XIC+10,YIC, &(G.scene->prop_mode), 0.0, 0.0, 0, 0, "Proportional Edit Falloff (Hotkey: Shift O) "); - xco+= XIC+10; - } - xco+= 10; - } - - /* Snap */ - if(G.obedit && (G.obedit->type == OB_MESH)) { // Only Mesh for now - uiBlockBeginAlign(block); - - if (G.scene->snap_flag & SCE_SNAP) { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEO,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Use Snap or Grid (Shift Tab)"); - xco+= XIC; - uiDefButS(block, MENU, B_NOP, "Mode%t|Closest%x0|Center%x1|Median%x2",xco,0,70,YIC, &G.scene->snap_target, 0, 0, 0, 0, "Snap Target Mode"); - xco+= 70; - } else { - uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,0,XIC,YIC, &G.scene->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)"); - xco+= XIC; - } - - uiBlockEndAlign(block); - xco+= 10; - } - - /* selection modus */ - if(G.obedit && (G.obedit->type == OB_MESH)) { - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode (Ctrl Tab 1)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Edge select mode (Ctrl Tab 2)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)"); - xco+= XIC; - uiBlockEndAlign(block); - if(G.vd->drawtype > OB_WIRE) { - uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,0,XIC,YIC, &G.vd->flag, 1.0, 0.0, 0, 0, "Occlude background geometry"); - xco+= XIC; - } - xco+= 20; - } - else if(G.f & G_PARTICLEEDIT) { - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, SCE_SELECT_PATH, B_SEL_PATH, ICON_EDGESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Path edit mode (Ctrl Tab 1)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_POINT, B_SEL_POINT, ICON_VERTEXSEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Point select mode (Ctrl Tab 2)"); - xco+= XIC; - uiDefIconButBitS(block, TOG, SCE_SELECT_END, B_SEL_END, ICON_FACESEL, xco,0,XIC,YIC, &G.scene->selectmode, 1.0, 0.0, 0, 0, "Tip select mode (Ctrl Tab 3)"); - xco+= XIC; - uiBlockEndAlign(block); - if(G.vd->drawtype > OB_WIRE) { - uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,0,XIC,YIC, &G.vd->flag, 1.0, 0.0, 0, 0, "Limit selection to visible (clipped with depth buffer)"); - xco+= XIC; - } - xco+= 20; - } - - uiDefIconBut(block, BUT, B_VIEWRENDER, ICON_SCENE_DEHLT, xco,0,XIC,YIC, NULL, 0, 1.0, 0, 0, "Render this window (hold CTRL for anim)"); - - if (ob && (ob->flag & OB_POSEMODE)) { - xco+= XIC/2; - uiBlockBeginAlign(block); - if(curarea->headertype==HEADERTOP) { - uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYUP, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Copies the current pose to the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEUP, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Pastes the pose from the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPUP, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Pastes the mirrored pose from the buffer"); - } - else { - uiDefIconBut(block, BUT, B_ACTCOPY, ICON_COPYDOWN, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Copies the current pose to the buffer"); - uiSetButLock(object_data_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - uiDefIconBut(block, BUT, B_ACTPASTE, ICON_PASTEDOWN, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Pastes the pose from the buffer"); - uiDefIconBut(block, BUT, B_ACTPASTEFLIP, ICON_PASTEFLIPDOWN, - xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, - "Pastes the mirrored pose from the buffer"); - } - uiBlockEndAlign(block); - } - } - - /* Always do this last */ - curarea->headbutlen= xco+2*XIC; - - uiDrawBlock(block); - -} diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c deleted file mode 100644 index 505206ed6e0..00000000000 --- a/source/blender/src/headerbuttons.c +++ /dev/null @@ -1,2091 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" -#include "BIF_language.h" -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_storage_types.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_ID.h" -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_group_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_sequence_types.h" -#include "DNA_sound_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_text_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view2d_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -#include "DNA_constraint_types.h" - -#include "BKE_utildefines.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_blender.h" -#include "BKE_brush.h" -#include "BKE_constraint.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_exotic.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_lattice.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_object.h" -#include "BKE_packedFile.h" -#include "BKE_sca.h" -#include "BKE_scene.h" -#include "BKE_texture.h" -#include "BKE_text.h" -#include "BKE_world.h" - -#include "BLO_readfile.h" -#include "BLO_writefile.h" - -#include "BIF_drawimage.h" -#include "BIF_drawoops.h" -#include "BIF_drawscene.h" -#include "BIF_drawtext.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editfont.h" -#include "BIF_editlattice.h" -#include "BIF_editconstraint.h" -#include "BIF_editmesh.h" -#include "BIF_editmesh.h" -#include "BIF_editsima.h" -#include "BIF_editsound.h" -#include "BIF_gl.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_mainqueue.h" -#include "BIF_mywindow.h" -#include "BIF_poseobject.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" -#include "BIF_previewrender.h" -#include "BIF_writeimage.h" -#include "BIF_butspace.h" - -#include "BPI_script.h" - -#include "BSE_edit.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" -#include "BSE_view.h" -#include "BSE_sequence.h" -#include "BSE_editipo.h" -#include "BSE_drawipo.h" - -#include "BDR_drawmesh.h" -#include "BDR_vpaint.h" -#include "BDR_editface.h" -#include "BDR_editobject.h" -#include "BDR_editcurve.h" -#include "BDR_editmball.h" -#include "BDR_sculptmode.h" - -#include "BPY_extern.h" -#include "BPY_menus.h" - -#include "mydevice.h" -#include "blendef.h" -#include "interface.h" -#include "nla.h" /* __NLA : To be removed later */ -#include "butspace.h" // test_idbutton - -#include "BIF_poseobject.h" - -#include "SYS_System.h" - - /* WATCH IT: always give all headerbuttons for same window the same name - * event B_REDR is a standard redraw - * - */ - -char *windowtype_pup(void) -{ - return( - "Window type:%t" //14 - "|3D View %x1" //30 - - "|%l" // 33 - - "|Ipo Curve Editor %x2" //54 - "|Action Editor %x12" //73 - "|NLA Editor %x13" //94 - - "|%l" //97 - - "|UV/Image Editor %x6" //117 - - "|Video Sequence Editor %x8" //143 - "|Timeline %x15" //163 - "|Audio Window %x11" //163 - "|Text Editor %x9" //179 - - "|%l" //192 - - - "|User Preferences %x7" //213 - "|Outliner %x3" //232 - "|Buttons Window %x4" //251 - "|Node Editor %x16" - "|%l" //254 - - "|Image Browser %x10" //273 - "|File Browser %x5" //290 - - "|%l" //293 - - "|Scripts Window %x14"//313 - ); -} - -int GetButStringLength(char *str) { - int rt; - - rt= BIF_GetStringWidth(G.font, str, (U.transopts & USER_TR_BUTTONS)); - - return rt + 15; -} - -/* ********************** GLOBAL ****************************** */ - -int std_libbuttons(uiBlock *block, short xco, short yco, - int pin, short *pinpoin, int browse, short id_code, short special, ID *id, - ID *parid, short *menupoin, int users, int lib, - int del, int autobut, int keepbut) -{ - ListBase *lb; - uiBut *but; - int len, oldcol, add_addbutton=0; - char *str=NULL, str1[10]; - - uiBlockBeginAlign(block); - oldcol= uiBlockGetCol(block); - - if(id && pin) { - uiDefIconButS(block, ICONTOG, pin, ICON_PIN_DEHLT, xco,yco,XIC,YIC, pinpoin, 0, 0, 0, 0, "Keeps this view displaying the current data regardless of what object is selected"); - xco+= XIC; - } - /* browse menu */ - if(browse) { - char *extrastr= NULL; - - if(ELEM4(id_code, ID_MA, ID_TE, ID_BR, ID_PA)) add_addbutton= 1; - - lb= wich_libbase(G.main, id_code); - - if(id && id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1); - - if (pin && *pinpoin) { - uiBlockSetCol(block, TH_BUT_SETTING2); - } - - if (ELEM8( id_code, ID_SCE, ID_SCR, ID_MA, ID_TE, ID_WO, ID_IP, ID_AC, ID_BR) || id_code == ID_PA) extrastr= "ADD NEW %x 32767"; - else if (id_code==ID_TXT) extrastr= "OPEN NEW %x 32766 |ADD NEW %x 32767"; - else if (id_code==ID_SO) extrastr= "OPEN NEW %x 32766"; - - uiSetButLock(G.scene->id.lib!=0, ERROR_LIBDATA_MESSAGE); - if( id_code==ID_SCE || id_code==ID_SCR ) uiClearButLock(); - - if(curarea->spacetype==SPACE_BUTS) - uiSetButLock(id_code!=ID_SCR && G.obedit!=0 && G.buts->mainb==CONTEXT_EDITING, "Cannot perform in EditMode"); - - if(parid) uiSetButLock(parid->lib!=0, ERROR_LIBDATA_MESSAGE); - - if (lb) { - if( id_code==ID_IP) - IPOnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin, G.sipo->blocktype); - else if(browse!=B_SIMABROWSE && id_code==ID_IM ) - IMAnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin); - else - IDnames_to_pupstring(&str, NULL, extrastr, lb, id, menupoin); - } - - uiDefButS(block, MENU, browse, str, xco,yco,XIC,YIC, menupoin, 0, 0, 0, 0, "Browses existing choices or adds NEW"); - xco+= XIC; - - uiClearButLock(); - - MEM_freeN(str); - } - - uiBlockSetCol(block, oldcol); - - if(id) { /* text button with name */ - - /* name */ - if(id->us>1) uiBlockSetCol(block, TH_BUT_SETTING1); - /* Pinned data ? */ - if (pin && *pinpoin) { - uiBlockSetCol(block, TH_BUT_SETTING2); - } - /* Redalert overrides pin color */ - if(id->us<=0) uiBlockSetCol(block, TH_REDALERT); - - uiSetButLock(id->lib!=0, ERROR_LIBDATA_MESSAGE); - - if(GS(id->name)==ID_SCE) strcpy(str1, "SCE:"); - else if(GS(id->name)==ID_SCE) strcpy(str1, "SCR:"); - else if(GS(id->name)==ID_MA) { - if( ((Material *)id)->use_nodes ) - strcpy(str1, "NT:"); - else - strcpy(str1, "MA:"); - } - else { - str1[0]= id->name[0]; - str1[1]= id->name[1]; - str1[2]= ':'; - str1[3]= 0; - } - - if( GS(id->name)==ID_IP) len= 110; - else if(yco) len= 140; // comes from button panel - else len= 120; - - but= uiDefBut(block, TEX, B_IDNAME, str1,xco, yco, (short)len, YIC, id->name+2, 0.0, 21.0, 0, 0, "Displays current Datablock name. Click to change."); - uiButSetFunc(but, test_idbutton_cb, id->name, NULL); - - uiClearButLock(); - - xco+= len; - - if(id->lib) { - - if(id->flag & LIB_INDIRECT) uiDefIconBut(block, BUT, 0, ICON_DATALIB,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Indirect Library Datablock. Cannot change."); - else uiDefIconBut(block, BUT, lib, ICON_PARLIB, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, - lib?"Direct linked Library Datablock. Click to make local.":"Direct linked Library Datablock, cannot make local." - ); - - xco+= XIC; - } - - - if(users && id->us>1) { - uiSetButLock (pin && *pinpoin, "Can't make pinned data single-user"); - - sprintf(str1, "%d", id->us); - if(id->us<10) { - - uiDefBut(block, BUT, users, str1, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); - xco+= XIC; - } - else { - uiDefBut(block, BUT, users, str1, xco, yco, XIC+10, YIC, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); - xco+= XIC+10; - } - - uiClearButLock(); - - } - - if(del) { - - uiSetButLock (pin && *pinpoin, "Can't unlink pinned data"); - if(parid && parid->lib); - else { - uiDefIconBut(block, BUT, del, ICON_X, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Deletes link to this Datablock"); - xco+= XIC; - } - - uiClearButLock(); - } - - if(autobut) { - if(parid && parid->lib); - else { - uiDefIconBut(block, BUT, autobut, ICON_AUTO,xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Generates an automatic name"); - xco+= XIC; - } - - - } - if(keepbut) { - uiDefBut(block, BUT, keepbut, "F", xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Saves this datablock even if it has no users"); - xco+= XIC; - } - } - else if(add_addbutton) { /* "add new" button */ - uiBlockSetCol(block, oldcol); - uiDefButS(block, TOG, browse, "Add New" ,xco, yco, 110, YIC, menupoin, (float)*menupoin, 32767.0, 0, 0, "Add new data block"); - xco+= 110; - } - //xco+=XIC; - - uiBlockSetCol(block, oldcol); - uiBlockEndAlign(block); - - return xco; -} - - -/* results in fully updated anim system */ -static void do_update_for_newframe(int mute, int events) -{ - extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */ - - if(events) { - allqueue(REDRAWALL, 0); - } - - /* this function applies the changes too */ - scene_update_for_newframe(G.scene, screen_view3d_layers()); /* BKE_scene.h */ - - if ( (CFRA>1) && (!mute) && (G.scene->audio.flag & AUDIO_SCRUB)) - audiostream_scrub( CFRA ); - - /* 3d window, preview */ - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - - /* all movie/sequence images */ - BIF_image_update_frame(); - - /* composite */ - if(G.scene->use_nodes && G.scene->nodetree) - ntreeCompositTagAnimated(G.scene->nodetree); -} - -void update_for_newframe(void) -{ - do_update_for_newframe(0, 1); -} - -void update_for_newframe_muted(void) -{ - do_update_for_newframe(1, 1); -} - -/* used by new animated UI playback */ -void update_for_newframe_nodraw(int nosound) -{ - do_update_for_newframe(nosound, 0); -} - - -static void show_splash(void) -{ - extern char datatoc_splash_jpg[]; - extern int datatoc_splash_jpg_size; - char *string = NULL; - -#ifdef NAN_BUILDINFO - char buffer[1024]; - extern char * build_date; - extern char * build_time; - extern char * build_rev; - extern char * build_platform; - extern char * build_type; - - string = &buffer[0]; - sprintf(string,"Built on %s %s, Rev-%s Version %s %s", build_date, build_time, build_rev, build_platform, build_type); -#endif - - splash((void *)datatoc_splash_jpg, datatoc_splash_jpg_size, string); -} - - -/* Functions for user preferences fileselect windows */ - -/* yafray: export dir select */ -static void filesel_u_yfexportdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.yfexportdir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_fontdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.fontdir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_textudir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.textudir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_plugtexdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.plugtexdir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_plugseqdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.plugseqdir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_renderdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.renderdir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_pythondir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.pythondir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_sounddir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.sounddir, dir); - allqueue(REDRAWALL, 0); -} - -static void filesel_u_tempdir(char *name) -{ - char dir[FILE_MAXDIR], file[FILE_MAXFILE]; - - BLI_cleanup_dir(G.sce, name); - BLI_split_dirfile(name, dir, file); - - strcpy(U.tempdir, dir); - allqueue(REDRAWALL, 0); -} - -/* END Functions for user preferences fileselect windows */ - - -void do_global_buttons(unsigned short event) -{ - ListBase *lb; - Object *ob; - Material *ma; - MTex *mtex; - Ipo *ipo; - Lamp *la; - World *wrld; - bAction *act; - ID *id, *idtest, *from=NULL; - ScrArea *sa; - Brush *br; - int nr= 1; - -#ifdef INTERNATIONAL - char buf[FILE_MAX]; -#endif - - ob= OBACT; - - id= NULL; /* id at null for texbrowse */ - - - switch(event) { - - case B_NEWFRAME: - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - - update_for_newframe(); - break; - case B_REDR: - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_REDRCURW3D: - allqueue(REDRAWVIEW3D, 0); - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - break; - case B_EDITBROWSE: - if(ob==NULL) return; - if(ob->id.lib) return; - id= ob->data; - if(id==NULL) return; - - if(G.buts->menunr== -2) { - activate_databrowse((ID *)G.buts->lockpoin, GS(id->name), 0, B_EDITBROWSE, &G.buts->menunr, do_global_buttons); - return; - } - if(G.buts->menunr < 0) return; - - lb= wich_libbase(G.main, GS(id->name)); - idtest= lb->first; - while(idtest) { - if(nr==G.buts->menunr) { - if(idtest!=id) { - id->us--; - id_us_plus(idtest); - - ob->data= idtest; - - test_object_materials(idtest); - - if( GS(idtest->name)==ID_CU ) { - test_curve_type(ob); - } - else if( ob->type==OB_ARMATURE) { - armature_rebuild_pose(ob, ob->data); - } - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION,0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNLA,0); - } - break; - } - nr++; - idtest= idtest->next; - } - - break; - case B_MESHBROWSE: - if(ob==0) return; - if(ob->id.lib) return; - - id= ob->data; - if(id==0) id= G.main->mesh.first; - if(id==0) return; - - if(G.buts->menunr== -2) { - activate_databrowse((ID *)G.buts->lockpoin, GS(id->name), 0, B_MESHBROWSE, &G.buts->menunr, do_global_buttons); - return; - } - if(G.buts->menunr < 0) return; - - - idtest= G.main->mesh.first; - while(idtest) { - if(nr==G.buts->menunr) { - set_mesh(ob, (Mesh *)idtest); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - BIF_undo_push("Browse Mesh"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION,0); - allqueue(REDRAWIPO, 0); - - break; - } - nr++; - idtest= idtest->next; - } - - break; - case B_MATBROWSE: - { - void *lockpoin= NULL; - short *menunr= 0; - - /* this is called now from Node editor too, buttons might not exist */ - if(curarea->spacetype==SPACE_NODE) { - SpaceNode *snode= curarea->spacedata.first; - menunr= &snode->menunr; - lockpoin= snode->id; - } - else if(G.buts) { - menunr= &G.buts->menunr; - lockpoin= G.buts->lockpoin; - } - else return; - - if(*menunr== -2) { - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel((ID *)lockpoin, ID_MA, 0, B_MATBROWSE, menunr, do_global_buttons); - } - else { - activate_databrowse((ID *)lockpoin, ID_MA, 0, B_MATBROWSE, menunr, do_global_buttons); - } - return; - } - - if(*menunr < 0) return; - - if(0) { /* future pin */ - - } - else { - - ma= give_current_material(ob, ob->actcol); - nr= 1; - - id= (ID *)ma; - - idtest= G.main->mat.first; - while(idtest) { - if(nr== *menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new mat */ - if(id) idtest= (ID *)copy_material((Material *)id); - else { - idtest= (ID *)add_material("Material"); - } - idtest->us--; - } - if(idtest!=id) { - assign_material(ob, (Material *)idtest, ob->actcol); - - BIF_undo_push("Browse Material"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWNODE, 0); - BIF_preview_changed(ID_MA); - } - - } - } - break; - case B_MATDELETE: - if(0) { /* future pin */ - - } - else { - ma= give_current_material(ob, ob->actcol); - if(ma) { - assign_material(ob, 0, ob->actcol); - BIF_undo_push("Unlink Material"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); - BIF_preview_changed(ID_MA); - } - } - break; - case B_TEXDELETE: - if(G.buts->pin) { - - } - else { - if(G.buts->texfrom==0) { /* from mat */ - ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - if(ma) { - mtex= ma->mtex[ ma->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - ma->mtex[ ma->texact ]= NULL; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - BIF_preview_changed(ID_MA); - } - } - } - else if(G.buts->texfrom==1) { /* from world */ - wrld= G.scene->world; - if(wrld) { - mtex= wrld->mtex[ wrld->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - wrld->mtex[ wrld->texact ]= NULL; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - BIF_preview_changed(ID_WO); - } - } - } - else if(G.buts->texfrom==2) { /* from lamp */ - la= ob->data; - if(la && ob->type==OB_LAMP) { /* to be sure */ - mtex= la->mtex[ la->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - la->mtex[ la->texact ]= NULL; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - BIF_preview_changed(ID_LA); - } - } - } - else { /* from brush */ - br= G.scene->toolsettings->imapaint.brush; - if(G.f & G_SCULPTMODE) { - sculptmode_rem_tex(NULL, NULL); - allqueue(REDRAWBUTSSHADING, 0); - } else if(br) { - mtex= br->mtex[ br->texact ]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - br->mtex[ br->texact ]= NULL; - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWIPO, 0); - /*BIF_preview_changed(ID_BR);*/ - } - } - } - BIF_undo_push("Unlink Texture"); - } - break; - case B_EXTEXBROWSE: - case B_TEXBROWSE: - - if(G.buts->texnr== -2) { - - id= G.buts->lockpoin; - if(event==B_EXTEXBROWSE) { - id= NULL; - ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - if(ma) { - mtex= ma->mtex[ ma->texact ]; - if(mtex) id= (ID *)mtex->tex; - } - } - if(G.qual & LR_CTRLKEY) { - activate_databrowse_imasel(id, ID_TE, 0, B_TEXBROWSE, &G.buts->texnr, do_global_buttons); - } - else { - activate_databrowse(id, ID_TE, 0, B_TEXBROWSE, &G.buts->texnr, do_global_buttons); - } - return; - } - if(G.buts->texnr < 0) break; - - if(G.buts->pin) { - - } - else { - id= NULL; - - ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - if(ma) { - mtex= ma->mtex[ ma->texact ]; - if(mtex) id= (ID *)mtex->tex; - } - - idtest= G.main->tex.first; - while(idtest) { - if(nr==G.buts->texnr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new tex */ - if(id) idtest= (ID *)copy_texture((Tex *)id); - else idtest= (ID *)add_texture("Tex"); - idtest->us--; - } - if(idtest!=id && ma) { - - if( ma->mtex[ma->texact]==0) ma->mtex[ma->texact]= add_mtex(); - - ma->mtex[ ma->texact ]->tex= (Tex *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Browse Texture"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_MA); - } - } - break; - case B_ACTIONDELETE: - act=ob->action; - - if (act) - act->id.us--; - ob->action=NULL; - if(ob->pose) { // clear flag, also used for draw colors - bPoseChannel *pchan; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - pchan->flag= 0; - } - BIF_undo_push("Unlink Action"); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - break; - case B_ACTIONBROWSE: - if (!ob) - break; - act=ob->action; - id= (ID *)act; - - if (G.saction->actnr== -2){ - activate_databrowse((ID *)G.saction->action, ID_AC, 0, B_ACTIONBROWSE, &G.saction->actnr, do_global_buttons); - return; - } - - if(G.saction->actnr < 0) break; - - /* See if we have selected a valid action */ - for (idtest= G.main->action.first; idtest; idtest= idtest->next) { - if(nr==G.saction->actnr) { - break; - } - nr++; - - } - - if(G.saction->pin) { - if (idtest == NULL) { - /* assign new/copy of pinned action only - messy as it doesn't assign to any obj's */ - if (G.saction->action) - G.saction->action= (bAction *)copy_action(G.saction->action); - else - G.saction->action= (bAction *)add_empty_action("PinnedAction"); - } - else { - G.saction->action= (bAction *)idtest; - } - allqueue(REDRAWACTION, 0); - } - else { - - /* Store current action */ - if (!idtest) { - /* 'Add New' option: - * - make a copy of an exisiting action - * - or make a new empty action if no existing action - */ - if (act) { - idtest= (ID *)copy_action(act); - } - else { - if (ID_OB==ob->type) { - /* for empties */ - idtest=(ID *)add_empty_action("ObAction"); - } - else if (ELEM(ob->type, OB_MESH, OB_LATTICE) && ob_get_key(ob)) { - /* shapekey - like if B_IPO_ACTION_KEY is triggered */ - bActionChannel *achan; - Key *key= ob_get_key(ob); - - ob->ipoflag |= OB_ACTION_KEY; - - act = add_empty_action("ShapeAction"); - idtest=(ID *)act; - - achan= verify_action_channel(act, "Shape"); - achan->flag = (ACHAN_HILIGHTED|ACHAN_SELECTED|ACHAN_EXPANDED|ACHAN_SHOWIPO); - - if(achan->ipo==NULL && key->ipo) { - achan->ipo= key->ipo; - key->ipo= NULL; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - } - } - else { - /* a plain action */ - idtest=(ID *)add_empty_action("Action"); - } - } - idtest->us--; - } - - - if(idtest!=id && ob) { - act= (bAction *)idtest; - - ob->action= act; - id_us_plus(idtest); - - if(id) id->us--; - - // Update everything - BIF_undo_push("Browse Action"); - do_global_buttons (B_NEWFRAME); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWHEADERS, 0); - } - } - - break; - case B_IPOBROWSE: - - ipo= G.sipo->ipo; - from= G.sipo->from; - id= (ID *)ipo; - if(from==NULL) return; - - if(G.sipo->menunr== -2) { - activate_databrowse((ID *)G.sipo->ipo, ID_IP, G.sipo->blocktype, B_IPOBROWSE, &G.sipo->menunr, do_global_buttons); - return; - } - - if(G.sipo->menunr < 0) break; - - idtest= G.main->ipo.first; - while(idtest) { - if( ((Ipo *)idtest)->blocktype == G.sipo->blocktype) { - if(nr==G.sipo->menunr) { - break; - } - nr++; - } - idtest= idtest->next; - } - - if(G.sipo->pin) { - if(idtest) { - G.sipo->ipo= (Ipo *)idtest; - allspace(REMAKEIPO, 0); // in fact it should only do this one, but there is no function for it - } - } - else { - // assign the ipo to ... - - if(idtest==0) { - if(ipo) idtest= (ID *)copy_ipo(ipo); - else { - nr= G.sipo->blocktype; - if(nr==ID_OB) idtest= (ID *)add_ipo("ObIpo", ID_OB); - else if(nr==ID_CO) idtest= (ID *)add_ipo("CoIpo", ID_CO); - else if(nr==ID_PO) idtest= (ID *)add_ipo("ActIpo", nr); - else if(nr==ID_MA) idtest= (ID *)add_ipo("MatIpo", nr); - else if(nr==ID_TE) idtest= (ID *)add_ipo("TexIpo", nr); - else if(nr==ID_SEQ) idtest= (ID *)add_ipo("MatSeq", nr); - else if(nr==ID_CU) idtest= (ID *)add_ipo("CuIpo", nr); - else if(nr==ID_KE) idtest= (ID *)add_ipo("KeyIpo", nr); - else if(nr==ID_WO) idtest= (ID *)add_ipo("WoIpo", nr); - else if(nr==ID_LA) idtest= (ID *)add_ipo("LaIpo", nr); - else if(nr==ID_CA) idtest= (ID *)add_ipo("CaIpo", nr); - else if(nr==ID_SO) idtest= (ID *)add_ipo("SndIpo", nr); - else if(nr==ID_FLUIDSIM) idtest= (ID *)add_ipo("FluidsimIpo", nr); - else if(nr==ID_PA) idtest= (ID *)add_ipo("PaIpo", nr); - else error("Warn bugtracker!"); - } - idtest->us--; - } - if(idtest!=id && from) { - spaceipo_assign_ipo(G.sipo, (Ipo *)idtest); - - BIF_undo_push("Browse Ipo"); - } - } - break; - case B_IPODELETE: - ipo= G.sipo->ipo; - from= G.sipo->from; - - spaceipo_assign_ipo(G.sipo, NULL); - - editipo_changed(G.sipo, 1); /* doredraw */ - - BIF_undo_push("Unlink Ipo"); - - break; - case B_WORLDBROWSE: - - if(G.buts->menunr==-2) { - activate_databrowse((ID *)G.scene->world, ID_WO, 0, B_WORLDBROWSE, &G.buts->menunr, do_global_buttons); - break; - } - - if(G.buts->menunr < 0) break; - /* no lock */ - - wrld= G.scene->world; - nr= 1; - - id= (ID *)wrld; - - idtest= G.main->world.first; - while(idtest) { - if(nr==G.buts->menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new world */ - if(id) idtest= (ID *)copy_world((World *)id); - else idtest= (ID *)add_world("World"); - idtest->us--; - } - if(idtest!=id) { - G.scene->world= (World *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Browse World"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_WO); - } - break; - case B_WORLDDELETE: - if(G.scene->world) { - G.scene->world->id.us--; - G.scene->world= NULL; - - BIF_undo_push("Unlink World"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - } - - break; - case B_WTEXBROWSE: - - if(G.buts->texnr== -2) { - id= NULL; - wrld= G.scene->world; - if(wrld) { - mtex= wrld->mtex[ wrld->texact ]; - if(mtex) id= (ID *)mtex->tex; - } - - activate_databrowse((ID *)id, ID_TE, 0, B_WTEXBROWSE, &G.buts->texnr, do_global_buttons); - return; - } - if(G.buts->texnr < 0) break; - - if(G.buts->pin) { - - } - else { - id= NULL; - - wrld= G.scene->world; - if(wrld) { - mtex= wrld->mtex[ wrld->texact ]; - if(mtex) id= (ID *)mtex->tex; - } - - idtest= G.main->tex.first; - while(idtest) { - if(nr==G.buts->texnr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new tex */ - if(id) idtest= (ID *)copy_texture((Tex *)id); - else idtest= (ID *)add_texture("Tex"); - idtest->us--; - } - if(idtest!=id && wrld) { - - if( wrld->mtex[wrld->texact]==0) { - wrld->mtex[wrld->texact]= add_mtex(); - wrld->mtex[wrld->texact]->texco= TEXCO_VIEW; - } - wrld->mtex[ wrld->texact ]->tex= (Tex *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Texture browse"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_WO); - } - } - break; - case B_LAMPBROWSE: - /* no lock */ - if(ob==0) return; - if(ob->type!=OB_LAMP) return; - - if(G.buts->menunr== -2) { - activate_databrowse((ID *)G.buts->lockpoin, ID_LA, 0, B_LAMPBROWSE, &G.buts->menunr, do_global_buttons); - return; - } - if(G.buts->menunr < 0) break; - - la= ob->data; - nr= 1; - id= (ID *)la; - - idtest= G.main->lamp.first; - while(idtest) { - if(nr==G.buts->menunr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* no new lamp */ - return; - } - if(idtest!=id) { - ob->data= (Lamp *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Lamp browse"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_LA); - } - break; - - case B_LTEXBROWSE: - - if(ob==0) return; - if(ob->type!=OB_LAMP) return; - - if(G.buts->texnr== -2) { - id= NULL; - la= ob->data; - mtex= la->mtex[ la->texact ]; - if(mtex) id= (ID *)mtex->tex; - - activate_databrowse(id, ID_TE, 0, B_LTEXBROWSE, &G.buts->texnr, do_global_buttons); - return; - } - if(G.buts->texnr < 0) break; - - if(G.buts->pin) { - - } - else { - id= NULL; - - la= ob->data; - mtex= la->mtex[ la->texact ]; - if(mtex) id= (ID *)mtex->tex; - - idtest= G.main->tex.first; - while(idtest) { - if(nr==G.buts->texnr) { - break; - } - nr++; - idtest= idtest->next; - } - if(idtest==0) { /* new tex */ - if(id) idtest= (ID *)copy_texture((Tex *)id); - else idtest= (ID *)add_texture("Tex"); - idtest->us--; - } - if(idtest!=id && la) { - - if( la->mtex[la->texact]==0) { - la->mtex[la->texact]= add_mtex(); - la->mtex[la->texact]->texco= TEXCO_GLOB; - } - la->mtex[ la->texact ]->tex= (Tex *)idtest; - id_us_plus(idtest); - if(id) id->us--; - - BIF_undo_push("Texture Browse"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWOOPS, 0); - BIF_preview_changed(ID_LA); - } - } - break; - - case B_IMAGEDELETE: - if(G.sima->image && (G.sima->image->type == IMA_TYPE_R_RESULT || G.sima->image->type == IMA_TYPE_COMPOSITE)) { - /* Run if G.sima is render, remove the render and display the meshes image if it exists */ - G.sima->image= NULL; - what_image(G.sima); - allqueue(REDRAWIMAGE, 0); - } else { - /* Run on non render images, unlink normally */ - image_changed(G.sima, NULL); - BIF_undo_push("Unlink Image"); - allqueue(REDRAWIMAGE, 0); - } - break; - - case B_AUTOMATNAME: - /* this is called now from Node editor too, buttons might not exist */ - if(curarea->spacetype==SPACE_NODE) { - SpaceNode *snode= curarea->spacedata.first; - automatname((Material *)snode->id); - } - else if(G.buts) { - automatname(G.buts->lockpoin); - } - else return; - - BIF_undo_push("Auto name"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWOOPS, 0); - break; - case B_AUTOTEXNAME: - if(G.buts->mainb==CONTEXT_SHADING) { - if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_TEX) { - autotexname(G.buts->lockpoin); - } - else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT) { - ma= G.buts->lockpoin; - if(ma->mtex[ ma->texact]) autotexname(ma->mtex[ma->texact]->tex); - } - else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD) { - wrld= G.buts->lockpoin; - if(wrld->mtex[ wrld->texact]) autotexname(wrld->mtex[wrld->texact]->tex); - } - else if(G.buts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP) { - la= G.buts->lockpoin; - if(la->mtex[ la->texact]) autotexname(la->mtex[la->texact]->tex); - } - BIF_undo_push("Auto name"); - allqueue(REDRAWBUTSSHADING, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWIMAGE, 0); - } - else if(G.buts->mainb==CONTEXT_EDITING) { - SculptData *sd= &G.scene->sculptdata; - if(sd && sd->texact != -1) { - if(sd->mtex[sd->texact]) autotexname(sd->mtex[sd->texact]->tex); - - BIF_undo_push("Auto name"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - } - } - break; - - case B_RESETAUTOSAVE: - reset_autosave(); - allqueue(REDRAWINFO, 0); - break; - case B_SOUNDTOGGLE: - SYS_WriteCommandLineInt(SYS_GetSystem(), "noaudio", (U.gameflags & USER_DISABLE_SOUND)); - break; - case B_SHOWSPLASH: - show_splash(); - break; - case B_MIPMAPCHANGED: - set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); - allqueue(REDRAWVIEW3D, 0); - break; - case B_GLRESLIMITCHANGED: - free_all_realtime_images(); /* force reloading with new res limit */ - allqueue(REDRAWVIEW3D, 0); - break; - case B_NEWSPACE: - newspace(curarea, curarea->butspacetype); - break; - case B_LOADTEMP: /* is button from space.c */ - BIF_read_autosavefile(); - break; - - case B_USERPREF: - allqueue(REDRAWINFO, 0); - break; - - case B_DRAWINFO: /* is button from space.c *info* */ - allqueue(REDRAWVIEW3D, 0); - break; - - case B_PLAINMENUS: /* is button from space.c *info* */ - reset_toolbox(); - break; - - case B_FLIPINFOMENU: /* is button from space.c *info* */ - scrarea_queue_headredraw(curarea); - break; - -#if 0 -//#ifdef _WIN32 // FULLSCREEN - case B_FLIPFULLSCREEN: - if(U.uiflag & USER_FLIPFULLSCREEN) - U.uiflag &= ~USER_FLIPFULLSCREEN; - else - U.uiflag |= USER_FLIPFULLSCREEN; - mainwindow_toggle_fullscreen((U.uiflag & USER_FLIPFULLSCREEN)); - break; -#endif - - /* Fileselect windows for user preferences file paths */ - - /* yafray: xml export dir. select */ - case B_YAFRAYDIRFILESEL: /* space.c */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT YFEXPORT PATH", U.yfexportdir, filesel_u_yfexportdir); - break; - - case B_FONTDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT FONT PATH", U.fontdir, filesel_u_fontdir); - break; - - case B_TEXTUDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT TEXTURE PATH", U.textudir, filesel_u_textudir); - break; - - case B_PLUGTEXDIRFILESEL: /* is button form space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT TEX PLUGIN PATH", U.plugtexdir, filesel_u_plugtexdir); - break; - - case B_PLUGSEQDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT SEQ PLUGIN PATH", U.plugseqdir, filesel_u_plugseqdir); - break; - - case B_RENDERDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT RENDER PATH", U.renderdir, filesel_u_renderdir); - break; - - case B_PYMENUEVAL: /* is button from space.c *info* */ - waitcursor( 1 ); /* can take some time */ - BPyMenu_RemoveAllEntries(); /* free old data */ - if (BPyMenu_Init(1) == -1) { /* re-eval scripts registration in menus */ - waitcursor( 0 ); - error("Invalid scripts dir: check console"); - } - waitcursor( 0 ); - break; - case B_PYTHONDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT SCRIPT PATH", U.pythondir, filesel_u_pythondir); - break; - - case B_SOUNDDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT SOUND PATH", U.sounddir, filesel_u_sounddir); - break; - - case B_TEMPDIRFILESEL: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_SPECIAL, "SELECT TEMP FILE PATH", U.tempdir, filesel_u_tempdir); - break; - - /* END Fileselect windows for user preferences file paths */ - -#ifdef INTERNATIONAL - case B_LOADUIFONT: /* is button from space.c *info* */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - BLI_make_file_string("/", buf, U.fontdir, U.fontname); - activate_fileselect(FILE_SPECIAL, "LOAD UI FONT", buf, set_interface_font); - break; - - case B_SETLANGUAGE: /* is button from space.c *info* */ - lang_setlanguage(); - allqueue(REDRAWALL, 0); - break; - - case B_SETFONTSIZE: /* is button from space.c *info* */ - refresh_interface_font(); - FTF_SetSize(U.fontsize); - allqueue(REDRAWALL, 0); - break; - - case B_SETTRANSBUTS: /* is button from space.c *info* */ - allqueue(REDRAWALL, 0); - break; - - case B_RESTOREFONT: /* is button from space.c *info* */ - U.fontsize= 0; - start_interface_font(); - allqueue(REDRAWALL, 0); - break; - - case B_USETEXTUREFONT: /* is button from space.c *info* */ - refresh_interface_font(); - allqueue(REDRAWALL, 0); - break; - - case B_DOLANGUIFONT: /* is button from space.c *info* */ - if(U.transopts & USER_DOTRANSLATE) - start_interface_font(); - else - G.ui_international = FALSE; - allqueue(REDRAWALL, 0); - break; -#endif - - case B_FULL: - if(curarea->spacetype!=SPACE_INFO) { - area_fullscreen(); - } - break; - - case B_IDNAME: - /* changing a metaballs name, sadly enough, - * can require it to be updated because its - * basis might have changed... -zr - */ - if (ob && ob->type==OB_MBALL) { - DAG_scene_sort(G.scene); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - /* redraw because name has changed: new pup */ - scrarea_queue_headredraw(curarea); - allqueue(REDRAWINFO, 1); - allqueue(REDRAWOOPS, 1); - allqueue(REDRAWACTION, 1); - allqueue(REDRAWNLA, 1); - /* name scene also in set PUPmenu */ - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWHEADERS, 0); - break; - - case B_KEEPDATA: - /* keep datablock. similar to pressing FKEY in a fileselect window - * maybe we can move that stuff to a seperate function? -- sg - */ - if (curarea->spacetype==SPACE_BUTS) { - id= (ID *)G.buts->lockpoin; - } else if(curarea->spacetype==SPACE_IPO) { - id = (ID *)G.sipo->ipo; - } else if(curarea->spacetype==SPACE_NODE) { - id = ((SpaceNode *)curarea->spacedata.first)->id; - } /* similar for other spacetypes ? */ - if (id) { - if( id->flag & LIB_FAKEUSER) { - id->flag -= LIB_FAKEUSER; - id->us--; - } else { - id->flag |= LIB_FAKEUSER; - id->us++; - } - } - allqueue(REDRAWHEADERS, 0); - - break; - - } -} - - -void do_global_buttons2(short event) -{ - Base *base; - Object *ob; - Material *ma; - MTex *mtex; - Mesh *me; - Curve *cu; - MetaBall *mb; - Ipo *ipo; - Lamp *la; - Lattice *lt; - World *wrld; - ID *idfrom; - bAction *act; - Brush *br; - - /* general: Single User is allowed when from==LOCAL - * Make Local is allowed when (from==LOCAL && id==LIB) - */ - - if(eventid.lib==0) { - la= ob->data; - if(la->id.us>1) { - if(okee("Single user")) { - ob->data= copy_lamp(la); - la->id.us--; - } - } - } - break; - case B_LAMPLOCAL: - if(ob && ob->id.lib==0) { - la= ob->data; - if(la->id.lib) { - if(okee("Make local")) { - make_local_lamp(la); - } - } - } - break; - - case B_ARMLOCAL: - if (ob&&ob->id.lib==0){ - bArmature *arm=ob->data; - if (arm->id.lib){ - if(okee("Make local")) { - make_local_armature(arm); - } - } - } - break; - case B_ARMALONE: - if(ob && ob->id.lib==0) { - bArmature *arm=ob->data; - if(arm->id.us>1) { - if(okee("Single user")) { - ob->data= copy_armature(arm); - armature_rebuild_pose(ob, ob->data); - arm->id.us--; - } - } - } - break; - case B_ACTLOCAL: - if(ob && ob->id.lib==0) { - act= ob->action; - if(act->id.lib) { - if(okee("Make local")) { - make_local_action(act); - allqueue(REDRAWACTION,0); - } - } - } - break; - case B_ACTALONE: - if(ob && ob->id.lib==0) { - act= ob->action; - - if(act->id.us>1) { - if(okee("Single user")) { - ob->action=copy_action(act); - act->id.us--; - allqueue(REDRAWACTION, 0); - } - } - } - break; - - case B_CAMERAALONE: - if(ob && ob->id.lib==0) { - Camera *ca= ob->data; - if(ca->id.us>1) { - if(okee("Single user")) { - ob->data= copy_camera(ca); - ca->id.us--; - } - } - } - break; - case B_CAMERALOCAL: - if(ob && ob->id.lib==0) { - Camera *ca= ob->data; - if(ca->id.lib) { - if(okee("Make local")) { - make_local_camera(ca); - } - } - } - break; - case B_WORLDALONE: - wrld= G.scene->world; - if(wrld->id.us>1) { - if(okee("Single user")) { - G.scene->world= copy_world(wrld); - wrld->id.us--; - } - } - break; - case B_WORLDLOCAL: - wrld= G.scene->world; - if(wrld && wrld->id.lib) { - if(okee("Make local")) { - make_local_world(wrld); - } - } - break; - - case B_LATTALONE: - if(ob && ob->id.lib==0) { - lt= ob->data; - if(lt->id.us>1) { - if(okee("Single user")) { - ob->data= copy_lattice(lt); - lt->id.us--; - } - } - } - break; - case B_LATTLOCAL: - if(ob && ob->id.lib==0) { - lt= ob->data; - if(lt->id.lib) { - if(okee("Make local")) { - make_local_lattice(lt); - } - } - } - break; - - case B_MATALONE: - if(ob==0) return; - ma= give_current_material(ob, ob->actcol); - idfrom= material_from(ob, ob->actcol); - if(idfrom && idfrom->lib==0) { - if(ma->id.us>1) { - if(okee("Single user")) { - ma= copy_material(ma); - ma->id.us= 0; - assign_material(ob, ma, ob->actcol); - } - } - } - break; - case B_MATLOCAL: - if(ob==0) return; - idfrom= material_from(ob, ob->actcol); - if(idfrom->lib==0) { - ma= give_current_material(ob, ob->actcol); - if(ma && ma->id.lib) { - if(okee("Make local")) { - make_local_material(ma); - } - } - } - break; - - case B_MESHLOCAL: - if(ob && ob->id.lib==0) { - me= ob->data; - if(me && me->id.lib) { - if(okee("Make local")) { - make_local_mesh(me); - make_local_key( me->key ); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - break; - - case B_MBALLALONE: - if(ob && ob->id.lib==0) { - mb= ob->data; - if(mb->id.us>1) { - if(okee("Single user")) { - ob->data= copy_mball(mb); - mb->id.us--; - if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0); - } - } - } - break; - case B_MBALLLOCAL: - if(ob && ob->id.lib==0) { - mb= ob->data; - if(mb->id.lib) { - if(okee("Make local")) { - make_local_mball(mb); - } - } - } - break; - - case B_CURVEALONE: - if(ob && ob->id.lib==0) { - cu= ob->data; - if(cu->id.us>1) { - if(okee("Single user")) { - ob->data= copy_curve(cu); - cu->id.us--; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0); - } - } - } - break; - case B_CURVELOCAL: - if(ob && ob->id.lib==0) { - cu= ob->data; - if(cu->id.lib) { - if(okee("Make local")) { - make_local_curve(cu); - make_local_key( cu->key ); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - } - break; - - case B_TEXALONE: - if(G.buts->texfrom==0) { /* from mat */ - if(ob==0) return; - ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - if(ma && ma->id.lib==0) { - mtex= ma->mtex[ ma->texact ]; - if(mtex->tex && mtex->tex->id.us>1) { - if(okee("Single user")) { - mtex->tex->id.us--; - mtex->tex= copy_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==1) { /* from world */ - wrld= G.scene->world; - if(wrld->id.lib==0) { - mtex= wrld->mtex[ wrld->texact ]; - if(mtex->tex && mtex->tex->id.us>1) { - if(okee("Single user")) { - mtex->tex->id.us--; - mtex->tex= copy_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==2) { /* from lamp */ - if(ob==0 || ob->type!=OB_LAMP) return; - la= ob->data; - if(la->id.lib==0) { - mtex= la->mtex[ la->texact ]; - if(mtex->tex && mtex->tex->id.us>1) { - if(okee("Single user")) { - mtex->tex->id.us--; - mtex->tex= copy_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==3) { /* from brush */ - br= G.scene->toolsettings->imapaint.brush; - if(br==0) return; - if(br->id.lib==0) { - mtex= br->mtex[ br->texact ]; - if(mtex->tex && mtex->tex->id.us>1) { - if(okee("Single user")) { - mtex->tex->id.us--; - mtex->tex= copy_texture(mtex->tex); - allqueue(REDRAWIMAGE, 0); - } - } - } - } - break; - case B_TEXLOCAL: - if(G.buts->texfrom==0) { /* from mat */ - if(ob==0) return; - ma= give_current_material(ob, ob->actcol); - ma= editnode_get_active_material(ma); - if(ma && ma->id.lib==0) { - mtex= ma->mtex[ ma->texact ]; - if(mtex->tex && mtex->tex->id.lib) { - if(okee("Make local")) { - make_local_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==1) { /* from world */ - wrld= G.scene->world; - if(wrld->id.lib==0) { - mtex= wrld->mtex[ wrld->texact ]; - if(mtex->tex && mtex->tex->id.lib) { - if(okee("Make local")) { - make_local_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==2) { /* from lamp */ - if(ob==0 || ob->type!=OB_LAMP) return; - la= ob->data; - if(la->id.lib==0) { - mtex= la->mtex[ la->texact ]; - if(mtex->tex && mtex->tex->id.lib) { - if(okee("Make local")) { - make_local_texture(mtex->tex); - } - } - } - } - else if(G.buts->texfrom==3) { /* from brush */ - br= G.scene->toolsettings->imapaint.brush; - if(br==0) return; - if(br->id.lib==0) { - mtex= br->mtex[ br->texact ]; - if(mtex->tex && mtex->tex->id.lib) { - if(okee("Make local")) { - make_local_texture(mtex->tex); - allqueue(REDRAWIMAGE, 0); - } - } - } - } - break; - - case B_IPOALONE: - ipo= G.sipo->ipo; - idfrom= G.sipo->from; - - if(idfrom && idfrom->lib==NULL) { - if(ipo->id.us>1) { - if(okee("Single user")) { - ipo= copy_ipo(ipo); - ipo->id.us= 0; /* assign_ipo adds users, copy_ipo sets to 1 */ - spaceipo_assign_ipo(G.sipo, ipo); - allqueue(REDRAWIPO, 0); - } - } - } - break; - case B_IPOLOCAL: - ipo= G.sipo->ipo; - idfrom= G.sipo->from; - - if(idfrom && idfrom->lib==0) { - if(ipo->id.lib) { - if(okee("Make local")) { - make_local_ipo(ipo); - allqueue(REDRAWIPO, 0); - } - } - } - break; - - case B_OBALONE: - if(G.scene->id.lib==0) { - if(ob->id.us>1) { - if(okee("Single user")) { - base= FIRSTBASE; - while(base) { - if(base->object==ob) { - base->object= copy_object(ob); - ob->id.us--; - allqueue(REDRAWVIEW3D, 0); - break; - } - base= base->next; - } - } - } - } - break; - case B_OBLOCAL: - if(G.scene->id.lib==0) { - if(ob->id.lib) { - if(okee("Make local")) { - make_local_object(ob); - allqueue(REDRAWVIEW3D, 0); - } - } - } - break; - case B_MESHALONE: - if(ob && ob->id.lib==0) { - - me= ob->data; - - if(me && me->id.us>1) { - if(okee("Single user")) { - Mesh *men= copy_mesh(me); - men->id.us= 0; - - set_mesh(ob, men); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if(ob==G.obedit) allqueue(REDRAWVIEW3D, 0); - } - } - } - break; - } - - BIF_undo_push("Make single user or local"); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWOOPS, 0); -} - -/* ******************** GENERAL ********************** */ - -void do_headerbuttons(short event) -{ - - if(event<=50) do_global_buttons2(event); - else if(event<=100) do_global_buttons(event); - else if(event<200) do_view3d_buttons(event); - else if(event<250) do_ipo_buttons(event); - else if(event<300) do_oops_buttons(event); - else if(event<350) do_info_buttons(event); - else if(event<400) do_image_buttons(event); - else if(event<450) do_buts_buttons(event); - else if(event<500) do_imasel_buttons(event); - else if(event<525) do_text_buttons(event); - else if(event<550) do_script_buttons(event); - else if(event<600) do_file_buttons(event); - else if(event<650) do_seq_buttons(event); - else if(event<700) do_sound_buttons(event); - else if(event<750) do_action_buttons(event); - else if(event<800) do_time_buttons(curarea, event); - else if(event<850) do_nla_buttons(event); - else if(event<900) do_node_buttons(curarea, event); - else if(event>=REDRAWVIEW3D) allqueue(event, 0); -} - diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c deleted file mode 100644 index 7b8efd0ed75..00000000000 --- a/source/blender/src/imagepaint.c +++ /dev/null @@ -1,790 +0,0 @@ -/** - * $Id$ - * imagepaint.c - * - * Functions to paint images in 2D and 3D. - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Jens Ole Wund (bjornmose) - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif -#include "BLI_arithb.h" -#include "PIL_time.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "DNA_brush_types.h" -#include "DNA_image_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_brush.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_utildefines.h" - -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_drawipo.h" -#include "BSE_node.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" - -#include "BDR_drawmesh.h" -#include "BDR_imagepaint.h" -#include "BDR_vpaint.h" - -#include "GHOST_Types.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -/* Defines and Structs */ - -#define IMAPAINT_FLOAT_TO_CHAR(f) ((char)(f*255)) -#define IMAPAINT_CHAR_TO_FLOAT(c) (c/255.0f) - -#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { c[0]=IMAPAINT_FLOAT_TO_CHAR(f[0]); \ - c[1]=IMAPAINT_FLOAT_TO_CHAR(f[1]); c[2]=IMAPAINT_FLOAT_TO_CHAR(f[2]); } -#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { f[0]=IMAPAINT_CHAR_TO_FLOAT(c[0]); \ - f[1]=IMAPAINT_CHAR_TO_FLOAT(c[1]); f[2]=IMAPAINT_CHAR_TO_FLOAT(c[2]); } -#define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b) - -#define IMAPAINT_TILE_BITS 6 -#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) -#define IMAPAINT_TILE_NUMBER(size) (((size)+IMAPAINT_TILE_SIZE-1) >> IMAPAINT_TILE_BITS) - -typedef struct ImagePaintState { - Brush *brush; - short tool, blend; - Image *image; - ImBuf *canvas; - ImBuf *clonecanvas; - short clonefreefloat; - char *warnpackedfile; - char *warnmultifile; - - /* texture paint only */ - Object *ob; - Mesh *me; - int faceindex; - float uv[2]; -} ImagePaintState; - -typedef struct ImagePaintUndo { - Image *image; - ImBuf *tilebuf; - void **tiles; - int xtiles, ytiles; -} ImagePaintUndo; - -typedef struct ImagePaintPartialRedraw { - int x1, y1, x2, y2; - int enabled; -} ImagePaintPartialRedraw; - -static ImagePaintUndo imapaintundo = {NULL, NULL, NULL, 0, 0}; -static ImagePaintPartialRedraw imapaintpartial = {0, 0, 0, 0, 0}; - -static void init_imagapaint_undo(Image *ima, ImBuf *ibuf) -{ - int xt, yt; - - imapaintundo.image = ima; - imapaintundo.xtiles = xt = IMAPAINT_TILE_NUMBER(ibuf->x); - imapaintundo.ytiles = yt = IMAPAINT_TILE_NUMBER(ibuf->y); - imapaintundo.tiles = MEM_callocN(sizeof(void*)*xt*yt, "ImagePaintUndoTiles"); - imapaintundo.tilebuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, - ibuf->depth, (ibuf->rect_float)? IB_rectfloat: IB_rect, 0); -} - -static void imapaint_copy_tile(ImBuf *ibuf, int tile, int x, int y, int swapundo) -{ - IMB_rectcpy(imapaintundo.tilebuf, ibuf, 0, 0, x*IMAPAINT_TILE_SIZE, - y*IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE); - - if (imapaintundo.tilebuf->rect_float) - SWAP(void*, imapaintundo.tilebuf->rect_float, imapaintundo.tiles[tile]) - else - SWAP(void*, imapaintundo.tilebuf->rect, imapaintundo.tiles[tile]) - - if (swapundo) - IMB_rectcpy(ibuf, imapaintundo.tilebuf, x*IMAPAINT_TILE_SIZE, - y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE); -} - -static void imapaint_clear_partial_redraw() -{ - memset(&imapaintpartial, 0, sizeof(imapaintpartial)); -} - -static void imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int h) -{ - int srcx= 0, srcy= 0, origx, tile, allocsize; - - IMB_rectclip(ibuf, NULL, &x, &y, &srcx, &srcy, &w, &h); - - if (w == 0 || h == 0) - return; - - if (!imapaintpartial.enabled) { - imapaintpartial.x1 = x; - imapaintpartial.y1 = y; - imapaintpartial.x2 = x+w; - imapaintpartial.y2 = y+h; - imapaintpartial.enabled = 1; - } - else { - imapaintpartial.x1 = MIN2(imapaintpartial.x1, x); - imapaintpartial.y1 = MIN2(imapaintpartial.y1, y); - imapaintpartial.x2 = MAX2(imapaintpartial.x2, x+w); - imapaintpartial.y2 = MAX2(imapaintpartial.y2, y+h); - } - - w = ((x + w - 1) >> IMAPAINT_TILE_BITS); - h = ((y + h - 1) >> IMAPAINT_TILE_BITS); - origx = (x >> IMAPAINT_TILE_BITS); - y = (y >> IMAPAINT_TILE_BITS); - - for (; y <= h; y++) { - for (x=origx; x <= w; x++) { - if (ima != imapaintundo.image) { - free_imagepaint(); - init_imagapaint_undo(ima, ibuf); - } - - tile = y*imapaintundo.xtiles + x; - if (!imapaintundo.tiles[tile]) { - allocsize= (ibuf->rect_float)? sizeof(float): sizeof(char); - imapaintundo.tiles[tile]= MEM_mapallocN(allocsize*4* - IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE, "ImagePaintUndoTile"); - imapaint_copy_tile(ibuf, tile, x, y, 0); - } - } - } - - ibuf->userflags |= IB_BITMAPDIRTY; -} - -static void imapaint_image_update(Image *image, ImBuf *ibuf, short texpaint) -{ - if(ibuf->rect_float) - imb_freerectImBuf(ibuf); /* force recreate of char rect */ - if(ibuf->mipmap[0]) - imb_freemipmapImBuf(ibuf); - - /* todo: should set_tpage create ->rect? */ - if(texpaint || G.sima->lock) { - int w = imapaintpartial.x2 - imapaintpartial.x1; - int h = imapaintpartial.y2 - imapaintpartial.y1; - update_realtime_image(image, imapaintpartial.x1, imapaintpartial.y1, w, h); - } -} - -/* note; gets called for both 2d image paint and 3d texture paint. in the - latter case image may be NULL and G.sima may not exist */ -static void imapaint_redraw(int final, int texpaint, Image *image) -{ - if(final) { - if(texpaint) - allqueue(REDRAWIMAGE, 0); - else if(!G.sima->lock) { - if(image) - free_realtime_image(image); /* force OpenGL reload */ - allqueue(REDRAWVIEW3D, 0); - } - allqueue(REDRAWHEADERS, 0); - - if(!texpaint && image) { - /* after paint, tag Image or RenderResult nodes changed */ - if(G.scene->nodetree) { - imagepaint_composite_tags(G.scene->nodetree, image, &G.sima->iuser); - } - /* signal composite (hurmf, need an allqueue?) */ - if(G.sima->lock) { - ScrArea *sa; - for(sa=G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_NODE) { - if(((SpaceNode *)sa->spacedata.first)->treetype==NTREE_COMPOSIT) { - addqueue(sa->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - break; - } - } - } - } - } - } - else if(!texpaint && G.sima->lock) - force_draw_plus(SPACE_VIEW3D, 0); - else - force_draw(0); -} - -void imagepaint_undo() -{ - Image *ima= imapaintundo.image; - ImBuf *ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL); - int x, y, tile; - - if (!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) - return; - - for (tile = 0, y = 0; y < imapaintundo.ytiles; y++) - for (x = 0; x < imapaintundo.xtiles; x++, tile++) - if (imapaintundo.tiles[tile]) - imapaint_copy_tile(ibuf, tile, x, y, 1); - - free_realtime_image(ima); /* force OpenGL reload */ - if(ibuf->rect_float) - imb_freerectImBuf(ibuf); /* force recreate of char rect */ - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} - -void free_imagepaint() -{ - /* todo: does this need to be in the same places as editmode_undo_clear, - vertex paint isn't? */ - int i, size = imapaintundo.xtiles*imapaintundo.ytiles; - - if (imapaintundo.tiles) { - for (i = 0; i < size; i++) - if (imapaintundo.tiles[i]) - MEM_freeN(imapaintundo.tiles[i]); - MEM_freeN(imapaintundo.tiles); - } - if (imapaintundo.tilebuf) - IMB_freeImBuf(imapaintundo.tilebuf); - - memset(&imapaintundo, 0, sizeof(imapaintundo)); -} - -/* Image Paint Operations */ - -static void imapaint_ibuf_get_set_rgb(ImBuf *ibuf, int x, int y, short torus, short set, float *rgb) -{ - if (torus) { - x %= ibuf->x; - if (x < 0) x += ibuf->x; - y %= ibuf->y; - if (y < 0) y += ibuf->y; - } - - if (ibuf->rect_float) { - float *rrgbf = ibuf->rect_float + (ibuf->x*y + x)*4; - - if (set) IMAPAINT_FLOAT_RGB_COPY(rrgbf, rgb) - else IMAPAINT_FLOAT_RGB_COPY(rgb, rrgbf) - } - else { - char *rrgb = (char*)ibuf->rect + (ibuf->x*y + x)*4; - - if (set) IMAPAINT_FLOAT_RGB_TO_CHAR(rrgb, rgb) - else IMAPAINT_CHAR_RGB_TO_FLOAT(rgb, rrgb) - } -} - -static int imapaint_ibuf_add_if(ImBuf *ibuf, unsigned int x, unsigned int y, float *outrgb, short torus) -{ - float inrgb[3]; - - if ((x >= ibuf->x) || (y >= ibuf->y)) { - if (torus) imapaint_ibuf_get_set_rgb(ibuf, x, y, 1, 0, inrgb); - else return 0; - } - else imapaint_ibuf_get_set_rgb(ibuf, x, y, 0, 0, inrgb); - - outrgb[0] += inrgb[0]; - outrgb[1] += inrgb[1]; - outrgb[2] += inrgb[2]; - - return 1; -} - -static void imapaint_lift_soften(ImBuf *ibuf, ImBuf *ibufb, int *pos, short torus) -{ - int x, y, count, xi, yi, xo, yo; - int out_off[2], in_off[2], dim[2]; - float outrgb[3]; - - dim[0] = ibufb->x; - dim[1] = ibufb->y; - in_off[0] = pos[0]; - in_off[1] = pos[1]; - out_off[0] = out_off[1] = 0; - - if (!torus) { - IMB_rectclip(ibuf, ibufb, &in_off[0], &in_off[1], &out_off[0], - &out_off[1], &dim[0], &dim[1]); - - if ((dim[0] == 0) || (dim[1] == 0)) - return; - } - - for (y=0; y < dim[1]; y++) { - for (x=0; x < dim[0]; x++) { - /* get input pixel */ - xi = in_off[0] + x; - yi = in_off[1] + y; - - count = 1; - imapaint_ibuf_get_set_rgb(ibuf, xi, yi, torus, 0, outrgb); - - count += imapaint_ibuf_add_if(ibuf, xi-1, yi-1, outrgb, torus); - count += imapaint_ibuf_add_if(ibuf, xi-1, yi , outrgb, torus); - count += imapaint_ibuf_add_if(ibuf, xi-1, yi+1, outrgb, torus); - - count += imapaint_ibuf_add_if(ibuf, xi , yi-1, outrgb, torus); - count += imapaint_ibuf_add_if(ibuf, xi , yi+1, outrgb, torus); - - count += imapaint_ibuf_add_if(ibuf, xi+1, yi-1, outrgb, torus); - count += imapaint_ibuf_add_if(ibuf, xi+1, yi , outrgb, torus); - count += imapaint_ibuf_add_if(ibuf, xi+1, yi+1, outrgb, torus); - - outrgb[0] /= count; - outrgb[1] /= count; - outrgb[2] /= count; - - /* write into brush buffer */ - xo = out_off[0] + x; - yo = out_off[1] + y; - imapaint_ibuf_get_set_rgb(ibufb, xo, yo, 0, 1, outrgb); - } - } -} - -static void imapaint_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos) -{ - IMB_rectblend_torus(ibufb, ibuf, 0, 0, pos[0], pos[1], - ibufb->x, ibufb->y, IMB_BLEND_COPY_RGB); -} - -static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos) -{ - /* note: allocImbuf returns zero'd memory, so regions outside image will - have zero alpha, and hence not be blended onto the image */ - int w=ibufb->x, h=ibufb->y, destx=0, desty=0, srcx=pos[0], srcy=pos[1]; - ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags, 0); - - IMB_rectclip(clonebuf, ibuf, &destx, &desty, &srcx, &srcy, &w, &h); - IMB_rectblend(clonebuf, ibuf, destx, desty, srcx, srcy, w, h, - IMB_BLEND_COPY_RGB); - IMB_rectblend(clonebuf, ibufb, destx, desty, destx, desty, w, h, - IMB_BLEND_COPY_ALPHA); - - return clonebuf; -} - -static void imapaint_convert_brushco(ImBuf *ibufb, float *pos, int *ipos) -{ - ipos[0]= (int)(pos[0] - ibufb->x/2); - ipos[1]= (int)(pos[1] - ibufb->y/2); -} - -static int imapaint_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *pos) -{ - ImagePaintState *s= ((ImagePaintState*)state); - ImBuf *clonebuf= NULL; - short torus= s->brush->flag & BRUSH_TORUS; - short blend= s->blend; - float *offset= s->brush->clone.offset; - float liftpos[2]; - int bpos[2], blastpos[2], bliftpos[2]; - - imapaint_convert_brushco(ibufb, pos, bpos); - - /* lift from canvas */ - if(s->tool == PAINT_TOOL_SOFTEN) { - imapaint_lift_soften(s->canvas, ibufb, bpos, torus); - } - else if(s->tool == PAINT_TOOL_SMEAR) { - if (lastpos[0]==pos[0] && lastpos[1]==pos[1]) - return 0; - - imapaint_convert_brushco(ibufb, lastpos, blastpos); - imapaint_lift_smear(s->canvas, ibufb, blastpos); - } - else if(s->tool == PAINT_TOOL_CLONE && s->clonecanvas) { - liftpos[0]= pos[0] - offset[0]*s->canvas->x; - liftpos[1]= pos[1] - offset[1]*s->canvas->y; - - imapaint_convert_brushco(ibufb, liftpos, bliftpos); - clonebuf= imapaint_lift_clone(s->clonecanvas, ibufb, bliftpos); - } - - imapaint_dirty_region(s->image, s->canvas, bpos[0], bpos[1], ibufb->x, ibufb->y); - - /* blend into canvas */ - if(torus) - IMB_rectblend_torus(s->canvas, (clonebuf)? clonebuf: ibufb, - bpos[0], bpos[1], 0, 0, ibufb->x, ibufb->y, blend); - else - IMB_rectblend(s->canvas, (clonebuf)? clonebuf: ibufb, - bpos[0], bpos[1], 0, 0, ibufb->x, ibufb->y, blend); - - if(clonebuf) IMB_freeImBuf(clonebuf); - - return 1; -} - -/* 2D ImagePaint */ - -static void imapaint_compute_uvco(short *mval, float *uv) -{ - areamouseco_to_ipoco(G.v2d, mval, &uv[0], &uv[1]); -} - -/* 3D TexturePaint */ - -int facesel_face_pick(Mesh *me, short *mval, unsigned int *index, short rect); -void texpaint_pick_uv(Object *ob, Mesh *mesh, unsigned int faceindex, short *xy, float *mousepos); - -static int texpaint_break_stroke(float *prevuv, float *fwuv, float *bkuv, float *uv) -{ - float d1[2], d2[2]; - float mismatch = Vec2Lenf(fwuv, uv); - float len1 = Vec2Lenf(prevuv, fwuv); - float len2 = Vec2Lenf(bkuv, uv); - - Vec2Subf(d1, fwuv, prevuv); - Vec2Subf(d2, uv, bkuv); - - return ((Inp2f(d1, d2) < 0.0f) || (mismatch > MAX2(len1, len2)*2)); -} - -/* ImagePaint Common */ - -static int imapaint_canvas_set(ImagePaintState *s, Image *ima) -{ - ImBuf *ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL); - - /* verify that we can paint and set canvas */ - if(ima->packedfile && ima->rr) { - s->warnpackedfile = ima->id.name + 2; - return 0; - } - else if(ibuf && ibuf->channels!=4) { - s->warnmultifile = ima->id.name + 2; - return 0; - } - else if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) - return 0; - - s->image= ima; - s->canvas= ibuf; - - /* set clone canvas */ - if(s->tool == PAINT_TOOL_CLONE) { - ima= s->brush->clone.image; - ibuf= BKE_image_get_ibuf(ima, G.sima?&G.sima->iuser:NULL); - - if(!ima || !ibuf || !(ibuf->rect || ibuf->rect_float)) - return 0; - - s->clonecanvas= ibuf; - - if(s->canvas->rect_float && !s->clonecanvas->rect_float) { - /* temporarily add float rect for cloning */ - IMB_float_from_rect(s->clonecanvas); - s->clonefreefloat= 1; - } - else if(!s->canvas->rect_float && !s->clonecanvas->rect) - IMB_rect_from_float(s->clonecanvas); - } - - return 1; -} - -static void imapaint_canvas_free(ImagePaintState *s) -{ - if (s->clonefreefloat) - imb_freerectfloatImBuf(s->clonecanvas); -} - -static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter, Image *image, short texpaint, float *uv, double time, int update, float pressure) -{ - ImBuf *ibuf= BKE_image_get_ibuf(image, G.sima?&G.sima->iuser:NULL); - float pos[2]; - - if(!ibuf) - return 0; - - pos[0] = uv[0]*ibuf->x; - pos[1] = uv[1]*ibuf->y; - - brush_painter_require_imbuf(painter, ((ibuf->rect_float)? 1: 0), 0, 0); - - if (brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s)) { - if (update) - imapaint_image_update(image, ibuf, texpaint); - return 1; - } - else return 0; -} - -static void imapaint_paint_stroke(ImagePaintState *s, BrushPainter *painter, short texpaint, short *prevmval, short *mval, double time, float pressure) -{ - Image *newimage = NULL; - float fwuv[2], bkuv[2], newuv[2]; - unsigned int newfaceindex; - int breakstroke = 0, redraw = 0; - - if (texpaint) { - - /* pick new face and image */ - if (facesel_face_pick(s->me, mval, &newfaceindex, 0)) { - ImBuf *ibuf; - - newimage = (Image*)((s->me->mtface+newfaceindex)->tpage); - ibuf= BKE_image_get_ibuf(newimage, G.sima?&G.sima->iuser:NULL); - - if(ibuf && ibuf->rect) - texpaint_pick_uv(s->ob, s->me, newfaceindex, mval, newuv); - else - newimage = NULL; - } - else - newuv[0] = newuv[1] = 0.0f; - - /* see if stroke is broken, and if so finish painting in old position */ - if (s->image) { - texpaint_pick_uv(s->ob, s->me, s->faceindex, mval, fwuv); - texpaint_pick_uv(s->ob, s->me, newfaceindex, prevmval, bkuv); - - if (newimage == s->image) - breakstroke= texpaint_break_stroke(s->uv, fwuv, bkuv, newuv); - else - breakstroke= 1; - } - else - fwuv[0]= fwuv[1]= 0.0f; - - if (breakstroke) { - texpaint_pick_uv(s->ob, s->me, s->faceindex, mval, fwuv); - redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint, - fwuv, time, 1, pressure); - imapaint_clear_partial_redraw(); - brush_painter_break_stroke(painter); - } - - /* set new canvas */ - if (newimage && (newimage != s->image)) - if (!imapaint_canvas_set(s, newimage)) - newimage = NULL; - - /* paint in new image */ - if (newimage) { - if (breakstroke) - redraw|= imapaint_paint_sub_stroke(s, painter, newimage, - texpaint, bkuv, time, 0, pressure); - redraw|= imapaint_paint_sub_stroke(s, painter, newimage, texpaint, - newuv, time, 1, pressure); - } - - /* update state */ - s->image = newimage; - s->faceindex = newfaceindex; - s->uv[0] = newuv[0]; - s->uv[1] = newuv[1]; - } - else { - imapaint_compute_uvco(mval, newuv); - redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint, newuv, - time, 1, pressure); - } - - if (redraw) { - imapaint_redraw(0, texpaint, NULL); - imapaint_clear_partial_redraw(); - } -} - -void imagepaint_paint(short mousebutton, short texpaint) -{ - ImagePaintState s; - BrushPainter *painter; - ToolSettings *settings= G.scene->toolsettings; - short prevmval[2], mval[2]; - double time; - float pressure; - - if(!settings->imapaint.brush) - return; - - /* initialize state */ - memset(&s, 0, sizeof(s)); - s.brush = settings->imapaint.brush; - s.tool = settings->imapaint.tool; - if(texpaint && (s.tool == PAINT_TOOL_CLONE)) - s.tool = PAINT_TOOL_DRAW; - s.blend = s.brush->blend; - - if(texpaint) { - s.ob = OBACT; - if (!s.ob || !(s.ob->lay & G.vd->lay)) return; - s.me = get_mesh(s.ob); - if (!s.me) return; - - persp(PERSP_VIEW); - } - else { - s.image = G.sima->image; - - if(!imapaint_canvas_set(&s, G.sima->image)) { - if(s.warnmultifile) - error("Image requires 4 color channels to paint"); - if(s.warnpackedfile) - error("Packed MultiLayer files cannot be painted"); - return; - } - } - - settings->imapaint.flag |= IMAGEPAINT_DRAWING; - free_imagepaint(); - - /* create painter and paint once */ - painter= brush_painter_new(s.brush); - - getmouseco_areawin(mval); - - pressure = get_pressure(); - s.blend = (get_activedevice() == 2)? BRUSH_BLEND_ERASE_ALPHA: s.brush->blend; - - time= PIL_check_seconds_timer(); - prevmval[0]= mval[0]; - prevmval[1]= mval[1]; - - /* special exception here for too high pressure values on first touch in - windows for some tablets */ - if (!((s.brush->flag & (BRUSH_ALPHA_PRESSURE|BRUSH_SIZE_PRESSURE| - BRUSH_SPACING_PRESSURE|BRUSH_RAD_PRESSURE)) && (get_activedevice() != 0) && (pressure >= 0.99f))) - imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure); - - /* paint loop */ - do { - getmouseco_areawin(mval); - - pressure = get_pressure(); - s.blend = (get_activedevice() == 2)? BRUSH_BLEND_ERASE_ALPHA: s.brush->blend; - - time= PIL_check_seconds_timer(); - - if((mval[0] != prevmval[0]) || (mval[1] != prevmval[1])) { - imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure); - prevmval[0]= mval[0]; - prevmval[1]= mval[1]; - } - else if (s.brush->flag & BRUSH_AIRBRUSH) - imapaint_paint_stroke(&s, painter, texpaint, prevmval, mval, time, pressure); - else - BIF_wait_for_statechange(); - - /* do mouse checking at the end, so don't check twice, and potentially - miss a short tap */ - } while(get_mbut() & mousebutton); - - /* clean up */ - settings->imapaint.flag &= ~IMAGEPAINT_DRAWING; - imapaint_canvas_free(&s); - brush_painter_free(painter); - - imapaint_redraw(1, texpaint, s.image); - - if (texpaint) { - if (s.warnmultifile) - error("Image requires 4 color channels to paint: %s", s.warnmultifile); - if(s.warnpackedfile) - error("Packed MultiLayer files cannot be painted %s", s.warnpackedfile); - - persp(PERSP_WIN); - } -} - -void imagepaint_pick(short mousebutton) -{ - ToolSettings *settings= G.scene->toolsettings; - Brush *brush= settings->imapaint.brush; - - if(brush && (settings->imapaint.tool == PAINT_TOOL_CLONE)) { - if(brush->clone.image) { - short prevmval[2], mval[2]; - float lastmousepos[2], mousepos[2]; - - getmouseco_areawin(prevmval); - - while(get_mbut() & mousebutton) { - getmouseco_areawin(mval); - - if((prevmval[0] != mval[0]) || (prevmval[1] != mval[1]) ) { - /* mouse moved, so move the clone image */ - imapaint_compute_uvco(prevmval, lastmousepos); - imapaint_compute_uvco(mval, mousepos); - - brush->clone.offset[0] += mousepos[0] - lastmousepos[0]; - brush->clone.offset[1] += mousepos[1] - lastmousepos[1]; - - force_draw(0); - - prevmval[0]= mval[0]; - prevmval[1]= mval[1]; - } - } - } - } - else if(brush) - sample_vpaint(); -} - diff --git a/source/blender/src/imasel.c b/source/blender/src/imasel.c deleted file mode 100644 index 78fc3f1be2a..00000000000 --- a/source/blender/src/imasel.c +++ /dev/null @@ -1,85 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include "BLI_winstuff.h" -#include -#include -#endif -#include -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_imasel.h" -#include "BIF_filelist.h" -#include "BIF_space.h" -#include "BIF_screen.h" - -#include "blendef.h" -#include "mydevice.h" - - -void free_imasel(SpaceImaSel *simasel) -{ - /* do not free imasel itself */ - if(simasel->files) { - BIF_filelist_freelib(simasel->files); - BIF_filelist_free(simasel->files); - MEM_freeN(simasel->files); - simasel->files = NULL; - } - if (simasel->img) { - IMB_freeImBuf(simasel->img); - } - if(simasel->pupmenu) { - MEM_freeN(simasel->pupmenu); - simasel->pupmenu = NULL; - } -} - diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c deleted file mode 100644 index a17e488ef13..00000000000 --- a/source/blender/src/interface.c +++ /dev/null @@ -1,6699 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt - - */ - - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BMF_Api.h" -#include "BIF_language.h" -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif // INTERNATIONAL - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_color_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vec_types.h" -#include "DNA_object_types.h" -#include "DNA_texture_types.h" -#include "DNA_vfont_types.h" - -#include "BKE_blender.h" -#include "BKE_colortools.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BIF_cursors.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_editfont.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_butspace.h" -#include "BIF_previewrender.h" - -#include "BSE_view.h" - -#include "BPY_extern.h" /* for BPY_button_eval */ - -#include "GHOST_Types.h" /* for tablet data */ - -#include "mydevice.h" -#include "interface.h" -#include "blendef.h" -#include "winlay.h" - -#define INSIDE_BLOCK 1 -#define INSIDE_PANEL_HEADER 2 -#define INSIDE_PANEL_SCALE 3 - -/* naming conventions: - * - * uiBlahBlah() external function - * ui_blah_blah() internal function - */ - -/***/ -/* ************ GLOBALS ************* */ - -float UIwinmat[4][4]; -static int UIlock= 0, UIafterval; -static char *UIlockstr=NULL; - -static void (*UIafterfunc_butm)(void *arg, int event); -static void (*UIafterfunc_but)(void *arg1, void *arg2); -static void *UIafterfunc_arg1, *UIafterfunc_arg2; - -static uiFont UIfont[UI_ARRAY]; // no init needed -uiBut *UIbuttip; - -static char but_copypaste_str[256]=""; -static double but_copypaste_val=0.0; -static float but_copypaste_rgb[3]; -static ColorBand but_copypaste_coba; - -/* ************* PROTOTYPES ***************** */ - -static void ui_set_but_val(uiBut *but, double value); -static void ui_do_but_tip(uiBut *buttip); - -/* ****************************** */ - -static int uibut_contains_pt(uiBut *but, short *pt) -{ - return ((but->x1x2>=pt[0]) && - (but->y1y2>=pt[1])); -} - -static void uibut_do_func(uiBut *but) -{ - if (but->func) { - but->func(but->func_arg1, but->func_arg2); - } -} - -/* ************* window matrix ************** */ - - -void ui_graphics_to_window(int win, float *x, float *y) /* for rectwrite */ -{ - float gx, gy; - int sx, sy; - int getsizex, getsizey; - - bwin_getsize(win, &getsizex, &getsizey); - bwin_getsuborigin(win, &sx, &sy); - - gx= *x; - gy= *y; - *x= ((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0])); - *y= ((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); -} - -void ui_graphics_to_window_rct(int win, rctf *graph, rcti *winr) -{ - float gx, gy; - int sx, sy; - int getsizex, getsizey; - - bwin_getsize(win, &getsizex, &getsizey); - bwin_getsuborigin(win, &sx, &sy); - - gx= graph->xmin; - gy= graph->ymin; - winr->xmin= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0])); - winr->ymin= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); - gx= graph->xmax; - gy= graph->ymax; - winr->xmax= (int)((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*UIwinmat[0][0]+ gy*UIwinmat[1][0]+ UIwinmat[3][0])); - winr->ymax= (int)((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*UIwinmat[0][1]+ gy*UIwinmat[1][1]+ UIwinmat[3][1])); -} - - -void ui_window_to_graphics(int win, float *x, float *y) /* for mouse cursor */ -{ - float a, b, c, d, e, f, px, py; - int getsizex, getsizey; - - bwin_getsize(win, &getsizex, &getsizey); - - a= .5*((float)getsizex)*UIwinmat[0][0]; - b= .5*((float)getsizex)*UIwinmat[1][0]; - c= .5*((float)getsizex)*(1.0+UIwinmat[3][0]); - - d= .5*((float)getsizey)*UIwinmat[0][1]; - e= .5*((float)getsizey)*UIwinmat[1][1]; - f= .5*((float)getsizey)*(1.0+UIwinmat[3][1]); - - px= *x; - py= *y; - - *y= (a*(py-f) + d*(c-px))/(a*e-d*b); - *x= (px- b*(*y)- c)/a; - -} - - -/* ************* SAVE UNDER ************ */ - -/* new method: - -OverDraw *ui_begin_overdraw(int minx, int miny, int maxx, int maxy); -- enforces mainwindow to become active -- grabs copy from frontbuffer, pastes in back - -void ui_flush_overdraw(OverDraw *od); -- copies backbuffer to front - -void ui_refresh_overdraw(Overdraw *od); -- pastes in back copy of frontbuffer again for fresh drawing - -void ui_end_overdraw(OverDraw *od); -- puts back on frontbuffer saved image -- frees copy -- sets back active blender area -- signals backbuffer to be corrupt (sel buffer!) - -*/ - -/* frontbuffer updates now glCopyPixels too, with block->flush rect */ - -/* new idea for frontbuffer updates: - -- hilites: with blended poly? - -- full updates... thats harder, but: - - copy original - - before draw, always paste to backbuf - - flush - - always end with redraw event for full update - -*/ - -static void myglCopyPixels(int a, int b, int c, int d, int e) -{ - if(G.rt==2) { - unsigned int *buf= MEM_mallocN(4*c*d, "temp glcopypixels"); - glReadPixels(a, b, c, d, GL_RGBA, GL_UNSIGNED_BYTE, buf); - glDrawPixels(c, d, GL_RGBA, GL_UNSIGNED_BYTE, buf); - MEM_freeN(buf); - } - else glCopyPixels(a, b, c, d, e); -} - -typedef struct { - short x, y, sx, sy, oldwin; - unsigned int *rect; -} uiOverDraw; - - -static uiOverDraw *ui_begin_overdraw(int minx, int miny, int maxx, int maxy) -{ - uiOverDraw *od=NULL; - - // dirty patch removed for sun and sgi to mywindow.c commented out - - /* clip with actual window size */ - if(minx < 0) minx= 0; - if(miny < 0) miny= 0; - if(maxx >= G.curscreen->sizex) maxx= G.curscreen->sizex-1; - if(maxy >= G.curscreen->sizey) maxy= G.curscreen->sizey-1; - - if(minxx= minx; - od->y= miny; - od->sx= maxx-minx; - od->sy= maxy-miny; - od->rect= MEM_mallocN(od->sx*od->sy*4, "temp_frontbuffer_image"); - - od->oldwin= mywinget(); - mywinset(G.curscreen->mainwin); - /* grab front */ - glReadBuffer(GL_FRONT); - glReadPixels(od->x, od->y, od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect); - glReadBuffer(GL_BACK); - /* paste in back */ - glDisable(GL_DITHER); - glRasterPos2f(od->x, od->y); - glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect); - glEnable(GL_DITHER); - } - - return od; -} - -static void ui_flush_overdraw(uiOverDraw *od) -{ - - if(od==NULL) return; - glDisable(GL_DITHER); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_FRONT); - glRasterPos2s(od->x, od->y); - myglCopyPixels(od->x, od->y, od->sx, od->sy, GL_COLOR); - glEnable(GL_DITHER); - bglFlush(); - glDrawBuffer(GL_BACK); -} - -/* special flush version to enable transparent menus */ -static void ui_block_flush_overdraw(uiBlock *block) -{ - - if(block->flag & UI_BLOCK_LOOP) { - char col[4]; - - BIF_GetThemeColor4ubv(TH_MENU_BACK, col); - if(col[3]!=255) { - uiBut *bt; - uiOverDraw *od= block->overdraw; - - /* completely draw all! */ - glRasterPos2s(od->x, od->y); - glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect); - - uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag); - for (bt= block->buttons.first; bt; bt= bt->next) { - ui_draw_but(bt); - } - } - } - - ui_flush_overdraw(block->overdraw); -} - -static void ui_end_overdraw(uiOverDraw *od) -{ - if(od==NULL) return; - - glDisable(GL_DITHER); - - // clear in back - glRasterPos2s(od->x, od->y); - glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect); - - // clear in front - glDrawBuffer(GL_FRONT); - glRasterPos2s(od->x, od->y); - glDrawPixels(od->sx, od->sy, GL_RGBA, GL_UNSIGNED_BYTE, od->rect); - - bglFlush(); - glDrawBuffer(GL_BACK); - glEnable(GL_DITHER); - - if(od->oldwin) mywinset(od->oldwin); - - MEM_freeN(od->rect); - MEM_freeN(od); - - markdirty_all_back(); // sets flags only -} - -/* ****************** live updates for hilites and button presses *********** */ - -void ui_block_flush_back(uiBlock *block) -{ - int minx, miny, sizex, sizey; - - /* note; this routine also has to work for block loop */ - if(block->needflush==0) return; - - /* exception, when we cannot use backbuffer for draw... */ - if(block->flag & UI_BLOCK_FRONTBUFFER) { - bglFlush(); - glDrawBuffer(GL_BACK); - block->needflush= 0; - return; - } - - /* copy pixels works on window coords, so we move to window space */ - - ui_graphics_to_window(block->win, &block->flush.xmin, &block->flush.ymin); - ui_graphics_to_window(block->win, &block->flush.xmax, &block->flush.ymax); - minx= floor(block->flush.xmin); - miny= floor(block->flush.ymin); - sizex= ceil(block->flush.xmax-block->flush.xmin); - sizey= ceil(block->flush.ymax-block->flush.ymin); - - if(sizex>0 && sizey>0) { - glPushMatrix(); - mywinset(G.curscreen->mainwin); - - glDisable(GL_DITHER); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_FRONT); - glRasterPos2i(minx, miny); -#ifdef __sun__ - myglCopyPixels(minx, miny+1, sizex, sizey, GL_COLOR); -#else - myglCopyPixels(minx, miny, sizex, sizey, GL_COLOR); -#endif - glEnable(GL_DITHER); - bglFlush(); - glDrawBuffer(GL_BACK); - - mywinset(block->win); - glPopMatrix(); - - markdirty_win_back(block->win); - } - - block->needflush= 0; -} - -/* merge info for live updates in frontbuf */ -void ui_block_set_flush(uiBlock *block, uiBut *but) -{ - /* clear signal */ - if(but==NULL) { - block->needflush= 0; - - block->flush.xmin= 0.0; - block->flush.xmax= 0.0; - } - else { - /* exception, when we cannot use backbuffer for draw... */ - if(block->flag & UI_BLOCK_FRONTBUFFER) { - glDrawBuffer(GL_FRONT); - } - else if(block->needflush==0) { - /* first rect */ - block->flush.xmin= but->x1; - block->flush.xmax= but->x2; - block->flush.ymin= but->y1; - block->flush.ymax= but->y2; - - } - else { - /* union of rects */ - if(block->flush.xmin > but->x1) block->flush.xmin= but->x1; - if(block->flush.xmax < but->x2) block->flush.xmax= but->x2; - if(block->flush.ymin > but->y1) block->flush.ymin= but->y1; - if(block->flush.ymax < but->y2) block->flush.ymax= but->y2; - } - - block->needflush= 1; - - } -} - -/* ******************* copy and paste ******************** */ - -/* c = copy, v = paste */ -/* return 1 when something changed */ -static int ui_but_copy_paste(uiBut *but, char mode) -{ - void *poin; - - if(mode=='v' && but->lock) return 0; - poin= but->poin; - - if ELEM3(but->type, NUM, NUMSLI, HSVSLI) { - - if(poin==NULL); - else if(mode=='c') { - but_copypaste_val= ui_get_but_val(but); - } - else { - ui_set_but_val(but, but_copypaste_val); - uibut_do_func(but); - ui_check_but(but); - return 1; - } - } - else if(but->type==COL) { - - if(poin==NULL); - else if(mode=='c') { - if(but->pointype==FLO) { - float *fp= (float *) poin; - but_copypaste_rgb[0]= fp[0]; - but_copypaste_rgb[1]= fp[1]; - but_copypaste_rgb[2]= fp[2]; - } - else if (but->pointype==CHA) { - char *cp= (char *) poin; - but_copypaste_rgb[0]= (float)(cp[0]/255.0); - but_copypaste_rgb[1]= (float)(cp[1]/255.0); - but_copypaste_rgb[2]= (float)(cp[2]/255.0); - } - - } - else { - if(but->pointype==FLO) { - float *fp= (float *) poin; - fp[0] = but_copypaste_rgb[0]; - fp[1] = but_copypaste_rgb[1]; - fp[2] = but_copypaste_rgb[2]; - return 1; - } - else if (but->pointype==CHA) { - char *cp= (char *) poin; - cp[0] = (char)(but_copypaste_rgb[0]*255.0); - cp[1] = (char)(but_copypaste_rgb[1]*255.0); - cp[2] = (char)(but_copypaste_rgb[2]*255.0); - - return 1; - } - - } - } - else if(but->type==TEX) { - if(poin==NULL); - else if(mode=='c') { - strncpy(but_copypaste_str, but->poin, but->max); - } - else { - char backstr[UI_MAX_DRAW_STR]; - /* give butfunc the original text too */ - /* feature used for bone renaming, channels, etc */ - if(but->func_arg2==NULL) { - strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR); - but->func_arg2= backstr; - } - strncpy(but->poin, but_copypaste_str, but->max); - uibut_do_func(but); - ui_check_but(but); - return 1; - } - } - else if(but->type==IDPOIN) { - if(mode=='c') { - ID *id= *but->idpoin_idpp; - if(id) strncpy(but_copypaste_str, id->name+2, 22); - } - else { - but->idpoin_func(but_copypaste_str, but->idpoin_idpp); - ui_check_but(but); - return 1; - } - } - else if(but->type==BUT_COLORBAND) { - if(mode=='c') { - if (!but->poin) { - return 0; - } - memcpy( &but_copypaste_coba, but->poin, sizeof(ColorBand) ); - } else { - if (but_copypaste_coba.tot==0) { - return 0; - } - if (!but->poin) { - but->poin= MEM_callocN( sizeof(ColorBand), "colorband"); - } - memcpy( but->poin, &but_copypaste_coba, sizeof(ColorBand) ); - return 1; - } - } - - return 0; -} - -/* ******************* block calc ************************* */ - -/* only for pulldowns */ -void uiTextBoundsBlock(uiBlock *block, int addval) -{ - uiBut *bt; - int i = 0, j, x1addval= 0, nextcol; - - bt= block->buttons.first; - while(bt) { - if(bt->type!=SEPR) { - int transopts= (U.transopts & USER_TR_BUTTONS); - if(bt->type==TEX || bt->type==IDPOIN) transopts= 0; - j= BIF_GetStringWidth(bt->font, bt->drawstr, transopts); - - if(j > i) i = j; - } - bt= bt->next; - } - - /* cope with multi collumns */ - bt= block->buttons.first; - while(bt) { - if(bt->next && bt->x1 < bt->next->x1) - nextcol= 1; - else nextcol= 0; - - bt->x1 = x1addval; - bt->x2 = bt->x1 + i + addval; - - ui_check_but(bt); // clips text again - - if(nextcol) - x1addval+= i + addval; - - bt= bt->next; - } -} - - -void uiBoundsBlock(uiBlock *block, int addval) -{ - uiBut *bt; - int xof; - - if(block->buttons.first==NULL) { - if(block->panel) { - block->minx= 0.0; block->maxx= block->panel->sizex; - block->miny= 0.0; block->maxy= block->panel->sizey; - } - } - else { - - block->minx= block->miny= 10000; - block->maxx= block->maxy= -10000; - - bt= block->buttons.first; - while(bt) { - if(bt->x1 < block->minx) block->minx= bt->x1; - if(bt->y1 < block->miny) block->miny= bt->y1; - - if(bt->x2 > block->maxx) block->maxx= bt->x2; - if(bt->y2 > block->maxy) block->maxy= bt->y2; - - bt= bt->next; - } - - block->minx -= addval; - block->miny -= addval; - block->maxx += addval; - block->maxy += addval; - } - - /* hardcoded exception... but that one is annoying with larger safety */ - bt= block->buttons.first; - if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10; - else xof= 40; - - block->safety.xmin= block->minx-xof; - block->safety.ymin= block->miny-xof; - block->safety.xmax= block->maxx+xof; - block->safety.ymax= block->maxy+xof; -} - -static void ui_positionblock(uiBlock *block, uiBut *but) -{ - /* position block relative to but */ - uiBut *bt; - rctf butrct; - float aspect; - int xsize, ysize, xof=0, yof=0, center; - short dir1= 0, dir2=0; - - /* first transform to screen coords, assuming matrix is stil OK */ - /* the UIwinmat is in panelspace */ - - butrct.xmin= but->x1; butrct.xmax= but->x2; - butrct.ymin= but->y1; butrct.ymax= but->y2; - - ui_graphics_to_window(block->win, &butrct.xmin, &butrct.ymin); - ui_graphics_to_window(block->win, &butrct.xmax, &butrct.ymax); - block->parentrct= butrct; // will use that for pulldowns later - - /* calc block rect */ - if(block->buttons.first) { - block->minx= block->miny= 10000; - block->maxx= block->maxy= -10000; - - bt= block->buttons.first; - while(bt) { - if(bt->x1 < block->minx) block->minx= bt->x1; - if(bt->y1 < block->miny) block->miny= bt->y1; - - if(bt->x2 > block->maxx) block->maxx= bt->x2; - if(bt->y2 > block->maxy) block->maxy= bt->y2; - - bt= bt->next; - } - } - else { - /* we're nice and allow empty blocks too */ - block->minx= block->miny= 0; - block->maxx= block->maxy= 20; - } - - aspect= (float)(block->maxx - block->minx + 4); - ui_graphics_to_window(block->win, &block->minx, &block->miny); - ui_graphics_to_window(block->win, &block->maxx, &block->maxy); - - //block->minx-= 2.0; block->miny-= 2.0; - //block->maxx+= 2.0; block->maxy+= 2.0; - - xsize= block->maxx - block->minx+4; // 4 for shadow - ysize= block->maxy - block->miny+4; - aspect/= (float)xsize; - - if(but) { - short left=0, right=0, top=0, down=0; - - if(block->direction & UI_CENTER) center= ysize/2; - else center= 0; - - if( butrct.xmin-xsize > 0.0) left= 1; - if( butrct.xmax+xsize < G.curscreen->sizex) right= 1; - if( butrct.ymin-ysize+center > 0.0) down= 1; - if( butrct.ymax+ysize-center < G.curscreen->sizey) top= 1; - - dir1= block->direction & UI_DIRECTION; - - /* secundary directions */ - if(dir1 & (UI_TOP|UI_DOWN)) { - if(dir1 & UI_LEFT) dir2= UI_LEFT; - else if(dir1 & UI_RIGHT) dir2= UI_RIGHT; - dir1 &= (UI_TOP|UI_DOWN); - } - - if(dir2==0) if(dir1==UI_LEFT || dir1==UI_RIGHT) dir2= UI_DOWN; - if(dir2==0) if(dir1==UI_TOP || dir1==UI_DOWN) dir2= UI_LEFT; - - /* no space at all? dont change */ - if(left || right) { - if(dir1==UI_LEFT && left==0) dir1= UI_RIGHT; - if(dir1==UI_RIGHT && right==0) dir1= UI_LEFT; - /* this is aligning, not append! */ - if(dir2==UI_LEFT && right==0) dir2= UI_RIGHT; - if(dir2==UI_RIGHT && left==0) dir2= UI_LEFT; - } - if(down || top) { - if(dir1==UI_TOP && top==0) dir1= UI_DOWN; - if(dir1==UI_DOWN && down==0) dir1= UI_TOP; - if(dir2==UI_TOP && top==0) dir2= UI_DOWN; - if(dir2==UI_DOWN && down==0) dir2= UI_TOP; - } - - if(dir1==UI_LEFT) { - xof= butrct.xmin - block->maxx; - if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center; - else yof= butrct.ymax - block->maxy+center; - } - else if(dir1==UI_RIGHT) { - xof= butrct.xmax - block->minx; - if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center; - else yof= butrct.ymax - block->maxy+center; - } - else if(dir1==UI_TOP) { - yof= butrct.ymax - block->miny; - if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx; - else xof= butrct.xmin - block->minx; - // changed direction? - if((dir1 & block->direction)==0) { - if(block->direction & UI_SHIFT_FLIPPED) - xof+= dir2==UI_LEFT?25:-25; - uiBlockFlipOrder(block); - } - } - else if(dir1==UI_DOWN) { - yof= butrct.ymin - block->maxy; - if(dir2==UI_RIGHT) xof= butrct.xmax - block->maxx; - else xof= butrct.xmin - block->minx; - // changed direction? - if((dir1 & block->direction)==0) { - if(block->direction & UI_SHIFT_FLIPPED) - xof+= dir2==UI_LEFT?25:-25; - uiBlockFlipOrder(block); - } - } - - /* and now we handle the exception; no space below or to top */ - if(top==0 && down==0) { - if(dir1==UI_LEFT || dir1==UI_RIGHT) { - // align with bottom of screen - yof= ysize; - } - } - - /* or no space left or right */ - if(left==0 && right==0) { - if(dir1==UI_TOP || dir1==UI_DOWN) { - // align with left size of screen - xof= -block->minx+5; - } - } - - // apply requested offset in the block - xof += block->xofs/block->aspect; - yof += block->yofs/block->aspect; - - } - - /* apply */ - - for(bt= block->buttons.first; bt; bt= bt->next) { - - ui_graphics_to_window(block->win, &bt->x1, &bt->y1); - ui_graphics_to_window(block->win, &bt->x2, &bt->y2); - - bt->x1 += xof; - bt->x2 += xof; - bt->y1 += yof; - bt->y2 += yof; - - bt->aspect= 1.0; - // ui_check_but recalculates drawstring size in pixels - ui_check_but(bt); - } - - block->minx += xof; - block->miny += yof; - block->maxx += xof; - block->maxy += yof; - - /* safety calculus */ - if(but) { - float midx= (block->parentrct.xmin+block->parentrct.xmax)/2.0; - float midy= (block->parentrct.ymin+block->parentrct.ymax)/2.0; - - /* when you are outside parent button, safety there should be smaller */ - - // parent button to left - if( midx < block->minx ) block->safety.xmin= block->minx-3; - else block->safety.xmin= block->minx-40; - // parent button to right - if( midx > block->maxx ) block->safety.xmax= block->maxx+3; - else block->safety.xmax= block->maxx+40; - - // parent button on bottom - if( midy < block->miny ) block->safety.ymin= block->miny-3; - else block->safety.ymin= block->miny-40; - // parent button on top - if( midy > block->maxy ) block->safety.ymax= block->maxy+3; - else block->safety.ymax= block->maxy+40; - - // exception for switched pulldowns... - if(dir1 && (dir1 & block->direction)==0) { - if(dir2==UI_RIGHT) block->safety.xmax= block->maxx+3; - if(dir2==UI_LEFT) block->safety.xmin= block->minx-3; - } - block->direction= dir1; - } - else { - block->safety.xmin= block->minx-40; - block->safety.ymin= block->miny-40; - block->safety.xmax= block->maxx+40; - block->safety.ymax= block->maxy+40; - } - -} - - -void ui_autofill(uiBlock *block) -{ - uiBut *but; - float *maxw, *maxh, startx = 0, starty, height = 0; - float totmaxh; - int rows=0, /* cols=0, */ i, lasti; - - /* first count rows */ - but= block->buttons.last; - rows= but->x1+1; - - /* calculate max width / height for each row */ - maxw= MEM_callocN(sizeof(float)*rows, "maxw"); - maxh= MEM_callocN(sizeof(float)*rows, "maxh"); - but= block->buttons.first; - while(but) { - i= but->x1; - if( maxh[i] < but->y2) maxh[i]= but->y2; - maxw[i] += but->x2; - but= but->next; - } - - totmaxh= 0.0; - for(i=0; imaxy; - but= block->buttons.first; - lasti= -1; - while(but) { - // signal for aligning code - but->flag |= UI_BUT_ALIGN_DOWN; - - i= but->x1; - - if(i!=lasti) { - startx= block->minx; - height= (maxh[i]*(block->maxy-block->miny))/totmaxh; - starty-= height; - lasti= i; - } - - but->y1= starty+but->aspect; - but->y2= but->y1+height-but->aspect; - - but->x2= (but->x2*(block->maxx-block->minx))/maxw[i]; - but->x1= startx+but->aspect; - - startx+= but->x2; - but->x2+= but->x1-but->aspect; - - ui_check_but(but); - - but= but->next; - } - - uiBlockEndAlign(block); - - MEM_freeN(maxw); MEM_freeN(maxh); - block->autofill= 0; -} - -/* ************** LINK LINE DRAWING ************* */ - -/* link line drawing is not part of buttons or theme.. so we stick with it here */ - -static void ui_draw_linkline(uiBut *but, uiLinkLine *line) -{ - float vec1[2], vec2[2]; - - if(line->from==NULL || line->to==NULL) return; - - vec1[0]= (line->from->x1+line->from->x2)/2.0; - vec1[1]= (line->from->y1+line->from->y2)/2.0; - vec2[0]= (line->to->x1+line->to->x2)/2.0; - vec2[1]= (line->to->y1+line->to->y2)/2.0; - - if(line->flag & UI_SELECT) BIF_ThemeColorShade(but->themecol, 80); - else glColor3ub(0,0,0); - fdrawline(vec1[0], vec1[1], vec2[0], vec2[1]); -} - -static void ui_draw_links(uiBlock *block) -{ - uiBut *but; - uiLinkLine *line; - - but= block->buttons.first; - while(but) { - if(but->type==LINK && but->link) { - line= but->link->lines.first; - while(line) { - ui_draw_linkline(but, line); - line= line->next; - } - } - but= but->next; - } -} - -/* ************** BLOCK DRAWING FUNCTION ************* */ - - -void uiDrawBlock(uiBlock *block) -{ - uiBut *but; - short testmouse=0, mouse[2]; - - /* we set this only once */ - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - /* handle pending stuff */ - if(block->autofill) ui_autofill(block); - if(block->minx==0.0 && block->maxx==0.0) uiBoundsBlock(block, 0); - if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block); - - /* we set active flag on a redraw again */ - if((block->flag & UI_BLOCK_LOOP)==0) { - testmouse= 1; - Mat4CpyMat4(UIwinmat, block->winmat); - } - - uiPanelPush(block); // panel matrix - - if(block->flag & UI_BLOCK_LOOP) { - uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag); - } - else { - if(block->panel) ui_draw_panel(block); - } - - if(block->drawextra) block->drawextra(curarea, block); - - if(testmouse) /* do it after panel push, otherwise coords are wrong */ - uiGetMouse(block->win, mouse); - - for (but= block->buttons.first; but; but= but->next) { - - if(testmouse && uibut_contains_pt(but, mouse)) - but->flag |= UI_ACTIVE; - - ui_draw_but(but); - } - - ui_draw_links(block); - - uiPanelPop(block); // matrix restored -} - -/* ************* MENUBUTS *********** */ - -typedef struct { - char *str; - int retval; - int icon; -} MenuEntry; - -typedef struct { - char *instr; - char *title; - int titleicon; - - MenuEntry *items; - int nitems, itemssize; -} MenuData; - -static MenuData *menudata_new(char *instr) { - MenuData *md= MEM_mallocN(sizeof(*md), "MenuData"); - - md->instr= instr; - md->title= NULL; - md->titleicon= 0; - md->items= NULL; - md->nitems= md->itemssize= 0; - - return md; -} - -static void menudata_set_title(MenuData *md, char *title, int titleicon) { - if (!md->title) - md->title= title; - if (!md->titleicon) - md->titleicon= titleicon; -} - -static void menudata_add_item(MenuData *md, char *str, int retval, int icon) { - if (md->nitems==md->itemssize) { - int nsize= md->itemssize?(md->itemssize<<1):1; - MenuEntry *oitems= md->items; - - md->items= MEM_mallocN(nsize*sizeof(*md->items), "md->items"); - if (oitems) { - memcpy(md->items, oitems, md->nitems*sizeof(*md->items)); - MEM_freeN(oitems); - } - - md->itemssize= nsize; - } - - md->items[md->nitems].str= str; - md->items[md->nitems].retval= retval; - md->items[md->nitems].icon= icon; - md->nitems++; -} - -static void menudata_free(MenuData *md) { - MEM_freeN(md->instr); - if (md->items) - MEM_freeN(md->items); - MEM_freeN(md); -} - - /** - * Parse menu description strings, string is of the - * form "[sss%t|]{(sss[%xNN]|), (%l|)}", ssss%t indicates the - * menu title, sss or sss%xNN indicates an option, - * if %xNN is given then NN is the return value if - * that option is selected otherwise the return value - * is the index of the option (starting with 1). %l - * indicates a seperator. - * - * @param str String to be parsed. - * @retval new menudata structure, free with menudata_free() - */ -static MenuData *decompose_menu_string(char *str) -{ - char *instr= BLI_strdup(str); - MenuData *md= menudata_new(instr); - char *nitem= NULL, *s= instr; - int nicon=0, nretval= 1, nitem_is_title= 0; - - while (1) { - char c= *s; - - if (c=='%') { - if (s[1]=='x') { - nretval= atoi(s+2); - - *s= '\0'; - s++; - } else if (s[1]=='t') { - nitem_is_title= 1; - - *s= '\0'; - s++; - } else if (s[1]=='l') { - nitem= "%l"; - s++; - } else if (s[1]=='i') { - nicon= atoi(s+2); - - *s= '\0'; - s++; - } - } else if (c=='|' || c=='\0') { - if (nitem) { - *s= '\0'; - - if (nitem_is_title) { - menudata_set_title(md, nitem, nicon); - nitem_is_title= 0; - } else { - /* prevent separator to get a value */ - if(nitem[0]=='%' && nitem[1]=='l') - menudata_add_item(md, nitem, -1, nicon); - else - menudata_add_item(md, nitem, nretval, nicon); - nretval= md->nitems+1; - } - - nitem= NULL; - nicon= 0; - } - - if (c=='\0') - break; - } else if (!nitem) - nitem= s; - - s++; - } - - return md; -} - -static void ui_set_name_menu(uiBut *but, int value) -{ - MenuData *md; - int i; - - md= decompose_menu_string(but->str); - for (i=0; initems; i++) - if (md->items[i].retval==value) - strcpy(but->drawstr, md->items[i].str); - - menudata_free(md); -} - -static void ui_warp_pointer(short x, short y) -{ - /* OSX has very poor mousewarp support, it sends events; - this causes a menu being pressed immediately ... */ - #ifndef __APPLE__ - warp_pointer(x, y); - #endif -} - -#define TBOXH 20 -static int ui_do_but_MENU(uiBut *but) -{ - uiBlock *block; - uiBut *bt; - ListBase listb={NULL, NULL}, lb; - double fvalue; - int width, height=0, a, xmax, starty; - short startx; - int columns=1, rows=0, boxh, event; - short x1, y1, active= -1; - short mval[2]; - MenuData *md; - - but->flag |= UI_SELECT; - ui_draw_but(but); - ui_block_flush_back(but->block); // flush because this button creates own blocks loop - - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - block->themecol= TH_MENU_ITEM; - - md= decompose_menu_string(but->str); - - /* columns and row calculation */ - columns= (md->nitems+20)/20; - if (columns<1) columns= 1; - - if(columns>8) columns= (md->nitems+25)/25; - - rows= (int) md->nitems/columns; - if (rows<1) rows= 1; - - while (rows*columnsnitems) rows++; - - /* prevent scaling up of pupmenu */ - if (but->aspect < 1.0f) but->aspect = 1.0f; - - /* size and location */ - if(md->title) - width= 1.5*but->aspect*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS)); - else - width= 0; - - for(a=0; anitems; a++) { - xmax= but->aspect*BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS)); - if ( md->items[a].icon) xmax += 20*but->aspect; - if(xmax>width) width= xmax; - } - - width+= 10; - if (width < (but->x2 - but->x1)) width = (but->x2 - but->x1); - if (width<50) width=50; - - boxh= TBOXH; - - height= rows*boxh; - if (md->title) height+= boxh; - - getmouseco_sc(mval); - - /* find active item */ - fvalue= ui_get_but_val(but); - for(active=0; activenitems; active++) { - if( md->items[active].retval== (int)fvalue ) break; - } - /* no active item? */ - if(active==md->nitems) { - if(md->title) active= -1; - else active= 0; - } - - /* for now disabled... works confusing because you think it's a title or so.... */ - active= -1; - - /* here we go! */ - startx= but->x1; - starty= but->y1; - - if(md->title) { - uiBut *bt; - uiSetCurFont(block, block->font+1); - if (md->titleicon) { - uiDefIconTextBut(block, LABEL, 0, md->titleicon, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); - } else { - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); - bt->flag= UI_TEXT_LEFT; - } - uiSetCurFont(block, block->font); - - } - - for(a=0; anitems; a++) { - - x1= but->x1 + width*((int)(md->nitems-a-1)/rows); - y1= but->y1 - boxh*(rows - ((md->nitems - a - 1)%rows)) + (rows*boxh); - - if (strcmp(md->items[md->nitems-a-1].str, "%l")==0) { - uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, ""); - } - else if(md->items[md->nitems-a-1].icon) { - uiBut *bt= uiDefIconTextBut(block, BUTM|but->pointype, but->retval, md->items[md->nitems-a-1].icon ,md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), but->poin, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, ""); - if(active==a) bt->flag |= UI_ACTIVE; - } - else { - uiBut *bt= uiDefBut(block, BUTM|but->pointype, but->retval, md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), but->poin, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, ""); - if(active==a) bt->flag |= UI_ACTIVE; - } - } - - /* the code up here has flipped locations, because of change of preferred order */ - /* thats why we have to switch list order too, to make arrowkeys work */ - - lb.first= lb.last= NULL; - bt= block->buttons.first; - while(bt) { - uiBut *next= bt->next; - BLI_remlink(&block->buttons, bt); - BLI_addhead(&lb, bt); - bt= next; - } - block->buttons= lb; - - /* and lets go */ - block->direction= UI_TOP; - ui_positionblock(block, but); - - /* blocks can come (and get scaled) from a normal window, now we go to screenspace */ - block->win= G.curscreen->mainwin; - for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win; - bwin_getsinglematrix(block->win, block->winmat); - - event= uiDoBlocks(&listb, 0, 1); - - menudata_free(md); - - but->flag &= ~UI_SELECT; - ui_check_but(but); - /* no draw of button now, for floating panels the matrix now is invalid... - the button still is active, and will be redrawn in main loop to de-activate it */ - /* but, if no hilites, we send redraw to queue */ - if(but->flag & UI_NO_HILITE) - addqueue(but->block->winq, REDRAW, 1); - - uibut_do_func(but); - - /* return no existing event, because the menu sends events instead */ - return -1; -} - -/* ********************** NEXT/PREV for arrowkeys etc ************** */ - -static uiBut *ui_but_prev(uiBut *but) -{ - while(but->prev) { - but= but->prev; - if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but; - } - return NULL; -} - -static uiBut *ui_but_next(uiBut *but) -{ - while(but->next) { - but= but->next; - if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but; - } - return NULL; -} - -static uiBut *ui_but_first(uiBlock *block) -{ - uiBut *but; - - but= block->buttons.first; - while(but) { - if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but; - but= but->next; - } - return NULL; -} - -static uiBut *ui_but_last(uiBlock *block) -{ - uiBut *but; - - but= block->buttons.last; - while(but) { - if(but->type!=LABEL && but->type!=SEPR && but->type!=ROUNDBOX) return but; - but= but->prev; - } - return NULL; -} - - -/* ************* IN-BUTTON TEXT SELECTION/EDITING ************* */ - -static short ui_delete_selection_edittext(uiBut *but) -{ - int x; - short deletedwidth=0; - char *str; - - str= (char *)but->poin; - - deletedwidth = (but->selend - but->selsta); - - for(x=0; x< strlen(str); x++) { - if (but->selend + x <= strlen(str) ) { - str[but->selsta + x]= str[but->selend + x]; - } else { - str[but->selsta + x]= '\0'; - break; - } - } - but->pos = but->selend = but->selsta; - - return deletedwidth; -} - -static void ui_set_cursor_pos_edittext(uiBut *but, short sx) -{ - char backstr[UI_MAX_DRAW_STR]; - - BLI_strncpy(backstr, but->drawstr, UI_MAX_DRAW_STR); - but->pos= strlen(backstr)-but->ofs; - - while((but->aspect*BIF_GetStringWidth(but->font, backstr+but->ofs, 0) + but->x1) > sx) { - if (but->pos <= 0) break; - but->pos--; - backstr[but->pos+but->ofs] = 0; - } - - but->pos -= strlen(but->str); - but->pos += but->ofs; - if(but->pos<0) but->pos= 0; -} - - -/* ************* EVENTS ************* */ - -void uiGetMouse(int win, short *adr) -{ - int x, y; - float xwin, ywin; - - getmouseco_sc(adr); - if (win == G.curscreen->mainwin) return; - - bwin_getsuborigin(win, &x, &y); - - adr[0]-= x; - adr[1]-= y; - - xwin= adr[0]; - ywin= adr[1]; - - ui_window_to_graphics(win, &xwin, &ywin); - - adr[0]= (short)(xwin+0.5); - adr[1]= (short)(ywin+0.5); -} - -static void ui_is_but_sel(uiBut *but) -{ - double value; - int lvalue; - short push=0, true=1; - - value= ui_get_but_val(but); - - if( but->type==TOGN || but->type==ICONTOGN) true= 0; - - if( but->bit ) { - lvalue= (int)value; - if( BTST(lvalue, (but->bitnr)) ) push= true; - else push= !true; - } - else { - switch(but->type) { - case BUT: - push= 0; - break; - case KEYEVT: - if (value==-1) push= 1; - break; - case TOG: - case TOGR: - case TOG3: - case BUT_TOGDUAL: - case ICONTOG: - if(value!=but->min) push= 1; - break; - case ICONTOGN: - case TOGN: - if(value==0.0) push= 1; - break; - case ROW: - if(value == but->max) push= 1; - break; - case COL: - push= 1; - break; - default: - push= 2; - break; - } - } - - if(push==2); - else if(push==1) but->flag |= UI_SELECT; - else but->flag &= ~UI_SELECT; -} - -static int ui_do_but_BUT(uiBut *but) -{ - int activated; - - do { - int oflag= but->flag; - short mval[2]; - - uiGetMouse(mywinget(), mval); - - if (uibut_contains_pt(but, mval)) - but->flag |= UI_SELECT; - else - but->flag &= ~UI_SELECT; - - if (but->flag != oflag) { - ui_draw_but(but); - ui_block_flush_back(but->block); - } - - PIL_sleep_ms(10); - } while (get_mbut() & L_MOUSE); - - activated= (but->flag & UI_SELECT); - - if(activated) { - UIafterfunc_but= but->func; - UIafterfunc_arg1= but->func_arg1; - UIafterfunc_arg2= but->func_arg2; - /* no more uibut_do_func(but); this button calls fileselecting windows */ - } - - but->flag &= ~UI_SELECT; - ui_draw_but(but); - - return activated?but->retval:0; -} - -static int ui_do_but_KEYEVT(uiBut *but) -{ - unsigned short event= 0; - short val; - - /* flag for ui_check_but */ - ui_set_but_val(but, -1); - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - - do { - event= extern_qread(&val); - } while (!event || !val || ELEM(event, MOUSEX, MOUSEY)); - - if (!key_event_to_string(event)[0]) event= 0; - - ui_set_but_val(but, (double) event); - ui_check_but(but); - ui_draw_but(but); - - return (event!=0); -} - -static int ui_do_but_TOG(uiBlock *block, uiBut *but, int qual) -{ - uiBut *bt; - double value; - int w, lvalue, push; - - /* local hack... */ - if(but->type==BUT_TOGDUAL && qual==LR_CTRLKEY) { - if(but->pointype==SHO) - but->poin += 2; - else if(but->pointype==INT) - but->poin += 4; - } - - value= ui_get_but_val(but); - lvalue= (int)value; - - if(but->bit) { - w= BTST(lvalue, but->bitnr); - if(w) lvalue = BCLR(lvalue, but->bitnr); - else lvalue = BSET(lvalue, but->bitnr); - - if(but->type==TOGR) { - if( (get_qual() & LR_SHIFTKEY)==0 ) { - lvalue= 1<<(but->bitnr); - - ui_set_but_val(but, (double)lvalue); - - bt= block->buttons.first; - while(bt) { - if( bt!=but && bt->poin==but->poin ) { - ui_is_but_sel(bt); - ui_draw_but(bt); - } - bt= bt->next; - } - } - else { - if(lvalue==0) lvalue= 1<<(but->bitnr); - } - } - - ui_set_but_val(but, (double)lvalue); - if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but); - // no frontbuffer draw for this one - if(but->type==BUT_TOGDUAL); - else if((but->flag & UI_NO_HILITE)==0) ui_draw_but(but); - } - else { - - if(value==0.0) push= 1; - else push= 0; - - if(but->type==TOGN || but->type==ICONTOGN) push= !push; - ui_set_but_val(but, (double)push); - if(but->type==ICONTOG || but->type==ICONTOGN) ui_check_but(but); - // no frontbuffer draw for this one - if((but->flag & UI_NO_HILITE)==0) ui_draw_but(but); - } - - /* end local hack... */ - if(but->type==BUT_TOGDUAL && qual==LR_CTRLKEY) { - if(but->pointype==SHO) - but->poin -= 2; - else if(but->pointype==INT) - but->poin -= 4; - } - - /* no while loop...this button is used for viewmove */ - - uibut_do_func(but); - - return but->retval; -} - -static int ui_do_but_ROW(uiBlock *block, uiBut *but) -{ - uiBut *bt; - - ui_set_but_val(but, but->max); - ui_draw_but(but); - - bt= block->buttons.first; - while(bt) { - if( bt!=but && bt->type==ROW ) { - if(bt->min==but->min) { - ui_is_but_sel(bt); - ui_draw_but(bt); - } - } - bt= bt->next; - } - return but->retval; -} - -/* return 1 if char ch is special character otherwise - * it returns 0 */ -static short test_special_char(char ch) -{ - switch(ch) { - case '\\': - case '/': - case '~': - case '!': - case '@': - case '#': - case '$': - case '%': - case '^': - case '&': - case '*': - case '(': - case ')': - case '+': - case '=': - case '{': - case '}': - case '[': - case ']': - case ':': - case ';': - case '\'': - case '\"': - case '<': - case '>': - case ',': - case '.': - case '?': - case '_': - case '-': - case ' ': - return 1; - break; - default: - break; - } - return 0; -} - -static int ui_do_but_TEX(uiBut *but) -{ - unsigned short dev; - short x, y, mval[2], len=0, dodraw, selextend=0; - char *str, backstr[UI_MAX_DRAW_STR]; - short capturing, sx, sy, prevx; - - str= (char *)but->poin; - - but->flag |= UI_SELECT; - - uiGetMouse(mywinget(), mval); - - /* set cursor pos to the end of the text */ - but->pos = strlen(str); - but->selsta = 0; - but->selend = strlen(but->drawstr) - strlen(but->str); - - /* backup */ - BLI_strncpy(backstr, but->poin, UI_MAX_DRAW_STR); - - ui_draw_but(but); - ui_block_flush_back(but->block); - - while (get_mbut() & L_MOUSE) BIF_wait_for_statechange(); - len= strlen(str); - - but->min= 0.0; - - capturing = TRUE; - while(capturing) { - char ascii; - short val; - - dodraw= 0; - dev = extern_qread_ext(&val, &ascii); - - if(dev==INPUTCHANGE) break; - else if(get_mbut() & R_MOUSE) break; - else if(get_mbut() & L_MOUSE) { - uiGetMouse(mywinget(), mval); - sx = mval[0]; sy = mval[1]; - - if ((but->y1 <= sy) && (sy <= but->y2) && (but->x1 <= sx) && (sx <= but->x2)) { - ui_set_cursor_pos_edittext(but, mval[0]); - - but->selsta = but->selend = but->pos; - - /* drag text select */ - prevx= mval[0]; - while (get_mbut() & L_MOUSE) { - uiGetMouse(mywinget(), mval); - - if(prevx!=mval[0]) { - - if (mval[0] > sx) selextend = EXTEND_RIGHT; - else if (mval[0] < sx) selextend = EXTEND_LEFT; - - ui_set_cursor_pos_edittext(but, mval[0]); - - if (selextend == EXTEND_RIGHT) but->selend = but->pos; - if (selextend == EXTEND_LEFT) but->selsta = but->pos; - - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - } - PIL_sleep_ms(10); - } - dodraw= 1; - } else break; - } - else if(dev==ESCKEY) break; - else if(dev==MOUSEX) val= 0; - else if(dev==MOUSEY) val= 0; - - /* cut, copy, paste selected text */ - /* mainqread discards ascii values < 32, so can't do this cleanly within the if(ascii) block*/ - else if ( (val) && - ((G.qual & LR_COMMANDKEY) || (G.qual & LR_CTRLKEY)) && - ((dev==XKEY) || (dev==CKEY) || (dev==VKEY)) ) { - - - /* paste */ - if (dev==VKEY) { - /* paste over the current selection */ - if ((but->selend - but->selsta) > 0) { - len -= ui_delete_selection_edittext(but); - } - - for (y=0; ymax) { - for(x= but->max; x>but->pos; x--) - str[x]= str[x-1]; - str[but->pos]= but_copypaste_str[y]; - but->pos++; - len++; - str[len]= '\0'; - } - } - if (strlen(but_copypaste_str) > 0) dodraw= 1; - } - /* cut & copy */ - else if ( (dev==XKEY) || (dev==CKEY) ) { - /* copy the contents to the copypaste buffer */ - for(x= but->selsta; x <= but->selend; x++) { - if (x==but->selend) - but_copypaste_str[x] = '\0'; - else - but_copypaste_str[(x - but->selsta)] = str[x]; - } - - /* for cut only, delete the selection afterwards */ - if (dev==XKEY) { - if ((but->selend - but->selsta) > 0) { - len -= ui_delete_selection_edittext(but); - - if (len < 0) len = 0; - dodraw=1; - } - } - } - } - else if((ascii)){ - - if(len-(but->selend - but->selsta)+1 <= but->max) { - - /* type over the current selection */ - if ((but->selend - but->selsta) > 0) { - len -= ui_delete_selection_edittext(but); - } - - if(len < but->max) { - for(x= but->max; x>but->pos; x--) - str[x]= str[x-1]; - str[but->pos]= ascii; - but->pos++; - len++; - str[len]= '\0'; - dodraw= 1; - } - } - } - else if(val) { - - switch (dev) { - - case RIGHTARROWKEY: - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(G.qual & LR_SHIFTKEY) { - if (!selextend) { - selextend = EXTEND_RIGHT; - } - if (selextend == EXTEND_RIGHT) { - but->selend++; - if (but->selend > len) but->selend = len; - } else if (selextend == EXTEND_LEFT) { - but->selsta++; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - selextend = EXTEND_RIGHT; - } - } - } else { - but->selsta = but->pos = but->selend; - selextend = 0; - } - } else { - if(G.qual & LR_SHIFTKEY) { - /* make a selection, starting from the cursor position */ - but->selsta = but->pos; - - but->pos++; - if(but->pos>strlen(str)) but->pos= strlen(str); - - but->selend = but->pos; - } else if(G.qual & LR_CTRLKEY) { - /* jump betweenn special characters (/,\,_,-, etc.), - * look at function test_special_char() for complete - * list of special character, ctr -> */ - while(but->pos < len) { - but->pos++; - if(test_special_char(str[but->pos])) break; - } - } else { - but->pos++; - if(but->pos>strlen(str)) but->pos= strlen(str); - } - } - dodraw= 1; - break; - - case LEFTARROWKEY: - /* if there's a selection */ - if ((but->selend - but->selsta) > 0) { - /* extend the selection based on the first direction taken */ - if(G.qual & LR_SHIFTKEY) { - if (!selextend) { - selextend = EXTEND_LEFT; - } - if (selextend == EXTEND_LEFT) { - but->selsta--; - if (but->selsta < 0) but->selsta = 0; - } else if (selextend == EXTEND_RIGHT) { - but->selend--; - /* if the selection start has gone past the end, - * flip them so they're in sync again */ - if (but->selsta == but->selend) { - but->pos = but->selsta; - selextend = EXTEND_LEFT; - } - } - } else { - but->pos = but->selend = but->selsta; - selextend = 0; - } - } else { - if(G.qual & LR_SHIFTKEY) { - /* make a selection, starting from the cursor position */ - but->selend = but->pos; - - but->pos--; - if(but->pos<0) but->pos= 0; - - but->selsta = but->pos; - } else if(G.qual & LR_CTRLKEY) { - /* jump betweenn special characters (/,\,_,-, etc.), - * look at function test_special_char() for complete - * list of special character, ctr -> */ - while(but->pos > 0){ - but->pos--; - if(test_special_char(str[but->pos])) break; - } - } else { - if(but->pos>0) but->pos--; - } - } - dodraw= 1; - break; - - case DOWNARROWKEY: - case ENDKEY: - if(G.qual & LR_SHIFTKEY) { - but->selsta = but->pos; - but->selend = strlen(str); - selextend = EXTEND_RIGHT; - } else { - but->selsta = but->selend = but->pos= strlen(str); - } - dodraw= 1; - break; - - case UPARROWKEY: - case HOMEKEY: - if(G.qual & LR_SHIFTKEY) { - but->selend = but->pos; - but->selsta = 0; - selextend = EXTEND_LEFT; - } else { - but->selsta = but->selend = but->pos= 0; - } - dodraw= 1; - break; - - case PADENTER: - case RETKEY: - capturing = FALSE; - break; - - case DELKEY: - if ((but->selend - but->selsta) > 0) { - len -= ui_delete_selection_edittext(but); - - if (len < 0) len = 0; - dodraw=1; - } - else if(but->pos>=0 && but->pospos; x<=strlen(str); x++) - str[x]= str[x+1]; - str[--len]='\0'; - dodraw= 1; - } - break; - - case BACKSPACEKEY: - if(len!=0) { - if ((but->selend - but->selsta) > 0) { - len -= ui_delete_selection_edittext(but); - - if (len < 0) len = 0; - dodraw=1; - } - else if(get_qual() & LR_SHIFTKEY) { - str[0]= 0; - but->pos= 0; - len= 0; - dodraw= 1; - } - else if(but->pos>0) { - for(x=but->pos; x<=strlen(str); x++) - str[x-1]= str[x]; - but->pos--; - str[--len]='\0'; - dodraw= 1; - } - } - break; - - case TABKEY: - if(but->autocomplete_func) { - but->autocomplete_func(str, but->autofunc_arg); - but->pos= strlen(str); - len= but->pos; - dodraw= 1; - } - else capturing= FALSE; - - break; - } - } - - - if(dodraw) { - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - } - } - - if(dev==ESCKEY) strcpy(but->poin, backstr); - but->pos= -1; - but->flag &= ~UI_SELECT; - - if(dev!=ESCKEY) { - /* give butfunc the original text too */ - /* feature used for bone renaming, channels, etc */ - if(but->func_arg2==NULL) but->func_arg2= backstr; - uibut_do_func(but); - } - - ui_check_but(but); - ui_draw_but(but); - - if(dev==TABKEY) addqueue(but->win, G.qual?BUT_PREV:BUT_NEXT, 1); - - if(dev!=ESCKEY) return but->retval; - else return B_NOP; // prevent event to be passed on -} - - -static int ui_act_as_text_but(uiBut *but) -{ - void *but_func; - double value; - float min, max; - int temp, retval, textleft; - char str[UI_MAX_DRAW_STR], *point; - - /* this function is abused for tab-cycling */ - if(but->type==TEX) - return ui_do_but_TEX(but); - - value= ui_get_but_val(but); - if( but->pointype==FLO ) { - if(but->a2) { /* amount of digits defined */ - if(but->a2==1) sprintf(str, "%.1f", value); - else if(but->a2==2) sprintf(str, "%.2f", value); - else if(but->a2==3) sprintf(str, "%.3f", value); - else sprintf(str, "%.4f", value); - } - else sprintf(str, "%.3f", value); - } - else { - sprintf(str, "%d", (int)value); - } - /* store values before calling as text button */ - point= but->poin; - but->poin= str; - but_func= but->func; - but->func= NULL; - min= but->min; - max= but->max; - but->min= 0.0; - but->max= UI_MAX_DRAW_STR - 1; /* for py strings evaluation */ - temp= but->type; - but->type= TEX; - textleft= but->flag & UI_TEXT_LEFT; - but->flag |= UI_TEXT_LEFT; - ui_check_but(but); - - retval= ui_do_but_TEX(but); - - /* restore values */ - but->type= temp; - but->poin= point; - but->func= but_func; - but->min= min; - but->max= max; - if(textleft==0) but->flag &= ~UI_TEXT_LEFT; - - if(BPY_button_eval(str, &value)) { - /* Uncomment this if you want to see an error message (and annoy users) */ - /* error("Invalid Python expression, check console");*/ - value = 0.0f; /* Zero out value on error */ - - if(str[0]) - retval = 0; /* invalidate return value if eval failed, except when string was null */ - } - - if(but->pointype!=FLO) value= (int)value; - - if(valuemax) value= max; - - ui_set_but_val(but, value); - ui_check_but(but); - ui_draw_but(but); - - return retval; -} - -static int ui_do_but_NUM(uiBut *but) -{ - double value; - float deler, fstart, f, tempf, pressure; - int lvalue, temp, orig_x; /* , firsttime=1; */ - short retval=0, qual, sx, mval[2], pos=0; - - but->flag |= UI_SELECT; - ui_draw_but(but); - ui_block_flush_back(but->block); - - uiGetMouse(mywinget(), mval); - value= ui_get_but_val(but); - - sx= mval[0]; - orig_x = sx; /* Store so we can scale the rate of change by the dist the mouse is from its original xlocation */ - fstart= (value - but->min)/(but->max-but->min); - f= fstart; - - temp= (int)value; - tempf= value; - - if(get_qual() & LR_SHIFTKEY) { /* make it textbut */ - if( ui_act_as_text_but(but) ) retval= but->retval; - } - else { - retval= but->retval; - /* firsttime: this button can be approached with enter as well */ - - /* drag-lock - prevent unwanted scroll adjustments */ - /* change last value (now 3) to adjust threshold in pixels */ - while (get_mbut() & L_MOUSE & ( abs(mval[0]-sx) <= 3) ) { - uiGetMouse(mywinget(), mval); - } - sx = mval[0]; /* ignore mouse movement within drag-lock */ - - while (get_mbut() & L_MOUSE) { - qual= get_qual(); - pressure = get_pressure(); - - uiGetMouse(mywinget(), mval); - - deler= 500; - if( but->pointype!=FLO ) { - - if( (but->max-but->min)<100 ) deler= 200.0; - if( (but->max-but->min)<25 ) deler= 50.0; - } - - if(qual & LR_SHIFTKEY) deler*= 10.0; - if(qual & LR_ALTKEY) deler*= 20.0; - - /* de-sensitise based on tablet pressure */ - if (ELEM(get_activedevice(), DEV_STYLUS, DEV_ERASER)) deler /= pressure; - - if(mval[0] != sx) { - if( but->pointype==FLO && but->max-but->min > 11) { - /* non linear change in mouse input- good for high precicsion */ - f+= (((float)(mval[0]-sx))/deler) * (fabs(orig_x-mval[0])*0.002); - } else if ( but->pointype!=FLO && but->max-but->min > 129) { /* only scale large int buttons */ - /* non linear change in mouse input- good for high precicsionm ints need less fine tuning */ - f+= (((float)(mval[0]-sx))/deler) * (fabs(orig_x-mval[0])*0.004); - } else { - /*no scaling */ - f+= ((float)(mval[0]-sx))/deler ; - } - - if(f>1.0) f= 1.0; - if(f<0.0) f= 0.0; - sx= mval[0]; - tempf= ( but->min + f*(but->max-but->min)); - - if( but->pointype!=FLO ) { - - temp= floor(tempf+.5); - - if(tempf==but->min || tempf==but->max); - else if(qual & LR_CTRLKEY) { - if(qual & LR_SHIFTKEY) temp= 100*(temp/100); - else temp= 10*(temp/10); - } - if( temp>=but->min && temp<=but->max) { - - value= ui_get_but_val(but); - lvalue= (int)value; - - if(temp != lvalue ) { - pos= 1; - ui_set_but_val(but, (double)temp); - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - - uibut_do_func(but); - } - } - - } - else { - temp= 0; - if(qual & LR_CTRLKEY) { - if(qual & LR_SHIFTKEY) { - if(tempf==but->min || tempf==but->max); - else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf); - else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf); - else tempf= floor(tempf); - } - else { - if(tempf==but->min || tempf==but->max); - else if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf); - else if(but->max-but->min < 21.0) tempf= floor(tempf); - else tempf= 10.0*floor(tempf/10.0); - } - } - - if( tempf>=but->min && tempf<=but->max) { - value= ui_get_but_val(but); - - if(tempf != value ) { - pos= 1; - ui_set_but_val(but, tempf); - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - } - } - - } - } - BIF_wait_for_statechange(); - } - - /* click on the side arrows to increment/decrement, click inside - * to edit the value directly */ - if(pos==0) { /* plus 1 or minus 1 */ - if( but->pointype!=FLO ) { - - if(sx < (but->x1 + (but->x2 - but->x1)/3 - 3)) { - temp--; - if( temp>=but->min && temp<=but->max) ui_set_but_val(but, (double)temp); - } - else if(sx > (but->x1 + (2*(but->x2 - but->x1)/3) + 3)) { - temp++; - if( temp>=but->min && temp<=but->max) ui_set_but_val(but, (double)temp); - } - else { - if( ui_act_as_text_but(but) ); else retval= 0; - } - } - else { - - if(sx < (but->x1 + (but->x2 - but->x1)/3 - 3)) { - tempf-= 0.01*but->a1; - if (tempf < but->min) tempf = but->min; - ui_set_but_val(but, tempf); - } - else if(sx > but->x1 + (2*((but->x2 - but->x1)/3) + 3)) { - tempf+= 0.01*but->a1; - if (tempf < but->min) tempf = but->min; - ui_set_but_val(but, tempf); - } - else { - if( ui_act_as_text_but(but) ); else retval= 0; - } - } - } - } - - but->flag &= ~UI_SELECT; - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - - uibut_do_func(but); - - return retval; -} - -static int ui_do_but_TOG3(uiBut *but) -{ - - if( but->pointype==SHO ) { - short *sp= (short *)but->poin; - - if( BTST(sp[1], but->bitnr)) { - sp[1]= BCLR(sp[1], but->bitnr); - sp[0]= BCLR(sp[0], but->bitnr); - } - else if( BTST(sp[0], but->bitnr)) { - sp[1]= BSET(sp[1], but->bitnr); - } else { - sp[0]= BSET(sp[0], but->bitnr); - } - } - else { - if( BTST(*(but->poin+2), but->bitnr)) { - *(but->poin+2)= BCLR(*(but->poin+2), but->bitnr); - *(but->poin)= BCLR(*(but->poin), but->bitnr); - } - else if( BTST(*(but->poin), but->bitnr)) { - *(but->poin+2)= BSET(*(but->poin+2), but->bitnr); - } else { - *(but->poin)= BSET(*(but->poin), but->bitnr); - } - } - - ui_is_but_sel(but); - ui_draw_but(but); - - return but->retval; -} - -static int ui_do_but_ICONROW(uiBut *but) -{ - ListBase listb= {NULL, NULL}; - uiBlock *block; - int a; - - but->flag |= UI_SELECT; - ui_draw_but(but); - ui_block_flush_back(but->block); // flush because this button creates own blocks loop - - /* here we go! */ - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - block->themecol= TH_MENU_ITEM; - - for(a=(int)but->min; a<=(int)but->max; a++) { - uiDefIconBut(block, BUTM|but->pointype, but->retval, but->icon+(a-but->min), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, but->poin, (float)a, 0.0, 0, 0, ""); - } - block->direction= UI_TOP; - ui_positionblock(block, but); - - /* the block is made with but-win, but is handled in mainwin space... - this is needs better implementation */ - block->win= G.curscreen->mainwin; - - uiDoBlocks(&listb, 0, 1); - - but->flag &= ~UI_SELECT; - ui_check_but(but); - ui_draw_but(but); - - return but->retval; -} - -static int ui_do_but_ICONTEXTROW(uiBut *but) -{ - uiBlock *block; - ListBase listb={NULL, NULL}; - int width, a, xmax, ypos; - MenuData *md; - - but->flag |= UI_SELECT; - ui_draw_but(but); - ui_block_flush_back(but->block); // flush because this button creates own blocks loop - - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, but->win); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - block->themecol= TH_MENU_ITEM; - - md= decompose_menu_string(but->str); - - /* size and location */ - /* expand menu width to fit labels */ - if(md->title) - width= 2*strlen(md->title)+BIF_GetStringWidth(block->curfont, md->title, (U.transopts & USER_TR_MENUS)); - else - width= 0; - - for(a=0; anitems; a++) { - xmax= BIF_GetStringWidth(block->curfont, md->items[a].str, (U.transopts & USER_TR_MENUS)); - if(xmax>width) width= xmax; - } - - width+= 30; - if (width<50) width=50; - - ypos = 1; - - /* loop through the menu options and draw them out with icons & text labels */ - for(a=0; anitems; a++) { - - /* add a space if there's a separator (%l) */ - if (strcmp(md->items[a].str, "%l")==0) { - ypos +=3; - } - else { - uiDefIconTextBut(block, BUTM|but->pointype, but->retval, (short)((but->icon)+(md->items[a].retval-but->min)), md->items[a].str, 0, ypos,(short)width, 19, but->poin, (float) md->items[a].retval, 0.0, 0, 0, ""); - ypos += 20; - } - } - - if(md->title) { - uiBut *bt; - uiSetCurFont(block, block->font+1); - bt= uiDefBut(block, LABEL, 0, md->title, 0, ypos, (short)width, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiSetCurFont(block, block->font); - bt->flag= UI_TEXT_LEFT; - } - - block->direction= UI_TOP; - ui_positionblock(block, but); - - /* the block is made with but-win, but is handled in mainwin space... - this is needs better implementation */ - block->win= G.curscreen->mainwin; - - uiBoundsBlock(block, 3); - - uiDoBlocks(&listb, 0, 1); - - menudata_free(md); - - but->flag &= ~UI_SELECT; - ui_check_but(but); - ui_draw_but(but); - - uibut_do_func(but); - - return but->retval; - -} - -static int ui_do_but_IDPOIN(uiBut *but) -{ - char str[UI_MAX_DRAW_STR]; - ID *id; - - id= *but->idpoin_idpp; - if(id) strcpy(str, id->name+2); - else str[0]= 0; - - but->type= TEX; - but->poin= str; - but->min= 0.0; - but->max= 22.0; - ui_check_but(but); - ui_do_but_TEX(but); - but->poin= NULL; - but->type= IDPOIN; - - but->idpoin_func(str, but->idpoin_idpp); - ui_check_but(but); - ui_draw_but(but); - - return but->retval; -} - -static int ui_do_but_SLI(uiBut *but) -{ - float f, fstart, tempf = 0.0, deler, value; - int sx, h, temp, pos=0, lvalue, redraw; - short mval[2], qual; - - value= ui_get_but_val(but); - uiGetMouse(mywinget(), mval); - - sx= mval[0]; - h= but->y2-but->y1; - fstart= but->max-but->min; - fstart= (value - but->min)/fstart; - temp= 32767; - - if( but->type==NUMSLI) deler= ( (but->x2-but->x1)/2 - 5.0*but->aspect); - else if( but->type==HSVSLI) deler= ( (but->x2-but->x1)/2 - 5.0*but->aspect); - else deler= (but->x2-but->x1- 5.0*but->aspect); - - - while (get_mbut() & L_MOUSE) { - - qual= get_qual(); - uiGetMouse(mywinget(), mval); - - f= (float)(mval[0]-sx)/deler +fstart; - - if (qual & LR_SHIFTKEY) { - f= (f-fstart)/10.0 + fstart; - } - - CLAMP(f, 0.0, 1.0); - tempf= but->min+f*(but->max-but->min); - temp= floor(tempf+.5); - - if(qual & LR_CTRLKEY) { - if(tempf==but->min || tempf==but->max); - else if( but->pointype==FLO ) { - - if(qual & LR_SHIFTKEY) { - if(tempf==but->min || tempf==but->max); - else if(but->max-but->min < 2.10) tempf= 0.01*floor(100.0*tempf); - else if(but->max-but->min < 21.0) tempf= 0.1*floor(10.0*tempf); - else tempf= floor(tempf); - } - else { - if(but->max-but->min < 2.10) tempf= 0.1*floor(10*tempf); - else if(but->max-but->min < 21.0) tempf= floor(tempf); - else tempf= 10.0*floor(tempf/10.0); - } - } - else { - temp= 10*(temp/10); - tempf= temp; - } - } - - value= ui_get_but_val(but); - lvalue= floor(value+0.5); - - if( but->pointype!=FLO ) - redraw= (temp != lvalue); - else - redraw= (tempf != value); - - if (redraw) { - pos= 1; - ui_set_but_val(but, tempf); - ui_check_but(but); - ui_draw_but(but); - ui_block_flush_back(but->block); - - if(but->a1) { /* color number */ - uiBut *bt= but->prev; - while(bt) { - if(bt->a2 == but->a1) ui_draw_but(bt); - bt= bt->prev; - } - bt= but->next; - while(bt) { - if(bt->a2 == but->a1) ui_draw_but(bt); - bt= bt->next; - } - } - /* save current window matrix (global UIwinmat) - because button callback function MIGHT change it - - which has until now occured through the Python API - */ - /* This is really not possible atm... nothing in Blender - supports such functionality even now. Calling function - callbacks while using a button screws up the UI (ton) - */ - /* Mat4CpyMat4(curmatrix, UIwinmat); - uibut_do_func(but); - Mat4CpyMat4(UIwinmat, curmatrix); */ - } - else BIF_wait_for_statechange(); - } - - - if(temp!=32767 && pos==0) { /* plus 1 or minus 1 */ - - if( but->type==SLI) f= (float)(mval[0]-but->x1)/(but->x2-but->x1-h); - else f= (float)(mval[0]- (but->x1+but->x2)/2)/( (but->x2-but->x1)/2 - h); - - f= but->min+f*(but->max-but->min); - - if( but->pointype!=FLO ) { - - if(f=but->min && temp<=but->max) - ui_set_but_val(but, (float)temp); - - } - else { - - if(f=but->min && tempf<=but->max) - ui_set_but_val(but, tempf); - - } - } - ui_check_but(but); - ui_draw_but(but); - uibut_do_func(but); - ui_block_flush_back(but->block); - - return but->retval; -} - -static int ui_do_but_NUMSLI(uiBut *but) -{ - short mval[2]; - - /* first define if it's a slider or textbut */ - uiGetMouse(mywinget(), mval); - - if(mval[0]>= -6+(but->x1+but->x2)/2 ) { /* slider */ - but->flag |= UI_SELECT; - ui_draw_but(but); - ui_do_but_SLI(but); - but->flag &= ~UI_SELECT; - } - else { - ui_act_as_text_but(but); - uibut_do_func(but); // this is done in ui_do_but_SLI() not in ui_act_as_text_but() - } - - while(get_mbut() & L_MOUSE) BIF_wait_for_statechange(); - - ui_draw_but(but); - - /* hsv patch */ - if(but->type==HSVSLI) { - - if(but->str[0]=='H') { - ui_draw_but(but->next); - ui_draw_but(but->next->next); - } - else if(but->str[0]=='S') { - ui_draw_but(but->next); - ui_draw_but(but->prev); - } - else if(but->str[0]=='V') { - ui_draw_but(but->prev); - ui_draw_but(but->prev->prev); - } - } - - return but->retval; -} - -/* event denotes if we make first item active or not */ -static uiBlock *ui_do_but_BLOCK(uiBut *but, int event) -{ - uiBlock *block; - uiBut *bt; - - but->flag |= UI_SELECT; - ui_draw_but(but); - - block= but->block_func(but->poin); - block->parent= but->block; /* allows checking for nested pulldowns */ - - block->xofs = -2; /* for proper alignment */ - - /* only used for automatic toolbox, so can set the shift flag */ - if(but->flag & UI_MAKE_TOP) { - block->direction= UI_TOP|UI_SHIFT_FLIPPED; - uiBlockFlipOrder(block); - } - if(but->flag & UI_MAKE_DOWN) block->direction= UI_DOWN|UI_SHIFT_FLIPPED; - if(but->flag & UI_MAKE_LEFT) block->direction |= UI_LEFT; - if(but->flag & UI_MAKE_RIGHT) block->direction |= UI_RIGHT; - - ui_positionblock(block, but); - block->flag |= UI_BLOCK_LOOP; - - /* blocks can come (and get scaled) from a normal window, now we go to screenspace */ - block->win= G.curscreen->mainwin; - for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win; - bwin_getsinglematrix(block->win, block->winmat); - - /* postpone draw, this will cause a new window matrix, first finish all other buttons */ - block->flag |= UI_BLOCK_REDRAW; - - if(event!=MOUSEX && event!=MOUSEY && event!=LEFTMOUSE && but->type==BLOCK) { - bt= ui_but_first(block); - if(bt) bt->flag |= UI_ACTIVE; - } - - but->flag &= ~UI_SELECT; - uibut_do_func(but); - - if(but->retval) - addqueue(curarea->win, UI_BUT_EVENT, (short)but->retval); - - return block; -} - -static int ui_do_but_BUTM(uiBut *but) -{ - - ui_set_but_val(but, but->min); - UIafterfunc_butm= but->butm_func; - UIafterfunc_arg1= but->butm_func_arg; - UIafterval= but->a2; - - return but->retval; -} - -static int ui_do_but_LABEL(uiBut *but) -{ - uibut_do_func(but); - return but->retval; -} - -static uiBut *ui_get_valid_link_button(uiBlock *block, uiBut *but, short *mval) -{ - uiBut *bt; - - /* find button to link to */ - for (bt= block->buttons.first; bt; bt= bt->next) - if(bt!=but && uibut_contains_pt(bt, mval)) - break; - - if (bt) { - if (but->type==LINK && bt->type==INLINK) { - if( but->link->tocode == (int)bt->min ) { - return bt; - } - } - else if(but->type==INLINK && bt->type==LINK) { - if( bt->link->tocode == (int)but->min ) { - return bt; - } - } - } - - return NULL; -} - -static int ui_is_a_link(uiBut *from, uiBut *to) -{ - uiLinkLine *line; - uiLink *link; - - link= from->link; - if(link) { - line= link->lines.first; - while(line) { - if(line->from==from && line->to==to) return 1; - line= line->next; - } - } - return 0; -} - -static uiBut *ui_find_inlink(uiBlock *block, void *poin) -{ - uiBut *but; - - but= block->buttons.first; - while(but) { - if(but->type==INLINK) { - if(but->poin == poin) return but; - } - but= but->next; - } - return NULL; -} - -static void ui_add_link_line(ListBase *listb, uiBut *but, uiBut *bt) -{ - uiLinkLine *line; - - line= MEM_callocN(sizeof(uiLinkLine), "linkline"); - BLI_addtail(listb, line); - line->from= but; - line->to= bt; -} - - -void uiComposeLinks(uiBlock *block) -{ - uiBut *but, *bt; - uiLink *link; - void ***ppoin; - int a; - - but= block->buttons.first; - while(but) { - if(but->type==LINK) { - link= but->link; - - /* for all pointers in the array */ - if(link) { - if(link->ppoin) { - ppoin= link->ppoin; - for(a=0; a < *(link->totlink); a++) { - bt= ui_find_inlink(block, (*ppoin)[a] ); - if(bt) { - ui_add_link_line(&link->lines, but, bt); - } - } - } - else if(link->poin) { - bt= ui_find_inlink(block, *(link->poin) ); - if(bt) { - ui_add_link_line(&link->lines, but, bt); - } - } - } - } - but= but->next; - } -} - -static void ui_add_link(uiBut *from, uiBut *to) -{ - /* in 'from' we have to add a link to 'to' */ - uiLink *link; - void **oldppoin; - int a; - - if(ui_is_a_link(from, to)) { - printf("already exists\n"); - return; - } - - link= from->link; - - /* are there more pointers allowed? */ - if(link->ppoin) { - oldppoin= *(link->ppoin); - - (*(link->totlink))++; - *(link->ppoin)= MEM_callocN( *(link->totlink)*sizeof(void *), "new link"); - - for(a=0; a< (*(link->totlink))-1; a++) { - (*(link->ppoin))[a]= oldppoin[a]; - } - (*(link->ppoin))[a]= to->poin; - - if(oldppoin) MEM_freeN(oldppoin); - } - else { - *(link->poin)= to->poin; - } - -} - -static int ui_do_but_LINK(uiBlock *block, uiBut *but) -{ - /* - * This button only visualizes, the dobutton mode - * can add a new link, but then the whole system - * should be redrawn/initialized. - * - */ - uiBut *bt=0, *bto=NULL; - short sval[2], mval[2], mvalo[2], first= 1; - - uiGetMouse(curarea->win, sval); - mvalo[0]= sval[0]; - mvalo[1]= sval[1]; - - while (get_mbut() & L_MOUSE) { - uiGetMouse(curarea->win, mval); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || first) { - /* clear completely, because of drawbuttons */ - bt= ui_get_valid_link_button(block, but, mval); - if(bt) { - bt->flag |= UI_ACTIVE; - ui_draw_but(bt); - } - if(bto && bto!=bt) { - bto->flag &= ~UI_ACTIVE; - ui_draw_but(bto); - } - bto= bt; - - if (!first) { - glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]); - } - glutil_draw_front_xor_line(sval[0], sval[1], mval[0], mval[1]); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - first= 0; - } - else BIF_wait_for_statechange(); - } - - if (!first) { - glutil_draw_front_xor_line(sval[0], sval[1], mvalo[0], mvalo[1]); - } - - if(bt) { - if(but->type==LINK) ui_add_link(but, bt); - else ui_add_link(bt, but); - - scrarea_queue_winredraw(curarea); - } - - return 0; -} - -/* picker sizes S hsize, F full size, D spacer, B button/pallette height */ -#define SPICK 110.0 -#define FPICK 180.0 -#define DPICK 6.0 -#define BPICK 24.0 - -#define UI_PALETTE_TOT 16 -/* note; in tot+1 the old color is stored */ -static float palette[UI_PALETTE_TOT+1][3]= { -{0.93, 0.83, 0.81}, {0.88, 0.89, 0.73}, {0.69, 0.81, 0.57}, {0.51, 0.76, 0.64}, -{0.37, 0.56, 0.61}, {0.33, 0.29, 0.55}, {0.46, 0.21, 0.51}, {0.40, 0.12, 0.18}, -{1.0, 1.0, 1.0}, {0.85, 0.85, 0.85}, {0.7, 0.7, 0.7}, {0.56, 0.56, 0.56}, -{0.42, 0.42, 0.42}, {0.28, 0.28, 0.28}, {0.14, 0.14, 0.14}, {0.0, 0.0, 0.0} -}; - -/* for picker, while editing hsv */ -static void ui_set_but_hsv(uiBut *but) -{ - float col[3]; - - hsv_to_rgb(but->hsv[0], but->hsv[1], but->hsv[2], col, col+1, col+2); - ui_set_but_vectorf(but, col); -} - -static void update_picker_hex(uiBlock *block, float *rgb) -{ - uiBut *bt; - char col[16]; - - sprintf(col, "%02X%02X%02X", (unsigned int)(rgb[0]*255.0), (unsigned int)(rgb[1]*255.0), (unsigned int)(rgb[2]*255.0)); - - // this updates button strings, is hackish... but button pointers are on stack of caller function - - for(bt= block->buttons.first; bt; bt= bt->next) { - if(strcmp(bt->str, "Hex: ")==0) { - strcpy(bt->poin, col); - ui_check_but(bt); - break; - } - } -} - -static void update_picker_buts_hsv(uiBlock *block, float *hsv, char *poin) -{ - uiBut *bt; - float r, g, b; - float rgb[3]; - - // this updates button strings, is hackish... but button pointers are on stack of caller function - hsv_to_rgb(hsv[0], hsv[1], hsv[2], &r, &g, &b); - - rgb[0] = r; rgb[1] = g; rgb[2] = b; - update_picker_hex(block, rgb); - - for(bt= block->buttons.first; bt; bt= bt->next) { - if(bt->type==HSVCUBE) { - VECCOPY(bt->hsv, hsv); - ui_set_but_hsv(bt); - } - else if(bt->str[1]==' ') { - if(bt->str[0]=='R') { - ui_set_but_val(bt, r); - } - else if(bt->str[0]=='G') { - ui_set_but_val(bt, g); - } - else if(bt->str[0]=='B') { - ui_set_but_val(bt, b); - } - else if(bt->str[0]=='H') { - ui_set_but_val(bt, hsv[0]); - } - else if(bt->str[0]=='S') { - ui_set_but_val(bt, hsv[1]); - } - else if(bt->str[0]=='V') { - ui_set_but_val(bt, hsv[2]); - } - } - } -} - -static void update_picker_buts_hex(uiBlock *block, char *hexcol) -{ - uiBut *bt; - float r=0, g=0, b=0; - float h, s, v; - - - // this updates button strings, is hackish... but button pointers are on stack of caller function - hex_to_rgb(hexcol, &r, &g, &b); - rgb_to_hsv(r, g, b, &h, &s, &v); - - for(bt= block->buttons.first; bt; bt= bt->next) { - if(bt->type==HSVCUBE) { - bt->hsv[0] = h; - bt->hsv[1] = s; - bt->hsv[2] = v; - ui_set_but_hsv(bt); - } - else if(bt->str[1]==' ') { - if(bt->str[0]=='R') { - ui_set_but_val(bt, r); - } - else if(bt->str[0]=='G') { - ui_set_but_val(bt, g); - } - else if(bt->str[0]=='B') { - ui_set_but_val(bt, b); - } - else if(bt->str[0]=='H') { - ui_set_but_val(bt, h); - } - else if(bt->str[0]=='S') { - ui_set_but_val(bt, s); - } - else if(bt->str[0]=='V') { - ui_set_but_val(bt, v); - } - } - } -} - - - -/* bt1 is palette but, col1 is original color */ -/* callback to copy from/to palette */ -static void do_palette_cb(void *bt1, void *col1) -{ - uiBut *but1= (uiBut *)bt1; - uiBut *but; - float *col= (float *)col1; - float *fp, hsv[3]; - - fp= (float *)but1->poin; - - if( (get_qual() & LR_CTRLKEY) ) { - VECCOPY(fp, col); - } - else { - VECCOPY(col, fp); - } - - rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); - update_picker_buts_hsv(but1->block, hsv, but1->poin); - update_picker_hex(but1->block, col); - - for (but= but1->block->buttons.first; but; but= but->next) { - ui_check_but(but); - ui_draw_but(but); - } - but= but1->block->buttons.first; - ui_block_flush_back(but->block); -} - -/* bt1 is num but, hsv1 is pointer to original color in hsv space*/ -/* callback to handle changes in num-buts in picker */ -static void do_palette1_cb(void *bt1, void *hsv1) -{ - uiBut *but1= (uiBut *)bt1; - uiBut *but; - float *hsv= (float *)hsv1; - float *fp= NULL; - - if(but1->str[1]==' ') { - if(but1->str[0]=='R') fp= (float *)but1->poin; - else if(but1->str[0]=='G') fp= ((float *)but1->poin)-1; - else if(but1->str[0]=='B') fp= ((float *)but1->poin)-2; - } - if(fp) { - rgb_to_hsv(fp[0], fp[1], fp[2], hsv, hsv+1, hsv+2); - } - update_picker_buts_hsv(but1->block, hsv, but1->poin); - - for (but= but1->block->buttons.first; but; but= but->next) { - ui_check_but(but); - ui_draw_but(but); - } - - but= but1->block->buttons.first; - ui_block_flush_back(but->block); - -} - -/* bt1 is num but, col1 is pointer to original color */ -/* callback to handle changes in num-buts in picker */ -static void do_palette2_cb(void *bt1, void *col1) -{ - uiBut *but1= (uiBut *)bt1; - uiBut *but; - float *rgb= (float *)col1; - float *fp= NULL; - - if(but1->str[1]==' ') { - if(but1->str[0]=='H') fp= (float *)but1->poin; - else if(but1->str[0]=='S') fp= ((float *)but1->poin)-1; - else if(but1->str[0]=='V') fp= ((float *)but1->poin)-2; - } - if(fp) { - hsv_to_rgb(fp[0], fp[1], fp[2], rgb, rgb+1, rgb+2); - } - update_picker_buts_hsv(but1->block, fp, but1->poin); - - for (but= but1->block->buttons.first; but; but= but->next) { - ui_check_but(but); - ui_draw_but(but); - } - - but= but1->block->buttons.first; - ui_block_flush_back(but->block); - -} - -static void do_palette_hex_cb(void *bt1, void *hexcl) -{ - uiBut *but1= (uiBut *)bt1; - uiBut *but; - char *hexcol= (char *)hexcl; - - update_picker_buts_hex(but1->block, hexcol); - - for (but= but1->block->buttons.first; but; but= but->next) { - ui_check_but(but); - ui_draw_but(but); - } - - but= but1->block->buttons.first; - ui_block_flush_back(but->block); -} - - -/* used for both 3d view and image window */ -static void do_palette_sample_cb(void *bt1, void *col1) /* frontbuf */ -{ - uiBut *but1= (uiBut *)bt1; - uiBut *but; - float tempcol[4]; - int x=0, y=0; - short mval[2]; - float hsv[3]; - short capturing; - int oldcursor; - Window *win; - unsigned short dev; - - oldcursor=get_cursor(); - win=winlay_get_active_window(); - - while (get_mbut() & L_MOUSE) BIF_wait_for_statechange(); - - SetBlenderCursor(BC_EYEDROPPER_CURSOR); - - /* loop and wait for a mouse click */ - capturing = TRUE; - while(capturing) { - char ascii; - short val; - - dev = extern_qread_ext(&val, &ascii); - - if(dev==INPUTCHANGE) break; - if(get_mbut() & R_MOUSE) break; - else if(get_mbut() & L_MOUSE) { - uiGetMouse(mywinget(), mval); - x= mval[0]; y= mval[1]; - - capturing = FALSE; - break; - } - else if(dev==ESCKEY) break; - } - window_set_cursor(win, oldcursor); - - if(capturing) return; - - if(x<0 || y<0) return; - - /* if we've got a glick, use OpenGL to sample the color under the mouse pointer */ - glReadBuffer(GL_FRONT); - glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol); - glReadBuffer(GL_BACK); - - /* and send that color back to the picker */ - rgb_to_hsv(tempcol[0], tempcol[1], tempcol[2], hsv, hsv+1, hsv+2); - update_picker_buts_hsv(but1->block, hsv, but1->poin); - update_picker_hex(but1->block, tempcol); - - for (but= but1->block->buttons.first; but; but= but->next) { - ui_check_but(but); - ui_draw_but(but); - } - - but= but1->block->buttons.first; - ui_block_flush_back(but->block); -} - - -/* color picker, Gimp version. mode: 'f' = floating panel, 'p' = popup */ -/* col = read/write to, hsv/old/hexcol = memory for temporal use */ -void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval) -{ - uiBut *bt; - float h, offs; - int a; - - VECCOPY(old, col); // old color stored there, for palette_cb to work - - // the cube intersection - bt= uiDefButF(block, HSVCUBE, retval, "", 0,DPICK+BPICK,FPICK,FPICK, col, 0.0, 0.0, 2, 0, ""); - uiButSetFlag(bt, UI_NO_HILITE); - - bt= uiDefButF(block, HSVCUBE, retval, "", 0,0,FPICK,BPICK, col, 0.0, 0.0, 3, 0, ""); - uiButSetFlag(bt, UI_NO_HILITE); - - // palette - - uiBlockSetEmboss(block, UI_EMBOSSP); - - bt=uiDefButF(block, COL, retval, "", FPICK+DPICK, 0, BPICK,BPICK, old, 0.0, 0.0, -1, 0, "Old color, click to restore"); - uiButSetFunc(bt, do_palette_cb, bt, col); - uiDefButF(block, COL, retval, "", FPICK+DPICK, BPICK+DPICK, BPICK,60-BPICK-DPICK, col, 0.0, 0.0, -1, 0, "Active color"); - - h= (DPICK+BPICK+FPICK-64)/(UI_PALETTE_TOT/2.0); - uiBlockBeginAlign(block); - for(a= -1+UI_PALETTE_TOT/2; a>=0; a--) { - bt= uiDefButF(block, COL, retval, "", FPICK+DPICK, 65.0+(float)a*h, BPICK/2, h, palette[a+UI_PALETTE_TOT/2], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette"); - uiButSetFunc(bt, do_palette_cb, bt, col); - bt= uiDefButF(block, COL, retval, "", FPICK+DPICK+BPICK/2, 65.0+(float)a*h, BPICK/2, h, palette[a], 0.0, 0.0, -1, 0, "Click to choose, hold CTRL to store in palette"); - uiButSetFunc(bt, do_palette_cb, bt, col); - } - uiBlockEndAlign(block); - - uiBlockSetEmboss(block, UI_EMBOSS); - - // buttons - rgb_to_hsv(col[0], col[1], col[2], hsv, hsv+1, hsv+2); - sprintf(hexcol, "%02X%02X%02X", (unsigned int)(col[0]*255.0), (unsigned int)(col[1]*255.0), (unsigned int)(col[2]*255.0)); - - offs= FPICK+2*DPICK+BPICK; - - /* note; made this a TOG now, with NULL pointer. Is because BUT now gets handled with a afterfunc */ - bt= uiDefIconTextBut(block, TOG, UI_RETURN_OK, ICON_EYEDROPPER, "Sample", offs+55, 170, 85, 20, NULL, 0, 0, 0, 0, "Sample the color underneath the following mouse click (ESC or RMB to cancel)"); - uiButSetFunc(bt, do_palette_sample_cb, bt, col); - uiButSetFlag(bt, UI_TEXT_LEFT); - - bt= uiDefBut(block, TEX, retval, "Hex: ", offs, 140, 140, 20, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)"); - uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol); - - uiBlockBeginAlign(block); - bt= uiDefButF(block, NUMSLI, retval, "R ", offs, 110, 140,20, col, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette1_cb, bt, hsv); - bt= uiDefButF(block, NUMSLI, retval, "G ", offs, 90, 140,20, col+1, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette1_cb, bt, hsv); - bt= uiDefButF(block, NUMSLI, retval, "B ", offs, 70, 140,20, col+2, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette1_cb, bt, hsv); - - uiBlockBeginAlign(block); - bt= uiDefButF(block, NUMSLI, retval, "H ", offs, 40, 140,20, hsv, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette2_cb, bt, col); - bt= uiDefButF(block, NUMSLI, retval, "S ", offs, 20, 140,20, hsv+1, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette2_cb, bt, col); - bt= uiDefButF(block, NUMSLI, retval, "V ", offs, 0, 140,20, hsv+2, 0.0, 1.0, 10, 3, ""); - uiButSetFunc(bt, do_palette2_cb, bt, col); - uiBlockEndAlign(block); -} - -static int ui_do_but_COL(uiBut *but) -{ - uiBlock *block; - uiBut *bt; - ListBase listb={NULL, NULL}; - float hsv[3], old[3], *poin= NULL, colstore[3]; - static char hexcol[128]; - short event; - - // signal to prevent calling up color picker - if(but->a1 == -1) { - uibut_do_func(but); - return but->retval; - } - - // enable char button too, use temporal colstore for color - if(but->pointype!=FLO) { - if(but->pointype==CHA) { - ui_get_but_vectorf(but, colstore); - poin= colstore; - } - else return but->retval; - } - else poin= (float *)but->poin; - - block= uiNewBlock(&listb, "colorpicker", UI_EMBOSS, UI_HELV, but->win); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW; - block->themecol= TH_BUT_NUM; - - uiBlockPickerButtons(block, poin, hsv, old, hexcol, 'p', 0); - - /* and lets go */ - block->direction= UI_TOP; - ui_positionblock(block, but); - uiBoundsBlock(block, 3); - - /* blocks can come from a normal window, but we go to screenspace */ - block->win= G.curscreen->mainwin; - for(bt= block->buttons.first; bt; bt= bt->next) bt->win= block->win; - bwin_getsinglematrix(block->win, block->winmat); - - event= uiDoBlocks(&listb, 0, 1); - - if(but->pointype==CHA) ui_set_but_vectorf(but, colstore); - - uibut_do_func(but); - return but->retval; - -} - -static int ui_do_but_HSVCUBE(uiBut *but) -{ - uiBut *bt; - float x, y; - short mval[2], mvalo[2]; - - mvalo[0]= mvalo[1]= -32000; - - /* we work on persistant hsv, to prevent it being converted back and forth all the time */ - - while (get_mbut() & L_MOUSE) { - - uiGetMouse(mywinget(), mval); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - /* relative position within box */ - x= ((float)mval[0]-but->x1)/(but->x2-but->x1); - y= ((float)mval[1]-but->y1)/(but->y2-but->y1); - CLAMP(x, 0.0, 1.0); - CLAMP(y, 0.0, 1.0); - - if(but->a1==0) { - but->hsv[0]= x; - but->hsv[2]= y; - // hsv_to_rgb(x, s, y, col, col+1, col+2); - } - else if(but->a1==1) { - but->hsv[0]= x; - but->hsv[1]= y; - // hsv_to_rgb(x, y, v, col, col+1, col+2); - } - else if(but->a1==2) { - but->hsv[2]= x; - but->hsv[1]= y; - // hsv_to_rgb(h, y, x, col, col+1, col+2); - } - else { - but->hsv[0]= x; - // hsv_to_rgb(x, s, v, col, col+1, col+2); - } - - ui_set_but_hsv(but); // converts to rgb - - // update button values and strings - update_picker_buts_hsv(but->block, but->hsv, but->poin); -// update_picker_buts_hex(but->block, but->hsv); - - /* we redraw the entire block */ - for (bt= but->block->buttons.first; bt; bt= bt->next) { - if(but->poin == bt->poin) VECCOPY(bt->hsv, but->hsv); - ui_draw_but(bt); - } - ui_block_flush_back(but->block); - } - else BIF_wait_for_statechange(); - } - - return but->retval; -} - -#ifdef INTERNATIONAL - -static int ui_do_but_CHARTAB(uiBut *but) -{ - /* Variables */ - short mval[2]; - float sx, sy, ex, ey; - float width, height; - float butw, buth; - int x, y, cs, che; - - /* Check the position */ - uiGetMouse(mywinget(), mval); - - /* Calculate the size of the button */ - width = abs(but->x2 - but->x1); - height = abs(but->y2 - but->y1); - - butw = floor(width / 12); - buth = floor(height / 6); - - /* Initialize variables */ - sx = but->x1; - ex = but->x1 + butw; - sy = but->y1 + height - buth; - ey = but->y1 + height; - - cs = G.charstart; - - /* And the character is */ - x = (int) ((mval[0] / butw) - 0.5); - y = (int) (6 - ((mval[1] / buth) - 0.5)); - - che = cs + (y*12) + x; - - if(che > G.charmax) - che = 0; - - if(G.obedit) - { - do_textedit(0,0,che); - } - - return but->retval; -} - -#endif - -static int vergcband(const void *a1, const void *a2) -{ - const CBData *x1=a1, *x2=a2; - - if( x1->pos > x2->pos ) return 1; - else if( x1->pos < x2->pos) return -1; - return 0; -} - - -static void do_colorband_evt(ColorBand *coba) -{ - int a; - - if(coba==NULL) return; - - if(coba->tot<2) return; - - for(a=0; atot; a++) coba->data[a].cur= a; - qsort(coba->data, coba->tot, sizeof(CBData), vergcband); - for(a=0; atot; a++) { - if(coba->data[a].cur==coba->cur) { - if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */ - coba->cur= a; - break; - } - } -} - -static int ui_do_but_COLORBAND(uiBut *but) -{ - ColorBand *coba= (ColorBand *)but->poin; - CBData *cbd; - float dx, width= but->x2-but->x1; - int a; - int mindist= 12, xco; - short mval[2], mvalo[2]; - - uiGetMouse(mywinget(), mvalo); - - if(G.qual & LR_CTRLKEY) { - /* insert new key on mouse location */ - if(coba->tot < MAXCOLORBAND-1) { - float pos= ((float)(mvalo[0] - but->x1))/width; - float col[4]; - - do_colorband(coba, pos, col); /* executes it */ - - coba->tot++; - coba->cur= coba->tot-1; - - coba->data[coba->cur].r= col[0]; - coba->data[coba->cur].g= col[1]; - coba->data[coba->cur].b= col[2]; - coba->data[coba->cur].a= col[3]; - coba->data[coba->cur].pos= pos; - - do_colorband_evt(coba); - } - } - else { - - /* first, activate new key when mouse is close */ - for(a=0, cbd= coba->data; atot; a++, cbd++) { - xco= but->x1 + (cbd->pos*width); - xco= ABS(xco-mvalo[0]); - if(a==coba->cur) xco+= 5; // selected one disadvantage - if(xcocur= a; - mindist= xco; - } - } - - cbd= coba->data + coba->cur; - - while(get_mbut() & L_MOUSE) { - uiGetMouse(mywinget(), mval); - if(mval[0]!=mvalo[0]) { - dx= mval[0]-mvalo[0]; - dx/= width; - cbd->pos+= dx; - CLAMP(cbd->pos, 0.0, 1.0); - - ui_draw_but(but); - ui_block_flush_back(but->block); - - do_colorband_evt(coba); - cbd= coba->data + coba->cur; /* because qsort */ - - mvalo[0]= mval[0]; - } - BIF_wait_for_statechange(); - } - } - - return but->retval; -} - -/* button is presumed square */ -/* if mouse moves outside of sphere, it does negative normal */ -static int ui_do_but_NORMAL(uiBut *but) -{ - float dx, dy, rad, radsq, mrad, *fp= (float *)but->poin; - int firsttime=1; - short mval[2], mvalo[2], mvals[2], mvaldx, mvaldy; - - rad= (but->x2 - but->x1); - radsq= rad*rad; - - if(fp[2]>0.0f) { - mvaldx= (rad*fp[0]); - mvaldy= (rad*fp[1]); - } - else if(fp[2]> -1.0f) { - mrad= rad/sqrt(fp[0]*fp[0] + fp[1]*fp[1]); - - mvaldx= 2.0f*mrad*fp[0] - (rad*fp[0]); - mvaldy= 2.0f*mrad*fp[1] - (rad*fp[1]); - } - else mvaldx= mvaldy= 0; - - uiGetMouse(mywinget(), mvalo); - mvals[0]= mvalo[0]; - mvals[1]= mvalo[1]; - - while(get_mbut() & L_MOUSE) { - - uiGetMouse(mywinget(), mval); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || firsttime) { - firsttime= 0; - - dx= (float)(mval[0]+mvaldx-mvals[0]); - dy= (float)(mval[1]+mvaldy-mvals[1]); - - mrad= dx*dx+dy*dy; - if(mrad < radsq) { /* inner circle */ - fp[0]= dx; - fp[1]= dy; - fp[2]= sqrt( radsq-dx*dx-dy*dy ); - } - else { /* outer circle */ - - mrad= rad/sqrt(mrad); // veclen - - dx*= (2.0f*mrad - 1.0f); - dy*= (2.0f*mrad - 1.0f); - - mrad= dx*dx+dy*dy; - if(mrad < radsq) { - fp[0]= dx; - fp[1]= dy; - fp[2]= -sqrt( radsq-dx*dx-dy*dy ); - } - } - Normalize(fp); - - ui_draw_but(but); - ui_block_flush_back(but->block); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - BIF_wait_for_statechange(); - } - - return but->retval; -} - -static int ui_do_but_CURVE(uiBut *but) -{ - CurveMapping *cumap= (CurveMapping *)but->poin; - CurveMap *cuma= cumap->cm+cumap->cur; - CurveMapPoint *cmp= cuma->curve; - float fx, fy, zoomx, zoomy, offsx, offsy; - float dist, mindist= 200.0f; // 14 pixels radius - int a, sel= -1, retval= but->retval; - short mval[2], mvalo[2]; - - uiGetMouse(mywinget(), mval); - - /* calculate offset and zoom */ - zoomx= (but->x2-but->x1)/(cumap->curr.xmax-cumap->curr.xmin); - zoomy= (but->y2-but->y1)/(cumap->curr.ymax-cumap->curr.ymin); - offsx= cumap->curr.xmin; - offsy= cumap->curr.ymin; - - if(G.qual & LR_CTRLKEY) { - - fx= ((float)mval[0] - but->x1)/zoomx + offsx; - fy= ((float)mval[1] - but->y1)/zoomy + offsy; - - curvemap_insert(cuma, fx, fy); - curvemapping_changed(cumap, 0); - - ui_draw_but(but); - ui_block_flush_back(but->block); - } - - - /* check for selecting of a point */ - cmp= cuma->curve; /* ctrl adds point, new malloc */ - for(a=0; atotpoint; a++) { - fx= but->x1 + zoomx*(cmp[a].x-offsx); - fy= but->y1 + zoomy*(cmp[a].y-offsy); - dist= (fx-mval[0])*(fx-mval[0]) + (fy-mval[1])*(fy-mval[1]); - if(dist < mindist) { - sel= a; - mindist= dist; - } - } - - if (sel == -1) { - /* if the click didn't select anything, check if it's clicked on the - * curve itself, and if so, add a point */ - fx= ((float)mval[0] - but->x1)/zoomx + offsx; - fy= ((float)mval[1] - but->y1)/zoomy + offsy; - - cmp= cuma->table; - - /* loop through the curve segment table and find what's near the mouse. - * 0.05 is kinda arbitrary, but seems to be what works nicely. */ - for(a=0; a<=CM_TABLE; a++) { - if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) { - - curvemap_insert(cuma, fx, fy); - curvemapping_changed(cumap, 0); - - ui_draw_but(but); - ui_block_flush_back(but->block); - - /* reset cmp back to the curve points again, rather than drawing segments */ - cmp= cuma->curve; - - /* find newly added point and make it 'sel' */ - for(a=0; atotpoint; a++) { - if (cmp[a].x == fx) sel = a; - } - - break; - } - } - } - - /* ok, we move a point */ - if(sel!= -1) { - int moved_point; - int moved_mouse= 0; - - /* deselect all if this one is deselect. except if we hold shift */ - if((G.qual & LR_SHIFTKEY)==0 && (cmp[sel].flag & SELECT)==0) - for(a=0; atotpoint; a++) - cmp[a].flag &= ~SELECT; - cmp[sel].flag |= SELECT; - - /* draw to show select updates */ - ui_draw_but(but); - ui_block_flush_back(but->block); - - /* while move mouse, do move points around */ - while(get_mbut() & L_MOUSE) { - - uiGetMouse(mywinget(), mvalo); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - moved_mouse= 1; /* for selection */ - moved_point= 0; /* for ctrl grid, can't use orig coords because of sorting */ - - fx= (mvalo[0]-mval[0])/zoomx; - fy= (mvalo[1]-mval[1])/zoomy; - for(a=0; atotpoint; a++) { - if(cmp[a].flag & SELECT) { - float origx= cmp[a].x, origy= cmp[a].y; - cmp[a].x+= fx; - cmp[a].y+= fy; - if( (get_qual() & LR_SHIFTKEY) ) { - cmp[a].x= 0.125f*floor(0.5f + 8.0f*cmp[a].x); - cmp[a].y= 0.125f*floor(0.5f + 8.0f*cmp[a].y); - } - if(cmp[a].x!=origx || cmp[a].y!=origy) - moved_point= 1; - } - } - curvemapping_changed(cumap, 0); /* no remove doubles */ - - ui_draw_but(but); - ui_block_flush_back(but->block); - - if(moved_point) { - mval[0]= mvalo[0]; - mval[1]= mvalo[1]; - } - } - BIF_wait_for_statechange(); - } - - if(moved_mouse==0) { - /* deselect all, select one */ - if((G.qual & LR_SHIFTKEY)==0) { - for(a=0; atotpoint; a++) - cmp[a].flag &= ~SELECT; - cmp[sel].flag |= SELECT; - } - } - else - curvemapping_changed(cumap, 1); /* remove doubles */ - - ui_draw_but(but); - ui_block_flush_back(but->block); - } - else { - /* we move the view */ - retval= B_NOP; - - while(get_mbut() & L_MOUSE) { - - uiGetMouse(mywinget(), mvalo); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - fx= (mvalo[0]-mval[0])/zoomx; - fy= (mvalo[1]-mval[1])/zoomy; - - /* clamp for clip */ - if(cumap->flag & CUMA_DO_CLIP) { - if(cumap->curr.xmin-fx < cumap->clipr.xmin) - fx= cumap->curr.xmin - cumap->clipr.xmin; - else if(cumap->curr.xmax-fx > cumap->clipr.xmax) - fx= cumap->curr.xmax - cumap->clipr.xmax; - if(cumap->curr.ymin-fy < cumap->clipr.ymin) - fy= cumap->curr.ymin - cumap->clipr.ymin; - else if(cumap->curr.ymax-fy > cumap->clipr.ymax) - fy= cumap->curr.ymax - cumap->clipr.ymax; - } - cumap->curr.xmin-=fx; - cumap->curr.ymin-=fy; - cumap->curr.xmax-=fx; - cumap->curr.ymax-=fy; - - ui_draw_but(but); - ui_block_flush_back(but->block); - - mval[0]= mvalo[0]; - mval[1]= mvalo[1]; - } - } - BIF_wait_for_statechange(); - } - - return retval; -} - -/* ************************************************ */ - -void uiSetButLock(int val, char *lockstr) -{ - UIlock |= val; - if (val) UIlockstr= lockstr; -} - -void uiClearButLock() -{ - UIlock= 0; - UIlockstr= NULL; -} - -/* *************************************************************** */ - -static void setup_file(uiBlock *block) -{ - uiBut *but; - FILE *fp; - - fp= fopen("butsetup","w"); - if(fp==NULL); - else { - but= block->buttons.first; - while(but) { - ui_check_but(but); - fprintf(fp,"%d,%d,%d,%d %s %s\n", (int)but->x1, (int)but->y1, (int)( but->x2-but->x1), (int)(but->y2-but->y1), but->str, but->tip); - but= but->next; - } - fclose(fp); - } -} - - -static void edit_but(uiBlock *block, uiBut *but, uiEvent *uevent) -{ - short dx, dy, mval[2], mvalo[2], didit=0; - - getmouseco_sc(mvalo); - while(TRUE) { - if( !(get_mbut() & L_MOUSE) ) break; - - getmouseco_sc(mval); - dx= (mval[0]-mvalo[0]); - dy= (mval[1]-mvalo[1]); - - if(dx!=0 || dy!=0) { - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - cpack(0xc0c0c0); - glRectf(but->x1-2, but->y1-2, but->x2+2, but->y2+2); - - if((uevent->qual & LR_SHIFTKEY)==0) { - but->x1 += dx; - but->y1 += dy; - } - but->x2 += dx; - but->y2 += dy; - - ui_draw_but(but); - ui_block_flush_back(but->block); - didit= 1; - - } - /* idle for this poor code */ - else PIL_sleep_ms(30); - } - if(didit) setup_file(block); -} - - -/* is called when LEFTMOUSE is pressed or released - * return: butval or zero - */ -static int ui_do_button(uiBlock *block, uiBut *but, uiEvent *uevent) -{ - int retval= 0; - - if(but->lock) { - if (but->lockstr) { - error("%s", but->lockstr); - return 0; - } - } - else { - if( but->pointype ) { /* there's a pointer needed */ - if(but->poin==0 ) { - printf("DoButton pointer error: %s\n",but->str); - return 0; - } - } - } - - if(G.rt==1 && (uevent->qual & LR_CTRLKEY)) { - edit_but(block, but, uevent); - return 0; - } - - block->flag |= UI_BLOCK_BUSY; - - switch(but->type) { - case BUT: - if(uevent->val) retval= ui_do_but_BUT(but); - break; - - case KEYEVT: - if(uevent->val) retval= ui_do_but_KEYEVT(but); - break; - - case TOG: - case TOGR: - case ICONTOG: - case ICONTOGN: - case TOGN: - case BUT_TOGDUAL: - if(uevent->val) { - retval= ui_do_but_TOG(block, but, uevent->qual); - } - break; - - case ROW: - if(uevent->val) retval= ui_do_but_ROW(block, but); - break; - - case SCROLL: - /* DrawBut(b, 1); */ - /* do_scrollbut(b); */ - /* DrawBut(b,0); */ - break; - - case NUM: - if(uevent->val) retval= ui_do_but_NUM(but); - break; - - case SLI: - case NUMSLI: - case HSVSLI: - if(uevent->val) retval= ui_do_but_NUMSLI(but); - break; - - case ROUNDBOX: - case LABEL: - if(uevent->val) retval= ui_do_but_LABEL(but); - break; - - case TOG3: - if(uevent->val) retval= ui_do_but_TOG3(but); - break; - - case TEX: - if(uevent->val) retval= ui_do_but_TEX(but); - break; - - case MENU: - if(uevent->val) retval= ui_do_but_MENU(but); - break; - - case ICONROW: - if(uevent->val) retval= ui_do_but_ICONROW(but); - break; - - case ICONTEXTROW: - if(uevent->val) retval= ui_do_but_ICONTEXTROW(but); - break; - - case IDPOIN: - if(uevent->val) retval= ui_do_but_IDPOIN(but); - break; - - case BLOCK: - case PULLDOWN: - if(uevent->val) { - ui_do_but_BLOCK(but, uevent->event); - retval= 0; - if(block->auto_open==0) block->auto_open= 1; - } - break; - - case BUTM: - retval= ui_do_but_BUTM(but); - break; - - case LINK: - case INLINK: - retval= ui_do_but_LINK(block, but); - break; - - case COL: - if(uevent->val) retval= ui_do_but_COL(but); - break; - - case HSVCUBE: - retval= ui_do_but_HSVCUBE(but); - break; - case BUT_COLORBAND: - retval= ui_do_but_COLORBAND(but); - break; - case BUT_NORMAL: - retval= ui_do_but_NORMAL(but); - break; - case BUT_CURVE: - retval= ui_do_but_CURVE(but); - break; - -#ifdef INTERNATIONAL - case CHARTAB: - retval= ui_do_but_CHARTAB(but); - break; -#endif - } - - block->flag &= ~UI_BLOCK_BUSY; - - return retval; -} - -static void ui_delete_active_linkline(uiBlock *block) -{ - uiBut *but; - uiLink *link; - uiLinkLine *line, *nline; - int a, b; - - but= block->buttons.first; - while(but) { - if(but->type==LINK && but->link) { - line= but->link->lines.first; - while(line) { - - nline= line->next; - - if(line->flag & UI_SELECT) { - BLI_remlink(&but->link->lines, line); - - link= line->from->link; - - /* are there more pointers allowed? */ - if(link->ppoin) { - - if(*(link->totlink)==1) { - *(link->totlink)= 0; - MEM_freeN(*(link->ppoin)); - *(link->ppoin)= NULL; - } - else { - b= 0; - for(a=0; a< (*(link->totlink)); a++) { - - if( (*(link->ppoin))[a] != line->to->poin ) { - (*(link->ppoin))[b]= (*(link->ppoin))[a]; - b++; - } - } - (*(link->totlink))--; - } - } - else { - *(link->poin)= NULL; - } - - MEM_freeN(line); - } - line= nline; - } - } - but= but->next; - } - - /* temporal! these buttons can be everywhere... */ - allqueue(REDRAWBUTSLOGIC, 0); -} - -static void ui_do_active_linklines(uiBlock *block, short *mval) -{ - uiBut *but; - uiLinkLine *line, *act= NULL; - float mindist= 12.0, fac, v1[2], v2[2], v3[3]; - int foundone= 0; - - if(mval) { - v1[0]= mval[0]; - v1[1]= mval[1]; - - /* find a line close to the mouse */ - but= block->buttons.first; - while(but) { - if(but->type==LINK && but->link) { - foundone= 1; - line= but->link->lines.first; - while(line) { - v2[0]= line->from->x2; - v2[1]= (line->from->y1+line->from->y2)/2.0; - v3[0]= line->to->x1; - v3[1]= (line->to->y1+line->to->y2)/2.0; - - fac= PdistVL2Dfl(v1, v2, v3); - if(fac < mindist) { - mindist= fac; - act= line; - } - line= line->next; - } - } - but= but->next; - } - } - - /* check for a 'found one' to prevent going to 'frontbuffer' mode. - this slows done gfx quite some, and at OSX the 'finish' forces a swapbuffer */ - if(foundone) { - glDrawBuffer(GL_FRONT); - - /* draw */ - but= block->buttons.first; - while(but) { - if(but->type==LINK && but->link) { - line= but->link->lines.first; - while(line) { - if(line==act) { - if((line->flag & UI_SELECT)==0) { - line->flag |= UI_SELECT; - ui_draw_linkline(but, line); - } - } - else if(line->flag & UI_SELECT) { - line->flag &= ~UI_SELECT; - ui_draw_linkline(but, line); - } - line= line->next; - } - } - but= but->next; - } - bglFlush(); - glDrawBuffer(GL_BACK); - } -} - - -/* only to be used to prevent an 'outside' event when using nested pulldowns */ -/* only one checks: - - while mouse moves in triangular area defined old mouse position and left/right side of new menu - - only for 1 second - - return 0: check outside -*/ -static int ui_mouse_motion_towards_block(uiBlock *block, uiEvent *uevent) -{ - short mvalo[2], dx, dy, domx, domy; - int counter=0; - - if((block->direction & UI_TOP) || (block->direction & UI_DOWN)) return 0; - if(uevent->event!= MOUSEX && uevent->event!= MOUSEY) return 0; - - /* calculate dominant direction */ - domx= ( -uevent->mval[0] + (block->maxx+block->minx)/2 ); - domy= ( -uevent->mval[1] + (block->maxy+block->miny)/2 ); - /* we need some accuracy */ - if( abs(domx)<4 ) return 0; - - uiGetMouse(mywinget(), mvalo); - - while(TRUE) { - uiGetMouse(mywinget(), uevent->mval); - - /* check inside, if so return */ - if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) { - if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) { - return 1; - } - } - - /* check direction */ - dx= uevent->mval[0] - mvalo[0]; - dy= uevent->mval[1] - mvalo[1]; - - if( abs(dx)+abs(dy)>4 ) { // threshold - /* menu to right */ - if(domx>0) { - int fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->maxy +20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->minx); - if( (fac>0)) { - // printf("Left outside 1, Fac %d\n", fac); - return 0; - } - - fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->miny-20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->minx); - if( (fac<0)) { - //printf("Left outside 2, Fac %d\n", fac); - return 0; - } - } - else { - int fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->maxy+20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->maxx); - if( (fac<0)) { - // printf("Left outside 1, Fac %d\n", fac); - return 0; - } - - fac= (uevent->mval[0] - mvalo[0])*(mvalo[1] - (short)(block->miny-20)) + (uevent->mval[1] - mvalo[1])*(-mvalo[0] + (short)block->maxx); - if( (fac>0)) { - // printf("Left outside 2, Fac %d\n", fac); - return 0; - } - } - } - - /* idle for this poor code */ - PIL_sleep_ms(10); - counter++; - if(counter > 100) { - //printf("left because of timer (1 sec)\n"); - return 0; - } - } - - return 0; -} - - -static void ui_set_ftf_font(float aspect) -{ - -#ifdef INTERNATIONAL - if(aspect<1.15) { - FTF_SetFontSize('l'); - } - else if(aspect<1.59) { - FTF_SetFontSize('m'); - } - else { - FTF_SetFontSize('s'); - } -#endif -} - -static void ui_but_next_edittext(uiBlock *block) -{ - uiBut *but, *actbut; - - for(actbut= block->buttons.first; actbut; actbut= actbut->next) { - /* label and roundbox can overlap real buttons (backdrops...) */ - if(actbut->type!=LABEL && actbut->type!=ROUNDBOX) - if(actbut->flag & UI_ACTIVE) break; - } - if(actbut) { - /* ensure all buttons are cleared, label/roundbox overlap */ - for(but= block->buttons.first; but; but= but->next) - but->flag &= ~(UI_ACTIVE|UI_SELECT); - - for(but= actbut->next; but; but= but->next) { - if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) { - but->flag |= UI_ACTIVE; - return; - } - } - for(but= block->buttons.first; but!=actbut; but= but->next) { - if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) { - but->flag |= UI_ACTIVE; - return; - } - } - } -} - -static void ui_but_prev_edittext(uiBlock *block) -{ - uiBut *but, *actbut; - - for(actbut= block->buttons.first; actbut; actbut= actbut->next) { - /* label and roundbox can overlap real buttons (backdrops...) */ - if(actbut->type!=LABEL && actbut->type!=ROUNDBOX) - if(actbut->flag & UI_ACTIVE) break; - } - if(actbut) { - /* ensure all buttons are cleared, label/roundbox overlap */ - for(but= block->buttons.first; but; but= but->next) - but->flag &= ~(UI_ACTIVE|UI_SELECT); - - for(but= actbut->prev; but; but= but->prev) { - if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) { - but->flag |= UI_ACTIVE; - return; - } - } - for(but= block->buttons.last; but!=actbut; but= but->prev) { - if(ELEM4(but->type, TEX, NUM, NUMSLI, HSVSLI)) { - but->flag |= UI_ACTIVE; - return; - } - } - } -} - -/* ******************************************************* */ - -/* nasty but safe way to store screendump rect */ -static int scr_x=0, scr_y=0, scr_sizex=0, scr_sizey=0; - -static void ui_set_screendump_bbox(uiBlock *block) -{ - if(block) { - scr_x= block->minx; - scr_y= block->miny; - scr_sizex= block->maxx - block->minx; - scr_sizey= block->maxy - block->miny; - } - else { - scr_sizex= scr_sizey= 0; - } -} - -/* used for making screenshots for menus, called in screendump.c */ -int uiIsMenu(int *x, int *y, int *sizex, int *sizey) -{ - if(scr_sizex!=0 && scr_sizey!=0) { - *x= scr_x; - *y= scr_y; - *sizex= scr_sizex; - *sizey= scr_sizey; - return 1; - } - - return 0; -} -/* ******************************************************* */ - -/* return: - * UI_NOTHING pass event to other ui's - * UI_CONT don't pass event to other ui's - * UI_RETURN something happened, return, swallow event - */ -static int ui_do_block(uiBlock *block, uiEvent *uevent, int movemouse_quit) -{ - uiBut *but, *bt; - int butevent, event, retval=UI_NOTHING, count, act=0; - int inside= 0, active=0; - - if(block->win != mywinget()) return UI_NOTHING; - - /* filter some unwanted events */ - /* btw: we allow event==0 for first time in menus, draws the hilited item */ - if(uevent==0 || uevent->event==LEFTSHIFTKEY || uevent->event==RIGHTSHIFTKEY) return UI_NOTHING; - if(uevent->event==UI_BUT_EVENT) return UI_NOTHING; - - if(block->flag & UI_BLOCK_ENTER_OK) { - if((uevent->event==RETKEY || uevent->event==PADENTER) && uevent->val) { - // printf("qual: %d %d %d\n", uevent->qual, get_qual(), G.qual); - if ((G.qual & LR_SHIFTKEY) == 0) { - return UI_RETURN_OK; - } - } - } - - ui_set_ftf_font(block->aspect); // sets just a pointer in ftf lib... the button dont have ftf handles - ui_set_screendump_bbox(block); - - // added this for panels in windows with buttons... - // maybe speed optimize should require test - if((block->flag & UI_BLOCK_LOOP)==0) { - glMatrixMode(GL_PROJECTION); - bwin_load_winmatrix(block->win, block->winmat); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - } - - Mat4CpyMat4(UIwinmat, block->winmat); - uiPanelPush(block); // push matrix; no return without pop! - - uiGetMouse(mywinget(), uevent->mval); /* transformed mouseco */ - - /* check boundbox and panel events */ - if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) { - - // inside block - if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) inside= INSIDE_BLOCK; - - if(block->panel && block->panel->paneltab==NULL) { - - /* clicked at panel header? */ - if( block->panel->flag & PNL_CLOSEDX) { - if(block->minx <= uevent->mval[0] && block->minx+PNL_HEADER >= uevent->mval[0]) - inside= INSIDE_PANEL_HEADER; - } - else if( (block->maxy <= uevent->mval[1]) && (block->maxy+PNL_HEADER >= uevent->mval[1]) ) { - inside= INSIDE_PANEL_HEADER; - } - else if( block->panel->control & UI_PNL_SCALE) { - if( (block->maxx-PNL_HEADER <= uevent->mval[0])) - if( (block->miny+PNL_HEADER >= uevent->mval[1]) && inside ) - inside= INSIDE_PANEL_SCALE; - } - - if (inside) { // this stuff should move to do_panel - - if(uevent->event==LEFTMOUSE) { - if(ELEM(inside, INSIDE_PANEL_HEADER, INSIDE_PANEL_SCALE)) { - uiPanelPop(block); // pop matrix; no return without pop! - if(inside==INSIDE_PANEL_HEADER) - ui_do_panel(block, uevent); - else - ui_scale_panel(block); - return UI_EXIT_LOOP; // exit loops because of moving panels - } - } - else if(uevent->event==ESCKEY) { - if(block->handler) { - rem_blockhandler(curarea, block->handler); - addqueue(curarea->win, REDRAW, 1); - } - } - else if(uevent->event==PADPLUSKEY || uevent->event==PADMINUS) { - int zoom=0; - - /* if panel is closed, only zoom if mouse is over the header */ - if ((block->panel->flag & PNL_CLOSEDX) || (block->panel->flag & PNL_CLOSEDY)) { - if (inside == INSIDE_PANEL_HEADER) - zoom=1; - } else if (inside >= INSIDE_BLOCK) - zoom=1; - - if(zoom) { - SpaceLink *sl= curarea->spacedata.first; - if(curarea->spacetype!=SPACE_BUTS) { - if(!(block->panel->control & UI_PNL_SCALE)) { - if(uevent->event==PADPLUSKEY) sl->blockscale+= 0.1; - else sl->blockscale-= 0.1; - CLAMP(sl->blockscale, 0.6, 1.0); - addqueue(block->winq, REDRAW, 1); - retval= UI_RETURN_OK; - } - } - } - - } - } - } - } - - /* inside menus, scrollwheel acts as arrow */ - if(block->flag & UI_BLOCK_LOOP) { - if(uevent->event==WHEELUPMOUSE) uevent->event= UPARROWKEY; - if(uevent->event==WHEELDOWNMOUSE) uevent->event= DOWNARROWKEY; - } - - switch(uevent->event) { - case LEFTARROWKEY: /* closing sublevels of pulldowns */ - if(uevent->val && (block->flag & UI_BLOCK_LOOP) && block->parent) { - return UI_RETURN_OUT; - } - break; - - case RIGHTARROWKEY: /* opening sublevels of pulldowns */ - if(uevent->val && (block->flag & UI_BLOCK_LOOP)) { - for(but= block->buttons.first; but; but= but->next) { - if(but->flag & UI_ACTIVE) { - if(but->type==BLOCK) { - but->flag &= ~UI_MOUSE_OVER; - uevent->event= BUT_ACTIVATE; - } - break; - } - } - if(but==NULL) { /* no item active, we make first active */ - if(block->direction & UI_TOP) but= ui_but_last(block); - else but= ui_but_first(block); - if(but) { - but->flag |= UI_ACTIVE; - ui_draw_but(but); - } - } - } - break; - - case PAD8: case PAD2: - case UPARROWKEY: - case DOWNARROWKEY: - if(inside || (block->flag & UI_BLOCK_LOOP)) { - /* arrowkeys: only handle for block_loop blocks */ - event= 0; - if(block->flag & UI_BLOCK_LOOP) { - event= uevent->event; - if(event==PAD8) event= UPARROWKEY; - if(event==PAD2) event= DOWNARROWKEY; - } - else { - if(uevent->event==PAD8) event= UPARROWKEY; - if(uevent->event==PAD2) event= DOWNARROWKEY; - } - if(event && uevent->val) { - - for(but= block->buttons.first; but; but= but->next) { - but->flag &= ~UI_MOUSE_OVER; - - if(but->flag & UI_ACTIVE) { - but->flag &= ~UI_ACTIVE; - ui_draw_but(but); - - if(event==UPARROWKEY) { - if(block->direction & UI_TOP) bt= ui_but_next(but); - else bt= ui_but_prev(but); - } - else { - if(block->direction & UI_TOP) bt= ui_but_prev(but); - else bt= ui_but_next(but); - } - - if(bt) { - bt->flag |= UI_ACTIVE; - ui_draw_but(bt); - break; - } - } - } - - /* nothing done */ - if(but==NULL) { - - if(event==UPARROWKEY) { - if(block->direction & UI_TOP) but= ui_but_first(block); - else but= ui_but_last(block); - } - else { - if(block->direction & UI_TOP) but= ui_but_last(block); - else but= ui_but_first(block); - } - if(but) { - but->flag |= UI_ACTIVE; - ui_draw_but(but); - } - } - retval= UI_CONT; - } - } - break; - - case ONEKEY: act= 1; - case TWOKEY: if(act==0) act= 2; - case THREEKEY: if(act==0) act= 3; - case FOURKEY: if(act==0) act= 4; - case FIVEKEY: if(act==0) act= 5; - case SIXKEY: if(act==0) act= 6; - case SEVENKEY: if(act==0) act= 7; - case EIGHTKEY: if(act==0) act= 8; - case NINEKEY: if(act==0) act= 9; - case ZEROKEY: if(act==0) act= 10; - - if( block->flag & UI_BLOCK_NUMSELECT ) { - - if(get_qual() & LR_ALTKEY) act+= 10; - - count= 0; - for(but= block->buttons.first; but; but= but->next) { - int doit= 0; - - if(but->type!=LABEL && but->type!=SEPR) count++; - /* exception for menus like layer buts, with button aligning they're not drawn in order */ - if(but->type==TOGR) { - if(but->bitnr==act-1) doit= 1; - } else if(count==act) doit=1; - - if(doit) { - but->flag |= UI_ACTIVE; - if(uevent->val==1) ui_draw_but(but); - else if(block->flag & UI_BLOCK_RET_1) { /* to make UI_BLOCK_RET_1 working */ - uevent->event= RETKEY; - uevent->val= 1; - //addqueue(block->winq, RIGHTARROWKEY, 1); (why! (ton)) - } - else { - uevent->event= LEFTMOUSE; /* to make sure the button is handled further on */ - uevent->val= 1; - } - } - else if(but->flag & UI_ACTIVE) { - but->flag &= ~UI_ACTIVE; - ui_draw_but(but); - } - } - } - break; - case BUT_NEXT: - ui_but_next_edittext(block); - break; - case BUT_PREV: - ui_but_prev_edittext(block); - break; - case BUT_ACTIVATE: - for(but= block->buttons.first; but; but= but->next) { - if(but->retval==uevent->val) but->flag |= UI_ACTIVE; - } - break; - case VKEY: - case CKEY: - if(uevent->val && (uevent->qual & (LR_CTRLKEY|LR_COMMANDKEY))) { - for(but= block->buttons.first; but; but= but->next) { - if(but->type!=LABEL && but->type!=ROUNDBOX) { - if(but->flag & UI_ACTIVE) { - int doit=0; - - if(uevent->event==VKEY) doit= ui_but_copy_paste(but, 'v'); - else ui_but_copy_paste(but, 'c'); - - if(doit) { - ui_draw_but(but); - - if(but->retval) addqueue(block->winq, UI_BUT_EVENT, (short)but->retval); - if((but->type==NUMSLI && but->a1) || (but->type==COL)) addqueue(block->winq, REDRAW, 1); // col button update - - BIF_undo_push(but->str); - } - // but we do return, to prevent passing event through other queues */ - if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK); - else if(but->retval) retval= UI_RETURN_OK; - break; - } - } - } - } - break; - - -#ifdef INTERNATIONAL - //HACK to let the chartab button react to the mousewheel and PGUP/PGDN keys - case WHEELUPMOUSE: - case PAGEUPKEY: - for(but= block->buttons.first; but; but= but->next) - { - if(but->type == CHARTAB && (but->flag & UI_MOUSE_OVER)) - { - G.charstart = G.charstart - (12*6); - if(G.charstart < 0) - G.charstart = 0; - if(G.charstart < G.charmin) - G.charstart = G.charmin; - ui_draw_but(but); - - //Really nasty... to update the num button from the same butblock - for(bt= block->buttons.first; bt; bt= bt->next) - { - if(bt->type == NUM) { - ui_check_but(bt); - ui_draw_but(bt); - } - } - retval=UI_CONT; - break; - } - } - break; - - case WHEELDOWNMOUSE: - case PAGEDOWNKEY: - for(but= block->buttons.first; but; but= but->next) - { - if(but->type == CHARTAB && (but->flag & UI_MOUSE_OVER)) - { - G.charstart = G.charstart + (12*6); - if(G.charstart > (0xffff - 12*6)) - G.charstart = 0xffff - (12*6); - if(G.charstart > G.charmax - 12*6) - G.charstart = G.charmax - 12*6; - ui_draw_but(but); - - for(bt= block->buttons.first; bt; bt= bt->next) - { - if(bt->type == NUM) { - ui_check_but(bt); - ui_draw_but(bt); - } - } - - but->flag |= UI_ACTIVE; - retval=UI_RETURN_OK; - break; - } - } - break; -#endif - - case PADENTER: - case RETKEY: // prevent treating this as mousemove. for example when you enter at popup - if(block->flag & UI_BLOCK_LOOP) break; - - default: - - for(but= block->buttons.first; but; but= but->next) { - - // active flag clear, it can have been set with number keys or arrows, prevents next loop from wrong selection on click - if(uevent->event==LEFTMOUSE) but->flag &= ~UI_ACTIVE; - - but->flag &= ~UI_MOUSE_OVER; - - /* check boundbox */ - if (uibut_contains_pt(but, uevent->mval)) { - but->flag |= UI_MOUSE_OVER; - UIbuttip= but; - } - /* hilite case 1 */ - if(but->flag & UI_MOUSE_OVER) { - if( (but->flag & UI_ACTIVE)==0) { - but->flag |= UI_ACTIVE; - if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but); - } - } - /* hilite case 2 */ - if(but->flag & UI_ACTIVE) { - if( (but->flag & UI_MOUSE_OVER)==0) { - /* we dont clear active flag until mouse move, for Menu buttons to remain showing active item when opened */ - if (uevent->event==MOUSEY) { - but->flag &= ~UI_ACTIVE; - if(but->type != LABEL && (but->flag & UI_NO_HILITE)==0) ui_draw_but(but); - } - } - else if(but->type==BLOCK || but->type==MENU || but->type==PULLDOWN || but->type==ICONTEXTROW) { // automatic opens block button (pulldown) - int time; - if(uevent->event!=LEFTMOUSE ) { - if(block->auto_open==2) time= 1; // test for toolbox - else if(block->auto_open) time= 5*U.menuthreshold2; - else if(U.uiflag & USER_MENUOPENAUTO) time= 5*U.menuthreshold1; - else time= -1; - - for (; time>0; time--) { - if (qtest()) break; - else PIL_sleep_ms(20); - } - - if(time==0) { - uevent->val= 1; // otherwise buttons dont react - ui_do_button(block, but, uevent); - } - } - } - if(but->flag & UI_ACTIVE) active= 1; - } - } - - /* if there are no active buttons... otherwise clear lines */ - if(active) ui_do_active_linklines(block, 0); - else ui_do_active_linklines(block, uevent->mval); - - } - - /* middlemouse exception, not for regular blocks */ - if( (block->flag & UI_BLOCK_LOOP) && uevent->event==MIDDLEMOUSE) uevent->event= LEFTMOUSE; - - /* the final dobutton */ - for(but= block->buttons.first; but; but= but->next) { - if(but->flag & UI_ACTIVE) { - - /* UI_BLOCK_RET_1: not return when val==0 */ - - if(uevent->val || (block->flag & UI_BLOCK_RET_1)==0) { - if ELEM6(uevent->event, LEFTMOUSE, PADENTER, RETKEY, BUT_ACTIVATE, BUT_NEXT, BUT_PREV) { - /* when mouse outside, don't do button */ - if(inside || uevent->event!=LEFTMOUSE) { - - if ELEM(uevent->event, BUT_NEXT, BUT_PREV) { - butevent= ui_act_as_text_but(but); - uibut_do_func(but); - } - else - butevent= ui_do_button(block, but, uevent); - - /* add undo pushes if... */ - if( !(block->flag & UI_BLOCK_LOOP)) { - if(!G.obedit) { - if ELEM5(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX); - else { - /* define which string to use for undo */ - if ELEM(but->type, LINK, INLINK) screen_delayed_undo_push("Add button link"); - else if ELEM(but->type, MENU, ICONTEXTROW) screen_delayed_undo_push(but->drawstr); - else if(but->drawstr[0]) screen_delayed_undo_push(but->drawstr); - else screen_delayed_undo_push(but->tip); - } - } - } - - if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent); - - /* i doubt about the next line! */ - /* if(but->func) mywinset(block->win); */ - - if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK); - else - if (butevent) retval= UI_RETURN_OK; - } - } - } - } - } - - /* flush to frontbuffer */ - if((block->flag & UI_BLOCK_LOOP)==0) { // no loop, might need total flush in uidoblocks() - ui_block_flush_back(block); - } - - uiPanelPop(block); // pop matrix; no return without pop! - - - /* the linkines... why not make buttons from it? Speed? Memory? */ - if(uevent->val && (uevent->event==XKEY || uevent->event==DELKEY)) - ui_delete_active_linkline(block); - - /* here we check return conditions for menus */ - if(block->flag & UI_BLOCK_LOOP) { - - if(inside==0 && uevent->val==1) { - if ELEM3(uevent->event, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) { - if(BLI_in_rctf(&block->parentrct, (float)uevent->mval[0], (float)uevent->mval[1])); - else return UI_RETURN_OUT; - } - } - - if(uevent->event==ESCKEY && uevent->val==1) return UI_RETURN_CANCEL; - - if((uevent->event==RETKEY || uevent->event==PADENTER) && uevent->val==1) return UI_RETURN_OK; - - /* check outside */ - if(inside==0 && movemouse_quit) { - uiBlock *tblock= NULL; - - /* check for all parent rects, enables arrowkeys to be used */ - if(uevent->event!=MOUSEX && uevent->event!=MOUSEY) { - for(tblock=block->parent; tblock; tblock= tblock->parent) { - if( BLI_in_rctf(&tblock->parentrct, (float)uevent->mval[0], (float)uevent->mval[1])) - break; - else if( BLI_in_rctf(&tblock->safety, (float)uevent->mval[0], (float)uevent->mval[1])) - break; - } - } - /* strict check, and include the parent rect */ - if(tblock); - else if( BLI_in_rctf(&block->parentrct, (float)uevent->mval[0], (float)uevent->mval[1])); - else if( ui_mouse_motion_towards_block(block, uevent)); - else if( BLI_in_rctf(&block->safety, (float)uevent->mval[0], (float)uevent->mval[1])); - else return UI_RETURN_OUT; - } - } - - return retval; -} - -static uiOverDraw *ui_draw_but_tip(uiBut *but) -{ - uiOverDraw *od; - float x1, x2, y1, y2; - rctf tip_bbox; - - BIF_GetBoundingBox(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS), &tip_bbox); - - x1= (but->x1+but->x2)/2; - x2= x1+but->aspect*((tip_bbox.xmax-tip_bbox.xmin) + 8); - y2= but->y1-10; - y1= y2-but->aspect*((tip_bbox.ymax+(tip_bbox.ymax-tip_bbox.ymin))); - - - /* for pulldown menus it doesnt work */ - if(mywinget()==G.curscreen->mainwin); - else { - ui_graphics_to_window(mywinget(), &x1, &y1); - ui_graphics_to_window(mywinget(), &x2, &y2); - } - - if(x2 > G.curscreen->sizex) { - x1 -= x2-G.curscreen->sizex; - x2= G.curscreen->sizex; - } - if(y1 < 0) { - y1 += 36; - y2 += 36; - } - - od= ui_begin_overdraw((int)(x1-1), (int)(y1-2), (int)(x2+4), (int)(y2+4)); - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, 20); - - gl_round_box(GL_POLYGON, x1+3, y1-1, x2+1, y2-2, 2.0); - gl_round_box(GL_POLYGON, x1+3, y1-2, x2+2, y2-2, 3.0); - - glColor4ub(0, 0, 0, 8); - - gl_round_box(GL_POLYGON, x1+3, y1-3, x2+3, y2-3, 4.0); - gl_round_box(GL_POLYGON, x1+3, y1-4, x2+4, y2-3, 5.0); - - glDisable(GL_BLEND); - - glColor3ub(0xFF, 0xFF, 0xDD); - glRectf(x1, y1, x2, y2); - - glColor3ub(0,0,0); - /* set the position for drawing text +4 in from the left edge, and leaving an equal gap between the top of the background box - * and the top of the string's tip_bbox, and the bottom of the background box, and the bottom of the string's tip_bbox - */ - ui_rasterpos_safe(x1+4, ((y2-tip_bbox.ymax)+(y1+tip_bbox.ymin))/2 - tip_bbox.ymin, but->aspect); - BIF_SetScale(1.0); - - BIF_DrawString(but->font, but->tip, (U.transopts & USER_TR_TOOLTIPS)); - - ui_flush_overdraw(od); /* to show it in the frontbuffer */ - return od; -} - -/* inside this function no global UIbuttip... qread is not safe */ -static void ui_do_but_tip(uiBut *buttip) -{ - uiOverDraw *od; - int time; - - if (buttip && buttip->tip && buttip->tip[0]) { - /* Pause for a moment to see if we - * should really display the tip - * or if the user will keep moving - * the pointer. - */ - for (time= 0; time<25; time++) { - if (anyqtest()) - return; - else - PIL_sleep_ms(20); - } - - /* Display the tip, and keep it displayed - * as long as the mouse remains on top - * of the button that owns it. - */ - Mat4CpyMat4(UIwinmat, buttip->block->winmat); // get rid of uiwinmat once... - uiPanelPush(buttip->block); // panel matrix - od= ui_draw_but_tip(buttip); - - if(od) { - while (1) { - char ascii; - short val; - unsigned short evt= extern_qread_ext(&val, &ascii); - - if (evt==MOUSEX || evt==MOUSEY) { - short mouse[2]; - uiGetMouse(od->oldwin, mouse); - - if (!uibut_contains_pt(buttip, mouse)) - break; - } else { - mainqpushback(evt, val, ascii); - break; - } - } - - ui_end_overdraw(od); - } - - uiPanelPop(buttip->block); // panel matrix - /* still the evil global.... */ - UIbuttip= NULL; - } -} - -/* returns UI_NOTHING, if nothing happened */ -int uiDoBlocks(ListBase *lb, int event, int movemouse_quit) -{ - /* return when: firstblock != BLOCK_LOOP - * - * 'cont' is used to make sure you can press another button while a looping menu - * is active. otherwise you have to press twice... - */ - - uiBlock *block, *first; - uiEvent uevent; - int retval= UI_NOTHING, cont= 1; - - if(lb->first==0) return UI_NOTHING; - - /* for every pixel both x and y events are generated, overloads the system! */ - if(event==MOUSEX) return UI_NOTHING; - - UIbuttip= NULL; - UIafterfunc_butm= NULL; /* to prevent infinite loops, this shouldnt be a global! */ - UIafterfunc_but= NULL; /* to prevent infinite loops, this shouldnt be a global! */ - UIafterfunc_arg1= UIafterfunc_arg2= NULL; - - uevent.qual= G.qual; - uevent.event= event; - uevent.val= 1; - - /* this is a caching mechanism, to prevent too many calls to glFrontBuffer and glFlush, which slows down interface */ - block= lb->first; - while(block) { - ui_block_set_flush(block, NULL); // clears all flushing info - block= block->next; - } - - /* main loop, needed when you click outside a looping block (menu) then it uses that - event to immediately evaluate the other uiBlocks again. */ - while(cont) { - - /* first loop, for the normal blocks */ - block= lb->first; - while(block) { - - /* for pupmenus, the bgnpupdraw sets (and later restores) the active - window. Then mousecoords get transformed OK. - It looks double... but a call to ui_do_block otherwise doesnt get handled properly - */ - if(block->flag & UI_BLOCK_REDRAW) { - if( block->flag & UI_BLOCK_LOOP) { - block->overdraw= ui_begin_overdraw((int)block->minx-1, (int)block->miny-10, (int)block->maxx+10, (int)block->maxy+1); - } - block->in_use= 1; // is always a menu - uiDrawBlock(block); - block->flag &= ~UI_BLOCK_REDRAW; - } - - block->in_use= 1; // bit awkward, but now we can detect if frontbuf flush should be set - retval |= ui_do_block(block, &uevent, movemouse_quit); /* we 'or' because 2nd loop can return to here, and we we want 'out' to return */ - block->in_use= 0; - if(retval & UI_EXIT_LOOP) break; - - /* now a new block could be created for menus, this is - inserted in the beginning of a list */ - - /* is there a flush cached? */ - if(block->needflush) { - ui_block_flush_overdraw(block); - block->needflush= 0; - } - - /* to make sure the matrix of the panel works for menus too */ - if(retval==UI_CONT || (retval & UI_RETURN)) break; - first= lb->first; if(first->flag & UI_BLOCK_LOOP) break; - - block= block->next; - } - - /* second loop, for menus (looping blocks). works for sub->menus too */ - block= lb->first; - if(block==NULL || (block->flag & UI_BLOCK_LOOP)==0) cont= 0; - - while( (block= lb->first) && (block->flag & UI_BLOCK_LOOP)) { - if(block->auto_open==0) block->auto_open= 1; - - /* this here, for menu buts */ - if(block->flag & UI_BLOCK_REDRAW) { - - if( block->flag & UI_BLOCK_LOOP) { - block->overdraw= ui_begin_overdraw((int)block->minx-1, (int)block->miny-6, (int)block->maxx+6, (int)block->maxy+1); - } - uiDrawBlock(block); - block->flag &= ~UI_BLOCK_REDRAW; - ui_flush_overdraw(block->overdraw); - block->needflush= 0; - } - - uevent.event= extern_qread(&uevent.val); - uevent.qual= G.qual; - - if(uevent.event) { - block->in_use= 1; // bit awkward, but now we can detect if frontbuf flush should be set - retval= ui_do_block(block, &uevent, movemouse_quit); - block->in_use= 0; - - if(block->needflush) { // flush (old menu) now, maybe new menu was opened - ui_block_flush_overdraw(block); - block->needflush= 0; - } - - if(retval & UI_RETURN) { - ui_end_overdraw(block->overdraw); - BLI_remlink(lb, block); - uiFreeBlock(block); - } - if(retval & (UI_RETURN_OK|UI_RETURN_CANCEL)) { - /* free other menus */ - while( (block= lb->first) && (block->flag & UI_BLOCK_LOOP)) { - ui_end_overdraw(block->overdraw); - BLI_remlink(lb, block); - uiFreeBlock(block); - } - } - } - - /* tooltip */ - if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) { - if(U.flag & USER_TOOLTIPS) ui_do_but_tip(UIbuttip); - } - } - - /* else it does the first part of this loop again, maybe another menu needs to be opened */ - if(retval==UI_CONT || (retval & UI_RETURN_OK)) cont= 0; - } - - /* clears screendump boundbox, call before afterfunc! */ - ui_set_screendump_bbox(NULL); - - /* afterfunc is used for fileloading too, so after this call, the blocks pointers are invalid */ - if(retval & UI_RETURN_OK) { - if(UIafterfunc_butm) { - mywinset(curarea->win); - UIafterfunc_butm(UIafterfunc_arg1, UIafterval); - UIafterfunc_butm= NULL; - } - if(UIafterfunc_but) { - mywinset(curarea->win); - UIafterfunc_but(UIafterfunc_arg1, UIafterfunc_arg2); - UIafterfunc_but= NULL; - } - } - - /* tooltip */ - if(retval==UI_NOTHING && (uevent.event==MOUSEX || uevent.event==MOUSEY)) { - if(U.flag & USER_TOOLTIPS) ui_do_but_tip(UIbuttip); - } - - return retval; -} - -/* ************** DATA *************** */ - -/* for buttons pointing to color for example */ -void ui_get_but_vectorf(uiBut *but, float *vec) -{ - void *poin; - - poin= but->poin; - - if( but->pointype == CHA ) { - char *cp= (char *)poin; - vec[0]= ((float)cp[0])/255.0; - vec[1]= ((float)cp[1])/255.0; - vec[2]= ((float)cp[2])/255.0; - } - else if( but->pointype == FLO ) { - float *fp= (float *)poin; - VECCOPY(vec, fp); - } -} -/* for buttons pointing to color for example */ -void ui_set_but_vectorf(uiBut *but, float *vec) -{ - void *poin; - - poin= but->poin; - - if( but->pointype == CHA ) { - char *cp= (char *)poin; - cp[0]= (char)(0.5 +vec[0]*255.0); - cp[1]= (char)(0.5 +vec[1]*255.0); - cp[2]= (char)(0.5 +vec[2]*255.0); - } - else if( but->pointype == FLO ) { - float *fp= (float *)poin; - VECCOPY(fp, vec); - } -} - -double ui_get_but_val(uiBut *but) -{ - void *poin; - double value = 0.0; - - if(but->poin==NULL) return 0.0; - poin= but->poin; - - if(but->type== HSVSLI) { - float h, s, v, *fp= (float *) poin; - - rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v); - - switch(but->str[0]) { - case 'H': value= h; break; - case 'S': value= s; break; - case 'V': value= v; break; - } - - } - else if( but->pointype == CHA ) { - value= *(char *)poin; - } - else if( but->pointype == SHO ) { - value= *(short *)poin; - } - else if( but->pointype == INT ) { - value= *(int *)poin; - } - else if( but->pointype == FLO ) { - value= *(float *)poin; - } - - return value; -} - -static void ui_set_but_val(uiBut *but, double value) -{ - void *poin; - - if(but->pointype==0) return; - poin= but->poin; - - /* value is a hsv value: convert to rgb */ - if( but->type==HSVSLI ) { - float h, s, v, *fp= (float *)but->poin; - - rgb_to_hsv(fp[0], fp[1], fp[2], &h, &s, &v); - - switch(but->str[0]) { - case 'H': h= value; break; - case 'S': s= value; break; - case 'V': v= value; break; - } - - hsv_to_rgb(h, s, v, fp, fp+1, fp+2); - - } - else if( but->pointype==CHA ) - *((char *)poin)= (char)floor(value+0.5); - else if( but->pointype==SHO ) { - /* gcc 3.2.1 seems to have problems - * casting a double like 32772.0 to - * a short so we cast to an int, then - to a short */ - int gcckludge; - gcckludge = (int) floor(value+0.5); - *((short *)poin)= (short) gcckludge; - } - else if( but->pointype==INT ) - *((int *)poin)= (int)floor(value+0.5); - else if( but->pointype==FLO ) { - float fval= (float)value; - if(fval>= -0.00001f && fval<= 0.00001f) fval= 0.0f; /* prevent negative zero */ - *((float *)poin)= fval; - } - - /* update select flag */ - ui_is_but_sel(but); - -} - -void uiSetCurFont(uiBlock *block, int index) -{ - - ui_set_ftf_font(block->aspect); - - if(block->aspect<0.60) { - block->curfont= UIfont[index].xl; - } - else if(block->aspect<1.15) { - block->curfont= UIfont[index].large; - } - else if(block->aspect<1.59) { - block->curfont= UIfont[index].medium; - } - else { - block->curfont= UIfont[index].small; - } - - if(block->curfont==NULL) block->curfont= UIfont[index].large; - if(block->curfont==NULL) block->curfont= UIfont[index].medium; - if(block->curfont==NULL) printf("error block no font %s\n", block->name); - -} - -/* called by node editor */ -void *uiSetCurFont_ext(float aspect) -{ - void *curfont; - - ui_set_ftf_font(aspect); - - if(aspect<0.60) { - curfont= UIfont[0].xl; - } - else if(aspect<1.15) { - curfont= UIfont[0].large; - } - else if(aspect<1.59) { - curfont= UIfont[0].medium; - } - else { - curfont= UIfont[0].small; - } - - if(curfont==NULL) curfont= UIfont[0].large; - if(curfont==NULL) curfont= UIfont[0].medium; - - return curfont; -} - -void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small) -{ - if(index>=UI_ARRAY) return; - - UIfont[index].xl= xl; - UIfont[index].large= large; - UIfont[index].medium= medium; - UIfont[index].small= small; -} - -static void ui_free_link(uiLink *link) -{ - if(link) { - BLI_freelistN(&link->lines); - MEM_freeN(link); - } -} - -static void ui_free_but(uiBut *but) -{ - if(but->str && but->str != but->strdata) MEM_freeN(but->str); - ui_free_link(but->link); - - MEM_freeN(but); -} - -void uiFreeBlock(uiBlock *block) -{ - uiBut *but; - - if(block->flag & UI_BLOCK_BUSY) printf("attempt to free busy buttonblock: %p\n", block); - - while( (but= block->buttons.first) ) { - BLI_remlink(&block->buttons, but); - ui_free_but(but); - } - - if(block->panel) block->panel->active= 0; - - - MEM_freeN(block); - UIbuttip= NULL; -} - -void uiFreeBlocks(ListBase *lb) -{ - uiBlock *block; - - while( (block= lb->first) ) { - BLI_remlink(lb, block); - uiFreeBlock(block); - } -} - -void uiFreeBlocksWin(ListBase *lb, int win) -{ - uiBlock *block, *blockn; - - block= lb->first; - while(block) { - blockn= block->next; - if(block->win==win) { - BLI_remlink(lb, block); - uiFreeBlock(block); - } - block= blockn; - } -} - -uiBlock *uiNewBlock(ListBase *lb, char *name, short dt, short font, short win) -{ - uiBlock *block; - - /* each listbase only has one block with this name */ - if(lb) { - for (block= lb->first; block; block= block->next) - if (BLI_streq(block->name, name)) - break; - if (block) { - BLI_remlink(lb, block); - uiFreeBlock(block); - } - } - - block= MEM_callocN(sizeof(uiBlock), "uiBlock"); - if(lb) BLI_addhead(lb, block); /* at the beginning of the list! for dynamical menus/blocks */ - - strcpy(block->name, name); - /* draw win */ - block->win= win; - /* window where queue event should be added, pretty weak this way! - this is because the 'mainwin' pup menu's */ - block->winq= mywinget(); - block->dt= dt; - block->themecol= TH_AUTO; - - /* aspect */ - bwin_getsinglematrix(win, block->winmat); - - if (win==G.curscreen->mainwin) { - block->aspect= 1.0; - block->auto_open= 2; - } else { - int getsizex, getsizey; - - bwin_getsize(win, &getsizex, &getsizey); - block->aspect= 2.0/( (getsizex)*block->winmat[0][0]); - } - - uiSetCurFont(block, font); - - UIbuttip= NULL; - UIlock= 0; - - return block; -} - -uiBlock *uiGetBlock(char *name, ScrArea *sa) -{ - uiBlock *block= sa->uiblocks.first; - - while(block) { - if( strcmp(name, block->name)==0 ) return block; - block= block->next; - } - - return NULL; -} - -void ui_check_but(uiBut *but) -{ - /* if something changed in the button */ - ID *id; - double value; - float okwidth; - int transopts= (U.transopts & USER_TR_BUTTONS); - short pos; - - ui_is_but_sel(but); - - if(but->type==TEX || but->type==IDPOIN) transopts= 0; - - /* test for min and max, icon sliders, etc */ - switch( but->type ) { - case NUM: - case SLI: - case SCROLL: - case NUMSLI: - case HSVSLI: - value= ui_get_but_val(but); - if(value < but->min) value= but->min; - if(value > but->max) value= but->max; - ui_set_but_val(but, value); - break; - - case ICONTOG: - case ICONTOGN: - if(but->flag & UI_SELECT) but->iconadd= 1; - else but->iconadd= 0; - break; - - case ICONROW: - value= ui_get_but_val(but); - but->iconadd= (int)value- (int)(but->min); - break; - - case ICONTEXTROW: - value= ui_get_but_val(but); - but->iconadd= (int)value- (int)(but->min); - break; - } - - - /* safety is 4 to enable small number buttons (like 'users') */ - if(but->type==NUMSLI || but->type==HSVSLI) - okwidth= -4 + (but->x2 - but->x1)/2.0; - else - okwidth= -4 + (but->x2 - but->x1); - - /* name: */ - switch( but->type ) { - - case MENU: - case ICONTEXTROW: - - if(but->x2 - but->x1 > 24) { - value= ui_get_but_val(but); - ui_set_name_menu(but, (int)value); - } - break; - - case NUM: - case NUMSLI: - case HSVSLI: - - value= ui_get_but_val(but); - - if( but->pointype==FLO ) { - if(but->a2) { /* amount of digits defined */ - if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value); - else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value); - else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value); - else sprintf(but->drawstr, "%s%.4f", but->str, value); - } - else { - if(but->max<10.001) sprintf(but->drawstr, "%s%.3f", but->str, value); - else sprintf(but->drawstr, "%s%.2f", but->str, value); - } - } - else { - sprintf(but->drawstr, "%s%d", but->str, (int)value); - } - break; - - case LABEL: - if( but->pointype==FLO && but->poin) { - value= ui_get_but_val(but); - if(but->a2) { /* amount of digits defined */ - if(but->a2==1) sprintf(but->drawstr, "%s%.1f", but->str, value); - else if(but->a2==2) sprintf(but->drawstr, "%s%.2f", but->str, value); - else if(but->a2==3) sprintf(but->drawstr, "%s%.3f", but->str, value); - else sprintf(but->drawstr, "%s%.4f", but->str, value); - } - else { - sprintf(but->drawstr, "%s%.2f", but->str, value); - } - } - else strcpy(but->drawstr, but->str); - - break; - - case IDPOIN: - id= *(but->idpoin_idpp); - strcpy(but->drawstr, but->str); - if(id) strcat(but->drawstr, id->name+2); - break; - - case TEX: - strcpy(but->drawstr, but->str); - strcat(but->drawstr, but->poin); - break; - - case KEYEVT: - strcpy(but->drawstr, but->str); - if (but->flag & UI_SELECT) { - strcat(but->drawstr, "Press a key"); - } else { - strcat(but->drawstr, key_event_to_string((short) ui_get_but_val(but))); - } - break; - case BUT_TOGDUAL: - /* trying to get the dual-icon to left of text... not very nice */ - if(but->str[0]) { - strcpy(but->drawstr, " "); - strcpy(but->drawstr+2, but->str); - } - break; - default: - strcpy(but->drawstr, but->str); - - } - - if(but->drawstr[0]) { - but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, transopts); - // here should be check for less space for icon offsets... - if(but->type==MENU) okwidth -= 15; - } - else - but->strwidth= 0; - - /* automatic width */ - if(but->x2==0.0f && but->x1 > 0.0f) { - but->x2= (but->x1+but->strwidth+6); - } - - if(but->strwidth==0) but->drawstr[0]= 0; - else if(but->type==BUTM || but->type==BLOCK); // no clip string, uiTextBoundsBlock is used (hack!) - else { - - /* calc but->ofs, to draw the string shorter if too long */ - but->ofs= 0; - while(but->strwidth > (int)okwidth ) { - - if ELEM(but->type, NUM, TEX) { // only these cut off left - but->ofs++; - but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, transopts); - - /* textbut exception */ - if(but->pos != -1) { - pos= but->pos+strlen(but->str); - if(pos-1 < but->ofs) { - pos= but->ofs-pos+1; - but->ofs -= pos; - if(but->ofs<0) { - but->ofs= 0; - pos--; - } - but->drawstr[ strlen(but->drawstr)-pos ]= 0; - } - } - } - else { - but->drawstr[ strlen(but->drawstr)-1 ]= 0; - but->strwidth= but->aspect*BIF_GetStringWidth(but->font, but->drawstr, transopts); - } - - if(but->strwidth < 10) break; - } - } -} - -static int ui_auto_themecol(uiBut *but) -{ - - switch(but->type) { - case BUT: - return TH_BUT_ACTION; - case ROW: - case TOG: - case TOG3: - case TOGR: - case TOGN: - case BUT_TOGDUAL: - return TH_BUT_SETTING; - case SLI: - case NUM: - case NUMSLI: - case HSVSLI: - return TH_BUT_NUM; - case TEX: - return TH_BUT_TEXTFIELD; - case PULLDOWN: - case BLOCK: - case MENU: - case BUTM: - // (weak!) detect if it is a blockloop - if(but->block->dt == UI_EMBOSSP) return TH_MENU_ITEM; - return TH_BUT_POPUP; - default: - return TH_BUT_NEUTRAL; - } -} - -void uiBlockBeginAlign(uiBlock *block) -{ - /* if other align was active, end it */ - if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block); - - block->flag |= UI_BUT_ALIGN_DOWN; - /* buttons declared after this call will this align flag */ -} - -static int buts_are_horiz(uiBut *but1, uiBut *but2) -{ - float dx, dy; - - dx= fabs( but1->x2 - but2->x1); - dy= fabs( but1->y1 - but2->y2); - - if(dx > dy) return 0; - return 1; -} - -void uiBlockEndAlign(uiBlock *block) -{ - uiBut *prev, *but=NULL, *next; - int flag= 0, cols=0, rows=0; - int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE); - - if ( !(ELEM3(theme, TH_MINIMAL, TH_SHADED, TH_ROUNDED)) ) { - block->flag &= ~UI_BUT_ALIGN; // all 4 flags - return; - } - - /* auto align: - - go back to first button of align start (ALIGN_DOWN) - - compare triples, and define flags - */ - prev= block->buttons.last; - while(prev) { - if( (prev->flag & UI_BUT_ALIGN_DOWN)) but= prev; - else break; - - if(but && but->next) { - if(buts_are_horiz(but, but->next)) cols++; - else rows++; - } - - prev= prev->prev; - } - if(but==NULL) return; - - /* rows==0: 1 row, cols==0: 1 collumn */ - - /* note; how it uses 'flag' in loop below (either set it, or OR it) is confusing */ - prev= NULL; - while(but) { - next= but->next; - - /* clear old flag */ - but->flag &= ~UI_BUT_ALIGN_DOWN; - - if(flag==0) { /* first case */ - if(next) { - if(buts_are_horiz(but, next)) { - if(rows==0) - flag= UI_BUT_ALIGN_RIGHT; - else - flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT; - } - else { - flag= UI_BUT_ALIGN_DOWN; - } - } - } - else if(next==NULL) { /* last case */ - if(prev) { - if(buts_are_horiz(prev, but)) { - if(rows==0) - flag= UI_BUT_ALIGN_LEFT; - else - flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT; - } - else flag= UI_BUT_ALIGN_TOP; - } - } - else if(buts_are_horiz(but, next)) { - /* check if this is already second row */ - if( prev && buts_are_horiz(prev, but)==0) { - flag |= UI_BUT_ALIGN_TOP; - /* exception case: bottom row */ - if(rows>0) { - uiBut *bt= but; - while(bt) { - if(bt->next && buts_are_horiz(bt, bt->next)==0 ) break; - bt= bt->next; - } - if(bt==0) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT; - } - } - else flag |= UI_BUT_ALIGN_LEFT; - } - else { - if(cols==0) { - flag |= UI_BUT_ALIGN_TOP; - } - else { /* next button switches to new row */ - if( (flag & UI_BUT_ALIGN_TOP)==0) { /* stil top row */ - if(prev) - flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT; - else - flag |= UI_BUT_ALIGN_DOWN; - } - else - flag |= UI_BUT_ALIGN_TOP; - } - } - - but->flag |= flag; - - /* merge coordinates */ - if(prev) { - // simple cases - if(rows==0) { - but->x1= (prev->x2+but->x1)/2.0; - prev->x2= but->x1; - } - else if(cols==0) { - but->y2= (prev->y1+but->y2)/2.0; - prev->y1= but->y2; - } - else { - if(buts_are_horiz(prev, but)) { - but->x1= (prev->x2+but->x1)/2.0; - prev->x2= but->x1; - /* copy height too */ - but->y2= prev->y2; - } - else if(prev->prev && buts_are_horiz(prev->prev, prev)==0) { - /* the previous button is a single one in its row */ - but->y2= (prev->y1+but->y2)/2.0; - prev->y1= but->y2; - } - else { - /* the previous button is not a single one in its row */ - but->y2= prev->y1; - } - } - } - - prev= but; - but= next; - } - - block->flag &= ~UI_BUT_ALIGN; // all 4 flags -} - -#if 0 -static void uiBlockEndAligno(uiBlock *block) -{ - uiBut *but; - - /* correct last defined button */ - but= block->buttons.last; - if(but) { - /* vertical align case */ - if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_DOWN) ) { - but->flag &= ~UI_BUT_ALIGN_DOWN; - } - /* horizontal align case */ - if( (block->flag & UI_BUT_ALIGN) == (UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT) ) { - but->flag &= ~UI_BUT_ALIGN_RIGHT; - } - /* else do nothing, manually provided flags */ - } - block->flag &= ~UI_BUT_ALIGN; // all 4 flags -} -#endif - -/* -ui_def_but is the function that draws many button types - -for float buttons: - "a1" Click Step (how much to change the value each click) - "a2" Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4, - all greater values will be clamped to 4. - -*/ -static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - uiBut *but; - short slen; - - if(type & BUTPOIN) { /* a pointer is required */ - if(poin==NULL) { - /* if pointer is zero, button is removed and not drawn */ - BIF_ThemeColor(block->themecol); - glRects(x1, y1, x1+x2, y1+y2); - return NULL; - } - } - - but= MEM_callocN(sizeof(uiBut), "uiBut"); - - but->type= type & BUTTYPE; - but->pointype= type & BUTPOIN; - but->bit= type & BIT; - but->bitnr= type & 31; - but->icon = 0; - - BLI_addtail(&block->buttons, but); - - but->retval= retval; - if( strlen(str)>=UI_MAX_NAME_STR-1 ) { - but->str= MEM_callocN( strlen(str)+2, "uiDefBut"); - strcpy(but->str, str); - } - else { - but->str= but->strdata; - strcpy(but->str, str); - } - but->x1= x1; - but->y1= y1; - if(block->autofill) { - but->x2= x2; - but->y2= y2; - } - else { - but->x2= (x1+x2); - but->y2= (y1+y2); - } - but->poin= poin; - but->min= min; - but->max= max; - but->a1= a1; - but->a2= a2; - but->tip= tip; - - but->font= block->curfont; - - but->lock= UIlock; - but->lockstr= UIlockstr; - - but->aspect= block->aspect; - but->win= block->win; - but->block= block; // pointer back, used for frontbuffer status, and picker - - if(block->themecol==TH_AUTO) but->themecol= ui_auto_themecol(but); - else but->themecol= block->themecol; - - if (but->type==BUTM) { - but->butm_func= block->butm_func; - but->butm_func_arg= block->butm_func_arg; - } else { - but->func= block->func; - but->func_arg1= block->func_arg1; - but->func_arg2= block->func_arg2; - } - - ui_set_embossfunc(but, block->dt); - - but->pos= -1; /* cursor invisible */ - - if(but->type==NUM) { /* add a space to name */ - slen= strlen(but->str); - if(slen>0 && slenstr[slen-1]!=' ') { - but->str[slen]= ' '; - but->str[slen+1]= 0; - } - } - } - - if(but->type==HSVCUBE) { /* hsv buttons temp storage */ - float rgb[3]; - ui_get_but_vectorf(but, rgb); - rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); - } - - if ELEM8(but->type, HSVSLI , NUMSLI, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM) { - but->flag |= UI_TEXT_LEFT; - } - - if(but->type==BUT_TOGDUAL) { - but->flag |= UI_ICON_LEFT; - } - - if(but->type==ROUNDBOX) - but->flag |= UI_NO_HILITE; - - but->flag |= (block->flag & UI_BUT_ALIGN); - if(block->flag & UI_BLOCK_NO_HILITE) - but->flag |= UI_NO_HILITE; - - return but; -} - -uiBut *uiDefBut(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); - - ui_check_but(but); - - return but; -} - - /* if _x_ is a power of two (only one bit) return the power, - * otherwise return -1. - * (1<>=16; - if (x&0xFF00) idx+=8, x>>=8; - if (x&0xF0) idx+=4, x>>=4; - if (x&0xC) idx+=2, x>>=2; - if (x&0x2) idx+=1; - - return idx; - } -} - -/* autocomplete helper functions */ -struct AutoComplete { - int maxlen; - char *truncate; - char *startname; -}; - -AutoComplete *autocomplete_begin(char *startname, int maxlen) -{ - AutoComplete *autocpl; - - autocpl= MEM_callocN(sizeof(AutoComplete), "AutoComplete"); - autocpl->maxlen= maxlen; - autocpl->truncate= MEM_callocN(sizeof(char)*maxlen, "AutoCompleteTruncate"); - autocpl->startname= startname; - - return autocpl; -} - -void autocomplete_do_name(AutoComplete *autocpl, const char *name) -{ - char *truncate= autocpl->truncate; - char *startname= autocpl->startname; - int a; - - for(a=0; amaxlen-1; a++) { - if(startname[a]==0 || startname[a]!=name[a]) - break; - } - /* found a match */ - if(startname[a]==0) { - /* first match */ - if(truncate[0]==0) - BLI_strncpy(truncate, name, autocpl->maxlen); - else { - /* remove from truncate what is not in bone->name */ - for(a=0; amaxlen-1; a++) { - if(truncate[a]!=name[a]) - truncate[a]= 0; - } - } - } -} - -void autocomplete_end(AutoComplete *autocpl, char *autoname) -{ - if(autocpl->truncate[0]) - BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen); - else - BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen); - - MEM_freeN(autocpl->truncate); - MEM_freeN(autocpl); -} - -/* autocomplete callback for ID buttons */ -static void autocomplete_id(char *str, void *arg_v) -{ - int blocktype= (long)arg_v; - ListBase *listb= wich_libbase(G.main, blocktype); - - if(listb==NULL) return; - - /* search if str matches the beginning of an ID struct */ - if(str[0]) { - AutoComplete *autocpl= autocomplete_begin(str, 22); - ID *id; - - for(id= listb->first; id; id= id->next) - autocomplete_do_name(autocpl, id->name+2); - - autocomplete_end(autocpl, str); - } -} - -static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - int bitIdx= findBitIndex(bit); - if (bitIdx==-1) { - return NULL; - } else { - return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); - } -} -uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} - -uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip); - - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; - - ui_check_but(but); - - return but; -} -static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - int bitIdx= findBitIndex(bit); - if (bitIdx==-1) { - return NULL; - } else { - return uiDefIconBut(block, type|BIT|bitIdx, retval, icon, x1, y1, x2, y2, poin, min, max, a1, a2, tip); - } -} - -uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} - -/* Button containing both string label and icon */ -uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); - - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; - - but->flag|= UI_ICON_LEFT; - - ui_check_but(but); - - return but; -} -static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) -{ - int bitIdx= findBitIndex(bit); - if (bitIdx==-1) { - return NULL; - } else { - return uiDefIconTextBut(block, type|BIT|bitIdx, retval, icon, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); - } -} - -uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} -uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) -{ - return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); -} - -/* END Button containing both string label and icon */ - -void uiAutoBlock(uiBlock *block, float minx, float miny, float sizex, float sizey, int flag) -{ - block->minx= minx; - block->maxx= minx+sizex; - block->miny= miny; - block->maxy= miny+sizey; - - block->autofill= flag; /* also check for if it has to be done */ - -} - -void uiSetButLink(uiBut *but, void **poin, void ***ppoin, short *tot, int from, int to) -{ - uiLink *link; - - link= but->link= MEM_callocN(sizeof(uiLink), "new uilink"); - - link->poin= poin; - link->ppoin= ppoin; - link->totlink= tot; - link->fromcode= from; - link->tocode= to; -} - -/* cruft to make uiBlock and uiBut private */ - -int uiBlocksGetYMin(ListBase *lb) -{ - uiBlock *block; - int min= 0; - - for (block= lb->first; block; block= block->next) - if (block==lb->first || block->minyminy; - - return min; -} - -int uiBlockGetCol(uiBlock *block) -{ - return block->themecol; -} -void uiBlockSetCol(uiBlock *block, int col) -{ - block->themecol= col; -} -void uiBlockSetEmboss(uiBlock *block, int emboss) -{ - block->dt= emboss; -} -void uiBlockSetDirection(uiBlock *block, int direction) -{ - block->direction= direction; -} - -/* this call escapes if there's alignment flags */ -void uiBlockFlipOrder(uiBlock *block) -{ - ListBase lb; - uiBut *but, *next; - float centy, miny=10000, maxy= -10000; - -// if(U.uiflag & USER_PLAINMENUS) -// return; - - for(but= block->buttons.first; but; but= but->next) { - if(but->flag & UI_BUT_ALIGN) return; - if(but->y1 < miny) miny= but->y1; - if(but->y2 > maxy) maxy= but->y2; - } - /* mirror trick */ - centy= (miny+maxy)/2.0; - for(but= block->buttons.first; but; but= but->next) { - but->y1 = centy-(but->y1-centy); - but->y2 = centy-(but->y2-centy); - SWAP(float, but->y1, but->y2); - } - - /* also flip order in block itself, for example for arrowkey */ - lb.first= lb.last= NULL; - but= block->buttons.first; - while(but) { - next= but->next; - BLI_remlink(&block->buttons, but); - BLI_addtail(&lb, but); - but= next; - } - block->buttons= lb; -} - - -void uiBlockSetFlag(uiBlock *block, int flag) -{ - block->flag= flag; -} -void uiBlockSetXOfs(uiBlock *block, int xofs) -{ - block->xofs= xofs; -} -void* uiBlockGetCurFont(uiBlock *block) -{ - return block->curfont; -} - -void uiButSetFlag(uiBut *but, int flag) -{ - but->flag|= flag; -} -void uiButClearFlag(uiBut *but, int flag) -{ - but->flag&= ~flag; -} - -int uiButGetRetVal(uiBut *but) -{ - return but->retval; -} - - -void uiBlockSetButmFunc(uiBlock *block, void (*menufunc)(void *arg, int event), void *arg) -{ - block->butm_func= menufunc; - block->butm_func_arg= arg; -} - -void uiBlockSetFunc(uiBlock *block, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2) -{ - block->func= func; - block->func_arg1= arg1; - block->func_arg2= arg2; -} - -void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)()) -{ - block->drawextra= func; -} - -void uiButSetFunc(uiBut *but, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2) -{ - but->func= func; - but->func_arg1= arg1; - but->func_arg2= arg2; -} - -void uiButSetCompleteFunc(uiBut *but, void (*func)(char *str, void *arg), void *arg) -{ - but->autocomplete_func= func; - but->autofunc_arg= arg; -} - - -uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, short x1, short y1, short x2, short y2, void *idpp, char *tip) -{ - uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); - but->idpoin_func= func; - but->idpoin_idpp= (ID**) idpp; - ui_check_but(but); - - if(blocktype) - uiButSetCompleteFunc(but, autocomplete_id, (void *)(long)blocktype); - - return but; -} - -uiBut *uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) -{ - uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); - but->block_func= func; - ui_check_but(but); - return but; -} - -uiBut *uiDefPulldownBut(uiBlock *block, uiBlockFuncFP func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) -{ - uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); - but->block_func= func; - ui_check_but(but); - return but; -} - -/* Block button containing both string label and icon */ -uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) -{ - uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); - - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; - - but->flag|= UI_ICON_LEFT; - but->flag|= UI_ICON_RIGHT; - - but->block_func= func; - ui_check_but(but); - - return but; -} - -/* Block button containing icon */ -uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip) -{ - uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); - - but->icon= (BIFIconID) icon; - but->flag|= UI_HAS_ICON; - - but->flag|= UI_ICON_LEFT; - but->flag|= UI_ICON_RIGHT; - - but->block_func= func; - ui_check_but(but); - - return but; -} - -void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip) -{ - uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip); - ui_check_but(but); -} - -/* ******************** PUPmenu ****************** */ - -static int pupmenu_set= 0; - -void pupmenu_set_active(int val) -{ - pupmenu_set= val; -} - -/* value== -1 read, otherwise set */ -static int pupmenu_memory(char *str, int value) -{ - static char mem[256], first=1; - int val=0, nr=0; - - if(first) { - memset(mem, 0, 256); - first= 0; - } - while(str[nr]) { - val+= str[nr]; - nr++; - } - - if(value >= 0) mem[ val & 255 ]= value; - else return mem[ val & 255 ]; - - return 0; -} - -#define PUP_LABELH 6 -short pupmenu(char *instr) -{ - uiBlock *block; - ListBase listb= {NULL, NULL}; - int event; - short lastselected, width, height=0, mousexmove = 0, mouseymove, xmax, ymax, mval[2], val= -1; - short a, startx, starty, endx, endy, boxh=TBOXH, x1, y1; - MenuData *md; - - /* block stuff first, need to know the font */ - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); - block->themecol= TH_MENU_ITEM; - - md= decompose_menu_string(instr); - - /* size and location, title slightly bigger for bold */ - if(md->title) width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & USER_TR_BUTTONS)); - else width= 0; - for(a=0; anitems; a++) { - char *name= md->items[a].str; - - xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & USER_TR_BUTTONS)); - if(xmax>width) width= xmax; - - if( strcmp(name, "%l")==0) height+= PUP_LABELH; - else height+= boxh; - } - - width+= 10; - - xmax = G.curscreen->sizex; - ymax = G.curscreen->sizey; - - getmouseco_sc(mval); - - /* set first item */ - lastselected= 0; - if(pupmenu_set) { - lastselected= pupmenu_set-1; - pupmenu_set= 0; - } - else if(md->nitems>1) { - lastselected= pupmenu_memory(instr, -1); - } - - startx= mval[0]-(0.8*(width)); - starty= mval[1]-height+boxh/2; - if(lastselected>=0 && lastselectednitems) { - for(a=0; anitems; a++) { - if(a==lastselected) break; - if( strcmp(md->items[a].str, "%l")==0) starty+= PUP_LABELH; - else starty+=boxh; - } - - //starty= mval[1]-height+boxh/2+lastselected*boxh; - } - - mouseymove= 0; - - if(startx<10) startx= 10; - if(starty<10) { - mouseymove= 10-starty; - starty= 10; - } - - endx= startx+width; - endy= starty+height; - if(endx>xmax) { - endx= xmax-10; - startx= endx-width; - } - if(endy>ymax-20) { - mouseymove= ymax-endy-20; - endy= ymax-20; - starty= endy-height; - - } - - if(mouseymove) { - ui_warp_pointer(mval[0], mouseymove+mval[1]); - mousexmove= mval[0]; - mouseymove= mval[1]; - } - - /* here we go! */ - if(md->title) { - uiBut *bt; - char titlestr[256]; - uiSetCurFont(block, UI_HELVB); - - if (md->titleicon) { - width+= 20; - sprintf(titlestr, " %s", md->title); - uiDefIconTextBut(block, LABEL, 0, md->titleicon, titlestr, startx, (short)(starty+height), width, boxh, NULL, 0.0, 0.0, 0, 0, ""); - } else { - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+height), width, boxh, NULL, 0.0, 0.0, 0, 0, ""); - bt->flag= UI_TEXT_LEFT; - } - uiSetCurFont(block, UI_HELV); - } - - y1= starty + height - boxh; - x1= startx; - - for(a=0; anitems; a++) { - char *name= md->items[a].str; - - if( strcmp(name, "%l")==0) { - uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, ""); - y1 -= PUP_LABELH; - } - else { - uiDefButS(block, BUTM, B_NOP, name, x1, y1, width, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= boxh; - } - } - - uiBoundsBlock(block, 1); - - event= uiDoBlocks(&listb, 0, 1); - - /* calculate last selected */ - if(event & UI_RETURN_OK) { - lastselected= 0; - for(a=0; anitems; a++) { - if(val==md->items[a].retval) lastselected= a; - } - - pupmenu_memory(instr, lastselected); - } - menudata_free(md); - - if(mouseymove && (event & UI_RETURN_OUT)==0) ui_warp_pointer(mousexmove, mouseymove); - return val; -} - -short pupmenu_col(char *instr, int maxrow) -{ - uiBlock *block; - ListBase listb= {NULL, NULL}; - int columns, rows; - short mousemove[2], mval[2], event; - int width, height, xmax, ymax, val= -1; - int a, startx, starty, endx, endy, boxh=TBOXH, x1, y1; - MenuData *md; - - block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); - block->themecol= TH_MENU_ITEM; - - md= decompose_menu_string(instr); - - /* collumns and row calculation */ - columns= (md->nitems+maxrow)/maxrow; - if (columns<1) columns= 1; - - if(columns > 8) { - maxrow += 5; - columns= (md->nitems+maxrow)/maxrow; - } - - rows= (int) md->nitems/columns; - if (rows<1) rows= 1; - - while (rows*columns<(md->nitems+columns) ) rows++; - - /* size and location */ - if(md->title) { - width= 2*strlen(md->title)+BIF_GetStringWidth(uiBlockGetCurFont(block), md->title, (U.transopts & USER_TR_BUTTONS)); - width /= columns; - } - else width= 0; - - for(a=0; anitems; a++) { - xmax= BIF_GetStringWidth(uiBlockGetCurFont(block), md->items[a].str, (U.transopts & USER_TR_BUTTONS)); - if(xmax>width) width= xmax; - } - - width+= 10; - if (width<50) width=50; - - boxh= TBOXH; - - height= rows*boxh; - if (md->title) height+= boxh; - - xmax = G.curscreen->sizex; - ymax = G.curscreen->sizey; - - getmouseco_sc(mval); - - /* find active item */ -#if 0 - fvalue= ui_get_but_val(but); - for(a=0; anitems; a++) { - if( md->items[a].retval== (int)fvalue ) break; - } -#endif - /* no active item? */ - if(a==md->nitems) { - if(md->title) a= -1; - else a= 0; - } - - if(a>0) - startx = mval[0]-width/2 - ((int)(a)/rows)*width; - else - startx= mval[0]-width/2; - starty = mval[1]-height + boxh/2 + ((a)%rows)*boxh; - - if (md->title) starty+= boxh; - - mousemove[0]= mousemove[1]= 0; - - if(startx<10) { - mousemove[0]= 10-startx; - startx= 10; - } - if(starty<10) { - mousemove[1]= 10-starty; - starty= 10; - } - - endx= startx+width*columns; - endy= starty+height; - - if(endx>xmax) { - mousemove[0]= xmax-endx-10; - endx= xmax-10; - startx= endx-width*columns; - } - if(endy>ymax) { - mousemove[1]= ymax-endy-10; - endy= ymax-10; - starty= endy-height; - } - - ui_warp_pointer(mval[0]+mousemove[0], mval[1]+mousemove[1]); - - mousemove[0]= mval[0]; - mousemove[1]= mval[1]; - - /* here we go! */ - - if(md->title) { - uiBut *bt; - uiSetCurFont(block, UI_HELVB); - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), columns*(short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); - uiSetCurFont(block, UI_HELV); - bt->flag= UI_TEXT_LEFT; - } - - for(a=0; anitems; a++) { - char *name= md->items[a].str; - - int icon = md->items[a].icon; - - x1= startx + width*((int)a/rows); - y1= starty - boxh*(a%rows) + (rows-1)*boxh; - - if( strcmp(name, "%l")==0){ - uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, ""); - y1 -= PUP_LABELH; - } - else if (icon) { - uiDefIconButI(block, BUTM, B_NOP, icon, x1, y1, width+16, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= boxh; - } - else { - uiDefButI(block, BUTM, B_NOP, name, x1, y1, width, boxh-1, &val, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= boxh; - } - //uiDefButI(block, BUTM, B_NOP, md->items[a].str, x1, y1, (short)(width-(rows>1)), (short)(boxh-1), &val, (float)md->items[a].retval, 0.0, 0, 0, ""); - } - - uiBoundsBlock(block, 1); - - event= uiDoBlocks(&listb, 0, 1); - - menudata_free(md); - - if((event & UI_RETURN_OUT)==0) ui_warp_pointer(mousemove[0], mousemove[1]); - - return val; -} - diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c deleted file mode 100644 index 4f1d5056111..00000000000 --- a/source/blender/src/interface_draw.c +++ /dev/null @@ -1,2467 +0,0 @@ - -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt - - */ - - -#include -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_color_types.h" -#include "DNA_key_types.h" -#include "DNA_packedFile_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vec_types.h" -#include "DNA_vfont_types.h" - -#include "BKE_blender.h" -#include "BKE_colortools.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_utildefines.h" - -#include "datatoc.h" /* std font */ - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" - -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_butspace.h" -#include "BIF_language.h" - -#include "BSE_view.h" - -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif - -#include "mydevice.h" -#include "interface.h" -#include "blendef.h" - -// globals -extern float UIwinmat[4][4]; - - -/* ************** safe rasterpos for pixmap alignment with pixels ************* */ - -void ui_rasterpos_safe(float x, float y, float aspect) -{ - float vals[4], remainder; - int doit=0; - - glRasterPos2f(x, y); - glGetFloatv(GL_CURRENT_RASTER_POSITION, vals); - - remainder= vals[0] - floor(vals[0]); - if(remainder > 0.4 && remainder < 0.6) { - if(remainder < 0.5) x -= 0.1*aspect; - else x += 0.1*aspect; - doit= 1; - } - remainder= vals[1] - floor(vals[1]); - if(remainder > 0.4 && remainder < 0.6) { - if(remainder < 0.5) y -= 0.1*aspect; - else y += 0.1*aspect; - doit= 1; - } - - if(doit) glRasterPos2f(x, y); - - BIF_RasterPos(x, y); - BIF_SetScale(aspect); -} - -/* ************** generic embossed rect, for window sliders etc ************* */ - -void uiEmboss(float x1, float y1, float x2, float y2, int sel) -{ - - /* below */ - if(sel) glColor3ub(200,200,200); - else glColor3ub(50,50,50); - fdrawline(x1, y1, x2, y1); - - /* right */ - fdrawline(x2, y1, x2, y2); - - /* top */ - if(sel) glColor3ub(50,50,50); - else glColor3ub(200,200,200); - fdrawline(x1, y2, x2, y2); - - /* left */ - fdrawline(x1, y1, x1, y2); - -} - -/* ************** GENERIC ICON DRAW, NO THEME HERE ************* */ - -/* icons have been standardized... and this call draws in untransformed coordinates */ -#define ICON_HEIGHT 16.0f - -static void ui_draw_icon(uiBut *but, BIFIconID icon, int blend) -{ - float xs=0, ys=0, aspect, height; - - /* this icon doesn't need draw... */ - if(icon==ICON_BLANK1) return; - - /* we need aspect from block, for menus... these buttons are scaled in uiPositionBlock() */ - aspect= but->block->aspect; - if(aspect != but->aspect) { - /* prevent scaling up icon in pupmenu */ - if (aspect < 1.0f) { - height= ICON_HEIGHT; - aspect = 1.0f; - - } - else - height= ICON_HEIGHT/aspect; - } - else - height= ICON_HEIGHT; - - if(but->flag & UI_ICON_LEFT) { - if (but->type==BUT_TOGDUAL && but->drawstr[0]) { - xs= but->x1-1.0; - } - else if (but->type==BUTM ) { - xs= but->x1+1.0; - } - else if ((but->type==ICONROW) || (but->type==ICONTEXTROW)) { - xs= but->x1+3.0; - } - else { - xs= but->x1+4.0; - } - ys= (but->y1+but->y2- height)/2.0; - } - if(but->flag & UI_ICON_RIGHT) { - xs= but->x2-17.0; - ys= (but->y1+but->y2- height)/2.0; - } - if (!((but->flag & UI_ICON_RIGHT) || (but->flag & UI_ICON_LEFT))) { - xs= (but->x1+but->x2- height)/2.0; - ys= (but->y1+but->y2- height)/2.0; - } - - glEnable(GL_BLEND); - - /* calculate blend color */ - if ELEM3(but->type, TOG, ROW, TOGN) { - if(but->flag & UI_SELECT); - else if(but->flag & UI_ACTIVE); - else blend= -60; - } - BIF_icon_draw_aspect_blended(xs, ys, icon, aspect, blend); - - glDisable(GL_BLEND); - -} - - -/* ************** DEFAULT THEME, SHADED BUTTONS ************* */ - - -#define M_WHITE BIF_ThemeColorShade(colorid, 80) - -#define M_ACT_LIGHT BIF_ThemeColorShade(colorid, 55) -#define M_LIGHT BIF_ThemeColorShade(colorid, 45) -#define M_HILITE BIF_ThemeColorShade(colorid, 25) -#define M_LMEDIUM BIF_ThemeColorShade(colorid, 10) -#define M_MEDIUM BIF_ThemeColor(colorid) -#define M_LGREY BIF_ThemeColorShade(colorid, -20) -#define M_GREY BIF_ThemeColorShade(colorid, -45) -#define M_DARK BIF_ThemeColorShade(colorid, -80) - -#define M_NUMTEXT BIF_ThemeColorShade(colorid, 25) -#define M_NUMTEXT_ACT_LIGHT BIF_ThemeColorShade(colorid, 35) - -#define MM_WHITE BIF_ThemeColorShade(TH_BUT_NEUTRAL, 120) - -/* Used for the subtle sunken effect around buttons. - * One option is to hardcode to white, with alpha, however it causes a - * weird 'building up' efect, so it's commented out for now. - */ - -/* -#define MM_WHITE_OP glColor4ub(255, 255, 255, 60) -#define MM_WHITE_TR glColor4ub(255, 255, 255, 0) - */ - -#define MM_WHITE_OP BIF_ThemeColorShadeAlpha(TH_BACK, 55, -100) -#define MM_WHITE_TR BIF_ThemeColorShadeAlpha(TH_BACK, 55, -255) - -#define MM_LIGHT BIF_ThemeColorShade(TH_BUT_OUTLINE, 45) -#define MM_MEDIUM BIF_ThemeColor(TH_BUT_OUTLINE) -#define MM_GREY BIF_ThemeColorShade(TH_BUT_OUTLINE, -45) -#define MM_DARK BIF_ThemeColorShade(TH_BUT_OUTLINE, -80) - -/* base shaded button */ -static void shaded_button(float x1, float y1, float x2, float y2, float asp, int colorid, int flag, int mid) -{ - /* 'mid' arg determines whether the button is in the middle of - * an alignment group or not. 0 = not middle, 1 = is in the middle. - * Done to allow cleaner drawing - */ - - /* *** SHADED BUTTON BASE *** */ - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_MEDIUM; - else M_LGREY; - } else { - if(flag & UI_ACTIVE) M_LIGHT; - else M_HILITE; - } - - glVertex2f(x1,y1); - glVertex2f(x2,y1); - - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; - } else { - if(flag & UI_ACTIVE) M_ACT_LIGHT; - else M_LIGHT; - } - - glVertex2f(x2,(y2-(y2-y1)/3)); - glVertex2f(x1,(y2-(y2-y1)/3)); - glEnd(); - - - glShadeModel(GL_FLAT); - glBegin(GL_QUADS); - - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; - } else { - if(flag & UI_ACTIVE) M_ACT_LIGHT; - else M_LIGHT; - } - - glVertex2f(x1,(y2-(y2-y1)/3)); - glVertex2f(x2,(y2-(y2-y1)/3)); - glVertex2f(x2,y2); - glVertex2f(x1,y2); - - glEnd(); - /* *** END SHADED BUTTON BASE *** */ - - /* *** INNER OUTLINE *** */ - /* left */ - if(!(flag & UI_SELECT)) { - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - M_MEDIUM; - glVertex2f(x1+1,y1+2); - M_WHITE; - glVertex2f(x1+1,y2); - glEnd(); - } - - /* right */ - if(!(flag & UI_SELECT)) { - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - M_MEDIUM; - glVertex2f(x2-1,y1+2); - M_WHITE; - glVertex2f(x2-1,y2); - glEnd(); - } - - glShadeModel(GL_FLAT); - - /* top */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; - } else { - if(flag & UI_ACTIVE) M_WHITE; - else M_WHITE; - } - - fdrawline(x1, (y2-1), x2, (y2-1)); - - /* bottom */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_MEDIUM; - else M_LGREY; - } else { - if(flag & UI_ACTIVE) M_LMEDIUM; - else M_MEDIUM; - } - fdrawline(x1, (y1+1), x2, (y1+1)); - /* *** END INNER OUTLINE *** */ - - /* *** OUTER OUTLINE *** */ - if (mid) { - // we draw full outline, its not AA, and it works better button mouse-over hilite - MM_DARK; - - // left right - fdrawline(x1, y1, x1, y2); - fdrawline(x2, y1, x2, y2); - - // top down - fdrawline(x1, y2, x2, y2); - fdrawline(x1, y1, x2, y1); - } else { - MM_DARK; - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, 1.5); - } - /* END OUTER OUTLINE */ -} - -/* base flat button */ -static void flat_button(float x1, float y1, float x2, float y2, float asp, int colorid, int flag, int mid) -{ - /* 'mid' arg determines whether the button is in the middle of - * an alignment group or not. 0 = not middle, 1 = is in the middle. - * Done to allow cleaner drawing - */ - - /* *** FLAT TEXT/NUM FIELD *** */ - glShadeModel(GL_FLAT); - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_LGREY; - else M_GREY; - } - else { - if(flag & UI_ACTIVE) M_NUMTEXT_ACT_LIGHT; - else M_NUMTEXT; - } - - glRectf(x1, y1, x2, y2); - /* *** END FLAT TEXT/NUM FIELD *** */ - - /* *** OUTER OUTLINE *** */ - if (mid) { - // we draw full outline, its not AA, and it works better button mouse-over hilite - MM_DARK; - - // left right - fdrawline(x1, y1, x1, y2); - fdrawline(x2, y1, x2, y2); - - // top down - fdrawline(x1, y2, x2, y2); - fdrawline(x1, y1, x2, y1); - } else { - MM_DARK; - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, 1.5); - } - /* END OUTER OUTLINE */ -} - -/* small side double arrow for iconrow */ -static void ui_default_iconrow_arrows(float x1, float y1, float x2, float y2) -{ - glEnable( GL_POLYGON_SMOOTH ); - glEnable( GL_BLEND ); - - glShadeModel(GL_FLAT); - glBegin(GL_TRIANGLES); - glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2)+1); - glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2)+1); - glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+4); - glEnd(); - - glBegin(GL_TRIANGLES); - glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2) -1); - glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2) -1); - glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -4); - glEnd(); - - glDisable( GL_BLEND ); - glDisable( GL_POLYGON_SMOOTH ); -} - -/* side double arrow for menu */ -static void ui_default_menu_arrows(float x1, float y1, float x2, float y2) -{ - glEnable( GL_POLYGON_SMOOTH ); - glEnable( GL_BLEND ); - - glShadeModel(GL_FLAT); - glBegin(GL_TRIANGLES); - glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1); - glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1); - glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4); - glEnd(); - - glBegin(GL_TRIANGLES); - glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -1); - glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2) -1); - glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2) -4); - glEnd(); - - glDisable( GL_BLEND ); - glDisable( GL_POLYGON_SMOOTH ); -} - -/* left/right arrows for number fields */ -static void ui_default_num_arrows(float x1, float y1, float x2, float y2) -{ - if( x2-x1 > 25) { // 25 is a bit arbitrary, but small buttons cant have arrows - - glEnable( GL_POLYGON_SMOOTH ); - glEnable( GL_BLEND ); - - glShadeModel(GL_FLAT); - glBegin(GL_TRIANGLES); - - glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2)); - glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4); - glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4); - glEnd(); - - /* right */ - glShadeModel(GL_FLAT); - glBegin(GL_TRIANGLES); - - glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2)); - glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4); - glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4); - glEnd(); - - glDisable( GL_BLEND ); - glDisable( GL_POLYGON_SMOOTH ); - } -} - -/* changing black/white for TOG3 buts */ -static void ui_tog3_invert(float x1, float y1, float x2, float y2, int seltype) -{ - short alpha = 30; - - if (seltype == 0) { - glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, alpha); - glRectf(x2-6, y1, x2, (y1+(y2-y1)/2)); - - glColor4ub(255, 255, 255, alpha); - glRectf(x2-6, (y1+(y2-y1)/2), x2, y2); - - glDisable(GL_BLEND); - } else { - glEnable(GL_BLEND); - - glColor4ub(255, 255, 255, alpha); - glRectf(x2-6, y1, x2, (y1+(y2-y1)/2)); - - glColor4ub(0, 0, 0, alpha); - glRectf(x2-6, (y1+(y2-y1)/2), x2, y2); - - glDisable(GL_BLEND); - } -} - -/* button/popup menu/iconrow drawing code */ -static void ui_default_button(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - int align= (flag & UI_BUT_ALIGN); - - if(align) { - - /* *** BOTTOM OUTER SUNKEN EFFECT *** */ - if (!((align == UI_BUT_ALIGN_DOWN) || - (align == (UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT)) || - (align == (UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT)))) { - glEnable(GL_BLEND); - MM_WHITE_OP; - fdrawline(x1, y1-1, x2, y1-1); - glDisable(GL_BLEND); - } - /* *** END BOTTOM OUTER SUNKEN EFFECT *** */ - - switch(align) { - case UI_BUT_ALIGN_TOP: - uiSetRoundBox(12); - - /* last arg in shaded_button() determines whether the button is in the middle of - * an alignment group or not. 0 = not middle, 1 = is in the middle. - * Done to allow cleaner drawing - */ - - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_DOWN: - uiSetRoundBox(3); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_LEFT: - - /* RIGHT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(6); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_RIGHT: - - /* LEFT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(9); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT: - uiSetRoundBox(1); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT: - uiSetRoundBox(2); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT: - - /* LEFT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(8); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT: - - /* RIGHT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(4); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - - default: - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 1); - break; - } - } - else { - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - - /* BOTTOM OUTER SUNKEN EFFECT */ - MM_WHITE_OP; - fdrawline(x1, y1-1, x2, y1-1); - - /* LEFT OUTER SUNKEN EFFECT */ - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - - /* RIGHT OUTER SUNKEN EFFECT */ - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - - glDisable(GL_BLEND); - - uiSetRoundBox(15); - shaded_button(x1, y1, x2, y2, asp, colorid, flag, 0); - } - - /* *** EXTRA DRAWING FOR SPECIFIC CONTROL TYPES *** */ - switch(type) { - case ICONROW: - case ICONTEXTROW: - /* DARKENED AREA */ - glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, 30); - glRectf(x2-9, y1, x2, y2); - - glDisable(GL_BLEND); - /* END DARKENED AREA */ - - /* ICONROW DOUBLE-ARROW */ - M_DARK; - ui_default_iconrow_arrows(x1, y1, x2, y2); - /* END ICONROW DOUBLE-ARROW */ - break; - case MENU: - /* DARKENED AREA */ - glEnable(GL_BLEND); - - glColor4ub(0, 0, 0, 30); - glRectf(x2-18, y1, x2, y2); - - glDisable(GL_BLEND); - /* END DARKENED AREA */ - - /* MENU DOUBLE-ARROW */ - M_DARK; - ui_default_menu_arrows(x1, y1, x2, y2); - /* MENU DOUBLE-ARROW */ - break; - } -} - - -/* number/text field drawing code */ -static void ui_default_flat(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - int align= (flag & UI_BUT_ALIGN); - - if(align) { - - /* *** BOTTOM OUTER SUNKEN EFFECT *** */ - if (!((align == UI_BUT_ALIGN_DOWN) || - (align == (UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT)) || - (align == (UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT)))) { - glEnable(GL_BLEND); - MM_WHITE_OP; - fdrawline(x1, y1-1, x2, y1-1); - glDisable(GL_BLEND); - } - /* *** END BOTTOM OUTER SUNKEN EFFECT *** */ - - switch(align) { - case UI_BUT_ALIGN_TOP: - uiSetRoundBox(12); - - /* last arg in shaded_button() determines whether the button is in the middle of - * an alignment group or not. 0 = not middle, 1 = is in the middle. - * Done to allow cleaner drawing - */ - - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_DOWN: - uiSetRoundBox(3); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_LEFT: - - /* RIGHT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(6); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_RIGHT: - - /* LEFT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(9); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT: - uiSetRoundBox(1); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT: - uiSetRoundBox(2); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT: - - /* LEFT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(8); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT: - - /* RIGHT OUTER SUNKEN EFFECT */ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - glDisable(GL_BLEND); - - uiSetRoundBox(4); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - break; - - default: - flat_button(x1, y1, x2, y2, asp, colorid, flag, 1); - break; - } - } - else { - - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - - /* BOTTOM OUTER SUNKEN EFFECT */ - MM_WHITE_OP; - fdrawline(x1, y1-1, x2, y1-1); - - /* LEFT OUTER SUNKEN EFFECT */ - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x1-1,y1); - MM_WHITE_TR; - glVertex2f(x1-1,y2); - glEnd(); - - /* RIGHT OUTER SUNKEN EFFECT */ - glBegin(GL_LINES); - MM_WHITE_OP; - glVertex2f(x2+1,y1); - MM_WHITE_TR; - glVertex2f(x2+1,y2); - glEnd(); - - glDisable(GL_BLEND); - - uiSetRoundBox(15); - flat_button(x1, y1, x2, y2, asp, colorid, flag, 0); - } - - /* *** EXTRA DRAWING FOR SPECIFIC CONTROL TYPES *** */ - switch(type) { - case NUM: - /* SIDE ARROWS */ - /* left */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) M_DARK; - else M_DARK; - } else { - if(flag & UI_ACTIVE) M_GREY; - else M_LGREY; - } - - ui_default_num_arrows(x1, y1, x2, y2); - /* END SIDE ARROWS */ - } -} - -static void ui_default_slider(int colorid, float fac, float aspect, float x1, float y1, float x2, float y2, int flag) -{ - float ymid, yc; - - /* the slider background line */ - ymid= (y1+y2)/2.0; - //yc= 2.5*aspect; // height of center line - yc = 2.3; // height of center line - - if(flag & UI_SELECT) - BIF_ThemeColorShade(TH_BUT_NUM, -5); - else - if(flag & UI_ACTIVE) - BIF_ThemeColorShade(TH_BUT_NUM, +35); - else - BIF_ThemeColorShade(TH_BUT_NUM, +25); - - glRectf(x1, ymid-yc, x2, ymid+yc); - - /* top inner bevel */ - if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, -40); - else BIF_ThemeColorShade(TH_BUT_NUM, -5); - fdrawline(x1+1, ymid+yc, x2, ymid+yc); - - /* bottom inner bevel */ - if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, +15); - else BIF_ThemeColorShade(TH_BUT_NUM, +45); - fdrawline(x1+1, ymid-yc, x2, ymid-yc); - - - /* the movable slider */ - if(flag & UI_SELECT) BIF_ThemeColorShade(TH_BUT_NUM, +80); - else BIF_ThemeColorShade(TH_BUT_NUM, -45); - - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - BIF_ThemeColorShade(TH_BUT_NUM, -45); - - glVertex2f(x1, y1+2.5); - glVertex2f(x1+fac, y1+2.5); - - BIF_ThemeColor(TH_BUT_NUM); - - glVertex2f(x1+fac, y2-2.5); - glVertex2f(x1, y2-2.5); - - glEnd(); - - - /* slider handle center */ - glShadeModel(GL_SMOOTH); - glBegin(GL_QUADS); - - BIF_ThemeColor(TH_BUT_NUM); - glVertex2f(x1+fac-3, y1+2); - glVertex2f(x1+fac, y1+4); - BIF_ThemeColorShade(TH_BUT_NUM, +80); - glVertex2f(x1+fac, y2-2); - glVertex2f(x1+fac-3, y2-2); - - glEnd(); - - /* slider handle left bevel */ - BIF_ThemeColorShade(TH_BUT_NUM, +70); - fdrawline(x1+fac-3, y2-2, x1+fac-3, y1+2); - - /* slider handle right bevel */ - BIF_ThemeColorShade(TH_BUT_NUM, -35); - fdrawline(x1+fac, y2-2, x1+fac, y1+2); - - glShadeModel(GL_FLAT); -} - -/* default theme callback */ -static void ui_draw_default(int type, int colorid, float aspect, float x1, float y1, float x2, float y2, int flag) -{ - - switch(type) { - case TEX: - case IDPOIN: - case NUM: - ui_default_flat(type, colorid, aspect, x1, y1, x2, y2, flag); - break; - case ICONROW: - case ICONTEXTROW: - case MENU: - default: - ui_default_button(type, colorid, aspect, x1, y1, x2, y2, flag); - } - -} - - -/* *************** OLDSKOOL THEME ***************** */ - -static void ui_draw_outlineX(float x1, float y1, float x2, float y2, float asp1) -{ - float vec[2]; - - glBegin(GL_LINE_LOOP); - vec[0]= x1+asp1; vec[1]= y1-asp1; - glVertex2fv(vec); - vec[0]= x2-asp1; - glVertex2fv(vec); - vec[0]= x2+asp1; vec[1]= y1+asp1; - glVertex2fv(vec); - vec[1]= y2-asp1; - glVertex2fv(vec); - vec[0]= x2-asp1; vec[1]= y2+asp1; - glVertex2fv(vec); - vec[0]= x1+asp1; - glVertex2fv(vec); - vec[0]= x1-asp1; vec[1]= y2-asp1; - glVertex2fv(vec); - vec[1]= y1+asp1; - glVertex2fv(vec); - glEnd(); - -} - - -static void ui_draw_oldskool(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - /* paper */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40); - else BIF_ThemeColorShade(colorid, -30); - } - else { - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +30); - else BIF_ThemeColorShade(colorid, +20); - } - - glRectf(x1+1, y1+1, x2-1, y2-1); - - x1+= asp; - x2-= asp; - y1+= asp; - y2-= asp; - - /* below */ - if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, 0); - else BIF_ThemeColorShade(colorid, -30); - fdrawline(x1, y1, x2, y1); - - /* right */ - fdrawline(x2, y1, x2, y2); - - /* top */ - if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -30); - else BIF_ThemeColorShade(colorid, 0); - fdrawline(x1, y2, x2, y2); - - /* left */ - fdrawline(x1, y1, x1, y2); - - /* outline */ - glColor3ub(0,0,0); - ui_draw_outlineX(x1, y1, x2, y2, asp); - - - /* special type decorations */ - switch(type) { - case NUM: - if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60); - else BIF_ThemeColorShade(colorid, -30); - ui_default_num_arrows(x1, y1, x2, y2); - break; - - case ICONROW: - case ICONTEXTROW: - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0); - else BIF_ThemeColorShade(colorid, -10); - glRectf(x2-9, y1+asp, x2-asp, y2-asp); - - BIF_ThemeColorShade(colorid, -50); - ui_default_iconrow_arrows(x1, y1, x2, y2); - break; - - case MENU: - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0); - else BIF_ThemeColorShade(colorid, -10); - glRectf(x2-17, y1+asp, x2-asp, y2-asp); - - BIF_ThemeColorShade(colorid, -50); - ui_default_menu_arrows(x1, y1, x2, y2); - break; - } - -} - -/* *************** BASIC ROUNDED THEME ***************** */ - -static void round_button(float x1, float y1, float x2, float y2, float asp, - int colorid, int round, int menudeco, int curshade) -{ - float rad; - char col[4]; - - rad= (y2-y1)/2.0; - if(rad>7.0) rad= 7.0; - - uiSetRoundBox(round); - gl_round_box(GL_POLYGON, x1, y1, x2, y2, rad); - - if(menudeco) { - uiSetRoundBox(round & ~9); - BIF_ThemeColorShade(colorid, curshade-20); - gl_round_box(GL_POLYGON, x2-menudeco, y1, x2, y2, rad); - } - - /* fake AA */ - uiSetRoundBox(round); - glEnable( GL_BLEND ); - - BIF_GetThemeColor3ubv(colorid, col); - - if(col[0]<100) col[0]= 0; else col[0]-= 100; - if(col[1]<100) col[1]= 0; else col[1]-= 100; - if(col[2]<100) col[2]= 0; else col[2]-= 100; - col[3]= 80; - glColor4ubv((GLubyte *)col); - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, rad - asp); - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, rad + asp); - col[3]= 180; - glColor4ubv((GLubyte *)col); - gl_round_box(GL_LINE_LOOP, x1, y1, x2, y2, rad); - - glDisable( GL_BLEND ); -} - -/* button in midst of alignment row */ -static void round_button_mid(float x1, float y1, float x2, float y2, float asp, - int colorid, int align, int menudeco, int curshade) -{ - glRectf(x1, y1, x2, y2); - - if(menudeco) { - BIF_ThemeColorShade(colorid, curshade-20); - glRectf(x2-menudeco, y1, x2, y2); - } - - BIF_ThemeColorBlendShade(colorid, TH_BACK, 0.5, -70); - // we draw full outline, its not AA, and it works better button mouse-over hilite - - // left right - fdrawline(x1, y1, x1, y2); - fdrawline(x2, y1, x2, y2); - - // top down - fdrawline(x1, y2, x2, y2); - fdrawline(x1, y1, x2, y1); -} - -static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - int align= (flag & UI_BUT_ALIGN); - int curshade= 0, menudeco= 0; - - if(type==ICONROW || type==ICONTEXTROW) menudeco= 9; - else if((type==MENU || type==BLOCK) && x2-x1>24) menudeco= 16; - - /* paper */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) curshade= -40; - else curshade= -30; - } - else { - if(flag & UI_ACTIVE) curshade= 30; - else curshade= +20; - } - - BIF_ThemeColorShade(colorid, curshade); - - if(align) { - switch(align) { - case UI_BUT_ALIGN_TOP: - round_button(x1, y1, x2, y2, asp, colorid, 12, menudeco, curshade); - break; - case UI_BUT_ALIGN_DOWN: - round_button(x1, y1, x2, y2, asp, colorid, 3, menudeco, curshade); - break; - case UI_BUT_ALIGN_LEFT: - round_button(x1, y1, x2, y2, asp, colorid, 6, menudeco, curshade); - break; - case UI_BUT_ALIGN_RIGHT: - round_button(x1, y1, x2, y2, asp, colorid, 9, menudeco, curshade); - break; - - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_RIGHT: - round_button(x1, y1, x2, y2, asp, colorid, 1, menudeco, curshade); - break; - case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT: - round_button(x1, y1, x2, y2, asp, colorid, 2, menudeco, curshade); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT: - round_button(x1, y1, x2, y2, asp, colorid, 8, menudeco, curshade); - break; - case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT: - round_button(x1, y1, x2, y2, asp, colorid, 4, menudeco, curshade); - break; - - default: - round_button_mid(x1, y1, x2, y2, asp, colorid, align, menudeco, curshade); - break; - } - } - else { - round_button(x1, y1, x2, y2, asp, colorid, 15, menudeco, curshade); - } - - /* special type decorations */ - switch(type) { - case NUM: - BIF_ThemeColorShade(colorid, curshade-60); - ui_default_num_arrows(x1, y1, x2, y2); - break; - - case ICONROW: - case ICONTEXTROW: - BIF_ThemeColorShade(colorid, curshade-60); - ui_default_iconrow_arrows(x1, y1, x2, y2); - break; - - case MENU: - case BLOCK: - BIF_ThemeColorShade(colorid, curshade-60); - ui_default_menu_arrows(x1, y1, x2, y2); - break; - } -} - -/* *************** MINIMAL THEME ***************** */ - -// theme can define an embosfunc and sliderfunc, text+icon drawing is standard, no theme. - - - -/* super minimal button as used in logic menu */ -static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - /* too much space between buttons */ - - if (type==TEX || type==IDPOIN) { - x1+= asp; - x2-= (asp*2); - //y1+= asp; - y2-= asp; - } else { - /* Less space between buttons looks nicer */ - y2-= asp; - x2-= asp; - } - - /* paper */ - if(flag & UI_SELECT) { - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40); - else BIF_ThemeColorShade(colorid, -30); - } - else { - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +20); - else BIF_ThemeColorShade(colorid, +10); - } - - glRectf(x1, y1, x2, y2); - - if (type==TEX || type==IDPOIN) { - BIF_ThemeColorShade(colorid, -60); - - /* top */ - fdrawline(x1, y2, x2, y2); - /* left */ - fdrawline(x1, y1, x1, y2); - - - /* text underline, some */ - BIF_ThemeColorShade(colorid, +50); - glEnable(GL_LINE_STIPPLE); - glLineStipple(1, 0x8888); - fdrawline(x1+(asp*2), y1+(asp*3), x2-(asp*2), y1+(asp*3)); - glDisable(GL_LINE_STIPPLE); - - - BIF_ThemeColorShade(colorid, +60); - /* below */ - fdrawline(x1, y1, x2, y1); - /* right */ - fdrawline(x2, y1, x2, y2); - - } else { - if(flag & UI_SELECT) { - BIF_ThemeColorShade(colorid, -60); - - /* top */ - fdrawline(x1, y2, x2, y2); - /* left */ - fdrawline(x1, y1, x1, y2); - BIF_ThemeColorShade(colorid, +40); - - /* below */ - fdrawline(x1, y1, x2, y1); - /* right */ - fdrawline(x2, y1, x2, y2); - } - else { - BIF_ThemeColorShade(colorid, +40); - - /* top */ - fdrawline(x1, y2, x2, y2); - /* left */ - fdrawline(x1, y1, x1, y2); - - BIF_ThemeColorShade(colorid, -60); - /* below */ - fdrawline(x1, y1, x2, y1); - /* right */ - fdrawline(x2, y1, x2, y2); - } - } - - /* special type decorations */ - switch(type) { - case NUM: - if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60); - else BIF_ThemeColorShade(colorid, -30); - ui_default_num_arrows(x1, y1, x2, y2); - break; - - case ICONROW: - case ICONTEXTROW: - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0); - else BIF_ThemeColorShade(colorid, -10); - glRectf(x2-9, y1+asp, x2-asp, y2-asp); - - BIF_ThemeColorShade(colorid, -50); - ui_default_iconrow_arrows(x1, y1, x2, y2); - break; - - case MENU: - case BLOCK: - if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0); - else BIF_ThemeColorShade(colorid, -10); - glRectf(x2-17, y1+asp, x2-asp, y2-asp); - - BIF_ThemeColorShade(colorid, -50); - ui_default_menu_arrows(x1, y1, x2, y2); - break; - } - - -} - - -/* fac is the slider handle position between x1 and x2 */ -static void ui_draw_slider(int colorid, float fac, float aspect, float x1, float y1, float x2, float y2, int flag) -{ - float ymid, yc; - - /* the slider background line */ - ymid= (y1+y2)/2.0; - yc= 1.7*aspect; - - if(flag & UI_ACTIVE) - BIF_ThemeColorShade(colorid, -50); - else - BIF_ThemeColorShade(colorid, -40); - - /* left part */ - glRectf(x1, ymid-2.0*yc, x1+fac, ymid+2.0*yc); - /* right part */ - glRectf(x1+fac, ymid-yc, x2, ymid+yc); - - /* the movable slider */ - - BIF_ThemeColorShade(colorid, +70); - glRectf(x1+fac-aspect, ymid-2.0*yc, x1+fac+aspect, ymid+2.0*yc); - -} - -/* ************** STANDARD MENU DRAWING FUNCTION ************* */ - - -static void ui_shadowbox(float minx, float miny, float maxx, float maxy, float shadsize, unsigned char alpha) -{ - glEnable(GL_BLEND); - glShadeModel(GL_SMOOTH); - - /* right quad */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, alpha); - glVertex2f(maxx, miny); - glVertex2f(maxx, maxy-shadsize); - glColor4ub(0, 0, 0, 0); - glVertex2f(maxx+shadsize, maxy-shadsize-shadsize); - glVertex2f(maxx+shadsize, miny); - glEnd(); - - /* corner shape */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, alpha); - glVertex2f(maxx, miny); - glColor4ub(0, 0, 0, 0); - glVertex2f(maxx+shadsize, miny); - glVertex2f(maxx+0.7*shadsize, miny-0.7*shadsize); - glVertex2f(maxx, miny-shadsize); - glEnd(); - - /* bottom quad */ - glBegin(GL_POLYGON); - glColor4ub(0, 0, 0, alpha); - glVertex2f(minx+shadsize, miny); - glVertex2f(maxx, miny); - glColor4ub(0, 0, 0, 0); - glVertex2f(maxx, miny-shadsize); - glVertex2f(minx+shadsize+shadsize, miny-shadsize); - glEnd(); - - glDisable(GL_BLEND); - glShadeModel(GL_FLAT); -} - -void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy) -{ - /* accumulated outline boxes to make shade not linear, is more pleasant */ - ui_shadowbox(minx, miny, maxx, maxy, 6.0, (30*alpha)>>8); - ui_shadowbox(minx, miny, maxx, maxy, 4.0, (70*alpha)>>8); - ui_shadowbox(minx, miny, maxx, maxy, 2.0, (100*alpha)>>8); - -} - -// background for pulldowns, pullups, and other drawing temporal menus.... -// has to be made themable still (now only color) - -void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag) -{ - char col[4]; - BIF_GetThemeColor4ubv(TH_MENU_BACK, col); - - if( (flag & UI_BLOCK_NOSHADOW)==0) { - /* accumulated outline boxes to make shade not linear, is more pleasant */ - ui_shadowbox(minx, miny, maxx, maxy, 6.0, (30*col[3])>>8); - ui_shadowbox(minx, miny, maxx, maxy, 4.0, (70*col[3])>>8); - ui_shadowbox(minx, miny, maxx, maxy, 2.0, (100*col[3])>>8); - - glEnable(GL_BLEND); - glColor4ubv((GLubyte *)col); - glRectf(minx-1, miny, minx, maxy); // 1 pixel on left, to distinguish sublevel menus - } - glEnable(GL_BLEND); - glColor4ubv((GLubyte *)col); - glRectf(minx, miny, maxx, maxy); - glDisable(GL_BLEND); -} - - - -/* pulldown menu item */ -static void ui_draw_pulldown_item(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - char col[4]; - - BIF_GetThemeColor4ubv(TH_MENU_BACK, col); - if(col[3]!=255) { - glEnable(GL_BLEND); - } - - if((flag & UI_ACTIVE) && type!=LABEL) { - BIF_ThemeColor4(TH_MENU_HILITE); - glRectf(x1, y1, x2, y2); - - - } else { - BIF_ThemeColor4(colorid); // is set at TH_MENU_ITEM when pulldown opened. - glRectf(x1, y1, x2, y2); - } - - glDisable(GL_BLEND); -} - -/* pulldown menu calling button */ -static void ui_draw_pulldown_round(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ - - if(flag & UI_ACTIVE) { - BIF_ThemeColor(TH_MENU_HILITE); - - uiSetRoundBox(15); - gl_round_box(GL_POLYGON, x1, y1+3, x2, y2-3, 7.0); - - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - gl_round_box(GL_LINE_LOOP, x1, y1+3, x2, y2-3, 7.0); - glDisable( GL_LINE_SMOOTH ); - glDisable( GL_BLEND ); - - } else { - BIF_ThemeColor(colorid); // is set at TH_MENU_ITEM when pulldown opened. - glRectf(x1-1, y1+2, x2+1, y2-2); - } - -} - - -/* ************** TEXT AND ICON DRAWING FUNCTIONS ************* */ - - - -/* draws text and icons for buttons */ -static void ui_draw_text_icon(uiBut *but) -{ - float x; - int len; - char *cpoin; - short t, pos, ch; - short selsta_tmp, selend_tmp, selsta_draw, selwidth_draw; - - /* check for button text label */ - if (but->type == ICONTEXTROW) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd), 0); - } - else { - - /* text button selection and cursor */ - if(but->pos != -1) { - - if ((but->selend - but->selsta) > 0) { - /* text button selection */ - selsta_tmp = but->selsta + strlen(but->str); - selend_tmp = but->selend + strlen(but->str); - - if(but->drawstr[0]!=0) { - ch= but->drawstr[selsta_tmp]; - but->drawstr[selsta_tmp]= 0; - - selsta_draw = but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3; - - but->drawstr[selsta_tmp]= ch; - - - ch= but->drawstr[selend_tmp]; - but->drawstr[selend_tmp]= 0; - - selwidth_draw = but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3; - - but->drawstr[selend_tmp]= ch; - - BIF_ThemeColor(TH_BUT_TEXTFIELD_HI); - glRects(but->x1+selsta_draw+1, but->y1+2, but->x1+selwidth_draw+1, but->y2-2); - } - } else { - /* text cursor */ - pos= but->pos+strlen(but->str); - if(pos >= but->ofs) { - if(but->drawstr[0]!=0) { - ch= but->drawstr[pos]; - but->drawstr[pos]= 0; - - t= but->aspect*BIF_GetStringWidth(but->font, but->drawstr+but->ofs, (U.transopts & USER_TR_BUTTONS)) + 3; - - but->drawstr[pos]= ch; - } - else t= 3; - - glColor3ub(255,0,0); - glRects(but->x1+t, but->y1+2, but->x1+t+2, but->y2-2); - } - } - } - - if(but->type==BUT_TOGDUAL) { - int dualset= 0; - if(but->pointype==SHO) - dualset= BTST( *(((short *)but->poin)+1), but->bitnr); - else if(but->pointype==INT) - dualset= BTST( *(((int *)but->poin)+1), but->bitnr); - - ui_draw_icon(but, ICON_DOT, dualset?0:-100); - } - - if(but->drawstr[0]!=0) { - int transopts; - int tog3= 0; - - // cut string in 2 parts - cpoin= strchr(but->drawstr, '|'); - if(cpoin) *cpoin= 0; - - /* If there's an icon too (made with uiDefIconTextBut) then draw the icon - and offset the text label to accomodate it */ - - if ( (but->flag & UI_HAS_ICON) && (but->flag & UI_ICON_LEFT) ) { - ui_draw_icon(but, but->icon, 0); - - if(but->flag & UI_TEXT_LEFT) x= but->x1 + but->aspect*BIF_icon_get_width(but->icon)+5.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - else { - if(but->flag & UI_TEXT_LEFT) x= but->x1+4.0; - else x= (but->x1+but->x2-but->strwidth+1)/2.0; - } - - /* tog3 button exception; draws with glColor! */ - if(but->type==TOG3 && (but->flag & UI_SELECT)) { - - if( but->pointype==CHA ) { - if( BTST( *(but->poin+2), but->bitnr )) tog3= 1; - } - else if( but->pointype ==SHO ) { - short *sp= (short *)but->poin; - if( BTST( sp[1], but->bitnr )) tog3= 1; - } - - ui_tog3_invert(but->x1,but->y1,but->x2,but->y2, tog3); - if (tog3) glColor3ub(255, 255, 0); - } - - /* text color, with pulldown item exception */ - if(tog3); // color already set - else if(but->dt==UI_EMBOSSP) { - if((but->flag & (UI_SELECT|UI_ACTIVE)) && but->type!=LABEL) { // LABEL = title in pulldowns - BIF_ThemeColor(TH_MENU_TEXT_HI); - } else { - BIF_ThemeColor(TH_MENU_TEXT); - } - } - else { - if(but->flag & UI_SELECT) { - BIF_ThemeColor(TH_BUT_TEXT_HI); - } else { - BIF_ThemeColor(TH_BUT_TEXT); - } - } - - /* LABEL button exception */ - if(but->type==LABEL && but->min!=0.0) BIF_ThemeColor(TH_BUT_TEXT_HI); - - ui_rasterpos_safe(x, (but->y1+but->y2- 9.0)/2.0, but->aspect); - if(but->type==IDPOIN) transopts= 0; // no translation, of course! - else transopts= (U.transopts & USER_TR_BUTTONS); - - #ifdef INTERNATIONAL - if (but->type == FTPREVIEW) - FTF_DrawNewFontString (but->drawstr+but->ofs, FTF_INPUT_UTF8); - else - BIF_DrawString(but->font, but->drawstr+but->ofs, transopts); - #else - BIF_DrawString(but->font, but->drawstr+but->ofs, transopts); - #endif - - /* part text right aligned */ - if(cpoin) { - len= BIF_GetStringWidth(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS)); - ui_rasterpos_safe( but->x2 - len*but->aspect-3, (but->y1+but->y2- 9.0)/2.0, but->aspect); - BIF_DrawString(but->font, cpoin+1, (U.transopts & USER_TR_BUTTONS)); - *cpoin= '|'; - } - } - /* if there's no text label, then check to see if there's an icon only and draw it */ - else if( but->flag & UI_HAS_ICON ) { - ui_draw_icon(but, (BIFIconID) (but->icon+but->iconadd), 0); - } - } -} - -static void ui_draw_but_COL(uiBut *but) -{ - float *fp; - char colr, colg, colb; - - if( but->pointype==FLO ) { - fp= (float *)but->poin; - colr= floor(255.0*fp[0]+0.5); - colg= floor(255.0*fp[1]+0.5); - colb= floor(255.0*fp[2]+0.5); - } - else { - char *cp= (char *)but->poin; - colr= cp[0]; - colg= cp[1]; - colb= cp[2]; - } - - /* exception... hrms, but can't simply use the emboss callback for this now. */ - /* this button type needs review, and nice integration with rest of API here */ - if(but->embossfunc == ui_draw_round) { - char *cp= BIF_ThemeGetColorPtr(U.themes.first, 0, TH_CUSTOM); - cp[0]= colr; cp[1]= colg; cp[2]= colb; - but->flag &= ~UI_SELECT; - but->embossfunc(but->type, TH_CUSTOM, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - } - else { - - glColor3ub(colr, colg, colb); - glRectf((but->x1), (but->y1), (but->x2), (but->y2)); - glColor3ub(0, 0, 0); - fdrawbox((but->x1), (but->y1), (but->x2), (but->y2)); - } -} - -/* draws in resolution of 20x4 colors */ -static void ui_draw_but_HSVCUBE(uiBut *but) -{ - int a; - float h,s,v; - float dx, dy, sx1, sx2, sy, x, y; - float col0[4][3]; // left half, rect bottom to top - float col1[4][3]; // right half, rect bottom to top - - h= but->hsv[0]; - s= but->hsv[1]; - v= but->hsv[2]; - - /* draw series of gouraud rects */ - glShadeModel(GL_SMOOTH); - - if(but->a1==0) { // H and V vary - hsv_to_rgb(0.0, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(0.0, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(0.0, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(0.0, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]); - x= h; y= v; - } - else if(but->a1==1) { // H and S vary - hsv_to_rgb(0.0, 0.0, v, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(0.0, 0.333, v, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(0.0, 0.666, v, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(0.0, 1.0, v, &col1[3][0], &col1[3][1], &col1[3][2]); - x= h; y= s; - } - else if(but->a1==2) { // S and V vary - hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(h, 0.333, 0.0, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(h, 0.666, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(h, 1.0, 0.0, &col1[3][0], &col1[3][1], &col1[3][2]); - x= v; y= s; - } - else { // only hue slider - hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); - x= h; y= 0.5; - } - - for(dx=0.0; dx<1.0; dx+= 0.05) { - // previous color - VECCOPY(col0[0], col1[0]); - VECCOPY(col0[1], col1[1]); - VECCOPY(col0[2], col1[2]); - VECCOPY(col0[3], col1[3]); - - // new color - if(but->a1==0) { // H and V vary - hsv_to_rgb(dx, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(dx, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(dx, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(dx, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]); - } - else if(but->a1==1) { // H and S vary - hsv_to_rgb(dx, 0.0, v, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(dx, 0.333, v, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(dx, 0.666, v, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(dx, 1.0, v, &col1[3][0], &col1[3][1], &col1[3][2]); - } - else if(but->a1==2) { // S and V vary - hsv_to_rgb(h, 0.0, dx, &col1[0][0], &col1[0][1], &col1[0][2]); - hsv_to_rgb(h, 0.333, dx, &col1[1][0], &col1[1][1], &col1[1][2]); - hsv_to_rgb(h, 0.666, dx, &col1[2][0], &col1[2][1], &col1[2][2]); - hsv_to_rgb(h, 1.0, dx, &col1[3][0], &col1[3][1], &col1[3][2]); - } - else { // only H - hsv_to_rgb(dx, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]); - VECCOPY(col1[1], col1[0]); - VECCOPY(col1[2], col1[0]); - VECCOPY(col1[3], col1[0]); - } - - // rect - sx1= but->x1 + dx*(but->x2-but->x1); - sx2= but->x1 + (dx+0.05)*(but->x2-but->x1); - sy= but->y1; - dy= (but->y2-but->y1)/3.0; - - glBegin(GL_QUADS); - for(a=0; a<3; a++, sy+=dy) { - glColor3fv(col0[a]); - glVertex2f(sx1, sy); - - glColor3fv(col1[a]); - glVertex2f(sx2, sy); - - glColor3fv(col1[a+1]); - glVertex2f(sx2, sy+dy); - - glColor3fv(col0[a+1]); - glVertex2f(sx1, sy+dy); - } - glEnd(); - } - - glShadeModel(GL_FLAT); - - /* cursor */ - x= but->x1 + x*(but->x2-but->x1); - y= but->y1 + y*(but->y2-but->y1); - CLAMP(x, but->x1+3.0, but->x2-3.0); - CLAMP(y, but->y1+3.0, but->y2-3.0); - - fdrawXORcirc(x, y, 3.1); - - /* outline */ - glColor3ub(0, 0, 0); - fdrawbox((but->x1), (but->y1), (but->x2), (but->y2)); -} - -#ifdef INTERNATIONAL -static void ui_draw_but_CHARTAB(uiBut *but) -{ - /* Some local variables */ - float sx, sy, ex, ey; - float width, height; - float butw, buth; - int x, y, cs; - wchar_t wstr[2]; - unsigned char ustr[16]; - PackedFile *pf; - int result = 0; - int charmax = G.charmax; - - /* font in use. There are TTF and non-TTF fonts */ - if(!strcmp(G.selfont->name, "")) - { - if(G.ui_international == TRUE) - { - charmax = 0xff; - } - else - { - charmax = 0xff; - } - } - - /* Category list exited without selecting the area */ - if(G.charmax == 0) - charmax = G.charmax = 0xffff; - - /* Calculate the size of the button */ - width = abs(but->x2 - but->x1); - height = abs(but->y2 - but->y1); - - butw = floor(width / 12); - buth = floor(height / 6); - - /* Initialize variables */ - sx = but->x1; - ex = but->x1 + butw; - sy = but->y1 + height - buth; - ey = but->y1 + height; - - cs = G.charstart; - - /* Set the font, in case it is not font */ - if(G.selfont && strcmp(G.selfont->name, "")) - { - char tmpStr[256]; - - // Is the font file packed, if so then use the packed file - if(G.selfont->packedfile) - { - pf = G.selfont->packedfile; - FTF_SetFont(pf->data, pf->size, 14.0); - } - else - { - int err; - - strcpy(tmpStr, G.selfont->name); - BLI_convertstringcode(tmpStr, G.sce, 0); - err = FTF_SetFont((unsigned char *)tmpStr, 0, 14.0); - } - } - else - { - if(G.ui_international == TRUE) - { - FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 14.0); - } - } - - /* Start drawing the button itself */ - glShadeModel(GL_SMOOTH); - - glColor3ub(200, 200, 200); - glRectf((but->x1), (but->y1), (but->x2), (but->y2)); - - glColor3ub(0, 0, 0); - for(y = 0; y < 6; y++) - { - // Do not draw more than the category allows - if(cs > charmax) break; - - for(x = 0; x < 12; x++) - { - // Do not draw more than the category allows - if(cs > charmax) break; - - // Draw one grid cell - glBegin(GL_LINE_LOOP); - glVertex2f(sx, sy); - glVertex2f(ex, sy); - glVertex2f(ex, ey); - glVertex2f(sx, ey); - glEnd(); - - // Draw character inside the cell - memset(wstr, 0, sizeof(wchar_t)*2); - memset(ustr, 0, 16); - - // Set the font to be either unicode or - wstr[0] = cs; - if(strcmp(G.selfont->name, "")) - { - wcs2utf8s((char *)ustr, (wchar_t *)wstr); - } - else - { - if(G.ui_international == TRUE) - { - wcs2utf8s((char *)ustr, (wchar_t *)wstr); - } - else - { - ustr[0] = cs; - ustr[1] = 0; - } - } - - if((G.selfont && strcmp(G.selfont->name, "")) || (G.selfont && !strcmp(G.selfont->name, "") && G.ui_international == TRUE)) - { - float wid; - float llx, lly, llz, urx, ury, urz; - float dx, dy; - float px, py; - - // Calculate the position - wid = FTF_GetStringWidth((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - FTF_GetBoundingBox((char *) ustr, &llx,&lly,&llz,&urx,&ury,&urz, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - dx = urx-llx; - dy = ury-lly; - - // This isn't fully functional since the but->aspect isn't working like I suspected - px = sx + ((butw/but->aspect)-dx)/2; - py = sy + ((buth/but->aspect)-dy)/2; - - // Set the position and draw the character - ui_rasterpos_safe(px, py, but->aspect); - FTF_DrawString((char *) ustr, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - } - else - { - ui_rasterpos_safe(sx + butw/2, sy + buth/2, but->aspect); - BIF_DrawString(but->font, (char *) ustr, 0); - } - - // Calculate the next position and character - sx += butw; ex +=butw; - cs++; - } - /* Add the y position and reset x position */ - sy -= buth; - ey -= buth; - sx = but->x1; - ex = but->x1 + butw; - } - glShadeModel(GL_FLAT); - - /* Return Font Settings to original */ - if(U.fontsize && U.fontname[0]) - { - result = FTF_SetFont((unsigned char *)U.fontname, 0, U.fontsize); - } - else if (U.fontsize) - { - result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize); - } - - if (result == 0) - { - result = FTF_SetFont((unsigned char *) datatoc_bfont_ttf, datatoc_bfont_ttf_size, 11); - } - - /* resets the font size */ - if(G.ui_international == TRUE) - { - uiSetCurFont(but->block, UI_HELV); - } -} - -#endif // INTERNATIONAL - -static void ui_draw_but_COLORBAND(uiBut *but) -{ - ColorBand *coba= (ColorBand *)but->poin; - CBData *cbd; - float x1, y1, sizex, sizey; - float dx, v3[2], v1[2], v2[2]; - int a; - - if(coba==NULL) return; - - x1= but->x1; - y1= but->y1; - sizex= but->x2-x1; - sizey= but->y2-y1; - - /* first background, to show tranparency */ - dx= sizex/12.0; - v1[0]= x1; - for(a=0; a<12; a++) { - if(a & 1) glColor3f(0.3, 0.3, 0.3); else glColor3f(0.8, 0.8, 0.8); - glRectf(v1[0], y1, v1[0]+dx, y1+0.5*sizey); - if(a & 1) glColor3f(0.8, 0.8, 0.8); else glColor3f(0.3, 0.3, 0.3); - glRectf(v1[0], y1+0.5*sizey, v1[0]+dx, y1+sizey); - v1[0]+= dx; - } - - glShadeModel(GL_SMOOTH); - glEnable(GL_BLEND); - - cbd= coba->data; - - v1[0]= v2[0]= x1; - v1[1]= y1; - v2[1]= y1+sizey; - - glBegin(GL_QUAD_STRIP); - - glColor4fv( &cbd->r ); - glVertex2fv(v1); glVertex2fv(v2); - - for(a=0; atot; a++, cbd++) { - - v1[0]=v2[0]= x1+ cbd->pos*sizex; - - glColor4fv( &cbd->r ); - glVertex2fv(v1); glVertex2fv(v2); - } - - v1[0]=v2[0]= x1+ sizex; - glVertex2fv(v1); glVertex2fv(v2); - - glEnd(); - glShadeModel(GL_FLAT); - glDisable(GL_BLEND); - - /* outline */ - v1[0]= x1; v1[1]= y1; - - cpack(0x0); - glBegin(GL_LINE_LOOP); - glVertex2fv(v1); - v1[0]+= sizex; - glVertex2fv(v1); - v1[1]+= sizey; - glVertex2fv(v1); - v1[0]-= sizex; - glVertex2fv(v1); - glEnd(); - - - /* help lines */ - v1[0]= v2[0]=v3[0]= x1; - v1[1]= y1; - v2[1]= y1+0.5*sizey; - v3[1]= y1+sizey; - - cbd= coba->data; - glBegin(GL_LINES); - for(a=0; atot; a++, cbd++) { - v1[0]=v2[0]=v3[0]= x1+ cbd->pos*sizex; - - glColor3ub(0, 0, 0); - glVertex2fv(v1); - glVertex2fv(v2); - - if(a==coba->cur) { - glVertex2f(v1[0]-1, v1[1]); - glVertex2f(v2[0]-1, v2[1]); - glVertex2f(v1[0]+1, v1[1]); - glVertex2f(v2[0]+1, v2[1]); - } - - glColor3ub(255, 255, 255); - glVertex2fv(v2); - glVertex2fv(v3); - - if(a==coba->cur) { - if(cbd->pos>0.01) { - glVertex2f(v2[0]-1, v2[1]); - glVertex2f(v3[0]-1, v3[1]); - } - if(cbd->pos<0.99) { - glVertex2f(v2[0]+1, v2[1]); - glVertex2f(v3[0]+1, v3[1]); - } - } - } - glEnd(); -} - -static void ui_draw_but_NORMAL(uiBut *but) -{ - static GLuint displist=0; - int a, old[8]; - GLfloat diff[4], diffn[4]={1.0f, 1.0f, 1.0f, 1.0f}; - float vec0[4]={0.0f, 0.0f, 0.0f, 0.0f}; - float dir[4], size; - - /* store stuff */ - glGetMaterialfv(GL_FRONT, GL_DIFFUSE, diff); - - /* backdrop */ - BIF_ThemeColor(TH_BUT_NEUTRAL); - uiSetRoundBox(15); - gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, 5.0f); - - /* sphere color */ - glMaterialfv(GL_FRONT, GL_DIFFUSE, diffn); - glCullFace(GL_BACK); glEnable(GL_CULL_FACE); - - /* disable blender light */ - for(a=0; a<8; a++) { - old[a]= glIsEnabled(GL_LIGHT0+a); - glDisable(GL_LIGHT0+a); - } - - /* own light */ - glEnable(GL_LIGHT7); - glEnable(GL_LIGHTING); - - VECCOPY(dir, (float *)but->poin); - dir[3]= 0.0f; /* glLight needs 4 args, 0.0 is sun */ - glLightfv(GL_LIGHT7, GL_POSITION, dir); - glLightfv(GL_LIGHT7, GL_DIFFUSE, diffn); - glLightfv(GL_LIGHT7, GL_SPECULAR, vec0); - glLightf(GL_LIGHT7, GL_CONSTANT_ATTENUATION, 1.0f); - glLightf(GL_LIGHT7, GL_LINEAR_ATTENUATION, 0.0f); - - /* transform to button */ - glPushMatrix(); - glTranslatef(but->x1 + 0.5f*(but->x2-but->x1), but->y1+ 0.5f*(but->y2-but->y1), 0.0f); - size= (but->x2-but->x1)/200.f; - glScalef(size, size, size); - - if(displist==0) { - GLUquadricObj *qobj; - - displist= glGenLists(1); - glNewList(displist, GL_COMPILE_AND_EXECUTE); - - qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); - gluSphere( qobj, 100.0, 32, 24); - glShadeModel(GL_FLAT); - gluDeleteQuadric(qobj); - - glEndList(); - } - else glCallList(displist); - - /* restore */ - glPopMatrix(); - glDisable(GL_LIGHTING); - glDisable(GL_CULL_FACE); - glMaterialfv(GL_FRONT, GL_DIFFUSE, diff); - - glDisable(GL_LIGHT7); - - /* enable blender light */ - for(a=0; a<8; a++) { - if(old[a]) - glEnable(GL_LIGHT0+a); - } -} - -static void ui_draw_but_curve_grid(uiBut *but, float zoomx, float zoomy, float offsx, float offsy, float step) -{ - float dx, dy, fx, fy; - - glBegin(GL_LINES); - dx= step*zoomx; - fx= but->x1 + zoomx*(-offsx); - if(fx > but->x1) fx -= dx*( floor(fx-but->x1)); - while(fx < but->x2) { - glVertex2f(fx, but->y1); - glVertex2f(fx, but->y2); - fx+= dx; - } - - dy= step*zoomy; - fy= but->y1 + zoomy*(-offsy); - if(fy > but->y1) fy -= dy*( floor(fy-but->y1)); - while(fy < but->y2) { - glVertex2f(but->x1, fy); - glVertex2f(but->x2, fy); - fy+= dy; - } - glEnd(); - -} - -static void ui_draw_but_CURVE(uiBut *but) -{ - CurveMapping *cumap= (CurveMapping *)but->poin; - CurveMap *cuma= cumap->cm+cumap->cur; - CurveMapPoint *cmp; - float fx, fy, dx, dy, fac[2], zoomx, zoomy, offsx, offsy; - GLint scissor[4]; - int a; - - /* need scissor test, curve can draw outside of boundary */ - glGetIntegerv(GL_VIEWPORT, scissor); - fx= but->x1; fy= but->y1; - ui_graphics_to_window(but->win, &fx, &fy); - dx= but->x2; dy= but->y2; - ui_graphics_to_window(but->win, &dx, &dy); - glScissor((int)floor(fx), (int)floor(fy), (int)ceil(dx-fx), (int)ceil(dy-fy)); - - /* calculate offset and zoom */ - zoomx= (but->x2-but->x1-2.0*but->aspect)/(cumap->curr.xmax - cumap->curr.xmin); - zoomy= (but->y2-but->y1-2.0*but->aspect)/(cumap->curr.ymax - cumap->curr.ymin); - offsx= cumap->curr.xmin-but->aspect/zoomx; - offsy= cumap->curr.ymin-but->aspect/zoomy; - - /* backdrop */ - if(cumap->flag & CUMA_DO_CLIP) { - BIF_ThemeColorShade(TH_BUT_NEUTRAL, -20); - glRectf(but->x1, but->y1, but->x2, but->y2); - BIF_ThemeColor(TH_BUT_NEUTRAL); - glRectf(but->x1 + zoomx*(cumap->clipr.xmin-offsx), - but->y1 + zoomy*(cumap->clipr.ymin-offsy), - but->x1 + zoomx*(cumap->clipr.xmax-offsx), - but->y1 + zoomy*(cumap->clipr.ymax-offsy)); - } - else { - BIF_ThemeColor(TH_BUT_NEUTRAL); - glRectf(but->x1, but->y1, but->x2, but->y2); - } - - /* grid, every .25 step */ - BIF_ThemeColorShade(TH_BUT_NEUTRAL, -16); - ui_draw_but_curve_grid(but, zoomx, zoomy, offsx, offsy, 0.25f); - /* grid, every 1.0 step */ - BIF_ThemeColorShade(TH_BUT_NEUTRAL, -24); - ui_draw_but_curve_grid(but, zoomx, zoomy, offsx, offsy, 1.0f); - /* axes */ - BIF_ThemeColorShade(TH_BUT_NEUTRAL, -50); - glBegin(GL_LINES); - glVertex2f(but->x1, but->y1 + zoomy*(-offsy)); - glVertex2f(but->x2, but->y1 + zoomy*(-offsy)); - glVertex2f(but->x1 + zoomx*(-offsx), but->y1); - glVertex2f(but->x1 + zoomx*(-offsx), but->y2); - glEnd(); - - /* cfra option */ - if(cumap->flag & CUMA_DRAW_CFRA) { - glColor3ub(0x60, 0xc0, 0x40); - glBegin(GL_LINES); - glVertex2f(but->x1 + zoomx*(cumap->black[0]-offsx), but->y1); - glVertex2f(but->x1 + zoomx*(cumap->black[0]-offsx), but->y2); - glEnd(); - } - - /* the curve */ - BIF_ThemeColorBlend(TH_TEXT, TH_BUT_NEUTRAL, 0.35); - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - glBegin(GL_LINE_STRIP); - - if(cuma->table==NULL) - curvemapping_changed(cumap, 0); /* 0 = no remove doubles */ - cmp= cuma->table; - - /* first point */ - if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) - glVertex2f(but->x1, but->y1 + zoomy*(cmp[0].y-offsy)); - else { - fx= but->x1 + zoomx*(cmp[0].x-offsx + cuma->ext_in[0]); - fy= but->y1 + zoomy*(cmp[0].y-offsy + cuma->ext_in[1]); - glVertex2f(fx, fy); - } - for(a=0; a<=CM_TABLE; a++) { - fx= but->x1 + zoomx*(cmp[a].x-offsx); - fy= but->y1 + zoomy*(cmp[a].y-offsy); - glVertex2f(fx, fy); - } - /* last point */ - if((cuma->flag & CUMA_EXTEND_EXTRAPOLATE)==0) - glVertex2f(but->x2, but->y1 + zoomy*(cmp[CM_TABLE].y-offsy)); - else { - fx= but->x1 + zoomx*(cmp[CM_TABLE].x-offsx - cuma->ext_out[0]); - fy= but->y1 + zoomy*(cmp[CM_TABLE].y-offsy - cuma->ext_out[1]); - glVertex2f(fx, fy); - } - glEnd(); - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); - - /* the points, use aspect to make them visible on edges */ - cmp= cuma->curve; - glPointSize(3.0f); - bglBegin(GL_POINTS); - for(a=0; atotpoint; a++) { - if(cmp[a].flag & SELECT) - BIF_ThemeColor(TH_TEXT_HI); - else - BIF_ThemeColor(TH_TEXT); - fac[0]= but->x1 + zoomx*(cmp[a].x-offsx); - fac[1]= but->y1 + zoomy*(cmp[a].y-offsy); - bglVertex2fv(fac); - } - bglEnd(); - glPointSize(1.0f); - - /* restore scissortest */ - glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); - - /* outline */ - BIF_ThemeColor(TH_BUT_OUTLINE); - fdrawbox(but->x1, but->y1, but->x2, but->y2); - -} - -static void ui_draw_roundbox(uiBut *but) -{ - glEnable(GL_BLEND); - - BIF_ThemeColorShadeAlpha(TH_PANEL, but->a2, but->a2); - - uiSetRoundBox(but->a1); - gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, but->min); - - glDisable(GL_BLEND); -} - - -/* nothing! */ -static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag) -{ -} - - -/* ************** EXTERN, called from interface.c ************* */ -/* ************** MAIN CALLBACK FUNCTION ************* */ - -void ui_set_embossfunc(uiBut *but, int drawtype) -{ - // this aded for evaluating textcolor for example - but->dt= drawtype; - - // not really part of standard minimal themes, just make sure it is set - but->sliderfunc= ui_draw_slider; - - // standard builtin first: - if(but->type==LABEL || but->type==ROUNDBOX) but->embossfunc= ui_draw_nothing; - else if(but->type==PULLDOWN) but->embossfunc= ui_draw_pulldown_round; - else if(drawtype==UI_EMBOSSM) but->embossfunc= ui_draw_minimal; - else if(drawtype==UI_EMBOSSN) but->embossfunc= ui_draw_nothing; - else if(drawtype==UI_EMBOSSP) but->embossfunc= ui_draw_pulldown_item; - else if(drawtype==UI_EMBOSSR) but->embossfunc= ui_draw_round; - else { - int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE); - - switch(theme) { - - case TH_ROUNDED: - but->embossfunc= ui_draw_round; - break; - case TH_OLDSKOOL: - but->embossfunc= ui_draw_oldskool; - break; - case TH_MINIMAL: - but->embossfunc= ui_draw_minimal; - break; - case TH_SHADED: - default: - but->embossfunc= ui_draw_default; - but->sliderfunc= ui_default_slider; - break; - } - } - - // note: if you want aligning, adapt the call uiBlockEndAlign in interface.c -} - -void ui_draw_but(uiBut *but) -{ - double value; - float x1, x2, y1, y2, fac; - - if(but==NULL) return; - - /* signal for frontbuf flush buttons and menus, not when normal drawing */ - if(but->block->in_use) ui_block_set_flush(but->block, but); - - switch (but->type) { - - case NUMSLI: - case HSVSLI: - - but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - ui_draw_text_icon(but); - - x1= (but->x1+but->x2)/2; - x2= but->x2 - 5.0*but->aspect; - y1= but->y1 + 2.0*but->aspect; - y2= but->y2 - 2.0*but->aspect; - - value= ui_get_but_val(but); - fac= (value-but->min)*(x2-x1)/(but->max - but->min); - - but->sliderfunc(but->themecol, fac, but->aspect, x1, y1, x2, y2, but->flag); - break; - - case SEPR: - // only background - break; - - case COL: - ui_draw_but_COL(but); // black box with color - break; - - case HSVCUBE: - ui_draw_but_HSVCUBE(but); // box for colorpicker, three types - break; - -#ifdef INTERNATIONAL - case CHARTAB: - value= ui_get_but_val(but); - ui_draw_but_CHARTAB(but); - break; -#endif - - case LINK: - case INLINK: - ui_draw_icon(but, but->icon, 0); - break; - - case ROUNDBOX: - ui_draw_roundbox(but); - break; - - case BUT_COLORBAND: - ui_draw_but_COLORBAND(but); - break; - case BUT_NORMAL: - ui_draw_but_NORMAL(but); - break; - case BUT_CURVE: - ui_draw_but_CURVE(but); - break; - - default: - but->embossfunc(but->type, but->themecol, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag); - ui_draw_text_icon(but); - - } -} - -void ui_dropshadow(rctf *rct, float radius, float aspect, int select) -{ - float rad; - float a; - char alpha= 2; - - glEnable(GL_BLEND); - - if(radius > (rct->ymax-rct->ymin-10.0f)/2.0f) - rad= (rct->ymax-rct->ymin-10.0f)/2.0f; - else - rad= radius; - - if(select) a= 12.0f*aspect; else a= 12.0f*aspect; - for(; a>0.0f; a-=aspect) { - /* alpha ranges from 2 to 20 or so */ - glColor4ub(0, 0, 0, alpha); - alpha+= 2; - - gl_round_box(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a); - } - - /* outline emphasis */ - glEnable( GL_LINE_SMOOTH ); - glColor4ub(0, 0, 0, 100); - gl_round_box(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius); - glDisable( GL_LINE_SMOOTH ); - - glDisable(GL_BLEND); -} diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c deleted file mode 100644 index d93834d8d8a..00000000000 --- a/source/blender/src/interface_icons.c +++ /dev/null @@ -1,1074 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifndef WIN32 -#include -#else -#include -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_storage_types.h" - -#include "DNA_material_types.h" -#include "DNA_texture_types.h" -#include "DNA_world_types.h" -#include "DNA_object_types.h" -#include "DNA_lamp_types.h" -#include "DNA_image_types.h" -#include "DNA_texture_types.h" -#include "DNA_world_types.h" -#include "DNA_camera_types.h" -#include "DNA_image_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_global.h" -#include "BKE_material.h" -#include "BKE_texture.h" -#include "BKE_world.h" -#include "BKE_image.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" -#include "BKE_icons.h" -#include "BKE_packedFile.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_previewrender.h" -#include "BIF_screen.h" -#include "BIF_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */ - -#include "interface.h" - -#include "PIL_time.h" - -#include "blendef.h" // CLAMP -#include "datatoc.h" -#include "mydevice.h" - -#define ICON_IMAGE_W 512 -#define ICON_IMAGE_H 256 - -#define ICON_GRID_COLS 25 -#define ICON_GRID_ROWS 12 - -#define ICON_GRID_MARGIN 5 -#define ICON_GRID_W 15 -#define ICON_GRID_H 16 - -typedef struct IconImage { - int w; - int h; - unsigned int *rect; -} IconImage; - -typedef struct DrawInfo { - int w; - int h; - float aspect; - VectorDrawFunc drawFunc; /* If drawFunc is defined then it is a vector icon, otherwise use rect */ - IconImage* icon; -} DrawInfo; - -/* ******************* STATIC LOCAL VARS ******************* */ -/* static here to cache results of icon directory scan, so it's not - * scanning the filesystem each time the menu is drawn */ -static struct ListBase iconfilelist = {0, 0}; - - -static int preview_render_size(int miplevel); - -/* **************************************************** */ - -static void def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs) -{ - Icon *new_icon = NULL; - IconImage *iimg = NULL; - DrawInfo *di; - int y = 0; - - new_icon = MEM_callocN(sizeof(Icon), "texicon"); - - new_icon->obj = 0; /* icon is not for library object */ - new_icon->type = 0; - - di = MEM_callocN(sizeof(DrawInfo), "drawinfo"); - di->drawFunc = 0; - di->w = ICON_DEFAULT_HEIGHT; - di->h = ICON_DEFAULT_HEIGHT; - di->aspect = 1.0f; - - iimg = MEM_mallocN(sizeof(IconImage), "icon_img"); - iimg->rect = MEM_mallocN(ICON_DEFAULT_HEIGHT*ICON_DEFAULT_HEIGHT*sizeof(unsigned int), "icon_rect"); - iimg->w = ICON_DEFAULT_HEIGHT; - iimg->h = ICON_DEFAULT_HEIGHT; - - /* Here we store the rect in the icon - same as before */ - for (y=0; yrect[y*ICON_DEFAULT_HEIGHT], &bbuf->rect[(y+yofs)*512+xofs], ICON_DEFAULT_HEIGHT*sizeof(int)); - } - - di->icon = iimg; - - new_icon->drawinfo_free = BIF_icons_free_drawinfo; - new_icon->drawinfo = di; - - BKE_icon_set(icon_id, new_icon); -} - -static void def_internal_vicon( int icon_id, VectorDrawFunc drawFunc) -{ - Icon *new_icon = NULL; - DrawInfo* di; - - new_icon = MEM_callocN(sizeof(Icon), "texicon"); - - new_icon->obj = 0; /* icon is not for library object */ - new_icon->type = 0; - - di = MEM_callocN(sizeof(DrawInfo), "drawinfo"); - di->drawFunc =drawFunc; - di->w = ICON_DEFAULT_HEIGHT; - di->h = ICON_DEFAULT_HEIGHT; - di->aspect = 1.0f; - di->icon = NULL; - - new_icon->drawinfo_free = 0; - new_icon->drawinfo = di; - - BKE_icon_set(icon_id, new_icon); -} - -/* Vector Icon Drawing Routines */ - - /* Utilities */ - -static void viconutil_set_point(GLint pt[2], int x, int y) -{ - pt[0] = x; - pt[1] = y; -} - -static void viconutil_draw_tri(GLint (*pts)[2]) -{ - glBegin(GL_TRIANGLES); - glVertex2iv(pts[0]); - glVertex2iv(pts[1]); - glVertex2iv(pts[2]); - glEnd(); -} - -#if 0 -static void viconutil_draw_quad(GLint (*pts)[2]) -{ - glBegin(GL_QUADS); - glVertex2iv(pts[0]); - glVertex2iv(pts[1]); - glVertex2iv(pts[2]); - glVertex2iv(pts[3]); - glEnd(); -} -#endif - -static void viconutil_draw_lineloop(GLint (*pts)[2], int numPoints) -{ - int i; - - glBegin(GL_LINE_LOOP); - for (i=0; ival) pxl[0]-= val; else pxl[0]= 0; - if(pxl[1]>val) pxl[1]-= val; else pxl[1]= 0; - if(pxl[2]>val) pxl[2]-= val; else pxl[2]= 0; - - pxl[3]= 128; - } - } - } - } - } -} -#endif - -static void clear_icon_grid_margins(unsigned char *rect, int w, int h) -{ - int x, y; - int xoffs=ICON_GRID_W+ICON_GRID_MARGIN; - int yoffs=ICON_GRID_H+ICON_GRID_MARGIN; - - for (y=0; y ICON_GRID_W+2)) - pxl[3] = 0; //alpha channel == x+3 - else if ((y % yoffs < ICON_GRID_MARGIN-2) || (y % yoffs > ICON_GRID_H+2)) - pxl[3] = 0; - } - } -} - -static void prepare_internal_icons(ImBuf *bbuf) -{ - - unsigned char *back= (unsigned char *)bbuf->rect; - - /* this sets the icon grid margin area outside of icon to zero alpha */ - clear_icon_grid_margins(back, bbuf->x, bbuf->y); - - /* hack! */ -#if 0 - for (y=0; y<12; y++) { - for (x=0; x<21; x++) { - unsigned char *start= ((unsigned char*) bbuf->rect) + (y*21 + 3)*rowstride + (x*20 + 3)*4; - /* this sets backdrop of icon to zero alpha */ - transp[0]= start[0]; - transp[1]= start[1]; - transp[2]= start[2]; - transp[3]= start[3]; - clear_transp_rect(transp, start, 20, 21, rowstride); - clear_transp_rect_soft(transp, start, 20, 21, rowstride); - - } - } -#endif -} - - -static void init_internal_icons() -{ - bTheme *btheme= U.themes.first; - ImBuf *bbuf; - int x, y; - char iconfilestr[FILE_MAXDIR+FILE_MAXFILE]; - char filenamestr[FILE_MAXFILE+16]; // 16 == strlen(".blender/icons/")+1 - - if ((btheme!=NULL) && (strlen(btheme->tui.iconfile) > 0)) { - -#ifdef WIN32 - sprintf(filenamestr, "icons/%s", btheme->tui.iconfile); -#else - sprintf(filenamestr, ".blender/icons/%s", btheme->tui.iconfile); -#endif - - BLI_make_file_string("/", iconfilestr, BLI_gethome(), filenamestr); - - if (BLI_exists(iconfilestr)) { - bbuf = IMB_loadiffname(iconfilestr, IB_rect); - } else { - bbuf = IMB_ibImageFromMemory((int *)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect); - } - } else { - bbuf = IMB_ibImageFromMemory((int *)datatoc_blenderbuttons, datatoc_blenderbuttons_size, IB_rect); - } - - prepare_internal_icons(bbuf); - - for (y=0; yfirst = list->last = NULL; - -#ifdef WIN32 - BLI_make_file_string("/", icondirstr, BLI_gethome(), "icons"); -#else - BLI_make_file_string("/", icondirstr, BLI_gethome(), ".blender/icons"); -#endif - - if(BLI_exists(icondirstr)==0) - return; - - /* since BLI_getdir changes the current working directory, restore it - back to old value afterwards */ - if(!BLI_getwdN(olddir)) - restoredir = 0; - totfile = BLI_getdir(icondirstr, &dir); - if (restoredir) - chdir(olddir); - - for(i=0; ix; - ifiley = bbuf->y; - IMB_freeImBuf(bbuf); - - if ((ifilex != ICON_IMAGE_W) || (ifiley != ICON_IMAGE_H)) - continue; - - /* found a potential icon file, so make an entry for it in the cache list */ - ifile = MEM_callocN(sizeof(IconFile), "IconFile"); - - BLI_strncpy(ifile->filename, filename, sizeof(ifile->filename)); - ifile->index = index; - - BLI_addtail(list, ifile); - - index++; - } - } - } - - /* free temporary direntry structure that's been created by BLI_getdir() */ - i= totfile-1; - - for(; i>=0; i--){ - MEM_freeN(dir[i].relname); - if (dir[i].string) MEM_freeN(dir[i].string); - } - free(dir); - dir= 0; -} - -static void free_iconfile_list(struct ListBase *list) -{ - IconFile *ifile=NULL, *next_ifile=NULL; - - for(ifile=list->first; ifile; ifile=next_ifile) { - next_ifile = ifile->next; - BLI_freelinkN(list, ifile); - } -} - -int BIF_iconfile_get_index(char *filename) -{ - IconFile *ifile; - ListBase *list=&(iconfilelist); - - for(ifile=list->first; ifile; ifile=ifile->next) { - if ( BLI_streq(filename, ifile->filename)) { - return ifile->index; - } - } - - return 0; -} - -ListBase *BIF_iconfile_list(void) -{ - ListBase *list=&(iconfilelist); - - return list; -} - - -void BIF_icons_free() -{ - free_iconfile_list(&iconfilelist); - BKE_icons_free(); -} - -void BIF_icons_free_drawinfo(void *drawinfo) -{ - DrawInfo *di = drawinfo; - - if (di) - { - if (di->icon) { - MEM_freeN(di->icon->rect); - MEM_freeN(di->icon); - } - MEM_freeN(di); - } -} - -static DrawInfo *icon_create_drawinfo() -{ - DrawInfo *di = NULL; - - di = MEM_callocN(sizeof(DrawInfo), "di_icon"); - - di->drawFunc = 0; - di->w = ICON_DEFAULT_HEIGHT; - di->h = ICON_DEFAULT_HEIGHT; - di->icon = NULL; - di->aspect = 1.0f; - - return di; -} - -int BIF_icon_get_width(int icon_id) -{ - Icon *icon = NULL; - DrawInfo *di = NULL; - - icon = BKE_icon_get(icon_id); - - if (!icon) { - printf("BIF_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id); - return 0; - } - - di = (DrawInfo *)icon->drawinfo; - if (!di) { - di = icon_create_drawinfo(); - icon->drawinfo = di; - } - - if (di) - return di->w; - - return 0; -} - -int BIF_icon_get_height(int icon_id) -{ - Icon *icon = NULL; - DrawInfo *di = NULL; - - icon = BKE_icon_get(icon_id); - - if (!icon) { - printf("BIF_icon_get_width: Internal error, no icon for icon ID: %d\n", icon_id); - return 0; - } - - di = (DrawInfo*)icon->drawinfo; - - if (!di) { - di = icon_create_drawinfo(); - icon->drawinfo = di; - } - - if (di) - return di->h; - - return 0; -} - -void BIF_icons_init(int first_dyn_id) -{ - init_iconfile_list(&iconfilelist); - BKE_icons_init(first_dyn_id); - init_internal_icons(); -} - -static void icon_copy_rect(ImBuf *ibuf, unsigned int w, unsigned int h, unsigned int *rect) -{ - struct ImBuf *ima; - unsigned int *drect, *srect; - float scaledx, scaledy; - short ex, ey, dx, dy; - - /* paranoia test */ - if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) - return; - - /* waste of cpu cyles... but the imbuf API has no other way to scale fast (ton) */ - ima = IMB_dupImBuf(ibuf); - - if (!ima) - return; - - if (ima->x > ima->y) { - scaledx = (float)w; - scaledy = ( (float)ima->y/(float)ima->x )*(float)w; - } - else { - scaledx = ( (float)ima->x/(float)ima->y )*(float)h; - scaledy = (float)h; - } - - ex = (short)scaledx; - ey = (short)scaledy; - - dx = (w - ex) / 2; - dy = (h - ey) / 2; - - IMB_scalefastImBuf(ima, ex, ey); - - /* if needed, convert to 32 bits */ - if(ima->rect==NULL) - IMB_rect_from_float(ima); - - srect = ima->rect; - drect = rect; - - drect+= dy*w+dx; - for (;ey > 0; ey--){ - memcpy(drect,srect, ex * sizeof(int)); - drect += w; - srect += ima->x; - } - IMB_freeImBuf(ima); -} - -static void icon_create_mipmap(struct PreviewImage* prv_img, int miplevel) -{ - unsigned int size = preview_render_size(miplevel); - - if (!prv_img) { - printf("Error: requested preview image does not exist"); - } - if (!prv_img->rect[miplevel]) { - prv_img->w[miplevel] = size; - prv_img->h[miplevel] = size; - prv_img->changed[miplevel] = 1; - prv_img->rect[miplevel] = MEM_callocN(size*size*sizeof(unsigned int), "prv_rect"); - } -} - -/* create single icon from jpg, png etc. */ -static void icon_from_image(Image *img, int miplevel) -{ - unsigned int pr_size; - short image_loaded = 0; - struct ImBuf* ibuf=NULL; - PreviewImage* pi; - - /* img->ok is zero when Image cannot load */ - if (img==NULL || img->ok==0) - return; - - /* elubie: this needs to be changed: here image is always loaded if not - already there. Very expensive for large images. Need to find a way to - only get existing ibuf */ - ibuf = BKE_image_get_ibuf(img, NULL); - if(ibuf==NULL || ibuf->rect==NULL) { - return; - } - - pi = BKE_previewimg_get((ID*)img); - - if(!pi) { - printf("preview image could'nt be allocated"); - return; - } - /* we can only create the preview rect here, since loading possibly deallocated - old preview */ - icon_create_mipmap(pi, miplevel); - - pr_size = img->preview->w[miplevel]*img->preview->h[miplevel]*sizeof(unsigned int); - - image_loaded = 1; - icon_copy_rect(ibuf, img->preview->w[miplevel], img->preview->h[miplevel], img->preview->rect[miplevel]); -} - -static void set_alpha(char* cp, int sizex, int sizey, char alpha) -{ - int x,y; - for(y=0; yname); - return; - } - - /* no drawing (see last parameter doDraw, just calculate preview image - - hopefully small enough to be fast */ - if (GS(id->name) == ID_IM) - icon_from_image((struct Image*)id, miplevel); - else { - /* create the preview rect */ - icon_create_mipmap(prv_img, miplevel); - - ri.curtile= 0; - ri.tottile= 0; - ri.rect = NULL; - ri.pr_rectx = prv_img->w[miplevel]; - ri.pr_recty = prv_img->h[miplevel]; - - pr_size = ri.pr_rectx*ri.pr_recty*sizeof(unsigned int); - - BIF_previewrender(id, &ri, NULL, PR_ICON_RENDER); - - /* world is rendered with alpha=0, so it wasn't displayed - this could be render option for sky to, for later */ - if (GS(id->name) == ID_WO) { - set_alpha( (char*) ri.rect, ri.pr_rectx, ri.pr_recty, 255); - } - else if (GS(id->name) == ID_MA) { - Material* mat = (Material*)id; - if (mat->mode & MA_HALO) { - set_alpha( (char*) ri.rect, ri.pr_rectx, ri.pr_recty, 255); - } - } - - if (ri.rect) { - memcpy(prv_img->rect[miplevel], ri.rect, pr_size); - - /* and clean up */ - MEM_freeN(ri.rect); - ri.rect = 0; - } - } -} - -static void icon_draw_rect(float x, float y, int w, int h, float aspect, int rw, int rh, unsigned int *rect) -{ - ui_rasterpos_safe(x, y, aspect); - - if(w<1 || h<1) { - printf("what the heck!\n"); - } - /* rect contains image in 'rendersize', we only scale if needed */ - else if(rw!=w && rh!=h) { - ImBuf *ima; - if(w>2000 || h>2000) { /* something has gone wrong! */ - printf("insane icon size w=%d h=%d\n",w,h); - return; - } - /* first allocate imbuf for scaling and copy preview into it */ - ima = IMB_allocImBuf(rw, rh, 32, IB_rect, 0); - memcpy(ima->rect, rect, rw*rh*sizeof(unsigned int)); - - /* scale it */ - IMB_scaleImBuf(ima, w, h); - glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, ima->rect); - - IMB_freeImBuf(ima); - } - else - glDrawPixels(w, h, GL_RGBA, GL_UNSIGNED_BYTE, rect); -} - -/* Render size for preview images at level miplevel */ -static int preview_render_size(int miplevel) -{ - switch (miplevel) { - case 0: return 32; - case 1: return PREVIEW_DEFAULT_HEIGHT; - } - return 0; -} - -/* Drawing size for preview images at level miplevel */ -static int preview_size(int miplevel) -{ - switch (miplevel) { - case 0: return ICON_DEFAULT_HEIGHT; - case 1: return PREVIEW_DEFAULT_HEIGHT; - } - return 0; -} - - -static void icon_draw_mipmap(float x, float y, int icon_id, float aspect, int miplevel, int nocreate) -{ - Icon *icon = NULL; - DrawInfo *di = NULL; - int draw_size = preview_size(miplevel); - - icon = BKE_icon_get(icon_id); - - if (!icon) { - printf("BIF_icon_set_aspect: Internal error, no icon for icon ID: %d\n", icon_id); - return; - } - - di = (DrawInfo*)icon->drawinfo; - - if (!di) { - di = icon_create_drawinfo(); - - icon->drawinfo = di; - icon->drawinfo_free = BIF_icons_free_drawinfo; - } - - di->aspect = aspect; - /* scale width and height according to aspect */ - di->w = (int)(draw_size/di->aspect + 0.5f); - di->h = (int)(draw_size/di->aspect + 0.5f); - - if (di->drawFunc) { - /* vector icons use the uiBlock transformation, they are not drawn - with untransformed coordinates like the other icons */ - di->drawFunc(x, y, ICON_DEFAULT_HEIGHT, ICON_DEFAULT_HEIGHT, 1.0f); - } - else if (di->icon) { - /* it is a builtin icon */ - if (!di->icon->rect) return; /* something has gone wrong! */ - - icon_draw_rect(x,y,di->w, di->h, di->aspect, di->icon->w, di->icon->h, di->icon->rect); - } - else { - PreviewImage* pi = BKE_previewimg_get((ID*)icon->obj); - - if (pi) { - if (!nocreate && (pi->changed[miplevel] ||!pi->rect[miplevel])) /* changed only ever set by dynamic icons */ - { - waitcursor(1); - /* create the preview rect if necessary */ - icon_set_image((ID*)icon->obj, icon->drawinfo, pi, miplevel); - pi->changed[miplevel] = 0; - waitcursor(0); - } - - if (!pi->rect[miplevel]) return; /* something has gone wrong! */ - - icon_draw_rect(x,y,di->w, di->h, di->aspect, pi->w[miplevel], pi->h[miplevel], pi->rect[miplevel]); - } - } -} - -void BIF_icon_draw_aspect(float x, float y, int icon_id, float aspect) -{ - icon_draw_mipmap(x,y,icon_id, aspect, PREVIEW_MIPMAP_ZERO, 0); -} - -void BIF_icon_draw(float x, float y, int icon_id) -{ - BIF_icon_draw_aspect(x, y, icon_id, 1.0f); -} - -void BIF_icon_draw_preview(float x, float y, int icon_id, int nocreate) -{ - icon_draw_mipmap(x,y,icon_id, 1.0f, PREVIEW_MIPMAP_LARGE, nocreate); -} - -void BIF_icon_draw_aspect_blended(float x, float y, int icon_id, float aspect, int shade) -{ - - if(shade < 0) { - float r= (128+shade)/128.0f; - glPixelTransferf(GL_ALPHA_SCALE, r); - } - - BIF_icon_draw_aspect(x, y, icon_id, aspect); - - if(shade < 0) - glPixelTransferf(GL_ALPHA_SCALE, 1.0f); -} diff --git a/source/blender/src/interface_panel.c b/source/blender/src/interface_panel.c deleted file mode 100644 index de7f53c2af7..00000000000 --- a/source/blender/src/interface_panel.c +++ /dev/null @@ -1,1957 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt - - */ - - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_vec_types.h" - -#include "BKE_blender.h" -#include "BKE_utildefines.h" -#include "BKE_global.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" - -#include "BIF_drawimage.h" -#include "BIF_previewrender.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" -#include "BIF_butspace.h" -#include "BIF_language.h" - -#include "BSE_view.h" - -#include "mydevice.h" -#include "interface.h" -#include "blendef.h" - -// globals -extern float UIwinmat[4][4]; - - - -/* --------- generic helper drawng calls ---------------- */ - - -#define UI_RB_ALPHA 16 -static int roundboxtype= 15; - -void uiSetRoundBox(int type) -{ - /* Not sure the roundbox function is the best place to change this - * if this is undone, its not that big a deal, only makes curves edges - * square for the */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == TH_MINIMAL) - roundboxtype= 0; - else - roundboxtype= type; - - /* flags to set which corners will become rounded: - - 1------2 - | | - 8------4 - */ - -} - -void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad) -{ - float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; - int a; - - /* mult */ - for(a=0; a<7; a++) { - vec[a][0]*= rad; vec[a][1]*= rad; - } - - glBegin(mode); - - /* start with corner right-bottom */ - if(roundboxtype & 4) { - glVertex2f( maxx-rad, miny); - for(a=0; a<7; a++) { - glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]); - } - glVertex2f( maxx, miny+rad); - } - else glVertex2f( maxx, miny); - - /* corner right-top */ - if(roundboxtype & 2) { - glVertex2f( maxx, maxy-rad); - for(a=0; a<7; a++) { - glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]); - } - glVertex2f( maxx-rad, maxy); - } - else glVertex2f( maxx, maxy); - - /* corner left-top */ - if(roundboxtype & 1) { - glVertex2f( minx+rad, maxy); - for(a=0; a<7; a++) { - glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]); - } - glVertex2f( minx, maxy-rad); - } - else glVertex2f( minx, maxy); - - /* corner left-bottom */ - if(roundboxtype & 8) { - glVertex2f( minx, miny+rad); - for(a=0; a<7; a++) { - glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]); - } - glVertex2f( minx+rad, miny); - } - else glVertex2f( minx, miny); - - glEnd(); -} - -static void round_box_shade_col(float *col1, float *col2, float fac) -{ - float col[3]; - - col[0]= (fac*col1[0] + (1.0-fac)*col2[0]); - col[1]= (fac*col1[1] + (1.0-fac)*col2[1]); - col[2]= (fac*col1[2] + (1.0-fac)*col2[2]); - - glColor3fv(col); -} - -/* linear horizontal shade within button or in outline */ -void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown) -{ - float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; - float div= maxy-miny; - float coltop[3], coldown[3], color[4]; - int a; - - /* mult */ - for(a=0; a<7; a++) { - vec[a][0]*= rad; vec[a][1]*= rad; - } - /* get current color, needs to be outside of glBegin/End */ - glGetFloatv(GL_CURRENT_COLOR, color); - - /* 'shade' defines strength of shading */ - coltop[0]= color[0]+shadetop; if(coltop[0]>1.0) coltop[0]= 1.0; - coltop[1]= color[1]+shadetop; if(coltop[1]>1.0) coltop[1]= 1.0; - coltop[2]= color[2]+shadetop; if(coltop[2]>1.0) coltop[2]= 1.0; - coldown[0]= color[0]+shadedown; if(coldown[0]<0.0) coldown[0]= 0.0; - coldown[1]= color[1]+shadedown; if(coldown[1]<0.0) coldown[1]= 0.0; - coldown[2]= color[2]+shadedown; if(coldown[2]<0.0) coldown[2]= 0.0; - - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) { - glShadeModel(GL_SMOOTH); - glBegin(mode); - } - - /* start with corner right-bottom */ - if(roundboxtype & 4) { - - round_box_shade_col(coltop, coldown, 0.0); - glVertex2f( maxx-rad, miny); - - for(a=0; a<7; a++) { - round_box_shade_col(coltop, coldown, vec[a][1]/div); - glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]); - } - - round_box_shade_col(coltop, coldown, rad/div); - glVertex2f( maxx, miny+rad); - } - else { - round_box_shade_col(coltop, coldown, 0.0); - glVertex2f( maxx, miny); - } - - /* corner right-top */ - if(roundboxtype & 2) { - - round_box_shade_col(coltop, coldown, (div-rad)/div); - glVertex2f( maxx, maxy-rad); - - for(a=0; a<7; a++) { - round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])/div); - glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]); - } - round_box_shade_col(coltop, coldown, 1.0); - glVertex2f( maxx-rad, maxy); - } - else { - round_box_shade_col(coltop, coldown, 1.0); - glVertex2f( maxx, maxy); - } - - /* corner left-top */ - if(roundboxtype & 1) { - - round_box_shade_col(coltop, coldown, 1.0); - glVertex2f( minx+rad, maxy); - - for(a=0; a<7; a++) { - round_box_shade_col(coltop, coldown, (div-vec[a][1])/div); - glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]); - } - - round_box_shade_col(coltop, coldown, (div-rad)/div); - glVertex2f( minx, maxy-rad); - } - else { - round_box_shade_col(coltop, coldown, 1.0); - glVertex2f( minx, maxy); - } - - /* corner left-bottom */ - if(roundboxtype & 8) { - - round_box_shade_col(coltop, coldown, rad/div); - glVertex2f( minx, miny+rad); - - for(a=0; a<7; a++) { - round_box_shade_col(coltop, coldown, (rad-vec[a][1])/div); - glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]); - } - - round_box_shade_col(coltop, coldown, 0.0); - glVertex2f( minx+rad, miny); - } - else { - round_box_shade_col(coltop, coldown, 0.0); - glVertex2f( minx, miny); - } - - glEnd(); - glShadeModel(GL_FLAT); -} - -/* only for headers */ -static void gl_round_box_topshade(float minx, float miny, float maxx, float maxy, float rad) -{ - float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; - char col[7]= {140, 165, 195, 210, 230, 245, 255}; - int a; - char alpha=255; - - if(roundboxtype & UI_RB_ALPHA) alpha= 128; - - /* mult */ - for(a=0; a<7; a++) { - vec[a][0]*= rad; vec[a][1]*= rad; - } - - /* shades from grey->white->grey */ - glBegin(GL_LINE_STRIP); - - if(roundboxtype & 3) { - /* corner right-top */ - glColor4ub(140, 140, 140, alpha); - glVertex2f( maxx, maxy-rad); - for(a=0; a<7; a++) { - glColor4ub(col[a], col[a], col[a], alpha); - glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]); - } - glColor4ub(225, 225, 225, alpha); - glVertex2f( maxx-rad, maxy); - - - /* corner left-top */ - glVertex2f( minx+rad, maxy); - for(a=0; a<7; a++) { - glColor4ub(col[6-a], col[6-a], col[6-a], alpha); - glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]); - } - glVertex2f( minx, maxy-rad); - } - else { - glColor4ub(225, 225, 225, alpha); - glVertex2f( minx, maxy); - glVertex2f( maxx, maxy); - } - - glEnd(); -} - -/* for headers and floating panels */ -void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad, int active) -{ - float color[4]; - - if(roundboxtype & UI_RB_ALPHA) { - glGetFloatv(GL_CURRENT_COLOR, color); - color[3]= 0.5; - glColor4fv(color); - glEnable( GL_BLEND ); - } - - /* solid part */ - //if(active) - // gl_round_box_shade(GL_POLYGON, minx, miny, maxx, maxy, rad, 0.10, -0.05); - // else - /* shading doesnt work for certain buttons yet (pulldown) need smarter buffer caching (ton) */ - gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad); - - /* set antialias line */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) { - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - } - - /* top shade */ - gl_round_box_topshade(minx+1, miny+1, maxx-1, maxy-1, rad); - - /* total outline */ - if(roundboxtype & UI_RB_ALPHA) glColor4ub(0,0,0, 128); else glColor4ub(0,0,0, 200); - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); - - glDisable( GL_LINE_SMOOTH ); - - /* bottom shade for header down */ - if((roundboxtype & 12)==12) { - glColor4ub(0,0,0, 80); - fdrawline(minx+rad-1.0, miny+1.0, maxx-rad+1.0, miny+1.0); - } - glDisable( GL_BLEND ); -} - - -/* plain antialiased unfilled rectangle */ -void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad) -{ - float color[4]; - - if(roundboxtype & UI_RB_ALPHA) { - glGetFloatv(GL_CURRENT_COLOR, color); - color[3]= 0.5; - glColor4fv(color); - glEnable( GL_BLEND ); - } - - /* set antialias line */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) { - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - } - - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); - - glDisable( GL_BLEND ); - glDisable( GL_LINE_SMOOTH ); -} - - - -/* plain antialiased filled box */ -void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad) -{ - float color[4]; - - if(roundboxtype & UI_RB_ALPHA) { - glGetFloatv(GL_CURRENT_COLOR, color); - color[3]= 0.5; - glColor4fv(color); - glEnable( GL_BLEND ); - } - - /* solid part */ - gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad); - - /* set antialias line */ - if (BIF_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) { - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - } - - gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad); - - glDisable( GL_BLEND ); - glDisable( GL_LINE_SMOOTH ); -} - - -/* ************** panels ************* */ - -static void copy_panel_offset(Panel *pa, Panel *papar) -{ - /* with respect to sizes... papar is parent */ - - pa->ofsx= papar->ofsx; - pa->ofsy= papar->ofsy + papar->sizey-pa->sizey; -} - - - -/* global... but will be NULLed after each 'newPanel' call */ -static char *panel_tabbed=NULL, *group_tabbed=NULL; - -void uiNewPanelTabbed(char *panelname, char *groupname) -{ - panel_tabbed= panelname; - group_tabbed= groupname; -} - -/* another global... */ -static int pnl_control= UI_PNL_TRANSP; - -void uiPanelControl(int control) -{ - pnl_control= control; -} - -/* another global... */ -static int pnl_handler= 0; - -void uiSetPanelHandler(int handler) -{ - pnl_handler= handler; -} - - -/* ofsx/ofsy only used for new panel definitions */ -/* return 1 if visible (create buttons!) */ -int uiNewPanel(ScrArea *sa, uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey) -{ - Panel *pa; - - /* check if Panel exists, then use that one */ - pa= sa->panels.first; - while(pa) { - if( strncmp(pa->panelname, panelname, UI_MAX_NAME_STR)==0) { - if( strncmp(pa->tabname, tabname, UI_MAX_NAME_STR)==0) { - break; - } - } - pa= pa->next; - } - - if(pa) { - /* scale correction */ - if(pa->control & UI_PNL_SCALE); - else { - pa->sizex= sizex; - if(pa->sizey != sizey) { - pa->ofsy+= (pa->sizey - sizey); // check uiNewPanelHeight() - pa->sizey= sizey; - } - } - } - else { - - /* new panel */ - pa= MEM_callocN(sizeof(Panel), "new panel"); - BLI_addtail(&sa->panels, pa); - strncpy(pa->panelname, panelname, UI_MAX_NAME_STR); - strncpy(pa->tabname, tabname, UI_MAX_NAME_STR); - - pa->ofsx= ofsx & ~(PNL_GRID-1); - pa->ofsy= ofsy & ~(PNL_GRID-1); - pa->sizex= sizex; - pa->sizey= sizey; - - /* make new Panel tabbed? */ - if(panel_tabbed && group_tabbed) { - Panel *papar; - for(papar= sa->panels.first; papar; papar= papar->next) { - if(papar->active && papar->paneltab==NULL) { - if( strncmp(panel_tabbed, papar->panelname, UI_MAX_NAME_STR)==0) { - if( strncmp(group_tabbed, papar->tabname, UI_MAX_NAME_STR)==0) { - pa->paneltab= papar; - copy_panel_offset(pa, papar); - break; - } - } - } - } - } - } - - block->panel= pa; - block->handler= pnl_handler; - pa->active= 1; - pa->control= pnl_control; - - /* global control over this feature; UI_PNL_TO_MOUSE only called for hotkey panels */ - if(U.uiflag & USER_PANELPINNED); - else if(pnl_control & UI_PNL_TO_MOUSE) { - short mval[2]; - - Mat4CpyMat4(UIwinmat, block->winmat); // can be first event here - uiGetMouse(block->win, mval); - pa->ofsx= mval[0]-pa->sizex/2; - pa->ofsy= mval[1]-pa->sizey/2; - - if(pa->flag & PNL_CLOSED) pa->flag &= ~PNL_CLOSED; - } - - if(pnl_control & UI_PNL_UNSTOW) { - if(pa->flag & PNL_CLOSEDY) { - pa->flag &= ~PNL_CLOSED; - } - } - - /* clear ugly globals */ - panel_tabbed= group_tabbed= NULL; - pnl_handler= 0; - pnl_control= UI_PNL_TRANSP; // back to default - - if(block->panel->paneltab) return 0; - if(block->panel->flag & PNL_CLOSED) return 0; - - /* the 'return 0' above makes this to be in end. otherwise closes panels show wrong title */ - pa->drawname[0]= 0; - - return 1; -} - -void uiFreePanels(ListBase *lb) -{ - Panel *panel; - - while( (panel= lb->first) ) { - BLI_remlink(lb, panel); - MEM_freeN(panel); - } -} - -void uiNewPanelHeight(uiBlock *block, int sizey) -{ - if(sizey<64) sizey= 64; - - if(block->panel) { - block->panel->ofsy+= (block->panel->sizey - sizey); - block->panel->sizey= sizey; - } -} - -void uiNewPanelTitle(uiBlock *block, char *str) -{ - if(block->panel) - BLI_strncpy(block->panel->drawname, str, UI_MAX_NAME_STR); -} - -static int panel_has_tabs(Panel *panel) -{ - Panel *pa= curarea->panels.first; - - if(panel==NULL) return 0; - - while(pa) { - if(pa->paneltab==panel) return 1; - pa= pa->next; - } - return 0; -} - -static void ui_scale_panel_block(uiBlock *block) -{ - uiBut *but; - float facx= 1.0, facy= 1.0; - int centerx= 0, topy=0, tabsy=0; - - if(block->panel==NULL) return; - - if(block->autofill) ui_autofill(block); - /* buttons min/max centered, offset calculated */ - uiBoundsBlock(block, 0); - - if( block->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) { - facx= (block->panel->sizex - (2*PNL_SAFETY))/( block->maxx-block->minx ); - } - else centerx= (block->panel->sizex-( block->maxx-block->minx ) - 2*PNL_SAFETY)/2; - - // tabsy= PNL_HEADER*panel_has_tabs(block->panel); - if( (block->maxy-block->miny) > block->panel->sizey - 2*PNL_SAFETY - tabsy) { - facy= (block->panel->sizey - (2*PNL_SAFETY) - tabsy)/( block->maxy-block->miny ); - } - else topy= (block->panel->sizey- 2*PNL_SAFETY - tabsy) - ( block->maxy-block->miny ) ; - - but= block->buttons.first; - while(but) { - but->x1= PNL_SAFETY+centerx+ facx*(but->x1-block->minx); - but->y1= PNL_SAFETY+topy + facy*(but->y1-block->miny); - but->x2= PNL_SAFETY+centerx+ facx*(but->x2-block->minx); - but->y2= PNL_SAFETY+topy + facy*(but->y2-block->miny); - if(facx!=1.0) ui_check_but(but); /* for strlen */ - but= but->next; - } - - block->maxx= block->panel->sizex; - block->maxy= block->panel->sizey; - block->minx= block->miny= 0.0; - -} - -// for 'home' key -void uiSetPanel_view2d(ScrArea *sa) -{ - Panel *pa; - float minx=10000, maxx= -10000, miny=10000, maxy= -10000; - int done=0; - - pa= sa->panels.first; - while(pa) { - if(pa->active && pa->paneltab==NULL) { - done= 1; - if(pa->ofsx < minx) minx= pa->ofsx; - if(pa->ofsx+pa->sizex > maxx) maxx= pa->ofsx+pa->sizex; - if(pa->ofsy < miny) miny= pa->ofsy; - if(pa->ofsy+pa->sizey+PNL_HEADER > maxy) maxy= pa->ofsy+pa->sizey+PNL_HEADER; - } - pa= pa->next; - } - if(done) { - G.v2d->tot.xmin= minx-PNL_DIST; - G.v2d->tot.xmax= maxx+PNL_DIST; - G.v2d->tot.ymin= miny-PNL_DIST; - G.v2d->tot.ymax= maxy+PNL_DIST; - } - else { - uiBlock *block; - - G.v2d->tot.xmin= 0; - G.v2d->tot.xmax= 1280; - G.v2d->tot.ymin= 0; - G.v2d->tot.ymax= 228; - - /* no panels, but old 'loose' buttons, as in old logic editor */ - for(block= sa->uiblocks.first; block; block= block->next) { - if(block->win==sa->win) { - if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx; - if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx; - if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny; - if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy; - } - } - } - -} - -// make sure the panels are not outside 'tot' area -void uiMatchPanel_view2d(ScrArea *sa) -{ - Panel *pa; - int done=0; - - pa= sa->panels.first; - while(pa) { - if(pa->active && pa->paneltab==NULL) { - done= 1; - if(pa->ofsx < G.v2d->tot.xmin) G.v2d->tot.xmin= pa->ofsx; - if(pa->ofsx+pa->sizex > G.v2d->tot.xmax) - G.v2d->tot.xmax= pa->ofsx+pa->sizex; - if(pa->ofsy < G.v2d->tot.ymin) G.v2d->tot.ymin= pa->ofsy; - if(pa->ofsy+pa->sizey+PNL_HEADER > G.v2d->tot.ymax) - G.v2d->tot.ymax= pa->ofsy+pa->sizey+PNL_HEADER; - } - pa= pa->next; - } - if(done==0) { - uiBlock *block; - /* no panels, but old 'loose' buttons, as in old logic editor */ - for(block= sa->uiblocks.first; block; block= block->next) { - if(block->win==sa->win) { - if(block->minx < G.v2d->tot.xmin) G.v2d->tot.xmin= block->minx; - if(block->maxx > G.v2d->tot.xmax) G.v2d->tot.xmax= block->maxx; - if(block->miny < G.v2d->tot.ymin) G.v2d->tot.ymin= block->miny; - if(block->maxy > G.v2d->tot.ymax) G.v2d->tot.ymax= block->maxy; - } - } - } -} - -/* extern used by previewrender */ -void uiPanelPush(uiBlock *block) -{ - glPushMatrix(); - if(block->panel) { - glTranslatef((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0); - i_translate((float)block->panel->ofsx, (float)block->panel->ofsy, 0.0, UIwinmat); - } -} - -void uiPanelPop(uiBlock *block) -{ - glPopMatrix(); - Mat4CpyMat4(UIwinmat, block->winmat); -} - -uiBlock *uiFindOpenPanelBlockName(ListBase *lb, char *name) -{ - uiBlock *block; - - for(block= lb->first; block; block= block->next) { - if(block->panel && block->panel->active && block->panel->paneltab==NULL) { - if(block->panel->flag & PNL_CLOSED); - else if(strncmp(name, block->panel->panelname, UI_MAX_NAME_STR)==0) break; - } - } - return block; -} - -static void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3) -{ - // we draw twice, anti polygons not widely supported... - glBegin(GL_POLYGON); - glVertex2f(x1, y1); - glVertex2f(x2, y2); - glVertex2f(x3, y3); - glEnd(); - - /* set antialias line */ - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - - glBegin(GL_LINE_LOOP); - glVertex2f(x1, y1); - glVertex2f(x2, y2); - glVertex2f(x3, y3); - glEnd(); - - glDisable( GL_LINE_SMOOTH ); - glDisable( GL_BLEND ); -} - -/* triangle 'icon' for panel header */ -void ui_draw_tria_icon(float x, float y, float aspect, char dir) -{ - if(dir=='h') { - ui_draw_anti_tria( x, y+1, x, y+10.0, x+8, y+6.25); - } - else { - ui_draw_anti_tria( x-2, y+9, x+8-2, y+9, x+4.25-2, y+1); - } -} - -void ui_draw_anti_x(float x1, float y1, float x2, float y2) -{ - - /* set antialias line */ - glEnable( GL_LINE_SMOOTH ); - glEnable( GL_BLEND ); - - glLineWidth(2.0); - - fdrawline(x1, y1, x2, y2); - fdrawline(x1, y2, x2, y1); - - glLineWidth(1.0); - - glDisable( GL_LINE_SMOOTH ); - glDisable( GL_BLEND ); - -} - -/* x 'icon' for panel header */ -static void ui_draw_x_icon(float x, float y) -{ - BIF_ThemeColor(TH_TEXT_HI); - - ui_draw_anti_x( x, y, x+9.375, y+9.375); - -} - -#if 0 -static void ui_set_panel_pattern(char dir) -{ - static int firsttime= 1; - static GLubyte path[4*32], patv[4*32]; - int a,b,i=0; - - if(firsttime) { - firsttime= 0; - for(a=0; a<128; a++) patv[a]= 0x33; - for(a=0; a<8; a++) { - for(b=0; b<4; b++) path[i++]= 0xff; /* 1 scanlines */ - for(b=0; b<12; b++) path[i++]= 0x0; /* 3 lines */ - } - } - glEnable(GL_POLYGON_STIPPLE); - if(dir=='h') glPolygonStipple(path); - else glPolygonStipple(patv); -} -#endif - -static char *ui_block_cut_str(uiBlock *block, char *str, short okwidth) -{ - short width, ofs=strlen(str); - static char str1[128]; - - if(ofs>127) return str; - - width= block->aspect*BIF_GetStringWidth(block->curfont, str, (U.transopts & USER_TR_BUTTONS)); - - if(width <= okwidth) return str; - strcpy(str1, str); - - while(width > okwidth && ofs>0) { - ofs--; - str1[ofs]= 0; - - width= block->aspect*BIF_GetStringWidth(block->curfont, str1, 0); - - if(width < 10) break; - } - return str1; -} - - -#define PNL_ICON 20 -#define PNL_DRAGGER 20 - - -static void ui_draw_panel_header(uiBlock *block) -{ - Panel *pa, *panel= block->panel; - float width; - int a, nr= 1, pnl_icons; - char *panelname= panel->drawname[0]?panel->drawname:panel->panelname; - char *str; - - /* count */ - pa= curarea->panels.first; - while(pa) { - if(pa->active) { - if(pa->paneltab==panel) nr++; - } - pa= pa->next; - } - - pnl_icons= PNL_ICON+8; - if(panel->control & UI_PNL_CLOSE) pnl_icons+= PNL_ICON; - - if(nr==1) { - // full header - BIF_ThemeColorShade(TH_HEADER, -30); - uiSetRoundBox(3); - uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - - /* active tab */ - /* draw text label */ - BIF_ThemeColor(TH_TEXT_HI); - ui_rasterpos_safe(4.0f+block->minx+pnl_icons, block->maxy+5.0f, block->aspect); - BIF_DrawString(block->curfont, panelname, (U.transopts & USER_TR_BUTTONS)); - return; - } - - // tabbed, full header brighter - //BIF_ThemeColorShade(TH_HEADER, 0); - //uiSetRoundBox(3); - //uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - - a= 0; - width= (panel->sizex - 3 - pnl_icons - PNL_ICON)/nr; - pa= curarea->panels.first; - while(pa) { - panelname= pa->drawname[0]?pa->drawname:pa->panelname; - - if(pa->active==0); - else if(pa==panel) { - /* active tab */ - - /* draw the active tab */ - uiSetRoundBox(3); - BIF_ThemeColorShade(TH_HEADER, -3); - uiRoundBox(2+pnl_icons+a*width, panel->sizey-1, pnl_icons+(a+1)*width, panel->sizey+PNL_HEADER-3, 8); - - /* draw the active text label */ - BIF_ThemeColor(TH_TEXT); - ui_rasterpos_safe(16+pnl_icons+a*width, panel->sizey+4, block->aspect); - str= ui_block_cut_str(block, panelname, (short)(width-10)); - BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS)); - - a++; - } - else if(pa->paneltab==panel) { - /* draw an inactive tab */ - uiSetRoundBox(3); - BIF_ThemeColorShade(TH_HEADER, -60); - uiRoundBox(2+pnl_icons+a*width, panel->sizey, pnl_icons+(a+1)*width, panel->sizey+PNL_HEADER-3, 8); - - /* draw an inactive tab label */ - BIF_ThemeColorShade(TH_TEXT_HI, -40); - ui_rasterpos_safe(16+pnl_icons+a*width, panel->sizey+4, block->aspect); - str= ui_block_cut_str(block, panelname, (short)(width-10)); - BIF_DrawString(block->curfont, str, (U.transopts & USER_TR_BUTTONS)); - - a++; - } - pa= pa->next; - } - - // dragger - /* - uiSetRoundBox(15); - BIF_ThemeColorShade(TH_HEADER, -70); - uiRoundBox(panel->sizex-PNL_ICON+5, panel->sizey+5, panel->sizex-5, panel->sizey+PNL_HEADER-5, 5); - */ - -} - -static void ui_draw_panel_scalewidget(uiBlock *block) -{ - float xmin, xmax, dx; - float ymin, ymax, dy; - - xmin= block->maxx-PNL_HEADER+2; - xmax= block->maxx-3; - ymin= block->miny+3; - ymax= block->miny+PNL_HEADER-2; - - dx= 0.5f*(xmax-xmin); - dy= 0.5f*(ymax-ymin); - - glEnable(GL_BLEND); - glColor4ub(255, 255, 255, 50); - fdrawline(xmin, ymin, xmax, ymax); - fdrawline(xmin+dx, ymin, xmax, ymax-dy); - - glColor4ub(0, 0, 0, 50); - fdrawline(xmin, ymin+block->aspect, xmax, ymax+block->aspect); - fdrawline(xmin+dx, ymin+block->aspect, xmax, ymax-dy+block->aspect); - glDisable(GL_BLEND); -} - -void ui_draw_panel(uiBlock *block) -{ - Panel *panel= block->panel; - int ofsx; - char *panelname= panel->drawname[0]?panel->drawname:panel->panelname; - - if(panel->paneltab) return; - - /* if the panel is minimized vertically: - * (------) - */ - if(panel->flag & PNL_CLOSEDY) { - /* draw a little rounded box, the size of the header */ - uiSetRoundBox(15); - BIF_ThemeColorShade(TH_HEADER, -30); - uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - - /* title */ - ofsx= PNL_ICON+8; - if(panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON; - BIF_ThemeColor(TH_TEXT_HI); - ui_rasterpos_safe(4+block->minx+ofsx, block->maxy+5, block->aspect); - BIF_DrawString(block->curfont, panelname, (U.transopts & USER_TR_BUTTONS)); - - /* border */ - if(panel->flag & PNL_SELECT) { - BIF_ThemeColorShade(TH_HEADER, -120); - uiRoundRect(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - } - /* if it's being overlapped by a panel being dragged */ - if(panel->flag & PNL_OVERLAP) { - BIF_ThemeColor(TH_TEXT_HI); - uiRoundRect(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - } - - } - /* if the panel is minimized horizontally: - * /-\ - * | - * | - * | - * \_/ - */ - else if(panel->flag & PNL_CLOSEDX) { - char str[4]; - int a, end, ofs; - - /* draw a little rounded box, the size of the header, rotated 90 deg */ - uiSetRoundBox(15); - BIF_ThemeColorShade(TH_HEADER, -30); - uiRoundBox(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8); - - /* title, only the initial character for now */ - BIF_ThemeColor(TH_TEXT_HI); - str[1]= 0; - end= strlen(panelname); - ofs= 20; - for(a=0; aminx+5, block->maxy-ofs, block->aspect); - BIF_DrawString(block->curfont, str, 0); - ofs+= 15; - } - } - - /* border */ - if(panel->flag & PNL_SELECT) { - BIF_ThemeColorShade(TH_HEADER, -120); - uiRoundRect(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8); - } - if(panel->flag & PNL_OVERLAP) { - BIF_ThemeColor(TH_TEXT_HI); - uiRoundRect(block->minx, block->miny, block->minx+PNL_HEADER, block->maxy+PNL_HEADER, 8); - } - - } - /* an open panel */ - else { - /* all panels now... */ - if(panel->control & UI_PNL_SOLID) { - BIF_ThemeColorShade(TH_HEADER, -30); - - uiSetRoundBox(3); - uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - - glEnable(GL_BLEND); - BIF_ThemeColor4(TH_PANEL); - - uiSetRoundBox(12); - /* bad code... but its late :) */ - if(strcmp(block->name, "image_panel_preview")==0) - uiRoundRect(block->minx, block->miny, block->maxx, block->maxy, 8); - else - uiRoundBox(block->minx, block->miny, block->maxx, block->maxy, 8); - - // glRectf(block->minx, block->miny, block->maxx, block->maxy); - - /* shadow */ - /* - glColor4ub(0, 0, 0, 40); - - fdrawline(block->minx+2, block->miny-1, block->maxx+1, block->miny-1); - fdrawline(block->maxx+1, block->miny-1, block->maxx+1, block->maxy+7); - - glColor4ub(0, 0, 0, 10); - - fdrawline(block->minx+3, block->miny-2, block->maxx+2, block->miny-2); - fdrawline(block->maxx+2, block->miny-2, block->maxx+2, block->maxy+6); - - */ - - glDisable(GL_BLEND); - } - /* floating panel */ - else if(panel->control & UI_PNL_TRANSP) { - BIF_ThemeColorShade(TH_HEADER, -30); - uiSetRoundBox(3); - uiRoundBox(block->minx, block->maxy, block->maxx, block->maxy+PNL_HEADER, 8); - - glEnable(GL_BLEND); - BIF_ThemeColor4(TH_PANEL); - glRectf(block->minx, block->miny, block->maxx, block->maxy); - - glDisable(GL_BLEND); - } - - /* draw the title, tabs, etc in the header */ - ui_draw_panel_header(block); - - /* in some occasions, draw a border */ - if(panel->flag & PNL_SELECT) { - if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15); - else uiSetRoundBox(3); - - BIF_ThemeColorShade(TH_HEADER, -120); - uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 8); - } - if(panel->flag & PNL_OVERLAP) { - if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15); - else uiSetRoundBox(3); - - BIF_ThemeColor(TH_TEXT_HI); - uiRoundRect(block->minx, block->miny, block->maxx, block->maxy+PNL_HEADER, 8); - } - - if(panel->control & UI_PNL_SCALE) - ui_draw_panel_scalewidget(block); - - /* and a soft shadow-line for now */ - /* - glEnable( GL_BLEND ); - glColor4ub(0, 0, 0, 50); - fdrawline(block->maxx, block->miny, block->maxx, block->maxy+PNL_HEADER/2); - fdrawline(block->minx, block->miny, block->maxx, block->miny); - glDisable(GL_BLEND); - */ - - } - - /* draw optional close icon */ - - ofsx= 6; - if(panel->control & UI_PNL_CLOSE) { - - ui_draw_x_icon(block->minx+2+ofsx, block->maxy+5); - ofsx= 22; - } - - /* draw collapse icon */ - - BIF_ThemeColor(TH_TEXT_HI); - - if(panel->flag & PNL_CLOSEDY) - ui_draw_tria_icon(block->minx+6+ofsx, block->maxy+5, block->aspect, 'h'); - else if(panel->flag & PNL_CLOSEDX) - ui_draw_tria_icon(block->minx+7, block->maxy+2, block->aspect, 'h'); - else - ui_draw_tria_icon(block->minx+6+ofsx, block->maxy+5, block->aspect, 'v'); - - -} - -static void ui_redraw_select_panel(ScrArea *sa) -{ - /* only for beauty, make sure the panel thats moved is on top */ - /* better solution later? */ - uiBlock *block; - - for(block= sa->uiblocks.first; block; block= block->next) { - if(block->panel && (block->panel->flag & PNL_SELECT)) { - uiDrawBlock(block); - } - } - -} - - -/* ------------ panel alignment ---------------- */ - - -/* this function is needed because uiBlock and Panel itself dont -change sizey or location when closed */ -static int get_panel_real_ofsy(Panel *pa) -{ - if(pa->flag & PNL_CLOSEDY) return pa->ofsy+pa->sizey; - else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDY)) return pa->ofsy+pa->sizey; - else return pa->ofsy; -} - -static int get_panel_real_ofsx(Panel *pa) -{ - if(pa->flag & PNL_CLOSEDX) return pa->ofsx+PNL_HEADER; - else if(pa->paneltab && (pa->paneltab->flag & PNL_CLOSEDX)) return pa->ofsx+PNL_HEADER; - else return pa->ofsx+pa->sizex; -} - - -typedef struct PanelSort { - Panel *pa, *orig; -} PanelSort; - -/* note about sorting; - the sortcounter has a lower value for new panels being added. - however, that only works to insert a single panel, when more new panels get - added the coordinates of existing panels and the previously stored to-be-insterted - panels do not match for sorting */ - -static int find_leftmost_panel(const void *a1, const void *a2) -{ - const PanelSort *ps1=a1, *ps2=a2; - - if( ps1->pa->ofsx > ps2->pa->ofsx) return 1; - else if( ps1->pa->ofsx < ps2->pa->ofsx) return -1; - else if( ps1->pa->sortcounter > ps2->pa->sortcounter) return 1; - else if( ps1->pa->sortcounter < ps2->pa->sortcounter) return -1; - - return 0; -} - - -static int find_highest_panel(const void *a1, const void *a2) -{ - const PanelSort *ps1=a1, *ps2=a2; - - if( ps1->pa->ofsy < ps2->pa->ofsy) return 1; - else if( ps1->pa->ofsy > ps2->pa->ofsy) return -1; - else if( ps1->pa->sortcounter > ps2->pa->sortcounter) return 1; - else if( ps1->pa->sortcounter < ps2->pa->sortcounter) return -1; - - return 0; -} - -/* this doesnt draw */ -/* returns 1 when it did something */ -int uiAlignPanelStep(ScrArea *sa, float fac) -{ - SpaceButs *sbuts= sa->spacedata.first; - Panel *pa; - PanelSort *ps, *panelsort, *psnext; - static int sortcounter= 0; - int a, tot=0, done; - - if(sa->spacetype!=SPACE_BUTS) { - return 0; - } - - /* count active, not tabbed Panels */ - for(pa= sa->panels.first; pa; pa= pa->next) { - if(pa->active && pa->paneltab==NULL) tot++; - } - - if(tot==0) return 0; - - /* extra; change close direction? */ - for(pa= sa->panels.first; pa; pa= pa->next) { - if(pa->active && pa->paneltab==NULL) { - if( (pa->flag & PNL_CLOSEDX) && (sbuts->align==BUT_VERTICAL) ) - pa->flag ^= PNL_CLOSED; - - else if( (pa->flag & PNL_CLOSEDY) && (sbuts->align==BUT_HORIZONTAL) ) - pa->flag ^= PNL_CLOSED; - - } - } - - panelsort= MEM_callocN( tot*sizeof(PanelSort), "panelsort"); - - /* fill panelsort array */ - ps= panelsort; - for(pa= sa->panels.first; pa; pa= pa->next) { - if(pa->active && pa->paneltab==NULL) { - ps->pa= MEM_dupallocN(pa); - ps->orig= pa; - ps++; - } - } - - if(sbuts->align==BUT_VERTICAL) - qsort(panelsort, tot, sizeof(PanelSort), find_highest_panel); - else - qsort(panelsort, tot, sizeof(PanelSort), find_leftmost_panel); - - - /* no smart other default start loc! this keeps switching f5/f6/etc compatible */ - ps= panelsort; - ps->pa->ofsx= 0; - ps->pa->ofsy= 0; - - for(a=0 ; aalign==BUT_VERTICAL) { - psnext->pa->ofsx = ps->pa->ofsx; - psnext->pa->ofsy = get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-PNL_HEADER-PNL_DIST; - } - else { - psnext->pa->ofsx = get_panel_real_ofsx(ps->pa)+PNL_DIST; - psnext->pa->ofsy = ps->pa->ofsy + ps->pa->sizey - psnext->pa->sizey; - } - } - - /* we interpolate */ - done= 0; - ps= panelsort; - for(a=0; apa->flag & PNL_SELECT)==0) { - if( (ps->orig->ofsx != ps->pa->ofsx) || (ps->orig->ofsy != ps->pa->ofsy)) { - ps->orig->ofsx= floor(0.5 + fac*ps->pa->ofsx + (1.0-fac)*ps->orig->ofsx); - ps->orig->ofsy= floor(0.5 + fac*ps->pa->ofsy + (1.0-fac)*ps->orig->ofsy); - done= 1; - } - } - } - - /* copy locations to tabs */ - for(pa= sa->panels.first; pa; pa= pa->next) { - if(pa->paneltab && pa->active) { - copy_panel_offset(pa, pa->paneltab); - } - } - - /* set counter, used for sorting with newly added panels */ - sortcounter++; - for(pa= sa->panels.first; pa; pa= pa->next) { - if(pa->active) pa->sortcounter= sortcounter; - } - - /* free panelsort array */ - ps= panelsort; - for(a=0; apa); - } - MEM_freeN(panelsort); - - return done; -} - - -static void ui_animate_panels(ScrArea *sa) -{ - double time=0, ltime; - float result= 0.0, fac= 0.2; - - ltime = PIL_check_seconds_timer(); - - /* for max 1 second, interpolate positions */ - while(TRUE) { - - if( uiAlignPanelStep(sa, fac) ) { - /* warn: this re-allocs uiblocks! */ - scrarea_do_windraw(curarea); - ui_redraw_select_panel(curarea); - screen_swapbuffers(); - } - else { - addqueue(curarea->win, REDRAW,1 ); // because 'Animate' is also called as redraw - break; - } - - if(result >= 1.0) break; - - if(result==0.0) { // firsttime - time = PIL_check_seconds_timer()-ltime; - if(time > 0.5) fac= 0.7; - else if(time > 0.2) fac= 0.5; - else if(time > 0.1) fac= 0.4; - else if(time > 0.05) fac= 0.3; // 11 steps - } - - result= fac + (1.0-fac)*result; - - if(result > 0.98) { - result= 1.0; - fac= 1.0; - } - } -} - -/* only draws blocks with panels */ -void uiDrawBlocksPanels(ScrArea *sa, int re_align) -{ - uiBlock *block; - Panel *panot, *panew, *patest; - - /* scaling contents */ - block= sa->uiblocks.first; - while(block) { - if(block->panel) ui_scale_panel_block(block); - block= block->next; - } - - /* consistancy; are panels not made, whilst they have tabs */ - for(panot= sa->panels.first; panot; panot= panot->next) { - if(panot->active==0) { // not made - - for(panew= sa->panels.first; panew; panew= panew->next) { - if(panew->active) { - if(panew->paneltab==panot) { // panew is tab in notmade pa - break; - } - } - } - /* now panew can become the new parent, check all other tabs */ - if(panew) { - for(patest= sa->panels.first; patest; patest= patest->next) { - if(patest->paneltab == panot) { - patest->paneltab= panew; - } - } - panot->paneltab= panew; - panew->paneltab= NULL; - addqueue(sa->win, REDRAW, 1); // the buttons panew were not made - } - } - } - - /* re-align */ - if(re_align) uiAlignPanelStep(sa, 1.0); - - if(sa->spacetype!=SPACE_BUTS) { - SpaceLink *sl= sa->spacedata.first; - for(block= sa->uiblocks.first; block; block= block->next) { - if(block->panel && block->panel->active && block->panel->paneltab == NULL) { - float dx=0.0, dy=0.0, minx, miny, maxx, maxy, miny_panel; - - minx= sl->blockscale*block->panel->ofsx; - maxx= sl->blockscale*(block->panel->ofsx+block->panel->sizex); - miny= sl->blockscale*(block->panel->ofsy+block->panel->sizey); - maxy= sl->blockscale*(block->panel->ofsy+block->panel->sizey+PNL_HEADER); - miny_panel= sl->blockscale*(block->panel->ofsy); - - /* check to see if snapped panels have been left out in the open by resizing a window - * and if so, offset them back to where they belong */ - if (block->panel->snap) { - if (((block->panel->snap) & PNL_SNAP_RIGHT) && - (maxx < (float)sa->winx)) { - - dx = sa->winx-maxx; - block->panel->ofsx+= dx/sl->blockscale; - } - if (((block->panel->snap) & PNL_SNAP_TOP) && - (maxy < (float)sa->winy)) { - - dy = sa->winy-maxy; - block->panel->ofsy+= dy/sl->blockscale; - } - - /* reset these vars with updated panel offset distances */ - minx= sl->blockscale*block->panel->ofsx; - maxx= sl->blockscale*(block->panel->ofsx+block->panel->sizex); - miny= sl->blockscale*(block->panel->ofsy+block->panel->sizey); - maxy= sl->blockscale*(block->panel->ofsy+block->panel->sizey+PNL_HEADER); - miny_panel= sl->blockscale*(block->panel->ofsy); - } else - /* reset to no snapping */ - block->panel->snap = PNL_SNAP_NONE; - - - /* clip panels (headers) for non-butspace situations (maybe make optimized event later) */ - - /* check left and right edges */ - if (minx < PNL_SNAP_DIST) { - dx = -minx; - block->panel->snap |= PNL_SNAP_LEFT; - } - else if (maxx > ((float)sa->winx - PNL_SNAP_DIST)) { - dx= sa->winx-maxx; - block->panel->snap |= PNL_SNAP_RIGHT; - } - if( minx + dx < 0.0) dx= -minx; // when panel cant fit, put it fixed here - - /* check top and bottom edges */ - if ((miny_panel < PNL_SNAP_DIST) && (miny_panel > -PNL_SNAP_DIST)) { - dy= -miny_panel; - block->panel->snap |= PNL_SNAP_BOTTOM; - } - if(miny < PNL_SNAP_DIST) { - dy= -miny; - block->panel->snap |= PNL_SNAP_BOTTOM; - } - else if(maxy > ((float)sa->winy - PNL_SNAP_DIST)) { - dy= sa->winy-maxy; - block->panel->snap |= PNL_SNAP_TOP; - } - if( miny + dy < 0.0) dy= -miny; // when panel cant fit, put it fixed here - - - block->panel->ofsx+= dx/sl->blockscale; - block->panel->ofsy+= dy/sl->blockscale; - - /* copy locations */ - for(patest= sa->panels.first; patest; patest= patest->next) { - if(patest->paneltab==block->panel) copy_panel_offset(patest, block->panel); - } - - } - } - } - - /* draw */ - block= sa->uiblocks.first; - while(block) { - if(block->panel) uiDrawBlock(block); - block= block->next; - } - -} - - - -/* ------------ panel merging ---------------- */ - -static void check_panel_overlap(ScrArea *sa, Panel *panel) -{ - Panel *pa= sa->panels.first; - - /* also called with panel==NULL for clear */ - - while(pa) { - pa->flag &= ~PNL_OVERLAP; - if(panel && (pa != panel)) { - if(pa->paneltab==NULL && pa->active) { - float safex= 0.2, safey= 0.2; - - if( pa->flag & PNL_CLOSEDX) safex= 0.05; - else if(pa->flag & PNL_CLOSEDY) safey= 0.05; - else if( panel->flag & PNL_CLOSEDX) safex= 0.05; - else if(panel->flag & PNL_CLOSEDY) safey= 0.05; - - if( pa->ofsx > panel->ofsx- safex*panel->sizex) - if( pa->ofsx+pa->sizex < panel->ofsx+ (1.0+safex)*panel->sizex) - if( pa->ofsy > panel->ofsy- safey*panel->sizey) - if( pa->ofsy+pa->sizey < panel->ofsy+ (1.0+safey)*panel->sizey) - pa->flag |= PNL_OVERLAP; - } - } - - pa= pa->next; - } -} - -static void test_add_new_tabs(ScrArea *sa) -{ - Panel *pa, *pasel=NULL, *palap=NULL; - /* search selected and overlapped panel */ - - pa= sa->panels.first; - while(pa) { - if(pa->active) { - if(pa->flag & PNL_SELECT) pasel= pa; - if(pa->flag & PNL_OVERLAP) palap= pa; - } - pa= pa->next; - } - - if(pasel && palap==NULL) { - - /* copy locations */ - pa= sa->panels.first; - while(pa) { - if(pa->paneltab==pasel) { - copy_panel_offset(pa, pasel); - } - pa= pa->next; - } - } - - if(pasel==NULL || palap==NULL) return; - - /* the overlapped panel becomes a tab */ - palap->paneltab= pasel; - - /* the selected panel gets coords of overlapped one */ - copy_panel_offset(pasel, palap); - - /* and its tabs */ - pa= sa->panels.first; - while(pa) { - if(pa->paneltab == pasel) { - copy_panel_offset(pa, palap); - } - pa= pa->next; - } - - /* but, the overlapped panel already can have tabs too! */ - pa= sa->panels.first; - while(pa) { - if(pa->paneltab == palap) { - pa->paneltab = pasel; - } - pa= pa->next; - } -} - -/* ------------ panel drag ---------------- */ - - -static void ui_drag_panel(uiBlock *block, int doscale) -{ - Panel *panel= block->panel; - short align=0, first=1, dx=0, dy=0, dxo=0, dyo=0, mval[2], mvalo[2]; - short ofsx, ofsy, sizex, sizey; - - if(curarea->spacetype==SPACE_BUTS) { - SpaceButs *sbuts= curarea->spacedata.first; - align= sbuts->align; - } - - uiGetMouse(block->win, mvalo); - ofsx= block->panel->ofsx; - ofsy= block->panel->ofsy; - sizex= block->panel->sizex; - sizey= block->panel->sizey; - - panel->flag |= PNL_SELECT; - - /* exception handling, 3d window preview panel */ - if(block->drawextra==BIF_view3d_previewdraw) - BIF_view3d_previewrender_clear(curarea); - - while(TRUE) { - - if( !(get_mbut() & L_MOUSE) ) break; - - /* first clip for window, no dragging outside */ - getmouseco_areawin(mval); - if( mval[0]>0 && mval[0]winx && mval[1]>0 && mval[1]winy) { - uiGetMouse(mywinget(), mval); - dx= (mval[0]-mvalo[0]) & ~(PNL_GRID-1); - dy= (mval[1]-mvalo[1]) & ~(PNL_GRID-1); - } - - if(dx!=dxo || dy!=dyo || first || align) { - dxo= dx; dyo= dy; - first= 0; - - if(doscale) { - panel->sizex = MAX2(sizex+dx, UI_PANEL_MINX); - - if(sizey-dy < UI_PANEL_MINY) { - dy= -UI_PANEL_MINY+sizey; - } - panel->sizey = sizey-dy; - - panel->ofsy= ofsy+dy; - - } - else { - /* reset the panel snapping, to allow dragging away from snapped edges */ - panel->snap = PNL_SNAP_NONE; - - panel->ofsx = ofsx+dx; - panel->ofsy = ofsy+dy; - check_panel_overlap(curarea, panel); - - if(align) uiAlignPanelStep(curarea, 0.2); - } - - /* warn: this re-allocs blocks! */ - scrarea_do_windraw(curarea); - ui_redraw_select_panel(curarea); - screen_swapbuffers(); - - /* so, we find the new block */ - block= curarea->uiblocks.first; - while(block) { - if(block->panel == panel) break; - block= block->next; - } - // temporal debug - if(block==NULL) { - printf("block null while panel drag, should not happen\n"); - } - - /* restore */ - Mat4CpyMat4(UIwinmat, block->winmat); - - /* idle for align */ - if(dx==dxo && dy==dyo) PIL_sleep_ms(30); - } - /* idle for this poor code */ - else PIL_sleep_ms(30); - } - - test_add_new_tabs(curarea); // also copies locations of tabs in dragged panel - - panel->flag &= ~PNL_SELECT; - check_panel_overlap(curarea, NULL); // clears - - if(align==0) addqueue(block->win, REDRAW, 1); - else ui_animate_panels(curarea); - - /* exception handling, 3d window preview panel */ - if(block->drawextra==BIF_view3d_previewdraw) - BIF_view3d_previewrender_signal(curarea, PR_DISPRECT); - else if(strcmp(block->name, "image_panel_preview")==0) - image_preview_event(2); -} - - -static void ui_panel_untab(uiBlock *block) -{ - Panel *panel= block->panel, *pa, *panew=NULL; - short nr, mval[2], mvalo[2]; - - /* while hold mouse, check for movement, then untab */ - - uiGetMouse(block->win, mvalo); - while(TRUE) { - - if( !(get_mbut() & L_MOUSE) ) break; - uiGetMouse(mywinget(), mval); - - if( abs(mval[0]-mvalo[0]) + abs(mval[1]-mvalo[1]) > 6 ) { - /* find new parent panel */ - nr= 0; - pa= curarea->panels.first; - while(pa) { - if(pa->paneltab==panel) { - panew= pa; - nr++; - } - pa= pa->next; - } - - /* make old tabs point to panew */ - if(panew==NULL) printf("panel untab: shouldnt happen\n"); - panew->paneltab= NULL; - - pa= curarea->panels.first; - while(pa) { - if(pa->paneltab==panel) { - pa->paneltab= panew; - } - pa= pa->next; - } - - ui_drag_panel(block, 0); - break; - - } - /* idle for this poor code */ - else PIL_sleep_ms(50); - - } - -} - -/* ------------ panel events ---------------- */ - - -static void panel_clicked_tabs(uiBlock *block, int mousex) -{ - Panel *pa, *tabsel=NULL, *panel= block->panel; - int nr= 1, a, width, ofsx; - - ofsx= PNL_ICON; - if(block->panel->control & UI_PNL_CLOSE) ofsx+= PNL_ICON; - - - /* count */ - pa= curarea->panels.first; - while(pa) { - if(pa!=panel) { - if(pa->paneltab==panel) nr++; - } - pa= pa->next; - } - - if(nr==1) return; - - /* find clicked tab, mouse in panel coords */ - a= 0; - width= (int)((float)(panel->sizex - ofsx-10)/nr); - pa= curarea->panels.first; - while(pa) { - if(pa==panel || pa->paneltab==panel) { - if( (mousex > ofsx+a*width) && (mousex < ofsx+(a+1)*width) ) { - tabsel= pa; - break; - } - a++; - } - pa= pa->next; - } - - if(tabsel) { - - if(tabsel == panel) { - ui_panel_untab(block); - } - else { - /* tabsel now becomes parent for all others */ - panel->paneltab= tabsel; - tabsel->paneltab= NULL; - - pa= curarea->panels.first; - while(pa) { - if(pa->paneltab == panel) pa->paneltab = tabsel; - pa= pa->next; - } - - addqueue(curarea->win, REDRAW, 1); - - /* panels now differ size.. */ - if(curarea->spacetype==SPACE_BUTS) { - SpaceButs *sbuts= curarea->spacedata.first; - if(sbuts->align) - uiAlignPanelStep(curarea, 1.0); - } - } - } - -} - -/* disabled /deprecated now, panels minimise in place */ -#if 0 -static void stow_unstow(uiBlock *block) -{ - SpaceLink *sl= curarea->spacedata.first; - Panel *pa; - int ok=0, x, y, width; - - if(block->panel->flag & PNL_CLOSEDY) { // flag has been set how it should become! - - width= (curarea->winx-320)/sl->blockscale; - if(width<5) width= 5; - - /* find empty spot in bottom */ - for(y=4; y<100; y+= PNL_HEADER+4) { - for(x=4; xpanels.first; pa; pa=pa->next) { - if(pa!=block->panel && pa->active && pa->paneltab==NULL) { - if( abs(pa->ofsx-x)<320 ) { - if( abs(pa->ofsy+pa->sizey-y)panel->old_ofsx= block->panel->ofsx; - block->panel->old_ofsy= block->panel->ofsy; - - block->panel->ofsx= x; - block->panel->ofsy= y-block->panel->sizey; - - } - else { - block->panel->ofsx= block->panel->old_ofsx; - block->panel->ofsy= block->panel->old_ofsy; - - } - /* copy locations */ - for(pa= curarea->panels.first; pa; pa= pa->next) { - if(pa->paneltab==block->panel) copy_panel_offset(pa, block->panel); - } - -} -#endif - - -/* this function is supposed to call general window drawing too */ -/* also it supposes a block has panel, and isnt a menu */ -void ui_do_panel(uiBlock *block, uiEvent *uevent) -{ - Panel *pa; - int align= 0; - - if(curarea->spacetype==SPACE_BUTS) { - SpaceButs *sbuts= curarea->spacedata.first; - align= sbuts->align; - } - - /* mouse coordinates in panel space! */ - - if(uevent->event==LEFTMOUSE && block->panel->paneltab==NULL) { - int button= 0; - - /* check open/collapsed button */ - if(block->panel->flag & PNL_CLOSEDX) { - if(uevent->mval[1] >= block->maxy) button= 1; - } - else if(block->panel->control & UI_PNL_CLOSE) { - if(uevent->mval[0] <= block->minx+PNL_ICON-2) button= 2; - else if(uevent->mval[0] <= block->minx+2*PNL_ICON+2) button= 1; - } - else if(uevent->mval[0] <= block->minx+PNL_ICON+2) { - button= 1; - } - - if(button) { - - if(button==2) { // close - rem_blockhandler(curarea, block->handler); - addqueue(curarea->win, REDRAW, 1); - } - else { // collapse - - if(block->panel->flag & PNL_CLOSED) { - block->panel->flag &= ~PNL_CLOSED; - /* snap back up so full panel aligns with screen edge */ - if (block->panel->snap & PNL_SNAP_BOTTOM) - block->panel->ofsy= 0; - } - else if(align==BUT_HORIZONTAL) block->panel->flag |= PNL_CLOSEDX; - else { - /* snap down to bottom screen edge*/ - block->panel->flag |= PNL_CLOSEDY; - if (block->panel->snap & PNL_SNAP_BOTTOM) - block->panel->ofsy= -block->panel->sizey; - } - - for(pa= curarea->panels.first; pa; pa= pa->next) { - if(pa->paneltab==block->panel) { - if(block->panel->flag & PNL_CLOSED) pa->flag |= PNL_CLOSED; - else pa->flag &= ~PNL_CLOSED; - } - } - } - if(align==0) addqueue(block->win, REDRAW, 1); - else ui_animate_panels(curarea); - - } - else if(block->panel->flag & PNL_CLOSED) { - ui_drag_panel(block, 0); - } - /* check if clicked in tabbed area */ - else if(uevent->mval[0] < block->maxx-PNL_ICON-3 && panel_has_tabs(block->panel)) { - panel_clicked_tabs(block, uevent->mval[0]); - } - else { - ui_drag_panel(block, 0); - } - } -} - -/* panel with scaling widget */ -void ui_scale_panel(uiBlock *block) -{ - if(block->panel->flag & PNL_CLOSED) - return; - - ui_drag_panel(block, 1); -} - - diff --git a/source/blender/src/keyval.c b/source/blender/src/keyval.c deleted file mode 100644 index 79445fa7aa2..00000000000 --- a/source/blender/src/keyval.c +++ /dev/null @@ -1,354 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BIF_keyval.h" -#include "blendef.h" -#include "mydevice.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - - -char *key_event_to_string(unsigned short event) -{ - - switch(event) { - case AKEY: - return "A"; - break; - case BKEY: - return "B"; - break; - case CKEY: - return "C"; - break; - case DKEY: - return "D"; - break; - case EKEY: - return "E"; - break; - case FKEY: - return "F"; - break; - case GKEY: - return "G"; - break; - case HKEY: - return "H"; - break; - case IKEY: - return "I"; - break; - case JKEY: - return "J"; - break; - case KKEY: - return "K"; - break; - case LKEY: - return "L"; - break; - case MKEY: - return "M"; - break; - case NKEY: - return "N"; - break; - case OKEY: - return "O"; - break; - case PKEY: - return "P"; - break; - case QKEY: - return "Q"; - break; - case RKEY: - return "R"; - break; - case SKEY: - return "S"; - break; - case TKEY: - return "T"; - break; - case UKEY: - return "U"; - break; - case VKEY: - return "V"; - break; - case WKEY: - return "W"; - break; - case XKEY: - return "X"; - break; - case YKEY: - return "Y"; - break; - case ZKEY: - return "Z"; - break; - - case ZEROKEY: - return "Zero"; - break; - case ONEKEY: - return "One"; - break; - case TWOKEY: - return "Two"; - break; - case THREEKEY: - return "Three"; - break; - case FOURKEY: - return "Four"; - break; - case FIVEKEY: - return "Five"; - break; - case SIXKEY: - return "Six"; - break; - case SEVENKEY: - return "Seven"; - break; - case EIGHTKEY: - return "Eight"; - break; - case NINEKEY: - return "Nine"; - break; - - case LEFTCTRLKEY: - return "Leftctrl"; - break; - case LEFTALTKEY: - return "Leftalt"; - break; - case RIGHTALTKEY: - return "Rightalt"; - break; - case RIGHTCTRLKEY: - return "Rightctrl"; - break; - case RIGHTSHIFTKEY: - return "Rightshift"; - break; - case LEFTSHIFTKEY: - return "Leftshift"; - break; - - case ESCKEY: - return "Esc"; - break; - case TABKEY: - return "Tab"; - break; - case RETKEY: - return "Ret"; - break; - case SPACEKEY: - return "Space"; - break; - case LINEFEEDKEY: - return "Linefeed"; - break; - case BACKSPACEKEY: - return "Backspace"; - break; - case DELKEY: - return "Del"; - break; - case SEMICOLONKEY: - return "Semicolon"; - break; - case PERIODKEY: - return "Period"; - break; - case COMMAKEY: - return "Comma"; - break; - case QUOTEKEY: - return "Quote"; - break; - case ACCENTGRAVEKEY: - return "Accentgrave"; - break; - case MINUSKEY: - return "Minus"; - break; - case SLASHKEY: - return "Slash"; - break; - case BACKSLASHKEY: - return "Backslash"; - break; - case EQUALKEY: - return "Equal"; - break; - case LEFTBRACKETKEY: - return "Leftbracket"; - break; - case RIGHTBRACKETKEY: - return "Rightbracket"; - break; - - case LEFTARROWKEY: - return "Leftarrow"; - break; - case DOWNARROWKEY: - return "Downarrow"; - break; - case RIGHTARROWKEY: - return "Rightarrow"; - break; - case UPARROWKEY: - return "Uparrow"; - break; - - case PAD2: - return "Pad2"; - break; - case PAD4: - return "Pad4"; - break; - case PAD6: - return "Pad6"; - break; - case PAD8: - return "Pad8"; - break; - case PAD1: - return "Pad1"; - break; - case PAD3: - return "Pad3"; - break; - case PAD5: - return "Pad5"; - break; - case PAD7: - return "Pad7"; - break; - case PAD9: - return "Pad9"; - break; - - case PADPERIOD: - return "Padperiod"; - break; - case PADSLASHKEY: - return "Padslash"; - break; - case PADASTERKEY: - return "Padaster"; - break; - - case PAD0: - return "Pad0"; - break; - case PADMINUS: - return "Padminus"; - break; - case PADENTER: - return "Padenter"; - break; - case PADPLUSKEY: - return "Padplus"; - break; - - case F1KEY: - return "F1"; - break; - case F2KEY: - return "F2"; - break; - case F3KEY: - return "F3"; - break; - case F4KEY: - return "F4"; - break; - case F5KEY: - return "F5"; - break; - case F6KEY: - return "F6"; - break; - case F7KEY: - return "F7"; - break; - case F8KEY: - return "F8"; - break; - case F9KEY: - return "F9"; - break; - case F10KEY: - return "F10"; - break; - case F11KEY: - return "F11"; - break; - case F12KEY: - return "F12"; - break; - - case PAUSEKEY: - return "Pause"; - break; - case INSERTKEY: - return "Insert"; - break; - case HOMEKEY: - return "Home"; - break; - case PAGEUPKEY: - return "Pageup"; - break; - case PAGEDOWNKEY: - return "Pagedown"; - break; - case ENDKEY: - return "End"; - break; - } - - return ""; -} diff --git a/source/blender/src/language.c b/source/blender/src/language.c deleted file mode 100644 index 5eb4bf3dc61..00000000000 --- a/source/blender/src/language.c +++ /dev/null @@ -1,453 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is written by Rob Haarsma (phase) - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -#include -#include - -#include "DNA_listBase.h" -#include "DNA_userdef_types.h" -#include "DNA_vec_types.h" - -#include "BKE_global.h" /* G */ -#include "BKE_utildefines.h" - -#include "BLI_blenlib.h" -#include "BLI_linklist.h" /* linknode */ - -#include "BIF_gl.h" -#include "BIF_language.h" -#include "BIF_space.h" /* allqueue() */ -#include "BIF_toolbox.h" /* error() */ -#include "datatoc.h" /* std font */ - -#include "MEM_guardedalloc.h" /* vprintf, etc ??? */ - -#include "mydevice.h" /* REDRAWALL */ - -#include "BMF_Api.h" - -#ifdef WITH_ICONV -#include "iconv.h" - -void string_to_utf8(char *original, char *utf_8, char *code) -{ - size_t inbytesleft=strlen(original); - size_t outbytesleft=512; - size_t rv=0; - iconv_t cd; - - cd=iconv_open("UTF-8", code); - - if (cd == (iconv_t)(-1)) { - printf("iconv_open Error"); - *utf_8='\0'; - return ; - } - rv=iconv(cd, &original, &inbytesleft, &utf_8, &outbytesleft); - if (rv == (size_t) -1) { - printf("iconv Error\n"); - return ; - } - *utf_8 = '\0'; - iconv_close(cd); -} -#endif // WITH_ICONV - -#ifdef INTERNATIONAL -#include "FTF_Api.h" - -static struct LANGMenuEntry *langmenu= 0; -static int tot_lang = 0; - -#endif // INTERNATIONAL - -void BIF_RasterPos(float x, float y) -{ -#ifdef INTERNATIONAL - FTF_SetPosition(x, y); -#endif // INTERNATIONAL -} - -void BIF_SetScale(float aspect) -{ -#ifdef INTERNATIONAL - FTF_SetScale(aspect); -#endif // INTERNATIONAL -} - -void refresh_interface_font(void) -{ -#ifdef INTERNATIONAL - if(U.transopts & USER_DOTRANSLATE) - start_interface_font(); - else - G.ui_international = FALSE; -#else // INTERNATIONAL - G.ui_international = FALSE; -#endif -} - -int BIF_DrawString(BMF_Font* font, char *str, int translate) -{ - -#ifdef INTERNATIONAL - if(G.ui_international == TRUE) { - if(translate) - { -#ifdef WITH_ICONV - if(translate & CONVERT_TO_UTF8) { - char utf_8[512]; - - struct LANGMenuEntry *lme; - lme = find_language(U.language); - - if (lme !=NULL) { - if (!strcmp(lme->code, "ja_JP")) - string_to_utf8(str, utf_8, "Shift_JIS"); /* Japanese */ - else if (!strcmp(lme->code, "zh_CN")) - string_to_utf8(str, utf_8, "GB2312"); /* Chinese */ - } - - return FTF_DrawString(utf_8, FTF_INPUT_UTF8); - } - else -#endif // WITH_ICONV - return FTF_DrawString(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - } - else - return FTF_DrawString(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); - } else { - return BMF_DrawString(font, str); - } -#else // INTERNATIONAL - return BMF_DrawString(font, str); -#endif - -} - - -float BIF_GetStringWidth(BMF_Font* font, char *str, int translate) -{ - float rt; - -#ifdef INTERNATIONAL - if(G.ui_international == TRUE) - if(translate && (U.transopts & USER_TR_BUTTONS)) - rt= FTF_GetStringWidth(str, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - else - rt= FTF_GetStringWidth(str, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); - else - rt= BMF_GetStringWidth(font, str); -#else - rt= BMF_GetStringWidth(font, str); -#endif - - return rt; -} - -void BIF_GetBoundingBox(struct BMF_Font* font, char* str, int translate, rctf *bbox){ -#ifdef INTERNATIONAL - float dummy; - if(G.ui_international == TRUE) - if(translate && (U.transopts & USER_TR_BUTTONS)) - FTF_GetBoundingBox(str, &bbox->xmin, &bbox->ymin, &dummy, &bbox->xmax, &bbox->ymax, &dummy, FTF_USE_GETTEXT | FTF_INPUT_UTF8); - else - FTF_GetBoundingBox(str, &bbox->xmin, &bbox->ymin, &dummy, &bbox->xmax, &bbox->ymax, &dummy, FTF_NO_TRANSCONV | FTF_INPUT_UTF8); - else - BMF_GetStringBoundingBox(font, str, &bbox->xmin, &bbox->ymin, &bbox->xmax, &bbox->ymax); -#else - BMF_GetStringBoundingBox(font, str, &bbox->xmin, &bbox->ymin, &bbox->xmax, &bbox->ymax); -#endif -} - - -#ifdef INTERNATIONAL - -char *fontsize_pup(void) -{ - static char string[1024]; - char formatstring[1024]; - - strcpy(formatstring, "Choose Font Size: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d"); - - sprintf(string, formatstring, - "Font Size: 8", 8, - "Font Size: 9", 9, - "Font Size: 10", 10, - "Font Size: 11", 11, - "Font Size: 12", 12, - "Font Size: 13", 13, - "Font Size: 14", 14, - "Font Size: 15", 15, - "Font Size: 16", 16 - ); - - return (string); -} - - -char *language_pup(void) -{ - struct LANGMenuEntry *lme = langmenu; - static char string[1024]; - static char tmp[1024]; - - if(tot_lang == 0) - sprintf(string, "Choose Language: %%t|Language: English %%x0"); - else { - sprintf(string, "Choose Language: %%t"); - while(lme) { - sprintf(tmp, "|Language: %s %%x%d", lme->language, lme->id); - strcat(string, tmp); - lme= lme->next; - } - } - - return string; -} - - -struct LANGMenuEntry *find_language(short langid) -{ - struct LANGMenuEntry *lme = langmenu; - - while(lme) { - if(lme->id == langid) - return lme; - - lme=lme->next; - } - return NULL; -} - - -void lang_setlanguage(void) -{ - struct LANGMenuEntry *lme; - - lme = find_language(U.language); - if(lme) FTF_SetLanguage(lme->code); - else FTF_SetLanguage("en_US"); -} - -/* called from fileselector */ -void set_interface_font(char *str) -{ - - /* this test needed because fileselect callback can happen after disable AA fonts */ - if(U.transopts & USER_DOTRANSLATE) { - if(FTF_SetFont((unsigned char*)str, 0, U.fontsize)) { - lang_setlanguage(); - - if(strlen(str) < FILE_MAXDIR) strcpy(U.fontname, str); - G.ui_international = TRUE; - } - else { - U.fontname[0]= 0; - FTF_SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize); - G.ui_international = TRUE; // this case will switch to standard font - okee("Invalid font selection - reverting to built-in font."); - } - allqueue(REDRAWALL, 0); - } -} - - -void start_interface_font(void) -{ - int result = 0; - - if(U.transopts & USER_USETEXTUREFONT) - FTF_SetMode(FTF_TEXTUREFONT); - else - FTF_SetMode(FTF_PIXMAPFONT); - - if(U.fontsize && U.fontname[0] ) { // we have saved user settings + fontpath - - // try loading font from U.fontname = full path to font in usersettings - result = FTF_SetFont((unsigned char*)U.fontname, 0, U.fontsize); - } - else if(U.fontsize) { // user settings, default - result = FTF_SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize); - } - - if(result==0) { // use default - U.language= 0; - U.fontsize= 11; - U.encoding= 0; - U.fontname[0]= 0; - result = FTF_SetFont((unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size, U.fontsize); - } - - if(result) { - - lang_setlanguage(); - - G.ui_international = TRUE; - } - else { - printf("no font found for international support\n"); - G.ui_international = FALSE; - U.transopts &= ~USER_DOTRANSLATE; - U.fontsize = 0; - } - - allqueue(REDRAWALL, 0); -} - - -static char *first_dpointchar(char *string) -{ - char *dpointchar; - - dpointchar= strchr(string, ':'); - - return dpointchar; -} - - -static void splitlangline(char *line, struct LANGMenuEntry *lme) -{ - char *dpointchar= first_dpointchar(line); - - if (dpointchar) { - lme->code= BLI_strdup(dpointchar+1); - *(dpointchar)=0; - lme->language= BLI_strdup(line); - } else { - error("Invalid language file"); - } -} - - -static void puplang_insert_entry(char *line) -{ - struct LANGMenuEntry *lme, *prev; - int sorted = 0; - - prev= NULL; - lme= langmenu; - - for (; lme; prev= lme, lme= lme->next) { - if (lme->line) { - if (BLI_streq(line, lme->line)) { - return; - } else if (sorted && strcmp(line, lme->line)<0) { - break; - } - } - } - - lme= MEM_mallocN(sizeof(*lme), "lme"); - lme->line = BLI_strdup(line); - splitlangline(line, lme); - lme->id = tot_lang; - tot_lang++; - - if (prev) { - lme->next= prev->next; - prev->next= lme; - } else { - lme->next= langmenu; - langmenu= lme; - } -} - - -int read_languagefile(void) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - LinkNode *l, *lines; - - /* .Blanguages, http://www.blender3d.org/cms/Installation_Policy.352.0.html*/ -#if defined (__APPLE__) || (WIN32) - BLI_make_file_string("/", name, BLI_gethome(), ".Blanguages"); -#else - BLI_make_file_string("/", name, BLI_gethome(), ".blender/.Blanguages"); -#endif - - lines= BLI_read_file_as_lines(name); - - if(lines == NULL) { - /* If not found in home, try current dir - * (Resources folder of app bundle on OS X) */ -#if defined (__APPLE__) - char *bundlePath = BLI_getbundle(); - strcpy(name, bundlePath); - strcat(name, "/Contents/Resources/.Blanguages"); -#else - /* Check the CWD. Takes care of the case where users - * unpack blender tarball; cd blender-dir; ./blender */ - strcpy(name, ".blender/.Blanguages"); -#endif - lines= BLI_read_file_as_lines(name); - - if(lines == NULL) { - /* If not found in .blender, try current dir */ - strcpy(name, ".Blanguages"); - lines= BLI_read_file_as_lines(name); - if(lines == NULL) { - if(G.f & G_DEBUG) printf("File .Blanguages not found\n"); - return 0; - } - } - } - - for (l= lines; l; l= l->next) { - char *line= l->link; - - if (!BLI_streq(line, "")) { - puplang_insert_entry(line); - } - } - - BLI_free_file_lines(lines); - - return 1; -} - - -void free_languagemenu(void) -{ - struct LANGMenuEntry *lme= langmenu; - - while (lme) { - struct LANGMenuEntry *n= lme->next; - - if (lme->line) MEM_freeN(lme->line); - if (lme->language) MEM_freeN(lme->language); - if (lme->code) MEM_freeN(lme->code); - MEM_freeN(lme); - - lme= n; - } -} - -#endif /* INTERNATIONAL */ diff --git a/source/blender/src/lorem.c b/source/blender/src/lorem.c deleted file mode 100644 index 6b3a00f2cc3..00000000000 --- a/source/blender/src/lorem.c +++ /dev/null @@ -1,516 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include "BIF_editfont.h" - -char *BIF_lorem = -"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. " -"Aliquam tristique interdum sem. " -"Nullam pretium, tortor non euismod varius, nulla odio sodales nulla, at bibendum lorem metus sed nulla. " -"Vestibulum in lectus at pede blandit viverra. " -"Fusce scelerisque ipsum nec enim. " -"Fusce euismod nunc id enim. " -"In venenatis cursus arcu. " -"Aenean quis dui. " -"Maecenas laoreet. " -"Nulla tempor, arcu pulvinar pretium suscipit, tortor wisi dapibus libero, id ornare felis ipsum suscipit purus. " -"Maecenas ipsum. " -"Morbi cursus. " -"Vestibulum diam purus, commodo et, convallis eu, posuere at, ligula. " -"Nulla aliquam aliquet lorem. " -"Nunc et mauris hendrerit est bibendum suscipit. " -"Donec pellentesque libero eu nisl. " -"Pellentesque eget libero. " -"Donec tempus ipsum sed quam. " -"Sed blandit nunc quis enim. " -"Quisque lectus diam, adipiscing hendrerit, placerat non, pulvinar id, felis. " -"In congue magna sit amet urna. " -"Nunc non augue sed nisl dictum laoreet. " -"Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. " -"In venenatis dapibus massa. " -"Nulla hendrerit sapien et quam. " -"Nunc ac magna lobortis tellus tincidunt posuere. " -"Cras augue mauris, mattis lobortis, fermentum at, semper ac, tellus. " -"Cras vitae ligula sit amet sem posuere iaculis. " -"Aliquam condimentum eleifend felis. " -"Ut sit amet sapien. " -"Suspendisse potenti. " -"Mauris urna. " -"Ut eu enim eu ante porta vestibulum. " -"Aenean scelerisque est ac felis. " -"Suspendisse auctor. " -"Nunc pellentesque. " -"Morbi laoreet ante et nibh. " -"Donec feugiat arcu eget enim. " -"Morbi vehicula tortor ac ipsum. " -"Quisque lacus arcu, elementum ac, faucibus vel, posuere id, est. " -"Proin commodo gravida sem. " -"Vivamus tincidunt vehicula libero. " -"Phasellus wisi. " -"Maecenas pretium tellus eu sapien. " -"Nunc sit amet nunc. " -"In hac habitasse platea dictumst. " -"Aenean dictum neque sed tortor. " -"Donec et erat. " -"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed justo turpis, scelerisque ut, mattis sit amet, ornare rutrum, massa. " -"Vestibulum bibendum enim sit amet velit. " -"Vivamus tellus ipsum, luctus ut, consectetuer vitae, dignissim non, ligula. " -"Phasellus lacinia wisi at est. " -"Donec elit wisi, commodo non, placerat in, convallis id, elit. " -"Nunc dolor dolor, vestibulum id, bibendum vitae, lacinia id, erat. " -"Cras sit amet eros. " -"Suspendisse suscipit lobortis lectus. " -"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. " -"Cras orci. " -"Praesent massa urna, lobortis semper, auctor a, pretium vitae, tellus. " -"Curabitur at purus. " -"Morbi tortor quam, imperdiet venenatis, egestas a, cursus eu, est. " -"Nunc interdum lectus sit amet libero. " -"Quisque dignissim placerat ligula. " -"Nunc porttitor posuere arcu. " -"Mauris faucibus quam at massa. " -"Vivamus sodales aliquet mauris. " -"In id ante. " -"Pellentesque varius ipsum in arcu. " -"Fusce mauris lacus, tristique ac, lobortis quis, lobortis luctus, pede. " -"Sed wisi. " -"Vestibulum mattis. " -"Maecenas hendrerit sem nec purus. " -"Proin id quam. " -"Cras nec mauris. " -"Integer orci. " -"Nullam dui sem, molestie sed, egestas quis, cursus in, magna. " -"Mauris neque lacus, consectetuer nec, sagittis eu, porttitor eget, dui. " -"Fusce consectetuer. " -"Donec nec tellus quis leo lobortis ullamcorper. " -"Etiam metus urna, aliquet pretium, ultrices eu, cursus ut, turpis. " -"Morbi bibendum vehicula lectus. " -"Sed non ante vitae arcu pellentesque tempor. " -"Fusce sed ligula in sem tempor imperdiet. " -"Aliquam vel est. " -"Phasellus sollicitudin sollicitudin nibh. " -"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. " -"Sed vel leo nec eros blandit imperdiet. " -"Nulla facilisi. " -"Suspendisse lobortis, dui ut fringilla hendrerit, justo purus ullamcorper ligula, ultricies ultrices dolor enim in libero. " -"Sed elementum, pede eget porta convallis, dui nulla dignissim pede, eget vehicula odio ante at sem. " -"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. " -"Sed ullamcorper tincidunt ipsum. " -"Fusce risus nibh, accumsan sit amet, tempus eget, tristique ac, neque. " -"Sed quis lorem ut tortor facilisis fermentum. " -"Fusce pulvinar quam sit amet ipsum. " -"Morbi ac elit quis tellus malesuada blandit. " -"Maecenas suscipit sollicitudin sem. " -"Nam sed eros vel lacus lobortis congue. " -"Proin interdum nunc lobortis orci. " -"Donec egestas enim eu odio. " -"Vestibulum id metus. " -"Pellentesque auctor, sem varius luctus tempus, libero magna cursus neque, et porttitor diam diam quis purus. " -"Vestibulum sit amet dolor. " -"Nulla in magna. " -"Cras id diam at lectus faucibus placerat. " -"Nunc porta posuere sapien. " -"Etiam scelerisque. " -"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. " -"Aliquam pellentesque mi sed tortor. " -"Maecenas eleifend diam non urna. " -"Donec luctus pharetra tellus. " -"Proin ac ipsum eget libero bibendum volutpat. " -"Cras id tellus. " -"Nulla non risus. " -"In dolor. " -"Fusce scelerisque quam in massa ultrices porta. " -"Morbi ut dolor eu massa egestas condimentum. " -"Mauris vulputate. " -"In hac habitasse platea dictumst. " -"Suspendisse potenti. " -"Mauris vehicula leo in tortor. " -"Mauris vel erat a urna laoreet semper. " -"Pellentesque ut metus ac tellus commodo eleifend. " -"Suspendisse quis urna. " -"Curabitur lacinia dignissim dui. " -"Nam nec ante. " -"In id enim. " -"Aenean mattis enim. " -"In ut neque porttitor risus hendrerit tincidunt. " -"Suspendisse potenti. " -"Ut vestibulum lectus vitae tortor. " -"Duis velit. " -"Nulla facilisi. " -"Integer sit amet urna. " -"Cras varius tortor in pede. " -"Sed facilisis. " -"Praesent lacinia libero nec nibh. " -"Donec aliquam risus non nisl. " -"Nam a nunc et felis tempor feugiat. " -"Nunc metus. " -"Vestibulum euismod, metus in semper laoreet, urna ipsum pharetra lorem, sed ultricies magna lorem sit amet wisi. " -"Sed wisi. " -"Nullam facilisis elit sed nisl. " -"Phasellus mattis leo nec massa. " -"Aenean malesuada. " -"Cras wisi erat, lobortis nec, cursus eget, lobortis at, libero. " -"In massa nisl, rutrum non, cursus nec, faucibus sed, lacus. " -"Pellentesque malesuada. " -"Cras euismod, neque ac suscipit tempus, velit lorem luctus elit, dapibus rhoncus wisi est ut sem. " -"Proin vulputate enim in eros elementum accumsan. " -"Ut lorem nisl, hendrerit et, interdum nec, lacinia in, dolor. " -"Duis nec quam. " -"Praesent velit felis, posuere id, luctus quis, laoreet ut, ipsum. " -"Praesent eget arcu. " -"Mauris massa felis, ornare non, ultrices id, tristique in, elit. " -"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. " -"Phasellus vulputate, mi ac bibendum facilisis, libero enim suscipit leo, non nonummy pede diam eget nibh. " -"Sed tempus. " -"Aenean interdum suscipit dui. " -"Aliquam erat volutpat. " -"Ut malesuada. " -"Nam commodo, nulla ut fringilla rutrum, orci elit viverra diam, vitae mollis odio odio et purus. " -"Aliquam erat volutpat. " -"Sed aliquet lobortis ipsum. " -"In ut est. " -"Etiam condimentum. " -"Vestibulum pellentesque tortor pulvinar lacus. " -"Aenean orci. " -"Suspendisse lacus nulla, nonummy a, dictum vitae, egestas quis, eros. " -"Donec auctor gravida nisl. " -"Cras ac est rutrum augue pulvinar ornare. " -"Phasellus mauris nibh, vulputate in, rhoncus imperdiet, dapibus eget, lacus. " -"Nam nunc mauris, suscipit at, ultricies a, facilisis at, tellus. " -"Nam accumsan mollis libero. " -"Vivamus condimentum mattis est. " -"Donec lacus. " -"Nullam ac sapien id massa lobortis molestie. " -"Pellentesque elementum. " -"Proin ut purus. " -"Integer et sapien quis turpis commodo mollis. " -"Nulla consequat. " -"Proin a wisi ut tellus blandit elementum. " -"Aliquam nulla lorem, bibendum ac, malesuada vel, elementum et, metus. " -"Phasellus egestas nibh et ligula. " -"Vivamus diam odio, lacinia quis, malesuada quis, sollicitudin ut, eros. " -"Phasellus aliquet lorem ac ipsum. " -"Sed cursus tellus ac orci. " -"Phasellus at nulla. " -"Donec porta sodales ante. " -"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. " -"Sed id lectus at massa ullamcorper tristique. " -"Suspendisse porttitor lacus. " -"In hac habitasse platea dictumst. " -"Nunc non turpis. " -"Sed sagittis. " -"Morbi laoreet scelerisque dui. " -"Nam arcu tellus, tempor vitae, vestibulum et, imperdiet ut, velit. " -"In sit amet augue a arcu volutpat suscipit. " -"Donec dictum ultrices lectus. " -"Phasellus a purus et orci dictum lacinia. " -"Ut leo. " -"Cras semper, lorem sit amet tincidunt congue, justo eros varius pede, in bibendum turpis lectus non eros. " -"Phasellus quam. " -"Suspendisse mattis sollicitudin magna. " -"Aenean facilisis diam vel nisl nonummy condimentum. " -"Suspendisse vel dolor. " -"Vestibulum nonummy. " -"Mauris imperdiet semper ante. " -"Maecenas vulputate eros. " -"Vestibulum ac dolor. " -"Fusce risus metus, aliquet eget, facilisis et, feugiat vel, orci. " -"Ut at nunc id ante sodales vulputate. " -"Duis tristique mattis ante. " -"Vestibulum neque mauris, laoreet id, congue interdum, aliquet ut, diam. " -"Nulla volutpat blandit magna. " -"Donec accumsan congue diam. " -"Etiam vel dui eget nisl tempor varius. " -"Cras dictum massa sed enim. " -"Cras urna tortor, fringilla ac, ullamcorper in, euismod vel, arcu. " -"Morbi posuere luctus augue. " -"Aliquam dui dui, adipiscing in, lobortis eu, luctus eu, nulla. " -"Cras velit pede, ullamcorper sit amet, feugiat in, auctor vitae, ante. " -"Suspendisse dictum fringilla mauris. " -"In a nibh. " -"Donec ac ligula. " -"In quam. " -"Praesent vitae urna ultricies sem aliquam placerat. " -"Aliquam erat volutpat. " -"Nam est. " -"Donec faucibus sodales metus. " -"Ut congue. " -"Donec arcu tellus, pharetra ac, vulputate ac, mollis sed, lectus. " -"Nulla facilisi. " -"Nullam volutpat nunc et felis. " -"Sed pede odio, tincidunt in, volutpat malesuada, feugiat gravida, nulla. " -"Nulla aliquam pede vitae arcu. " -"Proin velit elit, nonummy sit amet, elementum vitae, varius vitae, dolor. " -"Donec rutrum ipsum eu mi. " -"Aliquam et sem. " -"In adipiscing rhoncus velit. " -"Nam viverra scelerisque arcu. " -"Aliquam sem. " -"Sed tincidunt nulla quis massa. " -"Mauris faucibus tempus nunc. " -"Phasellus condimentum. " -"Curabitur aliquet iaculis sapien. " -"Nunc rhoncus, odio vitae bibendum dignissim, tellus libero commodo ipsum, ut sollicitudin nisl nisl vel justo. " -"Nulla facilisi. " -"Praesent blandit enim ut justo. " -"Proin elementum, elit eget accumsan pulvinar, orci quam auctor neque, sed convallis diam purus vel felis. " -"Sed orci leo, eleifend vel, blandit non, semper eu, purus. " -"Proin bibendum, libero ac consectetuer commodo, eros sapien blandit nisl, eu eleifend nibh nibh vel lectus. " -"Vivamus placerat. " -"Integer odio dolor, pharetra non, sodales id, viverra eget, diam. " -"Nunc mauris magna, egestas quis, feugiat id, fermentum viverra, mi. " -"Aenean suscipit nisl non nunc. " -"Proin quis lectus ac tellus nonummy commodo. " -"Nunc eget diam ac elit vestibulum auctor. " -"Etiam vulputate, odio sed lacinia consequat, justo mi vulputate purus, sit amet euismod libero metus sed tortor. " -"Maecenas ac elit sed lorem vulputate gravida. " -"Proin lectus eros, ullamcorper id, volutpat quis, condimentum tincidunt, sapien. " -"Sed et massa eget lorem aliquet tempus. " -"Duis porttitor nisl non risus. " -"Nam id quam. " -"Nullam est. " -"Proin orci diam, posuere et, pharetra commodo, dictum vel, enim. " -"Proin eget erat. " -"Donec nisl. " -"Maecenas auctor velit ut pede. " -"Nunc vitae lectus nec libero tincidunt hendrerit. " -"Quisque varius, erat ultrices ultrices euismod, purus lacus dictum eros, at condimentum enim dui nec magna. " -"Morbi diam. " -"Phasellus sed est. " -"Phasellus nec libero in arcu fringilla sollicitudin. " -"In rutrum nisl at arcu. " -"Nulla facilisi. " -"Mauris dignissim. " -"Etiam est mauris, pharetra sed, viverra et, tincidunt sed, neque. " -"Ut at lectus id nibh luctus ornare. " -"Mauris varius porttitor risus. " -"Ut vulputate aliquet risus. " -"Vestibulum luctus neque sit amet nunc. " -"Duis fermentum nibh. " -"Pellentesque dapibus. " -"Proin eros libero, aliquam non, condimentum a, sodales ut, turpis. " -"Integer accumsan mi sed lorem. " -"Vestibulum pellentesque sodales nisl. " -"Nulla eu justo quis dui pretium rhoncus. " -"Praesent viverra commodo mi. " -"Maecenas dolor libero, viverra a, elementum vitae, aliquet vitae, dui. " -"Mauris convallis lectus et mi. " -"Mauris sagittis. " -"Sed arcu. " -"Pellentesque auctor. " -"Donec pellentesque purus non tellus. " -"Ut leo wisi, ultrices sit amet, ultrices eu, gravida ac, libero. " -"Mauris fermentum dapibus diam. " -"Integer quis lacus dapibus odio pellentesque varius. " -"Fusce pede quam, vehicula ut, pulvinar et, tincidunt sed, felis. " -"Curabitur eros enim, vulputate sed, aliquam ac, euismod ac, erat. " -"Ut dignissim, lacus a interdum iaculis, enim orci posuere nunc, nec ultricies lectus risus in odio. " -"Etiam et massa id dui commodo vehicula. " -"Nunc blandit tortor quis dui. " -"Quisque nisl. " -"Sed venenatis blandit ligula. " -"Fusce viverra imperdiet magna. " -"Donec eget nunc quis est pharetra lobortis. " -"Vestibulum quis lectus. " -"Mauris vel orci lobortis nunc fermentum bibendum. " -"Pellentesque eget leo. " -"Morbi vel urna sit amet erat fermentum facilisis. " -"Sed vulputate, libero et sollicitudin congue, wisi lectus sodales dolor, eget molestie magna orci vel tellus. " -"Sed tempor ante et enim. " -"Mauris elit. " -"Curabitur ullamcorper vehicula massa. " -"Sed viverra. " -"Duis nulla. " -"Nam bibendum. " -"Nam tortor lorem, ullamcorper vitae, dictum sed, posuere eu, justo. " -"Aliquam adipiscing arcu vitae turpis. " -"Donec malesuada posuere libero. " -"Ut sed tellus. " -"Fusce sed nunc eget nisl dapibus malesuada. " -"Suspendisse potenti. " -"Integer tristique libero et metus. " -"Vivamus posuere. " -"Maecenas non sem non quam fermentum blandit. " -"Duis risus tellus, rutrum vitae, imperdiet nec, malesuada nec, ipsum. " -"Nunc quam dolor, luctus eget, placerat non, rhoncus at, tellus. " -"Duis pede lectus, mattis adipiscing, tempor ut, porta at, mi. " -"Pellentesque risus nulla, sodales sed, interdum id, nonummy vitae, ligula. " -"Morbi pulvinar pede ut massa. " -"Nunc risus mauris, tincidunt et, faucibus eu, suscipit vel, orci. " -"In faucibus felis in arcu. " -"Nulla sit amet elit. " -"Nulla erat sapien, sagittis eget, dignissim eget, viverra eu, felis. " -"Nam ac ipsum. " -"Suspendisse vulputate turpis vel sem lacinia ullamcorper. " -"Mauris ornare ipsum sed ligula. " -"Duis facilisis neque quis orci. " -"Nullam et erat et orci lacinia pellentesque. " -"Donec ac ipsum. " -"Duis molestie ipsum ac arcu. " -"Aenean congue accumsan ante. " -"Integer bibendum, leo ut ornare aliquam, nunc erat condimentum arcu, ut pulvinar mi augue et nulla. " -"Quisque lacinia aliquet wisi. " -"Vivamus nec dui. " -"Etiam wisi leo, euismod vitae, vulputate a, dictum vitae, quam. " -"Quisque quis tortor. " -"Etiam interdum. " -"In massa erat, porttitor sed, tincidunt vel, vehicula fringilla, augue. " -"Nulla vel urna. " -"In libero mi, pretium sed, mattis tempus, sagittis sed, massa. " -"Suspendisse quam wisi, fermentum quis, sagittis at, consequat eget, odio. " -"Nullam imperdiet, purus quis aliquam cursus, turpis odio egestas justo, placerat gravida turpis wisi vel tortor. " -"Nunc ultricies porta purus. " -"Proin elementum erat ac orci. " -"Ut vel magna nec mi feugiat tincidunt. " -"Ut ligula. " -"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec et magna in diam porta nonummy. " -"Maecenas ut sem in turpis fermentum viverra. " -"Suspendisse at orci. " -"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. " -"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque rutrum eleifend justo. " -"Nullam vitae pede. " -"Donec condimentum nibh et odio. " -"Sed et metus. " -"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. " -"Nam tempus. " -"Sed ac wisi. " -"In hac habitasse platea dictumst. " -"Sed sed wisi. " -"Ut facilisis tellus non ligula. " -"Integer metus. " -"In lacinia dui. " -"Curabitur ornare. " -"Mauris vel urna. " -"Nam consectetuer dignissim urna. " -"Nunc elementum porttitor erat. " -"Sed blandit, risus non commodo nonummy, ligula erat fermentum nibh, eu facilisis ante neque sed sem. " -"Etiam scelerisque justo eget wisi. " -"Nunc dignissim. " -"Proin pulvinar quam non lectus. " -"Proin ut turpis quis augue pellentesque dictum. " -"Fusce et lorem. " -"Aliquam urna lacus, blandit sed, vestibulum sit amet, placerat et, dolor. " -"Curabitur auctor erat nec lorem. " -"Phasellus urna wisi, lacinia ut, molestie tincidunt, condimentum id, odio. " -"Curabitur convallis ullamcorper justo. " -"Donec vestibulum est ac quam. " -"Nullam vitae elit eu massa varius vulputate. " -"Nulla facilisi. " -"Suspendisse potenti. " -"Praesent non libero. " -"Nullam tristique massa id magna viverra commodo. " -"Vestibulum libero tortor, luctus ac, viverra congue, consectetuer vel, libero. " -"Aenean arcu augue, luctus id, laoreet pulvinar, dictum sed, lectus. " -"Donec vestibulum volutpat dolor. " -"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. " -"Pellentesque augue turpis, laoreet nec, malesuada at, nonummy vitae, nibh. " -"Etiam orci sapien, congue in, porttitor sit amet, rutrum vel, nibh. " -"Integer eu lorem. " -"Mauris pretium leo et elit. " -"In nonummy ultricies sapien. " -"Mauris varius. " -"Mauris sed libero. " -"Curabitur ullamcorper elit eu purus. " -"Vestibulum velit pede, semper sit amet, lobortis vitae, tincidunt vel, dui. " -"Nulla neque ante, sagittis eu, vestibulum et, lacinia a, libero. " -"Morbi sit amet wisi. " -"Pellentesque non felis quis arcu bibendum ornare. " -"Aenean enim metus, commodo eu, hendrerit nonummy, euismod ut, quam. " -"Nulla eleifend nisl quis dolor. " -"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. " -"Maecenas pellentesque massa in erat molestie molestie. " -"Mauris dignissim dapibus libero. " -"Sed sed risus id neque dictum ornare. " -"Sed eu ligula at felis sodales accumsan. " -"Sed interdum, urna non pharetra hendrerit, quam mi ornare libero, id fringilla tortor orci non velit. " -"Aliquam nec risus. " -"Donec at nunc vitae tellus molestie vestibulum. " -"Pellentesque vel justo. " -"Duis ligula libero, vulputate quis, adipiscing bibendum, feugiat vitae, velit. " -"Vivamus et arcu. " -"Fusce eget quam. " -"Ut ante. " -"Suspendisse feugiat metus non ipsum. " -"Nulla tempus leo ut mi. " -"Curabitur vitae nisl. " -"Vivamus elementum. " -"Etiam a orci. " -"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vivamus urna quam, tincidunt at, ultrices vel, feugiat eget, nulla. " -"Maecenas lacus magna, nonummy eu, iaculis sed, consectetuer quis, enim. " -"Praesent a eros. " -"Aliquam nonummy dignissim neque. " -"Nulla enim. " -"Praesent molestie, orci quis tristique volutpat, lacus metus luctus sapien, et facilisis eros neque id sapien. " -"Nunc condimentum dolor vel orci. " -"Integer wisi diam, porttitor sit amet, feugiat in, dapibus in, lectus. " -"Aliquam erat volutpat. " -"Quisque mollis turpis vitae tortor. " -"Mauris turpis mi, pretium ut, ultrices sed, porta in, justo. " -"Suspendisse posuere. " -"Quisque ultricies lacus vitae enim. " -"Donec lacus. " -"Suspendisse potenti. " -"Donec molestie, magna sed euismod dictum, magna magna interdum diam, vitae sagittis leo lorem ac neque. " -"Cras metus. " -"Quisque nunc. " -"Duis consectetuer. " -"Vestibulum gravida sollicitudin urna. " -"Integer volutpat, massa quis ultrices pulvinar, eros purus dignissim nunc, eget rhoncus enim lectus quis tortor. " -"Integer lacinia quam quis erat convallis mattis. " -"Suspendisse iaculis posuere velit. " -"Etiam tellus enim, aliquet nec, laoreet a, molestie non, velit. " -"Quisque lacus velit, eleifend imperdiet, fringilla id, dapibus scelerisque, lectus. " -"Nulla quis lorem. " -"Nulla malesuada neque et dui. " -"Phasellus malesuada ultricies odio. " -"Phasellus vitae ligula. " -"Pellentesque feugiat arcu at erat. " -"Vivamus ut eros ut lorem pulvinar iaculis. " -"Proin lobortis ipsum id nunc. " -"Curabitur vel massa. " -"Suspendisse nulla ipsum, malesuada vel, posuere eget, mollis at, risus. " -"Vestibulum sed diam id est dapibus ultrices. " -"Proin tempus, eros a scelerisque vestibulum, ipsum arcu aliquam mi, ut feugiat libero odio in nisl. " -"Quisque et massa a mauris luctus congue. " -"Ut id eros. " -"Fusce ante eros, pharetra non, molestie tristique, bibendum sit amet, wisi. " -"Phasellus rutrum, dolor et semper elementum, eros ante malesuada massa, sed sollicitudin lectus velit et massa. " -"In auctor. " -"Aliquam erat volutpat. " -"Etiam risus leo, vulputate suscipit, sollicitudin et, sodales eget, nisl. " -"Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur lobortis, libero ac laoreet mollis, ligula leo porta wisi, ut euismod felis ligula id elit. " -"Vivamus malesuada nulla eu enim. " -"Donec accumsan faucibus orci. " -"Nulla lacinia ante. " -"Praesent at nibh. " -"Mauris porta dignissim wisi. " -"Ut lacinia tortor nec nunc. " -"Phasellus et augue. " -"Integer rhoncus, libero a pellentesque rhoncus, tortor sapien lobortis pede, eget condimentum sapien risus vitae elit. " -"Suspendisse sed turpis ut dolor placerat dignissim. " -"Quisque quis leo. " -"Cras ultrices. " -"Maecenas hendrerit auctor tortor. " -"Etiam sit amet arcu. "; diff --git a/source/blender/src/mainqueue.c b/source/blender/src/mainqueue.c deleted file mode 100644 index 30ee825a23a..00000000000 --- a/source/blender/src/mainqueue.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - * Just the functions to maintain a central event - * queue. - */ - -#include -#include -#include "BIF_mainqueue.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -typedef struct { - unsigned short event; - short val; - char ascii; -} QEvent; - -static QEvent mainqueue[MAXQUEUE]; -static unsigned int nevents= 0; - -unsigned short mainqread(short *val, char *ascii) -{ - if (nevents) { - nevents--; - - *val= mainqueue[nevents].val; - *ascii= mainqueue[nevents].ascii; - if((*ascii<32)||(*ascii==127)) *ascii=0; - return mainqueue[nevents].event; - } else - return 0; -} - -void mainqenter(unsigned short event, short val) -{ - mainqenter_ext(event, val, 0); -} - -void mainqenter_ext(unsigned short event, short val, char ascii) -{ - if (!event) - return; - - if (nevents -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_listBase.h" -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" - -#include "BLI_arithb.h" -#include "BLI_edgehash.h" -#include "BLI_memarena.h" - -#include "BKE_DerivedMesh.h" -#include "BKE_utildefines.h" - -#include "BIF_editdeform.h" -#include "BIF_meshlaplacian.h" -#include "BIF_meshtools.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BSE_headerbuttons.h" - -#ifdef RIGID_DEFORM -#include "BLI_editVert.h" -#include "BLI_polardecomp.h" -#endif - -#include "RE_raytrace.h" - -#include "ONL_opennl.h" - -/************************** Laplacian System *****************************/ - -struct LaplacianSystem { - NLContext context; /* opennl context */ - - int totvert, totface; - - float **verts; /* vertex coordinates */ - float *varea; /* vertex weights for laplacian computation */ - char *vpinned; /* vertex pinning */ - int (*faces)[3]; /* face vertex indices */ - float (*fweights)[3]; /* cotangent weights per face */ - - int areaweights; /* use area in cotangent weights? */ - int storeweights; /* store cotangent weights in fweights */ - int nlbegun; /* nlBegin(NL_SYSTEM/NL_MATRIX) done */ - - EdgeHash *edgehash; /* edge hash for construction */ - - struct HeatWeighting { - Mesh *mesh; - float (*verts)[3]; /* vertex coordinates */ - float (*vnors)[3]; /* vertex normals */ - - float (*root)[3]; /* bone root */ - float (*tip)[3]; /* bone tip */ - int numbones; - - float *H; /* diagonal H matrix */ - float *p; /* values from all p vectors */ - float *mindist; /* minimum distance to a bone for all vertices */ - - RayTree *raytree; /* ray tracing acceleration structure */ - MFace **vface; /* a face that the vertex belongs to */ - } heat; - -#ifdef RIGID_DEFORM - struct RigidDeformation { - EditMesh *mesh; - - float (*R)[3][3]; - float (*rhs)[3]; - float (*origco)[3]; - int thrownerror; - } rigid; -#endif -}; - -/* Laplacian matrix construction */ - -/* Computation of these weights for the laplacian is based on: - "Discrete Differential-Geometry Operators for Triangulated 2-Manifolds", - Meyer et al, 2002. Section 3.5, formula (8). - - We do it a bit different by going over faces instead of going over each - vertex and adjacent faces, since we don't store this adjacency. Also, the - formulas are tweaked a bit to work for non-manifold meshes. */ - -static void laplacian_increase_edge_count(EdgeHash *edgehash, int v1, int v2) -{ - void **p = BLI_edgehash_lookup_p(edgehash, v1, v2); - - if(p) - *p = (void*)((long)*p + (long)1); - else - BLI_edgehash_insert(edgehash, v1, v2, (void*)(long)1); -} - -static int laplacian_edge_count(EdgeHash *edgehash, int v1, int v2) -{ - return (int)(long)BLI_edgehash_lookup(edgehash, v1, v2); -} - -static float cotan_weight(float *v1, float *v2, float *v3) -{ - float a[3], b[3], c[3], clen; - - VecSubf(a, v2, v1); - VecSubf(b, v3, v1); - Crossf(c, a, b); - - clen = VecLength(c); - - if (clen == 0.0f) - return 0.0f; - - return Inpf(a, b)/clen; -} - -static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3) -{ - float t1, t2, t3, len1, len2, len3, area; - float *varea= sys->varea, *v1, *v2, *v3; - int obtuse = 0; - - v1= sys->verts[i1]; - v2= sys->verts[i2]; - v3= sys->verts[i3]; - - t1= cotan_weight(v1, v2, v3); - t2= cotan_weight(v2, v3, v1); - t3= cotan_weight(v3, v1, v2); - - if(VecAngle3(v2, v1, v3) > 90) obtuse= 1; - else if(VecAngle3(v1, v2, v3) > 90) obtuse= 2; - else if(VecAngle3(v1, v3, v2) > 90) obtuse= 3; - - if (obtuse > 0) { - area= AreaT3Dfl(v1, v2, v3); - - varea[i1] += (obtuse == 1)? area: area*0.5; - varea[i2] += (obtuse == 2)? area: area*0.5; - varea[i3] += (obtuse == 3)? area: area*0.5; - } - else { - len1= VecLenf(v2, v3); - len2= VecLenf(v1, v3); - len3= VecLenf(v1, v2); - - t1 *= len1*len1; - t2 *= len2*len2; - t3 *= len3*len3; - - varea[i1] += (t2 + t3)*0.25f; - varea[i2] += (t1 + t3)*0.25f; - varea[i3] += (t1 + t2)*0.25f; - } -} - -static void laplacian_triangle_weights(LaplacianSystem *sys, int f, int i1, int i2, int i3) -{ - float t1, t2, t3; - float *varea= sys->varea, *v1, *v2, *v3; - - v1= sys->verts[i1]; - v2= sys->verts[i2]; - v3= sys->verts[i3]; - - /* instead of *0.5 we divided by the number of faces of the edge, it still - needs to be varified that this is indeed the correct thing to do! */ - t1= cotan_weight(v1, v2, v3)/laplacian_edge_count(sys->edgehash, i2, i3); - t2= cotan_weight(v2, v3, v1)/laplacian_edge_count(sys->edgehash, i3, i1); - t3= cotan_weight(v3, v1, v2)/laplacian_edge_count(sys->edgehash, i1, i2); - - nlMatrixAdd(i1, i1, (t2+t3)*varea[i1]); - nlMatrixAdd(i2, i2, (t1+t3)*varea[i2]); - nlMatrixAdd(i3, i3, (t1+t2)*varea[i3]); - - nlMatrixAdd(i1, i2, -t3*varea[i1]); - nlMatrixAdd(i2, i1, -t3*varea[i2]); - - nlMatrixAdd(i2, i3, -t1*varea[i2]); - nlMatrixAdd(i3, i2, -t1*varea[i3]); - - nlMatrixAdd(i3, i1, -t2*varea[i3]); - nlMatrixAdd(i1, i3, -t2*varea[i1]); - - if(sys->storeweights) { - sys->fweights[f][0]= t1*varea[i1]; - sys->fweights[f][1]= t2*varea[i2]; - sys->fweights[f][2]= t3*varea[i3]; - } -} - -LaplacianSystem *laplacian_system_construct_begin(int totvert, int totface) -{ - LaplacianSystem *sys; - - sys= MEM_callocN(sizeof(LaplacianSystem), "LaplacianSystem"); - - sys->verts= MEM_callocN(sizeof(float*)*totvert, "LaplacianSystemVerts"); - sys->vpinned= MEM_callocN(sizeof(char)*totvert, "LaplacianSystemVpinned"); - sys->faces= MEM_callocN(sizeof(int)*3*totface, "LaplacianSystemFaces"); - - sys->totvert= 0; - sys->totface= 0; - - sys->areaweights= 1; - sys->storeweights= 0; - - /* create opennl context */ - nlNewContext(); - nlSolverParameteri(NL_NB_VARIABLES, totvert); - - sys->context= nlGetCurrent(); - - return sys; -} - -void laplacian_add_vertex(LaplacianSystem *sys, float *co, int pinned) -{ - sys->verts[sys->totvert]= co; - sys->vpinned[sys->totvert]= pinned; - sys->totvert++; -} - -void laplacian_add_triangle(LaplacianSystem *sys, int v1, int v2, int v3) -{ - sys->faces[sys->totface][0]= v1; - sys->faces[sys->totface][1]= v2; - sys->faces[sys->totface][2]= v3; - sys->totface++; -} - -void laplacian_system_construct_end(LaplacianSystem *sys) -{ - int (*face)[3]; - int a, totvert=sys->totvert, totface=sys->totface; - - laplacian_begin_solve(sys, 0); - - sys->varea= MEM_callocN(sizeof(float)*totvert, "LaplacianSystemVarea"); - - sys->edgehash= BLI_edgehash_new(); - for(a=0, face=sys->faces; atotface; a++, face++) { - laplacian_increase_edge_count(sys->edgehash, (*face)[0], (*face)[1]); - laplacian_increase_edge_count(sys->edgehash, (*face)[1], (*face)[2]); - laplacian_increase_edge_count(sys->edgehash, (*face)[2], (*face)[0]); - } - - if(sys->areaweights) - for(a=0, face=sys->faces; atotface; a++, face++) - laplacian_triangle_area(sys, (*face)[0], (*face)[1], (*face)[2]); - - for(a=0; aareaweights) { - if(sys->varea[a] != 0.0f) - sys->varea[a]= 0.5f/sys->varea[a]; - } - else - sys->varea[a]= 1.0f; - - /* for heat weighting */ - if(sys->heat.H) - nlMatrixAdd(a, a, sys->heat.H[a]); - } - - if(sys->storeweights) - sys->fweights= MEM_callocN(sizeof(float)*3*totface, "LaplacianFWeight"); - - for(a=0, face=sys->faces; afaces); - sys->faces= NULL; - - if(sys->varea) { - MEM_freeN(sys->varea); - sys->varea= NULL; - } - - BLI_edgehash_free(sys->edgehash, NULL); - sys->edgehash= NULL; -} - -void laplacian_system_delete(LaplacianSystem *sys) -{ - if(sys->verts) MEM_freeN(sys->verts); - if(sys->varea) MEM_freeN(sys->varea); - if(sys->vpinned) MEM_freeN(sys->vpinned); - if(sys->faces) MEM_freeN(sys->faces); - if(sys->fweights) MEM_freeN(sys->fweights); - - nlDeleteContext(sys->context); - MEM_freeN(sys); -} - -void laplacian_begin_solve(LaplacianSystem *sys, int index) -{ - int a; - - if (!sys->nlbegun) { - nlBegin(NL_SYSTEM); - - if(index >= 0) { - for(a=0; atotvert; a++) { - if(sys->vpinned[a]) { - nlSetVariable(0, a, sys->verts[a][index]); - nlLockVariable(a); - } - } - } - - nlBegin(NL_MATRIX); - sys->nlbegun = 1; - } -} - -void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value) -{ - nlRightHandSideAdd(0, v, value); -} - -int laplacian_system_solve(LaplacianSystem *sys) -{ - nlEnd(NL_MATRIX); - nlEnd(NL_SYSTEM); - sys->nlbegun = 0; - - //nlPrintMatrix(); - - return nlSolveAdvanced(NULL, NL_TRUE); -} - -float laplacian_system_get_solution(int v) -{ - return nlGetVariable(0, v); -} - -/************************* Heat Bone Weighting ******************************/ -/* From "Automatic Rigging and Animation of 3D Characters" - Ilya Baran and Jovan Popovic, SIGGRAPH 2007 */ - -#define C_WEIGHT 1.0f -#define WEIGHT_LIMIT 0.05f -#define DISTANCE_EPSILON 1e-4f - -/* Raytracing for vertex to bone visibility */ - -static LaplacianSystem *HeatSys = NULL; - -static void heat_ray_coords_func(RayFace *face, float **v1, float **v2, float **v3, float **v4) -{ - MFace *mface= (MFace*)face; - float (*verts)[3]= HeatSys->heat.verts; - - *v1= verts[mface->v1]; - *v2= verts[mface->v2]; - *v3= verts[mface->v3]; - *v4= (mface->v4)? verts[mface->v4]: NULL; -} - -static int heat_ray_check_func(Isect *is, RayFace *face) -{ - float *v1, *v2, *v3, *v4, nor[3]; - - /* don't intersect if the ray faces along the face normal */ - heat_ray_coords_func(face, &v1, &v2, &v3, &v4); - - if(v4) CalcNormFloat4(v1, v2, v3, v4, nor); - else CalcNormFloat(v1, v2, v3, nor); - - return (INPR(nor, is->vec) < 0); -} - -static void heat_ray_tree_create(LaplacianSystem *sys) -{ - Mesh *me = sys->heat.mesh; - RayTree *tree; - MFace *mface; - float min[3], max[3]; - int a; - - /* create a raytrace tree from the mesh */ - INIT_MINMAX(min, max); - - for(a=0; atotvert; a++) - DO_MINMAX(sys->heat.verts[a], min, max); - - tree= RE_ray_tree_create(64, me->totface, min, max, - heat_ray_coords_func, heat_ray_check_func, NULL, NULL); - - sys->heat.vface= MEM_callocN(sizeof(MFace*)*me->totvert, "HeatVFaces"); - - HeatSys= sys; - - for(a=0, mface=me->mface; atotface; a++, mface++) { - RE_ray_tree_add_face(tree, 0, mface); - - sys->heat.vface[mface->v1]= mface; - sys->heat.vface[mface->v2]= mface; - sys->heat.vface[mface->v3]= mface; - if(mface->v4) sys->heat.vface[mface->v4]= mface; - } - - HeatSys= NULL; - - RE_ray_tree_done(tree); - - sys->heat.raytree= tree; -} - -static int heat_ray_bone_visible(LaplacianSystem *sys, int vertex, int bone) -{ - Isect isec; - MFace *mface; - float dir[3]; - int visible; - - mface= sys->heat.vface[vertex]; - if(!mface) - return 1; - - /* setup isec */ - memset(&isec, 0, sizeof(isec)); - isec.mode= RE_RAY_SHADOW; - isec.lay= -1; - isec.face_last= NULL; - isec.faceorig= mface; - - VECCOPY(isec.start, sys->heat.verts[vertex]); - PclosestVL3Dfl(isec.end, isec.start, - sys->heat.root[bone], sys->heat.tip[bone]); - - /* add an extra offset to the start position to avoid self intersection */ - VECSUB(dir, isec.end, isec.start); - Normalize(dir); - VecMulf(dir, 1e-5); - VecAddf(isec.start, isec.start, dir); - - HeatSys= sys; - visible= !RE_ray_tree_intersect(sys->heat.raytree, &isec); - HeatSys= NULL; - - return visible; -} - -static float heat_bone_distance(LaplacianSystem *sys, int vertex, int bone) -{ - float closest[3], d[3], dist, cosine; - - /* compute euclidian distance */ - PclosestVL3Dfl(closest, sys->heat.verts[vertex], - sys->heat.root[bone], sys->heat.tip[bone]); - - VecSubf(d, sys->heat.verts[vertex], closest); - dist= Normalize(d); - - /* if the vertex normal does not point along the bone, increase distance */ - cosine= INPR(d, sys->heat.vnors[vertex]); - - return dist/(0.5f*(cosine + 1.001f)); -} - -static int heat_bone_closest(LaplacianSystem *sys, int vertex, int bone) -{ - float dist; - - dist= heat_bone_distance(sys, vertex, bone); - - if(dist <= sys->heat.mindist[vertex]*(1.0f + DISTANCE_EPSILON)) - if(heat_ray_bone_visible(sys, vertex, bone)) - return 1; - - return 0; -} - -static void heat_set_H(LaplacianSystem *sys, int vertex) -{ - float dist, mindist, h; - int j, numclosest = 0; - - mindist= 1e10; - - /* compute minimum distance */ - for(j=0; jheat.numbones; j++) { - dist= heat_bone_distance(sys, vertex, j); - - if(dist < mindist) - mindist= dist; - } - - sys->heat.mindist[vertex]= mindist; - - /* count number of bones with approximately this minimum distance */ - for(j=0; jheat.numbones; j++) - if(heat_bone_closest(sys, vertex, j)) - numclosest++; - - sys->heat.p[vertex]= (numclosest > 0)? 1.0f/numclosest: 0.0f; - - /* compute H entry */ - if(numclosest > 0) { - if(mindist > 1e-5) - h= numclosest*C_WEIGHT/(mindist*mindist); - else - h= 1e10f; - } - else - h= 0.0f; - - sys->heat.H[vertex]= h; -} - -void heat_calc_vnormals(LaplacianSystem *sys) -{ - float fnor[3]; - int a, v1, v2, v3, (*face)[3]; - - sys->heat.vnors= MEM_callocN(sizeof(float)*3*sys->totvert, "HeatVNors"); - - for(a=0, face=sys->faces; atotface; a++, face++) { - v1= (*face)[0]; - v2= (*face)[1]; - v3= (*face)[2]; - - CalcNormFloat(sys->verts[v1], sys->verts[v2], sys->verts[v3], fnor); - - VecAddf(sys->heat.vnors[v1], sys->heat.vnors[v1], fnor); - VecAddf(sys->heat.vnors[v2], sys->heat.vnors[v2], fnor); - VecAddf(sys->heat.vnors[v3], sys->heat.vnors[v3], fnor); - } - - for(a=0; atotvert; a++) - Normalize(sys->heat.vnors[a]); -} - -static void heat_laplacian_create(LaplacianSystem *sys) -{ - Mesh *me = sys->heat.mesh; - MFace *mface; - int a; - - /* heat specific definitions */ - sys->heat.mindist= MEM_callocN(sizeof(float)*me->totvert, "HeatMinDist"); - sys->heat.H= MEM_callocN(sizeof(float)*me->totvert, "HeatH"); - sys->heat.p= MEM_callocN(sizeof(float)*me->totvert, "HeatP"); - - /* add verts and faces to laplacian */ - for(a=0; atotvert; a++) - laplacian_add_vertex(sys, sys->heat.verts[a], 0); - - for(a=0, mface=me->mface; atotface; a++, mface++) { - laplacian_add_triangle(sys, mface->v1, mface->v2, mface->v3); - if(mface->v4) - laplacian_add_triangle(sys, mface->v1, mface->v3, mface->v4); - } - - /* for distance computation in set_H */ - heat_calc_vnormals(sys); - - for(a=0; atotvert; a++) - heat_set_H(sys, a); -} - -void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numbones, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected) -{ - LaplacianSystem *sys; - MFace *mface; - float solution, weight; - int *vertsflipped = NULL; - int a, totface, j, bbone, firstsegment, lastsegment, thrownerror = 0; - - /* count triangles */ - for(totface=0, a=0, mface=me->mface; atotface; a++, mface++) { - totface++; - if(mface->v4) totface++; - } - - /* create laplacian */ - sys = laplacian_system_construct_begin(me->totvert, totface); - - sys->heat.mesh= me; - sys->heat.verts= verts; - sys->heat.root= root; - sys->heat.tip= tip; - sys->heat.numbones= numbones; - - heat_ray_tree_create(sys); - heat_laplacian_create(sys); - - laplacian_system_construct_end(sys); - - if(dgroupflip) { - vertsflipped = MEM_callocN(sizeof(int)*me->totvert, "vertsflipped"); - for(a=0; atotvert; a++) - vertsflipped[a] = mesh_get_x_mirror_vert(ob, a); - } - - /* compute weights per bone */ - for(j=0; jtotvert; a++) { - remove_vert_defgroup(ob, dgrouplist[j], a); - if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) - remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]); - } - } - - /* fill right hand side */ - laplacian_begin_solve(sys, -1); - - for(a=0; atotvert; a++) - if(heat_bone_closest(sys, a, j)) - laplacian_add_right_hand_side(sys, a, - sys->heat.H[a]*sys->heat.p[a]); - - /* solve */ - if(laplacian_system_solve(sys)) { - /* load solution into vertex groups */ - for(a=0; atotvert; a++) { - solution= laplacian_system_get_solution(a); - - if(bbone) { - if(solution > 0.0f) - add_vert_to_defgroup(ob, dgrouplist[j], a, solution, - WEIGHT_ADD); - } - else { - if(solution > WEIGHT_LIMIT) - add_vert_to_defgroup(ob, dgrouplist[j], a, solution, - WEIGHT_REPLACE); - else - remove_vert_defgroup(ob, dgrouplist[j], a); - } - - /* do same for mirror */ - if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) { - if(bbone) { - if(solution > 0.0f) - add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a], - solution, WEIGHT_ADD); - } - else { - if(solution > WEIGHT_LIMIT) - add_vert_to_defgroup(ob, dgroupflip[j], vertsflipped[a], - solution, WEIGHT_REPLACE); - else - remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]); - } - } - } - } - else if(!thrownerror) { - error("Bone Heat Weighting:" - " failed to find solution for one or more bones"); - thrownerror= 1; - break; - } - - /* remove too small vertex weights */ - if(bbone && lastsegment) { - for(a=0; atotvert; a++) { - weight= get_vert_defgroup(ob, dgrouplist[j], a); - if(weight > 0.0f && weight <= WEIGHT_LIMIT) - remove_vert_defgroup(ob, dgrouplist[j], a); - - if(vertsflipped && dgroupflip[j] && vertsflipped[a] >= 0) { - weight= get_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]); - if(weight > 0.0f && weight <= WEIGHT_LIMIT) - remove_vert_defgroup(ob, dgroupflip[j], vertsflipped[a]); - } - } - } - } - - /* free */ - if(vertsflipped) MEM_freeN(vertsflipped); - - RE_ray_tree_free(sys->heat.raytree); - MEM_freeN(sys->heat.vface); - - MEM_freeN(sys->heat.mindist); - MEM_freeN(sys->heat.H); - MEM_freeN(sys->heat.p); - MEM_freeN(sys->heat.vnors); - - laplacian_system_delete(sys); -} - -#ifdef RIGID_DEFORM -/********************** As-Rigid-As-Possible Deformation ******************/ -/* From "As-Rigid-As-Possible Surface Modeling", - Olga Sorkine and Marc Alexa, ESGP 2007. */ - -/* investigate: - - transpose R in orthogonal - - flipped normals and per face adding - - move cancelling to transform, make origco pointer -*/ - -static LaplacianSystem *RigidDeformSystem = NULL; - -static void rigid_add_half_edge_to_R(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w) -{ - float e[3], e_[3]; - int i; - - VecSubf(e, sys->rigid.origco[v1->tmp.l], sys->rigid.origco[v2->tmp.l]); - VecSubf(e_, v1->co, v2->co); - - /* formula (5) */ - for (i=0; i<3; i++) { - sys->rigid.R[v1->tmp.l][i][0] += w*e[0]*e_[i]; - sys->rigid.R[v1->tmp.l][i][1] += w*e[1]*e_[i]; - sys->rigid.R[v1->tmp.l][i][2] += w*e[2]*e_[i]; - } -} - -static void rigid_add_edge_to_R(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w) -{ - rigid_add_half_edge_to_R(sys, v1, v2, w); - rigid_add_half_edge_to_R(sys, v2, v1, w); -} - -static void rigid_orthogonalize_R(float R[][3]) -{ - HMatrix M, Q, S; - - Mat4CpyMat3(M, R); - polar_decomp(M, Q, S); - Mat3CpyMat4(R, Q); -} - -static void rigid_add_half_edge_to_rhs(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w) -{ - /* formula (8) */ - float Rsum[3][3], rhs[3]; - - if (sys->vpinned[v1->tmp.l]) - return; - - Mat3AddMat3(Rsum, sys->rigid.R[v1->tmp.l], sys->rigid.R[v2->tmp.l]); - Mat3Transp(Rsum); - - VecSubf(rhs, sys->rigid.origco[v1->tmp.l], sys->rigid.origco[v2->tmp.l]); - Mat3MulVecfl(Rsum, rhs); - VecMulf(rhs, 0.5f); - VecMulf(rhs, w); - - VecAddf(sys->rigid.rhs[v1->tmp.l], sys->rigid.rhs[v1->tmp.l], rhs); -} - -static void rigid_add_edge_to_rhs(LaplacianSystem *sys, EditVert *v1, EditVert *v2, float w) -{ - rigid_add_half_edge_to_rhs(sys, v1, v2, w); - rigid_add_half_edge_to_rhs(sys, v2, v1, w); -} - -void rigid_deform_iteration() -{ - LaplacianSystem *sys= RigidDeformSystem; - EditMesh *em; - EditVert *eve; - EditFace *efa; - int a, i; - - if(!sys) - return; - - nlMakeCurrent(sys->context); - em= sys->rigid.mesh; - - /* compute R */ - memset(sys->rigid.R, 0, sizeof(float)*3*3*sys->totvert); - memset(sys->rigid.rhs, 0, sizeof(float)*3*sys->totvert); - - for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) { - rigid_add_edge_to_R(sys, efa->v1, efa->v2, sys->fweights[a][2]); - rigid_add_edge_to_R(sys, efa->v2, efa->v3, sys->fweights[a][0]); - rigid_add_edge_to_R(sys, efa->v3, efa->v1, sys->fweights[a][1]); - - if(efa->v4) { - a++; - rigid_add_edge_to_R(sys, efa->v1, efa->v3, sys->fweights[a][2]); - rigid_add_edge_to_R(sys, efa->v3, efa->v4, sys->fweights[a][0]); - rigid_add_edge_to_R(sys, efa->v4, efa->v1, sys->fweights[a][1]); - } - } - - for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) { - rigid_orthogonalize_R(sys->rigid.R[a]); - eve->tmp.l= a; - } - - /* compute right hand sides for solving */ - for(a=0, efa=em->faces.first; efa; efa=efa->next, a++) { - rigid_add_edge_to_rhs(sys, efa->v1, efa->v2, sys->fweights[a][2]); - rigid_add_edge_to_rhs(sys, efa->v2, efa->v3, sys->fweights[a][0]); - rigid_add_edge_to_rhs(sys, efa->v3, efa->v1, sys->fweights[a][1]); - - if(efa->v4) { - a++; - rigid_add_edge_to_rhs(sys, efa->v1, efa->v3, sys->fweights[a][2]); - rigid_add_edge_to_rhs(sys, efa->v3, efa->v4, sys->fweights[a][0]); - rigid_add_edge_to_rhs(sys, efa->v4, efa->v1, sys->fweights[a][1]); - } - } - - /* solve for positions, for X,Y and Z separately */ - for(i=0; i<3; i++) { - laplacian_begin_solve(sys, i); - - for(a=0; atotvert; a++) - if(!sys->vpinned[a]) - laplacian_add_right_hand_side(sys, a, sys->rigid.rhs[a][i]); - - if(laplacian_system_solve(sys)) { - for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) - eve->co[i]= laplacian_system_get_solution(a); - } - else { - if(!sys->rigid.thrownerror) { - error("RigidDeform: failed to find solution."); - sys->rigid.thrownerror= 1; - } - break; - } - } -} - -static void rigid_laplacian_create(LaplacianSystem *sys) -{ - EditMesh *em = sys->rigid.mesh; - EditVert *eve; - EditFace *efa; - int a; - - /* add verts and faces to laplacian */ - for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) { - laplacian_add_vertex(sys, eve->co, eve->pinned); - eve->tmp.l= a; - } - - for(efa=em->faces.first; efa; efa=efa->next) { - laplacian_add_triangle(sys, - efa->v1->tmp.l, efa->v2->tmp.l, efa->v3->tmp.l); - if(efa->v4) - laplacian_add_triangle(sys, - efa->v1->tmp.l, efa->v3->tmp.l, efa->v4->tmp.l); - } -} - -void rigid_deform_begin(EditMesh *em) -{ - LaplacianSystem *sys; - EditVert *eve; - EditFace *efa; - int a, totvert, totface; - - /* count vertices, triangles */ - for(totvert=0, eve=em->verts.first; eve; eve=eve->next) - totvert++; - - for(totface=0, efa=em->faces.first; efa; efa=efa->next) { - totface++; - if(efa->v4) totface++; - } - - /* create laplacian */ - sys = laplacian_system_construct_begin(totvert, totface); - - sys->rigid.mesh= em; - sys->rigid.R = MEM_callocN(sizeof(float)*3*3*totvert, "RigidDeformR"); - sys->rigid.rhs = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformRHS"); - sys->rigid.origco = MEM_callocN(sizeof(float)*3*totvert, "RigidDeformCo"); - - for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) - VecCopyf(sys->rigid.origco[a], eve->co); - - sys->areaweights= 0; - sys->storeweights= 1; - - rigid_laplacian_create(sys); - - laplacian_system_construct_end(sys); - - RigidDeformSystem = sys; -} - -void rigid_deform_end(int cancel) -{ - LaplacianSystem *sys = RigidDeformSystem; - - if(sys) { - EditMesh *em = sys->rigid.mesh; - EditVert *eve; - int a; - - if(cancel) - for(a=0, eve=em->verts.first; eve; eve=eve->next, a++) - if(!eve->pinned) - VecCopyf(eve->co, sys->rigid.origco[a]); - - if(sys->rigid.R) MEM_freeN(sys->rigid.R); - if(sys->rigid.rhs) MEM_freeN(sys->rigid.rhs); - if(sys->rigid.origco) MEM_freeN(sys->rigid.origco); - - /* free */ - laplacian_system_delete(sys); - } - - RigidDeformSystem = NULL; -} -#endif - -/************************** Harmonic Coordinates ****************************/ -/* From "Harmonic Coordinates for Character Articulation", - Pushkar Joshi, Mark Meyer, Tony DeRose, Brian Green and Tom Sanocki, - SIGGRAPH 2007. */ - -#define EPSILON 0.0001f - -#define MESHDEFORM_TAG_UNTYPED 0 -#define MESHDEFORM_TAG_BOUNDARY 1 -#define MESHDEFORM_TAG_INTERIOR 2 -#define MESHDEFORM_TAG_EXTERIOR 3 - -#define MESHDEFORM_LEN_THRESHOLD 1e-6 - -#define MESHDEFORM_MIN_INFLUENCE 0.0005 - -static int MESHDEFORM_OFFSET[7][3] = - {{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}}; - -typedef struct MDefBoundIsect { - float co[3], uvw[4]; - int nvert, v[4], facing; - float len; -} MDefBoundIsect; - -typedef struct MDefBindInfluence { - struct MDefBindInfluence *next; - float weight; - int vertex; -} MDefBindInfluence; - -typedef struct MeshDeformBind { - /* grid dimensions */ - float min[3], max[3]; - float width[3], halfwidth[3]; - int size, size3; - - /* meshes */ - DerivedMesh *cagedm; - float (*cagecos)[3]; - float (*vertexcos)[3]; - int totvert, totcagevert; - - /* grids */ - MemArena *memarena; - MDefBoundIsect *(*boundisect)[6]; - int *semibound; - int *tag; - float *phi, *totalphi; - - /* mesh stuff */ - int *inside; - float *weights; - MDefBindInfluence **dyngrid; - float cagemat[4][4]; - - /* direct solver */ - int *varidx; - - /* raytrace */ - RayTree *raytree; -} MeshDeformBind; - -/* ray intersection */ - -/* our own triangle intersection, so we can fully control the epsilons and - * prevent corner case from going wrong*/ -static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3], - float vert1[3], float vert2[3], float *isectco, float *uvw) -{ - float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; - float det,inv_det, u, v, dir[3], isectdir[3]; - - VECSUB(dir, end, orig); - - /* find vectors for two edges sharing vert0 */ - VECSUB(edge1, vert1, vert0); - VECSUB(edge2, vert2, vert0); - - /* begin calculating determinant - also used to calculate U parameter */ - Crossf(pvec, dir, edge2); - - /* if determinant is near zero, ray lies in plane of triangle */ - det = INPR(edge1, pvec); - - if (det == 0.0f) - return 0; - inv_det = 1.0f / det; - - /* calculate distance from vert0 to ray origin */ - VECSUB(tvec, orig, vert0); - - /* calculate U parameter and test bounds */ - u = INPR(tvec, pvec) * inv_det; - if (u < -EPSILON || u > 1.0f+EPSILON) - return 0; - - /* prepare to test V parameter */ - Crossf(qvec, tvec, edge1); - - /* calculate V parameter and test bounds */ - v = INPR(dir, qvec) * inv_det; - if (v < -EPSILON || u + v > 1.0f+EPSILON) - return 0; - - isectco[0]= (1.0f - u - v)*vert0[0] + u*vert1[0] + v*vert2[0]; - isectco[1]= (1.0f - u - v)*vert0[1] + u*vert1[1] + v*vert2[1]; - isectco[2]= (1.0f - u - v)*vert0[2] + u*vert1[2] + v*vert2[2]; - - uvw[0]= 1.0 - u - v; - uvw[1]= u; - uvw[2]= v; - - /* check if it is within the length of the line segment */ - VECSUB(isectdir, isectco, orig); - - if(INPR(dir, isectdir) < -EPSILON) - return 0; - - if(INPR(dir, dir) + EPSILON < INPR(isectdir, isectdir)) - return 0; - - return 1; -} - -/* blender's raytracer is not use now, even though it is much faster. it can - * give problems with rays falling through, so we use our own intersection - * function above with tweaked epsilons */ - -#if 0 -static MeshDeformBind *MESHDEFORM_BIND = NULL; - -static void meshdeform_ray_coords_func(RayFace *face, float **v1, float **v2, float **v3, float **v4) -{ - MFace *mface= (MFace*)face; - float (*cagecos)[3]= MESHDEFORM_BIND->cagecos; - - *v1= cagecos[mface->v1]; - *v2= cagecos[mface->v2]; - *v3= cagecos[mface->v3]; - *v4= (mface->v4)? cagecos[mface->v4]: NULL; -} - -static int meshdeform_ray_check_func(Isect *is, RayFace *face) -{ - return 1; -} - -static void meshdeform_ray_tree_create(MeshDeformBind *mdb) -{ - MFace *mface; - float min[3], max[3]; - int a, totface; - - /* create a raytrace tree from the mesh */ - INIT_MINMAX(min, max); - - for(a=0; atotcagevert; a++) - DO_MINMAX(mdb->cagecos[a], min, max) - - MESHDEFORM_BIND= mdb; - - mface= mdb->cagedm->getFaceArray(mdb->cagedm); - totface= mdb->cagedm->getNumFaces(mdb->cagedm); - - mdb->raytree= RE_ray_tree_create(64, totface, min, max, - meshdeform_ray_coords_func, meshdeform_ray_check_func); - - for(a=0; araytree, mface); - - RE_ray_tree_done(mdb->raytree); -} - -static void meshdeform_ray_tree_free(MeshDeformBind *mdb) -{ - MESHDEFORM_BIND= NULL; - RE_ray_tree_free(mdb->raytree); -} -#endif - -static int meshdeform_intersect(MeshDeformBind *mdb, Isect *isec) -{ - MFace *mface; - float face[4][3], co[3], uvw[3], len, nor[3]; - int f, hit, is= 0, totface; - - isec->labda= 1e10; - - mface= mdb->cagedm->getFaceArray(mdb->cagedm); - totface= mdb->cagedm->getNumFaces(mdb->cagedm); - - for(f=0; fcagecos[mface->v1]); - VECCOPY(face[1], mdb->cagecos[mface->v2]); - VECCOPY(face[2], mdb->cagecos[mface->v3]); - - if(mface->v4) { - VECCOPY(face[3], mdb->cagecos[mface->v4]); - hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[1], face[2], co, uvw); - - if(hit) { - CalcNormFloat(face[0], face[1], face[2], nor); - } - else { - hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[2], face[3], co, uvw); - CalcNormFloat(face[0], face[2], face[3], nor); - } - } - else { - hit= meshdeform_tri_intersect(isec->start, isec->end, face[0], face[1], face[2], co, uvw); - CalcNormFloat(face[0], face[1], face[2], nor); - } - - if(hit) { - len= VecLenf(isec->start, co)/VecLenf(isec->start, isec->end); - if(len < isec->labda) { - isec->labda= len; - isec->face= mface; - isec->isect= (INPR(isec->vec, nor) <= 0.0f); - is= 1; - } - } - } - - return is; -} - -static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float *co1, float *co2) -{ - MDefBoundIsect *isect; - Isect isec; - float (*cagecos)[3]; - MFace *mface; - float vert[4][3], len; - static float epsilon[3]= {0, 0, 0}; //1e-4, 1e-4, 1e-4}; - - /* setup isec */ - memset(&isec, 0, sizeof(isec)); - isec.mode= RE_RAY_MIRROR; /* we want the closest intersection */ - isec.lay= -1; - isec.face_last= NULL; - isec.faceorig= NULL; - isec.labda= 1e10f; - - VECADD(isec.start, co1, epsilon); - VECADD(isec.end, co2, epsilon); - VECSUB(isec.vec, isec.end, isec.start); - -#if 0 - /*if(RE_ray_tree_intersect(mdb->raytree, &isec)) {*/ -#endif - - if(meshdeform_intersect(mdb, &isec)) { - len= isec.labda; - mface= isec.face; - - /* create MDefBoundIsect */ - isect= BLI_memarena_alloc(mdb->memarena, sizeof(*isect)); - - /* compute intersection coordinate */ - isect->co[0]= co1[0] + isec.vec[0]*len; - isect->co[1]= co1[1] + isec.vec[1]*len; - isect->co[2]= co1[2] + isec.vec[2]*len; - - isect->len= VecLenf(co1, isect->co); - if(isect->len < MESHDEFORM_LEN_THRESHOLD) - isect->len= MESHDEFORM_LEN_THRESHOLD; - - isect->v[0]= mface->v1; - isect->v[1]= mface->v2; - isect->v[2]= mface->v3; - isect->v[3]= mface->v4; - isect->nvert= (mface->v4)? 4: 3; - - isect->facing= isec.isect; - - /* compute mean value coordinates for interpolation */ - cagecos= mdb->cagecos; - VECCOPY(vert[0], cagecos[mface->v1]); - VECCOPY(vert[1], cagecos[mface->v2]); - VECCOPY(vert[2], cagecos[mface->v3]); - if(mface->v4) VECCOPY(vert[3], cagecos[mface->v4]); - MeanValueWeights(vert, isect->nvert, isect->co, isect->uvw); - - return isect; - } - - return NULL; -} - -static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co) -{ - MDefBoundIsect *isect; - float outside[3], start[3], dir[3]; - int i, counter; - - for(i=1; i<=6; i++) { - counter = 0; - - outside[0] = co[0] + (mdb->max[0] - mdb->min[0] + 1.0f)*MESHDEFORM_OFFSET[i][0]; - outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1]; - outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2]; - - VECSUB(dir, outside, start); - Normalize(dir); - VECCOPY(start, co); - - isect = meshdeform_ray_tree_intersect(mdb, start, outside); - if(isect && !isect->facing) - return 1; - } - - return 0; -} - -/* solving */ - -static int meshdeform_index(MeshDeformBind *mdb, int x, int y, int z, int n) -{ - int size= mdb->size; - - x += MESHDEFORM_OFFSET[n][0]; - y += MESHDEFORM_OFFSET[n][1]; - z += MESHDEFORM_OFFSET[n][2]; - - if(x < 0 || x >= mdb->size) - return -1; - if(y < 0 || y >= mdb->size) - return -1; - if(z < 0 || z >= mdb->size) - return -1; - - return x + y*size + z*size*size; -} - -static void meshdeform_cell_center(MeshDeformBind *mdb, int x, int y, int z, int n, float *center) -{ - x += MESHDEFORM_OFFSET[n][0]; - y += MESHDEFORM_OFFSET[n][1]; - z += MESHDEFORM_OFFSET[n][2]; - - center[0]= mdb->min[0] + x*mdb->width[0] + mdb->halfwidth[0]; - center[1]= mdb->min[1] + y*mdb->width[1] + mdb->halfwidth[1]; - center[2]= mdb->min[2] + z*mdb->width[2] + mdb->halfwidth[2]; -} - -static void meshdeform_add_intersections(MeshDeformBind *mdb, int x, int y, int z) -{ - MDefBoundIsect *isect; - float center[3], ncenter[3]; - int i, a; - - a= meshdeform_index(mdb, x, y, z, 0); - meshdeform_cell_center(mdb, x, y, z, 0, center); - - /* check each outgoing edge for intersection */ - for(i=1; i<=6; i++) { - if(meshdeform_index(mdb, x, y, z, i) == -1) - continue; - - meshdeform_cell_center(mdb, x, y, z, i, ncenter); - - isect= meshdeform_ray_tree_intersect(mdb, center, ncenter); - if(isect) { - mdb->boundisect[a][i-1]= isect; - mdb->tag[a]= MESHDEFORM_TAG_BOUNDARY; - } - } -} - -static void meshdeform_bind_floodfill(MeshDeformBind *mdb) -{ - int *stack, *tag= mdb->tag; - int a, b, i, xyz[3], stacksize, size= mdb->size; - - stack= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformBindStack"); - - /* we know lower left corner is EXTERIOR because of padding */ - tag[0]= MESHDEFORM_TAG_EXTERIOR; - stack[0]= 0; - stacksize= 1; - - /* floodfill exterior tag */ - while(stacksize > 0) { - a= stack[--stacksize]; - - xyz[2]= a/(size*size); - xyz[1]= (a - xyz[2]*size*size)/size; - xyz[0]= a - xyz[1]*size - xyz[2]*size*size; - - for(i=1; i<=6; i++) { - b= meshdeform_index(mdb, xyz[0], xyz[1], xyz[2], i); - - if(b != -1) { - if(tag[b] == MESHDEFORM_TAG_UNTYPED || - (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i-1])) { - tag[b]= MESHDEFORM_TAG_EXTERIOR; - stack[stacksize++]= b; - } - } - } - } - - /* other cells are interior */ - for(a=0; asemibound[a]) - ts++; - } - - printf("interior %d exterior %d boundary %d semi-boundary %d\n", ti, te, tb, ts); - } -#endif - - MEM_freeN(stack); -} - -static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, int cagevert) -{ - int a; - - for(a=0; anvert; a++) - if(isect->v[a] == cagevert) - return isect->uvw[a]; - - return 0.0f; -} - -static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *vec, int cagevert) -{ - float dvec[3], ivec[3], wx, wy, wz, result=0.0f; - float weight, totweight= 0.0f; - int i, a, x, y, z; - - for(i=0; i<3; i++) { - ivec[i]= (int)gridvec[i]; - dvec[i]= gridvec[i] - ivec[i]; - } - - for(i=0; i<8; i++) { - if(i & 1) { x= ivec[0]+1; wx= dvec[0]; } - else { x= ivec[0]; wx= 1.0f-dvec[0]; } - - if(i & 2) { y= ivec[1]+1; wy= dvec[1]; } - else { y= ivec[1]; wy= 1.0f-dvec[1]; } - - if(i & 4) { z= ivec[2]+1; wz= dvec[2]; } - else { z= ivec[2]; wz= 1.0f-dvec[2]; } - - CLAMP(x, 0, mdb->size-1); - CLAMP(y, 0, mdb->size-1); - CLAMP(z, 0, mdb->size-1); - - a= meshdeform_index(mdb, x, y, z, 0); - weight= wx*wy*wz; - result += weight*mdb->phi[a]; - totweight += weight; - } - - if(totweight > 0.0f) - result /= totweight; - - return result; -} - -static void meshdeform_check_semibound(MeshDeformBind *mdb, int x, int y, int z) -{ - int i, a; - - a= meshdeform_index(mdb, x, y, z, 0); - if(mdb->tag[a] != MESHDEFORM_TAG_EXTERIOR) - return; - - for(i=1; i<=6; i++) - if(mdb->boundisect[a][i-1]) - mdb->semibound[a]= 1; -} - -static float meshdeform_boundary_total_weight(MeshDeformBind *mdb, int x, int y, int z) -{ - float weight, totweight= 0.0f; - int i, a; - - a= meshdeform_index(mdb, x, y, z, 0); - - /* count weight for neighbour cells */ - for(i=1; i<=6; i++) { - if(meshdeform_index(mdb, x, y, z, i) == -1) - continue; - - if(mdb->boundisect[a][i-1]) - weight= 1.0f/mdb->boundisect[a][i-1]->len; - else if(!mdb->semibound[a]) - weight= 1.0f/mdb->width[0]; - else - weight= 0.0f; - - totweight += weight; - } - - return totweight; -} - -static void meshdeform_matrix_add_cell(MeshDeformBind *mdb, int x, int y, int z) -{ - MDefBoundIsect *isect; - float weight, totweight; - int i, a, acenter; - - acenter= meshdeform_index(mdb, x, y, z, 0); - if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR) - return; - - nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[acenter], 1.0f); - - totweight= meshdeform_boundary_total_weight(mdb, x, y, z); - for(i=1; i<=6; i++) { - a= meshdeform_index(mdb, x, y, z, i); - if(a == -1 || mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR) - continue; - - isect= mdb->boundisect[acenter][i-1]; - if (!isect) { - weight= (1.0f/mdb->width[0])/totweight; - nlMatrixAdd(mdb->varidx[acenter], mdb->varidx[a], -weight); - } - } -} - -static void meshdeform_matrix_add_rhs(MeshDeformBind *mdb, int x, int y, int z, int cagevert) -{ - MDefBoundIsect *isect; - float rhs, weight, totweight; - int i, a, acenter; - - acenter= meshdeform_index(mdb, x, y, z, 0); - if(mdb->tag[acenter] == MESHDEFORM_TAG_EXTERIOR) - return; - - totweight= meshdeform_boundary_total_weight(mdb, x, y, z); - for(i=1; i<=6; i++) { - a= meshdeform_index(mdb, x, y, z, i); - if(a == -1) - continue; - - isect= mdb->boundisect[acenter][i-1]; - - if (isect) { - weight= (1.0f/isect->len)/totweight; - rhs= weight*meshdeform_boundary_phi(mdb, isect, cagevert); - nlRightHandSideAdd(0, mdb->varidx[acenter], rhs); - } - } -} - -static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert) -{ - MDefBoundIsect *isect; - float rhs, weight, totweight; - int i, a; - - a= meshdeform_index(mdb, x, y, z, 0); - if(!mdb->semibound[a]) - return; - - mdb->phi[a]= 0.0f; - - totweight= meshdeform_boundary_total_weight(mdb, x, y, z); - for(i=1; i<=6; i++) { - isect= mdb->boundisect[a][i-1]; - - if (isect) { - weight= (1.0f/isect->len)/totweight; - rhs= weight*meshdeform_boundary_phi(mdb, isect, cagevert); - mdb->phi[a] += rhs; - } - } -} - -static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert) -{ - float phi, totweight; - int i, a, acenter; - - acenter= meshdeform_index(mdb, x, y, z, 0); - if(mdb->tag[acenter] != MESHDEFORM_TAG_EXTERIOR || mdb->semibound[acenter]) - return; - - phi= 0.0f; - totweight= 0.0f; - for(i=1; i<=6; i++) { - a= meshdeform_index(mdb, x, y, z, i); - - if(a != -1 && mdb->semibound[a]) { - phi += mdb->phi[a]; - totweight += 1.0f; - } - } - - if(totweight != 0.0f) - mdb->phi[acenter]= phi/totweight; -} - -static void meshdeform_matrix_solve(MeshDeformBind *mdb) -{ - NLContext *context; - float vec[3], gridvec[3]; - int a, b, x, y, z, totvar; - char message[1024]; - - /* setup variable indices */ - mdb->varidx= MEM_callocN(sizeof(int)*mdb->size3, "MeshDeformDSvaridx"); - for(a=0, totvar=0; asize3; a++) - mdb->varidx[a]= (mdb->tag[a] == MESHDEFORM_TAG_EXTERIOR)? -1: totvar++; - - if(totvar == 0) { - MEM_freeN(mdb->varidx); - return; - } - - progress_bar(0, "Starting mesh deform solve"); - - /* setup opennl solver */ - nlNewContext(); - context= nlGetCurrent(); - - nlSolverParameteri(NL_NB_VARIABLES, totvar); - nlSolverParameteri(NL_NB_ROWS, totvar); - nlSolverParameteri(NL_NB_RIGHT_HAND_SIDES, 1); - - nlBegin(NL_SYSTEM); - nlBegin(NL_MATRIX); - - /* build matrix */ - for(z=0; zsize; z++) - for(y=0; ysize; y++) - for(x=0; xsize; x++) - meshdeform_matrix_add_cell(mdb, x, y, z); - - /* solve for each cage vert */ - for(a=0; atotcagevert; a++) { - if(a != 0) { - nlBegin(NL_SYSTEM); - nlBegin(NL_MATRIX); - } - - /* fill in right hand side and solve */ - for(z=0; zsize; z++) - for(y=0; ysize; y++) - for(x=0; xsize; x++) - meshdeform_matrix_add_rhs(mdb, x, y, z, a); - - nlEnd(NL_MATRIX); - nlEnd(NL_SYSTEM); - -#if 0 - nlPrintMatrix(); -#endif - - if(nlSolveAdvanced(NULL, NL_TRUE)) { - for(z=0; zsize; z++) - for(y=0; ysize; y++) - for(x=0; xsize; x++) - meshdeform_matrix_add_semibound_phi(mdb, x, y, z, a); - - for(z=0; zsize; z++) - for(y=0; ysize; y++) - for(x=0; xsize; x++) - meshdeform_matrix_add_exterior_phi(mdb, x, y, z, a); - - for(b=0; bsize3; b++) { - if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR) - mdb->phi[b]= nlGetVariable(0, mdb->varidx[b]); - mdb->totalphi[b] += mdb->phi[b]; - } - - if(mdb->weights) { - /* static bind : compute weights for each vertex */ - for(b=0; btotvert; b++) { - if(mdb->inside[b]) { - VECCOPY(vec, mdb->vertexcos[b]); - Mat4MulVecfl(mdb->cagemat, vec); - gridvec[0]= (vec[0] - mdb->min[0] - mdb->halfwidth[0])/mdb->width[0]; - gridvec[1]= (vec[1] - mdb->min[1] - mdb->halfwidth[1])/mdb->width[1]; - gridvec[2]= (vec[2] - mdb->min[2] - mdb->halfwidth[2])/mdb->width[2]; - - mdb->weights[b*mdb->totcagevert + a]= meshdeform_interp_w(mdb, gridvec, vec, a); - } - } - } - else { - MDefBindInfluence *inf; - - /* dynamic bind */ - for(b=0; bsize3; b++) { - if(mdb->phi[b] >= MESHDEFORM_MIN_INFLUENCE) { - inf= BLI_memarena_alloc(mdb->memarena, sizeof(*inf)); - inf->vertex= a; - inf->weight= mdb->phi[b]; - inf->next= mdb->dyngrid[b]; - mdb->dyngrid[b]= inf; - } - } - } - } - else { - error("Mesh Deform: failed to find solution."); - break; - } - - sprintf(message, "Mesh deform solve %d / %d |||", a+1, mdb->totcagevert); - progress_bar((float)(a+1)/(float)(mdb->totcagevert), message); - } - -#if 0 - /* sanity check */ - for(b=0; bsize3; b++) - if(mdb->tag[b] != MESHDEFORM_TAG_EXTERIOR) - if(fabs(mdb->totalphi[b] - 1.0f) > 1e-4) - printf("totalphi deficiency [%s|%d] %d: %.10f\n", - (mdb->tag[b] == MESHDEFORM_TAG_INTERIOR)? "interior": "boundary", mdb->semibound[b], mdb->varidx[b], mdb->totalphi[b]); -#endif - - /* free */ - MEM_freeN(mdb->varidx); - - nlDeleteContext(context); -} - -void harmonic_coordinates_bind(MeshDeformModifierData *mmd, float (*vertexcos)[3], int totvert, float cagemat[][4]) -{ - MeshDeformBind mdb; - MDefBindInfluence *inf; - MDefInfluence *mdinf; - MDefCell *cell; - MVert *mvert; - float center[3], vec[3], maxwidth, totweight; - int a, b, x, y, z, totinside, offset; - - waitcursor(1); - start_progress_bar(); - - memset(&mdb, 0, sizeof(MeshDeformBind)); - - /* get mesh and cage mesh */ - mdb.vertexcos= vertexcos; - mdb.totvert= totvert; - - mdb.cagedm= mesh_create_derived_no_deform(mmd->object, NULL, CD_MASK_BAREMESH); - mdb.totcagevert= mdb.cagedm->getNumVerts(mdb.cagedm); - mdb.cagecos= MEM_callocN(sizeof(*mdb.cagecos)*mdb.totcagevert, "MeshDeformBindCos"); - Mat4CpyMat4(mdb.cagemat, cagemat); - - mvert= mdb.cagedm->getVertArray(mdb.cagedm); - for(a=0; agridsize-1)) + 2; - mdb.size3= mdb.size*mdb.size*mdb.size; - mdb.tag= MEM_callocN(sizeof(int)*mdb.size3, "MeshDeformBindTag"); - mdb.phi= MEM_callocN(sizeof(float)*mdb.size3, "MeshDeformBindPhi"); - mdb.totalphi= MEM_callocN(sizeof(float)*mdb.size3, "MeshDeformBindTotalPhi"); - mdb.boundisect= MEM_callocN(sizeof(*mdb.boundisect)*mdb.size3, "MDefBoundIsect"); - mdb.semibound= MEM_callocN(sizeof(int)*mdb.size3, "MDefSemiBound"); - - mdb.inside= MEM_callocN(sizeof(int)*mdb.totvert, "MDefInside"); - - if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) - mdb.dyngrid= MEM_callocN(sizeof(MDefBindInfluence*)*mdb.size3, "MDefDynGrid"); - else - mdb.weights= MEM_callocN(sizeof(float)*mdb.totvert*mdb.totcagevert, "MDefWeights"); - - mdb.memarena= BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE); - BLI_memarena_use_calloc(mdb.memarena); - - /* make bounding box equal size in all directions, add padding, and compute - * width of the cells */ - maxwidth = -1.0f; - for(a=0; a<3; a++) - if(mdb.max[a]-mdb.min[a] > maxwidth) - maxwidth= mdb.max[a]-mdb.min[a]; - - for(a=0; a<3; a++) { - center[a]= (mdb.min[a]+mdb.max[a])*0.5f; - mdb.min[a]= center[a] - maxwidth*0.5f; - mdb.max[a]= center[a] + maxwidth*0.5f; - - mdb.width[a]= (mdb.max[a]-mdb.min[a])/(mdb.size-4); - mdb.min[a] -= 2.1f*mdb.width[a]; - mdb.max[a] += 2.1f*mdb.width[a]; - - mdb.width[a]= (mdb.max[a]-mdb.min[a])/mdb.size; - mdb.halfwidth[a]= mdb.width[a]*0.5f; - } - - progress_bar(0, "Setting up mesh deform system"); - -#if 0 - /* create ray tree */ - meshdeform_ray_tree_create(&mdb); -#endif - - totinside= 0; - for(a=0; abindcos= (float*)mdb.cagecos; - mmd->totvert= mdb.totvert; - mmd->totcagevert= mdb.totcagevert; - Mat4CpyMat4(mmd->bindmat, mmd->object->obmat); - - if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) { - mmd->totinfluence= 0; - for(a=0; anext) - mmd->totinfluence++; - - /* convert MDefBindInfluences to smaller MDefInfluences */ - mmd->dyngrid= MEM_callocN(sizeof(MDefCell)*mdb.size3, "MDefDynGrid"); - mmd->dyninfluences= MEM_callocN(sizeof(MDefInfluence)*mmd->totinfluence, "MDefInfluence"); - offset= 0; - for(a=0; adyngrid[a]; - cell->offset= offset; - - totweight= 0.0f; - mdinf= mmd->dyninfluences + cell->offset; - for(inf=mdb.dyngrid[a]; inf; inf=inf->next, mdinf++) { - mdinf->weight= inf->weight; - mdinf->vertex= inf->vertex; - totweight += mdinf->weight; - cell->totinfluence++; - } - - if(totweight > 0.0f) { - mdinf= mmd->dyninfluences + cell->offset; - for(b=0; btotinfluence; b++, mdinf++) - mdinf->weight /= totweight; - } - - offset += cell->totinfluence; - } - - mmd->dynverts= mdb.inside; - mmd->dyngridsize= mdb.size; - VECCOPY(mmd->dyncellmin, mdb.min); - mmd->dyncellwidth= mdb.width[0]; - MEM_freeN(mdb.dyngrid); - } - else { - mmd->bindweights= mdb.weights; - MEM_freeN(mdb.inside); - } - - /* transform bindcos to world space */ - for(a=0; aobject->obmat, mmd->bindcos+a*3); - - /* free */ - mdb.cagedm->release(mdb.cagedm); - MEM_freeN(mdb.tag); - MEM_freeN(mdb.phi); - MEM_freeN(mdb.totalphi); - MEM_freeN(mdb.boundisect); - MEM_freeN(mdb.semibound); - BLI_memarena_free(mdb.memarena); - - end_progress_bar(); - waitcursor(0); -} - diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c deleted file mode 100644 index bcf07c9b594..00000000000 --- a/source/blender/src/meshtools.c +++ /dev/null @@ -1,1132 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* - -meshtools.c: no editmode, tools operating on meshes - -int join_mesh(void); - -void fasterdraw(void); -void slowerdraw(void); - -void sort_faces(void); - -*/ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_image_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_material_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BKE_depsgraph.h" -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_material.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_editmesh.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_editconstraint.h" - -#include "BDR_drawmesh.h" -#include "BDR_editobject.h" -#include "BDR_editface.h" -#include "BDR_sculptmode.h" - -#include "BLI_editVert.h" -#include "BLI_ghash.h" -#include "BLI_threads.h" -#include "BLI_rand.h" /* for randome face sorting */ - -#include "mydevice.h" -#include "blendef.h" - -#include "BIF_meshtools.h" /* include ourself for prototypes */ - -#include "RE_pipeline.h" -#include "RE_shader_ext.h" - -#include "PIL_time.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -/* from rendercode.c */ -#define VECMUL(dest, f) dest[0]*= f; dest[1]*= f; dest[2]*= f - -/* * ********************** no editmode!!! *********** */ - -/* join selected meshes into the active mesh, context sensitive -return 0 if no join is made (error) and 1 of the join is done */ -int join_mesh(void) -{ - Base *base, *nextb; - Object *ob; - Material **matar, *ma; - Mesh *me; - MVert *mvert, *mvertmain; - MEdge *medge = NULL, *medgemain; - MFace *mface = NULL, *mfacemain; - float imat[4][4], cmat[4][4]; - int a, b, totcol, totedge=0, totvert=0, totface=0, ok=0, vertofs, map[MAXMAT]; - int i, j, index, haskey=0, hasmulti=0, edgeofs, faceofs; - bDeformGroup *dg, *odg; - MDeformVert *dvert; - CustomData vdata, edata, fdata; - - if(G.obedit) return 0; - - ob= OBACT; - if(!ob || ob->type!=OB_MESH) return 0; - - if (object_data_is_libdata(ob)) { - error_libdata(); - return 0; - } - -#ifdef WITH_VERSE - /* it isn't allowed to join shared object at verse server - * this function will be implemented as soon as possible */ - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base->object->type==OB_MESH) { - if(base->object->vnode) { - haskey= 1; - break; - } - } - } - base= base->next; - } - if(haskey) { - error("Can't join meshes shared at verse server"); - return 0; - } -#endif - - /* count & check */ - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(base->object->type==OB_MESH) { - me= base->object->data; - totvert+= me->totvert; - totface+= me->totface; - - if(base->object == ob) ok= 1; - - if(me->key) { - haskey= 1; - break; - } - if(me->mr) { - hasmulti= 1; - break; - } - } - } - base= base->next; - } - - if(haskey) { - error("Can't join meshes with vertex keys"); - return 0; - } - if(hasmulti) { - error("Can't join meshes with Multires"); - return 0; - } - /* that way the active object is always selected */ - if(ok==0) return 0; - - if(totvert==0 || totvert>MESH_MAX_VERTS) return 0; - - /* if needed add edges to other meshes */ - for(base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { - if(base->object->type==OB_MESH) { - me= base->object->data; - totedge += me->totedge; - } - } - } - - /* new material indices and material array */ - matar= MEM_callocN(sizeof(void *)*MAXMAT, "join_mesh"); - totcol= ob->totcol; - - /* obact materials in new main array, is nicer start! */ - for(a=1; a<=ob->totcol; a++) { - matar[a-1]= give_current_material(ob, a); - id_us_plus((ID *)matar[a-1]); - /* increase id->us : will be lowered later */ - } - - base= FIRSTBASE; - while(base) { - if TESTBASELIB(base) { - if(ob!=base->object && base->object->type==OB_MESH) { - me= base->object->data; - - // Join this object's vertex groups to the base one's - for (dg=base->object->defbase.first; dg; dg=dg->next){ - /* See if this group exists in the object */ - for (odg=ob->defbase.first; odg; odg=odg->next){ - if (!strcmp(odg->name, dg->name)){ - break; - } - } - if (!odg){ - odg = MEM_callocN (sizeof(bDeformGroup), "join deformGroup"); - memcpy (odg, dg, sizeof(bDeformGroup)); - BLI_addtail(&ob->defbase, odg); - } - - } - if (ob->defbase.first && ob->actdef==0) - ob->actdef=1; - - if(me->totvert) { - for(a=1; a<=base->object->totcol; a++) { - ma= give_current_material(base->object, a); - if(ma) { - for(b=0; bid.us++; - totcol++; - } - if(totcol>=MAXMAT-1) break; - } - } - } - } - if(totcol>=MAXMAT-1) break; - } - base= base->next; - } - - me= ob->data; - - memset(&vdata, 0, sizeof(vdata)); - memset(&edata, 0, sizeof(edata)); - memset(&fdata, 0, sizeof(fdata)); - - mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert); - medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); - mface= CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface); - - mvertmain= mvert; - medgemain= medge; - mfacemain= mface; - - /* inverse transorm all selected meshes in this object */ - Mat4Invert(imat, ob->obmat); - - vertofs= 0; - edgeofs= 0; - faceofs= 0; - base= FIRSTBASE; - while(base) { - nextb= base->next; - if TESTBASELIB(base) { - if(base->object->type==OB_MESH) { - - me= base->object->data; - - if(me->totvert) { - CustomData_merge(&me->vdata, &vdata, CD_MASK_MESH, CD_DEFAULT, totvert); - CustomData_copy_data(&me->vdata, &vdata, 0, vertofs, me->totvert); - - dvert= CustomData_get(&vdata, vertofs, CD_MDEFORMVERT); - - /* NEW VERSION */ - if (dvert){ - for (i=0; itotvert; i++){ - for (j=0; jobject->defbase, dvert[i].dw[j].def_nr); - if(odg) { - // Search for a match in the new object - for (dg=ob->defbase.first, index=0; dg; dg=dg->next, index++){ - if (!strcmp(dg->name, odg->name)){ - dvert[i].dw[j].def_nr = index; - break; - } - } - } - } - } - } - - if(base->object != ob) { - /* watch this: switch matmul order really goes wrong */ - Mat4MulMat4(cmat, base->object->obmat, imat); - - a= me->totvert; - while(a--) { - Mat4MulVecfl(cmat, mvert->co); - mvert++; - } - } - else mvert+= me->totvert; - } - if(me->totface) { - - /* make mapping for materials */ - memset(map, 0, 4*MAXMAT); - for(a=1; a<=base->object->totcol; a++) { - ma= give_current_material(base->object, a); - if(ma) { - for(b=0; bfdata, &fdata, CD_MASK_MESH, CD_DEFAULT, totface); - CustomData_copy_data(&me->fdata, &fdata, 0, faceofs, me->totface); - - for(a=0; atotface; a++, mface++) { - mface->v1+= vertofs; - mface->v2+= vertofs; - mface->v3+= vertofs; - if(mface->v4) mface->v4+= vertofs; - - mface->mat_nr= map[(int)mface->mat_nr]; - } - - faceofs += me->totface; - } - - if(me->totedge) { - CustomData_merge(&me->edata, &edata, CD_MASK_MESH, CD_DEFAULT, totedge); - CustomData_copy_data(&me->edata, &edata, 0, edgeofs, me->totedge); - - for(a=0; atotedge; a++, medge++) { - medge->v1+= vertofs; - medge->v2+= vertofs; - } - - edgeofs += me->totedge; - } - - vertofs += me->totvert; - - if(base->object!=ob) - free_and_unlink_base(base); - } - } - base= nextb; - } - - me= ob->data; - - CustomData_free(&me->vdata, me->totvert); - CustomData_free(&me->edata, me->totedge); - CustomData_free(&me->fdata, me->totface); - - me->totvert= totvert; - me->totedge= totedge; - me->totface= totface; - - me->vdata= vdata; - me->edata= edata; - me->fdata= fdata; - - mesh_update_customdata_pointers(me); - - /* old material array */ - for(a=1; a<=ob->totcol; a++) { - ma= ob->mat[a-1]; - if(ma) ma->id.us--; - } - for(a=1; a<=me->totcol; a++) { - ma= me->mat[a-1]; - if(ma) ma->id.us--; - } - if(ob->mat) MEM_freeN(ob->mat); - if(me->mat) MEM_freeN(me->mat); - ob->mat= me->mat= 0; - - if(totcol) { - me->mat= matar; - ob->mat= MEM_callocN(sizeof(void *)*totcol, "join obmatar"); - } - else MEM_freeN(matar); - - ob->totcol= me->totcol= totcol; - ob->colbits= 0; - - /* other mesh users */ - test_object_materials((ID *)me); - - DAG_scene_sort(G.scene); // removed objects, need to rebuild dag before editmode call - - enter_editmode(EM_WAITCURSOR); - exit_editmode(EM_FREEDATA|EM_WAITCURSOR); // freedata, but no undo - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSSHADING, 0); - - BIF_undo_push("Join Mesh"); - return 1; -} - - -/* ********************** SORT FACES ******************* */ - -static void permutate(void *list, int num, int size, int *index) -{ - void *buf; - int len; - int i; - - len = num * size; - - buf = MEM_mallocN(len, "permutate"); - memcpy(buf, list, len); - - for (i = 0; i < num; i++) { - memcpy((char *)list + (i * size), (char *)buf + (index[i] * size), size); - } - MEM_freeN(buf); -} - -/* sort faces on view axis */ -static float *face_sort_floats; -static int float_sort(const void *v1, const void *v2) -{ - float x1, x2; - - x1 = face_sort_floats[((int *) v1)[0]]; - x2 = face_sort_floats[((int *) v2)[0]]; - - if( x1 > x2 ) return 1; - else if( x1 < x2 ) return -1; - return 0; -} - - -void sort_faces(void) -{ - Object *ob= OBACT; - Mesh *me; - CustomDataLayer *layer; - int i, *index; - short event; - float reverse = 1; - - if(!ob) return; - if(G.obedit) return; - if(ob->type!=OB_MESH) return; - if (!G.vd) return; - - me= ob->data; - if(me->totface==0) return; - - event = pupmenu( - "Sort Faces (Ctrl to reverse)%t|" - "View Axis%x1|" - "Cursor Distance%x2|" - "Material%x3|" - "Selection%x4|" - "Randomize%x5"); - - if (event==-1) return; - - if(G.qual & LR_CTRLKEY) - reverse = -1; - -/* create index list */ - index = (int *) MEM_mallocN(sizeof(int) * me->totface, "sort faces"); - for (i = 0; i < me->totface; i++) { - index[i] = i; - } - - face_sort_floats = (float *) MEM_mallocN(sizeof(float) * me->totface, "sort faces float"); - -/* sort index list instead of faces itself - and apply this permutation to all face layers */ - - if (event == 5) { - /* Random */ - for(i=0; itotface; i++) { - face_sort_floats[i] = BLI_frand(); - } - qsort(index, me->totface, sizeof(int), float_sort); - } else { - MFace *mf; - float vec[3]; - float mat[4][4]; - float cur[3]; - - if (event == 1) - Mat4MulMat4(mat, OBACT->obmat, G.vd->viewmat); /* apply the view matrix to the object matrix */ - else if (event == 2) { /* sort from cursor */ - if( G.vd && G.vd->localview ) { - VECCOPY(cur, G.vd->cursor); - } else { - VECCOPY(cur, G.scene->cursor); - } - Mat4Invert(mat, OBACT->obmat); - Mat4MulVecfl(mat, cur); - } - - mf= me->mface; - for(i=0; itotface; i++, mf++) { - - if (event==3) { - face_sort_floats[i] = ((float)mf->mat_nr)*reverse; - } else if (event==4) { - /*selected first*/ - if (mf->flag & ME_FACE_SEL) face_sort_floats[i] = 0.0; - else face_sort_floats[i] = reverse; - } else { - /* find the faces center */ - VECADD(vec, (me->mvert+mf->v1)->co, (me->mvert+mf->v2)->co); - if (mf->v4) { - VECADD(vec, vec, (me->mvert+mf->v3)->co); - VECADD(vec, vec, (me->mvert+mf->v4)->co); - VECMUL(vec, 0.25f); - } else { - VECADD(vec, vec, (me->mvert+mf->v3)->co); - VECMUL(vec, 1.0f/3.0f); - } /* done */ - - if (event == 1) { /* sort on view axis */ - Mat4MulVecfl(mat, vec); - face_sort_floats[i] = vec[2] * reverse; - } else { /* distance from cursor*/ - face_sort_floats[i] = VecLenf(cur, vec) * reverse; /* back to front */ - } - } - } - qsort(index, me->totface, sizeof(int), float_sort); - } - - MEM_freeN(face_sort_floats); - - for(i = 0; i < me->fdata.totlayer; i++) { - layer = &me->fdata.layers[i]; - permutate(layer->data, me->totface, CustomData_sizeof(layer->type), index); - } - - MEM_freeN(index); - - allqueue(REDRAWVIEW3D, 0); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); -} - - - -/* ********************* MESH VERTEX OCTREE LOOKUP ************* */ - -/* important note; this is unfinished, needs better API for editmode, and custom threshold */ - -#define MOC_RES 8 -#define MOC_NODE_RES 8 -#define MOC_THRESH 0.0002f - -typedef struct MocNode { - struct MocNode *next; - long index[MOC_NODE_RES]; -} MocNode; - -static int mesh_octree_get_base_offs(float *co, float *offs, float *div) -{ - int vx, vy, vz; - - vx= floor( (co[0]-offs[0])/div[0] ); - vy= floor( (co[1]-offs[1])/div[1] ); - vz= floor( (co[2]-offs[2])/div[2] ); - - CLAMP(vx, 0, MOC_RES-1); - CLAMP(vy, 0, MOC_RES-1); - CLAMP(vz, 0, MOC_RES-1); - - return (vx*MOC_RES*MOC_RES) + vy*MOC_RES + vz; -} - -static void mesh_octree_add_node(MocNode **bt, long index) -{ - if(*bt==NULL) { - *bt= MEM_callocN(sizeof(MocNode), "MocNode"); - (*bt)->index[0]= index; - } - else { - int a; - for(a=0; aindex[a]==index) - return; - else if((*bt)->index[a]==0) { - (*bt)->index[a]= index; - return; - } - } - mesh_octree_add_node(&(*bt)->next, index); - } -} - -static void mesh_octree_free_node(MocNode **bt) -{ - if( (*bt)->next ) { - mesh_octree_free_node(&(*bt)->next); - } - MEM_freeN(*bt); -} - - -/* temporal define, just to make nicer code below */ -#define MOC_ADDNODE(vx, vy, vz) mesh_octree_add_node(basetable + ((vx)*MOC_RES*MOC_RES) + (vy)*MOC_RES + (vz), index) - -static void mesh_octree_add_nodes(MocNode **basetable, float *co, float *offs, float *div, long index) -{ - float fx, fy, fz; - int vx, vy, vz; - - fx= (co[0]-offs[0])/div[0]; - fy= (co[1]-offs[1])/div[1]; - fz= (co[2]-offs[2])/div[2]; - CLAMP(fx, 0.0f, MOC_RES-MOC_THRESH); - CLAMP(fy, 0.0f, MOC_RES-MOC_THRESH); - CLAMP(fz, 0.0f, MOC_RES-MOC_THRESH); - - vx= floor(fx); - vy= floor(fy); - vz= floor(fz); - - MOC_ADDNODE(vx, vy, vz); - - if( vx>0 ) - if( fx-((float)vx)-MOC_THRESH < 0.0f) - MOC_ADDNODE(vx-1, vy, vz); - if( vx 1.0f) - MOC_ADDNODE(vx+1, vy, vz); - - if( vy>0 ) - if( fy-((float)vy)-MOC_THRESH < 0.0f) - MOC_ADDNODE(vx, vy-1, vz); - if( vy 1.0f) - MOC_ADDNODE(vx, vy+1, vz); - - if( vz>0 ) - if( fz-((float)vz)-MOC_THRESH < 0.0f) - MOC_ADDNODE(vx, vy, vz-1); - if( vz 1.0f) - MOC_ADDNODE(vx, vy, vz+1); - -} - -static long mesh_octree_find_index(MocNode **bt, float (*orco)[3], MVert *mvert, float *co) -{ - float *vec; - int a; - - if(*bt==NULL) - return -1; - - for(a=0; aindex[a]) { - /* does mesh verts and editmode, code looks potential dangerous, octree should really be filled OK! */ - if(orco) { - vec= orco[(*bt)->index[a]-1]; - if(FloatCompare(vec, co, MOC_THRESH)) - return (*bt)->index[a]-1; - } - else if(mvert) { - vec= (mvert+(*bt)->index[a]-1)->co; - if(FloatCompare(vec, co, MOC_THRESH)) - return (*bt)->index[a]-1; - } - else { - EditVert *eve= (EditVert *)((*bt)->index[a]); - if(FloatCompare(eve->co, co, MOC_THRESH)) - return (*bt)->index[a]; - } - } - else return -1; - } - if( (*bt)->next) - return mesh_octree_find_index(&(*bt)->next, orco, mvert, co); - - return -1; -} - -static struct { - MocNode **table; - float offs[3], div[3]; - float (*orco)[3]; - float orcoloc[3]; -} MeshOctree = {NULL, {0, 0, 0}, {0, 0, 0}, NULL}; - -/* mode is 's' start, or 'e' end, or 'u' use */ -/* if end, ob can be NULL */ -long mesh_octree_table(Object *ob, float *co, char mode) -{ - MocNode **bt; - - if(mode=='u') { /* use table */ - if(MeshOctree.table==NULL) - mesh_octree_table(ob, NULL, 's'); - - if(MeshOctree.table) { - Mesh *me= ob->data; - bt= MeshOctree.table + mesh_octree_get_base_offs(co, MeshOctree.offs, MeshOctree.div); - if(ob==G.obedit) - return mesh_octree_find_index(bt, NULL, NULL, co); - else - return mesh_octree_find_index(bt, MeshOctree.orco, me->mvert, co); - } - return -1; - } - else if(mode=='s') { /* start table */ - Mesh *me= ob->data; - float min[3], max[3]; - - /* we compute own bounding box and don't reuse ob->bb because - * we are using the undeformed coordinates*/ - INIT_MINMAX(min, max); - - if(ob==G.obedit) { - EditVert *eve; - - for(eve= G.editMesh->verts.first; eve; eve= eve->next) - DO_MINMAX(eve->co, min, max) - } - else { - MVert *mvert; - float *co; - int a, totvert; - - MeshOctree.orco= mesh_getRefKeyCos(me, &totvert); - mesh_get_texspace(me, MeshOctree.orcoloc, NULL, NULL); - - for(a=0, mvert= me->mvert; atotvert; a++, mvert++) { - co= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co; - DO_MINMAX(co, min, max); - } - } - - /* for quick unit coordinate calculus */ - VECCOPY(MeshOctree.offs, min); - MeshOctree.offs[0]-= MOC_THRESH; /* we offset it 1 threshold unit extra */ - MeshOctree.offs[1]-= MOC_THRESH; - MeshOctree.offs[2]-= MOC_THRESH; - - VecSubf(MeshOctree.div, max, min); - MeshOctree.div[0]+= 2*MOC_THRESH; /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */ - MeshOctree.div[1]+= 2*MOC_THRESH; - MeshOctree.div[2]+= 2*MOC_THRESH; - - VecMulf(MeshOctree.div, 1.0f/MOC_RES); - if(MeshOctree.div[0]==0.0f) MeshOctree.div[0]= 1.0f; - if(MeshOctree.div[1]==0.0f) MeshOctree.div[1]= 1.0f; - if(MeshOctree.div[2]==0.0f) MeshOctree.div[2]= 1.0f; - - if(MeshOctree.table) /* happens when entering this call without ending it */ - mesh_octree_table(ob, co, 'e'); - - MeshOctree.table= MEM_callocN(MOC_RES*MOC_RES*MOC_RES*sizeof(void *), "sym table"); - - if(ob==G.obedit) { - EditVert *eve; - - for(eve= G.editMesh->verts.first; eve; eve= eve->next) { - mesh_octree_add_nodes(MeshOctree.table, eve->co, MeshOctree.offs, MeshOctree.div, (long)(eve)); - } - } - else { - MVert *mvert; - float *co; - int a; - - for(a=0, mvert= me->mvert; atotvert; a++, mvert++) { - co= (MeshOctree.orco)? MeshOctree.orco[a]: mvert->co; - mesh_octree_add_nodes(MeshOctree.table, co, MeshOctree.offs, MeshOctree.div, a+1); - } - } - } - else if(mode=='e') { /* end table */ - if(MeshOctree.table) { - int a; - - for(a=0, bt=MeshOctree.table; adata; - MVert *mvert; - float vec[3]; - - if(MeshOctree.orco) { - float *loc= MeshOctree.orcoloc; - - vec[0]= -(MeshOctree.orco[index][0] + loc[0]) - loc[0]; - vec[1]= MeshOctree.orco[index][1]; - vec[2]= MeshOctree.orco[index][2]; - } - else { - mvert= me->mvert+index; - vec[0]= -mvert->co[0]; - vec[1]= mvert->co[1]; - vec[2]= mvert->co[2]; - } - - return mesh_octree_table(ob, vec, 'u'); -} - -EditVert *editmesh_get_x_mirror_vert(Object *ob, float *co) -{ - float vec[3]; - long poinval; - - vec[0]= -co[0]; - vec[1]= co[1]; - vec[2]= co[2]; - - poinval= mesh_octree_table(ob, vec, 'u'); - if(poinval != -1) - return (EditVert *)(poinval); - return NULL; -} - -static unsigned int mirror_facehash(void *ptr) -{ - MFace *mf= ptr; - int v0, v1; - - if(mf->v4) { - v0= MIN4(mf->v1, mf->v2, mf->v3, mf->v4); - v1= MAX4(mf->v1, mf->v2, mf->v3, mf->v4); - } - else { - v0= MIN3(mf->v1, mf->v2, mf->v3); - v1= MAX3(mf->v1, mf->v2, mf->v3); - } - - return ((v0*39)^(v1*31)); -} - -static int mirror_facerotation(MFace *a, MFace *b) -{ - if(b->v4) { - if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3 && a->v4==b->v4) - return 0; - else if(a->v4==b->v1 && a->v1==b->v2 && a->v2==b->v3 && a->v3==b->v4) - return 1; - else if(a->v3==b->v1 && a->v4==b->v2 && a->v1==b->v3 && a->v2==b->v4) - return 2; - else if(a->v2==b->v1 && a->v3==b->v2 && a->v4==b->v3 && a->v1==b->v4) - return 3; - } - else { - if(a->v1==b->v1 && a->v2==b->v2 && a->v3==b->v3) - return 0; - else if(a->v3==b->v1 && a->v1==b->v2 && a->v2==b->v3) - return 1; - else if(a->v2==b->v1 && a->v3==b->v2 && a->v1==b->v3) - return 2; - } - - return -1; -} - -static int mirror_facecmp(void *a, void *b) -{ - return (mirror_facerotation((MFace*)a, (MFace*)b) == -1); -} - -int *mesh_get_x_mirror_faces(Object *ob) -{ - Mesh *me= ob->data; - MVert *mv, *mvert= me->mvert; - MFace mirrormf, *mf, *hashmf, *mface= me->mface; - GHash *fhash; - int *mirrorverts, *mirrorfaces; - int a; - - mirrorverts= MEM_callocN(sizeof(int)*me->totvert, "MirrorVerts"); - mirrorfaces= MEM_callocN(sizeof(int)*2*me->totface, "MirrorFaces"); - - mesh_octree_table(ob, NULL, 's'); - - for(a=0, mv=mvert; atotvert; a++, mv++) - mirrorverts[a]= mesh_get_x_mirror_vert(ob, a); - - mesh_octree_table(ob, NULL, 'e'); - - fhash= BLI_ghash_new(mirror_facehash, mirror_facecmp); - for(a=0, mf=mface; atotface; a++, mf++) - BLI_ghash_insert(fhash, mf, mf); - - for(a=0, mf=mface; atotface; a++, mf++) { - mirrormf.v1= mirrorverts[mf->v3]; - mirrormf.v2= mirrorverts[mf->v2]; - mirrormf.v3= mirrorverts[mf->v1]; - mirrormf.v4= (mf->v4)? mirrorverts[mf->v4]: 0; - - hashmf= BLI_ghash_lookup(fhash, &mirrormf); - if(hashmf) { - mirrorfaces[a*2]= hashmf - mface; - mirrorfaces[a*2+1]= mirror_facerotation(&mirrormf, hashmf); - } - else - mirrorfaces[a*2]= -1; - } - - BLI_ghash_free(fhash, NULL, NULL); - MEM_freeN(mirrorverts); - - return mirrorfaces; -} - -/* ****************** render BAKING ********************** */ - -/* threaded break test */ -static volatile int g_break= 0; -static int thread_break(void) -{ - return g_break; -} - -static ScrArea *biggest_image_area(void) -{ - ScrArea *sa, *big= NULL; - int size, maxsize= 0; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_IMAGE) { - size= sa->winx*sa->winy; - if(sa->winx > 10 && sa->winy > 10 && size > maxsize) { - maxsize= size; - big= sa; - } - } - } - return big; -} - - -typedef struct BakeRender { - Render *re; - struct Object *actob; - int event, tot, ready; -} BakeRender; - -static void *do_bake_render(void *bake_v) -{ - BakeRender *bkr= bake_v; - - bkr->tot= RE_bake_shade_all_selected(bkr->re, bkr->event, bkr->actob); - bkr->ready= 1; - - return NULL; -} - - -void objects_bake_render_menu(void) -{ - short event; - - event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4"); - - objects_bake_render(event); -} - -/* all selected meshes with UV maps are rendered for current scene visibility */ -void objects_bake_render(short event) -{ - Object *actob= OBACT; - int active= G.scene->r.bake_flag & R_BAKE_TO_ACTIVE; - short prev_r_raytrace= 0, prev_wo_amb_occ= 0; - - if(event==0) event= G.scene->r.bake_mode; - - if(G.scene->r.renderer!=R_INTERN) { - error("Bake only supported for Internal Renderer"); - return; - } - - if(active && !actob) - return; - - if(event>0) { - Render *re= RE_NewRender("_Bake View_"); - ScrArea *area= biggest_image_area(); - ListBase threads; - BakeRender bkr; - int timer=0, tot, sculptmode= G.f & G_SCULPTMODE; - - if(sculptmode) set_sculptmode(); - - if(event==1) event= RE_BAKE_ALL; - else if(event==2) event= RE_BAKE_AO; - else if(event==3) event= RE_BAKE_NORMALS; - else event= RE_BAKE_TEXTURE; - - if(event==RE_BAKE_AO) { - if(G.scene->world==NULL) { - error("No world set up"); - return; - } - - /* If raytracing or AO is disabled, switch it on temporarily for baking. */ - prev_wo_amb_occ = (G.scene->world->mode & WO_AMB_OCC) != 0; - G.scene->world->mode |= WO_AMB_OCC; - } - if(event==RE_BAKE_AO || active) { - prev_r_raytrace = (G.scene->r.mode & R_RAYTRACE) != 0; - G.scene->r.mode |= R_RAYTRACE; - } - - waitcursor(1); - RE_test_break_cb(re, thread_break); - g_break= 0; - G.afbreek= 0; /* blender_test_break uses this global */ - - RE_Database_Baking(re, G.scene, event, (active)? actob: NULL); - - /* baking itself is threaded, cannot use test_break in threads. we also update optional imagewindow */ - - BLI_init_threads(&threads, do_bake_render, 1); - bkr.re= re; - bkr.event= event; - bkr.ready= 0; - bkr.actob= (active)? actob: NULL; - BLI_insert_thread(&threads, &bkr); - - while(bkr.ready==0) { - PIL_sleep_ms(50); - if(bkr.ready) - break; - - g_break= blender_test_break(); - - timer++; - if(area && timer==20) { - Image *ima= RE_bake_shade_get_image(); - if(ima) ((SpaceImage *)area->spacedata.first)->image= ima; - scrarea_do_windraw(area); - myswapbuffers(); - timer= 0; - } - } - BLI_end_threads(&threads); - tot= bkr.tot; - - RE_Database_Free(re); - waitcursor(0); - - if(tot==0) error("No Images found to bake to"); - else { - Image *ima; - /* force OpenGL reload and mipmap recalc */ - for(ima= G.main->image.first; ima; ima= ima->id.next) { - if(ima->ok==IMA_OK_LOADED) { - ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); - if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) { - free_realtime_image(ima); - imb_freemipmapImBuf(ibuf); - } - } - } - } - - /* restore raytrace and AO */ - if(event==RE_BAKE_AO) - if(prev_wo_amb_occ == 0) - G.scene->world->mode &= ~WO_AMB_OCC; - - if(event==RE_BAKE_AO || active) - if(prev_r_raytrace == 0) - G.scene->r.mode &= ~R_RAYTRACE; - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - - if(sculptmode) set_sculptmode(); - - } -} - diff --git a/source/blender/src/multires-firstlevel.c b/source/blender/src/multires-firstlevel.c deleted file mode 100644 index 2be867b5db0..00000000000 --- a/source/blender/src/multires-firstlevel.c +++ /dev/null @@ -1,410 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Deals with the first-level data in multires (edge flags, weights, and UVs) - * - * multires.h - * - */ - -#include "DNA_customdata_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - -#include "BIF_editmesh.h" - -#include "BKE_customdata.h" -#include "BKE_global.h" -#include "BKE_mesh.h" - -#include "BLI_editVert.h" - -#include "MEM_guardedalloc.h" - -#include "blendef.h" -#include "multires.h" - -#include - -MDeformVert *subdivide_dverts(MDeformVert *src, MultiresLevel *lvl); -MTFace *subdivide_mtfaces(MTFace *src, MultiresLevel *lvl); -void multires_update_edge_flags(Mesh *me, EditMesh *em); -void eed_to_medge_flag(EditEdge *eed, short *flag, char *crease); - -/*********** Generic ***********/ - -CustomDataMask cdmask(const int type) -{ - if(type == CD_MDEFORMVERT) - return CD_MASK_MDEFORMVERT; - else if(type == CD_MTFACE) - return CD_MASK_MTFACE; - return -1; -} - -char type_ok(const int type) -{ - return (type == CD_MDEFORMVERT) || (type == CD_MTFACE); -} - -/* Copy vdata or fdata from Mesh or EditMesh to Multires. */ -void multires_update_customdata(MultiresLevel *lvl1, CustomData *src, CustomData *dst, const int type) -{ - if(src && dst && type_ok(type)) { - const int tot= (type == CD_MDEFORMVERT ? lvl1->totvert : lvl1->totface); - int i; - - CustomData_free(dst, tot); - - if(CustomData_has_layer(src, type)) { - if(G.obedit) { - EditVert *eve= G.editMesh->verts.first; - EditFace *efa= G.editMesh->faces.first; - CustomData_copy(src, dst, cdmask(type), CD_CALLOC, tot); - for(i=0; ivdata, dst, eve->data, i); - eve= eve->next; - } - else if(type == CD_MTFACE) { - CustomData_from_em_block(&G.editMesh->fdata, dst, efa->data, i); - efa= efa->next; - } - } - } - else - CustomData_copy(src, dst, cdmask(type), CD_DUPLICATE, tot); - } - } -} - -/* Uses subdivide_dverts or subdivide_mtfaces to subdivide src to match lvl_end. Does not free src. */ -void *subdivide_customdata_to_level(void *src, MultiresLevel *lvl_start, - MultiresLevel *lvl_end, const int type) -{ - if(src && lvl_start && lvl_end && type_ok(type)) { - MultiresLevel *lvl; - void *cr_data= NULL, *pr_data= NULL; - - pr_data= src; - for(lvl= lvl_start; lvl && lvl != lvl_end; lvl= lvl->next) { - if(type == CD_MDEFORMVERT) - cr_data= subdivide_dverts(pr_data, lvl); - else if(type == CD_MTFACE) - cr_data= subdivide_mtfaces(pr_data, lvl); - - /* Free previous subdivision level's data */ - if(lvl != lvl_start) { - if(type == CD_MDEFORMVERT) - free_dverts(pr_data, lvl->totvert); - else if(type == CD_MTFACE) - MEM_freeN(pr_data); - } - - pr_data= cr_data; - cr_data= NULL; - } - - return pr_data; - } - - return NULL; -} - -/* Directly copy src into dst (handles both Mesh and EditMesh) */ -void customdata_to_mesh(Mesh *me, EditMesh *em, CustomData *src, CustomData *dst, const int tot, const int type) -{ - if(me && me->mr && src && dst && type_ok(type)) { - if(em) { - int i; - EditVert *eve= em->verts.first; - EditFace *efa= em->faces.first; - CustomData_copy(src, dst, cdmask(type), CD_CALLOC, 0); - - for(i=0; idata); - eve= eve->next; - } - else if(type == CD_MTFACE) { - CustomData_to_em_block(src, dst, i, &efa->data); - efa= efa->next; - } - } - } else { - CustomData_merge(src, dst, cdmask(type), CD_DUPLICATE, tot); - } - } -} - -/* Subdivide vdata or fdata from Multires into either Mesh or EditMesh. */ -void multires_customdata_to_mesh(Mesh *me, EditMesh *em, MultiresLevel *lvl, CustomData *src, - CustomData *dst, const int type) -{ - if(me && me->mr && lvl && src && dst && type_ok(type) && - CustomData_has_layer(src, type)) { - const int tot= (type == CD_MDEFORMVERT ? lvl->totvert : lvl->totface); - if(lvl == me->mr->levels.first) { - customdata_to_mesh(me, em, src, dst, tot, type); - } - else { - CustomData cdf; - const int count = CustomData_number_of_layers(src, type); - int i; - - /* Construct a new CustomData containing the subdivided data */ - CustomData_copy(src, &cdf, cdmask(type), CD_ASSIGN, tot); - for(i=0; imr->levels.first, lvl, type)); - } - - customdata_to_mesh(me, em, &cdf, dst, tot, type); - CustomData_free(&cdf, tot); - } - } -} - -/* Subdivide the first-level customdata up to cr_lvl, then delete the original data */ -void multires_del_lower_customdata(Multires *mr, MultiresLevel *cr_lvl) -{ - MultiresLevel *lvl1= mr->levels.first; - MDeformVert *dverts= NULL; - CustomData cdf; - int i; - - /* dverts */ - dverts= subdivide_customdata_to_level(CustomData_get(&mr->vdata, 0, CD_MDEFORMVERT), - lvl1, cr_lvl, CD_MDEFORMVERT); - if(dverts) { - CustomData_free_layers(&mr->vdata, CD_MDEFORMVERT, lvl1->totvert); - CustomData_add_layer(&mr->vdata, CD_MDEFORMVERT, CD_ASSIGN, dverts, cr_lvl->totvert); - } - - /* mtfaces */ - CustomData_copy(&mr->fdata, &cdf, CD_MASK_MTFACE, CD_ASSIGN, cr_lvl->totface); - for(i=0; ifdata, CD_MTFACE); ++i) { - MTFace *mtfaces= - subdivide_customdata_to_level(CustomData_get_layer_n(&mr->fdata, CD_MTFACE, i), - lvl1, cr_lvl, CD_MTFACE); - if(mtfaces) - CustomData_set_layer_n(&cdf, CD_MTFACE, i, mtfaces); - } - - CustomData_free(&mr->fdata, lvl1->totface); - mr->fdata= cdf; -} - -/* Update all special first-level data, if the first-level is active */ -void multires_update_first_level(Mesh *me, EditMesh *em) -{ - if(me && me->mr && me->mr->current == 1) { - multires_update_customdata(me->mr->levels.first, em ? &em->vdata : &me->vdata, - &me->mr->vdata, CD_MDEFORMVERT); - multires_update_customdata(me->mr->levels.first, em ? &em->fdata : &me->fdata, - &me->mr->fdata, CD_MTFACE); - multires_update_edge_flags(me, em); - } -} - -/*********** Multires.edge_flags ***********/ -void multires_update_edge_flags(Mesh *me, EditMesh *em) -{ - MultiresLevel *lvl= me->mr->levels.first; - EditEdge *eed= NULL; - int i; - - if(em) eed= em->edges.first; - for(i=0; itotedge; ++i) { - if(em) { - me->mr->edge_flags[i]= 0; - eed_to_medge_flag(eed, &me->mr->edge_flags[i], &me->mr->edge_creases[i]); - eed= eed->next; - } - else { - me->mr->edge_flags[i]= me->medge[i].flag; - me->mr->edge_creases[i]= me->medge[i].crease; - } - } -} - - - -/*********** Multires.vdata ***********/ - -/* MDeformVert */ - -/* Add each weight from in to out. Scale each weight by w. */ -void multires_add_dvert(MDeformVert *out, const MDeformVert *in, const float w) -{ - if(out && in) { - int i, j; - char found; - - for(i=0; itotweight; ++i) { - found= 0; - for(j=0; jtotweight; ++j) { - if(out->dw[j].def_nr==in->dw[i].def_nr) { - out->dw[j].weight += in->dw[i].weight * w; - found= 1; - } - } - if(!found) { - MDeformWeight *newdw= MEM_callocN(sizeof(MDeformWeight)*(out->totweight+1), - "multires dvert"); - if(out->dw) { - memcpy(newdw, out->dw, sizeof(MDeformWeight)*out->totweight); - MEM_freeN(out->dw); - } - - out->dw= newdw; - out->dw[out->totweight].weight= in->dw[i].weight * w; - out->dw[out->totweight].def_nr= in->dw[i].def_nr; - - ++out->totweight; - } - } - } -} - -/* Takes an input array of dverts and subdivides them (linear) using the topology of lvl */ -MDeformVert *subdivide_dverts(MDeformVert *src, MultiresLevel *lvl) -{ - if(lvl && lvl->next) { - MDeformVert *out = MEM_callocN(sizeof(MDeformVert)*lvl->next->totvert, "dvert prop array"); - int i, j; - - /* Copy lower level */ - for(i=0; itotvert; ++i) - multires_add_dvert(&out[i], &src[i], 1); - /* Edge verts */ - for(i=0; itotedge; ++i) { - for(j=0; j<2; ++j) - multires_add_dvert(&out[lvl->totvert+i], &src[lvl->edges[i].v[j]],0.5); - } - - /* Face verts */ - for(i=0; itotface; ++i) { - for(j=0; j<(lvl->faces[i].v[3]?4:3); ++j) - multires_add_dvert(&out[lvl->totvert + lvl->totedge + i], - &src[lvl->faces[i].v[j]], - lvl->faces[i].v[3]?0.25:(1.0f/3.0f)); - } - - return out; - } - - return NULL; -} - - - -/*********** Multires.fdata ***********/ - -/* MTFace */ - -void multires_uv_avg2(float out[2], const float a[2], const float b[2]) -{ - int i; - for(i=0; i<2; ++i) - out[i] = (a[i] + b[i]) / 2.0f; -} - -/* Takes an input array of mtfaces and subdivides them (linear) using the topology of lvl */ -MTFace *subdivide_mtfaces(MTFace *src, MultiresLevel *lvl) -{ - if(lvl && lvl->next) { - MTFace *out= MEM_callocN(sizeof(MultiresColFace)*lvl->next->totface,"Multirescolfaces"); - int i, j, curf; - - for(i=0, curf=0; itotface; ++i) { - const char sides= lvl->faces[i].v[3]?4:3; - float cntr[2]= {0, 0}; - - /* Find average uv coord of the current face */ - for(j=0; jmr && cd) { - MultiresLevel *lvl1= me->mr->levels.first; - - multires_update_levels(me, 0); - - CustomData_set_layer_active(cd, type, n); - CustomData_free_layer_active(cd, type, lvl1->totface); - - multires_level_to_mesh(OBACT, me, 0); - } -} - -MultiresLevel *current_level(Multires *mr); -void multires_add_layer(Mesh *me, CustomData *cd, const int type, const int n) -{ - if(me && me->mr && cd) { - multires_update_levels(me, 0); - - if(CustomData_has_layer(cd, type)) - CustomData_add_layer(cd, type, CD_DUPLICATE, CustomData_get_layer(cd, type), - current_level(me->mr)->totface); - else - CustomData_add_layer(cd, type, CD_DEFAULT, NULL, current_level(me->mr)->totface); - - CustomData_set_layer_active(cd, type, n); - multires_level_to_mesh(OBACT, me, 0); - } -} diff --git a/source/blender/src/multires.c b/source/blender/src/multires.c deleted file mode 100644 index 8704f9abfa4..00000000000 --- a/source/blender/src/multires.c +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Implements the multiresolution modeling tools. - * - * multires.h - * - */ - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_key_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_vec_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_key.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" - -#include "BIF_editmesh.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BDR_editobject.h" -#include "BDR_sculptmode.h" - -#include "BLI_editVert.h" - -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "editmesh.h" -#include "multires.h" -#include "mydevice.h" -#include "parametrizer.h" - -#include - -const CustomDataMask vdata_mask= CD_MASK_MDEFORMVERT; - -void multires_calc_temp_data(struct MultiresLevel *lvl); - -int multires_test() -{ - Mesh *me= get_mesh(OBACT); - if(me && me->mr) { - error("Unable to complete action with multires enabled."); - return 1; - } - return 0; -} -int multires_level1_test() -{ - Mesh *me= get_mesh(OBACT); - if(me && me->mr && me->mr->current != 1) { - error("Operation only available for multires level 1."); - return 1; - } - return 0; -} - -/* Sculptmode */ - -void multires_check_state() -{ - if(G.f & G_SCULPTMODE && !G.obedit) - sculptmode_correct_state(); -} - -typedef struct MultiresMapNode { - struct MultiresMapNode *next, *prev; - unsigned Index; -} MultiresMapNode; - -MultiresLevel *current_level(Multires *mr) -{ - return BLI_findlink(&mr->levels, mr->current - 1); -} - -MultiresLevel *multires_level_n(Multires *mr, int n) -{ - if(mr) - return BLI_findlink(&mr->levels, n - 1); - else - return NULL; -} - -void Vec3fAvg3(float *out, float *v1, float *v2, float *v3) -{ - out[0]= (v1[0]+v2[0]+v3[0])/3; - out[1]= (v1[1]+v2[1]+v3[1])/3; - out[2]= (v1[2]+v2[2]+v3[2])/3; -} -void Vec3fAvg4(float *out, float *v1, float *v2, float *v3, float *v4) -{ - out[0]= (v1[0]+v2[0]+v3[0]+v4[0])/4; - out[1]= (v1[1]+v2[1]+v3[1]+v4[1])/4; - out[2]= (v1[2]+v2[2]+v3[2]+v4[2])/4; -} - -short multires_vert_is_boundary(MultiresLevel *lvl, unsigned v) -{ - MultiresMapNode *node= lvl->vert_edge_map[v].first; - while(node) { - if(lvl->edge_boundary_states[node->Index]) - return 1; - node= node->next; - } - return 0; -} - -typedef struct MultiApplyData { - /* Smooth faces */ - float *corner1, *corner2, *corner3, *corner4; - char quad; - - /* Smooth edges */ - char boundary; - float edge_face_neighbor_midpoints_accum[3]; - unsigned edge_face_neighbor_midpoints_total; - float *endpoint1, *endpoint2; - - /* Smooth verts */ - /* uses 'char boundary' */ - float *original; - int edge_count; - float vert_face_neighbor_midpoints_average[3]; - float vert_edge_neighbor_midpoints_average[3]; - float boundary_edges_average[3]; -} MultiApplyData; - -/* CATMULL-CLARK - ============= */ - -/* Simply averages the four corners of a polygon. */ -float catmullclark_smooth_face(MultiApplyData *data, const unsigned i) -{ - const float total= data->corner1[i]+data->corner2[i]+data->corner3[i]; - return data->quad ? (total+data->corner4[i])/4 : total/3; -} - -float catmullclark_smooth_edge(MultiApplyData *data, const unsigned i) -{ - float accum= 0; - unsigned count= 2; - - accum+= data->endpoint1[i] + data->endpoint2[i]; - - if(!data->boundary) { - accum+= data->edge_face_neighbor_midpoints_accum[i]; - count+= data->edge_face_neighbor_midpoints_total; - } - - return accum / count; -} -float catmullclark_smooth_vert(MultiApplyData *data, const unsigned i) -{ - if(data->boundary) { - return data->original[i]*0.75 + data->boundary_edges_average[i]*0.25; - } else { - return (data->vert_face_neighbor_midpoints_average[i] + - 2*data->vert_edge_neighbor_midpoints_average[i] + - data->original[i]*(data->edge_count-3))/data->edge_count; - } -} - - - -/* Call func count times, passing in[i] as the input and storing the output in out[i] */ -void multi_apply(float *out, MultiApplyData *data, - const unsigned count, float (*func)(MultiApplyData *, const unsigned)) -{ - unsigned i; - for(i=0; ivert_face_map[e->v[0]]; - ListBase *neighbors2= &lvl->vert_face_map[e->v[1]]; - MultiresMapNode *n1, *n2; - unsigned j,count= 0; - float *out= data->edge_face_neighbor_midpoints_accum; - - out[0]=out[1]=out[2]= 0; - - for(n1= neighbors1->first; n1; n1= n1->next) { - for(n2= neighbors2->first; n2; n2= n2->next) { - if(n1->Index == n2->Index) { - for(j=0; j<3; ++j) - out[j]+= GET_FLOAT(array,lvl->faces[n1->Index].mid,j,stride); - ++count; - } - } - } - - data->edge_face_neighbor_midpoints_total= count; -} -void vert_face_neighbor_midpoints_average(MultiApplyData *data, MultiresLevel *lvl, - void *array, const char stride, const unsigned i) -{ - ListBase *neighbors= &lvl->vert_face_map[i]; - MultiresMapNode *n1; - unsigned j,count= 0; - float *out= data->vert_face_neighbor_midpoints_average; - - out[0]=out[1]=out[2]= 0; - - for(n1= neighbors->first; n1; n1= n1->next) { - for(j=0; j<3; ++j) - out[j]+= GET_FLOAT(array,lvl->faces[n1->Index].mid,j,stride); - ++count; - } - for(j=0; j<3; ++j) out[j]/= count; -} -void vert_edge_neighbor_midpoints_average(MultiApplyData *data, MultiresLevel *lvl, - void *array, const char stride, const unsigned i) -{ - ListBase *neighbors= &lvl->vert_edge_map[i]; - MultiresMapNode *n1; - unsigned j,count= 0; - float *out= data->vert_edge_neighbor_midpoints_average; - - out[0]=out[1]=out[2]= 0; - - for(n1= neighbors->first; n1; n1= n1->next) { - for(j=0; j<3; ++j) - out[j]+= (GET_FLOAT(array,lvl->edges[n1->Index].v[0],j,stride) + - GET_FLOAT(array,lvl->edges[n1->Index].v[1],j,stride)) / 2; - ++count; - } - for(j=0; j<3; ++j) out[j]/= count; -} -void boundary_edges_average(MultiApplyData *data, MultiresLevel *lvl, - void *array, const char stride, const unsigned i) -{ - ListBase *neighbors= &lvl->vert_edge_map[i]; - MultiresMapNode *n1; - unsigned j,count= 0; - float *out= data->boundary_edges_average; - - out[0]=out[1]=out[2]= 0; - - for(n1= neighbors->first; n1; n1= n1->next) { - const MultiresEdge *e= &lvl->edges[n1->Index]; - const unsigned end= e->v[0]==i ? e->v[1] : e->v[0]; - - if(lvl->edge_boundary_states[n1->Index]) { - for(j=0; j<3; ++j) - out[j]+= GET_FLOAT(array,end,j,stride); - ++count; - } - } - for(j=0; j<3; ++j) out[j]/= count; -} - -/* For manipulating vertex colors / uvs */ -void mcol_to_multires(MultiresColFace *mrf, MCol *mcol) -{ - char i; - for(i=0; i<4; ++i) { - mrf->col[i].a= mcol[i].a; - mrf->col[i].r= mcol[i].r; - mrf->col[i].g= mcol[i].g; - mrf->col[i].b= mcol[i].b; - } -} - -float clamp_component(const float c) -{ - if(c<0) return 0; - else if(c>255) return 255; - else return c; -} - -void multires_to_mcol(MultiresColFace *f, MCol mcol[4]) -{ - unsigned char j; - for(j=0; j<4; ++j) { - mcol->a= clamp_component(f->col[j].a); - mcol->r= clamp_component(f->col[j].r); - mcol->g= clamp_component(f->col[j].g); - mcol->b= clamp_component(f->col[j].b); - ++mcol; - } -} - -/* 1 <= count <= 4 */ -void multires_col_avg(MultiresCol *avg, MultiresCol cols[4], char count) -{ - unsigned i; - avg->a= avg->r= avg->g= avg->b= 0; - for(i=0; ia+= cols[i].a; - avg->r+= cols[i].r; - avg->g+= cols[i].g; - avg->b+= cols[i].b; - } - avg->a/= count; - avg->r/= count; - avg->g/= count; - avg->b/= count; -} - -void multires_col_avg2(MultiresCol *avg, MultiresCol *c1, MultiresCol *c2) -{ - MultiresCol in[2]; - in[0]= *c1; - in[1]= *c2; - multires_col_avg(avg,in,2); -} - -void multires_load_cols(Mesh *me) -{ - MultiresLevel *lvl= BLI_findlink(&me->mr->levels,me->mr->current-1), *cur; - EditMesh *em= G.obedit ? G.editMesh : NULL; - CustomData *src= em ? &em->fdata : &me->fdata; - EditFace *efa= NULL; - unsigned i,j; - - if(!CustomData_has_layer(src, CD_MCOL) && !CustomData_has_layer(src, CD_MTFACE)) return; - - /* Add texcol data */ - for(cur= me->mr->levels.first; cur; cur= cur->next) - if(!cur->colfaces) - cur->colfaces= MEM_callocN(sizeof(MultiresColFace)*cur->totface,"ColFaces"); - - me->mr->use_col= CustomData_has_layer(src, CD_MCOL); - - if(em) efa= em->faces.first; - for(i=0; itotface; ++i) { - MultiresColFace *f= &lvl->colfaces[i]; - - if(me->mr->use_col) - mcol_to_multires(f, em ? CustomData_em_get(src, efa->data, CD_MCOL) : &me->mcol[i*4]); - - if(em) efa= efa->next; - } - - /* Update higher levels */ - lvl= lvl->next; - while(lvl) { - MultiresColFace *cf= lvl->colfaces; - for(i=0; iprev->totface; ++i) { - const char sides= lvl->prev->faces[i].v[3]?4:3; - MultiresCol cntr; - - /* Find average color of 4 (or 3 for triangle) verts */ - multires_col_avg(&cntr,lvl->prev->colfaces[i].col,sides); - - for(j=0; jprev->colfaces[i]; - - multires_col_avg2(&cf->col[0], - &pf->col[j], - &pf->col[j==0?sides-1:j-1]); - cf->col[1]= pf->col[j]; - multires_col_avg2(&cf->col[2], - &pf->col[j], - &pf->col[j==sides-1?0:j+1]); - cf->col[3]= cntr; - - ++cf; - } - } - lvl= lvl->next; - } - - /* Update lower levels */ - lvl= me->mr->levels.last; - lvl= lvl->prev; - while(lvl) { - unsigned curf= 0; - for(i=0; itotface; ++i) { - MultiresFace *f= &lvl->faces[i]; - for(j=0; j<(f->v[3]?4:3); ++j) { - lvl->colfaces[i].col[j]= lvl->next->colfaces[curf].col[1]; - ++curf; - } - } - lvl= lvl->prev; - } -} - -void multires_get_vert(MVert *out, EditVert *eve, MVert *m, int i) -{ - if(eve) { - VecCopyf(out->co, eve->co); - out->flag= 0; - if(eve->f & SELECT) out->flag |= 1; - if(eve->h) out->flag |= ME_HIDE; - eve->tmp.l= i; - } - else - *out= *m; -} - -void multires_get_face(MultiresFace *f, EditFace *efa, MFace *m) -{ - if(efa) { - MFace tmp; - int j; - tmp.v1= efa->v1->tmp.l; - tmp.v2= efa->v2->tmp.l; - tmp.v3= efa->v3->tmp.l; - tmp.v4= 0; - if(efa->v4) tmp.v4= efa->v4->tmp.l; - test_index_face(&tmp, NULL, 0, efa->v4?4:3); - for(j=0; j<4; ++j) f->v[j]= (&tmp.v1)[j]; - - /* Flags */ - f->flag= efa->flag; - if(efa->f & 1) f->flag |= ME_FACE_SEL; - else f->flag &= ~ME_FACE_SEL; - if(efa->h) f->flag |= ME_HIDE; - f->mat_nr= efa->mat_nr; - } else { - f->v[0]= m->v1; - f->v[1]= m->v2; - f->v[2]= m->v3; - f->v[3]= m->v4; - f->flag= m->flag; - f->mat_nr= m->mat_nr; - } -} - -void eed_to_medge_flag(EditEdge *eed, short *flag, char *crease) -{ - if(!eed || !flag) return; - - /* Would be nice if EditMesh edge flags could be unified with Mesh flags! */ - *flag= (eed->f & SELECT) | ME_EDGERENDER; - if(eed->f2<2) *flag |= ME_EDGEDRAW; - if(eed->f2==0) *flag |= ME_LOOSEEDGE; - if(eed->sharp) *flag |= ME_SHARP; - if(eed->seam) *flag |= ME_SEAM; - if(eed->h & EM_FGON) *flag |= ME_FGON; - if(eed->h & 1) *flag |= ME_HIDE; - - *crease= (char)(255.0*eed->crease); -} - -void multires_get_edge(MultiresEdge *e, EditEdge *eed, MEdge *m, short *flag, char *crease) -{ - if(eed) { - e->v[0]= eed->v1->tmp.l; - e->v[1]= eed->v2->tmp.l; - eed_to_medge_flag(eed, flag, crease); - } else { - e->v[0]= m->v1; - e->v[1]= m->v2; - *flag= m->flag; - *crease= m->crease; - } -} - -void multires_make(void *ob, void *me_v) -{ - Mesh *me= me_v; - MultiresLevel *lvl; - EditMesh *em= G.obedit ? G.editMesh : NULL; - EditVert *eve= NULL; - EditFace *efa= NULL; - EditEdge *eed= NULL; - Key *key; - int i; - - /* Check for shape keys */ - key= me->key; - if(key) { - int ret= okee("Adding multires will delete all shape keys, proceed?"); - if(ret) { - free_key(key); - me->key= NULL; - } else - return; - } - - lvl= MEM_callocN(sizeof(MultiresLevel), "multires level"); - - waitcursor(1); - - multires_check_state(); - - if(me->pv) sculptmode_pmv_off(me); - - me->mr= MEM_callocN(sizeof(Multires), "multires data"); - - BLI_addtail(&me->mr->levels,lvl); - me->mr->current= 1; - me->mr->level_count= 1; - me->mr->edgelvl= 1; - me->mr->pinlvl= 1; - me->mr->renderlvl= 1; - - /* Load mesh (or editmesh) into multires data */ - - /* Load vertices and vdata (MDeformVerts) */ - lvl->totvert= em ? BLI_countlist(&em->verts) : me->totvert; - me->mr->verts= MEM_callocN(sizeof(MVert)*lvl->totvert,"multires verts"); - multires_update_customdata(me->mr->levels.first, em ? &em->vdata : &me->vdata, - &me->mr->vdata, CD_MDEFORMVERT); - if(em) eve= em->verts.first; - for(i=0; itotvert; ++i) { - multires_get_vert(&me->mr->verts[i], eve, &me->mvert[i], i); - if(em) eve= eve->next; - } - - /* Load faces and fdata (MTFaces) */ - lvl->totface= em ? BLI_countlist(&em->faces) : me->totface; - lvl->faces= MEM_callocN(sizeof(MultiresFace)*lvl->totface,"multires faces"); - multires_update_customdata(me->mr->levels.first, em ? &em->fdata : &me->fdata, - &me->mr->fdata, CD_MTFACE); - if(em) efa= em->faces.first; - for(i=0; itotface; ++i) { - multires_get_face(&lvl->faces[i], efa, &me->mface[i]); - if(em) efa= efa->next; - } - - /* Load edges and edge_flags */ - lvl->totedge= em ? BLI_countlist(&em->edges) : me->totedge; - lvl->edges= MEM_callocN(sizeof(MultiresEdge)*lvl->totedge,"multires edges"); - me->mr->edge_flags= MEM_callocN(sizeof(short)*lvl->totedge, "multires edge flags"); - me->mr->edge_creases= MEM_callocN(sizeof(short)*lvl->totedge, "multires edge creases"); - if(em) eed= em->edges.first; - for(i=0; itotedge; ++i) { - multires_get_edge(&lvl->edges[i], eed, &me->medge[i], &me->mr->edge_flags[i], &me->mr->edge_creases[i]); - if(em) eed= eed->next; - } - - multires_load_cols(me); - - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Make multires"); - - waitcursor(0); -} - -void multires_delete(void *ob, void *me_v) -{ - Mesh *me= me_v; - multires_free(me->mr); - me->mr= NULL; - - multires_check_state(); - - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Apply multires"); -} - -MultiresLevel *multires_level_copy(MultiresLevel *orig) -{ - if(orig) { - MultiresLevel *lvl= MEM_dupallocN(orig); - - lvl->next= lvl->prev= NULL; - lvl->faces= MEM_dupallocN(orig->faces); - lvl->colfaces= MEM_dupallocN(orig->colfaces); - lvl->edges= MEM_dupallocN(orig->edges); - lvl->edge_boundary_states = NULL; - lvl->vert_edge_map= lvl->vert_face_map= NULL; - lvl->map_mem= NULL; - - return lvl; - } - return NULL; -} - -Multires *multires_copy(Multires *orig) -{ - if(orig) { - Multires *mr= MEM_dupallocN(orig); - MultiresLevel *lvl; - - mr->levels.first= mr->levels.last= NULL; - - for(lvl= orig->levels.first; lvl; lvl= lvl->next) - BLI_addtail(&mr->levels, multires_level_copy(lvl)); - - mr->verts= MEM_dupallocN(orig->verts); - - lvl= mr->levels.first; - if(lvl) { - CustomData_copy(&orig->vdata, &mr->vdata, vdata_mask, CD_DUPLICATE, lvl->totvert); - CustomData_copy(&orig->fdata, &mr->fdata, CD_MASK_MTFACE, CD_DUPLICATE, lvl->totface); - mr->edge_flags= MEM_dupallocN(orig->edge_flags); - mr->edge_creases= MEM_dupallocN(orig->edge_creases); - } - - return mr; - } - return NULL; -} - -void multires_free(Multires *mr) -{ - if(mr) { - MultiresLevel* lvl= mr->levels.first; - - /* Free the first-level data */ - if(lvl) { - CustomData_free(&mr->vdata, lvl->totvert); - CustomData_free(&mr->fdata, lvl->totface); - MEM_freeN(mr->edge_flags); - MEM_freeN(mr->edge_creases); - } - - while(lvl) { - multires_free_level(lvl); - lvl= lvl->next; - } - - MEM_freeN(mr->verts); - - BLI_freelistN(&mr->levels); - - MEM_freeN(mr); - } -} - -/* Free and clear the temporary connectivity data */ -void multires_free_temp_data(MultiresLevel *lvl) -{ - if(lvl) { - if(lvl->edge_boundary_states) MEM_freeN(lvl->edge_boundary_states); - if(lvl->vert_edge_map) MEM_freeN(lvl->vert_edge_map); - if(lvl->vert_face_map) MEM_freeN(lvl->vert_face_map); - if(lvl->map_mem) MEM_freeN(lvl->map_mem); - - lvl->edge_boundary_states = NULL; - lvl->vert_edge_map = lvl->vert_face_map = NULL; - lvl->map_mem = NULL; - } -} - -/* Does not actually free lvl itself! */ -void multires_free_level(MultiresLevel *lvl) -{ - if(lvl) { - if(lvl->faces) MEM_freeN(lvl->faces); - if(lvl->edges) MEM_freeN(lvl->edges); - if(lvl->colfaces) MEM_freeN(lvl->colfaces); - - multires_free_temp_data(lvl); - } -} - -/* Make sure that all level indices are clipped to [1, mr->level_count] */ -void multires_clip_levels(Multires *mr) -{ - if(mr) { - const int cnt = mr->level_count; - - if(mr->current < 1) mr->current = 1; - if(mr->edgelvl < 1) mr->edgelvl = 1; - if(mr->pinlvl < 1) mr->pinlvl = 1; - if(mr->renderlvl < 1) mr->renderlvl = 1; - - if(mr->current > cnt) mr->current = cnt; - if(mr->edgelvl > cnt) mr->edgelvl = cnt; - if(mr->pinlvl > cnt) mr->pinlvl = cnt; - if(mr->renderlvl > cnt) mr->renderlvl = cnt; - } -} - -/* Delete all multires levels beneath current level. Subdivide special - first-level data up to the new lowest level. */ -void multires_del_lower(void *ob, void *me) -{ - Multires *mr= ((Mesh*)me)->mr; - MultiresLevel *lvl1= mr->levels.first, *cr_lvl= current_level(mr); - MultiresLevel *lvl= NULL, *lvlprev= NULL; - short *edgeflags= NULL; - char *edgecreases= NULL; - int i, last; - - if(cr_lvl == lvl1) return; - - multires_check_state(); - - /* Subdivide the edge flags to the current level */ - edgeflags= MEM_callocN(sizeof(short)*current_level(mr)->totedge, "Multires Edge Flags"); - edgecreases= MEM_callocN(sizeof(char)*current_level(mr)->totedge, "Multires Edge Creases"); - last= lvl1->totedge * pow(2, mr->current-1); - for(i=0; iedge_flags[(int)(i / pow(2, mr->current-1))]; - edgecreases[i] = mr->edge_creases[(int)(i / pow(2, mr->current-1))]; - } - MEM_freeN(mr->edge_flags); - MEM_freeN(mr->edge_creases); - mr->edge_flags= edgeflags; - mr->edge_creases= edgecreases; - - multires_del_lower_customdata(mr, cr_lvl); - - lvl= cr_lvl->prev; - while(lvl) { - lvlprev= lvl->prev; - - multires_free_level(lvl); - BLI_freelinkN(&mr->levels, lvl); - - mr->current-= 1; - mr->level_count-= 1; - - lvl= lvlprev; - } - mr->newlvl= mr->current; - - multires_clip_levels(mr); - - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Multires delete lower"); -} - -void multires_del_higher(void *ob, void *me) -{ - Multires *mr= ((Mesh*)me)->mr; - MultiresLevel *lvl= BLI_findlink(&mr->levels,mr->current-1); - MultiresLevel *lvlnext; - - multires_check_state(); - - lvl= lvl->next; - while(lvl) { - lvlnext= lvl->next; - - multires_free_level(lvl); - BLI_freelinkN(&mr->levels,lvl); - - mr->level_count-= 1; - - lvl= lvlnext; - } - - multires_clip_levels(mr); - - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Multires delete higher"); -} - -unsigned int find_mid_edge(ListBase *vert_edge_map, - MultiresLevel *lvl, - const unsigned int v1, - const unsigned int v2 ) -{ - MultiresMapNode *n= vert_edge_map[v1].first; - while(n) { - if(lvl->edges[n->Index].v[0]==v2 || - lvl->edges[n->Index].v[1]==v2) - return lvl->edges[n->Index].mid; - - n= n->next; - } - return -1; -} - -void check_colors(Mesh *me) -{ - CustomData *src= G.obedit ? &G.editMesh->fdata : &me->fdata; - const char col= CustomData_has_layer(src, CD_MCOL); - - /* Check if vertex colors have been deleted or added */ - if(me->mr->use_col && !col) - me->mr->use_col= 0; - else if(!me->mr->use_col && col) { - me->mr->use_col= 1; - multires_load_cols(me); - } -} - -void multires_add_level(void *ob, void *me_v) -{ - int i,j, curf, cure; - Mesh *me= me_v; - MultiresLevel *lvl= NULL; - MultiApplyData data; - MVert *oldverts= NULL; - - multires_check_state(); - - if(CustomData_number_of_layers(G.obedit ? &G.editMesh->fdata : &me->fdata, CD_MCOL) > 1) { - int ret= okee("Adding a level will delete all but the active vertex color layer, proceed?"); - if(!ret) - return; - } - - waitcursor(1); - - lvl= MEM_callocN(sizeof(MultiresLevel), "multireslevel"); - if(me->pv) sculptmode_pmv_off(me); - - check_colors(me); - multires_update_levels(me, 0); - - ++me->mr->level_count; - BLI_addtail(&me->mr->levels,lvl); - - /* Create vertices - =============== */ - lvl->totvert= lvl->prev->totvert + lvl->prev->totedge + lvl->prev->totface; - oldverts= me->mr->verts; - me->mr->verts= MEM_callocN(sizeof(MVert)*lvl->totvert, "multitres verts"); - /* Copy old verts */ - for(i=0; iprev->totvert; ++i) - me->mr->verts[i]= oldverts[i]; - /* Create new edge verts */ - for(i=0; iprev->totedge; ++i) { - VecMidf(me->mr->verts[lvl->prev->totvert + i].co, - oldverts[lvl->prev->edges[i].v[0]].co, - oldverts[lvl->prev->edges[i].v[1]].co); - lvl->prev->edges[i].mid= lvl->prev->totvert + i; - } - /* Create new face verts */ - for(i=0; iprev->totface; ++i) { - lvl->prev->faces[i].mid= lvl->prev->totvert + lvl->prev->totedge + i; - } - - multires_calc_temp_data(lvl->prev); - - /* Create faces - ============ */ - /* Allocate all the new faces (each triangle creates three, and - each quad creates four */ - lvl->totface= 0; - for(i=0; iprev->totface; ++i) - lvl->totface+= lvl->prev->faces[i].v[3] ? 4 : 3; - lvl->faces= MEM_callocN(sizeof(MultiresFace)*lvl->totface,"multires faces"); - - curf= 0; - for(i=0; iprev->totface; ++i) { - const int max= lvl->prev->faces[i].v[3] ? 3 : 2; - - for(j=0; jfaces[curf].v[0]= find_mid_edge(lvl->prev->vert_edge_map,lvl->prev, - lvl->prev->faces[i].v[j], - lvl->prev->faces[i].v[j==0?max:j-1]); - lvl->faces[curf].v[1]= lvl->prev->faces[i].v[j]; - lvl->faces[curf].v[2]= find_mid_edge(lvl->prev->vert_edge_map,lvl->prev, - lvl->prev->faces[i].v[j], - lvl->prev->faces[i].v[j==max?0:j+1]); - lvl->faces[curf].v[3]= lvl->prev->totvert + lvl->prev->totedge + i; - lvl->faces[curf].flag= lvl->prev->faces[i].flag; - lvl->faces[curf].mat_nr= lvl->prev->faces[i].mat_nr; - - ++curf; - } - } - - /* Create edges - ============ */ - /* Figure out how many edges to allocate */ - lvl->totedge= lvl->prev->totedge*2; - for(i=0; iprev->totface; ++i) - lvl->totedge+= lvl->prev->faces[i].v[3]?4:3; - lvl->edges= MEM_callocN(sizeof(MultiresEdge)*lvl->totedge,"multires edges"); - - for(i=0; iprev->totedge; ++i) { - lvl->edges[i*2].v[0]= lvl->prev->edges[i].v[0]; - lvl->edges[i*2].v[1]= lvl->prev->edges[i].mid; - lvl->edges[i*2+1].v[0]= lvl->prev->edges[i].mid; - lvl->edges[i*2+1].v[1]= lvl->prev->edges[i].v[1]; - } - /* Add edges inside of old polygons */ - curf= 0; - cure= lvl->prev->totedge*2; - for(i=0; iprev->totface; ++i) { - for(j=0; j<(lvl->prev->faces[i].v[3]?4:3); ++j) { - lvl->edges[cure].v[0]= lvl->faces[curf].v[2]; - lvl->edges[cure].v[1]= lvl->faces[curf].v[3]; - ++cure; - ++curf; - } - } - - /* Smooth vertices - =============== */ - for(i=0; iprev->totface; ++i) { - const MultiresFace *f= &lvl->prev->faces[i]; - data.corner1= oldverts[f->v[0]].co; - data.corner2= oldverts[f->v[1]].co; - data.corner3= oldverts[f->v[2]].co; - data.corner4= oldverts[f->v[3]].co; - data.quad= f->v[3] ? 1 : 0; - multi_apply(me->mr->verts[f->mid].co, &data, 3, catmullclark_smooth_face); - } - - if(G.scene->toolsettings->multires_subdiv_type == 0) { - for(i=0; iprev->totedge; ++i) { - const MultiresEdge *e= &lvl->prev->edges[i]; - data.boundary= lvl->prev->edge_boundary_states[i]; - edge_face_neighbor_midpoints_accum(&data,lvl->prev, me->mr->verts, sizeof(MVert),e); - data.endpoint1= oldverts[e->v[0]].co; - data.endpoint2= oldverts[e->v[1]].co; - multi_apply(me->mr->verts[e->mid].co, &data, 3, catmullclark_smooth_edge); - } - - for(i=0; iprev->totvert; ++i) { - data.boundary= multires_vert_is_boundary(lvl->prev,i); - data.original= oldverts[i].co; - data.edge_count= BLI_countlist(&lvl->prev->vert_edge_map[i]); - if(data.boundary) - boundary_edges_average(&data,lvl->prev, oldverts, sizeof(MVert),i); - else { - vert_face_neighbor_midpoints_average(&data,lvl->prev, me->mr->verts, - sizeof(MVert),i); - vert_edge_neighbor_midpoints_average(&data,lvl->prev, oldverts, - sizeof(MVert),i); - } - multi_apply(me->mr->verts[i].co, &data, 3, catmullclark_smooth_vert); - } - } - - multires_free_temp_data(lvl->prev); - MEM_freeN(oldverts); - - /* Vertex Colors - ============= */ - curf= 0; - if(me->mr->use_col) { - MultiresColFace *cf= MEM_callocN(sizeof(MultiresColFace)*lvl->totface,"Multirescolfaces"); - lvl->colfaces= cf; - for(i=0; iprev->totface; ++i) { - const char sides= lvl->prev->faces[i].v[3]?4:3; - MultiresCol cntr; - - /* Find average color of 4 (or 3 for triangle) verts */ - multires_col_avg(&cntr,lvl->prev->colfaces[i].col,sides); - - for(j=0; jcol[0], - &lvl->prev->colfaces[i].col[j], - &lvl->prev->colfaces[i].col[j==0?sides-1:j-1]); - cf->col[1]= lvl->prev->colfaces[i].col[j]; - multires_col_avg2(&cf->col[2], - &lvl->prev->colfaces[i].col[j], - &lvl->prev->colfaces[i].col[j==sides-1?0:j+1]); - cf->col[3]= cntr; - - ++cf; - } - } - } - - me->mr->newlvl= me->mr->level_count; - me->mr->current= me->mr->newlvl; - /* Unless the render level has been set to something other than the - highest level (by the user), increment the render level to match - the highest available level */ - if(me->mr->renderlvl == me->mr->level_count - 1) me->mr->renderlvl= me->mr->level_count; - - multires_level_to_mesh(ob, me, 0); - - allqueue(REDRAWBUTSEDIT, 0); - - BIF_undo_push("Add multires level"); - - waitcursor(0); -} - -void multires_set_level_cb(void *ob, void *me) -{ - multires_set_level(ob, me, 0); -} - -void multires_set_level(struct Object *ob, struct Mesh *me, const int render) -{ - waitcursor(1); - - multires_check_state(); - - if(me->pv) sculptmode_pmv_off(me); - - check_colors(me); - multires_update_levels(me, render); - - me->mr->current= me->mr->newlvl; - if(me->mr->current<1) me->mr->current= 1; - else if(me->mr->current>me->mr->level_count) me->mr->current= me->mr->level_count; - - multires_level_to_mesh(ob, me, render); - - if(!render && (G.obedit || G.f & G_SCULPTMODE)) - BIF_undo_push("Multires set level"); - - allqueue(REDRAWBUTSEDIT, 0); - - waitcursor(0); -} - - -void medge_flag_to_eed(const short flag, const char crease, EditEdge *eed) -{ - if(!eed) return; - - if(flag & ME_SEAM) eed->seam= 1; - if(flag & ME_SHARP) eed->sharp = 1; - if(flag & SELECT) eed->f |= SELECT; - if(flag & ME_FGON) eed->h= EM_FGON; - if(flag & ME_HIDE) eed->h |= 1; - - eed->crease= ((float)crease)/255.0; -} - -/* note, function is called in background render too, without UI */ -void multires_level_to_mesh(Object *ob, Mesh *me, const int render) -{ - MultiresLevel *lvl= BLI_findlink(&me->mr->levels,me->mr->current-1); - int i; - EditMesh *em= (!render && G.obedit) ? G.editMesh : NULL; - EditVert **eves= NULL; - EditEdge *eed= NULL; - - if(em) { - /* Remove editmesh elements */ - free_editMesh(em); - - eves= MEM_callocN(sizeof(EditVert*)*lvl->totvert, "editvert pointers"); - } else { - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->totvert); - CustomData_free_layer_active(&me->edata, CD_MEDGE, me->totedge); - CustomData_free_layer_active(&me->fdata, CD_MFACE, me->totface); - CustomData_free_layer_active(&me->vdata, CD_MDEFORMVERT, me->totvert); - CustomData_free_layers(&me->fdata, CD_MTFACE, me->totface); - CustomData_free_layers(&me->fdata, CD_MCOL, me->totface); - - me->totvert= lvl->totvert; - me->totface= lvl->totface; - me->totedge= lvl->totedge; - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert); - CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface); - mesh_update_customdata_pointers(me); - } - - /* Vertices/Edges/Faces */ - - for(i=0; itotvert; ++i) { - if(em) { - eves[i]= addvertlist(me->mr->verts[i].co, NULL); - if(me->mr->verts[i].flag & 1) eves[i]->f |= SELECT; - if(me->mr->verts[i].flag & ME_HIDE) eves[i]->h= 1; - eves[i]->data= NULL; - } - else - me->mvert[i]= me->mr->verts[i]; - } - for(i=0; itotedge; ++i) { - if(em) { - addedgelist(eves[lvl->edges[i].v[0]], eves[lvl->edges[i].v[1]], NULL); - } else { - me->medge[i].v1= lvl->edges[i].v[0]; - me->medge[i].v2= lvl->edges[i].v[1]; - me->medge[i].flag &= ~ME_HIDE; - } - } - for(i=0; itotface; ++i) { - if(em) { - EditVert *eve4= lvl->faces[i].v[3] ? eves[lvl->faces[i].v[3]] : NULL; - EditFace *efa= addfacelist(eves[lvl->faces[i].v[0]], eves[lvl->faces[i].v[1]], - eves[lvl->faces[i].v[2]], eve4, NULL, NULL); - efa->flag= lvl->faces[i].flag & ~ME_HIDE; - efa->mat_nr= lvl->faces[i].mat_nr; - if(lvl->faces[i].flag & ME_FACE_SEL) - efa->f |= SELECT; - if(lvl->faces[i].flag & ME_HIDE) efa->h= 1; - efa->data= NULL; - } - else { - me->mface[i].v1= lvl->faces[i].v[0]; - me->mface[i].v2= lvl->faces[i].v[1]; - me->mface[i].v3= lvl->faces[i].v[2]; - me->mface[i].v4= lvl->faces[i].v[3]; - me->mface[i].flag= lvl->faces[i].flag; - me->mface[i].flag &= ~ME_HIDE; - me->mface[i].mat_nr= lvl->faces[i].mat_nr; - } - } - - /* Edge flags */ - if(em) eed= em->edges.first; - if(lvl==me->mr->levels.first) { - for(i=0; itotedge; ++i) { - if(em) { - medge_flag_to_eed(me->mr->edge_flags[i], me->mr->edge_creases[i], eed); - eed= eed->next; - } - else { - me->medge[i].flag= me->mr->edge_flags[i]; - me->medge[i].crease= me->mr->edge_creases[i]; - } - } - } else { - MultiresLevel *lvl1= me->mr->levels.first; - const int last= lvl1->totedge * pow(2, me->mr->current-1); - for(i=0; imr->current-1); - - if(em) { - medge_flag_to_eed(me->mr->edge_flags[ndx], me->mr->edge_creases[ndx], eed); - eed= eed->next; - } - else { - me->medge[i].flag= me->mr->edge_flags[ndx]; - me->medge[i].crease= me->mr->edge_creases[ndx]; - } - } - } - - if(em) { - eed= em->edges.first; - for(i=0, eed= em->edges.first; itotedge; ++i, eed= eed->next) { - eed->h= me->mr->verts[lvl->edges[i].v[0]].flag & ME_HIDE || - me->mr->verts[lvl->edges[i].v[1]].flag & ME_HIDE; - } - } - - EM_select_flush(); - - multires_customdata_to_mesh(me, em, lvl, &me->mr->vdata, em ? &em->vdata : &me->vdata, CD_MDEFORMVERT); - multires_customdata_to_mesh(me, em, lvl, &me->mr->fdata, em ? &em->fdata : &me->fdata, CD_MTFACE); - - /* Colors */ - if(me->mr->use_col) { - MCol c[4]; - EditFace *efa= NULL; - CustomData *src= em ? &em->fdata : &me->fdata; - if(em) { - if(me->mr->use_col) EM_add_data_layer(src, CD_MCOL); - efa= em->faces.first; - } - else { - if(me->mr->use_col) me->mcol= CustomData_add_layer(src, CD_MCOL, CD_CALLOC, NULL, me->totface); - } - - for(i=0; itotface; ++i) { - if(em) { - if(me->mr->use_col) { - multires_to_mcol(&lvl->colfaces[i], c); - CustomData_em_set(src, efa->data, CD_MCOL, c); - } - efa= efa->next; - } - else if(me->mr->use_col) multires_to_mcol(&lvl->colfaces[i], &me->mcol[i*4]); - } - - } - - mesh_update_customdata_pointers(me); - - if(em) { - MEM_freeN(eves); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - recalc_editnormals(); - } else { - multires_edge_level_update(ob,me); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); - } - - /* friendly check for background render */ - if(G.background==0) { - object_handle_update(ob); - countall(); - - if(G.vd && G.vd->depths) G.vd->depths->damaged= 1; - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - } -} - -void multires_update_colors(Mesh *me) -{ - MultiresLevel *lvl= BLI_findlink(&me->mr->levels,me->mr->current-1); - MultiresCol *pr_deltas= NULL, *cr_deltas= NULL; - EditMesh *em= G.obedit ? G.editMesh : NULL; - CustomData *src= em ? &em->fdata : &me->fdata; - EditFace *efa= NULL; - unsigned i,j,curf= 0; - - if(me->mr->use_col) { - /* Calc initial deltas */ - cr_deltas= MEM_callocN(sizeof(MultiresCol)*lvl->totface*4,"initial color/uv deltas"); - - if(em) efa= em->faces.first; - for(i=0; itotface; ++i) { - MCol *col= em ? CustomData_em_get(src, efa->data, CD_MCOL) : &me->mcol[i*4]; - for(j=0; j<4; ++j) { - if(me->mr->use_col) { - cr_deltas[i*4+j].a= col[j].a - lvl->colfaces[i].col[j].a; - cr_deltas[i*4+j].r= col[j].r - lvl->colfaces[i].col[j].r; - cr_deltas[i*4+j].g= col[j].g - lvl->colfaces[i].col[j].g; - cr_deltas[i*4+j].b= col[j].b - lvl->colfaces[i].col[j].b; - } - } - if(em) efa= efa->next; - } - - /* Update current level */ - if(em) efa= em->faces.first; - for(i=0; itotface; ++i) { - MultiresColFace *f= &lvl->colfaces[i]; - - if(me->mr->use_col) - mcol_to_multires(f, em ? CustomData_em_get(src, efa->data, CD_MCOL) : &me->mcol[i*4]); - - if(em) efa= efa->next; - } - - /* Update higher levels */ - lvl= lvl->next; - while(lvl) { - /* Set up new deltas, but keep the ones from the previous level */ - if(pr_deltas) MEM_freeN(pr_deltas); - pr_deltas= cr_deltas; - cr_deltas= MEM_callocN(sizeof(MultiresCol)*lvl->totface*4,"color deltas"); - - curf= 0; - for(i=0; iprev->totface; ++i) { - const char sides= lvl->prev->faces[i].v[3]?4:3; - MultiresCol cntr; - - /* Find average color of 4 (or 3 for triangle) verts */ - multires_col_avg(&cntr,&pr_deltas[i*4],sides); - - for(j=0; jtotface; ++i) { - for(j=0; j<4; ++j) { - lvl->colfaces[i].col[j].a+= cr_deltas[i*4+j].a; - lvl->colfaces[i].col[j].r+= cr_deltas[i*4+j].r; - lvl->colfaces[i].col[j].g+= cr_deltas[i*4+j].g; - lvl->colfaces[i].col[j].b+= cr_deltas[i*4+j].b; - } - } - - lvl= lvl->next; - } - if(pr_deltas) MEM_freeN(pr_deltas); - if(cr_deltas) MEM_freeN(cr_deltas); - - /* Update lower levels */ - lvl= me->mr->levels.last; - lvl= lvl->prev; - while(lvl) { - MultiresColFace *nf= lvl->next->colfaces; - for(i=0; itotface; ++i) { - MultiresFace *f= &lvl->faces[i]; - for(j=0; j<(f->v[3]?4:3); ++j) { - lvl->colfaces[i].col[j]= nf->col[1]; - ++nf; - } - } - lvl= lvl->prev; - } - } -} - -/* Update vertex locations and vertex flags */ -void multires_update_vertices(Mesh *me, EditMesh *em) -{ - MultiresLevel *cr_lvl= current_level(me->mr), *pr_lvl= NULL, - *last_lvl= me->mr->levels.last; - vec3f *pr_deltas= NULL, *cr_deltas= NULL, *swap_deltas= NULL; - EditVert *eve= NULL; - MultiApplyData data; - int i, j; - - /* Prepare deltas */ - pr_deltas= MEM_callocN(sizeof(vec3f)*last_lvl->totvert, "multires deltas 1"); - cr_deltas= MEM_callocN(sizeof(vec3f)*last_lvl->totvert, "multires deltas 2"); - - /* Calculate initial deltas -- current mesh subtracted from current level*/ - if(em) eve= em->verts.first; - for(i=0; itotvert; ++i) { - if(em) { - VecSubf(&cr_deltas[i].x, eve->co, me->mr->verts[i].co); - eve= eve->next; - } else - VecSubf(&cr_deltas[i].x, me->mvert[i].co, me->mr->verts[i].co); - } - - - /* Copy current level's vertex flags and clear the rest */ - if(em) eve= em->verts.first; - for(i=0; i < last_lvl->totvert; ++i) { - if(i < cr_lvl->totvert) { - MVert mvflag; - multires_get_vert(&mvflag, eve, &me->mvert[i], i); - if(em) eve= eve->next; - me->mr->verts[i].flag= mvflag.flag; - } - else - me->mr->verts[i].flag= 0; - } - - /* If already on the highest level, copy current verts (including flags) into current level */ - if(cr_lvl == last_lvl) { - if(em) - eve= em->verts.first; - for(i=0; itotvert; ++i) { - multires_get_vert(&me->mr->verts[i], eve, &me->mvert[i], i); - if(em) eve= eve->next; - } - } - - /* Update higher levels */ - pr_lvl= BLI_findlink(&me->mr->levels,me->mr->current-1); - cr_lvl= pr_lvl->next; - while(cr_lvl) { - multires_calc_temp_data(pr_lvl); - - /* Swap the old/new deltas */ - swap_deltas= pr_deltas; - pr_deltas= cr_deltas; - cr_deltas= swap_deltas; - - /* Calculate and add new deltas - ============================ */ - for(i=0; itotface; ++i) { - const MultiresFace *f= &pr_lvl->faces[i]; - data.corner1= &pr_deltas[f->v[0]].x; - data.corner2= &pr_deltas[f->v[1]].x; - data.corner3= &pr_deltas[f->v[2]].x; - data.corner4= &pr_deltas[f->v[3]].x; - data.quad= f->v[3] ? 1 : 0; - multi_apply(&cr_deltas[f->mid].x, &data, 3, catmullclark_smooth_face); - - for(j=0; j<(data.quad?4:3); ++j) - me->mr->verts[f->mid].flag |= me->mr->verts[f->v[j]].flag; - } - - for(i=0; itotedge; ++i) { - const MultiresEdge *e= &pr_lvl->edges[i]; - data.boundary= pr_lvl->edge_boundary_states[i]; - edge_face_neighbor_midpoints_accum(&data,pr_lvl,cr_deltas,sizeof(vec3f),e); - data.endpoint1= &pr_deltas[e->v[0]].x; - data.endpoint2= &pr_deltas[e->v[1]].x; - multi_apply(&cr_deltas[e->mid].x, &data, 3, catmullclark_smooth_edge); - - for(j=0; j<2; ++j) - me->mr->verts[e->mid].flag |= me->mr->verts[e->v[j]].flag; - } - - for(i=0; itotvert; ++i) { - data.boundary= multires_vert_is_boundary(pr_lvl,i); - data.original= &pr_deltas[i].x; - data.edge_count= BLI_countlist(&pr_lvl->vert_edge_map[i]); - if(data.boundary) - boundary_edges_average(&data,pr_lvl,pr_deltas,sizeof(vec3f),i); - else { - vert_face_neighbor_midpoints_average(&data,pr_lvl,cr_deltas,sizeof(vec3f),i); - vert_edge_neighbor_midpoints_average(&data,pr_lvl,pr_deltas,sizeof(vec3f),i); - } - multi_apply(&cr_deltas[i].x, &data, 3, catmullclark_smooth_vert); - } - - /* Apply deltas to vertex locations */ - for(i=0; (cr_lvl == last_lvl) && (i < cr_lvl->totvert); ++i) { - VecAddf(me->mr->verts[i].co, - me->mr->verts[i].co, - &cr_deltas[i].x); - } - - multires_free_temp_data(pr_lvl); - - pr_lvl= pr_lvl->next; - cr_lvl= cr_lvl->next; - } - if(pr_deltas) MEM_freeN(pr_deltas); - if(cr_deltas) MEM_freeN(cr_deltas); - -} - -void multires_update_faces(Mesh *me, EditMesh *em) -{ - MultiresLevel *cr_lvl= current_level(me->mr), *pr_lvl= NULL, - *last_lvl= me->mr->levels.last; - char *pr_flag_damaged= NULL, *cr_flag_damaged= NULL, *or_flag_damaged= NULL, - *pr_mat_damaged= NULL, *cr_mat_damaged= NULL, *or_mat_damaged= NULL, *swap= NULL; - EditFace *efa= NULL; - unsigned i,j,curf; - - /* Find for each face whether flag/mat has changed */ - pr_flag_damaged= MEM_callocN(sizeof(char) * last_lvl->totface, "flag_damaged 1"); - cr_flag_damaged= MEM_callocN(sizeof(char) * last_lvl->totface, "flag_damaged 1"); - pr_mat_damaged= MEM_callocN(sizeof(char) * last_lvl->totface, "mat_damaged 1"); - cr_mat_damaged= MEM_callocN(sizeof(char) * last_lvl->totface, "mat_damaged 1"); - if(em) efa= em->faces.first; - for(i=0; itotface; ++i) { - MultiresFace mftmp; - multires_get_face(&mftmp, efa, &me->mface[i]); - if(cr_lvl->faces[i].flag != mftmp.flag) - cr_flag_damaged[i]= 1; - if(cr_lvl->faces[i].mat_nr != mftmp.mat_nr) - cr_mat_damaged[i]= 1; - - /* Update current level */ - cr_lvl->faces[i].flag= mftmp.flag; - cr_lvl->faces[i].mat_nr= mftmp.mat_nr; - - if(em) efa= efa->next; - } - or_flag_damaged= MEM_dupallocN(cr_flag_damaged); - or_mat_damaged= MEM_dupallocN(cr_mat_damaged); - - /* Update lower levels */ - cr_lvl= cr_lvl->prev; - while(cr_lvl) { - swap= pr_flag_damaged; - pr_flag_damaged= cr_flag_damaged; - cr_flag_damaged= swap; - - swap= pr_mat_damaged; - pr_mat_damaged= cr_mat_damaged; - cr_mat_damaged= swap; - - curf= 0; - for(i=0; itotface; ++i) { - const int sides= cr_lvl->faces[i].v[3] ? 4 : 3; - - /* Check damages */ - for(j=0; jfaces[i].flag= cr_lvl->next->faces[curf].flag; - cr_flag_damaged[i]= 1; - } - if(pr_mat_damaged[curf]) { - cr_lvl->faces[i].mat_nr= cr_lvl->next->faces[curf].mat_nr; - cr_mat_damaged[i]= 1; - } - } - } - - cr_lvl= cr_lvl->prev; - } - - /* Clear to original damages */ - if(cr_flag_damaged) MEM_freeN(cr_flag_damaged); - if(cr_mat_damaged) MEM_freeN(cr_mat_damaged); - cr_flag_damaged= or_flag_damaged; - cr_mat_damaged= or_mat_damaged; - - /* Update higher levels */ - pr_lvl= current_level(me->mr); - cr_lvl= pr_lvl->next; - while(cr_lvl) { - swap= pr_flag_damaged; - pr_flag_damaged= cr_flag_damaged; - cr_flag_damaged= swap; - - swap= pr_mat_damaged; - pr_mat_damaged= cr_mat_damaged; - cr_mat_damaged= swap; - - /* Update faces */ - for(i=0, curf= 0; itotface; ++i) { - const int sides= cr_lvl->prev->faces[i].v[3] ? 4 : 3; - for(j=0; jfaces[curf].flag= pr_lvl->faces[i].flag; - cr_flag_damaged[curf]= 1; - } - if(pr_mat_damaged[i]) { - cr_lvl->faces[curf].mat_nr= pr_lvl->faces[i].mat_nr; - cr_mat_damaged[curf]= 1; - } - } - } - - pr_lvl= pr_lvl->next; - cr_lvl= cr_lvl->next; - } - - if(pr_flag_damaged) MEM_freeN(pr_flag_damaged); - if(cr_flag_damaged) MEM_freeN(cr_flag_damaged); - if(pr_mat_damaged) MEM_freeN(pr_mat_damaged); - if(cr_mat_damaged) MEM_freeN(cr_mat_damaged); -} - -void multires_update_levels(Mesh *me, const int render) -{ - EditMesh *em= (!render && G.obedit) ? G.editMesh : NULL; - - multires_update_first_level(me, em); - multires_update_vertices(me, em); - multires_update_faces(me, em); - multires_update_colors(me); -} - -void multires_calc_temp_data(MultiresLevel *lvl) -{ - unsigned i, j, emax; - MultiresMapNode *indexnode= NULL; - - lvl->map_mem= MEM_mallocN(sizeof(MultiresMapNode)*(lvl->totedge*2 + lvl->totface*4), "map_mem"); - indexnode= lvl->map_mem; - - /* edge map */ - lvl->vert_edge_map= MEM_callocN(sizeof(ListBase)*lvl->totvert,"vert_edge_map"); - for(i=0; itotedge; ++i) { - for(j=0; j<2; ++j, ++indexnode) { - indexnode->Index= i; - BLI_addtail(&lvl->vert_edge_map[lvl->edges[i].v[j]], indexnode); - } - } - - /* face map */ - lvl->vert_face_map= MEM_callocN(sizeof(ListBase)*lvl->totvert,"vert_face_map"); - for(i=0; itotface; ++i){ - for(j=0; j<(lvl->faces[i].v[3]?4:3); ++j, ++indexnode) { - indexnode->Index= i; - BLI_addtail(&lvl->vert_face_map[lvl->faces[i].v[j]], indexnode); - } - } - - /* edge boundaries */ - emax = (lvl->prev ? (lvl->prev->totedge * 2) : lvl->totedge); - lvl->edge_boundary_states= MEM_callocN(sizeof(char)*lvl->totedge, "edge_boundary_states"); - for(i=0; ivert_face_map[lvl->edges[i].v[0]].first; - unsigned total= 0; - - lvl->edge_boundary_states[i] = 1; - while(n1 && lvl->edge_boundary_states[i] == 1) { - MultiresMapNode *n2= lvl->vert_face_map[lvl->edges[i].v[1]].first; - while(n2) { - if(n1->Index == n2->Index) { - ++total; - - if(total > 1) { - lvl->edge_boundary_states[i] = 0; - break; - } - } - - n2= n2->next; - } - n1= n1->next; - } - } -} - -void multires_edge_level_update(void *ob, void *me_v) -{ - if(!G.obedit) { - Mesh *me= me_v; - MultiresLevel *cr_lvl= BLI_findlink(&me->mr->levels,me->mr->current-1); - MultiresLevel *edge_lvl= BLI_findlink(&me->mr->levels,me->mr->edgelvl-1); - const int threshold= edge_lvl->totedge * powf(2, me->mr->current - me->mr->edgelvl); - unsigned i; - - for(i=0; itotedge; ++i) { - const int ndx= me->pv ? me->pv->edge_map[i] : i; - if(ndx != -1) { /* -1= hidden edge */ - if(me->mr->edgelvl >= me->mr->current || imedge[ndx].flag |= ME_EDGEDRAW | ME_EDGERENDER; - else - me->medge[ndx].flag &= ~ME_EDGEDRAW & ~ME_EDGERENDER; - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } -} - -int multires_modifier_warning() -{ - ModifierData *md; - - for(md= modifiers_getVirtualModifierList(OBACT); md; md= md->next) { - if(md->mode & eModifierMode_Render) { - switch(md->type) { - case eModifierType_Subsurf: - case eModifierType_Build: - case eModifierType_Mirror: - case eModifierType_Decimate: - case eModifierType_Boolean: - case eModifierType_Array: - case eModifierType_EdgeSplit: - return 1; - } - } - } - - return 0; -} diff --git a/source/blender/src/mywindow.c b/source/blender/src/mywindow.c deleted file mode 100644 index 56ef28d3a6e..00000000000 --- a/source/blender/src/mywindow.c +++ /dev/null @@ -1,744 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - * - * for compatibility with old iris code, replacement of swinopen, winset, etc - * btw: subwindows in X are way too slow, tried it, and choose for my own system... (ton) - * - */ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_gsqueue.h" - -#include "DNA_screen_types.h" - -#include "BKE_global.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" - -#include "mydevice.h" -#include "blendef.h" - -#include "winlay.h" - -typedef struct { - struct bWindow *next, *prev; - int id, pad; - - int xmin, xmax, ymin, ymax; - float viewmat[4][4], winmat[4][4]; - - GSQueue *qevents; -} bWindow; - -/* globals */ -static Window *winlay_mainwindow; -static int curswin=0; -static bWindow *swinarray[MAXWIN]= {NULL}; -static bWindow mainwindow, renderwindow; -static int mainwin_color_depth; - -/* prototypes --------------- */ -void mywindow_init_mainwin(Window *, int , int , int , int ); -void mywindow_build_and_set_renderwin( int , int , int , int); - -void mywindow_init_mainwin(Window *win, int orx, int ory, int sizex, int sizey) -{ - GLint r, g, b; - - winlay_mainwindow= win; - - swinarray[1]= &mainwindow; - curswin= 1; - - mainwindow.xmin= orx; - mainwindow.ymin= ory; - mainwindow.xmax= orx+sizex-1; - mainwindow.ymax= ory+sizey-1; - mainwindow.qevents= NULL; - - myortho2(-0.375, (float)sizex-0.375, -0.375, (float)sizey-0.375); - glLoadIdentity(); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)mainwindow.winmat); - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)mainwindow.viewmat); - - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - - mainwin_color_depth= r + g + b; - if(G.f & G_DEBUG) { - printf("Color depth r %d g %d b %d\n", (int)r, (int)g, (int)b); - glGetIntegerv(GL_AUX_BUFFERS, &r); - printf("Aux buffers: %d\n", (int)r); - } -} - -/* XXXXXXXXXXXXXXXX very hacky, because of blenderwindows vs ghostwindows vs renderwindow - this routine sets up a blenderwin (a mywin) - */ -void mywindow_build_and_set_renderwin( int orx, int ory, int sizex, int sizey) -{ - - swinarray[2]= &renderwindow; - curswin= 2; /* myortho2 needs this to be set */ - - renderwindow.xmin= orx; - renderwindow.ymin= ory; - renderwindow.xmax= orx+sizex-1; - renderwindow.ymax= ory+sizey-1; - renderwindow.qevents= NULL; - - myortho2(-0.375, (float)sizex-0.375, -0.375, (float)sizey-0.375); - glLoadIdentity(); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)renderwindow.winmat); - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)renderwindow.viewmat); - mywinset(2); - -} - -/* ------------------------------------------------------------------------- */ - - /* XXXXX, remove later */ -static bWindow *bwin_from_winid(int winid) -{ - bWindow *bwin= swinarray[winid]; - if (!bwin) { - printf("bwin_from_winid: Internal error, bad winid: %d\n", winid); - } - return bwin; -} - -int bwin_qtest(int winid) -{ - return !BLI_gsqueue_is_empty(bwin_from_winid(winid)->qevents); -} -int bwin_qread(int winid, BWinEvent *evt_r) -{ - if (bwin_qtest(winid)) { - BLI_gsqueue_pop(bwin_from_winid(winid)->qevents, evt_r); - return 1; - } else { - return 0; - } -} -void bwin_qadd(int winid, BWinEvent *evt) -{ - BLI_gsqueue_push(bwin_from_winid(winid)->qevents, evt); -} - -/* ------------------------------------------------------------------------- */ - -void bwin_get_rect(int winid, rcti *rect_r) -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - rect_r->xmin= win->xmin; - rect_r->ymin= win->ymin; - rect_r->xmax= win->xmax; - rect_r->ymax= win->ymax; - } -} - -void bwin_getsize(int win, int *x, int *y) -{ - if(win<4) { - if (win==1) { - window_get_size(winlay_mainwindow, x, y); - } else { - printf("bwin_getsize: Internal error, bad winid: %d\n", win); - *x= *y= 0; - } - } else { - bWindow *bwin= swinarray[win]; - if (bwin) { - *x= bwin->xmax-bwin->xmin+1; - *y= bwin->ymax-bwin->ymin+1; - } - } -} - -void bwin_getsuborigin(int win, int *x, int *y) -{ - if(win<4) { - *x= *y= 0; - } else { - bWindow *bwin= swinarray[win]; - if (bwin) { - *x= bwin->xmin; - *y= bwin->ymin; - } - } -} - -void bwin_getsinglematrix(int winid, float mat[][4]) -{ - bWindow *win; - float matview[4][4], matproj[4][4]; - - win= swinarray[winid]; - if(win==NULL) { - glGetFloatv(GL_PROJECTION_MATRIX, (float *)matproj); - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)matview); - Mat4MulMat4(mat, matview, matproj); - } - else { - Mat4MulMat4(mat, win->viewmat, win->winmat); - } -} - -/* ------------------------------------------------------------------------- */ - -void bwin_load_viewmatrix(int winid, float mat[][4]) -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - glLoadMatrixf(mat); - Mat4CpyMat4(win->viewmat, mat); - } -} -void bwin_load_winmatrix(int winid, float mat[][4]) -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - glLoadMatrixf(mat); - Mat4CpyMat4(win->winmat, mat); - } -} - -void bwin_get_viewmatrix(int winid, float mat[][4]) -{ - bWindow *win= bwin_from_winid(winid); - if(win) - Mat4CpyMat4(mat, win->viewmat); -} -void bwin_get_winmatrix(int winid, float mat[][4]) -{ - bWindow *win= bwin_from_winid(winid); - if(win) - Mat4CpyMat4(mat, win->winmat); -} - -void bwin_multmatrix(int winid, float mat[][4]) -{ - bWindow *win= bwin_from_winid(winid); - - if(win) { - glMultMatrixf((float*) mat); - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->viewmat); - } -} - -void bwin_scalematrix(int winid, float x, float y, float z) -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - glScalef(x, y, z); - glGetFloatv(GL_MODELVIEW_MATRIX, (float *)win->viewmat); - } -} - -void bwin_clear_viewmat(int swin) -{ - bWindow *win; - - win= swinarray[swin]; - if(win==NULL) return; - - memset(win->viewmat, 0, sizeof(win->viewmat)); - win->viewmat[0][0]= 1.0; - win->viewmat[1][1]= 1.0; - win->viewmat[2][2]= 1.0; - win->viewmat[3][3]= 1.0; -} - - -void myloadmatrix(float mat[][4]) -{ - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) { - bwin_load_viewmatrix(curswin, mat); - } else { - bwin_load_winmatrix(curswin, mat); - } -} - -void mygetmatrix(float mat[][4]) -{ - if (glaGetOneInteger(GL_MATRIX_MODE)==GL_MODELVIEW) { - bwin_get_viewmatrix(curswin, mat); - } else { - bwin_get_winmatrix(curswin, mat); - } -} - -void mymultmatrix(float mat[][4]) -{ - bwin_multmatrix(curswin, mat); -} - -void mygetsingmatrix(float mat[][4]) -{ - bwin_getsinglematrix(curswin, mat); -} - -int mywinget(void) -{ - return curswin; -} - -void mywinset(int wid) -{ - bWindow *win; - - win= swinarray[wid]; - if(win==NULL) { - printf("mywinset %d: doesn't exist\n", wid); - return; - } - if (wid == 1 || wid == 2) { /* main window or renderwindow*/ - glViewport(0, 0, ( win->xmax-win->xmin)+1, ( win->ymax-win->ymin)+1); - glScissor(0, 0, ( win->xmax-win->xmin)+1, ( win->ymax-win->ymin)+1); - } - else { - int width= (win->xmax - win->xmin)+1; - int height= (win->ymax - win->ymin)+1; - - /* CRITICAL, this clamping ensures that - * the viewport never goes outside the screen - * edges (assuming the x, y coords aren't - * outside). This causes a hardware lock - * on Matrox cards if it happens. - * - * Really Blender should never _ever_ try - * to do such a thing, but just to be safe - * clamp it anyway (or fix the bScreen - * scaling routine, and be damn sure you - * fixed it). - zr - */ - if (win->xmin + width>G.curscreen->sizex) - width= G.curscreen->sizex - win->xmin; - if (win->ymin + height>G.curscreen->sizey) - height= G.curscreen->sizey - win->ymin; - - glViewport(win->xmin, win->ymin, width, height); - glScissor(win->xmin, win->ymin, width, height); - } - - glMatrixMode(GL_PROJECTION); - glLoadMatrixf(&win->winmat[0][0]); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixf(&win->viewmat[0][0]); - - glFlush(); - - curswin= wid; -} - -int myswinopen(int parentid, int xmin, int xmax, int ymin, int ymax) -{ - bWindow *win= NULL; - int freewinid; - - for (freewinid= 4; freewinidid= freewinid; - swinarray[win->id]= win; - - win->xmin= xmin; - win->ymin= ymin; - win->xmax= xmax; - win->ymax= ymax; - - win->qevents= BLI_gsqueue_new(sizeof(BWinEvent)); - - Mat4One(win->viewmat); - Mat4One(win->winmat); - - mywinset(win->id); - - return win->id; - } -} - -int myswinopen_allowed(void) -{ - int totfree=0; - int freewinid; - - for (freewinid= 4; freewinidqevents); - MEM_freeN(win); - } else { - printf("mwinclose: Internal error, bad winid: %d\n", winid); - } - } - - swinarray[winid]= NULL; - if (curswin==winid) curswin= 0; -} - -void mywinposition(int winid, int xmin, int xmax, int ymin, int ymax) /* watch: syntax differs from iris */ -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - win->xmin= xmin; - win->ymin= ymin; - win->xmax= xmax; - win->ymax= ymax; - } -} - - -void bwin_ortho(int winid, float x1, float x2, float y1, float y2, float n, float f) -{ - bWindow *bwin= bwin_from_winid(winid); - if(bwin) { - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - - glOrtho(x1, x2, y1, y2, n, f); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)bwin->winmat); - glMatrixMode(GL_MODELVIEW); - } -} - -void bwin_ortho2(int win, float x1, float x2, float y1, float y2) -{ - bwin_ortho(win, x1, x2, y1, y2, -1, 1); -} - -void bwin_frustum(int winid, float x1, float x2, float y1, float y2, float n, float f) -{ - bWindow *win= bwin_from_winid(winid); - if(win) { - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(x1, x2, y1, y2, n, f); - - glGetFloatv(GL_PROJECTION_MATRIX, (float *)win->winmat); - glMatrixMode(GL_MODELVIEW); - } -} - -void myortho(float x1, float x2, float y1, float y2, float n, float f) -{ - bwin_ortho(curswin, x1, x2, y1, y2, n, f); -} - -void myortho2(float x1, float x2, float y1, float y2) -{ - /* prevent opengl from generating errors */ - if(x1==x2) x2+=1.0; - if(y1==y2) y2+=1.0; - bwin_ortho(curswin, x1, x2, y1, y2, -100, 100); -} - -void mywindow(float x1, float x2, float y1, float y2, float n, float f) -{ - bwin_frustum(curswin, x1, x2, y1, y2, n, f); -} - -#ifdef __APPLE__ - -/* apple seems to round colors to below and up on some configs */ - -static unsigned int index_to_framebuffer(int index) -{ - unsigned int i= index; - - switch(mainwin_color_depth) { - case 12: - i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4); - /* sometimes dithering subtracts! */ - i |= 0x070707; - break; - case 15: - case 16: - i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3); - i |= 0x030303; - break; - case 24: - break; - default: // 18 bits... - i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2); - i |= 0x010101; - break; - } - - return i; -} - -#else - -/* this is the old method as being in use for ages.... seems to work? colors are rounded to lower values */ - -static unsigned int index_to_framebuffer(int index) -{ - unsigned int i= index; - - switch(mainwin_color_depth) { - case 8: - i= ((i & 48)<<18) + ((i & 12)<<12) + ((i & 3)<<6); - i |= 0x3F3F3F; - break; - case 12: - i= ((i & 0xF00)<<12) + ((i & 0xF0)<<8) + ((i & 0xF)<<4); - /* sometimes dithering subtracts! */ - i |= 0x0F0F0F; - break; - case 15: - case 16: - i= ((i & 0x7C00)<<9) + ((i & 0x3E0)<<6) + ((i & 0x1F)<<3); - i |= 0x070707; - break; - case 24: - break; - default: // 18 bits... - i= ((i & 0x3F000)<<6) + ((i & 0xFC0)<<4) + ((i & 0x3F)<<2); - i |= 0x030303; - break; - } - - return i; -} - -#endif - -void set_framebuffer_index_color(int index) -{ - cpack(index_to_framebuffer(index)); -} - -int framebuffer_to_index(unsigned int col) -{ - if (col==0) return 0; - - switch(mainwin_color_depth) { - case 8: - return ((col & 0xC00000)>>18) + ((col & 0xC000)>>12) + ((col & 0xC0)>>6); - case 12: - return ((col & 0xF00000)>>12) + ((col & 0xF000)>>8) + ((col & 0xF0)>>4); - case 15: - case 16: - return ((col & 0xF80000)>>9) + ((col & 0xF800)>>6) + ((col & 0xF8)>>3); - case 24: - return col & 0xFFFFFF; - default: // 18 bits... - return ((col & 0xFC0000)>>6) + ((col & 0xFC00)>>4) + ((col & 0xFC)>>2); - } -} - - -/* ********** END MY WINDOW ************** */ - -#ifdef WIN32 -static int is_a_really_crappy_nvidia_card(void) { - static int well_is_it= -1; - - /* Do you understand the implication? Do you? */ - if (well_is_it==-1) - well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0); - - return well_is_it; -} -#endif - -void myswapbuffers(void) -{ - ScrArea *sa; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->win_swap==WIN_BACK_OK) sa->win_swap= WIN_FRONT_OK; - if(sa->head_swap==WIN_BACK_OK) sa->head_swap= WIN_FRONT_OK; - - sa= sa->next; - } - - /* HACK, some windows drivers feel they should honor the scissor - * test when swapping buffers, disable the test while swapping - * on WIN32. (namely Matrox and NVidia's new drivers around Oct 1 2001) - * - zr - */ - -#ifdef WIN32 - /* HACK, in some NVidia driver release some kind of - * fancy optimiziation (I presume) was put in which for - * some reason causes parts of the buffer not to be - * swapped. One way to defeat it is the following wierd - * code (which we only do for nvidia cards). This should - * be removed if NVidia fixes their drivers. - zr - */ - if (is_a_really_crappy_nvidia_card()) { - glDrawBuffer(GL_FRONT); - - glBegin(GL_LINES); - glEnd(); - - glDrawBuffer(GL_BACK); - } - - glDisable(GL_SCISSOR_TEST); - window_swap_buffers(winlay_mainwindow); - glEnable(GL_SCISSOR_TEST); -#else - window_swap_buffers(winlay_mainwindow); -#endif -} - - -/* *********************** PATTERNS ETC ***************** */ - -void setlinestyle(int nr) -{ - if(nr==0) { - glDisable(GL_LINE_STIPPLE); - } - else { - - glEnable(GL_LINE_STIPPLE); - glLineStipple(nr, 0xAAAA); - } -} - -/*******************/ -/*******************/ -/* Menu utilities */ - -static int *frontbuffer_save= NULL; -static int ov_x, ov_y, ov_sx, ov_sy; - -/* -#if defined(__sgi) || defined(__sun) || defined(__sun__) || defined (__sparc) || defined (__sparc__) -*/ -/* this is a dirty patch: gets sometimes the backbuffer */ -/* my_get_frontbuffer_image(0, 0, 1, 1); -my_put_frontbuffer_image(); -#endif -*/ - -void my_put_frontbuffer_image(void) -{ - if (frontbuffer_save) { - glRasterPos2f( (float)ov_x -0.5, (float)ov_y - 0.5 ); - glDrawPixels(ov_sx, ov_sy, GL_RGBA, GL_UNSIGNED_BYTE, frontbuffer_save); - MEM_freeN(frontbuffer_save); - frontbuffer_save= NULL; - } -} - -void my_get_frontbuffer_image(int x, int y, int sx, int sy) -{ - if(frontbuffer_save) return; - - ov_x= x; - ov_y= y; - ov_sx= sx; - ov_sy= sy; - - if(sx>1 && sy>1) { - frontbuffer_save= MEM_mallocN(sx*sy*4, "temp_frontbuffer_image"); - glReadPixels(x, y, sx, sy, GL_RGBA, GL_UNSIGNED_BYTE, frontbuffer_save); - } - - #ifdef WIN32 - /* different coord system! */ - y= (G.curscreen->sizey-y); - - if(curswin>3) { - y -= curarea->winrct.ymin; - } - #endif -} - -int mywin_inmenu(void) { - return frontbuffer_save?1:0; -} - -void mywin_getmenu_rect(int *x, int *y, int *sx, int *sy) { - *x= ov_x; - *sx= ov_sx; - *sy= ov_sy; - -#if defined(WIN32) || defined (__BeOS) - *y= ov_y; -#else - *y= (G.curscreen->sizey - ov_y) - ov_sy; -#endif -} diff --git a/source/blender/src/oops.c b/source/blender/src/oops.c deleted file mode 100644 index 7def4ca615e..00000000000 --- a/source/blender/src/oops.c +++ /dev/null @@ -1,1104 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_curve_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_texture_types.h" -#include "DNA_key_types.h" -#include "DNA_group_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_main.h" - -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_oops.h" -#include "BIF_drawoops.h" -#include "BIF_outliner.h" - -#include "blendef.h" -#include "mydevice.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -static int correct_oops_y(Oops *oops); - - -Oops *add_oops(void *id) -{ - Oops *oops; - - if(G.soops==0) return NULL; - oops= MEM_callocN(sizeof(Oops), "oops"); - - BLI_addtail(&G.soops->oops, oops); - - oops->id= id; - oops->type= GS(oops->id->name); - - return oops; -} - - -Oops *find_oops(ID *id) -{ - Oops *oops; - - /* searching for an oops with this ID */ - oops= G.soops->oops.first; - while(oops) { - if(oops->id == id) { - /* this error once happened. securing it doesnt harm */ - if(oops->type != GS(id->name)) oops->id= 0; - else break; - } - oops= oops->next; - } - return oops; -} - -/* never even called! (ton) */ -int test_oops(Oops *oops) -{ - /* test if own ID block still exists */ - ListBase *lb; - ID *id; - - if(G.soops==0) return 0; - - lb= wich_libbase(G.main, oops->type); - id= lb->first; - while(id) { - if(id==oops->id) break; - id= id->next; - } - - if(id==0) return 0; - - - return 1; -} - -void test_oopslinko(OopsLink *ol) -{ - /* test if links exist */ - Oops *oops; - ListBase *lb; - ID *id, *from; - - if(G.soops==0) return; - - ol->to= 0; - from= *ol->idfrom; - - if(from==0) return; - - lb= wich_libbase(G.main, ol->type); - id= lb->first; - while(id) { - if(id==from) break; - id= id->next; - } - - if(id==0) { - /* ID does not exist anymore */ - *ol->idfrom= 0; - } - else { - /* search for oops with this ID */ - oops= G.soops->oops.first; - while(oops) { - if(oops->id == id) break; - oops= oops->next; - } - - ol->to= oops; - } -} - -void test_oopslink(OopsLink *ol) -{ - /* test if links exist */ - Oops *oops; - ID *from; - - if(G.soops==0) return; - - ol->to= 0; - from= *ol->idfrom; - - if(from==0) return; - - /* search for oops with this ID */ - oops= G.soops->oops.first; - while(oops) { - if(oops->id == from) break; - oops= oops->next; - } - - ol->to= oops; - if(oops) oops->flag |= OOPS_REFER; -} - - -OopsLink *add_oopslink(char *name, Oops *oops, short type, void *from, float xof, float yof) -{ - OopsLink *ol; - - if(G.soops==0) return NULL; - - /* testing if it exsists: */ - /* ol= oops->link.first; */ - /* while(ol) { */ - /* if(ol->idfrom == from) { */ - /* strncpy(ol->name, name, 11); */ - /* ol->type= type; */ - /* ol->xof= xof; */ - /* ol->yof= yof; */ - /* return ol; */ - /* } */ - /* ol= ol->next; */ - /* } */ - - if(* ((int *)from) == 0) return NULL; - - /* make new */ - ol= MEM_callocN(sizeof(OopsLink), "oopslink"); - - BLI_addtail(&oops->link, ol); - - ol->type= type; - ol->idfrom= from; - ol->xof= xof; - ol->yof= yof; - BLI_strncpy(ol->name, name, sizeof(ol->name)); - - return ol; -} - -int oops_test_overlap(Oops *test) -{ - Oops *oops; - rctf rt, ro; - - rt.xmin= test->x; - rt.xmax= (float)(test->x+OOPSX); - rt.ymin= test->y; - rt.ymax= (float)(test->y+OOPSY); - - oops= G.soops->oops.first; - while(oops) { - if(oops!=test) { /* do net test for hide: is only a temporal flag */ - - ro.xmin= oops->x; - ro.xmax= (float)(oops->x+OOPSX); - ro.ymin= oops->y; - ro.ymax= (float)(oops->y+OOPSY); - - if( BLI_isect_rctf(&rt, &ro, 0) ) return 1; - - } - oops= oops->next; - } - - return 0; -} - -int oops_test_overlaphide(Oops *test) -{ - Oops *oops; - rctf rt, ro; - - rt.xmin= (float)(test->x); - rt.xmax= (float)(test->x+OOPSX); - rt.ymin= (float)(test->y); - rt.ymax= (float)(test->y+OOPSY); - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0 && oops!=test) { /* do test for hide, but not use it during build_oops */ - - ro.xmin= oops->x; - ro.xmax= (float)(oops->x+OOPSX); - ro.ymin= oops->y; - ro.ymax= (float)(oops->y+OOPSY); - - if( BLI_isect_rctf(&rt, &ro, 0) ) return 1; - - } - oops= oops->next; - } - - return 0; -} - -float oopslink_totlen(Oops *oops) -{ - OopsLink *ol; - float vec[4], dx, dy, len= 0.0; - - - ol= oops->link.first; - while(ol) { - if(ol->to) { - give_oopslink_line(oops, ol, vec, vec+2); - - dx= vec[0]-vec[2]; - dy= vec[1]-vec[3]; - - len+= (float)sqrt( dx*dx + dy*dy ); - } - ol= ol->next; - } - return len; -} - - -void add_from_link(Oops *from, Oops *oops) -{ - OopsLink *ol; - - ol= MEM_callocN(sizeof(OopsLink), "oopslinktemp"); - BLI_addtail(&oops->link, ol); - ol->from= from; - -} - -void shuffle_oops() -{ - Oops *o2, *oops; - OopsLink *ol, *oln; - float olen, len1, f1, f2; - int go= 1, tot=0, dir=1, type1, type2; - - - /* we take two oopses, calc the 'beauty' and the exchanged beauty */ - - if(G.soops==0) return; - - waitcursor(1); - - /* to make it 100% OK and fast: temporal insert - * to the ooplinklist - per oops - the 'from' links. - * Don't forget to free! - */ - - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - ol= oops->link.first; - while(ol) { - if(ol->to && ol->to->hide==0) { - if(ol->to->flag & SELECT) { - add_from_link(oops, ol->to); - } - } - ol= ol->next; - } - } - oops= oops->next; - } - - while(go) { - - go= 0; - dir= 1-dir; - tot++; - - if(dir) oops= G.soops->oops.last; - else oops= G.soops->oops.first; - while(oops) { - - if(oops->link.first && oops->hide==0 && (oops->flag & SELECT)) { - /* find a good exchangable pair */ - olen= oopslink_totlen(oops); - - if(dir) o2= oops->prev; - else o2= oops->next; - - if ELEM3(oops->type, ID_OB, ID_LI, ID_SCE) type1= 1; else type1= 0; - - - while(o2) { - if(o2->hide==0 && (o2->flag & SELECT)) { - - if ELEM3(o2->type, ID_OB, ID_LI, ID_SCE) type2= 1; else type2= 0; - - if(type1==type2) { - - len1= oopslink_totlen(o2); - - SWAP(float, oops->x, o2->x); - SWAP(float, oops->y, o2->y); - - f1= oopslink_totlen(oops); - f2= oopslink_totlen(o2); - - if( f1<=olen && f2x, o2->x); - SWAP(float, oops->y, o2->y); - } - } - } - if(dir) o2= o2->prev; - else o2= o2->next; - } - } - if(dir) oops= oops->prev; - else oops= oops->next; - - - } - if(tot>5) break; - } - waitcursor(0); - - /* free the from links */ - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - ol= oops->link.first; - while(ol) { - oln= ol->next; - if(ol->from) { - BLI_remlink(&oops->link, ol); - MEM_freeN(ol); - } - ol= oln; - } - } - oops= oops->next; - } - - allqueue(REDRAWOOPS, 1); -} - -void shrink_oops() -{ - Oops *oops; - OopsLink *ol; - float vec[4]; - int /* go= 1, */tot=4; - - - if(G.soops==0) return; - - if(okee("Shrink oops")==0) return; - - waitcursor(1); - - /* clear */ - oops= G.soops->oops.first; - while(oops) { - oops->dx= oops->dy= 0.0; - oops= oops->next; - } - - while(tot) { - tot--; - - /* shrink */ - oops= G.soops->oops.first; - while(oops) { - if(oops->link.first && oops->hide==0 && (oops->flag & SELECT)) { - - ol= oops->link.first; - while(ol) { - if(ol->to && ol->to->hide==0) { - - give_oopslink_line(oops, ol, vec, vec+2); - - oops->dx= (float)(.8*oops->dx + .2*( vec[2]-vec[0])); - oops->dy= (float)(.8*oops->dy + .2*( vec[3]-vec[1])); - - if(ol->to->flag & SELECT) { - ol->to->dx= (float)(.8*ol->to->dx + .2*( vec[0]-vec[2])); - ol->to->dy= (float)(.8*ol->to->dy + .2*( vec[1]-vec[3])); - } - } - - ol= ol->next; - } - } - oops= oops->next; - } - - /* apply */ - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0 && (oops->flag & SELECT)) { - - /* shrink */ - oops->x+= oops->dx; - oops->y+= oops->dy; - - if(oops_test_overlaphide(oops)) { - oops->x-= oops->dx; - oops->y-= oops->dy; - } - - oops->dx= oops->dy= 0.0; - } - oops= oops->next; - } - } - waitcursor(0); - - allqueue(REDRAWOOPS, 1); -} - -#define LIMSCE -20.0 -#define LIMOB 14.0 -#define LIMDATA 24.0 - -static int correct_oops_y(Oops *oops) -{ - float y; - - y= oops->y; - - switch(oops->type) { - case ID_SCE: - case ID_LI: - if(oops->y > LIMSCE-OOPSY) oops->y= (float)(LIMSCE-OOPSY); - break; - case ID_OB: - CLAMP(oops->y, LIMSCE, LIMOB); - break; - case ID_IP: - case ID_MA: - case ID_TE: - if(oops->y < LIMDATA+OOPSY) oops->y= (float)(LIMDATA+OOPSY); - break; - default: - CLAMP(oops->y, (float)(LIMOB+OOPSY), LIMDATA); - break; - } - - if(y==oops->y) return 0; - else return 1; -} - -float oopslastx=0.0, oopslasty= 0.0; - -void new_oops_location(Oops *new) -{ - float dirvec[4][2]; - static int cnt=0; - int a, b, rc= 1, tel=1, ok=0; - - if(G.soops==0) return; - - if(G.soops->oops.first==G.soops->oops.last) { - oopslastx= oopslasty= 0.0; - } - - cnt++; - - new->x= oopslastx; - new->y= oopslasty; - - correct_oops_y(new); - - /* find from center free location */ - dirvec[cnt & 3][0]= 1.2*OOPSX; - dirvec[cnt & 3][1]= 0; - cnt++; - dirvec[cnt & 3][0]= 0; - dirvec[cnt & 3][1]= (float)(-1.2*OOPSY); - cnt++; - dirvec[cnt & 3][0]= -1.2*OOPSX; - dirvec[cnt & 3][1]= 0; - cnt++; - dirvec[cnt & 3][0]= 0; - dirvec[cnt & 3][1]= (float)(1.2*OOPSY); - cnt++; - - - new->x+= dirvec[ (rc-2) & 3][0]; - new->y+= dirvec[ (rc-2) & 3][1]; - rc+= correct_oops_y(new); - - if( oops_test_overlap(new)==0 ) { - ok= 1; - } - - rc++; - - if(ok==0) { - new->x+= dirvec[ (rc-1) & 3][0]; - new->y+= dirvec[ (rc-1) & 3][1]; - rc+= correct_oops_y(new); - - if(oops_test_overlap(new)==0 ) { - ok= 1; - } - rc++; - } - - - while(ok==0) { - - for(a=0;a<2;a++) { - for(b=0;bx += dirvec[rc][0]; - new->y += dirvec[rc][1]; - rc+= correct_oops_y(new); - } - rc++; - - - - if(ok) break; - } - if(ok || tel>100) break; - tel++; - } - oopslastx= new->x; - oopslasty= new->y; - -} - - -void free_oops(Oops *oops) /* also oops itself */ -{ - BLI_freelistN(&oops->link); - MEM_freeN(oops); -} - -void free_oopspace(SpaceOops *so) -{ - Oops *oops; - - while( (oops= so->oops.first) ) { - BLI_remlink(&so->oops, oops); - free_oops(oops); - } - - outliner_free_tree(&so->tree); - if(so->treestore) { - if(so->treestore->data) MEM_freeN(so->treestore->data); - MEM_freeN(so->treestore); - } -} - -void add_material_oopslinks(Material *ma, Oops *oops, short flag) -{ - int a; - - if(flag & OOPS_TE) { - for(a=0; amtex[a]) add_oopslink("tex", oops, ID_TE, &(ma->mtex[a]->tex), (float)(0.5*OOPSX), (float)OOPSY); - } - } - if(flag & OOPS_OB) { - for(a=0; amtex[a]) add_oopslink("ob", oops, ID_OB, &(ma->mtex[a]->object), 0.0, (float)(0.2*OOPSY)); - } - } - if(flag & OOPS_IP) - if(ma->ipo) add_oopslink("ipo", oops, ID_IP, &(ma->ipo), OOPSX, (float)(0.5*OOPSY)); - - if (ma->group) - add_oopslink("group", oops, ID_GR, &(ma->group), OOPSX, (float)(0.5*OOPSY)); -} - - -void add_group_oopslinks(Group *gp, Oops *oops, short flag) -{ - GroupObject *gob; - if(flag & OOPS_GR) { - for(gob=gp->gobject.first; gob; gob= gob->next) { - add_oopslink("group", oops, ID_GR, &(gob->ob), (float)(0.5*OOPSX), (float)OOPSY); - } - } -} - - -void add_object_oopslinks(Object *ob, Oops *oops, short flag) -{ - ID *id; - - if(ob->parent) add_oopslink("parent", oops, ID_OB, &ob->parent, (float)(.6*OOPSX), (float)OOPSY); - if(ob->track) add_oopslink("parent", oops, ID_OB, &ob->track, (float)(.4*OOPSX), (float)OOPSY); - - id= ob->data; - if(id) { - switch( GS(id->name) ) { - case ID_ME: - if(flag & OOPS_ME) add_oopslink("data", oops, ID_ME, &ob->data, (float)(.5*OOPSX), (float)OOPSY); - break; - case ID_CU: - if(flag & OOPS_CU) add_oopslink("data", oops, ID_CU, &ob->data, (float)(.5*OOPSX), (float)OOPSY); - break; - case ID_MB: - if(flag & OOPS_MB) add_oopslink("data", oops, ID_MB, &ob->data, (float)(.5*OOPSX), (float)OOPSY); - break; - case ID_LT: - if(flag & OOPS_LT) add_oopslink("data", oops, ID_LT, &ob->data, (float)(.5*OOPSX), (float)OOPSY); - break; - case ID_LA: - if(flag & OOPS_LA) add_oopslink("data", oops, ID_LA, &ob->data, (float)(.5*OOPSX), (float)OOPSY); - break; - } - } - - if(flag & OOPS_MA) { - short a; - - for(a=0; atotcol; a++) { - if(ob->mat[a]) { - add_oopslink("mat", oops, ID_MA, ob->mat+a, 0, (float)(0.5*OOPSY)); - } - } - } - - if(flag & OOPS_IP) add_oopslink("ipo", oops, ID_IP, &ob->ipo, OOPSX, (float)(0.5*OOPSY)); - - if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP)) - add_oopslink("group", oops, ID_GR, &ob->dup_group, OOPSX, (float)(0.5*OOPSY)); -} - -void add_mesh_oopslinks(Mesh *me, Oops *oops, short flag) -{ - int a; - - if(flag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(me->mat[a]) { - add_oopslink("ma", oops, ID_MA, me->mat+a, 0.0, (float)(0.5*OOPSY)); - } - } - } - if(flag & OOPS_IP) { - if(me->key) add_oopslink("ipo", oops, ID_IP, &me->key->ipo, OOPSX, (float)(0.5*OOPSY)); - } -} - -void add_curve_oopslinks(Curve *cu, Oops *oops, short flag) -{ - int a; - - if(flag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(cu->mat[a]) { - add_oopslink("ma", oops, ID_MA, cu->mat+a, 0.0, (float)(0.5*OOPSY)); - } - } - } - if(flag & OOPS_IP) { - add_oopslink("speed", oops, ID_IP, &cu->ipo, OOPSX, (float)(0.5*OOPSY)); - if(cu->key) add_oopslink("ipo", oops, ID_IP, &cu->key->ipo, OOPSX, (float)(0.5*OOPSY)); - } - -} - -void add_mball_oopslinks(MetaBall *mb, Oops *oops, short flag) -{ - int a; - - if(flag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(mb->mat[a]) { - add_oopslink("ma", oops, ID_MA, mb->mat+a, 0.0, (float)(0.5*OOPSY)); - } - } - } -} - -void add_lamp_oopslinks(Lamp *la, Oops *oops, short flag) -{ - int a; - - if(flag & OOPS_TE) { - for(a=0; amtex[a]) { - add_oopslink("tex", oops, ID_TE, &(la->mtex[a]->tex), 0.0, (float)(0.5*OOPSY)); - } - } - } -} - - -Oops *add_test_oops(void *id) /* incl links */ -{ - Oops *oops; - Object *ob; - Lamp *la; - Tex *tex; - - if(id==0) return NULL; - - /* test if it exists */ - oops= find_oops(id); - - if(oops) { - oops->hide= 0; - } - else { - oops= add_oops(id); - new_oops_location(oops); - if(G.soops->flag & SO_NEWSELECTED) { - oops->flag |= SELECT; - } - } - - switch( GS( ((ID *)id)->name)) { - case ID_SCE: - add_oopslink("set", oops, ID_SCE, &((Scene *)id)->set, (float)(.5*OOPSX), (float)OOPSY); - break; - case ID_OB: - ob= (Object *)id; - if(ob->flag & SELECT) oops->flag |= SELECT; - else oops->flag &= ~SELECT; - add_object_oopslinks(ob, oops, G.soops->visiflag); - break; - case ID_ME: - add_mesh_oopslinks((Mesh *)id, oops, G.soops->visiflag); - break; - case ID_CU: - add_curve_oopslinks((Curve *)id, oops, G.soops->visiflag); - break; - case ID_MB: - add_mball_oopslinks((MetaBall *)id, oops, G.soops->visiflag); - break; - case ID_LA: - la= (Lamp *)id; - add_lamp_oopslinks(la, oops, G.soops->visiflag); - if(la->ipo) if(G.soops->visiflag & OOPS_IP) add_oopslink("ipo", oops, ID_IP, &la->ipo, OOPSX, (float)(0.3*OOPSY)); - break; - case ID_IP: - - break; - case ID_MA: - add_material_oopslinks((Material *)id, oops, G.soops->visiflag); - break; - case ID_GR: - add_group_oopslinks((Group *)id, oops, G.soops->visiflag); - break; - case ID_TE: - tex= (Tex *)id; - if(tex->ima) if(G.soops->visiflag & OOPS_IM) add_oopslink("image", oops, ID_IM, &tex->ima, OOPSX, (float)(0.3*OOPSY)); - } - - return oops; -} - -void add_texture_oops(Material *ma) -{ - int a; - - for(a=0; amtex[a]) { - add_test_oops(ma->mtex[a]->tex); - if(ma->mtex[a]->tex) if(G.soops->visiflag & OOPS_IM) add_test_oops(ma->mtex[a]->tex->ima); - } - } -} - -void build_oops() -{ - Oops *oops; - OopsLink *ol; - ID *id; - Base *base; - Object *ob; - short a, type; - - /* always build it all! */ - - if(G.soops==0) return; - - /* set hide flags */ - oops= G.soops->oops.first; - while(oops) { - oops->hide= 1; - oops->flag &= ~OOPS_REFER; - - BLI_freelistN(&oops->link); /* much safer */ - - oops= oops->next; - } - - /* make oops, includes testing for existance */ - - /* always */ - if(G.soops->visiflag & OOPS_LI) { - Library *li= G.main->library.first; - while(li) { - oops= add_test_oops(li); - li= li->id.next; - } - } - - /* the rest in 2 ways: or everything (OOPS_SCE) or only the ones in this scene */ - - if(G.soops->visiflag & OOPS_SCE) { - Scene *sce= G.main->scene.first; - - while(sce) { - - oops= add_test_oops(sce); - - if(G.soops->visiflag & OOPS_OB) { - base= sce->base.first; - while(base) { - - add_oopslink("object", oops, ID_OB, &base->object, (float)(.5*OOPSX), (float)OOPSY); - base= base->next; - } - } - - sce= sce->id.next; - } - - if(G.soops->visiflag & OOPS_OB) { - Object *ob= G.main->object.first; - - while(ob) { - oops= add_test_oops(ob); - ob= ob->id.next; - } - } - if(G.soops->visiflag & OOPS_ME) { - Mesh *me= G.main->mesh.first; - while(me) { - oops= add_test_oops(me); - me= me->id.next; - } - } - - if(G.soops->visiflag & OOPS_CU) { - Curve *cu= G.main->curve.first; - while(cu) { - oops= add_test_oops(cu); - cu= cu->id.next; - } - } - - if(G.soops->visiflag & OOPS_MB) { - MetaBall *mb= G.main->mball.first; - while(mb) { - oops= add_test_oops(mb); - mb= mb->id.next; - } - } - - if(G.soops->visiflag & OOPS_LA) { - Lamp *la= G.main->lamp.first; - while(la) { - oops= add_test_oops(la); - la= la->id.next; - } - } - - if(G.soops->visiflag & OOPS_IP) { - Ipo *ipo= G.main->ipo.first; - while(ipo) { - oops= add_test_oops(ipo); - ipo= ipo->id.next; - } - } - - if(G.soops->visiflag & OOPS_MA) { - Material *ma= G.main->mat.first; - while(ma) { - oops= add_test_oops(ma); - ma= ma->id.next; - } - } - if(G.soops->visiflag & OOPS_TE) { - Tex *tex= G.main->tex.first; - while(tex) { - oops= add_test_oops(tex); - tex= tex->id.next; - } - } - if(G.soops->visiflag & OOPS_IM) { - Image *ima= G.main->image.first; - while(ima) { - oops= add_test_oops(ima); - ima= ima->id.next; - } - } - if(G.soops->visiflag & OOPS_GR) { - Group *gp= G.main->group.first; - while(gp) { - oops= add_test_oops(gp); - gp= gp->id.next; - } - } - } - else { - - /* only blocks from this scene */ - - base= FIRSTBASE; - while(base) { - - /* layer? */ - if( (G.soops->visiflag & OOPS_LAY)==0 || (base->lay & G.scene->lay)) { - ob= base->object; - - if(G.soops->visiflag & OOPS_OB) { - oops= add_test_oops(ob); - } - if(G.soops->visiflag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(ob->mat[a]) { - oops= add_test_oops(ob->mat[a]); - if(G.soops->visiflag & OOPS_TE) add_texture_oops(ob->mat[a]); - if(G.soops->visiflag & OOPS_IP) add_test_oops(ob->mat[a]->ipo); - } - } - } - if(G.soops->visiflag & OOPS_IP) oops= add_test_oops(ob->ipo); - - id= ob->data; - if(id) { - type= GS(id->name); - - if(type==ID_ME && G.soops->visiflag & OOPS_ME) { - Mesh *me= ob->data; - oops= add_test_oops(ob->data); - - if(G.soops->visiflag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(me->mat[a]) { - oops= add_test_oops(me->mat[a]); - if(G.soops->visiflag & OOPS_TE) add_texture_oops(me->mat[a]); - if(G.soops->visiflag & OOPS_IP) add_test_oops(me->mat[a]->ipo); - } - } - } - if(G.soops->visiflag & OOPS_IP) { - if(me->key) oops= add_test_oops(me->key->ipo); - } - } - else if(type==ID_CU && G.soops->visiflag & OOPS_CU) { - Curve *cu= ob->data; - oops= add_test_oops(ob->data); - - if(G.soops->visiflag & OOPS_MA) { - for(a=0; atotcol; a++) { - if(cu->mat[a]) { - oops= add_test_oops(cu->mat[a]); - if(G.soops->visiflag & OOPS_TE) add_texture_oops(cu->mat[a]); - if(G.soops->visiflag & OOPS_IP) add_test_oops(cu->mat[a]->ipo); - } - } - } - if(G.soops->visiflag & OOPS_IP) { - if(cu->ipo) oops= add_test_oops(cu->ipo); - if(cu->key) oops= add_test_oops(cu->key->ipo); - } - } - else if(type==ID_MB && G.soops->visiflag & OOPS_MB) { - oops= add_test_oops(ob->data); - - if(G.soops->visiflag & OOPS_MA) { - MetaBall *mb= ob->data; - for(a=0; atotcol; a++) { - if(mb->mat[a]) { - oops= add_test_oops(mb->mat[a]); - if(G.soops->visiflag & OOPS_TE) add_texture_oops(mb->mat[a]); - if(G.soops->visiflag & OOPS_IP) add_test_oops(mb->mat[a]->ipo); - } - } - } - } - else if(type==ID_LA && G.soops->visiflag & OOPS_LA) { - Lamp *la= ob->data; - oops= add_test_oops(ob->data); - if(G.soops->visiflag & OOPS_IP) add_test_oops(la->ipo); - if(G.soops->visiflag & OOPS_TE) { - for(a=0; amtex[a]) add_test_oops(la->mtex[a]->tex); - } - } - } - } - } - base= base->next; - } - } - - - - - /* test links */ - oops= G.soops->oops.first; - while(oops) { - if(oops->hide==0) { - ol= oops->link.first; - while(ol) { - test_oopslink(ol); - ol= ol->next; - } - } - oops= oops->next; - } - - G.soops->flag &= ~SO_NEWSELECTED; -} diff --git a/source/blender/src/outliner.c b/source/blender/src/outliner.c deleted file mode 100644 index 3e969e4ca9c..00000000000 --- a/source/blender/src/outliner.c +++ /dev/null @@ -1,3640 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2004 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_camera_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_group_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_material_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meta_types.h" -#include "DNA_modifier_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_oops_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_text_types.h" -#include "DNA_world_types.h" - -#include "BLI_blenlib.h" - -#include "BKE_constraint.h" -#include "BKE_deform.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_material.h" -#include "BKE_modifier.h" -#include "BKE_screen.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BIF_butspace.h" -#include "BIF_drawscene.h" -#include "BIF_drawtext.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editdeform.h" -#include "BIF_editnla.h" -#include "BIF_editview.h" -#include "BIF_editconstraint.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_mywindow.h" -#include "BIF_outliner.h" -#include "BIF_language.h" -#include "BIF_mainqueue.h" -#include "BIF_poseobject.h" -#include "BIF_previewrender.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif - -#include "BDR_editobject.h" -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "PIL_time.h" - -#include "blendef.h" -#include "mydevice.h" - -#define OL_H 19 -#define OL_X 18 - -#define OL_TOG_RESTRICT_VIEWX 54 -#define OL_TOG_RESTRICT_SELECTX 36 -#define OL_TOG_RESTRICT_RENDERX 18 - -#define OL_TOGW OL_TOG_RESTRICT_VIEWX - -#define TS_CHUNK 128 - -#define TREESTORE(a) ((a)?soops->treestore->data+(a)->store_index:NULL) - -#ifdef WITH_VERSE -extern ListBase session_list; -extern ListBase server_list; -#endif - - -/* ******************** PROTOTYPES ***************** */ -static void outliner_draw_tree_element(SpaceOops *soops, TreeElement *te, int startx, int *starty); - - -/* ******************** PERSISTANT DATA ***************** */ - -static void outliner_storage_cleanup(SpaceOops *soops) -{ - TreeStore *ts= soops->treestore; - - if(ts) { - TreeStoreElem *tselem; - int a, unused= 0; - - /* each element used once, for ID blocks with more users to have each a treestore */ - for(a=0, tselem= ts->data; ausedelem; a++, tselem++) tselem->used= 0; - - /* cleanup only after reading file or undo step */ - if(soops->storeflag & SO_TREESTORE_CLEANUP) { - - for(a=0, tselem= ts->data; ausedelem; a++, tselem++) { - if(tselem->id==NULL) unused++; - } - - if(unused) { - if(ts->usedelem == unused) { - MEM_freeN(ts->data); - ts->data= NULL; - ts->usedelem= ts->totelem= 0; - } - else { - TreeStoreElem *tsnewar, *tsnew; - - tsnew=tsnewar= MEM_mallocN((ts->usedelem-unused)*sizeof(TreeStoreElem), "new tselem"); - for(a=0, tselem= ts->data; ausedelem; a++, tselem++) { - if(tselem->id) { - *tsnew= *tselem; - tsnew++; - } - } - MEM_freeN(ts->data); - ts->data= tsnewar; - ts->usedelem-= unused; - ts->totelem= ts->usedelem; - } - } - } - } -} - -static void check_persistant(SpaceOops *soops, TreeElement *te, ID *id, short type, short nr) -{ - TreeStore *ts; - TreeStoreElem *tselem; - int a; - - /* case 1; no TreeStore */ - if(soops->treestore==NULL) { - ts= soops->treestore= MEM_callocN(sizeof(TreeStore), "treestore"); - } - ts= soops->treestore; - - /* check if 'te' is in treestore */ - tselem= ts->data; - for(a=0; ausedelem; a++, tselem++) { - if(tselem->id==id && tselem->used==0) { - if((type==0 && tselem->type==0) ||(tselem->type==type && tselem->nr==nr)) { - te->store_index= a; - tselem->used= 1; - return; - } - } - } - - /* add 1 element to treestore */ - if(ts->usedelem==ts->totelem) { - TreeStoreElem *tsnew; - - tsnew= MEM_mallocN((ts->totelem+TS_CHUNK)*sizeof(TreeStoreElem), "treestore data"); - if(ts->data) { - memcpy(tsnew, ts->data, ts->totelem*sizeof(TreeStoreElem)); - MEM_freeN(ts->data); - } - ts->data= tsnew; - ts->totelem+= TS_CHUNK; - } - - tselem= ts->data+ts->usedelem; - - tselem->type= type; - if(type) tselem->nr= nr; // we're picky! :) - else tselem->nr= 0; - tselem->id= id; - tselem->flag= TSE_CLOSED; - te->store_index= ts->usedelem; - - ts->usedelem++; -} - -/* ******************** TREE MANAGEMENT ****************** */ - -void outliner_free_tree(ListBase *lb) -{ - - while(lb->first) { - TreeElement *te= lb->first; - - outliner_free_tree(&te->subtree); - BLI_remlink(lb, te); - MEM_freeN(te); - } -} - -static void outliner_height(SpaceOops *soops, ListBase *lb, int *h) -{ - TreeElement *te= lb->first; - while(te) { - TreeStoreElem *tselem= TREESTORE(te); - if((tselem->flag & TSE_CLOSED)==0) - outliner_height(soops, &te->subtree, h); - (*h)++; - te= te->next; - } -} - -static void outliner_width(SpaceOops *soops, ListBase *lb, int *w) -{ - TreeElement *te= lb->first; - while(te) { - TreeStoreElem *tselem= TREESTORE(te); - if(tselem->flag & TSE_CLOSED) { - if (te->xend > *w) - *w = te->xend; - } - outliner_width(soops, &te->subtree, w); - te= te->next; - } -} - -static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index) -{ - TreeElement *te= lb->first, *tes; - while(te) { - if(te->store_index==store_index) return te; - tes= outliner_find_tree_element(&te->subtree, store_index); - if(tes) return tes; - te= te->next; - } - return NULL; -} - - - -static ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode) -{ - TreeStoreElem *tselem; - te= te->parent; - - while(te) { - tselem= TREESTORE(te); - if(te->idcode==idcode && tselem->type==0) return tselem->id; - te= te->parent; - } - return NULL; -} - -struct treesort { - TreeElement *te; - ID *id; - char *name; - short idcode; -}; - -static int treesort_alpha(const void *v1, const void *v2) -{ - const struct treesort *x1= v1, *x2= v2; - int comp; - - /* first put objects last (hierarchy) */ - comp= (x1->idcode==ID_OB); - if(x2->idcode==ID_OB) comp+=2; - - if(comp==1) return 1; - else if(comp==2) return -1; - else if(comp==3) { - int comp= strcmp(x1->name, x2->name); - - if( comp>0 ) return 1; - else if( comp<0) return -1; - return 0; - } - return 0; -} - -/* this is nice option for later? doesnt look too useful... */ -#if 0 -static int treesort_obtype_alpha(const void *v1, const void *v2) -{ - const struct treesort *x1= v1, *x2= v2; - - /* first put objects last (hierarchy) */ - if(x1->idcode==ID_OB && x2->idcode!=ID_OB) return 1; - else if(x2->idcode==ID_OB && x1->idcode!=ID_OB) return -1; - else { - /* 2nd we check ob type */ - if(x1->idcode==ID_OB && x2->idcode==ID_OB) { - if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return 1; - else if( ((Object *)x1->id)->type > ((Object *)x2->id)->type) return -1; - else return 0; - } - else { - int comp= strcmp(x1->name, x2->name); - - if( comp>0 ) return 1; - else if( comp<0) return -1; - return 0; - } - } -} -#endif - -/* sort happens on each subtree individual */ -static void outliner_sort(SpaceOops *soops, ListBase *lb) -{ - TreeElement *te; - TreeStoreElem *tselem; - int totelem=0; - - te= lb->last; - if(te==NULL) return; - tselem= TREESTORE(te); - - /* sorting rules; only object lists or deformgroups */ - if( (tselem->type==TSE_DEFGROUP) || (tselem->type==0 && te->idcode==ID_OB)) { - - /* count first */ - for(te= lb->first; te; te= te->next) totelem++; - - if(totelem>1) { - struct treesort *tear= MEM_mallocN(totelem*sizeof(struct treesort), "tree sort array"); - struct treesort *tp=tear; - int skip= 0; - - for(te= lb->first; te; te= te->next, tp++) { - tselem= TREESTORE(te); - tp->te= te; - tp->name= te->name; - tp->idcode= te->idcode; - if(tselem->type && tselem->type!=TSE_DEFGROUP) tp->idcode= 0; // dont sort this - tp->id= tselem->id; - } - /* keep beginning of list */ - for(tp= tear, skip=0; skipidcode) break; - - if(skipfirst=lb->last= NULL; - tp= tear; - while(totelem--) { - BLI_addtail(lb, tp->te); - tp++; - } - MEM_freeN(tear); - } - } - - for(te= lb->first; te; te= te->next) { - outliner_sort(soops, &te->subtree); - } -} - -/* Prototype, see functions below */ -static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, short index); - - -static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl) -{ - TreeStoreElem *tselem= TREESTORE(tenla); - TreeElement *te; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_COMBINED); - te->name= "Combined"; - te->directdata= &srl->passflag; - - /* save cpu cycles, but we add the first to invoke an open/close triangle */ - if(tselem->flag & TSE_CLOSED) - return; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_Z); - te->name= "Z"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_VECTOR); - te->name= "Vector"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_NORMAL); - te->name= "Normal"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_UV); - te->name= "UV"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_INDEXOB); - te->name= "Index Object"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RGBA); - te->name= "Color"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_DIFFUSE); - te->name= "Diffuse"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_SPEC); - te->name= "Specular"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_SHADOW); - te->name= "Shadow"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_AO); - te->name= "AO"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_REFLECT); - te->name= "Reflection"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_REFRACT); - te->name= "Refraction"; - te->directdata= &srl->passflag; - - te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, SCE_PASS_RADIO); - te->name= "Radiosity"; - te->directdata= &srl->passflag; - -} - - -/* special handling of hierarchical non-lib data */ -static void outliner_add_bone(SpaceOops *soops, ListBase *lb, ID *id, Bone *curBone, - TreeElement *parent, int *a) -{ - TreeElement *te= outliner_add_element(soops, lb, id, parent, TSE_BONE, *a); - - (*a)++; - te->name= curBone->name; - te->directdata= curBone; - - for(curBone= curBone->childbase.first; curBone; curBone=curBone->next) { - outliner_add_bone(soops, &te->subtree, id, curBone, te, a); - } -} - -static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te) -{ - SceneRenderLayer *srl; - TreeElement *tenla= outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0); - int a; - - tenla->name= "RenderLayers"; - for(a=0, srl= sce->r.layers.first; srl; srl= srl->next, a++) { - TreeElement *tenlay= outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a); - tenlay->name= srl->name; - tenlay->directdata= &srl->passflag; - - if(srl->light_override) - outliner_add_element(soops, &tenlay->subtree, srl->light_override, tenlay, TSE_LINKED_LAMP, 0); - if(srl->mat_override) - outliner_add_element(soops, &tenlay->subtree, srl->mat_override, tenlay, TSE_LINKED_MAT, 0); - - outliner_add_passes(soops, tenlay, &sce->id, srl); - } - - outliner_add_element(soops, lb, sce->world, te, 0, 0); - - if(sce->scriptlink.scripts) { - int a= 0; - tenla= outliner_add_element(soops, lb, sce, te, TSE_SCRIPT_BASE, 0); - tenla->name= "Scripts"; - for (a=0; ascriptlink.totscript; a++) { - outliner_add_element(soops, &tenla->subtree, sce->scriptlink.scripts[a], tenla, 0, 0); - } - } - -} - -static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, - TreeElement *parent, short type, short index) -{ - TreeElement *te; - TreeStoreElem *tselem; - ID *id= idv; - int a; - - if(id==NULL) return NULL; - - te= MEM_callocN(sizeof(TreeElement), "tree elem"); - /* add to the visual tree */ - BLI_addtail(lb, te); - /* add to the storage */ - check_persistant(soops, te, id, type, index); - tselem= TREESTORE(te); - - te->parent= parent; - te->index= index; // for data arays - te->name= id->name+2; // default, can be overridden by Library or non-ID data - te->idcode= GS(id->name); - - if(type==0) { - - /* tuck pointer back in object, to construct hierarchy */ - if(GS(id->name)==ID_OB) id->newid= (ID *)te; - - /* expand specific data always */ - switch(GS(id->name)) { - case ID_LI: - te->name= ((Library *)id)->name; - break; - case ID_SCE: - outliner_add_scene_contents(soops, &te->subtree, (Scene *)id, te); - break; - case ID_OB: - { - Object *ob= (Object *)id; - - if(ob->proxy && ob->id.lib==NULL) - outliner_add_element(soops, &te->subtree, ob->proxy, te, TSE_PROXY, 0); - - outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0); - - if(ob->pose) { - bPoseChannel *pchan; - TreeElement *ten; - TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_POSE_BASE, 0); - - tenla->name= "Pose"; - - if(ob!=G.obedit && (ob->flag & OB_POSEMODE)) { // channels undefined in editmode, but we want the 'tenla' pose icon itself - int a= 0, const_index= 1000; /* ensure unique id for bone constraints */ - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next, a++) { - ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_POSE_CHANNEL, a); - ten->name= pchan->name; - ten->directdata= pchan; - pchan->prev= (bPoseChannel *)ten; - - if(pchan->constraints.first) { - //Object *target; - bConstraint *con; - TreeElement *ten1; - TreeElement *tenla1= outliner_add_element(soops, &ten->subtree, ob, ten, TSE_CONSTRAINT_BASE, 0); - //char *str; - - tenla1->name= "Constraints"; - for(con= pchan->constraints.first; con; con= con->next, const_index++) { - ten1= outliner_add_element(soops, &tenla1->subtree, ob, tenla1, TSE_CONSTRAINT, const_index); -#if 0 /* disabled as it needs to be reworked for recoded constraints system */ - target= get_constraint_target(con, &str); - if(str && str[0]) ten1->name= str; - else if(target) ten1->name= target->id.name+2; - else ten1->name= con->name; -#endif - ten1->name= con->name; - ten1->directdata= con; - /* possible add all other types links? */ - } - } - } - /* make hierarchy */ - ten= tenla->subtree.first; - while(ten) { - TreeElement *nten= ten->next, *par; - tselem= TREESTORE(ten); - if(tselem->type==TSE_POSE_CHANNEL) { - pchan= (bPoseChannel *)ten->directdata; - if(pchan->parent) { - BLI_remlink(&tenla->subtree, ten); - par= (TreeElement *)pchan->parent->prev; - BLI_addtail(&par->subtree, ten); - ten->parent= par; - } - } - ten= nten; - } - /* restore prev pointers */ - pchan= ob->pose->chanbase.first; - if(pchan) pchan->prev= NULL; - for(; pchan; pchan= pchan->next) { - if(pchan->next) pchan->next->prev= pchan; - } - } - } - - outliner_add_element(soops, &te->subtree, ob->ipo, te, 0, 0); - outliner_add_element(soops, &te->subtree, ob->action, te, 0, 0); - - for(a=0; atotcol; a++) - outliner_add_element(soops, &te->subtree, ob->mat[a], te, 0, a); - - if(ob->constraints.first) { - //Object *target; - bConstraint *con; - TreeElement *ten; - TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_CONSTRAINT_BASE, 0); - int a= 0; - //char *str; - - tenla->name= "Constraints"; - for(con= ob->constraints.first; con; con= con->next, a++) { - ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_CONSTRAINT, a); -#if 0 /* disabled due to constraints system targets recode... code here needs review */ - target= get_constraint_target(con, &str); - if(str && str[0]) ten->name= str; - else if(target) ten->name= target->id.name+2; - else ten->name= con->name; -#endif - ten->name= con->name; - ten->directdata= con; - /* possible add all other types links? */ - } - } - - if(ob->modifiers.first) { - ModifierData *md; - TreeElement *temod = outliner_add_element(soops, &te->subtree, ob, te, TSE_MODIFIER_BASE, 0); - int index; - - temod->name = "Modifiers"; - for (index=0,md=ob->modifiers.first; md; index++,md=md->next) { - TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index); - te->name= md->name; - - if (md->type==eModifierType_Lattice) { - outliner_add_element(soops, &te->subtree, ((LatticeModifierData*) md)->object, te, TSE_LINKED_OB, 0); - } else if (md->type==eModifierType_Curve) { - outliner_add_element(soops, &te->subtree, ((CurveModifierData*) md)->object, te, TSE_LINKED_OB, 0); - } else if (md->type==eModifierType_Armature) { - outliner_add_element(soops, &te->subtree, ((ArmatureModifierData*) md)->object, te, TSE_LINKED_OB, 0); - } else if (md->type==eModifierType_Hook) { - outliner_add_element(soops, &te->subtree, ((HookModifierData*) md)->object, te, TSE_LINKED_OB, 0); - } - } - } - if(ob->defbase.first) { - bDeformGroup *defgroup; - TreeElement *ten; - TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_DEFGROUP_BASE, 0); - int a= 0; - - tenla->name= "Vertex Groups"; - for (defgroup=ob->defbase.first; defgroup; defgroup=defgroup->next, a++) { - ten= outliner_add_element(soops, &tenla->subtree, ob, tenla, TSE_DEFGROUP, a); - ten->name= defgroup->name; - ten->directdata= defgroup; - } - } - if(ob->scriptlink.scripts) { - TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_SCRIPT_BASE, 0); - int a= 0; - - tenla->name= "Scripts"; - for (a=0; ascriptlink.totscript; a++) { /* ** */ - outliner_add_element(soops, &tenla->subtree, ob->scriptlink.scripts[a], te, 0, 0); - } - } - - if(ob->dup_group) - outliner_add_element(soops, &te->subtree, ob->dup_group, te, 0, 0); - - if(ob->nlastrips.first) { - bActionStrip *strip; - TreeElement *ten; - TreeElement *tenla= outliner_add_element(soops, &te->subtree, ob, te, TSE_NLA, 0); - int a= 0; - - tenla->name= "NLA strips"; - for (strip=ob->nlastrips.first; strip; strip=strip->next, a++) { - ten= outliner_add_element(soops, &tenla->subtree, strip->act, tenla, TSE_NLA_ACTION, a); - if(ten) ten->directdata= strip; - } - } - - } - break; - case ID_ME: - { - Mesh *me= (Mesh *)id; - outliner_add_element(soops, &te->subtree, me->ipo, te, 0, 0); - outliner_add_element(soops, &te->subtree, me->key, te, 0, 0); - for(a=0; atotcol; a++) - outliner_add_element(soops, &te->subtree, me->mat[a], te, 0, a); - /* could do tfaces with image links, but the images are not grouped nicely. - would require going over all tfaces, sort images in use. etc... */ - } - break; - case ID_CU: - { - Curve *cu= (Curve *)id; - for(a=0; atotcol; a++) - outliner_add_element(soops, &te->subtree, cu->mat[a], te, 0, a); - } - break; - case ID_MB: - { - MetaBall *mb= (MetaBall *)id; - for(a=0; atotcol; a++) - outliner_add_element(soops, &te->subtree, mb->mat[a], te, 0, a); - } - break; - case ID_MA: - { - Material *ma= (Material *)id; - - outliner_add_element(soops, &te->subtree, ma->ipo, te, 0, 0); - for(a=0; amtex[a]) outliner_add_element(soops, &te->subtree, ma->mtex[a]->tex, te, 0, a); - } - } - break; - case ID_TE: - { - Tex *tex= (Tex *)id; - - outliner_add_element(soops, &te->subtree, tex->ipo, te, 0, 0); - outliner_add_element(soops, &te->subtree, tex->ima, te, 0, 0); - } - break; - case ID_CA: - { - Camera *ca= (Camera *)id; - outliner_add_element(soops, &te->subtree, ca->ipo, te, 0, 0); - } - break; - case ID_LA: - { - Lamp *la= (Lamp *)id; - outliner_add_element(soops, &te->subtree, la->ipo, te, 0, 0); - for(a=0; amtex[a]) outliner_add_element(soops, &te->subtree, la->mtex[a]->tex, te, 0, a); - } - } - break; - case ID_WO: - { - World *wrld= (World *)id; - outliner_add_element(soops, &te->subtree, wrld->ipo, te, 0, 0); - for(a=0; amtex[a]) outliner_add_element(soops, &te->subtree, wrld->mtex[a]->tex, te, 0, a); - } - } - break; - case ID_KE: - { - Key *key= (Key *)id; - outliner_add_element(soops, &te->subtree, key->ipo, te, 0, 0); - } - break; - case ID_IP: - { - Ipo *ipo= (Ipo *)id; - IpoCurve *icu; - Object *lastadded= NULL; - - for(icu= ipo->curve.first; icu; icu= icu->next) { - if(icu->driver && icu->driver->ob) { - if(lastadded!=icu->driver->ob) { - outliner_add_element(soops, &te->subtree, icu->driver->ob, te, TSE_LINKED_OB, 0); - lastadded= icu->driver->ob; - } - } - } - } - case ID_AC: - { - bAction *act= (bAction *)id; - bActionChannel *chan; - int a= 0; - - tselem= TREESTORE(parent); - for (chan=act->chanbase.first; chan; chan=chan->next, a++) { - outliner_add_element(soops, &te->subtree, chan->ipo, te, 0, a); - } - } - break; - case ID_AR: - { - bArmature *arm= (bArmature *)id; - int a= 0; - - if(G.obedit && G.obedit->data==arm) { - EditBone *ebone; - TreeElement *ten; - - for (ebone = G.edbo.first; ebone; ebone=ebone->next, a++) { - ten= outliner_add_element(soops, &te->subtree, id, te, TSE_EBONE, a); - ten->directdata= ebone; - ten->name= ebone->name; - ebone->temp= ten; - } - /* make hierarchy */ - ten= te->subtree.first; - while(ten) { - TreeElement *nten= ten->next, *par; - ebone= (EditBone *)ten->directdata; - if(ebone->parent) { - BLI_remlink(&te->subtree, ten); - par= ebone->parent->temp; - BLI_addtail(&par->subtree, ten); - ten->parent= par; - } - ten= nten; - } - } - else { - /* do not extend Armature when we have posemode */ - tselem= TREESTORE(te->parent); - if( GS(tselem->id->name)==ID_OB && ((Object *)tselem->id)->flag & OB_POSEMODE); - else { - Bone *curBone; - for (curBone=arm->bonebase.first; curBone; curBone=curBone->next){ - outliner_add_bone(soops, &te->subtree, id, curBone, te, &a); - } - } - } - } - break; - } - } -#ifdef WITH_VERSE - else if(type==ID_VS) { - struct VerseSession *session = (VerseSession*)idv; - te->name = session->address; - te->directdata = (void*)session; - te->idcode = ID_VS; - } - else if(type==ID_MS) { - te->name = "Available Verse Servers"; - te->idcode = ID_MS; - } - else if(type==ID_SS) { - struct VerseServer *server = (VerseServer *)idv; - te->name = server->name; - te->directdata = (void *)server; - te->idcode = ID_SS; - } - else if(type==ID_VN) { - struct VNode *vnode = (VNode*)idv; - te->name = vnode->name; - te->idcode = ID_VN; - if(vnode->type==V_NT_OBJECT) { - struct TreeElement *ten; - struct VNode *child_node; - struct VLink *vlink; - - vlink = ((VObjectData*)vnode->data)->links.lb.first; - while(vlink) { - child_node = vlink->target; - if(child_node && child_node->type==V_NT_GEOMETRY) { - ten = outliner_add_element(soops, &te->subtree, child_node, te, ID_VN, 0); - ten->directdata = child_node; - } - vlink = vlink->next; - } - } - } -#endif - return te; -} - -static void outliner_make_hierarchy(SpaceOops *soops, ListBase *lb) -{ - TreeElement *te, *ten, *tep; - TreeStoreElem *tselem; - - /* build hierarchy */ - te= lb->first; - while(te) { - ten= te->next; - tselem= TREESTORE(te); - - if(tselem->type==0 && te->idcode==ID_OB) { - Object *ob= (Object *)tselem->id; - if(ob->parent && ob->parent->id.newid) { - BLI_remlink(lb, te); - tep= (TreeElement *)ob->parent->id.newid; - BLI_addtail(&tep->subtree, te); - // set correct parent pointers - for(te=tep->subtree.first; te; te= te->next) te->parent= tep; - } - } - te= ten; - } -} - -static void outliner_build_tree(SpaceOops *soops) -{ - Base *base; - Object *ob; - TreeElement *te, *ten; - TreeStoreElem *tselem; - int show_opened= soops->treestore==NULL; /* on first view, we open scenes */ -#ifdef WITH_VERSE - struct VerseSession *session; -#endif - - if(soops->tree.first && (soops->storeflag & SO_TREESTORE_REDRAW)) - return; - - outliner_free_tree(&soops->tree); - outliner_storage_cleanup(soops); - - /* clear ob id.new flags */ - for(ob= G.main->object.first; ob; ob= ob->id.next) ob->id.newid= NULL; - - /* options */ - if(soops->outlinevis == SO_LIBRARIES) { - Library *lib; - - for(lib= G.main->library.first; lib; lib= lib->id.next) { - ten= outliner_add_element(soops, &soops->tree, lib, NULL, 0, 0); - lib->id.newid= (ID *)ten; - } - /* make hierarchy */ - ten= soops->tree.first; - while(ten) { - TreeElement *nten= ten->next, *par; - tselem= TREESTORE(ten); - lib= (Library *)tselem->id; - if(lib->parent) { - BLI_remlink(&soops->tree, ten); - par= (TreeElement *)lib->parent->id.newid; - BLI_addtail(&par->subtree, ten); - ten->parent= par; - } - ten= nten; - } - /* restore newid pointers */ - for(lib= G.main->library.first; lib; lib= lib->id.next) - lib->id.newid= NULL; - - } - else if(soops->outlinevis == SO_ALL_SCENES) { - Scene *sce; - for(sce= G.main->scene.first; sce; sce= sce->id.next) { - te= outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0); - tselem= TREESTORE(te); - if(sce==G.scene && show_opened) - tselem->flag &= ~TSE_CLOSED; - - for(base= sce->base.first; base; base= base->next) { - ten= outliner_add_element(soops, &te->subtree, base->object, te, 0, 0); - ten->directdata= base; - } - outliner_make_hierarchy(soops, &te->subtree); - /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ - for(base= sce->base.first; base; base= base->next) base->object->id.newid= NULL; - } - } - else if(soops->outlinevis == SO_CUR_SCENE) { - - outliner_add_scene_contents(soops, &soops->tree, G.scene, NULL); - - for(base= G.scene->base.first; base; base= base->next) { - ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); - ten->directdata= base; - } - outliner_make_hierarchy(soops, &soops->tree); - } - else if(soops->outlinevis == SO_VISIBLE) { - for(base= G.scene->base.first; base; base= base->next) { - if(base->lay & G.scene->lay) - outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); - } - outliner_make_hierarchy(soops, &soops->tree); - } - else if(soops->outlinevis == SO_GROUPS) { - Group *group; - GroupObject *go; - - for(group= G.main->group.first; group; group= group->id.next) { - if(group->id.us) { - te= outliner_add_element(soops, &soops->tree, group, NULL, 0, 0); - tselem= TREESTORE(te); - - for(go= group->gobject.first; go; go= go->next) { - ten= outliner_add_element(soops, &te->subtree, go->ob, te, 0, 0); - ten->directdata= NULL; /* eh, why? */ - } - outliner_make_hierarchy(soops, &te->subtree); - /* clear id.newid, to prevent objects be inserted in wrong scenes (parent in other scene) */ - for(go= group->gobject.first; go; go= go->next) go->ob->id.newid= NULL; - } - } - } - else if(soops->outlinevis == SO_SAME_TYPE) { - Object *ob= OBACT; - if(ob) { - for(base= G.scene->base.first; base; base= base->next) { - if(base->object->type==ob->type) { - ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); - ten->directdata= base; - } - } - outliner_make_hierarchy(soops, &soops->tree); - } - } - else if(soops->outlinevis == SO_SELECTED) { - for(base= G.scene->base.first; base; base= base->next) { - if(base->lay & G.scene->lay) { - if(base==BASACT || (base->flag & SELECT)) { - ten= outliner_add_element(soops, &soops->tree, base->object, NULL, 0, 0); - ten->directdata= base; - } - } - } - outliner_make_hierarchy(soops, &soops->tree); - } -#ifdef WITH_VERSE - else if(soops->outlinevis == SO_VERSE_SESSION) { - /* add all session to the "root" of hierarchy */ - for(session=session_list.first; session; session = session->next) { - struct VNode *vnode; - if(session->flag & VERSE_CONNECTED) { - te= outliner_add_element(soops, &soops->tree, session, NULL, ID_VS, 0); - /* add all object nodes as childreen of session */ - for(vnode=session->nodes.lb.first; vnode; vnode=vnode->next) { - if(vnode->type==V_NT_OBJECT) { - ten= outliner_add_element(soops, &te->subtree, vnode, te, ID_VN, 0); - ten->directdata= vnode; - } - else if(vnode->type==V_NT_BITMAP) { - ten= outliner_add_element(soops, &te->subtree, vnode, te, ID_VN, 0); - ten->directdata= vnode; - } - } - } - } - } - else if(soops->outlinevis == SO_VERSE_MS) { - te= outliner_add_element(soops, &soops->tree, "MS", NULL, ID_MS, 0); - if(server_list.first!=NULL) { - struct VerseServer *server; - /* add one main entry to root of hierarchy */ - for(server=server_list.first; server; server=server->next) { - ten= outliner_add_element(soops, &te->subtree, server, te, ID_SS, 0); - ten->directdata= server; - } - } - } -#endif - else { - ten= outliner_add_element(soops, &soops->tree, OBACT, NULL, 0, 0); - if(ten) ten->directdata= BASACT; - } - - - outliner_sort(soops, &soops->tree); -} - -/* **************** INTERACTIVE ************* */ - -static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel) -{ - TreeElement *te; - int level=curlevel, lev; - - for(te= lb->first; te; te= te->next) { - - lev= outliner_count_levels(soops, &te->subtree, curlevel+1); - if(lev>level) level= lev; - } - return level; -} - -static int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, short curlevel) -{ - TreeElement *te; - TreeStoreElem *tselem; - int level; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->flag & flag) return curlevel; - - level= outliner_has_one_flag(soops, &te->subtree, flag, curlevel+1); - if(level) return level; - } - return 0; -} - -static void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short set) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(set==0) tselem->flag &= ~flag; - else tselem->flag |= flag; - outliner_set_flag(soops, &te->subtree, flag, set); - } -} - -void outliner_toggle_visible(struct ScrArea *sa) -{ - SpaceOops *soops= sa->spacedata.first; - - if( outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1)) - outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 0); - else - outliner_set_flag(soops, &soops->tree, TSE_CLOSED, 1); - - BIF_undo_push("Outliner toggle visible"); - scrarea_queue_redraw(sa); -} - -void outliner_toggle_selected(struct ScrArea *sa) -{ - SpaceOops *soops= sa->spacedata.first; - - if( outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1)) - outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0); - else - outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 1); - - BIF_undo_push("Outliner toggle selected"); - soops->storeflag |= SO_TREESTORE_REDRAW; - scrarea_queue_redraw(sa); -} - - -static void outliner_openclose_level(SpaceOops *soops, ListBase *lb, int curlevel, int level, int open) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - - if(open) { - if(curlevel<=level) tselem->flag &= ~TSE_CLOSED; - } - else { - if(curlevel>=level) tselem->flag |= TSE_CLOSED; - } - - outliner_openclose_level(soops, &te->subtree, curlevel+1, level, open); - } -} - -/* return 1 when levels were opened */ -static int outliner_open_back(SpaceOops *soops, TreeElement *te) -{ - TreeStoreElem *tselem; - int retval= 0; - - for (te= te->parent; te; te= te->parent) { - tselem= TREESTORE(te); - if (tselem->flag & TSE_CLOSED) { - tselem->flag &= ~TSE_CLOSED; - retval= 1; - } - } - return retval; -} - -static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for (te= lb->first; te; te= te->next) { - /* check if this tree-element was the one we're seeking */ - if (te == teFind) { - *found= 1; - return; - } - - /* try to see if sub-tree contains it then */ - outliner_open_reveal(soops, &te->subtree, teFind, found); - if (*found) { - tselem= TREESTORE(te); - if (tselem->flag & TSE_CLOSED) - tselem->flag &= ~TSE_CLOSED; - return; - } - } -} - - -void outliner_one_level(struct ScrArea *sa, int add) -{ - SpaceOops *soops= sa->spacedata.first; - int level; - - level= outliner_has_one_flag(soops, &soops->tree, TSE_CLOSED, 1); - if(add==1) { - if(level) outliner_openclose_level(soops, &soops->tree, 1, level, 1); - } - else { - if(level==0) level= outliner_count_levels(soops, &soops->tree, 0); - if(level) outliner_openclose_level(soops, &soops->tree, 1, level-1, 0); - } - - BIF_undo_push("Outliner show/hide one level"); - scrarea_queue_redraw(sa); -} - -void outliner_page_up_down(ScrArea *sa, int up) -{ - SpaceOops *soops= sa->spacedata.first; - int dy= soops->v2d.mask.ymax-soops->v2d.mask.ymin; - - if(up == -1) dy= -dy; - soops->v2d.cur.ymin+= dy; - soops->v2d.cur.ymax+= dy; - - soops->storeflag |= SO_TREESTORE_REDRAW; - scrarea_queue_redraw(sa); -} - -/* **** do clicks on items ******* */ - -static int tree_element_active_renderlayer(TreeElement *te, TreeStoreElem *tselem, int set) -{ - Scene *sce; - - /* paranoia check */ - if(te->idcode!=ID_SCE) - return 0; - sce= (Scene *)tselem->id; - - if(set) { - sce->r.actlay= tselem->nr; - allqueue(REDRAWBUTSSCENE, 0); - } - else { - return sce->r.actlay==tselem->nr; - } - return 0; -} - -static void tree_element_active_object(SpaceOops *soops, TreeElement *te) -{ - TreeStoreElem *tselem= TREESTORE(te); - Scene *sce; - Base *base; - Object *ob= NULL; - - /* if id is not object, we search back */ - if(te->idcode==ID_OB) ob= (Object *)tselem->id; - else { - ob= (Object *)outliner_search_back(soops, te, ID_OB); - if(ob==OBACT) return; - } - if(ob==NULL) return; - - sce= (Scene *)outliner_search_back(soops, te, ID_SCE); - if(sce && G.scene != sce) { - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - set_scene(sce); - } - - /* find associated base in current scene */ - for(base= FIRSTBASE; base; base= base->next) - if(base->object==ob) break; - if(base) { - if(G.qual & LR_SHIFTKEY) { - /* swap select */ - if(base->flag & SELECT) base->flag &= ~SELECT; - else if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) base->flag |= SELECT; - base->object->flag= base->flag; - } - else { - Base *b; - /* deleselect all */ - for(b= FIRSTBASE; b; b= b->next) { - b->flag &= ~SELECT; - b->object->flag= b->flag; - } - if ((base->object->restrictflag & OB_RESTRICT_VIEW)==0) { - base->flag |= SELECT; - base->object->flag |= SELECT; - } - } - set_active_base(base); /* editview.c */ - - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWINFO, 1); - } - - if(ob!=G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); -} - -static int tree_element_active_material(SpaceOops *soops, TreeElement *te, int set) -{ - TreeElement *tes; - Object *ob; - - /* we search for the object parent */ - ob= (Object *)outliner_search_back(soops, te, ID_OB); - if(ob==NULL || ob!=OBACT) return 0; // just paranoia - - /* searching in ob mat array? */ - tes= te->parent; - if(tes->idcode==ID_OB) { - if(set) { - ob->actcol= te->index+1; - ob->colbits |= (1<index); // make ob material active too - } - else { - if(ob->actcol == te->index+1) - if(ob->colbits & (1<index)) return 1; - } - } - /* or we search for obdata material */ - else { - if(set) { - ob->actcol= te->index+1; - ob->colbits &= ~(1<index); // make obdata material active too - } - else { - if(ob->actcol == te->index+1) - if( (ob->colbits & (1<index))==0 ) return 1; - } - } - if(set) { - extern_set_butspace(F5KEY, 0); // force shading buttons - BIF_preview_changed(ID_MA); - allqueue(REDRAWBUTSSHADING, 1); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWIPO, 0); - } - return 0; -} - -static int tree_element_active_texture(SpaceOops *soops, TreeElement *te, int set) -{ - TreeElement *tep; - TreeStoreElem *tselem, *tselemp; - Object *ob=OBACT; - ScrArea *sa; - SpaceButs *sbuts=NULL; - - if(ob==NULL) return 0; // no active object - - tselem= TREESTORE(te); - - /* find buttons area (note, this is undefined really still, needs recode in blender) */ - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_BUTS) break; - sa= sa->next; - } - if(sa) sbuts= sa->spacedata.first; - - /* where is texture linked to? */ - tep= te->parent; - tselemp= TREESTORE(tep); - - if(tep->idcode==ID_WO) { - World *wrld= (World *)tselemp->id; - - if(set) { - if(sbuts) { - sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c - sbuts->texfrom= 1; - } - extern_set_butspace(F6KEY, 0); // force shading buttons texture - wrld->texact= te->index; - } - else if(tselemp->id == (ID *)(G.scene->world)) { - if(wrld->texact==te->index) return 1; - } - } - else if(tep->idcode==ID_LA) { - Lamp *la= (Lamp *)tselemp->id; - if(set) { - if(sbuts) { - sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c - sbuts->texfrom= 2; - } - extern_set_butspace(F6KEY, 0); // force shading buttons texture - la->texact= te->index; - } - else { - if(tselemp->id == ob->data) { - if(la->texact==te->index) return 1; - } - } - } - else if(tep->idcode==ID_MA) { - Material *ma= (Material *)tselemp->id; - if(set) { - if(sbuts) { - //sbuts->tabo= TAB_SHADING_TEX; // hack from header_buttonswin.c - sbuts->texfrom= 0; - } - extern_set_butspace(F6KEY, 0); // force shading buttons texture - ma->texact= te->index; - - /* also set active material */ - ob->actcol= tep->index+1; - } - else if(tep->flag & TE_ACTIVE) { // this is active material - if(ma->texact==te->index) return 1; - } - } - - return 0; -} - - -static int tree_element_active_lamp(SpaceOops *soops, TreeElement *te, int set) -{ - Object *ob; - - /* we search for the object parent */ - ob= (Object *)outliner_search_back(soops, te, ID_OB); - if(ob==NULL || ob!=OBACT) return 0; // just paranoia - - if(set) { - extern_set_butspace(F5KEY, 0); - BIF_preview_changed(ID_LA); - allqueue(REDRAWBUTSSHADING, 1); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWIPO, 0); - } - else return 1; - - return 0; -} - -static int tree_element_active_world(SpaceOops *soops, TreeElement *te, int set) -{ - TreeElement *tep; - TreeStoreElem *tselem=NULL; - Scene *sce=NULL; - - tep= te->parent; - if(tep) { - tselem= TREESTORE(tep); - sce= (Scene *)tselem->id; - } - - if(set) { // make new scene active - if(sce && G.scene != sce) { - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - set_scene(sce); - } - } - - if(tep==NULL || tselem->id == (ID *)G.scene) { - if(set) { - extern_set_butspace(F8KEY, 0); - } - else { - return 1; - } - } - return 0; -} - -static int tree_element_active_ipo(SpaceOops *soops, TreeElement *te, int set) -{ - TreeElement *tes; - TreeStoreElem *tselems=NULL; - Object *ob; - - /* we search for the object parent */ - ob= (Object *)outliner_search_back(soops, te, ID_OB); - if(ob==NULL || ob!=OBACT) return 0; // just paranoia - - /* the parent of ipo */ - tes= te->parent; - tselems= TREESTORE(tes); - - if(set) { - if(tes->idcode==ID_AC) { - if(ob->ipoflag & OB_ACTION_OB) - ob->ipowin= ID_OB; - else if(ob->ipoflag & OB_ACTION_KEY) - ob->ipowin= ID_KE; - else - ob->ipowin= ID_PO; - } - else ob->ipowin= tes->idcode; - - if(ob->ipowin==ID_MA) tree_element_active_material(soops, tes, 1); - else if(ob->ipowin==ID_AC) { - bActionChannel *chan; - short a=0; - for(chan=ob->action->chanbase.first; chan; chan= chan->next) { - if(a==te->index) break; - if(chan->ipo) a++; - } - deselect_actionchannels(ob->action, 0); - select_channel(ob->action, chan, SELECT_ADD); - allqueue(REDRAWACTION, ob->ipowin); - allqueue(REDRAWVIEW3D, ob->ipowin); - } - - allqueue(REDRAWIPO, ob->ipowin); - } - else { - if(tes->idcode==ID_AC) { - if(ob->ipoflag & OB_ACTION_OB) - return ob->ipowin==ID_OB; - else if(ob->ipoflag & OB_ACTION_KEY) - return ob->ipowin==ID_KE; - else if(ob->ipowin==ID_AC) { - bActionChannel *chan; - short a=0; - for(chan=ob->action->chanbase.first; chan; chan= chan->next) { - if(a==te->index) break; - if(chan->ipo) a++; - } - if(chan==get_hilighted_action_channel(ob->action)) return 1; - } - } - else if(ob->ipowin==tes->idcode) { - if(ob->ipowin==ID_MA) { - Material *ma= give_current_material(ob, ob->actcol); - if(ma==(Material *)tselems->id) return 1; - } - else return 1; - } - } - return 0; -} - -static int tree_element_active_defgroup(TreeElement *te, TreeStoreElem *tselem, int set) -{ - Object *ob; - - /* id in tselem is object */ - ob= (Object *)tselem->id; - if(set) { - ob->actdef= te->index+1; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, ob->ipowin); - } - else { - if(ob==OBACT) - if(ob->actdef== te->index+1) return 1; - } - return 0; -} - -static int tree_element_active_nla_action(TreeElement *te, TreeStoreElem *tselem, int set) -{ - if(set) { - bActionStrip *strip= te->directdata; - if(strip) { - deselect_nlachannel_keys(0); - strip->flag |= ACTSTRIP_SELECT; - allqueue(REDRAWNLA, 0); - } - } - else { - /* id in tselem is action */ - bActionStrip *strip= te->directdata; - if(strip) { - if(strip->flag & ACTSTRIP_SELECT) return 1; - } - } - return 0; -} - -static int tree_element_active_posechannel(TreeElement *te, TreeStoreElem *tselem, int set) -{ - Object *ob= (Object *)tselem->id; - bPoseChannel *pchan= te->directdata; - - if(set) { - if(!(pchan->bone->flag & BONE_HIDDEN_P)) { - - if(G.qual & LR_SHIFTKEY) deselectall_posearmature(ob, 2, 0); // 2 = clear active tag - else deselectall_posearmature(ob, 0, 0); // 0 = deselect - pchan->bone->flag |= BONE_SELECTED|BONE_ACTIVE; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWACTION, 0); - } - } - else { - if(ob==OBACT && ob->pose) { - if (pchan->bone->flag & BONE_SELECTED) return 1; - } - } - return 0; -} - -static int tree_element_active_bone(TreeElement *te, TreeStoreElem *tselem, int set) -{ - bArmature *arm= (bArmature *)tselem->id; - Bone *bone= te->directdata; - - if(set) { - if(!(bone->flag & BONE_HIDDEN_P)) { - if(G.qual & LR_SHIFTKEY) deselectall_posearmature(OBACT, 2, 0); // 2 is clear active tag - else deselectall_posearmature(OBACT, 0, 0); - bone->flag |= BONE_SELECTED|BONE_ACTIVE; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWACTION, 0); - } - } - else { - Object *ob= OBACT; - - if(ob && ob->data==arm) { - if (bone->flag & BONE_SELECTED) return 1; - } - } - return 0; -} - - -/* ebones only draw in editmode armature */ -static int tree_element_active_ebone(TreeElement *te, TreeStoreElem *tselem, int set) -{ - EditBone *ebone= te->directdata; - - if(set) { - if(!(ebone->flag & BONE_HIDDEN_A)) { - - if(G.qual & LR_SHIFTKEY) deselectall_armature(2, 0); // only clear active tag - else deselectall_armature(0, 0); // deselect - - ebone->flag |= BONE_SELECTED|BONE_ROOTSEL|BONE_TIPSEL|BONE_ACTIVE; - // flush to parent? - if(ebone->parent && (ebone->flag & BONE_CONNECTED)) ebone->parent->flag |= BONE_TIPSEL; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWACTION, 0); - } - } - else { - if (ebone->flag & BONE_SELECTED) return 1; - } - return 0; -} - -static int tree_element_active_modifier(TreeElement *te, TreeStoreElem *tselem, int set) -{ - if(set) { - extern_set_butspace(F9KEY, 0); - } - - return 0; -} - -static int tree_element_active_constraint(TreeElement *te, TreeStoreElem *tselem, int set) -{ - if(set) { - extern_set_butspace(F7KEY, 0); - } - - return 0; -} - -static int tree_element_active_text(SpaceOops *soops, TreeElement *te, int set) -{ - ScrArea *sa=NULL; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_TEXT) break; - } - if(sa) { - SpaceText *st= sa->spacedata.first; - TreeStoreElem *tselem= TREESTORE(te); - - if(set) { - st->text= (Text *)tselem->id; - st->top= 0; - scrarea_queue_redraw(sa); - } - else if(st->text==(Text *)tselem->id) return 1; - } - return 0; -} - -/* generic call for ID data check or make/check active in UI */ -static int tree_element_active(SpaceOops *soops, TreeElement *te, int set) -{ - - switch(te->idcode) { - case ID_MA: - return tree_element_active_material(soops, te, set); - case ID_WO: - return tree_element_active_world(soops, te, set); - case ID_LA: - return tree_element_active_lamp(soops, te, set); - case ID_IP: - return tree_element_active_ipo(soops, te, set); - case ID_TE: - return tree_element_active_texture(soops, te, set); - case ID_TXT: - return tree_element_active_text(soops, te, set); - } - return 0; -} - -static int tree_element_active_pose(TreeElement *te, TreeStoreElem *tselem, int set) -{ - Object *ob= (Object *)tselem->id; - - if(set) { - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - if(ob->flag & OB_POSEMODE) exit_posemode(); - else enter_posemode(); - } - else { - if(ob->flag & OB_POSEMODE) return 1; - } - return 0; -} - -/* generic call for non-id data to make/check active in UI */ -static int tree_element_type_active(SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, int set) -{ - - switch(tselem->type) { - case TSE_NLA_ACTION: - return tree_element_active_nla_action(te, tselem, set); - case TSE_DEFGROUP: - return tree_element_active_defgroup(te, tselem, set); - case TSE_BONE: - return tree_element_active_bone(te, tselem, set); - case TSE_EBONE: - return tree_element_active_ebone(te, tselem, set); - case TSE_MODIFIER: - return tree_element_active_modifier(te, tselem, set); - case TSE_LINKED_OB: - if(set) tree_element_active_object(soops, te); - else if(tselem->id==(ID *)OBACT) return 1; - break; - case TSE_POSE_BASE: - return tree_element_active_pose(te, tselem, set); - break; - case TSE_POSE_CHANNEL: - return tree_element_active_posechannel(te, tselem, set); - case TSE_CONSTRAINT: - return tree_element_active_constraint(te, tselem, set); - case TSE_R_LAYER: - return tree_element_active_renderlayer(te, tselem, set); - } - return 0; -} - -#ifdef WITH_VERSE -static void verse_operation_menu(TreeElement *te) -{ - short event=0; - if(te->idcode==ID_VS) { - struct VerseSession *session = (VerseSession*)te->directdata; - struct VNode *vnode; - if(!(session->flag & VERSE_AUTOSUBSCRIBE)) { - event = pupmenu("VerseSession %t| End Session %x1| Subscribe to All Nodes %x2| Start Autosubscribe %x3"); - } - else { - event = pupmenu("VerseSession %t| End Session %x1| Subscribe to All Nodes %x2| Stop Autosubscribe %x4"); - } - switch(event) { - case 1: - end_verse_session(session); - break; - case 2: - vnode = session->nodes.lb.first; - while(vnode) { - b_verse_pop_node(vnode); - vnode = vnode->next; - } - break; - case 3: - vnode = session->nodes.lb.first; - while(vnode) { - b_verse_pop_node(vnode); - vnode = vnode->next; - } - session->flag |= VERSE_AUTOSUBSCRIBE; - break; - case 4: - session->flag &= ~VERSE_AUTOSUBSCRIBE; - break; - } - } - else if(te->idcode==ID_VN) { - struct VNode *vnode = (VNode*)te->directdata; - event = pupmenu("VerseNode %t| Subscribe %x1| Unsubscribe %x2"); - switch(event) { - case 1: - b_verse_pop_node(vnode); - break; - case 2: - /* Global */ - b_verse_unsubscribe(vnode); - break; - } - } - else if(te->idcode==ID_MS) { - event = pupmenu("Verse Master Server %t| Refresh %x1"); - b_verse_ms_get(); - } - else if(te->idcode==ID_SS) { - struct VerseServer *vserver = (VerseServer*)te->directdata; - - if(!(vserver->flag & VERSE_CONNECTING) && !(vserver->flag & VERSE_CONNECTED)) { - event = pupmenu("VerseServer %t| Connect %x1"); - } else if((vserver->flag & VERSE_CONNECTING) && !(vserver->flag & VERSE_CONNECTED)) { - event = pupmenu("VerseServer %t| Connecting %x2"); - } else if(!(vserver->flag & VERSE_CONNECTING) && (vserver->flag & VERSE_CONNECTED)) { - event = pupmenu("VerseServer %t| Disconnect %x3"); - } - switch(event) { - case 1: - b_verse_connect(vserver->ip); - vserver->flag |= VERSE_CONNECTING; - break; - case 2: - break; - case 3: - end_verse_session(vserver->session); - break; - } - } -} -#endif - - -static int do_outliner_mouse_event(SpaceOops *soops, TreeElement *te, short event, float *mval) -{ - - if(mval[1]>te->ys && mval[1]ys+OL_H) { - TreeStoreElem *tselem= TREESTORE(te); - int openclose= 0; - - /* open close icon, three things to check */ - if(event==RETKEY || event==PADENTER) openclose= 1; // enter opens/closes always - else if((te->flag & TE_ICONROW)==0) { // hidden icon, no open/close - if( mval[0]>te->xs && mval[0]xs+OL_X) openclose= 1; - } - - if(openclose) { - - /* all below close/open? */ - if( (G.qual & LR_SHIFTKEY) ) { - tselem->flag &= ~TSE_CLOSED; - outliner_set_flag(soops, &te->subtree, TSE_CLOSED, !outliner_has_one_flag(soops, &te->subtree, TSE_CLOSED, 1)); - } - else { - if(tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED; - else tselem->flag |= TSE_CLOSED; - - } - - return 1; - } - /* name and first icon */ - else if(mval[0]>te->xs && mval[0]xend) { - - /* activate a name button? */ - if(event==LEFTMOUSE) { - - if (G.qual & LR_CTRLKEY) { - if(ELEM8(tselem->type, TSE_NLA, TSE_DEFGROUP_BASE, TSE_CONSTRAINT_BASE, TSE_MODIFIER_BASE, TSE_SCRIPT_BASE, TSE_POSE_BASE, TSE_R_LAYER_BASE, TSE_R_PASS)) - error("Cannot edit builtin name"); - else if(tselem->id->lib) - error_libdata(); - else { - tselem->flag |= TSE_TEXTBUT; - } - } else { - - if (G.qual & LR_SHIFTKEY) { - if(tselem->id->lib && tselem->type==0) { - notice(tselem->id->lib->name); - } - } - /* always makes active object */ - tree_element_active_object(soops, te); - - if(tselem->type==0) { // the lib blocks - /* editmode? */ - if(te->idcode==ID_SCE) { - if(G.scene!=(Scene *)tselem->id) { - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - set_scene((Scene *)tselem->id); - } - } - else if(ELEM5(te->idcode, ID_ME, ID_CU, ID_MB, ID_LT, ID_AR)) { - if(G.obedit) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - else { - enter_editmode(EM_WAITCURSOR); - extern_set_butspace(F9KEY, 0); - } - } else { // rest of types - tree_element_active(soops, te, 1); - } - - } - else tree_element_type_active(soops, te, tselem, 1); - } - } - else if(event==RIGHTMOUSE) { -#ifdef WITH_VERSE - if(ELEM4(te->idcode, ID_VS, ID_VN, ID_MS, ID_SS)) - verse_operation_menu(te); - else -#endif - /* select object that's clicked on and popup context menu */ - if (!(tselem->flag & TSE_SELECTED)) { - - if ( outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1) ) - outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0); - - tselem->flag |= TSE_SELECTED; - /* redraw, same as outliner_select function */ - soops->storeflag |= SO_TREESTORE_REDRAW; - scrarea_do_windraw(soops->area); - screen_swapbuffers(); - } - - outliner_operation_menu(soops->area); - } - return 1; - } - } - - for(te= te->subtree.first; te; te= te->next) { - if(do_outliner_mouse_event(soops, te, event, mval)) return 1; - } - return 0; -} - -/* event can enterkey, then it opens/closes */ -void outliner_mouse_event(ScrArea *sa, short event) -{ - SpaceOops *soops= sa->spacedata.first; - TreeElement *te; - float fmval[2]; - short mval[2]; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(&soops->v2d, mval, fmval, fmval+1); - - for(te= soops->tree.first; te; te= te->next) { - if(do_outliner_mouse_event(soops, te, event, fmval)) break; - } - - if(te) { - BIF_undo_push("Outliner click event"); - allqueue(REDRAWOOPS, 0); - } - else - outliner_select(sa); - -} -/* recursive helper for function below */ -static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) -{ - TreeStoreElem *tselem= TREESTORE(te); - - /* store coord and continue, we need coordinates for elements outside view too */ - te->xs= startx; - te->ys= *starty; - *starty-= OL_H; - - if((tselem->flag & TSE_CLOSED)==0) { - TreeElement *ten; - for(ten= te->subtree.first; ten; ten= ten->next) { - outliner_set_coordinates_element(soops, ten, startx+OL_X, starty); - } - } - -} - -/* to retrieve coordinates with redrawing the entire tree */ -static void outliner_set_coordinates(SpaceOops *soops) -{ - TreeElement *te; - int starty= soops->v2d.tot.ymax-OL_H; - int startx= 0; - - for(te= soops->tree.first; te; te= te->next) { - outliner_set_coordinates_element(soops, te, startx, &starty); - } -} - -static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) -{ - TreeElement *te, *tes; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->type==0) { - if(tselem->id==id) return te; - /* only deeper on scene or object */ - if( te->idcode==ID_OB || te->idcode==ID_SCE) { - tes= outliner_find_id(soops, &te->subtree, id); - if(tes) return tes; - } - } - } - return NULL; -} - -void outliner_show_active(struct ScrArea *sa) -{ - SpaceOops *so= sa->spacedata.first; - TreeElement *te; - int xdelta, ytop; - - if(OBACT == NULL) return; - - te= outliner_find_id(so, &so->tree, (ID *)OBACT); - if(te) { - /* make te->ys center of view */ - ytop= te->ys + (so->v2d.mask.ymax-so->v2d.mask.ymin)/2; - if(ytop>0) ytop= 0; - so->v2d.cur.ymax= ytop; - so->v2d.cur.ymin= ytop-(so->v2d.mask.ymax-so->v2d.mask.ymin); - - /* make te->xs ==> te->xend center of view */ - xdelta = te->xs - so->v2d.cur.xmin; - so->v2d.cur.xmin += xdelta; - so->v2d.cur.xmax += xdelta; - - so->storeflag |= SO_TREESTORE_REDRAW; - scrarea_queue_redraw(sa); - } -} - -void outliner_show_selected(struct ScrArea *sa) -{ - SpaceOops *so= sa->spacedata.first; - TreeElement *te; - int xdelta, ytop; - - te= outliner_find_id(so, &so->tree, (ID *)OBACT); - if(te) { - /* make te->ys center of view */ - ytop= te->ys + (so->v2d.mask.ymax-so->v2d.mask.ymin)/2; - if(ytop>0) ytop= 0; - so->v2d.cur.ymax= ytop; - so->v2d.cur.ymin= ytop-(so->v2d.mask.ymax-so->v2d.mask.ymin); - - /* make te->xs ==> te->xend center of view */ - xdelta = te->xs - so->v2d.cur.xmin; - so->v2d.cur.xmin += xdelta; - so->v2d.cur.xmax += xdelta; - - so->storeflag |= SO_TREESTORE_REDRAW; - scrarea_queue_redraw(sa); - } -} - - -/* find next element that has this name */ -static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) -{ - TreeElement *te, *tes; - - for (te= lb->first; te; te= te->next) { - int found; - - /* determine if match */ - if(flags==OL_FIND) - found= BLI_strcasestr(te->name, name)!=NULL; - else if(flags==OL_FIND_CASE) - found= strstr(te->name, name)!=NULL; - else if(flags==OL_FIND_COMPLETE) - found= BLI_strcasecmp(te->name, name)==0; - else - found= strcmp(te->name, name)==0; - - if(found) { - /* name is right, but is element the previous one? */ - if (prev) { - if ((te != prev) && (*prevFound)) - return te; - if (te == prev) { - *prevFound = 1; - } - } - else - return te; - } - - tes= outliner_find_named(soops, &te->subtree, name, flags, prev, prevFound); - if(tes) return tes; - } - - /* nothing valid found */ - return NULL; -} - -/* tse is not in the treestore, we use its contents to find a match */ -static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) -{ - TreeStore *ts= soops->treestore; - TreeStoreElem *tselem; - int a; - - if(tse->id==NULL) return NULL; - - /* check if 'tse' is in treestore */ - tselem= ts->data; - for(a=0; ausedelem; a++, tselem++) { - if(tselem->id==tse->id) { - if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) { - break; - } - } - } - if(tselem) - return outliner_find_tree_element(&soops->tree, a); - - return NULL; -} - - -/* Called to find an item based on name. - */ -void outliner_find_panel(struct ScrArea *sa, int again, int flags) -{ - SpaceOops *soops= sa->spacedata.first; - TreeElement *te= NULL; - TreeElement *last_find; - TreeStoreElem *tselem; - int ytop, xdelta, prevFound=0; - char name[33]; - - /* get last found tree-element based on stored search_tse */ - last_find= outliner_find_tse(soops, &soops->search_tse); - - /* determine which type of search to do */ - if (again && last_find) { - /* no popup panel - previous + user wanted to search for next after previous */ - BLI_strncpy(name, soops->search_string, 33); - flags= soops->search_flags; - - /* try to find matching element */ - te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound); - if (te==NULL) { - /* no more matches after previous, start from beginning again */ - prevFound= 1; - te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound); - } - } - else { - /* pop up panel - no previous, or user didn't want search after previous */ - strcpy(name, ""); - if (sbutton(name, 0, sizeof(name)-1, "Find: ") && name[0]) { - te= outliner_find_named(soops, &soops->tree, name, flags, NULL, &prevFound); - } - else return; /* XXX RETURN! XXX */ - } - - /* do selection and reveil */ - if (te) { - tselem= TREESTORE(te); - if (tselem) { - /* expand branches so that it will be visible, we need to get correct coordinates */ - if( outliner_open_back(soops, te)) - outliner_set_coordinates(soops); - - /* deselect all visible, and select found element */ - outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0); - tselem->flag |= TSE_SELECTED; - - /* make te->ys center of view */ - ytop= te->ys + (soops->v2d.mask.ymax-soops->v2d.mask.ymin)/2; - if(ytop>0) ytop= 0; - soops->v2d.cur.ymax= ytop; - soops->v2d.cur.ymin= ytop-(soops->v2d.mask.ymax-soops->v2d.mask.ymin); - - /* make te->xs ==> te->xend center of view */ - xdelta = te->xs - soops->v2d.cur.xmin; - soops->v2d.cur.xmin += xdelta; - soops->v2d.cur.xmax += xdelta; - - /* store selection */ - soops->search_tse= *tselem; - - BLI_strncpy(soops->search_string, name, 33); - soops->search_flags= flags; - - /* redraw */ - soops->storeflag |= SO_TREESTORE_REDRAW; - scrarea_queue_redraw(sa); - } - } - else { - /* no tree-element found */ - error("Not found: %s", name); - } -} - -static int subtree_has_objects(SpaceOops *soops, ListBase *lb) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->type==0 && te->idcode==ID_OB) return 1; - if( subtree_has_objects(soops, &te->subtree)) return 1; - } - return 0; -} - -static void tree_element_show_hierarchy(SpaceOops *soops, ListBase *lb) -{ - TreeElement *te; - TreeStoreElem *tselem; - - /* open all object elems, close others */ - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - - if(tselem->type==0) { - if(te->idcode==ID_SCE) { - if(tselem->id!=(ID *)G.scene) tselem->flag |= TSE_CLOSED; - else tselem->flag &= ~TSE_CLOSED; - } - else if(te->idcode==ID_OB) { - if(subtree_has_objects(soops, &te->subtree)) tselem->flag &= ~TSE_CLOSED; - else tselem->flag |= TSE_CLOSED; - } - } - else tselem->flag |= TSE_CLOSED; - - if(tselem->flag & TSE_CLOSED); else tree_element_show_hierarchy(soops, &te->subtree); - } - -} - -/* show entire object level hierarchy */ -void outliner_show_hierarchy(struct ScrArea *sa) -{ - SpaceOops *so= sa->spacedata.first; - - tree_element_show_hierarchy(so, &so->tree); - scrarea_queue_redraw(sa); - - BIF_undo_push("Outliner show hierarchy"); -} - -static void do_outliner_select(SpaceOops *soops, ListBase *lb, float y1, float y2, short *selecting) -{ - TreeElement *te; - TreeStoreElem *tselem; - - if(y1>y2) SWAP(float, y1, y2); - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - - if(te->ys + OL_H < y1) return; - if(te->ys < y2) { - if((te->flag & TE_ICONROW)==0) { - if(*selecting == -1) { - if( tselem->flag & TSE_SELECTED) *selecting= 0; - else *selecting= 1; - } - if(*selecting) tselem->flag |= TSE_SELECTED; - else tselem->flag &= ~TSE_SELECTED; - } - } - if((tselem->flag & TSE_CLOSED)==0) do_outliner_select(soops, &te->subtree, y1, y2, selecting); - } -} - -/* its own redraw loop... urm */ -void outliner_select(struct ScrArea *sa ) -{ - SpaceOops *so= sa->spacedata.first; - float fmval[2], y1, y2; - short mval[2], yo=-1, selecting= -1; - - getmouseco_areawin(mval); - areamouseco_to_ipoco(&so->v2d, mval, fmval, fmval+1); - y1= fmval[1]; - - while (get_mbut() & (L_MOUSE|R_MOUSE)) { - getmouseco_areawin(mval); - areamouseco_to_ipoco(&so->v2d, mval, fmval, fmval+1); - y2= fmval[1]; - - if(yo!=mval[1]) { - /* select the 'ouliner row' */ - do_outliner_select(so, &so->tree, y1, y2, &selecting); - yo= mval[1]; - - so->storeflag |= SO_TREESTORE_REDRAW; - scrarea_do_windraw(sa); - screen_swapbuffers(); - - y1= y2; - } - else PIL_sleep_ms(30); - } - - BIF_undo_push("Outliner selection"); - -} - -/* ************ SELECTION OPERATIONS ********* */ - -static int scenelevel=0, objectlevel=0, idlevel=0, datalevel=0; // globals, euh... you can do better - -static void set_operation_types(SpaceOops *soops, ListBase *lb) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->flag & TSE_SELECTED) { - if(tselem->type) { -#ifdef WITH_VERSE - if(te->idcode==ID_VS) datalevel= TSE_VERSE_SESSION; - else if(te->idcode==ID_VN) datalevel= TSE_VERSE_OBJ_NODE; - else if(datalevel==0) datalevel= tselem->type; -#else - if(datalevel==0) datalevel= tselem->type; -#endif - else if(datalevel!=tselem->type) datalevel= -1; - } - else { - int idcode= GS(tselem->id->name); - switch(idcode) { - case ID_SCE: - scenelevel= 1; - break; - case ID_OB: - objectlevel= 1; - break; - - case ID_ME: case ID_CU: case ID_MB: case ID_LT: - case ID_LA: case ID_AR: case ID_CA: - case ID_MA: case ID_TE: case ID_IP: case ID_IM: - case ID_SO: case ID_KE: case ID_WO: case ID_AC: - case ID_NLA: case ID_TXT: case ID_GR: - if(idlevel==0) idlevel= idcode; - else if(idlevel!=idcode) idlevel= -1; - break; - } - } - } - if((tselem->flag & TSE_CLOSED)==0) set_operation_types(soops, &te->subtree); - } -} - -static void unlink_material_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - Material **matar=NULL; - int a, totcol=0; - - if( GS(tsep->id->name)==ID_OB) { - Object *ob= (Object *)tsep->id; - totcol= ob->totcol; - matar= ob->mat; - } - else if( GS(tsep->id->name)==ID_ME) { - Mesh *me= (Mesh *)tsep->id; - totcol= me->totcol; - matar= me->mat; - } - else if( GS(tsep->id->name)==ID_CU) { - Curve *cu= (Curve *)tsep->id; - totcol= cu->totcol; - matar= cu->mat; - } - else if( GS(tsep->id->name)==ID_MB) { - MetaBall *mb= (MetaBall *)tsep->id; - totcol= mb->totcol; - matar= mb->mat; - } - - for(a=0; aindex && matar[a]) { - matar[a]->id.us--; - matar[a]= NULL; - } - } -} - -static void unlink_texture_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - MTex **mtex= NULL; - int a; - - if( GS(tsep->id->name)==ID_MA) { - Material *ma= (Material *)tsep->id; - mtex= ma->mtex; - } - else if( GS(tsep->id->name)==ID_LA) { - Lamp *la= (Lamp *)tsep->id; - mtex= la->mtex; - } - else if( GS(tsep->id->name)==ID_WO) { - World *wrld= (World *)tsep->id; - mtex= wrld->mtex; - } - else return; - - for(a=0; aindex && mtex[a]) { - if(mtex[a]->tex) { - mtex[a]->tex->id.us--; - mtex[a]->tex= NULL; - } - } - } -} - -static void unlink_group_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - Group *group= (Group *)tselem->id; - - if(tsep) { - if( GS(tsep->id->name)==ID_OB) { - Object *ob= (Object *)tsep->id; - ob->dup_group= NULL; - group->id.us--; - } - } - else { - unlink_group(group); - } -} - -static void outliner_do_libdata_operation(SpaceOops *soops, ListBase *lb, - void (*operation_cb)(TreeElement *, TreeStoreElem *, TreeStoreElem *)) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te=lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->flag & TSE_SELECTED) { - if(tselem->type==0) { - TreeStoreElem *tsep= TREESTORE(te->parent); - operation_cb(te, tsep, tselem); - } - } - if((tselem->flag & TSE_CLOSED)==0) { - outliner_do_libdata_operation(soops, &te->subtree, operation_cb); - } - } -} - -/* */ - -static void object_select_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - Base *base= (Base *)te->directdata; - - if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene); - if(base && ((base->object->restrictflag & OB_RESTRICT_VIEW)==0)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - } -} - -static void object_deselect_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - Base *base= (Base *)te->directdata; - - if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene); - if(base) { - base->flag &= ~SELECT; - base->object->flag &= ~SELECT; - } -} - -static void object_delete_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - Base *base= (Base *)te->directdata; - - if(base==NULL) base= object_in_scene((Object *)tselem->id, G.scene); - if(base) { - // check also library later - if(G.obedit==base->object) exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - - if(base==BASACT) { - G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT); - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - } - - free_and_unlink_base(base); - te->directdata= NULL; - tselem->id= NULL; - } -} - -static void id_local_cb(TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) -{ - if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) { - tselem->id->lib= NULL; - tselem->id->flag= LIB_LOCAL; - new_id(0, tselem->id, 0); - } -} - -static void outliner_do_object_operation(SpaceOops *soops, ListBase *lb, - void (*operation_cb)(TreeElement *, TreeStoreElem *, TreeStoreElem *)) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te=lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->flag & TSE_SELECTED) { - if(tselem->type==0 && te->idcode==ID_OB) { - // when objects selected in other scenes... dunno if that should be allowed - Scene *sce= (Scene *)outliner_search_back(soops, te, ID_SCE); - if(sce && G.scene != sce) set_scene(sce); - - operation_cb(te, NULL, tselem); - } - } - if((tselem->flag & TSE_CLOSED)==0) { - outliner_do_object_operation(soops, &te->subtree, operation_cb); - } - } -} - -static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem) -{ - bPoseChannel *pchan= (bPoseChannel *)te->directdata; - - if(event==1) - pchan->bone->flag |= BONE_SELECTED; - else if(event==2) - pchan->bone->flag &= ~BONE_SELECTED; - else if(event==3) { - pchan->bone->flag |= BONE_HIDDEN_P; - pchan->bone->flag &= ~BONE_SELECTED; - } - else if(event==4) - pchan->bone->flag &= ~BONE_HIDDEN_P; -} - -static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem) -{ - Bone *bone= (Bone *)te->directdata; - - if(event==1) - bone->flag |= BONE_SELECTED; - else if(event==2) - bone->flag &= ~BONE_SELECTED; - else if(event==3) { - bone->flag |= BONE_HIDDEN_P; - bone->flag &= ~BONE_SELECTED; - } - else if(event==4) - bone->flag &= ~BONE_HIDDEN_P; -} - -static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem) -{ - EditBone *ebone= (EditBone *)te->directdata; - - if(event==1) - ebone->flag |= BONE_SELECTED; - else if(event==2) - ebone->flag &= ~BONE_SELECTED; - else if(event==3) { - ebone->flag |= BONE_HIDDEN_A; - ebone->flag &= ~BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - } - else if(event==4) - ebone->flag &= ~BONE_HIDDEN_A; -} - -#ifdef WITH_VERSE -static void vsession_cb(int event, TreeElement *te, TreeStoreElem *tselem) -{ -/* struct VerseSession *vsession =(VerseSession*)te->directdata;*/ - - if(event==1) { - printf("\tending verse session\n"); - } -} -#endif - -static void outliner_do_data_operation(SpaceOops *soops, int type, int event, ListBase *lb, - void (*operation_cb)(int, TreeElement *, TreeStoreElem *)) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te=lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(tselem->flag & TSE_SELECTED) { - if(tselem->type==type) { - operation_cb(event, te, tselem); - } - } - if((tselem->flag & TSE_CLOSED)==0) { - outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb); - } - } -} - -void outliner_del(ScrArea *sa) -{ - SpaceOops *soops= sa->spacedata.first; - outliner_do_object_operation(soops, &soops->tree, object_delete_cb); - DAG_scene_sort(G.scene); - countall(); - BIF_undo_push("Delete Objects"); - allqueue(REDRAWALL, 0); -} - - -void outliner_operation_menu(ScrArea *sa) -{ - SpaceOops *soops= sa->spacedata.first; - - // bad globals - scenelevel= objectlevel= idlevel= datalevel=0; - - set_operation_types(soops, &soops->tree); - - if(scenelevel) { - if(objectlevel || datalevel || idlevel) error("Mixed selection"); - //else pupmenu("Scene Operations%t|Delete"); - } - else if(objectlevel) { - short event= pupmenu("Select%x1|Deselect%x2|Delete%x4"); /* make local: does not work... it doesn't set lib_extern flags... so data gets lost */ - if(event>0) { - char *str=""; - - if(event==1) { - Scene *sce= G.scene; // to be able to delete, scenes are set... - outliner_do_object_operation(soops, &soops->tree, object_select_cb); - if(G.scene != sce) set_scene(sce); - - str= "Select Objects"; - } - else if(event==2) { - outliner_do_object_operation(soops, &soops->tree, object_deselect_cb); - str= "Deselect Objects"; - } - else if(event==4) { - outliner_do_object_operation(soops, &soops->tree, object_delete_cb); - DAG_scene_sort(G.scene); - str= "Delete Objects"; - } - else if(event==5) { /* disabled, see above (ton) */ - outliner_do_object_operation(soops, &soops->tree, id_local_cb); - str= "Localized Objects"; - } - - countall(); - - BIF_undo_push(str); - allqueue(REDRAWALL, 0); - } - } - else if(idlevel) { - if(idlevel==-1 || datalevel) error("Mixed selection"); - else { - short event= pupmenu("Unlink %x1|Make Local %x2"); - - if(event==1) { - switch(idlevel) { - case ID_MA: - outliner_do_libdata_operation(soops, &soops->tree, unlink_material_cb); - BIF_undo_push("Unlink material"); - allqueue(REDRAWBUTSSHADING, 1); - break; - case ID_TE: - outliner_do_libdata_operation(soops, &soops->tree, unlink_texture_cb); - allqueue(REDRAWBUTSSHADING, 1); - BIF_undo_push("Unlink texture"); - break; - case ID_GR: - outliner_do_libdata_operation(soops, &soops->tree, unlink_group_cb); - BIF_undo_push("Unlink group"); - break; - default: - error("Not yet..."); - } - allqueue(REDRAWALL, 0); - } - else if(event==2) { - outliner_do_libdata_operation(soops, &soops->tree, id_local_cb); - BIF_undo_push("Localized Data"); - allqueue(REDRAWALL, 0); - } - } - } - else if(datalevel) { - if(datalevel==-1) error("Mixed selection"); - else { - if(datalevel==TSE_POSE_CHANNEL) { - short event= pupmenu("PoseChannel Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4"); - if(event>0) { - outliner_do_data_operation(soops, datalevel, event, &soops->tree, pchan_cb); - BIF_undo_push("PoseChannel operation"); - } - } - else if(datalevel==TSE_BONE) { - short event= pupmenu("Bone Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4"); - if(event>0) { - outliner_do_data_operation(soops, datalevel, event, &soops->tree, bone_cb); - BIF_undo_push("Bone operation"); - } - } - else if(datalevel==TSE_EBONE) { - short event= pupmenu("EditBone Operations%t|Select%x1|Deselect%x2|Hide%x3|Unhide%x4"); - if(event>0) { - outliner_do_data_operation(soops, datalevel, event, &soops->tree, ebone_cb); - BIF_undo_push("EditBone operation"); - } - } -#ifdef WITH_VERSE - else if(datalevel==TSE_VERSE_SESSION) { - short event= pupmenu("VerseSession %t| End %x1"); - if(event>0) { - outliner_do_data_operation(soops, datalevel, event, &soops->tree, vsession_cb); - } - } -#endif - - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWVIEW3D, 0); - } - } -} - - -/* ***************** DRAW *************** */ - -static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElement *te) -{ - if(tselem->type) { - switch( tselem->type) { - case TSE_NLA: - BIF_icon_draw(x, y, ICON_NLA); break; - case TSE_NLA_ACTION: - BIF_icon_draw(x, y, ICON_ACTION); break; - case TSE_DEFGROUP_BASE: - BIF_icon_draw(x, y, ICON_VERTEXSEL); break; - case TSE_BONE: - case TSE_EBONE: - BIF_icon_draw(x, y, ICON_WPAINT_DEHLT); break; - case TSE_CONSTRAINT_BASE: - BIF_icon_draw(x, y, ICON_CONSTRAINT); break; - case TSE_MODIFIER_BASE: - BIF_icon_draw(x, y, ICON_MODIFIER); break; - case TSE_LINKED_OB: - BIF_icon_draw(x, y, ICON_OBJECT); break; - case TSE_MODIFIER: - { - Object *ob= (Object *)tselem->id; - ModifierData *md= BLI_findlink(&ob->modifiers, tselem->nr); - switch(md->type) { - case eModifierType_Subsurf: - BIF_icon_draw(x, y, ICON_MOD_SUBSURF); break; - case eModifierType_Armature: - BIF_icon_draw(x, y, ICON_ARMATURE); break; - case eModifierType_Lattice: - BIF_icon_draw(x, y, ICON_LATTICE); break; - case eModifierType_Curve: - BIF_icon_draw(x, y, ICON_CURVE); break; - case eModifierType_Build: - BIF_icon_draw(x, y, ICON_MOD_BUILD); break; - case eModifierType_Mirror: - BIF_icon_draw(x, y, ICON_MOD_MIRROR); break; - case eModifierType_Decimate: - BIF_icon_draw(x, y, ICON_MOD_DECIM); break; - case eModifierType_Wave: - BIF_icon_draw(x, y, ICON_MOD_WAVE); break; - case eModifierType_Hook: - BIF_icon_draw(x, y, ICON_HOOK); break; - case eModifierType_Softbody: - BIF_icon_draw(x, y, ICON_MOD_SOFT); break; - case eModifierType_Boolean: - BIF_icon_draw(x, y, ICON_MOD_BOOLEAN); break; - default: - BIF_icon_draw(x, y, ICON_DOT); break; - } - break; - } - case TSE_SCRIPT_BASE: - BIF_icon_draw(x, y, ICON_TEXT); break; - case TSE_POSE_BASE: - BIF_icon_draw(x, y, ICON_ARMATURE_DEHLT); break; - case TSE_POSE_CHANNEL: - BIF_icon_draw(x, y, ICON_WPAINT_DEHLT); break; - case TSE_PROXY: - BIF_icon_draw(x, y, ICON_GHOST); break; - case TSE_R_LAYER_BASE: - BIF_icon_draw(x, y, ICON_RESTRICT_RENDER_OFF); break; - case TSE_R_LAYER: - BIF_icon_draw(x, y, ICON_IMAGE_DEHLT); break; - case TSE_LINKED_LAMP: - BIF_icon_draw(x, y, ICON_LAMP_DEHLT); break; - case TSE_LINKED_MAT: - BIF_icon_draw(x, y, ICON_MATERIAL_DEHLT); break; - -#ifdef WITH_VERSE - case ID_VS: - case ID_MS: - case ID_SS: - BIF_icon_draw(x, y, ICON_VERSE); break; - case ID_VN: - BIF_icon_draw(x, y, ICON_VERSE); break; -#endif - default: - BIF_icon_draw(x, y, ICON_DOT); break; - } - } - else { - switch( GS(tselem->id->name)) { - case ID_SCE: - BIF_icon_draw(x, y, ICON_SCENE_DEHLT); break; - case ID_OB: - BIF_icon_draw(x, y, ICON_OBJECT); break; - case ID_ME: - BIF_icon_draw(x, y, ICON_MESH); break; - case ID_CU: - BIF_icon_draw(x, y, ICON_CURVE); break; - case ID_MB: - BIF_icon_draw(x, y, ICON_MBALL); break; - case ID_LT: - BIF_icon_draw(x, y, ICON_LATTICE); break; - case ID_LA: - BIF_icon_draw(x, y, ICON_LAMP_DEHLT); break; - case ID_MA: - BIF_icon_draw(x, y, ICON_MATERIAL_DEHLT); break; - case ID_TE: - BIF_icon_draw(x, y, ICON_TEXTURE_DEHLT); break; - case ID_IP: - BIF_icon_draw(x, y, ICON_IPO_DEHLT); break; - case ID_IM: - BIF_icon_draw(x, y, ICON_IMAGE_DEHLT); break; - case ID_SO: - BIF_icon_draw(x, y, ICON_SPEAKER); break; - case ID_AR: - BIF_icon_draw(x, y, ICON_ARMATURE); break; - case ID_CA: - BIF_icon_draw(x, y, ICON_CAMERA_DEHLT); break; - case ID_KE: - BIF_icon_draw(x, y, ICON_EDIT_DEHLT); break; - case ID_WO: - BIF_icon_draw(x, y, ICON_WORLD_DEHLT); break; - case ID_AC: - BIF_icon_draw(x, y, ICON_ACTION); break; - case ID_NLA: - BIF_icon_draw(x, y, ICON_NLA); break; - case ID_TXT: - BIF_icon_draw(x, y, ICON_SCRIPT); break; - case ID_GR: - BIF_icon_draw(x, y, ICON_CIRCLE_DEHLT); break; - case ID_LI: - BIF_icon_draw(x, y, ICON_LIBRARY_DEHLT); break; - } - } -} - -static void outliner_draw_iconrow(SpaceOops *soops, ListBase *lb, int level, int *offsx, int ys) -{ - TreeElement *te; - TreeStoreElem *tselem; - int active; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - - /* object hierarchy always, further constrained on level */ - if(level<1 || (tselem->type==0 && te->idcode==ID_OB)) { - - /* active blocks get white circle */ - active= 0; - if(tselem->type==0) { - if(te->idcode==ID_OB) active= (OBACT==(Object *)tselem->id); - else if(G.obedit && G.obedit->data==tselem->id) active= 1; - else active= tree_element_active(soops, te, 0); - } - else active= tree_element_type_active(soops, te, tselem, 0); - - if(active) { - uiSetRoundBox(15); - glColor4ub(255, 255, 255, 100); - uiRoundBox( (float)*offsx-0.5, (float)ys-1.0, (float)*offsx+OL_H-3.0, (float)ys+OL_H-3.0, OL_H/2.0-2.0); - glEnable(GL_BLEND); - } - - tselem_draw_icon(*offsx, ys, tselem, te); - te->xs= *offsx; - te->ys= ys; - te->xend= *offsx+OL_X; - te->flag |= TE_ICONROW; // for click - - (*offsx) += OL_X; - } - - /* this tree element always has same amount of branches, so dont draw */ - if(tselem->type!=TSE_R_LAYER) - outliner_draw_iconrow(soops, &te->subtree, level+1, offsx, ys); - } - -} - -static void outliner_draw_tree_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) -{ - TreeElement *ten; - TreeStoreElem *tselem; - int offsx= 0, active=0; // active=1 active obj, else active data - - tselem= TREESTORE(te); - - if(*starty >= soops->v2d.cur.ymin && *starty<= soops->v2d.cur.ymax) { - - glEnable(GL_BLEND); - - /* colors for active/selected data */ - if(tselem->type==0) { - if(te->idcode==ID_SCE) { - if(tselem->id == (ID *)G.scene) { - glColor4ub(255, 255, 255, 100); - active= 2; - } - } - else if(te->idcode==ID_OB) { - Object *ob= (Object *)tselem->id; - - if(ob==OBACT || (ob->flag & SELECT)) { - char col[4]; - - active= 2; - if(ob==OBACT) { - BIF_GetThemeColorType4ubv(TH_ACTIVE, SPACE_VIEW3D, col); - /* so black text is drawn when active and not selected */ - if (ob->flag & SELECT) active= 1; - } - else BIF_GetThemeColorType4ubv(TH_SELECT, SPACE_VIEW3D, col); - col[3]= 100; - glColor4ubv((GLubyte *)col); - } - -#ifdef WITH_VERSE - if(ob->vnode) { - if (active==0) active=2; - if (ob==OBACT) - glColor4ub(0,255,0,100); - else - glColor4ub(0,128,0,100); - } -#endif - } - else if(G.obedit && G.obedit->data==tselem->id) { - glColor4ub(255, 255, 255, 100); - active= 2; - } - else { - if(tree_element_active(soops, te, 0)) { - glColor4ub(220, 220, 255, 100); - active= 2; - } - } - } else if (tselem->type==ID_SS) { -#ifdef WITH_VERSE - /* draw colored circle behind verse server icon */ - struct VerseServer *server = (VerseServer *)te->directdata; - if(server->flag & VERSE_CONNECTING) { - glColor4ub(255,128,64,100); - active = 2; - } else if(server->flag & VERSE_CONNECTED) { - glColor4ub(0,128,0,100); - active = 2; - } -#endif - } - else if (tselem->type==ID_VN) { -#ifdef WITH_VERSE - struct VNode *vnode = (VNode *)te->directdata; - if(vnode->type==V_NT_OBJECT) { - if(((VObjectData*)vnode->data)->object) { - glColor4ub(0,128,0,100); - active = 2; - } - } - else if(vnode->type==V_NT_GEOMETRY) { - if(((VGeomData*)vnode->data)->mesh || ((VGeomData*)vnode->data)->editmesh) { - glColor4ub(0,128,0,100); - active = 2; - } - } - if(vnode->type==V_NT_BITMAP) { - if(((VBitmapData*)vnode->data)->image) { - glColor4ub(0,128,0,100); - active = 2; - } - } -#endif - } - else { - if( tree_element_type_active(soops, te, tselem, 0) ) active= 2; - glColor4ub(220, 220, 255, 100); - } - - /* active circle */ - if(active) { - uiSetRoundBox(15); - uiRoundBox( (float)startx+OL_H-1.5, (float)*starty+2.0, (float)startx+2*OL_H-4.0, (float)*starty+OL_H-1.0, OL_H/2.0-2.0); - glEnable(GL_BLEND); /* roundbox disables it */ - - te->flag |= TE_ACTIVE; // for lookup in display hierarchies - } - - /* open/close icon, only when sublevels, except for scene */ - if(te->subtree.first || (te->idcode==ID_SCE && tselem->type==0)) { - int icon_x; - if((tselem->type==0 && ELEM(te->idcode, ID_OB, ID_SCE)) || ELEM4(te->idcode,ID_VN,ID_VS, ID_MS, ID_SS)) - icon_x = startx; - else - icon_x = startx+5; - - // icons a bit higher - if(tselem->flag & TSE_CLOSED) - BIF_icon_draw(icon_x, *starty+2, ICON_TRIA_RIGHT); - else - BIF_icon_draw(icon_x, *starty+2, ICON_TRIA_DOWN); - } - offsx+= OL_X; - - /* datatype icon */ - - // icons a bit higher - tselem_draw_icon(startx+offsx, *starty+2, tselem, te); - offsx+= OL_X; - - if(tselem->id->lib && tselem->type==0) { - glPixelTransferf(GL_ALPHA_SCALE, 0.5); - if(tselem->id->flag & LIB_INDIRECT) - BIF_icon_draw(startx+offsx, *starty+2, ICON_DATALIB); - else - BIF_icon_draw(startx+offsx, *starty+2, ICON_PARLIB); - glPixelTransferf(GL_ALPHA_SCALE, 1.0); - offsx+= OL_X; - } - glDisable(GL_BLEND); - - /* name */ - if(active==1) BIF_ThemeColor(TH_TEXT_HI); - else BIF_ThemeColor(TH_TEXT); - glRasterPos2i(startx+offsx, *starty+5); - BIF_RasterPos(startx+offsx, *starty+5); -#ifdef WITH_VERSE - if(te->name) { -#endif - BIF_DrawString(G.font, te->name, 0); - offsx+= OL_X + BIF_GetStringWidth(G.font, te->name, 0); -#ifdef WITH_VERSE - } -#endif - - /* closed item, we draw the icons, not when it's a scene, or master-server list though */ - if(tselem->flag & TSE_CLOSED) { - if(te->subtree.first) { - if(tselem->type==0 && te->idcode==ID_SCE); -#ifdef WITH_VERSE - else if(tselem->type==ID_MS) { - char server_buf[50]; - int nr_servers = 0; - struct VerseServer *server = server_list.first; - while (server) { - nr_servers++; - server = server->next; - } - sprintf(server_buf, "(%d server%s", nr_servers, nr_servers==1?")":"s)"); - glRasterPos2i(startx+offsx-10, *starty+5); - BIF_RasterPos(startx+offsx-10, *starty+5); - BIF_DrawString(G.font, server_buf, 0); - offsx+= OL_X + BIF_GetStringWidth(G.font, server_buf, 0); - } -#endif - else if(tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so dont draw */ - int tempx= startx+offsx; - // divider - BIF_ThemeColorShade(TH_BACK, -40); - glRecti(tempx -10, *starty+4, tempx -8, *starty+OL_H-4); - - glEnable(GL_BLEND); - glPixelTransferf(GL_ALPHA_SCALE, 0.5); - - outliner_draw_iconrow(soops, &te->subtree, 0, &tempx, *starty+2); - - glPixelTransferf(GL_ALPHA_SCALE, 1.0); - glDisable(GL_BLEND); - } - } - } - } - /* store coord and continue, we need coordinates for elements outside view too */ - te->xs= startx; - te->ys= *starty; - te->xend= startx+offsx; - - *starty-= OL_H; - - if((tselem->flag & TSE_CLOSED)==0) { - for(ten= te->subtree.first; ten; ten= ten->next) { - outliner_draw_tree_element(soops, ten, startx+OL_X, starty); - } - } -} - -static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx, int *starty) -{ - TreeElement *te; - TreeStoreElem *tselem; - int y1, y2; - - if(lb->first==NULL) return; - - y1=y2= *starty; /* for vertical lines between objects */ - for(te=lb->first; te; te= te->next) { - y2= *starty; - tselem= TREESTORE(te); - - /* horizontal line? */ - if((tselem->type==0 && (te->idcode==ID_OB || te->idcode==ID_SCE)) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS)) - glRecti(startx, *starty, startx+OL_X, *starty-1); - - *starty-= OL_H; - - if((tselem->flag & TSE_CLOSED)==0) - outliner_draw_hierarchy(soops, &te->subtree, startx+OL_X, starty); - } - - /* vertical line */ - te= lb->last; - if(te->parent || lb->first!=lb->last) { - tselem= TREESTORE(te); - if((tselem->type==0 && te->idcode==ID_OB) || ELEM4(te->idcode,ID_VS,ID_VN,ID_MS,ID_SS)) { - - glRecti(startx, y1+OL_H, startx+1, y2); - } - } -} - -static void outliner_draw_selection(SpaceOops *soops, ListBase *lb, int *starty) -{ - TreeElement *te; - TreeStoreElem *tselem; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - - /* selection status */ - if(tselem->flag & TSE_SELECTED) { - glRecti(0, *starty+1, (int)soops->v2d.cur.xmax, *starty+OL_H-1); - } - *starty-= OL_H; - if((tselem->flag & TSE_CLOSED)==0) outliner_draw_selection(soops, &te->subtree, starty); - } -} - - -static void outliner_draw_tree(SpaceOops *soops) -{ - TreeElement *te; - int starty, startx; - float col[4]; - -#ifdef INTERNATIONAL - FTF_SetFontSize('l'); - BIF_SetScale(1.0); -#endif - - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // only once - - // selection first - BIF_GetThemeColor3fv(TH_BACK, col); - glColor3f(col[0]+0.06f, col[1]+0.08f, col[2]+0.10f); - starty= soops->v2d.tot.ymax-OL_H; - outliner_draw_selection(soops, &soops->tree, &starty); - - // grey hierarchy lines - BIF_ThemeColorBlend(TH_BACK, TH_TEXT, 0.2); - starty= soops->v2d.tot.ymax-OL_H/2; - startx= 6; - outliner_draw_hierarchy(soops, &soops->tree, startx, &starty); - - // items themselves - starty= soops->v2d.tot.ymax-OL_H; - startx= 0; - for(te= soops->tree.first; te; te= te->next) { - outliner_draw_tree_element(soops, te, startx, &starty); - } -} - - -static void outliner_back(SpaceOops *soops) -{ - int ystart; - - BIF_ThemeColorShade(TH_BACK, 6); - ystart= soops->v2d.tot.ymax; - ystart= OL_H*(ystart/(OL_H)); - - while(ystart > soops->v2d.cur.ymin) { - glRecti(0, ystart, (int)soops->v2d.cur.xmax, ystart+OL_H); - ystart-= 2*OL_H; - } -} - -static void outliner_draw_restrictcols(SpaceOops *soops) -{ - int ystart; - - /* background underneath */ - BIF_ThemeColor(TH_BACK); - glRecti((int)soops->v2d.cur.xmax-OL_TOGW, soops->v2d.cur.ymin, (int)soops->v2d.cur.xmax, soops->v2d.cur.ymax); - - BIF_ThemeColorShade(TH_BACK, 6); - ystart= soops->v2d.tot.ymax; - ystart= OL_H*(ystart/(OL_H)); - - while(ystart > soops->v2d.cur.ymin) { - glRecti((int)soops->v2d.cur.xmax-OL_TOGW, ystart, (int)soops->v2d.cur.xmax, ystart+OL_H); - ystart-= 2*OL_H; - } - - BIF_ThemeColorShadeAlpha(TH_BACK, -15, -200); - - /* view */ - fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, - soops->v2d.cur.ymax, - soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, - soops->v2d.cur.ymin); - - /* render */ - fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, - soops->v2d.cur.ymax, - soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, - soops->v2d.cur.ymin); - - /* render */ - fdrawline(soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, - soops->v2d.cur.ymax, - soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, - soops->v2d.cur.ymin); -} - -static void restrictbutton_view_cb(void *poin, void *poin2) -{ - Base *base; - Object *ob = (Object *)poin; - - /* deselect objects that are invisible */ - if (ob->restrictflag & OB_RESTRICT_VIEW) { - - /* Ouch! There is no backwards pointer from Object to Base, - * so have to do loop to find it. */ - for(base= FIRSTBASE; base; base= base->next) { - if(base->object==ob) { - base->flag &= ~SELECT; - base->object->flag= base->flag; - } - } - } - - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); -} - -static void restrictbutton_sel_cb(void *poin, void *poin2) -{ - Base *base; - Object *ob = (Object *)poin; - - /* if select restriction has just been turned on */ - if (ob->restrictflag & OB_RESTRICT_SELECT) { - - /* Ouch! There is no backwards pointer from Object to Base, - * so have to do loop to find it. */ - for(base= FIRSTBASE; base; base= base->next) { - if(base->object==ob) { - base->flag &= ~SELECT; - base->object->flag= base->flag; - } - } - } - - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); -} - -static void restrictbutton_rend_cb(void *poin, void *poin2) -{ - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); -} - -static void restrictbutton_r_lay_cb(void *poin, void *poin2) -{ - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSCENE, 0); -} - -static void namebutton_cb(void *tep, void *oldnamep) -{ - SpaceOops *soops= curarea->spacedata.first; - TreeStore *ts= soops->treestore; - TreeElement *te= tep; - - if(ts && te) { - TreeStoreElem *tselem= TREESTORE(te); - - if(tselem->type==0) { - test_idbutton(tselem->id->name+2); // library.c, unique name and alpha sort - - /* Check the library target exists */ - if (te->idcode == ID_LI) { - char expanded[FILE_MAXDIR + FILE_MAXFILE]; - BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_convertstringcode(expanded, G.sce, G.scene->r.cfra); - if (!BLI_exists(expanded)) { - error("This path does not exist, correct this before saving"); - } - } - } - else { - switch(tselem->type) { - case TSE_DEFGROUP: - unique_vertexgroup_name(te->directdata, (Object *)tselem->id); // id = object - allqueue(REDRAWBUTSEDIT, 0); - break; - case TSE_NLA_ACTION: - test_idbutton(tselem->id->name+2); - break; - case TSE_EBONE: - if(G.obedit && G.obedit->data==(ID *)tselem->id) { - EditBone *ebone= te->directdata; - char newname[32]; - - /* restore bone name */ - BLI_strncpy(newname, ebone->name, 32); - BLI_strncpy(ebone->name, oldnamep, 32); - armature_bone_rename(G.obedit->data, oldnamep, newname); - } - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - break; - - case TSE_BONE: - { - Bone *bone= te->directdata; - Object *ob; - char newname[32]; - - // always make current object active - tree_element_active_object(soops, te); - ob= OBACT; - - /* restore bone name */ - BLI_strncpy(newname, bone->name, 32); - BLI_strncpy(bone->name, oldnamep, 32); - armature_bone_rename(ob->data, oldnamep, newname); - } - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - break; - case TSE_POSE_CHANNEL: - { - bPoseChannel *pchan= te->directdata; - Object *ob; - char newname[32]; - - // always make current object active - tree_element_active_object(soops, te); - ob= OBACT; - - /* restore bone name */ - BLI_strncpy(newname, pchan->name, 32); - BLI_strncpy(pchan->name, oldnamep, 32); - armature_bone_rename(ob->data, oldnamep, newname); - } - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - break; - case TSE_R_LAYER: - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSSCENE, 0); - break; - } - } - } - scrarea_queue_redraw(curarea); -} - -static void outliner_draw_restrictbuts(uiBlock *block, SpaceOops *soops, ListBase *lb) -{ - uiBut *bt; - TreeElement *te; - TreeStoreElem *tselem; - Object *ob; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(te->ys >= soops->v2d.cur.ymin && te->ys <= soops->v2d.cur.ymax) { - /* objects have toggle-able restriction flags */ - if(tselem->type==0 && te->idcode==ID_OB) { - ob = (Object *)tselem->id; - - uiBlockSetEmboss(block, UI_EMBOSSN); - bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_VIEW, REDRAWALL, ICON_RESTRICT_VIEW_OFF, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); - uiButSetFunc(bt, restrictbutton_view_cb, ob, NULL); - uiButSetFlag(bt, UI_NO_HILITE); - - bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_SELECT, REDRAWALL, ICON_RESTRICT_SELECT_OFF, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow selection in the 3D View"); - uiButSetFunc(bt, restrictbutton_sel_cb, ob, NULL); - uiButSetFlag(bt, UI_NO_HILITE); - - bt= uiDefIconButBitS(block, ICONTOG, OB_RESTRICT_RENDER, REDRAWALL, ICON_RESTRICT_RENDER_OFF, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, te->ys, 17, OL_H-1, &(ob->restrictflag), 0, 0, 0, 0, "Restrict/Allow renderability"); - uiButSetFunc(bt, restrictbutton_rend_cb, NULL, NULL); - uiButSetFlag(bt, UI_NO_HILITE); - - uiBlockSetEmboss(block, UI_EMBOSS); - } - /* scene render layers and passes have toggle-able flags too! */ - else if(tselem->type==TSE_R_LAYER) { - uiBlockSetEmboss(block, UI_EMBOSSN); - - bt= uiDefIconButBitI(block, ICONTOGN, SCE_LAY_DISABLE, REDRAWBUTSSCENE, ICON_CHECKBOX_HLT-1, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, te->directdata, 0, 0, 0, 0, "Render this RenderLayer"); - uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL); - - uiBlockSetEmboss(block, UI_EMBOSS); - } - else if(tselem->type==TSE_R_PASS) { - int *layflag= te->directdata; - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* NOTE: tselem->nr is short! */ - bt= uiDefIconButBitI(block, ICONTOG, tselem->nr, REDRAWBUTSSCENE, ICON_CHECKBOX_HLT-1, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Render this Pass"); - uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL); - - layflag++; /* is lay_xor */ - if(ELEM6(tselem->nr, SCE_PASS_SPEC, SCE_PASS_SHADOW, SCE_PASS_AO, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_RADIO)) - bt= uiDefIconButBitI(block, TOG, tselem->nr, REDRAWBUTSSCENE, (*layflag & tselem->nr)?ICON_DOT:ICON_BLANK1, - (int)soops->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, te->ys, 17, OL_H-1, layflag, 0, 0, 0, 0, "Exclude this Pass from Combined"); - uiButSetFunc(bt, restrictbutton_r_lay_cb, NULL, NULL); - - uiBlockSetEmboss(block, UI_EMBOSS); - } - } - - if((tselem->flag & TSE_CLOSED)==0) outliner_draw_restrictbuts(block, soops, &te->subtree); - } -} - -static void outliner_buttons(uiBlock *block, SpaceOops *soops, ListBase *lb) -{ - uiBut *bt; - TreeElement *te; - TreeStoreElem *tselem; - int dx, len; - - for(te= lb->first; te; te= te->next) { - tselem= TREESTORE(te); - if(te->ys >= soops->v2d.cur.ymin && te->ys <= soops->v2d.cur.ymax) { - - if(tselem->flag & TSE_TEXTBUT) { - if(tselem->type == TSE_POSE_BASE) continue; // prevent crash when trying to rename 'pose' entry of armature - - if(tselem->type==TSE_EBONE) len = sizeof(((EditBone*) 0)->name); - else if (tselem->type==TSE_MODIFIER) len = sizeof(((ModifierData*) 0)->name); - else if(tselem->id && GS(tselem->id->name)==ID_LI) len = sizeof(((Library*) 0)->name); - else len= sizeof(((ID*) 0)->name)-2; - - dx= BIF_GetStringWidth(G.font, te->name, 0); - if(dx<50) dx= 50; - - bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "", te->xs+2*OL_X-4, te->ys, dx+10, OL_H-1, te->name, 1.0, (float)len-1, 0, 0, ""); - uiButSetFunc(bt, namebutton_cb, te, NULL); - - // signal for button to open - addqueue(curarea->win, BUT_ACTIVATE, OL_NAMEBUTTON); - - /* otherwise keeps open on ESC */ - tselem->flag &= ~TSE_TEXTBUT; - } - } - - if((tselem->flag & TSE_CLOSED)==0) outliner_buttons(block, soops, &te->subtree); - } -} - -void draw_outliner(ScrArea *sa, SpaceOops *soops) -{ - uiBlock *block; - int sizey, sizex; - short ofsx, ofsy; - - /* version patch for old outliners here - do_versions patch doesn't work */ - if (G.v2d->scroll != L_SCROLL+B_SCROLLO) { - init_v2d_oops(curarea, soops); - test_view2d(G.v2d, curarea->winx, curarea->winy); - calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy); - } - else - calc_scrollrcts(sa, G.v2d, sa->winx, sa->winy); - - if(sa->winx>SCROLLB+10 && sa->winy>SCROLLH+10) { - if(G.v2d->scroll) { - ofsx= sa->winrct.xmin; /* because mywin */ - ofsy= sa->winrct.ymin; - glViewport(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1); - } - } - - outliner_build_tree(soops); // always - sizey = sizex = 0; - outliner_height(soops, &soops->tree, &sizey); - outliner_width(soops, &soops->tree, &sizex); - - /* we init all tot rect vars, only really needed on window size change though */ - G.v2d->tot.xmin= 0.0; - G.v2d->tot.xmax= (G.v2d->mask.xmax-G.v2d->mask.xmin); - if(soops->flag & SO_HIDE_RESTRICTCOLS) { - if(G.v2d->tot.xmax <= sizex) - G.v2d->tot.xmax= 2*sizex; - } - else { - if(G.v2d->tot.xmax-OL_TOGW <= sizex) - G.v2d->tot.xmax= 2*sizex; - } - G.v2d->tot.ymax= 0.0; - G.v2d->tot.ymin= -sizey*OL_H; - test_view2d(G.v2d, sa->winx, sa->winy); - - // align on top window if cur bigger than tot - if(G.v2d->cur.ymax-G.v2d->cur.ymin > sizey*OL_H) { - G.v2d->cur.ymax= 0.0; - G.v2d->cur.ymin= -(G.v2d->mask.ymax-G.v2d->mask.ymin); - } - - myortho2(G.v2d->cur.xmin-0.375, G.v2d->cur.xmax-0.375, G.v2d->cur.ymin-0.375, G.v2d->cur.ymax-0.375); - - /* draw outliner stuff (background and hierachy lines) */ - outliner_back(soops); - outliner_draw_tree(soops); - - /* restore viewport */ - mywinset(sa->win); - - /* ortho corrected - 'pixel space' */ - myortho2(G.v2d->cur.xmin-SCROLLB-0.375, G.v2d->cur.xmax-0.375, G.v2d->cur.ymin-SCROLLH-0.375, G.v2d->cur.ymax-0.375); - - /* draw icons and names */ - block= uiNewBlock(&sa->uiblocks, "outliner buttons", UI_EMBOSS, UI_HELV, sa->win); - outliner_buttons(block, soops, &soops->tree); - - /* draw restriction columns */ - if (!(soops->flag & SO_HIDE_RESTRICTCOLS)) { - outliner_draw_restrictcols(soops); - outliner_draw_restrictbuts(block, soops, &soops->tree); - } - - uiDrawBlock(block); - - /* clear flag that allows quick redraws */ - soops->storeflag &= ~SO_TREESTORE_REDRAW; - - /* drawoopsspace handles sliders */ -} diff --git a/source/blender/src/parametrizer.c b/source/blender/src/parametrizer.c deleted file mode 100644 index f54bd22c79e..00000000000 --- a/source/blender/src/parametrizer.c +++ /dev/null @@ -1,4200 +0,0 @@ - -#include "MEM_guardedalloc.h" - -#include "BLI_memarena.h" -#include "BLI_arithb.h" -#include "BLI_rand.h" -#include "BLI_heap.h" -#include "BLI_boxpack2d.h" - -#include "BKE_utildefines.h" - -#include "BIF_editsima.h" -#include "BIF_toolbox.h" - -#include "ONL_opennl.h" - -#include "parametrizer.h" -#include "parametrizer_intern.h" - -#include -#include -#include -#include - -#if defined(_WIN32) -#define M_PI 3.14159265358979323846 -#endif - -/* PHash - - special purpose hash that keeps all its elements in a single linked list. - - after construction, this hash is thrown away, and the list remains. - - removing elements is not possible efficiently. -*/ - -static int PHashSizes[] = { - 1, 3, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, - 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, - 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459 -}; - -#define PHASH_hash(ph, item) (((unsigned long) (item))%((unsigned int) (ph)->cursize)) -#define PHASH_edge(v1, v2) ((v1)^(v2)) - -static PHash *phash_new(PHashLink **list, int sizehint) -{ - PHash *ph = (PHash*)MEM_callocN(sizeof(PHash), "PHash"); - ph->size = 0; - ph->cursize_id = 0; - ph->list = list; - - while (PHashSizes[ph->cursize_id] < sizehint) - ph->cursize_id++; - - ph->cursize = PHashSizes[ph->cursize_id]; - ph->buckets = (PHashLink**)MEM_callocN(ph->cursize*sizeof(*ph->buckets), "PHashBuckets"); - - return ph; -} - -static void phash_delete(PHash *ph) -{ - MEM_freeN(ph->buckets); - MEM_freeN(ph); -} - -static int phash_size(PHash *ph) -{ - return ph->size; -} - -static void phash_insert(PHash *ph, PHashLink *link) -{ - int size = ph->cursize; - int hash = PHASH_hash(ph, link->key); - PHashLink *lookup = ph->buckets[hash]; - - if (lookup == NULL) { - /* insert in front of the list */ - ph->buckets[hash] = link; - link->next = *(ph->list); - *(ph->list) = link; - } - else { - /* insert after existing element */ - link->next = lookup->next; - lookup->next = link; - } - - ph->size++; - - if (ph->size > (size*3)) { - PHashLink *next = NULL, *first = *(ph->list); - - ph->cursize = PHashSizes[++ph->cursize_id]; - MEM_freeN(ph->buckets); - ph->buckets = (PHashLink**)MEM_callocN(ph->cursize*sizeof(*ph->buckets), "PHashBuckets"); - ph->size = 0; - *(ph->list) = NULL; - - for (link = first; link; link = next) { - next = link->next; - phash_insert(ph, link); - } - } -} - -static PHashLink *phash_lookup(PHash *ph, PHashKey key) -{ - PHashLink *link; - int hash = PHASH_hash(ph, key); - - for (link = ph->buckets[hash]; link; link = link->next) - if (link->key == key) - return link; - else if (PHASH_hash(ph, link->key) != hash) - return NULL; - - return link; -} - -static PHashLink *phash_next(PHash *ph, PHashKey key, PHashLink *link) -{ - int hash = PHASH_hash(ph, key); - - for (link = link->next; link; link = link->next) - if (link->key == key) - return link; - else if (PHASH_hash(ph, link->key) != hash) - return NULL; - - return link; -} - -/* Geometry */ - -static float p_vec_angle_cos(float *v1, float *v2, float *v3) -{ - float d1[3], d2[3]; - - d1[0] = v1[0] - v2[0]; - d1[1] = v1[1] - v2[1]; - d1[2] = v1[2] - v2[2]; - - d2[0] = v3[0] - v2[0]; - d2[1] = v3[1] - v2[1]; - d2[2] = v3[2] - v2[2]; - - Normalize(d1); - Normalize(d2); - - return d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2]; -} - -static float p_vec_angle(float *v1, float *v2, float *v3) -{ - float dot = p_vec_angle_cos(v1, v2, v3); - - if (dot <= -1.0f) - return (float)M_PI; - else if (dot >= 1.0f) - return 0.0f; - else - return (float)acos(dot); -} - -static float p_vec2_angle(float *v1, float *v2, float *v3) -{ - float u1[3], u2[3], u3[3]; - - u1[0] = v1[0]; u1[1] = v1[1]; u1[2] = 0.0f; - u2[0] = v2[0]; u2[1] = v2[1]; u2[2] = 0.0f; - u3[0] = v3[0]; u3[1] = v3[1]; u3[2] = 0.0f; - - return p_vec_angle(u1, u2, u3); -} - -static void p_triangle_angles(float *v1, float *v2, float *v3, float *a1, float *a2, float *a3) -{ - *a1 = p_vec_angle(v3, v1, v2); - *a2 = p_vec_angle(v1, v2, v3); - *a3 = M_PI - *a2 - *a1; -} - -static void p_face_angles(PFace *f, float *a1, float *a2, float *a3) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - p_triangle_angles(v1->co, v2->co, v3->co, a1, a2, a3); -} - -static float p_face_area(PFace *f) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - return AreaT3Dfl(v1->co, v2->co, v3->co); -} - -static float p_area_signed(float *v1, float *v2, float *v3) -{ - return 0.5f*(((v2[0] - v1[0])*(v3[1] - v1[1])) - - ((v3[0] - v1[0])*(v2[1] - v1[1]))); -} - -static float p_face_uv_area_signed(PFace *f) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - return 0.5f*(((v2->uv[0] - v1->uv[0])*(v3->uv[1] - v1->uv[1])) - - ((v3->uv[0] - v1->uv[0])*(v2->uv[1] - v1->uv[1]))); -} - -static float p_edge_length(PEdge *e) -{ - PVert *v1 = e->vert, *v2 = e->next->vert; - float d[3]; - - d[0] = v2->co[0] - v1->co[0]; - d[1] = v2->co[1] - v1->co[1]; - d[2] = v2->co[2] - v1->co[2]; - - return sqrt(d[0]*d[0] + d[1]*d[1] + d[2]*d[2]); -} - -static float p_edge_uv_length(PEdge *e) -{ - PVert *v1 = e->vert, *v2 = e->next->vert; - float d[3]; - - d[0] = v2->uv[0] - v1->uv[0]; - d[1] = v2->uv[1] - v1->uv[1]; - - return sqrt(d[0]*d[0] + d[1]*d[1]); -} - -static void p_chart_uv_bbox(PChart *chart, float *minv, float *maxv) -{ - PVert *v; - - INIT_MINMAX2(minv, maxv); - - for (v=chart->verts; v; v=v->nextlink) { - DO_MINMAX2(v->uv, minv, maxv); - } -} - -static void p_chart_uv_scale(PChart *chart, float scale) -{ - PVert *v; - - for (v=chart->verts; v; v=v->nextlink) { - v->uv[0] *= scale; - v->uv[1] *= scale; - } -} - -static void p_chart_uv_translate(PChart *chart, float trans[2]) -{ - PVert *v; - - for (v=chart->verts; v; v=v->nextlink) { - v->uv[0] += trans[0]; - v->uv[1] += trans[1]; - } -} - -static PBool p_intersect_line_2d_dir(float *v1, float *dir1, float *v2, float *dir2, float *isect) -{ - float lmbda, div; - - div= dir2[0]*dir1[1] - dir2[1]*dir1[0]; - - if (div == 0.0f) - return P_FALSE; - - lmbda= ((v1[1]-v2[1])*dir1[0]-(v1[0]-v2[0])*dir1[1])/div; - isect[0] = v1[0] + lmbda*dir2[0]; - isect[1] = v1[1] + lmbda*dir2[1]; - - return P_TRUE; -} - -#if 0 -static PBool p_intersect_line_2d(float *v1, float *v2, float *v3, float *v4, float *isect) -{ - float dir1[2], dir2[2]; - - dir1[0] = v4[0] - v3[0]; - dir1[1] = v4[1] - v3[1]; - - dir2[0] = v2[0] - v1[0]; - dir2[1] = v2[1] - v1[1]; - - if (!p_intersect_line_2d_dir(v1, dir1, v2, dir2, isect)) { - /* parallel - should never happen in theory for polygon kernel, but - let's give a point nearby in case things go wrong */ - isect[0] = (v1[0] + v2[0])*0.5f; - isect[1] = (v1[1] + v2[1])*0.5f; - return P_FALSE; - } - - return P_TRUE; -} -#endif - -/* Topological Utilities */ - -static PEdge *p_wheel_edge_next(PEdge *e) -{ - return e->next->next->pair; -} - -static PEdge *p_wheel_edge_prev(PEdge *e) -{ - return (e->pair)? e->pair->next: NULL; -} - -static PEdge *p_boundary_edge_next(PEdge *e) -{ - return e->next->vert->edge; -} - -static PEdge *p_boundary_edge_prev(PEdge *e) -{ - PEdge *we = e, *last; - - do { - last = we; - we = p_wheel_edge_next(we); - } while (we && (we != e)); - - return last->next->next; -} - -static PBool p_vert_interior(PVert *v) -{ - return (v->edge->pair != NULL); -} - -static void p_face_flip(PFace *f) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - int f1 = e1->flag, f2 = e2->flag, f3 = e3->flag; - - e1->vert = v2; - e1->next = e3; - e1->flag = (f1 & ~PEDGE_VERTEX_FLAGS) | (f2 & PEDGE_VERTEX_FLAGS); - - e2->vert = v3; - e2->next = e1; - e2->flag = (f2 & ~PEDGE_VERTEX_FLAGS) | (f3 & PEDGE_VERTEX_FLAGS); - - e3->vert = v1; - e3->next = e2; - e3->flag = (f3 & ~PEDGE_VERTEX_FLAGS) | (f1 & PEDGE_VERTEX_FLAGS); -} - -#if 0 -static void p_chart_topological_sanity_check(PChart *chart) -{ - PVert *v; - PEdge *e; - - for (v=chart->verts; v; v=v->nextlink) - param_test_equals_ptr("v->edge->vert", v, v->edge->vert); - - for (e=chart->edges; e; e=e->nextlink) { - if (e->pair) { - param_test_equals_ptr("e->pair->pair", e, e->pair->pair); - param_test_equals_ptr("pair->vert", e->vert, e->pair->next->vert); - param_test_equals_ptr("pair->next->vert", e->next->vert, e->pair->vert); - } - } -} -#endif - -/* Loading / Flushing */ - -static void p_vert_load_pin_select_uvs(PVert *v) -{ - PEdge *e; - int nedges = 0, npins = 0; - float pinuv[2]; - - v->uv[0] = v->uv[1] = 0.0f; - pinuv[0] = pinuv[1] = 0.0f; - e = v->edge; - do { - if (e->orig_uv) { - if (e->flag & PEDGE_SELECT) - v->flag |= PVERT_SELECT; - - if (e->flag & PEDGE_PIN) { - pinuv[0] += e->orig_uv[0]; - pinuv[1] += e->orig_uv[1]; - npins++; - } - else { - v->uv[0] += e->orig_uv[0]; - v->uv[1] += e->orig_uv[1]; - } - - nedges++; - } - - e = p_wheel_edge_next(e); - } while (e && e != (v->edge)); - - if (npins > 0) { - v->uv[0] = pinuv[0]/npins; - v->uv[1] = pinuv[1]/npins; - v->flag |= PVERT_PIN; - } - else if (nedges > 0) { - v->uv[0] /= nedges; - v->uv[1] /= nedges; - } -} - -static void p_flush_uvs(PChart *chart) -{ - PEdge *e; - - for (e=chart->edges; e; e=e->nextlink) { - if (e->orig_uv) { - e->orig_uv[0] = e->vert->uv[0]; - e->orig_uv[1] = e->vert->uv[1]; - } - } -} - -static void p_flush_uvs_blend(PChart *chart, float blend) -{ - PEdge *e; - float invblend = 1.0f - blend; - - for (e=chart->edges; e; e=e->nextlink) { - if (e->orig_uv) { - e->orig_uv[0] = blend*e->old_uv[0] + invblend*e->vert->uv[0]; - e->orig_uv[1] = blend*e->old_uv[1] + invblend*e->vert->uv[1]; - } - } -} - -static void p_face_backup_uvs(PFace *f) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - - if (e1->orig_uv && e2->orig_uv && e3->orig_uv) { - e1->old_uv[0] = e1->orig_uv[0]; - e1->old_uv[1] = e1->orig_uv[1]; - e2->old_uv[0] = e2->orig_uv[0]; - e2->old_uv[1] = e2->orig_uv[1]; - e3->old_uv[0] = e3->orig_uv[0]; - e3->old_uv[1] = e3->orig_uv[1]; - } -} - -static void p_face_restore_uvs(PFace *f) -{ - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - - if (e1->orig_uv && e2->orig_uv && e3->orig_uv) { - e1->orig_uv[0] = e1->old_uv[0]; - e1->orig_uv[1] = e1->old_uv[1]; - e2->orig_uv[0] = e2->old_uv[0]; - e2->orig_uv[1] = e2->old_uv[1]; - e3->orig_uv[0] = e3->old_uv[0]; - e3->orig_uv[1] = e3->old_uv[1]; - } -} - -/* Construction (use only during construction, relies on u.key being set */ - -static PVert *p_vert_add(PHandle *handle, PHashKey key, float *co, PEdge *e) -{ - PVert *v = (PVert*)BLI_memarena_alloc(handle->arena, sizeof *v); - v->co = co; - v->u.key = key; - v->edge = e; - v->flag = 0; - - phash_insert(handle->hash_verts, (PHashLink*)v); - - return v; -} - -static PVert *p_vert_lookup(PHandle *handle, PHashKey key, float *co, PEdge *e) -{ - PVert *v = (PVert*)phash_lookup(handle->hash_verts, key); - - if (v) - return v; - else - return p_vert_add(handle, key, co, e); -} - -static PVert *p_vert_copy(PChart *chart, PVert *v) -{ - PVert *nv = (PVert*)BLI_memarena_alloc(chart->handle->arena, sizeof *nv); - - nv->co = v->co; - nv->uv[0] = v->uv[0]; - nv->uv[1] = v->uv[1]; - nv->u.key = v->u.key; - nv->edge = v->edge; - nv->flag = v->flag; - - return nv; -} - -static PEdge *p_edge_lookup(PHandle *handle, PHashKey *vkeys) -{ - PHashKey key = PHASH_edge(vkeys[0], vkeys[1]); - PEdge *e = (PEdge*)phash_lookup(handle->hash_edges, key); - - while (e) { - if ((e->vert->u.key == vkeys[0]) && (e->next->vert->u.key == vkeys[1])) - return e; - else if ((e->vert->u.key == vkeys[1]) && (e->next->vert->u.key == vkeys[0])) - return e; - - e = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)e); - } - - return NULL; -} - -static PBool p_face_exists(PHandle *handle, PHashKey *vkeys, int i1, int i2, int i3) -{ - PHashKey key = PHASH_edge(vkeys[i1], vkeys[i2]); - PEdge *e = (PEdge*)phash_lookup(handle->hash_edges, key); - - while (e) { - if ((e->vert->u.key == vkeys[i1]) && (e->next->vert->u.key == vkeys[i2])) { - if (e->next->next->vert->u.key == vkeys[i3]) - return P_TRUE; - } - else if ((e->vert->u.key == vkeys[i2]) && (e->next->vert->u.key == vkeys[i1])) { - if (e->next->next->vert->u.key == vkeys[i3]) - return P_TRUE; - } - - e = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)e); - } - - return P_FALSE; -} - -static PChart *p_chart_new(PHandle *handle) -{ - PChart *chart = (PChart*)MEM_callocN(sizeof*chart, "PChart"); - chart->handle = handle; - - return chart; -} - -static void p_chart_delete(PChart *chart) -{ - /* the actual links are free by memarena */ - MEM_freeN(chart); -} - -static PBool p_edge_implicit_seam(PEdge *e, PEdge *ep) -{ - float *uv1, *uv2, *uvp1, *uvp2; - float limit[2]; - - limit[0] = 0.00001; - limit[1] = 0.00001; - - uv1 = e->orig_uv; - uv2 = e->next->orig_uv; - - if (e->vert->u.key == ep->vert->u.key) { - uvp1 = ep->orig_uv; - uvp2 = ep->next->orig_uv; - } - else { - uvp1 = ep->next->orig_uv; - uvp2 = ep->orig_uv; - } - - if((fabs(uv1[0]-uvp1[0]) > limit[0]) || (fabs(uv1[1]-uvp1[1]) > limit[1])) { - e->flag |= PEDGE_SEAM; - ep->flag |= PEDGE_SEAM; - return P_TRUE; - } - if((fabs(uv2[0]-uvp2[0]) > limit[0]) || (fabs(uv2[1]-uvp2[1]) > limit[1])) { - e->flag |= PEDGE_SEAM; - ep->flag |= PEDGE_SEAM; - return P_TRUE; - } - - return P_FALSE; -} - -static PBool p_edge_has_pair(PHandle *handle, PEdge *e, PEdge **pair, PBool impl) -{ - PHashKey key; - PEdge *pe; - PVert *v1, *v2; - PHashKey key1 = e->vert->u.key; - PHashKey key2 = e->next->vert->u.key; - - if (e->flag & PEDGE_SEAM) - return P_FALSE; - - key = PHASH_edge(key1, key2); - pe = (PEdge*)phash_lookup(handle->hash_edges, key); - *pair = NULL; - - while (pe) { - if (pe != e) { - v1 = pe->vert; - v2 = pe->next->vert; - - if (((v1->u.key == key1) && (v2->u.key == key2)) || - ((v1->u.key == key2) && (v2->u.key == key1))) { - - /* don't connect seams and t-junctions */ - if ((pe->flag & PEDGE_SEAM) || *pair || - (impl && p_edge_implicit_seam(e, pe))) { - *pair = NULL; - return P_FALSE; - } - - *pair = pe; - } - } - - pe = (PEdge*)phash_next(handle->hash_edges, key, (PHashLink*)pe); - } - - if (*pair && (e->vert == (*pair)->vert)) { - if ((*pair)->next->pair || (*pair)->next->next->pair) { - /* non unfoldable, maybe mobius ring or klein bottle */ - *pair = NULL; - return P_FALSE; - } - } - - return (*pair != NULL); -} - -static PBool p_edge_connect_pair(PHandle *handle, PEdge *e, PEdge ***stack, PBool impl) -{ - PEdge *pair = NULL; - - if(!e->pair && p_edge_has_pair(handle, e, &pair, impl)) { - if (e->vert == pair->vert) - p_face_flip(pair->face); - - e->pair = pair; - pair->pair = e; - - if (!(pair->face->flag & PFACE_CONNECTED)) { - **stack = pair; - (*stack)++; - } - } - - return (e->pair != NULL); -} - -static int p_connect_pairs(PHandle *handle, PBool impl) -{ - PEdge **stackbase = MEM_mallocN(sizeof*stackbase*phash_size(handle->hash_faces), "Pstackbase"); - PEdge **stack = stackbase; - PFace *f, *first; - PEdge *e, *e1, *e2; - PChart *chart = handle->construction_chart; - int ncharts = 0; - - /* connect pairs, count edges, set vertex-edge pointer to a pairless edge */ - for (first=chart->faces; first; first=first->nextlink) { - if (first->flag & PFACE_CONNECTED) - continue; - - *stack = first->edge; - stack++; - - while (stack != stackbase) { - stack--; - e = *stack; - e1 = e->next; - e2 = e1->next; - - f = e->face; - f->flag |= PFACE_CONNECTED; - - /* assign verts to charts so we can sort them later */ - f->u.chart = ncharts; - - if (!p_edge_connect_pair(handle, e, &stack, impl)) - e->vert->edge = e; - if (!p_edge_connect_pair(handle, e1, &stack, impl)) - e1->vert->edge = e1; - if (!p_edge_connect_pair(handle, e2, &stack, impl)) - e2->vert->edge = e2; - } - - ncharts++; - } - - MEM_freeN(stackbase); - - return ncharts; -} - -static void p_split_vert(PChart *chart, PEdge *e) -{ - PEdge *we, *lastwe = NULL; - PVert *v = e->vert; - PBool copy = P_TRUE; - - if (e->flag & PEDGE_VERTEX_SPLIT) - return; - - /* rewind to start */ - lastwe = e; - for (we = p_wheel_edge_prev(e); we && (we != e); we = p_wheel_edge_prev(we)) - lastwe = we; - - /* go over all edges in wheel */ - for (we = lastwe; we; we = p_wheel_edge_next(we)) { - if (we->flag & PEDGE_VERTEX_SPLIT) - break; - - we->flag |= PEDGE_VERTEX_SPLIT; - - if (we == v->edge) { - /* found it, no need to copy */ - copy = P_FALSE; - v->nextlink = chart->verts; - chart->verts = v; - chart->nverts++; - } - } - - if (copy) { - /* not found, copying */ - v->flag |= PVERT_SPLIT; - v = p_vert_copy(chart, v); - v->flag |= PVERT_SPLIT; - - v->nextlink = chart->verts; - chart->verts = v; - chart->nverts++; - - v->edge = lastwe; - - we = lastwe; - do { - we->vert = v; - we = p_wheel_edge_next(we); - } while (we && (we != lastwe)); - } -} - -static PChart **p_split_charts(PHandle *handle, PChart *chart, int ncharts) -{ - PChart **charts = MEM_mallocN(sizeof*charts * ncharts, "PCharts"), *nchart; - PFace *f, *nextf; - int i; - - for (i = 0; i < ncharts; i++) - charts[i] = p_chart_new(handle); - - f = chart->faces; - while (f) { - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - nextf = f->nextlink; - - nchart = charts[f->u.chart]; - - f->nextlink = nchart->faces; - nchart->faces = f; - e1->nextlink = nchart->edges; - nchart->edges = e1; - e2->nextlink = nchart->edges; - nchart->edges = e2; - e3->nextlink = nchart->edges; - nchart->edges = e3; - - nchart->nfaces++; - nchart->nedges += 3; - - p_split_vert(nchart, e1); - p_split_vert(nchart, e2); - p_split_vert(nchart, e3); - - f = nextf; - } - - return charts; -} - -static PFace *p_face_add(PHandle *handle) -{ - PFace *f; - PEdge *e1, *e2, *e3; - - /* allocate */ - f = (PFace*)BLI_memarena_alloc(handle->arena, sizeof *f); - f->flag=0; // init ! - - e1 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e1); - e2 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e2); - e3 = (PEdge*)BLI_memarena_alloc(handle->arena, sizeof *e3); - - /* set up edges */ - f->edge = e1; - e1->face = e2->face = e3->face = f; - - e1->next = e2; - e2->next = e3; - e3->next = e1; - - e1->pair = NULL; - e2->pair = NULL; - e3->pair = NULL; - - e1->flag =0; - e2->flag =0; - e3->flag =0; - - return f; -} - -static PFace *p_face_add_construct(PHandle *handle, ParamKey key, ParamKey *vkeys, - float *co[3], float *uv[3], int i1, int i2, int i3, - ParamBool *pin, ParamBool *select) -{ - PFace *f = p_face_add(handle); - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - - e1->vert = p_vert_lookup(handle, vkeys[i1], co[i1], e1); - e2->vert = p_vert_lookup(handle, vkeys[i2], co[i2], e2); - e3->vert = p_vert_lookup(handle, vkeys[i3], co[i3], e3); - - e1->orig_uv = uv[i1]; - e2->orig_uv = uv[i2]; - e3->orig_uv = uv[i3]; - - if (pin) { - if (pin[i1]) e1->flag |= PEDGE_PIN; - if (pin[i2]) e2->flag |= PEDGE_PIN; - if (pin[i3]) e3->flag |= PEDGE_PIN; - } - - if (select) { - if (select[i1]) e1->flag |= PEDGE_SELECT; - if (select[i2]) e2->flag |= PEDGE_SELECT; - if (select[i3]) e3->flag |= PEDGE_SELECT; - } - - /* insert into hash */ - f->u.key = key; - phash_insert(handle->hash_faces, (PHashLink*)f); - - e1->u.key = PHASH_edge(vkeys[i1], vkeys[i2]); - e2->u.key = PHASH_edge(vkeys[i2], vkeys[i3]); - e3->u.key = PHASH_edge(vkeys[i3], vkeys[i1]); - - phash_insert(handle->hash_edges, (PHashLink*)e1); - phash_insert(handle->hash_edges, (PHashLink*)e2); - phash_insert(handle->hash_edges, (PHashLink*)e3); - - return f; -} - -static PFace *p_face_add_fill(PChart *chart, PVert *v1, PVert *v2, PVert *v3) -{ - PFace *f = p_face_add(chart->handle); - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - - e1->vert = v1; - e2->vert = v2; - e3->vert = v3; - - e1->orig_uv = e2->orig_uv = e3->orig_uv = NULL; - - f->nextlink = chart->faces; - chart->faces = f; - e1->nextlink = chart->edges; - chart->edges = e1; - e2->nextlink = chart->edges; - chart->edges = e2; - e3->nextlink = chart->edges; - chart->edges = e3; - - chart->nfaces++; - chart->nedges += 3; - - return f; -} - -static PBool p_quad_split_direction(PHandle *handle, float **co, PHashKey *vkeys) -{ - float fac= VecLenf(co[0], co[2]) - VecLenf(co[1], co[3]); - PBool dir = (fac <= 0.0f); - - /* the face exists check is there because of a special case: when - two quads share three vertices, they can each be split into two - triangles, resulting in two identical triangles. for example in - suzanne's nose. */ - if (dir) { - if (p_face_exists(handle,vkeys,0,1,2) || p_face_exists(handle,vkeys,0,2,3)) - return !dir; - } - else { - if (p_face_exists(handle,vkeys,0,1,3) || p_face_exists(handle,vkeys,1,2,3)) - return !dir; - } - - return dir; -} - -/* Construction: boundary filling */ - -static void p_chart_boundaries(PChart *chart, int *nboundaries, PEdge **outer) -{ - PEdge *e, *be; - float len, maxlen = -1.0; - - if (nboundaries) - *nboundaries = 0; - if (outer) - *outer = NULL; - - for (e=chart->edges; e; e=e->nextlink) { - if (e->pair || (e->flag & PEDGE_DONE)) - continue; - - if (nboundaries) - (*nboundaries)++; - - len = 0.0f; - - be = e; - do { - be->flag |= PEDGE_DONE; - len += p_edge_length(be); - be = be->next->vert->edge; - } while(be != e); - - if (outer && (len > maxlen)) { - *outer = e; - maxlen = len; - } - } - - for (e=chart->edges; e; e=e->nextlink) - e->flag &= ~PEDGE_DONE; -} - -static float p_edge_boundary_angle(PEdge *e) -{ - PEdge *we; - PVert *v, *v1, *v2; - float angle; - int n = 0; - - v = e->vert; - - /* concave angle check -- could be better */ - angle = M_PI; - - we = v->edge; - do { - v1 = we->next->vert; - v2 = we->next->next->vert; - angle -= p_vec_angle(v1->co, v->co, v2->co); - - we = we->next->next->pair; - n++; - } while (we && (we != v->edge)); - - return angle; -} - -static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges) -{ - PEdge *e, *e1, *e2; - PHashKey vkeys[3]; - PFace *f; - struct Heap *heap = BLI_heap_new(); - float angle; - - e = be; - do { - angle = p_edge_boundary_angle(e); - e->u.heaplink = BLI_heap_insert(heap, angle, e); - - e = p_boundary_edge_next(e); - } while(e != be); - - if (nedges == 2) { - /* no real boundary, but an isolated seam */ - e = be->next->vert->edge; - e->pair = be; - be->pair = e; - - BLI_heap_remove(heap, e->u.heaplink); - BLI_heap_remove(heap, be->u.heaplink); - } - else { - while (nedges > 2) { - PEdge *ne, *ne1, *ne2; - - e = (PEdge*)BLI_heap_popmin(heap); - - e1 = p_boundary_edge_prev(e); - e2 = p_boundary_edge_next(e); - - BLI_heap_remove(heap, e1->u.heaplink); - BLI_heap_remove(heap, e2->u.heaplink); - e->u.heaplink = e1->u.heaplink = e2->u.heaplink = NULL; - - e->flag |= PEDGE_FILLED; - e1->flag |= PEDGE_FILLED; - - vkeys[0] = e->vert->u.key; - vkeys[1] = e1->vert->u.key; - vkeys[2] = e2->vert->u.key; - - f = p_face_add_fill(chart, e->vert, e1->vert, e2->vert); - f->flag |= PFACE_FILLED; - - ne = f->edge->next->next; - ne1 = f->edge; - ne2 = f->edge->next; - - ne->flag = ne1->flag = ne2->flag = PEDGE_FILLED; - - e->pair = ne; - ne->pair = e; - e1->pair = ne1; - ne1->pair = e1; - - ne->vert = e2->vert; - ne1->vert = e->vert; - ne2->vert = e1->vert; - - if (nedges == 3) { - e2->pair = ne2; - ne2->pair = e2; - } - else { - ne2->vert->edge = ne2; - - ne2->u.heaplink = BLI_heap_insert(heap, p_edge_boundary_angle(ne2), ne2); - e2->u.heaplink = BLI_heap_insert(heap, p_edge_boundary_angle(e2), e2); - } - - nedges--; - } - } - - BLI_heap_free(heap, NULL); -} - -static void p_chart_fill_boundaries(PChart *chart, PEdge *outer) -{ - PEdge *e, *enext, *be; - int nedges; - - for (e=chart->edges; e; e=e->nextlink) { - enext = e->nextlink; - - if (e->pair || (e->flag & PEDGE_FILLED)) - continue; - - nedges = 0; - be = e; - do { - be->flag |= PEDGE_FILLED; - be = be->next->vert->edge; - nedges++; - } while(be != e); - - if (e != outer) - p_chart_fill_boundary(chart, e, nedges); - } -} - -#if 0 -/* Polygon kernel for inserting uv's non overlapping */ - -static int p_polygon_point_in(float *cp1, float *cp2, float *p) -{ - if ((cp1[0] == p[0]) && (cp1[1] == p[1])) - return 2; - else if ((cp2[0] == p[0]) && (cp2[1] == p[1])) - return 3; - else - return (p_area_signed(cp1, cp2, p) >= 0.0f); -} - -static void p_polygon_kernel_clip(float (*oldpoints)[2], int noldpoints, float (*newpoints)[2], int *nnewpoints, float *cp1, float *cp2) -{ - float *p2, *p1, isect[2]; - int i, p2in, p1in; - - p1 = oldpoints[noldpoints-1]; - p1in = p_polygon_point_in(cp1, cp2, p1); - *nnewpoints = 0; - - for (i = 0; i < noldpoints; i++) { - p2 = oldpoints[i]; - p2in = p_polygon_point_in(cp1, cp2, p2); - - if ((p2in >= 2) || (p1in && p2in)) { - newpoints[*nnewpoints][0] = p2[0]; - newpoints[*nnewpoints][1] = p2[1]; - (*nnewpoints)++; - } - else if (p1in && !p2in) { - if (p1in != 3) { - p_intersect_line_2d(p1, p2, cp1, cp2, isect); - newpoints[*nnewpoints][0] = isect[0]; - newpoints[*nnewpoints][1] = isect[1]; - (*nnewpoints)++; - } - } - else if (!p1in && p2in) { - p_intersect_line_2d(p1, p2, cp1, cp2, isect); - newpoints[*nnewpoints][0] = isect[0]; - newpoints[*nnewpoints][1] = isect[1]; - (*nnewpoints)++; - - newpoints[*nnewpoints][0] = p2[0]; - newpoints[*nnewpoints][1] = p2[1]; - (*nnewpoints)++; - } - - p1in = p2in; - p1 = p2; - } -} - -static void p_polygon_kernel_center(float (*points)[2], int npoints, float *center) -{ - int i, size, nnewpoints = npoints; - float (*oldpoints)[2], (*newpoints)[2], *p1, *p2; - - size = npoints*3; - oldpoints = MEM_mallocN(sizeof(float)*2*size, "PPolygonOldPoints"); - newpoints = MEM_mallocN(sizeof(float)*2*size, "PPolygonNewPoints"); - - memcpy(oldpoints, points, sizeof(float)*2*npoints); - - for (i = 0; i < npoints; i++) { - p1 = points[i]; - p2 = points[(i+1)%npoints]; - p_polygon_kernel_clip(oldpoints, nnewpoints, newpoints, &nnewpoints, p1, p2); - - if (nnewpoints == 0) { - /* degenerate case, use center of original polygon */ - memcpy(oldpoints, points, sizeof(float)*2*npoints); - nnewpoints = npoints; - break; - } - else if (nnewpoints == 1) { - /* degenerate case, use remaining point */ - center[0] = newpoints[0][0]; - center[1] = newpoints[0][1]; - - MEM_freeN(oldpoints); - MEM_freeN(newpoints); - - return; - } - - if (nnewpoints*2 > size) { - size *= 2; - free(oldpoints); - oldpoints = malloc(sizeof(float)*2*size); - memcpy(oldpoints, newpoints, sizeof(float)*2*nnewpoints); - free(newpoints); - newpoints = malloc(sizeof(float)*2*size); - } - else { - float (*sw_points)[2] = oldpoints; - oldpoints = newpoints; - newpoints = sw_points; - } - } - - center[0] = center[1] = 0.0f; - - for (i = 0; i < nnewpoints; i++) { - center[0] += oldpoints[i][0]; - center[1] += oldpoints[i][1]; - } - - center[0] /= nnewpoints; - center[1] /= nnewpoints; - - MEM_freeN(oldpoints); - MEM_freeN(newpoints); -} -#endif - -#if 0 -/* Edge Collapser */ - -int NCOLLAPSE = 1; -int NCOLLAPSEX = 0; - -static float p_vert_cotan(float *v1, float *v2, float *v3) -{ - float a[3], b[3], c[3], clen; - - VecSubf(a, v2, v1); - VecSubf(b, v3, v1); - Crossf(c, a, b); - - clen = VecLength(c); - - if (clen == 0.0f) - return 0.0f; - - return Inpf(a, b)/clen; -} - -static PBool p_vert_flipped_wheel_triangle(PVert *v) -{ - PEdge *e = v->edge; - - do { - if (p_face_uv_area_signed(e->face) < 0.0f) - return P_TRUE; - - e = p_wheel_edge_next(e); - } while (e && (e != v->edge)); - - return P_FALSE; -} - -static PBool p_vert_map_harmonic_weights(PVert *v) -{ - float weightsum, positionsum[2], olduv[2]; - - weightsum = 0.0f; - positionsum[0] = positionsum[1] = 0.0f; - - if (p_vert_interior(v)) { - PEdge *e = v->edge; - - do { - float t1, t2, weight; - PVert *v1, *v2; - - v1 = e->next->vert; - v2 = e->next->next->vert; - t1 = p_vert_cotan(v2->co, e->vert->co, v1->co); - - v1 = e->pair->next->vert; - v2 = e->pair->next->next->vert; - t2 = p_vert_cotan(v2->co, e->pair->vert->co, v1->co); - - weight = 0.5f*(t1 + t2); - weightsum += weight; - positionsum[0] += weight*e->pair->vert->uv[0]; - positionsum[1] += weight*e->pair->vert->uv[1]; - - e = p_wheel_edge_next(e); - } while (e && (e != v->edge)); - } - else { - PEdge *e = v->edge; - - do { - float t1, t2; - PVert *v1, *v2; - - v2 = e->next->vert; - v1 = e->next->next->vert; - - t1 = p_vert_cotan(v1->co, v->co, v2->co); - t2 = p_vert_cotan(v2->co, v->co, v1->co); - - weightsum += t1 + t2; - positionsum[0] += (v2->uv[1] - v1->uv[1]) + (t1*v2->uv[0] + t2*v1->uv[0]); - positionsum[1] += (v1->uv[0] - v2->uv[0]) + (t1*v2->uv[1] + t2*v1->uv[1]); - - e = p_wheel_edge_next(e); - } while (e && (e != v->edge)); - } - - if (weightsum != 0.0f) { - weightsum = 1.0f/weightsum; - positionsum[0] *= weightsum; - positionsum[1] *= weightsum; - } - - olduv[0] = v->uv[0]; - olduv[1] = v->uv[1]; - v->uv[0] = positionsum[0]; - v->uv[1] = positionsum[1]; - - if (p_vert_flipped_wheel_triangle(v)) { - v->uv[0] = olduv[0]; - v->uv[1] = olduv[1]; - - return P_FALSE; - } - - return P_TRUE; -} - -static void p_vert_harmonic_insert(PVert *v) -{ - PEdge *e; - - if (!p_vert_map_harmonic_weights(v)) { - /* do polygon kernel center insertion: this is quite slow, but should - only be needed for 0.01 % of verts or so, when insert with harmonic - weights fails */ - - int npoints = 0, i; - float (*points)[2]; - - e = v->edge; - do { - npoints++; - e = p_wheel_edge_next(e); - } while (e && (e != v->edge)); - - if (e == NULL) - npoints++; - - points = MEM_mallocN(sizeof(float)*2*npoints, "PHarmonicPoints"); - - e = v->edge; - i = 0; - do { - PEdge *nexte = p_wheel_edge_next(e); - - points[i][0] = e->next->vert->uv[0]; - points[i][1] = e->next->vert->uv[1]; - - if (nexte == NULL) { - i++; - points[i][0] = e->next->next->vert->uv[0]; - points[i][1] = e->next->next->vert->uv[1]; - break; - } - - e = nexte; - i++; - } while (e != v->edge); - - p_polygon_kernel_center(points, npoints, v->uv); - - MEM_freeN(points); - } - - e = v->edge; - do { - if (!(e->next->vert->flag & PVERT_PIN)) - p_vert_map_harmonic_weights(e->next->vert); - e = p_wheel_edge_next(e); - } while (e && (e != v->edge)); - - p_vert_map_harmonic_weights(v); -} - -static void p_vert_fix_edge_pointer(PVert *v) -{ - PEdge *start = v->edge; - - /* set v->edge pointer to the edge with no pair, if there is one */ - while (v->edge->pair) { - v->edge = p_wheel_edge_prev(v->edge); - - if (v->edge == start) - break; - } -} - -static void p_collapsing_verts(PEdge *edge, PEdge *pair, PVert **newv, PVert **keepv) -{ - /* the two vertices that are involved in the collapse */ - if (edge) { - *newv = edge->vert; - *keepv = edge->next->vert; - } - else { - *newv = pair->next->vert; - *keepv = pair->vert; - } -} - -static void p_collapse_edge(PEdge *edge, PEdge *pair) -{ - PVert *oldv, *keepv; - PEdge *e; - - p_collapsing_verts(edge, pair, &oldv, &keepv); - - /* change e->vert pointers from old vertex to the target vertex */ - e = oldv->edge; - do { - if ((e != edge) && !(pair && pair->next == e)) - e->vert = keepv; - - e = p_wheel_edge_next(e); - } while (e && (e != oldv->edge)); - - /* set keepv->edge pointer */ - if ((edge && (keepv->edge == edge->next)) || (keepv->edge == pair)) { - if (edge && edge->next->pair) - keepv->edge = edge->next->pair->next; - else if (pair && pair->next->next->pair) - keepv->edge = pair->next->next->pair; - else if (edge && edge->next->next->pair) - keepv->edge = edge->next->next->pair; - else - keepv->edge = pair->next->pair->next; - } - - /* update pairs and v->edge pointers */ - if (edge) { - PEdge *e1 = edge->next, *e2 = e1->next; - - if (e1->pair) - e1->pair->pair = e2->pair; - - if (e2->pair) { - e2->pair->pair = e1->pair; - e2->vert->edge = p_wheel_edge_prev(e2); - } - else - e2->vert->edge = p_wheel_edge_next(e2); - - p_vert_fix_edge_pointer(e2->vert); - } - - if (pair) { - PEdge *e1 = pair->next, *e2 = e1->next; - - if (e1->pair) - e1->pair->pair = e2->pair; - - if (e2->pair) { - e2->pair->pair = e1->pair; - e2->vert->edge = p_wheel_edge_prev(e2); - } - else - e2->vert->edge = p_wheel_edge_next(e2); - - p_vert_fix_edge_pointer(e2->vert); - } - - p_vert_fix_edge_pointer(keepv); - - /* mark for move to collapsed list later */ - oldv->flag |= PVERT_COLLAPSE; - - if (edge) { - PFace *f = edge->face; - PEdge *e1 = edge->next, *e2 = e1->next; - - f->flag |= PFACE_COLLAPSE; - edge->flag |= PEDGE_COLLAPSE; - e1->flag |= PEDGE_COLLAPSE; - e2->flag |= PEDGE_COLLAPSE; - } - - if (pair) { - PFace *f = pair->face; - PEdge *e1 = pair->next, *e2 = e1->next; - - f->flag |= PFACE_COLLAPSE; - pair->flag |= PEDGE_COLLAPSE; - e1->flag |= PEDGE_COLLAPSE; - e2->flag |= PEDGE_COLLAPSE; - } -} - -static void p_split_vertex(PEdge *edge, PEdge *pair) -{ - PVert *newv, *keepv; - PEdge *e; - - p_collapsing_verts(edge, pair, &newv, &keepv); - - /* update edge pairs */ - if (edge) { - PEdge *e1 = edge->next, *e2 = e1->next; - - if (e1->pair) - e1->pair->pair = e1; - if (e2->pair) - e2->pair->pair = e2; - - e2->vert->edge = e2; - p_vert_fix_edge_pointer(e2->vert); - keepv->edge = e1; - } - - if (pair) { - PEdge *e1 = pair->next, *e2 = e1->next; - - if (e1->pair) - e1->pair->pair = e1; - if (e2->pair) - e2->pair->pair = e2; - - e2->vert->edge = e2; - p_vert_fix_edge_pointer(e2->vert); - keepv->edge = pair; - } - - p_vert_fix_edge_pointer(keepv); - - /* set e->vert pointers to restored vertex */ - e = newv->edge; - do { - e->vert = newv; - e = p_wheel_edge_next(e); - } while (e && (e != newv->edge)); -} - -static PBool p_collapse_allowed_topologic(PEdge *edge, PEdge *pair) -{ - PVert *oldv, *keepv; - - p_collapsing_verts(edge, pair, &oldv, &keepv); - - /* boundary edges */ - if (!edge || !pair) { - /* avoid collapsing chart into an edge */ - if (edge && !edge->next->pair && !edge->next->next->pair) - return P_FALSE; - else if (pair && !pair->next->pair && !pair->next->next->pair) - return P_FALSE; - } - /* avoid merging two boundaries (oldv and keepv are on the 'other side' of - the chart) */ - else if (!p_vert_interior(oldv) && !p_vert_interior(keepv)) - return P_FALSE; - - return P_TRUE; -} - -static PBool p_collapse_normal_flipped(float *v1, float *v2, float *vold, float *vnew) -{ - float nold[3], nnew[3], sub1[3], sub2[3]; - - VecSubf(sub1, vold, v1); - VecSubf(sub2, vold, v2); - Crossf(nold, sub1, sub2); - - VecSubf(sub1, vnew, v1); - VecSubf(sub2, vnew, v2); - Crossf(nnew, sub1, sub2); - - return (Inpf(nold, nnew) <= 0.0f); -} - -static PBool p_collapse_allowed_geometric(PEdge *edge, PEdge *pair) -{ - PVert *oldv, *keepv; - PEdge *e; - float angulardefect, angle; - - p_collapsing_verts(edge, pair, &oldv, &keepv); - - angulardefect = 2*M_PI; - - e = oldv->edge; - do { - float a[3], b[3], minangle, maxangle; - PEdge *e1 = e->next, *e2 = e1->next; - PVert *v1 = e1->vert, *v2 = e2->vert; - int i; - - angle = p_vec_angle(v1->co, oldv->co, v2->co); - angulardefect -= angle; - - /* skip collapsing faces */ - if (v1 == keepv || v2 == keepv) { - e = p_wheel_edge_next(e); - continue; - } - - if (p_collapse_normal_flipped(v1->co, v2->co, oldv->co, keepv->co)) - return P_FALSE; - - a[0] = angle; - a[1] = p_vec_angle(v2->co, v1->co, oldv->co); - a[2] = M_PI - a[0] - a[1]; - - b[0] = p_vec_angle(v1->co, keepv->co, v2->co); - b[1] = p_vec_angle(v2->co, v1->co, keepv->co); - b[2] = M_PI - b[0] - b[1]; - - /* abf criterion 1: avoid sharp and obtuse angles */ - minangle = 15.0f*M_PI/180.0f; - maxangle = M_PI - minangle; - - for (i = 0; i < 3; i++) { - if ((b[i] < a[i]) && (b[i] < minangle)) - return P_FALSE; - else if ((b[i] > a[i]) && (b[i] > maxangle)) - return P_FALSE; - } - - e = p_wheel_edge_next(e); - } while (e && (e != oldv->edge)); - - if (p_vert_interior(oldv)) { - /* hlscm criterion: angular defect smaller than threshold */ - if (fabs(angulardefect) > (M_PI*30.0/180.0)) - return P_FALSE; - } - else { - PVert *v1 = p_boundary_edge_next(oldv->edge)->vert; - PVert *v2 = p_boundary_edge_prev(oldv->edge)->vert; - - /* abf++ criterion 2: avoid collapsing verts inwards */ - if (p_vert_interior(keepv)) - return P_FALSE; - - /* don't collapse significant boundary changes */ - angle = p_vec_angle(v1->co, oldv->co, v2->co); - if (angle < (M_PI*160.0/180.0)) - return P_FALSE; - } - - return P_TRUE; -} - -static PBool p_collapse_allowed(PEdge *edge, PEdge *pair) -{ - PVert *oldv, *keepv; - - p_collapsing_verts(edge, pair, &oldv, &keepv); - - if (oldv->flag & PVERT_PIN) - return P_FALSE; - - return (p_collapse_allowed_topologic(edge, pair) && - p_collapse_allowed_geometric(edge, pair)); -} - -static float p_collapse_cost(PEdge *edge, PEdge *pair) -{ - /* based on volume and boundary optimization from: - "Fast and Memory Efficient Polygonal Simplification" P. Lindstrom, G. Turk */ - - PVert *oldv, *keepv; - PEdge *e; - PFace *oldf1, *oldf2; - float volumecost = 0.0f, areacost = 0.0f, edgevec[3], cost, weight, elen; - float shapecost = 0.0f; - float shapeold = 0.0f, shapenew = 0.0f; - int nshapeold = 0, nshapenew = 0; - - p_collapsing_verts(edge, pair, &oldv, &keepv); - oldf1 = (edge)? edge->face: NULL; - oldf2 = (pair)? pair->face: NULL; - - VecSubf(edgevec, keepv->co, oldv->co); - - e = oldv->edge; - do { - float a1, a2, a3; - float *co1 = e->next->vert->co; - float *co2 = e->next->next->vert->co; - - if ((e->face != oldf1) && (e->face != oldf2)) { - float tetrav2[3], tetrav3[3], c[3]; - - /* tetrahedron volume = (1/3!)*|a.(b x c)| */ - VecSubf(tetrav2, co1, oldv->co); - VecSubf(tetrav3, co2, oldv->co); - Crossf(c, tetrav2, tetrav3); - - volumecost += fabs(Inpf(edgevec, c)/6.0f); -#if 0 - shapecost += Inpf(co1, keepv->co); - - if (p_wheel_edge_next(e) == NULL) - shapecost += Inpf(co2, keepv->co); -#endif - - p_triangle_angles(oldv->co, co1, co2, &a1, &a2, &a3); - a1 = a1 - M_PI/3.0; - a2 = a2 - M_PI/3.0; - a3 = a3 - M_PI/3.0; - shapeold = (a1*a1 + a2*a2 + a3*a3)/((M_PI/2)*(M_PI/2)); - - nshapeold++; - } - else { - p_triangle_angles(keepv->co, co1, co2, &a1, &a2, &a3); - a1 = a1 - M_PI/3.0; - a2 = a2 - M_PI/3.0; - a3 = a3 - M_PI/3.0; - shapenew = (a1*a1 + a2*a2 + a3*a3)/((M_PI/2)*(M_PI/2)); - - nshapenew++; - } - - e = p_wheel_edge_next(e); - } while (e && (e != oldv->edge)); - - if (!p_vert_interior(oldv)) { - PVert *v1 = p_boundary_edge_prev(oldv->edge)->vert; - PVert *v2 = p_boundary_edge_next(oldv->edge)->vert; - - areacost = AreaT3Dfl(oldv->co, v1->co, v2->co); - } - - elen = VecLength(edgevec); - weight = 1.0f; /* 0.2f */ - cost = weight*volumecost*volumecost + elen*elen*areacost*areacost; -#if 0 - cost += shapecost; -#else - shapeold /= nshapeold; - shapenew /= nshapenew; - shapecost = (shapeold + 0.00001)/(shapenew + 0.00001); - - cost *= shapecost; -#endif - - return cost; -} - -static void p_collapse_cost_vertex(PVert *vert, float *mincost, PEdge **mine) -{ - PEdge *e, *enext, *pair; - - *mine = NULL; - *mincost = 0.0f; - e = vert->edge; - do { - if (p_collapse_allowed(e, e->pair)) { - float cost = p_collapse_cost(e, e->pair); - - if ((*mine == NULL) || (cost < *mincost)) { - *mincost = cost; - *mine = e; - } - } - - enext = p_wheel_edge_next(e); - - if (enext == NULL) { - /* the other boundary edge, where we only have the pair halfedge */ - pair = e->next->next; - - if (p_collapse_allowed(NULL, pair)) { - float cost = p_collapse_cost(NULL, pair); - - if ((*mine == NULL) || (cost < *mincost)) { - *mincost = cost; - *mine = pair; - } - } - - break; - } - - e = enext; - } while (e != vert->edge); -} - -static void p_chart_post_collapse_flush(PChart *chart, PEdge *collapsed) -{ - /* move to collapsed_ */ - - PVert *v, *nextv = NULL, *verts = chart->verts; - PEdge *e, *nexte = NULL, *edges = chart->edges, *laste = NULL; - PFace *f, *nextf = NULL, *faces = chart->faces; - - chart->verts = chart->collapsed_verts = NULL; - chart->edges = chart->collapsed_edges = NULL; - chart->faces = chart->collapsed_faces = NULL; - - chart->nverts = chart->nedges = chart->nfaces = 0; - - for (v=verts; v; v=nextv) { - nextv = v->nextlink; - - if (v->flag & PVERT_COLLAPSE) { - v->nextlink = chart->collapsed_verts; - chart->collapsed_verts = v; - } - else { - v->nextlink = chart->verts; - chart->verts = v; - chart->nverts++; - } - } - - for (e=edges; e; e=nexte) { - nexte = e->nextlink; - - if (!collapsed || !(e->flag & PEDGE_COLLAPSE_EDGE)) { - if (e->flag & PEDGE_COLLAPSE) { - e->nextlink = chart->collapsed_edges; - chart->collapsed_edges = e; - } - else { - e->nextlink = chart->edges; - chart->edges = e; - chart->nedges++; - } - } - } - - /* these are added last so they can be popped of in the right order - for splitting */ - for (e=collapsed; e; e=e->nextlink) { - e->nextlink = e->u.nextcollapse; - laste = e; - } - if (laste) { - laste->nextlink = chart->collapsed_edges; - chart->collapsed_edges = collapsed; - } - - for (f=faces; f; f=nextf) { - nextf = f->nextlink; - - if (f->flag & PFACE_COLLAPSE) { - f->nextlink = chart->collapsed_faces; - chart->collapsed_faces = f; - } - else { - f->nextlink = chart->faces; - chart->faces = f; - chart->nfaces++; - } - } -} - -static void p_chart_post_split_flush(PChart *chart) -{ - /* move from collapsed_ */ - - PVert *v, *nextv = NULL; - PEdge *e, *nexte = NULL; - PFace *f, *nextf = NULL; - - for (v=chart->collapsed_verts; v; v=nextv) { - nextv = v->nextlink; - v->nextlink = chart->verts; - chart->verts = v; - chart->nverts++; - } - - for (e=chart->collapsed_edges; e; e=nexte) { - nexte = e->nextlink; - e->nextlink = chart->edges; - chart->edges = e; - chart->nedges++; - } - - for (f=chart->collapsed_faces; f; f=nextf) { - nextf = f->nextlink; - f->nextlink = chart->faces; - chart->faces = f; - chart->nfaces++; - } - - chart->collapsed_verts = NULL; - chart->collapsed_edges = NULL; - chart->collapsed_faces = NULL; -} - -static void p_chart_simplify_compute(PChart *chart) -{ - /* Computes a list of edge collapses / vertex splits. The collapsed - simplices go in the chart->collapsed_* lists, The original and - collapsed may then be view as stacks, where the next collapse/split - is at the top of the respective lists. */ - - Heap *heap = BLI_heap_new(); - PVert *v, **wheelverts; - PEdge *collapsededges = NULL, *e; - int nwheelverts, i, ncollapsed = 0; - - wheelverts = MEM_mallocN(sizeof(PVert*)*chart->nverts, "PChartWheelVerts"); - - /* insert all potential collapses into heap */ - for (v=chart->verts; v; v=v->nextlink) { - float cost; - PEdge *e = NULL; - - p_collapse_cost_vertex(v, &cost, &e); - - if (e) - v->u.heaplink = BLI_heap_insert(heap, cost, e); - else - v->u.heaplink = NULL; - } - - for (e=chart->edges; e; e=e->nextlink) - e->u.nextcollapse = NULL; - - /* pop edge collapse out of heap one by one */ - while (!BLI_heap_empty(heap)) { - if (ncollapsed == NCOLLAPSE) - break; - - HeapNode *link = BLI_heap_top(heap); - PEdge *edge = (PEdge*)BLI_heap_popmin(heap), *pair = edge->pair; - PVert *oldv, *keepv; - PEdge *wheele, *nexte; - - /* remember the edges we collapsed */ - edge->u.nextcollapse = collapsededges; - collapsededges = edge; - - if (edge->vert->u.heaplink != link) { - edge->flag |= (PEDGE_COLLAPSE_EDGE|PEDGE_COLLAPSE_PAIR); - edge->next->vert->u.heaplink = NULL; - SWAP(PEdge*, edge, pair); - } - else { - edge->flag |= PEDGE_COLLAPSE_EDGE; - edge->vert->u.heaplink = NULL; - } - - p_collapsing_verts(edge, pair, &oldv, &keepv); - - /* gather all wheel verts and remember them before collapse */ - nwheelverts = 0; - wheele = oldv->edge; - - do { - wheelverts[nwheelverts++] = wheele->next->vert; - nexte = p_wheel_edge_next(wheele); - - if (nexte == NULL) - wheelverts[nwheelverts++] = wheele->next->next->vert; - - wheele = nexte; - } while (wheele && (wheele != oldv->edge)); - - /* collapse */ - p_collapse_edge(edge, pair); - - for (i = 0; i < nwheelverts; i++) { - float cost; - PEdge *collapse = NULL; - - v = wheelverts[i]; - - if (v->u.heaplink) { - BLI_heap_remove(heap, v->u.heaplink); - v->u.heaplink = NULL; - } - - p_collapse_cost_vertex(v, &cost, &collapse); - - if (collapse) - v->u.heaplink = BLI_heap_insert(heap, cost, collapse); - } - - ncollapsed++; - } - - MEM_freeN(wheelverts); - BLI_heap_free(heap, NULL); - - p_chart_post_collapse_flush(chart, collapsededges); -} - -static void p_chart_complexify(PChart *chart) -{ - PEdge *e, *pair, *edge; - PVert *newv, *keepv; - int x = 0; - - for (e=chart->collapsed_edges; e; e=e->nextlink) { - if (!(e->flag & PEDGE_COLLAPSE_EDGE)) - break; - - edge = e; - pair = e->pair; - - if (edge->flag & PEDGE_COLLAPSE_PAIR) { - SWAP(PEdge*, edge, pair); - } - - p_split_vertex(edge, pair); - p_collapsing_verts(edge, pair, &newv, &keepv); - - if (x >= NCOLLAPSEX) { - newv->uv[0] = keepv->uv[0]; - newv->uv[1] = keepv->uv[1]; - } - else { - p_vert_harmonic_insert(newv); - x++; - } - } - - p_chart_post_split_flush(chart); -} - -#if 0 -static void p_chart_simplify(PChart *chart) -{ - /* Not implemented, needs proper reordering in split_flush. */ -} -#endif -#endif - -/* ABF */ - -#define ABF_MAX_ITER 20 - -typedef struct PAbfSystem { - int ninterior, nfaces, nangles; - float *alpha, *beta, *sine, *cosine, *weight; - float *bAlpha, *bTriangle, *bInterior; - float *lambdaTriangle, *lambdaPlanar, *lambdaLength; - float (*J2dt)[3], *bstar, *dstar; - float minangle, maxangle; -} PAbfSystem; - -static void p_abf_setup_system(PAbfSystem *sys) -{ - int i; - - sys->alpha = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFalpha"); - sys->beta = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFbeta"); - sys->sine = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFsine"); - sys->cosine = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFcosine"); - sys->weight = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFweight"); - - sys->bAlpha = (float*)MEM_mallocN(sizeof(float)*sys->nangles, "ABFbalpha"); - sys->bTriangle = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFbtriangle"); - sys->bInterior = (float*)MEM_mallocN(sizeof(float)*2*sys->ninterior, "ABFbinterior"); - - sys->lambdaTriangle = (float*)MEM_callocN(sizeof(float)*sys->nfaces, "ABFlambdatri"); - sys->lambdaPlanar = (float*)MEM_callocN(sizeof(float)*sys->ninterior, "ABFlamdaplane"); - sys->lambdaLength = (float*)MEM_mallocN(sizeof(float)*sys->ninterior, "ABFlambdalen"); - - sys->J2dt = MEM_mallocN(sizeof(float)*sys->nangles*3, "ABFj2dt"); - sys->bstar = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFbstar"); - sys->dstar = (float*)MEM_mallocN(sizeof(float)*sys->nfaces, "ABFdstar"); - - for (i = 0; i < sys->ninterior; i++) - sys->lambdaLength[i] = 1.0; - - sys->minangle = 7.5f*M_PI/180.0f; - sys->maxangle = M_PI - sys->minangle; -} - -static void p_abf_free_system(PAbfSystem *sys) -{ - MEM_freeN(sys->alpha); - MEM_freeN(sys->beta); - MEM_freeN(sys->sine); - MEM_freeN(sys->cosine); - MEM_freeN(sys->weight); - MEM_freeN(sys->bAlpha); - MEM_freeN(sys->bTriangle); - MEM_freeN(sys->bInterior); - MEM_freeN(sys->lambdaTriangle); - MEM_freeN(sys->lambdaPlanar); - MEM_freeN(sys->lambdaLength); - MEM_freeN(sys->J2dt); - MEM_freeN(sys->bstar); - MEM_freeN(sys->dstar); -} - -static void p_abf_compute_sines(PAbfSystem *sys) -{ - int i; - float *sine = sys->sine, *cosine = sys->cosine, *alpha = sys->alpha; - - for (i = 0; i < sys->nangles; i++, sine++, cosine++, alpha++) { - *sine = sin(*alpha); - *cosine = cos(*alpha); - } -} - -static float p_abf_compute_sin_product(PAbfSystem *sys, PVert *v, int aid) -{ - PEdge *e, *e1, *e2; - float sin1, sin2; - - sin1 = sin2 = 1.0; - - e = v->edge; - do { - e1 = e->next; - e2 = e->next->next; - - if (aid == e1->u.id) { - /* we are computing a derivative for this angle, - so we use cos and drop the other part */ - sin1 *= sys->cosine[e1->u.id]; - sin2 = 0.0; - } - else - sin1 *= sys->sine[e1->u.id]; - - if (aid == e2->u.id) { - /* see above */ - sin1 = 0.0; - sin2 *= sys->cosine[e2->u.id]; - } - else - sin2 *= sys->sine[e2->u.id]; - - e = e->next->next->pair; - } while (e && (e != v->edge)); - - return (sin1 - sin2); -} - -static float p_abf_compute_grad_alpha(PAbfSystem *sys, PFace *f, PEdge *e) -{ - PVert *v = e->vert, *v1 = e->next->vert, *v2 = e->next->next->vert; - float deriv; - - deriv = (sys->alpha[e->u.id] - sys->beta[e->u.id])*sys->weight[e->u.id]; - deriv += sys->lambdaTriangle[f->u.id]; - - if (v->flag & PVERT_INTERIOR) { - deriv += sys->lambdaPlanar[v->u.id]; - } - - if (v1->flag & PVERT_INTERIOR) { - float product = p_abf_compute_sin_product(sys, v1, e->u.id); - deriv += sys->lambdaLength[v1->u.id]*product; - } - - if (v2->flag & PVERT_INTERIOR) { - float product = p_abf_compute_sin_product(sys, v2, e->u.id); - deriv += sys->lambdaLength[v2->u.id]*product; - } - - return deriv; -} - -static float p_abf_compute_gradient(PAbfSystem *sys, PChart *chart) -{ - PFace *f; - PEdge *e; - PVert *v; - float norm = 0.0; - - for (f=chart->faces; f; f=f->nextlink) { - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - float gtriangle, galpha1, galpha2, galpha3; - - galpha1 = p_abf_compute_grad_alpha(sys, f, e1); - galpha2 = p_abf_compute_grad_alpha(sys, f, e2); - galpha3 = p_abf_compute_grad_alpha(sys, f, e3); - - sys->bAlpha[e1->u.id] = -galpha1; - sys->bAlpha[e2->u.id] = -galpha2; - sys->bAlpha[e3->u.id] = -galpha3; - - norm += galpha1*galpha1 + galpha2*galpha2 + galpha3*galpha3; - - gtriangle = sys->alpha[e1->u.id] + sys->alpha[e2->u.id] + sys->alpha[e3->u.id] - M_PI; - sys->bTriangle[f->u.id] = -gtriangle; - norm += gtriangle*gtriangle; - } - - for (v=chart->verts; v; v=v->nextlink) { - if (v->flag & PVERT_INTERIOR) { - float gplanar = -2*M_PI, glength; - - e = v->edge; - do { - gplanar += sys->alpha[e->u.id]; - e = e->next->next->pair; - } while (e && (e != v->edge)); - - sys->bInterior[v->u.id] = -gplanar; - norm += gplanar*gplanar; - - glength = p_abf_compute_sin_product(sys, v, -1); - sys->bInterior[sys->ninterior + v->u.id] = -glength; - norm += glength*glength; - } - } - - return norm; -} - -static PBool p_abf_matrix_invert(PAbfSystem *sys, PChart *chart) -{ - PFace *f; - PEdge *e; - int i, j, ninterior = sys->ninterior, nvar = 2*sys->ninterior; - PBool success; - - nlNewContext(); - nlSolverParameteri(NL_NB_VARIABLES, nvar); - - nlBegin(NL_SYSTEM); - - nlBegin(NL_MATRIX); - - for (i = 0; i < nvar; i++) - nlRightHandSideAdd(0, i, sys->bInterior[i]); - - for (f=chart->faces; f; f=f->nextlink) { - float wi1, wi2, wi3, b, si, beta[3], j2[3][3], W[3][3]; - float row1[6], row2[6], row3[6]; - int vid[6]; - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - wi1 = 1.0/sys->weight[e1->u.id]; - wi2 = 1.0/sys->weight[e2->u.id]; - wi3 = 1.0/sys->weight[e3->u.id]; - - /* bstar1 = (J1*dInv*bAlpha - bTriangle) */ - b = sys->bAlpha[e1->u.id]*wi1; - b += sys->bAlpha[e2->u.id]*wi2; - b += sys->bAlpha[e3->u.id]*wi3; - b -= sys->bTriangle[f->u.id]; - - /* si = J1*d*J1t */ - si = 1.0/(wi1 + wi2 + wi3); - - /* J1t*si*bstar1 - bAlpha */ - beta[0] = b*si - sys->bAlpha[e1->u.id]; - beta[1] = b*si - sys->bAlpha[e2->u.id]; - beta[2] = b*si - sys->bAlpha[e3->u.id]; - - /* use this later for computing other lambda's */ - sys->bstar[f->u.id] = b; - sys->dstar[f->u.id] = si; - - /* set matrix */ - W[0][0] = si - sys->weight[e1->u.id]; W[0][1] = si; W[0][2] = si; - W[1][0] = si; W[1][1] = si - sys->weight[e2->u.id]; W[1][2] = si; - W[2][0] = si; W[2][1] = si; W[2][2] = si - sys->weight[e3->u.id]; - - vid[0] = vid[1] = vid[2] = vid[3] = vid[4] = vid[5] = -1; - - if (v1->flag & PVERT_INTERIOR) { - vid[0] = v1->u.id; - vid[3] = ninterior + v1->u.id; - - sys->J2dt[e1->u.id][0] = j2[0][0] = 1.0*wi1; - sys->J2dt[e2->u.id][0] = j2[1][0] = p_abf_compute_sin_product(sys, v1, e2->u.id)*wi2; - sys->J2dt[e3->u.id][0] = j2[2][0] = p_abf_compute_sin_product(sys, v1, e3->u.id)*wi3; - - nlRightHandSideAdd(0, v1->u.id, j2[0][0]*beta[0]); - nlRightHandSideAdd(0, ninterior + v1->u.id, j2[1][0]*beta[1] + j2[2][0]*beta[2]); - - row1[0] = j2[0][0]*W[0][0]; - row2[0] = j2[0][0]*W[1][0]; - row3[0] = j2[0][0]*W[2][0]; - - row1[3] = j2[1][0]*W[0][1] + j2[2][0]*W[0][2]; - row2[3] = j2[1][0]*W[1][1] + j2[2][0]*W[1][2]; - row3[3] = j2[1][0]*W[2][1] + j2[2][0]*W[2][2]; - } - - if (v2->flag & PVERT_INTERIOR) { - vid[1] = v2->u.id; - vid[4] = ninterior + v2->u.id; - - sys->J2dt[e1->u.id][1] = j2[0][1] = p_abf_compute_sin_product(sys, v2, e1->u.id)*wi1; - sys->J2dt[e2->u.id][1] = j2[1][1] = 1.0*wi2; - sys->J2dt[e3->u.id][1] = j2[2][1] = p_abf_compute_sin_product(sys, v2, e3->u.id)*wi3; - - nlRightHandSideAdd(0, v2->u.id, j2[1][1]*beta[1]); - nlRightHandSideAdd(0, ninterior + v2->u.id, j2[0][1]*beta[0] + j2[2][1]*beta[2]); - - row1[1] = j2[1][1]*W[0][1]; - row2[1] = j2[1][1]*W[1][1]; - row3[1] = j2[1][1]*W[2][1]; - - row1[4] = j2[0][1]*W[0][0] + j2[2][1]*W[0][2]; - row2[4] = j2[0][1]*W[1][0] + j2[2][1]*W[1][2]; - row3[4] = j2[0][1]*W[2][0] + j2[2][1]*W[2][2]; - } - - if (v3->flag & PVERT_INTERIOR) { - vid[2] = v3->u.id; - vid[5] = ninterior + v3->u.id; - - sys->J2dt[e1->u.id][2] = j2[0][2] = p_abf_compute_sin_product(sys, v3, e1->u.id)*wi1; - sys->J2dt[e2->u.id][2] = j2[1][2] = p_abf_compute_sin_product(sys, v3, e2->u.id)*wi2; - sys->J2dt[e3->u.id][2] = j2[2][2] = 1.0*wi3; - - nlRightHandSideAdd(0, v3->u.id, j2[2][2]*beta[2]); - nlRightHandSideAdd(0, ninterior + v3->u.id, j2[0][2]*beta[0] + j2[1][2]*beta[1]); - - row1[2] = j2[2][2]*W[0][2]; - row2[2] = j2[2][2]*W[1][2]; - row3[2] = j2[2][2]*W[2][2]; - - row1[5] = j2[0][2]*W[0][0] + j2[1][2]*W[0][1]; - row2[5] = j2[0][2]*W[1][0] + j2[1][2]*W[1][1]; - row3[5] = j2[0][2]*W[2][0] + j2[1][2]*W[2][1]; - } - - for (i = 0; i < 3; i++) { - int r = vid[i]; - - if (r == -1) - continue; - - for (j = 0; j < 6; j++) { - int c = vid[j]; - - if (c == -1) - continue; - - if (i == 0) - nlMatrixAdd(r, c, j2[0][i]*row1[j]); - else - nlMatrixAdd(r + ninterior, c, j2[0][i]*row1[j]); - - if (i == 1) - nlMatrixAdd(r, c, j2[1][i]*row2[j]); - else - nlMatrixAdd(r + ninterior, c, j2[1][i]*row2[j]); - - - if (i == 2) - nlMatrixAdd(r, c, j2[2][i]*row3[j]); - else - nlMatrixAdd(r + ninterior, c, j2[2][i]*row3[j]); - } - } - } - - nlEnd(NL_MATRIX); - - nlEnd(NL_SYSTEM); - - success = nlSolve(); - - if (success) { - for (f=chart->faces; f; f=f->nextlink) { - float dlambda1, pre[3], dalpha; - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - pre[0] = pre[1] = pre[2] = 0.0; - - if (v1->flag & PVERT_INTERIOR) { - float x = nlGetVariable(0, v1->u.id); - float x2 = nlGetVariable(0, ninterior + v1->u.id); - pre[0] += sys->J2dt[e1->u.id][0]*x; - pre[1] += sys->J2dt[e2->u.id][0]*x2; - pre[2] += sys->J2dt[e3->u.id][0]*x2; - } - - if (v2->flag & PVERT_INTERIOR) { - float x = nlGetVariable(0, v2->u.id); - float x2 = nlGetVariable(0, ninterior + v2->u.id); - pre[0] += sys->J2dt[e1->u.id][1]*x2; - pre[1] += sys->J2dt[e2->u.id][1]*x; - pre[2] += sys->J2dt[e3->u.id][1]*x2; - } - - if (v3->flag & PVERT_INTERIOR) { - float x = nlGetVariable(0, v3->u.id); - float x2 = nlGetVariable(0, ninterior + v3->u.id); - pre[0] += sys->J2dt[e1->u.id][2]*x2; - pre[1] += sys->J2dt[e2->u.id][2]*x2; - pre[2] += sys->J2dt[e3->u.id][2]*x; - } - - dlambda1 = pre[0] + pre[1] + pre[2]; - dlambda1 = sys->dstar[f->u.id]*(sys->bstar[f->u.id] - dlambda1); - - sys->lambdaTriangle[f->u.id] += dlambda1; - - dalpha = (sys->bAlpha[e1->u.id] - dlambda1); - sys->alpha[e1->u.id] += dalpha/sys->weight[e1->u.id] - pre[0]; - - dalpha = (sys->bAlpha[e2->u.id] - dlambda1); - sys->alpha[e2->u.id] += dalpha/sys->weight[e2->u.id] - pre[1]; - - dalpha = (sys->bAlpha[e3->u.id] - dlambda1); - sys->alpha[e3->u.id] += dalpha/sys->weight[e3->u.id] - pre[2]; - - /* clamp */ - e = f->edge; - do { - if (sys->alpha[e->u.id] > M_PI) - sys->alpha[e->u.id] = M_PI; - else if (sys->alpha[e->u.id] < 0.0f) - sys->alpha[e->u.id] = 0.0f; - } while (e != f->edge); - } - - for (i = 0; i < ninterior; i++) { - sys->lambdaPlanar[i] += nlGetVariable(0, i); - sys->lambdaLength[i] += nlGetVariable(0, ninterior + i); - } - } - - nlDeleteContext(nlGetCurrent()); - - return success; -} - -static PBool p_chart_abf_solve(PChart *chart) -{ - PVert *v; - PFace *f; - PEdge *e, *e1, *e2, *e3; - PAbfSystem sys; - int i; - float lastnorm, limit = (chart->nfaces > 100)? 1.0f: 0.001f; - - /* setup id's */ - sys.ninterior = sys.nfaces = sys.nangles = 0; - - for (v=chart->verts; v; v=v->nextlink) { - if (p_vert_interior(v)) { - v->flag |= PVERT_INTERIOR; - v->u.id = sys.ninterior++; - } - else - v->flag &= ~PVERT_INTERIOR; - } - - for (f=chart->faces; f; f=f->nextlink) { - e1 = f->edge; e2 = e1->next; e3 = e2->next; - f->u.id = sys.nfaces++; - - /* angle id's are conveniently stored in half edges */ - e1->u.id = sys.nangles++; - e2->u.id = sys.nangles++; - e3->u.id = sys.nangles++; - } - - p_abf_setup_system(&sys); - - /* compute initial angles */ - for (f=chart->faces; f; f=f->nextlink) { - float a1, a2, a3; - - e1 = f->edge; e2 = e1->next; e3 = e2->next; - p_face_angles(f, &a1, &a2, &a3); - - if (a1 < sys.minangle) - a1 = sys.minangle; - else if (a1 > sys.maxangle) - a1 = sys.maxangle; - if (a2 < sys.minangle) - a2 = sys.minangle; - else if (a2 > sys.maxangle) - a2 = sys.maxangle; - if (a3 < sys.minangle) - a3 = sys.minangle; - else if (a3 > sys.maxangle) - a3 = sys.maxangle; - - sys.alpha[e1->u.id] = sys.beta[e1->u.id] = a1; - sys.alpha[e2->u.id] = sys.beta[e2->u.id] = a2; - sys.alpha[e3->u.id] = sys.beta[e3->u.id] = a3; - - sys.weight[e1->u.id] = 2.0/(a1*a1); - sys.weight[e2->u.id] = 2.0/(a2*a2); - sys.weight[e3->u.id] = 2.0/(a3*a3); - } - - for (v=chart->verts; v; v=v->nextlink) { - if (v->flag & PVERT_INTERIOR) { - float anglesum = 0.0, scale; - - e = v->edge; - do { - anglesum += sys.beta[e->u.id]; - e = e->next->next->pair; - } while (e && (e != v->edge)); - - scale = (anglesum == 0.0f)? 0.0f: 2*M_PI/anglesum; - - e = v->edge; - do { - sys.beta[e->u.id] = sys.alpha[e->u.id] = sys.beta[e->u.id]*scale; - e = e->next->next->pair; - } while (e && (e != v->edge)); - } - } - - if (sys.ninterior > 0) { - p_abf_compute_sines(&sys); - - /* iteration */ - lastnorm = 1e10; - - for (i = 0; i < ABF_MAX_ITER; i++) { - float norm = p_abf_compute_gradient(&sys, chart); - - lastnorm = norm; - - if (norm < limit) - break; - - if (!p_abf_matrix_invert(&sys, chart)) { - param_warning("ABF failed to invert matrix."); - p_abf_free_system(&sys); - return P_FALSE; - } - - p_abf_compute_sines(&sys); - } - - if (i == ABF_MAX_ITER) { - param_warning("ABF maximum iterations reached."); - p_abf_free_system(&sys); - return P_FALSE; - } - } - - chart->u.lscm.abf_alpha = MEM_dupallocN(sys.alpha); - p_abf_free_system(&sys); - - return P_TRUE; -} - -/* Least Squares Conformal Maps */ - -static void p_chart_pin_positions(PChart *chart, PVert **pin1, PVert **pin2) -{ - if (pin1 == pin2) { - /* degenerate case */ - PFace *f = chart->faces; - *pin1 = f->edge->vert; - *pin2 = f->edge->next->vert; - - (*pin1)->uv[0] = 0.0f; - (*pin1)->uv[1] = 0.5f; - (*pin2)->uv[0] = 1.0f; - (*pin2)->uv[1] = 0.5f; - } - else { - int diru, dirv, dirx, diry; - float sub[3]; - - VecSubf(sub, (*pin1)->co, (*pin2)->co); - sub[0] = fabs(sub[0]); - sub[1] = fabs(sub[1]); - sub[2] = fabs(sub[2]); - - if ((sub[0] > sub[1]) && (sub[0] > sub[2])) { - dirx = 0; - diry = (sub[1] > sub[2])? 1: 2; - } - else if ((sub[1] > sub[0]) && (sub[1] > sub[2])) { - dirx = 1; - diry = (sub[0] > sub[2])? 0: 2; - } - else { - dirx = 2; - diry = (sub[0] > sub[1])? 0: 1; - } - - if (dirx == 2) { - diru = 1; - dirv = 0; - } - else { - diru = 0; - dirv = 1; - } - - (*pin1)->uv[diru] = (*pin1)->co[dirx]; - (*pin1)->uv[dirv] = (*pin1)->co[diry]; - (*pin2)->uv[diru] = (*pin2)->co[dirx]; - (*pin2)->uv[dirv] = (*pin2)->co[diry]; - } -} - -static PBool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PVert **pin2) -{ - PEdge *be, *lastbe = NULL, *maxe1 = NULL, *maxe2 = NULL, *be1, *be2; - PEdge *cure = NULL, *firste1 = NULL, *firste2 = NULL, *nextbe; - float maxlen = 0.0f, curlen = 0.0f, totlen = 0.0f, firstlen = 0.0f; - float len1, len2; - - /* find longest series of verts split in the chart itself, these are - marked during construction */ - be = outer; - lastbe = p_boundary_edge_prev(be); - do { - float len = p_edge_length(be); - totlen += len; - - nextbe = p_boundary_edge_next(be); - - if ((be->vert->flag & PVERT_SPLIT) || - (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) { - if (!cure) { - if (be == outer) - firste1 = be; - cure = be; - } - else - curlen += p_edge_length(lastbe); - } - else if (cure) { - if (curlen > maxlen) { - maxlen = curlen; - maxe1 = cure; - maxe2 = lastbe; - } - - if (firste1 == cure) { - firstlen = curlen; - firste2 = lastbe; - } - - curlen = 0.0f; - cure = NULL; - } - - lastbe = be; - be = nextbe; - } while(be != outer); - - /* make sure we also count a series of splits over the starting point */ - if (cure && (cure != outer)) { - firstlen += curlen + p_edge_length(be); - - if (firstlen > maxlen) { - maxlen = firstlen; - maxe1 = cure; - maxe2 = firste2; - } - } - - if (!maxe1 || !maxe2 || (maxlen < 0.5f*totlen)) - return P_FALSE; - - /* find pin1 in the split vertices */ - be1 = maxe1; - be2 = maxe2; - len1 = 0.0f; - len2 = 0.0f; - - do { - if (len1 < len2) { - len1 += p_edge_length(be1); - be1 = p_boundary_edge_next(be1); - } - else { - be2 = p_boundary_edge_prev(be2); - len2 += p_edge_length(be2); - } - } while (be1 != be2); - - *pin1 = be1->vert; - - /* find pin2 outside the split vertices */ - be1 = maxe1; - be2 = maxe2; - len1 = 0.0f; - len2 = 0.0f; - - do { - if (len1 < len2) { - be1 = p_boundary_edge_prev(be1); - len1 += p_edge_length(be1); - } - else { - len2 += p_edge_length(be2); - be2 = p_boundary_edge_next(be2); - } - } while (be1 != be2); - - *pin2 = be1->vert; - - p_chart_pin_positions(chart, pin1, pin2); - - return P_TRUE; -} - -static void p_chart_extrema_verts(PChart *chart, PVert **pin1, PVert **pin2) -{ - float minv[3], maxv[3], dirlen; - PVert *v, *minvert[3], *maxvert[3]; - int i, dir; - - /* find minimum and maximum verts over x/y/z axes */ - minv[0] = minv[1] = minv[2] = 1e20; - maxv[0] = maxv[1] = maxv[2] = -1e20; - - minvert[0] = minvert[1] = minvert[2] = NULL; - maxvert[0] = maxvert[1] = maxvert[2] = NULL; - - for (v = chart->verts; v; v=v->nextlink) { - for (i = 0; i < 3; i++) { - if (v->co[i] < minv[i]) { - minv[i] = v->co[i]; - minvert[i] = v; - } - if (v->co[i] > maxv[i]) { - maxv[i] = v->co[i]; - maxvert[i] = v; - } - } - } - - /* find axes with longest distance */ - dir = 0; - dirlen = -1.0; - - for (i = 0; i < 3; i++) { - if (maxv[i] - minv[i] > dirlen) { - dir = i; - dirlen = maxv[i] - minv[i]; - } - } - - *pin1 = minvert[dir]; - *pin2 = maxvert[dir]; - - p_chart_pin_positions(chart, pin1, pin2); -} - -static void p_chart_lscm_load_solution(PChart *chart) -{ - PVert *v; - - for (v=chart->verts; v; v=v->nextlink) { - v->uv[0] = nlGetVariable(0, 2*v->u.id); - v->uv[1] = nlGetVariable(0, 2*v->u.id + 1); - } -} - -static void p_chart_lscm_begin(PChart *chart, PBool live, PBool abf) -{ - PVert *v, *pin1, *pin2; - PBool select = P_FALSE, deselect = P_FALSE; - int npins = 0, id = 0; - - /* give vertices matrix indices and count pins */ - for (v=chart->verts; v; v=v->nextlink) { - if (v->flag & PVERT_PIN) { - npins++; - if (v->flag & PVERT_SELECT) - select = P_TRUE; - } - - if (!(v->flag & PVERT_SELECT)) - deselect = P_TRUE; - } - - if ((live && (!select || !deselect)) || (npins == 1)) { - chart->u.lscm.context = NULL; - } - else { -#if 0 - p_chart_simplify_compute(chart); - p_chart_topological_sanity_check(chart); -#endif - - if (abf) { - if (!p_chart_abf_solve(chart)) - param_warning("ABF solving failed: falling back to LSCM.\n"); - } - - if (npins <= 1) { - /* not enough pins, lets find some ourself */ - PEdge *outer; - - p_chart_boundaries(chart, NULL, &outer); - - if (!p_chart_symmetry_pins(chart, outer, &pin1, &pin2)) - p_chart_extrema_verts(chart, &pin1, &pin2); - - chart->u.lscm.pin1 = pin1; - chart->u.lscm.pin2 = pin2; - } - else { - chart->flag |= PCHART_NOPACK; - } - - for (v=chart->verts; v; v=v->nextlink) - v->u.id = id++; - - nlNewContext(); - nlSolverParameteri(NL_NB_VARIABLES, 2*chart->nverts); - nlSolverParameteri(NL_NB_ROWS, 2*chart->nfaces); - nlSolverParameteri(NL_LEAST_SQUARES, NL_TRUE); - - chart->u.lscm.context = nlGetCurrent(); - } -} - -static PBool p_chart_lscm_solve(PChart *chart) -{ - PVert *v, *pin1 = chart->u.lscm.pin1, *pin2 = chart->u.lscm.pin2; - PFace *f; - float *alpha = chart->u.lscm.abf_alpha; - int row; - - nlMakeCurrent(chart->u.lscm.context); - - nlBegin(NL_SYSTEM); - -#if 0 - /* TODO: make loading pins work for simplify/complexify. */ -#endif - - for (v=chart->verts; v; v=v->nextlink) - if (v->flag & PVERT_PIN) - p_vert_load_pin_select_uvs(v); /* reload for live */ - - if (chart->u.lscm.pin1) { - nlLockVariable(2*pin1->u.id); - nlLockVariable(2*pin1->u.id + 1); - nlLockVariable(2*pin2->u.id); - nlLockVariable(2*pin2->u.id + 1); - - nlSetVariable(0, 2*pin1->u.id, pin1->uv[0]); - nlSetVariable(0, 2*pin1->u.id + 1, pin1->uv[1]); - nlSetVariable(0, 2*pin2->u.id, pin2->uv[0]); - nlSetVariable(0, 2*pin2->u.id + 1, pin2->uv[1]); - } - else { - /* set and lock the pins */ - for (v=chart->verts; v; v=v->nextlink) { - if (v->flag & PVERT_PIN) { - nlLockVariable(2*v->u.id); - nlLockVariable(2*v->u.id + 1); - - nlSetVariable(0, 2*v->u.id, v->uv[0]); - nlSetVariable(0, 2*v->u.id + 1, v->uv[1]); - } - } - } - - /* construct matrix */ - - nlBegin(NL_MATRIX); - - row = 0; - for (f=chart->faces; f; f=f->nextlink) { - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - float a1, a2, a3, ratio, cosine, sine; - float sina1, sina2, sina3, sinmax; - - if (alpha) { - /* use abf angles if passed on */ - a1 = *(alpha++); - a2 = *(alpha++); - a3 = *(alpha++); - } - else - p_face_angles(f, &a1, &a2, &a3); - - sina1 = sin(a1); - sina2 = sin(a2); - sina3 = sin(a3); - - sinmax = MAX3(sina1, sina2, sina3); - - /* shift vertices to find most stable order */ - if (sina3 != sinmax) { - SHIFT3(PVert*, v1, v2, v3); - SHIFT3(float, a1, a2, a3); - SHIFT3(float, sina1, sina2, sina3); - - if (sina2 == sinmax) { - SHIFT3(PVert*, v1, v2, v3); - SHIFT3(float, a1, a2, a3); - SHIFT3(float, sina1, sina2, sina3); - } - } - - /* angle based lscm formulation */ - ratio = (sina3 == 0.0f)? 1.0f: sina2/sina3; - cosine = cos(a1)*ratio; - sine = sina1*ratio; - -#if 0 - nlBegin(NL_ROW); - nlCoefficient(2*v1->u.id, cosine - 1.0); - nlCoefficient(2*v1->u.id+1, -sine); - nlCoefficient(2*v2->u.id, -cosine); - nlCoefficient(2*v2->u.id+1, sine); - nlCoefficient(2*v3->u.id, 1.0); - nlEnd(NL_ROW); - - nlBegin(NL_ROW); - nlCoefficient(2*v1->u.id, sine); - nlCoefficient(2*v1->u.id+1, cosine - 1.0); - nlCoefficient(2*v2->u.id, -sine); - nlCoefficient(2*v2->u.id+1, -cosine); - nlCoefficient(2*v3->u.id+1, 1.0); - nlEnd(NL_ROW); -#else - nlMatrixAdd(row, 2*v1->u.id, cosine - 1.0); - nlMatrixAdd(row, 2*v1->u.id+1, -sine); - nlMatrixAdd(row, 2*v2->u.id, -cosine); - nlMatrixAdd(row, 2*v2->u.id+1, sine); - nlMatrixAdd(row, 2*v3->u.id, 1.0); - row++; - - nlMatrixAdd(row, 2*v1->u.id, sine); - nlMatrixAdd(row, 2*v1->u.id+1, cosine - 1.0); - nlMatrixAdd(row, 2*v2->u.id, -sine); - nlMatrixAdd(row, 2*v2->u.id+1, -cosine); - nlMatrixAdd(row, 2*v3->u.id+1, 1.0); - row++; -#endif - } - - nlEnd(NL_MATRIX); - - nlEnd(NL_SYSTEM); - - if (nlSolveAdvanced(NULL, NL_TRUE)) { - p_chart_lscm_load_solution(chart); - return P_TRUE; - } - else { - for (v=chart->verts; v; v=v->nextlink) { - v->uv[0] = 0.0f; - v->uv[1] = 0.0f; - } - } - - return P_FALSE; -} - -static void p_chart_lscm_end(PChart *chart) -{ - if (chart->u.lscm.context) - nlDeleteContext(chart->u.lscm.context); - - if (chart->u.lscm.abf_alpha) { - MEM_freeN(chart->u.lscm.abf_alpha); - chart->u.lscm.abf_alpha = NULL; - } - - chart->u.lscm.context = NULL; - chart->u.lscm.pin1 = NULL; - chart->u.lscm.pin2 = NULL; -} - -/* Stretch */ - -#define P_STRETCH_ITER 20 - -static void p_stretch_pin_boundary(PChart *chart) -{ - PVert *v; - - for(v=chart->verts; v; v=v->nextlink) - if (v->edge->pair == NULL) - v->flag |= PVERT_PIN; - else - v->flag &= ~PVERT_PIN; -} - -static float p_face_stretch(PFace *f) -{ - float T, w, tmp[3]; - float Ps[3], Pt[3]; - float a, c, area; - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - PVert *v1 = e1->vert, *v2 = e2->vert, *v3 = e3->vert; - - area = p_face_uv_area_signed(f); - - if (area <= 0.0f) /* flipped face -> infinite stretch */ - return 1e10f; - - w= 1.0f/(2.0f*area); - - /* compute derivatives */ - VecCopyf(Ps, v1->co); - VecMulf(Ps, (v2->uv[1] - v3->uv[1])); - - VecCopyf(tmp, v2->co); - VecMulf(tmp, (v3->uv[1] - v1->uv[1])); - VecAddf(Ps, Ps, tmp); - - VecCopyf(tmp, v3->co); - VecMulf(tmp, (v1->uv[1] - v2->uv[1])); - VecAddf(Ps, Ps, tmp); - - VecMulf(Ps, w); - - VecCopyf(Pt, v1->co); - VecMulf(Pt, (v3->uv[0] - v2->uv[0])); - - VecCopyf(tmp, v2->co); - VecMulf(tmp, (v1->uv[0] - v3->uv[0])); - VecAddf(Pt, Pt, tmp); - - VecCopyf(tmp, v3->co); - VecMulf(tmp, (v2->uv[0] - v1->uv[0])); - VecAddf(Pt, Pt, tmp); - - VecMulf(Pt, w); - - /* Sander Tensor */ - a= Inpf(Ps, Ps); - c= Inpf(Pt, Pt); - - T = sqrt(0.5f*(a + c)); - if (f->flag & PFACE_FILLED) - T *= 0.2; - - return T; -} - -static float p_stretch_compute_vertex(PVert *v) -{ - PEdge *e = v->edge; - float sum = 0.0f; - - do { - sum += p_face_stretch(e->face); - e = p_wheel_edge_next(e); - } while (e && e != (v->edge)); - - return sum; -} - -static void p_chart_stretch_minimize(PChart *chart, RNG *rng) -{ - PVert *v; - PEdge *e; - int j, nedges; - float orig_stretch, low, stretch_low, high, stretch_high, mid, stretch; - float orig_uv[2], dir[2], random_angle, trusted_radius; - - for(v=chart->verts; v; v=v->nextlink) { - if((v->flag & PVERT_PIN) || !(v->flag & PVERT_SELECT)) - continue; - - orig_stretch = p_stretch_compute_vertex(v); - orig_uv[0] = v->uv[0]; - orig_uv[1] = v->uv[1]; - - /* move vertex in a random direction */ - trusted_radius = 0.0f; - nedges = 0; - e = v->edge; - - do { - trusted_radius += p_edge_uv_length(e); - nedges++; - - e = p_wheel_edge_next(e); - } while (e && e != (v->edge)); - - trusted_radius /= 2 * nedges; - - random_angle = rng_getFloat(rng) * 2.0 * M_PI; - dir[0] = trusted_radius * cos(random_angle); - dir[1] = trusted_radius * sin(random_angle); - - /* calculate old and new stretch */ - low = 0; - stretch_low = orig_stretch; - - Vec2Addf(v->uv, orig_uv, dir); - high = 1; - stretch = stretch_high = p_stretch_compute_vertex(v); - - /* binary search for lowest stretch position */ - for (j = 0; j < P_STRETCH_ITER; j++) { - mid = 0.5 * (low + high); - v->uv[0]= orig_uv[0] + mid*dir[0]; - v->uv[1]= orig_uv[1] + mid*dir[1]; - stretch = p_stretch_compute_vertex(v); - - if (stretch_low < stretch_high) { - high = mid; - stretch_high = stretch; - } - else { - low = mid; - stretch_low = stretch; - } - } - - /* no luck, stretch has increased, reset to old values */ - if(stretch >= orig_stretch) - Vec2Copyf(v->uv, orig_uv); - } -} - -/* Minimum area enclosing rectangle for packing */ - -static int p_compare_geometric_uv(const void *a, const void *b) -{ - PVert *v1 = *(PVert**)a; - PVert *v2 = *(PVert**)b; - - if (v1->uv[0] < v2->uv[0]) - return -1; - else if (v1->uv[0] == v2->uv[0]) { - if (v1->uv[1] < v2->uv[1]) - return -1; - else if (v1->uv[1] == v2->uv[1]) - return 0; - else - return 1; - } - else - return 1; -} - -static PBool p_chart_convex_hull(PChart *chart, PVert ***verts, int *nverts, int *right) -{ - /* Graham algorithm, taken from: - * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117225 */ - - PEdge *be, *e; - int npoints = 0, i, ulen, llen; - PVert **U, **L, **points, **p; - - p_chart_boundaries(chart, NULL, &be); - - if (!be) - return P_FALSE; - - e = be; - do { - npoints++; - e = p_boundary_edge_next(e); - } while(e != be); - - p = points = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints*2, "PCHullpoints"); - U = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints, "PCHullU"); - L = (PVert**)MEM_mallocN(sizeof(PVert*)*npoints, "PCHullL"); - - e = be; - do { - *p = e->vert; - p++; - e = p_boundary_edge_next(e); - } while(e != be); - - qsort(points, npoints, sizeof(PVert*), p_compare_geometric_uv); - - ulen = llen = 0; - for (p=points, i = 0; i < npoints; i++, p++) { - while ((ulen > 1) && (p_area_signed(U[ulen-2]->uv, (*p)->uv, U[ulen-1]->uv) <= 0)) - ulen--; - while ((llen > 1) && (p_area_signed(L[llen-2]->uv, (*p)->uv, L[llen-1]->uv) >= 0)) - llen--; - - U[ulen] = *p; - ulen++; - L[llen] = *p; - llen++; - } - - npoints = 0; - for (p=points, i = 0; i < ulen; i++, p++, npoints++) - *p = U[i]; - - /* the first and last point in L are left out, since they are also in U */ - for (i = llen-2; i > 0; i--, p++, npoints++) - *p = L[i]; - - *verts = points; - *nverts = npoints; - *right = ulen - 1; - - MEM_freeN(U); - MEM_freeN(L); - - return P_TRUE; -} - -float p_rectangle_area(float *p1, float *dir, float *p2, float *p3, float *p4) -{ - /* given 4 points on the rectangle edges and the direction of on edge, - compute the area of the rectangle */ - - float orthodir[2], corner1[2], corner2[2], corner3[2]; - - orthodir[0] = dir[1]; - orthodir[1] = -dir[0]; - - if (!p_intersect_line_2d_dir(p1, dir, p2, orthodir, corner1)) - return 1e10; - - if (!p_intersect_line_2d_dir(p1, dir, p4, orthodir, corner2)) - return 1e10; - - if (!p_intersect_line_2d_dir(p3, dir, p4, orthodir, corner3)) - return 1e10; - - return Vec2Lenf(corner1, corner2)*Vec2Lenf(corner2, corner3); -} - -static float p_chart_minimum_area_angle(PChart *chart) -{ - /* minimum area enclosing rectangle with rotating calipers, info: - * http://cgm.cs.mcgill.ca/~orm/maer.html */ - - float rotated, minarea, minangle, area, len; - float *angles, miny, maxy, v[2], a[4], mina; - int npoints, right, mini, maxi, i, idx[4], nextidx; - PVert **points, *p1, *p2, *p3, *p4, *p1n; - - /* compute convex hull */ - if (!p_chart_convex_hull(chart, &points, &npoints, &right)) - return 0.0; - - /* find left/top/right/bottom points, and compute angle for each point */ - angles = MEM_mallocN(sizeof(float)*npoints, "PMinAreaAngles"); - - mini = maxi = 0; - miny = 1e10; - maxy = -1e10; - - for (i = 0; i < npoints; i++) { - p1 = (i == 0)? points[npoints-1]: points[i-1]; - p2 = points[i]; - p3 = (i == npoints-1)? points[0]: points[i+1]; - - angles[i] = M_PI - p_vec2_angle(p1->uv, p2->uv, p3->uv); - - if (points[i]->uv[1] < miny) { - miny = points[i]->uv[1]; - mini = i; - } - if (points[i]->uv[1] > maxy) { - maxy = points[i]->uv[1]; - maxi = i; - } - } - - /* left, top, right, bottom */ - idx[0] = 0; - idx[1] = maxi; - idx[2] = right; - idx[3] = mini; - - v[0] = points[idx[0]]->uv[0]; - v[1] = points[idx[0]]->uv[1] + 1.0f; - a[0] = p_vec2_angle(points[(idx[0]+1)%npoints]->uv, points[idx[0]]->uv, v); - - v[0] = points[idx[1]]->uv[0] + 1.0f; - v[1] = points[idx[1]]->uv[1]; - a[1] = p_vec2_angle(points[(idx[1]+1)%npoints]->uv, points[idx[1]]->uv, v); - - v[0] = points[idx[2]]->uv[0]; - v[1] = points[idx[2]]->uv[1] - 1.0f; - a[2] = p_vec2_angle(points[(idx[2]+1)%npoints]->uv, points[idx[2]]->uv, v); - - v[0] = points[idx[3]]->uv[0] - 1.0f; - v[1] = points[idx[3]]->uv[1]; - a[3] = p_vec2_angle(points[(idx[3]+1)%npoints]->uv, points[idx[3]]->uv, v); - - /* 4 rotating calipers */ - - rotated = 0.0; - minarea = 1e10; - minangle = 0.0; - - while (rotated <= M_PI/2) { /* INVESTIGATE: how far to rotate? */ - /* rotate with the smallest angle */ - mini = 0; - mina = 1e10; - - for (i = 0; i < 4; i++) - if (a[i] < mina) { - mina = a[i]; - mini = i; - } - - rotated += mina; - nextidx = (idx[mini]+1)%npoints; - - a[mini] = angles[nextidx]; - a[(mini+1)%4] = a[(mini+1)%4] - mina; - a[(mini+2)%4] = a[(mini+2)%4] - mina; - a[(mini+3)%4] = a[(mini+3)%4] - mina; - - /* compute area */ - p1 = points[idx[mini]]; - p1n = points[nextidx]; - p2 = points[idx[(mini+1)%4]]; - p3 = points[idx[(mini+2)%4]]; - p4 = points[idx[(mini+3)%4]]; - - len = Vec2Lenf(p1->uv, p1n->uv); - - if (len > 0.0f) { - len = 1.0/len; - v[0] = (p1n->uv[0] - p1->uv[0])*len; - v[1] = (p1n->uv[1] - p1->uv[1])*len; - - area = p_rectangle_area(p1->uv, v, p2->uv, p3->uv, p4->uv); - - /* remember smallest area */ - if (area < minarea) { - minarea = area; - minangle = rotated; - } - } - - idx[mini] = nextidx; - } - - /* try keeping rotation as small as possible */ - if (minangle > M_PI/4) - minangle -= M_PI/2; - - MEM_freeN(angles); - MEM_freeN(points); - - return minangle; -} - -void p_chart_rotate_minimum_area(PChart *chart) -{ - float angle = p_chart_minimum_area_angle(chart); - float sine = sin(angle); - float cosine = cos(angle); - PVert *v; - - for (v = chart->verts; v; v=v->nextlink) { - float oldu = v->uv[0], oldv = v->uv[1]; - v->uv[0] = cosine*oldu - sine*oldv; - v->uv[1] = sine*oldu + cosine*oldv; - } -} - -/* Area Smoothing */ - -/* 2d bsp tree for inverse mapping - that's a bit silly */ - -typedef struct SmoothTriangle { - float co1[2], co2[2], co3[2]; - float oco1[2], oco2[2], oco3[2]; -} SmoothTriangle; - -typedef struct SmoothNode { - struct SmoothNode *c1, *c2; - SmoothTriangle **tri; - float split; - int axis, ntri; -} SmoothNode; - -static void p_barycentric_2d(float *v1, float *v2, float *v3, float *p, float *b) -{ - float a[2], c[2], h[2], div; - - a[0] = v2[0] - v1[0]; - a[1] = v2[1] - v1[1]; - c[0] = v3[0] - v1[0]; - c[1] = v3[1] - v1[1]; - - div = a[0]*c[1] - a[1]*c[0]; - - if (div == 0.0f) { - b[0] = 1.0f/3.0f; - b[1] = 1.0f/3.0f; - b[2] = 1.0f/3.0f; - } - else { - h[0] = p[0] - v1[0]; - h[1] = p[1] - v1[1]; - - div = 1.0f/div; - - b[1] = (h[0]*c[1] - h[1]*c[0])*div; - b[2] = (a[0]*h[1] - a[1]*h[0])*div; - b[0] = 1.0 - b[1] - b[2]; - } -} - -static PBool p_triangle_inside(SmoothTriangle *t, float *co) -{ - float b[3]; - - p_barycentric_2d(t->co1, t->co2, t->co3, co, b); - - if ((b[0] >= 0.0) && (b[1] >= 0.0) && (b[2] >= 0.0f)) { - co[0] = t->oco1[0]*b[0] + t->oco2[0]*b[1] + t->oco3[0]*b[2]; - co[1] = t->oco1[1]*b[0] + t->oco2[1]*b[1] + t->oco3[1]*b[2]; - return P_TRUE; - } - - return P_FALSE; -} - -static SmoothNode *p_node_new(MemArena *arena, SmoothTriangle **tri, int ntri, float *bmin, float *bmax, int depth) -{ - SmoothNode *node = BLI_memarena_alloc(arena, sizeof *node); - int axis, i, t1size = 0, t2size = 0; - float split, mi, mx; - SmoothTriangle **t1, **t2, *t; - - node->tri = tri; - node->ntri = ntri; - - if (ntri <= 10 || depth >= 15) - return node; - - t1 = MEM_mallocN(sizeof(SmoothTriangle)*ntri, "PNodeTri1"); - t2 = MEM_mallocN(sizeof(SmoothTriangle)*ntri, "PNodeTri1"); - - axis = (bmax[0] - bmin[0] > bmax[1] - bmin[1])? 0: 1; - split = 0.5f*(bmin[axis] + bmax[axis]); - - for (i = 0; i < ntri; i++) { - t = tri[i]; - - if ((t->co1[axis] <= split) || (t->co2[axis] <= split) || (t->co3[axis] <= split)) { - t1[t1size] = t; - t1size++; - } - if ((t->co1[axis] >= split) || (t->co2[axis] >= split) || (t->co3[axis] >= split)) { - t2[t2size] = t; - t2size++; - } - } - - if ((t1size == t2size) && (t1size == ntri)) { - MEM_freeN(t1); - MEM_freeN(t2); - return node; - } - - node->tri = NULL; - node->ntri = 0; - MEM_freeN(tri); - - node->axis = axis; - node->split = split; - - mi = bmin[axis]; - mx = bmax[axis]; - bmax[axis] = split; - node->c1 = p_node_new(arena, t1, t1size, bmin, bmax, depth+1); - - bmin[axis] = bmax[axis]; - bmax[axis] = mx; - node->c2 = p_node_new(arena, t2, t2size, bmin, bmax, depth+1); - - return node; -} - -static void p_node_delete(SmoothNode *node) -{ - if (node->c1) - p_node_delete(node->c1); - if (node->c2) - p_node_delete(node->c2); - if (node->tri) - MEM_freeN(node->tri); -} - -static PBool p_node_intersect(SmoothNode *node, float *co) -{ - int i; - - if (node->tri) { - for (i = 0; i < node->ntri; i++) - if (p_triangle_inside(node->tri[i], co)) - return P_TRUE; - - return P_FALSE; - } - else { - if (co[node->axis] < node->split) - return p_node_intersect(node->c1, co); - else - return p_node_intersect(node->c2, co); - } - -} - -/* smooothing */ - -static int p_compare_float(const void *a, const void *b) -{ - if (*((float*)a) < *((float*)b)) - return -1; - else if (*((float*)a) == *((float*)b)) - return 0; - else - return 1; -} - -static float p_smooth_median_edge_length(PChart *chart) -{ - PEdge *e; - float *lengths = MEM_mallocN(sizeof(chart->edges)*chart->nedges, "PMedianLength"); - float median; - int i; - - /* ok, so i'm lazy */ - for (i=0, e=chart->edges; e; e=e->nextlink, i++) - lengths[i] = p_edge_length(e); - - qsort(lengths, i, sizeof(float), p_compare_float); - - median = lengths[i/2]; - MEM_freeN(lengths); - - return median; -} - -static float p_smooth_distortion(PEdge *e, float avg2d, float avg3d) -{ - float len2d = p_edge_uv_length(e)*avg3d; - float len3d = p_edge_length(e)*avg2d; - - return (len3d == 0.0f)? 0.0f: len2d/len3d; -} - -void p_smooth(PChart *chart) -{ - PEdge *e; - PVert *v; - PFace *f; - int j, it2, maxiter2, it; - int nedges = chart->nedges, nwheel, gridx, gridy; - int edgesx, edgesy, nsize, esize, i, x, y, maxiter, totiter; - float minv[2], maxv[2], median, invmedian, distortion, avglen2d, avglen3d; - float center[2], dx, dy, *nodes, dlimit, d, *oldnodesx, *oldnodesy; - float *nodesx, *nodesy, *hedges, *vedges, climit, moved, padding; - SmoothTriangle *triangles, *t, *t2, **tri, **trip; - SmoothNode *root; - MemArena *arena; - - if (nedges == 0) - return; - - p_chart_uv_bbox(chart, minv, maxv); - median = p_smooth_median_edge_length(chart)*0.10f; - - if (median == 0.0) - return; - - invmedian = 1.0/median; - - /* compute edge distortion */ - distortion = 0.0; - avglen2d = avglen3d = 0.0; - - for (e=chart->edges; e; e=e->nextlink) { - avglen2d += p_edge_uv_length(e); - avglen3d += p_edge_length(e); - } - - avglen2d /= nedges; - avglen3d /= nedges; - - for (v=chart->verts; v; v=v->nextlink) { - v->u.distortion = 0.0; - nwheel = 0; - - e = v->edge; - do { - v->u.distortion += p_smooth_distortion(e, avglen2d, avglen3d); - nwheel++; - - e = e->next->next->pair; - } while(e && (e != v->edge)); - - v->u.distortion /= nwheel; - } - - /* need to do excessive grid size checking still */ - center[0] = 0.5f*(minv[0] + maxv[0]); - center[1] = 0.5f*(minv[1] + maxv[1]); - - dx = 0.5f*(maxv[0] - minv[0]); - dy = 0.5f*(maxv[1] - minv[1]); - - padding = 0.15f; - dx += padding*dx + 2.0f*median; - dy += padding*dy + 2.0f*median; - - gridx = (int)(dx*invmedian); - gridy = (int)(dy*invmedian); - - minv[0] = center[0] - median*gridx; - minv[1] = center[1] - median*gridy; - maxv[0] = center[0] + median*gridx; - maxv[1] = center[1] + median*gridy; - - /* create grid */ - gridx = gridx*2 + 1; - gridy = gridy*2 + 1; - - if ((gridx <= 2) || (gridy <= 2)) - return; - - edgesx = gridx-1; - edgesy = gridy-1; - nsize = gridx*gridy; - esize = edgesx*edgesy; - - nodes = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodes"); - nodesx = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodesX"); - nodesy = MEM_mallocN(sizeof(float)*nsize, "PSmoothNodesY"); - oldnodesx = MEM_mallocN(sizeof(float)*nsize, "PSmoothOldNodesX"); - oldnodesy = MEM_mallocN(sizeof(float)*nsize, "PSmoothOldNodesY"); - hedges = MEM_mallocN(sizeof(float)*esize, "PSmoothHEdges"); - vedges = MEM_mallocN(sizeof(float)*esize, "PSmoothVEdges"); - - if (!nodes || !nodesx || !nodesy || !oldnodesx || !oldnodesy || !hedges || !vedges) { - if (nodes) MEM_freeN(nodes); - if (nodesx) MEM_freeN(nodesx); - if (nodesy) MEM_freeN(nodesy); - if (oldnodesx) MEM_freeN(oldnodesx); - if (oldnodesy) MEM_freeN(oldnodesy); - if (hedges) MEM_freeN(hedges); - if (vedges) MEM_freeN(vedges); - - error("Not enough memory for area smoothing grid."); - return; - } - - for (x = 0; x < gridx; x++) { - for (y = 0; y < gridy; y++) { - i = x + y*gridx; - - nodesx[i] = minv[0] + median*x; - nodesy[i] = minv[1] + median*y; - - nodes[i] = 1.0f; - } - } - - /* embed in grid */ - for (f=chart->faces; f; f=f->nextlink) { - PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next; - float fmin[2], fmax[2]; - int bx1, by1, bx2, by2; - - INIT_MINMAX2(fmin, fmax); - - DO_MINMAX2(e1->vert->uv, fmin, fmax); - DO_MINMAX2(e2->vert->uv, fmin, fmax); - DO_MINMAX2(e3->vert->uv, fmin, fmax); - - bx1 = (int)((fmin[0] - minv[0])*invmedian); - by1 = (int)((fmin[1] - minv[1])*invmedian); - bx2 = (int)((fmax[0] - minv[0])*invmedian + 2); - by2 = (int)((fmax[1] - minv[1])*invmedian + 2); - - for (x = bx1; x < bx2; x++) { - for (y = by1; y < by2; y++) { - float p[2], b[3]; - - i = x + y*gridx; - - p[0] = nodesx[i]; - p[1] = nodesy[i]; - - p_barycentric_2d(e1->vert->uv, e2->vert->uv, e3->vert->uv, p, b); - - if ((b[0] > 0.0) && (b[1] > 0.0) && (b[2] > 0.0)) { - nodes[i] = e1->vert->u.distortion*b[0]; - nodes[i] += e2->vert->u.distortion*b[1]; - nodes[i] += e3->vert->u.distortion*b[2]; - } - } - } - } - - /* smooth the grid */ - maxiter = 10; - totiter = 0; - climit = 0.00001f*nsize; - - for (it = 0; it < maxiter; it++) { - moved = 0.0f; - - for (x = 0; x < edgesx; x++) { - for (y = 0; y < edgesy; y++) { - i = x + y*gridx; - j = x + y*edgesx; - - hedges[j] = (nodes[i] + nodes[i+1])*0.5f; - vedges[j] = (nodes[i] + nodes[i+gridx])*0.5f; - - /* we do *inverse* mapping */ - hedges[j] = 1.0f/hedges[j]; - vedges[j] = 1.0f/vedges[j]; - } - } - - maxiter2 = 50; - dlimit = 0.0001f; - - for (it2 = 0; it2 < maxiter2; it2++) { - d = 0.0f; - totiter += 1; - - memcpy(oldnodesx, nodesx, sizeof(float)*nsize); - memcpy(oldnodesy, nodesy, sizeof(float)*nsize); - - for (x=1; x < gridx-1; x++) { - for (y=1; y < gridy-1; y++) { - float p[2], oldp[2], sum1, sum2, diff[2], length; - - i = x + gridx*y; - j = x + edgesx*y; - - oldp[0] = oldnodesx[i]; - oldp[1] = oldnodesy[i]; - - sum1 = hedges[j-1]*oldnodesx[i-1]; - sum1 += hedges[j]*oldnodesx[i+1]; - sum1 += vedges[j-edgesx]*oldnodesx[i-gridx]; - sum1 += vedges[j]*oldnodesx[i+gridx]; - - sum2 = hedges[j-1]; - sum2 += hedges[j]; - sum2 += vedges[j-edgesx]; - sum2 += vedges[j]; - - nodesx[i] = sum1/sum2; - - sum1 = hedges[j-1]*oldnodesy[i-1]; - sum1 += hedges[j]*oldnodesy[i+1]; - sum1 += vedges[j-edgesx]*oldnodesy[i-gridx]; - sum1 += vedges[j]*oldnodesy[i+gridx]; - - nodesy[i] = sum1/sum2; - - p[0] = nodesx[i]; - p[1] = nodesy[i]; - - diff[0] = p[0] - oldp[0]; - diff[1] = p[1] - oldp[1]; - - length = sqrt(diff[0]*diff[0] + diff[1]*diff[1]); - d = MAX2(d, length); - moved += length; - } - } - - if (d < dlimit) - break; - } - - if (moved < climit) - break; - } - - MEM_freeN(oldnodesx); - MEM_freeN(oldnodesy); - MEM_freeN(hedges); - MEM_freeN(vedges); - - /* create bsp */ - t = triangles = MEM_mallocN(sizeof(SmoothTriangle)*esize*2, "PSmoothTris"); - trip = tri = MEM_mallocN(sizeof(SmoothTriangle*)*esize*2, "PSmoothTriP"); - - if (!triangles || !tri) { - MEM_freeN(nodes); - MEM_freeN(nodesx); - MEM_freeN(nodesy); - - if (triangles) MEM_freeN(triangles); - if (tri) MEM_freeN(tri); - - error("Not enough memory for area smoothing grid."); - return; - } - - for (x = 0; x < edgesx; x++) { - for (y = 0; y < edgesy; y++) { - i = x + y*gridx; - - t->co1[0] = nodesx[i]; - t->co1[1] = nodesy[i]; - - t->co2[0] = nodesx[i+1]; - t->co2[1] = nodesy[i+1]; - - t->co3[0] = nodesx[i+gridx]; - t->co3[1] = nodesy[i+gridx]; - - t->oco1[0] = minv[0] + x*median; - t->oco1[1] = minv[1] + y*median; - - t->oco2[0] = minv[0] + (x+1)*median; - t->oco2[1] = minv[1] + y*median; - - t->oco3[0] = minv[0] + x*median; - t->oco3[1] = minv[1] + (y+1)*median; - - t2 = t+1; - - t2->co1[0] = nodesx[i+gridx+1]; - t2->co1[1] = nodesy[i+gridx+1]; - - t2->oco1[0] = minv[0] + (x+1)*median; - t2->oco1[1] = minv[1] + (y+1)*median; - - t2->co2[0] = t->co2[0]; t2->co2[1] = t->co2[1]; - t2->oco2[0] = t->oco2[0]; t2->oco2[1] = t->oco2[1]; - - t2->co3[0] = t->co3[0]; t2->co3[1] = t->co3[1]; - t2->oco3[0] = t->oco3[0]; t2->oco3[1] = t->oco3[1]; - - *trip = t; trip++; t++; - *trip = t; trip++; t++; - } - } - - MEM_freeN(nodes); - MEM_freeN(nodesx); - MEM_freeN(nodesy); - - arena = BLI_memarena_new(1<<16); - root = p_node_new(arena, tri, esize*2, minv, maxv, 0); - - for (v=chart->verts; v; v=v->nextlink) - if (!p_node_intersect(root, v->uv)) - param_warning("area smoothing error: couldn't find mapping triangle\n"); - - p_node_delete(root); - BLI_memarena_free(arena); - - MEM_freeN(triangles); -} - -/* Exported */ - -ParamHandle *param_construct_begin() -{ - PHandle *handle = MEM_callocN(sizeof*handle, "PHandle"); - handle->construction_chart = p_chart_new(handle); - handle->state = PHANDLE_STATE_ALLOCATED; - handle->arena = BLI_memarena_new((1<<16)); - - handle->hash_verts = phash_new((PHashLink**)&handle->construction_chart->verts, 1); - handle->hash_edges = phash_new((PHashLink**)&handle->construction_chart->edges, 1); - handle->hash_faces = phash_new((PHashLink**)&handle->construction_chart->faces, 1); - - return (ParamHandle*)handle; -} - -void param_delete(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - int i; - - param_assert((phandle->state == PHANDLE_STATE_ALLOCATED) || - (phandle->state == PHANDLE_STATE_CONSTRUCTED)); - - for (i = 0; i < phandle->ncharts; i++) - p_chart_delete(phandle->charts[i]); - - if (phandle->charts) - MEM_freeN(phandle->charts); - - if (phandle->construction_chart) { - p_chart_delete(phandle->construction_chart); - - phash_delete(phandle->hash_verts); - phash_delete(phandle->hash_edges); - phash_delete(phandle->hash_faces); - } - - BLI_memarena_free(phandle->arena); - MEM_freeN(phandle); -} - -void param_face_add(ParamHandle *handle, ParamKey key, int nverts, - ParamKey *vkeys, float **co, float **uv, - ParamBool *pin, ParamBool *select) -{ - PHandle *phandle = (PHandle*)handle; - - param_assert(phash_lookup(phandle->hash_faces, key) == NULL); - param_assert(phandle->state == PHANDLE_STATE_ALLOCATED); - param_assert((nverts == 3) || (nverts == 4)); - - if (nverts == 4) { - if (p_quad_split_direction(phandle, co, vkeys)) { - p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 2, pin, select); - p_face_add_construct(phandle, key, vkeys, co, uv, 0, 2, 3, pin, select); - } - else { - p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 3, pin, select); - p_face_add_construct(phandle, key, vkeys, co, uv, 1, 2, 3, pin, select); - } - } - else - p_face_add_construct(phandle, key, vkeys, co, uv, 0, 1, 2, pin, select); -} - -void param_edge_set_seam(ParamHandle *handle, ParamKey *vkeys) -{ - PHandle *phandle = (PHandle*)handle; - PEdge *e; - - param_assert(phandle->state == PHANDLE_STATE_ALLOCATED); - - e = p_edge_lookup(phandle, vkeys); - if (e) - e->flag |= PEDGE_SEAM; -} - -void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart = phandle->construction_chart; - int i, j, nboundaries = 0; - PEdge *outer; - - param_assert(phandle->state == PHANDLE_STATE_ALLOCATED); - - phandle->ncharts = p_connect_pairs(phandle, impl); - phandle->charts = p_split_charts(phandle, chart, phandle->ncharts); - - p_chart_delete(phandle->construction_chart); - phandle->construction_chart = NULL; - - phash_delete(phandle->hash_verts); - phash_delete(phandle->hash_edges); - phash_delete(phandle->hash_faces); - phandle->hash_verts = phandle->hash_edges = phandle->hash_faces = NULL; - - for (i = j = 0; i < phandle->ncharts; i++) { - PVert *v; - PChart *chart = phandle->charts[i]; - - p_chart_boundaries(chart, &nboundaries, &outer); - - if (nboundaries == 0) { - p_chart_delete(chart); - continue; - } - - phandle->charts[j] = chart; - j++; - - if (fill && (nboundaries > 1)) - p_chart_fill_boundaries(chart, outer); - - for (v=chart->verts; v; v=v->nextlink) - p_vert_load_pin_select_uvs(v); - } - - phandle->ncharts = j; - - phandle->state = PHANDLE_STATE_CONSTRUCTED; -} - -void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf) -{ - PHandle *phandle = (PHandle*)handle; - PFace *f; - int i; - - param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED); - phandle->state = PHANDLE_STATE_LSCM; - - for (i = 0; i < phandle->ncharts; i++) { - for (f=phandle->charts[i]->faces; f; f=f->nextlink) - p_face_backup_uvs(f); - p_chart_lscm_begin(phandle->charts[i], live, abf); - } -} - -void param_lscm_solve(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart; - int i; - PBool result; - - param_assert(phandle->state == PHANDLE_STATE_LSCM); - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - - if (chart->u.lscm.context) { - result = p_chart_lscm_solve(chart); - - if (result && !(chart->flag & PCHART_NOPACK)) - p_chart_rotate_minimum_area(chart); - - if (!result || (chart->u.lscm.pin1)) - p_chart_lscm_end(chart); - } - } -} - -void param_lscm_end(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - int i; - - param_assert(phandle->state == PHANDLE_STATE_LSCM); - - for (i = 0; i < phandle->ncharts; i++) { - p_chart_lscm_end(phandle->charts[i]); -#if 0 - p_chart_complexify(phandle->charts[i]); -#endif - } - - phandle->state = PHANDLE_STATE_CONSTRUCTED; -} - -void param_stretch_begin(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart; - PVert *v; - PFace *f; - int i; - - param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED); - phandle->state = PHANDLE_STATE_STRETCH; - - phandle->rng = rng_new(31415926); - phandle->blend = 0.0f; - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - - for (v=chart->verts; v; v=v->nextlink) - v->flag &= ~PVERT_PIN; /* don't use user-defined pins */ - - p_stretch_pin_boundary(chart); - - for (f=chart->faces; f; f=f->nextlink) { - p_face_backup_uvs(f); - f->u.area3d = p_face_area(f); - } - } -} - -void param_stretch_blend(ParamHandle *handle, float blend) -{ - PHandle *phandle = (PHandle*)handle; - - param_assert(phandle->state == PHANDLE_STATE_STRETCH); - phandle->blend = blend; -} - -void param_stretch_iter(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart; - int i; - - param_assert(phandle->state == PHANDLE_STATE_STRETCH); - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - p_chart_stretch_minimize(chart, phandle->rng); - } -} - -void param_stretch_end(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - - param_assert(phandle->state == PHANDLE_STATE_STRETCH); - phandle->state = PHANDLE_STATE_CONSTRUCTED; - - rng_free(phandle->rng); - phandle->rng = NULL; -} - -void param_smooth_area(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - int i; - - param_assert(phandle->state == PHANDLE_STATE_CONSTRUCTED); - - for (i = 0; i < phandle->ncharts; i++) { - PChart *chart = phandle->charts[i]; - PVert *v; - - for (v=chart->verts; v; v=v->nextlink) - v->flag &= ~PVERT_PIN; - - p_smooth(chart); - } -} - -void param_pack(ParamHandle *handle) -{ - /* box packing variables */ - boxPack *boxarray, *box; - float tot_width, tot_height, scale; - - PChart *chart; - int i, unpacked=0; - float trans[2]; - - PHandle *phandle = (PHandle*)handle; - - - if (phandle->ncharts == 0) - return; - - /* we may not use all these boxes */ - boxarray = MEM_mallocN( phandle->ncharts*sizeof(boxPack), "boxPack box"); - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - - - if (chart->flag & PCHART_NOPACK) { - unpacked++; - continue; - } - - box = boxarray+(i-unpacked); - - p_chart_uv_bbox(chart, trans, chart->u.pack.size); - - trans[0] = -trans[0]; - trans[1] = -trans[1]; - - p_chart_uv_translate(chart, trans); - - box->w = chart->u.pack.size[0] + trans[0]; - box->h = chart->u.pack.size[1] + trans[1]; - box->index = i; /* warning this index skips PCHART_NOPACK boxes */ - } - - boxPack2D(boxarray, phandle->ncharts-unpacked, &tot_width, &tot_height); - - if (tot_height>tot_width) - scale = 1.0/tot_height; - else - scale = 1.0/tot_width; - - for (i = 0; i < phandle->ncharts-unpacked; i++) { - box = boxarray+i; - trans[0] = box->x; - trans[1] = box->y; - - chart = phandle->charts[box->index]; - p_chart_uv_translate(chart, trans); - p_chart_uv_scale(chart, scale); - } - MEM_freeN(boxarray); -} - -void param_flush(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart; - int i; - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - - if ((phandle->state == PHANDLE_STATE_LSCM) && !chart->u.lscm.context) - continue; - - if (phandle->blend == 0.0f) - p_flush_uvs(chart); - else - p_flush_uvs_blend(chart, phandle->blend); - } -} - -void param_flush_restore(ParamHandle *handle) -{ - PHandle *phandle = (PHandle*)handle; - PChart *chart; - PFace *f; - int i; - - for (i = 0; i < phandle->ncharts; i++) { - chart = phandle->charts[i]; - - for (f=chart->faces; f; f=f->nextlink) - p_face_restore_uvs(f); - } -} - diff --git a/source/blender/src/parametrizer.h b/source/blender/src/parametrizer.h deleted file mode 100644 index fcda5fc6164..00000000000 --- a/source/blender/src/parametrizer.h +++ /dev/null @@ -1,85 +0,0 @@ - -#ifndef __PARAMETRIZER_H__ -#define __PARAMETRIZER_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void ParamHandle; /* handle to a set of charts */ -typedef long ParamKey; /* (hash) key for identifying verts and faces */ -typedef enum ParamBool { - PARAM_TRUE = 1, - PARAM_FALSE = 0 -} ParamBool; - -/* Chart construction: - ------------------- - - faces and seams may only be added between construct_{begin|end} - - the pointers to co and uv are stored, rather than being copied - - vertices are implicitly created - - in construct_end the mesh will be split up according to the seams - - the resulting charts must be: - - manifold, connected, open (at least one boundary loop) - - output will be written to the uv pointers -*/ - -ParamHandle *param_construct_begin(); - -void param_face_add(ParamHandle *handle, - ParamKey key, - int nverts, - ParamKey *vkeys, - float **co, - float **uv, - ParamBool *pin, - ParamBool *select); - -void param_edge_set_seam(ParamHandle *handle, - ParamKey *vkeys); - -void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl); -void param_delete(ParamHandle *chart); - -/* Least Squares Conformal Maps: - ----------------------------- - - charts with less than two pinned vertices are assigned 2 pins - - lscm is divided in three steps: - - begin: compute matrix and it's factorization (expensive) - - solve using pinned coordinates (cheap) - - end: clean up - - uv coordinates are allowed to change within begin/end, for - quick re-solving -*/ - -void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf); -void param_lscm_solve(ParamHandle *handle); -void param_lscm_end(ParamHandle *handle); - -/* Stretch */ - -void param_stretch_begin(ParamHandle *handle); -void param_stretch_blend(ParamHandle *handle, float blend); -void param_stretch_iter(ParamHandle *handle); -void param_stretch_end(ParamHandle *handle); - -/* Area Smooth */ - -void param_smooth_area(ParamHandle *handle); - -/* Packing */ - -void param_pack(ParamHandle *handle); - -/* Flushing */ - -void param_flush(ParamHandle *handle); -void param_flush_restore(ParamHandle *handle); - - -#ifdef __cplusplus -} -#endif - -#endif /*__PARAMETRIZER_H__*/ - diff --git a/source/blender/src/parametrizer_intern.h b/source/blender/src/parametrizer_intern.h deleted file mode 100644 index 6114ecc8696..00000000000 --- a/source/blender/src/parametrizer_intern.h +++ /dev/null @@ -1,192 +0,0 @@ - -#ifndef __PARAMETRIZER_INTERN_H__ -#define __PARAMETRIZER_INTERN_H__ - -/* Utils */ - -#if 0 - #define param_assert(condition); - #define param_warning(message); - #define param_test_equals_ptr(condition); - #define param_test_equals_int(condition); -#else - #define param_assert(condition) \ - if (!(condition)) \ - { /*printf("Assertion %s:%d\n", __FILE__, __LINE__); abort();*/ } - #define param_warning(message) \ - { /*printf("Warning %s:%d: %s\n", __FILE__, __LINE__, message);*/ } - #define param_test_equals_ptr(str, a, b) \ - if (a != b) \ - { /*printf("Equals %s => %p != %p\n", str, a, b);*/ }; - #define param_test_equals_int(str, a, b) \ - if (a != b) \ - { /*printf("Equals %s => %d != %d\n", str, a, b);*/ }; -#endif - -typedef enum PBool { - P_TRUE = 1, - P_FALSE = 0 -} PBool; - -/* Special Purpose Hash */ - -typedef long PHashKey; - -typedef struct PHashLink { - struct PHashLink *next; - PHashKey key; -} PHashLink; - -typedef struct PHash { - PHashLink **list; - PHashLink **buckets; - int size, cursize, cursize_id; -} PHash; - - - -struct PVert; -struct PEdge; -struct PFace; -struct PChart; -struct PHandle; - -/* Simplices */ - -typedef struct PVert { - struct PVert *nextlink; - - union PVertUnion { - PHashKey key; /* construct */ - int id; /* abf/lscm matrix index */ - float distortion; /* area smoothing */ - HeapNode *heaplink; /* edge collapsing */ - } u; - - struct PEdge *edge; - float *co; - float uv[2]; - unsigned char flag; - -} PVert; - -typedef struct PEdge { - struct PEdge *nextlink; - - union PEdgeUnion { - PHashKey key; /* construct */ - int id; /* abf matrix index */ - HeapNode *heaplink; /* fill holes */ - struct PEdge *nextcollapse; /* simplification */ - } u; - - struct PVert *vert; - struct PEdge *pair; - struct PEdge *next; - struct PFace *face; - float *orig_uv, old_uv[2]; - unsigned short flag; - -} PEdge; - -typedef struct PFace { - struct PFace *nextlink; - - union PFaceUnion { - PHashKey key; /* construct */ - int chart; /* construct splitting*/ - float area3d; /* stretch */ - int id; /* abf matrix index */ - } u; - - struct PEdge *edge; - unsigned char flag; - -} PFace; - -enum PVertFlag { - PVERT_PIN = 1, - PVERT_SELECT = 2, - PVERT_INTERIOR = 4, - PVERT_COLLAPSE = 8, - PVERT_SPLIT = 16 -}; - -enum PEdgeFlag { - PEDGE_SEAM = 1, - PEDGE_VERTEX_SPLIT = 2, - PEDGE_PIN = 4, - PEDGE_SELECT = 8, - PEDGE_DONE = 16, - PEDGE_FILLED = 32, - PEDGE_COLLAPSE = 64, - PEDGE_COLLAPSE_EDGE = 128, - PEDGE_COLLAPSE_PAIR = 256 -}; - -/* for flipping faces */ -#define PEDGE_VERTEX_FLAGS (PEDGE_PIN) - -enum PFaceFlag { - PFACE_CONNECTED = 1, - PFACE_FILLED = 2, - PFACE_COLLAPSE = 4 -}; - -/* Chart */ - -typedef struct PChart { - PVert *verts; - PEdge *edges; - PFace *faces; - int nverts, nedges, nfaces; - - PVert *collapsed_verts; - PEdge *collapsed_edges; - PFace *collapsed_faces; - - union PChartUnion { - struct PChartLscm { - NLContext context; - float *abf_alpha; - PVert *pin1, *pin2; - } lscm; - struct PChartPack { - float rescale, area; - float size[2], trans[2]; - } pack; - } u; - - unsigned char flag; - struct PHandle *handle; -} PChart; - -enum PChartFlag { - PCHART_NOPACK = 1 -}; - -enum PHandleState { - PHANDLE_STATE_ALLOCATED, - PHANDLE_STATE_CONSTRUCTED, - PHANDLE_STATE_LSCM, - PHANDLE_STATE_STRETCH -}; - -typedef struct PHandle { - enum PHandleState state; - MemArena *arena; - - PChart *construction_chart; - PHash *hash_verts; - PHash *hash_edges; - PHash *hash_faces; - - PChart **charts; - int ncharts; - - RNG *rng; - float blend; -} PHandle; - -#endif /*__PARAMETRIZER_INTERN_H__*/ - diff --git a/source/blender/src/playanim.c b/source/blender/src/playanim.c deleted file mode 100644 index e94366571db..00000000000 --- a/source/blender/src/playanim.c +++ /dev/null @@ -1,813 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#include -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" - -#ifdef WITH_QUICKTIME -#ifdef _WIN32 -#include -#include -#elif defined(__APPLE__) -#include -#endif /* __APPLE__ */ -#endif /* WITH_QUICKTIME */ - -#include "PIL_time.h" - -#include - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "BDR_editcurve.h" - -#include "BKE_blender.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_screen.h" -#include "BIF_mywindow.h" - -#include "BMF_Api.h" - -#include "playanim_ext.h" -#include "mydevice.h" -#include "blendef.h" -#include "winlay.h" - -/* ***************** gl_util.c ****************** */ - -static Window *g_window = NULL; -static int qualN = 0; - -#define LSHIFT (1<<0) -#define RSHIFT (1<<1) -#define SHIFT (LSHIFT | RSHIFT) -#define LALT (1<<2) -#define RALT (1<<3) -#define ALT (LALT | RALT) -#define LCTRL (1<<4) -#define RCTRL (1<<5) -#define LMOUSE (1<<16) -#define MMOUSE (1<<17) -#define RMOUSE (1<<18) -#define MOUSE (LMOUSE | MMOUSE | RMOUSE) - -unsigned short screen_qread(short *val, char *ascii); - -/* implementation */ -static int qreadN(short *val) -{ - char ascii; - int event = screen_qread(val, &ascii); - - switch(event){ - case LEFTMOUSE: - if (*val) qualN |= LMOUSE; - else qualN &= ~LMOUSE; - break; - case MIDDLEMOUSE: - if (*val) qualN |= MMOUSE; - else qualN &= ~MMOUSE; - break; - case RIGHTMOUSE: - if (*val) qualN |= RMOUSE; - else qualN &= ~RMOUSE; - break; - case LEFTSHIFTKEY: - if (*val) qualN |= LSHIFT; - else qualN &= ~LSHIFT; - break; - case RIGHTSHIFTKEY: - if (*val) qualN |= RSHIFT; - else qualN &= ~RSHIFT; - break; - case LEFTCTRLKEY: - if (*val) qualN |= LCTRL; - else qualN &= ~LCTRL; - break; - case RIGHTCTRLKEY: - if (*val) qualN |= RCTRL; - else qualN &= ~RCTRL; - break; - case LEFTALTKEY: - if (*val) qualN |= LALT; - else qualN &= ~LALT; - break; - case RIGHTALTKEY: - if (*val) qualN |= RALT; - else qualN &= ~RALT; - break; - } - - return(event); -} - -/* ***************** gl_util.c ****************** */ - - - - -typedef struct pict{ - struct pict *next, *prev; - char *mem; - int size; - char *name; - struct ImBuf *ibuf; - struct anim *anim; - int frame; - int IB_flags; -}Pict; - -static struct ListBase _picsbase = {0,0}; -static struct ListBase *picsbase = &_picsbase; -static int fromdisk = FALSE; -static float zoomx = 1.0 , zoomy = 1.0; -static double ptottime = 0.0, swaptime = 0.04; - -static int pupdate_time(void) -{ - static double ltime; - double time; - - time = PIL_check_seconds_timer(); - - ptottime += (time - ltime); - ltime = time; - return (ptottime < 0); -} - -static void toscreen(Pict *picture, struct ImBuf *ibuf) -{ - - if (ibuf == 0){ - printf("no ibuf !\n"); - return; - } - - glRasterPos2f(0.0f, 0.0f); - - glDrawPixels(ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - - pupdate_time(); - - if(picture && (qualN & (SHIFT|LMOUSE))) { - char str[256]; - cpack(-1); - glRasterPos2f(0.02f, 0.03f); - sprintf(str, "%s | %.2f frames/s\n", picture->name, 1.0 / swaptime); - BMF_DrawString(G.fonts, str); - } - - window_swap_buffers(g_window); -} - -static void build_pict_list(char * first) -{ - int size,pic,file; - char *mem, name[256]; - short val; - struct pict * picture = 0; - struct ImBuf *ibuf = 0; - int count = 0; - char str[100]; - struct anim * anim; - - if (IMB_isanim(first)) { - anim = IMB_open_anim(first, IB_rect); - if (anim) { - ibuf = IMB_anim_absolute(anim, 0); - if (ibuf) { - toscreen(NULL, ibuf); - IMB_freeImBuf(ibuf); - } - - for (pic = 0; pic < IMB_anim_get_duration(anim); pic ++) { - picture = (Pict*)MEM_callocN(sizeof(Pict),"Pict"); - picture->anim = anim; - picture->frame = pic; - picture->IB_flags = IB_rect; - sprintf(str, "%s : %d", first, pic + 1); - picture->name = strdup(str); - BLI_addtail(picsbase, picture); - } - } - else printf("couldn't open anim %s\n", first); - } - else { - - strcpy(name,first); - - pupdate_time(); - ptottime = 1.0; - -/* - O_DIRECT - If set, all reads and writes on the resulting file descriptor will - be performed directly to or from the user program buffer, provided - appropriate size and alignment restrictions are met. Refer to the - F_SETFL and F_DIOINFO commands in the fcntl(2) manual entry for - information about how to determine the alignment constraints. - O_DIRECT is a Silicon Graphics extension and is only supported on - local EFS and XFS file systems. -*/ - while(IMB_ispic(name)){ - file = open(name, O_BINARY|O_RDONLY, 0); - if (file < 0) return; - picture = (struct pict*)MEM_callocN(sizeof(struct pict), "picture"); - if (picture == 0){ - printf("Not enough memory for pict struct \n"); - close(file); - return; - } - size = BLI_filesize(file); - - if (size < 1) { - close(file); - MEM_freeN(picture); - return; - } - - picture->size = size; - picture->IB_flags = IB_rect; - - if (fromdisk == FALSE) { - mem=(char *)MEM_mallocN(size, "build pic list"); - if (mem==0){ - printf("Couldn't get memory\n"); - close(file); - MEM_freeN(picture); - return; - } - - if (read(file,mem,size) != size){ - printf("Error while reading %s\n",name); - close(file); - MEM_freeN(picture); - MEM_freeN(mem); - return; - } - } else mem = 0; - - picture->mem = mem; - picture->name = strdup(name); - close(file); - BLI_addtail(picsbase,picture); - count++; - - pupdate_time(); - - if (ptottime > 1.0) { - if (picture->mem) ibuf = IMB_ibImageFromMemory((int *) picture->mem, picture->size, picture->IB_flags); - else ibuf = IMB_loadiffname(picture->name, picture->IB_flags); - if (ibuf) { - toscreen(picture, ibuf); - IMB_freeImBuf(ibuf); - } - pupdate_time(); - ptottime = 0.0; - } - - BLI_newname(name, +1); - - while(qtest()){ - switch(qreadN(&val)){ - case ESCKEY: - if (val) return; - break; - } - } - } - } - return; -} - -void playanim(int argc, char **argv) -{ - struct ImBuf *ibuf = 0; - struct pict *picture = 0; - char name[256]; - short val = 0, go = TRUE, ibufx = 0, ibufy = 0; - int event, stopped = FALSE, maxwinx, maxwiny; - short /* c233 = FALSE, */ /* yuvx = FALSE, */ once = FALSE, sstep = FALSE, wait2 = FALSE, /* resetmap = FALSE, */ pause = 0; - short pingpong = FALSE, direction = 1, next = 1, turbo = FALSE, /* doubleb = TRUE, */ noskip = FALSE; - int sizex, sizey, ofsx, ofsy, i; - /* This was done to disambiguate the name for use under c++. */ - struct anim * anim = 0; - int start_x= 0, start_y= 0; - - while (argc > 1) { - if (argv[1][0] == '-'){ - switch(argv[1][1]) { - case 'm': - fromdisk = TRUE; - break; - case 'p': - if (argc>3) { - start_x= atoi(argv[2]); - start_y= atoi(argv[3]); - argc-= 2; - argv+= 2; - } else { - printf("too few arguments for -p (need 2): skipping\n"); - } - break; - case 'f': - if (argc>3) { - double fps = atof(argv[2]); - double fps_base= atof(argv[3]); - if (fps == 0) { - fps = 1; - printf("invalid fps," - "forcing 1\n"); - } - swaptime = fps_base / fps; - argc-= 2; - argv+= 2; - } else { - printf("too few arguments for -f (need 2): skipping\n"); - } - break; - default: - printf("unknown option '%c': skipping\n", argv[1][1]); - break; - } - argc--; - argv++; - } else break; - } - -#ifdef WITH_QUICKTIME -#if defined (_WIN32) || defined (__APPLE__) - /* Initialize QuickTime */ -#ifndef noErr -#define noErr 0 -#endif - -#ifdef _WIN32 - if (InitializeQTML(0) != noErr) - G.have_quicktime = FALSE; - else - G.have_quicktime = TRUE; -#endif /* _WIN32 */ - if (EnterMovies() != noErr) - G.have_quicktime = FALSE; - else -#endif /* _WIN32 || __APPLE__ */ - G.have_quicktime = TRUE; -#endif /* WITH_QUICKTIME */ - - if (argc > 1) strcpy(name,argv[1]); - else { - BLI_getwdN(name); - if (name[strlen(name)-1] != '/') strcat(name,"/"); - } - - if (IMB_isanim(name)) { - anim = IMB_open_anim(name, IB_rect); - if (anim) { - ibuf = IMB_anim_absolute(anim, 0); - IMB_close_anim(anim); - anim = NULL; - } - } else if (!IMB_ispic(name)) { - exit(1); - } - - if (ibuf == 0) ibuf = IMB_loadiffname(name, IB_rect); - if (ibuf == 0){ - printf("couldn't open %s\n",name); - exit(1); - } - - #if !defined(WIN32) && !defined(__APPLE__) - if (fork()) exit(0); - #endif - - winlay_get_screensize(&maxwinx, &maxwiny); - - /* XXX, fixme zr */ - { - extern void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii); - - g_window = window_open("Blender:Anim", start_x, start_y, ibuf->x, ibuf->y, 0); - window_set_handler(g_window, add_to_mainqueue, NULL); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); - } - - G.fonts= BMF_GetFont(BMF_kHelvetica10); - - ibufx = ibuf->x; - ibufy = ibuf->y; - - if (maxwinx % ibuf->x) maxwinx = ibuf->x * (1 + (maxwinx / ibuf->x)); - if (maxwiny % ibuf->y) maxwiny = ibuf->y * (1 + (maxwiny / ibuf->y)); - - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - window_swap_buffers(g_window); - - build_pict_list(name); - - for (i = 2; i < argc; i++){ - strcpy(name, argv[i]); - build_pict_list(name); - } - - IMB_freeImBuf(ibuf); - ibuf = 0; - - pupdate_time(); - ptottime = 0; - - while (go){ - if (pingpong) direction = -direction; - - if (direction == 1) picture = picsbase->first; - else picture = picsbase->last; - - if (picture == 0){ - printf("couldn't find pictures\n"); - go = FALSE; - } - if (pingpong){ - if (direction == 1) picture = picture->next; - else picture = picture->prev; - } - if (ptottime > 0.0) ptottime = 0.0; - - while (picture){ - if (ibuf != 0 && ibuf->type == 0) IMB_freeImBuf(ibuf); - - if (picture->ibuf) ibuf = picture->ibuf; - else if (picture->anim) ibuf = IMB_anim_absolute(picture->anim, picture->frame); - else if (picture->mem) ibuf = IMB_ibImageFromMemory((int *) picture->mem, picture->size, picture->IB_flags); - else ibuf = IMB_loadiffname(picture->name, picture->IB_flags); - - if (ibuf){ - strcpy(ibuf->name, picture->name); - -#ifdef _WIN32 - window_set_title(g_window, picture->name); -#endif - - while (pupdate_time()) PIL_sleep_ms(1); - ptottime -= swaptime; - toscreen(picture, ibuf); - } /* else deleten */ - else { - printf("error: can't play this image type\n"); - exit(0); - } - - if (once){ - if (picture->next == 0) wait2 = TRUE; - else if (picture->prev == 0) wait2 = TRUE; - } - - next = direction; - - while ((qtest() != 0 ) || ( wait2 != 0)){ - if (wait2 && stopped) { - stopped = FALSE; - } - - event = qreadN(&val); - /* printf("%d %d\n", event, val); */ - - if (wait2){ - pupdate_time(); - ptottime = 0; - } - switch (event){ - case AKEY: - if (val) - noskip = !noskip; - break; - case PKEY: - if (val) - pingpong = !pingpong; - break; - case SLASHKEY: - if (val) { - if (qualN & SHIFT) { - if (ibuf) - printf(" Name: %s | Speed: %.2f frames/s\n", ibuf->name, 1.0 / swaptime); - } else { - swaptime = 1.0 / 5.0; - } - } - break; - case LEFTARROWKEY: - if (val){ - sstep = TRUE; - wait2 = FALSE; - if (qualN & SHIFT) { - picture = picsbase->first; - next = 0; - } else { - next = -1; - } - } - break; - case DOWNARROWKEY: - if (val){ - wait2 = FALSE; - if (qualN & SHIFT) { - next = direction = -1; - } else { - next = -10; - sstep = TRUE; - } - } - break; - case RIGHTARROWKEY: - if (val){ - sstep = TRUE; - wait2 = FALSE; - if (qualN & SHIFT) { - picture = picsbase->last; - next = 0; - } else { - next = 1; - } - } - break; - case UPARROWKEY: - if (val){ - wait2 = FALSE; - if (qualN & SHIFT) { - next = direction = 1; - } else { - next = 10; - sstep = TRUE; - } - } - break; - case LEFTMOUSE: - case MOUSEX: - if (qualN & LMOUSE) { - window_get_size(g_window,&sizex,&sizey); - picture = picsbase->first; - i = 0; - while (picture){ - i ++; - picture = picture->next; - } - i = (i * val) / sizex; - picture = picsbase->first; - for (; i > 0; i--){ - if (picture->next == 0) break; - picture = picture->next; - } - sstep = TRUE; - wait2 = FALSE; - next = 0; - } - break; - go= FALSE; - break; - case EQUALKEY: - if (val) { - if (qualN & SHIFT) { - pause ++; - printf("pause:%d\n", pause); - } else swaptime /= 1.1; - } - break; - case MINUSKEY: - if (val) { - if (qualN & SHIFT) { - pause --; - printf("pause:%d\n", pause); - } else swaptime *= 1.1; - } - break; - case PAD0: - if (val){ - if (once) once = wait2 = FALSE; - else { - picture = 0; - once = TRUE; - wait2 = FALSE; - } - } - break; - case RETKEY: - case PADENTER: - if (val){ - wait2 = sstep = FALSE; - } - break; - case PADPERIOD: - if (val){ - if (sstep) wait2 = FALSE; - else { - sstep = TRUE; - wait2 = !wait2; - } - } - break; - case PAD1: - swaptime = 1.0 / 60.0; - break; - case PAD2: - swaptime = 1.0 / 50.0; - break; - case PAD3: - swaptime = 1.0 / 30.0; - break; - case PAD4: - if (qualN & SHIFT) - swaptime = 1.0 / 24.0; - else - swaptime = 1.0 / 25.0; - break; - case PAD5: - swaptime = 1.0 / 20.0; - break; - case PAD6: - swaptime = 1.0 / 15.0; - break; - case PAD7: - swaptime = 1.0 / 12.0; - break; - case PAD8: - swaptime = 1.0 / 10.0; - break; - case PAD9: - swaptime = 1.0 / 6.0; - break; - case PADPLUSKEY: - if (val == 0) break; - zoomx += 2.0; - zoomy += 2.0; - case PADMINUS: - if (val == 0) break; - if (zoomx > 1.0) zoomx -= 1.0; - if (zoomy > 1.0) zoomy -= 1.0; - window_get_position(g_window,&ofsx,&ofsy); - window_get_size(g_window,&sizex,&sizey); - ofsx += sizex/2; - ofsy += sizey/2; - sizex = zoomx * ibufx; - sizey = zoomy * ibufy; - ofsx -= sizex/2; - ofsy -= sizey/2; -/* window_set_position(g_window,sizex,sizey); */ - window_set_size(g_window,sizex,sizey); - break; - case RESHAPE: - case REDRAW: - window_get_size(g_window,&sizex,&sizey); - window_make_active(g_window); - - glViewport(0, 0, sizex, sizey); - glScissor(0, 0, sizex, sizey); - - zoomx = (float) sizex / ibufx; - zoomy = (float) sizey / ibufy; - zoomx = floor(zoomx + 0.5); - zoomy = floor(zoomy + 0.5); - if (zoomx < 1.0) zoomx = 1.0; - if (zoomy < 1.0) zoomy = 1.0; - - sizex = zoomx * ibufx; - sizey = zoomy * ibufy; - - glPixelZoom(zoomx, zoomy); - glEnable(GL_DITHER); - ptottime = 0.0; - toscreen(picture, ibuf); - while (qtest()) qreadN(&val); - - break; - case ESCKEY: - case WINCLOSE: - case WINQUIT: - go = FALSE; - break; - } - if (go == FALSE) break; - } - - wait2 = sstep; - - if (wait2 == 0 && stopped == 0) { - stopped = TRUE; - } - - pupdate_time(); - - if (picture && next) { - /* always at least set one step */ - while (picture){ - if (next < 0) picture = picture->prev; - else picture = picture->next; - - if (once && picture != 0){ - if (picture->next == 0) wait2 = TRUE; - else if (picture->prev == 0) wait2 = TRUE; - } - - if (wait2 || ptottime < swaptime || turbo || noskip) break; - ptottime -= swaptime; - } - if (picture == 0 && sstep) { - if (next < 0) picture = picsbase->last; - else if (next > 0) picture = picsbase->first; - } - } - if (go == FALSE) break; - } - } - picture = picsbase->first; - anim = NULL; - while (picture) { - if (picture && picture->anim && (anim != picture->anim)) { - // to prevent divx crashes - anim = picture->anim; - IMB_close_anim(anim); - } - if(picture->ibuf) IMB_freeImBuf(picture->ibuf); - if(picture->mem) MEM_freeN(picture->mem); - - picture = picture->next; - } -#ifdef WITH_QUICKTIME -#if defined (_WIN32) || defined (__APPLE__) - if(G.have_quicktime) { - ExitMovies(); -#ifdef _WIN32 - TerminateQTML(); -#endif /* _WIN32 */ - } -#endif /* _WIN32 || __APPLE__ */ -#endif /* WITH_QUICKTIME */ - - /* cleanup */ - if(ibuf) IMB_freeImBuf(ibuf); - BLI_freelistN(picsbase); - free_blender(); - window_destroy(g_window); - - if(totblock!=0) { - printf("Error Totblock: %d\n",totblock); - MEM_printmemlist(); - } -} diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c deleted file mode 100644 index 585ff320b71..00000000000 --- a/source/blender/src/poseobject.c +++ /dev/null @@ -1,1258 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Ton Roosendaal, Blender Foundation '05, full recode. - * - * ***** END GPL LICENSE BLOCK ***** - * support for animation modes - Reevan McKay - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_blender.h" -#include "BKE_constraint.h" -#include "BKE_deform.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" -#include "BKE_ipo.h" - -#include "BIF_editarmature.h" -#include "BIF_editaction.h" -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_interface.h" -#include "BIF_poseobject.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_screen.h" - -#include "BDR_editobject.h" - -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_trans_types.h" - -#include "mydevice.h" -#include "blendef.h" -#include "transform.h" - -#include "BIF_transform.h" /* for autokey TFM_TRANSLATION, etc */ - -void enter_posemode(void) -{ - Base *base; - Object *ob; - bArmature *arm; - - if(G.scene->id.lib) return; - base= BASACT; - if(base==NULL) return; - - ob= base->object; - - if (ob->id.lib){ - error ("Can't pose libdata"); - return; - } - - switch (ob->type){ - case OB_ARMATURE: - arm= get_armature(ob); - if( arm==NULL ) return; - - ob->flag |= OB_POSEMODE; - base->flag= ob->flag; - - allqueue(REDRAWHEADERS, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWVIEW3D, 0); - break; - default: - return; - } - - if (G.obedit) exit_editmode(EM_FREEDATA|EM_WAITCURSOR); - G.f &= ~(G_VERTEXPAINT | G_TEXTUREPAINT | G_WEIGHTPAINT); -} - -void set_pose_keys (Object *ob) -{ - bArmature *arm= ob->data; - bPoseChannel *chan; - - if (ob->pose){ - for (chan=ob->pose->chanbase.first; chan; chan=chan->next){ - Bone *bone= chan->bone; - if(bone && (bone->flag & BONE_SELECTED) && (arm->layer & bone->layer)) { - chan->flag |= POSE_KEY; - } - else { - chan->flag &= ~POSE_KEY; - } - } - } -} - - -void exit_posemode(void) -{ - Object *ob= OBACT; - Base *base= BASACT; - - if(ob==NULL) return; - - ob->flag &= ~OB_POSEMODE; - base->flag= ob->flag; - - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWHEADERS, 0); - allqueue(REDRAWBUTSALL, 0); - - scrarea_queue_headredraw(curarea); -} - -/* called by buttons to find a bone to display/edit values for */ -bPoseChannel *get_active_posechannel (Object *ob) -{ - bArmature *arm= ob->data; - bPoseChannel *pchan; - - /* find active */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone && (pchan->bone->flag & BONE_ACTIVE) && (pchan->bone->layer & arm->layer)) - return pchan; - } - - return NULL; -} - -/* if a selected or active bone is protected, throw error and return 1 */ -/* only_selected==1 : the active bone is allowed to be protected */ -static int pose_has_protected_selected(Object *ob, int only_selected) -{ - - /* check protection */ - if(ob->proxy) { - bPoseChannel *pchan; - bArmature *arm= ob->data; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone && (pchan->bone->layer & arm->layer)) { - if(pchan->bone->layer & arm->layer_protected) { - if(only_selected && (pchan->bone->flag & BONE_ACTIVE)); - else if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) - break; - } - } - } - if(pchan) { - error("Cannot change Proxy protected bones"); - return 1; - } - } - return 0; -} - -/* only for real IK, not for auto-IK */ -int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan) -{ - bConstraint *con; - Bone *bone; - - for(con= pchan->constraints.first; con; con= con->next) { - if(con->type==CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data= con->data; - if((data->flag & CONSTRAINT_IK_AUTO)==0) - return 1; - } - } - for(bone= pchan->bone->childbase.first; bone; bone= bone->next) { - pchan= get_pose_channel(ob->pose, bone->name); - if(pchan && pose_channel_in_IK_chain(ob, pchan)) - return 1; - } - return 0; -} - -/* ********************************************** */ - -/* For the object with pose/action: create path curves for selected bones - * This recalculates the WHOLE path within the pchan->pathsf and pchan->pathef range - */ -void pose_calculate_path(Object *ob) -{ - bArmature *arm; - bPoseChannel *pchan; - Base *base; - float *fp; - int cfra; - int sfra, efra; - - if (ob==NULL || ob->pose==NULL) - return; - arm= ob->data; - - /* version patch for older files here (do_versions patch too complicated) */ - if ((arm->pathsf == 0) || (arm->pathef == 0)) { - arm->pathsf = SFRA; - arm->pathef = EFRA; - } - if (arm->pathsize == 0) { - arm->pathsize = 1; - } - - /* set frame values */ - cfra= CFRA; - sfra = arm->pathsf; - efra = arm->pathef; - if (efra <= sfra) { - error("Can't calculate paths when pathlen <= 0"); - return; - } - - waitcursor(1); - - /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */ - if ((ob->recalc & OB_RECALC)==0) { - ob->recalc |= OB_RECALC; - DAG_object_update_flags(G.scene, ob, screen_view3d_layers()); - } - else - DAG_object_update_flags(G.scene, ob, screen_view3d_layers()); - - - /* malloc the path blocks */ - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) { - if (arm->layer & pchan->bone->layer) { - pchan->pathlen= efra-sfra+1; - pchan->pathsf= sfra; - pchan->pathef= efra+1; - if (pchan->path) - MEM_freeN(pchan->path); - pchan->path= MEM_callocN(3*pchan->pathlen*sizeof(float), "pchan path"); - } - } - } - - for (CFRA=sfra; CFRA<=efra; CFRA++) { - /* do all updates */ - for (base= FIRSTBASE; base; base= base->next) { - if (base->object->recalc) { - int temp= base->object->recalc; - object_handle_update(base->object); - base->object->recalc= temp; - } - } - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) { - if (arm->layer & pchan->bone->layer) { - if (pchan->path) { - fp= pchan->path+3*(CFRA-sfra); - - if (arm->pathflag & ARM_PATH_HEADS) { - VECCOPY(fp, pchan->pose_head); - } - else { - VECCOPY(fp, pchan->pose_tail); - } - - Mat4MulVecfl(ob->obmat, fp); - } - } - } - } - } - - waitcursor(0); - - CFRA= cfra; - allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */ - allqueue(REDRAWBUTSEDIT, 0); -} - -/* For the object with pose/action: update paths for those that have got them - * This should selectively update paths that exist... - */ -void pose_recalculate_paths(Object *ob) -{ - bArmature *arm; - bPoseChannel *pchan; - Base *base; - float *fp; - int cfra; - int sfra, efra; - - if (ob==NULL || ob->pose==NULL) - return; - arm= ob->data; - - /* set frame values */ - cfra = CFRA; - sfra = efra = cfra; - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (arm->layer & pchan->bone->layer)) { - if (pchan->path) { - /* if the pathsf and pathef aren't initialised, abort! */ - if (ELEM(0, pchan->pathsf, pchan->pathef)) - return; - - /* try to increase area to do (only as much as needed) */ - sfra= MIN2(sfra, pchan->pathsf); - efra= MAX2(efra, pchan->pathef); - } - } - } - if (efra <= sfra) return; - - waitcursor(1); - - /* hack: for unsaved files, set OB_RECALC so that paths can get calculated */ - if ((ob->recalc & OB_RECALC)==0) { - ob->recalc |= OB_RECALC; - DAG_object_update_flags(G.scene, ob, screen_view3d_layers()); - } - else - DAG_object_update_flags(G.scene, ob, screen_view3d_layers()); - - for (CFRA=sfra; CFRA<=efra; CFRA++) { - /* do all updates */ - for (base= FIRSTBASE; base; base= base->next) { - if (base->object->recalc) { - int temp= base->object->recalc; - object_handle_update(base->object); - base->object->recalc= temp; - } - } - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (arm->layer & pchan->bone->layer)) { - if (pchan->path) { - /* only update if: - * - in range of this pchan's existing path - * - ... insert evil filtering/optimising conditions here... - */ - if (IN_RANGE(CFRA, pchan->pathsf, pchan->pathef)) { - fp= pchan->path+3*(CFRA-sfra); - - if (arm->pathflag & ARM_PATH_HEADS) { - VECCOPY(fp, pchan->pose_head); - } - else { - VECCOPY(fp, pchan->pose_tail); - } - - Mat4MulVecfl(ob->obmat, fp); - } - } - } - } - } - - waitcursor(0); - - CFRA= cfra; - allqueue(REDRAWVIEW3D, 0); /* recalc tags are still there */ - allqueue(REDRAWBUTSEDIT, 0); -} - -/* for the object with pose/action: clear path curves for selected bones only */ -void pose_clear_paths(Object *ob) -{ - bPoseChannel *pchan; - - if (ob==NULL || ob->pose==NULL) - return; - - /* free the path blocks */ - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) { - if (pchan->path) { - MEM_freeN(pchan->path); - pchan->path= NULL; - } - } - } - - allqueue(REDRAWVIEW3D, 0); -} - - - -void pose_select_constraint_target(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - bPoseChannel *pchan; - bConstraint *con; - - /* paranoia checks */ - if (!ob && !ob->pose) return; - if (ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (arm->layer & pchan->bone->layer) { - if (pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { - for (con= pchan->constraints.first; con; con= con->next) { - bConstraintTypeInfo *cti= constraint_get_typeinfo(con); - ListBase targets = {NULL, NULL}; - bConstraintTarget *ct; - - if (cti && cti->get_constraint_targets) { - cti->get_constraint_targets(con, &targets); - - for (ct= targets.first; ct; ct= ct->next) { - if ((ct->tar == ob) && (ct->subtarget[0])) { - bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget); - if(pchanc) - pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; - } - } - - if (cti->flush_constraint_targets) - cti->flush_constraint_targets(con, &targets, 1); - } - } - } - } - } - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - BIF_undo_push("Select constraint target"); - -} - -/* context: active channel */ -void pose_special_editmenu(void) -{ - Object *ob= OBACT; - short nr; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - nr= pupmenu("Specials%t|Select Constraint Target%x1|Flip Left-Right Names%x2|Calculate Paths%x3|Clear Paths%x4|Clear User Transform %x5|Relax Pose %x6"); - if(nr==1) { - pose_select_constraint_target(); - } - else if(nr==2) { - pose_flip_names(); - } - else if(nr==3) { - pose_calculate_path(ob); - } - else if(nr==4) { - pose_clear_paths(ob); - } - else if(nr==5) { - rest_pose(ob->pose); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Clear User Transform Pose"); - } - else if(nr==6) { - pose_relax(); - } -} - -void pose_add_IK(void) -{ - Object *ob= OBACT; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - add_constraint(1); /* 1 means only IK */ -} - -/* context: all selected channels */ -void pose_clear_IK(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - bPoseChannel *pchan; - bConstraint *con; - bConstraint *next; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - if(pose_has_protected_selected(ob, 0)) - return; - - if(okee("Remove IK constraint(s)")==0) return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { - - for(con= pchan->constraints.first; con; con= next) { - next= con->next; - if(con->type==CONSTRAINT_TYPE_KINEMATIC) { - BLI_remlink(&pchan->constraints, con); - free_constraint_data(con); - MEM_freeN(con); - } - } - pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET); - } - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - BIF_undo_push("Remove IK constraint(s)"); -} - -void pose_clear_constraints(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - bPoseChannel *pchan; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - if(pose_has_protected_selected(ob, 0)) - return; - - if(okee("Remove Constraints")==0) return; - - /* find active */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { - free_constraints(&pchan->constraints); - pchan->constflag= 0; - } - } - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - BIF_undo_push("Remove Constraint(s)"); - -} - - -void pose_copy_menu(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - bPoseChannel *pchan, *pchanact; - short nr; - int i=0; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - /* find active */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->flag & BONE_ACTIVE) break; - } - - if(pchan==NULL) return; - - if(pose_has_protected_selected(ob, 1)) - return; - - pchanact= pchan; - - i= BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ - if (i<25) - nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|Constraints...%x5|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); - else - nr= pupmenu("Copy Pose Attributes %t|Local Location%x1|Local Rotation%x2|Local Size%x3|%l|Visual Location %x9|Visual Rotation%x10|Visual Size%x11|%l|Constraints (All)%x4|%l|Transform Locks%x6|IK Limits%x7|Bone Shape%x8"); - - if(nr==-1) return; - if(nr!=5) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if( (arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan!=pchanact) - ) { - switch (nr) { - case 1: /* Local Location */ - VECCOPY(pchan->loc, pchanact->loc); - break; - case 2: /* Local Rotation */ - QUATCOPY(pchan->quat, pchanact->quat); - break; - case 3: /* Local Size */ - VECCOPY(pchan->size, pchanact->size); - break; - case 4: /* All Constraints */ - { - free_constraints(&pchan->constraints); - copy_constraints(&pchan->constraints, &pchanact->constraints); - pchan->constflag = pchanact->constflag; - } - break; - case 6: /* Transform Locks */ - pchan->protectflag = pchanact->protectflag; - break; - case 7: /* IK (DOF) settings */ - { - pchan->ikflag = pchanact->ikflag; - VECCOPY(pchan->limitmin, pchanact->limitmin); - VECCOPY(pchan->limitmax, pchanact->limitmax); - VECCOPY(pchan->stiffness, pchanact->stiffness); - pchan->ikstretch= pchanact->ikstretch; - } - break; - case 8: /* Custom Bone Shape */ - pchan->custom = pchanact->custom; - break; - case 9: /* Visual Location */ - armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc); - break; - case 10: /* Visual Rotation */ - { - float delta_mat[4][4], quat[4]; - - armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - Mat4ToQuat(delta_mat, quat); - QUATCOPY(pchan->quat, quat); - } - break; - case 11: /* Visual Size */ - { - float delta_mat[4][4], size[4]; - - armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - Mat4ToSize(delta_mat, size); - VECCOPY(pchan->size, size); - } - } - } - } - } else { /* constraints, optional */ - bConstraint *con, *con_back; - int const_toggle[24]; - ListBase const_copy={0, 0}; - - duplicatelist (&const_copy, &(pchanact->constraints)); - - /* build the puplist of constraints */ - for (con = pchanact->constraints.first, i=0; con; con=con->next, i++){ - const_toggle[i]= 1; - add_numbut(i, TOG|INT, con->name, 0, 0, &(const_toggle[i]), ""); - } - - if (!do_clever_numbuts("Select Constraints", i, REDRAW)) { - BLI_freelistN(&const_copy); - return; - } - - /* now build a new listbase from the options selected */ - for (i=0, con=const_copy.first; con; i++) { - if (!const_toggle[i]) { - con_back= con->next; - BLI_freelinkN(&const_copy, con); - con= con_back; - } else { - con= con->next; - } - } - - /* Copy the temo listbase to the selected posebones */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if( (arm->layer & pchan->bone->layer) && - (pchan->bone->flag & BONE_SELECTED) && - (pchan!=pchanact) - ) { - free_constraints(&pchan->constraints); - copy_constraints(&pchan->constraints, &const_copy); - pchan->constflag = pchanact->constflag; - } - } - BLI_freelistN(&const_copy); - update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */ - } - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations - - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); - allqueue (REDRAWOOPS, 0); - - BIF_undo_push("Copy Pose Attributes"); - -} - -/* ******************** copy/paste pose ********************** */ - -static bPose *g_posebuf=NULL; - -void free_posebuf(void) -{ - if (g_posebuf) { - // was copied without constraints - BLI_freelistN (&g_posebuf->chanbase); - MEM_freeN (g_posebuf); - } - g_posebuf=NULL; -} - -void copy_posebuf (void) -{ - Object *ob= OBACT; - - if (!ob || !ob->pose){ - error ("No Pose"); - return; - } - - free_posebuf(); - - set_pose_keys(ob); // sets chan->flag to POSE_KEY if bone selected - copy_pose(&g_posebuf, ob->pose, 0); - -} - -void paste_posebuf (int flip) -{ - Object *ob= OBACT; - bPoseChannel *chan, *pchan; - float eul[4]; - char name[32]; - - if (!ob || !ob->pose) - return; - - if (!g_posebuf){ - error ("Copy buffer is empty"); - return; - } - - /* - // disabled until protected bones in proxies follow the rules everywhere else! - if(pose_has_protected_selected(ob, 1)) - return; - */ - - /* Safely merge all of the channels in this pose into - any existing pose */ - for (chan=g_posebuf->chanbase.first; chan; chan=chan->next) { - if (chan->flag & POSE_KEY) { - BLI_strncpy(name, chan->name, sizeof(name)); - if (flip) - bone_flip_name (name, 0); // 0 = don't strip off number extensions - - /* only copy when channel exists, poses are not meant to add random channels to anymore */ - pchan= get_pose_channel(ob->pose, name); - - if (pchan) { - /* only loc rot size */ - /* only copies transform info for the pose */ - VECCOPY(pchan->loc, chan->loc); - VECCOPY(pchan->size, chan->size); - QUATCOPY(pchan->quat, chan->quat); - pchan->flag= chan->flag; - - if (flip) { - pchan->loc[0]*= -1; - - QuatToEul(pchan->quat, eul); - eul[1]*= -1; - eul[2]*= -1; - EulToQuat(eul, pchan->quat); - } - - if (G.flags & G_RECORDKEYS) { - ID *id= &ob->id; - - /* Set keys on pose */ - if (chan->flag & POSE_ROT) { - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); - } - if (chan->flag & POSE_SIZE) { - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); - } - if (chan->flag & POSE_LOC) { - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); - } - - /* clear any unkeyed tags */ - if (chan->bone) - chan->bone->flag &= ~BONE_UNKEYED; - } - else { - /* add unkeyed tags */ - if (chan->bone) - chan->bone->flag |= BONE_UNKEYED; - } - } - } - } - - /* Update event for pose and deformation children */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if (G.flags & G_RECORDKEYS) { - remake_action_ipos(ob->action); - allqueue (REDRAWIPO, 0); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - } - else { - /* need to trick depgraph, action is not allowed to execute on pose */ - where_is_pose(ob); - ob->recalc= 0; - } - - BIF_undo_push("Paste Action Pose"); -} - -/* ********************************************** */ - -/* context weightpaint and deformer in posemode */ -void pose_adds_vgroups(Object *meshobj, int heatweights) -{ - extern VPaint Gwp; /* from vpaint */ - Object *poseobj= modifiers_isDeformedByArmature(meshobj); - - if(poseobj==NULL || (poseobj->flag & OB_POSEMODE)==0) { - error("The active object must have a deforming armature in pose mode"); - return; - } - - add_verts_to_dgroups(meshobj, poseobj, heatweights, (Gwp.flag & VP_MIRROR_X)); - - if(heatweights) - BIF_undo_push("Apply Bone Heat Weights to Vertex Groups"); - else - BIF_undo_push("Apply Bone Envelopes to Vertex Groups"); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - - // and all its relations - DAG_object_flush_update(G.scene, meshobj, OB_RECALC_DATA); -} - -/* ********************************************** */ - -/* context active object */ -void pose_flip_names(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - bPoseChannel *pchan; - char newname[32]; - - /* paranoia checks */ - if(!ob && !ob->pose) return; - if(ob==G.obedit || (ob->flag & OB_POSEMODE)==0) return; - - if(pose_has_protected_selected(ob, 0)) - return; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & (BONE_ACTIVE|BONE_SELECTED)) { - BLI_strncpy(newname, pchan->name, sizeof(newname)); - bone_flip_name(newname, 1); // 1 = do strip off number extensions - armature_bone_rename(ob->data, pchan->name, newname); - } - } - } - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue (REDRAWACTION, 0); - allqueue(REDRAWOOPS, 0); - BIF_undo_push("Flip names"); - -} - -/* context active object, or weightpainted object with armature in posemode */ -void pose_activate_flipped_bone(void) -{ - Object *ob= OBACT; - bArmature *arm= ob->data; - - if(ob==NULL) return; - - if(G.f & G_WEIGHTPAINT) { - ob= modifiers_isDeformedByArmature(ob); - } - if(ob && (ob->flag & OB_POSEMODE)) { - bPoseChannel *pchan, *pchanf; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(arm->layer & pchan->bone->layer) { - if(pchan->bone->flag & BONE_ACTIVE) - break; - } - } - if(pchan) { - char name[32]; - - BLI_strncpy(name, pchan->name, 32); - bone_flip_name(name, 1); // 0 = do not strip off number extensions - - pchanf= get_pose_channel(ob->pose, name); - if(pchanf && pchanf!=pchan) { - pchan->bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE); - pchanf->bone->flag |= (BONE_SELECTED|BONE_ACTIVE); - - /* in weightpaint we select the associated vertex group too */ - if(G.f & G_WEIGHTPAINT) { - vertexgroup_select_by_name(OBACT, name); - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - } - - select_actionchannel_by_name(ob->action, name, 1); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); /* To force action/constraint ipo update */ - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWOOPS, 0); - } - } - } -} - -/* This function pops up the move-to-layer popup widgets when the user - * presses either SHIFT-MKEY or MKEY in PoseMode OR EditMode (for Armatures) - */ -void pose_movetolayer(void) -{ - Object *ob= OBACT; - bArmature *arm; - short lay= 0; - - if (ob==NULL) return; - arm= ob->data; - - if (G.qual & LR_SHIFTKEY) { - /* armature layers */ - lay= arm->layer; - if ( movetolayer_short_buts(&lay, "Armature Layers")==0 ) return; - if (lay==0) return; - arm->layer= lay; - if(ob->pose) - ob->pose->proxy_layer= lay; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - else if (G.obedit) { - /* the check for editbone layer moving needs to occur before posemode one to work */ - EditBone *ebo; - EditBone *flipBone; - - for (ebo= G.edbo.first; ebo; ebo= ebo->next) { - if (arm->layer & ebo->layer) { - if (ebo->flag & BONE_SELECTED) - lay |= ebo->layer; - } - } - if (lay==0) return; - - if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return; - if (lay==0) return; - - for (ebo= G.edbo.first; ebo; ebo= ebo->next) { - if (arm->layer & ebo->layer) { - if (ebo->flag & BONE_SELECTED) { - ebo->layer= lay; - if (arm->flag & ARM_MIRROR_EDIT) { - flipBone = armature_bone_get_mirrored(ebo); - if (flipBone) - flipBone->layer = lay; - } - } - } - } - - BIF_undo_push("Move Bone Layer"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - else if (ob->flag & OB_POSEMODE) { - /* pose-channel layers */ - bPoseChannel *pchan; - - if (pose_has_protected_selected(ob, 0)) - return; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (arm->layer & pchan->bone->layer) { - if (pchan->bone->flag & BONE_SELECTED) - lay |= pchan->bone->layer; - } - } - if (lay==0) return; - - if ( movetolayer_short_buts(&lay, "Bone Layers")==0 ) return; - if (lay==0) return; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (arm->layer & pchan->bone->layer) { - if (pchan->bone->flag & BONE_SELECTED) - pchan->bone->layer= lay; - } - } - - BIF_undo_push("Move Bone Layer"); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWBUTSEDIT, 0); - } -} - - -/* for use with pose_relax only */ -static int pose_relax_icu(struct IpoCurve *icu, float framef, float *val, float *frame_prev, float *frame_next) -{ - if (!icu) { - return 0; - } else { - BezTriple *bezt = icu->bezt; - - BezTriple *bezt_prev=NULL, *bezt_next=NULL; - float w1, w2, wtot; - int i; - - for (i=0; i < icu->totvert; i++, bezt++) { - if (bezt->vec[1][0] < framef - 0.5) { - bezt_prev = bezt; - } else { - break; - } - } - - if (bezt_prev==NULL) return 0; - - /* advance to the next, dont need to advance i */ - bezt = bezt_prev+1; - - for (; i < icu->totvert; i++, bezt++) { - if (bezt->vec[1][0] > framef + 0.5) { - bezt_next = bezt; - break; - } - } - - if (bezt_next==NULL) return 0; - - if (val) { - w1 = framef - bezt_prev->vec[1][0]; - w2 = bezt_next->vec[1][0] - framef; - wtot = w1 + w2; - w1=w1/wtot; - w2=w2/wtot; -#if 0 - val = (bezt_prev->vec[1][1] * w2) + (bezt_next->vec[1][1] * w1); -#else - /* apply the value with a hard coded 6th */ - *val = (((bezt_prev->vec[1][1] * w2) + (bezt_next->vec[1][1] * w1)) + (*val * 5.0f)) / 6.0f; -#endif - } - - if (frame_prev) *frame_prev = bezt_prev->vec[1][0]; - if (frame_next) *frame_next = bezt_next->vec[1][0]; - - return 1; - } -} - -void pose_relax() -{ - Object *ob = OBACT; - bPose *pose; - bAction *act; - bArmature *arm; - - IpoCurve *icu_w, *icu_x, *icu_y, *icu_z; - - bPoseChannel *pchan; - bActionChannel *achan; - float framef = F_CFRA; - float frame_prev, frame_next; - float quat_prev[4], quat_next[4], quat_interp[4], quat_orig[4]; - - /*int do_scale = 0; - int do_loc = 0; - int do_quat = 0; - int flag = 0;*/ - int do_x, do_y, do_z; - - if (!ob) return; - - pose = ob->pose; - act = ob->action; - arm = (bArmature *)ob->data; - - if (!pose || !act || !arm) return; - - for (pchan=pose->chanbase.first; pchan; pchan= pchan->next){ - if(pchan->bone->layer & arm->layer) { - if(pchan->bone->flag & BONE_SELECTED) { - /* do we have an ipo curve? */ - achan= get_action_channel(act, pchan->name); - if(achan && achan->ipo) { - /*calc_ipo(achan->ipo, ctime);*/ - - do_x = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_X), framef, &pchan->loc[0], NULL, NULL); - do_y = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_Y), framef, &pchan->loc[1], NULL, NULL); - do_z = pose_relax_icu(find_ipocurve(achan->ipo, AC_LOC_Z), framef, &pchan->loc[2], NULL, NULL); - /* do_loc = do_x + do_y + do_z */ - - if (G.flags & G_RECORDKEYS) { - if (do_x) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); - if (do_y) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); - if (do_z) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); - } - - do_x = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_X), framef, &pchan->size[0], NULL, NULL); - do_y = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_Y), framef, &pchan->size[1], NULL, NULL); - do_z = pose_relax_icu(find_ipocurve(achan->ipo, AC_SIZE_Z), framef, &pchan->size[2], NULL, NULL); - /* do_scale = do_x + do_y + do_z */ - - if (G.flags & G_RECORDKEYS) { - if (do_x) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); - if (do_y) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); - if (do_z) insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); - } - - if( ((icu_w = find_ipocurve(achan->ipo, AC_QUAT_W))) && - ((icu_x = find_ipocurve(achan->ipo, AC_QUAT_X))) && - ((icu_y = find_ipocurve(achan->ipo, AC_QUAT_Y))) && - ((icu_z = find_ipocurve(achan->ipo, AC_QUAT_Z))) ) - { - /* use the quatw keyframe as a basis for others */ - if (pose_relax_icu(icu_w, framef, NULL, &frame_prev, &frame_next)) { - /* get 2 quats */ - quat_prev[0] = eval_icu(icu_w, frame_prev); - quat_prev[1] = eval_icu(icu_x, frame_prev); - quat_prev[2] = eval_icu(icu_y, frame_prev); - quat_prev[3] = eval_icu(icu_z, frame_prev); - - quat_next[0] = eval_icu(icu_w, frame_next); - quat_next[1] = eval_icu(icu_x, frame_next); - quat_next[2] = eval_icu(icu_y, frame_next); - quat_next[3] = eval_icu(icu_z, frame_next); - -#if 0 - /* apply the setting, completely smooth */ - QuatInterpol(pchan->quat, quat_prev, quat_next, (framef-frame_prev) / (frame_next-frame_prev) ); -#else - /* tricky interpolation */ - QuatInterpol(quat_interp, quat_prev, quat_next, (framef-frame_prev) / (frame_next-frame_prev) ); - QUATCOPY(quat_orig, pchan->quat); - QuatInterpol(pchan->quat, quat_orig, quat_interp, 1.0f/6.0f); - /* done */ -#endif - /*do_quat++;*/ - - if (G.flags & G_RECORDKEYS) { - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); - } - } - } - - if (G.flags & G_RECORDKEYS) { - pchan->bone->flag &= ~BONE_UNKEYED; - } - } - } - } - } - - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - -#if 0 -// /* auto-keyframing - dosnt work, no idea why, do manually above */ - if (do_loc) flag |= TFM_TRANSLATION; - if (do_scale) flag |= TFM_RESIZE; - if (do_quat) flag |= TFM_ROTATION; - autokeyframe_pose_cb_func(ob, flag, 0); -#endif - - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Relax Pose"); - -} diff --git a/source/blender/src/preview.blend.c b/source/blender/src/preview.blend.c deleted file mode 100644 index 945fbd9a962..00000000000 --- a/source/blender/src/preview.blend.c +++ /dev/null @@ -1,13901 +0,0 @@ -/* DataToC output of file */ - -int datatoc_preview_blend_size= 444636; -char datatoc_preview_blend[]= { - 66, 76, 69, 78, 68, 69, 82, 45,118, 50, 52, 53, 82, 69, 78, 68, 32, 0, 0, 0, 80, 67,123,102,255,127, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0,112,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 71, 76, 79, 66, 40, 0, 0, 0, 80, 67,123,102,255,127, 0, 0,150, 0, 0, 0, 1, 0, 0, 0, - 32, 32, 32, 56, 8, 0, 0, 0,240, 0, 0, 0, 1, 0, 0, 1, 64, 39,115, 1, 0, 0, 0, 0,128,199,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 64, 0, 0, 0, 83, 82, 0, 0,168, 0, 0, 0, 64, 39,115, 1, 0, 0, 0, 0,145, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 82,115, 99,114,101,101,110, 0, 45, 83, 99,114,105,112,116,105,110,103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 48, 40,115, 1, 0, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, 48, 43,115, 1, 0, 0, 0, 0, -144, 47,115, 1, 0, 0, 0, 0, 0, 48,115, 1, 0, 0, 0, 0,192,167,115, 1, 0, 0, 0, 0,128,199,115, 1, 0, 0, 0, 0, - 0, 0,127, 7, 25, 0,125, 4,128, 7,101, 4, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 48, 40,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, -144, 40,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 32, 0, 0, 0,144, 40,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,240, 40,115, 1, 0, 0, 0, 0, - 48, 40,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,101, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, -240, 40,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0,144, 40,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128, 7,101, 4, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0, -146, 0, 0, 0, 1, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0,240, 40,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, 7, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0, - 16, 42,115, 1, 0, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 4, 1, 0, 0, 0, - 68, 65, 84, 65, 32, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, -176, 41,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 7, 68, 4, 1, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0, -112, 42,115, 1, 0, 0, 0, 0,146, 0, 0, 0, 1, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,252, 5, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 32, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, -146, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -252, 5, 68, 4, 1, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48, 43,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -160, 43,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144, 40,115, 1, 0, 0, 0, 0,240, 40,115, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,160, 43,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, - 16, 44,115, 1, 0, 0, 0, 0, 48, 43,115, 1, 0, 0, 0, 0,144, 40,115, 1, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 16, 44,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -128, 44,115, 1, 0, 0, 0, 0,160, 43,115, 1, 0, 0, 0, 0,240, 40,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,128, 44,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -240, 44,115, 1, 0, 0, 0, 0, 16, 44,115, 1, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,240, 44,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, - 96, 45,115, 1, 0, 0, 0, 0,128, 44,115, 1, 0, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 96, 45,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -208, 45,115, 1, 0, 0, 0, 0,240, 44,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,208, 45,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, - 64, 46,115, 1, 0, 0, 0, 0, 96, 45,115, 1, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64, 46,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -176, 46,115, 1, 0, 0, 0, 0,208, 45,115, 1, 0, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176, 46,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, - 32, 47,115, 1, 0, 0, 0, 0, 64, 46,115, 1, 0, 0, 0, 0, 48, 40,115, 1, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32, 47,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, -144, 47,115, 1, 0, 0, 0, 0,176, 46,115, 1, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144, 47,115, 1, 0, 0, 0, 0,147, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32, 47,115, 1, 0, 0, 0, 0, 48, 40,115, 1, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 0, 48,115, 1, 0, 0, 0, 0,149, 0, 0, 0, 1, 0, 0, 0, - 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0,144, 40,115, 1, 0, 0, 0, 0, -240, 40,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 7, 0, 0, - 69, 4, 0, 0,101, 4, 0, 0, 0, 0, 0, 0,128, 7, 0, 0, 69, 4, 0, 0, 95, 4, 0, 0, 0, 0, 0, 0,128, 7, 0, 0, - 96, 4, 0, 0,101, 4, 0, 0, 5, 0, 4, 0, 1, 0, 7, 7,129, 7, 6, 0, 1, 0, 1, 0,189, 2, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32, 52, 88, 1, 0, 0, 0, 0,160,144,104, 1, 0, 0, 0, 0, 80, 49,115, 1, 0, 0, 0, 0, -208, 96,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 49,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -128, 50,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128, 50,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,176, 51,115, 1, 0, 0, 0, 0, 80, 49,115, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -176, 51,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224, 52,115, 1, 0, 0, 0, 0,128, 50,115, 1, 0, 0, 0, 0, - 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,224, 52,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 16, 54,115, 1, 0, 0, 0, 0, -176, 51,115, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16, 54,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 64, 55,115, 1, 0, 0, 0, 0,224, 52,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64, 55,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,112, 56,115, 1, 0, 0, 0, 0, 16, 54,115, 1, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -112, 56,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160, 57,115, 1, 0, 0, 0, 0, 64, 55,115, 1, 0, 0, 0, 0, - 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,160, 57,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,208, 58,115, 1, 0, 0, 0, 0, -112, 56,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208, 58,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 0, 60,115, 1, 0, 0, 0, 0,160, 57,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,160, 57,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0, 60,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 48, 61,115, 1, 0, 0, 0, 0,208, 58,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 48, 61,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 96, 62,115, 1, 0, 0, 0, 0, 0, 60,115, 1, 0, 0, 0, 0, - 76,105,110,107,115, 32, 97,110,100, 32, 80,105,112,101,108,105,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 96, 62,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,144, 63,115, 1, 0, 0, 0, 0, - 48, 61,115, 1, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144, 63,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -192, 64,115, 1, 0, 0, 0, 0, 96, 62,115, 1, 0, 0, 0, 0, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 96, 62,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192, 64,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,240, 65,115, 1, 0, 0, 0, 0,144, 63,115, 1, 0, 0, 0, 0, 83,104, 97,100,101,114,115, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 65,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -240, 65,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 32, 67,115, 1, 0, 0, 0, 0,192, 64,115, 1, 0, 0, 0, 0, - 77,105,114,114,111,114, 32, 84,114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 32, 67,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 80, 68,115, 1, 0, 0, 0, 0, -240, 65,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 68,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -128, 69,115, 1, 0, 0, 0, 0, 32, 67,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32, 67,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128, 69,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,176, 70,115, 1, 0, 0, 0, 0, 80, 68,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 67,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -176, 70,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224, 71,115, 1, 0, 0, 0, 0,128, 69,115, 1, 0, 0, 0, 0, - 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,224, 71,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 16, 73,115, 1, 0, 0, 0, 0, -176, 70,115, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16, 73,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 64, 74,115, 1, 0, 0, 0, 0,224, 71,115, 1, 0, 0, 0, 0, 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64, 74,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,112, 75,115, 1, 0, 0, 0, 0, 16, 73,115, 1, 0, 0, 0, 0, 83,104, 97,112,101,115, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 73,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -112, 75,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160, 76,115, 1, 0, 0, 0, 0, 64, 74,115, 1, 0, 0, 0, 0, - 77,101,115,104, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,160, 76,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,208, 77,115, 1, 0, 0, 0, 0, -112, 75,115, 1, 0, 0, 0, 0, 77,101,115,104, 32, 84,111,111,108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208, 77,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 0, 79,115, 1, 0, 0, 0, 0,160, 76,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0, 79,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 48, 80,115, 1, 0, 0, 0, 0,208, 77,115, 1, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 48, 80,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 96, 81,115, 1, 0, 0, 0, 0, 0, 79,115, 1, 0, 0, 0, 0, - 77,105,115,116, 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 96, 81,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,144, 82,115, 1, 0, 0, 0, 0, - 48, 80,115, 1, 0, 0, 0, 0, 65,109, 98, 32, 79, 99, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 80,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144, 82,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -192, 83,115, 1, 0, 0, 0, 0, 96, 81,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117, -116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192, 83,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,240, 84,115, 1, 0, 0, 0, 0,144, 82,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144, 82,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -240, 84,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 32, 86,115, 1, 0, 0, 0, 0,192, 83,115, 1, 0, 0, 0, 0, - 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 32, 86,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 80, 87,115, 1, 0, 0, 0, 0, -240, 84,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 87,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -128, 88,115, 1, 0, 0, 0, 0, 32, 86,115, 1, 0, 0, 0, 0, 67,111,108,111,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 32, 86,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,128, 88,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,176, 89,115, 1, 0, 0, 0, 0, 80, 87,115, 1, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 97, -110,100, 32, 76,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -176, 89,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224, 90,115, 1, 0, 0, 0, 0,128, 88,115, 1, 0, 0, 0, 0, - 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 70, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,224, 90,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 16, 92,115, 1, 0, 0, 0, 0, -176, 89,115, 1, 0, 0, 0, 0, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16, 92,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 64, 93,115, 1, 0, 0, 0, 0,224, 90,115, 1, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,210, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64, 93,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,112, 94,115, 1, 0, 0, 0, 0, 16, 92,115, 1, 0, 0, 0, 0, 67,108,111,117,100,115, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -112, 94,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160, 95,115, 1, 0, 0, 0, 0, 64, 93,115, 1, 0, 0, 0, 0, - 83,116,117, 99, 99,105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,160, 95,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,208, 96,115, 1, 0, 0, 0, 0, -112, 94,115, 1, 0, 0, 0, 0, 87,111,111,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,140, 2, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208, 96,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,160, 95,115, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 32, 76, 97,121,101,114,115, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 49,115, 1, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, 0, 98,115, 1, 0, 0, 0, 0, -149, 0, 0, 0, 1, 0, 0, 0,192,167,115, 1, 0, 0, 0, 0, 0, 48,115, 1, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, -208, 42,115, 1, 0, 0, 0, 0, 16, 42,115, 1, 0, 0, 0, 0, 80, 41,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,140, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,171, 68, 45, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 1,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128,226,215,163,188, 0, 0, 0,128, -253, 5, 0, 0,128, 7, 0, 0, 0, 0, 0, 0, 67, 4, 0, 0,253, 5, 0, 0,128, 7, 0, 0, 41, 4, 0, 0, 67, 4, 0, 0, -253, 5, 0, 0,128, 7, 0, 0, 0, 0, 0, 0, 40, 4, 0, 0, 7, 0, 6, 0, 2, 0, 4, 4,132, 1, 41, 4, 1, 0, 1, 0, -136, 1, 4, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192,152,115, 1, 0, 0, 0, 0,208,165,115, 1, 0, 0, 0, 0,208,145,196, 1, 0, 0, 0, 0, 48, 29, 88, 1, 0, 0, 0, 0, - 80, 99,115, 1, 0, 0, 0, 0, 80,143,114, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80, 99,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,128,100,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84,114, 97,110,115,102,111,114, -109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73,112,111, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0,167, 0, 62, 1,204, 0, - 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -128,100,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,176,101,115, 1, 0, 0, 0, 0, 80, 99,115, 1, 0, 0, 0, 0, - 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 80,137,115, 1, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,176,101,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224,102,115, 1, 0, 0, 0, 0, -128,100,115, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,224,102,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 16,104,115, 1, 0, 0, 0, 0,176,101,115, 1, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,104,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 64,105,115, 1, 0, 0, 0, 0,224,102,115, 1, 0, 0, 0, 0, 70,111,114,109, 97,116, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, - 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 64,105,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,112,106,115, 1, 0, 0, 0, 0, 16,104,115, 1, 0, 0, 0, 0, - 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,112,106,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160,107,115, 1, 0, 0, 0, 0, - 64,105,115, 1, 0, 0, 0, 0, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,160,107,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -208,108,115, 1, 0, 0, 0, 0,112,106,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,108,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 0,110,115, 1, 0, 0, 0, 0,160,107,115, 1, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 0,110,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 48,111,115, 1, 0, 0, 0, 0,208,108,115, 1, 0, 0, 0, 0, - 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 48,111,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 96,112,115, 1, 0, 0, 0, 0, - 0,110,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 96,112,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -144,113,115, 1, 0, 0, 0, 0, 48,111,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 48,111,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,113,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,192,114,115, 1, 0, 0, 0, 0, 96,112,115, 1, 0, 0, 0, 0, 77,101,115,104, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -192,114,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,240,115,115, 1, 0, 0, 0, 0,144,113,115, 1, 0, 0, 0, 0, - 77,111,100,105,102,105,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,240,115,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 32,117,115, 1, 0, 0, 0, 0, -192,114,115, 1, 0, 0, 0, 0, 83,104, 97,112,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, -192,114,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 32,117,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 80,118,115, 1, 0, 0, 0, 0,240,115,115, 1, 0, 0, 0, 0, 77,101,115,104, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,118,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,128,119,115, 1, 0, 0, 0, 0, 32,117,115, 1, 0, 0, 0, 0, 77,101,115,104, 32, 84,111,111, -108,115, 32, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -128,119,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,176,120,115, 1, 0, 0, 0, 0, 80,118,115, 1, 0, 0, 0, 0, - 84,101,120,116,117,114,101, 32,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,120,115, 1, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,176,120,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224,121,115, 1, 0, 0, 0, 0, -128,119,115, 1, 0, 0, 0, 0, 85, 86, 32, 67, 97,108, 99,117,108, 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,224,121,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 16,123,115, 1, 0, 0, 0, 0,176,120,115, 1, 0, 0, 0, 0, 80, 97,105,110,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,123,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 64,124,115, 1, 0, 0, 0, 0,224,121,115, 1, 0, 0, 0, 0, 67,117,114,118,101, 32, 97,110, -100, 32, 83,117,114,102, 97, 99,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 64,124,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,112,125,115, 1, 0, 0, 0, 0, 16,123,115, 1, 0, 0, 0, 0, - 67,117,114,118,101, 32, 84,111,111,108,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,112,125,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160,126,115, 1, 0, 0, 0, 0, - 64,124,115, 1, 0, 0, 0, 0, 67,117,114,118,101, 32, 84,111,111,108,115, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,160,126,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -208,127,115, 1, 0, 0, 0, 0,112,125,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,127,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 0,129,115, 1, 0, 0, 0, 0,160,126,115, 1, 0, 0, 0, 0, 76,105,110,107,115, 32, 97,110, -100, 32, 80,105,112,101,108,105,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 0,129,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 48,130,115, 1, 0, 0, 0, 0,208,127,115, 1, 0, 0, 0, 0, - 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 48,130,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 96,131,115, 1, 0, 0, 0, 0, - 0,129,115, 1, 0, 0, 0, 0, 82, 97,109,112,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0,129,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 96,131,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -144,132,115, 1, 0, 0, 0, 0, 48,130,115, 1, 0, 0, 0, 0, 83,104, 97,100,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,144,132,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,132,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,192,133,115, 1, 0, 0, 0, 0, 96,131,115, 1, 0, 0, 0, 0, 77,105,114,114,111,114, 32, 84, -114, 97,110,115,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -192,133,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,240,134,115, 1, 0, 0, 0, 0,144,132,115, 1, 0, 0, 0, 0, - 84,101,120,116,117,114,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 96,252, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,240,134,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 32,136,115, 1, 0, 0, 0, 0, -192,133,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192,133,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 32,136,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 80,137,115, 1, 0, 0, 0, 0,240,134,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 97,116,101,114,105, 97,108, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,252, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,192,133,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 80,137,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,128,138,115, 1, 0, 0, 0, 0, 32,136,115, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 32, 76, - 97,121,101,114,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -128,138,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,176,139,115, 1, 0, 0, 0, 0, 80,137,115, 1, 0, 0, 0, 0, - 80,114,101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,176,139,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,224,140,115, 1, 0, 0, 0, 0, -128,138,115, 1, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,224,140,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 16,142,115, 1, 0, 0, 0, 0,176,139,115, 1, 0, 0, 0, 0, 77,105,115,116, 32, 47, 32, 83,116, 97,114,115, 32, 47, 32, 80, -104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 16,142,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 64,143,115, 1, 0, 0, 0, 0,224,140,115, 1, 0, 0, 0, 0, 65,109, 98, 32, 79, 99, 99, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,140,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 64,143,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,112,144,115, 1, 0, 0, 0, 0, 16,142,115, 1, 0, 0, 0, 0, - 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,112,144,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,160,145,115, 1, 0, 0, 0, 0, - 64,143,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 87,111,114,108,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64,143,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,160,145,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -208,146,115, 1, 0, 0, 0, 0,112,144,115, 1, 0, 0, 0, 0, 77,117,108,116,105,114,101,115, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,208,146,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 0,148,115, 1, 0, 0, 0, 0,160,145,115, 1, 0, 0, 0, 0, 79, 98,106,101, 99,116, 32, 97, -110,100, 32, 76,105,110,107,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 0,148,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 48,149,115, 1, 0, 0, 0, 0,208,146,115, 1, 0, 0, 0, 0, - 65,110,105,109, 32,115,101,116,116,105,110,103,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 48,149,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 96,150,115, 1, 0, 0, 0, 0, - 0,148,115, 1, 0, 0, 0, 0, 68,114, 97,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 96,150,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -144,151,115, 1, 0, 0, 0, 0, 48,149,115, 1, 0, 0, 0, 0, 67,111,110,115,116,114, 97,105,110,116,115, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 98,106,101, 99,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,151,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,144,144,114, 1, 0, 0, 0, 0, 96,150,115, 1, 0, 0, 0, 0, 66, 97,107,101, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, - 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0,224,102,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -144,144,114, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,192, 26,122, 1, 0, 0, 0, 0,144,151,115, 1, 0, 0, 0, 0, - 83,116, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 72,253, 62, 1,204, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 16,104,115, 1, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,192, 26,122, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,144,161,135, 1, 0, 0, 0, 0, -144,144,114, 1, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 32, 83,121,115,116,101,109, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,144,161,135, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 64,247,121, 1, 0, 0, 0, 0,192, 26,122, 1, 0, 0, 0, 0, 80,104,121,115,105, 99,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 64,247,121, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 64, 62,114, 1, 0, 0, 0, 0,144,161,135, 1, 0, 0, 0, 0, 86,105,115,117, 97,108,105,122, - 97,116,105,111,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 64, 62,114, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 80,143,114, 1, 0, 0, 0, 0, 64,247,121, 1, 0, 0, 0, 0, - 69,120,116,114, 97,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 80,143,114, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 62,114, 1, 0, 0, 0, 0, 67,104,105,108,100,114,101,110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, - 64, 62,114, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,192,152,115, 1, 0, 0, 0, 0,129, 0, 0, 0, 1, 0, 0, 0, -240,153,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 98,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0,193, 0, 0,163, 67, 0, 0,106,196, 0, 0,104, 67,108, 94,173,194,155, 87,202, 67,176,132,139,196,193,149,104, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, 0, 0, 0, 69, 0, 0,225, 67, - 0, 0, 0, 63, 72,225,154, 63, 0, 0, 1, 0, 1, 0, 1, 0,132, 1, 41, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,128,199,115, 1, 0, 0, 0, 0,255,255, 0, 0, 0, 0, 0, 0, -150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 68, 65, 84, 65, 56, 3, 0, 0,240,153,115, 1, 0, 0, 0, 0, -124, 0, 0, 0, 1, 0, 0, 0,112,157,115, 1, 0, 0, 0, 0,192,152,115, 1, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63, - 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52,198,127, 63,146, 29,166,188, - 97,153, 22, 61, 0, 0, 0, 0, 13,252, 43, 61, 89, 11,247, 62, 90,248, 95,191, 0, 0, 0, 0,196,176, 67, 52,246, 42, 96, 63, - 44, 67,247, 62, 0, 0, 0, 0, 74, 45, 78, 64,201, 87,172, 62, 79,171, 41,194, 0, 0,128, 63, 53,198,127, 63,248,251, 43, 61, - 0, 0, 80, 52, 0, 0, 0, 0,186, 29,166,188,119, 11,247, 62, 16, 43, 96, 63, 0, 0, 0, 0, 99,153, 22, 61,117,248, 95,191, - 75, 67,247, 62, 0, 0, 0, 0,192,125,211,191,185,161, 21,194, 59,133,161, 65, 0, 0,128, 63,100,224,139, 63, 21,221, 96,190, -236,154, 22,189, 97,153, 22,189,174, 27, 60, 61,239, 52,167, 64,166,250, 95, 63, 90,248, 95, 63, 86, 9, 86, 52, 41,185, 23, 65, -181, 69,247,190, 44, 67,247,190,137,129, 97, 64, 27, 75,105, 64,145,152, 41, 66, 79,171, 41, 66, 95,225,105, 63, 84,247, 39, 61, -176, 46,185,186,144,196,146,184,178,126,245,186, 48,117, 54, 61, 23,157,165, 61, 0,160,153, 52,225, 56,165, 66,192,202,233, 68, - 18, 94,124,196, 87,254, 71,194,102, 77,165,194, 39,177,233,196,193, 65,124, 68,101, 0, 72, 66, 0, 0,140, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,171, 68, 45, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 1,128,191, 0, 0,128,191, 0, 0, 0,128, 0, 0, 0,128,226,215,163,188, 0, 0, 0,128, 52,198,127, 63,146, 29,166,188, - 97,153, 22, 61, 0, 0, 0, 0, 13,252, 43, 61, 89, 11,247, 62, 90,248, 95,191, 0, 0, 0, 0,196,176, 67, 52,246, 42, 96, 63, - 44, 67,247, 62, 0, 0, 0, 0, 74, 45, 78, 64,201, 87,172, 62, 79,171, 41,194, 0, 0,128, 63,141, 99, 92, 63, 43, 35, 2,191, -188,238, 46,188, 94, 32,148,188, 23,240, 25, 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,160,248,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -226,255, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, 68, 56,124, 58, 10,215, 35, 60, 0, 0,250, 67, 0, 0, 0, 0, - 0, 0, 0, 0,201, 77, 68, 64,228, 66,111, 64,230, 97,205,191,128,191,149, 60,116,109, 77,191,248,165,230, 63, 20, 0, 0, 0, - 7, 0, 99, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,255,255, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 88, 1, 0, 0,112,157,115, 1, 0, 0, 0, 0,128, 0, 0, 0, 1, 0, 0, 0, 16,159,115, 1, 0, 0, 0, 0, -240,153,115, 1, 0, 0, 0, 0, 2, 0, 0, 0, 51, 51, 51, 63, 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, - 0, 0,128, 63, 0, 0,122, 67, 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,235, 2, 0, 0, - 16, 0, 0, 0,168, 3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, 16, 0, 0, 0,235, 2, 0, 0, - 10,215, 35, 60, 10,215, 35, 60, 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 20,116, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 68, 65, 84, 65,136, 0, 0, 0, 16,159,115, 1, 0, 0, 0, 0, -135, 0, 0, 0, 1, 0, 0, 0,224,159,115, 1, 0, 0, 0, 0,112,157,115, 1, 0, 0, 0, 0, 9, 0, 0, 0, 51, 51, 51, 63, - 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,237,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,225, 2, 0, 0,227, 2, 0, 0, - 5, 0, 0, 0, 17, 0, 0, 0,207, 2, 0, 0,227, 2, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,224,159,115, 1, 0, 0, 0, 0, -133, 0, 0, 0, 1, 0, 0, 0, 80,161,115, 1, 0, 0, 0, 0, 16,159,115, 1, 0, 0, 0, 0, 6, 0, 0, 0, 51, 51, 51, 63, - 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, - 0, 0, 0, 0, 0, 0,128, 67, 0, 0,120,190, 0, 0,159, 63, 0, 0,242,190, 0,128,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, - 0, 0, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, - 80,161,115, 1, 0, 0, 0, 0,132, 0, 0, 0, 1, 0, 0, 0,192,162,115, 1, 0, 0, 0, 0,224,159,115, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 51, 51, 51, 63, 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,182, 67, 0, 0,209,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, - 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 1, 0, 1, 0,108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,192, 0, 0, 0,192,162,115, 1, 0, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 0,192,163,115, 1, 0, 0, 0, 0, - 80,161,115, 1, 0, 0, 0, 0, 11, 0, 0, 0, 51, 51, 51, 63, 0, 98,115, 1, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67, - 0, 0,128,192, 0, 0,127, 67, 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, - 16, 0, 0, 0,124, 1, 0, 0, 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0, -192,163,115, 1, 0, 0, 0, 0,134, 0, 0, 0, 1, 0, 0, 0,192,164,115, 1, 0, 0, 0, 0,192,162,115, 1, 0, 0, 0, 0, - 13, 0, 0, 0, 51, 51, 51, 63, 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, - 0, 0, 0, 0, 0, 0,182, 67,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,122, 68, 0, 0,122, 68,205,204,204, 61, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,192,164,115, 1, 0, 0, 0, 0, -215, 0, 0, 0, 1, 0, 0, 0,208,165,115, 1, 0, 0, 0, 0,192,163,115, 1, 0, 0, 0, 0, 12, 0, 0, 0, 51, 51, 51, 63, - 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, - 0, 0,122,196, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,150,194, 0, 0,160, 64,108, 1, 0, 0,124, 1, 0, 0, - 0, 0, 0, 0, 14, 2, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, - 16, 0, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, - 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,168, 1, 0, 0, -208,165,115, 1, 0, 0, 0, 0,131, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,164,115, 1, 0, 0, 0, 0, - 5, 0, 0, 0, 51, 51, 51, 63, 0, 98,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,150, 0, 0, 0, 83, 97,118,101, 32, 70,105,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 85,115,101,114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112,114,101,118,105,101,119, 46, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 82, 0, 0, 0, 0, 0, 76, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 1, 0, 0, -192,167,115, 1, 0, 0, 0, 0,149, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98,115, 1, 0, 0, 0, 0, - 48, 40,115, 1, 0, 0, 0, 0,176, 41,115, 1, 0, 0, 0, 0,208, 42,115, 1, 0, 0, 0, 0,112, 42,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,252, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228, 17,149, 63, - 0, 0, 0, 0, 0, 0, 0, 0,170, 82, 60,189,241, 1,131,188,206,211,153,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, -225,236, 65,193, 0, 0, 0, 0, 0, 0, 0, 0,251, 5, 0, 0, 0, 0, 0, 0, 67, 4, 0, 0, 0, 0, 0, 0,251, 5, 0, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,251, 5, 0, 0, 27, 0, 0, 0, 67, 4, 0, 0, 9, 0, 8, 0, 1, 0, 1, 1, -252, 5, 41, 4, 1, 0, 1, 0,195, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128,184,115, 1, 0, 0, 0, 0,144,197,115, 1, 0, 0, 0, 0,144, 46,106, 1, 0, 0, 0, 0, -144, 46,106, 1, 0, 0, 0, 0, 16,169,115, 1, 0, 0, 0, 0, 80,183,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 16,169,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 64,170,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 73,112,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0,167, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 64,170,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,112,171,115, 1, 0, 0, 0, 0, - 16,169,115, 1, 0, 0, 0, 0, 79,117,116,112,117,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,112,171,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, -160,172,115, 1, 0, 0, 0, 0, 64,170,115, 1, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,160,172,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,208,173,115, 1, 0, 0, 0, 0,112,171,115, 1, 0, 0, 0, 0, 65,110,105,109, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82,101,110,100,101,114, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -208,173,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 0,175,115, 1, 0, 0, 0, 0,160,172,115, 1, 0, 0, 0, 0, - 70,111,114,109, 97,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82,101,110,100,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192, 3, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0, 0,175,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 48,176,115, 1, 0, 0, 0, 0, -208,173,115, 1, 0, 0, 0, 0, 76,105,110,107, 32, 97,110,100, 32, 77, 97,116,101,114,105, 97,108,115, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 48,176,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 96,177,115, 1, 0, 0, 0, 0, 0,175,115, 1, 0, 0, 0, 0, 67, 97,109,101,114, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,100,105,116,105,110,103, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 1, 0, 0, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 96,177,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0,144,178,115, 1, 0, 0, 0, 0, 48,176,115, 1, 0, 0, 0, 0, 80,114,101,118,105,101,119, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, -144,178,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,192,179,115, 1, 0, 0, 0, 0, 96,177,115, 1, 0, 0, 0, 0, - 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 24,255, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 0, 0, 0,192,179,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0,240,180,115, 1, 0, 0, 0, 0, -144,178,115, 1, 0, 0, 0, 0, 83,104, 97,100,111,119, 32, 97,110,100, 32, 83,112,111,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,254, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0,240,180,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, - 32,182,115, 1, 0, 0, 0, 0,192,179,115, 1, 0, 0, 0, 0, 84,101,120,116,117,114,101, 32, 97,110,100, 32, 73,110,112,117, -116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 32,182,115, 1, 0, 0, 0, 0, -148, 0, 0, 0, 1, 0, 0, 0, 80,183,115, 1, 0, 0, 0, 0,240,180,115, 1, 0, 0, 0, 0, 77, 97,112, 32, 84,111, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 97,109,112, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,253, 62, 1,204, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,180,115, 1, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, - 80,183,115, 1, 0, 0, 0, 0,148, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,182,115, 1, 0, 0, 0, 0, - 84,114, 97,110,115,102,111,114,109, 32, 80,114,111,112,101,114,116,105,101,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 86,105,101,119, 51,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,228, 0, 62, 1,204, 0, 0, 0, 0, 0,162, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 56, 3, 0, 0,128,184,115, 1, 0, 0, 0, 0,124, 0, 0, 0, 1, 0, 0, 0, 0,188,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,255,255,127, 37, 0, 0,128, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 51, - 0, 0,128,191, 0, 0, 0, 0, 0, 0,128,165, 0, 0,128, 63,104, 33,162, 51, 0, 0, 0, 0, 78,199, 41, 60,210,129,230,191, -225,230, 30,193, 0, 0,128, 63, 0, 0,128, 63,254,255,127, 37,255,255,127,165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255,127, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,128,191, 0, 0,160, 51, 0, 0, 0, 0, 79,199, 41,188,226,230, 30,193, -216,129,230, 63, 0, 0,128, 63,252, 65, 79, 63,219, 5,147, 37,206,211,153,165, 0, 0,128,165,170, 82, 60, 61, 32, 2,131, 60, -206,211,153, 63, 0, 0,128, 63,198,137,110,177,228, 17,149, 63, 54,216,194,179,104, 33,162,179, 88, 21,238, 62, 0, 31,248,191, - 0,126, 61,190,225,230, 30, 65, 71, 26,158, 63, 70, 26,158, 37, 70, 26,158,165, 0, 0, 0, 26, 0, 0, 0,179, 0, 0,128, 51, -254,208, 91, 63, 0, 0,128,179,192, 31, 96, 58, 5,196, 81, 63, 84, 37, 24,190,230,248,168,189, 23,210,108,189,230, 37,122, 60, -168,200, 40, 62, 29, 17,203, 61,252, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,228, 17,149, 63, - 0, 0, 0, 0, 0, 0, 0, 0,170, 82, 60,189,241, 1,131,188,206,211,153,191, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, -225,236, 65,193, 0, 0, 0, 0, 0, 0,128, 63,255,255,127, 37, 0, 0,128, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 51, - 0, 0,128,191, 0, 0, 0, 0, 0, 0,128,165, 0, 0,128, 63,104, 33,162, 51, 0, 0, 0, 0, 78,199, 41, 60,210,129,230,191, -225,230, 30,193, 0, 0,128, 63,244, 4, 53, 63,243, 4, 53,191,243, 4, 53,165,242, 4,181, 36,147,160, 98, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0,160,248,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,251,255, 0, 0, 0, 0, 12, 66, 0, 0,128, 63, 0, 0,128, 63, -155, 90,211, 58, 10,215, 35, 60, 0, 0,250, 67,228, 18,218,188, 37,180, 23,188, 81, 35, 24, 62, 64, 52, 55,190,244,153,230,191, - 0, 0,224, 54, 56,146, 88, 63,198, 37, 71, 64, 20, 0, 0, 0, 7, 0,207, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,255,255, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,240, 0, 0, 0, 0,188,115, 1, 0, 0, 0, 0, -129, 0, 0, 0, 1, 0, 0, 0, 48,189,115, 1, 0, 0, 0, 0,128,184,115, 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, -192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 0, 0, 0, 0,160, 68, 0, 0, 46,196, 0, 0,100, 67,197,197,136, 55,118,209, 78, 68, - 40,222,231,195,172,158, 25, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 40, 66, - 0, 0, 0, 69, 0, 0,225, 67, 0, 0, 0, 63, 72,225,154, 63, 0, 0, 1, 0, 1, 0, 1, 0,233, 3,235, 2, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, -255,255, 0, 0, 0, 0, 0, 0,150, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 68, 65, 84, 65, 88, 1, 0, 0, - 48,189,115, 1, 0, 0, 0, 0,128, 0, 0, 0, 1, 0, 0, 0,208,190,115, 1, 0, 0, 0, 0, 0,188,115, 1, 0, 0, 0, 0, - 2, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67,205,204,204,189,205,204,140, 63, 0, 0,128, 63, 0, 0,122, 67, - 0, 0,160,192, 0, 0,160, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,235, 2, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, - 0, 0, 0, 0, 16, 0, 0, 0, 16, 0, 0, 0,168, 3, 0, 0, 16, 0, 0, 0,235, 2, 0, 0, 10,215, 35, 60, 10,215, 35, 60, - 0, 96,106, 70, 0, 0,122, 68, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 20,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 67, -205,204,204,189,205,204,140, 63, 68, 65, 84, 65,136, 0, 0, 0,208,190,115, 1, 0, 0, 0, 0,135, 0, 0, 0, 1, 0, 0, 0, -160,191,115, 1, 0, 0, 0, 0, 48,189,115, 1, 0, 0, 0, 0, 9, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,237,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,205,204,204, 61, 5, 0, 0, 0, 17, 0, 0, 0,225, 2, 0, 0,227, 2, 0, 0, 5, 0, 0, 0, 17, 0, 0, 0, -207, 2, 0, 0,227, 2, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,160,191,115, 1, 0, 0, 0, 0,133, 0, 0, 0, 1, 0, 0, 0, - 16,193,115, 1, 0, 0, 0, 0,208,190,115, 1, 0, 0, 0, 0, 6, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 67, - 0, 0,120,190, 0, 0,159, 63, 0, 0,242,190, 0,128,188, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,242, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, 16,193,115, 1, 0, 0, 0, 0, -132, 0, 0, 0, 1, 0, 0, 0,128,194,115, 1, 0, 0, 0, 0,160,191,115, 1, 0, 0, 0, 0, 3, 0, 0, 0, 51, 51, 51, 63, -192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, - 0, 0,209,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,182, 67, 0, 0,190,195, 0, 0, 0,181, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, - 0, 0, 0, 0,124, 1, 0, 0, 0, 0,190,195, 0, 0,190,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 1, 0, 1, 0, 1, 0, 1, 0,108, 1,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0, -128,194,115, 1, 0, 0, 0, 0,206, 0, 0, 0, 1, 0, 0, 0,128,195,115, 1, 0, 0, 0, 0, 16,193,115, 1, 0, 0, 0, 0, - 11, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, 0, 0,128,192, 0, 0,122, 67, 0, 0,128,192, 0, 0,127, 67, - 0, 0,128,192, 0, 0, 72, 66, 0, 0,128,192, 0, 0,127, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0,124, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, - 0, 0,128, 63, 0,128,129, 67, 0, 0,250, 70, 0,128,129, 67,205,204,204, 61, 0, 0, 32, 65, 8, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,192, 0, 0, 0,128,195,115, 1, 0, 0, 0, 0, -134, 0, 0, 0, 1, 0, 0, 0,128,196,115, 1, 0, 0, 0, 0,128,194,115, 1, 0, 0, 0, 0, 13, 0, 0, 0, 51, 51, 51, 63, -192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,122, 68, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,160,192, 0, 0,130, 66, 0, 0, 0, 0, 0, 0,182, 67, -108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0,124, 1, 0, 0,196, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, -196, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,122, 68, 0, 0,122, 68, -205,204,204, 61, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,208, 0, 0, 0,128,196,115, 1, 0, 0, 0, 0,215, 0, 0, 0, 1, 0, 0, 0, -144,197,115, 1, 0, 0, 0, 0,128,195,115, 1, 0, 0, 0, 0, 12, 0, 0, 0, 51, 51, 51, 63,192,167,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 0, 0, 2, 66, 0, 0,122,196, 0, 0, 0, 0, - 0, 0, 0,191, 0, 0, 2, 66, 0, 0,150,194, 0, 0,160, 64,108, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 14, 2, 0, 0, -128, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0,128, 0, 0, 0,108, 1, 0, 0, 16, 0, 0, 0, 14, 2, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250, 70, 0, 0,122, 68, 10,215, 35, 60, 0, 0, 72, 66, 10, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,168, 1, 0, 0,144,197,115, 1, 0, 0, 0, 0, -131, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,196,115, 1, 0, 0, 0, 0, 5, 0, 0, 0, 51, 51, 51, 63, -192,167,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 86, 0, 0, 0, 83, 97,118,101, 32, 70,105,108,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 85,115,101, -114,115, 47,116,111,110, 47, 68,101,115,107,116,111,112, 47, 0,114, 47,114,101,108,101, 97,115,101, 47,100, 97,116, 97,102,105, -108,101,115, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,114,101,118, -105,101,119, 46, 98,108,101,110,100, 0, 0, 0, 98,108,101,110,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 46, 0, 0, 0, 0, 0, 85, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 67, 0, 0, 24, 6, 0, 0,128,199,115, 1, 0, 0, 0, 0, -122, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 67,112,114,101,118,105,101,119, 0, 0, 99,101,110,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,248,115, 1, 0, 0, 0, 0,224,235,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,205,115, 1, 0, 0, 0, 0,128,215,115, 1, 0, 0, 0, 0, -192,206,115, 1, 0, 0, 0, 0, 84,213,149, 63,126,238, 7,193, 36,109,142, 63, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, - 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 1, 0, 0, 0, 65,245,214, 62, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -240,215,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,216,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0,100, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 2,224, 1, 60, 0, - 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 25, 0,141, 0, 88, 2, 88, 2,100, 0,100, 0, 2, 0, 2, 0, 0, 0, - 24, 0, 4, 0, 0, 0, 0, 0, 90, 0, 16, 0, 0, 0, 32, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 5, 0, 25, 0, 10, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,217,115, 1, 0, 0, 0, 0, 64,217,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 0, 2, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 47, 98, 97, 99,107, 98,117,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47,116,109,112, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 47, 47,102,116,121,112,101, 0, 64, 38, 35, 0, 0, 0, 0, 0, 64, 94, 0, 0, 64, 38, 94, 0, - 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 68,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0,192,249,117, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,224,205,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 80,206,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 34, 3, 28, 2,176, 6,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 80,206,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,192,206,115, 1, 0, 0, 0, 0, -224,205,115, 1, 0, 0, 0, 0, 14, 4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 34, 3,228, 2, 0, 2,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,192,206,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 48,207,115, 1, 0, 0, 0, 0, - 80,206,115, 1, 0, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,116, 3,187, 1,144, 88,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 48,207,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,160,207,115, 1, 0, 0, 0, 0, -192,206,115, 1, 0, 0, 0, 0, 32, 0, 0, 0, 4, 0, 0, 0, 0, 16, 0, 0,224, 46, 49, 1, 96, 46,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,160,207,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 16,208,115, 1, 0, 0, 0, 0, - 48,207,115, 1, 0, 0, 0, 0, 33, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 34, 3, 28, 2,192, 50,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 16,208,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,128,208,115, 1, 0, 0, 0, 0, -160,207,115, 1, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 20, 0, 0,224, 46, 52, 0, 0, 42,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,128,208,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,240,208,115, 1, 0, 0, 0, 0, - 16,208,115, 1, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 20, 0, 0,224, 46, 47, 0,160, 37,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,240,208,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 96,209,115, 1, 0, 0, 0, 0, -128,208,115, 1, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 20, 0, 0,224, 46, 85, 1, 64, 33,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 96,209,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,208,209,115, 1, 0, 0, 0, 0, -240,208,115, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 20, 0, 0,224, 46,158, 0,224, 28,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,208,209,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 64,210,115, 1, 0, 0, 0, 0, - 96,209,115, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 0, 20, 0, 0,224, 46,100, 0,128, 24,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 64,210,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,176,210,115, 1, 0, 0, 0, 0, -208,209,115, 1, 0, 0, 0, 0, 4, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0,254, 1,152, 1,224, 83,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,176,210,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 32,211,115, 1, 0, 0, 0, 0, - 64,210,115, 1, 0, 0, 0, 0, 14, 4, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 34, 3,228, 2, 0,253,115, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 32,211,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,144,211,115, 1, 0, 0, 0, 0, -176,210,115, 1, 0, 0, 0, 0, 64, 0, 0, 0, 13, 0, 0, 0, 0, 16, 0, 0,252, 1,162, 2,208, 74,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,144,211,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 0,212,115, 1, 0, 0, 0, 0, - 32,211,115, 1, 0, 0, 0, 0, 64, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0,249, 1,199, 1, 48, 79,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 0,212,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,112,212,115, 1, 0, 0, 0, 0, -144,211,115, 1, 0, 0, 0, 0, 32, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0,253, 1,124, 1,144, 95,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,112,212,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,224,212,115, 1, 0, 0, 0, 0, - 0,212,115, 1, 0, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,254, 1,125, 1, 32, 70,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,224,212,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 80,213,115, 1, 0, 0, 0, 0, -112,212,115, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 31, 3, 28, 2,112, 55,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 80,213,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,192,213,115, 1, 0, 0, 0, 0, -224,212,115, 1, 0, 0, 0, 0, 28, 4, 0, 0, 4, 0, 0, 0, 0, 20, 0, 0,224, 46,152, 1, 96, 11,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,192,213,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 48,214,115, 1, 0, 0, 0, 0, - 80,213,115, 1, 0, 0, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,254, 1,125, 1,112, 65,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 48,214,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,160,214,115, 1, 0, 0, 0, 0, -192,213,115, 1, 0, 0, 0, 0, 28, 4, 0, 0, 5, 0, 0, 0, 0, 20, 0, 0,224, 46, 44, 0, 32, 20,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,160,214,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 16,215,115, 1, 0, 0, 0, 0, - 48,214,115, 1, 0, 0, 0, 0, 8, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0,194, 1,152, 1, 32, 60,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0, 16,215,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0,128,215,115, 1, 0, 0, 0, 0, -160,214,115, 1, 0, 0, 0, 0, 28, 4, 0, 0, 6, 0, 0, 0, 0, 20, 0, 0,224, 46, 20, 0,192, 15,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,128,215,115, 1, 0, 0, 0, 0,107, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 16,215,115, 1, 0, 0, 0, 0,223, 5, 0, 0, 7, 0, 0, 0, 0, 4, 0, 0,224, 46, 62, 0,160,248,115, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,240,215,115, 1, 0, 0, 0, 0,106, 0, 0, 0, 1, 0, 0, 0, 44, 1, 0, 0, 1, 0, 2, 0, - 1, 0, 2, 0, 0, 0, 1, 0,244, 1,200, 0,100, 0, 20, 0, 16, 39, 0, 0,205,204,204, 61, 0, 0,240, 65, 0, 0, 0, 64, - 68, 65, 84, 65,152, 0, 0, 0, 96,216,115, 1, 0, 0, 0, 0,119, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0,205,204, 76, 63, - 0, 0,180, 66, 9, 0, 1, 0, 0, 0,128, 63,111, 18,131, 58, 32, 0, 32, 0, 32, 0, 1, 0, 0, 0,128, 63, 0, 0,128, 63, - 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 5, 0, 5, 0,255,255, - 50, 0, 50, 0, 10, 0, 0, 0, 50, 0,100, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, - 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 50, 0, 50, 0, 10, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 0, - 23,183,209, 56,205,204,204, 61, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 64,217,115, 1, 0, 0, 0, 0, -112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 32, 82,101,110,100,101,114, - 76, 97,121,101,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -160,243,115, 1, 0, 0, 0, 0,255,255, 15, 0,255,127, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 73, 77, 0, 0,176, 1, 0, 0, -208,217,115, 1, 0, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0,224,201,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 73,109, 97,103,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85,110,116,105,116,108,101,100, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,108,110,134, 68, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 73, 77, 0, 0,176, 1, 0, 0,224,201,114, 1, 0, 0, 0, 0, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208,217,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 77, 82,101,110,100,101,114, - 32, 82,101,115,117,108,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 67, 65, 0, 0,168, 0, 0, 0,192,219,115, 1, 0, 0, 0, 0, 26, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 67, 65, 67, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0,205,204, 76, 62,117,148, 96, 66, 76, 39,176, 64,210, 69,112, 66, 0, 0,240, 65, -161, 14,234, 64, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0,176,220,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, - 96,222,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 76, 97,109,112, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,160, 65,182,152,143, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 32,105,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 63, 0, 0, 32, 66, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, - 0, 2, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, -111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, 32,105,122, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63, -242, 4, 53,191,243, 4, 53, 63, 64, 75,122, 1, 0, 0, 0, 0,128,143,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 64, 75,122, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 0, 0,104, 1, 0, 0, 96,222,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, 16,224,115, 1, 0, 0, 0, 0, -176,220,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 8, 16, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 12, 64,247,255,239, 65, - 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0,192,118, 1, 0, 0, 0, 0, - 4, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 48, 1, 0, 0, 0,192,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63, -112,193,118, 1, 0, 0, 0, 0,192, 63,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,112,193,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0, - 16,224,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0,192,225,115, 1, 0, 0, 0, 0, 96,222,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,102,102,102, 63,247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0,176,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 46, 26,128, 63, - 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, - 0,176,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, - 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63,112,177,118, 1, 0, 0, 0, 0, -144,132,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,112,177,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0,192,225,115, 1, 0, 0, 0, 0, - 36, 0, 0, 0, 1, 0, 0, 0,112,227,115, 1, 0, 0, 0, 0, 16,224,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63,200,182, 27, 63, - 0, 0,128, 63, 0, 0, 0, 0,208,155,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, - 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,208,155,118, 1, 0, 0, 0, 0, - 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, -243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63, 64,157,118, 1, 0, 0, 0, 0,224,144,117, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, - 64,157,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0,112,227,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, - 32,229,115, 1, 0, 0, 0, 0,192,225,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 83,112,111,116, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, -205,204,204, 62,247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63,200,182, 27, 63, 0, 0,128, 63, 0, 0, 0, 0, -160,157,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, - 64, 11, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, -111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,160,157,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63, -242, 4, 53,191,243, 4, 53, 63, 16,159,118, 1, 0, 0, 0, 0, 48,157,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 16,159,118, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 0, 0,104, 1, 0, 0, 32,229,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0,208,230,115, 1, 0, 0, 0, 0, -112,227,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, - 48, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 8, 16, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 80, 78, 83, 63,247,255,239, 65, - 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0,112,159,118, 1, 0, 0, 0, 0, - 4, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 48, 1, 0, 0,112,159,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63, -224,160,118, 1, 0, 0, 0, 0,128,169,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0,224,160,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0, -208,230,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0,128,232,115, 1, 0, 0, 0, 0, 32,229,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 54, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 8, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 51, 51,179, 63,247,255,239, 65, 0, 0, 72, 66,171,156, 8, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 16, 76,118, 1, 0, 0, 0, 0, 4, 0, 0, 0, 78,207, 68, 65, - 25, 4,240, 65, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, 0, 2, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0, - 16, 76,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, - 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63,128, 77,118, 1, 0, 0, 0, 0, -208,181,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 68, 65, 84, 65, 24, 0, 0, 0,128, 77,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0,128,232,115, 1, 0, 0, 0, 0, - 36, 0, 0, 0, 1, 0, 0, 0, 48,234,115, 1, 0, 0, 0, 0,208,230,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 83,112,111,116, 46, 48, 48, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,247,255,239, 65, 0, 0,150, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0,224, 77,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 46, 26,128, 63, 25, 4,240, 65, 0, 0, 52, 66, - 0, 0,128, 63, 0, 0, 64, 64, 64, 11, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63,111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,224, 77,118, 1, 0, 0, 0, 0, - 2, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63, -243, 4, 53,191,242, 4, 53, 63,242, 4, 53,191,243, 4, 53, 63, 80, 79,118, 1, 0, 0, 0, 0, 32,194,117, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, - 80, 79,118, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 76, 65, 0, 0,104, 1, 0, 0, 48,234,115, 1, 0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128,232,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 65, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,192, 63, 0, 0,160, 65, 0, 0, 52, 66,154,153, 25, 62, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, -176, 79,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 63, 0, 0, 32, 66, 0, 0, 52, 66, 0, 0,128, 63, 0, 0, 64, 64, - 0, 2, 3, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, -111, 18,131, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 1, 0, 0,176, 79,118, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 2, 0, 1, 0, 0, 0,128, 67, 0, 0, 0, 0, 0, 0,128, 63,243, 4, 53,191,242, 4, 53, 63, -242, 4, 53,191,243, 4, 53, 63, 32, 81,118, 1, 0, 0, 0, 0,176,207,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 68, 65, 84, 65, 24, 0, 0, 0, 32, 81,118, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 87, 79, 0, 0,152, 1, 0, 0,224,235,115, 1, 0, 0, 0, 0,105, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 87,111,114,108,100, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,141, 47, 79, 62, 64, 19,209, 62, 73, 23, 14, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 28, 65, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 64, 0, 0, 0, 0, 0, 0,112, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 0, 0, - 0, 0,128, 63,205,204, 76, 61, 0, 0, 5, 0, 0, 0, 0, 0, 10,215,163, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 0, 0,152, 0, 0, 0,192,237,115, 1, 0, 0, 0, 0, - 24, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 84,101,120,116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, -160,238,115, 1, 0, 0, 0, 0,160,238,115, 1, 0, 0, 0, 0,160,238,115, 1, 0, 0, 0, 0,160,238,115, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 96,239,115, 1, 0, 0, 0, 0,255,255,255,255, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 40, 0, 0, 0,160,238,115, 1, 0, 0, 0, 0, 23, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16,239,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 69, 82, 70, - 68, 65, 84, 65, 4, 0, 0, 0, 16,239,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 71, 82, 0, 0, - 96, 0, 0, 0,160,243,115, 1, 0, 0, 0, 0,208, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 82, 79,118,101,114,114,105,100,101, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,244,115, 1, - 0, 0, 0, 0, 48,248,115, 1, 0, 0, 0, 0,255,255, 15, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 64,244,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,176,244,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 46,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,176,244,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 32,245,115, 1, 0, 0, 0, 0, 64,244,115, 1, 0, 0, 0, 0, 0, 42,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 32,245,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,144,245,115, 1, 0, 0, 0, 0,176,244,115, 1, 0, 0, 0, 0,160, 37,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,144,245,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 0,246,115, 1, 0, 0, 0, 0, 32,245,115, 1, 0, 0, 0, 0, 64, 33,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 0,246,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,112,246,115, 1, 0, 0, 0, 0,144,245,115, 1, 0, 0, 0, 0,224, 28,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,112,246,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,224,246,115, 1, 0, 0, 0, 0, 0,246,115, 1, 0, 0, 0, 0,128, 24,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,224,246,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 80,247,115, 1, 0, 0, 0, 0,112,246,115, 1, 0, 0, 0, 0,208, 74,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 80,247,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0,192,247,115, 1, 0, 0, 0, 0,224,246,115, 1, 0, 0, 0, 0, 96, 11,116, 1, - 0, 0, 0, 0,160, 44,191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0,192,247,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 48,248,115, 1, 0, 0, 0, 0, 80,247,115, 1, 0, 0, 0, 0, 32, 20,116, 1, - 0, 0, 0, 0,240,189,126, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 0, 0, 0, 48,248,115, 1, - 0, 0, 0, 0,207, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,247,115, 1, 0, 0, 0, 0,192, 15,116, 1, - 0, 0, 0, 0,176, 51,191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,160,248,115, 1, - 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 0,253,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 67, 97,109,101,114, 97, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,219,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78,199, 41,188,225,230, 30,193,216,129,230, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218, 15,201, 63, 0, 0,128, 37,255,255,127, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,255,255,127, 37, 0, 0,128,165, 0, 0, 0, 0,255,255,127, 37,105, 33,162, 51, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 37, 0, 0,128,191,105, 33,162, 51, 0, 0, 0, 0, 78,199, 41,188,225,230, 30,193, -216,129,230, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 60,110,145,137,160,133,136, 24, 0, 0, 0, 0,254,255,127, 25, 0, 0,128, 63, - 0, 0, 0, 40, 0, 0, 0, 0,255,255,127,165, 64, 90,136,176, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 60,110,145,137,160,133,136, 24, 0, 0, 0, 0,254,255,127, 25, 0, 0,128, 63, - 0, 0, 0, 40, 0, 0, 0, 0,255,255,127,165, 64, 90,136,176, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63,223, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0,128, 63, - 6, 41,100, 63, 0, 0,128, 63,205,204,204, 62, 6, 41,100, 63, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 0,253,115, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0, 0, 2,116, 1, 0, 0, 0, 0,160,248,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 46, 48, 48, 49, 0, 46, 48, 48, 49, 0, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 83,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,176, 1,116, 1, 0, 0, 0, 0, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 36,190, 64, 69, 36,190, 64, 68, 36,190, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,218, 15, 73, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 83,115,134, 64, 82,115,134, 64, 0, 0, 0, 0, 0, 0, 0, 0, 82,115,134,192, 83,115,134, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 36,190, 64, 0, 0, 0, 0, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,179, 0, 0, 0, 0, 0, 0,128, 63, -207,183,243, 61,205,183,243,189,160, 83,162, 37, 0, 0, 0, 0, 29, 90, 26, 50, 31, 90, 26, 50,173, 85, 44, 62, 0, 0, 0, 0, -205,183,243,189,207,183,243,189, 24,107, 87, 50, 0, 0, 0, 0,158,176,247,190,212,108,246,190, 64,232, 97,190, 0, 0,128, 63, - 14, 4, 0, 0, 0, 4, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 64,117,127, 1, 0, 0, 0, 0, 80,133,127, 1, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,176, 1,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,224,103,116, 1, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 0, 2,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,176, 6,116, 1, - 0, 0, 0, 0, 0,253,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104, -101, 99,107,101,114,115, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 2,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 6,116, 1, - 0, 0, 0, 0, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 69, 36,190, 64, 69, 36,190, 64, 68, 36,190, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,128,218, 15, 73, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 83,115,134, 64, 82,115,134, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 82,115,134,192, 83,115,134, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 36,190, 64, 0, 0, 0, 0, 52, 84,142, 55,194, 12,188,192, 28, 38, 71, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,179, 0, 0, 0, 0, 0, 0,128, 63,207,183,243, 61,205,183,243,189, -160, 83,162, 37, 0, 0, 0, 0, 29, 90, 26, 50, 31, 90, 26, 50,173, 85, 44, 62, 0, 0, 0, 0,205,183,243,189,207,183,243,189, - 24,107, 87, 50, 0, 0, 0, 0,158,176,247,190,212,108,246,190, 64,232, 97,190, 0, 0,128, 63, 14, 4, 0, 0, 0, 4, 1, 0, - 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 32,105, 1, - 0, 0, 0, 0,144,244,123, 1, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 0, 0, 0, 96, 6,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 64,100,116, 1, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0,176, 6,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 96, 11,116, 1, 0, 0, 0, 0, 0, 2,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 46, 48, - 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,162,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 11,116, 1, 0, 0, 0, 0, 0,131,102, 60, - 14,112,164, 64, 24,211,229, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178,159, 34, 65,178,159, 34, 65,177,159, 34, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, -166,250, 89,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,178,159, 34, 65,151,120, 10,180, 0, 0, 0, 0, 0, 0, 0, 0, -151,120, 10, 52,178,159, 34, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,177,159, 34, 65, 0, 0, 0, 0, - 0,131,102, 60, 14,112,164, 64, 24,211,229, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,231,126,201, 61,219,145,171, 48, 34, 66,201,163, 0, 0, 0, 0, - 65,209,167,164, 51, 57,255, 49,232,126,201, 61, 0, 0, 0, 0,235, 66,172, 48,231,126,201,189, 70,201,251, 49, 0, 0, 0, 0, - 18,136, 29,187,203,200,189,191,180,139, 9, 58, 0, 0,128, 63, 33, 0, 0, 0, 0, 0, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 36, 78, 1, 0, 0, 0, 0,128,105, 65, 1, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 16, 11,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,224,103,116, 1, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 96, 11,116, 1, - 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,192, 15,116, 1, 0, 0, 0, 0,176, 6,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,222,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 57,110, 65,237,114, 11, 64,120, 99,121, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190,115,209,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0,136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0,164, 21, 44,191, 28, 67,194, 61, -176,248, 59, 63, 0, 0, 0, 0,251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0, 42, 57,110, 65,237,114, 11, 64, -120, 99,121, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,254,255,255, 38, 0, 0, 0, 51, 0, 0, 0, 0,254,255,255, 50,254,255,127, 63, -254,255,127, 38, 0, 0, 0, 0, 0, 0, 64,179,254,255,127, 51, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63,138,247,255, 62,164, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0,141, 26,182, 62,176,248, 59, 63, - 45, 7, 20, 63, 0, 0, 0, 0, 37, 39, 74,191, 9, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0,147, 14,142,193, 35,125,234, 64, - 85,119, 0,192, 0, 0,128, 63, 28, 4, 0, 0, 0, 20, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, - 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,192, 15,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0, 32, 20,116, 1, 0, 0, 0, 0, 96, 11,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,224,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 76,210,191,178,162, 71,193,210,186,178, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190,115,209,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0,164, 21, 44,191, 28, 67,194, 61,176,248, 59, 63, 0, 0, 0, 0, -251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0, 84, 76,210,191,178,162, 71,193,210,186,178, 64, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -254,255,127, 63,251,255,255, 50,251,255, 47, 52, 0, 0, 0, 0,251,255,127,180, 1, 0,128, 63,249,255,127, 52, 0, 0, 0, 0, -251,255,159, 52,250,255,127,179,250,255,127, 63, 0, 0, 0, 0,254,255,127,181,251,255,255,168,251,255, 47,170, 0, 0,128, 63, -136,247,255, 62,164, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0,139, 26,182, 62,173,248, 59, 63, 44, 7, 20, 63, 0, 0, 0, 0, - 36, 39, 74,191, 17, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0,191,129,189, 63,176,159,104,192,132,194, 53,192, 0, 0,128, 63, - 28, 4, 0, 0, 0, 20, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 32, 20,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,128, 24,116, 1, - 0, 0, 0, 0,192, 15,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97, -109,112, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208,230,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,238,188, 16,193,229,119, 57,193, 17,218,141, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -202, 79, 15,191,179,100, 12,191,112, 92,234, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,171,197, 96,190,149, 27, 83, 63, - 10,118, 5, 63, 0, 0, 0, 0,142,218, 99,191,109, 4, 75, 61,179, 3,232,190, 0, 0, 0, 0,233,142,204,190,104, 64, 16,191, -174, 28, 57, 63, 0, 0, 0, 0,238,188, 16,193,229,119, 57,193, 17,218,141, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 1, 0,128, 63, 1, 0,128,179, - 2, 0,128, 51, 0, 0, 0, 0, 1, 0,160,179, 0, 0,128, 63, 0, 0, 32,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 2, 0,192,180, 3, 0,128, 51, 0, 0, 0, 54, 0, 0,128, 63,175,197, 96,190,143,218, 99,191, -235,142,204,190, 0, 0, 0, 0, 11,118, 5, 63,179, 3,232,190,172, 28, 57, 63, 0, 0, 0, 0,150, 27, 83,191,119, 4, 75,189, -105, 64, 16, 63, 0, 0, 0, 0,128,181, 14,193,214,177, 61,191, 29,133,128,193, 0, 0,128, 63, 28, 4, 0, 0, 0, 20, 0, 0, - 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0,128, 24,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,224, 28,116, 1, 0, 0, 0, 0, 32, 20,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,225,115, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,147,104, 64, - 42, 84, 23,193,116, 77,171, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190, -115,209,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0, -164, 21, 44,191, 28, 67,194, 61,176,248, 59, 63, 0, 0, 0, 0,251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0, -176,147,104, 64, 42, 84, 23,193,116, 77,171, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,254,255,127, 63, 0, 0, 0, 0,255,255,191, 51, 0, 0, 0, 0, -255,255,127, 51, 0, 0,128, 63,255,255,127,179, 0, 0, 0, 0,254,255,127,179, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, -255,255,127, 52, 0, 0,160, 52, 0, 0,128, 39, 0, 0,128, 63,137,247,255, 62,165, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0, -141, 26,182, 62,176,248, 59, 63, 46, 7, 20, 63, 0, 0, 0, 0, 37, 39, 74,191, 20, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0, - 91, 99, 93,192,136, 98, 80,190,223,119,112,192, 0, 0,128, 63, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,224, 28,116, 1, - 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 64, 33,116, 1, 0, 0, 0, 0,128, 24,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,227,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,249,147,251,192,206, 0, 24,193, 67,131,104,192, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190,115,209,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0,136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0,164, 21, 44,191, 28, 67,194, 61, -176,248, 59, 63, 0, 0, 0, 0,251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0,249,147,251,192,206, 0, 24,193, - 67,131,104,192, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,254,255,255, 50, 0, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 0,254,255,127, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 50,254,255,255, 50, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128,181,255,255,191,180, - 1, 0,224, 52, 0, 0,128, 63,137,247,255, 62,165, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0,139, 26,182, 62,176,248, 59, 63, - 45, 7, 20, 63, 0, 0, 0, 0, 36, 39, 74,191, 19, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0,147,142,176, 64, 97, 22,170,191, - 27, 28,246, 64, 0, 0,128, 63, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, - 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 64, 33,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0,160, 37,116, 1, 0, 0, 0, 0,224, 28,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,229,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,142, 41, 54, 65, 24,124,115,191,162,215, 58,192, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190,115,209,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0,164, 21, 44,191, 28, 67,194, 61,176,248, 59, 63, 0, 0, 0, 0, -251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0,142, 41, 54, 65, 24,124,115,191,162,215, 58,192, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -136,247,255, 62,164, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0,139, 26,182, 62,175,248, 59, 63, 46, 7, 20, 63, 0, 0, 0, 0, - 36, 39, 74,191, 25, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0,139,192, 49,193, 40, 99, 36, 65, 89,156,249, 63, 0, 0,128, 63, - 2, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,160, 37,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 0, 42,116, 1, - 0, 0, 0, 0, 64, 33,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97, -109,112, 46, 48, 48, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208,230,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,220,239, 19,193,215,239, 54,193, 42, 9, 60, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 67,251,103,191,164, 27, 24,191, 37,136, 3, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 31,143,197,190,209,184, 59, 63, -138, 80, 15, 63, 0, 0, 0, 0, 57, 66, 64,191,132,119,210, 61,118,249, 38,191, 0, 0, 0, 0, 37, 43, 9,191, 35, 15, 44,191, -114,212, 2, 63, 0, 0, 0, 0,220,239, 19,193,215,239, 54,193, 42, 9, 60, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 31,143,197,190, 56, 66, 64,191, - 35, 43, 9,191, 0, 0, 0, 0,139, 80, 15, 63,117,249, 38,191,112,212, 2, 63, 0, 0, 0, 0,208,184, 59,191,142,119,210,189, - 35, 15, 44, 63, 0, 0, 0, 0,195,135, 0,193,127,252,148,190, 8,180, 48,193, 0, 0,128, 63, 2, 0, 0, 0, 0, 16, 0, 0, - 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0, 0, 42,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 96, 46,116, 1, 0, 0, 0, 0,160, 37,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 55, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,232,115, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,104, 99,164,192, -239,244, 51,193,188,110, 19, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 90,103, 63,254, 45,186,190, -115,209,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,136,247,255, 62, 37, 39, 74, 63,138, 26,182, 62, 0, 0, 0, 0, -164, 21, 44,191, 28, 67,194, 61,176,248, 59, 63, 0, 0, 0, 0,251,203, 11, 63,217, 45, 27,191, 47, 7, 20, 63, 0, 0, 0, 0, -104, 99,164,192,239,244, 51,193,188,110, 19, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,137,247,255, 62,165, 21, 44,191,251,203, 11, 63, 0, 0, 0, 0, -139, 26,182, 62,178,248, 59, 63, 45, 7, 20, 63, 0, 0, 0, 0, 36, 39, 74,191, 18, 67,194,189,217, 45, 27, 63, 0, 0, 0, 0, - 96, 24, 91, 64,226, 50,108,192,101, 9,219, 63, 0, 0,128, 63, 2, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 96, 46,116, 1, - 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,192, 50,116, 1, 0, 0, 0, 0, 0, 42,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 76, 97,109,112, 46, 48, 48, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,234,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,145, 75,188, 63, 44,197,107,193, 5,147, 81, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218, 15,201, 63, 0, 0,128, 37,255,255,127, 37, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,255,255,127, 37, 0, 0,128,165, 0, 0, 0, 0,255,255,127, 37,105, 33,162, 51, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 37, 0, 0,128,191,105, 33,162, 51, 0, 0, 0, 0,145, 75,188, 63, 44,197,107,193, - 5,147, 81, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 45, 25, 23,178,107,199, 75,179, 0, 0, 0, 0, 0,127,236,153, 0, 0,128, 63, - 0, 0, 0, 40, 0, 0, 0, 0, 0,127,108,177,206, 9, 29, 50, 0, 0,128, 63, 0, 0, 0, 0, 32,159,189,191, 47,164,188,191, -150,188,153,192, 0, 0,128, 63, 32, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, - 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,192, 50,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0,112, 55,116, 1, 0, 0, 0, 0, 96, 46,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 99,104,101, 99,107,101,114,115, 0, 0,108, 97,110,101, 46, 48, 48, 51, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,178,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 55,116, 1, 0, 0, 0, 0, 0,131,102, 60, 14,112,164, 64, 24,211,229, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178,159, 34, 65,178,159, 34, 65,177,159, 34, 65, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,166,250, 89,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -178,159, 34, 65,151,120, 10,180, 0, 0, 0, 0, 0, 0, 0, 0,151,120, 10, 52,178,159, 34, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,177,159, 34, 65, 0, 0, 0, 0, 0,131,102, 60, 14,112,164, 64, 24,211,229, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -231,126,201, 61,219,145,171, 48, 34, 66,201,163, 0, 0, 0, 0, 65,209,167,164, 51, 57,255, 49,232,126,201, 61, 0, 0, 0, 0, -235, 66,172, 48,231,126,201,189, 70,201,251, 49, 0, 0, 0, 0, 18,136, 29,187,203,200,189,191,180,139, 9, 58, 0, 0,128, 63, - 33, 0, 0, 0, 0, 0, 1, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 64, 70, 88, 1, 0, 0, 0, 0,128,224,117, 1, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 32, 55,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 64,100,116, 1, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,112, 55,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 32, 60,116, 1, - 0, 0, 0, 0,192, 50,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114, -101,118,105,101,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,192, 66,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 59,116, 1, - 0, 0, 0, 0,100, 82, 7,189, 21,204,103,191,241,165,230, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,153, 39,155, 64,153, 39,155, 64,153, 39,155, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -218, 15,201, 63, 0, 0,192, 37,255,255,255, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,153, 39,155, 64,152, 39, 27, 38, -102,187,232,166, 0, 0, 0, 0,102,187,232, 38,157,134,196, 52,153, 39,155, 64, 0, 0, 0, 0,154, 39, 27, 38,153, 39,155,192, -157,134,196, 52, 0, 0, 0, 0,100, 82, 7,189, 21,204,103,191,241,165,230, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 32,222,204,151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,120,200,204, 24, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,179, 0, 0, 0, 0, 0, 0,128, 63, 25, 50, 83, 62, 28, 50,211, 35, - 23, 50,211,163, 0, 0, 0, 0, 27, 50,211,163, 25, 50, 83, 62,158, 59,174, 38, 0, 0, 0, 0, 0, 94,204,173,158, 79, 96,175, - 25, 50, 83, 62, 0, 0, 0, 0,135, 62,153, 59,217, 94,110,185,118, 71,238, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,233,117, 1, - 0, 0, 0, 0,240,240,117, 1, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 0, 0, 0,208, 59,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0, 32, 60,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,112, 65,116, 1, 0, 0, 0, 0,112, 55,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, - 50, 0, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,130,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128, 64,116, 1, 0, 0, 0, 0,128, 64,116, 1, 0, 0, 0, 0, 32, 65,116, 1, 0, 0, 0, 0,242,187,213,191, -194,145,134, 63,254,100, 35, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -243, 0, 28, 65,246, 0, 28, 65,243, 0, 28, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48,110,135, 63,180,169, 59, 62, -138,115, 1,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,198, 49, 6, 65,115,154,148,192, 3,113,227,191, 0, 0, 0, 0, -159,250,106, 64,189,207, 91, 64, 80,170, 5, 65, 0, 0, 0, 0, 46,151, 86,192,125, 94,251,192,188,127,150, 64, 0, 0, 0, 0, -242,187,213,191,194,145,134, 63,254,100, 35, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,143,174,180, 61,160, 48, 30, 61,223,118, 16,189, 0, 0, 0, 0, -162, 29,153,188, 38,248,179, 61,115,162, 74, 61, 0, 0, 0, 0, 15, 21, 72, 61,160,250, 19,189, 88, 57,169, 61, 0, 0, 0, 0, - 4,107, 50, 63, 88, 46,204,190,177,206, 79, 63, 0, 0,128, 63, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 32, 65,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 88, 0, 0, 0,128, 64,116, 1, - 0, 0, 0, 0, 73, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 31, 0, 0, 0, 83,117, 98,115,117,114,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,112, 65,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 32, 70,116, 1, - 0, 0, 0, 0, 32, 60,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114, -101,118,105,101,119, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128,202,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 69,116, 1, - 0, 0, 0, 0, 16,194,203,187,155, 89, 45, 63,244,153,230, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 56,135, 72, 63, 56,135, 72, 63, 56,135, 72, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 56,135, 72, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,135, 72, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56,135, 72, 63, 0, 0, 0, 0, 16,194,203,187,155, 89, 45, 63,244,153,230, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,144,104,163, 63,143,104,163, 37, -143,104,163,165, 0, 0, 0, 0, 66,104,165, 37,252,250,206, 51,144,104,163, 63, 0, 0, 0, 0, 60,240,202,173,144,104,163,191, -183, 63,204, 51, 0, 0, 0, 0,105, 93,173,187,172,176, 88,193, 95, 52,118,186, 0, 0,128, 63, 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 0, 0, 0,208, 69,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0, 32, 70,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,208, 74,116, 1, 0, 0, 0, 0,112, 65,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, - 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,202,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 74,116, 1, 0, 0, 0, 0, 0, 31, 10, 58, - 59, 94,236, 63,236, 84,231, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 91,188,110, 63, 91,188,110, 63, 91,188,110, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218, 15,201, 63, 0, 0, 0,128, - 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 91,188,110, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 90, 50,151, 51, 91,188,110, 63, 0, 0, 0, 0, 0, 0, 0, 0, 91,188,110,191, 90, 50,151, 51, 0, 0, 0, 0, - 0, 31, 10, 58, 59, 94,236, 63,236, 84,231, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,160, 65,137, 63,159, 65,137,165,161, 65,137,165, 0, 0, 0, 0, -160, 65,137, 37,160, 65,137, 63,157, 46, 19, 40, 0, 0, 0, 0,248,127, 14, 45,159,195,150,176,161, 65,137, 63, 0, 0, 0, 0, - 29, 80, 63,188, 62, 95,226,187, 87, 19, 74, 65, 0, 0,128, 63, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,128, 74,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,208, 74,116, 1, - 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0, 48, 79,116, 1, 0, 0, 0, 0, 32, 70,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, 53, 0, 48, 48, 51, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,220,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,155,195,189, 20,145,188, 64, 94,220, 88, 65, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,180,134, 63, 48,190,141, 37,253, 55, 57, 35, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63,253, 55, 57, 35, 48,190,141,165, 0, 0, 0, 0,219,128,112, 37, 52,177,253, 62, - 94, 93, 94, 63, 0, 0, 0, 0, 52,133, 22, 37, 94, 93, 94,191, 52,177,253, 62, 0, 0, 0, 0,128,155,195,189, 20,145,188, 64, - 94,220, 88, 65, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 23,252, 16, 37,196,176, 70,165, 0, 0, 0, 0, 80, 90,231,174, 94, 93, 94, 63, - 52,177,253, 62, 0, 0, 0, 0, 0, 68,239,172, 50,177,253,190, 95, 93, 94, 63, 0, 0, 0, 0,150, 98,174, 61, 85,101,144,193, -196,124,253, 64, 0, 0,128, 63, 64, 0, 0, 0, 0, 16, 0, 0, 0, 0, 68, 0, 5, 0, 1, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 7, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, - 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0, 48, 79,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0,224, 83,116, 1, 0, 0, 0, 0,208, 74,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119, 46, 48, 48, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 85,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,144, 83,116, 1, 0, 0, 0, 0, 94, 52,252,190,174,101,228, 65,141,116, 17, 65, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,235,239, 30, 66,236,239, 30, 66,235,239, 30, 66, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,138,174, 95, 63, 98,132,123, 37, 61, 56, 87,165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -235,239, 30, 66,105,158, 5,168,108, 39, 28,168, 0, 0, 0, 0,212,129, 77, 40, 66, 15,204, 65,158,186,243, 65, 0, 0, 0, 0, - 55, 89, 13,165,156,186,243,193, 65, 15,204, 65, 0, 0, 0, 0, 94, 52,252,190,174,101,228, 65,141,116, 17, 65, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, -101, 43,206, 60,143,217,240, 34,201,165, 18,163, 0, 0, 0, 0,226, 14,231, 31,101, 20,158, 60,193, 89,132, 60, 0, 0, 0, 0, -190, 83,173, 34,192, 89,132,188,103, 20,158, 60, 0, 0, 0, 0, 11,215, 70, 60, 61, 43, 67,191,185,241, 31, 63, 0, 0,128, 63, - 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,144, 83,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,224, 83,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,144, 88,116, 1, - 0, 0, 0, 0, 48, 79,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114, -101,118,105,101,119, 99,117, 98,101, 0,117, 98,101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112, 94,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 88,116, 1, - 0, 0, 0, 0,128,253, 88, 59,220,118,160, 63, 0, 15, 37, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 84, 88, 68, 64, 84, 88, 68, 64, 83, 88, 68, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1,190,237, 62,108,230,217,190, 20,151, 52, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 67, 38, 8, 64,191,228,231, 63, -186, 31,162, 63, 0, 0, 0, 0, 35,118, 13,192, 2, 61,220, 63, 31, 44,160, 63, 0, 0, 0, 0,166, 52,234, 60,102,223,227,191, - 55,229, 31, 64, 0, 0, 0, 0,128,253, 88, 59,220,118,160, 63, 0, 15, 37, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 10,115,103, 62,201,122,112,190, -255, 17, 71, 59, 0, 0, 0, 0,116,205, 9, 62,205, 36, 8, 62,136,232,135, 62, 0, 0, 0, 0, 1, 27, 69,190,224, 50, 59,190, - 25,176, 65, 62, 0, 0, 0, 0,110,176, 16,192,158, 71, 9,192,115, 90,244, 63, 0, 0,128, 63, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, - 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 0, 0, 0, 64, 88,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, - 32, 4, 0, 0,144, 88,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, 1, 0, 0, 0,144, 95,116, 1, 0, 0, 0, 0,224, 83,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 66,112,114,101,118,105,101,119,104, 97,105, -114, 0,108, 97,110,101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,194,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,224,223,117, 1, 0, 0, 0, 0,224,223,117, 1, 0, 0, 0, 0, 64, 95,116, 1, 0, 0, 0, 0, 86, 92,200, 63, - 7,205,227, 63,149,199, 9,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -234,126, 47, 64,234,126, 47, 64,236,126, 47, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,225, 80, 2, 63, 5,211, 15,191, - 92,219, 18, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0,224,254, 18, 64, 23,209,169, 62, 27,251,186, 63, 0, 0, 0, 0, - 71,254,133,191,207, 40, 17, 64,229,194,144, 63, 0, 0, 0, 0, 78, 38,137,191, 48,162,192,191,125,176, 1, 64, 0, 0, 0, 0, - 86, 92,200, 63, 7,205,227, 63,149,199, 9,189, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 2, 0, 64,179, 0, 0,128,179, 0, 0, 0, 0, - 2, 0, 64, 51, 1, 0,128, 63, 2, 0, 64,167, 0, 0, 0, 0, 0, 0,192,179, 0, 0, 0,179, 0, 0,128, 63, 0, 0, 0, 0, -255,255,127,179, 2, 0,192,179, 0, 0, 0,180, 0, 0,128, 63,244,100,156, 62,135,143, 14,190, 52,235, 17,190, 0, 0, 0, 0, -175,239, 70, 62,102, 4, 26, 62, 72,251,137, 62, 0, 0, 0, 0,174,172, 52,189,211,112,154,190, 67,243, 76, 62, 0, 0, 0, 0, -149, 56, 36,191,139, 98, 66,192,168, 5, 68, 64, 0, 0,128, 63, 0, 4, 0, 0, 1, 4, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, - 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, - 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63,205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220,117, 1, 0, 0, 0, 0, 0,220,117, 1, - 0, 0, 0, 0,128, 94,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 64, 95,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,120, 0, 0, 0,128, 94,116, 1, - 0, 0, 0, 0,101, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61,205,204, 76, 62, 10,215,163, 60, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,104, 1, 0, 0, 0,220,117, 1, 0, 0, 0, 0, 12, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,221,117, 1, 0, 0, 0, 0,240, 21,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,193,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,244,100,156, 62, -135,143, 14,190, 52,235, 17,190, 0, 0, 0, 0,175,239, 70, 62,102, 4, 26, 62, 72,251,137, 62, 0, 0, 0, 0,174,172, 52,189, -211,112,154,190, 67,243, 76, 62, 0, 0, 0, 0,149, 56, 36,191,139, 98, 66,192,168, 5, 68, 64, 0, 0,128, 63, 0, 0, 0, 64, - 0, 0, 0, 0, 17, 2, 0, 0,150, 0, 0, 0, 0, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,224,121, 0, 0,240, 21,124, 1, 0, 0, 0, 0, 10, 1, 0, 0,150, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 21,135, 17,192, 32,121, 97,192,108, 32,141, 63,190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62, -198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 96,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 96, 32, 63, -185,201,160, 62,160, 3, 6, 63, 11, 34,248,190,192, 53,185, 60,192,197,178, 61,174,184, 53, 63,224,172,162,190,108,136,224, 62, -142,173, 61,191,181, 96, 10, 60,201,196,163, 61, 78,182, 99, 63,165,242,180, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,248,112,150, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,109, 46, 7,192,144, 26, 60,192, 25,147,207, 63, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 19,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,121,229,190,108, 50, 41,191,136,152, 7,191,155,100,146,190,146,141, 25,191, - 40, 92,142, 62,212,104, 18, 63,228,105,105,190,112,156, 96, 62,137,226, 69,191,146,247, 17, 61, 49,172, 44, 62, 17,125, 54, 63, - 69,195,169, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,144, 63,245, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,224,103,174,189, 59, 88, 17,192,230, 35, 76, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176,101,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,102,160,155, 62, - 58, 87,152, 62,118,199, 84,191, 84, 89,183, 62,120,103,231, 62,112, 47,177,189,156, 8, 4,191,100, 60,199, 62,200, 40,177,189, - 0, 14, 46, 62,101, 96, 39, 62,100,119,242, 61,188,168,146, 62, 55, 9,221, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,135, 36, 87, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,102,131,192,184,241, 26, 63,143,198, 76, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128,127, 92, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 80, 39, 63,171, 26,218,190, 88,118, 16, 63,131, 72,138,190,168,255,122,190, -185,111, 14,191, 22,207, 38, 63, 80,252,211, 61,198,177, 80,191, 40,154,203,189,226,146, 53, 61, 63,180,115, 63,246,113, 42, 59, -153, 63,144, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,175, 95,142, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 43,226,189,254, 85,220,191,226,104,101, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,220,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119, 97, 45, 63, -120, 47,205,190, 35,117, 19, 63,168,125, 98, 62,240,195, 73, 62,124,228,243, 62,120, 86, 11, 63, 72,156, 89, 62,230,232, 88, 63, -130, 53,204,190,248,120,128, 62, 17,194, 20, 62, 61, 15, 90, 62, 94, 30,200, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 53,129,253, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,108,159,129,191, 4,210, 6, 63, 35,221,152, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0,219,135, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,167,210,190,195,172,139, 62,250,220, 35, 63, 30,182, 22,191,128, 3,136, 61, -110,164,176,190, 30,153,147,190, 0,249, 10,188,234, 90,160,190, 90,241,205,190,148,235, 25, 63,206,172,146, 62,143,195, 52, 61, -104,142,139, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 37,227, 77, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,114,167,189,191,212, 59,104,192,184,179,184, 63,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 0,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 45,121, 62, -121,126, 98, 63, 56,171,135,189,139,174,200,190,220,142, 21, 63, 77, 70, 40,191,116, 70,150, 62, 0,245, 92, 61,160,118,174,190, -176,217, 49, 63,120,167,104, 60,164,104,235, 60,217,251, 73, 63, 12, 25, 44, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,217, 2,247, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,112, 30, 63,112, 69, 82,192, 58,191, 51, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,200,206,183,190,199,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 45,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,227,137,190,206,195, 71,191, 70, 31, 96,190,127, 46, 5, 63, 96, 51,214,189, -228, 61, 67,191,136, 90, 2, 62,120,214,146,190, 32,111, 33, 62,136,229,187,190, 28,112,241, 60, 3,187,177, 60, 6,134,171, 62, -164, 35, 29, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,130,192, 56, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,116,148,176,191,100,200, 1, 63, 89, 48,146, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,144,124, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,169, 82,190, -102,214, 57, 63, 55,112, 36,191, 61,205, 9, 62,184,139, 5, 63,104, 32, 43,190,120, 62, 37,191,220,215, 15, 63,180, 2, 8, 63, -196,170,163, 62,159,178, 8, 63,184,164,184, 62, 70, 72, 63, 61, 17,104,112, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 97,249,192, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,198, 80,168,191, 7,154,165,191,229,248, 80, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48,145,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,145, 5,191, 84, 77,126, 62, 14,133, 63,191,190, 5,167, 62,124,212, 96,190, -232,136,176, 62, 32,193, 80,189,144, 49, 18, 62,224, 40, 25, 62, 59,204, 10,191,177, 46,104, 62, 36,106,150, 62, 1, 61,138, 62, - 4,131, 86, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 39, 27, 19, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,224,189,246,189,236,129, 90,192,226,155, 20, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112,111,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 77, 14,191, -232, 81,154, 62, 41,220, 22,191,104,189, 0,191,214,167,160,190,140, 60, 22,190, 38, 85, 74, 63, 32,253, 8,191, 96,146, 23, 61, -196, 30,177,190, 80, 25,187, 60,206,244,194, 60, 50,234,253, 62,235, 52,234, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,218, 21, 79, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144,231, 67,190,176,104, 11,189,211,111,153, 64, -190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144,112,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74,110,205, 62,147,226, 27,191, 69, 95,219, 61, 76, 3, 45, 63,222,109,147,190, -152,196, 40, 63, 36,136,116,190,180, 21,190,190,210, 38,213,190,112,230,183, 62,207,217, 24, 63, 57,222, 25, 62,255, 49,134, 61, -140,161, 63, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,180, 67,127, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 58,217,158, 63,120,225, 17,192,212,158,120, 64,190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62, -201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160,161,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175, 95, 22, 63, -171, 95,210,190,114, 70, 46,191, 69, 71, 26, 62,192,164,234, 61,121,120, 78,191,192,229,108,188,144,225, 72,190,196,218, 42,190, - 83,104,114,191, 26,213, 73, 62,213,230, 49, 61,216,117,187, 61,145,253, 42, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,226,144, 95, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23,205,127,191,229,116,142,191,114, 64,100, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192,162,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 25,132,189, 67,167, 41,191,248,145,174,190,170,227, 41, 63, 80,208, 94, 62, - 98, 21, 50, 63,138,162, 46,191,136, 53, 56,191, 8, 44,160, 62, 14, 42,188,190,111,124,145, 62, 46, 84,135, 62, 93, 56, 95, 62, -104, 38,111, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,183,116, 87, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,142,106, 67,192,223, 1,236, 62,229,139,105, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192,145,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 62, 72, 62, -146,226,176, 62, 67,185, 48,191, 0,216, 26,191, 0,159,254,187, 90,238,201,190,100,166, 39, 63,102,238, 3,191,208,229, 10, 62, -164, 53,230, 62, 35,227,100, 62,229, 38, 54, 63, 91, 4, 43, 61,170, 1,190, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,213, 26,126, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,110, 63, 58,191,238, 44,102,191,240,155,119, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224,146,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,202,238,131, 61, 49, 99, 58,191, 62,180, 26, 63,201, 92,162,190,112,254,209, 62, -150, 67, 12, 63, 80,138,197, 62,198,116, 72,191,118,129,182,190,184,137, 76, 62,232,134,178, 62, 21,134,113, 62,234,242, 46, 62, - 45,121,122, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,248, 12,169, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,236,173,175, 62,216,194,141, 61, 0,239,164, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0,148,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,213, 38, 28, 63, - 74,248,166, 60,227,199, 67,191,127,123, 83,190,122,119,224,190, 72, 46,149, 62,136, 43, 62, 62, 32,175,199, 62, 98,224, 2, 63, -180,198,250, 62,209, 97, 48, 63, 39,134,130, 61,168, 53, 8, 61, 57, 40, 91, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 93,115,157, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,131,188, 36,192, 82,192, 42,192, 16, 24,202, 63, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16, 45,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,121, 82,190,233,142,216,190, 95,156, 83,191,222, 73,158, 62,170,207, 3, 63, - 64, 41, 39,191, 4,164,147, 62, 36,187, 38,191, 0, 1,218, 62,145,119, 32,191,146,242,154, 60, 19,165,130, 62,128,236, 49, 63, - 79, 44,253, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 13,194,130, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,183,117, 51, 63, 38,247, 44,192, 85, 59, 82, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48, 46,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,175, 71, 59, -214, 55, 18,191, 64, 82,223,190,142, 2, 50, 63,240, 17,202, 61, 52,118,199, 62,128,125, 72, 63, 86,250, 36,191, 64, 99, 90, 61, -124, 38, 25, 63,229, 50,227, 61, 58,152,110, 61,163, 58,104, 62,119,161, 26, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 21, 69, 35, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22,218, 44,192,101,112,159,190, 70,196, 80, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 47,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 65, 39,191,175,203,203,190, 23, 58, 8,191,133,178,185,190, 48,133, 27, 63, -166,150, 35, 63,192,164,174,189,144, 20,209,189,124, 43, 3,191,220,188, 54, 63, 27,126, 53, 62, 93,113, 22, 63, 28,104, 42, 62, -169,168,140, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 90,122,222, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,218,253, 61,191,188,216, 43,190,219,239,140, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192,216,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 62,251,190, -156,207,132, 62,191,198, 19,191,122, 82, 25,191,178,114,169,190,242, 80, 46,191,160, 92,100,189,124,103,188, 62, 0,234, 23,191, - 12,140, 22, 63, 23, 36,252, 62,188,130,121, 62,100,245,198, 61,101,186, 42, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 62,205, 89, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,194,168,212,191, 48,175, 30,192, 93,228, 12, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224,217,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,244,136, 6, 62,240,135, 58,191, 94,198,233, 61, 57,148, 41, 63,152,188,189,190, -156, 72,189,190,184, 14, 86, 63,186, 54,165,190,128,220, 49, 62, 64, 87,189,189,118,198,167, 61, 93,200, 80, 62,158,210, 10, 63, -240, 9, 48, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,186,132,181, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,114,184,238,190,239,206,230,191,208,122, 85, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0,219,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129,165, 30, 63, -159, 50,249,190,187,213, 86,189,178, 10, 29,191,227,247, 49,191,208,139, 7,189,224,249,154,189,152, 77, 23,191,160, 58, 14, 63, - 64, 47, 15, 61,135,132, 94, 62,167,190, 48, 62,203, 41,136, 62,156, 52,176, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 38,177,233, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 19,104, 63,177,122,254,191,116, 37,123, 64, -190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62,200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64,235,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,231,181, 62, 36, 19, 51, 63,126, 5, 6,191,231, 27,170,190,128,253, 35,189, -184, 11,151,189, 76,171,178, 62,128,231, 49, 63,204,146,128, 62, 88,100, 17, 62,198,245,124, 62, 33,108,130, 61,205,152,229, 61, -240,193, 19, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 56,156, 79, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,172,106,191, 63,110,225, 42,192, 6,170,110, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96,236,104, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,227, 27,191, - 17, 83, 26, 63, 27,229, 2,191, 86, 48,135, 61,200,244,134, 62, 56, 37,151,190,208,195,237,189,248, 39, 17, 63,160, 1, 76, 61, - 76,194, 79,191,241, 99,249, 61,190, 88,249, 60,171, 20,183, 61, 38, 38, 66, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,150, 40,178, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119, 3, 12,192, 71, 11,252,190,144,136, 89, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128,237,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,105, 59, 20,191, 31, 36, 17, 63,112, 57,252,190, 32,101,162, 62,140, 6,160, 62, - 64,160, 80, 61,112,243,245, 61, 40, 18,224,190,192,154,227,188,238,196,139,190,172, 28,108, 62,189,152,246, 62,202, 50, 61, 62, - 34,254,210, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 20,166, 56, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,250,104,187,191,168, 86,139,189,145, 23,131, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 5,124, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,227, 80, 19,191, -120,138, 16,191,122,210, 6,191,144, 14,138, 62, 72, 65,189, 62, 16, 89,244,189,208, 5, 83, 62, 92,159,107,190, 20,199,255, 62, - 16,124, 48,190, 13, 67,208, 62,184, 57,190, 62,121,154,219, 61,111,114,234, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,203, 51,223, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 56,161, 62,253,221,207,191,204,110,120, 64, -188, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,203,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 6,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,138,124, 47, 63, 11,193, 0, 63,126, 39,176, 62, 68, 3,204,190,128,180, 43, 61, - 64,184,104,189, 69,173, 54,191, 16,239,116,189,192,183, 53,190,120, 91,198,190,123, 33,150, 62, 70, 30,226, 61,225,121, 27, 62, - 3,154,227, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,117, 22, 35, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 89, 41,192,114,107, 25,192,178,245,222, 63,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 7,124, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65,202,207, 62, -211, 32, 47, 63,139,219, 0,191,197,212,172,190,196, 68, 65, 63,104,152,217,190,160,218,214,190, 84,113, 84,190,194,108,158,190, -224,217,235, 61,107,179,202, 60,195,106,157, 62,210,197, 33, 63, 28,243, 18, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 1,162,102, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,238,220,191, 89, 70,150,191,200,192, 72, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 8,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,175, 95, 22, 63,171, 95,210,190,114, 70, 46,191, 69, 71, 26, 62,192,164,234, 61, -121,120, 78,191,192,229,108,188,144,225, 72,190,196,218, 42,190, 83,104,114,191, 14,183, 77, 62,160,153,182, 62, 65, 59,143, 62, - 51,159, 38, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,226,144, 95, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 60,234,116,192, 32,103,238,188,165, 20, 56, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 10,124, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,244,136, 6, 62, -240,135, 58,191, 94,198,233, 61, 57,148, 41, 63,152,188,189,190,156, 72,189,190,184, 14, 86, 63,186, 54,165,190,128,220, 49, 62, - 64, 87,189,189, 29,255,242, 60,231,194, 83, 63,189, 56, 5, 62, 66,188, 85, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,186,132,181, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,209,240,189,182,183, 95, 63, 5, 67,176, 64, -192, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,200,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 11,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,107,114, 86,191,137,141, 2,191,201,140,105, 61, 69,121, 63,190,132,242,218, 62, -236,163,132,190, 0,236, 16, 60, 84,203,248, 62, 79,244, 80,191,104, 0,148, 62,154,189, 85, 63,146,104,200, 61,242, 55,142, 60, - 69, 57, 76, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 31,252, 33, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,205, 54, 25,192,189,197,162, 62, 8, 16,121, 64,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32,124,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,219,100,244,190, -182, 69, 91,191, 61,137,144,189,165,126, 59, 62, 28,228,200,190, 60, 49,170, 62,224,139,250,189,248,143,111, 62,252,103,100,191, -144, 32, 79, 62,103,246,163, 62, 91,201, 16, 63, 24,104,136, 61,228,230, 66, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,182, 88, 41, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 57, 61,192,232, 53, 39,191,172,221, 55, 64, -190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62,198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64,125,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164, 43, 35,190,245,210,225, 61,197, 58, 30, 63,229, 8, 67, 63,208,176,222, 61, - 70, 15, 12, 63, 80,195,165, 62,224, 72,227, 61,188, 66, 87,191,144,213,195, 62, 46,218,212, 61,242, 20, 25, 63,124, 70,118, 62, -167,226,107, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,173, 74, 64, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,249, 62, 40,191, 32,113, 26, 63, 50,179,160, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96,126,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,190, 29,224,190, -239, 44, 4, 63,125,217, 49, 63,107, 25,121,190,116,172,217, 62,240, 98,116,190,148,162, 42, 63,142,178,199,190, 54,105, 13,191, - 84,107,163,190, 64,186, 45, 63,110,122, 91, 62, 32,134, 21, 61, 18,118,144, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,113,107, 73, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 51,138,191,200, 14,110,192, 13, 66,203, 63, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128,127,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 78, 39, 63,128, 50,251,190,139,185,189,190,173, 4,226, 62,118, 23,153,190, - 68,228,120,190, 50,226, 42,191,239,243, 86,191, 36, 42,189,190, 66, 1,190,190,234,223,153, 59, 20,174,243, 59,232,160, 60, 63, -248,135,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,167,245,105, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 44, 75,186,191,173,205,204,191,131,169, 61, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160,128,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,223,155, 62, -249,196, 3,191,115, 12,163,190,212, 73, 60,191, 56,208, 85, 62, 64, 11,155, 62, 24, 17,173,189, 20, 16,254,190,212,229, 32, 63, -224,221, 28,189, 77, 19, 52, 62,228, 52,146, 62,193,228,171, 62,107,185, 79, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 45,184, 37, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,118,219, 63,227, 73, 28,192, 81,117,128, 64, -192, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62,197,206,183,190,202,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192,129,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,167,109,254, 62,209,146, 4, 63,232,131, 23, 63, 68,212,187, 62, 10,109,158,190, - 72, 12,216, 62, 0, 20,153, 59, 8, 2, 7, 62, 96,134, 91, 62, 44,128, 33,191,191, 75, 51, 62,208,251,144, 60,197, 49, 19, 61, - 21,114, 69, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,221,100,115, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,177, 59,194,191, 34, 29, 13,192, 13,208, 30, 64,192, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -200,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64,106,127, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,223,155, 62, -249,196, 3,191,115, 12,163,190,212, 73, 60,191, 56,208, 85, 62, 64, 11,155, 62, 24, 17,173,189, 20, 16,254,190,212,229, 32, 63, -224,221, 28,189, 96, 31,227, 61,168,207,104, 62, 38, 89,237, 62, 91,238, 74, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 45,184, 37, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,197,190, 82,192, 3,149,174, 62, 30,189, 91, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96,107,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,170,132, 10,191, 82, 61,237, 62,127,191,223,190, 11,148, 12, 63,240,142, 92, 62, - 18,199, 32, 63,160,206,242,189,198,114, 15, 63, 92, 82, 33,191, 4,247,167,190,212, 10, 37, 62,124,152, 65, 63, 17,110,106, 61, -172,189,207, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 40, 23,140, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112,157,163,190, 48,219, 33, 63,250, 25,167, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128,108,127, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,101,175, 4,191, -158,200, 50,190,247,214, 77, 63,225,194,110,190,144, 10,198, 61,208,213, 62, 62,144,163,253, 61,112,130,160, 61,201,229,101,191, -104,145, 50, 62, 53,192, 61, 63, 16, 50, 23, 62, 37, 56, 1, 61, 41,254,162, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 89, 81,220, 60, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,135, 63, 79, 63, 22,225,203,191,183, 83,133, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160,109,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70,155,194,190, 81, 93, 3,191, 23,133, 19,191,178,146, 2,191,128,198,104, 62, - 16,189, 93, 63, 76,226,209,190,158,122, 21,191,168,192,234,190, 16,128, 35, 63, 10,188,167, 62,140,167,138, 61,186,163,185, 61, -147,152, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 25,249,236, 59, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20,218, 89, 62,170, 21, 81,192, 50,226, 38, 64,190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62, -198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192,110,127, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,140,169, 52, 63, - 96,163,156, 62, 27,132,184,190, 82, 25, 7, 63,128,117,151, 62,252,206,247, 62, 28,144, 76, 63,148, 57,204, 62,192,181,246,188, -196,222, 19, 63,175,237, 18, 61, 50, 0, 0, 61,180, 45,208, 62, 72,186, 6, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 61,195,186, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 91,166,190,195,138,151, 62,233, 4,159, 64, -188, 81, 55,191,109,243, 71,191,102,237, 42, 63,237,163,214, 62,198,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224,111,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,212,240, 7, 63,213, 2, 18,191,228, 90, 5,191,222, 92,178, 62, 8,236, 16, 63, - 92,216,151, 62,156,193,128, 62, 64, 60,245,188,118,129,160,190, 47,157,113,191,112,117, 40, 63,168, 92, 37, 62, 75,198, 78, 61, - 7, 28, 5, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,137, 96,226, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,106,137,191,191,137,156,208,190,238,245,116, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0,113,127, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,173,218, 49,191, -113,109, 23,191, 30, 16, 55, 62, 55,117,188,190, 24, 20,208, 62,118,245, 46,191, 0,158,236,186, 55, 10, 97,191,140,128,183, 62, -178,230,146,190,120,217,174, 62, 45, 55,188, 62, 42, 76, 25, 62,138,146, 16, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 96, 85, 48, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 6, 78,191,236,247, 2,191, 2,181,131, 64, -190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62,200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,133,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 25,236,189,127,158, 27, 63,122,235,239, 62, 59,108, 33, 63,244,198,103,190, -252,192,187, 62,180, 39,101,190,108,210,138, 62,145,168, 54,191,208, 20, 63,190,236,209,211, 62, 2,168,129, 62,107,237, 7, 62, -185, 30, 77, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 2,210,109, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 97,181,251,191,176, 67, 79, 63, 85,115,143, 64,188, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -203,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48,134,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119,243,237, 61, - 12,234,169,190,211,226, 55,191,185,175, 25,191, 24,201, 39, 63,204, 23, 71,190, 88, 61,218, 62, 32,211, 39, 63,108,101,215,190, - 32,125,244,189, 31, 56,250, 62,175,208,248, 62, 52, 43, 79, 60,247,186, 79, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 83,130,186, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,165,143, 16,192,220, 40, 31,192,184,165,240, 63, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80,135,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193,157, 15,191, 48, 51,205,190,152, 40,136,190,128,122, 44, 63,194,144, 92, 63, -236, 36, 99,190,244, 22,206,190,144, 32,220, 62,170,244, 19, 63,160,205,238,189, 90,255, 69, 61,125,237,129, 62,202,113, 29, 63, - 20,188,169, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,249,139,151, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 47, 16, 46,192,250,135, 17, 62,198,174,101, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112,136,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186,110,162,190, -145,104,105,190,247,168,239, 62, 3,235, 74, 63,140, 77,178,190, 80, 49, 72, 63,168, 45,112, 62, 42,101, 44, 63, 96,162,173, 62, -180,215,104,190,132,185,112, 62, 76,198, 31, 63, 80,148,186, 61,145,140, 75, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,161,174,120, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,222, 76, 34,192,190, 63,220,191,102, 92, 19, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144,137,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,105, 89, 32, 62,234, 91, 82, 63, 19, 79, 86, 60, 22, 61, 12, 63,250,120,178,190, -203, 19, 37,191,128, 65, 24, 63,196,226, 52, 63,219,214, 0,191,204,228,210,190,193, 5,144, 61, 31,251,203, 62, 4,217,232, 62, -185,169,156, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 7,165,113, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0,209,208,191,175, 98, 57,192,212, 39,244, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176,138,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,244,136, 6, 62, -240,135, 58,191, 94,198,233, 61, 57,148, 41, 63,152,188,189,190,156, 72,189,190,184, 14, 86, 63,186, 54,165,190,128,220, 49, 62, - 64, 87,189,189, 40,142,100, 61,205, 81, 18, 62, 52,238, 34, 63,214,209, 40, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,186,132,181, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,156,146, 19,192,144,169, 38, 63,119,240,133, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,139,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,123,191,104,191, 90, 12,172,190,102, 97,112, 62,249, 67,150, 61,240,234,241, 61, -120, 15, 65,190,224, 2, 61, 62,158, 38,233,190,128, 62,191,187,106,119, 29, 63,176, 98,202, 62,157,134, 14, 63,239,140,213, 60, - 93,116,179, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,159,173, 69, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 95,209,211, 63, 77, 57, 64,192,236, 52,100, 64,192, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62, -197,206,183,190,202,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144, 2,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129, 46,157,190, -239,142, 47,191,248,128,219, 60,123,203, 40, 63, 0,175,122,189,180, 33,139, 62,160, 8, 63, 61, 74,191, 26,191, 48,191,189, 61, -124,188,100,190,133,222,112, 61,149,149,161, 60,121,188,202, 61,220,141, 82, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 34, 78, 58, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204, 40,195, 62,168, 66, 22,192, 54, 69, 88, 64, -190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62,198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176, 3,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,168, 69, 25, 63, 77,123,124, 62,100,238, 32,191,234,140,220, 62, 96,159,120, 61, -192,254,244, 61,104,215, 59, 63,244,235, 71,190, 9,172, 73,191, 94,228,165,190,238,198, 39, 62,233,166,180, 61, 35, 45,106, 62, - 32,238, 4, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,128,255,104, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,179, 41,124, 63,215, 52, 92,192, 2,194, 56, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208, 4,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250,191,175, 62, - 72,210, 67, 63, 93, 44,255,190, 34,232, 97, 62,184, 89, 70,191, 58, 37,246,190,112,174,211, 61,224,174,119,189,237, 2,119,191, -176,205, 35, 62,226,119,158, 59, 63,185, 89, 59, 58, 41,150, 62,186,212, 50, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 78,102, 32, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76,215, 66,192, 80,102, 17,189,252, 64, 82, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240, 5,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 15,158,190, 97, 48, 27,191, 48,181, 41,191, 31, 19,160,190, 88, 23,153,189, -100,243,110,190,182,169,164,190, 97,129,120,191,128,101, 90, 60,192, 53,186, 61, 94, 65, 31, 62,150, 57, 45, 63,119,240,248, 61, - 59,128, 61, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,196, 79,137, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,246,234,243, 63, 15,199, 50,192,250,173,118, 64,188, 81, 55,191,109,243, 71,191,100,237, 42, 63,235,163,214, 62, -201,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16, 7,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,133,137,136, 62, -101, 7,106,191,250,249,155,190,188,218,155, 60,192,212,184,188, 72,215,201,189, 40,244, 61,191,128,234, 70, 61,154,226, 1,191, -118,139, 91, 63,202, 64,207, 61, 44,106, 89, 60, 30, 53, 13, 61,236,222, 89, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 6, 40, 87, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,170,176, 54,191, 97,173,187,191,212, 31, 93, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48, 8,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,175, 71, 59,214, 55, 18,191, 64, 82,223,190,142, 2, 50, 63,240, 17,202, 61, - 52,118,199, 62,128,125, 72, 63, 86,250, 36,191, 64, 99, 90, 61,124, 38, 25, 63,101,144,129, 62,185, 1, 91, 62, 60, 67,121, 62, - 32, 77,148, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 21, 69, 35, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,237,131,100,192,234,185, 81,191, 36, 50, 27, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 9,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,164, 43, 35,190, -245,210,225, 61,197, 58, 30, 63,229, 8, 67, 63,208,176,222, 61, 70, 15, 12, 63, 80,195,165, 62,224, 72,227, 61,188, 66, 87,191, -144,213,195, 62,157,146, 70, 60, 81,125, 44, 63, 69,124,156, 62, 99,144, 10, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,173, 74, 64, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,226, 77,248,190,220,108,103,190,232,231,143, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112, 10,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 62,251,190,156,207,132, 62,191,198, 19,191,122, 82, 25,191,178,114,169,190, -242, 80, 46,191,160, 92,100,189,124,103,188, 62, 0,234, 23,191, 12,140, 22, 63, 56,173, 3, 63,188,233, 78, 62, 70,225,187, 61, -197,112, 68, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 62,205, 89, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,129, 80, 10, 64,250,130, 74,192,126,179,109, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144, 11,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,175, 71, 59, -214, 55, 18,191, 64, 82,223,190,142, 2, 50, 63,240, 17,202, 61, 52,118,199, 62,128,125, 72, 63, 86,250, 36,191, 64, 99, 90, 61, -124, 38, 25, 63,214, 2,202, 60, 34,116,181, 59,235,167,204, 60,194,223,113, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 21, 69, 35, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 37, 55,192, 93, 44,210,191,133, 20, 12, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,191,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 7, 15, 63,134,194, 46,190, 35, 82,148, 62,186, 22, 66,191,210,135, 53, 63, -112, 29,172,190,200, 68,229, 62,252,167,140, 62,180,223, 99,190, 34,226,176,190,143,158, 50, 61, 52,247,230, 62,255, 25,236, 62, -225,215, 52, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,202,199,214, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 2,163,152,191,233,189, 16,192,148, 29, 39, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240,192,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 25,236,189, -127,158, 27, 63,122,235,239, 62, 59,108, 33, 63,244,198,103,190,252,192,187, 62,180, 39,101,190,108,210,138, 62,145,168, 54,191, -208, 20, 63,190,112,136,250, 61,107, 45, 71, 62,247,240,222, 62,108,172,125, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 2,210,109, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,219,213, 63,121,221, 77,192, 99,157, 90, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,194,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56,225, 4,191,238,172, 35, 63, 92, 44, 4,191, 90,166,112,190,228,149,176,190, -232,184, 6, 63, 91,120, 44,191,208, 36, 20, 63,166, 84, 79, 63,192,145, 89, 61,107,154,192, 60,171,233, 43, 60, 72, 13, 0, 62, - 52, 72, 87, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 34,131, 32, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,122, 39,106,191,130, 29,114, 63,156,123,164, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48,195,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119, 97, 45, 63, -120, 47,205,190, 35,117, 19, 63,168,125, 98, 62,240,195, 73, 62,124,228,243, 62,120, 86, 11, 63, 72,156, 89, 62,230,232, 88, 63, -130, 53,204,190,148, 27, 54, 63,245, 38,133, 62,230, 55, 53, 60, 90,130,143, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 53,129,253, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 71,102,192, 7,110,194,190,108, 39, 47, 64, -192, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,200,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80,196,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98,157,105,188,148, 8,184, 62,181,109, 7,191,177,194, 68,191,162, 77,220,190, - 58,120,101, 63, 0,106, 25, 61, 72,197, 86, 62,214, 78,236,190,126,136, 46, 63,150,203, 22, 61,130,161, 61, 63, 69,196, 79, 62, - 80, 22,160, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,112,148, 93, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 12,224,214, 63,227,182, 5,192,246, 59,136, 64,190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62, -200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112,197,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 46, 24,191, - 41, 20, 43,191,185,184,183, 62, 44,173,136, 62, 76, 75, 50, 63, 40, 83,126, 62,188,195, 8, 63,232,211,238, 62, 64, 36,152, 61, -236,106,145, 62,209, 28,131, 62, 30,255, 46, 60, 17,165,139, 60,114, 88, 55, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 93,122, 57, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99,158, 92, 63,115,243, 67,192, 15,154, 70, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144,198,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,101,175, 4,191,158,200, 50,190,247,214, 77, 63,225,194,110,190,144, 10,198, 61, -208,213, 62, 62,144,163,253, 61,112,130,160, 61,201,229,101,191,104,145, 50, 62,103, 55,104, 61, 9, 23, 9, 61,208, 82,129, 62, -177, 65, 40, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 89, 81,220, 60, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 87,234, 31,192,204,234, 65,192,108,200,172, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176,199,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,162,180, 99, 63, -129,169,145, 62,112, 95,174, 62,161,121,223,189,174,190, 73, 63,120, 72, 51,190,116, 48,162,190, 56, 98,139,189, 76,245,191, 62, - 80,124,253, 61,197,252, 48, 60,163,176, 62, 62,216, 93, 72, 63, 94, 65,166, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 81, 69, 12, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74,122,189,191,238,243,102,191,158,253, 93, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,200,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27,139,218,189,160, 81,222,190, 77, 71,151,190, 48, 33, 88,191,152,174,128,190, - 44,218,107,190, 40, 96, 66,190,220, 29,113,190, 88,240,184,190,152, 92,204, 62,101,159,135, 62,252,216,174, 62,218, 99, 96, 62, -104,171, 50, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 5, 27,207, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,223, 75, 67, 63,208,124, 78, 61,200,150,171, 64,190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62, -201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240,201,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 19,190,190, -189,203,147, 62, 26,242, 2, 62,224,138, 95, 63,128, 50, 24, 60,148,174, 64, 63,196,158, 11,191,220, 22, 64, 63,100, 35, 19,190, -216, 93, 44, 62,192,115, 58, 63,107,198, 2, 60,236,102,167, 59,175,100,132, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,189,176, 27, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 36,139, 62,248,230, 62, 63,173,205,179, 64, -192, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,200,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,203,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,220,239, 60,168,204, 46,191, 74, 95, 84, 61, 8,105, 58,191,232,245, 43, 63, - 92,254,151, 62, 80,143,206, 61,176,139, 42, 63, 26,107,196,190,150,211,139,190, 50, 23, 92, 63,172, 27, 15, 61, 11, 43, 83, 60, - 57, 83,189, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,121,221, 49, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 34,247,225,191, 36,175, 81,192,248,254,198, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80,166,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60,132,130, 62, -129,166,120,190, 15,191,109,191,174,164,238, 61, 20, 93, 78,190,248,164,231,189, 0,255, 16, 62, 62,189,234,190,112,167,116,189, - 68,175, 16, 63, 66,132, 2, 61,192, 37,189, 61,173, 5, 64, 63, 91,181, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,129, 93, 2, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,232,110,165, 61,209, 43,239, 62,128,243,169, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112,167,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,173,218, 49,191,113,109, 23,191, 30, 16, 55, 62, 55,117,188,190, 24, 20,208, 62, -118,245, 46,191, 0,158,236,186, 55, 10, 97,191,140,128,183, 62,178,230,146,190, 62,109, 66, 63,246,159,170, 61, 85,150,243, 60, - 72,136, 2, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 96, 85, 48, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 14,158,243,191,244,237,104,192,136, 34,155, 63,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144,168,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,155, 22, 49,191, -222,232,165, 62,133,208, 6,191, 93,253,190,190,190,234,194,190,240, 89, 29,191,134,110, 23,191, 8,217, 30,191,108,159,205,190, - 18, 94,185,190,229,106, 92, 60, 23, 25, 35, 61,136,111, 93, 63,212,105,167, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,252,153,132, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118, 74, 8, 63,255,239, 1,192, 28,123,108, 64, -190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176,169,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,217,155,104, 63,216,164, 29,190,175, 60,179,190,203,201, 43, 62, 96, 60, 67, 61, -176, 42, 90,189, 68, 85, 4,191, 68,249,130, 62,230,199,133,190,148, 14,107, 63,233,242,101, 62,183,120,181, 61,232,136, 43, 62, -245,241, 4, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,252,179,108, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 24,231,191, 44,105, 21,191,187, 32, 98, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,170,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,126, 52, 49,191, -202, 9, 43, 63,166,234, 96,190,182,210, 37,190,192, 58, 54, 61,232, 1, 63, 63,134,173, 34,191, 4,154,170,190, 92,112, 51, 63, - 18, 61, 23,191, 67,189,138, 62,116,103,210, 62,114,128, 62, 62, 32, 54, 7, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 33,132,126, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,145, 52, 5,191, 10,103, 49,192,233,154, 37, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240,171,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 96, 32, 63,185,201,160, 62,160, 3, 6, 63, 11, 34,248,190,192, 53,185, 60, -192,197,178, 61,174,184, 53, 63,224,172,162,190,108,136,224, 62,142,173, 61,191,135, 47,184, 61,247,157,207, 61,168, 0,225, 62, -249, 11,189, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,248,112,150, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,134, 45,177,191, 34,253, 99, 63, 8, 58,155, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,173,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,202, 55, 63, -247,235, 89,190,127, 18, 92,190,146,129, 32,191, 8,212, 8,190,168, 50,171,190, 96,120,123, 62,232,152,249,189,140, 18,149, 62, - 32,111, 13, 61,147,253, 28, 63,230,184,184, 62, 51, 48, 58, 60, 59, 78,111, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,115, 61, 18, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34,255, 57,191,231, 4, 65,192, 78, 7, 19, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48,174,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,204,218,133,189,113, 10,176,189,186,237, 10, 63, 14, 61, 85, 63,180,219, 38,190, -176,175,206, 62, 46,240, 10, 63, 32,232,114,190, 92,162,207,190,172, 85,193,190,228,255,128, 61, 73, 32,172, 61,146,152, 5, 63, -206,134,169, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 62, 38,212, 60, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,182, 68,137,191,204,177,226, 61,196,247,141, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80,175,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,137,138,146, 61, -191, 75, 8,187, 25,235, 68, 62,122,141,122, 63,116,117, 92, 63, 8,147,125,190, 88, 49,147,190, 8, 88, 41, 63, 64,255, 2, 63, - 64, 44,126, 61,107,166, 0, 63, 23, 29,154, 62, 34,214,165, 61, 42,130,236, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,241,170,103, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20,103, 82,192, 72, 75,201,191, 3,247, 0, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112,176,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,120,168, 62,178,154, 7,191, 41,180, 48, 63,240,232,187,190, 9, 35,104,191, -224, 8,114, 62, 76,143,177,190,106, 29, 28,191,208,112,234, 62, 8,249, 92,190, 78,110,118, 59,167,155, 4, 63, 69, 2,243, 62, -182,199,108, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 74, 4,184, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,196,241,246,191, 95,130,236, 62, 50,209,135, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144,177,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,123,197,223, 62, - 33,243,189,190,199,213,140,190, 13,149, 69,191,222,235,199,190,160, 79,240, 62,112,202, 14,190,184,168, 60,190, 4,145,220,190, - 44, 8,148, 62, 47, 99,219, 62, 87, 73,242, 62,132, 14, 79, 61, 70,141, 67, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,157,236,192, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,228,149,189, 15, 14,221,190,209,251,145, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176,178,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 19,190,190,189,203,147, 62, 26,242, 2, 62,224,138, 95, 63,128, 50, 24, 60, -148,174, 64, 63,196,158, 11,191,220, 22, 64, 63,100, 35, 19,190,216, 93, 44, 62,196,141, 4, 63, 1, 71, 19, 62, 65,186,174, 61, -103,146,129, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,189,176, 27, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20,120, 89, 62, 92,169,120,190, 29, 78,155, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208,179,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,118,201, 94, 63, -194,189,213, 62,141, 27, 67, 62,215, 93, 55,190, 6,154,131,190,132, 48,178,190,140, 11,192,190, 40,123,147,189, 28,130, 57,191, - 44,253, 33,190,226, 89, 24, 63,192,174,198, 61, 0,152,101, 61,141,237,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 59,122,117, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 80, 26,192,152, 3,239,189,183,210, 99, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240,180,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,148, 16,153,190,223, 1, 33,191, 43,253,168, 62,253, 36, 35, 63,124,255, 19,191, - 70, 97,138,190,192,109, 6, 62, 64, 58,223,190,152,121,189,189, 8,126,170, 62,117,248,126, 62, 83, 41, 12, 63,152, 55, 4, 62, - 62, 85,152, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 74,244,106, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80,245, 70,190,135,148, 37,192, 40,107, 57, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16,182,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,246,249, 62, -199,102,140, 62,155,199, 10, 63, 39,102, 32, 63, 78, 10, 19,191,224,238,250,190, 0, 13,111,190,240,232,187, 61,104, 10, 99, 62, -164, 96,221, 62,208,237,239, 61, 8, 34,210, 61, 61,101,181, 62,204, 22,218, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 35,143, 25, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,173, 25,191, 65,234,249,191, 59,217, 73, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48,183,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,109,230, 62, 67, 47,189,190,208,119,155,189,238, 53, 79,191,223,144, 88,191, - 88,163,146, 62, 64, 99,208,190,236,235,130, 62, 72, 10, 17,190,124,223, 15, 63, 12,172, 64, 62,161, 24, 51, 62,145, 49,156, 62, - 24,236,169, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,254,237, 72, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 63, 60,192,189, 70,245,191,243,177,248, 63,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80,184,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,162, 16, 63, - 33,180,219,190, 24,166,177,190,234, 8, 29,191, 24, 26, 48,190,240, 70,115,190, 0,197, 54, 63, 72,201, 75, 62, 32,174, 10,189, - 82,128, 78, 63,159,109,175, 60, 10,135,214, 62, 58, 12, 9, 63,133,154,198, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 34, 50,138, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,125,162, 63, 64,233, 64,192,144,167, 86, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16, 51,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,234,120, 11, 63,200, 35,253,190, 3,152,233,190, 0, 38, 0,191,214, 3, 36,191, - 4,239, 45,190,136,175, 9,191, 16,130, 42,190,156,197, 38, 63,182, 37,238,190, 3, 49,119, 61,118,251,224, 60, 93, 5, 47, 62, -189,195, 61, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 89,162,191, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,184, 96, 27,192,250, 23,179,191,194, 77, 38, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48, 52,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,177,231, 32,191, -150, 89,239, 62,128,156,188,190,225, 45, 0,191,248,133,210, 62, 52,169, 40, 63,146,184, 26, 63,210, 39,223,190,182,238, 15,191, - 74, 63,146,190,168,161,213, 61,218,242,218, 62, 37, 18,191, 62, 88, 74,194, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 81,236,129, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,181, 0, 21,191,137,241, 14,192,206, 27, 61, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 53,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 79,213,190, 94, 19, 10, 63, 60, 25, 56,191,192,193, 10, 62,128,232, 10,190, -160,126, 93,190, 24,169, 7, 63, 38,209,221,190, 52,214,186, 62, 20, 63, 41,191, 59, 36, 27, 62,244,151, 28, 62, 83, 23,179, 62, -150, 10,177, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 98,241, 41, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 80, 57,189,194, 80,166,191,242,172,123, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112, 54,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,174,232, 62, - 63, 99,164, 61, 41,108, 12, 63,106,126, 50,191, 64,117,124, 62,134, 54, 82, 63, 36, 55,191, 62,120,232,197,190,192,203, 70,189, - 26, 88, 51,191,198,225,170, 62,113, 67, 23, 62,201, 56, 33, 62, 27,224,184, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,216,213,138, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,218,106,219,190, 34,216,127, 63,142,251,173, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144, 55,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,215, 79,213,190, 94, 19, 10, 63, 60, 25, 56,191,192,193, 10, 62,128,232, 10,190, -160,126, 93,190, 24,169, 7, 63, 38,209,221,190, 52,214,186, 62, 20, 63, 41,191, 7,203, 79, 63,111, 14, 32, 62,255,238, 44, 60, - 59,180,175, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 98,241, 41, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,110, 39, 91,192, 65, 81,150,191, 89, 68, 15, 64,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176, 56,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,131,212, 0,191, - 16,161, 38,191,131,203,123,190,208, 48, 3,191,112, 6, 64, 63,136, 53, 34,190,175,202, 6,191, 64,241, 19, 62,120,105, 85,190, -144,246,146, 61, 23, 88, 25, 60, 83, 74, 25, 63,200,185,196, 62,208,179,249, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,198,223, 90, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,231, 17, 40, 63,155, 44,153,190, 68,123,161, 64, -190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62,200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208, 57,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,219, 68, 63,191, 75, 74, 62,251,129,229, 62,197, 78,210,190, 64, 63, 59,188, -172,173,214, 62, 16,159, 85, 62, 24,160,185,189,169,193, 46,191,176, 21, 77,190,202,133, 32, 63, 25,163, 36, 61, 44,136,225, 60, -132, 71,156, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 22,208,141, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 50, 95,160, 63, 33,101,249,191,177, 96,132, 64,190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62, -200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240, 58,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 25,236,189, -127,158, 27, 63,122,235,239, 62, 59,108, 33, 63,244,198,103,190,252,192,187, 62,180, 39,101,190,108,210,138, 62,145,168, 54,191, -208, 20, 63,190, 62, 45,138, 62, 35,142, 30, 61,173, 78,128, 61,170,246, 32, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 2,210,109, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,110,133, 6,192,171,152,225,191, 84, 16, 32, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16, 60,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186, 57,241, 62,210,244,173, 62,197,195,188, 61,228, 10, 79, 63, 14,223, 34,191, -172, 65, 40,190,160,228, 38, 61,186,225, 12, 63,192,196, 13,189,186,253, 14,191,241,107,217, 61,249,147,174, 62,230,232,218, 62, - 70, 80, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 8,168,183, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 99,228,190, 40, 59, 51,191,220, 75,133, 64,190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62, -198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 48, 61,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,191, 23, 63, -250,209, 82, 62, 34, 21,204, 62, 21, 58, 43, 63, 0, 3,139, 61, 48,159,135, 61, 32,117, 36,189,232,123,244, 62, 80,104,185, 62, - 18, 73, 33, 63,114,208,213, 62,122,118, 76, 62, 34,254, 5, 62, 63,245,128, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,179,246, 4, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,101, 74,192,162,185,105,191, 18,141, 36, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 80, 62,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,221,157, 3, 63, 67, 81,215, 62,135, 46, 5, 63,121,108, 9,191, 36, 83, 16,190, - 38,244,130,190,192, 18,216, 62,222, 44, 53, 63,152,136,162,189, 80,138,252,190,222,214,102, 61, 50, 22, 25, 63,139, 42,157, 62, -164,113, 30, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,145,208, 26, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,124,234,218,191, 45,177,232,191,109,174, 42, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,112, 63,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 41, 59,191, -238, 70,252, 61, 77, 96, 25,191, 33,195,154,190, 32,119,242,190,124, 79,204,190, 24, 53, 18,190,102, 31,214,190,166,174,199,190, - 32,105,169,188,231, 50, 8, 62,230,251,148, 62,128, 65,206, 62, 72, 82, 49, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 44,230, 5, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,106,206,191,179, 36,150, 62, 96, 42,137, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,144, 64,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51,191, 23, 63,250,209, 82, 62, 34, 21,204, 62, 21, 58, 43, 63, 0, 3,139, 61, - 48,159,135, 61, 32,117, 36,189,232,123,244, 62, 80,104,185, 62, 18, 73, 33, 63, 87, 15,231, 62, 50,237,207, 62,254, 43,141, 61, -226,225,150, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,179,246, 4, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,200, 61,167, 63,119, 5,171,191, 88,214,147, 64,190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62, -200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,176, 65,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,111, 39, 70, 63, - 89,103,218,188, 45, 24, 30, 63, 26, 81, 12, 62, 26,129, 16, 63,208,153,162, 61, 11,203, 31,191,222,132, 2, 63, 26, 4,154,190, -200,112,100, 62,215, 36,214, 62,168, 85,122, 60, 41,247,142, 60,132,140, 12, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 48, 61,115, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,196, 14,251,191, 16,213,105,190,166,188,109, 64, -190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,208, 66,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,173, 49, 3,191,179,133, 9, 63,104, 18, 16, 63,157, 16,186, 62,184,147,245, 62, -224, 88,111, 62,220, 25, 2, 63, 80, 44, 77,191, 76,136,152, 62,128,242,176, 61,239, 13,155, 62, 41, 17,234, 62, 93,128, 13, 62, -225,130,208, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 65,147,208, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,105, 47, 46,192, 88,212, 45, 63, 62, 35,127, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,240, 67,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,164, 48, 63, - 32,100, 38,191,163,157,157,190, 14, 78,167, 61, 0, 8, 54, 59,140,155,147,190, 10, 41, 50, 63, 28,101,140, 62,242,237,110, 63, - 0,188,179, 59, 76, 31,165, 62,210,208, 37, 63, 76,227,141, 60, 10, 28, 76, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,129, 24, 80, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22,203, 83,191,127, 15, 29,192,240, 82, 42, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 16, 69,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41,194,232,190,155,110, 35, 63,233,200, 75,190,170,158, 22,191, 80,122,193,189, -216, 58,149,189, 80, 15, 18,191, 64, 37,145,189, 96,184,219,189, 70,185, 86,191, 38,150,239, 61,142,193, 24, 62, 40, 71,217, 62, -137,114,158, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,122,231, 75, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 71,102, 63, 24, 13, 44,191, 26,187,156, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 74,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119, 40, 61,190, -150,196, 15,191,159,219, 54,191,233,195,191, 62,104, 96,122,190,192, 71, 74,191, 16,230, 56,190, 64,156,203, 61,224, 39,177, 61, - 26,222,193,190,177,206, 13, 63,144,101,237, 60, 18,227,198, 60, 19, 30,201, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 74,137,189, 61, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,172,210,252, 62,212, 58, 44,191, 99,217,149, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 75,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,152, 38, 63,169,225, 17,191, 60,217,140,189, 67,124,254,190, 16, 65, 17, 62, -230,204, 15, 63,180,148,241, 62,175,210, 73,191,182,161, 21, 63,192,222,169,188,235,174, 4, 63,126,216,156, 61,114,228,115, 61, -126,239,176, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 86,104,165, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,181,210, 46,192, 59, 4,135,191,167, 99, 44, 64,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 77,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,119, 97, 45, 63, -120, 47,205,190, 35,117, 19, 63,168,125, 98, 62,240,195, 73, 62,124,228,243, 62,120, 86, 11, 63, 72,156, 89, 62,230,232, 88, 63, -130, 53,204,190,152, 69,201, 61, 74,143, 3, 63,155, 10,162, 62,186, 21,146, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 53,129,253, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,231, 64, 60,203,210,147, 63,204, 32,185, 64, -192, 81, 55,191,109,243, 71,191, 98,237, 42, 63,233,163,214, 62,199,206,183,190,198,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 78,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,133,137,136, 62,101, 7,106,191,250,249,155,190,188,218,155, 60,192,212,184,188, - 72,215,201,189, 40,244, 61,191,128,234, 70, 61,154,226, 1,191,118,139, 91, 63,135,168,109, 63, 85, 44,112, 61, 69, 72,115, 59, -186, 90, 24, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 6, 40, 87, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,159,185, 0,192,197,235, 38,192,184,221,245, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64, 79,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,242, 54,241, 62, - 25, 75, 60,190,136, 31,166,190, 26,162, 76, 63,212, 23,180, 62,134, 28, 22,191,188,125,184, 62,170,143, 49, 63, 40,100,208, 62, -202,182, 12, 63, 90,123,103, 61,230, 65, 90, 62, 33,215, 29, 63,131, 5,233, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,233, 6, 78, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,134,118,247,191, 86, 66, 8,192, 90, 88, 20, 64, -190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62,198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96, 80,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,180,149,157, 62,171,241,150, 62,211, 72, 5, 63,196, 98, 61,191, 94, 43,103,191, -144,249, 13, 62,108, 40, 28,190,176,143, 89,189,160,169,180, 62, 50,210,102, 63, 12,245,186, 61,252,211,140, 62,239,184,252, 62, -162,107, 15, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,234, 53,126, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112,252, 2,190,192, 32, 63,192,250,176, 40, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 81,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,226,185,185, 62, - 69, 55,133,190, 78,101,246, 62,146, 32, 65,191, 12,142, 47,190,208,240, 16,191,192, 47,250, 60,148, 12,135, 62,250,130,192,190, -182,224, 63, 63,110,251,141, 61,211, 15,135, 61,153,122,212, 62,150, 66,230, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,194, 22,201, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,184, 37, 60,192,208, 36, 19,192,202,102,212, 63, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 82,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,133,116,253,190,160,178, 23, 63,114, 78, 32,191, 59, 97,221, 61,192,244,236,189, -204, 56,214, 62, 76,142, 40,191, 32, 48,161, 61, 82, 95, 7, 63,244, 70, 62,190,199,146,141, 59, 23,189,182, 62, 10, 24, 34, 63, - 60, 34,183, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 51, 4, 90, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 62,165,155, 63, 34,188,200,191,156,201,140, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 83,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68,198,205, 62, - 50, 21, 99, 63, 18,246, 86,190,239, 24,178,189,232,177, 74, 62,232, 94,174,190, 16,113, 17,189,144,148,211, 62,156,182, 80,190, - 18,214, 66,191, 55,112,182, 62,157,202, 2, 61, 67,146, 40, 61, 23, 18, 18, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,229, 84,124, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,134, 48, 1, 63,115, 14,211, 62,119,209,175, 64, -192, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,200,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 84,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0,181, 60,183, 21, 39, 63,174, 28, 42,191,206,254,185, 62, 64,101,180, 61, -224,164,162, 62,169, 22, 78,191, 14,164,146,190, 68, 47,188, 62,233,255, 63,191, 26, 61, 76, 63,219,234,171, 60,236,187, 47, 60, -123,146, 46, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,113,195, 41, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,196,144, 98, 62, 53,190,112,191,153,224,138, 64,190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62, -201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 86,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 80,148,190, - 18,138, 5, 63,169, 16, 38, 62,107, 50, 73,191,214,126, 32, 63,144, 14,148, 62,182, 31, 4,191, 72,152,145, 62, 16, 32, 89,189, - 64,239,100, 62, 51,212,220, 62, 48, 96,238, 61, 2,246,205, 61, 65, 22,180, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,247, 33, 76, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,243, 2,192, 18, 84, 91,191,110, 0, 77, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 87,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,146, 69,191,235,123, 69,190,179,188, 26,191,213,182, 47,189, 96, 14,105,191, - 56,120, 31,190,136, 41, 18, 62,208, 73,183,189,112, 99, 57,189, 32,155,137,190,111,143, 79, 62, 12, 36,220, 62,207,171,119, 62, -169,124, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,184,151,199, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,228, 81, 34, 62,178, 55, 39,192, 87, 36, 68, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64, 88,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,230,148, 3, 63, -224, 68,239, 62, 74, 64,241, 62, 71, 35, 11,191,248,202, 31,191, 68, 98,182, 62, 18,127, 48,191,160,108, 26,189,144, 93,173,190, -160,155, 16,191,143, 72,244, 61,152, 98,173, 61, 16,243,154, 62, 39,162,252, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 69,111,245, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,206,132,191,153,157,254,191, 61, 78, 57, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96, 89,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 64,217, 62,153, 24,213,190, 97,174,187, 61,103,136, 76, 63, 26, 1, 32, 63, -232, 95,162,189,124, 18, 29,191, 76, 78,155,190,124,134, 43,191,174,202,184,190, 49,138, 35, 62,234,209, 85, 62,126, 75,186, 62, -115, 6,137, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,111,100, 76, 61, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,220,163,237, 62, 54, 20, 58,192, 9,122, 64, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 90,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 95, 55,189, - 43, 21,181,190,230, 3,101,191, 87,248,137, 62, 8,208, 75, 62, 0,116,115, 59,100,196, 95,190,192, 15, 83, 62, 84,222, 81,191, - 36, 58,169, 62,187,215,163, 61, 90,207, 92, 61,187,248,152, 62,181, 59, 17, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,230,119,112, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 59,148,191,188,242, 56,191,189,111,113, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 91,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,203, 21,192, 61,216, 22, 8, 63,188, 84, 66, 63,159, 70,186, 62,240,211, 98, 62, -124, 7,155, 62, 12,134,246, 62,108, 16, 79,190,248,197,252,189, 80,188, 39, 63, 42,204,169, 62,204,195,154, 62,146,225, 51, 62, -125,254, 66, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,123, 26, 81, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32,179,252,191, 87,102,184,191,168,174, 51, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 92,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,233, 50,144,190, -207, 31, 50,191,179,203, 40,191,211, 99, 45,189,108,153, 34,190,239, 94, 10,191,114,186,212,190, 40,234, 19,190, 72, 26, 97,191, -128,105, 99, 61, 46,210, 21, 62,250, 32,186, 62,196,126,178, 62, 86,238, 16, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,131,240,124, 60, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,244, 77,192, 37, 52,163,190, 30,234, 62, 64, -190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62,200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 93,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,125, 41,112, 63, 48,166,164, 61, 88, 4,240, 61, 15,172,161, 62,106,126,191,190, -116, 33, 64, 63,128,227,184, 62, 92, 20,244,190,208,168,180,189, 60, 25, 43,191, 90,246,198, 61, 31,130, 46, 63,224,241, 54, 62, -222, 41, 46, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,190,196,107, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,251, 27,122, 63,181,229,133,191, 64, 39,149, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 95,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 46, 24,191, - 41, 20, 43,191,185,184,183, 62, 44,173,136, 62, 76, 75, 50, 63, 40, 83,126, 62,188,195, 8, 63,232,211,238, 62, 64, 36,152, 61, -236,106,145, 62,215, 4,239, 62,239,100, 21, 61,177, 73, 20, 61, 82,197,235, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 93,122, 57, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 66,151,191,209,139, 62,192, 97,118, 5, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 96,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,158,160, 32,190,190, 39, 52,191,142,138, 9,191,138, 13,224, 62,168,218,242, 62, - 92, 71, 26, 63, 32, 22, 52, 62,232, 52,124, 62,164, 91,192,190,148,111, 86,191,207,101,120, 61, 65, 26,221, 61,159, 82, 22, 63, -241, 14,122, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,195, 96, 22, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208, 63, 46,190,222,105,107,191,197,191,132, 64,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 3,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,202, 55, 63, -247,235, 89,190,127, 18, 92,190,146,129, 32,191, 8,212, 8,190,168, 50,171,190, 96,120,123, 62,232,152,249,189,140, 18,149, 62, - 32,111, 13, 61, 91,238,204, 62, 9, 90, 39, 62,122,156, 6, 62, 99, 22,156, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,115, 61, 18, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,250,148,234,190, 11,179, 97,192, 16,215, 3, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 4,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,177,227,248,190,160,134,192,190,155,159,184, 62,105,157, 51, 63, 2, 56, 54, 63, - 88,126,182, 62, 0,207, 4,187, 40,216,198, 62,140, 66, 73,191,144,126,248, 61,250, 26,119, 60, 35,207,150, 60,170,176, 20, 63, -225,120,197, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,208,234,216, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,202,177,135,191,150,220, 86,192,144, 9,239, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 5,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,201,122, 18,191, -155, 68,163,190,236, 36, 39,191,221,182,194,190,216, 47, 98,190, 98, 46,230,190,196,236,134, 62,192, 40,187, 60,112, 92,179,189, - 72, 17, 54, 63, 87,169, 5, 61,120,116, 92, 61,179,253, 38, 63,225,192,133, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,100, 58,154, 60, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,214,105,108,192,107,145,223, 62,196,182, 82, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 6,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,244, 32,190,175,189,218,190,167, 11, 55, 62,157, 75, 95,191, 32,155,243,190, -180, 86, 90,191, 56,237, 86, 62,224,198,126,190, 32, 34,101, 61, 92,239,180,190,206, 82,204, 61, 44,113, 89, 63, 62, 63, 23, 61, -219, 33,100, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 6, 63, 50, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 92, 23,243, 62, 46,133,166,191, 79,153,134, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 8,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,173,218, 49,191, -113,109, 23,191, 30, 16, 55, 62, 55,117,188,190, 24, 20,208, 62,118,245, 46,191, 0,158,236,186, 55, 10, 97,191,140,128,183, 62, -178,230,146,190,158, 2,190, 62, 33,141,193, 61,217, 93,214, 61,163, 2,220, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 96, 85, 48, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,130,192,214,190,181, 57, 73,192,176, 83, 23, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 9,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,206,172, 34,191, 67, 79,187, 62,140,197, 11, 62,199,135, 42, 63, 96, 91,148, 61, -128, 75, 25, 60, 56,126,232,189,208,190,220,189, 8,158,186, 62,182, 62,225,190,213,103, 84, 61, 92,194,115, 61,146,216,253, 62, - 40, 34,201, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 38,103,162, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,123, 4,133,192, 83,136,128, 62,136, 58, 58, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64, 10,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,147,206,137, 62, -234,207, 11, 63,195,144,225, 62,162,225, 40, 63, 24, 69,148,190, 48,238,190, 61, 13, 31, 86,191,218,106, 71, 63,248, 60, 1, 62, -160,250,136, 62,231, 78,156, 58,143,100,108, 63, 18, 72,153, 61, 52, 34, 17, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,174,199, 41, 60, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,116, 40, 12, 62,101, 32, 1,192,220,178, 95, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96, 11,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,159, 57, 95, 63,237,148,214, 62, 88,249,109, 62,231,220,204,189,240,118,221,189, -121,162, 19,191,202, 50, 48,191, 56,232, 80,190,142,100, 8,191,228,142, 19, 63,225,196, 88, 62,137, 94,237, 61,140, 5, 97, 62, - 40,195,231, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 75, 11, 15, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,211,109, 80, 63, 95,210, 20,192,246,253,103, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 12,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 32,133, 62, - 13,201,189,190, 54, 43, 66, 63, 73,254,239, 62, 0,164,179, 62, 0,181,171,188,128, 8,196, 60,214, 27, 14,191, 86, 32,128,190, -190, 27,208,190, 68,196, 53, 62,136,184,135, 61,240,250, 35, 62, 34,153, 24, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,224, 93,234, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,142,147,191, 8, 7,166,190, 61, 69,130, 64, -190, 81, 55,191,106,243, 71,191,102,237, 42, 63,233,163,214, 62,201,206,183,190,202,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 13,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,246,249, 62,199,102,140, 62,155,199, 10, 63, 39,102, 32, 63, 78, 10, 19,191, -224,238,250,190, 0, 13,111,190,240,232,187, 61,104, 10, 99, 62,164, 96,221, 62, 56,243,206, 62,109,170,159, 62,223,145, 2, 62, -211, 50, 32, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 35,143, 25, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6,254, 89,191,191,197, 85,192,180,197,254, 63,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 14,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,121,125,204, 62, - 38, 10, 46, 63, 69, 71, 26,190,131,168, 24, 63,116,105, 36,190,144,220, 32, 63, 12,167,231, 62,152,145,179, 62, 32, 72, 36,190, - 42, 67, 50,191,130, 3, 11, 61, 13, 3, 76, 61,228,181, 28, 63,102,179,155, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,244,186,188, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 46,253,191,200,126,214, 61,251, 1,125, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 15,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,170,218,181,190,161,100, 80, 63, 86, 18,175,190,141, 51,157,190, 18, 35, 4,191, -208,113,210, 62, 0,170, 11, 63,134,126,165,190,144, 47, 59, 62,104,163, 62,191, 20,251,181, 62,223,163,242, 62, 90, 98,191, 61, -223, 33,158, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 83, 76,104, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,114, 18, 94,192,208, 61, 49, 61, 94,153, 71, 64,190, 81, 55,191,107,243, 71,191,100,237, 42, 63,233,163,214, 62, -200,206,183,190,204,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 17,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,125, 41,112, 63, - 48,166,164, 61, 88, 4,240, 61, 15,172,161, 62,106,126,191,190,116, 33, 64, 63,128,227,184, 62, 92, 20,244,190,208,168,180,189, - 60, 25, 43,191,145,188,190, 61,117,157, 68, 63,105,119,224, 61,118,129,239, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,190,196,107, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 34,141,191,223,140, 39,192,178, 55, 25, 64, -190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62,201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32, 18,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,193, 40, 85, 63,120, 79,146,190, 68,249,203,190,206,217,131, 62,230, 65, 22, 63, -120,104, 63, 63,176,135,124,189,130,179,190,190,208, 81,171, 62,210,132, 69, 63,122, 6,189, 61, 59,195, 23, 62, 10,114,254, 62, -188,106,134, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,179,102, 20, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,149, 14, 63,192, 64,204,165,191, 11, 96, 24, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62, -202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64, 19,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 81, 30,191, -157, 39,223, 62,214, 30, 11, 63, 76, 51,186, 62,208,228, 83, 62,224,146, 0, 61, 22,106,121, 63, 0,124, 6,187, 0,234, 71,187, -216,190,173, 62, 15, 67, 83, 61,192,186, 4, 63, 40,206,197, 62,178,159, 50, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,208, 19, 52, 60, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,183,180, 22,192,125,173, 4,192,238,189, 8, 64, -190, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62,198,206,183,190,203,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 96, 20,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,105, 59, 20,191, 31, 36, 17, 63,112, 57,252,190, 32,101,162, 62,140, 6,160, 62, - 64,160, 80, 61,112,243,245, 61, 40, 18,224,190,192,154,227,188,238,196,139,190,133, 49,131, 61,129, 33,167, 62,160,225, 5, 63, -124, 59,177, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 20,166, 56, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 24,160, 97, 63,127,220,163,191,193,248,141, 64,192, 81, 55,191,107,243, 71,191, 98,237, 42, 63,234,163,214, 62, -197,206,183,190,202,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,128, 21,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,180,149,157, 62, -171,241,150, 62,211, 72, 5, 63,196, 98, 61,191, 94, 43,103,191,144,249, 13, 62,108, 40, 28,190,176,143, 89,189,160,169,180, 62, - 50,210,102, 63, 78,174,206, 62, 66,159, 93, 61,158, 84,118, 61, 56,211,246, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,234, 53,126, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,223, 18,192,153,169,140,191,151, 18, 57, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,160, 22,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,187, 63, 44, 63,134,104,136, 62, 45,117, 32, 63,178,227,147,190,254, 77, 90, 63, - 0,117,175,190,120, 69,167, 62,240, 73,138, 61, 56,211,189, 62,210, 28, 37,191,245, 96, 21, 62, 38,104,227, 62, 82, 62,154, 62, - 62,164,222, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,130, 27,151, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,100,193,179,191,252,111, 78,192,161, 64,228, 63,190, 81, 55,191,109,243, 71,191, 98,237, 42, 63,234,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,192, 23,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,129,101, 4,191, -237, 90, 0, 63,105,125,239,190,131, 31, 3, 63,200,160,212,190,114,217, 27, 63, 56,189, 6,190,132,223, 22,190, 4,241,223,190, - 4, 70, 0,190, 38,242, 35, 61,205,214,171, 61,176, 25, 46, 63, 82,177, 72, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,184,249,202, 62, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 90,124,191,113, 48,212,191, 57,208, 74, 64, -190, 81, 55,191,109,243, 71,191,100,237, 42, 63,232,163,214, 62,202,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66,224, 24,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,178, 25,236,189,127,158, 27, 63,122,235,239, 62, 59,108, 33, 63,244,198,103,190, -252,192,187, 62,180, 39,101,190,108,210,138, 62,145,168, 54,191,208, 20, 63,190,188,178, 81, 62,178, 57,108, 62, 93,177,153, 62, -110, 88,135, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 2,210,109, 63, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,252,231, 33,192,132, 2, 59,191, 77,162, 66, 64,190, 81, 55,191,109,243, 71,191,100,237, 42, 63,233,163,214, 62, -201,206,183,190,200,137, 61,190,158, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 26,105, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,191, 46, 24,191, - 41, 20, 43,191,185,184,183, 62, 44,173,136, 62, 76, 75, 50, 63, 40, 83,126, 62,188,195, 8, 63,232,211,238, 62, 64, 36,152, 61, -236,106,145, 62,215, 15, 30, 62,227,209, 4, 63,181,148,117, 62,217, 39,178, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 93,122, 57, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,185,138, 63,193,128, 41,192,138,193, 97, 64, -190, 81, 55,191,109,243, 71,191,102,237, 42, 63,236,163,214, 62,200,206,183,190,203,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0,190,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,229,120,168, 62,178,154, 7,191, 41,180, 48, 63,240,232,187,190, 9, 35,104,191, -224, 8,114, 62, 76,143,177,190,106, 29, 28,191,208,112,234, 62, 8,249, 92,190,244,195,250, 61, 74,120, 62, 61,198, 12, 31, 62, -203,252, 44, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 74, 4,184, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,234, 63,243,190, 82,176,159,191,246,150,111, 64,190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62, -202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 32,191,114, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,167, 26, 58,191, - 2, 70,159, 62,113,111, 2, 63,234,187,173,190,116, 51,237, 62,128, 53,247, 62,244,199, 26,190,232, 88,172,189,120,115,244, 62, - 34,147, 5,191,219, 77,158, 62, 43,131, 72, 62,117,208, 68, 62, 85, 8,155, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63,253,152,110, 63, 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,198,178, 48,191,138, 39, 52, 62, 40,252,149, 64, -190, 81, 55,191,107,243, 71,191,102,237, 42, 63,233,163,214, 62,202,206,183,190,201,137, 61,190,157, 38, 80,191, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 64,192,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43,167,210,190,195,172,139, 62,250,220, 35, 63, 30,182, 22,191,128, 3,136, 61, -110,164,176,190, 30,153,147,190, 0,249, 10,188,234, 90,160,190, 90,241,205,190, 62, 71, 19, 63,111,215,107, 62, 63, 71,138, 61, -242,231, 1, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,200, 66, 0, 0,200, 66, 0, 0, 0, 0, 0, 0,128, 63, 37,227, 77, 62, - 0, 0, 0, 0,255,255,255,255, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80, 96,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 31,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 19,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187, 63,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 23,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189,151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 39, 85,145,189, 35,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,176,101,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 71, 85,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 55, 85,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,251, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,192,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,128,127, 92, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 15, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 3, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 19,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,208,220,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,222,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -223, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,223, 84,145,188,223,223,124, 61,128,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188,255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,152,127, 35,189, 3, 62, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189, -135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,251, 84,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 0,219,135, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186, -255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,189, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,126, 35,188,255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,255,223,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,104,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80, 0,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188, -255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,167, 84,145,188, 15,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,120,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,251,137, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,239, 84,145,189, 27,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 45,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,191,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,239, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 15,224,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 16,144,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 23,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 48,145,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 7, 62, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 23,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189,151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 29,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,112,111,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187, 63,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, - 7, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 7,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -149,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 29,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,144,112,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,221,124, 59, 54,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,127,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188,191, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,191,223,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188, -239,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,104,127, 35,189,255, 61, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189,131,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,223, 84,145,189, 11,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,160,161,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189,255, 61, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,251,137, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,231, 84,145,189, 15,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,192,162,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,232,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 19,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189,155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 27, 85,145,189, 35,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192,145,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187, 63,224,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -147,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 39, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224,146,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,191,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, - 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 3, 85,145,189, 27,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0,148,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,221,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 83,145,187,127,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,126, 35,188, -223, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,167, 84,145,188,223,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,239,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,120,127, 35,189,247, 61, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -127,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,239, 84,145,189, 7,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16, 45,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 48, 46,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,239,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 3, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 19,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 80, 47,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189,139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192,216,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188, 15,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,120,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 27,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224,217,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,151,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 19, 85,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0,219,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 84,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, - 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 31, 85,145,188, 31,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,243, 20,227,188, 23,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,180,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 71,138, 94,189, -155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 25, 85,145,189, 35,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 64,235,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,127,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188,223, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188,223,223,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189,255, 61, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189,135,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 11, 85,145,189, 15,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 96,236,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -223, 61, 14, 61,222,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188,255,223,124, 61,128,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188,255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,200,127, 35,189, 7, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,143, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,128,237,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 19,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 13, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 5,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187, 63,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188, 31,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 23,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 19, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -151,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 7, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 6,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,221,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,127,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,255, 84,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,195, 20,227,188, -255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,148,127, 35,189,255, 61, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 31,138, 94,189,131,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 1, 85,145,189, 11,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 7,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,247, 84,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,160,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 8,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187, 31,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 23, 85,145,188, 31,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,251, 20,227,188, - 31,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,192,127, 35,189, 19, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 83,138, 94,189,153,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 10,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187, 63,224,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 11,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186, -255,221,124, 59, 54,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 86,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 31,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 21,227,188, - 31,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,151,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 32,124,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,127,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,223,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -247, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188, 7,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 9, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -141,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 21,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 64,125,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 19, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 31,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 96,126,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,127,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -223, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,123,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,128,127,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -127,224,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187, 31,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 23, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 39,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 27,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 21, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189,157,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 31, 85,145,189, 41,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,160,128,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 85,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, - 7, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,255, 84,145,188, 15,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,176,127, 35,189, 13, 62, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189, -147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 11, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,192,129,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188, 31, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 31,224,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 31,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,120,127, 35,189, 23, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189,167,155, 65, 62,182,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 47,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 64,106,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,127,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,247, 84,145,188, 31,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 23,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,160,127, 35,189, 19, 62, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189, -155,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 39,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 96,107,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,189, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 15, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,166,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 19,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128,108,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186,255,223,124, 59, 52,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,127,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -223, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,135, 84,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188,239,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,104,127, 35,189,255, 61, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189, -135,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,231, 84,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160,109,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,231, 84,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192,110,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188,255,223,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -145,155, 65, 62,182,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 7, 85,145,189, 23,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224,111,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186, -255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 86,145,187,127,223,124, 60,189, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,255, 61, 14, 61,222,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188,255,223,124, 61,129,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 43, 21,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,216,127, 35,189, 3, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 31, 85,145,189, 19,224,124, 62,143, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0,113,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, 3,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,239, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16,133,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 90,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,151,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 48,134,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,239,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188,243,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,104,127, 35,189, 1, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189, -133,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 80,135,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, - 23,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 19, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189,151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,255, 84,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,112,136,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,247,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,247,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189, -139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,144,137,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 39, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,184,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,180,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 19, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,176,138,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187, 63,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, - 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 23,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,208,139,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,223,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188,255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,199, 84,145,188, 15,224,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, - 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,136,127, 35,189, 9, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 23,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,144, 2,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186,255,225,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, - 31, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188, 31,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 47,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 23, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189, -167,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 47,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,176, 3,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,222,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,123,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, -255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 3, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 23,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,208, 4,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,216,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189, -135,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,240, 5,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186, -255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187, 63,224,124, 60,189, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 15, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 16, 7,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186,255,225,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -223, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188,255,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 48, 8,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,167, 84,145,187,191,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,120,127, 35,188,239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188,255,223,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,155, 20,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,128,127, 35,189, 3, 62, 14, 62,166,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189,135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 15,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80, 9,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188,255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189, -143,155, 65, 62,182,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,112, 10,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186, -255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188,223, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,199, 84,145,188,239,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, -255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189,139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,239, 84,145,189, 19,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,144, 11,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,189, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 31, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188, 31,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,152,127, 35,189, 7, 62, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,208,191,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 19, 85,145,189, 23,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,240,192,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, - 7, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 23, 85,145,188, 23,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,251, 20,227,188, 19,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,176,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -149,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 19, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16,194,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 54,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188,255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,123,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 7, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 15,224,124, 62,139, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 48,195,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,221,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -223, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,135, 84,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,104,127, 35,189, 7, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189, -143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,231, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 80,196,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 19, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189,155,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,112,197,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,221,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,127,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,223,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,176,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189, -135,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 27, 85,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,144,198,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,239, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 7, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,139,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 19,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,176,199,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 31, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,208,200,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -127,224,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187, 31,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 7, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 23,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 19,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 13, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,255, 84,145,189, 25,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,240,201,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 54,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -223, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,167, 84,145,188,255,223,124, 61,123,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,107, 20,227,188,255,142,197, 61, 78, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,120,127, 35,189,255, 61, 14, 62,162,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,251,137, 94,189, -135,155, 65, 62,182,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,231, 84,145,189, 23,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16,203,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,225,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 86,145,187,127,224,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 31, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 31,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 23, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,159,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 39,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80,166,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,112,167,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186, -255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 83,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,126, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,255,223,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,107, 20,227,188, -255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,104,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,251,137, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 23,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,144,168,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 19, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,107,138, 94,189, -155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 39, 85,145,189, 31,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,176,169,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,221,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,127,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188,223, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,199, 84,145,188,207,223,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, -231,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,128,127, 35,189,247, 61, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 19,138, 94,189,127,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,243, 84,145,189, 7,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,208,170,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187, 31,224,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, - 7, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188, 23,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 17, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -149,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 29,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,240,171,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,223,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,247, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 3,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 9, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,255, 84,145,189, 23,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 16,173,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,126, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,135, 84,145,188, 15,224,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188, 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,104,127, 35,189, 11, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189, -143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,231, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 48,174,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,191,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,199, 84,145,188, 15,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, - 11,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,120,127, 35,189, 11, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,251,137, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 25,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80,175,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,224,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187, 63,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188, 31,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 23,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 35,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,112,176,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187, 63,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,176,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 11, 85,145,189, 19,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,144,177,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186,255,222,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 86,145,187,191,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, -247, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188,255,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 3,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,200,127, 35,189, 7, 62, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,176,178,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, -255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 27,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,208,179,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,221,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,127,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -191, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,191,223,124, 61,128,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188,239,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,152,127, 35,189,255, 61, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189, -135,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 15,224,124, 62,143, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,240,180,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,223,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,126, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,199, 84,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,136,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189,139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 19,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 16,182,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,127,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188,239,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188,255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,200,127, 35,189, 9, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 48,183,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, - 11,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189,147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,255, 84,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 80,184,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 39, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,216,127, 35,188, - 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 31, 85,145,188, 15,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 3, 21,227,188, 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,196,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 83,138, 94,189, -155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 29, 85,145,189, 35,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16, 51,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,221,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,127,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188,255,223,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 21,227,188, - 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,232,127, 35,189, 7, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,139,138, 94,189,151,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 47, 85,145,189, 27,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 48, 52,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, 23,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 19, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 80, 53,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 71, 85,145,187, 63,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 23, 85,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,176,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,151,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 11, 85,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,112, 54,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, -239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,239,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,172,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189, -139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 7, 85,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,144, 55,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186, -255,221,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,255,222,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188,191, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,191,223,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 20,227,188, -239,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0, 72,127, 35,189,247, 61, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,203,137, 94,189,127,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 7,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,176, 56,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,224,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187, 63,224,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188, 15,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,144,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189, -139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 19,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,208, 57,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, -255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,240, 58,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,225,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -223, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188,223,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188,239,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,160,127, 35,189,255, 61, 14, 62,166,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189, -135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 19, 85,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16, 60,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,231, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,152,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,255, 84,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,164,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 47,138, 94,189,143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 13, 85,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 48, 61,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186,255,224,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,127,224,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 31, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188, 31,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 31,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 19, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -159,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 11, 85,145,189, 39,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 80, 62,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,255, 84,145,189, 23,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,112, 63,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 85,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,231, 84,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, - 7, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 23,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 19,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,172,127, 35,189, 13, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189, -145,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 11, 85,145,189, 29,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,144, 64,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 13, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,176, 65,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,223,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,127,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,247, 84,145,188,223,223,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -135,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,208, 66,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,222,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188,239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,247,223,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,107, 20,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0, 88,127, 35,189, 3, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,219,137, 94,189,139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,223, 84,145,189, 15,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,240, 67,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 80,145,186,255,223,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, - 7, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188, 15,224,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, 11,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,136,127, 35,189, 11, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 11,138, 94,189, -143,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,247, 84,145,189, 23,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 16, 69,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -127,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,223,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 7,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, - 11,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,160,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 19, 85,145,189, 31,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 74,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,232,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 55, 85,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,251, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,192,127, 35,189, 7, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 19, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 75,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,221,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,127,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,223, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, -255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,152,127, 35,189,255, 61, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189,135,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 3, 85,145,189, 15,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 77,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188,255,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,152,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189, -139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 3, 85,145,189, 15,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 78,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 63, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 63,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 47,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 23, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,107,138, 94,189,159,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 39,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 64, 79,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,223,124, 59, 60,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, -255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 23, 85,145,188, 15,224,124, 61,128,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,176,127, 35,189, 15, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189, -151,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 11, 85,145,189, 31,224,124, 62,143, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 96, 80,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 19, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189,151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 31,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 81,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,239,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 82,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, -255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,176,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 15,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 83,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 84,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 39, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,168,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 23, 85,145,188, 31,224,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,251, 20,227,188, 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,192,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189, -151,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 27, 85,145,189, 31,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 84,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,225,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,127,224,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 31, 62, 14, 61,222,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 63,224,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 43, 21,227,188, - 31,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 23, 62, 14, 62,166,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,159,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 47,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 86,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 83,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 84,145,187,127,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188, -223, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,183, 84,145,188,255,223,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188,255,142,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,128,127, 35,189, 3, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 3,138, 94,189, -139,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,235, 84,145,189, 19,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 87,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, 7, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 13, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 64, 88,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188, 15,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 31, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 96, 89,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186, -127,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,223,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 15,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, - 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,144,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189,147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,251, 84,145,189, 27,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 90,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -239, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188,239,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 3, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -139,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 91,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,191,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 11,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,145,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 92,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187, 31,224,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 23,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, 19,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,176,127, 35,189, 13, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -149,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 11, 85,145,189, 25,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 93,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187, 63,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 72,127, 35,188,255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,167, 84,145,188,255,223,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,139, 20,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,136,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 27,138, 94,189,143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,247, 84,145,189, 23,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 95,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 83,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189, -151,155, 65, 62,182,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 96,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187, 31,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 7, 85,145,188, 23,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 19,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 3,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 71, 85,145,187,127,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,124,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 7,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,192,127, 35,189, 11, 62, 14, 62,163,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189, -151,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 27, 85,145,189, 31,224,124, 62,140, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 4,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187, 63,224,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 15, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,231, 84,145,188, 31,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,171, 20,227,188, - 23,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,151,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 33,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 5,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 7, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 23, 85,145,189, 31,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 6,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 88,145,186, -255,222,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 86,145,187, 63,224,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 15, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 7,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 7, 62, 14, 62,166,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 39, 85,145,189, 19,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 8,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,221,124, 59, 55,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,152,127, 35,188, -223, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,223,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,227, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 67,138, 94,189, -135,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 15,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 9,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,222,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,223,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188,255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 15,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, - 7,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 11, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,143,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 25,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 64, 10,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,189, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 71, 85,145,188, 31,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -143,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 7, 85,145,189, 31,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 96, 11,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 31,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,192,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 83,138, 94,189,151,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 31, 85,145,189, 31,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 12,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,221,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,127,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -223, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,199, 84,145,188,223,223,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188,239,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189,255, 61, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -135,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 7, 85,145,189, 15,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 13,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,127, 35,188,255, 61, 14, 61,218,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,167, 84,145,188, 15,224,124, 61,124,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,107, 20,227,188, - 15,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,104,127, 35,189, 15, 62, 14, 62,163,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189,147,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 27,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 14,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,127,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, - 7, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,231, 84,145,188, 23,224,124, 61,127,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188, 19,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 13, 62, 14, 62,165,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -149,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 29,224,124, 62,143, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 15,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -127,223,124, 59, 61,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,223,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188,255, 61, 14, 61,222,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 71, 85,145,188, 15,224,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, - 11,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,184,127, 35,189, 11, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,145,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 15, 85,145,189, 21,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 17,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188,255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,168,127, 35,189, 11, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 15,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 32, 18,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, 7, 62, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188, 23,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, - 19,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 31, 85,145,189, 35,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 64, 19,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,188, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -255, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188, 15,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189, -147,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 23,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 96, 20,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -255,223,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,255,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,239, 84,145,188, 31,224,124, 61,125,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,187, 20,227,188, - 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 15, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 43,138, 94,189,151,155, 65, 62,183,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 27,224,124, 62,140, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,128, 21,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186,255,225,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,231, 84,145,187,255,224,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188, - 63, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0,239, 84,145,188, 63,224,124, 61,126,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,195, 20,227,188, 47,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,156,127, 35,189, 31, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 55,138, 94,189, -175,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 5, 85,145,189, 55,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,160, 22,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 84,145,186, -127,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,223,223,124, 60,186, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,104,127, 35,188, 7, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 7,224,124, 61,126,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,219, 20,227,188, - 19,143,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 17, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189,149,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 11, 85,145,189, 29,224,124, 62,141, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0,192, 23,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0,135, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188, - 15, 62, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 39, 85,145,188, 15,224,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, 23,143,197, 61, 80, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,200,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 91,138, 94,189, -155,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 31, 85,145,189, 35,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0,224, 24,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0,135, 84,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0,199, 84,145,187,223,223,124, 60,187, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, 7, 62, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,247, 84,145,188, 7,224,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,211, 20,227,188, - 11,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,168,127, 35,189, 13, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 51,138, 94,189,147,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 7, 85,145,189, 27,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 0, 26,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186,255,222,124, 59, 57,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,187, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,200,127, 35,188, -255, 61, 14, 61,219,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,235, 20,227,188, 15,143,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,184,127, 35,189, 15, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 59,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0, 15, 85,145,189, 27,224,124, 62,142, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 0,190,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 86,145,186, -255,223,124, 59, 58,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 85,145,187,255,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0, 8,128, 35,188,223, 61, 14, 61,221,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0, 39, 85,145,188,255,223,124, 61,127,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 11, 21,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,200,127, 35,189, 7, 62, 14, 62,164,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 75,138, 94,189,135,155, 65, 62,186,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0, 23, 85,145,189, 15,224,124, 62,142, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -216, 0, 0, 0, 32,191,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 85,145,186,255,223,124, 59, 56,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, - 0, 0, 0, 0, 7, 85,145,187,191,223,124, 60,186, 71, 2, 63, 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,127, 35,188, -239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, 0, 0, 0, 0, 7, 85,145,188,255,223,124, 61,125,101,127, 63, - 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0,203, 20,227,188,255,142,197, 61, 81, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, - 0, 0, 0, 0,160,127, 35,189, 7, 62, 14, 62,164,172,187, 63, 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0, 35,138, 94,189, -143,155, 65, 62,184,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, 0, 0, 0, 0,255, 84,145,189, 23,224,124, 62,141, 17,245, 63, - 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,216, 0, 0, 0, 64,192,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 7, 82,145,186, -255,223,124, 59, 59,146,131, 62, 0, 0, 72, 65, 0, 0, 96, 63, 0, 0, 0, 0, 7, 84,145,187,191,223,124, 60,188, 71, 2, 63, - 0, 0,200, 65, 0, 0, 64, 63, 0, 0, 0, 0,136,126, 35,188,239, 61, 14, 61,220,123, 65, 63, 0, 0, 22, 66, 0, 0, 32, 63, - 0, 0, 0, 0,135, 84,145,188,239,223,124, 61,128,101,127, 63, 0, 0, 72, 66, 0, 0, 0, 63, 0, 0, 0, 0, 75, 20,227,188, -255,142,197, 61, 82, 2,158, 63, 0, 0,122, 66, 0, 0,192, 62, 0, 0, 0, 0,104,127, 35,189, 3, 62, 14, 62,165,172,187, 63, - 0, 0,150, 66, 0, 0,128, 62, 0, 0, 0, 0,235,137, 94,189,139,155, 65, 62,185,177,216, 63, 0, 0,175, 66, 0, 0, 0, 62, - 0, 0, 0, 0,231, 84,145,189, 19,224,124, 62,143, 17,245, 63, 0, 0,200, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 88, 0, 0, 0,224,223,117, 1, 0, 0, 0, 0, 93, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 19, 0, 0, 0, 23, 0, 0, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 32, 49, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,220,117, 1, 0, 0, 0, 0,224,235,196, 1, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 79, 66, 0, 0, 32, 4, 0, 0,144, 95,116, 1, 0, 0, 0, 0, 99, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144, 88,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 66,116,101,120,116,117,114,101, 0,114,101,118,105,101,119, 46, 48, 48, 53, 0, 0, 0, 0, 1, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 76,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,240, 99,116, 1, 0, 0, 0, 0, 61, 16,183,188, 21,204,103,191, 48,234,228, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,153, 39,155, 64,153, 39,155, 64,153, 39,155, 64, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,218, 15,201, 63, 0, 0,192, 37,255,255,255, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, -153, 39,155, 64,152, 39, 27, 38,102,187,232,166, 0, 0, 0, 0,102,187,232, 38,157,134,196, 52,153, 39,155, 64, 0, 0, 0, 0, -154, 39, 27, 38,153, 39,155,192,157,134,196, 52, 0, 0, 0, 0, 61, 16,183,188, 21,204,103,191, 48,234,228, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 25, 50, 83, 62, 28, 50,211, 35, 23, 50,211,163, 0, 0, 0, 0, 27, 50,211,163, 25, 50, 83, 62,158, 59,174, 38, 0, 0, 0, 0, - 0, 24, 44,173,224,165, 94,175, 25, 50, 83, 62, 0, 0, 0, 0,236,251, 33, 59,135, 37, 40, 59,118, 71,238, 63, 0, 0,128, 63, - 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 1, 0, 2, 0, 0, 0, 0, 0, 79, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 56,180,150,201, 0, 0,128, 63, 10,215, 35, 61, 0, 0,128, 63, -205,204,204, 62,205,204,204, 61, 0, 0, 0, 0, 4, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 64, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,240, 99,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 65, 0, 0,144, 2, 0, 0, 64,100,116, 1, 0, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0,224,103,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 99,104, -101, 99,107,101,114,100, 97,114,107, 0, 0, 0, 97,116,101,114,105, 97, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 1, 0,116, 1,221, 61,200,251,220, 61,200,251,220, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63,154,153, 89, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 2, 0, 2, 0, 1, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 64, 1, 3, 0, 64, 1, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, - 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 16,103,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,136, 0, 0, 0, 16,103,116, 1, 0, 0, 0, 0, 29, 0, 0, 0, - 1, 0, 0, 0, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,128,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,192, 63, 1, 0,192, 63, 1, 0,192, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 23,183,209, 56,184,177,209, 56,184,177,209, 56, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 77, 65, 0, 0,144, 2, 0, 0,224,103,116, 1, 0, 0, 0, 0, 38, 0, 0, 0, - 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, 64,100,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 65, 99,104,101, 99,107,101,114,108,105,103,104,116, 0, 0, 0, 97,116,101,114,105, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0,188, 65,157, 62,178, 61,157, 62,178, 61,157, 62, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 63,154,153, 89, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, - 0, 0, 0, 0,205,204,204, 61, 2, 0, 2, 0, 1, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, - 10,215,163, 59, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 64, 1, 3, 0, 64, 1, 1, 0, 4, 0, 12, 0, 4, 0, - 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, - 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 16, 8, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,176,106,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 61, -205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,136, 0, 0, 0,176,106,116, 1, - 0, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,128,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 23,183,209, 56,184,177,209, 56,184,177,209, 56, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 77, 65, 0, 0,144, 2, 0, 0,128,107,116, 1, - 0, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0,112,114,116, 1, 0, 0, 0, 0,224,103,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,112,114,101,118,105,101,119, 0, 0, 97,116,101,114,105, 97,108, 0, 0, - 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128, 63, 61,232, 54, 63, -184,161, 23, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63,188,248, 68, 62, 0, 0,128, 63, -205,204, 76, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,198,121,130, 63, 0, 0,160, 63, 0, 0, 0, 0, - 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, - 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 17, 3, 3, 0, 17, 3, - 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, - 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63, - 1, 8, 1, 0, 32,111,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 80,110,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63,205,204, 76, 63, -205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, -136, 0, 0, 0, 80,110,116, 1, 0, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128,127,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,205,204, 76, 62, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 3, 0, 0, 32,111,116, 1, 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,245, 40,220, 62, 0, 0, 0, 0,164,112,125, 63, 0, 0,128, 63,106,214, 24, 63, - 0, 0,128, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65, 0, 0, -144, 2, 0, 0,112,114,116, 1, 0, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0, 96,121,116, 1, 0, 0, 0, 0,128,107,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,116,101,120,116,117,114,101, 0,114,101, -118,105,101,119, 46, 48, 48, 49, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0,205,204,204, 61, 2, 0, 2, 0, 50, 0, 0, 6, - 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 71, 0, 1, 3, 67, 0, 1, 3, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, 0, 0, 0, 63,205,204,204, 61, -205,204,204, 61, 0, 0,128, 63, 1, 8,129, 0, 16,118,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 64,117,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, -205,204, 76, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,136, 0, 0, 0, 64,117,116, 1, 0, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 1, 0,129, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,127,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63,205,204, 76, 62, - 0, 0, 0, 0, 68, 65, 84, 65, 8, 3, 0, 0, 16,118,116, 1, 0, 0, 0, 0, 32, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,245, 40,220, 62, 0, 0, 0, 0,164,112,125, 63, - 0, 0,128, 63,106,214, 24, 63, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 65, 0, 0,144, 2, 0, 0, 96,121,116, 1, 0, 0, 0, 0, 38, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,112,114,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 65,116,101, -120,116,117,114,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,205,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 2, 0, 2, 0, 50, 0, 0, 6, 0, 0,128, 63, 0, 0,128, 63, 18, 0, 18, 0, 10,215,163, 59, 10,215,163, 59, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 3, 3, 0, 1, 3, 1, 0, 4, 0, 12, 0, 4, 0, 0, 0, 0, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0,128, 64, 0, 0, 0, 63,205,204,204, 61, - 0, 0, 0, 63,205,204,204, 61,205,204,204, 61, 0, 0,128, 63, 0, 0, 0, 0, 48,124,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 63,205,204, 76, 61,205,204,204, 61,102,102,166, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 3, 0, 0, 48,124,116, 1, 0, 0, 0, 0, 32, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,245, 40,220, 62, - 0, 0, 0, 0,164,112,125, 63, 0, 0,128, 63,106,214, 24, 63, 0, 0,128, 63, 0, 0,128, 63, 1, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0,128, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0, 48, 1, 0, 0,128,127,116, 1, 0, 0, 0, 0, 34, 0, 0, 0, - 1, 0, 0, 0,240,128,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 84, 69,112,114,101,118,105,101,119, 0,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0,128, 63, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 64, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, - 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,205,204,204, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69, 0, 0, 48, 1, 0, 0,240,128,116, 1, - 0, 0, 0, 0, 34, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,127,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 69,102, 97,107,101,115,104, 97,100,111,119, 0, 0, 76,101,110,100, 0,101, -120, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0,160, 64, 0, 0,128, 63, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 64, 0, 0, 0, 64, - 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 40, 0, 5, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 1, 0, 1, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0,205,204,204, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 0, 0, -120, 1, 0, 0, 96,130,116, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, 32, 2,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 67,117, 98,101, 46, 48, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208, 1,118, 1, 0, 0, 0, 0,192,223,116, 1, 0, 0, 0, 0, 16, 7,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,160,133,116, 1, 0, 0, 0, 0,224,174,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,101,117, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,132,116, 1, - 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 96,173,116, 1, 0, 0, 0, 0, 1, 0, 0, 0, - 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 64,222,116, 1, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0,249, 1, 0, 0,237, 3, 0, 0,244, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,192,133, 88, 61, -184, 45, 85,189,196,181, 24,190,185, 71, 35, 63,153, 31,235, 62,130,102,203, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,208, 1,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 32,132,116, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,133,116, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,116, 39, 0, 0,160,133,116, 1, 0, 0, 0, 0, 56, 0, 0, 0,249, 1, 0, 0,140,144,131, 62, -119,163,200, 60,156, 9, 85, 62,125, 92, 70,170,228, 21, 0,255, 50,222, 26,190,119,163,200, 60,156, 9, 85, 62,131,163, 70,170, -228, 21, 0,255, 61,126,146, 62,223, 37, 8,188, 99,183, 47, 62,247, 76,191,194,228, 81, 2,255,147,185, 56,190,223, 37, 8,188, - 99,183, 47, 62, 9,179,191,194,228, 81, 2,255,129,176,157, 62,211, 91,217,188,244,238,246, 61, 31, 84,226,181,191, 61, 2,255, - 28, 30, 79,190,211, 91,217,188,244,238,246, 61,225,171,226,181,191, 61, 2,255,115, 19, 94, 62,103,251,128,189,150, 32, 14, 62, -241, 9,155,144, 64, 62, 2,255, 26,161,227,189,103,251,128,189,150, 32, 14, 62, 15,246,155,144, 64, 62, 2,255,115, 19, 94, 62, -251,118, 25,189, 20,165, 62, 62,184, 14,144,163, 76, 87, 2,255, 26,161,227,189,251,118, 25,189, 20,165, 62, 62, 72,241,144,163, - 76, 87, 2,255,115, 19, 94, 62,232,107, 34, 60,116,128, 92, 62, 3, 3,121,131,110, 29, 0,255, 26,161,227,189,232,107, 34, 60, -116,128, 92, 62,253,252,121,131,110, 29, 0,255, 58,193, 56, 62,119,163,200, 60, 77,247, 99, 62, 56,171,117,167,206, 36, 0,255, -168,252,152,189,119,163,200, 60, 77,247, 99, 62,200, 84,117,167,206, 36, 0,255,109, 42, 23, 62,223, 37, 8,188, 88,215, 73, 62, -152,217,122,203, 56,110, 0,255,229,197, 0, 62,211, 91,217,188, 71, 14, 29, 62,179,184, 93,175, 66, 69, 2,255,249, 23,164,188, -211, 91,217,188, 71, 14, 29, 62, 77, 71, 93,175, 66, 69, 2,255, 88,231,182, 61,159,154,121, 61,179,201, 32, 62,181,151,104,255, - 51, 74, 2,255,207,121,134, 60,159,154,121, 61,179,201, 32, 62, 75,104,104,255, 51, 74, 2,255, 25,158,242, 61,159,154,121, 61, - 88,215, 73, 62, 78,171,150,255,246, 95, 2,255,110,194, 80,188,159,154,121, 61, 88,215, 73, 62,178, 84,150,255,246, 95, 2,255, -138,211, 41, 62,159,154,121, 61, 77,247, 99, 62,152,133,153,254, 98, 37, 0,255,143, 66,118,189,159,154,121, 61, 77,247, 99, 62, -104,122,153,254, 98, 37, 0,255, 58,193, 56, 62,154,232,206, 61, 77,247, 99, 62, 24,170, 13, 88, 89, 35, 0,255,168,252,152,189, -154,232,206, 61, 77,247, 99, 62,232, 85, 13, 88, 89, 35, 0,255,109, 42, 23, 62,173, 79, 5, 62, 88,215, 73, 62,249,200,221, 65, -244, 94, 2,255, 31,158, 43,189,173, 79, 5, 62, 88,215, 73, 62, 7, 55,221, 65,244, 94, 2,255,229,197, 0, 62, 54,180, 27, 62, - 71, 14, 29, 62, 51,186, 86, 78, 78, 73, 2,255,249, 23,164,188, 54,180, 27, 62, 71, 14, 29, 62,205, 69, 86, 78, 78, 73, 2,255, -115, 19, 94, 62,111, 6, 65, 62,150, 32, 14, 62, 2, 11,152,107,114, 68, 2,255, 26,161,227,189,111, 6, 65, 62,150, 32, 14, 62, -254,244,152,107,114, 68, 2,255,115, 19, 94, 62, 14, 43, 35, 62, 20,165, 62, 62,201, 14,180, 91, 14, 88, 2,255, 26,161,227,189, - 14, 43, 35, 62, 20,165, 62, 62, 55,241,180, 91, 14, 88, 2,255,115, 19, 94, 62,250,195,236, 61,116,128, 92, 62,134, 2, 29,125, -228, 26, 0,255, 26,161,227,189,250,195,236, 61,116,128, 92, 62,122,253, 29,125,228, 26, 0,255,140,144,131, 62,154,232,206, 61, -156, 9, 85, 62, 54, 93, 67, 85,154, 20, 0,255, 50,222, 26,190,154,232,206, 61,156, 9, 85, 62,202,162, 67, 85,154, 20, 0,255, - 61,126,146, 62,173, 79, 5, 62, 99,183, 47, 62,241, 76,161, 60, 97, 82, 2,255,147,185, 56,190,173, 79, 5, 62, 99,183, 47, 62, - 15,179,161, 60, 97, 82, 2,255,129,176,157, 62, 54,180, 27, 62,244,238,246, 61,179, 83,157, 71, 45, 65, 2,255, 28, 30, 79,190, - 54,180, 27, 62,244,238,246, 61, 77,172,157, 71, 45, 65, 2,255,157, 89,176, 62,159,154,121, 61, 67, 1,232, 61, 40,111,113,255, -117, 63, 2,255, 84,112,116,190,159,154,121, 61, 67, 1,232, 61,216,144,113,255,117, 63, 2,255,237,107,161, 62,159,154,121, 61, -139, 64, 40, 62, 48,100,154,255,167, 79, 2,255,244,148, 86,190,159,154,121, 61,139, 64, 40, 62,208,155,154,255,167, 79, 2,255, -100, 7,139, 62,159,154,121, 61, 48, 78, 81, 62,117,126,181,254,185, 19, 0,255,227,203, 41,190,159,154,121, 61, 48, 78, 81, 62, -139,129,181,254,185, 19, 0,255, 26,229,140, 62,159,154,121, 61, 8,197, 88, 62,160,120,106,254,198, 42, 2,255, 79,135, 45,190, -159,154,121, 61, 8,197, 88, 62, 96,135,106,254,198, 42, 2,255, 66,110,133, 62,114, 95,214, 61,116,128, 92, 62,173, 93,126, 74, - 93, 45, 2,255,158,153, 30,190,114, 95,214, 61,116,128, 92, 62, 83,162,126, 74, 93, 45, 2,255,115, 19, 94, 62,170,177,251, 61, -185,178,103, 62, 9, 11, 31,115,216, 54, 2,255, 26,161,227,189,170,177,251, 61,185,178,103, 62,247,244, 31,115,216, 54, 2,255, -206, 5, 53, 62,114, 95,214, 61,145, 41,111, 62, 9,181,184, 80, 43, 65, 2,255,208,133,145,189,114, 95,214, 61,145, 41,111, 62, -247, 74,184, 80, 43, 65, 2,255,178, 92, 34, 62,159,154,121, 61,145, 41,111, 62,116,146, 57,254, 43, 66, 2,255, 48,103, 88,189, -159,154,121, 61,145, 41,111, 62,140,109, 57,254, 43, 66, 2,255,206, 5, 53, 62, 22,200,170, 60,145, 41,111, 62, 34,182,181,173, -115, 64, 2,255,208,133,145,189, 22,200,170, 60,145, 41,111, 62,222, 73,181,173,115, 64, 2,255,115, 19, 94, 62,159,154,121, 61, -253,228,114, 62, 74, 24,139,255,171,125, 2,255, 26,161,227,189,159,154,121, 61,253,228,114, 62,182,231,139,255,171,125, 2,255, -115, 19, 94, 62,149,249, 43, 59,185,178,103, 62,218, 10,140,140, 45, 54, 2,255, 26,161,227,189,149,249, 43, 59,185,178,103, 62, - 38,245,140,140, 45, 54, 2,255, 66,110,133, 62, 22,200,170, 60,116,128, 92, 62,141, 92,203,179,210, 44, 2,255,158,153, 30,190, - 22,200,170, 60,116,128, 92, 62,115,163,203,179,210, 44, 2,255,203,133, 88, 61,202,248, 23, 62, 88,215, 73, 62, 0, 0, 43,124, - 17, 31, 0,255,203,133, 88, 61, 34, 77,229, 61,145, 41,111, 62, 0, 0, 63,249,209,127, 0,255,203,133, 88, 61,150,254,188,190, -236, 27, 70, 62, 0, 0,204,251,237,127, 0,255,203,133, 88, 61,191, 79, 78,190,116,128, 92, 62, 0, 0, 33,150,238, 71, 2,255, -203,133, 88, 61,146,221, 14,190, 77,247, 99, 62, 0, 0, 28,100,192, 79, 0,255,203,133, 88, 61, 30, 99,211,190, 20,165, 62, 62, - 0, 0,184,142,147, 59, 2,255,203,133, 88, 61,133,198, 12, 62,190,169, 6, 62, 0, 0,143,103, 57, 75, 0,255,203,133, 88, 61, - 99, 38, 91, 62, 28,120,239, 61, 0, 0,115, 78, 34,101, 0,255,203,133, 88, 61, 16,243,187, 62,170,250,206,190, 0, 0,190,110, -212,191, 2,255,203,133, 88, 61,247,106, 87, 62,178,224, 11,191, 0, 0,144, 35, 12,133, 3,255,203,133, 88, 61, 18,165,157,188, - 33, 20, 9,191, 0, 0,194,214,213,134, 2,255,203,133, 88, 61, 32, 43,108,190,227, 83,160,190, 0, 0,154,134,113,215, 2,255, -109, 42, 23, 62,146,221, 14,190, 67, 1,232, 61,144,113,122,198, 79, 13, 0,255, 31,158, 43,189,146,221, 14,190, 67, 1,232, 61, -112,142,122,198, 79, 13, 0,255, 87,106, 75, 62,138, 37,131,190, 28,120,239, 61,196,122, 19, 31,152, 18, 2,255,225, 78,190,189, -138, 37,131,190, 28,120,239, 61, 60,133, 19, 31,152, 18, 2,255,115, 19, 94, 62, 2,186,192,190, 28,120,239, 61,167,125,146, 12, -226, 20, 0,255, 26,161,227,189, 2,186,192,190, 28,120,239, 61, 89,130,146, 12,226, 20, 0,255, 75,138,101, 62,200, 96,239,190, -227, 37,202, 61,113,124,142,242,196, 26, 2,255,203,142,242,189,200, 96,239,190,227, 37,202, 61,143,131,142,242,196, 26, 2,255, - 47,225, 82, 62,195,112,252,190, 10,175,194, 61,159, 79, 44,159,210, 25, 2,255,146, 60,205,189,195,112,252,190, 10,175,194, 61, - 97,176, 44,159,210, 25, 2,255, 41,248, 11, 62,242, 4, 1,191,107,138,224, 61,143, 19, 13,131,178, 19, 2,255, 27,170,253,188, -242, 4, 1,191,107,138,224, 61,113,236, 13,131,178, 19, 2,255,203,133, 88, 61,168,226, 2,191,244,238,246, 61, 0, 0, 75,130, - 21, 24, 2,255,140,144,131, 62, 18,242,240,189,227, 37,202, 61,114, 47,117,137,232, 8, 2,255, 50,222, 26,190, 18,242,240,189, -227, 37,202, 61,142,208,117,137,232, 8, 2,255, 83, 55,178, 62, 23,233,143,189,187,156,209, 61, 25, 77,198,154,214, 13, 2,255, -193, 43,120,190, 23,233,143,189,187,156,209, 61,231,178,198,154,214, 13, 2,255, 26,222,224, 62,182,236,140, 60, 49, 21,112, 61, -216,113,247,198,255, 12, 2,255,167,188,170,190,182,236,140, 60, 49, 21,112, 61, 40,142,247,198,255, 12, 2,255,243, 84,232, 62, -202,248, 23, 62, 82,238, 2, 62,104,113, 31, 51, 32, 30, 2,255,128, 51,178,190,202,248, 23, 62, 82,238, 2, 62,152,142, 31, 51, - 32, 30, 2,255,112,224,196, 62,190, 24, 50, 62, 2,220, 17, 62,216, 64,225,106,121, 27, 0,255,253,190,142,190,190, 24, 50, 62, - 2,220, 17, 62, 40,191,225,106,121, 27, 0,255,134,160,144, 62, 20, 20,106, 62, 99,183, 47, 62,137, 75, 82,101, 70, 20, 0,255, - 39,254, 52,190, 20, 20,106, 62, 99,183, 47, 62,119,180, 82,101, 70, 20, 0,255,195, 37, 79, 62, 67, 92,154, 62,236, 27, 70, 62, -241, 38, 19,119, 54, 26, 2,255,186,197,197,189, 67, 92,154, 62,236, 27, 70, 62, 15,217, 19,119, 54, 26, 2,255,229,197, 0, 62, -181, 7,145, 62, 48, 78, 81, 62, 21,175, 54, 96, 12, 24, 2,255,249, 23,164,188,181, 7,145, 62, 48, 78, 81, 62,235, 80, 54, 96, - 12, 24, 2,255,168,249,167, 61, 42,212, 53, 62,196,146, 77, 62,174,155,128, 76,151, 21, 0,255,144, 48,194, 60, 42,212, 53, 62, -196,146, 77, 62, 82,100,128, 76,151, 21, 0,255, 81,129, 4, 62,241,129, 16, 62, 8,197, 88, 62, 0, 25, 4,237, 22,124, 0,255, - 89,243,193,188,241,129, 16, 62, 8,197, 88, 62, 0,231, 4,237, 22,124, 0,255,105,176,227, 61, 17,132,184, 61,156, 9, 85, 62, -160,255,126,232,209,125, 0,255,214,169,178,187, 17,132,184, 61,156, 9, 85, 62, 96, 0,126,232,209,125, 0,255, 31,158, 43,189, -223, 37, 8,188, 88,215, 73, 62,104, 38,122,203, 56,110, 0,255,184, 69,105, 62, 92, 82, 55,189, 59, 46, 55, 62,106, 34,119,200, - 16,110, 0,255,163, 5,250,189, 92, 82, 55,189, 59, 46, 55, 62,150,221,119,200, 16,110, 0,255,134,160,144, 62,115,128,187,188, -139, 64, 40, 62,161, 55, 60,207,115,104, 0,255, 39,254, 52,190,115,128,187,188,139, 64, 40, 62, 95,200, 60,207,115,104, 0,255, -157, 89,176, 62,205, 26, 17, 61, 71, 14, 29, 62,181, 58,123,226,214,109, 0,255, 84,112,116,190,205, 26, 17, 61, 71, 14, 29, 62, - 75,197,123,226,214,109, 0,255, 9, 21,180, 62, 57, 13,177, 61, 71, 14, 29, 62,157, 49, 61,230, 36,115, 0,255, 45,231,123,190, - 57, 13,177, 61, 71, 14, 29, 62, 99,206, 61,230, 36,115, 0,255,123,192,170, 62,170,177,251, 61, 31,133, 36, 62,206, 39,175,234, -196,119, 0,255, 16, 62,105,190,170,177,251, 61, 31,133, 36, 62, 50,216,175,234,196,119, 0,255,214,178,129, 62, 54,180, 27, 62, - 20,165, 62, 62, 62, 24, 85,255,173,125, 0,255,198, 34, 23,190, 54,180, 27, 62, 20,165, 62, 62,194,231, 85,255,173,125, 0,255, -246,142, 45, 62,230,161, 42, 62, 48, 78, 81, 62,251, 31, 40,247,158,123, 0,255, 32,152,130,189,230,161, 42, 62, 48, 78, 81, 62, - 5,224, 40,247,158,123, 0,255,203,133, 88, 61,104,133,209,190,236, 27, 70, 62, 0, 0,148,210,170,119, 0,255,185,194,212, 61, - 36, 83,198,190,236, 27, 70, 62, 39, 19, 65,222,248,121, 0,255,191,196,240, 58, 36, 83,198,190,236, 27, 70, 62,217,236, 65,222, -248,121, 0,255,145, 57,220, 61,207, 80,226,190,167,233, 58, 62,134, 2,132,217, 12,122, 0,255, 77,241,236,186,207, 80,226,190, -167,233, 58, 62,122,253,132,217, 12,122, 0,255,168,249,167, 61, 19,131,237,190,207,114, 51, 62, 13,252,169,214, 18,121, 0,255, -144, 48,194, 60, 19,131,237,190,207,114, 51, 62,243, 3,169,214, 18,121, 0,255,203,133, 88, 61,200, 96,239,190, 99,183, 47, 62, - 0, 0,150,219,180,122, 0,255,203,133, 88, 61,254,152, 18,190,196,146, 77, 62, 0, 0, 46, 97, 76, 83, 0,255,203,133, 88, 61, - 18,242,240,189, 88,215, 73, 62, 0, 0,197,104,134, 73, 0,255,225, 75,205, 61,235,104,248,189, 88,215, 73, 62, 52, 36, 2, 53, -187,110, 0,255,179,158,179, 59,235,104,248,189, 88,215, 73, 62,204,219, 2, 53,187,110, 0,255,105,176,227, 61,174,134, 33,190, -196,146, 77, 62,187, 95, 14,212,182, 72, 0,255,214,169,178,187,174,134, 33,190,196,146, 77, 62, 69,160, 14,212,182, 72, 0,255, - 48, 94,190, 61, 15, 98, 63,190, 88,215, 73, 62,117, 64,117,207, 90, 99, 0,255,220, 60, 81, 60, 15, 98, 63,190, 88,215, 73, 62, -139,191,117,207, 90, 99, 0,255,252,119,116, 62,239, 95,151,189,139, 64, 40, 62,103, 49,157,196, 13,102, 0,255, 22, 53, 8,190, -239, 95,151,189,139, 64, 40, 62,153,206,157,196, 13,102, 0,255,231,123,174, 62,211, 91,217,188, 2,220, 17, 62,142, 59,107,204, -223,100, 2,255,232,180,112,190,211, 91,217,188, 2,220, 17, 62,114,196,107,204,223,100, 2,255,220,155,200, 62, 45,246, 46, 61, -190,169, 6, 62,102, 66, 11,217, 65,102, 0,255,105,122,146,190, 45,246, 46, 61,190,169, 6, 62,154,189, 11,217, 65,102, 0,255, - 72, 87,204, 62,170,177,251, 61,179,201, 32, 62, 87, 54,142,228,151,112, 0,255,213, 53,150,190,170,177,251, 61,179,201, 32, 62, -169,201,142,228,151,112, 0,255, 78, 71,191, 62,241,129, 16, 62,128, 96, 66, 62, 82, 42, 97,247,125,120, 2,255,219, 37,137,190, -241,129, 16, 62,128, 96, 66, 62,174,213, 97,247,125,120, 2,255,140,144,131, 62, 31,244, 79, 62, 77,247, 99, 62,192, 41,216,254, -253,120, 0,255, 50,222, 26,190, 31,244, 79, 62, 77,247, 99, 62, 64,214,216,254,253,120, 0,255, 87,106, 75, 62, 48,189,124, 62, -105,160,118, 62,217, 28, 53, 7,126,124, 0,255,225, 78,190,189, 48,189,124, 62,105,160,118, 62, 39,227, 53, 7,126,124, 0,255, -109, 42, 23, 62,236,138,113, 62, 65, 23,126, 62,125,255, 44, 5,227,127, 0,255, 31,158, 43,189,236,138,113, 62, 65, 23,126, 62, -131, 0, 44, 5,227,127, 0,255,225, 75,205, 61,202,248, 23, 62,213, 91,122, 62,130,238, 89, 2,197,126, 0,255,179,158,179, 59, -202,248, 23, 62,213, 91,122, 62,126, 17, 89, 2,197,126, 0,255,105,176,227, 61,217,159,203,189, 37,110,107, 62,115, 23, 27,230, - 34,123, 0,255,214,169,178,187,217,159,203,189, 37,110,107, 62,141,232, 27,230, 34,123, 0,255,218,229, 26, 62, 64, 3,133,190, -167,233, 58, 62,212, 74, 28, 14,225,102, 2,255,207,139, 58,189, 64, 3,133,190,167,233, 58, 62, 44,181, 28, 14,225,102, 2,255, -246,142, 45, 62,184,151,194,190, 99,183, 47, 62,235, 72, 17,252, 31,105, 2,255, 32,152,130,189,184,151,194,190, 99,183, 47, 62, - 21,183, 17,252, 31,105, 2,255,206, 5, 53, 62, 99,149,222,190, 31,133, 36, 62,179, 66,197,225,249,104, 2,255,208,133,145,189, - 99,149,222,190, 31,133, 36, 62, 77,189,197,225,249,104, 2,255, 30, 24, 38, 62,234,249,244,190,111,151, 21, 62, 62, 44, 4,183, - 98, 95, 2,255,224, 84,103,189,234,249,244,190,111,151, 21, 62,194,211, 4,183, 98, 95, 2,255, 81,129, 4, 62, 86,181,248,190, -111,151, 21, 62,155, 19, 52,158, 54, 80, 2,255, 89,243,193,188, 86,181,248,190,111,151, 21, 62,101,236, 52,158, 54, 80, 2,255, -203,133, 88, 61,195,112,252,190,219, 82, 25, 62, 0, 0,201,154, 88, 78, 2,255,203,133, 88, 61, 52, 55,247,188,128, 96, 66, 62, - 0, 0, 2,252,239,127, 0,255,203,133, 88, 61,222,227, 61, 61,156, 9, 85, 62, 0, 0,112,227,196,124, 0,255, 47,225, 82, 62, - 82, 93, 46, 62, 88,215, 73, 62, 58, 21,234,254, 56,126, 0,255,146, 60,205,189, 82, 93, 46, 62, 88,215, 73, 62,198,234,234,254, - 56,126, 0,255, 81,129, 4, 62,170, 34, 94, 60,196,146, 77, 62, 37,214,110,232,163,118, 0,255, 89,243,193,188,170, 34, 94, 60, -196,146, 77, 62,219, 41,110,232,163,118, 0,255, 65, 39,235, 61,222,227, 61, 61, 48, 78, 81, 62,150,232,127,230, 57,123, 0,255, -173, 11, 21,188,222,227, 61, 61, 48, 78, 81, 62,106, 23,127,230, 57,123, 0,255,145, 57,220, 61, 76,220,190,190,236, 27, 70, 62, -117, 20,197,248, 36,126, 0,255, 77,241,236,186, 76,220,190,190,236, 27, 70, 62,139,235,197,248, 36,126, 0,255, 88,231,182, 61, - 64, 3,133,190,196,146, 77, 62, 43, 19,128, 0,141,126, 2,255,207,121,134, 60, 64, 3,133,190,196,146, 77, 62,213,236,128, 0, -141,126, 2,255,203,133, 88, 61, 64, 3,133,190,196,146, 77, 62, 0, 0,122,255,254,127, 0,255,203,133, 88, 61, 43, 11, 82,190, - 88,215, 73, 62, 0, 0,121,184, 36,106, 0,255, 8,213,197, 61, 55,235, 55,190,116,128, 92, 62,167, 66,139,160, 45, 53, 2,255, - 27,134, 21, 60, 55,235, 55,190,116,128, 92, 62, 89,189,139,160, 45, 53, 2,255, 65, 39,235, 61,174,134, 33,190, 77,247, 99, 62, -133,118,215,224,239, 36, 2,255,173, 11, 21,188,174,134, 33,190, 77,247, 99, 62,123,137,215,224,239, 36, 2,255,185,194,212, 61, - 57,123,233,189,116,128, 92, 62,167, 81,141, 95, 49, 24, 2,255,191,196,240, 58, 57,123,233,189,116,128, 92, 62, 89,174,141, 95, - 49, 24, 2,255, 31,149,145, 61, 97, 4,226,189,116,128, 92, 62,189,200,160,108, 26, 39, 2,255, 89,225, 13, 61, 97, 4,226,189, -116,128, 92, 62, 67, 55,160,108, 26, 39, 2,255,203,133, 88, 61,106, 84, 22,190,253,228,114, 62, 0, 0, 42, 23,225,125, 0,255, -247, 11,153, 61,235,104,248,189, 37,110,107, 62,186,231, 89, 78, 66, 98, 2,255, 82,231,253, 60,235,104,248,189, 37,110,107, 62, - 70, 24, 89, 78, 66, 98, 2,255, 8,213,197, 61,195,223,255,189, 37,110,107, 62, 88, 43,134, 62,237,102, 2,255, 27,134, 21, 60, -195,223,255,189, 37,110,107, 62,168,212,134, 62,237,102, 2,255,185,194,212, 61,174,134, 33,190,253,228,114, 62,247, 46, 89,233, -228,116, 2,255,191,196,240, 58,174,134, 33,190,253,228,114, 62, 9,209, 89,233,228,116, 2,255, 88,231,182, 61,243,184, 44,190, -185,178,103, 62, 46, 31,198,181,128, 99, 2,255,207,121,134, 60,243,184, 44,190,185,178,103, 62,210,224,198,181,128, 99, 2,255, -203,133, 88, 61, 15, 98, 63,190,185,178,103, 62, 0, 0,185,191,175,110, 2,255, 98, 74, 49, 62, 83,148, 74,190,107,138,224, 61, - 23,120, 34, 41, 99, 16, 0,255,248, 14,138,189, 83,148, 74,190,107,138,224, 61,233,135, 34, 41, 99, 16, 0,255, 81,129, 4, 62, -134,253, 40,190,167,233, 58, 62,251, 80, 26,250,241, 98, 0,255, 89,243,193,188,134,253, 40,190,167,233, 58, 62, 5,175, 26,250, -241, 98, 0,255, 41,248, 11, 62, 83,148, 74,190,167,233, 58, 62,215, 83,153, 16, 71, 95, 0,255, 27,170,253,188, 83,148, 74,190, -167,233, 58, 62, 41,172,153, 16, 71, 95, 0,255, 30, 24, 38, 62,243,184, 44,190,107,138,224, 61, 24,122, 67, 35, 64, 15, 0,255, -224, 84,103,189,243,184, 44,190,107,138,224, 61,232,133, 67, 35, 64, 15, 0,255,203,133, 88, 61, 93,165,235,190, 99,183, 47, 62, - 0, 0,139, 86, 77, 94, 0,255,247, 11,153, 61,167,199,233,190, 99,183, 47, 62,144,206,200, 70,125, 94, 0,255, 82,231,253, 60, -167,199,233,190, 99,183, 47, 62,112, 49,200, 70,125, 94, 0,255, 8,213,197, 61, 99,149,222,190,167,233, 58, 62,253,164,109, 17, - 75, 88, 0,255, 27,134, 21, 60, 99,149,222,190,167,233, 58, 62, 3, 91,109, 17, 75, 88, 0,255, 8,213,197, 61, 70,236,203,190, -128, 96, 66, 62,141,225, 87,168, 39, 88, 0,255, 27,134, 21, 60, 70,236,203,190,128, 96, 66, 62,115, 30, 87,168, 39, 88, 0,255, -203,133, 88, 61,212, 64,213,190,179,201, 32, 62, 0, 0, 20,159,153, 83, 0,255, 8,213,197, 61,252,201,205,190, 31,133, 36, 62, - 5,230,250,177, 20, 98, 0,255, 27,134, 21, 60,252,201,205,190, 31,133, 36, 62,251, 25,250,177, 20, 98, 0,255, 8,213,197, 61, -173,183,220,190,219, 82, 25, 62, 18,152, 8, 24,188, 70, 0,255, 27,134, 21, 60,173,183,220,190,219, 82, 25, 62,238,103, 8, 24, -188, 70, 0,255,247, 11,153, 61, 59, 12,230,190,111,151, 21, 62, 26,222,242, 49,221,112, 0,255, 82,231,253, 60, 59, 12,230,190, -111,151, 21, 62,230, 33,242, 49,221,112, 0,255,203,133, 88, 61,241,233,231,190,111,151, 21, 62, 0, 0, 18, 60, 5,113, 0,255, -189, 60, 8, 62,142,209, 76, 61,116,128, 92, 62, 4, 30, 93,244,225,123, 0,255,186,206,223,188,142,209, 76, 61,116,128, 92, 62, -252,225, 93,244,225,123, 0,255,149,179, 15, 62, 22,200,170, 60, 8,197, 88, 62, 71, 9, 34,251,144,127, 0,255,190,194, 13,189, - 22,200,170, 60, 8,197, 88, 62,185,246, 34,251,144,127, 0,255,155,156, 86, 62,202,248, 23, 62, 48, 78, 81, 62, 81, 17, 74, 2, -204,126, 0,255,106,179,212,189,202,248, 23, 62, 48, 78, 81, 62,175,238, 74, 2,204,126, 0,255, 58,193, 56, 62, 94, 61, 20, 62, - 8,197, 88, 62,218, 25,177,253, 86,125, 2,255,168,252,152,189, 94, 61, 20, 62, 8,197, 88, 62, 38,230,177,253, 86,125, 2,255, - 64,170,127, 62, 25, 11, 9, 62, 8,197, 88, 62,182, 21,210,240, 57,125, 2,255, 90,103, 19,190, 25, 11, 9, 62, 8,197, 88, 62, - 74,234,210,240, 57,125, 2,255,237,107,161, 62, 34, 77,229, 61,207,114, 51, 62,143, 28,249,237,117,123, 0,255,244,148, 86,190, - 34, 77,229, 61,207,114, 51, 62,113,227,249,237,117,123, 0,255, 15, 5,167, 62, 97,150,169, 61, 99,183, 47, 62,209, 15,217,246, -175,126, 0,255, 56,199, 97,190, 97,150,169, 61, 99,183, 47, 62, 47,240,217,246,175,126, 0,255, 89, 39,165, 62,125, 8, 32, 61, -247,251, 43, 62,177, 24,190,253,146,125, 0,255,204, 11, 94,190,125, 8, 32, 61,247,251, 43, 62, 79,231,190,253,146,125, 0,255, - 26,229,140, 62, 60,222,152,187, 20,165, 62, 62, 20, 33, 75, 2,160,123, 0,255, 79,135, 45,190, 60,222,152,187, 20,165, 62, 62, -236,222, 75, 2,160,123, 0,255,184, 69,105, 62,115,128,187,188, 88,215, 73, 62, 85, 26,238,248, 14,125, 0,255,163, 5,250,189, -115,128,187,188, 88,215, 73, 62,171,229,238,248, 14,125, 0,255,178, 92, 34, 62,226,194,133,186,116,128, 92, 62, 8, 7,142,250, -175,127, 0,255, 48,103, 88,189,226,194,133,186,116,128, 92, 62,248,248,142,250,175,127, 0,255, 41,248, 11, 62, 57, 13,177, 61, -116,128, 92, 62,169, 34, 2,240, 43,122, 0,255, 27,170,253,188, 57, 13,177, 61,116,128, 92, 62, 87,221, 2,240, 43,122, 0,255, -218,229, 26, 62,170,177,251, 61,116,128, 92, 62,126, 27,108,239,231,123, 0,255,207,139, 58,189,170,177,251, 61,116,128, 92, 62, -130,228,108,239,231,123, 0,255, 30, 24, 38, 62,250,195,236, 61, 48, 78, 81, 62,226, 64, 13,207,224, 98, 0,255,224, 84,103,189, -250,195,236, 61, 48, 78, 81, 62, 30,191, 13,207,224, 98, 0,255, 1,111, 19, 62, 57, 13,177, 61, 48, 78, 81, 62, 29, 96,169,229, - 81, 80, 0,255,110,176, 28,189, 57, 13,177, 61, 48, 78, 81, 62,227,159,169,229, 81, 80, 0,255,138,211, 41, 62, 77,106,205, 59, - 48, 78, 81, 62, 36, 55,122, 71,188, 90, 0,255,143, 66,118,189, 77,106,205, 59, 48, 78, 81, 62,220,200,122, 71,188, 90, 0,255, -184, 69,105, 62,161,220, 67,188,128, 96, 66, 62, 76, 21, 90, 78,241, 98, 0,255,163, 5,250,189,161,220, 67,188,128, 96, 66, 62, -180,234, 90, 78,241, 98, 0,255,174, 41,137, 62,149,249, 43, 59, 59, 46, 55, 62, 85,245, 69, 69, 25,107, 0,255,118, 16, 38,190, -149,249, 43, 59, 59, 46, 55, 62,171, 10, 69, 69, 25,107, 0,255,129,176,157, 62,222,227, 61, 61,139, 64, 40, 62,232,223,211, 29, - 67,120, 0,255, 28, 30, 79,190,222,227, 61, 61,139, 64, 40, 62, 24, 32,211, 29, 67,120, 0,255, 55,142,159, 62,137, 31,162, 61, -139, 64, 40, 62,148,210,123,238, 95,118, 0,255,136,217, 82,190,137, 31,162, 61,139, 64, 40, 62,108, 45,123,238, 95,118, 0,255, - 21,245,153, 62,114, 95,214, 61,247,251, 43, 62,216,229,108,179, 43, 99, 0,255, 67,167, 71,190,114, 95,214, 61,247,251, 43, 62, - 40, 26,108,179, 43, 99, 0,255,212,238,123, 62,173, 79, 5, 62,196,146, 77, 62,202,237,179,158, 35, 81, 2,255,238,171, 15,190, -173, 79, 5, 62,196,146, 77, 62, 54, 18,179,158, 35, 81, 2,255,166,124, 60, 62, 25, 11, 9, 62,156, 9, 85, 62, 24, 39,118,212, -214,113, 2,255,129,115,160,189, 25, 11, 9, 62,156, 9, 85, 62,232,216,118,212,214,113, 2,255,155,156, 86, 62,133,198, 12, 62, -196,146, 77, 62,213, 1,189,193,208,111, 0,255,106,179,212,189,133,198, 12, 62,196,146, 77, 62, 43,254,189,193,208,111, 0,255, -109, 42, 23, 62,216,126,230, 60,196,146, 77, 62,226, 84,192, 42,187, 85, 0,255, 31,158, 43,189,216,126,230, 60,196,146, 77, 62, - 30,171,192, 42,187, 85, 0,255, 1,111, 19, 62, 63,191, 91, 61,196,146, 77, 62,235,102,196, 2, 11, 76, 0,255,110,176, 28,189, - 63,191, 91, 61,196,146, 77, 62, 21,153,196, 2, 11, 76, 0,255,185,194,212, 61,122,230, 38, 62, 42,101, 10, 62,183,182,118,104, - 5,246, 0,255,191,196,240, 58,122,230, 38, 62, 42,101, 10, 62, 73, 73,118,104, 5,246, 0,255, 1,111, 19, 62,186,247,131, 62, -150, 32, 14, 62,208,192,221, 66, 3,167, 2,255,110,176, 28,189,186,247,131, 62,150, 32, 14, 62, 48, 63,221, 66, 3,167, 2,255, -155,156, 86, 62,220,144,137, 62, 82,238, 2, 62, 59, 9, 89, 90,208,165, 2,255,106,179,212,189,220,144,137, 62, 82,238, 2, 62, -197,246, 89, 90,208,165, 2,255,208,194,142, 62,139,175, 83, 62,107,138,224, 61,165, 37,104,114,176,212, 0,255,187, 66, 49,190, -139,175, 83, 62,107,138,224, 61, 91,218,104,114,176,212, 0,255,152,105,189, 62, 14, 43, 35, 62,170,211,164, 61, 67, 45, 40,116, - 1,227, 0,255, 37, 72,135,190, 14, 43, 35, 62,170,211,164, 61,189,210, 40,116, 1,227, 0,255, 66,103,217, 62,133,198, 12, 62, - 73,248,134, 61,100, 94,237, 79, 18,223, 0,255,207, 69,163,190,133,198, 12, 62, 73,248,134, 61,156,161,237, 79, 18,223, 0,255, - 32,206,211, 62,119,163,200, 60,252,115,211, 60,247,120,255,221,165,231, 0,255,173,172,157,190,119,163,200, 60,252,115,211, 60, - 9,135,255,221,165,231, 0,255,123,192,170, 62,188, 45, 85,189,112, 94, 52, 61,155, 76,106,154, 19,242, 0,255, 16, 62,105,190, -188, 45, 85,189,112, 94, 52, 61,101,179,106,154, 19,242, 0,255,140,144,131, 62, 0, 41,196,189, 33,111,142, 61,204, 56, 26,142, -138, 13, 0,255, 50,222, 26,190, 0, 41,196,189, 33,111,142, 61, 52,199, 26,142,138, 13, 0,255,203,133, 88, 61, 16,243,187, 62, - 89,242,105,188, 0, 0,155,106,214, 70, 2,255,203,133, 88, 61,226,121,208, 62,254, 7, 62,190, 0, 0,243,127, 82, 3, 2,255, -203,133, 88, 61,254,152, 18,190, 11,214,236,190, 0, 0, 54,164,204,166, 3,255,203,133, 88, 61,173,190,136,190,139,142,124,189, - 0, 0,179,129, 65,235, 0,255,203,133, 88, 61,205,243, 1,191, 73,248,134, 61, 0, 0,182,151,204,181, 2,255,203,133, 88, 61, -247,217,218,190,241, 12, 56, 60, 0, 0,231,221,162,132, 2,255,203,133, 88, 61,161,222,162,190,147, 21,157, 57, 0, 0, 16,212, -201,135, 0,255,203,133, 88, 61,207, 87,142,190,141,212,146,188, 0, 0,245,147, 97,187, 0,255, 61,119,230, 62,239,172,106, 61, -161, 43,253,189,164,125,181,235,156, 13, 0,255,202, 85,176,190,239,172,106, 61,161, 43,253,189, 92,130,181,235,156, 13, 0,255, -243, 84,232, 62,194,113,199, 61, 78, 26, 47,190,174,126, 23,238, 66,252, 0,255,128, 51,178,190,194,113,199, 61, 78, 26, 47,190, - 82,129, 23,238, 66,252, 0,255, 32,206,211, 62,216, 49,147, 61,181,218,180,190, 70, 81,148, 13, 15,158, 1,255,173,172,157,190, -216, 49,147, 61,181,218,180,190,186,174,148, 13, 15,158, 1,255,174, 41,137, 62, 54,180, 27, 62,226, 76,244,190,123, 58,228, 21, - 70,144, 3,255,118, 16, 38,190, 54,180, 27, 62,226, 76,244,190,133,197,228, 21, 70,144, 3,255,146,121,202, 62,239, 95,151,189, -240, 61,238,189, 76, 89,139,164,161, 6, 2,255, 31, 88,148,190,239, 95,151,189,240, 61,238,189,180,166,139,164,161, 6, 2,255, -197,226,168, 62, 97, 4,226,189,163, 21,103,190, 93, 38, 34,134,182, 7, 0,255,164,130,101,190, 97, 4,226,189,163, 21,103,190, -163,217, 34,134,182, 7, 0,255, 9, 21,180, 62,109, 27,100,189,255,252,178,190,106, 43,219,170,222,170, 1,255, 45,231,123,190, -109, 27,100,189,255,252,178,190,150,212,219,170,222,170, 1,255,155,156, 86, 62,211, 91,217,188, 85,248,234,190,168, 55,109,213, -229,148, 2,255,106,179,212,189,211, 91,217,188, 85,248,234,190, 88,200,109,213,229,148, 2,255, 30, 24, 38, 62,112, 61, 93,190, -191,112, 37, 61,197,120, 36,255,158,213, 0,255,224, 84,103,189,112, 61, 93,190,191,112, 37, 61, 59,135, 36,255,158,213, 0,255, - 41,248, 11, 62,209, 24,123,190,176,102,236,188,188, 84, 20,181, 24,196, 0,255, 27,170,253,188,209, 24,123,190,176,102,236,188, - 68,171, 20,181, 24,196, 0,255, 19, 56, 64, 62,110,117,196,190, 92, 79,241, 60,131, 79, 86,254,183,155, 2,255, 89,234,167,189, -110,117,196,190, 92, 79,241, 60,125,176, 86,254,183,155, 2,255,246,142, 45, 62, 59, 19,146,190, 95,149, 7, 61, 5, 99, 8, 1, -231,174, 0,255, 32,152,130,189, 59, 19,146,190, 95,149, 7, 61,251,156, 8, 1,231,174, 0,255, 47,225, 82, 62,234,249,244,190, - 15,131, 22, 61, 65, 62,227,185,224,168, 2,255,146, 60,205,189,234,249,244,190, 15,131, 22, 61,191,193,227,185,224,168, 2,255, - 25,158,242, 61,178,167,207,190,155,152,181, 60,133, 16,208,232, 55,131, 0,255,110,194, 80,188,178,167,207,190,155,152,181, 60, -123,239,208,232, 55,131, 0,255,105,176,227, 61,201,103,155,190, 58,189,151, 60, 7, 48,163,224,149,141, 0,255,214,169,178,187, -201,103,155,190, 58,189,151, 60,249,207,163,224,149,141, 0,255, 81,129, 4, 62,195,112,252,190,129, 39, 97, 61, 68, 12,218,158, -147,173, 0,255, 89,243,193,188,195,112,252,190,129, 39, 97, 61,188,243,218,158,147,173, 0,255, 70,161, 30, 62,163,166, 59,190, -208, 57, 82, 61,195,124,106,227,203,255, 0,255,127,121, 73,189,163,166, 59,190,208, 57, 82, 61, 61,131,106,227,203,255, 0,255, -218,229, 26, 62,174,134, 33,190, 33,111,142, 61, 29,120,105,231,193, 36, 0,255,207,139, 58,189,174,134, 33,190, 33,111,142, 61, -227,135,105,231,193, 36, 0,255,109, 42, 23, 62,186,102, 7,190,130, 74,172, 61,160,101,164,182,240, 25, 0,255, 31,158, 43,189, -186,102, 7,190,130, 74,172, 61, 96,154,164,182,240, 25, 0,255,218,229, 26, 62,140,230,111,190,206,171,148,189,120, 84,221,159, -198,253, 0,255,207,139, 58,189,140,230,111,190,206,171,148,189,136,171,221,159,198,253, 0,255,127,243, 67, 62, 83,148, 74,190, - 16,205,139,190,255, 67, 42,151, 73,228, 2,255, 49, 97,175,189, 83,148, 74,190, 16,205,139,190, 1,188, 42,151, 73,228, 2,255, - 7, 88, 90, 62,235,104,248,189,244, 28,205,190,201, 63, 25,176, 0,179, 3,255, 66, 42,220,189,235,104,248,189,244, 28,205,190, - 55,192, 25,176, 0,179, 3,255,248, 75,135, 62, 55,124,180, 62,187,202,167,190, 34, 56,160, 95, 17,192, 2,255, 10, 85, 34,190, - 55,124,180, 62,187,202,167,190,222,199,160, 95, 17,192, 2,255,248, 75,135, 62,232,105,195, 62,146, 76, 58,190, 54, 55,120,115, -239, 0, 2,255, 10, 85, 34,190,232,105,195, 62,146, 76, 58,190,202,200,120,115,239, 0, 2,255,248, 75,135, 62,203,192,176, 62, -105,252, 34,189,239, 63,164, 92,238, 60, 2,255, 10, 85, 34,190,203,192,176, 62,105,252, 34,189, 17,192,164, 92,238, 60, 2,255, -174, 41,137, 62,219,193, 68, 62,208, 57, 82, 61,123, 49,255,102,170, 57, 0,255,118, 16, 38,190,219,193, 68, 62,208, 57, 82, 61, -133,206,255,102,170, 57, 0,255,220,155,200, 62,133,198, 12, 62, 95,172,248, 59,142, 98,198, 73, 6, 35, 0,255,105,122,146,190, -133,198, 12, 62, 95,172,248, 59,114,157,198, 73, 6, 35, 0,255, 83, 55,178, 62, 14, 43, 35, 62,141,212,146,188,129, 61,254,106, -241, 33, 0,255,193, 43,120,190, 14, 43, 35, 62,141,212,146,188,127,194,254,106,241, 33, 0,255, 9, 21,180, 62, 72, 76,141, 62, -161, 43,253,189,234, 76,151, 87,221, 52, 0,255, 45,231,123,190, 72, 76,141, 62,161, 43,253,189, 22,179,151, 87,221, 52, 0,255, - 66,103,217, 62,247,106, 87, 62, 7,254,185,189,187,101, 28, 66,199, 40, 2,255,207, 69,163,190,247,106, 87, 62, 7,254,185,189, - 69,154, 28, 66,199, 40, 2,255, 66,103,217, 62,236,138,113, 62, 26,177, 80,190,183,113, 68, 58,119,248, 2,255,207, 69,163,190, -236,138,113, 62, 26,177, 80,190, 73,142, 68, 58,119,248, 2,255, 9, 21,180, 62,141,126,152, 62, 83, 3,118,190,235, 86,238, 93, -205,253, 0,255, 45,231,123,190,141,126,152, 62, 83, 3,118,190, 21,169,238, 93,205,253, 0,255, 9, 21,180, 62, 38,179,135, 62, -107,184,182,190,232, 85,154, 70,157,192, 2,255, 45,231,123,190, 38,179,135, 62,107,184,182,190, 24,170,154, 70,157,192, 2,255, - 66,103,217, 62,179, 56, 76, 62,153, 49,162,190,166,110,177, 42,222,207, 2,255,207, 69,163,190,179, 56, 76, 62,153, 49,162,190, - 90,145,177, 42,222,207, 2,255,231,123,174, 62,154,232,206, 61, 56, 79,216,190, 58, 75, 57, 1,116,152, 3,255,232,180,112,190, -154,232,206, 61, 56, 79,216,190,198,180, 57, 1,116,152, 3,255,208,194,142, 62,171,100, 40,189,170,250,206,190, 73, 70,147,187, -200,173, 1,255,187, 66, 49,190,171,100, 40,189,170,250,206,190,183,185,147,187,200,173, 0,255,100, 0,223, 62,154,232,206, 61, -191,190,121,190,194,114, 80, 41,207, 38, 0,255,241,222,168,190,154,232,206, 61,191,190,121,190, 62,141, 80, 41,207, 38, 0,255, -104, 51,120, 62,186,102, 7,190,127,153,163,189,232, 74,153,154, 28, 22, 0,255,130,240, 11,190,186,102, 7,190,127,153,163,189, - 24,181,153,154, 28, 22, 0,255,214,178,129, 62,254,152, 18,190, 44,122,125,190, 89, 71,115,151, 1,237, 0,255,198, 34, 23,190, -254,152, 18,190, 44,122,125,190,167,184,115,151, 1,237, 0,255,202,203,239, 62,133,198, 12, 62, 56, 86,132,190, 72,220,207, 93, -106, 79, 2,255, 88,170,185,190,133,198, 12, 62, 56, 86,132,190,184, 35,207, 93,106, 79, 2,255, 32,206,211, 62, 18,242,240,189, -135,108, 84,190, 30, 15, 34,150, 84, 70, 2,255,173,172,157,190, 18,242,240,189,135,108, 84,190,226,240, 34,150, 84, 70, 2,255, - 38,160, 9, 63,217,159,203,189,192,186,154,190,164, 67,138,166,172, 61, 0,255,219, 30,221,190,217,159,203,189,192,186,154,190, - 92,188,138,166,172, 61, 0,255,172,140, 38, 63,211, 91,217,188,255,252,178,190,179, 83,223,206,114, 83, 0,255,244,123, 11,191, -211, 91,217,188,255,252,178,190, 77,172,223,206,114, 83, 0,255, 95,242, 46, 63,194,113,199, 61, 73, 31,177,190, 54, 92,232, 12, -210, 87, 2,255,167,225, 19,191,194,113,199, 61, 73, 31,177,190,202,163,232, 12,210, 87, 2,255,138,243, 32, 63, 3, 75, 61, 62, - 73, 31,177,190,247, 62,221, 83, 97, 73, 0,255,209,226, 5,191, 3, 75, 61, 62, 73, 31,177,190, 9,193,221, 83, 97, 73, 0,255, -112,194, 7, 63, 82, 93, 46, 62, 84,255,150,190,181, 5, 80,111,236, 62, 0,255,111, 99,217,190, 82, 93, 46, 62, 84,255,150,190, - 75,250, 80,111,236, 62, 0,255,149,211, 6, 63,241,129, 16, 62, 50,102,145,190,236, 69,117,239,236,105, 0,255,185,133,215,190, -241,129, 16, 62, 50,102,145,190, 20,186,117,239,236,105, 0,255,104, 90, 27, 63, 54,180, 27, 62,113,168,169,190, 34, 24,205,231, - 89,123, 0,255,175, 73, 0,191, 54,180, 27, 62,113,168,169,190,222,231,205,231, 89,123, 0,255,246,174, 36, 63, 97,150,169, 61, -221, 99,173,190, 69,223, 16,252,173,123, 0,255, 62,158, 9,191, 97,150,169, 61,221, 99,173,190,187, 32, 16,252,173,123, 0,255, -249, 38, 30, 63, 98,147,127,188,221, 99,173,190,171,239, 0, 39,207,120, 0,255, 64, 22, 3,191, 98,147,127,188,221, 99,173,190, - 85, 16, 0, 39,207,120, 0,255, 75,177, 8, 63, 23,233,143,189,158, 33,149,190, 9, 51, 56, 45, 82,108, 0,255, 37, 65,219,190, - 23,233,143,189,158, 33,149,190,247,204, 56, 45, 82,108, 0,255, 26,222,224, 62,120,196,173,189,243, 39, 88,190,147, 38,224, 62, -153,104, 2,255,167,188,170,190,120,196,173,189,243, 39, 88,190,109,217,224, 62,153,104, 2,255,162, 66,247, 62,250,195,236, 61, -204,154,128,190,218, 62,152,243,206,110, 2,255, 48, 33,193,190,250,195,236, 61,204,154,128,190, 38,193,152,243,206,110, 2,255, -196,219,252, 62, 17,132,184, 61, 50,102,145,190, 10, 87, 73,182, 19, 58, 0,255, 82,186,198,190, 17,132,184, 61, 50,102,145,190, -246,168, 73,182, 19, 58, 0,255, 21,238,237, 62,103,251,128,189, 44,122,125,190,232, 15,106,121, 64, 37, 0,255,162,204,183,190, -103,251,128,189, 44,122,125,190, 24,240,106,121, 64, 37, 0,255, 38,160, 9, 63,188, 45, 85,189, 79, 15,164,190,157,239, 89,122, -212, 33, 0,255,219, 30,221,190,188, 45, 85,189, 79, 15,164,190, 99, 16, 89,122,212, 33, 0,255,104, 90, 27, 63,223, 37, 8,188, -107,184,182,190, 8,158,202, 81,185, 9, 0,255,175, 73, 0,191,223, 37, 8,188,107,184,182,190,248, 97,202, 81,185, 9, 0,255, -138,243, 32, 63, 40, 68,132, 61,107,184,182,190, 60,131,145,239, 95, 23, 0,255,209,226, 5,191, 40, 68,132, 61,107,184,182,190, -196,124,145,239, 95, 23, 0,255,178,124, 25, 63,250,195,236, 61,181,218,180,190, 27,228, 22,153,206, 70, 0,255,242,215,252,190, -250,195,236, 61,181,218,180,190,229, 27, 22,153,206, 70, 0,255,112,194, 7, 63, 74,214,221, 61,153, 49,162,190, 65, 68,253,168, -113, 64, 0,255,111, 99,217,190, 74,214,221, 61,153, 49,162,190,191,187,253,168,113, 64, 0,255,135,153,228, 62, 97,150,169, 61, - 44,122,125,190,113, 86,190,222, 87, 88, 0,255, 20,120,174,190, 97,150,169, 61, 44,122,125,190,143,169,190,222, 87, 88, 0,255, -209,187,226, 62,216,126,230, 60,198,170,141,190,196, 95,107,182,100, 42, 0,255, 93,154,172,190,216,126,230, 60,198,170,141,190, - 60,160,107,182,100, 42, 0,255,180, 18,208, 62,223, 37, 8,188,198,170,141,190, 42,111, 21, 14,220, 61, 0,255, 65,241,153,190, -223, 37, 8,188,198,170,141,190,214,144, 21, 14,220, 61, 0,255,100, 0,223, 62,161,220, 67,188,198,170,141,190, 3, 79, 4, 91, - 19, 43, 2,255,241,222,168,190,161,220, 67,188,198,170,141,190,253,176, 4, 91, 19, 43, 2,255,135,153,228, 62, 92, 82, 55,189, -198,170,141,190,207,107,198,254,250, 68, 2,255, 20,120,174,190, 92, 82, 55,189,198,170,141,190, 49,148,198,254,250, 68, 2,255, -174, 34,221, 62, 29, 9,115,189,198,170,141,190, 7, 82,225, 64,200, 73, 0,255, 59, 1,167,190, 29, 9,115,189,198,170,141,190, -249,173,225, 64,200, 73, 0,255,220,155,200, 62,188, 45, 85,189,146, 76, 58,190, 38,117, 66,207, 47,239, 0,255,105,122,146,190, -188, 45, 85,189,146, 76, 58,190,218,138, 66,207, 47,239, 0,255, 38,190,198, 62,103,251,128,189, 15,209,106,190,150, 97,139, 18, -184, 80, 0,255,179,156,144,190,103,251,128,189, 15,209,106,190,106,158,139, 18,184, 80, 0,255, 38,190,198, 62, 74,137, 10,189, -231, 71,114,190, 17,116, 66,240,154, 51, 0,255,179,156,144,190, 74,137, 10,189,231, 71,114,190,239,139, 66,240,154, 51, 0,255, - 66,103,217, 62, 45,246, 46, 61, 44,122,125,190,112,113,245,204, 39, 30, 0,255,207, 69,163,190, 45,246, 46, 61, 44,122,125,190, -144,142,245,204, 39, 30, 0,255,202,203,239, 62,159,154,121, 61, 16,205,139,190,105, 90, 61,185,146, 56, 0,255, 88,170,185,190, -159,154,121, 61, 16,205,139,190,151,165, 61,185,146, 56, 0,255,202,203,239, 62,239,172,106, 61, 10,221,152,190,191, 82,102,204, -230, 82, 0,255, 88,170,185,190,239,172,106, 61, 10,221,152,190, 65,173,102,204,230, 82, 0,255,174, 34,221, 62, 29, 9,115,189, - 10,221,152,190,246, 29, 64, 98, 94, 76, 0,255, 59, 1,167,190, 29, 9,115,189, 10,221,152,190, 10,226, 64, 98, 94, 76, 0,255, - 61,119,230, 62, 92, 82, 55,189, 10,221,152,190,150, 77,111, 17, 75,100, 0,255,202, 85,176,190, 92, 82, 55,189, 10,221,152,190, -106,178,111, 17, 75,100, 0,255, 26,222,224, 62, 98,147,127,188, 10,221,152,190,239, 60,190, 60,195, 94, 0,255,167,188,170,190, - 98,147,127,188, 10,221,152,190, 17,195,190, 60,195, 94, 0,255,106,240,209, 62,223, 37, 8,188, 10,221,152,190,199, 83,178, 23, -209, 93, 0,255,247,206,155,190,223, 37, 8,188, 10,221,152,190, 57,172,178, 23,209, 93, 0,255,135,153,228, 62,216,126,230, 60, - 10,221,152,190, 98, 73, 1,200,170, 88, 0,255, 20,120,174,190,216,126,230, 60, 10,221,152,190,158,182, 1,200,170, 88, 0,255, - 38,160, 9, 63,154,232,206, 61,147, 65,175,190, 23, 68,166,223,112,103, 0,255,219, 30,221,190,154,232,206, 61,147, 65,175,190, -233,187,166,223,112,103, 0,255,104, 90, 27, 63, 74,214,221, 61,249, 12,192,190,165, 18,156,216, 89,120, 0,255,175, 73, 0,191, - 74,214,221, 61,249, 12,192,190, 91,237,156,216, 89,120, 0,255, 27,192, 35, 63,159,154,121, 61,175,234,193,190, 25,185, 29,231, -157,103, 0,255, 98,175, 8,191,159,154,121, 61,175,234,193,190,231, 70, 29,231,157,103, 0,255,249, 38, 30, 63,161,220, 67,188, -249, 12,192,190, 43,209, 0, 64,119,100, 0,255, 64, 22, 3,191,161,220, 67,188,249, 12,192,190,213, 46, 0, 64,119,100, 0,255, - 1,143, 10, 63,188, 45, 85,189, 73, 31,177,190, 52, 26,240, 92, 3, 84, 0,255,145,252,222,190,188, 45, 85,189, 73, 31,177,190, -204,229,240, 92, 3, 84, 0,255, 21,238,237, 62, 29, 9,115,189, 16,205,139,190, 58, 8,116,111,101, 62, 0,255,162,204,183,190, - 29, 9,115,189, 16,205,139,190,198,247,116,111,101, 62, 0,255,122,185,254, 62, 97,150,169, 61, 45,118,158,190,198, 80,102,213, -175, 89, 0,255, 8,152,200,190, 97,150,169, 61, 45,118,158,190, 58,175,102,213,175, 89, 0,255,202,203,239, 62,226,194,133,186, -192,186,154,190,136, 25,130, 0,108,125, 0,255, 88,170,185,190,226,194,133,186,192,186,154,190,120,230,130, 0,108,125, 0,255, - 14,254,250, 62,115,128,187,188,119,152,156,190, 2, 27, 58, 30,104,121, 0,255,156,220,196,190,115,128,187,188,119,152,156,190, -254,228, 58, 30,104,121, 0,255,223,245, 4, 63, 77,106,205, 59, 79, 15,164,190,218, 55,126,253, 35,115, 0,255, 76,202,211,190, - 77,106,205, 59, 79, 15,164,190, 38,200,126,253, 35,115, 0,255,152, 75, 0, 63,216,126,230, 60,227, 83,160,190,164, 41,199,255, - 8,121, 0,255,190,117,202,190,216,126,230, 60,227, 83,160,190, 92,214,199,255, 8,121, 0,255,149,211, 6, 63,239,172,106, 61, - 5,237,165,190,237, 39,191, 9, 55,121, 0,255,185,133,215,190,239,172,106, 61, 5,237,165,190, 19,216,191, 9, 55,121, 0,255, -220,125, 11, 63,205, 26, 17, 61,187,202,167,190,208, 46, 41,244,137,118, 0,255, 71,218,224,190,205, 26, 17, 61,187,202,167,190, - 48,209, 41,244,137,118, 0,255,218, 5, 18, 63,222,227, 61, 61,113,168,169,190, 70, 53, 84, 3, 85,116, 2,255, 65,234,237,190, -222,227, 61, 61,113,168,169,190,186,202, 84, 3, 85,116, 2,255, 73, 57, 15, 63,176,168,154, 61,113,168,169,190, 99, 44, 36, 38, -212,113, 2,255, 31, 81,232,190,176,168,154, 61,113,168,169,190,157,211, 36, 38,212,113, 2,255,112,194, 7, 63, 54,180, 27, 62, -249, 12,192,190,249,198, 3, 72,222,166, 3,255,111, 99,217,190, 54,180, 27, 62,249, 12,192,190, 7, 57, 3, 72,222,166, 3,255, - 64,209, 34, 63,230,161, 42, 62,170,250,206,190,198, 37,123, 68,174,154, 3,255,135,192, 7,191,230,161, 42, 62,170,250,206,190, - 58,218,123, 68,174,154, 3,255, 21,208, 48, 63, 57, 13,177, 61,102,200,195,190, 3,121,201, 17, 73,218, 3,255, 93,191, 21,191, - 57, 13,177, 61,102,200,195,190,253,134,201, 17, 73,218, 3,255, 24, 72, 42, 63,211, 91,217,188, 62, 63,203,190, 59, 82, 75,200, - 70,175, 3,255, 96, 55, 15,191,211, 91,217,188, 62, 63,203,190,197,173, 75,200, 70,175, 3,255, 38,160, 9, 63, 40,178,188,189, -175,234,193,190,134,249,184,165,129,165, 3,255,219, 30,221,190, 40,178,188,189,175,234,193,190,122, 6,184,165,129,165, 3,255, -140,137,215, 62, 97, 4,226,189,192,186,154,190,126,249,122,163,205,167, 1,255, 25,104,161,190, 97, 4,226,189,192,186,154,190, -130, 6,122,163,205,167, 1,255,243, 84,232, 62, 65,148, 1, 62,187,202,167,190, 93,193,224, 65,229,165, 1,255,128, 51,178,190, - 65,148, 1, 62,187,202,167,190,163, 62,224, 65,229,165, 1,255, 68, 65, 84, 65, 64, 1, 0, 0, 96,173,116, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -224,174,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 28, 47, 0, 0,224,174,116, 1, 0, 0, 0, 0, 53, 0, 0, 0,237, 3, 0, 0, - 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 43, 0, 0, 0, - 0, 0, 34, 0, 43, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, - 46, 0, 0, 0, 0, 0, 34, 0, 44, 0, 0, 0, 46, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 44, 0, 0, 0, 0, 0, 34, 0, - 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 41, 0, 0, 0, 0, 0, 34, 0, 41, 0, 0, 0, 43, 0, 0, 0, - 0, 0, 34, 0, 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 44, 0, 0, 0, 0, 0, 34, 0, 5, 0, 0, 0, - 42, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, - 4, 0, 0, 0, 6, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 9, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 34, 0, 5, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 34, 0, 8, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 34, 0, 9, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, - 10, 0, 0, 0, 12, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, 14, 0, 0, 0, 0, 0, 34, 0, 8, 0, 0, 0, 14, 0, 0, 0, - 0, 0, 34, 0, 11, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, - 15, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 16, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 19, 0, 0, 0, 0, 0, 34, 0, - 17, 0, 0, 0, 19, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 34, 0, 16, 0, 0, 0, 18, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, 21, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, - 21, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0, 22, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0, 22, 0, 0, 0, 0, 0, 34, 0, - 21, 0, 0, 0, 23, 0, 0, 0, 0, 0, 34, 0, 23, 0, 0, 0, 25, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, 25, 0, 0, 0, - 0, 0, 34, 0, 24, 0, 0, 0, 26, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, 24, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0, - 26, 0, 0, 0, 0, 0, 34, 0, 25, 0, 0, 0, 27, 0, 0, 0, 0, 0, 34, 0, 17, 0, 0, 0, 27, 0, 0, 0, 0, 0, 34, 0, - 26, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, 25, 0, 0, 0, 31, 0, 0, 0, - 0, 0, 34, 0, 29, 0, 0, 0, 31, 0, 0, 0, 0, 0, 34, 0, 27, 0, 0, 0, 29, 0, 0, 0, 0, 0, 34, 0, 30, 0, 0, 0, - 32, 0, 0, 0, 0, 0, 34, 0, 26, 0, 0, 0, 32, 0, 0, 0, 0, 0, 34, 0, 28, 0, 0, 0, 30, 0, 0, 0, 0, 0, 34, 0, - 23, 0, 0, 0, 33, 0, 0, 0, 0, 0, 34, 0, 31, 0, 0, 0, 33, 0, 0, 0, 0, 0, 34, 0, 32, 0, 0, 0, 34, 0, 0, 0, - 0, 0, 34, 0, 24, 0, 0, 0, 34, 0, 0, 0, 0, 0, 34, 0, 33, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 35, 0, 0, 0, - 37, 0, 0, 0, 0, 0, 34, 0, 31, 0, 0, 0, 37, 0, 0, 0, 0, 0, 34, 0, 36, 0, 0, 0, 38, 0, 0, 0, 0, 0, 34, 0, - 34, 0, 0, 0, 36, 0, 0, 0, 0, 0, 34, 0, 32, 0, 0, 0, 38, 0, 0, 0, 0, 0, 34, 0, 37, 0, 0, 0, 39, 0, 0, 0, - 0, 0, 34, 0, 29, 0, 0, 0, 39, 0, 0, 0, 0, 0, 34, 0, 38, 0, 0, 0, 40, 0, 0, 0, 0, 0, 34, 0, 30, 0, 0, 0, - 40, 0, 0, 0, 0, 0, 34, 0, 37, 0, 0, 0, 43, 0, 0, 0, 0, 0, 34, 0, 39, 0, 0, 0, 41, 0, 0, 0, 0, 0, 34, 0, - 38, 0, 0, 0, 44, 0, 0, 0, 0, 0, 34, 0, 40, 0, 0, 0, 42, 0, 0, 0, 0, 0, 34, 0, 35, 0, 0, 0, 45, 0, 0, 0, - 0, 0, 34, 0, 36, 0, 0, 0, 46, 0, 0, 0, 0, 0, 34, 0, 35, 0, 0, 0, 49, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, - 49, 0, 0, 0, 0, 0, 34, 0, 45, 0, 0, 0, 47, 0, 0, 0, 0, 0, 34, 0, 36, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, - 46, 0, 0, 0, 48, 0, 0, 0, 0, 0, 34, 0, 48, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, 33, 0, 0, 0, 51, 0, 0, 0, - 0, 0, 34, 0, 49, 0, 0, 0, 51, 0, 0, 0, 0, 0, 34, 0, 34, 0, 0, 0, 52, 0, 0, 0, 0, 0, 34, 0, 50, 0, 0, 0, - 52, 0, 0, 0, 0, 0, 34, 0, 23, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, - 24, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, 21, 0, 0, 0, 55, 0, 0, 0, - 0, 0, 34, 0, 53, 0, 0, 0, 55, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, 56, 0, 0, 0, 0, 0, 34, 0, 54, 0, 0, 0, - 56, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, 57, 0, 0, 0, 0, 0, 34, 0, 55, 0, 0, 0, 57, 0, 0, 0, 0, 0, 34, 0, - 13, 0, 0, 0, 58, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, 58, 0, 0, 0, 0, 0, 34, 0, 10, 0, 0, 0, 61, 0, 0, 0, - 0, 0, 34, 0, 57, 0, 0, 0, 61, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 62, 0, 0, 0, 0, 0, 34, 0, 58, 0, 0, 0, - 62, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, 61, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, - 1, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 62, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 34, 0, 48, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 59, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 34, 0, 60, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 48, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, - 59, 0, 0, 0, 61, 0, 0, 0, 0, 0, 34, 0, 60, 0, 0, 0, 62, 0, 0, 0, 0, 0, 34, 0, 57, 0, 0, 0, 59, 0, 0, 0, - 0, 0, 34, 0, 58, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 55, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 34, 0, 53, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, 54, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, - 51, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 49, 0, 0, 0, 59, 0, 0, 0, - 0, 0, 34, 0, 50, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 87, 0, 0, 0,171, 0, 0, 0, 0, 0, 34, 0,171, 0, 0, 0, -173, 0, 0, 0, 0, 0, 34, 0, 89, 0, 0, 0,173, 0, 0, 0, 0, 0, 34, 0, 87, 0, 0, 0, 89, 0, 0, 0, 0, 0, 34, 0, -172, 0, 0, 0,173, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0,172, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, 89, 0, 0, 0, - 0, 0, 34, 0, 85, 0, 0, 0,169, 0, 0, 0, 0, 0, 34, 0,169, 0, 0, 0,171, 0, 0, 0, 0, 0, 34, 0, 85, 0, 0, 0, - 87, 0, 0, 0, 0, 0, 34, 0,170, 0, 0, 0,172, 0, 0, 0, 0, 0, 34, 0, 86, 0, 0, 0,170, 0, 0, 0, 0, 0, 34, 0, - 86, 0, 0, 0, 88, 0, 0, 0, 0, 0, 34, 0, 83, 0, 0, 0,167, 0, 0, 0, 0, 0, 34, 0,167, 0, 0, 0,169, 0, 0, 0, - 0, 0, 34, 0, 83, 0, 0, 0, 85, 0, 0, 0, 0, 0, 34, 0,168, 0, 0, 0,170, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0, -168, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0, 86, 0, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0,165, 0, 0, 0, 0, 0, 34, 0, -165, 0, 0, 0,167, 0, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0, 83, 0, 0, 0, 0, 0, 34, 0,166, 0, 0, 0,168, 0, 0, 0, - 0, 0, 34, 0, 82, 0, 0, 0,166, 0, 0, 0, 0, 0, 34, 0, 82, 0, 0, 0, 84, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0, -163, 0, 0, 0, 0, 0, 34, 0,163, 0, 0, 0,165, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0, 81, 0, 0, 0, 0, 0, 34, 0, -164, 0, 0, 0,166, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0,164, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0, 82, 0, 0, 0, - 0, 0, 34, 0, 77, 0, 0, 0, 90, 0, 0, 0, 0, 0, 34, 0, 90, 0, 0, 0,143, 0, 0, 0, 0, 0, 34, 0,143, 0, 0, 0, -161, 0, 0, 0, 0, 0, 34, 0, 77, 0, 0, 0,161, 0, 0, 0, 0, 0, 34, 0, 91, 0, 0, 0,144, 0, 0, 0, 0, 0, 34, 0, - 78, 0, 0, 0, 91, 0, 0, 0, 0, 0, 34, 0, 78, 0, 0, 0,162, 0, 0, 0, 0, 0, 34, 0,144, 0, 0, 0,162, 0, 0, 0, - 0, 0, 34, 0, 90, 0, 0, 0, 92, 0, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0,145, 0, 0, 0, 0, 0, 34, 0,143, 0, 0, 0, -145, 0, 0, 0, 0, 0, 34, 0, 93, 0, 0, 0,146, 0, 0, 0, 0, 0, 34, 0, 91, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, -144, 0, 0, 0,146, 0, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0, 94, 0, 0, 0,147, 0, 0, 0, - 0, 0, 34, 0,145, 0, 0, 0,147, 0, 0, 0, 0, 0, 34, 0, 95, 0, 0, 0,148, 0, 0, 0, 0, 0, 34, 0, 93, 0, 0, 0, - 95, 0, 0, 0, 0, 0, 34, 0,146, 0, 0, 0,148, 0, 0, 0, 0, 0, 34, 0, 94, 0, 0, 0, 96, 0, 0, 0, 0, 0, 34, 0, - 96, 0, 0, 0,149, 0, 0, 0, 0, 0, 34, 0,147, 0, 0, 0,149, 0, 0, 0, 0, 0, 34, 0, 97, 0, 0, 0,150, 0, 0, 0, - 0, 0, 34, 0, 95, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0,148, 0, 0, 0,150, 0, 0, 0, 0, 0, 34, 0, 96, 0, 0, 0, - 98, 0, 0, 0, 0, 0, 34, 0, 98, 0, 0, 0,151, 0, 0, 0, 0, 0, 34, 0,149, 0, 0, 0,151, 0, 0, 0, 0, 0, 34, 0, - 99, 0, 0, 0,152, 0, 0, 0, 0, 0, 34, 0, 97, 0, 0, 0, 99, 0, 0, 0, 0, 0, 34, 0,150, 0, 0, 0,152, 0, 0, 0, - 0, 0, 34, 0, 98, 0, 0, 0,100, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0,153, 0, 0, 0, 0, 0, 34, 0,151, 0, 0, 0, -153, 0, 0, 0, 0, 0, 34, 0,101, 0, 0, 0,154, 0, 0, 0, 0, 0, 34, 0, 99, 0, 0, 0,101, 0, 0, 0, 0, 0, 34, 0, -152, 0, 0, 0,154, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0,102, 0, 0, 0, 0, 0, 34, 0,102, 0, 0, 0,155, 0, 0, 0, - 0, 0, 34, 0,153, 0, 0, 0,155, 0, 0, 0, 0, 0, 34, 0,103, 0, 0, 0,156, 0, 0, 0, 0, 0, 34, 0,101, 0, 0, 0, -103, 0, 0, 0, 0, 0, 34, 0,154, 0, 0, 0,156, 0, 0, 0, 0, 0, 34, 0,102, 0, 0, 0,104, 0, 0, 0, 0, 0, 34, 0, -104, 0, 0, 0,157, 0, 0, 0, 0, 0, 34, 0,155, 0, 0, 0,157, 0, 0, 0, 0, 0, 34, 0,105, 0, 0, 0,158, 0, 0, 0, - 0, 0, 34, 0,103, 0, 0, 0,105, 0, 0, 0, 0, 0, 34, 0,156, 0, 0, 0,158, 0, 0, 0, 0, 0, 34, 0,104, 0, 0, 0, -106, 0, 0, 0, 0, 0, 34, 0,106, 0, 0, 0,159, 0, 0, 0, 0, 0, 34, 0,157, 0, 0, 0,159, 0, 0, 0, 0, 0, 34, 0, -107, 0, 0, 0,160, 0, 0, 0, 0, 0, 34, 0,105, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0,158, 0, 0, 0,160, 0, 0, 0, - 0, 0, 34, 0, 65, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0, 66, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0, -159, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0,160, 0, 0, 0, 0, 0, 34, 0, -108, 0, 0, 0,125, 0, 0, 0, 0, 0, 34, 0,125, 0, 0, 0,157, 0, 0, 0, 0, 0, 34, 0,108, 0, 0, 0,159, 0, 0, 0, - 0, 0, 34, 0,126, 0, 0, 0,158, 0, 0, 0, 0, 0, 34, 0,109, 0, 0, 0,126, 0, 0, 0, 0, 0, 34, 0,109, 0, 0, 0, -160, 0, 0, 0, 0, 0, 34, 0,125, 0, 0, 0,176, 0, 0, 0, 0, 0, 34, 0,155, 0, 0, 0,176, 0, 0, 0, 0, 0, 34, 0, -156, 0, 0, 0,177, 0, 0, 0, 0, 0, 34, 0,126, 0, 0, 0,177, 0, 0, 0, 0, 0, 34, 0,123, 0, 0, 0,153, 0, 0, 0, - 0, 0, 34, 0,123, 0, 0, 0,176, 0, 0, 0, 0, 0, 34, 0,124, 0, 0, 0,154, 0, 0, 0, 0, 0, 34, 0,124, 0, 0, 0, -177, 0, 0, 0, 0, 0, 34, 0,121, 0, 0, 0,151, 0, 0, 0, 0, 0, 34, 0,121, 0, 0, 0,123, 0, 0, 0, 0, 0, 34, 0, -122, 0, 0, 0,152, 0, 0, 0, 0, 0, 34, 0,122, 0, 0, 0,124, 0, 0, 0, 0, 0, 34, 0,119, 0, 0, 0,149, 0, 0, 0, - 0, 0, 34, 0,119, 0, 0, 0,121, 0, 0, 0, 0, 0, 34, 0,120, 0, 0, 0,150, 0, 0, 0, 0, 0, 34, 0,120, 0, 0, 0, -122, 0, 0, 0, 0, 0, 34, 0,117, 0, 0, 0,147, 0, 0, 0, 0, 0, 34, 0,117, 0, 0, 0,119, 0, 0, 0, 0, 0, 34, 0, -118, 0, 0, 0,148, 0, 0, 0, 0, 0, 34, 0,118, 0, 0, 0,120, 0, 0, 0, 0, 0, 34, 0,115, 0, 0, 0,145, 0, 0, 0, - 0, 0, 34, 0,115, 0, 0, 0,117, 0, 0, 0, 0, 0, 34, 0,116, 0, 0, 0,146, 0, 0, 0, 0, 0, 34, 0,116, 0, 0, 0, -118, 0, 0, 0, 0, 0, 34, 0,113, 0, 0, 0,143, 0, 0, 0, 0, 0, 34, 0,113, 0, 0, 0,115, 0, 0, 0, 0, 0, 34, 0, -114, 0, 0, 0,144, 0, 0, 0, 0, 0, 34, 0,114, 0, 0, 0,116, 0, 0, 0, 0, 0, 34, 0,112, 0, 0, 0,162, 0, 0, 0, - 0, 0, 34, 0,112, 0, 0, 0,114, 0, 0, 0, 0, 0, 34, 0,174, 0, 0, 0,178, 0, 0, 0, 0, 0, 34, 0,161, 0, 0, 0, -174, 0, 0, 0, 0, 0, 34, 0,174, 0, 0, 0,179, 0, 0, 0, 0, 0, 34, 0,112, 0, 0, 0,179, 0, 0, 0, 0, 0, 34, 0, -162, 0, 0, 0,174, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0,108, 0, 0, 0,110, 0, 0, 0, - 0, 0, 34, 0,109, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0, -175, 0, 0, 0, 0, 0, 34, 0,175, 0, 0, 0,180, 0, 0, 0, 0, 0, 34, 0,110, 0, 0, 0,180, 0, 0, 0, 0, 0, 34, 0, -111, 0, 0, 0,181, 0, 0, 0, 0, 0, 34, 0,175, 0, 0, 0,181, 0, 0, 0, 0, 0, 34, 0,178, 0, 0, 0,180, 0, 0, 0, - 0, 0, 34, 0,174, 0, 0, 0,175, 0, 0, 0, 0, 0, 32, 0,179, 0, 0, 0,181, 0, 0, 0, 0, 0, 34, 0,132, 0, 0, 0, -134, 0, 0, 0, 0, 0, 34, 0,134, 0, 0, 0,173, 0, 0, 0, 0, 0, 34, 0,132, 0, 0, 0,171, 0, 0, 0, 0, 0, 34, 0, -133, 0, 0, 0,134, 0, 0, 0, 0, 0, 34, 0,133, 0, 0, 0,172, 0, 0, 0, 0, 0, 34, 0,130, 0, 0, 0,132, 0, 0, 0, - 0, 0, 34, 0,130, 0, 0, 0,169, 0, 0, 0, 0, 0, 34, 0,131, 0, 0, 0,133, 0, 0, 0, 0, 0, 34, 0,131, 0, 0, 0, -170, 0, 0, 0, 0, 0, 34, 0,128, 0, 0, 0,130, 0, 0, 0, 0, 0, 34, 0,128, 0, 0, 0,167, 0, 0, 0, 0, 0, 34, 0, -129, 0, 0, 0,131, 0, 0, 0, 0, 0, 34, 0,129, 0, 0, 0,168, 0, 0, 0, 0, 0, 34, 0,163, 0, 0, 0,184, 0, 0, 0, - 0, 0, 34, 0,182, 0, 0, 0,184, 0, 0, 0, 0, 0, 34, 0,165, 0, 0, 0,182, 0, 0, 0, 0, 0, 34, 0,183, 0, 0, 0, -185, 0, 0, 0, 0, 0, 34, 0,164, 0, 0, 0,185, 0, 0, 0, 0, 0, 34, 0,166, 0, 0, 0,183, 0, 0, 0, 0, 0, 34, 0, -128, 0, 0, 0,182, 0, 0, 0, 0, 0, 34, 0,129, 0, 0, 0,183, 0, 0, 0, 0, 0, 34, 0,141, 0, 0, 0,187, 0, 0, 0, - 0, 0, 34, 0,186, 0, 0, 0,187, 0, 0, 0, 0, 0, 32, 0,184, 0, 0, 0,186, 0, 0, 0, 0, 0, 34, 0,141, 0, 0, 0, -184, 0, 0, 0, 0, 0, 34, 0,142, 0, 0, 0,187, 0, 0, 0, 0, 0, 34, 0,142, 0, 0, 0,185, 0, 0, 0, 0, 0, 34, 0, -185, 0, 0, 0,186, 0, 0, 0, 0, 0, 34, 0, 67, 0, 0, 0,186, 0, 0, 0, 0, 0, 32, 0, 67, 0, 0, 0,182, 0, 0, 0, - 0, 0, 34, 0, 67, 0, 0, 0,183, 0, 0, 0, 0, 0, 34, 0,127, 0, 0, 0,128, 0, 0, 0, 0, 0, 34, 0, 67, 0, 0, 0, -127, 0, 0, 0, 0, 0, 32, 0,127, 0, 0, 0,129, 0, 0, 0, 0, 0, 34, 0,139, 0, 0, 0,190, 0, 0, 0, 0, 0, 34, 0, -188, 0, 0, 0,190, 0, 0, 0, 0, 0, 34, 0,141, 0, 0, 0,188, 0, 0, 0, 0, 0, 34, 0,139, 0, 0, 0,141, 0, 0, 0, - 0, 0, 34, 0,189, 0, 0, 0,191, 0, 0, 0, 0, 0, 34, 0,140, 0, 0, 0,191, 0, 0, 0, 0, 0, 34, 0,140, 0, 0, 0, -142, 0, 0, 0, 0, 0, 34, 0,142, 0, 0, 0,189, 0, 0, 0, 0, 0, 34, 0,137, 0, 0, 0,192, 0, 0, 0, 0, 0, 34, 0, -190, 0, 0, 0,192, 0, 0, 0, 0, 0, 34, 0,137, 0, 0, 0,139, 0, 0, 0, 0, 0, 34, 0,191, 0, 0, 0,193, 0, 0, 0, - 0, 0, 34, 0,138, 0, 0, 0,193, 0, 0, 0, 0, 0, 34, 0,138, 0, 0, 0,140, 0, 0, 0, 0, 0, 34, 0,136, 0, 0, 0, -194, 0, 0, 0, 0, 0, 34, 0,192, 0, 0, 0,194, 0, 0, 0, 0, 0, 34, 0,136, 0, 0, 0,137, 0, 0, 0, 0, 0, 34, 0, -193, 0, 0, 0,195, 0, 0, 0, 0, 0, 34, 0,136, 0, 0, 0,195, 0, 0, 0, 0, 0, 34, 0,136, 0, 0, 0,138, 0, 0, 0, - 0, 0, 34, 0, 69, 0, 0, 0,135, 0, 0, 0, 0, 0, 34, 0, 69, 0, 0, 0,194, 0, 0, 0, 0, 0, 34, 0,135, 0, 0, 0, -136, 0, 0, 0, 0, 0, 34, 0, 69, 0, 0, 0,195, 0, 0, 0, 0, 0, 34, 0, 68, 0, 0, 0,188, 0, 0, 0, 0, 0, 34, 0, - 68, 0, 0, 0,187, 0, 0, 0, 0, 0, 34, 0, 68, 0, 0, 0,189, 0, 0, 0, 0, 0, 34, 0,188, 0, 0, 0,203, 0, 0, 0, - 0, 0, 34, 0,203, 0, 0, 0,205, 0, 0, 0, 0, 0, 34, 0, 68, 0, 0, 0,205, 0, 0, 0, 0, 0, 34, 0,189, 0, 0, 0, -204, 0, 0, 0, 0, 0, 34, 0,204, 0, 0, 0,205, 0, 0, 0, 0, 0, 34, 0, 69, 0, 0, 0,196, 0, 0, 0, 0, 0, 34, 0, -196, 0, 0, 0,197, 0, 0, 0, 0, 0, 34, 0,194, 0, 0, 0,197, 0, 0, 0, 0, 0, 34, 0,196, 0, 0, 0,198, 0, 0, 0, - 0, 0, 34, 0,195, 0, 0, 0,198, 0, 0, 0, 0, 0, 34, 0,197, 0, 0, 0,199, 0, 0, 0, 0, 0, 34, 0,192, 0, 0, 0, -199, 0, 0, 0, 0, 0, 34, 0,198, 0, 0, 0,200, 0, 0, 0, 0, 0, 34, 0,193, 0, 0, 0,200, 0, 0, 0, 0, 0, 34, 0, -199, 0, 0, 0,201, 0, 0, 0, 0, 0, 34, 0,190, 0, 0, 0,201, 0, 0, 0, 0, 0, 34, 0,200, 0, 0, 0,202, 0, 0, 0, - 0, 0, 34, 0,191, 0, 0, 0,202, 0, 0, 0, 0, 0, 34, 0,201, 0, 0, 0,203, 0, 0, 0, 0, 0, 34, 0,202, 0, 0, 0, -204, 0, 0, 0, 0, 0, 34, 0,196, 0, 0, 0,201, 0, 0, 0, 0, 0, 34, 0,196, 0, 0, 0,202, 0, 0, 0, 0, 0, 34, 0, -196, 0, 0, 0,205, 0, 0, 0, 0, 0, 34, 0,137, 0, 0, 0,161, 0, 0, 0, 0, 0, 34, 0,136, 0, 0, 0,174, 0, 0, 0, - 0, 0, 34, 0,138, 0, 0, 0,162, 0, 0, 0, 0, 0, 34, 0,139, 0, 0, 0,208, 0, 0, 0, 0, 0, 34, 0,161, 0, 0, 0, -208, 0, 0, 0, 0, 0, 34, 0,140, 0, 0, 0,209, 0, 0, 0, 0, 0, 34, 0,162, 0, 0, 0,209, 0, 0, 0, 0, 0, 34, 0, -141, 0, 0, 0,210, 0, 0, 0, 0, 0, 34, 0,208, 0, 0, 0,210, 0, 0, 0, 0, 0, 34, 0,142, 0, 0, 0,211, 0, 0, 0, - 0, 0, 34, 0,209, 0, 0, 0,211, 0, 0, 0, 0, 0, 34, 0,163, 0, 0, 0,210, 0, 0, 0, 0, 0, 34, 0,164, 0, 0, 0, -211, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0,206, 0, 0, 0, 0, 0, 34, 0,206, 0, 0, 0,210, 0, 0, 0, 0, 0, 34, 0, -207, 0, 0, 0,211, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0,207, 0, 0, 0, 0, 0, 34, 0,206, 0, 0, 0,212, 0, 0, 0, - 0, 0, 34, 0,208, 0, 0, 0,212, 0, 0, 0, 0, 0, 34, 0,209, 0, 0, 0,213, 0, 0, 0, 0, 0, 34, 0,207, 0, 0, 0, -213, 0, 0, 0, 0, 0, 34, 0, 77, 0, 0, 0,212, 0, 0, 0, 0, 0, 34, 0, 78, 0, 0, 0,213, 0, 0, 0, 0, 0, 34, 0, - 70, 0, 0, 0,127, 0, 0, 0, 0, 0, 34, 0, 70, 0, 0, 0,219, 0, 0, 0, 0, 0, 34, 0,128, 0, 0, 0,219, 0, 0, 0, - 0, 0, 34, 0,129, 0, 0, 0,220, 0, 0, 0, 0, 0, 34, 0, 70, 0, 0, 0,220, 0, 0, 0, 0, 0, 34, 0,217, 0, 0, 0, -219, 0, 0, 0, 0, 0, 34, 0,130, 0, 0, 0,217, 0, 0, 0, 0, 0, 34, 0,131, 0, 0, 0,218, 0, 0, 0, 0, 0, 34, 0, -218, 0, 0, 0,220, 0, 0, 0, 0, 0, 34, 0,215, 0, 0, 0,217, 0, 0, 0, 0, 0, 34, 0,132, 0, 0, 0,215, 0, 0, 0, - 0, 0, 34, 0,133, 0, 0, 0,216, 0, 0, 0, 0, 0, 34, 0,216, 0, 0, 0,218, 0, 0, 0, 0, 0, 34, 0,214, 0, 0, 0, -215, 0, 0, 0, 0, 0, 34, 0,134, 0, 0, 0,214, 0, 0, 0, 0, 0, 34, 0,214, 0, 0, 0,216, 0, 0, 0, 0, 0, 34, 0, -215, 0, 0, 0,226, 0, 0, 0, 0, 0, 34, 0,226, 0, 0, 0,228, 0, 0, 0, 0, 0, 34, 0,214, 0, 0, 0,228, 0, 0, 0, - 0, 0, 34, 0,216, 0, 0, 0,227, 0, 0, 0, 0, 0, 34, 0,227, 0, 0, 0,228, 0, 0, 0, 0, 0, 34, 0,217, 0, 0, 0, -224, 0, 0, 0, 0, 0, 34, 0,224, 0, 0, 0,226, 0, 0, 0, 0, 0, 34, 0,218, 0, 0, 0,225, 0, 0, 0, 0, 0, 34, 0, -225, 0, 0, 0,227, 0, 0, 0, 0, 0, 34, 0,219, 0, 0, 0,222, 0, 0, 0, 0, 0, 34, 0,222, 0, 0, 0,224, 0, 0, 0, - 0, 0, 34, 0,220, 0, 0, 0,223, 0, 0, 0, 0, 0, 34, 0,223, 0, 0, 0,225, 0, 0, 0, 0, 0, 34, 0, 70, 0, 0, 0, -221, 0, 0, 0, 0, 0, 34, 0,221, 0, 0, 0,222, 0, 0, 0, 0, 0, 34, 0,221, 0, 0, 0,223, 0, 0, 0, 0, 0, 34, 0, -221, 0, 0, 0,228, 0, 0, 0, 0, 0, 34, 0,222, 0, 0, 0,226, 0, 0, 0, 0, 0, 34, 0,223, 0, 0, 0,227, 0, 0, 0, - 0, 0, 34, 0,178, 0, 0, 0,231, 0, 0, 0, 0, 0, 34, 0,229, 0, 0, 0,231, 0, 0, 0, 0, 0, 34, 0,180, 0, 0, 0, -229, 0, 0, 0, 0, 0, 34, 0,179, 0, 0, 0,232, 0, 0, 0, 0, 0, 34, 0,181, 0, 0, 0,230, 0, 0, 0, 0, 0, 34, 0, -230, 0, 0, 0,232, 0, 0, 0, 0, 0, 34, 0,229, 0, 0, 0,251, 0, 0, 0, 0, 0, 34, 0,110, 0, 0, 0,251, 0, 0, 0, - 0, 0, 34, 0,111, 0, 0, 0,252, 0, 0, 0, 0, 0, 34, 0,230, 0, 0, 0,252, 0, 0, 0, 0, 0, 34, 0,251, 0, 0, 0, -253, 0, 0, 0, 0, 0, 34, 0,108, 0, 0, 0,253, 0, 0, 0, 0, 0, 34, 0,109, 0, 0, 0,254, 0, 0, 0, 0, 0, 34, 0, -252, 0, 0, 0,254, 0, 0, 0, 0, 0, 34, 0,231, 0, 0, 0,249, 0, 0, 0, 0, 0, 34, 0,112, 0, 0, 0,250, 0, 0, 0, - 0, 0, 34, 0,232, 0, 0, 0,250, 0, 0, 0, 0, 0, 34, 0,113, 0, 0, 0,247, 0, 0, 0, 0, 0, 34, 0,247, 0, 0, 0, -249, 0, 0, 0, 0, 0, 34, 0,114, 0, 0, 0,248, 0, 0, 0, 0, 0, 34, 0,248, 0, 0, 0,250, 0, 0, 0, 0, 0, 34, 0, -115, 0, 0, 0,245, 0, 0, 0, 0, 0, 34, 0,245, 0, 0, 0,247, 0, 0, 0, 0, 0, 34, 0,116, 0, 0, 0,246, 0, 0, 0, - 0, 0, 34, 0,246, 0, 0, 0,248, 0, 0, 0, 0, 0, 34, 0,117, 0, 0, 0,243, 0, 0, 0, 0, 0, 34, 0,243, 0, 0, 0, -245, 0, 0, 0, 0, 0, 34, 0,118, 0, 0, 0,244, 0, 0, 0, 0, 0, 34, 0,244, 0, 0, 0,246, 0, 0, 0, 0, 0, 34, 0, -119, 0, 0, 0,241, 0, 0, 0, 0, 0, 34, 0,241, 0, 0, 0,243, 0, 0, 0, 0, 0, 34, 0,120, 0, 0, 0,242, 0, 0, 0, - 0, 0, 34, 0,242, 0, 0, 0,244, 0, 0, 0, 0, 0, 34, 0,121, 0, 0, 0,239, 0, 0, 0, 0, 0, 34, 0,239, 0, 0, 0, -241, 0, 0, 0, 0, 0, 34, 0,122, 0, 0, 0,240, 0, 0, 0, 0, 0, 34, 0,240, 0, 0, 0,242, 0, 0, 0, 0, 0, 34, 0, -123, 0, 0, 0,237, 0, 0, 0, 0, 0, 34, 0,237, 0, 0, 0,239, 0, 0, 0, 0, 0, 34, 0,124, 0, 0, 0,238, 0, 0, 0, - 0, 0, 34, 0,238, 0, 0, 0,240, 0, 0, 0, 0, 0, 34, 0,176, 0, 0, 0,233, 0, 0, 0, 0, 0, 34, 0,233, 0, 0, 0, -237, 0, 0, 0, 0, 0, 34, 0,177, 0, 0, 0,234, 0, 0, 0, 0, 0, 34, 0,234, 0, 0, 0,238, 0, 0, 0, 0, 0, 34, 0, -125, 0, 0, 0,235, 0, 0, 0, 0, 0, 34, 0,233, 0, 0, 0,235, 0, 0, 0, 0, 0, 34, 0,126, 0, 0, 0,236, 0, 0, 0, - 0, 0, 34, 0,234, 0, 0, 0,236, 0, 0, 0, 0, 0, 34, 0,235, 0, 0, 0,253, 0, 0, 0, 0, 0, 34, 0,236, 0, 0, 0, -254, 0, 0, 0, 0, 0, 34, 0,253, 0, 0, 0,255, 0, 0, 0, 0, 0, 34, 0,255, 0, 0, 0, 17, 1, 0, 0, 0, 0, 34, 0, -235, 0, 0, 0, 17, 1, 0, 0, 0, 0, 34, 0,254, 0, 0, 0, 0, 1, 0, 0, 0, 0, 34, 0,236, 0, 0, 0, 18, 1, 0, 0, - 0, 0, 34, 0, 0, 1, 0, 0, 18, 1, 0, 0, 0, 0, 34, 0, 17, 1, 0, 0, 19, 1, 0, 0, 0, 0, 34, 0,233, 0, 0, 0, - 19, 1, 0, 0, 0, 0, 34, 0,234, 0, 0, 0, 20, 1, 0, 0, 0, 0, 34, 0, 18, 1, 0, 0, 20, 1, 0, 0, 0, 0, 34, 0, - 15, 1, 0, 0, 19, 1, 0, 0, 0, 0, 34, 0,237, 0, 0, 0, 15, 1, 0, 0, 0, 0, 34, 0,238, 0, 0, 0, 16, 1, 0, 0, - 0, 0, 34, 0, 16, 1, 0, 0, 20, 1, 0, 0, 0, 0, 34, 0, 13, 1, 0, 0, 15, 1, 0, 0, 0, 0, 34, 0,239, 0, 0, 0, - 13, 1, 0, 0, 0, 0, 34, 0,240, 0, 0, 0, 14, 1, 0, 0, 0, 0, 34, 0, 14, 1, 0, 0, 16, 1, 0, 0, 0, 0, 34, 0, - 11, 1, 0, 0, 13, 1, 0, 0, 0, 0, 34, 0,241, 0, 0, 0, 11, 1, 0, 0, 0, 0, 34, 0,242, 0, 0, 0, 12, 1, 0, 0, - 0, 0, 34, 0, 12, 1, 0, 0, 14, 1, 0, 0, 0, 0, 34, 0, 9, 1, 0, 0, 11, 1, 0, 0, 0, 0, 34, 0,243, 0, 0, 0, - 9, 1, 0, 0, 0, 0, 34, 0,244, 0, 0, 0, 10, 1, 0, 0, 0, 0, 34, 0, 10, 1, 0, 0, 12, 1, 0, 0, 0, 0, 34, 0, - 7, 1, 0, 0, 9, 1, 0, 0, 0, 0, 34, 0,245, 0, 0, 0, 7, 1, 0, 0, 0, 0, 34, 0,246, 0, 0, 0, 8, 1, 0, 0, - 0, 0, 34, 0, 8, 1, 0, 0, 10, 1, 0, 0, 0, 0, 34, 0, 5, 1, 0, 0, 7, 1, 0, 0, 0, 0, 34, 0,247, 0, 0, 0, - 5, 1, 0, 0, 0, 0, 34, 0,248, 0, 0, 0, 6, 1, 0, 0, 0, 0, 34, 0, 6, 1, 0, 0, 8, 1, 0, 0, 0, 0, 34, 0, - 3, 1, 0, 0, 5, 1, 0, 0, 0, 0, 34, 0,249, 0, 0, 0, 3, 1, 0, 0, 0, 0, 34, 0,250, 0, 0, 0, 4, 1, 0, 0, - 0, 0, 34, 0, 4, 1, 0, 0, 6, 1, 0, 0, 0, 0, 34, 0, 3, 1, 0, 0, 21, 1, 0, 0, 0, 0, 34, 0,231, 0, 0, 0, - 21, 1, 0, 0, 0, 0, 34, 0,232, 0, 0, 0, 22, 1, 0, 0, 0, 0, 34, 0, 4, 1, 0, 0, 22, 1, 0, 0, 0, 0, 34, 0, -251, 0, 0, 0, 1, 1, 0, 0, 0, 0, 34, 0,255, 0, 0, 0, 1, 1, 0, 0, 0, 0, 34, 0,252, 0, 0, 0, 2, 1, 0, 0, - 0, 0, 34, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 34, 0,229, 0, 0, 0, 23, 1, 0, 0, 0, 0, 34, 0, 1, 1, 0, 0, - 23, 1, 0, 0, 0, 0, 34, 0,230, 0, 0, 0, 24, 1, 0, 0, 0, 0, 34, 0, 2, 1, 0, 0, 24, 1, 0, 0, 0, 0, 34, 0, - 21, 1, 0, 0, 23, 1, 0, 0, 0, 0, 34, 0, 22, 1, 0, 0, 24, 1, 0, 0, 0, 0, 34, 0,106, 0, 0, 0, 25, 1, 0, 0, - 0, 0, 34, 0, 71, 0, 0, 0, 25, 1, 0, 0, 0, 0, 38, 0, 65, 0, 0, 0, 71, 0, 0, 0, 0, 0, 34, 0,107, 0, 0, 0, - 26, 1, 0, 0, 0, 0, 34, 0, 71, 0, 0, 0, 26, 1, 0, 0, 0, 0, 38, 0,104, 0, 0, 0, 27, 1, 0, 0, 0, 0, 34, 0, - 25, 1, 0, 0, 27, 1, 0, 0, 0, 0, 34, 0,105, 0, 0, 0, 28, 1, 0, 0, 0, 0, 34, 0, 26, 1, 0, 0, 28, 1, 0, 0, - 0, 0, 34, 0,102, 0, 0, 0, 29, 1, 0, 0, 0, 0, 34, 0, 27, 1, 0, 0, 29, 1, 0, 0, 0, 0, 34, 0,103, 0, 0, 0, - 30, 1, 0, 0, 0, 0, 34, 0, 28, 1, 0, 0, 30, 1, 0, 0, 0, 0, 34, 0,100, 0, 0, 0, 31, 1, 0, 0, 0, 0, 34, 0, - 29, 1, 0, 0, 31, 1, 0, 0, 0, 0, 34, 0,101, 0, 0, 0, 32, 1, 0, 0, 0, 0, 34, 0, 30, 1, 0, 0, 32, 1, 0, 0, - 0, 0, 34, 0, 98, 0, 0, 0, 33, 1, 0, 0, 0, 0, 34, 0, 31, 1, 0, 0, 33, 1, 0, 0, 0, 0, 38, 0, 99, 0, 0, 0, - 34, 1, 0, 0, 0, 0, 34, 0, 32, 1, 0, 0, 34, 1, 0, 0, 0, 0, 38, 0, 96, 0, 0, 0, 35, 1, 0, 0, 0, 0, 34, 0, - 33, 1, 0, 0, 35, 1, 0, 0, 0, 0, 34, 0, 97, 0, 0, 0, 36, 1, 0, 0, 0, 0, 34, 0, 34, 1, 0, 0, 36, 1, 0, 0, - 0, 0, 34, 0, 94, 0, 0, 0, 37, 1, 0, 0, 0, 0, 34, 0, 35, 1, 0, 0, 37, 1, 0, 0, 0, 0, 34, 0, 95, 0, 0, 0, - 38, 1, 0, 0, 0, 0, 34, 0, 36, 1, 0, 0, 38, 1, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0, 39, 1, 0, 0, 0, 0, 34, 0, - 37, 1, 0, 0, 39, 1, 0, 0, 0, 0, 34, 0, 93, 0, 0, 0, 40, 1, 0, 0, 0, 0, 34, 0, 38, 1, 0, 0, 40, 1, 0, 0, - 0, 0, 34, 0, 90, 0, 0, 0, 41, 1, 0, 0, 0, 0, 34, 0, 39, 1, 0, 0, 41, 1, 0, 0, 0, 0, 34, 0, 91, 0, 0, 0, - 42, 1, 0, 0, 0, 0, 34, 0, 40, 1, 0, 0, 42, 1, 0, 0, 0, 0, 34, 0, 49, 1, 0, 0, 50, 1, 0, 0, 0, 0, 38, 0, - 50, 1, 0, 0, 69, 1, 0, 0, 0, 0, 34, 0, 69, 1, 0, 0, 79, 1, 0, 0, 0, 0, 34, 0, 49, 1, 0, 0, 79, 1, 0, 0, - 0, 0, 34, 0, 50, 1, 0, 0, 70, 1, 0, 0, 0, 0, 34, 0, 49, 1, 0, 0, 80, 1, 0, 0, 0, 0, 34, 0, 70, 1, 0, 0, - 80, 1, 0, 0, 0, 0, 34, 0, 48, 1, 0, 0, 49, 1, 0, 0, 0, 0, 38, 0, 77, 1, 0, 0, 79, 1, 0, 0, 0, 0, 34, 0, - 48, 1, 0, 0, 77, 1, 0, 0, 0, 0, 34, 0, 48, 1, 0, 0, 78, 1, 0, 0, 0, 0, 34, 0, 78, 1, 0, 0, 80, 1, 0, 0, - 0, 0, 34, 0, 47, 1, 0, 0, 48, 1, 0, 0, 0, 0, 38, 0, 77, 1, 0, 0, 81, 1, 0, 0, 0, 0, 34, 0, 47, 1, 0, 0, - 81, 1, 0, 0, 0, 0, 34, 0, 47, 1, 0, 0, 82, 1, 0, 0, 0, 0, 34, 0, 78, 1, 0, 0, 82, 1, 0, 0, 0, 0, 34, 0, - 89, 0, 0, 0, 47, 1, 0, 0, 0, 0, 38, 0, 87, 0, 0, 0, 81, 1, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, 82, 1, 0, 0, - 0, 0, 34, 0, 75, 1, 0, 0, 81, 1, 0, 0, 0, 0, 34, 0, 85, 0, 0, 0, 75, 1, 0, 0, 0, 0, 34, 0, 86, 0, 0, 0, - 76, 1, 0, 0, 0, 0, 34, 0, 76, 1, 0, 0, 82, 1, 0, 0, 0, 0, 34, 0, 71, 1, 0, 0, 75, 1, 0, 0, 0, 0, 34, 0, - 83, 0, 0, 0, 71, 1, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0, 72, 1, 0, 0, 0, 0, 34, 0, 72, 1, 0, 0, 76, 1, 0, 0, - 0, 0, 34, 0, 71, 1, 0, 0, 73, 1, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0, 73, 1, 0, 0, 0, 0, 34, 0, 82, 0, 0, 0, - 74, 1, 0, 0, 0, 0, 34, 0, 72, 1, 0, 0, 74, 1, 0, 0, 0, 0, 34, 0, 71, 1, 0, 0, 77, 1, 0, 0, 0, 0, 34, 0, - 73, 1, 0, 0, 79, 1, 0, 0, 0, 0, 34, 0, 72, 1, 0, 0, 78, 1, 0, 0, 0, 0, 34, 0, 74, 1, 0, 0, 80, 1, 0, 0, - 0, 0, 34, 0, 67, 1, 0, 0, 73, 1, 0, 0, 0, 0, 34, 0, 67, 1, 0, 0, 69, 1, 0, 0, 0, 0, 34, 0, 68, 1, 0, 0, - 74, 1, 0, 0, 0, 0, 34, 0, 68, 1, 0, 0, 70, 1, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0, 67, 1, 0, 0, 0, 0, 34, 0, - 80, 0, 0, 0, 68, 1, 0, 0, 0, 0, 34, 0,206, 0, 0, 0, 83, 1, 0, 0, 0, 0, 34, 0, 83, 1, 0, 0, 85, 1, 0, 0, - 0, 0, 34, 0,212, 0, 0, 0, 85, 1, 0, 0, 0, 0, 34, 0, 84, 1, 0, 0, 86, 1, 0, 0, 0, 0, 34, 0,207, 0, 0, 0, - 84, 1, 0, 0, 0, 0, 34, 0,213, 0, 0, 0, 86, 1, 0, 0, 0, 0, 34, 0, 67, 1, 0, 0, 83, 1, 0, 0, 0, 0, 34, 0, - 68, 1, 0, 0, 84, 1, 0, 0, 0, 0, 34, 0, 85, 1, 0, 0, 87, 1, 0, 0, 0, 0, 34, 0, 77, 0, 0, 0, 87, 1, 0, 0, - 0, 0, 34, 0, 78, 0, 0, 0, 88, 1, 0, 0, 0, 0, 34, 0, 86, 1, 0, 0, 88, 1, 0, 0, 0, 0, 34, 0, 41, 1, 0, 0, - 87, 1, 0, 0, 0, 0, 34, 0, 42, 1, 0, 0, 88, 1, 0, 0, 0, 0, 34, 0, 75, 0, 0, 0, 65, 1, 0, 0, 0, 0, 34, 0, - 65, 1, 0, 0, 93, 1, 0, 0, 0, 0, 34, 0, 45, 1, 0, 0, 93, 1, 0, 0, 0, 0, 39, 0, 75, 0, 0, 0, 45, 1, 0, 0, - 0, 0, 38, 0, 66, 1, 0, 0, 94, 1, 0, 0, 0, 0, 34, 0, 75, 0, 0, 0, 66, 1, 0, 0, 0, 0, 34, 0, 45, 1, 0, 0, - 94, 1, 0, 0, 0, 0, 39, 0, 91, 1, 0, 0, 93, 1, 0, 0, 0, 0, 34, 0, 76, 0, 0, 0, 91, 1, 0, 0, 0, 0, 34, 0, - 76, 0, 0, 0, 45, 1, 0, 0, 0, 0, 38, 0, 92, 1, 0, 0, 94, 1, 0, 0, 0, 0, 34, 0, 76, 0, 0, 0, 92, 1, 0, 0, - 0, 0, 34, 0, 89, 1, 0, 0, 91, 1, 0, 0, 0, 0, 34, 0, 46, 1, 0, 0, 89, 1, 0, 0, 0, 0, 34, 0, 76, 0, 0, 0, - 46, 1, 0, 0, 0, 0, 38, 0, 90, 1, 0, 0, 92, 1, 0, 0, 0, 0, 34, 0, 46, 1, 0, 0, 90, 1, 0, 0, 0, 0, 34, 0, - 69, 1, 0, 0, 89, 1, 0, 0, 0, 0, 34, 0, 46, 1, 0, 0, 50, 1, 0, 0, 0, 0, 38, 0, 70, 1, 0, 0, 90, 1, 0, 0, - 0, 0, 34, 0, 83, 1, 0, 0, 89, 1, 0, 0, 0, 0, 34, 0, 84, 1, 0, 0, 90, 1, 0, 0, 0, 0, 34, 0, 39, 1, 0, 0, - 59, 1, 0, 0, 0, 0, 34, 0, 51, 1, 0, 0, 59, 1, 0, 0, 0, 0, 34, 0, 37, 1, 0, 0, 51, 1, 0, 0, 0, 0, 34, 0, - 40, 1, 0, 0, 60, 1, 0, 0, 0, 0, 34, 0, 38, 1, 0, 0, 52, 1, 0, 0, 0, 0, 34, 0, 52, 1, 0, 0, 60, 1, 0, 0, - 0, 0, 34, 0, 74, 0, 0, 0, 57, 1, 0, 0, 0, 0, 39, 0, 57, 1, 0, 0, 65, 1, 0, 0, 0, 0, 34, 0, 74, 0, 0, 0, - 75, 0, 0, 0, 0, 0, 38, 0, 58, 1, 0, 0, 66, 1, 0, 0, 0, 0, 34, 0, 74, 0, 0, 0, 58, 1, 0, 0, 0, 0, 39, 0, - 43, 1, 0, 0, 99, 1, 0, 0, 0, 0, 34, 0, 97, 1, 0, 0, 99, 1, 0, 0, 0, 0, 34, 0, 44, 1, 0, 0, 97, 1, 0, 0, - 0, 0, 34, 0, 43, 1, 0, 0, 44, 1, 0, 0, 0, 0, 38, 0, 98, 1, 0, 0,100, 1, 0, 0, 0, 0, 34, 0, 43, 1, 0, 0, -100, 1, 0, 0, 0, 0, 34, 0, 44, 1, 0, 0, 98, 1, 0, 0, 0, 0, 34, 0, 95, 1, 0, 0, 97, 1, 0, 0, 0, 0, 34, 0, - 73, 0, 0, 0, 95, 1, 0, 0, 0, 0, 34, 0, 73, 0, 0, 0, 44, 1, 0, 0, 0, 0, 38, 0, 96, 1, 0, 0, 98, 1, 0, 0, - 0, 0, 34, 0, 73, 0, 0, 0, 96, 1, 0, 0, 0, 0, 34, 0, 57, 1, 0, 0, 95, 1, 0, 0, 0, 0, 34, 0, 73, 0, 0, 0, - 74, 0, 0, 0, 0, 0, 38, 0, 58, 1, 0, 0, 96, 1, 0, 0, 0, 0, 34, 0, 35, 1, 0, 0,103, 1, 0, 0, 0, 0, 34, 0, -103, 1, 0, 0,105, 1, 0, 0, 0, 0, 34, 0, 33, 1, 0, 0,105, 1, 0, 0, 0, 0, 34, 0, 36, 1, 0, 0,104, 1, 0, 0, - 0, 0, 34, 0, 34, 1, 0, 0,106, 1, 0, 0, 0, 0, 34, 0,104, 1, 0, 0,106, 1, 0, 0, 0, 0, 34, 0,103, 1, 0, 0, -109, 1, 0, 0, 0, 0, 34, 0,107, 1, 0, 0,109, 1, 0, 0, 0, 0, 34, 0,105, 1, 0, 0,107, 1, 0, 0, 0, 0, 34, 0, -104, 1, 0, 0,110, 1, 0, 0, 0, 0, 34, 0,106, 1, 0, 0,108, 1, 0, 0, 0, 0, 34, 0,108, 1, 0, 0,110, 1, 0, 0, - 0, 0, 34, 0,109, 1, 0, 0,111, 1, 0, 0, 0, 0, 34, 0,111, 1, 0, 0,113, 1, 0, 0, 0, 0, 34, 0,107, 1, 0, 0, -113, 1, 0, 0, 0, 0, 34, 0,110, 1, 0, 0,112, 1, 0, 0, 0, 0, 34, 0,108, 1, 0, 0,114, 1, 0, 0, 0, 0, 34, 0, -112, 1, 0, 0,114, 1, 0, 0, 0, 0, 34, 0,111, 1, 0, 0,117, 1, 0, 0, 0, 0, 34, 0,115, 1, 0, 0,117, 1, 0, 0, - 0, 0, 34, 0,113, 1, 0, 0,115, 1, 0, 0, 0, 0, 34, 0,112, 1, 0, 0,118, 1, 0, 0, 0, 0, 34, 0,114, 1, 0, 0, -116, 1, 0, 0, 0, 0, 34, 0,116, 1, 0, 0,118, 1, 0, 0, 0, 0, 34, 0, 55, 1, 0, 0,119, 1, 0, 0, 0, 0, 39, 0, -115, 1, 0, 0,119, 1, 0, 0, 0, 0, 34, 0, 55, 1, 0, 0,117, 1, 0, 0, 0, 0, 34, 0,116, 1, 0, 0,120, 1, 0, 0, - 0, 0, 34, 0, 56, 1, 0, 0,120, 1, 0, 0, 0, 0, 39, 0, 56, 1, 0, 0,118, 1, 0, 0, 0, 0, 34, 0, 95, 1, 0, 0, -115, 1, 0, 0, 0, 0, 34, 0, 57, 1, 0, 0,119, 1, 0, 0, 0, 0, 39, 0, 96, 1, 0, 0,116, 1, 0, 0, 0, 0, 34, 0, - 58, 1, 0, 0,120, 1, 0, 0, 0, 0, 39, 0, 97, 1, 0, 0,113, 1, 0, 0, 0, 0, 34, 0, 98, 1, 0, 0,114, 1, 0, 0, - 0, 0, 34, 0, 99, 1, 0, 0,107, 1, 0, 0, 0, 0, 34, 0,100, 1, 0, 0,108, 1, 0, 0, 0, 0, 34, 0, 99, 1, 0, 0, -101, 1, 0, 0, 0, 0, 34, 0,101, 1, 0, 0,105, 1, 0, 0, 0, 0, 34, 0,102, 1, 0, 0,106, 1, 0, 0, 0, 0, 34, 0, -100, 1, 0, 0,102, 1, 0, 0, 0, 0, 34, 0, 31, 1, 0, 0,101, 1, 0, 0, 0, 0, 34, 0, 32, 1, 0, 0,102, 1, 0, 0, - 0, 0, 34, 0, 72, 0, 0, 0,101, 1, 0, 0, 0, 0, 34, 0, 72, 0, 0, 0, 43, 1, 0, 0, 0, 0, 38, 0, 72, 0, 0, 0, -102, 1, 0, 0, 0, 0, 34, 0, 25, 1, 0, 0, 31, 1, 0, 0, 0, 0, 38, 0, 26, 1, 0, 0, 32, 1, 0, 0, 0, 0, 38, 0, - 72, 0, 0, 0, 25, 1, 0, 0, 0, 0, 34, 0, 72, 0, 0, 0, 26, 1, 0, 0, 0, 0, 34, 0, 71, 0, 0, 0, 72, 0, 0, 0, - 0, 0, 38, 0, 51, 1, 0, 0,103, 1, 0, 0, 0, 0, 34, 0, 52, 1, 0, 0,104, 1, 0, 0, 0, 0, 34, 0, 51, 1, 0, 0, - 53, 1, 0, 0, 0, 0, 34, 0, 53, 1, 0, 0,109, 1, 0, 0, 0, 0, 34, 0, 54, 1, 0, 0,110, 1, 0, 0, 0, 0, 34, 0, - 52, 1, 0, 0, 54, 1, 0, 0, 0, 0, 34, 0, 53, 1, 0, 0,123, 1, 0, 0, 0, 0, 34, 0,111, 1, 0, 0,123, 1, 0, 0, - 0, 0, 34, 0,112, 1, 0, 0,124, 1, 0, 0, 0, 0, 34, 0, 54, 1, 0, 0,124, 1, 0, 0, 0, 0, 34, 0, 55, 1, 0, 0, -123, 1, 0, 0, 0, 0, 34, 0, 56, 1, 0, 0,124, 1, 0, 0, 0, 0, 34, 0, 91, 1, 0, 0,127, 1, 0, 0, 0, 0, 34, 0, -125, 1, 0, 0,127, 1, 0, 0, 0, 0, 34, 0, 89, 1, 0, 0,125, 1, 0, 0, 0, 0, 34, 0, 92, 1, 0, 0,128, 1, 0, 0, - 0, 0, 34, 0, 90, 1, 0, 0,126, 1, 0, 0, 0, 0, 34, 0,126, 1, 0, 0,128, 1, 0, 0, 0, 0, 34, 0, 59, 1, 0, 0, -125, 1, 0, 0, 0, 0, 34, 0, 61, 1, 0, 0,127, 1, 0, 0, 0, 0, 34, 0, 59, 1, 0, 0, 61, 1, 0, 0, 0, 0, 34, 0, - 60, 1, 0, 0,126, 1, 0, 0, 0, 0, 34, 0, 60, 1, 0, 0, 62, 1, 0, 0, 0, 0, 34, 0, 62, 1, 0, 0,128, 1, 0, 0, - 0, 0, 34, 0, 41, 1, 0, 0,125, 1, 0, 0, 0, 0, 34, 0, 42, 1, 0, 0,126, 1, 0, 0, 0, 0, 34, 0, 41, 1, 0, 0, - 85, 1, 0, 0, 0, 0, 34, 0, 83, 1, 0, 0,125, 1, 0, 0, 0, 0, 34, 0, 42, 1, 0, 0, 86, 1, 0, 0, 0, 0, 34, 0, - 84, 1, 0, 0,126, 1, 0, 0, 0, 0, 34, 0, 55, 1, 0, 0, 63, 1, 0, 0, 0, 0, 34, 0, 63, 1, 0, 0,121, 1, 0, 0, - 0, 0, 39, 0,119, 1, 0, 0,121, 1, 0, 0, 0, 0, 34, 0, 64, 1, 0, 0,122, 1, 0, 0, 0, 0, 39, 0, 56, 1, 0, 0, - 64, 1, 0, 0, 0, 0, 34, 0,120, 1, 0, 0,122, 1, 0, 0, 0, 0, 34, 0, 65, 1, 0, 0,121, 1, 0, 0, 0, 0, 34, 0, - 66, 1, 0, 0,122, 1, 0, 0, 0, 0, 34, 0,121, 1, 0, 0,127, 1, 0, 0, 0, 0, 34, 0, 61, 1, 0, 0, 63, 1, 0, 0, - 0, 0, 34, 0,122, 1, 0, 0,128, 1, 0, 0, 0, 0, 34, 0, 62, 1, 0, 0, 64, 1, 0, 0, 0, 0, 34, 0, 93, 1, 0, 0, -121, 1, 0, 0, 0, 0, 39, 0, 94, 1, 0, 0,122, 1, 0, 0, 0, 0, 39, 0,129, 1, 0, 0,141, 1, 0, 0, 0, 0, 34, 0, -129, 1, 0, 0,155, 1, 0, 0, 0, 0, 34, 0,143, 1, 0, 0,155, 1, 0, 0, 0, 0, 34, 0,141, 1, 0, 0,143, 1, 0, 0, - 0, 0, 34, 0,130, 1, 0, 0,156, 1, 0, 0, 0, 0, 34, 0,130, 1, 0, 0,142, 1, 0, 0, 0, 0, 34, 0,142, 1, 0, 0, -144, 1, 0, 0, 0, 0, 34, 0,144, 1, 0, 0,156, 1, 0, 0, 0, 0, 34, 0,143, 1, 0, 0,145, 1, 0, 0, 0, 0, 34, 0, -139, 1, 0, 0,145, 1, 0, 0, 0, 0, 34, 0,139, 1, 0, 0,141, 1, 0, 0, 0, 0, 34, 0,144, 1, 0, 0,146, 1, 0, 0, - 0, 0, 34, 0,140, 1, 0, 0,142, 1, 0, 0, 0, 0, 34, 0,140, 1, 0, 0,146, 1, 0, 0, 0, 0, 34, 0,145, 1, 0, 0, -147, 1, 0, 0, 0, 0, 34, 0,137, 1, 0, 0,147, 1, 0, 0, 0, 0, 34, 0,137, 1, 0, 0,139, 1, 0, 0, 0, 0, 34, 0, -146, 1, 0, 0,148, 1, 0, 0, 0, 0, 34, 0,138, 1, 0, 0,140, 1, 0, 0, 0, 0, 34, 0,138, 1, 0, 0,148, 1, 0, 0, - 0, 0, 34, 0,147, 1, 0, 0,149, 1, 0, 0, 0, 0, 34, 0,135, 1, 0, 0,149, 1, 0, 0, 0, 0, 34, 0,135, 1, 0, 0, -137, 1, 0, 0, 0, 0, 34, 0,148, 1, 0, 0,150, 1, 0, 0, 0, 0, 34, 0,136, 1, 0, 0,138, 1, 0, 0, 0, 0, 34, 0, -136, 1, 0, 0,150, 1, 0, 0, 0, 0, 34, 0,149, 1, 0, 0,151, 1, 0, 0, 0, 0, 34, 0,133, 1, 0, 0,151, 1, 0, 0, - 0, 0, 34, 0,133, 1, 0, 0,135, 1, 0, 0, 0, 0, 34, 0,150, 1, 0, 0,152, 1, 0, 0, 0, 0, 34, 0,134, 1, 0, 0, -136, 1, 0, 0, 0, 0, 34, 0,134, 1, 0, 0,152, 1, 0, 0, 0, 0, 34, 0,151, 1, 0, 0,153, 1, 0, 0, 0, 0, 34, 0, -131, 1, 0, 0,153, 1, 0, 0, 0, 0, 34, 0,131, 1, 0, 0,133, 1, 0, 0, 0, 0, 34, 0,152, 1, 0, 0,154, 1, 0, 0, - 0, 0, 34, 0,132, 1, 0, 0,134, 1, 0, 0, 0, 0, 34, 0,132, 1, 0, 0,154, 1, 0, 0, 0, 0, 34, 0,151, 1, 0, 0, -161, 1, 0, 0, 0, 0, 34, 0,159, 1, 0, 0,161, 1, 0, 0, 0, 0, 34, 0,153, 1, 0, 0,159, 1, 0, 0, 0, 0, 34, 0, -160, 1, 0, 0,162, 1, 0, 0, 0, 0, 34, 0,152, 1, 0, 0,162, 1, 0, 0, 0, 0, 34, 0,154, 1, 0, 0,160, 1, 0, 0, - 0, 0, 34, 0,149, 1, 0, 0,163, 1, 0, 0, 0, 0, 34, 0,161, 1, 0, 0,163, 1, 0, 0, 0, 0, 34, 0,162, 1, 0, 0, -164, 1, 0, 0, 0, 0, 34, 0,150, 1, 0, 0,164, 1, 0, 0, 0, 0, 34, 0,147, 1, 0, 0,165, 1, 0, 0, 0, 0, 34, 0, -163, 1, 0, 0,165, 1, 0, 0, 0, 0, 34, 0,164, 1, 0, 0,166, 1, 0, 0, 0, 0, 34, 0,148, 1, 0, 0,166, 1, 0, 0, - 0, 0, 34, 0,145, 1, 0, 0,167, 1, 0, 0, 0, 0, 34, 0,165, 1, 0, 0,167, 1, 0, 0, 0, 0, 34, 0,166, 1, 0, 0, -168, 1, 0, 0, 0, 0, 34, 0,146, 1, 0, 0,168, 1, 0, 0, 0, 0, 34, 0,143, 1, 0, 0,169, 1, 0, 0, 0, 0, 34, 0, -167, 1, 0, 0,169, 1, 0, 0, 0, 0, 34, 0,168, 1, 0, 0,170, 1, 0, 0, 0, 0, 34, 0,144, 1, 0, 0,170, 1, 0, 0, - 0, 0, 34, 0,155, 1, 0, 0,157, 1, 0, 0, 0, 0, 34, 0,157, 1, 0, 0,169, 1, 0, 0, 0, 0, 34, 0,156, 1, 0, 0, -158, 1, 0, 0, 0, 0, 34, 0,158, 1, 0, 0,170, 1, 0, 0, 0, 0, 34, 0, 61, 1, 0, 0,185, 1, 0, 0, 0, 0, 34, 0, -183, 1, 0, 0,185, 1, 0, 0, 0, 0, 34, 0, 59, 1, 0, 0,183, 1, 0, 0, 0, 0, 34, 0, 62, 1, 0, 0,186, 1, 0, 0, - 0, 0, 34, 0, 60, 1, 0, 0,184, 1, 0, 0, 0, 0, 34, 0,184, 1, 0, 0,186, 1, 0, 0, 0, 0, 34, 0, 61, 1, 0, 0, -131, 1, 0, 0, 0, 0, 34, 0,153, 1, 0, 0,185, 1, 0, 0, 0, 0, 34, 0, 62, 1, 0, 0,132, 1, 0, 0, 0, 0, 34, 0, -154, 1, 0, 0,186, 1, 0, 0, 0, 0, 34, 0, 53, 1, 0, 0,183, 1, 0, 0, 0, 0, 34, 0, 54, 1, 0, 0,184, 1, 0, 0, - 0, 0, 34, 0,123, 1, 0, 0,171, 1, 0, 0, 0, 0, 34, 0,155, 1, 0, 0,171, 1, 0, 0, 0, 0, 34, 0,123, 1, 0, 0, -129, 1, 0, 0, 0, 0, 34, 0,156, 1, 0, 0,172, 1, 0, 0, 0, 0, 34, 0,124, 1, 0, 0,172, 1, 0, 0, 0, 0, 34, 0, -124, 1, 0, 0,130, 1, 0, 0, 0, 0, 34, 0,159, 1, 0, 0,181, 1, 0, 0, 0, 0, 34, 0,181, 1, 0, 0,185, 1, 0, 0, - 0, 0, 34, 0,160, 1, 0, 0,182, 1, 0, 0, 0, 0, 34, 0,182, 1, 0, 0,186, 1, 0, 0, 0, 0, 34, 0,179, 1, 0, 0, -187, 1, 0, 0, 0, 0, 34, 0,185, 1, 0, 0,187, 1, 0, 0, 0, 0, 34, 0,179, 1, 0, 0,181, 1, 0, 0, 0, 0, 34, 0, -186, 1, 0, 0,188, 1, 0, 0, 0, 0, 34, 0,180, 1, 0, 0,188, 1, 0, 0, 0, 0, 34, 0,180, 1, 0, 0,182, 1, 0, 0, - 0, 0, 34, 0,175, 1, 0, 0,187, 1, 0, 0, 0, 0, 34, 0,177, 1, 0, 0,179, 1, 0, 0, 0, 0, 34, 0,175, 1, 0, 0, -177, 1, 0, 0, 0, 0, 34, 0,176, 1, 0, 0,188, 1, 0, 0, 0, 0, 34, 0,176, 1, 0, 0,178, 1, 0, 0, 0, 0, 34, 0, -178, 1, 0, 0,180, 1, 0, 0, 0, 0, 34, 0,173, 1, 0, 0,189, 1, 0, 0, 0, 0, 34, 0,187, 1, 0, 0,189, 1, 0, 0, - 0, 0, 34, 0,173, 1, 0, 0,175, 1, 0, 0, 0, 0, 34, 0,188, 1, 0, 0,190, 1, 0, 0, 0, 0, 34, 0,174, 1, 0, 0, -190, 1, 0, 0, 0, 0, 34, 0,174, 1, 0, 0,176, 1, 0, 0, 0, 0, 34, 0,171, 1, 0, 0,189, 1, 0, 0, 0, 0, 34, 0, -173, 1, 0, 0,191, 1, 0, 0, 0, 0, 34, 0,171, 1, 0, 0,191, 1, 0, 0, 0, 0, 32, 0,172, 1, 0, 0,190, 1, 0, 0, - 0, 0, 34, 0,172, 1, 0, 0,192, 1, 0, 0, 0, 0, 32, 0,174, 1, 0, 0,192, 1, 0, 0, 0, 0, 34, 0,157, 1, 0, 0, -191, 1, 0, 0, 0, 0, 34, 0,158, 1, 0, 0,192, 1, 0, 0, 0, 0, 34, 0, 53, 1, 0, 0,189, 1, 0, 0, 0, 0, 34, 0, - 54, 1, 0, 0,190, 1, 0, 0, 0, 0, 34, 0,183, 1, 0, 0,187, 1, 0, 0, 0, 0, 34, 0,184, 1, 0, 0,188, 1, 0, 0, - 0, 0, 34, 0,191, 1, 0, 0,193, 1, 0, 0, 0, 0, 34, 0,193, 1, 0, 0,217, 1, 0, 0, 0, 0, 34, 0,157, 1, 0, 0, -217, 1, 0, 0, 0, 0, 34, 0,192, 1, 0, 0,194, 1, 0, 0, 0, 0, 34, 0,158, 1, 0, 0,218, 1, 0, 0, 0, 0, 34, 0, -194, 1, 0, 0,218, 1, 0, 0, 0, 0, 34, 0,173, 1, 0, 0,203, 1, 0, 0, 0, 0, 34, 0,193, 1, 0, 0,203, 1, 0, 0, - 0, 0, 34, 0,174, 1, 0, 0,204, 1, 0, 0, 0, 0, 34, 0,194, 1, 0, 0,204, 1, 0, 0, 0, 0, 34, 0,175, 1, 0, 0, -201, 1, 0, 0, 0, 0, 34, 0,201, 1, 0, 0,203, 1, 0, 0, 0, 0, 34, 0,176, 1, 0, 0,202, 1, 0, 0, 0, 0, 34, 0, -202, 1, 0, 0,204, 1, 0, 0, 0, 0, 34, 0,177, 1, 0, 0,199, 1, 0, 0, 0, 0, 34, 0,199, 1, 0, 0,201, 1, 0, 0, - 0, 0, 34, 0,178, 1, 0, 0,200, 1, 0, 0, 0, 0, 34, 0,200, 1, 0, 0,202, 1, 0, 0, 0, 0, 34, 0,179, 1, 0, 0, -197, 1, 0, 0, 0, 0, 34, 0,197, 1, 0, 0,199, 1, 0, 0, 0, 0, 34, 0,180, 1, 0, 0,198, 1, 0, 0, 0, 0, 34, 0, -198, 1, 0, 0,200, 1, 0, 0, 0, 0, 34, 0,181, 1, 0, 0,195, 1, 0, 0, 0, 0, 34, 0,195, 1, 0, 0,197, 1, 0, 0, - 0, 0, 34, 0,182, 1, 0, 0,196, 1, 0, 0, 0, 0, 34, 0,196, 1, 0, 0,198, 1, 0, 0, 0, 0, 34, 0,159, 1, 0, 0, -215, 1, 0, 0, 0, 0, 34, 0,195, 1, 0, 0,215, 1, 0, 0, 0, 0, 34, 0,160, 1, 0, 0,216, 1, 0, 0, 0, 0, 34, 0, -196, 1, 0, 0,216, 1, 0, 0, 0, 0, 34, 0,205, 1, 0, 0,217, 1, 0, 0, 0, 0, 34, 0,169, 1, 0, 0,205, 1, 0, 0, - 0, 0, 34, 0,170, 1, 0, 0,206, 1, 0, 0, 0, 0, 34, 0,206, 1, 0, 0,218, 1, 0, 0, 0, 0, 34, 0,205, 1, 0, 0, -207, 1, 0, 0, 0, 0, 34, 0,167, 1, 0, 0,207, 1, 0, 0, 0, 0, 34, 0,168, 1, 0, 0,208, 1, 0, 0, 0, 0, 34, 0, -206, 1, 0, 0,208, 1, 0, 0, 0, 0, 34, 0,207, 1, 0, 0,209, 1, 0, 0, 0, 0, 34, 0,165, 1, 0, 0,209, 1, 0, 0, - 0, 0, 34, 0,166, 1, 0, 0,210, 1, 0, 0, 0, 0, 34, 0,208, 1, 0, 0,210, 1, 0, 0, 0, 0, 34, 0,209, 1, 0, 0, -211, 1, 0, 0, 0, 0, 34, 0,163, 1, 0, 0,211, 1, 0, 0, 0, 0, 34, 0,164, 1, 0, 0,212, 1, 0, 0, 0, 0, 34, 0, -210, 1, 0, 0,212, 1, 0, 0, 0, 0, 34, 0,211, 1, 0, 0,213, 1, 0, 0, 0, 0, 34, 0,161, 1, 0, 0,213, 1, 0, 0, - 0, 0, 34, 0,162, 1, 0, 0,214, 1, 0, 0, 0, 0, 34, 0,212, 1, 0, 0,214, 1, 0, 0, 0, 0, 34, 0,213, 1, 0, 0, -215, 1, 0, 0, 0, 0, 34, 0,214, 1, 0, 0,216, 1, 0, 0, 0, 0, 34, 0,197, 1, 0, 0,221, 1, 0, 0, 0, 0, 34, 0, -219, 1, 0, 0,221, 1, 0, 0, 0, 0, 34, 0,199, 1, 0, 0,219, 1, 0, 0, 0, 0, 34, 0,198, 1, 0, 0,222, 1, 0, 0, - 0, 0, 34, 0,200, 1, 0, 0,220, 1, 0, 0, 0, 0, 34, 0,220, 1, 0, 0,222, 1, 0, 0, 0, 0, 34, 0,221, 1, 0, 0, -223, 1, 0, 0, 0, 0, 34, 0,223, 1, 0, 0,225, 1, 0, 0, 0, 0, 32, 0,219, 1, 0, 0,225, 1, 0, 0, 0, 0, 34, 0, -222, 1, 0, 0,224, 1, 0, 0, 0, 0, 34, 0,220, 1, 0, 0,226, 1, 0, 0, 0, 0, 34, 0,224, 1, 0, 0,226, 1, 0, 0, - 0, 0, 32, 0,223, 1, 0, 0,229, 1, 0, 0, 0, 0, 34, 0,227, 1, 0, 0,229, 1, 0, 0, 0, 0, 34, 0,225, 1, 0, 0, -227, 1, 0, 0, 0, 0, 34, 0,224, 1, 0, 0,230, 1, 0, 0, 0, 0, 34, 0,226, 1, 0, 0,228, 1, 0, 0, 0, 0, 34, 0, -228, 1, 0, 0,230, 1, 0, 0, 0, 0, 34, 0,229, 1, 0, 0,231, 1, 0, 0, 0, 0, 34, 0,231, 1, 0, 0,233, 1, 0, 0, - 0, 0, 34, 0,227, 1, 0, 0,233, 1, 0, 0, 0, 0, 34, 0,230, 1, 0, 0,232, 1, 0, 0, 0, 0, 34, 0,228, 1, 0, 0, -234, 1, 0, 0, 0, 0, 34, 0,232, 1, 0, 0,234, 1, 0, 0, 0, 0, 34, 0,217, 1, 0, 0,227, 1, 0, 0, 0, 0, 34, 0, -205, 1, 0, 0,233, 1, 0, 0, 0, 0, 34, 0,218, 1, 0, 0,228, 1, 0, 0, 0, 0, 34, 0,206, 1, 0, 0,234, 1, 0, 0, - 0, 0, 34, 0,193, 1, 0, 0,225, 1, 0, 0, 0, 0, 34, 0,194, 1, 0, 0,226, 1, 0, 0, 0, 0, 34, 0,203, 1, 0, 0, -219, 1, 0, 0, 0, 0, 34, 0,204, 1, 0, 0,220, 1, 0, 0, 0, 0, 34, 0,215, 1, 0, 0,221, 1, 0, 0, 0, 0, 34, 0, -216, 1, 0, 0,222, 1, 0, 0, 0, 0, 34, 0,213, 1, 0, 0,223, 1, 0, 0, 0, 0, 34, 0,214, 1, 0, 0,224, 1, 0, 0, - 0, 0, 34, 0,211, 1, 0, 0,229, 1, 0, 0, 0, 0, 34, 0,212, 1, 0, 0,230, 1, 0, 0, 0, 0, 34, 0,209, 1, 0, 0, -231, 1, 0, 0, 0, 0, 34, 0,210, 1, 0, 0,232, 1, 0, 0, 0, 0, 34, 0,207, 1, 0, 0,233, 1, 0, 0, 0, 0, 34, 0, -208, 1, 0, 0,234, 1, 0, 0, 0, 0, 34, 0,131, 1, 0, 0,245, 1, 0, 0, 0, 0, 34, 0,243, 1, 0, 0,245, 1, 0, 0, - 0, 0, 39, 0,133, 1, 0, 0,243, 1, 0, 0, 0, 0, 34, 0,132, 1, 0, 0,246, 1, 0, 0, 0, 0, 34, 0,134, 1, 0, 0, -244, 1, 0, 0, 0, 0, 34, 0,244, 1, 0, 0,246, 1, 0, 0, 0, 0, 39, 0,241, 1, 0, 0,243, 1, 0, 0, 0, 0, 39, 0, -135, 1, 0, 0,241, 1, 0, 0, 0, 0, 34, 0,136, 1, 0, 0,242, 1, 0, 0, 0, 0, 34, 0,242, 1, 0, 0,244, 1, 0, 0, - 0, 0, 39, 0,239, 1, 0, 0,241, 1, 0, 0, 0, 0, 39, 0,137, 1, 0, 0,239, 1, 0, 0, 0, 0, 34, 0,138, 1, 0, 0, -240, 1, 0, 0, 0, 0, 34, 0,240, 1, 0, 0,242, 1, 0, 0, 0, 0, 39, 0,237, 1, 0, 0,239, 1, 0, 0, 0, 0, 39, 0, -139, 1, 0, 0,237, 1, 0, 0, 0, 0, 34, 0,140, 1, 0, 0,238, 1, 0, 0, 0, 0, 34, 0,238, 1, 0, 0,240, 1, 0, 0, - 0, 0, 39, 0,235, 1, 0, 0,237, 1, 0, 0, 0, 0, 39, 0,141, 1, 0, 0,235, 1, 0, 0, 0, 0, 34, 0,142, 1, 0, 0, -236, 1, 0, 0, 0, 0, 34, 0,236, 1, 0, 0,238, 1, 0, 0, 0, 0, 39, 0,235, 1, 0, 0,247, 1, 0, 0, 0, 0, 39, 0, -129, 1, 0, 0,247, 1, 0, 0, 0, 0, 34, 0,130, 1, 0, 0,248, 1, 0, 0, 0, 0, 34, 0,236, 1, 0, 0,248, 1, 0, 0, - 0, 0, 39, 0,235, 1, 0, 0,243, 1, 0, 0, 0, 0, 34, 0,245, 1, 0, 0,247, 1, 0, 0, 0, 0, 34, 0,236, 1, 0, 0, -244, 1, 0, 0, 0, 0, 34, 0,246, 1, 0, 0,248, 1, 0, 0, 0, 0, 34, 0,237, 1, 0, 0,241, 1, 0, 0, 0, 0, 34, 0, -238, 1, 0, 0,242, 1, 0, 0, 0, 0, 34, 0, 55, 1, 0, 0,247, 1, 0, 0, 0, 0, 39, 0, 56, 1, 0, 0,248, 1, 0, 0, - 0, 0, 39, 0, 63, 1, 0, 0,245, 1, 0, 0, 0, 0, 39, 0, 64, 1, 0, 0,246, 1, 0, 0, 0, 0, 39, 0, 14, 0, 0, 0, -249, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0,178, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0,113, 0, 0, 0, 0, 0, 34, 0, - 14, 0, 0, 0,161, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0,112, 0, 0, 0, 0, 0, 34, 0, 16, 0, 0, 0,112, 0, 0, 0, - 0, 0, 34, 0, 9, 0, 0, 0,112, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0,112, 0, 0, 0, 0, 0, 34, 0, 68, 65, 84, 65, - 64, 1, 0, 0, 64,222,116, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,223,116, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 7,117, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,101,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 16, 39, 0, 0,192,223,116, 1, - 0, 0, 0, 0, 52, 0, 0, 0,244, 1, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 1, - 3, 0, 0, 0, 1, 0, 0, 0, 46, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 1, 43, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, - 41, 0, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 3, 0, 0, 0, 44, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, - 8, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 1, 7, 0, 0, 0, 9, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 10, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 9, 0, 0, 0, 11, 0, 0, 0, - 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 1, 10, 0, 0, 0, 12, 0, 0, 0, 14, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, -112, 0, 0, 0, 13, 0, 0, 0, 11, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 1, 8, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 1, 16, 0, 0, 0,112, 0, 0, 0, 9, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 1, 14, 0, 0, 0, - 19, 0, 0, 0, 17, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 1, 18, 0, 0, 0, 20, 0, 0, 0,112, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 1, 12, 0, 0, 0, 21, 0, 0, 0, 19, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 1, 20, 0, 0, 0, 22, 0, 0, 0, - 13, 0, 0, 0,112, 0, 0, 0, 0, 0, 0, 1, 21, 0, 0, 0, 23, 0, 0, 0, 25, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 1, - 26, 0, 0, 0, 24, 0, 0, 0, 22, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 19, 0, 0, 0, 25, 0, 0, 0, 27, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 1, 28, 0, 0, 0, 26, 0, 0, 0, 20, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 1, 25, 0, 0, 0, - 31, 0, 0, 0, 29, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 1, 30, 0, 0, 0, 32, 0, 0, 0, 26, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 1, 23, 0, 0, 0, 33, 0, 0, 0, 31, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 1, 32, 0, 0, 0, 34, 0, 0, 0, - 24, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 1, 33, 0, 0, 0, 35, 0, 0, 0, 37, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 1, - 38, 0, 0, 0, 36, 0, 0, 0, 34, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 1, 31, 0, 0, 0, 37, 0, 0, 0, 39, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 0, 1, 40, 0, 0, 0, 38, 0, 0, 0, 32, 0, 0, 0, 30, 0, 0, 0, 0, 0, 0, 1, 37, 0, 0, 0, - 43, 0, 0, 0, 41, 0, 0, 0, 39, 0, 0, 0, 0, 0, 0, 1, 42, 0, 0, 0, 44, 0, 0, 0, 38, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 1, 35, 0, 0, 0, 45, 0, 0, 0, 43, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 1, 44, 0, 0, 0, 46, 0, 0, 0, - 36, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 1, 45, 0, 0, 0, 35, 0, 0, 0, 49, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, - 50, 0, 0, 0, 36, 0, 0, 0, 46, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 1, 35, 0, 0, 0, 33, 0, 0, 0, 51, 0, 0, 0, - 49, 0, 0, 0, 0, 0, 0, 1, 52, 0, 0, 0, 34, 0, 0, 0, 36, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 1, 33, 0, 0, 0, - 23, 0, 0, 0, 53, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 1, 54, 0, 0, 0, 24, 0, 0, 0, 34, 0, 0, 0, 52, 0, 0, 0, - 0, 0, 0, 1, 23, 0, 0, 0, 21, 0, 0, 0, 55, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 1, 56, 0, 0, 0, 22, 0, 0, 0, - 24, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 1, 21, 0, 0, 0, 12, 0, 0, 0, 57, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 1, - 58, 0, 0, 0, 13, 0, 0, 0, 22, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 1, 12, 0, 0, 0, 10, 0, 0, 0, 61, 0, 0, 0, - 57, 0, 0, 0, 0, 0, 0, 1, 62, 0, 0, 0, 11, 0, 0, 0, 13, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 1, 10, 0, 0, 0, - 0, 0, 0, 0, 63, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 1, 0, 0, 0, 11, 0, 0, 0, 62, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 45, 0, 0, 0, 47, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 1, 48, 0, 0, 0, 46, 0, 0, 0, - 1, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 1, 59, 0, 0, 0, 63, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 48, 0, 0, 0, 64, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 61, 0, 0, 0, 63, 0, 0, 0, 59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 60, 0, 0, 0, 64, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 59, 0, 0, 0, - 57, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 62, 0, 0, 0, 58, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 59, 0, 0, 0, 55, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 58, 0, 0, 0, 56, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 59, 0, 0, 0, 53, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 56, 0, 0, 0, 54, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 59, 0, 0, 0, 51, 0, 0, 0, 53, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 54, 0, 0, 0, 52, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 59, 0, 0, 0, - 49, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 52, 0, 0, 0, 50, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 59, 0, 0, 0, 47, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 50, 0, 0, 0, 48, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 87, 0, 0, 0,171, 0, 0, 0,173, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 1, -173, 0, 0, 0,172, 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0,169, 0, 0, 0,171, 0, 0, 0, - 87, 0, 0, 0, 0, 0, 0, 1,172, 0, 0, 0,170, 0, 0, 0, 86, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 1, 83, 0, 0, 0, -167, 0, 0, 0,169, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 1,170, 0, 0, 0,168, 0, 0, 0, 84, 0, 0, 0, 86, 0, 0, 0, - 0, 0, 0, 1, 81, 0, 0, 0,165, 0, 0, 0,167, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 1,168, 0, 0, 0,166, 0, 0, 0, - 82, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 1, 79, 0, 0, 0,163, 0, 0, 0,165, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, -166, 0, 0, 0,164, 0, 0, 0, 80, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 1, 77, 0, 0, 0, 90, 0, 0, 0,143, 0, 0, 0, -161, 0, 0, 0, 0, 0, 0, 1,144, 0, 0, 0, 91, 0, 0, 0, 78, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 1, 90, 0, 0, 0, - 92, 0, 0, 0,145, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 1,146, 0, 0, 0, 93, 0, 0, 0, 91, 0, 0, 0,144, 0, 0, 0, - 0, 0, 0, 1, 92, 0, 0, 0, 94, 0, 0, 0,147, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 1,148, 0, 0, 0, 95, 0, 0, 0, - 93, 0, 0, 0,146, 0, 0, 0, 0, 0, 0, 1, 94, 0, 0, 0, 96, 0, 0, 0,149, 0, 0, 0,147, 0, 0, 0, 0, 0, 0, 1, -150, 0, 0, 0, 97, 0, 0, 0, 95, 0, 0, 0,148, 0, 0, 0, 0, 0, 0, 1, 96, 0, 0, 0, 98, 0, 0, 0,151, 0, 0, 0, -149, 0, 0, 0, 0, 0, 0, 1,152, 0, 0, 0, 99, 0, 0, 0, 97, 0, 0, 0,150, 0, 0, 0, 0, 0, 0, 1, 98, 0, 0, 0, -100, 0, 0, 0,153, 0, 0, 0,151, 0, 0, 0, 0, 0, 0, 1,154, 0, 0, 0,101, 0, 0, 0, 99, 0, 0, 0,152, 0, 0, 0, - 0, 0, 0, 1,100, 0, 0, 0,102, 0, 0, 0,155, 0, 0, 0,153, 0, 0, 0, 0, 0, 0, 1,156, 0, 0, 0,103, 0, 0, 0, -101, 0, 0, 0,154, 0, 0, 0, 0, 0, 0, 1,102, 0, 0, 0,104, 0, 0, 0,157, 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 1, -158, 0, 0, 0,105, 0, 0, 0,103, 0, 0, 0,156, 0, 0, 0, 0, 0, 0, 1,104, 0, 0, 0,106, 0, 0, 0,159, 0, 0, 0, -157, 0, 0, 0, 0, 0, 0, 1,160, 0, 0, 0,107, 0, 0, 0,105, 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 1,106, 0, 0, 0, - 65, 0, 0, 0, 66, 0, 0, 0,159, 0, 0, 0, 0, 0, 0, 1, 66, 0, 0, 0, 65, 0, 0, 0,107, 0, 0, 0,160, 0, 0, 0, - 0, 0, 0, 1,108, 0, 0, 0,125, 0, 0, 0,157, 0, 0, 0,159, 0, 0, 0, 0, 0, 0, 1,158, 0, 0, 0,126, 0, 0, 0, -109, 0, 0, 0,160, 0, 0, 0, 0, 0, 0, 1,125, 0, 0, 0,176, 0, 0, 0,155, 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 1, -156, 0, 0, 0,177, 0, 0, 0,126, 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 1,123, 0, 0, 0,153, 0, 0, 0,155, 0, 0, 0, -176, 0, 0, 0, 0, 0, 0, 1,156, 0, 0, 0,154, 0, 0, 0,124, 0, 0, 0,177, 0, 0, 0, 0, 0, 0, 1,121, 0, 0, 0, -151, 0, 0, 0,153, 0, 0, 0,123, 0, 0, 0, 0, 0, 0, 1,154, 0, 0, 0,152, 0, 0, 0,122, 0, 0, 0,124, 0, 0, 0, - 0, 0, 0, 1,119, 0, 0, 0,149, 0, 0, 0,151, 0, 0, 0,121, 0, 0, 0, 0, 0, 0, 1,152, 0, 0, 0,150, 0, 0, 0, -120, 0, 0, 0,122, 0, 0, 0, 0, 0, 0, 1,117, 0, 0, 0,147, 0, 0, 0,149, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 1, -150, 0, 0, 0,148, 0, 0, 0,118, 0, 0, 0,120, 0, 0, 0, 0, 0, 0, 1,115, 0, 0, 0,145, 0, 0, 0,147, 0, 0, 0, -117, 0, 0, 0, 0, 0, 0, 1,148, 0, 0, 0,146, 0, 0, 0,116, 0, 0, 0,118, 0, 0, 0, 0, 0, 0, 1,113, 0, 0, 0, -143, 0, 0, 0,145, 0, 0, 0,115, 0, 0, 0, 0, 0, 0, 1,146, 0, 0, 0,144, 0, 0, 0,114, 0, 0, 0,116, 0, 0, 0, - 0, 0, 0, 1, 14, 0, 0, 0,161, 0, 0, 0,143, 0, 0, 0,113, 0, 0, 0, 0, 0, 0, 1,144, 0, 0, 0,162, 0, 0, 0, -112, 0, 0, 0,114, 0, 0, 0, 0, 0, 0, 1, 14, 0, 0, 0,178, 0, 0, 0,174, 0, 0, 0,161, 0, 0, 0, 0, 0, 0, 1, -174, 0, 0, 0,179, 0, 0, 0,112, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 1,108, 0, 0, 0,159, 0, 0, 0, 66, 0, 0, 0, -110, 0, 0, 0, 0, 0, 0, 1, 66, 0, 0, 0,160, 0, 0, 0,109, 0, 0, 0,111, 0, 0, 0, 0, 0, 0, 1,110, 0, 0, 0, - 66, 0, 0, 0,175, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 1,175, 0, 0, 0, 66, 0, 0, 0,111, 0, 0, 0,181, 0, 0, 0, - 0, 0, 0, 1,174, 0, 0, 0,178, 0, 0, 0,180, 0, 0, 0,175, 0, 0, 0, 0, 0, 0, 1,181, 0, 0, 0,179, 0, 0, 0, -174, 0, 0, 0,175, 0, 0, 0, 0, 0, 0, 1,132, 0, 0, 0,134, 0, 0, 0,173, 0, 0, 0,171, 0, 0, 0, 0, 0, 0, 1, -173, 0, 0, 0,134, 0, 0, 0,133, 0, 0, 0,172, 0, 0, 0, 0, 0, 0, 1,130, 0, 0, 0,132, 0, 0, 0,171, 0, 0, 0, -169, 0, 0, 0, 0, 0, 0, 1,172, 0, 0, 0,133, 0, 0, 0,131, 0, 0, 0,170, 0, 0, 0, 0, 0, 0, 1,128, 0, 0, 0, -130, 0, 0, 0,169, 0, 0, 0,167, 0, 0, 0, 0, 0, 0, 1,170, 0, 0, 0,131, 0, 0, 0,129, 0, 0, 0,168, 0, 0, 0, - 0, 0, 0, 1,163, 0, 0, 0,184, 0, 0, 0,182, 0, 0, 0,165, 0, 0, 0, 0, 0, 0, 1,183, 0, 0, 0,185, 0, 0, 0, -164, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 1,128, 0, 0, 0,167, 0, 0, 0,165, 0, 0, 0,182, 0, 0, 0, 0, 0, 0, 1, -166, 0, 0, 0,168, 0, 0, 0,129, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 1,141, 0, 0, 0,187, 0, 0, 0,186, 0, 0, 0, -184, 0, 0, 0, 0, 0, 0, 1,186, 0, 0, 0,187, 0, 0, 0,142, 0, 0, 0,185, 0, 0, 0, 0, 0, 0, 1,182, 0, 0, 0, -184, 0, 0, 0,186, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 1,186, 0, 0, 0,185, 0, 0, 0,183, 0, 0, 0, 67, 0, 0, 0, - 0, 0, 0, 1,127, 0, 0, 0,128, 0, 0, 0,182, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 1,183, 0, 0, 0,129, 0, 0, 0, -127, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 1,139, 0, 0, 0,190, 0, 0, 0,188, 0, 0, 0,141, 0, 0, 0, 0, 0, 0, 1, -189, 0, 0, 0,191, 0, 0, 0,140, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 1,137, 0, 0, 0,192, 0, 0, 0,190, 0, 0, 0, -139, 0, 0, 0, 0, 0, 0, 1,191, 0, 0, 0,193, 0, 0, 0,138, 0, 0, 0,140, 0, 0, 0, 0, 0, 0, 1,136, 0, 0, 0, -194, 0, 0, 0,192, 0, 0, 0,137, 0, 0, 0, 0, 0, 0, 1,193, 0, 0, 0,195, 0, 0, 0,136, 0, 0, 0,138, 0, 0, 0, - 0, 0, 0, 1,135, 0, 0, 0, 69, 0, 0, 0,194, 0, 0, 0,136, 0, 0, 0, 0, 0, 0, 1,195, 0, 0, 0, 69, 0, 0, 0, -135, 0, 0, 0,136, 0, 0, 0, 0, 0, 0, 1,187, 0, 0, 0,141, 0, 0, 0,188, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 1, -189, 0, 0, 0,142, 0, 0, 0,187, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 1, 68, 0, 0, 0,188, 0, 0, 0,203, 0, 0, 0, -205, 0, 0, 0, 0, 0, 0, 1,204, 0, 0, 0,189, 0, 0, 0, 68, 0, 0, 0,205, 0, 0, 0, 0, 0, 0, 1, 69, 0, 0, 0, -196, 0, 0, 0,197, 0, 0, 0,194, 0, 0, 0, 0, 0, 0, 1,198, 0, 0, 0,196, 0, 0, 0, 69, 0, 0, 0,195, 0, 0, 0, - 0, 0, 0, 1,194, 0, 0, 0,197, 0, 0, 0,199, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 1,200, 0, 0, 0,198, 0, 0, 0, -195, 0, 0, 0,193, 0, 0, 0, 0, 0, 0, 1,192, 0, 0, 0,199, 0, 0, 0,201, 0, 0, 0,190, 0, 0, 0, 0, 0, 0, 1, -202, 0, 0, 0,200, 0, 0, 0,193, 0, 0, 0,191, 0, 0, 0, 0, 0, 0, 1,190, 0, 0, 0,201, 0, 0, 0,203, 0, 0, 0, -188, 0, 0, 0, 0, 0, 0, 1,204, 0, 0, 0,202, 0, 0, 0,191, 0, 0, 0,189, 0, 0, 0, 0, 0, 0, 1,196, 0, 0, 0, -201, 0, 0, 0,199, 0, 0, 0,197, 0, 0, 0, 0, 0, 0, 1,200, 0, 0, 0,202, 0, 0, 0,196, 0, 0, 0,198, 0, 0, 0, - 0, 0, 0, 1,196, 0, 0, 0,205, 0, 0, 0,203, 0, 0, 0,201, 0, 0, 0, 0, 0, 0, 1,204, 0, 0, 0,205, 0, 0, 0, -196, 0, 0, 0,202, 0, 0, 0, 0, 0, 0, 1,136, 0, 0, 0,137, 0, 0, 0,161, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 1, -162, 0, 0, 0,138, 0, 0, 0,136, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 1,137, 0, 0, 0,139, 0, 0, 0,208, 0, 0, 0, -161, 0, 0, 0, 0, 0, 0, 1,209, 0, 0, 0,140, 0, 0, 0,138, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 1,139, 0, 0, 0, -141, 0, 0, 0,210, 0, 0, 0,208, 0, 0, 0, 0, 0, 0, 1,211, 0, 0, 0,142, 0, 0, 0,140, 0, 0, 0,209, 0, 0, 0, - 0, 0, 0, 1,141, 0, 0, 0,184, 0, 0, 0,163, 0, 0, 0,210, 0, 0, 0, 0, 0, 0, 1,164, 0, 0, 0,185, 0, 0, 0, -142, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 1, 79, 0, 0, 0,206, 0, 0, 0,210, 0, 0, 0,163, 0, 0, 0, 0, 0, 0, 1, -211, 0, 0, 0,207, 0, 0, 0, 80, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 1,206, 0, 0, 0,212, 0, 0, 0,208, 0, 0, 0, -210, 0, 0, 0, 0, 0, 0, 1,209, 0, 0, 0,213, 0, 0, 0,207, 0, 0, 0,211, 0, 0, 0, 0, 0, 0, 1, 77, 0, 0, 0, -161, 0, 0, 0,208, 0, 0, 0,212, 0, 0, 0, 0, 0, 0, 1,209, 0, 0, 0,162, 0, 0, 0, 78, 0, 0, 0,213, 0, 0, 0, - 0, 0, 0, 1,128, 0, 0, 0,127, 0, 0, 0, 70, 0, 0, 0,219, 0, 0, 0, 0, 0, 0, 1, 70, 0, 0, 0,127, 0, 0, 0, -129, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 1,130, 0, 0, 0,128, 0, 0, 0,219, 0, 0, 0,217, 0, 0, 0, 0, 0, 0, 1, -220, 0, 0, 0,129, 0, 0, 0,131, 0, 0, 0,218, 0, 0, 0, 0, 0, 0, 1,132, 0, 0, 0,130, 0, 0, 0,217, 0, 0, 0, -215, 0, 0, 0, 0, 0, 0, 1,218, 0, 0, 0,131, 0, 0, 0,133, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 1,134, 0, 0, 0, -132, 0, 0, 0,215, 0, 0, 0,214, 0, 0, 0, 0, 0, 0, 1,216, 0, 0, 0,133, 0, 0, 0,134, 0, 0, 0,214, 0, 0, 0, - 0, 0, 0, 1,214, 0, 0, 0,215, 0, 0, 0,226, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 1,227, 0, 0, 0,216, 0, 0, 0, -214, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 1,215, 0, 0, 0,217, 0, 0, 0,224, 0, 0, 0,226, 0, 0, 0, 0, 0, 0, 1, -225, 0, 0, 0,218, 0, 0, 0,216, 0, 0, 0,227, 0, 0, 0, 0, 0, 0, 1,217, 0, 0, 0,219, 0, 0, 0,222, 0, 0, 0, -224, 0, 0, 0, 0, 0, 0, 1,223, 0, 0, 0,220, 0, 0, 0,218, 0, 0, 0,225, 0, 0, 0, 0, 0, 0, 1,219, 0, 0, 0, - 70, 0, 0, 0,221, 0, 0, 0,222, 0, 0, 0, 0, 0, 0, 1,221, 0, 0, 0, 70, 0, 0, 0,220, 0, 0, 0,223, 0, 0, 0, - 0, 0, 0, 1,221, 0, 0, 0,228, 0, 0, 0,226, 0, 0, 0,222, 0, 0, 0, 0, 0, 0, 1,227, 0, 0, 0,228, 0, 0, 0, -221, 0, 0, 0,223, 0, 0, 0, 0, 0, 0, 1,222, 0, 0, 0,226, 0, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -225, 0, 0, 0,227, 0, 0, 0,223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,180, 0, 0, 0,178, 0, 0, 0,231, 0, 0, 0, -229, 0, 0, 0, 0, 0, 0, 1,232, 0, 0, 0,179, 0, 0, 0,181, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 1,110, 0, 0, 0, -180, 0, 0, 0,229, 0, 0, 0,251, 0, 0, 0, 0, 0, 0, 1,230, 0, 0, 0,181, 0, 0, 0,111, 0, 0, 0,252, 0, 0, 0, - 0, 0, 0, 1,108, 0, 0, 0,110, 0, 0, 0,251, 0, 0, 0,253, 0, 0, 0, 0, 0, 0, 1,252, 0, 0, 0,111, 0, 0, 0, -109, 0, 0, 0,254, 0, 0, 0, 0, 0, 0, 1,178, 0, 0, 0, 14, 0, 0, 0,249, 0, 0, 0,231, 0, 0, 0, 0, 0, 0, 1, -250, 0, 0, 0,112, 0, 0, 0,179, 0, 0, 0,232, 0, 0, 0, 0, 0, 0, 1, 14, 0, 0, 0,113, 0, 0, 0,247, 0, 0, 0, -249, 0, 0, 0, 0, 0, 0, 1,248, 0, 0, 0,114, 0, 0, 0,112, 0, 0, 0,250, 0, 0, 0, 0, 0, 0, 1,113, 0, 0, 0, -115, 0, 0, 0,245, 0, 0, 0,247, 0, 0, 0, 0, 0, 0, 1,246, 0, 0, 0,116, 0, 0, 0,114, 0, 0, 0,248, 0, 0, 0, - 0, 0, 0, 1,115, 0, 0, 0,117, 0, 0, 0,243, 0, 0, 0,245, 0, 0, 0, 0, 0, 0, 1,244, 0, 0, 0,118, 0, 0, 0, -116, 0, 0, 0,246, 0, 0, 0, 0, 0, 0, 1,117, 0, 0, 0,119, 0, 0, 0,241, 0, 0, 0,243, 0, 0, 0, 0, 0, 0, 1, -242, 0, 0, 0,120, 0, 0, 0,118, 0, 0, 0,244, 0, 0, 0, 0, 0, 0, 1,119, 0, 0, 0,121, 0, 0, 0,239, 0, 0, 0, -241, 0, 0, 0, 0, 0, 0, 1,240, 0, 0, 0,122, 0, 0, 0,120, 0, 0, 0,242, 0, 0, 0, 0, 0, 0, 1,121, 0, 0, 0, -123, 0, 0, 0,237, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 1,238, 0, 0, 0,124, 0, 0, 0,122, 0, 0, 0,240, 0, 0, 0, - 0, 0, 0, 1,123, 0, 0, 0,176, 0, 0, 0,233, 0, 0, 0,237, 0, 0, 0, 0, 0, 0, 1,234, 0, 0, 0,177, 0, 0, 0, -124, 0, 0, 0,238, 0, 0, 0, 0, 0, 0, 1,176, 0, 0, 0,125, 0, 0, 0,235, 0, 0, 0,233, 0, 0, 0, 0, 0, 0, 1, -236, 0, 0, 0,126, 0, 0, 0,177, 0, 0, 0,234, 0, 0, 0, 0, 0, 0, 1,125, 0, 0, 0,108, 0, 0, 0,253, 0, 0, 0, -235, 0, 0, 0, 0, 0, 0, 1,254, 0, 0, 0,109, 0, 0, 0,126, 0, 0, 0,236, 0, 0, 0, 0, 0, 0, 1,235, 0, 0, 0, -253, 0, 0, 0,255, 0, 0, 0, 17, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,254, 0, 0, 0,236, 0, 0, 0, 18, 1, 0, 0, - 0, 0, 0, 1,233, 0, 0, 0,235, 0, 0, 0, 17, 1, 0, 0, 19, 1, 0, 0, 0, 0, 0, 1, 18, 1, 0, 0,236, 0, 0, 0, -234, 0, 0, 0, 20, 1, 0, 0, 0, 0, 0, 1,237, 0, 0, 0,233, 0, 0, 0, 19, 1, 0, 0, 15, 1, 0, 0, 0, 0, 0, 1, - 20, 1, 0, 0,234, 0, 0, 0,238, 0, 0, 0, 16, 1, 0, 0, 0, 0, 0, 1,239, 0, 0, 0,237, 0, 0, 0, 15, 1, 0, 0, - 13, 1, 0, 0, 0, 0, 0, 1, 16, 1, 0, 0,238, 0, 0, 0,240, 0, 0, 0, 14, 1, 0, 0, 0, 0, 0, 1,241, 0, 0, 0, -239, 0, 0, 0, 13, 1, 0, 0, 11, 1, 0, 0, 0, 0, 0, 1, 14, 1, 0, 0,240, 0, 0, 0,242, 0, 0, 0, 12, 1, 0, 0, - 0, 0, 0, 1,243, 0, 0, 0,241, 0, 0, 0, 11, 1, 0, 0, 9, 1, 0, 0, 0, 0, 0, 1, 12, 1, 0, 0,242, 0, 0, 0, -244, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 1,245, 0, 0, 0,243, 0, 0, 0, 9, 1, 0, 0, 7, 1, 0, 0, 0, 0, 0, 1, - 10, 1, 0, 0,244, 0, 0, 0,246, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 1,247, 0, 0, 0,245, 0, 0, 0, 7, 1, 0, 0, - 5, 1, 0, 0, 0, 0, 0, 1, 8, 1, 0, 0,246, 0, 0, 0,248, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 1,249, 0, 0, 0, -247, 0, 0, 0, 5, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0, 1, 6, 1, 0, 0,248, 0, 0, 0,250, 0, 0, 0, 4, 1, 0, 0, - 0, 0, 0, 1,231, 0, 0, 0,249, 0, 0, 0, 3, 1, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0,250, 0, 0, 0, -232, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1,253, 0, 0, 0,251, 0, 0, 0, 1, 1, 0, 0,255, 0, 0, 0, 0, 0, 0, 1, - 2, 1, 0, 0,252, 0, 0, 0,254, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,251, 0, 0, 0,229, 0, 0, 0, 23, 1, 0, 0, - 1, 1, 0, 0, 0, 0, 0, 1, 24, 1, 0, 0,230, 0, 0, 0,252, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1,229, 0, 0, 0, -231, 0, 0, 0, 21, 1, 0, 0, 23, 1, 0, 0, 0, 0, 0, 1, 22, 1, 0, 0,232, 0, 0, 0,230, 0, 0, 0, 24, 1, 0, 0, - 0, 0, 0, 1, 65, 0, 0, 0,106, 0, 0, 0, 25, 1, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1, 26, 1, 0, 0,107, 0, 0, 0, - 65, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1,106, 0, 0, 0,104, 0, 0, 0, 27, 1, 0, 0, 25, 1, 0, 0, 0, 0, 0, 1, - 28, 1, 0, 0,105, 0, 0, 0,107, 0, 0, 0, 26, 1, 0, 0, 0, 0, 0, 1,104, 0, 0, 0,102, 0, 0, 0, 29, 1, 0, 0, - 27, 1, 0, 0, 0, 0, 0, 1, 30, 1, 0, 0,103, 0, 0, 0,105, 0, 0, 0, 28, 1, 0, 0, 0, 0, 0, 1,102, 0, 0, 0, -100, 0, 0, 0, 31, 1, 0, 0, 29, 1, 0, 0, 0, 0, 0, 1, 32, 1, 0, 0,101, 0, 0, 0,103, 0, 0, 0, 30, 1, 0, 0, - 0, 0, 0, 1,100, 0, 0, 0, 98, 0, 0, 0, 33, 1, 0, 0, 31, 1, 0, 0, 0, 0, 0, 1, 34, 1, 0, 0, 99, 0, 0, 0, -101, 0, 0, 0, 32, 1, 0, 0, 0, 0, 0, 1, 98, 0, 0, 0, 96, 0, 0, 0, 35, 1, 0, 0, 33, 1, 0, 0, 0, 0, 0, 1, - 36, 1, 0, 0, 97, 0, 0, 0, 99, 0, 0, 0, 34, 1, 0, 0, 0, 0, 0, 1, 96, 0, 0, 0, 94, 0, 0, 0, 37, 1, 0, 0, - 35, 1, 0, 0, 0, 0, 0, 1, 38, 1, 0, 0, 95, 0, 0, 0, 97, 0, 0, 0, 36, 1, 0, 0, 0, 0, 0, 1, 94, 0, 0, 0, - 92, 0, 0, 0, 39, 1, 0, 0, 37, 1, 0, 0, 0, 0, 0, 1, 40, 1, 0, 0, 93, 0, 0, 0, 95, 0, 0, 0, 38, 1, 0, 0, - 0, 0, 0, 1, 92, 0, 0, 0, 90, 0, 0, 0, 41, 1, 0, 0, 39, 1, 0, 0, 0, 0, 0, 1, 42, 1, 0, 0, 91, 0, 0, 0, - 93, 0, 0, 0, 40, 1, 0, 0, 0, 0, 0, 1, 49, 1, 0, 0, 50, 1, 0, 0, 69, 1, 0, 0, 79, 1, 0, 0, 0, 0, 0, 1, - 70, 1, 0, 0, 50, 1, 0, 0, 49, 1, 0, 0, 80, 1, 0, 0, 0, 0, 0, 1, 48, 1, 0, 0, 49, 1, 0, 0, 79, 1, 0, 0, - 77, 1, 0, 0, 0, 0, 0, 1, 80, 1, 0, 0, 49, 1, 0, 0, 48, 1, 0, 0, 78, 1, 0, 0, 0, 0, 0, 1, 47, 1, 0, 0, - 48, 1, 0, 0, 77, 1, 0, 0, 81, 1, 0, 0, 0, 0, 0, 1, 78, 1, 0, 0, 48, 1, 0, 0, 47, 1, 0, 0, 82, 1, 0, 0, - 0, 0, 0, 1, 87, 0, 0, 0, 89, 0, 0, 0, 47, 1, 0, 0, 81, 1, 0, 0, 0, 0, 0, 1, 47, 1, 0, 0, 89, 0, 0, 0, - 88, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0, 87, 0, 0, 0, 81, 1, 0, 0, 75, 1, 0, 0, 0, 0, 0, 1, - 82, 1, 0, 0, 88, 0, 0, 0, 86, 0, 0, 0, 76, 1, 0, 0, 0, 0, 0, 1, 83, 0, 0, 0, 85, 0, 0, 0, 75, 1, 0, 0, - 71, 1, 0, 0, 0, 0, 0, 1, 76, 1, 0, 0, 86, 0, 0, 0, 84, 0, 0, 0, 72, 1, 0, 0, 0, 0, 0, 1, 81, 0, 0, 0, - 83, 0, 0, 0, 71, 1, 0, 0, 73, 1, 0, 0, 0, 0, 0, 1, 72, 1, 0, 0, 84, 0, 0, 0, 82, 0, 0, 0, 74, 1, 0, 0, - 0, 0, 0, 1, 71, 1, 0, 0, 77, 1, 0, 0, 79, 1, 0, 0, 73, 1, 0, 0, 0, 0, 0, 1, 80, 1, 0, 0, 78, 1, 0, 0, - 72, 1, 0, 0, 74, 1, 0, 0, 0, 0, 0, 1, 71, 1, 0, 0, 75, 1, 0, 0, 81, 1, 0, 0, 77, 1, 0, 0, 0, 0, 0, 1, - 82, 1, 0, 0, 76, 1, 0, 0, 72, 1, 0, 0, 78, 1, 0, 0, 0, 0, 0, 1, 67, 1, 0, 0, 73, 1, 0, 0, 79, 1, 0, 0, - 69, 1, 0, 0, 0, 0, 0, 1, 80, 1, 0, 0, 74, 1, 0, 0, 68, 1, 0, 0, 70, 1, 0, 0, 0, 0, 0, 1, 79, 0, 0, 0, - 81, 0, 0, 0, 73, 1, 0, 0, 67, 1, 0, 0, 0, 0, 0, 1, 74, 1, 0, 0, 82, 0, 0, 0, 80, 0, 0, 0, 68, 1, 0, 0, - 0, 0, 0, 1,206, 0, 0, 0, 83, 1, 0, 0, 85, 1, 0, 0,212, 0, 0, 0, 0, 0, 0, 1, 86, 1, 0, 0, 84, 1, 0, 0, -207, 0, 0, 0,213, 0, 0, 0, 0, 0, 0, 1, 79, 0, 0, 0, 67, 1, 0, 0, 83, 1, 0, 0,206, 0, 0, 0, 0, 0, 0, 1, - 84, 1, 0, 0, 68, 1, 0, 0, 80, 0, 0, 0,207, 0, 0, 0, 0, 0, 0, 1, 77, 0, 0, 0,212, 0, 0, 0, 85, 1, 0, 0, - 87, 1, 0, 0, 0, 0, 0, 1, 86, 1, 0, 0,213, 0, 0, 0, 78, 0, 0, 0, 88, 1, 0, 0, 0, 0, 0, 1, 77, 0, 0, 0, - 87, 1, 0, 0, 41, 1, 0, 0, 90, 0, 0, 0, 0, 0, 0, 1, 42, 1, 0, 0, 88, 1, 0, 0, 78, 0, 0, 0, 91, 0, 0, 0, - 0, 0, 0, 1, 75, 0, 0, 0, 65, 1, 0, 0, 93, 1, 0, 0, 45, 1, 0, 0, 0, 0, 0, 1, 94, 1, 0, 0, 66, 1, 0, 0, - 75, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 1, 45, 1, 0, 0, 93, 1, 0, 0, 91, 1, 0, 0, 76, 0, 0, 0, 0, 0, 0, 1, - 92, 1, 0, 0, 94, 1, 0, 0, 45, 1, 0, 0, 76, 0, 0, 0, 0, 0, 0, 1, 76, 0, 0, 0, 91, 1, 0, 0, 89, 1, 0, 0, - 46, 1, 0, 0, 0, 0, 0, 1, 90, 1, 0, 0, 92, 1, 0, 0, 76, 0, 0, 0, 46, 1, 0, 0, 0, 0, 0, 1, 46, 1, 0, 0, - 89, 1, 0, 0, 69, 1, 0, 0, 50, 1, 0, 0, 0, 0, 0, 1, 70, 1, 0, 0, 90, 1, 0, 0, 46, 1, 0, 0, 50, 1, 0, 0, - 0, 0, 0, 1, 67, 1, 0, 0, 69, 1, 0, 0, 89, 1, 0, 0, 83, 1, 0, 0, 0, 0, 0, 1, 90, 1, 0, 0, 70, 1, 0, 0, - 68, 1, 0, 0, 84, 1, 0, 0, 0, 0, 0, 1, 37, 1, 0, 0, 39, 1, 0, 0, 59, 1, 0, 0, 51, 1, 0, 0, 0, 0, 0, 1, - 60, 1, 0, 0, 40, 1, 0, 0, 38, 1, 0, 0, 52, 1, 0, 0, 0, 0, 0, 1, 74, 0, 0, 0, 57, 1, 0, 0, 65, 1, 0, 0, - 75, 0, 0, 0, 0, 0, 0, 1, 66, 1, 0, 0, 58, 1, 0, 0, 74, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 1, 43, 1, 0, 0, - 99, 1, 0, 0, 97, 1, 0, 0, 44, 1, 0, 0, 0, 0, 0, 1, 98, 1, 0, 0,100, 1, 0, 0, 43, 1, 0, 0, 44, 1, 0, 0, - 0, 0, 0, 1, 44, 1, 0, 0, 97, 1, 0, 0, 95, 1, 0, 0, 73, 0, 0, 0, 0, 0, 0, 1, 96, 1, 0, 0, 98, 1, 0, 0, - 44, 1, 0, 0, 73, 0, 0, 0, 0, 0, 0, 1, 73, 0, 0, 0, 95, 1, 0, 0, 57, 1, 0, 0, 74, 0, 0, 0, 0, 0, 0, 1, - 58, 1, 0, 0, 96, 1, 0, 0, 73, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 1, 33, 1, 0, 0, 35, 1, 0, 0,103, 1, 0, 0, -105, 1, 0, 0, 0, 0, 0, 1,104, 1, 0, 0, 36, 1, 0, 0, 34, 1, 0, 0,106, 1, 0, 0, 0, 0, 0, 1,105, 1, 0, 0, -103, 1, 0, 0,109, 1, 0, 0,107, 1, 0, 0, 0, 0, 0, 1,110, 1, 0, 0,104, 1, 0, 0,106, 1, 0, 0,108, 1, 0, 0, - 0, 0, 0, 1,107, 1, 0, 0,109, 1, 0, 0,111, 1, 0, 0,113, 1, 0, 0, 0, 0, 0, 1,112, 1, 0, 0,110, 1, 0, 0, -108, 1, 0, 0,114, 1, 0, 0, 0, 0, 0, 1,113, 1, 0, 0,111, 1, 0, 0,117, 1, 0, 0,115, 1, 0, 0, 0, 0, 0, 1, -118, 1, 0, 0,112, 1, 0, 0,114, 1, 0, 0,116, 1, 0, 0, 0, 0, 0, 1, 55, 1, 0, 0,119, 1, 0, 0,115, 1, 0, 0, -117, 1, 0, 0, 0, 0, 0, 1,116, 1, 0, 0,120, 1, 0, 0, 56, 1, 0, 0,118, 1, 0, 0, 0, 0, 0, 1, 57, 1, 0, 0, - 95, 1, 0, 0,115, 1, 0, 0,119, 1, 0, 0, 0, 0, 0, 1,116, 1, 0, 0, 96, 1, 0, 0, 58, 1, 0, 0,120, 1, 0, 0, - 0, 0, 0, 1, 95, 1, 0, 0, 97, 1, 0, 0,113, 1, 0, 0,115, 1, 0, 0, 0, 0, 0, 1,114, 1, 0, 0, 98, 1, 0, 0, - 96, 1, 0, 0,116, 1, 0, 0, 0, 0, 0, 1, 97, 1, 0, 0, 99, 1, 0, 0,107, 1, 0, 0,113, 1, 0, 0, 0, 0, 0, 1, -108, 1, 0, 0,100, 1, 0, 0, 98, 1, 0, 0,114, 1, 0, 0, 0, 0, 0, 1, 99, 1, 0, 0,101, 1, 0, 0,105, 1, 0, 0, -107, 1, 0, 0, 0, 0, 0, 1,106, 1, 0, 0,102, 1, 0, 0,100, 1, 0, 0,108, 1, 0, 0, 0, 0, 0, 1, 31, 1, 0, 0, - 33, 1, 0, 0,105, 1, 0, 0,101, 1, 0, 0, 0, 0, 0, 1,106, 1, 0, 0, 34, 1, 0, 0, 32, 1, 0, 0,102, 1, 0, 0, - 0, 0, 0, 1, 72, 0, 0, 0,101, 1, 0, 0, 99, 1, 0, 0, 43, 1, 0, 0, 0, 0, 0, 1,100, 1, 0, 0,102, 1, 0, 0, - 72, 0, 0, 0, 43, 1, 0, 0, 0, 0, 0, 1, 25, 1, 0, 0, 27, 1, 0, 0, 29, 1, 0, 0, 31, 1, 0, 0, 0, 0, 0, 1, - 30, 1, 0, 0, 28, 1, 0, 0, 26, 1, 0, 0, 32, 1, 0, 0, 0, 0, 0, 1, 25, 1, 0, 0, 31, 1, 0, 0,101, 1, 0, 0, - 72, 0, 0, 0, 0, 0, 0, 1,102, 1, 0, 0, 32, 1, 0, 0, 26, 1, 0, 0, 72, 0, 0, 0, 0, 0, 0, 1, 71, 0, 0, 0, - 25, 1, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 72, 0, 0, 0, 26, 1, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 35, 1, 0, 0, 37, 1, 0, 0, 51, 1, 0, 0,103, 1, 0, 0, 0, 0, 0, 1, 52, 1, 0, 0, 38, 1, 0, 0, - 36, 1, 0, 0,104, 1, 0, 0, 0, 0, 0, 1, 51, 1, 0, 0, 53, 1, 0, 0,109, 1, 0, 0,103, 1, 0, 0, 0, 0, 0, 1, -110, 1, 0, 0, 54, 1, 0, 0, 52, 1, 0, 0,104, 1, 0, 0, 0, 0, 0, 1, 53, 1, 0, 0,123, 1, 0, 0,111, 1, 0, 0, -109, 1, 0, 0, 0, 0, 0, 1,112, 1, 0, 0,124, 1, 0, 0, 54, 1, 0, 0,110, 1, 0, 0, 0, 0, 0, 1, 55, 1, 0, 0, -117, 1, 0, 0,111, 1, 0, 0,123, 1, 0, 0, 0, 0, 0, 1,112, 1, 0, 0,118, 1, 0, 0, 56, 1, 0, 0,124, 1, 0, 0, - 0, 0, 0, 1, 89, 1, 0, 0, 91, 1, 0, 0,127, 1, 0, 0,125, 1, 0, 0, 0, 0, 0, 1,128, 1, 0, 0, 92, 1, 0, 0, - 90, 1, 0, 0,126, 1, 0, 0, 0, 0, 0, 1, 59, 1, 0, 0,125, 1, 0, 0,127, 1, 0, 0, 61, 1, 0, 0, 0, 0, 0, 1, -128, 1, 0, 0,126, 1, 0, 0, 60, 1, 0, 0, 62, 1, 0, 0, 0, 0, 0, 1, 39, 1, 0, 0, 41, 1, 0, 0,125, 1, 0, 0, - 59, 1, 0, 0, 0, 0, 0, 1,126, 1, 0, 0, 42, 1, 0, 0, 40, 1, 0, 0, 60, 1, 0, 0, 0, 0, 0, 1, 41, 1, 0, 0, - 85, 1, 0, 0, 83, 1, 0, 0,125, 1, 0, 0, 0, 0, 0, 1, 84, 1, 0, 0, 86, 1, 0, 0, 42, 1, 0, 0,126, 1, 0, 0, - 0, 0, 0, 1, 83, 1, 0, 0, 89, 1, 0, 0,125, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,126, 1, 0, 0, 90, 1, 0, 0, - 84, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 41, 1, 0, 0, 87, 1, 0, 0, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 86, 1, 0, 0, 88, 1, 0, 0, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 55, 1, 0, 0, 63, 1, 0, 0,121, 1, 0, 0, -119, 1, 0, 0, 0, 0, 0, 1,122, 1, 0, 0, 64, 1, 0, 0, 56, 1, 0, 0,120, 1, 0, 0, 0, 0, 0, 1, 57, 1, 0, 0, -119, 1, 0, 0,121, 1, 0, 0, 65, 1, 0, 0, 0, 0, 0, 1,122, 1, 0, 0,120, 1, 0, 0, 58, 1, 0, 0, 66, 1, 0, 0, - 0, 0, 0, 1, 61, 1, 0, 0,127, 1, 0, 0,121, 1, 0, 0, 63, 1, 0, 0, 0, 0, 0, 1,122, 1, 0, 0,128, 1, 0, 0, - 62, 1, 0, 0, 64, 1, 0, 0, 0, 0, 0, 1, 91, 1, 0, 0, 93, 1, 0, 0,121, 1, 0, 0,127, 1, 0, 0, 0, 0, 0, 1, -122, 1, 0, 0, 94, 1, 0, 0, 92, 1, 0, 0,128, 1, 0, 0, 0, 0, 0, 1, 65, 1, 0, 0,121, 1, 0, 0, 93, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 94, 1, 0, 0,122, 1, 0, 0, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,141, 1, 0, 0, -129, 1, 0, 0,155, 1, 0, 0,143, 1, 0, 0, 0, 0, 0, 1,156, 1, 0, 0,130, 1, 0, 0,142, 1, 0, 0,144, 1, 0, 0, - 0, 0, 0, 1,141, 1, 0, 0,143, 1, 0, 0,145, 1, 0, 0,139, 1, 0, 0, 0, 0, 0, 1,146, 1, 0, 0,144, 1, 0, 0, -142, 1, 0, 0,140, 1, 0, 0, 0, 0, 0, 1,139, 1, 0, 0,145, 1, 0, 0,147, 1, 0, 0,137, 1, 0, 0, 0, 0, 0, 1, -148, 1, 0, 0,146, 1, 0, 0,140, 1, 0, 0,138, 1, 0, 0, 0, 0, 0, 1,137, 1, 0, 0,147, 1, 0, 0,149, 1, 0, 0, -135, 1, 0, 0, 0, 0, 0, 1,150, 1, 0, 0,148, 1, 0, 0,138, 1, 0, 0,136, 1, 0, 0, 0, 0, 0, 1,135, 1, 0, 0, -149, 1, 0, 0,151, 1, 0, 0,133, 1, 0, 0, 0, 0, 0, 1,152, 1, 0, 0,150, 1, 0, 0,136, 1, 0, 0,134, 1, 0, 0, - 0, 0, 0, 1,133, 1, 0, 0,151, 1, 0, 0,153, 1, 0, 0,131, 1, 0, 0, 0, 0, 0, 1,154, 1, 0, 0,152, 1, 0, 0, -134, 1, 0, 0,132, 1, 0, 0, 0, 0, 0, 1,151, 1, 0, 0,161, 1, 0, 0,159, 1, 0, 0,153, 1, 0, 0, 0, 0, 0, 1, -160, 1, 0, 0,162, 1, 0, 0,152, 1, 0, 0,154, 1, 0, 0, 0, 0, 0, 1,149, 1, 0, 0,163, 1, 0, 0,161, 1, 0, 0, -151, 1, 0, 0, 0, 0, 0, 1,162, 1, 0, 0,164, 1, 0, 0,150, 1, 0, 0,152, 1, 0, 0, 0, 0, 0, 1,147, 1, 0, 0, -165, 1, 0, 0,163, 1, 0, 0,149, 1, 0, 0, 0, 0, 0, 1,164, 1, 0, 0,166, 1, 0, 0,148, 1, 0, 0,150, 1, 0, 0, - 0, 0, 0, 1,145, 1, 0, 0,167, 1, 0, 0,165, 1, 0, 0,147, 1, 0, 0, 0, 0, 0, 1,166, 1, 0, 0,168, 1, 0, 0, -146, 1, 0, 0,148, 1, 0, 0, 0, 0, 0, 1,143, 1, 0, 0,169, 1, 0, 0,167, 1, 0, 0,145, 1, 0, 0, 0, 0, 0, 1, -168, 1, 0, 0,170, 1, 0, 0,144, 1, 0, 0,146, 1, 0, 0, 0, 0, 0, 1,143, 1, 0, 0,155, 1, 0, 0,157, 1, 0, 0, -169, 1, 0, 0, 0, 0, 0, 1,158, 1, 0, 0,156, 1, 0, 0,144, 1, 0, 0,170, 1, 0, 0, 0, 0, 0, 1, 59, 1, 0, 0, - 61, 1, 0, 0,185, 1, 0, 0,183, 1, 0, 0, 0, 0, 0, 1,186, 1, 0, 0, 62, 1, 0, 0, 60, 1, 0, 0,184, 1, 0, 0, - 0, 0, 0, 1, 61, 1, 0, 0,131, 1, 0, 0,153, 1, 0, 0,185, 1, 0, 0, 0, 0, 0, 1,154, 1, 0, 0,132, 1, 0, 0, - 62, 1, 0, 0,186, 1, 0, 0, 0, 0, 0, 1, 51, 1, 0, 0, 59, 1, 0, 0,183, 1, 0, 0, 53, 1, 0, 0, 0, 0, 0, 1, -184, 1, 0, 0, 60, 1, 0, 0, 52, 1, 0, 0, 54, 1, 0, 0, 0, 0, 0, 1,123, 1, 0, 0,171, 1, 0, 0,155, 1, 0, 0, -129, 1, 0, 0, 0, 0, 0, 1,156, 1, 0, 0,172, 1, 0, 0,124, 1, 0, 0,130, 1, 0, 0, 0, 0, 0, 1,153, 1, 0, 0, -159, 1, 0, 0,181, 1, 0, 0,185, 1, 0, 0, 0, 0, 0, 1,182, 1, 0, 0,160, 1, 0, 0,154, 1, 0, 0,186, 1, 0, 0, - 0, 0, 0, 1,179, 1, 0, 0,187, 1, 0, 0,185, 1, 0, 0,181, 1, 0, 0, 0, 0, 0, 1,186, 1, 0, 0,188, 1, 0, 0, -180, 1, 0, 0,182, 1, 0, 0, 0, 0, 0, 1,175, 1, 0, 0,187, 1, 0, 0,179, 1, 0, 0,177, 1, 0, 0, 0, 0, 0, 1, -180, 1, 0, 0,188, 1, 0, 0,176, 1, 0, 0,178, 1, 0, 0, 0, 0, 0, 1,173, 1, 0, 0,189, 1, 0, 0,187, 1, 0, 0, -175, 1, 0, 0, 0, 0, 0, 1,188, 1, 0, 0,190, 1, 0, 0,174, 1, 0, 0,176, 1, 0, 0, 0, 0, 0, 1,171, 1, 0, 0, -189, 1, 0, 0,173, 1, 0, 0,191, 1, 0, 0, 0, 0, 0, 1,174, 1, 0, 0,190, 1, 0, 0,172, 1, 0, 0,192, 1, 0, 0, - 0, 0, 0, 1,155, 1, 0, 0,171, 1, 0, 0,191, 1, 0, 0,157, 1, 0, 0, 0, 0, 0, 1,192, 1, 0, 0,172, 1, 0, 0, -156, 1, 0, 0,158, 1, 0, 0, 0, 0, 0, 1, 53, 1, 0, 0,189, 1, 0, 0,171, 1, 0, 0,123, 1, 0, 0, 0, 0, 0, 1, -172, 1, 0, 0,190, 1, 0, 0, 54, 1, 0, 0,124, 1, 0, 0, 0, 0, 0, 1, 53, 1, 0, 0,183, 1, 0, 0,187, 1, 0, 0, -189, 1, 0, 0, 0, 0, 0, 1,188, 1, 0, 0,184, 1, 0, 0, 54, 1, 0, 0,190, 1, 0, 0, 0, 0, 0, 1,183, 1, 0, 0, -185, 1, 0, 0,187, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,188, 1, 0, 0,186, 1, 0, 0,184, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1,157, 1, 0, 0,191, 1, 0, 0,193, 1, 0, 0,217, 1, 0, 0, 0, 0, 0, 1,194, 1, 0, 0,192, 1, 0, 0, -158, 1, 0, 0,218, 1, 0, 0, 0, 0, 0, 1,191, 1, 0, 0,173, 1, 0, 0,203, 1, 0, 0,193, 1, 0, 0, 0, 0, 0, 1, -204, 1, 0, 0,174, 1, 0, 0,192, 1, 0, 0,194, 1, 0, 0, 0, 0, 0, 1,173, 1, 0, 0,175, 1, 0, 0,201, 1, 0, 0, -203, 1, 0, 0, 0, 0, 0, 1,202, 1, 0, 0,176, 1, 0, 0,174, 1, 0, 0,204, 1, 0, 0, 0, 0, 0, 1,175, 1, 0, 0, -177, 1, 0, 0,199, 1, 0, 0,201, 1, 0, 0, 0, 0, 0, 1,200, 1, 0, 0,178, 1, 0, 0,176, 1, 0, 0,202, 1, 0, 0, - 0, 0, 0, 1,177, 1, 0, 0,179, 1, 0, 0,197, 1, 0, 0,199, 1, 0, 0, 0, 0, 0, 1,198, 1, 0, 0,180, 1, 0, 0, -178, 1, 0, 0,200, 1, 0, 0, 0, 0, 0, 1,179, 1, 0, 0,181, 1, 0, 0,195, 1, 0, 0,197, 1, 0, 0, 0, 0, 0, 1, -196, 1, 0, 0,182, 1, 0, 0,180, 1, 0, 0,198, 1, 0, 0, 0, 0, 0, 1,181, 1, 0, 0,159, 1, 0, 0,215, 1, 0, 0, -195, 1, 0, 0, 0, 0, 0, 1,216, 1, 0, 0,160, 1, 0, 0,182, 1, 0, 0,196, 1, 0, 0, 0, 0, 0, 1,169, 1, 0, 0, -157, 1, 0, 0,217, 1, 0, 0,205, 1, 0, 0, 0, 0, 0, 1,218, 1, 0, 0,158, 1, 0, 0,170, 1, 0, 0,206, 1, 0, 0, - 0, 0, 0, 1,167, 1, 0, 0,169, 1, 0, 0,205, 1, 0, 0,207, 1, 0, 0, 0, 0, 0, 1,206, 1, 0, 0,170, 1, 0, 0, -168, 1, 0, 0,208, 1, 0, 0, 0, 0, 0, 1,165, 1, 0, 0,167, 1, 0, 0,207, 1, 0, 0,209, 1, 0, 0, 0, 0, 0, 1, -208, 1, 0, 0,168, 1, 0, 0,166, 1, 0, 0,210, 1, 0, 0, 0, 0, 0, 1,163, 1, 0, 0,165, 1, 0, 0,209, 1, 0, 0, -211, 1, 0, 0, 0, 0, 0, 1,210, 1, 0, 0,166, 1, 0, 0,164, 1, 0, 0,212, 1, 0, 0, 0, 0, 0, 1,161, 1, 0, 0, -163, 1, 0, 0,211, 1, 0, 0,213, 1, 0, 0, 0, 0, 0, 1,212, 1, 0, 0,164, 1, 0, 0,162, 1, 0, 0,214, 1, 0, 0, - 0, 0, 0, 1,159, 1, 0, 0,161, 1, 0, 0,213, 1, 0, 0,215, 1, 0, 0, 0, 0, 0, 1,214, 1, 0, 0,162, 1, 0, 0, -160, 1, 0, 0,216, 1, 0, 0, 0, 0, 0, 1,199, 1, 0, 0,197, 1, 0, 0,221, 1, 0, 0,219, 1, 0, 0, 0, 0, 0, 1, -222, 1, 0, 0,198, 1, 0, 0,200, 1, 0, 0,220, 1, 0, 0, 0, 0, 0, 1,219, 1, 0, 0,221, 1, 0, 0,223, 1, 0, 0, -225, 1, 0, 0, 0, 0, 0, 1,224, 1, 0, 0,222, 1, 0, 0,220, 1, 0, 0,226, 1, 0, 0, 0, 0, 0, 1,225, 1, 0, 0, -223, 1, 0, 0,229, 1, 0, 0,227, 1, 0, 0, 0, 0, 0, 1,230, 1, 0, 0,224, 1, 0, 0,226, 1, 0, 0,228, 1, 0, 0, - 0, 0, 0, 1,227, 1, 0, 0,229, 1, 0, 0,231, 1, 0, 0,233, 1, 0, 0, 0, 0, 0, 1,232, 1, 0, 0,230, 1, 0, 0, -228, 1, 0, 0,234, 1, 0, 0, 0, 0, 0, 1,205, 1, 0, 0,217, 1, 0, 0,227, 1, 0, 0,233, 1, 0, 0, 0, 0, 0, 1, -228, 1, 0, 0,218, 1, 0, 0,206, 1, 0, 0,234, 1, 0, 0, 0, 0, 0, 1,193, 1, 0, 0,225, 1, 0, 0,227, 1, 0, 0, -217, 1, 0, 0, 0, 0, 0, 1,228, 1, 0, 0,226, 1, 0, 0,194, 1, 0, 0,218, 1, 0, 0, 0, 0, 0, 1,193, 1, 0, 0, -203, 1, 0, 0,219, 1, 0, 0,225, 1, 0, 0, 0, 0, 0, 1,220, 1, 0, 0,204, 1, 0, 0,194, 1, 0, 0,226, 1, 0, 0, - 0, 0, 0, 1,199, 1, 0, 0,219, 1, 0, 0,203, 1, 0, 0,201, 1, 0, 0, 0, 0, 0, 1,204, 1, 0, 0,220, 1, 0, 0, -200, 1, 0, 0,202, 1, 0, 0, 0, 0, 0, 1,195, 1, 0, 0,215, 1, 0, 0,221, 1, 0, 0,197, 1, 0, 0, 0, 0, 0, 1, -222, 1, 0, 0,216, 1, 0, 0,196, 1, 0, 0,198, 1, 0, 0, 0, 0, 0, 1,213, 1, 0, 0,223, 1, 0, 0,221, 1, 0, 0, -215, 1, 0, 0, 0, 0, 0, 1,222, 1, 0, 0,224, 1, 0, 0,214, 1, 0, 0,216, 1, 0, 0, 0, 0, 0, 1,211, 1, 0, 0, -229, 1, 0, 0,223, 1, 0, 0,213, 1, 0, 0, 0, 0, 0, 1,224, 1, 0, 0,230, 1, 0, 0,212, 1, 0, 0,214, 1, 0, 0, - 0, 0, 0, 1,209, 1, 0, 0,231, 1, 0, 0,229, 1, 0, 0,211, 1, 0, 0, 0, 0, 0, 1,230, 1, 0, 0,232, 1, 0, 0, -210, 1, 0, 0,212, 1, 0, 0, 0, 0, 0, 1,207, 1, 0, 0,233, 1, 0, 0,231, 1, 0, 0,209, 1, 0, 0, 0, 0, 0, 1, -232, 1, 0, 0,234, 1, 0, 0,208, 1, 0, 0,210, 1, 0, 0, 0, 0, 0, 1,205, 1, 0, 0,233, 1, 0, 0,207, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1,208, 1, 0, 0,234, 1, 0, 0,206, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,133, 1, 0, 0, -131, 1, 0, 0,245, 1, 0, 0,243, 1, 0, 0, 0, 0, 0, 1,246, 1, 0, 0,132, 1, 0, 0,134, 1, 0, 0,244, 1, 0, 0, - 0, 0, 0, 1,135, 1, 0, 0,133, 1, 0, 0,243, 1, 0, 0,241, 1, 0, 0, 0, 0, 0, 1,244, 1, 0, 0,134, 1, 0, 0, -136, 1, 0, 0,242, 1, 0, 0, 0, 0, 0, 1,137, 1, 0, 0,135, 1, 0, 0,241, 1, 0, 0,239, 1, 0, 0, 0, 0, 0, 1, -242, 1, 0, 0,136, 1, 0, 0,138, 1, 0, 0,240, 1, 0, 0, 0, 0, 0, 1,139, 1, 0, 0,137, 1, 0, 0,239, 1, 0, 0, -237, 1, 0, 0, 0, 0, 0, 1,240, 1, 0, 0,138, 1, 0, 0,140, 1, 0, 0,238, 1, 0, 0, 0, 0, 0, 1,141, 1, 0, 0, -139, 1, 0, 0,237, 1, 0, 0,235, 1, 0, 0, 0, 0, 0, 1,238, 1, 0, 0,140, 1, 0, 0,142, 1, 0, 0,236, 1, 0, 0, - 0, 0, 0, 1,129, 1, 0, 0,141, 1, 0, 0,235, 1, 0, 0,247, 1, 0, 0, 0, 0, 0, 1,236, 1, 0, 0,142, 1, 0, 0, -130, 1, 0, 0,248, 1, 0, 0, 0, 0, 0, 1,235, 1, 0, 0,243, 1, 0, 0,245, 1, 0, 0,247, 1, 0, 0, 0, 0, 0, 1, -246, 1, 0, 0,244, 1, 0, 0,236, 1, 0, 0,248, 1, 0, 0, 0, 0, 0, 1,235, 1, 0, 0,237, 1, 0, 0,241, 1, 0, 0, -243, 1, 0, 0, 0, 0, 0, 1,242, 1, 0, 0,238, 1, 0, 0,236, 1, 0, 0,244, 1, 0, 0, 0, 0, 0, 1,237, 1, 0, 0, -239, 1, 0, 0,241, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,242, 1, 0, 0,240, 1, 0, 0,238, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 55, 1, 0, 0,123, 1, 0, 0,129, 1, 0, 0,247, 1, 0, 0, 0, 0, 0, 1,130, 1, 0, 0,124, 1, 0, 0, - 56, 1, 0, 0,248, 1, 0, 0, 0, 0, 0, 1, 55, 1, 0, 0,247, 1, 0, 0,245, 1, 0, 0, 63, 1, 0, 0, 0, 0, 0, 1, -246, 1, 0, 0,248, 1, 0, 0, 56, 1, 0, 0, 64, 1, 0, 0, 0, 0, 0, 1, 61, 1, 0, 0, 63, 1, 0, 0,245, 1, 0, 0, -131, 1, 0, 0, 0, 0, 0, 1,246, 1, 0, 0, 64, 1, 0, 0, 62, 1, 0, 0,132, 1, 0, 0, 0, 0, 0, 1, 68, 65, 84, 65, -192, 93, 0, 0, 16, 7,117, 1, 0, 0, 0, 0, 60, 0, 0, 0,244, 1, 0, 0, 3,112, 28, 63,185,178,236, 62,224,124, 27, 63, -235, 65,232, 62,144, 63, 30, 63,233,195,226, 62,118,152, 32, 63, 37,167,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 2,232,209, 62,222, 21,226, 62,102,109,215, 62,222,147,231, 62, 28,135,213, 62,172, 4,236, 62, 56, 54,205, 62, - 22,249,235, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,118,152, 32, 63, 37,167,236, 62,144, 63, 30, 63, -233,195,226, 62,108,235, 33, 63,197,235,220, 62,209,151, 37, 63, 89,161,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 76,144,202, 62,186, 61,220, 62, 2,232,209, 62,222, 21,226, 62, 56, 54,205, 62, 22,249,235, 62,128, 55,195, 62, - 70,243,235, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,144, 63, 30, 63,233,195,226, 62, 20, 55, 25, 63, - 1, 35,223, 62,200,178, 25, 63, 77,233,214, 62,108,235, 33, 63,197,235,220, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,146, 1,219, 62, 66, 59,214, 62,248,248,219, 62,246,116,222, 62, 2,232,209, 62,222, 21,226, 62, 76,144,202, 62, -186, 61,220, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,224,124, 27, 63,235, 65,232, 62, 87,252, 24, 63, - 93,111,230, 62, 20, 55, 25, 63, 1, 35,223, 62,144, 63, 30, 63,233,195,226, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,248,248,219, 62,246,116,222, 62,118,110,220, 62, 78,193,229, 62,102,109,215, 62,222,147,231, 62, 2,232,209, 62, -222, 21,226, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 87,252, 24, 63, 93,111,230, 62, 22,195, 22, 63, -195, 90,232, 62,191, 91, 20, 63,193, 18,227, 62, 20, 55, 25, 63, 1, 35,223, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,162,175,229, 62,178,100,226, 62,248,224,224, 62,182,172,231, 62,118,110,220, 62, 78,193,229, 62,248,248,219, 62, -246,116,222, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 20, 55, 25, 63, 1, 35,223, 62,191, 91, 20, 63, -193, 18,227, 62,187,165, 17, 63,225, 6,221, 62,200,178, 25, 63, 77,233,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,170, 27,235, 62,214, 88,220, 62,162,175,229, 62,178,100,226, 62,248,248,219, 62,246,116,222, 62,146, 1,219, 62, - 66, 59,214, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,191, 91, 20, 63,193, 18,227, 62,164, 18, 18, 63, -173,201,236, 62,157,231, 13, 63, 89,161,236, 62,187,165, 17, 63,225, 6,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,232,151,242, 62, 70,243,235, 62,216, 65,234, 62,158, 27,236, 62,162,175,229, 62,178,100,226, 62,170, 27,235, 62, -214, 88,220, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 22,195, 22, 63,195, 90,232, 62, 11,202, 21, 63, - 1,189,236, 62,164, 18, 18, 63,173,201,236, 62,191, 91, 20, 63,193, 18,227, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,216, 65,234, 62,158, 27,236, 62, 12,211,226, 62,246, 14,236, 62,248,224,224, 62,182,172,231, 62,162,175,229, 62, -178,100,226, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 11,202, 21, 63, 1,189,236, 62,215,202, 22, 63, -237,124,241, 62,125,105, 20, 63, 1, 71,246, 62,164, 18, 18, 63,173,201,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 42,148,229, 62,246,152,245, 62,112,209,224, 62,226,206,240, 62, 12,211,226, 62,246, 14,236, 62,216, 65,234, 62, -158, 27,236, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,164, 18, 18, 63,173,201,236, 62,125,105, 20, 63, - 1, 71,246, 62, 44,173, 17, 63,231,149,252, 62,157,231, 13, 63, 89,161,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,206, 12,235, 62,218,231,251, 62, 42,148,229, 62,246,152,245, 62,216, 65,234, 62,158, 27,236, 62,232,151,242, 62, - 70,243,235, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,125,105, 20, 63, 1, 71,246, 62, 37, 59, 25, 63, - 49, 73,250, 62,108,178, 25, 63,218,108, 1, 63, 44,173, 17, 63,231,149,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 76, 2,219, 62,213, 21, 1, 63,216,240,219, 62, 38,155,249, 62, 42,148,229, 62,246,152,245, 62,206, 12,235, 62, -218,231,251, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,215,202, 22, 63,237,124,241, 62,195, 1, 25, 63, -169,102,243, 62, 37, 59, 25, 63, 49, 73,250, 62,125,105, 20, 63, 1, 71,246, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,216,240,219, 62, 38,155,249, 62,156, 99,220, 62,154,184,242, 62,112,209,224, 62,226,206,240, 62, 42,148,229, 62, -246,152,245, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,195, 1, 25, 63,169,102,243, 62,176,125, 27, 63, -149,145,241, 62,167, 74, 30, 63, 3,153,246, 62, 37, 59, 25, 63, 49, 73,250, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,212,209,209, 62,246,234,245, 62,192,107,215, 62,138,227,240, 62,156, 99,220, 62,154,184,242, 62,216,240,219, 62, - 38,155,249, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 37, 59, 25, 63, 49, 73,250, 62,167, 74, 30, 63, - 3,153,246, 62,204,230, 33, 63,107,232,252, 62,108,178, 25, 63,218,108, 1, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,132,153,202, 62, 94, 58,252, 62,212,209,209, 62,246,234,245, 62,216,240,219, 62, 38,155,249, 62, 76, 2,219, 62, -213, 21, 1, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,167, 74, 30, 63, 3,153,246, 62,118,152, 32, 63, - 37,167,236, 62,209,151, 37, 63, 89,161,236, 62,204,230, 33, 63,107,232,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,128, 55,195, 62, 70,243,235, 62, 56, 54,205, 62, 22,249,235, 62,212,209,209, 62,246,234,245, 62,132,153,202, 62, - 94, 58,252, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,176,125, 27, 63,149,145,241, 62, 3,112, 28, 63, -185,178,236, 62,118,152, 32, 63, 37,167,236, 62,167, 74, 30, 63, 3,153,246, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 56, 54,205, 62, 22,249,235, 62, 28,135,213, 62,172, 4,236, 62,192,107,215, 62,138,227,240, 62,212,209,209, 62, -246,234,245, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 3,112, 28, 63,185,178,236, 62,176,125, 27, 63, -149,145,241, 62, 42, 39, 27, 63, 57, 1,241, 62,140,249, 27, 63,115,186,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,206, 24,216, 62, 46, 83,240, 62,192,107,215, 62,138,227,240, 62, 28,135,213, 62,172, 4,236, 62, 8,116,214, 62, -102, 12,236, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,176,125, 27, 63,149,145,241, 62,195, 1, 25, 63, -169,102,243, 62, 6,248, 24, 63,185, 91,242, 62, 42, 39, 27, 63, 57, 1,241, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 22,119,220, 62,174,173,241, 62,156, 99,220, 62,154,184,242, 62,192,107,215, 62,138,227,240, 62,206, 24,216, 62, - 46, 83,240, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,195, 1, 25, 63,169,102,243, 62,215,202, 22, 63, -237,124,241, 62,157, 38, 23, 63,225,173,240, 62, 6,248, 24, 63,185, 91,242, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,234, 25,224, 62,214,255,239, 62,112,209,224, 62,226,206,240, 62,156, 99,220, 62,154,184,242, 62, 22,119,220, 62, -174,173,241, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,215,202, 22, 63,237,124,241, 62, 11,202, 21, 63, - 1,189,236, 62, 13, 89, 22, 63,247,196,236, 62,157, 38, 23, 63,225,173,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 8,181,225, 62,234, 22,236, 62, 12,211,226, 62,246, 14,236, 62,112,209,224, 62,226,206,240, 62,234, 25,224, 62, -214,255,239, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 11,202, 21, 63, 1,189,236, 62, 22,195, 22, 63, -195, 90,232, 62, 88, 33, 23, 63, 69, 47,233, 62, 13, 89, 22, 63,247,196,236, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,112, 36,224, 62, 58,129,232, 62,248,224,224, 62,182,172,231, 62, 12,211,226, 62,246, 14,236, 62, 8,181,225, 62, -234, 22,236, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 22,195, 22, 63,195, 90,232, 62, 87,252, 24, 63, - 93,111,230, 62,100,243, 24, 63, 5,123,231, 62, 88, 33, 23, 63, 69, 47,233, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 90,128,220, 62,248,204,230, 62,118,110,220, 62, 78,193,229, 62,248,224,224, 62,182,172,231, 62,112, 36,224, 62, - 58,129,232, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0, 87,252, 24, 63, 93,111,230, 62,224,124, 27, 63, -235, 65,232, 62,169, 37, 27, 63, 35,211,232, 62,100,243, 24, 63, 5,123,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,206, 27,216, 62, 22, 37,232, 62,102,109,215, 62,222,147,231, 62,118,110,220, 62, 78,193,229, 62, 90,128,220, 62, -248,204,230, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,224,124, 27, 63,235, 65,232, 62, 3,112, 28, 63, -185,178,236, 62,140,249, 27, 63,115,186,236, 62,169, 37, 27, 63, 35,211,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 8,116,214, 62,102, 12,236, 62, 28,135,213, 62,172, 4,236, 62,102,109,215, 62,222,147,231, 62,206, 27,216, 62, - 22, 37,232, 62,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,240, 0,138,242, 24, 63, 21,194,236, 62,169, 37, 27, 63, - 35,211,232, 62,140,249, 27, 63,115,186,236, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 8,116,214, 62,102, 12,236, 62,206, 27,216, 62, 22, 37,232, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,100,243, 24, 63, 5,123,231, 62,169, 37, 27, 63, - 35,211,232, 62,138,242, 24, 63, 21,194,236, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 16,130,220, 62, 6, 20,236, 62,206, 27,216, 62, 22, 37,232, 62, 90,128,220, 62,248,204,230, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62, 88, 33, 23, 63, - 69, 47,233, 62,100,243, 24, 63, 5,123,231, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 90,128,220, 62,248,204,230, 62,112, 36,224, 62, 58,129,232, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62, 13, 89, 22, 63, -247,196,236, 62, 88, 33, 23, 63, 69, 47,233, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0,112, 36,224, 62, 58,129,232, 62, 8,181,225, 62,234, 22,236, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62,157, 38, 23, 63, -225,173,240, 62, 13, 89, 22, 63,247,196,236, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 8,181,225, 62,234, 22,236, 62,234, 25,224, 62,214,255,239, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62, 6,248, 24, 63, -185, 91,242, 62,157, 38, 23, 63,225,173,240, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0,234, 25,224, 62,214,255,239, 62, 22,119,220, 62,174,173,241, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62, 42, 39, 27, 63, - 57, 1,241, 62, 6,248, 24, 63,185, 91,242, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 22,119,220, 62,174,173,241, 62,206, 24,216, 62, 46, 83,240, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,138,242, 24, 63, 21,194,236, 62,140,249, 27, 63, -115,186,236, 62, 42, 39, 27, 63, 57, 1,241, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0,206, 24,216, 62, 46, 83,240, 62, 8,116,214, 62,102, 12,236, 62, 16,130,220, 62, 6, 20,236, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 61, 0, 5, 0, 0, 0,112, 0,174,254, 16, 63, 94, 45, 34, 62, 79,190, 13, 63, -160,193, 46, 62,220,199, 3, 63, 89,219, 24, 62,219,199, 3, 63, 18, 28,229, 61,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,220,199, 3, 63, 89,219, 24, 62, 14,150,243, 62,204, 79, 47, 62,140,248,236, 62,182,202, 34, 62,219,199, 3, 63, - 18, 28,229, 61,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0,184,152, 21, 63,182, 47, 53, 62,250,104, 16, 63, - 16,113, 55, 62, 79,190, 13, 63,160,193, 46, 62,174,254, 16, 63, 94, 45, 34, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0, 14,150,243, 62,204, 79, 47, 62,200, 68,238, 62, 76, 62, 56, 62,183,207,227, 62,250, 75, 54, 62,140,248,236, 62, -182,202, 34, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0,137, 57, 22, 63, 81, 93, 61, 62,206,186, 16, 63, - 85,129, 72, 62,250,104, 16, 63, 16,113, 55, 62,184,152, 21, 63,182, 47, 53, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,200, 68,238, 62, 76, 62, 56, 62,192,187,237, 62,194,118, 73, 62,122,152,226, 62,190,166, 62, 62,183,207,227, 62, -250, 75, 54, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,250,249, 22, 63,160,251, 88, 62,222, 32, 16, 63, - 34,106, 93, 62,206,186, 16, 63, 85,129, 72, 62,137, 57, 22, 63, 81, 93, 61, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192,187,237, 62,194,118, 73, 62, 21, 19,239, 62,121,110, 94, 62, 90, 83,225, 62, 21,153, 90, 62,122,152,226, 62, -190,166, 62, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 20, 81, 25, 63, 17, 56,132, 62,206,243, 15, 63, -182,207,136, 62,222, 32, 16, 63, 34,106, 93, 62,250,249, 22, 63,160,251, 88, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 21, 19,239, 62,121,110, 94, 62, 92,193,239, 62,113, 61,137, 62, 54, 42,221, 62,209, 25,133, 62, 90, 83,225, 62, - 21,153, 90, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,111,239, 27, 63,159, 77,166, 62, 91, 94, 37, 63, -107,120,187, 62, 66, 21, 30, 63,178,139,200, 62,158,237, 12, 63, 38,241,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,139,125,211, 62,170,171,200, 62,156, 28,197, 62,166,130,187, 62,115, 21,216, 62, 14,177,166, 62, 15,175,245, 62, -188, 14,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 91, 94, 37, 63,107,120,187, 62, 87, 57, 43, 63, -222, 58,206, 62, 24,163, 39, 63,174, 95,216, 62, 66, 21, 30, 63,178,139,200, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 98,194,191, 62, 42, 94,216, 62,130,207,184, 62, 42, 27,206, 62,156, 28,197, 62,166,130,187, 62,139,125,211, 62, -170,171,200, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 87, 57, 43, 63,222, 58,206, 62, 38,229, 50, 63, -169, 32,226, 62,177, 79, 43, 63,202,194,231, 62, 24,163, 39, 63,174, 95,216, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 60,201,183, 62, 82,218,231, 62,196, 39,168, 62,206, 11,226, 62,130,207,184, 62, 42, 27,206, 62, 98,194,191, 62, - 42, 94,216, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 38,229, 50, 63,169, 32,226, 62, 62,134, 48, 63, - 37,107,249, 62,154,190, 43, 63,192, 0,249, 62,177, 79, 43, 63,202,194,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,138,190,182, 62, 35, 49,249, 62,172,229,172, 62,116,127,249, 62,196, 39,168, 62,206, 11,226, 62, 60,201,183, 62, - 82,218,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 62,134, 48, 63, 37,107,249, 62,238, 88, 46, 63, -146,223, 2, 63,123,207, 40, 63,218,175,254, 62,154,190, 43, 63,192, 0,249, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 2,184,188, 62,140, 0,255, 62,173, 87,177, 62,102, 9, 3, 63,172,229,172, 62,116,127,249, 62,138,190,182, 62, - 35, 49,249, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,238, 88, 46, 63,146,223, 2, 63,220,158, 34, 63, -175, 23, 10, 63,126, 77, 30, 63,156, 88, 5, 63,123,207, 40, 63,218,175,254, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 89, 65,210, 62, 56,158, 5, 63,124,109,201, 62, 72,121, 10, 63,173, 87,177, 62,102, 9, 3, 63, 2,184,188, 62, -140, 0,255, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,220,158, 34, 63,175, 23, 10, 63, 28,105, 26, 63, -242,194, 11, 63,244,120, 25, 63, 78,242, 7, 63,126, 77, 30, 63,156, 88, 5, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 0, 39,220, 62,252, 58, 8, 63,220, 73,218, 62,169, 31, 12, 63,124,109,201, 62, 72,121, 10, 63, 89, 65,210, 62, - 56,158, 5, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 28,105, 26, 63,242,194, 11, 63,173,244, 22, 63, -236,215, 11, 63,202, 47, 22, 63,156, 60, 8, 63,244,120, 25, 63, 78,242, 7, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 11,221,226, 62, 90,125, 8, 63,220, 89,225, 62, 77, 42, 12, 63,220, 73,218, 62,169, 31, 12, 63, 0, 39,220, 62, -252, 58, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,173,244, 22, 63,236,215, 11, 63, 67,169, 11, 63, - 18,197, 11, 63,106,252, 12, 63,180,173, 3, 63,202, 47, 22, 63,156, 60, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 35,114,245, 62,233,196, 3, 63, 55, 72,248, 62, 91,232, 11, 63,220, 89,225, 62, 77, 42, 12, 63, 11,221,226, 62, - 90,125, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 67,169, 11, 63, 18,197, 11, 63,148,232, 3, 63, -164, 17, 11, 63,162,220, 3, 63, 45, 88, 0, 63,106,252, 12, 63,180,173, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,162,220, 3, 63, 45, 88, 0, 63,148,232, 3, 63,164, 17, 11, 63, 55, 72,248, 62, 91,232, 11, 63, 35,114,245, 62, -233,196, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,103, 59, 17, 63,120,195,255, 62,240, 81, 22, 63, -114, 70, 1, 63,202, 47, 22, 63,156, 60, 8, 63,106,252, 12, 63,180,173, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 11,221,226, 62, 90,125, 8, 63,106,128,226, 62,198,111, 1, 63,209,213,236, 62, 4,250,255, 62, 35,114,245, 62, -233,196, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,240, 81, 22, 63,114, 70, 1, 63,151,182, 25, 63, -130, 9, 1, 63,244,120, 25, 63, 78,242, 7, 63,202, 47, 22, 63,156, 60, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 0, 39,220, 62,252, 58, 8, 63,213,150,219, 62, 50, 55, 1, 63,106,128,226, 62,198,111, 1, 63, 11,221,226, 62, - 90,125, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 96, 49, 30, 63,121,229,254, 62,126, 77, 30, 63, -156, 88, 5, 63,244,120, 25, 63, 78,242, 7, 63,151,182, 25, 63,130, 9, 1, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 0, 39,220, 62,252, 58, 8, 63, 89, 65,210, 62, 56,158, 5, 63,176,116,210, 62,227, 62,255, 62,213,150,219, 62, - 50, 55, 1, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 25,113, 37, 63, 35,157,247, 62,123,207, 40, 63, -218,175,254, 62,126, 77, 30, 63,156, 88, 5, 63, 96, 49, 30, 63,121,229,254, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 89, 65,210, 62, 56,158, 5, 63, 2,184,188, 62,140, 0,255, 62,189,165,195, 62,139,232,247, 62,176,116,210, 62, -227, 62,255, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 92, 62, 39, 63,121, 75,240, 62,154,190, 43, 63, -192, 0,249, 62,123,207, 40, 63,218,175,254, 62, 25,113, 37, 63, 35,157,247, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 2,184,188, 62,140, 0,255, 62,138,190,182, 62, 35, 49,249, 62,222, 10,192, 62,163,128,240, 62,189,165,195, 62, -139,232,247, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,140,149, 38, 63, 38, 95,229, 62,177, 79, 43, 63, -202,194,231, 62,154,190, 43, 63,192, 0,249, 62, 92, 62, 39, 63,121, 75,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,138,190,182, 62, 35, 49,249, 62, 60,201,183, 62, 82,218,231, 62,168,140,193, 62, 94,129,229, 62,222, 10,192, 62, -163,128,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 14,120, 33, 63,166,238,214, 62, 24,163, 39, 63, -174, 95,216, 62,177, 79, 43, 63,202,194,231, 62,140,149, 38, 63, 38, 95,229, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 60,201,183, 62, 82,218,231, 62, 98,194,191, 62, 42, 94,216, 62,168, 75,204, 62, 62, 7,215, 62,168,140,193, 62, - 94,129,229, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,165,178, 27, 63,128, 17,208, 62, 66, 21, 30, 63, -178,139,200, 62, 24,163, 39, 63,174, 95,216, 62, 14,120, 33, 63,166,238,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 98,194,191, 62, 42, 94,216, 62,139,125,211, 62,170,171,200, 62, 6, 24,216, 62,128, 57,208, 62,168, 75,204, 62, - 62, 7,215, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 15, 97, 17, 63,220, 34,214, 62,158,237, 12, 63, - 38,241,187, 62, 66, 21, 30, 63,178,139,200, 62,165,178, 27, 63,128, 17,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,139,125,211, 62,170,171,200, 62, 15,175,245, 62,188, 14,188, 62,217,200,236, 62,134, 49,214, 62, 6, 24,216, 62, -128, 57,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 15, 97, 17, 63,220, 34,214, 62,149,244, 14, 63, - 4, 42,221, 62,147,230, 3, 63, 78, 47,208, 62,158,237, 12, 63, 38,241,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,147,230, 3, 63, 78, 47,208, 62,141,144,241, 62,244, 52,221, 62,217,200,236, 62,134, 49,214, 62, 15,175,245, 62, -188, 14,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,103, 59, 17, 63,120,195,255, 62,106,252, 12, 63, -180,173, 3, 63,162,220, 3, 63, 45, 88, 0, 63, 71, 25, 13, 63,116,163,243, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,162,220, 3, 63, 45, 88, 0, 63, 35,114,245, 62,233,196, 3, 63,209,213,236, 62, 4,250,255, 62, 0, 45,245, 62, -206,185,243, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 71, 25, 13, 63,116,163,243, 62,162,220, 3, 63, - 45, 88, 0, 63,215,220, 3, 63,148,189,231, 62, 64, 2, 13, 63, 52,215,230, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,215,220, 3, 63,148,189,231, 62,162,220, 3, 63, 45, 88, 0, 63, 0, 45,245, 62,206,185,243, 62,219,100,245, 62, -184,230,230, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,147,230, 3, 63, 78, 47,208, 62,149,244, 14, 63, - 4, 42,221, 62, 64, 2, 13, 63, 52,215,230, 62,215,220, 3, 63,148,189,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,219,100,245, 62,184,230,230, 62,141,144,241, 62,244, 52,221, 62,147,230, 3, 63, 78, 47,208, 62,215,220, 3, 63, -148,189,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,250, 61, 7, 63,148, 31, 54, 62,193,202, 3, 63, -214,174, 49, 62,220,199, 3, 63, 89,219, 24, 62, 79,190, 13, 63,160,193, 46, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,220,199, 3, 63, 89,219, 24, 62,193,202, 3, 63,214,174, 49, 62,175, 87, 0, 63,251, 90, 54, 62, 14,150,243, 62, -204, 79, 47, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 68,214, 9, 63,246,237, 66, 62,250, 61, 7, 63, -148, 31, 54, 62, 79,190, 13, 63,160,193, 46, 62,250,104, 16, 63, 16,113, 55, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 14,150,243, 62,204, 79, 47, 62,175, 87, 0, 63,251, 90, 54, 62,104,137,251, 62,179, 92, 67, 62,200, 68,238, 62, - 76, 62, 56, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,237,221, 8, 63,218, 90, 91, 62, 68,214, 9, 63, -246,237, 66, 62,250,104, 16, 63, 16,113, 55, 62,206,186, 16, 63, 85,129, 72, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,200, 68,238, 62, 76, 62, 56, 62,104,137,251, 62,179, 92, 67, 62, 39,153,253, 62, 27,195, 91, 62,192,187,237, 62, -194,118, 73, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,206,243, 15, 63,182,207,136, 62, 77, 32, 8, 63, - 10, 39,139, 62, 22,117, 9, 63,146,203, 97, 62,222, 32, 16, 63, 34,106, 93, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192,110,252, 62, 79, 68, 98, 62,219, 89,255, 62,116, 79,139, 62, 92,193,239, 62,113, 61,137, 62, 21, 19,239, 62, -121,110, 94, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,237,221, 8, 63,218, 90, 91, 62,206,186, 16, 63, - 85,129, 72, 62,222, 32, 16, 63, 34,106, 93, 62, 22,117, 9, 63,146,203, 97, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 21, 19,239, 62,121,110, 94, 62,192,187,237, 62,194,118, 73, 62, 39,153,253, 62, 27,195, 91, 62,192,110,252, 62, - 79, 68, 98, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,119,125, 9, 63, 7,112,158, 62, 70,233, 3, 63, - 88, 27,154, 62,235,229, 3, 63, 97,108,139, 62, 77, 32, 8, 63, 10, 39,139, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,235,229, 3, 63, 97,108,139, 62, 70,233, 3, 63, 88, 27,154, 62,165,179,252, 62,163,140,158, 62,219, 89,255, 62, -116, 79,139, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 22,117, 9, 63,146,203, 97, 62, 77, 32, 8, 63, - 10, 39,139, 62,235,229, 3, 63, 97,108,139, 62,246,215, 3, 63,143, 56,101, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,235,229, 3, 63, 97,108,139, 62,219, 89,255, 62,116, 79,139, 62,192,110,252, 62, 79, 68, 98, 62,246,215, 3, 63, -143, 56,101, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,147,210, 3, 63,221, 95, 86, 62,237,221, 8, 63, -218, 90, 91, 62, 22,117, 9, 63,146,203, 97, 62,246,215, 3, 63,143, 56,101, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192,110,252, 62, 79, 68, 98, 62, 39,153,253, 62, 27,195, 91, 62,147,210, 3, 63,221, 95, 86, 62,246,215, 3, 63, -143, 56,101, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 5, 54, 12, 63,188,183,167, 62,250, 61, 9, 63, -252,214,168, 62,152,143, 8, 63, 45,107,163, 62,119,125, 9, 63, 7,112,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,100,136,254, 62, 38,123,163, 62,110, 39,253, 62,103,224,168, 62, 98, 68,247, 62,146,206,167, 62,165,179,252, 62, -163,140,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,135,196, 10, 63, 52,208,178, 62, 25,233, 8, 63, -116,110,175, 62,250, 61, 9, 63,252,214,168, 62, 5, 54, 12, 63,188,183,167, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,110, 39,253, 62,103,224,168, 62,102,195,253, 62,184,102,175, 62, 98, 14,250, 62,149,202,178, 62, 98, 68,247, 62, -146,206,167, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 69, 17, 4, 63,105,176,182, 62, 69,138, 6, 63, - 80,180,177, 62, 25,233, 8, 63,116,110,175, 62,135,196, 10, 63, 52,208,178, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,102,195,253, 62,184,102,175, 62, 14, 49, 1, 63, 62,150,177, 62, 69, 17, 4, 63,105,176,182, 62, 98, 14,250, 62, -149,202,178, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,209,124, 3, 63, 70, 0,177, 62, 11,232, 3, 63, -140, 4,174, 62, 69,138, 6, 63, 80,180,177, 62, 69, 17, 4, 63,105,176,182, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 14, 49, 1, 63, 62,150,177, 62, 11,232, 3, 63,140, 4,174, 62,209,124, 3, 63, 70, 0,177, 62, 69, 17, 4, 63, -105,176,182, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 70,233, 3, 63, 88, 27,154, 62,119,125, 9, 63, - 7,112,158, 62,152,143, 8, 63, 45,107,163, 62,212,232, 3, 63, 58,152,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,100,136,254, 62, 38,123,163, 62,165,179,252, 62,163,140,158, 62, 70,233, 3, 63, 88, 27,154, 62,212,232, 3, 63, - 58,152,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,212,232, 3, 63, 58,152,158, 62,152,143, 8, 63, - 45,107,163, 62,121, 91, 7, 63,134, 51,166, 62,205,231, 3, 63, 58,149,162, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 44,116, 0, 63,255, 56,166, 62,100,136,254, 62, 38,123,163, 62,212,232, 3, 63, 58,152,158, 62,205,231, 3, 63, - 58,149,162, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 11,232, 3, 63,140, 4,174, 62,214,233, 3, 63, -198,154,170, 62,233,110, 6, 63, 94,152,174, 62, 69,138, 6, 63, 80,180,177, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,228, 82, 1, 63, 95,140,174, 62,214,233, 3, 63,198,154,170, 62, 11,232, 3, 63,140, 4,174, 62, 14, 49, 1, 63, - 62,150,177, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 69,138, 6, 63, 80,180,177, 62,233,110, 6, 63, - 94,152,174, 62, 59,236, 7, 63, 19,123,173, 62, 25,233, 8, 63,116,110,175, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,217,185,255, 62, 92,116,173, 62,228, 82, 1, 63, 95,140,174, 62, 14, 49, 1, 63, 62,150,177, 62,102,195,253, 62, -184,102,175, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 25,233, 8, 63,116,110,175, 62, 59,236, 7, 63, - 19,123,173, 62, 85,249, 7, 63, 92, 52,169, 62,250, 61, 9, 63,252,214,168, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,169,255, 62, 6, 57,169, 62,217,185,255, 62, 92,116,173, 62,102,195,253, 62,184,102,175, 62,110, 39,253, 62, -103,224,168, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,250, 61, 9, 63,252,214,168, 62, 85,249, 7, 63, - 92, 52,169, 62,121, 91, 7, 63,134, 51,166, 62,152,143, 8, 63, 45,107,163, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 44,116, 0, 63,255, 56,166, 62,160,169,255, 62, 6, 57,169, 62,110, 39,253, 62,103,224,168, 62,100,136,254, 62, - 38,123,163, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,214,233, 3, 63,198,154,170, 62, 85,249, 7, 63, - 92, 52,169, 62, 59,236, 7, 63, 19,123,173, 62,233,110, 6, 63, 94,152,174, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,217,185,255, 62, 92,116,173, 62,160,169,255, 62, 6, 57,169, 62,214,233, 3, 63,198,154,170, 62,228, 82, 1, 63, - 95,140,174, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,214,233, 3, 63,198,154,170, 62,205,231, 3, 63, - 58,149,162, 62,121, 91, 7, 63,134, 51,166, 62, 85,249, 7, 63, 92, 52,169, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 44,116, 0, 63,255, 56,166, 62,205,231, 3, 63, 58,149,162, 62,214,233, 3, 63,198,154,170, 62,160,169,255, 62, - 6, 57,169, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 69, 17, 4, 63,105,176,182, 62,135,196, 10, 63, - 52,208,178, 62,158,237, 12, 63, 38,241,187, 62,147,230, 3, 63, 78, 47,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 15,175,245, 62,188, 14,188, 62, 98, 14,250, 62,149,202,178, 62, 69, 17, 4, 63,105,176,182, 62,147,230, 3, 63, - 78, 47,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,135,196, 10, 63, 52,208,178, 62, 5, 54, 12, 63, -188,183,167, 62,112, 0, 16, 63,254,246,164, 62,158,237, 12, 63, 38,241,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,207,187,239, 62, 19, 42,165, 62, 98, 68,247, 62,146,206,167, 62, 98, 14,250, 62,149,202,178, 62, 15,175,245, 62, -188, 14,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 5, 54, 12, 63,188,183,167, 62,119,125, 9, 63, - 7,112,158, 62, 44,250, 15, 63,109, 0,154, 62,112, 0, 16, 63,254,246,164, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 56,205,239, 62, 8, 71,154, 62,165,179,252, 62,163,140,158, 62, 98, 68,247, 62,146,206,167, 62,207,187,239, 62, - 19, 42,165, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,119,125, 9, 63, 7,112,158, 62, 77, 32, 8, 63, - 10, 39,139, 62,206,243, 15, 63,182,207,136, 62, 44,250, 15, 63,109, 0,154, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 92,193,239, 62,113, 61,137, 62,219, 89,255, 62,116, 79,139, 62,165,179,252, 62,163,140,158, 62, 56,205,239, 62, - 8, 71,154, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 20, 81, 25, 63, 17, 56,132, 62,208, 46, 27, 63, -149, 35,148, 62, 44,250, 15, 63,109, 0,154, 62,206,243, 15, 63,182,207,136, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 56,205,239, 62, 8, 71,154, 62,238,166,217, 62,229,221,148, 62, 54, 42,221, 62,209, 25,133, 62, 92,193,239, 62, -113, 61,137, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,208, 46, 27, 63,149, 35,148, 62, 36,177, 27, 63, -158,151,156, 62,112, 0, 16, 63,254,246,164, 62, 44,250, 15, 63,109, 0,154, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,207,187,239, 62, 19, 42,165, 62, 0,160,216, 62,127, 44,157, 62,238,166,217, 62,229,221,148, 62, 56,205,239, 62, - 8, 71,154, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,111,239, 27, 63,159, 77,166, 62,158,237, 12, 63, - 38,241,187, 62,112, 0, 16, 63,254,246,164, 62, 36,177, 27, 63,158,151,156, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,207,187,239, 62, 19, 42,165, 62, 15,175,245, 62,188, 14,188, 62,115, 21,216, 62, 14,177,166, 62, 0,160,216, 62, -127, 44,157, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,237,221, 8, 63,218, 90, 91, 62,147,210, 3, 63, -221, 95, 86, 62,129,211, 3, 63,248,168, 83, 62,170, 33, 8, 63,254,149, 86, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,129,211, 3, 63,248,168, 83, 62,147,210, 3, 63,221, 95, 86, 62, 39,153,253, 62, 27,195, 91, 62, 8, 14,255, 62, - 58,232, 86, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 68,214, 9, 63,246,237, 66, 62,237,221, 8, 63, -218, 90, 91, 62,170, 33, 8, 63,254,149, 86, 62, 20,180, 8, 63, 94, 29, 69, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 8, 14,255, 62, 58,232, 86, 62, 39,153,253, 62, 27,195, 91, 62,104,137,251, 62,179, 92, 67, 62, 19,210,253, 62, - 55,114, 69, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,250, 61, 7, 63,148, 31, 54, 62, 68,214, 9, 63, -246,237, 66, 62, 20,180, 8, 63, 94, 29, 69, 62,168, 82, 6, 63, 80, 43, 57, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 19,210,253, 62, 55,114, 69, 62,104,137,251, 62,179, 92, 67, 62,175, 87, 0, 63,251, 90, 54, 62, 48, 68, 1, 63, -166, 84, 57, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,193,202, 3, 63,214,174, 49, 62,250, 61, 7, 63, -148, 31, 54, 62,168, 82, 6, 63, 80, 43, 57, 62,205,202, 3, 63, 8, 22, 54, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 48, 68, 1, 63,166, 84, 57, 62,175, 87, 0, 63,251, 90, 54, 62,193,202, 3, 63,214,174, 49, 62,205,202, 3, 63, - 8, 22, 54, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,205,202, 3, 63, 8, 22, 54, 62,168, 82, 6, 63, - 80, 43, 57, 62,246, 24, 5, 63, 26,150, 66, 62,213,205, 3, 63,220,232, 64, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 29,131, 2, 63, 22,172, 66, 62, 48, 68, 1, 63,166, 84, 57, 62,205,202, 3, 63, 8, 22, 54, 62,213,205, 3, 63, -220,232, 64, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,168, 82, 6, 63, 80, 43, 57, 62, 20,180, 8, 63, - 94, 29, 69, 62, 39, 83, 6, 63,191,114, 70, 62,246, 24, 5, 63, 26,150, 66, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,185, 75, 1, 63,222,160, 70, 62, 19,210,253, 62, 55,114, 69, 62, 48, 68, 1, 63,166, 84, 57, 62, 29,131, 2, 63, - 22,172, 66, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 20,180, 8, 63, 94, 29, 69, 62,170, 33, 8, 63, -254,149, 86, 62, 4,111, 6, 63, 40,172, 76, 62, 39, 83, 6, 63,191,114, 70, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,157, 51, 1, 63,158,218, 76, 62, 8, 14,255, 62, 58,232, 86, 62, 19,210,253, 62, 55,114, 69, 62,185, 75, 1, 63, -222,160, 70, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,170, 33, 8, 63,254,149, 86, 62,129,211, 3, 63, -248,168, 83, 62,234,208, 3, 63,146, 43, 75, 62, 4,111, 6, 63, 40,172, 76, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,234,208, 3, 63,146, 43, 75, 62,129,211, 3, 63,248,168, 83, 62, 8, 14,255, 62, 58,232, 86, 62,157, 51, 1, 63, -158,218, 76, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,234,208, 3, 63,146, 43, 75, 62,213,205, 3, 63, -220,232, 64, 62,246, 24, 5, 63, 26,150, 66, 62, 4,111, 6, 63, 40,172, 76, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 29,131, 2, 63, 22,172, 66, 62,213,205, 3, 63,220,232, 64, 62,234,208, 3, 63,146, 43, 75, 62,157, 51, 1, 63, -158,218, 76, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 4,111, 6, 63, 40,172, 76, 62,246, 24, 5, 63, - 26,150, 66, 62, 39, 83, 6, 63,191,114, 70, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,185, 75, 1, 63,222,160, 70, 62, 29,131, 2, 63, 22,172, 66, 62,157, 51, 1, 63,158,218, 76, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 64, 2, 13, 63, 52,215,230, 62,149,244, 14, 63, - 4, 42,221, 62, 4,216, 16, 63,160, 24,224, 62,120,200, 15, 63, 84,255,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,119,193,237, 62,190, 38,224, 62,141,144,241, 62,244, 52,221, 62,219,100,245, 62,184,230,230, 62, 21,211,239, 62, -185, 18,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 71, 25, 13, 63,116,163,243, 62, 64, 2, 13, 63, - 52,215,230, 62,120,200, 15, 63, 84,255,231, 62,184,171, 16, 63, 40,133,241, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 21,211,239, 62,185, 18,232, 62,219,100,245, 62,184,230,230, 62, 0, 45,245, 62,206,185,243, 62,218,252,237, 62, - 62,160,241, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,103, 59, 17, 63,120,195,255, 62, 71, 25, 13, 63, -116,163,243, 62,184,171, 16, 63, 40,133,241, 62, 55, 44, 19, 63, 86, 21,250, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,218,252,237, 62, 62,160,241, 62, 0, 45,245, 62,206,185,243, 62,209,213,236, 62, 4,250,255, 62,153,228,232, 62, -154, 67,250, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,149,244, 14, 63, 4, 42,221, 62, 15, 97, 17, 63, -220, 34,214, 62,217, 53, 19, 63, 16,211,218, 62, 4,216, 16, 63,160, 24,224, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 8, 14,233, 62, 66,226,218, 62,217,200,236, 62,134, 49,214, 62,141,144,241, 62,244, 52,221, 62,119,193,237, 62, -190, 38,224, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 15, 97, 17, 63,220, 34,214, 62,165,178, 27, 63, -128, 17,208, 62,205,198, 26, 63,124,184,214, 62,217, 53, 19, 63, 16,211,218, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,216,214,217, 62,218,224,214, 62, 6, 24,216, 62,128, 57,208, 62,217,200,236, 62,134, 49,214, 62, 8, 14,233, 62, - 66,226,218, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,165,178, 27, 63,128, 17,208, 62, 14,120, 33, 63, -166,238,214, 62,156,136, 31, 63,194,138,219, 62,205,198, 26, 63,124,184,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,254, 30,208, 62,204,177,219, 62,168, 75,204, 62, 62, 7,215, 62, 6, 24,216, 62,128, 57,208, 62,216,214,217, 62, -218,224,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 14,120, 33, 63,166,238,214, 62,140,149, 38, 63, - 38, 95,229, 62, 79, 9, 36, 63, 94,224,229, 62,156,136, 31, 63,194,138,219, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,148,192,198, 62,182, 11,230, 62,168,140,193, 62, 94,129,229, 62,168, 75,204, 62, 62, 7,215, 62,254, 30,208, 62, -204,177,219, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,140,149, 38, 63, 38, 95,229, 62, 92, 62, 39, 63, -121, 75,240, 62, 14, 49, 36, 63,253, 88,239, 62, 79, 9, 36, 63, 94,224,229, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 97, 71,198, 62,192,149,239, 62,222, 10,192, 62,163,128,240, 62,168,140,193, 62, 94,129,229, 62,148,192,198, 62, -182, 11,230, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 92, 62, 39, 63,121, 75,240, 62, 25,113, 37, 63, - 35,157,247, 62,243, 33, 35, 63, 80,143,245, 62, 14, 49, 36, 63,253, 88,239, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 87, 99,200, 62,172,217,245, 62,189,165,195, 62,139,232,247, 62,222, 10,192, 62,163,128,240, 62, 97, 71,198, 62, -192,149,239, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 25,113, 37, 63, 35,157,247, 62, 96, 49, 30, 63, -121,229,254, 62,223, 49, 29, 63,199,140,250, 62,243, 33, 35, 63, 80,143,245, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,147,124,212, 62,146,215,250, 62,176,116,210, 62,227, 62,255, 62,189,165,195, 62,139,232,247, 62, 87, 99,200, 62, -172,217,245, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 96, 49, 30, 63,121,229,254, 62,151,182, 25, 63, -130, 9, 1, 63, 50,181, 25, 63,118,111,253, 62,223, 49, 29, 63,199,140,250, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 52,151,219, 62, 68,186,253, 62,213,150,219, 62, 50, 55, 1, 63,176,116,210, 62,227, 62,255, 62,147,124,212, 62, -146,215,250, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,151,182, 25, 63,130, 9, 1, 63,240, 81, 22, 63, -114, 70, 1, 63,241,188, 22, 63, 28,149,253, 62, 50,181, 25, 63,118,111,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,212,163,225, 62, 91,215,253, 62,106,128,226, 62,198,111, 1, 63,213,150,219, 62, 50, 55, 1, 63, 52,151,219, 62, - 68,186,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,240, 81, 22, 63,114, 70, 1, 63,103, 59, 17, 63, -120,195,255, 62, 55, 44, 19, 63, 86, 21,250, 62,241,188, 22, 63, 28,149,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,153,228,232, 62,154, 67,250, 62,209,213,236, 62, 4,250,255, 62,106,128,226, 62,198,111, 1, 63,212,163,225, 62, - 91,215,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,241,188, 22, 63, 28,149,253, 62, 55, 44, 19, 63, - 86, 21,250, 62, 9,165, 20, 63,248, 99,247, 62, 20, 0, 23, 63, 6, 57,251, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,232,232,229, 62, 74,142,247, 62,153,228,232, 62,154, 67,250, 62,212,163,225, 62, 91,215,253, 62,145, 26,225, 62, -114,116,251, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 50,181, 25, 63,118,111,253, 62,241,188, 22, 63, - 28,149,253, 62, 20, 0, 23, 63, 6, 57,251, 62,130,144, 25, 63,128, 7,251, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,145, 26,225, 62,114,116,251, 62,212,163,225, 62, 91,215,253, 62, 52,151,219, 62, 68,186,253, 62,177,225,219, 62, - 67, 75,251, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,223, 49, 29, 63,199,140,250, 62, 50,181, 25, 63, -118,111,253, 62,130,144, 25, 63,128, 7,251, 62, 80,195, 28, 63, 55,166,248, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,177,225,219, 62, 67, 75,251, 62, 52,151,219, 62, 68,186,253, 62,147,124,212, 62,146,215,250, 62,233, 95,213, 62, - 20,237,248, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,243, 33, 35, 63, 80,143,245, 62,223, 49, 29, 63, -199,140,250, 62, 80,195, 28, 63, 55,166,248, 62, 22,164, 33, 63,102, 75,243, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,233, 95,213, 62, 20,237,248, 62,147,124,212, 62,146,215,250, 62, 87, 99,200, 62,172,217,245, 62, 65,114,203, 62, -159,143,243, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 14, 49, 36, 63,253, 88,239, 62,243, 33, 35, 63, - 80,143,245, 62, 22,164, 33, 63,102, 75,243, 62, 30,160, 34, 63,169, 47,238, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 65,114,203, 62,159,143,243, 62, 87, 99,200, 62,172,217,245, 62, 97, 71,198, 62,192,149,239, 62,188,128,201, 62, -126,110,238, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 79, 9, 36, 63, 94,224,229, 62, 14, 49, 36, 63, -253, 88,239, 62, 30,160, 34, 63,169, 47,238, 62,131,144, 34, 63,253, 87,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,188,128,201, 62,126,110,238, 62, 97, 71,198, 62,192,149,239, 62,148,192,198, 62,182, 11,230, 62,141,190,201, 62, -124,140,231, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,156,136, 31, 63,194,138,219, 62, 79, 9, 36, 63, - 94,224,229, 62,131,144, 34, 63,253, 87,231, 62, 21,208, 30, 63,174,182,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,141,190,201, 62,124,140,231, 62,148,192,198, 62,182, 11,230, 62,254, 30,208, 62,204,177,219, 62,168,133,209, 62, - 51,221,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,205,198, 26, 63,124,184,214, 62,156,136, 31, 63, -194,138,219, 62, 21,208, 30, 63,174,182,221, 62,128,218, 26, 63, 68,206,217, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,168,133,209, 62, 51,221,221, 62,254, 30,208, 62,204,177,219, 62,216,214,217, 62,218,224,214, 62, 11,157,217, 62, - 64,243,217, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,217, 53, 19, 63, 16,211,218, 62,205,198, 26, 63, -124,184,214, 62,128,218, 26, 63, 68,206,217, 62,103, 53, 20, 63,236, 84,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 11,157,217, 62, 64,243,217, 62,216,214,217, 62,218,224,214, 62, 8, 14,233, 62, 66,226,218, 62, 68, 5,231, 62, -234,101,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 4,216, 16, 63,160, 24,224, 62,217, 53, 19, 63, - 16,211,218, 62,103, 53, 20, 63,236, 84,221, 62, 81, 87, 18, 63, 33,175,226, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 68, 5,231, 62,234,101,221, 62, 8, 14,233, 62, 66,226,218, 62,119,193,237, 62,190, 38,224, 62,180,187,234, 62, -249,190,226, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 55, 44, 19, 63, 86, 21,250, 62,184,171, 16, 63, - 40,133,241, 62, 98, 68, 18, 63,150,197,240, 62, 9,165, 20, 63,248, 99,247, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 35,197,234, 62,215,226,240, 62,218,252,237, 62, 62,160,241, 62,153,228,232, 62,154, 67,250, 62,232,232,229, 62, - 74,142,247, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,184,171, 16, 63, 40,133,241, 62,120,200, 15, 63, - 84,255,231, 62,161, 4, 18, 63,138,184,232, 62, 98, 68, 18, 63,150,197,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,154, 85,235, 62, 92,206,232, 62, 21,211,239, 62,185, 18,232, 62,218,252,237, 62, 62,160,241, 62, 35,197,234, 62, -215,226,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,120,200, 15, 63, 84,255,231, 62, 4,216, 16, 63, -160, 24,224, 62, 81, 87, 18, 63, 33,175,226, 62,161, 4, 18, 63,138,184,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,180,187,234, 62,249,190,226, 62,119,193,237, 62,190, 38,224, 62, 21,211,239, 62,185, 18,232, 62,154, 85,235, 62, - 92,206,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,148,232, 3, 63,164, 17, 11, 63, 67,169, 11, 63, - 18,197, 11, 63,216,120, 13, 63,160, 81, 23, 63,147, 15, 4, 63,227,248, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 64, 27,245, 62,100,166, 23, 63, 55, 72,248, 62, 91,232, 11, 63,148,232, 3, 63,164, 17, 11, 63,147, 15, 4, 63, -227,248, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 67,169, 11, 63, 18,197, 11, 63,173,244, 22, 63, -236,215, 11, 63, 94,233, 23, 63,186, 60, 16, 63,216,120, 13, 63,160, 81, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,109,130,223, 62,118,165, 16, 63,220, 89,225, 62, 77, 42, 12, 63, 55, 72,248, 62, 91,232, 11, 63, 64, 27,245, 62, -100,166, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,173,244, 22, 63,236,215, 11, 63, 28,105, 26, 63, -242,194, 11, 63,220, 56, 28, 63, 66,250, 14, 63, 94,233, 23, 63,186, 60, 16, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,157,161,214, 62,219,110, 15, 63,220, 73,218, 62,169, 31, 12, 63,220, 89,225, 62, 77, 42, 12, 63,109,130,223, 62, -118,165, 16, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 28,105, 26, 63,242,194, 11, 63,220,158, 34, 63, -175, 23, 10, 63,109, 44, 39, 63,107,221, 19, 63,220, 56, 28, 63, 66,250, 14, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,156, 26,192, 62, 31,139, 20, 63,124,109,201, 62, 72,121, 10, 63,220, 73,218, 62,169, 31, 12, 63,157,161,214, 62, -219,110, 15, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,220,158, 34, 63,175, 23, 10, 63,238, 88, 46, 63, -146,223, 2, 63,242, 80, 56, 63, 44,244, 6, 63,109, 44, 39, 63,107,221, 19, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 64, 0, 61,208,156, 62,204, 16, 7, 63,173, 87,177, 62,102, 9, 3, 63,124,109,201, 62, 72,121, 10, 63,156, 26,192, 62, - 31,139, 20, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 16, 0,238, 88, 46, 63,146,223, 2, 63, 62,134, 48, 63, - 37,107,249, 62,195,173, 54, 63,239,106,252, 62,242, 80, 56, 63, 44,244, 6, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0,202, 36,160, 62, 94, 51,252, 62,172,229,172, 62,116,127,249, 62,173, 87,177, 62,102, 9, 3, 63, 61,208,156, 62, -204, 16, 7, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0, 62,134, 48, 63, 37,107,249, 62, 38,229, 50, 63, -169, 32,226, 62,154, 88, 53, 63,240,146,221, 62,195,173, 54, 63,239,106,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 64, 0,128,172,162, 62, 17,169,221, 62,196, 39,168, 62,206, 11,226, 62,172,229,172, 62,116,127,249, 62,202, 36,160, 62, - 94, 51,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 16, 0, 38,229, 50, 63,169, 32,226, 62, 87, 57, 43, 63, -222, 58,206, 62,240,117, 49, 63,164,138,198, 62,154, 88, 53, 63,240,146,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0,147,137,172, 62,148, 19,198, 62,130,207,184, 62, 42, 27,206, 62,196, 39,168, 62,206, 11,226, 62,128,172,162, 62, - 17,169,221, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0, 87, 57, 43, 63,222, 58,206, 62, 91, 94, 37, 63, -107,120,187, 62,156,160, 41, 63, 56,175,182, 62,240,117, 49, 63,164,138,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,202,212,188, 62,245,163,182, 62,156, 28,197, 62,166,130,187, 62,130,207,184, 62, 42, 27,206, 62,147,137,172, 62, -148, 19,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,165,252, 48, 63,133, 33, 85, 62,112, 54, 48, 63, - 20, 19, 96, 62,172, 36, 46, 63,208, 7,129, 62,240, 17, 42, 63,129, 84, 97, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 76, 71,181, 62,204,200,131, 62,117,121,175, 62,183,185,106, 62,217, 24,172, 62, 21,237, 92, 62,138, 81,187, 62, - 59, 40,103, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,204, 89, 48, 63,134,194, 4, 62,165,252, 48, 63, -133, 33, 85, 62,240, 17, 42, 63,129, 84, 97, 62,160,125, 37, 63, 50,211, 46, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,138, 81,187, 62, 59, 40,103, 62,217, 24,172, 62, 21,237, 92, 62, 94,197,172, 62,109,200, 4, 62, 25,121,195, 62, - 46,253, 48, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0, 11, 44, 20, 63, 20, 26,163, 61,204, 89, 48, 63, -134,194, 4, 62,160,125, 37, 63, 50,211, 46, 62, 40, 92, 24, 63,214,184, 21, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 32, 0, 25,121,195, 62, 46,253, 48, 62, 94,197,172, 62,109,200, 4, 62,140,122,230, 62,202,248,161, 61,216, 13,222, 62, -222,116, 22, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 32, 0,174,254, 16, 63, 94, 45, 34, 62,219,199, 3, 63, - 18, 28,229, 61, 11, 44, 20, 63, 20, 26,163, 61, 40, 92, 24, 63,214,184, 21, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,140,122,230, 62,202,248,161, 61,219,199, 3, 63, 18, 28,229, 61,140,248,236, 62,182,202, 34, 62,216, 13,222, 62, -222,116, 22, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0,184,152, 21, 63,182, 47, 53, 62,174,254, 16, 63, - 94, 45, 34, 62, 40, 92, 24, 63,214,184, 21, 62,209, 52, 25, 63, 76,140, 51, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 32, 0,216, 13,222, 62,222,116, 22, 62,140,248,236, 62,182,202, 34, 62,183,207,227, 62,250, 75, 54, 62,229,137,220, 62, -185,228, 52, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 32, 0,137, 57, 22, 63, 81, 93, 61, 62,184,152, 21, 63, -182, 47, 53, 62,209, 52, 25, 63, 76,140, 51, 62,193,166, 30, 63,114,168, 73, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,229,137,220, 62,185,228, 52, 62,183,207,227, 62,250, 75, 54, 62,122,152,226, 62,190,166, 62, 62, 54,198,209, 62, - 18,240, 75, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,250,249, 22, 63,160,251, 88, 62,137, 57, 22, 63, - 81, 93, 61, 62,193,166, 30, 63,114,168, 73, 62, 75, 0, 36, 63,229, 47,116, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 54,198,209, 62, 18,240, 75, 62,122,152,226, 62,190,166, 62, 62, 90, 83,225, 62, 21,153, 90, 62,211,231,199, 62, -216,237,119, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,193,166, 30, 63,114,168, 73, 62,160,125, 37, 63, - 50,211, 46, 62,240, 17, 42, 63,129, 84, 97, 62, 75, 0, 36, 63,229, 47,116, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,138, 81,187, 62, 59, 40,103, 62, 25,121,195, 62, 46,253, 48, 62, 54,198,209, 62, 18,240, 75, 62,211,231,199, 62, -216,237,119, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,193,166, 30, 63,114,168, 73, 62,209, 52, 25, 63, - 76,140, 51, 62, 40, 92, 24, 63,214,184, 21, 62,160,125, 37, 63, 50,211, 46, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,216, 13,222, 62,222,116, 22, 62,229,137,220, 62,185,228, 52, 62, 54,198,209, 62, 18,240, 75, 62, 25,121,195, 62, - 46,253, 48, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 37,163, 36, 63,191,168,140, 62, 75, 0, 36, 63, -229, 47,116, 62,240, 17, 42, 63,129, 84, 97, 62,172, 36, 46, 63,208, 7,129, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,138, 81,187, 62, 59, 40,103, 62,211,231,199, 62,216,237,119, 62, 6, 64,199, 62,105, 6,142, 62, 76, 71,181, 62, -204,200,131, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 20, 81, 25, 63, 17, 56,132, 62,250,249, 22, 63, -160,251, 88, 62, 75, 0, 36, 63,229, 47,116, 62, 37,163, 36, 63,191,168,140, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,211,231,199, 62,216,237,119, 62, 90, 83,225, 62, 21,153, 90, 62, 54, 42,221, 62,209, 25,133, 62, 6, 64,199, 62, -105, 6,142, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,208, 46, 27, 63,149, 35,148, 62, 91, 60, 36, 63, -221,222,150, 62,222,170, 33, 63, 74,126,158, 62, 36,177, 27, 63,158,151,156, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 72,234,204, 62, 56, 63,159, 62,150,245,199, 62, 85, 15,152, 62,238,166,217, 62,229,221,148, 62, 0,160,216, 62, -127, 44,157, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 20, 81, 25, 63, 17, 56,132, 62, 37,163, 36, 63, -191,168,140, 62, 91, 60, 36, 63,221,222,150, 62,208, 46, 27, 63,149, 35,148, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,150,245,199, 62, 85, 15,152, 62, 6, 64,199, 62,105, 6,142, 62, 54, 42,221, 62,209, 25,133, 62,238,166,217, 62, -229,221,148, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,111,239, 27, 63,159, 77,166, 62, 36,177, 27, 63, -158,151,156, 62,222,170, 33, 63, 74,126,158, 62,102,212, 31, 63,144,192,164, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 72,234,204, 62, 56, 63,159, 62, 0,160,216, 62,127, 44,157, 62,115, 21,216, 62, 14,177,166, 62, 17,119,208, 62, -201, 65,165, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,111,239, 27, 63,159, 77,166, 62,102,212, 31, 63, -144,192,164, 62,156,160, 41, 63, 56,175,182, 62, 91, 94, 37, 63,107,120,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,202,212,188, 62,245,163,182, 62, 17,119,208, 62,201, 65,165, 62,115, 21,216, 62, 14,177,166, 62,156, 28,197, 62, -166,130,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,104,119,194, 62,164,189, 82, 63, 23, 73,212, 62, -152,239, 90, 63,100,192,205, 62, 46,238, 97, 63, 38, 56,185, 62, 72,154, 91, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,228, 94,141, 62, 86,234,100, 63, 84, 66,150, 62,114,154, 94, 63,230, 86,173, 62, 79, 66, 98, 63, 20,143,162, 62, - 44,173,106, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0, 72,122, 87, 63,216, 8, 62, 62,202,106, 84, 63, -137,185,113, 62,226, 77, 72, 63,204, 21,121, 62,158,225, 71, 63,113, 34, 68, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,132, 32,137, 62,181, 65,121, 62,168,179,107, 62,139,127,103, 62,210,147,114, 62,212,116, 61, 62,248,125,142, 62, - 30, 4, 80, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0,158,225, 71, 63,113, 34, 68, 62,226, 77, 72, 63, -204, 21,121, 62, 8, 7, 51, 63, 5,186,130, 62, 3,166, 49, 63,232, 57, 96, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 18,197,172, 62, 41,112,133, 62,132, 32,137, 62,181, 65,121, 62,248,125,142, 62, 30, 4, 80, 62,121,228,174, 62, - 52, 79,109, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 3,166, 49, 63,232, 57, 96, 62, 8, 7, 51, 63, - 5,186,130, 62,172, 36, 46, 63,208, 7,129, 62,112, 54, 48, 63, 20, 19, 96, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 76, 71,181, 62,204,200,131, 62, 18,197,172, 62, 41,112,133, 62,121,228,174, 62, 52, 79,109, 62,117,121,175, 62, -183,185,106, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 37,163, 36, 63,191,168,140, 62,172, 36, 46, 63, -208, 7,129, 62, 8, 7, 51, 63, 5,186,130, 62, 91, 60, 36, 63,221,222,150, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 18,197,172, 62, 41,112,133, 62, 76, 71,181, 62,204,200,131, 62, 6, 64,199, 62,105, 6,142, 62,150,245,199, 62, - 85, 15,152, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,154, 88, 53, 63,240,146,221, 62,240,117, 49, 63, -164,138,198, 62,224, 19, 69, 63, 24, 68,190, 62, 53, 64, 74, 63,171, 31,224, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,250, 78,134, 62,148,213,186, 62,147,137,172, 62,148, 19,198, 62,128,172,162, 62, 17,169,221, 62,184,112,114, 62, -248,169,220, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0, 54, 74,214, 62, 20, 55, 70, 63, 48,130,233, 62, -188, 69, 83, 63, 23, 73,212, 62,152,239, 90, 63,104,119,194, 62,164,189, 82, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 84, 66,150, 62,114,154, 94, 63, 66, 1,153, 62,245,149, 81, 63, 38, 56,185, 62,102,110, 83, 63,230, 86,173, 62, - 79, 66, 98, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0,106,242, 66, 63,202, 94, 25, 63,190,100, 70, 63, -222,234, 15, 63, 90,189, 77, 63,233, 88, 17, 63, 8,206, 74, 63, 88,118, 27, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 22, 32, 96, 62, 66, 60, 16, 63, 86, 87,125, 62,174, 5, 15, 63, 78,187,132, 62,180, 44, 24, 63, 26, 79,108, 62, -124, 1, 26, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 8,206, 74, 63, 88,118, 27, 63, 90,189, 77, 63, -233, 88, 17, 63, 72,139, 85, 63,103, 51, 19, 63,220,119, 85, 63, 77, 71, 31, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 64,199, 64, 62, 26, 40, 18, 63, 22, 32, 96, 62, 66, 60, 16, 63, 26, 79,108, 62,124, 1, 26, 63, 44,191, 67, 62, - 90, 89, 30, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,220,119, 85, 63, 77, 71, 31, 63, 72,139, 85, 63, -103, 51, 19, 63,228,213,100, 63, 72,156, 20, 63, 18, 82, 96, 63,128,133, 34, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0,226, 50, 1, 62,184, 68, 20, 63, 64,199, 64, 62, 26, 40, 18, 63, 44,191, 67, 62, 90, 89, 30, 63,194,204, 24, 62, - 32,186, 34, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0,242, 80, 56, 63, 44,244, 6, 63,195,173, 54, 63, -239,106,252, 62,115,205, 60, 63,213,150,253, 62,166, 14, 64, 63, 81, 80, 4, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,190, 85,147, 62, 91,176,252, 62,202, 36,160, 62, 94, 51,252, 62, 61,208,156, 62,204, 16, 7, 63,160,121,140, 62, - 74,197, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0,166, 14, 64, 63, 81, 80, 4, 63,115,205, 60, 63, -213,150,253, 62, 68,103, 73, 63,233,248, 0, 63,248, 12, 75, 63, 64,206, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,144, 59,115, 62,102,143,255, 62,190, 85,147, 62, 91,176,252, 62,160,121,140, 62, 74,197, 3, 63, 78,135,107, 62, - 88,182, 7, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,248, 12, 75, 63, 64,206, 8, 63, 68,103, 73, 63, -233,248, 0, 63,239,151, 82, 63, 86,223, 3, 63,181,227, 82, 63,189,102, 11, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 82, 17, 77, 62,162, 98, 2, 63,144, 59,115, 62,102,143,255, 62, 78,135,107, 62, 88,182, 7, 63,202, 98, 75, 62, -108, 43, 10, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,181,227, 82, 63,189,102, 11, 63,239,151, 82, 63, - 86,223, 3, 63, 92,224, 91, 63,239,144, 5, 63,161,148, 90, 63,146, 95, 13, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,178, 40, 38, 62, 14,230, 3, 63, 82, 17, 77, 62,162, 98, 2, 63,202, 98, 75, 62,108, 43, 10, 63, 10,162, 43, 62, - 8, 50, 12, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,120, 89,103, 63,105, 76, 2, 63,170,179,103, 63, -142,105, 12, 63,161,148, 90, 63,146, 95, 13, 63, 92,224, 91, 63,239,144, 5, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 10,162, 43, 62, 8, 50, 12, 63,168, 41,231, 61,158, 83, 11, 63,116,128,234, 61,200, 39, 0, 63,178, 40, 38, 62, - 14,230, 3, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,228,213,100, 63, 72,156, 20, 63, 72,139, 85, 63, -103, 51, 19, 63,161,148, 90, 63,146, 95, 13, 63,170,179,103, 63,142,105, 12, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 10,162, 43, 62, 8, 50, 12, 63, 64,199, 64, 62, 26, 40, 18, 63,226, 50, 1, 62,184, 68, 20, 63,168, 41,231, 61, -158, 83, 11, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 72,139, 85, 63,103, 51, 19, 63, 90,189, 77, 63, -233, 88, 17, 63,181,227, 82, 63,189,102, 11, 63,161,148, 90, 63,146, 95, 13, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,202, 98, 75, 62,108, 43, 10, 63, 22, 32, 96, 62, 66, 60, 16, 63, 64,199, 64, 62, 26, 40, 18, 63, 10,162, 43, 62, - 8, 50, 12, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 90,189, 77, 63,233, 88, 17, 63,190,100, 70, 63, -222,234, 15, 63,248, 12, 75, 63, 64,206, 8, 63,181,227, 82, 63,189,102, 11, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 78,135,107, 62, 88,182, 7, 63, 86, 87,125, 62,174, 5, 15, 63, 22, 32, 96, 62, 66, 60, 16, 63,202, 98, 75, 62, -108, 43, 10, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,190,100, 70, 63,222,234, 15, 63, 82,235, 60, 63, - 27, 12, 12, 63,166, 14, 64, 63, 81, 80, 4, 63,248, 12, 75, 63, 64,206, 8, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,121,140, 62, 74,197, 3, 63, 78,230,145, 62,148,225, 11, 63, 86, 87,125, 62,174, 5, 15, 63, 78,135,107, 62, - 88,182, 7, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 31,118, 57, 63,230, 79, 12, 63,242, 80, 56, 63, - 44,244, 6, 63,166, 14, 64, 63, 81, 80, 4, 63, 82,235, 60, 63, 27, 12, 12, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 32, 0,160,121,140, 62, 74,197, 3, 63, 61,208,156, 62,204, 16, 7, 63, 0,199,152, 62, 13,133, 12, 63, 78,230,145, 62, -148,225, 11, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 32, 0,195,240, 57, 63, 10,138, 23, 63, 82,235, 60, 63, - 27, 12, 12, 63,190,100, 70, 63,222,234, 15, 63,106,242, 66, 63,202, 94, 25, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 86, 87,125, 62,174, 5, 15, 63, 78,230,145, 62,148,225, 11, 63,247, 7,150, 62, 96, 12, 23, 63, 78,187,132, 62, -180, 44, 24, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,216,120, 13, 63,160, 81, 23, 63, 94,233, 23, 63, -186, 60, 16, 63,220, 56, 28, 63, 66,250, 14, 63,109, 44, 39, 63,107,221, 19, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,157,161,214, 62,219,110, 15, 63,109,130,223, 62,118,165, 16, 63, 64, 27,245, 62,100,166, 23, 63,156, 26,192, 62, - 31,139, 20, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,176, 29, 56, 63, 88,206, 20, 63, 31,118, 57, 63, -230, 79, 12, 63, 82,235, 60, 63, 27, 12, 12, 63,195,240, 57, 63, 10,138, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 78,230,145, 62,148,225, 11, 63, 0,199,152, 62, 13,133, 12, 63,239,211,153, 62,220,159, 20, 63,247, 7,150, 62, - 96, 12, 23, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 48,148, 54, 63,220,206, 22, 63,176, 29, 56, 63, - 88,206, 20, 63,195,240, 57, 63, 10,138, 23, 63, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,247, 7,150, 62, 96, 12, 23, 63,239,211,153, 62,220,159, 20, 63,108,106,156, 62,146,154, 22, 63, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,195,173, 54, 63,239,106,252, 62,154, 88, 53, 63, -240,146,221, 62, 53, 64, 74, 63,171, 31,224, 62,115,205, 60, 63,213,150,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 32, 0,184,112,114, 62,248,169,220, 62,128,172,162, 62, 17,169,221, 62,202, 36,160, 62, 94, 51,252, 62,190, 85,147, 62, - 91,176,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 32, 0, 53, 64, 74, 63,171, 31,224, 62,217,106, 81, 63, - 14,214,232, 62, 68,103, 73, 63,233,248, 0, 63,115,205, 60, 63,213,150,253, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,144, 59,115, 62,102,143,255, 62, 88, 93, 84, 62, 50,105,228, 62,184,112,114, 62,248,169,220, 62,190, 85,147, 62, - 91,176,252, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,217,106, 81, 63, 14,214,232, 62,106,154, 93, 63, -226, 26,233, 62,239,151, 82, 63, 86,223, 3, 63, 68,103, 73, 63,233,248, 0, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 82, 17, 77, 62,162, 98, 2, 63,128, 1, 33, 62, 70,210,226, 62, 88, 93, 84, 62, 50,105,228, 62,144, 59,115, 62, -102,143,255, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,120, 89,103, 63,105, 76, 2, 63, 92,224, 91, 63, -239,144, 5, 63,239,151, 82, 63, 86,223, 3, 63,106,154, 93, 63,226, 26,233, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 82, 17, 77, 62,162, 98, 2, 63,178, 40, 38, 62, 14,230, 3, 63,116,128,234, 61,200, 39, 0, 63,128, 1, 33, 62, - 70,210,226, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 8, 7, 51, 63, 5,186,130, 62,226, 77, 72, 63, -204, 21,121, 62,154,254, 73, 63,178, 82,140, 62, 90,188, 56, 63,103,207,159, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,249,249,130, 62,246,175,137, 62,132, 32,137, 62,181, 65,121, 62, 18,197,172, 62, 41,112,133, 62,192, 5,161, 62, -228, 40,159, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,224, 19, 69, 63, 24, 68,190, 62, 90,188, 56, 63, -103,207,159, 62,154,254, 73, 63,178, 82,140, 62,216,217, 77, 63, 7,228,157, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0,249,249,130, 62,246,175,137, 62,192, 5,161, 62,228, 40,159, 62,250, 78,134, 62,148,213,186, 62,154,118,111, 62, -120,108,152, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0,240,117, 49, 63,164,138,198, 62,156,160, 41, 63, - 56,175,182, 62, 90,188, 56, 63,103,207,159, 62,224, 19, 69, 63, 24, 68,190, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192, 5,161, 62,228, 40,159, 62,202,212,188, 62,245,163,182, 62,147,137,172, 62,148, 19,198, 62,250, 78,134, 62, -148,213,186, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,156,160, 41, 63, 56,175,182, 62,222,170, 33, 63, - 74,126,158, 62, 91, 60, 36, 63,221,222,150, 62, 90,188, 56, 63,103,207,159, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,150,245,199, 62, 85, 15,152, 62, 72,234,204, 62, 56, 63,159, 62,202,212,188, 62,245,163,182, 62,192, 5,161, 62, -228, 40,159, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 91, 60, 36, 63,221,222,150, 62, 8, 7, 51, 63, - 5,186,130, 62, 90,188, 56, 63,103,207,159, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192, 5,161, 62,228, 40,159, 62, 18,197,172, 62, 41,112,133, 62,150,245,199, 62, 85, 15,152, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,156,160, 41, 63, 56,175,182, 62,102,212, 31, 63, -144,192,164, 62,222,170, 33, 63, 74,126,158, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 72,234,204, 62, 56, 63,159, 62, 17,119,208, 62,201, 65,165, 62,202,212,188, 62,245,163,182, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,226, 44,245, 62,129,140, 96, 63, 42,135,227, 62, - 58, 2,101, 63,136,168,219, 62, 30,236, 95, 63,135, 30,238, 62,200, 41, 90, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,216,240,137, 62, 90,226, 93, 63,110,103,122, 62,236,255, 92, 63, 74, 84,120, 62,104, 32, 83, 63, 32,193,138, 62, - 16, 3, 83, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0, 48,130,233, 62,188, 69, 83, 63,135, 30,238, 62, -200, 41, 90, 63,136,168,219, 62, 30,236, 95, 63, 23, 73,212, 62,152,239, 90, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0,216,240,137, 62, 90,226, 93, 63, 32,193,138, 62, 16, 3, 83, 63, 66, 1,153, 62,245,149, 81, 63, 84, 66,150, 62, -114,154, 94, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0,216,217, 77, 63, 7,228,157, 62,154,254, 73, 63, -178, 82,140, 62, 33, 61, 90, 63,195,207,124, 62,160,225, 90, 63,110,121,137, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0, 98,207, 81, 62,109, 1,110, 62,249,249,130, 62,246,175,137, 62,154,118,111, 62,120,108,152, 62,166,125, 74, 62, -252, 30,130, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0,226, 77, 72, 63,204, 21,121, 62,202,106, 84, 63, -137,185,113, 62, 33, 61, 90, 63,195,207,124, 62,154,254, 73, 63,178, 82,140, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 98,207, 81, 62,109, 1,110, 62,168,179,107, 62,139,127,103, 62,132, 32,137, 62,181, 65,121, 62,249,249,130, 62, -246,175,137, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 23, 73,212, 62,152,239, 90, 63,136,168,219, 62, - 30,236, 95, 63,100,192,205, 62, 46,238, 97, 63, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0,228, 94,141, 62, 86,234,100, 63,216,240,137, 62, 90,226, 93, 63, 84, 66,150, 62,114,154, 94, 63, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,112, 0, 31,178,109, 63,224, 68,228, 62, 46,178,102, 63, -100,184,232, 62,100,251,101, 63,238,198,227, 62, 94,173,107, 63,168,130,225, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 68,209,249, 61, 70,134,219, 62,120,216,242, 61,124, 40,225, 62, 28, 27,177, 61, 42,240,219, 62, 76,131,196, 61, -196, 97,216, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 31,178,109, 63,224, 68,228, 62, 94,173,107, 63, -168,130,225, 62,144,102,114, 63,198, 23,220, 62, 41, 76,116, 63,139,153,222, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 56,163,120, 61, 58,252,208, 62, 76,131,196, 61,196, 97,216, 62, 28, 27,177, 61, 42,240,219, 62,128,183, 73, 61, - 84,108,213, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 41, 76,116, 63,139,153,222, 62,144,102,114, 63, -198, 23,220, 62, 84, 87,117, 63,221,255,211, 62,183,115,119, 63,140, 49,215, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,144, 29, 55, 61,207,183,194, 62, 56,163,120, 61, 58,252,208, 62,128,183, 73, 61, 84,108,213, 62,224,111,231, 60, -100,142,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,183,115,119, 63,140, 49,215, 62, 84, 87,117, 63, -221,255,211, 62,150, 20,118, 63, 60,110,196, 62, 49, 12,122, 63,246, 8,197, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 96,197,103, 61, 15,206,170, 62,144, 29, 55, 61,207,183,194, 62,224,111,231, 60,100,142,198, 62,240, 54, 16, 61, -120, 4,167, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 49, 12,122, 63,246, 8,197, 62,150, 20,118, 63, - 60,110,196, 62, 17,155,108, 63,130,201,178, 62, 84,190,110, 63,223, 77,172, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,148,252,246, 61,164,116,160, 62, 96,197,103, 61, 15,206,170, 62,240, 54, 16, 61,120, 4,167, 62, 8, 66,246, 61, - 28,161,152, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 84,190,110, 63,223, 77,172, 62, 17,155,108, 63, -130,201,178, 62, 21,180, 92, 63,202, 95,173, 62,151, 5, 90, 63,138, 61,167, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,144,216, 54, 62, 35, 76,163, 62,148,252,246, 61,164,116,160, 62, 8, 66,246, 61, 28,161,152, 62,194,251, 66, 62, -163,102,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 17,155,108, 63,130,201,178, 62,198,132,109, 63, -182,157,186, 62, 68, 32, 97, 63,192, 12,178, 62, 21,180, 92, 63,202, 95,173, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 48,185, 36, 62, 16, 7,166, 62, 40, 91,221, 61, 4,194,167, 62,148,252,246, 61,164,116,160, 62,144,216, 54, 62, - 35, 76,163, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,150, 20,118, 63, 60,110,196, 62, 84,225,115, 63, -208, 85,198, 62,198,132,109, 63,182,157,186, 62, 17,155,108, 63,130,201,178, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 40, 91,221, 61, 4,194,167, 62,244,221,134, 61,121,164,175, 62, 96,197,103, 61, 15,206,170, 62,148,252,246, 61, -164,116,160, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 84, 87,117, 63,221,255,211, 62,222, 48,116, 63, -169, 8,209, 62, 84,225,115, 63,208, 85,198, 62,150, 20,118, 63, 60,110,196, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,244,221,134, 61,121,164,175, 62,160,108, 93, 61, 17,207,190, 62,144, 29, 55, 61,207,183,194, 62, 96,197,103, 61, - 15,206,170, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,144,102,114, 63,198, 23,220, 62,174,151,113, 63, - 26,229,214, 62,222, 48,116, 63,169, 8,209, 62, 84, 87,117, 63,221,255,211, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,108, 93, 61, 17,207,190, 62, 12,155,135, 61,166, 39,201, 62, 56,163,120, 61, 58,252,208, 62,144, 29, 55, 61, -207,183,194, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 94,173,107, 63,168,130,225, 62,228,239,107, 63, - 62, 59,218, 62,174,151,113, 63, 26,229,214, 62,144,102,114, 63,198, 23,220, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 12,155,135, 61,166, 39,201, 62,128, 47,195, 61, 6, 11,207, 62, 76,131,196, 61,196, 97,216, 62, 56,163,120, 61, - 58,252,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 94,173,107, 63,168,130,225, 62,100,251,101, 63, -238,198,227, 62, 71,205,102, 63,132, 94,219, 62,228,239,107, 63, 62, 59,218, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,192,157,244, 61,157,137,209, 62, 68,209,249, 61, 70,134,219, 62, 76,131,196, 61,196, 97,216, 62,128, 47,195, 61, - 6, 11,207, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,224, 19, 69, 63, 24, 68,190, 62,216,217, 77, 63, - 7,228,157, 62,236, 35, 85, 63,164,201,181, 62, 56, 92, 78, 63,177,114,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 32, 0,122, 91, 80, 62, 72, 18,174, 62,154,118,111, 62,120,108,152, 62,250, 78,134, 62,148,213,186, 62,162,163,104, 62, -150,180,182, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 32, 0,216,217, 77, 63, 7,228,157, 62,151, 5, 90, 63, -138, 61,167, 62, 21,180, 92, 63,202, 95,173, 62,236, 35, 85, 63,164,201,181, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0,144,216, 54, 62, 35, 76,163, 62,194,251, 66, 62,163,102,158, 62,154,118,111, 62,120,108,152, 62,122, 91, 80, 62, - 72, 18,174, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0, 53, 64, 74, 63,171, 31,224, 62,224, 19, 69, 63, - 24, 68,190, 62, 56, 92, 78, 63,177,114,188, 62,217,106, 81, 63, 14,214,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,162,163,104, 62,150,180,182, 62,250, 78,134, 62,148,213,186, 62,184,112,114, 62,248,169,220, 62, 88, 93, 84, 62, - 50,105,228, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,106,154, 93, 63,226, 26,233, 62,196,229, 94, 63, -128,195,224, 62,100,251,101, 63,238,198,227, 62, 46,178,102, 63,100,184,232, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 68,209,249, 61, 70,134,219, 62,108,187, 28, 62, 48, 86,217, 62,128, 1, 33, 62, 70,210,226, 62,120,216,242, 61, -124, 40,225, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 21,180, 92, 63,202, 95,173, 62, 68, 32, 97, 63, -192, 12,178, 62, 9,215, 94, 63, 4, 54,186, 62,236, 35, 85, 63,164,201,181, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 60,122, 41, 62, 16, 58,175, 62, 48,185, 36, 62, 16, 7,166, 62,144,216, 54, 62, 35, 76,163, 62,122, 91, 80, 62, - 72, 18,174, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,230, 78, 95, 63, 4,233,189, 62, 32,188, 86, 63, - 44, 62,190, 62,236, 35, 85, 63,164,201,181, 62, 9,215, 94, 63, 4, 54,186, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,122, 91, 80, 62, 72, 18,174, 62, 78,118, 71, 62, 27, 49,182, 62, 52,225, 37, 62, 40, 12,179, 62, 60,122, 41, 62, - 16, 58,175, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 70,166, 92, 63, 0,166,197, 62, 32,188, 86, 63, - 44, 62,190, 62,230, 78, 95, 63, 4,233,189, 62,226, 13, 95, 63, 37,152,194, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 52,225, 37, 62, 40, 12,179, 62, 78,118, 71, 62, 27, 49,182, 62,142,143, 45, 62,237, 37,188, 62,106,230, 36, 62, -222, 27,184, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,248, 90, 95, 63,100,122,207, 62,108,249, 90, 63, - 58,199,212, 62, 32,188, 86, 63, 44, 62,190, 62, 70,166, 92, 63, 0,166,197, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 78,118, 71, 62, 27, 49,182, 62,110, 56, 48, 62,230, 43,205, 62,174,250, 30, 62, 26, 12,198, 62,142,143, 45, 62, -237, 37,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,196,229, 94, 63,128,195,224, 62,108,249, 90, 63, - 58,199,212, 62,248, 90, 95, 63,100,122,207, 62, 92,104, 98, 63,197,136,215, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,174,250, 30, 62, 26, 12,198, 62,110, 56, 48, 62,230, 43,205, 62,108,187, 28, 62, 48, 86,217, 62,212, 59, 15, 62, -224, 50,206, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,100,251,101, 63,238,198,227, 62,196,229, 94, 63, -128,195,224, 62, 92,104, 98, 63,197,136,215, 62, 71,205,102, 63,132, 94,219, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,212, 59, 15, 62,224, 50,206, 62,108,187, 28, 62, 48, 86,217, 62, 68,209,249, 61, 70,134,219, 62,192,157,244, 61, -157,137,209, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,217,106, 81, 63, 14,214,232, 62,108,249, 90, 63, - 58,199,212, 62,196,229, 94, 63,128,195,224, 62,106,154, 93, 63,226, 26,233, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,108,187, 28, 62, 48, 86,217, 62,110, 56, 48, 62,230, 43,205, 62, 88, 93, 84, 62, 50,105,228, 62,128, 1, 33, 62, - 70,210,226, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,217,106, 81, 63, 14,214,232, 62, 56, 92, 78, 63, -177,114,188, 62, 32,188, 86, 63, 44, 62,190, 62,108,249, 90, 63, 58,199,212, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 78,118, 71, 62, 27, 49,182, 62,162,163,104, 62,150,180,182, 62, 88, 93, 84, 62, 50,105,228, 62,110, 56, 48, 62, -230, 43,205, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 56, 92, 78, 63,177,114,188, 62,236, 35, 85, 63, -164,201,181, 62, 32,188, 86, 63, 44, 62,190, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 78,118, 71, 62, 27, 49,182, 62,122, 91, 80, 62, 72, 18,174, 62,162,163,104, 62,150,180,182, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 71,205,102, 63,132, 94,219, 62, 92,104, 98, 63, -197,136,215, 62,182,109,100, 63,149,255,210, 62, 54, 86,104, 63,209,241,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,107, 7, 62, 34,103,200, 62,212, 59, 15, 62,224, 50,206, 62,192,157,244, 61,157,137,209, 62, 8, 2,232, 61, - 20,214,203, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 92,104, 98, 63,197,136,215, 62,248, 90, 95, 63, -100,122,207, 62,112,206, 97, 63, 10,202,204, 62,182,109,100, 63,149,255,210, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 64, 68, 21, 62,107, 55,194, 62,174,250, 30, 62, 26, 12,198, 62,212, 59, 15, 62,224, 50,206, 62,160,107, 7, 62, - 34,103,200, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,248, 90, 95, 63,100,122,207, 62, 70,166, 92, 63, - 0,166,197, 62, 82,241, 94, 63, 40,103,198, 62,112,206, 97, 63, 10,202,204, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 20,225, 35, 62, 39, 50,188, 62,142,143, 45, 62,237, 37,188, 62,174,250, 30, 62, 26, 12,198, 62, 64, 68, 21, 62, -107, 55,194, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 70,166, 92, 63, 0,166,197, 62,226, 13, 95, 63, - 37,152,194, 62,118, 1, 97, 63, 47,226,195, 62, 82,241, 94, 63, 40,103,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 12, 43, 28, 62,186,177,184, 62,106,230, 36, 62,222, 27,184, 62,142,143, 45, 62,237, 37,188, 62, 20,225, 35, 62, - 39, 50,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,226, 13, 95, 63, 37,152,194, 62,230, 78, 95, 63, - 4,233,189, 62, 51,113, 97, 63, 92,151,189, 62,118, 1, 97, 63, 47,226,195, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,104, 67, 29, 62, 58,199,177, 62, 52,225, 37, 62, 40, 12,179, 62,106,230, 36, 62,222, 27,184, 62, 12, 43, 28, 62, -186,177,184, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,230, 78, 95, 63, 4,233,189, 62, 9,215, 94, 63, - 4, 54,186, 62, 96, 69, 96, 63,152,133,187, 62, 51,113, 97, 63, 92,151,189, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,140, 14, 35, 62, 33, 19,176, 62, 60,122, 41, 62, 16, 58,175, 62, 52,225, 37, 62, 40, 12,179, 62,104, 67, 29, 62, - 58,199,177, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 9,215, 94, 63, 4, 54,186, 62, 68, 32, 97, 63, -192, 12,178, 62,112, 91, 98, 63,149,128,182, 62, 96, 69, 96, 63,152,133,187, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,228,107, 29, 62, 95,230,169, 62, 48,185, 36, 62, 16, 7,166, 62, 60,122, 41, 62, 16, 58,175, 62,140, 14, 35, 62, - 33, 19,176, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,228,239,107, 63, 62, 59,218, 62, 71,205,102, 63, -132, 94,219, 62, 54, 86,104, 63,209,241,214, 62, 34, 27,109, 63,155,254,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 8, 2,232, 61, 20,214,203, 62,192,157,244, 61,157,137,209, 62,128, 47,195, 61, 6, 11,207, 62, 36,174,184, 61, -216,130,202, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,174,151,113, 63, 26,229,214, 62,228,239,107, 63, - 62, 59,218, 62, 34, 27,109, 63,155,254,214, 62, 69,134,113, 63,156, 82,212, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 36,174,184, 61,216,130,202, 62,128, 47,195, 61, 6, 11,207, 62, 12,155,135, 61,166, 39,201, 62, 60,114,138, 61, - 28, 61,197, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,222, 48,116, 63,169, 8,209, 62,174,151,113, 63, - 26,229,214, 62, 69,134,113, 63,156, 82,212, 62, 42,143,114, 63, 24,168,207, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 60,114,138, 61, 28, 61,197, 62, 12,155,135, 61,166, 39,201, 62,160,108, 93, 61, 17,207,190, 62,184, 85,132, 61, - 22,211,189, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 84,225,115, 63,208, 85,198, 62,222, 48,116, 63, -169, 8,209, 62, 42,143,114, 63, 24,168,207, 62,203,125,114, 63, 96,114,200, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,184, 85,132, 61, 22,211,189, 62,160,108, 93, 61, 17,207,190, 62,244,221,134, 61,121,164,175, 62, 16,152,145, 61, - 84,214,179, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,198,132,109, 63,182,157,186, 62, 84,225,115, 63, -208, 85,198, 62,203,125,114, 63, 96,114,200, 62,177,192,109, 63,152,240,190, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 16,152,145, 61, 84,214,179, 62,244,221,134, 61,121,164,175, 62, 40, 91,221, 61, 4,194,167, 62, 64,226,208, 61, -232, 58,172, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 68, 32, 97, 63,192, 12,178, 62,198,132,109, 63, -182,157,186, 62,177,192,109, 63,152,240,190, 62,112, 91, 98, 63,149,128,182, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 64,226,208, 61,232, 58,172, 62, 40, 91,221, 61, 4,194,167, 62, 48,185, 36, 62, 16, 7,166, 62,228,107, 29, 62, - 95,230,169, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,118, 1, 97, 63, 47,226,195, 62, 51,113, 97, 63, - 92,151,189, 62,215,139,102, 63, 15,109,193, 62, 54, 47,100, 63,186,115,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 92,169, 5, 62,168,115,179, 62,104, 67, 29, 62, 58,199,177, 62, 12, 43, 28, 62,186,177,184, 62, 50, 97, 13, 62, - 50, 42,186, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 54, 47,100, 63,186,115,198, 62,215,139,102, 63, - 15,109,193, 62,174,241,105, 63,204, 8,200, 62, 71,233,103, 63,178, 42,204, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,228,171,229, 61, 41, 42,185, 62, 92,169, 5, 62,168,115,179, 62, 50, 97, 13, 62, 50, 42,186, 62, 92,248,243, 61, - 96, 22,191, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 71,233,103, 63,178, 42,204, 62,174,241,105, 63, -204, 8,200, 62, 51, 37,108, 63,249, 3,205, 62, 56,212,106, 63, 96,238,208, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,120, 99,202, 61,192, 49,190, 62,228,171,229, 61, 41, 42,185, 62, 92,248,243, 61, 96, 22,191, 62,160,209,211, 61, -108,159,195, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 56,212,106, 63, 96,238,208, 62, 51, 37,108, 63, -249, 3,205, 62, 56, 73,110, 63,186,119,206, 62, 46,191,109, 63, 92, 64,210, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,244,234,179, 61,240,219,190, 62,120, 99,202, 61,192, 49,190, 62,160,209,211, 61,108,159,195, 62,196,129,181, 61, -204, 14,196, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 34, 27,109, 63,155,254,214, 62, 54, 86,104, 63, -209,241,214, 62, 56,212,106, 63, 96,238,208, 62, 46,191,109, 63, 92, 64,210, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,209,211, 61,108,159,195, 62, 8, 2,232, 61, 20,214,203, 62, 36,174,184, 61,216,130,202, 62,196,129,181, 61, -204, 14,196, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,182,109,100, 63,149,255,210, 62, 71,233,103, 63, -178, 42,204, 62, 56,212,106, 63, 96,238,208, 62, 54, 86,104, 63,209,241,214, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,160,209,211, 61,108,159,195, 62, 92,248,243, 61, 96, 22,191, 62,160,107, 7, 62, 34,103,200, 62, 8, 2,232, 61, - 20,214,203, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,182,109,100, 63,149,255,210, 62,112,206, 97, 63, - 10,202,204, 62, 54, 47,100, 63,186,115,198, 62, 71,233,103, 63,178, 42,204, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 50, 97, 13, 62, 50, 42,186, 62, 64, 68, 21, 62,107, 55,194, 62,160,107, 7, 62, 34,103,200, 62, 92,248,243, 61, - 96, 22,191, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,118, 1, 97, 63, 47,226,195, 62, 54, 47,100, 63, -186,115,198, 62,112,206, 97, 63, 10,202,204, 62, 82,241, 94, 63, 40,103,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 64, 68, 21, 62,107, 55,194, 62, 50, 97, 13, 62, 50, 42,186, 62, 12, 43, 28, 62,186,177,184, 62, 20,225, 35, 62, - 39, 50,188, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 96, 69, 96, 63,152,133,187, 62,112, 91, 98, 63, -149,128,182, 62,215,139,102, 63, 15,109,193, 62, 51,113, 97, 63, 92,151,189, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 92,169, 5, 62,168,115,179, 62,228,107, 29, 62, 95,230,169, 62,140, 14, 35, 62, 33, 19,176, 62,104, 67, 29, 62, - 58,199,177, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,177,192,109, 63,152,240,190, 62,174,241,105, 63, -204, 8,200, 62,215,139,102, 63, 15,109,193, 62,112, 91, 98, 63,149,128,182, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 92,169, 5, 62,168,115,179, 62,228,171,229, 61, 41, 42,185, 62, 64,226,208, 61,232, 58,172, 62,228,107, 29, 62, - 95,230,169, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,203,125,114, 63, 96,114,200, 62, 51, 37,108, 63, -249, 3,205, 62,174,241,105, 63,204, 8,200, 62,177,192,109, 63,152,240,190, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,228,171,229, 61, 41, 42,185, 62,120, 99,202, 61,192, 49,190, 62, 16,152,145, 61, 84,214,179, 62, 64,226,208, 61, -232, 58,172, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 42,143,114, 63, 24,168,207, 62, 56, 73,110, 63, -186,119,206, 62, 51, 37,108, 63,249, 3,205, 62,203,125,114, 63, 96,114,200, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,120, 99,202, 61,192, 49,190, 62,244,234,179, 61,240,219,190, 62,184, 85,132, 61, 22,211,189, 62, 16,152,145, 61, - 84,214,179, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 69,134,113, 63,156, 82,212, 62, 46,191,109, 63, - 92, 64,210, 62, 56, 73,110, 63,186,119,206, 62, 42,143,114, 63, 24,168,207, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,244,234,179, 61,240,219,190, 62,196,129,181, 61,204, 14,196, 62, 60,114,138, 61, 28, 61,197, 62,184, 85,132, 61, - 22,211,189, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 34, 27,109, 63,155,254,214, 62, 46,191,109, 63, - 92, 64,210, 62, 69,134,113, 63,156, 82,212, 62, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 60,114,138, 61, 28, 61,197, 62,196,129,181, 61,204, 14,196, 62, 36,174,184, 61,216,130,202, 62, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 84,190,110, 63,223, 77,172, 62,151, 5, 90, 63, -138, 61,167, 62, 22, 25, 96, 63,246,248,149, 62,162,176,122, 63,145,215,161, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0, 64,234, 54, 62,146,219,140, 62,194,251, 66, 62,163,102,158, 62, 8, 66,246, 61, 28,161,152, 62,172,241,189, 61, - 13,107,132, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 49, 12,122, 63,246, 8,197, 62, 84,190,110, 63, -223, 77,172, 62,162,176,122, 63,145,215,161, 62,188,255,126, 63,115,248,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 64, 0,172,241,189, 61, 13,107,132, 62, 8, 66,246, 61, 28,161,152, 62,240, 54, 16, 61,120, 4,167, 62, 0, 8,163, 58, - 39, 69,162, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0,183,115,119, 63,140, 49,215, 62, 49, 12,122, 63, -246, 8,197, 62,188,255,126, 63,115,248,198, 62, 47, 6,122, 63,248,157,216, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0, 0, 8,163, 58, 39, 69,162, 62,240, 54, 16, 61,120, 4,167, 62,224,111,231, 60,100,142,198, 62,224,248, 14, 60, - 70,141,198, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 16, 0, 41, 76,116, 63,139,153,222, 62,183,115,119, 63, -140, 49,215, 62, 47, 6,122, 63,248,157,216, 62,134, 98,119, 63,204, 37,225, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,224,248, 14, 60, 70,141,198, 62,224,111,231, 60,100,142,198, 62,128,183, 73, 61, 84,108,213, 62, 80,210,229, 60, - 32,239,218, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 31,178,109, 63,224, 68,228, 62, 41, 76,116, 63, -139,153,222, 62,134, 98,119, 63,204, 37,225, 62, 46,185,115, 63, 90,157,234, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,128, 0, 80,210,229, 60, 32,239,218, 62,128,183, 73, 61, 84,108,213, 62, 28, 27,177, 61, 42,240,219, 62, 56,103,122, 61, - 30, 10,230, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,128, 0, 46,178,102, 63,100,184,232, 62, 31,178,109, 63, -224, 68,228, 62, 46,185,115, 63, 90,157,234, 62,244,134,106, 63,234, 64,246, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 64, 0, 56,103,122, 61, 30, 10,230, 62, 28, 27,177, 61, 42,240,219, 62,120,216,242, 61,124, 40,225, 62,212,222,209, 61, -238,123,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 16, 0,235,188, 5, 63,252, 74, 98, 63,200,111,248, 62, -197,105,112, 63, 0, 49,231, 62,118,190,107, 63,150, 57,255, 62, 53, 14, 96, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 80, 99, 95, 62,149,194, 94, 63, 58, 8, 62, 62, 10,154, 89, 63, 40, 24, 92, 62, 14, 82, 74, 63,112, 11,112, 62, -157,133, 78, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0,235,188, 5, 63,252, 74, 98, 63,136,139, 12, 63, -138,233,101, 63,116, 45, 6, 63,112,245,113, 63,200,111,248, 62,197,105,112, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 68,219, 36, 62,249,186, 81, 63, 28,254, 65, 62, 20, 55, 70, 63, 40, 24, 92, 62, 14, 82, 74, 63, 58, 8, 62, 62, - 10,154, 89, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0,136,139, 12, 63,138,233,101, 63, 5,130, 12, 63, -149,216,108, 63,116, 45, 6, 63,112,245,113, 63, 0, 0,128, 63, 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,112, 0, 68,219, 36, 62,249,186, 81, 63, 76, 1, 42, 62, 39,178, 73, 63, 28,254, 65, 62, 20, 55, 70, 63, 0, 0,128, 63, - 0, 0,128, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,112, 0,120, 89,103, 63,105, 76, 2, 63,106,154, 93, 63, -226, 26,233, 62, 46,178,102, 63,100,184,232, 62,244,134,106, 63,234, 64,246, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 0, 0,120,216,242, 61,124, 40,225, 62,128, 1, 33, 62, 70,210,226, 62,116,128,234, 61,200, 39, 0, 63,212,222,209, 61, -238,123,240, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0,226, 44,245, 62,129,140, 96, 63,150, 57,255, 62, - 53, 14, 96, 63, 0, 49,231, 62,118,190,107, 63, 42,135,227, 62, 58, 2,101, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0,240, 0, 80, 99, 95, 62,149,194, 94, 63,112, 11,112, 62,157,133, 78, 63, 74, 84,120, 62,104, 32, 83, 63,110,103,122, 62, -236,255, 92, 63,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0,240, 0,216,217, 77, 63, 7,228,157, 62,160,225, 90, 63, -110,121,137, 62, 22, 25, 96, 63,246,248,149, 62,151, 5, 90, 63,138, 61,167, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, - 0, 0, 16, 0, 64,234, 54, 62,146,219,140, 62,166,125, 74, 62,252, 30,130, 62,154,118,111, 62,120,108,152, 62,194,251, 66, 62, -163,102,158, 62,208,217,115, 1, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 64, 0, 68, 65, 84, 65, 64, 31, 0, 0, 16,101,117, 1, - 0, 0, 0, 0, 57, 0, 0, 0,208, 7, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0, 32, 2,118, 1, 0, 0, 0, 0, 50, 0, 0, 0, - 1, 0, 0, 0, 80, 83,118, 1, 0, 0, 0, 0, 96,130,116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 4,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83,118, 1, 0, 0, 0, 0, 16, 38,118, 1, - 0, 0, 0, 0, 64, 44,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 5,118, 1, 0, 0, 0, 0,208, 21,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 58,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224, 3,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 80, 20,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,144, 36,118, 1, - 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0,188, 0, 0, 0, 53, 1, 0, 0, 76, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,213,204, 76, 63,255,204, 76, 63, 0, 0,104,182, 30, 0,128, 63,140, 0,128, 63, -214,255,127, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 8, 0, 0, 0, 0, 83,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 64, 1, 0, 0,224, 3,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 5,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,176, 14, 0, 0, 96, 5,118, 1, - 0, 0, 0, 0, 56, 0, 0, 0,188, 0, 0, 0,133,102,230, 63,208, 51,179, 63,146,255,127, 63,127,165, 0, 0,129, 90, 2,255, -133,102,230, 63,206,154, 25, 63,146,255,127, 63,127,165, 0, 0,129, 90, 2,255, 81, 51,179, 63,210, 51,179, 63,148,255,127, 63, - 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63,212, 51,179, 63,152,255,127, 63, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63, -214, 51,179, 63,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255,152,205, 76, 62,216, 51,179, 63,156,255,127, 63, 0, 0, 0, 0, -255,127, 2,255, 80, 51,179, 63,158, 0,128, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,160, 0,128, 63, -150,255,127, 63, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,162, 0,128, 63,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -140,205, 76, 62,163, 0,128, 63,156,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,209,154, 25, 63,148,255,127, 63, - 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,213,154, 25, 63,150,255,127, 63, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63, -217,154, 25, 63,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62,221,154, 25, 63,156,255,127, 63, 0, 0, 0, 0, -255,127, 2,255, 80, 51,179, 63,160,209, 76, 62,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,176,209, 76, 62, -150,255,127, 63, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,188,209, 76, 62,152,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -140,205, 76, 62,204,209, 76, 62,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62, 8,103,230, 63,148,255,127, 63, - 0, 0,127,165,129, 90, 0,255,204,153, 25, 63, 10,103,230, 63,146,255,127, 63, 0, 0,127,165,129, 90, 0,255, 27, 0,128, 63, - 10,103,230, 63,142,255,127, 63, 0, 0,127,165,129, 90, 0,255, 80, 51,179, 63, 12,103,230, 63,140,255,127, 63, 0, 0,127,165, -129, 90, 0,255,152,205, 76,190, 12,103,230, 63,140,255,127, 63, 0, 0,127,165,129, 90, 0,255,152,205, 76,190,160,209, 76, 62, -148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,209,154, 25, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -152,205, 76,190,158, 0,128, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,144,205, 76,190,210, 51,179, 63,148,255,127, 63, - 0, 0, 0, 0,255,127, 2,255,131,102,230, 63, 7,103,230, 63,148,255,127, 63, 0, 0,127,165,129, 90, 0,255,131,102,230, 63, -160, 0,128, 63,142,255,127, 63,127,165, 0, 0,129, 90, 2,255,127,102,230, 63, 28,208, 76, 62,148,255,127, 63,127,165, 0, 0, -129, 90, 2,255,146,205, 76,190, 72,208, 76,190,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,150,205, 76, 62, 24,208, 76,190, -156,255,127, 63, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63, 40,208, 76,190,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255, - 28, 0,128, 63, 56,208, 76,190,152,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 81, 51,179, 63, 72,208, 76,190,148,255,127, 63, - 0, 0, 0, 0,255,127, 2,255,133,102,230, 63, 88,208, 76,190,146,255,127, 63, 0, 0, 0, 0,255,127, 2,255,133,102,230, 63, - 88,208, 76,190, 4, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 81, 51,179, 63, 72,208, 76,190, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255, 28, 0,128, 63, 56,208, 76,190, 1, 0,128,191, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63, 40,208, 76,190, - 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255,150,205, 76, 62, 24,208, 76,190,254,255,127,191, 0, 0, 0, 0,255,127, 2,255, -146,205, 76,190, 72,208, 76,190, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,127,102,230, 63, 28,208, 76, 62,155,153, 25,191, - 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,136,201, 76,190,159,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, - 28,208, 76, 62,193,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,136,201, 76,190,209,204, 76,190, 1,128, 0, 0, - 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62,219,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,136,201, 76,190, -203,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62,159,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255, -131,102,230, 63,136,201, 76,190,155,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62, 3, 0,128,191, -127,165, 0, 0,129, 90, 2,255,131,102,230, 63,160, 0,128, 63, 6, 0,128,191,127,165, 0, 0,129, 90, 2,255,131,102,230, 63, - 7,103,230, 63, 3, 0,128,191, 0, 0,127,165,129, 90, 0,255,135,102,230, 63,207,154, 25, 63,151,153, 25, 63, 1,128, 0, 0, - 0, 0, 2,255,131,102,230, 63,156, 0,128, 63,151,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63, -155,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, 7,103,230, 63,159,153, 25, 63,127,165,127,165, 0, 0, 2,255, -135,102,230, 63,207,154, 25, 63,171,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,160, 0,128, 63,187,204, 76, 62, - 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,203,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, - 7,103,230, 63,219,204, 76, 62,127,165,127,165, 0, 0, 2,255,135,102,230, 63,207,154, 25, 63,241,204, 76,190, 1,128, 0, 0, - 0, 0, 2,255,131,102,230, 63,160, 0,128, 63,225,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63, -209,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, 7,103,230, 63,193,204, 76,190,127,165,127,165, 0, 0, 2,255, -135,102,230, 63,207,154, 25, 63,167,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,160, 0,128, 63,163,153, 25,191, - 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,159,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, - 7,103,230, 63,155,153, 25,191,127,165,127,165, 0, 0, 2,255,144,205, 76,190,210, 51,179, 63, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255,152,205, 76,190,158, 0,128, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,209,154, 25, 63, - 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,160,209, 76, 62, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255, -152,205, 76,190, 12,103,230, 63,168,153, 25,191, 0, 0, 1,128, 0, 0, 2,255,152,205, 76,190, 12,103,230, 63,244,204, 76,190, - 0, 0, 1,128, 0, 0, 2,255,152,205, 76,190, 12,103,230, 63,168,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255,144,205, 76,190, - 12,103,230, 63,150,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255,152,205, 76,190, 12,103,230, 63, 7, 0,128,191, 0, 0,127,165, -129, 90, 0,255, 80, 51,179, 63, 12,103,230, 63, 7, 0,128,191, 0, 0,127,165,129, 90, 0,255, 27, 0,128, 63, 10,103,230, 63, - 6, 0,128,191, 0, 0,127,165,129, 90, 0,255,204,153, 25, 63, 10,103,230, 63, 4, 0,128,191, 0, 0,127,165,129, 90, 0,255, -140,205, 76, 62, 8,103,230, 63, 3, 0,128,191, 0, 0,127,165,129, 90, 0,255, 81, 51,179, 63, 12,103,230, 63,150,153, 25, 63, - 0, 0, 1,128, 0, 0, 2,255, 28, 0,128, 63, 10,103,230, 63,150,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255,207,153, 25, 63, - 10,103,230, 63,154,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255,152,205, 76, 62, 8,103,230, 63,158,153, 25, 63, 0, 0, 1,128, - 0, 0, 2,255, 80, 51,179, 63, 12,103,230, 63,168,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63, -184,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255,204,153, 25, 63, 10,103,230, 63,200,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255, -140,205, 76, 62, 8,103,230, 63,216,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255, 80, 51,179, 63, 12,103,230, 63,244,204, 76,190, - 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63,228,204, 76,190, 0, 0, 1,128, 0, 0, 2,255,204,153, 25, 63, - 10,103,230, 63,212,204, 76,190, 0, 0, 1,128, 0, 0, 2,255,140,205, 76, 62, 8,103,230, 63,196,204, 76,190, 0, 0, 1,128, - 0, 0, 2,255, 80, 51,179, 63, 12,103,230, 63,168,153, 25,191, 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63, -164,153, 25,191, 0, 0, 1,128, 0, 0, 2,255,204,153, 25, 63, 10,103,230, 63,160,153, 25,191, 0, 0, 1,128, 0, 0, 2,255, -140,205, 76, 62, 8,103,230, 63,156,153, 25,191, 0, 0, 1,128, 0, 0, 2,255,140,205, 76, 62,204,209, 76, 62,255,255,127,191, - 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,188,209, 76, 62, 1, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63, -176,209, 76, 62, 2, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,160,209, 76, 62, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255,140,205, 76, 62,221,154, 25, 63,254,255,127,191, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,217,154, 25, 63, - 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,213,154, 25, 63, 2, 0,128,191, 0, 0, 0, 0,255,127, 2,255, - 80, 51,179, 63,209,154, 25, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62,163, 0,128, 63,254,255,127,191, - 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,162, 0,128, 63, 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63, -160, 0,128, 63, 2, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,158, 0,128, 63, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255,152,205, 76, 62,216, 51,179, 63,254,255,127,191, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63,214, 51,179, 63, - 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63,212, 51,179, 63, 1, 0,128,191, 0, 0, 0, 0,255,127, 2,255, - 81, 51,179, 63,210, 51,179, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,133,102,230, 63,206,154, 25, 63, 4, 0,128,191, -127,165, 0, 0,129, 90, 2,255,133,102,230, 63,208, 51,179, 63, 4, 0,128,191,127,165, 0, 0,129, 90, 2,255,128,205, 76,190, -116,201, 76, 62, 5, 0,128,191,255,127, 0, 0, 0, 0, 16,255,136,205, 76,190, 48,255,127, 63, 5, 0,128,191,255,127, 0, 0, - 0, 0, 16,255,112,205, 76,190, 64,208, 76,190,156,153, 25,191,255,127, 0, 0, 0, 0, 16,255,112,205, 76,190, 84,201, 76, 62, -160,153, 25,191,255,127, 0, 0, 0, 0, 18,255,120,205, 76,190,190,152, 25, 63,164,153, 25,191,255,127, 0, 0, 0, 0, 18,255, -152,205, 76,190, 46,255,127, 63,168,153, 25,191,255,127, 0, 0, 0, 0, 18,255,112,205, 76,190, 64,208, 76,190,195,204, 76,190, -255,127, 0, 0, 0, 0, 16,255,112,205, 76,190, 84,201, 76, 62,211,204, 76,190,255,127, 0, 0, 0, 0, 18,255,120,205, 76,190, -190,152, 25, 63,227,204, 76,190,255,127, 0, 0, 0, 0, 18,255,152,205, 76,190, 46,255,127, 63,243,204, 76,190,255,127, 0, 0, - 0, 0, 18,255,112,205, 76,190, 64,208, 76,190,221,204, 76, 62,255,127, 0, 0, 0, 0, 16,255,112,205, 76,190, 84,201, 76, 62, -205,204, 76, 62,255,127, 0, 0, 0, 0, 18,255,120,205, 76,190,190,152, 25, 63,189,204, 76, 62,255,127, 0, 0, 0, 0, 18,255, -152,205, 76,190, 46,255,127, 63,173,204, 76, 62,255,127, 0, 0, 0, 0, 18,255,112,205, 76,190, 64,208, 76,190,160,153, 25, 63, -255,127, 0, 0, 0, 0, 16,255,112,205, 76,190, 84,201, 76, 62,156,153, 25, 63,255,127, 0, 0, 0, 0, 18,255,120,205, 76,190, -198,152, 25, 63,152,153, 25, 63,255,127, 0, 0, 0, 0, 18,255,152,205, 76,190, 46,255,127, 63,152,153, 25, 63,255,127, 0, 0, - 0, 0, 18,255,112,205, 76,190, 64,208, 76,190, 4, 0,128,191, 94,231, 94,231,215,132, 16,255,120,205, 76,190,190,152, 25, 63, - 7, 0,128,191,255,127, 0, 0, 0, 0, 16,255, 96,205, 76,190,251, 50,179, 63, 4, 0,128,191,255,127, 0, 0, 0, 0, 16,255, -128,205, 76,190, 48,102,230, 63,156,153, 25, 63,255,127, 0, 0, 0, 0, 18,255, 96,205, 76,190,251, 50,179, 63,160,153, 25, 63, -255,127, 0, 0, 0, 0, 18,255,128,205, 76,190, 48,102,230, 63,205,204, 76, 62,255,127, 0, 0, 0, 0, 18,255, 96,205, 76,190, -251, 50,179, 63,221,204, 76, 62,255,127, 0, 0, 0, 0, 18,255,128,205, 76,190, 48,102,230, 63,211,204, 76,190,255,127, 0, 0, - 0, 0, 18,255, 96,205, 76,190,251, 50,179, 63,195,204, 76,190,255,127, 0, 0, 0, 0, 18,255,128,205, 76,190, 48,102,230, 63, -160,153, 25,191,255,127, 0, 0, 0, 0, 18,255, 96,205, 76,190,251, 50,179, 63,156,153, 25,191,255,127, 0, 0, 0, 0, 18,255, -144,205, 76,190, 10,103,230, 63, 5, 0,128,191,161,243, 93,111, 34,194, 16,255,144,205, 76,190, 10,103,230, 63,148,255,127, 63, -161,243, 93,111,222, 61, 16,255, 96,205, 76,190,251, 50,179, 63,150,255,127, 63,255,127, 0, 0, 0, 0, 16,255,120,205, 76,190, -190,152, 25, 63,144,255,127, 63,255,127, 0, 0, 0, 0, 16,255,112,205, 76,190, 64,208, 76,190,150,255,127, 63, 94,231, 94,231, - 41,123, 16,255,136,205, 76,190, 48,255,127, 63,148,255,127, 63,255,127, 0, 0, 0, 0, 16,255,128,205, 76,190,116,201, 76, 62, -148,255,127, 63,255,127, 0, 0, 0, 0, 16,255, 36, 51,179, 63, 56,208, 76,190,157,153, 25,191, 0, 0,255,127, 0, 0, 3,255, -222,255,127, 63, 80,208, 76,190,161,153, 25,191, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,165,153, 25,191, - 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190,169,153, 25,191, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, - 56,208, 76,190,198,204, 76,190, 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190,214,204, 76,190, 0, 0,255,127, - 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,230,204, 76,190, 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190, -246,204, 76,190, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, 56,208, 76,190,218,204, 76, 62, 0, 0,255,127, 0, 0, 3,255, -222,255,127, 63, 80,208, 76,190,202,204, 76, 62, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,186,204, 76, 62, - 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190,170,204, 76, 62, 0, 0,255,127, 0, 0, 3,255, 34, 51,179, 63, - 56,208, 76,190,159,153, 25, 63, 0, 0,255,127, 0, 0, 3,255,220,255,127, 63, 80,208, 76,190,155,153, 25, 63, 0, 0,255,127, - 0, 0, 3,255,114,153, 25, 63, 80,208, 76,190,151,153, 25, 63, 0, 0,255,127, 0, 0, 3,255, 36,204, 76, 62,104,208, 76,190, -151,153, 25, 63, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, 56,208, 76,190, 4, 0,128,191, 0, 0,255,127, 0, 0, 3,255, -222,255,127, 63, 80,208, 76,190, 5, 0,128,191, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190, 7, 0,128,191, - 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190, 8, 0,128,191, 0, 0,255,127, 0, 0, 3,255,136,102,230, 63, - 88,208, 76,190, 8, 0,128,191, 0, 0,255,127, 0, 0, 3,255,135,102,230, 63, 88,208, 76,190,151,153, 25, 63, 0, 0,255,127, - 0, 0, 3,255,136,102,230, 63, 88,208, 76,190,170,204, 76, 62, 0, 0,255,127, 0, 0, 3,255,136,102,230, 63, 88,208, 76,190, -246,204, 76,190, 0, 0,255,127, 0, 0, 3,255,136,102,230, 63, 88,208, 76,190,169,153, 25,191, 0, 0,255,127, 0, 0, 3,255, -112,205, 76,190, 64,208, 76,190,156,153, 25,191, 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, 64,208, 76,190,195,204, 76,190, - 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, 64,208, 76,190,221,204, 76, 62, 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, - 64,208, 76,190,160,153, 25, 63, 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, 64,208, 76,190, 4, 0,128,191, 0, 0,255,127, - 0, 0, 3,255,112,205, 76,190, 64,208, 76,190,150,255,127, 63, 0, 0,255,127, 0, 0, 3,255,136,102,230, 63, 88,208, 76,190, -142,255,127, 63, 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190,142,255,127, 63, 0, 0,255,127, 0, 0, 3,255, -116,153, 25, 63, 80,208, 76,190,144,255,127, 63, 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190,148,255,127, 63, - 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, 56,208, 76,190,150,255,127, 63, 0, 0,255,127, 0, 0, 3,255, 68, 65, 84, 65, - 64, 1, 0, 0, 80, 20,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208, 21,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,124, 14, 0, 0,208, 21,118, 1, - 0, 0, 0, 0, 53, 0, 0, 0, 53, 1, 0, 0, 21, 0, 0, 0, 82, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0, 83, 0, 0, 0, - 0, 0, 34, 0, 19, 0, 0, 0, 84, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 85, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, - 76, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, 28, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, - 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 34, 0, 27, 0, 0, 0, 56, 0, 0, 0, 0, 0, 34, 0, 29, 0, 0, 0, 48, 0, 0, 0, - 0, 0, 34, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 34, 0, 5, 0, 0, 0, 9, 0, 0, 0, 0, 0, 34, 0, - 8, 0, 0, 0, 9, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 34, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 34, 0, 9, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, - 8, 0, 0, 0, 12, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 12, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 34, 0, 10, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 10, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, - 10, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 16, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, - 12, 0, 0, 0, 16, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 16, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 34, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, 10, 0, 0, 0, 14, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, - 20, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 21, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 20, 0, 0, 0, 0, 0, 34, 0, - 4, 0, 0, 0, 19, 0, 0, 0, 0, 0, 34, 0, 5, 0, 0, 0, 18, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 34, 0, 24, 0, 0, 0, 25, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 22, 0, 0, 0, 0, 0, 34, 0, 17, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0, 24, 0, 0, 0, 0, 0, 34, 0, 9, 0, 0, 0, 25, 0, 0, 0, 0, 0, 34, 0, - 5, 0, 0, 0, 26, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 34, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 29, 0, 0, 0, 0, 0, 34, 0, 21, 0, 0, 0, - 27, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 29, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, - 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 34, 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 32, 0, 0, 0, 33, 0, 0, 0, - 0, 0, 34, 0, 29, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 23, 0, 0, 0, 30, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, - 34, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 33, 0, 0, 0, 0, 0, 34, 0, 16, 0, 0, 0, 32, 0, 0, 0, 0, 0, 34, 0, - 17, 0, 0, 0, 31, 0, 0, 0, 0, 0, 34, 0, 40, 0, 0, 0, 98, 0, 0, 0, 0, 0, 34, 0, 39, 0, 0, 0, 99, 0, 0, 0, - 0, 0, 34, 0, 38, 0, 0, 0,100, 0, 0, 0, 0, 0, 34, 0, 37, 0, 0, 0,101, 0, 0, 0, 0, 0, 34, 0, 41, 0, 0, 0, - 72, 0, 0, 0, 0, 0, 34, 0, 36, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, 38, 0, 0, 0, 39, 0, 0, 0, 0, 0, 34, 0, - 36, 0, 0, 0, 37, 0, 0, 0, 0, 0, 34, 0, 40, 0, 0, 0, 41, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0,109, 0, 0, 0, - 0, 0, 34, 0, 50, 0, 0, 0,101, 0, 0, 0, 0, 0, 34, 0, 68, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0, 64, 0, 0, 0, - 90, 0, 0, 0, 0, 0, 34, 0, 60, 0, 0, 0, 86, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, 82, 0, 0, 0, 0, 0, 34, 0, - 52, 0, 0, 0, 78, 0, 0, 0, 0, 0, 34, 0, 50, 0, 0, 0,114, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0,114, 0, 0, 0, - 0, 0, 34, 0, 67, 0, 0, 0,115, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0,115, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0, -115, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0,114, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, - 43, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 44, 0, 0, 0, - 0, 0, 34, 0, 44, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, 44, 0, 0, 0, 46, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, - 49, 0, 0, 0, 0, 0, 34, 0, 46, 0, 0, 0, 47, 0, 0, 0, 0, 0, 34, 0, 46, 0, 0, 0, 48, 0, 0, 0, 0, 0, 34, 0, - 48, 0, 0, 0, 49, 0, 0, 0, 0, 0, 34, 0, 55, 0, 0, 0, 56, 0, 0, 0, 0, 0, 34, 0, 54, 0, 0, 0, 55, 0, 0, 0, - 0, 0, 34, 0, 53, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 59, 0, 0, 0, - 60, 0, 0, 0, 0, 0, 34, 0, 55, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, 58, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, - 54, 0, 0, 0, 58, 0, 0, 0, 0, 0, 34, 0, 57, 0, 0, 0, 58, 0, 0, 0, 0, 0, 34, 0, 53, 0, 0, 0, 57, 0, 0, 0, - 0, 0, 34, 0, 60, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 59, 0, 0, 0, - 63, 0, 0, 0, 0, 0, 34, 0, 62, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, 58, 0, 0, 0, 62, 0, 0, 0, 0, 0, 34, 0, - 61, 0, 0, 0, 62, 0, 0, 0, 0, 0, 34, 0, 57, 0, 0, 0, 61, 0, 0, 0, 0, 0, 34, 0, 64, 0, 0, 0, 68, 0, 0, 0, - 0, 0, 34, 0, 67, 0, 0, 0, 68, 0, 0, 0, 0, 0, 34, 0, 63, 0, 0, 0, 67, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0, - 67, 0, 0, 0, 0, 0, 34, 0, 62, 0, 0, 0, 66, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0, 66, 0, 0, 0, 0, 0, 34, 0, - 61, 0, 0, 0, 65, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0, 68, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 34, 0, 48, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, 46, 0, 0, 0, 57, 0, 0, 0, 0, 0, 34, 0, 44, 0, 0, 0, - 61, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 65, 0, 0, 0, 0, 0, 34, 0, 69, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0, - 70, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0, 71, 0, 0, 0,102, 0, 0, 0, 0, 0, 34, 0, 72, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 34, 0, 73, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0, 74, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, 75, 0, 0, 0, - 89, 0, 0, 0, 0, 0, 34, 0, 76, 0, 0, 0, 85, 0, 0, 0, 0, 0, 34, 0, 77, 0, 0, 0, 81, 0, 0, 0, 0, 0, 34, 0, - 70, 0, 0, 0, 71, 0, 0, 0, 0, 0, 34, 0, 73, 0, 0, 0, 77, 0, 0, 0, 0, 0, 34, 0, 74, 0, 0, 0, 75, 0, 0, 0, - 0, 0, 34, 0, 69, 0, 0, 0, 77, 0, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0, -111, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0,112, 0, 0, 0, 0, 0, 34, 0, 78, 0, 0, 0,113, 0, 0, 0, 0, 0, 34, 0, - 79, 0, 0, 0, 80, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0, 85, 0, 0, 0, 0, 0, 34, 0, 83, 0, 0, 0, 84, 0, 0, 0, - 0, 0, 34, 0, 82, 0, 0, 0, 83, 0, 0, 0, 0, 0, 34, 0, 85, 0, 0, 0, 89, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, - 89, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0, 88, 0, 0, 0, 0, 0, 34, 0, 87, 0, 0, 0, 88, 0, 0, 0, 0, 0, 34, 0, - 83, 0, 0, 0, 87, 0, 0, 0, 0, 0, 34, 0, 86, 0, 0, 0, 87, 0, 0, 0, 0, 0, 34, 0, 82, 0, 0, 0, 86, 0, 0, 0, - 0, 0, 34, 0, 89, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, - 92, 0, 0, 0, 0, 0, 34, 0, 91, 0, 0, 0, 92, 0, 0, 0, 0, 0, 34, 0, 87, 0, 0, 0, 91, 0, 0, 0, 0, 0, 34, 0, - 90, 0, 0, 0, 91, 0, 0, 0, 0, 0, 34, 0, 86, 0, 0, 0, 90, 0, 0, 0, 0, 0, 34, 0, 93, 0, 0, 0, 97, 0, 0, 0, - 0, 0, 34, 0, 96, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0, 96, 0, 0, 0, 0, 0, 34, 0, 95, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 34, 0, 91, 0, 0, 0, 95, 0, 0, 0, 0, 0, 34, 0, 94, 0, 0, 0, 95, 0, 0, 0, 0, 0, 34, 0, - 90, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0, 96, 0, 0, 0, - 0, 0, 34, 0, 79, 0, 0, 0, 95, 0, 0, 0, 0, 0, 34, 0, 78, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0,101, 0, 0, 0, -105, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0,101, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0,104, 0, 0, 0, 0, 0, 34, 0, - 99, 0, 0, 0,100, 0, 0, 0, 0, 0, 34, 0, 99, 0, 0, 0,103, 0, 0, 0, 0, 0, 34, 0, 98, 0, 0, 0, 99, 0, 0, 0, - 0, 0, 34, 0, 98, 0, 0, 0,102, 0, 0, 0, 0, 0, 34, 0,105, 0, 0, 0,114, 0, 0, 0, 0, 0, 34, 0,105, 0, 0, 0, -109, 0, 0, 0, 0, 0, 34, 0,104, 0, 0, 0,105, 0, 0, 0, 0, 0, 34, 0,104, 0, 0, 0,108, 0, 0, 0, 0, 0, 34, 0, -103, 0, 0, 0,104, 0, 0, 0, 0, 0, 34, 0,103, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0,102, 0, 0, 0,103, 0, 0, 0, - 0, 0, 34, 0,102, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0,109, 0, 0, 0,113, 0, 0, 0, 0, 0, 34, 0,108, 0, 0, 0, -109, 0, 0, 0, 0, 0, 34, 0,108, 0, 0, 0,112, 0, 0, 0, 0, 0, 34, 0,107, 0, 0, 0,108, 0, 0, 0, 0, 0, 34, 0, -107, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0,106, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0,106, 0, 0, 0,110, 0, 0, 0, - 0, 0, 34, 0,113, 0, 0, 0,115, 0, 0, 0, 0, 0, 34, 0,112, 0, 0, 0,113, 0, 0, 0, 0, 0, 34, 0,111, 0, 0, 0, -112, 0, 0, 0, 0, 0, 34, 0,110, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0,121, 0, 0, 0,144, 0, 0, 0, 0, 0, 50, 0, -125, 0, 0, 0,142, 0, 0, 0, 0, 0, 50, 0,129, 0, 0, 0,140, 0, 0, 0, 0, 0, 50, 0,133, 0, 0, 0,138, 0, 0, 0, - 0, 0, 50, 0,120, 0, 0, 0,135, 0, 0, 0, 0, 0, 50, 0,118, 0, 0, 0,134, 0, 0, 0, 0, 0,178, 0,121, 0, 0, 0, -125, 0, 0, 0, 0, 0, 50, 0,120, 0, 0, 0,121, 0, 0, 0, 0, 0, 50, 0,120, 0, 0, 0,124, 0, 0, 0, 0, 0, 50, 0, -120, 0, 0, 0,119, 0, 0, 0, 0, 0, 50, 0,119, 0, 0, 0,123, 0, 0, 0, 0, 0, 50, 0,118, 0, 0, 0,119, 0, 0, 0, - 0, 0, 50, 0,118, 0, 0, 0,122, 0, 0, 0, 0, 0, 50, 0,125, 0, 0, 0,129, 0, 0, 0, 0, 0, 50, 0,124, 0, 0, 0, -125, 0, 0, 0, 0, 0, 50, 0,124, 0, 0, 0,128, 0, 0, 0, 0, 0, 50, 0,123, 0, 0, 0,124, 0, 0, 0, 0, 0, 50, 0, -123, 0, 0, 0,127, 0, 0, 0, 0, 0, 50, 0,122, 0, 0, 0,123, 0, 0, 0, 0, 0, 50, 0,122, 0, 0, 0,126, 0, 0, 0, - 0, 0,178, 0,129, 0, 0, 0,133, 0, 0, 0, 0, 0, 50, 0,128, 0, 0, 0,129, 0, 0, 0, 0, 0, 50, 0,128, 0, 0, 0, -132, 0, 0, 0, 0, 0, 50, 0,127, 0, 0, 0,128, 0, 0, 0, 0, 0, 50, 0,127, 0, 0, 0,131, 0, 0, 0, 0, 0, 50, 0, -126, 0, 0, 0,127, 0, 0, 0, 0, 0, 50, 0,126, 0, 0, 0,130, 0, 0, 0, 0, 0, 50, 0,132, 0, 0, 0,133, 0, 0, 0, - 0, 0, 50, 0,131, 0, 0, 0,132, 0, 0, 0, 0, 0, 50, 0,130, 0, 0, 0,131, 0, 0, 0, 0, 0, 50, 0,137, 0, 0, 0, -138, 0, 0, 0, 0, 0, 50, 0,138, 0, 0, 0,140, 0, 0, 0, 0, 0, 50, 0,139, 0, 0, 0,140, 0, 0, 0, 0, 0, 50, 0, -137, 0, 0, 0,139, 0, 0, 0, 0, 0, 50, 0,140, 0, 0, 0,142, 0, 0, 0, 0, 0, 50, 0,141, 0, 0, 0,142, 0, 0, 0, - 0, 0, 50, 0,142, 0, 0, 0,144, 0, 0, 0, 0, 0, 50, 0,143, 0, 0, 0,144, 0, 0, 0, 0, 0, 50, 0,141, 0, 0, 0, -143, 0, 0, 0, 0, 0, 50, 0,136, 0, 0, 0,144, 0, 0, 0, 0, 0, 50, 0,117, 0, 0, 0,135, 0, 0, 0, 0, 0,178, 0, -116, 0, 0, 0,135, 0, 0, 0, 0, 0, 50, 0,116, 0, 0, 0,134, 0, 0, 0, 0, 0,178, 0,119, 0, 0, 0,116, 0, 0, 0, - 0, 0, 50, 0,117, 0, 0, 0,121, 0, 0, 0, 0, 0, 50, 0,117, 0, 0, 0,136, 0, 0, 0, 0, 0, 50, 0,136, 0, 0, 0, -145, 0, 0, 0, 0, 0,178, 0,146, 0, 0, 0,147, 0, 0, 0, 0, 0,178, 0,147, 0, 0, 0,150, 0, 0, 0, 0, 0, 50, 0, -149, 0, 0, 0,151, 0, 0, 0, 0, 0,178, 0,148, 0, 0, 0,151, 0, 0, 0, 0, 0, 50, 0,148, 0, 0, 0,150, 0, 0, 0, - 0, 0,178, 0,138, 0, 0, 0,147, 0, 0, 0, 0, 0, 50, 0,130, 0, 0, 0,149, 0, 0, 0, 0, 0,178, 0,131, 0, 0, 0, -151, 0, 0, 0, 0, 0, 50, 0,132, 0, 0, 0,148, 0, 0, 0, 0, 0, 50, 0,133, 0, 0, 0,150, 0, 0, 0, 0, 0, 50, 0, -155, 0, 0, 0,171, 0, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0,153, 0, 0, 0,169, 0, 0, 0, - 0, 0, 35, 0,152, 0, 0, 0,168, 0, 0, 0, 0, 0, 35, 0,155, 0, 0, 0,159, 0, 0, 0, 0, 0, 35, 0,154, 0, 0, 0, -155, 0, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,158, 0, 0, 0, 0, 0, 35, 0,153, 0, 0, 0,154, 0, 0, 0, 0, 0, 35, 0, -153, 0, 0, 0,157, 0, 0, 0, 0, 0, 35, 0,152, 0, 0, 0,153, 0, 0, 0, 0, 0, 35, 0,152, 0, 0, 0,156, 0, 0, 0, - 0, 0, 35, 0,159, 0, 0, 0,163, 0, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,159, 0, 0, 0, 0, 0, 35, 0,158, 0, 0, 0, -162, 0, 0, 0, 0, 0, 35, 0,157, 0, 0, 0,158, 0, 0, 0, 0, 0, 35, 0,157, 0, 0, 0,161, 0, 0, 0, 0, 0, 35, 0, -156, 0, 0, 0,157, 0, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,160, 0, 0, 0, 0, 0, 35, 0,163, 0, 0, 0,167, 0, 0, 0, - 0, 0, 35, 0,162, 0, 0, 0,163, 0, 0, 0, 0, 0, 35, 0,162, 0, 0, 0,166, 0, 0, 0, 0, 0, 35, 0,161, 0, 0, 0, -162, 0, 0, 0, 0, 0, 35, 0,161, 0, 0, 0,165, 0, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,161, 0, 0, 0, 0, 0, 35, 0, -160, 0, 0, 0,164, 0, 0, 0, 0, 0, 35, 0,166, 0, 0, 0,167, 0, 0, 0, 0, 0, 35, 0,165, 0, 0, 0,166, 0, 0, 0, - 0, 0, 35, 0,164, 0, 0, 0,165, 0, 0, 0, 0, 0, 35, 0,169, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0,174, 0, 0, 0, -175, 0, 0, 0, 0, 0, 35, 0,172, 0, 0, 0,176, 0, 0, 0, 0, 0, 35, 0,168, 0, 0, 0,172, 0, 0, 0, 0, 0, 35, 0, -164, 0, 0, 0,173, 0, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,174, 0, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,175, 0, 0, 0, - 0, 0, 35, 0,152, 0, 0, 0,176, 0, 0, 0, 0, 0, 35, 0,177, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0,177, 0, 0, 0, -178, 0, 0, 0, 0, 0,163, 0,178, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0,179, 0, 0, 0,180, 0, 0, 0, 0, 0,163, 0, -171, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0,167, 0, 0, 0,180, 0, 0, 0, 0, 0, 35, 0,163, 0, 0, 0,179, 0, 0, 0, - 0, 0, 35, 0,159, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0,155, 0, 0, 0,177, 0, 0, 0, 0, 0, 35, 0,182, 0, 0, 0, -184, 0, 0, 0, 0, 0, 35, 0,183, 0, 0, 0,187, 0, 0, 0, 0, 0, 35, 0,185, 0, 0, 0,186, 0, 0, 0, 0, 0, 35, 0, -180, 0, 0, 0,182, 0, 0, 0, 0, 0, 35, 0,173, 0, 0, 0,183, 0, 0, 0, 0, 0, 35, 0,164, 0, 0, 0,187, 0, 0, 0, - 0, 0, 35, 0,165, 0, 0, 0,186, 0, 0, 0, 0, 0, 35, 0,166, 0, 0, 0,185, 0, 0, 0, 0, 0, 35, 0,167, 0, 0, 0, -184, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0,144, 36,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 38,118, 1, 0, 0, 0, 0, - 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 44,118, 1, 0, 0, 0, 0, - 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 58,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,240, 5, 0, 0, 16, 38,118, 1, 0, 0, 0, 0, 52, 0, 0, 0, 76, 0, 0, 0, 18, 0, 0, 0, 22, 0, 0, 0, - 26, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 19, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 9, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, - 25, 0, 0, 0, 24, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 28, 0, 0, 0, 6, 0, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 13, 0, 0, 0, - 17, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 15, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 23, 0, 0, 0, 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 32, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 29, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, - 65, 0, 0, 0,114, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 44, 0, 0, 0, 42, 0, 0, 0, 43, 0, 0, 0, - 0, 0, 0, 0, 46, 0, 0, 0, 57, 0, 0, 0, 61, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 48, 0, 0, 0, - 46, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 1, 0, 0, 0, 53, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, - 28, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 56, 0, 0, 0, 60, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 54, 0, 0, 0, 58, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, - 59, 0, 0, 0, 63, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 64, 0, 0, 0, 68, 0, 0, 0, 67, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 0, 0, 62, 0, 0, 0, 66, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0,115, 0, 0, 0, 51, 0, 0, 0, - 66, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 22, 0, 0, 0, 76, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 0, 19, 0, 0, 0, 84, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 21, 0, 0, 0, 82, 0, 0, 0, - 56, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 85, 0, 0, 0, 89, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, - 83, 0, 0, 0, 87, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 75, 0, 0, 0, 74, 0, 0, 0, 93, 0, 0, 0, - 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, 92, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 86, 0, 0, 0, - 90, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0, 97, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, - 90, 0, 0, 0, 91, 0, 0, 0, 95, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 73, 0, 0, 0, 77, 0, 0, 0, - 81, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, 80, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, - 52, 0, 0, 0, 68, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 36, 0, 0, 0, 50, 0, 0, 0,101, 0, 0, 0, - 0, 0, 0, 0,100, 0, 0, 0, 99, 0, 0, 0, 39, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 72, 0, 0, 0, - 41, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0,104, 0, 0, 0,100, 0, 0, 0,101, 0, 0, 0, 0, 0, 0, 0, -103, 0, 0, 0,102, 0, 0, 0, 98, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0,109, 0, 0, 0,105, 0, 0, 0, -114, 0, 0, 0, 0, 0, 0, 0,108, 0, 0, 0,107, 0, 0, 0,103, 0, 0, 0,104, 0, 0, 0, 0, 0, 0, 0,106, 0, 0, 0, - 70, 0, 0, 0, 71, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0,113, 0, 0, 0,112, 0, 0, 0,108, 0, 0, 0,109, 0, 0, 0, - 0, 0, 0, 0,111, 0, 0, 0,110, 0, 0, 0,106, 0, 0, 0,107, 0, 0, 0, 0, 0, 0, 0,113, 0, 0, 0,115, 0, 0, 0, - 52, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 79, 0, 0, 0, 80, 0, 0, 0,111, 0, 0, 0,112, 0, 0, 0, 0, 0, 0, 0, - 81, 0, 0, 0, 77, 0, 0, 0, 69, 0, 0, 0,110, 0, 0, 0, 0, 0, 0, 0,116, 0, 0, 0,135, 0, 0, 0,120, 0, 0, 0, -119, 0, 0, 0, 0, 0, 0, 16,125, 0, 0, 0,124, 0, 0, 0,120, 0, 0, 0,121, 0, 0, 0, 0, 0, 0, 16,123, 0, 0, 0, -122, 0, 0, 0,118, 0, 0, 0,119, 0, 0, 0, 0, 0, 0, 16,128, 0, 0, 0,127, 0, 0, 0,123, 0, 0, 0,124, 0, 0, 0, - 0, 0, 0, 16,133, 0, 0, 0,132, 0, 0, 0,128, 0, 0, 0,129, 0, 0, 0, 0, 0, 0, 16,131, 0, 0, 0,130, 0, 0, 0, -126, 0, 0, 0,127, 0, 0, 0, 0, 0, 0, 16,148, 0, 0, 0,151, 0, 0, 0,131, 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 16, -147, 0, 0, 0,150, 0, 0, 0,133, 0, 0, 0,138, 0, 0, 0, 0, 0, 0, 16,137, 0, 0, 0,138, 0, 0, 0,140, 0, 0, 0, -139, 0, 0, 0, 0, 0, 0, 16,140, 0, 0, 0,129, 0, 0, 0,125, 0, 0, 0,142, 0, 0, 0, 0, 0, 0, 16,141, 0, 0, 0, -142, 0, 0, 0,144, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 16,144, 0, 0, 0,121, 0, 0, 0,117, 0, 0, 0,136, 0, 0, 0, - 0, 0, 0, 16,171, 0, 0, 0,181, 0, 0, 0,177, 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 2,154, 0, 0, 0,153, 0, 0, 0, -169, 0, 0, 0,170, 0, 0, 0, 0, 0, 0, 2,152, 0, 0, 0,176, 0, 0, 0,172, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 2, -159, 0, 0, 0,158, 0, 0, 0,154, 0, 0, 0,155, 0, 0, 0, 0, 0, 0, 2,157, 0, 0, 0,156, 0, 0, 0,152, 0, 0, 0, -153, 0, 0, 0, 0, 0, 0, 2,179, 0, 0, 0,163, 0, 0, 0,159, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 2,162, 0, 0, 0, -161, 0, 0, 0,157, 0, 0, 0,158, 0, 0, 0, 0, 0, 0, 2,160, 0, 0, 0,174, 0, 0, 0,175, 0, 0, 0,156, 0, 0, 0, - 0, 0, 0, 2,167, 0, 0, 0,166, 0, 0, 0,162, 0, 0, 0,163, 0, 0, 0, 0, 0, 0, 2,165, 0, 0, 0,164, 0, 0, 0, -160, 0, 0, 0,161, 0, 0, 0, 0, 0, 0, 2,182, 0, 0, 0,184, 0, 0, 0,167, 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 2, -185, 0, 0, 0,186, 0, 0, 0,165, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 2,187, 0, 0, 0,183, 0, 0, 0,173, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65, 64, 14, 0, 0, 64, 44,118, 1, 0, 0, 0, 0, 60, 0, 0, 0, 76, 0, 0, 0, -250,168, 27, 63, 96,211, 93, 59, 84,162,203, 62, 96,211, 93, 59, 84,162,203, 62, 96,211, 93, 59,251,168, 27, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 21,172,131, 63, 96,211, 93, 59,146,128, 81, 63, 96,211, 93, 59, -149,128, 81, 63, 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, -227,151,158, 63, 96,211, 93, 59,174,131,185, 63, 96,211, 93, 59,174,131,185, 63, 96,211, 93, 59,225,151,158, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,149,128, 81, 63, 96,211, 93, 59,251,168, 27, 63, 96,211, 93, 59, -246,168, 27, 63, 96,211, 93, 59,142,128, 81, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, -227,151,158, 63, 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59, 24,172,131, 63, 96,211, 93, 59,226,151,158, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,246,168, 27, 63, 96,211, 93, 59, 86,162,203, 62, 96,211, 93, 59, - 85,162,203, 62, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, - 24,172,131, 63, 96,211, 93, 59,142,128, 81, 63, 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59, 21,172,131, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,174,131,185, 63, 96,211, 93, 59,226,151,158, 63, 96,211, 93, 59, -226,151,158, 63, 96,211, 93, 59,176,131,185, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, -144,128, 81, 63, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,226,151,158, 63, 96,211, 93, 59, 21,172,131, 63, 96,211, 93, 59, - 22,172,131, 63, 96,211, 93, 59,224,151,158, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, -247,168, 27, 63, 96,211, 93, 59, 85,162,203, 62, 96,211, 93, 59, 86,162,203, 62, 96,211, 93, 59,248,168, 27, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 22,172,131, 63, 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59, -144,128, 81, 63, 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, -226,151,158, 63, 96,211, 93, 59,176,131,185, 63, 96,211, 93, 59,174,131,185, 63, 96,211, 93, 59,224,151,158, 63, 96,211, 93, 59, - 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, - 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, - 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, 72, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, - 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -174,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63,111,179,141, 63,174,225, 76, 63,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63, -188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 44,244,114, 63,236, 65, 79, 63,174,225, 76, 63,102, 84,117, 63,172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, - 52,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63,188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63,236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63, -172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 56,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 96,105,188,189,120, 47, 41, 63, 56,127,118,190,220, 28, 3, 63, - 56,127,118,190,220, 28, 3, 63, 96,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 26, 95, 82, 62,102, 84,117, 63,200, 84,104, 61,244, 65, 79, 63,200, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,190,188, 0, 63,171,188,160, 63,122, 84,181, 62,113,179,141, 63, -122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -200, 84,104, 61,242, 65, 79, 63, 96,105,188,189,120, 47, 41, 63,128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, - 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63, -160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61,242, 65, 79, 63,128,105,188,189,120, 47, 41, 63, -128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, - 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63,160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, -188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -180,131,140, 63,116, 19,186, 62,244,140,159, 63, 50, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 42,244,114, 63,244, 28, 3, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,174,225, 76, 63, 0, 21,186, 62, 51,207, 38, 63, 24,224, 91, 62, -112,226, 76, 63, 64, 38,135, 61,240,244,114, 63, 4,221, 91, 62, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -185,188, 0, 63, 96, 44,135, 61, 61, 84,181, 62,176,104,169,189, 93,189, 0, 63, 80, 1,109,190,248,207, 38, 63,144,109,169,189, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,174,225, 76, 63,116, 47, 41, 63, 52,207, 38, 63,248, 28, 3, 63, -174,225, 76, 63, 0, 21,186, 62, 42,244,114, 63,244, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -185,188, 0, 63, 0, 21,186, 62,122, 84,181, 62, 32,224, 91, 62,185,188, 0, 63, 96, 44,135, 61, 51,207, 38, 63, 24,224, 91, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,236, 65, 79, 63, -174,225, 76, 63,116, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -188,188, 0, 63,120, 47, 41, 63,122, 84,181, 62,248, 28, 3, 63,185,188, 0, 63, 0, 21,186, 62, 52,207, 38, 63,248, 28, 3, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 14, 95, 82, 62, 0, 21,186, 62,144, 82,104, 61,128,223, 91, 62, -138, 94, 82, 62, 48, 43,135, 61,122, 84,181, 62, 32,224, 91, 62, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -190,188, 0, 63,102, 84,117, 63,127, 84,181, 62,242, 65, 79, 63,188,188, 0, 63,120, 47, 41, 63, 52,207, 38, 63,236, 65, 79, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,120, 47, 41, 63,160, 84,104, 61, 0, 29, 3, 63, - 14, 95, 82, 62, 0, 21,186, 62,122, 84,181, 62,248, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -190,188, 0, 63,102, 84,117, 63, 56,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63, - 26, 95, 82, 62,120, 47, 41, 63,127, 84,181, 62,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63,128,106,188,189,176, 20,186, 62,160, 84,104, 61, 0, 29, 3, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 56,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63, -172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 44,244,114, 63,236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63, -188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63,236, 65, 79, 63,174,225, 76, 63,102, 84,117, 63, -172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63,188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,174,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, - 52,207, 38, 63,111,179,141, 63,174,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 99,131,140, 63, 72, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, - 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, - 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, -188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63,160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, - 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61,242, 65, 79, 63,128,105,188,189,120, 47, 41, 63, -128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63, -160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, - 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, -200, 84,104, 61,242, 65, 79, 63, 96,105,188,189,120, 47, 41, 63,128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,190,188, 0, 63,171,188,160, 63,122, 84,181, 62,113,179,141, 63, -122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 26, 95, 82, 62,102, 84,117, 63,200, 84,104, 61,244, 65, 79, 63,200, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 96,105,188,189,120, 47, 41, 63, 56,127,118,190,220, 28, 3, 63, - 56,127,118,190,220, 28, 3, 63, 96,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, - 68, 65, 84, 65,192, 4, 0, 0,192, 58,118, 1, 0, 0, 0, 0, 57, 0, 0, 0, 48, 1, 0, 0,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0, - 80, 83,118, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0,144,162,118, 1, 0, 0, 0, 0, 32, 2,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 46, 48, 48, 49, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,149,127, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64,162,118, 1, 0, 0, 0, 0,112,118,118, 1, 0, 0, 0, 0,128,124,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -144, 86,118, 1, 0, 0, 0, 0,144,102,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,138,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 85,118, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 16,101,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0,240,116,118, 1, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, -182, 0, 0, 0, 45, 1, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,213,204, 76, 63,255,204, 76, 63, - 0, 0,104,182, 30, 0,128, 63,140, 0,128, 63,214,255,127, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 64,162,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 16, 85,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,144, 86,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 56, 14, 0, 0,144, 86,118, 1, 0, 0, 0, 0, 56, 0, 0, 0,182, 0, 0, 0,133,102,230, 63,208, 51,179, 63, - 4, 0,128,191,127,165, 0, 0,129, 90, 2,255,133,102,230, 63,206,154, 25, 63, 4, 0,128,191,127,165, 0, 0,129, 90, 2,255, - 81, 51,179, 63,210, 51,179, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63,212, 51,179, 63, 1, 0,128,191, - 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63,214, 51,179, 63, 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255,152,205, 76, 62, -216, 51,179, 63,254,255,127,191, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,158, 0,128, 63, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255, 27, 0,128, 63,160, 0,128, 63, 2, 0,128,191, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,162, 0,128, 63, - 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62,163, 0,128, 63,254,255,127,191, 0, 0, 0, 0,255,127, 2,255, - 80, 51,179, 63,209,154, 25, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,213,154, 25, 63, 2, 0,128,191, - 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,217,154, 25, 63, 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62, -221,154, 25, 63,254,255,127,191, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,160,209, 76, 62, 3, 0,128,191, 0, 0, 0, 0, -255,127, 2,255, 27, 0,128, 63,176,209, 76, 62, 2, 0,128,191, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,188,209, 76, 62, - 1, 0,128,191, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62,204,209, 76, 62,255,255,127,191, 0, 0, 0, 0,255,127, 2,255, -140,205, 76, 62, 8,103,230, 63,156,153, 25,191, 0, 0, 1,128, 0, 0, 2,255,204,153, 25, 63, 10,103,230, 63,160,153, 25,191, - 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63,164,153, 25,191, 0, 0, 1,128, 0, 0, 2,255, 80, 51,179, 63, - 12,103,230, 63,168,153, 25,191, 0, 0, 1,128, 0, 0, 2,255,140,205, 76, 62, 8,103,230, 63,196,204, 76,190, 0, 0, 1,128, - 0, 0, 2,255,204,153, 25, 63, 10,103,230, 63,212,204, 76,190, 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63, -228,204, 76,190, 0, 0, 1,128, 0, 0, 2,255, 80, 51,179, 63, 12,103,230, 63,244,204, 76,190, 0, 0, 1,128, 0, 0, 2,255, -140,205, 76, 62, 8,103,230, 63,216,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255,204,153, 25, 63, 10,103,230, 63,200,204, 76, 62, - 0, 0, 1,128, 0, 0, 2,255, 27, 0,128, 63, 10,103,230, 63,184,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255, 80, 51,179, 63, - 12,103,230, 63,168,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255,152,205, 76, 62, 8,103,230, 63,158,153, 25, 63, 0, 0, 1,128, - 0, 0, 2,255,207,153, 25, 63, 10,103,230, 63,154,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255, 28, 0,128, 63, 10,103,230, 63, -150,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255, 81, 51,179, 63, 12,103,230, 63,150,153, 25, 63, 0, 0, 1,128, 0, 0, 2,255, -140,205, 76, 62, 8,103,230, 63, 3, 0,128,191, 0, 0,127,165,129, 90, 0,255,204,153, 25, 63, 10,103,230, 63, 4, 0,128,191, - 0, 0,127,165,129, 90, 0,255, 27, 0,128, 63, 10,103,230, 63, 6, 0,128,191, 0, 0,127,165,129, 90, 0,255, 80, 51,179, 63, - 12,103,230, 63, 7, 0,128,191, 0, 0,127,165,129, 90, 0,255,144,205, 76,190, 12,103,230, 63,150,153, 25, 63, 0, 0, 1,128, - 0, 0, 2,255,152,205, 76,190, 12,103,230, 63,168,204, 76, 62, 0, 0, 1,128, 0, 0, 2,255,152,205, 76,190, 12,103,230, 63, -244,204, 76,190, 0, 0, 1,128, 0, 0, 2,255,152,205, 76,190, 12,103,230, 63,168,153, 25,191, 0, 0, 1,128, 0, 0, 2,255, -152,205, 76,190,160,209, 76, 62, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,209,154, 25, 63, 3, 0,128,191, - 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,158, 0,128, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,144,205, 76,190, -210, 51,179, 63, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,131,102,230, 63, 7,103,230, 63,155,153, 25,191,127,165,127,165, - 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,159,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,160, 0,128, 63, -163,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,135,102,230, 63,207,154, 25, 63,167,153, 25,191, 1,128, 0, 0, 0, 0, 2,255, -131,102,230, 63, 7,103,230, 63,193,204, 76,190,127,165,127,165, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,209,204, 76,190, - 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,160, 0,128, 63,225,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,135,102,230, 63, -207,154, 25, 63,241,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, 7,103,230, 63,219,204, 76, 62,127,165,127,165, - 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,203,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,160, 0,128, 63, -187,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,135,102,230, 63,207,154, 25, 63,171,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255, -131,102,230, 63, 7,103,230, 63,159,153, 25, 63,127,165,127,165, 0, 0, 2,255,131,102,230, 63,212, 51,179, 63,155,153, 25, 63, - 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,156, 0,128, 63,151,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,135,102,230, 63, -207,154, 25, 63,151,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, 7,103,230, 63, 3, 0,128,191, 1,128, 0, 0, - 0, 0, 2,255,131,102,230, 63,160, 0,128, 63, 6, 0,128,191,127,165, 0, 0,129, 90, 2,255,127,102,230, 63, 28,208, 76, 62, - 3, 0,128,191,127,165, 0, 0,129, 90, 2,255,131,102,230, 63,136,201, 76,190,155,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255, -127,102,230, 63, 28,208, 76, 62,159,153, 25, 63, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63,136,201, 76,190,203,204, 76, 62, - 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62,219,204, 76, 62, 1,128, 0, 0, 0, 0, 2,255,131,102,230, 63, -136,201, 76,190,209,204, 76,190, 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62,193,204, 76,190, 1,128, 0, 0, - 0, 0, 2,255,131,102,230, 63,136,201, 76,190,159,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,127,102,230, 63, 28,208, 76, 62, -155,153, 25,191, 1,128, 0, 0, 0, 0, 2,255,150,205, 76, 62, 24,208, 76,190,254,255,127,191, 0, 0, 0, 0,255,127, 2,255, -207,153, 25, 63, 40,208, 76,190, 0, 0,128,191, 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63, 56,208, 76,190, 1, 0,128,191, - 0, 0, 0, 0,255,127, 2,255, 81, 51,179, 63, 72,208, 76,190, 3, 0,128,191, 0, 0, 0, 0,255,127, 2,255,133,102,230, 63, - 88,208, 76,190, 4, 0,128,191, 1,128, 0, 0, 0, 0, 2,255,133,102,230, 63, 88,208, 76,190,146,255,127, 63, 1,128, 0, 0, - 0, 0, 2,255, 81, 51,179, 63, 72,208, 76,190,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63, 56,208, 76,190, -152,255,127, 63, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63, 40,208, 76,190,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -150,205, 76, 62, 24,208, 76,190,156,255,127, 63, 0, 0, 0, 0,255,127, 2,255,127,102,230, 63, 28,208, 76, 62,148,255,127, 63, -127,165, 0, 0,129, 90, 2,255,131,102,230, 63,160, 0,128, 63,142,255,127, 63,127,165, 0, 0,129, 90, 2,255,131,102,230, 63, - 7,103,230, 63,148,255,127, 63, 1,128, 0, 0, 0, 0, 2,255,144,205, 76,190,210, 51,179, 63,148,255,127, 63, 0, 0, 0, 0, -255,127, 2,255,152,205, 76,190,158, 0,128, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,209,154, 25, 63, -148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,152,205, 76,190,160,209, 76, 62,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, - 80, 51,179, 63, 12,103,230, 63,140,255,127, 63, 0, 0,127,165,129, 90, 2,255, 27, 0,128, 63, 10,103,230, 63,142,255,127, 63, - 0, 0,127,165,129, 90, 2,255,204,153, 25, 63, 10,103,230, 63,146,255,127, 63, 0, 0,127,165,129, 90, 2,255,140,205, 76, 62, - 8,103,230, 63,148,255,127, 63, 0, 0,127,165,129, 90, 2,255,140,205, 76, 62,204,209, 76, 62,154,255,127, 63, 0, 0, 0, 0, -255,127, 2,255,204,153, 25, 63,188,209, 76, 62,152,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,176,209, 76, 62, -150,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,160,209, 76, 62,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -140,205, 76, 62,221,154, 25, 63,156,255,127, 63, 0, 0, 0, 0,255,127, 2,255,204,153, 25, 63,217,154, 25, 63,154,255,127, 63, - 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,213,154, 25, 63,150,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63, -209,154, 25, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,140,205, 76, 62,163, 0,128, 63,156,255,127, 63, 0, 0, 0, 0, -255,127, 2,255,204,153, 25, 63,162, 0,128, 63,154,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 27, 0,128, 63,160, 0,128, 63, -150,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 80, 51,179, 63,158, 0,128, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255, -152,205, 76, 62,216, 51,179, 63,156,255,127, 63, 0, 0, 0, 0,255,127, 2,255,207,153, 25, 63,214, 51,179, 63,154,255,127, 63, - 0, 0, 0, 0,255,127, 2,255, 28, 0,128, 63,212, 51,179, 63,152,255,127, 63, 0, 0, 0, 0,255,127, 2,255, 81, 51,179, 63, -210, 51,179, 63,148,255,127, 63, 0, 0, 0, 0,255,127, 2,255,133,102,230, 63,206,154, 25, 63,146,255,127, 63,127,165, 0, 0, -129, 90, 2,255,133,102,230, 63,208, 51,179, 63,146,255,127, 63,127,165, 0, 0,129, 90, 2,255,144,205, 76,190,140,201, 76, 62, -148,255,127, 63,255,127, 0, 0, 0, 0, 1,255,136,205, 76,190, 52,255,127, 63,148,255,127, 63,255,127, 0, 0, 0, 0, 1,255, -128,205, 76,190, 48,208, 76,190,150,255,127, 63,255,127, 0, 0, 0, 0, 3,255,120,205, 76,190,194,152, 25, 63,144,255,127, 63, -255,127, 0, 0, 0, 0, 1,255, 80,205, 76,190,254, 50,179, 63,150,255,127, 63,255,127, 0, 0, 0, 0, 1,255,128,205, 76,190, - 12,103,230, 63,148,255,127, 63,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190, 12,103,230, 63, 5, 0,128,191,255,127, 0, 0, - 0, 0, 3,255, 80,205, 76,190,254, 50,179, 63,156,153, 25,191,255,127, 0, 0, 0, 0, 3,255,112,205, 76,190, 50,102,230, 63, -160,153, 25,191,255,127, 0, 0, 0, 0, 3,255, 80,205, 76,190,254, 50,179, 63,195,204, 76,190,255,127, 0, 0, 0, 0, 3,255, -112,205, 76,190, 50,102,230, 63,211,204, 76,190,255,127, 0, 0, 0, 0, 3,255, 80,205, 76,190,254, 50,179, 63,221,204, 76, 62, -255,127, 0, 0, 0, 0, 3,255,112,205, 76,190, 50,102,230, 63,205,204, 76, 62,255,127, 0, 0, 0, 0, 3,255, 80,205, 76,190, -254, 50,179, 63,160,153, 25, 63,255,127, 0, 0, 0, 0, 3,255,112,205, 76,190, 50,102,230, 63,156,153, 25, 63,255,127, 0, 0, - 0, 0, 3,255, 80,205, 76,190,254, 50,179, 63, 4, 0,128,191,255,127, 0, 0, 0, 0, 1,255,120,205, 76,190,194,152, 25, 63, - 7, 0,128,191,255,127, 0, 0, 0, 0, 1,255,128,205, 76,190, 48,208, 76,190, 4, 0,128,191,255,127, 0, 0, 0, 0, 3,255, -152,205, 76,190, 52,255,127, 63,152,153, 25, 63,255,127, 0, 0, 0, 0, 3,255,120,205, 76,190,202,152, 25, 63,152,153, 25, 63, -255,127, 0, 0, 0, 0, 3,255,128,205, 76,190,108,201, 76, 62,156,153, 25, 63,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190, - 48,208, 76,190,160,153, 25, 63,255,127, 0, 0, 0, 0, 1,255,152,205, 76,190, 52,255,127, 63,173,204, 76, 62,255,127, 0, 0, - 0, 0, 3,255,120,205, 76,190,194,152, 25, 63,189,204, 76, 62,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190,108,201, 76, 62, -205,204, 76, 62,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190, 48,208, 76,190,221,204, 76, 62,255,127, 0, 0, 0, 0, 1,255, -152,205, 76,190, 52,255,127, 63,243,204, 76,190,255,127, 0, 0, 0, 0, 3,255,120,205, 76,190,194,152, 25, 63,227,204, 76,190, -255,127, 0, 0, 0, 0, 3,255,128,205, 76,190,108,201, 76, 62,211,204, 76,190,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190, - 48,208, 76,190,195,204, 76,190,255,127, 0, 0, 0, 0, 1,255,152,205, 76,190, 52,255,127, 63,168,153, 25,191,255,127, 0, 0, - 0, 0, 3,255,120,205, 76,190,194,152, 25, 63,164,153, 25,191,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190,108,201, 76, 62, -160,153, 25,191,255,127, 0, 0, 0, 0, 3,255,128,205, 76,190, 48,208, 76,190,156,153, 25,191,255,127, 0, 0, 0, 0, 1,255, -136,205, 76,190, 52,255,127, 63, 5, 0,128,191,255,127, 0, 0, 0, 0, 1,255,144,205, 76,190,140,201, 76, 62, 5, 0,128,191, -255,127, 0, 0, 0, 0, 1,255, 36, 51,179, 63, 56,208, 76,190,150,255,127, 63, 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, - 80,208, 76,190,148,255,127, 63, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,144,255,127, 63, 0, 0,255,127, - 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190,142,255,127, 63, 0, 0,255,127, 0, 0, 3,255,112,205, 76,190, 64,208, 76,190, -150,255,127, 63, 94,231, 94,231, 41,123, 1,255,112,205, 76,190, 64,208, 76,190, 4, 0,128,191, 94,231, 94,231,215,132, 1,255, -112,205, 76,190, 64,208, 76,190,160,153, 25, 63, 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, 64,208, 76,190,221,204, 76, 62, - 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, 64,208, 76,190,195,204, 76,190, 0, 0,255,127, 0, 0, 1,255,112,205, 76,190, - 64,208, 76,190,156,153, 25,191, 0, 0,255,127, 0, 0, 1,255,136,102,230, 63, 88,208, 76,190,169,153, 25,191, 0, 0,255,127, - 0, 0, 3,255,136,102,230, 63, 88,208, 76,190,246,204, 76,190, 0, 0,255,127, 0, 0, 3,255,136,102,230, 63, 88,208, 76,190, -170,204, 76, 62, 0, 0,255,127, 0, 0, 3,255,135,102,230, 63, 88,208, 76,190,151,153, 25, 63, 0, 0,255,127, 0, 0, 3,255, - 44,204, 76, 62,104,208, 76,190, 8, 0,128,191, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190, 7, 0,128,191, - 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190, 5, 0,128,191, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, - 56,208, 76,190, 4, 0,128,191, 0, 0,255,127, 0, 0, 3,255, 36,204, 76, 62,104,208, 76,190,151,153, 25, 63, 0, 0,255,127, - 0, 0, 3,255,114,153, 25, 63, 80,208, 76,190,151,153, 25, 63, 0, 0,255,127, 0, 0, 3,255,220,255,127, 63, 80,208, 76,190, -155,153, 25, 63, 0, 0,255,127, 0, 0, 3,255, 34, 51,179, 63, 56,208, 76,190,159,153, 25, 63, 0, 0,255,127, 0, 0, 3,255, - 44,204, 76, 62,104,208, 76,190,170,204, 76, 62, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,186,204, 76, 62, - 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190,202,204, 76, 62, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, - 56,208, 76,190,218,204, 76, 62, 0, 0,255,127, 0, 0, 3,255, 44,204, 76, 62,104,208, 76,190,246,204, 76,190, 0, 0,255,127, - 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,230,204, 76,190, 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190, -214,204, 76,190, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, 56,208, 76,190,198,204, 76,190, 0, 0,255,127, 0, 0, 3,255, - 44,204, 76, 62,104,208, 76,190,169,153, 25,191, 0, 0,255,127, 0, 0, 3,255,116,153, 25, 63, 80,208, 76,190,165,153, 25,191, - 0, 0,255,127, 0, 0, 3,255,222,255,127, 63, 80,208, 76,190,161,153, 25,191, 0, 0,255,127, 0, 0, 3,255, 36, 51,179, 63, - 56,208, 76,190,157,153, 25,191, 0, 0,255,127, 0, 0, 3,255, 68, 65, 84, 65, 64, 1, 0, 0, 16,101,118, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -144,102,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 28, 14, 0, 0,144,102,118, 1, 0, 0, 0, 0, 53, 0, 0, 0, 45, 1, 0, 0, - 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 34, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 34, 0, 5, 0, 0, 0, 9, 0, 0, 0, 0, 0, 34, 0, 8, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, - 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 34, 0, 9, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, 8, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 12, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, - 10, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 10, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 34, 0, 13, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 16, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 12, 0, 0, 0, - 16, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 16, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, - 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, 10, 0, 0, 0, 14, 0, 0, 0, 0, 0, 34, 0, 21, 0, 0, 0, 37, 0, 0, 0, - 0, 0, 34, 0, 20, 0, 0, 0, 36, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, - 34, 0, 0, 0, 0, 0, 34, 0, 21, 0, 0, 0, 25, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0, 21, 0, 0, 0, 0, 0, 34, 0, - 20, 0, 0, 0, 24, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, 20, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 34, 0, 18, 0, 0, 0, 19, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 22, 0, 0, 0, 0, 0, 34, 0, 25, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 34, 0, 24, 0, 0, 0, 25, 0, 0, 0, 0, 0, 34, 0, 24, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, - 23, 0, 0, 0, 24, 0, 0, 0, 0, 0, 34, 0, 23, 0, 0, 0, 27, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, 23, 0, 0, 0, - 0, 0, 34, 0, 22, 0, 0, 0, 26, 0, 0, 0, 0, 0, 34, 0, 29, 0, 0, 0, 33, 0, 0, 0, 0, 0, 34, 0, 28, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 34, 0, 28, 0, 0, 0, 32, 0, 0, 0, 0, 0, 34, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 34, 0, - 27, 0, 0, 0, 31, 0, 0, 0, 0, 0, 34, 0, 26, 0, 0, 0, 27, 0, 0, 0, 0, 0, 34, 0, 26, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 34, 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, 0, 34, 0, 31, 0, 0, 0, 32, 0, 0, 0, 0, 0, 34, 0, 30, 0, 0, 0, - 31, 0, 0, 0, 0, 0, 34, 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 34, 0, 36, 0, 0, 0, 37, 0, 0, 0, 0, 0, 34, 0, - 2, 0, 0, 0, 37, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 36, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 35, 0, 0, 0, - 0, 0, 34, 0, 5, 0, 0, 0, 34, 0, 0, 0, 0, 0, 34, 0, 38, 0, 0, 0, 39, 0, 0, 0, 0, 0, 34, 0, 40, 0, 0, 0, - 41, 0, 0, 0, 0, 0, 34, 0, 42, 0, 0, 0, 43, 0, 0, 0, 0, 0, 34, 0, 44, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, - 30, 0, 0, 0, 38, 0, 0, 0, 0, 0, 34, 0, 26, 0, 0, 0, 39, 0, 0, 0, 0, 0, 34, 0, 22, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 34, 0, 18, 0, 0, 0, 41, 0, 0, 0, 0, 0, 34, 0, 17, 0, 0, 0, 42, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0, - 43, 0, 0, 0, 0, 0, 34, 0, 9, 0, 0, 0, 44, 0, 0, 0, 0, 0, 34, 0, 5, 0, 0, 0, 45, 0, 0, 0, 0, 0, 34, 0, - 49, 0, 0, 0, 72, 0, 0, 0, 0, 0, 34, 0, 53, 0, 0, 0, 70, 0, 0, 0, 0, 0, 34, 0, 57, 0, 0, 0, 68, 0, 0, 0, - 0, 0, 34, 0, 61, 0, 0, 0, 66, 0, 0, 0, 0, 0, 34, 0, 48, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, 46, 0, 0, 0, - 62, 0, 0, 0, 0, 0, 34, 0, 49, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, 48, 0, 0, 0, 49, 0, 0, 0, 0, 0, 34, 0, - 48, 0, 0, 0, 52, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, 48, 0, 0, 0, 0, 0, 34, 0, 47, 0, 0, 0, 51, 0, 0, 0, - 0, 0, 34, 0, 46, 0, 0, 0, 47, 0, 0, 0, 0, 0, 34, 0, 46, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, 53, 0, 0, 0, - 57, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0, 53, 0, 0, 0, 0, 0, 34, 0, 52, 0, 0, 0, 56, 0, 0, 0, 0, 0, 34, 0, - 51, 0, 0, 0, 52, 0, 0, 0, 0, 0, 34, 0, 51, 0, 0, 0, 55, 0, 0, 0, 0, 0, 34, 0, 50, 0, 0, 0, 51, 0, 0, 0, - 0, 0, 34, 0, 50, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, 57, 0, 0, 0, 61, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, - 57, 0, 0, 0, 0, 0, 34, 0, 56, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 55, 0, 0, 0, 56, 0, 0, 0, 0, 0, 34, 0, - 55, 0, 0, 0, 59, 0, 0, 0, 0, 0, 34, 0, 54, 0, 0, 0, 55, 0, 0, 0, 0, 0, 34, 0, 54, 0, 0, 0, 58, 0, 0, 0, - 0, 0, 34, 0, 60, 0, 0, 0, 61, 0, 0, 0, 0, 0, 34, 0, 59, 0, 0, 0, 60, 0, 0, 0, 0, 0, 34, 0, 58, 0, 0, 0, - 59, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0, 66, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0, 68, 0, 0, 0, 0, 0, 34, 0, - 67, 0, 0, 0, 68, 0, 0, 0, 0, 0, 34, 0, 68, 0, 0, 0, 70, 0, 0, 0, 0, 0, 34, 0, 69, 0, 0, 0, 70, 0, 0, 0, - 0, 0, 34, 0, 67, 0, 0, 0, 69, 0, 0, 0, 0, 0, 34, 0, 70, 0, 0, 0, 72, 0, 0, 0, 0, 0, 34, 0, 71, 0, 0, 0, - 72, 0, 0, 0, 0, 0, 34, 0, 64, 0, 0, 0, 72, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, - 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 0, 0, 34, 0, 1, 0, 0, 0, 49, 0, 0, 0, 0, 0, 34, 0, 1, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 33, 0, 0, 0, - 58, 0, 0, 0, 0, 0, 34, 0, 29, 0, 0, 0, 54, 0, 0, 0, 0, 0, 34, 0, 25, 0, 0, 0, 50, 0, 0, 0, 0, 0, 34, 0, - 21, 0, 0, 0, 46, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 64, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 34, 0, 75, 0, 0, 0, 76, 0, 0, 0, 0, 0, 34, 0, 73, 0, 0, 0, 74, 0, 0, 0, 0, 0, 34, 0, 71, 0, 0, 0, - 77, 0, 0, 0, 0, 0, 34, 0, 64, 0, 0, 0, 77, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 76, 0, 0, 0, 0, 0, 34, 0, - 15, 0, 0, 0, 75, 0, 0, 0, 0, 0, 34, 0, 16, 0, 0, 0, 74, 0, 0, 0, 0, 0, 34, 0, 17, 0, 0, 0, 73, 0, 0, 0, - 0, 0, 34, 0, 82, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0, 81, 0, 0, 0, 95, 0, 0, 0, 0, 0, 34, 0, 80, 0, 0, 0, - 96, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0, 78, 0, 0, 0, 83, 0, 0, 0, 0, 0, 34, 0, - 81, 0, 0, 0, 82, 0, 0, 0, 0, 0, 34, 0, 79, 0, 0, 0, 80, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0,105, 0, 0, 0, - 0, 0, 34, 0, 83, 0, 0, 0, 97, 0, 0, 0, 0, 0, 34, 0, 83, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0, 85, 0, 0, 0, -111, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0, 84, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0, - 86, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0, 87, 0, 0, 0,102, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 34, 0, 89, 0, 0, 0, 94, 0, 0, 0, 0, 0, 34, 0, 86, 0, 0, 0, 87, 0, 0, 0, 0, 0, 34, 0, 88, 0, 0, 0, - 89, 0, 0, 0, 0, 0, 34, 0, 93, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0, 92, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0, - 91, 0, 0, 0,108, 0, 0, 0, 0, 0, 34, 0, 90, 0, 0, 0,109, 0, 0, 0, 0, 0, 34, 0, 90, 0, 0, 0, 91, 0, 0, 0, - 0, 0, 34, 0, 92, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, 97, 0, 0, 0,101, 0, 0, 0, 0, 0, 34, 0, 96, 0, 0, 0, - 97, 0, 0, 0, 0, 0, 34, 0, 96, 0, 0, 0,100, 0, 0, 0, 0, 0, 34, 0, 95, 0, 0, 0, 96, 0, 0, 0, 0, 0, 34, 0, - 95, 0, 0, 0, 99, 0, 0, 0, 0, 0, 34, 0, 94, 0, 0, 0, 95, 0, 0, 0, 0, 0, 34, 0, 94, 0, 0, 0, 98, 0, 0, 0, - 0, 0, 34, 0,101, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0,101, 0, 0, 0,105, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0, -101, 0, 0, 0, 0, 0, 34, 0,100, 0, 0, 0,104, 0, 0, 0, 0, 0, 34, 0, 99, 0, 0, 0,100, 0, 0, 0, 0, 0, 34, 0, - 99, 0, 0, 0,103, 0, 0, 0, 0, 0, 34, 0, 98, 0, 0, 0, 99, 0, 0, 0, 0, 0, 34, 0, 98, 0, 0, 0,102, 0, 0, 0, - 0, 0, 34, 0,105, 0, 0, 0,109, 0, 0, 0, 0, 0, 34, 0,104, 0, 0, 0,105, 0, 0, 0, 0, 0, 34, 0,104, 0, 0, 0, -108, 0, 0, 0, 0, 0, 34, 0,103, 0, 0, 0,104, 0, 0, 0, 0, 0, 34, 0,103, 0, 0, 0,107, 0, 0, 0, 0, 0, 34, 0, -102, 0, 0, 0,103, 0, 0, 0, 0, 0, 34, 0,102, 0, 0, 0,106, 0, 0, 0, 0, 0, 34, 0,109, 0, 0, 0,111, 0, 0, 0, - 0, 0, 34, 0,108, 0, 0, 0,109, 0, 0, 0, 0, 0, 34, 0,107, 0, 0, 0,108, 0, 0, 0, 0, 0, 34, 0,106, 0, 0, 0, -107, 0, 0, 0, 0, 0, 34, 0, 65, 0, 0, 0, 78, 0, 0, 0, 0, 0, 34, 0, 66, 0, 0, 0, 83, 0, 0, 0, 0, 0, 34, 0, - 58, 0, 0, 0, 85, 0, 0, 0, 0, 0, 34, 0, 59, 0, 0, 0,111, 0, 0, 0, 0, 0, 34, 0, 60, 0, 0, 0, 84, 0, 0, 0, - 0, 0, 34, 0, 61, 0, 0, 0,110, 0, 0, 0, 0, 0, 34, 0, 30, 0, 0, 0, 93, 0, 0, 0, 0, 0, 34, 0, 31, 0, 0, 0, - 92, 0, 0, 0, 0, 0, 34, 0, 32, 0, 0, 0, 91, 0, 0, 0, 0, 0, 34, 0, 33, 0, 0, 0, 90, 0, 0, 0, 0, 0, 34, 0, -113, 0, 0, 0,130, 0, 0, 0, 0, 0, 35, 0,115, 0, 0, 0,131, 0, 0, 0, 0, 0, 35, 0,112, 0, 0, 0,132, 0, 0, 0, - 0, 0, 35, 0,114, 0, 0, 0,133, 0, 0, 0, 0, 0, 35, 0,116, 0, 0, 0,125, 0, 0, 0, 0, 0, 35, 0,117, 0, 0, 0, -126, 0, 0, 0, 0, 0, 35, 0,113, 0, 0, 0,115, 0, 0, 0, 0, 0, 35, 0,112, 0, 0, 0,115, 0, 0, 0, 0, 0,163, 0, -112, 0, 0, 0,114, 0, 0, 0, 0, 0, 35, 0,113, 0, 0, 0,116, 0, 0, 0, 0, 0,163, 0,116, 0, 0, 0,117, 0, 0, 0, - 0, 0, 35, 0,118, 0, 0, 0,127, 0, 0, 0, 0, 0, 35, 0,118, 0, 0, 0,120, 0, 0, 0, 0, 0, 35, 0,127, 0, 0, 0, -146, 0, 0, 0, 0, 0,163, 0,142, 0, 0, 0,146, 0, 0, 0, 0, 0, 35, 0,144, 0, 0, 0,147, 0, 0, 0, 0, 0, 35, 0, -129, 0, 0, 0,147, 0, 0, 0, 0, 0, 35, 0,128, 0, 0, 0,147, 0, 0, 0, 0, 0,163, 0,128, 0, 0, 0,146, 0, 0, 0, - 0, 0, 35, 0,119, 0, 0, 0,127, 0, 0, 0, 0, 0, 35, 0,119, 0, 0, 0,120, 0, 0, 0, 0, 0, 35, 0,119, 0, 0, 0, -121, 0, 0, 0, 0, 0, 35, 0,122, 0, 0, 0,124, 0, 0, 0, 0, 0, 35, 0,121, 0, 0, 0,122, 0, 0, 0, 0, 0, 35, 0, -121, 0, 0, 0,123, 0, 0, 0, 0, 0, 35, 0,123, 0, 0, 0,124, 0, 0, 0, 0, 0, 35, 0,123, 0, 0, 0,125, 0, 0, 0, - 0, 0, 35, 0,125, 0, 0, 0,126, 0, 0, 0, 0, 0, 35, 0,132, 0, 0, 0,133, 0, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, -132, 0, 0, 0, 0, 0, 35, 0,130, 0, 0, 0,131, 0, 0, 0, 0, 0, 35, 0,133, 0, 0, 0,137, 0, 0, 0, 0, 0,163, 0, -136, 0, 0, 0,137, 0, 0, 0, 0, 0, 35, 0,132, 0, 0, 0,136, 0, 0, 0, 0, 0, 35, 0,135, 0, 0, 0,136, 0, 0, 0, - 0, 0, 35, 0,131, 0, 0, 0,135, 0, 0, 0, 0, 0, 35, 0,134, 0, 0, 0,135, 0, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, -134, 0, 0, 0, 0, 0, 35, 0,137, 0, 0, 0,141, 0, 0, 0, 0, 0, 35, 0,140, 0, 0, 0,141, 0, 0, 0, 0, 0, 35, 0, -136, 0, 0, 0,140, 0, 0, 0, 0, 0, 35, 0,139, 0, 0, 0,140, 0, 0, 0, 0, 0, 35, 0,135, 0, 0, 0,139, 0, 0, 0, - 0, 0, 35, 0,138, 0, 0, 0,139, 0, 0, 0, 0, 0, 35, 0,134, 0, 0, 0,138, 0, 0, 0, 0, 0, 35, 0,141, 0, 0, 0, -145, 0, 0, 0, 0, 0,163, 0,144, 0, 0, 0,145, 0, 0, 0, 0, 0, 35, 0,140, 0, 0, 0,144, 0, 0, 0, 0, 0, 35, 0, -143, 0, 0, 0,144, 0, 0, 0, 0, 0, 35, 0,139, 0, 0, 0,143, 0, 0, 0, 0, 0, 35, 0,142, 0, 0, 0,143, 0, 0, 0, - 0, 0, 35, 0,138, 0, 0, 0,142, 0, 0, 0, 0, 0, 35, 0,129, 0, 0, 0,145, 0, 0, 0, 0, 0, 35, 0,128, 0, 0, 0, -143, 0, 0, 0, 0, 0, 35, 0,125, 0, 0, 0,130, 0, 0, 0, 0, 0, 35, 0,123, 0, 0, 0,134, 0, 0, 0, 0, 0, 35, 0, -121, 0, 0, 0,138, 0, 0, 0, 0, 0, 35, 0,119, 0, 0, 0,142, 0, 0, 0, 0, 0, 35, 0,151, 0, 0, 0,166, 0, 0, 0, - 0, 0, 35, 0,150, 0, 0, 0,167, 0, 0, 0, 0, 0, 35, 0,149, 0, 0, 0,168, 0, 0, 0, 0, 0, 35, 0,148, 0, 0, 0, -169, 0, 0, 0, 0, 0, 35, 0,152, 0, 0, 0,154, 0, 0, 0, 0, 0,163, 0,148, 0, 0, 0,149, 0, 0, 0, 0, 0, 35, 0, -150, 0, 0, 0,151, 0, 0, 0, 0, 0, 35, 0,157, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,174, 0, 0, 0, - 0, 0, 35, 0,155, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,166, 0, 0, 0, 0, 0, 35, 0,154, 0, 0, 0, -155, 0, 0, 0, 0, 0, 35, 0,155, 0, 0, 0,156, 0, 0, 0, 0, 0,163, 0,156, 0, 0, 0,157, 0, 0, 0, 0, 0, 35, 0, -153, 0, 0, 0,157, 0, 0, 0, 0, 0,163, 0,158, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0,159, 0, 0, 0,177, 0, 0, 0, - 0, 0, 35, 0,160, 0, 0, 0,173, 0, 0, 0, 0, 0, 35, 0,161, 0, 0, 0,169, 0, 0, 0, 0, 0, 35, 0,158, 0, 0, 0, -159, 0, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,161, 0, 0, 0, 0, 0, 35, 0,162, 0, 0, 0,163, 0, 0, 0, 0, 0, 35, 0, -164, 0, 0, 0,165, 0, 0, 0, 0, 0, 35, 0,168, 0, 0, 0,169, 0, 0, 0, 0, 0, 35, 0,167, 0, 0, 0,168, 0, 0, 0, - 0, 0, 35, 0,166, 0, 0, 0,167, 0, 0, 0, 0, 0, 35, 0,169, 0, 0, 0,173, 0, 0, 0, 0, 0, 35, 0,172, 0, 0, 0, -173, 0, 0, 0, 0, 0, 35, 0,168, 0, 0, 0,172, 0, 0, 0, 0, 0, 35, 0,171, 0, 0, 0,172, 0, 0, 0, 0, 0, 35, 0, -167, 0, 0, 0,171, 0, 0, 0, 0, 0, 35, 0,170, 0, 0, 0,171, 0, 0, 0, 0, 0, 35, 0,166, 0, 0, 0,170, 0, 0, 0, - 0, 0, 35, 0,173, 0, 0, 0,177, 0, 0, 0, 0, 0, 35, 0,176, 0, 0, 0,177, 0, 0, 0, 0, 0, 35, 0,172, 0, 0, 0, -176, 0, 0, 0, 0, 0, 35, 0,175, 0, 0, 0,176, 0, 0, 0, 0, 0, 35, 0,171, 0, 0, 0,175, 0, 0, 0, 0, 0, 35, 0, -174, 0, 0, 0,175, 0, 0, 0, 0, 0, 35, 0,170, 0, 0, 0,174, 0, 0, 0, 0, 0, 35, 0,177, 0, 0, 0,181, 0, 0, 0, - 0, 0, 35, 0,180, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0,176, 0, 0, 0,180, 0, 0, 0, 0, 0, 35, 0,179, 0, 0, 0, -180, 0, 0, 0, 0, 0, 35, 0,175, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0,178, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0, -174, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0,165, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0,164, 0, 0, 0,180, 0, 0, 0, - 0, 0, 35, 0,163, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0,162, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, - 64, 1, 0, 0,240,116,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112,118,118, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,124,118, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,138,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,200, 5, 0, 0,112,118,118, 1, - 0, 0, 0, 0, 52, 0, 0, 0, 74, 0, 0, 0, 35, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 37, 0, 0, 0, 36, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 45, 0, 0, 0, 44, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 6, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 13, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 11, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 43, 0, 0, 0, - 42, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 16, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0, 73, 0, 0, 0, - 74, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 76, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, - 20, 0, 0, 0, 36, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 18, 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, - 0, 0, 0, 0, 50, 0, 0, 0, 25, 0, 0, 0, 21, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 23, 0, 0, 0, - 19, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 0, 28, 0, 0, 0, 24, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 26, 0, 0, 0, 22, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 0, 33, 0, 0, 0, 29, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, - 31, 0, 0, 0, 27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 38, 0, 0, 0, 39, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 90, 0, 0, 0, 91, 0, 0, 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0, - 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 48, 0, 0, 0, 63, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 62, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 51, 0, 0, 0, 47, 0, 0, 0, - 48, 0, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 56, 0, 0, 0, 52, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, - 54, 0, 0, 0, 50, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 59, 0, 0, 0, 55, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0,110, 0, 0, 0, 84, 0, 0, 0, 60, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0,111, 0, 0, 0, 85, 0, 0, 0, - 58, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 83, 0, 0, 0, 66, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, - 66, 0, 0, 0, 61, 0, 0, 0, 57, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 68, 0, 0, 0, 70, 0, 0, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 53, 0, 0, 0, 49, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 71, 0, 0, 0, - 72, 0, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 79, 0, 0, 0, 97, 0, 0, 0, 96, 0, 0, 0, - 0, 0, 0, 0, 95, 0, 0, 0, 94, 0, 0, 0, 82, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0,110, 0, 0, 0,101, 0, 0, 0, - 97, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0,100, 0, 0, 0, 99, 0, 0, 0, 95, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, - 98, 0, 0, 0, 88, 0, 0, 0, 89, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0,105, 0, 0, 0,104, 0, 0, 0,100, 0, 0, 0, -101, 0, 0, 0, 0, 0, 0, 0,103, 0, 0, 0,102, 0, 0, 0, 98, 0, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0,111, 0, 0, 0, -109, 0, 0, 0,105, 0, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,108, 0, 0, 0,107, 0, 0, 0,103, 0, 0, 0,104, 0, 0, 0, - 0, 0, 0, 0,106, 0, 0, 0, 86, 0, 0, 0, 87, 0, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 91, 0, 0, 0, -108, 0, 0, 0,109, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 93, 0, 0, 0,106, 0, 0, 0,107, 0, 0, 0, 0, 0, 0, 0, -120, 0, 0, 0,119, 0, 0, 0,127, 0, 0, 0,118, 0, 0, 0, 0, 0, 0, 2,121, 0, 0, 0,138, 0, 0, 0,142, 0, 0, 0, -119, 0, 0, 0, 0, 0, 0, 2,124, 0, 0, 0,123, 0, 0, 0,121, 0, 0, 0,122, 0, 0, 0, 0, 0, 0, 2,125, 0, 0, 0, -130, 0, 0, 0,134, 0, 0, 0,123, 0, 0, 0, 0, 0, 0, 2,117, 0, 0, 0,116, 0, 0, 0,125, 0, 0, 0,126, 0, 0, 0, - 0, 0, 0, 2,112, 0, 0, 0,114, 0, 0, 0,133, 0, 0, 0,132, 0, 0, 0, 0, 0, 0, 2,113, 0, 0, 0,115, 0, 0, 0, -131, 0, 0, 0,130, 0, 0, 0, 0, 0, 0, 2,131, 0, 0, 0,132, 0, 0, 0,136, 0, 0, 0,135, 0, 0, 0, 0, 0, 0, 2, -136, 0, 0, 0,137, 0, 0, 0,141, 0, 0, 0,140, 0, 0, 0, 0, 0, 0, 2,134, 0, 0, 0,135, 0, 0, 0,139, 0, 0, 0, -138, 0, 0, 0, 0, 0, 0, 2,139, 0, 0, 0,140, 0, 0, 0,144, 0, 0, 0,143, 0, 0, 0, 0, 0, 0, 2,129, 0, 0, 0, -147, 0, 0, 0,144, 0, 0, 0,145, 0, 0, 0, 0, 0, 0, 2,142, 0, 0, 0,143, 0, 0, 0,128, 0, 0, 0,146, 0, 0, 0, - 0, 0, 0, 2,149, 0, 0, 0,148, 0, 0, 0,169, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 2,151, 0, 0, 0,150, 0, 0, 0, -167, 0, 0, 0,166, 0, 0, 0, 0, 0, 0, 2,169, 0, 0, 0,161, 0, 0, 0,160, 0, 0, 0,173, 0, 0, 0, 0, 0, 0, 2, -167, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0,171, 0, 0, 0, 0, 0, 0, 2,154, 0, 0, 0,166, 0, 0, 0,170, 0, 0, 0, -155, 0, 0, 0, 0, 0, 0, 2,172, 0, 0, 0,173, 0, 0, 0,177, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 2,170, 0, 0, 0, -171, 0, 0, 0,175, 0, 0, 0,174, 0, 0, 0, 0, 0, 0, 2,177, 0, 0, 0,159, 0, 0, 0,158, 0, 0, 0,181, 0, 0, 0, - 0, 0, 0, 2,175, 0, 0, 0,176, 0, 0, 0,180, 0, 0, 0,179, 0, 0, 0, 0, 0, 0, 2,156, 0, 0, 0,174, 0, 0, 0, -178, 0, 0, 0,157, 0, 0, 0, 0, 0, 0, 2,180, 0, 0, 0,181, 0, 0, 0,165, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 2, -178, 0, 0, 0,179, 0, 0, 0,163, 0, 0, 0,162, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65,224, 13, 0, 0,128,124,118, 1, - 0, 0, 0, 0, 60, 0, 0, 0, 74, 0, 0, 0,160, 84,104, 61,242, 65, 79, 63,128,105,188,189,120, 47, 41, 63,160, 84,104, 61, - 0, 29, 3, 63, 26, 95, 82, 62,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, -113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63,127, 84,181, 62,242, 65, 79, 63,190,188, 0, 63,102, 84,117, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61, 0, 29, 3, 63,128,106,188,189,176, 20,186, 62,144, 82,104, 61, -128,223, 91, 62, 14, 95, 82, 62, 0, 21,186, 62, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,127, 84,181, 62, -242, 65, 79, 63, 26, 95, 82, 62,120, 47, 41, 63,122, 84,181, 62,248, 28, 3, 63,188,188, 0, 63,120, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 56,207, 38, 63,111,179,141, 63,190,188, 0, 63,102, 84,117, 63, 52,207, 38, 63, -236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, -248, 28, 3, 63, 14, 95, 82, 62, 0, 21,186, 62,122, 84,181, 62, 32,224, 91, 62,185,188, 0, 63, 0, 21,186, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,236, 65, 79, 63,188,188, 0, 63,120, 47, 41, 63, 52,207, 38, 63, -248, 28, 3, 63,174,225, 76, 63,116, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, - 32,224, 91, 62,138, 94, 82, 62, 48, 43,135, 61, 61, 84,181, 62,176,104,169,189,185,188, 0, 63, 96, 44,135, 61, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,248, 28, 3, 63,185,188, 0, 63, 0, 21,186, 62, 51,207, 38, 63, - 24,224, 91, 62,174,225, 76, 63, 0, 21,186, 62, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63, -236, 65, 79, 63,174,225, 76, 63,116, 47, 41, 63, 42,244,114, 63,244, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 51,207, 38, 63, 24,224, 91, 62,185,188, 0, 63, 96, 44,135, 61,248,207, 38, 63, -144,109,169,189,112,226, 76, 63, 64, 38,135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,240,244,114, 63, - 4,221, 91, 62,180,131,140, 63,116, 19,186, 62, 42,244,114, 63,244, 28, 3, 63,174,225, 76, 63, 0, 21,186, 62, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62, -102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61, -242, 65, 79, 63,128,105,188,189,120, 47, 41, 63,128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62, -113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62, -102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63,160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,128,105,188,189,120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, 64,127,118,190, -216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, -113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61,242, 65, 79, 63,128,105,188,189,120, 47, 41, 63,128,105,188,189, -120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63, -173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,102, 84,117, 63,200, 84,104, 61,242, 65, 79, 63,160, 84,104, 61, -242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 96,105,188,189, -120, 47, 41, 63, 56,127,118,190,220, 28, 3, 63, 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62, -102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,200, 84,104, 61, -244, 65, 79, 63, 96,105,188,189,120, 47, 41, 63, 96,105,188,189,120, 47, 41, 63,200, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63,236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63, -102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63, -173,188,160, 63, 56,207, 38, 63,111,179,141, 63, 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,172,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63, -111,179,141, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63, -236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,111,179,141, 63,188,188, 0, 63,173,188,160, 63,188,188, 0, 63, -173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,174,225, 76, 63, -102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63,236, 65, 79, 63,174,225, 76, 63,102, 84,117, 63,174,225, 76, 63, -102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63, -111,179,141, 63,190,188, 0, 63,171,188,160, 63,188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,162,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 72, 47, 41, 63, 99,131,140, 63, - 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, - 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, - 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, - 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63,236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63,210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, - 76, 47, 41, 63,244,140,159, 63, 50, 28, 3, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 22,172,131, 63, - 96,211, 93, 59,226,151,158, 63, 96,211, 93, 59,224,151,158, 63, 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,144,128, 81, 63, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59,248,168, 27, 63, - 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,176,131,185, 63, - 96,211, 93, 59,226,151,158, 63, 96,211, 93, 59,224,151,158, 63, 96,211, 93, 59,174,131,185, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 21,172,131, 63, 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59,144,128, 81, 63, - 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,247,168, 27, 63, - 96,211, 93, 59, 85,162,203, 62, 96,211, 93, 59, 85,162,203, 62, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,226,151,158, 63, 96,211, 93, 59, 24,172,131, 63, 96,211, 93, 59, 21,172,131, 63, - 96,211, 93, 59,226,151,158, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,142,128, 81, 63, - 96,211, 93, 59,246,168, 27, 63, 96,211, 93, 59,247,168, 27, 63, 96,211, 93, 59,144,128, 81, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,174,131,185, 63, 96,211, 93, 59,227,151,158, 63, 96,211, 93, 59,226,151,158, 63, - 96,211, 93, 59,174,131,185, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 22,172,131, 63, - 96,211, 93, 59,149,128, 81, 63, 96,211, 93, 59,142,128, 81, 63, 96,211, 93, 59, 24,172,131, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,251,168, 27, 63, 96,211, 93, 59, 84,162,203, 62, 96,211, 93, 59, 86,162,203, 62, - 96,211, 93, 59,246,168, 27, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,225,151,158, 63, - 96,211, 93, 59, 21,172,131, 63, 96,211, 93, 59, 22,172,131, 63, 96,211, 93, 59,227,151,158, 63, 96,211, 93, 59, 0, 0, 0, 0, - 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,146,128, 81, 63, 96,211, 93, 59,250,168, 27, 63, 96,211, 93, 59,251,168, 27, 63, - 96,211, 93, 59,149,128, 81, 63, 96,211, 93, 59, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63, -210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, 76, 47, 41, 63,244,140,159, 63, 50, 28, 3, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63, -236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,161,140,159, 63, -210, 28, 3, 63, 99,131,140, 63, 76, 47, 41, 63, 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 99,131,140, 63, 76, 47, 41, 63, 44,244,114, 63,236, 65, 79, 63, 44,244,114, 63, -236, 65, 79, 63, 99,131,140, 63, 76, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,162,140,159, 63, -210, 28, 3, 63, 99,131,140, 63, 72, 47, 41, 63, 99,131,140, 63, 76, 47, 41, 63,161,140,159, 63,210, 28, 3, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63,111,179,141, 63,190,188, 0, 63,171,188,160, 63,188,188, 0, 63, -173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63, -236, 65, 79, 63,174,225, 76, 63,102, 84,117, 63,174,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,174,225, 76, 63,102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63, -111,179,141, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 52,207, 38, 63, -111,179,141, 63,188,188, 0, 63,173,188,160, 63,188,188, 0, 63,173,188,160, 63, 52,207, 38, 63,111,179,141, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63,236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63, -102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,172,225, 76, 63, -102, 84,117, 63, 52,207, 38, 63,111,179,141, 63, 52,207, 38, 63,111,179,141, 63,172,225, 76, 63,102, 84,117, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63,173,188,160, 63, 56,207, 38, 63,111,179,141, 63, 52,207, 38, 63, -111,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 44,244,114, 63, -236, 65, 79, 63,172,225, 76, 63,102, 84,117, 63,172,225, 76, 63,102, 84,117, 63, 44,244,114, 63,236, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,200, 84,104, 61,244, 65, 79, 63, 96,105,188,189,120, 47, 41, 63, 96,105,188,189, -120, 47, 41, 63,200, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, -113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 96,105,188,189,120, 47, 41, 63, 56,127,118,190,220, 28, 3, 63, 64,127,118,190, -216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62, -102, 84,117, 63,200, 84,104, 61,242, 65, 79, 63,160, 84,104, 61,242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63,173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62, -113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61, -242, 65, 79, 63,128,105,188,189,120, 47, 41, 63,128,105,188,189,120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62,113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62, -102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,128,105,188,189, -120, 47, 41, 63, 64,127,118,190,216, 28, 3, 63, 64,127,118,190,216, 28, 3, 63,128,105,188,189,120, 47, 41, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 26, 95, 82, 62,102, 84,117, 63,160, 84,104, 61,242, 65, 79, 63,160, 84,104, 61, -242, 65, 79, 63, 26, 95, 82, 62,102, 84,117, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,188,188, 0, 63, -173,188,160, 63,122, 84,181, 62,113,179,141, 63,122, 84,181, 62,113,179,141, 63,188,188, 0, 63,173,188,160, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,160, 84,104, 61,242, 65, 79, 63,128,105,188,189,120, 47, 41, 63,128,105,188,189, -120, 47, 41, 63,160, 84,104, 61,242, 65, 79, 63, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0,122, 84,181, 62, -113,179,141, 63, 26, 95, 82, 62,102, 84,117, 63, 26, 95, 82, 62,102, 84,117, 63,122, 84,181, 62,113,179,141, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 60, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 4, 0, 0,160,138,118, 1, 0, 0, 0, 0, 57, 0, 0, 0, - 40, 1, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0,144,162,118, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0,144,178,118, 1, - 0, 0, 0, 0, 80, 83,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108, - 97,110,101, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,144, 69, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,178,118, 1, 0, 0, 0, 0,160,172,118, 1, 0, 0, 0, 0,128,173,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,165,118, 1, 0, 0, 0, 0, 96,169,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 64,175,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80,164,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,224,167,118, 1, - 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 32,171,118, 1, 0, 0, 0, 0, 3, 0, 0, 0, - 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,205, 76, 63,172,197, 39, 55,214,204, 76, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 64,178,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 80,164,118, 1, - 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208,165,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 1, 0, 0,208,165,118, 1, 0, 0, 0, 0, 56, 0, 0, 0, - 23, 0, 0, 0, 4,205, 76,191, 0, 0, 0, 0,208,204,204,190, 0, 0, 1,128, 0, 0, 3, 1, 55,205,204,190, 0, 0, 0, 0, -216,204,204,190, 0, 0, 1,128, 0, 0, 3, 1, 0, 0, 70,182, 0, 0,128, 52,224,204,204,190, 0, 0, 1,128, 0, 0, 3, 1, - 4,205, 76,191, 0, 0, 0, 0, 0, 0, 96, 52, 0, 0, 1,128, 0, 0, 3, 1, 55,205,204,190, 0, 0, 0, 0, 0, 0, 0,179, - 0, 0, 1,128, 0, 0, 3, 1, 0, 0, 70,182, 0, 0,128, 52, 0, 0,144,180, 0, 0, 1,128, 0, 0, 3, 1, 4,205, 76,191, - 0, 0, 0, 0,213,204,204, 62, 0, 0, 1,128, 0, 0, 3, 1, 55,205,204,190, 0, 0, 0, 0,205,204,204, 62, 0, 0, 1,128, - 0, 0, 3, 1, 0, 0, 70,182, 0, 0,128, 52,197,204,204, 62, 0, 0, 1,128, 0, 0, 3, 1, 47,205,204,190, 0, 0, 0, 0, -206,204, 76, 63, 0, 0, 1,128, 0, 0, 3, 1, 0, 0, 62,182, 0, 0,128, 52,206,204, 76, 63, 0, 0, 1,128, 0, 0, 3, 1, - 4,205, 76,191, 0, 0, 0, 0,208,204, 76,191, 0, 0, 1,128, 0, 0, 3, 1, 55,205,204,190, 0, 0, 0, 0,212,204, 76,191, - 0, 0, 1,128, 0, 0, 3, 1, 0, 0, 70,182, 0, 0,128, 52,214,204, 76,191, 0, 0, 1,128, 0, 0, 3, 1, 47,205,204, 62, - 0, 0,128,180,206,204, 76,191, 0, 0, 1,128, 0, 0, 3, 1, 4,205, 76, 63, 0, 0, 0, 0,210,204, 76, 63, 0, 0, 1,128, - 0, 0, 3, 1, 53,205,204, 62, 0, 0,128,180,214,204, 76, 63, 0, 0, 1,128, 0, 0, 3, 1, 0,205, 76, 63, 0, 0, 0, 0, -213,204,204, 62, 0, 0, 1,128, 0, 0, 3, 1, 47,205,204, 62, 0, 0,128,180,221,204,204, 62, 0, 0, 1,128, 0, 0, 3, 1, - 0,205, 76, 63, 0, 0, 0, 0, 0, 0, 96, 52, 0, 0, 1,128, 0, 0, 3, 1, 47,205,204, 62, 0, 0,128,180, 0, 0,240, 52, - 0, 0, 1,128, 0, 0, 3, 1, 0,205, 76, 63, 0, 0, 0, 0,208,204,204,190, 0, 0, 1,128, 0, 0, 3, 1, 47,205,204, 62, - 0, 0,128,180,200,204,204,190, 0, 0, 1,128, 0, 0, 3, 1, 68, 65, 84, 65, 64, 1, 0, 0,224,167,118, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96,169,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,128, 1, 0, 0, 96,169,118, 1, 0, 0, 0, 0, 53, 0, 0, 0, 32, 0, 0, 0, - 2, 0, 0, 0, 22, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0, 18, 0, 0, 0, - 0, 0, 35, 0, 14, 0, 0, 0, 13, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 13, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, - 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 35, 0, 5, 0, 0, 0, 8, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, - 8, 0, 0, 0, 10, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 35, 0, 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0, 16, 0, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0, 18, 0, 0, 0, 0, 0, 35, 0, - 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0, 17, 0, 0, 0, 0, 0, 35, 0, 18, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 35, 0, 19, 0, 0, 0, 20, 0, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0, 22, 0, 0, 0, 0, 0, 35, 0, 21, 0, 0, 0, - 22, 0, 0, 0, 0, 0, 35, 0, 19, 0, 0, 0, 21, 0, 0, 0, 0, 0, 35, 0, 14, 0, 0, 0, 22, 0, 0, 0, 0, 0, 35, 0, - 68, 65, 84, 65, 64, 1, 0, 0, 32,171,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,172,118, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,173,118, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,175,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0, -160,172,118, 1, 0, 0, 0, 0, 52, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 2, 5, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 6, 0, 0, 0, - 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 2, 10, 0, 0, 0, 9, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 2, - 15, 0, 0, 0, 16, 0, 0, 0, 18, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 2, 18, 0, 0, 0, 8, 0, 0, 0, 5, 0, 0, 0, - 20, 0, 0, 0, 0, 0, 0, 2, 22, 0, 0, 0, 21, 0, 0, 0, 19, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 2, 22, 0, 0, 0, - 2, 0, 0, 0, 13, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65,128, 1, 0, 0,128,173,118, 1, 0, 0, 0, 0, - 60, 0, 0, 0, 8, 0, 0, 0, 12,192,137, 62,162,226,125, 63,144,108,246, 61,162,226,125, 63,144,108,246, 61,162,226,125, 63, - 12,192,137, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,252,228,213, 62,162,226,125, 63, - 12,192,137, 62,162,226,125, 63, 12,192,137, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 1, 0, 0, 0, 0, 0, 12,192,137, 62,162,226,125, 63,144,108,246, 61,162,226,125, 63,144,108,246, 61,162,226,125, 63, - 12,192,137, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 0,229,213, 62,162,226,125, 63, - 18,192,137, 62,162,226,125, 63, 12,192,137, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 1, 0, 0, 0, 0, 0,154, 23, 55, 63,162,226,125, 63, 34, 5, 17, 63,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, -152, 23, 55, 63,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 30, 5, 17, 63,162,226,125, 63, -252,228,213, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 1, 0, 0, 0, 0, 0, 30, 5, 17, 63,162,226,125, 63,152, 23, 55, 63,162,226,125, 63,152, 23, 55, 63,162,226,125, 63, - 30, 5, 17, 63,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 30, 5, 17, 63,162,226,125, 63, -252,228,213, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65,128, 0, 0, 0, 64,175,118, 1, 0, 0, 0, 0, 57, 0, 0, 0, 32, 0, 0, 0, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 77, 69, 0, 0,120, 1, 0, 0,144,178,118, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0,144,194,118, 1, 0, 0, 0, 0, -144,162,118, 1, 0, 0, 0, 0, 1, 94, 44, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 46, - 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -192,232,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64,194,118, 1, 0, 0, 0, 0,160,188,118, 1, 0, 0, 0, 0,128,189,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,208,181,118, 1, 0, 0, 0, 0, 96,185,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64,191,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80,180,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,224,183,118, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 32,187,118, 1, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 0, 2,205, 76, 63,172,197, 39, 55,214,204, 76, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 64,194,118, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 80,180,118, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208,181,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,204, 1, 0, 0,208,181,118, 1, 0, 0, 0, 0, 56, 0, 0, 0, 23, 0, 0, 0, - 47,205,204, 62, 0, 0,128,180,200,204,204,190, 0, 0, 1,128, 0, 0, 2, 0, 0,205, 76, 63, 0, 0, 0, 0,208,204,204,190, - 0, 0, 1,128, 0, 0, 2, 0, 47,205,204, 62, 0, 0,128,180, 0, 0,240, 52, 0, 0, 1,128, 0, 0, 2, 0, 0,205, 76, 63, - 0, 0, 0, 0, 0, 0, 96, 52, 0, 0, 1,128, 0, 0, 2, 0, 47,205,204, 62, 0, 0,128,180,221,204,204, 62, 0, 0, 1,128, - 0, 0, 2, 0, 0,205, 76, 63, 0, 0, 0, 0,213,204,204, 62, 0, 0, 1,128, 0, 0, 2, 0, 53,205,204, 62, 0, 0,128,180, -214,204, 76, 63, 0, 0, 1,128, 0, 0, 2, 0, 47,205,204, 62, 0, 0,128,180,206,204, 76,191, 0, 0, 1,128, 0, 0, 2, 0, - 0,205, 76, 63, 0, 0, 0, 0,208,204, 76,191, 0, 0, 1,128, 0, 0, 2, 0, 0, 0, 70,182, 0, 0,128, 52,214,204, 76,191, - 0, 0, 1,128, 0, 0, 2, 0, 55,205,204,190, 0, 0, 0, 0,212,204, 76,191, 0, 0, 1,128, 0, 0, 2, 0, 0, 0, 62,182, - 0, 0,128, 52,206,204, 76, 63, 0, 0, 1,128, 0, 0, 2, 0, 47,205,204,190, 0, 0, 0, 0,206,204, 76, 63, 0, 0, 1,128, - 0, 0, 2, 0, 4,205, 76,191, 0, 0, 0, 0,210,204, 76, 63, 0, 0, 1,128, 0, 0, 2, 0, 0, 0, 70,182, 0, 0,128, 52, -197,204,204, 62, 0, 0, 1,128, 0, 0, 2, 0, 55,205,204,190, 0, 0, 0, 0,205,204,204, 62, 0, 0, 1,128, 0, 0, 2, 0, - 4,205, 76,191, 0, 0, 0, 0,213,204,204, 62, 0, 0, 1,128, 0, 0, 2, 0, 0, 0, 70,182, 0, 0,128, 52, 0, 0,144,180, - 0, 0, 1,128, 0, 0, 2, 0, 55,205,204,190, 0, 0, 0, 0, 0, 0, 0,179, 0, 0, 1,128, 0, 0, 2, 0, 4,205, 76,191, - 0, 0, 0, 0, 0, 0, 96, 52, 0, 0, 1,128, 0, 0, 2, 0, 0, 0, 70,182, 0, 0,128, 52,224,204,204,190, 0, 0, 1,128, - 0, 0, 2, 0, 55,205,204,190, 0, 0, 0, 0,216,204,204,190, 0, 0, 1,128, 0, 0, 2, 0, 4,205, 76,191, 0, 0, 0, 0, -208,204,204,190, 0, 0, 1,128, 0, 0, 2, 0, 68, 65, 84, 65, 64, 1, 0, 0,224,183,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,185,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65,128, 1, 0, 0, 96,185,118, 1, 0, 0, 0, 0, 53, 0, 0, 0, 32, 0, 0, 0, 1, 0, 0, 0, - 8, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 34, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 34, 0, 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 34, 0, 2, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 34, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 34, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 34, 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, 0, 34, 0, - 12, 0, 0, 0, 13, 0, 0, 0, 0, 0, 34, 0, 13, 0, 0, 0, 16, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 34, 0, 12, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 15, 0, 0, 0, 0, 0, 34, 0, 11, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 19, 0, 0, 0, 0, 0, 34, 0, 15, 0, 0, 0, 18, 0, 0, 0, 0, 0, 34, 0, - 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 34, 0, 14, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 19, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 34, 0, 21, 0, 0, 0, 22, 0, 0, 0, 0, 0, 34, 0, 18, 0, 0, 0, 21, 0, 0, 0, 0, 0, 34, 0, 20, 0, 0, 0, - 21, 0, 0, 0, 0, 0, 34, 0, 17, 0, 0, 0, 20, 0, 0, 0, 0, 0, 34, 0, 10, 0, 0, 0, 21, 0, 0, 0, 0, 0, 34, 0, - 9, 0, 0, 0, 20, 0, 0, 0, 0, 0, 34, 0, 6, 0, 0, 0, 11, 0, 0, 0, 0, 0, 34, 0, 4, 0, 0, 0, 14, 0, 0, 0, - 0, 0, 34, 0, 2, 0, 0, 0, 17, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 34, 0, 68, 65, 84, 65, - 64, 1, 0, 0, 32,187,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,160,188,118, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,189,118, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,191,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,160,188,118, 1, - 0, 0, 0, 0, 52, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 11, 0, 0, 0, 14, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, - 13, 0, 0, 0, 16, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 18, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 0, 18, 0, 0, 0, 19, 0, 0, 0, 22, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 21, 0, 0, 0, - 10, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,128, 1, 0, 0,128,189,118, 1, 0, 0, 0, 0, 60, 0, 0, 0, - 8, 0, 0, 0,152, 23, 55, 63,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63,152, 23, 55, 63, -162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,252,228,213, 62,162,226,125, 63, 30, 5, 17, 63, -162,226,125, 63, 30, 5, 17, 63,162,226,125, 63,252,228,213, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, - 0, 0, 0, 0,152, 23, 55, 63,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63,152, 23, 55, 63, -162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0, 34, 5, 17, 63,162,226,125, 63, 0,229,213, 62, -162,226,125, 63,252,228,213, 62,162,226,125, 63, 30, 5, 17, 63,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, - 0, 0, 0, 0, 18,192,137, 62,162,226,125, 63,144,108,246, 61,162,226,125, 63,144,108,246, 61,162,226,125, 63, 12,192,137, 62, -162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,252,228,213, 62,162,226,125, 63, 12,192,137, 62, -162,226,125, 63, 12,192,137, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, - 0, 0, 0, 0, 12,192,137, 62,162,226,125, 63,144,108,246, 61,162,226,125, 63,144,108,246, 61,162,226,125, 63, 12,192,137, 62, -162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, 0, 0, 0, 0,252,228,213, 62,162,226,125, 63, 12,192,137, 62, -162,226,125, 63, 12,192,137, 62,162,226,125, 63,252,228,213, 62,162,226,125, 63, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 1, 0, - 0, 0, 0, 0, 68, 65, 84, 65,128, 0, 0, 0, 64,191,118, 1, 0, 0, 0, 0, 57, 0, 0, 0, 32, 0, 0, 0,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 77, 69, 0, 0, -120, 1, 0, 0,144,194,118, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0,128,202,118, 1, 0, 0, 0, 0,144,178,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69, 80,108, 97,110,101, 46, 48, 48, 52, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,237,196, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 48,202,118, 1, 0, 0, 0, 0,208,201,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,208,197,118, 1, 0, 0, 0, 0,224,199,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80,196,118, 1, - 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 96,198,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, - 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 80,200,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,128,179, - 0, 0, 64, 52, 0, 0, 0, 0, 0, 0,128, 63, 2, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 48,202,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 80,196,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,197,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,208,197,118, 1, 0, 0, 0, 0, 56, 0, 0, 0, 4, 0, 0, 0, 0, 0,128, 63, -255,255,127, 63, 0, 0, 0, 0, 0, 0, 0, 0,255,127, 3,255, 0, 0,128, 63, 0, 0,128,191, 0, 0, 0, 0, 0, 0, 0, 0, -255,127, 3,255, 1, 0,128,191,253,255,127,191, 0, 0, 0, 0, 0, 0, 0, 0,255,127, 3,255,250,255,127,191, 3, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0,255,127, 3,255, 68, 65, 84, 65, 64, 1, 0, 0, 96,198,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,199,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,224,199,118, 1, 0, 0, 0, 0, 53, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, - 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0, 80,200,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,208,201,118, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,208,201,118, 1, 0, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 77, 69, 0, 0,120, 1, 0, 0,128,202,118, 1, 0, 0, 0, 0, - 50, 0, 0, 0, 1, 0, 0, 0,192, 66,122, 1, 0, 0, 0, 0,144,194,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101,119, 0, 0, 0, 0,112,104,101,114,101, 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 66,122, 1, 0, 0, 0, 0, -112, 93,119, 1, 0, 0, 0, 0,176,193,119, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,205,118, 1, 0, 0, 0, 0, -176, 1,119, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,177,120, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,204,118, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, - 20, 0, 0, 0, 0, 0, 0, 0, 48, 0,119, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, -240, 91,119, 1, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0,130, 2, 0, 0,128, 7, 0, 0, - 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,117,224,186, 64, - 91, 13,187, 64,160,240,186, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 8, 0, 0, 0,112, 66,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, - 68, 65, 84, 65, 64, 1, 0, 0, 64,204,118, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,205,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 40, 50, 0, 0, -192,205,118, 1, 0, 0, 0, 0, 56, 0, 0, 0,130, 2, 0, 0, 28,136,141,191, 12,243,244, 62,198, 86,183,192,212,231,117, 10, -191,130, 3,255,240,102,131,192, 30,183,119, 64,109,169,199,191, 58,166,158, 84,230,221, 3,255,119,108,239, 63,213, 85,156, 64, -188, 58, 40,192,228, 40,207,106,137,198, 3,255, 95,135,146, 64, 63, 54, 14,191,241,194,102,192, 27,100,219,243, 45,177, 3,255, -239, 84,141, 62, 16,220,157,192, 14, 2, 73,192, 8, 6, 39,148, 86,187, 3,255,132,239,162,192,206,165, 12,192,150, 45,240,191, -175,144,245,207,251,214, 3,255,239, 84,141,190, 16,220,157, 64, 14, 2, 73, 64,248,249,217,107,170, 68, 3,255,132,239,162, 64, -206,165, 12, 64,150, 45,240, 63, 81,111, 11, 48, 5, 41, 3,255,240,102,131, 64, 30,183,119,192,109,169,199, 63,198, 89, 98,171, - 26, 34, 3,255,119,108,239,191,213, 85,156,192,188, 58, 40, 64, 28,215, 49,149,119, 57, 3,255, 95,135,146,192, 63, 54, 14, 63, -241,194,102, 64,229,155, 37, 12,211, 78, 3,255, 28,136,141, 63, 12,243,244,190,198, 86,183, 64, 44, 24,139,245, 65,125, 3,255, -114, 17, 68,192,226,153, 35, 64,154, 26,137,192, 6,189,226, 55, 85,162, 3,255,155, 40,230, 62,239,199, 73, 64,176, 52,157,192, -211, 9,237, 68,153,148, 3,255,124, 55,168,191,224,177,164, 64, 58,144, 29,192, 69,227,132,112, 46,202, 3,255, 94, 35,105,192, -230, 88,129,191,195, 14,143,192, 93,176,233,233, 68,158, 3,255, 37, 2,173,192,137,187,123, 63, 56, 68, 1,192,206,137,127, 21, -216,211, 3,255,234,168, 2, 64,231,158, 57,189, 65,149,175,192,162, 44, 3,255, 11,136, 3,255, 19,159,114, 64,254,226, 34, 64, -196,133,106,192,225, 82,164, 55,228,175, 3,255,105,176,249,190, 21,148, 39,192,217,214,166,192, 87,245,194,198, 5,142, 3,255, -227,163, 54, 64, 86,121, 78,192, 22,202,125,192, 99, 62,120,185, 79,169, 3,255,241, 40, 53,192,200, 31,134,192,229,188, 60,192, - 30,194, 94,164,136,191, 3,255, 96,230,181,192, 33, 24,119,191,174, 26,130, 63,186,131,231,234, 56, 22, 3,255,103, 93,163,192, -136,128, 38, 64, 83,235,153, 63,100,144,224, 56, 74, 26, 3,255,238,219, 36,192,132,151,165, 64,165,226,109, 63,176,199, 33,113, - 80, 20, 3,255, 24,237,111, 63,118,174,184, 64,212, 34,154, 62,125, 20, 44,126,148, 6, 3,255,163,244,130, 64,157, 58,133, 64, -125, 95,226,190,119, 89, 5, 91, 86,246, 3,255, 96,230,181, 64, 33, 24,119, 63,174, 26,130,191, 70,124, 25, 21,200,233, 3,255, -103, 93,163, 64,136,128, 38,192, 83,235,153,191,156,111, 32,199,182,229, 3,255,238,219, 36, 64,132,151,165,192,165,226,109,191, - 80, 56,223,142,176,235, 3,255, 24,237,111,191,118,174,184,192,212, 34,154,190,131,235,212,129,108,249, 3,255,163,244,130,192, -157, 58,133,192,125, 95,226, 62,137,166,251,164,170, 9, 3,255,227,163, 54,192, 86,121, 78, 64, 22,202,125, 64,157,193,136, 70, -177, 86, 3,255,241, 40, 53, 64,200, 31,134, 64,229,188, 60, 64,226, 61,162, 91,120, 64, 3,255, 37, 2,173, 64,137,187,123,191, - 56, 68, 1, 64, 50,118,129,234, 40, 44, 3,255,124, 55,168, 63,224,177,164,192, 58,144, 29, 64,187, 28,124,143,210, 53, 3,255, - 19,159,114,192,254,226, 34,192,196,133,106, 64, 31,173, 92,200, 28, 80, 3,255,234,168, 2,192,231,158, 57, 61, 65,149,175, 64, - 94,211,253, 0,245,119, 3,255,105,176,249, 62, 21,148, 39, 64,217,214,166, 64,169, 10, 62, 57,251,113, 3,255, 94, 35,105, 64, -230, 88,129, 63,195, 14,143, 64,163, 79, 23, 22,188, 97, 3,255,114, 17, 68, 64,226,153, 35,192,154, 26,137, 64,250, 66, 30,200, -171, 93, 3,255,155, 40,230,190,239,199, 73,192,176, 52,157, 64, 45,246, 19,187,103,107, 3,255, 37,178, 10,192,138,231,201, 63, -149,143,166,192,129,209,140, 33,145,141, 3,255, 3,132,110,192,243,203, 85, 64,151,107, 66,192, 16,174,158, 73,209,190, 3,255, -116,161,174,190, 81,152,241, 63,110, 2,177,192,217,247, 15, 40,182,134, 3,255,138, 91,154, 63,218,179,133, 64,209,222,122,192, - 0, 27, 30, 92, 86,171, 3,255, 7, 82, 52,192, 82,252,149, 64, 64,202, 5,192, 39,193,227,101,181,210, 3,255,179, 12,148, 62, -251,221,166, 64,188, 87, 41,192,192, 7,224,113, 21,198, 3,255,216,246, 29,192, 17,156,141,190,209,167,169,192, 47,203,160,250, -137,139, 3,255, 99, 72,145,192, 79,114,213,191,183, 35, 83,192, 26,156, 3,219, 12,185, 3,255,115, 58,158,192,129,120, 33, 64, -198, 41,238,191,126,148,116, 56,137,215, 3,255,118,158,174,192,103,148, 33,191,140,156, 1,192,218,136,198,240,203,211, 3,255, - 55, 14,249, 62, 95,133,102, 62,210,143,186,192, 56, 9, 40, 5,113,128, 3,255,220, 61, 92, 64, 56,230,159,190, 6, 61,151,192, - 94, 76,242,248,135,153, 3,255, 7, 86, 60, 64, 60, 48,119, 64, 93, 88, 81,192,119, 63,124, 85,246,184, 3,255,252, 55,139, 64, - 62, 95,132, 63,225,216,113,192,118, 95, 54, 21,107,173, 3,255, 18, 6, 84,191,251, 96,142,191, 76, 4,182,192,158,237, 20,233, -109,131, 3,255,109, 74,225,189, 51, 54,123,192, 34,246,138,192,241,253, 39,169, 1,162, 3,255,153, 66,119, 64,127,154,251,191, -161,220,123,192, 59, 85, 59,214, 34,170, 3,255,201, 59,208, 63,241,182,135,192,212,101,108,192,103, 34,133,162,160,175, 3,255, -161,246,169,191,235,196,151,192,170,149, 74,192, 95,228,253,151,184,186, 3,255, 33,198,131,192,218,137, 84,192, 37,134, 32,192, -247,164, 77,184,167,201, 3,255,176, 61,179,192,138,110,210,191, 24,220,228,190,210,133,130,219,238,244, 3,255, 73,182,170,192, -136, 16, 90,190, 90,194, 25, 64,224,139, 8,252,174, 53, 3,255, 75, 55,153,192, 4, 78, 87, 64, 12, 54, 62,190,200,151, 29, 74, -179,250, 3,255,235, 19,161,192,207, 12,210, 63,210,242, 31, 64, 50,146,244, 34,182, 55, 3,255, 60, 75, 94,192,189,115,150, 64, -186,211,167,190, 98,179, 49,102,183,247, 3,255,186,191,189,191, 63, 32,168, 64,213,100, 7, 64,161,224,191,114, 61, 47, 3,255, -242,205,186, 63,141, 65,177, 64,127,219,154,191, 82, 32,177,120, 61,228, 3,255, 99,245,175, 62, 97, 12,178, 64,255,253,228, 63, -247, 6, 65,121, 98, 40, 3,255,226, 92, 70, 64, 8,131,150, 64,182, 77,204,191,193, 66, 37,103, 32,220, 3,255,200,194,152, 64, -180,155, 83, 64,154,217, 62, 63,207,104,101, 71, 87, 17, 3,255, 73,182,170, 64,136, 16, 90, 62, 90,194, 25,192, 32,116,248, 3, - 82,202, 3,255,176, 61,179, 64,138,110,210, 63, 24,220,228, 62, 46,122,126, 36, 18, 11, 3,255,235, 19,161, 64,207, 12,210,191, -210,242, 31,192,206,109, 12,221, 74,200, 3,255, 75, 55,153, 64, 4, 78, 87,192, 12, 54, 62, 62, 56,104,227,181, 77, 5, 3,255, -186,191,189, 63, 63, 32,168,192,213,100, 7,192, 95, 31, 65,141,195,208, 3,255, 60, 75, 94, 64,189,115,150,192,186,211,167, 62, -158, 76,207,153, 73, 8, 3,255, 99,245,175,190, 97, 12,178,192,255,253,228,191, 9,249,191,134,158,215, 3,255,242,205,186,191, -141, 65,177,192,127,219,154, 63,174,223, 79,135,195, 27, 3,255,200,194,152,192,180,155, 83,192,154,217, 62,191, 49,151,155,184, -169,238, 3,255,226, 92, 70,192, 8,131,150,192,182, 77,204, 63, 63,189,219,152,224, 35, 3,255,201, 59,208,191,241,182,135, 64, -212,101,108, 64,153,221,123, 93, 96, 80, 3,255,153, 66,119,192,127,154,251, 63,161,220,123, 64,197,170,197, 41,222, 85, 3,255, -161,246,169, 63,235,196,151, 64,170,149, 74, 64,161, 27, 3,104, 72, 69, 3,255, 33,198,131, 64,218,137, 84, 64, 37,134, 32, 64, - 9, 91,179, 71, 89, 54, 3,255,118,158,174, 64,103,148, 33, 63,140,156, 1, 64, 38,119, 58, 15, 53, 44, 3,255,115, 58,158, 64, -129,120, 33,192,198, 41,238, 63,130,107,140,199,119, 40, 3,255, 7, 82, 52, 64, 82,252,149,192, 64,202, 5, 64,217, 62, 29,154, - 75, 45, 3,255,179, 12,148,190,251,221,166,192,188, 87, 41, 64, 64,248, 32,142,235, 57, 3,255, 7, 86, 60,192, 60, 48,119,192, - 93, 88, 81, 64,137,192,132,170, 10, 71, 3,255,252, 55,139,192, 62, 95,132,191,225,216,113, 64,138,160,202,234,149, 82, 3,255, -220, 61, 92,192, 56,230,159, 62, 6, 61,151, 64,162,179, 14, 7,121,102, 3,255, 55, 14,249,190, 95,133,102,190,210,143,186, 64, -200,246,216,250,143,127, 3,255,109, 74,225, 61, 51, 54,123, 64, 34,246,138, 64, 15, 2,217, 86,255, 93, 3,255, 18, 6, 84, 63, -251, 96,142, 63, 76, 4,182, 64, 98, 18,236, 22,147,124, 3,255, 99, 72,145, 64, 79,114,213, 63,183, 35, 83, 64,230, 99,253, 36, -244, 70, 3,255,216,246, 29, 64, 17,156,141, 62,209,167,169, 64,209, 52, 96, 5,119,116, 3,255, 3,132,110, 64,243,203, 85,192, -151,107, 66, 64,240, 81, 98,182, 47, 65, 3,255, 37,178, 10, 64,138,231,201,191,149,143,166, 64,127, 46,116,222,111,114, 3,255, -138, 91,154,191,218,179,133,192,209,222,122, 64, 0,229,226,163,170, 84, 3,255,116,161,174, 62, 81,152,241,191,110, 2,177, 64, - 39, 8,241,215, 74,121, 3,255, 36, 76, 19,192, 25,151,129, 64,212,254, 98,192,231,206, 97, 88,131,177, 3,255, 93,232,175,191, -177, 23, 64, 64, 69,186,154,192,227,225,235, 66, 34,151, 3,255,208,190,232,190, 93,160,139, 64,191, 33,120,192,183,244,205, 94, -192,170, 3,255,210,126,142,192, 43, 49,238, 63,112, 30, 84,192,187,158, 95, 39,183,182, 3,255,138,165, 97,192, 92, 9, 80, 63, - 20, 74,147,192,183,177,233, 17, 86,156, 3,255, 98, 61,152,192, 87, 63,106,188, 6, 97, 90,192,127,152,251, 0,183,180, 3,255, -200,173, 14, 64,155,183, 63, 64,192, 75,144,192,206, 48, 45, 64,152,156, 3,255, 95,162,167, 63,144, 29,209, 63, 25,245,174,192, -250, 29, 75, 36,250,136, 3,255,211, 62, 68, 64, 51, 56,168, 63, 13,245,153,192,241, 65,192, 29,106,150, 3,255, 33,182, 36, 64, - 34, 38,220,191,150, 5,159,192,233, 54,211,217,223,146, 3,255, 16, 34, 81, 63,129, 64,179,191,162, 5,180,192,242, 18, 93,224, -111,133, 3,255,212, 56,159, 63,172,166, 68,192,212,108,154,192,176, 27, 32,190,208,149, 3,255,204, 76,223,191,170, 32,101,192, - 65, 83,137,192,199,216,195,178,198,161, 3,255,249,249, 10,192, 62, 52,244,191, 25,236,162,192, 9,208, 0,213,102,145, 3,255, - 42,207, 89,192,251, 6, 47,192, 27,165,121,192,209,182, 18,196,198,169, 3,255,137,215,176,192, 25, 62,241, 63,179,254,219,190, -179,134,232, 39, 78,247, 3,255, 28,150,186,192,150, 16, 28, 60,191, 9, 7,191,118,128,131, 1, 77,245, 3,255, 34,132,181,192, - 99, 60, 92, 63,217, 81,149, 63,181,131,238, 18,252, 23, 3,255,175,242, 74,190,164,173,183, 64,227,105,145,191,117,250,160,125, - 31,232, 3,255,219,227, 2,192, 96,164,173, 64,200, 71, 78,191,164,212, 52,119,226,238, 3,255,181,140, 92,191, 75, 38,184, 64, -176,148, 37, 63,224,236,237,125,159, 12, 3,255, 75,104,159, 64,212, 56,236, 63,240,126, 29,192,211,108,166, 41, 9,203, 3,255, -215,159,132, 64, 84,184, 97, 64, 30, 44, 10,192,176, 91, 19, 76, 56,209, 3,255, 95,122,164, 64,199,143, 44, 64, 53, 78, 68,191, - 17,112, 17, 59,185,237, 3,255,255,176, 54, 64,243, 84,141,192,237,176, 36,192,192, 63, 9,160, 63,200, 3,255, 93,229,133, 64, -217, 21, 68,192,157,226, 45,192,249, 90,187,187, 78,197, 3,255,203, 56,129, 64, 21,211,130,192,187,115,143,191,252, 87,194,166, -252,229, 3,255,189,239,104,192, 82,142,140,192,178,178,168,191,134,177,245,158,155,227, 3,255, 50,141,253,191, 52,155,167,192, -170,181,218,191,125,211,166,141,155,219, 3,255,164, 58, 41,192,172, 34,167,192,206,232,151, 61,232,197,243,141, 26, 0, 3,255, - 93,229,133,192,217, 21, 68, 64,157,226, 45, 64, 7,165, 69, 68,178, 58, 3,255,203, 56,129,192, 21,211,130, 64,187,115,143, 63, - 4,168, 62, 89, 4, 26, 3,255,255,176, 54,192,243, 84,141, 64,237,176, 36, 64, 64,192,247, 95,193, 55, 3,255, 50,141,253, 63, - 52,155,167, 64,170,181,218, 63,131, 44, 90,114,101, 36, 3,255,164, 58, 41, 64,172, 34,167, 64,206,232,151,189, 24, 58, 13,114, -230,255, 3,255,189,239,104, 64, 82,142,140, 64,178,178,168, 63,122, 78, 11, 97,101, 28, 3,255, 28,150,186, 64,150, 16, 28,188, -191, 9, 7, 63,138,127,125,254,179, 10, 3,255, 34,132,181, 64, 99, 60, 92,191,217, 81,149,191, 75,124, 18,237, 4,232, 3,255, -137,215,176, 64, 25, 62,241,191,179,254,219, 62, 77,121, 24,216,178, 8, 3,255,219,227, 2, 64, 96,164,173,192,200, 71, 78, 63, - 92, 43,204,136, 30, 17, 3,255,181,140, 92, 63, 75, 38,184,192,176,148, 37,191, 32, 19, 19,130, 97,243, 3,255,175,242, 74, 62, -164,173,183,192,227,105,145, 63,139, 5, 96,130,225, 23, 3,255,215,159,132,192, 84,184, 97,192, 30, 44, 10, 64, 80,164,237,179, -200, 46, 3,255, 95,122,164,192,199,143, 44,192, 53, 78, 68, 63,239,143,239,196, 71, 18, 3,255, 75,104,159,192,212, 56,236,191, -240,126, 29, 64, 45,147, 90,214,247, 52, 3,255,212, 56,159,191,172,166, 68, 64,212,108,154, 64, 80,228,224, 65, 48,106, 3,255, - 33,182, 36,192, 34, 38,220, 63,150, 5,159, 64, 23,201, 45, 38, 33,109, 3,255, 16, 34, 81,191,129, 64,179, 63,162, 5,180, 64, - 14,237,163, 31,145,122, 3,255, 42,207, 89, 64,251, 6, 47, 64, 27,165,121, 64, 47, 73,238, 59, 58, 86, 3,255,208, 76,223, 63, -170, 32,101, 64, 65, 83,137, 64, 57, 39, 61, 77, 58, 94, 3,255,249,249, 10, 64, 62, 52,244, 63, 25,236,162, 64,247, 47, 0, 43, -154,110, 3,255,210,126,142, 64, 43, 49,238,191,112, 30, 84, 64, 69, 97,161,216, 73, 73, 3,255, 98, 61,152, 64, 87, 63,106, 60, - 6, 97, 90, 64,129,103, 5,255, 73, 75, 3,255,138,165, 97, 64, 92, 9, 80,191, 20, 74,147, 64, 73, 78, 23,238,170, 99, 3,255, -208,190,232, 62, 93,160,139,192,191, 33,120, 64, 73, 11, 51,161, 64, 85, 3,255, 36, 76, 19, 64, 25,151,129,192,212,254, 98, 64, - 25, 49,159,167,125, 78, 3,255, 93,232,175, 63,177, 23, 64,192, 69,186,154, 64, 29, 30, 21,189,222,104, 3,255,211, 62, 68,192, - 51, 56,168,191, 13,245,153, 64, 15,190, 64,226,150,105, 3,255,200,173, 14,192,155,183, 63,192,192, 75,144, 64, 50,207,211,191, -104, 99, 3,255, 95,162,167,191,144, 29,209,191, 25,245,174, 64, 6,226,181,219, 6,119, 3,255,158,156,211,191,185,228,132, 63, -190,207,176,192,164,220,231, 21,244,134, 3,255, 0, 76, 41,192,190,199, 5, 64, 83,157,153,192,146,198, 75, 45,246,150, 3,255, -204, 83,125,192,169, 55,105, 64,244,162, 20,192, 72,169,246, 79, 82,206, 3,255,178,215, 91,192,222,235, 62, 64,190,254,108,192, -215,180, 87, 65,155,175, 3,255,242, 63, 59,191,210,237,152, 63,251, 21,182,192,125,239, 26, 25,149,131, 3,255, 86,230, 94, 61, -198, 30, 35, 64,233, 15,169,192,238, 0, 52, 55,135,140, 3,255,220, 4,199, 63, 7,145,146, 64,104,186, 83,192,109, 34,137,100, -168,184, 3,255, 9,120, 86, 63,149, 91,109, 64, 79,242,142,192,133, 18, 64, 81,218,158, 3,255,103,243, 95,192,221, 91,138, 64, -186, 15,236,191,170,178,219, 93, 25,216, 3,255, 46,206, 5,192,121, 41,159, 64,154, 91, 19,192,230,209, 96,108,226,205, 3,255, -169,200,139, 63,198, 78,163, 64,201,146, 42,192,247, 24, 59,111,206,197, 3,255,187,128, 4,191,206,181,167, 64, 74, 92, 37,192, - 57,245, 96,114,145,199, 3,255,151, 16,231,191,160,166,209, 61,167, 95,178,192,136,217,196, 2,245,133, 3,255,163,200, 69,192, -178,143, 38,191,148, 48,158,192,243,188, 11,242,223,147, 3,255, 43,192,155,192,151, 6,250,191,170, 82, 39,192, 79,149,247,212, -231,199, 3,255,233,118,132,192,217,111,173,191, 67,122,123,192,100,165, 58,226,165,170, 3,255,238, 85,146,192,178,205, 78, 64, - 70, 54,221,191,183,156,134, 71,120,218, 3,255, 76,137,167,192,111, 31,227, 63,158, 57,251,191,234,141, 54, 39, 59,213, 3,255, - 39,143,170,192,167, 15,183,191,251, 85,252,191,217,139,169,223, 13,213, 3,255, 8,214,175,192,177,124, 53, 62,206,241, 2,192, - 23,136, 89, 3, 92,211, 3,255, 77,160,160,190, 9, 20,182, 62,108,232,186,192, 8,248,241, 7,128,128, 3,255, 33,144,163, 63, -151,144,186, 61, 50, 47,183,192, 97, 27, 19, 2,252,130, 3,255,222,179,129, 64,234,147,224,190, 38,180,134,192, 83, 89, 64,246, -218,164, 3,255,114,138, 49, 64,246, 97, 57,190, 57, 76,165,192,250, 60,247,251,138,143, 3,255,249,158, 27, 64,197,118,141, 64, - 58,196, 62,192, 90, 52, 70, 97, 90,191, 3,255, 98,244, 89, 64, 8,120, 79, 64, 65,128, 96,192, 8, 74, 39, 71,151,179, 3,255, - 13,100,144, 64,200,214,118, 62, 64,205,110,192,182, 98, 37, 4,161,174, 3,255, 42,202,131, 64, 60,161,231, 63,142,245,112,192, - 10, 90,255, 38,209,173, 3,255,149, 51,122,191, 52,151,163,190, 15,157,184,192,118,234, 36,250,248,129, 3,255, 5,113, 42,191, - 31,112,241,191, 15,119,176,192, 93,241, 84,215,135,135, 3,255, 60, 55,172, 61, 22, 64,143,192,164,246,113,192, 27, 2,132,157, - 71,174, 3,255,167,173,154,190,111,224, 83,192,198,169,154,192,136,249, 89,183,211,150, 3,255,151,133,136, 64, 9,249,162,191, -106,219,115,192,175, 93, 47,229, 3,173, 3,255,110,124, 89, 64,135, 6, 40,192,223,195,127,192,120, 74, 31,199,208,168, 3,255, -244,248,117, 63,109, 90,148,192,123, 0, 93,192, 8, 20, 66,154,249,180, 3,255,162, 0, 17, 64, 63,196,113,192, 52,239,119,192, - 10, 49, 64,173,144,171, 3,255,162,217, 7,191, 21,117,156,192,222,238, 75,192,139,245, 20,149,108,186, 3,255,171,144, 6,192, -112,158,144,192,198,241, 69,192,156,210, 55,157,115,188, 3,255,110,238,148,192,115,109, 50,192,187,197, 13,192,170,153,231,195, - 17,208, 3,255, 79,252, 96,192,140, 40,115,192,116,165, 48,192,226,178, 98,173,236,195, 3,255,100,228,172,192,217,128,248,191, - 8, 93,150,191, 91,138, 53,213, 86,229, 3,255, 82,171,182,192,216,250,168,191, 15, 15,147, 62,122,131,250,226,203, 5, 3,255, -215, 73,160,192,124,165, 49, 62,232, 85, 66, 64, 33,147, 84, 4, 42, 67, 3,255,171, 89,178,192,192,115, 24,191, 78,116,221, 63, -129,134, 64,243, 50, 38, 3,255, 51,206,143,192,133,250,105, 64,119,251, 97,191, 85,158, 53, 80,193,235, 3,255, 62, 32,160,192, -163, 38, 65, 64,164,117, 3, 63,236,146, 24, 66,193, 10, 3,255,216,108,155,192, 59,255,141, 63,189,117, 69, 64, 61,150,119, 23, - 42, 68, 3,255, 85, 27,164,192,244, 78, 9, 64, 87,193,239, 63, 33,144,128, 46, 73, 41, 3,255,134, 35,117,192, 39,152,138, 64, - 73, 86,116,191,230,171, 2, 94, 73,234, 3,255, 35,220, 67,192, 6,218,159, 64,242,103,155, 62,240,188,215,108, 55, 6, 3,255, -130, 79, 99,191,215,182,164, 64, 10, 4, 42, 64,118,237, 50,112,190, 58, 3,255,161, 86, 3,192, 14,205,168, 64, 60, 55,197, 63, -148,211, 31,115,255, 33, 3,255,229,101,215, 63, 84,141,168, 64, 16, 90,248,191, 11, 37,148,114,159,212, 3,255, 99, 52,155, 63, -198, 17,183, 64,232,199,235,190,159, 26,192,124,120,245, 3,255,105,179, 10, 61, 25,185,169, 64,120,119, 31, 64, 77, 0,101,115, - 96, 55, 3,255,143,198, 37, 63,123,120,183, 64,160,108,135, 63,240, 13, 8,125,144, 23, 3,255,180,174, 32, 64, 65, 13,155, 64, -238,167, 8,192,247, 53,245,105,163,208, 3,255, 69,199,104, 64,177,135,143, 64, 41, 12,132,191, 10, 79, 10, 98, 31,233, 3,255, -121,134,159, 64, 49,245, 49, 64,210,166,169, 63, 27,109,242, 59,190, 29, 3,255, 52,133,143, 64,119,200,113, 64,186,206, 29, 62, - 20, 98, 39, 82,190, 3, 3,255,215, 73,160, 64,124,165, 49,190,232, 85, 66,192,223,108,172,251,214,188, 3,255,171, 89,178, 64, -192,115, 24, 63, 78,116,221,191,127,121,192, 12,206,217, 3,255,100,228,172, 64,217,128,248, 63, 8, 93,150, 63,165,117,203, 42, -170, 26, 3,255, 82,171,182, 64,216,250,168, 63, 15, 15,147,190,134,124, 6, 29, 53,250, 3,255,216,108,155, 64, 59,255,141,191, -189,117, 69,192,195,105,137,232,214,187, 3,255, 85, 27,164, 64,244, 78, 9,192, 87,193,239,191,223,111,128,209,183,214, 3,255, - 51,206,143, 64,133,250,105,192,119,251, 97, 63,171, 97,203,175, 63, 20, 3,255, 62, 32,160, 64,163, 38, 65,192,164,117, 3,191, - 20,109,232,189, 63,245, 3,255,130, 79, 99, 63,215,182,164,192, 10, 4, 42,192,138, 18,206,143, 66,197, 3,255,161, 86, 3, 64, - 14,205,168,192, 60, 55,197,191,108, 44,225,140, 1,222, 3,255,134, 35,117, 64, 39,152,138,192, 73, 86,116, 63, 26, 84,254,161, -183, 21, 3,255, 35,220, 67, 64, 6,218,159,192,242,103,155,190, 16, 67, 41,147,201,249, 3,255,105,179, 10,189, 25,185,169,192, -120,119, 31,192,179,255,155,140,160,200, 3,255,143,198, 37,191,123,120,183,192,160,108,135,191, 16,242,248,130,112,232, 3,255, -229,101,215,191, 84,141,168,192, 16, 90,248, 63,245,218,108,141, 97, 43, 3,255, 99, 52,155,191,198, 17,183,192,232,199,235, 62, - 97,229, 64,131,136, 10, 3,255,121,134,159,192, 49,245, 49,192,210,166,169,191,229,146, 14,196, 66,226, 3,255, 52,133,143,192, -119,200,113,192,186,206, 29,190,236,157,217,173, 66,252, 3,255,180,174, 32,192, 65, 13,155,192,238,167, 8, 64, 9,202, 11,150, - 93, 47, 3,255, 69,199,104,192,177,135,143,192, 41, 12,132, 63,246,176,246,157,225, 22, 3,255,244,248,117,191,109, 90,148, 64, -123, 0, 93, 64,248,235,190,101, 7, 75, 3,255,162, 0, 17,192, 63,196,113, 64, 52,239,119, 64,246,206,192, 82,112, 84, 3,255, -151,133,136,192, 9,249,162, 63,106,219,115, 64, 81,162,209, 26,253, 82, 3,255,110,124, 89,192,135, 6, 40, 64,223,195,127, 64, -136,181,225, 56, 48, 87, 3,255,162,217, 7, 63, 21,117,156, 64,222,238, 75, 64,117, 10,236,106,148, 69, 3,255,171,144, 6, 64, -112,158,144, 64,198,241, 69, 64,100, 45,201, 98,141, 67, 3,255,110,238,148, 64,115,109, 50, 64,187,197, 13, 64, 86,102, 25, 60, -239, 47, 3,255, 79,252, 96, 64,140, 40,115, 64,116,165, 48, 64, 30, 77,158, 82, 20, 60, 3,255, 39,143,170, 64,167, 15,183, 63, -251, 85,252, 63, 39,116, 87, 32,243, 42, 3,255, 8,214,175, 64,177,124, 53,190,206,241, 2, 64,233,119,167,252,164, 44, 3,255, -238, 85,146, 64,178,205, 78,192, 70, 54,221, 63, 73, 99,122,184,136, 37, 3,255, 76,137,167, 64,111, 31,227,191,158, 57,251, 63, - 22,114,202,216,197, 42, 3,255,103,243, 95, 64,221, 91,138,192,186, 15,236, 63, 86, 77, 37,162,231, 39, 3,255, 46,206, 5, 64, -121, 41,159,192,154, 91, 19, 64, 26, 46,160,147, 30, 50, 3,255,169,200,139,191,198, 78,163,192,201,146, 42, 64, 9,231,197,144, - 50, 58, 3,255,187,128, 4, 63,206,181,167,192, 74, 92, 37, 64,199, 10,160,141,111, 56, 3,255,249,158, 27,192,197,118,141,192, - 58,196, 62, 64,166,203,186,158,166, 64, 3,255, 98,244, 89,192, 8,120, 79,192, 65,128, 96, 64,248,181,217,184,105, 76, 3,255, - 13,100,144,192,200,214,118,190, 64,205,110, 64, 74,157,219,251, 95, 81, 3,255, 42,202,131,192, 60,161,231,191,142,245,112, 64, -246,165, 1,217, 47, 82, 3,255,222,179,129,192,234,147,224, 62, 38,180,134, 64,173,166,192, 9, 38, 91, 3,255,114,138, 49,192, -246, 97, 57, 62, 57, 76,165, 64, 6,195, 9, 4,118,112, 3,255, 77,160,160, 62, 9, 20,182,190,108,232,186, 64,248, 7, 15,248, -128,127, 3,255, 33,144,163,191,151,144,186,189, 50, 47,183, 64,159,228,237,253, 4,125, 3,255, 60, 55,172,189, 22, 64,143, 64, -164,246,113, 64,229,253,124, 98,185, 81, 3,255,167,173,154, 62,111,224, 83, 64,198,169,154, 64,120, 6,167, 72, 45,105, 3,255, -149, 51,122, 63, 52,151,163, 62, 15,157,184, 64,138, 21,220, 5, 8,126, 3,255, 5,113, 42, 63, 31,112,241, 63, 15,119,176, 64, -163, 14,172, 40,121,120, 3,255, 43,192,155, 64,151, 6,250, 63,170, 82, 39, 64,177,106, 9, 43, 25, 56, 3,255,233,118,132, 64, -217,111,173, 63, 67,122,123, 64,156, 90,198, 29, 91, 85, 3,255,151, 16,231, 63,160,166,209,189,167, 95,178, 64,120, 38, 60,253, - 11,122, 3,255,163,200, 69, 64,178,143, 38, 63,148, 48,158, 64, 13, 67,245, 13, 33,108, 3,255,204, 83,125, 64,169, 55,105,192, -244,162, 20, 64,184, 86, 10,176,174, 49, 3,255,178,215, 91, 64,222,235, 62,192,190,254,108, 64, 41, 75,169,190,101, 80, 3,255, -158,156,211, 63,185,228,132,191,190,207,176, 64, 92, 35, 25,234, 12,121, 3,255, 0, 76, 41, 64,190,199, 5,192, 83,157,153, 64, -110, 57,181,210, 10,105, 3,255,220, 4,199,191, 7,145,146,192,104,186, 83, 64,147,221,119,155, 88, 71, 3,255, 9,120, 86,191, -149, 91,109,192, 79,242,142, 64,123,237,192,174, 38, 97, 3,255,242, 63, 59, 63,210,237,152,191,251, 21,182, 64,131, 16,230,230, -107,124, 3,255, 86,230, 94,189,198, 30, 35,192,233, 15,169, 64, 18,255,204,200,121,115, 3,255,208, 27, 46,192,124,104, 86, 64, - 85, 52,126,192,137,197,226, 72,134,168, 3,255, 82,168,234,191, 87, 62,149, 64,118, 12, 67,192, 5,217,188,101,210,188, 3,255, -186, 10, 16,192,249,106, 52, 64,210,253,147,192,182,206,131, 62,198,155, 3,255, 93, 33,240,190,191,199, 71, 64,142, 47,158,192, -214,245, 40, 69,199,148, 3,255, 19, 46, 71,187,194,240,115, 64,175,166,142,192,240,254,161, 82, 66,158, 3,255,188,194,101,191, - 17, 84,154, 64,240,193, 77,192, 76,235,214,104,142,185, 3,255,246,246,115,192,183, 86, 15, 64, 51,168,118,192,249,172,229, 47, - 45,171, 3,255,101, 1,160,192, 47,146,184, 63,153, 38, 45,192,225,146, 96, 30,102,196, 3,255,215,229, 85,192,166,178,218, 63, -183, 55,144,192, 38,182,133, 37,110,158, 3,255,151,178,104,192,245,107,205,189,175, 60,147,192,178,175,205,253, 91,156, 3,255, -192, 81,136,192, 55,239, 4,191, 24,222,127,192,130,163,158,245, 35,168, 3,255, 70,241,164,192,102,218,251, 62,143, 82, 48,192, -222,143,210, 11,110,195, 3,255,209,230,173, 63,231,135, 71, 64, 27,234,152,192,148, 29, 4, 67, 11,151, 3,255,158,103, 67, 64, - 82,206, 51, 64, 39,168,132,192,203, 66, 63, 60,242,164, 3,255,136,131,100, 63, 16, 95, 27, 64, 4,115,168,192,122, 20,138, 53, -143,141, 3,255, 77,154,217, 63,185, 69, 78, 63,221,196,177,192, 53, 38,236, 17, 42,135, 3,255,107,195, 37, 64, 4,213, 36, 63, - 20, 33,167,192,151, 55,194, 14,168,141, 3,255,103,139, 94, 64,153,146,250, 63, 72,141,137,192, 19, 75,156, 43,245,161, 3,255, -231,195, 21, 64,236, 58,101,191,218,178,169,192,247, 49, 31,236,218,139, 3,255,142, 32, 48, 64,155,140, 32,192,195, 1,145,192, - 3, 59,178,200,204,156, 3,255, 70,155,185, 63, 12,202, 59,191,163, 86,180,192,149, 32, 73,239, 91,133, 3,255, 29, 97, 43, 62, -144,118, 2,192,125,231,175,192,106, 4,160,210,103,136, 3,255, 97,116,196, 62, 10,176, 56,192,120,239,162,192,164, 8, 20,194, - 81,144, 3,255,185, 2, 5, 64,217,105, 76,192,135,173,142,192,218, 45, 79,187, 56,158, 3,255,163,243,144,191,252, 41, 73,192, -148, 66,154,192,134,230, 73,188,107,150, 3,255,147,133, 20,192,234, 55,124,192,176, 3,107,192,110,204,196,170,164,175, 3,255, - 42,186, 60,192,219,128,189,191, 23, 43,155,192, 41,191,189,222,199,150, 3,255, 52,164,172,191,106,240, 18,192,141, 58,167,192, - 76,226,213,204,128,142, 3,255, 12,171,100,192,249, 33,243,191,106,221,135,192,248,178,143,214,143,162, 3,255,195, 78, 74,192, -241,206, 96,192, 98, 88, 94,192, 4,188, 34,179,129,179, 3,255, 41,110,177,192, 81, 30,186, 63,105,249,158,191,160,134,165, 30, - 86,229, 3,255, 45,138,172,192,114,149, 17, 64,127,203,200, 62,251,137,171, 48, 56, 9, 3,255, 10, 94,182,192, 48, 5, 1, 63, - 86, 81,165,191,156,131, 24, 12, 94,228, 3,255,117,224,186,192, 37,234,247,190,147, 56,126, 62,132,128,101,246, 46, 6, 3,255, -204, 78,184,192, 19,193, 89,189,187,163,141, 63, 22,130,208,254,241, 22, 3,255,105,232,174,192,151,187,224, 63,156,183,153, 63, -137,136,137, 38, 3, 25, 3,255, 42,118, 68,191,101,173,176, 64,114,132,233,191, 57,238,142,120,217,216, 3,255, 81,172,191, 62, - 67,208,186, 64,195,163,216,190, 75, 7,131,127,159,247, 3,255,113, 2,218,191,172,151,171, 64,114, 25,212,191,243,219,116,117, - 30,220, 3,255,251,244, 21,192, 28, 12,172, 64, 13,151,128, 61,229,205,196,117,226, 1, 3,255, 51, 39,223,191,248, 94,177, 64, -104,122, 76, 63,155,217, 3,121, 65, 16, 3,255, 72,208, 28, 61, 91, 13,187, 64, 64,215,245, 62,187, 0,168,127, 66, 9, 3,255, - 45, 93,142, 64, 70,137, 14, 64,147,202, 70,192,241, 96,173, 49,202,188, 3,255,106, 23,173, 64,157,131,182, 63,175,176,225,191, - 7,118, 20, 32, 72,218, 3,255, 78,203,128, 64,124, 14, 69, 64, 55, 0, 61,192,168, 88, 80, 66,199,191, 3,255,133,175,133, 64, - 28,149,121, 64, 51,212,168,191, 4, 92, 86, 84,170,227, 3,255, 8,211,149, 64, 84,166, 94, 64, 68, 24, 29,191,221,101, 30, 76, -113,241, 3,255, 31,169,175, 64,138,176,237, 63, 15,168,103,191,152,119,128, 40, 11,235, 3,255,122, 78, 57, 64,224, 12,120,192, - 7, 56, 84,192, 62, 64,247,171,239,183, 3,255, 0, 74, 48, 64,245,165,155,192,208, 87,227,191, 38, 61, 68,150,192,217, 3,255, - 85,108,100, 64,115, 47, 76,192,149,224, 88,192,102, 77, 90,185,131,182, 3,255,173,191,150, 64,227,233, 55,192,198,101,254,191, -121,102, 79,192, 73,213, 3,255,119, 97,148, 64,200, 33, 89,192, 24,225,150,191, 7,101, 44,182, 20,229, 3,255, 75,171, 86, 64, - 36, 83,150,192, 22, 36,133,191,220, 72,131,153, 32,232, 3,255,116,251, 81,192,115, 80,139,192, 57,124, 10,192, 81,185, 53,160, -254,208, 3,255, 70,239,122,192, 53,220,138,192,113, 86,227,190, 68,171,132,160,195,246, 3,255, 14, 50, 28,192,245, 4,153,192, -141, 39, 23,192,187,201,215,151, 33,205, 3,255, 34,123,189,191,203,168,178,192,149,106,130,191,209,222, 63,134,158,234, 3,255, -176,127,232,191,177,107,178,192, 47,189,236,189, 65,216,100,134, 66,252, 3,255, 53,168, 90,192,169, 83,152,192,227,201,133, 62, - 29,181, 77,152,136, 4, 3,255,173,191,150,192,227,233, 55, 64,198,101,254, 63,135,153,177, 63,183, 42, 3,255, 85,108,100,192, -115, 47, 76, 64,149,224, 88, 64,154,178,166, 70,125, 73, 3,255,119, 97,148,192,200, 33, 89, 64, 24,225,150, 63,249,154,212, 73, -236, 26, 3,255, 75,171, 86,192, 36, 83,150, 64, 22, 36,133, 63, 36,183,125,102,224, 23, 3,255, 0, 74, 48,192,245,165,155, 64, -208, 87,227, 63,218,194,188,105, 64, 38, 3,255,122, 78, 57,192,224, 12,120, 64, 7, 56, 84, 64,194,191, 9, 84, 17, 72, 3,255, - 34,123,189, 63,203,168,178, 64,149,106,130, 63, 47, 33,193,121, 98, 21, 3,255, 14, 50, 28, 64,245, 4,153, 64,141, 39, 23, 64, - 69, 54, 41,104,223, 50, 3,255,176,127,232, 63,177,107,178, 64, 47,189,236, 61,191, 39,156,121,190, 3, 3,255, 53,168, 90, 64, -169, 83,152, 64,227,201,133,190,227, 74,179,103,120,251, 3,255, 70,239,122, 64, 53,220,138, 64,113, 86,227, 62,188, 84,124, 95, - 61, 9, 3,255,116,251, 81, 64,115, 80,139, 64, 57,124, 10, 64,175, 70,203, 95, 2, 47, 3,255,117,224,186, 64, 37,234,247, 62, -147, 56,126,190,124,127,155, 9,210,249, 3,255, 10, 94,182, 64, 48, 5, 1,191, 86, 81,165, 63,100,124,232,243,162, 27, 3,255, -204, 78,184, 64, 19,193, 89, 61,187,163,141,191,234,125, 48, 1, 15,233, 3,255,105,232,174, 64,151,187,224,191,156,183,153,191, -119,119,119,217,253,230, 3,255, 45,138,172, 64,114,149, 17,192,127,203,200,190, 5,118, 85,207,200,246, 3,255, 41,110,177, 64, - 81, 30,186,191,105,249,158, 63, 96,121, 91,225,170, 26, 3,255,251,244, 21, 64, 28, 12,172,192, 13,151,128,189, 27, 50, 60,138, - 30,254, 3,255,113, 2,218, 63,172,151,171,192,114, 25,212, 63, 13, 36,140,138,226, 35, 3,255, 51, 39,223, 63,248, 94,177,192, -104,122, 76,191,101, 38,253,134,191,239, 3,255, 72,208, 28,189, 91, 13,187,192, 64,215,245,190, 69,255, 88,128,190,246, 3,255, - 81,172,191,190, 67,208,186,192,195,163,216, 62,181,248,125,128, 97, 8, 3,255, 42,118, 68, 63,101,173,176,192,114,132,233, 63, -199, 17,114,135, 39, 39, 3,255,133,175,133,192, 28,149,121,192, 51,212,168, 63,252,163,170,171, 86, 28, 3,255, 78,203,128,192, -124, 14, 69,192, 55, 0, 61, 64, 88,167,176,189, 57, 64, 3,255, 31,169,175,192,138,176,237,191, 15,168,103, 63,104,136,128,215, -245, 20, 3,255, 8,211,149,192, 84,166, 94,192, 68, 24, 29, 63, 35,154,226,179,143, 14, 3,255,106, 23,173,192,157,131,182,191, -175,176,225, 63,249,137,236,223,184, 37, 3,255, 45, 93,142,192, 70,137, 14,192,147,202, 70, 64, 15,159, 83,206, 54, 67, 3,255, -185, 2, 5,192,217,105, 76, 64,135,173,142, 64, 38,210,177, 68,200, 97, 3,255, 97,116,196,190, 10,176, 56, 64,120,239,162, 64, - 92,247,236, 61,175,111, 3,255,142, 32, 48,192,155,140, 32, 64,195, 1,145, 64,253,196, 78, 55, 52, 99, 3,255,231,195, 21,192, -236, 58,101, 63,218,178,169, 64, 9,206,225, 19, 38,116, 3,255, 70,155,185,191, 12,202, 59, 63,163, 86,180, 64,107,223,183, 16, -165,122, 3,255, 29, 97, 43,190,144,118, 2, 64,125,231,175, 64,150,251, 96, 45,153,119, 3,255,195, 78, 74, 64,241,206, 96, 64, - 98, 88, 94, 64,252, 67,222, 76,127, 76, 3,255, 12,171,100, 64,249, 33,243, 63,106,221,135, 64, 8, 77,113, 41,113, 93, 3,255, -147,133, 20, 64,234, 55,124, 64,176, 3,107, 64,146, 51, 60, 85, 92, 80, 3,255,164,243,144, 63,252, 41, 73, 64,148, 66,154, 64, -122, 25,183, 67,149,105, 3,255, 52,164,172, 63,106,240, 18, 64,141, 58,167, 64,180, 29, 43, 51,128,113, 3,255, 42,186, 60, 64, -219,128,189, 63, 23, 43,155, 64,215, 64, 67, 33, 57,105, 3,255,101, 1,160, 64, 47,146,184,191,153, 38, 45, 64, 31,109,160,225, -154, 59, 3,255,246,246,115, 64,183, 86, 15,192, 51,168,118, 64, 7, 83, 27,208,211, 84, 3,255, 70,241,164, 64,102,218,251,190, -143, 82, 48, 64, 34,112, 46,244,146, 60, 3,255,192, 81,136, 64, 55,239, 4, 63, 24,222,127, 64,126, 92, 98, 10,221, 87, 3,255, -151,178,104, 64,245,107,205, 61,175, 60,147, 64, 78, 80, 51, 2,165, 99, 3,255,215,229, 85, 64,166,178,218,191,183, 55,144, 64, -218, 73,123,218,146, 97, 3,255,188,194,101, 63, 17, 84,154,192,240,193, 77, 64,180, 20, 42,151,114, 70, 3,255, 19, 46, 71, 59, -194,240,115,192,175,166,142, 64, 16, 1, 95,173,190, 97, 3,255, 82,168,234, 63, 87, 62,149,192,118, 12, 67, 64,251, 38, 68,154, - 46, 67, 3,255,208, 27, 46, 64,124,104, 86,192, 85, 52,126, 64,119, 58, 30,183,122, 87, 3,255,186, 10, 16, 64,249,106, 52,192, -210,253,147, 64, 74, 49,125,193, 58,100, 3,255, 93, 33,240, 62,191,199, 71,192,142, 47,158, 64, 42, 10,216,186, 57,107, 3,255, -103,139, 94,192,153,146,250,191, 72,141,137, 64,237,180,100,212, 11, 94, 3,255,107,195, 37,192, 4,213, 36,191, 20, 33,167, 64, -105,200, 62,241, 88,114, 3,255,158,103, 67,192, 82,206, 51,192, 39,168,132, 64, 53,189,193,195, 14, 91, 3,255,209,230,173,191, -231,135, 71,192, 27,234,152, 64,108,226,252,188,245,104, 3,255, 77,154,217,191,185, 69, 78,191,221,196,177, 64,203,217, 20,238, -214,120, 3,255,136,131,100,191, 16, 95, 27,192, 4,115,168, 64,134,235,118,202,113,114, 3,255,139,220, 37,192,245,135,141, 64, -114,173, 54,192, 45,199, 95, 96,211,193, 3,255,204,119, 84,192, 93, 73,130, 64,212,107, 38,192, 58,183,223, 88,137,199, 3,255, -208, 76, 67,192, 62,120,111, 64, 14, 89, 85,192, 80,189,196, 81,140,183, 3,255, 68,147,238,191,166,230,100, 64,234, 9,136,192, -216,215,130, 78, 59,163, 3,255, 30,149,109,191, 40, 18,111, 64,171,100,141,192, 37,235,201, 81,199,159, 3,255,144,237,178,191, - 25,136,136, 64,121, 1,113,192,117,225,189, 92, 62,173, 3,255,214, 82, 66, 63,128,115,152, 64,164, 25, 85,192,241, 16, 27,104, -126,183, 3,255,119,155,171,189,138, 40,155, 64,113, 96, 83,192,128,254,196,105,238,183, 3,255, 67,138,194, 62,177, 97,138, 64, - 75,158,124,192,112, 8,134, 94, 29,170, 3,255,158,106, 94,191,167,106, 30, 64,254,240,167,192,229,236,187, 53,105,141, 3,255, - 22,114,229,191,193, 96, 20, 64,253,167,162,192, 22,217, 93, 50,244,144, 3,255, 45,210,162,191,233,211,224, 63,184, 67,174,192, - 69,228,245, 37,244,136, 3,255, 37, 61,152,192,230, 9, 14, 64,137,179, 39,192, 85,152,183, 48,226,198, 3,255,232,187,140,192, - 6, 96, 62, 64,107,247, 30,192, 7,160, 68, 65, 11,202, 3,255,116,134,132,192, 40,130, 40, 64,237,207, 77,192,139,165,149, 57, - 30,186, 3,255, 12,129,129,192,231,129,173, 63,159,125,128,192, 62,167, 15, 29,123,168, 3,255,254,112,134,192,126,146,207, 62, -159, 19,130,192, 15,164,119, 9,117,167, 3,255,189,121,149,192,142,192,111, 63, 76, 95, 90,192, 95,154,107, 20,236,180, 3,255, - 12, 65,162,192, 11, 84,149,191,172,202, 44,192, 60,145, 47,230, 75,197, 3,255, 74,120,165,192, 95, 78,167,190,139, 51, 48,192, - 54,143,140,248,244,195, 3,255, 61,161,150,192,107,221, 89,191,118,113, 89,192, 40,153, 79,237, 35,182, 3,255, 52, 56, 66,192, -206, 40,139, 62, 21,116,160,192, 13,190, 19, 6,121,146, 3,255,245,120, 56,192,118,213,154, 63, 81,227,158,192, 81,193, 47, 26, -133,147, 3,255,220,104, 22,192,204,221, 40, 63,115,137,170,192, 16,205, 89, 14,117,139, 3,255,145,143, 39, 64,190, 49, 94, 64, -165, 27,124,192,238, 56,252, 75, 43,170, 3,255,130,168, 6, 64,190,132,130, 64, 12, 96,105,192,226, 45, 91, 89,173,176, 3,255, - 76,169,222, 63,205,107,104, 64,150,142,136,192, 23, 38,105, 79, 33,163, 3,255,137,207,229, 63, 30, 63, 22, 64,207,235,161,192, -198, 39,227, 50,127,145, 3,255,239, 11, 14, 64,175,114,191, 63,254,208,166,192,133, 48, 81, 33, 87,142, 3,255,239,222, 43, 64, -212,226, 11, 64,227, 71,151,192, 33, 58,140, 47, 91,152, 3,255, 0,245,124, 64, 27, 32,187, 62, 57, 6,138,192,138, 86,176, 7, - 2,162, 3,255, 42, 75,112, 64,228, 42,152, 63, 25, 44,139,192, 0, 82,159, 25, 31,161, 3,255,178,218, 82, 64,178,247, 1, 63, -211,129,154,192, 35, 72, 4, 11,217,150, 3,255,208,203,104, 63,146, 6,113, 63,108, 5,183,192,132, 19,150, 20, 49,131, 3,255, - 26, 68,251, 62,111, 38,228, 63,114, 48,178,192,139, 10,158, 38,109,134, 3,255,163, 78,149, 61, 65, 25,137, 63,234,102,184,192, - 54, 1, 52, 23, 34,130, 3,255, 98,140, 80, 64,169,205,238,191, 83, 69,144,192, 70, 71,145,215,173,157, 3,255,177, 39,109, 64, -155,213,147,191,238,143,140,192, 57, 81,247,230, 77,160, 3,255,100,225, 66, 64,146,191,131,191,152, 18,157,192,178, 66,128,233, - 25,149, 3,255,190, 24,220, 63,163,163,202,191,160,244,171,192, 99, 37,199,220,196,138, 3,255,227,219,133, 63,172, 47, 17,192, - 93,160,169,192,126, 23,164,206, 68,140, 3,255, 46,202,247, 63, 23,140, 27,192,116,252,158,192,217, 41, 77,203, 32,147, 3,255, - 36,220, 68, 63, 24,143,132,192, 20,105,130,192,163, 16, 66,165, 72,167, 3,255, 60,255,185, 63,215,244,108,192,129, 7,138,192, -113, 31, 11,175,251,161, 3,255,220, 18, 19, 63,168,186, 98,192, 66,136,148,192,155, 12,121,178,241,154, 3,255,131,119,172,187, -182,209,162,191,170, 73,183,192,209,255,144,228,251,130, 3,255,165,230, 40, 63,246,111, 24,191, 50,150,185,192, 19, 14, 18,243, -113,129, 3,255,123, 45, 50,190,213, 16,230,190,160,240,186,192,231,251,124,246,109,128, 3,255,221, 22,199,191, 71,211,134,192, - 37,161,113,192, 98,222,255,163,157,173, 3,255,171,131, 58,191, 57,178,140,192,214,174,115,192,105,240,201,159, 11,173, 3,255, -228,119,112,191, 49, 46,115,192,186,222,139,192,152,235,221,172,217,160, 3,255,122, 75,254,191, 18, 36, 50,192, 84, 70,152,192, -253,211, 46,195, 87,152, 3,255,190,239, 52,192,193,186, 22,192,166,240,145,192,167,194, 3,204,108,156, 3,255, 51, 23, 39,192, - 14,245, 76,192,105,248,132,192, 29,199,137,186,200,164, 3,255,202,137,140,192, 4,234, 33,192,152,117, 60,192,215,159,216,200, - 6,192, 3,255, 68,176,115,192, 85, 49, 68,192, 65,173, 79,192,178,172, 81,189, 81,185, 3,255,131,173,128,192, 50,170, 14,192, -247, 71,105,192, 30,168, 64,207,189,176, 3,255,230, 80, 22,192, 50,155,141,191,108, 95,168,192, 3,205, 6,232, 19,141, 3,255, - 96,113,194,191,166,184,195,191, 31,160,174,192,205,222,245,222,227,136, 3,255,249,244,213,191, 10, 33, 52,191,248, 94,178,192, -172,219, 3,241, 48,134, 3,255, 30, 26,167,192, 62, 11, 42, 64,199,163,159,190, 45,142, 26, 58,236,248, 3,255, 15,242,157,192, -177, 35, 63, 64,242,230,132,191,115,148,134, 65, 39,233, 3,255, 58,163,169,192,184,207, 14, 64, 43, 92,148,191,122,140,250, 48, -193,230, 3,255,241, 83,184,192, 33,241,117, 63,204, 69,248,190, 32,130,245, 20, 22,246, 3,255, 88,178,186,192,180, 33,226, 62, - 69,211,165, 62,153,128, 65, 10,196, 6, 3,255,100,194,181,192,227, 37,178, 63, 65, 51,191, 62,199,131,217, 29,201, 7, 3,255, -140, 68,168,192,162,100, 57, 63, 90, 41, 31, 64, 91,141,195, 15,175, 54, 3,255,185,114,173,192,147, 11,162, 63,136,131,237, 63, -204,137,106, 27,187, 40, 3,255, 90, 82,178,192,181, 0,168, 62,125, 64,231, 63,136,134, 78, 7,175, 39, 3,255,235, 52,185,192, -191,185, 83,191, 39,176,252,190,201,129,211,237,241,244, 3,255, 95,222,182,192,178, 32,161,190, 48, 92,165,191, 90,131,208,248, -211,227, 3,255, 52,119,179,192,223,204,147,191,116,141,160,191,169,133,113,230,103,228, 3,255,109, 88, 35, 63,129,186,182, 64, -207, 8,152,191, 5, 14,127,124,202,229, 3,255,226, 54, 99, 63,172,134,174, 64, 96, 98,250,191,180, 19,244,118, 14,213, 3,255, -150,195, 60, 61, 46,121,177, 64,174, 6,245,191, 84, 1,249,120, 55,214, 3,255,228,160,145,191,121, 59,181, 64,246,252,123,191, - 63,231,214,123, 42,235, 3,255, 29,166,188,191,167,120,181, 64, 4,224,165,189, 81,224,253,123,203,253, 3,255, 26,186, 9,191, -104,142,186, 64,128, 74,126,190,158,243, 69,127, 88,250, 3,255,179,205, 19,191, 33,145,175, 64,102,151,253, 63,125,243,171,119, -167, 43, 3,255,163,114,134,190, 81, 94,183, 64, 73,210,157, 63, 40,250,240,124, 49, 27, 3,255,253,217,151,191, 90, 89,178, 64, -210,246,178, 63, 89,230,146,121,187, 30, 3,255,107,200, 50,192, 4, 21,164, 64,143,252, 18,191,229,194,189,111, 58,243, 3,255, -219,140, 29,192,164,216,163, 64,163,160,187,191, 2,202,148,111, 27,224, 3,255, 8, 63, 76,192,149, 92,152, 64,201, 6,157,191, -254,185,184,103, 25,229, 3,255,102, 31,167, 64, 18,113,133, 63,122,150, 29,192,214,113,149, 22, 5,202, 3,255,115, 48,157, 64, - 74,183, 33, 63, 21,172, 72,192, 50,107,106, 13, 91,187, 3,255,250, 48,151, 64,117,157,186, 63,236, 37, 74,192, 41,103,126, 31, - 23,187, 3,255,118, 31,148, 64,144, 99, 46, 64, 95,237, 21,192,101,101,141, 59,115,205, 3,255, 40,177,150, 64,101,250, 73, 64, -104,252,189,191, 13,103,113, 68, 39,223, 3,255, 59, 67,164, 64,106,116, 19, 64, 96,145,209,191,204,111,223, 50,255,219, 3,255, - 9, 99,168, 64,184,173, 32, 64,129, 16, 27, 63,228,114,189, 54,164, 13, 3,255,225, 1,174, 64, 65,167, 12, 64,199, 1, 38,190, -149,118, 17, 48,195,252, 3,255,172,156,160, 64, 23,121, 66, 64,220,253, 53,188,155,109, 25, 66, 0, 0, 3,255,230,184,106, 64, -117, 83,133, 64, 76, 95,243,191,202, 79,251, 90, 77,214, 3,255,116,166,101, 64, 67,107,111, 64, 69,233, 47,192, 23, 78,219, 81, - 34,196, 3,255,109, 20, 68, 64,202, 9,139, 64,124,255, 29,192,138, 66, 22, 95, 6,202, 3,255, 46,138, 12, 64,195,168,156,192, - 99,240, 23,192,172, 47, 54,149,252,203, 3,255,110,189,201, 63, 48, 28,154,192,180,148, 60,192, 2, 34,195,150,147,191, 3,255, - 21, 55, 17, 64,125, 67,140,192,118, 8, 75,192, 61, 49, 50,160,221,186, 3,255, 85,126,100, 64,103,211,114,192,187,176, 43,192, - 60, 78,241,172, 2,198, 3,255, 29,112,133, 64,168, 45,104,192, 95, 44,249,191,154, 90, 96,176, 48,213, 3,255,192,193, 95, 64, -221, 5,138,192, 42,219,239,191,181, 76, 61,162,177,214, 3,255, 28, 21,134, 64,185,231,130,192,175,210,133, 62,128, 91,182,166, - 33, 6, 3,255,128,101,115, 64,106,100,142,192,214,174,205,190, 32, 83, 12,159,127,247, 3,255,187,250,142, 64,178,123,113,192, - 90,120,242,190, 99, 97,142,173,244,245, 3,255,115, 83,149, 64, 25,118, 24,192, 96, 5, 41,192,195,101, 61,204, 36,198, 3,255, -236, 97,130, 64,181,248, 34,192, 49,132, 87,192, 17, 89,184,200,144,182, 3,255,186,103,144, 64, 91, 9,234,191,150,226, 80,192, -152, 98,121,216,152,184, 3,255,208, 74,136,192,231,117,121,192, 32,193,133,191,248,162, 42,171,249,232, 3,255, 31, 84,144,192, - 24, 19, 87,192, 53, 65,211,191, 74,157,248,182,224,219, 3,255, 7, 90,123,192,107,238,121,192,115,227,247,191, 22,170, 1,171, -218,213, 3,255,161,112, 54,192, 94, 77,156,192,207,107,196,191,198,193, 23,149, 32,223, 3,255, 24, 41, 22,192, 1,197,169,192, -191, 68, 84,191, 45,204,105,140,172,237, 3,255, 73,243, 75,192, 86, 16,156,192,180,150, 33,191,216,186, 63,149,194,241, 3,255, -140,246, 19,192,148, 60,166,192, 11, 70,182, 63,164,205,159,142,127, 31, 3,255, 17, 21, 58,192,224,209,160,192,103,100, 88, 63, -202,192, 72,146,171, 18, 3,255,151,252, 4,192, 71, 89,174,192,215, 93, 38, 63,148,210, 55,137,122, 14, 3,255, 53,176,150,191, -238,252,174,192, 37,172,226,191,114,230,199,136, 20,217, 3,255,225,105,214,191,211,177,161,192,160,229, 29,192,197,219,175,145, - 38,202, 3,255, 62,213, 88,191,193, 70,167,192,212,217, 32,192,221,237,232,141,230,200, 3,255,236, 97,130,192,181,248, 34, 64, - 49,132, 87, 64,239,166, 72, 55,112, 73, 3,255,186,103,144,192, 91, 9,234, 63,150,226, 80, 64,104,157,135, 39,104, 71, 3,255, -115, 83,149,192, 25,118, 24, 64, 96, 5, 41, 64, 61,154,195, 51,220, 57, 3,255, 29,112,133,192,168, 45,104, 64, 95, 44,249, 63, -102,165,160, 79,208, 42, 3,255,192,193, 95,192,221, 5,138, 64, 42,219,239, 63, 75,179,195, 93, 79, 41, 3,255, 85,126,100,192, -103,211,114, 64,187,176, 43, 64,196,177, 15, 83,254, 57, 3,255,110,189,201,191, 48, 28,154, 64,180,148, 60, 64,254,221, 61,105, -109, 64, 3,255, 21, 55, 17,192,125, 67,140, 64,118, 8, 75, 64,195,206,206, 95, 35, 69, 3,255, 46,138, 12,192,195,168,156, 64, - 99,240, 23, 64, 84,208,202,106, 4, 52, 3,255,128,101,115,192,106,100,142, 64,214,174,205, 62,224,172,244, 96,129, 8, 3,255, -187,250,142,192,178,123,113, 64, 90,120,242, 62,157,158,114, 82, 12, 10, 3,255, 28, 21,134,192,185,231,130, 64,175,210,133,190, -128,164, 74, 89,223,249, 3,255,225,105,214, 63,211,177,161, 64,160,229, 29, 64, 59, 36, 81,110,218, 53, 3,255, 62,213, 88, 63, -193, 70,167, 64,212,217, 32, 64, 35, 18, 24,114, 26, 55, 3,255, 53,176,150, 63,238,252,174, 64, 37,172,226, 63,142, 25, 57,119, -236, 38, 3,255, 24, 41, 22, 64, 1,197,169, 64,191, 68, 84, 63,211, 51,151,115, 84, 18, 3,255, 73,243, 75, 64, 86, 16,156, 64, -180,150, 33, 63, 40, 69,193,106, 62, 14, 3,255,161,112, 54, 64, 94, 77,156, 64,208,107,196, 63, 58, 62,233,106,224, 32, 3,255, - 31, 84,144, 64, 24, 19, 87, 64, 53, 65,211, 63,182, 98, 8, 73, 32, 36, 3,255, 7, 90,123, 64,107,238,121, 64,115,227,247, 63, -234, 85,255, 84, 38, 42, 3,255,208, 74,136, 64,231,117,121, 64, 32,193,133, 63, 8, 93,214, 84, 7, 23, 3,255, 17, 21, 58, 64, -224,209,160, 64,103,100, 88,191, 54, 63,184,109, 85,237, 3,255,151,252, 4, 64, 71, 89,174, 64,215, 93, 38,191,108, 45,201,118, -134,241, 3,255,140,246, 19, 64,148, 60,166, 64, 11, 70,182,191, 92, 50, 97,113,129,224, 3,255, 95,222,182, 64,178, 32,161, 62, - 48, 92,165, 63,166,124, 48, 7, 45, 28, 3,255, 52,119,179, 64,223,204,147, 63,116,141,160, 63, 87,122,143, 25,153, 27, 3,255, -235, 52,185, 64,191,185, 83, 63, 39,176,252, 62, 55,126, 45, 18, 15, 11, 3,255, 88,178,186, 64,180, 33,226,190, 69,211,165,190, -103,127,191,245, 60,249, 3,255,100,194,181, 64,227, 37,178,191, 65, 51,191,190, 57,124, 39,226, 55,248, 3,255,241, 83,184, 64, - 33,241,117,191,204, 69,248, 62,224,125, 11,235,234, 9, 3,255, 15,242,157, 64,177, 35, 63,192,242,230,132, 63,141,107,122,190, -217, 22, 3,255, 58,163,169, 64,184,207, 14,192, 43, 92,148, 63,134,115, 6,207, 63, 25, 3,255, 30, 26,167, 64, 62, 11, 42,192, -199,163,159, 62,211,113,230,197, 20, 7, 3,255,185,114,173, 64,147, 11,162,191,136,131,237,191, 52,118,150,228, 69,215, 3,255, - 90, 82,178, 64,181, 0,168,190,125, 64,231,191,120,121,178,248, 81,216, 3,255,140, 68,168, 64,162,100, 57,191, 90, 41, 31,192, -165,114, 61,240, 81,201, 3,255,219,140, 29, 64,164,216,163,192,163,160,187, 63,254, 53,108,144,229, 31, 3,255, 8, 63, 76, 64, -149, 92,152,192,201, 6,157, 63, 2, 70, 72,152,231, 26, 3,255,107,200, 50, 64, 4, 21,164,192,143,252, 18, 63, 27, 61, 67,144, -198, 12, 3,255, 29,166,188, 63,167,120,181,192, 4,224,165, 61,175, 31, 3,132, 53, 2, 3,255, 26,186, 9, 63,104,142,186,192, -128, 74,126, 62, 98, 12,187,128,168, 5, 3,255,228,160,145, 63,121, 59,181,192,246,252,123, 63,193, 24, 42,132,214, 20, 3,255, -226, 54, 99,191,172,134,174,192, 96, 98,250, 63, 76,236, 12,137,242, 42, 3,255,150,195, 60,189, 46,121,177,192,174, 6,245, 63, -172,254, 7,135,201, 41, 3,255,109, 88, 35,191,129,186,182,192,207, 8,152, 63,251,241,129,131, 54, 26, 3,255,163,114,134, 62, - 81, 94,183,192, 73,210,157,191,216, 5, 16,131,207,228, 3,255,253,217,151, 63, 90, 89,178,192,210,246,178,191,167, 25,110,134, - 69,225, 3,255,179,205, 19, 63, 33,145,175,192,102,151,253,191,131, 12, 85,136, 89,212, 3,255,116,166,101,192, 67,107,111,192, - 69,233, 47, 64,233,177, 37,174,222, 59, 3,255,109, 20, 68,192,202, 9,139,192,124,255, 29, 64,118,189,234,160,250, 53, 3,255, -230,184,106,192,117, 83,133,192, 76, 95,243, 63, 54,176, 5,165,179, 41, 3,255, 40,177,150,192,101,250, 73,192,104,252,189, 63, -243,152,143,187,217, 32, 3,255, 59, 67,164,192,106,116, 19,192, 96,145,209, 63, 52,144, 33,205, 1, 36, 3,255,118, 31,148,192, -144, 99, 46,192, 95,237, 21, 64,155,154,115,196,141, 50, 3,255,115, 48,157,192, 74,183, 33,191, 21,172, 72, 64,206,148,150,242, -165, 68, 3,255,250, 48,151,192,117,157,186,191,236, 37, 74, 64,215,152,130,224,233, 68, 3,255,102, 31,167,192, 18,113,133,191, -122,150, 29, 64, 42,142,107,233,251, 53, 3,255,225, 1,174,192, 65,167, 12,192,199, 1, 38, 62,107,137,239,207, 61, 3, 3,255, -172,156,160,192, 23,121, 66,192,220,253, 53, 60,101,146,231,189, 0, 0, 3,255, 9, 99,168,192,184,173, 32,192,129, 16, 27,191, - 28,141, 67,201, 92,242, 3,255,220, 18, 19,191,168,186, 98, 64, 66,136,148, 64,101,243,135, 77, 15,101, 3,255, 36,220, 68,191, - 24,143,132, 64, 20,105,130, 64, 93,239,190, 90,184, 88, 3,255, 60,255,185,191,215,244,108, 64,129, 7,138, 64,143,224,245, 80, - 5, 94, 3,255, 46,202,247,191, 23,140, 27, 64,116,252,158, 64, 39,214,179, 52,224,108, 3,255,190, 24,220,191,163,163,202, 63, -160,244,171, 64,157,218, 57, 35, 60,117, 3,255,227,219,133,191,172, 47, 17, 64, 93,160,169, 64,130,232, 92, 49,188,115, 3,255, -123, 45, 50, 62,213, 16,230, 62,160,240,186, 64, 25, 4,132, 9,147,127, 3,255,131,119,172, 59,182,209,162, 63,170, 73,183, 64, - 47, 0,112, 27, 5,125, 3,255,165,230, 40,191,246,111, 24, 63, 50,150,185, 64,237,241,238, 12,143,126, 3,255,100,225, 66,192, -146,191,131, 63,152, 18,157, 64, 78,189,128, 22,231,106, 3,255, 98,140, 80,192,169,205,238, 63, 83, 69,144, 64,186,184,111, 40, - 83, 98, 3,255,177, 39,109,192,154,213,147, 63,239,143,140, 64,199,174, 9, 25,179, 95, 3,255,131,173,128, 64, 50,170, 14, 64, -247, 71,105, 64,226, 87,192, 48, 67, 79, 3,255,202,137,140, 64, 4,234, 33, 64,152,117, 60, 64, 41, 96, 40, 55,250, 63, 3,255, - 68,176,115, 64, 85, 49, 68, 64, 65,173, 79, 64, 78, 83,175, 66,175, 70, 3,255, 51, 23, 39, 64, 14,245, 76, 64,105,248,132, 64, -227, 56,119, 69, 56, 91, 3,255,122, 75,254, 63, 17, 36, 50, 64, 83, 70,152, 64, 3, 44,210, 60,169,103, 3,255,190,239, 52, 64, -193,186, 22, 64,166,240,145, 64, 89, 61,253, 51,148, 99, 3,255,249,244,213, 63, 10, 33, 52, 63,248, 94,178, 64, 84, 36,253, 14, -208,121, 3,255,230, 80, 22, 64, 50,155,141, 63,108, 95,168, 64,253, 50,250, 23,237,114, 3,255, 96,113,194, 63,166,184,195, 63, - 31,160,174, 64, 51, 33, 11, 33, 29,119, 3,255,228,119,112, 63, 49, 46,115, 64,186,222,139, 64,104, 20, 35, 83, 40, 95, 3,255, -221, 22,199, 63, 71,211,134, 64, 37,161,113, 64,158, 33, 1, 92, 99, 82, 3,255,170,131, 58, 63, 58,178,140, 64,213,174,115, 64, -151, 15, 55, 96,245, 82, 3,255,116,134,132, 64, 40,130, 40,192,237,207, 77, 64,117, 90,107,198,226, 69, 3,255,232,187,140, 64, - 6, 96, 62,192,107,247, 30, 64,249, 95,188,190,245, 53, 3,255, 37, 61,152, 64,230, 9, 14,192,137,179, 39, 64,171,103, 73,207, - 30, 57, 3,255,189,121,149, 64,142,192,111,191, 76, 95, 90, 64,161,101,149,235, 20, 75, 3,255,254,112,134, 64,126,146,207,190, -159, 19,130, 64,241, 91,137,246,139, 88, 3,255, 12,129,129, 64,231,129,173,191,159,125,128, 64,194, 88,241,226,133, 87, 3,255, -220,104, 22, 64,204,221, 40,191,115,137,170, 64,240, 50,167,241,139,116, 3,255,245,120, 56, 64,118,213,154,191, 81,227,158, 64, -175, 62,209,229,123,108, 3,255, 52, 56, 66, 64,206, 40,139,190, 21,116,160, 64,243, 65,237,249,135,109, 3,255, 61,161,150, 64, -107,221, 89, 63,118,113, 89, 64,216,102,177, 18,221, 73, 3,255, 74,120,165, 64, 95, 78,167, 62,139, 51, 48, 64,202,112,116, 7, - 12, 60, 3,255, 12, 65,162, 64, 11, 84,149, 63,172,202, 44, 64,196,110,209, 25,181, 58, 3,255, 67,138,194,190,177, 97,138,192, - 75,158,124, 64,144,247,122,161,227, 85, 3,255,214, 82, 66,191,128,115,152,192,164, 25, 85, 64, 15,239,229,151,130, 72, 3,255, -119,155,171, 61,138, 40,155,192,113, 96, 83, 64,128, 1, 60,150, 18, 72, 3,255,144,237,178, 63, 25,136,136,192,121, 1,113, 64, -139, 30, 67,163,194, 82, 3,255, 68,147,238, 63,166,230,100,192,234, 9,136, 64, 40, 40,126,177,197, 92, 3,255, 30,149,109, 63, - 40, 18,111,192,171,100,141, 64,219, 20, 55,174, 57, 96, 3,255, 45,210,162, 63,233,211,224,191,184, 67,174, 64,187, 27, 11,218, - 12,119, 3,255,158,106, 94, 63,167,106, 30,192,254,240,167, 64, 27, 19, 69,202,151,114, 3,255, 22,114,229, 63,193, 96, 20,192, -253,167,162, 64,234, 38,163,205, 12,111, 3,255,208, 76, 67, 64, 62,120,111,192, 14, 89, 85, 64,176, 66, 60,174,116, 72, 3,255, -139,220, 37, 64,245,135,141,192,114,173, 54, 64,211, 56,161,159, 45, 62, 3,255,204,119, 84, 64, 93, 73,130,192,212,107, 38, 64, -198, 72, 33,167,119, 56, 3,255,178,218, 82,192,178,247, 1,191,211,129,154, 64,221,183,252,244, 39,105, 3,255, 0,245,124,192, - 27, 32,187,190, 57, 6,138, 64,118,169, 80,248,254, 93, 3,255, 42, 75,112,192,228, 42,152,191, 25, 44,139, 64, 0,174, 97,230, -225, 94, 3,255,239,222, 43,192,212,226, 11,192,227, 71,151, 64,223,197,116,208,165,103, 3,255,137,207,229,191, 30, 63, 22,192, -207,235,161, 64, 58,216, 29,205,129,110, 3,255,239, 11, 14,192,175,114,191,191,254,208,166, 64,123,207,175,222,169,113, 3,255, -163, 78,149,189, 65, 25,137,191,234,102,184, 64,202,254,204,232,222,125, 3,255,208,203,104,191,146, 6,113,191,108, 5,183, 64, -124,236,106,235,207,124, 3,255, 26, 68,251,190,111, 38,228,191,114, 48,178, 64,117,245, 98,217,147,121, 3,255, 76,169,222,191, -205,107,104,192,150,142,136, 64,233,217,151,176,223, 92, 3,255,145,143, 39,192,190, 49, 94,192,165, 27,124, 64, 18,199, 4,180, -213, 85, 3,255,130,168, 6,192,190,132,130,192, 12, 96,105, 64, 30,210,165,166, 83, 79, 3,255, 68, 65, 84, 65, 64, 1, 0, 0, - 48, 0,119, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,176, 1,119, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 90, 0, 0,176, 1,119, 1, 0, 0, 0, 0, - 53, 0, 0, 0,128, 7, 0, 0, 0, 0, 0, 0,162, 0, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,162, 0, 0, 0, 0, 0, 35, 0, - 12, 0, 0, 0,163, 0, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,163, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0,164, 0, 0, 0, - 0, 0, 35, 0, 43, 0, 0, 0,164, 0, 0, 0, 0, 0, 35, 0, 12, 0, 0, 0,165, 0, 0, 0, 0, 0, 35, 0, 43, 0, 0, 0, -165, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,166, 0, 0, 0, 0, 0, 35, 0, 44, 0, 0, 0,166, 0, 0, 0, 0, 0, 35, 0, - 13, 0, 0, 0,167, 0, 0, 0, 0, 0, 35, 0, 44, 0, 0, 0,167, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0,168, 0, 0, 0, - 0, 0, 35, 0, 45, 0, 0, 0,168, 0, 0, 0, 0, 0, 35, 0, 13, 0, 0, 0,169, 0, 0, 0, 0, 0, 35, 0, 45, 0, 0, 0, -169, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0, 46, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0, - 14, 0, 0, 0,171, 0, 0, 0, 0, 0, 35, 0, 46, 0, 0, 0,171, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0,172, 0, 0, 0, - 0, 0, 35, 0, 47, 0, 0, 0,172, 0, 0, 0, 0, 0, 35, 0, 14, 0, 0, 0,173, 0, 0, 0, 0, 0, 35, 0, 47, 0, 0, 0, -173, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,174, 0, 0, 0, 0, 0, 35, 0, 48, 0, 0, 0,174, 0, 0, 0, 0, 0, 35, 0, - 15, 0, 0, 0,175, 0, 0, 0, 0, 0, 35, 0, 48, 0, 0, 0,175, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0,176, 0, 0, 0, - 0, 0, 35, 0, 49, 0, 0, 0,176, 0, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0,177, 0, 0, 0, 0, 0, 35, 0, 49, 0, 0, 0, -177, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0, 50, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0, - 16, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0, 50, 0, 0, 0,179, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0,180, 0, 0, 0, - 0, 0, 35, 0, 51, 0, 0, 0,180, 0, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0,181, 0, 0, 0, 0, 0, 35, 0, 51, 0, 0, 0, -181, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,182, 0, 0, 0, 0, 0, 35, 0, 52, 0, 0, 0,182, 0, 0, 0, 0, 0, 35, 0, - 17, 0, 0, 0,183, 0, 0, 0, 0, 0, 35, 0, 52, 0, 0, 0,183, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0,184, 0, 0, 0, - 0, 0, 35, 0, 53, 0, 0, 0,184, 0, 0, 0, 0, 0, 35, 0, 17, 0, 0, 0,185, 0, 0, 0, 0, 0, 35, 0, 53, 0, 0, 0, -185, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0,186, 0, 0, 0, 0, 0, 35, 0, 54, 0, 0, 0,186, 0, 0, 0, 0, 0, 35, 0, - 18, 0, 0, 0,187, 0, 0, 0, 0, 0, 35, 0, 54, 0, 0, 0,187, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0,188, 0, 0, 0, - 0, 0, 35, 0, 55, 0, 0, 0,188, 0, 0, 0, 0, 0, 35, 0, 18, 0, 0, 0,189, 0, 0, 0, 0, 0, 35, 0, 55, 0, 0, 0, -189, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,190, 0, 0, 0, 0, 0, 35, 0, 56, 0, 0, 0,190, 0, 0, 0, 0, 0, 35, 0, - 19, 0, 0, 0,191, 0, 0, 0, 0, 0, 35, 0, 56, 0, 0, 0,191, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,192, 0, 0, 0, - 0, 0, 35, 0, 57, 0, 0, 0,192, 0, 0, 0, 0, 0, 35, 0, 19, 0, 0, 0,193, 0, 0, 0, 0, 0, 35, 0, 57, 0, 0, 0, -193, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0,194, 0, 0, 0, 0, 0, 35, 0, 58, 0, 0, 0,194, 0, 0, 0, 0, 0, 35, 0, - 20, 0, 0, 0,195, 0, 0, 0, 0, 0, 35, 0, 58, 0, 0, 0,195, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,196, 0, 0, 0, - 0, 0, 35, 0, 59, 0, 0, 0,196, 0, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0,197, 0, 0, 0, 0, 0, 35, 0, 59, 0, 0, 0, -197, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,198, 0, 0, 0, 0, 0, 35, 0, 60, 0, 0, 0,198, 0, 0, 0, 0, 0, 35, 0, - 21, 0, 0, 0,199, 0, 0, 0, 0, 0, 35, 0, 60, 0, 0, 0,199, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0,200, 0, 0, 0, - 0, 0, 35, 0, 61, 0, 0, 0,200, 0, 0, 0, 0, 0, 35, 0, 21, 0, 0, 0,201, 0, 0, 0, 0, 0, 35, 0, 61, 0, 0, 0, -201, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0,202, 0, 0, 0, 0, 0, 35, 0, 62, 0, 0, 0,202, 0, 0, 0, 0, 0, 35, 0, - 22, 0, 0, 0,203, 0, 0, 0, 0, 0, 35, 0, 62, 0, 0, 0,203, 0, 0, 0, 0, 0, 35, 0, 10, 0, 0, 0,204, 0, 0, 0, - 0, 0, 35, 0, 63, 0, 0, 0,204, 0, 0, 0, 0, 0, 35, 0, 22, 0, 0, 0,205, 0, 0, 0, 0, 0, 35, 0, 63, 0, 0, 0, -205, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0,206, 0, 0, 0, 0, 0, 35, 0, 64, 0, 0, 0,206, 0, 0, 0, 0, 0, 35, 0, - 23, 0, 0, 0,207, 0, 0, 0, 0, 0, 35, 0, 64, 0, 0, 0,207, 0, 0, 0, 0, 0, 35, 0, 10, 0, 0, 0,208, 0, 0, 0, - 0, 0, 35, 0, 65, 0, 0, 0,208, 0, 0, 0, 0, 0, 35, 0, 23, 0, 0, 0,209, 0, 0, 0, 0, 0, 35, 0, 65, 0, 0, 0, -209, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0,210, 0, 0, 0, 0, 0, 35, 0, 66, 0, 0, 0,210, 0, 0, 0, 0, 0, 35, 0, - 24, 0, 0, 0,211, 0, 0, 0, 0, 0, 35, 0, 66, 0, 0, 0,211, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0,212, 0, 0, 0, - 0, 0, 35, 0, 67, 0, 0, 0,212, 0, 0, 0, 0, 0, 35, 0, 24, 0, 0, 0,213, 0, 0, 0, 0, 0, 35, 0, 67, 0, 0, 0, -213, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0,214, 0, 0, 0, 0, 0, 35, 0, 68, 0, 0, 0,214, 0, 0, 0, 0, 0, 35, 0, - 25, 0, 0, 0,215, 0, 0, 0, 0, 0, 35, 0, 68, 0, 0, 0,215, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0,216, 0, 0, 0, - 0, 0, 35, 0, 69, 0, 0, 0,216, 0, 0, 0, 0, 0, 35, 0, 25, 0, 0, 0,217, 0, 0, 0, 0, 0, 35, 0, 69, 0, 0, 0, -217, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0,218, 0, 0, 0, 0, 0, 35, 0, 70, 0, 0, 0,218, 0, 0, 0, 0, 0, 35, 0, - 26, 0, 0, 0,219, 0, 0, 0, 0, 0, 35, 0, 70, 0, 0, 0,219, 0, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0,220, 0, 0, 0, - 0, 0, 35, 0, 71, 0, 0, 0,220, 0, 0, 0, 0, 0, 35, 0, 26, 0, 0, 0,221, 0, 0, 0, 0, 0, 35, 0, 71, 0, 0, 0, -221, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0,222, 0, 0, 0, 0, 0, 35, 0, 72, 0, 0, 0,222, 0, 0, 0, 0, 0, 35, 0, - 27, 0, 0, 0,223, 0, 0, 0, 0, 0, 35, 0, 72, 0, 0, 0,223, 0, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0,224, 0, 0, 0, - 0, 0, 35, 0, 73, 0, 0, 0,224, 0, 0, 0, 0, 0, 35, 0, 27, 0, 0, 0,225, 0, 0, 0, 0, 0, 35, 0, 73, 0, 0, 0, -225, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0,226, 0, 0, 0, 0, 0, 35, 0, 74, 0, 0, 0,226, 0, 0, 0, 0, 0, 35, 0, - 28, 0, 0, 0,227, 0, 0, 0, 0, 0, 35, 0, 74, 0, 0, 0,227, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0,228, 0, 0, 0, - 0, 0, 35, 0, 75, 0, 0, 0,228, 0, 0, 0, 0, 0, 35, 0, 28, 0, 0, 0,229, 0, 0, 0, 0, 0, 35, 0, 75, 0, 0, 0, -229, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,230, 0, 0, 0, 0, 0, 35, 0, 76, 0, 0, 0,230, 0, 0, 0, 0, 0, 35, 0, - 29, 0, 0, 0,231, 0, 0, 0, 0, 0, 35, 0, 76, 0, 0, 0,231, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0,232, 0, 0, 0, - 0, 0, 35, 0, 77, 0, 0, 0,232, 0, 0, 0, 0, 0, 35, 0, 29, 0, 0, 0,233, 0, 0, 0, 0, 0, 35, 0, 77, 0, 0, 0, -233, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0,234, 0, 0, 0, 0, 0, 35, 0, 78, 0, 0, 0,234, 0, 0, 0, 0, 0, 35, 0, - 30, 0, 0, 0,235, 0, 0, 0, 0, 0, 35, 0, 78, 0, 0, 0,235, 0, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0,236, 0, 0, 0, - 0, 0, 35, 0, 79, 0, 0, 0,236, 0, 0, 0, 0, 0, 35, 0, 30, 0, 0, 0,237, 0, 0, 0, 0, 0, 35, 0, 79, 0, 0, 0, -237, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0,238, 0, 0, 0, 0, 0, 35, 0, 80, 0, 0, 0,238, 0, 0, 0, 0, 0, 35, 0, - 31, 0, 0, 0,239, 0, 0, 0, 0, 0, 35, 0, 80, 0, 0, 0,239, 0, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0,240, 0, 0, 0, - 0, 0, 35, 0, 81, 0, 0, 0,240, 0, 0, 0, 0, 0, 35, 0, 31, 0, 0, 0,241, 0, 0, 0, 0, 0, 35, 0, 81, 0, 0, 0, -241, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0,242, 0, 0, 0, 0, 0, 35, 0, 82, 0, 0, 0,242, 0, 0, 0, 0, 0, 35, 0, - 32, 0, 0, 0,243, 0, 0, 0, 0, 0, 35, 0, 82, 0, 0, 0,243, 0, 0, 0, 0, 0, 35, 0, 10, 0, 0, 0,244, 0, 0, 0, - 0, 0, 35, 0, 83, 0, 0, 0,244, 0, 0, 0, 0, 0, 35, 0, 32, 0, 0, 0,245, 0, 0, 0, 0, 0, 35, 0, 83, 0, 0, 0, -245, 0, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0,246, 0, 0, 0, 0, 0, 35, 0, 84, 0, 0, 0,246, 0, 0, 0, 0, 0, 35, 0, - 33, 0, 0, 0,247, 0, 0, 0, 0, 0, 35, 0, 84, 0, 0, 0,247, 0, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0,248, 0, 0, 0, - 0, 0, 35, 0, 85, 0, 0, 0,248, 0, 0, 0, 0, 0, 35, 0, 33, 0, 0, 0,249, 0, 0, 0, 0, 0, 35, 0, 85, 0, 0, 0, -249, 0, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0,250, 0, 0, 0, 0, 0, 35, 0, 86, 0, 0, 0,250, 0, 0, 0, 0, 0, 35, 0, - 34, 0, 0, 0,251, 0, 0, 0, 0, 0, 35, 0, 86, 0, 0, 0,251, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0,252, 0, 0, 0, - 0, 0, 35, 0, 87, 0, 0, 0,252, 0, 0, 0, 0, 0, 35, 0, 34, 0, 0, 0,253, 0, 0, 0, 0, 0, 35, 0, 87, 0, 0, 0, -253, 0, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0,254, 0, 0, 0, 0, 0, 35, 0, 88, 0, 0, 0,254, 0, 0, 0, 0, 0, 35, 0, - 35, 0, 0, 0,255, 0, 0, 0, 0, 0, 35, 0, 88, 0, 0, 0,255, 0, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 35, 0, 89, 0, 0, 0, 0, 1, 0, 0, 0, 0, 35, 0, 35, 0, 0, 0, 1, 1, 0, 0, 0, 0, 35, 0, 89, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0, 2, 1, 0, 0, 0, 0, 35, 0, 90, 0, 0, 0, 2, 1, 0, 0, 0, 0, 35, 0, - 36, 0, 0, 0, 3, 1, 0, 0, 0, 0, 35, 0, 90, 0, 0, 0, 3, 1, 0, 0, 0, 0, 35, 0, 10, 0, 0, 0, 4, 1, 0, 0, - 0, 0, 35, 0, 91, 0, 0, 0, 4, 1, 0, 0, 0, 0, 35, 0, 36, 0, 0, 0, 5, 1, 0, 0, 0, 0, 35, 0, 91, 0, 0, 0, - 5, 1, 0, 0, 0, 0, 35, 0, 10, 0, 0, 0, 6, 1, 0, 0, 0, 0, 35, 0, 92, 0, 0, 0, 6, 1, 0, 0, 0, 0, 35, 0, - 37, 0, 0, 0, 7, 1, 0, 0, 0, 0, 35, 0, 92, 0, 0, 0, 7, 1, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, 8, 1, 0, 0, - 0, 0, 35, 0, 93, 0, 0, 0, 8, 1, 0, 0, 0, 0, 35, 0, 37, 0, 0, 0, 9, 1, 0, 0, 0, 0, 35, 0, 93, 0, 0, 0, - 9, 1, 0, 0, 0, 0, 35, 0, 6, 0, 0, 0, 10, 1, 0, 0, 0, 0, 35, 0, 94, 0, 0, 0, 10, 1, 0, 0, 0, 0, 35, 0, - 38, 0, 0, 0, 11, 1, 0, 0, 0, 0, 35, 0, 94, 0, 0, 0, 11, 1, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, 12, 1, 0, 0, - 0, 0, 35, 0, 95, 0, 0, 0, 12, 1, 0, 0, 0, 0, 35, 0, 38, 0, 0, 0, 13, 1, 0, 0, 0, 0, 35, 0, 95, 0, 0, 0, - 13, 1, 0, 0, 0, 0, 35, 0, 7, 0, 0, 0, 14, 1, 0, 0, 0, 0, 35, 0, 96, 0, 0, 0, 14, 1, 0, 0, 0, 0, 35, 0, - 39, 0, 0, 0, 15, 1, 0, 0, 0, 0, 35, 0, 96, 0, 0, 0, 15, 1, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, 16, 1, 0, 0, - 0, 0, 35, 0, 97, 0, 0, 0, 16, 1, 0, 0, 0, 0, 35, 0, 39, 0, 0, 0, 17, 1, 0, 0, 0, 0, 35, 0, 97, 0, 0, 0, - 17, 1, 0, 0, 0, 0, 35, 0, 8, 0, 0, 0, 18, 1, 0, 0, 0, 0, 35, 0, 98, 0, 0, 0, 18, 1, 0, 0, 0, 0, 35, 0, - 40, 0, 0, 0, 19, 1, 0, 0, 0, 0, 35, 0, 98, 0, 0, 0, 19, 1, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, 20, 1, 0, 0, - 0, 0, 35, 0, 99, 0, 0, 0, 20, 1, 0, 0, 0, 0, 35, 0, 40, 0, 0, 0, 21, 1, 0, 0, 0, 0, 35, 0, 99, 0, 0, 0, - 21, 1, 0, 0, 0, 0, 35, 0, 9, 0, 0, 0, 22, 1, 0, 0, 0, 0, 35, 0,100, 0, 0, 0, 22, 1, 0, 0, 0, 0, 35, 0, - 41, 0, 0, 0, 23, 1, 0, 0, 0, 0, 35, 0,100, 0, 0, 0, 23, 1, 0, 0, 0, 0, 35, 0, 11, 0, 0, 0, 24, 1, 0, 0, - 0, 0, 35, 0,101, 0, 0, 0, 24, 1, 0, 0, 0, 0, 35, 0, 41, 0, 0, 0, 25, 1, 0, 0, 0, 0, 35, 0,101, 0, 0, 0, - 25, 1, 0, 0, 0, 0, 35, 0, 12, 0, 0, 0, 26, 1, 0, 0, 0, 0, 35, 0,102, 0, 0, 0, 26, 1, 0, 0, 0, 0, 35, 0, - 14, 0, 0, 0, 27, 1, 0, 0, 0, 0, 35, 0,102, 0, 0, 0, 27, 1, 0, 0, 0, 0, 35, 0, 12, 0, 0, 0, 28, 1, 0, 0, - 0, 0, 35, 0,103, 0, 0, 0, 28, 1, 0, 0, 0, 0, 35, 0, 13, 0, 0, 0, 29, 1, 0, 0, 0, 0, 35, 0,103, 0, 0, 0, - 29, 1, 0, 0, 0, 0, 35, 0, 13, 0, 0, 0, 30, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0, 30, 1, 0, 0, 0, 0, 35, 0, - 14, 0, 0, 0, 31, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0, 31, 1, 0, 0, 0, 0, 35, 0, 12, 0, 0, 0, 32, 1, 0, 0, - 0, 0, 35, 0,105, 0, 0, 0, 32, 1, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 0,105, 0, 0, 0, - 33, 1, 0, 0, 0, 0, 35, 0, 12, 0, 0, 0, 34, 1, 0, 0, 0, 0, 35, 0,106, 0, 0, 0, 34, 1, 0, 0, 0, 0, 35, 0, - 15, 0, 0, 0, 35, 1, 0, 0, 0, 0, 35, 0,106, 0, 0, 0, 35, 1, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0, 36, 1, 0, 0, - 0, 0, 35, 0,107, 0, 0, 0, 36, 1, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0, 37, 1, 0, 0, 0, 0, 35, 0,107, 0, 0, 0, - 37, 1, 0, 0, 0, 0, 35, 0, 13, 0, 0, 0, 38, 1, 0, 0, 0, 0, 35, 0,108, 0, 0, 0, 38, 1, 0, 0, 0, 0, 35, 0, - 18, 0, 0, 0, 39, 1, 0, 0, 0, 0, 35, 0,108, 0, 0, 0, 39, 1, 0, 0, 0, 0, 35, 0, 13, 0, 0, 0, 40, 1, 0, 0, - 0, 0, 35, 0,109, 0, 0, 0, 40, 1, 0, 0, 0, 0, 35, 0, 17, 0, 0, 0, 41, 1, 0, 0, 0, 0, 35, 0,109, 0, 0, 0, - 41, 1, 0, 0, 0, 0, 35, 0, 17, 0, 0, 0, 42, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0, 42, 1, 0, 0, 0, 0, 35, 0, - 18, 0, 0, 0, 43, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0, 43, 1, 0, 0, 0, 0, 35, 0, 17, 0, 0, 0, 44, 1, 0, 0, - 0, 0, 35, 0,111, 0, 0, 0, 44, 1, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0, 45, 1, 0, 0, 0, 0, 35, 0,111, 0, 0, 0, - 45, 1, 0, 0, 0, 0, 35, 0, 17, 0, 0, 0, 46, 1, 0, 0, 0, 0, 35, 0,112, 0, 0, 0, 46, 1, 0, 0, 0, 0, 35, 0, - 19, 0, 0, 0, 47, 1, 0, 0, 0, 0, 35, 0,112, 0, 0, 0, 47, 1, 0, 0, 0, 0, 35, 0, 19, 0, 0, 0, 48, 1, 0, 0, - 0, 0, 35, 0,113, 0, 0, 0, 48, 1, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0, 49, 1, 0, 0, 0, 0, 35, 0,113, 0, 0, 0, - 49, 1, 0, 0, 0, 0, 35, 0, 19, 0, 0, 0, 50, 1, 0, 0, 0, 0, 35, 0,114, 0, 0, 0, 50, 1, 0, 0, 0, 0, 35, 0, - 21, 0, 0, 0, 51, 1, 0, 0, 0, 0, 35, 0,114, 0, 0, 0, 51, 1, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0, 52, 1, 0, 0, - 0, 0, 35, 0,115, 0, 0, 0, 52, 1, 0, 0, 0, 0, 35, 0, 19, 0, 0, 0, 53, 1, 0, 0, 0, 0, 35, 0,115, 0, 0, 0, - 53, 1, 0, 0, 0, 0, 35, 0, 15, 0, 0, 0, 54, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0, 54, 1, 0, 0, 0, 0, 35, 0, - 21, 0, 0, 0, 55, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0, 55, 1, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0, 56, 1, 0, 0, - 0, 0, 35, 0,117, 0, 0, 0, 56, 1, 0, 0, 0, 0, 35, 0, 23, 0, 0, 0, 57, 1, 0, 0, 0, 0, 35, 0,117, 0, 0, 0, - 57, 1, 0, 0, 0, 0, 35, 0, 16, 0, 0, 0, 58, 1, 0, 0, 0, 0, 35, 0,118, 0, 0, 0, 58, 1, 0, 0, 0, 0, 35, 0, - 22, 0, 0, 0, 59, 1, 0, 0, 0, 0, 35, 0,118, 0, 0, 0, 59, 1, 0, 0, 0, 0, 35, 0, 22, 0, 0, 0, 60, 1, 0, 0, - 0, 0, 35, 0,119, 0, 0, 0, 60, 1, 0, 0, 0, 0, 35, 0, 23, 0, 0, 0, 61, 1, 0, 0, 0, 0, 35, 0,119, 0, 0, 0, - 61, 1, 0, 0, 0, 0, 35, 0, 14, 0, 0, 0, 62, 1, 0, 0, 0, 0, 35, 0,120, 0, 0, 0, 62, 1, 0, 0, 0, 0, 35, 0, - 25, 0, 0, 0, 63, 1, 0, 0, 0, 0, 35, 0,120, 0, 0, 0, 63, 1, 0, 0, 0, 0, 35, 0, 14, 0, 0, 0, 64, 1, 0, 0, - 0, 0, 35, 0,121, 0, 0, 0, 64, 1, 0, 0, 0, 0, 35, 0, 24, 0, 0, 0, 65, 1, 0, 0, 0, 0, 35, 0,121, 0, 0, 0, - 65, 1, 0, 0, 0, 0, 35, 0, 24, 0, 0, 0, 66, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0, 66, 1, 0, 0, 0, 0, 35, 0, - 25, 0, 0, 0, 67, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0, 67, 1, 0, 0, 0, 0, 35, 0, 18, 0, 0, 0, 68, 1, 0, 0, - 0, 0, 35, 0,123, 0, 0, 0, 68, 1, 0, 0, 0, 0, 35, 0, 27, 0, 0, 0, 69, 1, 0, 0, 0, 0, 35, 0,123, 0, 0, 0, - 69, 1, 0, 0, 0, 0, 35, 0, 18, 0, 0, 0, 70, 1, 0, 0, 0, 0, 35, 0,124, 0, 0, 0, 70, 1, 0, 0, 0, 0, 35, 0, - 26, 0, 0, 0, 71, 1, 0, 0, 0, 0, 35, 0,124, 0, 0, 0, 71, 1, 0, 0, 0, 0, 35, 0, 26, 0, 0, 0, 72, 1, 0, 0, - 0, 0, 35, 0,125, 0, 0, 0, 72, 1, 0, 0, 0, 0, 35, 0, 27, 0, 0, 0, 73, 1, 0, 0, 0, 0, 35, 0,125, 0, 0, 0, - 73, 1, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0, 74, 1, 0, 0, 0, 0, 35, 0,126, 0, 0, 0, 74, 1, 0, 0, 0, 0, 35, 0, - 29, 0, 0, 0, 75, 1, 0, 0, 0, 0, 35, 0,126, 0, 0, 0, 75, 1, 0, 0, 0, 0, 35, 0, 20, 0, 0, 0, 76, 1, 0, 0, - 0, 0, 35, 0,127, 0, 0, 0, 76, 1, 0, 0, 0, 0, 35, 0, 28, 0, 0, 0, 77, 1, 0, 0, 0, 0, 35, 0,127, 0, 0, 0, - 77, 1, 0, 0, 0, 0, 35, 0, 28, 0, 0, 0, 78, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0, 78, 1, 0, 0, 0, 0, 35, 0, - 29, 0, 0, 0, 79, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0, 79, 1, 0, 0, 0, 0, 35, 0, 21, 0, 0, 0, 80, 1, 0, 0, - 0, 0, 35, 0,129, 0, 0, 0, 80, 1, 0, 0, 0, 0, 35, 0, 31, 0, 0, 0, 81, 1, 0, 0, 0, 0, 35, 0,129, 0, 0, 0, - 81, 1, 0, 0, 0, 0, 35, 0, 21, 0, 0, 0, 82, 1, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, 82, 1, 0, 0, 0, 0, 35, 0, - 30, 0, 0, 0, 83, 1, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, 83, 1, 0, 0, 0, 0, 35, 0, 30, 0, 0, 0, 84, 1, 0, 0, - 0, 0, 35, 0,131, 0, 0, 0, 84, 1, 0, 0, 0, 0, 35, 0, 31, 0, 0, 0, 85, 1, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, - 85, 1, 0, 0, 0, 0, 35, 0, 23, 0, 0, 0, 86, 1, 0, 0, 0, 0, 35, 0,132, 0, 0, 0, 86, 1, 0, 0, 0, 0, 35, 0, - 32, 0, 0, 0, 87, 1, 0, 0, 0, 0, 35, 0,132, 0, 0, 0, 87, 1, 0, 0, 0, 0, 35, 0, 23, 0, 0, 0, 88, 1, 0, 0, - 0, 0, 35, 0,133, 0, 0, 0, 88, 1, 0, 0, 0, 0, 35, 0, 24, 0, 0, 0, 89, 1, 0, 0, 0, 0, 35, 0,133, 0, 0, 0, - 89, 1, 0, 0, 0, 0, 35, 0, 24, 0, 0, 0, 90, 1, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, 90, 1, 0, 0, 0, 0, 35, 0, - 32, 0, 0, 0, 91, 1, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, 91, 1, 0, 0, 0, 0, 35, 0, 25, 0, 0, 0, 92, 1, 0, 0, - 0, 0, 35, 0,135, 0, 0, 0, 92, 1, 0, 0, 0, 0, 35, 0, 33, 0, 0, 0, 93, 1, 0, 0, 0, 0, 35, 0,135, 0, 0, 0, - 93, 1, 0, 0, 0, 0, 35, 0, 25, 0, 0, 0, 94, 1, 0, 0, 0, 0, 35, 0,136, 0, 0, 0, 94, 1, 0, 0, 0, 0, 35, 0, - 26, 0, 0, 0, 95, 1, 0, 0, 0, 0, 35, 0,136, 0, 0, 0, 95, 1, 0, 0, 0, 0, 35, 0, 26, 0, 0, 0, 96, 1, 0, 0, - 0, 0, 35, 0,137, 0, 0, 0, 96, 1, 0, 0, 0, 0, 35, 0, 33, 0, 0, 0, 97, 1, 0, 0, 0, 0, 35, 0,137, 0, 0, 0, - 97, 1, 0, 0, 0, 0, 35, 0, 27, 0, 0, 0, 98, 1, 0, 0, 0, 0, 35, 0,138, 0, 0, 0, 98, 1, 0, 0, 0, 0, 35, 0, - 34, 0, 0, 0, 99, 1, 0, 0, 0, 0, 35, 0,138, 0, 0, 0, 99, 1, 0, 0, 0, 0, 35, 0, 27, 0, 0, 0,100, 1, 0, 0, - 0, 0, 35, 0,139, 0, 0, 0,100, 1, 0, 0, 0, 0, 35, 0, 28, 0, 0, 0,101, 1, 0, 0, 0, 0, 35, 0,139, 0, 0, 0, -101, 1, 0, 0, 0, 0, 35, 0, 28, 0, 0, 0,102, 1, 0, 0, 0, 0, 35, 0,140, 0, 0, 0,102, 1, 0, 0, 0, 0, 35, 0, - 34, 0, 0, 0,103, 1, 0, 0, 0, 0, 35, 0,140, 0, 0, 0,103, 1, 0, 0, 0, 0, 35, 0, 29, 0, 0, 0,104, 1, 0, 0, - 0, 0, 35, 0,141, 0, 0, 0,104, 1, 0, 0, 0, 0, 35, 0, 35, 0, 0, 0,105, 1, 0, 0, 0, 0, 35, 0,141, 0, 0, 0, -105, 1, 0, 0, 0, 0, 35, 0, 29, 0, 0, 0,106, 1, 0, 0, 0, 0, 35, 0,142, 0, 0, 0,106, 1, 0, 0, 0, 0, 35, 0, - 30, 0, 0, 0,107, 1, 0, 0, 0, 0, 35, 0,142, 0, 0, 0,107, 1, 0, 0, 0, 0, 35, 0, 30, 0, 0, 0,108, 1, 0, 0, - 0, 0, 35, 0,143, 0, 0, 0,108, 1, 0, 0, 0, 0, 35, 0, 35, 0, 0, 0,109, 1, 0, 0, 0, 0, 35, 0,143, 0, 0, 0, -109, 1, 0, 0, 0, 0, 35, 0, 31, 0, 0, 0,110, 1, 0, 0, 0, 0, 35, 0,144, 0, 0, 0,110, 1, 0, 0, 0, 0, 35, 0, - 36, 0, 0, 0,111, 1, 0, 0, 0, 0, 35, 0,144, 0, 0, 0,111, 1, 0, 0, 0, 0, 35, 0, 22, 0, 0, 0,112, 1, 0, 0, - 0, 0, 35, 0,145, 0, 0, 0,112, 1, 0, 0, 0, 0, 35, 0, 31, 0, 0, 0,113, 1, 0, 0, 0, 0, 35, 0,145, 0, 0, 0, -113, 1, 0, 0, 0, 0, 35, 0, 22, 0, 0, 0,114, 1, 0, 0, 0, 0, 35, 0,146, 0, 0, 0,114, 1, 0, 0, 0, 0, 35, 0, - 36, 0, 0, 0,115, 1, 0, 0, 0, 0, 35, 0,146, 0, 0, 0,115, 1, 0, 0, 0, 0, 35, 0, 32, 0, 0, 0,116, 1, 0, 0, - 0, 0, 35, 0,147, 0, 0, 0,116, 1, 0, 0, 0, 0, 35, 0, 38, 0, 0, 0,117, 1, 0, 0, 0, 0, 35, 0,147, 0, 0, 0, -117, 1, 0, 0, 0, 0, 35, 0, 32, 0, 0, 0,118, 1, 0, 0, 0, 0, 35, 0,148, 0, 0, 0,118, 1, 0, 0, 0, 0, 35, 0, - 37, 0, 0, 0,119, 1, 0, 0, 0, 0, 35, 0,148, 0, 0, 0,119, 1, 0, 0, 0, 0, 35, 0, 37, 0, 0, 0,120, 1, 0, 0, - 0, 0, 35, 0,149, 0, 0, 0,120, 1, 0, 0, 0, 0, 35, 0, 38, 0, 0, 0,121, 1, 0, 0, 0, 0, 35, 0,149, 0, 0, 0, -121, 1, 0, 0, 0, 0, 35, 0, 33, 0, 0, 0,122, 1, 0, 0, 0, 0, 35, 0,150, 0, 0, 0,122, 1, 0, 0, 0, 0, 35, 0, - 39, 0, 0, 0,123, 1, 0, 0, 0, 0, 35, 0,150, 0, 0, 0,123, 1, 0, 0, 0, 0, 35, 0, 33, 0, 0, 0,124, 1, 0, 0, - 0, 0, 35, 0,151, 0, 0, 0,124, 1, 0, 0, 0, 0, 35, 0, 38, 0, 0, 0,125, 1, 0, 0, 0, 0, 35, 0,151, 0, 0, 0, -125, 1, 0, 0, 0, 0, 35, 0, 38, 0, 0, 0,126, 1, 0, 0, 0, 0, 35, 0,152, 0, 0, 0,126, 1, 0, 0, 0, 0, 35, 0, - 39, 0, 0, 0,127, 1, 0, 0, 0, 0, 35, 0,152, 0, 0, 0,127, 1, 0, 0, 0, 0, 35, 0, 34, 0, 0, 0,128, 1, 0, 0, - 0, 0, 35, 0,153, 0, 0, 0,128, 1, 0, 0, 0, 0, 35, 0, 40, 0, 0, 0,129, 1, 0, 0, 0, 0, 35, 0,153, 0, 0, 0, -129, 1, 0, 0, 0, 0, 35, 0, 34, 0, 0, 0,130, 1, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,130, 1, 0, 0, 0, 0, 35, 0, - 39, 0, 0, 0,131, 1, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,131, 1, 0, 0, 0, 0, 35, 0, 39, 0, 0, 0,132, 1, 0, 0, - 0, 0, 35, 0,155, 0, 0, 0,132, 1, 0, 0, 0, 0, 35, 0, 40, 0, 0, 0,133, 1, 0, 0, 0, 0, 35, 0,155, 0, 0, 0, -133, 1, 0, 0, 0, 0, 35, 0, 35, 0, 0, 0,134, 1, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,134, 1, 0, 0, 0, 0, 35, 0, - 41, 0, 0, 0,135, 1, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,135, 1, 0, 0, 0, 0, 35, 0, 35, 0, 0, 0,136, 1, 0, 0, - 0, 0, 35, 0,157, 0, 0, 0,136, 1, 0, 0, 0, 0, 35, 0, 40, 0, 0, 0,137, 1, 0, 0, 0, 0, 35, 0,157, 0, 0, 0, -137, 1, 0, 0, 0, 0, 35, 0, 40, 0, 0, 0,138, 1, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,138, 1, 0, 0, 0, 0, 35, 0, - 41, 0, 0, 0,139, 1, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,139, 1, 0, 0, 0, 0, 35, 0, 36, 0, 0, 0,140, 1, 0, 0, - 0, 0, 35, 0,159, 0, 0, 0,140, 1, 0, 0, 0, 0, 35, 0, 37, 0, 0, 0,141, 1, 0, 0, 0, 0, 35, 0,159, 0, 0, 0, -141, 1, 0, 0, 0, 0, 35, 0, 36, 0, 0, 0,142, 1, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,142, 1, 0, 0, 0, 0, 35, 0, - 41, 0, 0, 0,143, 1, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,143, 1, 0, 0, 0, 0, 35, 0, 37, 0, 0, 0,144, 1, 0, 0, - 0, 0, 35, 0,161, 0, 0, 0,144, 1, 0, 0, 0, 0, 35, 0, 41, 0, 0, 0,145, 1, 0, 0, 0, 0, 35, 0,161, 0, 0, 0, -145, 1, 0, 0, 0, 0, 35, 0, 46, 0, 0, 0,146, 1, 0, 0, 0, 0, 35, 0,102, 0, 0, 0,146, 1, 0, 0, 0, 0, 35, 0, - 43, 0, 0, 0,147, 1, 0, 0, 0, 0, 33, 0, 46, 0, 0, 0,147, 1, 0, 0, 0, 0, 33, 0, 43, 0, 0, 0,148, 1, 0, 0, - 0, 0, 35, 0,102, 0, 0, 0,148, 1, 0, 0, 0, 0, 35, 0,102, 0, 0, 0,149, 1, 0, 0, 0, 0, 35, 0,103, 0, 0, 0, -149, 1, 0, 0, 0, 0, 35, 0,103, 0, 0, 0,150, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0,150, 1, 0, 0, 0, 0, 35, 0, -102, 0, 0, 0,151, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0,151, 1, 0, 0, 0, 0, 35, 0, 45, 0, 0, 0,152, 1, 0, 0, - 0, 0, 33, 0, 47, 0, 0, 0,152, 1, 0, 0, 0, 0, 33, 0, 47, 0, 0, 0,153, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0, -153, 1, 0, 0, 0, 0, 35, 0, 45, 0, 0, 0,154, 1, 0, 0, 0, 0, 35, 0,104, 0, 0, 0,154, 1, 0, 0, 0, 0, 35, 0, - 44, 0, 0, 0,155, 1, 0, 0, 0, 0, 35, 0,103, 0, 0, 0,155, 1, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,156, 1, 0, 0, - 0, 0, 35, 0,103, 0, 0, 0,156, 1, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,157, 1, 0, 0, 0, 0, 33, 0, 44, 0, 0, 0, -157, 1, 0, 0, 0, 0, 33, 0, 50, 0, 0, 0,158, 1, 0, 0, 0, 0, 35, 0,105, 0, 0, 0,158, 1, 0, 0, 0, 0, 35, 0, - 43, 0, 0, 0,159, 1, 0, 0, 0, 0, 33, 0, 50, 0, 0, 0,159, 1, 0, 0, 0, 0, 33, 0, 43, 0, 0, 0,160, 1, 0, 0, - 0, 0, 35, 0,105, 0, 0, 0,160, 1, 0, 0, 0, 0, 35, 0,105, 0, 0, 0,161, 1, 0, 0, 0, 0, 35, 0,106, 0, 0, 0, -161, 1, 0, 0, 0, 0, 35, 0,106, 0, 0, 0,162, 1, 0, 0, 0, 0, 35, 0,107, 0, 0, 0,162, 1, 0, 0, 0, 0, 35, 0, -105, 0, 0, 0,163, 1, 0, 0, 0, 0, 35, 0,107, 0, 0, 0,163, 1, 0, 0, 0, 0, 35, 0, 49, 0, 0, 0,164, 1, 0, 0, - 0, 0, 33, 0, 51, 0, 0, 0,164, 1, 0, 0, 0, 0, 33, 0, 51, 0, 0, 0,165, 1, 0, 0, 0, 0, 35, 0,107, 0, 0, 0, -165, 1, 0, 0, 0, 0, 35, 0, 49, 0, 0, 0,166, 1, 0, 0, 0, 0, 35, 0,107, 0, 0, 0,166, 1, 0, 0, 0, 0, 35, 0, - 48, 0, 0, 0,167, 1, 0, 0, 0, 0, 35, 0,106, 0, 0, 0,167, 1, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,168, 1, 0, 0, - 0, 0, 35, 0,106, 0, 0, 0,168, 1, 0, 0, 0, 0, 35, 0, 42, 0, 0, 0,169, 1, 0, 0, 0, 0, 33, 0, 48, 0, 0, 0, -169, 1, 0, 0, 0, 0, 33, 0, 54, 0, 0, 0,170, 1, 0, 0, 0, 0, 35, 0,108, 0, 0, 0,170, 1, 0, 0, 0, 0, 35, 0, - 45, 0, 0, 0,171, 1, 0, 0, 0, 0, 33, 0, 54, 0, 0, 0,171, 1, 0, 0, 0, 0, 33, 0, 45, 0, 0, 0,172, 1, 0, 0, - 0, 0, 35, 0,108, 0, 0, 0,172, 1, 0, 0, 0, 0, 35, 0,108, 0, 0, 0,173, 1, 0, 0, 0, 0, 35, 0,109, 0, 0, 0, -173, 1, 0, 0, 0, 0, 35, 0,109, 0, 0, 0,174, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0,174, 1, 0, 0, 0, 0, 35, 0, -108, 0, 0, 0,175, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0,175, 1, 0, 0, 0, 0, 35, 0, 53, 0, 0, 0,176, 1, 0, 0, - 0, 0, 33, 0, 55, 0, 0, 0,176, 1, 0, 0, 0, 0, 33, 0, 55, 0, 0, 0,177, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0, -177, 1, 0, 0, 0, 0, 35, 0, 53, 0, 0, 0,178, 1, 0, 0, 0, 0, 35, 0,110, 0, 0, 0,178, 1, 0, 0, 0, 0, 35, 0, - 52, 0, 0, 0,179, 1, 0, 0, 0, 0, 35, 0,109, 0, 0, 0,179, 1, 0, 0, 0, 0, 35, 0, 44, 0, 0, 0,180, 1, 0, 0, - 0, 0, 35, 0,109, 0, 0, 0,180, 1, 0, 0, 0, 0, 35, 0, 44, 0, 0, 0,181, 1, 0, 0, 0, 0, 33, 0, 52, 0, 0, 0, -181, 1, 0, 0, 0, 0, 33, 0, 58, 0, 0, 0,182, 1, 0, 0, 0, 0, 35, 0,111, 0, 0, 0,182, 1, 0, 0, 0, 0, 35, 0, - 53, 0, 0, 0,183, 1, 0, 0, 0, 0, 33, 0, 58, 0, 0, 0,183, 1, 0, 0, 0, 0, 33, 0, 53, 0, 0, 0,184, 1, 0, 0, - 0, 0, 35, 0,111, 0, 0, 0,184, 1, 0, 0, 0, 0, 35, 0,111, 0, 0, 0,185, 1, 0, 0, 0, 0, 35, 0,112, 0, 0, 0, -185, 1, 0, 0, 0, 0, 35, 0,112, 0, 0, 0,186, 1, 0, 0, 0, 0, 35, 0,113, 0, 0, 0,186, 1, 0, 0, 0, 0, 35, 0, -111, 0, 0, 0,187, 1, 0, 0, 0, 0, 35, 0,113, 0, 0, 0,187, 1, 0, 0, 0, 0, 35, 0, 57, 0, 0, 0,188, 1, 0, 0, - 0, 0, 33, 0, 59, 0, 0, 0,188, 1, 0, 0, 0, 0, 33, 0, 59, 0, 0, 0,189, 1, 0, 0, 0, 0, 35, 0,113, 0, 0, 0, -189, 1, 0, 0, 0, 0, 35, 0, 57, 0, 0, 0,190, 1, 0, 0, 0, 0, 35, 0,113, 0, 0, 0,190, 1, 0, 0, 0, 0, 35, 0, - 56, 0, 0, 0,191, 1, 0, 0, 0, 0, 35, 0,112, 0, 0, 0,191, 1, 0, 0, 0, 0, 35, 0, 52, 0, 0, 0,192, 1, 0, 0, - 0, 0, 35, 0,112, 0, 0, 0,192, 1, 0, 0, 0, 0, 35, 0, 52, 0, 0, 0,193, 1, 0, 0, 0, 0, 33, 0, 56, 0, 0, 0, -193, 1, 0, 0, 0, 0, 33, 0, 60, 0, 0, 0,194, 1, 0, 0, 0, 0, 35, 0,114, 0, 0, 0,194, 1, 0, 0, 0, 0, 35, 0, - 57, 0, 0, 0,195, 1, 0, 0, 0, 0, 33, 0, 60, 0, 0, 0,195, 1, 0, 0, 0, 0, 33, 0, 57, 0, 0, 0,196, 1, 0, 0, - 0, 0, 35, 0,114, 0, 0, 0,196, 1, 0, 0, 0, 0, 35, 0,114, 0, 0, 0,197, 1, 0, 0, 0, 0, 35, 0,115, 0, 0, 0, -197, 1, 0, 0, 0, 0, 35, 0,115, 0, 0, 0,198, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0,198, 1, 0, 0, 0, 0, 35, 0, -114, 0, 0, 0,199, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0,199, 1, 0, 0, 0, 0, 35, 0, 49, 0, 0, 0,200, 1, 0, 0, - 0, 0, 33, 0, 61, 0, 0, 0,200, 1, 0, 0, 0, 0, 33, 0, 61, 0, 0, 0,201, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0, -201, 1, 0, 0, 0, 0, 35, 0, 49, 0, 0, 0,202, 1, 0, 0, 0, 0, 35, 0,116, 0, 0, 0,202, 1, 0, 0, 0, 0, 35, 0, - 48, 0, 0, 0,203, 1, 0, 0, 0, 0, 35, 0,115, 0, 0, 0,203, 1, 0, 0, 0, 0, 35, 0, 56, 0, 0, 0,204, 1, 0, 0, - 0, 0, 35, 0,115, 0, 0, 0,204, 1, 0, 0, 0, 0, 35, 0, 48, 0, 0, 0,205, 1, 0, 0, 0, 0, 33, 0, 56, 0, 0, 0, -205, 1, 0, 0, 0, 0, 33, 0, 64, 0, 0, 0,206, 1, 0, 0, 0, 0, 35, 0,117, 0, 0, 0,206, 1, 0, 0, 0, 0, 35, 0, - 50, 0, 0, 0,207, 1, 0, 0, 0, 0, 33, 0, 64, 0, 0, 0,207, 1, 0, 0, 0, 0, 33, 0, 50, 0, 0, 0,208, 1, 0, 0, - 0, 0, 35, 0,117, 0, 0, 0,208, 1, 0, 0, 0, 0, 35, 0,117, 0, 0, 0,209, 1, 0, 0, 0, 0, 35, 0,118, 0, 0, 0, -209, 1, 0, 0, 0, 0, 35, 0,118, 0, 0, 0,210, 1, 0, 0, 0, 0, 35, 0,119, 0, 0, 0,210, 1, 0, 0, 0, 0, 35, 0, -117, 0, 0, 0,211, 1, 0, 0, 0, 0, 35, 0,119, 0, 0, 0,211, 1, 0, 0, 0, 0, 35, 0, 63, 0, 0, 0,212, 1, 0, 0, - 0, 0, 33, 0, 65, 0, 0, 0,212, 1, 0, 0, 0, 0, 33, 0, 65, 0, 0, 0,213, 1, 0, 0, 0, 0, 35, 0,119, 0, 0, 0, -213, 1, 0, 0, 0, 0, 35, 0, 63, 0, 0, 0,214, 1, 0, 0, 0, 0, 35, 0,119, 0, 0, 0,214, 1, 0, 0, 0, 0, 35, 0, - 62, 0, 0, 0,215, 1, 0, 0, 0, 0, 35, 0,118, 0, 0, 0,215, 1, 0, 0, 0, 0, 35, 0, 51, 0, 0, 0,216, 1, 0, 0, - 0, 0, 35, 0,118, 0, 0, 0,216, 1, 0, 0, 0, 0, 35, 0, 51, 0, 0, 0,217, 1, 0, 0, 0, 0, 33, 0, 62, 0, 0, 0, -217, 1, 0, 0, 0, 0, 33, 0, 68, 0, 0, 0,218, 1, 0, 0, 0, 0, 35, 0,120, 0, 0, 0,218, 1, 0, 0, 0, 0, 35, 0, - 47, 0, 0, 0,219, 1, 0, 0, 0, 0, 33, 0, 68, 0, 0, 0,219, 1, 0, 0, 0, 0, 33, 0, 47, 0, 0, 0,220, 1, 0, 0, - 0, 0, 35, 0,120, 0, 0, 0,220, 1, 0, 0, 0, 0, 35, 0,120, 0, 0, 0,221, 1, 0, 0, 0, 0, 35, 0,121, 0, 0, 0, -221, 1, 0, 0, 0, 0, 35, 0,121, 0, 0, 0,222, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0,222, 1, 0, 0, 0, 0, 35, 0, -120, 0, 0, 0,223, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0,223, 1, 0, 0, 0, 0, 35, 0, 67, 0, 0, 0,224, 1, 0, 0, - 0, 0, 33, 0, 69, 0, 0, 0,224, 1, 0, 0, 0, 0, 33, 0, 69, 0, 0, 0,225, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0, -225, 1, 0, 0, 0, 0, 35, 0, 67, 0, 0, 0,226, 1, 0, 0, 0, 0, 35, 0,122, 0, 0, 0,226, 1, 0, 0, 0, 0, 35, 0, - 66, 0, 0, 0,227, 1, 0, 0, 0, 0, 35, 0,121, 0, 0, 0,227, 1, 0, 0, 0, 0, 35, 0, 46, 0, 0, 0,228, 1, 0, 0, - 0, 0, 35, 0,121, 0, 0, 0,228, 1, 0, 0, 0, 0, 35, 0, 46, 0, 0, 0,229, 1, 0, 0, 0, 0, 33, 0, 66, 0, 0, 0, -229, 1, 0, 0, 0, 0, 33, 0, 72, 0, 0, 0,230, 1, 0, 0, 0, 0, 35, 0,123, 0, 0, 0,230, 1, 0, 0, 0, 0, 35, 0, - 55, 0, 0, 0,231, 1, 0, 0, 0, 0, 33, 0, 72, 0, 0, 0,231, 1, 0, 0, 0, 0, 33, 0, 55, 0, 0, 0,232, 1, 0, 0, - 0, 0, 35, 0,123, 0, 0, 0,232, 1, 0, 0, 0, 0, 35, 0,123, 0, 0, 0,233, 1, 0, 0, 0, 0, 35, 0,124, 0, 0, 0, -233, 1, 0, 0, 0, 0, 35, 0,124, 0, 0, 0,234, 1, 0, 0, 0, 0, 35, 0,125, 0, 0, 0,234, 1, 0, 0, 0, 0, 35, 0, -123, 0, 0, 0,235, 1, 0, 0, 0, 0, 35, 0,125, 0, 0, 0,235, 1, 0, 0, 0, 0, 35, 0, 71, 0, 0, 0,236, 1, 0, 0, - 0, 0, 33, 0, 73, 0, 0, 0,236, 1, 0, 0, 0, 0, 33, 0, 73, 0, 0, 0,237, 1, 0, 0, 0, 0, 35, 0,125, 0, 0, 0, -237, 1, 0, 0, 0, 0, 35, 0, 71, 0, 0, 0,238, 1, 0, 0, 0, 0, 35, 0,125, 0, 0, 0,238, 1, 0, 0, 0, 0, 35, 0, - 70, 0, 0, 0,239, 1, 0, 0, 0, 0, 35, 0,124, 0, 0, 0,239, 1, 0, 0, 0, 0, 35, 0, 54, 0, 0, 0,240, 1, 0, 0, - 0, 0, 35, 0,124, 0, 0, 0,240, 1, 0, 0, 0, 0, 35, 0, 54, 0, 0, 0,241, 1, 0, 0, 0, 0, 33, 0, 70, 0, 0, 0, -241, 1, 0, 0, 0, 0, 33, 0, 76, 0, 0, 0,242, 1, 0, 0, 0, 0, 35, 0,126, 0, 0, 0,242, 1, 0, 0, 0, 0, 35, 0, - 59, 0, 0, 0,243, 1, 0, 0, 0, 0, 33, 0, 76, 0, 0, 0,243, 1, 0, 0, 0, 0, 33, 0, 59, 0, 0, 0,244, 1, 0, 0, - 0, 0, 35, 0,126, 0, 0, 0,244, 1, 0, 0, 0, 0, 35, 0,126, 0, 0, 0,245, 1, 0, 0, 0, 0, 35, 0,127, 0, 0, 0, -245, 1, 0, 0, 0, 0, 35, 0,127, 0, 0, 0,246, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0,246, 1, 0, 0, 0, 0, 35, 0, -126, 0, 0, 0,247, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0,247, 1, 0, 0, 0, 0, 35, 0, 75, 0, 0, 0,248, 1, 0, 0, - 0, 0, 33, 0, 77, 0, 0, 0,248, 1, 0, 0, 0, 0, 33, 0, 77, 0, 0, 0,249, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0, -249, 1, 0, 0, 0, 0, 35, 0, 75, 0, 0, 0,250, 1, 0, 0, 0, 0, 35, 0,128, 0, 0, 0,250, 1, 0, 0, 0, 0, 35, 0, - 74, 0, 0, 0,251, 1, 0, 0, 0, 0, 35, 0,127, 0, 0, 0,251, 1, 0, 0, 0, 0, 35, 0, 58, 0, 0, 0,252, 1, 0, 0, - 0, 0, 35, 0,127, 0, 0, 0,252, 1, 0, 0, 0, 0, 35, 0, 58, 0, 0, 0,253, 1, 0, 0, 0, 0, 33, 0, 74, 0, 0, 0, -253, 1, 0, 0, 0, 0, 33, 0, 80, 0, 0, 0,254, 1, 0, 0, 0, 0, 35, 0,129, 0, 0, 0,254, 1, 0, 0, 0, 0, 35, 0, - 61, 0, 0, 0,255, 1, 0, 0, 0, 0, 33, 0, 80, 0, 0, 0,255, 1, 0, 0, 0, 0, 33, 0, 61, 0, 0, 0, 0, 2, 0, 0, - 0, 0, 35, 0,129, 0, 0, 0, 0, 2, 0, 0, 0, 0, 35, 0,129, 0, 0, 0, 1, 2, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, - 1, 2, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, 2, 2, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, 2, 2, 0, 0, 0, 0, 35, 0, -129, 0, 0, 0, 3, 2, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, 3, 2, 0, 0, 0, 0, 35, 0, 79, 0, 0, 0, 4, 2, 0, 0, - 0, 0, 33, 0, 81, 0, 0, 0, 4, 2, 0, 0, 0, 0, 33, 0, 81, 0, 0, 0, 5, 2, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, - 5, 2, 0, 0, 0, 0, 35, 0, 79, 0, 0, 0, 6, 2, 0, 0, 0, 0, 35, 0,131, 0, 0, 0, 6, 2, 0, 0, 0, 0, 35, 0, - 78, 0, 0, 0, 7, 2, 0, 0, 0, 0, 35, 0,130, 0, 0, 0, 7, 2, 0, 0, 0, 0, 35, 0, 60, 0, 0, 0, 8, 2, 0, 0, - 0, 0, 35, 0,130, 0, 0, 0, 8, 2, 0, 0, 0, 0, 35, 0, 60, 0, 0, 0, 9, 2, 0, 0, 0, 0, 33, 0, 78, 0, 0, 0, - 9, 2, 0, 0, 0, 0, 33, 0, 83, 0, 0, 0, 10, 2, 0, 0, 0, 0, 35, 0,132, 0, 0, 0, 10, 2, 0, 0, 0, 0, 35, 0, - 65, 0, 0, 0, 11, 2, 0, 0, 0, 0, 33, 0, 83, 0, 0, 0, 11, 2, 0, 0, 0, 0, 33, 0, 65, 0, 0, 0, 12, 2, 0, 0, - 0, 0, 35, 0,132, 0, 0, 0, 12, 2, 0, 0, 0, 0, 35, 0,132, 0, 0, 0, 13, 2, 0, 0, 0, 0, 35, 0,133, 0, 0, 0, - 13, 2, 0, 0, 0, 0, 35, 0,133, 0, 0, 0, 14, 2, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, 14, 2, 0, 0, 0, 0, 35, 0, -132, 0, 0, 0, 15, 2, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, 15, 2, 0, 0, 0, 0, 35, 0, 67, 0, 0, 0, 16, 2, 0, 0, - 0, 0, 33, 0, 82, 0, 0, 0, 16, 2, 0, 0, 0, 0, 33, 0, 82, 0, 0, 0, 17, 2, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, - 17, 2, 0, 0, 0, 0, 35, 0, 67, 0, 0, 0, 18, 2, 0, 0, 0, 0, 35, 0,134, 0, 0, 0, 18, 2, 0, 0, 0, 0, 35, 0, - 66, 0, 0, 0, 19, 2, 0, 0, 0, 0, 35, 0,133, 0, 0, 0, 19, 2, 0, 0, 0, 0, 35, 0, 64, 0, 0, 0, 20, 2, 0, 0, - 0, 0, 35, 0,133, 0, 0, 0, 20, 2, 0, 0, 0, 0, 35, 0, 64, 0, 0, 0, 21, 2, 0, 0, 0, 0, 33, 0, 66, 0, 0, 0, - 21, 2, 0, 0, 0, 0, 33, 0, 84, 0, 0, 0, 22, 2, 0, 0, 0, 0, 35, 0,135, 0, 0, 0, 22, 2, 0, 0, 0, 0, 35, 0, - 69, 0, 0, 0, 23, 2, 0, 0, 0, 0, 33, 0, 84, 0, 0, 0, 23, 2, 0, 0, 0, 0, 33, 0, 69, 0, 0, 0, 24, 2, 0, 0, - 0, 0, 35, 0,135, 0, 0, 0, 24, 2, 0, 0, 0, 0, 35, 0,135, 0, 0, 0, 25, 2, 0, 0, 0, 0, 35, 0,136, 0, 0, 0, - 25, 2, 0, 0, 0, 0, 35, 0,136, 0, 0, 0, 26, 2, 0, 0, 0, 0, 35, 0,137, 0, 0, 0, 26, 2, 0, 0, 0, 0, 35, 0, -135, 0, 0, 0, 27, 2, 0, 0, 0, 0, 35, 0,137, 0, 0, 0, 27, 2, 0, 0, 0, 0, 35, 0, 71, 0, 0, 0, 28, 2, 0, 0, - 0, 0, 33, 0, 85, 0, 0, 0, 28, 2, 0, 0, 0, 0, 33, 0, 85, 0, 0, 0, 29, 2, 0, 0, 0, 0, 35, 0,137, 0, 0, 0, - 29, 2, 0, 0, 0, 0, 35, 0, 71, 0, 0, 0, 30, 2, 0, 0, 0, 0, 35, 0,137, 0, 0, 0, 30, 2, 0, 0, 0, 0, 35, 0, - 70, 0, 0, 0, 31, 2, 0, 0, 0, 0, 35, 0,136, 0, 0, 0, 31, 2, 0, 0, 0, 0, 35, 0, 68, 0, 0, 0, 32, 2, 0, 0, - 0, 0, 35, 0,136, 0, 0, 0, 32, 2, 0, 0, 0, 0, 35, 0, 68, 0, 0, 0, 33, 2, 0, 0, 0, 0, 33, 0, 70, 0, 0, 0, - 33, 2, 0, 0, 0, 0, 33, 0, 86, 0, 0, 0, 34, 2, 0, 0, 0, 0, 35, 0,138, 0, 0, 0, 34, 2, 0, 0, 0, 0, 35, 0, - 73, 0, 0, 0, 35, 2, 0, 0, 0, 0, 33, 0, 86, 0, 0, 0, 35, 2, 0, 0, 0, 0, 33, 0, 73, 0, 0, 0, 36, 2, 0, 0, - 0, 0, 35, 0,138, 0, 0, 0, 36, 2, 0, 0, 0, 0, 35, 0,138, 0, 0, 0, 37, 2, 0, 0, 0, 0, 35, 0,139, 0, 0, 0, - 37, 2, 0, 0, 0, 0, 35, 0,139, 0, 0, 0, 38, 2, 0, 0, 0, 0, 35, 0,140, 0, 0, 0, 38, 2, 0, 0, 0, 0, 35, 0, -138, 0, 0, 0, 39, 2, 0, 0, 0, 0, 35, 0,140, 0, 0, 0, 39, 2, 0, 0, 0, 0, 35, 0, 75, 0, 0, 0, 40, 2, 0, 0, - 0, 0, 33, 0, 87, 0, 0, 0, 40, 2, 0, 0, 0, 0, 33, 0, 87, 0, 0, 0, 41, 2, 0, 0, 0, 0, 35, 0,140, 0, 0, 0, - 41, 2, 0, 0, 0, 0, 35, 0, 75, 0, 0, 0, 42, 2, 0, 0, 0, 0, 35, 0,140, 0, 0, 0, 42, 2, 0, 0, 0, 0, 35, 0, - 74, 0, 0, 0, 43, 2, 0, 0, 0, 0, 35, 0,139, 0, 0, 0, 43, 2, 0, 0, 0, 0, 35, 0, 72, 0, 0, 0, 44, 2, 0, 0, - 0, 0, 35, 0,139, 0, 0, 0, 44, 2, 0, 0, 0, 0, 35, 0, 72, 0, 0, 0, 45, 2, 0, 0, 0, 0, 33, 0, 74, 0, 0, 0, - 45, 2, 0, 0, 0, 0, 33, 0, 88, 0, 0, 0, 46, 2, 0, 0, 0, 0, 35, 0,141, 0, 0, 0, 46, 2, 0, 0, 0, 0, 35, 0, - 77, 0, 0, 0, 47, 2, 0, 0, 0, 0, 33, 0, 88, 0, 0, 0, 47, 2, 0, 0, 0, 0, 33, 0, 77, 0, 0, 0, 48, 2, 0, 0, - 0, 0, 35, 0,141, 0, 0, 0, 48, 2, 0, 0, 0, 0, 35, 0,141, 0, 0, 0, 49, 2, 0, 0, 0, 0, 35, 0,142, 0, 0, 0, - 49, 2, 0, 0, 0, 0, 35, 0,142, 0, 0, 0, 50, 2, 0, 0, 0, 0, 35, 0,143, 0, 0, 0, 50, 2, 0, 0, 0, 0, 35, 0, -141, 0, 0, 0, 51, 2, 0, 0, 0, 0, 35, 0,143, 0, 0, 0, 51, 2, 0, 0, 0, 0, 35, 0, 79, 0, 0, 0, 52, 2, 0, 0, - 0, 0, 33, 0, 89, 0, 0, 0, 52, 2, 0, 0, 0, 0, 33, 0, 89, 0, 0, 0, 53, 2, 0, 0, 0, 0, 35, 0,143, 0, 0, 0, - 53, 2, 0, 0, 0, 0, 35, 0, 79, 0, 0, 0, 54, 2, 0, 0, 0, 0, 35, 0,143, 0, 0, 0, 54, 2, 0, 0, 0, 0, 35, 0, - 78, 0, 0, 0, 55, 2, 0, 0, 0, 0, 35, 0,142, 0, 0, 0, 55, 2, 0, 0, 0, 0, 35, 0, 76, 0, 0, 0, 56, 2, 0, 0, - 0, 0, 35, 0,142, 0, 0, 0, 56, 2, 0, 0, 0, 0, 35, 0, 76, 0, 0, 0, 57, 2, 0, 0, 0, 0, 33, 0, 78, 0, 0, 0, - 57, 2, 0, 0, 0, 0, 33, 0, 90, 0, 0, 0, 58, 2, 0, 0, 0, 0, 35, 0,144, 0, 0, 0, 58, 2, 0, 0, 0, 0, 35, 0, - 81, 0, 0, 0, 59, 2, 0, 0, 0, 0, 33, 0, 90, 0, 0, 0, 59, 2, 0, 0, 0, 0, 33, 0, 81, 0, 0, 0, 60, 2, 0, 0, - 0, 0, 35, 0,144, 0, 0, 0, 60, 2, 0, 0, 0, 0, 35, 0,144, 0, 0, 0, 61, 2, 0, 0, 0, 0, 35, 0,145, 0, 0, 0, - 61, 2, 0, 0, 0, 0, 35, 0,145, 0, 0, 0, 62, 2, 0, 0, 0, 0, 35, 0,146, 0, 0, 0, 62, 2, 0, 0, 0, 0, 35, 0, -144, 0, 0, 0, 63, 2, 0, 0, 0, 0, 35, 0,146, 0, 0, 0, 63, 2, 0, 0, 0, 0, 35, 0, 63, 0, 0, 0, 64, 2, 0, 0, - 0, 0, 33, 0, 91, 0, 0, 0, 64, 2, 0, 0, 0, 0, 33, 0, 91, 0, 0, 0, 65, 2, 0, 0, 0, 0, 35, 0,146, 0, 0, 0, - 65, 2, 0, 0, 0, 0, 35, 0, 63, 0, 0, 0, 66, 2, 0, 0, 0, 0, 35, 0,146, 0, 0, 0, 66, 2, 0, 0, 0, 0, 35, 0, - 62, 0, 0, 0, 67, 2, 0, 0, 0, 0, 35, 0,145, 0, 0, 0, 67, 2, 0, 0, 0, 0, 35, 0, 80, 0, 0, 0, 68, 2, 0, 0, - 0, 0, 35, 0,145, 0, 0, 0, 68, 2, 0, 0, 0, 0, 35, 0, 62, 0, 0, 0, 69, 2, 0, 0, 0, 0, 33, 0, 80, 0, 0, 0, - 69, 2, 0, 0, 0, 0, 33, 0, 94, 0, 0, 0, 70, 2, 0, 0, 0, 0, 35, 0,147, 0, 0, 0, 70, 2, 0, 0, 0, 0, 35, 0, - 82, 0, 0, 0, 71, 2, 0, 0, 0, 0, 33, 0, 94, 0, 0, 0, 71, 2, 0, 0, 0, 0, 33, 0, 82, 0, 0, 0, 72, 2, 0, 0, - 0, 0, 35, 0,147, 0, 0, 0, 72, 2, 0, 0, 0, 0, 35, 0,147, 0, 0, 0, 73, 2, 0, 0, 0, 0, 35, 0,148, 0, 0, 0, - 73, 2, 0, 0, 0, 0, 35, 0,148, 0, 0, 0, 74, 2, 0, 0, 0, 0, 35, 0,149, 0, 0, 0, 74, 2, 0, 0, 0, 0, 35, 0, -147, 0, 0, 0, 75, 2, 0, 0, 0, 0, 35, 0,149, 0, 0, 0, 75, 2, 0, 0, 0, 0, 35, 0, 93, 0, 0, 0, 76, 2, 0, 0, - 0, 0, 33, 0, 95, 0, 0, 0, 76, 2, 0, 0, 0, 0, 33, 0, 95, 0, 0, 0, 77, 2, 0, 0, 0, 0, 35, 0,149, 0, 0, 0, - 77, 2, 0, 0, 0, 0, 35, 0, 93, 0, 0, 0, 78, 2, 0, 0, 0, 0, 35, 0,149, 0, 0, 0, 78, 2, 0, 0, 0, 0, 35, 0, - 92, 0, 0, 0, 79, 2, 0, 0, 0, 0, 35, 0,148, 0, 0, 0, 79, 2, 0, 0, 0, 0, 35, 0, 83, 0, 0, 0, 80, 2, 0, 0, - 0, 0, 35, 0,148, 0, 0, 0, 80, 2, 0, 0, 0, 0, 35, 0, 83, 0, 0, 0, 81, 2, 0, 0, 0, 0, 33, 0, 92, 0, 0, 0, - 81, 2, 0, 0, 0, 0, 33, 0, 96, 0, 0, 0, 82, 2, 0, 0, 0, 0, 35, 0,150, 0, 0, 0, 82, 2, 0, 0, 0, 0, 35, 0, - 85, 0, 0, 0, 83, 2, 0, 0, 0, 0, 33, 0, 96, 0, 0, 0, 83, 2, 0, 0, 0, 0, 33, 0, 85, 0, 0, 0, 84, 2, 0, 0, - 0, 0, 35, 0,150, 0, 0, 0, 84, 2, 0, 0, 0, 0, 35, 0,150, 0, 0, 0, 85, 2, 0, 0, 0, 0, 35, 0,151, 0, 0, 0, - 85, 2, 0, 0, 0, 0, 35, 0,151, 0, 0, 0, 86, 2, 0, 0, 0, 0, 35, 0,152, 0, 0, 0, 86, 2, 0, 0, 0, 0, 35, 0, -150, 0, 0, 0, 87, 2, 0, 0, 0, 0, 35, 0,152, 0, 0, 0, 87, 2, 0, 0, 0, 0, 35, 0, 95, 0, 0, 0, 88, 2, 0, 0, - 0, 0, 33, 0, 97, 0, 0, 0, 88, 2, 0, 0, 0, 0, 33, 0, 97, 0, 0, 0, 89, 2, 0, 0, 0, 0, 35, 0,152, 0, 0, 0, - 89, 2, 0, 0, 0, 0, 35, 0, 95, 0, 0, 0, 90, 2, 0, 0, 0, 0, 35, 0,152, 0, 0, 0, 90, 2, 0, 0, 0, 0, 35, 0, - 94, 0, 0, 0, 91, 2, 0, 0, 0, 0, 35, 0,151, 0, 0, 0, 91, 2, 0, 0, 0, 0, 35, 0, 84, 0, 0, 0, 92, 2, 0, 0, - 0, 0, 35, 0,151, 0, 0, 0, 92, 2, 0, 0, 0, 0, 35, 0, 84, 0, 0, 0, 93, 2, 0, 0, 0, 0, 33, 0, 94, 0, 0, 0, - 93, 2, 0, 0, 0, 0, 33, 0, 98, 0, 0, 0, 94, 2, 0, 0, 0, 0, 35, 0,153, 0, 0, 0, 94, 2, 0, 0, 0, 0, 35, 0, - 87, 0, 0, 0, 95, 2, 0, 0, 0, 0, 33, 0, 98, 0, 0, 0, 95, 2, 0, 0, 0, 0, 33, 0, 87, 0, 0, 0, 96, 2, 0, 0, - 0, 0, 35, 0,153, 0, 0, 0, 96, 2, 0, 0, 0, 0, 35, 0,153, 0, 0, 0, 97, 2, 0, 0, 0, 0, 35, 0,154, 0, 0, 0, - 97, 2, 0, 0, 0, 0, 35, 0,154, 0, 0, 0, 98, 2, 0, 0, 0, 0, 35, 0,155, 0, 0, 0, 98, 2, 0, 0, 0, 0, 35, 0, -153, 0, 0, 0, 99, 2, 0, 0, 0, 0, 35, 0,155, 0, 0, 0, 99, 2, 0, 0, 0, 0, 35, 0, 97, 0, 0, 0,100, 2, 0, 0, - 0, 0, 33, 0, 99, 0, 0, 0,100, 2, 0, 0, 0, 0, 33, 0, 99, 0, 0, 0,101, 2, 0, 0, 0, 0, 35, 0,155, 0, 0, 0, -101, 2, 0, 0, 0, 0, 35, 0, 97, 0, 0, 0,102, 2, 0, 0, 0, 0, 35, 0,155, 0, 0, 0,102, 2, 0, 0, 0, 0, 35, 0, - 96, 0, 0, 0,103, 2, 0, 0, 0, 0, 35, 0,154, 0, 0, 0,103, 2, 0, 0, 0, 0, 35, 0, 86, 0, 0, 0,104, 2, 0, 0, - 0, 0, 35, 0,154, 0, 0, 0,104, 2, 0, 0, 0, 0, 35, 0, 86, 0, 0, 0,105, 2, 0, 0, 0, 0, 33, 0, 96, 0, 0, 0, -105, 2, 0, 0, 0, 0, 33, 0,100, 0, 0, 0,106, 2, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,106, 2, 0, 0, 0, 0, 35, 0, - 89, 0, 0, 0,107, 2, 0, 0, 0, 0, 33, 0,100, 0, 0, 0,107, 2, 0, 0, 0, 0, 33, 0, 89, 0, 0, 0,108, 2, 0, 0, - 0, 0, 35, 0,156, 0, 0, 0,108, 2, 0, 0, 0, 0, 35, 0,156, 0, 0, 0,109, 2, 0, 0, 0, 0, 35, 0,157, 0, 0, 0, -109, 2, 0, 0, 0, 0, 35, 0,157, 0, 0, 0,110, 2, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,110, 2, 0, 0, 0, 0, 35, 0, -156, 0, 0, 0,111, 2, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,111, 2, 0, 0, 0, 0, 35, 0, 99, 0, 0, 0,112, 2, 0, 0, - 0, 0, 33, 0,101, 0, 0, 0,112, 2, 0, 0, 0, 0, 33, 0,101, 0, 0, 0,113, 2, 0, 0, 0, 0, 35, 0,158, 0, 0, 0, -113, 2, 0, 0, 0, 0, 35, 0, 99, 0, 0, 0,114, 2, 0, 0, 0, 0, 35, 0,158, 0, 0, 0,114, 2, 0, 0, 0, 0, 35, 0, - 98, 0, 0, 0,115, 2, 0, 0, 0, 0, 35, 0,157, 0, 0, 0,115, 2, 0, 0, 0, 0, 35, 0, 88, 0, 0, 0,116, 2, 0, 0, - 0, 0, 35, 0,157, 0, 0, 0,116, 2, 0, 0, 0, 0, 35, 0, 88, 0, 0, 0,117, 2, 0, 0, 0, 0, 33, 0, 98, 0, 0, 0, -117, 2, 0, 0, 0, 0, 33, 0, 92, 0, 0, 0,118, 2, 0, 0, 0, 0, 35, 0,159, 0, 0, 0,118, 2, 0, 0, 0, 0, 35, 0, - 91, 0, 0, 0,119, 2, 0, 0, 0, 0, 33, 0, 92, 0, 0, 0,119, 2, 0, 0, 0, 0, 33, 0, 91, 0, 0, 0,120, 2, 0, 0, - 0, 0, 35, 0,159, 0, 0, 0,120, 2, 0, 0, 0, 0, 35, 0,159, 0, 0, 0,121, 2, 0, 0, 0, 0, 35, 0,160, 0, 0, 0, -121, 2, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,122, 2, 0, 0, 0, 0, 35, 0,161, 0, 0, 0,122, 2, 0, 0, 0, 0, 35, 0, -159, 0, 0, 0,123, 2, 0, 0, 0, 0, 35, 0,161, 0, 0, 0,123, 2, 0, 0, 0, 0, 35, 0, 93, 0, 0, 0,124, 2, 0, 0, - 0, 0, 33, 0,101, 0, 0, 0,124, 2, 0, 0, 0, 0, 33, 0, 93, 0, 0, 0,125, 2, 0, 0, 0, 0, 35, 0,161, 0, 0, 0, -125, 2, 0, 0, 0, 0, 35, 0,101, 0, 0, 0,126, 2, 0, 0, 0, 0, 35, 0,161, 0, 0, 0,126, 2, 0, 0, 0, 0, 35, 0, -100, 0, 0, 0,127, 2, 0, 0, 0, 0, 35, 0,160, 0, 0, 0,127, 2, 0, 0, 0, 0, 35, 0, 90, 0, 0, 0,128, 2, 0, 0, - 0, 0, 35, 0,160, 0, 0, 0,128, 2, 0, 0, 0, 0, 35, 0, 90, 0, 0, 0,129, 2, 0, 0, 0, 0, 33, 0,100, 0, 0, 0, -129, 2, 0, 0, 0, 0, 33, 0, 27, 1, 0, 0,146, 1, 0, 0, 0, 0, 35, 0,171, 0, 0, 0,146, 1, 0, 0, 0, 0, 35, 0, -171, 0, 0, 0, 27, 1, 0, 0, 0, 0, 35, 0,146, 1, 0, 0,147, 1, 0, 0, 0, 0, 35, 0,146, 1, 0, 0,148, 1, 0, 0, - 0, 0, 35, 0,147, 1, 0, 0,148, 1, 0, 0, 0, 0, 35, 0,165, 0, 0, 0, 26, 1, 0, 0, 0, 0, 35, 0,165, 0, 0, 0, -148, 1, 0, 0, 0, 0, 35, 0, 26, 1, 0, 0,148, 1, 0, 0, 0, 0, 35, 0,164, 0, 0, 0,147, 1, 0, 0, 0, 0, 35, 0, -164, 0, 0, 0,170, 0, 0, 0, 0, 0, 35, 0,170, 0, 0, 0,147, 1, 0, 0, 0, 0, 35, 0, 26, 1, 0, 0,149, 1, 0, 0, - 0, 0, 35, 0, 28, 1, 0, 0,149, 1, 0, 0, 0, 0, 35, 0, 26, 1, 0, 0, 28, 1, 0, 0, 0, 0, 35, 0,149, 1, 0, 0, -150, 1, 0, 0, 0, 0, 35, 0,149, 1, 0, 0,151, 1, 0, 0, 0, 0, 35, 0,150, 1, 0, 0,151, 1, 0, 0, 0, 0, 35, 0, - 27, 1, 0, 0, 31, 1, 0, 0, 0, 0, 35, 0, 31, 1, 0, 0,151, 1, 0, 0, 0, 0, 35, 0, 27, 1, 0, 0,151, 1, 0, 0, - 0, 0, 35, 0, 30, 1, 0, 0,150, 1, 0, 0, 0, 0, 35, 0, 29, 1, 0, 0, 30, 1, 0, 0, 0, 0, 35, 0, 29, 1, 0, 0, -150, 1, 0, 0, 0, 0, 35, 0,168, 0, 0, 0,152, 1, 0, 0, 0, 0, 35, 0,172, 0, 0, 0,152, 1, 0, 0, 0, 0, 35, 0, -168, 0, 0, 0,172, 0, 0, 0, 0, 0, 35, 0,152, 1, 0, 0,153, 1, 0, 0, 0, 0, 35, 0,152, 1, 0, 0,154, 1, 0, 0, - 0, 0, 35, 0,153, 1, 0, 0,154, 1, 0, 0, 0, 0, 35, 0,169, 0, 0, 0, 30, 1, 0, 0, 0, 0, 35, 0, 30, 1, 0, 0, -154, 1, 0, 0, 0, 0, 35, 0,169, 0, 0, 0,154, 1, 0, 0, 0, 0, 35, 0, 31, 1, 0, 0,153, 1, 0, 0, 0, 0, 35, 0, -173, 0, 0, 0, 31, 1, 0, 0, 0, 0, 35, 0,173, 0, 0, 0,153, 1, 0, 0, 0, 0, 35, 0,167, 0, 0, 0,155, 1, 0, 0, - 0, 0, 35, 0, 29, 1, 0, 0,155, 1, 0, 0, 0, 0, 35, 0,167, 0, 0, 0, 29, 1, 0, 0, 0, 0, 35, 0,155, 1, 0, 0, -156, 1, 0, 0, 0, 0, 35, 0,155, 1, 0, 0,157, 1, 0, 0, 0, 0, 35, 0,156, 1, 0, 0,157, 1, 0, 0, 0, 0, 35, 0, -162, 0, 0, 0,166, 0, 0, 0, 0, 0, 35, 0,162, 0, 0, 0,157, 1, 0, 0, 0, 0, 35, 0,166, 0, 0, 0,157, 1, 0, 0, - 0, 0, 35, 0,163, 0, 0, 0,156, 1, 0, 0, 0, 0, 35, 0,163, 0, 0, 0, 28, 1, 0, 0, 0, 0, 35, 0, 28, 1, 0, 0, -156, 1, 0, 0, 0, 0, 35, 0, 33, 1, 0, 0,158, 1, 0, 0, 0, 0, 35, 0,179, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 0, -179, 0, 0, 0,158, 1, 0, 0, 0, 0, 35, 0,158, 1, 0, 0,159, 1, 0, 0, 0, 0, 35, 0,159, 1, 0, 0,160, 1, 0, 0, - 0, 0, 35, 0,158, 1, 0, 0,160, 1, 0, 0, 0, 0, 35, 0,165, 0, 0, 0, 32, 1, 0, 0, 0, 0, 35, 0, 32, 1, 0, 0, -160, 1, 0, 0, 0, 0, 35, 0,165, 0, 0, 0,160, 1, 0, 0, 0, 0, 35, 0,164, 0, 0, 0,159, 1, 0, 0, 0, 0, 35, 0, -178, 0, 0, 0,159, 1, 0, 0, 0, 0, 35, 0,164, 0, 0, 0,178, 0, 0, 0, 0, 0, 35, 0, 32, 1, 0, 0,161, 1, 0, 0, - 0, 0, 35, 0, 32, 1, 0, 0, 34, 1, 0, 0, 0, 0, 35, 0, 34, 1, 0, 0,161, 1, 0, 0, 0, 0, 35, 0,161, 1, 0, 0, -162, 1, 0, 0, 0, 0, 35, 0,162, 1, 0, 0,163, 1, 0, 0, 0, 0, 35, 0,161, 1, 0, 0,163, 1, 0, 0, 0, 0, 35, 0, - 33, 1, 0, 0, 37, 1, 0, 0, 0, 0, 35, 0, 33, 1, 0, 0,163, 1, 0, 0, 0, 0, 35, 0, 37, 1, 0, 0,163, 1, 0, 0, - 0, 0, 35, 0, 36, 1, 0, 0,162, 1, 0, 0, 0, 0, 35, 0, 35, 1, 0, 0,162, 1, 0, 0, 0, 0, 35, 0, 35, 1, 0, 0, - 36, 1, 0, 0, 0, 0, 35, 0,176, 0, 0, 0,164, 1, 0, 0, 0, 0, 35, 0,176, 0, 0, 0,180, 0, 0, 0, 0, 0, 35, 0, -180, 0, 0, 0,164, 1, 0, 0, 0, 0, 35, 0,164, 1, 0, 0,165, 1, 0, 0, 0, 0, 35, 0,165, 1, 0, 0,166, 1, 0, 0, - 0, 0, 35, 0,164, 1, 0, 0,166, 1, 0, 0, 0, 0, 35, 0,177, 0, 0, 0, 36, 1, 0, 0, 0, 0, 35, 0,177, 0, 0, 0, -166, 1, 0, 0, 0, 0, 35, 0, 36, 1, 0, 0,166, 1, 0, 0, 0, 0, 35, 0, 37, 1, 0, 0,165, 1, 0, 0, 0, 0, 35, 0, -181, 0, 0, 0,165, 1, 0, 0, 0, 0, 35, 0,181, 0, 0, 0, 37, 1, 0, 0, 0, 0, 35, 0,175, 0, 0, 0,167, 1, 0, 0, - 0, 0, 35, 0,175, 0, 0, 0, 35, 1, 0, 0, 0, 0, 35, 0, 35, 1, 0, 0,167, 1, 0, 0, 0, 0, 35, 0,167, 1, 0, 0, -168, 1, 0, 0, 0, 0, 35, 0,168, 1, 0, 0,169, 1, 0, 0, 0, 0, 35, 0,167, 1, 0, 0,169, 1, 0, 0, 0, 0, 35, 0, -162, 0, 0, 0,174, 0, 0, 0, 0, 0, 35, 0,174, 0, 0, 0,169, 1, 0, 0, 0, 0, 35, 0,162, 0, 0, 0,169, 1, 0, 0, - 0, 0, 35, 0,163, 0, 0, 0,168, 1, 0, 0, 0, 0, 35, 0, 34, 1, 0, 0,168, 1, 0, 0, 0, 0, 35, 0,163, 0, 0, 0, - 34, 1, 0, 0, 0, 0, 35, 0, 39, 1, 0, 0,170, 1, 0, 0, 0, 0, 35, 0,187, 0, 0, 0,170, 1, 0, 0, 0, 0, 35, 0, -187, 0, 0, 0, 39, 1, 0, 0, 0, 0, 35, 0,170, 1, 0, 0,171, 1, 0, 0, 0, 0, 35, 0,170, 1, 0, 0,172, 1, 0, 0, - 0, 0, 35, 0,171, 1, 0, 0,172, 1, 0, 0, 0, 0, 35, 0,169, 0, 0, 0, 38, 1, 0, 0, 0, 0, 35, 0,169, 0, 0, 0, -172, 1, 0, 0, 0, 0, 35, 0, 38, 1, 0, 0,172, 1, 0, 0, 0, 0, 35, 0,168, 0, 0, 0,171, 1, 0, 0, 0, 0, 35, 0, -168, 0, 0, 0,186, 0, 0, 0, 0, 0, 35, 0,186, 0, 0, 0,171, 1, 0, 0, 0, 0, 35, 0, 38, 1, 0, 0,173, 1, 0, 0, - 0, 0, 35, 0, 40, 1, 0, 0,173, 1, 0, 0, 0, 0, 35, 0, 38, 1, 0, 0, 40, 1, 0, 0, 0, 0, 35, 0,173, 1, 0, 0, -174, 1, 0, 0, 0, 0, 35, 0,173, 1, 0, 0,175, 1, 0, 0, 0, 0, 35, 0,174, 1, 0, 0,175, 1, 0, 0, 0, 0, 35, 0, - 39, 1, 0, 0, 43, 1, 0, 0, 0, 0, 35, 0, 43, 1, 0, 0,175, 1, 0, 0, 0, 0, 35, 0, 39, 1, 0, 0,175, 1, 0, 0, - 0, 0, 35, 0, 42, 1, 0, 0,174, 1, 0, 0, 0, 0, 35, 0, 41, 1, 0, 0, 42, 1, 0, 0, 0, 0, 35, 0, 41, 1, 0, 0, -174, 1, 0, 0, 0, 0, 35, 0,184, 0, 0, 0,176, 1, 0, 0, 0, 0, 35, 0,188, 0, 0, 0,176, 1, 0, 0, 0, 0, 35, 0, -184, 0, 0, 0,188, 0, 0, 0, 0, 0, 35, 0,176, 1, 0, 0,177, 1, 0, 0, 0, 0, 35, 0,176, 1, 0, 0,178, 1, 0, 0, - 0, 0, 35, 0,177, 1, 0, 0,178, 1, 0, 0, 0, 0, 35, 0,185, 0, 0, 0, 42, 1, 0, 0, 0, 0, 35, 0, 42, 1, 0, 0, -178, 1, 0, 0, 0, 0, 35, 0,185, 0, 0, 0,178, 1, 0, 0, 0, 0, 35, 0, 43, 1, 0, 0,177, 1, 0, 0, 0, 0, 35, 0, -189, 0, 0, 0, 43, 1, 0, 0, 0, 0, 35, 0,189, 0, 0, 0,177, 1, 0, 0, 0, 0, 35, 0,183, 0, 0, 0,179, 1, 0, 0, - 0, 0, 35, 0, 41, 1, 0, 0,179, 1, 0, 0, 0, 0, 35, 0,183, 0, 0, 0, 41, 1, 0, 0, 0, 0, 35, 0,179, 1, 0, 0, -180, 1, 0, 0, 0, 0, 35, 0,179, 1, 0, 0,181, 1, 0, 0, 0, 0, 35, 0,180, 1, 0, 0,181, 1, 0, 0, 0, 0, 35, 0, -166, 0, 0, 0,182, 0, 0, 0, 0, 0, 35, 0,166, 0, 0, 0,181, 1, 0, 0, 0, 0, 35, 0,182, 0, 0, 0,181, 1, 0, 0, - 0, 0, 35, 0,167, 0, 0, 0,180, 1, 0, 0, 0, 0, 35, 0,167, 0, 0, 0, 40, 1, 0, 0, 0, 0, 35, 0, 40, 1, 0, 0, -180, 1, 0, 0, 0, 0, 35, 0, 45, 1, 0, 0,182, 1, 0, 0, 0, 0, 35, 0,195, 0, 0, 0,182, 1, 0, 0, 0, 0, 35, 0, -195, 0, 0, 0, 45, 1, 0, 0, 0, 0, 35, 0,182, 1, 0, 0,183, 1, 0, 0, 0, 0, 35, 0,182, 1, 0, 0,184, 1, 0, 0, - 0, 0, 35, 0,183, 1, 0, 0,184, 1, 0, 0, 0, 0, 35, 0,185, 0, 0, 0, 44, 1, 0, 0, 0, 0, 35, 0,185, 0, 0, 0, -184, 1, 0, 0, 0, 0, 35, 0, 44, 1, 0, 0,184, 1, 0, 0, 0, 0, 35, 0,184, 0, 0, 0,183, 1, 0, 0, 0, 0, 35, 0, -184, 0, 0, 0,194, 0, 0, 0, 0, 0, 35, 0,194, 0, 0, 0,183, 1, 0, 0, 0, 0, 35, 0, 44, 1, 0, 0,185, 1, 0, 0, - 0, 0, 35, 0, 46, 1, 0, 0,185, 1, 0, 0, 0, 0, 35, 0, 44, 1, 0, 0, 46, 1, 0, 0, 0, 0, 35, 0,185, 1, 0, 0, -186, 1, 0, 0, 0, 0, 35, 0,185, 1, 0, 0,187, 1, 0, 0, 0, 0, 35, 0,186, 1, 0, 0,187, 1, 0, 0, 0, 0, 35, 0, - 45, 1, 0, 0, 49, 1, 0, 0, 0, 0, 35, 0, 49, 1, 0, 0,187, 1, 0, 0, 0, 0, 35, 0, 45, 1, 0, 0,187, 1, 0, 0, - 0, 0, 35, 0, 48, 1, 0, 0,186, 1, 0, 0, 0, 0, 35, 0, 47, 1, 0, 0, 48, 1, 0, 0, 0, 0, 35, 0, 47, 1, 0, 0, -186, 1, 0, 0, 0, 0, 35, 0,192, 0, 0, 0,188, 1, 0, 0, 0, 0, 35, 0,196, 0, 0, 0,188, 1, 0, 0, 0, 0, 35, 0, -192, 0, 0, 0,196, 0, 0, 0, 0, 0, 35, 0,188, 1, 0, 0,189, 1, 0, 0, 0, 0, 35, 0,188, 1, 0, 0,190, 1, 0, 0, - 0, 0, 35, 0,189, 1, 0, 0,190, 1, 0, 0, 0, 0, 35, 0,193, 0, 0, 0, 48, 1, 0, 0, 0, 0, 35, 0, 48, 1, 0, 0, -190, 1, 0, 0, 0, 0, 35, 0,193, 0, 0, 0,190, 1, 0, 0, 0, 0, 35, 0, 49, 1, 0, 0,189, 1, 0, 0, 0, 0, 35, 0, -197, 0, 0, 0, 49, 1, 0, 0, 0, 0, 35, 0,197, 0, 0, 0,189, 1, 0, 0, 0, 0, 35, 0,191, 0, 0, 0,191, 1, 0, 0, - 0, 0, 35, 0, 47, 1, 0, 0,191, 1, 0, 0, 0, 0, 35, 0,191, 0, 0, 0, 47, 1, 0, 0, 0, 0, 35, 0,191, 1, 0, 0, -192, 1, 0, 0, 0, 0, 35, 0,191, 1, 0, 0,193, 1, 0, 0, 0, 0, 35, 0,192, 1, 0, 0,193, 1, 0, 0, 0, 0, 35, 0, -182, 0, 0, 0,190, 0, 0, 0, 0, 0, 35, 0,182, 0, 0, 0,193, 1, 0, 0, 0, 0, 35, 0,190, 0, 0, 0,193, 1, 0, 0, - 0, 0, 35, 0,183, 0, 0, 0,192, 1, 0, 0, 0, 0, 35, 0,183, 0, 0, 0, 46, 1, 0, 0, 0, 0, 35, 0, 46, 1, 0, 0, -192, 1, 0, 0, 0, 0, 35, 0, 51, 1, 0, 0,194, 1, 0, 0, 0, 0, 35, 0,199, 0, 0, 0,194, 1, 0, 0, 0, 0, 35, 0, -199, 0, 0, 0, 51, 1, 0, 0, 0, 0, 35, 0,194, 1, 0, 0,195, 1, 0, 0, 0, 0, 35, 0,194, 1, 0, 0,196, 1, 0, 0, - 0, 0, 35, 0,195, 1, 0, 0,196, 1, 0, 0, 0, 0, 35, 0,193, 0, 0, 0, 50, 1, 0, 0, 0, 0, 35, 0,193, 0, 0, 0, -196, 1, 0, 0, 0, 0, 35, 0, 50, 1, 0, 0,196, 1, 0, 0, 0, 0, 35, 0,192, 0, 0, 0,195, 1, 0, 0, 0, 0, 35, 0, -192, 0, 0, 0,198, 0, 0, 0, 0, 0, 35, 0,198, 0, 0, 0,195, 1, 0, 0, 0, 0, 35, 0, 50, 1, 0, 0,197, 1, 0, 0, - 0, 0, 35, 0, 53, 1, 0, 0,197, 1, 0, 0, 0, 0, 35, 0, 50, 1, 0, 0, 53, 1, 0, 0, 0, 0, 35, 0,197, 1, 0, 0, -198, 1, 0, 0, 0, 0, 35, 0,197, 1, 0, 0,199, 1, 0, 0, 0, 0, 35, 0,198, 1, 0, 0,199, 1, 0, 0, 0, 0, 35, 0, - 51, 1, 0, 0, 55, 1, 0, 0, 0, 0, 35, 0, 55, 1, 0, 0,199, 1, 0, 0, 0, 0, 35, 0, 51, 1, 0, 0,199, 1, 0, 0, - 0, 0, 35, 0, 54, 1, 0, 0,198, 1, 0, 0, 0, 0, 35, 0, 52, 1, 0, 0, 54, 1, 0, 0, 0, 0, 35, 0, 52, 1, 0, 0, -198, 1, 0, 0, 0, 0, 35, 0,176, 0, 0, 0,200, 1, 0, 0, 0, 0, 35, 0,200, 0, 0, 0,200, 1, 0, 0, 0, 0, 35, 0, -176, 0, 0, 0,200, 0, 0, 0, 0, 0, 35, 0,200, 1, 0, 0,201, 1, 0, 0, 0, 0, 35, 0,200, 1, 0, 0,202, 1, 0, 0, - 0, 0, 35, 0,201, 1, 0, 0,202, 1, 0, 0, 0, 0, 35, 0,177, 0, 0, 0, 54, 1, 0, 0, 0, 0, 35, 0, 54, 1, 0, 0, -202, 1, 0, 0, 0, 0, 35, 0,177, 0, 0, 0,202, 1, 0, 0, 0, 0, 35, 0, 55, 1, 0, 0,201, 1, 0, 0, 0, 0, 35, 0, -201, 0, 0, 0, 55, 1, 0, 0, 0, 0, 35, 0,201, 0, 0, 0,201, 1, 0, 0, 0, 0, 35, 0,175, 0, 0, 0,203, 1, 0, 0, - 0, 0, 35, 0, 52, 1, 0, 0,203, 1, 0, 0, 0, 0, 35, 0,175, 0, 0, 0, 52, 1, 0, 0, 0, 0, 35, 0,203, 1, 0, 0, -204, 1, 0, 0, 0, 0, 35, 0,203, 1, 0, 0,205, 1, 0, 0, 0, 0, 35, 0,204, 1, 0, 0,205, 1, 0, 0, 0, 0, 35, 0, -174, 0, 0, 0,190, 0, 0, 0, 0, 0, 35, 0,190, 0, 0, 0,205, 1, 0, 0, 0, 0, 35, 0,174, 0, 0, 0,205, 1, 0, 0, - 0, 0, 35, 0,191, 0, 0, 0,204, 1, 0, 0, 0, 0, 35, 0,191, 0, 0, 0, 53, 1, 0, 0, 0, 0, 35, 0, 53, 1, 0, 0, -204, 1, 0, 0, 0, 0, 35, 0, 57, 1, 0, 0,206, 1, 0, 0, 0, 0, 35, 0,207, 0, 0, 0, 57, 1, 0, 0, 0, 0, 35, 0, -207, 0, 0, 0,206, 1, 0, 0, 0, 0, 35, 0,206, 1, 0, 0,207, 1, 0, 0, 0, 0, 35, 0,207, 1, 0, 0,208, 1, 0, 0, - 0, 0, 35, 0,206, 1, 0, 0,208, 1, 0, 0, 0, 0, 35, 0,179, 0, 0, 0, 56, 1, 0, 0, 0, 0, 35, 0, 56, 1, 0, 0, -208, 1, 0, 0, 0, 0, 35, 0,179, 0, 0, 0,208, 1, 0, 0, 0, 0, 35, 0,178, 0, 0, 0,207, 1, 0, 0, 0, 0, 35, 0, -206, 0, 0, 0,207, 1, 0, 0, 0, 0, 35, 0,178, 0, 0, 0,206, 0, 0, 0, 0, 0, 35, 0, 56, 1, 0, 0,209, 1, 0, 0, - 0, 0, 35, 0, 56, 1, 0, 0, 58, 1, 0, 0, 0, 0, 35, 0, 58, 1, 0, 0,209, 1, 0, 0, 0, 0, 35, 0,209, 1, 0, 0, -210, 1, 0, 0, 0, 0, 35, 0,210, 1, 0, 0,211, 1, 0, 0, 0, 0, 35, 0,209, 1, 0, 0,211, 1, 0, 0, 0, 0, 35, 0, - 57, 1, 0, 0, 61, 1, 0, 0, 0, 0, 35, 0, 57, 1, 0, 0,211, 1, 0, 0, 0, 0, 35, 0, 61, 1, 0, 0,211, 1, 0, 0, - 0, 0, 35, 0, 60, 1, 0, 0,210, 1, 0, 0, 0, 0, 35, 0, 59, 1, 0, 0,210, 1, 0, 0, 0, 0, 35, 0, 59, 1, 0, 0, - 60, 1, 0, 0, 0, 0, 35, 0,204, 0, 0, 0,212, 1, 0, 0, 0, 0, 35, 0,204, 0, 0, 0,208, 0, 0, 0, 0, 0, 35, 0, -208, 0, 0, 0,212, 1, 0, 0, 0, 0, 35, 0,212, 1, 0, 0,213, 1, 0, 0, 0, 0, 35, 0,213, 1, 0, 0,214, 1, 0, 0, - 0, 0, 35, 0,212, 1, 0, 0,214, 1, 0, 0, 0, 0, 35, 0,205, 0, 0, 0, 60, 1, 0, 0, 0, 0, 35, 0,205, 0, 0, 0, -214, 1, 0, 0, 0, 0, 35, 0, 60, 1, 0, 0,214, 1, 0, 0, 0, 0, 35, 0, 61, 1, 0, 0,213, 1, 0, 0, 0, 0, 35, 0, -209, 0, 0, 0,213, 1, 0, 0, 0, 0, 35, 0,209, 0, 0, 0, 61, 1, 0, 0, 0, 0, 35, 0,203, 0, 0, 0,215, 1, 0, 0, - 0, 0, 35, 0,203, 0, 0, 0, 59, 1, 0, 0, 0, 0, 35, 0, 59, 1, 0, 0,215, 1, 0, 0, 0, 0, 35, 0,215, 1, 0, 0, -216, 1, 0, 0, 0, 0, 35, 0,216, 1, 0, 0,217, 1, 0, 0, 0, 0, 35, 0,215, 1, 0, 0,217, 1, 0, 0, 0, 0, 35, 0, -180, 0, 0, 0,202, 0, 0, 0, 0, 0, 35, 0,202, 0, 0, 0,217, 1, 0, 0, 0, 0, 35, 0,180, 0, 0, 0,217, 1, 0, 0, - 0, 0, 35, 0,181, 0, 0, 0,216, 1, 0, 0, 0, 0, 35, 0, 58, 1, 0, 0,216, 1, 0, 0, 0, 0, 35, 0,181, 0, 0, 0, - 58, 1, 0, 0, 0, 0, 35, 0, 63, 1, 0, 0,218, 1, 0, 0, 0, 0, 35, 0,215, 0, 0, 0, 63, 1, 0, 0, 0, 0, 35, 0, -215, 0, 0, 0,218, 1, 0, 0, 0, 0, 35, 0,218, 1, 0, 0,219, 1, 0, 0, 0, 0, 35, 0,219, 1, 0, 0,220, 1, 0, 0, - 0, 0, 35, 0,218, 1, 0, 0,220, 1, 0, 0, 0, 0, 35, 0,173, 0, 0, 0, 62, 1, 0, 0, 0, 0, 35, 0, 62, 1, 0, 0, -220, 1, 0, 0, 0, 0, 35, 0,173, 0, 0, 0,220, 1, 0, 0, 0, 0, 35, 0,172, 0, 0, 0,219, 1, 0, 0, 0, 0, 35, 0, -214, 0, 0, 0,219, 1, 0, 0, 0, 0, 35, 0,172, 0, 0, 0,214, 0, 0, 0, 0, 0, 35, 0, 62, 1, 0, 0,221, 1, 0, 0, - 0, 0, 35, 0, 62, 1, 0, 0, 64, 1, 0, 0, 0, 0, 35, 0, 64, 1, 0, 0,221, 1, 0, 0, 0, 0, 35, 0,221, 1, 0, 0, -222, 1, 0, 0, 0, 0, 35, 0,222, 1, 0, 0,223, 1, 0, 0, 0, 0, 35, 0,221, 1, 0, 0,223, 1, 0, 0, 0, 0, 35, 0, - 63, 1, 0, 0, 67, 1, 0, 0, 0, 0, 35, 0, 63, 1, 0, 0,223, 1, 0, 0, 0, 0, 35, 0, 67, 1, 0, 0,223, 1, 0, 0, - 0, 0, 35, 0, 66, 1, 0, 0,222, 1, 0, 0, 0, 0, 35, 0, 65, 1, 0, 0,222, 1, 0, 0, 0, 0, 35, 0, 65, 1, 0, 0, - 66, 1, 0, 0, 0, 0, 35, 0,212, 0, 0, 0,224, 1, 0, 0, 0, 0, 35, 0,212, 0, 0, 0,216, 0, 0, 0, 0, 0, 35, 0, -216, 0, 0, 0,224, 1, 0, 0, 0, 0, 35, 0,224, 1, 0, 0,225, 1, 0, 0, 0, 0, 35, 0,225, 1, 0, 0,226, 1, 0, 0, - 0, 0, 35, 0,224, 1, 0, 0,226, 1, 0, 0, 0, 0, 35, 0,213, 0, 0, 0, 66, 1, 0, 0, 0, 0, 35, 0,213, 0, 0, 0, -226, 1, 0, 0, 0, 0, 35, 0, 66, 1, 0, 0,226, 1, 0, 0, 0, 0, 35, 0, 67, 1, 0, 0,225, 1, 0, 0, 0, 0, 35, 0, -217, 0, 0, 0,225, 1, 0, 0, 0, 0, 35, 0,217, 0, 0, 0, 67, 1, 0, 0, 0, 0, 35, 0,211, 0, 0, 0,227, 1, 0, 0, - 0, 0, 35, 0,211, 0, 0, 0, 65, 1, 0, 0, 0, 0, 35, 0, 65, 1, 0, 0,227, 1, 0, 0, 0, 0, 35, 0,227, 1, 0, 0, -228, 1, 0, 0, 0, 0, 35, 0,228, 1, 0, 0,229, 1, 0, 0, 0, 0, 35, 0,227, 1, 0, 0,229, 1, 0, 0, 0, 0, 35, 0, -170, 0, 0, 0,210, 0, 0, 0, 0, 0, 35, 0,210, 0, 0, 0,229, 1, 0, 0, 0, 0, 35, 0,170, 0, 0, 0,229, 1, 0, 0, - 0, 0, 35, 0,171, 0, 0, 0,228, 1, 0, 0, 0, 0, 35, 0, 64, 1, 0, 0,228, 1, 0, 0, 0, 0, 35, 0,171, 0, 0, 0, - 64, 1, 0, 0, 0, 0, 35, 0, 69, 1, 0, 0,230, 1, 0, 0, 0, 0, 35, 0,223, 0, 0, 0, 69, 1, 0, 0, 0, 0, 35, 0, -223, 0, 0, 0,230, 1, 0, 0, 0, 0, 35, 0,230, 1, 0, 0,231, 1, 0, 0, 0, 0, 35, 0,231, 1, 0, 0,232, 1, 0, 0, - 0, 0, 35, 0,230, 1, 0, 0,232, 1, 0, 0, 0, 0, 35, 0,189, 0, 0, 0, 68, 1, 0, 0, 0, 0, 35, 0, 68, 1, 0, 0, -232, 1, 0, 0, 0, 0, 35, 0,189, 0, 0, 0,232, 1, 0, 0, 0, 0, 35, 0,188, 0, 0, 0,231, 1, 0, 0, 0, 0, 35, 0, -222, 0, 0, 0,231, 1, 0, 0, 0, 0, 35, 0,188, 0, 0, 0,222, 0, 0, 0, 0, 0, 35, 0, 68, 1, 0, 0,233, 1, 0, 0, - 0, 0, 35, 0, 68, 1, 0, 0, 70, 1, 0, 0, 0, 0, 35, 0, 70, 1, 0, 0,233, 1, 0, 0, 0, 0, 35, 0,233, 1, 0, 0, -234, 1, 0, 0, 0, 0, 35, 0,234, 1, 0, 0,235, 1, 0, 0, 0, 0, 35, 0,233, 1, 0, 0,235, 1, 0, 0, 0, 0, 35, 0, - 69, 1, 0, 0, 73, 1, 0, 0, 0, 0, 35, 0, 69, 1, 0, 0,235, 1, 0, 0, 0, 0, 35, 0, 73, 1, 0, 0,235, 1, 0, 0, - 0, 0, 35, 0, 72, 1, 0, 0,234, 1, 0, 0, 0, 0, 35, 0, 71, 1, 0, 0,234, 1, 0, 0, 0, 0, 35, 0, 71, 1, 0, 0, - 72, 1, 0, 0, 0, 0, 35, 0,220, 0, 0, 0,236, 1, 0, 0, 0, 0, 35, 0,220, 0, 0, 0,224, 0, 0, 0, 0, 0, 35, 0, -224, 0, 0, 0,236, 1, 0, 0, 0, 0, 35, 0,236, 1, 0, 0,237, 1, 0, 0, 0, 0, 35, 0,237, 1, 0, 0,238, 1, 0, 0, - 0, 0, 35, 0,236, 1, 0, 0,238, 1, 0, 0, 0, 0, 35, 0,221, 0, 0, 0, 72, 1, 0, 0, 0, 0, 35, 0,221, 0, 0, 0, -238, 1, 0, 0, 0, 0, 35, 0, 72, 1, 0, 0,238, 1, 0, 0, 0, 0, 35, 0, 73, 1, 0, 0,237, 1, 0, 0, 0, 0, 35, 0, -225, 0, 0, 0,237, 1, 0, 0, 0, 0, 35, 0,225, 0, 0, 0, 73, 1, 0, 0, 0, 0, 35, 0,219, 0, 0, 0,239, 1, 0, 0, - 0, 0, 35, 0,219, 0, 0, 0, 71, 1, 0, 0, 0, 0, 35, 0, 71, 1, 0, 0,239, 1, 0, 0, 0, 0, 35, 0,239, 1, 0, 0, -240, 1, 0, 0, 0, 0, 35, 0,240, 1, 0, 0,241, 1, 0, 0, 0, 0, 35, 0,239, 1, 0, 0,241, 1, 0, 0, 0, 0, 35, 0, -186, 0, 0, 0,218, 0, 0, 0, 0, 0, 35, 0,218, 0, 0, 0,241, 1, 0, 0, 0, 0, 35, 0,186, 0, 0, 0,241, 1, 0, 0, - 0, 0, 35, 0,187, 0, 0, 0,240, 1, 0, 0, 0, 0, 35, 0, 70, 1, 0, 0,240, 1, 0, 0, 0, 0, 35, 0,187, 0, 0, 0, - 70, 1, 0, 0, 0, 0, 35, 0, 75, 1, 0, 0,242, 1, 0, 0, 0, 0, 35, 0,231, 0, 0, 0, 75, 1, 0, 0, 0, 0, 35, 0, -231, 0, 0, 0,242, 1, 0, 0, 0, 0, 35, 0,242, 1, 0, 0,243, 1, 0, 0, 0, 0, 35, 0,243, 1, 0, 0,244, 1, 0, 0, - 0, 0, 35, 0,242, 1, 0, 0,244, 1, 0, 0, 0, 0, 35, 0,197, 0, 0, 0, 74, 1, 0, 0, 0, 0, 35, 0, 74, 1, 0, 0, -244, 1, 0, 0, 0, 0, 35, 0,197, 0, 0, 0,244, 1, 0, 0, 0, 0, 35, 0,196, 0, 0, 0,243, 1, 0, 0, 0, 0, 35, 0, -230, 0, 0, 0,243, 1, 0, 0, 0, 0, 35, 0,196, 0, 0, 0,230, 0, 0, 0, 0, 0, 35, 0, 74, 1, 0, 0,245, 1, 0, 0, - 0, 0, 35, 0, 74, 1, 0, 0, 76, 1, 0, 0, 0, 0, 35, 0, 76, 1, 0, 0,245, 1, 0, 0, 0, 0, 35, 0,245, 1, 0, 0, -246, 1, 0, 0, 0, 0, 35, 0,246, 1, 0, 0,247, 1, 0, 0, 0, 0, 35, 0,245, 1, 0, 0,247, 1, 0, 0, 0, 0, 35, 0, - 75, 1, 0, 0, 79, 1, 0, 0, 0, 0, 35, 0, 75, 1, 0, 0,247, 1, 0, 0, 0, 0, 35, 0, 79, 1, 0, 0,247, 1, 0, 0, - 0, 0, 35, 0, 78, 1, 0, 0,246, 1, 0, 0, 0, 0, 35, 0, 77, 1, 0, 0,246, 1, 0, 0, 0, 0, 35, 0, 77, 1, 0, 0, - 78, 1, 0, 0, 0, 0, 35, 0,228, 0, 0, 0,248, 1, 0, 0, 0, 0, 35, 0,228, 0, 0, 0,232, 0, 0, 0, 0, 0, 35, 0, -232, 0, 0, 0,248, 1, 0, 0, 0, 0, 35, 0,248, 1, 0, 0,249, 1, 0, 0, 0, 0, 35, 0,249, 1, 0, 0,250, 1, 0, 0, - 0, 0, 35, 0,248, 1, 0, 0,250, 1, 0, 0, 0, 0, 35, 0,229, 0, 0, 0, 78, 1, 0, 0, 0, 0, 35, 0,229, 0, 0, 0, -250, 1, 0, 0, 0, 0, 35, 0, 78, 1, 0, 0,250, 1, 0, 0, 0, 0, 35, 0, 79, 1, 0, 0,249, 1, 0, 0, 0, 0, 35, 0, -233, 0, 0, 0,249, 1, 0, 0, 0, 0, 35, 0,233, 0, 0, 0, 79, 1, 0, 0, 0, 0, 35, 0,227, 0, 0, 0,251, 1, 0, 0, - 0, 0, 35, 0,227, 0, 0, 0, 77, 1, 0, 0, 0, 0, 35, 0, 77, 1, 0, 0,251, 1, 0, 0, 0, 0, 35, 0,251, 1, 0, 0, -252, 1, 0, 0, 0, 0, 35, 0,252, 1, 0, 0,253, 1, 0, 0, 0, 0, 35, 0,251, 1, 0, 0,253, 1, 0, 0, 0, 0, 35, 0, -194, 0, 0, 0,226, 0, 0, 0, 0, 0, 35, 0,226, 0, 0, 0,253, 1, 0, 0, 0, 0, 35, 0,194, 0, 0, 0,253, 1, 0, 0, - 0, 0, 35, 0,195, 0, 0, 0,252, 1, 0, 0, 0, 0, 35, 0, 76, 1, 0, 0,252, 1, 0, 0, 0, 0, 35, 0,195, 0, 0, 0, - 76, 1, 0, 0, 0, 0, 35, 0, 81, 1, 0, 0,254, 1, 0, 0, 0, 0, 35, 0,239, 0, 0, 0, 81, 1, 0, 0, 0, 0, 35, 0, -239, 0, 0, 0,254, 1, 0, 0, 0, 0, 35, 0,254, 1, 0, 0,255, 1, 0, 0, 0, 0, 35, 0,255, 1, 0, 0, 0, 2, 0, 0, - 0, 0, 35, 0,254, 1, 0, 0, 0, 2, 0, 0, 0, 0, 35, 0,201, 0, 0, 0, 80, 1, 0, 0, 0, 0, 35, 0, 80, 1, 0, 0, - 0, 2, 0, 0, 0, 0, 35, 0,201, 0, 0, 0, 0, 2, 0, 0, 0, 0, 35, 0,200, 0, 0, 0,255, 1, 0, 0, 0, 0, 35, 0, -238, 0, 0, 0,255, 1, 0, 0, 0, 0, 35, 0,200, 0, 0, 0,238, 0, 0, 0, 0, 0, 35, 0, 80, 1, 0, 0, 1, 2, 0, 0, - 0, 0, 35, 0, 80, 1, 0, 0, 82, 1, 0, 0, 0, 0, 35, 0, 82, 1, 0, 0, 1, 2, 0, 0, 0, 0, 35, 0, 1, 2, 0, 0, - 2, 2, 0, 0, 0, 0, 35, 0, 2, 2, 0, 0, 3, 2, 0, 0, 0, 0, 35, 0, 1, 2, 0, 0, 3, 2, 0, 0, 0, 0, 35, 0, - 81, 1, 0, 0, 85, 1, 0, 0, 0, 0, 35, 0, 81, 1, 0, 0, 3, 2, 0, 0, 0, 0, 35, 0, 85, 1, 0, 0, 3, 2, 0, 0, - 0, 0, 35, 0, 84, 1, 0, 0, 2, 2, 0, 0, 0, 0, 35, 0, 83, 1, 0, 0, 2, 2, 0, 0, 0, 0, 35, 0, 83, 1, 0, 0, - 84, 1, 0, 0, 0, 0, 35, 0,236, 0, 0, 0, 4, 2, 0, 0, 0, 0, 35, 0,236, 0, 0, 0,240, 0, 0, 0, 0, 0, 35, 0, -240, 0, 0, 0, 4, 2, 0, 0, 0, 0, 35, 0, 4, 2, 0, 0, 5, 2, 0, 0, 0, 0, 35, 0, 5, 2, 0, 0, 6, 2, 0, 0, - 0, 0, 35, 0, 4, 2, 0, 0, 6, 2, 0, 0, 0, 0, 35, 0,237, 0, 0, 0, 84, 1, 0, 0, 0, 0, 35, 0,237, 0, 0, 0, - 6, 2, 0, 0, 0, 0, 35, 0, 84, 1, 0, 0, 6, 2, 0, 0, 0, 0, 35, 0, 85, 1, 0, 0, 5, 2, 0, 0, 0, 0, 35, 0, -241, 0, 0, 0, 5, 2, 0, 0, 0, 0, 35, 0,241, 0, 0, 0, 85, 1, 0, 0, 0, 0, 35, 0,235, 0, 0, 0, 7, 2, 0, 0, - 0, 0, 35, 0,235, 0, 0, 0, 83, 1, 0, 0, 0, 0, 35, 0, 83, 1, 0, 0, 7, 2, 0, 0, 0, 0, 35, 0, 7, 2, 0, 0, - 8, 2, 0, 0, 0, 0, 35, 0, 8, 2, 0, 0, 9, 2, 0, 0, 0, 0, 35, 0, 7, 2, 0, 0, 9, 2, 0, 0, 0, 0, 35, 0, -198, 0, 0, 0,234, 0, 0, 0, 0, 0, 35, 0,234, 0, 0, 0, 9, 2, 0, 0, 0, 0, 35, 0,198, 0, 0, 0, 9, 2, 0, 0, - 0, 0, 35, 0,199, 0, 0, 0, 8, 2, 0, 0, 0, 0, 35, 0, 82, 1, 0, 0, 8, 2, 0, 0, 0, 0, 35, 0,199, 0, 0, 0, - 82, 1, 0, 0, 0, 0, 35, 0, 87, 1, 0, 0, 10, 2, 0, 0, 0, 0, 35, 0,245, 0, 0, 0, 10, 2, 0, 0, 0, 0, 35, 0, -245, 0, 0, 0, 87, 1, 0, 0, 0, 0, 35, 0, 10, 2, 0, 0, 11, 2, 0, 0, 0, 0, 35, 0, 10, 2, 0, 0, 12, 2, 0, 0, - 0, 0, 35, 0, 11, 2, 0, 0, 12, 2, 0, 0, 0, 0, 35, 0,209, 0, 0, 0, 86, 1, 0, 0, 0, 0, 35, 0,209, 0, 0, 0, - 12, 2, 0, 0, 0, 0, 35, 0, 86, 1, 0, 0, 12, 2, 0, 0, 0, 0, 35, 0,208, 0, 0, 0, 11, 2, 0, 0, 0, 0, 35, 0, -208, 0, 0, 0,244, 0, 0, 0, 0, 0, 35, 0,244, 0, 0, 0, 11, 2, 0, 0, 0, 0, 35, 0, 86, 1, 0, 0, 13, 2, 0, 0, - 0, 0, 35, 0, 88, 1, 0, 0, 13, 2, 0, 0, 0, 0, 35, 0, 86, 1, 0, 0, 88, 1, 0, 0, 0, 0, 35, 0, 13, 2, 0, 0, - 14, 2, 0, 0, 0, 0, 35, 0, 13, 2, 0, 0, 15, 2, 0, 0, 0, 0, 35, 0, 14, 2, 0, 0, 15, 2, 0, 0, 0, 0, 35, 0, - 87, 1, 0, 0, 91, 1, 0, 0, 0, 0, 35, 0, 91, 1, 0, 0, 15, 2, 0, 0, 0, 0, 35, 0, 87, 1, 0, 0, 15, 2, 0, 0, - 0, 0, 35, 0, 90, 1, 0, 0, 14, 2, 0, 0, 0, 0, 35, 0, 89, 1, 0, 0, 90, 1, 0, 0, 0, 0, 35, 0, 89, 1, 0, 0, - 14, 2, 0, 0, 0, 0, 35, 0,212, 0, 0, 0, 16, 2, 0, 0, 0, 0, 35, 0,242, 0, 0, 0, 16, 2, 0, 0, 0, 0, 35, 0, -212, 0, 0, 0,242, 0, 0, 0, 0, 0, 35, 0, 16, 2, 0, 0, 17, 2, 0, 0, 0, 0, 35, 0, 16, 2, 0, 0, 18, 2, 0, 0, - 0, 0, 35, 0, 17, 2, 0, 0, 18, 2, 0, 0, 0, 0, 35, 0,213, 0, 0, 0, 90, 1, 0, 0, 0, 0, 35, 0, 90, 1, 0, 0, - 18, 2, 0, 0, 0, 0, 35, 0,213, 0, 0, 0, 18, 2, 0, 0, 0, 0, 35, 0, 91, 1, 0, 0, 17, 2, 0, 0, 0, 0, 35, 0, -243, 0, 0, 0, 91, 1, 0, 0, 0, 0, 35, 0,243, 0, 0, 0, 17, 2, 0, 0, 0, 0, 35, 0,211, 0, 0, 0, 19, 2, 0, 0, - 0, 0, 35, 0, 89, 1, 0, 0, 19, 2, 0, 0, 0, 0, 35, 0,211, 0, 0, 0, 89, 1, 0, 0, 0, 0, 35, 0, 19, 2, 0, 0, - 20, 2, 0, 0, 0, 0, 35, 0, 19, 2, 0, 0, 21, 2, 0, 0, 0, 0, 35, 0, 20, 2, 0, 0, 21, 2, 0, 0, 0, 0, 35, 0, -206, 0, 0, 0,210, 0, 0, 0, 0, 0, 35, 0,206, 0, 0, 0, 21, 2, 0, 0, 0, 0, 35, 0,210, 0, 0, 0, 21, 2, 0, 0, - 0, 0, 35, 0,207, 0, 0, 0, 20, 2, 0, 0, 0, 0, 35, 0,207, 0, 0, 0, 88, 1, 0, 0, 0, 0, 35, 0, 88, 1, 0, 0, - 20, 2, 0, 0, 0, 0, 35, 0, 93, 1, 0, 0, 22, 2, 0, 0, 0, 0, 35, 0,247, 0, 0, 0, 22, 2, 0, 0, 0, 0, 35, 0, -247, 0, 0, 0, 93, 1, 0, 0, 0, 0, 35, 0, 22, 2, 0, 0, 23, 2, 0, 0, 0, 0, 35, 0, 22, 2, 0, 0, 24, 2, 0, 0, - 0, 0, 35, 0, 23, 2, 0, 0, 24, 2, 0, 0, 0, 0, 35, 0,217, 0, 0, 0, 92, 1, 0, 0, 0, 0, 35, 0,217, 0, 0, 0, - 24, 2, 0, 0, 0, 0, 35, 0, 92, 1, 0, 0, 24, 2, 0, 0, 0, 0, 35, 0,216, 0, 0, 0, 23, 2, 0, 0, 0, 0, 35, 0, -216, 0, 0, 0,246, 0, 0, 0, 0, 0, 35, 0,246, 0, 0, 0, 23, 2, 0, 0, 0, 0, 35, 0, 92, 1, 0, 0, 25, 2, 0, 0, - 0, 0, 35, 0, 94, 1, 0, 0, 25, 2, 0, 0, 0, 0, 35, 0, 92, 1, 0, 0, 94, 1, 0, 0, 0, 0, 35, 0, 25, 2, 0, 0, - 26, 2, 0, 0, 0, 0, 35, 0, 25, 2, 0, 0, 27, 2, 0, 0, 0, 0, 35, 0, 26, 2, 0, 0, 27, 2, 0, 0, 0, 0, 35, 0, - 93, 1, 0, 0, 97, 1, 0, 0, 0, 0, 35, 0, 97, 1, 0, 0, 27, 2, 0, 0, 0, 0, 35, 0, 93, 1, 0, 0, 27, 2, 0, 0, - 0, 0, 35, 0, 96, 1, 0, 0, 26, 2, 0, 0, 0, 0, 35, 0, 95, 1, 0, 0, 96, 1, 0, 0, 0, 0, 35, 0, 95, 1, 0, 0, - 26, 2, 0, 0, 0, 0, 35, 0,220, 0, 0, 0, 28, 2, 0, 0, 0, 0, 35, 0,248, 0, 0, 0, 28, 2, 0, 0, 0, 0, 35, 0, -220, 0, 0, 0,248, 0, 0, 0, 0, 0, 35, 0, 28, 2, 0, 0, 29, 2, 0, 0, 0, 0, 35, 0, 28, 2, 0, 0, 30, 2, 0, 0, - 0, 0, 35, 0, 29, 2, 0, 0, 30, 2, 0, 0, 0, 0, 35, 0,221, 0, 0, 0, 96, 1, 0, 0, 0, 0, 35, 0, 96, 1, 0, 0, - 30, 2, 0, 0, 0, 0, 35, 0,221, 0, 0, 0, 30, 2, 0, 0, 0, 0, 35, 0, 97, 1, 0, 0, 29, 2, 0, 0, 0, 0, 35, 0, -249, 0, 0, 0, 97, 1, 0, 0, 0, 0, 35, 0,249, 0, 0, 0, 29, 2, 0, 0, 0, 0, 35, 0,219, 0, 0, 0, 31, 2, 0, 0, - 0, 0, 35, 0, 95, 1, 0, 0, 31, 2, 0, 0, 0, 0, 35, 0,219, 0, 0, 0, 95, 1, 0, 0, 0, 0, 35, 0, 31, 2, 0, 0, - 32, 2, 0, 0, 0, 0, 35, 0, 31, 2, 0, 0, 33, 2, 0, 0, 0, 0, 35, 0, 32, 2, 0, 0, 33, 2, 0, 0, 0, 0, 35, 0, -214, 0, 0, 0,218, 0, 0, 0, 0, 0, 35, 0,214, 0, 0, 0, 33, 2, 0, 0, 0, 0, 35, 0,218, 0, 0, 0, 33, 2, 0, 0, - 0, 0, 35, 0,215, 0, 0, 0, 32, 2, 0, 0, 0, 0, 35, 0,215, 0, 0, 0, 94, 1, 0, 0, 0, 0, 35, 0, 94, 1, 0, 0, - 32, 2, 0, 0, 0, 0, 35, 0, 99, 1, 0, 0, 34, 2, 0, 0, 0, 0, 35, 0,251, 0, 0, 0, 34, 2, 0, 0, 0, 0, 35, 0, -251, 0, 0, 0, 99, 1, 0, 0, 0, 0, 35, 0, 34, 2, 0, 0, 35, 2, 0, 0, 0, 0, 35, 0, 34, 2, 0, 0, 36, 2, 0, 0, - 0, 0, 35, 0, 35, 2, 0, 0, 36, 2, 0, 0, 0, 0, 35, 0,225, 0, 0, 0, 98, 1, 0, 0, 0, 0, 35, 0,225, 0, 0, 0, - 36, 2, 0, 0, 0, 0, 35, 0, 98, 1, 0, 0, 36, 2, 0, 0, 0, 0, 35, 0,224, 0, 0, 0, 35, 2, 0, 0, 0, 0, 35, 0, -224, 0, 0, 0,250, 0, 0, 0, 0, 0, 35, 0,250, 0, 0, 0, 35, 2, 0, 0, 0, 0, 35, 0, 98, 1, 0, 0, 37, 2, 0, 0, - 0, 0, 35, 0,100, 1, 0, 0, 37, 2, 0, 0, 0, 0, 35, 0, 98, 1, 0, 0,100, 1, 0, 0, 0, 0, 35, 0, 37, 2, 0, 0, - 38, 2, 0, 0, 0, 0, 35, 0, 37, 2, 0, 0, 39, 2, 0, 0, 0, 0, 35, 0, 38, 2, 0, 0, 39, 2, 0, 0, 0, 0, 35, 0, - 99, 1, 0, 0,103, 1, 0, 0, 0, 0, 35, 0,103, 1, 0, 0, 39, 2, 0, 0, 0, 0, 35, 0, 99, 1, 0, 0, 39, 2, 0, 0, - 0, 0, 35, 0,102, 1, 0, 0, 38, 2, 0, 0, 0, 0, 35, 0,101, 1, 0, 0,102, 1, 0, 0, 0, 0, 35, 0,101, 1, 0, 0, - 38, 2, 0, 0, 0, 0, 35, 0,228, 0, 0, 0, 40, 2, 0, 0, 0, 0, 35, 0,252, 0, 0, 0, 40, 2, 0, 0, 0, 0, 35, 0, -228, 0, 0, 0,252, 0, 0, 0, 0, 0, 35, 0, 40, 2, 0, 0, 41, 2, 0, 0, 0, 0, 35, 0, 40, 2, 0, 0, 42, 2, 0, 0, - 0, 0, 35, 0, 41, 2, 0, 0, 42, 2, 0, 0, 0, 0, 35, 0,229, 0, 0, 0,102, 1, 0, 0, 0, 0, 35, 0,102, 1, 0, 0, - 42, 2, 0, 0, 0, 0, 35, 0,229, 0, 0, 0, 42, 2, 0, 0, 0, 0, 35, 0,103, 1, 0, 0, 41, 2, 0, 0, 0, 0, 35, 0, -253, 0, 0, 0,103, 1, 0, 0, 0, 0, 35, 0,253, 0, 0, 0, 41, 2, 0, 0, 0, 0, 35, 0,227, 0, 0, 0, 43, 2, 0, 0, - 0, 0, 35, 0,101, 1, 0, 0, 43, 2, 0, 0, 0, 0, 35, 0,227, 0, 0, 0,101, 1, 0, 0, 0, 0, 35, 0, 43, 2, 0, 0, - 44, 2, 0, 0, 0, 0, 35, 0, 43, 2, 0, 0, 45, 2, 0, 0, 0, 0, 35, 0, 44, 2, 0, 0, 45, 2, 0, 0, 0, 0, 35, 0, -222, 0, 0, 0,226, 0, 0, 0, 0, 0, 35, 0,222, 0, 0, 0, 45, 2, 0, 0, 0, 0, 35, 0,226, 0, 0, 0, 45, 2, 0, 0, - 0, 0, 35, 0,223, 0, 0, 0, 44, 2, 0, 0, 0, 0, 35, 0,223, 0, 0, 0,100, 1, 0, 0, 0, 0, 35, 0,100, 1, 0, 0, - 44, 2, 0, 0, 0, 0, 35, 0,105, 1, 0, 0, 46, 2, 0, 0, 0, 0, 35, 0,255, 0, 0, 0, 46, 2, 0, 0, 0, 0, 35, 0, -255, 0, 0, 0,105, 1, 0, 0, 0, 0, 35, 0, 46, 2, 0, 0, 47, 2, 0, 0, 0, 0, 35, 0, 46, 2, 0, 0, 48, 2, 0, 0, - 0, 0, 35, 0, 47, 2, 0, 0, 48, 2, 0, 0, 0, 0, 35, 0,233, 0, 0, 0,104, 1, 0, 0, 0, 0, 35, 0,233, 0, 0, 0, - 48, 2, 0, 0, 0, 0, 35, 0,104, 1, 0, 0, 48, 2, 0, 0, 0, 0, 35, 0,232, 0, 0, 0, 47, 2, 0, 0, 0, 0, 35, 0, -232, 0, 0, 0,254, 0, 0, 0, 0, 0, 35, 0,254, 0, 0, 0, 47, 2, 0, 0, 0, 0, 35, 0,104, 1, 0, 0, 49, 2, 0, 0, - 0, 0, 35, 0,106, 1, 0, 0, 49, 2, 0, 0, 0, 0, 35, 0,104, 1, 0, 0,106, 1, 0, 0, 0, 0, 35, 0, 49, 2, 0, 0, - 50, 2, 0, 0, 0, 0, 35, 0, 49, 2, 0, 0, 51, 2, 0, 0, 0, 0, 35, 0, 50, 2, 0, 0, 51, 2, 0, 0, 0, 0, 35, 0, -105, 1, 0, 0,109, 1, 0, 0, 0, 0, 35, 0,109, 1, 0, 0, 51, 2, 0, 0, 0, 0, 35, 0,105, 1, 0, 0, 51, 2, 0, 0, - 0, 0, 35, 0,108, 1, 0, 0, 50, 2, 0, 0, 0, 0, 35, 0,107, 1, 0, 0,108, 1, 0, 0, 0, 0, 35, 0,107, 1, 0, 0, - 50, 2, 0, 0, 0, 0, 35, 0,236, 0, 0, 0, 52, 2, 0, 0, 0, 0, 35, 0, 0, 1, 0, 0, 52, 2, 0, 0, 0, 0, 35, 0, -236, 0, 0, 0, 0, 1, 0, 0, 0, 0, 35, 0, 52, 2, 0, 0, 53, 2, 0, 0, 0, 0, 35, 0, 52, 2, 0, 0, 54, 2, 0, 0, - 0, 0, 35, 0, 53, 2, 0, 0, 54, 2, 0, 0, 0, 0, 35, 0,237, 0, 0, 0,108, 1, 0, 0, 0, 0, 35, 0,108, 1, 0, 0, - 54, 2, 0, 0, 0, 0, 35, 0,237, 0, 0, 0, 54, 2, 0, 0, 0, 0, 35, 0,109, 1, 0, 0, 53, 2, 0, 0, 0, 0, 35, 0, - 1, 1, 0, 0,109, 1, 0, 0, 0, 0, 35, 0, 1, 1, 0, 0, 53, 2, 0, 0, 0, 0, 35, 0,235, 0, 0, 0, 55, 2, 0, 0, - 0, 0, 35, 0,107, 1, 0, 0, 55, 2, 0, 0, 0, 0, 35, 0,235, 0, 0, 0,107, 1, 0, 0, 0, 0, 35, 0, 55, 2, 0, 0, - 56, 2, 0, 0, 0, 0, 35, 0, 55, 2, 0, 0, 57, 2, 0, 0, 0, 0, 35, 0, 56, 2, 0, 0, 57, 2, 0, 0, 0, 0, 35, 0, -230, 0, 0, 0,234, 0, 0, 0, 0, 0, 35, 0,230, 0, 0, 0, 57, 2, 0, 0, 0, 0, 35, 0,234, 0, 0, 0, 57, 2, 0, 0, - 0, 0, 35, 0,231, 0, 0, 0, 56, 2, 0, 0, 0, 0, 35, 0,231, 0, 0, 0,106, 1, 0, 0, 0, 0, 35, 0,106, 1, 0, 0, - 56, 2, 0, 0, 0, 0, 35, 0,111, 1, 0, 0, 58, 2, 0, 0, 0, 0, 35, 0, 3, 1, 0, 0, 58, 2, 0, 0, 0, 0, 35, 0, - 3, 1, 0, 0,111, 1, 0, 0, 0, 0, 35, 0, 58, 2, 0, 0, 59, 2, 0, 0, 0, 0, 35, 0, 58, 2, 0, 0, 60, 2, 0, 0, - 0, 0, 35, 0, 59, 2, 0, 0, 60, 2, 0, 0, 0, 0, 35, 0,241, 0, 0, 0,110, 1, 0, 0, 0, 0, 35, 0,241, 0, 0, 0, - 60, 2, 0, 0, 0, 0, 35, 0,110, 1, 0, 0, 60, 2, 0, 0, 0, 0, 35, 0,240, 0, 0, 0, 59, 2, 0, 0, 0, 0, 35, 0, -240, 0, 0, 0, 2, 1, 0, 0, 0, 0, 35, 0, 2, 1, 0, 0, 59, 2, 0, 0, 0, 0, 35, 0,110, 1, 0, 0, 61, 2, 0, 0, - 0, 0, 35, 0,113, 1, 0, 0, 61, 2, 0, 0, 0, 0, 35, 0,110, 1, 0, 0,113, 1, 0, 0, 0, 0, 35, 0, 61, 2, 0, 0, - 62, 2, 0, 0, 0, 0, 35, 0, 61, 2, 0, 0, 63, 2, 0, 0, 0, 0, 35, 0, 62, 2, 0, 0, 63, 2, 0, 0, 0, 0, 35, 0, -111, 1, 0, 0,115, 1, 0, 0, 0, 0, 35, 0,115, 1, 0, 0, 63, 2, 0, 0, 0, 0, 35, 0,111, 1, 0, 0, 63, 2, 0, 0, - 0, 0, 35, 0,114, 1, 0, 0, 62, 2, 0, 0, 0, 0, 35, 0,112, 1, 0, 0,114, 1, 0, 0, 0, 0, 35, 0,112, 1, 0, 0, - 62, 2, 0, 0, 0, 0, 35, 0,204, 0, 0, 0, 64, 2, 0, 0, 0, 0, 35, 0, 4, 1, 0, 0, 64, 2, 0, 0, 0, 0, 35, 0, -204, 0, 0, 0, 4, 1, 0, 0, 0, 0, 35, 0, 64, 2, 0, 0, 65, 2, 0, 0, 0, 0, 35, 0, 64, 2, 0, 0, 66, 2, 0, 0, - 0, 0, 35, 0, 65, 2, 0, 0, 66, 2, 0, 0, 0, 0, 35, 0,205, 0, 0, 0,114, 1, 0, 0, 0, 0, 35, 0,114, 1, 0, 0, - 66, 2, 0, 0, 0, 0, 35, 0,205, 0, 0, 0, 66, 2, 0, 0, 0, 0, 35, 0,115, 1, 0, 0, 65, 2, 0, 0, 0, 0, 35, 0, - 5, 1, 0, 0,115, 1, 0, 0, 0, 0, 35, 0, 5, 1, 0, 0, 65, 2, 0, 0, 0, 0, 35, 0,203, 0, 0, 0, 67, 2, 0, 0, - 0, 0, 35, 0,112, 1, 0, 0, 67, 2, 0, 0, 0, 0, 35, 0,203, 0, 0, 0,112, 1, 0, 0, 0, 0, 35, 0, 67, 2, 0, 0, - 68, 2, 0, 0, 0, 0, 35, 0, 67, 2, 0, 0, 69, 2, 0, 0, 0, 0, 35, 0, 68, 2, 0, 0, 69, 2, 0, 0, 0, 0, 35, 0, -202, 0, 0, 0,238, 0, 0, 0, 0, 0, 35, 0,238, 0, 0, 0, 69, 2, 0, 0, 0, 0, 35, 0,202, 0, 0, 0, 69, 2, 0, 0, - 0, 0, 35, 0,239, 0, 0, 0, 68, 2, 0, 0, 0, 0, 35, 0,239, 0, 0, 0,113, 1, 0, 0, 0, 0, 35, 0,113, 1, 0, 0, - 68, 2, 0, 0, 0, 0, 35, 0,117, 1, 0, 0, 70, 2, 0, 0, 0, 0, 35, 0, 11, 1, 0, 0,117, 1, 0, 0, 0, 0, 35, 0, - 11, 1, 0, 0, 70, 2, 0, 0, 0, 0, 35, 0, 70, 2, 0, 0, 71, 2, 0, 0, 0, 0, 35, 0, 71, 2, 0, 0, 72, 2, 0, 0, - 0, 0, 35, 0, 70, 2, 0, 0, 72, 2, 0, 0, 0, 0, 35, 0,243, 0, 0, 0,116, 1, 0, 0, 0, 0, 35, 0,116, 1, 0, 0, - 72, 2, 0, 0, 0, 0, 35, 0,243, 0, 0, 0, 72, 2, 0, 0, 0, 0, 35, 0,242, 0, 0, 0, 71, 2, 0, 0, 0, 0, 35, 0, - 10, 1, 0, 0, 71, 2, 0, 0, 0, 0, 35, 0,242, 0, 0, 0, 10, 1, 0, 0, 0, 0, 35, 0,116, 1, 0, 0, 73, 2, 0, 0, - 0, 0, 35, 0,116, 1, 0, 0,118, 1, 0, 0, 0, 0, 35, 0,118, 1, 0, 0, 73, 2, 0, 0, 0, 0, 35, 0, 73, 2, 0, 0, - 74, 2, 0, 0, 0, 0, 35, 0, 74, 2, 0, 0, 75, 2, 0, 0, 0, 0, 35, 0, 73, 2, 0, 0, 75, 2, 0, 0, 0, 0, 35, 0, -117, 1, 0, 0,121, 1, 0, 0, 0, 0, 35, 0,117, 1, 0, 0, 75, 2, 0, 0, 0, 0, 35, 0,121, 1, 0, 0, 75, 2, 0, 0, - 0, 0, 35, 0,120, 1, 0, 0, 74, 2, 0, 0, 0, 0, 35, 0,119, 1, 0, 0, 74, 2, 0, 0, 0, 0, 35, 0,119, 1, 0, 0, -120, 1, 0, 0, 0, 0, 35, 0, 8, 1, 0, 0, 76, 2, 0, 0, 0, 0, 35, 0, 8, 1, 0, 0, 12, 1, 0, 0, 0, 0, 35, 0, - 12, 1, 0, 0, 76, 2, 0, 0, 0, 0, 35, 0, 76, 2, 0, 0, 77, 2, 0, 0, 0, 0, 35, 0, 77, 2, 0, 0, 78, 2, 0, 0, - 0, 0, 35, 0, 76, 2, 0, 0, 78, 2, 0, 0, 0, 0, 35, 0, 9, 1, 0, 0,120, 1, 0, 0, 0, 0, 35, 0, 9, 1, 0, 0, - 78, 2, 0, 0, 0, 0, 35, 0,120, 1, 0, 0, 78, 2, 0, 0, 0, 0, 35, 0,121, 1, 0, 0, 77, 2, 0, 0, 0, 0, 35, 0, - 13, 1, 0, 0, 77, 2, 0, 0, 0, 0, 35, 0, 13, 1, 0, 0,121, 1, 0, 0, 0, 0, 35, 0, 7, 1, 0, 0, 79, 2, 0, 0, - 0, 0, 35, 0, 7, 1, 0, 0,119, 1, 0, 0, 0, 0, 35, 0,119, 1, 0, 0, 79, 2, 0, 0, 0, 0, 35, 0, 79, 2, 0, 0, - 80, 2, 0, 0, 0, 0, 35, 0, 80, 2, 0, 0, 81, 2, 0, 0, 0, 0, 35, 0, 79, 2, 0, 0, 81, 2, 0, 0, 0, 0, 35, 0, -244, 0, 0, 0, 6, 1, 0, 0, 0, 0, 35, 0, 6, 1, 0, 0, 81, 2, 0, 0, 0, 0, 35, 0,244, 0, 0, 0, 81, 2, 0, 0, - 0, 0, 35, 0,245, 0, 0, 0, 80, 2, 0, 0, 0, 0, 35, 0,118, 1, 0, 0, 80, 2, 0, 0, 0, 0, 35, 0,245, 0, 0, 0, -118, 1, 0, 0, 0, 0, 35, 0,123, 1, 0, 0, 82, 2, 0, 0, 0, 0, 35, 0, 15, 1, 0, 0,123, 1, 0, 0, 0, 0, 35, 0, - 15, 1, 0, 0, 82, 2, 0, 0, 0, 0, 35, 0, 82, 2, 0, 0, 83, 2, 0, 0, 0, 0, 35, 0, 83, 2, 0, 0, 84, 2, 0, 0, - 0, 0, 35, 0, 82, 2, 0, 0, 84, 2, 0, 0, 0, 0, 35, 0,249, 0, 0, 0,122, 1, 0, 0, 0, 0, 35, 0,122, 1, 0, 0, - 84, 2, 0, 0, 0, 0, 35, 0,249, 0, 0, 0, 84, 2, 0, 0, 0, 0, 35, 0,248, 0, 0, 0, 83, 2, 0, 0, 0, 0, 35, 0, - 14, 1, 0, 0, 83, 2, 0, 0, 0, 0, 35, 0,248, 0, 0, 0, 14, 1, 0, 0, 0, 0, 35, 0,122, 1, 0, 0, 85, 2, 0, 0, - 0, 0, 35, 0,122, 1, 0, 0,124, 1, 0, 0, 0, 0, 35, 0,124, 1, 0, 0, 85, 2, 0, 0, 0, 0, 35, 0, 85, 2, 0, 0, - 86, 2, 0, 0, 0, 0, 35, 0, 86, 2, 0, 0, 87, 2, 0, 0, 0, 0, 35, 0, 85, 2, 0, 0, 87, 2, 0, 0, 0, 0, 35, 0, -123, 1, 0, 0,127, 1, 0, 0, 0, 0, 35, 0,123, 1, 0, 0, 87, 2, 0, 0, 0, 0, 35, 0,127, 1, 0, 0, 87, 2, 0, 0, - 0, 0, 35, 0,126, 1, 0, 0, 86, 2, 0, 0, 0, 0, 35, 0,125, 1, 0, 0, 86, 2, 0, 0, 0, 0, 35, 0,125, 1, 0, 0, -126, 1, 0, 0, 0, 0, 35, 0, 12, 1, 0, 0, 88, 2, 0, 0, 0, 0, 35, 0, 12, 1, 0, 0, 16, 1, 0, 0, 0, 0, 35, 0, - 16, 1, 0, 0, 88, 2, 0, 0, 0, 0, 35, 0, 88, 2, 0, 0, 89, 2, 0, 0, 0, 0, 35, 0, 89, 2, 0, 0, 90, 2, 0, 0, - 0, 0, 35, 0, 88, 2, 0, 0, 90, 2, 0, 0, 0, 0, 35, 0, 13, 1, 0, 0,126, 1, 0, 0, 0, 0, 35, 0, 13, 1, 0, 0, - 90, 2, 0, 0, 0, 0, 35, 0,126, 1, 0, 0, 90, 2, 0, 0, 0, 0, 35, 0,127, 1, 0, 0, 89, 2, 0, 0, 0, 0, 35, 0, - 17, 1, 0, 0, 89, 2, 0, 0, 0, 0, 35, 0, 17, 1, 0, 0,127, 1, 0, 0, 0, 0, 35, 0, 11, 1, 0, 0, 91, 2, 0, 0, - 0, 0, 35, 0, 11, 1, 0, 0,125, 1, 0, 0, 0, 0, 35, 0,125, 1, 0, 0, 91, 2, 0, 0, 0, 0, 35, 0, 91, 2, 0, 0, - 92, 2, 0, 0, 0, 0, 35, 0, 92, 2, 0, 0, 93, 2, 0, 0, 0, 0, 35, 0, 91, 2, 0, 0, 93, 2, 0, 0, 0, 0, 35, 0, -246, 0, 0, 0, 10, 1, 0, 0, 0, 0, 35, 0, 10, 1, 0, 0, 93, 2, 0, 0, 0, 0, 35, 0,246, 0, 0, 0, 93, 2, 0, 0, - 0, 0, 35, 0,247, 0, 0, 0, 92, 2, 0, 0, 0, 0, 35, 0,124, 1, 0, 0, 92, 2, 0, 0, 0, 0, 35, 0,247, 0, 0, 0, -124, 1, 0, 0, 0, 0, 35, 0,129, 1, 0, 0, 94, 2, 0, 0, 0, 0, 35, 0, 19, 1, 0, 0,129, 1, 0, 0, 0, 0, 35, 0, - 19, 1, 0, 0, 94, 2, 0, 0, 0, 0, 35, 0, 94, 2, 0, 0, 95, 2, 0, 0, 0, 0, 35, 0, 95, 2, 0, 0, 96, 2, 0, 0, - 0, 0, 35, 0, 94, 2, 0, 0, 96, 2, 0, 0, 0, 0, 35, 0,253, 0, 0, 0,128, 1, 0, 0, 0, 0, 35, 0,128, 1, 0, 0, - 96, 2, 0, 0, 0, 0, 35, 0,253, 0, 0, 0, 96, 2, 0, 0, 0, 0, 35, 0,252, 0, 0, 0, 95, 2, 0, 0, 0, 0, 35, 0, - 18, 1, 0, 0, 95, 2, 0, 0, 0, 0, 35, 0,252, 0, 0, 0, 18, 1, 0, 0, 0, 0, 35, 0,128, 1, 0, 0, 97, 2, 0, 0, - 0, 0, 35, 0,128, 1, 0, 0,130, 1, 0, 0, 0, 0, 35, 0,130, 1, 0, 0, 97, 2, 0, 0, 0, 0, 35, 0, 97, 2, 0, 0, - 98, 2, 0, 0, 0, 0, 35, 0, 98, 2, 0, 0, 99, 2, 0, 0, 0, 0, 35, 0, 97, 2, 0, 0, 99, 2, 0, 0, 0, 0, 35, 0, -129, 1, 0, 0,133, 1, 0, 0, 0, 0, 35, 0,129, 1, 0, 0, 99, 2, 0, 0, 0, 0, 35, 0,133, 1, 0, 0, 99, 2, 0, 0, - 0, 0, 35, 0,132, 1, 0, 0, 98, 2, 0, 0, 0, 0, 35, 0,131, 1, 0, 0, 98, 2, 0, 0, 0, 0, 35, 0,131, 1, 0, 0, -132, 1, 0, 0, 0, 0, 35, 0, 16, 1, 0, 0,100, 2, 0, 0, 0, 0, 35, 0, 16, 1, 0, 0, 20, 1, 0, 0, 0, 0, 35, 0, - 20, 1, 0, 0,100, 2, 0, 0, 0, 0, 35, 0,100, 2, 0, 0,101, 2, 0, 0, 0, 0, 35, 0,101, 2, 0, 0,102, 2, 0, 0, - 0, 0, 35, 0,100, 2, 0, 0,102, 2, 0, 0, 0, 0, 35, 0, 17, 1, 0, 0,132, 1, 0, 0, 0, 0, 35, 0, 17, 1, 0, 0, -102, 2, 0, 0, 0, 0, 35, 0,132, 1, 0, 0,102, 2, 0, 0, 0, 0, 35, 0,133, 1, 0, 0,101, 2, 0, 0, 0, 0, 35, 0, - 21, 1, 0, 0,101, 2, 0, 0, 0, 0, 35, 0, 21, 1, 0, 0,133, 1, 0, 0, 0, 0, 35, 0, 15, 1, 0, 0,103, 2, 0, 0, - 0, 0, 35, 0, 15, 1, 0, 0,131, 1, 0, 0, 0, 0, 35, 0,131, 1, 0, 0,103, 2, 0, 0, 0, 0, 35, 0,103, 2, 0, 0, -104, 2, 0, 0, 0, 0, 35, 0,104, 2, 0, 0,105, 2, 0, 0, 0, 0, 35, 0,103, 2, 0, 0,105, 2, 0, 0, 0, 0, 35, 0, -250, 0, 0, 0, 14, 1, 0, 0, 0, 0, 35, 0, 14, 1, 0, 0,105, 2, 0, 0, 0, 0, 35, 0,250, 0, 0, 0,105, 2, 0, 0, - 0, 0, 35, 0,251, 0, 0, 0,104, 2, 0, 0, 0, 0, 35, 0,130, 1, 0, 0,104, 2, 0, 0, 0, 0, 35, 0,251, 0, 0, 0, -130, 1, 0, 0, 0, 0, 35, 0,135, 1, 0, 0,106, 2, 0, 0, 0, 0, 35, 0, 23, 1, 0, 0,135, 1, 0, 0, 0, 0, 35, 0, - 23, 1, 0, 0,106, 2, 0, 0, 0, 0, 35, 0,106, 2, 0, 0,107, 2, 0, 0, 0, 0, 35, 0,107, 2, 0, 0,108, 2, 0, 0, - 0, 0, 35, 0,106, 2, 0, 0,108, 2, 0, 0, 0, 0, 35, 0, 1, 1, 0, 0,134, 1, 0, 0, 0, 0, 35, 0,134, 1, 0, 0, -108, 2, 0, 0, 0, 0, 35, 0, 1, 1, 0, 0,108, 2, 0, 0, 0, 0, 35, 0, 0, 1, 0, 0,107, 2, 0, 0, 0, 0, 35, 0, - 22, 1, 0, 0,107, 2, 0, 0, 0, 0, 35, 0, 0, 1, 0, 0, 22, 1, 0, 0, 0, 0, 35, 0,134, 1, 0, 0,109, 2, 0, 0, - 0, 0, 35, 0,134, 1, 0, 0,136, 1, 0, 0, 0, 0, 35, 0,136, 1, 0, 0,109, 2, 0, 0, 0, 0, 35, 0,109, 2, 0, 0, -110, 2, 0, 0, 0, 0, 35, 0,110, 2, 0, 0,111, 2, 0, 0, 0, 0, 35, 0,109, 2, 0, 0,111, 2, 0, 0, 0, 0, 35, 0, -135, 1, 0, 0,139, 1, 0, 0, 0, 0, 35, 0,135, 1, 0, 0,111, 2, 0, 0, 0, 0, 35, 0,139, 1, 0, 0,111, 2, 0, 0, - 0, 0, 35, 0,138, 1, 0, 0,110, 2, 0, 0, 0, 0, 35, 0,137, 1, 0, 0,110, 2, 0, 0, 0, 0, 35, 0,137, 1, 0, 0, -138, 1, 0, 0, 0, 0, 35, 0, 20, 1, 0, 0,112, 2, 0, 0, 0, 0, 35, 0, 20, 1, 0, 0, 24, 1, 0, 0, 0, 0, 35, 0, - 24, 1, 0, 0,112, 2, 0, 0, 0, 0, 35, 0,112, 2, 0, 0,113, 2, 0, 0, 0, 0, 35, 0,113, 2, 0, 0,114, 2, 0, 0, - 0, 0, 35, 0,112, 2, 0, 0,114, 2, 0, 0, 0, 0, 35, 0, 21, 1, 0, 0,138, 1, 0, 0, 0, 0, 35, 0, 21, 1, 0, 0, -114, 2, 0, 0, 0, 0, 35, 0,138, 1, 0, 0,114, 2, 0, 0, 0, 0, 35, 0,139, 1, 0, 0,113, 2, 0, 0, 0, 0, 35, 0, - 25, 1, 0, 0,113, 2, 0, 0, 0, 0, 35, 0, 25, 1, 0, 0,139, 1, 0, 0, 0, 0, 35, 0, 19, 1, 0, 0,115, 2, 0, 0, - 0, 0, 35, 0, 19, 1, 0, 0,137, 1, 0, 0, 0, 0, 35, 0,137, 1, 0, 0,115, 2, 0, 0, 0, 0, 35, 0,115, 2, 0, 0, -116, 2, 0, 0, 0, 0, 35, 0,116, 2, 0, 0,117, 2, 0, 0, 0, 0, 35, 0,115, 2, 0, 0,117, 2, 0, 0, 0, 0, 35, 0, -254, 0, 0, 0, 18, 1, 0, 0, 0, 0, 35, 0, 18, 1, 0, 0,117, 2, 0, 0, 0, 0, 35, 0,254, 0, 0, 0,117, 2, 0, 0, - 0, 0, 35, 0,255, 0, 0, 0,116, 2, 0, 0, 0, 0, 35, 0,136, 1, 0, 0,116, 2, 0, 0, 0, 0, 35, 0,255, 0, 0, 0, -136, 1, 0, 0, 0, 0, 35, 0,141, 1, 0, 0,118, 2, 0, 0, 0, 0, 35, 0, 7, 1, 0, 0,141, 1, 0, 0, 0, 0, 35, 0, - 7, 1, 0, 0,118, 2, 0, 0, 0, 0, 35, 0,118, 2, 0, 0,119, 2, 0, 0, 0, 0, 35, 0,119, 2, 0, 0,120, 2, 0, 0, - 0, 0, 35, 0,118, 2, 0, 0,120, 2, 0, 0, 0, 0, 35, 0, 5, 1, 0, 0,140, 1, 0, 0, 0, 0, 35, 0,140, 1, 0, 0, -120, 2, 0, 0, 0, 0, 35, 0, 5, 1, 0, 0,120, 2, 0, 0, 0, 0, 35, 0, 4, 1, 0, 0,119, 2, 0, 0, 0, 0, 35, 0, - 6, 1, 0, 0,119, 2, 0, 0, 0, 0, 35, 0, 4, 1, 0, 0, 6, 1, 0, 0, 0, 0, 35, 0,140, 1, 0, 0,121, 2, 0, 0, - 0, 0, 35, 0,140, 1, 0, 0,142, 1, 0, 0, 0, 0, 35, 0,142, 1, 0, 0,121, 2, 0, 0, 0, 0, 35, 0,121, 2, 0, 0, -122, 2, 0, 0, 0, 0, 35, 0,122, 2, 0, 0,123, 2, 0, 0, 0, 0, 35, 0,121, 2, 0, 0,123, 2, 0, 0, 0, 0, 35, 0, -141, 1, 0, 0,144, 1, 0, 0, 0, 0, 35, 0,141, 1, 0, 0,123, 2, 0, 0, 0, 0, 35, 0,144, 1, 0, 0,123, 2, 0, 0, - 0, 0, 35, 0,145, 1, 0, 0,122, 2, 0, 0, 0, 0, 35, 0,143, 1, 0, 0,122, 2, 0, 0, 0, 0, 35, 0,143, 1, 0, 0, -145, 1, 0, 0, 0, 0, 35, 0, 24, 1, 0, 0,124, 2, 0, 0, 0, 0, 35, 0, 8, 1, 0, 0, 24, 1, 0, 0, 0, 0, 35, 0, - 8, 1, 0, 0,124, 2, 0, 0, 0, 0, 35, 0,124, 2, 0, 0,125, 2, 0, 0, 0, 0, 35, 0,125, 2, 0, 0,126, 2, 0, 0, - 0, 0, 35, 0,124, 2, 0, 0,126, 2, 0, 0, 0, 0, 35, 0, 25, 1, 0, 0,145, 1, 0, 0, 0, 0, 35, 0, 25, 1, 0, 0, -126, 2, 0, 0, 0, 0, 35, 0,145, 1, 0, 0,126, 2, 0, 0, 0, 0, 35, 0,144, 1, 0, 0,125, 2, 0, 0, 0, 0, 35, 0, - 9, 1, 0, 0,125, 2, 0, 0, 0, 0, 35, 0, 9, 1, 0, 0,144, 1, 0, 0, 0, 0, 35, 0, 23, 1, 0, 0,127, 2, 0, 0, - 0, 0, 35, 0, 23, 1, 0, 0,143, 1, 0, 0, 0, 0, 35, 0,143, 1, 0, 0,127, 2, 0, 0, 0, 0, 35, 0,127, 2, 0, 0, -128, 2, 0, 0, 0, 0, 35, 0,128, 2, 0, 0,129, 2, 0, 0, 0, 0, 35, 0,127, 2, 0, 0,129, 2, 0, 0, 0, 0, 35, 0, - 2, 1, 0, 0, 22, 1, 0, 0, 0, 0, 35, 0, 22, 1, 0, 0,129, 2, 0, 0, 0, 0, 35, 0, 2, 1, 0, 0,129, 2, 0, 0, - 0, 0, 35, 0, 3, 1, 0, 0,128, 2, 0, 0, 0, 0, 35, 0,142, 1, 0, 0,128, 2, 0, 0, 0, 0, 35, 0, 3, 1, 0, 0, -142, 1, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0,240, 91,119, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,112, 93,119, 1, 0, 0, 0, 0, - 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176,193,119, 1, 0, 0, 0, 0, - 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240,177,120, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 0,100, 0, 0,112, 93,119, 1, 0, 0, 0, 0, 52, 0, 0, 0, 0, 5, 0, 0, 27, 1, 0, 0,102, 0, 0, 0, -146, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,146, 1, 0, 0,171, 0, 0, 0, 27, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 14, 0, 0, 0, 27, 1, 0, 0,171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,171, 0, 0, 0,146, 1, 0, 0, 46, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,147, 1, 0, 0, 46, 0, 0, 0,146, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,146, 1, 0, 0, -148, 1, 0, 0,147, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 43, 0, 0, 0,147, 1, 0, 0,148, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,148, 1, 0, 0,146, 1, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 26, 1, 0, 0, 12, 0, 0, 0, -165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,165, 0, 0, 0,148, 1, 0, 0, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -102, 0, 0, 0, 26, 1, 0, 0,148, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,148, 1, 0, 0,165, 0, 0, 0, 43, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,147, 1, 0, 0, 43, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,164, 0, 0, 0, -170, 0, 0, 0,147, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 46, 0, 0, 0,147, 1, 0, 0,170, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,170, 0, 0, 0,164, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 26, 1, 0, 0,102, 0, 0, 0, -149, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,149, 1, 0, 0, 28, 1, 0, 0, 26, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 12, 0, 0, 0, 26, 1, 0, 0, 28, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28, 1, 0, 0,149, 1, 0, 0,103, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,150, 1, 0, 0,103, 0, 0, 0,149, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,149, 1, 0, 0, -151, 1, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 0, 0, 0,150, 1, 0, 0,151, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,151, 1, 0, 0,149, 1, 0, 0,102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27, 1, 0, 0, 14, 0, 0, 0, - 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 1, 0, 0,151, 1, 0, 0, 27, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -102, 0, 0, 0, 27, 1, 0, 0,151, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,151, 1, 0, 0, 31, 1, 0, 0,104, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,150, 1, 0, 0,104, 0, 0, 0, 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 1, 0, 0, - 29, 1, 0, 0,150, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,103, 0, 0, 0,150, 1, 0, 0, 29, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 29, 1, 0, 0, 30, 1, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,168, 0, 0, 0, 45, 0, 0, 0, -152, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,152, 1, 0, 0,172, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 2, 0, 0, 0,168, 0, 0, 0,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,172, 0, 0, 0,152, 1, 0, 0, 47, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,153, 1, 0, 0, 47, 0, 0, 0,152, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,152, 1, 0, 0, -154, 1, 0, 0,153, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 0, 0, 0,153, 1, 0, 0,154, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,154, 1, 0, 0,152, 1, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,169, 0, 0, 0, 13, 0, 0, 0, - 30, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 1, 0, 0,154, 1, 0, 0,169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 45, 0, 0, 0,169, 0, 0, 0,154, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,154, 1, 0, 0, 30, 1, 0, 0,104, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,153, 1, 0, 0,104, 0, 0, 0, 31, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 1, 0, 0, -173, 0, 0, 0,153, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 47, 0, 0, 0,153, 1, 0, 0,173, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,173, 0, 0, 0, 31, 1, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,167, 0, 0, 0, 44, 0, 0, 0, -155, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,155, 1, 0, 0, 29, 1, 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 13, 0, 0, 0,167, 0, 0, 0, 29, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 29, 1, 0, 0,155, 1, 0, 0,103, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,156, 1, 0, 0,103, 0, 0, 0,155, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,155, 1, 0, 0, -157, 1, 0, 0,156, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 42, 0, 0, 0,156, 1, 0, 0,157, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,157, 1, 0, 0,155, 1, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,166, 0, 0, 0, 0, 0, 0, 0, -162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,162, 0, 0, 0,157, 1, 0, 0,166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 44, 0, 0, 0,166, 0, 0, 0,157, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,157, 1, 0, 0,162, 0, 0, 0, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,156, 1, 0, 0, 42, 0, 0, 0,163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,163, 0, 0, 0, - 28, 1, 0, 0,156, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,103, 0, 0, 0,156, 1, 0, 0, 28, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 28, 1, 0, 0,163, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,158, 1, 0, 0,105, 0, 0, 0, - 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 33, 1, 0, 0,179, 0, 0, 0,158, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 50, 0, 0, 0,158, 1, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,179, 0, 0, 0, 33, 1, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,158, 1, 0, 0, 50, 0, 0, 0,159, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,159, 1, 0, 0, -160, 1, 0, 0,158, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,105, 0, 0, 0,158, 1, 0, 0,160, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,160, 1, 0, 0,159, 1, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,165, 0, 0, 0, 12, 0, 0, 0, - 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 1, 0, 0,160, 1, 0, 0,165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 43, 0, 0, 0,165, 0, 0, 0,160, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,160, 1, 0, 0, 32, 1, 0, 0,105, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,164, 0, 0, 0, 43, 0, 0, 0,159, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,159, 1, 0, 0, -178, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0,164, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,178, 0, 0, 0,159, 1, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,161, 1, 0, 0,105, 0, 0, 0, - 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 1, 0, 0, 34, 1, 0, 0,161, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -106, 0, 0, 0,161, 1, 0, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 34, 1, 0, 0, 32, 1, 0, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,161, 1, 0, 0,106, 0, 0, 0,162, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,162, 1, 0, 0, -163, 1, 0, 0,161, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,105, 0, 0, 0,161, 1, 0, 0,163, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,163, 1, 0, 0,162, 1, 0, 0,107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 1, 0, 0, 16, 0, 0, 0, - 33, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 33, 1, 0, 0,163, 1, 0, 0, 37, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -107, 0, 0, 0, 37, 1, 0, 0,163, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,163, 1, 0, 0, 33, 1, 0, 0,105, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 36, 1, 0, 0,107, 0, 0, 0,162, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,162, 1, 0, 0, - 35, 1, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 0, 0, 0, 36, 1, 0, 0, 35, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 35, 1, 0, 0,162, 1, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,164, 1, 0, 0, 49, 0, 0, 0, -176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,176, 0, 0, 0,180, 0, 0, 0,164, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 51, 0, 0, 0,164, 1, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,180, 0, 0, 0,176, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,164, 1, 0, 0, 51, 0, 0, 0,165, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,165, 1, 0, 0, -166, 1, 0, 0,164, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 49, 0, 0, 0,164, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,166, 1, 0, 0,165, 1, 0, 0,107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 36, 1, 0, 0, 15, 0, 0, 0, -177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,177, 0, 0, 0,166, 1, 0, 0, 36, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -107, 0, 0, 0, 36, 1, 0, 0,166, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,166, 1, 0, 0,177, 0, 0, 0, 49, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 37, 1, 0, 0,107, 0, 0, 0,165, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,165, 1, 0, 0, -181, 0, 0, 0, 37, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 0, 0, 0, 37, 1, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,181, 0, 0, 0,165, 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,167, 1, 0, 0, 48, 0, 0, 0, -175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,175, 0, 0, 0, 35, 1, 0, 0,167, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -106, 0, 0, 0,167, 1, 0, 0, 35, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 35, 1, 0, 0,175, 0, 0, 0, 15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,167, 1, 0, 0,106, 0, 0, 0,168, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,168, 1, 0, 0, -169, 1, 0, 0,167, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 48, 0, 0, 0,167, 1, 0, 0,169, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,169, 1, 0, 0,168, 1, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,162, 0, 0, 0, 0, 0, 0, 0, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,174, 0, 0, 0,169, 1, 0, 0,162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 42, 0, 0, 0,162, 0, 0, 0,169, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,169, 1, 0, 0,174, 0, 0, 0, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,163, 0, 0, 0, 42, 0, 0, 0,168, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,168, 1, 0, 0, - 34, 1, 0, 0,163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 0, 0, 0,163, 0, 0, 0, 34, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 34, 1, 0, 0,168, 1, 0, 0,106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 39, 1, 0, 0,108, 0, 0, 0, -170, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,170, 1, 0, 0,187, 0, 0, 0, 39, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 18, 0, 0, 0, 39, 1, 0, 0,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,187, 0, 0, 0,170, 1, 0, 0, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,171, 1, 0, 0, 54, 0, 0, 0,170, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,170, 1, 0, 0, -172, 1, 0, 0,171, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 45, 0, 0, 0,171, 1, 0, 0,172, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,172, 1, 0, 0,170, 1, 0, 0,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 38, 1, 0, 0, 13, 0, 0, 0, -169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,169, 0, 0, 0,172, 1, 0, 0, 38, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -108, 0, 0, 0, 38, 1, 0, 0,172, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,172, 1, 0, 0,169, 0, 0, 0, 45, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,171, 1, 0, 0, 45, 0, 0, 0,168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,168, 0, 0, 0, -186, 0, 0, 0,171, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54, 0, 0, 0,171, 1, 0, 0,186, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,186, 0, 0, 0,168, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 38, 1, 0, 0,108, 0, 0, 0, -173, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,173, 1, 0, 0, 40, 1, 0, 0, 38, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 13, 0, 0, 0, 38, 1, 0, 0, 40, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 40, 1, 0, 0,173, 1, 0, 0,109, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,174, 1, 0, 0,109, 0, 0, 0,173, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,173, 1, 0, 0, -175, 1, 0, 0,174, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 0, 0, 0,174, 1, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,175, 1, 0, 0,173, 1, 0, 0,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 39, 1, 0, 0, 18, 0, 0, 0, - 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 43, 1, 0, 0,175, 1, 0, 0, 39, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -108, 0, 0, 0, 39, 1, 0, 0,175, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,175, 1, 0, 0, 43, 1, 0, 0,110, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,174, 1, 0, 0,110, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 42, 1, 0, 0, - 41, 1, 0, 0,174, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,109, 0, 0, 0,174, 1, 0, 0, 41, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 41, 1, 0, 0, 42, 1, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,184, 0, 0, 0, 53, 0, 0, 0, -176, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,176, 1, 0, 0,188, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 3, 0, 0, 0,184, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,188, 0, 0, 0,176, 1, 0, 0, 55, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,177, 1, 0, 0, 55, 0, 0, 0,176, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,176, 1, 0, 0, -178, 1, 0, 0,177, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 0, 0, 0,177, 1, 0, 0,178, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,178, 1, 0, 0,176, 1, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,185, 0, 0, 0, 17, 0, 0, 0, - 42, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 42, 1, 0, 0,178, 1, 0, 0,185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 53, 0, 0, 0,185, 0, 0, 0,178, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,178, 1, 0, 0, 42, 1, 0, 0,110, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,177, 1, 0, 0,110, 0, 0, 0, 43, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 43, 1, 0, 0, -189, 0, 0, 0,177, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 0, 0, 0,177, 1, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,189, 0, 0, 0, 43, 1, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,183, 0, 0, 0, 52, 0, 0, 0, -179, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,179, 1, 0, 0, 41, 1, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 17, 0, 0, 0,183, 0, 0, 0, 41, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 41, 1, 0, 0,179, 1, 0, 0,109, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,180, 1, 0, 0,109, 0, 0, 0,179, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,179, 1, 0, 0, -181, 1, 0, 0,180, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 44, 0, 0, 0,180, 1, 0, 0,181, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,181, 1, 0, 0,179, 1, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,182, 0, 0, 0, 0, 0, 0, 0, -166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,166, 0, 0, 0,181, 1, 0, 0,182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 52, 0, 0, 0,182, 0, 0, 0,181, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,181, 1, 0, 0,166, 0, 0, 0, 44, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,180, 1, 0, 0, 44, 0, 0, 0,167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,167, 0, 0, 0, - 40, 1, 0, 0,180, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,109, 0, 0, 0,180, 1, 0, 0, 40, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 40, 1, 0, 0,167, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 45, 1, 0, 0,111, 0, 0, 0, -182, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,182, 1, 0, 0,195, 0, 0, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 20, 0, 0, 0, 45, 1, 0, 0,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,195, 0, 0, 0,182, 1, 0, 0, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,183, 1, 0, 0, 58, 0, 0, 0,182, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,182, 1, 0, 0, -184, 1, 0, 0,183, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 53, 0, 0, 0,183, 1, 0, 0,184, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,184, 1, 0, 0,182, 1, 0, 0,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 44, 1, 0, 0, 17, 0, 0, 0, -185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,185, 0, 0, 0,184, 1, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -111, 0, 0, 0, 44, 1, 0, 0,184, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,184, 1, 0, 0,185, 0, 0, 0, 53, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,183, 1, 0, 0, 53, 0, 0, 0,184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,184, 0, 0, 0, -194, 0, 0, 0,183, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58, 0, 0, 0,183, 1, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,194, 0, 0, 0,184, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 44, 1, 0, 0,111, 0, 0, 0, -185, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,185, 1, 0, 0, 46, 1, 0, 0, 44, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 17, 0, 0, 0, 44, 1, 0, 0, 46, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 46, 1, 0, 0,185, 1, 0, 0,112, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,186, 1, 0, 0,112, 0, 0, 0,185, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,185, 1, 0, 0, -187, 1, 0, 0,186, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,113, 0, 0, 0,186, 1, 0, 0,187, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,187, 1, 0, 0,185, 1, 0, 0,111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 45, 1, 0, 0, 20, 0, 0, 0, - 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 49, 1, 0, 0,187, 1, 0, 0, 45, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -111, 0, 0, 0, 45, 1, 0, 0,187, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,187, 1, 0, 0, 49, 1, 0, 0,113, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,186, 1, 0, 0,113, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 48, 1, 0, 0, - 47, 1, 0, 0,186, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,112, 0, 0, 0,186, 1, 0, 0, 47, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 47, 1, 0, 0, 48, 1, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,192, 0, 0, 0, 57, 0, 0, 0, -188, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,188, 1, 0, 0,196, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 4, 0, 0, 0,192, 0, 0, 0,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,196, 0, 0, 0,188, 1, 0, 0, 59, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,189, 1, 0, 0, 59, 0, 0, 0,188, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,188, 1, 0, 0, -190, 1, 0, 0,189, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,113, 0, 0, 0,189, 1, 0, 0,190, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,190, 1, 0, 0,188, 1, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,193, 0, 0, 0, 19, 0, 0, 0, - 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 48, 1, 0, 0,190, 1, 0, 0,193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 57, 0, 0, 0,193, 0, 0, 0,190, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,190, 1, 0, 0, 48, 1, 0, 0,113, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,189, 1, 0, 0,113, 0, 0, 0, 49, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 49, 1, 0, 0, -197, 0, 0, 0,189, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59, 0, 0, 0,189, 1, 0, 0,197, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,197, 0, 0, 0, 49, 1, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,191, 0, 0, 0, 56, 0, 0, 0, -191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,191, 1, 0, 0, 47, 1, 0, 0,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 19, 0, 0, 0,191, 0, 0, 0, 47, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 47, 1, 0, 0,191, 1, 0, 0,112, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,192, 1, 0, 0,112, 0, 0, 0,191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,191, 1, 0, 0, -193, 1, 0, 0,192, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 52, 0, 0, 0,192, 1, 0, 0,193, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,193, 1, 0, 0,191, 1, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,190, 0, 0, 0, 0, 0, 0, 0, -182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,182, 0, 0, 0,193, 1, 0, 0,190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 56, 0, 0, 0,190, 0, 0, 0,193, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,193, 1, 0, 0,182, 0, 0, 0, 52, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,192, 1, 0, 0, 52, 0, 0, 0,183, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,183, 0, 0, 0, - 46, 1, 0, 0,192, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,112, 0, 0, 0,192, 1, 0, 0, 46, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 46, 1, 0, 0,183, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 51, 1, 0, 0,114, 0, 0, 0, -194, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,194, 1, 0, 0,199, 0, 0, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 21, 0, 0, 0, 51, 1, 0, 0,199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,199, 0, 0, 0,194, 1, 0, 0, 60, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,195, 1, 0, 0, 60, 0, 0, 0,194, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,194, 1, 0, 0, -196, 1, 0, 0,195, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 57, 0, 0, 0,195, 1, 0, 0,196, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,196, 1, 0, 0,194, 1, 0, 0,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 50, 1, 0, 0, 19, 0, 0, 0, -193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,193, 0, 0, 0,196, 1, 0, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -114, 0, 0, 0, 50, 1, 0, 0,196, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,196, 1, 0, 0,193, 0, 0, 0, 57, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,195, 1, 0, 0, 57, 0, 0, 0,192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,192, 0, 0, 0, -198, 0, 0, 0,195, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 60, 0, 0, 0,195, 1, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,198, 0, 0, 0,192, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 50, 1, 0, 0,114, 0, 0, 0, -197, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,197, 1, 0, 0, 53, 1, 0, 0, 50, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 19, 0, 0, 0, 50, 1, 0, 0, 53, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 53, 1, 0, 0,197, 1, 0, 0,115, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,198, 1, 0, 0,115, 0, 0, 0,197, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,197, 1, 0, 0, -199, 1, 0, 0,198, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 0, 0, 0,198, 1, 0, 0,199, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,199, 1, 0, 0,197, 1, 0, 0,114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 51, 1, 0, 0, 21, 0, 0, 0, - 55, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 1, 0, 0,199, 1, 0, 0, 51, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -114, 0, 0, 0, 51, 1, 0, 0,199, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,199, 1, 0, 0, 55, 1, 0, 0,116, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,198, 1, 0, 0,116, 0, 0, 0, 54, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54, 1, 0, 0, - 52, 1, 0, 0,198, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,115, 0, 0, 0,198, 1, 0, 0, 52, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 52, 1, 0, 0, 54, 1, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,176, 0, 0, 0, 49, 0, 0, 0, -200, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,200, 1, 0, 0,200, 0, 0, 0,176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 5, 0, 0, 0,176, 0, 0, 0,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,200, 0, 0, 0,200, 1, 0, 0, 61, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,201, 1, 0, 0, 61, 0, 0, 0,200, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,200, 1, 0, 0, -202, 1, 0, 0,201, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 0, 0, 0,201, 1, 0, 0,202, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,202, 1, 0, 0,200, 1, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,177, 0, 0, 0, 15, 0, 0, 0, - 54, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54, 1, 0, 0,202, 1, 0, 0,177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 49, 0, 0, 0,177, 0, 0, 0,202, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,202, 1, 0, 0, 54, 1, 0, 0,116, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,201, 1, 0, 0,116, 0, 0, 0, 55, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 1, 0, 0, -201, 0, 0, 0,201, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 61, 0, 0, 0,201, 1, 0, 0,201, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,201, 0, 0, 0, 55, 1, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,175, 0, 0, 0, 48, 0, 0, 0, -203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,203, 1, 0, 0, 52, 1, 0, 0,175, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 15, 0, 0, 0,175, 0, 0, 0, 52, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 52, 1, 0, 0,203, 1, 0, 0,115, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,204, 1, 0, 0,115, 0, 0, 0,203, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,203, 1, 0, 0, -205, 1, 0, 0,204, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 56, 0, 0, 0,204, 1, 0, 0,205, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,205, 1, 0, 0,203, 1, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,174, 0, 0, 0, 0, 0, 0, 0, -190, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,190, 0, 0, 0,205, 1, 0, 0,174, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 48, 0, 0, 0,174, 0, 0, 0,205, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,205, 1, 0, 0,190, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,204, 1, 0, 0, 56, 0, 0, 0,191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,191, 0, 0, 0, - 53, 1, 0, 0,204, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,115, 0, 0, 0,204, 1, 0, 0, 53, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 53, 1, 0, 0,191, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,206, 1, 0, 0,117, 0, 0, 0, - 57, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 57, 1, 0, 0,207, 0, 0, 0,206, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 64, 0, 0, 0,206, 1, 0, 0,207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,207, 0, 0, 0, 57, 1, 0, 0, 23, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,206, 1, 0, 0, 64, 0, 0, 0,207, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,207, 1, 0, 0, -208, 1, 0, 0,206, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,117, 0, 0, 0,206, 1, 0, 0,208, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,208, 1, 0, 0,207, 1, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,179, 0, 0, 0, 16, 0, 0, 0, - 56, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 56, 1, 0, 0,208, 1, 0, 0,179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 50, 0, 0, 0,179, 0, 0, 0,208, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,208, 1, 0, 0, 56, 1, 0, 0,117, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,178, 0, 0, 0, 50, 0, 0, 0,207, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,207, 1, 0, 0, -206, 0, 0, 0,178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0,178, 0, 0, 0,206, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,206, 0, 0, 0,207, 1, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,209, 1, 0, 0,117, 0, 0, 0, - 56, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 56, 1, 0, 0, 58, 1, 0, 0,209, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -118, 0, 0, 0,209, 1, 0, 0, 58, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58, 1, 0, 0, 56, 1, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,209, 1, 0, 0,118, 0, 0, 0,210, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 1, 0, 0, -211, 1, 0, 0,209, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,117, 0, 0, 0,209, 1, 0, 0,211, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,211, 1, 0, 0,210, 1, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 61, 1, 0, 0, 23, 0, 0, 0, - 57, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 57, 1, 0, 0,211, 1, 0, 0, 61, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -119, 0, 0, 0, 61, 1, 0, 0,211, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,211, 1, 0, 0, 57, 1, 0, 0,117, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 60, 1, 0, 0,119, 0, 0, 0,210, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 1, 0, 0, - 59, 1, 0, 0, 60, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 22, 0, 0, 0, 60, 1, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 59, 1, 0, 0,210, 1, 0, 0,118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,212, 1, 0, 0, 63, 0, 0, 0, -204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,204, 0, 0, 0,208, 0, 0, 0,212, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 65, 0, 0, 0,212, 1, 0, 0,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,208, 0, 0, 0,204, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,212, 1, 0, 0, 65, 0, 0, 0,213, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,213, 1, 0, 0, -214, 1, 0, 0,212, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 63, 0, 0, 0,212, 1, 0, 0,214, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,214, 1, 0, 0,213, 1, 0, 0,119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 60, 1, 0, 0, 22, 0, 0, 0, -205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,205, 0, 0, 0,214, 1, 0, 0, 60, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -119, 0, 0, 0, 60, 1, 0, 0,214, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,214, 1, 0, 0,205, 0, 0, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 61, 1, 0, 0,119, 0, 0, 0,213, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,213, 1, 0, 0, -209, 0, 0, 0, 61, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 23, 0, 0, 0, 61, 1, 0, 0,209, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,209, 0, 0, 0,213, 1, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,215, 1, 0, 0, 62, 0, 0, 0, -203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,203, 0, 0, 0, 59, 1, 0, 0,215, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -118, 0, 0, 0,215, 1, 0, 0, 59, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 59, 1, 0, 0,203, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,215, 1, 0, 0,118, 0, 0, 0,216, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,216, 1, 0, 0, -217, 1, 0, 0,215, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 62, 0, 0, 0,215, 1, 0, 0,217, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,217, 1, 0, 0,216, 1, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,180, 0, 0, 0, 5, 0, 0, 0, -202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,202, 0, 0, 0,217, 1, 0, 0,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 51, 0, 0, 0,180, 0, 0, 0,217, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,217, 1, 0, 0,202, 0, 0, 0, 62, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,181, 0, 0, 0, 51, 0, 0, 0,216, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,216, 1, 0, 0, - 58, 1, 0, 0,181, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 0, 0, 0,181, 0, 0, 0, 58, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 58, 1, 0, 0,216, 1, 0, 0,118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,218, 1, 0, 0,120, 0, 0, 0, - 63, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 63, 1, 0, 0,215, 0, 0, 0,218, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 68, 0, 0, 0,218, 1, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,215, 0, 0, 0, 63, 1, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,218, 1, 0, 0, 68, 0, 0, 0,219, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,219, 1, 0, 0, -220, 1, 0, 0,218, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,120, 0, 0, 0,218, 1, 0, 0,220, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,220, 1, 0, 0,219, 1, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,173, 0, 0, 0, 14, 0, 0, 0, - 62, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 62, 1, 0, 0,220, 1, 0, 0,173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 47, 0, 0, 0,173, 0, 0, 0,220, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,220, 1, 0, 0, 62, 1, 0, 0,120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,172, 0, 0, 0, 47, 0, 0, 0,219, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,219, 1, 0, 0, -214, 0, 0, 0,172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 0, 0,172, 0, 0, 0,214, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,214, 0, 0, 0,219, 1, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,221, 1, 0, 0,120, 0, 0, 0, - 62, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 62, 1, 0, 0, 64, 1, 0, 0,221, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -121, 0, 0, 0,221, 1, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 64, 1, 0, 0, 62, 1, 0, 0, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,221, 1, 0, 0,121, 0, 0, 0,222, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,222, 1, 0, 0, -223, 1, 0, 0,221, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,120, 0, 0, 0,221, 1, 0, 0,223, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,223, 1, 0, 0,222, 1, 0, 0,122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 67, 1, 0, 0, 25, 0, 0, 0, - 63, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 63, 1, 0, 0,223, 1, 0, 0, 67, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -122, 0, 0, 0, 67, 1, 0, 0,223, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,223, 1, 0, 0, 63, 1, 0, 0,120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 66, 1, 0, 0,122, 0, 0, 0,222, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,222, 1, 0, 0, - 65, 1, 0, 0, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 24, 0, 0, 0, 66, 1, 0, 0, 65, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 65, 1, 0, 0,222, 1, 0, 0,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,224, 1, 0, 0, 67, 0, 0, 0, -212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,212, 0, 0, 0,216, 0, 0, 0,224, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 69, 0, 0, 0,224, 1, 0, 0,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,216, 0, 0, 0,212, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,224, 1, 0, 0, 69, 0, 0, 0,225, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,225, 1, 0, 0, -226, 1, 0, 0,224, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 67, 0, 0, 0,224, 1, 0, 0,226, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,226, 1, 0, 0,225, 1, 0, 0,122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 66, 1, 0, 0, 24, 0, 0, 0, -213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,213, 0, 0, 0,226, 1, 0, 0, 66, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -122, 0, 0, 0, 66, 1, 0, 0,226, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,226, 1, 0, 0,213, 0, 0, 0, 67, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 67, 1, 0, 0,122, 0, 0, 0,225, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,225, 1, 0, 0, -217, 0, 0, 0, 67, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25, 0, 0, 0, 67, 1, 0, 0,217, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,217, 0, 0, 0,225, 1, 0, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,227, 1, 0, 0, 66, 0, 0, 0, -211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,211, 0, 0, 0, 65, 1, 0, 0,227, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -121, 0, 0, 0,227, 1, 0, 0, 65, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 65, 1, 0, 0,211, 0, 0, 0, 24, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,227, 1, 0, 0,121, 0, 0, 0,228, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,228, 1, 0, 0, -229, 1, 0, 0,227, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 66, 0, 0, 0,227, 1, 0, 0,229, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,229, 1, 0, 0,228, 1, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,170, 0, 0, 0, 1, 0, 0, 0, -210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 0,229, 1, 0, 0,170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 46, 0, 0, 0,170, 0, 0, 0,229, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,229, 1, 0, 0,210, 0, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,171, 0, 0, 0, 46, 0, 0, 0,228, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,228, 1, 0, 0, - 64, 1, 0, 0,171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 14, 0, 0, 0,171, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 64, 1, 0, 0,228, 1, 0, 0,121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,230, 1, 0, 0,123, 0, 0, 0, - 69, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 69, 1, 0, 0,223, 0, 0, 0,230, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 72, 0, 0, 0,230, 1, 0, 0,223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,223, 0, 0, 0, 69, 1, 0, 0, 27, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,230, 1, 0, 0, 72, 0, 0, 0,231, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,231, 1, 0, 0, -232, 1, 0, 0,230, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,123, 0, 0, 0,230, 1, 0, 0,232, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,232, 1, 0, 0,231, 1, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,189, 0, 0, 0, 18, 0, 0, 0, - 68, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 68, 1, 0, 0,232, 1, 0, 0,189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 55, 0, 0, 0,189, 0, 0, 0,232, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,232, 1, 0, 0, 68, 1, 0, 0,123, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,188, 0, 0, 0, 55, 0, 0, 0,231, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,231, 1, 0, 0, -222, 0, 0, 0,188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0,188, 0, 0, 0,222, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,222, 0, 0, 0,231, 1, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,233, 1, 0, 0,123, 0, 0, 0, - 68, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 68, 1, 0, 0, 70, 1, 0, 0,233, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -124, 0, 0, 0,233, 1, 0, 0, 70, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 70, 1, 0, 0, 68, 1, 0, 0, 18, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,233, 1, 0, 0,124, 0, 0, 0,234, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,234, 1, 0, 0, -235, 1, 0, 0,233, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,123, 0, 0, 0,233, 1, 0, 0,235, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,235, 1, 0, 0,234, 1, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 73, 1, 0, 0, 27, 0, 0, 0, - 69, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 69, 1, 0, 0,235, 1, 0, 0, 73, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -125, 0, 0, 0, 73, 1, 0, 0,235, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,235, 1, 0, 0, 69, 1, 0, 0,123, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 72, 1, 0, 0,125, 0, 0, 0,234, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,234, 1, 0, 0, - 71, 1, 0, 0, 72, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 26, 0, 0, 0, 72, 1, 0, 0, 71, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 71, 1, 0, 0,234, 1, 0, 0,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,236, 1, 0, 0, 71, 0, 0, 0, -220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,220, 0, 0, 0,224, 0, 0, 0,236, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 73, 0, 0, 0,236, 1, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,224, 0, 0, 0,220, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,236, 1, 0, 0, 73, 0, 0, 0,237, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,237, 1, 0, 0, -238, 1, 0, 0,236, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 71, 0, 0, 0,236, 1, 0, 0,238, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,238, 1, 0, 0,237, 1, 0, 0,125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 72, 1, 0, 0, 26, 0, 0, 0, -221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,221, 0, 0, 0,238, 1, 0, 0, 72, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -125, 0, 0, 0, 72, 1, 0, 0,238, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,238, 1, 0, 0,221, 0, 0, 0, 71, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 73, 1, 0, 0,125, 0, 0, 0,237, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,237, 1, 0, 0, -225, 0, 0, 0, 73, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27, 0, 0, 0, 73, 1, 0, 0,225, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,225, 0, 0, 0,237, 1, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,239, 1, 0, 0, 70, 0, 0, 0, -219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,219, 0, 0, 0, 71, 1, 0, 0,239, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -124, 0, 0, 0,239, 1, 0, 0, 71, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 71, 1, 0, 0,219, 0, 0, 0, 26, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,239, 1, 0, 0,124, 0, 0, 0,240, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,240, 1, 0, 0, -241, 1, 0, 0,239, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 70, 0, 0, 0,239, 1, 0, 0,241, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,241, 1, 0, 0,240, 1, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,186, 0, 0, 0, 2, 0, 0, 0, -218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,218, 0, 0, 0,241, 1, 0, 0,186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 54, 0, 0, 0,186, 0, 0, 0,241, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,241, 1, 0, 0,218, 0, 0, 0, 70, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,187, 0, 0, 0, 54, 0, 0, 0,240, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,240, 1, 0, 0, - 70, 1, 0, 0,187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 18, 0, 0, 0,187, 0, 0, 0, 70, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 70, 1, 0, 0,240, 1, 0, 0,124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,242, 1, 0, 0,126, 0, 0, 0, - 75, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 75, 1, 0, 0,231, 0, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 76, 0, 0, 0,242, 1, 0, 0,231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,231, 0, 0, 0, 75, 1, 0, 0, 29, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,242, 1, 0, 0, 76, 0, 0, 0,243, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,243, 1, 0, 0, -244, 1, 0, 0,242, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,126, 0, 0, 0,242, 1, 0, 0,244, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,244, 1, 0, 0,243, 1, 0, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,197, 0, 0, 0, 20, 0, 0, 0, - 74, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 74, 1, 0, 0,244, 1, 0, 0,197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 59, 0, 0, 0,197, 0, 0, 0,244, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,244, 1, 0, 0, 74, 1, 0, 0,126, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,196, 0, 0, 0, 59, 0, 0, 0,243, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,243, 1, 0, 0, -230, 0, 0, 0,196, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0,196, 0, 0, 0,230, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,230, 0, 0, 0,243, 1, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,245, 1, 0, 0,126, 0, 0, 0, - 74, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 74, 1, 0, 0, 76, 1, 0, 0,245, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -127, 0, 0, 0,245, 1, 0, 0, 76, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 76, 1, 0, 0, 74, 1, 0, 0, 20, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,245, 1, 0, 0,127, 0, 0, 0,246, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,246, 1, 0, 0, -247, 1, 0, 0,245, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,126, 0, 0, 0,245, 1, 0, 0,247, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,247, 1, 0, 0,246, 1, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 79, 1, 0, 0, 29, 0, 0, 0, - 75, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 75, 1, 0, 0,247, 1, 0, 0, 79, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -128, 0, 0, 0, 79, 1, 0, 0,247, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,247, 1, 0, 0, 75, 1, 0, 0,126, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 78, 1, 0, 0,128, 0, 0, 0,246, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,246, 1, 0, 0, - 77, 1, 0, 0, 78, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28, 0, 0, 0, 78, 1, 0, 0, 77, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 77, 1, 0, 0,246, 1, 0, 0,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,248, 1, 0, 0, 75, 0, 0, 0, -228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,228, 0, 0, 0,232, 0, 0, 0,248, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 77, 0, 0, 0,248, 1, 0, 0,232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 0,228, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,248, 1, 0, 0, 77, 0, 0, 0,249, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,249, 1, 0, 0, -250, 1, 0, 0,248, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 75, 0, 0, 0,248, 1, 0, 0,250, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,250, 1, 0, 0,249, 1, 0, 0,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 78, 1, 0, 0, 28, 0, 0, 0, -229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,229, 0, 0, 0,250, 1, 0, 0, 78, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -128, 0, 0, 0, 78, 1, 0, 0,250, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,250, 1, 0, 0,229, 0, 0, 0, 75, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 79, 1, 0, 0,128, 0, 0, 0,249, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,249, 1, 0, 0, -233, 0, 0, 0, 79, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 29, 0, 0, 0, 79, 1, 0, 0,233, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,233, 0, 0, 0,249, 1, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,251, 1, 0, 0, 74, 0, 0, 0, -227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,227, 0, 0, 0, 77, 1, 0, 0,251, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -127, 0, 0, 0,251, 1, 0, 0, 77, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 77, 1, 0, 0,227, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,251, 1, 0, 0,127, 0, 0, 0,252, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,252, 1, 0, 0, -253, 1, 0, 0,251, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 74, 0, 0, 0,251, 1, 0, 0,253, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,253, 1, 0, 0,252, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,194, 0, 0, 0, 3, 0, 0, 0, -226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,226, 0, 0, 0,253, 1, 0, 0,194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 58, 0, 0, 0,194, 0, 0, 0,253, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,253, 1, 0, 0,226, 0, 0, 0, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,195, 0, 0, 0, 58, 0, 0, 0,252, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,252, 1, 0, 0, - 76, 1, 0, 0,195, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 20, 0, 0, 0,195, 0, 0, 0, 76, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 76, 1, 0, 0,252, 1, 0, 0,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,254, 1, 0, 0,129, 0, 0, 0, - 81, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 81, 1, 0, 0,239, 0, 0, 0,254, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 80, 0, 0, 0,254, 1, 0, 0,239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,239, 0, 0, 0, 81, 1, 0, 0, 31, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,254, 1, 0, 0, 80, 0, 0, 0,255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,255, 1, 0, 0, - 0, 2, 0, 0,254, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,129, 0, 0, 0,254, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 2, 0, 0,255, 1, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,201, 0, 0, 0, 21, 0, 0, 0, - 80, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 80, 1, 0, 0, 0, 2, 0, 0,201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 61, 0, 0, 0,201, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 80, 1, 0, 0,129, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,200, 0, 0, 0, 61, 0, 0, 0,255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,255, 1, 0, 0, -238, 0, 0, 0,200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0,200, 0, 0, 0,238, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,238, 0, 0, 0,255, 1, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2, 0, 0,129, 0, 0, 0, - 80, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 80, 1, 0, 0, 82, 1, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -130, 0, 0, 0, 1, 2, 0, 0, 82, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 82, 1, 0, 0, 80, 1, 0, 0, 21, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 1, 2, 0, 0,130, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 0, 0, - 3, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,129, 0, 0, 0, 1, 2, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 3, 2, 0, 0, 2, 2, 0, 0,131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 85, 1, 0, 0, 31, 0, 0, 0, - 81, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 81, 1, 0, 0, 3, 2, 0, 0, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -131, 0, 0, 0, 85, 1, 0, 0, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 0, 0, 81, 1, 0, 0,129, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 84, 1, 0, 0,131, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 0, 0, - 83, 1, 0, 0, 84, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 0, 0, 0, 84, 1, 0, 0, 83, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 83, 1, 0, 0, 2, 2, 0, 0,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 2, 0, 0, 79, 0, 0, 0, -236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,236, 0, 0, 0,240, 0, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 81, 0, 0, 0, 4, 2, 0, 0,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,240, 0, 0, 0,236, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 4, 2, 0, 0, 81, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 2, 0, 0, - 6, 2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 79, 0, 0, 0, 4, 2, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 6, 2, 0, 0, 5, 2, 0, 0,131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 84, 1, 0, 0, 30, 0, 0, 0, -237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,237, 0, 0, 0, 6, 2, 0, 0, 84, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -131, 0, 0, 0, 84, 1, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 2, 0, 0,237, 0, 0, 0, 79, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 85, 1, 0, 0,131, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 2, 0, 0, -241, 0, 0, 0, 85, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 0, 0, 0, 85, 1, 0, 0,241, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,241, 0, 0, 0, 5, 2, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 2, 0, 0, 78, 0, 0, 0, -235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,235, 0, 0, 0, 83, 1, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -130, 0, 0, 0, 7, 2, 0, 0, 83, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 83, 1, 0, 0,235, 0, 0, 0, 30, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 7, 2, 0, 0,130, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 2, 0, 0, - 9, 2, 0, 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 78, 0, 0, 0, 7, 2, 0, 0, 9, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 9, 2, 0, 0, 8, 2, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,198, 0, 0, 0, 4, 0, 0, 0, -234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,234, 0, 0, 0, 9, 2, 0, 0,198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 60, 0, 0, 0,198, 0, 0, 0, 9, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 2, 0, 0,234, 0, 0, 0, 78, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,199, 0, 0, 0, 60, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 2, 0, 0, - 82, 1, 0, 0,199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 21, 0, 0, 0,199, 0, 0, 0, 82, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 82, 1, 0, 0, 8, 2, 0, 0,130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 87, 1, 0, 0,132, 0, 0, 0, - 10, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 10, 2, 0, 0,245, 0, 0, 0, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 32, 0, 0, 0, 87, 1, 0, 0,245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,245, 0, 0, 0, 10, 2, 0, 0, 83, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 11, 2, 0, 0, 83, 0, 0, 0, 10, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 10, 2, 0, 0, - 12, 2, 0, 0, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 65, 0, 0, 0, 11, 2, 0, 0, 12, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 12, 2, 0, 0, 10, 2, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 86, 1, 0, 0, 23, 0, 0, 0, -209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,209, 0, 0, 0, 12, 2, 0, 0, 86, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -132, 0, 0, 0, 86, 1, 0, 0, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 2, 0, 0,209, 0, 0, 0, 65, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 11, 2, 0, 0, 65, 0, 0, 0,208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,208, 0, 0, 0, -244, 0, 0, 0, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 83, 0, 0, 0, 11, 2, 0, 0,244, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,244, 0, 0, 0,208, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 86, 1, 0, 0,132, 0, 0, 0, - 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 2, 0, 0, 88, 1, 0, 0, 86, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 23, 0, 0, 0, 86, 1, 0, 0, 88, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 88, 1, 0, 0, 13, 2, 0, 0,133, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 14, 2, 0, 0,133, 0, 0, 0, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 2, 0, 0, - 15, 2, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,134, 0, 0, 0, 14, 2, 0, 0, 15, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 15, 2, 0, 0, 13, 2, 0, 0,132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 87, 1, 0, 0, 32, 0, 0, 0, - 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 91, 1, 0, 0, 15, 2, 0, 0, 87, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -132, 0, 0, 0, 87, 1, 0, 0, 15, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 2, 0, 0, 91, 1, 0, 0,134, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 14, 2, 0, 0,134, 0, 0, 0, 90, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 90, 1, 0, 0, - 89, 1, 0, 0, 14, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,133, 0, 0, 0, 14, 2, 0, 0, 89, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 89, 1, 0, 0, 90, 1, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,212, 0, 0, 0, 67, 0, 0, 0, - 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 2, 0, 0,242, 0, 0, 0,212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 6, 0, 0, 0,212, 0, 0, 0,242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,242, 0, 0, 0, 16, 2, 0, 0, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 17, 2, 0, 0, 82, 0, 0, 0, 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 2, 0, 0, - 18, 2, 0, 0, 17, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,134, 0, 0, 0, 17, 2, 0, 0, 18, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 18, 2, 0, 0, 16, 2, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,213, 0, 0, 0, 24, 0, 0, 0, - 90, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 90, 1, 0, 0, 18, 2, 0, 0,213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 67, 0, 0, 0,213, 0, 0, 0, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 18, 2, 0, 0, 90, 1, 0, 0,134, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 17, 2, 0, 0,134, 0, 0, 0, 91, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 91, 1, 0, 0, -243, 0, 0, 0, 17, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 82, 0, 0, 0, 17, 2, 0, 0,243, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,243, 0, 0, 0, 91, 1, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,211, 0, 0, 0, 66, 0, 0, 0, - 19, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 2, 0, 0, 89, 1, 0, 0,211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 24, 0, 0, 0,211, 0, 0, 0, 89, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 89, 1, 0, 0, 19, 2, 0, 0,133, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 20, 2, 0, 0,133, 0, 0, 0, 19, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 2, 0, 0, - 21, 2, 0, 0, 20, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 64, 0, 0, 0, 20, 2, 0, 0, 21, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 21, 2, 0, 0, 19, 2, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,210, 0, 0, 0, 1, 0, 0, 0, -206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,206, 0, 0, 0, 21, 2, 0, 0,210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 66, 0, 0, 0,210, 0, 0, 0, 21, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 21, 2, 0, 0,206, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 20, 2, 0, 0, 64, 0, 0, 0,207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,207, 0, 0, 0, - 88, 1, 0, 0, 20, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,133, 0, 0, 0, 20, 2, 0, 0, 88, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 88, 1, 0, 0,207, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 93, 1, 0, 0,135, 0, 0, 0, - 22, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 22, 2, 0, 0,247, 0, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 33, 0, 0, 0, 93, 1, 0, 0,247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,247, 0, 0, 0, 22, 2, 0, 0, 84, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 23, 2, 0, 0, 84, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 22, 2, 0, 0, - 24, 2, 0, 0, 23, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 69, 0, 0, 0, 23, 2, 0, 0, 24, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 24, 2, 0, 0, 22, 2, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 92, 1, 0, 0, 25, 0, 0, 0, -217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,217, 0, 0, 0, 24, 2, 0, 0, 92, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -135, 0, 0, 0, 92, 1, 0, 0, 24, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 24, 2, 0, 0,217, 0, 0, 0, 69, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 23, 2, 0, 0, 69, 0, 0, 0,216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,216, 0, 0, 0, -246, 0, 0, 0, 23, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 84, 0, 0, 0, 23, 2, 0, 0,246, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,246, 0, 0, 0,216, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 92, 1, 0, 0,135, 0, 0, 0, - 25, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25, 2, 0, 0, 94, 1, 0, 0, 92, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 25, 0, 0, 0, 92, 1, 0, 0, 94, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 94, 1, 0, 0, 25, 2, 0, 0,136, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 26, 2, 0, 0,136, 0, 0, 0, 25, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25, 2, 0, 0, - 27, 2, 0, 0, 26, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,137, 0, 0, 0, 26, 2, 0, 0, 27, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 27, 2, 0, 0, 25, 2, 0, 0,135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 93, 1, 0, 0, 33, 0, 0, 0, - 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 97, 1, 0, 0, 27, 2, 0, 0, 93, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -135, 0, 0, 0, 93, 1, 0, 0, 27, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 27, 2, 0, 0, 97, 1, 0, 0,137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 26, 2, 0, 0,137, 0, 0, 0, 96, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 96, 1, 0, 0, - 95, 1, 0, 0, 26, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,136, 0, 0, 0, 26, 2, 0, 0, 95, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 95, 1, 0, 0, 96, 1, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,220, 0, 0, 0, 71, 0, 0, 0, - 28, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28, 2, 0, 0,248, 0, 0, 0,220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 7, 0, 0, 0,220, 0, 0, 0,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,248, 0, 0, 0, 28, 2, 0, 0, 85, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 29, 2, 0, 0, 85, 0, 0, 0, 28, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 28, 2, 0, 0, - 30, 2, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,137, 0, 0, 0, 29, 2, 0, 0, 30, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 30, 2, 0, 0, 28, 2, 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,221, 0, 0, 0, 26, 0, 0, 0, - 96, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 96, 1, 0, 0, 30, 2, 0, 0,221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 71, 0, 0, 0,221, 0, 0, 0, 30, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 30, 2, 0, 0, 96, 1, 0, 0,137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 29, 2, 0, 0,137, 0, 0, 0, 97, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 97, 1, 0, 0, -249, 0, 0, 0, 29, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 85, 0, 0, 0, 29, 2, 0, 0,249, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,249, 0, 0, 0, 97, 1, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,219, 0, 0, 0, 70, 0, 0, 0, - 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 2, 0, 0, 95, 1, 0, 0,219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 26, 0, 0, 0,219, 0, 0, 0, 95, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 95, 1, 0, 0, 31, 2, 0, 0,136, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 32, 2, 0, 0,136, 0, 0, 0, 31, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 31, 2, 0, 0, - 33, 2, 0, 0, 32, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 68, 0, 0, 0, 32, 2, 0, 0, 33, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 33, 2, 0, 0, 31, 2, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,218, 0, 0, 0, 2, 0, 0, 0, -214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,214, 0, 0, 0, 33, 2, 0, 0,218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 70, 0, 0, 0,218, 0, 0, 0, 33, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 33, 2, 0, 0,214, 0, 0, 0, 68, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 32, 2, 0, 0, 68, 0, 0, 0,215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,215, 0, 0, 0, - 94, 1, 0, 0, 32, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,136, 0, 0, 0, 32, 2, 0, 0, 94, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 94, 1, 0, 0,215, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 99, 1, 0, 0,138, 0, 0, 0, - 34, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 34, 2, 0, 0,251, 0, 0, 0, 99, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 34, 0, 0, 0, 99, 1, 0, 0,251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,251, 0, 0, 0, 34, 2, 0, 0, 86, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 35, 2, 0, 0, 86, 0, 0, 0, 34, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 34, 2, 0, 0, - 36, 2, 0, 0, 35, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 73, 0, 0, 0, 35, 2, 0, 0, 36, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 36, 2, 0, 0, 34, 2, 0, 0,138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 98, 1, 0, 0, 27, 0, 0, 0, -225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,225, 0, 0, 0, 36, 2, 0, 0, 98, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -138, 0, 0, 0, 98, 1, 0, 0, 36, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 36, 2, 0, 0,225, 0, 0, 0, 73, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 35, 2, 0, 0, 73, 0, 0, 0,224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,224, 0, 0, 0, -250, 0, 0, 0, 35, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 86, 0, 0, 0, 35, 2, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,250, 0, 0, 0,224, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 98, 1, 0, 0,138, 0, 0, 0, - 37, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 2, 0, 0,100, 1, 0, 0, 98, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 27, 0, 0, 0, 98, 1, 0, 0,100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,100, 1, 0, 0, 37, 2, 0, 0,139, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 38, 2, 0, 0,139, 0, 0, 0, 37, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 2, 0, 0, - 39, 2, 0, 0, 38, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,140, 0, 0, 0, 38, 2, 0, 0, 39, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 39, 2, 0, 0, 37, 2, 0, 0,138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 99, 1, 0, 0, 34, 0, 0, 0, -103, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,103, 1, 0, 0, 39, 2, 0, 0, 99, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -138, 0, 0, 0, 99, 1, 0, 0, 39, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 39, 2, 0, 0,103, 1, 0, 0,140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 38, 2, 0, 0,140, 0, 0, 0,102, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,102, 1, 0, 0, -101, 1, 0, 0, 38, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,139, 0, 0, 0, 38, 2, 0, 0,101, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,101, 1, 0, 0,102, 1, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,228, 0, 0, 0, 75, 0, 0, 0, - 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 40, 2, 0, 0,252, 0, 0, 0,228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 8, 0, 0, 0,228, 0, 0, 0,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,252, 0, 0, 0, 40, 2, 0, 0, 87, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 41, 2, 0, 0, 87, 0, 0, 0, 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 40, 2, 0, 0, - 42, 2, 0, 0, 41, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,140, 0, 0, 0, 41, 2, 0, 0, 42, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 42, 2, 0, 0, 40, 2, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,229, 0, 0, 0, 28, 0, 0, 0, -102, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,102, 1, 0, 0, 42, 2, 0, 0,229, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 75, 0, 0, 0,229, 0, 0, 0, 42, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 42, 2, 0, 0,102, 1, 0, 0,140, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 41, 2, 0, 0,140, 0, 0, 0,103, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,103, 1, 0, 0, -253, 0, 0, 0, 41, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 87, 0, 0, 0, 41, 2, 0, 0,253, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,253, 0, 0, 0,103, 1, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,227, 0, 0, 0, 74, 0, 0, 0, - 43, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 43, 2, 0, 0,101, 1, 0, 0,227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 28, 0, 0, 0,227, 0, 0, 0,101, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,101, 1, 0, 0, 43, 2, 0, 0,139, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 44, 2, 0, 0,139, 0, 0, 0, 43, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 43, 2, 0, 0, - 45, 2, 0, 0, 44, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 72, 0, 0, 0, 44, 2, 0, 0, 45, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 45, 2, 0, 0, 43, 2, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,226, 0, 0, 0, 3, 0, 0, 0, -222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,222, 0, 0, 0, 45, 2, 0, 0,226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 74, 0, 0, 0,226, 0, 0, 0, 45, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 45, 2, 0, 0,222, 0, 0, 0, 72, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 44, 2, 0, 0, 72, 0, 0, 0,223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,223, 0, 0, 0, -100, 1, 0, 0, 44, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,139, 0, 0, 0, 44, 2, 0, 0,100, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,100, 1, 0, 0,223, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,105, 1, 0, 0,141, 0, 0, 0, - 46, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 46, 2, 0, 0,255, 0, 0, 0,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 35, 0, 0, 0,105, 1, 0, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,255, 0, 0, 0, 46, 2, 0, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 47, 2, 0, 0, 88, 0, 0, 0, 46, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 46, 2, 0, 0, - 48, 2, 0, 0, 47, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 77, 0, 0, 0, 47, 2, 0, 0, 48, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 48, 2, 0, 0, 46, 2, 0, 0,141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 1, 0, 0, 29, 0, 0, 0, -233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,233, 0, 0, 0, 48, 2, 0, 0,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -141, 0, 0, 0,104, 1, 0, 0, 48, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 48, 2, 0, 0,233, 0, 0, 0, 77, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 47, 2, 0, 0, 77, 0, 0, 0,232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,232, 0, 0, 0, -254, 0, 0, 0, 47, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 88, 0, 0, 0, 47, 2, 0, 0,254, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,254, 0, 0, 0,232, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 1, 0, 0,141, 0, 0, 0, - 49, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 49, 2, 0, 0,106, 1, 0, 0,104, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 29, 0, 0, 0,104, 1, 0, 0,106, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,106, 1, 0, 0, 49, 2, 0, 0,142, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 50, 2, 0, 0,142, 0, 0, 0, 49, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 49, 2, 0, 0, - 51, 2, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,143, 0, 0, 0, 50, 2, 0, 0, 51, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 51, 2, 0, 0, 49, 2, 0, 0,141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,105, 1, 0, 0, 35, 0, 0, 0, -109, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,109, 1, 0, 0, 51, 2, 0, 0,105, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -141, 0, 0, 0,105, 1, 0, 0, 51, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 51, 2, 0, 0,109, 1, 0, 0,143, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 50, 2, 0, 0,143, 0, 0, 0,108, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,108, 1, 0, 0, -107, 1, 0, 0, 50, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,142, 0, 0, 0, 50, 2, 0, 0,107, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,107, 1, 0, 0,108, 1, 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,236, 0, 0, 0, 79, 0, 0, 0, - 52, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 52, 2, 0, 0, 0, 1, 0, 0,236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 9, 0, 0, 0,236, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 52, 2, 0, 0, 89, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 53, 2, 0, 0, 89, 0, 0, 0, 52, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 52, 2, 0, 0, - 54, 2, 0, 0, 53, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,143, 0, 0, 0, 53, 2, 0, 0, 54, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 54, 2, 0, 0, 52, 2, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,237, 0, 0, 0, 30, 0, 0, 0, -108, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,108, 1, 0, 0, 54, 2, 0, 0,237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 79, 0, 0, 0,237, 0, 0, 0, 54, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 54, 2, 0, 0,108, 1, 0, 0,143, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 53, 2, 0, 0,143, 0, 0, 0,109, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,109, 1, 0, 0, - 1, 1, 0, 0, 53, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 89, 0, 0, 0, 53, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 1, 1, 0, 0,109, 1, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,235, 0, 0, 0, 78, 0, 0, 0, - 55, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 2, 0, 0,107, 1, 0, 0,235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 30, 0, 0, 0,235, 0, 0, 0,107, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,107, 1, 0, 0, 55, 2, 0, 0,142, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 56, 2, 0, 0,142, 0, 0, 0, 55, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 55, 2, 0, 0, - 57, 2, 0, 0, 56, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 76, 0, 0, 0, 56, 2, 0, 0, 57, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 57, 2, 0, 0, 55, 2, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,234, 0, 0, 0, 4, 0, 0, 0, -230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,230, 0, 0, 0, 57, 2, 0, 0,234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 78, 0, 0, 0,234, 0, 0, 0, 57, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 57, 2, 0, 0,230, 0, 0, 0, 76, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 56, 2, 0, 0, 76, 0, 0, 0,231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,231, 0, 0, 0, -106, 1, 0, 0, 56, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,142, 0, 0, 0, 56, 2, 0, 0,106, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,106, 1, 0, 0,231, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,111, 1, 0, 0,144, 0, 0, 0, - 58, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58, 2, 0, 0, 3, 1, 0, 0,111, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 36, 0, 0, 0,111, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 0, 0, 58, 2, 0, 0, 90, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 59, 2, 0, 0, 90, 0, 0, 0, 58, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 58, 2, 0, 0, - 60, 2, 0, 0, 59, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 81, 0, 0, 0, 59, 2, 0, 0, 60, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 60, 2, 0, 0, 58, 2, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 1, 0, 0, 31, 0, 0, 0, -241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,241, 0, 0, 0, 60, 2, 0, 0,110, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -144, 0, 0, 0,110, 1, 0, 0, 60, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 60, 2, 0, 0,241, 0, 0, 0, 81, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 59, 2, 0, 0, 81, 0, 0, 0,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,240, 0, 0, 0, - 2, 1, 0, 0, 59, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 90, 0, 0, 0, 59, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 2, 1, 0, 0,240, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 1, 0, 0,144, 0, 0, 0, - 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 61, 2, 0, 0,113, 1, 0, 0,110, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 31, 0, 0, 0,110, 1, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,113, 1, 0, 0, 61, 2, 0, 0,145, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 62, 2, 0, 0,145, 0, 0, 0, 61, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 61, 2, 0, 0, - 63, 2, 0, 0, 62, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,146, 0, 0, 0, 62, 2, 0, 0, 63, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 63, 2, 0, 0, 61, 2, 0, 0,144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,111, 1, 0, 0, 36, 0, 0, 0, -115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,115, 1, 0, 0, 63, 2, 0, 0,111, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -144, 0, 0, 0,111, 1, 0, 0, 63, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 63, 2, 0, 0,115, 1, 0, 0,146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 62, 2, 0, 0,146, 0, 0, 0,114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,114, 1, 0, 0, -112, 1, 0, 0, 62, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,145, 0, 0, 0, 62, 2, 0, 0,112, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,112, 1, 0, 0,114, 1, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,204, 0, 0, 0, 63, 0, 0, 0, - 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 64, 2, 0, 0, 4, 1, 0, 0,204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 10, 0, 0, 0,204, 0, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 1, 0, 0, 64, 2, 0, 0, 91, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 65, 2, 0, 0, 91, 0, 0, 0, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 64, 2, 0, 0, - 66, 2, 0, 0, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,146, 0, 0, 0, 65, 2, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 66, 2, 0, 0, 64, 2, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,205, 0, 0, 0, 22, 0, 0, 0, -114, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,114, 1, 0, 0, 66, 2, 0, 0,205, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 63, 0, 0, 0,205, 0, 0, 0, 66, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 66, 2, 0, 0,114, 1, 0, 0,146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 65, 2, 0, 0,146, 0, 0, 0,115, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,115, 1, 0, 0, - 5, 1, 0, 0, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 91, 0, 0, 0, 65, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 5, 1, 0, 0,115, 1, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,203, 0, 0, 0, 62, 0, 0, 0, - 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 67, 2, 0, 0,112, 1, 0, 0,203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 22, 0, 0, 0,203, 0, 0, 0,112, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,112, 1, 0, 0, 67, 2, 0, 0,145, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 68, 2, 0, 0,145, 0, 0, 0, 67, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 67, 2, 0, 0, - 69, 2, 0, 0, 68, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 80, 0, 0, 0, 68, 2, 0, 0, 69, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 69, 2, 0, 0, 67, 2, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,202, 0, 0, 0, 5, 0, 0, 0, -238, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,238, 0, 0, 0, 69, 2, 0, 0,202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 62, 0, 0, 0,202, 0, 0, 0, 69, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 69, 2, 0, 0,238, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 68, 2, 0, 0, 80, 0, 0, 0,239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,239, 0, 0, 0, -113, 1, 0, 0, 68, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,145, 0, 0, 0, 68, 2, 0, 0,113, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,113, 1, 0, 0,239, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 70, 2, 0, 0,147, 0, 0, 0, -117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,117, 1, 0, 0, 11, 1, 0, 0, 70, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 94, 0, 0, 0, 70, 2, 0, 0, 11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 11, 1, 0, 0,117, 1, 0, 0, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 70, 2, 0, 0, 94, 0, 0, 0, 71, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 71, 2, 0, 0, - 72, 2, 0, 0, 70, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,147, 0, 0, 0, 70, 2, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 72, 2, 0, 0, 71, 2, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,243, 0, 0, 0, 32, 0, 0, 0, -116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 1, 0, 0, 72, 2, 0, 0,243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 82, 0, 0, 0,243, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 72, 2, 0, 0,116, 1, 0, 0,147, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,242, 0, 0, 0, 82, 0, 0, 0, 71, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 71, 2, 0, 0, - 10, 1, 0, 0,242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 0, 0, 0,242, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 10, 1, 0, 0, 71, 2, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 73, 2, 0, 0,147, 0, 0, 0, -116, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 1, 0, 0,118, 1, 0, 0, 73, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -148, 0, 0, 0, 73, 2, 0, 0,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,118, 1, 0, 0,116, 1, 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 73, 2, 0, 0,148, 0, 0, 0, 74, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 74, 2, 0, 0, - 75, 2, 0, 0, 73, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,147, 0, 0, 0, 73, 2, 0, 0, 75, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 75, 2, 0, 0, 74, 2, 0, 0,149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,121, 1, 0, 0, 38, 0, 0, 0, -117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,117, 1, 0, 0, 75, 2, 0, 0,121, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -149, 0, 0, 0,121, 1, 0, 0, 75, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 75, 2, 0, 0,117, 1, 0, 0,147, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,120, 1, 0, 0,149, 0, 0, 0, 74, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 74, 2, 0, 0, -119, 1, 0, 0,120, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 0, 0, 0,120, 1, 0, 0,119, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,119, 1, 0, 0, 74, 2, 0, 0,148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 76, 2, 0, 0, 93, 0, 0, 0, - 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 1, 0, 0, 12, 1, 0, 0, 76, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 95, 0, 0, 0, 76, 2, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 1, 0, 0, 8, 1, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 76, 2, 0, 0, 95, 0, 0, 0, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 77, 2, 0, 0, - 78, 2, 0, 0, 76, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 93, 0, 0, 0, 76, 2, 0, 0, 78, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 78, 2, 0, 0, 77, 2, 0, 0,149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,120, 1, 0, 0, 37, 0, 0, 0, - 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 1, 0, 0, 78, 2, 0, 0,120, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -149, 0, 0, 0,120, 1, 0, 0, 78, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 78, 2, 0, 0, 9, 1, 0, 0, 93, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,121, 1, 0, 0,149, 0, 0, 0, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 77, 2, 0, 0, - 13, 1, 0, 0,121, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 38, 0, 0, 0,121, 1, 0, 0, 13, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 13, 1, 0, 0, 77, 2, 0, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 79, 2, 0, 0, 92, 0, 0, 0, - 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 1, 0, 0,119, 1, 0, 0, 79, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -148, 0, 0, 0, 79, 2, 0, 0,119, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,119, 1, 0, 0, 7, 1, 0, 0, 37, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 79, 2, 0, 0,148, 0, 0, 0, 80, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 80, 2, 0, 0, - 81, 2, 0, 0, 79, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 92, 0, 0, 0, 79, 2, 0, 0, 81, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 81, 2, 0, 0, 80, 2, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,244, 0, 0, 0, 10, 0, 0, 0, - 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 1, 0, 0, 81, 2, 0, 0,244, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 83, 0, 0, 0,244, 0, 0, 0, 81, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 81, 2, 0, 0, 6, 1, 0, 0, 92, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,245, 0, 0, 0, 83, 0, 0, 0, 80, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 80, 2, 0, 0, -118, 1, 0, 0,245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 32, 0, 0, 0,245, 0, 0, 0,118, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,118, 1, 0, 0, 80, 2, 0, 0,148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 82, 2, 0, 0,150, 0, 0, 0, -123, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,123, 1, 0, 0, 15, 1, 0, 0, 82, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 96, 0, 0, 0, 82, 2, 0, 0, 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 1, 0, 0,123, 1, 0, 0, 39, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 82, 2, 0, 0, 96, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 83, 2, 0, 0, - 84, 2, 0, 0, 82, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,150, 0, 0, 0, 82, 2, 0, 0, 84, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 84, 2, 0, 0, 83, 2, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,249, 0, 0, 0, 33, 0, 0, 0, -122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,122, 1, 0, 0, 84, 2, 0, 0,249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 85, 0, 0, 0,249, 0, 0, 0, 84, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 84, 2, 0, 0,122, 1, 0, 0,150, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,248, 0, 0, 0, 85, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 83, 2, 0, 0, - 14, 1, 0, 0,248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 0, 0, 0,248, 0, 0, 0, 14, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 14, 1, 0, 0, 83, 2, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 85, 2, 0, 0,150, 0, 0, 0, -122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,122, 1, 0, 0,124, 1, 0, 0, 85, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -151, 0, 0, 0, 85, 2, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,124, 1, 0, 0,122, 1, 0, 0, 33, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 85, 2, 0, 0,151, 0, 0, 0, 86, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 86, 2, 0, 0, - 87, 2, 0, 0, 85, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,150, 0, 0, 0, 85, 2, 0, 0, 87, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 87, 2, 0, 0, 86, 2, 0, 0,152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,127, 1, 0, 0, 39, 0, 0, 0, -123, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,123, 1, 0, 0, 87, 2, 0, 0,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -152, 0, 0, 0,127, 1, 0, 0, 87, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 87, 2, 0, 0,123, 1, 0, 0,150, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,126, 1, 0, 0,152, 0, 0, 0, 86, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 86, 2, 0, 0, -125, 1, 0, 0,126, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 38, 0, 0, 0,126, 1, 0, 0,125, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,125, 1, 0, 0, 86, 2, 0, 0,151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 88, 2, 0, 0, 95, 0, 0, 0, - 12, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 1, 0, 0, 16, 1, 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 97, 0, 0, 0, 88, 2, 0, 0, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 1, 0, 0, 12, 1, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 88, 2, 0, 0, 97, 0, 0, 0, 89, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 89, 2, 0, 0, - 90, 2, 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 95, 0, 0, 0, 88, 2, 0, 0, 90, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 90, 2, 0, 0, 89, 2, 0, 0,152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,126, 1, 0, 0, 38, 0, 0, 0, - 13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 13, 1, 0, 0, 90, 2, 0, 0,126, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -152, 0, 0, 0,126, 1, 0, 0, 90, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 90, 2, 0, 0, 13, 1, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,127, 1, 0, 0,152, 0, 0, 0, 89, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 89, 2, 0, 0, - 17, 1, 0, 0,127, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 39, 0, 0, 0,127, 1, 0, 0, 17, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 17, 1, 0, 0, 89, 2, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 91, 2, 0, 0, 94, 0, 0, 0, - 11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 11, 1, 0, 0,125, 1, 0, 0, 91, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -151, 0, 0, 0, 91, 2, 0, 0,125, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,125, 1, 0, 0, 11, 1, 0, 0, 38, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 91, 2, 0, 0,151, 0, 0, 0, 92, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 92, 2, 0, 0, - 93, 2, 0, 0, 91, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 94, 0, 0, 0, 91, 2, 0, 0, 93, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 93, 2, 0, 0, 92, 2, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,246, 0, 0, 0, 6, 0, 0, 0, - 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 10, 1, 0, 0, 93, 2, 0, 0,246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 84, 0, 0, 0,246, 0, 0, 0, 93, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 93, 2, 0, 0, 10, 1, 0, 0, 94, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,247, 0, 0, 0, 84, 0, 0, 0, 92, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 92, 2, 0, 0, -124, 1, 0, 0,247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 33, 0, 0, 0,247, 0, 0, 0,124, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,124, 1, 0, 0, 92, 2, 0, 0,151, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 94, 2, 0, 0,153, 0, 0, 0, -129, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,129, 1, 0, 0, 19, 1, 0, 0, 94, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 98, 0, 0, 0, 94, 2, 0, 0, 19, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 1, 0, 0,129, 1, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 94, 2, 0, 0, 98, 0, 0, 0, 95, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 95, 2, 0, 0, - 96, 2, 0, 0, 94, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,153, 0, 0, 0, 94, 2, 0, 0, 96, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 96, 2, 0, 0, 95, 2, 0, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,253, 0, 0, 0, 34, 0, 0, 0, -128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,128, 1, 0, 0, 96, 2, 0, 0,253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 87, 0, 0, 0,253, 0, 0, 0, 96, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 96, 2, 0, 0,128, 1, 0, 0,153, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,252, 0, 0, 0, 87, 0, 0, 0, 95, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 95, 2, 0, 0, - 18, 1, 0, 0,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 0, 0, 0,252, 0, 0, 0, 18, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 18, 1, 0, 0, 95, 2, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 97, 2, 0, 0,153, 0, 0, 0, -128, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,128, 1, 0, 0,130, 1, 0, 0, 97, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -154, 0, 0, 0, 97, 2, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,130, 1, 0, 0,128, 1, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 97, 2, 0, 0,154, 0, 0, 0, 98, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 98, 2, 0, 0, - 99, 2, 0, 0, 97, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,153, 0, 0, 0, 97, 2, 0, 0, 99, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 99, 2, 0, 0, 98, 2, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,133, 1, 0, 0, 40, 0, 0, 0, -129, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,129, 1, 0, 0, 99, 2, 0, 0,133, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -155, 0, 0, 0,133, 1, 0, 0, 99, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 99, 2, 0, 0,129, 1, 0, 0,153, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,132, 1, 0, 0,155, 0, 0, 0, 98, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 98, 2, 0, 0, -131, 1, 0, 0,132, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 39, 0, 0, 0,132, 1, 0, 0,131, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,131, 1, 0, 0, 98, 2, 0, 0,154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,100, 2, 0, 0, 97, 0, 0, 0, - 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 16, 1, 0, 0, 20, 1, 0, 0,100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 99, 0, 0, 0,100, 2, 0, 0, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 20, 1, 0, 0, 16, 1, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,100, 2, 0, 0, 99, 0, 0, 0,101, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,101, 2, 0, 0, -102, 2, 0, 0,100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 97, 0, 0, 0,100, 2, 0, 0,102, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,102, 2, 0, 0,101, 2, 0, 0,155, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,132, 1, 0, 0, 39, 0, 0, 0, - 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 17, 1, 0, 0,102, 2, 0, 0,132, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -155, 0, 0, 0,132, 1, 0, 0,102, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,102, 2, 0, 0, 17, 1, 0, 0, 97, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,133, 1, 0, 0,155, 0, 0, 0,101, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,101, 2, 0, 0, - 21, 1, 0, 0,133, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 40, 0, 0, 0,133, 1, 0, 0, 21, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 21, 1, 0, 0,101, 2, 0, 0, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,103, 2, 0, 0, 96, 0, 0, 0, - 15, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 15, 1, 0, 0,131, 1, 0, 0,103, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -154, 0, 0, 0,103, 2, 0, 0,131, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,131, 1, 0, 0, 15, 1, 0, 0, 39, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,103, 2, 0, 0,154, 0, 0, 0,104, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 2, 0, 0, -105, 2, 0, 0,103, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 96, 0, 0, 0,103, 2, 0, 0,105, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,105, 2, 0, 0,104, 2, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,250, 0, 0, 0, 7, 0, 0, 0, - 14, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 14, 1, 0, 0,105, 2, 0, 0,250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 86, 0, 0, 0,250, 0, 0, 0,105, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,105, 2, 0, 0, 14, 1, 0, 0, 96, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,251, 0, 0, 0, 86, 0, 0, 0,104, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,104, 2, 0, 0, -130, 1, 0, 0,251, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 34, 0, 0, 0,251, 0, 0, 0,130, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,130, 1, 0, 0,104, 2, 0, 0,154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,106, 2, 0, 0,156, 0, 0, 0, -135, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,135, 1, 0, 0, 23, 1, 0, 0,106, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -100, 0, 0, 0,106, 2, 0, 0, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 23, 1, 0, 0,135, 1, 0, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,106, 2, 0, 0,100, 0, 0, 0,107, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,107, 2, 0, 0, -108, 2, 0, 0,106, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,156, 0, 0, 0,106, 2, 0, 0,108, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,108, 2, 0, 0,107, 2, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 1, 0, 0, 35, 0, 0, 0, -134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,134, 1, 0, 0,108, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 89, 0, 0, 0, 1, 1, 0, 0,108, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,108, 2, 0, 0,134, 1, 0, 0,156, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 89, 0, 0, 0,107, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,107, 2, 0, 0, - 22, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 9, 0, 0, 0, 0, 1, 0, 0, 22, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 22, 1, 0, 0,107, 2, 0, 0,100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,109, 2, 0, 0,156, 0, 0, 0, -134, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,134, 1, 0, 0,136, 1, 0, 0,109, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -157, 0, 0, 0,109, 2, 0, 0,136, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,136, 1, 0, 0,134, 1, 0, 0, 35, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,109, 2, 0, 0,157, 0, 0, 0,110, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 2, 0, 0, -111, 2, 0, 0,109, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,156, 0, 0, 0,109, 2, 0, 0,111, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,111, 2, 0, 0,110, 2, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,139, 1, 0, 0, 41, 0, 0, 0, -135, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,135, 1, 0, 0,111, 2, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -158, 0, 0, 0,139, 1, 0, 0,111, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,111, 2, 0, 0,135, 1, 0, 0,156, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,138, 1, 0, 0,158, 0, 0, 0,110, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,110, 2, 0, 0, -137, 1, 0, 0,138, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 40, 0, 0, 0,138, 1, 0, 0,137, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,137, 1, 0, 0,110, 2, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,112, 2, 0, 0, 99, 0, 0, 0, - 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 20, 1, 0, 0, 24, 1, 0, 0,112, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -101, 0, 0, 0,112, 2, 0, 0, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 24, 1, 0, 0, 20, 1, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,112, 2, 0, 0,101, 0, 0, 0,113, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,113, 2, 0, 0, -114, 2, 0, 0,112, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 99, 0, 0, 0,112, 2, 0, 0,114, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,114, 2, 0, 0,113, 2, 0, 0,158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,138, 1, 0, 0, 40, 0, 0, 0, - 21, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 21, 1, 0, 0,114, 2, 0, 0,138, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -158, 0, 0, 0,138, 1, 0, 0,114, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,114, 2, 0, 0, 21, 1, 0, 0, 99, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,139, 1, 0, 0,158, 0, 0, 0,113, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,113, 2, 0, 0, - 25, 1, 0, 0,139, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 41, 0, 0, 0,139, 1, 0, 0, 25, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 25, 1, 0, 0,113, 2, 0, 0,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,115, 2, 0, 0, 98, 0, 0, 0, - 19, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 19, 1, 0, 0,137, 1, 0, 0,115, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -157, 0, 0, 0,115, 2, 0, 0,137, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,137, 1, 0, 0, 19, 1, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,115, 2, 0, 0,157, 0, 0, 0,116, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 2, 0, 0, -117, 2, 0, 0,115, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 98, 0, 0, 0,115, 2, 0, 0,117, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,117, 2, 0, 0,116, 2, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,254, 0, 0, 0, 8, 0, 0, 0, - 18, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 18, 1, 0, 0,117, 2, 0, 0,254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 88, 0, 0, 0,254, 0, 0, 0,117, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,117, 2, 0, 0, 18, 1, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,255, 0, 0, 0, 88, 0, 0, 0,116, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,116, 2, 0, 0, -136, 1, 0, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 35, 0, 0, 0,255, 0, 0, 0,136, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,136, 1, 0, 0,116, 2, 0, 0,157, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,118, 2, 0, 0,159, 0, 0, 0, -141, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,141, 1, 0, 0, 7, 1, 0, 0,118, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 92, 0, 0, 0,118, 2, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 1, 0, 0,141, 1, 0, 0, 37, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,118, 2, 0, 0, 92, 0, 0, 0,119, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,119, 2, 0, 0, -120, 2, 0, 0,118, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,159, 0, 0, 0,118, 2, 0, 0,120, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,120, 2, 0, 0,119, 2, 0, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 1, 0, 0, 36, 0, 0, 0, -140, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,140, 1, 0, 0,120, 2, 0, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 91, 0, 0, 0, 5, 1, 0, 0,120, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,120, 2, 0, 0,140, 1, 0, 0,159, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 4, 1, 0, 0, 91, 0, 0, 0,119, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,119, 2, 0, 0, - 6, 1, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 10, 0, 0, 0, 4, 1, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 6, 1, 0, 0,119, 2, 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,121, 2, 0, 0,159, 0, 0, 0, -140, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,140, 1, 0, 0,142, 1, 0, 0,121, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -160, 0, 0, 0,121, 2, 0, 0,142, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,142, 1, 0, 0,140, 1, 0, 0, 36, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,121, 2, 0, 0,160, 0, 0, 0,122, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,122, 2, 0, 0, -123, 2, 0, 0,121, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,159, 0, 0, 0,121, 2, 0, 0,123, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,123, 2, 0, 0,122, 2, 0, 0,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,144, 1, 0, 0, 37, 0, 0, 0, -141, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,141, 1, 0, 0,123, 2, 0, 0,144, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -161, 0, 0, 0,144, 1, 0, 0,123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,123, 2, 0, 0,141, 1, 0, 0,159, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,145, 1, 0, 0,161, 0, 0, 0,122, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,122, 2, 0, 0, -143, 1, 0, 0,145, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 41, 0, 0, 0,145, 1, 0, 0,143, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,143, 1, 0, 0,122, 2, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,124, 2, 0, 0,101, 0, 0, 0, - 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 24, 1, 0, 0, 8, 1, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 93, 0, 0, 0,124, 2, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 1, 0, 0, 24, 1, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,124, 2, 0, 0, 93, 0, 0, 0,125, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,125, 2, 0, 0, -126, 2, 0, 0,124, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,101, 0, 0, 0,124, 2, 0, 0,126, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,126, 2, 0, 0,125, 2, 0, 0,161, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,145, 1, 0, 0, 41, 0, 0, 0, - 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 25, 1, 0, 0,126, 2, 0, 0,145, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -161, 0, 0, 0,145, 1, 0, 0,126, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,126, 2, 0, 0, 25, 1, 0, 0,101, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,144, 1, 0, 0,161, 0, 0, 0,125, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,125, 2, 0, 0, - 9, 1, 0, 0,144, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 0, 0, 0,144, 1, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 9, 1, 0, 0,125, 2, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,127, 2, 0, 0,100, 0, 0, 0, - 23, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 23, 1, 0, 0,143, 1, 0, 0,127, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, -160, 0, 0, 0,127, 2, 0, 0,143, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,143, 1, 0, 0, 23, 1, 0, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3,127, 2, 0, 0,160, 0, 0, 0,128, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,128, 2, 0, 0, -129, 2, 0, 0,127, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,100, 0, 0, 0,127, 2, 0, 0,129, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,129, 2, 0, 0,128, 2, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 9, 0, 0, 0, - 22, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 22, 1, 0, 0,129, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, - 90, 0, 0, 0, 2, 1, 0, 0,129, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,129, 2, 0, 0, 22, 1, 0, 0,100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 0, 0, 90, 0, 0, 0,128, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,128, 2, 0, 0, -142, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 36, 0, 0, 0, 3, 1, 0, 0,142, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3,142, 1, 0, 0,128, 2, 0, 0,160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 68, 65, 84, 65, 0,240, 0, 0, -176,193,119, 1, 0, 0, 0, 0, 60, 0, 0, 0, 0, 5, 0, 0,166,222,110, 63, 9,205, 55, 63,212,132,105, 63,201,236, 65, 63, -218,153,103, 63,119,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -218,153,103, 63,119,155, 54, 63,118,148,108, 63,211,160, 44, 63,166,222,110, 63, 9,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 36, 51,115, 63, 36, 28, 45, 63,166,222,110, 63, 9,205, 55, 63, -118,148,108, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,148,108, 63,211,160, 44, 63,218,153,103, 63,119,155, 54, 63, 87, 17,102, 63,229, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 56, 81, 96, 63,170, 55, 52, 63, 87, 17,102, 63,229, 52, 43, 63, -218,153,103, 63,119,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -218,153,103, 63,119,155, 54, 63, 9, 75, 97, 63, 92,233, 63, 63, 56, 81, 96, 63,170, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 49, 86, 60, 63, 56, 81, 96, 63,170, 55, 52, 63, - 9, 75, 97, 63, 92,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 9, 75, 97, 63, 92,233, 63, 63,218,153,103, 63,119,155, 54, 63,212,132,105, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,103,167, 98, 63,168, 39, 75, 63,138,153, 89, 63, 39,228, 82, 63, -139,153, 89, 63,255,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -139,153, 89, 63,255,153, 71, 63, 9, 75, 97, 63, 92,233, 63, 63,103,167, 98, 63,168, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,132,105, 63,201,236, 65, 63,103,167, 98, 63,168, 39, 75, 63, - 9, 75, 97, 63, 92,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 9, 75, 97, 63, 92,233, 63, 63,139,153, 89, 63,255,153, 71, 63,138,153, 89, 63, 49, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 56, 81, 96, 63,170, 55, 52, 63,138,153, 89, 63, 49, 86, 60, 63, -139,153, 89, 63, 79, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -139,153, 89, 63, 79, 12, 49, 63,205,182, 95, 63,222,228, 40, 63, 56, 81, 96, 63,170, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 87, 17,102, 63,229, 52, 43, 63, 56, 81, 96, 63,170, 55, 52, 63, -205,182, 95, 63,222,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -205,182, 95, 63,222,228, 40, 63,139,153, 89, 63, 79, 12, 49, 63,139,153, 89, 63, 45,200, 37, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,103,167, 98, 63,168, 39, 75, 63,212,132,105, 63,201,236, 65, 63, -168, 83,109, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -168, 83,109, 63,207, 83, 78, 63,135, 85,101, 63,148, 64, 88, 63,103,167, 98, 63,168, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 39,228, 82, 63,103,167, 98, 63,168, 39, 75, 63, -135, 85,101, 63,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -135, 85,101, 63,148, 64, 88, 63,168, 83,109, 63,207, 83, 78, 63, 36, 51,115, 63, 22, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,162, 18,121, 63,207, 83, 78, 63, 36, 51,115, 63, 22, 56, 90, 63, -168, 83,109, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -168, 83,109, 63,207, 83, 78, 63, 36, 51,115, 63,115, 23, 67, 63,162, 18,121, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,116,225,124, 63,202,236, 65, 63,162, 18,121, 63,207, 83, 78, 63, - 36, 51,115, 63,115, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 36, 51,115, 63,115, 23, 67, 63,168, 83,109, 63,207, 83, 78, 63,212,132,105, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,166,222,110, 63, 9,205, 55, 63, 36, 51,115, 63, 36, 28, 45, 63, -163,135,119, 63, 11,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -163,135,119, 63, 11,205, 55, 63, 36, 51,115, 63,115, 23, 67, 63,166,222,110, 63, 9,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,132,105, 63,201,236, 65, 63,166,222,110, 63, 9,205, 55, 63, - 36, 51,115, 63,115, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 36, 51,115, 63,115, 23, 67, 63,163,135,119, 63, 11,205, 55, 63,116,225,124, 63,202,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,162, 18,121, 63,207, 83, 78, 63,116,225,124, 63,202,236, 65, 63, -113,223,129, 63,170, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -113,223,129, 63,170, 39, 75, 63, 98,136,128, 63,148, 64, 88, 63,162, 18,121, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 36, 51,115, 63, 22, 56, 90, 63,162, 18,121, 63,207, 83, 78, 63, - 98,136,128, 63,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 95, 98,136, 59,148, 64, 88, 63,160,184,111, 60,170, 39, 75, 63,243,203, 76, 61, 41,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,243,203, 76, 61, 82, 12, 49, 63,246,203, 76, 61, 53, 86, 60, 63, - 31,162,194, 60,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 31,162,194, 60,172, 55, 52, 63,111,239,213, 60,223,228, 40, 63,243,203, 76, 61, 82, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,246,203, 76, 61, 48,200, 37, 63,243,203, 76, 61, 82, 12, 49, 63, -111,239,213, 60,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -111,239,213, 60,223,228, 40, 63, 31,162,194, 60,172, 55, 52, 63,120,226,169, 58,230, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,111,204,126, 63,121,155, 54, 63,121, 42,128, 63,230, 52, 43, 63, -136, 10,131, 63,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136, 10,131, 63,172, 55, 52, 63,160,141,130, 63, 95,233, 63, 63,111,204,126, 63,121,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,116,225,124, 63,202,236, 65, 63,111,204,126, 63,121,155, 54, 63, -160,141,130, 63, 95,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 11,104,163, 60, 95,233, 63, 63, 31,162,194, 60,172, 55, 52, 63,246,203, 76, 61, 53, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,244,203, 76, 61, 2,154, 71, 63,243,203, 76, 61, 41,228, 82, 63, -160,184,111, 60,170, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -160,184,111, 60,170, 39, 75, 63, 11,104,163, 60, 95,233, 63, 63,244,203, 76, 61, 2,154, 71, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,246,203, 76, 61, 53, 86, 60, 63,244,203, 76, 61, 2,154, 71, 63, - 11,104,163, 60, 95,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -160,141,130, 63, 95,233, 63, 63,113,223,129, 63,170, 39, 75, 63,116,225,124, 63,202,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,111,204,126, 63,121,155, 54, 63,116,225,124, 63,202,236, 65, 63, -163,135,119, 63, 11,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -163,135,119, 63, 11,205, 55, 63,210,209,121, 63,212,160, 44, 63,111,204,126, 63,121,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,121, 42,128, 63,230, 52, 43, 63,111,204,126, 63,121,155, 54, 63, -210,209,121, 63,212,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -210,209,121, 63,212,160, 44, 63,163,135,119, 63, 11,205, 55, 63, 36, 51,115, 63, 36, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 95,102,134, 63, 79, 46, 94, 63, 95,102,134, 63, 22,114,105, 63, - 52,205,124, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 52,205,124, 63, 58, 26, 99, 63, 98,136,128, 63,148, 64, 88, 63, 95,102,134, 63, 79, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,243,203, 76, 61, 41,228, 82, 63,234,203, 76, 61, 79, 46, 94, 63, - 95, 98,136, 59,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 98,136,128, 63,148, 64, 88, 63, 52,205,124, 63, 58, 26, 99, 63, 36, 51,115, 63, 22, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,153,105, 63, 58, 26, 99, 63, 36, 51,115, 63, 22, 56, 90, 63, - 52,205,124, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 52,205,124, 63, 58, 26, 99, 63, 32, 51,115, 63,212,154,109, 63, 21,153,105, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 19,114,105, 63, 21,153,105, 63, 58, 26, 99, 63, - 32, 51,115, 63,212,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 32, 51,115, 63,212,154,109, 63, 52,205,124, 63, 58, 26, 99, 63, 95,102,134, 63, 22,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 95,102,134, 63,242,187,116, 63, 3,153, 59, 63, 0, 0,128, 63, -136,153, 89, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136,153, 89, 63,242,187,116, 63, 32, 51,115, 63,212,154,109, 63, 95,102,134, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 95,102,134, 63, 22,114,105, 63, 95,102,134, 63,242,187,116, 63, - 32, 51,115, 63,212,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 32, 51,115, 63,212,154,109, 63,136,153, 89, 63,242,187,116, 63,138,153, 89, 63, 19,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,153,105, 63, 58, 26, 99, 63,138,153, 89, 63, 19,114,105, 63, -138,153, 89, 63, 77, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138,153, 89, 63, 77, 46, 94, 63,135, 85,101, 63,148, 64, 88, 63, 21,153,105, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 36, 51,115, 63, 22, 56, 90, 63, 21,153,105, 63, 58, 26, 99, 63, -135, 85,101, 63,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -135, 85,101, 63,148, 64, 88, 63,138,153, 89, 63, 77, 46, 94, 63,138,153, 89, 63, 39,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 67,153, 75, 63,113,155, 54, 63, 74,174, 73, 63,193,236, 65, 63, -124, 84, 68, 63,255,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -124, 84, 68, 63,255,204, 55, 63,169,158, 70, 63,200,160, 44, 63, 67,153, 75, 63,113,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,196, 33, 77, 63,221, 52, 43, 63, 67,153, 75, 63,113,155, 54, 63, -169,158, 70, 63,200,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169,158, 70, 63,200,160, 44, 63,124, 84, 68, 63,255,204, 55, 63, 0, 0, 64, 63, 24, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 67,153, 75, 63,113,155, 54, 63,196, 33, 77, 63,221, 52, 43, 63, -225,225, 82, 63,165, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225,225, 82, 63,165, 55, 52, 63, 16,232, 81, 63, 89,233, 63, 63, 67,153, 75, 63,113,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 74,174, 73, 63,193,236, 65, 63, 67,153, 75, 63,113,155, 54, 63, - 16,232, 81, 63, 89,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 16,232, 81, 63, 89,233, 63, 63,225,225, 82, 63,165, 55, 52, 63,138,153, 89, 63, 49, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,139,153, 89, 63,255,153, 71, 63,138,153, 89, 63, 39,228, 82, 63, -179,139, 80, 63,164, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -179,139, 80, 63,164, 39, 75, 63, 16,232, 81, 63, 89,233, 63, 63,139,153, 89, 63,255,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 49, 86, 60, 63,139,153, 89, 63,255,153, 71, 63, - 16,232, 81, 63, 89,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 16,232, 81, 63, 89,233, 63, 63,179,139, 80, 63,164, 39, 75, 63, 74,174, 73, 63,193,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,139,153, 89, 63, 79, 12, 49, 63,138,153, 89, 63, 49, 86, 60, 63, -225,225, 82, 63,165, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225,225, 82, 63,165, 55, 52, 63, 75,124, 83, 63,217,228, 40, 63,139,153, 89, 63, 79, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,139,153, 89, 63, 45,200, 37, 63,139,153, 89, 63, 79, 12, 49, 63, - 75,124, 83, 63,217,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 75,124, 83, 63,217,228, 40, 63,225,225, 82, 63,165, 55, 52, 63,196, 33, 77, 63,221, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,120,223, 69, 63,198, 83, 78, 63, 74,174, 73, 63,193,236, 65, 63, -179,139, 80, 63,164, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -179,139, 80, 63,164, 39, 75, 63,148,221, 77, 63,140, 64, 88, 63,120,223, 69, 63,198, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 12, 56, 90, 63,120,223, 69, 63,198, 83, 78, 63, -148,221, 77, 63,140, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -148,221, 77, 63,140, 64, 88, 63,179,139, 80, 63,164, 39, 75, 63,138,153, 89, 63, 39,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,120,223, 69, 63,198, 83, 78, 63, 0, 0, 64, 63, 12, 56, 90, 63, -136, 32, 58, 63,198, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136, 32, 58, 63,198, 83, 78, 63, 0, 0, 64, 63,106, 23, 67, 63,120,223, 69, 63,198, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 74,174, 73, 63,193,236, 65, 63,120,223, 69, 63,198, 83, 78, 63, - 0, 0, 64, 63,106, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,106, 23, 67, 63,136, 32, 58, 63,198, 83, 78, 63,182, 81, 54, 63,193,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,132,171, 59, 63,255,204, 55, 63, 0, 0, 64, 63, 24, 28, 45, 63, -124, 84, 68, 63,255,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -124, 84, 68, 63,255,204, 55, 63, 0, 0, 64, 63,106, 23, 67, 63,132,171, 59, 63,255,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,182, 81, 54, 63,193,236, 65, 63,132,171, 59, 63,255,204, 55, 63, - 0, 0, 64, 63,106, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,106, 23, 67, 63,124, 84, 68, 63,255,204, 55, 63, 74,174, 73, 63,193,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 77,116, 47, 63,164, 39, 75, 63,182, 81, 54, 63,193,236, 65, 63, -136, 32, 58, 63,198, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136, 32, 58, 63,198, 83, 78, 63,108, 34, 50, 63,140, 64, 88, 63, 77,116, 47, 63,164, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,102, 38, 63, 38,228, 82, 63, 77,116, 47, 63,164, 39, 75, 63, -108, 34, 50, 63,140, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -108, 34, 50, 63,140, 64, 88, 63,136, 32, 58, 63,198, 83, 78, 63, 0, 0, 64, 63, 12, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 31, 30, 45, 63,165, 55, 52, 63,117,102, 38, 63, 50, 86, 60, 63, -117,102, 38, 63, 78, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117,102, 38, 63, 78, 12, 49, 63,181,131, 44, 63,216,228, 40, 63, 31, 30, 45, 63,165, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 60,222, 50, 63,221, 52, 43, 63, 31, 30, 45, 63,165, 55, 52, 63, -181,131, 44, 63,216,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -181,131, 44, 63,216,228, 40, 63,117,102, 38, 63, 78, 12, 49, 63,117,102, 38, 63, 45,200, 37, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 31, 30, 45, 63,165, 55, 52, 63, 60,222, 50, 63,221, 52, 43, 63, -189,102, 52, 63,113,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -189,102, 52, 63,113,155, 54, 63,240, 23, 46, 63, 89,233, 63, 63, 31, 30, 45, 63,165, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63, 50, 86, 60, 63, 31, 30, 45, 63,165, 55, 52, 63, -240, 23, 46, 63, 89,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -240, 23, 46, 63, 89,233, 63, 63,189,102, 52, 63,113,155, 54, 63,182, 81, 54, 63,193,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 77,116, 47, 63,164, 39, 75, 63,118,102, 38, 63, 38,228, 82, 63, -117,102, 38, 63,255,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117,102, 38, 63,255,153, 71, 63,240, 23, 46, 63, 89,233, 63, 63, 77,116, 47, 63,164, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,182, 81, 54, 63,193,236, 65, 63, 77,116, 47, 63,164, 39, 75, 63, -240, 23, 46, 63, 89,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -240, 23, 46, 63, 89,233, 63, 63,117,102, 38, 63,255,153, 71, 63,117,102, 38, 63, 50, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,132,171, 59, 63,255,204, 55, 63,182, 81, 54, 63,193,236, 65, 63, -189,102, 52, 63,113,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -189,102, 52, 63,113,155, 54, 63, 87, 97, 57, 63,200,160, 44, 63,132,171, 59, 63,255,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 24, 28, 45, 63,132,171, 59, 63,255,204, 55, 63, - 87, 97, 57, 63,200,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87, 97, 57, 63,200,160, 44, 63,189,102, 52, 63,113,155, 54, 63, 60,222, 50, 63,221, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,250,101, 54, 63, 51, 26, 99, 63,118,102, 38, 63, 19,114,105, 63, -118,102, 38, 63, 77, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,102, 38, 63, 77, 46, 94, 63,108, 34, 50, 63,140, 64, 88, 63,250,101, 54, 63, 51, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 12, 56, 90, 63,250,101, 54, 63, 51, 26, 99, 63, -108, 34, 50, 63,140, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -108, 34, 50, 63,140, 64, 88, 63,118,102, 38, 63, 77, 46, 94, 63,118,102, 38, 63, 38,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,250,101, 54, 63, 51, 26, 99, 63, 0, 0, 64, 63, 12, 56, 90, 63, - 6,154, 73, 63, 51, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 6,154, 73, 63, 51, 26, 99, 63, 0, 0, 64, 63,206,154,109, 63,250,101, 54, 63, 51, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,102, 38, 63, 19,114,105, 63,250,101, 54, 63, 51, 26, 99, 63, - 0, 0, 64, 63,206,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,206,154,109, 63, 6,154, 73, 63, 51, 26, 99, 63,138,153, 89, 63, 19,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,136,153, 89, 63,242,187,116, 63, 3,153, 59, 63, 0, 0,128, 63, -120,102, 38, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -120,102, 38, 63,242,187,116, 63, 0, 0, 64, 63,206,154,109, 63,136,153, 89, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 19,114,105, 63,136,153, 89, 63,242,187,116, 63, - 0, 0, 64, 63,206,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,206,154,109, 63,120,102, 38, 63,242,187,116, 63,118,102, 38, 63, 19,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 77, 46, 94, 63,138,153, 89, 63, 19,114,105, 63, - 6,154, 73, 63, 51, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 6,154, 73, 63, 51, 26, 99, 63,148,221, 77, 63,140, 64, 88, 63,138,153, 89, 63, 77, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,153, 89, 63, 39,228, 82, 63,138,153, 89, 63, 77, 46, 94, 63, -148,221, 77, 63,140, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -148,221, 77, 63,140, 64, 88, 63, 6,154, 73, 63, 51, 26, 99, 63, 0, 0, 64, 63, 12, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,167, 71, 8, 62, 7,205, 55, 63,170,192,229, 61,200,236, 65, 63, -203,104,214, 61,120,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -203,104,214, 61,120,155, 54, 63,201, 61,254, 61,207,160, 44, 63,167, 71, 8, 62, 7,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173,153, 25, 62, 27, 28, 45, 63,167, 71, 8, 62, 7,205, 55, 63, -201, 61,254, 61,207,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -201, 61,254, 61,207,160, 44, 63,203,104,214, 61,120,155, 54, 63,175, 36,202, 61,228, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,145, 35,156, 61,172, 55, 52, 63,175, 36,202, 61,228, 52, 43, 63, -203,104,214, 61,120,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -203,104,214, 61,120,155, 54, 63, 32,242,163, 61, 96,233, 63, 63,145, 35,156, 61,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,246,203, 76, 61, 53, 86, 60, 63,145, 35,156, 61,172, 55, 52, 63, - 32,242,163, 61, 96,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 32,242,163, 61, 96,233, 63, 63,203,104,214, 61,120,155, 54, 63,170,192,229, 61,200,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 17,213,174, 61,171, 39, 75, 63,243,203, 76, 61, 41,228, 82, 63, -244,203, 76, 61, 2,154, 71, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -244,203, 76, 61, 2,154, 71, 63, 32,242,163, 61, 96,233, 63, 63, 17,213,174, 61,171, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,192,229, 61,200,236, 65, 63, 17,213,174, 61,171, 39, 75, 63, - 32,242,163, 61, 96,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 32,242,163, 61, 96,233, 63, 63,244,203, 76, 61, 2,154, 71, 63,246,203, 76, 61, 53, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,145, 35,156, 61,172, 55, 52, 63,246,203, 76, 61, 53, 86, 60, 63, -243,203, 76, 61, 82, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -243,203, 76, 61, 82, 12, 49, 63, 53, 80,151, 61,223,228, 40, 63,145, 35,156, 61,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,175, 36,202, 61,228, 52, 43, 63,145, 35,156, 61,172, 55, 52, 63, - 53, 80,151, 61,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 53, 80,151, 61,223,228, 40, 63,243,203, 76, 61, 82, 12, 49, 63,246,203, 76, 61, 48,200, 37, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 17,213,174, 61,171, 39, 75, 63,170,192,229, 61,200,236, 65, 63, -169, 27, 2, 62,204, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169, 27, 2, 62,204, 83, 78, 63, 23, 70,196, 61,147, 64, 88, 63, 17,213,174, 61,171, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,243,203, 76, 61, 41,228, 82, 63, 17,213,174, 61,171, 39, 75, 63, - 23, 70,196, 61,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 23, 70,196, 61,147, 64, 88, 63,169, 27, 2, 62,204, 83, 78, 63,160,153, 25, 62, 14, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,162, 23, 49, 62,195, 83, 78, 63,160,153, 25, 62, 14, 56, 90, 63, -169, 27, 2, 62,204, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169, 27, 2, 62,204, 83, 78, 63,172,153, 25, 62,108, 23, 67, 63,162, 23, 49, 62,195, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,240, 82, 64, 62,183,236, 65, 63,162, 23, 49, 62,195, 83, 78, 63, -172,153, 25, 62,108, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -172,153, 25, 62,108, 23, 67, 63,169, 27, 2, 62,204, 83, 78, 63,170,192,229, 61,200,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,167, 71, 8, 62, 7,205, 55, 63,173,153, 25, 62, 27, 28, 45, 63, -173,235, 42, 62,254,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -173,235, 42, 62,254,204, 55, 63,172,153, 25, 62,108, 23, 67, 63,167, 71, 8, 62, 7,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,192,229, 61,200,236, 65, 63,167, 71, 8, 62, 7,205, 55, 63, -172,153, 25, 62,108, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -172,153, 25, 62,108, 23, 67, 63,173,235, 42, 62,254,204, 55, 63,240, 82, 64, 62,183,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,162, 23, 49, 62,195, 83, 78, 63,240, 82, 64, 62,183,236, 65, 63, -166,200, 91, 62,147, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -166,200, 91, 62,147, 39, 75, 63, 34, 16, 81, 62,131, 64, 88, 63,162, 23, 49, 62,195, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,160,153, 25, 62, 14, 56, 90, 63,162, 23, 49, 62,195, 83, 78, 63, - 34, 16, 81, 62,131, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 34, 16, 81, 62,131, 64, 88, 63,166,200, 91, 62,147, 39, 75, 63, 0, 0,128, 62, 13,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 47, 12, 49, 63, 0, 0,128, 62, 19, 86, 60, 63, - 92, 33,101, 62,146, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 92, 33,101, 62,146, 55, 52, 63, 14,139,103, 62,199,228, 40, 63, 0, 0,128, 62, 47, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 23,200, 37, 63, 0, 0,128, 62, 47, 12, 49, 63, - 14,139,103, 62,199,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 14,139,103, 62,199,228, 40, 63, 92, 33,101, 62,146, 55, 52, 63,230, 32, 78, 62,211, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,223,254, 71, 62,102,155, 54, 63,230, 32, 78, 62,211, 52, 43, 63, - 92, 33,101, 62,146, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 92, 33,101, 62,146, 55, 52, 63, 23, 58, 97, 62, 69,233, 63, 63,223,254, 71, 62,102,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,240, 82, 64, 62,183,236, 65, 63,223,254, 71, 62,102,155, 54, 63, - 23, 58, 97, 62, 69,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 23, 58, 97, 62, 69,233, 63, 63, 92, 33,101, 62,146, 55, 52, 63, 0, 0,128, 62, 19, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,228,153, 71, 63, 0, 0,128, 62, 13,228, 82, 63, -166,200, 91, 62,147, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -166,200, 91, 62,147, 39, 75, 63, 23, 58, 97, 62, 69,233, 63, 63, 0, 0,128, 62,228,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 19, 86, 60, 63, 0, 0,128, 62,228,153, 71, 63, - 23, 58, 97, 62, 69,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 23, 58, 97, 62, 69,233, 63, 63,166,200, 91, 62,147, 39, 75, 63,240, 82, 64, 62,183,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,223,254, 71, 62,102,155, 54, 63,240, 82, 64, 62,183,236, 65, 63, -173,235, 42, 62,254,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -173,235, 42, 62,254,204, 55, 63,105, 20, 52, 62,198,160, 44, 63,223,254, 71, 62,102,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,230, 32, 78, 62,211, 52, 43, 63,223,254, 71, 62,102,155, 54, 63, -105, 20, 52, 62,198,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -105, 20, 52, 62,198,160, 44, 63,173,235, 42, 62,254,204, 55, 63,173,153, 25, 62, 27, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 58, 46, 94, 63, 0, 0,128, 62, 8,114,105, 63, -230, 1, 64, 62, 49, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -230, 1, 64, 62, 49, 26, 99, 63, 34, 16, 81, 62,131, 64, 88, 63, 0, 0,128, 62, 58, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 13,228, 82, 63, 0, 0,128, 62, 58, 46, 94, 63, - 34, 16, 81, 62,131, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 34, 16, 81, 62,131, 64, 88, 63,230, 1, 64, 62, 49, 26, 99, 63,160,153, 25, 62, 14, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,164, 98,230, 61, 58, 26, 99, 63,160,153, 25, 62, 14, 56, 90, 63, -230, 1, 64, 62, 49, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -230, 1, 64, 62, 49, 26, 99, 63,159,153, 25, 62,210,154,109, 63,164, 98,230, 61, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237,203, 76, 61, 22,114,105, 63,164, 98,230, 61, 58, 26, 99, 63, -159,153, 25, 62,210,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -159,153, 25, 62,210,154,109, 63,230, 1, 64, 62, 49, 26, 99, 63, 0, 0,128, 62, 8,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,232,187,116, 63, 3,153, 59, 63, 0, 0,128, 63, - 95,102,134, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -210,203, 76, 61,242,187,116, 63,159,153, 25, 62,210,154,109, 63, 0, 0,128, 62,232,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 8,114,105, 63, 0, 0,128, 62,232,187,116, 63, -159,153, 25, 62,210,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -159,153, 25, 62,210,154,109, 63,210,203, 76, 61,242,187,116, 63,237,203, 76, 61, 22,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,164, 98,230, 61, 58, 26, 99, 63,237,203, 76, 61, 22,114,105, 63, -234,203, 76, 61, 79, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -234,203, 76, 61, 79, 46, 94, 63, 23, 70,196, 61,147, 64, 88, 63,164, 98,230, 61, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,160,153, 25, 62, 14, 56, 90, 63,164, 98,230, 61, 58, 26, 99, 63, - 23, 70,196, 61,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 23, 70,196, 61,147, 64, 88, 63,234,203, 76, 61, 79, 46, 94, 63,243,203, 76, 61, 41,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42,138,170, 62,254,204, 55, 63,136,214,159, 62,183,236, 65, 63, -145, 0,156, 62,102,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -145, 0,156, 62,102,155, 54, 63,204,245,165, 62,198,160, 44, 63, 42,138,170, 62,254,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42, 51,179, 62, 28, 28, 45, 63, 42,138,170, 62,254,204, 55, 63, -204,245,165, 62,198,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -204,245,165, 62,198,160, 44, 63,145, 0,156, 62,102,155, 54, 63,141,239,152, 62,211, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 82,111,141, 62,146, 55, 52, 63,141,239,152, 62,211, 52, 43, 63, -145, 0,156, 62,102,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -145, 0,156, 62,102,155, 54, 63,245, 98,143, 62, 68,233, 63, 63, 82,111,141, 62,146, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 19, 86, 60, 63, 82,111,141, 62,146, 55, 52, 63, -245, 98,143, 62, 68,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -245, 98,143, 62, 68,233, 63, 63,145, 0,156, 62,102,155, 54, 63,136,214,159, 62,183,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173, 27,146, 62,147, 39, 75, 63, 0, 0,128, 62, 13,228, 82, 63, - 0, 0,128, 62,228,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,228,153, 71, 63,245, 98,143, 62, 68,233, 63, 63,173, 27,146, 62,147, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,136,214,159, 62,183,236, 65, 63,173, 27,146, 62,147, 39, 75, 63, -245, 98,143, 62, 68,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -245, 98,143, 62, 68,233, 63, 63, 0, 0,128, 62,228,153, 71, 63, 0, 0,128, 62, 19, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 82,111,141, 62,146, 55, 52, 63, 0, 0,128, 62, 19, 86, 60, 63, - 0, 0,128, 62, 47, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62, 47, 12, 49, 63,121, 58,140, 62,199,228, 40, 63, 82,111,141, 62,146, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,141,239,152, 62,211, 52, 43, 63, 82,111,141, 62,146, 55, 52, 63, -121, 58,140, 62,199,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -121, 58,140, 62,199,228, 40, 63, 0, 0,128, 62, 47, 12, 49, 63, 0, 0,128, 62, 23,200, 37, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173, 27,146, 62,147, 39, 75, 63,136,214,159, 62,183,236, 65, 63, - 47,116,167, 62,195, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 47,116,167, 62,195, 83, 78, 63,239,119,151, 62,131, 64, 88, 63,173, 27,146, 62,147, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 13,228, 82, 63,173, 27,146, 62,147, 39, 75, 63, -239,119,151, 62,131, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,119,151, 62,131, 64, 88, 63, 47,116,167, 62,195, 83, 78, 63, 49, 51,179, 62, 14, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44,242,190, 62,205, 83, 78, 63, 49, 51,179, 62, 14, 56, 90, 63, - 47,116,167, 62,195, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 47,116,167, 62,195, 83, 78, 63, 42, 51,179, 62,108, 23, 67, 63, 44,242,190, 62,205, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,143,198, 62,200,236, 65, 63, 44,242,190, 62,205, 83, 78, 63, - 42, 51,179, 62,108, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42, 51,179, 62,108, 23, 67, 63, 47,116,167, 62,195, 83, 78, 63,136,214,159, 62,183,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42,138,170, 62,254,204, 55, 63, 42, 51,179, 62, 28, 28, 45, 63, - 45,220,187, 62, 7,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 45,220,187, 62, 7,205, 55, 63, 42, 51,179, 62,108, 23, 67, 63, 42,138,170, 62,254,204, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,136,214,159, 62,183,236, 65, 63, 42,138,170, 62,254,204, 55, 63, - 42, 51,179, 62,108, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42, 51,179, 62,108, 23, 67, 63, 45,220,187, 62, 7,205, 55, 63,214,143,198, 62,200,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44,242,190, 62,205, 83, 78, 63,214,143,198, 62,200,236, 65, 63, -188, 74,212, 62,171, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -188, 74,212, 62,171, 39, 75, 63,122,238,206, 62,147, 64, 88, 63, 44,242,190, 62,205, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 49, 51,179, 62, 14, 56, 90, 63, 44,242,190, 62,205, 83, 78, 63, -122,238,206, 62,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -122,238,206, 62,147, 64, 88, 63,188, 74,212, 62,171, 39, 75, 63,130,102,230, 62, 41,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,130,102,230, 62, 82, 12, 49, 63,129,102,230, 62, 53, 86, 60, 63, - 28,247,216, 62,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 28,247,216, 62,172, 55, 52, 63,243, 43,218, 62,223,228, 40, 63,130,102,230, 62, 82, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,102,230, 62, 48,200, 37, 63,130,102,230, 62, 82, 12, 49, 63, -243, 43,218, 62,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -243, 43,218, 62,223,228, 40, 63, 28,247,216, 62,172, 55, 52, 63,212,118,205, 62,228, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,206,101,202, 62,120,155, 54, 63,212,118,205, 62,228, 52, 43, 63, - 28,247,216, 62,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 28,247,216, 62,172, 55, 52, 63,120, 3,215, 62, 95,233, 63, 63,206,101,202, 62,120,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,143,198, 62,200,236, 65, 63,206,101,202, 62,120,155, 54, 63, -120, 3,215, 62, 95,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -120, 3,215, 62, 95,233, 63, 63, 28,247,216, 62,172, 55, 52, 63,129,102,230, 62, 53, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,130,102,230, 62, 1,154, 71, 63,130,102,230, 62, 41,228, 82, 63, -188, 74,212, 62,171, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -188, 74,212, 62,171, 39, 75, 63,120, 3,215, 62, 95,233, 63, 63,130,102,230, 62, 1,154, 71, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,102,230, 62, 53, 86, 60, 63,130,102,230, 62, 1,154, 71, 63, -120, 3,215, 62, 95,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -120, 3,215, 62, 95,233, 63, 63,188, 74,212, 62,171, 39, 75, 63,214,143,198, 62,200,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,206,101,202, 62,120,155, 54, 63,214,143,198, 62,200,236, 65, 63, - 45,220,187, 62, 7,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 45,220,187, 62, 7,205, 55, 63,142,112,192, 62,207,160, 44, 63,206,101,202, 62,120,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,118,205, 62,228, 52, 43, 63,206,101,202, 62,120,155, 54, 63, -142,112,192, 62,207,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -142,112,192, 62,207,160, 44, 63, 45,220,187, 62, 7,205, 55, 63, 42, 51,179, 62, 28, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,131,102,230, 62, 79, 46, 94, 63,131,102,230, 62, 22,114,105, 63, - 87,103,198, 62, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87,103,198, 62, 58, 26, 99, 63,122,238,206, 62,147, 64, 88, 63,131,102,230, 62, 79, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,130,102,230, 62, 41,228, 82, 63,131,102,230, 62, 79, 46, 94, 63, -122,238,206, 62,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -122,238,206, 62,147, 64, 88, 63, 87,103,198, 62, 58, 26, 99, 63, 49, 51,179, 62, 14, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,255,159, 62, 49, 26, 99, 63, 49, 51,179, 62, 14, 56, 90, 63, - 87,103,198, 62, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87,103,198, 62, 58, 26, 99, 63, 49, 51,179, 62,210,154,109, 63, 14,255,159, 62, 49, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 8,114,105, 63, 14,255,159, 62, 49, 26, 99, 63, - 49, 51,179, 62,210,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 49, 51,179, 62,210,154,109, 63, 87,103,198, 62, 58, 26, 99, 63,131,102,230, 62, 22,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,134,102,230, 62,242,187,116, 63, 3,153, 59, 63, 0, 0,128, 63, - 0, 0,128, 62,232,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,232,187,116, 63, 49, 51,179, 62,210,154,109, 63,134,102,230, 62,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,131,102,230, 62, 22,114,105, 63,134,102,230, 62,242,187,116, 63, - 49, 51,179, 62,210,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 49, 51,179, 62,210,154,109, 63, 0, 0,128, 62,232,187,116, 63, 0, 0,128, 62, 8,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,255,159, 62, 49, 26, 99, 63, 0, 0,128, 62, 8,114,105, 63, - 0, 0,128, 62, 58, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62, 58, 46, 94, 63,239,119,151, 62,131, 64, 88, 63, 14,255,159, 62, 49, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 49, 51,179, 62, 14, 56, 90, 63, 14,255,159, 62, 49, 26, 99, 63, -239,119,151, 62,131, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,119,151, 62,131, 64, 88, 63, 0, 0,128, 62, 58, 46, 94, 63, 0, 0,128, 62, 13,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 93,120, 8, 63, 11,205, 55, 63,140, 30, 3, 63,201,236, 65, 63, -145, 51, 1, 63,121,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -145, 51, 1, 63,121,155, 54, 63, 46, 46, 6, 63,211,160, 44, 63, 93,120, 8, 63, 11,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,220,204, 12, 63, 35, 28, 45, 63, 93,120, 8, 63, 11,205, 55, 63, - 46, 46, 6, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 46, 46, 6, 63,211,160, 44, 63,145, 51, 1, 63,121,155, 54, 63, 30, 86,255, 62,230, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,222,213,243, 62,172, 55, 52, 63, 30, 86,255, 62,230, 52, 43, 63, -145, 51, 1, 63,121,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -145, 51, 1, 63,121,155, 54, 63,128,201,245, 62, 94,233, 63, 63,222,213,243, 62,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,102,230, 62, 53, 86, 60, 63,222,213,243, 62,172, 55, 52, 63, -128,201,245, 62, 94,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -128,201,245, 62, 94,233, 63, 63,145, 51, 1, 63,121,155, 54, 63,140, 30, 3, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 59,130,248, 62,169, 39, 75, 63,130,102,230, 62, 41,228, 82, 63, -130,102,230, 62, 1,154, 71, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -130,102,230, 62, 1,154, 71, 63,128,201,245, 62, 94,233, 63, 63, 59,130,248, 62,169, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,140, 30, 3, 63,201,236, 65, 63, 59,130,248, 62,169, 39, 75, 63, -128,201,245, 62, 94,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -128,201,245, 62, 94,233, 63, 63,130,102,230, 62, 1,154, 71, 63,129,102,230, 62, 53, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,222,213,243, 62,172, 55, 52, 63,129,102,230, 62, 53, 86, 60, 63, -130,102,230, 62, 82, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -130,102,230, 62, 82, 12, 49, 63, 9,161,242, 62,223,228, 40, 63,222,213,243, 62,172, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 30, 86,255, 62,230, 52, 43, 63,222,213,243, 62,172, 55, 52, 63, - 9,161,242, 62,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 9,161,242, 62,223,228, 40, 63,130,102,230, 62, 82, 12, 49, 63,129,102,230, 62, 48,200, 37, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 59,130,248, 62,169, 39, 75, 63,140, 30, 3, 63,201,236, 65, 63, - 94,237, 6, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 94,237, 6, 63,207, 83, 78, 63,118,222,253, 62,148, 64, 88, 63, 59,130,248, 62,169, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,130,102,230, 62, 41,228, 82, 63, 59,130,248, 62,169, 39, 75, 63, -118,222,253, 62,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,222,253, 62,148, 64, 88, 63, 94,237, 6, 63,207, 83, 78, 63,220,204, 12, 63, 22, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 88,172, 18, 63,207, 83, 78, 63,220,204, 12, 63, 22, 56, 90, 63, - 94,237, 6, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 94,237, 6, 63,207, 83, 78, 63,220,204, 12, 63,115, 23, 67, 63, 88,172, 18, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44,123, 22, 63,201,236, 65, 63, 88,172, 18, 63,207, 83, 78, 63, -220,204, 12, 63,115, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -220,204, 12, 63,115, 23, 67, 63, 94,237, 6, 63,207, 83, 78, 63,140, 30, 3, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 93,120, 8, 63, 11,205, 55, 63,220,204, 12, 63, 35, 28, 45, 63, - 91, 33, 17, 63, 9,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91, 33, 17, 63, 9,205, 55, 63,220,204, 12, 63,115, 23, 67, 63, 93,120, 8, 63, 11,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,140, 30, 3, 63,201,236, 65, 63, 93,120, 8, 63, 11,205, 55, 63, -220,204, 12, 63,115, 23, 67, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -220,204, 12, 63,115, 23, 67, 63, 91, 33, 17, 63, 9,205, 55, 63, 44,123, 22, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 88,172, 18, 63,207, 83, 78, 63, 44,123, 22, 63,201,236, 65, 63, -153, 88, 29, 63,167, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -153, 88, 29, 63,167, 39, 75, 63,121,170, 26, 63,147, 64, 88, 63, 88,172, 18, 63,207, 83, 78, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,220,204, 12, 63, 22, 56, 90, 63, 88,172, 18, 63,207, 83, 78, 63, -121,170, 26, 63,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -121,170, 26, 63,147, 64, 88, 63,153, 88, 29, 63,167, 39, 75, 63,118,102, 38, 63, 38,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63, 78, 12, 49, 63,117,102, 38, 63, 50, 86, 60, 63, -200,174, 31, 63,169, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -200,174, 31, 63,169, 55, 52, 63, 51, 73, 32, 63,221,228, 40, 63,117,102, 38, 63, 78, 12, 49, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63, 45,200, 37, 63,117,102, 38, 63, 78, 12, 49, 63, - 51, 73, 32, 63,221,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 51, 73, 32, 63,221,228, 40, 63,200,174, 31, 63,169, 55, 52, 63,169,238, 25, 63,229, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 39,102, 24, 63,119,155, 54, 63,169,238, 25, 63,229, 52, 43, 63, -200,174, 31, 63,169, 55, 52, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -200,174, 31, 63,169, 55, 52, 63,246,180, 30, 63, 92,233, 63, 63, 39,102, 24, 63,119,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44,123, 22, 63,201,236, 65, 63, 39,102, 24, 63,119,155, 54, 63, -246,180, 30, 63, 92,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -246,180, 30, 63, 92,233, 63, 63,200,174, 31, 63,169, 55, 52, 63,117,102, 38, 63, 50, 86, 60, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63,255,153, 71, 63,118,102, 38, 63, 38,228, 82, 63, -153, 88, 29, 63,167, 39, 75, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -153, 88, 29, 63,167, 39, 75, 63,246,180, 30, 63, 92,233, 63, 63,117,102, 38, 63,255,153, 71, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63, 50, 86, 60, 63,117,102, 38, 63,255,153, 71, 63, -246,180, 30, 63, 92,233, 63, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -246,180, 30, 63, 92,233, 63, 63,153, 88, 29, 63,167, 39, 75, 63, 44,123, 22, 63,201,236, 65, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 39,102, 24, 63,119,155, 54, 63, 44,123, 22, 63,201,236, 65, 63, - 91, 33, 17, 63, 9,205, 55, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91, 33, 17, 63, 9,205, 55, 63,138,107, 19, 63,211,160, 44, 63, 39,102, 24, 63,119,155, 54, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,169,238, 25, 63,229, 52, 43, 63, 39,102, 24, 63,119,155, 54, 63, -138,107, 19, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138,107, 19, 63,211,160, 44, 63, 91, 33, 17, 63, 9,205, 55, 63,220,204, 12, 63, 35, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,102, 38, 63, 77, 46, 94, 63,118,102, 38, 63, 19,114,105, 63, -235,102, 22, 63, 59, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -235,102, 22, 63, 59, 26, 99, 63,121,170, 26, 63,147, 64, 88, 63,118,102, 38, 63, 77, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,102, 38, 63, 38,228, 82, 63,118,102, 38, 63, 77, 46, 94, 63, -121,170, 26, 63,147, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -121,170, 26, 63,147, 64, 88, 63,235,102, 22, 63, 59, 26, 99, 63,220,204, 12, 63, 22, 56, 90, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,204, 50, 3, 63, 58, 26, 99, 63,220,204, 12, 63, 22, 56, 90, 63, -235,102, 22, 63, 59, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -235,102, 22, 63, 59, 26, 99, 63,224,204, 12, 63,212,154,109, 63,204, 50, 3, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,131,102,230, 62, 22,114,105, 63,204, 50, 3, 63, 58, 26, 99, 63, -224,204, 12, 63,212,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -224,204, 12, 63,212,154,109, 63,235,102, 22, 63, 59, 26, 99, 63,118,102, 38, 63, 19,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,120,102, 38, 63,242,187,116, 63, 3,153, 59, 63, 0, 0,128, 63, -134,102,230, 62,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -134,102,230, 62,242,187,116, 63,224,204, 12, 63,212,154,109, 63,120,102, 38, 63,242,187,116, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,102, 38, 63, 19,114,105, 63,120,102, 38, 63,242,187,116, 63, -224,204, 12, 63,212,154,109, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -224,204, 12, 63,212,154,109, 63,134,102,230, 62,242,187,116, 63,131,102,230, 62, 22,114,105, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,204, 50, 3, 63, 58, 26, 99, 63,131,102,230, 62, 22,114,105, 63, -131,102,230, 62, 79, 46, 94, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -131,102,230, 62, 79, 46, 94, 63,118,222,253, 62,148, 64, 88, 63,204, 50, 3, 63, 58, 26, 99, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,220,204, 12, 63, 22, 56, 90, 63,204, 50, 3, 63, 58, 26, 99, 63, -118,222,253, 62,148, 64, 88, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,222,253, 62,148, 64, 88, 63,131,102,230, 62, 79, 46, 94, 63,130,102,230, 62, 41,228, 82, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,213,233, 76, 63, 35, 48, 21, 63,176,235, 70, 63,226,209, 22, 63, - 80,234, 73, 63,146,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80,234, 73, 63,146,111, 11, 63, 1,200, 79, 63, 94,152, 9, 63,213,233, 76, 63, 35, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 19,215, 82, 63,252, 29, 19, 63,213,233, 76, 63, 35, 48, 21, 63, - 1,200, 79, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 1,200, 79, 63, 94,152, 9, 63, 80,234, 73, 63,146,111, 11, 63,193,204, 76, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,213,233, 76, 63, 35, 48, 21, 63, 19,215, 82, 63,252, 29, 19, 63, -220, 41, 80, 63,105, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -220, 41, 80, 63,105, 60, 31, 63,164,219, 73, 63,173, 23, 33, 63,213,233, 76, 63, 35, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,176,235, 70, 63,226,209, 22, 63,213,233, 76, 63, 35, 48, 21, 63, -164,219, 73, 63,173, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -164,219, 73, 63,173, 23, 33, 63,220, 41, 80, 63,105, 60, 31, 63,196, 33, 77, 63,221, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,169,158, 70, 63,200,160, 44, 63, 0, 0, 64, 63, 24, 28, 45, 63, - 5,171, 67, 63,216, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 5,171, 67, 63,216, 17, 34, 63,164,219, 73, 63,173, 23, 33, 63,169,158, 70, 63,200,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,196, 33, 77, 63,221, 52, 43, 63,169,158, 70, 63,200,160, 44, 63, -164,219, 73, 63,173, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -164,219, 73, 63,173, 23, 33, 63, 5,171, 67, 63,216, 17, 34, 63,176,235, 70, 63,226,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 75,124, 83, 63,217,228, 40, 63,196, 33, 77, 63,221, 52, 43, 63, -220, 41, 80, 63,105, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -220, 41, 80, 63,105, 60, 31, 63,218, 20, 86, 63,143,140, 28, 63, 75,124, 83, 63,217,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,139,153, 89, 63, 45,200, 37, 63, 75,124, 83, 63,217,228, 40, 63, -218, 20, 86, 63,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -218, 20, 86, 63,143,140, 28, 63,220, 41, 80, 63,105, 60, 31, 63, 19,215, 82, 63,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,182, 32, 23, 63,176,235, 70, 63,226,209, 22, 63, - 5,171, 67, 63,216, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 5,171, 67, 63,216, 17, 34, 63,251, 84, 60, 63,216, 17, 34, 63, 0, 0, 64, 63,182, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 80, 20, 57, 63,226,209, 22, 63, 0, 0, 64, 63,182, 32, 23, 63, -251, 84, 60, 63,216, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251, 84, 60, 63,216, 17, 34, 63, 5,171, 67, 63,216, 17, 34, 63, 0, 0, 64, 63, 24, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,182, 32, 23, 63, 80, 20, 57, 63,226,209, 22, 63, -169,156, 60, 63, 96,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169,156, 60, 63, 96,116, 11, 63, 87, 99, 67, 63, 96,116, 11, 63, 0, 0, 64, 63,182, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,176,235, 70, 63,226,209, 22, 63, 0, 0, 64, 63,182, 32, 23, 63, - 87, 99, 67, 63, 96,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87, 99, 67, 63, 96,116, 11, 63,169,156, 60, 63, 96,116, 11, 63, 0, 0, 64, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 96,102, 70, 63,244, 1, 0, 63,193,204, 76, 63, 0, 0, 0, 63, - 80,234, 73, 63,146,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80,234, 73, 63,146,111, 11, 63, 87, 99, 67, 63, 96,116, 11, 63, 96,102, 70, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 0, 0, 0, 63, 96,102, 70, 63,244, 1, 0, 63, - 87, 99, 67, 63, 96,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87, 99, 67, 63, 96,116, 11, 63, 80,234, 73, 63,146,111, 11, 63,176,235, 70, 63,226,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,160,153, 57, 63,244, 1, 0, 63, 0, 0, 64, 63, 0, 0, 0, 63, -169,156, 60, 63, 96,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169,156, 60, 63, 96,116, 11, 63,176, 21, 54, 63,146,111, 11, 63,160,153, 57, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 51, 51, 63, 0, 0, 0, 63,160,153, 57, 63,244, 1, 0, 63, -176, 21, 54, 63,146,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176, 21, 54, 63,146,111, 11, 63,169,156, 60, 63, 96,116, 11, 63, 80, 20, 57, 63,226,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 93, 58,217, 62,144, 61, 57, 63, 19,196,217, 62, - 85,123, 60, 63,253,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 85,123, 60, 63,253,230,198, 62,171,132, 67, 63,253,230,198, 62, 0, 0, 64, 63, 93, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,112,194, 70, 63, 19,196,217, 62, 0, 0, 64, 63, 93, 58,217, 62, -171,132, 67, 63,253,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,132, 67, 63,253,230,198, 62, 85,123, 60, 63,253,230,198, 62, 0, 0, 64, 63,211,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 93, 58,217, 62,112,194, 70, 63, 19,196,217, 62, -125, 84, 67, 63, 42,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -125, 84, 67, 63, 42,211,236, 62,131,171, 60, 63, 42,211,236, 62, 0, 0, 64, 63, 93, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,144, 61, 57, 63, 19,196,217, 62, 0, 0, 64, 63, 93, 58,217, 62, -131,171, 60, 63, 42,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -131,171, 60, 63, 42,211,236, 62,125, 84, 67, 63, 42,211,236, 62, 0, 0, 64, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,160,153, 57, 63,244, 1, 0, 63, 63, 51, 51, 63, 0, 0, 0, 63, -128, 46, 54, 63, 75,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -128, 46, 54, 63, 75,207,236, 62,131,171, 60, 63, 42,211,236, 62,160,153, 57, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 0, 0, 0, 63,160,153, 57, 63,244, 1, 0, 63, -131,171, 60, 63, 42,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -131,171, 60, 63, 42,211,236, 62,128, 46, 54, 63, 75,207,236, 62,144, 61, 57, 63, 19,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 96,102, 70, 63,244, 1, 0, 63, 0, 0, 64, 63, 0, 0, 0, 63, -125, 84, 67, 63, 42,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -125, 84, 67, 63, 42,211,236, 62,128,209, 73, 63, 75,207,236, 62, 96,102, 70, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,193,204, 76, 63, 0, 0, 0, 63, 96,102, 70, 63,244, 1, 0, 63, -128,209, 73, 63, 75,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -128,209, 73, 63, 75,207,236, 62,125, 84, 67, 63, 42,211,236, 62,112,194, 70, 63, 19,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 43, 22, 51, 63, 35, 48, 21, 63,237, 40, 45, 63,252, 29, 19, 63, -255, 55, 48, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -255, 55, 48, 63, 94,152, 9, 63,176, 21, 54, 63,146,111, 11, 63, 43, 22, 51, 63, 35, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 80, 20, 57, 63,226,209, 22, 63, 43, 22, 51, 63, 35, 48, 21, 63, -176, 21, 54, 63,146,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176, 21, 54, 63,146,111, 11, 63,255, 55, 48, 63, 94,152, 9, 63, 63, 51, 51, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 43, 22, 51, 63, 35, 48, 21, 63, 80, 20, 57, 63,226,209, 22, 63, - 91, 36, 54, 63,173, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91, 36, 54, 63,173, 23, 33, 63, 36,214, 47, 63,105, 60, 31, 63, 43, 22, 51, 63, 35, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 40, 45, 63,252, 29, 19, 63, 43, 22, 51, 63, 35, 48, 21, 63, - 36,214, 47, 63,105, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 36,214, 47, 63,105, 60, 31, 63, 91, 36, 54, 63,173, 23, 33, 63, 60,222, 50, 63,221, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,181,131, 44, 63,216,228, 40, 63,117,102, 38, 63, 45,200, 37, 63, - 38,235, 41, 63,141,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 38,235, 41, 63,141,140, 28, 63, 36,214, 47, 63,105, 60, 31, 63,181,131, 44, 63,216,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 60,222, 50, 63,221, 52, 43, 63,181,131, 44, 63,216,228, 40, 63, - 36,214, 47, 63,105, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 36,214, 47, 63,105, 60, 31, 63, 38,235, 41, 63,141,140, 28, 63,237, 40, 45, 63,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 87, 97, 57, 63,200,160, 44, 63, 60,222, 50, 63,221, 52, 43, 63, - 91, 36, 54, 63,173, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91, 36, 54, 63,173, 23, 33, 63,251, 84, 60, 63,216, 17, 34, 63, 87, 97, 57, 63,200,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63, 24, 28, 45, 63, 87, 97, 57, 63,200,160, 44, 63, -251, 84, 60, 63,216, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251, 84, 60, 63,216, 17, 34, 63, 91, 36, 54, 63,173, 23, 33, 63, 80, 20, 57, 63,226,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,134, 14,128, 63, 39, 48, 21, 63,227, 30,122, 63,233,209, 22, 63, -138, 29,125, 63,150,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138, 29,125, 63,150,111, 11, 63,159,125,129, 63, 94,152, 9, 63,134, 14,128, 63, 39, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,174, 73,193, 60,253, 29, 19, 63,209, 92,232, 57, 39, 48, 21, 63, -114,207, 62, 60, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -159,125,129, 63, 94,152, 9, 63,138, 29,125, 63,150,111, 11, 63, 0, 0,128, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,209, 92,232, 57, 39, 48, 21, 63,174, 73,193, 60,253, 29, 19, 63, -214, 67, 87, 60,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136,174,129, 63,110, 60, 31, 63,213, 14,125, 63,180, 23, 33, 63,134, 14,128, 63, 39, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,227, 30,122, 63,233,209, 22, 63,134, 14,128, 63, 39, 48, 21, 63, -213, 14,125, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213, 14,125, 63,180, 23, 33, 63,136,174,129, 63,110, 60, 31, 63,121, 42,128, 63,230, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,210,209,121, 63,212,160, 44, 63, 36, 51,115, 63, 36, 28, 45, 63, - 49,222,118, 63,226, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 49,222,118, 63,226, 17, 34, 63,213, 14,125, 63,180, 23, 33, 63,210,209,121, 63,212,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,121, 42,128, 63,230, 52, 43, 63,210,209,121, 63,212,160, 44, 63, -213, 14,125, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213, 14,125, 63,180, 23, 33, 63, 49,222,118, 63,226, 17, 34, 63,227, 30,122, 63,233,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,111,239,213, 60,223,228, 40, 63,120,226,169, 58,230, 52, 43, 63, -214, 67, 87, 60,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -214, 67, 87, 60,110, 60, 31, 63, 13,129, 20, 61,143,140, 28, 63,111,239,213, 60,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,246,203, 76, 61, 48,200, 37, 63,111,239,213, 60,223,228, 40, 63, - 13,129, 20, 61,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 13,129, 20, 61,143,140, 28, 63,214, 67, 87, 60,110, 60, 31, 63,174, 73,193, 60,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44, 51,115, 63,188, 32, 23, 63,227, 30,122, 63,233,209, 22, 63, - 49,222,118, 63,226, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 49,222,118, 63,226, 17, 34, 63, 31,136,111, 63,225, 17, 34, 63, 44, 51,115, 63,188, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,116, 71,108, 63,232,209, 22, 63, 44, 51,115, 63,188, 32, 23, 63, - 31,136,111, 63,225, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 31,136,111, 63,225, 17, 34, 63, 49,222,118, 63,226, 17, 34, 63, 36, 51,115, 63, 36, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 44, 51,115, 63,188, 32, 23, 63,116, 71,108, 63,232,209, 22, 63, -213,207,111, 63,100,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213,207,111, 63,100,116, 11, 63,138,150,118, 63,101,116, 11, 63, 44, 51,115, 63,188, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,227, 30,122, 63,233,209, 22, 63, 44, 51,115, 63,188, 32, 23, 63, -138,150,118, 63,101,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138,150,118, 63,101,116, 11, 63,213,207,111, 63,100,116, 11, 63, 51, 51,115, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,154,153,121, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0, 0, 63, -138, 29,125, 63,150,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138, 29,125, 63,150,111, 11, 63,138,150,118, 63,101,116, 11, 63,154,153,121, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 51, 51,115, 63, 0, 0, 0, 63,154,153,121, 63,244, 1, 0, 63, -138,150,118, 63,101,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -138,150,118, 63,101,116, 11, 63,138, 29,125, 63,150,111, 11, 63,227, 30,122, 63,233,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,205,204,108, 63,244, 1, 0, 63, 51, 51,115, 63, 0, 0, 0, 63, -213,207,111, 63,100,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213,207,111, 63,100,116, 11, 63,213, 72,105, 63,149,111, 11, 63,205,204,108, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,102,102, 63, 0, 0, 0, 63,205,204,108, 63,244, 1, 0, 63, -213, 72,105, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213, 72,105, 63,149,111, 11, 63,213,207,111, 63,100,116, 11, 63,116, 71,108, 63,232,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 58, 51,115, 63, 73, 58,217, 62,192,112,108, 63, 4,196,217, 62, -139,174,111, 63,223,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -139,174,111, 63,223,230,198, 62,239,183,118, 63,227,230,198, 62, 58, 51,115, 63, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,245,121, 63, 6,196,217, 62, 58, 51,115, 63, 73, 58,217, 62, -239,183,118, 63,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,183,118, 63,227,230,198, 62,139,174,111, 63,223,230,198, 62, 65, 51,115, 63,160,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 58, 51,115, 63, 73, 58,217, 62,179,245,121, 63, 6,196,217, 62, -185,135,118, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -185,135,118, 63, 30,211,236, 62,180,222,111, 63, 30,211,236, 62, 58, 51,115, 63, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192,112,108, 63, 4,196,217, 62, 58, 51,115, 63, 73, 58,217, 62, -180,222,111, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -180,222,111, 63, 30,211,236, 62,185,135,118, 63, 30,211,236, 62, 51, 51,115, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,205,204,108, 63,244, 1, 0, 63,101,102,102, 63, 0, 0, 0, 63, -170, 97,105, 63, 65,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -170, 97,105, 63, 65,207,236, 62,180,222,111, 63, 30,211,236, 62,205,204,108, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 51, 51,115, 63, 0, 0, 0, 63,205,204,108, 63,244, 1, 0, 63, -180,222,111, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -180,222,111, 63, 30,211,236, 62,170, 97,105, 63, 65,207,236, 62,192,112,108, 63, 4,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,154,153,121, 63,244, 1, 0, 63, 51, 51,115, 63, 0, 0, 0, 63, -185,135,118, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -185,135,118, 63, 30,211,236, 62,194, 4,125, 63, 67,207,236, 62,154,153,121, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 63,154,153,121, 63,244, 1, 0, 63, -194, 4,125, 63, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194, 4,125, 63, 67,207,236, 62,185,135,118, 63, 30,211,236, 62,179,245,121, 63, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 76, 73,102, 63, 38, 48, 21, 63, 11, 92, 96, 63,253, 29, 19, 63, - 33,107, 99, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 33,107, 99, 63, 94,152, 9, 63,213, 72,105, 63,149,111, 11, 63, 76, 73,102, 63, 38, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,116, 71,108, 63,232,209, 22, 63, 76, 73,102, 63, 38, 48, 21, 63, -213, 72,105, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213, 72,105, 63,149,111, 11, 63, 33,107, 99, 63, 94,152, 9, 63,101,102,102, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 76, 73,102, 63, 38, 48, 21, 63,116, 71,108, 63,232,209, 22, 63, -124, 87,105, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -124, 87,105, 63,180, 23, 33, 63, 65, 9, 99, 63,109, 60, 31, 63, 76, 73,102, 63, 38, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 11, 92, 96, 63,253, 29, 19, 63, 76, 73,102, 63, 38, 48, 21, 63, - 65, 9, 99, 63,109, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 9, 99, 63,109, 60, 31, 63,124, 87,105, 63,180, 23, 33, 63, 87, 17,102, 63,229, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,205,182, 95, 63,222,228, 40, 63,139,153, 89, 63, 45,200, 37, 63, - 63, 30, 93, 63,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 63, 30, 93, 63,143,140, 28, 63, 65, 9, 99, 63,109, 60, 31, 63,205,182, 95, 63,222,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 87, 17,102, 63,229, 52, 43, 63,205,182, 95, 63,222,228, 40, 63, - 65, 9, 99, 63,109, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 9, 99, 63,109, 60, 31, 63, 63, 30, 93, 63,143,140, 28, 63, 11, 92, 96, 63,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,118,148,108, 63,211,160, 44, 63, 87, 17,102, 63,229, 52, 43, 63, -124, 87,105, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -124, 87,105, 63,180, 23, 33, 63, 31,136,111, 63,225, 17, 34, 63,118,148,108, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 36, 51,115, 63, 36, 28, 45, 63,118,148,108, 63,211,160, 44, 63, - 31,136,111, 63,225, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 31,136,111, 63,225, 17, 34, 63,124, 87,105, 63,180, 23, 33, 63,116, 71,108, 63,232,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 65, 77, 62, 32, 48, 21, 63,152, 72, 53, 62,229,209, 22, 63, - 47, 67, 65, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 47, 67, 65, 62,147,111, 11, 63,255,185, 88, 62, 90,152, 9, 63, 65, 65, 77, 62, 32, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64,246,100, 62,246, 29, 19, 63, 65, 65, 77, 62, 32, 48, 21, 63, -255,185, 88, 62, 90,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -255,185, 88, 62, 90,152, 9, 63, 47, 67, 65, 62,147,111, 11, 63,254,204, 76, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 65, 77, 62, 32, 48, 21, 63, 64,246,100, 62,246, 29, 19, 63, - 89, 65, 90, 62, 94, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89, 65, 90, 62, 94, 60, 31, 63,107, 8, 65, 62,170, 23, 33, 63, 65, 65, 77, 62, 32, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152, 72, 53, 62,229,209, 22, 63, 65, 65, 77, 62, 32, 48, 21, 63, -107, 8, 65, 62,170, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -107, 8, 65, 62,170, 23, 33, 63, 89, 65, 90, 62, 94, 60, 31, 63,230, 32, 78, 62,211, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,105, 20, 52, 62,198,160, 44, 63,173,153, 25, 62, 27, 28, 45, 63, -216, 69, 40, 62,220, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -216, 69, 40, 62,220, 17, 34, 63,107, 8, 65, 62,170, 23, 33, 63,105, 20, 52, 62,198,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,230, 32, 78, 62,211, 52, 43, 63,105, 20, 52, 62,198,160, 44, 63, -107, 8, 65, 62,170, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -107, 8, 65, 62,170, 23, 33, 63,216, 69, 40, 62,220, 17, 34, 63,152, 72, 53, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,139,103, 62,199,228, 40, 63,230, 32, 78, 62,211, 52, 43, 63, - 89, 65, 90, 62, 94, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89, 65, 90, 62, 94, 60, 31, 63, 83,237,113, 62,130,140, 28, 63, 14,139,103, 62,199,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 23,200, 37, 63, 14,139,103, 62,199,228, 40, 63, - 83,237,113, 62,130,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 83,237,113, 62,130,140, 28, 63, 89, 65, 90, 62, 94, 60, 31, 63, 64,246,100, 62,246, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180,153, 25, 62,185, 32, 23, 63,152, 72, 53, 62,229,209, 22, 63, -216, 69, 40, 62,220, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -216, 69, 40, 62,220, 17, 34, 63,133,237, 10, 62,219, 17, 34, 63,180,153, 25, 62,185, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147,213,251, 61,228,209, 22, 63,180,153, 25, 62,185, 32, 23, 63, -133,237, 10, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,237, 10, 62,219, 17, 34, 63,216, 69, 40, 62,220, 17, 34, 63,173,153, 25, 62, 27, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180,153, 25, 62,185, 32, 23, 63,147,213,251, 61,228,209, 22, 63, - 67, 12, 12, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 67, 12, 12, 62, 98,116, 11, 63, 34, 39, 39, 62, 98,116, 11, 63,180,153, 25, 62,185, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152, 72, 53, 62,229,209, 22, 63,180,153, 25, 62,185, 32, 23, 63, - 34, 39, 39, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 34, 39, 39, 62, 98,116, 11, 63, 67, 12, 12, 62, 98,116, 11, 63,181,153, 25, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 92, 51, 51, 62,244, 1, 0, 63,254,204, 76, 62, 0, 0, 0, 63, - 47, 67, 65, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 47, 67, 65, 62,147,111, 11, 63, 34, 39, 39, 62, 98,116, 11, 63, 92, 51, 51, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,181,153, 25, 62, 0, 0, 0, 63, 92, 51, 51, 62,244, 1, 0, 63, - 34, 39, 39, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 34, 39, 39, 62, 98,116, 11, 63, 47, 67, 65, 62,147,111, 11, 63,152, 72, 53, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 62,244, 1, 0, 63,181,153, 25, 62, 0, 0, 0, 63, - 67, 12, 12, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 67, 12, 12, 62, 98,116, 11, 63,109,224,227, 61,147,111, 11, 63, 8, 0, 0, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,204,204, 61, 0, 0, 0, 63, 8, 0, 0, 62,244, 1, 0, 63, -109,224,227, 61,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -109,224,227, 61,147,111, 11, 63, 67, 12, 12, 62, 98,116, 11, 63,147,213,251, 61,228,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,196,153, 25, 62, 73, 58,217, 62,171, 31,253, 61, 6,196,217, 62, - 1,135, 11, 62,228,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 1,135, 11, 62,228,230,198, 62,153,172, 39, 62,230,230,198, 62,196,153, 25, 62, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,163, 52, 62, 7,196,217, 62,196,153, 25, 62, 73, 58,217, 62, -153,172, 39, 62,230,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -153,172, 39, 62,230,230,198, 62, 1,135, 11, 62,228,230,198, 62,214,153, 25, 62,165,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,196,153, 25, 62, 73, 58,217, 62,179,163, 52, 62, 7,196,217, 62, -202,235, 38, 62, 33,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -202,235, 38, 62, 33,211,236, 62,173, 71, 12, 62, 31,211,236, 62,196,153, 25, 62, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,171, 31,253, 61, 6,196,217, 62,196,153, 25, 62, 73, 58,217, 62, -173, 71, 12, 62, 31,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -173, 71, 12, 62, 31,211,236, 62,202,235, 38, 62, 33,211,236, 62,181,153, 25, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 62,244, 1, 0, 63,215,204,204, 61, 0, 0, 0, 63, -251,166,228, 61, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,166,228, 61, 67,207,236, 62,173, 71, 12, 62, 31,211,236, 62, 8, 0, 0, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,181,153, 25, 62, 0, 0, 0, 63, 8, 0, 0, 62,244, 1, 0, 63, -173, 71, 12, 62, 31,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -173, 71, 12, 62, 31,211,236, 62,251,166,228, 61, 67,207,236, 62,171, 31,253, 61, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 92, 51, 51, 62,244, 1, 0, 63,181,153, 25, 62, 0, 0, 0, 63, -202,235, 38, 62, 33,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -202,235, 38, 62, 33,211,236, 62,251,223, 64, 62, 67,207,236, 62, 92, 51, 51, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,254,204, 76, 62, 0, 0, 0, 63, 92, 51, 51, 62,244, 1, 0, 63, -251,223, 64, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,223, 64, 62, 67,207,236, 62,202,235, 38, 62, 33,211,236, 62,179,163, 52, 62, 7,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42,228,203, 61, 37, 48, 21, 63, 1,122,156, 61,254, 29, 19, 63, -172,242,180, 61, 96,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -172,242,180, 61, 96,152, 9, 63,109,224,227, 61,147,111, 11, 63, 42,228,203, 61, 37, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147,213,251, 61,228,209, 22, 63, 42,228,203, 61, 37, 48, 21, 63, -109,224,227, 61,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -109,224,227, 61,147,111, 11, 63,172,242,180, 61, 96,152, 9, 63,215,204,204, 61, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42,228,203, 61, 37, 48, 21, 63,147,213,251, 61,228,209, 22, 63, -208, 85,228, 61,179, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -208, 85,228, 61,179, 23, 33, 63,212,227,177, 61,110, 60, 31, 63, 42,228,203, 61, 37, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1,122,156, 61,254, 29, 19, 63, 42,228,203, 61, 37, 48, 21, 63, -212,227,177, 61,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212,227,177, 61,110, 60, 31, 63,208, 85,228, 61,179, 23, 33, 63,175, 36,202, 61,228, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 53, 80,151, 61,223,228, 40, 63,246,203, 76, 61, 48,200, 37, 63, -166,139,130, 61,145,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -166,139,130, 61,145,140, 28, 63,212,227,177, 61,110, 60, 31, 63, 53, 80,151, 61,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,175, 36,202, 61,228, 52, 43, 63, 53, 80,151, 61,223,228, 40, 63, -212,227,177, 61,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212,227,177, 61,110, 60, 31, 63,166,139,130, 61,145,140, 28, 63, 1,122,156, 61,254, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,201, 61,254, 61,207,160, 44, 63,175, 36,202, 61,228, 52, 43, 63, -208, 85,228, 61,179, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -208, 85,228, 61,179, 23, 33, 63,133,237, 10, 62,219, 17, 34, 63,201, 61,254, 61,207,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173,153, 25, 62, 27, 28, 45, 63,201, 61,254, 61,207,160, 44, 63, -133,237, 10, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,237, 10, 62,219, 17, 34, 63,208, 85,228, 61,179, 23, 33, 63,147,213,251, 61,228,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,245, 6,205, 62, 37, 48, 21, 63,155, 10,193, 62,229,209, 22, 63, -229, 7,199, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -229, 7,199, 62,147,111, 11, 63, 85,195,210, 62, 96,152, 9, 63,245, 6,205, 62, 37, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,128,225,216, 62,254, 29, 19, 63,245, 6,205, 62, 37, 48, 21, 63, - 85,195,210, 62, 96,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 85,195,210, 62, 96,152, 9, 63,229, 7,199, 62,147,111, 11, 63,202,204,204, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,245, 6,205, 62, 37, 48, 21, 63,128,225,216, 62,254, 29, 19, 63, - 11,135,211, 62,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 11,135,211, 62,110, 60, 31, 63,140,234,198, 62,179, 23, 33, 63,245, 6,205, 62, 37, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,155, 10,193, 62,229,209, 22, 63,245, 6,205, 62, 37, 48, 21, 63, -140,234,198, 62,179, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -140,234,198, 62,179, 23, 33, 63, 11,135,211, 62,110, 60, 31, 63,212,118,205, 62,228, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,142,112,192, 62,207,160, 44, 63, 42, 51,179, 62, 28, 28, 45, 63, - 61,137,186, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 61,137,186, 62,219, 17, 34, 63,140,234,198, 62,179, 23, 33, 63,142,112,192, 62,207,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,118,205, 62,228, 52, 43, 63,142,112,192, 62,207,160, 44, 63, -140,234,198, 62,179, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -140,234,198, 62,179, 23, 33, 63, 61,137,186, 62,219, 17, 34, 63,155, 10,193, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,243, 43,218, 62,223,228, 40, 63,212,118,205, 62,228, 52, 43, 63, - 11,135,211, 62,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 11,135,211, 62,110, 60, 31, 63, 22, 93,223, 62,145,140, 28, 63,243, 43,218, 62,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,102,230, 62, 48,200, 37, 63,243, 43,218, 62,223,228, 40, 63, - 22, 93,223, 62,145,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22, 93,223, 62,145,140, 28, 63, 11,135,211, 62,110, 60, 31, 63,128,225,216, 62,254, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 51,179, 62,185, 32, 23, 63,155, 10,193, 62,229,209, 22, 63, - 61,137,186, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 61,137,186, 62,219, 17, 34, 63, 20,221,171, 62,219, 17, 34, 63, 38, 51,179, 62,185, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180, 91,165, 62,229,209, 22, 63, 38, 51,179, 62,185, 32, 23, 63, - 20,221,171, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 20,221,171, 62,219, 17, 34, 63, 61,137,186, 62,219, 17, 34, 63, 42, 51,179, 62, 28, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 51,179, 62,185, 32, 23, 63,180, 91,165, 62,229,209, 22, 63, -111,108,172, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -111,108,172, 62, 98,116, 11, 63,222,249,185, 62, 98,116, 11, 63, 38, 51,179, 62,185, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,155, 10,193, 62,229,209, 22, 63, 38, 51,179, 62,185, 32, 23, 63, -222,249,185, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -222,249,185, 62, 98,116, 11, 63,111,108,172, 62, 98,116, 11, 63, 38, 51,179, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,252,255,191, 62,244, 1, 0, 63,202,204,204, 62, 0, 0, 0, 63, -229, 7,199, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -229, 7,199, 62,147,111, 11, 63,222,249,185, 62, 98,116, 11, 63,252,255,191, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 51,179, 62, 0, 0, 0, 63,252,255,191, 62,244, 1, 0, 63, -222,249,185, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -222,249,185, 62, 98,116, 11, 63,229, 7,199, 62,147,111, 11, 63,155, 10,193, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 82,102,166, 62,244, 1, 0, 63, 38, 51,179, 62, 0, 0, 0, 63, -111,108,172, 62, 98,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -111,108,172, 62, 98,116, 11, 63,104, 94,159, 62,147,111, 11, 63, 82,102,166, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,153,153, 62, 0, 0, 0, 63, 82,102,166, 62,244, 1, 0, 63, -104, 94,159, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -104, 94,159, 62,147,111, 11, 63,111,108,172, 62, 98,116, 11, 63,180, 91,165, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 30, 51,179, 62, 73, 58,217, 62, 39,174,165, 62, 7,196,217, 62, -180, 41,172, 62,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -180, 41,172, 62,227,230,198, 62,127, 60,186, 62,225,230,198, 62, 30, 51,179, 62, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,184,192, 62, 6,196,217, 62, 30, 51,179, 62, 73, 58,217, 62, -127, 60,186, 62,225,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -127, 60,186, 62,225,230,198, 62,180, 41,172, 62,227,230,198, 62, 21, 51,179, 62,165,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 30, 51,179, 62, 73, 58,217, 62, 21,184,192, 62, 6,196,217, 62, - 42,220,185, 62, 31,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42,220,185, 62, 31,211,236, 62, 27,138,172, 62, 33,211,236, 62, 30, 51,179, 62, 73, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 39,174,165, 62, 7,196,217, 62, 30, 51,179, 62, 73, 58,217, 62, - 27,138,172, 62, 33,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 27,138,172, 62, 33,211,236, 62, 42,220,185, 62, 31,211,236, 62, 38, 51,179, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 82,102,166, 62,244, 1, 0, 63,129,153,153, 62, 0, 0, 0, 63, - 3,144,159, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 3,144,159, 62, 67,207,236, 62, 27,138,172, 62, 33,211,236, 62, 82,102,166, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 51,179, 62, 0, 0, 0, 63, 82,102,166, 62,244, 1, 0, 63, - 27,138,172, 62, 33,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 27,138,172, 62, 33,211,236, 62, 3,144,159, 62, 67,207,236, 62, 39,174,165, 62, 7,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,252,255,191, 62,244, 1, 0, 63, 38, 51,179, 62, 0, 0, 0, 63, - 42,220,185, 62, 31,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42,220,185, 62, 31,211,236, 62, 65,214,198, 62, 67,207,236, 62,252,255,191, 62,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,202,204,204, 62, 0, 0, 0, 63,252,255,191, 62,244, 1, 0, 63, - 65,214,198, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65,214,198, 62, 67,207,236, 62, 42,220,185, 62, 31,211,236, 62, 21,184,192, 62, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 95, 95,153, 62, 32, 48, 21, 63,224,132,141, 62,246, 29, 19, 63, - 1,163,147, 62, 91,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 1,163,147, 62, 91,152, 9, 63,104, 94,159, 62,147,111, 11, 63, 95, 95,153, 62, 32, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180, 91,165, 62,229,209, 22, 63, 95, 95,153, 62, 32, 48, 21, 63, -104, 94,159, 62,147,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -104, 94,159, 62,147,111, 11, 63, 1,163,147, 62, 91,152, 9, 63,129,153,153, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 95, 95,153, 62, 32, 48, 21, 63,180, 91,165, 62,229,209, 22, 63, -203,123,159, 62,170, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -203,123,159, 62,170, 23, 33, 63, 84,223,146, 62, 94, 60, 31, 63, 95, 95,153, 62, 32, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,224,132,141, 62,246, 29, 19, 63, 95, 95,153, 62, 32, 48, 21, 63, - 84,223,146, 62, 94, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 84,223,146, 62, 94, 60, 31, 63,203,123,159, 62,170, 23, 33, 63,141,239,152, 62,211, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,121, 58,140, 62,199,228, 40, 63, 0, 0,128, 62, 23,200, 37, 63, - 86, 9,135, 62,130,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 86, 9,135, 62,130,140, 28, 63, 84,223,146, 62, 94, 60, 31, 63,121, 58,140, 62,199,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,141,239,152, 62,211, 52, 43, 63,121, 58,140, 62,199,228, 40, 63, - 84,223,146, 62, 94, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 84,223,146, 62, 94, 60, 31, 63, 86, 9,135, 62,130,140, 28, 63,224,132,141, 62,246, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,204,245,165, 62,198,160, 44, 63,141,239,152, 62,211, 52, 43, 63, -203,123,159, 62,170, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -203,123,159, 62,170, 23, 33, 63, 20,221,171, 62,219, 17, 34, 63,204,245,165, 62,198,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 42, 51,179, 62, 28, 28, 45, 63,204,245,165, 62,198,160, 44, 63, - 20,221,171, 62,219, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 20,221,171, 62,219, 17, 34, 63,203,123,159, 62,170, 23, 33, 63,180, 91,165, 62,229,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180,182, 25, 63, 38, 48, 21, 63,140,184, 19, 63,232,209, 22, 63, - 43,183, 22, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43,183, 22, 63,149,111, 11, 63,223,148, 28, 63, 94,152, 9, 63,180,182, 25, 63, 38, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,245,163, 31, 63,253, 29, 19, 63,180,182, 25, 63, 38, 48, 21, 63, -223,148, 28, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -223,148, 28, 63, 94,152, 9, 63, 43,183, 22, 63,149,111, 11, 63,155,153, 25, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180,182, 25, 63, 38, 48, 21, 63,245,163, 31, 63,253, 29, 19, 63, -191,246, 28, 63,109, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,246, 28, 63,109, 60, 31, 63,132,168, 22, 63,180, 23, 33, 63,180,182, 25, 63, 38, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,140,184, 19, 63,232,209, 22, 63,180,182, 25, 63, 38, 48, 21, 63, -132,168, 22, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -132,168, 22, 63,180, 23, 33, 63,191,246, 28, 63,109, 60, 31, 63,169,238, 25, 63,229, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,107, 19, 63,211,160, 44, 63,220,204, 12, 63, 35, 28, 45, 63, -225,119, 16, 63,225, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225,119, 16, 63,225, 17, 34, 63,132,168, 22, 63,180, 23, 33, 63,138,107, 19, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,169,238, 25, 63,229, 52, 43, 63,138,107, 19, 63,211,160, 44, 63, -132,168, 22, 63,180, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -132,168, 22, 63,180, 23, 33, 63,225,119, 16, 63,225, 17, 34, 63,140,184, 19, 63,232,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 51, 73, 32, 63,221,228, 40, 63,169,238, 25, 63,229, 52, 43, 63, -191,246, 28, 63,109, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,246, 28, 63,109, 60, 31, 63,192,225, 34, 63,142,140, 28, 63, 51, 73, 32, 63,221,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,117,102, 38, 63, 45,200, 37, 63, 51, 73, 32, 63,221,228, 40, 63, -192,225, 34, 63,142,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -192,225, 34, 63,142,140, 28, 63,191,246, 28, 63,109, 60, 31, 63,245,163, 31, 63,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,204, 12, 63,188, 32, 23, 63,140,184, 19, 63,232,209, 22, 63, -225,119, 16, 63,225, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225,119, 16, 63,225, 17, 34, 63,207, 33, 9, 63,226, 17, 34, 63,212,204, 12, 63,188, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 29,225, 5, 63,233,209, 22, 63,212,204, 12, 63,188, 32, 23, 63, -207, 33, 9, 63,226, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -207, 33, 9, 63,226, 17, 34, 63,225,119, 16, 63,225, 17, 34, 63,220,204, 12, 63, 35, 28, 45, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,212,204, 12, 63,188, 32, 23, 63, 29,225, 5, 63,233,209, 22, 63, -118,105, 9, 63,101,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,105, 9, 63,101,116, 11, 63, 43, 48, 16, 63,100,116, 11, 63,212,204, 12, 63,188, 32, 23, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,140,184, 19, 63,232,209, 22, 63,212,204, 12, 63,188, 32, 23, 63, - 43, 48, 16, 63,100,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43, 48, 16, 63,100,116, 11, 63,118,105, 9, 63,101,116, 11, 63,205,204, 12, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 51, 51, 19, 63,244, 1, 0, 63,155,153, 25, 63, 0, 0, 0, 63, - 43,183, 22, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43,183, 22, 63,149,111, 11, 63, 43, 48, 16, 63,100,116, 11, 63, 51, 51, 19, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,205,204, 12, 63, 0, 0, 0, 63, 51, 51, 19, 63,244, 1, 0, 63, - 43, 48, 16, 63,100,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43, 48, 16, 63,100,116, 11, 63, 43,183, 22, 63,149,111, 11, 63,140,184, 19, 63,232,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,102,102, 6, 63,244, 1, 0, 63,205,204, 12, 63, 0, 0, 0, 63, -118,105, 9, 63,101,116, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,105, 9, 63,101,116, 11, 63,118,226, 2, 63,149,111, 11, 63,102,102, 6, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,102,102, 6, 63,244, 1, 0, 63, -118,226, 2, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,226, 2, 63,149,111, 11, 63,118,105, 9, 63,101,116, 11, 63, 29,225, 5, 63,233,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198,204, 12, 63, 72, 58,217, 62, 77, 10, 6, 63, 6,196,217, 62, - 17, 72, 9, 63,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 17, 72, 9, 63,227,230,198, 62,117, 81, 16, 63,223,230,198, 62,198,204, 12, 63, 72, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64,143, 19, 63, 4,196,217, 62,198,204, 12, 63, 72, 58,217, 62, -117, 81, 16, 63,223,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117, 81, 16, 63,223,230,198, 62, 17, 72, 9, 63,227,230,198, 62,191,204, 12, 63,160,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198,204, 12, 63, 72, 58,217, 62, 64,143, 19, 63, 4,196,217, 62, - 76, 33, 16, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 76, 33, 16, 63, 30,211,236, 62, 71,120, 9, 63, 30,211,236, 62,198,204, 12, 63, 72, 58,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 77, 10, 6, 63, 6,196,217, 62,198,204, 12, 63, 72, 58,217, 62, - 71,120, 9, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 71,120, 9, 63, 30,211,236, 62, 76, 33, 16, 63, 30,211,236, 62,205,204, 12, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,102,102, 6, 63,244, 1, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 62,251, 2, 63, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 62,251, 2, 63, 67,207,236, 62, 71,120, 9, 63, 30,211,236, 62,102,102, 6, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,205,204, 12, 63, 0, 0, 0, 63,102,102, 6, 63,244, 1, 0, 63, - 71,120, 9, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 71,120, 9, 63, 30,211,236, 62, 62,251, 2, 63, 67,207,236, 62, 77, 10, 6, 63, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 51, 51, 19, 63,244, 1, 0, 63,205,204, 12, 63, 0, 0, 0, 63, - 76, 33, 16, 63, 30,211,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 76, 33, 16, 63, 30,211,236, 62, 86,158, 22, 63, 65,207,236, 62, 51, 51, 19, 63,244, 1, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,155,153, 25, 63, 0, 0, 0, 63, 51, 51, 19, 63,244, 1, 0, 63, - 86,158, 22, 63, 65,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 86,158, 22, 63, 65,207,236, 62, 76, 33, 16, 63, 30,211,236, 62, 64,143, 19, 63, 4,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,233,197,255, 62, 39, 48, 21, 63,101,235,243, 62,252, 29, 19, 63, -132, 9,250, 62, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -132, 9,250, 62, 94,152, 9, 63,118,226, 2, 63,149,111, 11, 63,233,197,255, 62, 39, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 29,225, 5, 63,233,209, 22, 63,233,197,255, 62, 39, 48, 21, 63, -118,226, 2, 63,149,111, 11, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118,226, 2, 63,149,111, 11, 63,132, 9,250, 62, 94,152, 9, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,233,197,255, 62, 39, 48, 21, 63, 29,225, 5, 63,233,209, 22, 63, - 43,241, 2, 63,181, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43,241, 2, 63,181, 23, 33, 63,225, 69,249, 62,110, 60, 31, 63,233,197,255, 62, 39, 48, 21, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,235,243, 62,252, 29, 19, 63,233,197,255, 62, 39, 48, 21, 63, -225, 69,249, 62,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225, 69,249, 62,110, 60, 31, 63, 43,241, 2, 63,181, 23, 33, 63, 30, 86,255, 62,230, 52, 43, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 9,161,242, 62,223,228, 40, 63,129,102,230, 62, 48,200, 37, 63, -222,111,237, 62,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -222,111,237, 62,143,140, 28, 63,225, 69,249, 62,110, 60, 31, 63, 9,161,242, 62,223,228, 40, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 30, 86,255, 62,230, 52, 43, 63, 9,161,242, 62,223,228, 40, 63, -225, 69,249, 62,110, 60, 31, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -225, 69,249, 62,110, 60, 31, 63,222,111,237, 62,143,140, 28, 63,101,235,243, 62,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 46, 46, 6, 63,211,160, 44, 63, 30, 86,255, 62,230, 52, 43, 63, - 43,241, 2, 63,181, 23, 33, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 43,241, 2, 63,181, 23, 33, 63,207, 33, 9, 63,226, 17, 34, 63, 46, 46, 6, 63,211,160, 44, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,220,204, 12, 63, 35, 28, 45, 63, 46, 46, 6, 63,211,160, 44, 63, -207, 33, 9, 63,226, 17, 34, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -207, 33, 9, 63,226, 17, 34, 63, 43,241, 2, 63,181, 23, 33, 63, 29,225, 5, 63,233,209, 22, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,238, 85, 63, 72,220,187, 62,218,173, 82, 63, 55, 92,210, 62, -229,189, 79, 63,173,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -229,189, 79, 63,173,208,189, 62,230,250, 82, 63,117,190,166, 62,138,238, 85, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,149,153, 89, 63,201,199,165, 62,138,238, 85, 63, 72,220,187, 62, -230,250, 82, 63,117,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -230,250, 82, 63,117,190,166, 62,229,189, 79, 63,173,208,189, 62,198,119, 76, 63, 90,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,111, 73, 63, 68,135,193, 62,198,119, 76, 63, 90,150,169, 62, -229,189, 79, 63,173,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -229,189, 79, 63,173,208,189, 62,176,175, 76, 63,192,159,213, 62,170,111, 73, 63, 68,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,112,194, 70, 63, 19,196,217, 62,170,111, 73, 63, 68,135,193, 62, -176,175, 76, 63,192,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176,175, 76, 63,192,159,213, 62,229,189, 79, 63,173,208,189, 62,218,173, 82, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 52,175, 79, 63,218, 32,233, 62,193,204, 76, 63, 0, 0, 0, 63, -128,209, 73, 63, 75,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -128,209, 73, 63, 75,207,236, 62,176,175, 76, 63,192,159,213, 62, 52,175, 79, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,218,173, 82, 63, 55, 92,210, 62, 52,175, 79, 63,218, 32,233, 62, -176,175, 76, 63,192,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176,175, 76, 63,192,159,213, 62,128,209, 73, 63, 75,207,236, 62,112,194, 70, 63, 19,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,111, 73, 63, 68,135,193, 62,112,194, 70, 63, 19,196,217, 62, -171,132, 67, 63,253,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,132, 67, 63,253,230,198, 62, 61, 29, 70, 63,114, 54,174, 62,170,111, 73, 63, 68,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198,119, 76, 63, 90,150,169, 62,170,111, 73, 63, 68,135,193, 62, - 61, 29, 70, 63,114, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 61, 29, 70, 63,114, 54,174, 62,171,132, 67, 63,253,230,198, 62, 0, 0, 64, 63,211,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 52,175, 79, 63,218, 32,233, 62,218,173, 82, 63, 55, 92,210, 62, - 56, 54, 86, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 56, 54, 86, 63, 58, 23,233, 62, 41, 51, 83, 63, 24,252,255, 62, 52,175, 79, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,193,204, 76, 63, 0, 0, 0, 63, 52,175, 79, 63,218, 32,233, 62, - 41, 51, 83, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 41, 51, 83, 63, 24,252,255, 62, 56, 54, 86, 63, 58, 23,233, 62,147,153, 89, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,239,252, 92, 63, 58, 23,233, 62,147,153, 89, 63, 0, 0, 0, 63, - 56, 54, 86, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 56, 54, 86, 63, 58, 23,233, 62,147,153, 89, 63,143,190,209, 62,239,252, 92, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 78,133, 96, 63, 55, 92,210, 62,239,252, 92, 63, 58, 23,233, 62, -147,153, 89, 63,143,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -147,153, 89, 63,143,190,209, 62, 56, 54, 86, 63, 58, 23,233, 62,218,173, 82, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,138,238, 85, 63, 72,220,187, 62,149,153, 89, 63,201,199,165, 62, -159, 68, 93, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -159, 68, 93, 63, 72,220,187, 62,147,153, 89, 63,143,190,209, 62,138,238, 85, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,218,173, 82, 63, 55, 92,210, 62,138,238, 85, 63, 72,220,187, 62, -147,153, 89, 63,143,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -147,153, 89, 63,143,190,209, 62,159, 68, 93, 63, 72,220,187, 62, 78,133, 96, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,239,252, 92, 63, 58, 23,233, 62, 78,133, 96, 63, 55, 92,210, 62, -242,131, 99, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -242,131, 99, 63,218, 32,233, 62,254,255, 95, 63, 24,252,255, 62,239,252, 92, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147,153, 89, 63, 0, 0, 0, 63,239,252, 92, 63, 58, 23,233, 62, -254,255, 95, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -254,255, 95, 63, 24,252,255, 62,242,131, 99, 63,218, 32,233, 62,101,102,102, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,139,174,111, 63,223,230,198, 62,192,112,108, 63, 4,196,217, 62, -133,195,105, 63, 37,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,195,105, 63, 37,135,193, 62,249, 21,109, 63, 65, 54,174, 62,139,174,111, 63,223,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63,160,111,180, 62,139,174,111, 63,223,230,198, 62, -249, 21,109, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -249, 21,109, 63, 65, 54,174, 62,133,195,105, 63, 37,135,193, 62,106,187,102, 63, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 70,117, 99, 63,155,208,189, 62,106,187,102, 63, 54,150,169, 62, -133,195,105, 63, 37,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,195,105, 63, 37,135,193, 62,123,131,102, 63,181,159,213, 62, 70,117, 99, 63,155,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 78,133, 96, 63, 55, 92,210, 62, 70,117, 99, 63,155,208,189, 62, -123,131,102, 63,181,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -123,131,102, 63,181,159,213, 62,133,195,105, 63, 37,135,193, 62,192,112,108, 63, 4,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170, 97,105, 63, 65,207,236, 62,101,102,102, 63, 0, 0, 0, 63, -242,131, 99, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -242,131, 99, 63,218, 32,233, 62,123,131,102, 63,181,159,213, 62,170, 97,105, 63, 65,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192,112,108, 63, 4,196,217, 62,170, 97,105, 63, 65,207,236, 62, -123,131,102, 63,181,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -123,131,102, 63,181,159,213, 62,242,131, 99, 63,218, 32,233, 62, 78,133, 96, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 70,117, 99, 63,155,208,189, 62, 78,133, 96, 63, 55, 92,210, 62, -159, 68, 93, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -159, 68, 93, 63, 72,220,187, 62, 71, 56, 96, 63, 99,190,166, 62, 70,117, 99, 63,155,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,106,187,102, 63, 54,150,169, 62, 70,117, 99, 63,155,208,189, 62, - 71, 56, 96, 63, 99,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 71, 56, 96, 63, 99,190,166, 62,159, 68, 93, 63, 72,220,187, 62,149,153, 89, 63,201,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 33,107, 99, 63, 94,152, 9, 63, 11, 92, 96, 63,253, 29, 19, 63, - 21,238, 92, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21,238, 92, 63,112,150, 9, 63,254,255, 95, 63, 24,252,255, 62, 33,107, 99, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,102,102, 63, 0, 0, 0, 63, 33,107, 99, 63, 94,152, 9, 63, -254,255, 95, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -254,255, 95, 63, 24,252,255, 62, 21,238, 92, 63,112,150, 9, 63,147,153, 89, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14, 69, 86, 63,112,150, 9, 63,147,153, 89, 63, 0, 0, 0, 63, - 21,238, 92, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21,238, 92, 63,112,150, 9, 63,143,153, 89, 63,219, 98, 19, 63, 14, 69, 86, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 19,215, 82, 63,252, 29, 19, 63, 14, 69, 86, 63,112,150, 9, 63, -143,153, 89, 63,219, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -143,153, 89, 63,219, 98, 19, 63, 21,238, 92, 63,112,150, 9, 63, 11, 92, 96, 63,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 30, 93, 63,143,140, 28, 63,139,153, 89, 63, 45,200, 37, 63, -218, 20, 86, 63,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -218, 20, 86, 63,143,140, 28, 63,143,153, 89, 63,219, 98, 19, 63, 63, 30, 93, 63,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 11, 92, 96, 63,253, 29, 19, 63, 63, 30, 93, 63,143,140, 28, 63, -143,153, 89, 63,219, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -143,153, 89, 63,219, 98, 19, 63,218, 20, 86, 63,143,140, 28, 63, 19,215, 82, 63,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14, 69, 86, 63,112,150, 9, 63, 19,215, 82, 63,252, 29, 19, 63, - 1,200, 79, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 1,200, 79, 63, 94,152, 9, 63, 41, 51, 83, 63, 24,252,255, 62, 14, 69, 86, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147,153, 89, 63, 0, 0, 0, 63, 14, 69, 86, 63,112,150, 9, 63, - 41, 51, 83, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 41, 51, 83, 63, 24,252,255, 62, 1,200, 79, 63, 94,152, 9, 63,193,204, 76, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 28, 18, 61, 60,220,187, 62,151, 35,188, 60, 46, 92,210, 62, -218, 74, 60, 60,150,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -218, 74, 60, 60,150,208,189, 62,195,197,197, 60, 89,190,166, 62,237, 28, 18, 61, 60,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,194,205, 76, 61,186,199,165, 62,237, 28, 18, 61, 60,220,187, 62, -195,197,197, 60, 89,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 23, 23,131, 63, 89,190,166, 62,150,120,129, 63,150,208,189, 62, 15,171,127, 63, 52,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,241,162,124, 63, 36,135,193, 62, 15,171,127, 63, 52,150,169, 62, -150,120,129, 63,150,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -150,120,129, 63,150,208,189, 62,244,226,127, 63,179,159,213, 62,241,162,124, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,245,121, 63, 6,196,217, 62,241,162,124, 63, 36,135,193, 62, -244,226,127, 63,179,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -244,226,127, 63,179,159,213, 62,150,120,129, 63,150,208,189, 62,142,240,130, 63, 46, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 59,113,129, 63,214, 32,233, 62, 0, 0,128, 63, 0, 0, 0, 63, -194, 4,125, 63, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194, 4,125, 63, 67,207,236, 62,244,226,127, 63,179,159,213, 62, 59,113,129, 63,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,142,240,130, 63, 46, 92,210, 62, 59,113,129, 63,214, 32,233, 62, -244,226,127, 63,179,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -244,226,127, 63,179,159,213, 62,194, 4,125, 63, 67,207,236, 62,179,245,121, 63, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,241,162,124, 63, 36,135,193, 62,179,245,121, 63, 6,196,217, 62, -239,183,118, 63,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,183,118, 63,227,230,198, 62,133, 80,121, 63, 65, 54,174, 62,241,162,124, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 15,171,127, 63, 52,150,169, 62,241,162,124, 63, 36,135,193, 62, -133, 80,121, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133, 80,121, 63, 65, 54,174, 62,239,183,118, 63,227,230,198, 62, 65, 51,115, 63,160,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,110,157, 56, 60,214, 32,233, 62,151, 35,188, 60, 46, 92,210, 62, - 95,151, 22, 61, 55, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 95,151, 22, 61, 55, 23,233, 62,176,204,204, 60, 24,252,255, 62,110,157, 56, 60,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,167, 79, 11, 38, 0, 0, 0, 63,110,157, 56, 60,214, 32,233, 62, -176,204,204, 60, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176,204,204, 60, 24,252,255, 62, 95,151, 22, 61, 55, 23,233, 62,215,204, 76, 61, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 87,129,129, 61, 57, 23,233, 62,215,204, 76, 61, 0, 0, 0, 63, - 95,151, 22, 61, 55, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 95,151, 22, 61, 55, 23,233, 62, 68,205, 76, 61,135,190,209, 62, 87,129,129, 61, 57, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 92,196,157, 61, 49, 92,210, 62, 87,129,129, 61, 57, 23,233, 62, - 68,205, 76, 61,135,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 68,205, 76, 61,135,190,209, 62, 95,151, 22, 61, 55, 23,233, 62,151, 35,188, 60, 46, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 28, 18, 61, 60,220,187, 62,194,205, 76, 61,186,199,165, 62, - 7,191,131, 61, 62,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 7,191,131, 61, 62,220,187, 62, 68,205, 76, 61,135,190,209, 62,237, 28, 18, 61, 60,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,151, 35,188, 60, 46, 92,210, 62,237, 28, 18, 61, 60,220,187, 62, - 68,205, 76, 61,135,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 68,205, 76, 61,135,190,209, 62, 7,191,131, 61, 62,220,187, 62, 92,196,157, 61, 49, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 87,129,129, 61, 57, 23,233, 62, 92,196,157, 61, 49, 92,210, 62, - 89,185,181, 61,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89,185,181, 61,214, 32,233, 62,154,153,153, 61, 25,252,255, 62, 87,129,129, 61, 57, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,204, 76, 61, 0, 0, 0, 63, 87,129,129, 61, 57, 23,233, 62, -154,153,153, 61, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -154,153,153, 61, 25,252,255, 62, 89,185,181, 61,214, 32,233, 62,215,204,204, 61, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1,135, 11, 62,228,230,198, 62,171, 31,253, 61, 6,196,217, 62, -251,181,231, 61, 38,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,181,231, 61, 38,135,193, 62,204, 36, 1, 62, 70, 54,174, 62, 1,135, 11, 62,228,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,165,111,180, 62, 1,135, 11, 62,228,230,198, 62, -204, 36, 1, 62, 70, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -204, 36, 1, 62, 70, 54,174, 62,251,181,231, 61, 38,135,193, 62, 70,117,207, 61, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 35, 68,181, 61,153,208,189, 62, 70,117,207, 61, 54,150,169, 62, -251,181,231, 61, 38,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,181,231, 61, 38,135,193, 62,164,181,205, 61,180,159,213, 62, 35, 68,181, 61,153,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 92,196,157, 61, 49, 92,210, 62, 35, 68,181, 61,153,208,189, 62, -164,181,205, 61,180,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -164,181,205, 61,180,159,213, 62,251,181,231, 61, 38,135,193, 62,171, 31,253, 61, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,251,166,228, 61, 67,207,236, 62,215,204,204, 61, 0, 0, 0, 63, - 89,185,181, 61,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89,185,181, 61,214, 32,233, 62,164,181,205, 61,180,159,213, 62,251,166,228, 61, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,171, 31,253, 61, 6,196,217, 62,251,166,228, 61, 67,207,236, 62, -164,181,205, 61,180,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -164,181,205, 61,180,159,213, 62, 89,185,181, 61,214, 32,233, 62, 92,196,157, 61, 49, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 35, 68,181, 61,153,208,189, 62, 92,196,157, 61, 49, 92,210, 62, - 7,191,131, 61, 62,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 7,191,131, 61, 62,220,187, 62, 79, 92,155, 61, 91,190,166, 62, 35, 68,181, 61,153,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 70,117,207, 61, 54,150,169, 62, 35, 68,181, 61,153,208,189, 62, - 79, 92,155, 61, 91,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 79, 92,155, 61, 91,190,166, 62, 7,191,131, 61, 62,220,187, 62,194,205, 76, 61,186,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,172,242,180, 61, 96,152, 9, 63, 1,122,156, 61,254, 29, 19, 63, -100, 10,129, 61,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -100, 10,129, 61,113,150, 9, 63,154,153,153, 61, 25,252,255, 62,172,242,180, 61, 96,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,204,204, 61, 0, 0, 0, 63,172,242,180, 61, 96,152, 9, 63, -154,153,153, 61, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -154,153,153, 61, 25,252,255, 62,100, 10,129, 61,113,150, 9, 63,215,204, 76, 61, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,109,132, 23, 61,113,150, 9, 63,215,204, 76, 61, 0, 0, 0, 63, -100, 10,129, 61,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -100, 10,129, 61,113,150, 9, 63, 91,204, 76, 61,220, 98, 19, 63,109,132, 23, 61,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,174, 73,193, 60,253, 29, 19, 63,109,132, 23, 61,113,150, 9, 63, - 91,204, 76, 61,220, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91,204, 76, 61,220, 98, 19, 63,100, 10,129, 61,113,150, 9, 63, 1,122,156, 61,254, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,166,139,130, 61,145,140, 28, 63,246,203, 76, 61, 48,200, 37, 63, - 13,129, 20, 61,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 13,129, 20, 61,143,140, 28, 63, 91,204, 76, 61,220, 98, 19, 63,166,139,130, 61,145,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1,122,156, 61,254, 29, 19, 63,166,139,130, 61,145,140, 28, 63, - 91,204, 76, 61,220, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91,204, 76, 61,220, 98, 19, 63, 13,129, 20, 61,143,140, 28, 63,174, 73,193, 60,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,109,132, 23, 61,113,150, 9, 63,174, 73,193, 60,253, 29, 19, 63, -114,207, 62, 60, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -114,207, 62, 60, 94,152, 9, 63,176,204,204, 60, 24,252,255, 62,109,132, 23, 61,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,204, 76, 61, 0, 0, 0, 63,109,132, 23, 61,113,150, 9, 63, -176,204,204, 60, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -176,204,204, 60, 24,252,255, 62,114,207, 62, 60, 94,152, 9, 63,167, 79, 11, 38, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 83,113, 62, 79,220,187, 62, 63, 81,100, 62, 60, 92,210, 62, -110,145, 88, 62,167,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -110,145, 88, 62,167,208,189, 62, 91,133,101, 62,112,190,166, 62,237, 83,113, 62, 79,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,206,199,165, 62,237, 83,113, 62, 79,220,187, 62, - 91,133,101, 62,112,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 91,133,101, 62,112,190,166, 62,110,145, 88, 62,167,208,189, 62,239,120, 75, 62, 70,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,144, 88, 63, 62, 46,135,193, 62,239,120, 75, 62, 70,150,169, 62, -110,145, 88, 62,167,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -110,145, 88, 62,167,208,189, 62,170, 88, 76, 62,187,159,213, 62,144, 88, 63, 62, 46,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,163, 52, 62, 7,196,217, 62,144, 88, 63, 62, 46,135,193, 62, -170, 88, 76, 62,187,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -170, 88, 76, 62,187,159,213, 62,110,145, 88, 62,167,208,189, 62, 63, 81,100, 62, 60, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,190, 86, 88, 62,221, 32,233, 62,254,204, 76, 62, 0, 0, 0, 63, -251,223, 64, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,223, 64, 62, 67,207,236, 62,170, 88, 76, 62,187,159,213, 62,190, 86, 88, 62,221, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 81,100, 62, 60, 92,210, 62,190, 86, 88, 62,221, 32,233, 62, -170, 88, 76, 62,187,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -170, 88, 76, 62,187,159,213, 62,251,223, 64, 62, 67,207,236, 62,179,163, 52, 62, 7,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,144, 88, 63, 62, 46,135,193, 62,179,163, 52, 62, 7,196,217, 62, -153,172, 39, 62,230,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -153,172, 39, 62,230,230,198, 62,213, 14, 50, 62, 78, 54,174, 62,144, 88, 63, 62, 46,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,239,120, 75, 62, 70,150,169, 62,144, 88, 63, 62, 46,135,193, 62, -213, 14, 50, 62, 78, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213, 14, 50, 62, 78, 54,174, 62,153,172, 39, 62,230,230,198, 62,214,153, 25, 62,165,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,190, 86, 88, 62,221, 32,233, 62, 63, 81,100, 62, 60, 92,210, 62, -166,114,114, 62, 63, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -166,114,114, 62, 63, 23,233, 62,126,102,102, 62, 25,252,255, 62,190, 86, 88, 62,221, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,254,204, 76, 62, 0, 0, 0, 63,190, 86, 88, 62,221, 32,233, 62, -126,102,102, 62, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -126,102,102, 62, 25,252,255, 62,166,114,114, 62, 63, 23,233, 62, 0, 0,128, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173,198,134, 62, 63, 23,233, 62, 0, 0,128, 62, 0, 0, 0, 63, -166,114,114, 62, 63, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -166,114,114, 62, 63, 23,233, 62, 0, 0,128, 62,149,190,209, 62,173,198,134, 62, 63, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 97,215,141, 62, 60, 92,210, 62,173,198,134, 62, 63, 23,233, 62, - 0, 0,128, 62,149,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,149,190,209, 62,166,114,114, 62, 63, 23,233, 62, 63, 81,100, 62, 60, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 83,113, 62, 79,220,187, 62, 0, 0,128, 62,206,199,165, 62, - 9, 86,135, 62, 79,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 9, 86,135, 62, 79,220,187, 62, 0, 0,128, 62,149,190,209, 62,237, 83,113, 62, 79,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 81,100, 62, 60, 92,210, 62,237, 83,113, 62, 79,220,187, 62, - 0, 0,128, 62,149,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,149,190,209, 62, 9, 86,135, 62, 79,220,187, 62, 97,215,141, 62, 60, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,173,198,134, 62, 63, 23,233, 62, 97,215,141, 62, 60, 92,210, 62, -161,212,147, 62,221, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -161,212,147, 62,221, 32,233, 62,193,204,140, 62, 25,252,255, 62,173,198,134, 62, 63, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 63,173,198,134, 62, 63, 23,233, 62, -193,204,140, 62, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -193,204,140, 62, 25,252,255, 62,161,212,147, 62,221, 32,233, 62,129,153,153, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,180, 41,172, 62,227,230,198, 62, 39,174,165, 62, 7,196,217, 62, -184, 83,160, 62, 46,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -184, 83,160, 62, 46,135,193, 62,150,248,166, 62, 78, 54,174, 62,180, 41,172, 62,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,165,111,180, 62,180, 41,172, 62,227,230,198, 62, -150,248,166, 62, 78, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -150,248,166, 62, 78, 54,174, 62,184, 83,160, 62, 46,135,193, 62,137, 67,154, 62, 70,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 73,183,147, 62,167,208,189, 62,137, 67,154, 62, 70,150,169, 62, -184, 83,160, 62, 46,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -184, 83,160, 62, 46,135,193, 62,171,211,153, 62,187,159,213, 62, 73,183,147, 62,167,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 97,215,141, 62, 60, 92,210, 62, 73,183,147, 62,167,208,189, 62, -171,211,153, 62,187,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,211,153, 62,187,159,213, 62,184, 83,160, 62, 46,135,193, 62, 39,174,165, 62, 7,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 3,144,159, 62, 67,207,236, 62,129,153,153, 62, 0, 0, 0, 63, -161,212,147, 62,221, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -161,212,147, 62,221, 32,233, 62,171,211,153, 62,187,159,213, 62, 3,144,159, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 39,174,165, 62, 7,196,217, 62, 3,144,159, 62, 67,207,236, 62, -171,211,153, 62,187,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,211,153, 62,187,159,213, 62,161,212,147, 62,221, 32,233, 62, 97,215,141, 62, 60, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 73,183,147, 62,167,208,189, 62, 97,215,141, 62, 60, 92,210, 62, - 9, 86,135, 62, 79,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 9, 86,135, 62, 79,220,187, 62, 82, 61,141, 62,112,190,166, 62, 73,183,147, 62,167,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,137, 67,154, 62, 70,150,169, 62, 73,183,147, 62,167,208,189, 62, - 82, 61,141, 62,112,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 82, 61,141, 62,112,190,166, 62, 9, 86,135, 62, 79,220,187, 62, 0, 0,128, 62,206,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1,163,147, 62, 91,152, 9, 63,224,132,141, 62,246, 29, 19, 63, -251,168,134, 62,107,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,168,134, 62,107,150, 9, 63,193,204,140, 62, 25,252,255, 62, 1,163,147, 62, 91,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129,153,153, 62, 0, 0, 0, 63, 1,163,147, 62, 91,152, 9, 63, -193,204,140, 62, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -193,204,140, 62, 25,252,255, 62,251,168,134, 62,107,150, 9, 63, 0, 0,128, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 11,174,114, 62,107,150, 9, 63, 0, 0,128, 62, 0, 0, 0, 63, -251,168,134, 62,107,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -251,168,134, 62,107,150, 9, 63, 0, 0,128, 62,209, 98, 19, 63, 11,174,114, 62,107,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64,246,100, 62,246, 29, 19, 63, 11,174,114, 62,107,150, 9, 63, - 0, 0,128, 62,209, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,209, 98, 19, 63,251,168,134, 62,107,150, 9, 63,224,132,141, 62,246, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 86, 9,135, 62,130,140, 28, 63, 0, 0,128, 62, 23,200, 37, 63, - 83,237,113, 62,130,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 83,237,113, 62,130,140, 28, 63, 0, 0,128, 62,209, 98, 19, 63, 86, 9,135, 62,130,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,224,132,141, 62,246, 29, 19, 63, 86, 9,135, 62,130,140, 28, 63, - 0, 0,128, 62,209, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0,128, 62,209, 98, 19, 63, 83,237,113, 62,130,140, 28, 63, 64,246,100, 62,246, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 11,174,114, 62,107,150, 9, 63, 64,246,100, 62,246, 29, 19, 63, -255,185, 88, 62, 90,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -255,185, 88, 62, 90,152, 9, 63,126,102,102, 62, 25,252,255, 62, 11,174,114, 62,107,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 0, 0, 0, 63, 11,174,114, 62,107,150, 9, 63, -126,102,102, 62, 25,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -126,102,102, 62, 25,252,255, 62,255,185, 88, 62, 90,152, 9, 63,254,204, 76, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 16,223, 62, 62,220,187, 62,233,142,216, 62, 49, 92,210, 62, -248,174,210, 62,153,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -248,174,210, 62,153,208,189, 62,237, 40,217, 62, 91,190,166, 62, 63, 16,223, 62, 62,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62,183,199,165, 62, 63, 16,223, 62, 62,220,187, 62, -237, 40,217, 62, 91,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -237, 40,217, 62, 91,190,166, 62,248,174,210, 62,153,208,189, 62,175, 34,204, 62, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129, 18,198, 62, 37,135,193, 62,175, 34,204, 62, 54,150,169, 62, -248,174,210, 62,153,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -248,174,210, 62,153,208,189, 62,151,146,204, 62,180,159,213, 62,129, 18,198, 62, 37,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,184,192, 62, 6,196,217, 62,129, 18,198, 62, 37,135,193, 62, -151,146,204, 62,180,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -151,146,204, 62,180,159,213, 62,248,174,210, 62,153,208,189, 62,233,142,216, 62, 49, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,145,210, 62,214, 32,233, 62,202,204,204, 62, 0, 0, 0, 63, - 65,214,198, 62, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65,214,198, 62, 67,207,236, 62,151,146,204, 62,180,159,213, 62,170,145,210, 62,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,233,142,216, 62, 49, 92,210, 62,170,145,210, 62,214, 32,233, 62, -151,146,204, 62,180,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -151,146,204, 62,180,159,213, 62, 65,214,198, 62, 67,207,236, 62, 21,184,192, 62, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,129, 18,198, 62, 37,135,193, 62, 21,184,192, 62, 6,196,217, 62, -127, 60,186, 62,225,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -127, 60,186, 62,225,230,198, 62,154,109,191, 62, 68, 54,174, 62,129, 18,198, 62, 37,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,175, 34,204, 62, 54,150,169, 62,129, 18,198, 62, 37,135,193, 62, -154,109,191, 62, 68, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -154,109,191, 62, 68, 54,174, 62,127, 60,186, 62,225,230,198, 62, 21, 51,179, 62,165,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,170,145,210, 62,214, 32,233, 62,233,142,216, 62, 49, 92,210, 62, -171,159,223, 62, 57, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,159,223, 62, 57, 23,233, 62,154,153,217, 62, 24,252,255, 62,170,145,210, 62,214, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,202,204,204, 62, 0, 0, 0, 63,170,145,210, 62,214, 32,233, 62, -154,153,217, 62, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -154,153,217, 62, 24,252,255, 62,171,159,223, 62, 57, 23,233, 62,101,102,230, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 20, 45,237, 62, 55, 23,233, 62,101,102,230, 62, 0, 0, 0, 63, -171,159,223, 62, 57, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -171,159,223, 62, 57, 23,233, 62, 88,102,230, 62,135,190,209, 62, 20, 45,237, 62, 55, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,199, 61,244, 62, 46, 92,210, 62, 20, 45,237, 62, 55, 23,233, 62, - 88,102,230, 62,135,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 88,102,230, 62,135,190,209, 62,171,159,223, 62, 57, 23,233, 62,233,142,216, 62, 49, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 16,223, 62, 62,220,187, 62, 72,102,230, 62,183,199,165, 62, - 99,188,237, 62, 60,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 99,188,237, 62, 60,220,187, 62, 88,102,230, 62,135,190,209, 62, 63, 16,223, 62, 62,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,233,142,216, 62, 49, 92,210, 62, 63, 16,223, 62, 62,220,187, 62, - 88,102,230, 62,135,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 88,102,230, 62,135,190,209, 62, 99,188,237, 62, 60,220,187, 62,199, 61,244, 62, 46, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 20, 45,237, 62, 55, 23,233, 62,199, 61,244, 62, 46, 92,210, 62, - 21, 59,250, 62,213, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 59,250, 62,213, 32,233, 62, 53, 51,243, 62, 24,252,255, 62, 20, 45,237, 62, 55, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,102,230, 62, 0, 0, 0, 63, 20, 45,237, 62, 55, 23,233, 62, - 53, 51,243, 62, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 53, 51,243, 62, 24,252,255, 62, 21, 59,250, 62,213, 32,233, 62, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 17, 72, 9, 63,227,230,198, 62, 77, 10, 6, 63, 6,196,217, 62, - 15, 93, 3, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 15, 93, 3, 63, 36,135,193, 62,123,175, 6, 63, 65, 54,174, 62, 17, 72, 9, 63,227,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63,160,111,180, 62, 17, 72, 9, 63,227,230,198, 62, -123,175, 6, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -123,175, 6, 63, 65, 54,174, 62, 15, 93, 3, 63, 36,135,193, 62,241, 84, 0, 63, 52,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,169, 29,250, 62,150,208,189, 62,241, 84, 0, 63, 52,150,169, 62, - 15, 93, 3, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 15, 93, 3, 63, 36,135,193, 62, 12, 29, 0, 63,179,159,213, 62,169, 29,250, 62,150,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,199, 61,244, 62, 46, 92,210, 62,169, 29,250, 62,150,208,189, 62, - 12, 29, 0, 63,179,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 12, 29, 0, 63,179,159,213, 62, 15, 93, 3, 63, 36,135,193, 62, 77, 10, 6, 63, 6,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 62,251, 2, 63, 67,207,236, 62, 0, 0, 0, 63, 0, 0, 0, 63, - 21, 59,250, 62,213, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 59,250, 62,213, 32,233, 62, 12, 29, 0, 63,179,159,213, 62, 62,251, 2, 63, 67,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 77, 10, 6, 63, 6,196,217, 62, 62,251, 2, 63, 67,207,236, 62, - 12, 29, 0, 63,179,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 12, 29, 0, 63,179,159,213, 62, 21, 59,250, 62,213, 32,233, 62,199, 61,244, 62, 46, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,169, 29,250, 62,150,208,189, 62,199, 61,244, 62, 46, 92,210, 62, - 99,188,237, 62, 60,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 99,188,237, 62, 60,220,187, 62,164,163,243, 62, 89,190,166, 62,169, 29,250, 62,150,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,241, 84, 0, 63, 52,150,169, 62,169, 29,250, 62,150,208,189, 62, -164,163,243, 62, 89,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -164,163,243, 62, 89,190,166, 62, 99,188,237, 62, 60,220,187, 62, 72,102,230, 62,183,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,132, 9,250, 62, 94,152, 9, 63,101,235,243, 62,252, 29, 19, 63, -114, 15,237, 62,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -114, 15,237, 62,113,150, 9, 63, 53, 51,243, 62, 24,252,255, 62,132, 9,250, 62, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63,132, 9,250, 62, 94,152, 9, 63, - 53, 51,243, 62, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 53, 51,243, 62, 24,252,255, 62,114, 15,237, 62,113,150, 9, 63,101,102,230, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,103,189,223, 62,112,150, 9, 63,101,102,230, 62, 0, 0, 0, 63, -114, 15,237, 62,113,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -114, 15,237, 62,113,150, 9, 63,117,102,230, 62,220, 98, 19, 63,103,189,223, 62,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,128,225,216, 62,254, 29, 19, 63,103,189,223, 62,112,150, 9, 63, -117,102,230, 62,220, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117,102,230, 62,220, 98, 19, 63,114, 15,237, 62,113,150, 9, 63,101,235,243, 62,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,222,111,237, 62,143,140, 28, 63,129,102,230, 62, 48,200, 37, 63, - 22, 93,223, 62,145,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22, 93,223, 62,145,140, 28, 63,117,102,230, 62,220, 98, 19, 63,222,111,237, 62,143,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,235,243, 62,252, 29, 19, 63,222,111,237, 62,143,140, 28, 63, -117,102,230, 62,220, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117,102,230, 62,220, 98, 19, 63, 22, 93,223, 62,145,140, 28, 63,128,225,216, 62,254, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,103,189,223, 62,112,150, 9, 63,128,225,216, 62,254, 29, 19, 63, - 85,195,210, 62, 96,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 85,195,210, 62, 96,152, 9, 63,154,153,217, 62, 24,252,255, 62,103,189,223, 62,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,101,102,230, 62, 0, 0, 0, 63,103,189,223, 62,112,150, 9, 63, -154,153,217, 62, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -154,153,217, 62, 24,252,255, 62, 85,195,210, 62, 96,152, 9, 63,202,204,204, 62, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 97,187, 34, 63, 72,220,187, 62,178,122, 31, 63, 55, 92,210, 62, -186,138, 28, 63,155,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -186,138, 28, 63,155,208,189, 62,185,199, 31, 63, 96,190,166, 62, 97,187, 34, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,107,102, 38, 63,201,199,165, 62, 97,187, 34, 63, 72,220,187, 62, -185,199, 31, 63, 96,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -185,199, 31, 63, 96,190,166, 62,186,138, 28, 63,155,208,189, 62,150, 68, 25, 63, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,123, 60, 22, 63, 36,135,193, 62,150, 68, 25, 63, 54,150,169, 62, -186,138, 28, 63,155,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -186,138, 28, 63,155,208,189, 62,133,124, 25, 63,181,159,213, 62,123, 60, 22, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64,143, 19, 63, 4,196,217, 62,123, 60, 22, 63, 36,135,193, 62, -133,124, 25, 63,181,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,124, 25, 63,181,159,213, 62,186,138, 28, 63,155,208,189, 62,178,122, 31, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,124, 28, 63,218, 32,233, 62,155,153, 25, 63, 0, 0, 0, 63, - 86,158, 22, 63, 65,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 86,158, 22, 63, 65,207,236, 62,133,124, 25, 63,181,159,213, 62, 14,124, 28, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,178,122, 31, 63, 55, 92,210, 62, 14,124, 28, 63,218, 32,233, 62, -133,124, 25, 63,181,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -133,124, 25, 63,181,159,213, 62, 86,158, 22, 63, 65,207,236, 62, 64,143, 19, 63, 4,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,123, 60, 22, 63, 36,135,193, 62, 64,143, 19, 63, 4,196,217, 62, -117, 81, 16, 63,223,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -117, 81, 16, 63,223,230,198, 62, 7,234, 18, 63, 65, 54,174, 62,123, 60, 22, 63, 36,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,150, 68, 25, 63, 54,150,169, 62,123, 60, 22, 63, 36,135,193, 62, - 7,234, 18, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 7,234, 18, 63, 65, 54,174, 62,117, 81, 16, 63,223,230,198, 62,191,204, 12, 63,160,111,180, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,124, 28, 63,218, 32,233, 62,178,122, 31, 63, 55, 92,210, 62, - 17, 3, 35, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 17, 3, 35, 63, 58, 23,233, 62, 2, 0, 32, 63, 24,252,255, 62, 14,124, 28, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,155,153, 25, 63, 0, 0, 0, 63, 14,124, 28, 63,218, 32,233, 62, - 2, 0, 32, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 2, 0, 32, 63, 24,252,255, 62, 17, 3, 35, 63, 58, 23,233, 62,109,102, 38, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,200,201, 41, 63, 58, 23,233, 62,109,102, 38, 63, 0, 0, 0, 63, - 17, 3, 35, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 17, 3, 35, 63, 58, 23,233, 62,109,102, 38, 63,143,190,209, 62,200,201, 41, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 82, 45, 63, 55, 92,210, 62,200,201, 41, 63, 58, 23,233, 62, -109,102, 38, 63,143,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -109,102, 38, 63,143,190,209, 62, 17, 3, 35, 63, 58, 23,233, 62,178,122, 31, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 97,187, 34, 63, 72,220,187, 62,107,102, 38, 63,201,199,165, 62, -118, 17, 42, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118, 17, 42, 63, 72,220,187, 62,109,102, 38, 63,143,190,209, 62, 97,187, 34, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,178,122, 31, 63, 55, 92,210, 62, 97,187, 34, 63, 72,220,187, 62, -109,102, 38, 63,143,190,209, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -109,102, 38, 63,143,190,209, 62,118, 17, 42, 63, 72,220,187, 62, 38, 82, 45, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,200,201, 41, 63, 58, 23,233, 62, 38, 82, 45, 63, 55, 92,210, 62, -204, 80, 48, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -204, 80, 48, 63,218, 32,233, 62,215,204, 44, 63, 23,252,255, 62,200,201, 41, 63, 58, 23,233, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,109,102, 38, 63, 0, 0, 0, 63,200,201, 41, 63, 58, 23,233, 62, -215,204, 44, 63, 23,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -215,204, 44, 63, 23,252,255, 62,204, 80, 48, 63,218, 32,233, 62, 63, 51, 51, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 85,123, 60, 63,253,230,198, 62,144, 61, 57, 63, 19,196,217, 62, - 86,144, 54, 63, 68,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 86,144, 54, 63, 68,135,193, 62,196,226, 57, 63,114, 54,174, 62, 85,123, 60, 63,253,230,198, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,211,111,180, 62, 85,123, 60, 63,253,230,198, 62, -196,226, 57, 63,114, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -196,226, 57, 63,114, 54,174, 62, 86,144, 54, 63, 68,135,193, 62, 58,136, 51, 63, 90,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 27, 66, 48, 63,173,208,189, 62, 58,136, 51, 63, 90,150,169, 62, - 86,144, 54, 63, 68,135,193, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 86,144, 54, 63, 68,135,193, 62, 80, 80, 51, 63,192,159,213, 62, 27, 66, 48, 63,173,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38, 82, 45, 63, 55, 92,210, 62, 27, 66, 48, 63,173,208,189, 62, - 80, 80, 51, 63,192,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80, 80, 51, 63,192,159,213, 62, 86,144, 54, 63, 68,135,193, 62,144, 61, 57, 63, 19,196,217, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,128, 46, 54, 63, 75,207,236, 62, 63, 51, 51, 63, 0, 0, 0, 63, -204, 80, 48, 63,218, 32,233, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -204, 80, 48, 63,218, 32,233, 62, 80, 80, 51, 63,192,159,213, 62,128, 46, 54, 63, 75,207,236, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,144, 61, 57, 63, 19,196,217, 62,128, 46, 54, 63, 75,207,236, 62, - 80, 80, 51, 63,192,159,213, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80, 80, 51, 63,192,159,213, 62,204, 80, 48, 63,218, 32,233, 62, 38, 82, 45, 63, 55, 92,210, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 27, 66, 48, 63,173,208,189, 62, 38, 82, 45, 63, 55, 92,210, 62, -118, 17, 42, 63, 72,220,187, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -118, 17, 42, 63, 72,220,187, 62, 26, 5, 45, 63,117,190,166, 62, 27, 66, 48, 63,173,208,189, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 58,136, 51, 63, 90,150,169, 62, 27, 66, 48, 63,173,208,189, 62, - 26, 5, 45, 63,117,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 26, 5, 45, 63,117,190,166, 62,118, 17, 42, 63, 72,220,187, 62,107,102, 38, 63,201,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,255, 55, 48, 63, 94,152, 9, 63,237, 40, 45, 63,252, 29, 19, 63, -242,186, 41, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -242,186, 41, 63,112,150, 9, 63,215,204, 44, 63, 23,252,255, 62,255, 55, 48, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63, 51, 51, 63, 0, 0, 0, 63,255, 55, 48, 63, 94,152, 9, 63, -215,204, 44, 63, 23,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -215,204, 44, 63, 23,252,255, 62,242,186, 41, 63,112,150, 9, 63,109,102, 38, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,235, 17, 35, 63,112,150, 9, 63,109,102, 38, 63, 0, 0, 0, 63, -242,186, 41, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -242,186, 41, 63,112,150, 9, 63,113,102, 38, 63,219, 98, 19, 63,235, 17, 35, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,245,163, 31, 63,253, 29, 19, 63,235, 17, 35, 63,112,150, 9, 63, -113,102, 38, 63,219, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -113,102, 38, 63,219, 98, 19, 63,242,186, 41, 63,112,150, 9, 63,237, 40, 45, 63,252, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 38,235, 41, 63,141,140, 28, 63,117,102, 38, 63, 45,200, 37, 63, -192,225, 34, 63,142,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -192,225, 34, 63,142,140, 28, 63,113,102, 38, 63,219, 98, 19, 63, 38,235, 41, 63,141,140, 28, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 40, 45, 63,252, 29, 19, 63, 38,235, 41, 63,141,140, 28, 63, -113,102, 38, 63,219, 98, 19, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -113,102, 38, 63,219, 98, 19, 63,192,225, 34, 63,142,140, 28, 63,245,163, 31, 63,253, 29, 19, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,235, 17, 35, 63,112,150, 9, 63,245,163, 31, 63,253, 29, 19, 63, -223,148, 28, 63, 94,152, 9, 63, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -223,148, 28, 63, 94,152, 9, 63, 2, 0, 32, 63, 24,252,255, 62,235, 17, 35, 63,112,150, 9, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,109,102, 38, 63, 0, 0, 0, 63,235, 17, 35, 63,112,150, 9, 63, - 2, 0, 32, 63, 24,252,255, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 2, 0, 32, 63, 24,252,255, 62,223,148, 28, 63, 94,152, 9, 63,155,153, 25, 63, 0, 0, 0, 63, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188,129,107, 63, 66, 45,128, 62,235, 71, 99, 63,222, 76,120, 62, - 94, 37,106, 63, 84, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 94, 37,106, 63, 84, 97, 83, 62, 65, 51,115, 63,248,151, 97, 62,188,129,107, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63,151, 83,135, 62,188,129,107, 63, 66, 45,128, 62, - 65, 51,115, 63,248,151, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 51,115, 63,248,151, 97, 62, 94, 37,106, 63, 84, 97, 83, 62, 65, 51,115, 63, 90,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188,129,107, 63, 66, 45,128, 62, 65, 51,115, 63,151, 83,135, 62, -142,123,108, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -142,123,108, 63,169,144,151, 62,231, 50,101, 63, 17,201,146, 62,188,129,107, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,235, 71, 99, 63,222, 76,120, 62,188,129,107, 63, 66, 45,128, 62, -231, 50,101, 63, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -231, 50,101, 63, 17,201,146, 62,142,123,108, 63,169,144,151, 62,106,187,102, 63, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 71, 56, 96, 63, 99,190,166, 62,149,153, 89, 63,201,199,165, 62, - 22,238, 93, 63,243,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22,238, 93, 63,243,101,144, 62,231, 50,101, 63, 17,201,146, 62, 71, 56, 96, 63, 99,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,106,187,102, 63, 54,150,169, 62, 71, 56, 96, 63, 99,190,166, 62, -231, 50,101, 63, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -231, 50,101, 63, 17,201,146, 62, 22,238, 93, 63,243,101,144, 62,235, 71, 99, 63,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,249, 21,109, 63, 65, 54,174, 62,106,187,102, 63, 54,150,169, 62, -142,123,108, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -142,123,108, 63,169,144,151, 62, 65, 51,115, 63, 93,231,157, 62,249, 21,109, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63,160,111,180, 62,249, 21,109, 63, 65, 54,174, 62, - 65, 51,115, 63, 93,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 51,115, 63, 93,231,157, 62,142,123,108, 63,169,144,151, 62, 65, 51,115, 63,151, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,149,153, 89, 63, 79,162,115, 62,235, 71, 99, 63,222, 76,120, 62, - 22,238, 93, 63,243,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22,238, 93, 63,243,101,144, 62, 21, 69, 85, 63, 3,102,144, 62,149,153, 89, 63, 79,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68,235, 79, 63, 37, 77,120, 62,149,153, 89, 63, 79,162,115, 62, - 21, 69, 85, 63, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 69, 85, 63, 3,102,144, 62, 22,238, 93, 63,243,101,144, 62,149,153, 89, 63,201,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,149,153, 89, 63, 79,162,115, 62, 68,235, 79, 63, 37, 77,120, 62, - 24,186, 83, 63,245,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 24,186, 83, 63,245,176, 70, 62, 22,121, 95, 63,204,176, 70, 62,149,153, 89, 63, 79,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,235, 71, 99, 63,222, 76,120, 62,149,153, 89, 63, 79,162,115, 62, - 22,121, 95, 63,204,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22,121, 95, 63,204,176, 70, 62, 24,186, 83, 63,245,176, 70, 62,152,153, 89, 63,198, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 61,119,103, 63,179,253, 30, 62, 65, 51,115, 63, 90,111, 52, 62, - 94, 37,106, 63, 84, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 94, 37,106, 63, 84, 97, 83, 62, 22,121, 95, 63,204,176, 70, 62, 61,119,103, 63,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152,153, 89, 63,198, 31, 23, 62, 61,119,103, 63,179,253, 30, 62, - 22,121, 95, 63,204,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22,121, 95, 63,204,176, 70, 62, 94, 37,106, 63, 84, 97, 83, 62,235, 71, 99, 63,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,248,187, 75, 63,241,253, 30, 62,152,153, 89, 63,198, 31, 23, 62, - 24,186, 83, 63,245,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 24,186, 83, 63,245,176, 70, 62,214, 13, 73, 63,181, 97, 83, 62,248,187, 75, 63,241,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,202,111, 52, 62,248,187, 75, 63,241,253, 30, 62, -214, 13, 73, 63,181, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -214, 13, 73, 63,181, 97, 83, 62, 24,186, 83, 63,245,176, 70, 62, 68,235, 79, 63, 37, 77,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152,153, 89, 63,111, 41,147, 61, 0, 0, 64, 63,195,111,180, 61, - 0, 0, 64, 63,111, 65, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,111, 65, 52, 61, 38, 49,117, 63,225, 64, 52, 61,152,153, 89, 63,111, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63, 83,111,180, 61,152,153, 89, 63,111, 41,147, 61, - 38, 49,117, 63,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 38, 49,117, 63,225, 64, 52, 61, 0, 0, 64, 63,111, 65, 52, 61,208,222,121, 63,102, 9,239,178, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152,153, 89, 63,111, 41,147, 61, 65, 51,115, 63, 83,111,180, 61, -172, 51, 99, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -172, 51, 99, 63, 48, 46,231, 61,135,255, 79, 63,120, 46,231, 61,152,153, 89, 63,111, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,195,111,180, 61,152,153, 89, 63,111, 41,147, 61, -135,255, 79, 63,120, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -135,255, 79, 63,120, 46,231, 61,172, 51, 99, 63, 48, 46,231, 61,152,153, 89, 63,198, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,248,187, 75, 63,241,253, 30, 62, 0, 0, 64, 63,202,111, 52, 62, - 0, 0, 64, 63, 24, 71, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63, 24, 71, 7, 62,135,255, 79, 63,120, 46,231, 61,248,187, 75, 63,241,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,152,153, 89, 63,198, 31, 23, 62,248,187, 75, 63,241,253, 30, 62, -135,255, 79, 63,120, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -135,255, 79, 63,120, 46,231, 61, 0, 0, 64, 63, 24, 71, 7, 62, 0, 0, 64, 63,195,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 61,119,103, 63,179,253, 30, 62,152,153, 89, 63,198, 31, 23, 62, -172, 51, 99, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -172, 51, 99, 63, 48, 46,231, 61, 66, 51,115, 63,199, 70, 7, 62, 61,119,103, 63,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63, 90,111, 52, 62, 61,119,103, 63,179,253, 30, 62, - 66, 51,115, 63,199, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 66, 51,115, 63,199, 70, 7, 62,172, 51, 99, 63, 48, 46,231, 61, 65, 51,115, 63, 83,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,122,177, 71, 63,120, 45,128, 62, 0, 0, 64, 63,218, 83,135, 62, - 0, 0, 64, 63,115,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,115,152, 97, 62,214, 13, 73, 63,181, 97, 83, 62,122,177, 71, 63,120, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68,235, 79, 63, 37, 77,120, 62,122,177, 71, 63,120, 45,128, 62, -214, 13, 73, 63,181, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -214, 13, 73, 63,181, 97, 83, 62, 0, 0, 64, 63,115,152, 97, 62, 0, 0, 64, 63,202,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,122,177, 71, 63,120, 45,128, 62, 68,235, 79, 63, 37, 77,120, 62, - 72, 0, 78, 63, 52,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 72, 0, 78, 63, 52,201,146, 62,169,183, 70, 63,219,144,151, 62,122,177, 71, 63,120, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,218, 83,135, 62,122,177, 71, 63,120, 45,128, 62, -169,183, 70, 63,219,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169,183, 70, 63,219,144,151, 62, 72, 0, 78, 63, 52,201,146, 62,198,119, 76, 63, 90,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 61, 29, 70, 63,114, 54,174, 62, 0, 0, 64, 63,211,111,180, 62, - 0, 0, 64, 63,162,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,162,231,157, 62,169,183, 70, 63,219,144,151, 62, 61, 29, 70, 63,114, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198,119, 76, 63, 90,150,169, 62, 61, 29, 70, 63,114, 54,174, 62, -169,183, 70, 63,219,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -169,183, 70, 63,219,144,151, 62, 0, 0, 64, 63,162,231,157, 62, 0, 0, 64, 63,218, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,230,250, 82, 63,117,190,166, 62,198,119, 76, 63, 90,150,169, 62, - 72, 0, 78, 63, 52,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 72, 0, 78, 63, 52,201,146, 62, 21, 69, 85, 63, 3,102,144, 62,230,250, 82, 63,117,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,149,153, 89, 63,201,199,165, 62,230,250, 82, 63,117,190,166, 62, - 21, 69, 85, 63, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 69, 85, 63, 3,102,144, 62, 72, 0, 78, 63, 52,201,146, 62, 68,235, 79, 63, 37, 77,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,167,245, 61, 72, 45,128, 62, 94,217,179, 61,222, 76,120, 62, -202,196,234, 61,100, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -202,196,234, 61,100, 97, 83, 62,212,153, 25, 62, 2,152, 97, 62,179,167,245, 61, 72, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,156, 83,135, 62,179,167,245, 61, 72, 45,128, 62, -212,153, 25, 62, 2,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212,153, 25, 62, 2,152, 97, 62,202,196,234, 61,100, 97, 83, 62,214,153, 25, 62,106,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,179,167,245, 61, 72, 45,128, 62,214,153, 25, 62,156, 83,135, 62, - 62,118,253, 61,174,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 62,118,253, 61,174,144,151, 62, 53, 49,195, 61, 17,201,146, 62,179,167,245, 61, 72, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 94,217,179, 61,222, 76,120, 62,179,167,245, 61, 72, 45,128, 62, - 53, 49,195, 61, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 53, 49,195, 61, 17,201,146, 62, 62,118,253, 61,174,144,151, 62, 70,117,207, 61, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 79, 92,155, 61, 91,190,166, 62,194,205, 76, 61,186,199,165, 62, -212, 10,137, 61,238,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212, 10,137, 61,238,101,144, 62, 53, 49,195, 61, 17,201,146, 62, 79, 92,155, 61, 91,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 70,117,207, 61, 54,150,169, 62, 79, 92,155, 61, 91,190,166, 62, - 53, 49,195, 61, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 53, 49,195, 61, 17,201,146, 62,212, 10,137, 61,238,101,144, 62, 94,217,179, 61,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,204, 36, 1, 62, 70, 54,174, 62, 70,117,207, 61, 54,150,169, 62, - 62,118,253, 61,174,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 62,118,253, 61,174,144,151, 62,213,153, 25, 62,100,231,157, 62,204, 36, 1, 62, 70, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,165,111,180, 62,204, 36, 1, 62, 70, 54,174, 62, -213,153, 25, 62,100,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213,153, 25, 62,100,231,157, 62, 62,118,253, 61,174,144,151, 62,214,153, 25, 62,156, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188,205, 76, 61, 53,162,115, 62, 94,217,179, 61,222, 76,120, 62, -212, 10,137, 61,238,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212, 10,137, 61,238,101,144, 62,207,133, 7, 61,236,101,144, 62,188,205, 76, 61, 53,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,255,162, 71, 60,216, 76,120, 62,188,205, 76, 61, 53,162,115, 62, -207,133, 7, 61,236,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -207,133, 7, 61,236,101,144, 62,212, 10,137, 61,238,101,144, 62,194,205, 76, 61,186,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188,205, 76, 61, 53,162,115, 62,255,162, 71, 60,216, 76,120, 62, -190,171,221, 60,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -190,171,221, 60,194,176, 70, 62,194, 98,149, 61,194,176, 70, 62,188,205, 76, 61, 53,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 94,217,179, 61,222, 76,120, 62,188,205, 76, 61, 53,162,115, 62, -194, 98,149, 61,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194, 98,149, 61,194,176, 70, 62,190,171,221, 60,194,176, 70, 62,193,205, 76, 61,168, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198, 83,213, 61,179,253, 30, 62,214,153, 25, 62,106,111, 52, 62, -202,196,234, 61,100, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -202,196,234, 61,100, 97, 83, 62,194, 98,149, 61,194,176, 70, 62,198, 83,213, 61,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,193,205, 76, 61,168, 31, 23, 62,198, 83,213, 61,179,253, 30, 62, -194, 98,149, 61,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194, 98,149, 61,194,176, 70, 62,202,196,234, 61,100, 97, 83, 62, 94,217,179, 61,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 59,239,126, 63,174,253, 30, 62,154,105,131, 63,168, 31, 23, 62, -175,118,131, 63,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -175,118,131, 63,194,176, 70, 62, 30, 65,124, 63, 90, 97, 83, 62, 59,239,126, 63,174,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63, 90,111, 52, 62, 59,239,126, 63,174,253, 30, 62, - 30, 65,124, 63, 90, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 30, 65,124, 63, 90, 97, 83, 62,175,118,131, 63,194,176, 70, 62, 70,143,129, 63,216, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,156,105,131, 63,101, 41,147, 61, 65, 51,115, 63, 83,111,180, 61, - 38, 49,117, 63,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 38, 49,117, 63,225, 64, 52, 61,232,148,135, 63,144,158,125, 60,156,105,131, 63,101, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,153, 25, 62,104,111,180, 61,122,245,128, 61,101, 41,147, 61, -224,153, 25, 62,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -232,148,135, 63,144,158,125, 60, 38, 49,117, 63,225, 64, 52, 61,208,222,121, 63,102, 9,239,178, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,122,245,128, 61,101, 41,147, 61,215,153, 25, 62,104,111,180, 61, - 89, 55,179, 61, 38, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89, 55,179, 61, 38, 46,231, 61, 96,147,208, 60, 48, 46,231, 61,122,245,128, 61,101, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63, 83,111,180, 61,156,105,131, 63,101, 41,147, 61, -102,153,129, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 96,147,208, 60, 48, 46,231, 61, 89, 55,179, 61, 38, 46,231, 61,193,205, 76, 61,168, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 59,239,126, 63,174,253, 30, 62, 65, 51,115, 63, 90,111, 52, 62, - 66, 51,115, 63,199, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 66, 51,115, 63,199, 70, 7, 62,102,153,129, 63, 48, 46,231, 61, 59,239,126, 63,174,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,154,105,131, 63,168, 31, 23, 62, 59,239,126, 63,174,253, 30, 62, -102,153,129, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -102,153,129, 63, 48, 46,231, 61, 66, 51,115, 63,199, 70, 7, 62, 65, 51,115, 63, 83,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,198, 83,213, 61,179,253, 30, 62,193,205, 76, 61,168, 31, 23, 62, - 89, 55,179, 61, 38, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 89, 55,179, 61, 38, 46,231, 61,217,153, 25, 62,204, 70, 7, 62,198, 83,213, 61,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,106,111, 52, 62,198, 83,213, 61,179,253, 30, 62, -217,153, 25, 62,204, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -217,153, 25, 62,204, 70, 7, 62, 89, 55,179, 61, 38, 46,231, 61,215,153, 25, 62,104,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192,228,122, 63, 66, 45,128, 62, 65, 51,115, 63,151, 83,135, 62, - 65, 51,115, 63,248,151, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 51,115, 63,248,151, 97, 62, 30, 65,124, 63, 90, 97, 83, 62,192,228,122, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 70,143,129, 63,216, 76,120, 62,192,228,122, 63, 66, 45,128, 62, - 30, 65,124, 63, 90, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 30, 65,124, 63, 90, 97, 83, 62, 65, 51,115, 63,248,151, 97, 62, 65, 51,115, 63, 90,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192,228,122, 63, 66, 45,128, 62, 70,143,129, 63,216, 76,120, 62, -201,153,128, 63, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -201,153,128, 63, 14,201,146, 62,239,234,121, 63,169,144,151, 62,192,228,122, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 65, 51,115, 63,151, 83,135, 62,192,228,122, 63, 66, 45,128, 62, -239,234,121, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,234,121, 63,169,144,151, 62,201,153,128, 63, 14,201,146, 62, 15,171,127, 63, 52,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,133, 80,121, 63, 65, 54,174, 62, 65, 51,115, 63,160,111,180, 62, - 65, 51,115, 63, 93,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 65, 51,115, 63, 93,231,157, 62,239,234,121, 63,169,144,151, 62,133, 80,121, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 15,171,127, 63, 52,150,169, 62,133, 80,121, 63, 65, 54,174, 62, -239,234,121, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -239,234,121, 63,169,144,151, 62, 65, 51,115, 63, 93,231,157, 62, 65, 51,115, 63,151, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 23, 23,131, 63, 89,190,166, 62, 15,171,127, 63, 52,150,169, 62, -201,153,128, 63, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -136,200,153, 59, 14,201,146, 62,207,133, 7, 61,236,101,144, 62,195,197,197, 60, 89,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,194,205, 76, 61,186,199,165, 62,195,197,197, 60, 89,190,166, 62, -207,133, 7, 61,236,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -207,133, 7, 61,236,101,144, 62,136,200,153, 59, 14,201,146, 62,255,162, 71, 60,216, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 32,208,163, 62, 79, 45,128, 62,147, 92,147, 62,252, 76,120, 62, -102, 23,161, 62,115, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -102, 23,161, 62,115, 97, 83, 62, 22, 51,179, 62, 2,152, 97, 62, 32,208,163, 62, 79, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,156, 83,135, 62, 32,208,163, 62, 79, 45,128, 62, - 22, 51,179, 62, 2,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22, 51,179, 62, 2,152, 97, 62,102, 23,161, 62,115, 97, 83, 62, 21, 51,179, 62,101,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 32,208,163, 62, 79, 45,128, 62, 21, 51,179, 62,156, 83,135, 62, -194,195,165, 62,181,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194,195,165, 62,181,144,151, 62,134, 50,151, 62, 29,201,146, 62, 32,208,163, 62, 79, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147, 92,147, 62,252, 76,120, 62, 32,208,163, 62, 79, 45,128, 62, -134, 50,151, 62, 29,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -134, 50,151, 62, 29,201,146, 62,194,195,165, 62,181,144,151, 62,137, 67,154, 62, 70,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 82, 61,141, 62,112,190,166, 62, 0, 0,128, 62,206,199,165, 62, -247,168,136, 62, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -247,168,136, 62, 3,102,144, 62,134, 50,151, 62, 29,201,146, 62, 82, 61,141, 62,112,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,137, 67,154, 62, 70,150,169, 62, 82, 61,141, 62,112,190,166, 62, -134, 50,151, 62, 29,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -134, 50,151, 62, 29,201,146, 62,247,168,136, 62, 3,102,144, 62,147, 92,147, 62,252, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,150,248,166, 62, 78, 54,174, 62,137, 67,154, 62, 70,150,169, 62, -194,195,165, 62,181,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -194,195,165, 62,181,144,151, 62, 21, 51,179, 62, 98,231,157, 62,150,248,166, 62, 78, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,165,111,180, 62,150,248,166, 62, 78, 54,174, 62, - 21, 51,179, 62, 98,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 51,179, 62, 98,231,157, 62,194,195,165, 62,181,144,151, 62, 21, 51,179, 62,156, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 89,162,115, 62,147, 92,147, 62,252, 76,120, 62, -247,168,136, 62, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -247,168,136, 62, 3,102,144, 62, 18,174,110, 62, 3,102,144, 62, 0, 0,128, 62, 89,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,217, 70, 89, 62,252, 76,120, 62, 0, 0,128, 62, 89,162,115, 62, - 18,174,110, 62, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 18,174,110, 62, 3,102,144, 62,247,168,136, 62, 3,102,144, 62, 0, 0,128, 62,206,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62, 89,162,115, 62,217, 70, 89, 62,252, 76,120, 62, - 30,130,104, 62,230,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 30,130,104, 62,230,176, 70, 62,241,190,139, 62,230,176, 70, 62, 0, 0,128, 62, 89,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,147, 92,147, 62,252, 76,120, 62, 0, 0,128, 62, 89,162,115, 62, -241,190,139, 62,230,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -241,190,139, 62,230,176, 70, 62, 30,130,104, 62,230,176, 70, 62, 0, 0,128, 62,208, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 41,187,155, 62,205,253, 30, 62, 21, 51,179, 62,101,111, 52, 62, -102, 23,161, 62,115, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -102, 23,161, 62,115, 97, 83, 62,241,190,139, 62,230,176, 70, 62, 41,187,155, 62,205,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,208, 31, 23, 62, 41,187,155, 62,205,253, 30, 62, -241,190,139, 62,230,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -241,190,139, 62,230,176, 70, 62,102, 23,161, 62,115, 97, 83, 62,147, 92,147, 62,252, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,174,137, 72, 62,205,253, 30, 62, 0, 0,128, 62,208, 31, 23, 62, - 30,130,104, 62,230,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 30,130,104, 62,230,176, 70, 62, 51,209, 61, 62,115, 97, 83, 62,174,137, 72, 62,205,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,106,111, 52, 62,174,137, 72, 62,205,253, 30, 62, - 51,209, 61, 62,115, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 51,209, 61, 62,115, 97, 83, 62, 30,130,104, 62,230,176, 70, 62,217, 70, 89, 62,252, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,255,255,127, 62,141, 41,147, 61,215,153, 25, 62,104,111,180, 61, -224,153, 25, 62,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -224,153, 25, 62,225, 64, 52, 61, 15, 51,179, 62,225, 64, 52, 61,255,255,127, 62,141, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 20, 51,179, 62,104,111,180, 61,255,255,127, 62,141, 41,147, 61, - 15, 51,179, 62,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 15, 51,179, 62,225, 64, 52, 61,224,153, 25, 62,225, 64, 52, 61,144,175,161, 62,102, 9,239,178, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,255,255,127, 62,141, 41,147, 61, 20, 51,179, 62,104,111,180, 61, - 12, 52,147, 62,109, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 12, 52,147, 62,109, 46,231, 61,231,151, 89, 62,109, 46,231, 61,255,255,127, 62,141, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,215,153, 25, 62,104,111,180, 61,255,255,127, 62,141, 41,147, 61, -231,151, 89, 62,109, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -231,151, 89, 62,109, 46,231, 61, 12, 52,147, 62,109, 46,231, 61, 0, 0,128, 62,208, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,174,137, 72, 62,205,253, 30, 62,214,153, 25, 62,106,111, 52, 62, -217,153, 25, 62,204, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -217,153, 25, 62,204, 70, 7, 62,231,151, 89, 62,109, 46,231, 61,174,137, 72, 62,205,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,208, 31, 23, 62,174,137, 72, 62,205,253, 30, 62, -231,151, 89, 62,109, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -231,151, 89, 62,109, 46,231, 61,217,153, 25, 62,204, 70, 7, 62,215,153, 25, 62,104,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 41,187,155, 62,205,253, 30, 62, 0, 0,128, 62,208, 31, 23, 62, - 12, 52,147, 62,109, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 12, 52,147, 62,109, 46,231, 61, 19, 51,179, 62,204, 70, 7, 62, 41,187,155, 62,205,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,101,111, 52, 62, 41,187,155, 62,205,253, 30, 62, - 19, 51,179, 62,204, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 19, 51,179, 62,204, 70, 7, 62, 12, 52,147, 62,109, 46,231, 61, 20, 51,179, 62,104,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192, 95, 56, 62, 79, 45,128, 62,214,153, 25, 62,156, 83,135, 62, -212,153, 25, 62, 2,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -212,153, 25, 62, 2,152, 97, 62, 51,209, 61, 62,115, 97, 83, 62,192, 95, 56, 62, 79, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,217, 70, 89, 62,252, 76,120, 62,192, 95, 56, 62, 79, 45,128, 62, - 51,209, 61, 62,115, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 51,209, 61, 62,115, 97, 83, 62,212,153, 25, 62, 2,152, 97, 62,214,153, 25, 62,106,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,192, 95, 56, 62, 79, 45,128, 62,217, 70, 89, 62,252, 76,120, 62, -245,154, 81, 62, 29,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -245,154, 81, 62, 29,201,146, 62,125,120, 52, 62,181,144,151, 62,192, 95, 56, 62, 79, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,214,153, 25, 62,156, 83,135, 62,192, 95, 56, 62, 79, 45,128, 62, -125,120, 52, 62,181,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -125,120, 52, 62,181,144,151, 62,245,154, 81, 62, 29,201,146, 62,239,120, 75, 62, 70,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,213, 14, 50, 62, 78, 54,174, 62,214,153, 25, 62,165,111,180, 62, -213,153, 25, 62,100,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -213,153, 25, 62,100,231,157, 62,125,120, 52, 62,181,144,151, 62,213, 14, 50, 62, 78, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,239,120, 75, 62, 70,150,169, 62,213, 14, 50, 62, 78, 54,174, 62, -125,120, 52, 62,181,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -125,120, 52, 62,181,144,151, 62,213,153, 25, 62,100,231,157, 62,214,153, 25, 62,156, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 91,133,101, 62,112,190,166, 62,239,120, 75, 62, 70,150,169, 62, -245,154, 81, 62, 29,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -245,154, 81, 62, 29,201,146, 62, 18,174,110, 62, 3,102,144, 62, 91,133,101, 62,112,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0,128, 62,206,199,165, 62, 91,133,101, 62,112,190,166, 62, - 18,174,110, 62, 3,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 18,174,110, 62, 3,102,144, 62,245,154, 81, 62, 29,201,146, 62,217, 70, 89, 62,252, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64, 27, 5, 63, 66, 45,128, 62,232,194,249, 62,216, 76,120, 62, -226,190, 3, 63, 90, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -226,190, 3, 63, 90, 97, 83, 62,191,204, 12, 63,248,151, 97, 62, 64, 27, 5, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63,149, 83,135, 62, 64, 27, 5, 63, 66, 45,128, 62, -191,204, 12, 63,248,151, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63,248,151, 97, 62,226,190, 3, 63, 90, 97, 83, 62,191,204, 12, 63, 90,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 64, 27, 5, 63, 66, 45,128, 62,191,204, 12, 63,149, 83,135, 62, - 17, 21, 6, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 17, 21, 6, 63,169,144,151, 62,222,152,253, 62, 14,201,146, 62, 64, 27, 5, 63, 66, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,232,194,249, 62,216, 76,120, 62, 64, 27, 5, 63, 66, 45,128, 62, -222,152,253, 62, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -222,152,253, 62, 14,201,146, 62, 17, 21, 6, 63,169,144,151, 62,241, 84, 0, 63, 52,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,164,163,243, 62, 89,190,166, 62, 72,102,230, 62,183,199,165, 62, - 70, 15,239, 62,233,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 70, 15,239, 62,233,101,144, 62,222,152,253, 62, 14,201,146, 62,164,163,243, 62, 89,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,241, 84, 0, 63, 52,150,169, 62,164,163,243, 62, 89,190,166, 62, -222,152,253, 62, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -222,152,253, 62, 14,201,146, 62, 70, 15,239, 62,233,101,144, 62,232,194,249, 62,216, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,123,175, 6, 63, 65, 54,174, 62,241, 84, 0, 63, 52,150,169, 62, - 17, 21, 6, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 17, 21, 6, 63,169,144,151, 62,191,204, 12, 63, 90,231,157, 62,123,175, 6, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63,160,111,180, 62,123,175, 6, 63, 65, 54,174, 62, -191,204, 12, 63, 90,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63, 90,231,157, 62, 17, 21, 6, 63,169,144,151, 62,191,204, 12, 63,149, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62, 53,162,115, 62,232,194,249, 62,216, 76,120, 62, - 70, 15,239, 62,233,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 70, 15,239, 62,233,101,144, 62, 75,189,221, 62,238,101,144, 62, 72,102,230, 62, 53,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,168, 9,211, 62,222, 76,120, 62, 72,102,230, 62, 53,162,115, 62, - 75,189,221, 62,238,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 75,189,221, 62,238,101,144, 62, 70, 15,239, 62,233,101,144, 62, 72,102,230, 62,183,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62, 53,162,115, 62,168, 9,211, 62,222, 76,120, 62, - 80,167,218, 62,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80,167,218, 62,194,176, 70, 62, 68, 37,242, 62,194,176, 70, 62, 72,102,230, 62, 53,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,232,194,249, 62,216, 76,120, 62, 72,102,230, 62, 53,162,115, 62, - 68, 37,242, 62,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 68, 37,242, 62,194,176, 70, 62, 80,167,218, 62,194,176, 70, 62, 72,102,230, 62,168, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,197, 16, 1, 63,174,253, 30, 62,191,204, 12, 63, 90,111, 52, 62, -226,190, 3, 63, 90, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -226,190, 3, 63, 90, 97, 83, 62, 68, 37,242, 62,194,176, 70, 62,197, 16, 1, 63,174,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62,168, 31, 23, 62,197, 16, 1, 63,174,253, 30, 62, - 68, 37,242, 62,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 68, 37,242, 62,194,176, 70, 62,226,190, 3, 63, 90, 97, 83, 62,232,194,249, 62,216, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,171,202, 62,179,253, 30, 62, 72,102,230, 62,168, 31, 23, 62, - 80,167,218, 62,194,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 80,167,218, 62,194,176, 70, 62,205, 78,197, 62, 95, 97, 83, 62, 14,171,202, 62,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,101,111, 52, 62, 14,171,202, 62,179,253, 30, 62, -205, 78,197, 62, 95, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -205, 78,197, 62, 95, 97, 83, 62, 80,167,218, 62,194,176, 70, 62,168, 9,211, 62,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63,102,230, 62,101, 41,147, 61, 20, 51,179, 62,104,111,180, 61, - 15, 51,179, 62,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 15, 51,179, 62,225, 64, 52, 61,189,204, 12, 63,225, 64, 52, 61, 63,102,230, 62,101, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63, 83,111,180, 61, 63,102,230, 62,101, 41,147, 61, -189,204, 12, 63,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -189,204, 12, 63,225, 64, 52, 61, 15, 51,179, 62,225, 64, 52, 61,144,175,161, 62,102, 9,239,178, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 63,102,230, 62,101, 41,147, 61,191,204, 12, 63, 83,111,180, 61, -104,154,249, 62, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -104,154,249, 62, 48, 46,231, 61, 42, 50,211, 62, 48, 46,231, 61, 63,102,230, 62,101, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 20, 51,179, 62,104,111,180, 61, 63,102,230, 62,101, 41,147, 61, - 42, 50,211, 62, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42, 50,211, 62, 48, 46,231, 61,104,154,249, 62, 48, 46,231, 61, 72,102,230, 62,168, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 14,171,202, 62,179,253, 30, 62, 21, 51,179, 62,101,111, 52, 62, - 19, 51,179, 62,204, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 19, 51,179, 62,204, 70, 7, 62, 42, 50,211, 62, 48, 46,231, 61, 14,171,202, 62,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62,168, 31, 23, 62, 14,171,202, 62,179,253, 30, 62, - 42, 50,211, 62, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42, 50,211, 62, 48, 46,231, 61, 19, 51,179, 62,204, 70, 7, 62, 20, 51,179, 62,104,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,197, 16, 1, 63,174,253, 30, 62, 72,102,230, 62,168, 31, 23, 62, -104,154,249, 62, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -104,154,249, 62, 48, 46,231, 61,191,204, 12, 63,199, 70, 7, 62,197, 16, 1, 63,174,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63, 90,111, 52, 62,197, 16, 1, 63,174,253, 30, 62, -191,204, 12, 63,199, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63,199, 70, 7, 62,104,154,249, 62, 48, 46,231, 61,191,204, 12, 63, 83,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 19,150,194, 62, 72, 45,128, 62, 21, 51,179, 62,156, 83,135, 62, - 22, 51,179, 62, 2,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 22, 51,179, 62, 2,152, 97, 62,205, 78,197, 62, 95, 97, 83, 62, 19,150,194, 62, 72, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,168, 9,211, 62,222, 76,120, 62, 19,150,194, 62, 72, 45,128, 62, -205, 78,197, 62, 95, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -205, 78,197, 62, 95, 97, 83, 62, 22, 51,179, 62, 2,152, 97, 62, 21, 51,179, 62,101,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 19,150,194, 62, 72, 45,128, 62,168, 9,211, 62,222, 76,120, 62, -179, 51,207, 62, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -179, 51,207, 62, 17,201,146, 62,113,162,192, 62,174,144,151, 62, 19,150,194, 62, 72, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21, 51,179, 62,156, 83,135, 62, 19,150,194, 62, 72, 45,128, 62, -113,162,192, 62,174,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -113,162,192, 62,174,144,151, 62,179, 51,207, 62, 17,201,146, 62,175, 34,204, 62, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,154,109,191, 62, 68, 54,174, 62, 21, 51,179, 62,165,111,180, 62, - 21, 51,179, 62, 98,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 21, 51,179, 62, 98,231,157, 62,113,162,192, 62,174,144,151, 62,154,109,191, 62, 68, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,175, 34,204, 62, 54,150,169, 62,154,109,191, 62, 68, 54,174, 62, -113,162,192, 62,174,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -113,162,192, 62,174,144,151, 62, 21, 51,179, 62, 98,231,157, 62, 21, 51,179, 62,156, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,237, 40,217, 62, 91,190,166, 62,175, 34,204, 62, 54,150,169, 62, -179, 51,207, 62, 17,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -179, 51,207, 62, 17,201,146, 62, 75,189,221, 62,238,101,144, 62,237, 40,217, 62, 91,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 72,102,230, 62,183,199,165, 62,237, 40,217, 62, 91,190,166, 62, - 75,189,221, 62,238,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 75,189,221, 62,238,101,144, 62,179, 51,207, 62, 17,201,146, 62,168, 9,211, 62,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,134, 78, 56, 63,117, 45,128, 62,188, 20, 48, 63, 37, 77,120, 62, - 42,242, 54, 63,181, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42,242, 54, 63,181, 97, 83, 62, 0, 0, 64, 63,115,152, 97, 62,134, 78, 56, 63,117, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,218, 83,135, 62,134, 78, 56, 63,117, 45,128, 62, - 0, 0, 64, 63,115,152, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,115,152, 97, 62, 42,242, 54, 63,181, 97, 83, 62, 0, 0, 64, 63,202,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,134, 78, 56, 63,117, 45,128, 62, 0, 0, 64, 63,218, 83,135, 62, - 87, 72, 57, 63,219,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87, 72, 57, 63,219,144,151, 62,184,255, 49, 63, 52,201,146, 62,134, 78, 56, 63,117, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188, 20, 48, 63, 37, 77,120, 62,134, 78, 56, 63,117, 45,128, 62, -184,255, 49, 63, 52,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -184,255, 49, 63, 52,201,146, 62, 87, 72, 57, 63,219,144,151, 62, 58,136, 51, 63, 90,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 26, 5, 45, 63,117,190,166, 62,107,102, 38, 63,201,199,165, 62, -235,186, 42, 63, 5,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -235,186, 42, 63, 5,102,144, 62,184,255, 49, 63, 52,201,146, 62, 26, 5, 45, 63,117,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 58,136, 51, 63, 90,150,169, 62, 26, 5, 45, 63,117,190,166, 62, -184,255, 49, 63, 52,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -184,255, 49, 63, 52,201,146, 62,235,186, 42, 63, 5,102,144, 62,188, 20, 48, 63, 37, 77,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,196,226, 57, 63,114, 54,174, 62, 58,136, 51, 63, 90,150,169, 62, - 87, 72, 57, 63,219,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 87, 72, 57, 63,219,144,151, 62, 0, 0, 64, 63,162,231,157, 62,196,226, 57, 63,114, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,211,111,180, 62,196,226, 57, 63,114, 54,174, 62, - 0, 0, 64, 63,162,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,162,231,157, 62, 87, 72, 57, 63,219,144,151, 62, 0, 0, 64, 63,218, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,107,102, 38, 63, 79,162,115, 62,188, 20, 48, 63, 37, 77,120, 62, -235,186, 42, 63, 5,102,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -235,186, 42, 63, 5,102,144, 62,234, 17, 34, 63,243,101,144, 62,107,102, 38, 63, 79,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,184, 28, 63,222, 76,120, 62,107,102, 38, 63, 79,162,115, 62, -234, 17, 34, 63,243,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -234, 17, 34, 63,243,101,144, 62,235,186, 42, 63, 5,102,144, 62,107,102, 38, 63,201,199,165, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,107,102, 38, 63, 79,162,115, 62, 21,184, 28, 63,222, 76,120, 62, -234,134, 32, 63,204,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -234,134, 32, 63,204,176, 70, 62,233, 69, 44, 63,245,176, 70, 62,107,102, 38, 63, 79,162,115, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,188, 20, 48, 63, 37, 77,120, 62,107,102, 38, 63, 79,162,115, 62, -233, 69, 44, 63,245,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -233, 69, 44, 63,245,176, 70, 62,234,134, 32, 63,204,176, 70, 62,104,102, 38, 63,198, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 9, 68, 52, 63,241,253, 30, 62, 0, 0, 64, 63,202,111, 52, 62, - 42,242, 54, 63,181, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 42,242, 54, 63,181, 97, 83, 62,233, 69, 44, 63,245,176, 70, 62, 9, 68, 52, 63,241,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,104,102, 38, 63,198, 31, 23, 62, 9, 68, 52, 63,241,253, 30, 62, -233, 69, 44, 63,245,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -233, 69, 44, 63,245,176, 70, 62, 42,242, 54, 63,181, 97, 83, 62,188, 20, 48, 63, 37, 77,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,195,136, 24, 63,179,253, 30, 62,104,102, 38, 63,198, 31, 23, 62, -234,134, 32, 63,204,176, 70, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -234,134, 32, 63,204,176, 70, 62,162,218, 21, 63, 84, 97, 83, 62,195,136, 24, 63,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63, 90,111, 52, 62,195,136, 24, 63,179,253, 30, 62, -162,218, 21, 63, 84, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -162,218, 21, 63, 84, 97, 83, 62,234,134, 32, 63,204,176, 70, 62, 21,184, 28, 63,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,104,102, 38, 63,111, 41,147, 61,191,204, 12, 63, 83,111,180, 61, -189,204, 12, 63,225, 64, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -189,204, 12, 63,225, 64, 52, 61, 0, 0, 64, 63,111, 65, 52, 61,104,102, 38, 63,111, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,195,111,180, 61,104,102, 38, 63,111, 41,147, 61, - 0, 0, 64, 63,111, 65, 52, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63,111, 65, 52, 61,189,204, 12, 63,225, 64, 52, 61,208,222,121, 63,102, 9,239,178, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,104,102, 38, 63,111, 41,147, 61, 0, 0, 64, 63,195,111,180, 61, -122, 0, 48, 63,120, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -122, 0, 48, 63,120, 46,231, 61, 85,204, 28, 63, 48, 46,231, 61,104,102, 38, 63,111, 41,147, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63, 83,111,180, 61,104,102, 38, 63,111, 41,147, 61, - 85,204, 28, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 85,204, 28, 63, 48, 46,231, 61,122, 0, 48, 63,120, 46,231, 61,104,102, 38, 63,198, 31, 23, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,195,136, 24, 63,179,253, 30, 62,191,204, 12, 63, 90,111, 52, 62, -191,204, 12, 63,199, 70, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63,199, 70, 7, 62, 85,204, 28, 63, 48, 46,231, 61,195,136, 24, 63,179,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,104,102, 38, 63,198, 31, 23, 62,195,136, 24, 63,179,253, 30, 62, - 85,204, 28, 63, 48, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 85,204, 28, 63, 48, 46,231, 61,191,204, 12, 63,199, 70, 7, 62,191,204, 12, 63, 83,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 9, 68, 52, 63,241,253, 30, 62,104,102, 38, 63,198, 31, 23, 62, -122, 0, 48, 63,120, 46,231, 61, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -122, 0, 48, 63,120, 46,231, 61, 0, 0, 64, 63, 24, 71, 7, 62, 9, 68, 52, 63,241,253, 30, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 64, 63,202,111, 52, 62, 9, 68, 52, 63,241,253, 30, 62, - 0, 0, 64, 63, 24, 71, 7, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 64, 63, 24, 71, 7, 62,122, 0, 48, 63,120, 46,231, 61, 0, 0, 64, 63,195,111,180, 61, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68,126, 20, 63, 64, 45,128, 62,191,204, 12, 63,149, 83,135, 62, -191,204, 12, 63,248,151, 97, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63,248,151, 97, 62,162,218, 21, 63, 84, 97, 83, 62, 68,126, 20, 63, 64, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 21,184, 28, 63,222, 76,120, 62, 68,126, 20, 63, 64, 45,128, 62, -162,218, 21, 63, 84, 97, 83, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -162,218, 21, 63, 84, 97, 83, 62,191,204, 12, 63,248,151, 97, 62,191,204, 12, 63, 90,111, 52, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68,126, 20, 63, 64, 45,128, 62, 21,184, 28, 63,222, 76,120, 62, - 25,205, 26, 63, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 25,205, 26, 63, 14,201,146, 62,114,132, 19, 63,169,144,151, 62, 68,126, 20, 63, 64, 45,128, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,191,204, 12, 63,149, 83,135, 62, 68,126, 20, 63, 64, 45,128, 62, -114,132, 19, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -114,132, 19, 63,169,144,151, 62, 25,205, 26, 63, 14,201,146, 62,150, 68, 25, 63, 54,150,169, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 7,234, 18, 63, 65, 54,174, 62,191,204, 12, 63,160,111,180, 62, -191,204, 12, 63, 90,231,157, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -191,204, 12, 63, 90,231,157, 62,114,132, 19, 63,169,144,151, 62, 7,234, 18, 63, 65, 54,174, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,150, 68, 25, 63, 54,150,169, 62, 7,234, 18, 63, 65, 54,174, 62, -114,132, 19, 63,169,144,151, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -114,132, 19, 63,169,144,151, 62,191,204, 12, 63, 90,231,157, 62,191,204, 12, 63,149, 83,135, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,185,199, 31, 63, 96,190,166, 62,150, 68, 25, 63, 54,150,169, 62, - 25,205, 26, 63, 14,201,146, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 25,205, 26, 63, 14,201,146, 62,234, 17, 34, 63,243,101,144, 62,185,199, 31, 63, 96,190,166, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0,107,102, 38, 63,201,199,165, 62,185,199, 31, 63, 96,190,166, 62, -234, 17, 34, 63,243,101,144, 62, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -234, 17, 34, 63,243,101,144, 62, 25,205, 26, 63, 14,201,146, 62, 21,184, 28, 63,222, 76,120, 62, 0, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, 0, 80, 0, 0,240,177,120, 1, 0, 0, 0, 0, - 57, 0, 0, 0, 0, 20, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0,192, 66,122, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, - 16, 76,122, 1, 0, 0, 0, 0,128,202,118, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 69,112,114,101,118,105,101,119, 46, 48, 48, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,112,248,117, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 75,122, 1, 0, 0, 0, 0, 32, 74,122, 1, 0, 0, 0, 0, -128, 74,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70,122, 1, 0, 0, 0, 0, 48, 72,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,240, 74,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128, 68,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, -176, 70,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,160, 72,122, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,128,179, 0, 0, 64, 52,235, 92,142,188, 0, 0,128, 63, 2, 0,128, 63,235, 92,142, 60, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, -192, 75,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, -128, 68,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 70,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,100, 0, 0, 0, 0, 70,122, 1, 0, 0, 0, 0, - 56, 0, 0, 0, 5, 0, 0, 0, 0, 0,128, 63,255,255,127, 63,255,255,251, 39, 0, 0, 0, 0,255,127, 2,255, 0, 0,128, 63, - 0, 0,128,191, 0, 0, 2,168, 0, 0, 0, 0,255,127, 2,255, 1, 0,128,191,253,255,127,191,253,255,251,167, 0, 0, 0, 0, -255,127, 2,255,250,255,127,191, 3, 0,128, 63, 3, 0, 2, 40, 0, 0, 0, 0,255,127, 2,255, 0,239,110, 59,131,164, 26, 60, -235, 92, 14,189,228, 12, 95, 33, 28,133, 3,255, 68, 65, 84, 65, 64, 1, 0, 0,176, 70,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 72,122, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 48, 72,122, 1, 0, 0, 0, 0, 53, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 34, 0, - 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 34, 0, 68, 65, 84, 65, 64, 1, 0, 0,160, 72,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, - 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 74,122, 1, - 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101, -120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 74,122, 1, - 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,240, 74,122, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 32, 74,122, 1, 0, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,128, 74,122, 1, 0, 0, 0, 0, - 60, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, 16, 0, 0, 0, -240, 74,122, 1, 0, 0, 0, 0, 57, 0, 0, 0, 4, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 77, 69, 0, 0,120, 1, 0, 0, 16, 76,122, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, 64, 85,122, 1, 0, 0, 0, 0, -192, 66,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114,101,118,105,101, -119, 46, 48, 48, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,240, 84,122, 1, 0, 0, 0, 0, 80, 83,122, 1, 0, 0, 0, 0,176, 83,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 79,122, 1, 0, 0, 0, 0, 96, 81,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 84,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -208, 77,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0,224, 79,122, 1, 0, 0, 0, 0, - 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,208, 81,122, 1, 0, 0, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, - 80, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0,128,179, 0, 0, 64, 52, 0, 0,192, 28, 0, 0,128, 63, 2, 0,128, 63,172,197, 39, 55, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0,240, 84,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0,112,114,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0,208, 77,122, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 79,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0, 80, 79,122, 1, 0, 0, 0, 0, 56, 0, 0, 0, 4, 0, 0, 0, - 0, 0,128, 63,255,255,127, 63,255,255,251, 39, 0, 0, 0, 0,255,127, 3,255, 0, 0,128, 63, 0, 0,128,191, 0, 0, 2,168, - 0, 0, 0, 0,255,127, 3,255, 1, 0,128,191,253,255,127,191,253,255,251,167, 0, 0, 0, 0,255,127, 3,255,250,255,127,191, - 3, 0,128, 63, 3, 0, 2, 40, 0, 0, 0, 0,255,127, 3,255, 68, 65, 84, 65, 64, 1, 0, 0,224, 79,122, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96, 81,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0, 96, 81,122, 1, 0, 0, 0, 0, 53, 0, 0, 0, 4, 0, 0, 0, - 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0,208, 81,122, 1, 0, 0, 0, 0, - 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 83,122, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -176, 83,122, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 84,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0, 80, 83,122, 1, 0, 0, 0, 0, 52, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65, 48, 0, 0, 0,176, 83,122, 1, - 0, 0, 0, 0, 60, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, - 16, 0, 0, 0, 32, 84,122, 1, 0, 0, 0, 0, 57, 0, 0, 0, 4, 0, 0, 0,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0, 64, 85,122, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0,112, 94,122, 1, - 0, 0, 0, 0, 16, 76,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 69,112,114, -101,118,105,101,119, 46, 48, 48, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 94,122, 1, 0, 0, 0, 0,128, 92,122, 1, 0, 0, 0, 0,224, 92,122, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 88,122, 1, 0, 0, 0, 0,144, 90,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80, 93,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 87,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 16, 89,122, 1, - 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 91,122, 1, 0, 0, 0, 0, 3, 0, 0, 0, - 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0,128,179, 0, 0, 64, 52, 0, 0,192, 28, 0, 0,128, 63, 2, 0,128, 63,172,197, 39, 55, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, 32, 94,122, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 96,121,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, 0, 87,122, 1, - 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128, 88,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 80, 0, 0, 0,128, 88,122, 1, 0, 0, 0, 0, 56, 0, 0, 0, - 4, 0, 0, 0, 0, 0,128, 63,255,255,127, 63,255,255,251, 39, 0, 0, 0, 0,255,127, 3,255, 0, 0,128, 63, 0, 0,128,191, - 0, 0, 2,168, 0, 0, 0, 0,255,127, 3,255, 1, 0,128,191,253,255,127,191,253,255,251,167, 0, 0, 0, 0,255,127, 3,255, -250,255,127,191, 3, 0,128, 63, 3, 0, 2, 40, 0, 0, 0, 0,255,127, 3,255, 68, 65, 84, 65, 64, 1, 0, 0, 16, 89,122, 1, - 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,144, 90,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 48, 0, 0, 0,144, 90,122, 1, 0, 0, 0, 0, 53, 0, 0, 0, - 4, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0, 0, 91,122, 1, - 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,128, 92,122, 1, 0, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0,224, 92,122, 1, 0, 0, 0, 0, 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 80, 93,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 20, 0, 0, 0,128, 92,122, 1, 0, 0, 0, 0, 52, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65, 48, 0, 0, 0, -224, 92,122, 1, 0, 0, 0, 0, 60, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 68, 65, 84, 65, 16, 0, 0, 0, 80, 93,122, 1, 0, 0, 0, 0, 57, 0, 0, 0, 4, 0, 0, 0,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255, 77, 69, 0, 0,120, 1, 0, 0,112, 94,122, 1, 0, 0, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 85,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 69, 67,117, 98,101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,224,106,122, 1, 0, 0, 0, 0, 96,102,122, 1, 0, 0, 0, 0, - 32,103,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,176, 97,122, 1, 0, 0, 0, 0, 16,100,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,128,104,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 48, 96,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, -144, 98,122, 1, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,224,100,122, 1, 0, 0, 0, 0, - 3, 0, 0, 0, 5, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,128, 51, 0, 0, 0,180, 0, 0, 0, 0, 4, 0,128, 63, 4, 0,128, 63, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65, 8, 0, 0, 0, -224,106,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,128,107,116, 1, 0, 0, 0, 0, 68, 65, 84, 65, 64, 1, 0, 0, - 48, 96,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0,176, 97,122, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 65, 84, 65,160, 0, 0, 0,176, 97,122, 1, 0, 0, 0, 0, - 56, 0, 0, 0, 8, 0, 0, 0, 0, 0,128, 63,255,255,127, 63, 0, 0,128,191,230, 73,230, 73, 26,182, 3,255, 0, 0,128, 63, - 0, 0,128,191, 0, 0,128,191,230, 73, 26,182, 26,182, 3,255, 1, 0,128,191,253,255,127,191, 0, 0,128,191, 26,182, 26,182, - 26,182, 3,255,250,255,127,191, 3, 0,128, 63, 0, 0,128,191, 26,182,230, 73, 26,182, 3,255, 4, 0,128, 63,247,255,127, 63, - 0, 0,128, 63,230, 73,230, 73,230, 73, 3,255,245,255,127, 63, 5, 0,128,191, 0, 0,128, 63,230, 73, 26,182,230, 73, 3,255, - 3, 0,128,191,250,255,127,191, 0, 0,128, 63, 26,182, 26,182,230, 73, 3,255,255,255,127,191, 0, 0,128, 63, 0, 0,128, 63, - 26,182,230, 73,230, 73, 3,255, 68, 65, 84, 65, 64, 1, 0, 0,144, 98,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,100,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,144, 0, 0, 0, 16,100,122, 1, 0, 0, 0, 0, 53, 0, 0, 0, 12, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 5, 0, 0, 0, 0, 0, 35, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, - 6, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 4, 0, 0, 0, 7, 0, 0, 0, 0, 0, 35, 0, 1, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 35, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 35, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 3, 0, 0, 0, - 7, 0, 0, 0, 0, 0, 35, 0, 68, 65, 84, 65, 64, 1, 0, 0,224,100,122, 1, 0, 0, 0, 0, 5, 1, 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96,102,122, 1, 0, 0, 0, 0, - 5, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 84,101,120, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32,103,122, 1, 0, 0, 0, 0, - 6, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67,111,108, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,104,122, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 65, 84, 65,120, 0, 0, 0, 96,102,122, 1, 0, 0, 0, 0, 52, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, - 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 2, - 0, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, - 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, - 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 2, 68, 65, 84, 65, 32, 1, 0, 0, 32,103,122, 1, 0, 0, 0, 0, - 60, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, 0, 0, 68, 65, 84, 65, 96, 0, 0, 0,128,104,122, 1, 0, 0, 0, 0, 57, 0, 0, 0, 24, 0, 0, 0, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, -255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, - 80, 65, 0, 0,232, 1, 0, 0,176,221,117, 1, 0, 0, 0, 0, 11, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 65, 80, 83,121,115, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 4, 0, 6, 0, 8, 0, - 5, 0, 5, 0, 3, 0,100, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 4, 0, 5, 0, 3, 0, 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0,200, 66, 0, 0, 72, 66, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 63,150, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0,128, 41,182, 63, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0,128, 63, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63,240,214, 35,189, 0, 0, 0, 0,184,155,196,189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0,205,204, 76, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,205,204, 76, 62, 0, 0, 0, 64, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 63, - 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0,128, 63,205,204, 76, 62,154,153,153, 62, 0, 0,128, 63, - 0, 0,128, 63, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 63, - 0, 0, 0, 63, 0, 0, 0, 63, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 78, 65, 49, 80,145, 0, 0,192, 43,191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 83, 68, 78, 65, 78, 65, 77, 69, - 19, 8, 0, 0, 42,110,101,120,116, 0, 42,112,114,101,118, 0, 42,102,105,114,115,116, 0, 42,108, 97,115,116, 0,120, 0,121, - 0,122, 0,119, 0,120,109,105,110, 0,120,109, 97,120, 0,121,109,105,110, 0,121,109, 97,120, 0, 42,112,111,105,110,116,101, -114, 0,103,114,111,117,112, 0,118, 97,108, 0,112, 97,100, 0,110, 97,109,101, 91, 51, 50, 93, 0,116,121,112,101, 0,115,117, - 98,116,121,112,101, 0,102,108, 97,103, 0,115, 97,118,101,100, 0,100, 97,116, 97, 0,108,101,110, 0,116,111,116, 97,108,108, -101,110, 0, 42,110,101,119,105,100, 0, 42,108,105, 98, 0,110, 97,109,101, 91, 50, 52, 93, 0,117,115, 0,105, 99,111,110, 95, -105,100, 0, 42,112,114,111,112,101,114,116,105,101,115, 0,105,100, 0, 42,105,100, 98,108,111, 99,107, 0, 42,102,105,108,101, -100, 97,116, 97, 0,110, 97,109,101, 91, 50, 52, 48, 93, 0,102,105,108,101,110, 97,109,101, 91, 50, 52, 48, 93, 0,116,111,116, - 0, 42,112, 97,114,101,110,116, 0,119, 91, 50, 93, 0,104, 91, 50, 93, 0, 99,104, 97,110,103,101,100, 91, 50, 93, 0,112, 97, -100, 48, 0,112, 97,100, 49, 0, 42,114,101, 99,116, 91, 50, 93, 0, 99,117,114,118,101, 0, 99,117,114, 0, 98,108,111, 99,107, -116,121,112,101, 0,115,104,111,119,107,101,121, 0,109,117,116,101,105,112,111, 0,112,111,115, 0, 99,117,114,118, 97,108, 0, - 97,100,114, 99,111,100,101, 0,114,101,108, 97,116,105,118,101, 0,116,111,116,101,108,101,109, 0,112, 97,100, 50, 0, 42,100, - 97,116, 97, 0, 42,119,101,105,103,104,116,115, 0,118,103,114,111,117,112, 91, 51, 50, 93, 0,115,108,105,100,101,114,109,105, -110, 0,115,108,105,100,101,114,109, 97,120, 0, 42,114,101,102,107,101,121, 0,101,108,101,109,115,116,114, 91, 51, 50, 93, 0, -101,108,101,109,115,105,122,101, 0, 98,108,111, 99,107, 0, 42,105,112,111, 0, 42,102,114,111,109, 0,116,111,116,107,101,121, - 0,115,108,117,114,112,104, 0, 42, 42,115, 99,114,105,112,116,115, 0, 42,102,108, 97,103, 0, 97, 99,116,115, 99,114,105,112, -116, 0,116,111,116,115, 99,114,105,112,116, 0, 42,108,105,110,101, 0, 42,102,111,114,109, 97,116, 0, 98,108,101,110, 0, 42, -110, 97,109,101, 0,102,108, 97,103,115, 0,110,108,105,110,101,115, 0,108,105,110,101,115, 0, 42, 99,117,114,108, 0, 42,115, -101,108,108, 0, 99,117,114, 99, 0,115,101,108, 99, 0, 42,117,110,100,111, 95, 98,117,102, 0,117,110,100,111, 95,112,111,115, - 0,117,110,100,111, 95,108,101,110, 0, 42, 99,111,109,112,105,108,101,100, 0,115,105,122,101, 0,115,101,101,107, 0,112, 97, -115,115,101,112, 97,114,116, 97,108,112,104, 97, 0, 97,110,103,108,101, 0, 99,108,105,112,115,116, 97, 0, 99,108,105,112,101, -110,100, 0,108,101,110,115, 0,111,114,116,104,111, 95,115, 99, 97,108,101, 0,100,114, 97,119,115,105,122,101, 0,115,104,105, -102,116,120, 0,115,104,105,102,116,121, 0, 89, 70, 95,100,111,102,100,105,115,116, 0, 89, 70, 95, 97,112,101,114,116,117,114, -101, 0, 89, 70, 95, 98,107,104,116,121,112,101, 0, 89, 70, 95, 98,107,104, 98,105, 97,115, 0, 89, 70, 95, 98,107,104,114,111, -116, 0,115, 99,114,105,112,116,108,105,110,107, 0, 42,100,111,102, 95,111, 98, 0,102,114, 97,109,101,110,114, 0,102,114, 97, -109,101,115, 0,111,102,102,115,101,116, 0,115,102,114, 97, 0,102,105,101, 95,105,109, 97, 0, 99,121, 99,108, 0,111,107, 0, -109,117,108,116,105, 95,105,110,100,101,120, 0,108, 97,121,101,114, 0,112, 97,115,115, 0,109,101,110,117,110,114, 0,105, 98, -117,102,115, 0, 42, 97,110,105,109, 0, 42,114,114, 0,115,111,117,114, 99,101, 0,108, 97,115,116,102,114, 97,109,101, 0,116, -112, 97,103,101,102,108, 97,103, 0,116,111,116, 98,105,110,100, 0,120,114,101,112, 0,121,114,101,112, 0,116,119,115,116, 97, - 0,116,119,101,110,100, 0, 98,105,110,100, 99,111,100,101, 0, 42,114,101,112, 98,105,110,100, 0, 42,112, 97, 99,107,101,100, -102,105,108,101, 0, 42,112,114,101,118,105,101,119, 0,108, 97,115,116,117,112,100, 97,116,101, 0,108, 97,115,116,117,115,101, -100, 0, 97,110,105,109,115,112,101,101,100, 0,103,101,110, 95,120, 0,103,101,110, 95,121, 0,103,101,110, 95,116,121,112,101, - 0, 97,115,112,120, 0, 97,115,112,121, 0, 42,118,110,111,100,101, 0,116,101,120, 99,111, 0,109, 97,112,116,111, 0,109, 97, -112,116,111,110,101,103, 0, 98,108,101,110,100,116,121,112,101, 0, 42,111, 98,106,101, 99,116, 0, 42,116,101,120, 0,117,118, -110, 97,109,101, 91, 51, 50, 93, 0,112,114,111,106,120, 0,112,114,111,106,121, 0,112,114,111,106,122, 0,109, 97,112,112,105, -110,103, 0,111,102,115, 91, 51, 93, 0,115,105,122,101, 91, 51, 93, 0,116,101,120,102,108, 97,103, 0, 99,111,108,111,114,109, -111,100,101,108, 0,112,109, 97,112,116,111, 0,112,109, 97,112,116,111,110,101,103, 0,114, 0,103, 0, 98, 0,107, 0,100,101, -102, 95,118, 97,114, 0,114,116, 0, 99,111,108,102, 97, 99, 0,110,111,114,102, 97, 99, 0,118, 97,114,102, 97, 99, 0,100,105, -115,112,102, 97, 99, 0,119, 97,114,112,102, 97, 99, 0,110, 97,109,101, 91, 49, 54, 48, 93, 0, 42,104, 97,110,100,108,101, 0, - 42,112,110, 97,109,101, 0, 42,115,116,110, 97,109,101,115, 0,115,116,121,112,101,115, 0,118, 97,114,115, 0, 42,118, 97,114, -115,116,114, 0, 42,114,101,115,117,108,116, 0, 42, 99,102,114, 97, 0,100, 97,116, 97, 91, 51, 50, 93, 0, 40, 42,100,111,105, -116, 41, 40, 41, 0, 40, 42,105,110,115,116, 97,110, 99,101, 95,105,110,105,116, 41, 40, 41, 0, 40, 42, 99, 97,108,108, 98, 97, - 99,107, 41, 40, 41, 0,118,101,114,115,105,111,110, 0, 97, 0,105,112,111,116,121,112,101, 0, 42,105,109, 97, 0, 42, 99,117, - 98,101, 91, 54, 93, 0,105,109, 97,116, 91, 52, 93, 91, 52, 93, 0,111, 98,105,109, 97,116, 91, 51, 93, 91, 51, 93, 0,115,116, -121,112,101, 0,118,105,101,119,115, 99, 97,108,101, 0,110,111,116,108, 97,121, 0, 99,117, 98,101,114,101,115, 0,100,101,112, -116,104, 0,114,101, 99, 97,108, 99, 0,108, 97,115,116,115,105,122,101, 0,110,111,105,115,101,115,105,122,101, 0,116,117,114, - 98,117,108, 0, 98,114,105,103,104,116, 0, 99,111,110,116,114, 97,115,116, 0,114,102, 97, 99, 0,103,102, 97, 99, 0, 98,102, - 97, 99, 0,102,105,108,116,101,114,115,105,122,101, 0,109,103, 95, 72, 0,109,103, 95,108, 97, 99,117,110, 97,114,105,116,121, - 0,109,103, 95,111, 99,116, 97,118,101,115, 0,109,103, 95,111,102,102,115,101,116, 0,109,103, 95,103, 97,105,110, 0,100,105, -115,116, 95, 97,109,111,117,110,116, 0,110,115, 95,111,117,116,115, 99, 97,108,101, 0,118,110, 95,119, 49, 0,118,110, 95,119, - 50, 0,118,110, 95,119, 51, 0,118,110, 95,119, 52, 0,118,110, 95,109,101,120,112, 0,118,110, 95,100,105,115,116,109, 0,118, -110, 95, 99,111,108,116,121,112,101, 0,110,111,105,115,101,100,101,112,116,104, 0,110,111,105,115,101,116,121,112,101, 0,110, -111,105,115,101, 98, 97,115,105,115, 0,110,111,105,115,101, 98, 97,115,105,115, 50, 0,105,109, 97,102,108, 97,103, 0, 99,114, -111,112,120,109,105,110, 0, 99,114,111,112,121,109,105,110, 0, 99,114,111,112,120,109, 97,120, 0, 99,114,111,112,121,109, 97, -120, 0,120,114,101,112,101, 97,116, 0,121,114,101,112,101, 97,116, 0,101,120,116,101,110,100, 0, 99,104,101, 99,107,101,114, -100,105,115,116, 0,110, 97, 98,108, 97, 0,105,117,115,101,114, 0, 42,112,108,117,103,105,110, 0, 42, 99,111, 98, 97, 0, 42, -101,110,118, 0,108,111, 99, 91, 51, 93, 0,114,111,116, 91, 51, 93, 0,109, 97,116, 91, 52, 93, 91, 52, 93, 0,109,105,110, 91, - 51, 93, 0,109, 97,120, 91, 51, 93, 0, 42,111, 98, 0,109,111,100,101, 0,116,111,116,101,120, 0,101,110,101,114,103,121, 0, -100,105,115,116, 0,115,112,111,116,115,105,122,101, 0,115,112,111,116, 98,108,101,110,100, 0,104, 97,105,110,116, 0, 97,116, -116, 49, 0, 97,116,116, 50, 0, 42, 99,117,114,102, 97,108,108,111,102,102, 0,102, 97,108,108,111,102,102, 95,116,121,112,101, - 0,112, 97,100, 51, 0,115,104, 97,100,115,112,111,116,115,105,122,101, 0, 98,105, 97,115, 0,115,111,102,116, 0, 98,117,102, -115,105,122,101, 0,115, 97,109,112, 0, 98,117,102,102,101,114,115, 0,102,105,108,116,101,114,116,121,112,101, 0, 98,117,102, -102,108, 97,103, 0, 98,117,102,116,121,112,101, 0,114, 97,121, 95,115, 97,109,112, 0,114, 97,121, 95,115, 97,109,112,121, 0, -114, 97,121, 95,115, 97,109,112,122, 0,114, 97,121, 95,115, 97,109,112, 95,116,121,112,101, 0, 97,114,101, 97, 95,115,104, 97, -112,101, 0, 97,114,101, 97, 95,115,105,122,101, 0, 97,114,101, 97, 95,115,105,122,101,121, 0, 97,114,101, 97, 95,115,105,122, -101,122, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 0,114, 97,121, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0, -116,101,120, 97, 99,116, 0,115,104, 97,100,104, 97,108,111,115,116,101,112, 0, 89, 70, 95,110,117,109,112,104,111,116,111,110, -115, 0, 89, 70, 95,110,117,109,115,101, 97,114, 99,104, 0, 89, 70, 95,112,104,100,101,112,116,104, 0, 89, 70, 95,117,115,101, -113,109, 99, 0, 89, 70, 95, 98,117,102,115,105,122,101, 0, 89, 70, 95,112, 97,100, 0, 89, 70, 95, 99, 97,117,115,116,105, 99, - 98,108,117,114, 0, 89, 70, 95,108,116,114, 97,100,105,117,115, 0, 89, 70, 95,103,108,111,119,105,110,116, 0, 89, 70, 95,103, -108,111,119,111,102,115, 0, 89, 70, 95,103,108,111,119,116,121,112,101, 0, 89, 70, 95,112, 97,100, 50, 0, 42,109,116,101,120, - 91, 49, 48, 93, 0,115,112,101, 99,114, 0,115,112,101, 99,103, 0,115,112,101, 99, 98, 0,109,105,114,114, 0,109,105,114,103, - 0,109,105,114, 98, 0, 97,109, 98,114, 0, 97,109, 98, 98, 0, 97,109, 98,103, 0, 97,109, 98, 0,101,109,105,116, 0, 97,110, -103, 0,115,112,101, 99,116,114, 97, 0,114, 97,121, 95,109,105,114,114,111,114, 0, 97,108,112,104, 97, 0,114,101,102, 0,115, -112,101, 99, 0,122,111,102,102,115, 0, 97,100,100, 0,116,114, 97,110,115,108,117, 99,101,110, 99,121, 0,102,114,101,115,110, -101,108, 95,109,105,114, 0,102,114,101,115,110,101,108, 95,109,105,114, 95,105, 0,102,114,101,115,110,101,108, 95,116,114, 97, - 0,102,114,101,115,110,101,108, 95,116,114, 97, 95,105, 0,102,105,108,116,101,114, 0,116,120, 95,108,105,109,105,116, 0,116, -120, 95,102, 97,108,108,111,102,102, 0,114, 97,121, 95,100,101,112,116,104, 0,114, 97,121, 95,100,101,112,116,104, 95,116,114, - 97, 0,104, 97,114, 0,115,101,101,100, 49, 0,115,101,101,100, 50, 0,103,108,111,115,115, 95,109,105,114, 0,103,108,111,115, -115, 95,116,114, 97, 0,115, 97,109,112, 95,103,108,111,115,115, 95,109,105,114, 0,115, 97,109,112, 95,103,108,111,115,115, 95, -116,114, 97, 0, 97,100, 97,112,116, 95,116,104,114,101,115,104, 95,109,105,114, 0, 97,100, 97,112,116, 95,116,104,114,101,115, -104, 95,116,114, 97, 0, 97,110,105,115,111, 95,103,108,111,115,115, 95,109,105,114, 0,100,105,115,116, 95,109,105,114, 0,102, - 97,100,101,116,111, 95,109,105,114, 0,109,111,100,101, 95,108, 0,102,108, 97,114,101, 99, 0,115,116, 97,114, 99, 0,108,105, -110,101, 99, 0,114,105,110,103, 99, 0,104, 97,115,105,122,101, 0,102,108, 97,114,101,115,105,122,101, 0,115,117, 98,115,105, -122,101, 0,102,108, 97,114,101, 98,111,111,115,116, 0,115,116,114, 97,110,100, 95,115,116, 97, 0,115,116,114, 97,110,100, 95, -101,110,100, 0,115,116,114, 97,110,100, 95,101, 97,115,101, 0,115,116,114, 97,110,100, 95,117,118,110, 97,109,101, 91, 51, 50, - 93, 0,115, 98,105, 97,115, 0,115,104, 97,100, 95, 97,108,112,104, 97, 0,112, 97,100,102, 0,114,103, 98,115,101,108, 0,112, -114, 95,116,121,112,101, 0,117,115,101, 95,110,111,100,101,115, 0,112,114, 95, 98, 97, 99,107, 0,112,114, 95,108, 97,109,112, - 0,115,101,112,116,101,120, 0,109,108, 95,102,108, 97,103, 0,100,105,102,102, 95,115,104, 97,100,101,114, 0,115,112,101, 99, - 95,115,104, 97,100,101,114, 0,114,111,117,103,104,110,101,115,115, 0,114,101,102,114, 97, 99, 0,112, 97,114, 97,109, 91, 52, - 93, 0,114,109,115, 0,100, 97,114,107,110,101,115,115, 0, 42,114, 97,109,112, 95, 99,111,108, 0, 42,114, 97,109,112, 95,115, -112,101, 99, 0,114, 97,109,112,105,110, 95, 99,111,108, 0,114, 97,109,112,105,110, 95,115,112,101, 99, 0,114, 97,109,112, 98, -108,101,110,100, 95, 99,111,108, 0,114, 97,109,112, 98,108,101,110,100, 95,115,112,101, 99, 0,114, 97,109,112, 95,115,104,111, -119, 0,114, 97,109,112,102, 97, 99, 95, 99,111,108, 0,114, 97,109,112,102, 97, 99, 95,115,112,101, 99, 0, 42,110,111,100,101, -116,114,101,101, 0, 42,103,114,111,117,112, 0,102,114,105, 99,116,105,111,110, 0,102,104, 0,114,101,102,108,101, 99,116, 0, -102,104,100,105,115,116, 0,120,121,102,114,105, 99,116, 0,100,121,110, 97,109,111,100,101, 0,115,115,115, 95,114, 97,100,105, -117,115, 91, 51, 93, 0,115,115,115, 95, 99,111,108, 91, 51, 93, 0,115,115,115, 95,101,114,114,111,114, 0,115,115,115, 95,115, - 99, 97,108,101, 0,115,115,115, 95,105,111,114, 0,115,115,115, 95, 99,111,108,102, 97, 99, 0,115,115,115, 95,116,101,120,102, - 97, 99, 0,115,115,115, 95,102,114,111,110,116, 0,115,115,115, 95, 98, 97, 99,107, 0,115,115,115, 95,102,108, 97,103, 0,115, -115,115, 95,112,114,101,115,101,116, 0, 89, 70, 95, 97,114, 0, 89, 70, 95, 97,103, 0, 89, 70, 95, 97, 98, 0, 89, 70, 95,100, -115, 99, 97,108,101, 0, 89, 70, 95,100,112,119,114, 0, 89, 70, 95,100,115,109,112, 0, 89, 70, 95,112,114,101,115,101,116, 0, - 89, 70, 95,100,106,105,116, 0,110, 97,109,101, 91, 50, 53, 54, 93, 0,115, 99, 97,108,101, 0, 42, 98, 98, 0,105, 49, 0,106, - 49, 0,107, 49, 0,105, 50, 0,106, 50, 0,107, 50, 0,115,101,108, 99,111,108, 49, 0,115,101,108, 99,111,108, 50, 0,113,117, - 97,116, 91, 52, 93, 0,101,120,112,120, 0,101,120,112,121, 0,101,120,112,122, 0,114, 97,100, 0,114, 97,100, 50, 0,115, 0, - 42,109, 97,116, 0, 42,105,109, 97,116, 0,101,108,101,109,115, 0,100,105,115,112, 0, 42, 42,109, 97,116, 0,116,111,116, 99, -111,108, 0,119,105,114,101,115,105,122,101, 0,114,101,110,100,101,114,115,105,122,101, 0,116,104,114,101,115,104, 0,118,101, - 99, 91, 51, 93, 91, 51, 93, 0, 97,108,102, 97, 0,119,101,105,103,104,116, 0,114, 97,100,105,117,115, 0,104, 49, 0,104, 50, - 0,102, 49, 0,102, 50, 0,102, 51, 0,104,105,100,101, 0,118,101, 99, 91, 52, 93, 0,109, 97,116, 95,110,114, 0,112,110,116, -115,117, 0,112,110,116,115,118, 0,114,101,115,111,108,117, 0,114,101,115,111,108,118, 0,111,114,100,101,114,117, 0,111,114, -100,101,114,118, 0,102,108, 97,103,117, 0,102,108, 97,103,118, 0, 42,107,110,111,116,115,117, 0, 42,107,110,111,116,115,118, - 0, 42, 98,112, 0, 42, 98,101,122,116, 0,116,105,108,116, 95,105,110,116,101,114,112, 0, 99,104, 97,114,105,100,120, 0,107, -101,114,110, 0,104, 0,110,117,114, 98, 0, 42, 98,101,118,111, 98,106, 0, 42,116, 97,112,101,114,111, 98,106, 0, 42,116,101, -120,116,111,110, 99,117,114,118,101, 0, 42,112, 97,116,104, 0, 42,107,101,121, 0, 98,101,118, 0,112, 97,116,104,108,101,110, - 0, 98,101,118,114,101,115,111,108, 0,119,105,100,116,104, 0,101,120,116, 49, 0,101,120,116, 50, 0,114,101,115,111,108,117, - 95,114,101,110, 0,114,101,115,111,108,118, 95,114,101,110, 0,115,112, 97, 99,101,109,111,100,101, 0,115,112, 97, 99,105,110, -103, 0,108,105,110,101,100,105,115,116, 0,115,104,101, 97,114, 0,102,115,105,122,101, 0,119,111,114,100,115,112, 97, 99,101, - 0,117,108,112,111,115, 0,117,108,104,101,105,103,104,116, 0,120,111,102, 0,121,111,102, 0,108,105,110,101,119,105,100,116, -104, 0, 42,115,116,114, 0,102, 97,109,105,108,121, 91, 50, 52, 93, 0, 42,118,102,111,110,116, 0, 42,118,102,111,110,116, 98, - 0, 42,118,102,111,110,116,105, 0, 42,118,102,111,110,116, 98,105, 0,115,101,112, 99,104, 97,114, 0,116,111,116, 98,111,120, - 0, 97, 99,116, 98,111,120, 0, 42,116, 98, 0,115,101,108,115,116, 97,114,116, 0,115,101,108,101,110,100, 0, 42,115,116,114, -105,110,102,111, 0, 99,117,114,105,110,102,111, 0,110, 97,109,101, 91, 49, 50, 56, 93, 0,109, 97,120,114, 99,116, 0,116,111, -116,114, 99,116, 0,118, 97,114,116,121,112,101, 0,116,111,116,118,101,114,116, 0,105,112,111, 0,101,120,116,114, 97,112, 0, - 98,105,116,109, 97,115,107, 0,115,108,105,100,101, 95,109,105,110, 0,115,108,105,100,101, 95,109, 97,120, 0, 42,100,114,105, -118,101,114, 0,101,102,102,101, 99,116, 0, 42,109,102, 97, 99,101, 0, 42,109,116,102, 97, 99,101, 0, 42,116,102, 97, 99,101, - 0, 42,109,118,101,114,116, 0, 42,109,101,100,103,101, 0, 42,100,118,101,114,116, 0, 42,109, 99,111,108, 0, 42,109,115,116, -105, 99,107,121, 0, 42,116,101,120, 99,111,109,101,115,104, 0, 42,109,115,101,108,101, 99,116, 0,118,100, 97,116, 97, 0,101, -100, 97,116, 97, 0,102,100, 97,116, 97, 0,116,111,116,101,100,103,101, 0,116,111,116,102, 97, 99,101, 0,116,111,116,115,101, -108,101, 99,116, 0, 97, 99,116, 95,102, 97, 99,101, 0, 99,117, 98,101,109, 97,112,115,105,122,101, 0,115,109,111,111,116,104, -114,101,115,104, 0,115,117, 98,100,105,118, 0,115,117, 98,100,105,118,114, 0,115,117, 98,115,117,114,102,116,121,112,101, 0, - 42,109,114, 0, 42,112,118, 0, 42,116,112, 97,103,101, 0,117,118, 91, 52, 93, 91, 50, 93, 0, 99,111,108, 91, 52, 93, 0,116, -114, 97,110,115,112, 0,116,105,108,101, 0,117,110,119,114, 97,112, 0,118, 49, 0,118, 50, 0,118, 51, 0,118, 52, 0,101,100, - 99,111,100,101, 0, 99,114,101, 97,115,101, 0,100,101,102, 95,110,114, 0, 42,100,119, 0,116,111,116,119,101,105,103,104,116, - 0, 99,111, 91, 51, 93, 0,110,111, 91, 51, 93, 0, 99,111, 91, 50, 93, 0,105,110,100,101,120, 0,102, 0,105, 0,115, 91, 50, - 53, 54, 93, 0,118, 91, 52, 93, 0,109,105,100, 0,112, 97,100, 91, 50, 93, 0,118, 91, 50, 93, 0, 42,102, 97, 99,101,115, 0, - 42, 99,111,108,102, 97, 99,101,115, 0, 42,101,100,103,101,115, 0, 42,101,100,103,101, 95, 98,111,117,110,100, 97,114,121, 95, -115,116, 97,116,101,115, 0, 42,118,101,114,116, 95,101,100,103,101, 95,109, 97,112, 0, 42,118,101,114,116, 95,102, 97, 99,101, - 95,109, 97,112, 0, 42,109, 97,112, 95,109,101,109, 0, 42,118,101,114,116,115, 0,108,101,118,101,108,115, 0,108,101,118,101, -108, 95, 99,111,117,110,116, 0, 99,117,114,114,101,110,116, 0,110,101,119,108,118,108, 0,101,100,103,101,108,118,108, 0,112, -105,110,108,118,108, 0,114,101,110,100,101,114,108,118,108, 0,117,115,101, 95, 99,111,108, 0, 42,101,100,103,101, 95,102,108, - 97,103,115, 0, 42,101,100,103,101, 95, 99,114,101, 97,115,101,115, 0, 42,118,101,114,116, 95,109, 97,112, 0, 42,101,100,103, -101, 95,109, 97,112, 0, 42,111,108,100, 95,102, 97, 99,101,115, 0, 42,111,108,100, 95,101,100,103,101,115, 0, 42,101,114,114, -111,114, 0,109,111,100,105,102,105,101,114, 0,115,117, 98,100,105,118, 84,121,112,101, 0,114,101,110,100,101,114, 76,101,118, -101,108,115, 0, 42,101,109, 67, 97, 99,104,101, 0, 42,109, 67, 97, 99,104,101, 0,100,101,102, 97,120,105,115, 0,112, 97,100, - 91, 54, 93, 0,115,116, 97,114,116, 0,108,101,110,103,116,104, 0,114, 97,110,100,111,109,105,122,101, 0,115,101,101,100, 0, - 42,115,116, 97,114,116, 95, 99, 97,112, 0, 42,101,110,100, 95, 99, 97,112, 0, 42, 99,117,114,118,101, 95,111, 98, 0, 42,111, -102,102,115,101,116, 95,111, 98, 0,111,102,102,115,101,116, 91, 51, 93, 0,115, 99, 97,108,101, 91, 51, 93, 0,109,101,114,103, -101, 95,100,105,115,116, 0,102,105,116, 95,116,121,112,101, 0,111,102,102,115,101,116, 95,116,121,112,101, 0, 99,111,117,110, -116, 0, 97,120,105,115, 0,116,111,108,101,114, 97,110, 99,101, 0, 42,109,105,114,114,111,114, 95,111, 98, 0,115,112,108,105, -116, 95, 97,110,103,108,101, 0, 42,116,101,120,116,117,114,101, 0,115,116,114,101,110,103,116,104, 0,100,105,114,101, 99,116, -105,111,110, 0,100,101,102,103,114,112, 95,110, 97,109,101, 91, 51, 50, 93, 0,109,105,100,108,101,118,101,108, 0,116,101,120, -109, 97,112,112,105,110,103, 0, 42,109, 97,112, 95,111, 98,106,101, 99,116, 0,117,118,108, 97,121,101,114, 95,110, 97,109,101, - 91, 51, 50, 93, 0,117,118,108, 97,121,101,114, 95,116,109,112, 0, 42,112,114,111,106,101, 99,116,111,114,115, 91, 49, 48, 93, - 0, 42,105,109, 97,103,101, 0,110,117,109, 95,112,114,111,106,101, 99,116,111,114,115, 0, 97,115,112,101, 99,116,120, 0, 97, -115,112,101, 99,116,121, 0,112,101,114, 99,101,110,116, 0,102, 97, 99,101, 67,111,117,110,116, 0,102, 97, 99, 0,114,101,112, -101, 97,116, 0, 42,111, 98,106,101, 99,116, 99,101,110,116,101,114, 0,115,116, 97,114,116,120, 0,115,116, 97,114,116,121, 0, -104,101,105,103,104,116, 0,110, 97,114,114,111,119, 0,115,112,101,101,100, 0,100, 97,109,112, 0,116,105,109,101,111,102,102, -115, 0,108,105,102,101,116,105,109,101, 0,100,101,102,111,114,109,102,108, 97,103, 0,109,117,108,116,105, 0, 42,112,114,101, -118, 67,111,115, 0,112, 97,114,101,110,116,105,110,118, 91, 52, 93, 91, 52, 93, 0, 99,101,110,116, 91, 51, 93, 0,102, 97,108, -108,111,102,102, 0, 42,105,110,100,101,120, 97,114, 0,116,111,116,105,110,100,101,120, 0,102,111,114, 99,101, 0,111,112,101, -114, 97,116,105,111,110, 0,118,101,114,116,101,120, 0,116,111,116,105,110,102,108,117,101,110, 99,101, 0,103,114,105,100,115, -105,122,101, 0,110,101,101,100, 98,105,110,100, 0, 42, 98,105,110,100,119,101,105,103,104,116,115, 0, 42, 98,105,110,100, 99, -111,115, 0,116,111,116, 99, 97,103,101,118,101,114,116, 0, 42,100,121,110,103,114,105,100, 0, 42,100,121,110,105,110,102,108, -117,101,110, 99,101,115, 0, 42,100,121,110,118,101,114,116,115, 0, 42,112, 97,100, 50, 0,100,121,110,103,114,105,100,115,105, -122,101, 0,100,121,110, 99,101,108,108,109,105,110, 91, 51, 93, 0,100,121,110, 99,101,108,108,119,105,100,116,104, 0, 98,105, -110,100,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 42,112,115,121,115, 0, 42,100,109, 0,114,116, 91, 51, 93, 0,112,115,121,115, - 0,114,116, 91, 50, 93, 0, 42,102, 97, 99,101,112, 97, 0,118,103,114,111,117,112, 0,112,114,111,116,101, 99,116, 0,112,110, -116,115,119, 0,111,112,110,116,115,117, 0,111,112,110,116,115,118, 0,111,112,110,116,115,119, 0,116,121,112,101,117, 0,116, -121,112,101,118, 0,116,121,112,101,119, 0,102,117, 0,102,118, 0,102,119, 0,100,117, 0,100,118, 0,100,119, 0, 42,100,101, -102, 0,118,101, 99, 91, 56, 93, 91, 51, 93, 0,112, 97,114,116,121,112,101, 0,112, 97,114, 49, 0,112, 97,114, 50, 0,112, 97, -114, 51, 0,112, 97,114,115,117, 98,115,116,114, 91, 51, 50, 93, 0, 42,116,114, 97, 99,107, 0, 42,112,114,111,120,121, 0, 42, -112,114,111,120,121, 95,103,114,111,117,112, 0, 42,112,114,111,120,121, 95,102,114,111,109, 0, 42, 97, 99,116,105,111,110, 0, - 42,112,111,115,101, 0, 99,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108,115, 0,100,101,102, 98, 97,115,101, - 0,109,111,100,105,102,105,101,114,115, 0,100,108,111, 99, 91, 51, 93, 0,111,114,105,103, 91, 51, 93, 0,100,115,105,122,101, - 91, 51, 93, 0,100,114,111,116, 91, 51, 93, 0,100,113,117, 97,116, 91, 52, 93, 0,111, 98,109, 97,116, 91, 52, 93, 91, 52, 93, - 0, 99,111,110,115,116,105,110,118, 91, 52, 93, 91, 52, 93, 0,108, 97,121, 0, 99,111,108, 98,105,116,115, 0,116,114, 97,110, -115,102,108, 97,103, 0,105,112,111,102,108, 97,103, 0,116,114, 97, 99,107,102,108, 97,103, 0,117,112,102,108, 97,103, 0,110, -108, 97,102,108, 97,103, 0,112,114,111,116,101, 99,116,102,108, 97,103, 0,105,112,111,119,105,110, 0,115, 99, 97,102,108, 97, -103, 0,115, 99, 97,118,105,115,102,108, 97,103, 0, 98,111,117,110,100,116,121,112,101, 0,100,117,112,111,110, 0,100,117,112, -111,102,102, 0,100,117,112,115,116, 97, 0,100,117,112,101,110,100, 0,115,102, 0, 99,116,105,109,101, 0,109, 97,115,115, 0, -100, 97,109,112,105,110,103, 0,105,110,101,114,116,105, 97, 0,102,111,114,109,102, 97, 99,116,111,114, 0,114,100, 97,109,112, -105,110,103, 0,115,105,122,101,102, 97, 99, 0,100,116, 0,100,116,120, 0, 97, 99,116, 99,111,108, 0,101,109,112,116,121, 95, -100,114, 97,119,116,121,112,101, 0,112, 97,100, 49, 91, 55, 93, 0,101,109,112,116,121, 95,100,114, 97,119,115,105,122,101, 0, -112,114,111,112, 0,115,101,110,115,111,114,115, 0, 99,111,110,116,114,111,108,108,101,114,115, 0, 97, 99,116,117, 97,116,111, -114,115, 0, 42,115,117,109,111,104, 97,110,100,108,101, 0, 98, 98,115,105,122,101, 91, 51, 93, 0, 97, 99,116,100,101,102, 0, -103, 97,109,101,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103, 50, 0,115,111,102,116,102,108, 97,103, 0, 97,110,105,115, -111,116,114,111,112,105, 99, 70,114,105, 99,116,105,111,110, 91, 51, 93, 0, 99,111,110,115,116,114, 97,105,110,116,115, 0,110, -108, 97,115,116,114,105,112,115, 0,104,111,111,107,115, 0,112, 97,114,116,105, 99,108,101,115,121,115,116,101,109, 0, 42,112, -100, 0, 42,115,111,102,116, 0, 42,100,117,112, 95,103,114,111,117,112, 0,102,108,117,105,100,115,105,109, 70,108, 97,103, 0, -114,101,115,116,114,105, 99,116,102,108, 97,103, 0,115,104, 97,112,101,110,114, 0,115,104, 97,112,101,102,108, 97,103, 0,114, -101, 99, 97,108, 99,111, 0,112, 97,100, 52, 0, 42,102,108,117,105,100,115,105,109, 83,101,116,116,105,110,103,115, 0, 42,100, -101,114,105,118,101,100, 68,101,102,111,114,109, 0, 42,100,101,114,105,118,101,100, 70,105,110, 97,108, 0,108, 97,115,116, 68, - 97,116, 97, 77, 97,115,107, 0, 99,117,114,105,110,100,101,120, 0, 97, 99,116,105,118,101, 0,100,101,102,108,101, 99,116, 0, -102,111,114, 99,101,102,105,101,108,100, 0,112,100,101,102, 95,100, 97,109,112, 0,112,100,101,102, 95,114,100, 97,109,112, 0, -112,100,101,102, 95,112,101,114,109, 0,112,100,101,102, 95,102,114,105, 99,116, 0,112,100,101,102, 95,114,102,114,105, 99,116, - 0,102, 95,115,116,114,101,110,103,116,104, 0,102, 95,112,111,119,101,114, 0,102, 95,100,105,115,116, 0,102, 95,100, 97,109, -112, 0,109, 97,120,100,105,115,116, 0,109,105,110,100,105,115,116, 0,109, 97,120,114, 97,100, 0,109,105,110,114, 97,100, 0, -102, 95,112,111,119,101,114, 95,114, 0,112,100,101,102, 95,115, 98,100, 97,109,112, 0,112,100,101,102, 95,115, 98,105,102,116, - 0,112,100,101,102, 95,115, 98,111,102,116, 0, 99,108,117,109,112, 95,102, 97, 99, 0, 99,108,117,109,112, 95,112,111,119, 0, -107,105,110,107, 95,102,114,101,113, 0,107,105,110,107, 95,115,104, 97,112,101, 0,107,105,110,107, 95, 97,109,112, 0,102,114, -101,101, 95,101,110,100, 0,116,101,120, 95,110, 97, 98,108, 97, 0,116,101,120, 95,109,111,100,101, 0,107,105,110,107, 0,107, -105,110,107, 95, 97,120,105,115, 0,114,116, 50, 0, 42,112, 97,114,116,105, 99,108,101,115, 0,116,111,116,112,111,105,110,116, - 0,116,111,116,115,112,114,105,110,103, 0, 42, 98,112,111,105,110,116, 0, 42, 98,115,112,114,105,110,103, 0,110,111,100,101, -109, 97,115,115, 0,103,114, 97,118, 0,109,101,100,105, 97,102,114,105, 99,116, 0,114,107,108,105,109,105,116, 0,112,104,121, -115,105, 99,115, 95,115,112,101,101,100, 0,103,111, 97,108,115,112,114,105,110,103, 0,103,111, 97,108,102,114,105, 99,116, 0, -109,105,110,103,111, 97,108, 0,109, 97,120,103,111, 97,108, 0,100,101,102,103,111, 97,108, 0,118,101,114,116,103,114,111,117, -112, 0,102,117,122,122,121,110,101,115,115, 0,105,110,115,112,114,105,110,103, 0,105,110,102,114,105, 99,116, 0,101,102,114, - 97, 0,105,110,116,101,114,118, 97,108, 0,108,111, 99, 97,108, 0,115,111,108,118,101,114,102,108, 97,103,115, 0, 42, 42,107, -101,121,115, 0,116,111,116,112,111,105,110,116,107,101,121, 0,115,101, 99,111,110,100,115,112,114,105,110,103, 0, 99,111,108, - 98, 97,108,108, 0, 98, 97,108,108,100, 97,109,112, 0, 98, 97,108,108,115,116,105,102,102, 0,115, 98, 99, 95,109,111,100,101, - 0, 97,101,114,111,101,100,103,101, 0,109,105,110,108,111,111,112,115, 0,109, 97,120,108,111,111,112,115, 0, 99,104,111,107, -101, 0,112, 97,100, 53, 0, 42,115, 99,114, 97,116, 99,104, 0,115,104,111,119, 95, 97,100,118, 97,110, 99,101,100,111,112,116, -105,111,110,115, 0,114,101,115,111,108,117,116,105,111,110,120,121,122, 0,112,114,101,118,105,101,119,114,101,115,120,121,122, - 0,114,101, 97,108,115,105,122,101, 0,103,117,105, 68,105,115,112,108, 97,121, 77,111,100,101, 0,114,101,110,100,101,114, 68, -105,115,112,108, 97,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 86, 97,108,117,101, 0,118,105,115, 99,111,115, -105,116,121, 77,111,100,101, 0,118,105,115, 99,111,115,105,116,121, 69,120,112,111,110,101,110,116, 0,103,114, 97,118,120, 0, -103,114, 97,118,121, 0,103,114, 97,118,122, 0, 97,110,105,109, 83,116, 97,114,116, 0, 97,110,105,109, 69,110,100, 0,103,115, -116, 97,114, 0,109, 97,120, 82,101,102,105,110,101, 0,105,110,105, 86,101,108,120, 0,105,110,105, 86,101,108,121, 0,105,110, -105, 86,101,108,122, 0, 42,111,114,103, 77,101,115,104, 0, 42,109,101,115,104, 83,117,114,102, 97, 99,101, 0, 42,109,101,115, -104, 66, 66, 0,115,117,114,102,100, 97,116, 97, 80, 97,116,104, 91, 50, 52, 48, 93, 0, 98, 98, 83,116, 97,114,116, 91, 51, 93, - 0, 98, 98, 83,105,122,101, 91, 51, 93, 0,116,121,112,101, 70,108, 97,103,115, 0,100,111,109, 97,105,110, 78,111,118,101, 99, -103,101,110, 0,118,111,108,117,109,101, 73,110,105,116, 84,121,112,101, 0,112, 97,114,116, 83,108,105,112, 86, 97,108,117,101, - 0,103,101,110,101,114, 97,116,101, 84,114, 97, 99,101,114,115, 0,103,101,110,101,114, 97,116,101, 80, 97,114,116,105, 99,108, -101,115, 0,115,117,114,102, 97, 99,101, 83,109,111,111,116,104,105,110,103, 0,115,117,114,102, 97, 99,101, 83,117, 98,100,105, -118,115, 0,117,110,117,115,101,100, 68, 78, 65, 68,117,109,109,121, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 83,105,122, -101, 0,112, 97,114,116,105, 99,108,101, 73,110,102, 65,108,112,104, 97, 0,102, 97,114, 70,105,101,108,100, 83,105,122,101, 0, - 42,109,101,115,104, 83,117,114,102, 78,111,114,109, 97,108,115, 0,109,105,115,116,121,112,101, 0,104,111,114,114, 0,104,111, -114,103, 0,104,111,114, 98, 0,104,111,114,107, 0,122,101,110,114, 0,122,101,110,103, 0,122,101,110, 98, 0,122,101,110,107, - 0, 97,109, 98,107, 0,102, 97,115,116, 99,111,108, 0,101,120,112,111,115,117,114,101, 0,101,120,112, 0,114, 97,110,103,101, - 0,108,105,110,102, 97, 99, 0,108,111,103,102, 97, 99, 0,103,114, 97,118,105,116,121, 0, 97, 99,116,105,118,105,116,121, 66, -111,120, 82, 97,100,105,117,115, 0,115,107,121,116,121,112,101, 0,112,104,121,115,105, 99,115, 69,110,103,105,110,101, 0,109, -105,115,105, 0,109,105,115,116,115,116, 97, 0,109,105,115,116,100,105,115,116, 0,109,105,115,116,104,105, 0,115,116, 97,114, -114, 0,115,116, 97,114,103, 0,115,116, 97,114, 98, 0,115,116, 97,114,107, 0,115,116, 97,114,115,105,122,101, 0,115,116, 97, -114,109,105,110,100,105,115,116, 0,115,116, 97,114,100,105,115,116, 0,115,116, 97,114, 99,111,108,110,111,105,115,101, 0,100, -111,102,115,116, 97, 0,100,111,102,101,110,100, 0,100,111,102,109,105,110, 0,100,111,102,109, 97,120, 0, 97,111,100,105,115, -116, 0, 97,111,100,105,115,116,102, 97, 99, 0, 97,111,101,110,101,114,103,121, 0, 97,111, 98,105, 97,115, 0, 97,111,109,111, -100,101, 0, 97,111,115, 97,109,112, 0, 97,111,109,105,120, 0, 97,111, 99,111,108,111,114, 0, 97,111, 95, 97,100, 97,112,116, - 95,116,104,114,101,115,104, 0, 97,111, 95, 97,100, 97,112,116, 95,115,112,101,101,100, 95,102, 97, 99, 0,112, 97,100, 50, 91, - 50, 93, 0, 97,111, 95,115, 97,109,112, 95,109,101,116,104,111,100, 0,112, 97,100, 49, 91, 51, 93, 0, 42, 97,111,115,112,104, -101,114,101, 0, 42, 97,111,116, 97, 98,108,101,115, 0,104,101,109,105,114,101,115, 0,109, 97,120,105,116,101,114, 0,100,114, - 97,119,116,121,112,101, 0,115,117, 98,115,104,111,111,116,112, 0,115,117, 98,115,104,111,111,116,101, 0,110,111,100,101,108, -105,109, 0,109, 97,120,115,117, 98,108, 97,109,112, 0,112, 97,109, 97, 0,112, 97,109,105, 0,101,108,109, 97, 0,101,108,109, -105, 0,109, 97,120,110,111,100,101, 0, 99,111,110,118,101,114,103,101,110, 99,101, 0,114, 97,100,102, 97, 99, 0,103, 97,109, -109, 97, 0,115,101,108, 99,111,108, 0,115,120, 0,115,121, 0, 42,108,112, 70,111,114,109, 97,116, 0, 42,108,112, 80, 97,114, -109,115, 0, 99, 98, 70,111,114,109, 97,116, 0, 99, 98, 80, 97,114,109,115, 0,102, 99, 99, 84,121,112,101, 0,102, 99, 99, 72, - 97,110,100,108,101,114, 0,100,119, 75,101,121, 70,114, 97,109,101, 69,118,101,114,121, 0,100,119, 81,117, 97,108,105,116,121, - 0,100,119, 66,121,116,101,115, 80,101,114, 83,101, 99,111,110,100, 0,100,119, 70,108, 97,103,115, 0,100,119, 73,110,116,101, -114,108,101, 97,118,101, 69,118,101,114,121, 0, 97,118,105, 99,111,100,101, 99,110, 97,109,101, 91, 49, 50, 56, 93, 0, 42, 99, -100, 80, 97,114,109,115, 0, 42,112, 97,100, 0, 99,100, 83,105,122,101, 0,113,116, 99,111,100,101, 99,110, 97,109,101, 91, 49, - 50, 56, 93, 0, 99,111,100,101, 99, 0, 97,117,100,105,111, 95, 99,111,100,101, 99, 0,118,105,100,101,111, 95, 98,105,116,114, - 97,116,101, 0, 97,117,100,105,111, 95, 98,105,116,114, 97,116,101, 0,103,111,112, 95,115,105,122,101, 0,114, 99, 95,109,105, -110, 95,114, 97,116,101, 0,114, 99, 95,109, 97,120, 95,114, 97,116,101, 0,114, 99, 95, 98,117,102,102,101,114, 95,115,105,122, -101, 0,109,117,120, 95,112, 97, 99,107,101,116, 95,115,105,122,101, 0,109,117,120, 95,114, 97,116,101, 0,109,105,120,114, 97, -116,101, 0,109, 97,105,110, 0,112, 97,100, 91, 51, 93, 0, 42,109, 97,116, 95,111,118,101,114,114,105,100,101, 0, 42,108,105, -103,104,116, 95,111,118,101,114,114,105,100,101, 0,108, 97,121,102,108, 97,103, 0,112, 97,115,115,102,108, 97,103, 0,112, 97, -115,115, 95,120,111,114, 0, 42, 97,118,105, 99,111,100,101, 99,100, 97,116, 97, 0, 42,113,116, 99,111,100,101, 99,100, 97,116, - 97, 0,102,102, 99,111,100,101, 99,100, 97,116, 97, 0, 99,102,114, 97, 0,112,115,102,114, 97, 0,112,101,102,114, 97, 0,105, -109, 97,103,101,115, 0,102,114, 97,109, 97,112,116,111, 0,116,104,114,101, 97,100,115, 0,102,114, 97,109,101,108,101,110, 0, - 98,108,117,114,102, 97, 99, 0,101,100,103,101, 82, 0,101,100,103,101, 71, 0,101,100,103,101, 66, 0,102,117,108,108,115, 99, -114,101,101,110, 0,120,112,108, 97,121, 0,121,112,108, 97,121, 0,102,114,101,113,112,108, 97,121, 0, 97,116,116,114,105, 98, - 0,114,116, 49, 0,115,116,101,114,101,111,109,111,100,101, 0,100,105,109,101,110,115,105,111,110,115,112,114,101,115,101,116, - 0,109, 97,120,105,109,115,105,122,101, 0,120,115, 99,104, 0,121,115, 99,104, 0,120, 97,115,112, 0,121, 97,115,112, 0,120, -112, 97,114,116,115, 0,121,112, 97,114,116,115, 0,119,105,110,112,111,115, 0,112,108, 97,110,101,115, 0,105,109,116,121,112, -101, 0,115,117, 98,105,109,116,121,112,101, 0,113,117, 97,108,105,116,121, 0,115, 99,101,109,111,100,101, 0,114,101,110,100, -101,114,101,114, 0,111, 99,114,101,115, 0,114,112, 97,100, 91, 50, 93, 0, 97,108,112,104, 97,109,111,100,101, 0,111,115, 97, - 0,102,114,115, 95,115,101, 99, 0,101,100,103,101,105,110,116, 0,115, 97,102,101,116,121, 0, 98,111,114,100,101,114, 0,100, -105,115,112,114,101, 99,116, 0,108, 97,121,101,114,115, 0, 97, 99,116,108, 97,121, 0,102,114,115, 95,115,101, 99, 95, 98, 97, -115,101, 0,103, 97,117,115,115, 0,112,111,115,116,109,117,108, 0,112,111,115,116,103, 97,109,109, 97, 0,112,111,115,116,104, -117,101, 0,112,111,115,116,115, 97,116, 0,100,105,116,104,101,114, 95,105,110,116,101,110,115,105,116,121, 0, 98, 97,107,101, - 95,111,115, 97, 0, 98, 97,107,101, 95,102,105,108,116,101,114, 0, 98, 97,107,101, 95,109,111,100,101, 0, 98, 97,107,101, 95, -102,108, 97,103, 0, 71, 73,113,117, 97,108,105,116,121, 0, 71, 73, 99, 97, 99,104,101, 0, 71, 73,109,101,116,104,111,100, 0, - 71, 73,112,104,111,116,111,110,115, 0, 71, 73,100,105,114,101, 99,116, 0, 89, 70, 95, 65, 65, 0, 89, 70,101,120,112,111,114, -116,120,109,108, 0, 89, 70, 95,110,111, 98,117,109,112, 0, 89, 70, 95, 99,108, 97,109,112,114,103, 98, 0,121,102,112, 97,100, - 49, 0, 71, 73,100,101,112,116,104, 0, 71, 73, 99, 97,117,115,100,101,112,116,104, 0, 71, 73,112,105,120,101,108,115,112,101, -114,115, 97,109,112,108,101, 0, 71, 73,112,104,111,116,111,110, 99,111,117,110,116, 0, 71, 73,109,105,120,112,104,111,116,111, -110,115, 0, 71, 73,112,104,111,116,111,110,114, 97,100,105,117,115, 0, 89, 70, 95,110,117,109,112,114,111, 99,115, 0, 89, 70, - 95,114, 97,121,100,101,112,116,104, 0, 89, 70, 95, 65, 65,112, 97,115,115,101,115, 0, 89, 70, 95, 65, 65,115, 97,109,112,108, -101,115, 0, 71, 73,115,104, 97,100,111,119,113,117, 97,108,105,116,121, 0, 71, 73,114,101,102,105,110,101,109,101,110,116, 0, - 71, 73,112,111,119,101,114, 0, 71, 73,105,110,100,105,114,112,111,119,101,114, 0, 89, 70, 95,103, 97,109,109, 97, 0, 89, 70, - 95,101,120,112,111,115,117,114,101, 0, 89, 70, 95,114, 97,121, 98,105, 97,115, 0, 89, 70, 95, 65, 65,112,105,120,101,108,115, -105,122,101, 0, 89, 70, 95, 65, 65,116,104,114,101,115,104,111,108,100, 0, 98, 97, 99,107, 98,117,102, 91, 49, 54, 48, 93, 0, -112,105, 99, 91, 49, 54, 48, 93, 0,102,116,121,112,101, 91, 49, 54, 48, 93, 0,115,116, 97,109,112, 0,115,116, 97,109,112, 95, -102,111,110,116, 95,105,100, 0,115,116, 97,109,112, 95,117,100, 97,116, 97, 91, 49, 54, 48, 93, 0,102,103, 95,115,116, 97,109, -112, 91, 52, 93, 0, 98,103, 95,115,116, 97,109,112, 91, 52, 93, 0, 99,111,108, 91, 51, 93, 0,102,114, 97,109,101, 0,110, 97, -109,101, 91, 54, 52, 93, 0, 42, 98,114,117,115,104, 0,116,111,111,108, 0,115,116,101,112, 0,105,110,118,101,114,116, 0,116, -111,116,114,101,107,101,121, 0,116,111,116, 97,100,100,107,101,121, 0, 98,114,117,115,104,116,121,112,101, 0, 98,114,117,115, -104, 91, 55, 93, 0,101,109,105,116,116,101,114,100,105,115,116, 0,100,114, 97,119, 95,116,105,109,101,100, 0, 99,111,114,110, -101,114,116,121,112,101, 0,101,100,105,116, 98,117,116,102,108, 97,103, 0,106,111,105,110,116,114,105,108,105,109,105,116, 0, -100,101,103,114, 0,116,117,114,110, 0,101,120,116,114, 95,111,102,102,115, 0,100,111,117, 98,108,105,109,105,116, 0,115,101, -103,109,101,110,116,115, 0,114,105,110,103,115, 0,118,101,114,116,105, 99,101,115, 0,117,110,119,114, 97,112,112,101,114, 0, -117,118, 99, 97,108, 99, 95,114, 97,100,105,117,115, 0,117,118, 99, 97,108, 99, 95, 99,117, 98,101,115,105,122,101, 0,117,118, - 99, 97,108, 99, 95,109, 97,112,100,105,114, 0,117,118, 99, 97,108, 99, 95,109, 97,112, 97,108,105,103,110, 0,117,118, 99, 97, -108, 99, 95,102,108, 97,103, 0,105,109, 97,112, 97,105,110,116, 0,112, 97,114,116,105, 99,108,101, 0,115,101,108,101, 99,116, - 95,116,104,114,101,115,104, 0, 99,108,101, 97,110, 95,116,104,114,101,115,104, 0,114,101,116,111,112,111, 95,109,111,100,101, - 0,114,101,116,111,112,111, 95,112, 97,105,110,116, 95,116,111,111,108, 0,108,105,110,101, 95,100,105,118, 0,101,108,108,105, -112,115,101, 95,100,105,118, 0,114,101,116,111,112,111, 95,104,111,116,115,112,111,116, 0,109,117,108,116,105,114,101,115, 95, -115,117, 98,100,105,118, 95,116,121,112,101, 0,112, 97,100, 52, 91, 50, 93, 0,100,105,114, 0, 97,105,114, 98,114,117,115,104, - 0,118,105,101,119, 0, 42,115,101,115,115,105,111,110, 0,100,114, 97,119, 98,114,117,115,104, 0,115,109,111,111,116,104, 98, -114,117,115,104, 0,112,105,110, 99,104, 98,114,117,115,104, 0,105,110,102,108, 97,116,101, 98,114,117,115,104, 0,103,114, 97, - 98, 98,114,117,115,104, 0,108, 97,121,101,114, 98,114,117,115,104, 0,102,108, 97,116,116,101,110, 98,114,117,115,104, 0, 98, -114,117,115,104, 95,116,121,112,101, 0,116,101,120,110,114, 0,116,101,120,114,101,112,116, 0,116,101,120,102, 97,100,101, 0, -116,101,120,115,101,112, 0, 97,118,101,114, 97,103,105,110,103, 0,116, 97, 98,108,101,116, 95,115,105,122,101, 0,116, 97, 98, -108,101,116, 95,115,116,114,101,110,103,116,104, 0,115,121,109,109, 0, 42, 99, 97,109,101,114, 97, 0, 42,119,111,114,108,100, - 0, 42,115,101,116, 0, 98, 97,115,101, 0, 42, 98, 97,115, 97, 99,116, 0, 99,117,114,115,111,114, 91, 51, 93, 0,116,119, 99, -101,110,116, 91, 51, 93, 0,116,119,109,105,110, 91, 51, 93, 0,116,119,109, 97,120, 91, 51, 93, 0,101,100,105,116, 98,117,116, -115,105,122,101, 0,115,101,108,101, 99,116,109,111,100,101, 0,112,114,111,112,111,114,116,105,111,110, 97,108, 0,112,114,111, -112, 95,109,111,100,101, 0, 97,117,116,111,109,101,114,103,101, 0,112, 97,100, 54, 0,112, 97,100, 55, 0, 42,101,100, 0, 42, -114, 97,100,105,111, 0,102,114, 97,109,105,110,103, 0, 42,116,111,111,108,115,101,116,116,105,110,103,115, 0, 97,117,100,105, -111, 0,109, 97,114,107,101,114,115, 0,106,117,109,112,102,114, 97,109,101, 0,115,110, 97,112, 95,102,108, 97,103, 0,115,110, - 97,112, 95,116, 97,114,103,101,116, 0, 42,116,104,101, 68, 97,103, 0,100, 97,103,105,115,118, 97,108,105,100, 0,100, 97,103, -102,108, 97,103,115, 0,115, 99,117,108,112,116,100, 97,116, 97, 0,122,111,111,109, 0, 98,108,101,110,100, 0,120,105,109, 0, -121,105,109, 0,115,112, 97, 99,101,116,121,112,101, 0, 98,108,111, 99,107,115, 99, 97,108,101, 0, 42, 97,114,101, 97, 0, 98, -108,111, 99,107,104, 97,110,100,108,101,114, 91, 56, 93, 0,118,105,101,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0,118,105,101, -119,105,110,118, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,101,114,115,105,110,118, - 91, 52, 93, 91, 52, 93, 0,119,105,110,109, 97,116, 49, 91, 52, 93, 91, 52, 93, 0,118,105,101,119,109, 97,116, 49, 91, 52, 93, - 91, 52, 93, 0,118,105,101,119,113,117, 97,116, 91, 52, 93, 0,122,102, 97, 99, 0,112,101,114,115,112, 0, 42,111, 98, 95, 99, -101,110,116,114,101, 0, 42, 98,103,112,105, 99, 0, 42,108,111, 99, 97,108,118,100, 0, 42,114,105, 0, 42,114,101,116,111,112, -111, 95,118,105,101,119, 95,100, 97,116, 97, 0, 42,100,101,112,116,104,115, 0,111, 98, 95, 99,101,110,116,114,101, 95, 98,111, -110,101, 91, 51, 50, 93, 0,108,111, 99, 97,108,118,105,101,119, 0,108, 97,121, 97, 99,116, 0,115, 99,101,110,101,108,111, 99, -107, 0, 97,114,111,117,110,100, 0, 99, 97,109,122,111,111,109, 0,112,105,118,111,116, 95,108, 97,115,116, 0,103,114,105,100, - 0,103,114,105,100,118,105,101,119, 0,112,105,120,115,105,122,101, 0,110,101, 97,114, 0,102, 97,114, 0, 99, 97,109,100,120, - 0, 99, 97,109,100,121, 0,103,114,105,100,108,105,110,101,115, 0,118,105,101,119, 98,117,116, 0,103,114,105,100,102,108, 97, -103, 0,109,111,100,101,115,101,108,101, 99,116, 0,116,119,116,121,112,101, 0,116,119,109,111,100,101, 0,116,119,102,108, 97, -103, 0,116,119,100,114, 97,119,102,108, 97,103, 0,116,119,109, 97,116, 91, 52, 93, 91, 52, 93, 0, 99,108,105,112, 91, 52, 93, - 91, 52, 93, 0, 42, 99,108,105,112, 98, 98, 0, 97,102,116,101,114,100,114, 97,119, 0,122, 98,117,102, 0,120,114, 97,121, 0, -102,108, 97,103, 50, 0,103,114,105,100,115,117, 98,100,105,118, 0, 42,112,114,111,112,101,114,116,105,101,115, 95,115,116,111, -114, 97,103,101, 0,118,101,114,116, 0,104,111,114, 0,109, 97,115,107, 0,109,105,110, 91, 50, 93, 0,109, 97,120, 91, 50, 93, - 0,109,105,110,122,111,111,109, 0,109, 97,120,122,111,111,109, 0,115, 99,114,111,108,108, 0,107,101,101,112,116,111,116, 0, -107,101,101,112, 97,115,112,101, 99,116, 0,107,101,101,112,122,111,111,109, 0,111,108,100,119,105,110,120, 0,111,108,100,119, -105,110,121, 0, 99,117,114,115,111,114, 91, 50, 93, 0,114,111,119, 98,117,116, 0,118, 50,100, 0, 42,101,100,105,116,105,112, -111, 0,105,112,111,107,101,121, 0, 97, 99,116,110, 97,109,101, 91, 51, 50, 93, 0, 99,111,110,115,116,110, 97,109,101, 91, 51, - 50, 93, 0,116,111,116,105,112,111, 0,112,105,110, 0, 98,117,116,111,102,115, 0, 99,104, 97,110,110,101,108, 0,108,111, 99, -107, 0,109,101,100,105, 97,110, 91, 51, 93, 0, 99,117,114,115,101,110,115, 0, 99,117,114, 97, 99,116, 0, 97,108,105,103,110, - 0,116, 97, 98,111, 0,109, 97,105,110, 98, 0,109, 97,105,110, 98,111, 0, 42,108,111, 99,107,112,111,105,110, 0,116,101,120, -102,114,111,109, 0,115,104,111,119,103,114,111,117,112, 0,109,111,100,101,108,116,121,112,101, 0,115, 99,114,105,112,116, 98, -108,111, 99,107, 0,114,101, 95, 97,108,105,103,110, 0,111,108,100,107,101,121,112,114,101,115,115, 0,116, 97, 98, 91, 55, 93, - 0, 99,104, 97,110,115,104,111,119,110, 0, 42,102,105,108,101,108,105,115,116, 0,116,111,116,102,105,108,101, 0,116,105,116, -108,101, 91, 50, 52, 93, 0,100,105,114, 91, 49, 54, 48, 93, 0,102,105,108,101, 91, 56, 48, 93, 0,111,102,115, 0,115,111,114, -116, 0,109, 97,120,110, 97,109,101,108,101,110, 0, 99,111,108,108,117,109,115, 0,102, 95,102,112, 0,102,112, 95,115,116,114, - 91, 56, 93, 0, 42,108,105, 98,102,105,108,101,100, 97,116, 97, 0,114,101,116,118, 97,108, 0,109,101,110,117, 0, 97, 99,116, - 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95,101,118, -101,110,116, 41, 40, 41, 0, 40, 42,114,101,116,117,114,110,102,117,110, 99, 95, 97,114,103,115, 41, 40, 41, 0, 42, 97,114,103, - 49, 0, 42, 97,114,103, 50, 0, 42,109,101,110,117,112, 0, 42,112,117,112,109,101,110,117, 0,111,111,112,115, 0,118,105,115, -105,102,108, 97,103, 0,116,114,101,101, 0, 42,116,114,101,101,115,116,111,114,101, 0,115,101, 97,114, 99,104, 95,115,116,114, -105,110,103, 91, 51, 50, 93, 0,115,101, 97,114, 99,104, 95,116,115,101, 0,115,101, 97,114, 99,104, 95,102,108, 97,103,115, 0, -100,111, 95, 0,111,117,116,108,105,110,101,118,105,115, 0,115,116,111,114,101,102,108, 97,103, 0,100,101,112,115, 95,102,108, - 97,103,115, 0, 42, 99,117,109, 97,112, 0,105,109, 97,110,114, 0, 99,117,114,116,105,108,101, 0,105,109,116,121,112,101,110, -114, 0,115,104,111,119,115,112, 97,114,101, 0,100,116, 95,117,118, 0,115,116,105, 99,107,121, 0, 99,101,110,116,120, 0, 99, -101,110,116,121, 0, 42,105,110,102,111, 95,115,116,114, 0, 42,105,110,102,111, 95,115,112, 97,114,101, 0, 42,115,112, 97,114, -101, 0, 97,117,116,111,115,110, 97,112, 0, 42,116,101,120,116, 0,116,111,112, 0,118,105,101,119,108,105,110,101,115, 0,102, -111,110,116, 95,105,100, 0,108,104,101,105,103,104,116, 0,108,101,102,116, 0,115,104,111,119,108,105,110,101,110,114,115, 0, -116, 97, 98,110,117,109, 98,101,114, 0, 99,117,114,114,116, 97, 98, 95,115,101,116, 0,115,104,111,119,115,121,110,116, 97,120, - 0,117,110,117,115,101,100, 95,112, 97,100,100, 0,112,105,120, 95,112,101,114, 95,108,105,110,101, 0,116,120,116,115, 99,114, -111,108,108, 0,116,120,116, 98, 97,114, 0, 42,115, 99,114,105,112,116, 0, 42, 98,117,116, 95,114,101,102,115, 0,114,101,100, -114, 97,119,115, 0, 42,105,100, 0, 97,115,112,101, 99,116, 0, 42, 99,117,114,102,111,110,116, 0, 42,101,100,105,116,116,114, -101,101, 0,116,114,101,101,116,121,112,101, 0, 42,102,105,108,101,115, 0, 97, 99,116,105,118,101, 95,102,105,108,101, 0,110, -117,109,116,105,108,101,115,120, 0,110,117,109,116,105,108,101,115,121, 0,115,101,108,115,116, 97,116,101, 0,118,105,101,119, -114,101, 99,116, 0, 98,111,111,107,109, 97,114,107,114,101, 99,116, 0,115, 99,114,111,108,108,112,111,115, 0,115, 99,114,111, -108,108,104,101,105,103,104,116, 0,115, 99,114,111,108,108, 97,114,101, 97, 0, 97, 99,116,105,118,101, 95, 98,111,111,107,109, - 97,114,107, 0,112,114,118, 95,119, 0,112,114,118, 95,104, 0, 42,105,109,103, 0,111,117,116,108,105,110,101, 91, 52, 93, 0, -110,101,117,116,114, 97,108, 91, 52, 93, 0, 97, 99,116,105,111,110, 91, 52, 93, 0,115,101,116,116,105,110,103, 91, 52, 93, 0, -115,101,116,116,105,110,103, 49, 91, 52, 93, 0,115,101,116,116,105,110,103, 50, 91, 52, 93, 0,110,117,109, 91, 52, 93, 0,116, -101,120,116,102,105,101,108,100, 91, 52, 93, 0,116,101,120,116,102,105,101,108,100, 95,104,105, 91, 52, 93, 0,112,111,112,117, -112, 91, 52, 93, 0,116,101,120,116, 91, 52, 93, 0,116,101,120,116, 95,104,105, 91, 52, 93, 0,109,101,110,117, 95, 98, 97, 99, -107, 91, 52, 93, 0,109,101,110,117, 95,105,116,101,109, 91, 52, 93, 0,109,101,110,117, 95,104,105,108,105,116,101, 91, 52, 93, - 0,109,101,110,117, 95,116,101,120,116, 91, 52, 93, 0,109,101,110,117, 95,116,101,120,116, 95,104,105, 91, 52, 93, 0, 98,117, -116, 95,100,114, 97,119,116,121,112,101, 0,105, 99,111,110,102,105,108,101, 91, 56, 48, 93, 0, 98, 97, 99,107, 91, 52, 93, 0, -104,101, 97,100,101,114, 91, 52, 93, 0,112, 97,110,101,108, 91, 52, 93, 0,115,104, 97,100,101, 49, 91, 52, 93, 0,115,104, 97, -100,101, 50, 91, 52, 93, 0,104,105,108,105,116,101, 91, 52, 93, 0,103,114,105,100, 91, 52, 93, 0,119,105,114,101, 91, 52, 93, - 0,115,101,108,101, 99,116, 91, 52, 93, 0,108, 97,109,112, 91, 52, 93, 0, 97, 99,116,105,118,101, 91, 52, 93, 0,103,114,111, -117,112, 91, 52, 93, 0,103,114,111,117,112, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,114, 97,110,115,102,111,114,109, 91, - 52, 93, 0,118,101,114,116,101,120, 91, 52, 93, 0,118,101,114,116,101,120, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100, -103,101, 91, 52, 93, 0,101,100,103,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,101,100,103,101, 95,115,101, 97,109, 91, 52, - 93, 0,101,100,103,101, 95,115,104, 97,114,112, 91, 52, 93, 0,101,100,103,101, 95,102, 97, 99,101,115,101,108, 91, 52, 93, 0, -102, 97, 99,101, 91, 52, 93, 0,102, 97, 99,101, 95,115,101,108,101, 99,116, 91, 52, 93, 0,102, 97, 99,101, 95,100,111,116, 91, - 52, 93, 0,110,111,114,109, 97,108, 91, 52, 93, 0, 98,111,110,101, 95,115,111,108,105,100, 91, 52, 93, 0, 98,111,110,101, 95, -112,111,115,101, 91, 52, 93, 0,115,116,114,105,112, 91, 52, 93, 0,115,116,114,105,112, 95,115,101,108,101, 99,116, 91, 52, 93, - 0,118,101,114,116,101,120, 95,115,105,122,101, 0,102, 97, 99,101,100,111,116, 95,115,105,122,101, 0, 98,112, 97,100, 91, 50, - 93, 0,115,121,110,116, 97,120,108, 91, 52, 93, 0,115,121,110,116, 97,120,110, 91, 52, 93, 0,115,121,110,116, 97,120, 98, 91, - 52, 93, 0,115,121,110,116, 97,120,118, 91, 52, 93, 0,115,121,110,116, 97,120, 99, 91, 52, 93, 0,109,111,118,105,101, 91, 52, - 93, 0,105,109, 97,103,101, 91, 52, 93, 0,115, 99,101,110,101, 91, 52, 93, 0, 97,117,100,105,111, 91, 52, 93, 0,101,102,102, -101, 99,116, 91, 52, 93, 0,112,108,117,103,105,110, 91, 52, 93, 0,116,114, 97,110,115,105,116,105,111,110, 91, 52, 93, 0,109, -101,116, 97, 91, 52, 93, 0,101,100,105,116,109,101,115,104, 95, 97, 99,116,105,118,101, 91, 52, 93, 0,116,117,105, 0,116, 98, -117,116,115, 0,116,118, 51,100, 0,116,102,105,108,101, 0,116,105,112,111, 0,116,105,110,102,111, 0,116,115,110,100, 0,116, - 97, 99,116, 0,116,110,108, 97, 0,116,115,101,113, 0,116,105,109, 97, 0,116,105,109, 97,115,101,108, 0,116,101,120,116, 0, -116,111,111,112,115, 0,116,116,105,109,101, 0,116,110,111,100,101, 0, 98,112, 97,100, 91, 52, 93, 0, 98,112, 97,100, 49, 91, - 52, 93, 0,115,112,101, 99, 91, 52, 93, 0,100,117,112,102,108, 97,103, 0,115, 97,118,101,116,105,109,101, 0,116,101,109,112, -100,105,114, 91, 49, 54, 48, 93, 0,102,111,110,116,100,105,114, 91, 49, 54, 48, 93, 0,114,101,110,100,101,114,100,105,114, 91, - 49, 54, 48, 93, 0,116,101,120,116,117,100,105,114, 91, 49, 54, 48, 93, 0,112,108,117,103,116,101,120,100,105,114, 91, 49, 54, - 48, 93, 0,112,108,117,103,115,101,113,100,105,114, 91, 49, 54, 48, 93, 0,112,121,116,104,111,110,100,105,114, 91, 49, 54, 48, - 93, 0,115,111,117,110,100,100,105,114, 91, 49, 54, 48, 93, 0,121,102,101,120,112,111,114,116,100,105,114, 91, 49, 54, 48, 93, - 0,118,101,114,115,105,111,110,115, 0,118,114,109,108,102,108, 97,103, 0,103, 97,109,101,102,108, 97,103,115, 0,119,104,101, -101,108,108,105,110,101,115, 99,114,111,108,108, 0,117,105,102,108, 97,103, 0,108, 97,110,103,117, 97,103,101, 0,117,115,101, -114,112,114,101,102, 0,118,105,101,119,122,111,111,109, 0, 99,111,110,115,111,108,101, 95, 98,117,102,102,101,114, 0, 99,111, -110,115,111,108,101, 95,111,117,116, 0,109,105,120, 98,117,102,115,105,122,101, 0,102,111,110,116,115,105,122,101, 0,101,110, - 99,111,100,105,110,103, 0,116,114, 97,110,115,111,112,116,115, 0,109,101,110,117,116,104,114,101,115,104,111,108,100, 49, 0, -109,101,110,117,116,104,114,101,115,104,111,108,100, 50, 0,102,111,110,116,110, 97,109,101, 91, 50, 53, 54, 93, 0,116,104,101, -109,101,115, 0,117,110,100,111,115,116,101,112,115, 0, 99,117,114,115,115,105,122,101, 0,116, 98, 95,108,101,102,116,109,111, -117,115,101, 0,116, 98, 95,114,105,103,104,116,109,111,117,115,101, 0,108,105,103,104,116, 91, 51, 93, 0,116,119, 95,104,111, -116,115,112,111,116, 0,116,119, 95,102,108, 97,103, 0,116,119, 95,104, 97,110,100,108,101,115,105,122,101, 0,116,119, 95,115, -105,122,101, 0,116,101,120,116,105,109,101,111,117,116, 0,116,101,120, 99,111,108,108,101, 99,116,114, 97,116,101, 0,109,101, -109, 99, 97, 99,104,101,108,105,109,105,116, 0,112,114,101,102,101,116, 99,104,102,114, 97,109,101,115, 0,102,114, 97,109,101, -115,101,114,118,101,114,112,111,114,116, 0,112, 97,100, 95,114,111,116, 95, 97,110,103,108,101, 0,111, 98, 99,101,110,116,101, -114, 95,100,105, 97, 0,114,118,105,115,105,122,101, 0,114,118,105, 98,114,105,103,104,116, 0,114,101, 99,101,110,116, 95,102, -105,108,101,115, 0,115,109,111,111,116,104, 95,118,105,101,119,116,120, 0,103,108,114,101,115,108,105,109,105,116, 0,118,101, -114,115,101,109, 97,115,116,101,114, 91, 49, 54, 48, 93, 0,118,101,114,115,101,117,115,101,114, 91, 49, 54, 48, 93, 0,103,108, - 97,108,112,104, 97, 99,108,105,112, 0, 99,111, 98, 97, 95,119,101,105,103,104,116, 0,118,101,114,116, 98, 97,115,101, 0,101, -100,103,101, 98, 97,115,101, 0, 97,114,101, 97, 98, 97,115,101, 0, 42,115, 99,101,110,101, 0,101,110,100,120, 0,101,110,100, -121, 0,115,105,122,101,120, 0,115,105,122,101,121, 0,115, 99,101,110,101,110,114, 0,115, 99,114,101,101,110,110,114, 0,102, -117,108,108, 0,109, 97,105,110,119,105,110, 0,119,105,110, 97,107,116, 0,104, 97,110,100,108,101,114, 91, 56, 93, 0, 42,110, -101,119,118, 0,118,101, 99, 0, 42,118, 49, 0, 42,118, 50, 0,112, 97,110,101,108,110, 97,109,101, 91, 54, 52, 93, 0,116, 97, - 98,110, 97,109,101, 91, 54, 52, 93, 0,100,114, 97,119,110, 97,109,101, 91, 54, 52, 93, 0,111,102,115,120, 0,111,102,115,121, - 0, 99,111,110,116,114,111,108, 0,115,110, 97,112, 0,111,108,100, 95,111,102,115,120, 0,111,108,100, 95,111,102,115,121, 0, -115,111,114,116, 99,111,117,110,116,101,114, 0, 42,112, 97,110,101,108,116, 97, 98, 0, 42,118, 51, 0, 42,118, 52, 0, 42,102, -117,108,108, 0,119,105,110,109, 97,116, 91, 52, 93, 91, 52, 93, 0,104,101, 97,100,114, 99,116, 0,119,105,110,114, 99,116, 0, -104,101, 97,100,119,105,110, 0,119,105,110, 0,104,101, 97,100,101,114,116,121,112,101, 0, 98,117,116,115,112, 97, 99,101,116, -121,112,101, 0,119,105,110,120, 0,119,105,110,121, 0,104,101, 97,100, 95,115,119, 97,112, 0,104,101, 97,100, 95,101,113,117, - 97,108, 0,119,105,110, 95,115,119, 97,112, 0,119,105,110, 95,101,113,117, 97,108, 0,104,101, 97,100, 98,117,116,108,101,110, - 0,104,101, 97,100, 98,117,116,111,102,115, 0, 99,117,114,115,111,114, 0,115,112, 97, 99,101,100, 97,116, 97, 0,117,105, 98, -108,111, 99,107,115, 0,112, 97,110,101,108,115, 0,115,117, 98,118,115,116,114, 91, 52, 93, 0,115,117, 98,118,101,114,115,105, -111,110, 0,112, 97,100,115, 0,109,105,110,118,101,114,115,105,111,110, 0,109,105,110,115,117, 98,118,101,114,115,105,111,110, - 0,100,105,115,112,108, 97,121,109,111,100,101, 0, 42, 99,117,114,115, 99,114,101,101,110, 0, 42, 99,117,114,115, 99,101,110, -101, 0,102,105,108,101,102,108, 97,103,115, 0,103,108,111, 98, 97,108,102, 0,110, 97,109,101, 91, 56, 48, 93, 0, 42,105, 98, -117,102, 0, 42,115,101, 49, 0, 42,115,101, 50, 0, 42,115,101, 51, 0,110,114, 0,100,111,110,101, 0, 42,115,116,114,105,112, -100, 97,116, 97, 0,111,114,120, 0,111,114,121, 0, 42,116,115,116,114,105,112,100, 97,116, 97, 0, 42,105,110,115,116, 97,110, - 99,101, 95,112,114,105,118, 97,116,101, 95,100, 97,116, 97, 0, 42, 42, 99,117,114,114,101,110,116, 95,112,114,105,118, 97,116, -101, 95,100, 97,116, 97, 0, 42,116,109,112, 0,115,116, 97,114,116,111,102,115, 0,101,110,100,111,102,115, 0,115,116, 97,114, -116,115,116,105,108,108, 0,101,110,100,115,116,105,108,108, 0,109, 97, 99,104,105,110,101, 0,115,116, 97,114,116,100,105,115, -112, 0,101,110,100,100,105,115,112, 0,109,117,108, 0,104, 97,110,100,115,105,122,101, 0, 42,115,116,114,105,112, 0,102, 97, - 99,102, 48, 0,102, 97, 99,102, 49, 0, 42,115,101,113, 49, 0, 42,115,101,113, 50, 0, 42,115,101,113, 51, 0,115,101,113, 98, - 97,115,101, 0, 42,115,111,117,110,100, 0, 42,104,100, 97,117,100,105,111, 0,108,101,118,101,108, 0,112, 97,110, 0, 99,117, -114,112,111,115, 0,115,116,114,111, 98,101, 0, 42,101,102,102,101, 99,116,100, 97,116, 97, 0, 97,110,105,109, 95,112,114,101, -115,101,101,107, 0, 42,111,108,100, 98, 97,115,101,112, 0, 42,112, 97,114,115,101,113, 0, 42,115,101,113, 98, 97,115,101,112, - 0,109,101,116, 97,115,116, 97, 99,107, 0,101,100,103,101, 87,105,100,116,104, 0,102,111,114,119, 97,114,100, 0,119,105,112, -101,116,121,112,101, 0,102, 77,105,110,105, 0,102, 67,108, 97,109,112, 0,102, 66,111,111,115,116, 0,100, 68,105,115,116, 0, -100, 81,117, 97,108,105,116,121, 0, 98, 78,111, 67,111,109,112, 0, 83, 99, 97,108,101,120, 73,110,105, 0, 83, 99, 97,108,101, -121, 73,110,105, 0, 83, 99, 97,108,101,120, 70,105,110, 0, 83, 99, 97,108,101,121, 70,105,110, 0,120, 73,110,105, 0,120, 70, -105,110, 0,121, 73,110,105, 0,121, 70,105,110, 0,114,111,116, 73,110,105, 0,114,111,116, 70,105,110, 0,105,110,116,101,114, -112,111,108, 97,116,105,111,110, 0, 42,102,114, 97,109,101, 77, 97,112, 0,103,108,111, 98, 97,108, 83,112,101,101,100, 0,108, - 97,115,116, 86, 97,108,105,100, 70,114, 97,109,101, 0, 98,117,116,116,121,112,101, 0,117,115,101,114,106,105,116, 0,115,116, - 97, 0,101,110,100, 0,116,111,116,112, 97,114,116, 0,110,111,114,109,102, 97, 99, 0,111, 98,102, 97, 99, 0,114, 97,110,100, -102, 97, 99, 0,116,101,120,102, 97, 99, 0,114, 97,110,100,108,105,102,101, 0,102,111,114, 99,101, 91, 51, 93, 0,118,101, 99, -116,115,105,122,101, 0,109, 97,120,108,101,110, 0,100,101,102,118,101, 99, 91, 51, 93, 0,109,117,108,116, 91, 52, 93, 0,108, -105,102,101, 91, 52, 93, 0, 99,104,105,108,100, 91, 52, 93, 0,109, 97,116, 91, 52, 93, 0,116,101,120,109, 97,112, 0, 99,117, -114,109,117,108,116, 0,115,116, 97,116,105, 99,115,116,101,112, 0,111,109, 97,116, 0,116,105,109,101,116,101,120, 0,115,112, -101,101,100,116,101,120, 0,102,108, 97,103, 50,110,101,103, 0,118,101,114,116,103,114,111,117,112, 95,118, 0,118,103,114,111, -117,112,110, 97,109,101, 91, 51, 50, 93, 0,118,103,114,111,117,112,110, 97,109,101, 95,118, 91, 51, 50, 93, 0, 42,107,101,121, -115, 0,109,105,110,102, 97, 99, 0,117,115,101,100, 0,117,115,101,100,101,108,101,109, 0,100,120, 0,100,121, 0,108,105,110, -107, 0,111,116,121,112,101, 0,111,108,100, 0, 42,112,111,105,110, 0, 42,111,108,100,112,111,105,110, 0,114,101,115,101,116, -100,105,115,116, 0,108, 97,115,116,118, 97,108, 0, 42,109, 97, 0,107,101,121, 0,113,117, 97,108, 0,113,117, 97,108, 50, 0, -116, 97,114,103,101,116, 78, 97,109,101, 91, 51, 50, 93, 0,116,111,103,103,108,101, 78, 97,109,101, 91, 51, 50, 93, 0,118, 97, -108,117,101, 91, 51, 50, 93, 0,109, 97,120,118, 97,108,117,101, 91, 51, 50, 93, 0,109, 97,116,101,114,105, 97,108, 78, 97,109, -101, 91, 51, 50, 93, 0,100, 97,109,112,116,105,109,101,114, 0,100,101,108, 97,121, 0,112,114,111,112,110, 97,109,101, 91, 51, - 50, 93, 0,109, 97,116,110, 97,109,101, 91, 51, 50, 93, 0, 97,120,105,115,102,108, 97,103, 0, 42,102,114,111,109, 79, 98,106, -101, 99,116, 0,115,117, 98,106,101, 99,116, 91, 51, 50, 93, 0, 98,111,100,121, 91, 51, 50, 93, 0,112,117,108,115,101, 0,102, -114,101,113, 0,116,111,116,108,105,110,107,115, 0, 42, 42,108,105,110,107,115, 0,102,114,101,113, 50, 0, 97,120,105,115,102, - 0, 98,117,116,116,111,110, 0, 98,117,116,116,111,110,102, 0,104, 97,116, 0,104, 97,116,102, 0,112,114,101, 99,105,115,105, -111,110, 0,115,116,114, 91, 49, 50, 56, 93, 0, 42,109,121,110,101,119, 0,105,110,112,117,116,115, 0,116,111,116,115,108,105, -110,107,115, 0, 42, 42,115,108,105,110,107,115, 0,118, 97,108,111, 0,116,105,109,101, 0, 42, 97, 99,116, 0, 98,108,101,110, -100,105,110, 0,112,114,105,111,114,105,116,121, 0,115,116,114,105,100,101, 97,120,105,115, 0,115,116,114,105,100,101,108,101, -110,103,116,104, 0,115,110,100,110,114, 0,112, 97,100, 49, 91, 50, 93, 0,109, 97,107,101, 99,111,112,121, 0, 99,111,112,121, -109, 97,100,101, 0,112, 97,100, 50, 91, 49, 93, 0,116,114, 97, 99,107, 0,118,111,108,117,109,101, 0, 42,109,101, 0,108,105, -110, 86,101,108,111, 99,105,116,121, 91, 51, 93, 0,108,111, 99, 97,108,102,108, 97,103, 0,102,111,114, 99,101,108,111, 99, 91, - 51, 93, 0,102,111,114, 99,101,114,111,116, 91, 51, 93, 0,108,105,110,101, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, - 0, 97,110,103,117,108, 97,114,118,101,108,111, 99,105,116,121, 91, 51, 93, 0, 98,117,116,115,116, 97, 0, 98,117,116,101,110, -100, 0,109,105,110, 0,109, 97,120, 0,118,105,115,105,102, 97, 99, 0,115,108,111,119, 0,109,105,110,108,111, 99, 91, 51, 93, - 0,109, 97,120,108,111, 99, 91, 51, 93, 0,109,105,110,114,111,116, 91, 51, 93, 0,109, 97,120,114,111,116, 91, 51, 93, 0,100, -105,115,116,114,105, 98,117,116,105,111,110, 0,105,110,116, 95, 97,114,103, 95, 49, 0,105,110,116, 95, 97,114,103, 95, 50, 0, -102,108,111, 97,116, 95, 97,114,103, 95, 49, 0,102,108,111, 97,116, 95, 97,114,103, 95, 50, 0,116,111, 80,114,111,112, 78, 97, -109,101, 91, 51, 50, 93, 0, 42,116,111, 79, 98,106,101, 99,116, 0, 98,111,100,121, 84,121,112,101, 0,102,105,108,101,110, 97, -109,101, 91, 54, 52, 93, 0,108,111, 97,100, 97,110,105,110, 97,109,101, 91, 54, 52, 93, 0,103,111, 0, 97, 99, 99,101,108,108, -101,114, 97,116,105,111,110, 0,109, 97,120,115,112,101,101,100, 0,109, 97,120,114,111,116,115,112,101,101,100, 0,109, 97,120, -116,105,108,116,115,112,101,101,100, 0,114,111,116,100, 97,109,112, 0,116,105,108,116,100, 97,109,112, 0,115,112,101,101,100, -100, 97,109,112, 0, 42,115, 97,109,112,108,101, 0, 42,115,116,114,101, 97,109, 0, 42,110,101,119,112, 97, 99,107,101,100,102, -105,108,101, 0, 42,115,110,100, 95,115,111,117,110,100, 0,112, 97,110,110,105,110,103, 0, 97,116,116,101,110,117, 97,116,105, -111,110, 0,112,105,116, 99,104, 0,109,105,110, 95,103, 97,105,110, 0,109, 97,120, 95,103, 97,105,110, 0,100,105,115,116, 97, -110, 99,101, 0,115,116,114,101, 97,109,108,101,110, 0, 99,104, 97,110,110,101,108,115, 0,104,105,103,104,112,114,105,111, 0, -112, 97,100, 91, 49, 48, 93, 0,103, 97,105,110, 0,100,111,112,112,108,101,114,102, 97, 99,116,111,114, 0,100,111,112,112,108, -101,114,118,101,108,111, 99,105,116,121, 0,110,117,109,115,111,117,110,100,115, 98,108,101,110,100,101,114, 0,110,117,109,115, -111,117,110,100,115,103, 97,109,101,101,110,103,105,110,101, 0, 42,108, 97,109,112,114,101,110, 0,103,111, 98,106,101, 99,116, - 0, 99,104,105,108,100, 98, 97,115,101, 0,114,111,108,108, 0,104,101, 97,100, 91, 51, 93, 0,116, 97,105,108, 91, 51, 93, 0, - 98,111,110,101, 95,109, 97,116, 91, 51, 93, 91, 51, 93, 0, 97,114,109, 95,104,101, 97,100, 91, 51, 93, 0, 97,114,109, 95,116, - 97,105,108, 91, 51, 93, 0, 97,114,109, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,120,119,105,100,116,104, 0,122,119,105,100, -116,104, 0,101, 97,115,101, 49, 0,101, 97,115,101, 50, 0,114, 97,100, 95,104,101, 97,100, 0,114, 97,100, 95,116, 97,105,108, - 0, 98,111,110,101, 98, 97,115,101, 0, 99,104, 97,105,110, 98, 97,115,101, 0,112, 97,116,104,102,108, 97,103, 0,108, 97,121, -101,114, 95,112,114,111,116,101, 99,116,101,100, 0,103,104,111,115,116,101,112, 0,103,104,111,115,116,115,105,122,101, 0,103, -104,111,115,116,116,121,112,101, 0,112, 97,116,104,115,105,122,101, 0,103,104,111,115,116,115,102, 0,103,104,111,115,116,101, -102, 0,112, 97,116,104,115,102, 0,112, 97,116,104,101,102, 0,112, 97,116,104, 98, 99, 0,112, 97,116,104, 97, 99, 0, 99,111, -110,115,116,102,108, 97,103, 0,105,107,102,108, 97,103, 0,115,101,108,101, 99,116,102,108, 97,103, 0, 42, 98,111,110,101, 0, - 42, 99,104,105,108,100, 0,105,107,116,114,101,101, 0, 42, 98, 95, 98,111,110,101, 95,109, 97,116,115, 0, 42,100,117, 97,108, - 95,113,117, 97,116, 0, 42, 98, 95, 98,111,110,101, 95,100,117, 97,108, 95,113,117, 97,116,115, 0, 99,104, 97,110, 95,109, 97, -116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,109, 97,116, 91, 52, 93, 91, 52, 93, 0,112,111,115,101, 95,104,101, 97,100, - 91, 51, 93, 0,112,111,115,101, 95,116, 97,105,108, 91, 51, 93, 0,108,105,109,105,116,109,105,110, 91, 51, 93, 0,108,105,109, -105,116,109, 97,120, 91, 51, 93, 0,115,116,105,102,102,110,101,115,115, 91, 51, 93, 0,105,107,115,116,114,101,116, 99,104, 0, - 42, 99,117,115,116,111,109, 0, 99,104, 97,110, 98, 97,115,101, 0,112,114,111,120,121, 95,108, 97,121,101,114, 0,115,116,114, -105,100,101, 95,111,102,102,115,101,116, 91, 51, 93, 0, 99,121, 99,108,105, 99, 95,111,102,102,115,101,116, 91, 51, 93, 0,114, -101,115,101,114,118,101,100, 49, 0, 97, 99,116,110,114, 0, 97, 99,116,119,105,100,116,104, 0,116,105,109,101,115,108,105,100, -101, 0,110, 97,109,101, 91, 51, 48, 93, 0,111,119,110,115,112, 97, 99,101, 0,116, 97,114,115,112, 97, 99,101, 0,101,110,102, -111,114, 99,101, 0,104,101, 97,100,116, 97,105,108, 0, 42,116, 97,114, 0,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, - 0,109, 97,116,114,105,120, 91, 52, 93, 91, 52, 93, 0,115,112, 97, 99,101, 0, 42,112,114,111,112, 0,116, 97,114,110,117,109, - 0,116, 97,114,103,101,116,115, 0,105,116,101,114, 97,116,105,111,110,115, 0,114,111,111,116, 98,111,110,101, 0, 42,112,111, -108,101,116, 97,114, 0,112,111,108,101,115,117, 98,116, 97,114,103,101,116, 91, 51, 50, 93, 0,112,111,108,101, 97,110,103,108, -101, 0,111,114,105,101,110,116,119,101,105,103,104,116, 0,103,114, 97, 98,116, 97,114,103,101,116, 91, 51, 93, 0,114,101,115, -101,114,118,101,100, 50, 0,109,105,110,109, 97,120,102,108, 97,103, 0,115,116,117, 99,107, 0, 99, 97, 99,104,101, 91, 51, 93, - 0,108,111, 99,107,102,108, 97,103, 0,102,111,108,108,111,119,102,108, 97,103, 0,118,111,108,109,111,100,101, 0,112,108, 97, -110,101, 0,111,114,103,108,101,110,103,116,104, 0, 98,117,108,103,101, 0,112,105,118, 88, 0,112,105,118, 89, 0,112,105,118, - 90, 0, 97,120, 88, 0, 97,120, 89, 0, 97,120, 90, 0,109,105,110, 76,105,109,105,116, 91, 54, 93, 0,109, 97,120, 76,105,109, -105,116, 91, 54, 93, 0,101,120,116,114, 97, 70,122, 0,105,110,118,109, 97,116, 91, 52, 93, 91, 52, 93, 0,102,114,111,109, 0, -116,111, 0,109, 97,112, 91, 51, 93, 0,101,120,112,111, 0,102,114,111,109, 95,109,105,110, 91, 51, 93, 0,102,114,111,109, 95, -109, 97,120, 91, 51, 93, 0,116,111, 95,109,105,110, 91, 51, 93, 0,116,111, 95,109, 97,120, 91, 51, 93, 0,122,109,105,110, 0, -122,109, 97,120, 0, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,110,111, 95,114,111,116, 95, 97,120,105,115, 0,115,116,114, -105,100,101, 95, 97,120,105,115, 0, 99,117,114,109,111,100, 0, 97, 99,116,115,116, 97,114,116, 0, 97, 99,116,101,110,100, 0, - 97, 99,116,111,102,102,115, 0,115,116,114,105,100,101,108,101,110, 0, 98,108,101,110,100,111,117,116, 0,115,116,114,105,100, -101, 99,104, 97,110,110,101,108, 91, 51, 50, 93, 0,111,102,102,115, 95, 98,111,110,101, 91, 51, 50, 93, 0,104, 97,115,105,110, -112,117,116, 0,104, 97,115,111,117,116,112,117,116, 0,100, 97,116, 97,116,121,112,101, 0,115,111, 99,107,101,116,116,121,112, -101, 0,110,115, 0,108,105,109,105,116, 0,115,116, 97, 99,107, 95,105,110,100,101,120, 0,105,110,116,101,114,110, 0,115,116, - 97, 99,107, 95,105,110,100,101,120, 95,101,120,116, 0,108,111, 99,120, 0,108,111, 99,121, 0,111,119,110, 95,105,110,100,101, -120, 0,116,111, 95,105,110,100,101,120, 0, 42,116,111,115,111, 99,107, 0, 42,108,105,110,107, 0, 42,110,101,119, 95,110,111, -100,101, 0,108, 97,115,116,121, 0,111,117,116,112,117,116,115, 0, 42,115,116,111,114, 97,103,101, 0,109,105,110,105,119,105, -100,116,104, 0, 99,117,115,116,111,109, 49, 0, 99,117,115,116,111,109, 50, 0,110,101,101,100, 95,101,120,101, 99, 0,101,120, -101, 99, 0,116,111,116,114, 0, 98,117,116,114, 0,112,114,118,114, 0, 42,116,121,112,101,105,110,102,111, 0, 42,102,114,111, -109,110,111,100,101, 0, 42,116,111,110,111,100,101, 0, 42,102,114,111,109,115,111, 99,107, 0,110,111,100,101,115, 0,108,105, -110,107,115, 0, 42, 42,115,116, 97, 99,107, 0,105,110,105,116, 0,115,116, 97, 99,107,115,105,122,101, 0, 99,117,114, 95,105, -110,100,101,120, 0, 97,108,108,116,121,112,101,115, 0, 42,111,119,110,116,121,112,101, 0, 40, 42,116,105,109,101, 99,117,114, -115,111,114, 41, 40, 41, 0, 40, 42,115,116, 97,116,115, 95,100,114, 97,119, 41, 40, 41, 0, 40, 42,116,101,115,116, 95, 98,114, -101, 97,107, 41, 40, 41, 0, 99,121, 99,108,105, 99, 0,109,111,118,105,101, 0,115, 97,109,112,108,101,115, 0,109,105,110,115, -112,101,101,100, 0, 98,111,107,101,104, 0,104,117,101, 0,115, 97,116, 0,116, 49, 0,116, 50, 0,116, 51, 0,102,115,116,114, -101,110,103,116,104, 0,102, 97,108,112,104, 97, 0,107,101,121, 91, 52, 93, 0,120, 49, 0,120, 50, 0,121, 49, 0,121, 50, 0, - 99,111,108,110, 97,109,101, 91, 51, 50, 93, 0, 98,107,116,121,112,101, 0,114,111,116, 97,116,105,111,110, 0,112,114,101,118, -105,101,119, 0,103, 97,109, 99,111, 0,110,111, 95,122, 98,117,102, 0,102,115,116,111,112, 0,109, 97,120, 98,108,117,114, 0, - 98,116,104,114,101,115,104, 0,105,116,101,114, 0, 97,110,103,108,101, 95,111,102,115, 0, 99,111,108,109,111,100, 0,109,105, -120, 0,116,104,114,101,115,104,111,108,100, 0,102, 97,100,101, 0,109, 0, 99, 0,106,105,116, 0,112,114,111,106, 0,102,105, -116, 0,115,104,111,114,116,121, 0,109,105,110,116, 97, 98,108,101, 0,109, 97,120,116, 97, 98,108,101, 0,101,120,116, 95,105, -110, 91, 50, 93, 0,101,120,116, 95,111,117,116, 91, 50, 93, 0, 42, 99,117,114,118,101, 0, 42,116, 97, 98,108,101, 0, 42,112, -114,101,109,117,108,116, 97, 98,108,101, 0, 99,117,114,114, 0, 99,108,105,112,114, 0, 99,109, 91, 52, 93, 0, 98,108, 97, 99, -107, 91, 51, 93, 0,119,104,105,116,101, 91, 51, 93, 0, 98,119,109,117,108, 91, 51, 93, 0,111,102,102,115,101,116, 91, 50, 93, - 0,105,110,110,101,114,114, 97,100,105,117,115, 0,114, 97,116,101, 0,114,103, 98, 91, 51, 93, 0, 99,108,111,110,101, 0, 97, - 99,116,105,118,101, 95,114,110,100, 0,112, 97,100, 91, 52, 93, 0, 42,108, 97,121,101,114,115, 0,116,111,116,108, 97,121,101, -114, 0,109, 97,120,108, 97,121,101,114, 0,116,111,116,115,105,122,101, 0,101,100,105,116,102,108, 97,103, 0,118,101,108, 91, - 51, 93, 0,114,111,116, 91, 52, 93, 0, 97,118,101, 91, 51, 93, 0,110,117,109, 0,112, 97,114,101,110,116, 0,112, 97, 91, 52, - 93, 0,119, 91, 52, 93, 0,102,117,118, 91, 52, 93, 0,102,111,102,102,115,101,116, 0,114, 97,110,100, 91, 51, 93, 0, 42,115, -116,105, 99,107, 95,111, 98, 0,115,116, 97,116,101, 0, 42,104, 97,105,114, 0,105, 95,114,111,116, 91, 52, 93, 0,114, 95,114, -111,116, 91, 52, 93, 0,114, 95, 97,118,101, 91, 51, 93, 0,114, 95,118,101, 91, 51, 93, 0,100,105,101,116,105,109,101, 0, 98, - 97,110,107, 0,115,105,122,101,109,117,108, 0,110,117,109, 95,100,109, 99, 97, 99,104,101, 0, 98,112,105, 0, 97,108,105,118, -101, 0,108,111,111,112, 0,100,105,115,116,114, 0,112,104,121,115,116,121,112,101, 0,114,111,116,109,111,100,101, 0, 97,118, -101,109,111,100,101, 0,114,101, 97, 99,116,101,118,101,110,116, 0,100,114, 97,119, 0,100,114, 97,119, 95, 97,115, 0,100,114, - 97,119, 95,115,105,122,101, 0, 99,104,105,108,100,116,121,112,101, 0,100,114, 97,119, 95,115,116,101,112, 0,114,101,110, 95, -115,116,101,112, 0,104, 97,105,114, 95,115,116,101,112, 0,107,101,121,115, 95,115,116,101,112, 0, 97,100, 97,112,116, 95, 97, -110,103,108,101, 0, 97,100, 97,112,116, 95,112,105,120, 0,114,111,116,102,114,111,109, 0,105,110,116,101,103,114, 97,116,111, -114, 0,110, 98,101,116,119,101,101,110, 0, 98,111,105,100,110,101,105,103,104, 98,111,117,114,115, 0, 98, 98, 95, 97,108,105, -103,110, 0, 98, 98, 95,117,118, 95,115,112,108,105,116, 0, 98, 98, 95, 97,110,105,109, 0, 98, 98, 95,115,112,108,105,116, 95, -111,102,102,115,101,116, 0, 98, 98, 95,116,105,108,116, 0, 98, 98, 95,114, 97,110,100, 95,116,105,108,116, 0, 98, 98, 95,111, -102,102,115,101,116, 91, 50, 93, 0,116,105,109,101,116,119,101, 97,107, 0,106,105,116,102, 97, 99, 0,107,101,121,101,100, 95, -116,105,109,101, 0,103,114,105,100, 95,114,101,115, 0,112, 97,114,116,102, 97, 99, 0,116, 97,110,102, 97, 99, 0,116, 97,110, -112,104, 97,115,101, 0,114,101, 97, 99,116,102, 97, 99, 0,114,111,116,102, 97, 99, 0, 97,118,101,102, 97, 99, 0,112,104, 97, -115,101,102, 97, 99, 0,114, 97,110,100,115,105,122,101, 0,114,101, 97, 99,116,115,104, 97,112,101, 0, 97, 99, 99, 91, 51, 93, - 0,100,114, 97,103,102, 97, 99, 0, 98,114,111,119,110,102, 97, 99, 0,100, 97,109,112,102, 97, 99, 0, 97, 98,115,108,101,110, -103,116,104, 0,114, 97,110,100,108,101,110,103,116,104, 0, 99,104,105,108,100, 95,110, 98,114, 0,112, 97,114,101,110,116,115, - 0, 99,104,105,108,100,115,105,122,101, 0, 99,104,105,108,100,114, 97,110,100,115,105,122,101, 0, 99,104,105,108,100,114, 97, -100, 0, 99,104,105,108,100,102,108, 97,116, 0, 99,104,105,108,100,115,112,114,101, 97,100, 0, 99,108,117,109,112,102, 97, 99, - 0, 99,108,117,109,112,112,111,119, 0,114,111,117,103,104, 49, 0,114,111,117,103,104, 49, 95,115,105,122,101, 0,114,111,117, -103,104, 50, 0,114,111,117,103,104, 50, 95,115,105,122,101, 0,114,111,117,103,104, 50, 95,116,104,114,101,115, 0,114,111,117, -103,104, 95,101,110,100, 0,114,111,117,103,104, 95,101,110,100, 95,115,104, 97,112,101, 0, 98,114, 97,110, 99,104, 95,116,104, -114,101,115, 0,100,114, 97,119, 95,108,105,110,101, 91, 50, 93, 0,109, 97,120, 95,118,101,108, 0,109, 97,120, 95,108, 97,116, - 95, 97, 99, 99, 0,109, 97,120, 95,116, 97,110, 95, 97, 99, 99, 0, 97,118,101,114, 97,103,101, 95,118,101,108, 0, 98, 97,110, -107,105,110,103, 0,109, 97,120, 95, 98, 97,110,107, 0,103,114,111,117,110,100,122, 0, 98,111,105,100,102, 97, 99, 91, 56, 93, - 0, 98,111,105,100,114,117,108,101, 91, 56, 93, 0, 42,101,102,102, 95,103,114,111,117,112, 0, 42,100,117,112, 95,111, 98, 0, - 42, 98, 98, 95,111, 98, 0, 42,112, 97,114,116, 0, 42,101,100,105,116, 0, 42, 42,112, 97,116,104, 99, 97, 99,104,101, 0, 42, - 42, 99,104,105,108,100, 99, 97, 99,104,101, 0, 42,116, 97,114,103,101,116, 95,111, 98, 0, 42,107,101,121,101,100, 95,111, 98, - 0, 42,108, 97,116,116,105, 99,101, 0,101,102,102,101, 99,116,111,114,115, 0,114,101, 97, 99,116,101,118,101,110,116,115, 0, -116,111,116, 99,104,105,108,100, 0,116,111,116, 99, 97, 99,104,101,100, 0,116,111,116, 99,104,105,108,100, 99, 97, 99,104,101, - 0,116, 97,114,103,101,116, 95,112,115,121,115, 0,107,101,121,101,100, 95,112,115,121,115, 0,116,111,116,107,101,121,101,100, - 0, 98, 97,107,101,115,112, 97, 99,101, 0, 98, 98, 95,117,118,110, 97,109,101, 91, 51, 93, 91, 51, 50, 93, 0,118,103,114,111, -117,112, 91, 49, 49, 93, 0,118,103, 95,110,101,103, 0,114,116, 51, 91, 50, 93, 0, 0, 0, 0, 84, 89, 80, 69, 50, 1, 0, 0, - 99,104, 97,114, 0,117, 99,104, 97,114, 0,115,104,111,114,116, 0,117,115,104,111,114,116, 0,105,110,116, 0,108,111,110,103, - 0,117,108,111,110,103, 0,102,108,111, 97,116, 0,100,111,117, 98,108,101, 0,118,111,105,100, 0, 76,105,110,107, 0, 76,105, -115,116, 66, 97,115,101, 0,118,101, 99, 50,115, 0,118,101, 99, 50,105, 0,118,101, 99, 50,102, 0,118,101, 99, 50,100, 0,118, -101, 99, 51,105, 0,118,101, 99, 51,102, 0,118,101, 99, 51,100, 0,118,101, 99, 52,105, 0,118,101, 99, 52,102, 0,118,101, 99, - 52,100, 0,114, 99,116,105, 0,114, 99,116,102, 0, 73, 68, 80,114,111,112,101,114,116,121, 68, 97,116, 97, 0, 73, 68, 80,114, -111,112,101,114,116,121, 0, 73, 68, 0, 76,105, 98,114, 97,114,121, 0, 70,105,108,101, 68, 97,116, 97, 0, 80,114,101,118,105, -101,119, 73,109, 97,103,101, 0, 73,112,111, 0, 75,101,121, 66,108,111, 99,107, 0, 75,101,121, 0, 83, 99,114,105,112,116, 76, -105,110,107, 0, 84,101,120,116, 76,105,110,101, 0, 84,101,120,116, 0, 80, 97, 99,107,101,100, 70,105,108,101, 0, 67, 97,109, -101,114, 97, 0, 79, 98,106,101, 99,116, 0, 73,109, 97,103,101, 85,115,101,114, 0, 73,109, 97,103,101, 0, 97,110,105,109, 0, - 82,101,110,100,101,114, 82,101,115,117,108,116, 0, 77, 84,101,120, 0, 84,101,120, 0, 80,108,117,103,105,110, 84,101,120, 0, - 67, 66, 68, 97,116, 97, 0, 67,111,108,111,114, 66, 97,110,100, 0, 69,110,118, 77, 97,112, 0, 73,109, 66,117,102, 0, 84,101, -120, 77, 97,112,112,105,110,103, 0, 76, 97,109,112, 0, 67,117,114,118,101, 77, 97,112,112,105,110,103, 0, 87, 97,118,101, 0, - 77, 97,116,101,114,105, 97,108, 0, 98, 78,111,100,101, 84,114,101,101, 0, 71,114,111,117,112, 0, 86, 70,111,110,116, 0, 86, - 70,111,110,116, 68, 97,116, 97, 0, 77,101,116, 97, 69,108,101,109, 0, 66,111,117,110,100, 66,111,120, 0, 77,101,116, 97, 66, - 97,108,108, 0, 66,101,122, 84,114,105,112,108,101, 0, 66, 80,111,105,110,116, 0, 78,117,114, 98, 0, 67,104, 97,114, 73,110, -102,111, 0, 84,101,120,116, 66,111,120, 0, 67,117,114,118,101, 0, 80, 97,116,104, 0, 73,112,111, 68,114,105,118,101,114, 0, - 73,112,111, 67,117,114,118,101, 0, 77,101,115,104, 0, 77, 70, 97, 99,101, 0, 77, 84, 70, 97, 99,101, 0, 84, 70, 97, 99,101, - 0, 77, 86,101,114,116, 0, 77, 69,100,103,101, 0, 77, 68,101,102,111,114,109, 86,101,114,116, 0, 77, 67,111,108, 0, 77, 83, -116,105, 99,107,121, 0, 77, 83,101,108,101, 99,116, 0, 67,117,115,116,111,109, 68, 97,116, 97, 0, 77,117,108,116,105,114,101, -115, 0, 80, 97,114,116,105, 97,108, 86,105,115,105, 98,105,108,105,116,121, 0, 77, 68,101,102,111,114,109, 87,101,105,103,104, -116, 0, 77, 70,108,111, 97,116, 80,114,111,112,101,114,116,121, 0, 77, 73,110,116, 80,114,111,112,101,114,116,121, 0, 77, 83, -116,114,105,110,103, 80,114,111,112,101,114,116,121, 0, 79,114,105,103, 83,112, 97, 99,101, 70, 97, 99,101, 0, 77,117,108,116, -105,114,101,115, 67,111,108, 0, 77,117,108,116,105,114,101,115, 67,111,108, 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, - 70, 97, 99,101, 0, 77,117,108,116,105,114,101,115, 69,100,103,101, 0, 77,117,108,116,105,114,101,115, 76,101,118,101,108, 0, - 77,117,108,116,105,114,101,115, 77, 97,112, 78,111,100,101, 0, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83,117, 98, -115,117,114,102, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116,116,105, 99,101, 77,111,100,105,102,105,101,114, - 68, 97,116, 97, 0, 67,117,114,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,117,105,108,100, 77,111,100,105, -102,105,101,114, 68, 97,116, 97, 0, 65,114,114, 97,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 77,105,114,114,111, -114, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 69,100,103,101, 83,112,108,105,116, 77,111,100,105,102,105,101,114, 68, - 97,116, 97, 0, 68,105,115,112,108, 97, 99,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 85, 86, 80,114,111,106,101, - 99,116, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 68,101, 99,105,109, 97,116,101, 77,111,100,105,102,105,101,114, 68, - 97,116, 97, 0, 83,109,111,111,116,104, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 67, 97,115,116, 77,111,100,105,102, -105,101,114, 68, 97,116, 97, 0, 87, 97,118,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 65,114,109, 97,116,117,114, -101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 72,111,111,107, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 83, -111,102,116, 98,111,100,121, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 66,111,111,108,101, 97,110, 77,111,100,105,102, -105,101,114, 68, 97,116, 97, 0, 77, 68,101,102, 73,110,102,108,117,101,110, 99,101, 0, 77, 68,101,102, 67,101,108,108, 0, 77, -101,115,104, 68,101,102,111,114,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121, -115,116,101,109, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108,101, 83,121,115,116,101,109, 0, - 68,101,114,105,118,101,100, 77,101,115,104, 0, 80, 97,114,116,105, 99,108,101, 73,110,115,116, 97,110, 99,101, 77,111,100,105, -102,105,101,114, 68, 97,116, 97, 0, 69,120,112,108,111,100,101, 77,111,100,105,102,105,101,114, 68, 97,116, 97, 0, 76, 97,116, -116,105, 99,101, 0, 98, 68,101,102,111,114,109, 71,114,111,117,112, 0, 98, 65, 99,116,105,111,110, 0, 98, 80,111,115,101, 0, - 80, 97,114,116, 68,101,102,108,101, 99,116, 0, 83,111,102,116, 66,111,100,121, 0, 70,108,117,105,100,115,105,109, 83,101,116, -116,105,110,103,115, 0, 79, 98, 72,111,111,107, 0, 83, 66, 86,101,114,116,101,120, 0, 66,111,100,121, 80,111,105,110,116, 0, - 66,111,100,121, 83,112,114,105,110,103, 0, 83, 66, 83, 99,114, 97,116, 99,104, 0, 87,111,114,108,100, 0, 82, 97,100,105,111, - 0, 66, 97,115,101, 0, 65,118,105, 67,111,100,101, 99, 68, 97,116, 97, 0, 81,117,105, 99,107,116,105,109,101, 67,111,100,101, - 99, 68, 97,116, 97, 0, 70, 70, 77,112,101,103, 67,111,100,101, 99, 68, 97,116, 97, 0, 65,117,100,105,111, 68, 97,116, 97, 0, - 83, 99,101,110,101, 82,101,110,100,101,114, 76, 97,121,101,114, 0, 82,101,110,100,101,114, 68, 97,116, 97, 0, 71, 97,109,101, - 70,114, 97,109,105,110,103, 0, 84,105,109,101, 77, 97,114,107,101,114, 0, 73,109, 97,103,101, 80, 97,105,110,116, 83,101,116, -116,105,110,103,115, 0, 66,114,117,115,104, 0, 80, 97,114,116,105, 99,108,101, 66,114,117,115,104, 68, 97,116, 97, 0, 80, 97, -114,116,105, 99,108,101, 69,100,105,116, 83,101,116,116,105,110,103,115, 0, 84,111,111,108, 83,101,116,116,105,110,103,115, 0, - 66,114,117,115,104, 68, 97,116, 97, 0, 83, 99,117,108,112,116, 68, 97,116, 97, 0, 83, 99,117,108,112,116, 83,101,115,115,105, -111,110, 0, 83, 99,101,110,101, 0, 68, 97,103, 70,111,114,101,115,116, 0, 66, 71,112,105, 99, 0, 86,105,101,119, 51, 68, 0, - 83,112, 97, 99,101, 76,105,110,107, 0, 83, 99,114, 65,114,101, 97, 0, 82,101,110,100,101,114, 73,110,102,111, 0, 82,101,116, -111,112,111, 86,105,101,119, 68, 97,116, 97, 0, 86,105,101,119, 68,101,112,116,104,115, 0, 86,105,101,119, 50, 68, 0, 83,112, - 97, 99,101, 73,110,102,111, 0, 83,112, 97, 99,101, 73,112,111, 0, 83,112, 97, 99,101, 66,117,116,115, 0, 83,112, 97, 99,101, - 83,101,113, 0, 83,112, 97, 99,101, 70,105,108,101, 0,100,105,114,101,110,116,114,121, 0, 66,108,101,110,100, 72, 97,110,100, -108,101, 0, 83,112, 97, 99,101, 79,111,112,115, 0, 84,114,101,101, 83,116,111,114,101, 0, 84,114,101,101, 83,116,111,114,101, - 69,108,101,109, 0, 83,112, 97, 99,101, 73,109, 97,103,101, 0, 83,112, 97, 99,101, 78,108, 97, 0, 83,112, 97, 99,101, 84,101, -120,116, 0, 83,112, 97, 99,101, 83, 99,114,105,112,116, 0, 83, 99,114,105,112,116, 0, 83,112, 97, 99,101, 84,105,109,101, 0, - 83,112, 97, 99,101, 78,111,100,101, 0, 83,112, 97, 99,101, 73,109, 97, 83,101,108, 0, 70,105,108,101, 76,105,115,116, 0, 84, -104,101,109,101, 85, 73, 0, 84,104,101,109,101, 83,112, 97, 99,101, 0, 98, 84,104,101,109,101, 0, 83,111,108,105,100, 76,105, -103,104,116, 0, 85,115,101,114, 68,101,102, 0, 98, 83, 99,114,101,101,110, 0, 83, 99,114, 86,101,114,116, 0, 83, 99,114, 69, -100,103,101, 0, 80, 97,110,101,108, 0, 70,105,108,101, 71,108,111, 98, 97,108, 0, 83,116,114,105,112, 69,108,101,109, 0, 84, - 83,116,114,105,112, 69,108,101,109, 0, 83,116,114,105,112, 0, 80,108,117,103,105,110, 83,101,113, 0, 83,101,113,117,101,110, - 99,101, 0, 98, 83,111,117,110,100, 0,104,100, 97,117,100,105,111, 0, 77,101,116, 97, 83,116, 97, 99,107, 0, 69,100,105,116, -105,110,103, 0, 87,105,112,101, 86, 97,114,115, 0, 71,108,111,119, 86, 97,114,115, 0, 84,114, 97,110,115,102,111,114,109, 86, - 97,114,115, 0, 83,111,108,105,100, 67,111,108,111,114, 86, 97,114,115, 0, 83,112,101,101,100, 67,111,110,116,114,111,108, 86, - 97,114,115, 0, 69,102,102,101, 99,116, 0, 66,117,105,108,100, 69,102,102, 0, 80, 97,114,116, 69,102,102, 0, 80, 97,114,116, -105, 99,108,101, 0, 87, 97,118,101, 69,102,102, 0, 79,111,112,115, 0, 98, 80,114,111,112,101,114,116,121, 0, 98, 78,101, 97, -114, 83,101,110,115,111,114, 0, 98, 77,111,117,115,101, 83,101,110,115,111,114, 0, 98, 84,111,117, 99,104, 83,101,110,115,111, -114, 0, 98, 75,101,121, 98,111, 97,114,100, 83,101,110,115,111,114, 0, 98, 80,114,111,112,101,114,116,121, 83,101,110,115,111, -114, 0, 98, 67,111,108,108,105,115,105,111,110, 83,101,110,115,111,114, 0, 98, 82, 97,100, 97,114, 83,101,110,115,111,114, 0, - 98, 82, 97,110,100,111,109, 83,101,110,115,111,114, 0, 98, 82, 97,121, 83,101,110,115,111,114, 0, 98, 77,101,115,115, 97,103, -101, 83,101,110,115,111,114, 0, 98, 83,101,110,115,111,114, 0, 98, 67,111,110,116,114,111,108,108,101,114, 0, 98, 74,111,121, -115,116,105, 99,107, 83,101,110,115,111,114, 0, 98, 69,120,112,114,101,115,115,105,111,110, 67,111,110,116, 0, 98, 80,121,116, -104,111,110, 67,111,110,116, 0, 98, 65, 99,116,117, 97,116,111,114, 0, 98, 65,100,100, 79, 98,106,101, 99,116, 65, 99,116,117, - 97,116,111,114, 0, 98, 65, 99,116,105,111,110, 65, 99,116,117, 97,116,111,114, 0, 98, 83,111,117,110,100, 65, 99,116,117, 97, -116,111,114, 0, 98, 67, 68, 65, 99,116,117, 97,116,111,114, 0, 98, 69,100,105,116, 79, 98,106,101, 99,116, 65, 99,116,117, 97, -116,111,114, 0, 98, 83, 99,101,110,101, 65, 99,116,117, 97,116,111,114, 0, 98, 80,114,111,112,101,114,116,121, 65, 99,116,117, - 97,116,111,114, 0, 98, 79, 98,106,101, 99,116, 65, 99,116,117, 97,116,111,114, 0, 98, 73,112,111, 65, 99,116,117, 97,116,111, -114, 0, 98, 67, 97,109,101,114, 97, 65, 99,116,117, 97,116,111,114, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 65, 99,116, -117, 97,116,111,114, 0, 98, 71,114,111,117,112, 65, 99,116,117, 97,116,111,114, 0, 98, 82, 97,110,100,111,109, 65, 99,116,117, - 97,116,111,114, 0, 98, 77,101,115,115, 97,103,101, 65, 99,116,117, 97,116,111,114, 0, 98, 71, 97,109,101, 65, 99,116,117, 97, -116,111,114, 0, 98, 86,105,115,105, 98,105,108,105,116,121, 65, 99,116,117, 97,116,111,114, 0, 70,114,101,101, 67, 97,109,101, -114, 97, 0, 98, 83, 97,109,112,108,101, 0, 98, 83,111,117,110,100, 76,105,115,116,101,110,101,114, 0, 83,112, 97, 99,101, 83, -111,117,110,100, 0, 71,114,111,117,112, 79, 98,106,101, 99,116, 0, 66,111,110,101, 0, 98, 65,114,109, 97,116,117,114,101, 0, - 98, 80,111,115,101, 67,104, 97,110,110,101,108, 0, 98, 65, 99,116,105,111,110, 67,104, 97,110,110,101,108, 0, 83,112, 97, 99, -101, 65, 99,116,105,111,110, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 67,104, 97,110,110,101,108, 0, 98, 67,111,110,115, -116,114, 97,105,110,116, 0, 98, 67,111,110,115,116,114, 97,105,110,116, 84, 97,114,103,101,116, 0, 98, 80,121,116,104,111,110, - 67,111,110,115,116,114, 97,105,110,116, 0, 98, 75,105,110,101,109, 97,116,105, 99, 67,111,110,115,116,114, 97,105,110,116, 0, - 98, 84,114, 97, 99,107, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,111,116, 97,116,101, 76,105,107,101, 67,111, -110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 97,116,101, 76,105,107,101, 67,111,110,115,116,114, 97,105,110,116, 0, 98, - 77,105,110, 77, 97,120, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,107,101, 67,111,110,115,116,114, - 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99,107, 84,114, 97, 99, -107, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 70,111,108,108,111,119, 80, 97,116,104, 67,111,110,115,116,114, 97,105,110, -116, 0, 98, 83,116,114,101,116, 99,104, 84,111, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 82,105,103,105,100, 66,111,100, -121, 74,111,105,110,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 67,108, 97,109,112, 84,111, 67,111,110,115,116,114, 97, -105,110,116, 0, 98, 67,104,105,108,100, 79,102, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 84,114, 97,110,115,102,111,114, -109, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 76,111, 99, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, - 98, 82,111,116, 76,105,109,105,116, 67,111,110,115,116,114, 97,105,110,116, 0, 98, 83,105,122,101, 76,105,109,105,116, 67,111, -110,115,116,114, 97,105,110,116, 0, 98, 65, 99,116,105,111,110, 77,111,100,105,102,105,101,114, 0, 98, 65, 99,116,105,111,110, - 83,116,114,105,112, 0, 98, 78,111,100,101, 83,116, 97, 99,107, 0, 98, 78,111,100,101, 83,111, 99,107,101,116, 0, 98, 78,111, -100,101, 76,105,110,107, 0, 98, 78,111,100,101, 0, 98, 78,111,100,101, 80,114,101,118,105,101,119, 0, 98, 78,111,100,101, 84, -121,112,101, 0, 78,111,100,101, 73,109, 97,103,101, 65,110,105,109, 0, 78,111,100,101, 66,108,117,114, 68, 97,116, 97, 0, 78, -111,100,101, 72,117,101, 83, 97,116, 0, 78,111,100,101, 73,109, 97,103,101, 70,105,108,101, 0, 78,111,100,101, 67,104,114,111, -109, 97, 0, 78,111,100,101, 84,119,111, 88, 89,115, 0, 78,111,100,101, 71,101,111,109,101,116,114,121, 0, 78,111,100,101, 86, -101,114,116,101,120, 67,111,108, 0, 78,111,100,101, 68,101,102,111, 99,117,115, 0, 78,111,100,101, 71,108, 97,114,101, 0, 78, -111,100,101, 84,111,110,101,109, 97,112, 0, 78,111,100,101, 76,101,110,115, 68,105,115,116, 0, 67,117,114,118,101, 77, 97,112, - 80,111,105,110,116, 0, 67,117,114,118,101, 77, 97,112, 0, 66,114,117,115,104, 67,108,111,110,101, 0, 67,117,115,116,111,109, - 68, 97,116, 97, 76, 97,121,101,114, 0, 72, 97,105,114, 75,101,121, 0, 80, 97,114,116,105, 99,108,101, 75,101,121, 0, 67,104, -105,108,100, 80, 97,114,116,105, 99,108,101, 0, 80, 97,114,116,105, 99,108,101, 68, 97,116, 97, 0, 80, 97,114,116,105, 99,108, -101, 83,101,116,116,105,110,103,115, 0, 80, 97,114,116,105, 99,108,101, 69,100,105,116, 0, 80, 97,114,116,105, 99,108,101, 67, - 97, 99,104,101, 75,101,121, 0, 84, 76, 69, 78, 1, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 4, 0, 8, 0, 0, 0, - 16, 0, 16, 0, 4, 0, 8, 0, 8, 0, 16, 0, 12, 0, 12, 0, 24, 0, 16, 0, 16, 0, 32, 0, 16, 0, 16, 0, 32, 0, 96, 0, - 72, 0, 72, 2, 0, 0, 40, 0,112, 0,128, 0,160, 0, 24, 0, 40, 0,152, 0, 24, 0,168, 0, 32, 4, 32, 0,176, 1, 0, 0, - 0, 0,136, 0, 48, 1,120, 1, 24, 0, 8, 3,200, 0, 0, 0,136, 0,104, 1, 48, 1, 80, 0,144, 2,176, 0, 96, 0, 96, 1, - 0, 0,128, 0,104, 0,184, 0, 56, 0, 36, 0, 80, 0, 8, 0, 16, 0,160, 1, 0, 0,144, 0,112, 0,120, 1, 20, 0, 48, 0, - 64, 0, 20, 0, 12, 0, 16, 0, 4, 0, 8, 0, 8, 0, 24, 0, 96, 0, 48, 0, 8, 0, 4, 0, 4, 0, 0, 1, 32, 0, 16, 0, - 64, 0, 24, 0, 12, 0, 96, 0, 0, 0, 64, 0, 88, 0,104, 0,112, 0, 80, 0,144, 0, 80, 0, 72, 0,168, 0,208, 0, 72, 0, -104, 0,120, 0,200, 0,120, 0,200, 0, 64, 0, 80, 0, 8, 0, 8, 0, 0, 1, 88, 0,104, 1, 0, 0, 80, 0, 80, 0,152, 0, - 48, 0, 88, 0, 48, 0,120, 0,160, 0,152, 1,224, 0, 16, 0, 0, 0, 0, 0, 0, 0,152, 1, 40, 0, 40, 0,184, 0,152, 0, - 48, 0, 16, 0, 80, 0, 48, 4, 16, 0, 88, 0, 16, 0,216, 0, 8, 0, 72, 0,152, 0, 8, 0,160, 0, 0, 0, 24, 6, 0, 0, - 64, 0, 56, 3, 48, 0, 8, 1, 0, 0, 0, 0, 0, 0,136, 0, 48, 0, 88, 1,240, 0,208, 0,168, 1, 0, 0, 0, 0, 48, 1, - 16, 0, 16, 0, 48, 1,192, 0,136, 0, 56, 0, 0, 0,176, 0,232, 0,104, 2, 0, 0,152, 0,184, 0,152, 11, 56, 0, 16, 12, -168, 0, 32, 0, 40, 0,240, 0, 40, 0, 80, 0, 40, 0,216, 0,200, 1,248, 0, 72, 1, 0, 0, 32, 0, 48, 0, 12, 0, 24, 0, - 48, 0, 16, 0, 24, 0, 24, 0, 32, 0, 72, 1, 0, 0, 64, 0, 64, 0, 80, 0, 48, 0, 8, 0, 48, 0, 72, 0,104, 0, 72, 0, - 44, 0, 40, 0,108, 0, 72, 0, 96, 0,104, 0, 64, 0,128, 0, 8, 0, 80, 0, 16, 0, 64, 0, 32, 0, 20, 0, 72, 0, 24, 0, - 80, 0,104, 0, 52, 0, 32, 0, 56, 0, 64, 0, 56, 0,112, 0,140, 0, 4, 0, 40, 0, 0, 0, 88, 0,192, 0, 40, 0, 24, 1, -152, 0,208, 1, 80, 0,208, 0, 56, 0, 72, 0,128, 0, 80, 0,112, 0, 56, 0, 48, 0, 48, 0, 72, 0, 48, 0, 72, 0, 48, 0, - 24, 0, 56, 0,104, 0, 16, 0,112, 0, 96, 0, 28, 0, 28, 0, 28, 0, 72, 0,168, 0, 40, 0,136, 0, 48, 0,208, 0, 0, 0, - 0, 0, 16, 0, 24, 0, 12, 0, 16, 1, 40, 0, 8, 0, 64, 0, 32, 0, 24, 0, 24, 0, 32, 0, 8, 0, 12, 0, 56, 0, 24, 0, - 64, 0, 24, 0, 56, 0, 72, 0,208, 0,232, 1, 0, 0, 0, 0, 83, 84, 82, 67, 13, 1, 0, 0, 10, 0, 2, 0, 10, 0, 0, 0, - 10, 0, 1, 0, 11, 0, 2, 0, 9, 0, 2, 0, 9, 0, 3, 0, 12, 0, 2, 0, 2, 0, 4, 0, 2, 0, 5, 0, 13, 0, 2, 0, - 4, 0, 4, 0, 4, 0, 5, 0, 14, 0, 2, 0, 7, 0, 4, 0, 7, 0, 5, 0, 15, 0, 2, 0, 8, 0, 4, 0, 8, 0, 5, 0, - 16, 0, 3, 0, 4, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, 17, 0, 3, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, - 18, 0, 3, 0, 8, 0, 4, 0, 8, 0, 5, 0, 8, 0, 6, 0, 19, 0, 4, 0, 4, 0, 4, 0, 4, 0, 5, 0, 4, 0, 6, 0, - 4, 0, 7, 0, 20, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, 7, 0, 7, 0, 21, 0, 4, 0, 8, 0, 4, 0, - 8, 0, 5, 0, 8, 0, 6, 0, 8, 0, 7, 0, 22, 0, 4, 0, 4, 0, 8, 0, 4, 0, 9, 0, 4, 0, 10, 0, 4, 0, 11, 0, - 23, 0, 4, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 24, 0, 4, 0, 9, 0, 12, 0, 11, 0, 13, 0, - 4, 0, 14, 0, 4, 0, 15, 0, 25, 0, 10, 0, 25, 0, 0, 0, 25, 0, 1, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, 0, 18, 0, - 2, 0, 19, 0, 4, 0, 20, 0, 24, 0, 21, 0, 4, 0, 22, 0, 4, 0, 23, 0, 26, 0, 9, 0, 9, 0, 0, 0, 9, 0, 1, 0, - 26, 0, 24, 0, 27, 0, 25, 0, 0, 0, 26, 0, 2, 0, 27, 0, 2, 0, 19, 0, 4, 0, 28, 0, 25, 0, 29, 0, 27, 0, 8, 0, - 26, 0, 30, 0, 26, 0, 31, 0, 28, 0, 32, 0, 0, 0, 33, 0, 0, 0, 34, 0, 4, 0, 35, 0, 4, 0, 15, 0, 27, 0, 36, 0, - 29, 0, 6, 0, 4, 0, 37, 0, 4, 0, 38, 0, 2, 0, 39, 0, 2, 0, 40, 0, 2, 0, 41, 0, 4, 0, 42, 0, 30, 0, 7, 0, - 26, 0, 30, 0, 11, 0, 43, 0, 23, 0, 44, 0, 2, 0, 45, 0, 2, 0, 46, 0, 2, 0, 47, 0, 2, 0, 15, 0, 31, 0, 16, 0, - 31, 0, 0, 0, 31, 0, 1, 0, 7, 0, 48, 0, 7, 0, 49, 0, 2, 0, 17, 0, 2, 0, 50, 0, 2, 0, 51, 0, 2, 0, 41, 0, - 4, 0, 52, 0, 4, 0, 53, 0, 9, 0, 54, 0, 7, 0, 55, 0, 0, 0, 16, 0, 0, 0, 56, 0, 7, 0, 57, 0, 7, 0, 58, 0, - 32, 0, 12, 0, 26, 0, 30, 0, 31, 0, 59, 0, 0, 0, 60, 0, 4, 0, 61, 0, 7, 0, 49, 0, 11, 0, 62, 0, 30, 0, 63, 0, - 26, 0, 64, 0, 2, 0, 17, 0, 2, 0, 65, 0, 2, 0, 66, 0, 2, 0, 19, 0, 33, 0, 5, 0, 26, 0, 67, 0, 2, 0, 68, 0, - 2, 0, 69, 0, 2, 0, 70, 0, 4, 0, 15, 0, 34, 0, 6, 0, 34, 0, 0, 0, 34, 0, 1, 0, 0, 0, 71, 0, 0, 0, 72, 0, - 4, 0, 22, 0, 4, 0, 73, 0, 35, 0, 13, 0, 26, 0, 30, 0, 0, 0, 74, 0, 4, 0, 75, 0, 4, 0, 76, 0, 11, 0, 77, 0, - 34, 0, 78, 0, 34, 0, 79, 0, 4, 0, 80, 0, 4, 0, 81, 0, 0, 0, 82, 0, 4, 0, 83, 0, 4, 0, 84, 0, 9, 0, 85, 0, - 36, 0, 5, 0, 4, 0, 86, 0, 4, 0, 87, 0, 4, 0, 75, 0, 4, 0, 15, 0, 9, 0, 54, 0, 37, 0, 20, 0, 26, 0, 30, 0, - 2, 0, 17, 0, 2, 0, 19, 0, 7, 0, 88, 0, 7, 0, 89, 0, 7, 0, 90, 0, 7, 0, 91, 0, 7, 0, 92, 0, 7, 0, 93, 0, - 7, 0, 94, 0, 7, 0, 95, 0, 7, 0, 96, 0, 7, 0, 97, 0, 7, 0, 98, 0, 2, 0, 99, 0, 2, 0,100, 0, 7, 0,101, 0, - 30, 0, 63, 0, 33, 0,102, 0, 38, 0,103, 0, 39, 0, 12, 0, 4, 0,104, 0, 4, 0,105, 0, 4, 0,106, 0, 4, 0,107, 0, - 2, 0,108, 0, 2, 0,109, 0, 2, 0, 19, 0, 2, 0,110, 0, 2, 0,111, 0, 2, 0,112, 0, 2, 0,113, 0, 2, 0,114, 0, - 40, 0, 31, 0, 26, 0, 30, 0, 0, 0, 33, 0, 11, 0,115, 0, 41, 0,116, 0, 42, 0,117, 0, 2, 0,110, 0, 2, 0, 19, 0, - 2, 0,118, 0, 2, 0, 17, 0, 2, 0, 15, 0, 2, 0, 41, 0, 4, 0,119, 0, 2, 0,120, 0, 2, 0,121, 0, 2, 0,122, 0, - 2, 0,123, 0, 2, 0,124, 0, 2, 0,125, 0, 4, 0,126, 0, 4, 0,127, 0, 36, 0,128, 0, 29, 0,129, 0, 7, 0,130, 0, - 4, 0,131, 0, 2, 0,132, 0, 2, 0,133, 0, 2, 0,134, 0, 2, 0,135, 0, 7, 0,136, 0, 7, 0,137, 0, 9, 0,138, 0, - 43, 0, 28, 0, 2, 0,139, 0, 2, 0,140, 0, 2, 0,141, 0, 2, 0,142, 0, 38, 0,143, 0, 44, 0,144, 0, 0, 0,145, 0, - 0, 0,146, 0, 0, 0,147, 0, 0, 0,148, 0, 0, 0,149, 0, 7, 0,150, 0, 7, 0,151, 0, 2, 0,152, 0, 2, 0,153, 0, - 2, 0,154, 0, 2, 0,155, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,160, 0, 7, 0,161, 0, - 7, 0,162, 0, 7, 0,163, 0, 7, 0,164, 0, 7, 0,165, 0, 7, 0,166, 0, 45, 0, 15, 0, 0, 0,167, 0, 9, 0,168, 0, - 0, 0,169, 0, 0, 0,170, 0, 4, 0,171, 0, 4, 0,172, 0, 9, 0,173, 0, 7, 0,174, 0, 7, 0,175, 0, 7, 0,176, 0, - 4, 0,177, 0, 9, 0,178, 0, 9, 0,179, 0, 4, 0,180, 0, 4, 0, 15, 0, 46, 0, 6, 0, 7, 0,156, 0, 7, 0,157, 0, - 7, 0,158, 0, 7, 0,181, 0, 7, 0, 48, 0, 4, 0, 44, 0, 47, 0, 5, 0, 2, 0, 19, 0, 2, 0, 35, 0, 2, 0, 44, 0, - 2, 0,182, 0, 46, 0,176, 0, 48, 0, 17, 0, 38, 0,143, 0, 40, 0,183, 0, 49, 0,184, 0, 7, 0,185, 0, 7, 0,186, 0, - 2, 0, 17, 0, 2, 0,187, 0, 7, 0, 90, 0, 7, 0, 91, 0, 7, 0,188, 0, 4, 0,189, 0, 2, 0,190, 0, 2, 0,191, 0, - 4, 0,110, 0, 4, 0,119, 0, 2, 0,192, 0, 2, 0,193, 0, 44, 0, 53, 0, 26, 0, 30, 0, 7, 0,194, 0, 7, 0,195, 0, - 7, 0,196, 0, 7, 0,197, 0, 7, 0,198, 0, 7, 0,199, 0, 7, 0,200, 0, 7, 0,201, 0, 7, 0,202, 0, 7, 0,203, 0, - 7, 0,204, 0, 7, 0,205, 0, 7, 0,206, 0, 7, 0,207, 0, 7, 0,208, 0, 7, 0,209, 0, 7, 0,210, 0, 7, 0,211, 0, - 7, 0,212, 0, 7, 0,213, 0, 2, 0,214, 0, 2, 0,215, 0, 2, 0,216, 0, 2, 0,217, 0, 2, 0,218, 0, 2, 0,219, 0, - 2, 0,220, 0, 2, 0, 19, 0, 2, 0, 17, 0, 2, 0,187, 0, 7, 0,221, 0, 7, 0,222, 0, 7, 0,223, 0, 7, 0,224, 0, - 2, 0,225, 0, 2, 0,226, 0, 2, 0,227, 0, 2, 0,108, 0, 4, 0, 22, 0, 4, 0,105, 0, 4, 0,106, 0, 4, 0,107, 0, - 7, 0,228, 0, 7, 0,229, 0, 7, 0,163, 0, 39, 0,230, 0, 30, 0, 63, 0, 40, 0,183, 0, 45, 0,231, 0, 47, 0,232, 0, - 48, 0,233, 0, 29, 0,129, 0, 50, 0, 8, 0, 7, 0,234, 0, 7, 0,235, 0, 7, 0,151, 0, 4, 0, 19, 0, 7, 0,236, 0, - 7, 0,237, 0, 7, 0,238, 0, 38, 0,239, 0, 51, 0, 60, 0, 26, 0, 30, 0, 2, 0, 17, 0, 2, 0,240, 0, 2, 0,153, 0, - 2, 0,241, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, 7, 0,159, 0, 7, 0,242, 0, 7, 0,243, 0, 7, 0,244, 0, - 7, 0,245, 0, 7, 0,246, 0, 7, 0,247, 0, 7, 0,248, 0, 4, 0, 53, 0, 52, 0,249, 0, 2, 0,250, 0, 2, 0,251, 0, - 7, 0, 90, 0, 7, 0, 91, 0, 7, 0,252, 0, 7, 0,253, 0, 7, 0,254, 0, 2, 0,255, 0, 2, 0, 0, 1, 2, 0, 1, 1, - 2, 0, 2, 1, 0, 0, 3, 1, 0, 0, 4, 1, 2, 0, 5, 1, 2, 0, 6, 1, 2, 0, 7, 1, 2, 0, 8, 1, 2, 0, 9, 1, - 7, 0, 10, 1, 7, 0, 11, 1, 7, 0, 12, 1, 7, 0, 13, 1, 2, 0, 14, 1, 2, 0, 41, 0, 2, 0, 15, 1, 2, 0, 16, 1, - 4, 0, 17, 1, 4, 0, 18, 1, 2, 0, 19, 1, 2, 0, 20, 1, 2, 0, 21, 1, 2, 0, 22, 1, 7, 0, 23, 1, 7, 0, 24, 1, - 7, 0, 25, 1, 7, 0, 26, 1, 2, 0, 27, 1, 2, 0, 28, 1, 43, 0, 29, 1, 30, 0, 63, 0, 29, 0,129, 0, 33, 0,102, 0, - 53, 0, 2, 0, 26, 0, 30, 0, 30, 0, 63, 0, 54, 0,124, 0, 26, 0, 30, 0, 2, 0,153, 0, 2, 0, 19, 0, 7, 0,156, 0, - 7, 0,157, 0, 7, 0,158, 0, 7, 0, 30, 1, 7, 0, 31, 1, 7, 0, 32, 1, 7, 0, 33, 1, 7, 0, 34, 1, 7, 0, 35, 1, - 7, 0, 36, 1, 7, 0, 37, 1, 7, 0, 38, 1, 7, 0, 39, 1, 7, 0, 40, 1, 7, 0, 41, 1, 7, 0, 42, 1, 7, 0, 43, 1, - 7, 0, 44, 1, 7, 0, 45, 1, 7, 0, 46, 1, 7, 0, 47, 1, 7, 0, 48, 1, 7, 0, 49, 1, 7, 0, 50, 1, 7, 0, 51, 1, - 7, 0, 52, 1, 7, 0, 53, 1, 7, 0, 54, 1, 7, 0, 55, 1, 7, 0, 56, 1, 2, 0, 57, 1, 2, 0, 58, 1, 2, 0, 59, 1, - 0, 0, 60, 1, 0, 0, 61, 1, 7, 0, 62, 1, 7, 0, 63, 1, 2, 0, 64, 1, 2, 0, 65, 1, 7, 0, 66, 1, 7, 0, 67, 1, - 7, 0, 68, 1, 7, 0, 69, 1, 2, 0, 70, 1, 2, 0, 41, 0, 4, 0,240, 0, 4, 0, 71, 1, 2, 0, 72, 1, 2, 0, 73, 1, - 2, 0, 74, 1, 2, 0, 75, 1, 7, 0, 76, 1, 7, 0, 77, 1, 7, 0, 78, 1, 7, 0, 79, 1, 7, 0, 80, 1, 7, 0, 81, 1, - 7, 0, 82, 1, 0, 0, 83, 1, 7, 0, 84, 1, 7, 0, 85, 1, 7, 0, 86, 1, 0, 0, 87, 1, 0, 0, 15, 1, 0, 0, 88, 1, - 0, 0, 89, 1, 2, 0, 90, 1, 2, 0, 91, 1, 2, 0, 92, 1, 2, 0, 93, 1, 2, 0, 94, 1, 2, 0, 95, 1, 7, 0, 96, 1, - 7, 0, 97, 1, 7, 0, 98, 1, 7, 0, 99, 1, 7, 0,100, 1, 2, 0,139, 0, 2, 0,140, 0, 47, 0,101, 1, 47, 0,102, 1, - 0, 0,103, 1, 0, 0,104, 1, 0, 0,105, 1, 0, 0,106, 1, 2, 0,107, 1, 2, 0,251, 0, 7, 0,108, 1, 7, 0,109, 1, - 43, 0, 29, 1, 55, 0,110, 1, 30, 0, 63, 0, 56, 0,111, 1, 29, 0,129, 0, 7, 0,112, 1, 7, 0,113, 1, 7, 0,114, 1, - 7, 0,115, 1, 7, 0,116, 1, 2, 0,117, 1, 2, 0, 53, 0, 7, 0,118, 1, 7, 0,119, 1, 7, 0,120, 1, 7, 0,121, 1, - 7, 0,122, 1, 7, 0,123, 1, 7, 0,124, 1, 7, 0,125, 1, 7, 0,126, 1, 2, 0,127, 1, 2, 0,128, 1, 7, 0,129, 1, - 7, 0,130, 1, 7, 0,131, 1, 7, 0,132, 1, 7, 0,133, 1, 4, 0,134, 1, 4, 0,135, 1, 4, 0,136, 1, 33, 0,102, 0, - 57, 0, 6, 0, 26, 0, 30, 0, 0, 0,137, 1, 7, 0,138, 1, 7, 0, 15, 0, 58, 0, 54, 0, 36, 0,128, 0, 59, 0, 26, 0, - 59, 0, 0, 0, 59, 0, 1, 0, 60, 0,139, 1, 4, 0,140, 1, 4, 0,141, 1, 4, 0,142, 1, 4, 0,143, 1, 4, 0,144, 1, - 4, 0,145, 1, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,146, 1, 2, 0,147, 1, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 6, 0, - 7, 0,148, 1, 7, 0,149, 1, 7, 0,150, 1, 7, 0,151, 1, 7, 0,152, 1, 7, 0,153, 1, 7, 0,154, 1, 7, 0, 22, 0, - 7, 0,155, 1, 7, 0,156, 1, 61, 0, 15, 0, 26, 0, 30, 0, 60, 0,139, 1, 11, 0,157, 1, 11, 0,158, 1, 30, 0, 63, 0, - 54, 0,159, 1, 2, 0, 19, 0, 2, 0,160, 1, 4, 0,152, 0, 7, 0,234, 0, 7, 0,151, 0, 7, 0,235, 0, 7, 0,161, 1, - 7, 0,162, 1, 7, 0,163, 1, 62, 0, 10, 0, 7, 0,164, 1, 7, 0,165, 1, 7, 0,166, 1, 7, 0,167, 1, 2, 0,168, 1, - 2, 0,169, 1, 0, 0,170, 1, 0, 0,171, 1, 0, 0,172, 1, 0, 0,173, 1, 63, 0, 7, 0, 7, 0,174, 1, 7, 0,165, 1, - 7, 0,166, 1, 2, 0,170, 1, 2, 0,173, 1, 7, 0,167, 1, 7, 0, 15, 0, 64, 0, 21, 0, 64, 0, 0, 0, 64, 0, 1, 0, - 2, 0, 17, 0, 2, 0,175, 1, 2, 0,173, 1, 2, 0, 19, 0, 2, 0,176, 1, 2, 0,177, 1, 2, 0,178, 1, 2, 0,179, 1, - 2, 0,180, 1, 2, 0,181, 1, 2, 0,182, 1, 2, 0,183, 1, 7, 0,184, 1, 7, 0,185, 1, 63, 0,186, 1, 62, 0,187, 1, - 2, 0,188, 1, 2, 0, 15, 0, 4, 0,189, 1, 65, 0, 5, 0, 2, 0,190, 1, 2, 0,175, 1, 0, 0, 19, 0, 0, 0, 15, 0, - 2, 0, 53, 0, 66, 0, 4, 0, 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 7, 0, 7, 0,191, 1, 67, 0, 57, 0, 26, 0, 30, 0, - 60, 0,139, 1, 11, 0,192, 1, 11, 0,158, 1, 38, 0,193, 1, 38, 0,194, 1, 38, 0,195, 1, 30, 0, 63, 0, 68, 0,196, 1, - 32, 0,197, 1, 54, 0,159, 1, 11, 0,198, 1, 7, 0,234, 0, 7, 0,151, 0, 7, 0,235, 0, 4, 0,152, 0, 2, 0,199, 1, - 2, 0,160, 1, 2, 0, 19, 0, 2, 0,200, 1, 7, 0,201, 1, 7, 0,202, 1, 7, 0,203, 1, 2, 0,178, 1, 2, 0,179, 1, - 2, 0,204, 1, 2, 0,205, 1, 4, 0, 53, 0, 2, 0, 22, 0, 2, 0, 77, 0, 2, 0, 48, 0, 2, 0,206, 1, 7, 0,207, 1, - 7, 0,208, 1, 7, 0,209, 1, 7, 0,210, 1, 7, 0,211, 1, 7, 0,212, 1, 7, 0,213, 1, 7, 0,214, 1, 7, 0,215, 1, - 7, 0,216, 1, 0, 0,217, 1, 0, 0,218, 1, 57, 0,219, 1, 57, 0,220, 1, 57, 0,221, 1, 57, 0,222, 1, 4, 0,223, 1, - 4, 0,224, 1, 4, 0,225, 1, 4, 0, 15, 0, 66, 0,226, 1, 4, 0,227, 1, 4, 0,228, 1, 65, 0,229, 1, 65, 0,230, 1, - 69, 0, 6, 0, 38, 0,239, 0, 2, 0, 45, 0, 2, 0, 50, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 0,231, 1, 70, 0, 21, 0, - 70, 0, 0, 0, 70, 0, 1, 0, 63, 0,186, 1, 62, 0,187, 1, 23, 0,232, 1, 23, 0,233, 1, 2, 0, 45, 0, 2, 0, 50, 0, - 2, 0,234, 1, 2, 0,235, 1, 2, 0,236, 1, 2, 0,237, 1, 2, 0, 19, 0, 2, 0,161, 0, 7, 0, 10, 0, 7, 0, 11, 0, - 4, 0,238, 1, 7, 0,239, 1, 7, 0,240, 1, 7, 0, 49, 0, 69, 0,241, 1, 71, 0, 39, 0, 26, 0, 30, 0, 60, 0,139, 1, - 11, 0,242, 1, 30, 0, 63, 0, 32, 0,197, 1, 54, 0,159, 1, 72, 0,243, 1, 73, 0,244, 1, 74, 0,245, 1, 75, 0,246, 1, - 76, 0,247, 1, 77, 0,248, 1, 78, 0,249, 1, 79, 0,250, 1, 71, 0,251, 1, 80, 0,252, 1, 81, 0,253, 1, 81, 0,254, 1, - 81, 0,255, 1, 4, 0,235, 1, 4, 0, 0, 2, 4, 0, 1, 2, 4, 0, 2, 2, 4, 0, 3, 2, 4, 0,152, 0, 7, 0,234, 0, - 7, 0,151, 0, 7, 0,235, 0, 7, 0, 4, 2, 7, 0, 15, 0, 2, 0, 5, 2, 2, 0, 19, 0, 2, 0, 6, 2, 2, 0, 7, 2, - 2, 0,160, 1, 2, 0, 8, 2, 82, 0, 9, 2, 83, 0, 10, 2, 9, 0,138, 0, 74, 0, 8, 0, 9, 0, 11, 2, 7, 0, 12, 2, - 4, 0, 13, 2, 0, 0, 19, 0, 0, 0, 14, 2, 2, 0,240, 0, 2, 0, 15, 2, 2, 0, 16, 2, 72, 0, 8, 0, 4, 0, 17, 2, - 4, 0, 18, 2, 4, 0, 19, 2, 4, 0, 20, 2, 0, 0, 15, 0, 0, 0,175, 1, 0, 0, 21, 2, 0, 0, 19, 0, 76, 0, 5, 0, - 4, 0, 17, 2, 4, 0, 18, 2, 0, 0, 22, 2, 0, 0, 15, 0, 2, 0, 19, 0, 84, 0, 2, 0, 4, 0, 23, 2, 7, 0,166, 1, - 77, 0, 3, 0, 84, 0, 24, 2, 4, 0, 25, 2, 4, 0, 19, 0, 75, 0, 4, 0, 7, 0, 26, 2, 2, 0, 27, 2, 0, 0, 19, 0, - 0, 0,175, 1, 78, 0, 4, 0, 0, 0,181, 0, 0, 0,156, 0, 0, 0,157, 0, 0, 0,158, 0, 79, 0, 1, 0, 7, 0, 28, 2, - 80, 0, 2, 0, 4, 0, 29, 2, 4, 0, 17, 0, 73, 0, 7, 0, 7, 0, 12, 2, 40, 0, 11, 2, 0, 0, 19, 0, 0, 0, 14, 2, - 2, 0,240, 0, 2, 0, 15, 2, 2, 0, 16, 2, 85, 0, 1, 0, 7, 0, 30, 2, 86, 0, 1, 0, 4, 0, 31, 2, 87, 0, 1, 0, - 0, 0, 32, 2, 88, 0, 1, 0, 7, 0, 12, 2, 89, 0, 4, 0, 7, 0,181, 0, 7, 0,156, 0, 7, 0,157, 0, 7, 0,158, 0, - 90, 0, 1, 0, 89, 0, 13, 2, 91, 0, 5, 0, 4, 0, 33, 2, 4, 0, 34, 2, 0, 0, 19, 0, 0, 0,175, 1, 0, 0, 35, 2, - 92, 0, 2, 0, 4, 0, 36, 2, 4, 0, 34, 2, 93, 0, 14, 0, 93, 0, 0, 0, 93, 0, 1, 0, 91, 0, 37, 2, 90, 0, 38, 2, - 92, 0, 39, 2, 0, 0, 40, 2, 11, 0, 41, 2, 11, 0, 42, 2, 94, 0, 43, 2, 4, 0,235, 1, 4, 0, 1, 2, 4, 0, 0, 2, - 4, 0, 15, 0, 75, 0, 44, 2, 82, 0, 14, 0, 11, 0, 45, 2, 75, 0, 44, 2, 0, 0, 46, 2, 0, 0, 47, 2, 0, 0, 48, 2, - 0, 0, 49, 2, 0, 0, 50, 2, 0, 0, 51, 2, 0, 0, 52, 2, 0, 0, 15, 0, 81, 0,253, 1, 81, 0,255, 1, 2, 0, 53, 2, - 0, 0, 54, 2, 83, 0, 8, 0, 4, 0, 55, 2, 4, 0, 56, 2, 72, 0, 57, 2, 76, 0, 58, 2, 4, 0, 1, 2, 4, 0, 0, 2, - 4, 0,235, 1, 4, 0, 15, 0, 95, 0, 6, 0, 95, 0, 0, 0, 95, 0, 1, 0, 4, 0, 17, 0, 4, 0,240, 0, 0, 0, 16, 0, - 0, 0, 59, 2, 96, 0, 7, 0, 95, 0, 60, 2, 2, 0, 61, 2, 2, 0, 45, 2, 2, 0, 62, 2, 2, 0, 75, 0, 9, 0, 63, 2, - 9, 0, 64, 2, 97, 0, 3, 0, 95, 0, 60, 2, 38, 0,143, 0, 0, 0, 16, 0, 98, 0, 5, 0, 95, 0, 60, 2, 38, 0,143, 0, - 0, 0, 16, 0, 2, 0, 65, 2, 0, 0, 66, 2, 99, 0, 5, 0, 95, 0, 60, 2, 7, 0, 67, 2, 7, 0, 68, 2, 4, 0, 69, 2, - 4, 0, 70, 2,100, 0, 13, 0, 95, 0, 60, 2, 38, 0, 71, 2, 38, 0, 72, 2, 38, 0, 73, 2, 38, 0, 74, 2, 7, 0, 75, 2, - 7, 0, 76, 2, 7, 0, 68, 2, 7, 0, 77, 2, 4, 0, 78, 2, 4, 0, 79, 2, 4, 0, 75, 0, 4, 0, 80, 2,101, 0, 5, 0, - 95, 0, 60, 2, 2, 0, 81, 2, 2, 0, 19, 0, 7, 0, 82, 2, 38, 0, 83, 2,102, 0, 3, 0, 95, 0, 60, 2, 7, 0, 84, 2, - 4, 0, 75, 0,103, 0, 11, 0, 95, 0, 60, 2, 44, 0, 85, 2, 7, 0, 86, 2, 4, 0, 87, 2, 0, 0, 88, 2, 7, 0, 89, 2, - 4, 0, 90, 2, 38, 0, 91, 2, 0, 0, 92, 2, 4, 0, 93, 2, 4, 0, 15, 0,104, 0, 10, 0, 95, 0, 60, 2, 38, 0, 94, 2, - 40, 0, 95, 2, 4, 0, 75, 0, 4, 0, 96, 2, 7, 0, 97, 2, 7, 0, 98, 2, 0, 0, 92, 2, 4, 0, 93, 2, 4, 0, 15, 0, -105, 0, 3, 0, 95, 0, 60, 2, 7, 0, 99, 2, 4, 0,100, 2,106, 0, 5, 0, 95, 0, 60, 2, 7, 0,101, 2, 0, 0, 88, 2, - 2, 0, 19, 0, 2, 0,102, 2,107, 0, 8, 0, 95, 0, 60, 2, 38, 0,143, 0, 7, 0,101, 2, 7, 0,167, 1, 7, 0, 86, 0, - 0, 0, 88, 2, 2, 0, 19, 0, 2, 0, 17, 0,108, 0, 19, 0, 95, 0, 60, 2, 38, 0,103, 2, 0, 0, 88, 2, 44, 0, 85, 2, - 38, 0, 91, 2, 2, 0, 19, 0, 2, 0, 15, 0, 7, 0,104, 2, 7, 0,105, 2, 7, 0,106, 2, 7, 0,201, 1, 7, 0,107, 2, - 7, 0,108, 2, 7, 0,109, 2, 4, 0, 90, 2, 4, 0, 93, 2, 0, 0, 92, 2, 7, 0,110, 2, 7, 0,111, 2,109, 0, 7, 0, - 95, 0, 60, 2, 2, 0,112, 2, 2, 0,113, 2, 4, 0, 53, 0, 38, 0,143, 0, 7, 0,114, 2, 0, 0, 88, 2,110, 0, 9, 0, - 95, 0, 60, 2, 38, 0,143, 0, 7, 0,115, 2, 7, 0,116, 2, 7, 0,117, 2, 4, 0,118, 2, 4, 0,119, 2, 7, 0,120, 2, - 0, 0, 16, 0,111, 0, 1, 0, 95, 0, 60, 2,112, 0, 4, 0, 95, 0, 60, 2, 38, 0,143, 0, 4, 0,121, 2, 4, 0, 15, 0, -113, 0, 2, 0, 4, 0,122, 2, 7, 0,166, 1,114, 0, 2, 0, 4, 0,106, 0, 4, 0,123, 2,115, 0, 20, 0, 95, 0, 60, 2, - 38, 0,143, 0, 0, 0, 88, 2, 2, 0,124, 2, 2, 0,125, 2, 2, 0, 19, 0, 2, 0, 15, 0, 7, 0,126, 2, 7, 0,127, 2, - 4, 0,235, 1, 4, 0,128, 2,114, 0,129, 2,113, 0,130, 2, 4, 0,131, 2, 4, 0,132, 2, 4, 0,133, 2, 4, 0,123, 2, - 7, 0,134, 2, 7, 0,135, 2, 7, 0,136, 2,116, 0, 5, 0, 95, 0, 60, 2,117, 0,137, 2,118, 0,138, 2, 2, 0, 19, 0, - 2, 0,139, 2,119, 0, 5, 0, 95, 0, 60, 2, 38, 0,239, 0, 2, 0,140, 2, 2, 0, 19, 0, 2, 0,141, 2,120, 0, 5, 0, - 95, 0, 60, 2, 4, 0,142, 2, 2, 0, 19, 0, 2, 0,143, 2, 7, 0,144, 2,121, 0, 24, 0, 26, 0, 30, 0, 2, 0,176, 1, - 2, 0,177, 1, 2, 0,145, 2, 2, 0, 19, 0, 2, 0,146, 2, 2, 0,147, 2, 2, 0,148, 2, 2, 0, 53, 0, 0, 0,149, 2, - 0, 0,150, 2, 0, 0,151, 2, 0, 0, 17, 0, 4, 0, 15, 0, 7, 0,152, 2, 7, 0,153, 2, 7, 0,154, 2, 7, 0,155, 2, - 7, 0,156, 2, 7, 0,157, 2, 63, 0,158, 2, 30, 0, 63, 0, 32, 0,197, 1, 77, 0,248, 1,122, 0, 3, 0,122, 0, 0, 0, -122, 0, 1, 0, 0, 0, 16, 0, 60, 0, 3, 0, 7, 0,159, 2, 4, 0, 19, 0, 4, 0, 15, 0, 38, 0,104, 0, 26, 0, 30, 0, - 2, 0, 17, 0, 2, 0,160, 2, 4, 0,161, 2, 4, 0,162, 2, 4, 0,163, 2, 0, 0,164, 2, 38, 0, 36, 0, 38, 0,165, 2, - 38, 0,166, 2, 38, 0,167, 2, 38, 0,168, 2, 30, 0, 63, 0, 68, 0,196, 1, 60, 0,139, 1,123, 0,169, 2,124, 0,170, 2, - 9, 0, 54, 0, 11, 0,171, 2, 11, 0,242, 1, 11, 0,158, 1, 11, 0,172, 2, 11, 0,173, 2, 54, 0,159, 1, 7, 0,234, 0, - 7, 0,174, 2, 7, 0,175, 2, 7, 0,151, 0, 7, 0,176, 2, 7, 0,235, 0, 7, 0,177, 2, 7, 0,148, 1, 7, 0,178, 2, - 7, 0,179, 2, 7, 0,115, 2, 7, 0,180, 2, 7, 0,185, 0, 4, 0,181, 2, 2, 0, 19, 0, 2, 0,182, 2, 2, 0,183, 2, - 2, 0,184, 2, 2, 0,185, 2, 2, 0,186, 2, 2, 0,187, 2, 2, 0,188, 2, 2, 0,189, 2, 2, 0,190, 2, 2, 0,191, 2, - 2, 0,192, 2, 4, 0,193, 2, 4, 0,194, 2, 4, 0,195, 2, 4, 0,196, 2, 7, 0,197, 2, 7, 0,198, 2, 7, 0,199, 2, - 7, 0,200, 2, 7, 0,201, 2, 7, 0,202, 2, 7, 0,203, 2, 7, 0,204, 2, 0, 0,205, 2, 0, 0,206, 2, 0, 0,160, 1, - 0, 0,207, 2, 0, 0,208, 2, 0, 0,209, 2, 7, 0,210, 2, 33, 0,102, 0, 11, 0,211, 2, 11, 0,212, 2, 11, 0,213, 2, - 11, 0,214, 2, 9, 0,215, 2, 7, 0,216, 2, 2, 0, 29, 2, 2, 0,217, 2, 7, 0, 13, 2, 4, 0,218, 2, 4, 0,219, 2, - 2, 0,220, 2, 2, 0,192, 0, 7, 0,221, 2, 11, 0,222, 2, 11, 0,223, 2, 11, 0,224, 2, 11, 0,225, 2,125, 0,226, 2, -126, 0,227, 2, 56, 0,228, 2, 2, 0,229, 2, 2, 0,230, 2, 2, 0,231, 2, 2, 0,232, 2, 7, 0, 5, 2, 2, 0,233, 2, - 2, 0,234, 2,127, 0,235, 2,118, 0,236, 2,118, 0,237, 2, 4, 0,238, 2, 4, 0, 15, 0, 9, 0,138, 0,128, 0, 14, 0, -128, 0, 0, 0,128, 0, 1, 0, 38, 0, 36, 0, 7, 0,115, 2, 7, 0,236, 0, 7, 0,116, 2, 7, 0,117, 2, 0, 0, 16, 0, - 4, 0,118, 2, 4, 0,119, 2, 4, 0,239, 2, 2, 0, 17, 0, 2, 0,240, 2, 7, 0,120, 2,125, 0, 33, 0, 2, 0,241, 2, - 2, 0,242, 2, 2, 0, 19, 0, 2, 0,117, 2, 7, 0,243, 2, 7, 0,244, 2, 7, 0,245, 2, 7, 0,246, 2, 7, 0,247, 2, - 7, 0,248, 2, 7, 0,249, 2, 7, 0,250, 2, 7, 0,251, 2, 7, 0,252, 2, 7, 0,253, 2, 7, 0,254, 2, 7, 0,255, 2, - 7, 0, 0, 3, 7, 0, 1, 3, 7, 0, 2, 3, 7, 0, 3, 3, 7, 0, 4, 3, 7, 0, 5, 3, 7, 0, 6, 3, 7, 0, 7, 3, - 7, 0, 8, 3, 7, 0, 9, 3, 7, 0, 10, 3, 2, 0, 11, 3, 2, 0, 12, 3, 2, 0, 13, 3, 2, 0, 14, 3, 44, 0,144, 0, -129, 0, 1, 0, 7, 0,174, 1,126, 0, 41, 0,117, 0, 15, 3, 4, 0, 16, 3, 4, 0, 17, 3,130, 0, 18, 3,131, 0, 19, 3, - 7, 0,198, 2, 7, 0, 20, 3, 7, 0, 21, 3, 7, 0, 22, 3, 7, 0, 23, 3, 7, 0, 24, 3, 7, 0, 25, 3, 7, 0, 26, 3, - 7, 0, 27, 3, 7, 0, 28, 3, 7, 0, 29, 3, 2, 0, 30, 3, 2, 0, 31, 3, 7, 0, 32, 3, 7, 0, 33, 3, 4, 0,107, 0, - 4, 0, 34, 3, 4, 0, 35, 3, 2, 0, 36, 3, 2, 0, 37, 3,129, 0, 38, 3, 4, 0, 39, 3, 4, 0, 65, 0, 7, 0, 40, 3, - 7, 0, 41, 3, 7, 0, 42, 3, 7, 0, 43, 3, 2, 0, 44, 3, 2, 0, 45, 3, 2, 0, 46, 3, 2, 0, 47, 3, 2, 0, 48, 3, - 2, 0,251, 0, 2, 0,234, 2, 2, 0, 49, 3,132, 0, 50, 3,127, 0, 40, 0, 2, 0, 17, 0, 2, 0, 51, 3, 2, 0, 52, 3, - 2, 0, 53, 3, 7, 0, 54, 3, 2, 0, 55, 3, 2, 0, 56, 3, 7, 0, 57, 3, 2, 0, 58, 3, 2, 0, 59, 3, 7, 0, 60, 3, - 7, 0, 61, 3, 7, 0, 62, 3, 7, 0, 63, 3, 7, 0, 64, 3, 7, 0, 65, 3, 4, 0, 66, 3, 7, 0, 67, 3, 7, 0, 68, 3, - 7, 0, 69, 3, 71, 0, 70, 3, 71, 0, 71, 3, 71, 0, 72, 3, 0, 0, 73, 3, 7, 0, 74, 3, 7, 0, 75, 3, 30, 0, 63, 0, - 2, 0, 76, 3, 0, 0, 77, 3, 0, 0, 78, 3, 7, 0, 79, 3, 4, 0, 80, 3, 7, 0, 81, 3, 7, 0, 82, 3, 4, 0, 83, 3, - 4, 0, 84, 3, 7, 0, 85, 3, 7, 0, 86, 3, 7, 0, 87, 3, 75, 0, 88, 3,133, 0, 63, 0, 26, 0, 30, 0, 2, 0,153, 0, - 2, 0,241, 0, 2, 0, 15, 1, 2, 0, 89, 3, 7, 0, 90, 3, 7, 0, 91, 3, 7, 0, 92, 3, 7, 0, 93, 3, 7, 0, 94, 3, - 7, 0, 95, 3, 7, 0, 96, 3, 7, 0, 97, 3, 7, 0, 36, 1, 7, 0, 38, 1, 7, 0, 37, 1, 7, 0, 98, 3, 4, 0, 99, 3, - 7, 0,100, 3, 7, 0,101, 3, 7, 0,102, 3, 7, 0,103, 3, 7, 0,104, 3, 7, 0,105, 3, 7, 0,106, 3, 2, 0,107, 3, - 2, 0,240, 0, 4, 0,108, 3, 7, 0,109, 3, 7, 0,110, 3, 7, 0,111, 3, 7, 0,112, 3, 7, 0,113, 3, 7, 0,114, 3, - 7, 0,115, 3, 7, 0,116, 3, 7, 0,117, 3, 7, 0,118, 3, 7, 0,119, 3, 7, 0,120, 3, 2, 0,121, 3, 2, 0,122, 3, - 2, 0,123, 3, 2, 0,124, 3, 7, 0,125, 3, 7, 0,126, 3, 7, 0,127, 3, 7, 0,128, 3, 2, 0,129, 3, 2, 0,130, 3, - 2, 0,131, 3, 2, 0,132, 3, 7, 0,133, 3, 7, 0,134, 3, 7, 0,135, 3, 2, 0,136, 3, 2, 0,137, 3, 7, 0,138, 3, - 7, 0,139, 3, 30, 0, 63, 0, 43, 0, 29, 1, 29, 0,129, 0, 33, 0,102, 0,134, 0, 16, 0, 2, 0,140, 3, 2, 0,141, 3, - 2, 0,142, 3, 2, 0, 19, 0, 2, 0,143, 3, 2, 0,144, 3, 2, 0,145, 3, 2, 0,146, 3, 2, 0,147, 3, 2, 0,148, 3, - 2, 0,149, 3, 2, 0,150, 3, 4, 0,151, 3, 7, 0,152, 3, 7, 0,153, 3, 7, 0,154, 3,135, 0, 8, 0,135, 0, 0, 0, -135, 0, 1, 0, 4, 0,181, 2, 4, 0,155, 3, 4, 0, 19, 0, 2, 0,156, 3, 2, 0,157, 3, 38, 0,143, 0,136, 0, 13, 0, - 9, 0,158, 3, 9, 0,159, 3, 4, 0,160, 3, 4, 0,161, 3, 4, 0,162, 3, 4, 0,163, 3, 4, 0,164, 3, 4, 0,165, 3, - 4, 0,166, 3, 4, 0,167, 3, 4, 0,168, 3, 4, 0, 15, 0, 0, 0,169, 3,137, 0, 5, 0, 9, 0,170, 3, 9, 0,171, 3, - 4, 0,172, 3, 4, 0, 53, 0, 0, 0,173, 3,138, 0, 12, 0, 4, 0, 17, 0, 4, 0,174, 3, 4, 0,175, 3, 4, 0,176, 3, - 4, 0,177, 3, 4, 0,178, 3, 4, 0, 75, 0, 4, 0,179, 3, 4, 0,180, 3, 4, 0,181, 3, 4, 0,182, 3, 4, 0,183, 3, -139, 0, 4, 0, 4, 0,184, 3, 7, 0,185, 3, 2, 0, 19, 0, 2, 0,186, 3,140, 0, 9, 0,140, 0, 0, 0,140, 0, 1, 0, - 0, 0, 16, 0, 54, 0,187, 3, 56, 0,188, 3, 4, 0,181, 2, 4, 0,189, 3, 4, 0,190, 3, 4, 0,191, 3,141, 0,107, 0, -136, 0,192, 3,137, 0,193, 3,138, 0,194, 3, 4, 0,195, 3, 4, 0,107, 0, 4, 0, 34, 3, 4, 0,196, 3, 4, 0,197, 3, - 4, 0,198, 3, 4, 0,199, 3, 2, 0, 19, 0, 2, 0,200, 3, 7, 0,198, 2, 7, 0,201, 3, 7, 0,202, 3, 7, 0,203, 3, - 7, 0,204, 3, 7, 0,205, 3, 2, 0,206, 3, 2, 0,207, 3, 2, 0,208, 3, 2, 0,209, 3, 2, 0,191, 0, 2, 0,210, 3, - 2, 0,211, 3, 2, 0, 14, 3, 2, 0,212, 3, 2, 0,213, 3, 2, 0, 2, 1, 2, 0, 86, 0, 2, 0,214, 3, 2, 0,215, 3, - 2, 0,216, 3, 2, 0,217, 3, 2, 0,218, 3, 2, 0,219, 3, 2, 0,220, 3, 2, 0,221, 3, 2, 0,222, 3, 2, 0,223, 3, - 2, 0,224, 3, 2, 0, 3, 1, 2, 0,225, 3, 2, 0,226, 3, 4, 0,240, 0, 2, 0,227, 3, 2, 0,228, 3, 2, 0,229, 3, - 2, 0,230, 3, 2, 0,231, 3, 2, 0,232, 3, 2, 0,233, 3, 23, 0,234, 3, 23, 0,235, 3, 22, 0,236, 3, 11, 0,237, 3, - 2, 0,238, 3, 2, 0, 15, 0, 7, 0,239, 3, 7, 0,240, 3, 7, 0,241, 3, 7, 0,242, 3, 7, 0,243, 3, 7, 0,244, 3, - 7, 0,245, 3, 2, 0,246, 3, 2, 0,247, 3, 2, 0,248, 3, 2, 0,249, 3, 2, 0,250, 3, 2, 0,251, 3, 2, 0,252, 3, - 2, 0,253, 3, 2, 0,254, 3, 2, 0,255, 3, 2, 0, 0, 4, 2, 0, 1, 4, 2, 0, 2, 4, 2, 0, 3, 4, 4, 0, 4, 4, - 4, 0, 5, 4, 4, 0, 6, 4, 4, 0, 7, 4, 4, 0, 8, 4, 7, 0, 9, 4, 4, 0, 10, 4, 4, 0, 11, 4, 4, 0, 12, 4, - 4, 0, 13, 4, 7, 0, 14, 4, 7, 0, 15, 4, 7, 0, 16, 4, 7, 0, 17, 4, 7, 0, 18, 4, 7, 0, 19, 4, 7, 0, 20, 4, - 7, 0, 21, 4, 7, 0, 22, 4, 0, 0, 23, 4, 0, 0, 24, 4, 0, 0, 25, 4, 4, 0, 26, 4, 2, 0, 27, 4, 2, 0,251, 0, - 0, 0, 28, 4, 7, 0, 29, 4, 7, 0, 30, 4,142, 0, 5, 0, 7, 0, 31, 4, 0, 0, 17, 0, 0, 0, 41, 0, 0, 0, 53, 0, - 0, 0,251, 0,143, 0, 5, 0,143, 0, 0, 0,143, 0, 1, 0, 4, 0, 32, 4, 0, 0, 33, 4, 4, 0, 19, 0,144, 0, 4, 0, -145, 0, 34, 4, 2, 0, 19, 0, 2, 0, 35, 4, 4, 0,251, 0,146, 0, 4, 0, 2, 0, 86, 0, 2, 0, 86, 2, 2, 0, 36, 4, - 2, 0, 37, 4,147, 0, 7, 0, 2, 0, 19, 0, 2, 0, 38, 4, 2, 0, 39, 4, 2, 0, 40, 4,146, 0, 41, 4, 7, 0, 42, 4, - 4, 0, 43, 4,148, 0, 29, 0, 2, 0, 44, 4, 2, 0, 45, 4, 7, 0, 46, 4, 7, 0, 47, 4, 2, 0, 36, 4, 2, 0, 48, 4, - 7, 0, 49, 4, 7, 0, 50, 4, 2, 0, 51, 4, 2, 0, 52, 4, 2, 0, 53, 4, 2, 0, 54, 4, 7, 0, 55, 4, 7, 0, 56, 4, - 2, 0, 57, 4, 2, 0, 58, 4, 2, 0, 59, 4, 2, 0, 53, 0,144, 0, 60, 4,147, 0, 61, 4, 7, 0, 62, 4, 7, 0, 63, 4, - 0, 0, 64, 4, 0, 0, 65, 4, 0, 0, 66, 4, 0, 0, 67, 4, 0, 0, 68, 4, 0, 0, 69, 4, 0, 0, 70, 4,149, 0, 6, 0, - 2, 0, 86, 0, 0, 0, 86, 2, 0, 0, 71, 4, 0, 0, 72, 4, 0, 0, 73, 4, 0, 0, 35, 2,150, 0, 21, 0,151, 0, 74, 4, - 43, 0, 29, 1,149, 0, 75, 4,149, 0, 76, 4,149, 0, 77, 4,149, 0, 78, 4,149, 0, 79, 4,149, 0, 80, 4,149, 0, 81, 4, - 2, 0, 82, 4, 2, 0, 15, 1, 2, 0, 83, 4, 2, 0,207, 1, 0, 0, 84, 4, 0, 0, 85, 4, 0, 0, 86, 4, 0, 0, 87, 4, - 0, 0, 75, 0, 0, 0, 88, 4, 0, 0, 89, 4, 0, 0, 90, 4,152, 0, 40, 0, 26, 0, 30, 0, 38, 0, 91, 4,133, 0, 92, 4, -152, 0, 93, 4, 40, 0,183, 0, 11, 0, 94, 4,135, 0, 95, 4, 7, 0, 96, 4, 7, 0, 97, 4, 7, 0, 98, 4, 7, 0, 99, 4, - 4, 0,181, 2, 7, 0,100, 4, 2, 0,101, 4, 2, 0,102, 4, 2, 0,103, 4, 2, 0,104, 4, 2, 0, 49, 3, 2, 0,105, 4, - 2, 0,106, 4, 2, 0, 89, 1, 55, 0,110, 1, 9, 0,107, 4,134, 0,108, 4,142, 0,109, 4,148, 0,110, 4,141, 0,156, 0, -139, 0,111, 4, 33, 0,102, 0, 11, 0,112, 4, 2, 0,113, 4, 2, 0, 41, 0, 2, 0,114, 4, 2, 0,115, 4,153, 0,116, 4, - 2, 0,117, 4, 2, 0,118, 4, 2, 0,234, 2, 2, 0,192, 0,150, 0,119, 4,154, 0, 9, 0, 40, 0,183, 0, 39, 0,230, 0, - 7, 0,214, 1, 7, 0,215, 1, 7, 0, 86, 0, 7, 0,120, 4, 7, 0,121, 4, 2, 0,122, 4, 2, 0,123, 4,155, 0, 68, 0, -156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, 7, 0,128, 4, 7, 0,129, 4, - 7, 0,130, 4, 7, 0,131, 4, 7, 0,132, 4, 7, 0,133, 4, 7, 0,134, 4, 7, 0,243, 0, 7, 0,135, 4, 7, 0, 40, 0, - 2, 0,136, 4, 2, 0, 73, 4, 38, 0, 91, 4, 38, 0,137, 4,154, 0,138, 4,155, 0,139, 4,158, 0,140, 4,159, 0,141, 4, -160, 0,142, 4, 0, 0,143, 4, 2, 0,142, 3, 2, 0,144, 4, 4, 0,181, 2, 4, 0,145, 4, 2, 0,146, 4, 2, 0,147, 4, - 2, 0,148, 4, 0, 0,149, 4, 0, 0, 41, 0, 7, 0, 92, 0, 7, 0,150, 4, 7, 0,151, 4, 7, 0,152, 4, 7, 0,153, 4, - 7, 0,154, 4, 7, 0,155, 4, 7, 0,156, 4, 7, 0,150, 0, 7, 0, 96, 4, 2, 0,157, 4, 2, 0,158, 4, 2, 0,159, 4, - 2, 0,160, 4, 2, 0,114, 0, 2, 0, 83, 4, 2, 0,161, 4, 2, 0,162, 4, 2, 0,163, 4, 2, 0,164, 4, 7, 0,165, 4, - 7, 0,166, 4, 60, 0,167, 4, 11, 0,168, 4, 2, 0,169, 4, 2, 0, 14, 2, 2, 0,170, 4, 2, 0, 19, 0, 2, 0,171, 4, - 2, 0,172, 4, 2, 0,251, 0, 2, 0, 53, 0, 9, 0,173, 4,161, 0, 19, 0, 23, 0, 35, 0, 23, 0, 44, 0, 22, 0,174, 4, - 22, 0,175, 4, 22, 0,176, 4, 7, 0,177, 4, 7, 0,178, 4, 7, 0,179, 4, 7, 0,180, 4, 2, 0,181, 4, 2, 0,182, 4, - 2, 0,183, 4, 2, 0,184, 4, 2, 0,185, 4, 2, 0,186, 4, 4, 0, 19, 0, 7, 0,187, 4, 2, 0,147, 4, 0, 0, 66, 2, -156, 0, 6, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4,162, 0, 6, 0, -156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4,163, 0, 26, 0,156, 0, 0, 0, -156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, 4, 0,188, 4, 4, 0, 53, 0,161, 0,189, 4, - 9, 0,190, 4, 11, 0,191, 4, 30, 0, 63, 0, 26, 0, 64, 0, 0, 0,192, 4, 0, 0,193, 4, 2, 0,194, 4, 2, 0,195, 4, - 2, 0,196, 4, 2, 0,197, 4, 2, 0, 46, 0, 2, 0, 45, 0, 2, 0,114, 0, 2, 0,198, 4, 4, 0, 19, 0, 7, 0,199, 4, - 23, 0, 35, 0,164, 0, 29, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4,158, 0,140, 4, - 2, 0,127, 4, 2, 0,200, 4, 2, 0,201, 4, 2, 0,202, 4, 2, 0,203, 4,161, 0,189, 4, 2, 0,204, 4, 2, 0,114, 0, - 2, 0,195, 4, 2, 0,205, 4, 9, 0,206, 4, 2, 0, 83, 4, 0, 0,207, 4, 0, 0,208, 4, 2, 0,209, 4, 2, 0,210, 4, - 2, 0,190, 2, 2, 0,211, 4, 2, 0,212, 4, 0, 0, 15, 0, 0, 0, 19, 0, 0, 0, 15, 1, 0, 0,213, 4,165, 0, 15, 0, -156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4,161, 0,189, 4, 7, 0,214, 1, - 7, 0,215, 1, 2, 0,204, 4, 2, 0,120, 4, 2, 0,214, 4, 2, 0, 53, 0, 4, 0, 19, 0, 4, 0, 15, 0,166, 0, 33, 0, -156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4,167, 0,215, 4, 4, 0,216, 4, - 0, 0,217, 4, 0, 0,218, 4, 0, 0,219, 4, 2, 0, 17, 0, 2, 0,220, 4, 2, 0, 19, 0, 2, 0,221, 4, 2, 0,222, 4, - 2, 0,223, 4, 2, 0,224, 4, 2, 0, 41, 0, 4, 0, 53, 0, 0, 0,225, 4,168, 0,226, 4, 2, 0,227, 4, 2, 0,228, 4, - 2, 0,229, 4, 2, 0,182, 0, 9, 0,230, 4, 9, 0,231, 4, 9, 0,232, 4, 9, 0,233, 4, 9, 0,234, 4, 2, 0,235, 4, - 0, 0,236, 4,169, 0, 23, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, -161, 0,189, 4, 11, 0,237, 4, 2, 0,195, 4, 2, 0,238, 4, 2, 0, 19, 0, 2, 0,161, 0, 9, 0,206, 4, 11, 0,239, 4, -170, 0,240, 4, 0, 0,241, 4,171, 0,242, 4, 4, 0,243, 4, 4, 0,244, 4, 2, 0, 17, 0, 2, 0,245, 4, 2, 0,246, 4, - 2, 0,247, 4,172, 0, 30, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, -161, 0,189, 4, 40, 0, 95, 2, 39, 0,230, 0, 52, 0,248, 4, 2, 0,240, 0, 2, 0,114, 0, 2, 0,249, 4, 2, 0,250, 4, - 4, 0, 19, 0, 2, 0,251, 4, 2, 0,198, 4, 2, 0,252, 4, 2, 0,195, 4, 7, 0,120, 4, 0, 0,253, 4, 0, 0,254, 4, - 0, 0, 66, 2, 7, 0,214, 1, 7, 0,215, 1, 7, 0,255, 4, 7, 0, 0, 5, 0, 0, 1, 5, 0, 0, 2, 5, 49, 0, 3, 5, -173, 0, 11, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, 2, 0,114, 0, - 2, 0,198, 4, 2, 0, 4, 5, 2, 0, 19, 0,161, 0,189, 4,174, 0, 22, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, - 7, 0,125, 4,157, 0,126, 4, 2, 0,127, 4, 35, 0, 5, 5, 4, 0, 6, 5, 4, 0, 7, 5, 2, 0, 75, 0, 2, 0,114, 0, - 4, 0, 8, 5, 4, 0, 9, 5, 4, 0, 10, 5, 4, 0, 11, 5, 4, 0, 12, 5, 4, 0, 13, 5, 4, 0, 14, 5, 4, 0, 15, 5, - 7, 0, 16, 5, 22, 0, 17, 5, 22, 0, 18, 5,175, 0, 10, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4, -157, 0,126, 4,176, 0, 19, 5, 2, 0, 75, 0, 2, 0,114, 0, 4, 0, 41, 0, 9, 0, 20, 5,177, 0, 8, 0,156, 0, 0, 0, -156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4,161, 0,189, 4, 4, 0, 19, 0, 4, 0, 21, 5,178, 0, 18, 0, -156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4,161, 0,189, 4, 26, 0, 22, 5, 26, 0, 64, 0, - 2, 0, 19, 0, 2, 0,114, 0, 7, 0, 23, 5, 9, 0, 24, 5, 7, 0,214, 1, 7, 0,215, 1, 55, 0,110, 1, 55, 0, 25, 5, - 4, 0, 26, 5, 4, 0, 15, 0,179, 0, 42, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, - 2, 0,127, 4,161, 0,189, 4,180, 0, 27, 5, 0, 0,217, 4, 0, 0,218, 4, 0, 0,219, 4, 2, 0, 17, 0, 2, 0,228, 4, - 2, 0, 19, 0, 2, 0,221, 4, 9, 0, 24, 5, 4, 0, 28, 5, 4, 0, 29, 5, 4, 0, 30, 5, 4, 0, 31, 5, 22, 0, 32, 5, - 22, 0, 33, 5, 7, 0, 34, 5, 7, 0, 35, 5, 7, 0, 36, 5, 7, 0, 23, 5, 2, 0,227, 4, 2, 0,182, 0, 2, 0, 54, 1, - 2, 0, 37, 5, 2, 0, 15, 0, 2, 0, 41, 0, 2, 0, 38, 5, 2, 0, 39, 5, 9, 0,230, 4, 9, 0,231, 4, 9, 0,232, 4, - 9, 0,233, 4, 9, 0,234, 4, 2, 0,235, 4, 0, 0,236, 4, 49, 0, 40, 5,181, 0, 20, 0, 0, 0, 41, 5, 0, 0, 42, 5, - 0, 0, 43, 5, 0, 0, 44, 5, 0, 0, 45, 5, 0, 0, 46, 5, 0, 0, 47, 5, 0, 0, 48, 5, 0, 0, 49, 5, 0, 0, 50, 5, - 0, 0, 51, 5, 0, 0, 52, 5, 0, 0, 53, 5, 0, 0, 54, 5, 0, 0, 55, 5, 0, 0, 56, 5, 0, 0, 57, 5, 0, 0, 58, 5, - 0, 0,186, 3, 0, 0, 59, 5,182, 0, 48, 0, 0, 0, 60, 5, 0, 0, 51, 5, 0, 0, 52, 5, 0, 0, 61, 5, 0, 0, 62, 5, - 0, 0, 63, 5, 0, 0, 64, 5, 0, 0, 65, 5, 0, 0, 66, 5, 0, 0, 67, 5, 0, 0, 68, 5, 0, 0, 69, 5, 0, 0, 70, 5, - 0, 0, 71, 5, 0, 0, 72, 5, 0, 0, 73, 5, 0, 0, 74, 5, 0, 0, 75, 5, 0, 0, 76, 5, 0, 0, 77, 5, 0, 0, 78, 5, - 0, 0, 79, 5, 0, 0, 80, 5, 0, 0, 81, 5, 0, 0, 82, 5, 0, 0, 83, 5, 0, 0, 84, 5, 0, 0, 85, 5, 0, 0, 86, 5, - 0, 0, 87, 5, 0, 0, 88, 5, 0, 0, 89, 5, 0, 0, 90, 5, 0, 0, 91, 5, 0, 0, 92, 5, 0, 0, 93, 5, 0, 0, 94, 5, - 0, 0, 95, 5, 0, 0, 96, 5, 0, 0, 97, 5, 0, 0, 98, 5, 0, 0, 99, 5, 0, 0,100, 5, 0, 0,101, 5, 0, 0,102, 5, - 0, 0,103, 5, 0, 0,104, 5, 0, 0,105, 5,183, 0, 21, 0,183, 0, 0, 0,183, 0, 1, 0, 0, 0, 16, 0,181, 0,106, 5, -182, 0,107, 5,182, 0,108, 5,182, 0,109, 5,182, 0,110, 5,182, 0,111, 5,182, 0,112, 5,182, 0,113, 5,182, 0,114, 5, -182, 0,115, 5,182, 0,116, 5,182, 0,117, 5,182, 0,118, 5,182, 0,119, 5,182, 0,120, 5,182, 0,121, 5, 0, 0,122, 5, - 0, 0,123, 5,184, 0, 5, 0, 4, 0, 19, 0, 4, 0, 15, 0, 7, 0, 13, 2, 7, 0,124, 5, 7, 0,174, 1,185, 0, 56, 0, - 4, 0, 19, 0, 4, 0,125, 5, 4, 0,126, 5, 0, 0,127, 5, 0, 0,128, 5, 0, 0,129, 5, 0, 0,130, 5, 0, 0,131, 5, - 0, 0,132, 5, 0, 0,133, 5, 0, 0,134, 5, 0, 0,135, 5, 2, 0,136, 5, 2, 0,137, 5, 4, 0,138, 5, 4, 0,139, 5, - 4, 0,140, 5, 4, 0,141, 5, 2, 0,142, 5, 2, 0,143, 5, 2, 0,144, 5, 2, 0,145, 5, 4, 0,146, 5, 4, 0,147, 5, - 2, 0,148, 5, 2, 0,149, 5, 2, 0,150, 5, 2, 0,151, 5, 0, 0,152, 5, 11, 0,153, 5, 2, 0,154, 5, 2, 0,155, 5, - 2, 0,156, 5, 2, 0,157, 5,184, 0,158, 5, 2, 0,159, 5, 2, 0,160, 5, 2, 0,161, 5, 2, 0,162, 5, 4, 0,163, 5, - 4, 0,164, 5, 4, 0,165, 5, 4, 0,166, 5, 2, 0,167, 5, 2, 0,168, 5, 2, 0,169, 5, 2, 0,170, 5, 2, 0,171, 5, - 2, 0,172, 5, 2, 0,173, 5, 2, 0,174, 5, 0, 0,175, 5, 0, 0,176, 5, 7, 0,177, 5, 7, 0, 15, 0, 47, 0,178, 5, -186, 0, 18, 0, 26, 0, 30, 0, 11, 0,179, 5, 11, 0,180, 5, 11, 0,181, 5,152, 0,182, 5, 2, 0,104, 2, 2, 0,183, 5, - 2, 0,105, 2, 2, 0,184, 5, 2, 0,185, 5, 2, 0,186, 5, 2, 0,187, 5, 2, 0,188, 5, 2, 0,189, 5, 2, 0, 15, 0, - 2, 0,190, 5, 2, 0,191, 5, 2, 0,192, 5,187, 0, 5, 0,187, 0, 0, 0,187, 0, 1, 0,187, 0,193, 5, 12, 0,194, 5, - 4, 0, 19, 0,188, 0, 7, 0,188, 0, 0, 0,188, 0, 1, 0,187, 0,195, 5,187, 0,196, 5, 2, 0,235, 3, 2, 0, 19, 0, - 4, 0, 15, 0,189, 0, 17, 0,189, 0, 0, 0,189, 0, 1, 0, 0, 0,197, 5, 0, 0,198, 5, 0, 0,199, 5, 2, 0,200, 5, - 2, 0,201, 5, 2, 0,185, 5, 2, 0,186, 5, 2, 0, 19, 0, 2, 0,240, 2, 2, 0,202, 5, 2, 0,203, 5, 2, 0,204, 5, - 2, 0,205, 5, 4, 0,206, 5,189, 0,207, 5,157, 0, 30, 0,157, 0, 0, 0,157, 0, 1, 0,187, 0,195, 5,187, 0,196, 5, -187, 0,208, 5,187, 0,209, 5,186, 0,210, 5, 7, 0,211, 5, 22, 0,233, 1, 22, 0,212, 5, 22, 0,213, 5, 2, 0,214, 5, - 2, 0,215, 5, 2, 0,216, 5, 0, 0,124, 4, 0, 0,217, 5, 2, 0,218, 5, 2, 0,219, 5, 0, 0,220, 5, 0, 0,221, 5, - 0, 0,222, 5, 0, 0,223, 5, 2, 0,224, 5, 2, 0,225, 5, 2, 0,226, 5, 2, 0, 19, 0, 33, 0,102, 0, 11, 0,227, 5, - 11, 0,228, 5, 11, 0,229, 5,190, 0, 11, 0, 0, 0,230, 5, 2, 0,231, 5, 2, 0,232, 5, 2, 0,233, 5, 2, 0,234, 5, - 2, 0,235, 5, 2, 0,221, 3, 9, 0,236, 5, 9, 0,237, 5, 4, 0,238, 5, 4, 0,239, 5,191, 0, 1, 0, 0, 0,240, 5, -192, 0, 7, 0, 49, 0,241, 5,192, 0,242, 5,192, 0,243, 5,192, 0,244, 5, 2, 0,110, 0, 2, 0, 15, 0, 4, 0,245, 5, -193, 0, 11, 0,193, 0, 0, 0,193, 0, 1, 0, 4, 0,161, 0, 4, 0, 22, 0, 4, 0, 27, 0, 4, 0,246, 5,191, 0,247, 5, - 0, 0,218, 4, 4, 0,248, 5, 4, 0,249, 5,192, 0,250, 5,194, 0, 12, 0, 0, 0,137, 1, 9, 0,168, 0, 0, 0,169, 0, - 4, 0,172, 0, 4, 0,180, 0, 9, 0,173, 0, 7, 0,175, 0, 7, 0,176, 0, 9, 0,251, 5, 9, 0,252, 5, 9, 0,177, 0, - 9, 0,179, 0,195, 0, 40, 0,195, 0, 0, 0,195, 0, 1, 0, 9, 0,253, 5, 9, 0, 25, 0, 0, 0, 26, 0, 2, 0, 19, 0, - 2, 0, 17, 0, 4, 0, 22, 0, 4, 0, 67, 2, 4, 0,254, 5, 4, 0,255, 5, 4, 0, 0, 6, 4, 0, 1, 6, 4, 0, 2, 6, - 4, 0,191, 0, 4, 0, 3, 6, 4, 0, 4, 6, 7, 0, 5, 6, 7, 0, 6, 6, 4, 0,107, 0,193, 0, 7, 6, 30, 0, 63, 0, -152, 0,182, 5, 41, 0,116, 0, 7, 0, 8, 6, 7, 0, 9, 6,194, 0,231, 0,195, 0, 10, 6,195, 0, 11, 6,195, 0, 12, 6, - 11, 0, 13, 6,196, 0, 14, 6,197, 0, 15, 6, 7, 0, 16, 6, 7, 0, 17, 6, 4, 0, 18, 6, 7, 0, 19, 6, 9, 0, 20, 6, - 4, 0, 21, 6, 4, 0, 15, 0,198, 0, 4, 0,198, 0, 0, 0,198, 0, 1, 0, 11, 0, 22, 6,195, 0, 23, 6,199, 0, 6, 0, - 11, 0, 24, 6, 11, 0, 13, 6, 11, 0, 25, 6, 2, 0, 19, 0, 2, 0, 15, 0, 4, 0,161, 0,200, 0, 4, 0, 7, 0, 26, 6, - 7, 0, 89, 0, 2, 0, 27, 6, 2, 0, 28, 6,201, 0, 6, 0, 7, 0, 29, 6, 7, 0, 30, 6, 7, 0, 31, 6, 7, 0, 32, 6, - 4, 0, 33, 6, 4, 0, 34, 6,202, 0, 12, 0, 7, 0, 35, 6, 7, 0, 36, 6, 7, 0, 37, 6, 7, 0, 38, 6, 7, 0, 39, 6, - 7, 0, 40, 6, 7, 0, 41, 6, 7, 0, 42, 6, 7, 0, 43, 6, 7, 0, 44, 6, 4, 0, 99, 2, 4, 0, 45, 6,203, 0, 2, 0, - 7, 0, 31, 4, 7, 0, 15, 0,204, 0, 5, 0, 7, 0, 46, 6, 7, 0, 47, 6, 4, 0, 75, 0, 4, 0, 68, 2, 4, 0, 48, 6, -205, 0, 6, 0,205, 0, 0, 0,205, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 49, 6, 2, 0,161, 0,206, 0, 8, 0, -206, 0, 0, 0,206, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 49, 6, 2, 0,161, 0, 7, 0, 22, 0, 7, 0,107, 0, -207, 0, 45, 0,207, 0, 0, 0,207, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 49, 6, 2, 0,187, 0, 2, 0, 30, 3, - 2, 0, 50, 6, 7, 0, 51, 6, 7, 0, 52, 6, 7, 0,111, 2, 4, 0, 53, 6, 4, 0, 65, 0, 4, 0, 70, 2, 7, 0, 54, 6, - 7, 0, 55, 6, 7, 0, 56, 6, 7, 0, 57, 6, 7, 0, 58, 6, 7, 0, 59, 6, 7, 0,109, 2, 7, 0,229, 0, 7, 0, 60, 6, - 7, 0, 61, 6, 7, 0, 15, 0, 7, 0, 62, 6, 7, 0, 63, 6, 7, 0, 64, 6, 2, 0, 65, 6, 2, 0, 66, 6, 2, 0, 67, 6, - 2, 0, 68, 6, 2, 0, 69, 6, 2, 0, 70, 6, 2, 0, 71, 6, 2, 0, 72, 6, 2, 0,171, 4, 2, 0, 73, 6, 2, 0,158, 1, - 2, 0, 74, 6, 0, 0, 75, 6, 0, 0, 76, 6, 7, 0,185, 0,208, 0, 77, 6, 56, 0,111, 1,209, 0, 16, 0,209, 0, 0, 0, -209, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 49, 6, 2, 0,187, 0, 7, 0,104, 2, 7, 0,105, 2, 7, 0,106, 2, - 7, 0,201, 1, 7, 0,107, 2, 7, 0,108, 2, 7, 0, 78, 6, 7, 0,109, 2, 7, 0,110, 2, 7, 0,111, 2,171, 0, 5, 0, - 2, 0, 17, 0, 2, 0,245, 5, 2, 0, 19, 0, 2, 0, 79, 6, 26, 0, 22, 5,170, 0, 3, 0, 4, 0, 52, 0, 4, 0, 80, 6, -171, 0, 54, 0,210, 0, 12, 0,210, 0, 0, 0,210, 0, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,205, 2, 2, 0,173, 1, - 7, 0, 4, 0, 7, 0, 5, 0, 7, 0, 81, 6, 7, 0, 82, 6, 26, 0, 22, 5, 11, 0, 83, 6,211, 0, 11, 0,211, 0, 0, 0, -211, 0, 1, 0, 0, 0, 16, 0, 2, 0, 17, 0, 2, 0, 84, 6, 4, 0, 21, 0, 4, 0, 85, 6, 2, 0, 19, 0, 2, 0, 15, 0, - 9, 0, 86, 6, 9, 0, 87, 6,212, 0, 5, 0, 0, 0, 16, 0, 7, 0,243, 0, 7, 0, 88, 6, 4, 0, 89, 6, 4, 0, 15, 0, -213, 0, 4, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 41, 0, 2, 0, 53, 0,214, 0, 4, 0, 0, 0, 16, 0, 54, 0, 90, 6, - 7, 0,243, 0, 7, 0, 15, 0,215, 0, 6, 0, 2, 0, 91, 6, 2, 0, 92, 6, 2, 0, 17, 0, 2, 0, 93, 6, 0, 0, 94, 6, - 0, 0, 95, 6,216, 0, 5, 0, 4, 0, 17, 0, 4, 0, 15, 0, 0, 0, 16, 0, 0, 0, 96, 6, 0, 0, 97, 6,217, 0, 6, 0, - 0, 0, 16, 0, 0, 0, 98, 6, 2, 0, 99, 6, 2, 0,109, 2, 2, 0,240, 0, 2, 0, 53, 0,218, 0, 5, 0, 0, 0, 16, 0, - 7, 0, 89, 0, 7, 0,102, 3, 2, 0, 19, 0, 2, 0, 81, 2,219, 0, 3, 0, 0, 0, 16, 0, 4, 0, 70, 2, 4, 0,100, 6, -220, 0, 7, 0, 0, 0, 16, 0, 7, 0,102, 3, 0, 0,101, 6, 0, 0,102, 6, 2, 0,240, 0, 2, 0, 41, 0, 4, 0,103, 6, -221, 0, 3, 0, 38, 0,104, 6, 0, 0,105, 6, 0, 0,106, 6,222, 0, 17, 0,222, 0, 0, 0,222, 0, 1, 0, 2, 0, 17, 0, - 2, 0, 84, 6, 2, 0, 19, 0, 2, 0,107, 6, 2, 0,108, 6, 2, 0,109, 6, 2, 0, 41, 0, 2, 0, 53, 0, 0, 0, 16, 0, - 9, 0, 54, 0,223, 0,110, 6, 38, 0,239, 0, 2, 0, 37, 4, 2, 0,111, 6, 4, 0, 15, 0,224, 0, 10, 0, 0, 0, 16, 0, - 2, 0, 17, 0, 2, 0, 15, 0, 4, 0, 81, 2, 4, 0,112, 6, 4, 0,113, 6, 4, 0,114, 6, 4, 0,115, 6, 4, 0,116, 6, - 4, 0,117, 6,225, 0, 1, 0, 0, 0,118, 6,226, 0, 1, 0, 35, 0, 5, 5,223, 0, 18, 0,223, 0, 0, 0,223, 0, 1, 0, -223, 0,119, 6, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,120, 6, 2, 0,109, 6, 2, 0, 84, 6, 2, 0,121, 6, 2, 0, 53, 0, - 2, 0,251, 0, 0, 0, 16, 0, 9, 0, 54, 0,227, 0,110, 6,222, 0,122, 6, 2, 0, 14, 0, 2, 0,123, 6, 4, 0, 49, 3, -228, 0, 3, 0, 4, 0,124, 6, 4, 0, 15, 0, 38, 0,239, 0,229, 0, 10, 0,123, 0,125, 6, 2, 0, 17, 0, 2, 0, 19, 0, - 4, 0, 51, 6, 4, 0, 52, 6, 0, 0, 16, 0, 4, 0,126, 6, 2, 0,127, 6, 2, 0,128, 6, 7, 0,129, 6,230, 0, 10, 0, - 2, 0, 19, 0, 2, 0,130, 6, 4, 0, 51, 6, 4, 0, 52, 6, 2, 0,131, 6,196, 0, 14, 6, 2, 0, 17, 0, 2, 0,132, 6, - 2, 0,133, 6, 2, 0,134, 6,231, 0, 7, 0, 2, 0, 19, 0, 2, 0,130, 6, 4, 0, 51, 6, 4, 0, 52, 6, 2, 0, 17, 0, - 2, 0,135, 6, 7, 0,136, 6,232, 0, 9, 0, 4, 0,124, 6, 2, 0, 17, 0, 2, 0, 19, 0, 38, 0,239, 0, 71, 0,137, 6, - 0, 0, 16, 0, 7, 0,138, 6, 2, 0,139, 6, 2, 0, 15, 0,233, 0, 5, 0, 2, 0, 17, 0, 2, 0, 19, 0, 4, 0, 15, 0, -152, 0,182, 5, 38, 0, 91, 4,234, 0, 5, 0, 4, 0, 19, 0, 4, 0, 17, 0, 0, 0, 16, 0, 0, 0, 96, 6, 38, 0,239, 0, -235, 0, 10, 0, 4, 0, 19, 0, 4, 0, 17, 0, 7, 0,140, 6, 7, 0,141, 6, 7, 0,234, 0, 7, 0,235, 0, 7, 0,174, 2, - 7, 0,177, 2, 7, 0,142, 6, 7, 0,143, 6,236, 0, 9, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 0, 51, 6, 4, 0, 52, 6, - 0, 0, 16, 0, 2, 0, 41, 0, 2, 0, 44, 0, 2, 0,144, 6, 2, 0,145, 6,237, 0, 8, 0, 38, 0,239, 0, 7, 0,106, 2, - 7, 0,146, 6, 7, 0,147, 6, 7, 0,101, 2, 2, 0, 19, 0, 2, 0, 81, 2, 7, 0,148, 6,238, 0, 7, 0, 2, 0, 19, 0, - 2, 0,109, 2, 7, 0,149, 6, 7, 0,150, 6, 7, 0,151, 6, 7, 0,152, 6, 7, 0,153, 6,239, 0, 10, 0, 2, 0, 19, 0, - 2, 0, 17, 0, 4, 0, 51, 6, 4, 0, 52, 6, 0, 0, 16, 0, 2, 0,186, 3, 2, 0, 44, 0, 2, 0,144, 6, 2, 0,145, 6, - 56, 0,111, 1,240, 0, 7, 0, 4, 0, 70, 2, 4, 0,154, 6, 4, 0,155, 6, 4, 0,156, 6, 7, 0,157, 6, 7, 0,158, 6, - 0, 0,101, 6,241, 0, 7, 0, 0, 0,159, 6, 38, 0,160, 6, 0, 0,105, 6, 2, 0,161, 6, 2, 0, 41, 0, 4, 0, 53, 0, - 0, 0,106, 6,242, 0, 6, 0, 2, 0, 19, 0, 2, 0, 17, 0, 4, 0, 51, 6, 4, 0, 52, 6, 0, 0,162, 6, 0, 0,163, 6, -243, 0, 1, 0, 4, 0, 19, 0,227, 0, 10, 0,227, 0, 0, 0,227, 0, 1, 0,227, 0,119, 6, 2, 0, 17, 0, 2, 0, 19, 0, - 2, 0, 84, 6, 2, 0,164, 6, 0, 0, 16, 0, 9, 0, 54, 0, 38, 0,239, 0,244, 0, 10, 0, 7, 0,199, 2, 7, 0,165, 6, - 7, 0,166, 6, 7, 0,167, 6, 7, 0,168, 6, 4, 0, 19, 0, 7, 0,169, 6, 7, 0,170, 6, 7, 0,171, 6, 7, 0, 15, 0, -196, 0, 20, 0, 26, 0, 30, 0, 0, 0,167, 0,245, 0,172, 6, 9, 0,173, 6, 36, 0,128, 0, 36, 0,174, 6, 9, 0,175, 6, - 30, 0, 63, 0, 7, 0,136, 6, 7, 0,176, 6, 7, 0,177, 6, 7, 0,178, 6, 7, 0,179, 6, 7, 0,180, 6, 7, 0,181, 6, - 4, 0, 75, 0, 4, 0,182, 6, 0, 0,183, 6, 0, 0,184, 6, 0, 0,185, 6,246, 0, 6, 0, 26, 0, 30, 0, 7, 0,186, 6, - 7, 0,187, 6, 7, 0,188, 6, 2, 0,189, 6, 2, 0,190, 6,247, 0, 14, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, - 7, 0,125, 4,157, 0,126, 4,161, 0,189, 4,196, 0, 14, 6, 2, 0,240, 0, 2, 0,130, 6, 2, 0,214, 1, 2, 0,215, 1, - 2, 0, 19, 0, 2, 0,198, 4, 4, 0, 53, 0,248, 0, 6, 0,248, 0, 0, 0,248, 0, 1, 0, 38, 0,239, 0, 9, 0,191, 6, - 4, 0,192, 0, 4, 0, 15, 0, 56, 0, 4, 0, 26, 0, 30, 0, 11, 0,192, 6, 4, 0,112, 0, 4, 0, 15, 0,249, 0, 25, 0, -249, 0, 0, 0,249, 0, 1, 0,249, 0, 36, 0, 11, 0,193, 6, 0, 0, 16, 0, 7, 0,194, 6, 7, 0,195, 6, 7, 0,196, 6, - 7, 0,197, 6, 4, 0, 19, 0, 7, 0,198, 6, 7, 0,199, 6, 7, 0,200, 6, 7, 0,243, 0, 7, 0,166, 1, 7, 0,201, 6, - 7, 0, 68, 2, 7, 0,202, 6, 7, 0,203, 6, 7, 0,204, 6, 7, 0,205, 6, 7, 0,206, 6, 7, 0,151, 0, 2, 0,112, 0, - 2, 0, 51, 4,250, 0, 19, 0, 26, 0, 30, 0, 11, 0,207, 6, 11, 0,208, 6, 4, 0, 19, 0, 4, 0,142, 3, 2, 0,112, 2, - 2, 0,209, 6, 2, 0,112, 0, 2, 0,210, 6, 2, 0,211, 6, 2, 0,212, 6, 2, 0,213, 6, 2, 0,214, 6, 4, 0,215, 6, - 4, 0,216, 6, 4, 0,217, 6, 4, 0,218, 6, 4, 0,219, 6, 4, 0,220, 6,251, 0, 34, 0,251, 0, 0, 0,251, 0, 1, 0, - 11, 0,222, 2, 0, 0, 16, 0, 2, 0, 19, 0, 2, 0,221, 6, 2, 0,222, 6, 2, 0,223, 6, 2, 0,188, 2, 2, 0, 53, 0, - 4, 0,199, 1, 4, 0,217, 6, 4, 0,218, 6,249, 0,224, 6,251, 0, 36, 0,251, 0,225, 6, 11, 0,226, 6, 9, 0,227, 6, - 9, 0,228, 6, 9, 0,229, 6, 7, 0,234, 0, 7, 0,151, 0, 7, 0,148, 1, 7, 0,230, 6, 7, 0,231, 6, 7, 0,180, 2, - 7, 0,232, 6, 7, 0,233, 6, 7, 0,234, 6, 7, 0,235, 6, 7, 0,236, 6, 7, 0,237, 6, 7, 0,196, 1, 38, 0,238, 6, -124, 0, 6, 0, 11, 0,239, 6, 2, 0, 19, 0, 2, 0,240, 6, 7, 0,198, 2, 7, 0,241, 6, 7, 0,242, 6,252, 0, 7, 0, -252, 0, 0, 0,252, 0, 1, 0, 30, 0, 63, 0, 11, 0,171, 2, 4, 0, 19, 0, 0, 0, 16, 0, 4, 0,243, 6,123, 0, 2, 0, - 26, 0, 30, 0, 11, 0,239, 6,253, 0, 15, 0,156, 0, 0, 0,156, 0, 1, 0, 4, 0,124, 4, 7, 0,125, 4,157, 0,126, 4, - 2, 0,127, 4,161, 0,189, 4,123, 0,169, 2, 2, 0, 19, 0, 2, 0, 4, 5, 2, 0,195, 4, 2, 0,244, 6, 2, 0,198, 4, - 2, 0,245, 6, 7, 0,246, 6,254, 0, 5, 0,254, 0, 0, 0,254, 0, 1, 0, 30, 0, 63, 0, 2, 0, 19, 0, 0, 0,247, 6, -255, 0, 11, 0,255, 0, 0, 0,255, 0, 1, 0, 9, 0, 54, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 0,248, 6, 0, 0,249, 6, - 0, 0,247, 6, 7, 0,250, 6, 7, 0,251, 6, 4, 0, 15, 0, 0, 1, 9, 0, 0, 1, 0, 0, 0, 1, 1, 0, 38, 0,252, 6, - 0, 0,253, 6, 7, 0,254, 6, 2, 0,255, 6, 2, 0, 19, 0, 2, 0, 17, 0, 2, 0, 15, 0, 1, 1, 7, 0, 35, 0, 5, 5, - 25, 0, 0, 7, 4, 0, 19, 0, 4, 0, 1, 7, 11, 0, 2, 7, 38, 0,252, 6, 0, 0,253, 6, 2, 1, 11, 0, 38, 0,252, 6, - 2, 0, 3, 7, 2, 0, 19, 0, 4, 0, 4, 7, 0, 0,253, 6, 38, 0, 5, 7, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0,166, 1, - 7, 0, 8, 7, 7, 0, 9, 7, 3, 1, 6, 0, 38, 0,252, 6, 4, 0,243, 6, 4, 0, 10, 7, 4, 0, 75, 0, 4, 0, 15, 0, - 0, 0,253, 6, 4, 1, 4, 0, 38, 0,252, 6, 4, 0, 19, 0, 4, 0,243, 6, 0, 0,253, 6, 5, 1, 4, 0, 38, 0,252, 6, - 4, 0, 19, 0, 4, 0,243, 6, 0, 0,253, 6, 6, 1, 10, 0, 38, 0,252, 6, 4, 0, 11, 7, 7, 0,106, 0, 4, 0, 19, 0, - 2, 0,254, 4, 2, 0, 12, 7, 2, 0, 41, 0, 2, 0, 53, 0, 7, 0, 13, 7, 0, 0,253, 6, 7, 1, 4, 0, 38, 0,252, 6, - 4, 0, 19, 0, 4, 0,243, 6, 0, 0,253, 6, 8, 1, 10, 0, 38, 0,252, 6, 2, 0, 17, 0, 2, 0, 36, 3, 4, 0, 67, 2, - 4, 0, 52, 6, 7, 0,146, 6, 7, 0,147, 6, 4, 0, 15, 0,123, 0,125, 6, 0, 0,253, 6, 9, 1, 4, 0, 38, 0,252, 6, - 4, 0,185, 2, 4, 0, 14, 7, 0, 0,253, 6, 10, 1, 5, 0, 38, 0,252, 6, 7, 0,106, 0, 4, 0, 15, 7, 4, 0,185, 2, - 4, 0,186, 2, 11, 1, 6, 0, 38, 0,252, 6, 4, 0, 16, 7, 4, 0, 17, 7, 7, 0, 18, 7, 7, 0, 19, 7, 0, 0,253, 6, - 12, 1, 16, 0, 38, 0,252, 6, 38, 0,225, 6, 4, 0, 17, 0, 7, 0, 20, 7, 7, 0, 21, 7, 7, 0, 22, 7, 7, 0, 23, 7, - 7, 0, 24, 7, 7, 0, 25, 7, 7, 0, 26, 7, 7, 0, 27, 7, 7, 0, 28, 7, 2, 0, 19, 0, 2, 0, 15, 0, 2, 0, 41, 0, - 2, 0, 53, 0, 13, 1, 3, 0, 38, 0,252, 6, 4, 0, 19, 0, 4, 0,171, 4, 14, 1, 5, 0, 38, 0,252, 6, 4, 0, 19, 0, - 4, 0, 15, 0, 7, 0, 29, 7, 0, 0,253, 6, 15, 1, 10, 0, 38, 0,252, 6, 0, 0,253, 6, 2, 0, 30, 7, 2, 0, 31, 7, - 0, 0, 32, 7, 0, 0, 33, 7, 7, 0, 34, 7, 7, 0, 35, 7, 7, 0, 36, 7, 7, 0, 37, 7, 16, 1, 8, 0, 7, 0, 8, 0, - 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 38, 7, 7, 0, 39, 7, 2, 0, 19, 0, 2, 0,171, 4, 17, 1, 8, 0, - 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 38, 7, 7, 0, 39, 7, 2, 0, 19, 0, 2, 0, 41, 0, - 18, 1, 8, 0, 7, 0, 8, 0, 7, 0, 9, 0, 7, 0, 10, 0, 7, 0, 11, 0, 7, 0, 38, 7, 7, 0, 39, 7, 2, 0, 19, 0, - 2, 0, 41, 0, 19, 1, 10, 0, 19, 1, 0, 0, 19, 1, 1, 0, 2, 0, 17, 0, 2, 0, 19, 0, 0, 0, 40, 7, 7, 0,194, 0, - 7, 0,195, 0, 2, 0,183, 6, 2, 0, 41, 7, 38, 0,239, 0, 20, 1, 22, 0, 20, 1, 0, 0, 20, 1, 1, 0, 2, 0, 19, 0, - 2, 0,240, 0, 2, 0, 42, 7, 2, 0, 43, 7, 30, 0, 63, 0,123, 0,125, 6, 38, 0,143, 0, 7, 0, 67, 2, 7, 0, 52, 6, - 7, 0, 44, 7, 7, 0, 45, 7, 7, 0, 46, 7, 7, 0, 86, 1, 7, 0, 47, 7, 7, 0,102, 2, 7, 0,126, 6, 7, 0, 48, 7, - 0, 0, 49, 7, 0, 0, 50, 7, 11, 0,173, 2, 21, 1, 8, 0, 7, 0,174, 1, 7, 0,146, 6, 7, 0,147, 6, 9, 0, 54, 0, - 2, 0, 51, 7, 2, 0, 52, 7, 2, 0, 53, 7, 2, 0, 54, 7, 22, 1, 17, 0, 22, 1, 0, 0, 22, 1, 1, 0, 0, 0, 16, 0, - 21, 1, 55, 7, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0, 56, 7, 2, 0, 57, 7, 2, 0, 58, 7, 2, 0, 59, 7, 4, 0, 41, 0, - 7, 0, 60, 7, 7, 0, 61, 7, 4, 0, 62, 7, 4, 0, 63, 7, 22, 1, 64, 7, 23, 1, 65, 7, 24, 1, 29, 0, 24, 1, 0, 0, - 24, 1, 1, 0, 24, 1, 66, 7, 0, 0, 16, 0, 2, 0, 17, 0, 2, 0, 19, 0, 2, 0,246, 5, 2, 0, 16, 6, 2, 0, 67, 7, - 2, 0,114, 0, 2, 0, 57, 7, 2, 0,245, 5, 11, 0,120, 6, 11, 0, 68, 7, 26, 0, 22, 5, 9, 0, 69, 7, 7, 0, 60, 7, - 7, 0, 61, 7, 7, 0,201, 1, 7, 0, 70, 7, 2, 0, 71, 7, 2, 0, 72, 7, 2, 0, 73, 7, 2, 0, 74, 7, 23, 0, 75, 7, - 23, 0, 76, 7, 23, 0, 77, 7, 25, 1,129, 0, 26, 1, 78, 7, 23, 1, 6, 0, 23, 1, 0, 0, 23, 1, 1, 0, 24, 1, 79, 7, - 24, 1, 80, 7, 22, 1, 81, 7, 22, 1, 64, 7, 55, 0, 13, 0, 26, 0, 30, 0, 11, 0, 82, 7, 11, 0, 83, 7, 21, 1, 84, 7, - 4, 0, 17, 0, 4, 0, 85, 7, 4, 0, 86, 7, 4, 0, 87, 7, 11, 0, 88, 7, 26, 1, 89, 7, 9, 0, 90, 7, 9, 0, 91, 7, - 4, 0, 92, 7, 27, 1, 6, 0, 4, 0,105, 0, 4, 0,107, 0, 4, 0,245, 5, 0, 0, 93, 7, 0, 0, 94, 7, 2, 0, 15, 0, - 28, 1, 11, 0, 2, 0,185, 5, 2, 0,186, 5, 2, 0, 95, 7, 2, 0,166, 6, 2, 0, 96, 7, 2, 0, 41, 0, 7, 0,101, 2, - 2, 0, 2, 1, 0, 0, 97, 7, 0, 0,154, 3, 4, 0, 53, 0, 29, 1, 3, 0, 7, 0, 98, 7, 7, 0, 99, 7, 7, 0, 14, 0, - 30, 1, 7, 0, 0, 0,137, 1, 2, 0,223, 3, 2, 0,224, 3, 2, 0,225, 3, 2, 0,174, 3, 4, 0,107, 0, 4, 0, 34, 3, - 31, 1, 7, 0, 7, 0,100, 7, 7, 0,101, 7, 7, 0,102, 7, 7, 0,210, 1, 7, 0,103, 7, 7, 0,104, 7, 7, 0,105, 7, - 32, 1, 4, 0, 2, 0,106, 7, 2, 0,107, 7, 2, 0,108, 7, 2, 0,109, 7, 33, 1, 2, 0, 0, 0,145, 0, 0, 0,110, 7, - 34, 1, 1, 0, 0, 0, 16, 0, 35, 1, 10, 0, 0, 0,111, 7, 0, 0,112, 7, 0, 0,113, 7, 0, 0,114, 7, 2, 0, 95, 7, - 2, 0,115, 7, 7, 0,116, 7, 7, 0,117, 7, 7, 0,118, 7, 7, 0,138, 1, 36, 1, 11, 0, 0, 0,225, 3, 0, 0, 17, 0, - 0, 0,119, 7, 0, 0, 89, 0, 0, 0,120, 7, 0, 0, 86, 0, 0, 0, 35, 2, 7, 0,121, 7, 7, 0,122, 7, 7, 0,123, 7, - 7, 0,124, 7, 37, 1, 8, 0, 7, 0, 91, 6, 7, 0,106, 0, 7, 0,154, 3, 7, 0, 30, 2, 7, 0,125, 7, 7, 0,181, 0, - 7, 0,126, 7, 4, 0, 17, 0, 38, 1, 4, 0, 2, 0,127, 7, 2, 0,128, 7, 2, 0,129, 7, 2, 0, 15, 0, 39, 1, 4, 0, - 7, 0, 4, 0, 7, 0, 5, 0, 2, 0, 19, 0, 2, 0,130, 7, 40, 1, 10, 0, 2, 0, 16, 3, 2, 0, 19, 0, 7, 0,102, 3, - 7, 0,131, 7, 7, 0,132, 7, 7, 0,133, 7, 7, 0,134, 7, 39, 1,135, 7, 39, 1,136, 7, 39, 1,137, 7, 52, 0, 9, 0, - 4, 0, 19, 0, 4, 0, 44, 0, 23, 0,138, 7, 23, 0,139, 7, 40, 1,140, 7, 7, 0,141, 7, 7, 0,142, 7, 7, 0,143, 7, - 7, 0, 86, 1, 41, 1, 4, 0, 40, 0, 95, 2, 7, 0,144, 7, 7, 0, 44, 1, 7, 0, 15, 0,145, 0, 13, 0, 26, 0, 30, 0, - 2, 0, 19, 0, 2, 0,121, 4, 4, 0, 86, 0, 7, 0,145, 7, 7, 0,207, 1, 7, 0,146, 7, 7, 0,147, 7, 7, 0, 44, 1, - 2, 0, 15, 1, 2, 0, 15, 0, 43, 0, 29, 1, 41, 1,148, 7, 42, 1, 8, 0, 4, 0, 17, 0, 4, 0,106, 0, 4, 0, 19, 0, - 4, 0,240, 2, 4, 0,149, 7, 0, 0,150, 7, 0, 0, 16, 0, 9, 0, 54, 0, 81, 0, 5, 0, 42, 1,151, 7, 4, 0,152, 7, - 4, 0,153, 7, 4, 0,154, 7, 4, 0, 15, 0, 43, 1, 5, 0, 7, 0, 26, 2, 7, 0,124, 6, 7, 0,166, 1, 2, 0,155, 7, - 2, 0, 15, 0, 44, 1, 5, 0, 7, 0, 26, 2, 7, 0,156, 7, 7, 0,157, 7, 7, 0,158, 7, 7, 0,124, 6, 45, 1, 7, 0, - 4, 0,159, 7, 4, 0,160, 7, 4, 0,161, 7, 7, 0,162, 7, 7, 0,163, 7, 7, 0,164, 7, 7, 0,165, 7, 46, 1, 25, 0, - 38, 0,166, 7, 44, 1,167, 7, 43, 1,168, 7, 44, 1, 77, 6, 7, 0,169, 7, 7, 0,170, 7, 7, 0,171, 7, 7, 0,172, 7, - 7, 0,163, 7, 7, 0,164, 7, 7, 0,124, 6, 7, 0,111, 2, 7, 0,173, 7, 7, 0,174, 7, 7, 0, 86, 0, 7, 0,175, 7, - 4, 0,159, 7, 4, 0,176, 7, 4, 0, 15, 0, 4, 0, 65, 0, 4, 0,177, 7, 2, 0, 19, 0, 2, 0,178, 7, 2, 0,179, 7, - 2, 0, 14, 3, 47, 1,102, 0, 26, 0, 30, 0, 4, 0, 19, 0, 2, 0, 17, 0, 2, 0, 30, 7, 2, 0,180, 7, 2, 0,181, 7, - 2, 0,182, 7, 2, 0,183, 7, 2, 0,184, 7, 2, 0,185, 7, 2, 0,186, 7, 2, 0,187, 7, 2, 0,188, 7, 2, 0,189, 7, - 2, 0,190, 7, 2, 0,191, 7, 2, 0,192, 7, 2, 0,193, 7, 2, 0,194, 7, 2, 0,158, 1, 2, 0, 70, 6, 2, 0, 45, 6, - 2, 0,195, 7, 2, 0,196, 7, 2, 0, 12, 3, 2, 0, 13, 3, 2, 0,197, 7, 2, 0,198, 7, 2, 0,199, 7, 2, 0,200, 7, - 2, 0,201, 7, 2, 0,202, 7, 7, 0,203, 7, 7, 0,204, 7, 7, 0,205, 7, 7, 0, 51, 6, 7, 0, 52, 6, 7, 0,111, 2, - 7, 0, 58, 6, 7, 0,206, 7, 7, 0,207, 7, 7, 0,208, 7, 4, 0, 53, 6, 4, 0, 50, 6, 4, 0,209, 7, 7, 0, 54, 6, - 7, 0, 55, 6, 7, 0, 56, 6, 7, 0,210, 7, 7, 0,211, 7, 7, 0,212, 7, 7, 0,213, 7, 7, 0,214, 7, 7, 0,215, 7, - 7, 0,216, 7, 7, 0,199, 2, 7, 0, 86, 0, 7, 0,217, 7, 7, 0,218, 7, 7, 0,219, 7, 7, 0,220, 7, 7, 0,221, 7, - 7, 0,222, 7, 7, 0, 68, 2, 7, 0,223, 7, 7, 0,224, 7, 4, 0,225, 7, 7, 0,226, 7, 7, 0,227, 7, 7, 0,228, 7, - 7, 0,229, 7, 7, 0,230, 7, 7, 0,231, 7, 7, 0,232, 7, 7, 0,233, 7, 7, 0, 8, 3, 7, 0, 6, 3, 7, 0, 7, 3, - 7, 0,234, 7, 7, 0,235, 7, 7, 0,236, 7, 7, 0,237, 7, 7, 0,238, 7, 7, 0,239, 7, 7, 0,240, 7, 7, 0,241, 7, - 7, 0,242, 7, 7, 0,243, 7, 7, 0,244, 7, 7, 0,245, 7, 7, 0,246, 7, 7, 0,247, 7, 7, 0,248, 7, 7, 0,249, 7, - 7, 0,250, 7, 0, 0,251, 7, 56, 0,228, 2, 56, 0,252, 7, 38, 0,253, 7, 38, 0,254, 7, 30, 0, 63, 0,125, 0,226, 2, -117, 0, 33, 0,117, 0, 0, 0,117, 0, 1, 0, 47, 1,255, 7, 46, 1, 15, 3, 45, 1,225, 6, 48, 1, 0, 8, 49, 1, 1, 8, - 49, 1, 2, 8,126, 0,227, 2, 38, 0, 3, 8, 38, 0, 4, 8, 38, 0, 5, 8, 11, 0, 6, 8, 11, 0, 7, 8, 7, 0,185, 0, - 7, 0,195, 3, 4, 0, 70, 2, 4, 0, 19, 0, 4, 0, 53, 6, 4, 0, 8, 8, 4, 0, 9, 8, 4, 0, 10, 8, 4, 0,161, 0, - 2, 0,192, 0, 2, 0, 11, 8, 2, 0, 12, 8, 2, 0, 13, 8, 2, 0,220, 2, 2, 0, 14, 8, 0, 0, 15, 8, 2, 0, 16, 8, - 2, 0, 17, 8, 2, 0, 18, 8, 69, 78, 68, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c deleted file mode 100644 index 2f7b4754d76..00000000000 --- a/source/blender/src/previewrender.c +++ /dev/null @@ -1,912 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* global includes */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" - -#include "MTC_matrixops.h" - -#include "DNA_texture_types.h" -#include "DNA_world_types.h" -#include "DNA_camera_types.h" -#include "DNA_image_types.h" -#include "DNA_material_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_lamp_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" - -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_icons.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_texture.h" -#include "BKE_material.h" -#include "BKE_node.h" -#include "BKE_world.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "BSE_headerbuttons.h" -#include "BSE_node.h" -#include "BSE_view.h" - -#include "BIF_gl.h" -#include "BIF_screen.h" -#include "BIF_space.h" /* allqueue */ -#include "BIF_butspace.h" -#include "BIF_mywindow.h" -#include "BIF_interface.h" -#include "BIF_glutil.h" - -#include "BIF_previewrender.h" /* include ourself for prototypes */ - -#include "PIL_time.h" - -#include "RE_pipeline.h" -#include "BLO_readfile.h" - -#include "blendef.h" /* CLAMP */ -#include "interface.h" /* ui_graphics_to_window(), SOLVE! (ton) */ -#include "mydevice.h" - - -#define PR_XMIN 10 -#define PR_YMIN 5 -#define PR_XMAX 200 -#define PR_YMAX 195 - - -static void set_previewrect(RenderInfo *ri, int win) -{ - rctf viewplane; - - BLI_init_rctf(&viewplane, PR_XMIN, PR_XMAX, PR_YMIN, PR_YMAX); - - ui_graphics_to_window_rct(win, &viewplane, &ri->disprect); - - /* correction for gla draw */ - BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - glaDefine2DArea(&curarea->winrct); - - ri->pr_rectx= (ri->disprect.xmax-ri->disprect.xmin); - ri->pr_recty= (ri->disprect.ymax-ri->disprect.ymin); -} - -static void end_previewrect(void) -{ - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - // restore viewport / scissor which was set by glaDefine2DArea - glViewport(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy); - glScissor(curarea->winrct.xmin, curarea->winrct.ymin, curarea->winx, curarea->winy); - -} - -/* unused now */ -void draw_tex_crop(Tex *tex) -{ - rcti rct; - int ret= 0; - - if(tex==0) return; - - if(tex->type==TEX_IMAGE) { - if(tex->cropxmin==0.0f) ret++; - if(tex->cropymin==0.0f) ret++; - if(tex->cropxmax==1.0f) ret++; - if(tex->cropymax==1.0f) ret++; - if(ret==4) return; - - rct.xmin= PR_XMIN+2+tex->cropxmin*(PR_XMAX-PR_XMIN-4); - rct.xmax= PR_XMIN+2+tex->cropxmax*(PR_XMAX-PR_XMIN-4); - rct.ymin= PR_YMIN+2+tex->cropymin*(PR_YMAX-PR_YMIN-4); - rct.ymax= PR_YMIN+2+tex->cropymax*(PR_YMAX-PR_YMIN-4); - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - glColor3ub(0, 0, 0); - glRecti(rct.xmin+1, rct.ymin-1, rct.xmax+1, rct.ymax-1); - - glColor3ub(255, 255, 255); - glRecti(rct.xmin, rct.ymin, rct.xmax, rct.ymax); - - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - -} - -/* temporal abuse; if id_code is -1 it only does texture.... solve! */ -void BIF_preview_changed(short id_code) -{ - ScrArea *sa; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->spacetype==SPACE_BUTS) { - SpaceButs *sbuts= sa->spacedata.first; - if(sbuts->mainb==CONTEXT_SHADING) { - int tab= sbuts->tab[CONTEXT_SHADING]; - if(tab==TAB_SHADING_MAT && (id_code==ID_MA || id_code==ID_TE)) { - if (sbuts->ri) sbuts->ri->curtile= 0; - addafterqueue(sa->win, RENDERPREVIEW, 1); - } - else if(tab==TAB_SHADING_TEX && (id_code==ID_TE || id_code==-1)) { - if (sbuts->ri) sbuts->ri->curtile= 0; - addafterqueue(sa->win, RENDERPREVIEW, 1); - } - else if(tab==TAB_SHADING_LAMP && (id_code==ID_LA || id_code==ID_TE)) { - if (sbuts->ri) sbuts->ri->curtile= 0; - addafterqueue(sa->win, RENDERPREVIEW, 1); - } - else if(tab==TAB_SHADING_WORLD && (id_code==ID_WO || id_code==ID_TE)) { - if (sbuts->ri) sbuts->ri->curtile= 0; - addafterqueue(sa->win, RENDERPREVIEW, 1); - } - } - else if (sbuts->ri) - sbuts->ri->curtile= 0; /* ensure changes always result in re-render when context is restored */ - } - else if(sa->spacetype==SPACE_NODE) { - SpaceNode *snode= sa->spacedata.first; - if(snode->treetype==NTREE_SHADER && (id_code==ID_MA || id_code==ID_TE)) { - snode_tag_dirty(snode); - } - } - else if(sa->spacetype==SPACE_VIEW3D) { - View3D *vd= sa->spacedata.first; - /* if is has a renderinfo, we consider that reason for signalling */ - if (vd->ri) { - vd->ri->curtile= 0; - addafterqueue(sa->win, RENDERPREVIEW, 1); - } - } - } -} - -/* *************************** Preview for buttons *********************** */ - -static Main *pr_main= NULL; - -void BIF_preview_init_dbase(void) -{ - BlendReadError bre; - BlendFileData *bfd; - extern int datatoc_preview_blend_size; - extern char datatoc_preview_blend[]; - - G.fileflags |= G_FILE_NO_UI; - bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, &bre); - if (bfd) { - pr_main= bfd->main; - - MEM_freeN(bfd); - } - G.fileflags &= ~G_FILE_NO_UI; -} - -void BIF_preview_free_dbase(void) -{ - if(pr_main) - free_main(pr_main); -} - -/* call this with an ID pointer to initialize preview scene */ -/* call this with ID NULL to restore assigned ID pointers in preview scene */ -static Scene *preview_prepare_scene(RenderInfo *ri, int id_type, ID *id, int pr_method) -{ - Scene *sce; - Base *base; - - if(pr_main==NULL) return NULL; - - sce= pr_main->scene.first; - if(sce) { - - // sce->r.mode |= G.scene->r.mode & R_THREADS; - /* this flag tells render to not execute depsgraph or ipos etc */ - sce->r.scemode |= R_PREVIEWBUTS; - /* set world always back, is used now */ - sce->world= pr_main->world.first; - - sce->r.cfra= G.scene->r.cfra; - - if(id_type==ID_MA) { - Material *mat= (Material *)id; - - if(id) { - init_render_material(mat, 0, NULL); /* call that retrieves mode_l */ - end_render_material(mat); - - /* turn on raytracing if needed */ - if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR)) - sce->r.mode |= R_RAYTRACE; - if(mat->sss_flag & MA_DIFF_SSS) - sce->r.mode |= R_SSS; - - /* turn off fake shadows if needed */ - /* this only works in a specific case where the preview.blend contains - * an object starting with 'c' which has a material linked to it (not the obdata) - * and that material has a fake shadow texture in the active texture slot */ - for(base= sce->base.first; base; base= base->next) { - if(base->object->id.name[2]=='c') { - Material *shadmat= give_current_material(base->object, base->object->actcol); - if(shadmat) { - if (mat->mode & MA_SHADBUF) shadmat->septex = 0; - else shadmat->septex |= 1; - } - } - } - - - if(pr_method==PR_ICON_RENDER) { - if (mat->mode & MA_HALO) { - sce->lay= 1<lay= 1<lay= 1<pr_type; - if(mat->nodetree) - ntreeInitPreview(mat->nodetree, ri->pr_rectx, ri->pr_recty); - } - } - else { - sce->r.mode &= ~(R_OSA|R_RAYTRACE|R_SSS); - } - - for(base= sce->base.first; base; base= base->next) { - if(base->object->id.name[2]=='p') { - if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) - assign_material(base->object, mat, base->object->actcol); - } - } - } - else if(id_type==ID_TE) { - Tex *tex= (Tex *)id; - - sce->lay= 1<base.first; base; base= base->next) { - if(base->object->id.name[2]=='t') { - Material *mat= give_current_material(base->object, base->object->actcol); - if(mat && mat->mtex[0]) { - mat->mtex[0]->tex= tex; - /* show alpha in this case */ - if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) { - mat->mtex[0]->mapto |= MAP_ALPHA; - mat->alpha= 0.0f; - } - else { - mat->mtex[0]->mapto &= ~MAP_ALPHA; - mat->alpha= 1.0f; - } - } - } - } - } - else if(id_type==ID_LA) { - Lamp *la= (Lamp *)id; - - sce->lay= 1<r.mode &= ~R_SHADOW; - - for(base= sce->base.first; base; base= base->next) { - if(base->object->id.name[2]=='p') { - if(base->object->type==OB_LAMP) - base->object->data= la; - } - } - } - else if(id_type==ID_WO) { - sce->lay= 1<world= (World *)id; - } - - return sce; - } - - return NULL; -} - -static void previewrender_progress(RenderResult *rr, volatile rcti *renrect) -{ - RenderLayer *rl; - RenderInfo *ri= G.buts->ri; - float ofsx, ofsy; - - if(renrect) return; - - rl= rr->layers.first; - - ofsx= ri->disprect.xmin + rr->tilerect.xmin; - ofsy= ri->disprect.ymin + rr->tilerect.ymin; - - glDrawBuffer(GL_FRONT); - glaDrawPixelsSafe_to32(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, rl->rectf); - bglFlush(); - glDrawBuffer(GL_BACK); -} - - -/* called by interface_icons.c, or by BIF_previewrender_buts or by nodes... */ -void BIF_previewrender(struct ID *id, struct RenderInfo *ri, struct ScrArea *area, int pr_method) -{ - Render *re; - RenderStats *rstats; - Scene *sce; - SpaceButs *sbuts= NULL; - int oldx= ri->pr_rectx, oldy= ri->pr_recty; - char name [32]; - - if(ri->tottile && ri->curtile>=ri->tottile) return; - - /* check for return with a new event */ - if(pr_method!=PR_ICON_RENDER && qtest()) { - if(area) - addafterqueue(area->win, RENDERPREVIEW, 1); - return; - } - - /* get the stuff from the builtin preview dbase */ - sce= preview_prepare_scene(ri, GS(id->name), id, pr_method); - if(sce==NULL) return; - - /* set drawing conditions OK */ - if(area) { - sbuts= area->spacedata.first; /* needed for flag */ - - set_previewrect(ri, area->win); // uses UImat - - /* because preview render size can differs */ - if(ri->rect && (oldx!=ri->pr_rectx || oldy!=ri->pr_recty)) { - MEM_freeN(ri->rect); - ri->rect= NULL; - ri->curtile= 0; - } - } - - sprintf(name, "ButsPreview %d", area?area->win:0); - re= RE_GetRender(name); - - /* full refreshed render from first tile */ - if(re==NULL || ri->curtile==0) { - - re= RE_NewRender(name); - - /* handle cases */ - if(pr_method==PR_DRAW_RENDER) { - RE_display_draw_cb(re, previewrender_progress); - RE_test_break_cb(re, qtest); - sce->r.scemode |= R_NODE_PREVIEW; - if(sbuts->flag & SB_PRV_OSA) - sce->r.mode |= R_OSA; - sce->r.scemode &= ~R_NO_IMAGE_LOAD; - } - else if(pr_method==PR_DO_RENDER) { - RE_test_break_cb(re, qtest); - sce->r.scemode |= R_NODE_PREVIEW; - sce->r.scemode &= ~R_NO_IMAGE_LOAD; - } - else { /* PR_ICON_RENDER */ - sce->r.scemode &= ~R_NODE_PREVIEW; - sce->r.scemode |= R_NO_IMAGE_LOAD; - } - - /* allocates render result */ - RE_InitState(re, &sce->r, ri->pr_rectx, ri->pr_recty, NULL); - - /* enforce preview image clear */ - if(GS(id->name)==ID_MA) { - Material *ma= (Material *)id; - ntreeClearPreview(ma->nodetree); - } - } - /* entire cycle for render engine */ - RE_SetCamera(re, sce->camera); - RE_Database_FromScene(re, sce, 1); - RE_TileProcessor(re, ri->curtile, 0); // actual render engine - RE_Database_Free(re); - - /* handle results */ - if(pr_method==PR_ICON_RENDER) { - if(ri->rect==NULL) - ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender"); - RE_ResultGet32(re, ri->rect); - } - else { - rstats= RE_GetStats(re); - - if(rstats->partsdone!=ri->curtile) { - if(ri->rect==NULL) - ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender"); - RE_ResultGet32(re, ri->rect); - } - - if(rstats->totpart==rstats->partsdone && rstats->partsdone) { - if(GS(id->name)==ID_MA && ((Material *)id)->use_nodes) - allqueue(REDRAWNODE, 0); - allqueue(REDRAWBUTSSHADING, 0); - } - else { - if(pr_method==PR_DRAW_RENDER && qtest()) - addafterqueue(area->win, RENDERPREVIEW, 1); - } - - ri->curtile= rstats->partsdone; - ri->tottile= rstats->totpart; - } - - /* unassign the pointers, reset vars */ - preview_prepare_scene(ri, GS(id->name), NULL, 0); - -} - - -/* afterqueue call */ -void BIF_previewrender_buts(SpaceButs *sbuts) -{ - uiBlock *block; - struct ID* id = 0; - struct ID* idfrom = 0; - struct ID* idshow = 0; - Object *ob; - - if (!sbuts->ri) return; - - /* we safely assume curarea has panel "preview" */ - /* quick hack for now, later on preview should become uiBlock itself */ - - block= uiFindOpenPanelBlockName(&curarea->uiblocks, "Preview"); - if(block==NULL) return; - - ob= ((G.scene->basact)? (G.scene->basact)->object: 0); - - /* we cant trust this global lockpoin.. for example with headerless window */ - buttons_active_id(&id, &idfrom); - G.buts->lockpoin= id; - - if(sbuts->mainb==CONTEXT_SHADING) { - int tab= sbuts->tab[CONTEXT_SHADING]; - - if(tab==TAB_SHADING_MAT) - idshow = sbuts->lockpoin; - else if(tab==TAB_SHADING_TEX) - idshow = sbuts->lockpoin; - else if(tab==TAB_SHADING_LAMP) { - if(ob && ob->type==OB_LAMP) idshow= ob->data; - } - else if(tab==TAB_SHADING_WORLD) - idshow = sbuts->lockpoin; - } - else if(sbuts->mainb==CONTEXT_OBJECT) { - if(ob && ob->type==OB_LAMP) idshow = ob->data; - } - - if (idshow) { - BKE_icon_changed(BKE_icon_getid(idshow)); - uiPanelPush(block); - BIF_previewrender(idshow, sbuts->ri, sbuts->area, PR_DRAW_RENDER); - uiPanelPop(block); - end_previewrect(); - } - else { - /* no active block to draw. But we do draw black if possible */ - if(sbuts->ri->rect) { - memset(sbuts->ri->rect, 0, sizeof(int)*sbuts->ri->pr_rectx*sbuts->ri->pr_recty); - sbuts->ri->tottile= 10000; - addqueue(curarea->win, REDRAW, 1); - } - return; - } -} - - -/* is panel callback, supposed to be called with correct panel offset matrix */ -void BIF_previewdraw(ScrArea *sa, uiBlock *block) -{ - SpaceButs *sbuts= sa->spacedata.first; - short id_code= 0; - - if(sbuts->lockpoin) { - ID *id= sbuts->lockpoin; - id_code= GS(id->name); - } - - if (!sbuts->ri) { - sbuts->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo"); - sbuts->ri->tottile = 10000; - } - - if (sbuts->ri->rect==NULL) BIF_preview_changed(id_code); - else { - RenderInfo *ri= sbuts->ri; - int oldx= ri->pr_rectx, oldy= ri->pr_recty; - - /* we now do scalable previews! */ - set_previewrect(ri, sa->win); - if( ABS(oldx-ri->pr_rectx)<2 && ABS(oldy-ri->pr_recty)<2 ) { - /* restore old values for drawing! */ - ri->pr_rectx= oldx; - ri->pr_recty= oldy; - glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect); - } - else { - MEM_freeN(ri->rect); - ri->rect= NULL; - sbuts->ri->curtile= 0; - } - end_previewrect(); - } - if(sbuts->ri->curtile==0) BIF_preview_changed(id_code); - -} - -/* *************************** Preview for 3d window *********************** */ -static void view3d_previewrender_stats(RenderStats *rs) -{ -// if(rs->convertdone) -// printf("rendered %d %.3f\n", rs->partsdone, rs->lastframetime); -} - -static void view3d_previewrender_progress(RenderResult *rr, volatile rcti *renrect) -{ - RenderLayer *rl; - int ofsx, ofsy; - - if(renrect) return; - - rl= rr->layers.first; - - /* this case is when we render envmaps... */ - if(rr->rectx>G.vd->ri->pr_rectx || rr->recty>G.vd->ri->pr_recty) - return; - - ofsx= G.vd->ri->disprect.xmin + rr->tilerect.xmin; - ofsy= G.vd->ri->disprect.ymin + rr->tilerect.ymin; - - glDrawBuffer(GL_FRONT); - glaDefine2DArea(&curarea->winrct); - glaDrawPixelsSafe_to32(ofsx, ofsy, rr->rectx, rr->recty, rr->rectx, rl->rectf); - bglFlush(); - glDrawBuffer(GL_BACK); - -} - -void BIF_view3d_previewrender_signal(ScrArea *sa, short signal) -{ - View3D *v3d= sa->spacedata.first; - - /* this can be called from other window... solve! */ - if(sa->spacetype!=SPACE_VIEW3D) - v3d= G.vd; - - if(v3d && v3d->ri) { - RenderInfo *ri= v3d->ri; - ri->status &= ~signal; - ri->curtile= 0; - //printf("preview signal %d\n", signal); - if(ri->re && (signal & PR_DBASE)) - RE_Database_Free(ri->re); - - addafterqueue(sa->win, RENDERPREVIEW, 1); - } -} - -void BIF_view3d_previewrender_free(View3D *v3d) -{ - - if(v3d->ri) { - RenderInfo *ri= v3d->ri; - if(ri->re) { -// printf("free render\n"); - RE_Database_Free(ri->re); - RE_FreeRender(ri->re); - ri->re= NULL; - } - if (v3d->ri->rect) MEM_freeN(v3d->ri->rect); - MEM_freeN(v3d->ri); - v3d->ri= NULL; - } -} - -/* returns 1 if OK, do not call while in panel space! */ -static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderInfo *ri, float *clipsta, float *clipend, int *ortho, float *pixsize) -{ - int rectx, recty; - uiBlock *block; - - block= uiFindOpenPanelBlockName(&curarea->uiblocks, "Preview"); - if(block==NULL) return 0; - - /* calculate preview rect size */ - BLI_init_rctf(viewplane, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f); - uiPanelPush(block); - ui_graphics_to_window_rct(sa->win, viewplane, &ri->disprect); - uiPanelPop(block); - - /* correction for gla draw */ - BLI_translate_rcti(&ri->disprect, -sa->winrct.xmin, -sa->winrct.ymin); - - *ortho= get_view3d_viewplane(sa->winx, sa->winy, viewplane, clipsta, clipend, pixsize); - - rectx= ri->disprect.xmax - ri->disprect.xmin; - recty= ri->disprect.ymax - ri->disprect.ymin; - - if(rectx<4 || recty<4) return 0; - - if(ri->rect && (rectx!=ri->pr_rectx || recty!=ri->pr_recty)) { - MEM_freeN(ri->rect); - ri->rect= NULL; - ri->curtile= 0; - printf("changed size\n"); - } - ri->pr_rectx= rectx; - ri->pr_recty= recty; - - return 1; -} - -/* called before a panel gets moved/scaled, makes sure we can see through */ -void BIF_view3d_previewrender_clear(ScrArea *sa) -{ - View3D *v3d= sa->spacedata.first; - - if(v3d->ri) { - RenderInfo *ri= v3d->ri; - ri->curtile= 0; - if(ri->rect) - MEM_freeN(ri->rect); - ri->rect= NULL; - } -} - -/* afterqueue call */ -void BIF_view3d_previewrender(ScrArea *sa) -{ - View3D *v3d= sa->spacedata.first; - Render *re; - RenderInfo *ri; /* preview struct! */ - RenderStats *rstats; - RenderData rdata; - rctf viewplane; - float clipsta, clipend, pixsize; - int orth; - - /* first get the render info right */ - if (!v3d->ri) { - ri= v3d->ri= MEM_callocN(sizeof(RenderInfo), "butsrenderinfo"); - ri->tottile= 10000; - } - ri= v3d->ri; - - if(0==view3d_previewrender_get_rects(sa, &viewplane, ri, &clipsta, &clipend, &orth, &pixsize)) - return; - - /* render is finished, so return */ - if(ri->tottile && ri->curtile>=ri->tottile) return; - - /* or return with a new event */ - if(qtest()) { - addafterqueue(curarea->win, RENDERPREVIEW, 1); - return; - } - //printf("Enter previewrender\n"); - /* ok, are we rendering all over? */ - if(ri->re==NULL) { - char name[32]; - - ri->status= 0; - - sprintf(name, "View3dPreview %d", sa->win); - re= ri->re= RE_NewRender(name); - RE_display_draw_cb(re, view3d_previewrender_progress); - RE_stats_draw_cb(re, view3d_previewrender_stats); - RE_test_break_cb(re, qtest); - - /* no osa, blur, seq, layers, etc for preview render */ - rdata= G.scene->r; - rdata.mode &= ~(R_OSA|R_MBLUR); - rdata.scemode &= ~(R_DOSEQ|R_DOCOMP|R_FREE_IMAGE); - rdata.layers.first= rdata.layers.last= NULL; - rdata.renderer= R_INTERN; - - RE_InitState(re, &rdata, sa->winx, sa->winy, &ri->disprect); - - if(orth) - RE_SetOrtho(re, &viewplane, clipsta, clipend); - else - RE_SetWindow(re, &viewplane, clipsta, clipend); - RE_SetPixelSize(re, pixsize); - - /* until here are no escapes */ - ri->status |= PR_DISPRECT; - ri->curtile= 0; - //printf("new render\n"); - } - - re= ri->re; - - PIL_sleep_ms(100); /* wait 0.1 second if theres really no event... */ - if(qtest()==0) { - - /* check status */ - if((ri->status & PR_DISPRECT)==0) { - RE_SetDispRect(ri->re, &ri->disprect); - if(orth) - RE_SetOrtho(ri->re, &viewplane, clipsta, clipend); - else - RE_SetWindow(ri->re, &viewplane, clipsta, clipend); - RE_SetPixelSize(re, pixsize); - ri->status |= PR_DISPRECT; - ri->curtile= 0; - //printf("disprect update\n"); - } - if((ri->status & PR_DBASE)==0) { - unsigned int lay= G.scene->lay; - - RE_SetView(re, G.vd->viewmat); - - /* allow localview render for objects with lights in normal layers */ - if(v3d->lay & 0xFF000000) - G.scene->lay |= v3d->lay; - else G.scene->lay= v3d->lay; - - RE_Database_FromScene(re, G.scene, 0); // 0= dont use camera view - G.scene->lay= lay; - - rstats= RE_GetStats(re); - if(rstats->convertdone) - ri->status |= PR_DBASE|PR_PROJECTED|PR_ROTATED; - ri->curtile= 0; - - /* database can have created render-resol data... */ - if(rstats->convertdone) - DAG_scene_update_flags(G.scene, screen_view3d_layers()); - - //printf("dbase update\n"); - } - if((ri->status & PR_PROJECTED)==0) { - if(ri->status & PR_DBASE) { - if(orth) - RE_SetOrtho(ri->re, &viewplane, clipsta, clipend); - else - RE_SetWindow(ri->re, &viewplane, clipsta, clipend); - RE_DataBase_ApplyWindow(re); - ri->status |= PR_PROJECTED; - } - ri->curtile= 0; - //printf("project update\n"); - } - - /* OK, can we enter render code? */ - if(ri->status==(PR_DISPRECT|PR_DBASE|PR_PROJECTED|PR_ROTATED)) { - //printf("curtile %d tottile %d\n", ri->curtile, ri->tottile); - RE_TileProcessor(ri->re, ri->curtile, 0); - - if(ri->rect==NULL) - ri->rect= MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "preview view3d rect"); - - RE_ResultGet32(ri->re, ri->rect); - } - - rstats= RE_GetStats(ri->re); - if(rstats->totpart==rstats->partsdone && rstats->partsdone) - addqueue(sa->win, REDRAW, 1); - else - addafterqueue(curarea->win, RENDERPREVIEW, 1); - - ri->curtile= rstats->partsdone; - ri->tottile= rstats->totpart; - } - else { - addafterqueue(curarea->win, RENDERPREVIEW, 1); - } - - //printf("\n"); -} - -/* in panel space! */ -static void view3d_previewdraw_rect(ScrArea *sa, uiBlock *block, RenderInfo *ri) -{ - rctf dispf; - - if(ri->rect==NULL) - return; - - BLI_init_rctf(&dispf, 15.0f, (block->maxx - block->minx)-15.0f, 15.0f, (block->maxy - block->miny)-15.0f); - ui_graphics_to_window_rct(sa->win, &dispf, &ri->disprect); - - /* correction for gla draw */ - BLI_translate_rcti(&ri->disprect, -curarea->winrct.xmin, -curarea->winrct.ymin); - - /* when panel scale changed, free rect */ - if(ri->disprect.xmax-ri->disprect.xmin != ri->pr_rectx || - ri->disprect.ymax-ri->disprect.ymin != ri->pr_recty) { - MEM_freeN(ri->rect); - ri->rect= NULL; - } - else { - glaDefine2DArea(&sa->winrct); - glaDrawPixelsSafe(ri->disprect.xmin, ri->disprect.ymin, ri->pr_rectx, ri->pr_recty, ri->pr_rectx, GL_RGBA, GL_UNSIGNED_BYTE, ri->rect); - } -} - -/* is panel callback, supposed to be called with correct panel offset matrix */ -void BIF_view3d_previewdraw(struct ScrArea *sa, struct uiBlock *block) -{ - View3D *v3d= sa->spacedata.first; - - if (v3d->ri==NULL || v3d->ri->rect==NULL) - addafterqueue(sa->win, RENDERPREVIEW, 1); - else { - view3d_previewdraw_rect(sa, block, v3d->ri); - if(v3d->ri->curtile==0) - addafterqueue(sa->win, RENDERPREVIEW, 1); - } -} - diff --git a/source/blender/src/prvicons.c b/source/blender/src/prvicons.c deleted file mode 100644 index 6222090705a..00000000000 --- a/source/blender/src/prvicons.c +++ /dev/null @@ -1,436 +0,0 @@ -/* DataToC output of file */ - -int datatoc_prvicons_size= 13732; -char datatoc_prvicons[]= { -137, 80, 78, 71, - 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0,192, 0, 0, 0,192, 8, 6, 0, 0, 0, 82,220,108, 7, 0, 0, 0, - 6, 98, 75, 71, 68, 0, 0, 0, 0, 0, 0,249, 67,187,127, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, - 0,154,156, 24, 0, 0, 0, 7,116, 73, 77, 69, 7,215, 8, 27, 17, 57, 33, 43,142, 73,203, 0, 0, 0, 29,116, 69, 88,116, 67, -111,109,109,101,110,116, 0, 67,114,101, 97,116,101,100, 32,119,105,116,104, 32, 84,104,101, 32, 71, 73, 77, 80,239,100, 37,110, - 0, 0, 32, 0, 73, 68, 65, 84,120,218,237,125,121,124, 84,213,249,254,115,238,189, 51,147,201,158, 12, 73, 72,216, 3,200, 98, - 88, 69, 66, 38, 65, 16, 20,165, 40,213,162, 32, 45,138,203, 79,176,223, 42,180,110, 72,235,190, 97, 91, 91, 21,181,149,182, 90, - 20, 42, 10, 66, 80,164, 34, 59,146, 5,194, 30, 18, 8, 75, 2,201,144,144,201, 62, 73,102,189,247,158,243,251, 35,235, 36, 51, -217,200,100, 38,229, 62,159,207,124,146,123,239,153, 59,207, 61,247,125,207,121,223,247,156,243, 30, 64,129, 2, 5, 10, 20, 40, - 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, - 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80, -160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, - 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, - 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,160, 64,129, 2, 5, 10, 20, 40, 80,208, 18, 36, 41, 41,105, -180, 32, 8,143, 16, 66, 72,119,223,156, 49, 22, 46,203,242,112,198,216,203, 41, 41, 41,251, 60,241, 0,189,157,191, 2,239, 43, -192, 61, 49, 49, 49, 27,230,204,153,227,215,157, 55,206,206,206,198,169, 83,167, 16, 25, 25, 9,131,193, 64, 37, 73,154,150,146, -146,146,226, 1, 5,232,213,252, 21,120, 23, 2, 0, 68, 71, 71,219, 23, 46, 92,216,109, 2,180,105,211, 38, 24, 12, 6, 60,250, -232,163,224, 56, 14, 7, 15, 30,228, 50, 51, 51, 15, 36, 38, 38, 38,164,166,166,102,116,247, 67,244,118,254, 10,188, 7,174,187, -111, 40, 73, 18,214,175, 95,143, 5, 11, 22,160,111,223,190,240,247,247, 71, 98, 98, 34,226,226,226, 56,149, 74,149,174,215,235, - 39,250,114,133,244,118,254, 10,188,172, 0, 6,131, 1,193,193,193,136,136,136,128, 32, 8,208,106,181,208,106,181,208,235,245, - 24, 57,114, 36,167, 86,171, 51,244,122,125,156,175, 86, 72,111,231,175,192,203, 10, 80, 88, 88, 8,157, 78,215,120,172,209,104, - 26,133, 40, 49, 49, 17,195,135, 15,231,213,106,245,137,132,132,132, 27,124,177, 66,122, 59,127, 5, 94, 86,128,192,192, 64, 88, -173, 86,167,115,254,254,254,141,159,164,164, 36,196,198,198, 10,126,126,126, 89,122,189, 62,214,215, 42,164,183,243, 87,224,101, - 5,208,233,116, 48,153, 76,173,206, 55,180,162, 90,173, 22, 73, 73, 73, 24, 56,112,160, 74,163,209,156,213,235,245, 3,124,169, - 66,122, 59,127, 5,157,131,208,221, 55,140,138,138, 66, 77, 77, 13,172, 86, 43,180, 90, 45, 0,160,170,170, 10,165,165,165, 40, - 47, 47, 71,105,105, 41, 44, 22, 11, 6, 15, 30, 12, 81, 20,213, 87,175, 94, 61,175,215,235,135,164,165,165, 21,251, 66,133,244, -118,254, 10,188,172, 0,106,181, 26,227,199,143, 71, 78, 78, 14,116, 58, 29, 14, 28, 56,128,130,130, 2,196,198,198, 34, 42, 42, - 10, 67,135, 14, 5,207,243, 72, 77, 77,133,209,104,132, 40,138,126, 26,141, 38, 79,175,215, 15, 74, 75, 75, 43,245,118,133,244, -118,254, 10,188,172, 0, 0, 48,109,218, 52,124,250,233,167, 16, 69, 17,143, 63,254, 56,102,206,156, 9,181, 90,237, 84,102,209, -162, 69, 48,153, 76, 88,183,110, 29,182,108,217,162,165,148,190, 9,224, 9, 0,204,219,149,210,219,249, 43,240,162, 15, 0, 0, - 9, 9, 9, 8, 12, 12,196, 71, 31,125,132,217,179,103,183, 18,158, 6,132,132,132,224,201, 39,159,132, 70,163, 97, 86,171,117, -108,104,104,104,127, 0,196,219,149,210,219,249, 43,240,178, 2, 4, 5, 5, 97,205,154, 53,136,137,137,233, 80,249, 33, 67,134, - 72, 86,171,213,204,243,252,253,190, 32, 64,189,157,191, 2, 47, 43, 0, 0, 8, 66,199,173, 43, 63, 63, 63, 70, 41,149, 24, 99, - 26, 95, 17,160,222,206, 95,129,151, 21,160,139,144,123,121,125,202,138, 72, 41, 10,208, 37, 16, 66,100, 66, 72,175, 21,160,222, -206,255,122,133,208, 19, 63, 98,178,216,193, 24,131, 74,224, 17,160, 81,185,109, 61, 25, 99, 50,122,111, 20,165,183,243, 87, 20, -192, 19,200, 45,174,194,152,103, 62, 5, 0, 68,135, 5,226,252,234, 37,224,185,122, 51,153, 81, 56,142,252, 11,183, 71, 92,225, - 39,223, 22, 56, 50, 88,173,213,234, 99,111,136,134, 64,254, 25,249,155,244,139,158,230,166, 82,185, 85, 70,136,162,216,217, 30, -128, 2,160,138, 15,160, 40,128, 19, 62, 63,112,186,241,255,171,149,181,248,241,100, 30,126, 54,113, 40, 0,128,154,174,192,126, -124, 61,146,194,192, 35, 76, 51, 28,192,112, 0,183, 17,137,255,216,155,194,223,145,235, 45,148,132, 1,104, 48,129,148, 30, 64, -241, 1,234,109, 2,202,240,159,159,178,157,206,125,113, 32,171,241,127, 90,118,190,213,119, 24, 80, 30,190, 60,165,192,155,194, -223,197,251, 80,197, 9, 86, 20,192, 9, 59, 79, 93,194,213, 42, 51,180,234,166,142,230,135, 19,121, 40,173,182,212, 41, 72,217, - 5,184,208,128, 19,189,169, 2,155, 41, 1,173,247, 1, 20, 40, 10,224,220,218,191,255,240, 76, 52, 44, 89, 23,101,138, 13, 41, -103,234, 36,166,212,101, 15,112,220,215, 43, 77, 20, 69,167, 15, 0, 13,165, 20, 0,244, 0,120, 69,172, 20, 5, 64,105,181, 5, -255, 61,158,139, 65, 17, 33, 88,116, 75, 28,102,196, 13,106,230, 23,100,213,247, 0, 46, 20,128,178,227,189,173, 18, 25, 99, 0, - 16, 7,160, 76,241, 1, 20, 39, 24, 0,176, 33,229, 12, 68,153,226,161,105, 55,130, 16,224,161,105, 99,176,231,116, 62, 0,224, -236,149,114,100,100,102, 97,148,189,166,213,247,204,140,157, 0,128,146,143,167, 7,242,212, 54, 7,192, 72, 70,137,131,227,113, - 90,148,232,145,168,223, 30, 54,250,168, 2,252, 4,160, 90, 17, 41,165, 7,104,108,229, 57, 66,240,224,180,186,229,179,115, 39, - 13, 67, 88, 64, 83,226,134,181,123, 91,155,250,162,204, 44,187,114,228, 75,229,171,227,159,225,101, 91, 49, 24,190, 2,195,171, -132,176,183, 25,101,219, 4,142,228, 85,172, 78, 88,234,139, 21,233,112, 56,202, 25, 99,134,122,103, 88,193,245,172, 0, 71,115, -139,113,246, 74, 57,102,142, 25,132,254,225, 65, 0, 0,141,138,199,130,196, 81,141,101, 54,159, 42,133, 85,118, 54,151,171,172, -180,224, 23,113,170,117, 0,121, 23, 64,128,139, 91,251, 51,176, 79,202, 62, 72, 88,229,131,117, 25, 98,179,217,250,195,247,166, -151, 40,232,105, 5, 88,187,191, 46,246,191,120,250, 24,167,243, 15, 79,111, 74,166, 80,227, 96,216, 86,230, 60,219, 82, 23,192, - 15, 35,192,130,246,238, 79, 8,123,166,236,189, 41,163,188, 85,105, 42,149,170, 85, 40,149, 16, 2, 74,169, 77, 81,128,235, 92, - 1, 44,118, 17,223,164,159,131, 46, 72,139,187,110, 26,234,116,109,236,160, 72,140, 27, 28,217,228, 39, 24, 7, 57,147, 33, 16, - 24, 96, 7,240, 79, 2,242, 75, 2,242, 75, 6, 28,112, 37,131,132,195,115,222,170,180,102,209,159, 70,225,231, 56, 14, 42,149, -234, 40,234,162, 64,202,104,240,245,170, 0, 91,143, 92, 64,181,213,142, 7, 18, 71, 65, 45,180,142, 8, 62,220,172, 87, 72,175, - 14,199,101, 91,147,165, 67, 41,236,162,204,238,214, 45, 59,180, 36,124, 89,250,134,240,101,233, 27,116, 21,126,183, 1,200,105, -221, 13,224,198,107, 17, 96, 15, 33,166,222, 7, 96, 0, 84,138,120, 93,135, 10,208, 16,251, 95, 60,205,117,238,168,249,250,145, -240, 19,184,250,232, 9,193,134,226,129,141,215, 14, 92, 52,255, 43,250,119,135,247, 56,201,249,171,251, 37, 66, 88,178,139,216, -139, 79,229,229,169,207,205, 43,212,127, 72,125,221,106, 20, 17,187,142, 20,224, 82,137, 9, 7,207, 26, 48, 49, 54, 10,113, 3, - 35, 92,150, 9, 11,240,195, 93,195,154,150, 24,126,109, 28, 8,153, 17, 88, 37, 88, 95,218,102,220,233, 70,188,170, 92,156,243, -243,149, 74,164,148,130, 82, 10, 73,146, 56, 0, 13,221,139, 31,234,204, 57, 5, 62,140,110, 29, 7,248,226, 64, 22, 24, 3,146, - 70, 14, 64,102,126,137,219,114, 19,131, 42,241, 13,234, 82,142, 92,117,248, 97,127,101, 36, 2,107, 11, 47, 24,107, 36,171,171, -242,140,161,159,139,211, 62,149,129,161,190, 7, 16,209, 52, 16,102, 82,196,235, 58, 82, 0,202, 24,214,255, 84,103,254,172,254, -239, 81,172,254,239,209, 54, 74,107,157,142, 54, 24, 7,226, 94,114,165,202,221,130, 18, 2, 50,136,181, 30, 96,205,242, 86,165, - 53, 68,128,154,251, 18,140, 49,112, 28, 39,214,215,169,168,136,214,117,166, 0,187, 78, 93, 70, 97, 69, 45,166,142, 26,128,219, -199, 14,118, 95, 80,118,192,126,116, 45, 14,155,194,177,187, 50, 10, 0,240, 99,121, 95,220,168,209, 88, 40,165,173,166, 19,151, -175,142, 15,102, 96,183,182,234, 21, 0,175,231,234, 87,169, 84, 78, 74,192,113,156, 67, 49,123,174, 83, 5,104,112,126, 95,186, - 79,143,164,145,253,221,150,147,138, 78,192,106, 60,143,139,186, 64,236, 62, 86,167, 0, 14,198,225, 44, 63,108, 24, 33, 57,178, - 11,211,226, 9,198, 16,220,178,195,225,101,124,233, 11, 21,216,208, 27,168, 84, 42,155, 90,173,110,112,128, 21, 92, 79, 78,112, -121,141, 21,219,143,231, 98, 72,100, 8, 18, 71,244,111,219, 84,170,159, 1, 58,204,191, 22, 55, 7, 87, 52,158, 63, 45,247, 31, - 76,235,167, 84, 54,160,236,195,201, 51, 24,195, 75, 46,140,162, 45, 97,191, 59,116,217,135,236,255, 82, 65, 16,120, 40, 19,225, -174,207, 30,224,171,212,179,112, 72, 50, 22,221,114, 35,218,219,169,171,249, 26,128, 95, 70,229,227, 72,117, 56, 0, 32,207, 22, - 36,124,241,127,250, 79,110,139,170,120,141,112, 40,231, 25,110,167, 12,207,160,117, 40,209,194,113,228, 89, 95,170, 68,158,231, - 3,120,158,175, 97,140, 29,135, 50, 23,232,250,235, 1,214,238, 63, 13,142, 16, 44,186,165,253,125, 35,154,175, 2,251,121, 68, - 33,252, 57,169,241,120,111,109,255, 49, 60,193, 55, 28,195, 62, 6,252,158,180, 22,126, 10, 66, 30, 14,123, 50, 45,223,199,234, -145, 17, 66,168, 39, 54,234, 83,224,163, 61, 64, 65, 89, 53,118,158,186,132,242, 26, 43,178, 13,101,232, 23, 30,136, 31, 79,230, - 1, 0,126, 54,113, 40, 98,194, 2, 91, 75,137,100, 3,173, 42, 64,165,164,198,119,165,117,243,128, 6,105, 45, 56,107,174, 51, -241,183,148,246,199,232,128,186, 25,197,183,134,149, 96,160,159,197,201,125, 32,192,178,240,167,210, 55,249, 82, 5,138,162,216, - 16, 2,149, 91,154,112, 10,254,135, 21, 32,203, 80,134,101,159,237,110, 60, 46,172,168,109, 60, 30,214, 55,204,165, 2,208,242, - 92,128, 81, 20,219,253,240,252,197,113,173,174, 87, 75,170,198,243,159,141,202,104,174, 0, 57,132,224,255,133, 63,117, 40,181, - 59, 5,247, 90,215, 6, 55, 68,128, 24, 99,168,239, 1, 20, 5,184, 94, 20, 32,126, 88, 52,118,252, 97,190,203,107, 99, 7,185, - 30, 5,230,130,251, 65, 59,247, 3,140,112,200,216, 62,185,166,222,129,228,177,230,235, 31,109,135,207,228,173, 11, 12,208,156, -126,112, 28, 25, 30,161,178, 15, 25, 27,100,178, 1,200, 97,132,238,235,243, 84,198, 94, 79,181,222,157, 77,141, 34, 73, 82,171, -180,137,132, 16, 48,198,168, 44,203, 65,138, 72, 93, 39, 10,160, 11,210,226,150,209,157,219, 28,133,104, 67, 33,104, 39, 32, 4, -192,173,131,155,206,127,191,245, 59, 57,220,116,225, 66,126,102,254,174, 63,236, 48,125,212,147,209,148,206, 78,140,115,151, 51, - 84,201, 12,119, 29, 59,193,221,132,222, 46, 64,138, 2,244,214, 30,192,100, 50, 9, 25, 25,222,219,255,217,100, 50,241,132, 16, - 42,203,178,220,197,239,247,106,254, 10,188,171, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99, 76,141,186,176, 30, -234, 77, 17,214,204, 36, 97,132,144,198,255, 91, 94,115,119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212, 59,145,157, 53, -127,122, 59,127, 5, 94, 68,243,184, 53,167,211,233,150, 3,232,139,166, 44,103, 50, 99, 76, 34,132,200,140, 49,153, 16, 34, 53, - 59, 71,155, 93,107, 56, 47, 19, 66,164,250, 4, 81,114,195, 53, 66,136, 76, 41,149, 90, 28,203, 13,118, 51,165, 84,146,101, 89, - 98,140, 89,204,102,243,149,174,154,115,189,156,191, 2, 47, 43, 0, 9, 12, 12,140,230, 56, 78, 77, 8, 97,245, 19,189, 26, 91, -185,134, 86,176,249,113,125,232,143, 1,128,195,225,112,106, 65, 9, 33,172,217,167,161, 44, 44, 22,139,211, 61, 56,142, 99,132, - 16, 86, 89, 89,201,234,133,182,171, 51, 41,123, 59,127, 5, 94, 86, 0, 87,199, 29, 5,243,209,231,233,109,252, 21,244,180,192, - 36, 37, 37,141, 22, 4,225, 17, 79, 12,227, 51,198,194,101, 89, 30,206, 24,123, 57, 37, 37,101,159, 39, 30, 64,225,175,240,191, - 86, 5,184, 39, 38, 38,102,195,156, 57,115,186,117,137, 97,118,118, 54, 78,157, 58,133,200,200, 72, 24, 12, 6, 42, 73,210,180, -148,148,148, 20, 15,188, 0,133,191,194,255,154,162, 64,136,142,142,182, 47, 92,184,176,219, 30, 96,211,166, 77, 48, 24, 12,120, -244,209, 71,193,113, 28, 14, 30, 60,200,101,102,102, 30, 72, 76, 76, 76, 72, 77, 77,237,246,120,165,194, 95,225,223, 85,116,251, - 64,152, 36, 73, 88,191,126, 61, 22, 44, 88,128,190,125,251,194,223,223, 31,137,137,137,136,139,139,227, 84, 42, 85,186, 94,175, -159,232,203, 54,161,194,255,250,226,223,237, 10, 96, 48, 24, 16, 28, 28,140,136,136, 8, 8,130, 0,173, 86, 11,173, 86, 11,189, - 94,143,145, 35, 71,114,106,181, 58, 67,175,215,199,249,234, 11, 80,248, 95, 95,252,187, 93, 1, 10, 11, 11,161,211,233, 26,143, - 53, 26, 77,227, 67, 36, 38, 38, 98,248,240,225,188, 90,173, 62,145,144,144,112,131, 47,190, 0,133,255,245,197,191,219, 21, 32, - 48, 48, 16, 86,171,115,118, 19,127,127,255,198, 79, 82, 82, 18, 98, 99, 99, 5, 63, 63,191, 44,189, 94, 31,235,107, 47, 64,225, -127,125,241,239,118, 5,208,233,116, 48,153, 90,167,196,105,208, 98,173, 86,139,164,164, 36, 12, 28, 56, 80,165,209,104,206,234, -245,250, 1,190,244, 2, 20,254,215, 23,255,110,223, 32, 35, 42, 42, 10, 53, 53, 53,176, 90,173,208,106,235,242,255, 84, 85, 85, -161,180,180, 20,229,229,229, 40, 45, 45,133,197, 98,193,224,193,131, 33,138,162,250,234,213,171,231,245,122,253,144,180,180,180, - 98, 95,120, 1, 10,255,235,139,127,183, 43,128, 90,173,198,248,241,227,145,147,147, 3,157, 78,135, 3, 7, 14,160,160,160, 0, -177,177,177,136,138,138,194,208,161, 67,193,243, 60, 82, 83, 83, 97, 52, 26, 33,138,162,159, 70,163,201,211,235,245,131,210,210, -210,188,158,237, 77,225,127,125,241,247,200, 22, 73,211,166, 77,195,167,159,126, 10, 81, 20,241,248,227,143, 99,230,204,153, 80, -171,213, 78,101, 22, 45, 90, 4,147,201,132,117,235,214, 97,203,150, 45, 90, 74,233,155, 0,158,128, 15, 76, 75, 80,248, 95, 63, -252, 61,178, 32, 38, 33, 33, 1,129,129,129,248,232,163,143, 48,123,246,108,183,171,168, 66, 66, 66,240,228,147, 79, 66,163,209, - 48,171,213, 58, 54, 52, 52,180, 63,124, 32,177, 84, 75,254, 45, 43, 95,225,255,191,195,223, 35, 10, 16, 20, 20,132, 53,107,214, - 32, 38, 38, 6,207, 62,251, 44,102,204,152, 1,135,195,225,182,252,144, 33, 67, 36,171,213,106,230,121,254,126, 95,120, 1,205, -249,119, 4,189,141,191,217, 46,225, 82,105, 45,142, 95,174,192,190, 51,197,136,136,155, 70, 73,212, 40,191,136,184,169,207,196, -175,248, 79,191,235,169,254, 61,182, 75,164, 32, 8,248,252,243,207,177,122,245,106, 0, 64,114,114, 50, 22, 44,112,189,251,145, -159,159, 31,163,148, 74,140, 49, 13,124, 36,181,160,187, 94,171, 55,243, 63,122,169, 2,155, 50, 12,200, 41, 50,129,202, 82, 99, - 90,119, 22, 54,158, 15,157, 50,118,124, 8,165,227, 41,149,151, 37,190,240,245, 22,202,196,215,210,255,184,232,244,255,122,253, - 11,158,124,136, 63,252,225, 15, 0,128,216,216, 88,124,241,197, 23,110, 21,160, 25,122,251,146, 66,159,229,127,185,204,140, 55, -191,205,134,192, 1, 49, 33, 26, 20,148,137, 96,148,130,177, 86, 31, 2, 70,231,129,146, 95, 76,126,118,253,188,140,119, 23, 37, -119,250,189,111,248, 9, 89, 5,158,245,167,191,121,246, 94,168,120,238,154,235,223, 99, 10, 80, 84, 84,132,146,146, 18,188,249, -230,155,120,238,185,231,176,120,241,226, 54,203,247,246,172, 10,190,206,255, 68,126, 37, 24,163,120,235,254, 9, 24, 17, 29,140, - 63,109, 59,141,189, 89, 69, 96, 13,189, 64,227, 95,214,112, 76, 64,233, 59, 0, 58,173, 0,207,220, 61, 25, 14,201,179, 85,209, - 82,248,187, 90,255, 30, 83,128,236,236,108, 68, 68, 68,224,217,103,159, 5, 33, 4,185,185,185, 46,115,234, 52,215,222,250,165, -136,189,117,113,138, 79,243, 63, 83,104, 2,165, 20, 2, 87,103, 33,168, 56, 82,215, 3,180,248,180, 80,130, 27,110, 90,178,198, -255,216, 63,150, 90, 58,243, 91, 57,133,229, 40,175,181, 94, 51,103,209, 97,119,235, 59,206, 26, 59, 24, 92,253, 18, 4,187,221, - 14, 89,150, 57, 89,150,213, 0, 66,208,118,126,214,234,230,215, 59,164, 0,159,237,205,196,165,146,206,109,120,146,157,150,138, -232, 81,147,240,202,198, 84, 72, 14, 59,206,156,191,136, 87,190, 78, 1,199,183,222, 56,239, 80, 77, 8, 95, 54,112,234, 72,235, - 0,149, 86, 8, 31, 20, 13,144,118,133, 72, 82,227,143,248,114,101,165, 15,245, 0,180,190, 98,125, 50, 63,168, 67,148,193, 40, -195,138, 47,143,162, 95,152, 22, 57,133,149,117, 2,207, 24, 24,163,160,204,165, 57, 4,217, 95,173, 6,208, 41, 5,200, 51, 86, - 33,191,172,250,154, 57,239, 92,247, 49,210,183,111,236, 72, 81, 53,128, 59,235, 63,111,183, 83,246, 70, 0,103, 58,165, 0,250, - 17,253,220,238,249,229, 14, 17, 86, 3,138,250,248,225,238, 73,195,240,233, 71,239, 33,208,223, 31, 63,143, 31,225,186,194, 82, -183,211, 98, 83,126,161,228, 96,167,164,240,129,223, 18,158,111, 63,197, 96,165,214,210, 93,194, 65,171, 12,224, 66, 59, 54,162, -110, 50,153, 96,179,217, 16, 21, 21,213,252, 52, 67, 83, 94, 32, 31,237,193,234, 4,221,108,151,113,174,200,214, 36,244,148,130, - 82,230,214, 20, 2,215,249, 64,225,162, 91,110,236, 22,198,166, 67,201, 72,175,139,242, 32, 34,194,181,252,157, 57,115, 6,181, -181,181, 13,141, 80, 25, 99, 44,215,205,237, 70, 1,173,246,153,232,152, 2,140,236,167,235,188, 61, 80, 58, 4, 63, 92,202, 65, -148,202,129, 13,159,125,130, 25, 51,102, 96,242,176,104,151,101,163, 84, 14,234, 95,109, 40,179,150,151, 95,172,201,220,123, 8, - 61,156, 98,220,113, 98, 61,184,136, 17, 80,199,253,162,221,178, 85, 85, 85,152, 59,119, 46,118,239,222,221,242,165, 80, 95,115, -130, 25, 99, 16,229, 58,125, 92,126,199, 72,136,242, 8,103,253,100,117,255, 63,248,167,173,204, 14,129,184, 50,133, 0,128, 93, -125,186, 97,177,139, 68,162,255, 42,181,247,187,203,255,189, 27, 39, 47,151, 92,187,227,158, 86,183, 59, 46, 55,106, 6,248,113, - 83,157,174,237,122,105, 1,212, 2,143,105,211,166, 33, 61, 61, 29, 0,160,209,104,126,176,217,108, 15,187,145,159, 61, 0,102, -244,152, 15, 48, 96,192, 0, 28, 59,118, 12,219,183,111,135,205,102,195,252,249,243,219,109,136,235,109,104,175,180,142,246,148, - 15, 64, 56, 30,170,209, 63,111,183,244,217,179,103,113,199, 29,119, 96,231,206,157,232,211,167,143, 15,240,119,150,233,140,188, - 10,164,158, 47, 65, 70, 94, 57,204, 86, 7, 40,149, 91,181,240, 78,231,160, 34, 13, 38, 80, 75, 83,232,181,159, 93,137, 4,112, -174,241, 25,175,254,238, 44,152,188,140,196,172,118,155,175,245,131, 71,110,235,150,103,121,222,122, 18,239,103,236,192,138,123, -226,241,240,195,191,236,136,194,119,186,225,236,144, 2, 56, 36, 25,148,117,174,103, 55,219,108,216,187,119, 47,100, 89, 70,100, -100, 36,102,205,254, 25,108,162,228, 38,118, 72, 64,121, 1,208,104, 57,220,189,212, 15,186,232,246, 31,100,237, 43,246,142,248, - 10,157, 81, 2,219, 79,127, 5, 8, 15,213,168,187,218, 45,157,149,149,133, 59,239,188, 19, 59,119, 54,238,236,234, 19, 81,160, - 79,246,229,226,199,204,162, 38, 97,111, 33,216, 77, 2,206,156,237,125, 23,166, 80,235, 42,162, 28,152,116, 35,152,252, 29, 51, - 44, 25, 72, 6,252,163,194, 21,135,175,211,114, 96,232, 6, 31,224,104,110,221,252,182, 31, 79, 94, 66,217,119,206, 43, 33,127, -119,215,205,224,185, 86,238,150,103, 20,224,181, 77,169,157,138,235, 58,204,213, 72, 91,243, 18, 26, 50, 5, 14,152,181, 24,143, -253, 99,143,251, 22,181, 50, 92, 85, 26, 59,123,170, 72, 84,163, 4, 77,240, 47, 96,110,223,142,150, 22,190,189, 24, 27, 96,236, -238,158,192,118,224,207, 0,199, 67, 53, 98,118,187,165, 51, 51, 51, 49,123,246,108, 76,154, 52, 9,245,137,182,188,170, 0, 57, - 87,107,240,227,233,171,237, 10,182,187,191,172,222,236,113, 45,252, 18,192,228,186, 15,149, 2,192,228,223, 0,120,195,165, 73, - 27,226,223, 24,161,185, 22,204,152, 53, 27, 67, 6, 13, 68,220,164,201,232, 31, 17,210, 34,232,224,218,138,104,227,118, 31, 3, -216, 6,160,184,211, 10,240,214,194, 91, 58, 69,124,225,194,133,176, 86,214,217,128, 43, 86,172,192, 27,111,188,209,102,249,167, -159,126,218,177,235,232,174, 93,165,165,165,187, 42, 42, 42,190,132, 87,183, 25, 98,176,237,255, 35, 8,199, 67, 24, 62,171,221, -210, 39, 78,156, 64, 97, 97,161, 42, 40, 40,136,247,182, 15,176,247,140,177, 93,193,102, 45,206, 57,149,173,239, 33,154,161,118, -214,232,138, 64, 48, 9,160,178,179, 18, 48,233,255,220, 41,192,164,161,125, 33,201,215,254, 10,111, 31, 59, 8,192,189, 46,175, -185, 81,176,182, 26,206, 45, 93,238, 1, 58,131, 77,155, 54, 97,243,230,205, 0,128,233,211,167, 99,220,184,113, 29, 14, 35,250, -130, 13, 93,223,213,195,186,247,109,104, 9, 15, 97,216,204,118,139,151,148,148,112, 85, 85, 85, 51,181, 90,237, 78,111,210, 46, - 40, 51,183, 22,108, 39,211,135,181,109, 10, 81,218,232, 24,215,139,211, 14, 63, 34,198,131,214, 11,190,179, 18,244,101,185,247, - 69, 76, 93, 92,236,210, 98,200,204,247,236, 72,240,182, 23,230, 65, 45,240, 61,227, 3,116, 20, 70,163, 17,203,150, 45, 3, 0, - 60,245,212, 83, 88,190,124, 57,222,127,255,125,220,119,223,125,237, 9,191,207,216,208, 78, 74,176,231, 13,104, 57, 30, 66,236, -244,246,205, 62,135, 35, 66,146,164, 21, 0, 54,163,110,176,165,199, 81,108,178,180, 22,236, 86,145,157, 54, 76, 32,103, 63,239, -220,188,201,149,175,129,138, 59,235, 91,252,230, 38, 80,195,255,195, 93,241,248,243,131,183,122,235,173,121, 70, 1, 58, 58, 16, -182,229,253,151, 80, 94, 94,142,126,195,227,224, 55,241,110,124,188,247, 44, 54,126,247, 3, 28, 3, 39, 35,172,175,251, 73,134, -233, 53,193, 66,241,128, 91, 38, 89, 7,106,116, 66,112,244, 77, 62, 51, 16,198, 40,172,187, 95,131,246,118, 30,194,144,169,237, -215, 62,165, 35,234,237,204,159, 1, 48,247,228,155,183,139, 50,202,170,173,109, 10, 56, 24,197,168,126, 97, 24, 30, 19, 10,127, - 53, 95,175, 36, 12,187,247,236,145, 10,140,101,217, 18,175,189,164, 14, 31,144, 77,128,172,111,127,115,246,252,128, 80,219, 23, - 96, 82,180,139,214, 31,245,102,209, 48, 87,202,254,238,119, 25, 56, 95, 84,225,209,231,253,248,241, 89,174,230, 2,121, 70, 1, -166,223, 56, 16,147,134, 58,218,142,138,156, 58,129, 11,199,211,160,235, 19,129,127,253,123, 45, 34,162,250,226,245,149,207,162, -164, 32, 23,255,120,254, 33, 68,247,235,143, 71,150, 62,137, 95, 44, 92,212,186,235, 78,219, 78, 75,170, 46, 94,144,236, 72,167, -129,186,253,224, 85,237, 63,136, 40,246,140,128, 81, 25,214, 93,175, 64,123,199, 27, 16, 6, 37,118,228, 27,183,212, 43,193, 28, - 0,214,158, 82, 0,158, 35, 0, 99,110,109,252,176, 64, 53,126, 63,111, 18,110, 30, 80, 14, 34, 93, 6, 88,211,134,246, 55,251, -149, 18,201, 94,174,234, 19, 74,252, 71, 13,171,138, 38,160,119,130, 74,227, 65,101,190,141,214, 31, 96, 82,128, 43, 5, 88,144, - 56, 10, 86,187,103,115, 4, 11,174, 7,232,152, 71, 20, 32, 54, 42,180,221, 50, 23,143,213,201,227,250,117, 95, 96,230,228,177, - 88,191,126, 61,190,251,230,171,198,235, 87, 11,175,224,237,151, 95,192,200,193, 49,120,224,129, 7,156,190,219, 71, 37,202, 1, -181, 87, 75,106,141,198,139,181,153,123, 79,194,215,246,218,165, 18,172, 59, 95,134,118,214,155, 0, 58, 52, 71,253, 86, 0,223, - 1,184, 27,128,173, 39, 40, 10, 60,135,240, 0, 21, 74, 76, 98, 43, 27,159,128,225,181, 7,166, 96, 92,216, 15,224,106,178, 90, -125, 87, 63, 30, 60, 88,232,104, 80,121,180,139, 86, 30,173,148,160, 73, 17,114, 80, 55,247,198, 9,102,155, 3,213, 86,199,255, -142, 9,212, 17,148,151,151, 35, 52, 52, 20, 51,103,214, 57,141,111,189,245, 22,198,141, 27,135,249,243,231, 35, 47, 47, 15, 35, - 71,142,196, 59,239,188,131, 23, 95,124,177,149, 2, 52,115, 96,124,119, 54,168, 44,194,150,242, 30,144,240,118, 71,191,113, 27, -128,135, 0,252,163,167, 40,246, 13,209,194, 88, 89,219,202,244,153,114, 67, 20,198, 70, 21,128,171,205,114,209,102,182, 16,112, - 87,166,142,203,243, 50, 64,165,179, 0,166,180,188,229,206, 83,151,112,161,216,179,214,233,196, 33, 81, 16,122,202, 4,170,181, - 57,218, 13,107,197, 12, 28,140, 81,163,111, 68,149,217,134,146, 18, 35,114,115,115,241,205,214,239, 16, 63, 37, 1,143, 62,180, - 8,171,222,125, 15, 34, 5,126,191,226, 57,100,229, 92, 64,255, 1, 77,115,111,236,148, 16, 89,229,175,146, 2,250,248,225,230, -135, 67,161, 13,110,255, 65,198,163, 26,175,190,218, 99, 61, 5,231,175,131,118,206,187, 40, 55,117,184,151,125,191, 39,133, 31, - 0,134, 68, 4,226,100, 94, 73,171,112,231,232, 1,225, 32,226,233,214,214, 66, 91,173, 60,117,161, 4,206,231,175,144,184,148, -226,164,164,164, 86, 60,150,253,108,146,119,226, 22,158,138, 2,253,101,219, 17,100, 27,218, 14,107,201, 14, 59, 78, 95,184,132, - 37,107,118,128,202, 18,180, 33, 58,124,145, 85,131,245, 57,251,144,117,165, 2, 75,214,236,128,100,139, 0, 39,168,240,252,231, - 59, 17, 24,209,228, 20,103, 85,135,169,138, 7,207,184,205, 65,212, 99, 4, 77,224, 67, 29,114,130, 79, 9, 75, 0,148,244,152, -240,207,253, 0, 92,232, 64,192,148,223, 81,225,255, 93, 79, 11,192,188,248,193,248,238, 72, 30,100,217, 57,220, 25,232,167, 2, -161,181, 78,206,125,199, 90,249,230,202,209,226, 26,240, 23,119, 60,126,253,207,157, 56,158,231,217, 44, 43, 7,223,248, 85,171, - 48,168,199,122,128, 87,238,239,144,243,135,249,199, 55,227, 47,247,223,132, 1, 3, 6,224, 29,249, 34,180,154, 34, 44, 95,190, - 28,203,243,247,225,165,135,146,224,231,231,135, 81,127, 95,129,109,111, 62, 1,190,217,180,232,103,158, 57,232,216,115,108, 79, -178,209,104,252,161,188,188,124,191, 47,249, 0, 78,194,223, 49,124,224, 13,225, 7,128,200, 16, 45,102,143, 31,128,173,135,115, -157, 28, 96,231, 9,112,157,106,229, 91, 40,135,220,240,106, 74,219,234,221,254,254,248, 44,175,188,171,102,251,187,245,188, 15, - 0, 0,127,255,251,223,241,252,243,207,227,239,127,255, 59, 94,120,225, 5, 36, 39, 39, 67,146, 36,140, 27, 55, 14,199,143, 31, - 71,126,126, 62,238,184,227, 14, 39,225,111,230,189,203,148, 82,159,154, 78,220, 89,225,231,121,254, 27, 89,150,127,231, 77,206, -191,190, 35, 14,126, 42, 14, 7, 78, 27, 80, 92, 89, 11, 6, 82, 63,106, 74, 1, 38,186,108,229,101, 81, 6,152, 36, 19, 34, 83, - 14, 50,117,171, 4,117, 14,253, 81, 0,207,146,184, 84,183,211,209,119,158,186,132, 18,147,197,163,207,185, 48,105,116,171,185, - 64,245, 38, 16,243,154, 2,232,116, 58,188,248,226,139, 88,185,114, 37,238,186,235, 46,220,123,111,221, 48,246,152, 49, 99,240, -250,235,175,227,198, 27,111,196,154, 53,107,220,105, 47,245,165,129,176,206, 10,127, 80, 80,208, 17,149, 74,245, 65, 69, 69,133, - 87,121,171, 4, 14, 75,102,197, 97,201,172, 22, 9,148, 77,123, 1, 42,186, 52,117,254,181, 45,216,158,113,228,196,231,209, 97, -214,159, 94,249, 77,255,227, 42,158,177,102,189,193,121, 18,119,176, 83, 61,178, 40, 83,183, 19, 31,123,101, 20,232,147,157, 39, -144,107,172,234, 56,139,209,183,227,131,173, 7,241,202,223,214,163,232, 66, 54,170,203,141,144, 28,118,140,184,255,183,120,225, -203,159, 90,219,115,213, 33,234, 43, 3,111,157,105, 25,172, 29, 42,248,135,221,215,145, 69, 85, 18, 52,175, 99,211,211, 21,190, - 32,252,227,198,141,147, 36, 73,218, 89, 88, 88,232, 91,225,219, 22,161,220,186, 86,189,181,169,179,244,238, 18,205,210,187,162, -150,128,201, 75, 90,181,254, 96, 97, 0,170, 58,243, 83,115, 38, 14,245,150, 19,236, 25, 19,104,214,184, 33,168,181,117, 50,174, -123,155,243, 62, 6, 75, 23,221,143,135,166,141,113, 89,180,228,200,143, 82, 85,213,197,147,146,168, 74,113, 12,158,156, 5,194, -117,224, 65,170,107,125, 65,248,151, 45, 91, 6,198,152, 99,223,190,125, 62,190,168, 95,114,107, 2, 57, 69,129, 84,209,102, 16, -129,192,122,222,191,203,102, 88, 39,157,224,221, 47, 63,128, 32,173,218,119,123,128,142, 12,132,181,135, 49,163, 70, 96,236,160, - 72,151,215,250,168, 68, 57,168,182,176,168,186,176,240,172,249,232,182,147,222,242, 3,186, 34,252,239,190,251, 46,158,121,230, - 25,230,107, 38, 92,235,214,145, 7,105, 48,129,220,216,248,148,105,109, 92,236,218, 0, 16, 14,184,176,160, 22,142, 66,127, 0, -246, 78,251,130, 94,114,130,225,205,129,176,230, 56,113,226, 4,190,252,242, 75, 76,157, 58, 21,115,231,206, 5, 0, 12, 29, 58, - 20,178, 44,187,114,128, 27, 39,195,213, 59,193,232, 77,194,239, 43,252,219, 85, 0,213, 96,192,156,222,102,180,135, 48,137,135, - 92, 13,112, 26, 64,174, 38, 0, 78,146,184, 84,171,175, 61,203,246,237,219, 81, 88, 88, 8, 0, 40, 46,110,234,105, 40,165, 19, -209,148, 31,116, 63,128,156, 30, 87, 0, 74, 41,230,205,155,135, 43, 87,174,224,227,143, 63,198,241,227,199, 49,114,228, 72,132, -132,132,192,106,181, 34, 48, 48,208,149,237,230, 85, 39,152,248,247,233,178,240,251, 2,255, 14,189,151,192, 89,224, 44,135, 64, -172,103, 93,155, 64,160, 32,128, 10,231,127,110, 7, 56, 6, 38,137, 0,150,250,226,179,172, 94,189, 26,251,246,237,115, 37,123, -115, 80, 55, 7, 11, 0, 30,243,138, 2,212,214,214,226,202,149, 43,141,202,208,208,226, 23, 23, 23, 67, 20, 69,119, 17, 32, 48, -198,168,220,176,132,172,135,161,185,249, 49,128,227, 59, 84,182, 95,191,126, 78,194,239, 11,252, 59,166,229, 42, 72, 81,175,131, - 51,167,129,171, 88, 7, 98,191,220,220,209,109,214, 26,201,118, 64,126, 15,192,123, 36, 46,213,228,139,143,242,231, 63,255, 25, -149,149, 77, 83, 45,254,246,183,191,217, 14, 31, 62,188,174,180,180, 52, 77, 20,197,252,250, 7,202,233,200,189,186, 93, 1,130, -131,131,113,251,237,183, 35, 59, 59, 27,159,127,254, 57,134, 15, 31,142,140,140, 12, 24,141, 70,132,133,133,185,127, 63,222,204, -172,214, 65,225, 7,220,231,172,236, 29,153,237, 8,104, 64, 34,104, 64, 34, 32, 87,129, 56, 10, 64, 28, 6,108,217,188,209,158, -151,119,225,115,115,109,229, 87, 99,134, 9, 63,205,127,250,156, 79, 63,199,216,177, 99,157,142,183,109,219, 38,231,230,230, 94, - 48,155,205,135, 76, 38,211,185,206,248,144, 30,241, 1, 54,110,220,136,215, 94,123, 13,159,125,246, 25,190,255,254,123,232,116, - 58,124,240,193, 7,237,125,173, 87,167, 70,236,117,252,249, 80, 48,109, 40,152,118, 44, 82,206,236,147,246,239,207, 62, 87, 80, - 80,126,165,170,170,138, 94, 79,245, 47, 0,128,201,100, 18, 50, 50,186,119,255,228,150,171,192, 78,158, 60,233,182,172,201,100, -226, 9, 33, 93, 54, 33, 60,193,191,147,191,175,240,239,165,252, 5, 0,198,226,226,226, 83,171, 86,173,226,237,118,123, 52, 99, - 76, 13,128,213, 71, 54, 88,179, 15,234,207, 55,254,223,242,154,187,235, 45,238,213,178, 44,147,101, 89,150, 36,169,164, 62,189, - 96,103, 67,160, 10,127,133,127,151,249, 55, 31,114,229,116, 58,221,114, 0,125,209,148,229, 76,102,140, 73,132, 16,153, 49, 38, - 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84,191,184, 93,110,184, 70, 8,145, 41,165, 82,139, 99,185,193,110,166,148, - 74,178, 44, 75,140, 49,139,217,108,190,210, 85, 75, 94,225,175,240,239, 44,255,230, 10, 64, 2, 3, 3,163, 57,142, 83, 19, 66, -152, 74,165,130, 40,138,141, 90,214,160,133,205,143,235, 67,127, 12, 0, 28, 14,135,147, 6, 19, 66, 88,179, 79, 67, 89, 88, 44, - 22,167,123,112, 28,199, 8, 33,172,178,178,146,213, 87, 90, 87,215,210, 41,252, 21,254,157,230, 79,218, 57,238, 40,124,101, 6, -167,194, 95,225,223, 35,132,187, 5, 73, 73, 73, 2,128,217, 28,199,221,247,211, 79, 63, 45,238,109, 97, 7,133, 63,144,148,148, - 52, 90, 16,132, 71, 8, 33,221, 46, 75,140,177,112, 89,150,135, 51,198, 94, 78, 73, 73,217,231,137, 58, 16,186,169, 34,251, 1, - 40, 79, 73, 73,177,117,176,252,120,181, 90,189,132, 49,246, 43,157, 78,199,149,149,149, 9, 0, 22,123, 81, 16, 20,254, 93,231, -127, 67,100,100,228,147,115,230,204,241,235,206,103,202,206,206,198,169, 83,167, 16, 25, 25, 9,131,193,176, 59, 41, 41,105, 90, - 74, 74, 74,138,207, 40, 64, 82, 82, 82, 8,128,121, 90,173,246,215, 14,135, 99,188, 32, 8, 59,146,146,146,230,166,164,164, 48, - 55,229, 35, 57,142,123, 80,173, 86,255,159, 32, 8, 81,241,241,241,154, 73,147, 38, 9, 90,173, 22,111,190,249,166,205, 11, 66, -163,240,239, 38,254,209,209,209,246,133, 11, 23,118,155, 2,108,218,180, 9, 6,131, 1,143, 62,250, 40, 56,142,195,193,131, 7, -185,204,204,204, 3,137,137,137, 9,169,169,169, 25, 94, 83,128,164,164, 36, 53,128,217,126,126,126, 75,101, 89,158, 62,108,216, - 48, 41, 62, 62, 62,104,232,208,161, 88,179,102,205,173, 37, 37, 37,239, 2,120,166, 69,249,185, 90,173,246, 73, 73,146,226,227, -226,226,104,124,124,188,255,224,193,131, 27, 38,144,193,106,181,246,164,208, 40,252,189,200,191, 35,144, 36, 9,235,215,175,199, -210,165, 75, 17, 22, 22,134,218,218, 90, 36, 38, 38,130, 82,202,101,101,101,165,235,245,250,155,211,210,210,142,247,152, 2, 36, - 37, 37, 17, 0, 73, 26,141,230, 49, 74,233,188,190,125,251,202, 83,166, 76, 9,137,139,139,131,159, 95,147,210, 63,246,216, 99, - 1,239,189,247,222, 19,183,220,114, 75, 14,165,244,148, 70,163, 89, 74, 41,157, 31, 19, 19, 67, 19, 18, 18,130,227,226,226,160, - 82,169,188, 97, 30, 40,252,189,200,191,179, 48, 24, 12, 8, 14, 14,110,220,124, 68,171,213, 66,150,101,232,245,122, 72,146,196, -229,228,228,100,232,245,250,241,105,105,105, 89, 30, 85,128,122,231,102, 49,199,113,143, 6, 6, 6,170,227,227,227, 3, 38, 76, -152,192,135,132,132,184, 44,239,239,239,143, 37, 75,150,248,175, 94,189,250, 35,173, 86,235,152, 50,101,138,118,226,196,137,124, -104,104,104,183, 85,206,244,233,211,251,216,237,118,154,158,158, 94,209, 1,193, 81,248,123,145,127, 87, 81, 88, 88, 8,157,174, -105, 71, 34,141, 70, 3, 89,150, 33,203, 50, 18, 19, 19, 33,203, 50,127,225,194,133, 19, 9, 9, 9, 55,166,167,167,159,239, 86, - 5, 72, 74, 74,138,225, 56,238, 87,106,181,122, 9,199,113, 49,147, 38, 77, 18,110,186,233, 38,117,223,190,125, 59,116,179,136, -136, 8,172, 92,185, 82,237,239,239,175,238,206, 74, 73, 76, 76, 28, 17, 16, 16,176,210,110,183,223, 86, 93, 93, 29,219,134,208, - 40,252,189,200,191, 59, 16, 24, 24,216,202, 44,243,247,247,111,220,212, 59, 41, 41, 9,178, 44, 11,151, 46, 93,202,210,235,245, - 35,211,210,210,242,186, 69, 1,146,146,146, 18, 4, 65,216, 59,102,204, 24,122,243,205, 55,251,199,198,198,162, 43,145, 45,127, -127,255,110,171,140,169, 83,167, 78, 11, 8, 8,120,153, 82,154, 16, 16, 16,160,150,101,249,163,236,236,108,135, 27,225, 81,248, -123,145,127,119, 65,167,211,193,100,106, 61, 11,187,193, 20,146,101,185, 65, 9, 84, 5, 5, 5,103,245,122,253,176,180,180, 52, -195, 53, 43,128,159,159,223,107,208,238,250,153, 0, 0, 20,252, 73, 68, 65, 84,119,222,121,167, 58, 33, 33,129,131, 23, 49,125, -250,116, 65,150,229,251,252,253,253, 95,241,247,247,239,255,224,131, 15, 6, 76,159, 62,157, 44, 88,176,192,102,177, 88, 62,114, -247, 61,133,191,119,249,119, 23,162,162,162, 80, 83, 83, 3,171,213, 10,173, 86, 11,160,110, 99,194,210,210, 82,148,151,151,163, -180,180, 20, 22,139, 5,131, 7, 15,134, 40,138,234,171, 87,175,158,215,235,245, 67,210,210,210,138,187,172, 0, 73, 73, 73, 35, - 1, 36, 77,154, 52,201,107,149, 31, 31, 31, 31,172,209,104,150, 8,130,176, 98,232,208,161,154,135, 30,122, 40,104,202,148, 41, - 32,132, 96,247,238,221, 16, 4,225, 84,122,122,250, 69, 55,173,167,194,223,139,252,187, 19,106,181, 26,227,199,143, 71, 78, 78, - 14,116, 58, 29, 14, 28, 56,128,130,130, 2,196,198,198, 34, 42, 42, 10, 67,135, 14, 5,207,243, 72, 77, 77,133,209,104,132, 40, -138,126, 26,141, 38, 79,175,215, 15, 74, 75, 75, 43,237,146, 2,104, 52,154,151,166, 78,157,170,242, 70,148,160,186,186, 26, 28, -199,169, 2, 3, 3,139, 38, 79,158,140, 95,253,234, 87, 1, 55,220,112,131, 83,153,111,190,249,166,166,182,182,246,207,238,238, -161,240,119,195,205, 38,225,167,139,165, 40,169,113, 64, 45,112, 80,243, 4,106,158,131, 70,224, 48, 97, 64, 40,250, 6,251,117, - 11,255,238,198,180,105,211,240,233,167,159, 66, 20, 69, 60,254,248,227,152, 57,115, 38,212,106,103,183,102,209,162, 69, 48,153, - 76, 88,183,110, 29,182,108,217,162,165,148,190,137,166,245,192, 29, 87,128,164,164,164,104, 74,233,189,122,189, 94,232, 73,193, - 41, 44, 44, 68, 74, 74, 10,206,157, 59,135, 57,115,230,240, 11, 22, 44, 8,136,140,108,157, 53, 34, 63, 63, 31, 5, 5, 5,148, -231,249,111,221,180,158, 94,231, 63,243,206,159,241,139,127,249,128, 79,240,183, 75, 20,169,121,229,216,157, 83,130,140,252, 74, -136,110,146, 26, 19, 0, 3, 53,118,220,104,207,198, 67,119, 37,240,183,205,127, 34, 32, 50, 50,170,211,252, 61,129,132,132, 4, -124,253,245,215,120,227,141, 55, 16, 19,227, 62, 29,125, 72, 72, 8,158,124,242, 73,108,223,190,157,213,212,212,140, 13, 13, 13, -237, 95, 85, 85,117,165, 51, 74, 32,168,213,234,231,110,186,233, 38,174, 59,157, 39,119, 96,140, 33, 39, 39, 7,169,169,169,168, -172,172,196,125,247,221,135,215, 95,127,189, 77,199, 45, 57, 57,217,193, 24, 91,179,127,255,126,201, 77,151,233, 85,254,137,243, - 30,197,211,235,126,194, 61,178, 10,145, 94,228,207, 24,240,245,113, 3,214, 30, 42,128, 85,108,127, 93, 8, 3,144,111,215,224, -151,131,181,184, 91,216, 3,203,119,199, 96, 31, 57, 3,252,144,169, 16,162,199, 55, 46, 19,109,143,191, 39, 16, 20, 20,132, 53, -107,214,184, 93,126,218, 18, 67,134, 12,145, 12, 6,131,153,231,249,251, 81,151,152,184,227, 10,192,243,252,207, 39, 77,154,164, -241,228, 3, 73,146,132, 99,199,142, 33, 45, 45, 13, 1, 1, 1, 88,184,112, 33,166, 77,155,230, 50, 69,138, 83,107,102,183, 99, -231,206,157,212,106,181,254,205, 93, 25,111,242,207,200, 45,198, 93,171,190,129,213, 33,225,238,119,190,193,190, 87, 23, 34, 58, - 44,176,199,249,151,155, 29,120,251,199,115, 56, 90,208,249,156,252, 19, 2,235,190,227, 47, 85,193,145,181, 5,200,218, 2,226, - 23, 12, 97,144, 30,108,128, 30,251,246,180,205,223, 83,232,168,240,215, 7, 16, 24,165, 84, 98,140,105,208,201, 9,158, 2, 0, -194,113,158,241,189,204,102, 51,210,211,211,113,248,240, 97,140, 26, 53, 10, 43, 86,172,232,240,174,145, 0,176,111,223, 62, 8, -130,112, 36, 45, 45,173,173,156,228, 94,225,159,109, 40,195,188,119,183,194,234,168,107, 24, 11,202,170,113,239,159,147,177,243, -165,249, 8,214,106,122,140,191,201, 38,225,183,155, 51, 81, 80,209,249,100,180, 4,192,248,160,214, 89, 15,153,173, 26,226,185, - 29,192,185, 29,248,247,108,162, 82, 17,246, 23,242,192,148,100,104,196,239,195,151, 30,243,201, 76, 17,245,232,218,154,224,238, - 70,105,105, 41, 82, 83, 83,145,153,153,137,105,211,166,225,195, 15, 63,196,128,102, 27, 98,116, 20, 61,237,124,117,148,127, 65, - 89, 53,230,190,243, 13,170,204,206,115,200, 50,243, 75,176,240,253,109, 72,126,238, 94,168, 5,222,227,252,173,162,140,231,147, - 79,119, 73,248, 1, 32, 86, 91,139, 16,161,237,245, 35, 42,142,241, 0,230, 49, 96, 58,236,170,229,229, 31, 76,249, 74,144,201, -218,144,167,211,189,155, 5,152, 81,128, 52, 53, 28, 93,205,202,209,173, 10,144,151,151,135,148,148, 20, 20, 22, 22, 98,238,220, -185,120,238,185,231,208,213,161,248,220,220, 92, 92,189,122, 85,140,142,142,254,111, 79,213,105, 71,248,151,152, 44,152,179,106, - 19,174, 86,185,222,163,111, 95, 86, 62,150,124,178, 3, 47,222, 57,210,227,252,255,153,122, 25, 57,198,154,182, 91,121, 2,232, - 71,244, 71, 76, 88, 0,204, 54, 17,149,102, 59, 14, 95, 40, 2,101, 12, 19,130, 42,219,234,151,144,122,133,179,199,199,208, 39, - 52, 4, 7, 67,151,165,229,250, 66, 19, 79, 45,229,176,253,176, 18,204, 82, 6,245,228, 37, 80,141,184,163,177,245,175, 95, 74, -217,233,244,232,215,180, 26,135, 82,138,204,204, 76,164,166,166, 66,150,101, 60,240,192, 3,184,253,246,219, 91,133,173, 58,139, -173, 91,183,218, 41,165, 31,111,218,180,169, 61,173,238, 49,254, 53, 86, 7,238,249,211, 22,228, 22,183,157, 44,121, 99,122, 14, - 12,185, 57,178,218,131,252, 47,150,214, 34,249, 84,161,219,235,129,126,106,172,184, 39, 30, 11, 18, 71,161,127,120,144,211,181, -203, 37, 38,124,180,227, 56, 6, 95,106, 61,159,204, 6, 13,252, 96, 7, 24,197,153, 50, 97,227,220, 63,166,172,245, 37, 27,135, - 85, 23, 65,174,200,173,219,179,109,223,219, 16,179,147, 17,227, 7, 82,191, 32,158,118,197, 7,232, 18, 28, 14, 7, 14, 29, 58, -132,244,244,116,244,239,223, 31, 79, 60,241, 4,226,227,227,209, 29, 11,131,108, 54, 27,246,236,217,195,108, 54,219, 39,158,170, -200,206,242,183,139, 50, 22,188,247, 45, 78, 94, 54,118,232,254,233, 37,224, 53, 33,137, 20,216,227, 17,254,255, 72,201, 3,117, -163, 58,209, 97,129,216,242,236,189, 24, 55,216,117, 50,226,193,145, 33,120,247,161, 91, 81,242,229, 23, 78,155,156,214,112, 65, - 8,162, 77, 61,202,226, 56,199,224, 23,124,204,200,231,251,142,129,118,214, 27,176,238,124, 9,144, 69,200, 37,103,241,255, 6, - 16,149,223, 20,255,193,111,109, 39, 93,234, 1,186,132,109,219,182,129, 82,138, 85,171, 86, 97,248,240,225,221,250,144,123,246, -236,129, 32, 8,169,169,169,169, 69,158,170,200,206,240,167,140,225,145,143,183, 99,127,118, 65,167,126,195,206,107, 95,230,231, -175, 58, 39,111, 92,185,161, 59,185,151,155, 29,200,200,175,116,217,216, 13,208, 5, 97,247, 43, 11, 49, 64, 23,212,142,187, 40, - 66,107,174,123, 30, 17, 2,100,162,114, 18,126, 0, 80,243,152, 90,249,158,126,124,216,239,210, 78,250,146, 18, 8,131,244,208, -206,122, 3,182,157, 47,131,201, 14,240,132, 97,241, 36,191,113, 83, 6, 14,122, 88, 16,134,173,155,252,234,225,234,142,222,139, - 67, 23,246, 21, 48,155,205,200,204,204,196,202,149, 43,187, 93,248, 27,156, 95,179,217,220, 81,231,209,227,252,151,125,182, 27, - 91,143, 92,232,202,163, 16,194,176, 86,184,127,213,140,238,228,191, 35,171, 16,204, 77, 79,255,135,121,250,246,133, 31,128, 92, - 94,103, 70,128, 87, 33, 48,225, 9,248, 49,215, 11, 99, 40, 47,223,235,139,225, 30, 97,144, 30,126,179,255, 8,162,210, 54,158, - 27, 17,169,158, 52, 52,156, 28, 42,251, 48, 97,164, 71,123,128,163, 71,143, 34, 33, 33,161,205, 92,159, 93,197,185,115,231, 80, - 82, 82, 98, 59,120,240,224, 78, 79, 85, 94,103,248,191,254, 77, 42, 62,219,155,121, 45, 63,167, 6,144,172, 90,240,206, 45,226, -215, 47,156,234, 14,254,169,103, 93, 79,126, 28,216, 39, 24, 11,147, 70,119, 44, 94, 88,114, 6, 32, 28,180,183,191, 6, 97,112, - 18,196,236,100,208,106, 23, 62, 5, 35, 9, 61,102,223,215,150, 64, 42, 60, 6, 72,118, 48, 89, 4,100, 7, 24, 21, 65,168, 4, -230,176,130, 57,106,193, 28,181,128,104, 1,179,155,235,254,111,189, 51,234, 40,194,216,225,242, 15, 19,230,235,158, 74,255,177, -219, 21,128, 82,138,140,140, 12,188,252,242,203, 30,169,132,173, 91,183,218, 68, 81,252, 0, 30, 74,149,209, 25,254,127,251,241, - 56,222, 73, 62,212,120, 28,164, 85, 99, 70,220, 32,216, 68, 9, 63,158,188,228,186, 66, 9, 16,224,168, 56,100, 82,133,107, 0, - 76,168, 63, 29,204, 40,251,193,239,129, 85,122,219, 87, 43, 47, 95, 43,255,203,149, 86,128,104, 91, 93, 91,116,203,141, 80,241, - 29, 27, 83,160, 37,103,161,137, 95, 10, 97,112,221, 62,191,170,225, 51, 97, 63,246,133,139, 62, 12, 61,178,233,175,116, 97, 39, -172,123,223,118, 37,208, 93, 65, 48, 24,219, 94,241, 97,252,178,240,167, 14,255,173, 61, 19,168, 83, 56,127,254, 60,130,130,130, - 16, 23, 23,215,237,149, 96,177, 88,176,127,255,126, 56, 28,142,127,122,170,162, 59,202,255,235,180, 28, 60,183,110, 31,162,195, - 2,241,248,109,227,240,237,138,121, 48,124,242,127,216,240,219,185,109,239,129, 69, 37,140, 40, 73,253,185,180,105,229, 68, 9, -100, 16, 1,158, 2,176, 27, 64,164, 36, 99, 7,238,125, 91,119,173,252, 45,196,245,250,243,168,144,128,142,219,102,234, 0,168, -199, 63,208, 36, 8, 49, 19,221, 21, 13,233, 9, 5, 16,207,239,236, 46,225,111,244,151, 25, 35, 31,151,127,144,240, 62,123,213, -189,156, 11,157,221, 91,245,240,225,195,248,197, 47,126,225,145, 74,216,181,107, 23, 83,171,213,123,247,236,217,211,225, 13,176, - 61,193,127, 87,230,101,252,117, 91, 6,214, 44,189, 19, 11,244,163, 58,220,170, 2, 0, 3,145,210,210,210,234,248,111,122,161, - 64, 4, 62, 2,240,145,102,193,159,134, 74,178,252,172, 32,112,155,164,251,255, 58, 7,155,158,182,118,149,191,138,143,133, 67, -110,253,181,176, 64,103,197, 56,124,161, 8,195,163,195, 17,222,226, 60, 24,133,122,226,131,206, 78,180,228, 54, 49, 4,199, 54, -222,207,147,249,155, 60,154,249,218,111,198,139,144, 75,178, 1,209, 10, 38, 90,193, 28, 22,192, 81, 3,106, 53,129,150,157,131, - 92,226, 58,221, 63, 31, 58, 16,124,248, 96, 64,208,128, 89, 42, 32, 22,157,172,223,240,163, 65, 64,216,242,242,176, 41, 67, 75, - 62,246, 91, 24,249,155,253,181, 93, 54,129, 24, 99, 40, 47, 47, 71, 65, 65, 1,110,187,237, 54,143, 84,194,166, 77,155,204,213, -213,213,239,122,196,190,236, 32,127,179, 93,132,192, 17, 28,122,251, 33,116, 37,162, 75, 9,231,114, 79, 45,251,215,207,231, 2, -248, 53, 22,190, 21, 37,136,142, 9, 18,144,214, 85,254, 1,125, 71,194, 97,110,253, 51,205,103,126,214,218, 28,120,107, 75, 58, -190, 91, 49,207, 69,171,193,129,248, 59,119, 68,204,230, 54,112, 34,226,204, 38,143,103,110, 35,218, 80, 8,131, 90,111,200, 46, - 95,205,132, 53,111,127,171,243,170,126, 19,161,141,127, 28, 66,191,241,173,158,195,126,126, 39, 44, 41,171,235,156,124, 0,132, -224, 46, 94,182,165,148,175,142,191, 75,183,236,240,149, 78, 41, 0, 99,245, 59,142, 51,134,195,135, 15, 99,214,172, 89,208,104, -186,127,238,217,153, 51,103, 80, 85, 85, 85,147,154,154,186,175,187, 5,191, 51,252, 3, 52, 42,220, 26, 55,168,235,191, 7,210, -246,172,201, 13,127, 48, 74,128,241, 90,248, 27, 11,131, 81,105,110,189,246, 99,219,145, 11, 88,152, 56, 10,140, 1,203, 63,219, -141, 62, 65,218, 14,243, 46,185,120, 28,193,174, 47, 93, 32,175,194, 43,123, 6, 72, 23,247,192,186,239,237, 70, 65,110,236, 45, -110,122, 8,254, 9, 75, 27,167, 66,156, 59,127, 6,102,179, 25,186,112, 29, 6, 13,138,133,223,216,251, 32, 68,220,128,154,237, - 43,192,172,141,131,150,227, 0,238, 61, 0,247,119,216, 7,160,148, 54,174,195,180,217,108, 56,126,252, 56,238,185,231, 30,143, - 60,236,150, 45, 91,172,162, 40,190,215,221, 14,111, 79,241,247,148,195,238,138,255,228,225,209, 46,203,239,204,188, 12,139, 93, -196,239, 55, 28,192,134,212,179,152, 60, 44,186, 99, 74,230,176, 64,147,191,219, 77, 43, 79,206,244,248,131, 51, 10,251,225, 53, -176,238,126,189,149,240,171,135,205,128,191,254,215, 0,225,112, 56, 35, 29,241, 79,188,138,184, 23,191, 67,252,170, 61, 24,246, -220, 70,252,252,153, 55,112,241, 98, 14,132,232,177, 8,185,255, 95, 32,126,205,167,178,176,123,171, 62,156, 60,164,165, 2,180, -138, 67, 55,175,248,134, 79,102,102, 38,134, 13, 27,134,254,253,251,119,251,243,214,212,212, 32, 53, 53,149,216,108,182, 79,187, -214,200,123,151,255,181,119, 82,157,227, 63,101,120, 63,215, 65, 4,187,136,121,127,217,138, 15,182, 31, 5, 0, 76, 30, 22,211, - 33, 2,181,199,191,130,134,147,220, 24,124,108,103,143, 42,189,185, 12,150,109,203,225, 56,241,159,214,129, 64, 65, 3,255,233, -207, 2, 0,242,242,206,227,231,171,119,227,120,133,179,127,243, 95,131, 10,243,255,244, 21, 36, 81, 4, 23,210, 15,234, 33,122, - 39,151, 65,166,252,114,183, 61, 0, 99,172,177,194, 37, 73,130, 36, 73,141,199,199,143, 31,199,188,121,243, 60,242,208, 59,119, -238,132, 90,173,222,113,173,249,102,188,197,191, 59,205,181,142,240,159, 59,105, 24, 66,252, 93,155,113, 7,234, 71,171,181,106, - 1, 99, 6, 69,180,111,102,228,167, 65, 62,245, 31,119,151,109, 68, 35,110,236, 49,147,231,202, 49, 88,191,121, 12,114,145,235, -225, 18, 85,244, 88,112,218,186,177,155, 15,191,254, 14,229, 14,215, 75, 72, 79, 87,249,225,207,255,168, 11, 36,170, 6, 76,110, -209,161,177, 71, 13,127, 77,208, 58, 41, 64,131,157,217,178,213,105,120, 17, 6,131, 1, 22,139, 5, 9, 9,221, 59, 38, 66, 41, -197,158, 61,123,176,118,237, 90,212,214,214,190,123, 45,130,227, 13,254,221,237,167,116,148,127,144, 86,141, 71,110, 29,219,230, - 61,199,235, 36,168,218,153, 30,239,200,254, 22,150, 31, 86,130,103,110,167, 68,127,213, 35,243,255, 25,133,253,216, 90, 88,183, - 63, 3,106,117, 63, 67, 85,136,106, 26,228, 59,125,213,220,230, 45,243, 74,235,156,122, 97,192,205, 45, 47, 5,169,180, 36,168, -185, 19,204, 26, 42,186,193,217,106, 72, 66,212,240, 57,113,226, 4,238,185,231, 30,116,215,194, 19, 89,150,177,107,215, 46,124, -246,217,103,176, 88, 44,142,226,226,226, 45, 6,131, 33, 60, 56, 56,248,230,234,234,234, 35,157,173,190,158,230, 79,105,183,250, -132, 93,226,255,200,140, 49, 88,179,235, 68,227,130,156,150,152,192, 95,132,121,227, 98, 8, 35,102, 67,125,195, 29, 32,129,117, - 19,227,152,104,133,227,226, 62,148, 30,222,128, 16, 91,126, 91, 83, 39, 77, 50, 47,175,244,184,236,139, 86,216,118,189, 2,169, -224,144,115, 67,205,171,193,192,156,124, 0, 90,219, 20, 29, 31, 18,174,193,129, 54, 18,161,140,111,152, 8,232, 98,108,193,223, -108,111, 60, 41, 52,111,125, 26, 42,188,249, 75,176, 88, 44, 56,127,254, 60, 94,121,229,149,107,239,226, 36, 9, 63,252,240, 3, -214,174, 93, 11,155,205,102,191,122,245,234,214,162,162,162,100, 74,105, 49,207,243, 70, 89,150, 75,174,165,245,236, 41,254,255, - 90,191, 3, 16, 98,187,189,245,119,197,223, 84,107,198,169,220, 43,184,243, 87, 75,177,249,240,121, 28,207, 43, 70,218,185, 66, -156,184,100,132, 67,114,223,194,223, 20, 84, 9,106, 42,130, 35,227,159,112,100,252,179, 46, 98, 66, 56, 48, 42,131,128,181, 59, -186, 69, 8, 94,136,252,205,145, 98,143, 10,191,189, 22,214,255, 62, 7,217,152,237,252,219,193, 49,240,159,245, 38,236, 71,254, - 5, 41,191, 41, 90, 44,149,158,107,252,255,233, 7,238,194,127, 94,217, 6,145,181, 86,225, 80,149,132,217,183,212,141,112,203, -165,173,179, 39, 50, 78, 77,157,194,160, 45, 95, 64,243, 23,113,234,212, 41, 36, 36, 36,224, 90,114, 76, 58, 28, 14,124,255,253, -247, 88,183,110, 29, 28, 14,135,173,168,168, 40,185,168,168,232,123,142,227,140,140, 49,163, 36, 73,198,170,170,170,210,107,105, -145,123,146,255, 85, 41,226, 52,250,224,230,238,142,246,184,226,159,125,250, 52,134,198, 77,192, 15, 89,133,216,118,244, 34,174, - 86,214,118,232,158, 55, 5, 87,180, 50, 51,192,104,135, 38,203, 51,134,191,233,150, 29,250,196,147,194, 79,173,149,117, 38, 79, -153,115,170, 33, 97,144, 30,126, 51, 94, 4,209, 4, 66, 24,156,232,164, 0,114,121, 30,236,103,191,135,102,212, 93, 24, 53, 50, - 14,219,127, 99,196, 67,255, 76, 69,177,189,105,237,198,208, 0, 59, 62, 91, 58, 3,177,177,117,169, 93,172, 39,190,108,249,211, -162, 57,192, 97,115, 82,128, 6,123,179,229, 11,144,101, 25, 89, 89, 89,120,253,245,215,187,244,144,118,187, 29,223,126,251, 45, -214,175, 95, 15, 89,150,109,133,133,133,155,141, 70,227, 14,198,152, 17,128,145,231,121, 99,121,121,185,241, 90, 43,179,167,249, - 91,198,207,187, 25,232, 62, 5,104,139,127,118,214,105,188,254,250,235, 24, 61,122, 52,254,186,120, 6, 14,157, 47, 66,114,198, -121,108,205, 56,143,194, 10,215,202, 16,163,177, 34, 90,109,235, 98,143,132, 47,117,149,135,158,242,104,203,111,173,130,245,219, - 39, 65,171,154, 77,234,227, 4,104,110,126, 12,234, 9,191, 68,195, 8, 53, 63, 48,161,254,255,166,104,144, 53,245, 35,168, 98, - 38,128, 11,233,135, 91,111,153,137,203,137,211,177,231,192, 30, 20,149,150, 33, 38,162, 15,110,155, 62, 19, 28,199, 3,140,194, -146,178, 26,210,149, 99, 45,186, 54,124, 25,179,244,152,197,165, 15,208,210,254,204,203,203, 67,104,104, 40, 70,143, 30,221,169, - 7,180, 88, 44, 72, 78, 78,198,134, 13, 27, 64, 41,181, 22, 20, 20,108, 46, 47, 47,223,205, 24, 51, 82, 74,141,130, 32, 24,203, -202,202,140,232,194, 34,230,182,108,232,158,226, 79,253,195,251,121,194, 7,104,143, 63, 71, 8,244, 35,250, 65, 63,162, 31,254, -180,232, 86, 28,201,189,138,228,140,243, 72, 62,124, 30, 5,101,213, 78,230, 79, 23, 32,130,177,223,235,150, 29,254, 11, 33,158, -221,179, 75, 46, 60,234, 36,252, 92,200, 0,248,221,246, 50,248,136, 17, 78,229,184,128, 62,224,251,222, 8,185, 56,171, 89,207, - 97,130,233,171,135, 17,112,219, 31,160, 30, 58, 29, 60,207, 99,214,140, 89,173, 76,171,218, 29, 47, 66, 44, 56,220,170,174,193, -216,159,156,122,156,230,161,183,150, 54,232,153, 51,103, 58, 21, 58,172,173,173,197,230,205,155,177,113,227, 70, 80, 74, 45, 6, -131,225,155,178,178,178,253,140, 49, 35,207,243, 70,198,152,177,170,170,202,136,174,239, 68,216,102,232,176,167,248,171,180, 33, -241,221, 37, 34, 93,229, 79, 8, 48,121, 88, 52, 38, 15,139,198,170, 95, 78,195,241, 60, 35, 54,238,203, 64,114,250,105,140, 15, -236,148, 2, 72,140, 97, 7,227,232,107, 17,203, 50,142, 98,185,231,163, 94,252,160, 68,240,125,199, 64, 46, 57, 11,213,136,217, -208,232,159,116,154,215,223, 28,154,164,223,194,178,229, 9,128, 54, 57,251,204, 81,139,218,255,174,132,122,232,116, 8, 81,163, -193,135, 15, 1, 9,208, 65,174,184, 12,185,236, 2, 28,185, 7, 64,171, 91,175,165, 98,192,247,125,150, 29,118, 26,216,115,235, - 3,152, 76, 38, 20, 23, 23, 99,198,140, 25,237, 62, 80,117,117, 53,190,254,250,107, 36, 39, 39,131, 82,106,190,114,229,202,230, -178,178,178,131,140, 49, 99,189,157, 95, 28, 26, 26,106,188,120,241,162,221, 35,246,164,194, 31,199,246,124,135,204,228,100, 12, -161,212,188, 35,219,184,189,223, 56,106,191,101,120,224, 68,157, 63, 63, 26,196,133,233, 79,112,152, 49,178, 94,237,112,124, 21, -252,236,177,178,158, 12,251, 18,149, 22,254,247,124,220,184, 32,167, 77,101,233,115, 3,212,147, 30,169,115,228, 91,250,102,185, -251,225,200,221,223,193, 31, 37,121, 2,228, 86,234,237,214, 7,200,206,206,198,157,119,222,217,230,188,153,170,170, 42,124,249, -229,151, 13,203, 11,107, 13, 6,195,230,170,170,170,180, 6, 27,159, 82,106,212,106,181,198,162,162, 34, 75,101,101,165,199, 42, - 84,225,223,154,255,243,151,152, 81,150,139,140,235, 31, 25, 64, 18, 6, 5,106,136, 74,230,136,172, 34, 96, 50, 7,162,170, 10, - 95,150, 82, 0,111,131,239, 88, 46, 84,205,132, 95, 1,142, 90, 56, 78,118,121,101,233, 41,153,147,238,212,185,136,106, 53, 42, - 64,115, 27, 84, 20, 69,156, 63,127, 30,207, 60,243,140,203,187,149,151,151, 99,253,250,245,216,177, 99, 7,100, 89,174,169,175, -248,140, 6,161, 81,169, 84,197,140, 49, 99, 69, 69, 69,173,171, 92,239,158, 16, 32,133,191,107,254,119,191,239,203,121,172, 58, -218,101,112,208, 76,249, 53,248, 62, 55,192,182,255,143, 96, 82,167, 28,252, 20,162, 17,239,138,116, 51,160,215,202, 4, 98,140, -225,226,197,139, 24, 49, 98, 4,250,245,115,246,245, 74, 74, 74,240,197, 23, 95, 96,247,238,221,144, 36,169,218, 96, 48,108,169, -174,174, 62,202, 24, 51, 54,216,201, 0,140, 37, 37, 37, 61, 90,235, 10,127,239,242,239, 41, 8,195,102,194,191,223, 68,136,103, -190,131,120,230, 91, 48,179, 91,203,205, 0, 32,153, 3,217, 18,218,183,127, 74, 91,107, 25, 4,198, 24,107,217, 5, 95,184,112, - 1, 79, 61,213, 20, 9, 43, 42, 42,194,231,159,127,142, 3, 7, 14, 64,146, 36, 83,126,126,254,150,218,218,218,147, 13, 81, 17, -158,231,141,146, 36, 25, 43, 43, 43,123, 60, 91,152, 87,248,203,220, 81,240,244, 53,215,132,136,205,231,249,247, 98,112,218, 48, -104,110, 90, 12,205,132, 69,117,249,129, 28, 22,124,182,230, 67, 27, 45, 57,179,121, 76, 31,122,118,100,140,176,179,239,242, 35, - 29,158, 77, 32, 16, 66,242,171,171,171, 71,134,133,133,129, 82,138,210,210, 82,136,162,136, 41, 83,166,192, 96, 48,224,223,255, -254, 55,210,210,210, 32,138, 98,229,229,203,151,183,154,205,230,204, 6,231, 16,128, 81,150,101, 99, 85, 85, 85,153,183, 42,196, - 27,252,197,205, 43,142, 2, 56,218, 91,249,255,111,104, 2, 15,190, 79,221, 96,215, 57,115,152,188,255,136,120,188,160,160, 96, - 91, 85, 85, 85,167, 54,241, 16,236,118,123,106, 73, 73,201,204,254,253,251, 11,148, 82, 92,188,120, 17, 19, 38, 76,192,203, 47, -191,140, 35, 71,142,192,110,183, 87, 24, 12,134,111,107,107,107,179, 8, 33, 37,168, 91,204, 97,228,121,222, 88, 82, 82, 98,244, -118, 61, 40,252,189, 15,147,201, 36,100,100,100,120,243,247,121, 66, 8,149,101,185,243,185, 65, 25, 99, 25,121,121,121,246, 33, - 67,134, 8,118,187, 29,121,121,121,200,207,207,135,205,102,107,168,248,179,205, 91,155,102,131, 88,212, 23, 42, 95,225,239,117, - 24,139,139,139, 79,173, 90,181,138,183,219,237,209,140, 49, 53, 0, 86,159, 97,143, 53,251,160,254, 60,107, 10,203, 59, 95,115, -119,189,197,189, 90,150,101,178, 44,203,146, 36,149,212,167, 71,236,212, 8, 13, 1,128,105,211,166, 61, 79, 41,125, 11,128,236, -112, 56,106,138,138,138,182,213,214,214,158,227, 56,174,193,198, 44, 97,140, 21,215, 79, 91,144,224, 99, 80,248,251,134, 81,162, -211,233,150, 3,232, 91,175,156, 50,234, 18,214, 74,132, 16,153, 49, 38, 19, 66,164,102,231,104,179,107, 13,231,101, 66,136, 84, -159,228, 86,110,184, 70, 8,145, 41,165, 82,139, 99,185, 33, 35, 52,165, 84,146,101, 89, 98,140, 89,204,102,243,149, 78, 43, 64, - 61, 84,225,225,225, 81,140,177, 48,142,227,180, 0,136, 44,203,118,142,227,202,195,195,195, 75, 60, 53, 8,212,141, 80,248,123, - 57, 88, 25, 24, 24, 24,205,113,156,154, 16,194, 84, 42, 21, 68, 81,108,108,165, 27, 90,241,230,199,132, 16,218,208,226, 59, 28, - 14,167, 30,128, 16,194,154,125, 26,202,194, 98,177, 56,221,131,227, 56, 70, 8, 97,149,149,149,172, 94,233,196,174, 42,128, 2, - 5,215,172, 4, 93,181, 4,189, 69,248,255, 3,212, 21,184,121, 66,226, 69,162, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, -}; - diff --git a/source/blender/src/pub/license_key.c b/source/blender/src/pub/license_key.c deleted file mode 100644 index 07e8296a185..00000000000 --- a/source/blender/src/pub/license_key.c +++ /dev/null @@ -1,447 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include "license_key.h" -#include "keyed_functions.h" -#include "BKE_utildefines.h" -#include "BIF_screen.h" // splash -#include "BIF_toolbox.h" -#include "blenkey.h" -#include -#include - -#include "BLI_blenlib.h" - -#include "BLO_readfile.h" -#include "BLO_keyStore.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -int LICENSE_KEY_VALID = TRUE; -int I_AM_PUBLISHER = TRUE; - -static UserStruct User; - -// Python stuff - -#include "Python.h" -#include "marshal.h" -#include "compile.h" /* to give us PyCodeObject */ -#include "eval.h" /* prototype for PyEval_EvalCode */ - -#include "BPY_extern.h" - -#include "IMB_imbuf.h" - -Fptr g_functab[PYKEY_TABLEN]; -Fptr g_ptrtab[PYKEY_TABLEN]; - -static int g_seed[3] = PYKEY_SEED; -static PyObject *g_module_self; -static PyObject *g_main; - - -// end Python stuff - -// **************** PYTHON STUFF ************************** -/* ----------------------------------------------------- */ -/* this is the dummy functions to demonstrate */ - -int sticky_shoes(void *vp) -{ - return 0; -} - -/* -int key_func1(void *vp) { - printf("function 1 called\n"); -} - -*/ -int key_return_true(void *vp) { - return 1; -} - - -/* ----------------------------------------------------- */ - -/* Declarations for objects of type Fplist */ - - -static char prot_getseed__doc__[] = ""; - -static PyObject * -prot_getseed(self, args) - PyObject *self; /* Not used */ - PyObject *args; -{ - PyObject *p; - p = PyTuple_New(3); - PyTuple_SetItem(p, 0, PyInt_FromLong(g_seed[0])); - PyTuple_SetItem(p, 1, PyInt_FromLong(g_seed[1])); - PyTuple_SetItem(p, 2, PyInt_FromLong(g_seed[2])); - return p; -} - -static char prot_getlen__doc__[] = ""; -static PyObject * -prot_getlen(self, args) - PyObject *self; /* Not used */ - PyObject *args; -{ - return Py_BuildValue("i", PYKEY_TABLEN); -} - -static char prot_getptr__doc__[] = -"" -; - -static PyObject * -prot_getptr(self, args) - PyObject *self; /* Not used */ - PyObject *args; -{ - PyObject *p; - Fptr f; - int index; - /* we don't catch errors here, we're in the key code */ - if (!g_functab) - return NULL; - if (!PyArg_ParseTuple(args, "i", &index)) - return NULL; - if (index >= PYKEY_TABLEN) - return NULL; - - f = g_functab[index]; - p = PyCObject_FromVoidPtr(f , NULL); - return p; -} - -static char prot_setptr__doc__[] = -"" -; -static PyObject * -prot_setptr(self, args) - PyObject *self; /* Not used */ - PyObject *args; -{ - PyObject *p; - - int index; - - if (!g_ptrtab) - return NULL; - if (!PyArg_ParseTuple(args, "iO", &index, &p)) - return NULL; - if (index >= PYKEY_TABLEN) - return NULL; - if (!PyCObject_Check(p)) { - return NULL; - } - - g_ptrtab[index] = PyCObject_AsVoidPtr(p); - return Py_BuildValue("i", 1); -} - -static PyObject *callkeycode( - unsigned char *keycode, - int keycodelen) -{ - PyCodeObject *code; - PyObject *maindict = PyModule_GetDict(g_main); - - code = (PyCodeObject *) PyMarshal_ReadObjectFromString(keycode, keycodelen); - if (!PyEval_EvalCode(code, maindict, maindict)) - return NULL; - return Py_BuildValue("i", 1); -} - - - -/* List of methods defined in the module */ - -static struct PyMethodDef prot_methods[] = { - {"getlen", (PyCFunction)prot_getlen, METH_VARARGS, prot_getlen__doc__}, - {"getseed", (PyCFunction)prot_getseed, METH_VARARGS, prot_getseed__doc__}, - {"getptr", (PyCFunction)prot_getptr, METH_VARARGS, prot_getptr__doc__}, - {"setptr", (PyCFunction)prot_setptr, METH_VARARGS, prot_setptr__doc__}, - - {NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */ -}; - - -/* Initialization function for the module (*must* be called initprot) */ - -static char prot_module_documentation[] = "No Documentation"; - -static void init_ftable(void) // initializes functiontable -{ - int i; - - g_functab[0] = &key_func1; -/* add more key_funcs here */ - - for (i = 1; i < PYKEY_TABLEN; i++) - { - g_functab[i] = &sticky_shoes; - } -} - - -static void init_ptable(void) // initializes functiontable -{ - int i; - - for (i = 0; i < PYKEY_TABLEN; i++) - { - g_ptrtab[i] = &sticky_shoes; - } -} - - -static void insertname(PyObject *m,PyObject *p, char *name) -{ - PyObject *d = PyModule_GetDict(m); - - EXPP_dict_set_item_str(d, name, p); -} - -/* initialisation */ -static void initprot() -{ - PyObject *m, *d; - PyObject *capi1; - init_ftable(); - - g_main = PyImport_AddModule("__main__"); - - m = Py_InitModule4("prot", prot_methods, - prot_module_documentation, - (PyObject*)NULL,PYTHON_API_VERSION); - g_module_self = m; - d = PyModule_GetDict(m); - EXPP_dict_set_item_str(d, "error", PyString_FromString("prot.error"); - - /* add global object */ - - capi1 = PyCObject_FromVoidPtr((void *)g_functab , NULL); - if (capi1) { - insertname(m, capi1, "APIfunctab"); - } - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module prot"); - - init_ptable(); -} - -// ******************************* KEY STUFF ********************* - -static void create_key_name(char * keyname) -{ - sprintf(keyname, "%s/.BPkey", BLI_gethome()); -} - -void checkhome() -{ - int keyresult; - char *HexPriv, *HexPub, *HexPython; - byte *Byte; - char keyname[FILE_MAXDIR + FILE_MAXFILE]; - int wasInitialized; - unsigned char *keycode = NULL; - int keycodelen = 0; - - create_key_name(keyname); - keyresult = ReadKeyFile(keyname, &User, &HexPriv, &HexPub, - &Byte, &HexPython); - if (keyresult != 0) { - // printf("\nReadKeyFile error %d\n", keyresult); - } else { - // printf("\nReadKeyFile OK\n"); - LICENSE_KEY_VALID = TRUE; - - wasInitialized = Py_IsInitialized(); - - // make it failsafe if python interpreter was already initialized - if (wasInitialized) - Py_Initialize(); - - initprot(); // initialize module and function tables - // get python byte code - keycode = DeHexify(HexPython); - keycodelen = strlen(HexPython) / 2; - - callkeycode(keycode, keycodelen); - - Py_Finalize(); - - if (wasInitialized) // if we were initialized, - BPY_start_python(); // restart creator python - - //some debugging stuff - // print_ptable(); - - // Store key stuff for use by stream - keyStoreConstructor( - &User, - HexPriv, - HexPub, - Byte, - HexPython); - - // other initialization code - - } -} - -void SHOW_LICENSE_KEY(void) -{ - extern int datatoc_tonize; - extern char datatoc_ton[]; - char string[1024]; - int maxtype, type; - char *typestrings[] = { - "", - "Individual", - "Company", - "Unlimited", - "Educational"}; - - maxtype = (sizeof(typestrings) / sizeof(char *)) - 1; - type = User.keytype; - if (type > maxtype) { - type = 0; - } - - if (LICENSE_KEY_VALID) { - sprintf(string, "%s License registered to: %s (%s)", typestrings[type], User.name, User.email); - splash((void *)datatoc_ton, datatoc_tonize, string); - } -} - -void loadKeyboard(char * name) -{ - char keyname[FILE_MAXDIR + FILE_MAXFILE]; - FILE *in, *out; - char string[1024], *match = 0; - int i, c; - int found = 0; - - // make sure we don't overwrite a valid key... - - if (!LICENSE_KEY_VALID) { - in = fopen(name, "rb"); - if (in) { - // scan for blender key magic, read strings - // with anything but a newline - while (fscanf(in, "%1000[^\n\r]", string) != EOF) { - match = strstr(string, BLENKEYMAGIC); - if (match) { - break; - } - fscanf(in, "\n"); - } - - if (match) { - // found blender key magic, open output file - // to copy key information - - create_key_name(keyname); - out = fopen(keyname, "wb"); - if (out) { - // printout first line - fprintf(out, "%s", match); - for (i = 0; i < 350; i++) { - // handle control characters (\n\r) - while (1) { - c = getc(in); - if (c == '\n') { - // output a \n for each \n in the input - fprintf(out, "\n"); - } else if (c == EOF) { - break; - } else if (c < ' ') { - // skip control characters - } else { - ungetc(c, in); - break; - } - } - - if (fscanf(in, "%1000[^\n\r]", string) != EOF) { - if (strcmp(string, BLENKEYSEPERATOR) == 0) { - found++; - } - fprintf(out, "%s", string); - } else { - break; - } - - if (found >= 2) { - break; - } - } - - fclose(out); - - checkhome(); - if (LICENSE_KEY_VALID) { - SHOW_LICENSE_KEY(); - } else { - error("Not a valid license key ! Removing installed key."); - BLI_delete(keyname, 0, 0); - } - - } else { - error("Can't install key"); - } - } else { - error("File doesn't contain a valid key: %s", name); - } - - fclose(in); - - if (LICENSE_KEY_VALID) { - if (okee("Remove input file: '%s'?", name)) { - BLI_delete(name, 0, 0); - } - } - - } else { - error("File doesn't exist: %s", name); - } - } -} diff --git a/source/blender/src/reeb.c b/source/blender/src/reeb.c deleted file mode 100644 index 85fb5815c3e..00000000000 --- a/source/blender/src/reeb.c +++ /dev/null @@ -1,1923 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Martin Poirier - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include // for memcpy -#include -#include // for qsort - -#include "DNA_listBase.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_meshdata_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_editVert.h" -#include "BLI_edgehash.h" - -#include "BDR_editobject.h" - -#include "BIF_editmesh.h" -#include "BIF_editarmature.h" -#include "BIF_interface.h" -#include "BIF_toolbox.h" -#include "BIF_graphics.h" - -#include "BKE_global.h" -#include "BKE_utildefines.h" -#include "BKE_customdata.h" - -#include "blendef.h" - -#include "ONL_opennl.h" - -#include "reeb.h" - -/* - * Skeleton generation algorithm based on: - * "Harmonic Skeleton for Realistic Character Animation" - * Gregoire Aujay, Franck Hetroy, Francis Lazarus and Christine Depraz - * SIGGRAPH 2007 - * - * Reeb graph generation algorithm based on: - * "Robust On-line Computation of Reeb Graphs: Simplicity and Speed" - * Valerio Pascucci, Giorgio Scorzelli, Peer-Timo Bremer and Ajith Mascarenhas - * SIGGRAPH 2007 - * - * */ - -int mergeArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1); -int mergeConnectedArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1); -EditEdge * NextEdgeForVert(EditMesh *em, EditVert *v); - -/***************************************** BUCKET UTILS **********************************************/ - -void addVertToBucket(EmbedBucket *b, float co[3]) -{ - b->nv++; - VecLerpf(b->p, b->p, co, 1.0f / b->nv); -} - -void removeVertFromBucket(EmbedBucket *b, float co[3]) -{ - VecMulf(b->p, (float)b->nv); - VecSubf(b->p, b->p, co); - b->nv--; - VecMulf(b->p, 1.0f / (float)b->nv); -} - -void mergeBuckets(EmbedBucket *bDst, EmbedBucket *bSrc) -{ - if (bDst->nv > 0 && bSrc->nv > 0) - { - bDst->nv += bSrc->nv; - VecLerpf(bDst->p, bDst->p, bSrc->p, (float)bSrc->nv / (float)(bDst->nv)); - } - else if (bSrc->nv > 0) - { - bDst->nv = bSrc->nv; - VECCOPY(bDst->p, bSrc->p); - } -} - -void mergeArcBuckets(ReebArc *aDst, ReebArc *aSrc, float start, float end) -{ - if (aDst->bcount > 0 && aSrc->bcount > 0) - { - int indexDst = 0, indexSrc = 0; - - start = MAX3(start, aDst->buckets[0].val, aSrc->buckets[0].val); - - while(indexDst < aDst->bcount && aDst->buckets[indexDst].val < start) - { - indexDst++; - } - - while(indexSrc < aSrc->bcount && aSrc->buckets[indexSrc].val < start) - { - indexSrc++; - } - - for( ; indexDst < aDst->bcount && - indexSrc < aSrc->bcount && - aDst->buckets[indexDst].val <= end && - aSrc->buckets[indexSrc].val <= end - - ; indexDst++, indexSrc++) - { - mergeBuckets(aDst->buckets + indexDst, aSrc->buckets + indexSrc); - } - } -} - -void allocArcBuckets(ReebArc *arc) -{ - int i; - float start = ceil(arc->v1->weight); - arc->bcount = (int)(floor(arc->v2->weight) - start) + 1; - - if (arc->bcount > 0) - { - arc->buckets = MEM_callocN(sizeof(EmbedBucket) * arc->bcount, "embed bucket"); - - for(i = 0; i < arc->bcount; i++) - { - arc->buckets[i].val = start + i; - } - } - else - { - arc->buckets = NULL; - } - -} - -void resizeArcBuckets(ReebArc *arc) -{ - EmbedBucket *oldBuckets = arc->buckets; - int oldBCount = arc->bcount; - - allocArcBuckets(arc); - - if (oldBCount != 0 && arc->bcount != 0) - { - int oldStart = (int)oldBuckets[0].val; - int oldEnd = (int)oldBuckets[oldBCount - 1].val; - int newStart = (int)arc->buckets[0].val; - int newEnd = (int)arc->buckets[arc->bcount - 1].val; - int oldOffset = 0; - int newOffset = 0; - int len; - - if (oldStart < newStart) - { - oldOffset = newStart - oldStart; - } - else - { - newOffset = oldStart - newStart; - } - - len = MIN2(oldEnd - (oldStart + oldOffset) + 1, newEnd - (newStart - newOffset) + 1); - - memcpy(arc->buckets + newOffset, oldBuckets + oldOffset, len * sizeof(EmbedBucket)); - } - - if (oldBuckets != NULL) - { - MEM_freeN(oldBuckets); - } -} -/***************************************** UTILS **********************************************/ - -ReebEdge * copyEdge(ReebEdge *edge) -{ - ReebEdge *newEdge = NULL; - - newEdge = MEM_callocN(sizeof(ReebEdge), "reeb edge"); - memcpy(newEdge, edge, sizeof(ReebEdge)); - - newEdge->next = NULL; - newEdge->prev = NULL; - - return newEdge; -} - -void printArc(ReebArc *arc) -{ - ReebEdge *edge; - printf("arc: (%i)%f -> (%i)%f\n", arc->v1->index, arc->v1->weight, arc->v2->index, arc->v2->weight); - - for(edge = arc->edges.first; edge ; edge = edge->next) - { - printf("\tedge (%i, %i)\n", edge->v1->index, edge->v2->index); - } -} - -void freeArc(ReebArc *arc) -{ - BLI_freelistN(&arc->edges); - - if (arc->buckets) - MEM_freeN(arc->buckets); - - MEM_freeN(arc); -} - -void freeGraph(ReebGraph *rg) -{ - ReebArc *arc; - ReebNode *node; - - // free nodes - for( node = rg->nodes.first; node; node = node->next ) - { - // Free adjacency lists - if (node->arcs != NULL) - { - MEM_freeN(node->arcs); - } - } - BLI_freelistN(&rg->nodes); - - // free arcs - arc = rg->arcs.first; - while( arc ) - { - ReebArc *next = arc->next; - freeArc(arc); - arc = next; - } - - // free edge map - BLI_edgehash_free(rg->emap, NULL); - - MEM_freeN(rg); -} - -void repositionNodes(ReebGraph *rg) -{ - ReebArc *arc = NULL; - ReebNode *node = NULL; - - // Reset node positions - for(node = rg->nodes.first; node; node = node->next) - { - node->p[0] = node->p[1] = node->p[2] = 0; - } - - for(arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->bcount > 0) - { - float p[3]; - - VECCOPY(p, arc->buckets[0].p); - VecMulf(p, 1.0f / arc->v1->degree); - VecAddf(arc->v1->p, arc->v1->p, p); - - VECCOPY(p, arc->buckets[arc->bcount - 1].p); - VecMulf(p, 1.0f / arc->v2->degree); - VecAddf(arc->v2->p, arc->v2->p, p); - } - } -} - -void verifyNodeDegree(ReebGraph *rg) -{ - ReebNode *node = NULL; - ReebArc *arc = NULL; - - for(node = rg->nodes.first; node; node = node->next) - { - int count = 0; - for(arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->v1 == node || arc->v2 == node) - { - count++; - } - } - if (count != node->degree) - { - printf("degree error in node %i: expected %i got %i\n", node->index, count, node->degree); - } - } -} - -void verifyBuckets(ReebGraph *rg) -{ -#ifdef DEBUG_REEB - ReebArc *arc = NULL; - for(arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->bcount > 0) - { - int i; - for(i = 0; i < arc->bcount; i++) - { - if (arc->buckets[i].nv == 0) - { - printArc(arc); - printf("count error in bucket %i/%i\n", i+1, arc->bcount); - } - } - - if (ceil(arc->v1->weight) < arc->buckets[0].val) - { - printArc(arc); - printf("alloc error in first bucket: %f should be %f \n", arc->buckets[0].val, ceil(arc->v1->weight)); - } - if (floor(arc->v2->weight) < arc->buckets[arc->bcount - 1].val) - { - printArc(arc); - printf("alloc error in last bucket: %f should be %f \n", arc->buckets[arc->bcount - 1].val, floor(arc->v2->weight)); - } - } - } -#endif -} - -/************************************** ADJACENCY LIST *************************************************/ - -void addArcToNodeAdjacencyList(ReebNode *node, ReebArc *arc) -{ - ReebArc **arclist; - - for(arclist = node->arcs; *arclist; arclist++) - { } - - *arclist = arc; -} - -void buildAdjacencyList(ReebGraph *rg) -{ - ReebNode *node = NULL; - ReebArc *arc = NULL; - - for(node = rg->nodes.first; node; node = node->next) - { - if (node->arcs != NULL) - { - MEM_freeN(node->arcs); - } - - node->arcs = MEM_callocN((node->degree + 1) * sizeof(ReebArc*), "adjacency list"); - } - - for(arc = rg->arcs.first; arc; arc= arc->next) - { - addArcToNodeAdjacencyList(arc->v1, arc); - addArcToNodeAdjacencyList(arc->v2, arc); - } -} - -int hasAdjacencyList(ReebGraph *rg) -{ - ReebNode *node; - - for(node = rg->nodes.first; node; node = node->next) - { - if (node->arcs == NULL) - { - return 0; - } - } - - return 1; -} - -int countConnectedArcs(ReebGraph *rg, ReebNode *node) -{ - int count = 0; - - /* use adjacency list if present */ - if (node->arcs) - { - ReebArc **arcs; - - for(arcs = node->arcs; *arcs; arcs++) - { - count++; - } - } - else - { - ReebArc *arc; - for(arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->v1 == node || arc->v2 == node) - { - count++; - } - } - } - - return count; -} - -/****************************************** SMOOTHING **************************************************/ - -void postprocessGraph(ReebGraph *rg, char mode) -{ - ReebArc *arc; - float fac1 = 0, fac2 = 1, fac3 = 0; - - switch(mode) - { - case SKGEN_AVERAGE: - fac1 = fac2 = fac3 = 1.0f / 3.0f; - break; - case SKGEN_SMOOTH: - fac1 = fac3 = 0.25f; - fac2 = 0.5f; - break; - case SKGEN_SHARPEN: - fac1 = fac2 = -0.25f; - fac2 = 1.5f; - break; - default: - error("Unknown post processing mode"); - return; - } - - for(arc = rg->arcs.first; arc; arc = arc->next) - { - EmbedBucket *buckets = arc->buckets; - int bcount = arc->bcount; - int index; - - for(index = 1; index < bcount - 1; index++) - { - VecLerpf(buckets[index].p, buckets[index].p, buckets[index - 1].p, fac1 / (fac1 + fac2)); - VecLerpf(buckets[index].p, buckets[index].p, buckets[index + 1].p, fac3 / (fac1 + fac2 + fac3)); - } - } -} - -/********************************************SORTING****************************************************/ - -int compareNodesWeight(void *vnode1, void *vnode2) -{ - ReebNode *node1 = (ReebNode*)vnode1; - ReebNode *node2 = (ReebNode*)vnode2; - - if (node1->weight < node2->weight) - { - return -1; - } - if (node1->weight > node2->weight) - { - return 1; - } - else - { - return 0; - } -} - -void sortNodes(ReebGraph *rg) -{ - BLI_sortlist(&rg->nodes, compareNodesWeight); -} - -int compareArcsWeight(void *varc1, void *varc2) -{ - ReebArc *arc1 = (ReebArc*)varc1; - ReebArc *arc2 = (ReebArc*)varc2; - - if (arc1->v1->weight < arc2->v1->weight) - { - return -1; - } - if (arc1->v1->weight > arc2->v1->weight) - { - return 1; - } - else - { - return 0; - } -} - -void sortArcs(ReebGraph *rg) -{ - BLI_sortlist(&rg->arcs, compareArcsWeight); -} - -/****************************************** FILTERING **************************************************/ - -int compareArcs(void *varc1, void *varc2) -{ - ReebArc *arc1 = (ReebArc*)varc1; - ReebArc *arc2 = (ReebArc*)varc2; - float len1 = arc1->v2->weight - arc1->v1->weight; - float len2 = arc2->v2->weight - arc2->v1->weight; - - if (len1 < len2) - { - return -1; - } - if (len1 > len2) - { - return 1; - } - else - { - return 0; - } -} - -void filterArc(ReebGraph *rg, ReebNode *newNode, ReebNode *removedNode, ReebArc * srcArc, int merging) -{ - ReebArc *arc = NULL, *nextArc = NULL; - - /* first pass, merge buckets for arcs that spawned the two nodes into the source arc*/ - for(arc = rg->arcs.first; arc; arc = arc->next) - { - if (arc->v1 == srcArc->v1 && arc->v2 == srcArc->v2 && arc != srcArc) - { - mergeArcBuckets(srcArc, arc, srcArc->v1->weight, srcArc->v2->weight); - } - } - - /* second pass, replace removedNode by newNode, remove arcs that are collapsed in a loop */ - arc = rg->arcs.first; - while(arc) - { - nextArc = arc->next; - - if (arc->v1 == removedNode || arc->v2 == removedNode) - { - if (arc->v1 == removedNode) - { - arc->v1 = newNode; - } - else - { - arc->v2 = newNode; - } - - // Remove looped arcs - if (arc->v1 == arc->v2) - { - // v1 or v2 was already newNode, since we're removing an arc, decrement degree - newNode->degree--; - - // If it's safeArc, it'll be removed later, so keep it for now - if (arc != srcArc) - { - BLI_remlink(&rg->arcs, arc); - freeArc(arc); - } - } - // Remove flipped arcs - else if (arc->v1->weight > arc->v2->weight) - { - // Decrement degree from the other node - OTHER_NODE(arc, newNode)->degree--; - - BLI_remlink(&rg->arcs, arc); - freeArc(arc); - } - else - { - newNode->degree++; // incrementing degree since we're adding an arc - - if (merging) - { - // resize bucket list - resizeArcBuckets(arc); - mergeArcBuckets(arc, srcArc, arc->v1->weight, arc->v2->weight); - } - } - } - - arc = nextArc; - } -} - -void filterNullReebGraph(ReebGraph *rg) -{ - ReebArc *arc = NULL, *nextArc = NULL; - - arc = rg->arcs.first; - while(arc) - { - nextArc = arc->next; - // Only collapse arcs too short to have any embed bucket - if (arc->bcount == 0) - { - ReebNode *newNode = arc->v1; - ReebNode *removedNode = arc->v2; - float blend; - - blend = (float)newNode->degree / (float)(newNode->degree + removedNode->degree); // blending factors - - //newNode->weight = FloatLerpf(newNode->weight, removedNode->weight, blend); - VecLerpf(newNode->p, newNode->p, removedNode->p, blend); - - filterArc(rg, newNode, removedNode, arc, 0); - - // Reset nextArc, it might have changed - nextArc = arc->next; - - BLI_remlink(&rg->arcs, arc); - freeArc(arc); - - BLI_freelinkN(&rg->nodes, removedNode); - } - - arc = nextArc; - } -} - -int filterInternalReebGraph(ReebGraph *rg, float threshold) -{ - ReebArc *arc = NULL, *nextArc = NULL; - int value = 0; - - BLI_sortlist(&rg->arcs, compareArcs); - - arc = rg->arcs.first; - while(arc) - { - nextArc = arc->next; - - // Only collapse non-terminal arcs that are shorter than threshold - if ((arc->v1->degree > 1 && arc->v2->degree > 1 && arc->v2->weight - arc->v1->weight < threshold)) - { - ReebNode *newNode = NULL; - ReebNode *removedNode = NULL; - - /* Keep the node with the highestn number of connected arcs */ - if (arc->v1->degree >= arc->v2->degree) - { - newNode = arc->v1; - removedNode = arc->v2; - } - else - { - newNode = arc->v2; - removedNode = arc->v1; - } - - filterArc(rg, newNode, removedNode, arc, 1); - - // Reset nextArc, it might have changed - nextArc = arc->next; - - BLI_remlink(&rg->arcs, arc); - freeArc(arc); - - BLI_freelinkN(&rg->nodes, removedNode); - value = 1; - } - - arc = nextArc; - } - - return value; -} - -int filterExternalReebGraph(ReebGraph *rg, float threshold) -{ - ReebArc *arc = NULL, *nextArc = NULL; - int value = 0; - - BLI_sortlist(&rg->arcs, compareArcs); - - arc = rg->arcs.first; - while(arc) - { - nextArc = arc->next; - - // Only collapse terminal arcs that are shorter than threshold - if ((arc->v1->degree == 1 || arc->v2->degree == 1) && arc->v2->weight - arc->v1->weight < threshold) - { - ReebNode *terminalNode = NULL; - ReebNode *middleNode = NULL; - ReebNode *newNode = NULL; - ReebNode *removedNode = NULL; - int merging = 0; - - // Assign terminal and middle nodes - if (arc->v1->degree == 1) - { - terminalNode = arc->v1; - middleNode = arc->v2; - } - else - { - terminalNode = arc->v2; - middleNode = arc->v1; - } - - // If middle node is a normal node, merge to terminal node - if (middleNode->degree == 2) - { - merging = 1; - newNode = terminalNode; - removedNode = middleNode; - } - // Otherwise, just plain remove of the arc - else - { - merging = 0; - newNode = middleNode; - removedNode = terminalNode; - } - - // Merging arc - if (merging) - { - filterArc(rg, newNode, removedNode, arc, 1); - } - else - { - // removing arc, so we need to decrease the degree of the remaining node - newNode->degree--; - } - - // Reset nextArc, it might have changed - nextArc = arc->next; - - BLI_remlink(&rg->arcs, arc); - freeArc(arc); - - BLI_freelinkN(&rg->nodes, removedNode); - value = 1; - } - - arc = nextArc; - } - - return value; -} - -/************************************** WEIGHT SPREADING ***********************************************/ - -int compareVerts( const void* a, const void* b ) -{ - EditVert *va = *(EditVert**)a; - EditVert *vb = *(EditVert**)b; - int value = 0; - - if (va->tmp.fp < vb->tmp.fp) - { - value = -1; - } - else if (va->tmp.fp > vb->tmp.fp) - { - value = 1; - } - - return value; -} - -void spreadWeight(EditMesh *em) -{ - EditVert **verts, *eve; - float lastWeight = 0.0f; - int totvert = BLI_countlist(&em->verts); - int i; - int work_needed = 1; - - verts = MEM_callocN(sizeof(EditVert*) * totvert, "verts array"); - - for(eve = em->verts.first, i = 0; eve; eve = eve->next, i++) - { - verts[i] = eve; - } - - while(work_needed == 1) - { - work_needed = 0; - qsort(verts, totvert, sizeof(EditVert*), compareVerts); - - for(i = 0; i < totvert; i++) - { - eve = verts[i]; - - if (i == 0 || (eve->tmp.fp - lastWeight) > FLT_EPSILON) - { - lastWeight = eve->tmp.fp; - } - else - { - work_needed = 1; - eve->tmp.fp = lastWeight + FLT_EPSILON * 2; - lastWeight = eve->tmp.fp; - } - } - } - - MEM_freeN(verts); -} -/*********************************** GRAPH AS TREE FUNCTIONS *******************************************/ - -int subtreeDepth(ReebNode *node, ReebArc *rootArc) -{ - int depth = 0; - - /* Base case, no arcs leading away */ - if (node->arcs == NULL || *(node->arcs) == NULL) - { - return 0; - } - else - { - ReebArc ** pArc; - - for(pArc = node->arcs; *pArc; pArc++) - { - ReebArc *arc = *pArc; - - /* only arcs that go down the tree */ - if (arc != rootArc) - { - ReebNode *newNode = OTHER_NODE(arc, node); - depth = MAX2(depth, subtreeDepth(newNode, arc)); - } - } - } - - return depth + 1; -} - -/*************************************** CYCLE DETECTION ***********************************************/ - -int detectCycle(ReebNode *node, ReebArc *srcArc) -{ - int value = 0; - - if (node->flags == 0) - { - ReebArc ** pArc; - - /* mark node as visited */ - node->flags = 1; - - for(pArc = node->arcs; *pArc && value == 0; pArc++) - { - ReebArc *arc = *pArc; - - /* don't go back on the source arc */ - if (arc != srcArc) - { - value = detectCycle(OTHER_NODE(arc, node), arc); - } - } - } - else - { - value = 1; - } - - return value; -} - -int isGraphCyclic(ReebGraph *rg) -{ - ReebNode *node; - int value = 0; - - /* NEED TO CHECK IF ADJACENCY LIST EXIST */ - - /* Mark all nodes as not visited */ - for(node = rg->nodes.first; node; node = node->next) - { - node->flags = 0; - } - - /* detectCycles in subgraphs */ - for(node = rg->nodes.first; node && value == 0; node = node->next) - { - /* only for nodes in subgraphs that haven't been visited yet */ - if (node->flags == 0) - { - value = value || detectCycle(node, NULL); - } - } - - return value; -} - -/******************************************** EXPORT ***************************************************/ - -void exportNode(FILE *f, char *text, ReebNode *node) -{ - fprintf(f, "%s i:%i w:%f d:%i %f %f %f\n", text, node->index, node->weight, node->degree, node->p[0], node->p[1], node->p[2]); -} - -void exportGraph(ReebGraph *rg, int count) -{ -#ifdef DEBUG_REEB - ReebArc *arc; - char filename[128]; - FILE *f; - - if (count == -1) - { - sprintf(filename, "test.txt"); - } - else - { - sprintf(filename, "test%05i.txt", count); - } - f = fopen(filename, "w"); - - for(arc = rg->arcs.first; arc; arc = arc->next) - { - int i; - - exportNode(f, "v1", arc->v1); - - for(i = 0; i < arc->bcount; i++) - { - fprintf(f, "b nv:%i %f %f %f\n", arc->buckets[i].nv, arc->buckets[i].p[0], arc->buckets[i].p[1], arc->buckets[i].p[2]); - } - - exportNode(f, "v2", arc->v2); - } - - fclose(f); -#endif -} - -/***************************************** MAIN ALGORITHM **********************************************/ - -ReebArc * findConnectedArc(ReebGraph *rg, ReebArc *arc, ReebNode *v) -{ - ReebArc *nextArc = arc->next; - - for(nextArc = rg->arcs.first; nextArc; nextArc = nextArc->next) - { - if (arc != nextArc && (nextArc->v1 == v || nextArc->v2 == v)) - { - break; - } - } - - return nextArc; -} - -void removeNormalNodes(ReebGraph *rg) -{ - ReebArc *arc; - - // Merge degree 2 nodes - for(arc = rg->arcs.first; arc; arc = arc->next) - { - while (arc->v1->degree == 2 || arc->v2->degree == 2) - { - // merge at v1 - if (arc->v1->degree == 2) - { - ReebArc *nextArc = findConnectedArc(rg, arc, arc->v1); - - // Merge arc only if needed - if (arc->v1 == nextArc->v2) - { - mergeConnectedArcs(rg, arc, nextArc); - } - // Otherwise, mark down vert - else - { - arc->v1->degree = 3; - } - } - - // merge at v2 - if (arc->v2->degree == 2) - { - ReebArc *nextArc = findConnectedArc(rg, arc, arc->v2); - - // Merge arc only if needed - if (arc->v2 == nextArc->v1) - { - mergeConnectedArcs(rg, arc, nextArc); - } - // Otherwise, mark down vert - else - { - arc->v2->degree = 3; - } - } - } - } - -} - -int edgeEquals(ReebEdge *e1, ReebEdge *e2) -{ - return (e1->v1 == e2->v1 && e1->v2 == e2->v2); -} - -ReebArc *nextArcMappedToEdge(ReebArc *arc, ReebEdge *e) -{ - ReebEdge *nextEdge = NULL; - ReebEdge *edge = NULL; - ReebArc *result = NULL; - - /* Find the ReebEdge in the edge list */ - for(edge = arc->edges.first; edge && !edgeEquals(edge, e); edge = edge->next) - { } - - nextEdge = edge->nextEdge; - - if (nextEdge != NULL) - { - result = nextEdge->arc; - } - - return result; -} - -typedef enum { - MERGE_LOWER, - MERGE_HIGHER, - MERGE_APPEND -} MergeDirection; - -void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection direction) -{ - ReebEdge *e = NULL; - - if (direction == MERGE_APPEND) - { - for(e = aSrc->edges.first; e; e = e->next) - { - e->arc = aDst; // Edge is stolen by new arc - } - - addlisttolist(&aDst->edges , &aSrc->edges); - } - else - { - for(e = aSrc->edges.first; e; e = e->next) - { - ReebEdge *newEdge = copyEdge(e); - - newEdge->arc = aDst; - - BLI_addtail(&aDst->edges, newEdge); - - if (direction == MERGE_LOWER) - { - void **p = BLI_edgehash_lookup_p(rg->emap, e->v1->index, e->v2->index); - - newEdge->nextEdge = e; - - // if edge was the first in the list, point the edit edge to the new reeb edge instead. - if (*p == e) - { - *p = (void*)newEdge; - } - // otherwise, advance in the list until the predecessor is found then insert it there - else - { - ReebEdge *previous = (ReebEdge*)*p; - - while(previous->nextEdge != e) - { - previous = previous->nextEdge; - } - - previous->nextEdge = newEdge; - } - } - else - { - newEdge->nextEdge = e->nextEdge; - e->nextEdge = newEdge; - } - } - } -} - -// return 1 on full merge -int mergeConnectedArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1) -{ - int result = 0; - ReebNode *removedNode = NULL; - - mergeArcEdges(rg, a0, a1, MERGE_APPEND); - - // Bring a0 to the combine length of both arcs - if (a0->v2 == a1->v1) - { - removedNode = a0->v2; - a0->v2 = a1->v2; - } - else if (a0->v1 == a1->v2) - { - removedNode = a0->v1; - a0->v1 = a1->v1; - } - - resizeArcBuckets(a0); - // Merge a1 in a0 - mergeArcBuckets(a0, a1, a0->v1->weight, a0->v2->weight); - - // remove a1 from graph - BLI_remlink(&rg->arcs, a1); - freeArc(a1); - - BLI_freelinkN(&rg->nodes, removedNode); - result = 1; - - return result; -} -// return 1 on full merge -int mergeArcs(ReebGraph *rg, ReebArc *a0, ReebArc *a1) -{ - int result = 0; - // TRIANGLE POINTS DOWN - if (a0->v1->weight == a1->v1->weight) // heads are the same - { - if (a0->v2->weight == a1->v2->weight) // tails also the same, arcs can be totally merge together - { - mergeArcEdges(rg, a0, a1, MERGE_APPEND); - - mergeArcBuckets(a0, a1, a0->v1->weight, a0->v2->weight); - - // Adjust node degree - a1->v1->degree--; - a1->v2->degree--; - - // remove a1 from graph - BLI_remlink(&rg->arcs, a1); - - freeArc(a1); - result = 1; - } - else if (a0->v2->weight > a1->v2->weight) // a1->v2->weight is in the middle - { - mergeArcEdges(rg, a1, a0, MERGE_LOWER); - - // Adjust node degree - a0->v1->degree--; - a1->v2->degree++; - - mergeArcBuckets(a1, a0, a1->v1->weight, a1->v2->weight); - a0->v1 = a1->v2; - resizeArcBuckets(a0); - } - else // a0>n2 is in the middle - { - mergeArcEdges(rg, a0, a1, MERGE_LOWER); - - // Adjust node degree - a1->v1->degree--; - a0->v2->degree++; - - mergeArcBuckets(a0, a1, a0->v1->weight, a0->v2->weight); - a1->v1 = a0->v2; - resizeArcBuckets(a1); - } - } - // TRIANGLE POINTS UP - else if (a0->v2->weight == a1->v2->weight) // tails are the same - { - if (a0->v1->weight > a1->v1->weight) // a0->v1->weight is in the middle - { - mergeArcEdges(rg, a0, a1, MERGE_HIGHER); - - // Adjust node degree - a1->v2->degree--; - a0->v1->degree++; - - mergeArcBuckets(a0, a1, a0->v1->weight, a0->v2->weight); - a1->v2 = a0->v1; - resizeArcBuckets(a1); - } - else // a1->v1->weight is in the middle - { - mergeArcEdges(rg, a1, a0, MERGE_HIGHER); - - // Adjust node degree - a0->v2->degree--; - a1->v1->degree++; - - mergeArcBuckets(a1, a0, a1->v1->weight, a1->v2->weight); - a0->v2 = a1->v1; - resizeArcBuckets(a0); - } - } - else - { - // Need something here (OR NOT) - } - - return result; -} - -void glueByMergeSort(ReebGraph *rg, ReebArc *a0, ReebArc *a1, ReebEdge *e0, ReebEdge *e1) -{ - int total = 0; - while (total == 0 && a0 != a1 && a0 != NULL && a1 != NULL) - { - total = mergeArcs(rg, a0, a1); - - if (total == 0) // if it wasn't a total merge, go forward - { - if (a0->v2->weight < a1->v2->weight) - { - a0 = nextArcMappedToEdge(a0, e0); - } - else - { - a1 = nextArcMappedToEdge(a1, e1); - } - } - } -} - -void mergePaths(ReebGraph *rg, ReebEdge *e0, ReebEdge *e1, ReebEdge *e2) -{ - ReebArc *a0, *a1, *a2; - a0 = e0->arc; - a1 = e1->arc; - a2 = e2->arc; - - glueByMergeSort(rg, a0, a1, e0, e1); - glueByMergeSort(rg, a0, a2, e0, e2); -} - -ReebNode * addNode(ReebGraph *rg, EditVert *eve, float weight) -{ - ReebNode *node = NULL; - - node = MEM_callocN(sizeof(ReebNode), "reeb node"); - - node->flags = 0; // clear flags on init - node->arcs = NULL; - node->degree = 0; - node->weight = weight; - node->index = rg->totnodes; - VECCOPY(node->p, eve->co); - - BLI_addtail(&rg->nodes, node); - rg->totnodes++; - - return node; -} - -ReebEdge * createArc(ReebGraph *rg, ReebNode *node1, ReebNode *node2) -{ - ReebEdge *edge; - - edge = BLI_edgehash_lookup(rg->emap, node1->index, node2->index); - - // Only add existing edges that haven't been added yet - if (edge == NULL) - { - ReebArc *arc; - ReebNode *v1, *v2; - float len, offset; - int i; - - arc = MEM_callocN(sizeof(ReebArc), "reeb arc"); - edge = MEM_callocN(sizeof(ReebEdge), "reeb edge"); - - arc->flags = 0; // clear flags on init - - if (node1->weight <= node2->weight) - { - v1 = node1; - v2 = node2; - } - else - { - v1 = node2; - v2 = node1; - } - - arc->v1 = v1; - arc->v2 = v2; - - // increase node degree - v1->degree++; - v2->degree++; - - BLI_edgehash_insert(rg->emap, node1->index, node2->index, edge); - - edge->arc = arc; - edge->nextEdge = NULL; - edge->v1 = v1; - edge->v2 = v2; - - BLI_addtail(&rg->arcs, arc); - BLI_addtail(&arc->edges, edge); - - /* adding buckets for embedding */ - allocArcBuckets(arc); - - offset = arc->v1->weight; - len = arc->v2->weight - arc->v1->weight; - -#if 0 - /* This is the actual embedding filling described in the paper - * the problem is that it only works with really dense meshes - */ - if (arc->bcount > 0) - { - addVertToBucket(&(arc->buckets[0]), arc->v1->co); - addVertToBucket(&(arc->buckets[arc->bcount - 1]), arc->v2->co); - } -#else - for(i = 0; i < arc->bcount; i++) - { - float co[3]; - float f = (arc->buckets[i].val - offset) / len; - - VecLerpf(co, v1->p, v2->p, f); - addVertToBucket(&(arc->buckets[i]), co); - } -#endif - - } - - return edge; -} - -void addTriangleToGraph(ReebGraph *rg, ReebNode * n1, ReebNode * n2, ReebNode * n3) -{ - ReebEdge *re1, *re2, *re3; - ReebEdge *e1, *e2, *e3; - float len1, len2, len3; - - re1 = createArc(rg, n1, n2); - re2 = createArc(rg, n2, n3); - re3 = createArc(rg, n3, n1); - - len1 = (float)fabs(n1->weight - n2->weight); - len2 = (float)fabs(n2->weight - n3->weight); - len3 = (float)fabs(n3->weight - n1->weight); - - /* The rest of the algorithm assumes that e1 is the longest edge */ - - if (len1 >= len2 && len1 >= len3) - { - e1 = re1; - e2 = re2; - e3 = re3; - } - else if (len2 >= len1 && len2 >= len3) - { - e1 = re2; - e2 = re1; - e3 = re3; - } - else - { - e1 = re3; - e2 = re2; - e3 = re1; - } - - /* And e2 is the lowest edge - * If e3 is lower than e2, swap them - */ - if (e3->v1->weight < e2->v1->weight) - { - ReebEdge *etmp = e2; - e2 = e3; - e3 = etmp; - } - - - mergePaths(rg, e1, e2, e3); -} - -ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) -{ - ReebGraph *rg; - struct DynamicList * dlist; - EditVert *eve; - EditFace *efa; - int index; - int totvert; - int totfaces; - -#ifdef DEBUG_REEB - int countfaces = 0; -#endif - - rg = MEM_callocN(sizeof(ReebGraph), "reeb graph"); - - rg->totnodes = 0; - rg->emap = BLI_edgehash_new(); - - totvert = BLI_countlist(&em->verts); - totfaces = BLI_countlist(&em->faces); - - renormalizeWeight(em, 1.0f); - - /* Spread weight to minimize errors */ - spreadWeight(em); - - renormalizeWeight(em, (float)subdivisions); - - /* Adding vertice */ - for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next) - { - eve->hash = index; - eve->f2 = 0; - eve->tmp.p = addNode(rg, eve, eve->tmp.fp); - } - - /* Temporarely convert node list to dynamic list, for indexed access */ - dlist = BLI_dlist_from_listbase(&rg->nodes); - - /* Adding face, edge per edge */ - for(efa = em->faces.first; efa; efa = efa->next) - { - ReebNode *n1, *n2, *n3; - - n1 = (ReebNode*)BLI_dlist_find_link(dlist, efa->v1->hash); - n2 = (ReebNode*)BLI_dlist_find_link(dlist, efa->v2->hash); - n3 = (ReebNode*)BLI_dlist_find_link(dlist, efa->v3->hash); - - addTriangleToGraph(rg, n1, n2, n3); - - if (efa->v4) - { - ReebNode *n4 = (ReebNode*)efa->v4->tmp.p; - addTriangleToGraph(rg, n1, n3, n4); - } - -#ifdef DEBUG_REEB - countfaces++; - if (countfaces % 100 == 0) - { - printf("face %i of %i\n", countfaces, totfaces); - } -#endif - - - } - BLI_listbase_from_dlist(dlist, &rg->nodes); - - removeNormalNodes(rg); - - return rg; -} - -/***************************************** WEIGHT UTILS **********************************************/ - -void renormalizeWeight(EditMesh *em, float newmax) -{ - EditVert *eve; - float minimum, maximum, range; - - if (em == NULL || BLI_countlist(&em->verts) == 0) - return; - - /* First pass, determine maximum and minimum */ - eve = em->verts.first; - minimum = eve->tmp.fp; - maximum = eve->tmp.fp; - for(eve = em->verts.first; eve; eve = eve->next) - { - maximum = MAX2(maximum, eve->tmp.fp); - minimum = MIN2(minimum, eve->tmp.fp); - } - - range = maximum - minimum; - - /* Normalize weights */ - for(eve = em->verts.first; eve; eve = eve->next) - { - eve->tmp.fp = (eve->tmp.fp - minimum) / range * newmax; - } -} - - -int weightFromLoc(EditMesh *em, int axis) -{ - EditVert *eve; - - if (em == NULL || BLI_countlist(&em->verts) == 0 || axis < 0 || axis > 2) - return 0; - - /* Copy coordinate in weight */ - for(eve = em->verts.first; eve; eve = eve->next) - { - eve->tmp.fp = eve->co[axis]; - } - - return 1; -} - -static float cotan_weight(float *v1, float *v2, float *v3) -{ - float a[3], b[3], c[3], clen; - - VecSubf(a, v2, v1); - VecSubf(b, v3, v1); - Crossf(c, a, b); - - clen = VecLength(c); - - if (clen == 0.0f) - return 0.0f; - - return Inpf(a, b)/clen; -} - -int weightToHarmonic(EditMesh *em) -{ - NLboolean success; - EditVert *eve; - EditEdge *eed; - EditFace *efa; - int totvert = 0; - int index; - int rval; - - /* Find local extrema */ - for(eve = em->verts.first; eve; eve = eve->next) - { - totvert++; - } - - /* Solve with openNL */ - - nlNewContext(); - - nlSolverParameteri(NL_NB_VARIABLES, totvert); - - nlBegin(NL_SYSTEM); - - /* Find local extrema */ - for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next) - { - EditEdge *eed; - int maximum = 1; - int minimum = 1; - - eve->hash = index; /* Assign index to vertex */ - - NextEdgeForVert(NULL, NULL); /* Reset next edge */ - for(eed = NextEdgeForVert(em, eve); eed && (maximum || minimum); eed = NextEdgeForVert(em, eve)) - { - EditVert *eve2; - - if (eed->v1 == eve) - { - eve2 = eed->v2; - } - else - { - eve2 = eed->v1; - } - - /* Adjacent vertex is bigger, not a local maximum */ - if (eve2->tmp.fp > eve->tmp.fp) - { - maximum = 0; - } - /* Adjacent vertex is smaller, not a local minimum */ - else if (eve2->tmp.fp < eve->tmp.fp) - { - minimum = 0; - } - } - - if (maximum || minimum) - { - float w = eve->tmp.fp; - eve->f1 = 0; - nlSetVariable(0, index, w); - nlLockVariable(index); - } - else - { - eve->f1 = 1; - } - } - - nlBegin(NL_MATRIX); - - /* Zero edge weight */ - for(eed = em->edges.first; eed; eed = eed->next) - { - eed->tmp.l = 0; - } - - /* Add faces count to the edge weight */ - for(efa = em->faces.first; efa; efa = efa->next) - { - efa->e1->tmp.l++; - efa->e2->tmp.l++; - efa->e3->tmp.l++; - } - - /* Add faces angle to the edge weight */ - for(efa = em->faces.first; efa; efa = efa->next) - { - /* Angle opposite e1 */ - float t1= cotan_weight(efa->v1->co, efa->v2->co, efa->v3->co) / efa->e2->tmp.l; - - /* Angle opposite e2 */ - float t2 = cotan_weight(efa->v2->co, efa->v3->co, efa->v1->co) / efa->e3->tmp.l; - - /* Angle opposite e3 */ - float t3 = cotan_weight(efa->v3->co, efa->v1->co, efa->v2->co) / efa->e1->tmp.l; - - int i1 = efa->v1->hash; - int i2 = efa->v2->hash; - int i3 = efa->v3->hash; - - nlMatrixAdd(i1, i1, t2+t3); - nlMatrixAdd(i2, i2, t1+t3); - nlMatrixAdd(i3, i3, t1+t2); - - nlMatrixAdd(i1, i2, -t3); - nlMatrixAdd(i2, i1, -t3); - - nlMatrixAdd(i2, i3, -t1); - nlMatrixAdd(i3, i2, -t1); - - nlMatrixAdd(i3, i1, -t2); - nlMatrixAdd(i1, i3, -t2); - } - - nlEnd(NL_MATRIX); - - nlEnd(NL_SYSTEM); - - success = nlSolveAdvanced(NULL, NL_TRUE); - - if (success) - { - rval = 1; - for(index = 0, eve = em->verts.first; eve; index++, eve = eve->next) - { - eve->tmp.fp = nlGetVariable(0, index); - } - } - else - { - rval = 0; - } - - nlDeleteContext(nlGetCurrent()); - - return rval; -} - - -EditEdge * NextEdgeForVert(EditMesh *em, EditVert *v) -{ - static EditEdge *e = NULL; - - /* Reset method, call with NULL mesh pointer */ - if (em == NULL) - { - e = NULL; - return NULL; - } - - /* first pass, start at the head of the list */ - if (e == NULL) - { - e = em->edges.first; - } - /* subsequent passes, start on the next edge */ - else - { - e = e->next; - } - - for( ; e ; e = e->next) - { - if (e->v1 == v || e->v2 == v) - { - break; - } - } - - return e; -} - -int weightFromDistance(EditMesh *em) -{ - EditVert *eve; - int totedge = 0; - int vCount = 0; - - if (em == NULL || BLI_countlist(&em->verts) == 0) - { - return 0; - } - - totedge = BLI_countlist(&em->edges); - - if (totedge == 0) - { - return 0; - } - - /* Initialize vertice flags and find at least one selected vertex */ - for(eve = em->verts.first; eve && vCount == 0; eve = eve->next) - { - eve->f1 = 0; - if (eve->f & SELECT) - { - vCount = 1; - } - } - - if (vCount == 0) - { - return 0; /* no selected vert, failure */ - } - else - { - EditVert *eve, *current_eve = NULL; - /* Apply dijkstra spf for each selected vert */ - for(eve = em->verts.first; eve; eve = eve->next) - { - if (eve->f & SELECT) - { - current_eve = eve; - eve->f1 = 1; - - { - EditEdge *eed = NULL; - EditEdge *select_eed = NULL; - EditEdge **edges = NULL; - float currentWeight = 0; - int eIndex = 0; - - edges = MEM_callocN(totedge * sizeof(EditEdge*), "Edges"); - - /* Calculate edge weight and initialize edge flags */ - for(eed= em->edges.first; eed; eed= eed->next) - { - eed->tmp.fp = VecLenf(eed->v1->co, eed->v2->co); - eed->f1 = 0; - } - - do { - int i; - - current_eve->f1 = 1; /* mark vertex as selected */ - - /* Add all new edges connected to current_eve to the list */ - NextEdgeForVert(NULL, NULL); // Reset next edge - for(eed = NextEdgeForVert(em, current_eve); eed; eed = NextEdgeForVert(em, current_eve)) - { - if (eed->f1 == 0) - { - edges[eIndex] = eed; - eed->f1 = 1; - eIndex++; - } - } - - /* Find next shortest edge */ - select_eed = NULL; - for(i = 0; i < eIndex; i++) - { - eed = edges[i]; - - if (eed->f1 != 2 && (eed->v1->f1 == 0 || eed->v2->f1 == 0)) /* eed is not selected yet and leads to a new node */ - { - float newWeight = 0; - if (eed->v1->f1 == 1) - { - newWeight = eed->v1->tmp.fp + eed->tmp.fp; - } - else - { - newWeight = eed->v2->tmp.fp + eed->tmp.fp; - } - - if (select_eed == NULL || newWeight < currentWeight) /* no selected edge or current smaller than selected */ - { - currentWeight = newWeight; - select_eed = eed; - } - } - } - - if (select_eed != NULL) - { - select_eed->f1 = 2; - - if (select_eed->v1->f1 == 0) /* v1 is the new vertex */ - { - current_eve = select_eed->v1; - } - else /* otherwise, it's v2 */ - { - current_eve = select_eed->v2; - } - current_eve->tmp.fp = currentWeight; - } - } while (select_eed != NULL); - - MEM_freeN(edges); - } - } - } - } - - return 1; -} - -MCol MColFromWeight(EditVert *eve) -{ - MCol col; - col.a = 255; - col.b = (char)(eve->tmp.fp * 255); - col.g = 0; - col.r = (char)((1.0f - eve->tmp.fp) * 255); - return col; -} - -void weightToVCol(EditMesh *em) -{ - EditFace *efa; - MCol *mcol; - if (!EM_vertColorCheck()) { - return; - } - - for(efa=em->faces.first; efa; efa=efa->next) { - mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL); - - mcol[0] = MColFromWeight(efa->v1); - mcol[1] = MColFromWeight(efa->v2); - mcol[2] = MColFromWeight(efa->v3); - - if(efa->v4) { - mcol[3] = MColFromWeight(efa->v4); - } - } -} - -/****************************************** BUCKET ITERATOR **************************************************/ - -void initArcIterator(ReebArcIterator *iter, ReebArc *arc, ReebNode *head) -{ - iter->arc = arc; - - if (head == arc->v1) - { - iter->start = 0; - iter->end = arc->bcount - 1; - iter->stride = 1; - } - else - { - iter->start = arc->bcount - 1; - iter->end = 0; - iter->stride = -1; - } - - iter->index = iter->start - iter->stride; -} - -void initArcIterator2(ReebArcIterator *iter, ReebArc *arc, int start, int end) -{ - iter->arc = arc; - - iter->start = start; - iter->end = end; - - if (end > start) - { - iter->stride = 1; - } - else - { - iter->stride = -1; - } - - iter->index = iter->start - iter->stride; -} - -EmbedBucket * nextBucket(ReebArcIterator *iter) -{ - EmbedBucket *result = NULL; - - if (iter->index != iter->end) - { - iter->index += iter->stride; - result = &(iter->arc->buckets[iter->index]); - } - - return result; -} diff --git a/source/blender/src/renderwin.c b/source/blender/src/renderwin.c deleted file mode 100644 index 8250ba4902d..00000000000 --- a/source/blender/src/renderwin.c +++ /dev/null @@ -1,1449 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef WIN32 -/* for the multimedia timer */ -#include -#include -#endif - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include "BLI_winstuff.h" -#else - /* for signal callback, not (fully) supported at windows */ -#include -#include - -#endif - -#include - -#include "BLI_blenlib.h" -#include "BLI_threads.h" - -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" - -#include "DNA_image_types.h" -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_vec_types.h" - -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" -#include "BKE_writeavi.h" /* movie handle */ - -#include "BIF_drawimage.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_graphics.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_mywindow.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_writeimage.h" - -#include "BDR_sculptmode.h" -#include "BDR_editobject.h" -#include "BPY_extern.h" /* for BPY_do_all_scripts */ - -#include "BSE_view.h" -#include "BSE_drawview.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" - -#include "RE_pipeline.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "mydevice.h" -#include "winlay.h" - -/* ------------ renderwin struct, to prevent too much global vars --------- */ -/* ------------ only used for display in a 2nd window --------- */ - - -/* flags escape presses during event handling -* so we can test for user break later. -*/ -#define RW_FLAGS_ESCAPE (1<<0) -/* old zoom style (2x, locked to mouse, exits -* when mouse leaves window), to be removed -* at some point. -*/ -#define RW_FLAGS_OLDZOOM (1<<1) -/* on when image is being panned with middlemouse -*/ -#define RW_FLAGS_PANNING (1<<2) -/* on when the mouse is dragging over the image -* to examine pixel values. -*/ -#define RW_FLAGS_PIXEL_EXAMINING (1<<3) - -/* forces draw of alpha */ -#define RW_FLAGS_ALPHA (1<<4) - - -typedef struct { - Window *win; - - int rectx, recty; /* size of image */ - - int sparex, sparey; /* spare rect size */ - unsigned int *rectspare; - float *rectsparef; - - float zoom, zoomofs[2]; - int active; - short storespare, showspare; - - int mbut[5]; - int lmouse[2]; - - unsigned int flags; - - float pan_mouse_start[2], pan_ofs_start[2]; - - char *info_text; - char *render_text, *render_text_spare; - -} RenderWin; - -static RenderWin *render_win= NULL; - -/* --------------- help functions for RenderWin struct ---------------------------- */ - - -/* only called in function open_renderwin */ -static RenderWin *renderwin_alloc(Window *win) -{ - RenderWin *rw= MEM_callocN(sizeof(*rw), "RenderWin"); - rw->win= win; - rw->zoom= 1.0; - rw->active= 0; - rw->flags= 0; - rw->zoomofs[0]= rw->zoomofs[1]= 0; - rw->info_text= NULL; - rw->render_text= MEM_callocN(RW_MAXTEXT, "rendertext"); - rw->render_text_spare= MEM_callocN(RW_MAXTEXT, "rendertext spare"); - - rw->lmouse[0]= rw->lmouse[1]= 0; - rw->mbut[0]= rw->mbut[1]= rw->mbut[2]= rw->mbut[3] = rw->mbut[4] = 0; - - return rw; -} - - -static void renderwin_queue_redraw(RenderWin *rw) -{ - window_queue_redraw(rw->win); // to ghost -} - -static void renderwin_reshape(RenderWin *rw) -{ - ; -} - -static void renderwin_get_fullrect(RenderWin *rw, float fullrect_r[2][2]) -{ - float display_w, display_h; - float cent_x, cent_y; - int w, h; - - window_get_size(rw->win, &w, &h); - h-= RW_HEADERY; - - display_w= rw->rectx*rw->zoom; - display_h= rw->recty*rw->zoom; - cent_x= (rw->zoomofs[0] + rw->rectx/2)*rw->zoom; - cent_y= (rw->zoomofs[1] + rw->recty/2)*rw->zoom; - - fullrect_r[0][0]= w/2 - cent_x; - fullrect_r[0][1]= h/2 - cent_y; - fullrect_r[1][0]= fullrect_r[0][0] + display_w; - fullrect_r[1][1]= fullrect_r[0][1] + display_h; -} - - /** - * Project window coordinate to image pixel coordinate. - * Returns true if resulting coordinate is within image. - */ -static int renderwin_win_to_image_co(RenderWin *rw, int winco[2], int imgco_r[2]) -{ - float fullrect[2][2]; - - renderwin_get_fullrect(rw, fullrect); - - imgco_r[0]= (int) ((winco[0]-fullrect[0][0])/rw->zoom); - imgco_r[1]= (int) ((winco[1]-fullrect[0][1])/rw->zoom); - - return (imgco_r[0]>=0 && imgco_r[1]>=0 && imgco_r[0]rectx && imgco_r[1]recty); -} - - /** - * Project window coordinates to normalized device coordinates - * Returns true if resulting coordinate is within window. - */ -static int renderwin_win_to_ndc(RenderWin *rw, int win_co[2], float ndc_r[2]) -{ - int w, h; - - window_get_size(rw->win, &w, &h); - h-= RW_HEADERY; - - ndc_r[0]= ((float)(win_co[0]*2)/(w-1) - 1.0f); - ndc_r[1]= ((float)(win_co[1]*2)/(h-1) - 1.0f); - - return (fabs(ndc_r[0])<=1.0 && fabs(ndc_r[1])<=1.0); -} - -static void renderwin_set_infotext(RenderWin *rw, char *info_text) -{ - if (rw->info_text) MEM_freeN(rw->info_text); - rw->info_text= info_text?BLI_strdup(info_text):NULL; -} - -static void renderwin_reset_view(RenderWin *rw) -{ - int w, h; - - if (rw->info_text) renderwin_set_infotext(rw, NULL); - - /* now calculate a zoom for when image is larger than window */ - window_get_size(rw->win, &w, &h); - h-= RW_HEADERY; - - if(rw->rectx>w || rw->recty>h) { - if(rw->rectx-w > rw->recty-h) rw->zoom= ((float)w)/((float)rw->rectx); - else rw->zoom= ((float)h)/((float)rw->recty); - } - else rw->zoom= 1.0; - - rw->zoomofs[0]= rw->zoomofs[1]= 0; - renderwin_queue_redraw(rw); -} - -static void renderwin_draw_render_info(RenderWin *rw) -{ - /* render text is added to top */ - if(RW_HEADERY) { - float colf[3]; - rcti rect; - char *str; - - window_get_size(rw->win, &rect.xmax, &rect.ymax); - rect.xmin= 0; - rect.ymin= rect.ymax-RW_HEADERY; - glEnable(GL_SCISSOR_TEST); - glaDefine2DArea(&rect); - - /* clear header rect */ - BIF_SetTheme(NULL); // sets view3d theme by default - BIF_GetThemeColor3fv(TH_HEADER, colf); - glClearColor(colf[0], colf[1], colf[2], 1.0); - glClear(GL_COLOR_BUFFER_BIT); - - if(rw->showspare) - str= rw->render_text_spare; - else - str= rw->render_text; - - if(str) { - BIF_ThemeColor(TH_TEXT); - glRasterPos2i(12, 5); - BMF_DrawString(G.fonts, str); - } - - BIF_SetTheme(curarea); // restore theme - } - -} - -static void renderwin_draw(RenderWin *rw, int just_clear) -{ - float fullrect[2][2]; - int set_back_mainwindow; - rcti rect; - - /* since renderwin uses callbacks (controlled by ghost) it can - mess up active window output with redraw events after a render. - this is patchy, still WIP */ - set_back_mainwindow = (winlay_get_active_window() != rw->win); - window_make_active(rw->win); - - rect.xmin= rect.ymin= 0; - window_get_size(rw->win, &rect.xmax, &rect.ymax); - rect.ymax-= RW_HEADERY; - - renderwin_get_fullrect(rw, fullrect); - - /* do this first, so window ends with correct scissor */ - renderwin_draw_render_info(rw); - - glEnable(GL_SCISSOR_TEST); - glaDefine2DArea(&rect); - - glClearColor(.1875, .1875, .1875, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - - if (just_clear) { - glColor3ub(0, 0, 0); - glRectfv(fullrect[0], fullrect[1]); - } else { - RenderResult rres; - - if(rw->showspare) { - rres.rectx= rw->sparex; - rres.recty= rw->sparey; - rres.rect32= (int *)rw->rectspare; - rres.rectf= rw->rectsparef; - } - else - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - if(rres.rectf || rres.rect32) { - - glPixelZoom(rw->zoom, rw->zoom); - if(rw->flags & RW_FLAGS_ALPHA) { - if(rres.rect32) { - /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ - if(G.order==B_ENDIAN) - glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rres.rectx, rres.recty, rres.rectx, GL_LUMINANCE, GL_UNSIGNED_INT, rres.rect32); - glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); - } - else { - float *trectf= MEM_mallocN(rres.rectx*rres.recty*4, "temp"); - int a, b; - - for(a= rres.rectx*rres.recty -1, b= 4*a+3; a>=0; a--, b-=4) - trectf[a]= rres.rectf[b]; - - glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rres.rectx, rres.recty, rres.rectx, GL_LUMINANCE, GL_FLOAT, trectf); - MEM_freeN(trectf); - } - } - else { - if(rres.rect32) - glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], rres.rectx, rres.recty, rres.rectx, GL_RGBA, GL_UNSIGNED_BYTE, rres.rect32); - else if(rres.rectf) - glaDrawPixelsSafe_to32(fullrect[0][0], fullrect[0][1], rres.rectx, rres.recty, rres.rectx, rres.rectf); - } - glPixelZoom(1.0, 1.0); - } - } - - /* info text is overlayed on bottom */ - if (rw->info_text) { - float w; - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - w=186.0*strlen(rw->info_text)/30; - glColor4f(.5,.5,.5,.25); - glRectf(0.0,0.0,w,30.0); - glDisable(GL_BLEND); - glColor3ub(255, 255, 255); - glRasterPos2i(10, 10); - BMF_DrawString(G.font, rw->info_text); - } - - window_swap_buffers(rw->win); - - if (set_back_mainwindow) mainwindow_make_active(); -} - - -/* ------ interactivity calls for RenderWin ------------- */ -static void renderwin_zoom(RenderWin *rw, int ZoomIn) { - if (ZoomIn) { - if (rw->zoom>0.26) { - if(rw->zoom>1.0 && rw->zoom<2.0) rw->zoom= 1.0; - else rw->zoom*= 0.5; - } - } else { - if (rw->zoom<15.9) { - if(rw->zoom>0.5 && rw->zoom<1.0) rw->zoom= 1.0; - else rw->zoom*= 2.0; - } - } - if (rw->zoom>1.0) rw->flags |= RW_FLAGS_OLDZOOM; - if (rw->zoom==1.0) rw->flags &= ~RW_FLAGS_OLDZOOM; - renderwin_queue_redraw(rw); -} - -static void renderwin_mouse_moved(RenderWin *rw) -{ - RenderResult rres; - - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) { - int imgco[2], ofs=0; - char buf[128]; - char *pxl; - - if (renderwin_win_to_image_co(rw, rw->lmouse, imgco)) { - if (rres.rect32) { - pxl= (char*) &rres.rect32[rres.rectx*imgco[1] + imgco[0]]; - ofs= sprintf(buf, "R: %d G: %d B: %d A: %d", pxl[0], pxl[1], pxl[2], pxl[3]); - } - if (rres.rectf) { - float *pxlf= rres.rectf + 4*(rres.rectx*imgco[1] + imgco[0]); - ofs+= sprintf(buf+ofs, " | R: %.3f G: %.3f B: %.3f A: %.3f ", pxlf[0], pxlf[1], pxlf[2], pxlf[3]); - } - if (rres.rectz) { - float *pxlz= &rres.rectz[rres.rectx*imgco[1] + imgco[0]]; - sprintf(buf+ofs, "| Z: %.3f", *pxlz ); - } - - renderwin_set_infotext(rw, buf); - renderwin_queue_redraw(rw); - } else { - renderwin_set_infotext(rw, NULL); - renderwin_queue_redraw(rw); - } - } - else if (rw->flags & RW_FLAGS_PANNING) { - int delta_x= rw->lmouse[0] - rw->pan_mouse_start[0]; - int delta_y= rw->lmouse[1] - rw->pan_mouse_start[1]; - - rw->zoomofs[0]= rw->pan_ofs_start[0] - delta_x/rw->zoom; - rw->zoomofs[1]= rw->pan_ofs_start[1] - delta_y/rw->zoom; - rw->zoomofs[0]= CLAMPIS(rw->zoomofs[0], -rres.rectx/2, rres.rectx/2); - rw->zoomofs[1]= CLAMPIS(rw->zoomofs[1], -rres.recty/2, rres.recty/2); - - renderwin_queue_redraw(rw); - } - else if (rw->flags & RW_FLAGS_OLDZOOM) { - float ndc[2]; - int w, h; - - window_get_size(rw->win, &w, &h); - h-= RW_HEADERY; - renderwin_win_to_ndc(rw, rw->lmouse, ndc); - - rw->zoomofs[0]= -0.5*ndc[0]*(w-rres.rectx*rw->zoom)/rw->zoom; - rw->zoomofs[1]= -0.5*ndc[1]*(h-rres.recty*rw->zoom)/rw->zoom; - - renderwin_queue_redraw(rw); - } -} - -static void renderwin_mousebut_changed(RenderWin *rw) -{ - if (rw->mbut[0]) { - rw->flags|= RW_FLAGS_PIXEL_EXAMINING; - } - else if (rw->mbut[1]) { - rw->flags|= RW_FLAGS_PANNING; - rw->pan_mouse_start[0]= rw->lmouse[0]; - rw->pan_mouse_start[1]= rw->lmouse[1]; - rw->pan_ofs_start[0]= rw->zoomofs[0]; - rw->pan_ofs_start[1]= rw->zoomofs[1]; - } else if (rw->mbut[3]) { - renderwin_zoom(rw, 0); - rw->mbut[3]=0; - } else if (rw->mbut[4]) { - renderwin_zoom(rw, 1); - rw->mbut[4]=0; - } else { - if (rw->flags & RW_FLAGS_PANNING) { - rw->flags &= ~RW_FLAGS_PANNING; - renderwin_queue_redraw(rw); - } - if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) { - rw->flags&= ~RW_FLAGS_PIXEL_EXAMINING; - renderwin_set_infotext(rw, NULL); - renderwin_queue_redraw(rw); - } - } -} - - -/* handler for renderwin, passed on to Ghost */ -static void renderwin_handler(Window *win, void *user_data, short evt, short val, char ascii) -{ - RenderWin *rw= user_data; - - // added this for safety, while render it's just creating bezerk results - if(G.rendering) { - if(evt==ESCKEY && val) - rw->flags|= RW_FLAGS_ESCAPE; - return; - } - - if (evt==RESHAPE) { - renderwin_reshape(rw); - } - else if (evt==REDRAW) { - renderwin_draw(rw, 0); - } - else if (evt==WINCLOSE) { - BIF_close_render_display(); - } - else if (evt==INPUTCHANGE) { - rw->active= val; - - if (!val && (rw->flags&RW_FLAGS_OLDZOOM)) { - rw->flags&= ~RW_FLAGS_OLDZOOM; - renderwin_reset_view(rw); - } - } - else if (ELEM(evt, MOUSEX, MOUSEY)) { - rw->lmouse[evt==MOUSEY]= val; - renderwin_mouse_moved(rw); - } - else if (ELEM(evt, WHEELUPMOUSE, WHEELDOWNMOUSE)) { - int which=(evt==WHEELUPMOUSE?3:4); - rw->mbut[which]=val; - renderwin_mousebut_changed(rw); - } - else if (ELEM3(evt, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) { - int which= (evt==LEFTMOUSE)?0:(evt==MIDDLEMOUSE)?1:2; - rw->mbut[which]= val; - renderwin_mousebut_changed(rw); - } - else if (val) { - if (evt==ESCKEY) { - if (rw->flags&RW_FLAGS_OLDZOOM) { - rw->flags&= ~RW_FLAGS_OLDZOOM; - renderwin_reset_view(rw); - } - else { - rw->flags|= RW_FLAGS_ESCAPE; - mainwindow_raise(); - mainwindow_make_active(); - rw->active= 0; - } - } - else if( evt==AKEY) { - rw->flags ^= RW_FLAGS_ALPHA; - renderwin_queue_redraw(render_win); - } - else if (evt==JKEY) { - if(G.rendering==0) BIF_swap_render_rects(); - } - else if (evt==ZKEY) { - if (rw->flags&RW_FLAGS_OLDZOOM) { - rw->flags&= ~RW_FLAGS_OLDZOOM; - renderwin_reset_view(rw); - } else { - rw->zoom= 2.0; - rw->flags|= RW_FLAGS_OLDZOOM; - renderwin_mouse_moved(rw); - } - } - else if (ELEM(evt,PADPLUSKEY,PAGEUPKEY)) { - renderwin_zoom(rw, 0); - } - else if (ELEM(evt,PADMINUS,PAGEDOWNKEY)) { - renderwin_zoom(rw, 1); - } - else if (evt==PADENTER || evt==HOMEKEY) { - if (rw->flags&RW_FLAGS_OLDZOOM) { - rw->flags&= ~RW_FLAGS_OLDZOOM; - } - renderwin_reset_view(rw); - } - else if (evt==F3KEY) { - if(G.rendering==0) { - mainwindow_raise(); - mainwindow_make_active(); - rw->active= 0; - areawinset(find_biggest_area()->win); - BIF_save_rendered_image_fs(); - } - } - else if (evt==F11KEY) { - BIF_toggle_render_display(); - } - else if (evt==F12KEY) { - if(G.rendering==0) - BIF_do_render(0); - } - } -} - -static char *renderwin_get_title(int doswap) -{ - static int swap= 0; - char *title=""; - - swap+= doswap; - - if(swap & 1) { - if (G.scene->r.renderer==R_YAFRAY) title = "YafRay:Render (previous)"; - else title = "Blender:Render (previous)"; - } - else { - if (G.scene->r.renderer==R_YAFRAY) title = "YafRay:Render"; - else title = "Blender:Render"; - } - - return title; -} - -/* opens window and allocs struct */ -static void open_renderwin(int winpos[2], int winsize[2], int imagesize[2]) -{ - extern void mywindow_build_and_set_renderwin( int orx, int ory, int sizex, int sizey); // mywindow.c - Window *win; - char *title; - - title= renderwin_get_title(0); /* 0 = no swap */ - win= window_open(title, winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY, 0); - - render_win= renderwin_alloc(win); - render_win->rectx= imagesize[0]; - render_win->recty= imagesize[1]; - - /* Ghost calls handler */ - window_set_handler(win, renderwin_handler, render_win); - - winlay_process_events(0); - window_make_active(render_win->win); - winlay_process_events(0); - - /* mywindow has to know about it too */ - mywindow_build_and_set_renderwin(winpos[0], winpos[1], winsize[0], winsize[1]+RW_HEADERY); - /* and we should be able to draw 3d in it */ - init_gl_stuff(); - - renderwin_draw(render_win, 1); - renderwin_draw(render_win, 1); -} - -/* -------------- callbacks for render loop: Window (RenderWin) ----------------------- */ - -/* calculations for window size and position */ -void calc_renderwin_rectangle(int rectx, int recty, int posmask, int renderpos_r[2], int rendersize_r[2]) -{ - int scr_w, scr_h, x, y, div= 0; - float ndc_x= 0.0, ndc_y= 0.0; - - winlay_get_screensize(&scr_w, &scr_h); - - rendersize_r[0]= rectx; - rendersize_r[1]= recty; - - rendersize_r[0]= CLAMPIS(rendersize_r[0], 0, scr_w); - rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-RW_HEADERY); - - for (y=-1; y<=1; y++) { - for (x=-1; x<=1; x++) { - if (posmask & (1<<((y+1)*3 + (x+1)))) { - ndc_x+= x; - ndc_y+= y; - div++; - } - } - } - - if (div) { - ndc_x/= div; - ndc_y/= div; - } - - renderpos_r[0]= (scr_w-rendersize_r[0])*(ndc_x*0.5 + 0.5); -#ifdef __APPLE__ - /* 44 pixels is topbar and window header... awaiting better fixes in ghost :) */ - rendersize_r[1]= CLAMPIS(rendersize_r[1], 0, scr_h-44-RW_HEADERY); - renderpos_r[1]= -44-RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5); -#else - renderpos_r[1]= -RW_HEADERY+(scr_h-rendersize_r[1])*(ndc_y*0.5 + 0.5); -#endif -} - -/* init renderwin, alloc/open/resize */ -static void renderwin_init_display_cb(RenderResult *rr) -{ - if (G.afbreek != 1) { - int rendersize[2], renderpos[2], imagesize[2]; - - calc_renderwin_rectangle(rr->rectx, rr->recty, G.winpos, renderpos, rendersize); - - imagesize[0]= rr->rectx; - imagesize[1]= rr->recty; - - if (!render_win) { - open_renderwin(renderpos, rendersize, imagesize); - renderwin_reset_view(render_win); // incl. autozoom for large images - } else { - int win_x, win_y; - int win_w, win_h; - - window_get_position(render_win->win, &win_x, &win_y); - window_get_size(render_win->win, &win_w, &win_h); - win_h-= RW_HEADERY; - - /* XXX, this is nasty and I guess bound to cause problems, - * but to ensure the window is at the user specified position - * and size we reopen the window all the time... we need - * a ghost _set_position to fix this -zr - */ - - /* XXX, well... it is nasty yes, and reopens windows each time on - subsequent renders. Better rule is to make it reopen only only - size change, and use the preferred position only on open_renderwin - cases (ton) - */ - if(rendersize[0]!= win_w || rendersize[1]!= win_h) { - BIF_close_render_display(); - open_renderwin(renderpos, rendersize, imagesize); - } - else { - window_raise(render_win->win); - window_make_active(render_win->win); - - mywinset(2); // to assign scissor/viewport again in mywindow.c. is hackish yes, but otherwise it draws in header of button for ogl header - { - rcti win_rct; - win_rct.xmin= win_rct.ymin= 0; - window_get_size(render_win->win, &win_rct.xmax, &win_rct.ymax); - win_rct.ymax-= RW_HEADERY; - glaDefine2DArea(&win_rct); - } - } - - renderwin_reset_view(render_win); - render_win->active= 1; - } - /* make sure we are in normal draw again */ - render_win->flags &= ~RW_FLAGS_ALPHA; - - glFinish(); - } -} - -/* callback for redraw render win */ -static void renderwin_clear_display_cb(RenderResult *rr) -{ - if (render_win) { - window_make_active(render_win->win); - renderwin_draw(render_win, 1); - } -} - -/* XXX, this is not good, we do this without any regard to state -* ... better is to make this an optimization of a more clear -* implementation. the bug shows up when you do something like -* open the window, then draw part of the progress, then get -* a redraw event. whatever can go wrong will. -zr -* -* Note: blocked queue handling while rendering to prevent that (ton) -*/ - -/* can get as well the full picture, as the parts while rendering */ -static void renderwin_progress(RenderWin *rw, RenderResult *rr, volatile rcti *renrect) -{ - rcti win_rct; - float *rectf= NULL, fullrect[2][2]; - unsigned int *rect32= NULL; - int ymin, ymax, xmin, xmax; - - /* if renrect argument, we only display scanlines */ - if(renrect) { - /* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */ - if(rr->renlay==NULL || renrect->ymax>=rr->recty) - return; - - /* xmin here is first subrect x coord, xmax defines subrect width */ - xmin = renrect->xmin; - xmax = renrect->xmax - xmin; - if (xmax<2) return; - - ymin= renrect->ymin; - ymax= renrect->ymax - ymin; - if(ymax<2) - return; - renrect->ymin= renrect->ymax; - } - else { - xmin = ymin = 0; - xmax = rr->rectx - 2*rr->crop; - ymax = rr->recty - 2*rr->crop; - } - - /* renderwindow cruft */ - win_rct.xmin= win_rct.ymin= 0; - window_get_size(rw->win, &win_rct.xmax, &win_rct.ymax); - win_rct.ymax-= RW_HEADERY; - renderwin_get_fullrect(rw, fullrect); - - /* find current float rect for display, first case is after composit... still weak */ - if(rr->rectf) - rectf= rr->rectf; - else { - if(rr->rect32) - rect32= (unsigned int *)rr->rect32; - else { - if(rr->renlay==NULL || rr->renlay->rectf==NULL) return; - rectf= rr->renlay->rectf; - } - } - if(rectf) { - /* if scanline updates... */ - rectf+= 4*(rr->rectx*ymin + xmin); - - /* when rendering more pixels than needed, we crop away cruft */ - if(rr->crop) - rectf+= 4*(rr->crop*rr->rectx + rr->crop); - } - - /* tilerect defines drawing offset from (0,0) */ - /* however, tilerect (xmin, ymin) is first pixel */ - fullrect[0][0] += (rr->tilerect.xmin + rr->crop + xmin)*rw->zoom; - fullrect[0][1] += (rr->tilerect.ymin + rr->crop + ymin)*rw->zoom; - - glEnable(GL_SCISSOR_TEST); - glaDefine2DArea(&win_rct); - -#ifdef __APPLE__ -#else - glDrawBuffer(GL_FRONT); -#endif - glPixelZoom(rw->zoom, rw->zoom); - - if(rect32) - glaDrawPixelsSafe(fullrect[0][0], fullrect[0][1], xmax, ymax, rr->rectx, GL_RGBA, GL_UNSIGNED_BYTE, rect32); - else - glaDrawPixelsSafe_to32(fullrect[0][0], fullrect[0][1], xmax, ymax, rr->rectx, rectf); - - glPixelZoom(1.0, 1.0); - -#ifdef __APPLE__ - window_swap_buffers(render_win->win); -#else - glFlush(); - glDrawBuffer(GL_BACK); -#endif -} - - -/* in render window; display a couple of scanlines of rendered image */ -static void renderwin_progress_display_cb(RenderResult *rr, volatile rcti *rect) -{ - if (render_win) { - renderwin_progress(render_win, rr, rect); - } -} - -/* -------------- callbacks for render loop: interactivity ----------------------- */ - -/* string is RW_MAXTEXT chars min */ -void make_renderinfo_string(RenderStats *rs, char *str) -{ - extern char info_time_str[32]; // header_info.c - extern unsigned long mem_in_use, mmap_in_use; - float megs_used_memory, mmap_used_memory; - char *spos= str; - - megs_used_memory= (mem_in_use-mmap_in_use)/(1024.0*1024.0); - mmap_used_memory= (mmap_in_use)/(1024.0*1024.0); - - if(G.scene->lay & 0xFF000000) - spos+= sprintf(spos, "Localview | "); - else if(G.scene->r.scemode & R_SINGLE_LAYER) - spos+= sprintf(spos, "Single Layer | "); - - spos+= sprintf(spos, "Fra:%d Ve:%d Fa:%d ", (G.scene->r.cfra), rs->totvert, rs->totface); - if(rs->tothalo) spos+= sprintf(spos, "Ha:%d ", rs->tothalo); - if(rs->totstrand) spos+= sprintf(spos, "St:%d ", rs->totstrand); - spos+= sprintf(spos, "La:%d Mem:%.2fM (%.2fM) ", rs->totlamp, megs_used_memory, mmap_used_memory); - - if(rs->curfield) - spos+= sprintf(spos, "Field %d ", rs->curfield); - if(rs->curblur) - spos+= sprintf(spos, "Blur %d ", rs->curblur); - - BLI_timestr(rs->lastframetime, info_time_str); - spos+= sprintf(spos, "Time:%s ", info_time_str); - - if(rs->infostr) - spos+= sprintf(spos, "| %s ", rs->infostr); - - /* very weak... but 512 characters is quite safe... we cannot malloc during thread render */ - if(spos >= str+RW_MAXTEXT) - printf("WARNING! renderwin text beyond limit \n"); - -} - -/* callback for print info in top header of renderwin */ -static void renderwin_renderinfo_cb(RenderStats *rs) -{ - - if(render_win) { - - make_renderinfo_string(rs, render_win->render_text); - -#ifdef __APPLE__ -#else - glDrawBuffer(GL_FRONT); -#endif - renderwin_draw_render_info(render_win); - -#ifdef __APPLE__ - window_swap_buffers(render_win->win); -#else - glFlush(); - glDrawBuffer(GL_BACK); -#endif - } - -} - -/* -------------- callback system to allow ESC from rendering ----------------------- */ - -/* POSIX & WIN32: this function is called all the time, and should not use cpu or resources */ -static int test_break(void) -{ - - if(G.afbreek==2) { /* code for testing queue */ - - G.afbreek= 0; - - blender_test_break(); /* tests blender interface */ - - if (G.afbreek==0 && render_win) { /* tests window */ - winlay_process_events(0); - // render_win can be closed in winlay_process_events() - if (render_win == 0 || (render_win->flags & RW_FLAGS_ESCAPE)) { - G.afbreek= 1; - } - } - } - - if(G.afbreek==1) return 1; - else return 0; -} - - - -#ifdef _WIN32 -/* we use the multimedia time here */ -static UINT uRenderTimerId; - -void CALLBACK interruptESC(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) -{ - if(G.afbreek==0) G.afbreek= 2; /* code for read queue */ -} - -/* WIN32: init SetTimer callback */ -static void init_test_break_callback() -{ - timeBeginPeriod(50); - uRenderTimerId = timeSetEvent(250, 1, interruptESC, 0, TIME_PERIODIC); -} - -/* WIN32: stop SetTimer callback */ -static void end_test_break_callback() -{ - timeEndPeriod(50); - timeKillEvent(uRenderTimerId); -} - -#else -/* all other OS's support signal(SIGVTALRM) */ - -/* XXX The ESC problem: some unix users reported that ESC doesn't cancel - * renders anymore. Most complaints came from linux, but it's not - * general, not all linux users have the problem. - * - * From tests, the systems that do have it are not signalling SIGVTALRM - * interrupts (an issue with signals and threads). Using SIGALRM instead - * fixes the problem, at least while we investigate better. - * - * ITIMER_REAL (SIGALRM): timer that counts real system time - * ITIMER_VIRTUAL (SIGVTALRM): only counts time spent in its owner process */ - -/* POSIX: this function goes in the signal() callback */ -static void interruptESC(int sig) -{ - - if(G.afbreek==0) G.afbreek= 2; /* code for read queue */ - - /* call again, timer was reset */ - signal(SIGALRM, interruptESC); -} - -/* POSIX: initialize timer and signal */ -static void init_test_break_callback() -{ - - struct itimerval tmevalue; - - tmevalue.it_interval.tv_sec = 0; - tmevalue.it_interval.tv_usec = 250000; - /* when the first ? */ - tmevalue.it_value.tv_sec = 0; - tmevalue.it_value.tv_usec = 10000; - - signal(SIGALRM, interruptESC); - setitimer(ITIMER_REAL, &tmevalue, 0); -} - -/* POSIX: stop timer and callback */ -static void end_test_break_callback() -{ - struct itimerval tmevalue; - - memset(&tmevalue, 0, sizeof(struct itimerval)); - - setitimer(ITIMER_REAL, &tmevalue, 0); - signal(SIGALRM, SIG_IGN); - -} - - -#endif - - - -/* -------------- callbacks for render loop: init & run! ----------------------- */ - - -/* - initialize displays - - set callbacks - - cleanup -*/ - -static void do_render(int anim) -{ - Image *ima; - Render *re= RE_NewRender(G.scene->id.name); - unsigned int lay= G.scene->lay; - int scemode= G.scene->r.scemode; - int sculptmode= G.f & G_SCULPTMODE; - - /* UGLY! we set this flag to prevent renderwindow queue to execute another render */ - /* is reset in RE_BlenderFrame */ - G.rendering= 1; - - /* set render callbacks, also starts ESC timer */ - BIF_init_render_callbacks(re, 1); - - waitcursor(1); - if(render_win) - window_set_cursor(render_win->win, CURSOR_WAIT); - - if(G.obedit) - exit_editmode(0); /* 0 = no free data */ - - if(sculptmode) set_sculptmode(); - - /* allow localview render for objects with lights in normal layers */ - if(curarea->spacetype==SPACE_VIEW3D) { - /* if view is defined (might not be if called from script), check and set layers. */ - if(G.vd) { - if(G.vd->lay & 0xFF000000) { - G.scene->lay |= G.vd->lay; - G.scene->r.scemode |= R_SINGLE_LAYER; - } - else G.scene->lay= G.vd->lay; - } - } - - if(anim) - RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra); - else - RE_BlenderFrame(re, G.scene, G.scene->r.cfra); - - /* restore local view exception */ - G.scene->lay= lay; - G.scene->r.scemode= scemode; - - if(render_win) window_set_cursor(render_win->win, CURSOR_STD); - - free_filesel_spec(G.scene->r.pic); - - G.afbreek= 0; - BIF_end_render_callbacks(); - - /* after an envmap creation... */ -// if(R.flag & R_REDRAW_PRV) { -// BIF_preview_changed(ID_TE); -// } - - scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it - - /* get a render result image, and make sure it is clean */ - ima= BKE_image_verify_viewer(IMA_TYPE_R_RESULT, "Render Result"); - BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); - - if(sculptmode) set_sculptmode(); - - waitcursor(0); -} - -/* called before render, store old render in spare buffer */ -static void renderwin_store_spare(void) -{ - RenderResult rres; - - if(render_win==0 || render_win->storespare==0) - return; - - /* only store when it does not show spare */ - if(render_win->showspare==0) - return; - - render_win->showspare= 0; - window_set_title(render_win->win, renderwin_get_title(1)); - - BLI_strncpy(render_win->render_text_spare, render_win->render_text, RW_MAXTEXT); - - if(render_win->rectspare) MEM_freeN(render_win->rectspare); - render_win->rectspare= NULL; - if(render_win->rectsparef) MEM_freeN(render_win->rectsparef); - render_win->rectsparef= NULL; - - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - if(rres.rect32) - render_win->rectspare= MEM_dupallocN(rres.rect32); - else if(rres.rectf) - render_win->rectsparef= MEM_dupallocN(rres.rectf); - - render_win->sparex= rres.rectx; - render_win->sparey= rres.recty; -} - -/* -------------- API: externally called --------------- */ - -static void error_cb(char *str){error(str);} -static int esc_timer_set= 0; - -/* set callbacks, exported to sequence render too. - Only call in foreground (UI) renders. */ - -void BIF_init_render_callbacks(Render *re, int do_display) -{ - if(do_display) { - if(G.displaymode!=R_DISPLAYWIN) { - if(render_win) - BIF_close_render_display(); - imagewindow_render_callbacks(re); - } - else { - RE_display_init_cb(re, renderwin_init_display_cb); - RE_display_draw_cb(re, renderwin_progress_display_cb); - RE_display_clear_cb(re, renderwin_clear_display_cb); - RE_stats_draw_cb(re, renderwin_renderinfo_cb); - } - } - - RE_error_cb(re, error_cb); - - G.afbreek= 0; - if(render_win) - render_win->flags &= ~RW_FLAGS_ESCAPE; - - /* start esc timer. ensure it happens once only */ - if(esc_timer_set==0) - init_test_break_callback(); - esc_timer_set++; - - RE_test_break_cb(re, test_break); - RE_timecursor_cb(re, set_timecursor); - -} - -/* the init/end callbacks can be called multiple times (sequence render) */ -void BIF_end_render_callbacks(void) -{ - esc_timer_set--; - if(esc_timer_set==0) { - end_test_break_callback(); - - if(render_win) - mainwindow_make_active(); - } -} - -void BIF_store_spare(void) -{ - if(render_win) - renderwin_store_spare(); - else - imagewin_store_spare(); -} - -/* set up display, render an image or scene */ -void BIF_do_render(int anim) -{ - int slink_flag = 0; - - if (G.f & G_DOSCRIPTLINKS) { - BPY_do_all_scripts(SCRIPT_RENDER); - if (!anim) { /* avoid FRAMECHANGED slink in render callback */ - G.f &= ~G_DOSCRIPTLINKS; - slink_flag = 1; - } - } - - BIF_store_spare(); - - do_render(anim); - - if(G.scene->use_nodes) { - allqueue(REDRAWNODE, 1); - allqueue(REDRAWIMAGE, 1); - } - if (slink_flag) G.f |= G_DOSCRIPTLINKS; - if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_POSTRENDER); -} - -void do_ogl_view3d_render(Render *re, View3D *v3d, int winx, int winy) -{ - float winmat[4][4]; - - update_for_newframe_muted(); /* here, since camera can be animated */ - - if(v3d->persp==2 && v3d->camera) { - /* in camera view, use actual render winmat */ - RE_GetCameraWindow(re, v3d->camera, CFRA, winmat); - drawview3d_render(v3d, winx, winy, winmat); - } - else - drawview3d_render(v3d, winx, winy, NULL); -} - -/* set up display, render the current area view in an image */ -/* the RE_Render is only used to make sure we got the picture in the result */ -void BIF_do_ogl_render(View3D *v3d, int anim) -{ - Render *re= RE_NewRender(G.scene->id.name); - RenderResult *rr; - int winx, winy; - - G.afbreek= 0; - init_test_break_callback(); - - winx= (G.scene->r.size*G.scene->r.xsch)/100; - winy= (G.scene->r.size*G.scene->r.ysch)/100; - - RE_InitState(re, &G.scene->r, winx, winy, NULL); - - /* for now, result is defaulting to floats still... */ - rr= RE_GetResult(re); - if(rr->rect32==NULL) - rr->rect32= MEM_mallocN(sizeof(int)*winx*winy, "32 bits rects"); - - /* open window */ - renderwin_init_display_cb(rr); - if(render_win) - render_win->flags &= ~RW_FLAGS_ESCAPE; - - init_gl_stuff(); - - waitcursor(1); - - if(anim) { - bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype); - int cfrao= CFRA; - - if(BKE_imtype_is_movie(G.scene->r.imtype)) - mh->start_movie(&G.scene->r, winx, winy); - - for(CFRA= SFRA; CFRA<=EFRA; CFRA++) { - /* user event can close window */ - if(render_win==NULL) - break; - - do_ogl_view3d_render(re, v3d, winx, winy); - glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); - BKE_stamp_buf((unsigned char *)rr->rect32, rr->rectf, rr->rectx, rr->recty); - window_swap_buffers(render_win->win); - - if(BKE_imtype_is_movie(G.scene->r.imtype)) { - mh->append_movie(CFRA, rr->rect32, winx, winy); - printf("Append frame %d", G.scene->r.cfra); - } - else { - ImBuf *ibuf= IMB_allocImBuf(winx, winy, G.scene->r.planes, 0, 0); - char name[FILE_MAXDIR+FILE_MAXFILE]; - int ok; - - BKE_makepicstring(name, G.scene->r.pic, G.scene->r.cfra, G.scene->r.imtype); - - ibuf->rect= (unsigned int *)rr->rect32; - ok= BKE_write_ibuf(ibuf, name, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); - - if(ok==0) { - printf("Write error: cannot save %s\n", name); - break; - } - else printf("Saved: %s", name); - - /* imbuf knows which rects are not part of ibuf */ - IMB_freeImBuf(ibuf); - } - /* movie stats prints have no line break */ - printf("\n"); - - if(test_break()) break; - } - - if(BKE_imtype_is_movie(G.scene->r.imtype)) - mh->end_movie(); - - CFRA= cfrao; - } - else { - do_ogl_view3d_render(re, v3d, winx, winy); - glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, rr->rect32); - BKE_stamp_buf((unsigned char *)rr->rect32, rr->rectf, rr->rectx, rr->recty); - window_swap_buffers(render_win->win); - } - - if(render_win) - renderwin_draw(render_win, 0); - - mainwindow_make_active(); - - if(anim) - scene_update_for_newframe(G.scene, G.scene->lay); // no redraw needed, this restores to view as we left it - - end_test_break_callback(); - waitcursor(0); -} - -void BIF_redraw_render_rect(void) -{ - /* redraw */ - if (render_win) { - renderwin_queue_redraw(render_win); - } - else { - allqueue(REDRAWIMAGE, 0); - } -} - -void BIF_swap_render_rects(void) -{ - RenderResult rres; - - if(G.displaymode!=R_DISPLAYWIN) { - imagewindow_swap_render_rects(); - } - else if(render_win) { - - render_win->storespare= 1; - render_win->showspare ^= 1; - - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - if(render_win->sparex!=rres.rectx || render_win->sparey!=rres.recty) { - if(render_win->rectspare) MEM_freeN(render_win->rectspare); - render_win->rectspare= NULL; - if(render_win->rectsparef) MEM_freeN(render_win->rectsparef); - render_win->rectsparef= NULL; - } - - window_set_title(render_win->win, renderwin_get_title(1)); - } - - /* redraw */ - BIF_redraw_render_rect(); - -} - -/* called from usiblender.c too, to free and close renderwin */ -void BIF_close_render_display(void) -{ - if (render_win) { - if (render_win->info_text) MEM_freeN(render_win->info_text); - if (render_win->render_text) MEM_freeN(render_win->render_text); - if (render_win->render_text_spare) MEM_freeN(render_win->render_text_spare); - if (render_win->rectspare) MEM_freeN(render_win->rectspare); - if (render_win->rectsparef) MEM_freeN(render_win->rectsparef); - - window_destroy(render_win->win); /* ghost close window */ - MEM_freeN(render_win); - - render_win= NULL; - } -} - - -/* typical with F11 key, show image or hide/close */ -void BIF_toggle_render_display(void) -{ - - if (G.displaymode!=R_DISPLAYWIN) { - imagewindow_toggle_render(); - } - else { - if (render_win) { - if(render_win->active) { - mainwindow_raise(); - mainwindow_make_active(); - render_win->active= 0; - } - else { - window_raise(render_win->win); - window_make_active(render_win->win); - render_win->active= 1; - } - } - else { - RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); - if(rr) renderwin_init_display_cb(rr); - } - } -} - -void BIF_renderwin_set_custom_cursor(unsigned char mask[16][2], unsigned char bitmap[16][2]) -{ - if (render_win) { - window_set_custom_cursor(render_win->win, mask, bitmap, 7, 7); - } -} diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c deleted file mode 100644 index 25295f4cd3c..00000000000 --- a/source/blender/src/resources.c +++ /dev/null @@ -1,923 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_listBase.h" -#include "DNA_userdef_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "BKE_utildefines.h" - -#include "BIF_gl.h" -#include "BIF_resources.h" -#include "BIF_interface_icons.h" - -#include "BLI_blenlib.h" -#include "blendef.h" // CLAMP -#include "datatoc.h" - -/* global for themes */ -typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha); - -static bTheme *theme_active=NULL; -static int theme_spacetype= SPACE_VIEW3D; - - -void BIF_resources_init(void) -{ - BIF_icons_init(BIFICONID_LAST+1); -} - -void BIF_resources_free(void) -{ - BIF_icons_free(); -} - - -/* ******************************************************** */ -/* THEMES */ -/* ******************************************************** */ - -char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) -{ - ThemeSpace *ts= NULL; - static char error[4]={240, 0, 240, 255}; - static char alert[4]={240, 60, 60, 255}; - static char headerdesel[4]={0,0,0,255}; - static char custom[4]={0,0,0,255}; - - char *cp= error; - - if(btheme) { - - // first check for ui buttons theme - if(colorid < TH_THEMEUI) { - - switch(colorid) { - case TH_BUT_OUTLINE: - cp= btheme->tui.outline; break; - case TH_BUT_NEUTRAL: - cp= btheme->tui.neutral; break; - case TH_BUT_ACTION: - cp= btheme->tui.action; break; - case TH_BUT_SETTING: - cp= btheme->tui.setting; break; - case TH_BUT_SETTING1: - cp= btheme->tui.setting1; break; - case TH_BUT_SETTING2: - cp= btheme->tui.setting2; break; - case TH_BUT_NUM: - cp= btheme->tui.num; break; - case TH_BUT_TEXTFIELD: - cp= btheme->tui.textfield; break; - case TH_BUT_TEXTFIELD_HI: - cp= btheme->tui.textfield_hi; break; - case TH_BUT_POPUP: - cp= btheme->tui.popup; break; - case TH_BUT_TEXT: - cp= btheme->tui.text; break; - case TH_BUT_TEXT_HI: - cp= btheme->tui.text_hi; break; - case TH_MENU_BACK: - cp= btheme->tui.menu_back; break; - case TH_MENU_ITEM: - cp= btheme->tui.menu_item; break; - case TH_MENU_HILITE: - cp= btheme->tui.menu_hilite; break; - case TH_MENU_TEXT: - cp= btheme->tui.menu_text; break; - case TH_MENU_TEXT_HI: - cp= btheme->tui.menu_text_hi; break; - - case TH_BUT_DRAWTYPE: - cp= &btheme->tui.but_drawtype; break; - - case TH_ICONFILE: - cp= btheme->tui.iconfile; break; - - case TH_REDALERT: - cp= alert; break; - case TH_CUSTOM: - cp= custom; break; - } - } - else { - - switch(spacetype) { - case SPACE_BUTS: - ts= &btheme->tbuts; - break; - case SPACE_VIEW3D: - ts= &btheme->tv3d; - break; - case SPACE_IPO: - ts= &btheme->tipo; - break; - case SPACE_FILE: - ts= &btheme->tfile; - break; - case SPACE_NLA: - ts= &btheme->tnla; - break; - case SPACE_ACTION: - ts= &btheme->tact; - break; - case SPACE_SEQ: - ts= &btheme->tseq; - break; - case SPACE_IMAGE: - ts= &btheme->tima; - break; - case SPACE_IMASEL: - ts= &btheme->timasel; - break; - case SPACE_TEXT: - ts= &btheme->text; - break; - case SPACE_OOPS: - ts= &btheme->toops; - break; - case SPACE_SOUND: - ts= &btheme->tsnd; - break; - case SPACE_INFO: - ts= &btheme->tinfo; - break; - case SPACE_TIME: - ts= &btheme->ttime; - break; - case SPACE_NODE: - ts= &btheme->tnode; - break; - default: - ts= &btheme->tv3d; - break; - } - - switch(colorid) { - case TH_BACK: - cp= ts->back; break; - case TH_TEXT: - cp= ts->text; break; - case TH_TEXT_HI: - cp= ts->text_hi; break; - case TH_HEADER: - cp= ts->header; break; - case TH_HEADERDESEL: - /* we calculate a dynamic builtin header deselect color, also for pulldowns... */ - cp= ts->header; - headerdesel[0]= cp[0]>10?cp[0]-10:0; - headerdesel[1]= cp[1]>10?cp[1]-10:0; - headerdesel[2]= cp[2]>10?cp[2]-10:0; - cp= headerdesel; - break; - case TH_PANEL: - cp= ts->panel; break; - case TH_SHADE1: - cp= ts->shade1; break; - case TH_SHADE2: - cp= ts->shade2; break; - case TH_HILITE: - cp= ts->hilite; break; - - case TH_GRID: - cp= ts->grid; break; - case TH_WIRE: - cp= ts->wire; break; - case TH_LAMP: - cp= ts->lamp; break; - case TH_SELECT: - cp= ts->select; break; - case TH_ACTIVE: - cp= ts->active; break; - case TH_GROUP: - cp= ts->group; break; - case TH_GROUP_ACTIVE: - cp= ts->group_active; break; - case TH_TRANSFORM: - cp= ts->transform; break; - case TH_VERTEX: - cp= ts->vertex; break; - case TH_VERTEX_SELECT: - cp= ts->vertex_select; break; - case TH_VERTEX_SIZE: - cp= &ts->vertex_size; break; - case TH_EDGE: - cp= ts->edge; break; - case TH_EDGE_SELECT: - cp= ts->edge_select; break; - case TH_EDGE_SEAM: - cp= ts->edge_seam; break; - case TH_EDGE_SHARP: - cp= ts->edge_sharp; break; - case TH_EDITMESH_ACTIVE: - cp= ts->editmesh_active; break; - case TH_EDGE_FACESEL: - cp= ts->edge_facesel; break; - case TH_FACE: - cp= ts->face; break; - case TH_FACE_SELECT: - cp= ts->face_select; break; - case TH_FACE_DOT: - cp= ts->face_dot; break; - case TH_FACEDOT_SIZE: - cp= &ts->facedot_size; break; - case TH_NORMAL: - cp= ts->normal; break; - case TH_BONE_SOLID: - cp= ts->bone_solid; break; - case TH_BONE_POSE: - cp= ts->bone_pose; break; - case TH_STRIP: - cp= ts->strip; break; - case TH_STRIP_SELECT: - cp= ts->strip_select; break; - case TH_CFRAME: - cp= ts->cframe; break; - - case TH_SYNTAX_B: - cp= ts->syntaxb; break; - case TH_SYNTAX_V: - cp= ts->syntaxv; break; - case TH_SYNTAX_C: - cp= ts->syntaxc; break; - case TH_SYNTAX_L: - cp= ts->syntaxl; break; - case TH_SYNTAX_N: - cp= ts->syntaxn; break; - - case TH_NODE: - cp= ts->syntaxl; break; - case TH_NODE_IN_OUT: - cp= ts->syntaxn; break; - case TH_NODE_OPERATOR: - cp= ts->syntaxb; break; - case TH_NODE_CONVERTOR: - cp= ts->syntaxv; break; - case TH_NODE_GROUP: - cp= ts->syntaxc; break; - - case TH_SEQ_MOVIE: - cp= ts->movie; break; - case TH_SEQ_IMAGE: - cp= ts->image; break; - case TH_SEQ_SCENE: - cp= ts->scene; break; - case TH_SEQ_AUDIO: - cp= ts->audio; break; - case TH_SEQ_EFFECT: - cp= ts->effect; break; - case TH_SEQ_PLUGIN: - cp= ts->plugin; break; - case TH_SEQ_TRANSITION: - cp= ts->transition; break; - case TH_SEQ_META: - cp= ts->meta; break; - - } - - } - } - - return cp; -} - -#define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; - -/* initialize - Note: when you add new colors, created & saved themes need initialized - in usiblender.c, search for "versionfile" -*/ -void BIF_InitTheme(void) -{ - bTheme *btheme= U.themes.first; - - /* we search for the theme with name Default */ - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - if(strcmp("Default", btheme->name)==0) break; - } - - if(btheme==NULL) { - btheme= MEM_callocN(sizeof(bTheme), "theme"); - BLI_addtail(&U.themes, btheme); - strcpy(btheme->name, "Default"); - } - - BIF_SetTheme(NULL); // make sure the global used in this file is set - - /* UI buttons (todo) */ - SETCOL(btheme->tui.outline, 0xA0,0xA0,0xA0, 255); - SETCOL(btheme->tui.neutral, 0xA0,0xA0,0xA0, 255); - SETCOL(btheme->tui.action, 0xAD,0xA0,0x93, 255); - SETCOL(btheme->tui.setting, 0x8A,0x9E,0xA1, 255); - SETCOL(btheme->tui.setting1, 0xA1,0xA1,0xAE, 255); - SETCOL(btheme->tui.setting2, 0xA1,0x99,0xA7, 255); - SETCOL(btheme->tui.num, 0x90,0x90,0x90, 255); - SETCOL(btheme->tui.textfield, 0x90,0x90,0x90, 255); - SETCOL(btheme->tui.textfield_hi,0xc6,0x77,0x77, 255); - SETCOL(btheme->tui.popup, 0xA0,0xA0,0xA0, 255); - - SETCOL(btheme->tui.text, 0,0,0, 255); - SETCOL(btheme->tui.text_hi, 255, 255, 255, 255); - - SETCOL(btheme->tui.menu_back, 0xD2,0xD2,0xD2, 255); - SETCOL(btheme->tui.menu_item, 0xDA,0xDA,0xDA, 255); - SETCOL(btheme->tui.menu_hilite, 0x7F,0x7F,0x7F, 255); - SETCOL(btheme->tui.menu_text, 0, 0, 0, 255); - SETCOL(btheme->tui.menu_text_hi, 255, 255, 255, 255); - btheme->tui.but_drawtype= TH_SHADED; - - BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile)); - - /* space view3d */ - SETCOL(btheme->tv3d.back, 115, 115, 115, 255); - SETCOL(btheme->tv3d.text, 0, 0, 0, 255); - SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255); - SETCOL(btheme->tv3d.header, 195, 195, 195, 255); - SETCOL(btheme->tv3d.panel, 165, 165, 165, 127); - - SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100); - SETCOL(btheme->tv3d.shade2, 0x7f, 0x70, 0x70, 100); - - SETCOL(btheme->tv3d.grid, 92, 92, 92, 255); - SETCOL(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255); - SETCOL(btheme->tv3d.lamp, 0, 0, 0, 40); - SETCOL(btheme->tv3d.select, 0xff, 0x88, 0xff, 255); - SETCOL(btheme->tv3d.active, 0xff, 0xbb, 0xff, 255); - SETCOL(btheme->tv3d.group, 0x10, 0x40, 0x10, 255); - SETCOL(btheme->tv3d.group_active, 0x55, 0xbb, 0x55, 255); - SETCOL(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255); - SETCOL(btheme->tv3d.vertex, 0xff, 0x70, 0xff, 255); - SETCOL(btheme->tv3d.vertex_select, 0xff, 0xff, 0x70, 255); - btheme->tv3d.vertex_size= 2; - SETCOL(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255); - SETCOL(btheme->tv3d.edge_select, 0xb0, 0xb0, 0x30, 255); - SETCOL(btheme->tv3d.edge_seam, 230, 150, 50, 255); - SETCOL(btheme->tv3d.edge_facesel, 75, 75, 75, 255); - SETCOL(btheme->tv3d.face, 0, 50, 150, 30); - SETCOL(btheme->tv3d.face_select, 200, 100, 200, 60); - SETCOL(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255); - SETCOL(btheme->tv3d.face_dot, 255, 138, 48, 255); - btheme->tv3d.facedot_size= 4; - SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255); - - SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255); - SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); // alpha 80 is not meant editable, used for wire+action draw - - - /* space buttons */ - /* to have something initialized */ - btheme->tbuts= btheme->tv3d; - - SETCOL(btheme->tbuts.back, 180, 180, 180, 255); - SETCOL(btheme->tbuts.header, 195, 195, 195, 255); - SETCOL(btheme->tbuts.panel, 255, 255, 255, 40); - - /* space ipo */ - /* to have something initialized */ - btheme->tipo= btheme->tv3d; - - SETCOL(btheme->tipo.grid, 94, 94, 94, 255); - SETCOL(btheme->tipo.back, 120, 120, 120, 255); - SETCOL(btheme->tipo.header, 195, 195, 195, 255); - SETCOL(btheme->tipo.panel, 255, 255, 255, 150); - SETCOL(btheme->tipo.shade1, 172, 172, 172, 100); - SETCOL(btheme->tipo.shade2, 0x70, 0x70, 0x70, 100); - SETCOL(btheme->tipo.vertex, 0xff, 0x70, 0xff, 255); - SETCOL(btheme->tipo.vertex_select, 0xff, 0xff, 0x70, 255); - SETCOL(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255); - btheme->tipo.vertex_size= 3; - - /* space file */ - /* to have something initialized */ - btheme->tfile= btheme->tv3d; - SETCOL(btheme->tfile.back, 128, 128, 128, 255); - SETCOL(btheme->tfile.text, 0, 0, 0, 255); - SETCOL(btheme->tfile.text_hi, 255, 255, 255, 255); - SETCOL(btheme->tfile.header, 182, 182, 182, 255); - SETCOL(btheme->tfile.hilite, 0xA0, 0xA0, 0xD0, 255); // selected files - - - /* space action */ - btheme->tact= btheme->tv3d; - SETCOL(btheme->tact.back, 116, 116, 116, 255); - SETCOL(btheme->tact.text, 0, 0, 0, 255); - SETCOL(btheme->tact.text_hi, 255, 255, 255, 255); - SETCOL(btheme->tact.header, 182, 182, 182, 255); - SETCOL(btheme->tact.grid, 94, 94, 94, 255); - SETCOL(btheme->tact.face, 166, 166, 166, 255); // RVK - SETCOL(btheme->tact.shade1, 172, 172, 172, 255); // sliders - SETCOL(btheme->tact.shade2, 84, 44, 31, 100); // bar - SETCOL(btheme->tact.hilite, 17, 27, 60, 100); // bar - SETCOL(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 255); - SETCOL(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 255); - - /* space nla */ - btheme->tnla= btheme->tv3d; - SETCOL(btheme->tnla.back, 116, 116, 116, 255); - SETCOL(btheme->tnla.text, 0, 0, 0, 255); - SETCOL(btheme->tnla.text_hi, 255, 255, 255, 255); - SETCOL(btheme->tnla.header, 182, 182, 182, 255); - SETCOL(btheme->tnla.grid, 94, 94, 94, 255); - SETCOL(btheme->tnla.shade1, 172, 172, 172, 255); // sliders - SETCOL(btheme->tnla.shade2, 84, 44, 31, 100); // bar - SETCOL(btheme->tnla.hilite, 17, 27, 60, 100); // bar - SETCOL(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255); - SETCOL(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255); - - /* space seq */ - btheme->tseq= btheme->tv3d; - SETCOL(btheme->tseq.back, 116, 116, 116, 255); - SETCOL(btheme->tseq.movie, 81, 105, 135, 255); - SETCOL(btheme->tseq.image, 109, 88, 129, 255); - SETCOL(btheme->tseq.scene, 78, 152, 62, 255); - SETCOL(btheme->tseq.audio, 46, 143, 143, 255); - SETCOL(btheme->tseq.effect, 169, 84, 124, 255); - SETCOL(btheme->tseq.plugin, 126, 126, 80, 255); - SETCOL(btheme->tseq.transition, 162, 95, 111, 255); - SETCOL(btheme->tseq.meta, 109, 145, 131, 255); - - - /* space image */ - btheme->tima= btheme->tv3d; - SETCOL(btheme->tima.back, 53, 53, 53, 255); - SETCOL(btheme->tima.vertex, 0xff, 0x70, 0xff, 255); - SETCOL(btheme->tima.vertex_select, 0xff, 0xff, 0x70, 255); - btheme->tima.vertex_size= 2; - SETCOL(btheme->tima.face, 0, 50, 150, 40); - SETCOL(btheme->tima.face_select, 200, 100, 200, 80); - - /* space imageselect */ - btheme->timasel= btheme->tv3d; - SETCOL(btheme->timasel.active, 195, 195, 195, 255); /* active tile */ - SETCOL(btheme->timasel.grid, 94, 94, 94, 255); /* active file text */ - SETCOL(btheme->timasel.back, 110, 110, 110, 255); - SETCOL(btheme->timasel.header, 195, 195, 195, 255); - SETCOL(btheme->timasel.shade1, 94, 94, 94, 255); /* bar */ - SETCOL(btheme->timasel.shade2, 172, 172, 172, 255); /* sliders */ - SETCOL(btheme->timasel.hilite, 17, 27, 60, 100); /* selected tile */ - SETCOL(btheme->timasel.text, 0, 0, 0, 255); - SETCOL(btheme->timasel.text_hi, 255, 255, 255, 255); - SETCOL(btheme->timasel.panel, 132, 132, 132, 255); - - /* space text */ - btheme->text= btheme->tv3d; - SETCOL(btheme->text.back, 153, 153, 153, 255); - SETCOL(btheme->text.shade1, 143, 143, 143, 255); - SETCOL(btheme->text.shade2, 0xc6, 0x77, 0x77, 255); - SETCOL(btheme->text.hilite, 255, 0, 0, 255); - - /* syntax highlighting */ - SETCOL(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/ - SETCOL(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */ - SETCOL(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */ - SETCOL(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */ - SETCOL(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */ - - /* space oops */ - btheme->toops= btheme->tv3d; - SETCOL(btheme->toops.back, 153, 153, 153, 255); - - /* space info */ - btheme->tinfo= btheme->tv3d; - SETCOL(btheme->tinfo.back, 153, 153, 153, 255); - - /* space sound */ - btheme->tsnd= btheme->tv3d; - SETCOL(btheme->tsnd.back, 153, 153, 153, 255); - SETCOL(btheme->tsnd.shade1, 173, 173, 173, 255); // sliders - SETCOL(btheme->tsnd.grid, 140, 140, 140, 255); - - /* space time */ - btheme->ttime= btheme->tsnd; // same as sound space - - /* space node, re-uses syntax color storage */ - btheme->tnode= btheme->tv3d; - SETCOL(btheme->tnode.edge_select, 255, 255, 255, 255); - SETCOL(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */ - SETCOL(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */ - SETCOL(btheme->tnode.syntaxb, 127,127,127, 255); /* operator */ - SETCOL(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */ - SETCOL(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */ - -} - -char *BIF_ThemeColorsPup(int spacetype) -{ - char *cp= MEM_callocN(32*32, "theme pup"); - char *str = cp; - - if(spacetype==0) { - str += sprintf(str, "Outline %%x%d|", TH_BUT_OUTLINE); - str += sprintf(str, "Neutral %%x%d|", TH_BUT_NEUTRAL); - str += sprintf(str, "Action %%x%d|", TH_BUT_ACTION); - str += sprintf(str, "Setting %%x%d|", TH_BUT_SETTING); - str += sprintf(str, "Special Setting 1%%x%d|", TH_BUT_SETTING1); - str += sprintf(str, "Special Setting 2 %%x%d|", TH_BUT_SETTING2); - str += sprintf(str, "Number Input %%x%d|", TH_BUT_NUM); - str += sprintf(str, "Text Input %%x%d|", TH_BUT_TEXTFIELD); - str += sprintf(str, "Text Input Highlight %%x%d|", TH_BUT_TEXTFIELD_HI); - str += sprintf(str, "Popup %%x%d|", TH_BUT_POPUP); - str += sprintf(str, "Text %%x%d|", TH_BUT_TEXT); - str += sprintf(str, "Text Highlight %%x%d|", TH_BUT_TEXT_HI); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Menu Background %%x%d|", TH_MENU_BACK); - str += sprintf(str, "Menu Item %%x%d|", TH_MENU_ITEM); - str += sprintf(str, "Menu Item Highlight %%x%d|", TH_MENU_HILITE); - str += sprintf(str, "Menu Text %%x%d|", TH_MENU_TEXT); - str += sprintf(str, "Menu Text Highlight %%x%d|", TH_MENU_TEXT_HI); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Drawtype %%x%d|", TH_BUT_DRAWTYPE); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Icon File %%x%d|", TH_ICONFILE); - } - else { - // first defaults for each space - str += sprintf(str, "Background %%x%d|", TH_BACK); - str += sprintf(str, "Text %%x%d|", TH_TEXT); - str += sprintf(str, "Text Highlight %%x%d|", TH_TEXT_HI); - str += sprintf(str, "Header %%x%d|", TH_HEADER); - - switch(spacetype) { - case SPACE_VIEW3D: - str += sprintf(str, "Panel %%x%d|", TH_PANEL); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "Wire %%x%d|", TH_WIRE); - str += sprintf(str, "Lamp %%x%d|", TH_LAMP); - str += sprintf(str, "Object Selected %%x%d|", TH_SELECT); - str += sprintf(str, "Object Active %%x%d|", TH_ACTIVE); - str += sprintf(str, "Object Grouped %%x%d|", TH_GROUP); - str += sprintf(str, "Object Grouped Active %%x%d|", TH_GROUP_ACTIVE); - str += sprintf(str, "Transform %%x%d|", TH_TRANSFORM); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Vertex %%x%d|", TH_VERTEX); - str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT); - str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE); - str += sprintf(str, "Edge Selected %%x%d|", TH_EDGE_SELECT); - str += sprintf(str, "Edge Seam %%x%d|", TH_EDGE_SEAM); - str += sprintf(str, "Edge Sharp %%x%d|", TH_EDGE_SHARP); - str += sprintf(str, "Edge UV Face Select %%x%d|", TH_EDGE_FACESEL); - str += sprintf(str, "Face (transp) %%x%d|", TH_FACE); - str += sprintf(str, "Face Selected (transp) %%x%d|", TH_FACE_SELECT); - str += sprintf(str, "Face Dot Selected %%x%d|", TH_FACE_DOT); - str += sprintf(str, "Face Dot Size %%x%d|", TH_FACEDOT_SIZE); - str += sprintf(str, "Active Vert/Edge/Face %%x%d|", TH_EDITMESH_ACTIVE); - str += sprintf(str, "Normal %%x%d|", TH_NORMAL); - str += sprintf(str, "Bone Solid %%x%d|", TH_BONE_SOLID); - str += sprintf(str, "Bone Pose %%x%d", TH_BONE_POSE); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_IPO: - str += sprintf(str, "Panel %%x%d|", TH_PANEL); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "Window Sliders %%x%d|", TH_SHADE1); - str += sprintf(str, "Ipo Channels %%x%d|", TH_SHADE2); - str += sprintf(str, "Vertex %%x%d|", TH_VERTEX); - str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT); - str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_FILE: - str += sprintf(str, "Selected file %%x%d", TH_HILITE); - break; - case SPACE_NLA: - //str += sprintf(str, "Panel %%x%d|", TH_PANEL); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "View Sliders %%x%d|", TH_SHADE1); - str += sprintf(str, "Bars %%x%d|", TH_SHADE2); - str += sprintf(str, "Bars selected %%x%d|", TH_HILITE); - str += sprintf(str, "Strips %%x%d|", TH_STRIP); - str += sprintf(str, "Strips selected %%x%d|", TH_STRIP_SELECT); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_ACTION: - //str += sprintf(str, "Panel %%x%d|", TH_PANEL); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "RVK Sliders %%x%d|", TH_FACE); - str += sprintf(str, "View Sliders %%x%d|", TH_SHADE1); - str += sprintf(str, "Channels %%x%d|", TH_SHADE2); - str += sprintf(str, "Channels Selected %%x%d|", TH_HILITE); - str += sprintf(str, "Long Key %%x%d|", TH_STRIP); - str += sprintf(str, "Long Key selected %%x%d|", TH_STRIP_SELECT); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_IMAGE: - str += sprintf(str, "%%l|"); - str += sprintf(str, "Vertex %%x%d|", TH_VERTEX); - str += sprintf(str, "Vertex Selected %%x%d|", TH_VERTEX_SELECT); - str += sprintf(str, "Vertex Size %%x%d|", TH_VERTEX_SIZE); - str += sprintf(str, "Face %%x%d|", TH_FACE); - str += sprintf(str, "Face Selected %%x%d", TH_FACE_SELECT); - break; - case SPACE_SEQ: - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "Window Sliders %%x%d|", TH_SHADE1); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Movie Strip %%x%d|", TH_SEQ_MOVIE); - str += sprintf(str, "Image Strip %%x%d|", TH_SEQ_IMAGE); - str += sprintf(str, "Scene Strip %%x%d|", TH_SEQ_SCENE); - str += sprintf(str, "Audio Strip %%x%d|", TH_SEQ_AUDIO); - str += sprintf(str, "Effect Strip %%x%d|", TH_SEQ_EFFECT); - str += sprintf(str, "Plugin Strip %%x%d|", TH_SEQ_PLUGIN); - str += sprintf(str, "Transition Strip %%x%d|", TH_SEQ_TRANSITION); - str += sprintf(str, "Meta Strip %%x%d|", TH_SEQ_META); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_SOUND: - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "Window Slider %%x%d|", TH_SHADE1); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_BUTS: - str += sprintf(str, "Panel %%x%d|", TH_PANEL); - break; - case SPACE_IMASEL: - str += sprintf(str, "Tiles %%x%d|", TH_PANEL); - str += sprintf(str, "Scrollbar %%x%d|", TH_SHADE1); - str += sprintf(str, "Scroll Handle %%x%d|", TH_SHADE2); - str += sprintf(str, "Selected File %%x%d|", TH_HILITE); - str += sprintf(str, "Active File %%x%d|", TH_ACTIVE); - str += sprintf(str, "Active File Text%%x%d|", TH_GRID); - break; - case SPACE_TEXT: - str += sprintf(str, "Scroll Bar %%x%d|", TH_SHADE1); - str += sprintf(str, "Selected Text %%x%d|", TH_SHADE2); - str += sprintf(str, "Cursor %%x%d|", TH_HILITE); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Syntax Builtin %%x%d|", TH_SYNTAX_B); - str += sprintf(str, "Syntax Special %%x%d|", TH_SYNTAX_V); - str += sprintf(str, "Syntax Comment %%x%d|", TH_SYNTAX_C); - str += sprintf(str, "Syntax Strings %%x%d|", TH_SYNTAX_L); - str += sprintf(str, "Syntax Numbers %%x%d|", TH_SYNTAX_N); - break; - case SPACE_TIME: - str += sprintf(str, "Grid %%x%d|", TH_GRID); - str += sprintf(str, "Current Frame %%x%d", TH_CFRAME); - break; - case SPACE_NODE: - str += sprintf(str, "Wires %%x%d|", TH_WIRE); - str += sprintf(str, "Wires Select %%x%d|", TH_EDGE_SELECT); - str += sprintf(str, "%%l|"); - str += sprintf(str, "Node Backdrop %%x%d|", TH_NODE); - str += sprintf(str, "In/Out Node %%x%d|", TH_NODE_IN_OUT); - str += sprintf(str, "Convertor Node %%x%d|", TH_NODE_CONVERTOR); - str += sprintf(str, "Operator Node %%x%d|", TH_NODE_OPERATOR); - str += sprintf(str, "Group Node %%x%d|", TH_NODE_GROUP); - break; - } - } - return cp; -} - -void BIF_SetTheme(ScrArea *sa) -{ - if(sa==NULL) { // called for safety, when delete themes - theme_active= U.themes.first; - theme_spacetype= SPACE_VIEW3D; - } - else { - // later on, a local theme can be found too - theme_active= U.themes.first; - theme_spacetype= sa->spacetype; - - } -} - -// for space windows only -void BIF_ThemeColor(int colorid) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - glColor3ub(cp[0], cp[1], cp[2]); - -} - -// plus alpha -void BIF_ThemeColor4(int colorid) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - glColor4ub(cp[0], cp[1], cp[2], cp[3]); - -} - -// set the color with offset for shades -void BIF_ThemeColorShade(int colorid, int offset) -{ - int r, g, b; - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - r= offset + (int) cp[0]; - CLAMP(r, 0, 255); - g= offset + (int) cp[1]; - CLAMP(g, 0, 255); - b= offset + (int) cp[2]; - CLAMP(b, 0, 255); - //glColor3ub(r, g, b); - glColor4ub(r, g, b, cp[3]); -} -void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset) -{ - int r, g, b, a; - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - r= coloffset + (int) cp[0]; - CLAMP(r, 0, 255); - g= coloffset + (int) cp[1]; - CLAMP(g, 0, 255); - b= coloffset + (int) cp[2]; - CLAMP(b, 0, 255); - a= alphaoffset + (int) cp[3]; - CLAMP(a, 0, 255); - glColor4ub(r, g, b, a); -} - -// blend between to theme colors, and set it -void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac) -{ - int r, g, b; - char *cp1, *cp2; - - cp1= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1); - cp2= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2); - - if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0; - r= floor((1.0-fac)*cp1[0] + fac*cp2[0]); - g= floor((1.0-fac)*cp1[1] + fac*cp2[1]); - b= floor((1.0-fac)*cp1[2] + fac*cp2[2]); - - glColor3ub(r, g, b); -} - -// blend between to theme colors, shade it, and set it -void BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset) -{ - int r, g, b; - char *cp1, *cp2; - - cp1= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1); - cp2= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2); - - if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0; - r= offset+floor((1.0-fac)*cp1[0] + fac*cp2[0]); - g= offset+floor((1.0-fac)*cp1[1] + fac*cp2[1]); - b= offset+floor((1.0-fac)*cp1[2] + fac*cp2[2]); - - r= r<0?0:(r>255?255:r); - g= g<0?0:(g>255?255:g); - b= b<0?0:(b>255?255:b); - - glColor3ub(r, g, b); -} - -// get individual values, not scaled -float BIF_GetThemeValuef(int colorid) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - return ((float)cp[0]); - -} - -// get individual values, not scaled -int BIF_GetThemeValue(int colorid) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - return ((int) cp[0]); - -} - - -// get the color, range 0.0-1.0 -void BIF_GetThemeColor3fv(int colorid, float *col) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - col[0]= ((float)cp[0])/255.0; - col[1]= ((float)cp[1])/255.0; - col[2]= ((float)cp[2])/255.0; -} - -// get the color, in char pointer -void BIF_GetThemeColor3ubv(int colorid, char *col) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - col[0]= cp[0]; - col[1]= cp[1]; - col[2]= cp[2]; -} - -// get the color, in char pointer -void BIF_GetThemeColor4ubv(int colorid, char *col) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - col[0]= cp[0]; - col[1]= cp[1]; - col[2]= cp[2]; - col[3]= cp[3]; -} - -void BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col) -{ - char *cp; - - cp= BIF_ThemeGetColorPtr(theme_active, spacetype, colorid); - col[0]= cp[0]; - col[1]= cp[1]; - col[2]= cp[2]; - col[3]= cp[3]; -} - -// blends and shades between two char color pointers -void BIF_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset) -{ - int r, g, b; - - if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0; - r= offset+floor((1.0-fac)*cp1[0] + fac*cp2[0]); - g= offset+floor((1.0-fac)*cp1[1] + fac*cp2[1]); - b= offset+floor((1.0-fac)*cp1[2] + fac*cp2[2]); - - r= r<0?0:(r>255?255:r); - g= g<0?0:(g>255?255:g); - b= b<0?0:(b>255?255:b); - - glColor3ub(r, g, b); -} - -// get a 3 byte color, blended and shaded between two other char color pointers -void BIF_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset) -{ - int r, g, b; - - if(fac<0.0) fac=0.0; else if(fac>1.0) fac= 1.0; - r= offset+floor((1.0-fac)*cp1[0] + fac*cp2[0]); - g= offset+floor((1.0-fac)*cp1[1] + fac*cp2[1]); - b= offset+floor((1.0-fac)*cp1[2] + fac*cp2[2]); - - r= r<0?0:(r>255?255:r); - g= g<0?0:(g>255?255:g); - b= b<0?0:(b>255?255:b); - - col[0] = r; - col[1] = g; - col[2] = b; -} diff --git a/source/blender/src/retopo.c b/source/blender/src/retopo.c deleted file mode 100644 index 60be622e3ad..00000000000 --- a/source/blender/src/retopo.c +++ /dev/null @@ -1,921 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Implements the Retopo tools - * - * BIF_retopo.h - * - */ - -#include "MEM_guardedalloc.h" - -#include "DNA_curve_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BDR_editobject.h" - -#include "BIF_editmesh.h" -#include "BIF_editmode_undo.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_mesh.h" - -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "BSE_drawview.h" -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "editmesh.h" -#include "mydevice.h" - -#ifdef WIN32 -#define _USE_MATH_DEFINES -#endif -#include -#include -#include - -typedef struct RetopoPaintHit { - struct RetopoPaintHit *next, *prev; - RetopoPaintPoint *intersection; - short index; - float where; -} RetopoPaintHit; - -void retopo_do_2d(View3D *v3d, double proj[2], float *v, char adj); -void retopo_paint_debug_print(RetopoPaintData *rpd); - -/* Painting */ -RetopoPaintData *get_retopo_paint_data() -{ - if(!retopo_mesh_paint_check()) return NULL; - if(!G.editMesh) return NULL; - return G.editMesh->retopo_paint_data; -} - -char retopo_mesh_paint_check() -{ - return retopo_mesh_check() && G.scene->toolsettings->retopo_mode & RETOPO_PAINT; -} - -void retopo_free_paint_data(RetopoPaintData *rpd) -{ - if(rpd) { - RetopoPaintLine *l; - for(l= rpd->lines.first; l; l= l->next) { - BLI_freelistN(&l->points); - BLI_freelistN(&l->hitlist); - } - BLI_freelistN(&rpd->lines); - - BLI_freelistN(&rpd->intersections); - - MEM_freeN(rpd); - } -} - -void retopo_free_paint() -{ - retopo_free_paint_data(G.editMesh->retopo_paint_data); - G.editMesh->retopo_paint_data= NULL; -} - -char line_intersection_2d(const vec2s *a, const vec2s *b, const vec2s *c, const vec2s *d, vec2s *out, - float *r, float *s) -{ - float den; - *r= (a->y - c->y) * (d->x - c->x) - (a->x - c->x) * (d->y - c->y); - *s= (a->y - c->y) * (b->x - a->x) - (a->x - c->x) * (b->y - a->y); - den= (b->x - a->x) * (d->y - c->y) - (b->y - a->y) * (d->x - c->x); - - if((a->x==b->x && a->y==b->y) || (c->x==d->x && c->y==d->y)) return 0; - - if(!den) return 0; - - *r/= den; - *s/= den; - - if(*s<0 || *s>=1 || *r<0 || *r>=1) return 0; - - out->x= a->x + *r*(b->x - a->x); - out->y= a->y + *r*(b->y - a->y); - return 1; -} - -void retopo_paint_add_line_hit(RetopoPaintLine *l, RetopoPaintPoint *p, RetopoPaintPoint *intersection, float w) -{ - RetopoPaintHit *prev, *hit= MEM_callocN(sizeof(RetopoPaintHit),"RetopoPaintHit"); - - hit->intersection= intersection; - hit->index= p->index; - hit->where= w; - - prev= l->hitlist.first; - if(!prev) { - BLI_addtail(&l->hitlist,hit); - } - else if(prev->index>hit->index) { - BLI_addhead(&l->hitlist,hit); - } - else { - /* Move forward until we hit the next highest index */ - while(prev->next) { - if(prev->next->index > hit->index) break; - prev= prev->next; - } - /* Move backward until we hit the next lowest where */ - while(prev->prev && prev->prev->index==prev->index && - prev->where > hit->where) - prev=prev->prev; - BLI_insertlink(&l->hitlist,prev,hit); - } - - /* Removed duplicate intersections */ - if(hit->prev && hit->prev->intersection==hit->intersection) { - BLI_freelinkN(&l->hitlist,hit); - } -} - -char retopo_paint_add_intersection(RetopoPaintData *rpd, RetopoPaintLine *l1, RetopoPaintPoint *p1, - RetopoPaintLine *l2, RetopoPaintPoint *p2, vec2s *out, float r, float s) -{ - RetopoPaintPoint *p, *hit; - char found= 0; - - for(p=rpd->intersections.first; p; p= p->next) { - if(sqrt(pow(p->loc.x-out->x,2)+pow(p->loc.y-out->y,2))<7) { - found= 1; - break; - } - } - - if(!found) { - hit= MEM_callocN(sizeof(RetopoPaintPoint),"Retopo paint intersection"); - hit->loc.x= out->x; - hit->loc.y= out->y; - BLI_addtail(&rpd->intersections,hit); - } else { - hit= p; - } - - retopo_paint_add_line_hit(l1,p1,hit,r); - retopo_paint_add_line_hit(l2,p2,hit,s); - - return !found; -} - - -/* Returns 1 if a new intersection was added */ -char do_line_intersection(RetopoPaintData *rpd, RetopoPaintLine *l1, RetopoPaintPoint *p1, - RetopoPaintLine *l2, RetopoPaintPoint *p2) -{ - vec2s out; - float r,s; - if(line_intersection_2d(&p1->loc, &p1->next->loc, - &p2->loc, &p2->next->loc, - &out,&r,&s)) { - if(retopo_paint_add_intersection(rpd,l1,p1,l2,p2,&out,r,s)) - return 1; - } - return 0; -} - -typedef struct FaceNode { - struct FaceNode *next, *prev; - MFace f; -} FaceNode; - -char faces_equal(EditFace *f1, EditFace *f2) -{ - return editface_containsVert(f2,f1->v1) && - editface_containsVert(f2,f1->v2) && - editface_containsVert(f2,f1->v3) && - (f1->v4 ? editface_containsVert(f2,f1->v4) : 1); -} - -EditFace *addfaceif(EditMesh *em, EditVert *v1, EditVert *v2, EditVert *v3, EditVert *v4) -{ - EditFace *efa; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(editface_containsVert(efa,v1) && - editface_containsVert(efa,v2) && - editface_containsVert(efa,v3) && - (v4 ? editface_containsVert(efa,v4) : 1)) - return NULL; - } - - return addfacelist(v1,v2,v3,v4,NULL,NULL); -} - -void retopo_paint_apply() -{ - RetopoPaintData *rpd= G.editMesh->retopo_paint_data; - EditVert *eve; - - if(rpd) { - RetopoPaintLine *l1, *l2; - RetopoPaintPoint *p1, *p2; - unsigned hitcount= 0; - unsigned i; - RetopoPaintHit *h; - float hitco[3]; - - /* Find intersections */ - BLI_freelistN(&rpd->intersections); - for(l1= rpd->lines.first; l1; l1= l1->next) { - for(l2= rpd->lines.first; l2; l2= l2->next) { - if(l1!=l2) { - for(p1= l1->points.first; p1 && p1!=l1->points.last; p1= p1->next) { - for(p2= l2->points.first; p2 && p2!=l2->points.last; p2= p2->next) { - if(p1!=p2) { - if(do_line_intersection(rpd,l1,p1,l2,p2)) - ++hitcount; - } - } - } - } - } - } - - /*topoPaintHit *hit; - l1= rpd->lines.first; - for(hit= l1->hitlist.first; hit; hit= hit->next) { - printf("\nhit(%p,%d) ",hit->intersection,hit->index); - } - fflush(stdout);*/ - - /* Deselect */ - for(eve= G.editMesh->verts.first; eve; eve= eve->next) - eve->f &= ~SELECT; - EM_deselect_flush(); - - for(i=0; iintersections,i); - double proj[2] = {intersection->loc.x, intersection->loc.y}; - retopo_do_2d(rpd->paint_v3d, proj, hitco, 1); - intersection->eve= addvertlist(hitco, NULL); - intersection->eve->f= SELECT; - } - - for(l1= rpd->lines.first; l1; l1= l1->next) { - unsigned etcount= BLI_countlist(&l1->hitlist); - if(etcount>=2) { - for(h= l1->hitlist.first; (h && h->next); h= h->next) - addedgelist(h->intersection->eve,h->next->intersection->eve,NULL); - if(etcount>=3 && l1->cyclic) - addedgelist(((RetopoPaintHit*)l1->hitlist.first)->intersection->eve, - ((RetopoPaintHit*)l1->hitlist.last)->intersection->eve, NULL); - } - } - - addfaces_from_edgenet(); - } - - retopo_free_paint(); -} - -void add_rppoint(RetopoPaintLine *l, short x, short y) -{ - RetopoPaintPoint *p= MEM_callocN(sizeof(RetopoPaintPoint),"RetopoPaintPoint"); - double proj[2]; - p->loc.x= x; - p->loc.y= y; - BLI_addtail(&l->points,p); - p->index= p->prev?p->prev->index+1:0; - - proj[0] = p->loc.x; - proj[1] = p->loc.y; - - retopo_do_2d(G.editMesh->retopo_paint_data->paint_v3d, proj, p->co, 1); -} -RetopoPaintLine *add_rpline(RetopoPaintData *rpd) -{ - RetopoPaintLine *l= MEM_callocN(sizeof(RetopoPaintLine),"RetopoPaintLine"); - BLI_addtail(&rpd->lines,l); - return l; -} - -void retopo_paint_toggle_cyclic(RetopoPaintLine *l) -{ - if(l==NULL) - return; - if(!l->cyclic) { - RetopoPaintPoint *pf= l->points.first; - - if(pf) { - add_rppoint(l, pf->loc.x, pf->loc.y); - l->cyclic= l->points.last; - } - } else { - BLI_freelinkN(&l->points,l->cyclic); - l->cyclic= NULL; - } -} - -void retopo_paint_add_line(RetopoPaintData *rpd, short mouse[2]) -{ - RetopoPaintLine *l= add_rpline(rpd); - float range[2]= {mouse[0]-rpd->sloc[0],mouse[1]-rpd->sloc[1]}; - int i; - - /* Add initial point */ - add_rppoint(l,rpd->sloc[0],rpd->sloc[1]); - for(i=0; itoolsettings->line_div; ++i) { - const float mul= (i+1.0f) / G.scene->toolsettings->line_div; - add_rppoint(l,rpd->sloc[0] + range[0]*mul,rpd->sloc[1] + range[1]*mul); - } - - allqueue(REDRAWVIEW3D,0); -} - -void retopo_paint_add_ellipse(RetopoPaintData *rpd, short mouse[2]) -{ - int i; - - add_rpline(rpd); - for (i=0; itoolsettings->ellipse_div; i++) { - float t= (float) i / G.scene->toolsettings->ellipse_div; - float cur= t*(M_PI*2); - - float w= abs(mouse[0]-rpd->sloc[0]); - float h= abs(mouse[1]-rpd->sloc[1]); - - add_rppoint(rpd->lines.last,cos(cur)*w+rpd->sloc[0],sin(cur)*h+rpd->sloc[1]); - } - - retopo_paint_toggle_cyclic(rpd->lines.last); - - allqueue(REDRAWVIEW3D,0); -} - -void retopo_end_okee() -{ - if(okee("Apply retopo paint?")) - retopo_paint_apply(); - else - retopo_free_paint(); - G.scene->toolsettings->retopo_mode &= ~RETOPO_PAINT; -} - -void retopo_paint_toggle(void *a, void *b) -{ - /* Note that these operations are reversed because mode bit has already been set! */ - if(retopo_mesh_paint_check()) { /* Activate retopo paint */ - RetopoPaintData *rpd= MEM_callocN(sizeof(RetopoPaintData),"RetopoPaintData"); - - G.editMesh->retopo_paint_data= rpd; - G.scene->toolsettings->retopo_paint_tool= RETOPO_PEN; - rpd->seldist= 15; - rpd->nearest.line= NULL; - G.scene->toolsettings->line_div= 25; - G.scene->toolsettings->ellipse_div= 25; - G.scene->toolsettings->retopo_hotspot= 1; - } else retopo_end_okee(); - - BIF_undo_push("Retopo toggle"); - - allqueue(REDRAWVIEW3D, 1); -} - -void retopo_paint_view_update(struct View3D *v3d) -{ - RetopoPaintData *rpd= get_retopo_paint_data(); - - if(rpd && rpd->paint_v3d==v3d) { - RetopoPaintLine *l; - RetopoPaintPoint *p; - double ux, uy, uz; - - for(l= rpd->lines.first; l; l= l->next) { - for(p= l->points.first; p; p= p->next) { - gluProject(p->co[0],p->co[1],p->co[2], v3d->retopo_view_data->mats.modelview, - v3d->retopo_view_data->mats.projection, - (GLint *)v3d->retopo_view_data->mats.viewport, &ux, &uy, &uz); - p->loc.x= ux; - p->loc.y= uy; - } - } - } -} - -void retopo_force_update() -{ - RetopoPaintData *rpd= get_retopo_paint_data(); - - if(rpd) { - View3D *vd= rpd->paint_v3d; - - if(vd) { - if(vd->depths) vd->depths->damaged= 1; - retopo_queue_updates(vd); - if(retopo_mesh_paint_check() && vd->retopo_view_data) - allqueue(REDRAWVIEW3D, 0); - } - } -} - -/* Returns 1 if event should be processed by caller, 0 otherwise */ -char retopo_paint(const unsigned short event) -{ - RetopoPaintData *rpd= get_retopo_paint_data(); - - if(!event) return 1; - if(rpd) { - RetopoPaintLine *l; - short mouse[2]; - char lbut= get_mbut() & (U.flag & USER_LMOUSESELECT ? R_MOUSE : L_MOUSE); - - if(rpd->paint_v3d && rpd->paint_v3d!=G.vd) return 1; - - getmouseco_areawin(mouse); - - if(rpd->in_drag && !lbut) { /* End drag */ - rpd->in_drag= 0; - - switch(G.scene->toolsettings->retopo_paint_tool) { - case RETOPO_PEN: - break; - case RETOPO_LINE: - retopo_paint_add_line(rpd, mouse); - break; - case RETOPO_ELLIPSE: - retopo_paint_add_ellipse(rpd, mouse); - break; - } - BIF_undo_push("Retopo paint"); - } - - switch(event) { - case MOUSEX: - case MOUSEY: - switch(G.scene->toolsettings->retopo_paint_tool) { - case RETOPO_PEN: - if(rpd->in_drag && rpd->lines.last) { - l= rpd->lines.last; - - if(((RetopoPaintPoint*)l->points.last)->loc.x != mouse[0] || - ((RetopoPaintPoint*)l->points.last)->loc.y != mouse[1]) { - add_rppoint(l,mouse[0],mouse[1]); - } - rpd->nearest.line= NULL; - - break; - } else if(G.scene->toolsettings->retopo_hotspot) { /* Find nearest endpoint */ - float sdist; - RetopoPaintLine *l= rpd->lines.first; - RetopoPaintSel n= {NULL,NULL,l,1}; - sdist= rpd->seldist + 10; - for(l= rpd->lines.first; l; l= l->next) { - float tdist; - RetopoPaintPoint *p1= l->points.first, *p2= l->points.last; - - tdist= sqrt(pow(mouse[0] - p1->loc.x,2)+pow(mouse[1] - p1->loc.y,2)); - if(tdist < sdist && tdist < rpd->seldist) { - sdist= tdist; - n.line= l; - n.first= 1; - } else { - tdist= sqrt(pow(mouse[0] - p2->loc.x,2)+pow(mouse[1] - p2->loc.y,2)); - if(tdist < sdist && tdist < rpd->seldist) { - sdist= tdist; - n.line= l; - n.first= 0; - } - } - } - - if(sdist < rpd->seldist) - rpd->nearest= n; - else rpd->nearest.line= NULL; - } - break; - case RETOPO_LINE: - break; - case RETOPO_ELLIPSE: - break; - } - allqueue(REDRAWVIEW3D,0); - break; - case RETKEY: - case PADENTER: - retopo_paint_apply(); - case ESCKEY: - G.scene->toolsettings->retopo_mode&= ~RETOPO_PAINT; - retopo_free_paint(); - - BIF_undo_push("Retopo toggle"); - - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); - break; - case CKEY: - retopo_paint_toggle_cyclic(rpd->lines.last); - BIF_undo_push("Retopo toggle cyclic"); - allqueue(REDRAWVIEW3D, 0); - break; - case EKEY: - G.scene->toolsettings->retopo_paint_tool= RETOPO_ELLIPSE; - allqueue(REDRAWVIEW3D, 1); - break; - case HKEY: - G.scene->toolsettings->retopo_hotspot= !G.scene->toolsettings->retopo_hotspot; - allqueue(REDRAWVIEW3D, 1); - break; - case LKEY: - G.scene->toolsettings->retopo_paint_tool= RETOPO_LINE; - allqueue(REDRAWVIEW3D, 1); - break; - case PKEY: - G.scene->toolsettings->retopo_paint_tool= RETOPO_PEN; - allqueue(REDRAWVIEW3D, 1); - break; - case XKEY: - case DELKEY: - l= rpd->lines.last; - if(l) { - BLI_freelistN(&l->points); - BLI_freelistN(&l->hitlist); - BLI_freelinkN(&rpd->lines, l); - if(rpd->nearest.line == l) - rpd->nearest.line= NULL; - BIF_undo_push("Erase line"); - allqueue(REDRAWVIEW3D, 0); - } - break; - case LEFTMOUSE: - if(!rpd->in_drag) { /* Start new drag */ - rpd->in_drag= 1; - - if(!rpd->paint_v3d) - rpd->paint_v3d= G.vd; - - /* Location of mouse down */ - rpd->sloc[0]= mouse[0]; - rpd->sloc[1]= mouse[1]; - - switch(G.scene->toolsettings->retopo_paint_tool) { - case RETOPO_PEN: - if(rpd->nearest.line) { - RetopoPaintPoint *p, *pt; - int i; - - BLI_remlink(&rpd->lines,rpd->nearest.line); - BLI_addtail(&rpd->lines,rpd->nearest.line); - - /* Check if we need to reverse the line */ - if(rpd->nearest.first) { - for(p= rpd->nearest.line->points.first; p; p= p->prev) { - pt= p->prev; - p->prev= p->next; - p->next= pt; - } - pt= rpd->nearest.line->points.first; - rpd->nearest.line->points.first= rpd->nearest.line->points.last; - rpd->nearest.line->points.last= pt; - - /* Reverse indices */ - i= 0; - for(p= rpd->nearest.line->points.first; p; p= p->next) - p->index= i++; - } - } else { - add_rpline(rpd); - add_rppoint(rpd->lines.last,mouse[0],mouse[1]); - } - break; - case RETOPO_LINE: - break; - case RETOPO_ELLIPSE: - break; - } - allqueue(REDRAWVIEW3D, 0); - } - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - case PAD0: case PAD1: case PAD2: case PAD3: case PAD4: - case PAD5: case PAD6: case PAD7: case PAD8: case PAD9: - case PADMINUS: case PADPLUSKEY: - return 1; - } - return 0; - } else return 1; -} -void retopo_draw_paint_lines() -{ - RetopoPaintData *rpd= get_retopo_paint_data(); - - if(rpd && rpd->paint_v3d==G.vd) { - RetopoPaintLine *l; - RetopoPaintPoint *p; - - glColor3f(0,0,0); - glLineWidth(2); - - /* Draw existing lines */ - for(l= rpd->lines.first; l; l= l->next) { - if(l==rpd->lines.last) - glColor3f(0.3,0,0); - glBegin(l->cyclic?GL_LINE_LOOP:GL_LINE_STRIP); - for(p= l->points.first; p; p= p->next) { - glVertex2s(p->loc.x,p->loc.y); - } - glEnd(); - } - - /* Draw ellipse */ - if(G.scene->toolsettings->retopo_paint_tool==RETOPO_ELLIPSE && rpd->in_drag) { - short mouse[2]; - getmouseco_areawin(mouse); - - setlinestyle(3); - fdrawXORellipse(rpd->sloc[0],rpd->sloc[1],abs(mouse[0]-rpd->sloc[0]),abs(mouse[1]-rpd->sloc[1])); - setlinestyle(0); - } - else if(G.scene->toolsettings->retopo_paint_tool==RETOPO_LINE && rpd->in_drag) { - short mouse[2]; - getmouseco_areawin(mouse); - - setlinestyle(3); - sdrawXORline(rpd->sloc[0],rpd->sloc[1],mouse[0],mouse[1]); - setlinestyle(0); - } - else if(rpd->nearest.line) { /* Draw selection */ - RetopoPaintPoint *p= rpd->nearest.first ? rpd->nearest.line->points.first : - rpd->nearest.line->points.last; - if(p) - fdrawXORcirc(p->loc.x, p->loc.y, rpd->seldist); - } - - glLineWidth(1); - } -} - -RetopoPaintData *retopo_paint_data_copy(RetopoPaintData *rpd) -{ - RetopoPaintData *copy; - RetopoPaintLine *l, *lcp; - RetopoPaintPoint *p, *pcp; - - if(!rpd) return NULL; - - copy= MEM_mallocN(sizeof(RetopoPaintData),"RetopoPaintDataCopy"); - - memcpy(copy,rpd,sizeof(RetopoPaintData)); - copy->lines.first= copy->lines.last= NULL; - for(l= rpd->lines.first; l; l= l->next) { - lcp= MEM_mallocN(sizeof(RetopoPaintLine),"RetopoPaintLineCopy"); - memcpy(lcp,l,sizeof(RetopoPaintLine)); - BLI_addtail(©->lines,lcp); - - lcp->hitlist.first= lcp->hitlist.last= NULL; - lcp->points.first= lcp->points.last= NULL; - for(p= l->points.first; p; p= p->next) { - pcp= MEM_mallocN(sizeof(RetopoPaintPoint),"RetopoPaintPointCopy"); - memcpy(pcp,p,sizeof(RetopoPaintPoint)); - BLI_addtail(&lcp->points,pcp); - } - } - - copy->intersections.first= copy->intersections.last= NULL; - - return copy; -} - -char retopo_mesh_check() -{ - return G.obedit && G.obedit->type==OB_MESH && (G.scene->toolsettings->retopo_mode & RETOPO); -} -char retopo_curve_check() -{ - return G.obedit && (G.obedit->type==OB_CURVE || - G.obedit->type==OB_SURF) && (((Curve*)G.obedit->data)->flag & CU_RETOPO); -} - -void retopo_toggle(void *j1,void *j2) -{ - if(retopo_mesh_check() || retopo_curve_check()) { - if(G.vd->depths) G.vd->depths->damaged= 1; - retopo_queue_updates(G.vd); - } else { - if(G.editMesh && G.scene->toolsettings->retopo_mode & RETOPO_PAINT) - retopo_end_okee(); - } - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); -} - -void retopo_do_2d(View3D *v3d, double proj[2], float *v, char adj) -{ - /* Check to make sure vert is visible in window */ - if(proj[0]>0 && proj[1]>0 && proj[0] < v3d->depths->w && proj[1] < v3d->depths->h) { - float depth= v3d->depths->depths[((int)proj[1])*v3d->depths->w+((int)proj[0])]; - double px, py, pz; - - /* Don't modify the point if it'll be mapped to the background */ - if(depth==v3d->depths->depth_range[1]) { - if(adj) { - /* Find the depth of (0,0,0); */ - gluProject(0,0,0,v3d->retopo_view_data->mats.modelview, - v3d->retopo_view_data->mats.projection, - (GLint *)v3d->retopo_view_data->mats.viewport,&px,&py,&pz); - depth= pz; - } - else return; - } - - /* Find 3D location with new depth (unproject) */ - gluUnProject(proj[0],proj[1],depth,v3d->retopo_view_data->mats.modelview, - v3d->retopo_view_data->mats.projection, - (GLint *)v3d->retopo_view_data->mats.viewport,&px,&py,&pz); - - v[0]= px; - v[1]= py; - v[2]= pz; - } -} - -void retopo_do_vert(View3D *v3d, float *v) -{ - double proj[3]; - - /* Find 2D location (project) */ - gluProject(v[0],v[1],v[2],v3d->retopo_view_data->mats.modelview,v3d->retopo_view_data->mats.projection, - (GLint *)v3d->retopo_view_data->mats.viewport,&proj[0],&proj[1],&proj[2]); - - retopo_do_2d(v3d,proj,v,0); -} - -void retopo_do_all() -{ - RetopoViewData *rvd= G.vd->retopo_view_data; - if(retopo_mesh_check()) { - if(rvd) { - EditMesh *em= G.editMesh; - EditVert *eve; - - /* Apply retopo to all selected vertices */ - eve= em->verts.first; - while(eve) { - if(eve->f & SELECT) - retopo_do_vert(G.vd,eve->co); - eve= eve->next; - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } - else if(retopo_curve_check()) { - if(rvd) { - extern ListBase editNurb; - Nurb *nu; - BPoint *bp; - int i, j; - - for(nu= editNurb.first; nu; nu= nu->next) - { - if(nu->type & CU_2D) { - /* Can't wrap a 2D curve onto a 3D surface */ - } - else if(nu->type & CU_BEZIER) { - for(i=0; ipntsu; ++i) { - if(nu->bezt[i].f1 & 1) - retopo_do_vert(G.vd, nu->bezt[i].vec[0]); - if(nu->bezt[i].f2 & 1) - retopo_do_vert(G.vd, nu->bezt[i].vec[1]); - if(nu->bezt[i].f3 & 1) - retopo_do_vert(G.vd, nu->bezt[i].vec[2]); - } - } - else { - bp= nu->bp; - for(i=0; ipntsv; ++i) { - for(j=0; jpntsu; ++j, ++bp) { - if(bp->f1 & SELECT) - retopo_do_vert(G.vd,bp->vec); - } - } - } - - testhandlesNurb(nu); - } - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } -} - -void retopo_do_all_cb(void *j1, void *j2) -{ - /* This is called from editbuttons, so user needs to specify view */ - if(!select_area(SPACE_VIEW3D)) return; - - if(G.vd->drawtype == OB_WIRE) { - error("Cannot apply retopo in wireframe mode"); - return; - } - - retopo_do_all(); - BIF_undo_push("Retopo all"); -} - -void retopo_queue_updates(View3D *v3d) -{ - if(retopo_mesh_check() || retopo_curve_check()) { - if(!v3d->retopo_view_data) - v3d->retopo_view_data= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData"); - - v3d->retopo_view_data->queue_matrix_update= 1; - - allqueue(REDRAWVIEW3D, 0); - } -} - -void retopo_matrix_update(View3D *v3d) -{ - RetopoPaintData *rpd= get_retopo_paint_data(); - if((retopo_mesh_check() || retopo_curve_check()) && (!rpd || rpd->paint_v3d==v3d)) { - RetopoViewData *rvd= v3d->retopo_view_data; - if(!rvd) { - rvd= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData"); - v3d->retopo_view_data= rvd; - rvd->queue_matrix_update= 1; - } - if(rvd && rvd->queue_matrix_update) { - bgl_get_mats(&rvd->mats); - - rvd->queue_matrix_update= 0; - } - } -} - -void retopo_free_view_data(View3D *v3d) -{ - if(v3d->retopo_view_data) { - MEM_freeN(v3d->retopo_view_data); - v3d->retopo_view_data= NULL; - } -} - -void retopo_paint_debug_print(RetopoPaintData *rpd) -{ - RetopoPaintLine *l; - RetopoPaintPoint *p; - - for(l= rpd->lines.first; l; l= l->next) { - printf("Line:\n"); - for(p= l->points.first; p; p= p->next) { - printf(" Point(%d: %d,%d)\n",p->index,p->loc.x,p->loc.y); - } - } - - fflush(stdout); -} diff --git a/source/blender/src/scrarea.c b/source/blender/src/scrarea.c deleted file mode 100644 index c9076a105a8..00000000000 --- a/source/blender/src/scrarea.c +++ /dev/null @@ -1,69 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "BIF_scrarea.h" - -#ifdef HAVE_CONFIG_H -#include -#endif - -void *scrarea_find_space_of_type(ScrArea *sa, int type) -{ - SpaceLink *sl; - - for (sl= sa->spacedata.first; sl; sl= sl->next) - if (sl->spacetype==type) - return (void*) sl; - - return 0; -} - -int scrarea_get_win_x(ScrArea *sa) -{ - return sa->winrct.xmin; -} - -int scrarea_get_win_y(ScrArea *sa) -{ - return sa->winrct.ymin; -} - -int scrarea_get_win_width(ScrArea *sa) -{ - return sa->winx; -} - -int scrarea_get_win_height(ScrArea *sa) -{ - return sa->winy; -} diff --git a/source/blender/src/screendump.c b/source/blender/src/screendump.c deleted file mode 100644 index 4c1cda52da3..00000000000 --- a/source/blender/src/screendump.c +++ /dev/null @@ -1,161 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * Making screendumps. - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_material.h" -#include "BKE_sca.h" - -#include "BIF_gl.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_toets.h" -#include "BIF_interface.h" -#include "BIF_writeimage.h" - -#include "BSE_filesel.h" - -#include "mydevice.h" - -static unsigned int *dumprect=0; -static int dumpsx, dumpsy; - -void write_screendump(char *name) -{ - ImBuf *ibuf; - - if(dumprect) { - - strcpy(G.ima, name); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - - /* BKE_add_image_extension() checks for if extension was already set */ - if(G.scene->r.scemode & R_EXTENSION) - if(strlen(name)r.imtype); - - if(saveover(name)) { - waitcursor(1); - - ibuf= IMB_allocImBuf(dumpsx, dumpsy, 24, 0, 0); - ibuf->rect= dumprect; - - if(G.scene->r.planes == 8) IMB_cspace(ibuf, rgb_to_bw); - - BKE_write_ibuf(ibuf, name, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); - - IMB_freeImBuf(ibuf); - - waitcursor(0); - } - MEM_freeN(dumprect); - dumprect= NULL; - } -} - -/* get dump from frontbuffer */ -void BIF_screendump(int fscreen) -{ - extern int uiIsMenu(int *x, int *y, int *sizex, int *sizey); - int ismenu; - static int wasmenu= 0; - int x=0, y=0; - char imstr[64]; - - /* this sets dumpsx/y to zero if ismenu==0 */ - ismenu= uiIsMenu(&x, &y, &dumpsx, &dumpsy); - - if(wasmenu && !ismenu) { - save_image_filesel_str(imstr); - strcat(imstr, " (Menu)"); - activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); - wasmenu= 0; - return; - } - - if(dumprect) MEM_freeN(dumprect); - dumprect= NULL; - - if((G.qual & LR_SHIFTKEY) || fscreen) { /* full screen */ - x= 0; - y= 0; - - dumpsx= G.curscreen->sizex; - dumpsy= G.curscreen->sizey; - - } - else { - if(ismenu==0) { /* a window */ - //int win= mywinget(); - - //bwin_getsuborigin(win, &x, &y); - //bwin_getsize(win, &dumpsx, &dumpsy); - x= curarea->totrct.xmin; - y= curarea->totrct.ymin; - dumpsx= curarea->totrct.xmax-x; - dumpsy= curarea->totrct.ymax-y; - } - } - - if (dumpsx && dumpsy) { - - dumprect= MEM_mallocN(sizeof(int)*dumpsx*dumpsy, "dumprect"); - glReadBuffer(GL_FRONT); - glReadPixels(x, y, dumpsx, dumpsy, GL_RGBA, GL_UNSIGNED_BYTE, dumprect); - glFinish(); - glReadBuffer(GL_BACK); - - if(ismenu==0) { - wasmenu= 0; - save_image_filesel_str(imstr); - activate_fileselect(FILE_SPECIAL, imstr, G.ima, write_screendump); - } - else wasmenu= 1; - } - -} diff --git a/source/blender/src/sculptmode-stroke.c b/source/blender/src/sculptmode-stroke.c deleted file mode 100644 index 2f8dac2818c..00000000000 --- a/source/blender/src/sculptmode-stroke.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2007 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Storage and manipulation of sculptmode brush strokes. - * - */ - -#include "MEM_guardedalloc.h" -#include "DNA_listBase.h" -#include "DNA_scene_types.h" -#include "BLI_blenlib.h" -#include "BIF_gl.h" -#include "BDR_sculptmode.h" -#include - -/* Temporary storage of input stroke control points */ -typedef struct StrokePoint { - struct StrokePoint *next, *prev; - short x, y; -} StrokePoint; -typedef struct SculptStroke { - short (*loc)[2]; - int max; - int index; - float length; - ListBase final; - StrokePoint *final_mem; - float offset; -} SculptStroke; - -void sculpt_stroke_new(const int max) -{ - SculptSession *ss = sculpt_session(); - - ss->stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke"); - ss->stroke->loc = MEM_callocN(sizeof(short) * 2 * max, "SculptStroke.loc"); - ss->stroke->max = max; - ss->stroke->index = -1; -} - -void sculpt_stroke_free() -{ - SculptSession *ss = sculpt_session(); - if(ss && ss->stroke) { - if(ss->stroke->loc) MEM_freeN(ss->stroke->loc); - if(ss->stroke->final_mem) MEM_freeN(ss->stroke->final_mem); - - MEM_freeN(ss->stroke); - ss->stroke = NULL; - } -} - -void sculpt_stroke_add_point(const short x, const short y) -{ - SculptStroke *stroke = sculpt_session()->stroke; - const int next = stroke->index + 1; - - if(stroke->index == -1) { - stroke->loc[0][0] = x; - stroke->loc[0][1] = y; - stroke->index = 0; - } - else if(next < stroke->max) { - const int dx = x - stroke->loc[stroke->index][0]; - const int dy = y - stroke->loc[stroke->index][1]; - stroke->loc[next][0] = x; - stroke->loc[next][1] = y; - stroke->length += sqrt(dx*dx + dy*dy); - stroke->index = next; - } -} - -void sculpt_stroke_smooth(SculptStroke *stroke) -{ - /* Apply smoothing (exclude the first and last points)*/ - StrokePoint *p = stroke->final.first; - if(p && p->next && p->next->next) { - for(p = p->next->next; p && p->next && p->next->next; p = p->next) { - p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1; - p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1; - } - } -} - -static void sculpt_stroke_create_final() -{ - SculptStroke *stroke = sculpt_session()->stroke; - - if(stroke) { - StrokePoint *p, *pnext; - int i; - - /* Copy loc into final */ - if(stroke->final_mem) - MEM_freeN(stroke->final_mem); - stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final"); - stroke->final.first = stroke->final.last = NULL; - for(i = 0; i <= stroke->index; ++i) { - p = &stroke->final_mem[i]; - p->x = stroke->loc[i][0]; - p->y = stroke->loc[i][1]; - BLI_addtail(&stroke->final, p); - } - - /* Remove shortest edges */ - if(stroke->final.first) { - for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) { - const int dx = p->x - p->prev->x; - const int dy = p->y - p->prev->y; - const float len = sqrt(dx*dx + dy*dy); - pnext = p->next; - if(len < 10) { - BLI_remlink(&stroke->final, p); - } - } - } - - sculpt_stroke_smooth(stroke); - - /* Subdivide edges */ - for(p = stroke->final.first; p && p->next; p = pnext) { - StrokePoint *np = &stroke->final_mem[i++]; - - pnext = p->next; - np->x = (p->x + p->next->x) / 2; - np->y = (p->y + p->next->y) / 2; - BLI_insertlink(&stroke->final, p, np); - } - - sculpt_stroke_smooth(stroke); - } -} - -float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2) -{ - int dx = p2->x - p1->x; - int dy = p2->y - p1->y; - return sqrt(dx*dx + dy*dy); -} - -float sculpt_stroke_final_length(SculptStroke *stroke) -{ - StrokePoint *p; - float len = 0; - for(p = stroke->final.first; p && p->next; ++p) - len += sculpt_stroke_seglen(p, p->next); - return len; -} - -/* If partial is nonzero, cuts off apply after that length has been processed */ -static StrokePoint *sculpt_stroke_apply_generic(SculptStroke *stroke, struct EditData *e, const int partial) -{ - const int sdspace = sculpt_data()->spacing; - const short spacing = sdspace > 0 ? sdspace : 2; - const int dots = sculpt_stroke_final_length(stroke) / spacing; - int i; - StrokePoint *p = stroke->final.first; - float startloc = stroke->offset; - - for(i = 0; i < dots && p && p->next; ++i) { - const float dotloc = spacing * i; - short co[2]; - float len = sculpt_stroke_seglen(p, p->next); - float u, v; - - /* Find edge containing dot */ - while(dotloc > startloc + len && p && p->next && p->next->next) { - p = p->next; - startloc += len; - len = sculpt_stroke_seglen(p, p->next); - } - - if(!p || !p->next || dotloc > startloc + len) - break; - - if(partial && startloc > partial) { - /* Calculate offset for next stroke segment */ - stroke->offset = startloc + len - dotloc; - break; - } - - u = (dotloc - startloc) / len; - v = 1 - u; - - co[0] = p->x*v + p->next->x*u; - co[1] = p->y*v + p->next->y*u; - - do_symmetrical_brush_actions(e, co, NULL); - } - - return p ? p->next : NULL; -} - -void sculpt_stroke_apply(struct EditData *e) -{ - SculptStroke *stroke = sculpt_session()->stroke; - /* TODO: make these values user-modifiable? */ - const int partial_len = 100; - const int min_len = 200; - - if(stroke) { - sculpt_stroke_create_final(); - - if(sculpt_stroke_final_length(stroke) > min_len) { - StrokePoint *p = sculpt_stroke_apply_generic(stroke, e, partial_len); - - /* Replace remaining values in stroke->loc with remaining stroke->final values */ - stroke->index = -1; - stroke->length = 0; - for(; p; p = p->next) { - ++stroke->index; - stroke->loc[stroke->index][0] = p->x; - stroke->loc[stroke->index][1] = p->y; - if(p->next) { - stroke->length += sculpt_stroke_seglen(p, p->next); - } - } - } - } -} - -void sculpt_stroke_apply_all(struct EditData *e) -{ - SculptStroke *stroke = sculpt_session()->stroke; - - sculpt_stroke_create_final(); - - if(stroke) { - sculpt_stroke_apply_generic(stroke, e, 0); - } -} - -void sculpt_stroke_draw() -{ - SculptStroke *stroke = sculpt_session()->stroke; - - if(stroke) { - StrokePoint *p; - - /* Draws the original stroke */ - /*glColor3f(1, 0, 0); - glBegin(GL_LINE_STRIP); - for(i = 0; i <= stroke->index; ++i) - glVertex2s(stroke->loc[i][0], stroke->loc[i][1]); - glEnd();*/ - - /* Draws the smoothed stroke */ - glColor3f(0, 1, 0); - glBegin(GL_LINE_STRIP); - for(p = stroke->final.first; p; p = p->next) - glVertex2s(p->x, p->y); - glEnd(); - } -} diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c deleted file mode 100644 index 010bf6f746c..00000000000 --- a/source/blender/src/sculptmode.c +++ /dev/null @@ -1,2267 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2006 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Implements the Sculpt Mode tools - * - * BDR_sculptmode.h - * - */ - -#include "GHOST_Types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_dynstr.h" - -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_image_types.h" -#include "DNA_key_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_texture_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" -#include "DNA_color_types.h" - -#include "BKE_customdata.h" -#include "BKE_DerivedMesh.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_key.h" -#include "BKE_library.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" -#include "BKE_colortools.h" - -#include "BIF_editkey.h" -#include "BIF_editview.h" -#include "BIF_glutil.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BDR_drawobject.h" -#include "BDR_sculptmode.h" - -#include "BSE_drawview.h" -#include "BSE_edit.h" -#include "BSE_view.h" - -#include "IMB_imbuf_types.h" - -#include "blendef.h" -#include "multires.h" -#include "mydevice.h" - -#include "RE_render_ext.h" -#include "RE_shader_ext.h" /*for multitex_ext*/ - -#include -#include -#include - -/* Number of vertices to average in order to determine the flatten distance */ -#define FLATTEN_SAMPLE_SIZE 10 - -/* ===== STRUCTS ===== - * - */ - -/* Used by vertex_users to store face indices in a list */ -typedef struct IndexNode { - struct IndexNode* next,* prev; - int Index; -} IndexNode; - - -/* ActiveData stores an Index into the mvert array of Mesh, plus Fade, which - stores how far the vertex is from the brush center, scaled to the range [0,1]. */ -typedef struct ActiveData { - struct ActiveData *next, *prev; - unsigned int Index; - float Fade; - float dist; -} ActiveData; - -typedef struct GrabData { - char firsttime; - ListBase active_verts[8]; - unsigned char index; - vec3f delta, delta_symm; - float depth; -} GrabData; - -typedef struct EditData { - vec3f center; - float size; - char flip; - short mouse[2]; - - /* Adjust brush strength along each axis - to adjust for object scaling */ - float scale[3]; - - /* View normals */ - vec3f up, right, out; - - GrabData *grabdata; - float *layer_disps; - vec3f *layer_store; - - char clip[3]; - float cliptol[3]; - - char symm; -} EditData; - -typedef struct RectNode { - struct RectNode *next, *prev; - rcti r; -} RectNode; - -/* Used to store to 2D screen coordinates of each vertex in the mesh. */ -typedef struct ProjVert { - short co[2]; - - /* Used to mark whether a vertex is inside a rough bounding box - containing the brush. */ - char inside; -} ProjVert; - -static ProjVert *projverts= NULL; -static Object *active_ob= NULL; - -SculptData *sculpt_data(void) -{ - return &G.scene->sculptdata; -} - -void sculpt_init_session(void); -void init_editdata(EditData *e, short *, short *); -void sculpt_undo_push(const short); - -SculptSession *sculpt_session(void) -{ - if(!sculpt_data()->session) - sculpt_init_session(); - return sculpt_data()->session; -} - -/* ===== MEMORY ===== - * - * Allocate/initialize/free data - */ - -// Default curve approximates 0.5 * (cos(pi * x) + 1), with 0 <= x <= 1; -void sculpt_reset_curve(SculptData *sd) -{ - CurveMap *cm = NULL; - - if(!sd->cumap) - sd->cumap = curvemapping_add(1, 0, 0, 1, 1); - - cm = sd->cumap->cm; - - if(cm->curve) - MEM_freeN(cm->curve); - cm->curve= MEM_callocN(6*sizeof(CurveMapPoint), "curve points"); - cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE; - cm->totpoint= 6; - cm->curve[0].x= 0; - cm->curve[0].y= 1; - cm->curve[1].x= 0.1; - cm->curve[1].y= 0.97553; - cm->curve[2].x= 0.3; - cm->curve[2].y= 0.79389; - cm->curve[3].x= 0.9; - cm->curve[3].y= 0.02447; - cm->curve[4].x= 0.7; - cm->curve[4].y= 0.20611; - cm->curve[5].x= 1; - cm->curve[5].y= 0; -} - -/* Initialize 'permanent' sculpt data that is saved with file kept after - switching out of sculptmode. */ -void sculptmode_init(Scene *sce) -{ - SculptData *sd; - - if(!sce) { - error("Unable to initialize sculptmode: bad scene"); - return; - } - - sd= &sce->sculptdata; - - if(sd->cumap) - curvemapping_free(sd->cumap); - - memset(sd, 0, sizeof(SculptData)); - - sd->drawbrush.size = sd->smoothbrush.size = sd->pinchbrush.size = - sd->inflatebrush.size = sd->grabbrush.size = - sd->layerbrush.size = sd->flattenbrush.size = 50; - sd->drawbrush.strength = sd->smoothbrush.strength = - sd->pinchbrush.strength = sd->inflatebrush.strength = - sd->grabbrush.strength = sd->layerbrush.strength = - sd->flattenbrush.strength = 25; - sd->drawbrush.dir = sd->pinchbrush.dir = sd->inflatebrush.dir = sd->layerbrush.dir= 1; - sd->drawbrush.airbrush = sd->smoothbrush.airbrush = - sd->pinchbrush.airbrush = sd->inflatebrush.airbrush = - sd->layerbrush.airbrush = sd->flattenbrush.airbrush = 0; - sd->drawbrush.view= 0; - sd->brush_type= DRAW_BRUSH; - sd->texact= -1; - sd->texfade= 1; - sd->averaging= 1; - sd->texsep= 0; - sd->texrept= SCULPTREPT_DRAG; - sd->flags= SCULPT_DRAW_BRUSH; - sd->tablet_size=3; - sd->tablet_strength=10; - sd->rake=0; - sculpt_reset_curve(sd); -} - -void sculptmode_free_session(Scene *); -void sculpt_init_session(void) -{ - if(sculpt_data()->session) - sculptmode_free_session(G.scene); - sculpt_data()->session= MEM_callocN(sizeof(SculptSession), "SculptSession"); -} - -void sculptmode_free_vertexusers(SculptSession *ss) -{ - if(ss && ss->vertex_users){ - MEM_freeN(ss->vertex_users); - MEM_freeN(ss->vertex_users_mem); - ss->vertex_users= NULL; - ss->vertex_users_mem= NULL; - ss->vertex_users_size= 0; - } -} - -void sculptmode_propset_end(SculptSession *ss, int); -void sculptmode_free_session(Scene *sce) -{ - SculptSession *ss= sce->sculptdata.session; - if(ss) { - sculptmode_free_vertexusers(ss); - if(ss->texcache) - MEM_freeN(ss->texcache); - sculptmode_propset_end(ss, 1); - MEM_freeN(ss); - sce->sculptdata.session= NULL; - } -} - -void sculptmode_free_all(Scene *sce) -{ - SculptData *sd= &sce->sculptdata; - int a; - - sculptmode_free_session(sce); - - if(projverts) { - MEM_freeN(projverts); - projverts = NULL; - } - - for(a=0; amtex[a]; - if(mtex) { - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - } - } - - curvemapping_free(sd->cumap); - sd->cumap = NULL; -} - -/* vertex_users is an array of Lists that store all the faces that use a - particular vertex. vertex_users is in the same order as mesh.mvert */ -void calc_vertex_users() -{ - SculptSession *ss= sculpt_session(); - int i,j; - IndexNode *node= NULL; - Mesh *me= get_mesh(OBACT); - - sculptmode_free_vertexusers(ss); - - /* For efficiency, use vertex_users_mem as a memory pool (may be larger - than necessary if mesh has triangles, but only one alloc is needed.) */ - ss->vertex_users= MEM_callocN(sizeof(ListBase) * me->totvert, "vertex_users"); - ss->vertex_users_size= me->totvert; - ss->vertex_users_mem= MEM_callocN(sizeof(IndexNode)*me->totface*4, "vertex_users_mem"); - node= ss->vertex_users_mem; - - /* Find the users */ - for(i=0; itotface; ++i){ - for(j=0; j<(me->mface[i].v4?4:3); ++j, ++node) { - node->Index=i; - BLI_addtail(&ss->vertex_users[((unsigned int*)(&me->mface[i]))[j]], node); - } - } -} - -/* ===== INTERFACE ===== - */ - -void sculptmode_rem_tex(void *junk0,void *junk1) -{ - MTex *mtex= G.scene->sculptdata.mtex[G.scene->sculptdata.texact]; - if(mtex) { - SculptSession *ss= sculpt_session(); - if(mtex->tex) mtex->tex->id.us--; - MEM_freeN(mtex); - G.scene->sculptdata.mtex[G.scene->sculptdata.texact]= NULL; - /* Clear brush preview */ - if(ss->texcache) { - MEM_freeN(ss->texcache); - ss->texcache= NULL; - } - BIF_undo_push("Unlink brush texture"); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWOOPS, 0); - } -} - -/* ===== OPENGL ===== - * - * Simple functions to get data from the GL - */ - -/* Store the modelview and projection matrices and viewport. */ -void init_sculptmatrices() -{ - SculptSession *ss= sculpt_session(); - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glMultMatrixf(OBACT->obmat); - - bgl_get_mats(&ss->mats); - - glPopMatrix(); - -} - -/* Uses window coordinates (x,y) to find the depth in the GL depth buffer. If - available, G.vd->depths is used so that the brush doesn't sculpt on top of - itself (G.vd->depths is only updated at the end of a brush stroke.) */ -float get_depth(short x, short y) -{ - float depth; - - if(x<0 || y<0) return 1; - if(x>=curarea->winx || y>=curarea->winy) return 1; - - if(G.vd->depths && xdepths->w && ydepths->h) - return G.vd->depths->depths[y*G.vd->depths->w+x]; - - x+= curarea->winrct.xmin; - y+= curarea->winrct.ymin; - - glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth); - - return depth; -} - -/* Uses window coordinates (x,y) and depth component z to find a point in - modelspace */ -vec3f unproject(const short x, const short y, const float z) -{ - SculptSession *ss= sculpt_session(); - double ux, uy, uz; - vec3f p; - - gluUnProject(x,y,z, ss->mats.modelview, ss->mats.projection, - (GLint *)ss->mats.viewport, &ux, &uy, &uz ); - p.x= ux; - p.y= uy; - p.z= uz; - return p; -} - -/* Convert a point in model coordinates to 2D screen coordinates. */ -void project(const float v[3], short p[2]) -{ - SculptSession *ss= sculpt_session(); - double ux, uy, uz; - - gluProject(v[0],v[1],v[2], ss->mats.modelview, ss->mats.projection, - (GLint *)ss->mats.viewport, &ux, &uy, &uz); - p[0]= ux; - p[1]= uy; -} - -/* ===== Sculpting ===== - * - */ - -/* Return modified brush size. Uses current tablet pressure (if available) to - shrink the brush. Skipped for grab brush because only the first mouse down - size is used, which is small if the user has just touched the pen to the - tablet */ -char brush_size() -{ - const BrushData *b= sculptmode_brush(); - float size= b->size; - float pressure= get_pressure(); - short activedevice= get_activedevice(); - - if(sculpt_data()->brush_type!=GRAB_BRUSH) { - const float size_factor= G.scene->sculptdata.tablet_size / 10.0f; - if(ELEM(activedevice, DEV_STYLUS, DEV_ERASER)) - size*= G.scene->sculptdata.tablet_size==0?1: - (1-size_factor) + pressure*size_factor; - } - - return size; -} - -/* Return modified brush strength. Includes the direction of the brush, positive - values pull vertices, negative values push. Uses tablet pressure and a - special multiplier found experimentally to scale the strength factor. */ -float brush_strength(EditData *e) -{ - const BrushData* b= sculptmode_brush(); - float dir= b->dir==1 ? 1 : -1; - float pressure= 1; - short activedevice= get_activedevice(); - float flip= e->flip ? -1:1; - - const float strength_factor= G.scene->sculptdata.tablet_strength / 10.0f; - if(ELEM(activedevice, DEV_STYLUS, DEV_ERASER)) - pressure= G.scene->sculptdata.tablet_strength==0?1: - (1-strength_factor) + get_pressure()*strength_factor; - - /* Flip direction for eraser */ - if(activedevice==DEV_ERASER) - dir= -dir; - - switch(G.scene->sculptdata.brush_type){ - case DRAW_BRUSH: - case LAYER_BRUSH: - return b->strength / 5000.0f * dir * pressure * flip; - case SMOOTH_BRUSH: - return b->strength / 50.0f * pressure; - case PINCH_BRUSH: - return b->strength / 1000.0f * dir * pressure * flip; - case GRAB_BRUSH: - return 1; - case INFLATE_BRUSH: - return b->strength / 5000.0f * dir * pressure * flip; - case FLATTEN_BRUSH: - return b->strength / 500.0f * pressure; - default: - return 0; - } -} - -/* For clipping against a mirror modifier */ -void sculpt_clip(const EditData *e, float *co, const float val[3]) -{ - char i; - for(i=0; i<3; ++i) { - if(e->clip[i] && (fabs(co[i]) <= e->cliptol[i])) - co[i]= 0.0f; - else - co[i]= val[i]; - } -} - -/* Currently only for the draw brush; finds average normal for all active - vertices */ -vec3f calc_area_normal(const vec3f *outdir, const ListBase* active_verts) -{ - Mesh *me= get_mesh(OBACT); - vec3f area_normal= {0,0,0}; - ActiveData *node= active_verts->first; - const int view= sculpt_data()->brush_type==DRAW_BRUSH ? sculptmode_brush()->view : 0; - - while(node){ - area_normal.x+= me->mvert[node->Index].no[0]; - area_normal.y+= me->mvert[node->Index].no[1]; - area_normal.z+= me->mvert[node->Index].no[2]; - node= node->next; - } - Normalize(&area_normal.x); - if(outdir) { - area_normal.x= outdir->x * view + area_normal.x * (10-view); - area_normal.y= outdir->y * view + area_normal.y * (10-view); - area_normal.z= outdir->z * view + area_normal.z * (10-view); - } - Normalize(&area_normal.x); - return area_normal; -} -void do_draw_brush(const EditData *e, const ListBase* active_verts) -{ - Mesh *me= get_mesh(OBACT); - const vec3f area_normal= calc_area_normal(&e->out, active_verts); - ActiveData *node= active_verts->first; - - while(node){ - float *co= me->mvert[node->Index].co; - - const float val[3]= {co[0]+area_normal.x*node->Fade*e->scale[0], - co[1]+area_normal.y*node->Fade*e->scale[1], - co[2]+area_normal.z*node->Fade*e->scale[2]}; - - sculpt_clip(e, co, val); - - node= node->next; - } -} - -/* For the smooth brush, uses the neighboring vertices around vert to calculate - a smoothed location for vert. Skips corner vertices (used by only one - polygon.) */ -vec3f neighbor_average(const int vert) -{ - SculptSession *ss= sculpt_session(); - Mesh *me= get_mesh(OBACT); - int i, skip= -1, total=0; - IndexNode *node= ss->vertex_users[vert].first; - vec3f avg= {0,0,0}; - char ncount= BLI_countlist(&ss->vertex_users[vert]); - MFace *f; - - /* Don't modify corner vertices */ - if(ncount==1) { - VecCopyf(&avg.x, me->mvert[vert].co); - return avg; - } - - while(node){ - f= &me->mface[node->Index]; - - if(f->v4) { - skip= (f->v1==vert?2: - f->v2==vert?3: - f->v3==vert?0: - f->v4==vert?1:-1); - } - - for(i=0; i<(f->v4?4:3); ++i) { - if(i != skip && (ncount!=2 || BLI_countlist(&ss->vertex_users[(&f->v1)[i]]) <= 2)) { - VecAddf(&avg.x,&avg.x,me->mvert[(&f->v1)[i]].co); - ++total; - } - } - - node= node->next; - } - - if(total>0) { - avg.x/= total; - avg.y/= total; - avg.z/= total; - } - else - VecCopyf(&avg.x, me->mvert[vert].co); - - return avg; -} - -void do_smooth_brush(const EditData *e, const ListBase* active_verts) -{ - ActiveData *node= active_verts->first; - Mesh *me= get_mesh(OBACT); - - while(node){ - float *co= me->mvert[node->Index].co; - const vec3f avg= neighbor_average(node->Index); - const float val[3]= {co[0]+(avg.x-co[0])*node->Fade, - co[1]+(avg.y-co[1])*node->Fade, - co[2]+(avg.z-co[2])*node->Fade}; - sculpt_clip(e, co, val); - node= node->next; - } -} - -void do_pinch_brush(const EditData *e, const ListBase* active_verts) -{ - Mesh *me= get_mesh(OBACT); - ActiveData *node= active_verts->first; - - while(node) { - float *co= me->mvert[node->Index].co; - const float val[3]= {co[0]+(e->center.x-co[0])*node->Fade, - co[1]+(e->center.y-co[1])*node->Fade, - co[2]+(e->center.z-co[2])*node->Fade}; - sculpt_clip(e, co, val); - node= node->next; - } -} - -void do_grab_brush(EditData *e) -{ - Mesh *me= get_mesh(OBACT); - ActiveData *node= e->grabdata->active_verts[e->grabdata->index].first; - float add[3]; - - while(node) { - float *co= me->mvert[node->Index].co; - - VecCopyf(add, &e->grabdata->delta_symm.x); - VecMulf(add, node->Fade); - VecAddf(add, add, co); - sculpt_clip(e, co, add); - - node= node->next; - } -} - -void do_layer_brush(EditData *e, const ListBase *active_verts) -{ - Mesh *me= get_mesh(OBACT); - vec3f area_normal= calc_area_normal(NULL, active_verts); - ActiveData *node= active_verts->first; - const float bstr= brush_strength(e); - - while(node){ - float *disp= &e->layer_disps[node->Index]; - - if((bstr > 0 && *disp < bstr) || - (bstr < 0 && *disp > bstr)) { - float *co= me->mvert[node->Index].co; - - *disp+= node->Fade; - - if(bstr < 0) { - if(*disp < bstr) - *disp = bstr; - } else { - if(*disp > bstr) - *disp = bstr; - } - - { - const float val[3]= {e->layer_store[node->Index].x+area_normal.x * *disp*e->scale[0], - e->layer_store[node->Index].y+area_normal.y * *disp*e->scale[1], - e->layer_store[node->Index].z+area_normal.z * *disp*e->scale[2]}; - sculpt_clip(e, co, val); - } - } - - node= node->next; - } -} - -void do_inflate_brush(const EditData *e, const ListBase *active_verts) -{ - ActiveData *node= active_verts->first; - float add[3]; - Mesh *me= get_mesh(OBACT); - - while(node) { - float *co= me->mvert[node->Index].co; - short *no= me->mvert[node->Index].no; - - add[0]= no[0]/ 32767.0f; - add[1]= no[1]/ 32767.0f; - add[2]= no[2]/ 32767.0f; - VecMulf(add, node->Fade); - add[0]*= e->scale[0]; - add[1]*= e->scale[1]; - add[2]*= e->scale[2]; - VecAddf(add, add, co); - - sculpt_clip(e, co, add); - - node= node->next; - } -} - -void calc_flatten_center(Mesh *me, ActiveData *node, const EditData *e, float co[3]) -{ - ActiveData *outer[FLATTEN_SAMPLE_SIZE]; - int i; - - for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) - outer[i] = node; - - for(; node; node = node->next) { - for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) { - if(node->dist > outer[i]->dist) { - outer[i] = node; - break; - } - } - } - - co[0] = co[1] = co[2] = 0.0f; - for(i = 0; i < FLATTEN_SAMPLE_SIZE; ++i) - VecAddf(co, co, me->mvert[outer[i]->Index].co); - VecMulf(co, 1.0f / FLATTEN_SAMPLE_SIZE); -} - -void do_flatten_brush(const EditData *e, const ListBase *active_verts) -{ - Mesh *me= get_mesh(OBACT); - ActiveData *node= active_verts->first; - /* area_normal and cntr define the plane towards which vertices are squashed */ - vec3f area_normal= calc_area_normal(&e->out, active_verts); - float cntr[3]; - - calc_flatten_center(me, node, e, cntr); - - while(node){ - float *co= me->mvert[node->Index].co; - float p1[3], sub1[3], sub2[3], intr[3], val[3]; - - /* Find the intersection between squash-plane and vertex (along the area normal) */ - VecSubf(p1, co, &area_normal.x); - VecSubf(sub1, cntr, p1); - VecSubf(sub2, co, p1); - VecSubf(intr, co, p1); - VecMulf(intr, Inpf(&area_normal.x, sub1) / Inpf(&area_normal.x, sub2)); - VecAddf(intr, intr, p1); - - VecSubf(val, intr, co); - VecMulf(val, node->Fade); - VecAddf(val, val, co); - - sculpt_clip(e, co, val); - - node= node->next; - } -} - -/* Uses the brush curve control to find a strength value between 0 and 1 */ -float curve_strength(float p, const float len) -{ - if(p > len) p= len; - return curvemapping_evaluateF(G.scene->sculptdata.cumap, 0, p/len); -} - -/* Uses symm to selectively flip any axis of a coordinate. */ -void flip_coord(float co[3], const char symm) -{ - if(symm & SYMM_X) - co[0]= -co[0]; - if(symm & SYMM_Y) - co[1]= -co[1]; - if(symm & SYMM_Z) - co[2]= -co[2]; -} - -/* Use the warpfac field in MTex to store a rotation value for sculpt textures. Value is in degrees */ -float tex_angle(void) -{ - SculptData *sd= sculpt_data(); - if(sd->texact!=-1 && sd->mtex[sd->texact]) - return sd->mtex[sd->texact]->warpfac; - return 0; -} - -void set_tex_angle(const float f) -{ - SculptData *sd = sculpt_data(); - if(sd->texact != -1 && sd->mtex[sd->texact]) - sd->mtex[sd->texact]->warpfac = f; -} - -float to_rad(const float deg) -{ - return deg * (M_PI/180.0f); -} - -float to_deg(const float rad) -{ - return rad * (180.0f/M_PI); -} - -/* Get a pixel from the texcache at (px, py) */ -unsigned *get_texcache_pixel(const SculptSession *ss, int px, int py) -{ - if(px < 0) px= 0; - if(py < 0) py= 0; - if(px > ss->texcache_w - 1) px= ss->texcache_w - 1; - if(py > ss->texcache_h - 1) py= ss->texcache_h - 1; - return ss->texcache + py * ss->texcache_w + px; -} - -/* Return a multiplier for brush strength on a particular vertex. */ -float tex_strength(EditData *e, float *point, const float len,const unsigned vindex) -{ - SculptData *sd= sculpt_data(); - SculptSession *ss= sculpt_session(); - float avg= 1; - - if(sd->texact==-1 || !sd->mtex[sd->texact]) - avg= 1; - else if(sd->texrept==SCULPTREPT_3D) { - /* Get strength by feeding the vertex location directly - into a texture */ - float jnk; - const float factor= 0.01; - MTex mtex; - memset(&mtex,0,sizeof(MTex)); - mtex.tex= sd->mtex[sd->texact]->tex; - mtex.projx= 1; - mtex.projy= 2; - mtex.projz= 3; - VecCopyf(mtex.size, sd->mtex[sd->texact]->size); - VecMulf(mtex.size, factor); - if(!sd->texsep) - mtex.size[1]= mtex.size[2]= mtex.size[0]; - - externtex(&mtex,point,&avg,&jnk,&jnk,&jnk,&jnk); - } - else if(ss->texcache) { - const short bsize= sculptmode_brush()->size * 2; - const short half= sculptmode_brush()->size; - const float rot= to_rad(tex_angle()); - const unsigned tcw = ss->texcache_w, tch = ss->texcache_h; - int px, py; - unsigned i, *p; - ProjVert pv; - - /* If the active area is being applied for symmetry, flip it - across the symmetry axis in order to project it. This insures - that the brush texture will be oriented correctly. */ - if(!e->symm) - pv= projverts[vindex]; - else { - float co[3]; - VecCopyf(co, point); - flip_coord(co, e->symm); - project(co, pv.co); - } - - /* For Tile and Drag modes, get the 2D screen coordinates of the - and scale them up or down to the texture size. */ - if(sd->texrept==SCULPTREPT_TILE) { - const int sx= (const int)sd->mtex[sd->texact]->size[0]; - const int sy= (const int)sd->texsep ? sd->mtex[sd->texact]->size[1] : sx; - - float fx= pv.co[0]; - float fy= pv.co[1]; - - float angle= atan2(fy, fx) - rot; - float len= sqrtf(fx*fx + fy*fy); - - if(rot<0.001 && rot>-0.001) { - px= pv.co[0]; - py= pv.co[1]; - } else { - px= len * cos(angle) + 2000; - py= len * sin(angle) + 2000; - } - if(sx != 1) - px %= sx-1; - if(sy != 1) - py %= sy-1; - p= get_texcache_pixel(ss, tcw*px/sx, tch*py/sy); - } else { - float fx= (pv.co[0] - e->mouse[0] + half) * (tcw*1.0f/bsize) - tcw/2; - float fy= (pv.co[1] - e->mouse[1] + half) * (tch*1.0f/bsize) - tch/2; - - float angle= atan2(fy, fx) - rot; - float len= sqrtf(fx*fx + fy*fy); - - px= tcw/2 + len * cos(angle); - py= tch/2 + len * sin(angle); - - p= get_texcache_pixel(ss, px, py); - } - - avg= 0; - for(i=0; i<3; ++i) - avg+= ((unsigned char*)(p))[i] / 255.0f; - - avg/= 3; - } - - if(sd->texfade) - avg*= curve_strength(len,e->size); /* Smooth curve */ - - return avg; -} - -/* Mark area around the brush as damaged. projverts are marked if they are - inside the area and the damaged rectangle in 2D screen coordinates is - added to damaged_rects. */ -void sculpt_add_damaged_rect(EditData *e) -{ - short p[2]; - const float radius= brush_size(); - RectNode *rn= MEM_mallocN(sizeof(RectNode),"RectNode"); - Mesh *me= get_mesh(OBACT); - unsigned i; - - /* Find center */ - project(&e->center.x, p); - rn->r.xmin= p[0]-radius; - rn->r.ymin= p[1]-radius; - rn->r.xmax= p[0]+radius; - rn->r.ymax= p[1]+radius; - - BLI_addtail(&sculpt_session()->damaged_rects, rn); - - /* Update insides */ - for(i=0; itotvert; ++i) { - if(!projverts[i].inside) { - if(projverts[i].co[0] > rn->r.xmin && projverts[i].co[1] > rn->r.ymin && - projverts[i].co[0] < rn->r.xmax && projverts[i].co[1] < rn->r.ymax) { - projverts[i].inside= 1; - } - } - } -} - -/* Clears the depth buffer in each modified area. */ -void sculpt_clear_damaged_areas(SculptSession *ss) -{ - RectNode *rn= NULL; - - for(rn = ss->damaged_rects.first; rn; rn = rn->next) { - rcti clp = rn->r; - rcti *win = &curarea->winrct; - - clp.xmin += win->xmin; - clp.xmax += win->xmin; - clp.ymin += win->ymin; - clp.ymax += win->ymin; - - if(clp.xmin < win->xmax && clp.xmax > win->xmin && - clp.ymin < win->ymax && clp.ymax > win->ymin) { - if(clp.xmin < win->xmin) clp.xmin = win->xmin; - if(clp.ymin < win->ymin) clp.ymin = win->ymin; - if(clp.xmax > win->xmax) clp.xmax = win->xmax; - if(clp.ymax > win->ymax) clp.ymax = win->ymax; - - glScissor(clp.xmin + 1, clp.ymin + 1, - clp.xmax - clp.xmin - 2, - clp.ymax - clp.ymin - 2); - } - - glClear(GL_DEPTH_BUFFER_BIT); - } -} - -void do_brush_action(EditData e) -{ - int i; - float av_dist; - ListBase active_verts={0,0}; - ActiveData *adata= 0; - float *vert; - Mesh *me= get_mesh(OBACT); - const float bstrength= brush_strength(&e); - KeyBlock *keyblock= ob_get_keyblock(OBACT); - SculptSession *ss = sculpt_session(); - - sculpt_add_damaged_rect(&e); - - /* Build a list of all vertices that are potentially within the brush's - area of influence. Only do this once for the grab brush. */ - if(!e.grabdata || (e.grabdata && e.grabdata->firsttime)) { - for(i=0; itotvert; ++i) { - /* Projverts.inside provides a rough bounding box */ - if(projverts[i].inside) { - vert= ss->vertexcosnos ? &ss->vertexcosnos[i*6] : me->mvert[i].co; - av_dist= VecLenf(&e.center.x,vert); - if(av_dist < e.size) { - adata= (ActiveData*)MEM_mallocN(sizeof(ActiveData), "ActiveData"); - adata->Index = i; - /* Fade is used to store the final strength at which the brush - should modify a particular vertex. */ - adata->Fade= tex_strength(&e,vert,av_dist,i) * bstrength; - adata->dist = av_dist; - if(e.grabdata && e.grabdata->firsttime) - BLI_addtail(&e.grabdata->active_verts[e.grabdata->index], adata); - else - BLI_addtail(&active_verts, adata); - } - } - } - } - - /* Only act if some verts are inside the brush area */ - if(active_verts.first || (e.grabdata && e.grabdata->active_verts[e.grabdata->index].first)) { - /* Apply one type of brush action */ - switch(G.scene->sculptdata.brush_type){ - case DRAW_BRUSH: - do_draw_brush(&e, &active_verts); - break; - case SMOOTH_BRUSH: - do_smooth_brush(&e, &active_verts); - break; - case PINCH_BRUSH: - do_pinch_brush(&e, &active_verts); - break; - case INFLATE_BRUSH: - do_inflate_brush(&e, &active_verts); - break; - case GRAB_BRUSH: - do_grab_brush(&e); - break; - case LAYER_BRUSH: - do_layer_brush(&e, &active_verts); - break; - case FLATTEN_BRUSH: - do_flatten_brush(&e, &active_verts); - break; - } - - /* Copy the modified vertices from mesh to the active key */ - if(keyblock) { - float *co= keyblock->data; - if(co) { - adata = e.grabdata ? e.grabdata->active_verts[e.grabdata->index].first : active_verts.first; - for(; adata; adata= adata->next) - if(adata->Index < keyblock->totelem) - VecCopyf(&co[adata->Index*3], me->mvert[adata->Index].co); - } - } - - if(ss->vertexcosnos) - BLI_freelistN(&active_verts); - else { - if(!e.grabdata) - addlisttolist(&ss->damaged_verts, &active_verts); - } - } -} - -/* Flip all the editdata across the axis/axes specified by symm. Used to - calculate multiple modifications to the mesh when symmetry is enabled. */ -EditData flip_editdata(EditData *e, const char symm) -{ - EditData fe= *e; - GrabData *gd= fe.grabdata; - - flip_coord(&fe.center.x, symm); - flip_coord(&fe.up.x, symm); - flip_coord(&fe.right.x, symm); - flip_coord(&fe.out.x, symm); - - fe.symm= symm; - - project(&e->center.x,fe.mouse); - - if(gd) { - gd->index= symm; - gd->delta_symm= gd->delta; - flip_coord(&gd->delta_symm.x, symm); - } - - return fe; -} - -void do_symmetrical_brush_actions(EditData * e, short co[2], short pr_co[2]) -{ - const char symm= sculpt_data()->symm; - - init_editdata(e, co, pr_co); - - do_brush_action(flip_editdata(e, 0)); - - if(symm & SYMM_X) - do_brush_action(flip_editdata(e, SYMM_X)); - if(symm & SYMM_Y) - do_brush_action(flip_editdata(e, SYMM_Y)); - if(symm & SYMM_Z) - do_brush_action(flip_editdata(e, SYMM_Z)); - if(symm & SYMM_X && symm & SYMM_Y) - do_brush_action(flip_editdata(e, SYMM_X | SYMM_Y)); - if(symm & SYMM_X && symm & SYMM_Z) - do_brush_action(flip_editdata(e, SYMM_X | SYMM_Z)); - if(symm & SYMM_Y && symm & SYMM_Z) - do_brush_action(flip_editdata(e, SYMM_Y | SYMM_Z)); - if(symm & SYMM_X && symm & SYMM_Y && symm & SYMM_Z) - do_brush_action(flip_editdata(e, SYMM_X | SYMM_Y | SYMM_Z)); -} - -void add_face_normal(vec3f *norm, const MFace* face) -{ - Mesh *me= get_mesh(OBACT); - - vec3f c= {me->mvert[face->v1].co[0],me->mvert[face->v1].co[1],me->mvert[face->v1].co[2]}; - vec3f b= {me->mvert[face->v2].co[0],me->mvert[face->v2].co[1],me->mvert[face->v2].co[2]}; - vec3f a= {me->mvert[face->v3].co[0],me->mvert[face->v3].co[1],me->mvert[face->v3].co[2]}; - vec3f s1, s2; - - VecSubf(&s1.x,&a.x,&b.x); - VecSubf(&s2.x,&c.x,&b.x); - - norm->x+= s1.y * s2.z - s1.z * s2.y; - norm->y+= s1.z * s2.x - s1.x * s2.z; - norm->z+= s1.x * s2.y - s1.y * s2.x; -} - -void update_damaged_vert(Mesh *me, ListBase *lb) -{ - ActiveData *vert; - - for(vert= lb->first; vert; vert= vert->next) { - vec3f norm= {0,0,0}; - IndexNode *face= sculpt_session()->vertex_users[vert->Index].first; - - while(face){ - add_face_normal(&norm,&me->mface[face->Index]); - face= face->next; - } - Normalize(&norm.x); - - me->mvert[vert->Index].no[0]=norm.x*32767; - me->mvert[vert->Index].no[1]=norm.y*32767; - me->mvert[vert->Index].no[2]=norm.z*32767; - } -} - -void calc_damaged_verts(ListBase *damaged_verts, GrabData *grabdata) -{ - Mesh *me= get_mesh(OBACT); - - if(grabdata) { - int i; - for(i=0; i<8; ++i) - update_damaged_vert(me,&grabdata->active_verts[i]); - } else { - update_damaged_vert(me,damaged_verts); - BLI_freelistN(damaged_verts); - damaged_verts->first = damaged_verts->last = NULL; - } -} - -void projverts_clear_inside() -{ - Mesh *me = get_mesh(OBACT); - if(me) { - int i; - for(i = 0; i < me->totvert; ++i) - projverts[i].inside = 0; - } -} - -BrushData *sculptmode_brush(void) -{ - SculptData *sd= &G.scene->sculptdata; - - BrushData *bd = - (sd->brush_type==DRAW_BRUSH ? &sd->drawbrush : - sd->brush_type==SMOOTH_BRUSH ? &sd->smoothbrush : - sd->brush_type==PINCH_BRUSH ? &sd->pinchbrush : - sd->brush_type==INFLATE_BRUSH ? &sd->inflatebrush : - sd->brush_type==GRAB_BRUSH ? &sd->grabbrush : - sd->brush_type==LAYER_BRUSH ? &sd->layerbrush : - sd->brush_type==FLATTEN_BRUSH ? &sd->flattenbrush : NULL); - - if(!bd) { - sculptmode_init(G.scene); - bd = &sd->drawbrush; - } - - return bd; -} - -void sculptmode_update_tex() -{ - SculptData *sd= sculpt_data(); - SculptSession *ss= sculpt_session(); - MTex *mtex = sd->mtex[sd->texact]; - TexResult texres = {0}; - float x, y, step=2.0/128.0, co[3]; - int hasrgb, ix, iy; - - /* Skip Default brush shape and non-textures */ - if(sd->texact == -1 || !sd->mtex[sd->texact]) return; - - if(ss->texcache) { - MEM_freeN(ss->texcache); - ss->texcache= NULL; - } - - ss->texcache_w = ss->texcache_h = 128; - ss->texcache = MEM_callocN(sizeof(int) * ss->texcache_w * ss->texcache_h, "Sculpt Texture cache"); - - if(mtex && mtex->tex) { - BKE_image_get_ibuf(sd->mtex[sd->texact]->tex->ima, NULL); - - /*do normalized cannonical view coords for texture*/ - for (y=-1.0, iy=0; iy<128; iy++, y += step) { - for (x=-1.0, ix=0; ix<128; ix++, x += step) { - co[0]= x; - co[1]= y; - co[2]= 0.0f; - - /* This is copied from displace modifier code */ - hasrgb = multitex_ext(mtex->tex, co, NULL, NULL, 1, &texres); - - /* if the texture gave an RGB value, we assume it didn't give a valid - * intensity, so calculate one (formula from do_material_tex). - * if the texture didn't give an RGB value, copy the intensity across - */ - if(hasrgb & TEX_RGB) - texres.tin = (0.35 * texres.tr + 0.45 * - texres.tg + 0.2 * texres.tb); - - texres.tin = texres.tin * 255.0; - ((char*)ss->texcache)[(iy*128+ix)*4] = (char)texres.tin; - ((char*)ss->texcache)[(iy*128+ix)*4+1] = (char)texres.tin; - ((char*)ss->texcache)[(iy*128+ix)*4+2] = (char)texres.tin; - ((char*)ss->texcache)[(iy*128+ix)*4+3] = (char)texres.tin; - } - } - } -} - -/* pr_mouse is only used for the grab brush, can be NULL otherwise */ -void init_editdata(EditData *e, short *mouse, short *pr_mouse) -{ - SculptData *sd = sculpt_data(); - const float mouse_depth= get_depth(mouse[0],mouse[1]); - vec3f brush_edge_loc, zero_loc, oldloc; - ModifierData *md; - int i; - const char flip = (get_qual() == LR_SHIFTKEY); - - e->flip= flip; - - /* Convert the location and size of the brush to - modelspace coords */ - e->center= unproject(mouse[0],mouse[1],mouse_depth); - brush_edge_loc= unproject(mouse[0] + - brush_size(),mouse[1], - mouse_depth); - e->size= VecLenf(&e->center.x,&brush_edge_loc.x); - - /* Set the pivot to allow the model to rotate around the center of the brush */ - if(get_depth(mouse[0],mouse[1]) < 1.0) - sculpt_session()->pivot= e->center; - - /* Now project the Up, Right, and Out normals from view to model coords */ - zero_loc= unproject(0, 0, 0); - e->up= unproject(0, -1, 0); - e->right= unproject(1, 0, 0); - e->out= unproject(0, 0, -1); - VecSubf(&e->up.x, &e->up.x, &zero_loc.x); - VecSubf(&e->right.x, &e->right.x, &zero_loc.x); - VecSubf(&e->out.x, &e->out.x, &zero_loc.x); - Normalize(&e->up.x); - Normalize(&e->right.x); - Normalize(&e->out.x); - - /* Initialize mirror modifier clipping */ - for(i=0; i<3; ++i) { - e->clip[i]= 0; - e->cliptol[i]= 0; - } - for(md= OBACT->modifiers.first; md; md= md->next) { - if(md->type==eModifierType_Mirror && (md->mode & eModifierMode_Realtime)) { - const MirrorModifierData *mmd = (MirrorModifierData*) md; - - if(mmd->flag & MOD_MIR_CLIPPING) { - e->clip[mmd->axis]= 1; - if(mmd->tolerance > e->cliptol[mmd->axis]) - e->cliptol[mmd->axis]= mmd->tolerance; - } - } - } - - if(sd->brush_type == GRAB_BRUSH) { - vec3f gcenter; - if(!e->grabdata) { - e->grabdata= MEM_callocN(sizeof(GrabData),"grab data"); - e->grabdata->firsttime= 1; - e->grabdata->depth= mouse_depth; - } - else - e->grabdata->firsttime= 0; - - /* Find the delta */ - gcenter= unproject(mouse[0],mouse[1],e->grabdata->depth); - oldloc= unproject(pr_mouse[0],pr_mouse[1],e->grabdata->depth); - VecSubf(&e->grabdata->delta.x,&gcenter.x,&oldloc.x); - } - else if(sd->brush_type == LAYER_BRUSH) { - Mesh *me= get_mesh(OBACT); - - if(!e->layer_disps) - e->layer_disps= MEM_callocN(sizeof(float)*me->totvert,"Layer disps"); - if(!e->layer_store) { - unsigned i; - e->layer_store= MEM_mallocN(sizeof(vec3f)*me->totvert,"Layer store"); - for(i=0; itotvert; ++i) - VecCopyf(&e->layer_store[i].x,me->mvert[i].co); - } - } -} -void sculptmode_set_strength(const int delta) -{ - int val = sculptmode_brush()->strength + delta; - if(val < 1) val = 1; - if(val > 100) val = 100; - sculptmode_brush()->strength= val; -} - -void sculptmode_propset_calctex() -{ - SculptData *sd= sculpt_data(); - SculptSession *ss= sculpt_session(); - PropsetData *pd= sculpt_session()->propset; - if(pd) { - int i, j; - const int tsz = 128; - float *d; - if(!pd->texdata) { - pd->texdata= MEM_mallocN(sizeof(float)*tsz*tsz, "Brush preview"); - if(sd->texrept!=SCULPTREPT_3D) - sculptmode_update_tex(); - for(i=0; itexfade) - pd->texdata[i*tsz+j]= curve_strength(magn,tsz/2); - else - pd->texdata[i*tsz+j]= magn < tsz/2 ? 1 : 0; - } - if(sd->texact != -1 && ss->texcache) { - for(i=0; itexcache[i*tsz+j]; - pd->texdata[i*tsz+j]*= (((char*)&col)[0]+((char*)&col)[1]+((char*)&col)[2])/3.0f/255.0f; - } - } - } - - /* Adjust alpha with brush strength */ - d= MEM_dupallocN(pd->texdata); - for(i=0; istrength/200.0f+0.5f; - - - if(!pd->tex) - glGenTextures(1, (GLuint *)&pd->tex); - glBindTexture(GL_TEXTURE_2D, pd->tex); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, tsz, tsz, 0, GL_ALPHA, GL_FLOAT, d); - MEM_freeN(d); - } -} - -void sculptmode_propset_header() -{ - SculptSession *ss= sculpt_session(); - PropsetData *pd= ss ? ss->propset : NULL; - if(pd) { - char str[512]; - const char *name= ""; - int val= 0; - if(pd->mode == PropsetSize) { - name= "Size"; - val= sculptmode_brush()->size; - } - else if(pd->mode == PropsetStrength) { - name= "Strength"; - val= sculptmode_brush()->strength; - } - else if(pd->mode == PropsetTexRot) { - name= "Texture Angle"; - val= tex_angle(); - } - sprintf(str, "Brush %s: %d", name, val); - headerprint(str); - } -} - -void sculptmode_propset_end(SculptSession *ss, int cancel) -{ - if(ss && ss->propset) { - PropsetData *pd= ss->propset; - - if(cancel) { - sculptmode_brush()->size= pd->origsize; - sculptmode_brush()->strength= pd->origstrength; - set_tex_angle(pd->origtexrot); - } else { - if(pd->mode != PropsetSize) - sculptmode_brush()->size= pd->origsize; - if(pd->mode != PropsetStrength) - sculptmode_brush()->strength= pd->origstrength; - if(pd->mode != PropsetTexRot) - set_tex_angle(pd->origtexrot); - } - glDeleteTextures(1, &pd->tex); - MEM_freeN(pd->texdata); - MEM_freeN(pd); - ss->propset= NULL; - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWHEADERS, 0); - } -} - -void sculptmode_propset_init(PropsetMode mode) -{ - SculptSession *ss= sculpt_session(); - PropsetData *pd= ss->propset; - const float ang= tex_angle(); - - if(!pd) { - short mouse[2]; - - pd= MEM_callocN(sizeof(PropsetData),"PropsetSize"); - ss->propset= pd; - - getmouseco_areawin(mouse); - pd->origloc[0]= mouse[0]; - pd->origloc[1]= mouse[1]; - - if(mode == PropsetSize) - pd->origloc[0]-= sculptmode_brush()->size; - else if(mode == PropsetStrength) - pd->origloc[0]-= 200 - 2*sculptmode_brush()->strength; - else if(mode == PropsetTexRot) { - pd->origloc[0]-= 200 * cos(to_rad(ang)); - pd->origloc[1]-= 200 * sin(to_rad(ang)); - } - - pd->origsize= sculptmode_brush()->size; - pd->origstrength= sculptmode_brush()->strength; - pd->origtexrot= ang; - - sculptmode_propset_calctex(); - - pd->num.idx_max= 0; - } - - pd->mode= mode; - sculptmode_propset_header(); - - allqueue(REDRAWVIEW3D, 0); -} - -void sculpt_paint_brush(char clear) -{ - if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) { - static short mvalo[2]; - short mval[2]; - const short rad= sculptmode_brush()->size; - - getmouseco_areawin(mval); - - persp(PERSP_WIN); - if(clear) - fdrawXORcirc(mval[0], mval[1], rad); - else - draw_sel_circle(mval, mvalo, rad, rad, 0); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } -} - -void sculptmode_propset(unsigned short event) -{ - PropsetData *pd= sculpt_session()->propset; - short mouse[2]; - short tmp[2]; - float dist; - BrushData *brush= sculptmode_brush(); - char valset= 0; - - handleNumInput(&pd->num, event); - - if(hasNumInput(&pd->num)) { - float val; - applyNumInput(&pd->num, &val); - if(pd->mode==PropsetSize) - brush->size= val; - else if(pd->mode==PropsetStrength) - brush->strength= val; - else if(pd->mode==PropsetTexRot) - set_tex_angle(val); - valset= 1; - allqueue(REDRAWVIEW3D, 0); - } - - switch(event) { - case MOUSEX: - case MOUSEY: - if(!hasNumInput(&pd->num)) { - char ctrl= G.qual & LR_CTRLKEY; - getmouseco_areawin(mouse); - tmp[0]= pd->origloc[0]-mouse[0]; - tmp[1]= pd->origloc[1]-mouse[1]; - dist= sqrt(tmp[0]*tmp[0]+tmp[1]*tmp[1]); - if(pd->mode == PropsetSize) { - brush->size= dist; - if(ctrl) brush->size= (brush->size+5)/10*10; - } else if(pd->mode == PropsetStrength) { - float fin= (200.0f - dist) * 0.5f; - brush->strength= fin>=0 ? fin : 0; - if(ctrl) brush->strength= (brush->strength+5)/10*10; - } else if(pd->mode == PropsetTexRot) { - set_tex_angle((int)to_deg(atan2(tmp[1], tmp[0])) + 180); - if(ctrl) - set_tex_angle(((int)(tex_angle())+5)/10*10); - } - valset= 1; - allqueue(REDRAWVIEW3D, 0); - } - break; - case ESCKEY: - case RIGHTMOUSE: - brush->size= pd->origsize; - brush->strength= pd->origstrength; - set_tex_angle(pd->origtexrot); - case LEFTMOUSE: - while(get_mbut()==L_MOUSE); - case RETKEY: - case PADENTER: - sculptmode_propset_end(sculpt_session(), 0); - break; - default: - break; - }; - - if(valset) { - if(pd->mode == PropsetSize) { - if(brush->size<1) brush->size= 1; - if(brush->size>200) brush->size= 200; - } - else if(pd->mode == PropsetStrength) { - if(brush->strength > 100) brush->strength= 100; - sculptmode_propset_calctex(); - } - else if(pd->mode == PropsetTexRot) { - if(tex_angle() < 0) - set_tex_angle(0); - else if(tex_angle() > 360) - set_tex_angle(360); - } - } - - sculptmode_propset_header(); -} - -void sculptmode_selectbrush_menu(void) -{ - SculptData *sd= sculpt_data(); - int val; - - pupmenu_set_active(sd->brush_type); - - val= pupmenu("Select Brush%t|Draw|Smooth|Pinch|Inflate|Grab|Layer|Flatten"); - - if(val>0) { - sd->brush_type= val; - - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 1); - } -} - -void sculptmode_update_all_projverts(float *vertcosnos) -{ - Mesh *me= get_mesh(OBACT); - unsigned i; - - if(!projverts) - projverts = MEM_mallocN(sizeof(ProjVert)*me->totvert,"ProjVerts"); - - for(i=0; itotvert; ++i) { - project(vertcosnos ? &vertcosnos[i * 6] : me->mvert[i].co, projverts[i].co); - projverts[i].inside= 0; - } -} - -void sculptmode_draw_wires(int only_damaged, Mesh *me) -{ - int i; - - bglPolygonOffset(1.0); - glDepthMask(0); - BIF_ThemeColor((OBACT==OBACT)?TH_ACTIVE:TH_SELECT); - - for(i=0; itotedge; i++) { - MEdge *med= &me->medge[i]; - - if((!only_damaged || (projverts[med->v1].inside || projverts[med->v2].inside)) && - (med->flag & ME_EDGEDRAW)) { - glDrawElements(GL_LINES, 2, GL_UNSIGNED_INT, &med->v1); - } - } - - glDepthMask(1); - bglPolygonOffset(0.0); -} - -void sculptmode_draw_mesh(int only_damaged) -{ - Mesh *me= get_mesh(OBACT); - int i, j, dt, drawCurrentMat = 1, matnr= -1; - - persp(PERSP_VIEW); - mymultmatrix(OBACT->obmat); - glEnable(GL_DEPTH_TEST); - glEnable(GL_LIGHTING); - init_gl_materials(OBACT, 0); - glEnable(GL_CULL_FACE); - - glShadeModel(GL_SMOOTH); - - glVertexPointer(3, GL_FLOAT, sizeof(MVert), &me->mvert[0].co); - glNormalPointer(GL_SHORT, sizeof(MVert), &me->mvert[0].no); - - dt= MIN2(G.vd->drawtype, OBACT->dt); - if(dt==OB_WIRE) - glColorMask(0,0,0,0); - - for(i=0; itotface; ++i) { - MFace *f= &me->mface[i]; - char inside= 0; - int new_matnr= f->mat_nr + 1; - - if(new_matnr != matnr) - drawCurrentMat= set_gl_material(matnr = new_matnr); - - /* If only_damaged!=0, only draw faces that are partially - inside the area(s) modified by the brush */ - if(only_damaged) { - for(j=0; j<(f->v4?4:3); ++j) { - if(projverts[*((&f->v1)+j)].inside) { - inside= 1; - break; - } - } - } - else - inside= 1; - - if(inside && drawCurrentMat) - glDrawElements(f->v4?GL_QUADS:GL_TRIANGLES, f->v4?4:3, GL_UNSIGNED_INT, &f->v1); - } - - glDisable(GL_CULL_FACE); - glDisable(GL_LIGHTING); - glColorMask(1,1,1,1); - - if(dt==OB_WIRE || (OBACT->dtx & OB_DRAWWIRE)) - sculptmode_draw_wires(only_damaged, me); - - glDisable(GL_DEPTH_TEST); -} - -void sculptmode_correct_state(void) -{ - if(!sculpt_session()) - sculpt_init_session(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - if(!sculpt_session()->vertex_users) calc_vertex_users(); -} - -/* Checks whether full update mode (slower) needs to be used to work with modifiers */ -char sculpt_modifiers_active(Object *ob) -{ - ModifierData *md; - - for(md= modifiers_getVirtualModifierList(ob); md; md= md->next) { - if(md->mode & eModifierMode_Realtime) - return 1; - } - - return 0; -} - -void sculpt(void) -{ - SculptData *sd= sculpt_data(); - SculptSession *ss= sculpt_session(); - Object *ob= OBACT; - /* lastSigMouse is for the rake, to store the last place the mouse movement was significant */ - short mouse[2], mvalo[2], lastSigMouse[2],firsttime=1, mousebut; - short modifier_calculations= 0; - EditData e; - short spacing= 32000; - int scissor_box[4]; - float offsetRot; - if(!(G.f & G_SCULPTMODE) || G.obedit || !ob || ob->id.lib || !get_mesh(ob) || (get_mesh(ob)->totface == 0)) - return; - if(!(ob->lay & G.vd->lay)) - error("Active object is not in this layer"); - if(ob_get_keyblock(ob)) { - if(!(ob->shapeflag & OB_SHAPE_LOCK)) { - error("Cannot sculpt on unlocked shape key"); - return; - } - } - - if(!ss) { - sculpt_init_session(); - ss= sd->session; - } - - if(sd->flags & SCULPT_INPUT_SMOOTH) - sculpt_stroke_new(256); - - ss->damaged_rects.first = ss->damaged_rects.last = NULL; - ss->damaged_verts.first = ss->damaged_verts.last = NULL; - ss->vertexcosnos = NULL; - - /* Check that vertex users are up-to-date */ - if(ob != active_ob || !ss->vertex_users || ss->vertex_users_size != get_mesh(ob)->totvert) { - sculptmode_free_vertexusers(ss); - calc_vertex_users(); - if(projverts) - MEM_freeN(projverts); - projverts = NULL; - active_ob= ob; - } - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - persp(PERSP_VIEW); - - getmouseco_areawin(mvalo); - - /* Init texture - FIXME: Shouldn't be doing this every time! */ - if(sd->texrept!=SCULPTREPT_3D) - sculptmode_update_tex(); - - getmouseco_areawin(mouse); - mvalo[0]= mouse[0]; - mvalo[1]= mouse[1]; - lastSigMouse[0]=mouse[0]; - lastSigMouse[1]=mouse[1]; - mousebut = L_MOUSE; - - /* If modifier_calculations is true, then extra time must be spent - updating the mesh. This takes a *lot* longer, so it's worth - skipping if the modifier stack is empty. */ - modifier_calculations= sculpt_modifiers_active(ob); - - init_sculptmatrices(); - - if(modifier_calculations) - ss->vertexcosnos= mesh_get_mapped_verts_nors(ob); - sculptmode_update_all_projverts(ss->vertexcosnos); - - e.grabdata= NULL; - e.layer_disps= NULL; - e.layer_store= NULL; - - /* Set scaling adjustment */ - e.scale[0]= 1.0f / ob->size[0]; - e.scale[1]= 1.0f / ob->size[1]; - e.scale[2]= 1.0f / ob->size[2]; - - /* Capture original copy */ - if(sd->flags & SCULPT_DRAW_FAST) - glAccum(GL_LOAD, 1); - - /* Get original scissor box */ - glGetIntegerv(GL_SCISSOR_BOX, scissor_box); - - /* For raking, get the original angle*/ - offsetRot=tex_angle(); - - while (get_mbut() & mousebut) { - getmouseco_areawin(mouse); - /* If rake, and the mouse has moved over 10 pixels (euclidean) (prevents jitter) then get the new angle */ - if (sd->rake && (pow(lastSigMouse[0]-mouse[0],2)+pow(lastSigMouse[1]-mouse[1],2))>100){ - /*Nasty looking, but just orig + new angle really*/ - set_tex_angle(offsetRot+180.+to_deg(atan2((float)(mouse[1]-lastSigMouse[1]),(float)(mouse[0]-lastSigMouse[0])))); - lastSigMouse[0]=mouse[0]; - lastSigMouse[1]=mouse[1]; - } - - if(firsttime || mouse[0]!=mvalo[0] || mouse[1]!=mvalo[1] || sculptmode_brush()->airbrush) { - firsttime= 0; - - if(sd->flags & SCULPT_INPUT_SMOOTH) - sculpt_stroke_add_point(mouse[0], mouse[1]); - - spacing+= sqrt(pow(mvalo[0]-mouse[0],2)+pow(mvalo[1]-mouse[1],2)); - - if(modifier_calculations && !ss->vertexcosnos) - ss->vertexcosnos= mesh_get_mapped_verts_nors(ob); - - if(G.scene->sculptdata.brush_type != GRAB_BRUSH) { - if(sd->flags & SCULPT_INPUT_SMOOTH) { - sculpt_stroke_apply(&e); - } - else if(sd->spacing==0 || spacing>sd->spacing) { - do_symmetrical_brush_actions(&e, mouse, NULL); - spacing= 0; - } - } - else { - do_symmetrical_brush_actions(&e, mouse, mvalo); - ss->pivot= unproject(mouse[0],mouse[1],e.grabdata->depth); - } - - if(modifier_calculations || ob_get_keyblock(ob)) - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if(modifier_calculations || sd->brush_type == GRAB_BRUSH || !(sd->flags & SCULPT_DRAW_FAST)) { - calc_damaged_verts(&ss->damaged_verts,e.grabdata); - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } else { /* Optimized drawing */ - calc_damaged_verts(&ss->damaged_verts,e.grabdata); - - /* Draw the stored image to the screen */ - glAccum(GL_RETURN, 1); - - sculpt_clear_damaged_areas(ss); - - /* Draw all the polygons that are inside the modified area(s) */ - glScissor(scissor_box[0], scissor_box[1], scissor_box[2], scissor_box[3]); - sculptmode_draw_mesh(1); - glAccum(GL_LOAD, 1); - - projverts_clear_inside(); - - persp(PERSP_WIN); - glDisable(GL_DEPTH_TEST); - - /* Draw cursor */ - if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) - fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()->size); - if(sculpt_data()->flags & SCULPT_INPUT_SMOOTH) - sculpt_stroke_draw(); - - myswapbuffers(); - } - - BLI_freelistN(&ss->damaged_rects); - ss->damaged_rects.first = ss->damaged_rects.last = NULL; - - mvalo[0]= mouse[0]; - mvalo[1]= mouse[1]; - - if(ss->vertexcosnos) { - MEM_freeN(ss->vertexcosnos); - ss->vertexcosnos= NULL; - } - - } - else BIF_wait_for_statechange(); - } - - /* Set the rotation of the brush back to what it was before any rake */ - set_tex_angle(offsetRot); - - if(sd->flags & SCULPT_INPUT_SMOOTH) { - sculpt_stroke_apply_all(&e); - calc_damaged_verts(&ss->damaged_verts,e.grabdata); - BLI_freelistN(&ss->damaged_rects); - } - - if(e.layer_disps) MEM_freeN(e.layer_disps); - if(e.layer_store) MEM_freeN(e.layer_store); - /* Free GrabData */ - if(e.grabdata) { - int i; - for(i=0; i<8; ++i) - BLI_freelistN(&e.grabdata->active_verts[i]); - MEM_freeN(e.grabdata); - } - sculpt_stroke_free(); - - sculpt_undo_push(G.scene->sculptdata.brush_type); - - if(G.vd->depths) G.vd->depths->damaged= 1; - - allqueue(REDRAWVIEW3D, 0); -} - -void sculpt_undo_push(const short brush_type) -{ - switch(brush_type) { - case DRAW_BRUSH: - BIF_undo_push("Draw Brush"); break; - case SMOOTH_BRUSH: - BIF_undo_push("Smooth Brush"); break; - case PINCH_BRUSH: - BIF_undo_push("Pinch Brush"); break; - case INFLATE_BRUSH: - BIF_undo_push("Inflate Brush"); break; - case GRAB_BRUSH: - BIF_undo_push("Grab Brush"); break; - case LAYER_BRUSH: - BIF_undo_push("Layer Brush"); break; - case FLATTEN_BRUSH: - BIF_undo_push("Flatten Brush"); break; - default: - BIF_undo_push("Sculpting"); break; - } -} - -void set_sculptmode(void) -{ - if(G.f & G_SCULPTMODE) { - Mesh *me= get_mesh(OBACT); - - G.f &= ~G_SCULPTMODE; - - sculptmode_free_session(G.scene); - if(me && me->pv) - sculptmode_pmv_off(me); - } - else { - G.f |= G_SCULPTMODE; - - /* Called here to sanity-check the brush */ - sculptmode_brush(); - - sculpt_init_session(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - } - - active_ob= NULL; - - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSEDIT, 0); -} - -/* Partial Mesh Visibility */ -PartialVisibility *sculptmode_copy_pmv(PartialVisibility *pmv) -{ - PartialVisibility *n= MEM_dupallocN(pmv); - n->vert_map= MEM_dupallocN(pmv->vert_map); - n->edge_map= MEM_dupallocN(pmv->edge_map); - n->old_edges= MEM_dupallocN(pmv->old_edges); - n->old_faces= MEM_dupallocN(pmv->old_faces); - return n; -} - -void sculptmode_pmv_free(PartialVisibility *pv) -{ - MEM_freeN(pv->vert_map); - MEM_freeN(pv->edge_map); - MEM_freeN(pv->old_faces); - MEM_freeN(pv->old_edges); - MEM_freeN(pv); -} - -void sculptmode_revert_pmv(Mesh *me) -{ - if(me->pv) { - unsigned i; - MVert *nve, *old_verts; - - active_ob= NULL; - - /* Reorder vertices */ - nve= me->mvert; - old_verts = MEM_mallocN(sizeof(MVert)*me->pv->totvert,"PMV revert verts"); - for(i=0; ipv->totvert; ++i) - old_verts[i]= nve[me->pv->vert_map[i]]; - - /* Restore verts, edges and faces */ - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->totvert); - CustomData_free_layer_active(&me->edata, CD_MEDGE, me->totedge); - CustomData_free_layer_active(&me->fdata, CD_MFACE, me->totface); - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, old_verts, me->pv->totvert); - CustomData_add_layer(&me->edata, CD_MEDGE, CD_ASSIGN, me->pv->old_edges, me->pv->totedge); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_ASSIGN, me->pv->old_faces, me->pv->totface); - mesh_update_customdata_pointers(me); - - me->totvert= me->pv->totvert; - me->totedge= me->pv->totedge; - me->totface= me->pv->totface; - - me->pv->old_edges= NULL; - me->pv->old_faces= NULL; - - /* Free maps */ - MEM_freeN(me->pv->edge_map); - me->pv->edge_map= NULL; - MEM_freeN(me->pv->vert_map); - me->pv->vert_map= NULL; - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - } -} - -void sculptmode_pmv_off(Mesh *me) -{ - if(me->pv) { - sculptmode_revert_pmv(me); - MEM_freeN(me->pv); - me->pv= NULL; - } -} - -/* mode: 0=hide outside selection, 1=hide inside selection */ -void sculptmode_do_pmv(Object *ob, rcti *hb_2d, int mode) -{ - Mesh *me= get_mesh(ob); - vec3f hidebox[6]; - vec3f plane_normals[4]; - float plane_ds[4]; - unsigned i, j; - unsigned ndx_show, ndx_hide; - MVert *nve; - unsigned face_cnt_show= 0, face_ndx_show= 0; - unsigned edge_cnt_show= 0, edge_ndx_show= 0; - unsigned *old_map= NULL; - const unsigned SHOW= 0, HIDE=1; - - /* Convert hide box from 2D to 3D */ - hidebox[0]= unproject(hb_2d->xmin, hb_2d->ymax, 1); - hidebox[1]= unproject(hb_2d->xmax, hb_2d->ymax, 1); - hidebox[2]= unproject(hb_2d->xmax, hb_2d->ymin, 1); - hidebox[3]= unproject(hb_2d->xmin, hb_2d->ymin, 1); - hidebox[4]= unproject(hb_2d->xmin, hb_2d->ymax, 0); - hidebox[5]= unproject(hb_2d->xmax, hb_2d->ymin, 0); - - /* Calculate normals for each side of hide box */ - CalcNormFloat(&hidebox[0].x,&hidebox[1].x,&hidebox[4].x,&plane_normals[0].x); - CalcNormFloat(&hidebox[1].x,&hidebox[2].x,&hidebox[5].x,&plane_normals[1].x); - CalcNormFloat(&hidebox[2].x,&hidebox[3].x,&hidebox[5].x,&plane_normals[2].x); - CalcNormFloat(&hidebox[3].x,&hidebox[0].x,&hidebox[4].x,&plane_normals[3].x); - - /* Calculate D for each side of hide box */ - for(i= 0; i<4; ++i) - plane_ds[i]= hidebox[i].x*plane_normals[i].x + hidebox[i].y*plane_normals[i].y + - hidebox[i].z*plane_normals[i].z; - - /* Add partial visibility to mesh */ - if(!me->pv) { - me->pv= MEM_callocN(sizeof(PartialVisibility),"PartialVisibility"); - } else { - old_map= MEM_callocN(sizeof(unsigned)*me->pv->totvert,"PMV oldmap"); - for(i=0; ipv->totvert; ++i) { - old_map[i]= me->pv->vert_map[i]totvert?0:1; - } - sculptmode_revert_pmv(me); - } - - /* Kill sculpt data */ - active_ob= NULL; - - /* Initalize map with which verts are to be hidden */ - me->pv->vert_map= MEM_mallocN(sizeof(unsigned)*me->totvert, "PMV vertmap"); - me->pv->totvert= me->totvert; - me->totvert= 0; - for(i=0; ipv->totvert; ++i) { - me->pv->vert_map[i]= mode ? HIDE:SHOW; - for(j=0; j<4; ++j) { - if(me->mvert[i].co[0] * plane_normals[j].x + - me->mvert[i].co[1] * plane_normals[j].y + - me->mvert[i].co[2] * plane_normals[j].z < plane_ds[j] ) { - me->pv->vert_map[i]= mode ? SHOW:HIDE; /* Vert is outside the hide box */ - break; - } - } - if(old_map && old_map[i]) me->pv->vert_map[i]= 1; - if(!me->pv->vert_map[i]) ++me->totvert; - - } - if(old_map) MEM_freeN(old_map); - - /* Find out how many faces to show */ - for(i=0; itotface; ++i) { - if(!me->pv->vert_map[me->mface[i].v1] && - !me->pv->vert_map[me->mface[i].v2] && - !me->pv->vert_map[me->mface[i].v3]) { - if(me->mface[i].v4) { - if(!me->pv->vert_map[me->mface[i].v4]) - ++face_cnt_show; - } - else ++face_cnt_show; - } - } - /* Find out how many edges to show */ - for(i=0; itotedge; ++i) { - if(!me->pv->vert_map[me->medge[i].v1] && - !me->pv->vert_map[me->medge[i].v2]) - ++edge_cnt_show; - } - - /* Create new vert array and reset each vert's map with map[old]=new index */ - nve= MEM_mallocN(sizeof(MVert)*me->pv->totvert, "PMV verts"); - ndx_show= 0; ndx_hide= me->totvert; - for(i=0; ipv->totvert; ++i) { - if(me->pv->vert_map[i]) { - me->pv->vert_map[i]= ndx_hide; - nve[me->pv->vert_map[i]]= me->mvert[i]; - ++ndx_hide; - } else { - me->pv->vert_map[i]= ndx_show; - nve[me->pv->vert_map[i]]= me->mvert[i]; - ++ndx_show; - } - } - CustomData_free_layer_active(&me->vdata, CD_MVERT, me->pv->totvert); - me->mvert= CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, nve, me->totvert); - - /* Create new face array */ - me->pv->old_faces= me->mface; - me->pv->totface= me->totface; - me->mface= MEM_mallocN(sizeof(MFace)*face_cnt_show, "PMV faces"); - for(i=0; itotface; ++i) { - MFace *pr_f= &me->pv->old_faces[i]; - char show= 0; - - if(me->pv->vert_map[pr_f->v1] < me->totvert && - me->pv->vert_map[pr_f->v2] < me->totvert && - me->pv->vert_map[pr_f->v3] < me->totvert) { - if(pr_f->v4) { - if(me->pv->vert_map[pr_f->v4] < me->totvert) - show= 1; - } - else show= 1; - } - - if(show) { - MFace *cr_f= &me->mface[face_ndx_show]; - *cr_f= *pr_f; - cr_f->v1= me->pv->vert_map[pr_f->v1]; - cr_f->v2= me->pv->vert_map[pr_f->v2]; - cr_f->v3= me->pv->vert_map[pr_f->v3]; - cr_f->v4= pr_f->v4 ? me->pv->vert_map[pr_f->v4] : 0; - test_index_face(cr_f,NULL,0,pr_f->v4?4:3); - ++face_ndx_show; - } - } - me->totface= face_cnt_show; - CustomData_set_layer(&me->fdata, CD_MFACE, me->mface); - - /* Create new edge array */ - me->pv->old_edges= me->medge; - me->pv->totedge= me->totedge; - me->medge= MEM_mallocN(sizeof(MEdge)*edge_cnt_show, "PMV edges"); - me->pv->edge_map= MEM_mallocN(sizeof(int)*me->pv->totedge,"PMV edgemap"); - for(i=0; itotedge; ++i) { - if(me->pv->vert_map[me->pv->old_edges[i].v1] < me->totvert && - me->pv->vert_map[me->pv->old_edges[i].v2] < me->totvert) { - MEdge *cr_e= &me->medge[edge_ndx_show]; - me->pv->edge_map[i]= edge_ndx_show; - *cr_e= me->pv->old_edges[i]; - cr_e->v1= me->pv->vert_map[me->pv->old_edges[i].v1]; - cr_e->v2= me->pv->vert_map[me->pv->old_edges[i].v2]; - ++edge_ndx_show; - } - else me->pv->edge_map[i]= -1; - } - me->totedge= edge_cnt_show; - CustomData_set_layer(&me->edata, CD_MEDGE, me->medge); - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); -} - -rcti sculptmode_pmv_box() -{ - short down[2], mouse[2]; - rcti ret; - - getmouseco_areawin(down); - - while((get_mbut()&L_MOUSE) || (get_mbut()&R_MOUSE)) { - getmouseco_areawin(mouse); - - scrarea_do_windraw(curarea); - - persp(PERSP_WIN); - glLineWidth(2); - setlinestyle(2); - sdrawXORline(down[0],down[1],mouse[0],down[1]); - sdrawXORline(mouse[0],down[1],mouse[0],mouse[1]); - sdrawXORline(mouse[0],mouse[1],down[0],mouse[1]); - sdrawXORline(down[0],mouse[1],down[0],down[1]); - setlinestyle(0); - glLineWidth(1); - persp(PERSP_VIEW); - - screen_swapbuffers(); - backdrawview3d(0); - } - - ret.xmin= down[0]mouse[0]?down[0]:mouse[0]; - ret.ymax= down[1]>mouse[1]?down[1]:mouse[1]; - return ret; -} - -void sculptmode_pmv(int mode) -{ - Object *ob= OBACT; - rcti hb_2d; - - if(ob_get_key(ob)) { - error("Cannot hide mesh with shape keys enabled"); - return; - } - - hb_2d= sculptmode_pmv_box(); /* Get 2D hide box */ - - sculptmode_correct_state(); - - waitcursor(1); - - if(hb_2d.xmax-hb_2d.xmin > 3 && hb_2d.ymax-hb_2d.ymin > 3) { - init_sculptmatrices(); - - sculptmode_do_pmv(ob,&hb_2d,mode); - } - else sculptmode_pmv_off(get_mesh(ob)); - - scrarea_do_windraw(curarea); - - BIF_undo_push("Partial mesh hide"); - - waitcursor(0); -} diff --git a/source/blender/src/seqaudio.c b/source/blender/src/seqaudio.c deleted file mode 100644 index ae76de90ddf..00000000000 --- a/source/blender/src/seqaudio.c +++ /dev/null @@ -1,553 +0,0 @@ -/* - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): intrr, Peter Schlaile - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifndef WIN32 -#define __USE_XOPEN /* Needed for swab on linux */ -#include -#undef __USE_XOPEN -#else -#include -#endif - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "BMF_Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_screen_types.h" -#include "DNA_sound_types.h" -#include "DNA_userdef_types.h" -#include "DNA_sequence_types.h" -#include "DNA_scene_types.h" -#include "DNA_ipo_types.h" - -#include "BKE_utildefines.h" -#include "BKE_global.h" -#include "BKE_library.h" -#include "BKE_blender.h" -#include "BKE_main.h" -#include "BKE_ipo.h" - -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_keyval.h" -#include "BIF_mainqueue.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_glutil.h" -#include "BIF_interface.h" - -#include "BSE_view.h" -#include "BSE_seqaudio.h" -#include "BIF_editsound.h" - -#include "mydevice.h" -#include "blendef.h" - - -void audio_fill(void *mixdown, Uint8 *sstream, int len); -/* ************ GLOBALS ************* */ - -static int audio_pos; -static int audio_scrub=0; -static int audio_playing=0; -static int audio_initialised=0; -static int audio_startframe=0; -static double audio_starttime = 0.0; -///// -// -/* local protos ------------------- */ -void audio_mixdown(void); - -void makewavstring (char *string) -{ - char txt[64]; - - if (string==0) return; - - strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); - - BLI_make_existing_file(string); - - if (BLI_strcasecmp(string + strlen(string) - 4, ".wav")) { - sprintf(txt, "%04d_%04d.wav", (G.scene->r.sfra) , (G.scene->r.efra) ); - strcat(string, txt); - } -} - -void audio_mixdown() -{ - int file, c, totlen, totframe, i, oldcfra; - char *buf; - - buf = MEM_mallocN(65536, "audio_mixdown"); - makewavstring(buf); - - file = open(buf, O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666); - - if(file == -1) - { - error("Can't open output file"); - return; - } - - waitcursor(1); - - printf("Saving: %s ", buf); - - strcpy(buf, "RIFFlengWAVEfmt fmln01ccRATEbsecBP16dataDLEN"); - totframe = (EFRA - SFRA + 1); - totlen = (int) ( FRA2TIME(totframe) * (float)G.scene->audio.mixrate * 4.0); - printf(" totlen %d\n", totlen+36+8); - - totlen+= 36; /* len is filesize-8 in WAV spec, total header is 44 bytes */ - memcpy(buf+4, &totlen, 4); - totlen-= 36; - - buf[16] = 0x10; buf[17] = buf[18] = buf[19] = 0; buf[20] = 1; buf[21] = 0; - buf[22] = 2; buf[23]= 0; - memcpy(buf+24, &G.scene->audio.mixrate, 4); - i = G.scene->audio.mixrate * 4; - memcpy(buf+28, &i, 4); - buf[32] = 4; buf[33] = 0; buf[34] = 16; buf[35] = 0; - i = totlen; - memcpy(buf+40, &i, 4); - - if (G.order == B_ENDIAN) { - /* swap the four ints to little endian */ - - /* length */ - SWITCH_INT(buf[4]); - - /* audio rate */ - SWITCH_INT(buf[24]); - - /* audio mixrate * 4 */ - SWITCH_INT(buf[28]); - - /* length */ - SWITCH_INT(buf[40]); - } - - c = write(file, buf, 44); - - oldcfra = CFRA; - audiostream_play(SFRA, 0, 1); - - i= 0; - while ( totlen > 0 ) { - totlen -= 64; - - memset(buf+i, 0, 64); - - CFRA=(int) ( ((float)(audio_pos-64)/( G.scene->audio.mixrate*4 ))*FPS ); - - audio_fill(buf+i, NULL, 64); - if (G.order == B_ENDIAN) { - char tbuf[64]; - memcpy(tbuf, buf+i, 64); - swab(tbuf, buf+i, 64); - } - if (i == (65536-64)) { - i=0; - write(file, buf, 65536); - } - else i+=64; - } - write(file, buf, i); - - waitcursor(0); - CFRA = oldcfra; - close(file); - MEM_freeN(buf); - - return; -} - -void audiostream_fill(Uint8 *mixdown, int len) -{ - int oldcfra = CFRA; - int i; - - memset(mixdown, 0, len); - - for (i = 0; i < len; i += 64) { - CFRA = (int) ( ((float)(audio_pos-64) - /( G.scene->audio.mixrate*4 )) - * FPS ); - - audio_fill(mixdown + i, NULL, - (len - i) > 64 ? 64 : (len - i)); - } - - CFRA = oldcfra; -} - - -static void audio_levels(Uint8 *buf, int len, float db, float facf, float pan) -{ - int i; - float facl, facr, fac; - signed short *sample; - - if (pan>=0) { facr = 1.0; facl = 1.0-pan; } - else { facr = pan+1.0; facl = 1.0; } - - fac = pow(10.0, ((-(db+G.scene->audio.main))/20.0)) / facf; - facl /= fac; - facr /= fac; - - for (i=0; istream to contain the new sample, and set sound->streamlen - * accordingly. - */ -void audio_makestream(bSound *sound) -{ - signed short *source, *dest; - float ratio; - int i; - - if ( (!sound)||(sound->stream)||(!sound->sample)||(!G.scene) ) { - return; - } - ratio = (float)G.scene->audio.mixrate / (float)sound->sample->rate; - sound->streamlen = (int) ( (float)sound->sample->len * ratio * 2.0/((float)sound->sample->channels) ); - sound->stream = malloc((int) ((float)sound->streamlen * 1.05)); - if (sound->sample->rate == G.scene->audio.mixrate) { - if (sound->sample->channels == 2) { - memcpy(sound->stream, sound->sample->data, sound->streamlen); - return; - } else { - for (source = (signed short*)(sound->sample->data), - dest = (signed short*)(sound->stream), - i=0; - istreamlen/4; - dest += 2, source++, i++) dest[0] = dest[1] = source[0]; - return; - } - } - if (sound->sample->channels == 1) { - for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data); - i<(sound->streamlen/4); dest+=2, i++) - dest[0] = dest[1] = source[(int)((float)i/ratio)]; - } - else if (sound->sample->channels == 2) { - for (dest=(signed short*)(sound->stream), i=0, source=(signed short*)(sound->sample->data); - i<(sound->streamlen/2); dest+=2, i+=2) { - dest[1] = source[(int)((float)i/ratio)]; - dest[0] = source[(int)((float)i/ratio)+1]; - } - } -} - -static void audio_fill_ram_sound(Sequence *seq, void * mixdown, - Uint8 * sstream, int len) -{ - Uint8* cvtbuf; - bSound* sound; - float facf; - - sound = seq->sound; - audio_makestream(sound); - if ((seq->curposstreamlen -len) && (seq->curpos>=0) && - (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA)) - { - if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, CFRA); - facf = seq->facf0; - } else { - facf = 1.0; - } - cvtbuf = malloc(len); - memcpy(cvtbuf, ((Uint8*)sound->stream)+(seq->curpos & (~3)), len); - audio_levels(cvtbuf, len, seq->level, facf, seq->pan); - if (!mixdown) { - SDL_MixAudio(sstream, cvtbuf, len, SDL_MIX_MAXVOLUME); - } else { - SDL_MixAudio((Uint8*)mixdown, cvtbuf, len, SDL_MIX_MAXVOLUME); - } - free(cvtbuf); - } - seq->curpos += len; -} - -static void audio_fill_hd_sound(Sequence *seq, - void * mixdown, Uint8 * sstream, - int len) -{ - Uint8* cvtbuf; - float facf; - - if ((seq->curpos >= 0) && - (seq->startdisp <= CFRA) && ((seq->enddisp) > CFRA)) - { - if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, CFRA); - facf = seq->facf0; - } else { - facf = 1.0; - } - cvtbuf = malloc(len); - - sound_hdaudio_extract(seq->hdaudio, (short*) cvtbuf, - seq->curpos / 4, - G.scene->audio.mixrate, - 2, - len / 4); - audio_levels(cvtbuf, len, seq->level, facf, seq->pan); - if (!mixdown) { - SDL_MixAudio(sstream, - cvtbuf, len, SDL_MIX_MAXVOLUME); - } else { - SDL_MixAudio((Uint8*)mixdown, - cvtbuf, len, SDL_MIX_MAXVOLUME); - } - free(cvtbuf); - } - seq->curpos += len; -} - -static void audio_fill_seq(Sequence * seq, void * mixdown, - Uint8 *sstream, int len) -{ - while(seq) { - if (seq->type == SEQ_META) { - audio_fill_seq(seq->seqbase.first, - mixdown, sstream, len); - } - if ( (seq->type == SEQ_RAM_SOUND) && - (seq->sound) && - (!(seq->flag & SEQ_MUTE))) { - audio_fill_ram_sound(seq, mixdown, sstream, len); - } - if ( (seq->type == SEQ_HD_SOUND) && - (!(seq->flag & SEQ_MUTE))) { - if (!seq->hdaudio) { - char name[FILE_MAXDIR+FILE_MAXFILE]; - - strncpy(name, seq->strip->dir, - FILE_MAXDIR-1); - strncat(name, - seq->strip->stripdata->name, - FILE_MAXFILE-1); - BLI_convertstringcode(name, G.sce, - G.scene->r.cfra); - - seq->hdaudio= sound_open_hdaudio(name); - } - if (seq->hdaudio) { - audio_fill_hd_sound(seq, mixdown, - sstream, len); - } - } - seq = seq->next; - } -} - -void audio_fill(void *mixdown, Uint8 *sstream, int len) -{ - Editing *ed; - Sequence *seq; - - ed = G.scene->ed; - if((ed) && (!(G.scene->audio.flag & AUDIO_MUTE))) { - seq = ed->seqbasep->first; - audio_fill_seq(seq, mixdown, sstream, len); - } - - audio_pos += len; - if (audio_scrub) { - audio_scrub--; - if (!audio_scrub) { - audiostream_stop(); - } - } -} - -static int audio_init(SDL_AudioSpec *desired) -{ - SDL_AudioSpec *obtained, *hardware_spec; - - SDL_CloseAudio(); - - obtained = (SDL_AudioSpec*)MEM_mallocN(sizeof(SDL_AudioSpec), - "SDL_AudioSpec"); - - desired->callback=audio_fill; - - if ( SDL_OpenAudio(desired, obtained) < 0 ) { - fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError()); - if (obtained) MEM_freeN(obtained); - return 0; - } - audio_initialised = 1; - hardware_spec=obtained; - - MEM_freeN(obtained); - - SDL_PauseAudio(0); - return 1; -} - -static int audiostream_play_seq(Sequence * seq, Uint32 startframe) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - int have_sound = 0; - - while(seq) { - if (seq->type == SEQ_META) { - if (audiostream_play_seq( - seq->seqbase.first, startframe)) { - have_sound = 1; - } - } - if ((seq->type == SEQ_RAM_SOUND) && (seq->sound)) { - have_sound = 1; - seq->curpos = (int)( (FRA2TIME((double) startframe - - (double) seq->start) - * ((float)G.scene->audio.mixrate) - * 4 )); - } - if ((seq->type == SEQ_HD_SOUND)) { - have_sound = 1; - if (!seq->hdaudio) { - strncpy(name, seq->strip->dir, FILE_MAXDIR-1); - strncat(name, seq->strip->stripdata->name, - FILE_MAXFILE-1); - - seq->hdaudio = sound_open_hdaudio(name); - } - seq->curpos = (int)( (FRA2TIME((double) startframe - - (double) seq->start) - * ((float)G.scene->audio.mixrate) - * 4 )); - } - seq= seq->next; - } - return have_sound; -} - -void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown) -{ - static SDL_AudioSpec desired; - Editing *ed; - int have_sound = 0; - - ed= G.scene->ed; - if(ed) { - have_sound = - audiostream_play_seq(ed->seqbasep->first, startframe); - } - - if(have_sound) { - /* this call used to be in startup */ - sound_init_audio(); - } - - if (U.mixbufsize && !audio_initialised && !(duration + mixdown)) { - desired.freq=G.scene->audio.mixrate; - desired.format=AUDIO_S16SYS; - desired.channels=2; - desired.samples=U.mixbufsize; - desired.userdata=0; - if (audio_init(&desired)==0) { - U.mixbufsize = 0; /* no audio */ - } - } - - audio_startframe = startframe; - audio_pos = ( ((int)( FRA2TIME(startframe) - *(G.scene->audio.mixrate)*4 )) & (~3) ); - audio_starttime = PIL_check_seconds_timer(); - - audio_scrub = duration; - if (!mixdown) { - SDL_PauseAudio(0); - audio_playing++; - } -} - -void audiostream_start(Uint32 frame) -{ - audiostream_play(frame, 0, 0); -} - -void audiostream_scrub(Uint32 frame) -{ - if (U.mixbufsize) audiostream_play(frame, 4096/U.mixbufsize, 0); -} - -void audiostream_stop(void) -{ - SDL_PauseAudio(1); - audio_playing=0; -} - -int audiostream_pos(void) -{ - int pos; - - if (U.mixbufsize) { - pos = (int) (((double)(audio_pos-U.mixbufsize) - / ( G.scene->audio.mixrate*4 )) - * FPS ); - } else { /* fallback to seconds_timer when no audio available */ - pos = (int) ((PIL_check_seconds_timer() - audio_starttime) - * FPS); - } - - if (pos < audio_startframe) pos = audio_startframe; - return ( pos ); -} - diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c deleted file mode 100644 index 5ed7ea29e2f..00000000000 --- a/source/blender/src/seqeffects.c +++ /dev/null @@ -1,3032 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Peter Schlaile 2005/2006 - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" -#include "PIL_dynlib.h" - -#include "DNA_scene_types.h" -#include "DNA_sequence_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BIF_interface.h" -#include "BIF_toolbox.h" - -#include "BSE_seqeffects.h" -#include "BSE_sequence.h" - -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_plugin_types.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "RE_pipeline.h" // talks to entire render API - -#include "blendef.h" - -/* Glow effect */ -enum { - GlowR=0, - GlowG=1, - GlowB=2, - GlowA=3 -}; - - -/* ********************************************************************** - PLUGINS - ********************************************************************** */ - -static void open_plugin_seq(PluginSeq *pis, const char *seqname) -{ - int (*version)(); - void* (*alloc_private)(); - char *cp; - - /* to be sure: (is tested for) */ - pis->doit= 0; - pis->pname= 0; - pis->varstr= 0; - pis->cfra= 0; - pis->version= 0; - pis->instance_private_data = 0; - - /* clear the error list */ - PIL_dynlib_get_error_as_string(NULL); - - /* if(pis->handle) PIL_dynlib_close(pis->handle); */ - /* pis->handle= 0; */ - - /* open the needed object */ - pis->handle= PIL_dynlib_open(pis->name); - if(test_dlerr(pis->name, pis->name)) return; - - if (pis->handle != 0) { - /* find the address of the version function */ - version= (int (*)())PIL_dynlib_find_symbol(pis->handle, "plugin_seq_getversion"); - if (test_dlerr(pis->name, "plugin_seq_getversion")) return; - - if (version != 0) { - pis->version= version(); - if (pis->version >= 2 && pis->version <= 5) { - int (*info_func)(PluginInfo *); - PluginInfo *info= (PluginInfo*) MEM_mallocN(sizeof(PluginInfo), "plugin_info"); - - info_func= (int (*)(PluginInfo *))PIL_dynlib_find_symbol(pis->handle, "plugin_getinfo"); - - if(info_func == NULL) error("No info func"); - else { - info_func(info); - - pis->pname= info->name; - pis->vars= info->nvars; - pis->cfra= info->cfra; - - pis->varstr= info->varstr; - - pis->doit= (void(*)(void))info->seq_doit; - if (info->init) - info->init(); - } - MEM_freeN(info); - - cp= PIL_dynlib_find_symbol(pis->handle, "seqname"); - if(cp) strncpy(cp, seqname, 21); - } else { - printf ("Plugin returned unrecognized version number\n"); - return; - } - } - alloc_private = (void* (*)())PIL_dynlib_find_symbol( - pis->handle, "plugin_seq_alloc_private_data"); - if (alloc_private) { - pis->instance_private_data = alloc_private(); - } - - pis->current_private_data = (void**) - PIL_dynlib_find_symbol( - pis->handle, "plugin_private_data"); - } -} - -static PluginSeq *add_plugin_seq(const char *str, const char *seqname) -{ - PluginSeq *pis; - VarStruct *varstr; - int a; - - pis= MEM_callocN(sizeof(PluginSeq), "PluginSeq"); - - strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE); - open_plugin_seq(pis, seqname); - - if(pis->doit==0) { - if(pis->handle==0) error("no plugin: %s", str); - else error("in plugin: %s", str); - MEM_freeN(pis); - return 0; - } - - /* default values */ - varstr= pis->varstr; - for(a=0; avars; a++, varstr++) { - if( (varstr->type & FLO)==FLO) - pis->data[a]= varstr->def; - else if( (varstr->type & INT)==INT) - *((int *)(pis->data+a))= (int) varstr->def; - } - - return pis; -} - -static void free_plugin_seq(PluginSeq *pis) -{ - if(pis==0) return; - - /* no PIL_dynlib_close: same plugin can be opened multiple times with 1 handle */ - - if (pis->instance_private_data) { - void (*free_private)(void *); - - free_private = (void (*)(void *))PIL_dynlib_find_symbol( - pis->handle, "plugin_seq_free_private_data"); - if (free_private) { - free_private(pis->instance_private_data); - } - } - - MEM_freeN(pis); -} - -static void init_plugin(Sequence * seq, const char * fname) -{ - seq->plugin= (PluginSeq *)add_plugin_seq(fname, seq->name+2); -} - -/* - * FIXME: should query plugin! Could be generator, that needs zero inputs... - */ -static int num_inputs_plugin() -{ - return 1; -} - -static void load_plugin(Sequence * seq) -{ - if (seq) { - open_plugin_seq(seq->plugin, seq->name+2); - } -} - -static void copy_plugin(Sequence * dst, Sequence * src) -{ - if(src->plugin) { - dst->plugin= MEM_dupallocN(src->plugin); - open_plugin_seq(dst->plugin, dst->name+2); - } -} - -static ImBuf * IMB_cast_away_list(ImBuf * i) -{ - if (!i) { - return 0; - } - return (ImBuf*) (((void**) i) + 2); -} - -static void do_plugin_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - char *cp; - int float_rendering; - int use_temp_bufs = 0; /* Are needed since blur.c (and maybe some other - old plugins) do very bad stuff - with imbuf-internals */ - - if(seq->plugin && seq->plugin->doit) { - if(seq->plugin->cfra) - *(seq->plugin->cfra)= frame_to_float(cfra); - - cp = PIL_dynlib_find_symbol( - seq->plugin->handle, "seqname"); - - if(cp) strncpy(cp, seq->name+2, 22); - - if (seq->plugin->current_private_data) { - *seq->plugin->current_private_data - = seq->plugin->instance_private_data; - } - - float_rendering = (out->rect_float != NULL); - - if (seq->plugin->version<=3 && float_rendering) { - use_temp_bufs = 1; - - if (ibuf1) { - ibuf1 = IMB_dupImBuf(ibuf1); - IMB_rect_from_float(ibuf1); - imb_freerectfloatImBuf(ibuf1); - ibuf1->flags &= ~IB_rectfloat; - } - if (ibuf2) { - ibuf2 = IMB_dupImBuf(ibuf2); - IMB_rect_from_float(ibuf2); - imb_freerectfloatImBuf(ibuf2); - ibuf2->flags &= ~IB_rectfloat; - } - if (ibuf3) { - ibuf3 = IMB_dupImBuf(ibuf3); - IMB_rect_from_float(ibuf3); - imb_freerectfloatImBuf(ibuf3); - ibuf3->flags &= ~IB_rectfloat; - } - if (!out->rect) imb_addrectImBuf(out); - imb_freerectfloatImBuf(out); - out->flags &= ~IB_rectfloat; - } - - if (seq->plugin->version<=2) { - if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1); - if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2); - if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3); - } - - if (seq->plugin->version<=4) { - ((SeqDoit)seq->plugin->doit)( - seq->plugin->data, facf0, facf1, x, y, - IMB_cast_away_list(ibuf1), - IMB_cast_away_list(ibuf2), - IMB_cast_away_list(out), - IMB_cast_away_list(ibuf3)); - } else { - ((SeqDoit)seq->plugin->doit)( - seq->plugin->data, facf0, facf1, x, y, - ibuf1, ibuf2, out, ibuf3); - } - - if (seq->plugin->version<=2) { - if (!use_temp_bufs) { - if(ibuf1) IMB_convert_rgba_to_abgr(ibuf1); - if(ibuf2) IMB_convert_rgba_to_abgr(ibuf2); - if(ibuf3) IMB_convert_rgba_to_abgr(ibuf3); - } - IMB_convert_rgba_to_abgr(out); - } - if (seq->plugin->version<=3 && float_rendering) { - IMB_float_from_rect(out); - } - - if (use_temp_bufs) { - if (ibuf1) IMB_freeImBuf(ibuf1); - if (ibuf2) IMB_freeImBuf(ibuf2); - if (ibuf3) IMB_freeImBuf(ibuf3); - } - } -} - -static int do_plugin_early_out(struct Sequence *seq, - float facf0, float facf1) -{ - return 0; -} - -static void free_plugin(struct Sequence * seq) -{ - free_plugin_seq(seq->plugin); - seq->plugin = 0; -} - -/* ********************************************************************** - ALPHA OVER - ********************************************************************** */ - -static void init_alpha_over_or_under(Sequence * seq) -{ - Sequence * seq1 = seq->seq1; - Sequence * seq2 = seq->seq2; - - seq->seq2= seq1; - seq->seq1= seq2; -} - -static void do_alphaover_effect_byte(float facf0, float facf1, int x, int y, - char * rect1, char *rect2, char *out) -{ - int fac2, mfac, fac, fac4; - int xo, tempc; - char *rt1, *rt2, *rt; - - xo= x; - rt1= (char *)rect1; - rt2= (char *)rect2; - rt= (char *)out; - - fac2= (int)(256.0*facf0); - fac4= (int)(256.0*facf1); - - while(y--) { - - x= xo; - while(x--) { - - /* rt = rt1 over rt2 (alpha from rt1) */ - - fac= fac2; - mfac= 256 - ( (fac2*rt1[3])>>8 ); - - if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1); - else { - tempc= ( fac*rt1[0] + mfac*rt2[0])>>8; - if(tempc>255) rt[0]= 255; else rt[0]= tempc; - tempc= ( fac*rt1[1] + mfac*rt2[1])>>8; - if(tempc>255) rt[1]= 255; else rt[1]= tempc; - tempc= ( fac*rt1[2] + mfac*rt2[2])>>8; - if(tempc>255) rt[2]= 255; else rt[2]= tempc; - tempc= ( fac*rt1[3] + mfac*rt2[3])>>8; - if(tempc>255) rt[3]= 255; else rt[3]= tempc; - } - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - fac= fac4; - mfac= 256 - ( (fac4*rt1[3])>>8 ); - - if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else if(mfac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt1); - else { - tempc= ( fac*rt1[0] + mfac*rt2[0])>>8; - if(tempc>255) rt[0]= 255; else rt[0]= tempc; - tempc= ( fac*rt1[1] + mfac*rt2[1])>>8; - if(tempc>255) rt[1]= 255; else rt[1]= tempc; - tempc= ( fac*rt1[2] + mfac*rt2[2])>>8; - if(tempc>255) rt[2]= 255; else rt[2]= tempc; - tempc= ( fac*rt1[3] + mfac*rt2[3])>>8; - if(tempc>255) rt[3]= 255; else rt[3]= tempc; - } - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_alphaover_effect_float(float facf0, float facf1, int x, int y, - float * rect1, float *rect2, float *out) -{ - float fac2, mfac, fac, fac4; - int xo; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= facf0; - fac4= facf1; - - while(y--) { - - x= xo; - while(x--) { - - /* rt = rt1 over rt2 (alpha from rt1) */ - - fac= fac2; - mfac= 1.0 - (fac2*rt1[3]) ; - - if(fac <= 0.0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else if(mfac <=0) { - memcpy(rt, rt1, 4 * sizeof(float)); - } else { - rt[0] = fac*rt1[0] + mfac*rt2[0]; - rt[1] = fac*rt1[1] + mfac*rt2[1]; - rt[2] = fac*rt1[2] + mfac*rt2[2]; - rt[3] = fac*rt1[3] + mfac*rt2[3]; - } - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - fac= fac4; - mfac= 1.0 - (fac4*rt1[3]); - - if(fac <= 0.0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else if(mfac <= 0.0) { - memcpy(rt, rt1, 4 * sizeof(float)); - } else { - rt[0] = fac*rt1[0] + mfac*rt2[0]; - rt[1] = fac*rt1[1] + mfac*rt2[1]; - rt[2] = fac*rt1[2] + mfac*rt2[2]; - rt[3] = fac*rt1[3] + mfac*rt2[3]; - } - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_alphaover_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_alphaover_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_alphaover_effect_byte( - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - - -/* ********************************************************************** - ALPHA UNDER - ********************************************************************** */ - -void do_alphaunder_effect_byte( - float facf0, float facf1, int x, int y, char *rect1, - char *rect2, char *out) -{ - int fac2, mfac, fac, fac4; - int xo; - char *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= (int)(256.0*facf0); - fac4= (int)(256.0*facf1); - - while(y--) { - - x= xo; - while(x--) { - - /* rt = rt1 under rt2 (alpha from rt2) */ - - /* this complex optimalisation is because the - * 'skybuf' can be crossed in - */ - if(rt2[3]==0 && fac2==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1); - else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else { - mfac= rt2[3]; - fac= (fac2*(256-mfac))>>8; - - if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else { - rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8; - rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8; - rt[2]= ( fac*rt1[2] + mfac*rt2[2])>>8; - rt[3]= ( fac*rt1[3] + mfac*rt2[3])>>8; - } - } - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - if(rt2[3]==0 && fac4==256) *( (unsigned int *)rt) = *( (unsigned int *)rt1); - else if(rt2[3]==255) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else { - mfac= rt2[3]; - fac= (fac4*(256-mfac))>>8; - - if(fac==0) *( (unsigned int *)rt) = *( (unsigned int *)rt2); - else { - rt[0]= ( fac*rt1[0] + mfac*rt2[0])>>8; - rt[1]= ( fac*rt1[1] + mfac*rt2[1])>>8; - rt[2]= ( fac*rt1[2] + mfac*rt2[2])>>8; - rt[3]= ( fac*rt1[3] + mfac*rt2[3])>>8; - } - } - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - - -static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) -{ - float fac2, mfac, fac, fac4; - int xo; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= facf0; - fac4= facf1; - - while(y--) { - - x= xo; - while(x--) { - - /* rt = rt1 under rt2 (alpha from rt2) */ - - /* this complex optimalisation is because the - * 'skybuf' can be crossed in - */ - if( rt2[3]<=0 && fac2>=1.0) { - memcpy(rt, rt1, 4 * sizeof(float)); - } else if(rt2[3]>=1.0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else { - mfac = rt2[3]; - fac = fac2 * (1.0 - mfac); - - if(fac == 0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else { - rt[0]= fac*rt1[0] + mfac*rt2[0]; - rt[1]= fac*rt1[1] + mfac*rt2[1]; - rt[2]= fac*rt1[2] + mfac*rt2[2]; - rt[3]= fac*rt1[3] + mfac*rt2[3]; - } - } - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - if(rt2[3]<=0 && fac4 >= 1.0) { - memcpy(rt, rt1, 4 * sizeof(float)); - - } else if(rt2[3]>=1.0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else { - mfac= rt2[3]; - fac= fac4*(1.0-mfac); - - if(fac == 0) { - memcpy(rt, rt2, 4 * sizeof(float)); - } else { - rt[0]= fac * rt1[0] + mfac * rt2[0]; - rt[1]= fac * rt1[1] + mfac * rt2[1]; - rt[2]= fac * rt1[2] + mfac * rt2[2]; - rt[3]= fac * rt1[3] + mfac * rt2[3]; - } - } - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_alphaunder_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_alphaunder_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_alphaunder_effect_byte( - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - - -/* ********************************************************************** - CROSS - ********************************************************************** */ - -void do_cross_effect_byte(float facf0, float facf1, int x, int y, - char *rect1, char *rect2, - char *out) -{ - int fac1, fac2, fac3, fac4; - int xo; - char *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= (int)(256.0*facf0); - fac1= 256-fac2; - fac4= (int)(256.0*facf1); - fac3= 256-fac4; - - while(y--) { - - x= xo; - while(x--) { - - rt[0]= (fac1*rt1[0] + fac2*rt2[0])>>8; - rt[1]= (fac1*rt1[1] + fac2*rt2[1])>>8; - rt[2]= (fac1*rt1[2] + fac2*rt2[2])>>8; - rt[3]= (fac1*rt1[3] + fac2*rt2[3])>>8; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - rt[0]= (fac3*rt1[0] + fac4*rt2[0])>>8; - rt[1]= (fac3*rt1[1] + fac4*rt2[1])>>8; - rt[2]= (fac3*rt1[2] + fac4*rt2[2])>>8; - rt[3]= (fac3*rt1[3] + fac4*rt2[3])>>8; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - } -} - -void do_cross_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, float *out) -{ - float fac1, fac2, fac3, fac4; - int xo; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= facf0; - fac1= 1.0 - fac2; - fac4= facf1; - fac3= 1.0 - fac4; - - while(y--) { - - x= xo; - while(x--) { - - rt[0]= fac1*rt1[0] + fac2*rt2[0]; - rt[1]= fac1*rt1[1] + fac2*rt2[1]; - rt[2]= fac1*rt1[2] + fac2*rt2[2]; - rt[3]= fac1*rt1[3] + fac2*rt2[3]; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - rt[0]= fac3*rt1[0] + fac4*rt2[0]; - rt[1]= fac3*rt1[1] + fac4*rt2[1]; - rt[2]= fac3*rt1[2] + fac4*rt2[2]; - rt[3]= fac3*rt1[3] + fac4*rt2[3]; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - } -} - -/* carefull: also used by speed effect! */ - -static void do_cross_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_cross_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_cross_effect_byte( - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - - -/* ********************************************************************** - GAMMA CROSS - ********************************************************************** */ - -/* copied code from initrender.c */ -static unsigned short *gamtab = 0; -static unsigned short *igamtab1 = 0; -static int gamma_tabs_refcount = 0; - -#define RE_GAMMA_TABLE_SIZE 400 - -static float gamma_range_table[RE_GAMMA_TABLE_SIZE + 1]; -static float gamfactor_table[RE_GAMMA_TABLE_SIZE]; -static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1]; -static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE]; -static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1]; -static float color_step; -static float inv_color_step; -static float valid_gamma; -static float valid_inv_gamma; - -static void makeGammaTables(float gamma) -{ - /* we need two tables: one forward, one backward */ - int i; - - valid_gamma = gamma; - valid_inv_gamma = 1.0 / gamma; - color_step = 1.0 / RE_GAMMA_TABLE_SIZE; - inv_color_step = (float) RE_GAMMA_TABLE_SIZE; - - /* We could squeeze out the two range tables to gain some memory. */ - for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) { - color_domain_table[i] = i * color_step; - gamma_range_table[i] = pow(color_domain_table[i], - valid_gamma); - inv_gamma_range_table[i] = pow(color_domain_table[i], - valid_inv_gamma); - } - - /* The end of the table should match 1.0 carefully. In order to avoid */ - /* rounding errors, we just set this explicitly. The last segment may */ - /* have a different lenght than the other segments, but our */ - /* interpolation is insensitive to that. */ - color_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0; - gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0; - inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0; - - /* To speed up calculations, we make these calc factor tables. They are */ - /* multiplication factors used in scaling the interpolation. */ - for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) { - gamfactor_table[i] = inv_color_step - * (gamma_range_table[i + 1] - gamma_range_table[i]) ; - inv_gamfactor_table[i] = inv_color_step - * (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ; - } - -} /* end of void makeGammaTables(float gamma) */ - - -static float gammaCorrect(float c) -{ - int i; - float res = 0.0; - - i = floor(c * inv_color_step); - /* Clip to range [0,1]: outside, just do the complete calculation. */ - /* We may have some performance problems here. Stretching up the LUT */ - /* may help solve that, by exchanging LUT size for the interpolation. */ - /* Negative colors are explicitly handled. */ - if (i < 0) res = -pow(abs(c), valid_gamma); - else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma); - else res = gamma_range_table[i] + - ( (c - color_domain_table[i]) * gamfactor_table[i]); - - return res; -} /* end of float gammaCorrect(float col) */ - -/* ------------------------------------------------------------------------- */ - -static float invGammaCorrect(float col) -{ - int i; - float res = 0.0; - - i = floor(col*inv_color_step); - /* Negative colors are explicitly handled. */ - if (i < 0) res = -pow(abs(col), valid_inv_gamma); - else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma); - else res = inv_gamma_range_table[i] + - ( (col - color_domain_table[i]) * inv_gamfactor_table[i]); - - return res; -} /* end of float invGammaCorrect(float col) */ - - -static void gamtabs(float gamma) -{ - float val, igamma= 1.0f/gamma; - int a; - - gamtab= MEM_mallocN(65536*sizeof(short), "initGaus2"); - igamtab1= MEM_mallocN(256*sizeof(short), "initGaus2"); - - /* gamtab: in short, out short */ - for(a=0; a<65536; a++) { - val= a; - val/= 65535.0; - - if(gamma==2.0) val= sqrt(val); - else if(gamma!=1.0) val= pow(val, igamma); - - gamtab[a]= (65535.99*val); - } - /* inverse gamtab1 : in byte, out short */ - for(a=1; a<=256; a++) { - if(gamma==2.0) igamtab1[a-1]= a*a-1; - else if(gamma==1.0) igamtab1[a-1]= 256*a-1; - else { - val= a/256.0; - igamtab1[a-1]= (65535.0*pow(val, gamma)) -1 ; - } - } - -} - -static void alloc_or_ref_gammatabs() -{ - if (gamma_tabs_refcount == 0) { - gamtabs(2.0f); - makeGammaTables(2.0f); - } - gamma_tabs_refcount++; -} - -static void init_gammacross(Sequence * seq) -{ - alloc_or_ref_gammatabs(); -} - -static void load_gammacross(Sequence * seq) -{ - alloc_or_ref_gammatabs(); -} - -static void free_gammacross(Sequence * seq) -{ - if (--gamma_tabs_refcount == 0) { - MEM_freeN(gamtab); - MEM_freeN(igamtab1); - gamtab = 0; - igamtab1 = 0; - } - if (gamma_tabs_refcount < 0) { - fprintf(stderr, "seqeffects: free_gammacross double free!\n"); - } -} - -static void do_gammacross_effect_byte(float facf0, float facf1, - int x, int y, - char *rect1, - char *rect2, - char *out) -{ - int fac1, fac2, col; - int xo; - char *rt1, *rt2, *rt; - - xo= x; - rt1= (char *)rect1; - rt2= (char *)rect2; - rt= (char *)out; - - fac2= (int)(256.0*facf0); - fac1= 256-fac2; - - while(y--) { - - x= xo; - while(x--) { - - col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8; - if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col=(fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8; - if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8; - if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8; - if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - col= (fac1*igamtab1[rt1[0]] + fac2*igamtab1[rt2[0]])>>8; - if(col>65535) rt[0]= 255; else rt[0]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col= (fac1*igamtab1[rt1[1]] + fac2*igamtab1[rt2[1]])>>8; - if(col>65535) rt[1]= 255; else rt[1]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col= (fac1*igamtab1[rt1[2]] + fac2*igamtab1[rt2[2]])>>8; - if(col>65535) rt[2]= 255; else rt[2]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - col= (fac1*igamtab1[rt1[3]] + fac2*igamtab1[rt2[3]])>>8; - if(col>65535) rt[3]= 255; else rt[3]= ( (char *)(gamtab+col))[MOST_SIG_BYTE]; - - rt1+= 4; rt2+= 4; rt+= 4; - } - } - -} - -static void do_gammacross_effect_float(float facf0, float facf1, - int x, int y, - float *rect1, float *rect2, - float *out) -{ - float fac1, fac2, col; - int xo; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac2= facf0; - fac1= 1.0 - fac2; - - while(y--) { - - x= xo * 4; - while(x--) { - - *rt= gammaCorrect( - fac1 * invGammaCorrect(*rt1) - + fac2 * invGammaCorrect(*rt2)); - rt1++; rt2++; rt++; - } - - if(y==0) break; - y--; - - x= xo * 4; - while(x--) { - - col= gammaCorrect( - fac1*invGammaCorrect(*rt1) - + fac2*invGammaCorrect(*rt2)); - - rt1++; rt2++; rt++; - } - } -} - -static void do_gammacross_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_gammacross_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_gammacross_effect_byte( - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - - -/* ********************************************************************** - ADD - ********************************************************************** */ - -static void do_add_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, - unsigned char *out) -{ - int col, xo, fac1, fac3; - char *rt1, *rt2, *rt; - - xo= x; - rt1= (char *)rect1; - rt2= (char *)rect2; - rt= (char *)out; - - fac1= (int)(256.0*facf0); - fac3= (int)(256.0*facf1); - - while(y--) { - - x= xo; - while(x--) { - - col= rt1[0]+ ((fac1*rt2[0])>>8); - if(col>255) rt[0]= 255; else rt[0]= col; - col= rt1[1]+ ((fac1*rt2[1])>>8); - if(col>255) rt[1]= 255; else rt[1]= col; - col= rt1[2]+ ((fac1*rt2[2])>>8); - if(col>255) rt[2]= 255; else rt[2]= col; - col= rt1[3]+ ((fac1*rt2[3])>>8); - if(col>255) rt[3]= 255; else rt[3]= col; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - col= rt1[0]+ ((fac3*rt2[0])>>8); - if(col>255) rt[0]= 255; else rt[0]= col; - col= rt1[1]+ ((fac3*rt2[1])>>8); - if(col>255) rt[1]= 255; else rt[1]= col; - col= rt1[2]+ ((fac3*rt2[2])>>8); - if(col>255) rt[2]= 255; else rt[2]= col; - col= rt1[3]+ ((fac3*rt2[3])>>8); - if(col>255) rt[3]= 255; else rt[3]= col; - - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_add_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) -{ - int xo; - float fac1, fac3; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac1= facf0; - fac3= facf1; - - while(y--) { - - x= xo * 4; - while(x--) { - *rt = *rt1 + fac1 * (*rt2); - - rt1++; rt2++; rt++; - } - - if(y==0) break; - y--; - - x= xo * 4; - while(x--) { - *rt = *rt1 + fac3 * (*rt2); - - rt1++; rt2++; rt++; - } - } -} - -static void do_add_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_add_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_add_effect_byte( - facf0, facf1, x, y, - (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, - (unsigned char*) out->rect); - } -} - - -/* ********************************************************************** - SUB - ********************************************************************** */ - -static void do_sub_effect_byte(float facf0, float facf1, - int x, int y, - char *rect1, char *rect2, char *out) -{ - int col, xo, fac1, fac3; - char *rt1, *rt2, *rt; - - xo= x; - rt1= (char *)rect1; - rt2= (char *)rect2; - rt= (char *)out; - - fac1= (int)(256.0*facf0); - fac3= (int)(256.0*facf1); - - while(y--) { - - x= xo; - while(x--) { - - col= rt1[0]- ((fac1*rt2[0])>>8); - if(col<0) rt[0]= 0; else rt[0]= col; - col= rt1[1]- ((fac1*rt2[1])>>8); - if(col<0) rt[1]= 0; else rt[1]= col; - col= rt1[2]- ((fac1*rt2[2])>>8); - if(col<0) rt[2]= 0; else rt[2]= col; - col= rt1[3]- ((fac1*rt2[3])>>8); - if(col<0) rt[3]= 0; else rt[3]= col; - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - col= rt1[0]- ((fac3*rt2[0])>>8); - if(col<0) rt[0]= 0; else rt[0]= col; - col= rt1[1]- ((fac3*rt2[1])>>8); - if(col<0) rt[1]= 0; else rt[1]= col; - col= rt1[2]- ((fac3*rt2[2])>>8); - if(col<0) rt[2]= 0; else rt[2]= col; - col= rt1[3]- ((fac3*rt2[3])>>8); - if(col<0) rt[3]= 0; else rt[3]= col; - - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_sub_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) -{ - int xo; - float fac1, fac3; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac1= facf0; - fac3= facf1; - - while(y--) { - - x= xo * 4; - while(x--) { - *rt = *rt1 - fac1 * (*rt2); - - rt1++; rt2++; rt++; - } - - if(y==0) break; - y--; - - x= xo * 4; - while(x--) { - *rt = *rt1 - fac3 * (*rt2); - - rt1++; rt2++; rt++; - } - } -} - -static void do_sub_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_sub_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_sub_effect_byte( - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - -/* ********************************************************************** - DROP - ********************************************************************** */ - -/* Must be > 0 or add precopy, etc to the function */ -#define XOFF 8 -#define YOFF 8 - -static void do_drop_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect2i, unsigned char *rect1i, - unsigned char *outi) -{ - int height, width, temp, fac, fac1, fac2; - char *rt1, *rt2, *out; - int field= 1; - - width= x; - height= y; - - fac1= (int)(70.0*facf0); - fac2= (int)(70.0*facf1); - - rt2= (char*) (rect2i + YOFF*width); - rt1= (char*) rect1i; - out= (char*) outi; - for (y=0; y>8); - - *(out++)= MAX2(0, *rt1 - temp); rt1++; - *(out++)= MAX2(0, *rt1 - temp); rt1++; - *(out++)= MAX2(0, *rt1 - temp); rt1++; - *(out++)= MAX2(0, *rt1 - temp); rt1++; - rt2+=4; - } - rt2+=XOFF*4; - } - memcpy(out, rt1, sizeof(int)*YOFF*width); -} - -static void do_drop_effect_float(float facf0, float facf1, int x, int y, - float *rect2i, float *rect1i, - float *outi) -{ - int height, width; - float temp, fac, fac1, fac2; - float *rt1, *rt2, *out; - int field= 1; - - width= x; - height= y; - - fac1= 70.0*facf0; - fac2= 70.0*facf1; - - rt2= (rect2i + YOFF*width); - rt1= rect1i; - out= outi; - for (y=0; yrect_float) { - do_drop_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_drop_effect_byte( - facf0, facf1, x, y, - (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, - (unsigned char*) out->rect); - } -} - -/* ********************************************************************** - MUL - ********************************************************************** */ - -static void do_mul_effect_byte(float facf0, float facf1, int x, int y, - unsigned char *rect1, unsigned char *rect2, - unsigned char *out) -{ - int xo, fac1, fac3; - char *rt1, *rt2, *rt; - - xo= x; - rt1= (char *)rect1; - rt2= (char *)rect2; - rt= (char *)out; - - fac1= (int)(256.0*facf0); - fac3= (int)(256.0*facf1); - - /* formula: - * fac*(a*b) + (1-fac)*a => fac*a*(b-1)+axaux= c*px + py*s ;//+centx - yaux= -s*px + c*py;//+centy - */ - - while(y--) { - - x= xo; - while(x--) { - - rt[0]= rt1[0] + ((fac1*rt1[0]*(rt2[0]-256))>>16); - rt[1]= rt1[1] + ((fac1*rt1[1]*(rt2[1]-256))>>16); - rt[2]= rt1[2] + ((fac1*rt1[2]*(rt2[2]-256))>>16); - rt[3]= rt1[3] + ((fac1*rt1[3]*(rt2[3]-256))>>16); - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - rt[0]= rt1[0] + ((fac3*rt1[0]*(rt2[0]-256))>>16); - rt[1]= rt1[1] + ((fac3*rt1[1]*(rt2[1]-256))>>16); - rt[2]= rt1[2] + ((fac3*rt1[2]*(rt2[2]-256))>>16); - rt[3]= rt1[3] + ((fac3*rt1[3]*(rt2[3]-256))>>16); - - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_mul_effect_float(float facf0, float facf1, int x, int y, - float *rect1, float *rect2, - float *out) -{ - int xo; - float fac1, fac3; - float *rt1, *rt2, *rt; - - xo= x; - rt1= rect1; - rt2= rect2; - rt= out; - - fac1= facf0; - fac3= facf1; - - /* formula: - * fac*(a*b) + (1-fac)*a => fac*a*(b-1)+a - */ - - while(y--) { - - x= xo; - while(x--) { - - rt[0]= rt1[0] + fac1*rt1[0]*(rt2[0]-1.0); - rt[1]= rt1[1] + fac1*rt1[1]*(rt2[1]-1.0); - rt[2]= rt1[2] + fac1*rt1[2]*(rt2[2]-1.0); - rt[3]= rt1[3] + fac1*rt1[3]*(rt2[3]-1.0); - - rt1+= 4; rt2+= 4; rt+= 4; - } - - if(y==0) break; - y--; - - x= xo; - while(x--) { - - rt[0]= rt1[0] + fac3*rt1[0]*(rt2[0]-1.0); - rt[1]= rt1[1] + fac3*rt1[1]*(rt2[1]-1.0); - rt[2]= rt1[2] + fac3*rt1[2]*(rt2[2]-1.0); - rt[3]= rt1[3] + fac3*rt1[3]*(rt2[3]-1.0); - - rt1+= 4; rt2+= 4; rt+= 4; - } - } -} - -static void do_mul_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_mul_effect_float( - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_mul_effect_byte( - facf0, facf1, x, y, - (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, - (unsigned char*) out->rect); - } -} - -/* ********************************************************************** - WIPE - ********************************************************************** */ - -// This function calculates the blur band for the wipe effects -static float in_band(float width,float dist, float perc,int side,int dir){ - - float t1,t2,alpha,percwidth; - if(width == 0) - return (float)side; - if(side == 1) - percwidth = width * perc; - else - percwidth = width * (1 - perc); - - if(width < dist) - return side; - - t1 = dist / width; //percentange of width that is - t2 = 1 / width; //amount of alpha per % point - - if(side == 1) - alpha = (t1*t2*100) + (1-perc); // add point's alpha contrib to current position in wipe - else - alpha = (1-perc) - (t1*t2*100); - - if(dir == 0) - alpha = 1-alpha; - return alpha; -} - -static float check_zone(int x, int y, int xo, int yo, - Sequence *seq, float facf0) -{ - float posx, posy,hyp,hyp2,angle,hwidth,b1,b2,b3,pointdist; -/*some future stuff -float hyp3,hyp4,b4,b5 -*/ - float temp1,temp2,temp3,temp4; //some placeholder variables - float halfx = xo/2; - float halfy = yo/2; - float widthf,output=0; - WipeVars *wipe = (WipeVars *)seq->effectdata; - int width; - - angle = wipe->angle; - if(angle < 0){ - x = xo-x; - //y = yo-y - } - angle = pow(fabs(angle)/45,log(xo)/log(2)); - - posy = facf0 * yo; - if(wipe->forward){ - posx = facf0 * xo; - posy = facf0 * yo; - } else{ - posx = xo - facf0 * xo; - posy = yo - facf0 * yo; - } - switch (wipe->wipetype) { - case DO_SINGLE_WIPE: - width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; - - if (angle == 0.0)angle = 0.000001; - b1 = posy - (-angle)*posx; - b2 = y - (-angle)*x; - hyp = fabs(angle*x+y+(-posy-angle*posx))/sqrt(angle*angle+1); - if(angle < 0){ - temp1 = b1; - b1 = b2; - b2 = temp1; - } - if(wipe->forward){ - if(b1 < b2) - output = in_band(width,hyp,facf0,1,1); - else - output = in_band(width,hyp,facf0,0,1); - } else{ - if(b1 < b2) - output = in_band(width,hyp,facf0,0,1); - else - output = in_band(width,hyp,facf0,1,1); - } - break; - - - case DO_DOUBLE_WIPE: - if(!wipe->forward)facf0 = 1-facf0; // Go the other direction - - width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); // calculate the blur width - hwidth = (float)width/2.0; - if (angle == 0)angle = 0.000001; - b1 = posy/2 - (-angle)*posx/2; - b3 = (yo-posy/2) - (-angle)*(xo-posx/2); - b2 = y - (-angle)*x; - - hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); - hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - - temp1 = xo*(1-facf0/2)-xo*facf0/2; - temp2 = yo*(1-facf0/2)-yo*facf0/2; - pointdist = sqrt(temp1*temp1 + temp2*temp2); - - if(b2 < b1 && b2 < b3 ){ - if(hwidth < pointdist) - output = in_band(hwidth,hyp,facf0,0,1); - } else if(b2 > b1 && b2 > b3 ){ - if(hwidth < pointdist) - output = in_band(hwidth,hyp2,facf0,0,1); - } else { - if( hyp < hwidth && hyp2 > hwidth ) - output = in_band(hwidth,hyp,facf0,1,1); - else if( hyp > hwidth && hyp2 < hwidth ) - output = in_band(hwidth,hyp2,facf0,1,1); - else - output = in_band(hwidth,hyp2,facf0,1,1) * in_band(hwidth,hyp,facf0,1,1); - } - if(!wipe->forward)output = 1-output; - break; - case DO_CLOCK_WIPE: - /* - temp1: angle of effect center in rads - temp2: angle of line through (halfx,halfy) and (x,y) in rads - temp3: angle of low side of blur - temp4: angle of high side of blur - */ - output = 1-facf0; - widthf = wipe->edgeWidth*2*3.14159; - temp1 = 2 * 3.14159 * facf0; - - if(wipe->forward){ - temp1 = 2*3.14159-temp1; - } - - x = x - halfx; - y = y - halfy; - - temp2 = asin(abs(y)/sqrt(x*x + y*y)); - if(x <= 0 && y >= 0) temp2 = 3.14159 - temp2; - else if(x<=0 && y <= 0) temp2 += 3.14159; - else if(x >= 0 && y <= 0) temp2 = 2*3.14159 - temp2; - - if(wipe->forward){ - temp3 = temp1-(widthf/2)*facf0; - temp4 = temp1+(widthf/2)*(1-facf0); - } else{ - temp3 = temp1-(widthf/2)*(1-facf0); - temp4 = temp1+(widthf/2)*facf0; - } - if (temp3 < 0) temp3 = 0; - if (temp4 > 2*3.14159) temp4 = 2*3.14159; - - - if(temp2 < temp3) output = 0; - else if (temp2 > temp4) output = 1; - else output = (temp2-temp3)/(temp4-temp3); - if(x == 0 && y == 0) output = 1; - if(output != output) output = 1; - if(wipe->forward) output = 1 - output; - break; - /* BOX WIPE IS NOT WORKING YET */ - /* case DO_CROSS_WIPE: */ - /* BOX WIPE IS NOT WORKING YET */ - /* - case DO_BOX_WIPE: - if(invert)facf0 = 1-facf0; - - width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; - if (angle == 0)angle = 0.000001; - b1 = posy/2 - (-angle)*posx/2; - b3 = (yo-posy/2) - (-angle)*(xo-posx/2); - b2 = y - (-angle)*x; - - hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); - hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - - temp1 = xo*(1-facf0/2)-xo*facf0/2; - temp2 = yo*(1-facf0/2)-yo*facf0/2; - pointdist = sqrt(temp1*temp1 + temp2*temp2); - - if(b2 < b1 && b2 < b3 ){ - if(hwidth < pointdist) - output = in_band(hwidth,hyp,facf0,0,1); - } else if(b2 > b1 && b2 > b3 ){ - if(hwidth < pointdist) - output = in_band(hwidth,hyp2,facf0,0,1); - } else { - if( hyp < hwidth && hyp2 > hwidth ) - output = in_band(hwidth,hyp,facf0,1,1); - else if( hyp > hwidth && hyp2 < hwidth ) - output = in_band(hwidth,hyp2,facf0,1,1); - else - output = in_band(hwidth,hyp2,facf0,1,1) * in_band(hwidth,hyp,facf0,1,1); - } - - if(invert)facf0 = 1-facf0; - angle = -1/angle; - b1 = posy/2 - (-angle)*posx/2; - b3 = (yo-posy/2) - (-angle)*(xo-posx/2); - b2 = y - (-angle)*x; - - hyp = abs(angle*x+y+(-posy/2-angle*posx/2))/sqrt(angle*angle+1); - hyp2 = abs(angle*x+y+(-(yo-posy/2)-angle*(xo-posx/2)))/sqrt(angle*angle+1); - - if(b2 < b1 && b2 < b3 ){ - if(hwidth < pointdist) - output *= in_band(hwidth,hyp,facf0,0,1); - } else if(b2 > b1 && b2 > b3 ){ - if(hwidth < pointdist) - output *= in_band(hwidth,hyp2,facf0,0,1); - } else { - if( hyp < hwidth && hyp2 > hwidth ) - output *= in_band(hwidth,hyp,facf0,1,1); - else if( hyp > hwidth && hyp2 < hwidth ) - output *= in_band(hwidth,hyp2,facf0,1,1); - else - output *= in_band(hwidth,hyp2,facf0,1,1) * in_band(hwidth,hyp,facf0,1,1); - } - - break; -*/ - case DO_IRIS_WIPE: - if(xo > yo) yo = xo; - else xo = yo; - - if(!wipe->forward) facf0 = 1-facf0; - - width = (int)(wipe->edgeWidth*((xo+yo)/2.0)); - hwidth = (float)width/2.0; - - temp1 = (halfx-(halfx)*facf0); - pointdist = sqrt(temp1*temp1 + temp1*temp1); - - temp2 = sqrt((halfx-x)*(halfx-x) + (halfy-y)*(halfy-y)); - if(temp2 > pointdist) output = in_band(hwidth,fabs(temp2-pointdist),facf0,0,1); - else output = in_band(hwidth,fabs(temp2-pointdist),facf0,1,1); - - if(!wipe->forward) output = 1-output; - - break; - } - if (output < 0) output = 0; - else if(output > 1) output = 1; - return output; -} - -static void init_wipe_effect(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct WipeVars), "wipevars"); -} - -static int num_inputs_wipe() -{ - return 1; -} - -static void free_wipe_effect(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; -} - -static void copy_wipe_effect(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -static void do_wipe_effect_byte(Sequence *seq, float facf0, float facf1, - int x, int y, - unsigned char *rect1, - unsigned char *rect2, unsigned char *out) -{ - int xo, yo; - char *rt1, *rt2, *rt; - rt1 = (char *)rect1; - rt2 = (char *)rect2; - rt = (char *)out; - - xo = x; - yo = y; - for(y=0;yrect_float) { - do_wipe_effect_float(seq, - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_wipe_effect_byte(seq, - facf0, facf1, x, y, - (unsigned char*) ibuf1->rect, (unsigned char*) ibuf2->rect, - (unsigned char*) out->rect); - } -} -/* ********************************************************************** - TRANSFORM - ********************************************************************** */ -static void init_transform_effect(Sequence *seq) -{ - TransformVars *scale; - - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct TransformVars), "transformvars"); - - scale = (TransformVars *)seq->effectdata; - scale->ScalexIni = 1; - scale->ScaleyIni = 1; - scale->ScalexFin = 1; - scale->ScaleyFin = 1; - - scale->xIni=0; - scale->xFin=0; - scale->yIni=0; - scale->yFin=0; - - scale->rotIni=0; - scale->rotFin=0; - - scale->interpolation=1; - scale->percent=1; -} - -static int num_inputs_transform() -{ - return 1; -} - -static void free_transform_effect(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; -} - -static void copy_transform_effect(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -static void do_transform(Sequence * seq,float facf0, int x, int y, - struct ImBuf *ibuf1,struct ImBuf *out) -{ - int xo, yo, xi, yi; - float xs,ys,factxScale,factyScale,tx,ty,rad,s,c,xaux,yaux,factRot,px,py; - TransformVars *scale; - - scale = (TransformVars *)seq->effectdata; - xo = x; - yo = y; - - //factor scale - factxScale = scale->ScalexIni + (scale->ScalexFin - scale->ScalexIni) * facf0; - factyScale = scale->ScaleyIni + (scale->ScaleyFin - scale->ScaleyIni) * facf0; - - //Factor translate - if(!scale->percent){ - tx = scale->xIni+(xo / 2.0f) + (scale->xFin-(xo / 2.0f) - scale->xIni+(xo / 2.0f)) * facf0; - ty = scale->yIni+(yo / 2.0f) + (scale->yFin-(yo / 2.0f) - scale->yIni+(yo / 2.0f)) * facf0; - }else{ - tx = xo*(scale->xIni/100.0)+(xo / 2.0f) + (xo*(scale->xFin/100.0)-(xo / 2.0f) - xo*(scale->xIni/100.0)+(xo / 2.0f)) * facf0; - ty = yo*(scale->yIni/100.0)+(yo / 2.0f) + (yo*(scale->yFin/100.0)-(yo / 2.0f) - yo*(scale->yIni/100.0)+(yo / 2.0f)) * facf0; - } - - //factor Rotate - factRot = scale->rotIni + (scale->rotFin - scale->rotIni) * facf0; - rad = (M_PI * factRot) / 180.0f; - s= sin(rad); - c= cos(rad); - - for (yi = 0; yi < yo; yi++) { - for (xi = 0; xi < xo; xi++) { - //tranlate point - px = xi-tx; - py = yi-ty; - - //rotate point with center ref - xaux = c*px + py*s ; - yaux = -s*px + c*py; - - //scale point with center ref - xs = xaux / factxScale; - ys = yaux / factyScale; - - //undo reference center point - xs += (xo / 2.0f); - ys += (yo / 2.0f); - - //interpolate - if(scale->interpolation==0) - neareast_interpolation(ibuf1,out, xs,ys,xi,yi); - if(scale->interpolation==1) - bilinear_interpolation(ibuf1,out, xs,ys,xi,yi); - if(scale->interpolation==2) - bicubic_interpolation(ibuf1,out, xs,ys,xi,yi); - } - } - -} -static void do_transform_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - do_transform(seq, facf0, x, y, ibuf1, out); -} - - -/* ********************************************************************** - GLOW - ********************************************************************** */ - -static void RVBlurBitmap2_byte ( unsigned char* map, int width,int height, - float blur, - int quality) -/* MUUUCCH better than the previous blur. */ -/* We do the blurring in two passes which is a whole lot faster. */ -/* I changed the math arount to implement an actual Gaussian */ -/* distribution. */ -/* */ -/* Watch out though, it tends to misbehaven with large blur values on */ -/* a small bitmap. Avoid avoid avoid. */ -/*=============================== */ -{ - unsigned char* temp=NULL,*swap; - float *filter=NULL; - int x,y,i,fx,fy; - int index, ix, halfWidth; - float fval, k, curColor[3], curColor2[3], weight=0; - - /* If we're not really blurring, bail out */ - if (blur<=0) - return; - - /* Allocate memory for the tempmap and the blur filter matrix */ - temp= MEM_mallocN( (width*height*4), "blurbitmaptemp"); - if (!temp) - return; - - /* Allocate memory for the filter elements */ - halfWidth = ((quality+1)*blur); - filter = (float *)MEM_mallocN(sizeof(float)*halfWidth*2, "blurbitmapfilter"); - if (!filter){ - MEM_freeN (temp); - return; - } - - /* Apparently we're calculating a bell curve */ - /* based on the standard deviation (or radius) */ - /* This code is based on an example */ - /* posted to comp.graphics.algorithms by */ - /* Blancmange (bmange@airdmhor.gen.nz) */ - - k = -1.0/(2.0*3.14159*blur*blur); - fval=0; - for (ix = 0;ix< halfWidth;ix++){ - weight = (float)exp(k*(ix*ix)); - filter[halfWidth - ix] = weight; - filter[halfWidth + ix] = weight; - } - filter[0] = weight; - - /* Normalize the array */ - fval=0; - for (ix = 0;ix< halfWidth*2;ix++) - fval+=filter[ix]; - - for (ix = 0;ix< halfWidth*2;ix++) - filter[ix]/=fval; - - /* Blur the rows */ - for (y=0;y=0)&&(i=0)&&(i=0)&&(i=0)&&(i0){ - out[index+GlowR]=MIN2(255*clamp, (in[index+GlowR]*boost*intensity)/255); - out[index+GlowG]=MIN2(255*clamp, (in[index+GlowG]*boost*intensity)/255); - out[index+GlowB]=MIN2(255*clamp, (in[index+GlowB]*boost*intensity)/255); - out[index+GlowA]=MIN2(255*clamp, (in[index+GlowA]*boost*intensity)/255); - } else{ - out[index+GlowR]=0; - out[index+GlowG]=0; - out[index+GlowB]=0; - out[index+GlowA]=0; - } - } - } -} - -static void RVIsolateHighlights_float (float* in, float* out, - int width, int height, float threshold, - float boost, float clamp) -{ - int x,y,index; - float intensity; - - - for(y=0;y< height;y++) { - for (x=0;x< width;x++) { - index= (x+y*width)*4; - - /* Isolate the intensity */ - intensity=(in[index+GlowR]+in[index+GlowG]+in[index+GlowB]-threshold); - if (intensity>0){ - out[index+GlowR]=MIN2(clamp, (in[index+GlowR]*boost*intensity)); - out[index+GlowG]=MIN2(clamp, (in[index+GlowG]*boost*intensity)); - out[index+GlowB]=MIN2(clamp, (in[index+GlowB]*boost*intensity)); - out[index+GlowA]=MIN2(clamp, (in[index+GlowA]*boost*intensity)); - } else{ - out[index+GlowR]=0; - out[index+GlowG]=0; - out[index+GlowB]=0; - out[index+GlowA]=0; - } - } - } -} - -static void init_glow_effect(Sequence *seq) -{ - GlowVars *glow; - - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct GlowVars), "glowvars"); - - glow = (GlowVars *)seq->effectdata; - glow->fMini = 0.25; - glow->fClamp = 1.0; - glow->fBoost = 0.5; - glow->dDist = 3.0; - glow->dQuality = 3; - glow->bNoComp = 0; -} - -static int num_inputs_glow() -{ - return 1; -} - -static void free_glow_effect(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; -} - -static void copy_glow_effect(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -//void do_glow_effect(Cast *cast, float facf0, float facf1, int xo, int yo, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *outbuf, ImBuf *use) -static void do_glow_effect_byte(Sequence *seq, float facf0, float facf1, - int x, int y, char *rect1, - char *rect2, char *out) -{ - unsigned char *outbuf=(unsigned char *)out; - unsigned char *inbuf=(unsigned char *)rect1; - GlowVars *glow = (GlowVars *)seq->effectdata; - struct RenderData *rd = &G.scene->r; - - RVIsolateHighlights_byte(inbuf, outbuf , x, y, glow->fMini*765, glow->fBoost, glow->fClamp); - RVBlurBitmap2_byte (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality); - if (!glow->bNoComp) - RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y); -} - -static void do_glow_effect_float(Sequence *seq, float facf0, float facf1, - int x, int y, - float *rect1, float *rect2, float *out) -{ - float *outbuf = out; - float *inbuf = rect1; - GlowVars *glow = (GlowVars *)seq->effectdata; - struct RenderData *rd = &G.scene->r; - - RVIsolateHighlights_float(inbuf, outbuf , x, y, glow->fMini*3.0f, glow->fBoost, glow->fClamp); - RVBlurBitmap2_float (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality); - if (!glow->bNoComp) - RVAddBitmaps_float (inbuf , outbuf, outbuf, x, y); -} - -static void do_glow_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - if (out->rect_float) { - do_glow_effect_float(seq, - facf0, facf1, x, y, - ibuf1->rect_float, ibuf2->rect_float, - out->rect_float); - } else { - do_glow_effect_byte(seq, - facf0, facf1, x, y, - (char*) ibuf1->rect, (char*) ibuf2->rect, - (char*) out->rect); - } -} - -/* ********************************************************************** - SOLID COLOR - ********************************************************************** */ - -static void init_solid_color(Sequence *seq) -{ - SolidColorVars *cv; - - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct SolidColorVars), "solidcolor"); - - cv = (SolidColorVars *)seq->effectdata; - cv->col[0] = cv->col[1] = cv->col[2] = 0.5; -} - -static int num_inputs_color() -{ - return 0; -} - -static void free_solid_color(Sequence *seq) -{ - if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; -} - -static void copy_solid_color(Sequence *dst, Sequence *src) -{ - dst->effectdata = MEM_dupallocN(src->effectdata); -} - -static int early_out_color(struct Sequence *seq, - float facf0, float facf1) -{ - return -1; -} - -static void do_solid_color(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - SolidColorVars *cv = (SolidColorVars *)seq->effectdata; - - unsigned char *rect; - float *rect_float; - - if (out->rect) { - rect = (unsigned char *)out->rect; - - for(y=0; yy; y++) { - for(x=0; xx; x++, rect+=4) { - rect[0]= (char)(cv->col[0]*255); - rect[1]= (char)(cv->col[1]*255); - rect[2]= (char)(cv->col[2]*255); - rect[3]= 255; - } - } - } else if (out->rect_float) { - rect_float = out->rect_float; - - for(y=0; yy; y++) { - for(x=0; xx; x++, rect_float+=4) { - rect_float[0]= cv->col[0]; - rect_float[1]= cv->col[1]; - rect_float[2]= cv->col[2]; - rect_float[3]= 1.0; - } - } - } -} - -/* ********************************************************************** - SPEED - ********************************************************************** */ -static void init_speed_effect(Sequence *seq) -{ - SpeedControlVars * v; - - if(seq->effectdata) MEM_freeN(seq->effectdata); - seq->effectdata = MEM_callocN(sizeof(struct SpeedControlVars), - "speedcontrolvars"); - - v = (SpeedControlVars *)seq->effectdata; - v->globalSpeed = 1.0; - v->frameMap = 0; - v->flags = SEQ_SPEED_COMPRESS_IPO_Y; - v->length = 0; -} - -static void load_speed_effect(Sequence * seq) -{ - SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; - - v->frameMap = 0; - v->length = 0; -} - -static int num_inputs_speed() -{ - return 1; -} - -static void free_speed_effect(Sequence *seq) -{ - SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; - if(v->frameMap) MEM_freeN(v->frameMap); - if(seq->effectdata) MEM_freeN(seq->effectdata); - seq->effectdata = 0; -} - -static void copy_speed_effect(Sequence *dst, Sequence *src) -{ - SpeedControlVars * v; - dst->effectdata = MEM_dupallocN(src->effectdata); - v = (SpeedControlVars *)dst->effectdata; - v->frameMap = 0; - v->length = 0; -} - -static int early_out_speed(struct Sequence *seq, - float facf0, float facf1) -{ - return 1; -} - -static void store_icu_yrange_speed(struct Sequence * seq, - short adrcode, float * ymin, float * ymax) -{ - SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; - - /* if not already done, load / initialize data */ - get_sequence_effect(seq); - - if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) { - *ymin = -100.0; - *ymax = 100.0; - } else { - if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) { - *ymin = 0.0; - *ymax = 1.0; - } else { - *ymin = 0.0; - *ymax = seq->len; - } - } -} - -void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force) -{ - float facf0 = seq->facf0; - float ctime, div; - int cfra; - float fallback_fac; - SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; - - /* if not already done, load / initialize data */ - get_sequence_effect(seq); - - if (!(force || seq->len != v->length || !v->frameMap)) { - return; - } - - if (!v->frameMap || v->length != seq->len) { - if (v->frameMap) MEM_freeN(v->frameMap); - - v->length = seq->len; - - v->frameMap = MEM_callocN(sizeof(float) * v->length, - "speedcontrol frameMap"); - } - - fallback_fac = 1.0; - - /* if there is no IPO, try to make retiming easy by stretching the - strip */ - - if (!seq->ipo && seq->seq1 && seq->seq1->enddisp != seq->seq1->start - && seq->seq1->len != 0) { - fallback_fac = (float) seq->seq1->len / - (float) (seq->seq1->enddisp - seq->seq1->start); - /* FIXME: this strip stretching gets screwed by stripdata - handling one layer up. - - So it currently works by enlarging, never by shrinking! - - (IPOs still work, if used correctly) - */ - if (fallback_fac > 1.0) { - fallback_fac = 1.0; - } - } - - if ((v->flags & SEQ_SPEED_INTEGRATE) != 0) { - float cursor = 0; - - v->frameMap[0] = 0; - v->lastValidFrame = 0; - - for (cfra = 1; cfra < v->length; cfra++) { - if(seq->ipo) { - if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - ctime = frame_to_float(seq->startdisp - + cfra); - div = 1.0; - } else { - ctime= frame_to_float(cfra); - div= v->length / 100.0f; - if(div==0.0) return; - } - - calc_ipo(seq->ipo, ctime/div); - execute_ipo((ID *)seq, seq->ipo); - } else { - seq->facf0 = fallback_fac; - } - seq->facf0 *= v->globalSpeed; - - cursor += seq->facf0; - - if (cursor >= v->length) { - v->frameMap[cfra] = v->length - 1; - } else { - v->frameMap[cfra] = cursor; - v->lastValidFrame = cfra; - } - } - } else { - v->lastValidFrame = 0; - for (cfra = 0; cfra < v->length; cfra++) { - if(seq->ipo) { - if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - ctime = frame_to_float(seq->startdisp - + cfra); - div = 1.0; - } else { - ctime= frame_to_float(cfra); - div= v->length / 100.0f; - if(div==0.0) return; - } - - calc_ipo(seq->ipo, ctime/div); - execute_ipo((ID *)seq, seq->ipo); - } - - if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) { - seq->facf0 *= v->length; - } - if (!seq->ipo) { - seq->facf0 = (float) cfra * fallback_fac; - } - seq->facf0 *= v->globalSpeed; - if (seq->facf0 >= v->length) { - seq->facf0 = v->length - 1; - } else { - v->lastValidFrame = cfra; - } - v->frameMap[cfra] = seq->facf0; - } - } - seq->facf0 = facf0; -} - -/* - simply reuse do_cross_effect for blending... - -static void do_speed_effect(Sequence * seq,int cfra, - float facf0, float facf1, int x, int y, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3, struct ImBuf *out) -{ - -} -*/ - - -/* ********************************************************************** - sequence effect factory - ********************************************************************** */ - - -static void init_noop(struct Sequence *seq) -{ - -} - -static void load_noop(struct Sequence *seq) -{ - -} - -static void init_plugin_noop(struct Sequence *seq, const char * fname) -{ - -} - -static void free_noop(struct Sequence *seq) -{ - -} - -static int num_inputs_default() -{ - return 2; -} - -static int early_out_noop(struct Sequence *seq, - float facf0, float facf1) -{ - return 0; -} - -static int early_out_fade(struct Sequence *seq, - float facf0, float facf1) -{ - if (facf0 == 0.0 && facf1 == 0.0) { - return 1; - } else if (facf0 == 1.0 && facf1 == 1.0) { - return 2; - } - return 0; -} - -static int early_out_mul_input2(struct Sequence *seq, - float facf0, float facf1) -{ - if (facf0 == 0.0 && facf1 == 0.0) { - return 1; - } - return 0; -} - -static void store_icu_yrange_noop(struct Sequence * seq, - short adrcode, float * ymin, float * ymax) -{ - /* defaults are fine */ -} - -static void get_default_fac_noop(struct Sequence *seq, int cfra, - float * facf0, float * facf1) -{ - *facf0 = *facf1 = 1.0; -} - -static void get_default_fac_fade(struct Sequence *seq, int cfra, - float * facf0, float * facf1) -{ - *facf0 = (float)(cfra - seq->startdisp); - *facf1 = (float)(*facf0 + 0.5); - *facf0 /= seq->len; - *facf1 /= seq->len; -} - -static void do_overdrop_effect(struct Sequence * seq, int cfra, - float fac, float facf, - int x, int y, struct ImBuf * ibuf1, - struct ImBuf * ibuf2, - struct ImBuf * ibuf3, - struct ImBuf * out) -{ - do_drop_effect(seq, cfra, fac, facf, x, y, - ibuf1, ibuf2, ibuf3, out); - do_alphaover_effect(seq, cfra, fac, facf, x, y, - ibuf1, ibuf2, ibuf3, out); -} - -static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) -{ - struct SeqEffectHandle rval; - int sequence_type = seq_type; - - rval.init = init_noop; - rval.init_plugin = init_plugin_noop; - rval.num_inputs = num_inputs_default; - rval.load = load_noop; - rval.free = free_noop; - rval.early_out = early_out_noop; - rval.get_default_fac = get_default_fac_noop; - rval.store_icu_yrange = store_icu_yrange_noop; - rval.execute = NULL; - rval.copy = NULL; - - switch (sequence_type) { - case SEQ_CROSS: - rval.execute = do_cross_effect; - rval.early_out = early_out_fade; - rval.get_default_fac = get_default_fac_fade; - break; - case SEQ_GAMCROSS: - rval.init = init_gammacross; - rval.load = load_gammacross; - rval.free = free_gammacross; - rval.early_out = early_out_fade; - rval.get_default_fac = get_default_fac_fade; - rval.execute = do_gammacross_effect; - break; - case SEQ_ADD: - rval.execute = do_add_effect; - rval.early_out = early_out_mul_input2; - break; - case SEQ_SUB: - rval.execute = do_sub_effect; - rval.early_out = early_out_mul_input2; - break; - case SEQ_MUL: - rval.execute = do_mul_effect; - rval.early_out = early_out_mul_input2; - break; - case SEQ_ALPHAOVER: - rval.init = init_alpha_over_or_under; - rval.execute = do_alphaover_effect; - break; - case SEQ_OVERDROP: - rval.execute = do_overdrop_effect; - break; - case SEQ_ALPHAUNDER: - rval.init = init_alpha_over_or_under; - rval.execute = do_alphaunder_effect; - break; - case SEQ_WIPE: - rval.init = init_wipe_effect; - rval.num_inputs = num_inputs_wipe; - rval.free = free_wipe_effect; - rval.copy = copy_wipe_effect; - rval.early_out = early_out_fade; - rval.get_default_fac = get_default_fac_fade; - rval.execute = do_wipe_effect; - break; - case SEQ_GLOW: - rval.init = init_glow_effect; - rval.num_inputs = num_inputs_glow; - rval.free = free_glow_effect; - rval.copy = copy_glow_effect; - rval.execute = do_glow_effect; - break; - case SEQ_TRANSFORM: - rval.init = init_transform_effect; - rval.num_inputs = num_inputs_transform; - rval.free = free_transform_effect; - rval.copy = copy_transform_effect; - rval.execute = do_transform_effect; - break; - case SEQ_SPEED: - rval.init = init_speed_effect; - rval.num_inputs = num_inputs_speed; - rval.load = load_speed_effect; - rval.free = free_speed_effect; - rval.copy = copy_speed_effect; - rval.execute = do_cross_effect; - rval.early_out = early_out_speed; - rval.store_icu_yrange = store_icu_yrange_speed; - break; - case SEQ_COLOR: - rval.init = init_solid_color; - rval.num_inputs = num_inputs_color; - rval.early_out = early_out_color; - rval.free = free_solid_color; - rval.copy = copy_solid_color; - rval.execute = do_solid_color; - break; - case SEQ_PLUGIN: - rval.init_plugin = init_plugin; - rval.num_inputs = num_inputs_plugin; - rval.load = load_plugin; - rval.free = free_plugin; - rval.copy = copy_plugin; - rval.execute = do_plugin_effect; - rval.early_out = do_plugin_early_out; - rval.get_default_fac = get_default_fac_fade; - break; - } - - return rval; -} - - -struct SeqEffectHandle get_sequence_effect(Sequence * seq) -{ - struct SeqEffectHandle rval = get_sequence_effect_impl(seq->type); - - if ((seq->flag & SEQ_EFFECT_NOT_LOADED) != 0) { - rval.load(seq); - seq->flag &= ~SEQ_EFFECT_NOT_LOADED; - } - - return rval; -} - -int get_sequence_effect_num_inputs(int seq_type) -{ - struct SeqEffectHandle rval = get_sequence_effect_impl(seq_type); - - return rval.num_inputs(); -} diff --git a/source/blender/src/seqscopes.c b/source/blender/src/seqscopes.c deleted file mode 100644 index 1fa01a6145e..00000000000 --- a/source/blender/src/seqscopes.c +++ /dev/null @@ -1,340 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Author: Peter Schlaile < peter [at] schlaile [dot] de > - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - */ - -#include "BSE_seqscopes.h" -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" -#include "BKE_utildefines.h" -#include -#include - -static void rgb_to_yuv(float rgb[3], float yuv[3]) { - yuv[0]= 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2]; - yuv[1]= 0.492*(rgb[2] - yuv[0]); - yuv[2]= 0.877*(rgb[0] - yuv[0]); - - /* Normalize */ - yuv[1]*= 255.0/(122*2.0); - yuv[1]+= 0.5; - - yuv[2]*= 255.0/(157*2.0); - yuv[2]+= 0.5; -} - -static void scope_put_pixel(unsigned char* table, unsigned char * pos) -{ - char newval = table[*pos]; - pos[0] = pos[1] = pos[2] = newval; - pos[3] = 255; -} - -static void wform_put_line(int w, - unsigned char * last_pos, unsigned char * new_pos) -{ - if (last_pos > new_pos) { - unsigned char* temp = new_pos; - new_pos = last_pos; - last_pos = temp; - } - - while (last_pos < new_pos) { - if (last_pos[0] == 0) { - last_pos[0] = last_pos[1] = last_pos[2] = 32; - last_pos[3] = 255; - } - last_pos += 4*w; - } -} - -static struct ImBuf *make_waveform_view_from_ibuf_byte(struct ImBuf * ibuf) -{ - struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0); - int x,y; - unsigned char* src = (unsigned char*) ibuf->rect; - unsigned char* tgt = (unsigned char*) rval->rect; - int w = ibuf->x + 3; - int h = 515; - float waveform_gamma = 0.2; - unsigned char wtable[256]; - - for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char) (pow(((float) x + 1)/256, - waveform_gamma)*255); - } - - for (y = 0; y < ibuf->y; y++) { - unsigned char * last_p = 0; - - for (x = 0; x < ibuf->x; x++) { - unsigned char * rgb = src + 4 * (ibuf->x * y + x); - float v = 1.0 * - ( 0.299*rgb[0] - + 0.587*rgb[1] - + 0.114*rgb[2]) / 255.0; - unsigned char * p = tgt; - p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1); - - scope_put_pixel(wtable, p); - p += 4 * w; - scope_put_pixel(wtable, p); - - if (last_p != 0) { - wform_put_line(w, last_p, p); - } - last_p = p; - } - } - - for (x = 0; x < w; x++) { - unsigned char * p = tgt + 4 * x; - p[1] = p[3] = 255.0; - p[4 * w + 1] = p[4 * w + 3] = 255.0; - p = tgt + 4 * (w * (h - 1) + x); - p[1] = p[3] = 255.0; - p[-4 * w + 1] = p[-4 * w + 3] = 255.0; - } - - for (y = 0; y < h; y++) { - unsigned char * p = tgt + 4 * w * y; - p[1] = p[3] = 255.0; - p[4 + 1] = p[4 + 3] = 255.0; - p = tgt + 4 * (w * y + w - 1); - p[1] = p[3] = 255.0; - p[-4 + 1] = p[-4 + 3] = 255.0; - } - - return rval; -} - -static struct ImBuf *make_waveform_view_from_ibuf_float(struct ImBuf * ibuf) -{ - struct ImBuf * rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect, 0); - int x,y; - float* src = ibuf->rect_float; - unsigned char* tgt = (unsigned char*) rval->rect; - int w = ibuf->x + 3; - int h = 515; - float waveform_gamma = 0.2; - unsigned char wtable[256]; - - for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char) (pow(((float) x + 1)/256, - waveform_gamma)*255); - } - - for (y = 0; y < ibuf->y; y++) { - unsigned char * last_p = 0; - - for (x = 0; x < ibuf->x; x++) { - float * rgb = src + 4 * (ibuf->x * y + x); - float v = 1.0 * - ( 0.299*rgb[0] - + 0.587*rgb[1] - + 0.114*rgb[2]); - unsigned char * p = tgt; - - CLAMP(v, 0.0, 1.0); - - p += 4 * (w * ((int) (v * (h - 3)) + 1) + x + 1); - - scope_put_pixel(wtable, p); - p += 4 * w; - scope_put_pixel(wtable, p); - - if (last_p != 0) { - wform_put_line(w, last_p, p); - } - last_p = p; - } - } - - for (x = 0; x < w; x++) { - unsigned char * p = tgt + 4 * x; - p[1] = p[3] = 255.0; - p[4 * w + 1] = p[4 * w + 3] = 255.0; - p = tgt + 4 * (w * (h - 1) + x); - p[1] = p[3] = 255.0; - p[-4 * w + 1] = p[-4 * w + 3] = 255.0; - } - - for (y = 0; y < h; y++) { - unsigned char * p = tgt + 4 * w * y; - p[1] = p[3] = 255.0; - p[4 + 1] = p[4 + 3] = 255.0; - p = tgt + 4 * (w * y + w - 1); - p[1] = p[3] = 255.0; - p[-4 + 1] = p[-4 + 3] = 255.0; - } - - return rval; -} - -struct ImBuf *make_waveform_view_from_ibuf(struct ImBuf * ibuf) -{ - if (ibuf->rect_float) { - return make_waveform_view_from_ibuf_float(ibuf); - } else { - return make_waveform_view_from_ibuf_byte(ibuf); - } -} - - -static void vectorscope_put_cross(unsigned char r, unsigned char g, - unsigned char b, - char * tgt, int w, int h, int size) -{ - float rgb[3], yuv[3]; - char * p; - int x = 0; - int y = 0; - - rgb[0]= (float)r/255.0; - rgb[1]= (float)g/255.0; - rgb[2]= (float)b/255.0; - rgb_to_yuv(rgb, yuv); - - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); - - if (r == 0 && g == 0 && b == 0) { - r = 255; - } - - for (y = -size; y <= size; y++) { - for (x = -size; x <= size; x++) { - char * q = p + 4 * (y * w + x); - q[0] = r; q[1] = g; q[2] = b; q[3] = 255; - } - } -} - -static struct ImBuf *make_vectorscope_view_from_ibuf_byte(struct ImBuf * ibuf) -{ - struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0); - int x,y; - char* src = (char*) ibuf->rect; - char* tgt = (char*) rval->rect; - float rgb[3], yuv[3]; - int w = 515; - int h = 515; - float scope_gamma = 0.2; - unsigned char wtable[256]; - - for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char) (pow(((float) x + 1)/256, - scope_gamma)*255); - } - - for (x = 0; x <= 255; x++) { - vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1); - vectorscope_put_cross(255 , x, 0, tgt, w, h, 1); - vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1); - vectorscope_put_cross(0, 255, x, tgt, w, h, 1); - vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1); - vectorscope_put_cross(x, 0, 255, tgt, w, h, 1); - } - - for (y = 0; y < ibuf->y; y++) { - for (x = 0; x < ibuf->x; x++) { - char * src1 = src + 4 * (ibuf->x * y + x); - char * p; - - rgb[0]= (float)src1[0]/255.0; - rgb[1]= (float)src1[1]/255.0; - rgb[2]= (float)src1[2]/255.0; - rgb_to_yuv(rgb, yuv); - - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, (unsigned char*)p); - } - } - - vectorscope_put_cross(0, 0, 0, tgt, w, h, 3); - - return rval; -} - -static struct ImBuf *make_vectorscope_view_from_ibuf_float(struct ImBuf * ibuf) -{ - struct ImBuf * rval = IMB_allocImBuf(515, 515, 32, IB_rect, 0); - int x,y; - float* src = ibuf->rect_float; - char* tgt = (char*) rval->rect; - float rgb[3], yuv[3]; - int w = 515; - int h = 515; - float scope_gamma = 0.2; - unsigned char wtable[256]; - - for (x = 0; x < 256; x++) { - wtable[x] = (unsigned char) (pow(((float) x + 1)/256, - scope_gamma)*255); - } - - for (x = 0; x <= 255; x++) { - vectorscope_put_cross(255 , 0,255 - x, tgt, w, h, 1); - vectorscope_put_cross(255 , x, 0, tgt, w, h, 1); - vectorscope_put_cross(255- x, 255, 0, tgt, w, h, 1); - vectorscope_put_cross(0, 255, x, tgt, w, h, 1); - vectorscope_put_cross(0, 255 - x, 255, tgt, w, h, 1); - vectorscope_put_cross(x, 0, 255, tgt, w, h, 1); - } - - for (y = 0; y < ibuf->y; y++) { - for (x = 0; x < ibuf->x; x++) { - float * src1 = src + 4 * (ibuf->x * y + x); - char * p; - - memcpy(rgb, src1, 3 * sizeof(float)); - - CLAMP(rgb[0], 0.0, 1.0); - CLAMP(rgb[1], 0.0, 1.0); - CLAMP(rgb[2], 0.0, 1.0); - - rgb_to_yuv(rgb, yuv); - - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); - scope_put_pixel(wtable, (unsigned char*)p); - } - } - - vectorscope_put_cross(0, 0, 0, tgt, w, h, 3); - - return rval; -} - -struct ImBuf *make_vectorscope_view_from_ibuf(struct ImBuf * ibuf) -{ - if (ibuf->rect_float) { - return make_vectorscope_view_from_ibuf_float(ibuf); - } else { - return make_vectorscope_view_from_ibuf_byte(ibuf); - } -} diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c deleted file mode 100644 index 6d663b610ca..00000000000 --- a/source/blender/src/sequence.c +++ /dev/null @@ -1,1776 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Contributor(s): Peter Schlaile 2005/2006 - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "MEM_guardedalloc.h" -#include "MEM_CacheLimiterC-Api.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_ipo_types.h" -#include "DNA_scene_types.h" -#include "DNA_sequence_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_main.h" -#include "BKE_scene.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#include "BIF_editsound.h" -#include "BIF_editseq.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BIF_interface.h" -#include "BIF_renderwin.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_sequence.h" -#include "BSE_seqeffects.h" - -#include "RE_pipeline.h" // talks to entire render API - -#include "blendef.h" - -#include "BLI_threads.h" -#include - -int seqrectx, seqrecty; - -void free_tstripdata(int len, TStripElem *se) -{ - TStripElem *seo; - int a; - - seo= se; - if (!se) { - return; - } - - for(a=0; aibuf && se->ok != STRIPELEM_META) { - IMB_freeImBuf(se->ibuf); - se->ibuf = 0; - } - } - - MEM_freeN(seo); - -} - -void free_strip(Strip *strip) -{ - strip->us--; - if(strip->us>0) return; - if(strip->us<0) { - printf("error: negative users in strip\n"); - return; - } - - if(strip->stripdata) { - MEM_freeN(strip->stripdata); - } - - free_tstripdata(strip->len, strip->tstripdata); - - MEM_freeN(strip); -} - -void new_tstripdata(Sequence *seq) -{ - if(seq->strip) { - free_tstripdata(seq->strip->len, seq->strip->tstripdata); - seq->strip->tstripdata= 0; - seq->strip->len= seq->len; - } -} - -void free_sequence(Sequence *seq) -{ - Sequence *last_seq = get_last_seq(); - - if(seq->strip) free_strip(seq->strip); - - if(seq->anim) IMB_free_anim(seq->anim); - if(seq->hdaudio) sound_close_hdaudio(seq->hdaudio); - - if (seq->type & SEQ_EFFECT) { - struct SeqEffectHandle sh = get_sequence_effect(seq); - - sh.free(seq); - } - - if(seq==last_seq) set_last_seq(NULL); - - MEM_freeN(seq); -} - -/* - ********************************************************************** - * build_seqar - ********************************************************************** - * Build a complete array of _all_ sequencies (including those - * in metastrips!) - ********************************************************************** -*/ - -static void do_seq_count(ListBase *seqbase, int *totseq) -{ - Sequence *seq; - - seq= seqbase->first; - while(seq) { - (*totseq)++; - if(seq->seqbase.first) do_seq_count(&seq->seqbase, totseq); - seq= seq->next; - } -} - -static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth) -{ - Sequence *seq; - - seq= seqbase->first; - while(seq) { - seq->depth= depth; - if(seq->seqbase.first) do_build_seqar(&seq->seqbase, seqar, depth+1); - **seqar= seq; - (*seqar)++; - seq= seq->next; - } -} - -void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) -{ - Sequence **tseqar; - - *totseq= 0; - do_seq_count(seqbase, totseq); - - if(*totseq==0) { - *seqar= 0; - return; - } - *seqar= MEM_mallocN(sizeof(void *)* *totseq, "seqar"); - tseqar= *seqar; - - do_build_seqar(seqbase, seqar, 0); - *seqar= tseqar; -} - -void free_editing(Editing *ed) -{ - MetaStack *ms; - Sequence *seq; - - if(ed==NULL) return; - set_last_seq(NULL); /* clear_last_seq doesnt work, it screws up free_sequence */ - - WHILE_SEQ(&ed->seqbase) { - free_sequence(seq); - } - END_SEQ - - while( (ms= ed->metastack.first) ) { - BLI_remlink(&ed->metastack, ms); - MEM_freeN(ms); - } - - MEM_freeN(ed); - -} - -void calc_sequence_disp(Sequence *seq) -{ - if(seq->startofs && seq->startstill) seq->startstill= 0; - if(seq->endofs && seq->endstill) seq->endstill= 0; - - seq->startdisp= seq->start + seq->startofs - seq->startstill; - seq->enddisp= seq->start+seq->len - seq->endofs + seq->endstill; - - seq->handsize= 10.0; /* 10 frames */ - if( seq->enddisp-seq->startdisp < 10 ) { - seq->handsize= (float)(0.5*(seq->enddisp-seq->startdisp)); - } - else if(seq->enddisp-seq->startdisp > 250) { - seq->handsize= (float)((seq->enddisp-seq->startdisp)/25); - } -} - -void calc_sequence(Sequence *seq) -{ - Sequence *seqm; - int min, max; - - /* check all metas recursively */ - seqm= seq->seqbase.first; - while(seqm) { - if(seqm->seqbase.first) calc_sequence(seqm); - seqm= seqm->next; - } - - /* effects and meta: automatic start and end */ - - if(seq->type & SEQ_EFFECT) { - /* pointers */ - if(seq->seq2==0) seq->seq2= seq->seq1; - if(seq->seq3==0) seq->seq3= seq->seq1; - - /* effecten go from seq1 -> seq2: test */ - - /* we take the largest start and smallest end */ - - // seq->start= seq->startdisp= MAX2(seq->seq1->startdisp, seq->seq2->startdisp); - // seq->enddisp= MIN2(seq->seq1->enddisp, seq->seq2->enddisp); - - if (seq->seq1) { - seq->start= seq->startdisp= MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp); - seq->enddisp= MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp); - seq->len= seq->enddisp - seq->startdisp; - } else { - calc_sequence_disp(seq); - } - - if(seq->strip && seq->len!=seq->strip->len) { - new_tstripdata(seq); - } - - } - else { - if(seq->type==SEQ_META) { - seqm= seq->seqbase.first; - if(seqm) { - min= 1000000; - max= -1000000; - while(seqm) { - if(seqm->startdisp < min) min= seqm->startdisp; - if(seqm->enddisp > max) max= seqm->enddisp; - seqm= seqm->next; - } - seq->start= min; - seq->len= max-min; - - if(seq->strip && seq->len!=seq->strip->len) { - new_tstripdata(seq); - } - } - } - calc_sequence_disp(seq); - } -} - -void sort_seq() -{ - /* all strips together per kind, and in order of y location ("machine") */ - ListBase seqbase, effbase; - Editing *ed; - Sequence *seq, *seqt; - - ed= G.scene->ed; - if(ed==0) return; - - seqbase.first= seqbase.last= 0; - effbase.first= effbase.last= 0; - - while( (seq= ed->seqbasep->first) ) { - BLI_remlink(ed->seqbasep, seq); - - if(seq->type & SEQ_EFFECT) { - seqt= effbase.first; - while(seqt) { - if(seqt->machine>=seq->machine) { - BLI_insertlinkbefore(&effbase, seqt, seq); - break; - } - seqt= seqt->next; - } - if(seqt==0) BLI_addtail(&effbase, seq); - } - else { - seqt= seqbase.first; - while(seqt) { - if(seqt->machine>=seq->machine) { - BLI_insertlinkbefore(&seqbase, seqt, seq); - break; - } - seqt= seqt->next; - } - if(seqt==0) BLI_addtail(&seqbase, seq); - } - } - - addlisttolist(&seqbase, &effbase); - *(ed->seqbasep)= seqbase; -} - - -void clear_scene_in_allseqs(Scene *sce) -{ - Scene *sce1; - Editing *ed; - Sequence *seq; - - /* when a scene is deleted: test all seqs */ - - sce1= G.main->scene.first; - while(sce1) { - if(sce1!=sce && sce1->ed) { - ed= sce1->ed; - - WHILE_SEQ(&ed->seqbase) { - - if(seq->scene==sce) seq->scene= 0; - - } - END_SEQ - } - - sce1= sce1->id.next; - } -} - -/* ***************** DO THE SEQUENCE ***************** */ - -static void make_black_ibuf(ImBuf *ibuf) -{ - unsigned int *rect; - float *rect_float; - int tot; - - if(ibuf==0 || (ibuf->rect==0 && ibuf->rect_float==0)) return; - - tot= ibuf->x*ibuf->y; - - rect= ibuf->rect; - rect_float = ibuf->rect_float; - - if (rect) { - memset(rect, 0, tot * sizeof(char) * 4); - } - - if (rect_float) { - memset(rect_float, 0, tot * sizeof(float) * 4); - } -} - -static void multibuf(ImBuf *ibuf, float fmul) -{ - char *rt; - float *rt_float; - - int a, mul, icol; - - mul= (int)(256.0*fmul); - - a= ibuf->x*ibuf->y; - rt= (char *)ibuf->rect; - rt_float = ibuf->rect_float; - - if (rt) { - while(a--) { - - icol= (mul*rt[0])>>8; - if(icol>254) rt[0]= 255; else rt[0]= icol; - icol= (mul*rt[1])>>8; - if(icol>254) rt[1]= 255; else rt[1]= icol; - icol= (mul*rt[2])>>8; - if(icol>254) rt[2]= 255; else rt[2]= icol; - icol= (mul*rt[3])>>8; - if(icol>254) rt[3]= 255; else rt[3]= icol; - - rt+= 4; - } - } - if (rt_float) { - while(a--) { - rt_float[0] *= fmul; - rt_float[1] *= fmul; - rt_float[2] *= fmul; - rt_float[3] *= fmul; - - rt_float += 4; - } - } -} - -static void do_effect(int cfra, Sequence *seq, TStripElem *se) -{ - TStripElem *se1, *se2, *se3; - float fac, facf; - int x, y; - int early_out; - struct SeqEffectHandle sh = get_sequence_effect(seq); - - if (!sh.execute) { /* effect not supported in this version... */ - make_black_ibuf(se->ibuf); - return; - } - - if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, cfra); - fac= seq->facf0; - facf= seq->facf1; - } else { - sh.get_default_fac(seq, cfra, &fac, &facf); - } - - if( !(G.scene->r.mode & R_FIELDS) ) facf = fac; - - early_out = sh.early_out(seq, fac, facf); - - if (early_out == -1) { /* no input needed */ - sh.execute(seq, cfra, fac, facf, se->ibuf->x, se->ibuf->y, - 0, 0, 0, se->ibuf); - return; - } - - switch (early_out) { - case 0: - if (se->se1==0 || se->se2==0 || se->se3==0) { - make_black_ibuf(se->ibuf); - return; - } - - if(se->se1->ok == STRIPELEM_META) se1= se->se1->se1; - else se1= se->se1; - - if(se->se2->ok == STRIPELEM_META) se2= se->se2->se1; - else se2= se->se2; - - if(se->se3->ok == STRIPELEM_META) se3= se->se3->se1; - else se3= se->se3; - - if ( (se1==0 || se2==0 || se3==0) - || (se1->ibuf==0 || se2->ibuf==0 || se3->ibuf==0)) { - make_black_ibuf(se->ibuf); - return; - } - - break; - case 1: - if (se->se1 == 0) { - make_black_ibuf(se->ibuf); - return; - } - - if(se->se1->ok == STRIPELEM_META) se1= se->se1->se1; - else se1= se->se1; - - if (se1 == 0 || se1->ibuf == 0) { - make_black_ibuf(se->ibuf); - return; - } - - if (se->ibuf != se1->ibuf) { - IMB_freeImBuf(se->ibuf); - se->ibuf = se1->ibuf; - IMB_refImBuf(se->ibuf); - } - return; - case 2: - if (se->se2 == 0) { - make_black_ibuf(se->ibuf); - return; - } - - if(se->se2->ok == STRIPELEM_META) se2= se->se2->se1; - else se2= se->se2; - - if (se2 == 0 || se2->ibuf == 0) { - make_black_ibuf(se->ibuf); - return; - } - if (se->ibuf != se2->ibuf) { - IMB_freeImBuf(se->ibuf); - se->ibuf = se2->ibuf; - IMB_refImBuf(se->ibuf); - } - return; - default: - make_black_ibuf(se->ibuf); - return; - } - - x= se2->ibuf->x; - y= se2->ibuf->y; - - if (!se1->ibuf->rect_float && se->ibuf->rect_float) { - IMB_float_from_rect(se1->ibuf); - } - if (!se2->ibuf->rect_float && se->ibuf->rect_float) { - IMB_float_from_rect(se2->ibuf); - } - - if (!se1->ibuf->rect && !se->ibuf->rect_float) { - IMB_rect_from_float(se1->ibuf); - } - if (!se2->ibuf->rect && !se->ibuf->rect_float) { - IMB_rect_from_float(se2->ibuf); - } - - sh.execute(seq, cfra, fac, facf, x, y, se1->ibuf, se2->ibuf, se3->ibuf, - se->ibuf); -} - -static int give_stripelem_index(Sequence *seq, int cfra) -{ - int nr; - - if(seq->startdisp >cfra || seq->enddisp <= cfra) return -1; - - if(seq->flag&SEQ_REVERSE_FRAMES) { - /*reverse frame in this sequence */ - if(cfra <= seq->start) nr= seq->len-1; - else if(cfra >= seq->start+seq->len-1) nr= 0; - else nr= (seq->start + seq->len) - cfra; - } else { - if(cfra <= seq->start) nr= 0; - else if(cfra >= seq->start+seq->len-1) nr= seq->len-1; - else nr= cfra-seq->start; - } - if (seq->strobe < 1.0) seq->strobe = 1.0; - if (seq->strobe > 1.0) { - nr -= (int)fmod((double)nr, (double)seq->strobe); - } - - return nr; -} - -TStripElem *give_tstripelem(Sequence *seq, int cfra) -{ - TStripElem *se; - int nr; - - se = seq->strip->tstripdata; - if (se == 0 && seq->len > 0) { - int i; - se = seq->strip->tstripdata = MEM_callocN( - seq->len*sizeof(TStripElem), "tstripelems"); - for (i = 0; i < seq->len; i++) { - se[i].ok = STRIPELEM_OK; - } - } - nr = give_stripelem_index(seq, cfra); - - if (nr == -1) return 0; - if (se == 0) return 0; - - se+= nr; - se->nr= nr; - - return se; -} - -StripElem *give_stripelem(Sequence *seq, int cfra) -{ - StripElem *se; - int nr; - - se = seq->strip->stripdata; - nr = give_stripelem_index(seq, cfra); - - if (nr == -1) return 0; - if (se == 0) return 0; - - se += nr; - - return se; -} - -static int evaluate_seq_frame_gen( - Sequence ** seq_arr, ListBase *seqbase, int cfra) -{ - Sequence *seq; - int totseq=0; - - memset(seq_arr, 0, sizeof(Sequence*) * MAXSEQ); - - seq= seqbase->first; - while(seq) { - if(seq->startdisp <=cfra && seq->enddisp > cfra) { - seq_arr[seq->machine]= seq; - totseq++; - } - seq= seq->next; - } - - return totseq; -} - -int evaluate_seq_frame(int cfra) -{ - Editing *ed; - Sequence *seq_arr[MAXSEQ+1]; - - ed= G.scene->ed; - if(ed==0) return 0; - - return evaluate_seq_frame_gen(seq_arr, ed->seqbasep, cfra); - -} - -Sequence *get_shown_sequence(ListBase * seqbasep, int cfra, int chanshown) -{ - Sequence *seq, *seqim, *seqeff; - Sequence *seq_arr[MAXSEQ+1]; - int b; - - seq = 0; - - if (chanshown > MAXSEQ) { - return 0; - } - - if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) { - if (chanshown > 0) { - return seq_arr[chanshown]; - } - - /* we take the upper effect strip or - the lowest imagestrip/metastrip */ - seqim= seqeff= 0; - - for(b=1; btype & SEQ_EFFECT) { - if(seqeff==0) seqeff= seq; - else if(seqeff->machine < seq->machine) - seqeff= seq; - } else if (seq->type != SEQ_RAM_SOUND && seq->type != SEQ_HD_SOUND) { - if(seqim==0) seqim= seq; - else if(seqim->machine > seq->machine) - seqim= seq; - } - } - } - if(seqeff) seq= seqeff; - else if(seqim) seq= seqim; - else seq= 0; - } - - return seq; -} - -static Sequence * get_shown_seq_from_metastrip(Sequence * seqm, int cfra) -{ - return get_shown_sequence(&seqm->seqbase, cfra, 0); -} - -void set_meta_stripdata(Sequence *seqm) -{ - Sequence *seq; - TStripElem *se; - int a, cfra; - - se= seqm->strip->tstripdata; - - if (se == 0 && seqm->len > 0) { - int i; - se = seqm->strip->tstripdata = MEM_callocN( - seqm->len*sizeof(TStripElem), "tstripelems"); - for (i = 0; i < seqm->len; i++) { - se[i].ok = STRIPELEM_META; - } - } - - /* sets all ->se1 pointers in stripdata, to read the ibuf from it */ - - for(a=0; alen; a++, se++) { - cfra= a+seqm->start; - seq = get_shown_seq_from_metastrip(seqm, cfra); - if (seq) { - se->se1= give_tstripelem(seq, cfra); - } else { - se->se1= 0; - } - } -} - -static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra); - -static void do_build_seq_ibuf(Sequence * seq, TStripElem *se, int cfra) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - - if(seq->type == SEQ_META) { - if(seq->seqbase.first) { - Sequence * seqmshown= - get_shown_seq_from_metastrip(seq, cfra); - if (seqmshown) { - if(cfra< seq->start) - do_build_seq_recursively(seqmshown, seq->start); - else if(cfra> seq->start+seq->len-1) - do_build_seq_recursively(seqmshown, seq->start + seq->len-1); - else do_build_seq_recursively(seqmshown, cfra); - } - } - - se->ok = STRIPELEM_META; - if(se->se1 == 0) set_meta_stripdata(seq); - if(se->se1) { - se->ibuf= se->se1->ibuf; - } - } else if(seq->type & SEQ_EFFECT) { - - /* test if image is too small or discarded from cache: reload */ - if(se->ibuf) { - if(se->ibuf->x < seqrectx || se->ibuf->y < seqrecty || !(se->ibuf->rect || se->ibuf->rect_float)) { - IMB_freeImBuf(se->ibuf); - se->ibuf= 0; - } - } - - /* should the effect be recalculated? */ - - if(se->ibuf == 0) { - /* if one of two first inputs are rectfloat, output is float too */ - if((se->se1 && se->se1->ibuf && se->se1->ibuf->rect_float) || - (se->se2 && se->se2->ibuf && se->se2->ibuf->rect_float)) - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); - else - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0); - - do_effect(cfra, seq, se); - } - - /* test size */ - if(se->ibuf) { - if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) { - if(G.scene->r.mode & R_OSA) { - IMB_scaleImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - } else { - IMB_scalefastImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - } - } - } - } else if(seq->type < SEQ_EFFECT) { - if(se->ibuf) { - /* test if image too small - or discarded from cache: reload */ - if(se->ibuf->x < seqrectx || se->ibuf->y < seqrecty || !(se->ibuf->rect || se->ibuf->rect_float)) { - IMB_freeImBuf(se->ibuf); - se->ibuf= 0; - se->ok= STRIPELEM_OK; - } - } - - if(seq->type==SEQ_IMAGE) { - if(se->ok == STRIPELEM_OK && se->ibuf==0) { - StripElem * s_elem = give_stripelem(seq, cfra); - - /* if playanim or render: - no waitcursor */ - if((G.f & G_PLAYANIM)==0) - waitcursor(1); - - strncpy(name, seq->strip->dir, FILE_MAXDIR-1); - strncat(name, s_elem->name, FILE_MAXFILE); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - se->ibuf= IMB_loadiffname(name, IB_rect); - - if((G.f & G_PLAYANIM)==0) - waitcursor(0); - - if(se->ibuf == 0) { - se->ok = STRIPELEM_FAILED; - } else { - if(seq->flag & SEQ_MAKE_PREMUL) { - if(se->ibuf->depth==32 && se->ibuf->zbuf==0) converttopremul(se->ibuf); - } - seq->strip->orx= se->ibuf->x; - seq->strip->ory= se->ibuf->y; - if(seq->flag & SEQ_FILTERY) IMB_filtery(se->ibuf); - if(seq->flag & SEQ_FLIPX) IMB_flipx(se->ibuf); - if(seq->flag & SEQ_FLIPY) IMB_flipy(se->ibuf); - if(seq->mul==0.0) seq->mul= 1.0; - if(seq->mul != 1.0) multibuf(se->ibuf, seq->mul); - } - } - } - else if(seq->type==SEQ_MOVIE) { - if(se->ok == STRIPELEM_OK && se->ibuf==0) { - if(seq->anim==0) { - strncpy(name, seq->strip->dir, FILE_MAXDIR-1); - strncat(name, seq->strip->stripdata->name, FILE_MAXFILE-1); - BLI_convertstringcode(name, G.sce, G.scene->r.cfra); - - seq->anim = openanim(name, IB_rect); - } - if(seq->anim) { - IMB_anim_set_preseek(seq->anim, seq->anim_preseek); - se->ibuf = IMB_anim_absolute(seq->anim, se->nr); - } - - if(se->ibuf == 0) { - se->ok = STRIPELEM_FAILED; - } else { - if(seq->flag & SEQ_MAKE_PREMUL) { - if(se->ibuf->depth==32) converttopremul(se->ibuf); - } - seq->strip->orx= se->ibuf->x; - seq->strip->ory= se->ibuf->y; - if(seq->flag & SEQ_FILTERY) IMB_filtery(se->ibuf); - if(seq->mul==0.0) seq->mul= 1.0; - if(seq->mul != 1.0) multibuf(se->ibuf, seq->mul); - } - } - } else if(seq->type==SEQ_SCENE && se->ibuf==NULL && seq->scene) { // scene can be NULL after deletions - int oldcfra = CFRA; - Scene *sce= seq->scene, *oldsce= G.scene; - Render *re; - RenderResult rres; - int doseq, rendering= G.rendering; - char scenename[64]; - - waitcursor(1); - - /* Hack! This function can be called from do_render_seq(), in that case - the seq->scene can already have a Render initialized with same name, - so we have to use a default name. (compositor uses G.scene name to - find render). - However, when called from within the UI (image preview in sequencer) - we do want to use scene Render, that way the render result is defined - for display in render/imagewindow */ - if(rendering) { - BLI_strncpy(scenename, sce->id.name+2, 64); - strcpy(sce->id.name+2, " do_build_seq_ibuf"); - } - re= RE_NewRender(sce->id.name); - - /* prevent eternal loop */ - doseq= G.scene->r.scemode & R_DOSEQ; - G.scene->r.scemode &= ~R_DOSEQ; - - BIF_init_render_callbacks(re, 0); /* 0= no display callbacks */ - - /* hrms, set_scene still needed? work on that... */ - if(sce!=oldsce) set_scene_bg(sce); - RE_BlenderFrame(re, sce, seq->sfra + se->nr); - if(sce!=oldsce) set_scene_bg(oldsce); - - /* UGLY WARNING, it is set to zero in RE_BlenderFrame */ - G.rendering= rendering; - if(rendering) - BLI_strncpy(sce->id.name+2, scenename, 64); - - RE_GetResultImage(re, &rres); - - if(rres.rectf) { - se->ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rectfloat, 0); - memcpy(se->ibuf->rect_float, rres.rectf, 4*sizeof(float)*rres.rectx*rres.recty); - if(rres.rectz) { - addzbuffloatImBuf(se->ibuf); - memcpy(se->ibuf->zbuf_float, rres.rectz, sizeof(float)*rres.rectx*rres.recty); - } - } else if (rres.rect32) { - se->ibuf= IMB_allocImBuf(rres.rectx, rres.recty, 32, IB_rect, 0); - memcpy(se->ibuf->rect, rres.rect32, 4*rres.rectx*rres.recty); - } - - BIF_end_render_callbacks(); - - /* restore */ - G.scene->r.scemode |= doseq; - - if((G.f & G_PLAYANIM)==0) /* bad, is set on do_render_seq */ - waitcursor(0); - CFRA = oldcfra; - } - - /* size test */ - if(se->ibuf) { - if(se->ibuf->x != seqrectx || se->ibuf->y != seqrecty ) { - - if (0) { // G.scene->r.mode & R_FIELDS) { - - if (seqrecty > 288) - IMB_scalefieldImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - else { - IMB_de_interlace(se->ibuf); - - if(G.scene->r.mode & R_OSA) - IMB_scaleImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - else - IMB_scalefastImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - } - } - else { - if(G.scene->r.mode & R_OSA) - IMB_scaleImBuf(se->ibuf,(short)seqrectx, (short)seqrecty); - else - IMB_scalefastImBuf(se->ibuf, (short)seqrectx, (short)seqrecty); - } - } - - } - } - if (se->ibuf && seq->type != SEQ_META) { - IMB_cache_limiter_insert(se->ibuf); - IMB_cache_limiter_ref(se->ibuf); - IMB_cache_limiter_touch(se->ibuf); - } -} - -static void do_effect_seq_recursively(Sequence * seq, TStripElem *se, int cfra) -{ - float fac, facf; - struct SeqEffectHandle sh = get_sequence_effect(seq); - int early_out; - - se->se1 = 0; - se->se2 = 0; - se->se3 = 0; - - if(seq->ipo && seq->ipo->curve.first) { - do_seq_ipo(seq, cfra); - fac= seq->facf0; - facf= seq->facf1; - } else { - sh.get_default_fac(seq, cfra, &fac, &facf); - } - - if( G.scene->r.mode & R_FIELDS ); else facf= fac; - - early_out = sh.early_out(seq, fac, facf); - switch (early_out) { - case -1: - /* no input needed */ - break; - case 0: - se->se1 = do_build_seq_recursively(seq->seq1, cfra); - se->se2 = do_build_seq_recursively(seq->seq2, cfra); - if (seq->seq3) { - se->se3 = do_build_seq_recursively(seq->seq3, cfra); - } - break; - case 1: - se->se1 = do_build_seq_recursively(seq->seq1, cfra); - break; - case 2: - se->se2 = do_build_seq_recursively(seq->seq2, cfra); - break; - } - - - do_build_seq_ibuf(seq, se, cfra); - - /* children are not needed anymore ... */ - - if (se->se1 && se->se1->ibuf) { - IMB_cache_limiter_unref(se->se1->ibuf); - } - if (se->se2 && se->se2->ibuf) { - IMB_cache_limiter_unref(se->se2->ibuf); - } - if (se->se3 && se->se3->ibuf) { - IMB_cache_limiter_unref(se->se3->ibuf); - } -} - -static TStripElem* do_build_seq_recursively_impl(Sequence * seq, int cfra) -{ - TStripElem *se; - - se = give_tstripelem(seq, cfra); - - if(se) { - if (seq->type & SEQ_EFFECT) { - do_effect_seq_recursively(seq, se, cfra); - } else { - do_build_seq_ibuf(seq, se, cfra); - } - } - return se; -} - -/* FIXME: - -If cfra was float throughout blender (especially in the render -pipeline) one could even _render_ with subframe precision -instead of faking using the blend code below... - -*/ - -static TStripElem* do_handle_speed_effect(Sequence * seq, int cfra) -{ - SpeedControlVars * s = (SpeedControlVars *)seq->effectdata; - int nr = cfra - seq->start; - float f_cfra; - int cfra_left; - int cfra_right; - TStripElem * se = 0; - TStripElem * se1 = 0; - TStripElem * se2 = 0; - - sequence_effect_speed_rebuild_map(seq, 0); - - f_cfra = seq->start + s->frameMap[nr]; - - cfra_left = (int) floor(f_cfra); - cfra_right = (int) ceil(f_cfra); - - se = give_tstripelem(seq, cfra); - - if (cfra_left == cfra_right || - (s->flags & SEQ_SPEED_BLEND) == 0) { - if(se->ibuf) { - if(se->ibuf->x < seqrectx || se->ibuf->y < seqrecty - || !(se->ibuf->rect || se->ibuf->rect_float)) { - IMB_freeImBuf(se->ibuf); - se->ibuf= 0; - } - } - - if (se->ibuf == NULL) { - se1 = do_build_seq_recursively_impl( - seq->seq1, cfra_left); - - if((se1 && se1->ibuf && se1->ibuf->rect_float)) - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); - else - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0); - - if (se1 == 0 || se1->ibuf == 0) { - make_black_ibuf(se->ibuf); - } else { - if (se->ibuf != se1->ibuf) { - if (se->ibuf) { - IMB_freeImBuf(se->ibuf); - } - - se->ibuf = se1->ibuf; - IMB_refImBuf(se->ibuf); - } - } - } - } else { - struct SeqEffectHandle sh; - - if(se->ibuf) { - if(se->ibuf->x < seqrectx || se->ibuf->y < seqrecty - || !(se->ibuf->rect || se->ibuf->rect_float)) { - IMB_freeImBuf(se->ibuf); - se->ibuf= 0; - } - } - - if (se->ibuf == NULL) { - se1 = do_build_seq_recursively_impl( - seq->seq1, cfra_left); - se2 = do_build_seq_recursively_impl( - seq->seq1, cfra_right); - - if((se1 && se1->ibuf && se1->ibuf->rect_float)) - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rectfloat, 0); - else - se->ibuf= IMB_allocImBuf((short)seqrectx, (short)seqrecty, 32, IB_rect, 0); - - if (!se1 || !se2) { - make_black_ibuf(se->ibuf); - } else { - sh = get_sequence_effect(seq); - - sh.execute(seq, cfra, - f_cfra - (float) cfra_left, - f_cfra - (float) cfra_left, - se->ibuf->x, se->ibuf->y, - se1->ibuf, se2->ibuf, 0, se->ibuf); - } - } - - } - - /* caller expects this to be referenced, so do it! */ - if (se->ibuf) { - IMB_cache_limiter_insert(se->ibuf); - IMB_cache_limiter_ref(se->ibuf); - IMB_cache_limiter_touch(se->ibuf); - } - - /* children are no longer needed */ - if (se1 && se1->ibuf) - IMB_cache_limiter_unref(se1->ibuf); - if (se2 && se2->ibuf) - IMB_cache_limiter_unref(se2->ibuf); - - return se; -} - -/* - * build all ibufs recursively - * - * if successfull, the returned TStripElem contains the (referenced!) imbuf - * that means: you _must_ call - * - * IMB_cache_limiter_unref(rval); - * - * if rval != 0 - * - */ - -static TStripElem* do_build_seq_recursively(Sequence * seq, int cfra) -{ - if (seq->type == SEQ_SPEED) { - return do_handle_speed_effect(seq, cfra); - } else { - return do_build_seq_recursively_impl(seq, cfra); - } -} - -/* - * returned ImBuf is refed! - * you have to unref after usage! - */ - -static ImBuf *give_ibuf_seq_impl(int rectx, int recty, int cfra, int chanshown) -{ - Sequence *seqfirst=0; - Editing *ed; - int count; - ListBase *seqbasep; - TStripElem *se; - - ed= G.scene->ed; - if(ed==0) return 0; - - count = BLI_countlist(&ed->metastack); - if((chanshown < 0) && (count > 0)) { - count = MAX2(count + chanshown, 0); - seqbasep= ((MetaStack*)BLI_findlink(&ed->metastack, count))->oldbasep; - } else { - seqbasep= ed->seqbasep; - } - - seqrectx= rectx; /* bad bad global! */ - seqrecty= recty; - - seqfirst = get_shown_sequence(seqbasep, cfra, chanshown); - - if (!seqfirst) { - return 0; - } - - se = do_build_seq_recursively(seqfirst, cfra); - - if(!se) { - return 0; - } - - return se->ibuf; -} - -ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra, - Sequence * seq) -{ - TStripElem* se; - - seqrectx= rectx; /* bad bad global! */ - seqrecty= recty; - - se = do_build_seq_recursively(seq, cfra); - - if(!se) { - return 0; - } - - if (se->ibuf) { - IMB_cache_limiter_unref(se->ibuf); - } - - return se->ibuf; -} - -ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chanshown) -{ - ImBuf* i = give_ibuf_seq_impl(rectx, recty, cfra, chanshown); - - if (i) { - IMB_cache_limiter_unref(i); - } - return i; -} - -/* threading api */ - -static ListBase running_threads; -static ListBase prefetch_wait; -static ListBase prefetch_done; - -static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER; - -static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER; - -static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER; - -static volatile int seq_thread_shutdown = FALSE; -static volatile int seq_last_given_monoton_cfra = 0; -static int monoton_cfra = 0; - -typedef struct PrefetchThread { - struct PrefetchThread *next, *prev; - struct PrefetchQueueElem *current; - pthread_t pthread; - int running; -} PrefetchThread; - -typedef struct PrefetchQueueElem { - struct PrefetchQueueElem *next, *prev; - - int rectx; - int recty; - int cfra; - int chanshown; - - int monoton_cfra; - - struct ImBuf * ibuf; -} PrefetchQueueElem; - -static void * seq_prefetch_thread(void * This_) -{ - PrefetchThread * This = This_; - - while (!seq_thread_shutdown) { - PrefetchQueueElem * e; - int s_last; - - pthread_mutex_lock(&queue_lock); - e = prefetch_wait.first; - if (e) { - BLI_remlink(&prefetch_wait, e); - } - s_last = seq_last_given_monoton_cfra; - - This->current = e; - - pthread_mutex_unlock(&queue_lock); - - if (!e) { - pthread_mutex_lock(&prefetch_ready_lock); - - This->running = FALSE; - - pthread_cond_signal(&prefetch_ready_cond); - pthread_mutex_unlock(&prefetch_ready_lock); - - pthread_mutex_lock(&wakeup_lock); - if (!seq_thread_shutdown) { - pthread_cond_wait(&wakeup_cond, &wakeup_lock); - } - pthread_mutex_unlock(&wakeup_lock); - continue; - } - - This->running = TRUE; - - if (e->cfra >= s_last) { - e->ibuf = give_ibuf_seq_impl( - e->rectx, e->recty, e->cfra, e->chanshown); - } - - pthread_mutex_lock(&queue_lock); - - BLI_addtail(&prefetch_done, e); - - for (e = prefetch_wait.first; e; e = e->next) { - if (s_last > e->monoton_cfra) { - BLI_remlink(&prefetch_wait, e); - MEM_freeN(e); - } - } - - for (e = prefetch_done.first; e; e = e->next) { - if (s_last > e->monoton_cfra) { - if (e->ibuf) { - IMB_cache_limiter_unref(e->ibuf); - } - BLI_remlink(&prefetch_done, e); - MEM_freeN(e); - } - } - - pthread_mutex_unlock(&queue_lock); - - pthread_mutex_lock(&frame_done_lock); - pthread_cond_signal(&frame_done_cond); - pthread_mutex_unlock(&frame_done_lock); - } - return 0; -} - -void seq_start_threads() -{ - int i; - - running_threads.first = running_threads.last = NULL; - prefetch_wait.first = prefetch_wait.last = NULL; - prefetch_done.first = prefetch_done.last = NULL; - - seq_thread_shutdown = FALSE; - seq_last_given_monoton_cfra = monoton_cfra = 0; - - /* since global structures are modified during the processing - of one frame, only one render thread is currently possible... - - (but we code, in the hope, that we can remove this restriction - soon...) - */ - - fprintf(stderr, "SEQ-THREAD: seq_start_threads\n"); - - for (i = 0; i < 1; i++) { - PrefetchThread *t = MEM_callocN(sizeof(PrefetchThread), - "prefetch_thread"); - t->running = TRUE; - BLI_addtail(&running_threads, t); - - pthread_create(&t->pthread, NULL, seq_prefetch_thread, t); - } - - /* init malloc mutex */ - BLI_init_threads(0, 0, 0); -} - -void seq_stop_threads() -{ - PrefetchThread *tslot; - PrefetchQueueElem * e; - - fprintf(stderr, "SEQ-THREAD: seq_stop_threads()\n"); - - if (seq_thread_shutdown) { - fprintf(stderr, "SEQ-THREAD: ... already stopped\n"); - return; - } - - pthread_mutex_lock(&wakeup_lock); - - seq_thread_shutdown = TRUE; - - pthread_cond_broadcast(&wakeup_cond); - pthread_mutex_unlock(&wakeup_lock); - - for(tslot = running_threads.first; tslot; tslot= tslot->next) { - pthread_join(tslot->pthread, NULL); - } - - - for (e = prefetch_wait.first; e; e = e->next) { - BLI_remlink(&prefetch_wait, e); - MEM_freeN(e); - } - - for (e = prefetch_done.first; e; e = e->next) { - if (e->ibuf) { - IMB_cache_limiter_unref(e->ibuf); - } - BLI_remlink(&prefetch_done, e); - MEM_freeN(e); - } - - BLI_freelistN(&running_threads); - - /* deinit malloc mutex */ - BLI_end_threads(0); -} - -void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown) -{ - PrefetchQueueElem * e; - if (seq_thread_shutdown) { - return; - } - - e = MEM_callocN(sizeof(PrefetchQueueElem), "prefetch_queue_elem"); - e->rectx = rectx; - e->recty = recty; - e->cfra = cfra; - e->chanshown = chanshown; - e->monoton_cfra = monoton_cfra++; - - pthread_mutex_lock(&queue_lock); - BLI_addtail(&prefetch_wait, e); - pthread_mutex_unlock(&queue_lock); - - pthread_mutex_lock(&wakeup_lock); - pthread_cond_signal(&wakeup_cond); - pthread_mutex_unlock(&wakeup_lock); -} - -void seq_wait_for_prefetch_ready() -{ - PrefetchThread *tslot; - - if (seq_thread_shutdown) { - return; - } - - fprintf(stderr, "SEQ-THREAD: rendering prefetch frames...\n"); - - pthread_mutex_lock(&prefetch_ready_lock); - - for(;;) { - for(tslot = running_threads.first; tslot; tslot= tslot->next) { - if (tslot->running) { - break; - } - } - if (!tslot) { - break; - } - pthread_cond_wait(&prefetch_ready_cond, &prefetch_ready_lock); - } - - pthread_mutex_unlock(&prefetch_ready_lock); - - fprintf(stderr, "SEQ-THREAD: prefetch done\n"); -} - -ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra, int chanshown) -{ - PrefetchQueueElem * e = 0; - int found_something = FALSE; - - if (seq_thread_shutdown) { - return give_ibuf_seq(rectx, recty, cfra, chanshown); - } - - while (!e) { - int success = FALSE; - pthread_mutex_lock(&queue_lock); - - for (e = prefetch_done.first; e; e = e->next) { - if (cfra == e->cfra && - chanshown == e->chanshown && - rectx == e->rectx && - recty == e->recty) { - success = TRUE; - found_something = TRUE; - break; - } - } - - if (!e) { - for (e = prefetch_wait.first; e; e = e->next) { - if (cfra == e->cfra && - chanshown == e->chanshown && - rectx == e->rectx && - recty == e->recty) { - found_something = TRUE; - break; - } - } - } - - if (!e) { - PrefetchThread *tslot; - - for(tslot = running_threads.first; - tslot; tslot= tslot->next) { - if (tslot->current && - cfra == tslot->current->cfra && - chanshown == tslot->current->chanshown && - rectx == tslot->current->rectx && - recty == tslot->current->recty) { - found_something = TRUE; - break; - } - } - } - - /* e->ibuf is unrefed by render thread on next round. */ - - if (e) { - seq_last_given_monoton_cfra = e->monoton_cfra; - } - - pthread_mutex_unlock(&queue_lock); - - if (!success) { - e = NULL; - - if (!found_something) { - fprintf(stderr, - "SEQ-THREAD: Requested frame " - "not in queue ???\n"); - break; - } - pthread_mutex_lock(&frame_done_lock); - pthread_cond_wait(&frame_done_cond, &frame_done_lock); - pthread_mutex_unlock(&frame_done_lock); - } - } - - return e ? e->ibuf : 0; -} - -/* Functions to free imbuf and anim data on changes */ - -static void free_imbuf_strip_elem(TStripElem *se) -{ - if (se->ibuf) { - if (se->ok != STRIPELEM_META && se->ibuf != 0) - IMB_freeImBuf(se->ibuf); - se->ibuf= 0; - se->ok= STRIPELEM_OK; - se->se1= se->se2= se->se3= 0; - } -} - -static void free_anim_seq(Sequence *seq) -{ - if(seq->anim) { - IMB_free_anim(seq->anim); - seq->anim = 0; - } -} - -void free_imbuf_seq_except(int cfra) -{ - Editing *ed= G.scene->ed; - Sequence *seq; - TStripElem *se; - int a; - - if(ed==0) return; - - WHILE_SEQ(&ed->seqbase) { - if(seq->strip) { - TStripElem * curelem = give_tstripelem(seq, cfra); - - for(a=0, se= seq->strip->tstripdata; alen; a++, se++) - if(se != curelem) - free_imbuf_strip_elem(se); - - if(seq->type==SEQ_MOVIE) - if(seq->startdisp > cfra || seq->enddisp < cfra) - free_anim_seq(seq); - } - } - END_SEQ -} - -void free_imbuf_seq() -{ - Editing *ed= G.scene->ed; - Sequence *seq; - TStripElem *se; - int a; - - if(ed==0) return; - - WHILE_SEQ(&ed->seqbase) { - if(seq->strip) { - if (seq->strip->tstripdata) { - for(a=0, se= seq->strip->tstripdata; alen; a++, se++) - free_imbuf_strip_elem(se); - } - - if(seq->type==SEQ_MOVIE) - free_anim_seq(seq); - if(seq->type==SEQ_SPEED) { - sequence_effect_speed_rebuild_map(seq, 1); - } - } - } - END_SEQ -} - -void free_imbuf_seq_with_ipo(struct Ipo *ipo) -{ - /* force update of all sequences with this ipo, on ipo changes */ - Editing *ed= G.scene->ed; - Sequence *seq; - - if(ed==0) return; - - WHILE_SEQ(&ed->seqbase) { - if(seq->ipo == ipo) { - update_changed_seq_and_deps(seq, 0, 1); - if(seq->type == SEQ_SPEED) { - sequence_effect_speed_rebuild_map(seq, 1); - } - } - } - END_SEQ -} - -static int update_changed_seq_recurs(Sequence *seq, Sequence *changed_seq, int len_change, int ibuf_change) -{ - Sequence *subseq; - int a, free_imbuf = 0; - TStripElem *se; - - /* recurs downwards to see if this seq depends on the changed seq */ - - if(seq == NULL) - return 0; - - if(seq == changed_seq) - free_imbuf = 1; - - for(subseq=seq->seqbase.first; subseq; subseq=subseq->next) - if(update_changed_seq_recurs(subseq, changed_seq, len_change, ibuf_change)) - free_imbuf = TRUE; - - if(seq->seq1) - if(update_changed_seq_recurs(seq->seq1, changed_seq, len_change, ibuf_change)) - free_imbuf = TRUE; - if(seq->seq2 && (seq->seq2 != seq->seq1)) - if(update_changed_seq_recurs(seq->seq2, changed_seq, len_change, ibuf_change)) - free_imbuf = TRUE; - if(seq->seq3 && (seq->seq3 != seq->seq1) && (seq->seq3 != seq->seq2)) - if(update_changed_seq_recurs(seq->seq3, changed_seq, len_change, ibuf_change)) - free_imbuf = TRUE; - - if(free_imbuf) { - if(ibuf_change) { - se= seq->strip->tstripdata; - if (se) { - for(a=0; alen; a++, se++) - free_imbuf_strip_elem(se); - } - - if(seq->type == SEQ_MOVIE) - free_anim_seq(seq); - if(seq->type == SEQ_SPEED) { - sequence_effect_speed_rebuild_map(seq, 1); - } - } - - if(len_change) - calc_sequence(seq); - } - - return free_imbuf; -} - -void update_changed_seq_and_deps(Sequence *changed_seq, int len_change, int ibuf_change) -{ - Editing *ed= G.scene->ed; - Sequence *seq; - - if (!ed) return; - - for (seq=ed->seqbase.first; seq; seq=seq->next) - update_changed_seq_recurs(seq, changed_seq, len_change, ibuf_change); -} - -/* bad levell call... */ -void do_render_seq(RenderResult *rr, int cfra) -{ - ImBuf *ibuf; - - G.f |= G_PLAYANIM; /* waitcursor patch */ - - ibuf= give_ibuf_seq(rr->rectx, rr->recty, cfra, 0); - - if(ibuf) { - if(ibuf->rect_float) { - if (!rr->rectf) - rr->rectf= MEM_mallocN(4*sizeof(float)*rr->rectx*rr->recty, "render_seq rectf"); - - memcpy(rr->rectf, ibuf->rect_float, 4*sizeof(float)*rr->rectx*rr->recty); - - /* TSK! Since sequence render doesn't free the *rr render result, the old rect32 - can hang around when sequence render has rendered a 32 bits one before */ - if(rr->rect32) { - MEM_freeN(rr->rect32); - rr->rect32= NULL; - } - } - else if(ibuf->rect) { - if (!rr->rect32) - rr->rect32= MEM_mallocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect"); - - memcpy(rr->rect32, ibuf->rect, 4*rr->rectx*rr->recty); - - /* if (ibuf->zbuf) { */ - /* if (R.rectz) freeN(R.rectz); */ - /* R.rectz = BLI_dupallocN(ibuf->zbuf); */ - /* } */ - } - - /* Let the cache limitor take care of this (schlaile) */ - /* While render let's keep all memory available for render - (ton) - At least if free memory is tight... - This can make a big difference in encoding speed - (it is around 4 times(!) faster, if we do not waste time - on freeing _all_ buffers every time on long timelines...) - (schlaile) - */ - { - extern int mem_in_use; - extern int mmap_in_use; - - int max = MEM_CacheLimiter_get_maximum(); - if (max != 0 && mem_in_use + mmap_in_use > max) { - fprintf(stderr, "mem_in_use = %d, max = %d\n", - mem_in_use + mmap_in_use, max); - fprintf(stderr, "Cleaning up, please wait...\n" - "If this happens very often,\n" - "consider " - "raising the memcache limit in the " - "user preferences.\n"); - free_imbuf_seq(); - } - } - } - else { - /* render result is delivered empty in most cases, nevertheless we handle all cases */ - if (rr->rectf) - memset(rr->rectf, 0, 4*sizeof(float)*rr->rectx*rr->recty); - else if (rr->rect32) - memset(rr->rect32, 0, 4*rr->rectx*rr->recty); - else - rr->rect32= MEM_callocN(sizeof(int)*rr->rectx*rr->recty, "render_seq rect"); - } - - G.f &= ~G_PLAYANIM; - -} diff --git a/source/blender/src/space.c b/source/blender/src/space.c deleted file mode 100644 index 2e560b05228..00000000000 --- a/source/blender/src/space.c +++ /dev/null @@ -1,6678 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - * - * - here initialize and free and handling SPACE data - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" -#include "MEM_CacheLimiterC-Api.h" - -#ifdef INTERNATIONAL -#include "BIF_language.h" -#endif - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_gsqueue.h" -#include "BLI_linklist.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_curve_types.h" -#include "DNA_group_types.h" /* used for select_same_group */ -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" /* used for select grouped hooks */ -#include "DNA_object_types.h" -#include "DNA_particle_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_sequence_types.h" -#include "DNA_sound_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view2d_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_blender.h" -#include "BKE_colortools.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_ipo.h" -#include "BKE_main.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_scene.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" -#include "BKE_image.h" /* for IMA_TYPE_COMPOSITE and IMA_TYPE_R_RESULT */ -#include "BKE_particle.h" - -#include "BIF_spacetypes.h" /* first, nasty dependency with typedef */ - -#include "BIF_butspace.h" -#include "BIF_drawimage.h" -#include "BIF_drawseq.h" -#include "BIF_drawtext.h" -#include "BIF_drawscript.h" -#include "BIF_editarmature.h" -#include "BIF_editparticle.h" -#include "BIF_editconstraint.h" -#include "BIF_editdeform.h" -#include "BIF_editfont.h" -#include "BIF_editgroup.h" -#include "BIF_editkey.h" -#include "BIF_editlattice.h" -#include "BIF_editmesh.h" -#include "BIF_editmode_undo.h" -#include "BIF_editnla.h" -#include "BIF_editoops.h" -#include "BIF_editseq.h" -#include "BIF_editsima.h" -#include "BIF_editsound.h" -#include "BIF_editview.h" -#include "BIF_filelist.h" -#include "BIF_gl.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_interface_icons.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_oops.h" -#include "BIF_poseobject.h" -#include "BIF_outliner.h" -#include "BIF_resources.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" -#include "BIF_previewrender.h" - -#include "BSE_edit.h" -#include "BSE_view.h" -#include "BSE_editipo.h" -#include "BSE_drawipo.h" -#include "BSE_drawview.h" -#include "BSE_drawnla.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_editnla_types.h" -#include "BSE_time.h" -#include "BSE_trans_types.h" - -#include "BDR_vpaint.h" -#include "BDR_editmball.h" -#include "BDR_editobject.h" -#include "BDR_editcurve.h" -#include "BDR_editface.h" -#include "BDR_drawmesh.h" -#include "BDR_drawobject.h" -#include "BDR_imagepaint.h" -#include "BDR_sculptmode.h" -#include "BDR_unwrapper.h" - -#include "BLO_readfile.h" /* for BLO_blendhandle_close */ - -#include "PIL_time.h" - -#include "BPY_extern.h" - -#include "butspace.h" -#include "mydevice.h" -#include "blendef.h" -#include "datatoc.h" -#include "multires.h" - -#include "BIF_transform.h" - -#include "BKE_depsgraph.h" - -#include "BSE_trans_types.h" - -#include "SYS_System.h" /* for the user def menu ... should move elsewhere. */ - -/* maybe we need this defined somewhere else */ -extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing); -extern void StartKetsjiShellSimulation(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);/*rcruiz*/ - -/** - * When the mipmap setting changes, we want to redraw the view right - * away to reflect this setting. - */ -void space_mipmap_button_function(int event); - -void free_soundspace(SpaceSound *ssound); - -/* *************************************** */ - -/* don't know yet how the handlers will evolve, for simplicity - i choose for an array with eventcodes, this saves in a file! - */ -void add_blockhandler(ScrArea *sa, short eventcode, short val) -{ - SpaceLink *sl= sa->spacedata.first; - short a; - - /* find empty spot */ - for(a=0; ablockhandler[a]==eventcode ) { - sl->blockhandler[a+1]= val; - break; - } - else if( sl->blockhandler[a]==0) { - sl->blockhandler[a]= eventcode; - sl->blockhandler[a+1]= val; - break; - } - } - if(a==SPACE_MAXHANDLER) printf("error; max (4) blockhandlers reached!\n"); -} - -void rem_blockhandler(ScrArea *sa, short eventcode) -{ - SpaceLink *sl= sa->spacedata.first; - short a; - - for(a=0; ablockhandler[a]==eventcode) { - sl->blockhandler[a]= 0; - - /* specific free calls */ - if(eventcode==IMAGE_HANDLER_PREVIEW) - image_preview_event(0); - break; - } - } -} - -void toggle_blockhandler(ScrArea *sa, short eventcode, short val) -{ - SpaceLink *sl= sa->spacedata.first; - short a, addnew=1; - - /* find if it exists */ - for(a=0; ablockhandler[a]==eventcode ) { - sl->blockhandler[a]= 0; - - /* specific free calls */ - if(eventcode==VIEW3D_HANDLER_PREVIEW) - BIF_view3d_previewrender_free(sa->spacedata.first); - else if(eventcode==IMAGE_HANDLER_PREVIEW) - image_preview_event(0); - - addnew= 0; - } - } - if(addnew) { - add_blockhandler(sa, eventcode, val); - - /* specific add new calls */ - if(eventcode==IMAGE_HANDLER_PREVIEW) - image_preview_event(1); - } -} - - - -/* ************* SPACE: VIEW3D ************* */ - -/* extern void drawview3dspace(ScrArea *sa, void *spacedata); BSE_drawview.h */ - - -void copy_view3d_lock(short val) -{ - bScreen *sc; - int bit; - - /* from G.scene copy to the other views */ - sc= G.main->screen.first; - - while(sc) { - if(sc->scene==G.scene) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_OOPS && val==REDRAW) { - if(sa->win) scrarea_queue_winredraw(sa); - } - else if(sl->spacetype==SPACE_VIEW3D) { - View3D *vd= (View3D*) sl; - if(vd->scenelock && vd->localview==0) { - vd->lay= G.scene->lay; - vd->camera= G.scene->camera; - - if(vd->camera==0 && vd->persp>1) vd->persp= 1; - - if( (vd->lay & vd->layact) == 0) { - bit= 0; - while(bit<32) { - if(vd->lay & (1<layact= 1<spacedata.first) { - if(sa->win) scrarea_queue_redraw(sa); - } - } - } - sl= sl->next; - } - sa= sa->next; - } - } - sc= sc->id.next; - } -} - -void handle_view3d_around() -{ - bScreen *sc; - - if ((U.uiflag & USER_LOCKAROUND)==0) return; - - /* copies from G.vd->around to other view3ds */ - - sc= G.main->screen.first; - - while(sc) { - if(sc->scene==G.scene) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_VIEW3D) { - View3D *vd= (View3D*) sl; - if (vd != G.vd) { - vd->around= G.vd->around; - if (G.vd->flag & V3D_ALIGN) - vd->flag |= V3D_ALIGN; - else - vd->flag &= ~V3D_ALIGN; - scrarea_queue_headredraw(sa); - } - } - sl= sl->next; - } - sa= sa->next; - } - } - sc= sc->id.next; - } -} - -void handle_view3d_lock() -{ - if (G.vd != NULL && curarea != NULL ) { - if(G.vd->localview==0 && G.vd->scenelock && curarea->spacetype==SPACE_VIEW3D) { - - /* copy to scene */ - G.scene->lay= G.vd->lay; - G.scene->camera= G.vd->camera; - - copy_view3d_lock(REDRAW); - } - } -} - -void space_set_commmandline_options(void) { - SYS_SystemHandle syshandle; - int a; - - if ( (syshandle = SYS_GetSystem()) ) { - /* User defined settings */ - a= (U.gameflags & USER_VERTEX_ARRAYS); - SYS_WriteCommandLineInt(syshandle, "vertexarrays", a); - - a= (U.gameflags & USER_DISABLE_SOUND); - SYS_WriteCommandLineInt(syshandle, "noaudio", a); - - a= (U.gameflags & USER_DISABLE_MIPMAP); - set_mipmap(!a); - SYS_WriteCommandLineInt(syshandle, "nomipmap", a); - - /* File specific settings: */ - /* Only test the first one. These two are switched - * simultaneously. */ - a= (G.fileflags & G_FILE_SHOW_FRAMERATE); - SYS_WriteCommandLineInt(syshandle, "show_framerate", a); - SYS_WriteCommandLineInt(syshandle, "show_profile", a); - - /* When in wireframe mode, always draw debug props. */ - if (G.vd) { - a = ( (G.fileflags & G_FILE_SHOW_DEBUG_PROPS) - || (G.vd->drawtype == OB_WIRE) - || (G.vd->drawtype == OB_SOLID) ); - SYS_WriteCommandLineInt(syshandle, "show_properties", a); - } - - a= (G.fileflags & G_FILE_SHOW_PHYSICS); - SYS_WriteCommandLineInt(syshandle, "show_physics", a); - - a= (G.fileflags & G_FILE_ENABLE_ALL_FRAMES); - SYS_WriteCommandLineInt(syshandle, "fixedtime", a); - - a= (G.fileflags & G_FILE_GAME_TO_IPO); - SYS_WriteCommandLineInt(syshandle, "game2ipo", a); - - a=(G.fileflags & G_FILE_GAME_MAT); - SYS_WriteCommandLineInt(syshandle, "blender_material", a); - a=(G.fileflags & G_FILE_DIAPLAY_LISTS); - SYS_WriteCommandLineInt(syshandle, "displaylists", a); - - - } -} - -#if GAMEBLENDER == 1 - /** - * These two routines imported from the gameengine, - * I suspect a lot of the resetting stuff is cruft - * and can be removed, but it should be checked. - */ -static void SaveState(void) -{ - glPushAttrib(GL_ALL_ATTRIB_BITS); - - init_realtime_GL(); - init_gl_stuff(); - - if(G.f & G_TEXTUREPAINT) - texpaint_enable_mipmap(); - - if(G.scene->camera==0 || G.scene->camera->type!=OB_CAMERA) - error("no (correct) camera"); - - waitcursor(1); -} - -static void RestoreState(void) -{ - if(G.f & G_TEXTUREPAINT) - texpaint_disable_mipmap(); - - curarea->win_swap = 0; - curarea->head_swap=0; - allqueue(REDRAWVIEW3D, 1); - allqueue(REDRAWBUTSALL, 0); - reset_slowparents(); - waitcursor(0); - G.qual= 0; - glPopAttrib(); -} - -static LinkNode *save_and_reset_all_scene_cfra(void) -{ - LinkNode *storelist= NULL; - Scene *sc; - - for (sc= G.main->scene.first; sc; sc= sc->id.next) { - BLI_linklist_prepend(&storelist, (void*) (long) sc->r.cfra); - - /* why is this reset to 1 ?*/ - /* sc->r.cfra= 1;*/ - - set_scene_bg(sc); - } - - BLI_linklist_reverse(&storelist); - - return storelist; -} - -static void restore_all_scene_cfra(LinkNode *storelist) { - LinkNode *sc_store= storelist; - Scene *sc; - - for (sc= G.main->scene.first; sc; sc= sc->id.next) { - int stored_cfra= (long) sc_store->link; - - sc->r.cfra= stored_cfra; - set_scene_bg(sc); - - sc_store= sc_store->next; - } - - BLI_linklist_free(storelist, NULL); -} -#endif - -void start_game(void) -{ -#if GAMEBLENDER == 1 -#ifndef NO_KETSJI - Scene *sc, *startscene = G.scene; - LinkNode *scene_cfra_store; - - /* XXX, silly code - the game engine can - * access any scene through logic, so we try - * to make sure each scene has a valid camera, - * just in case the game engine tries to use it. - * - * Better would be to make a better routine - * in the game engine for finding the camera. - * - zr - * Note: yes, this is all very badly hacked! (ton) - */ - for (sc= G.main->scene.first; sc; sc= sc->id.next) { - if (!sc->camera) { - Base *base; - - for (base= sc->base.first; base; base= base->next) - if (base->object->type==OB_CAMERA) - break; - - sc->camera= base?base->object:NULL; - } - } - - /* these two lines make sure front and backbuffer are equal. for swapbuffers */ - markdirty_all(); - screen_swapbuffers(); - - /* can start from header */ - mywinset(curarea->win); - - scene_cfra_store= save_and_reset_all_scene_cfra(); - - - /* game engine will do its own sounds. */ - sound_stop_all_sounds(); - sound_exit_audio(); - - /* Before jumping into Ketsji, we configure some settings. */ - space_set_commmandline_options(); - - SaveState(); - StartKetsjiShell(curarea, startscene->id.name+2, G.main,G.sipo, 1); - RestoreState(); - - /* Restart BPY - unload the game engine modules. */ - BPY_end_python(); - BPY_start_python(0, NULL); /* argc, argv stored there already */ - BPY_post_start_python(); /* userpref path and menus init */ - - restore_all_scene_cfra(scene_cfra_store); - set_scene_bg(startscene); - scene_update_for_newframe(G.scene, G.scene->lay); - - if (G.flags & G_FILE_AUTOPLAY) - exit_usiblender(); - - /* groups could have changed ipo */ - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); -#endif -#else - notice("Game engine is disabled in this release!"); -#endif -} - -void start_RBSimulation(void) -{ -#if GAMEBLENDER == 1 -#ifndef NO_KETSJI - Scene *sc, *startscene = G.scene; - LinkNode *scene_cfra_store; - - /* XXX, silly code - the game engine can - * access any scene through logic, so we try - * to make sure each scene has a valid camera, - * just in case the game engine tries to use it. - * - * Better would be to make a better routine - * in the game engine for finding the camera. - * - zr - * Note: yes, this is all very badly hacked! (ton) - */ - for (sc= G.main->scene.first; sc; sc= sc->id.next) { - if (!sc->camera) { - Base *base; - - for (base= sc->base.first; base; base= base->next) - if (base->object->type==OB_CAMERA) - break; - - sc->camera= base?base->object:NULL; - } - } - - /* these two lines make sure front and backbuffer are equal. for swapbuffers */ - markdirty_all(); - screen_swapbuffers(); - - /* can start from header */ - mywinset(curarea->win); - - scene_cfra_store= save_and_reset_all_scene_cfra(); - - - /* game engine will do its own sounds. */ - sound_stop_all_sounds(); - sound_exit_audio(); - - /* Before jumping into Ketsji, we configure some settings. */ - space_set_commmandline_options(); - - SaveState(); - StartKetsjiShellSimulation(curarea, startscene->id.name+2, G.main,G.sipo, 1); - RestoreState(); - /* Restart BPY - unload the game engine modules. */ - BPY_end_python(); - BPY_start_python(0, NULL); /* argc, argv stored there already */ - BPY_post_start_python(); /* userpref path and menus init */ - - restore_all_scene_cfra(scene_cfra_store); - set_scene_bg(startscene); - scene_update_for_newframe(G.scene, G.scene->lay); - - if (G.flags & G_FILE_AUTOPLAY) - exit_usiblender(); - - /* groups could have changed ipo */ - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); -#endif -#else - notice("YOU NEED GAME ENGIEN TO RUN THE SIMULATION!"); -#endif -} - -static void changeview3dspace(ScrArea *sa, void *spacedata) -{ - setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */ -} - - /* Callable from editmode and faceselect mode from the - * moment, would be nice (and is easy) to generalize - * to any mode. - */ -static void align_view_to_selected(View3D *v3d) -{ - int nr= pupmenu("Align View (Ctrl flips)%t|To Selected (top)%x3|To Selected (front)%x2|To Selected (side)%x1"); - if (nr!=-1) { - int axis= nr; - - /* opposite axis in case ctrl is pressed */ - if(G.qual==LR_CTRLKEY) axis= -axis; - - if ((G.obedit) && (G.obedit->type == OB_MESH)) { - editmesh_align_view_to_selected(v3d, axis); - addqueue(v3d->area->win, REDRAW, 1); - } else if (FACESEL_PAINT_TEST) { - Object *obact= OBACT; - if (obact && obact->type==OB_MESH) { - Mesh *me= obact->data; - faceselect_align_view_to_selected(v3d, me, axis); - addqueue(v3d->area->win, REDRAW, 1); - } - } - } -} - - -static short select_children(Object *ob, int recursive) -{ - short changed = 0; - Base *base; - - for (base= FIRSTBASE; base; base= base->next) { - if (ob == base->object->parent) { - if (BASE_SELECTABLE(base) && !(base->flag & SELECT)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - - if (recursive) - changed |= select_children(base->object, 1); - } - } - return changed; -} - -static short select_parent(void) /* Makes parent active and de-selected OBACT */ -{ - short changed = 0; - Base *base, *startbase, *basact=NULL, *oldbasact; - - if (!(OBACT) || !(OBACT->parent)) return 0; - BASACT->flag &= (~SELECT); - BASACT->object->flag &= (~SELECT); - startbase= FIRSTBASE; - if(BASACT && BASACT->next) startbase= BASACT->next; - base = startbase; - while(base) { - if(base->object==BASACT->object->parent) { basact=base; break; } - base=base->next; - if(base==NULL) base= FIRSTBASE; - if(base==startbase) break; - } - /* can be NULL if parent in other scene */ - if(basact && BASE_SELECTABLE(basact)) { - oldbasact = BASACT; - BASACT = basact; - basact->flag |= SELECT; - - basact->object->flag= basact->flag; - - set_active_base(basact); - changed = 1; - } - return changed; -} - - -#define GROUP_MENU_MAX 24 -static short select_same_group(Object *ob) /* Select objects in the same group as the active */ -{ - short changed = 0; - Base *base; - Group *group, *ob_groups[GROUP_MENU_MAX]; - char str[10 + (24*GROUP_MENU_MAX)]; - char *p = str; - int group_count=0, menu, i; - - if (!ob) - return 0; - - for ( group=G.main->group.first; - group && group_count < GROUP_MENU_MAX; - group=group->id.next - ) { - if (object_in_group (ob, group)) { - ob_groups[group_count] = group; - group_count++; - } - } - - if (!group_count) - return 0; - - else if (group_count == 1) { - group = ob_groups[0]; - for (base= FIRSTBASE; base; base= base->next) { - if (BASE_SELECTABLE(base) && !(base->flag & SELECT) && object_in_group(base->object, group)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - } - return changed; - } - - /* build the menu. */ - p += sprintf(str, "Groups%%t"); - for (i=0; iid.name+2, i); - } - - menu = pupmenu (str); - if (menu == -1) - return 0; - - group = ob_groups[menu]; - for (base= FIRSTBASE; base; base= base->next) { - if (!(base->flag & SELECT) && object_in_group(base->object, group)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - } - return changed; -} - -static short select_object_hooks(Object *ob) -{ - short changed = 0; - Base *base; - ModifierData *md; - HookModifierData *hmd; - - if (!ob) - return 0; - - for (md = ob->modifiers.first; md; md=md->next) { - if (md->type==eModifierType_Hook) { - hmd= (HookModifierData*) md; - if (hmd->object && !(hmd->object->flag & SELECT)) { - base= object_in_scene(hmd->object, G.scene); - if (base && BASE_SELECTABLE(base)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - } - } - } - return changed; -} - -/* Select objects woth the same parent as the active (siblings), - * parent can be NULL also */ -static short select_same_parent(Object *ob) -{ - short changed = 0; - Base *base; - if (!ob) - return 0; - - for (base= FIRSTBASE; base; base= base->next) { - if (BASE_SELECTABLE(base) && (base->object->parent==ob->parent) && !(base->flag & SELECT)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - } - return changed; -} - -static short select_same_type(Object *ob) -{ - short changed = 0; - Base *base; - if (!ob) - return 0; - - for (base= FIRSTBASE; base; base= base->next) { - if (BASE_SELECTABLE(base) && (base->object->type == ob->type) && !(base->flag & SELECT)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - } - return changed; -} - -static short select_same_layer(Object *ob) -{ - char changed = 0; - Base *base = FIRSTBASE; - - if (!ob) - return 0; - - while(base) { - if (BASE_SELECTABLE(base) && (base->lay & ob->lay) && !(base->flag & SELECT)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - base= base->next; - } - return changed; -} - -static short select_same_index_object(Object *ob) -{ - char changed = 0; - Base *base = FIRSTBASE; - - if (!ob) - return 0; - - while(base) { - if (BASE_SELECTABLE(base) && (base->object->index == ob->index) && !(base->flag & SELECT)) { - base->flag |= SELECT; - base->object->flag |= SELECT; - changed = 1; - } - base= base->next; - } - return changed; -} - -void select_object_grouped(short nr) -{ - short changed = 0; - if(nr==1) changed = select_children(OBACT, 1); - else if(nr==2) changed = select_children(OBACT, 0); - else if(nr==3) changed = select_parent(); - else if(nr==4) changed = select_same_parent(OBACT); - else if(nr==5) changed = select_same_type(OBACT); - else if(nr==6) changed = select_same_layer(OBACT); - else if(nr==7) changed = select_same_group(OBACT); - else if(nr==8) changed = select_object_hooks(OBACT); - else if(nr==9) changed = select_same_index_object(OBACT); - - if (changed) { - countall(); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSOBJECT, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWIPO, 0); - BIF_undo_push("Select Grouped"); - } -} - -static void select_object_grouped_menu(void) -{ - char *str; - short nr; - - /* make menu string */ - - str= MEM_mallocN(512, "groupmenu"); - strcpy(str, "Select Grouped%t|Children%x1|" - "Immediate Children%x2|Parent%x3|" - "Siblings (Shared Parent)%x4|" - "Objects of Same Type%x5|" - "Objects on Shared Layers%x6|" - "Objects in Same Group%x7|" - "Object Hooks%x8|Object PassIndex%x9"); - - /* here we go */ - - nr= pupmenu(str); - MEM_freeN(str); - - select_object_grouped(nr); -} - -void join_menu(void) -{ - Object *ob= OBACT; - if (G.obedit) { - error("This data does not support joining in editmode"); - return; - } - if (!ob) { - error("Can't join unless there is an active object"); - return; - } - - if(ob->type == OB_MESH) { - if(okee("Join selected meshes")==0) return; - join_mesh(); - } else if(ob->type == OB_CURVE) { - if(okee("Join selected curves")==0) return; - join_curve(OB_CURVE); - } else if(ob->type == OB_SURF) { - if(okee("Join selected NURBS")==0) return; - join_curve(OB_SURF); - } else if(ob->type == OB_ARMATURE) { - /* Make sure the user wants to continue*/ - if(okee("Join selected armatures")==0) return; - join_armature (); - } else { - error("This object type doesn't support joining"); - } -} - -static unsigned short convert_for_nonumpad(unsigned short event) -{ - if (event>=ZEROKEY && event<=NINEKEY) { - return event - ZEROKEY + PAD0; - } else if (event==MINUSKEY) { - return PADMINUS; - } else if (event==EQUALKEY) { - return PADPLUSKEY; - } else if (event==BACKSLASHKEY) { - return PADSLASHKEY; - } else { - return event; - } -} - -/* *************** */ - -void BIF_undo_push(char *str) -{ - if(G.obedit) { - if (U.undosteps == 0) return; - - if(G.obedit->type==OB_MESH) - undo_push_mesh(str); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) - undo_push_curve(str); - else if (G.obedit->type==OB_FONT) - undo_push_font(str); - else if (G.obedit->type==OB_MBALL) - undo_push_mball(str); - else if (G.obedit->type==OB_LATTICE) - undo_push_lattice(str); - else if (G.obedit->type==OB_ARMATURE) - undo_push_armature(str); - } - else if(G.f & G_PARTICLEEDIT) { - PE_undo_push(str); - } - else { - if(U.uiflag & USER_GLOBALUNDO) - BKE_write_undo(str); - } -} - -void BIF_undo(void) -{ - if(G.obedit) { - if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) - undo_editmode_step(1); - } - else { - if(G.f & G_TEXTUREPAINT) - imagepaint_undo(); - else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL)) - imagepaint_undo(); - else if(G.f & G_PARTICLEEDIT) - PE_undo(); - else { - /* now also in faceselect mode */ - if(U.uiflag & USER_GLOBALUNDO) { - BKE_undo_step(1); - sound_initialize_sounds(); - } - } - } -} - -void BIF_redo(void) -{ - if(G.obedit) { - if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) - undo_editmode_step(-1); - } - else { - if(G.f & G_TEXTUREPAINT) - imagepaint_undo(); - else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL)) - imagepaint_undo(); - else if(G.f & G_PARTICLEEDIT) - PE_redo(); - else { - /* includes faceselect now */ - if(U.uiflag & USER_GLOBALUNDO) { - BKE_undo_step(-1); - sound_initialize_sounds(); - } - } - } -} - -void BIF_undo_menu(void) -{ - if(G.obedit) { - if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) - undo_editmode_menu(); - allqueue(REDRAWALL, 0); - } - else { - if(G.f & G_PARTICLEEDIT) - PE_undo_menu(); - else if(U.uiflag & USER_GLOBALUNDO) { - char *menu= BKE_undo_menu_string(); - if(menu) { - short event= pupmenu_col(menu, 20); - MEM_freeN(menu); - if(event>0) BKE_undo_number(event); - } - } - } -} - -/* *************** */ - -void handle_view_middlemouse() { - /* use '&' here, because of alt+leftmouse which emulates middlemouse */ - if(U.flag & USER_VIEWMOVE) { - if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY)))) - viewmove(0); - else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY)))) - viewmove(2); - else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY))) - viewmove(1); - } - else { - if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY)))) - viewmove(1); - else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY)))) - viewmove(2); - else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY))) - viewmove(0); - } -} - -void handle_view_wheelup() -{ - /* Regular: Zoom in */ - /* Shift: Scroll up */ - /* Ctrl: Scroll right */ - /* Alt-Shift: Rotate up */ - /* Alt-Ctrl: Rotate right */ - - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD2); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD2); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD4); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD4); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADMINUS); - else - persptoetsen(PADPLUSKEY); -} - -void handle_view_wheeldown() -{ - /* Regular: Zoom out */ - /* Shift: Scroll down */ - /* Ctrl: Scroll left */ - /* Alt-Shift: Rotate down */ - /* Alt-Ctrl: Rotate left */ - - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD8); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD8); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD6); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD6); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADPLUSKEY); - else - persptoetsen(PADMINUS); -} - -int mouse_in_header(ScrArea *sa) -{ - short mouse[2]; - getmouseco_sc(mouse); - return mouse[0] >= sa->headrct.xmin && - mouse[0] <= sa->headrct.xmax && - mouse[1] >= sa->headrct.ymin && - mouse[1] <= sa->headrct.ymax; -} - -static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - View3D *v3d= sa->spacedata.first; - Object *ob= OBACT; /* do not change! */ - float *curs; - int doredraw= 0, pupval; - unsigned short event= evt->event; - short val= evt->val; - char ascii= evt->ascii; - - if(curarea->win==0) return; /* when it comes from sa->headqread() */ - - if(val) { - - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - if(event==UI_BUT_EVENT) do_butspace(val); /* temporal, view3d deserves own queue? */ - - /* we consider manipulator a button, defaulting to leftmouse */ - if(event==LEFTMOUSE) if(BIF_do_manipulator(sa)) return; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - /* only swap mouse button for selection, in modes where it is relevant. - * painting/sculpting stays on LEFTMOUSE */ - if ( !((G.f & G_SCULPTMODE) || (G.f & G_WEIGHTPAINT) || - (G.f & G_VERTEXPAINT) || (G.f & G_TEXTUREPAINT) || (G.f & G_PARTICLEEDIT)) || - (G.obedit) ) - { - if (event==LEFTMOUSE) event = RIGHTMOUSE; - else if (event==RIGHTMOUSE) event = LEFTMOUSE; - } - } - - if(!mouse_in_header(sa)) { - if(!G.obedit && (G.f & G_SCULPTMODE)) { - SculptSession *ss= sculpt_session(); - if(ss && ss->propset) { - sculptmode_propset(event); - return; - } - else if(event!=LEFTMOUSE && event!=MIDDLEMOUSE && (event==MOUSEY || event==MOUSEX)) { - if(!bwin_qtest(sa->win)) - allqueue(REDRAWVIEW3D, 0); - } - } - else if(!G.obedit && OBACT && G.f&G_PARTICLEEDIT){ - ParticleSystem *psys=PE_get_current(OBACT); - ParticleEditSettings *pset=PE_settings(); - if(psys && psys->edit){ - if(pset->brushtype>=0 && - event!=LEFTMOUSE && event!=RIGHTMOUSE && event!=MIDDLEMOUSE && - (event==MOUSEY || event==MOUSEX) && bwin_qtest(sa->win)==0) { - allqueue(REDRAWVIEW3D, 0); - } - } - } - - /* Handle retopo painting */ - if(retopo_mesh_paint_check()) { - if(!retopo_paint(event)) - return; - } - } - - /* run any view3d event handler script links */ - if (event && sa->scriptlink.totscript) - if (BPY_do_spacehandlers(sa, event, SPACEHANDLER_VIEW3D_EVENT)) - return; /* return if event was processed (swallowed) by handler(s) */ - - /* TEXTEDITING?? */ - if((G.obedit) && G.obedit->type==OB_FONT) { - switch(event) { - - case LEFTMOUSE: - mouse_cursor(); - break; - case MIDDLEMOUSE: - /* use '&' here, because of alt+leftmouse which emulates middlemouse */ - if(U.flag & USER_VIEWMOVE) { - if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY)))) - viewmove(0); - else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY)))) - viewmove(2); - else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY))) - viewmove(1); - } - else { - if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY)))) - viewmove(1); - else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY)))) - viewmove(2); - else - viewmove(0); - } - break; - - case WHEELUPMOUSE: - /* Regular: Zoom in */ - /* Shift: Scroll up */ - /* Ctrl: Scroll right */ - /* Alt-Shift: Rotate up */ - /* Alt-Ctrl: Rotate right */ - - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD2); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD2); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD4); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD4); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADMINUS); - else - persptoetsen(PADPLUSKEY); - - doredraw= 1; - break; - - case WHEELDOWNMOUSE: - /* Regular: Zoom out */ - /* Shift: Scroll down */ - /* Ctrl: Scroll left */ - /* Alt-Shift: Rotate down */ - /* Alt-Ctrl: Rotate left */ - - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD8); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD8); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD6); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD6); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADPLUSKEY); - else - persptoetsen(PADMINUS); - - doredraw= 1; - break; - - case UKEY: - if(G.qual==LR_ALTKEY) { - remake_editText(); - doredraw= 1; - } - else { - do_textedit(event, val, ascii); - } - break; - case VKEY: - if(G.qual==LR_ALTKEY) { - paste_editText(); - doredraw= 1; - } - else { - do_textedit(event, val, ascii); - } - break; - case PAD0: case PAD1: case PAD2: case PAD3: case PAD4: - case PAD5: case PAD6: case PAD7: case PAD8: case PAD9: - case PADENTER: - persptoetsen(event); - doredraw= 1; - break; - - default: - do_textedit(event, val, ascii); - break; - } - } - else if(!G.obedit && (G.f & G_SCULPTMODE)) { - SculptData *sd= sculpt_data(); - SculptSession *ss= sculpt_session(); - BrushData *br= sculptmode_brush(); - Mesh *me= get_mesh(OBACT); - char update_prop= 0; - - if(U.flag & USER_NONUMPAD) { - event= convert_for_nonumpad(event); - } - - switch(event) { - case LEFTMOUSE: - if(G.qual==LR_SHIFTKEY+LR_CTRLKEY) - sculptmode_pmv(0); - else if(!(ss && ss->propset)) - sculpt(); - break; - /* View */ - case MIDDLEMOUSE: - handle_view_middlemouse(); - break; - case WHEELUPMOUSE: - handle_view_wheelup(); - doredraw= 1; - break; - case WHEELDOWNMOUSE: - handle_view_wheeldown(); - doredraw= 1; - break; - case RIGHTMOUSE: - if(G.qual==LR_SHIFTKEY+LR_CTRLKEY) - sculptmode_pmv(1); - break; - case CKEY: - if(G.qual==LR_SHIFTKEY) { - view3d_home(1); - curs= give_cursor(); - curs[0]=curs[1]=curs[2]= 0.0; - allqueue(REDRAWVIEW3D, 0); - } - else if(G.qual==0) { - if (G.vd->persp==2) - /* center the camera offset */ - G.vd->camdx= G.vd->camdy= 0.0; - else { - /*non camera center*/ - float new_ofs[3]; - curs= give_cursor(); - new_ofs[0]= -curs[0]; - new_ofs[1]= -curs[1]; - new_ofs[2]= -curs[2]; - smooth_view(G.vd, new_ofs, NULL, NULL, NULL); - } - } - doredraw= 1; - break; - case PAD0: case PAD1: case PAD2: case PAD3: case PAD4: - case PAD5: case PAD6: case PAD7: case PAD8: case PAD9: - case PADPLUSKEY: - case PADMINUS: - case PADENTER: - persptoetsen(event); - doredraw= 1; - break; - case BKEY: - if(G.qual==LR_ALTKEY) - view3d_edit_clipping(v3d); - else if(G.qual==LR_SHIFTKEY) { - if(G.vd->persp==2) - set_render_border(); - else - view3d_border_zoom(); - } - break; - case PADSLASHKEY: - if(!G.qual) { - if(G.vd->localview) { - G.vd->localview= 0; - endlocalview(curarea); - } - else { - G.vd->localview= 1; - initlocalview(); - } - allqueue(REDRAWVIEW3D, 1); - } - break; - /* Brush properties */ - case AKEY: - br->airbrush= !br->airbrush; - update_prop= 1; break; - case FKEY: - if(G.qual==0) - sculptmode_propset_init(PropsetSize); - if(G.qual==LR_SHIFTKEY) - sculptmode_propset_init(PropsetStrength); - if(G.qual==LR_CTRLKEY) - sculptmode_propset_init(PropsetTexRot); - break; - case VKEY: - br->dir= br->dir==1 ? 2 : 1; - update_prop= 1; break; - /* Set brush */ - case DKEY: - sd->brush_type= DRAW_BRUSH; - update_prop= 1; break; - case SKEY: - sd->brush_type= SMOOTH_BRUSH; - update_prop= 1; break; - case PKEY: - sd->brush_type= PINCH_BRUSH; - update_prop= 1; break; - case IKEY: - sd->brush_type= INFLATE_BRUSH; - update_prop= 1; break; - case GKEY: - sd->brush_type= GRAB_BRUSH; - update_prop= 1; break; - case LKEY: - sd->brush_type= LAYER_BRUSH; - update_prop= 1; break; - case TKEY: - sd->brush_type= FLATTEN_BRUSH; - update_prop= 1; break; - /* Symmetry */ - case XKEY: - sd->symm^= SYMM_X; - update_prop= 1; break; - case YKEY: - sd->symm^= SYMM_Y; - update_prop= 1; break; - case ZKEY: - sd->symm^= SYMM_Z; - update_prop= 1; break; - /* Interface */ - case NKEY: - if(G.qual==0) { - toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE); - allqueue(REDRAWVIEW3D, 0); - } - break; - /* Multires */ - case PAGEUPKEY: - if(me && me->mr) { - me->mr->newlvl= ((Mesh*)ob->data)->mr->current+1; - multires_set_level(ob, ob->data, 0); - } - break; - case PAGEDOWNKEY: - if(me && me->mr) { - me->mr->newlvl= ((Mesh*)ob->data)->mr->current-1; - multires_set_level(ob, ob->data, 0); - } - break; - /* Partial Visibility */ - case HKEY: - if(G.qual==LR_ALTKEY) { - waitcursor(1); - sculptmode_pmv_off(get_mesh(ob)); - BIF_undo_push("Partial mesh hide"); - allqueue(REDRAWVIEW3D,0); - waitcursor(0); - } - break; - /* Layers */ - case ONEKEY: - do_layer_buttons(0); break; - case TWOKEY: - do_layer_buttons(1); break; - case THREEKEY: - do_layer_buttons(2); break; - case FOURKEY: - do_layer_buttons(3); break; - case FIVEKEY: - do_layer_buttons(4); break; - case SIXKEY: - do_layer_buttons(5); break; - case SEVENKEY: - do_layer_buttons(6); break; - case EIGHTKEY: - do_layer_buttons(7); break; - case NINEKEY: - do_layer_buttons(8); break; - case ZEROKEY: - do_layer_buttons(9); break; - case MINUSKEY: - do_layer_buttons(10); break; - case EQUALKEY: - do_layer_buttons(11); break; - case ACCENTGRAVEKEY: - do_layer_buttons(-1); break; - } - - /* Redraw buttons window as well as view 3d (for floating panel) */ - if(update_prop) { - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - } else { - - if (U.flag & USER_NONUMPAD) { - event= convert_for_nonumpad(event); - } - - switch(event) { - - /* Afterqueue events */ - case BACKBUFDRAW: - backdrawview3d(1); - break; - case RENDERPREVIEW: - BIF_view3d_previewrender(sa); - break; - - case TABKEY: - /* Shift-Tabe handling (other cases are in toets) */ - if (G.qual == LR_SHIFTKEY) - { - /* Snap toggle (only edit mesh right now) */ - if (G.obedit && G.obedit->type==OB_MESH) - { - G.scene->snap_flag ^= SCE_SNAP; - allqueue(REDRAWHEADERS, 0); - } - } - break; - - /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, - * based on user preference USER_LMOUSESELECT - */ - case LEFTMOUSE: - if ((G.obedit) || !(G.f&(G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT|G_PARTICLEEDIT))) { - mouse_cursor(); - } - else if (G.f & G_WEIGHTPAINT) { - weight_paint(); - } - else if (G.f & G_VERTEXPAINT) { - vertex_paint(); - } - else if (G.f & G_TEXTUREPAINT) { - imagepaint_paint(L_MOUSE, 1); - } - else if (G.f & G_PARTICLEEDIT) { - if(G.qual & LR_CTRLKEY) - mouse_cursor(); - else if(!PE_brush_particles()) - mouse_cursor(); - } - break; - case MIDDLEMOUSE: - handle_view_middlemouse(); - break; - case RIGHTMOUSE: - if((G.obedit) && (G.qual & LR_CTRLKEY)==0) { - if(G.obedit->type==OB_MESH) - mouse_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) - mouse_nurb(); - else if(G.obedit->type==OB_MBALL) - mouse_mball(); - else if(G.obedit->type==OB_LATTICE) - mouse_lattice(); - else if(G.obedit->type==OB_ARMATURE) - mouse_armature(); - } - else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY))) - mouse_mesh(); /* loop select for 1 mousebutton dudes */ - else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY))) - mouse_mesh(); /* loop select for 1 mousebutton dudes */ - else if(G.qual==LR_CTRLKEY) - mouse_select(); /* also allow in editmode, for vertex parenting */ - else if(FACESEL_PAINT_TEST) - face_select(); - else if( G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) - sample_vpaint(); - else if( G.f & G_PARTICLEEDIT) - PE_mouse_particles(); - else - mouse_select(); /* does poses too */ - break; - case WHEELUPMOUSE: - handle_view_wheelup(); - doredraw= 1; - break; - case WHEELDOWNMOUSE: - handle_view_wheeldown(); - doredraw= 1; - break; - - case ONEKEY: - if(G.qual==LR_CTRLKEY) { - flip_subdivison(1); - } - else do_layer_buttons(0); - break; - - case TWOKEY: - if(G.qual==LR_CTRLKEY) { - flip_subdivison(2); - } - else do_layer_buttons(1); - break; - - case THREEKEY: - if(G.qual==LR_CTRLKEY) { - flip_subdivison(3); - } - else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - if ( (G.obedit) && (G.obedit->type==OB_MESH) ) - select_faces_by_numverts(3); - } - else do_layer_buttons(2); - break; - - case FOURKEY: - if(G.qual==LR_CTRLKEY) { - flip_subdivison(4); - } - else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - if ( (G.obedit) && (G.obedit->type==OB_MESH) ) - select_faces_by_numverts(4); - } - else do_layer_buttons(3); - break; - - case FIVEKEY: - if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - if ( (G.obedit) && (G.obedit->type==OB_MESH) ) - select_faces_by_numverts(5); - } - else do_layer_buttons(4); - break; - - case SIXKEY: - do_layer_buttons(5); break; - case SEVENKEY: - do_layer_buttons(6); break; - case EIGHTKEY: - do_layer_buttons(7); break; - case NINEKEY: - do_layer_buttons(8); break; - case ZEROKEY: - do_layer_buttons(9); break; - case MINUSKEY: - do_layer_buttons(10); break; - case EQUALKEY: - do_layer_buttons(11); break; - case ACCENTGRAVEKEY: - do_layer_buttons(-1); break; - - case SPACEKEY: - if(G.qual == LR_CTRLKEY) { - val= pupmenu("Manipulator%t|Enable/Disable|Translate|Rotate|Scale|Combo"); - if(val>0) { - if(val==1) v3d->twflag ^= V3D_USE_MANIPULATOR; - else { - if(val==2) v3d->twtype= V3D_MANIP_TRANSLATE; - else if(val==3) v3d->twtype= V3D_MANIP_ROTATE; - else if(val==4) v3d->twtype= V3D_MANIP_SCALE; - else if(val==5) v3d->twtype= V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE|V3D_MANIP_SCALE; - v3d->twflag |= V3D_USE_MANIPULATOR; - } - doredraw= 1; - } - } - else if(G.qual == LR_ALTKEY) { - BIF_selectOrientation(); - doredraw= 1; - } - - break; - - case AKEY: - if(G.qual & LR_CTRLKEY) apply_object(); /* also with shift! */ - else if((G.qual==LR_SHIFTKEY)) { - toolbox_n_add(); - } - else { - if(G.obedit) { - if(G.obedit->type==OB_MESH) - deselectall_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) - deselectall_nurb(); - else if(G.obedit->type==OB_MBALL) - deselectall_mball(); - else if(G.obedit->type==OB_LATTICE) - deselectall_Latt(); - else if(G.obedit->type==OB_ARMATURE) - deselectall_armature(1, 1); /* 1 == toggle */ - } - else if (ob && (ob->flag & OB_POSEMODE)){ - deselectall_posearmature(ob, 1, 1); - } - else { - if(FACESEL_PAINT_TEST) deselectall_tface(); - else if(G.f & G_PARTICLEEDIT) PE_deselectall(); - else { - /* by design, the center of the active object - * (which need not necessarily by selected) will - * still be drawn as if it were selected. - */ - deselectall(); - } - } - } - break; - case BKEY: - if(G.qual==LR_ALTKEY) - view3d_edit_clipping(v3d); - else if(G.qual==LR_SHIFTKEY) - { - if(G.vd->persp==2) - set_render_border(); - else - view3d_border_zoom(); - } - else if(G.qual==LR_CTRLKEY) { - if(okee("Bake all selected")) { - extern void softbody_bake(Object *ob); - extern void fluidsimBake(Object *ob); - softbody_bake(NULL); - /* also bake first domain of selected objects... */ - fluidsimBake(NULL); - } - } - else if(G.qual== (LR_ALTKEY|LR_CTRLKEY)) - objects_bake_render_menu(); - else if(G.qual==0) - borderselect(); - break; - case CKEY: - if(G.qual==LR_CTRLKEY) { - if(ob && (ob->flag & OB_POSEMODE)) - pose_copy_menu(); /* poseobject.c */ - else - copy_attr_menu(); - } - else if(G.qual==LR_ALTKEY) { - if(ob && (ob->flag & OB_POSEMODE)) - pose_clear_constraints(); /* poseobject.c */ - else - convertmenu(); /* editobject.c */ - } - else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) - add_constraint(0); /* editconstraint.c, generic for objects and posemode */ - else if((G.qual==LR_SHIFTKEY)) { - view3d_home(1); - curs= give_cursor(); - curs[0]=curs[1]=curs[2]= 0.0; - allqueue(REDRAWVIEW3D, 0); - } - else if((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF) ) { - makecyclicNurb(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - else if((G.qual==0)){ - if (G.vd->persp==2) - /* center the camera offset */ - G.vd->camdx= G.vd->camdy= 0.0; - else { - /*non camera center*/ - float new_ofs[3]; - curs= give_cursor(); - new_ofs[0]= -curs[0]; - new_ofs[1]= -curs[1]; - new_ofs[2]= -curs[2]; - smooth_view(G.vd, new_ofs, NULL, NULL, NULL); - } - scrarea_queue_winredraw(curarea); - } - break; - case DKEY: - if((G.qual==LR_SHIFTKEY)) { - duplicate_context_selected(); - } - else if(G.qual==LR_ALTKEY) { - if(ob && (ob->flag & OB_POSEMODE)) - error ("Duplicate not possible in posemode."); - else if((G.obedit==NULL)) - adduplicate(0, 0); - } - else if(G.qual==LR_CTRLKEY) { - imagestodisplist(); - } - else if((G.qual==0)){ - pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4|Textured Solid %x5"); - if(pupval>0) { - G.vd->drawtype= pupval; - doredraw= 1; - } - } - - break; - case EKEY: - if (G.qual==0){ - if(G.obedit) { - if(G.obedit->type==OB_MESH) - extrude_mesh(); - else if(G.obedit->type==OB_CURVE) - addvert_Nurb('e'); - else if(G.obedit->type==OB_SURF) - extrude_nurb(); - else if(G.obedit->type==OB_ARMATURE) - extrude_armature(0); - } - } - else if (G.qual==LR_CTRLKEY) { - if(G.obedit && G.obedit->type==OB_MESH) - Edge_Menu(); - else if (FACESEL_PAINT_TEST) - seam_mark_clear_tface(0); - } - else if (G.qual==LR_SHIFTKEY) { - if (G.obedit && G.obedit->type==OB_MESH && - !multires_level1_test()) { - initTransform(TFM_CREASE, CTX_EDGE); - Transform(); - } - else if (G.obedit && G.obedit->type==OB_ARMATURE) { - extrude_armature(1); - } - } - break; - case FKEY: - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - if(G.qual == LR_CTRLKEY) - Face_Menu(); - else if((G.qual==LR_SHIFTKEY)) - fill_mesh(); - else if(G.qual==LR_ALTKEY) - beauty_fill(); - else if(G.qual==(LR_CTRLKEY|LR_SHIFTKEY)) - edge_flip(); - else if (G.qual==0) - addedgeface_mesh(); - else if ( G.qual == - (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - select_linked_flat_faces(); - } - - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - addsegment_nurb(); - } - else if(G.obedit->type == OB_ARMATURE) { - fill_bones_armature(); - } - } - else if(G.qual==LR_CTRLKEY) - sort_faces(); - else if((G.qual==LR_SHIFTKEY)) { - if(ob && (ob->flag & OB_POSEMODE)) - pose_activate_flipped_bone(); - else if(G.f & G_WEIGHTPAINT) - pose_activate_flipped_bone(); - else - fly(); - } - else { - if (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT)){ - G.f ^= G_FACESELECT; - allqueue(REDRAWVIEW3D, 1); - } - } - - break; - case GKEY: - if((G.qual == LR_CTRLKEY)) { - if(G.obedit) { - if(ELEM(G.obedit->type, OB_MESH, OB_LATTICE)) - vgroup_assign_with_menu(); - } - else - group_operation_with_menu(); - } - else if((G.qual == (LR_CTRLKEY|LR_SHIFTKEY))) { - if(G.obedit) { - if(ELEM(G.obedit->type, OB_MESH, OB_LATTICE)) - vgroup_operation_with_menu(); - } - } - else if((G.qual==LR_SHIFTKEY)) - if(G.obedit) { - if(G.obedit->type==OB_MESH) - select_mesh_group_menu(); - } else - select_object_grouped_menu(); - else if((G.obedit==0) && G.qual==LR_ALTKEY) { - if(okee("Clear location")) { - clear_object('g'); - } - } - else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) { - v3d->twtype= V3D_MANIP_TRANSLATE; - doredraw= 1; - } - else if((G.qual==0)) { - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - } - break; - case HKEY: - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - if(G.qual==LR_CTRLKEY) - add_hook(); - else if(G.qual==LR_ALTKEY) - reveal_mesh(); - else if((G.qual==LR_SHIFTKEY)) - hide_mesh(1); - else if((G.qual==0)) - hide_mesh(0); - } - else if(G.obedit->type== OB_SURF) { - if(G.qual==LR_CTRLKEY) - add_hook(); - else if(G.qual==LR_ALTKEY) - revealNurb(); - else if((G.qual==LR_SHIFTKEY)) - hideNurb(1); - else if((G.qual==0)) - hideNurb(0); - } - else if(G.obedit->type==OB_CURVE) { - if(G.qual==LR_CTRLKEY) - add_hook(); - else if(G.qual==LR_ALTKEY) - revealNurb(); - /* should be G.qual==LR_SHIFTKEY, but that is taken fro handles already */ - else if((G.qual==(LR_ALTKEY|LR_SHIFTKEY))) - hideNurb(1); - /* should be G.qual==0, but that is taken for handles already */ - else if((G.qual==(LR_ALTKEY|LR_CTRLKEY))) - hideNurb(0); - else { - if(G.qual==LR_CTRLKEY) /* conflict */ - autocalchandlesNurb_all(1); /* flag=1, selected */ - else if((G.qual==LR_SHIFTKEY)) - sethandlesNurb(1); - else if((G.qual==0)) - sethandlesNurb(3); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - BIF_undo_push("Handle change"); - allqueue(REDRAWVIEW3D, 0); - } - } - else if(G.obedit->type==OB_LATTICE) { - if(G.qual==LR_CTRLKEY) add_hook(); - } - else if(G.obedit->type==OB_MBALL) { - if(G.qual==LR_ALTKEY) - reveal_mball(); - else if((G.qual==LR_SHIFTKEY)) - hide_mball(1); - else if((G.qual==0)) - hide_mball(0); - } - else if(G.obedit->type==OB_ARMATURE) { - if (G.qual==0) - hide_selected_armature_bones(); - else if (G.qual==LR_SHIFTKEY) - hide_unselected_armature_bones(); - else if (G.qual==LR_ALTKEY) - show_all_armature_bones(); - } - } - else if(FACESEL_PAINT_TEST) - hide_tface(); - else if(G.f & G_PARTICLEEDIT) { - if(G.qual == LR_ALTKEY) - PE_hide(0); - else if(G.qual == LR_SHIFTKEY) - PE_hide(1); - else if(G.qual == 0) - PE_hide(2); - } - else if(ob && (ob->flag & OB_POSEMODE)) { - if (G.qual==0) - hide_selected_pose_bones(); - else if (G.qual==LR_SHIFTKEY) - hide_unselected_pose_bones(); - else if (G.qual==LR_ALTKEY) - show_all_pose_bones(); - } - /* Object mode only, other modes are accounted for above */ - else if ((G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) { - if(G.qual==LR_CTRLKEY)hookmenu(); - else if(G.qual==LR_ALTKEY) show_objects(); - else if(G.qual==LR_SHIFTKEY) hide_objects(0); - else hide_objects(1); - } - break; - case IKEY: - if(G.obedit) { - if(G.qual==LR_CTRLKEY) - selectswap_mesh(); - } else if(G.qual==LR_CTRLKEY) { - if(ob && ob->type==OB_ARMATURE) - if(ob->flag & OB_POSEMODE) - pose_add_IK(); - } - else if(G.qual==LR_ALTKEY) { - if(ob && ob->type==OB_ARMATURE) - if(ob->flag & OB_POSEMODE) - pose_clear_IK(); - } - break; - - case JKEY: - if(G.qual==LR_CTRLKEY) { - if( ob ) { - join_menu(); - } - else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF)) { - addsegment_nurb(); - } else { - error("Can't join unless there is an active object"); - } - - } - else if(G.obedit) { - if(G.obedit->type==OB_MESH) { - join_triangles(); - } - } - - break; - case KKEY: - if(G.obedit) { - if (G.obedit->type==OB_MESH) { - if (G.qual==LR_SHIFTKEY) - KnifeSubdivide(KNIFE_PROMPT); - else if (G.qual==0) - LoopMenu(); - } - else if(G.obedit->type==OB_SURF) - printknots(); - } - else { - if((G.qual==LR_SHIFTKEY)) { - if(FACESEL_PAINT_TEST) - if (G.f & G_WEIGHTPAINT) - clear_wpaint_selectedfaces(); - else - clear_vpaint_selectedfaces(); - else if(G.f & G_VERTEXPAINT) - clear_vpaint(); - else - select_select_keys(); - } - else if (G.qual==0) - set_ob_ipoflags(); - } - - break; - case LKEY: - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - if (G.qual & LR_CTRLKEY) { - if ((G.scene->selectmode & SCE_SELECT_FACE) == 0) { - selectconnected_mesh_all(); /* normal select linked */ - } else { - selectconnected_delimit_mesh_all(); /* select linked with edge crease delimiting */ - } - } else { - if ((G.scene->selectmode & SCE_SELECT_FACE) == 0) { - selectconnected_mesh(); - } else { - selectconnected_delimit_mesh(); - } - } - } - if(G.obedit->type==OB_ARMATURE) - selectconnected_armature(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) - selectconnected_nurb(); - } - else if(ob && (ob->flag & OB_POSEMODE)) { - selectconnected_posearmature(); - } - else { - if(FACESEL_PAINT_TEST) { - if((G.qual==0)) - select_linked_tfaces(0); - else if((G.qual==LR_SHIFTKEY)) - select_linked_tfaces(1); - else if(G.qual==LR_CTRLKEY) - select_linked_tfaces(2); - } - else if(G.f & G_PARTICLEEDIT) { - PE_select_linked(); - } - else { - if((G.qual==0)) - make_local_menu(); - else if((G.qual==LR_SHIFTKEY)) - selectlinks_menu(); - else if(G.qual==LR_CTRLKEY) - make_links_menu(); - } - } - break; - case MKEY: - if(G.obedit){ - if (ELEM(G.qual, 0, LR_SHIFTKEY) && (G.obedit->type==OB_ARMATURE)) { - pose_movetolayer(); - } - else if (G.qual==LR_ALTKEY) { - if (G.obedit->type == OB_MESH) { - mergemenu(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - else if (G.obedit->type == OB_ARMATURE) { - merge_armature(); - } - } - else if ((G.qual==0) || (G.qual==LR_CTRLKEY)) { - mirrormenu(); - } - else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - if(G.obedit->type==OB_MESH) select_non_manifold(); - } - } - else if(G.qual & LR_CTRLKEY) { - mirrormenu(); - } - else if(G.qual==0 || G.qual==LR_SHIFTKEY) { - if(ob && (ob->flag & OB_POSEMODE)) - pose_movetolayer(); - else - movetolayer(); - } - break; - case NKEY: - if((G.qual==0)) { - toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE); - allqueue(REDRAWVIEW3D, 0); - } - else if(G.obedit) { - switch (G.obedit->type){ - case OB_ARMATURE: - if(G.qual==LR_CTRLKEY) { - pupval= pupmenu("Recalculate Bone Roll Angles%t|Clear Roll (Z-Axis Up) %x1|Align Z-Axis to 3D-Cursor %x2"); - if (pupval > 0) { - auto_align_armature(pupval - 1); - allqueue(REDRAWVIEW3D, 0); - } - } - break; - case OB_MESH: - if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) { - if(okee("Recalculate normals inside")) { - righthandfaces(2); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Recalculate normals inside"); - } - } - else if(G.qual==LR_CTRLKEY){ - if(okee("Recalculate normals outside")) { - righthandfaces(1); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Recalculate normals outside"); - } - } - break; - } - } - - break; - case OKEY: - if (G.obedit || G.f&G_PARTICLEEDIT) { - if (G.qual==LR_SHIFTKEY) { - G.scene->prop_mode = (G.scene->prop_mode+1)%7; - allqueue(REDRAWHEADERS, 0); - } - else if((G.qual==LR_ALTKEY)) { - if(G.scene->proportional==2) G.scene->proportional= 1; - else G.scene->proportional= 2; - allqueue(REDRAWHEADERS, 0); - } - else if((G.qual==0)) { - G.scene->proportional= !G.scene->proportional; - allqueue(REDRAWHEADERS, 0); - } - } - else if((G.qual==LR_SHIFTKEY || G.qual==(LR_ALTKEY|LR_SHIFTKEY))) { - flip_subdivison(-1); - } - else if(G.qual==LR_ALTKEY) { - if(okee("Clear origin")) { - clear_object('o'); - } - } - break; - - case PKEY: - if(G.obedit) { - if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) { - if(G.obedit->type==OB_ARMATURE) - make_bone_parent(); - else - make_parent(); - } - - else if(G.qual==LR_ALTKEY && G.obedit->type==OB_ARMATURE) - clear_bone_parent(); - else if((G.qual==0) && (G.obedit->type==OB_ARMATURE)) - select_bone_parent(); - else if((G.qual==0) && G.obedit->type==OB_MESH) - separatemenu(); - else if ((G.qual==0) && ELEM(G.obedit->type, OB_CURVE, OB_SURF)) - separate_nurb(); - else if (G.qual==LR_SHIFTKEY) { - initTransform(TFM_PUSHPULL, CTX_NONE); - Transform(); - } - } - else if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) - make_parent(); - else if(G.qual==LR_SHIFTKEY) { - toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0); - doredraw= 1; - } - else if(G.qual==(LR_ALTKEY|LR_SHIFTKEY)) { - initTransform(TFM_PUSHPULL, CTX_NONE); - Transform(); - } - else if(G.qual==LR_ALTKEY) - clear_parent(); - else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) - make_proxy(); - else if(G.qual==(LR_ALTKEY|LR_CTRLKEY|LR_SHIFTKEY)) { - start_RBSimulation(); - } - else if((G.qual==0) && (OBACT) && (OBACT->type==OB_ARMATURE) && (OBACT->flag & OB_POSEMODE)) - select_bone_parent(); - else if((G.qual==0)) { - start_game(); - } - break; - case RKEY: - if((G.obedit==0) && G.qual==LR_ALTKEY) { - if(okee("Clear rotation")) { - clear_object('r'); - } - } - else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) { - v3d->twtype= V3D_MANIP_ROTATE; - doredraw= 1; - } - else if (G.obedit) { - if((G.qual==LR_SHIFTKEY)) { - if ELEM(G.obedit->type, OB_CURVE, OB_SURF) - selectrow_nurb(); - } - else if(G.qual==LR_CTRLKEY) { - if (G.obedit->type==OB_MESH) { - CutEdgeloop(1); - BIF_undo_push("Cut Edgeloop"); - } - else if (G.obedit->type==OB_ARMATURE) { - initTransform(TFM_BONE_ROLL, CTX_NONE); - Transform(); - } - } - else if((G.qual==0)) { - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - } - } - else if((G.qual==0)) { - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - } - break; - case SKEY: - if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) { - v3d->twtype= V3D_MANIP_SCALE; - doredraw= 1; - } - else if(G.obedit) { - - if(G.qual==LR_ALTKEY) { - if(G.obedit->type==OB_ARMATURE) { - initTransform(TFM_BONESIZE, CTX_NONE); - } - else if (G.obedit->type==OB_CURVE) { - initTransform(TFM_CURVE_SHRINKFATTEN, CTX_NONE); - } else { - initTransform(TFM_SHRINKFATTEN, CTX_NONE); - } - Transform(); - } - else if(G.qual==LR_CTRLKEY) { - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - } - else if(G.qual==LR_SHIFTKEY) - snapmenu(); - else if(G.qual==0) { - if(G.obedit->type==OB_ARMATURE) { - bArmature *arm= G.obedit->data; - if(arm->drawtype==ARM_ENVELOPE) - initTransform(TFM_BONE_ENVELOPE, CTX_NONE); - else - initTransform(TFM_RESIZE, CTX_NONE); - } - else - initTransform(TFM_RESIZE, CTX_NONE); - Transform(); - } - else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)){ - initTransform(TFM_TOSPHERE, CTX_NONE); - Transform(); - } - if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) { - if(G.obedit->type==OB_MESH) select_sharp_edges(); - } - } - else if(G.qual==LR_ALTKEY) { - if(G.f & G_WEIGHTPAINT) - ob= ob->parent; - if(ob && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; - if( arm->drawtype==ARM_ENVELOPE) { - initTransform(TFM_BONESIZE, CTX_NONE); - Transform(); - break; - } - } - - if(okee("Clear scale")) { - clear_object('s'); - } - } - else if(G.qual==LR_SHIFTKEY) { - snapmenu(); - } - else if((G.qual==0)) { - initTransform(TFM_RESIZE, CTX_NONE); - Transform(); - } - else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) { - initTransform(TFM_TOSPHERE, CTX_NONE); - Transform(); - } - else if(G.qual==(LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY)) { - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - } - break; - case TKEY: - if(G.qual == LR_SHIFTKEY) { /* toggle texture in solid draw mode */ - G.vd->flag2 ^= V3D_SOLID_TEX; - allqueue(REDRAWVIEW3D, 0); - } else if(G.obedit){ - if((G.qual & LR_CTRLKEY) && G.obedit->type==OB_MESH) { - convert_to_triface(G.qual & LR_SHIFTKEY); - allqueue(REDRAWVIEW3D, 0); - if (EM_texFaceCheck()) - allqueue(REDRAWIMAGE, 0); - - countall(); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - } - if (G.obedit->type==OB_CURVE) { - if (G.qual==LR_ALTKEY) { - clear_tilt(); - } - else if (G.qual==0) { - initTransform(TFM_TILT, CTX_NONE); - Transform(); - } - } - } - else if(G.f & G_PARTICLEEDIT) { - initTransform(TFM_BAKE_TIME, CTX_NONE); - Transform(); - } - else if(G.qual==LR_CTRLKEY) { - if(ob && (ob->flag & OB_POSEMODE)); - else make_track(); - } - else if(G.qual==LR_ALTKEY) { - if(ob && (ob->flag & OB_POSEMODE)); - else clear_track(); - } - else if((G.qual==0)){ - texspace_edit(); - } - - break; - case UKEY: - /*// Use Ctrl Z like everybody else - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - if(G.qual==0) BIF_undo(); else BIF_redo(); - } - else if ELEM5(G.obedit->type, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) { - if(G.qual==0) BIF_undo(); else BIF_redo(); - } - }*/ - if(G.obedit) { - if(G.obedit->type==OB_MESH && G.qual==0) { - uv_autocalc_tface(); - } - } - else if (G.f & G_PARTICLEEDIT){ - if(G.qual==0) BIF_undo(); else BIF_redo(); - } - else if((G.qual==0)) { - if(G.f & G_WEIGHTPAINT) - BIF_undo(); - else if(G.f & G_VERTEXPAINT) - BIF_undo(); - else if(G.f & G_TEXTUREPAINT) - imagepaint_undo(); - else { - single_user(); - } - } - - break; - case VKEY: - if ((G.qual==LR_CTRLKEY)) { - if ((G.obedit) && G.obedit->type==OB_MESH) { - Vertex_Menu(); - } - } else if((G.qual==LR_SHIFTKEY)) { - if ((G.obedit) && G.obedit->type==OB_MESH) { - align_view_to_selected(v3d); - } - else if (FACESEL_PAINT_TEST) { - align_view_to_selected(v3d); - } - } - else if(G.qual==LR_ALTKEY) - image_aspect(); - else if (G.qual==0){ - if(G.obedit) { - if(G.obedit->type==OB_MESH) { - mesh_rip(); - } - else if(G.obedit->type==OB_CURVE) { - sethandlesNurb(2); - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - BIF_undo_push("Handle change"); - } - } - else if(ob && ob->type == OB_MESH) - set_vpaint(); - } - break; - case WKEY: - if((G.qual==LR_SHIFTKEY)) { - initTransform(TFM_WARP, CTX_NONE); - Transform(); - } - /*else if(G.qual==LR_ALTKEY) {}*/ - else if(G.qual==LR_CTRLKEY) { - if(G.obedit) { - if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - switchdirectionNurb2(); - } - } - } - else if((G.qual==0)) - special_editmenu(); - - break; - case XKEY: - case DELKEY: - if(G.qual==0 || G.qual==LR_SHIFTKEY) - delete_context_selected(); - break; - case YKEY: - if((G.qual==0) && (G.obedit)) { - if(G.obedit->type==OB_MESH) split_mesh(); - } - break; - case ZKEY: - toggle_shading(); - - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - - case HOMEKEY: - if(G.qual==0) - view3d_home(0); - break; - case COMMAKEY: - if(G.qual==LR_CTRLKEY) { - G.vd->around= V3D_CENTROID; - } else if(G.qual==LR_SHIFTKEY) { - G.vd->around= V3D_CENTROID; - } else if(G.qual==0) { - G.vd->around= V3D_CENTER; - } - handle_view3d_around(); - - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - - case PERIODKEY: - if(G.qual==LR_CTRLKEY) { - G.vd->around= V3D_LOCAL; - } else if(G.qual==LR_ALTKEY) { - G.vd->around= V3D_ACTIVE; - } else if(G.qual==0) { - G.vd->around= V3D_CURSOR; - } - handle_view3d_around(); - - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - - case PADSLASHKEY: - if(G.qual==0) { - if(G.vd->localview) { - G.vd->localview= 0; - endlocalview(curarea); - } - else { - G.vd->localview= 1; - initlocalview(); - } - scrarea_queue_headredraw(curarea); - } - break; - case PADASTERKEY: /* '*' */ - if(G.qual==0) { - if(ob) { - if ((G.obedit) && (G.obedit->type == OB_MESH)) { - editmesh_align_view_to_selected(G.vd, 3); - } - else if (FACESEL_PAINT_TEST) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - faceselect_align_view_to_selected(G.vd, me, 3); - } - } - else - obmat_to_viewmat(ob, 1); - - if(G.vd->persp==2) G.vd->persp= 1; - scrarea_queue_winredraw(curarea); - } - } - break; - case PADPERIOD: /* '.' */ - if(G.qual==0) - centerview(); - break; - - case PAGEUPKEY: - if(G.qual==LR_CTRLKEY) - movekey_obipo(1); - else if((G.qual==0)) - nextkey_obipo(1); /* in editipo.c */ - break; - - case PAGEDOWNKEY: - if(G.qual==LR_CTRLKEY) - movekey_obipo(-1); - else if((G.qual==0)) - nextkey_obipo(-1); - break; - - case PAD0: case PAD1: case PAD2: case PAD3: case PAD4: - case PAD5: case PAD6: case PAD7: case PAD8: case PAD9: - case PADENTER: - persptoetsen(event); - doredraw= 1; - break; - case PADMINUS: - if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_MESH) ) - select_less(); - else if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_CURVE) ) - select_less_nurb(); - else if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_SURF) ) - select_less_nurb(); - else if ( (G.qual==LR_CTRLKEY) - && (G.f & G_PARTICLEEDIT) ) - PE_select_less(); - else { - persptoetsen(event); - doredraw= 1; - } - break; - - case PADPLUSKEY: - if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_MESH) ) - select_more(); - else if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_CURVE) ) - select_more_nurb(); - else if ( (G.qual==LR_CTRLKEY) - && (G.obedit) && (G.obedit->type==OB_SURF) ) - select_more_nurb(); - else if ( (G.qual==LR_CTRLKEY) - && (G.f & G_PARTICLEEDIT) ) - PE_select_more(); - else { - persptoetsen(event); - doredraw= 1; - } - break; - - case ESCKEY: - if(G.qual==0) { - if (G.vd->flag & V3D_DISPIMAGE) { - G.vd->flag &= ~V3D_DISPIMAGE; - doredraw= 1; - } - } - break; - } - } - } - - if(doredraw) { - scrarea_queue_winredraw(curarea); - scrarea_queue_headredraw(curarea); - } -} - -static void initview3d(ScrArea *sa) -{ - View3D *vd; - - vd= MEM_callocN(sizeof(View3D), "initview3d"); - BLI_addhead(&sa->spacedata, vd); /* addhead! not addtail */ - - vd->spacetype= SPACE_VIEW3D; - vd->blockscale= 0.7f; - vd->viewquat[0]= 1.0f; - vd->viewquat[1]= vd->viewquat[2]= vd->viewquat[3]= 0.0f; - vd->persp= 1; - vd->drawtype= OB_WIRE; - vd->view= 7; - vd->dist= 10.0; - vd->lens= 35.0f; - vd->near= 0.01f; - vd->far= 500.0f; - vd->grid= 1.0f; - vd->gridlines= 16; - vd->gridsubdiv = 10; - - vd->lay= vd->layact= 1; - if(G.scene) { - vd->lay= vd->layact= G.scene->lay; - vd->camera= G.scene->camera; - } - vd->scenelock= 1; - vd->gridflag |= V3D_SHOW_X; - vd->gridflag |= V3D_SHOW_Y; - vd->gridflag |= V3D_SHOW_FLOOR; - vd->gridflag &= ~V3D_SHOW_Z; - - vd->depths= NULL; -} - - -/* ******************** SPACE: IPO ********************** */ - -static void changeview2dspace(ScrArea *sa, void *spacedata) -{ - if(G.v2d==0) return; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); -} - -static int get_cfra_from_dx(SpaceIpo * sipo, int dx) -{ - if (sipo->blocktype == ID_SEQ) { - Sequence * seq = (Sequence*) sipo->from; - if (!seq) { - return dx; - } - if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { - return dx; - } else { - float m= (seq->enddisp - seq->startdisp)/100.0f; - float cfra = dx * m + seq->startdisp; - - return (int) cfra; - } - } else { - return dx; - } -} - -static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - extern void do_ipobuts(unsigned short event); /* drawipo.c */ - unsigned short event= evt->event; - short val= evt->val; - SpaceIpo *sipo= curarea->spacedata.first; - View2D *v2d= &sipo->v2d; - float dx, dy; - int cfra, doredraw= 0; - short mval[2]; - short mousebut = L_MOUSE; - - if(sa->win==0) return; - - if(val) { - if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - switch(event) { - case UI_BUT_EVENT: - /* note: bad bad code, will be cleaned! is because event queues are all shattered */ - if(val>0 && val < 256) do_ipowin_buts(val-1); - else do_ipobuts(val); - break; - - case LEFTMOUSE: - if( in_ipo_buttons() ) { - do_ipo_selectbuttons(); - doredraw= 1; - } - else if(view2dmove(LEFTMOUSE)); /* only checks for sliders */ - else if((G.qual & LR_CTRLKEY) && (sipo->showkey==0)) add_vert_ipo(); - else { - do { - getmouseco_areawin(mval); - areamouseco_to_ipoco(v2d, mval, &dx, &dy); - - cfra = get_cfra_from_dx(sipo, (int)dx); - if(cfra< 1) cfra= 1; - - if( cfra!=CFRA ) { - CFRA= cfra; - update_for_newframe_nodraw(0); /* 1 = nosound */ - force_draw_all(0); /* To make constraint sliders redraw */ - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - } - break; - case RIGHTMOUSE: - mouse_select_ipo(); - allqueue(REDRAWMARKER, 0); - break; - case MIDDLEMOUSE: - if(in_ipo_buttons()) { - scroll_ipobuts(); - } - else view2dmove(event); /* in drawipo.c */ - break; - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - case PADPLUSKEY: - view2d_zoom(v2d, 0.1154f, sa->winx, sa->winy); - doredraw= 1; - break; - case PADMINUS: - view2d_zoom(v2d, -0.15f, sa->winx, sa->winy); - doredraw= 1; - break; - case PAGEUPKEY: - if(G.qual & LR_CTRLKEY) - movekey_ipo(1); - else if(G.qual & LR_SHIFTKEY) - nextkey_ipo(1); - else - nextprev_marker(1); - break; - case PAGEDOWNKEY: - if(G.qual & LR_CTRLKEY) - movekey_ipo(-1); - else if(G.qual & LR_SHIFTKEY) - nextkey_ipo(-1); - else - nextprev_marker(-1); - break; - case HOMEKEY: - if((G.qual==0)) - do_ipo_buttons(B_IPOHOME); - break; - case PADPERIOD: - if((G.qual==0)) - do_ipo_buttons(B_IPOVIEWCENTER); - break; - - case AKEY: - if (G.qual & LR_CTRLKEY) { - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - } - else if (G.qual==0) { - if(in_ipo_buttons()) { - swap_visible_editipo(); - } - else { - swap_selectall_editipo(); - } - allspace (REMAKEIPO, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWACTION, 0); - } - - break; - case BKEY: - if (G.qual==0) - borderselect_ipo(); - else if (G.qual==LR_CTRLKEY) { - borderselect_markers(); - } - break; - case CKEY: - if (G.qual == LR_SHIFTKEY) - center_currframe(); - else - move_to_frame(); - break; - case DKEY: - if (G.qual==LR_SHIFTKEY) { - add_duplicate_editipo(); - } else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) { - duplicate_marker(); - allqueue(REDRAWMARKER, 0); - } - break; - case GKEY: - if (G.qual & LR_CTRLKEY) { - transform_markers('g', 0); - allqueue(REDRAWMARKER, 0); - } else if (G.qual==0) - transform_ipo('g'); - break; - case HKEY: - if (G.qual==LR_ALTKEY) - sethandles_ipo(HD_AUTO_ANIM); - if (G.qual==LR_SHIFTKEY) - sethandles_ipo(HD_AUTO); - else if (G.qual==0) - sethandles_ipo(HD_ALIGN); - break; - case JKEY: - if (G.qual==LR_CTRLKEY) - join_ipo_menu(); - break; - case KKEY: - if (G.qual==0) { - ipo_toggle_showkey(); - scrarea_queue_headredraw(curarea); - allqueue(REDRAWVIEW3D, 0); - doredraw= 1; - } - break; - case MKEY: - if (G.qual==0) { - add_marker(CFRA); - } else if (G.qual==LR_SHIFTKEY) { - ipo_mirror_menu(); - break; - } else if (G.qual == LR_CTRLKEY) { - rename_marker(); - } else { - break; - } - allqueue(REDRAWMARKER, 0); - break; - case NKEY: - toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - doredraw= 1; - break; - case OKEY: - if (G.qual==LR_SHIFTKEY) - smooth_ipo(); - else - clean_ipo(); - break; - case PKEY: - if (G.qual & LR_CTRLKEY) /* set preview range */ - anim_previewrange_set(); - else if (G.qual & LR_ALTKEY) /* clear preview range */ - anim_previewrange_clear(); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWBUTSALL, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - break; - case RKEY: - if (G.qual==LR_CTRLKEY) - ipo_record(); - else - transform_ipo('r'); - break; - case SKEY: - if (G.qual==LR_SHIFTKEY) { - ipo_snap_menu(); - } - else if (G.qual==0) - transform_ipo('s'); - break; - case TKEY: - if (G.qual==0) - set_ipotype(); - break; - case VKEY: - if (G.qual==0) - sethandles_ipo(HD_VECT); - break; - case XKEY: - case DELKEY: - if (okee("Erase selected")) { - remove_marker(); - del_ipo(0); - - /* note: don't update the other spaces (in particular ipo) - * or else curves disappear. - */ - allqueue(REDRAWTIME, 0); - allqueue(REDRAWSOUND, 0); - } - break; - case ACCENTGRAVEKEY: - if((G.qual==0)) { - do_ipo_buttons(B_IPOVIEWALL); - allqueue(REDRAWIPO, 0); - } - break; - - } - } - - if(doredraw) scrarea_queue_winredraw(sa); -} - -void initipo(ScrArea *sa) -{ - SpaceIpo *sipo; - - sipo= MEM_callocN(sizeof(SpaceIpo), "initipo"); - BLI_addhead(&sa->spacedata, sipo); - - sipo->spacetype= SPACE_IPO; - sipo->blockscale= 0.7f; - - /* sipo space loopt van (0,-?) tot (??,?) */ - sipo->v2d.tot.xmin= 0.0; - sipo->v2d.tot.ymin= -10.0; - sipo->v2d.tot.xmax= G.scene->r.efra; - sipo->v2d.tot.ymax= 10.0; - - sipo->v2d.cur= sipo->v2d.tot; - - sipo->v2d.min[0]= 0.01f; - sipo->v2d.min[1]= 0.01f; - - sipo->v2d.max[0]= 15000.0f; - sipo->v2d.max[1]= 10000.0f; - - sipo->v2d.scroll= L_SCROLL+B_SCROLL; - sipo->v2d.keeptot= 0; - - sipo->blocktype= ID_OB; -} - -/* ******************** SPACE: INFO ********************** */ - -void space_mipmap_button_function(int event) { - set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP)); - - allqueue(REDRAWVIEW3D, 0); -} - -#if 0 -static void space_sound_button_function(int event) -{ - int a; - SYS_SystemHandle syshandle; - - if ((syshandle = SYS_GetSystem())) - { - a = (U.gameflags & USER_DISABLE_SOUND); - SYS_WriteCommandLineInt(syshandle, "noaudio", a); - } -} -#endif - - -static char *iconfile_menu(void) -{ - static char string[512]; - char *str = string; - IconFile *ifile; - ListBase *iconfilelist = BIF_iconfile_list(); - - str += sprintf(str, "Built-in %%x0|%%l|"); - - for(ifile=iconfilelist->first; ifile; ifile=ifile->next) { - str += sprintf(str, "%s %%x%d|", ifile->filename, ifile->index); - } - - return string; -} - -static void set_userdef_iconfile_cb(void *menuindex, void *unused2) -{ - bTheme *btheme= U.themes.first; - IconFile *ifile; - ListBase *iconfilelist = BIF_iconfile_list(); - int index = *((int *)menuindex); - - if (index==0) { - BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile)); - return; - } - - for(ifile=iconfilelist->first; ifile; ifile=ifile->next) { - if (index == ifile->index) { - BLI_strncpy(btheme->tui.iconfile, ifile->filename, sizeof(btheme->tui.iconfile)); - } - } -} - -/* needed for event; choose new 'curmain' resets it... */ -static short th_curcol= TH_BACK; -static char *th_curcol_ptr= NULL; -static char th_curcol_arr[4]={0, 0, 0, 255}; - -static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3) -{ - bTheme *btheme, *bt; - int spacetype= 0; - static short cur=1, curmain=2; - short a, tot=0, isbuiltin= 0; - char string[21*32], *strp, *col; - /* for choosing an icon image based on index in the cached list */ - static int iconfileindex=0; - - y3= y2+23; /* exception! */ - - /* count total, max 16! */ - for(bt= U.themes.first; bt; bt= bt->next) tot++; - - /* if cur not is 1; move that to front of list */ - if(cur!=1) { - a= 1; - for(bt= U.themes.first; bt; bt= bt->next, a++) { - if(a==cur) { - BLI_remlink(&U.themes, bt); - BLI_addhead(&U.themes, bt); - allqueue(REDRAWALL, 0); - cur= 1; - break; - } - } - } - - /* the current theme */ - btheme= U.themes.first; - if(strcmp(btheme->name, "Default")==0) isbuiltin= 1; - - /* construct popup script */ - string[0]= 0; - for(bt= U.themes.first; bt; bt= bt->next) { - strcat(string, bt->name); - if(btheme->next) strcat(string, " |"); - } - uiDefButS(block, MENU, B_UPDATE_THEME_ICONS, string, 45,y3,200,20, &cur, 0, 0, 0, 0, "Current theme"); - - - /* add / delete / name */ - - if(tot<16) - uiDefBut(block, BUT, B_ADD_THEME, "Add", 45,y2,200,20, NULL, 0, 0, 0, 0, "Makes new copy of this theme"); - if(tot>1 && isbuiltin==0) - uiDefBut(block, BUT, B_DEL_THEME, "Delete", 45,y1,200,20, NULL, 0, 0, 0, 0, "Delete theme"); - - if(isbuiltin) return; - - /* name */ - uiDefBut(block, TEX, B_NAME_THEME, "", 255,y3,200,20, btheme->name, 1.0, 30.0, 0, 0, "Rename theme"); - - /* main choices pup: note, it uses collums, and the seperators (%l) then have to fill both halves equally for the menu to work */ - uiDefButS(block, MENU, B_CHANGE_THEME, "UI and Buttons %x1|%l|3D View %x2|%l|Ipo Curve Editor %x3|Action Editor %x4|" - "NLA Editor %x5|%l|UV/Image Editor %x6|Video Sequence Editor %x7|Node Editor %x16|Timeline %x15|%l|Audio Window %x8|Text Editor %x9|%l|User Preferences %x10|" - "Outliner %x11|Buttons Window %x12|%l|File Browser %x13|Image Browser %x14", - 255,y2,200,20, &curmain, 0, 0, 0, 0, "Specify theme for..."); - if(curmain==1) spacetype= 0; - else if(curmain==2) spacetype= SPACE_VIEW3D; - else if(curmain==3) spacetype= SPACE_IPO; - else if(curmain==4) spacetype= SPACE_ACTION; - else if(curmain==5) spacetype= SPACE_NLA; - else if(curmain==6) spacetype= SPACE_IMAGE; - else if(curmain==7) spacetype= SPACE_SEQ; - else if(curmain==8) spacetype= SPACE_SOUND; - else if(curmain==9) spacetype= SPACE_TEXT; - else if(curmain==10) spacetype= SPACE_INFO; - else if(curmain==11) spacetype= SPACE_OOPS; - else if(curmain==12) spacetype= SPACE_BUTS; - else if(curmain==13) spacetype= SPACE_FILE; - else if(curmain==14) spacetype= SPACE_IMASEL; - else if(curmain==15) spacetype= SPACE_TIME; - else if(curmain==16) spacetype= SPACE_NODE; - else return; /* only needed while coding... when adding themes for more windows */ - - /* color choices pup */ - if(curmain==1) { - strp= BIF_ThemeColorsPup(0); - if(th_curcol==TH_BACK) th_curcol= TH_BUT_OUTLINE; /* switching main choices... */ - } - else strp= BIF_ThemeColorsPup(spacetype); - - uiDefButS(block, MENU, B_REDR, strp, 255,y1,200,20, &th_curcol, 0, 0, 0, 0, "Current color"); - MEM_freeN(strp); - - th_curcol_ptr= col= BIF_ThemeGetColorPtr(btheme, spacetype, th_curcol); - if(col==NULL) return; - - /* first handle exceptions, special single values, row selection, etc */ - if(th_curcol==TH_VERTEX_SIZE) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, ""); - } - else if(th_curcol==TH_FACEDOT_SIZE) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Face dot size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, ""); - } - else if(th_curcol==TH_BUT_DRAWTYPE) { - uiBlockBeginAlign(block); - uiDefButC(block, ROW, B_UPDATE_THEME, "Shaded", 465,y2,80,20, col, 2.0, (float) TH_SHADED, 0, 0, ""); - uiDefButC(block, ROW, B_UPDATE_THEME, "Rounded", 545,y2,80,20, col, 2.0, (float) TH_ROUNDED, 0, 0, ""); - uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 625,y2,80,20, col, 2.0, (float) TH_MINIMAL, 0, 0, ""); - uiDefButC(block, ROW, B_UPDATE_THEME, "OldSkool", 705,y2,80,20, col, 2.0, (float) TH_OLDSKOOL, 0, 0, ""); - uiBlockEndAlign(block); - } - else if(th_curcol==TH_ICONFILE) { - uiBut *but; - - /* set the icon file menu to the correct icon file index for what's stored in the theme values */ - iconfileindex= BIF_iconfile_get_index(btheme->tui.iconfile); - - but = uiDefButI(block, MENU, B_UPDATE_THEME_ICONS, iconfile_menu(), - 465,y2,200,20, &iconfileindex, 0, 0, 0, 0, "The icon PNG file to use, searching in .blender/icons"); - uiButSetFunc(but, set_userdef_iconfile_cb, &iconfileindex, NULL); - - } - else { - uiBlockBeginAlign(block); - if ELEM9(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_EDITMESH_ACTIVE, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM, TH_NODE) { - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, ""); - } - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"R ", 465,y3,200,20, col, 0.0, 255.0, B_THEMECOL, 0, ""); - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"G ", 465,y2,200,20, col+1, 0.0, 255.0, B_THEMECOL, 0, ""); - uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, ""); - uiBlockEndAlign(block); - - uiDefButC(block, COL, B_UPDATE_THEME, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, ""); - - /* copy paste */ - uiBlockBeginAlign(block); - uiDefBut(block, BUT, B_THEME_COPY, "Copy Color", 755,y2,120,20, NULL, 0, 0, 0, 0, "Stores current color in buffer"); - uiDefBut(block, BUT, B_THEME_PASTE, "Paste Color", 755,y1,120,20, NULL, 0, 0, 0, 0, "Pastes buffer color"); - uiBlockEndAlign(block); - - uiDefButC(block, COL, 0, "", 885,y1,50,y2-y1+20, th_curcol_arr, 0, 0, 0, 0, ""); - - } -} - - -void drawinfospace(ScrArea *sa, void *spacedata) -{ - uiBlock *block; - static short cur_light=0; - float fac, col[3]; - short xpos, ypos, ypostab, buth, rspace, dx, y1, y2, y3, y4, y5, y6, y7; - short y2label, y3label, y4label, y5label, y6label, y7label; - short spref, mpref, lpref, smfileselbut; - short edgsp, midsp; - char naam[32]; - - if(curarea->win==0 || curarea->winy<2) return; - - BIF_GetThemeColor3fv(TH_BACK, col); - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* smaller buttons make no sense */ - if(curarea->winx<320) return; - - if(curarea->winx<=1280.0) { - fac= ((float)curarea->winx)/1280.0f; - myortho2(0.375f, 1280.375f, 0.375f, curarea->winy/fac + 0.375f); - } - else { - myortho2(0.375f, (float)curarea->winx + 0.375f, 0.375f, (float)curarea->winy + 0.375f); - } - - sprintf(naam, "infowin %d", curarea->win); - block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->win); - - - /* Vars for nice grid alignment */ - dx= (1280-90)/7; /* spacing for use in equally dividing 'tab' row */ - - xpos = 45; /* left padding */ - ypos = 50; /* bottom padding for buttons */ - ypostab = 10; /* bottom padding for 'tab' row */ - - buth = 20; /* standard button height */ - - spref = 90; /* standard size for small preferences button */ - mpref = 189; /* standard size for medium preferences button */ - lpref = 288; /* standard size for large preferences button */ - smfileselbut = buth; /* standard size for fileselect button (square) */ - - edgsp = 3; /* space from edge of end 'tab' to edge of end button */ - midsp = 9; /* horizontal space between buttons */ - - rspace = 3; /* default space between rows */ - - y1 = ypos; /* grid alignment for each row of buttons */ - y2 = ypos+buth+rspace; - y3 = ypos+2*(buth+rspace); - y4 = ypos+3*(buth+rspace); - y5 = ypos+4*(buth+rspace); - y6 = ypos+5*(buth+rspace); - y7 = ypos+6*(buth+rspace); - - - y2label = y2-2; /* adjustments to offset the labels down to align better */ - y3label = y3-2; - y4label = y4-2; - y5label = y5-2; - y6label = y6-2; - y7label = y7-2; - - - /* set the color to blue and draw the main 'tab' controls */ - - uiBlockSetCol(block, TH_BUT_SETTING1); - uiBlockBeginAlign(block); - - uiDefButS(block, ROW,B_USERPREF,"View & Controls", - xpos,ypostab,(short)dx,buth, - &U.userpref,1.0,0.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"Edit Methods", - (short)(xpos+dx),ypostab,(short)dx,buth, - &U.userpref,1.0,1.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"Language & Font", - (short)(xpos+2*dx),ypostab,(short)dx,buth, - &U.userpref,1.0,2.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"Themes", - (short)(xpos+3*dx),ypostab,(short)dx,buth, - &U.userpref,1.0,6.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"Auto Save", - (short)(xpos+4*dx),ypostab,(short)dx,buth, - &U.userpref,1.0,3.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"System & OpenGL", - (short)(xpos+5*dx),ypostab,(short)dx,buth, - &U.userpref,1.0,4.0, 0, 0,""); - - uiDefButS(block, ROW,B_USERPREF,"File Paths", - (short)(xpos+6*dx),ypostab,(short)dx,buth, - &U.userpref,1.0,5.0, 0, 0,""); - - uiBlockSetCol(block, TH_AUTO); - uiBlockEndAlign(block); - /* end 'tab' controls */ - - /* line 2: left x co-ord, top y co-ord, width, height */ - - if(U.userpref == 6) { - info_user_themebuts(block, y1, y2, y3); - } - else if (U.userpref == 0) { /* view & controls */ - - uiDefBut(block, LABEL,0,"Display:", - xpos,y6label,spref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_TOOLTIPS, 0, "Tool Tips", - (xpos+edgsp),y5,spref,buth, - &(U.flag), 0, 0, 0, 0, - "Display tooltips (help tags) over buttons"); - uiDefButBitI(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info", - (xpos+edgsp),y4,spref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Display active object name and frame number in the 3D View"); - uiDefButBitI(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene", - (xpos+edgsp),y3,spref,buth, - &(U.flag), 0, 0, 0, 0, - "Forces the current Scene to be displayed in all Screens"); -#ifndef __APPLE__ - uiDefButBitS(block, TOG, 1, 0, "Large Cursors", - (xpos+edgsp),y2,spref,buth, - &(U.curssize), 0, 0, 0, 0, - "Use large mouse cursors when available"); -#else - U.curssize=0; /*Small Cursor always for OS X for now */ -#endif - uiDefButBitI(block, TOG, USER_SHOW_VIEWPORTNAME, B_DRAWINFO, "View Name", - (xpos+edgsp),y1,spref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Show the name of the view's direction in each 3D View"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Menus:", - (xpos+(2*edgsp)+spref),y6label,spref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_MENUOPENAUTO, 0, "Open on Mouse Over", - (xpos+edgsp+spref+midsp),y5,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Open menu buttons and pulldowns automatically when the mouse is hovering"); - uiDefButS(block, NUM, 0, "Top Level:", - (xpos+edgsp+spref+midsp),y4,spref+edgsp,buth, - &(U.menuthreshold1), 1, 40, 0, 0, - "Time delay in 1/10 seconds before automatically opening top level menus"); - uiDefButS(block, NUM, 0, "Sublevels:", - (xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y4,spref+edgsp,buth, - &(U.menuthreshold2), 1, 40, 0, 0, - "Time delay in 1/10 seconds before automatically opening menu sublevels"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Toolbox click-hold delay:", - (xpos+(2*edgsp)+spref),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, 0, "LMB:", - (xpos+edgsp+spref+midsp),y2,spref+edgsp,buth, - &(U.tb_leftmouse), 2, 40, 0, 0, - "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox"); - uiDefButS(block, NUM, 0, "RMB:", - (xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y2,spref+edgsp,buth, - &(U.tb_rightmouse), 2, 40, 0, 0, - "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox"); - uiBlockEndAlign(block); - - uiDefButBitI(block, TOG, USER_PANELPINNED, 0, "Pin Floating Panels", - (xpos+edgsp+spref+midsp),y1,(mpref/2),buth, - &(U.uiflag), 0, 0, 0, 0, - "Make floating panels invoked by a hotkey (eg. N Key) open at the previous location"); - uiDefButBitI(block, TOG, USER_PLAINMENUS, B_PLAINMENUS, "Plain Menus", - (xpos+edgsp+(2*spref)+(2*midsp)),y1,spref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Use a column layout for toolbox and do not flip the contents of any menu"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Snap to grid:", - (xpos+(2*edgsp)+spref+midsp+mpref),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_AUTOGRABGRID, 0, "Grab/Move", - (xpos+edgsp+mpref+spref+(2*midsp)),y5,spref,buth, - &(U.flag), 0, 0, 0, 0, - "Snap objects and sub-objects to grid units when moving"); - uiDefButBitI(block, TOG, USER_AUTOROTGRID, 0, "Rotate", - (xpos+edgsp+mpref+spref+(2*midsp)),y4,spref,buth, - &(U.flag), 0, 0, 0, 0, - "Snap objects and sub-objects to grid units when rotating"); - uiDefButBitI(block, TOG, USER_AUTOSIZEGRID, 0, "Scale", - (xpos+edgsp+mpref+spref+(2*midsp)),y3,spref,buth, - &(U.flag), 0, 0, 0, 0, - "Snap objects and sub-objects to grid units when scaling"); - uiBlockEndAlign(block); - - uiDefButBitI(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot", - (xpos+edgsp+mpref+spref+(2*midsp)),y1,spref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Lock the same rotation/scaling pivot in all 3D Views"); - - uiDefBut(block, LABEL,0,"View zoom:", - (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */ - uiDefButS(block, ROW, 0, "Continue", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y5,(mpref/3),buth, - &(U.viewzoom), 40, USER_ZOOM_CONT, 0, 0, - "Old style zoom, continues while moving mouse up or down"); - uiDefButS(block, ROW, 0, "Dolly", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/3)),y5,(mpref/3),buth, - &(U.viewzoom), 40, USER_ZOOM_DOLLY, 0, 0, - "Zooms in and out based on vertical mouse movement."); - uiDefButS(block, ROW, 0, "Scale", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(2*mpref/3)),y5,(mpref/3),buth, - &(U.viewzoom), 40, USER_ZOOM_SCALE, 0, 0, - "Zooms in and out like scaling the view, mouse movements relative to center."); - uiBlockSetCol(block, TH_AUTO); /* end color */ - uiBlockEndAlign(block); - - uiDefButBitI(block, TOG, USER_ZOOM_TO_MOUSEPOS, B_DRAWINFO, "Zoom to Mouse Position", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y4,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center"); - - uiDefBut(block, LABEL,0,"View rotation:", - (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */ - uiDefButBitI(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y2,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, - "Allow the view to tumble freely when orbiting with the Middle Mouse Button"); - uiDefButBitI(block, TOGN, USER_TRACKBALL, B_DRAWINFO, "Turntable", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y2,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, - "Use fixed up axis for orbiting with Middle Mouse Button"); - uiBlockSetCol(block, TH_AUTO); /* end color */ - uiDefButBitI(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Perspective", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y1,(mpref/2),buth, - &(U.uiflag), 0, 0, 0, 0, - "Automatically switch between orthographic and perspective when changing from top/front/side views"); - uiDefButBitI(block, TOG, USER_ORBIT_SELECTION, B_DRAWINFO, "Around Selection", - (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y1,(mpref/2),buth, - &(U.uiflag), 0, 0, 0, 0, - "Use selection as the orbiting center"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Select with:", - (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */ - uiDefButBitI(block, TOG, USER_LMOUSESELECT, B_DRAWINFO, "Left Mouse", - (xpos+edgsp+(3*mpref)+(4*midsp)),y5,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Use the Left Mouse Button for selection"); - uiDefButBitI(block, TOGN, USER_LMOUSESELECT, B_DRAWINFO, "Right Mouse", - (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/2)),y5,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Use the Right Mouse Button for selection"); - uiBlockSetCol(block, TH_AUTO); /* end color */ - uiBlockEndAlign(block); - - - if(U.flag & USER_LMOUSESELECT) { - uiDefBut(block, LABEL,0,"Cursor with: Right Mouse", - (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth, - 0, 0, 0, 0, 0, ""); - } else { - uiDefBut(block, LABEL,0,"Cursor with: Left Mouse", - (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth, - 0, 0, 0, 0, 0, ""); - } - - uiDefButBitI(block, TOG, USER_SHOW_FPS, B_DRAWINFO, "Display FPS in View", - (xpos+edgsp+(3*mpref)+(4*midsp)),y2,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Display the number of frames per secons being drawn"); - - /* illegal combo... */ - if (U.flag & USER_LMOUSESELECT) - U.flag &= ~USER_TWOBUTTONMOUSE; - - uiDefButBitI(block, TOG, USER_TWOBUTTONMOUSE, B_DRAWINFO, "Emulate 3 Button Mouse", - (xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth, - &(U.flag), 0, 0, 0, 0, - "Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)"); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis", - (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref/3),buth, - &(U.uiflag), 0, 0, 0, 0, - "Show a small rotating 3D axis in the bottom left corner of the 3D View"); - uiDefButS(block, NUM, B_DRAWINFO, "Size:", - (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/3)),y1,(mpref/3),buth, - &U.rvisize, 10, 64, 0, 0, - "The axis icon's size"); - uiDefButS(block, NUM, B_DRAWINFO, "Bright:", - (xpos+edgsp+(3*mpref)+(4*midsp)+2*(mpref/3)),y1,(mpref/3),buth, - &U.rvibright, 0, 10, 0, 0, - "The brightness of the icon"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Middle Mouse Button:", - (xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */ - uiDefButBitI(block, TOGN, USER_VIEWMOVE, B_DRAWINFO, "Rotate View", - (xpos+edgsp+(4*mpref)+(5*midsp)),y5,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button"); - uiDefButBitI(block, TOG, USER_VIEWMOVE, B_DRAWINFO, "Pan View", - (xpos+edgsp+(4*mpref)+(5*midsp)+(mpref/2)),y5,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button"); - uiBlockSetCol(block, TH_AUTO); /* end color */ - uiBlockEndAlign(block); - - - uiDefBut(block, LABEL,0,"Mouse Wheel:", - (xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y4label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_WHEELZOOMDIR, 0, "Invert Zoom", - (xpos+edgsp+(4*mpref)+(5*midsp)),y3,spref,buth, - &(U.uiflag), 0, 0, 0, 0, - "Swap the Mouse Wheel zoom direction"); - uiDefButI(block, NUM, 0, "Scroll Lines:", - (xpos+edgsp+(4*mpref)+(6*midsp)+spref-edgsp),y3,spref+edgsp,buth, - &U.wheellinescroll, 0.0, 32.0, 0, 0, - "The number of lines scrolled at a time with the mouse wheel"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_DRAWINFO, "Smooth View:", - (xpos+edgsp+(4*mpref)+(5*midsp)),y2,(mpref),buth, - &U.smooth_viewtx, 0, 1000, 0, 0, - "The time to animate the view in miliseconds, zero to disable"); - uiDefButS(block, NUM, B_DRAWINFO, "Rotation Angle:", - (xpos+edgsp+(4*mpref)+(5*midsp)),y1,(mpref),buth, - &U.pad_rot_angle, 0, 90, 0, 0, - "The rotation step for numerical pad keys (2 4 6 8)"); - uiBlockEndAlign(block); - - - uiDefBut(block, LABEL,0,"3D Transform Widget:", - (xpos+(2*edgsp)+(5*mpref)+(5*midsp)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_REDRCURW3D, "Size:", - (xpos+edgsp+(5*mpref)+(6*midsp)),y5,(mpref/2),buth, - &(U.tw_size), 2, 40, 0, 0, "Diameter of widget, in 10 pixel units"); - uiDefButS(block, NUM, B_REDRCURW3D, "Handle:", - (xpos+edgsp+(5*mpref)+(6*midsp)+(mpref/2)),y5,(mpref/2),buth, - &(U.tw_handlesize), 2, 40, 0, 0, "Size of widget handles as percentage of widget radius"); - uiDefButS(block, NUM, B_REDRCURW3D, "Hotspot:", - (xpos+edgsp+(5*mpref)+(6*midsp)),y4,(mpref),buth, - &(U.tw_hotspot), 4, 40, 0, 0, "Hotspot in pixels for clicking widget handles"); - uiBlockEndAlign(block); - - uiDefButS(block, NUM, B_REDRCURW3D, "Object Center Size: ", - (xpos+edgsp+(5*mpref)+(6*midsp)),y3,mpref,buth, - &(U.obcenter_dia), 4, 10, 0, 0, - "Diameter in Pixels for Object/Lamp center display"); - - - } else if (U.userpref == 1) { /* edit methods */ - - - uiDefBut(block, LABEL,0,"Material linked to:", - xpos,y5label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOGN, USER_MAT_ON_OB, B_DRAWINFO, "ObData", - (xpos+edgsp),y4,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Link new objects' material to the obData block"); - uiDefButBitI(block, TOG, USER_MAT_ON_OB, B_DRAWINFO, "Object", - (xpos+edgsp+(mpref/2)),y4,(mpref/2),buth, - &(U.flag), 0, 0, 0, 0, "Link new objects' material to the object block"); - uiBlockEndAlign(block); - - uiDefBut(block, LABEL,0,"Add new objects:", - xpos,y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_ADD_EDITMODE, B_DRAWINFO, "Switch to Edit Mode", - (xpos+edgsp),y2,mpref,buth, - &(U.flag), 0, 0, 0, 0, "Enter Edit Mode automatically after adding a new object"); - uiDefButBitI(block, TOG, USER_ADD_VIEWALIGNED, B_DRAWINFO, "Aligned to View", - (xpos+edgsp),y1,mpref,buth, - &(U.flag), 0, 0, 0, 0, "Align newly added objects facing the 3D View direction"); - uiBlockEndAlign(block); - - - uiDefBut(block, LABEL,0,"Undo:", - (xpos+(2*edgsp)+mpref),y3label, mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButS(block, NUMSLI, B_DRAWINFO, "Steps: ", - (xpos+edgsp+mpref+midsp),y2,mpref,buth, - &(U.undosteps), 0, 64, 0, 0, "Number of undo steps available (smaller values conserve memory)"); - - uiDefButBitI(block, TOG, USER_GLOBALUNDO, B_DRAWINFO, "Global Undo", - (xpos+edgsp+mpref+midsp),y1,mpref,buth, - &(U.uiflag), 2, 64, 0, 0, "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory"); - uiBlockEndAlign(block); - - - uiDefBut(block, LABEL,0,"Auto keyframe", - (xpos+(2*edgsp)+(2*mpref)+midsp),y5label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButBitI(block, TOG, G_RECORDKEYS, REDRAWTIME, "Action and Object", - (xpos+edgsp+(2*mpref)+(2*midsp)),y4,mpref, buth, - &(G.flags), 0, 0, 0, 0, "Automatic keyframe insertion in Object and Action Ipo curves"); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_KEYINSERTAVAI, REDRAWTIME, "Available", - (xpos+edgsp+(2*mpref)+(2*midsp)),y3,mpref, buth, - &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in available curves"); - - uiDefButBitI(block, TOG, USER_KEYINSERTNEED, REDRAWTIME, "Needed", - (xpos+edgsp+(2*mpref)+(2*midsp)),y2,mpref, buth, - &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion only when keyframe needed"); - - uiDefButBitI(block, TOG, G_AUTOMATKEYS, REDRAWTIME, "Use Visual Keying", - (xpos+edgsp+(2*mpref)+(2*midsp)),y1,mpref, buth, - &(G.flags), 0, 0, 0, 0, "Use Visual keying automatically for constrained objects"); - uiBlockEndAlign(block); - -/* uiDefButBitS(block, TOG, USER_KEYINSERTACT, 0, "Action", - (xpos+edgsp+(2*mpref)+(2*midsp)),y2,(spref+edgsp),buth, - &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in Action Ipo curve"); - uiDefButBitS(block, TOG, USER_KEYINSERTOBJ, 0, "Object", - (xpos+edgsp+(2*mpref)+(3*midsp)+spref-edgsp),y2,(spref+edgsp),buth, - &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in Object Ipo curve"); */ - - - uiDefBut(block, LABEL,0,"Duplicate with object:", - (xpos+(2*edgsp)+(3*midsp)+(3*mpref)+spref),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, USER_DUP_MESH, 0, "Mesh", - (xpos+edgsp+(4*midsp)+(3*mpref)+spref),y2,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes mesh data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_SURF, 0, "Surface", - (xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y2,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes surface data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_CURVE, 0, "Curve", - (xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y2,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes curve data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_FONT, 0, "Text", - (xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y2,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes text data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_MBALL, 0, "Metaball", - (xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y2,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes metaball data to be duplicated with Shift+D"); - - uiDefButBitI(block, TOG, USER_DUP_ARM, 0, "Armature", - (xpos+edgsp+(4*midsp)+(3*mpref)+spref),y1,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes armature data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_LAMP, 0, "Lamp", - (xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y1,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes lamp data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_MAT, 0, "Material", - (xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y1,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes material data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_TEX, 0, "Texture", - (xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y1,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes texture data to be duplicated with Shift+D"); - uiDefButBitI(block, TOG, USER_DUP_IPO, 0, "Ipo", - (xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y1,(spref+edgsp),buth, - &(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D"); - uiBlockEndAlign(block); - - } else if(U.userpref == 2) { /* language & colors */ - -#ifdef INTERNATIONAL - uiDefButBitS(block, TOG, USER_DOTRANSLATE, B_DOLANGUIFONT, "International Fonts", - xpos,y2,mpref,buth, - &(U.transopts), 0, 0, 0, 0, "Activate international interface"); - - if(U.transopts & USER_DOTRANSLATE) { - char curfont[320]; - - sprintf(curfont, "Interface Font: "); - if(U.fontname[0]) strcat(curfont, U.fontname); - else strcat(curfont, "Built-in"); - - uiDefBut(block, LABEL,0,curfont, - (xpos),y3,4*mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefBut(block, BUT, B_LOADUIFONT, "Select Font", - xpos,y1,mpref,buth, - 0, 0, 0, 0, 0, "Select a new font for the interface"); - - uiDefButI(block, BUT, B_RESTOREFONT, "Restore to default", - (xpos+edgsp+mpref+midsp),y2,mpref,buth, - &U.fontsize, 0, 0, 0, 0, "Restores to using the default included antialised font"); - - uiDefButI(block, MENU, B_SETFONTSIZE, fontsize_pup(), - (xpos+edgsp+mpref+midsp),y1,mpref,buth, - &U.fontsize, 0, 0, 0, 0, "Current interface font size (points)"); - -/* - uiDefButS(block, MENU, B_SETENCODING, encoding_pup(), - (xpos+edgsp+mpref+midsp),y1,mpref,buth, - &U.encoding, 0, 0, 0, 0, "Current interface font encoding"); - - - uiDefBut(block, LABEL,0,"Translate:", - (xpos+edgsp+(2.1*mpref)+(2*midsp)),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); -*/ - - uiDefButBitS(block, TOG, USER_TR_TOOLTIPS, B_SETTRANSBUTS, "Tooltips", - (xpos+edgsp+(2.2*mpref)+(3*midsp)),y1,spref,buth, - &(U.transopts), 0, 0, 0, 0, "Translate tooltips"); - - uiDefButBitS(block, TOG, USER_TR_BUTTONS, B_SETTRANSBUTS, "Buttons", - (xpos+edgsp+(2.2*mpref)+(4*midsp)+spref),y1,spref,buth, - &(U.transopts), 0, 0, 0, 0, "Translate button labels"); - - uiDefButBitS(block, TOG, USER_TR_MENUS, B_SETTRANSBUTS, "Toolbox", - (xpos+edgsp+(2.2*mpref)+(5*midsp)+(2*spref)),y1,spref,buth, - &(U.transopts), 0, 0, 0, 0, "Translate toolbox menu"); - - uiDefButI(block, MENU, B_SETLANGUAGE, language_pup(), - (xpos+edgsp+(2.2*mpref)+(3*midsp)),y2,mpref+(0.5*mpref)+3,buth, - &U.language, 0, 0, 0, 0, "Select interface language"); - - uiDefButBitS(block, TOG, USER_USETEXTUREFONT, B_USETEXTUREFONT, "Use Textured Fonts", - (xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth, - &(U.transopts), 0, 0, 0, 0, - "Use Textured Fonts"); - } - -/* end of INTERNATIONAL */ -#endif - - } else if(U.userpref == 3) { /* auto save */ - - - uiDefButS(block, NUM, 0, "Save Versions:", - (xpos+edgsp),y3,mpref,buth, - &U.versions, 0.0, 32.0, 0, 0, - "The number of old versions to maintain in the current directory, when manually saving"); - - uiDefButBitI(block, TOG, USER_AUTOSAVE, B_RESETAUTOSAVE, "Auto Save Temp Files", - (xpos+edgsp+mpref+midsp),y3,mpref,buth, - &(U.flag), 0, 0, 0, 0, - "Enables automatic saving of temporary files"); - - if(U.flag & USER_AUTOSAVE) { - - uiDefButI(block, NUM, B_RESETAUTOSAVE, "Minutes:", - (xpos+edgsp+mpref+midsp),y2,mpref,buth, - &(U.savetime), 1.0, 60.0, 0, 0, - "The time (in minutes) to wait between automatic temporary saves"); - - uiDefBut(block, BUT, B_LOADTEMP, "Open Recent", - (xpos+edgsp+mpref+midsp),y1,mpref,buth, - 0, 0, 0, 0, 0,"Open the most recently saved temporary file"); - } - - uiDefButS(block, NUM, B_DRAWINFO, "Recent Files:", - (xpos+edgsp+(2*mpref)+(3*midsp)),y3,(mpref),buth, - &U.recent_files, 0, 30, 0, 0, - "Maximum number of recently opened files to remember"); - - uiDefButBitI(block, TOG, USER_SAVE_PREVIEWS, 0, "Save Preview Images", - (xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth, - &(U.flag), 0, 0, 0, 0, - "Enables automatic saving of preview images in the .blend file"); - - } else if (U.userpref == 4) { /* system & opengl */ - int memcachemax; - if (sizeof(void *) ==8) memcachemax = 1024*16; /* 64bit system, 16 gig of ram would be nice */ - else memcachemax = 1024; /* 32 bit system, cant address over 2gig anyway */ - - uiDefBut(block, LABEL,0,"Solid OpenGL lights:", - xpos+edgsp, y6label, mpref, buth, - 0, 0, 0, 0, 0, ""); - - for (cur_light=0; cur_light<3; cur_light++) { - char lightname[12]; - int lightbutw=buth*2; - int offs=cur_light*(midsp+lightbutw); - - sprintf(lightname, "Light %d", cur_light+1); - - uiDefButBitI(block, TOG, 1, B_RECALCLIGHT, lightname, - xpos+edgsp+offs, y5, lightbutw, buth, - &U.light[cur_light].flag, 0.0, 0.0, 0, 0, "Enable this OpenGL light in Solid draw mode"); - - uiDefButF(block, BUT_NORMAL, B_RECALCLIGHT, "", - xpos+edgsp+offs, y3, lightbutw, buth*2+rspace, - U.light[cur_light].vec, 0.0f, 1.0f, 0, 0, "The direction that the OpenGL light is shining"); - - uiDefButF(block, COL, B_RECALCLIGHT, "", - xpos+edgsp+offs, y2, lightbutw, buth, - U.light[cur_light].col, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, COL, B_RECALCLIGHT, "", - xpos+edgsp+offs, y1, lightbutw, buth, - U.light[cur_light].spec, 0.0, 0.0, 0, 0, ""); - } - - uiDefBut(block, LABEL,0,"Color", - xpos+edgsp+140, y2, mpref/4, buth, - 0, 0, 0, 0, 0, ""); - uiDefBut(block, LABEL,0,"Spec", - xpos+edgsp+140, y1, mpref/4, buth, - 0, 0, 0, 0, 0, ""); - - -#ifdef WITH_VERSE - uiDefBut(block, LABEL,0,"Verse:", - (xpos+edgsp+(3*midsp)+(3*mpref)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefBut(block, TEX, 0, "Master: ", - (xpos+edgsp+(3*midsp)+(3*mpref)),y5,mpref,buth, - U.versemaster, 1.0, 63.0, 0, 0, - "The Verse Master-server IP"); - uiDefBut(block, TEX, 0, "Username: ", - (xpos+edgsp+(3*midsp)+(3*mpref)),y4,mpref,buth, - U.verseuser, 1.0, 63.0, 0, 0, - "The Verse user name"); -#endif - -/* - uiDefButBitS(block, TOG, USER_EVTTOCONSOLE, 0, "Log Events to Console", - (xpos+edgsp),y2,lpref,buth, - &(U.uiflag), 0, 0, 0, 0, "Display a list of input events in the console"); - - uiDefButS(block, MENU, B_CONSOLEOUT, consolemethod_pup(), - (xpos+edgsp), y1, lpref,buth, - &U.console_out, 0, 0, 0, 0, "Select console output method"); - - uiDefButS(block, NUM, B_CONSOLENUMLINES, "Lines:", - (xpos+edgsp+lpref+midsp),y1,spref,buth, - &U.console_buffer, 1.0, 4000.0, 0, 0, "Maximum number of internal console lines"); -*/ - -#ifdef _WIN32 - uiDefBut(block, LABEL,0,"Win Codecs:", - (xpos+edgsp+(1*midsp)+(1*mpref)),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButBitI(block, TOG, USER_ALLWINCODECS, 0, "Enable all codecs", - (xpos+edgsp+(1*mpref)+(1*midsp)),y2,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, "Allows all codecs for rendering (not guaranteed)"); -#endif - - uiDefBut(block, LABEL,0,"Auto Run Python Scripts", - (xpos+edgsp+(1*midsp)+(1*mpref)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButBitI(block, TOG, G_DOSCRIPTLINKS, REDRAWBUTSSCRIPT, "Enabled by Default", - (xpos+edgsp+(1*mpref)+(1*midsp)),y5,mpref,buth, - &(G.f), 0, 0, 0, 0, "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)"); - - uiDefBut(block, LABEL,0,"Keyboard:", - (xpos+edgsp+(3*midsp)+(3*mpref)),y3label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButBitI(block, TOG, USER_NO_CAPSLOCK, B_U_CAPSLOCK, "Disable Caps Lock", - (xpos+edgsp+(3*midsp)+(3*mpref)),y1,mpref,buth, - &(U.flag), 0, 0, 0, 0, - "Disables the Caps Lock key when entering text"); - - uiDefButBitI(block, TOG, USER_NONUMPAD, 0, "Emulate Numpad", - (xpos+edgsp+(3*midsp)+(3*mpref)),y2,mpref,buth, - &(U.flag), 0, 0, 0, 0, - "Causes the 1 to 0 keys to act as the numpad (useful for laptops)"); - - - uiDefBut(block, LABEL,0,"System:", - (xpos+edgsp+(4*midsp)+(4*mpref)),y7label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiDefButI(block, NUM, B_REDR, "Prefetch frames ", - (xpos+edgsp+(4*mpref)+(4*midsp)), y6, mpref, buth, - &U.prefetchframes, 0.0, 500.0, 20, 2, - "Number of frames to render ahead during playback."); - - uiDefButI(block, NUM, B_MEMCACHELIMIT, "MEM Cache Limit ", - (xpos+edgsp+(4*mpref)+(4*midsp)), y5, mpref, buth, - &U.memcachelimit, 0.0, (float)memcachemax, 30, 2, - "Memory cache limit in sequencer (megabytes)"); - - uiDefButS(block, NUM, B_REDR, "Frameserver Port ", - (xpos+edgsp+(4*mpref)+(4*midsp)), y4, mpref, buth, - &U.frameserverport, 0.0, 32727.0, 30, 2, - "Frameserver Port for Framserver-Rendering"); - - uiDefButBitI(block, TOG, USER_DISABLE_SOUND, B_SOUNDTOGGLE, "Disable Game Sound", - (xpos+edgsp+(4*mpref)+(4*midsp)),y3,mpref,buth, - &(U.gameflags), 0, 0, 0, 0, "Disables sounds from being played in games"); - - uiDefButBitI(block, TOG, USER_FILTERFILEEXTS, 0, "Filter File Extensions", - (xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, "Display only files with extensions in the image select window"); - - uiDefButBitI(block, TOG, USER_HIDE_DOT, 0, "Hide dot file/datablock", - (xpos+edgsp+(4*mpref)+(4*midsp)),y1,mpref,buth, - &(U.uiflag), 0, 0, 0, 0, "Hide files/datablocks that start with a dot(.*)"); - - uiDefBut(block, LABEL,0,"OpenGL:", - (xpos+edgsp+(5*midsp)+(5*mpref)),y7label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButF(block, NUMSLI, B_DRAWINFO, "Clip Alpha: ", - (xpos+edgsp+(5*mpref)+(5*midsp)),y6,mpref,buth, - &(U.glalphaclip), 0.0, 1.0, 0, 0, "Clip alpha below this threshold in the 3d textured view"); - - uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps", - (xpos+edgsp+(5*mpref)+(5*midsp)),y5,mpref,buth, - &(U.gameflags), 0, 0, 0, 0, "Toggles between mipmap textures on (beautiful) and off (fast)"); - - /* main choices pup: note, it uses collums, and the seperators (%l) then have to fill both halves equally for the menu to work */ - uiDefButS(block, MENU, B_GLRESLIMITCHANGED, "GL Texture Clamp Off%x0|%l|GL Texture Clamp 8192%x8192|GL Texture Clamp 4096%x4096|GL Texture Clamp 2048%x2048|GL Texture Clamp 1024%x1024|GL Texture Clamp 512%x512|GL Texture Clamp 256%x256|GL Texture Clamp 128%x128", - (xpos+edgsp+(5*mpref)+(5*midsp)),y4,mpref,buth, &(U.glreslimit), 0, 0, 0, 0, "Limit the texture size to save graphics memory"); - - uiDefButBitI(block, TOG, USER_VERTEX_ARRAYS, 0, "Vertex Arrays", - (xpos+edgsp+(5*mpref)+(5*midsp)),y3,mpref,buth, - &(U.gameflags), 0, 0, 0, 0, "Toggles between vertex arrays on (less reliable) and off (more reliable)"); - - uiDefButI(block, NUM, 0, "Time Out ", - (xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth, - &U.textimeout, 0.0, 3600.0, 30, 2, "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated)"); - uiDefButI(block, NUM, 0, "Collect Rate ", - (xpos+edgsp+(5*mpref)+(5*midsp)), y1, mpref, buth, - &U.texcollectrate, 1.0, 3600.0, 30, 2, "Number of seconds between each run of the GL texture garbage collector."); - - /* *** */ - uiDefBut(block, LABEL,0,"Color range for weight paint", - (xpos+edgsp+(2*midsp)+(2*mpref)),y6label,mpref,buth, - 0, 0, 0, 0, 0, ""); - - uiDefButBitI(block, TOG, USER_CUSTOM_RANGE, B_WPAINT_RANGE, "ColorBand", - (xpos+edgsp+(2*midsp)+(2*mpref)),y5,mpref,buth, - &(U.flag), 0, 0, 0, 0, - ""); - - if((U.flag & USER_CUSTOM_RANGE)==0) { - vDM_ColorBand_store(NULL); - } - else { - rctf butrect; - - vDM_ColorBand_store(&U.coba_weight); /* also signal for derivedmesh to use colorband */ - - BLI_init_rctf(&butrect, (xpos+edgsp+(2*midsp)+(2*mpref)), - (xpos+edgsp+(2*midsp)+(2*mpref)) + mpref, - y3, y3+30); - - draw_colorband_buts_small(block, &U.coba_weight, &butrect, B_WPAINT_RANGE); - } - - uiDefBut(block, LABEL,0,"Audio mixing buffer:", - (xpos+edgsp+(2*midsp)+(2*mpref)),y2label,mpref,buth, - 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButI(block, ROW, 0, "256", - (xpos+edgsp+(2*midsp)+(2*mpref)),y1,(mpref/4),buth, - &U.mixbufsize, 2.0, 256.0, 0, 0, "Set audio mixing buffer size to 256 samples"); - uiDefButI(block, ROW, 0, "512", - (xpos+edgsp+(2*midsp)+(2*mpref)+(mpref/4)),y1,(mpref/4),buth, - &U.mixbufsize, 2.0, 512.0, 0, 0, "Set audio mixing buffer size to 512 samples"); - uiDefButI(block, ROW, 0, "1024", - (xpos+edgsp+(2*midsp)+(2*mpref)+(2*mpref/4)),y1,(mpref/4),buth, - &U.mixbufsize, 2.0, 1024.0, 0, 0, "Set audio mixing buffer size to 1024 samples"); - uiDefButI(block, ROW, 0, "2048", - (xpos+edgsp+(2*midsp)+(2*mpref)+(3*mpref/4)),y1,(mpref/4),buth, - &U.mixbufsize, 2.0, 2048.0, 0, 0, "Set audio mixing buffer size to 2048 samples"); - uiBlockEndAlign(block); - - } else if(U.userpref == 5) { /* file paths */ - - /* yafray: (temporary) path button for yafray xml export, now with fileselect */ - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "YFexport: ", - (xpos+edgsp), y2+buth+rspace, lpref-smfileselbut, buth, - U.yfexportdir, 1.0, 63.0, 0, 0, - "The default directory for yafray xml export (must exist!)"); - uiDefIconBut(block, BUT, B_YAFRAYDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+lpref-smfileselbut), y2+buth+rspace, smfileselbut, buth, - 0, 0, 0, 0, 0, "Select the default yafray export directory"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Fonts: ", - (xpos+edgsp),y2,(lpref-smfileselbut),buth, - U.fontdir, 1.0, 63.0, 0, 0, - "The default directory to search for loading fonts"); - uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+lpref-smfileselbut),y2,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default font directory"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Textures: ", - (xpos+edgsp+lpref+midsp),y2,(lpref-smfileselbut),buth, - U.textudir, 1.0, 63.0, 0, 0, "The default directory to search for textures"); - uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(2*lpref)+midsp-smfileselbut),y2,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default texture location"); - uiBlockEndAlign(block); - - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Tex Plugins: ", - (xpos+edgsp+(2*lpref)+(2*midsp)),y2,(lpref-smfileselbut),buth, - U.plugtexdir, 1.0, 63.0, 0, 0, "The default directory to search for texture plugins"); - uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y2,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default texture plugin location"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Seq Plugins: ", - (xpos+edgsp+(3*lpref)+(3*midsp)),y2,(lpref-smfileselbut),buth, - U.plugseqdir, 1.0, 63.0, 0, 0, "The default directory to search for sequence plugins"); - uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y2,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default sequence plugin location"); - uiBlockEndAlign(block); - - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Render: ", - (xpos+edgsp),y1,(lpref-smfileselbut),buth, - U.renderdir, 1.0, 63.0, 0, 0, "The default directory for rendering output"); - uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+lpref-smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default render output location"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Python: ", - (xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth, - U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts"); - uiDefIconBut(block, BUT, B_PYMENUEVAL, ICON_SCRIPT, - (xpos+edgsp+(2*lpref)+midsp-2*smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Re-evaluate scripts registration in menus"); - uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default Python script location"); - uiBlockEndAlign(block); - - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Sounds: ", - (xpos+edgsp+(2*lpref)+(2*midsp)),y1,(lpref-smfileselbut),buth, - U.sounddir, 1.0, 63.0, 0, 0, "The default directory to search for sounds"); - uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Selet the default sound location"); - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - uiDefBut(block, TEX, 0, "Temp: ", - (xpos+edgsp+(3*lpref)+(3*midsp)),y1,(lpref-smfileselbut),buth, - U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files"); - uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL, - (xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y1,smfileselbut,buth, - 0, 0, 0, 0, 0, "Select the default temporary save file location"); - uiBlockEndAlign(block); - - } - - uiDrawBlock(block); - - myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375); - draw_area_emboss(sa); - - /* restore buttons transform */ - if(curarea->winx<=1280.0) { - fac= ((float)curarea->winx)/1280.0f; - myortho2(0.0, 1280.0, 0.0, curarea->winy/fac); - } - else { - myortho2(0.0, (float)curarea->winx, 0.0, (float)curarea->winy); - } - sa->win_swap= WIN_BACK_OK; - -} - - -static void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - - if(val) { - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - switch(event) { - case UI_BUT_EVENT: - if(val==REDRAWTIME) allqueue(REDRAWTIME, 0); - else if(val==B_ADD_THEME) { - bTheme *btheme, *new; - - btheme= U.themes.first; - new= MEM_callocN(sizeof(bTheme), "theme"); - memcpy(new, btheme, sizeof(bTheme)); - BLI_addhead(&U.themes, new); - strcpy(new->name, "New User Theme"); - addqueue(sa->win, REDRAW, 1); - } - else if(val==B_DEL_THEME) { - bTheme *btheme= U.themes.first; - BLI_remlink(&U.themes, btheme); - MEM_freeN(btheme); - BIF_SetTheme(sa); /* prevent usage of old theme in calls */ - addqueue(sa->win, REDRAW, 1); - } - else if(val==B_NAME_THEME) { - bTheme *btheme= U.themes.first; - if(strcmp(btheme->name, "Default")==0) { - strcpy(btheme->name, "New User Theme"); - addqueue(sa->win, REDRAW, 1); - } - } - else if(val==B_UPDATE_THEME) { - allqueue(REDRAWALL, 0); - } - else if(val==B_UPDATE_THEME_ICONS) { - BIF_icons_free(); - BIF_icons_init(BIFICONID_LAST+1); - allqueue(REDRAWALL, 0); - } - else if(val==B_CHANGE_THEME) { - th_curcol= TH_BACK; /* backdrop color is always there... */ - addqueue(sa->win, REDRAW, 1); - } - else if(val==B_THEME_COPY) { - if(th_curcol_ptr) { - th_curcol_arr[0]= th_curcol_ptr[0]; - th_curcol_arr[1]= th_curcol_ptr[1]; - th_curcol_arr[2]= th_curcol_ptr[2]; - th_curcol_arr[3]= th_curcol_ptr[3]; - addqueue(sa->win, REDRAW, 1); - } - } - else if(val==B_THEME_PASTE) { - if(th_curcol_ptr) { - th_curcol_ptr[0]= th_curcol_arr[0]; - th_curcol_ptr[1]= th_curcol_arr[1]; - th_curcol_ptr[2]= th_curcol_arr[2]; - th_curcol_ptr[3]= th_curcol_arr[3]; - allqueue(REDRAWALL, 0); - } - } - else if(val==B_RECALCLIGHT) { - if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) - U.light[0].flag= 1; - - default_gl_light(); - addqueue(sa->win, REDRAW, 1); - allqueue(REDRAWVIEW3D, 0); - } - else if (val==B_MEMCACHELIMIT) { - printf("Setting memcache limit to %d\n", - U.memcachelimit); - MEM_CacheLimiter_set_maximum( - U.memcachelimit * 1024 * 1024); - } - else if (val==B_WPAINT_RANGE) { - addqueue(sa->win, REDRAW, 1); - if(OBACT && (G.f & G_WEIGHTPAINT)) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - } - } - else do_global_buttons(val); - - break; - } - } -} - -static void init_infospace(ScrArea *sa) -{ - SpaceInfo *sinfo; - - sinfo= MEM_callocN(sizeof(SpaceInfo), "initinfo"); - BLI_addhead(&sa->spacedata, sinfo); - - sinfo->spacetype=SPACE_INFO; -} - -/* ******************** SPACE: BUTS ********************** */ - -extern void drawbutspace(ScrArea *sa, void *spacedata); /* buttons.c */ - -static void changebutspace(ScrArea *sa, void *spacedata) -{ - if(G.v2d==0) return; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); -} - -static void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - SpaceButs *sbuts= curarea->spacedata.first; - ScrArea *sa2, *sa3d; - int nr; - - if(val) { - - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - switch(event) { - case UI_BUT_EVENT: - do_butspace(val); - break; - - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - case PAGEUPKEY: - event= WHEELUPMOUSE; - view2dmove(event); /* in drawipo.c */ - break; - case PAGEDOWNKEY: - event= WHEELDOWNMOUSE; - view2dmove(event); /* in drawipo.c */ - break; - - case RIGHTMOUSE: - nr= pupmenu("Panel Alignment%t|Horizontal%x1|Vertical%x2|Free %x0"); - if (nr>=0) { - sbuts->align= nr; - if(nr) { - uiAlignPanelStep(sa, 1.0); - do_buts_buttons(B_BUTSHOME); - } - } - - break; - case PADPLUSKEY: - view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - case PADMINUS: - view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - case RENDERPREVIEW: - BIF_previewrender_buts(sbuts); - break; - - case HOMEKEY: - do_buts_buttons(B_BUTSHOME); - break; - - - /* if only 1 view, also de persp, excluding arrowkeys */ - case PAD0: case PAD1: case PAD3: - case PAD5: case PAD7: case PAD9: - case PADENTER: case ZKEY: case PKEY: - sa3d= 0; - sa2= G.curscreen->areabase.first; - while(sa2) { - if(sa2->spacetype==SPACE_VIEW3D) { - if(sa3d) return; - sa3d= sa2; - } - sa2= sa2->next; - } - if(sa3d) { - sa= curarea; - areawinset(sa3d->win); - - if(event==PKEY && G.qual==0) start_game(); - else if(event==ZKEY) toggle_shading(); - else persptoetsen(event); - - scrarea_queue_winredraw(sa3d); - scrarea_queue_headredraw(sa3d); - areawinset(sa->win); - } - } - } - -} - -void set_rects_butspace(SpaceButs *buts) -{ - /* buts space goes from (0,0) to (1280, 228) */ - - buts->v2d.tot.xmin= 0.0f; - buts->v2d.tot.ymin= 0.0f; - buts->v2d.tot.xmax= 1279.0f; - buts->v2d.tot.ymax= 228.0f; - - buts->v2d.min[0]= 256.0f; - buts->v2d.min[1]= 42.0f; - - buts->v2d.max[0]= 2048.0f; - buts->v2d.max[1]= 450.0f; - - buts->v2d.minzoom= 0.5f; - buts->v2d.maxzoom= 1.21f; - - buts->v2d.scroll= 0; - buts->v2d.keepaspect= 1; - buts->v2d.keepzoom= 1; - buts->v2d.keeptot= 1; - -} - -void test_butspace(void) -{ - ScrArea *area= curarea; - int blocksmin= uiBlocksGetYMin(&area->uiblocks)-10.0f; - - G.buts->v2d.tot.ymin= MIN2(0.0f, blocksmin-10.0f); -} - -static void init_butspace(ScrArea *sa) -{ - SpaceButs *buts; - - buts= MEM_callocN(sizeof(SpaceButs), "initbuts"); - BLI_addhead(&sa->spacedata, buts); - - buts->spacetype= SPACE_BUTS; - buts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK; - - /* set_rects only does defaults, so after reading a file the cur has not changed */ - set_rects_butspace(buts); - buts->v2d.cur= buts->v2d.tot; - - buts->ri = NULL; -} - -void extern_set_butspace(int fkey, int do_cycle) -{ - ScrArea *sa; - SpaceButs *sbuts; - Object *ob= OBACT; - - /* when a f-key pressed: 'closest' button window is initialized */ - if(curarea->spacetype==SPACE_BUTS) sa= curarea; - else { - /* find area */ - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_BUTS) break; - sa= sa->next; - } - } - - if(sa==NULL) return; - - if(sa!=curarea) areawinset(sa->win); - - sbuts= sa->spacedata.first; - if(!do_cycle) sbuts->oldkeypress= 0; - - if(fkey==F4KEY) { - sbuts->mainb= CONTEXT_LOGIC; - } - else if(fkey==F5KEY) { - /* if it's already in shading context, cycle between tabs with the same key */ - if (sbuts->oldkeypress == F5KEY) { - - if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP) - sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_MAT; - else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT) - sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_TEX; - else if (sbuts->tab[CONTEXT_SHADING]==1) { - sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_RAD; - } - else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_RAD) - sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_WORLD; - else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD) - sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_LAMP; - } - /* if we're coming in from texture buttons, - or from outside the shading context, just go to the 'default' */ - else if (ob) { - sbuts->mainb= CONTEXT_SHADING; - - if(ob->type==OB_CAMERA) - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD; - else if(ob->type==OB_LAMP) - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP; - else - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT; - } - else { - sbuts->mainb= CONTEXT_SHADING; - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT; - } - BIF_preview_changed(ID_TE); - } - else if(fkey==F6KEY) { - sbuts->mainb= CONTEXT_SHADING; - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX; - BIF_preview_changed(ID_TE); - } - else if(fkey==F7KEY) { - /* if it's already in object context, cycle between tabs with the same key */ - if (sbuts->oldkeypress == F7KEY) { - - if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_OBJECT) - sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_PHYSICS; - else if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_PHYSICS) - sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_PARTICLE; - else if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_PARTICLE) - sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_OBJECT; - } - else sbuts->mainb= CONTEXT_OBJECT; - - } - else if(fkey==F8KEY) { - sbuts->mainb= CONTEXT_SHADING; - sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD; - BIF_preview_changed(ID_TE); - } - else if(fkey==F9KEY) sbuts->mainb= CONTEXT_EDITING; - else if(fkey==F10KEY) { - /* if it's already in scene context, cycle between tabs with the same key */ - if (sbuts->oldkeypress == F10KEY) { - - if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_RENDER) - sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_ANIM; - else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_ANIM) - sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_SOUND; - else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND) - sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_RENDER; - } - else sbuts->mainb= CONTEXT_SCENE; - } - - sbuts->oldkeypress = fkey; - - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); -} - -/* ******************** SPACE: SEQUENCE ********************** */ - -/* extern void drawseqspace(ScrArea *sa, void *spacedata); BIF_drawseq.h */ - -static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - SpaceSeq *sseq= curarea->spacedata.first; - View2D *v2d= &sseq->v2d; - Sequence *last_seq = get_last_seq(); - float dx, dy; - int doredraw= 0, cfra=0, first; - short mval[2]; - short nr; - short mousebut = L_MOUSE; - - if(curarea->win==0) return; - - if(val) { - if( uiDoBlocks(&curarea->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - mousebut = L_MOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - mousebut = R_MOUSE; - } - } - - switch(event) { - case UI_BUT_EVENT: - do_seqbuttons(val); - break; - case LEFTMOUSE: - if(sseq->mainb || view2dmove(event)==0) { - - first= 1; - set_special_seq_update(1); - - do { - getmouseco_areawin(mval); - areamouseco_to_ipoco(v2d, mval, &dx, &dy); - - cfra= (int)dx; - if(cfra< 1) cfra= 1; - /* else if(cfra> EFRA) cfra= EFRA; */ - - if( cfra!=CFRA || first ) { - first= 0; - - CFRA= cfra; - force_draw(0); - update_for_newframe(); /* for audio scrubbing */ - } - else PIL_sleep_ms(30); - - } while(get_mbut() & mousebut); - - set_special_seq_update(0); - - if (cfra == 0) - update_for_newframe(); - } - break; - case MIDDLEMOUSE: - if(sseq->mainb) seq_viewmove(sseq); - else view2dmove(event); /* in drawipo.c */ - break; - case RIGHTMOUSE: - if(sseq->mainb) break; - mouse_select_seq(); - break; - case PADPLUSKEY: - if (G.qual==LR_CTRLKEY) { - select_more_seq(); - break; - } - case WHEELUPMOUSE: - if(sseq->mainb) { - sseq->zoom++; - if(sseq->zoom==-1) sseq->zoom= 1; - if(sseq->zoom>8) sseq->zoom= 8; - } - else { - if((G.qual==0)) { - dx= 0.1154f*(v2d->cur.xmax-v2d->cur.xmin); - v2d->cur.xmin+= dx; - v2d->cur.xmax-= dx; - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(sa, V2D_LOCK_COPY); - } - else if((G.qual==LR_SHIFTKEY)) { - insert_gap(25, CFRA); - BIF_undo_push("Insert gaps Sequencer"); - allqueue(REDRAWSEQ, 0); - } - else if(G.qual==LR_ALTKEY) { - insert_gap(250, CFRA); - BIF_undo_push("Insert gaps Sequencer"); - allqueue(REDRAWSEQ, 0); - } - } - doredraw= 1; - break; - case PADMINUS: - if (G.qual==LR_CTRLKEY) { - select_less_seq(); - break; - } - case WHEELDOWNMOUSE: - if(sseq->mainb) { - sseq->zoom--; - if(sseq->zoom==0) sseq->zoom= -2; - if(sseq->zoom<-8) sseq->zoom= -8; - } - else { - if((G.qual==LR_SHIFTKEY)) - no_gaps(); - else if((G.qual==0)) { - dx= 0.15f*(v2d->cur.xmax-v2d->cur.xmin); - v2d->cur.xmin-= dx; - v2d->cur.xmax+= dx; - test_view2d(G.v2d, sa->winx, sa->winy); - view2d_do_locks(sa, V2D_LOCK_COPY); - } - } - doredraw= 1; - break; - case HOMEKEY: - if((G.qual==0)) - do_seq_buttons(B_SEQHOME); - break; - case PADPERIOD: - if(last_seq) { - CFRA= last_seq->startdisp; - v2d->cur.xmin= last_seq->startdisp- (last_seq->len/20); - v2d->cur.xmax= last_seq->enddisp+ (last_seq->len/20); - update_for_newframe(); - } - break; - - case AKEY: - if (G.qual == LR_CTRLKEY) { - deselect_markers(1, 0); - allqueue(REDRAWMARKER, 0); - } else { - if(sseq->mainb) break; - if((G.qual==LR_SHIFTKEY)) { - add_sequence(-1); - } else if((G.qual==0)) { - swap_select_seq(); - } - } - break; - case SPACEKEY: - if (G.qual==0) { - if (sseq->mainb) { - play_anim(1); - } else { - add_sequence(-1); - } - } - break; - case BKEY: - if(sseq->mainb) break; - if((G.qual==0)) - borderselect_seq(); - break; - case CKEY: - if((G.qual==0)) { - if(last_seq && (last_seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))) { - if(last_seq->flag & SEQ_LEFTSEL) CFRA= last_seq->startdisp; - else CFRA= last_seq->enddisp-1; - - dx= CFRA-(v2d->cur.xmax+v2d->cur.xmin)/2; - v2d->cur.xmax+= dx; - v2d->cur.xmin+= dx; - update_for_newframe(); - } - else - change_sequence(); - } - break; - case DKEY: - if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) - duplicate_marker(); - else if ((G.qual==LR_SHIFTKEY)) { - if(sseq->mainb) break; - add_duplicate_seq(); - } - break; - case EKEY: - if(sseq->mainb) break; - if((G.qual==0)) - transform_seq('e', 0); - break; - case FKEY: - if((G.qual==0)) - set_filter_seq(); - break; - case GKEY: - if (G.qual & LR_CTRLKEY) - transform_markers('g', 0); - else if (G.qual==0) { - if(sseq->mainb) break; - transform_seq('g', 0); - } - break; - case KKEY: - if((G.qual==0)) { /* Cut at current frame */ - seq_cut(CFRA); - } - break; - case LKEY: - if((G.qual==0)) { /* Cut at current frame */ - select_linked_seq( 0 ); - } else if((G.qual==LR_CTRLKEY)) { /* Cut at current frame */ - select_linked_seq( 2 ); - } - break; - case YKEY: - if((G.qual==0)) { /* Cut at current frame */ - seq_separate_images(); - } - break; - case MKEY: - if(G.qual==LR_ALTKEY) { - un_meta(); - break; /*dont redraw timeline etc */ - } else if((G.qual==0)){ - if ((last_seq) && - (last_seq->type == SEQ_RAM_SOUND - || last_seq->type == SEQ_HD_SOUND)) - { - last_seq->flag ^= SEQ_MUTE; - doredraw = 1; - } else { - make_meta(); - } - break; /*dont redraw timeline etc */ - } else if ((G.qual==(LR_CTRLKEY|LR_ALTKEY) )) { - add_marker(CFRA); - } else if ((G.qual==LR_CTRLKEY)) { - rename_marker(); - } else { - break; /* do nothing */ - } - allqueue(REDRAWMARKER, 0); - break; - case NKEY: - if(G.qual==0) { - toggle_blockhandler(curarea, SEQ_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - scrarea_queue_winredraw(curarea); - } - break; - case RKEY: - if(G.qual==LR_SHIFTKEY) - seq_remap_paths(); - if(G.qual==LR_ALTKEY) - reload_sequence(); - else if (G.qual==0) - reassign_inputs_seq_effect(); - break; - case SKEY: - if((G.qual==LR_SHIFTKEY)) - seq_snap_menu(); - break; - case PKEY: - if((G.qual==0)) - touch_seq_files(); - break; - case TKEY: /* popup menu */ - nr= pupmenu("Time value%t|Frames %x1|Seconds%x2"); - if (nr>0) { - if(nr==1) sseq->flag |= SEQ_DRAWFRAMES; - else sseq->flag &= ~SEQ_DRAWFRAMES; - doredraw= 1; - } - break; - case XKEY: - case DELKEY: - if(G.qual==0) { - if(sseq->mainb) break; - if((G.qual==0)) - del_seq(); - } - break; - } - } - - if(doredraw) scrarea_queue_winredraw(curarea); -} - - -static void init_seqspace(ScrArea *sa) -{ - SpaceSeq *sseq; - - sseq= MEM_callocN(sizeof(SpaceSeq), "initseqspace"); - BLI_addhead(&sa->spacedata, sseq); - - sseq->spacetype= SPACE_SEQ; - sseq->zoom= 4; - sseq->blockscale= 0.7; - sseq->chanshown = 0; - - /* seq space goes from (0,8) to (250, 0) */ - - sseq->v2d.tot.xmin= 0.0; - sseq->v2d.tot.ymin= 0.0; - sseq->v2d.tot.xmax= 250.0; - sseq->v2d.tot.ymax= 8.0; - - sseq->v2d.cur= sseq->v2d.tot; - - sseq->v2d.min[0]= 10.0; - sseq->v2d.min[1]= 4.0; - - sseq->v2d.max[0]= 32000.0; - sseq->v2d.max[1]= MAXSEQ; - - sseq->v2d.minzoom= 0.1f; - sseq->v2d.maxzoom= 10.0; - - sseq->v2d.scroll= L_SCROLL+B_SCROLL; - sseq->v2d.keepaspect= 0; - sseq->v2d.keepzoom= 0; - sseq->v2d.keeptot= 0; -} - -/* ******************** SPACE: ACTION ********************** */ -extern void drawactionspace(ScrArea *sa, void *spacedata); -extern void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void changeactionspace(ScrArea *sa, void *spacedata) -{ - if(G.v2d==0) return; - - /* this sets the sub-areas correct, for scrollbars */ - test_view2d(G.v2d, sa->winx, sa->winy); - - /* action space uses weird matrices... local calculated in a function */ - /* myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); */ -} - - -static void init_actionspace(ScrArea *sa) -{ - SpaceAction *saction; - - saction= MEM_callocN(sizeof(SpaceAction), "initactionspace"); - BLI_addhead(&sa->spacedata, saction); - - saction->spacetype= SPACE_ACTION; - saction->blockscale= 0.7; - - saction->v2d.tot.xmin= 1.0; - saction->v2d.tot.ymin= -1000.0; - saction->v2d.tot.xmax= 1000.0; - saction->v2d.tot.ymax= 0.0; - - saction->v2d.cur.xmin= -5.0; - saction->v2d.cur.ymin= -75.0; - saction->v2d.cur.xmax= 65.0; - saction->v2d.cur.ymax= 5.0; - - saction->v2d.min[0]= 0.0; - saction->v2d.min[1]= 0.0; - - saction->v2d.max[0]= 32000.0; - saction->v2d.max[1]= 1000.0; - - saction->v2d.minzoom= 0.01; - saction->v2d.maxzoom= 50; - - saction->v2d.scroll= R_SCROLL+B_SCROLL; - saction->v2d.keepaspect= 0; - saction->v2d.keepzoom= V2D_LOCKZOOM_Y; - saction->v2d.keeptot= 0; - -} - -static void free_actionspace(SpaceAction *saction) -{ - /* don't free saction itself */ - - /* __PINFAKE */ -/* if (saction->flag & SACTION_PIN) - if (saction->action) - saction->action->id.us --; - -*/ /* end PINFAKE */ -} - - -/* ******************** SPACE: FILE ********************** */ - -static void init_filespace(ScrArea *sa) -{ - SpaceFile *sfile; - - sfile= MEM_callocN(sizeof(SpaceFile), "initfilespace"); - BLI_addhead(&sa->spacedata, sfile); - - sfile->dir[0]= '/'; - sfile->type= FILE_UNIX; - sfile->blockscale= 0.7; - sfile->spacetype= SPACE_FILE; -} - - -/* ******************** SPACE: SOUND ********************** */ - -extern void drawsoundspace(ScrArea *sa, void *spacedata); -extern void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void init_soundspace(ScrArea *sa) -{ - SpaceSound *ssound; - - ssound= MEM_callocN(sizeof(SpaceSound), "initsoundspace"); - BLI_addhead(&sa->spacedata, ssound); - - ssound->spacetype= SPACE_SOUND; - ssound->blockscale= 0.7; - /* sound space goes from (0,8) to (250, 0) */ - - ssound->v2d.tot.xmin= -4.0; - ssound->v2d.tot.ymin= -4.0; - ssound->v2d.tot.xmax= 250.0; - ssound->v2d.tot.ymax= 255.0; - - ssound->v2d.cur.xmin= -4.0; - ssound->v2d.cur.ymin= -4.0; - ssound->v2d.cur.xmax= 50.0; - ssound->v2d.cur.ymax= 255.0; - - ssound->v2d.min[0]= 1.0; - ssound->v2d.min[1]= 259.0; - - ssound->v2d.max[0]= 32000.0; - ssound->v2d.max[1]= 259; - - ssound->v2d.minzoom= 0.1f; - ssound->v2d.maxzoom= 10.0; - - ssound->v2d.scroll= B_SCROLL; - ssound->v2d.keepaspect= 0; - ssound->v2d.keepzoom= 0; - ssound->v2d.keeptot= 0; - -} - -void free_soundspace(SpaceSound *ssound) -{ - /* don't free ssound itself */ - - -} - -/* ******************** SPACE: IMAGE ********************** */ - -static void changeimagepace(ScrArea *sa, void *spacedata) -{ - image_preview_event(2); -} - -static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - SpaceImage *sima= spacedata; - unsigned short event= evt->event; - short val= evt->val; - - if(val==0) return; - - if(uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - if (U.flag & USER_LMOUSESELECT) { - if (event == LEFTMOUSE) { - event = RIGHTMOUSE; - } else if (event == RIGHTMOUSE) { - event = LEFTMOUSE; - } - } - - if (sima->image && (sima->flag & SI_DRAWTOOL)) { - switch(event) { - case CKEY: - toggle_blockhandler(sa, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW); - scrarea_queue_winredraw(sa); - break; - case LEFTMOUSE: - imagepaint_paint(L_MOUSE, 0); - break; - case RIGHTMOUSE: - imagepaint_pick(R_MOUSE); - break; - } - } - else if (G.obedit) { - /* Draw tool is inactive, editmode is enabled and the image is not a render or composite */ - if (EM_texFaceCheck() && (G.sima->image==0 || (G.sima->image->type != IMA_TYPE_R_RESULT && G.sima->image->type != IMA_TYPE_COMPOSITE))) { - switch(event) { - case LEFTMOUSE: - if(G.qual == LR_SHIFTKEY) { - if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) { - mouseco_to_curtile(); - } - } else if (!gesture()) { - mouseco_to_cursor_sima(); - } - break; - case RIGHTMOUSE: - mouse_select_sima(); - break; - case AKEY: - select_swap_tface_uv(); - break; - case BKEY: - if(G.qual==LR_SHIFTKEY) - borderselect_sima(UV_SELECT_PINNED); - else if((G.qual==0)) - borderselect_sima(UV_SELECT_ALL); - break; - case CKEY: - if (G.sima->flag & SI_SYNC_UVSEL) { - /* operate on the editmesh */ - if (G.qual==0) { - if (G.scene->selectmode != SCE_SELECT_FACE) { - G.sima->flag ^= SI_SELACTFACE; - scrarea_queue_winredraw(curarea); - } - } else { - error("Sync selection to Edit Mesh disables UV select options"); - } - } else { - /* normal operaton */ - if(G.qual==LR_CTRLKEY) { - G.sima->sticky = SI_STICKY_VERTEX; - scrarea_do_headdraw(curarea); - } else if(G.qual==LR_SHIFTKEY) { - G.sima->sticky = SI_STICKY_DISABLE; - scrarea_do_headdraw(curarea); - } else if(G.qual==LR_ALTKEY) { - G.sima->sticky = SI_STICKY_LOC; - scrarea_do_headdraw(curarea); - } else { - G.sima->flag ^= SI_SELACTFACE; - scrarea_queue_winredraw(curarea); - } - } - break; - case EKEY : - if(okee("Unwrap")) - unwrap_lscm(0); - break; - case HKEY: - if(G.qual==LR_ALTKEY) - reveal_tface_uv(); - else if((G.qual==LR_SHIFTKEY)) - hide_tface_uv(1); - else if((G.qual==0)) - hide_tface_uv(0); - break; - case LKEY: - if(G.qual==0) - select_linked_tface_uv(0); - else if(G.qual==LR_SHIFTKEY) - select_linked_tface_uv(1); - else if(G.qual==LR_CTRLKEY) - select_linked_tface_uv(2); - else if(G.qual==LR_ALTKEY) - unlink_selection(); - break; - case PKEY: - if(G.qual==LR_CTRLKEY) - pack_charts_tface_uv(); - else if(G.qual==LR_SHIFTKEY) - select_pinned_tface_uv(); - else if(G.qual==LR_ALTKEY) - pin_tface_uv(0); - else - pin_tface_uv(1); - break; - case GKEY: - if((G.qual==0) && is_uv_tface_editing_allowed()) { - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - } - break; - case RKEY: - if((G.qual==0) && is_uv_tface_editing_allowed()) { - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - } - break; - case SKEY: - if (is_uv_tface_editing_allowed()) { - if ( G.qual==LR_SHIFTKEY) { - /* Snap */ - snap_menu_sima(); - } else if (G.qual==0) { - initTransform(TFM_RESIZE, CTX_NONE); - Transform(); - } - } - break; - case VKEY: - if(G.qual == 0) - stitch_vert_uv_tface(); - else if(G.qual==LR_SHIFTKEY) - stitch_limit_uv_tface(); - else if(G.qual==LR_CTRLKEY) - minimize_stretch_tface_uv(); - break; - case WKEY: - weld_align_menu_tface_uv(); - break; - case MKEY: - if((G.qual==0)) - mirrormenu_tface_uv(); - break; - case COMMAKEY: - if(G.qual==LR_SHIFTKEY) { - G.v2d->around= V3D_CENTROID; - } else if(G.qual==0) { - G.v2d->around= V3D_CENTER; - } - - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - case PERIODKEY: - if(G.qual==LR_CTRLKEY) { - G.v2d->around= V3D_LOCAL; - } else if(G.qual==0) { - G.v2d->around= V3D_CURSOR; - } - scrarea_queue_headredraw(curarea); - scrarea_queue_winredraw(curarea); - break; - case PADPERIOD: - if(G.qual==0) - image_viewcenter(); - break; - case OKEY: - if(G.qual==0) { - G.scene->proportional= !G.scene->proportional; - allqueue(REDRAWHEADERS, 0); - } else if (G.qual==LR_SHIFTKEY) { - G.scene->prop_mode = (G.scene->prop_mode+1)%7; - allqueue(REDRAWHEADERS, 0); - } - break; - case PADSLASHKEY: - if(G.qual==0) - G.sima->flag ^= SI_LOCAL_UV; - scrarea_queue_winredraw(curarea); - break; - case TABKEY: - if (G.qual == LR_SHIFTKEY) { - G.scene->snap_flag ^= SCE_SNAP; - allqueue(REDRAWHEADERS, 0); - } - break; - } - } - } else { - /* Draw and editmode are inactive */ - switch(event) { - case LEFTMOUSE: - sima_sample_color(); - break; - case RIGHTMOUSE: - if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) - sample_vpaint(); - break; - case NKEY: - if(G.qual==LR_CTRLKEY) - replace_names_but(); - break; - case PKEY: - if(G.qual==LR_SHIFTKEY) { - toggle_blockhandler(sa, IMAGE_HANDLER_PREVIEW, 0); - scrarea_queue_winredraw(sa); - } - break; - } - } - - - /* least intrusive nonumpad hack, only for plus/minus */ - if (U.flag & USER_NONUMPAD) { - event= convert_for_nonumpad(event); - } - - /* Events handled always (whether the draw tool is active or not) */ - switch (event) { - case UI_BUT_EVENT: - do_image_buttons(val); /* header_image.c */ - break; - case MIDDLEMOUSE: - if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY)))) - image_viewmove(1); - else - image_viewmove(0); - break; - case WHEELUPMOUSE: case WHEELDOWNMOUSE: case PADPLUSKEY: case PADMINUS: - case PAD1: case PAD2: case PAD4: case PAD8: - image_viewzoom(event, (G.qual & LR_SHIFTKEY)==0); - scrarea_queue_winredraw(sa); - break; - case HOMEKEY: - if((G.qual==0)) - image_home(); - - break; - case NKEY: - if(G.qual==LR_ALTKEY) { - new_image_sima(); - } else if(G.qual==0) { - /*if (EM_texFaceCheck()) { - toggle_blockhandler(sa, IMAGE_HANDLER_TRANSFORM_PROPERTIES, UI_PNL_TO_MOUSE); - } else { - toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - }*/ - toggle_blockhandler(sa, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); - scrarea_queue_winredraw(sa); - } - break; - case OKEY: - if (G.qual & LR_ALTKEY) - open_image_sima(G.qual & LR_CTRLKEY); - break; - case RKEY: - if(G.qual==LR_ALTKEY) - reload_image_sima(); - break; - case SKEY: - if(G.qual & LR_ALTKEY) - save_image_sima(); - break; - case ESCKEY: - if(sima->flag & SI_PREVSPACE) { - /* only allow ESC once */ - sima->flag &= ~SI_PREVSPACE; - - sima= sa->spacedata.first; - if(sima->next) { - SpaceLink *sl; - - BLI_remlink(&sa->spacedata, sima); - BLI_addtail(&sa->spacedata, sima); - - sl= sa->spacedata.first; - - newspace(sa, sl->spacetype); - } - } - if(sima->flag & SI_FULLWINDOW) { - sima->flag &= ~SI_FULLWINDOW; - if(sa->full) - area_fullscreen(); - } - } -} - - -static void init_imagespace(ScrArea *sa) -{ - SpaceImage *sima; - - sima= MEM_callocN(sizeof(SpaceImage), "initimaspace"); - BLI_addhead(&sa->spacedata, sima); - - sima->spacetype= SPACE_IMAGE; - sima->zoom= 1; - sima->blockscale= 0.7; - - sima->iuser.ok= 1; - sima->iuser.fie_ima= 2; - sima->iuser.frames= 100; -} - - -/* ******************** SPACE: IMASEL ********************** */ - -extern void drawimaselspace(ScrArea *sa, void *spacedata); -extern void winqreadimaselspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void changeimaselspace(ScrArea *sa, void *spacedata) -{ - if(G.v2d==0) return; - - test_view2d(G.v2d, curarea->winx, curarea->winy); - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); -} - -static void init_imaselspace(ScrArea *sa) -{ - SpaceImaSel *simasel; - - simasel= MEM_callocN(sizeof(SpaceImaSel), "init imaselspace"); - BLI_addhead(&sa->spacedata, simasel); - - simasel->spacetype= SPACE_IMASEL; - simasel->blockscale= 0.7; - - /* view 2D */ - simasel->v2d.tot.xmin= -10.0; - simasel->v2d.tot.ymin= -10.0; - simasel->v2d.tot.xmax= (float)sa->winx + 10.0f; - simasel->v2d.tot.ymax= (float)sa->winy + 10.0f; - - simasel->v2d.cur.xmin= 0.0; - simasel->v2d.cur.ymin= 0.0; - simasel->v2d.cur.xmax= (float)sa->winx; - simasel->v2d.cur.ymax= (float)sa->winy; - - simasel->v2d.min[0]= 1.0; - simasel->v2d.min[1]= 1.0; - - simasel->v2d.max[0]= 32000.0f; - simasel->v2d.max[1]= 32000.0f; - - simasel->v2d.minzoom= 0.5f; - simasel->v2d.maxzoom= 1.21f; - - simasel->v2d.scroll= 0; - simasel->v2d.keepaspect= 1; - simasel->v2d.keepzoom= 1; - simasel->v2d.keeptot= 0; - - simasel->prv_h = 96; - simasel->prv_w = 96; - - simasel->flag = 7; /* ??? elubie */ - strcpy (simasel->dir, U.textudir); /* TON */ - strcpy (simasel->file, ""); - - simasel->returnfunc = 0; - simasel->title[0] = 0; - simasel->type = FILE_UNIX; - simasel->files = BIF_filelist_new(); -} - -/* ******************** SPACE: OOPS ********************** */ - -extern void drawoopsspace(ScrArea *sa, void *spacedata); - -static void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt) -{ - unsigned short event= evt->event; - short val= evt->val; - SpaceOops *soops= curarea->spacedata.first; - View2D *v2d= &soops->v2d; - float dx, dy; - - if(val==0) return; - - if( uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - - if (U.flag & USER_NONUMPAD) { - event= convert_for_nonumpad(event); - } - - /* keep leftmouse select for outliner, regardless of user pref */ - if(soops->type==SO_OUTLINER) { - switch(event) { - case LEFTMOUSE: - case RIGHTMOUSE: - outliner_mouse_event(sa, event); - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - soops->storeflag |= SO_TREESTORE_REDRAW; - break; - - case AKEY: - if(G.qual==LR_SHIFTKEY) - outliner_toggle_selected(sa); - else - outliner_toggle_visible(sa); - break; - case FKEY: - { - /* search */ - int search_flags=0, again=0; - - /* CTRL=case sensitive, SHIFT=find again, ALT=complete */ - if (G.qual & LR_CTRLKEY) search_flags |= 1; - if (G.qual & LR_ALTKEY) search_flags |= 8; - if (G.qual & LR_SHIFTKEY) again = 1; - - outliner_find_panel(sa, again, search_flags); - } - break; - case XKEY: - case DELKEY: - outliner_del(sa); - break; - case WKEY: - outliner_operation_menu(sa); - break; - - case HOMEKEY: - outliner_show_hierarchy(sa); - break; - case PAGEUPKEY: - outliner_page_up_down(sa, 1); - break; - case PAGEDOWNKEY: - outliner_page_up_down(sa, -1); - break; - - case RETKEY: - case PADENTER: - outliner_mouse_event(sa, event); - break; - case PERIODKEY: - case PADPERIOD: - outliner_show_active(sa); - break; - case PADPLUSKEY: - outliner_one_level(sa, 1); - break; - case PADMINUS: - outliner_one_level(sa, -1); - break; - } - } - else { - /* swap mouse buttons based on user preference */ - if (U.flag & USER_LMOUSESELECT) { - if (event==LEFTMOUSE) event = RIGHTMOUSE; - else if (event==RIGHTMOUSE) event = LEFTMOUSE; - } - - switch(event) { - case LEFTMOUSE: - gesture(); - break; - case MIDDLEMOUSE: - case WHEELUPMOUSE: - case WHEELDOWNMOUSE: - view2dmove(event); /* in drawipo.c */ - break; - case RIGHTMOUSE: - mouse_select_oops(); - break; - case PADPLUSKEY: - - dx= 0.1154*(v2d->cur.xmax-v2d->cur.xmin); - dy= 0.1154*(v2d->cur.ymax-v2d->cur.ymin); - v2d->cur.xmin+= dx; - v2d->cur.xmax-= dx; - v2d->cur.ymin+= dy; - v2d->cur.ymax-= dy; - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - - case PADMINUS: - - dx= 0.15*(v2d->cur.xmax-v2d->cur.xmin); - dy= 0.15*(v2d->cur.ymax-v2d->cur.ymin); - v2d->cur.xmin-= dx; - v2d->cur.xmax+= dx; - v2d->cur.ymin-= dy; - v2d->cur.ymax+= dy; - test_view2d(G.v2d, curarea->winx, curarea->winy); - scrarea_queue_winredraw(curarea); - break; - - case HOMEKEY: - if((G.qual==0)) - do_oops_buttons(B_OOPSHOME); - break; - - case PADPERIOD: - if((G.qual==0)) - do_oops_buttons(B_OOPSVIEWSEL); - break; - - case AKEY: - if((G.qual==0)) { - swap_select_all_oops(); - scrarea_queue_winredraw(curarea); - } - break; - case BKEY: - if((G.qual==0)) - borderselect_oops(); - break; - case GKEY: - if((G.qual==0)) - transform_oops('g', 0); - break; - case LKEY: - if((G.qual==LR_SHIFTKEY)) - select_backlinked_oops(); - else if((G.qual==0)) - select_linked_oops(); - break; - case SKEY: - if((G.qual==LR_ALTKEY)) { - if (okee("Shrink blocks")) { - shrink_oops(); - } - } else if((G.qual==LR_SHIFTKEY)) { - if (okee("Shuffle blocks")) { - shuffle_oops(); - } - } else if((G.qual==0)) { - transform_oops('s', 0); - } - break; - case PKEY: - if((G.qual==LR_CTRLKEY)) { - make_parent(); - } else if((G.qual==LR_ALTKEY)) { - clear_parent(); - } - break; - - - case ONEKEY: - do_layer_buttons(0); break; - case TWOKEY: - do_layer_buttons(1); break; - case THREEKEY: - do_layer_buttons(2); break; - case FOURKEY: - do_layer_buttons(3); break; - case FIVEKEY: - do_layer_buttons(4); break; - case SIXKEY: - do_layer_buttons(5); break; - case SEVENKEY: - do_layer_buttons(6); break; - case EIGHTKEY: - do_layer_buttons(7); break; - case NINEKEY: - do_layer_buttons(8); break; - case ZEROKEY: - do_layer_buttons(9); break; - case MINUSKEY: - do_layer_buttons(10); break; - case EQUALKEY: - do_layer_buttons(11); break; - case ACCENTGRAVEKEY: - do_layer_buttons(-1); break; - - } - } -} - -void init_v2d_oops(ScrArea *sa, SpaceOops *soops) -{ - View2D *v2d= &soops->v2d; - - if(soops->type==SO_OUTLINER) { - /* outliner space is window size */ - calc_scrollrcts(sa, v2d, sa->winx, sa->winy); - - v2d->tot.xmax= (v2d->mask.xmax-v2d->mask.xmin); - v2d->tot.ymax= (v2d->mask.ymax-v2d->mask.ymin); - v2d->tot.xmin= 0.0; - v2d->tot.ymin= 0.0; - - v2d->cur= v2d->tot; - - v2d->min[0]= v2d->tot.xmin; - v2d->min[1]= v2d->tot.ymin; - - v2d->max[0]= v2d->tot.xmax; - v2d->max[1]= v2d->tot.ymax; - - v2d->minzoom= 1.0; - v2d->maxzoom= 1.0; - - /* B_SCROLLO used here instead of B_SCROLL, to stop old blender's hanging on - * loading a file from a version with horizontal scrolling due to an old bug - */ - v2d->scroll= L_SCROLL+B_SCROLLO; - v2d->keepaspect= 1; - v2d->keepzoom= 1; - - /* NOTE: keeptot is 2, as keeptot!=0 makes sure it does get - * too freely scrolled on x-axis, but keeptot=1 will result - * in a snap-back when clicking on elements - */ - v2d->keeptot= 2; - } - else { - v2d->tot.xmin= -28.0; - v2d->tot.xmax= 28.0; - v2d->tot.ymin= -28.0; - v2d->tot.ymax= 28.0; - - v2d->cur= v2d->tot; - - v2d->min[0]= 10.0; - v2d->min[1]= 4.0; - - v2d->max[0]= 320.0; - v2d->max[1]= 320.0; - - v2d->minzoom= 0.01f; - v2d->maxzoom= 2.0; - - /* v2d->scroll= L_SCROLL+B_SCROLL; */ - v2d->scroll= 0; - v2d->keepaspect= 1; - v2d->keepzoom= 0; - v2d->keeptot= 0; - } -} - -static void init_oopsspace(ScrArea *sa) -{ - SpaceOops *soops; - - soops= MEM_callocN(sizeof(SpaceOops), "initoopsspace"); - BLI_addhead(&sa->spacedata, soops); - - soops->visiflag= OOPS_OB+OOPS_MA+OOPS_ME+OOPS_TE+OOPS_CU+OOPS_IP; - /* new oops is default an outliner */ - soops->type= SO_OUTLINER; - - soops->spacetype= SPACE_OOPS; - soops->blockscale= 0.7; - init_v2d_oops(sa, soops); -} - -/* ******************** SPACE: NLA ********************** */ - -static void init_nlaspace(ScrArea *sa) -{ - SpaceNla *snla; - - snla= MEM_callocN(sizeof(SpaceNla), "initnlaspace"); - BLI_addhead(&sa->spacedata, snla); - - snla->spacetype= SPACE_NLA; - snla->blockscale= 0.7; - - snla->v2d.tot.xmin= 1.0; - snla->v2d.tot.ymin= 0.0; - snla->v2d.tot.xmax= 1000.0; - snla->v2d.tot.ymax= 1000.0; - - snla->v2d.cur.xmin= -5.0; - snla->v2d.cur.ymin= 0.0; - snla->v2d.cur.xmax= 65.0; - snla->v2d.cur.ymax= 1000.0; - - snla->v2d.min[0]= 0.0; - snla->v2d.min[1]= 0.0; - - snla->v2d.max[0]= 1000.0; - snla->v2d.max[1]= 1000.0; - - snla->v2d.minzoom= 0.1F; - snla->v2d.maxzoom= 50; - - snla->v2d.scroll= R_SCROLL+B_SCROLL; - snla->v2d.keepaspect= 0; - snla->v2d.keepzoom= V2D_LOCKZOOM_Y; - snla->v2d.keeptot= 0; - - snla->lock = 0; -} - - - -/* ******************** SPACE: Text ********************** */ - -extern void drawtextspace(ScrArea *sa, void *spacedata); -extern void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void init_textspace(ScrArea *sa) -{ - SpaceText *st; - - st= MEM_callocN(sizeof(SpaceText), "inittextspace"); - BLI_addhead(&sa->spacedata, st); - - st->spacetype= SPACE_TEXT; - st->blockscale= 0.7; - st->text= NULL; - st->flags= 0; - - st->font_id= 5; - st->lheight= 12; - st->showlinenrs= 0; - st->tabnumber = 4; - st->currtab_set = 0; - - st->top= 0; -} - - -/* ******************** SPACE: Script ********************** */ - -extern void drawscriptspace(ScrArea *sa, void *spacedata); -extern void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void init_scriptspace(ScrArea *sa) -{ - SpaceScript *sc; - - sc = MEM_callocN(sizeof(SpaceScript), "initscriptspace"); - BLI_addhead(&sa->spacedata, sc); - - sc->spacetype = SPACE_SCRIPT; - sc->blockscale= 0.7; - sc->script = NULL; - sc->flags = 0; -} - - -/* ******************** SPACE: Time ********************** */ - -extern void drawtimespace(ScrArea *sa, void *spacedata); -extern void winqreadtimespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void init_timespace(ScrArea *sa) -{ - SpaceTime *stime; - - stime= MEM_callocN(sizeof(SpaceTime), "init timespace"); - BLI_addhead(&sa->spacedata, stime); - - stime->spacetype= SPACE_TIME; - stime->blockscale= 0.7; - stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; - - stime->v2d.tot.xmin= -4.0; - stime->v2d.tot.ymin= 0.0; - stime->v2d.tot.xmax= (float)EFRA + 4.0; - stime->v2d.tot.ymax= (float)sa->winy; - - stime->v2d.cur= stime->v2d.tot; - - stime->v2d.min[0]= 1.0; - stime->v2d.min[1]= (float)sa->winy; - - stime->v2d.max[0]= 32000.0; - stime->v2d.max[1]= (float)sa->winy; - - stime->v2d.minzoom= 0.1f; - stime->v2d.maxzoom= 10.0; - - stime->v2d.scroll= 0; - stime->v2d.keepaspect= 0; - stime->v2d.keepzoom= 0; - stime->v2d.keeptot= 0; - - stime->flag |= TIME_DRAWFRAMES; - -} - -/* ******************** SPACE: Nodes ********************** */ - -extern void drawnodespace(ScrArea *sa, void *spacedata); -extern void winqreadnodespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt); - -static void init_nodespace(ScrArea *sa) -{ - SpaceNode *snode; - - snode= MEM_callocN(sizeof(SpaceNode), "init nodespace"); - BLI_addhead(&sa->spacedata, snode); - - snode->spacetype= SPACE_NODE; - snode->blockscale= 0.7; - - snode->v2d.tot.xmin= -10.0; - snode->v2d.tot.ymin= -10.0; - snode->v2d.tot.xmax= (float)sa->winx + 10.0f; - snode->v2d.tot.ymax= (float)sa->winy + 10.0f; - - snode->v2d.cur.xmin= 0.0; - snode->v2d.cur.ymin= 0.0; - snode->v2d.cur.xmax= (float)sa->winx; - snode->v2d.cur.ymax= (float)sa->winy; - - snode->v2d.min[0]= 1.0; - snode->v2d.min[1]= 1.0; - - snode->v2d.max[0]= 32000.0f; - snode->v2d.max[1]= 32000.0f; - - snode->v2d.minzoom= 0.5f; - snode->v2d.maxzoom= 1.21f; - - snode->v2d.scroll= 0; - snode->v2d.keepaspect= 1; - snode->v2d.keepzoom= 1; - snode->v2d.keeptot= 0; -} - - - -/* ******************** SPACE: GENERAL ********************** */ - -void newspace(ScrArea *sa, int type) -{ - int xtra= type & 256; /* hack to enforce outliner with hotkey from toets.c */ - - type &= ~256; - - if(type>=0) { - if(sa->spacetype != type) { - SpaceLink *sl; - - sa->spacetype= type; - sa->headbutofs= 0; - - uiFreeBlocks(&sa->uiblocks); - wich_cursor(sa); - - if (sa->headwin) addqueue(sa->headwin, CHANGED, 1); - scrarea_queue_headredraw(sa); - - addqueue(sa->win, CHANGED, 1); - scrarea_queue_winredraw(sa); - - for (sl= sa->spacedata.first; sl; sl= sl->next) - if(sl->spacetype==type) - break; - - if (sl) { - BLI_remlink(&sa->spacedata, sl); - BLI_addhead(&sa->spacedata, sl); - } else { - if(type==SPACE_VIEW3D) - initview3d(sa); - else if(type==SPACE_IPO) - initipo(sa); - else if(type==SPACE_INFO) - init_infospace(sa); - else if(type==SPACE_BUTS) - init_butspace(sa); - else if(type==SPACE_FILE) - init_filespace(sa); - else if(type==SPACE_SEQ) - init_seqspace(sa); - else if(type==SPACE_IMAGE) - init_imagespace(sa); - else if(type==SPACE_IMASEL) - init_imaselspace(sa); - else if(type==SPACE_OOPS) - init_oopsspace(sa); - else if(type==SPACE_ACTION) - init_actionspace(sa); - else if(type==SPACE_TEXT) - init_textspace(sa); - else if(type==SPACE_SCRIPT) - init_scriptspace(sa); - else if(type==SPACE_SOUND) - init_soundspace(sa); - else if(type==SPACE_NLA) - init_nlaspace(sa); - else if(type==SPACE_TIME) - init_timespace(sa); - else if(type==SPACE_NODE) - init_nodespace(sa); - - sl= sa->spacedata.first; - sl->area= sa; - } - - areawinset(sa->win); - bwin_clear_viewmat(sa->win); - } - } - - - /* exception: filespace */ - if(sa->spacetype==SPACE_FILE) { - SpaceFile *sfile= sa->spacedata.first; - - if(sfile->type==FILE_MAIN) { - freefilelist(sfile); - } else { - sfile->type= FILE_UNIX; - } - - sfile->returnfunc= NULL; - sfile->title[0]= 0; - if(sfile->filelist) test_flags_file(sfile); - } - /* exception: imasel space */ - else if(sa->spacetype==SPACE_IMASEL) { - SpaceImaSel *simasel= sa->spacedata.first; - if(simasel->type==FILE_MAIN) { - if (simasel->files) { - BIF_filelist_free(simasel->files); - BIF_filelist_settype(simasel->files, FILE_MAIN); - } - } else { - if (simasel->files) { - simasel->type= FILE_UNIX; - BIF_filelist_settype(simasel->files, simasel->type); - } - } - simasel->returnfunc= NULL; - simasel->title[0]= 0; - } - else if(sa->spacetype==SPACE_OOPS) { - SpaceOops *so= sa->spacedata.first; - if(xtra && so->type!=SO_OUTLINER) { - so->type= SO_OUTLINER; - init_v2d_oops(sa, so); - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } -} - -void freespacelist(ScrArea *sa) -{ - SpaceLink *sl; - - for (sl= sa->spacedata.first; sl; sl= sl->next) { - if(sl->spacetype==SPACE_FILE) { - SpaceFile *sfile= (SpaceFile*) sl; - if(sfile->libfiledata) - BLO_blendhandle_close(sfile->libfiledata); - if(sfile->filelist) - freefilelist(sfile); - if(sfile->pupmenu) - MEM_freeN(sfile->pupmenu); - } - else if(sl->spacetype==SPACE_BUTS) { - SpaceButs *buts= (SpaceButs*) sl; - if(buts->ri) { - if (buts->ri->rect) MEM_freeN(buts->ri->rect); - MEM_freeN(buts->ri); - } - if(G.buts==buts) G.buts= NULL; - } - else if(sl->spacetype==SPACE_IPO) { - SpaceIpo *si= (SpaceIpo*) sl; - if(si->editipo) MEM_freeN(si->editipo); - free_ipokey(&si->ipokey); - if(G.sipo==si) G.sipo= NULL; - } - else if(sl->spacetype==SPACE_VIEW3D) { - View3D *vd= (View3D*) sl; - if(vd->bgpic) { - if(vd->bgpic->ima) vd->bgpic->ima->id.us--; - MEM_freeN(vd->bgpic); - } - if(vd->localvd) MEM_freeN(vd->localvd); - if(vd->clipbb) MEM_freeN(vd->clipbb); - if(vd->depths) { - if(vd->depths->depths) MEM_freeN(vd->depths->depths); - MEM_freeN(vd->depths); - vd->depths= NULL; - } - retopo_free_view_data(vd); - if(vd->properties_storage) MEM_freeN(vd->properties_storage); - if(G.vd==vd) G.vd= NULL; - if(vd->ri) { - BIF_view3d_previewrender_free(vd); - } - } - else if(sl->spacetype==SPACE_OOPS) { - SpaceOops *so= (SpaceOops *) sl; - free_oopspace(so); - } - else if(sl->spacetype==SPACE_IMASEL) { - SpaceImaSel *simasel= (SpaceImaSel*) sl; - free_imasel(simasel); - } - else if(sl->spacetype==SPACE_ACTION) { - free_actionspace((SpaceAction*)sl); - } - else if(sl->spacetype==SPACE_NLA){ -/* free_nlaspace((SpaceNla*)sl); */ - } - else if(sl->spacetype==SPACE_TEXT) { - free_textspace((SpaceText *)sl); - } - else if(sl->spacetype==SPACE_SCRIPT) { - free_scriptspace((SpaceScript *)sl); - } - else if(sl->spacetype==SPACE_SOUND) { - free_soundspace((SpaceSound *)sl); - } - else if(sl->spacetype==SPACE_IMAGE) { - SpaceImage *sima= (SpaceImage *)sl; - if(sima->cumap) - curvemapping_free(sima->cumap); - if(sima->info_str) - MEM_freeN(sima->info_str); - if(sima->info_spare) - MEM_freeN(sima->info_spare); - if(sima->spare) - IMB_freeImBuf(sima->spare); - } - else if(sl->spacetype==SPACE_NODE) { -/* SpaceNode *snode= (SpaceNode *)sl; */ - } - } - - BLI_freelistN(&sa->spacedata); -} - -/* can be called for area-full, so it should keep interesting stuff */ -void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) -{ - SpaceLink *sl; - - duplicatelist(lb1, lb2); - - /* lb1 is copy from lb2, from lb2 we free stuff, rely on event system to properly re-alloc */ - - sl= lb2->first; - while(sl) { - if(sl->spacetype==SPACE_FILE) { - SpaceFile *sfile= (SpaceFile*) sl; - sfile->libfiledata= NULL; - sfile->filelist= NULL; - sfile->pupmenu= NULL; - sfile->menup= NULL; - } - else if(sl->spacetype==SPACE_VIEW3D) { - View3D *v3d= (View3D*)sl; - BIF_view3d_previewrender_free(v3d); - v3d->depths= NULL; - v3d->retopo_view_data= NULL; - } - else if(sl->spacetype==SPACE_OOPS) { - SpaceOops *so= (SpaceOops *)sl; - so->oops.first= so->oops.last= NULL; - so->tree.first= so->tree.last= NULL; - so->treestore= NULL; - } - else if(sl->spacetype==SPACE_IMASEL) { - SpaceImaSel *simasel= (SpaceImaSel*) sl; - simasel->pupmenu= NULL; - simasel->menup= NULL; - simasel->files = BIF_filelist_new(); - BIF_filelist_setdir(simasel->files, simasel->dir); - BIF_filelist_settype(simasel->files, simasel->type); - /* see SPACE_FILE - elubie */ - } - else if(sl->spacetype==SPACE_NODE) { - SpaceNode *snode= (SpaceNode *)sl; - snode->nodetree= NULL; - } - - sl= sl->next; - } - - /* but some things we copy */ - - sl= lb1->first; - while(sl) { - sl->area= newarea; - - if(sl->spacetype==SPACE_BUTS) { - SpaceButs *buts= (SpaceButs *)sl; - buts->ri= NULL; - } - else if(sl->spacetype==SPACE_FILE) { - SpaceFile *sfile= (SpaceFile*) sl; - sfile->menup= NULL; - } - else if(sl->spacetype==SPACE_IPO) { - SpaceIpo *si= (SpaceIpo *)sl; - si->editipo= NULL; - si->ipokey.first= si->ipokey.last= NULL; - } - else if(sl->spacetype==SPACE_VIEW3D) { - View3D *vd= (View3D *)sl; - if(vd->bgpic) { - vd->bgpic= MEM_dupallocN(vd->bgpic); - if(vd->bgpic->ima) vd->bgpic->ima->id.us++; - } - vd->clipbb= MEM_dupallocN(vd->clipbb); - vd->ri= NULL; - vd->properties_storage= NULL; - } - else if(sl->spacetype==SPACE_IMAGE) { - SpaceImage *sima= (SpaceImage *)sl; - if(sima->cumap) - sima->cumap= curvemapping_copy(sima->cumap); - if(sima->info_str) - sima->info_str= MEM_dupallocN(sima->info_str); - if(sima->info_spare) - sima->info_spare= MEM_dupallocN(sima->info_spare); - } - sl= sl->next; - } - - /* again: from old View3D restore localview (because full) */ - sl= lb2->first; - while(sl) { - if(sl->spacetype==SPACE_VIEW3D) { - View3D *v3d= (View3D*) sl; - if(v3d->localvd) { - restore_localviewdata(v3d); - v3d->localvd= NULL; - v3d->properties_storage= NULL; - v3d->localview= 0; - v3d->lay &= 0xFFFFFF; - } - } - sl= sl->next; - } -} - -/* is called everywhere in blender */ -void allqueue(unsigned short event, short val) -{ - ScrArea *sa; - View3D *v3d; - SpaceButs *buts; - SpaceFile *sfile; - - sa= G.curscreen->areabase.first; - while(sa) { - - if(event==REDRAWALL) { - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - else if(sa->win != val) { - switch(event) { - - case REDRAWHEADERS: - scrarea_queue_headredraw(sa); - break; - case REDRAWVIEW3D: - if(sa->spacetype==SPACE_VIEW3D) { - scrarea_queue_winredraw(sa); - if(val) scrarea_queue_headredraw(sa); - } - break; - case REDRAWVIEW3D_Z: - if(sa->spacetype==SPACE_VIEW3D) { - v3d= sa->spacedata.first; - if(v3d->drawtype==OB_SOLID) { - scrarea_queue_winredraw(sa); - if(val) scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWVIEW3D_IMAGE: - if(sa->spacetype==SPACE_VIEW3D || sa->spacetype==SPACE_IMAGE) { - scrarea_queue_winredraw(sa); - if(val) scrarea_queue_headredraw(sa); - } - break; - case REDRAWVIEWCAM: - if(sa->spacetype==SPACE_VIEW3D) { - v3d= sa->spacedata.first; - if(v3d->persp>1) scrarea_queue_winredraw(sa); - } - break; - case REDRAWINFO: - if(sa->spacetype==SPACE_INFO) { - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - break; - case REDRAWIMAGE: - if(sa->spacetype==SPACE_IMAGE) { - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - break; - case REDRAWIPO: - if(sa->spacetype==SPACE_IPO) { - SpaceIpo *si; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - if(val) { - si= sa->spacedata.first; - if (si->pin==0) - si->blocktype= val; - } - } - else if(sa->spacetype==SPACE_OOPS) { - scrarea_queue_winredraw(sa); - } - - break; - - case REDRAWBUTSALL: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - break; - case REDRAWBUTSHEAD: - if(sa->spacetype==SPACE_BUTS) { - scrarea_queue_headredraw(sa); - } - break; - case REDRAWBUTSSCENE: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_SCENE) { - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWBUTSOBJECT: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_OBJECT) { - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWBUTSSHADING: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_SHADING) { - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWBUTSEDIT: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_EDITING) { - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWBUTSSCRIPT: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_SCRIPT) { - buts->re_align= 1; - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - case REDRAWBUTSLOGIC: - if(sa->spacetype==SPACE_BUTS) { - buts= sa->spacedata.first; - if(buts->mainb==CONTEXT_LOGIC) { - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - } - break; - - case REDRAWDATASELECT: - if(sa->spacetype==SPACE_FILE) { - sfile= sa->spacedata.first; - if(sfile->type==FILE_MAIN) { - freefilelist(sfile); - scrarea_queue_winredraw(sa); - } - } - else if(sa->spacetype==SPACE_OOPS) { - scrarea_queue_winredraw(sa); - } - break; - case REDRAWSEQ: - if(sa->spacetype==SPACE_SEQ) { - addqueue(sa->win, CHANGED, 1); - scrarea_queue_winredraw(sa); - scrarea_queue_headredraw(sa); - } - break; - case REDRAWOOPS: - if(sa->spacetype==SPACE_OOPS) { - scrarea_queue_winredraw(sa); - } - break; - case REDRAWNLA: - if(sa->spacetype==SPACE_NLA) { - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } - case REDRAWACTION: - if(sa->spacetype==SPACE_ACTION) { - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } - break; - case REDRAWTEXT: - if(sa->spacetype==SPACE_TEXT) { - scrarea_queue_winredraw(sa); - } - break; - case REDRAWSCRIPT: - if (sa->spacetype==SPACE_SCRIPT) { - scrarea_queue_winredraw(sa); - } - break; - case REDRAWSOUND: - if(sa->spacetype==SPACE_SOUND) { - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } - break; - case REDRAWTIME: - if(sa->spacetype==SPACE_TIME) { - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } - break; - case REDRAWNODE: - if(sa->spacetype==SPACE_NODE) { - scrarea_queue_headredraw(sa); - scrarea_queue_winredraw(sa); - } - break; - case RECALC_COMPOSITE: - if(sa->spacetype==SPACE_NODE) { - addqueue(sa->win, UI_BUT_EVENT, B_NODE_TREE_EXEC); - } - break; - case REDRAWANIM: - if ELEM6(sa->spacetype, SPACE_IPO, SPACE_SOUND, SPACE_TIME, SPACE_NLA, SPACE_ACTION, SPACE_SEQ) { - scrarea_queue_winredraw(sa); - if(val) scrarea_queue_headredraw(sa); - } - case REDRAWMARKER: /* markers may not always match animation */ - if ELEM6(sa->spacetype, SPACE_TIME, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_SOUND, SPACE_SEQ) { - scrarea_queue_winredraw(sa); - if(val) scrarea_queue_headredraw(sa); - } - } - } - sa= sa->next; - } -} - -void allspace(unsigned short event, short val) -{ - bScreen *sc; - - sc= G.main->screen.first; - while(sc) { - ScrArea *sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - switch(event) { - case REMAKEIPO: - if(sl->spacetype==SPACE_IPO) { - SpaceIpo *si= (SpaceIpo *)sl; - { - if(si->editipo) MEM_freeN(si->editipo); - si->editipo= 0; - free_ipokey(&si->ipokey); - } - } - break; - - case OOPS_TEST: - if(sl->spacetype==SPACE_OOPS) { - SpaceOops *so= (SpaceOops *)sl; - so->flag |= SO_TESTBLOCKS; - } - break; - } - - sl= sl->next; - } - sa= sa->next; - } - sc= sc->id.next; - } -} - -/* if header==1, then draw header for curarea too. Excepption for headerprint()... */ -void force_draw(int header) -{ - /* draws all areas that show something identical to curarea */ - extern int afterqtest(short win, unsigned short evt); /*editscreen.c*/ - ScrArea *tempsa, *sa; - - scrarea_do_windraw(curarea); - if(header) scrarea_do_headdraw(curarea); - - tempsa= curarea; - sa= G.curscreen->areabase.first; - while(sa) { - if(sa!=tempsa && sa->spacetype==tempsa->spacetype) { - areawinset(sa->win); - scrarea_do_windraw(sa); - scrarea_do_headdraw(sa); - } - sa= sa->next; - } - - screen_swapbuffers(); - -#ifndef __APPLE__ - if(tempsa->spacetype==SPACE_VIEW3D) { - /* de the afterqueuetest for backbuf draw */ - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==SPACE_VIEW3D) { - if(afterqtest(sa->win, BACKBUFDRAW)) { - areawinset(sa->win); - backdrawview3d(0); - } - } - sa= sa->next; - } - } -#endif - if(curarea!=tempsa) areawinset(tempsa->win); - -} - -/* if header==1, then draw header for curarea too. Exception for headerprint()... */ -void force_draw_plus(int type, int header) -{ - /* draws all areas that show something like curarea AND areas of 'type' */ - ScrArea *tempsa, *sa; - - scrarea_do_windraw(curarea); - if(header) scrarea_do_headdraw(curarea); - - tempsa= curarea; - sa= G.curscreen->areabase.first; - while(sa) { - if(sa!=tempsa && (sa->spacetype==tempsa->spacetype || sa->spacetype==type)) { - if(ELEM5(sa->spacetype, SPACE_VIEW3D, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION)) { - areawinset(sa->win); - scrarea_do_windraw(sa); - scrarea_do_headdraw(sa); - } - } - sa= sa->next; - } - if(curarea!=tempsa) areawinset(tempsa->win); - - screen_swapbuffers(); -} - -/* if header==1, then draw header for curarea too. Excepption for headerprint()... */ -void force_draw_all(int header) -{ - /* redraws all */ - ScrArea *tempsa, *sa; - - tempsa= curarea; - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->headwin) { - scrarea_do_headdraw(sa); - if(sa!=curarea || header) scrarea_do_headchange(sa); - } - if(sa->win) { - scrarea_do_windraw(sa); - } - sa= sa->next; - } - if(curarea!=tempsa) areawinset(tempsa->win); - - screen_swapbuffers(); -} - -/***/ - -SpaceType *spaceaction_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Action"); - spacetype_set_winfuncs(st, NULL, drawactionspace, changeactionspace, winqreadactionspace); - } - - return st; -} -SpaceType *spacebuts_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Buts"); - spacetype_set_winfuncs(st, NULL, drawbutspace, changebutspace, winqreadbutspace); - } - - return st; -} -SpaceType *spacefile_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("File"); - spacetype_set_winfuncs(st, NULL, drawfilespace, NULL, winqreadfilespace); - } - - return st; -} -SpaceType *spaceimage_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Image"); - spacetype_set_winfuncs(st, NULL, drawimagespace, changeimagepace, winqreadimagespace); - } - - return st; -} -SpaceType *spaceimasel_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Imasel"); - spacetype_set_winfuncs(st, NULL, drawimaselspace, changeimaselspace, winqreadimaselspace); - } - - return st; -} -SpaceType *spaceinfo_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Info"); - spacetype_set_winfuncs(st, NULL, drawinfospace, NULL, winqreadinfospace); - } - - return st; -} -SpaceType *spaceipo_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Ipo"); - spacetype_set_winfuncs(st, NULL, drawipospace, changeview2dspace, winqreadipospace); - } - - return st; -} -SpaceType *spacenla_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Nla"); - spacetype_set_winfuncs(st, NULL, drawnlaspace, changeview2dspace, winqreadnlaspace); - } - - return st; -} -SpaceType *spaceoops_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Oops"); - spacetype_set_winfuncs(st, NULL, drawoopsspace, changeview2dspace, winqreadoopsspace); - } - - return st; -} -SpaceType *spaceseq_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Sequence"); - spacetype_set_winfuncs(st, drawprefetchseqspace, drawseqspace, changeview2dspace, winqreadseqspace); - } - - return st; -} -SpaceType *spacesound_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Sound"); - spacetype_set_winfuncs(st, NULL, drawsoundspace, changeview2dspace, winqreadsoundspace); - } - - return st; -} -SpaceType *spacetext_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Text"); - spacetype_set_winfuncs(st, NULL, drawtextspace, NULL, winqreadtextspace); - } - - return st; -} - -static void spacescript_change(ScrArea *sa, void *spacedata) -{ - SpaceScript *sc = (SpaceScript*) spacedata; - - /*clear all temp button references*/ - if (sc->but_refs) { - BPy_Set_DrawButtonsList(sc->but_refs); - BPy_Free_DrawButtonsList(); - sc->but_refs = NULL; - } -} - -SpaceType *spacescript_get_type(void) -{ - static SpaceType *st = NULL; - - if (!st) { - st = spacetype_new("Script"); - spacetype_set_winfuncs(st, NULL, drawscriptspace, spacescript_change, winqreadscriptspace); - } - - return st; -} -SpaceType *spaceview3d_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("View3D"); - spacetype_set_winfuncs(st, NULL, drawview3dspace, changeview3dspace, winqreadview3dspace); - } - - return st; -} -SpaceType *spacetime_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Time"); - spacetype_set_winfuncs(st, NULL, drawtimespace, NULL, winqreadtimespace); - } - - return st; -} - -SpaceType *spacenode_get_type(void) -{ - static SpaceType *st= NULL; - - if (!st) { - st= spacetype_new("Node"); - spacetype_set_winfuncs(st, NULL, drawnodespace, changeview2dspace, winqreadnodespace); - } - - return st; -} diff --git a/source/blender/src/spacetypes.c b/source/blender/src/spacetypes.c deleted file mode 100644 index 4a0375f2366..00000000000 --- a/source/blender/src/spacetypes.c +++ /dev/null @@ -1,161 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "BLI_blenlib.h" - -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BIF_gl.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_spacetypes.h" - -/***/ - -struct _SpaceType { - char name[32]; - - SpacePrefetchDrawFP winprefetchdraw; - SpaceDrawFP windraw; - SpaceChangeFP winchange; - SpaceHandleFP winhandle; -}; - -/* local prototypes ----------------------- */ -void scrarea_do_windraw(ScrArea *area); -void scrarea_do_winchange(ScrArea *area); -void scrarea_do_winhandle(ScrArea *area, BWinEvent *evt); - -SpaceType *spacetype_new(char *name) -{ - SpaceType *st= calloc(1, sizeof(*st)); - BLI_strncpy(st->name, name, sizeof(st->name)); - - return st; -} - -void spacetype_set_winfuncs(SpaceType *st, SpacePrefetchDrawFP prefetchdraw, SpaceDrawFP draw, SpaceChangeFP change, SpaceHandleFP handle) -{ - st->winprefetchdraw = prefetchdraw; - st->windraw= draw; - st->winchange= change; - st->winhandle= handle; -} - - /* gets SpaceType struct, but also has patch to initialize unknown spacetypes */ - -static SpaceType *spacetype_from_area(ScrArea *area) -{ - switch (area->spacetype) { - case SPACE_ACTION: return spaceaction_get_type(); - case SPACE_BUTS: return spacebuts_get_type(); - case SPACE_FILE: return spacefile_get_type(); - case SPACE_IMAGE: return spaceimage_get_type(); - case SPACE_IMASEL: return spaceimasel_get_type(); - case SPACE_INFO: return spaceinfo_get_type(); - case SPACE_IPO: return spaceipo_get_type(); - case SPACE_NLA: return spacenla_get_type(); - case SPACE_OOPS: return spaceoops_get_type(); - case SPACE_SEQ: return spaceseq_get_type(); - case SPACE_SOUND: return spacesound_get_type(); - case SPACE_TEXT: return spacetext_get_type(); - case SPACE_SCRIPT: return spacescript_get_type(); - case SPACE_VIEW3D: return spaceview3d_get_type(); - case SPACE_TIME: return spacetime_get_type(); - case SPACE_NODE: return spacenode_get_type(); - default: - newspace(area, SPACE_VIEW3D); - return spaceview3d_get_type(); - return NULL; - } -} - -void scrarea_do_winprefetchdraw(ScrArea *area) -{ - SpaceType *st= spacetype_from_area(area); - - areawinset(area->win); - - if(area->win && st->winprefetchdraw) { - st->winprefetchdraw(area, area->spacedata.first); - } -} - -void scrarea_do_windraw(ScrArea *area) -{ - SpaceType *st= spacetype_from_area(area); - - areawinset(area->win); - - if(area->win && st->windraw) { - st->windraw(area, area->spacedata.first); - } - else { - glClearColor(0.4375, 0.4375, 0.4375, 0.0); - glClear(GL_COLOR_BUFFER_BIT); - } - - area->win_swap= WIN_BACK_OK; -} -void scrarea_do_winchange(ScrArea *area) -{ - SpaceType *st= spacetype_from_area(area); - - areawinset(area->win); - - if (st->winchange) { - st->winchange(area, area->spacedata.first); - } else { - if (!BLI_rcti_is_empty(&area->winrct)) { - bwin_ortho2(area->win, -0.375, area->winrct.xmax-area->winrct.xmin-0.375, -0.375, area->winrct.ymax-area->winrct.ymin-0.375); - glLoadIdentity(); - } - } -} -void scrarea_do_winhandle(ScrArea *area, BWinEvent *evt) -{ - SpaceType *st= spacetype_from_area(area); - - areawinset(area->win); - - if (st->winhandle) { - st->winhandle(area, area->spacedata.first, evt); - } -} diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c deleted file mode 100644 index c1ca8b575e6..00000000000 --- a/source/blender/src/splash.jpg.c +++ /dev/null @@ -1,2483 +0,0 @@ -/* DataToC output of file */ - -int datatoc_splash_jpg_size= 79258; -char datatoc_splash_jpg[]= { -255,216,255,224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0,255,225, 0, 22, 69,120, -105,102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0,255,219, 0, 67, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,219, 0, 67, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,255,192, 0, 17, - 8, 1, 15, 1,245, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1,255,196, 0, 31, 0, 0, 1, 3, 5, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 7, 10, 3, 5, 6, 8, 9, 2, 1, 11,255,196, 0,103, 16, 0, 1, 3, 3, 2, 4, 3, 4, 6, 4, 7, - 11, 5, 9, 13, 9, 1, 2, 3, 4, 5, 6, 17, 0, 7, 8, 18, 33, 49, 19, 65, 81, 9, 20, 34, 97, 10, 21,113,129,145,240, 35, - 50,161,193, 22, 23, 24, 66,177,209,225, 25, 26, 36, 40, 51, 56, 73, 82, 98,232,241, 72,104,105,136,168, 41, 52, 57, 67, 84, 88, -120,150,178, 37, 38, 68, 83, 87,115,130,135,147,152,181,200,210, 54, 89, 99,114,146,184,213,214,215,255,196, 0, 29, 1, 0, 0, - 6, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 5, 6, 7, 1, 4, 8, 9,255,196, 0, 80, 17, 0, 2, 1, - 2, 4, 4, 3, 4, 6, 7, 5, 7, 0, 7, 9, 0, 1, 2, 3, 4, 17, 0, 5, 18, 33, 6, 19, 49, 65, 7, 34, 81, 20, 97,113, -240, 8, 35, 50,129,161,209, 21, 66, 82,145,177,193,210, 36, 51, 98,162,225, 9, 67, 83, 84,114,130,241, 52, 56, 68, 85,116,148, -211, 22, 23, 24,115,131,146,147,180,181,255,218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0,159,198,150,150,150,134, 6, 22, -150,150,190,100,122,143,199, 67, 3, 31,116,203,220, 60, 68,108,181,171,123, 70,219,170,254,224,209, 41,183,140,167, 25,101, 20, -135,189,241, 73,101,249, 28,165,136,243,170, 77, 69, 84, 74,116,149,133,163,149,185, 15,180,226,185,211,132,158, 97,151,159, 35, -212,126, 35, 92,108,227, 63,131, 43,145, 85,251,143,120, 54,213, 18,235,236, 86, 37,191, 87,185,237,148,243, 72,170, 67,146,224, - 11,147, 81,162,128, 57,167, 69, 42, 5, 75,143,213,230,242, 75, 94, 34, 50,148, 86,158, 42,113, 39, 27,112,159, 14, 38,119,193, - 60, 55, 23, 19,212, 81,204,173, 89, 4,134, 67, 34,209,128,198, 87,130, 56,138,188,146, 2, 0,242,151, 49,169, 50,114,101, 1, -128,179,188, 40,225,158, 7,226,222, 37,108,143,142, 56,150,110, 23,166,172,133,150,142,120,196, 98, 54,173, 44,162, 36,158, 73, - 85,146, 56,200, 44,124,193, 4,140, 4,124,232,139, 41, 61,145,109,196, 58,132,173,181, 37,104, 80,200, 82, 72, 32,131,243, 26, -247,174, 11,240,211,199, 61,219,180,206, 66,179, 55, 36, 79,186,108,118, 29, 68, 54,166, 58, 92,122,228,181,217, 65, 13, 22,219, - 47, 30,106,157, 61,174, 95,242, 14, 16,243, 97, 37, 45, 44,128,150,181,219,219, 46,247,181,247, 6,129, 2,231,180, 43, 48,171, -148,106,139, 65,216,211, 33, 58, 29, 65,232, 57,219,113, 63,172,203,233, 86, 66,219, 88, 74,208,160, 66,146, 14,147,240,211,197, -174, 19,241, 67, 46, 53, 25, 37, 79,179,102,180,202, 13, 86, 95, 49, 2,166,156,244, 38,219, 9, 97,213,178,207, 29,212,220, 7, - 17,201,120,194,158, 38,248, 69,197,190, 22,102, 66,159, 60,166,246,156,166,165,136,165,204, 33, 4,210,212,142,160, 95,115, 12, -218,119,104, 36,179, 11, 18,134, 72,237, 33,202,244,180,180,181,103,226,173,194,210,210,210,208,192,194,210,210,210,208,192,194, -210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210, -215, 13,125,163,254,220, 13,158,224,130,240,159,178,214, 5,156,238,249,111,173, 45,150, 21,116, 81,219,173,155,110,200,219,199, - 39,194, 98,116, 8,215, 53,192,138,116,167,170,213,245, 68,151, 17,255, 0,171, 32,177,132, 50,233, 76,186,132, 39,249, 26, 91, -214, 67,195,217,207, 19,102, 9,149,228,116, 47, 95, 90,224,177, 85, 42,161, 80, 16, 11,200,238, 85, 35, 64, 72, 5,157,128,185, - 10, 46,204, 1, 98,226, 46, 38,200,248, 79, 45,124,219,136, 51, 20,203,104, 81,130, 6, 96,204,206,237,114,169, 28,104, 26, 73, - 28,128, 78,148, 86, 58, 85,152,128,170,196,119, 43, 75, 80,124, 63, 73,159,141,131, 84, 83,195,103, 56, 94, 20, 82,242,212,138, -127,240,103,117, 13, 77, 44, 20,171,195,105, 85,127,227,115,194, 91,193,101, 37, 75, 16,146, 20, 1, 1,180,147,204, 58,247,192, - 39,183,219,102,184,168,189,173,253,156,222,171, 32,236, 38,233,221, 18,227,210,109, 58,154,110, 6,238, 13,182,188,107,111,132, -162, 53, 29,138,204,184,113, 36,218,181,233,114, 84, 26,131, 10, 91, 82, 88,144,233, 68,118,234,107,152,244,120,206,205,115,175, - 7,248,243, 35,161,151, 49,169,202, 86,166,150,157, 75,200,105,230,142,102,141, 64,185,102,140, 17, 33, 10, 55, 98,138,225, 64, - 44,108,160,156, 64,178, 47, 27,188, 58,226, 12,194, 28,174,151, 57,106, 90,186,150, 9, 16,169,134, 72, 82, 71, 38,202,171, 35, - 3, 26,179, 27, 5, 18, 50, 22, 36, 42,130,196, 12, 72, 35, 75, 94, 80,180,173, 41, 90, 8, 82, 84, 1, 73, 29, 65, 7,204, 29, -122,213, 97,139,107, 11, 75, 75, 94, 29,117,182, 91,113,231,156, 67, 76,180,133, 56,235,174, 41, 40,109,182,208,146,165,184,226, -212, 64, 66, 2, 65, 36,147,128, 6, 78,134, 6, 61,233,107,140, 28, 63,123, 94,236,238, 39,253,160,119,151, 9,219, 61,108,210, - 43,219, 63,103, 88,247, 29, 77,157,231, 77, 86, 91,178,239, 43,178,215,171, 80,169,213, 69,219, 84,214,227,166, 57,178,252,106, -195,236,197,150, 92,117, 83,126,173,247,214, 23,238,178, 89, 3,231,181,219,218,129,127,123, 56, 15, 15,137,177,182,194,209,220, -115,188,169,221, 85, 85, 13,213, 86,172,210,254,165,254, 47, 78,219,136, 94,225,245, 74, 79,188,123,199,240,222, 95,139,226,126, -167,184,183,201,250,202,212,182, 30, 7,226,105,179,220,183,134,191, 71,242,179,156,218, 1, 81, 12, 50, 72,136,121, 70, 41, 38, - 5,203, 48, 17,183, 46, 39, 37, 28,171,130, 52,149, 12,109,136, 92,222, 32,240,164, 60, 61,154,241, 87,233, 46,118, 69,147, 78, -105,167,158, 56,228,145,121,162,104,160, 34, 48,170, 90, 84,230,202,138, 36,140, 50, 48, 58,149,138,139,227,180, 26, 90,134, 23, -247,207,155,251,255, 0,155, 30,209,127,235, 93,227,255, 0,232,210,254,249,243,127,127,243, 99,218, 47,253,107,188,127,253, 26, -152,127,247, 29,226, 55,254,233,139,255, 0,155,166,255, 0,234, 98, 19,255, 0,226, 11,194,239,253,245, 55,255, 0, 37, 87,255, - 0,210,196,207,116,181,166,252, 3,241, 57, 89,226,255, 0,133,157,171,223,235,138,219,165,218, 85,203,250,153, 89,157, 81,183, -232,178,101,204,165,211,157,166, 93, 53,202, 3,109,195,147, 56,120,175, 33,108, 82,154,113, 69,125, 66,221, 80, 29, 0,214,228, -106,172,174,163,168,203,171,107, 50,250,180, 17,213, 80, 75, 36, 50,168, 33,128,146, 39, 40,224, 48, 36, 16, 25, 72,184, 36, 30, -160,219, 22,246, 95, 93, 77,154, 80, 80,230, 84,110,100,163,204, 97,138,120,152,130,165,163,153, 22, 68, 37, 88, 6, 82, 85,129, - 32,128, 71, 66, 47,133,165,165,165,173, 92,110, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105, -105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,105,104, 96, 97,105,105,107, - 3,168,110, 45, 6, 60,249,116,122, 75, 21,123,182,183, 5,239,118,155, 75,181, 41,174, 85, 12, 9, 92,174,168,197,170, 85,150, -166,169,212,105, 67,194, 32,183, 54,108,117,130,164,229, 32, 40, 29, 12, 12,103,154, 90,104,166,239, 21, 38,143, 91,167,219,119, - 13,169,123,209, 43,245,152, 83, 39,208,233, 9,165, 83, 46,121,213,134, 41,225,159,126, 83, 12, 88,181,170,177,130,134,188, 97, -151, 38,251,171, 42,228, 95, 35,139,228, 86, 47,143, 95, 53, 54,130,157,111,109,119, 6, 76, 70,208, 28,118, 91, 44, 90, 40, 45, -183,221,106, 77, 58, 85,222,220,217, 43, 74,114, 75,108,197,113,213, 99,149,182,214,178, 18, 70, 6, 28, 29, 45, 88,232, 23, 37, - 18,231,136,236,202, 36,244, 76,110, 60,135, 33,205, 97, 77,191, 18,125, 54,115, 56, 47, 83,234,212,201,141, 55, 38,149, 80, 64, - 82, 10,216,146,211, 78,164, 45, 36,160, 5, 2,111,154, 24, 24, 90, 90, 90, 90, 24, 24, 90, 90, 90, 90, 24, 24, 99,120,143,168, -110,117, 51,103,174,233, 91, 65, 29,201, 23,200,138,203,116,255, 0,119,109,167,170, 12, 69,114, 67,104,169, 72,165, 50,240, 40, -118,166,136, 69,226,200, 32,144,175,137, 0,184, 17,174, 20, 60,223, 25, 18, 95,121,199,215,190,238, 72, 83,138, 83,202, 92,139, -187,156,186,165, 18,178,175,210,126,183, 54,117, 36,133, 36, 40, 16,160, 8, 61, 8, 35, 32,253,218,208,158, 40, 56,198,176, 54, - 85,185,246,165,163, 22,151,119,238,105, 66,153, 92, 54,212,151,168,214,187,171, 78, 67,245,249, 12, 43,244,179, 83,148,148,194, -109, 65,206,185,121,108,167,148, 47,157, 60,116,224,190, 27,204, 99,139,140, 56,175,196,124,203,131,114,188,170, 14, 66,193, 75, - 56, 17, 77, 38,167,144,114, 96,182,185, 42,165,190,146, 16, 51, 50, 70,132,233, 84,102,199, 72,120, 15,198,220, 77,151, 75, 55, - 7,112,151,134,185,103, 26,102,153,172,252,246,158,170, 2,101,134, 61, 49,198,121,211,223, 68,116,145, 17,172, 23,210,170,242, - 53,139, 51,170,227,143,215, 53,223,196,133,153,238,191,194,219,167,117,237,195, 59,196,247, 52,214,107,151, 20, 5,201, 13, 99, -196, 83, 45,200,148,149, 45, 41, 42, 0,144, 49,147,140,231, 88,195, 91,199,188,114, 93,109,134, 55, 39,112,100, 60,226,194, 90, -101,171,158,186,235,142, 44,159,133, 40,109, 50,201, 90,179,216, 0, 78,177,155,198,244,186,247, 18,225,151,114, 93,181,137,181, -218,221, 69,209,207, 34, 82,202,131,105, 39, 13, 68,134,194,112,136,145, 17,156, 33,166,210,148, 36,118, 25, 36,157,221,188, 47, - 45,145,246,104,112,186,239, 19, 59,221, 70, 93,217,123,214,159,133, 73,179,173, 8,106,140,213,106,227,187, 42,177, 94,153, 78, -181,233, 18, 37,182,177, 72,167,177, 22, 51,207,212,167,150,214, 25,110, 59,132, 37,229,170, 52,119,121, 7,194,159, 15,120,203, -198,222, 60,159,134,248, 23,136, 51,106,108,146, 23, 75,212, 85,212,201, 45, 66,164,141,162, 37, 49,195, 36, 81, 52,243,178,187, - 44, 97,214, 56,145, 92,188,204,177,150,110,196,241,107,196,110, 10,240, 51,128, 32,226,126, 62,225,252,162,167, 58,153, 28,251, - 61, 37, 52,112,211, 51, 70,161,230, 97, 36,209,203, 42,211,192,172,138,210, 20,105, 37,118,141, 82, 21,105, 2,174,163, 72,218, -189,222,170,162, 69,126, 85,135,123,206, 76,183, 23, 46, 77, 77,218, 13, 81,227, 33,199,137, 91,146, 29,120,199, 37,106, 82,148, - 73, 81,238, 73, 58,203,118, 91,127, 55, 47,135,155,149,114,173,233, 18, 19, 1,201, 8, 23, 5,159, 86, 18, 27,166,212,210,217, -229, 80,122, 50,192, 84, 10,130, 81,144,135,219, 1,196,246, 80, 91,101, 77,171,150, 85, 47,164,143,198, 35,151, 97,170, 81,118, -183, 97,169, 54,130, 37,133,179,102, 61,111, 92, 53, 14,120, 40, 95,195, 22, 93,192,171,133,185, 46, 62,166,176, 22,235, 65,161, -204, 74,144,218, 6, 18, 59,121,195,151, 16, 59, 31,237,121,225,250,232,188,108,251, 74, 62,216,241, 35,181,232,138,205,221,106, - 37,246,165,173,185,210, 97,201,126,152,244, 42,139,108,182,186,213,159, 85, 16,103, 34, 50,222,109, 50, 33,200,136,182, 92, 7, -194, 14,201,234,207, 16,126,128,222, 38,248, 71,147,143, 16,120, 59,138,106, 38,207, 50,127,174,217,162, 46,210, 29,204,124,216, -156,104,105,141,227, 9, 42, 77, 79, 51,176,134, 89, 64,146,237,200,222, 28,127,180, 43,194,191, 25, 51,195,225,207, 24,112,181, - 60, 89, 30,113,245, 32, 50,202, 17, 98, 29, 36, 17, 76,191, 88,176,139, 72,205, 19,193, 81, 10, 35, 77, 20, 76, 99, 32,118, 27, - 96,248,137,177,183,250,218, 21,123,106, 66,161,213,225, 37,166,235,214,228,213,160, 84,232,242,156, 78, 64,113, 41, 56,147, 13, -101, 43,240,159, 71,192,224, 65, 7,149,105, 90, 19,106,226, 39,139,222, 29,184, 78,110,198,145,196, 38,229, 82,246,206, 6,226, -214, 42, 20, 27, 86,171, 91,137, 84, 93, 38, 85, 78,151, 17,153,211, 89,157, 82,131, 5,214,105, 13,162, 43,237,171,196,148,182, - 91, 86, 72, 74,138,129, 26,224,102,199,110,133,115, 99,247, 86,135,116,199, 84,134, 26,129, 81,250,170,231,166, 5,148, 9,180, -119, 95, 17,234,144,223,108, 28, 41,230,185, 75,173,103, 33, 47,197, 65,236, 8, 56,167,210,118,170,198,173,240,251,194, 53, 82, - 35,168,126, 52,237,202,189, 36,178,235,106, 10,109,214,222,179,169,238, 54,226, 20, 58, 41, 37, 10, 4, 31, 67,171, 87,232,151, -199,112,248,245, 61, 22, 67,196,119,203,243,234, 9,141, 61,127,179,133, 66,234,105,230,150, 10,168,209,213,213, 57,175, 11,164, -177,216,133,120,223, 78,133,116, 11, 85,125, 48,120, 26,127,163,229, 30, 99,196, 92, 52, 23, 49,200,107, 97, 90,156,188, 84,150, -112,140, 42, 96,138,162,146, 87, 70, 70,147,148,147, 35,197, 32, 96, 89, 36,143, 86,182, 71, 38, 80,214, 61,247,102,238,101,169, - 68,190,118,250,231,162, 94, 86,117,203, 5,186,157, 2,229,183,106, 17,170,180, 90,196, 7, 74,146,220,186,125, 66, 35,138,110, - 83, 5, 72, 80,230, 66,136,202, 72,238, 8,214, 89,168, 64,112,175,237,189,221,253,134,225,159,102,120,123,225,163,133,105,251, -189, 82,218,155, 26, 53, 58,249,186, 43,172, 93, 53, 88,104,168, 59, 62,163, 61,244, 83, 40, 54, 52,101, 57, 18,156,216,146, 0, -149, 42, 82, 84,242,185,200,142,216, 71, 50,250, 53,193,103,210, 48,176, 55,151,114, 45,253,161,226,123,106,154,216,235,138,230, -171,179,111,210,175,154, 45,102, 69, 70,198, 98,189, 45,246,226, 66,166, 92,208, 43, 49,218,153,107, 54,228,197,120, 94,244,183, -101, 50,219,175, 32, 72, 17,218, 11,121, 61, 57,156,120, 63,198,153,119,233, 74,154,108,168,214, 80, 80, 73, 45,180,205, 3,212, -154,116,102,229,204,244,233, 33,144,107,140, 7,210, 20,181,143,217, 29,185,103, 35,241,187,128,243, 63,209, 20,149, 89,184,162, -204,179, 40,225, 7, 84, 53, 9, 74, 42, 93, 19,153, 2, 84,188, 98, 35,203,145,140,122,139,232,184,251,102,226,253,250,171,113, - 37,195,245, 6,251,107,107,171, 91,211,182, 52,173,200,122,165, 79,163, 51, 98,207,189,104, 17,110,183,106,213,101, 50,154, 93, - 53, 20, 39,167, 9, 42,157, 33, 82, 99,134, 90, 13,243,184, 95, 72, 64, 60,195, 47, 80, 32,128, 65, 4, 17,144, 71, 98, 53, 2, -158, 50, 84,211,191, 72, 26,128,243, 1, 10, 14,113, 65,195,147,232, 82, 80,159,137,193, 34,193, 91, 78,246,248,156, 5, 45,144, -174,224,164, 16,122, 13,118, 87,143, 15,111, 68, 62, 31,247, 89,238, 25,120, 83,218,134, 55,231,120,232,117, 24,214,189,203, 90, -170, 59, 86,145,107, 83,239, 39, 22, 24,122,204,183,168, 86,222, 39,222, 53,230, 36, 56,219, 82, 84,212,136,236,177, 41, 11,138, -145, 33,196, 56, 91, 91, 48,240,167, 51,118,225, 88,120,116,201,154,212,103,249,106,102, 51,243, 57,112,197, 76,172, 19, 86,169, - 89,130, 8,193,123, 6, 98, 25,182, 0, 19,182, 17,203, 60, 97,202,145, 56,190,163,137,196,121, 61, 47, 14,230,178,101,148,252, -190,100,210,213,186,151,211,162, 37, 82,237, 35, 4,185, 84, 5, 84, 92,179, 1,190, 36,133,165,168,139,220,190,218,255, 0,106, -111, 13,237, 80,239,190, 41,184, 29,183,169, 27, 89, 90,168, 69,138,228,225, 66,187,237, 23, 16,167,193,117, 20,246, 46, 35, 90, -169, 70,163, 85,156,101, 14,120, 77, 84, 34,149,172,182,172, 54, 74, 84, 7, 85, 46,223,109,143, 13, 22,231, 5,182, 47, 26,148, -171,102,247,187,237, 43,183,112,233,251, 83, 88,178, 40,166,138,205,225,100, 95, 50, 40, 85,218,228,250, 85,194,221, 66,123,108, -120, 76, 51, 65,115,145,214,150,161, 37,154,132, 89, 13, 39,195,116,242,177,215,248,105,197,180, 35, 47,120,168,226,205,105,243, - 57,189,158, 25,168,170, 33,169,137,167,177, 60,146,241,185, 8,246, 6,193,244,130, 65, 0,146, 8,196,131, 46,241, 91,131, 43, -206,100,147, 87, 77,147,212,229, 48,251, 76,240,215,211, 79, 73, 50,211,220, 14,112,142, 68, 5,227,187, 45,202,106, 32, 16, 72, - 0,223, 29,148,210,212, 92,183, 35,233, 31,162,243,160,209,233,124, 25,112,161,184,187,163,185, 51, 34, 63, 58,227,131,120, 83, -170,147,233,118,147, 44,202,113,150,152,250,163,111,196,153,119, 10,221,142, 27,116,188,153, 48,153, 96,159, 12,248,202, 37, 72, -198,248, 54,250, 69,151,109,251,190,214,214,200,241,107,178, 86,230,220,166,238,185, 96,217,113, 46,235, 45, 87, 21, 53,219, 86, -231,169,204, 77, 62,159, 26,239,181,110,153, 50, 30, 76, 37,212, 94,142,195,174,178,251, 78, 69, 46,135, 23, 29,196,133, 99,108, -248, 71,199,171, 65, 85, 94,249, 46,143, 99, 86,119,128,205, 7,180,136,210,247,113, 0,144,200, 87, 98, 84, 91, 83,129,116, 86, - 4, 95, 68,120,211,225,211,102, 52,121,116,121,233,147,219,157, 99,142,160, 83,212,123, 33,145,237,166, 51, 80, 99, 17,134,243, - 0,198,250, 99, 38,210, 50,144,109, 43, 29,120,113,198,217,109,199,157, 90, 91,105,164, 45,199, 28, 89, 9, 67,109,161, 37, 75, - 90,212,122, 37, 33, 32,146,124,128,215, 14,253,164,222,219,221,157,224, 86,233, 59, 61,101,218, 15,111, 86,249, 34,155, 14,165, - 92,161, 49, 88, 69, 18,210,176, 89,169,199,110,101, 41,155,170,176,220,103,222,151, 90,126, 19,172,190,154,124, 86,130,209, 30, - 75, 79, 63, 37,143, 17,182,220,230, 77,175,244,142, 56,132,142,220,122,222,253,112, 91,245, 86,205, 92,140,191, 79, 85,221,100, - 38,245,165, 74,102, 61, 69,151, 99,183, 46,153, 83,187,226,187, 77,174,184,128,224, 80,100, 59, 27,198, 13,148,165,214,201,230, - 8,229, 94, 22,113,190,113,150, 83,230,244,153, 69,168,170,198,168,121,147, 65, 20,147,169, 23, 6, 24,228,145, 93,245, 13,211, - 97,172, 88,173,193, 4,175,156,120,191,192, 25, 38,109, 81,146,214,231,119,174,163, 58,103,229, 65, 81, 52, 84,237,123, 17, 52, -177, 70,232,133, 78,207,185,229,155,135,210, 65, 2, 71,219, 95,199,191, 8,187,217,187,147,118, 59,104, 55,194,208,220,189,198, -166,208,234, 87, 13, 70,153,102, 59, 46,189, 76,133, 76,164,205,137, 79,158,183,238, 88, 81, 85, 78, 18, 91,151, 54, 58, 11, 41, -148,167, 73, 89, 33, 4, 37, 68,109,254,160, 19,244,127,110,123,126,214,227,115,113,175, 26,237, 82, 45, 14,212,183,182, 43,113, - 46, 74,213,102,160,164,196,131, 73,183,233, 85,139,126,167, 62,165, 57,121, 34, 52, 86, 32, 48,235,174, 30,161, 9,104,247,198, -186,103,185, 63, 72, 83,125,183,147,120, 38,237, 23,179,215,133,198,183, 45,182,164, 77, 98,145,112,222, 16,174, 10,229,197,113, -192,167, 58, 82,245,199, 30,212,183,230, 68,102,215,162, 45, 1, 42, 11,168, 75,116,161,181,165, 79,248, 14, 57,225, 53, 36,226, - 95, 8,115, 26, 94, 38,172,201,120,104, 61, 93, 6, 89, 75, 4,245, 53,117,114,195, 4, 81, 25, 67,146,100,145,185,104,163,202, - 74,160,212,224, 2, 73, 32, 18, 34,220, 41,227, 94, 89, 89,194,148, 57,247, 21,178, 81,102, 57,181,101, 69, 61, 45, 29, 20, 83, -212, 77, 48,132,160, 2, 56,151,153, 35,155,184, 12,231, 66, 18, 85, 64, 4,128,101,135,165,168,156,219,158,223, 30, 44,184,114, -221, 75,123,111,253,161,252, 36, 55,183,244, 42,247,131, 37,117,235, 78,155, 93,160, 92, 80,232,239,201, 68,119,171,244,186,109, -102,169, 54,159,121,211,227, 40, 44, 58,212, 57,113,220,230, 73, 71,139,226, 0,218,186, 89,198, 87,182,211,135, 30, 14,235, 27, - 75, 6,163,102,223, 59,171, 70,222, 93,176,167,238,197,161,117, 88, 18, 40, 31, 82,200,182,106,181, 25,180,248, 5, 70,177, 61, -135,125,225,126,226,183, 10,124, 49,200,151, 18,149,128,224, 82, 83, 20,171,240,211,140,105,171,114,250, 40,178,177,152,182,106, -143, 37, 52,148,179, 67, 60, 19,172, 66,242, 24,230, 71,208, 74, 13,202,146, 26,219,128, 70,248,152,209,120,173,192,245,116, 57, -149,124,217,177,202,215, 39,120,227,171,138,178, 9,169,234, 41,218, 83,166, 46,100, 14,156,192, 28,236, 25, 67, 45,246, 36, 29, -177,217,173,112,163,112,253,133, 28, 55, 95,188,105,212,248,162,173,202,171,215,108,187,186,163, 93,190, 47,125,152,175,202,157, - 87,160,214,183, 90,175, 85,141, 82,118,228,122,179, 46,114,165,201,181,228, 73,126,179, 50,101, 17,245, 57, 25,115, 93,105,180, - 56, 41, 5,116,160,202,240,191,237,190,220,158, 50,248,231,219, 77,158,218, 29,130,147,111,112,189, 93,145,119,193,184,247, 10, -229,165,214,170, 87,151,189,209,182,206,237,185,233,142,205,168,210,100,170,143,106, 52,237,203, 71,166, 71,110, 59,134, 83,174, -180,249, 30, 48,117,228, 33,185, 31,161, 92,200, 74,187,115, 37, 42,199,166, 64, 58, 74,170, 30, 49,240,218,181,169, 26,169,242, - 74,252,226,140, 25, 82, 41, 81,156, 65, 43,200,129, 36, 40, 91,149, 48,104,217,133,136,150, 59,130, 25, 75, 17,133,169, 38,224, -127, 20,232, 22,181,105, 35,207,242,236,146,184,136,164,154, 23, 84, 53, 16,164,110, 94, 33, 32, 83, 44, 44,178,170,155,131, 20, -182, 33,149,130,131,134,126,151,176,123, 71, 74,180, 27,176,226,237,253,162,205,158,136,126,226, 45,102,173,218, 59, 86,224,136, - 80, 27, 49, 69, 13,184, 98, 40,143,200, 0,228, 13,114,224, 99, 24,212, 4,189,180, 92, 57,109,223, 10,156,122, 93,182,174,205, -192,141,105,218,119, 45,169,102,238,133, 50,218,161,145, 14,159,102,213,171,255, 0, 88, 69,169,211,168,140,199,193,165, 66, 53, -106, 19,243,227,176,217, 74, 34,138,178, 89,140,150,163, 54,195, 77,254,136, 21, 90,173, 54,133, 75,169, 86,235, 51,225,210,168, -244,120, 19, 42,149, 90,165, 66, 67, 81, 32, 83,105,180,248,238, 75,157, 62,108,183,214,148, 70,136,204, 86, 93,113,199, 22,160, -132, 33,181, 41, 68, 0, 78,191, 57, 62, 35,175,107,151,218,161,237, 50,184, 37,109,235, 50,196, 29,229,220,202, 77,141,183,190, - 43, 14,184,170, 30,215, 90, 80,163, 80, 97,220,243, 97, 43, 10,140,219,118,133, 14,117,126,160,198, 73,109,217, 50,144,146,162, - 19,155, 39,192, 39,174,139, 62,226, 12,218,122,167,135, 34,160,161,145,235, 29,217,140, 69,217,213,208,184, 38,197,194, 71, 52, -154,236, 88, 42,184,189,156,131, 86,125, 35,211, 47,155,135,120,111, 38,167,164, 73,184,135, 50,204, 35,142,133, 17, 84, 74, 17, - 81,146, 64,132, 0, 66, 51,201, 4,122, 1, 10, 89,144,218,233,113, 61,206, 11,119, 14,189,187, 28, 40,240,239,185, 23, 75,138, -118,228,190,118, 83,107,110,250,243,171, 32,173,202,197,203, 99,208,235, 85, 53,168,134,209,146,102,205,124,159,129, 61, 79,234, -167,176,217,253, 55, 59, 75,100,210,182,231,110,237, 11, 38,133, 20, 65,162,218,246,245, 30,223,164, 66, 7,152, 68,165, 81,169, -241,233,212,232,193, 88, 25, 13,196,142,210,123, 15,213,211,141,170, 34,178, 72,102,172,170,154,158, 62, 77, 60,178, 59, 34,126, -202, 51, 18,171,255, 0,106,144, 62,236,116, 69, 12, 83,193, 69, 71, 5, 76,188,250,152, 98,141, 36,127,219,117, 64, 29,191,238, - 96, 79,223,133,168,165,123,119,125,170,238,209, 91,175,240, 39,195,117,192,235,151, 29, 77, 14, 81,120,135,190, 40, 15,243,187, - 74,135, 49, 41,105,123, 57,111, 76,138,162,181,214,165, 33,194, 46, 23, 26, 41, 49,152, 90, 40,225, 78, 63, 38,166,204, 61,237, -246,205,251, 82,224,240, 79,182,174,108,238,209, 85,161,203,226,135,116, 40,142,253, 82,227, 78, 37,255, 0,226,146,206,156,167, -161,191,184, 53, 54, 18, 8, 53,247,252, 41,108, 80, 99, 56, 82, 61,229,165,212,159, 75,177,161, 8,147,185, 93,236,136,246, 94, -213,106,214,149,199,198,255, 0, 17,212,217,179,238, 10,173,173,115,221, 27, 61, 64,185, 22,228,217,136, 85, 70,147, 62,106,247, - 98,229, 19,146,183,100,220, 18,214,234,221,164,120,203, 82,154,110, 66,170,174, 5,201,122, 11,177,110, 14, 3,225,236,179,135, -178,212,241, 23,140, 33,215, 71, 11,133,202,168,154,193,235,170,175,228,151, 73,191,212,196,192,178,146, 8, 37, 76,132, 21, 68, - 89,105, 31, 17,120,151, 54,226,108,214, 79, 12, 56, 34,126, 93,116,209,151,206, 43,214,229, 40, 41, 45,231,132, 50,145,245,242, -169, 10,202, 8, 32, 50,196, 8,105, 29,161,210,223,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199,236,141,116, 43,233, - 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,207, 95,163,211,255, 0,132, 11,255, 0,169, 75,243,255, 0,199, -236,141,116, 43,233, 74,255, 0,148,224, 99,255, 0,154,226, 91,255, 0,107, 96, 53,106,102,159,250,197,112,231,255, 0, 5, 39, -255, 0,208,175,197, 59,147,255, 0,234,195,197, 95,252,124,127,255, 0,161,150,227,167,222,201,206, 30,246, 78,244,224, 27,134, -234,253,209,181,155,125, 93,172,206,219,232,206,205,170, 85,108,219,118,161, 80,150,239,214, 85, 36,151,101, 76,151, 78, 91,146, - 29,229, 74, 71, 50,212, 78, 0,235,174,142,127, 36,254, 28,127,249, 20,218,239,253, 65,181,127,255, 0, 21,168, 67,236,206,242, -251,107,106, 27, 11,183,118,135, 14,118,230,248,218,123, 35, 96,219, 49,169,246,138,246,239,108,225, 81, 63,132, 20,246, 12,185, - 95, 92,181,113, 85,232,203,170, 93,234,124,188,224,255, 0, 4,146,236, 21, 45,180,166, 60,100, 57,144,172,147,102,189,184,158, -209,254, 22,247, 41, 54,175, 17, 19,170,123,167, 72,160, 84, 35,193,188,246,187,121,108,216, 86,109,253, 75, 99,149,165,201, 68, - 43,134, 21, 2, 5, 86,143, 93, 49, 75,106,105, 85, 86,234, 49,190, 62,117, 68, 87,136, 87,168, 78,113,225, 63, 21,230,217,158, -127, 91,147,241, 53, 5,117, 75, 84,212,207,236, 81, 87, 72,103, 68,121,153,145, 24, 4,229,164,150,101, 82,174,202,138,219,115, - 58, 98,193,200,252,101,224,252,151, 41,225,202, 12,239,133, 51, 44,186,145, 41,105, 96,246,233,178,248,197, 59,201, 28, 17,171, -186,157,124,201, 35,186,179, 6, 68,121, 25, 70,174, 95,164,237,173, 75, 62,218,177,233, 17,168, 22,157, 22,153,111,209, 33, 37, -105,135, 73,163,193,139, 77,167, 68, 67,142,173,231, 17, 26, 20, 54,144,211, 9, 83,206, 56,178, 16,144, 10,156, 82,143, 82, 78, -178, 93, 49, 28, 53,113, 19,183, 28, 85,108,189,139,190,123, 87, 80,118,125,159,125,210, 5, 74, 19,114,219,105,138,157, 46, 99, - 18, 31,167,214, 40, 85,152,204,188,226, 34,214, 96, 85,226, 78,135, 45,180, 56,227,105,126, 18,252, 55, 93,108,161,197, 62,250, -231,250,168,106, 41,170,106, 41,234,227,104,170,224,119, 73, 85,193, 14,178, 43, 21,117,112,119, 12, 24, 16,215,222,247,190, 58, - 70,146,122, 90,170, 74,106,154, 41, 18,106, 58,136,209,225,120,200, 40,209, 58,134,141,144,141,138, 50,144, 84,141,172, 69,176, -180,180,180,180,134, 54, 48,180,180,180,180, 48, 48,180,180,181,192,111,104, 5,251,125, 80, 56,143,220,198, 45,253,213,169, 89, - 9,183, 54,167,110,238, 27,118, 11,123,151,122, 90, 50,220,172,139,138,158,153, 72,178, 45,251,125,102, 37,197,116, 63, 9, 82, - 82,182, 38, 6, 89, 68,111, 26, 95,138, 30,142,216, 47, 57, 30, 78,249,221, 99, 81,164,226, 6, 84, 47,168,169,111,215, 68,181, -129, 7,171,130, 78,246, 0,236, 78,216,215,169,168, 20,209,243, 10,234, 23,181,175,110,196,255, 0, 44,119,231, 75, 81,244,103, -138, 29,229,219,186,190,226, 38,204,169, 55,100, 67,220,238, 34,247, 45,250,213,217,125, 65,164,205,147,104,206,165,216,118, 61, - 94,129,106,212, 95,186,100,197,162, 91,207, 73,151, 86,156,153, 30, 59,169, 82,141, 53,244,196,109,181, 55,135,114,241,198,191, - 22, 21,107, 15,123,247, 58, 21,239,182, 80, 41,252, 61,195,225,246, 85, 90,221,164,217,177,110, 10,125,254,238,232, 42, 29, 18, -168, 34,221, 38,172, 62,174,129,245,162, 36,204, 82,163, 52,225, 82,101,134, 98,190,203,109, 37,110, 59,183, 5,230, 62, 70, 90, -152, 57,114,114,192, 44,206, 14,169, 36, 72,144, 16,168,246,213, 43,132, 6,228, 91,204,218, 84,223, 8, 12,198, 29,193, 70,184, -191, 64, 58, 0, 88,157,200,232,162,231,111,112,185,199,119, 52,181, 31,219,163,138, 13,215,187,247, 63,109,175,153, 87,125, 18, -185,126,217, 23,151, 19, 82,104,252, 60,211, 45,201, 52,233,150, 71,240, 34,193,174,162,217,167,220,143,211,222, 93, 66,233,145, - 84,147, 75,108,134,220, 72,230,113,130,136,203, 97, 74,115,194,187,218, 60,116,241, 71, 94,159,183, 22,253, 63,112, 54,166,175, - 63,117,119, 39,104,237,104,115,229, 80,109,233,245, 11, 49,235,225,117,154,109,106,149, 86,182, 45, 90,232,117,138, 91, 85, 35, - 79, 91,126,254,228,106,167, 37, 61,109,158, 66,226,214,144,220, 23,153, 8,213,214,162, 27,132,212,225,139,174,147,174, 69, 33, - 78,131,172, 1, 25,109,118, 10,194,252,179, 32, 1,136, 25,140, 58,136, 42,221,108, 45, 99,125,129,245,219,115,107,117, 29,237, -142,245,233,107,147,209,223,222, 43, 46,151,189,123,171, 87,168, 91,247, 45,193, 96,238,236,107, 86,163,184, 18,175, 13,204,135, - 26,223, 51,155,219,155,122,229,185,225,109, 4,121,171,160, 11, 66,149, 6,229,173, 86, 75, 18,101,144,211, 81, 94, 47, 30, 86, -130,245,116,153,197,253,205,104,175,125,224,212,119, 98,196,186,104,182, 78,217,238,236,253,159,220, 25, 80,109,250, 84, 61,204, -189,109, 75,111,110,106,180, 88,240, 28,129, 37, 16, 46,122,140, 59,158,240,173,209,164, 71,165, 4,181, 37,202, 9,253, 10, 30, - 67,199, 90, 31,253,157,169,144,255, 0,100,153, 42,109, 96,108, 24, 93,173, 25, 33,108, 27, 96, 37, 66, 3,232,144,141, 71,151, -101, 98, 20,246,180, 31,222, 41, 75,252, 58,110, 5,250,122, 30,151, 3,109,247, 24,234,110,150,185,121,125,113, 27,190,246,141, - 14,226,220,138, 85,122,149, 95,137, 79,221, 29,192,219, 42, 86,219,187,104, 69,247, 57, 66,135,195,181,213,186,212,122,171,149, -122,104, 85, 74, 93, 76, 92,212, 56,173,120, 13,169,182, 94,140,242,153, 95,134,178, 36,161,188,127,125,171, 86,214,225,238, 11, - 22,199, 16, 84,107,178,163,121, 39,108,124, 29,207, 68,141,169,183,108, 72,233,163,237,245,233, 92,170,211,106, 53,186,204, 89, - 52,202, 39, 35,139,138,182, 99, 49, 2,101, 90, 83, 81,212,194,240,184,239, 73, 25,143,134,171, 36, 66,194,104,254,198,161,110, - 97, 23, 14,138,202,199, 64, 11,164, 54,162,119, 6,214, 93, 86, 98,161,171, 35, 6,218, 79, 91,118,238, 9, 4, 11,239,126,158, -238,246,218,253,134,210,215, 23,168,252, 66,238,173,122,152,237,253, 54,243, 85,110,231,171, 76,225,138,243,161,236,203, 18,102, -193,102,123,213,219, 34,129, 34,173, 62,218,133, 2,172,137,173,218,242, 46,180,203,140,244, 86, 80,236, 39,101,213,208,220,211, - 33,228,132,186,236, 80,248,135,221,139,146,237,218,187, 18,214,222,123,102,243,129,185, 51,246,200,220,219,133,110,217,182,220, -151, 54,246,175,118, 89, 27,207,114,220, 59,126,196, 88,238, 61, 5,154,162,127,128,148, 71,161,179, 83, 67,181, 56, 13,161,255, - 0,172, 27,152,151,144, 18,105,120, 98,178, 37,118, 51,199,104,151, 83,147,204, 1,108,138,237,184, 67,125, 33,173,125,181, 16, - 66,106,107,129,133,173,141,136, 1, 79,155,167, 77,247, 32,119,239,248,119,182, 58,147,171, 69,118,187, 74,182,233,114,107, 21, -153,105,135, 2, 47,132,149,185,225,188,251,206,189, 33,212, 71,139, 18, 28, 72,205,173,217,211,223,148,235, 45, 49, 29,148, 45, -231,222,121, 13, 52,133,184,180,164,182, 60, 63, 94, 23, 13,249,180,118,173,203,117,202,141, 58,225,125,219,146,149, 84,168, 68, -134,221, 57,154,140,139,106,235,174,219, 34,165,238, 12,168,183, 13,217, 13, 81,219,121,198,219,253, 26, 28,125, 73,108, 37, 1, - 41, 13, 62,232,111,214,218, 88, 87, 53,221, 90,189,235,241,103, 84, 54,214, 35,223,192,237,191,166,243,212, 43,146,234,168,162, -210,230,214,174, 85,210,219,108, 4, 84, 20,139,146, 5, 54, 10,228, 56,219,108, 55,239, 43,109,212,137,238, 41, 44, 50,192,240, -207, 45, 59, 88,201, 19,178, 27,116,186,146, 13,137,182,215, 29, 72, 27,117,198,210,176,101, 86, 29, 24, 3,251,247,199,221,233, -222,106,181,159, 75,167, 84,174,234, 93, 66,210,177,231, 69,184,235,115,168,180, 74,161,155,188,183, 37,187,104, 81,151, 91,175, - 70,163, 80, 40,200, 81,166, 32, 83, 84,169, 82,149, 18, 91,178,216,139, 78, 83, 11,126,159, 42,107, 42,103,136,187,179,237, 34, -226,147,119,235, 63,197,223, 8,251,124,189,158,219,184, 97, 16, 40,176,233,212,196, 92,251,157, 84,166,150,212,167,102,185, 76, -180, 34, 77,106,221,117,114, 22, 2, 25,135, 45, 15, 52,181, 45,110,204,125, 71,175,108,182, 23,109,174,187,130,169, 84,222,157, -223,125,186,149,249,123, 65,247,101,210, 60,100,212,104, 54, 69,155, 36, 7,224,237,133,176,149, 2,203,148,166,146,166,158,173, -205,109, 3,235,170,160, 43, 86, 98, 69,134,211, 59, 51,104,216,150, 77,129, 77,110,141, 99, 90, 54,213,159, 74,109, 41, 66,105, -246,205, 18,155, 68,137,132,126,169, 91, 20,232,205,165,197,117, 57, 82,129, 81, 36,146, 73, 39, 78,217,109, 94, 95,150, 60,146, - 85, 80,254,145,169, 22,208, 11, 40,141, 58,223, 82,180,114, 93,186, 91, 96, 71, 98,164, 27,234,212,195, 81, 80, 21, 35,159,217, -227,223, 81, 0,150, 61, 45, 98, 25,108, 58,223,168,247, 17,136,175,109,165,111,136, 46, 22,110, 90,253,251,188, 55,190,238, 65, -226, 39,118,227, 73, 22,188, 43,214,173, 93, 15,170,216,230,151, 29, 53, 11,198, 13, 89,199, 26,118,108,119, 24,169, 38,135, 69, - 37,232,207,174, 19,213,119,127,239, 68, 64,213, 43,151,138,189,231,148,233, 93,203,191,247,220,103, 10,148,232,142,246,226, 85, -105, 32, 96,149, 21, 51, 79,141, 84,100, 37, 35,175, 68, 55,129,142,128,107,190, 92, 81,109,158,214,113, 35, 67,184,108,237,202, -102, 60, 43, 2,198,163,212, 42,247, 21,248,211, 49,155,173, 80, 37,183,202,252,118,173,218,155,209,221, 83, 79,170,117, 53,160, -227, 77, 36,169,228, 67,121, 32,178,242,233,207, 57,194,234, 71, 15,220, 39, 90, 75,109,193, 77,191,119, 2,124, 94, 96,220,151, -161,219,182,108,103,243,144, 18,185, 21,119,174, 89,106,100,163, 0,129,224,171,201, 60,131, 83,252,135, 54,165,204,160,150,105, - 50,197,106,184,152, 41, 60,176,194,223,170, 17,180, 5, 22, 29, 67, 58,155,146,119,189,240,193, 93, 73, 45, 59,170, 45, 73,228, -176,184, 26,172,111,176, 36,139,220,223,181,129,216, 91,107, 91, 29, 21,246,100,113, 47,186, 91,235,125,110, 4, 59,162, 92, 75, -222,214,164, 89,244,136,116,189,196,146,195,109, 87,221, 69, 6,164,227, 77, 68,157, 83,101,164,170,228,142,252,250,245, 93,166, - 94,150, 12,132,127, 7, 30, 90, 93,113,183, 73, 87,102,245,197, 62, 8,247, 59,106,118,179,113, 23,103, 90,182, 36, 75, 2, 30, -235, 85,168,116, 25, 13,199,172,212,107, 14, 87, 43,209,216,152,205,189, 33,239,126, 9,109,170,147,105,114, 75, 75, 16,216,138, -219,177, 93, 46, 62,219,134, 27, 74, 71,107, 53, 4,226,104,132,121,180,197, 40,197, 20,114, 5,101, 80, 0, 13,113,230,112, 20, -149, 23,107,139, 2,109,109,247,185, 47,153,107, 22,165, 75,205,206,101,184, 39,115,107,116, 27,128,122, 88,239,235,233,133,165, -165,165,168,254, 55,240,180, 29, 66,161, 2,147, 6, 93, 78,169, 50, 45, 58,157, 2, 59,178,166,206,154,251,113,162, 68,140,194, - 11,143, 72,147, 33,229, 4,178,202, 80,149, 21, 41, 68, 0, 6, 73,209,154,212,158, 53,182,250,255, 0,220,189,141,169,219,187, -118,235,139,169,181, 89,166,213,106,148,134,158, 12, 59,113, 81, 32, 51, 52,201,162,180,181, 16,149, 58,102, 59, 6, 74, 80,165, - 0,225,167, 6,243,149, 0, 88,184,159, 52,173,201, 56,123, 58,205,242,220,170, 76,242,191, 45,166,150,104,105, 34,254,242,162, - 68, 66,203, 18,216, 19,118, 35,162,171, 57, 23, 8,172,214, 82,253,194,249, 85, 14,121,196, 89, 38, 79,153,230,209,228, 89,126, -101, 83, 12, 51, 86, 75,253,221, 60,114, 56, 87,149,174, 85,108,160,245,102, 84, 6,197,221, 86,236, 52,131,138, 95,104, 4,186, -199,214, 54, 22,197, 77,122, 13, 40,151,161,213,183, 5, 41, 91, 51,234, 13,245,109,214,109,116, 44, 5, 64,138,174,191,225,138, - 1,245,164,254,133, 45,116,112,232,102,217,108,157,245,187,134,183, 88,166,198,146,138, 37, 30, 21, 78,171, 88,184,102, 54,243, -205,188,244, 72,207, 77,118, 44,101, 40,243, 79,168,186,180, 97, 88, 36, 32,185,206,226,129, 32, 43,100, 54, 19,129,203,238,248, -173,181, 55,114, 41,115,173, 91,118, 27,233,241,105,111,225,154,189, 85, 72, 80,230,100,242, 40,251,132, 63, 37, 44,159, 21, 64, -225,180,167, 62, 34,123,107,102,109,165,171,100,219,108, 91, 52,106, 68, 40,116,214, 97, 24, 34, 35, 12, 33,184,233,142,182,203, -107,104, 54, 7, 80,164,169, 92,196,228,168,168,149, 18, 73, 58,227, 46, 26,240,155,196, 15, 27,243,131,198,254, 48,212, 79,148, -100,169,175,216,178,205, 50, 64,197, 79,217, 84,129,142,186, 74, 91,129,173,223,251, 93, 72, 91,234, 0,172,216,237, 78, 38,241, -115,195,223, 3, 50, 97,192,254, 13, 83, 65,156,103,114, 20, 53,217,166,164,168, 64, 71,218,103,168, 81,162,174,168,169,109, 8, -159,217, 41, 75, 17,164,144,208,226, 44, 52,185, 13,195,169,211,165,188,142,118, 98,207,137, 33,212, 30,203,109,137, 13,184,226, - 8,249,165, 36,125,250,127,189,191, 59, 1,126,241, 15,193, 94,202,238,238,208,211,167, 93,244,109,151,184,170,119,101,215, 68, -161,176,236,233,235,179,175, 10, 4, 24,142, 93, 76, 66,140, 20,185, 76,211, 95,167, 69, 50, 66, 18,165,179, 30,166,244,130, 3, - 76, 60,164,211,226,127,101, 42, 59, 29,186,181,187,117,109, 62,187,118,168,251,213,155, 78,162,182,200,106, 93, 34, 91,202, 95, -186,135, 57, 66, 85, 38, 43,203, 84,119, 64,193,253, 26, 87,128,151, 18, 75,183,195, 79, 26, 53,221,151,166,139, 34,240,164,187, -122,109,226,148,224,141, 17, 46,182,154,189, 13,183,212,165, 72,102, 2,165, 31, 10,109, 61, 74, 90,213,238,238,148, 4, 41,106, - 40,113, 41, 37, 5,151,232,189,226,236,127, 70,191, 20,115,188,175,140,233,189,135,151, 83, 26, 73, 43,163, 50, 69, 61, 47, 62, - 45, 50,104, 12,254,207, 83, 5, 76,154, 39,141, 95, 65, 49, 74, 20,198,204,234,241,244,170,240,114, 79,164,247,132,249, 46, 99, -193,117, 94,220, 37,165,149,227,137, 29, 21,229,130,168,211,204, 26, 46, 97, 84,246,154, 89,233,163,215, 79, 35, 71,204, 2, 88, -139, 9, 21, 81,160, 87,169,110,253, 27, 78, 31,247, 14,201, 78,246,241, 53,120, 64,159,107,237,173,207,108, 82,237,139, 90, 69, - 85,167,160,179,114, 68,163, 76,149, 92,175,220,241,144,248, 79,137, 70,138, 26,139, 29,153, 56, 45,188,228,137, 73,109, 71,193, - 94,122, 95, 89,143,236,147,185,110, 37,110, 61,103,134,205,190,118,245,118, 71,214, 47,186,246,201, 80, 28,168, 63, 81,230,241, - 76,135,214,152, 94,233, 38,103,139,215,198,113, 69,124,221,121,181,134,239,223, 25, 43,190,109,119, 54,195,105,109,159,226,243, -110, 28, 97, 16,106, 24, 17,153,172,214,169,236, 0,134,169,158, 5, 63,244, 20,106, 55, 34, 82, 21, 29,165, 56,167, 82, 2, 22, -180,183,204,210,189, 25,241,187,233,237,225,100,220, 3,152, 80,112,253, 92, 57,166, 99,153, 70,182,130, 10,152,234,164,119, 86, - 89, 18, 33,201, 5, 97, 70,145, 87,153, 52,237, 25, 88,195,132,133,228, 42, 7,154, 94, 3,127,179,211,197,122, 79, 17,114,220, -207,136,233,166,203, 50,220,174, 70,250,249,233,164,165,141, 17,213,163,121,155,158,193,230,117,141,219,151, 5, 58,200, 30, 82, -133,230, 72,149,201,211,219,222,171, 18,185,121,221,181,168, 8, 8,131, 86,185,107,149, 40,105, 74,121, 64,139, 58,167, 42, 76, -127,132,143,135,244, 78, 35,167,207, 77, 71,183,193, 83,207, 4, 92, 7,166,161,226,120,232,185,171,137, 62, 46,121,194, 5,131, - 73,240, 82,160,174,160,134, 66, 7,221,173,145,216,173,173,169,238,230,227,208,109,120,108, 60,170,120,148,204,234,252,180, 33, - 69,184,116,136,238,161, 82, 57,156, 72,194, 30,120,132,178,214,123,173,224,113,202,149, 17,210, 31,105, 23,179, 6, 31,180, 15, -107, 54,119,111,211,186, 82,118,157, 59, 83,112, 85,238, 6, 95,131,103, 71,187, 17, 86, 21,122, 52,122, 72,130, 99,187,113, 83, -133, 57, 44,166, 58, 86,149,165, 78,133, 5, 20, 20, 12, 5,107,144,127,217,239, 11,228,156,117,155,248,159,196, 50, 53, 6, 69, - 81, 49,167, 14, 35,118, 89, 36,209, 81, 36,238,145,198, 25,217, 98,121, 98,141, 74,171, 13, 82, 58,223,200,246,236,191,246,140, -186,241, 7,135,185, 87,133,124, 53, 18,230, 60, 67, 79, 0,168, 49,153, 35, 86,142, 62,101, 52,112, 70,242, 72,200,138,210,199, - 20,210,176,118, 83,166, 56,218,223, 88,151,102,125,130,112,118, 42,169,192, 62,220,155, 3,248, 58,253,211, 14, 69,121,189,216, -141, 20,197,250,250, 61,248,229,122,168, 93,114,229,109, 39,197, 75,206, 82, 17, 78, 84, 37, 57,240,170, 2, 88, 75, 71, 8, 80, - 17,173,246,250, 13,156, 87,180, 78,224,103,100, 28,162, 63, 88,110,202,179, 25,220,245,218, 78, 69,118, 49,221,175,121,170, 25, -141,184,237, 53, 69,181,220, 41,161, 42,215, 76,222, 83,227, 38, 98, 92, 68,140, 74, 75,192,117, 38,227,250, 54,119,189,161, 79, -164, 73,216, 46, 46,110,123, 78,180,253, 25,154,101,232,154,149, 18,165, 73,135, 95,154,143, 16, 72,168,192,114,215,185, 18,237, - 62, 19,168, 82, 1,129, 35,223, 2, 20,149, 45, 50,202, 86, 27, 67,243,193,111,209,227,219,173,146,220,107,127,118,119,231,112, -164,239, 85,205,109, 84,218,174, 81,173,207,169, 81, 69,178, 35, 87, 35, 60,153, 16,234,149,118, 37,204,149, 42,232,125,153, 9, - 75,205, 33,229,199,142, 93, 0,191, 29,240,156, 31, 80, 50,110, 36,240,255, 0,133,248,167,136,120,250,159,140,167,206,102,204, -197, 81,139, 47, 20,147,199, 51, 60,242, 9, 52, 75, 52,159, 86,209,161, 80, 35, 44, 16, 5,210,199,204,186, 91,202,188,243,133, -252, 73,226,222, 17,225,159, 14,106,120, 26,159, 34,131, 42, 52,130,108,204,214,211, 75, 2,165, 60, 92,190,100, 48, 71,245,171, - 35,134, 38, 64,165,201,109,106, 60,175,173,120,101,186,226,227, 30,216,222, 31,145,113,169,212,222, 13,238, 7, 6,204,215,213, - 43,196, 18, 19,114,181,106,109,123, 85, 19, 47,197,202,132,164,212,146,231,141,205,215,196, 74,201,235,211, 90,121,178,118,150, -251, 86,248,244,118,209,176, 55, 14,149,181, 28, 67, 63,187,123,137, 77,165, 94, 87,124,150,160,183, 79,191, 68,251,137,138,172, - 71,101, 79,167,202, 75, 85,121,111,253, 99, 25,144,182,148,167, 95,150,150,144,124, 71, 18, 12,191, 55,139,216,145, 27,114,184, -246,164,241,181, 23,126,103,210, 85, 77,220,141,186,220, 36,237,202,118,242, 36,168,229, 86, 2,232,107, 69, 32, 92,230,240,109, - 65,169, 66,136,128, 94,247, 2,166,125,229, 68, 33,194,145,159,188,127,251, 8,246,135,139,155,230, 86,246,237,181,237, 81,216, -221,230,170,248, 18,174,153,244,186, 83, 85,171, 78,238,170, 68,109,180, 49, 90,169, 81, 81, 50, 35,244,171,136,165,166,146,236, -232,146,128,119,194, 75,143, 69,117,254,103, 75,214, 91,226,215, 8, 67, 22, 85,150,205, 86, 35,138,175, 35,134,138,121,205, 36, -147, 69, 73, 85, 26,176,229,203, 3,162,251, 69, 57,230, 48, 97, 30,180,109, 10,167,202,197,149,139, 52,240,103,141,106, 37,205, -243, 72,104,140,147, 80,241, 4,245,244,244,226,182, 40, 37,173,163,149,163, 60,200,170, 35,145,189,154,161,121, 42, 80,203,203, -117,214,204, 6,181, 8,220,174,226, 71,130,207,107,101, 91,105,167,218,220, 83,113,207,179,208,246,122,238,169,208,173,233,177, -183, 54,243,164,208,173,170,181,102,101, 69,135,109,234, 98,103,201,178, 88, 45,207, 85, 69,134,150,209, 67,168, 82, 61,221, 78, -173, 73,109,181,173, 58,117,197, 87, 1,155,253,192,167,179,178,235,160,238,229,199,101,215,173,141,200,226,147,102,174,107, 61, - 22, 93, 90,117, 86, 35,117, 8, 59,103,187,240,170,243,222, 92,168, 76,160, 38, 69, 61,202, 40,109,109,115,248,137,137,146,174, - 80,141,116,161,143,163,193,196, 46,228,213,168, 20,254, 34,120,219,187,111,155, 38,221,113,180,211,233, 77,199,185,174, 25,241, - 97,167, 8,114, 37, 29,203,202,228,122, 53,190,165, 48, 57, 82,234, 35,200, 8, 29, 60, 21,142,154,234,183, 19,126,200,187, 31, -124, 56, 36,218,238, 11,108,125,198,175,109,125,165,181, 87,181, 22,242,163, 87, 39,211,158,220,106,188,245,210,168,215, 85, 46, - 68, 42,129,170,215,224,171,196,147, 34,233,147, 37,110,182,234, 91,105, 81,195, 44, 70,109,146,148, 54,214,158, 34,228,185, 53, - 87, 15, 81, 71,196,212, 85,249,107, 87, 71, 81, 94,180, 57, 43, 81, 65, 18, 68, 85,227,149, 89,109, 43, 77,170, 53, 86, 9, 12, -154,144,144, 89, 2,128,238,210,120, 95,158,231,148,156, 75,152, 73,194,149,249,118,106,153,124,148,217,123,102, 25,242,215, 84, - 77, 36,193,146, 72,157, 90,240,164, 26,100,118, 66,243, 71,165,192, 96,175,172,152,216,127,163,207,182, 54, 85, 63,129, 26, 5, -213, 18,131, 1,186,245,225,121, 94,117, 27,146,168, 35, 51,239,213,105, 84,250,195,212,170,127,190, 73, 8, 11,121,152,244,248, -205, 54,202, 20, 74, 90, 10, 95, 32, 5,107, 39,133, 62,218,203,122,129,108,123, 96,109,245,210, 41,177,105,109,213,209,195,221, -118,176, 97,180,134, 12,218,147,149, 56,208,159,168, 62, 91, 3,158, 81,133, 78,134,130,179,241, 17, 25, 57, 61, 53, 47, 47,103, -175, 7, 75,224,115,135,139,127, 97,141,234,237,254,138, 5, 74,189, 81, 77,202,253, 13,187,113,201,102,185, 84,122,164,166,141, - 41,170,164,208,194, 90, 47,114, 3,239, 11, 42, 8,230, 56,206, 53,160, 92,119,251, 21,218,227, 43,139,138, 79, 20,201,223,169, -214, 59,244,232, 27,125, 4,217,141,109,212,106,251, 11, 22, 36,247, 38,120,191, 94,185,121,196, 82, 76,164, 44, 39,151,221, 15, -128, 83,205,151,129,228, 17,110, 24,227,108,134,131,196,238, 46,226, 60,195, 51,120,242,140,217, 51, 4,134,110, 92,238, 92, 77, - 42, 52, 0,198,177,153, 20,104, 81, 96,232, 2, 5, 0,233,176, 24,151,241,111, 0,241, 22, 99,225, 63, 5,112,190, 91,148,164, -153,214, 76,249,107,207, 8,150,157, 4,109, 4, 46,181, 12, 36,105, 22, 38, 58,216,234, 40,236, 92,177, 35, 85,201,196, 94,166, -255, 0, 4,227,251,102,171,138,226,141, 80,145,106,127, 43,106,227,151,155,183,111,130, 40, 41,134,253,197, 45,203,106, 77,100, -206, 72,103,248, 45,250, 74, 26,201, 88, 17,189,203,148,159,208,106,118,219,255, 0, 77,225,202, 23, 11,155,155, 59,120,151,101, -141,146,115,108, 43,142,220,242,235, 79, 83, 77, 2, 85,186,237, 13,231, 25, 76, 37,173, 94, 28,153, 78, 35,192,250,189, 49,242, -243,146, 21, 28, 67, 5,242,214,185,225,237, 10,246, 37,236,223, 28, 51,160,110, 93, 50,230,159,180,155,231, 14,139, 6,141, 84, -188,169, 20,168,245,170, 53,231, 14,149, 20, 69,166, 34,238,183, 93,151, 24,202,168, 48,195,108,176,204,230, 36,178,250, 35, 54, -134, 94, 76,166,217,142,134,185,163, 99,253, 27,221,214,159, 80,165, 91,187,205,197,181,110,187,181,116,121, 33,246,109, 11, 90, -155, 92, 73,125,180,171, 33,152,105,184, 43,142,194,160,169, 67,169,117,184,146, 84,156, 20,165, 25, 60,195,123, 59,206,248, 23, -142, 41, 56, 79, 52,204, 56,182,110, 23,174,225,202,104,160,154,140, 82, 79, 49, 38, 34,167, 93, 35,197,104,209,156,173,149,152, -146, 20, 70, 93, 84,165,153,191, 32,200, 60, 65,240,254,183,140,178,156,183,130,224,226,234, 14, 40,171,154,162, 10,227, 91, 4, - 0, 9,129, 81, 29,108,114,131, 35,162, 6,187,162,128, 11, 25, 66, 51,137, 46,188, 20,224,130, 37,122,161,107,241,207, 22,205, - 68,229,213,151,193,189,253, 34, 59,113,121,149, 53, 84, 40, 55,206,223, 79,185,147,150,134, 72, 22,172,106,177,123, 29, 60, 36, - 57,159,135, 58,112,125,151, 27,107,197,206,231,238,109,253, 66,224,219,124,109,173,154,220,132, 90,144,164, 85,209, 87,159, 18, - 13, 86,231,182,219,170,182,183,153,164,123,205, 6,114,159,102, 44,244,195,114, 64,108, 32,164, 58,218,149,148,246,148,183, 0, - 30,195,186,103, 4, 59,219, 95,221, 41, 91,210,238,236, 81,174, 43, 18,191, 97, 78,179,235, 27,115, 6,133, 5,234,101,126, 92, - 7,229, 25,178,149,117,212, 19, 61,159,118,131,224,173,133,199, 8,117, 50, 23,206,113,240,235, 95,184,128,250, 57, 52, 5,238, - 92,237,211,224,251,126,238,109,132,155, 34,168,253, 90,157,107, 61, 18,125, 66, 21,175, 38, 90,150,227,236,218, 87, 93, 26,179, - 18,165, 71,166,165, 75, 33,152,239, 9,107,109, 10, 40, 18,121, 2, 82, 39,213,158, 45,112, 93,125,119, 19,229,145,230,113,193, - 73,155,199, 76,244,245,181, 20, 18,212,211,115,163, 69, 71,134,162,150, 72,214, 70, 81,203, 66,172, 80,165,217,219, 82,178,174, -170,226,135,193,142, 59,203,114,254, 18,205,101,202,100,158,183, 36,150,174, 58,154, 26, 92,198, 42, 74,174, 68,178, 51,199, 61, - 45, 92, 82, 52,106,228, 72,225,215,152, 30,200,138, 85,149,155, 79, 63,120,152,246,113,123, 73,247,246,235,219,109,167,226,139, -140,141,138,188,175,178,213,122,187,181,118, 29,241,126, 64,166,221,115, 99, 73, 93, 54,159,112, 78,182, 41,145,237, 56,210,106, - 13, 56,228,106,115,110, 33, 60,254, 41,132, 84,218, 23,238,207, 41,173, 31,246,169,108, 70,229,240,207, 70,224,147, 98,119,114, -163, 71,170,222,187,125,195,213,118,150,252,234, 12,137, 18,233, 70,139, 43,118,239, 89,244, 56,177,164,203, 97,167, 29, 12, 68, -146, 91, 60,200, 72, 79, 32, 74, 71, 40, 26,238, 94,204,253, 30, 26,228,253,212,164,238,167, 22,156, 77, 94,219,207, 82,164, 79, -131, 56,192,167, 63, 93,167, 79,170,174,154,224,118, 27, 85, 91,234,181, 93,149, 83, 76, 20,173, 8, 10,106, 34, 99, 59,203,144, -220,182,137,206,183, 63,218, 81,236,103,137,199,254,225,237,141,254,141,242,159,182, 63,197,206,219,177,183,108, 80,227,216, 76, - 93,200,157, 30, 61,114,165, 89,102,162,106, 82,110,248, 10,142,176,154,138,153, 45, 22,157,230, 12, 37,207, 23, 42, 41,211, 54, - 91,226,118, 67,149,113, 15, 14, 82, 84,113, 37, 61,110, 65,151, 37, 76,179, 61, 46, 80,244,112, 67, 83, 36, 82,198,139, 2, 70, - 26, 87, 71,230,182,191,169, 81,168, 7, 46,218,138,163,238,105,225, 55, 17,103, 28, 53,197, 21,180,220, 43, 85, 67,196,121,172, -148,176,195, 29,102,117, 29,117, 68,244,145,205, 12,142,213, 15, 41, 72, 99,120,249, 43,203,250,242,218, 47, 24,141,116,134,125, -234,246,125,236,206,223,237,103, 9,155, 11, 64,179,173,250,125, 38, 3, 59, 97,100,212, 92, 17,163, 54,202,230, 85,234,214,237, - 54,167, 88,172, 76, 82, 19,151,234, 82,234, 82,100, 72,125,213,100,173,199,207,100,132,164,111, 48, 24, 24, 29,135, 65,166,203, -102,236, 37,237,126,216, 88,187,122,185,202,169,155, 50,212,183,173,113, 82, 83, 9,138,169,233,160, 82, 33,210,147, 53, 81,146, -234,196,117, 58,152,129,101,176,181,132, 21,242,133, 40, 12,150, 11,143, 78, 49,236,142, 6, 56,109,189,119,206,237,247,106,133, - 98, 35, 63, 80,109,189,164,235,165,183,175,125,198,171, 71,147,252, 28,183,209,200,180,173, 16, 18,168,242, 38, 84, 93, 65,230, -143, 77,165,203,121,176,183, 80,219, 78,115,121,134,183, 63,207, 30, 26, 53,122,250,236,222,165,132, 99,114,242,188,210, 27, 18, - 91,123,146,215, 98,214,176,185,107, 0,113,212, 98,122, 30, 27,225,232,231,174,100,203,178,252,150,145, 76,135, 96,145, 71, 12, - 64, 48, 1,118,178,133,178,170,222,230,193, 65, 36, 12,113, 23,233, 10,251, 69,127,139,219, 56,240, 51,180,149,207, 14,246,220, - 58, 76, 90,158,253,213,105,238,225,251,107,110,170, 45,166, 69, 35,111,195,236,175,154, 61, 90,224, 64, 68,138,131,100,165, 72, -161,165,182, 28,109,216,245,192,166,197,250, 63, 62,207,199, 44, 27, 45,238, 46,247, 46,142,166,111, 45,207,164, 38, 30,218,192, -168, 71, 90, 31,183,118,209,231,218,148, 43,105,105,228, 15, 10,125,126, 68,104,146, 26, 88, 10, 34,147, 18, 26,217,112, 38,161, - 37,189,113, 27,217,255, 0,195, 62,227,251, 81,184,218,174,223,155,197, 50,161,115,219, 13, 92,234,221, 61,253,186, 37, 37,214, -218,174, 63, 83,168,185, 34,149, 99, 68, 49,148,129, 0, 85, 37, 71,114, 43, 76, 50,166,145, 6,141, 74,151,238,188,134, 52,102, -151,250, 18,218,182,237, 58,213,161,211,168,148,168,145,160,194,167,196,143, 18, 60, 88,140,183, 30, 52,118, 35,180,150,153,143, - 29,134, 82, 16,203, 8,109, 41, 74, 16,144, 18,148,164, 37, 32, 0, 53,117,113,253,101, 39, 0,112,165, 23,134, 89, 44,193,243, - 42,197, 90,140,226,116,234,236,225, 88, 67,126,160, 61,151,202,108, 86,153, 34, 86,213,206,123,208,254, 27, 80,214,248,145,198, - 53,254, 44,103,208, 52,121, 85, 11, 61, 54, 73, 76,251,132, 68, 44,166,123,116, 38, 59,183,152, 92, 53, 84,146,178,149,228, 32, - 25, 10, 82, 18,144,148,140, 4,128, 0,244, 3,160,215, 62, 61,164, 30,208, 29,190,246,125,108, 68,221,193,174,166, 21,195,185, -183, 74,103,208,246,111,110, 92,144, 91,126,238,186,153,142,218,156,168, 84,144,203,169,118, 61,155, 75, 18,162, 72,171, 73, 65, - 65, 8,121,152,108,172, 76,155, 21, 42,223,186,157, 78,157, 69,167, 84, 43, 21,138,132, 42, 77, 34,147, 10, 85, 74,169, 84,169, - 74, 98, 13, 58,155, 78,130,195,146,166,207,159, 54, 83,137,106, 28, 38, 99, 52,235,142,186,226,146,134,208,218,150,181, 4,130, - 71, 9,184,174,225,239,128,223,109, 5,235,103,196,178,120,186,133, 90,187,118, 26,145,116,193, 93,191,180, 87, 53,159, 80,147, - 34,153,115,212,232,158,253, 88,147, 10,183, 72,146,245, 74,148,212,218, 52, 38,155,157, 7,154, 22,102, 37, 42,117, 74,117,156, -212,252, 35, 69,149,207,156, 82,213,241, 20, 21, 13,195, 52, 45,174,178, 72, 34,146, 64,163, 75, 24,163,145,145, 78,133,154, 64, -177,177,184,109, 37,180,144, 64, 34,228,227, 92,195, 55,166,201, 42,232,248, 98,122,101,226,188,193,116, 80,199, 81, 52, 81, 22, - 98,202, 37,146, 53,145,135, 49,160,137,154, 69, 91, 50,235, 85, 12, 10,155, 24,223,112, 43, 69,217,158, 45,184,165,187,120,165, -246,138,241, 35,182,116,170,123, 23, 91,119, 61, 74,223,220,203,198,221,164,212,247, 82,240, 90,154,145, 18, 4,155,122, 83,169, - 76, 13,179,165,195,106, 27, 94,232,150, 88,134,243,109, 69,164,194,109, 80,163,204,105,153,125,220, 94,209,127,103,156, 61,184, -186,232, 52, 94, 47, 56,125,117,247,237, 26,244, 24,113, 99,110, 45,186, 93,145, 37,234, 60,166, 35,176,203,104,151,241, 45, 78, - 41, 9, 74, 64,234, 84, 0,215, 43,127,189,146,225,251,255, 0,151,141,236,252,108, 47,255, 0,212,117, 98,186, 62,141, 70,193, - 80,109,171,134,184,206,250,111, 75,206,209,168,117,106,171, 77, 58,108, 79, 9,215, 41,240, 31,150,134,220,228,180,193,240,212, -166, 64, 56, 32,224,156, 28,234,227,226,156,231,194,238, 48,205, 41, 42,234,248,179, 49,165,167,161, 88,226,165,164,134,136, 37, - 61, 52,107,164,104,141, 76,102,218,138,130,204,119, 54, 10, 44,136,138, 40,222, 15,200,252, 93,224,124,162,178,142,139,131, 50, -202,202,154,247,146,106,202,201,235,245,213, 85, 72,218,137,121, 92, 72, 47,160, 51, 4, 81,176,187, 49,187,187,179,241,151,216, -125,188,123, 87,177,188,108,155,223,120,111,251, 87,109,173, 15,226,150,243,164,127, 8,239, 10,196, 74, 37, 35,235, 57,181,155, - 69,248,144, 61,246,107,137, 71,189, 56,212, 57, 74, 66, 51,149, 6, 20, 64,192, 58,156, 37,241,179, 92, 40,241,203,106,237, 46, -225,220,246,214,221,239,165,175,107, 85,218,191,118,150,241,196,122,245, 54, 52,165,184,202, 93,157, 69,169, 68,120, 38,161, 71, -146,245, 54, 31,189, 67,112,189, 2,106,233, 81,140,168,239, 42, 43, 5,184, 0,123, 51,184, 59,180,120,227,226, 73,123, 35,122, - 92,215, 45,167, 72,254, 47,238, 75,185, 21, 91, 80,210,133, 79,223,104,181, 43,126, 19, 17,149,245,197, 62, 75, 62,234,182,234, -239, 21,254,143,159,153,164,114,168, 12,131,250, 11,240,185,177,214,207, 9,155, 29,181,187, 7, 78,186,100,213, 41,118,141, 53, - 54,133,175, 62,230,151, 77, 98,183, 95,122, 59, 21, 90,234,227,165,168,172,176,212,202,144,167,198,170, 72, 83,113,218, 4, 70, -167, 60,241, 64,109,167, 22, 49,227,201,203,105, 56,158,154,191, 47,204,234, 97,226,113, 20, 74,241,160, 40,145,211,114,230, 28, -196,153, 44,218,218,229, 29,117,125,130,110, 45,140,253, 29, 23, 52,173,225, 42,188,187, 50,202,105,103,225, 38,158,102, 73,100, - 43, 36,146, 85,137, 41,207, 41,224,123,174,133, 0, 58, 57, 91,243, 2,216,220, 12, 63,180,219,118,145, 74,138,212, 72,144,152, - 67, 77, 33, 40, 72, 13,164, 97, 41, 24, 0, 0, 58, 12, 1,168,214,125, 36,238, 26, 44,170,175, 15, 59,113,196,205, 42,137, 14, - 22,224,216, 59,137, 73,176,171, 53,136,200, 98, 51,213, 75, 2,242,167, 86,221, 76, 42,145, 5, 42,168, 46, 29,213, 78,163, 42, - 16, 60,230, 50, 42,243,249, 18, 18,251,170, 18,111, 4, 30,160,228,122,141, 71, 19,233, 42,111, 69,183,107,112,145,182,219, 37, -239,241,156,189,119, 91,118,169,119, 3, 20,143, 17,179, 37,155, 43,111,169, 53,105, 85,170,210,208, 57,148,210, 5,199, 87,180, -163, 53,144,128,239,189,200, 40, 89,247,119, 16,170,219,194,167,174, 95, 16,120, 99,216, 11, 9, 94,160, 7,211,125,224, 42,220, -240,214,234,188,157,100,223,109,175,219, 22,175,140, 41,151,191,134,156, 91,250, 68, 41,133, 41,137,143, 85,182,168, 14,158,207, -166,253, 27,157,160, 45,183,222,221,240,212,253, 25, 45,199,171,212,118,115,136, 29,176,151, 33,247,169, 54,142,229, 80,110,122, - 75,110,168, 41,184,138,190, 45,181, 67,159, 26, 49, 42, 42, 67, 62, 61,152,135,139,120, 8, 14, 76, 91,137,202,221,112,234, 82, - 58,139,207,209,155,219, 90,149, 31, 99,247,187,115,230, 71,118, 60, 91,231,115,160,208,105,106,117,183, 80, 38,192,177,109,214, - 20,185,241,212,165,114,187, 24,213,110,170,156,110,100,164, 31, 22,152,242, 20,163,202, 2,101, 13,163,120,178,105,219,196, 78, - 41, 52,214,229,243,208, 27,116,230, 8, 34, 19,125,252,208,250,189,247,193, 60, 25, 90,149,240,199,132, 5, 93,249,190,206,228, - 95,175, 40,212, 76, 97,251,185, 38, 61, 63,225,181,182,194,210,210,210,213,119,139, 59, 11, 75, 75, 75, 67, 3, 11, 86,231,168, -244,137, 50,219,159, 34,151, 78,126,123, 74,105,109, 77,122, 12,103,101,180,182, 20, 20,202,155,146,182,138,208,164, 40, 2,146, - 20, 10, 72,200,193,213,199, 75, 89, 4,141,193,177,247, 96, 98,222,186, 77, 45,198,165,199,114,155, 79,113,137,239,123,196,230, - 87, 14, 50,154,153, 32, 41, 11, 15,203,109, 77,226, 67,220,237,182,121,150, 10,178,128,115,144, 52,195, 92,219,245,176,182,149, -122,185,103,220,245, 58,117, 38,177, 14,165, 62,137, 88,166,205,183,100,165, 18, 94,180,182,226, 54,233, 43,153,126,224, 91,159, - 5,155, 45,232,238,197, 88, 82,208,167,241, 10, 62,100,128,214,182, 39, 90,175,186,220, 34,237,174,239, 92, 87,189,203,114,202, -174,179, 62,249,180,173,155, 70,114, 96, 73, 97,182,233,177,104, 55, 4, 90,205, 74,117, 39,196, 97, 70, 44,234,189, 58,155, 70, -165,212,213,146,151,233,244,134, 89,229, 24, 36,239,229,230,133,166, 97,152,203, 44,112, 21,216,197, 98,193,245, 40, 4,130, 13, -194,173,216,141,137,210, 0, 32,219, 9, 75,204, 10, 12, 42,165,129,253,111, 75, 29,135,199, 97,247,227,225,226,159,135, 84, 56, -170,163,213, 95,119,172, 38, 13,219, 88,247,105, 22,125, 85,171,145, 66,203,155, 66,162,214, 18,136,138,166,123,195,149, 5, 46, -227,166, 8,173,167, 43,148,194,220,113,158,102,153,112,164,250, 39, 17,220, 62, 92, 21, 58, 93, 58,145, 81,141, 34,185, 94,151, - 97,212,226,211,133,167, 80,106,170,170,149,249,112,215, 45,203,118, 92,198, 28,166,133,197,168, 51, 86,164, 85,125,241,199,121, - 87, 1,181,165,233, 10,109, 15,161, 74,182,220, 60, 32,109,125,201,123,215, 47,185,174, 86, 27,170, 87, 55, 43,109, 55, 45,216, -204, 61, 29, 48, 33,205,219,106, 84,138, 75, 84, 24, 49,212,193, 12, 91,213, 70,167, 84,156,170,176, 58,201,118,122,151,204, 20, -134,139,116,232, 92, 31,109,165,187,120,209,239,138, 92,218,235, 53,202, 30,226,110,142,227, 66,113, 79, 68,117,145, 63,115,169, -177,233,206, 81,214,211,177,136, 85, 10,144,168, 20,183,233, 12,118,138,245, 57, 11,202,185,222, 14, 56,145,195,220,178, 86,106, -161, 46,139,128, 74,144, 27, 78,161, 30,201,246, 67,125, 94,175,251,237,109,176,143,246,189, 67,202,133,111,239,189,175,107,245, -235,111, 53,190,235,247,192,151, 23, 20,214,213,149,120,238,245,161,112, 90,149, 90,123,118, 93,223,110,218,116,155,146, 37, 34, -165, 34,213,175, 92, 87,142,216, 91,119,181, 10, 5,199, 93,102, 0, 98,139, 83,155, 86,172,154, 91, 40,230,144, 74,145, 17, 79, -169,147, 50, 58, 23,100,166,241,143,176,110, 91,118,252,155,150, 60,202,122, 85,111, 48,244,196,211,236,186,197,114,218,166, 92, -206, 88,209,239, 59,138,199,163,207,137, 73, 87,214, 85,120,214,244,153,202, 90, 88,103,194,117, 48,100, 69, 14, 42, 91,110,197, - 77,226,167,194, 53, 62,224,168,214,164, 92,187,177,184,117,202, 93,207, 86,176,238,171,166,132,252, 75, 34, 52, 75,138,247,219, -171, 22,218,178,232, 23,101, 70,124, 75, 81, 19, 90,146,100, 90,180,154,171,241, 99, 73, 98, 19,149, 8,201,195, 8,139,207, 29, -204, 89,174, 3, 54,230, 28, 89, 84,218, 93,213,112, 83,169, 85, 8, 13,183, 62, 50,109,173,179,153, 84,126,170,109,166, 45,137, -213, 38,111, 9,246, 59,149,202,124, 73, 44,199, 68,199, 96,199,169,183, 24, 77, 91,133, 9, 76, 55, 93,134,181,227, 28, 52, 99, - 65, 52,210, 44,161, 35,212, 99, 50, 88,176,141, 85,236, 90, 50, 67, 23,214,214,210, 86,214,179,139,144, 10, 77,101,201, 85, 4, - 92,245,183, 75,220,116, 61,133,133,239,123,246, 56,201,110, 78, 45, 54,210,143, 71,187, 69, 26,206,190,106, 23,221,159, 10,239, -174, 77,176,164,109,229,114,157, 93,162,200,181,109, 26, 5,194,253,122,230, 66,160, 17,111,208,220,164,222, 86,170, 68,245, 41, - 75, 91, 85,192,134, 91,117,109,188,218, 1,107,139,222, 30, 41,208,160, 38,182,212,154, 96, 81, 98, 34,164, 83,236,138,173, 86, -132,229,233, 73,143, 2, 77, 86,210,160,202,167, 82,150,229,102,224,167, 57, 85,155,240,177, 28,130,105,117, 4, 48,181,191, 26, - 67, 73,200,239, 78, 20,232,247, 93,227,184,151,181, 59,113,239,187, 58,175,186, 16,107, 20, 59,177, 20, 6,109, 25, 81, 38, 91, - 85,235, 26,194,177,234,148, 36, 49,113, 91, 83, 67, 13,174, 54,221, 80,228,162, 75,124,147, 24,118, 76,180,176,251,104,120,114, - 97, 71,129, 29,185,102, 75,134,157,116, 87,233,212,215,107,237,221,142,192,102,217,219, 23,234, 46,220,107,153, 26,125, 70, 66, -175, 41, 86, 50,235,200,165, 73,156,220,169, 11,130,138,162, 26, 67,243,150, 16, 68, 68,166, 32,196, 67,134,204, 81,243,102,154, - 55, 96, 25,172, 90,225,180,141, 75,126, 89, 22, 86,190,141,141,197,203, 50,155, 12, 6,246,205, 70,202,164, 3,177,176,251,143, -218,190,227,175,167, 96,112,231, 92,188, 65,108,253,156,237, 21, 85,234, 37,205, 77,117, 54,204, 75,162,127,188,109,197,114, 52, -173,190,178,220,185,255, 0,131,148,235,130,242,141, 38,152,219,246,149, 21,117,198, 37, 41,160,227, 97,192,213, 50, 76,191, 5, - 44,199,113,212,227,232,226,211,100, 21, 21,169,244,186, 61,249, 82, 97,202,109,126,252,241,169,187, 81,118,165, 40,183,173,245, - 24,119, 77,250, 28,149, 70,101, 47, 81,162,201,144, 35, 61, 61,165, 56, 94,122, 73,102, 57,144,174,112,155,149,235,194,253, 54, -254,147, 62, 77,127,114,247, 1, 75,185,109,201,150, 53,252,136,169,180, 27, 69,243,183,234,190,107,183,181, 30,208,169,151,173, -119, 21, 76,139, 79, 23, 21, 86,150,196,154,122,162,203,114,155, 49,212, 72,121,217, 74, 76,164, 52,251,165,194,237,235, 26,209, -179,173,109,147,172, 76,141, 81,133,182, 87,238,208, 87, 46,106,213,219, 71,163, 71,122,208,188,167,211, 39,166, 53,106,131, 47, -109,107,104,172, 50,153,222,250,242,158,167, 46,147, 80, 97,184,166, 59, 47,172,204, 15, 66, 37, 60, 57, 12,220,152,228,168,144, - 77, 35, 16,197,159, 68,106,161, 88,234,102,104,191,104, 88, 1,114, 84,173,192,114,193,114,237, 84,161,152, 32, 33, 64,176, 2, -228,155,141,128, 13,233,248,131,216, 12,110,107,245,216,236,216,210,174,155,102, 19, 51, 24,254, 12, 74,185,104,144, 74,126,174, -102,127,139, 76,118,175, 5,151, 65,108,123,159,142,181,183,206, 74,121,146, 94, 82,148, 50, 14,180,215,116,165,219,144, 32,213, -182,215,234, 10, 53,122,167, 42,135, 42,149,118,221,213, 70,214,169, 21,107,134,188,202,229, 86,106, 18, 4, 96,219,174,148,212, - 36,135,144,147, 32, 54,202,144, 24,109,164, 55, 29,160,157,199,135,107, 57, 22,193,139,100,166,162,160,236,107, 61,139, 88, 85, -154, 99,195, 80,113,154, 42,105, 34,162,212,101, 58,174, 69,115, 39,197, 74, 10,206, 14, 19,204,123,235,144, 59,209, 19,116,167, - 75,115,110,234, 52,115,107,213, 46,219,210,159, 99,220,151,204, 58,236, 73,212,214, 41,117,135,213, 18,124,250, 47,142,152,243, - 99,207,171, 72, 8,129, 8,201,140,219, 77, 59, 90,111,154, 74,212,166,148,189, 76,174, 26,121,106,106, 29,239, 34, 68, 9, 80, -110, 46, 9,181,201,219,183, 91,237,190,248, 60,236,234,136, 7,148,183, 95,203, 29, 10,217,141,236,135,113,237,133,155, 34,137, -104, 94, 55, 7,131, 64,143, 79,110,109, 18,136,236,138, 4,185, 20, 96,229, 38, 91, 17,174, 7,228, 6, 36,186,204,216, 18, 99, -188,239, 63, 35,146, 34,186,166, 84,235, 74,109,197,229,117,203,231,113,228, 81, 38, 76, 27,115, 80,181,169, 66, 35,130,109, 86, -161, 91,167,203,170,192,109,238,102,132,198,233, 52, 53, 63, 33,184, 44,146,133,204,125, 1, 82, 99, 70,241, 95,139, 22, 83,173, - 37,181,115,182,167,188,183, 37,129, 6,159,182,219, 79, 95,118,221,177,236,232, 45,208,224,166,152,212, 39, 19, 54, 68, 95,130, - 92,184,146,164, 69, 83,145,233,254, 40, 83,113,195,107, 72,113,182, 68,151, 7,140,251,152,109,170, 91,157,184,213,165,133, 85, - 47,171,178,127, 33,230, 75,114,171,213, 23, 35,250,156,199, 84,159, 15,147, 25,200, 41,229,229,200, 61, 52,228,156, 45, 83, 33, - 46,213, 9, 12,109,184,184, 98,214, 61, 46, 54,177,183, 93,246,239,141,118,204, 17,118,208, 89,135, 93,192, 23,247,125,248,187, -241, 61,191, 16,171, 20,120, 91, 43,100, 59, 38, 45, 50,223,155,227,110,163,143,165,182,103,212,183, 14, 41,104,204,160,206,247, - 98, 91,122,157, 79, 90, 99, 41,149, 50,183, 97,190,216,132,184, 46, 57, 2, 52, 39,156,210, 5, 41, 40, 66,220, 89, 66, 27,109, - 42, 90,220, 95,192,219,105, 72,202,150,226,212,112,218, 7, 82, 73, 32, 0, 59,247,214,204, 79,218,105, 60, 77, 67,171,238, 54, -206,186,245, 31,112, 40,173, 83,169, 53,218, 12, 24,116,183,153,221, 11,113,130,220, 51,122, 91, 76, 85, 22,150, 26, 76, 26,164, -146,195, 50, 28, 10, 83,241,203,235,111,199,134,228, 45,102,150, 23,179, 43,113,174,103,163, 78,220,186,172, 10, 83, 3,192,117, -104,185,234,127,195, 25,237, 41, 32,164,174, 53,175, 72, 83, 84,104,143,114, 21,146,164,150,212, 20,190,185,198, 4,179, 46,173, -203, 50,156,190, 58,121,100, 74, 87,131,103, 86, 97,169,159, 98, 92, 0, 11,184,125,138,176, 91,105, 32,109,107, 6,154,136,106, -106,106, 25,213, 76,161,250, 16, 54, 3,176, 36,216, 2, 58, 17,126,183, 62,252, 48, 60, 43,109,125, 79,127,119,214,218,118,158, -185, 44,218, 22,100,195, 85, 21,152, 78,173,176, 24,129, 33,164,215, 46, 72, 51, 89, 87,232,220,113,192,221, 34,148,242, 50,174, -121,115,101, 55,205, 29,104,115, 82, 78,211, 25,177, 59, 3,102,236, 21,187, 50,139,108,185, 46,165, 62,173, 33,153, 53,170,245, - 73, 17,145, 54,114,162,180, 89,135, 17,150,162,180,148, 67,165,176,133, 61,224,176, 57,202, 21, 37,197, 41,197,149,100, 62,122, -131,113, 6,106,185,165, 96,104,175,236,208, 11, 33, 34,197,137,182,166, 35,168,189,128, 0,244, 85, 23,220,156, 61, 80,210,154, -104,136,127,239, 28,220,251,189, 7,243, 39,212,156, 45, 45, 45, 45, 48,227,119, 11, 95, 8, 4, 16, 70, 65,232, 65,215,221, 45, - 12, 12, 83, 67, 45, 53,146,219,104, 65, 61,202, 82, 1, 63,128,213, 77, 45, 45, 12, 12, 51,123,215,177,246, 78,250, 90,142,219, - 55,132, 15, 17, 77,169, 82, 41, 53, 88,229, 45, 85, 40,211,185, 57, 19, 46,159, 36,164,248,107,198, 2,208,160,166,221, 72,229, -113, 10, 24,199, 21, 55, 95,128,189,229,176,101,201,126,218,136,213,251, 65, 75,139, 49,164, 82,249, 99, 86, 27,103, 36,161, 50, -233, 82, 22, 57,221, 9,192,203, 14, 59,205,140,242,163, 60,162, 65,250,242,180, 33,192, 82,180,165, 96,247, 10, 0,143,219,170, -147,196,127, 5, 56, 23,196,226,149, 89,229, 28,148,121,204, 74, 17, 43,169, 25, 98,168,208, 62,202, 73,169, 94, 41,209,127, 84, - 75, 27, 50, 11,136,217, 1, 55,183,188, 54,241,191,143, 60, 47, 87,165,200,171, 99,172,201,165,114,239, 65, 86,173, 45, 54,179, -246,158, 61, 46,146,192,237,250,198, 41, 21, 92,216,200,174, 64,180, 88,213,177,251,198,219,222, 2,182,186,252, 11, 10,228,255, - 0,246, 90,178, 91,207,151,233,189,211,147, 31, 62,108,117,239,167,207,108,248, 36,222, 91,238,100,115, 87,165,127, 3,105, 10, -113, 62, 60,170,176,241,106, 37,172,142,111,119,166, 48,172,135, 49,156,120,203,100, 12,103,174, 48,100, 58,105,148,245, 30, 99, - 13,130,123,231,195, 26, 33,168,236, 50, 48,211, 77,182, 63,217, 72, 31,208, 53, 83,100,223, 67,239, 15,232,107, 82,167, 52,206, -115, 28,238,154, 50, 15,179,179, 69, 4,111, 99,246,100,120, 99, 18,149, 61,249,111, 17,244, 97,139,115, 58,250, 99,248,133, 95, - 67, 37, 46, 85,146,229,217, 29, 76,128,143,104, 85,150,162, 68,184,251, 81,164,210, 24,131, 14,220,200,229, 95,240,156,107,150, -193,112,227,103,236,125, 9,184, 52,136,161,218,131,220,143, 84,106,146,130, 29,168, 84,101, 37, 56, 15, 74,120, 32, 14, 80, 10, -130, 27, 64, 13,182, 9, 8, 72,201, 39,100,244,180,181,212,185, 94, 87,151,100,153,125, 38, 85,148,209, 71,151,101,180, 40, 35, -134, 24,148, 36,113,160,232, 21, 70,221,110, 73,234,204, 75, 49, 36,147,142, 85,205,115, 92,203, 59,204,106,243,108,222,182, 76, -199, 50,175,115, 36,211,204,197,228,145,207, 82,204,119,233, 96, 7, 69, 80, 21, 64, 0, 0,180,180,180,181,191,134,252, 45, 45, - 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12, 45, 45, 45, 45, 12, 12,104, 15, 16,151, 95, 24, 54,239, 17,123, - 83,103,109, 12, 84,212, 54, 75,118, 69,182, 47, 27,216,219,148, 90,131,187, 24,189,180,184,101, 92,219,132, 23, 42, 76, 82, 37, -139,234,202,151, 77,160,210,125,241,138,135,213,181, 58,116,137,140,248, 9, 90, 64,231,117, 43,136,239,106,117,199, 89,185,105, -117, 10, 52,219, 42, 68,189,220,218,235, 50,177, 79,135,177,151,213,106,118,216, 64,186,248,146,182,109, 10,197, 94,196,168,220, - 27, 33, 79,182,247, 3,109, 33,236,132,171,166,163, 88,171, 53,117,221,106,132,229, 62, 29, 72,212, 41,241, 36, 73,106, 28,131, - 84,132, 47, 28,201, 10,199,108,140,227, 84, 76, 88,197, 69, 69,150,202,143,115,203,215,203,250,134,165, 20, 60, 69, 77, 73, 4, -113, 75,195,212, 85,111, 18,196, 57,143, 18,150,102,142, 70, 98,238, 24, 50,182,184,244, 70,234, 2,130, 99, 89, 13,218, 73,249, -209, 44,195,134, 42,235,106, 36,154, 46, 37,175,163,142, 87,148,152,210,102, 8,171, 36,106,161, 35, 42,200,203,203,148, 73, 42, - 49, 44, 87,154,209,139, 36,116,252,158, 18,111, 54,228,113,174,250,120,178,217,207,122,222, 77,206,102,216,218,235, 50,169,182, -183,141, 11, 96,170,118,165,187, 86,174, 81, 46, 93,174,102,187,109,151, 87,181,116,241,125,223,117,200,235,187,229, 59, 34,206, -174, 87,232,109, 83,149, 52, 24,150,188,232,144,226,189,121,221,222, 37,189,160,182,229,237,191,208,108, 59, 58,250,169,203,183, -173,190, 38,157,179,108,216,155, 3, 85,170, 88,180,107, 78,206,216,154,213,197,195,166,226,216,251,164,154, 35,177,247, 99,117, - 46, 45,225,139,109,211,166, 90,113,234, 19,223, 67, 85,233,113, 87,111, 66, 52,228,205,149,220, 51, 22, 58,149,204, 89, 65, 80, - 24, 4,167,168, 30,131,211, 95, 12, 72,196,133, 22, 91, 42, 29, 1,229, 25, 3,211, 75,197,197, 20,136,176,163,240,229, 36,235, - 18,176, 33,145, 44,210, 60, 84,241,180,133, 86, 48,170, 73,131,152, 2, 42,144,206,124,197, 76,130, 93,105,120, 70,177,218,103, -143,138, 43, 96,121, 93, 72, 43, 36,132,172,105, 45, 76,169, 24,102,149,157,128, 21, 28,178,100,103, 82,136, 60,129,132, 70, 29, - 28,224,214,249,226, 54,181, 83,222,219, 55,136, 39, 43, 85,241,100, 94,246,107, 27,119,127, 86,246,245,141,190,145,120, 91, 23, -102,204,109,181,247, 91,109,168,212,184, 17,169,213,150, 40,215,245,201,118,208,253,234, 19, 64,161,116, 5, 67,154,165,207,141, - 37, 70, 41, 62,217,106,175, 29, 60,104,113, 79, 93,164, 80,248, 84,226,128,108,102,199,212,235,214, 38,211,193,135,178, 27,169, - 46,147,113, 46, 44,255, 0,115,185,183, 61, 15,199,182, 20,196,245, 87, 38,211,216, 92, 23,154, 60,130,143, 6,156,148,254,148, -200,113,217,206, 33,150,155, 57, 67,105, 73,237,144, 49,211,211, 67,187, 77,128,242,138,221,136,195,139, 61,212,180, 5, 19,247, -157,111,240,175, 28,175, 11,103,243,113, 12, 25, 5, 53, 85, 91, 66,177, 70,164,152,227,133,180, 34, 75, 44,105, 26,133, 87,155, - 75, 19,164, 5, 65, 35,170, 0,166,216,110,227, 15, 15,159,139,248,110, 14, 25,168,226, 74,186, 58, 36,153,165,149,192, 89,101, -157, 4,143, 36, 48,202,242,146,204,144,234, 80, 53, 18,206, 99,141,156,150, 92,126,116,252, 63,207,246,190,240,179,111, 84, 45, -109,128,218, 78, 44,118,210,133, 86,172, 61, 95,169,195,163,240,195,113, 77,114,125, 93,248,145, 32,174,108,185,213,189,175,149, - 33,245,136,112, 98,182,132,169,210,134,210,214, 16,148,229, 89,216, 95,229,123,244,129, 63,242,126, 52, 63,251,173,204,255, 0, -254, 61,169,231,253, 81, 76,255, 0,200, 99,127,246, 73,254,173, 47,170, 41,159,249, 12,111,254,201, 63,213,169,173, 79,140,244, -149,147,203, 85, 89,225,206, 77, 85, 85, 49,212,242, 73, 10,188,142,118,221,157,162, 44,199,110,164,147,211,211, 16, 58, 95, 2, -107,104,105,226,164,162,241, 71, 60,163,164,128,105, 72,162,157,227,141, 23,246, 81, 18, 80,170, 58,236, 0, 27,226, 37,155,115, -253,212,126, 49,125,153,188,113,237,174,247,198,222,153, 59,193, 46,175, 96, 72,219,250, 22,228,109,202,182,202,225,187,172,138, - 21, 82,137,114,222,246,157,180,203,246,205, 29, 85, 20,205,129, 74,154,216, 8, 67,198, 83,220,180,197, 40, 34, 90,211,174,108, -123, 29, 56, 93,226,149, 28,122,109, 85,237, 78,219,189,198,219,219,123,106,234,245,201,187,145,114,220,214,181,114,217,129, 10, -149, 34,223,173, 81,102, 90, 18, 69,110, 36,113, 58,173, 81,126, 98, 97,251,154, 2,223,101, 46, 57, 49, 77,165, 17, 22,226, 63, - 64, 22, 96,195,143,159, 6, 51, 45,115, 12, 43,145, 0,100,124,245, 69,170, 85, 61,151,140,134,162, 50,135,137, 36,184,148, 36, - 40,147,243,198,154,161,241,114,174,151, 42,226,204,162,135,135, 40,168,169, 56,157,157,130, 68,186, 35,166,230,211, 71, 75, 40, - 72,213, 66, 72,165, 35, 14,129,130,132,145,152,182,181, 58,112,239, 63,130,212, 85,153,191, 6,103, 85,252, 79, 95, 95, 91,194, - 43, 26,151,149,181,201, 87,201,170,146,174, 18,242,179, 23,141,131,202, 81,202,150, 47, 18,162,175, 45,134,178, 91, 28,254, 11, - 94, 39,235,248,104,231,255, 0,249,185, 70,127,110,177,109,192,143, 34, 93,135,122,196,136,195,210,165, 74,180,238, 40,241,163, - 71,105,111, 72,145, 33,234, 68,198,217, 97,134, 91, 73, 83,175, 45,197, 37, 41, 74, 65, 82,148,160, 0, 36,235, 46,210, 35, 32, -131,216,244, 58,169, 35,115, 27,163,129,114,132, 31,220,111,139,166, 68, 18, 35,161, 54, 14, 8,253,226,216,132, 15,176,167,134, -142, 35,182,159,142,131,114,110,159, 15,251,217,182,150,232,218, 43,214,152,107,251,129,181, 87,213,153, 69,250,202, 85,110,207, -118, 45, 59,235, 91,142,131, 25,143,127,113,168,178, 84,219, 62, 39,136,180,199,112,165, 36, 33, 68,117, 47,219,205,195, 55, 28, -251,238, 54, 30,243,225,142, 29, 70,225,177,182, 89, 85,139,166,109,187, 96,220, 82, 40,155,167, 77,220,121,146, 24,110, 13,239, - 72,138,151, 99, 46,172,220, 26, 44, 70, 24,129,245,108,167, 42,145,159,169,206, 83,113, 11, 78,151, 83, 34,132,192,132,135, 60, -100,198,101, 46,147,146,224, 64, 11,207,219,162, 84,132,172, 20,173, 41, 82, 79,112,160, 8, 63,113,213,149,152,120,159,153, 87, -113,173, 39, 27,140,170,149, 43,105, 34, 16,136, 36, 15, 44, 37,116, 73, 27, 19,114,172, 24,164,140, 1, 7,202,108,119,232,106, -156,179,194, 76,171, 47,224, 42,222, 1,108,226,174, 74, 26,217,140,230,162, 50,144,206,175,174, 41, 20, 11, 43,161, 85,120,148, -144, 65,212, 46, 54,216,136, 25,208, 61,170, 30,218,237,168,164, 39,110,107,112,119, 42,161, 86,167,180,154,124, 73,123,145,195, -123,147,175,152, 73, 79, 52,102, 82,236,185, 86,131, 14,213,229, 7, 80,172, 61, 80,106, 99,238,173, 39,196,113,206,163, 77,149, -151,192,119,180,211,218, 97,189, 44,110, 46,255, 0, 64,220,170, 74,107, 38, 36, 90,246,237,239,133, 26, 85,175, 26,139,111, 48, -234,221,106,157,101, 88, 47,198,128,235,144, 71,143, 49,200,112, 41, 20,248,116,144,252,135, 28,117,248,190, 58,222, 95,232, 6, -237, 2,142,250,185,220,129, 29, 74,245,240,211,253, 90, 50, 61, 62, 20, 79,251,222, 43, 45, 99,205, 8, 0,254, 56,212,132,120, -202,153,122,212, 79,195, 92, 13,149,240,246,109, 84,165, 90,170, 40,213,156,106,234, 81, 86, 56,128,223,205,165,153,208,176, 5, -209,237, 99, 26, 62, 5,190,100,244,176,113, 87,136, 57,191, 19,100,212,110,174,148,114,202,202,135, 79, 64,238,210,202, 78,215, - 82,200,169, 32, 82, 66, 58, 94,248,215,190, 20,248,114,178,184, 89,217, 43, 15,102, 44, 56, 70, 37,191,100,208,163,210,163, 45, -222, 85, 76,168, 74, 82,220,153, 87,173, 84,156, 72, 1,218,172,250,188,153,211, 37, 41, 41, 74, 21, 34,123,133,180, 33, 28,168, - 78,200,105,105,106,151,168,168,158,174,121,234,170,101,105,234, 42, 93,164,145,216,221,157,220,150,102, 98,119, 44,204, 73, 39, -185, 56,189,233,169,169,232,233,169,232,233, 97, 90,122, 90, 84, 88,227,141, 5,149, 35, 69, 10,136,160,108, 21, 84, 0, 7, 96, - 48,180,180,180,180,142, 23,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194, -210,210,210,208,192,194,210,210,210,208,192,194,210,210,210,208,192,194,214, 53,117,217,246,213,239, 67,171,219,183, 69, 34, 21, - 94,149, 91,165, 79,163, 84, 24,146,195,107,113,112, 42,113, 93,135, 45,182, 95, 41,231,142,178,203,206,114,173, 5, 42, 66,136, - 82, 72, 80, 7, 89, 46,150,178, 24,169, 5, 77,136,238, 48, 8, 7, 98, 46, 49,196,171,235,133,221,241,219,202,252,170, 5, 5, -186,133,255, 0,110, 54,227,142, 91,183, 24,180, 43, 87, 5, 89,218, 66,156, 34, 28, 91,130,109, 22,174,210, 93,171,176,128, 27, -113,199, 24,105,215,249, 3,170, 47, 40,169,247, 49, 56,124, 52,111,189,235, 81,137, 67,173, 91, 85,184,244, 57,175, 52,212,250, -127,240, 58,177,105,211,231, 52,181, 0, 89,174,220, 21,122,163,202, 77, 11,186,164,199, 97, 13, 46, 66, 17,224,173,197,178,183, - 24,123,188, 58, 90,146,167, 20, 85,172, 74,141, 2, 59,168,182,162, 91,115,107, 92,168, 54,223,184,232,119,216, 13,176,222,114, -248,203, 92, 57, 11,126,155,126, 7,249,225,157,217,141,156,160,236,245,178,138, 85, 60, 53, 50,183, 53, 12, 57, 94,173,134, 82, -202,230,190,210, 57, 90,139, 21,176, 63,193,105, 44, 36,169, 17,217, 29, 0, 37,106,202,214,163,167,139, 75, 75, 81,233,166,150, -162, 87,154,103, 50, 73, 33,185, 39,231, 96, 58, 0, 54, 3, 97,182, 55,149, 85, 20, 42,139, 42,244,194,210,210,210,210, 88, 54, - 22,150,150,150,134, 6, 32,111,253,251,111,253, 25,127,246,206,255, 0,117, 13, 84, 31, 77,167, 61,189,153,157,251,127,142,111, -251,168,234, 6,201, 25, 61, 71, 79,216,116, 66, 7, 92,227,160,237,253, 29,191, 61,180,202,213,149, 2,195, 94,231,220,191,150, - 52,249,178,126,215,224, 63, 44, 79, 25, 63, 77,151, 39,255, 0, 6,119,218,127,150,103,111,251, 41,107,223,247,236, 95,244,103, -255, 0,219, 47,253,212,245, 4, 4, 2, 7, 95, 63, 47,223,170,169, 25, 61,186,122,250, 31, 81,243,210,126,219, 83,255, 0, 19, -240, 95,203, 24,230,201,127,181,183,192, 98,119,163,233,176,103, 24,246,104, 30,163,167,248,229,121,231, 24,255, 0, 53, 62,250, -168, 62,154,225, 35,175,179, 71, 31, 47,229,149,254,234,154,130, 42, 65,207, 67,215,212,255, 0, 96,209, 9,238, 1, 57,207, 66, -113,249,198,136,213,245, 67, 97, 37,143,253, 43,249, 99, 60,217, 45,187,126, 3,242,196,238, 7,211, 87,201,199,247, 52,251,255, - 0,207, 39,240,255, 0,146,174,190,171,233,171,114,130,127,185,167,159,151,242,200,255, 0,117, 93, 65, 69, 9,235,159,151, 79, -207,231,190,171, 4,115, 15,151,207,215,229,233,211, 26, 76,230, 21,118, 63, 93,254, 85,254,156, 37,237, 18,245,215,248, 15,203, - 19,165, 79,211, 89, 73, 4,159,102,170, 83,233,158, 50,135,207,254,106,191, 45, 18,215,211, 80,241, 19,205,253,205, 94, 80,123, -127,142, 62,115,255, 0,101,109, 65, 56, 67,100,168, 18,128,163,223,185,239,242, 25,237,223, 87, 54,211,203,202, 0, 0,118, 29, - 49,229,158,131,238,210,103, 49,173, 22,250,254,191,225, 79,233,198, 13, 68,189,155,240, 31,150, 39, 74,159,166,146, 79,127,102, -191, 47,111,249, 99,122,255, 0,213, 99, 85, 71,211, 69,207,250, 54, 71, 94,199,249, 98,244,199,175,249,172,106, 11,137, 0,145, -159, 63, 79,199,240,209, 41, 7,203, 0,118, 57,237,143, 77, 96,230, 85,191,241,191,202,159,211,140,123, 76,223,183,248, 15,203, - 19,158,254,253, 11,254,141,175,251, 98,127,186,206,189,143,166,127,144, 15,247, 54,241,159,249,225,255, 0,186,214,160,208,144, - 8,234,123,244,199,237,253,218, 36, 39, 29,124,250,119, 29,189,116,145,205, 43,199,251,255, 0,242, 39,187,252, 56,199,180,205, -109,218,196,123,135,229,137,201,143,166,116, 79,250, 55, 15,111,252,240,187,127,217,107, 94,199,211, 56, 39,191,179,119, 29, 51, -254,120, 95,111,127,241, 91,233,219, 80,111, 66,135,111, 60,254, 7, 24,209, 8,238,125, 72,239,223, 31,119,231,182,138,115, 90, -253,254,190,214,255, 0, 10,127, 78, 11,237, 51,116, 50, 88,250,233, 31,150, 39, 26, 62,153,166,112, 71,179,131, 57,237,142, 48, - 63,221,115, 94,135,211, 49, 57, 0,251, 55,241,156,227,252,112, 51,219,254,171,154,131,194, 82, 70, 48, 64,232, 51,143, 33,242, -252, 52, 66, 49,158,191, 96,244,255, 0,142,136,115,108,195,114, 42, 46, 7,248, 19,250, 48, 95,107,159,246,255, 0, 5,252,177, - 56, 65,244,203, 15,159,179,135, 31,245,191,207,255, 0,149,221,122,254,252,175,166,127,185,197,246,143,229,127,219,211,254, 75, -218,132, 10,112, 10,114,160, 9, 29, 7,168, 61,127,167, 94,243,144, 72,238,122,100,244,207,207, 69,253, 47,152,255, 0,204,127, -146, 63,233,198, 13, 93, 64,255, 0,121,248, 47,229,137,189,127,126, 89,255, 0, 71, 16,255, 0,239,127,229,235,254,107,186, 95, -223,150,127,209,197,255, 0,107,255, 0,247, 93,212, 32,130, 70, 78, 83,156,121,142,227,167, 97,235,175,129, 39, 36, 96,158,227, -228, 15,174,116, 63, 75,230, 63,243, 31,228, 79,233,198, 61,174,163,175, 50,254,235, 47,229,137,191,255, 0,126, 86,112, 79,247, - 56,187, 99, 63,227,127,235,216,255, 0,154,238,144,250,101,100,228, 15,103, 9,200, 56,255, 0, 59,241,143,159, 95,228,189,168, - 65, 28, 19,201,158,160, 12,125,189, 71, 93,124,228, 56, 61, 58,142,199,215,215, 67,244,190, 96,127,246,143,242, 39,244,227, 34, -170,163,188,157, 61,195,242,196,224, 26,250,101, 42,117,105, 66,125,155,238,173, 74, 90, 16,134,216,226,229,114, 31,117,110, 45, - 45,180,204,120,237,112,184, 87, 34, 67,142,173, 8,109,180, 2,183, 28,113, 40, 64, 42, 80, 26,145,125,139,237, 28,187,106,123, -107, 97, 92,219,161,195,163, 59, 99,184,215, 61,173, 2,228,186,182,189,141,220, 55,106,172, 25, 85, 68,137, 81,173,154,141,204, -118,206,154,106, 53,248,244,231,225,154,131,105,167, 50,136,178,214,252, 70,220,146, 35,151,215,249,251,123, 18,120, 79,167,111, -111, 18,114,247,186,251,163, 49, 85,218,222, 24,163,210,111, 53,194,156,128,245, 62,228,222, 74,163,175, 29,169,183,157, 96,172, - 9,108, 83,222,131, 80,184,101, 52,174,132,209, 41,225, 89, 75,196, 25,105, 85,110, 39,101, 73,126,161, 41,197,174, 75,239,169, -114,139,171,241, 63,239,176,162,251,170, 86,121,157, 65, 89,113, 67, 7, 35,169, 4, 18,115, 82,113,247,137,217,238, 79, 87, 22, - 91,147,230, 34, 26,136,198,185,156, 69, 79, 33, 23,221, 80, 44,145, 56, 6,222, 98,116,157,153,122,110, 71, 99,125, 27, 60, 13, -161,241, 3, 47,175,226,174, 50,162,122,236,146, 71, 48, 81, 64, 36,150, 14,107, 70,214,150,114,244,239, 20,133,117,222, 36, 93, - 65,110,172, 77,203, 45,186,186,215,180, 61,151,139, 72, 78,210, 40, 56,230, 50,147,125, 47,149, 37, 77,151, 65,231,254, 5, 97, - 72, 9,229,201,242,231, 29, 51,240,235, 38,139,199, 80,146,160,145,181,193, 5,104, 75,168,255, 0,223,202, 78, 90, 39,195, 82, -214, 13,164, 11,120,116,164, 96,142,161, 65, 94,120,215, 37, 97,212,227,199,149, 78, 9,151, 17,105,146, 42, 43,109,228,184,158, - 66,150,152, 96,162, 49, 81, 60,133,229, 15, 16,124, 93, 73, 25,192,198,117,127,135,119,198,133, 85,181,154, 92,152,232, 50, 28, -186,224, 45, 77,133,168,134,145, 77,106,160,134,156, 25,228,241,210,136, 43, 91,107, 60,205,168,199, 90, 80, 50,188, 26,248,120, -191,199, 91,223, 62,222,224, 91,217,168,122, 27,111,255, 0,163,123,205,183,183,173,183,183, 70,215,125, 26,252, 47,211,253,139, -131,216, 17, 28,143,189,110,104,215, 17,164,174,118, 53,123,111, 17, 95, 80, 78,224,219, 29,102,143,198,144,125,124,131,109, 74, - 72, 74, 85,145,120,165,105,198, 84,135, 7, 50,109,142,133, 46,164,167, 31,102,112, 78, 53,145,195,226,200, 74,117, 13, 42,195, - 67, 36,164, 41,197, 27,185, 11, 13, 21, 41, 73,194,147,252, 30, 10, 94, 8, 28,197, 41, 32, 5,103, 39,166,121,115, 2,240,167, - 70, 20, 80,180,187,134,229,185, 73,145, 29,134,150,242,101, 73,157, 30, 64, 97,134,152, 42,230,117,245, 61, 19,152,140,164, 39, - 42, 42, 1, 32,105,211,165, 85, 16,235,177,228, 37,200,205, 55, 48,170, 47,130,211,169,144,168,175,186,194,157, 76, 57, 13,129, -240,203, 11,104,243,140, 39,147,168, 74, 84, 64,202,195,197,222, 56, 99,182,126, 45,113,183,178,209,131, 98, 7, 66,105,253,247, -233,115,110,128, 3,138,247, 55,240, 35,129, 40,195, 21,225,118,129, 72,107, 19, 85, 94,119, 82,194,219,213, 27,146,171,175, 96, - 71,152,124, 11,113,237, 58,246,213,110,191,179,158,220,176, 55, 74, 7, 3, 3,126,182, 34,238,121,155,106,229,220,202, 87, 17, - 78, 89, 19,118,199,113,165,190,239,212,246,205,239,105,183,176,245,193, 6,220,171, 67, 74, 62,167,174,138,129,141, 46,106, 28, -166,201,143, 6, 89,138,153,124,121, 63, 76,188,131,211,217,192, 8,233,212,113,129,228,124,255, 0,205,115,211, 93,240,187,108, - 11, 23,121, 44, 27,215,104,183, 62,212,167,238, 22,218,110, 61,183, 91,177,239,203, 66,160,208, 85, 46,224,160, 85, 98, 2,253, - 61,213,161,121,131, 48, 56,162,244, 73, 72, 34, 68, 57,212,248,242,227, 45,183,153,109, 73,252,231,120,230,246,106,239,183, 6, - 60, 82, 94,220, 62, 83,108,205,193,221, 91, 81,182, 13,241,179, 87,213,187,104,220, 55, 36,155,231,104,106,242,164, 10, 21, 78, -166,154, 13, 41,239, 10,232,165,186,219,212,154,235,124,169,228,168,210, 87, 32, 1, 30,100,114,171, 79,131, 60, 72,204,115,136, - 37,165,205, 43, 2, 87, 83,141, 66, 67, 28, 72,146,161, 61,172,129, 53,165,192,178,216, 50, 16, 84, 54,151,115,201,126, 41,240, - 67,240,133, 90, 87,229,108, 70, 77, 84,193, 66, 19,169,160,115,246, 86,238, 90, 66,143,111, 41,114, 72,109,181, 29, 64, 44,156, -255, 0,191, 47,234, 71,247, 56, 71, 65,159,243,192,245,237,255, 0, 37,221,124,254,252,192,255, 0,251,184, 58,127,233,129,251, -191,146,230,161, 89, 94,176, 47,187, 81,114, 17,117,216,247,149,174, 99,171,195,147,252, 35,181,171,244, 20,198,115,152,128,219, -235,171,211, 88, 13, 56, 84, 8, 9, 81, 4,144, 64, 7, 88,123, 74, 75,159, 19, 69, 14,164, 21, 0,180, 45, 46, 36, 20,146, 20, - 9,109, 68, 2, 15,124,246,212,249, 51,218,185, 55,142,181, 92,123,132,103,248, 46, 42, 15,110,150,246, 51, 0,111,208,133,191, -238,181,241, 56, 81,244,203,137,239,236,225,192, 29,201,226,255, 0,215,254,171,186,248,126,153,120, 29, 15,179,135,175,203,139, -254,159,143,242, 93,212, 32, 71,158, 48, 9,235,223,204,253,191,118,188,167, 39,161,193,199, 83,242, 36,159,221,165,127, 75,230, - 63,243, 31,228, 79,233,193,189,170,162,223,222,111,255, 0, 72,252,177, 56, 1,244,203,201, 56, 30,206, 14,191,250, 95,255, 0, -186,238,190, 43,233,152, 4,128,127,185,195,159, 80, 56,191,234, 62,223,241, 93,212, 32,142,124,128,239,248,116,243,251,245,224, - 2, 84,115,211, 3,186,122,117, 63,111,200,157, 15,210,249,143,252,199,249, 19,250,113,159,106,159,254, 39,224, 63, 44, 78, 11, -251,242,241,128,127,185,197,247,127, 43,254,191,183,133,221, 47,239,203,198, 79,253,206, 35,129,231,252,175,186,125,255, 0,226, -187,211, 80,130, 66, 58,149, 12,115,116, 4,159, 63,159,111,206, 53,240,167,226,206, 58,142,135, 29,189, 58,232,126,151,204,127, -230, 63,200,159,211,129,237,117, 31,183,248, 47,229,137,190, 15,166, 96, 9, 35,251,156, 36, 99,204,241,125,223,236,255, 0, 21, -237,123, 31, 76,184, 28,127,220,226,239,156,127,141,247,167,127,249, 47,106, 16, 24,207,151,108,247,244,199, 92,126,124,181,244, -117,192,232, 61, 63,183,166,135,233,124,199,254, 99,252,145,255, 0, 78, 49,237, 85, 23, 31, 89,248, 47,229,137,191,143,166, 88, - 79,250, 56,122,245,233,252,175,255, 0,163,252, 87,122,235,233,250,101,100,119,246,112,227, 63,243,191,235,248,127, 37,221, 66, - 19, 3,190, 50, 71, 94,159,213,159,150,190,247, 32,249,119,193, 25,253,190, 93,244, 63, 75,230, 63,243, 31,228,143,250,112, 61, -170,163,254, 39,224,191,150, 38,238,126,153,113, 31,232,224, 56,245,254, 87,248,253,159,201,119,166,169, 43,233,153, 17,254,141, -252,140,227, 63,203, 3, 30, 93,255, 0,205,115, 80,137, 32,156,156, 0, 51,142,224,117,245, 61,123,245,213, 5, 32, 17,128, 51, -158,253,127, 63,145,172,254,151,204, 44,127,180,111,255, 0, 68,127,211,140,251, 84,255, 0,183,248, 15,203, 19,121, 63, 76,212, -130,113,236,221, 39, 7, 31,231,129,248,255, 0,201,111, 95, 15,211, 55, 35,183,179,120, 30,153,255, 0, 60, 47,217,254,107,125, -245, 7,245,128, 51,129,133,119,198, 14, 62,255, 0, 77, 10,172,140,244, 29,122,244,245, 31,111,111,237,209,151, 54,175,239, 83, -123,255, 0,129, 63,167, 25,246,169,251,191,224, 63, 44, 78, 33, 95, 76,228,167,253, 27,185, 30,191,203, 11,253,214,245, 72,253, - 51,220, 28,127,115,115, 63,245,194,255, 0,117,175, 77, 65,216,247,233,128,113,149, 30,227, 30,127,111,150,188, 16,112,114, 0, -207, 92, 14,248,249,244,232, 59,232,227, 53,175, 32, 30,127, 95,240,167,244,224,235, 81, 49, 23, 50,126, 3,242,196,226, 85,244, -208, 57,127,209,181,145,235,252,176,255, 0,221,103, 84,207,211, 67, 35,253, 27, 63,135, 24,191,238,177,168, 57, 45, 35, 56,193, -193, 29,252,191, 31, 95,234,208,235, 73, 57,230, 30,125,255, 0,163, 74, 46,103, 90,127,223,127,149, 63,167, 0,212,205,183,155, -175,184,126, 88,156,137,250,105, 24,200,254,230,199,108, 99,252,113,123,255, 0,217, 99, 84,213,244,210,249,127,209,175,159,250, -227,126,239,228,175,168, 52, 41, 61, 72, 62, 89,255, 0,142,168, 41, 56, 62,164,103, 31,126, 58,232,227, 50,173,255, 0,141,127, -251, 83,250,113,145, 81, 41,232,255, 0,128,252,177, 57,179,244,211,113,219,217,173,147,233,252,177,255, 0,221, 95, 94, 15,211, - 80,198,127,238,106,246,242,254, 88,253,127,254,213,181, 6, 5,142,164,147,229,220,116,200,251, 71, 97,211, 84,150, 6, 51,159, -179,211,246,104,227, 48,172,218,243, 94,253,244,175,244,227, 62,209, 55,237,254, 3,242,196,231,207,211, 85, 32,103,251,154,121, -199,252,242,113,255, 0,229, 87, 84,149,244,214, 72,255, 0, 70,150, 71,254,153, 61,191,236,169,168, 45,169, 56,237,219,247,143, - 95,191, 67, 44,117, 35, 3,175, 92,104,195, 48,171,190,242,237,255, 0, 74,254, 88, 56,158, 75,253,187,253,195,221,238,196,233, -215,244,215,249, 15,254, 13, 12,143, 95,229,149,251,191,146,159,174,168, 31,166,202, 57,185, 71,179, 56,159, 60,255, 0, 44,190, -159,179,133, 62,250,130,147,205,243,116, 35,207,203,167,159, 76,103,203,250,244, 42,153, 60,221,200, 3,183,150, 62,206,158,154, - 88, 86,212,216,125,109,255, 0,237, 95,203, 6,231, 73,183,159,240, 24,157,183,247,236,196,140,143,102,104,199,110,188,102,224, -231,211, 31,201, 71, 94, 15,211,105,229,239,236,204,199,253,115,191,221, 71, 80, 71, 82, 0,206, 51,208,227,167, 94,222,154, 25, -105, 72, 7, 35,174,124,242,122,252,243,246,104,235, 89, 57, 27,203,191,192,126, 88,199, 58, 77,183,189,253,195, 19,188,254,253, -183,254,140,191,251,103,127,186,134,150,160,120, 80, 60,142, 63,111,239,210,209,253,170,163,254, 39,224,191,150, 13,205,147,246, -191, 1,249, 99,234, 65, 0, 3,249,235,162,146, 15, 64,123,244, 31,156,106,138, 70, 79,203,207,243,246,232,132, 12,159,179,175, -223,157,105, 22,185,191, 75,116,194,120,174, 1, 61,189,113,249,249,106,176, 0, 96,121,121,254,253, 83, 70,122,244,200, 36, 12, -231,183,231, 58,174,144, 14,115,158,131, 61, 52, 76, 12,123, 74, 74, 73,234, 49,249,252, 52, 66, 7, 76,250,254,204,106,130, 50, - 71, 92,224,158,153,235,223,231,231,253,154, 41,180,246, 7,203,169,252,253,186, 65,141,205,241,131,176,191,166, 43,163, 29,135, -197,143, 79,159,217,162,144,140,142,131, 3,207,237,253,231, 84, 17,208,244, 3,175,125, 20,140,253,223,191, 68, 98, 69,192,194, - 36, 91,248,227,210, 7, 98, 79, 83,230,122,244,253,253,180, 72,193, 3,207,211,167,159,110,218,164,145,147,246,117,209, 9,237, -140,128, 1,200,251, 71,223,219, 73, 49,185,233,108, 99, 21, 18, 0,193,193,235,223, 61,241,233,162, 83,140, 14,157, 60,134,124, -191,118,168,164,115, 31,219,247,116,237,162, 80,158,163,167, 65,235,162,147, 97,115,219, 4,244, 23,177,255, 0,199,207,250, 98, -170, 64,242, 3,229,162, 82, 9,192,249,119,249,252,245,118,183, 45,171,130,238,172, 83,173,203, 86,135, 85,184,238, 26,180,164, -196,164, 80,104, 52,233,117,122,213, 90, 99,129,106, 68, 58,109, 46,158,203,143,206,146,164,161,100, 33,180, 40,242,182,165, 16, - 2, 73,213,222,187, 99, 94,182,156,151, 98, 93, 54,117,215,108, 74, 96,148, 63, 30,227,182,235,180, 39, 90, 90, 78, 20, 28, 77, - 82,158,215, 41,230, 7, 90,109, 60, 43, 32,137,165, 81, 43, 11,133, 36,106,181,237,123,117,183,107,224,250, 36,229,180,162, 54, - 49, 41,179, 56, 83,164, 27, 94,197,173,164, 27, 88,218,247,182,248,198, 80,144,123,128, 8,207, 65,220,156,249,122,157, 86, 70, - 62, 33,143,179,215,239,252, 63,110,188, 32, 18, 50,217, 14, 1,220,161, 73,115,211,185, 65, 56,237,162, 27, 73, 86, 58,128,125, - 7,127, 95, 61,101,136,223,126,191,127,195, 26,250,131, 11,131,127,120,239,138,168, 73, 56,233,212, 12, 30,190, 64,234,179,125, - 79,108,128, 65, 3,191,221,251, 53,245, 40,236, 58,103,190,122,253,191,187, 85,144,140, 43,169, 3,207,228,114, 15, 95,217,164, -240, 49, 84, 39, 42,193,232, 59,129,129,148,140,118,207,225,175, 74,108,245, 4,242,143, 47, 81,233,175,160,149,103, 24, 10,245, - 30, 99,243,231,175, 67,174, 2,178, 51,230, 48,123,121,159,195,246,235, 24,199,195,174, 40,165, 56,206, 85,212,156,142,157,254, -204,246,215,148,164, 2, 50,163,223,238,235,242,243, 58,172,224,201, 29,122,122,142,157, 51,140,159,151, 93, 92,168,148, 58,189, -195, 84,167, 81, 40,116,202,141,102,177, 88,152,213, 58,145, 73,165, 65,153, 85,171, 85,170, 18, 20, 16,196, 10, 77, 42, 3, 46, - 72,169,206, 90,136, 8,101,134,214,226,179,209, 58,195, 50,162,150,118, 10,171,185, 39, 96, 48, 91,133, 2,231, 97,181,254, 54, -183,239,197,153, 93,240, 57, 64, 30,106, 3,174, 51,128, 61, 53,233, 88, 67, 69,215, 84, 27,101, 56,241, 29, 89, 8,105, 40,238, -165, 21,172,129,140,103, 82, 39,224,247,232,242,113, 5,186, 44,209,175,126, 45,110,120,252, 41,109,245, 65, 45, 76, 98,212,168, -192,137,115,111,205,126, 34,210,167, 80,219, 22, 95,189, 38, 13,132,167, 80,143,133, 85,151,221,152, 18,178, 69, 47,152, 99, 82, - 25,217,126, 4,125,158,220, 32, 70,111,248,177,225,226,214,187,174,202, 84,112,204,221,208,222,132,198,220,171,212,205,121,104, - 12, 72,241,238, 54,151, 77,163,211,164, 45, 56,103,220,169,241,154,109, 74,229, 79, 82, 64,134,103, 28,115,148,101,101,145, 24, -213,204,187, 89, 14,215,247,144, 9,248, 27, 91,212,226,216,224,191, 5,184,251,142, 12,111,150,229, 38,134,142, 80, 8,158,164, - 20, 4, 18, 0,100,140,217,216, 94,195,204, 99,185,176, 23, 36, 3,170,254,203, 46, 26, 46, 77,165,224, 39,102,233,180,203, 98, -123, 55, 94,240,135,247,210,247,144,229, 50, 82, 28,149, 42,249, 17,191,130, 80, 39,169,184,229, 79,197,133, 96,194,183,154,100, -100, 99,197,117, 73, 37, 43, 81, 86,234, 87,236,203,238,132,204, 33, 46,221,170, 32,138,139, 45, 45,243, 6, 98, 99, 20,165,137, -143,123,195,179, 60, 34, 27, 65,240,249, 15, 57, 79, 42,214, 17,130, 72, 35, 99,155,223, 42,234,221,136,202,101,194,143, 66,171, -184,105,112,211, 76, 5,132,211,101,181, 28,123,180,100, 71, 82, 83,238,168, 82, 80,227, 9, 67, 73, 8, 14, 54,132, 97,180, 20, -130, 37, 39,125, 42,234,171,170,153, 34,124,151,131,206,170, 19, 32, 54, 57,101,207,141,200,137,172, 48, 57,190, 37, 8,222, 27, -165, 60,170, 39, 42, 9, 10,109, 42, 35,158,243, 89,104,243,106,250,186,249, 38,156,203, 86,236,231,104,202,139,157,149, 87, 85, -236, 1, 10,190,110,130,198,230,248,244,231,129,168,248,183,129,184,107, 38,225,202, 14, 30,163,155, 47,200,105, 99, 77, 38, 89, -121,146,114,215, 68,146, 59, 8,236,178, 22, 87,121, 1, 82, 69,181, 95, 73, 7, 26, 81, 90,169, 61, 79,168,208,167,204, 91, 44, -184,170,148,168, 83, 66, 11,141, 70,124, 78,167, 84, 35, 51, 29,198, 66,130, 11, 8,121,168,165, 36,146,181, 41, 14, 44, 21, 40, -224, 88,100, 92,178, 84,252, 41, 12, 58,134,169,236,223, 20, 56, 17, 31, 91,158, 31,213,209,106, 45, 85,162,212, 38, 53,239, 67, -159,220,194,222,100,171, 9, 37, 41,111, 45,133, 37,120,214,238,238, 21,145,110,110,237, 53,104,141, 18,147, 65,187,160,213,226, - 84,226, 75, 44, 52,154, 77, 70,163,111,200,247,152,240,235,208,227,114,167,192,113, 14, 20, 25, 44,164, 59, 28,191,226, 56,135, -145,206,141,115, 74,240, 69, 70,139, 58,226, 93, 94,157, 42,151, 38,217,171,209,163,191, 18, 75, 72, 91,241,167,211,107,148, 86, -235, 13,120,141,225, 15,143,117,147,200,218,176,158,118,242,164,158, 78,241, 42,202,121,105,230, 69, 46, 37,138, 83,229, 96, 54, - 39, 96, 53, 11, 27, 48,191,217, 61,150,247, 32, 99,163,184, 11, 53,202,248,178,154, 72,228,131,244,126,105, 66,170,147,211, 72, -202,218, 17,229, 26, 94, 18, 8, 15, 27, 23,116, 14,187, 34, 6, 89, 17, 67,170, 54,206, 82,238,185,177,160,198, 76,229,153, 13, -208,110, 74, 4,198,235, 44, 56,149,128, 69,106, 35, 41,155, 33, 8,201, 46, 37,233,173,153, 1,226, 91, 60,203, 41, 39,176,223, -221,171,219,215,238, 40,178, 42,213,233, 10,163,209,233,181, 8,142, 38,114, 84,251,110,185, 54, 35,209, 31, 13,197, 91,138, 79, -143,206,150,212, 57,242,124, 38,229, 16, 84, 73,240,213,204, 75, 50,143, 87,173, 84,164, 89, 20,181,168, 46,225,151, 26,159, 71, -109, 65, 14,184,229,111,223,226,166, 53, 41,224,179,148, 64,114, 79,132, 90,113, 73,200,104,184,146,174,118,146, 79,101,175,201, -205,219,204,155,102,128,180, 26,125, 18, 28,150, 98,195,105, 10, 14, 85, 92,139, 49, 44, 74,113, 69,160, 66,149, 34, 98, 36, 58, - 20, 83,202,178,235,104, 56, 3, 26,125,225,170,120,167,231,215, 85,141,112,211,105, 68, 66,108, 25,200, 98, 1, 35,204, 2,129, -118, 32,139,221, 73,211,171, 88,164, 60,112,168,124,170,167, 38,200,178,103, 72, 51, 44,237,231,149,166, 81,253,213, 50, 10, 79, -172, 10, 67, 42,201, 44,175, 42,128,126,168, 90, 67,176, 82, 27, 44,157,124, 91, 86,163,172,210, 40,209, 33, 66,112,182,149, 48, -228,143, 4,186,243,202,144,134,136, 71, 50, 71, 59,195,196, 43,253, 81,128,121,143, 54, 9,213, 9,123,191, 49,153,245, 55, 35, -206,109,168,116,233,113, 41,236,173,165,115,203,126,108,150, 24,126, 66, 34,165,149,164, 32, 41,215,163,182,233, 78, 22,166,155, - 90,143, 48,108,145,165, 85, 75,154, 37, 70,161, 46,164,219,243,155,165,183, 95,162, 83, 41,204,184,183, 31,120, 38, 3,190, 45, -101,232,203,231, 40, 76,115, 83, 50,127, 74, 20,164,143,112, 40,242, 9, 31, 98, 92, 79, 79,129, 78,140,203, 11,121,138,245, 72, -215,101,185, 49,196, 39,158, 19, 18, 21, 36,165,158, 84,115,163,196,105,234,116,116, 44,252, 60,143,172,114,249,234,105,237,243, -234, 88,226,151,149, 96, 84, 34, 93, 22,215, 29,128, 4, 3,181,141,183,216,168,177,185,166,163,240,166,136, 67, 12,245,145, 53, - 84,238, 0,153,166,177, 96,204, 18, 87, 55,144,155,186, 70,146, 43, 45,216,107,212, 1, 59, 91,122,169, 91,167, 70,186,227,184, -197,203, 10,131, 87,163,189, 10, 69, 85,214,171,148, 90, 69,113,166, 35, 70, 56,136,137, 81,234,204,184,151,100,173,214,164,200, -104, 6,254, 24,254, 26,193, 30, 33,214,177,238,127, 2, 62,206, 30, 34,208,151,119,167,131, 14, 31,170, 51,171, 76, 70,150,170, -189, 2,208,133,100, 93, 16,152,156,135, 92, 15,166,232,176, 13, 54, 74,101,165,135, 57,220, 33, 69, 97,249, 39,169,192, 0, 26, - 93,210, 95,153, 46,142,195, 48,212,207,240,138, 76,170,188,247,144, 86,212,166, 41,209, 88, 17,109,147,200,217,240, 91,113,230, - 10, 86,128,162,166, 98,165, 96, 97,201, 9, 78,178,250, 69, 65,249,177,152,150,228,245, 53, 78,141,239,234,159, 40,211,220,125, -234,189,102,123,128,204,166,210,121, 79, 70,152, 89, 40,114, 90,121,185, 11, 65,166,199,232,221,121,189,200,179, 42,152, 93, 92, - 75,230,181,135,235, 18,204, 69,152,107,221, 75, 2, 72,234, 69,174, 46, 14, 32, 60, 65,225, 38, 67, 80,102,246,156,185, 96,142, - 64,186, 65, 26,216, 43, 6, 40, 6,149,221,157,212, 46,150, 93, 69, 68,110,116,131, 41,199, 40, 55,231,232,175,112, 39,186, 52, -233,149,158, 27,247,143,120, 56,116,174,173,153, 18, 34,210,174, 57,144,247,130,194,102, 74,185,149, 26, 52,200, 23, 10,162, 86, - 96,176, 86,182,130,146,213, 93,197,161,183, 1, 8, 39,149, 38, 53, 60,110,123, 1,189,162, 92, 20, 64,171,222, 82,246,226, 47, - 16,123, 65, 75, 15, 72,127,116,120,126, 77, 82,239, 20,202,115, 40, 46,174,117,219,183,111, 65, 69,126,215, 97, 8,232,243,169, -139, 58, 27, 74, 74,185,166,114,142, 99,250, 18,209, 46,181,183,224, 68,113,102, 52,106,107,177, 37,200, 76, 89,105,113,113,218, - 56,118, 12, 55,101, 50, 10,230, 23, 86, 85, 37,215,208, 22,167,192, 67, 77,169, 69,206,125,108,205,177,123,137, 81,132,228, 77, -240,230, 79,154,105,244,170, 68,172, 70,170, 45, 44,243, 23,229,205,128,165,133,198, 42, 67,110, 60,176,176,144,220, 86,155, 75, -156,175,184, 82, 37,249,111, 22, 85, 64,218, 42, 36, 46,150,235,171, 86,247,176,186,185, 5,172, 47,228,140,198, 46, 44, 72,234, -121,147,139, 60, 39, 92,176,153,168,117, 68,140,198,218, 71,144, 3, 98,138, 64,212,159,103, 84,140,214, 0, 32, 12, 28,131,124, -126, 50,105,198, 21,146, 20, 2,150,143,132,228, 7, 26, 81,109,214,212, 65,248, 92, 74,194,146,164,156, 20,169, 37, 42, 0,131, -165,219,161,234, 58, 18, 58,228,124,254, 71, 95,166,111,180,163,216, 17,194, 7, 31,240,238, 45,193,218,248,212,110, 26,248,173, -144,137, 82,206,229, 89, 52, 54, 25,176,183, 2,186,219, 40,113, 49,183,135,111,169, 74,106, 53, 73,215,223,228, 75,245,122,111, -187,214,152, 50, 20,235,206, 84, 2, 61,217,127,158,255, 0, 24,156, 20,241, 33,192,134,239,206,217, 30, 38, 54,238,125,139,118, -182,211,245, 43,118,166,211,159, 90,217,123,137,109, 53, 37,113,155,187,182,234,235,101,180,177,115, 80,148,226, 64,116, 0,220, -200, 46,171,221,234, 49, 34, 72, 30, 25,177,178,252,214,159, 48,137, 36,141,135,159,161, 6,234, 78,231, 77,251, 48, 0,221, 90, -199,202,197,117, 32,214,105,170,234, 26,172,186, 65, 29, 84,101, 65, 54, 87,177, 10,215, 32, 13,141,138,150,236, 14,199,245, 75, -111,141, 87,232, 7, 78,223, 46,186,240,164,147,156, 28, 3,215, 4,145,249,235,175, 68,129,142,189, 7, 76, 99,191,151,125, 32, - 65, 39, 61, 71, 76, 36,140,103,167,252,116,233,141, 78,248,166, 18, 9,199, 92,122,143, 95,234,239,175,161, 36,250,244,200, 30, - 93,115,158,191,142,170,121,127,171,248,116,215,196,144, 1,202,147,156,231,167, 92,228,232, 96,111,143,129, 56, 33, 89,201, 25, -230,243,242,215,164,117, 4,143,135, 25, 61,115,251, 63, 29,125,233,140,254,206,216,252,245,215,209,215,246, 12, 1,220,121,253, -253, 52, 48, 58,123,176,136,207, 68,245,233,231,142,164,103,246,106,130,219,198, 9,242, 61, 70,124,244, 78, 14, 58,140,121, 2, - 70, 49,246,252,191,175, 84,207,110,131, 39,246,103, 63,212,127,167, 88, 6,255, 0, 17,140,224, 37,160,224,249,103,215,184,207, -168,252,247,208,170, 64, 0,231, 36, 18,123,250,252,190, 90,184, 57,205,158,184, 61, 58,231,190,125, 58,121,245,208,238, 32,242, -231, 4,117,232, 58,231,175,203,236,214, 65,232,122, 99, 32,158,221, 78, 45,197, 1, 39, 32,245, 29, 49,158,152,199,174,188, 20, -231, 36, 28,121, 28,159,179,207,240,209, 42, 73,234, 20, 7, 79,245,123,146,126,126, 67,174,168,242, 12, 40,100, 99,166, 0,243, -235,158,231, 75,169,184,235,131,168, 34,219,109,243,243,111,195, 3, 40, 3,212,147,129,248,125,186,160, 70, 70, 63, 35, 70, 41, - 35, 56, 30,153, 63, 44, 13, 12,180,144, 73, 3,167,246,126,206,186, 81, 79,108, 24,216,116, 23,254, 71, 0,184, 0, 32,116,206, -122,159,217,215, 31,158,154,162,160, 78, 58,100,103,175,175,221,163, 20,147,230, 7,221,216,158,250, 25, 89,201,230, 56, 39,183, -207,211, 31,119,244,105, 92, 1,208, 95,113,129, 22,128,114, 64,199,200,249,250,140,104,117, 35,166, 6, 1,239,246,103,200,244, -209,138,206, 65, 56,207,160,242,208,199,169,200,207, 95, 92, 14,221, 63,118,149, 7,160, 39,167,207, 95,158,248, 54, 5, 87, 76, -228,103, 25,253,159,187, 66,172,116,206, 15, 78,216,253,164,244,237,211, 70,172,100,142,152,235,220, 30,253,124,255, 0, 62,122, - 25,196,228,156,100, 1,208,227,182, 79,228,104,248, 50,250, 91,127, 92, 91,215,128,112, 14, 73, 39,167,161, 29,123,232,115,223, -168,235,158,191,184,104,199, 19,144, 83,211, 62,126,189, 61, 63, 13, 12, 80, 70, 78,114,125, 15,225,223, 58, 89,122, 97, 81,107, - 3,210,216, 29,105,243, 25,206,133, 90, 72, 39,183,153,251, 62,223,150,116,105, 25,251,186,250,103,228,126, 90, 25,105,206, 73, -200, 62,126,125, 59,253,250, 85, 79, 91,157,176, 69,216,144,119,183,250, 96, 34, 48,113,165,175,107, 73, 39, 35,175,224, 52,180, -174, 15,113,220,216,227,234, 49,143,233,209, 40, 24, 3,231,215,243,247,106,128,198, 6, 1, 31, 35,223, 85,211,204, 59,128, 49, -233,223, 61, 58,233, 18,118, 3,231,221,140,226,178, 60,250,253,223,191, 85,209,220,253,157,189,127, 63,191, 84, 81,143, 33,215, -204,234,178, 6,122,231,177,237,249,242,254,173, 16,157,137,190, 6, 8, 78,112,112, 70, 7,124,143,196,244,243,233,162, 27,234, -126,239,234,213, 4,125,189,188,191,126,189, 18, 64, 86, 14, 8, 30,125, 1,207,244,255, 0,102,181,216,133,193, 78,224,142,199, - 7, 54,115,211, 61, 62,206,158,126, 99, 69,164, 14,128, 16,123, 15,151,236,213,189,146,233, 74, 78, 19,142,153,251,112, 63,171, - 71, 55,223,162,122,140, 28,224,246,249,233, 34,215,194, 71,174, 43,165, 61, 65, 57,232,123, 99,191,167,237,209, 9, 0,142,169, -249,103, 39,175,175,217,170, 64, 18, 71,145,233,231,230,123,231,229,170,232,200, 36,116, 29,135,203,168,243, 62,103,182,176, 73, - 61,123, 96,167, 21,209,156, 1,208, 14,195,241,243,249,104,148, 3,216,156,228,224,103,250,117, 65,160, 72, 29, 58, 3,231,163, - 16, 58,231,175,203,211,211, 73,191,175,207,108, 99,107,145,181,206, 58,159,236,114,180, 36,215,120,223,178,238,166, 92,121,134, - 54,178,207,191,175,249, 50,154, 42, 65,101,248,212, 39,104, 52,196,151, 17,213,181, 46,101, 96,132,144, 65,248, 62,103, 82,170, -147,119, 79,171, 52, 99,214, 12, 27,130, 56,200, 92, 43,154,147, 73,175,197,113, 32,149, 96,181, 85,136,238, 83,215,166,114, 61, -117, 30,111, 98, 93, 13, 12,206,226,110,249, 80, 74, 93,129,102,217,118,147, 11, 61, 22,147, 89,172,205,170, 73, 66, 84, 58,128, -180, 66,104, 17,242,215,110, 85, 89, 62, 34, 74, 78, 18,162, 18,178, 78, 2, 72, 24,243,252, 53,207,158, 33,214, 52,188, 67, 60, - 91,218,146, 56,163, 6,254,160, 73,191,190,242, 16, 55,233,143, 67,190,140,252, 57, 24,240,222, 10,185, 97, 89, 6,113, 87, 87, - 57, 12, 1, 4, 44,130,152, 2, 8,181,138,211,143,223,140, 91,113,184, 80,224,223,122, 90,127,248,197,225,195,111,141, 78, 74, - 74, 28,185,236, 6,100,109,189,210,202,149,255, 0,194, 25,155,109, 45,182, 30,116, 14,184,114, 58,193, 35, 36, 29,114,235,126, - 61,136,232,153, 30,101,195,194, 78,234, 11,142, 74, 18,167, 81,180, 59,192,184, 84, 27,145,224,126, 38,225,219, 27,129, 13, 41, -129, 85,124,254,171,109, 79,106, 42,220, 56, 5,240, 78, 79, 93,141,126, 51,110,161,151, 93, 72, 82,213,250, 21,147,128,162,159, -242,172,156,116, 75,192, 96,143,245,128,214,109,101, 34,179,125, 87, 98,219,150,188, 73,117, 58,171,235, 8, 75,113, 88,113,228, -190,130,160,148, 6,130, 7,194,176,163,212,158,137, 41,207,108,226, 37, 67,197, 89,254, 85, 44,107, 65, 92,242,128,109,202,127, -172,140,251,130, 53,244,131,234,154, 77,174, 21,133,241,105,113, 79,128,254, 26,113,109, 13, 76,249,182, 65, 22, 83, 80, 16,177, -174,164, 11, 73, 52,123,127,120,210, 70,162, 57,108,123, 78,146,165,250,169,223, 16,133,191,246,226,251,218,171,186,173, 97,110, - 77,165,112,216,183,165, 5,229, 49, 86,182,110,106,115,212,202,172, 69, 5, 40, 7, 80,219,163,150,100, 37,129,150,164, 48,167, - 88,117, 63, 19,110, 40, 29, 97,233,193,243, 24, 29,250,143,184,116,215,232,143,190, 62,204, 45,147,226, 95,110, 34,219, 28, 90, - 85,225, 64,173,211, 34, 4,217, 87, 45, 7,192,123,116,108, 57, 14, 35,197, 13,193,172,182,131,239, 52,194,172,248,180,249,101, -232,171,201,194, 80,172, 40,106, 85,157,236, 48,246, 94, 89, 49, 96, 11,150,111, 16, 59,185, 80, 43, 83, 18, 93,168,222, 84,251, - 54,159, 41,214,155,241, 92, 81,129, 64,166,133,196, 36,117, 74, 67,170,207,108,116,206,173,202, 63, 17, 40,214,142, 55,205,233, - 13, 21,112,217,227, 87,141,135,185,128, 46, 29, 67,117,210,202, 74,244,212,246,213,142, 20,207,126,143,124, 95, 14,119, 61, 31, - 6,200, 56,195, 36, 55,104,107, 68,114, 83, 2, 59,199, 46,168,204, 70, 69,177,250,200,100,120,157,124,223, 84, 73,137, 96,225, -130, 70,121, 22, 8,237,202,133, 96,250, 28,227, 72,168, 32, 0, 58,146,113,140, 31, 63,151,222, 53, 61,230,125,146,190,201, 76, - 62,208,225,254,252, 87,128,217,112,248,251,193,118,173,197, 4, 39,152,242,173, 11, 29,115,211, 32,117,193,211, 69,186, 94,193, -159,103, 5,247, 75, 55, 6,222,220,187,247,177,170,142,168,178, 84,212, 27,150,141,124,210, 39, 70, 74,144,228,182,226,199,187, -233,222, 60, 23, 11, 1,196, 7, 82,242,195,107,113, 42,240,151,142, 83,177, 77,226, 46, 75, 83, 47, 41, 81,193,177, 55,242,216, - 0, 46, 73,185, 22,183,223,238,190, 25,235,190,143,254, 42,229,177,123, 69, 87, 14,170,171, 21, 80, 22,161, 11, 51, 57, 1, 84, - 2,160, 93,137, 3,114, 63,142, 35, 1,192, 79,179,155,127,248,252,190,165,208,246,210,151, 26,220,219,219, 90, 68, 49,185,187, -209,119,179, 45,157,189,219,184,210,112,227,112,228, 57, 29, 33,219,162,244,145, 27,153, 80, 40, 80, 57,165, 61,128,236,151, 33, -196, 10,146, 38,173,194, 71, 5, 92, 32,251, 61,109,198,127,137, 11, 71,248,111,187,134, 47,186, 92,156, 68, 95,208,233,213, 77, -203,169,188,166,210,220,230, 45,176,210, 20,198,221, 91, 60,222, 42,147, 78,163,161, 14,132, 16,169, 50,102, 40, 41,100,251, 2, - 70,221,108,222,222,208,118, 35,135,219, 98,141,182,187, 99,183, 80,221, 22,253,169, 5,240, 28,175,120,202,109,117, 43,158,224, -172,168, 42, 69,193,113,212,166, 35,154,109, 86, 73,117,239,122, 88, 75,220,172, 22,219, 70, 15, 39,112, 35,202,153, 34,108, 9, - 83, 16,228,242,167, 30,167,205, 67,209,101, 60,247, 40, 75,203,132,133,184, 16,103,115, 6,213,204,193,117,183,249,130, 73, 35, - 5, 53, 87, 20,120,131, 91,154, 84, 73, 73, 68,198,158,137, 73, 10, 65,221,198,214,239,181,250,134,185,234, 8, 61,113,217, 30, - 12,253, 20, 41, 50,184,169,243,158, 45,133,115, 76,244, 44,114,114,236, 90, 10,109,118,101, 69, 7,109, 69,110, 68,166,247, 32, -244, 91, 5,122, 46, 93,207,151,112,185, 82, 84,201,237, 85,196,152,174,184, 88,241, 23,239,197, 8,146,129,239,112,210,195,217, -143, 82, 97,220,134,151,240, 7,148,160,230, 82, 64, 42,108, 46, 11,170, 52,200,142, 42,108,229, 75,154, 25, 10,128,251,176,220, - 69, 62,231,164,248,160, 73,129, 34, 43, 32,148, 79,109,191, 21,101,149, 97,198,164, 54, 36, 52,149, 5,184, 19, 97,136,251,117, -212, 9,207, 47,222, 75, 83,204, 70,166,198,109, 84,203,178,149, 49, 96, 25, 28,237,178,132,166, 28, 66,181,167, 45,188,144, 84, -217, 47, 45,181,163,161,199,231,178,168,238, 61, 67,174,165, 50, 30, 68,210,138,101, 69, 41, 66,226,214, 24,154,175, 18, 68, 23, - 25,200, 16, 43,237, 53,206, 89, 40, 41,101,229, 18,227, 11, 67,153,107, 85,228,149, 94,103,214, 88,177,181,218,251, 49,190,198, -219, 19,126,194,199,107,117, 59, 14,220,202, 56,115, 41,161,100,166,134, 46, 65,164,220,199, 24, 80,202, 6,149, 99, 29,208, 93, - 86,200,179, 38,148,109, 12,205,160, 36,107, 36, 87,151,170,161,165, 46,223,113,167,151, 78,170, 42, 43,148,218,139,143,133, 60, -212,244, 50,100,136,203,150,242,135,136,250, 60, 22,164,198,112,144,183, 19, 29, 76, 58,165, 45, 0,185,112,131, 94,118, 83,239, - 68, 41,110,145, 84,110, 85, 61, 77, 75,109,178, 94,166,215,169,104, 8, 67,209,226,188, 8,118, 28,136,175, 69,146,129,147,227, -180,167,144,130,160, 73, 24,237, 74,148, 41,180,184,241,225,200,118,224,181,231, 71,136, 98, 84,161,159, 30,183,110, 75,101,207, -122,101,135, 67,139, 34,171, 78, 67,173,161, 72,116, 98, 92, 85,128,204,132, 60,193,241, 18, 44,199,101, 84, 85,252, 43,112,177, - 42, 84, 4, 52, 95, 52,245, 4,179, 84,167,160, 46, 60,163,202, 84, 82,137,173,158,119, 35, 43, 36, 50,180, 41,160, 2, 22, 0, - 48,114,196,178,177, 80, 55,211,178,238, 64,223,114,118,234, 70,226,196,234,190,160,112,250, 40,232,234, 98, 13, 29,180, 72, 74, -135, 58,129, 51,142, 88, 77,113,191,149, 76,133, 66, 76,142, 54, 49,137, 46,240,201,115,180,187,121,113,159,112,167, 74,168,126, -134,164, 39, 75, 21,246,192, 76,150, 24,152,101, 59, 6,160, 22,251,164, 23, 22, 86, 34,169, 37, 64, 41, 77,186,215,114,156,150, - 43,139, 43, 97,169, 85,218,101,105,162, 25, 69,219,106, 92, 52,234,159, 51,106,114, 59,213,187, 98, 11,114, 96,186,162,129,133, - 58,105, 47, 71, 91,228,165, 74,112,210, 83,241, 18,146, 11,135,106,214, 98, 78,172, 73,102, 43,177,164, 67,184,105,116,249, 76, -184,164, 4, 42, 59,240, 23,245, 98,155,113,151,208, 49, 37,216,174, 66, 88, 82,250, 45,200,200,202,137, 72, 26,161,196, 82,249, - 44,237,191,114,123, 77,202,228,191, 13, 50,108,176,183, 27, 75,109,213, 41, 83,161, 73, 7, 42, 42, 37,230,219,111,224, 71, 41, - 82,129, 72, 56, 26, 82,178,211, 80,176, 96,117, 33, 87, 27,130, 65, 15,123,139,250, 43, 17,247,133,176, 59,154,251, 35,230,229, - 30, 34,101,181, 84,209,154,121,115, 5,168,137,162, 38,222, 89,169,228,145, 35,177, 23,211, 13, 74, 42,128,222, 98,209, 33, 93, -247, 45,207, 13,114,155,103,122, 54,250,161, 33,214, 94,250,215,234,202,139,111,115, 54,235, 9,117,115, 33, 84, 25,247,117,161, - 36,186, 75,171,142,226, 92, 32,132,169, 8,234, 2,250,244,178,232,151, 46, 85, 85, 97, 46,180,218,152,141, 41,185, 10, 82,146, -133, 56, 87, 49,135, 28, 75,206, 54,128, 82,149,182,149,114,148,252, 73, 40, 42, 25, 63,173,202,173,165,149,245, 27, 59,105, 37, -133,198,106, 75, 46,199, 11,153,201,226, 56,179, 68,204,101, 51,206,133, 4,148,184,138,122, 64,229,229,233,145,221, 56, 61, 81, -185, 75, 51, 27,159, 80,109, 41,125,186,148, 24,239, 53, 37,180,135, 92,106, 52,136,171,113, 78,165, 68,140, 37, 16,223, 89, 4, -156,167,195, 25, 30,171,240,236,165,105,234,169,128, 26,161,150,226,251, 18, 25,116,220,216,131,250,167,125,192, 39,222,113, 12, -241,161, 4,252, 89,144,102,166, 63, 45, 69, 19,211,173,192, 32, 52, 53, 5, 73,183,217, 0,172,167, 96,196,253, 93,251,227, 89, -170,116,137,115, 41,150,180, 88,239, 52,228,155,128,190,219,171,105, 45,132, 20, 84,125,242,101,110, 97,109,192, 60, 15, 6, 4, -169, 41, 7,205,101, 42, 4, 30,100,235, 48, 98,100,183,170,109, 55, 77,129, 26, 53, 90, 77, 38,159, 64,165, 69,109,165, 59, 30, - 52,118, 31, 90,205,199, 80, 1,144, 68, 88,139, 74, 3, 44,182, 0,117, 80,218,100,243, 23, 20, 81,245,170, 20,128,229,191, 57, -231, 18,227,180,170, 21, 94, 83,170,231,105, 13,211, 41, 41,129, 19,194, 45,180, 74, 72,152,162,162,165,171, 24, 90,155, 91,121, - 64, 1, 10,190, 89,208,106, 49,147, 38,123,140,190, 42,215, 59,205, 63, 4, 41, 77, 7,232,116,248, 77, 39,221, 90,229, 3, 45, - 60,220, 25, 11,121, 77,164,169,180,203,154, 2,178,180,171, 50, 56, 55,242,106, 47,163,123,251,137,182,215, 39,127,128, 23, 32, -147,183, 70, 90,252,198, 22,163,102,103,142,115, 15, 52,168, 39, 72, 47, 37, 68,133,131, 88,139,196,145, 68,178, 49, 42, 54, 4, - 38,158,106, 17,126,147, 14,157, 74,146,213, 34,214,106,160, 3,145, 23, 72, 93, 65,214,154,147, 60, 45,214,208,171,150,181,227, - 40,145, 58,176,135, 20, 0, 88, 40, 71,191, 85, 50,133, 16,199, 40,204,233,149,217, 16, 81, 74,106,213,167,196, 41,166, 68, 93, - 61,218,202,202,222,163, 83, 36,180,202,163, 63,224, 83, 73, 82,235, 51,209, 30, 63, 41, 12,169, 45,248,223, 4,213,169, 74, 90, - 53,128,211,101, 42, 82,164, 55,109,135, 89,147, 41, 74,163,196,152,181, 2,229, 14,132,196,169,105,114, 84,194,235, 37, 15,213, -165,203, 74,222,142,144, 8, 75,184,116,146, 25,235,123, 77,126, 53, 26,159, 50,222,163, 82, 34, 87,170,209, 34,199,165,211, 98, -196,145, 42, 52, 27, 97,182,148, 76,169,143,206,119,244, 45, 5, 21,254,145, 74, 46, 58,167, 16,167, 2, 71, 51,139,214,220,104, - 21,172, 65, 37,238, 69,201, 58,119, 82, 55, 23, 34,254, 81,127, 40,177, 82, 54, 23, 48,154,250, 57, 42, 21,105,164,129,171,170, - 20,141, 98, 87, 0,144,254, 73, 38,170, 44,234,129, 19, 88,176,146, 78, 89, 34,103,179,171,162, 77,157, 81,164,143,123,163, 8, - 73,114, 60, 56, 14, 56, 25,153, 92, 82, 27, 64,113,230,129,159,116,212,234,141,165, 30, 35,232,150,149, 34, 26,138, 67, 35,195, -229,195, 64,160,161,215,163,214,229, 61,114,193,118, 3, 18,169,144,234,116,244, 83,105,213, 73,128, 42,170,162,244,180, 53, 84, -173, 73,139, 52,114,195,114, 72, 17,209, 13, 46,130, 91, 66,252, 80,144,164,132,233,150,102,139, 89,170,162, 58, 42, 11,109, 2, -156,194, 86,221, 33,181,251,181, 38, 42,218, 67, 77,174, 97,127,153, 78,214, 92, 14, 2,191, 29,239, 13,182, 62, 55, 80,210, 57, -121,206,113, 74,153, 54,127,189, 8,203, 67,140,225,184,143, 85,220,123,222,211, 87,121,197,162, 59, 80,232,138, 96,225,196, 37, -231, 93,231,158,158,124,173,226,166, 18,183, 1,113, 59,104,206, 7,217,212,166,214, 54, 39,125,193,177,184,189,190,201, 2,219, -129,115,109, 36, 64,115,202, 58,106,133,145,131,199, 51,172,111, 27,220,150, 84, 18, 57, 32,181,236, 38,119,102,187, 2,172,173, -245,138,161,227,115, 42,109, 53,183, 89,113,151,211, 75,165,167, 49, 32,171,220, 30, 90, 20,243,205, 83,164, 33,100, 75, 87,189, -190,190,121, 21, 18,250, 71, 48, 94, 91,105, 75, 43,121, 74,230,229, 45,103, 23,124, 32,112,213,237, 11,217, 74,166,193,241, 37, -103,179,117, 80, 93,247,138,133,163,115, 83, 94, 17,183, 11,108, 46,100,165,216,113, 47, 43, 30,236, 12, 41,116, 27,141,183,211, -202, 18,144,184,181, 22,208, 98,204,139, 46, 18,220,104,135, 30,225, 76, 56, 81,105,212,133, 48, 41,180,229, 70,162,206,126, 38, - 92, 98,148,206, 66,164,193,166,164, 45,105,171,200, 68,140,120,203, 37, 97, 47, 60,174,114,244,144, 80, 29,171, 42,165, 30,155, - 49, 51, 37,181, 81, 79,132, 15,185,196,151,151,234,114, 30, 44,248, 41,113,104, 4,248,238,184,148,190,180,184, 74,188, 52,182, - 16,234,154, 81, 58,124,203,115, 9,169, 39, 2, 57, 12,104,246, 82,172, 26,204,163, 72, 34,253, 44, 52, 92, 91,236,149, 12,133, -109,183, 62,241,103, 9, 69, 81, 77, 83, 52,208,150, 44, 27, 66,145,121, 36, 63,181, 37,206,204,250,129, 61,116,169,212, 89,131, - 43,201,249,104,123, 74,253,155,155,225,236,203,226, 10,102,204,110,202, 63,132, 86,125,198,138,149,127,100,183,134,155, 1,112, -237,173,219,177,225,202, 67, 75,152,211, 60,203, 77, 6,247,167,123,204, 54,107,180, 85,184,167, 33, 62,251,114, 35,170, 69, 54, - 84, 73, 46,115,200, 36,167, 25,234, 60,137, 61, 71,217,242,198,191, 92,191,104, 95, 2, 27, 99,237, 47,225, 82,247,225,235,116, -208,197, 6,191, 47, 55, 54,209,110, 43, 17, 27,149, 84,218, 45,211,165,197,120, 90,215,101, 56,171, 11,149, 13, 70, 66,225,214, - 96,115,165, 21, 26, 85, 74, 92, 66,166,214,227, 79, 55,249, 64,239, 46,206,238, 55, 15,155,187,185,155, 17,187,212, 5, 91, 27, -163,180, 55,157,106,194,190,104,165,101,216,241,171,116, 57, 30, 18,166,211, 37, 16, 5, 70,131, 54, 18,226, 79,167, 74, 70, 81, - 42, 5, 78, 52,132, 18, 28, 26,183,178,186,229,171,129, 84, 73,169,212,119, 35, 85,129, 0,134,181,188,202, 72, 5,128,210,110, -164,121,139, 34,115,126, 99,150,201,150, 78,208,177,215, 21,236,173,125, 91,218,250, 75,126,181,187, 55,113,190,246, 44, 91, 95, -135,148,129,156,147,147,205,212, 31,144,244, 3, 58,243,202,158,132, 96,121,118,234, 51,223,167,152,213, 84,132,144, 83,212,144, -122,231,250, 71, 93,121,229, 7,168,206, 61, 58,103,231,212,233,216,126,242, 48,223,133,202,123,243, 12,118,207,203,183,111, 61, - 32, 14,126, 17,140, 14,161, 90,245,202, 0,199,235, 2,114, 60,191,110,190, 5, 15,139, 57,201, 32,114,253,216,239,161,239,192, -233,108,123, 39,162,135, 78,189, 62,195,246,249,106,136, 10, 78,112, 73, 80, 61,113,230, 62, 64,254,122,234,166, 18, 83,202,122, -103,184,207, 81,130, 49,223,236,215,174, 80, 6, 9,201,199, 47,111, 46,189, 71,203, 89,192, 63, 27, 96, 53, 1,149, 31, 49,140, -143,183,211, 84, 10,122,103,152,159, 49,204,115,211,229,233,253,186, 57,109,140, 0, 0, 42, 35,161, 61,188,137,207,221,161, 86, - 58,145,216,118,198, 58,231, 30, 93,116, 48, 63,158, 1,112, 96,228,246, 63,119,203, 84, 21,220, 28,101, 35,160,235,242,245, 31, -102,138, 90, 22,121, 72,232, 51,231,247,231,247,104,117, 39, 61, 58, 2, 59, 96,249,104,234, 64,191,160,198, 65, 55,247,255, 0, - 60, 14,160, 50, 60,137, 24,206, 58,103,203, 61, 58,234,146,135,124,156,121, 99,160, 31, 51,219,236,252,116, 73,206, 49,128, 51, -231,231,251,123,106,130,209,216,142,152, 32,159, 63,195, 75, 14,184, 84, 94,215, 29, 79,250, 96, 55, 19,215, 9, 7,190, 79,166, -113,212,157, 10,180,231,174, 51,219, 30,163,230, 61,124,245,112, 94, 8, 35, 56,199,150, 58,254, 63, 97,208,174, 36,246, 79, 78, -132,250,231,203,175,160,237,165,148,155, 11,141,240, 1, 23,176,233,128,148,158,253,122,158,192,247,206,126,126, 93,116, 42,219, - 61,126, 33,142,248, 29,128,238, 64,251,180, 98,130, 72,235,144,115,140, 99, 39,215, 61,190, 90, 29,105, 56, 32,252,142,124,190, -223,195, 58, 58,223,238,254, 95, 39, 6,192,106, 72, 24,199,207,169,245, 30, 90,160,176, 6, 79, 92,227,183,145,249,118,249,104, -165,167, 61,148, 78, 62, 93,254,239, 93, 12,179,220, 30,157, 60,198,115,242,249,127,110,150,193,148,246,192, 42, 80,207, 64,115, -230, 7, 95,188,250,119,213, 21, 12,100, 99, 63,179,231,162,150,129,220, 12,103, 57, 35,191,246,104,101, 2, 7, 81,158,249, 35, -174,127,183, 74, 39,124, 40,187,129,129,212, 62, 68,122,250,125,199, 84, 23,140,143, 92,117,213,117, 19,215,184, 4,231,175, 66, - 79,245,106,130,251,142,158, 93,255, 0,118,149, 29,122, 95, 24, 34,198,227,107,126,239,159,158,216, 20,140, 18, 59,227, 75, 95, - 85,250,199, 75, 75, 13,192, 56, 53,129,222,221,113,224, 31, 34, 70,125, 6,170,115,117, 4, 36,146,112,146, 71,252, 62, 67, 84, - 57, 57,156, 74,190, 46,131,167,126,189, 72,198, 14,138, 73, 72, 0,249,103,174,123,247,243,198,181,201, 39,189,191, 44, 27,238, -190, 43,164,129,129,211, 63,236,245,233,243, 58, 32, 97, 35, 36,140, 31, 65,231,246,249,232,100,242,133, 16, 14, 78, 58,158,157, - 7,144, 58, 37, 4, 36, 28,167,155, 7,168,239,223,182,147, 44,119, 29,113,140, 86, 9, 88, 80, 33, 67,148,142,189, 58,147,229, -223,183,125, 16, 27, 14, 36, 37, 73,206, 14, 71,113,233,215, 84,146,114, 59, 96,121,126,113,162,219, 33, 61, 20,122,227,203, 61, -135,228,105, 51,107,111,211, 4, 38,221, 6,253,190,126, 24,172,132,132,167, 25,192, 31, 46,167,238,209,141,168,114,132,252,186, - 31, 95,234, 58, 17, 41, 24, 32,168,146,115,128, 59,159,179,174,138,108, 18,115,203,216, 12,131,215, 0,103,174,144,194, 71,174, - 42,227,160,207, 92,117,206, 62,223, 33,242,209, 40,194,176, 79, 64,124,186,245, 61,190,239,236,213, 16, 1, 81, 29, 64,242,237, -249,245,209, 45,130, 6, 1,237,228,113,147,251, 59,104, 99, 7,241,193, 13,224,100, 14,158,159,183, 68, 33,125,121,112,122,103, - 36,117, 25,207,111,219,170, 8,237,156, 12,250,116,207,217,159, 61,101, 86,165,169,113,222,213,218, 85,175,104,208,234,151, 29, -199, 92,154,205, 58,143, 67,162, 64,145, 83,170,213,103, 62,174, 86,162,193,129, 17,181, 57, 37,226, 79, 92, 12, 36, 30,101, 16, -144, 78,144,150, 68,141, 93,157,130, 34,110, 73, 54, 0, 1,212,158,192, 96, 14,194,219,159, 78,228,237, 97,234, 73,216,119, 56, -239, 95,177,184, 52,198,205,241, 34,250, 82,145, 37,219,203,111,154,116,243, 97, 74,140,138, 52,229,161, 36,121, 36, 56,165, 99, - 62,127,102,186,125, 58,178,168,165,224,240,108,180,227,106, 45,243,168,133, 3,219,224, 41,253, 99,156, 28,124,181,130,123, 43, - 61,153,123,231,176,246, 46,230, 76,226, 66, 69, 19,109, 99,238,172,123,102, 85,189,105, 61, 82,102,161,115, 83, 77, 53, 47, 41, -114,110, 56,241, 22, 91,166,201, 83, 79, 37, 41, 96, 41, 78, 35, 7,156,131,211, 91,183,187, 60, 21, 87,216,164,202,171,216, 55, - 44, 43,172,211, 80,185, 34,157, 13,254, 73,133,108,167,153, 73,110, 58,212,124, 76,167,200,119,206,185,175,140,211,219,115,250, -250,186,121,150,106, 87, 41,102, 86, 4,217, 99, 69, 62, 95,180, 64, 96, 69,237, 98, 6,161,177, 7, 30,160,125, 30, 51, 92,167, - 42,240,231,133, 50, 92,240,205,148,102, 10, 42, 3,172,240, 74,138,188,202,201,222, 50,206,202, 2,106, 70, 70,243, 90,193,183, -223, 26, 33, 89,187, 38, 56,211,173, 73, 82, 68,134, 29,100, 33,180, 43,195,241,146,165,129, 30,115, 42, 79, 82,234, 84, 82, 20, - 61, 53,220,158, 22,104,113,246,115, 98,169, 87, 66,163,180,230,226,223, 48,159,157,245,162,217,109,215,233, 84,130, 15,134,212, - 53,167, 42, 99,197, 78, 84,181,167,226,199, 98, 53, 30, 10,163,245, 54,234,111,196,144,202,209, 82,166, 75, 80,109,137, 72, 83, - 78, 49, 38, 59,153,147, 79,146,210,250,165,126, 35,100, 96,227, 24,215,127,118,138,242,164,110, 62,192,109,157,106,149, 47, 30, -229, 76, 54,197, 89, 17,150, 68,186,101, 86, 23, 51,106, 97,104, 7, 45,130, 23,217, 88,202,117, 28,118, 20, 81, 23,136,105,153, -198,204, 58,139,149,189,143,111, 45,236, 65,254, 3, 29, 5,199,185,104,158, 14, 29,203,164, 80,217,101, 77, 86,170,133, 93,209, -180,199,170, 20, 96, 14,241,187, 6, 37,127, 93,148, 45,136,181,242,106,229,223, 42,176, 31,122, 91,235, 11,114, 43,173, 63, 43, -152,169,199,159,143,135,153, 45,243, 30,101,243,182,162,159,187,215, 88,194,171,109, 42, 52, 22,155,105,229, 73,168, 62, 22,203, -206, 5, 45,198,219, 49,203, 37, 62, 31, 54,124, 70,223, 9,248,135, 92, 47,174,172,242, 97, 74,133, 54,150,235,136, 92,152,237, - 58,252, 89, 13, 45, 92,139, 46, 50,219,136, 74, 20, 9,248, 28, 41, 32,143, 62,190,122,188, 83, 18,164, 54,242,101, 71, 65,114, - 44, 22,132, 53, 40,114,187, 30, 75,239, 23, 82, 65, 72,234,224, 65, 70,125,121,117, 30, 87, 45,172,129,168,158,155,237,126,135, -115,211,189,187,236, 62, 56,127,142,130,130,138,154, 49, 79, 24,120,134,234,170,193,123,180, 96, 91,169, 10, 66, 18, 15,151, 77, -128, 4,226,231, 71,140,106,110,203,144, 95, 44, 50,131, 42, 92,249, 46, 56,161,202,196, 32,136,201,141, 24, 96, 36,190,183,201, -194, 51,149, 21, 28,117,214,187,111,102,251,181, 33,243,106, 81,228, 61, 14, 37, 33, 97,130,251, 50, 21, 30, 63, 51,105,194,152, - 98,106,148, 82, 95, 81,200, 60,195,245,138,142, 20, 14, 19,125,222, 75,250, 78,218,216,238,219,180,169,142, 42,187, 85,231,169, -204, 91,107,109, 14,183, 50,106, 86,182, 24,105,167,112,133,173,168,202, 43, 80,230, 79,199, 45, 56, 33, 67, 58,228,228,187,229, -250,132,217, 47, 75, 67,178, 96, 58,242, 83, 61,164, 56,226,208,226,208,181,175,198,125, 46,167,157, 35,226,117, 68, 43,152, 40, - 32, 32, 40,140,101,246, 58, 73, 18,147,146,135, 76,211,128,242,145,107,170,177,186,198, 9,237,250,205,184,185,216,218,219,233, -112,238, 72, 56,183, 63,169,204,229, 28,252,143,135,165, 49, 82, 40, 35,235,170, 18,203, 36,204,173, 96,202,132, 24, 98, 13,183, -146, 66,118, 56,218,122,181,245, 81,114,145, 37,110, 60,103,198, 97,207,125,165, 84, 31, 79,131, 90,163,190,219, 97, 10,108, 48, - 26, 9,169, 66, 90, 80,227, 47,128, 80,181, 33,204,169, 42, 79, 34,145,144, 27,238, 36,202, 77, 46, 61, 71,146,158, 91, 77, 34, - 80,129, 80,121,196,192,149, 37,107, 67,234,250,134,230,105, 96,211,223,104,169, 92,205,169, 77, 58,128, 83,145,140, 41, 90,141, - 75,174,173, 77,251,204, 9, 44,170,156,220,176,219,244,224,164,200,165, 79,117,183, 20,184,138, 75,160,173,218,100,118, 89, 33, - 75, 40,230, 73, 95, 94, 82, 7, 38,179,218,117,105, 35,154,151, 61,164,211, 34, 50,180, 74,121,186,147,237,205,163, 21, 60,162, - 29,110, 35,204,164, 37,216,238, 48,180,134,146,248, 5,180,189,243,232,211, 62, 92,169,112,162,228, 27,221,109,123,121,123, 16, -109,110,225, 46, 44,215,186, 62,199,161,242,220,190,156, 36,113,114, 47,203,109,107,162,234,192,145,231, 26, 47,177,110,190, 75, - 27, 13, 65,145,137, 24,220,138, 82,100, 86,167, 67, 85, 85, 5,217, 21, 54, 83, 26,153, 91,143, 41, 84,218,173, 77,175, 19,157, - 16,100, 78,167,184,142,105,169, 96,169, 46,243, 41,104,121,178, 22,223, 34,202,155, 23,250,140,137, 20,138,148,138,125, 82, 20, -234,253, 56, 69,122, 35,244,247, 86,135, 43,244,199,152,112, 33,197, 60,228, 96,159,173,226,132, 50, 84,121,113, 53,165,176,135, - 82,167, 71,194, 53,242, 20, 11,121, 84,166, 35,198,155, 38, 4, 37,169, 19, 41,142,209, 42, 19,225,165,233, 62, 34, 25,142,226, - 80, 30,113, 17,157, 66,149,252,196,164, 18,216, 82, 84,115,167, 38,148,205,126,152,227, 49, 97,220, 38,171, 81, 86, 91, 68, 26, -187, 13,248, 14, 69, 97, 62, 35,143,138,156,112, 22,101, 41, 15, 18, 22,226, 10,194,136,230,230,233,134,127, 42, 6, 37,206,199, -117,101, 43,181,186,143,180, 75, 2,110, 73, 96, 5,128,176, 42, 44,157, 77, 28, 1,181, 71, 86,166, 56,195,160,133,227,150, 34, - 10, 48, 60,200,165, 70,147,146,168,163,204, 71, 45, 85,148, 2,193, 25,163,195,167,111,214, 86,203,172,196,137, 45,186,155,174, -161, 10,167, 73,203, 62,227, 94,136,211,232, 33,202,160, 82,127,192,238, 54, 24, 88, 10,120, 37, 1,208,149, 43,151,151,153,182, -170,166, 34,105,117, 25,181, 40,161, 79,194,159, 53, 78,221,148, 2,130,244,202, 62, 11,173,203,168,196,140,210,177,239,188,139, - 79,188, 52,148,143, 25, 25,113,159,210,140,171, 8,167, 26, 85, 94, 65,131, 35,235, 11,102,226,130, 87, 49,132, 48,166, 27,155, - 34,167, 24, 20, 49, 81,133, 37, 81,151, 26,170, 90,112, 31, 21,124,188,252,170, 13,201, 72, 73,201,204,105,149, 74,157, 57,200, -147,110, 38,154,139, 18, 67,205,195,153,115, 70,104, 51, 79,155, 83, 70, 23, 21, 85, 85, 0,161, 70,146,242,249, 2, 78, 76,126, -101,128,219,173,128,148,235, 34, 80,196, 0,231, 83, 92, 1,220, 90,204, 10,145,112, 0,185, 42, 1, 2,236,108, 45, 99,136,197, -109, 57,134, 90,147, 78, 60,243,173,165,136,149, 15, 48,189,215,148, 86,241,202,190, 93, 81,152,134,165,148, 13, 11,202,242, 35, -169,110,248,110,177, 16, 67, 42,158,104,128,170, 20,215, 22,194,141,110,142,176,131, 25,131,225, 54, 11,133, 84,196,180, 99,164, - 18, 82,252, 36, 58, 2, 73, 90,181,243,137,137,169, 94,219, 91, 8,140,165,159, 30,241,143, 84, 66,139,156,202,240, 96,192, 62, - 18,156, 82,206,124, 78, 89,140,129,203,241, 21, 30, 76, 19,163,109,106, 99,148,203,129,215,161, 22,149, 70,170, 36, 45,108,171, - 31,224, 53, 5,243, 58,217,101,215, 79,193, 25, 79,185, 33, 32, 39, 1,165,190, 66, 50,135, 15, 45,187,123,227, 46,167, 87,178, - 45,198, 26,115,194,143, 66,171,214,144, 26, 91,156,200,171, 26,148,118, 84,145, 31,151, 10, 8,167,198, 11, 4, 31,135,197,207, -235, 37, 39, 74,201, 56, 20,179, 48,220, 2,160, 89,137, 27, 48,218,251, 92,218,224, 27,108,182,181,237,189, 90,213,112,199,197, -185, 37, 66, 63, 50, 26, 82,245, 33,186, 21, 2, 41, 29,149,214,224, 41, 89,127, 85, 64, 0,155,129,164,168,195,121,106,210,157, - 49, 16,180, 67,123,221,105, 23,132,151, 98,143, 8,133,181, 9,233, 2,160,114,132,149, 41,152,202, 77, 80, 0,122, 20,224,133, -140, 19,174,145,216, 85, 22,174,139, 58,117, 20,167,255, 0,116, 45,215,218,183, 92,253, 48,116, 59, 66,168, 71,135, 84,162,201, - 91,137, 33, 46,115, 83,165, 76,101, 96,101, 41, 92, 44,103,200,106,117,145,110,169,112,231, 15, 1,196,123,195, 84,153, 12,178, - 20,148, 41, 94, 28, 38,226,200,119,157,100,120, 95,165,138, 1,112,228,146,114,114,161,173,186,219, 8, 70,145, 86,150,137, 9, - 45, 70,158,138, 76, 55,148,216, 65,109, 45,150, 86,152,239,128, 57, 65, 12, 75,229,234,122,225,213,148,244,209,114,119,104,171, - 4,128,125, 92,254, 87,191, 96,110,192,158,223,104, 2,109,189,142,214,189,197,123,226,102,115, 14,101,151,130,175,170,167, 41, -126,116, 54, 59,220, 24,181, 41, 23,243, 93, 94, 65, 97,177,125, 39,160, 56,182, 92, 20, 69, 77,185,225,210,208,218, 12,121,177, -214,245,101,132,175,147, 20,200,207,169, 77, 67, 12,161, 64,187,239, 14, 55, 24, 58, 82,112,164,176,232,229, 32,231, 94, 29, 77, - 69,138,133, 70, 29, 29,163, 30,174,236, 24, 12, 74,171,176,182, 29, 93, 18,157, 80, 46,135, 10, 99,172, 22,209, 86,126, 34, 28, -247, 86, 74,249, 90, 42, 50,212,149, 37,164,133, 61,149, 74, 50, 96,174,108,231,227,148, 73,104, 70, 98, 34, 90,232,251,142, 52, -174, 65, 30, 63, 46, 28,230,126, 90,201,119, 25, 60,138,113, 64,225,189, 82,183,173,152,148,155,102,178,203,203, 68,215,166, 72, -114,183, 95,156,227,173,149, 84,171, 51, 30, 74, 27, 67, 12,173, 36, 52,203, 81,219,102, 60, 68,130,144,203,109,165, 36,133,120, -138,212,193, 31, 77,212,144, 72, 34,198,251, 27,245, 44, 15,154,214, 6,230,224,239,182,149, 3, 21, 18,113, 76, 43, 65, 3, 50, -137,214, 49, 12, 40,135,117,121, 29,209,158, 71,223, 75, 42, 46,136,204,108, 8,145,132, 74,193,144, 72, 75, 74,213, 54, 21, 45, - 76, 91,246,218, 94,139, 17,193, 28, 86, 29, 14, 46,115,208,212,249, 67, 77, 64,167, 72,144, 20,185,149,135,226,180,158,101,145, -202,195, 40, 83,141,144,227,200, 2,245, 21,216, 52, 92,248, 96, 70,161, 83,252,103, 98,197,145, 15,156,115, 78,109, 49, 66,157, -109, 1,110,205,152,167, 16,175,119, 65,203,206,130,172,229, 69, 42, 23, 85,184,213, 38,116,122, 77, 49, 30,243,112, 48,191,122, -156,175, 0,120, 52,218,131,205, 97, 18,106, 83,146,149, 4,194, 76, 0,146, 91, 88,241,164,101, 41,109,188,184, 10,126, 34,216, - 84, 0,137,213,234,155,149, 73,236,160, 76, 76,164,176,212,104,116,198,150,183, 7,131, 18, 42, 93,229,167,198,253, 69, 23,214, - 76,149,151, 57, 71,195,200,157,109, 69, 33, 82,243, 60,133,180,234,176,248,250,244,211,107, 91,226, 72,211,167,112,188,181,209, - 76,160,213,204,197,106, 0, 96, 24,179, 79, 82,204, 72, 51,121,144,128, 10,249, 98,149,218,225, 28,149, 89, 27,152,205, 94,144, -220,249, 80,209, 79,171, 70, 91, 20,181,184,135, 92,141, 50, 72, 14, 84, 76,118, 19, 36, 34,177, 25,151, 21,138,119,187,114, 19, - 21, 68, 12,117,150,149,132,150,213,150, 54, 98,220,136, 16,188,119,163, 67,101, 5,113,196,105, 72,165,185, 82,119,197, 5,126, -248,228,114,219,144,233,141, 70, 67,104,106, 56, 82,124, 82, 79,136,218, 88, 9,105, 88,156,247,222,169, 82,227,191, 45,232,212, -218, 11, 78, 71, 98, 59,143,161,113, 39, 84, 75, 46,153, 13, 76,172, 45,229,243, 37,135, 29,104,251,180, 52,101,110, 6,210,236, -148,169, 74, 12,138,140, 74,153, 50, 51,206, 33,177, 76,164,162, 59, 73,171, 73, 72,104, 78,168,197,125,231,124, 63, 6, 48,109, -102,142,200, 60,234, 28,229, 82, 93, 7,244,104,105, 39, 91,241,105,141, 99, 37,254,169,195, 11, 90,214,220,144, 53, 30,151,233, -216, 2, 62,226,207, 81, 79, 37, 64, 53, 1,150,150,100,144,129,164,144,145, 57, 33,117, 0, 73,102,157,197,144,162,146,201,229, -185, 91, 7,133,199,163,200,101, 79,198,131, 70,106, 76,183, 83, 33, 17, 40,212,166, 60, 24,241,189,234, 27,101,247,106, 85,121, - 13, 51,138, 77, 9,190, 85, 34, 58,146,217, 82,185,213,225,182,227,202,108, 33,244,163, 51, 30,132, 13,122,179, 61, 46,206,167, -178,218,106, 21, 83, 17,198,105,113, 16,255, 0,130,203, 84,152, 48,121,220,112, 58, 60, 70,144,219, 72, 14,202,154,226, 91, 75, -137,117,229,164, 37,133,166, 84,233, 54,205, 18,152, 42, 78, 72, 74,100, 38,109, 70,157, 75,167,176,101,215,110,185, 45,168,183, - 26, 21, 45,132, 58, 22,233, 81, 25, 47, 73, 45, 70,101, 9, 42,121,228, 37, 28,165,217,183, 32,206,171, 85,105,149,250,165, 82, -149, 14, 75, 94, 12,218, 69,174,167, 26, 93, 42,136,182,199, 51,171,157, 33,213,135,234, 53, 63, 17,100,187, 57, 41,104, 33, 40, - 8,142,218, 24, 74,121,221,169, 86, 22, 72,193,212,205, 96,202, 46, 67, 48,184, 22, 31,101,130,133,184, 4, 88, 49, 35, 72,181, -216, 86, 28, 81, 1,116,150, 73, 25,169,242,225,205, 66,229, 73,146,164,163,105,104,209,130,181,131, 0, 76,135, 75, 68,143,118, -149,228,145, 98,129, 95,138, 36,233,202,152,138,141, 93,169,141, 69, 80, 30,227, 5,244, 43,222, 82,165, 36,243, 74,171,176,208, - 41,106,160,226,222, 82, 83, 28,169, 98, 40, 10, 73, 90,220,201, 68, 52,254,150,111, 2,144,225,187,179,158,209,187, 10,132,211, - 79,213,165, 82,118, 15,137, 25, 20,246,210,148, 75, 91,140,190,246,200, 95,117, 36, 32,115, 57, 41, 10,102,175,109,202,146,122, - 41, 18,232,108, 40,225,134,134,166, 17, 71,172, 75,173,183,254, 28,202,224,136, 19,125,223,220,189,237,247, 37, 21,179, 37,214, - 81, 80,121,191, 1, 45, 16,166,130, 31,105, 33,106, 75, 76,149, 56,163,206,177,200,205,113,141,195,133, 51,141, 78, 12,248,147, -225,150,176,148, 59, 23,119,182,166,230,182,237, 57, 15, 97,150,105,151,140, 70, 87, 85,176,107,200, 50, 27,253, 3,177,111, 58, - 93,191, 49,181, 28, 41, 2, 57, 60,193, 74,200,158,100,149,102, 22,210,191, 88,166,198,203,123,107, 2,250, 84, 17,179, 17,170, - 37, 36, 88, 6, 45,176, 1,135, 60,241, 94, 80,210,197, 55, 50, 52,167,146, 27, 38,149,177,141,119,250,189, 44, 46, 13,254,219, - 16,222,117, 4,220,220,223,242, 16, 41, 10, 0,121,103, 35, 29, 63, 35,174,144, 0,146,129,231,232,122,252,251,246,242,213,103, -105,213, 58, 52,201,244, 90,252, 69,192,174,208,170, 53, 26, 21,114, 3,128,135, 96, 86,232,211, 30,166, 85,233,238,115, 96,133, -177, 82,139, 41,165,103,205,147,175, 33, 3, 57, 79,194, 14, 78,124,199,203,236,212,253, 72, 96, 25, 78,160, 70,198,251, 27,216, -220, 31, 76, 83,251,247, 22, 56,241,142, 65,215,160,207, 76,143, 35,229,243,210, 78, 79,144, 72, 39,250,186,145,142,218,250, 74, -136, 25,198,115,208,129,220,124,245,247, 36,146,124,191,217,244,236,126,205,103,127,191, 3, 30, 72,200,230,229,206, 58,121, 15, -199,215,251,117,236, 5, 31,245, 72,242, 7,190, 62,223, 76,233,114,133,144,114,164,245,198, 7, 65,219,215,238,215,190, 92,127, - 56,224,103, 31, 47,191,211, 67,221,233,129,138, 43, 71,124,156, 15,196, 14,221,186,244,208,171, 3, 3,191,166, 64,201,249,119, -249,234,232,212, 41,147, 22,132, 71,105, 74, 46,186,134, 91, 32, 16, 29,125,194, 18,211, 12,249,188,250,213,209, 40, 72, 43, 89, - 56, 72, 39,166,186, 71,195,191,178, 43,142,110, 36, 99,196,171,219, 27, 61, 83,178,237, 25, 97,151, 26,188,247, 98, 90, 54,206, -131, 38, 59,229, 63,225, 52,182,171,241,205, 66,178,148, 52,175, 16,166, 60, 5,115, 36, 97, 43,202,147,157,121,171, 41,169,236, - 37,148, 43, 55, 69,234,199,224,162,228,159,112,198,205, 37, 29, 93,124,188,138, 26, 89, 43, 38, 29, 86, 36,103, 32,122,182,144, -116,143,123, 88,123,241,204, 5,140,156, 36,231, 29,252,135,224,124,251,232,117, 0, 14, 70, 1, 7, 7,183,159,203,207,166,117, -177,124, 80,240,223,126,112,157,189,183,214,195,110,107, 49,211,119,216, 53, 54, 96,207,155, 77, 84,151,104,213,200,115,224,199, -169,209,174, 75,118, 76,184,204,185, 50,223,157, 79,148,219,177,157,113,166,212, 74, 28, 66,144, 20,218,181,174,203,234, 48, 7, -159, 79, 94,255, 0,111, 83,141,108, 83,203, 28,200,146,198,218,163,144, 2, 58,142,190,160,216,223,220, 69,240,155,199, 36, 18, -203, 12,200, 98,158, 22,100,116, 59, 50,178,157, 44,164, 14,132, 16, 65,247,140, 12,160, 58, 18,122, 12,253,253, 63,179, 67,171, -168,200, 61, 58,140,249,227,207,167,231,182,138, 63,173,208, 17,223,167,203, 25,201,252, 53, 69, 64, 1,142,253,115,246, 15, 67, -173,144,108, 65,244,198, 70,227,125,199,254, 48, 26,129,245, 28,189,186,140,125,224,250,245,208,171,192,201, 25, 7,255, 0,104, -122,103, 69,184, 70, 72, 57, 0, 30,195, 29,124,186,126, 31,179, 66, 47, 62,163, 30,158,121,249,116,210,202, 73, 23, 56, 0,108, - 61, 54,192,202,193,193,193, 4,247,206,116, 58,199,159,175, 67,233,162, 87,235,229,140,122, 96,250,252,244, 58,129,201,200,200, -251,113,131,219, 56,209,199,198,216, 54, 6, 88, 0,100, 39,175,203,167,231,251, 52, 43,131, 39, 36, 2, 64,236, 58,254, 63, 61, - 22,231, 76,100,244,201,251, 60,134,132, 80, 30,188,221,127,104,193,245,251, 52,170,155,223,107, 91, 25, 22,223, 2, 44, 12, 18, - 70, 49,219,212,117,237,161, 87,243,234, 15,111, 44, 31, 92,249,249,232,197,140,103,249,222,127,105,251, 6,133,115, 24,236,123, -246,244,239,223,229,165,147, 10,139, 27,123,190,126,126,252, 12,188,246,199, 76,103, 62,152,254,142,154, 13,206,249,201, 78, 51, -156,140,231,211, 31, 46,250, 49,194, 2,122,244,243,207,151, 79, 93, 90,212,167,148,162, 20, 50,159, 34,158,248, 35,184,244,210, -152, 2,247, 55,232, 48, 59,171, 82, 85,220,156,231,177,199, 79,179, 75, 84,137, 89, 82,129, 64,192, 61, 9,238,125,123,157, 45, - 11,159, 92,102,195,211, 7, 1,145,228, 49,230,115,215,175,153,251,245, 85, 41,199, 65,212,158,255, 0,159, 77, 82, 78,114, 7, -145,207, 79, 35,223,203,237, 26, 37, 0,231, 61, 49,231,219,242, 53,130, 1,198,113, 85,164, 37, 39, 24, 29, 70, 51,230,123,121, -232,129,156,245, 31, 8, 29,193,235,233,231,223,190,169,163, 29,176, 58,117, 7, 26,244,121,242, 2, 82, 20, 60,250,224,142,189, -251,246,210, 76, 0,248,223, 3, 5, 39, 29, 51,146, 59,252,240,123,103,174,138, 64,206, 8, 35, 31,183,240,208,109, 54, 70, 78, - 78, 73,235,147,144, 6, 78, 6, 51,215, 70,163, 57,233,142,157,199,203,229,162, 27,218,255, 0,203,124, 17,187,155,224,134,240, -161,156,231,174, 64,235,211, 29, 63,164,104,132,168,143, 60, 14,199, 24,243,245,249,127, 86,168,160, 96,103,207,203,243,246,141, - 16,132,224,228,245, 7,174, 63,160,231,215, 73, 16, 5,253,223, 39, 9, 28, 86, 71,127, 62,223,143,231, 58, 44, 1,220,122, 99, -160,192,252, 52, 58, 82, 7,219,143,207,238,213, 86,242,162, 60,134,112, 57,142, 0,243, 42, 62,128, 12,232,167, 5, 97,182,231, -108,101, 54,149,175, 93,188,238, 42, 37,171,108, 82,103,215,174, 43,142,169, 10,139, 68,162,210,216, 92,170,133, 82,169, 80,121, - 49,225, 64,134,195, 96,151, 31,113,229,164,118,194, 70, 84, 72, 0,157, 78, 55,217,195,236,235,180, 56, 5,219,136,183,189,229, - 6,143,114,241,101,120,210,144,245,197,112,186,195, 83, 99,109,101, 38,115, 41,113, 22, 77,152,167, 82, 66, 42, 9, 66,147,245, -132,212, 0,227,174,130,132,144,210, 64, 58, 65,236, 48,224, 78,145,183,150, 91, 28,115,238,229, 25, 47, 93, 23, 10,101,211,120, -127,163, 84,163,165, 73,163,211, 57, 87, 30,165,184, 46, 48,226, 73, 76,201, 4, 45,184,107, 35, 40,101, 37,105, 33, 78,103, 93, -206,171,207,168, 77,158,242,214,234,165,120,206, 45,240,239, 57, 83,188,203, 36,252, 62,157, 9,239,170, 51,196, 46, 48,105, 37, -147, 42,160,151, 76, 16,146, 37, 96,109,169,129, 27, 92,118, 83,208,119, 32,181,143,145,135,112,125, 25,188, 13,143, 54, 16,113, -223, 19, 82,137, 17,172,244, 16, 72, 60,170,157,125,165,213,191, 93,246, 49,126,194, 16,247,212,254, 92,102,175, 95,155, 82, 46, -162,100,151,208,236,151, 84, 86,135,157, 83,143, 45, 96,146, 94,142,181, 28,149, 31,231, 39, 61,245, 66,141,115,205,137, 57,175, - 1,247, 75, 76, 35,195, 76,148, 41, 72,125, 46, 37, 67,149, 50, 80, 63, 89,178,122,100,246, 29,245,245,218, 59,147,164, 45, 78, - 62,215, 50,202,148,134,101,254,133,244, 62,145,140,180,188,124, 11, 56,232, 71, 67,171, 83,148,233, 49,170, 13,190,247,248, 44, -245,182, 90,104, 56,144,150, 39, 33, 63, 10,154,125, 67,225,241, 20,158,202,245,193,243,213, 56,106, 88,146,193,203,105,235,239, - 59, 19,191,201,199,127,158, 23,202,218,157,233,146, 24,236, 81,136, 80, 46, 1, 43,107,143, 46,174,130,197,183, 3,169,212, 47, -102, 23,138, 45,142,166,222, 16, 42, 27,183,108,211, 81, 10,232,163, 70,247,155,186,155, 13,174, 83, 92,132, 0, 8,170,165,134, -192, 6,115, 39, 5,106, 72,203,136, 86, 73,233,166,207,131,205,208,115,108,174, 89,118,133,206,234,163,216, 59,146,166, 20,169, - 42, 82,136,161, 93, 77,252, 49, 42, 33, 4,225,182,215,204,148,185,216, 20,171, 61,198,186, 27,110,114,132,166, 53, 69,148, 59, - 30, 90, 23, 25,101,236,171,154, 43,201,240,223,133, 36, 17,241, 35,145, 74,229, 39,161,215, 63,238,253,167,145,106,238,109,193, -110,177, 27,154,158,103,166,165, 71,109,208, 75, 65,135,207,188, 66,117,149,227,252,159, 41,228,233,219, 3, 75,181, 66,188,109, - 27,157, 72,221, 61,223,199, 99,123,219,220, 65,219,108, 51,192, 88,210, 85,228, 53,174, 76,116,104, 30,157,201,185,229, 35, 0, - 2, 19,125,224,147, 75, 37,239,101, 33, 13,213, 69,250,103,114, 80, 10,102,173, 46, 58,164,199,113,180,212,163,184,159,141, 18, - 38,180,144, 27,150,219,136,255, 0, 40,194,218,193,244,234, 52, 13, 53,152, 76, 85,228, 75,126, 75,175, 83,218,112,212,170, 11, -111, 28,170,135, 77,132,169, 78,242,115, 15,209,175, 45,242,143,153,236,117,227, 97,231, 85,171,148, 38,109,155,155,154, 91, 20, -248,232,126,139, 84, 87,199, 38, 34, 85,134,223,163, 74, 82,186,185, 28, 40,126,141, 95,205, 7, 30, 67, 69,110,125, 33,219, 19, -109,119, 58,172, 90, 66, 93,116, 66,166,211,214,225, 63,160,250,214, 82, 3,169, 64,233,241,150, 27,112, 39,168, 3,155, 62, 88, - 58,244,144,243,106,233,148, 11,197, 35,128,123,129,109,205,246,238, 6,199,184,235,108, 71, 42,184,155,216,242,188,198,154,162, - 95,237,180,208,232,140, 11, 90, 66,236,136,172,189,245, 3,160,145,212, 16,122,249, 73,227,159, 17,187,137, 50,231,190,101, 63, - 18,112,228,140,252,162,176, 30, 62, 10,228, 73, 82,164, 22, 95, 72, 63, 2, 91, 10, 66, 22,112, 8, 82, 66,185,126, 28, 29, 79, -145, 81, 80,168, 42, 68,213, 63, 12, 37,188, 63, 45,130,209,128,132,156,150, 26, 75,203, 73, 74,254, 39, 10,138, 92, 67,124,164, -229, 42, 25, 25,186,221,245, 35, 87,185, 43, 18,155, 90,227, 77,126,164,251,143, 7,129,118, 51,188,178, 11,120,144,148,242,135, - 91,232, 71, 50, 10, 92, 36, 36, 39,211, 88,139,213,131, 77,117,196,212, 27, 16,219, 83,220,225,196,169, 47,211,101,161, 71,194, - 11, 92,133, 4,174, 9, 66,203,105,113,183,145,240,248,193,124,202,108,130, 38, 34, 59,179, 29,137,125,253,230,246, 63,127,165, -250, 13,186, 11,218,248,225,108,186, 60,159, 36,202,104, 33, 80,239, 79, 18, 6,232, 36, 44,108,206, 88,216,171,134,102, 58,137, -189,193,232,183,182, 51,138,107,197,167, 35,145, 32,194, 75,137, 45,162,170,204,129, 26, 59,172, 0, 57, 16,250, 88, 42, 67,173, -168, 44,132, 33, 97,105, 81, 89,194,193,192, 15, 21,183, 34, 93,189, 17,133,173,196,213, 88,150,133,188,239, 51, 44,199,149, 29, - 45,142, 86,210, 82,135, 2, 38, 68,112,144,144,148,168, 41, 39, 32,133, 0, 2, 89,200, 80,154,117,109,186,212,100,199,139, 80, -101, 13, 33,216, 78,199,114, 51,238, 37, 74, 91, 78,189, 27,148,178,231, 80,164,172,130, 9, 41,201,238, 14,179,250, 11, 83,227, -182,194,154,145, 2,161, 25,212,187, 44,196, 66,213, 18,124,111, 5,107,100,166, 20,148,169,198,211, 12,115,175,153, 42, 74, 80, - 70, 78, 78, 51,166,186,192,172,178, 6,109,136,220,117,189,189,227,117,177, 30,160, 27,119,233,139, 14,158,162, 39,142, 0,101, - 66, 93,128, 10,247, 70,216,130,108,214,176, 96,108, 65,243, 95,175,187, 27, 7,111,210, 27,168,182,211,116,199,151, 78, 75,232, -110, 83,209,169,177, 26,125, 10,125, 72, 91,143,187, 34, 34,142, 34,172, 0,129,128,132, 45, 73, 72, 9, 43, 56, 80,206,163,202, -184,216,125,223, 26,158,154,225, 56, 80,114,142,180, 69,150,162,178,150,227, 46, 61, 62,106,200, 76,129,146, 74, 91,146, 28, 87, - 54, 67,121, 73,211, 37, 69,159, 9, 83, 19, 42,175, 34,171, 13,106, 74,227,154,156, 84,200, 79,185,120,108,229,135, 25,169, 81, -213,250, 96,176,134,208,128, 65, 64,248,130,145,141, 58,116, 74,219,236,148,159,175, 97, 86, 33,180,182, 20, 87, 17,108,199,169, -180,216, 91,106, 47, 79,130,128, 61,245,230,208,113,204,207, 34,215,156,148,247,212, 94,170, 25,163,109,148, 76,140, 5,245, 41, -218,254,142, 8,213,107,116, 44, 47, 97,229, 55,198,205, 75, 85, 29, 71,255, 0, 73, 68, 85, 96,178,164,159,111, 98,202,179, 71, -229, 98, 69,134,130,202, 77,238, 0, 83, 96,239, 82,107, 84,106,164,152,205,214, 16,245, 17, 75,247,101, 22, 43, 1,232, 83,105, -203,136,165, 50,229, 98, 34,151,202, 17,226, 61,202,145,202,178, 48,162,146,142,250,216,251,105,128,186, 36,170,100,211, 22, 67, - 77,176,209,122, 60,214,153,145, 30,167, 10, 65,240,214,164,164,158, 79, 13, 73, 45,115, 37,224,181, 33,120, 81,230, 79, 42,131, - 59, 69, 16,106,201,139, 50, 64,129, 87,142,243,161,150,146, 80,211,168, 90, 71,134,148, 54,236, 25, 3,150, 43,129, 5,101,229, - 41, 92,199,162, 51,130,112,245,208,236,136, 14, 52, 88,165, 63, 50,139, 34, 51,197,246, 98, 51,239, 14, 83,216, 91,139,113,121, - 76, 73,110,172, 58,223, 48, 72, 13,160,134,135,112,144, 6,154,194, 70, 23,117,229,143,129,216,236, 71, 80, 47, 96,118,184, 4, -222,231,114, 6, 41,222, 44,205,105, 4, 73, 28,205, 45, 7, 45,193,177,250,212,141,149,187, 31, 44,137,107,144,124,172,109,102, -184,117, 1,243, 59, 82,158,154, 90, 88,167,200,142,181,210,164,169,181, 70, 81, 89,144,237, 61,164, 97, 8,142, 95, 89, 89,114, -156,227,128, 6,143, 58,148,202,185,146,172,161, 73, 41, 58,230,163,187, 82,190,163,190,164, 15,240, 15,170, 97, 12,245, 79, 47, -184,169, 46, 41,174,193, 14,169,111,140,231,161, 40,198,122,227, 89, 5, 18, 3,176,154,143, 6,166,202, 9, 1, 73,143, 61,174, -116,199,117, 99, 11,126, 47,134, 18, 84,193,229, 10, 37, 10, 37,180,225, 64, 40, 28, 13,100,168,166,120,245,217, 15,133,120,168, -146,220, 87,219, 46, 28,171, 6, 52,112,158,128,225, 60,175, 70, 87,197,205,140, 40, 16,112, 64,214, 42,193, 90,101, 10,126,211, -169,184,233,123, 31,188,110, 72,220, 3,125,207, 67,138, 55, 49,206,155,219,234, 42,132,129,216,197, 32, 46, 15,145,195, 50, 2, -235,191, 86, 80, 85,250, 18, 70,227, 86,166, 57,149,157,109,178,148,183,224, 71, 1,183, 35,200,142,217, 40, 25, 72,109,212,201, - 82,185, 20,122,144,165,158,100,158,128,171, 25,198, 50,253,209, 40,136, 75,137, 56, 90, 16,244,102,139,216, 60,229, 92,174, 20, -160, 14,224, 59,241,225, 62,105,200,244,214, 51,107,195,108,165,151, 16,146, 22, 20,133, 20, 2, 74, 64,121, 60,138, 65, 87, 76, - 96,117,207,114, 8,243, 3, 79, 5, 53,182,146, 64, 57,193,111,145, 35,178, 84, 80,226, 28,232,165,126,162,177,219, 31,234, 19, -220,105,223, 44,132,121, 88,223, 77,198,253,250,119, 62,253,247,252,113, 75,113, 30,119, 60,175, 32, 4,249,186,239,191, 91,252, - 54,176,222,214,184,191,174, 50, 89, 20,195, 81,143, 72,144,180,173, 79,134, 84,226,176, 3,206, 10,131, 10, 49,156,120,149, 12, -182, 3, 33,100, 31, 37,188, 73,238, 14,172, 46, 81, 36,215,106, 78,136, 82, 13, 46,159, 29,244,173,218,140, 98, 3,147, 86,130, -148, 42,159, 79,101,212,148,184, 90, 82, 9,117,242, 64, 39,157,182, 86, 64, 39, 89,163,142, 4,210, 26,113,106,112, 18,169,104, -109, 13,148, 32,151, 20,219, 9, 95, 85,156,163, 43, 88, 5, 64, 16, 3,157, 50, 73,215,199, 43, 45, 65, 83,113, 91, 14,161,136, -145, 25, 84,196,198, 1,231, 22, 91, 74, 20,150,219,107, 33, 42,116,156, 18,165, 16, 57, 84, 58,142,131, 82, 86,141,140,129, 80, - 14, 99, 42, 29,250, 93,128, 39, 98, 55,238, 64,233, 99,214,219, 98,176,130,186,186, 61, 66,153, 3,200, 12,138,151, 0,172,107, -174,228,216,130, 24,139,170,168, 32,128, 73,218,246, 35, 9,159, 71,167,209,161,120, 20,248,236,194,134,100,203, 91,178, 29, 95, -186,251,203,202, 90, 28,149, 81,118, 76,215,143,188, 39,196, 74,202,151, 33, 97, 35,155,151,196, 40, 72,195, 37, 84,174, 73,169, - 84,154,106,129, 77, 18,105, 49, 10,229, 68,157, 80,241,218,102,167, 32,224, 55, 84, 90, 25,111,222,102,198, 15, 5,251,154, 64, -109, 11,229, 46,180,231, 39, 33, 15,133, 74, 59,117,246,189,234,168,242, 95,136,212,199, 36,199,182,218,105,167,105,241,249, 74, -146,211,181,151, 92, 73, 53, 87, 2,149,206,150, 9, 76, 54,221, 64, 80,109,197, 32, 43, 88,189, 94,149, 6, 43,205,191, 86,230, -247,217,135,221,162,211,216,142,170,140,185,124,205,173, 45, 70,131, 10, 58,124,106,140,226, 75,124,160, 0,202, 50, 8, 82, 18, - 57,198,220, 72,224,134,210, 45,176,191, 96,122, 95,208, 6,189,206,219,216, 29,247,196,207, 33,174,134,153,155,219, 85,171,171, -156, 48,220,187, 89,207, 83, 96, 67, 75, 32, 91,221,193, 17, 45,216,175, 48, 50,178,224, 84, 74, 44,154,236,184,109, 72,113,234, -237,116,165,197,177, 54, 82,143,185,194,138,164,184,249, 16,105,241,143, 44,103,208,121, 50,164,146,226,240,182,220,119, 4,235, - 37,164, 65,153, 92, 80,137,106, 70,139, 82,125,151,164,197,155, 93,168,123,196,123, 46,150,251, 8,240,252, 17,238, 40, 42,185, -170,222, 34,155, 80,141, 16,150, 88,230, 75,114,101, 51,130,141,103,113,118,222, 84,228,199,126,232, 95,240,106,136, 16,215,189, -218, 86,235,201, 53,185, 52,220,146, 81,114, 92,236, 97, 49, 90,112,128, 36,194,166, 1,146,181, 52,236,199,138, 84, 53,147, 85, -149, 73,182, 92,129, 6,223,109, 81,169,207,198,147, 79,163, 83, 41,232, 5, 82, 81, 29,145,152,108,180,165, 54, 91,134,211,156, -200,113,210, 18,218, 3,193,103,153, 99, 39,101,145,165, 85,144, 39, 49,211,208,128,187,218,251,146, 58, 53,134,171, 94,215, 4, - 88,173,147,175,226,120,170,103,246,122, 6, 21,149, 44, 27, 66,168,189, 44, 37, 67, 23, 6, 68, 33, 36, 54, 58,210, 58,127,236, -202,171,173,165,149, 12,145, 11, 77, 10,223,167, 90, 47,203,153, 93,154, 39,203,117,178,229, 86,225,153, 22, 43, 10, 90,217, 97, -108,173,148, 73,109,194,197, 34,138,149,128, 98,176,158, 86, 18,160,180, 32,169,197, 18,171,243, 12, 71,188, 39, 42,174,205, 61, - 18, 45, 72,169, 45, 52,144,181, 82, 30,158,238, 86,184,179,219,134,160,218,163, 82,146,160,225,109, 14, 58,219,178, 20, 76,135, -249, 18, 91,109, 56,227,176, 25,153, 75,137, 81,185,166,184,212, 78, 68,193,165, 81, 33, 56, 20,195, 85, 39, 10, 11, 82,165, 48, -193, 47, 87,234,137,240,209,202,128,158, 72,168, 70, 91, 66, 74,214,240,187,209,162, 25,147, 29,241, 80,243, 20, 40, 45,185, 21, -234,107,146, 57,170,243,146,235,172,178,227, 19,125,225,132, 36,196, 91,197, 42, 68,112,151, 28, 82, 94, 80,113,210, 62, 13, 58, -210,106, 66,183, 75, 35, 17,168,117, 97,109,198,228, 16,111,212,237,190,224, 90,197,113, 23,172,103,117,158,190, 74,182,147, 48, - 80, 99,105, 64,211, 10, 1,101,209, 78,168, 99, 38,107,105,141, 52, 17, 20, 68,221,110,162, 55, 14,212, 81, 18,171, 73, 69, 54, -151, 80,170,193,183,229,135,231, 85, 42,149, 41, 47, 79,143, 80,247, 20, 52,203, 16, 98,229,240,126,168,115,170, 31,125, 39,149, -208,202, 26, 10, 40,231,230,113,232, 15, 68,139, 87,166, 53, 26, 60,198, 94,122, 51, 68, 71,148,250,148, 25,103, 63,162, 83,229, - 41, 41, 99, 37, 69, 44,160, 37, 60,201,103,152,129,206, 20, 27,135, 43, 8,141, 22,153, 2,220,110, 28,171,174,170,134, 89,142, -153,169, 66, 35,209, 88,108,174, 57,126, 80,125, 99,220, 96,135, 91,113, 92,141,161, 33,199, 27, 75,101, 92,216, 34,241, 2, 53, - 62,152,134,101, 34,161, 49,233,206,169,137,117, 56,178,156, 90,231, 45,245,190, 29,112,130,215,199,159, 17, 9,113, 10, 64, 72, -240,130, 80, 82, 83,212, 76,105, 31,217,222, 25, 64,230,104, 8,110,162,224, 1,102,223, 85,193, 99,246,172,183, 96, 73,103, 47, -101, 81, 84,230, 84,205, 52, 18,164,134, 72,163,156,202, 35,140,221,164,118, 98, 85,165,150,214,109, 39, 74,162, 72,246, 71,229, - 5, 65, 26,139,159,203,207,219, 83,176,204,240,223,237, 79,227, 35,111, 41,204, 69,139, 67,175,238, 80,222, 59, 98, 36, 38,195, -113,161,208,183,162,149, 7,112,132, 52,182,144, 3,101,170,213,102,182,215, 40,232,148,176,158,221,135, 48, 73, 36,100, 96, 99, -184, 61,250,246,212,159, 62,150, 45,137, 6,222,246,135,108,254,224, 66, 67,137,123,117, 56, 94,183,220,168,135, 22,209, 74,230, - 88, 87,181,215, 66,109,109,161,180, 2,209, 52,250,172, 0,176,165, 45, 68,165, 61, 64, 1, 34, 48, 64,228, 21, 18, 15,251, 56, -236,115,211, 86, 37, 3,171, 82, 68, 23,236, 70, 90, 53,182,195, 76,108,209,131,111, 66, 22,227,189,136,190,247,199, 60,230, 49, -152,171,170, 80,253,162,193,143,184,200,162, 66, 62,237, 86,255, 0, 76,120, 41,206, 48,160,113,145,142,217,207,150, 15,125,123, - 0,227,148, 14, 92,116, 63,209,247,244,215,220, 39, 25, 35,191, 83,230, 71,159,125, 87,109,178,242,146,134, 70, 92, 87, 96,172, - 36, 4,128, 84,165, 45, 71,162, 80, 0, 36,146,112, 0,201,233,173,195,210,228,218,223,187, 26, 93,174,118,199,134, 90,117,213, - 33,166,208,167, 28, 90,185, 80,132, 2,165, 40,158,192, 1,174,165,240, 33,236,163,226, 11,141,133,195,187,161,181, 31,108, 54, - 57,185,170,102,161,188,215,148, 9, 46,210, 42,138,140,234, 81, 54,157,182,214,243, 78, 53, 39,113, 42,232,234,133, 62,203,140, - 81,226,186,164,251,205, 65, 68, 45,141,111,127,178,155,217, 11, 7,117,232,244, 30, 38,184,174,161,203,107,103,231,248, 21,109, -173,218, 73,190,241, 78,168,239, 51, 13,168,169,155,182,242,228, 90, 36, 81,246,136,186,131,238,144,210, 90,151,113,134,203,171, - 91, 20,149, 36,203,150,181, 2, 36, 72,241, 41,180,202,125, 62, 5, 42,149, 74,131, 14,149, 68,162, 82,162, 70,166,209,168,180, -168,109, 37,152, 52,202, 93, 50, 19, 72, 98,155, 79, 98, 58, 66, 90, 97,150,208,219,105, 24, 66, 83,166, 25,243, 9, 42, 36, 48, -211, 63, 42, 59,216,200, 44, 75, 90,215, 17,131,112, 7, 91,187, 2, 54,178,171, 92,178, 89,124, 43,192, 18,102, 49, 69,153,103, - 74,240,208,200, 3, 69, 2,157, 18, 76,166,196, 60,141,179, 69, 19, 15,178, 22,210, 56, 58,131, 70,186, 89,244,203,132,143,102, - 23, 8,220, 37,199,165,207,176,182,222, 37,237,184,240,218, 71,188,239, 38,234, 68,167,221, 55,203,178, 8, 5,199,104, 48,157, -143,245,101,141, 16,184, 57,155,143, 75,138,210,217, 36,230, 83,228,243,158,151, 69,160,187, 49,126, 36,133, 58,235,129, 35, 46, - 60, 86,226,143, 94,131,153, 68,246, 24, 3,200,118,213,202,135, 74,248, 27, 28,132,168,164, 41, 71, 3, 60,167,178,137,239,204, -123, 15, 64, 52,232,211,232,248, 74, 64, 64, 35, 29, 71,146, 73,235,146,113,212, 96,254,205,107, 90, 40, 75,114,198,159, 86, 38, -236,109,251, 76, 73, 38,219,253,162,109,208, 91, 22,226, 81, 83,208,192,148,180,116,233, 71, 78,189, 18, 53, 84, 94,219,144,182, -187, 30,236,110,205,212,155,226, 36,191, 73,131,133,184, 14,237,254,198,241,107, 70,166, 37,170,205, 10,172,246,199,238, 12,230, - 90, 72, 51,232,213, 6,101, 92, 59,127, 50,122,210, 50,227,241,167, 51, 87,134,218,213,158, 86,166, 6,193, 0, 1,168,116,169, - 41, 33, 39,204,245,237,215, 39,203,251,117,250, 82,251,111,182,226,159,122,123, 47,248,158, 68,212,183,205,103,209,237,109,192, -166, 56,164,149,248, 53, 59, 98,234,166, 45,165,183,223,145, 74, 98,100,132,103,253, 85,145,219, 95,154,217, 61, 0, 4, 2, 74, -134, 8, 61, 7, 49,198, 52,227,147, 73,255, 0,165, 66, 15,216,112,195,220, 36, 0,159,222,225,201,223,169,197, 33,199,180,137, - 77,196, 45, 34, 0, 5,116, 17, 74, 69,250,190,167,136,155,109, 98,194, 32,222,246, 36,247,192,206,116, 56, 35,174, 1,207,238, -253,186, 25, 65, 61,243,212,246,243, 7, 26, 53,192, 0,199, 55, 83,220,158,189,254, 95,142,132, 88, 87, 83,128, 65,237,142,152, -192,193, 56,199,174,159,241, 15,192, 46, 18, 50, 66,124,241,246,227,185,249,232, 98, 58,147,216,252,251, 39,236, 30, 90, 53,207, - 47,191, 65, 58, 65,207,175,110,189,250, 16, 14, 52,178,244, 30,252, 20,218,254,159,207,182, 5,112,227, 39,190, 51,142,131, 31, -120,199, 78,154, 17, 68,242,243, 31,159, 40,251,126,126,154, 37, 72, 61,249,137,198,122,121,118,238,122,245,213, 5,161, 68,100, - 16,191, 34,124,135,231,247,232,227,183,207,254, 48,111,134, 5, 42, 36, 16, 71,124,114,231,182, 61,126,122, 29, 68,103, 25,234, - 1,232, 6, 0,235,229,162, 84,147,145,215,246,116, 0,106,130,240, 62,121,237,229,142,217,251,124,180,162,141,133,183, 31, 63, - 61,177,144, 1, 62,151,192,138, 73, 25,229, 57,201, 57,255, 0,103,240,208,221,251,232,197, 2, 50, 70, 0,235,156, 30,227, 61, - 50, 61,116, 50,192, 29,129,245, 39,203,236,252,116,170,117,249,219, 10, 40, 4,116,183,200,197,185,230,249,199, 41, 42,198, 70, - 82, 58,103, 25,238, 71,150,116, 51,141,184, 1,235,202, 2,112,144, 0, 36,143,159,167,158,174, 42, 0, 30,132,158,249,207,174, -132,121,178,164,158, 85,169, 7, 39, 24,254,119,219,234, 51,165,176,110,158,235,226,222, 82,148,255, 0,148, 36,147,212, 99,211, -208,244,239,165,175, 69,181,182, 0, 82,148,225, 61, 73,192,233,242,239,165,161, 99,233,140,227,210, 7, 92,249, 15,233,252,157, - 20,130, 49,129,223,185,251,245, 65, 32,224, 12,117,234, 63, 19,255, 0, 13, 86, 64,238,124,199, 76,122,104, 96, 96,148,167, 3, -175, 66,127, 28,126,227,253, 90,168,210, 0,200, 56, 61,207, 79,158, 58,231,243,223, 84,210, 73,233,142,131,166,126,239,219,162, - 91, 73, 57,233,223,215,207,166,147,112, 55, 61,255, 0,241,129,143, 96,121,224,159,199,161,251,180, 91, 63, 23,113,203,215, 25, -238,123, 13, 83,109, 35,160,235,215,175,223,141, 18,148,131,208,116,233,158,223,102,147,193, 77,141,238,118,193, 72, 79,216,122, -118,249,250,227,203,207, 85,146, 1, 56, 61, 61, 49,251, 7,109, 14,216,230,198,125, 50,122, 99, 68,160, 2, 64,198,125, 63,225, -164, 90,192,144, 62,122, 97, 28, 86, 29, 14, 58,140,121,159, 62,158,186,218,174, 11,120,121,159,197, 23, 18,123, 87,179,145,130, -147, 79,185,110, 40,206,220,178, 66, 73, 76, 27, 74,150,164,207,184,229,172,143,213, 6,158,202,219, 7,253,105, 35, 90,172, 1, -206,113,144, 59,143,159,245,234, 71,254,193,173,178, 98,146,141,245,226, 34,165, 22, 63,188, 82,169,144,118,234,211,150,250, 66, -158, 98, 93, 83, 19,235,142, 70,200,253, 26,253,223,221, 91, 42, 24, 61,198,152, 56,151, 50, 57, 86, 77, 91, 84,173,166, 80,186, - 80,142,161,155,107,143,122,130, 91,254,220, 76, 56, 7,134, 79, 24,113,142, 65,195,218, 75, 67, 95, 58,243,173,255, 0, 2, 48, -101,152, 92,116,213, 26, 20, 7,179, 48,196,149,103,214, 45,203,102,139, 77,179,109,136,172, 83,237,139, 54,149, 2,215,182,224, - 65, 9,106, 37, 62,145, 72,142,136, 76,165, 49,147,211, 5, 45,100,145,212,231, 39, 86,118,235, 42,143,200,227, 47, 37,210,234, - 18, 24, 83,124,167, 5,120, 37, 7, 39,169, 39, 31,142,154, 22,235,241,228,173,213, 7, 98,188,149,229,164,178,233,228, 89, 82, -186, 30,101,122, 21,107, 39,167, 33,181,182,204, 85, 70,113,109, 7, 2,195,161,204,169,167, 50, 20, 18,130, 15,196, 61, 53,201, - 85,114,187,206,236,205,119,148,147,111,221,239,252,122, 91,240,246,231,132, 50, 26, 12,191, 43,166,165,142, 30, 84, 80,168, 93, - 32, 13, 58, 85, 84,105,177,176, 1,109,176, 91, 3,211, 99,135,136,196,145, 38, 52,105,210, 76,121, 79,186, 10, 76,117,169, 45, -200, 65, 31,170,160, 65,233,140,104,132,199, 66,144,161, 62, 50,221,107,148,150,150,164,248,168,109, 67, 33, 74, 86, 6, 71,200, -131,160, 41,209,224, 56, 99,202,116, 72, 15, 50,217, 66,222,125, 75, 64,192, 24, 0,163,205, 35,215,229,172,162, 35,108, 56,218, -125,222,104, 97,121,193, 42, 81,113, 50, 18,162, 73, 1,181,118, 3, 58, 69,199,148,148, 66,227,107,244,216,237,190,219,127, 28, - 18,170, 83, 9, 43,230,178, 30,161, 74, 4,185, 54, 11,164,181,128, 27, 95, 77,200, 59,139, 97, 81,169,202,247,134,228, 67, 90, - 39, 71, 36, 55, 34, 19,199, 15, 6,193, 24, 91, 89,234,160, 7,109, 86,220,221,191, 69, 90, 85,181,115, 68, 96, 46, 68, 6,140, - 7,138,147,149,150, 82,160,166,208,188,140,168, 39, 39, 25,242,233,167, 58,137, 71,166,201,142,194,201,142,212,216,196, 6,229, - 50,121, 11,153, 61, 65, 3,161,199,207, 78,207,240,125,201,244,162,195,141,165,106, 65, 67,236,188,216,248, 92, 90, 48, 74, 84, - 7, 98, 83,144,126,221,106,152,228,100,145, 44, 64,101, 22,223,184,183, 79,141,173,235, 98,111,138,187,136,120,137, 99,171,130, -101, 58, 30, 38,100,109, 86, 82,202,195, 78,228, 88, 56, 32,141,236,172, 58, 16,109,124, 91,182, 90,193,101,183,152, 82, 35,165, - 30,248,200,113, 65, 41, 9, 79,140, 82, 57,198, 49,211,152,245,251, 78,155,223,104, 77, 33,251, 91,135,122,140,200,202, 44, 42, - 69,199, 77,109, 75, 9, 39,197,247,120, 85, 7, 27,105,208, 6, 86,128,176,147,145,219,151, 56, 58,220,141,174,167, 53, 29,232, -216, 70, 58, 14,152,232,133,143,214, 72, 31,205, 26, 97,253,170,148,143, 23,133, 86,229, 70, 46,101,187,202, 15, 56,105, 57, 89, - 75,148,154,162, 84, 79, 78,191,171,143, 92,159, 93, 75, 50, 90,104,205, 42,203,166,242, 70,111,241,189,135,243,239,235,142,124, -204,184,154,105,248,255, 0, 33,161,119,211, 75, 85, 83, 4,100,118,176,147, 86,254,237,133,254, 24,136, 5, 65,227, 38, 82,145, -202,226, 39, 41,110,184,151,185,156,241, 27, 46, 17,149,180,210, 23,200,250, 75,169,109, 32, 45, 42, 64,235,207,202,174,244,225, - 84,213, 6, 69, 67,223,225,189, 84,158,167,131,113,207,129, 29,150,216,138, 80,148,182,153,212,240,151, 19, 0,248,133,126,240, -180,243,120,152, 79,110,128, 7, 61,166, 95, 74, 93, 83,147, 93,247,105, 92,175, 73,101,190, 69, 71,105, 74,202,153, 10,108,130, -212,142,100,163, 40, 88,230, 36,130,160, 83,202, 52, 77, 26, 68,232,229, 30, 27, 79,123,184, 37, 79,205,166,196,101, 85,116,182, - 73, 71, 35,108, 72, 90, 68,166,220, 46, 4, 56,180, 23, 84,209, 5, 97, 7, 3,149,225,214,234,123,129,216,253,221,239,113,176, - 23, 3,174,219, 95,167,161,116,245, 3,200,177,221,159,162,132,176, 97,182,229, 73, 27,128, 53, 11,223,179, 1,176, 39, 14, 61, -179,110, 49, 87, 92,138,164, 73,146,233,178,165,150, 16,227, 84, 69, 42, 50, 94,109, 10, 71, 71, 96,168, 22, 37,159,133,105, 75, -193, 9, 83,132,168, 41, 95, 14,158, 74, 45, 26,235,147, 34, 76,184,244,134,171, 40,104,204, 83,146, 41,175, 68,162, 76,140, 26, -117, 76,161, 51,233,207, 31, 0,115,161,149,165, 62, 10,135, 57, 87,234, 12,157, 54,148,138,123, 5, 81,133,159, 38,108, 39, 22, -195,242,231, 68, 66,152,157, 2, 68,128,208, 83,174, 57, 5,247, 3,144, 18,140,142,105, 41, 91,107, 89, 89, 79,134, 84,158,109, -108,157,156,170,253, 2, 24,110, 77, 1, 74, 65,106, 28,151,106, 52, 57, 77,206,132,236,118,255, 0, 72,150,159,167,169, 41,148, -219,202,116, 37,124,170,241, 18,165, 16, 50, 10,136,212,110,190, 89, 0,102, 91, 57, 54, 10,173, 96,125, 45,246,150,247,176,217, - 88,139,245,185,184,195,137,205,164,100, 34,153, 99,169,146, 43, 14, 92,202, 82, 66,118,230,106, 62, 73, 25, 71, 75,134,111, 41, - 23, 70, 4, 1,238,148,138, 91, 79,179, 2,163, 42,161,107, 43,221,217,145, 13, 23, 52, 5,211, 28, 76,196,148,190, 35,243,188, -223,129, 37,188,163,195,105,198, 94, 1,193,212, 37, 68,105,199,141,108,212,103, 60,153,146,233, 80,100,164, 73,113, 42,158,134, -163,128, 66,210,128,223, 59,193,178, 90, 87, 40, 29, 82, 74,185, 79, 84,231,174,179,235, 33,170, 93, 82, 77, 65,154,147, 17, 46, - 76,178,176, 41, 85, 40,140, 45,104,144,248, 64, 74, 13, 62,115,105,115, 41,101, 46,164,185,225,171,144, 31,132,142,153,120,104, -155, 91,103, 58,196,127,118,165, 59,108,201,150,211, 50,140,139, 86,167, 83,165,188,209, 10, 66, 17, 17,112, 22,243,140, 60, 16, - 72, 81,231, 97,105,115,147,153, 93,245, 22,146,172,134,180,138,209, 72, 58,244, 55,189,174, 71,217, 35,212,143, 54,251,139, 30, -173,181,252,117, 14, 86,239, 28,240, 77, 72,225, 81,117, 42, 44,182, 50, 45,220,171, 22,130, 84,251, 42, 72, 28,237, 90, 65, 85, - 58, 66,227, 1,178,236,216, 17,129,148,194,170,116,121,146, 79,188, 38, 93, 38, 95,133, 10, 82,217, 78, 91, 18, 24,229,114, 60, -196,167,194, 87,134, 28,105, 10,115,149, 65, 71, 7, 26,218,107,126,109, 90, 10,162,154,132,152, 21, 33, 32, 55,133, 48,201,165, -212, 26, 80, 33, 63, 20,102,159,113,167,222, 82, 65, 82,130, 11,105, 73, 39,225,199, 46,172,180, 45,177,175,198,113,230,233,151, -117, 62,124, 98,178,148,183, 92,183,144,196,137, 9, 81,248,202,103, 82, 28, 65,109, 73,194,146, 20, 24,229, 74,149,158, 83,170, -151,157, 90, 22,218, 91,117,139,187,113, 17, 73,181,172,155, 85,134,101,215,110,181,213, 99,253, 77, 72, 98, 68,134,161, 70, 15, -171,149, 18, 12,199,165, 63, 30, 59, 44, 48,211,146,228, 58,240, 75, 8,112,149, 16,164, 80,243, 60,247, 50, 62,199,125,199,193, - 73, 23,219, 99,125,143, 82, 0,239, 80,241, 39, 21, 71,196,149,209, 83, 82,212,174,107, 81, 80,226, 56,226, 80,230,162, 70,147, -234,226,138, 33, 50, 71, 80,238,238, 21, 99,138, 13,122,152,170,128,194,195, 15, 28,122,147,162, 40,105,244, 58,132, 37,223, 18, - 3,231,194,234,242, 86, 28,114, 59,165, 43, 30, 26,249,214,164,228,128,219,188,202,202,185,192,213,242, 37, 81,151, 30,143, 37, -197, 57,226, 48, 3, 43, 43, 9, 11, 44,184,174,102,157, 83, 95,206, 90, 22, 66, 70, 64,200, 86,124,137, 13, 21,189,112, 82, 46, - 11,114,151,114, 91,117,216,119, 21,175,113, 83, 33, 86,232,117,120,238,174, 76,106,173, 26, 82, 67,145,101, 66,125,192, 11,141, - 45, 4,130,146,128,164, 41, 37,183, 57, 92, 66,210, 3,147,114,251,147,205, 46, 54, 83,202,178, 2, 20,226, 80,132,161, 96,169, - 73, 10, 36,120,173,129,204,140,147,204, 20, 64,198, 59,150,162, 37,117, 42, 5,134,194,253,108, 65,216,110,125, 71, 75, 11,250, - 92,139, 85, 45, 11, 75, 83, 85, 72,209,180, 51,196,206,140,172, 25, 25, 24, 29, 14,146, 35, 0,209,184, 32,134, 82, 46, 24, 18, - 55, 26, 78,240, 90,213, 31,208,130, 86, 9, 4, 18,130, 72, 73,229, 80, 42,230,108,126,177,199, 46,112, 65, 25,207, 93, 58,209, - 39,130, 16,145,159,214, 81, 60,157, 65,194, 72, 0,114,156,158,128, 96, 14,165, 71, 30,128,234, 46,217,220,212,153,116,202,237, -193,112,215,105,214,197,177,108, 64,126,171, 91,175,213, 37,166, 53, 46,151, 79,136, 18,100, 76,145, 41, 67,244, 76, 39, 45,163, -148, 5, 41,199, 22,134,154, 11, 82,210,147,121,177, 56,210,225,140,221, 20,202, 80,185, 43,180,231, 43, 85, 4,209,236,251,142, -240,181,165,219, 54,109,110,224,123,244, 52,198,233,213,121,111, 56,150,164,191, 39, 34, 8,154,220, 70,223,145,203,133,133,114, - 37, 82, 44,159, 40,174,158,140, 87,178, 8,168, 83,237, 72, 72, 38,202, 69,200, 91,220,219, 97,125,133,250,145,136, 77,103, 11, -113, 14, 98,249,179,100,188, 59, 93,159, 12,160, 94,161,169,105,165,154, 56,137, 78, 96, 87,150, 53,100, 83,203, 28,198, 91,150, - 88,129,148,174,133, 36,110,229,114, 79,128,205, 58,148,133, 31, 26, 20,100, 59, 45, 60,196,132,212, 39, 20,202,122, 50, 84, 70, - 84, 27, 10,142,218,188,129,109, 73,206, 70, 5,137,201, 14, 46, 63, 35,110,172, 30, 98,236,137, 60,136, 43, 66,208, 65, 73, 5, -196,225,111,114,171,166, 73,229, 9, 25,193, 3, 88, 95,215,200,158,183, 30, 67,206, 41, 43,116,248,202,117,107,231, 82,249,143, - 62, 86,165,101, 75, 43, 42,230, 4, 2, 9, 87, 55,198, 14,178, 38, 92, 98, 67, 32, 20,251,201, 8, 88,240, 16,146,164, 41, 67, -178,192, 65,194,147,145,216,231, 10,198,125,116,226,139,237, 51,153,109,101,216, 45,137,176, 85, 0, 40, 38,219,249, 64,243, 91, -246,186, 2, 70, 32,113, 80,251, 44, 81, 44,131, 83,130, 89,141,129,187, 49,212,196,131,181,139, 18, 64, 38,192, 90,228,140, 52, - 23, 71, 18,155, 27,182,247,133, 23,109,175,221,230,219,141,180,184,238, 72,209,228,209,169,247,213,194,220, 10,181, 86, 20,201, - 78, 65,135, 62, 60,103,163,251,172, 38, 37, 75,102, 75, 81,164,214, 36, 66,142,250,153, 91,141,169,214,146, 84,119, 30,147, 66, -165, 80,195,147, 41,232, 38,166,235,108, 25,149,121, 74, 76,250,173, 65, 50, 26, 67,141,184, 37,252, 94, 36, 34,194,208,182,218, -140, 81, 20,180, 82, 89, 10,109, 73, 89,131, 15,180, 99,113, 31,190,120,217,226,105,247, 21, 37, 48,237,189,193,122,201,132,220, -231, 27, 90,216,183,172, 58, 52, 11, 98, 37, 40,182,149, 41, 9,140,210,225,202, 12,167,155,149,105,150,162,177,158,154,222,143, -101, 55,180,158,109,129,120, 91, 92, 38,241, 1,118, 84,165,108,197,201, 83,133, 67,218, 59,194,177, 84,117, 3,105,238, 58,130, -145, 22,145,102,215, 42, 78,168,190, 54,130,167, 53,198, 99,180,128,239,129, 65,155, 33,153, 40, 74, 41,207, 76, 66, 18,163,204, - 18,106,169,105,103,136, 44,113,146,169, 37,205,135,152, 11, 55, 64, 21,137,251, 98,218, 65, 1,129, 26,156,119,103,137,223, 65, - 12,230,155,192,222, 23,241, 67,129,120,142,163, 57,207,166,202,105,115, 92,243, 34,120, 80,201, 36, 83,210, 71, 89, 57,203, 94, - 45, 47, 81, 37, 18,146,173, 69, 62,179, 89,161,231,164,145, 39, 16,209, 79, 40,202,229,206,203, 50, 92,167,210,208,107, 18,249, - 17,239,226, 44,119,234, 17,224,182,163,206,183, 36, 8,104, 87,141, 37, 68, 5, 37,149,169, 33,190,156,196,116, 73, 21, 52,233, - 79,123,195,137,167, 34,158,186,130, 89,101,234,213, 77, 81,234, 87, 35, 64,168, 41,152,136,167, 35, 45,198,233,144,132,186,180, -161,158,159,161, 42, 57,214,118,211,109, 82,144, 99,162, 60,122,107, 81,146,184,210, 98, 6,209, 25, 12,173,165,168, 41,185, 13, -180,145,149,165,224,224, 89, 57, 61,193, 61, 53,141, 63,114, 33,233, 11, 85, 22, 2,170, 6, 42, 84,212,185, 46,120, 80,168,201, -117, 77,148,182, 88,156,160,181, 73,125, 4,163, 41,105, 11, 32, 40,146,226, 20, 64,212,177, 40,249,104,218,136, 93, 29, 1,247, -238, 71,235, 92,237,232, 58, 18, 54,181,252,231,165,168, 98,130, 44,186,134,201, 24, 5,166,121, 54, 99,112, 87, 94,233, 10,130, -202,186, 81,249,136, 78,144,193,201, 44, 84,122, 5, 38, 28, 86,234,113,156,144,169,205,161,212, 57, 82,170,201, 76,201, 45, 60, -163,153,137,113,197,182,159,113,143,202,130, 20,219, 0, 33, 33, 33, 36,173, 0,232, 37,215, 92,148,250,153,181,195,113, 24,204, - 83,252, 40,144,178,220,218,116,212, 96,205, 77,188,203,169,196,146,181,168, 6,221,112, 41,150,139,220,205,165, 69, 32,139, 44, -136,107,113,106,122,179, 49,215,100, 48,241,113, 20,248,234,113,186,107, 6, 70, 20,166,155,136, 28,230,125, 10, 89, 0,151, 66, -148,164,164,149, 30,184, 24,253,199,122, 66,165, 47,234,152,208, 81, 88,170, 60,133,169,134,151, 37, 17, 89,142,182,144,160,195, -138,116, 16,184,175,115,146, 26,228, 35,152, 2,144, 10, 70,182, 97, 64, 14,163,229,113,223,173,246,245,220,141,236, 46,119,233, -208,144,112,239, 75,150, 79, 93, 50,162,150,205,103,109, 68,106,254,230, 52,186,181,201,144,170,200,168, 55, 28,194,177, 0, 89, - 74, 58, 49,195,130,197, 46,151, 71,143, 89,156,136, 50, 16,226,147,239, 45,220,146,230, 75, 91,181, 22,228,134, 85, 46, 53, 65, - 42,116,169,215, 27, 81,116, 21,143,136, 56,176, 83,223, 69,209,101,194,118,104,120,212,188,105, 41,116,182,242, 25, 83,206,149, - 54,218,214,160,181,186,242,194,131,168,108,182, 83,205,250,200,108, 3,147,240,233,134,126, 83,142,181, 21,235,160,213, 20,137, -105,109,136,245, 1, 33,149, 69,131, 86, 73, 74,228,162, 18,225, 47,194, 98, 66,176,143,133,208, 29, 73, 36,133, 44,128, 52,237, - 91, 17,157, 91,145, 84,244,169,143,180,227, 68, 21, 75,109,133,243, 33,111,129, 20, 74,114, 56,241, 39,182, 84,174, 82, 70, 20, -165,173, 69, 57,239,167,120,101, 42,241,198, 6,146, 55,181,138,219,126,164, 14,187, 16, 5,245, 16, 5,201, 45,115,133, 51, 76, -165,169, 40,229,154,170,189,170,102,150,227, 88, 37,145,130, 42,169, 88,221,140,154,183, 83,169, 71, 40, 43,236,138, 6,155,195, -227,233,107,174,155, 39,136,190, 10, 30, 97,107,118,164, 56,127,220, 70,158,146,160, 16,217,132,155,246,143,200,210,154, 35,155, -222, 4,191,120, 37, 71, 9, 82, 86, 10, 64,235,168,152,132,228, 28,164,164, 19,215,231,143, 77, 73,155,233, 79, 95,204, 87,248, -240,217,189,185, 66,217,147, 47,105,120,111,164,154,148,182,157, 83,138,126, 70,226,221,245,186,220, 86,150,133,146, 80,148, 83, -104,144,212,158,249, 18,186,147,129,168,234,237,246,223,222, 27,165,119,219,150, 21,133,110, 86,174,219,186,237,172, 68,160, 91, -118,213,189, 79,122,169, 91,174, 86, 39, 44, 34, 53, 58,153, 1,128, 75,239, 43,226, 82,212, 74, 91,101,180, 45,231,150,219, 72, - 90,211, 98,229, 79,202,203,150, 89, 92, 34,171, 76, 88,147,176, 28,199, 55,185,216, 11,111,185,252, 49,198, 60, 76,139,250,126, -189, 32, 28,197,102,132, 46,145,114,196,195, 16, 0, 0, 1, 44, 73,181,128, 4,182,214, 7,108, 96,193, 42, 89, 72, 66,114, 71, -100,165, 36,149, 99,176, 0,119, 58,237,167,177,211,217,215, 3,138,221,197,169,239, 54,241,210, 85, 43,135, 45,155,171,194, 77, -122,148,248, 83,108,110,166,227, 37, 13, 84,169, 27, 94,149,140, 21,219,145, 99, 42, 44,251,145, 77,156,169,135,162, 82,185,144, -185,207, 4,246, 39,129,175,163,187,181, 22, 69, 46,141,184, 92,116,214,164,223, 87,121,101,186,140,141,132,177,171,110,211,108, - 90, 17, 41, 14, 34,153,125,223, 20,181,162,117,229, 60, 3,201, 42, 45, 53,216, 84,224,161,200,151,229, 4,149, 43,177, 76, 91, - 27,113,181,244, 24,150, 14,210, 88, 54,166,216,237,189,188,185, 31, 81,216,214, 37, 26, 21, 6,221,166, 25,110,243, 75,144,204, - 24,141,132,174,107,238,225,201, 18, 29, 43,126, 67,129, 42,121,215, 23,130, 27,243, 44,205,164,167, 43, 26, 24,161, 39,118, 99, -165,220,118, 10,191,105, 84,157,152,182,150,181,202,117, 86, 19,158, 18,240,238,182,106,218, 90,236,242, 5,138,150, 59, 56,166, - 62,103,145,133,180, 9, 71,217, 84,185, 12,200, 75, 22,182,135, 80, 11, 12,100, 74,154,169,242,176,132, 54,203,109, 54,195, 44, - 71,140,203, 81,226, 70,137, 29,164,179, 10, 4, 72,236,165, 45,195,134,212,102, 91, 75,109,182,148,182,219, 76,161, 8, 74, 80, - 18,144,232, 90,112, 2,249, 93,117, 25, 66,146,209, 71, 66, 22,162,163,134,241,211,245,150,177,159,152, 58,106,104,113, 92, 82, -188, 39, 22, 57,159,117,107,144,172,114,134,208,144, 20,235, 77,249,242, 37, 62, 27, 96,249,156,159,144,217, 59, 62,158, 23, 33, -162,160,146, 26, 67, 60,168,236,129, 33,209,134,130,134, 48, 2, 26, 35, 31, 51,211, 77,180, 46,116, 52,199,224, 54,176, 30,128, - 14,214, 29,134,219,219, 98, 14, 47,113, 78, 21, 72, 3, 87,123,254,238,135,222,126,240, 59, 91, 14,157, 22,158, 26,105,164,172, - 5,168, 4,243,159,213,231,121,125,145,208, 99, 30, 93, 60,129,211,139, 26, 35,109, 54, 49,133, 17,220, 16, 79, 83,232, 60,250, -246, 31,187, 86,138,100, 68,165, 73, 8,229, 81,142, 64, 42, 86,112,183, 22,144, 21,130, 15, 85, 36, 19,242, 28,218,203,218, 78, - 49,240,169, 41, 70, 66, 74,122,165, 68,142,170,207,160, 57, 72,251,254, 88,216, 14, 90,230,251, 15,244,249,254,125, 48,211, 87, -166, 54,210, 5,205,133,251,123,192,239,235,247, 3,211, 99,142, 83,123,105,234,144, 40, 62,204, 78, 45,213, 56,172, 10,158,223, -193,161, 68,109,166,214,234,222,168,213,110,106, 44,120, 49,210,219,105,230, 42, 83,161,103,253,144,131,228, 53,249,148, 74,163, - 86, 33,178, 31,157, 73,168, 68, 97, 73, 37, 15, 75,136,244,102,150,130,114, 10, 29,117,176,149,119,242, 39, 7,166,117,250,228, -239, 21, 54,139,113, 81,162, 91, 21,234, 77, 58,187, 2,167, 53,185, 83, 41, 53,168, 81, 42,144, 36, 71,167, 16,227,102, 68, 9, -141, 45,167,146, 37,173,178,146,164,171, 5, 25,232, 70,154, 39,182,131,105, 43,148,145, 68,173,237, 86,217, 86,168,230, 58,226, -138, 93, 86,195,181,102,211,147, 24,131,204,194, 99,191, 75, 41,109,188, 19,219,175, 94,132, 30,186,205, 29,108,244,181, 21, 13, - 12,113,200,178,104, 7, 83, 48, 55, 91,237,178,176,177,213,114,119, 55,218,198,215,196, 43,137,120, 6,163,136,230,167,205,151, - 49, 90, 53, 72, 22, 32,134, 2,250,180,203, 43,106, 45,205, 75, 41, 46, 64,178,159,179,125,239,183,228,250,227,101, 60,188,224, -140,142,128,244,207,144,199,168,198, 48,126,122, 21,192, 0, 3,155, 35, 57,233,215,215,166,191, 65, 78, 47,125,129,220, 19,241, - 21, 2,167, 90,218,170, 35,252, 48,110, 99,233,144,252, 74,205,131, 29,202,134,222,212,103,172, 18,132, 92, 59,119, 53,242,134, - 99, 45,220,115, 59, 76,122, 43,169, 25, 41,109, 88,229, 48,230,227,131,217,183,196,255, 0, 1,119, 35,112,119,146,205, 19,108, - 74,180,247, 33,217,251,193,104,151,171, 59,105,118,144,165,248, 44, 49, 88, 13, 5,219,245,162,132,229, 84,234,138, 35,202, 73, -200,108, 58,145,204,100,244,217,164, 82,178,199, 50, 26,105, 9, 0, 92,221, 24,250, 43,250,158,193,130,177,236,164, 11,226,164, -206,184, 91, 56,200, 65,146,174, 1, 45, 32,219,159, 17, 47, 24,222,195, 93,194,188,123,216, 93,212, 33, 36, 42,187, 28,115,229, -210,158,163,169, 24, 62, 96,119,253,255, 0,215,160,212, 66,187,167, 24,232, 58,249,116,198, 49,219,174,141,117, 3,152,133,229, - 39, 56, 41,199, 80,122,227, 65,120, 97,165,169, 73,201, 43,238, 14, 79, 41,235,146, 61, 52,244, 14,192, 1,182, 35,160, 31, 92, - 14,231, 32, 73, 74,186,231,203, 24,251,137,244,208,101, 3,148, 32, 40,165, 57,236, 60,201,209,133, 63, 26,186,168,231,201, 71, -225, 29,187,121, 13, 81, 86, 50,122, 16,115,246, 12,124,177,163,142,222,236,103, 3, 40, 3,211, 29,186, 30,189,241,215, 57,208, -203, 24, 36, 15, 67,140,252,199,207,203, 69, 47,208,103,166,115,229,147,129,215, 62,186, 25, 64,244,230, 29,124,143,175,113,215, -212,233, 85,189,129,245,235,243,240,198, 69,172,126,125, 48, 42,129,193, 30,127,147,161, 85,246,156, 17,215,204, 2, 8,199,217, -162,148, 58,146, 20,122,103,207,167,159, 83,161, 92, 42,235,233,230, 71,159, 95,232,210,139,215,173,176,170,143, 95,157,176, 50, -206, 15, 76, 31, 80, 71,224,126,220,104, 85,168,227, 28,189,125, 61,126,206,154, 37,100,103, 3,200,156,244,243,249,232,117,227, - 57,235,233,242,251,180,182, 50,126, 54, 56, 25, 99,175,159, 81,231,229,242,210,215,178,172,119,200,244,198, 14,127, 31, 61, 45, - 40, 47, 97,229,191,200,255, 0, 79,155,224,126, 56,162,144, 64, 30,191,143,158,170,163, 62,125,137,232,115,220,250,106,159,236, -213, 69, 35,156,131,204, 71,166, 63, 63,156,233, 54,219,160,220, 99, 35,227,108, 20,131,208, 14,228,121, 99,231,251,116, 80, 56, - 35,184,249,250,104, 22, 57,146, 8, 81,234, 59, 31, 80, 60,243,247,232,209,216,117,207,207, 68,223, 77,200,244,254, 88, 24, 45, - 24,207, 92,231,203, 69, 35,207,183,239,208,173,124,207, 92,126,127,118,138, 64,232, 79,221,249,252,249,105, 44, 16,142,190,251, - 15,145,130, 80, 58,103,215,250,244, 66, 49,140,129,215,212,247,207,245,106,146, 48, 57, 79,150, 7,252,116, 64,193,232, 49,223, - 31, 97,210, 44, 79, 91,236,127,211,253, 48,153,183, 97,138,128, 40, 5,103,208,224,119,235,169,123,123, 41,104,112,173, 78, 2, -173,121, 73,134,167,220,191,111,139,158,183, 80,116, 97, 14, 1, 26, 65,131, 29, 41,199,146, 91,142, 0, 58,136,106, 65,193, 4, -140,224,156,227,211,175, 77, 75,111,217,163,113,199,172,240, 9,183,233,105,231,146,187, 86,241,187, 45,249,133,131,143, 9,213, - 78,114, 75, 97,196,121, 2,219,168, 32,158,224,244,213,121,226, 65,147,244, 28, 33, 13,148,206,186,191,254, 57, 45,142,131,250, - 49, 71, 12,158, 42,209,137,118,101,162,169, 41,214,225,249,148,226,226,196, 27,233, 45,211,181,251, 99,118,128, 83,114,214,210, -153,146,220,116,144,235,125, 10,212,129,205,144, 20,161,156,249,105,224,180,100,161, 50, 35, 25,130, 74, 80, 57, 85,206, 20,176, - 26,230,198, 22,164, 30,253,198,153, 40,181, 49,238,232, 92,122,195, 47, 73, 82,210,211, 81,100, 39,149,110,184,178, 82,218, 1, - 61,252,180,248,219,242,107, 80,222,162, 71,155, 77, 98,169, 61,192,124,102, 35, 56,130, 91,108,254,170, 94, 72,254,110, 58,245, -215, 54,213, 70,193,217,152,217,148,130,111,182,219,117,233,112,127, 28,123, 9,151,215,172, 84,113,194,236,164,181,215,237,232, -114,116,222,246,144, 11,142,228,222,194,248,216, 58, 84,210,135, 89,145,227, 49, 81,108,184, 26, 12,189,132,132,180,123, 21,146, - 58,249,103, 78, 29, 49,216,145,157, 46,202,141, 0, 50,165, 99,153,162,151, 0, 10,255, 0, 80, 14,216,207, 93, 55, 22,253, 58, -116,249, 14,180,186, 68,194,162,227,110, 41, 40,100, 22,154, 72,236,208, 41,238, 63,167, 78,237, 50,222,105,197, 50,210,160,203, - 5, 43,248,209,238,139, 82, 16,172,254,170, 84, 6, 15, 64,123,246,209, 97,137,100, 58,121,100, 21, 38,219,129,125,253,251,159, -203,124, 66, 51,202,138, 53, 13,169,202,221,119, 10,203,112,189, 71,216, 96, 1, 27,139,233,177,239,124, 60, 54,123, 86,252,196, -161, 45,162, 50,155,229, 7,170, 74, 10,129,238, 6, 71,112,116,252,211,104,240,209, 29, 41,140,174, 68, 20,228, 53,207,204,217, - 24,234, 19,232,174,250,105,109, 74, 83,112,209, 24, 57, 24, 70, 14, 44, 8,200,152, 24,136,167,206,112,124, 36,200, 90, 75,189, - 71,243,115,233,167,174,148,195,204, 73,247,101,182,182, 20,172, 18,219,237, 41, 33, 67,200,161, 67,203,168,237,167,136,114,230, -101,187, 11,252, 13,192,191, 66,125,255, 0,150, 57,147,139,234,195, 84,202, 96,169,114,138, 75, 0,206, 26,224,108, 77,134,219, -119, 54,216,237,113,131,109,233, 2,149, 48,165, 68,165, 30, 38, 65, 7,177,206, 58, 19,172, 11,142,250,104,187,248, 72,189,156, -100,243,201,160,212,173,234,211, 33, 37, 75, 0, 55, 52,196,120,156,116, 8,228,153,212,158,131, 26,214,142, 52, 56,200,162,240, -178,104,182,149, 18,205,170,110, 30,239, 93,144, 68,251,106,214,167,179, 37,200,145,162, 56,240,138,204,250,159,186, 52,167, 29, - 74,229, 97, 13,180,210, 74,150, 65,201, 72, 25,215, 24,110,255, 0,109,214,236, 89,181,169,123, 63,196,206,212,209,225,216,219, -139, 33, 54,133,121,152,140,200,163, 86,236,207,172, 95, 67, 44,213, 92, 50, 29, 90, 28,247, 39,220,142,243,241,228,161, 37,109, - 48,160, 22,133, 16,160,237,150,210, 77, 74, 30, 57, 24, 4,148, 29, 42, 55,123,122,233, 0,155, 3,252,176,190, 77,224,151, 30, -113,173, 21, 7, 27,228,116, 52,241,195,151,149,172,136, 84,213,193, 77, 53, 92, 16, 72,162, 73, 41,163,149,129,100, 44, 12,107, - 36,134, 56,222, 75, 34,185, 39, 28,240,171, 81, 92, 18,235, 15,189, 50, 83, 15,182,251,205,242,193, 1,135, 11,172,188,227,129, -215, 90,116, 41, 15,167,152, 55,128,160,127, 87,190,113,171,197,186,251, 84,199, 27,110,231, 91, 11, 8,109,105,102,164,211,204, -152, 75, 4,120,205, 50,166, 93, 67,142, 51, 33,194, 84,147,146,190, 85, 0, 82,178, 59,103,187,207, 96, 84,168,155,135, 92,164, -148,251,168,139, 80,118, 74,101, 49,206,195,115, 26, 83,165,196,200, 97,164,164,165, 44,172,160, 41, 39, 56, 83,110, 36,144, 0, -213, 45,183,165,251,180,225, 57,214, 41,211,231, 46, 59,134, 32,155, 57,137, 75, 47, 56,165, 48,251,207, 7, 20,216, 97,211,207, - 28, 22,210,121,212,147,204,148,242,228,105,122,137, 21, 98, 46,198,247, 22, 0, 1,112,118, 0, 3,218,222,150,216,220,157,247, -199, 91,101, 89,173, 61, 78, 87, 77, 84, 36, 38, 42,136, 21,215, 65,180,182, 96, 28, 89,154,203,123,157,181, 30,246, 5,126,214, - 30, 11, 94,207,114,229,117,201,237, 69,164,202,120,197,143, 54, 85, 82,157, 37,183,147, 22, 59,235,108, 65,134,165, 70,194,224, - 61,226, 33, 45,144,231, 55, 47,196,226,209,149,116,219,107, 39,110,107,207,161,154, 43, 53, 69,192,105,220, 59, 45, 51,224, 51, - 86, 64,151,226,135,152,104,200, 64, 67,211, 90, 7, 24, 74, 94, 41,111, 9,230, 0,233,156,176,182,201, 77,169, 18,170,137,115, -223, 42,193,152,112, 99, 91,243,158,143, 35,199, 74,144,226, 36, 74,147, 13,192,137,144, 80,224, 4,151, 2,137, 82,194, 64, 37, - 56, 27,217,102, 90,215,133, 41, 49, 27,133, 84, 98,165, 57,224,159,142,189, 5,146, 26,113, 35,153,236,152,138,109, 46,169, 69, - 25, 87,137,133,140,117, 36, 18, 53, 10,175,145,203, 5,138, 80,109,208, 48, 59, 17, 96, 8,190,160,123,246, 0,108, 20, 27, 91, - 12, 57,247, 17, 10,106,116,134,130,190,154, 78, 89, 80,156,196, 87, 1,193, 91, 30, 97, 18,163,152,205,238,197, 65, 6,218, 88, - 22,108, 90,237,237,189,152,234,185, 95,164, 89,245,210,228,149, 56,245, 82,107, 53, 74,100,246, 35, 52,164,165,243, 25, 77,135, -115,204,242, 70,121, 29, 74,177,211,148, 96, 43, 79, 29,187, 98, 95,172, 58,106, 17,164, 80, 67, 45, 56, 12, 74,109, 70,100,217, -240, 85, 24,171,153, 44, 69,113,113, 82,236, 53, 20, 4,149, 21, 41, 69, 5, 39, 41, 86, 6,179,123,118,157, 92,141, 29, 16,156, -183,161,203,117,169, 45, 41, 85, 8,181, 70, 27,109, 47,173,212,248,236, 71,106, 84, 99,132,175, 36, 36,133,242,100,225, 68, 4, -141, 58,241, 37,169, 36,181, 81,162,206,163,163,196, 75,109,173,245,177, 34, 3, 69, 39,152,189,239,177, 10,146,225, 89, 79,232, -208,128, 73,194,129, 72, 61,117,169, 79, 70,103, 39,152, 2,179,118,234, 61,230,215,211,210,196,129, 98, 64, 29,141,241, 79,103, -220,101,153, 30,114, 70,144, 85, 43, 2, 13,228, 73, 14,130, 64, 58, 33,230, 2,133,252,192,233,140, 21,185, 0,130, 72,108,110, -143, 14,191, 8,188, 39,209, 80,234, 30, 65,115,252, 6,171, 17,212, 71, 73, 7,149, 40, 68,198,155,113,192, 74, 65, 61,137, 39, -175,124,235,131,126,216,205,247,152,111,141,190,225,194,146,243,176,233,118,141, 10,155,186,215,228, 17, 33,165,138,133,245,119, - 54,244,107, 38, 20,208,210,212, 86,213, 50,201, 6, 83, 77, 44,254,130, 77,220,242,193, 10, 9, 34, 68, 98,167, 69,113,239,115, - 98,162,209,150,227,169,100,164, 50,250, 30,142,153, 10, 67,104, 47,161,113,185,149,250,217,193,234, 7,124,117, 58,132,167,180, - 11,114,157,191, 56,207,226,110,235, 91,220,193,123,191,119, 82,161,167, 35, 13,210,109, 57,205,218, 52,134, 80,174, 65,250, 54, -233,246,252,102,210, 48, 48,150,250,247, 58,147, 81,229,101, 16,136,212, 49,107,111,110,151,247,223,215,107,145,238, 29,206, 45, - 63,161,246, 88,153,247,139,149,156, 79,155,208, 8,233,184, 47, 46,150,174, 32,203, 38,147, 89, 80,241, 82,211,189,164,119, 95, - 36, 18,213,200,157, 74, 75, 28,114, 11, 50,130, 59,157,236,172,221, 24,215,231, 13, 23, 37,147, 81,118, 25,168,236,189,253, 46, -152,218, 93,144,151,101, 53,102,223,141,191,116, 91,190, 19,107, 28,209, 97, 71,172, 69,186,152, 65,253, 80,165, 4,167, 7, 26, -218,107,158,228,161,191, 61,218,125, 49, 94,245, 40,172, 37,210,202,148, 67, 42, 11,229, 81,117,224, 57, 60,114, 15, 92, 2,160, -149, 14,100,228,234, 49,124, 2,239,229, 79,110, 55,233,155, 77,234,234,233,116, 45,237,130,141,181,173,200,114, 66, 99, 70,106, -181, 46,104,159, 98, 79,117,194,147,225, 52,221,203, 17,152,171,112, 17,134,171,110,142, 96, 9,204,138,108,186, 50,226,248, 65, -230, 94, 18,210,234,138,218,116, 40, 56,144,201,253, 42,228, 2,144, 82,232,125, 39,155,155,185, 24,199,163, 70,113, 75, 61, 53, - 66,211, 24,192,102, 80,250,173,177, 4,158,128,236,109,107, 27,244,244, 55,216,120,245,195,212, 92, 51,226,119, 20,241, 60, 83, - 51,208,241, 68,223,164, 41, 96, 4,170, 44,179, 42,251,111, 53,134,197,189,176, 77, 41,141,108,170,146,160, 98, 5,181, 97, 28, - 75,220,181, 26, 38,200,211,104,247, 69, 74,235,183,182,170,177,190,251, 65, 11,117,110,107, 14,159, 10,179,117, 91,182, 75,207, -220, 78,183, 82,133, 14,168, 4, 79,171,216,186,153,183, 21, 41, 82,210, 98, 36, 41, 9,115, 46,170, 58, 78,196,185,236,244,224, -218,187,107, 59,115,220,156, 71,239,126,228,237,173, 2,138,187,170,107, 84,230, 45, 75, 86, 5,193, 65,109,135,229, 52,252, 91, -142,223,106, 82,213, 70,114, 67,192,198,106, 35, 40,154,243,242, 91,140,151, 91,112,244,112,233,245, 17, 14, 44,120,174, 52,203, -140, 76,104,179, 45,183, 16,135, 25,122, 52,130,142,120,210,155,117, 36, 60,203,137, 64, 5,181,165, 73, 88, 7, 57,232, 53,131, -111, 20,122,181,183,183, 23,101,181,105,248, 52,138, 5, 74, 76, 74,251,148,250,116, 97, 1, 16,222,167, 60,106, 47, 70,165, 53, - 21, 77,181, 6,159, 41,244,182,244,150, 67,100, 56,236,116,184, 10, 10,220, 42, 89, 95, 56,135, 46,142, 10, 39,138, 88, 81,180, -202, 38, 14, 74,164,134,226, 72,138, 50,168,146, 61,200, 73, 86, 72,223,161, 85,177,213, 91,112,255, 0,139,220, 97, 77, 6, 89, -195,156, 53,196, 21, 60, 22,207,152, 77, 60,242,208,138, 52, 21, 75, 82,148,144,150,121, 38,162,154,174,158,178, 4,129,185,117, - 52,245, 41,169, 36, 80, 81, 94, 4,118, 96,232,187,243,188, 52, 58, 53,183, 22,179,113, 84,169, 53,196, 81,160,251,245, 41,201, - 62,244,245, 37, 30, 24, 17,105,181, 9, 10,121,208,245, 77,152, 9,140,153, 37,110, 58,225,146,151,148,235,139,112, 41,106,217, -189,151,227, 46,253,131,118,219,180,250,252,122,125,201, 79,118,165, 17,114,150,164, 24,178,216,166,197,117, 15,212, 36, 41,109, -252, 46,145, 13,149,146, 84,156, 16,146,163,211, 58,229, 18,107,239, 62,242,147, 37,199, 31, 91,206,242,186,241,117,192,165, 58, -115,211, 39,155,149,210,121, 78, 15,117, 43,161,198,175,245,237,208,133,180,123, 77,185, 27,181, 83,195,175,211, 41, 12,109,245, -155, 17,197,165, 15, 85, 55, 47,117, 95, 93,149,109, 82, 48,149,164,169,198,162, 73,174, 84, 86, 89,234,134,109,247, 20,190, 92, -115, 20, 34,161,174,138,166, 35, 73, 52,177, 73, 35, 11, 42,177, 35,177,251, 38,224,129,110,227,176,216, 3,139, 63, 49,225,124, -159, 58,137,168,171, 50,122, 67, 83,155,200,176,199,104,150, 37, 89,170,228, 17, 68, 21,129,214,136, 36,145, 64, 37,137, 84, 80, - 88,147,124,113, 55,116,247, 70, 69,253,187,251,165,124,248,206, 6,183, 3,113, 47,219,205,230,124,103, 29,108, 53,115, 87, 43, - 21, 40,234, 47,172,146,232, 75, 18, 90, 9, 39, 39, 13, 39, 9,232, 14,172, 14,214,153,120, 48,183, 78, 92,152, 57,157, 10, 37, - 43,109,167, 26, 13,184,150,207, 80,131,206,176,172, 30,169, 9, 5, 24, 32,105,155,145, 77,159, 79,177, 55,214,248,122, 99,102, - 14,214,238, 37, 54,195,167, 33,244, 45,181,207,144,221, 5,213,204, 44, 21, 16,151,138, 88,241,164,244, 32,167,198, 64, 82, 64, - 41,200, 53, 27,141, 40,118,147, 76, 15, 45,169, 62, 12, 25,243, 2, 86, 20,234, 16,197, 62, 19, 65,165,164,117,229,247,167,138, - 73, 61, 22,177,202, 7, 66, 69,171, 7, 12,211, 48,141, 68, 97,196, 42, 34,118,176,243,125, 68, 82, 27,237,230, 26,101, 64, 77, -183, 59, 94,221,125, 38,200,188, 76,203,114,202, 54,165,142, 67, 20,116, 65, 22, 8,217,183, 68, 90,250,204,182, 21, 7,236,171, - 60,153,116,228, 2, 70,148, 58,202,134,186, 15,209, 95,217,213,187,149,126, 36, 56, 44,216,253,206,187,174, 26,157,110,227,126, -218,126,193,186,149,240,199, 84,155,163,109, 39,191,101, 84, 39,204,125,144, 23, 80,149, 50,149, 75,163, 76,121,231, 85,202,227, -245, 23,148, 15, 58,213,173,192,169,181, 57,184,233, 69, 62, 75, 17,217,117,148, 54, 25,157, 8, 41, 77,184, 20, 57, 18, 85, 21, -196, 40, 55,148, 36,167, 33,106,235,158,185, 26,226,103,176,146,232,171, 73,224,105,202, 90,107, 52,248, 49, 97,111,182,232,183, - 25,185,145,221,148,239,233,169,118, 36,151, 91, 74,223,144,136,236, 44, 74, 46, 41, 40,108,169, 68,173,101, 73,230, 86,187, 41, - 49,154,218,209,205, 42,173, 52, 52,180,165, 74, 68, 70, 98, 69,116,182, 9, 42, 83, 15,150, 84, 82,172,173, 43,228, 0,100, 3, -231,140,166,170, 86,154, 21,107,179,160, 10, 88,238,110,160,139,147,114, 77,254, 59,238,122,227,195,207, 25,248,114,151,135,188, -100,241, 27, 44,203,158, 10, 60,158,155, 59,204, 26,142,156, 69,166, 56,105,158,169,228,130, 24,163, 88,121, 65, 97,137,146, 53, - 32,147,100, 5,141,201,182, 5, 94, 69,230, 10, 94,145, 46,158,251, 79, 45,104,148,212, 6, 23, 14, 74,219,229, 12, 45,182, 36, - 58,225, 37,149, 97, 25,231, 83,121, 7,151,152,115,103, 88,171,145,168,116,244,134, 97,194,115,222,240,219,142,210,234,106,145, - 26, 99, 65,211,209,246,222,146, 74,159,116, 16, 64, 41,113, 93,130, 80,224, 61, 53,146,220, 18, 42,169, 71,189, 65,175, 23,224, - 43,196,110,100,138,180, 52, 73,141, 20,132,150,219,121,201, 49,146,211,140, 32,184, 66, 20, 84, 8, 65, 74, 73,198,117,138, 87, - 28,148,234,162, 34,187, 74,117,192,134,195,141, 85,221,124,204,165, 74, 66, 64, 8,106, 33,105, 1,113,212,225, 81, 86, 31, 66, - 49,205,221, 67, 11,214,189,142,171, 48,185,237,109,186,218,221,251, 94,219,220,117, 0,118,198,190, 89,205,228, 83,161,104,226, -136,234,212,180,224,194,199, 64, 4, 7,140,136,249,140,128,157,144,137, 21, 72,107,233, 54, 57, 45, 21,111, 50,239,128,212,167, -155,106, 99,237, 53, 50, 5, 82, 58,170,112,130, 22,133,248,114,226,201, 82, 20, 84,194, 84,162, 75, 79,133, 20,150,202,144,180, -144, 70,158,219, 70,151, 29,231,155,118, 60,104,204, 22, 63,193,222,142,151, 20,169, 10,146,203,194, 58,208,195,190, 63,232,220, - 83,255, 0, 26, 27, 64, 12,165, 9, 10,230, 9, 32,105,148,162, 91,141, 33,248, 83, 89,126, 99, 48,230,182, 20,180,198,150,244, -129, 79,113, 60,188,170,101,153,170,115,222, 32,173, 37, 93,149,240, 99,149,124,169, 9, 89,109,184,249,226, 98, 31, 5,220, 21, -239,191, 17, 15,200,136,155,150,213,178,166,210,246,246, 59, 73,141, 4, 86, 55, 54,239,228,181,236, 42, 83, 8, 90,185, 31,124, -220, 21, 40,178,202, 18,149,144,213, 45,220,101, 41, 86,157,232,209,181,169, 10,100,111, 40, 23, 59,177, 54,181,129, 23, 4,146, - 58, 1,212,220, 92, 98, 11,198,117,212,212,212,243, 58,213, 20, 77, 12,210, 54,146, 52,132, 30,109, 96, 29,244,170,155,187, 57, - 42, 0, 96,197, 77,204, 4,253,172,219,203, 47,139, 95,105,175, 18,183,101,176,204,138,245, 61,141,200,141,179, 22, 18, 41, 9, - 93, 86, 93,102,147,182,162, 46,222,210,152,166, 51, 24, 19, 62,108,219,142, 29, 80,176,134,211,151, 87, 57, 0, 2, 78, 76,168, -189,147, 30,205, 59,119,129,141,189,137,185,219,145, 71,167,212,120,177,191,168, 72,110,225,150,239,131, 57,157,155,182, 42,104, -109,241,183, 54,188,132,130,150,171,238,183,225,154,253, 69,162, 22,251,224,192,105, 98, 36,114, 29,230,127,176,159,128, 53, 76, -144,190, 60,247,198,152,229, 94,166,106,149, 39, 54, 34, 21,106, 58, 84, 43, 87,116,135,159, 77,209,188,211,162, 60,140, 58,227, - 18,159,150,197, 29,103, 9, 19, 37, 74,154,140,150,153, 34, 80,232,121,231, 86, 94,194,151,206, 84,165,229, 89, 83,132,156,149, -100,255, 0, 59,169,238,117, 52,214,174,144,192, 15,246,106, 75, 42,129,210, 73, 19,102,115,254, 20, 96,116, 95,171,221,172, 52, -163, 53, 11,192,252, 48,106,170,102,226,204,206, 29, 53, 57,147,188,180,145, 48,254,234, 41, 9,101,148,237, 96,238,166,209,126, -196, 86, 97,188,158, 91,213,199, 90, 49,104, 79,128,238, 30,144,121, 9, 61,192,192,201, 10,245,242,251,181,174, 71,196,148,241, -192, 74,219,247,143, 25,101,101, 88, 83,109,158,100, 32,143,231,159, 20,183,140,231,245,116,231,222,179, 3,236,178,194, 18,160, -158, 67,240,159,214,231, 63, 8,200,245,230, 7,246,107, 16,183,233,171,125,220,148, 41, 94, 26,193, 82, 72, 56, 30, 24, 42, 25, - 7,182, 93, 82,127,254,159,144,211, 69, 97,106,138,152,227, 83,176,254, 38,222,238,150,252, 15, 81,139, 78, 53, 68, 46, 72,176, - 83,107,124, 58,253,247,191,243,198,113,108,211, 19,227,169,194,215, 63,134,203, 99, 5, 93, 27,101,146, 22,246, 14, 62, 37, 45, -242, 7,255, 0, 71, 91, 55,104, 83,196, 88,200, 91,141, 21, 62,226,125,225,196,142,201,144,233, 1,182,178,161,208, 1,200, 7, -158, 18,112, 52,218,218, 20, 34, 11, 72, 82, 48,167, 29, 66, 86,162, 9, 37,168,227,198,115, 36,249,169,100, 15,158,126,122,216, - 74, 93, 56,165,176,160, 48, 80,160,230, 79, 96,234,193,228, 24,207, 80,150,250,245,243, 58,216,145,194,132,133, 59,122,123,247, -233,252, 61, 58,123,176,171,188,113,197,169,205,134,223,126,214, 23,251,250,216,250, 19,223, 23,184, 45, 45, 45,164,250,130,146, - 81,130,165, 58, 79,198,161,205,211,205, 71, 39, 29,135,217,171,242, 82,161,202,146, 14, 66, 64, 79, 92, 18,112, 18,132, 16, 7, - 82, 71,151,110,167,174, 79, 64,225, 49,204, 6, 74,148, 8,194, 60,151,142,203, 80, 0,244,206, 50, 62, 95,110,173, 87,197, 93, - 84, 74, 17, 76,101,242,212,170,171, 93, 62,154, 51,254, 77,126, 25, 50,166, 56,148,245, 8,102, 57, 81, 78, 59,184,180, 13, 2, -252,184,139,157,194,142,158,167,111,226,127,215, 17,237, 18, 87, 87, 69, 75, 8, 13, 45, 67,233, 30,130,251,146,127,194,160, 22, -111, 64, 9,233,134, 94,191, 60,214,174, 57,178,155, 80, 92, 88,138,250,178, 34,146, 73, 75,205,197, 89,247,133,181,215,245, 87, - 40,172, 41, 93,185, 91, 30, 93,117,113,101,178,148, 36, 20,167, 60,185, 33, 32,115,124,125,242,123, 32, 17,235,228, 58,103, 58, - 6,155, 5, 49,217, 1, 3, 41, 72, 72, 43, 80,202,251,124, 13,167, 57,231,230, 87,116,142,188,202,202,181,122,119,157,164,242, -182,128, 48,114, 74,210, 29, 82,148,174,231,149, 4, 14,112,122, 96,156, 36, 12,232, 82,130, 20, 22,181,207, 83,241,235,252,127, -134, 38,117,241,198,136,144, 66, 60,145, 40, 65,126,182, 80, 5,205,187,158,167,191,125,177,107,145,209, 56, 56, 42,192, 31, 7, - 50,136, 81, 39,245,114, 6,113,145,215,212,143, 62,186,109,183, 18,195,178,183, 58,203,185,118,235,114, 45, 74, 13,245, 98, 93, -244,185, 20,123,178,204,185,224,179, 84,161,215, 41,210,208, 90, 83, 50,227,188,143,209,202, 66, 15, 51, 50, 26, 45,202,140,234, - 80,244,119, 91, 90, 65, 46, 20,133,132,149, 18,121, 66, 82,146,158,167,227, 3, 9, 11,231,233,205,133, 28,116,233,240,231,231, -171, 4,167,130,146, 70,115,130, 7, 41,230, 1,190, 97,133,140,168,119,230, 25, 87, 47,167, 66,115,128,228,164, 50,233, 32, 21, - 35,161, 23, 7,226, 15, 81,234, 45,238,196, 78,170, 0,218,129, 93, 72,247, 12, 8, 22, 32,141,193, 7, 98, 10,220, 16,110, 45, -112,118,216,254,127, 62,215,111,101, 5,107,129, 75,173,157,208,218,223,173, 46,126, 22, 47,170,217,166,219, 21, 73,139,114,161, - 95,218,219,154, 98, 29,148,206,220,223, 83, 66, 63,194, 24, 91, 77,191,245, 45, 81, 88, 76,246, 99,150, 29,196,198,148, 28,226, - 11,202,192,207,250,185,206, 65,252, 7,207,183,227,175,213, 99,121,118,187,111,119,183,109,239,125,163,221, 75,114, 53,215,183, - 27,137, 66,147,110, 93,212, 9, 73, 66,132,168, 18, 70, 89,155, 1,197, 28,211,235,208,230, 33,137,116,249, 72, 41, 92,105,113, -154, 90, 84, 7, 50, 85,249,178,113,225,194, 13,235,193, 55, 17,215,238,197, 93,238,191, 80,167, 82,159, 69,111,111,238,242,201, -110, 45,251,182,117,197,186,245,165,117,196,233,203,239, 75,138,218,226,212, 26, 24, 84,122,141, 58, 75, 74, 74, 64, 71, 51,238, - 85, 86,192,138, 57,152,176,223,150,204,110, 72, 29, 81,137,234,203,216,159, 51, 46,237,118, 86, 99, 65,113,143, 12,174, 75, 50, -215, 81, 41, 25,101, 83,105, 43,215,145, 46,237,160, 27,127,116,226,230, 50,126,201, 86, 67, 97,203,213,166, 30, 57, 89, 86, 50, - 57, 63, 91, 35,175,110,154,250,115,156,144,122,249,254,255, 0,158,190,132, 99,161, 63, 14, 7, 46, 51,204,122,121,244,234,117, -245, 72,229, 29, 50,113,234,114, 6,127,226, 52,254, 46,118,196, 36, 11, 11,116,192,142, 40,231,160, 24, 29,207,175,231,166,135, - 82,137,238, 64,232,124,241,143,179, 68, 44, 19,211, 24,237,156, 99,160,245, 31,126, 52, 50,128,235,212,121,128, 78, 49,215,207, -246,105, 68, 59, 91,211, 6,181,253,109,251,240, 59,128, 1,240,171,174,122,121,121,246,207,159,246,104,101,244,200,243, 35,246, - 1,147,162, 21,140, 28,140,254,113,161,148,112, 8,235,215, 56,237,248,125,154, 85,112,176,189,136, 39, 3,168, 0, 15,145, 62, - 99,204,143, 35,249,242,208,203,229,235,235,211,242,126,225,162, 87,140,117,249,224,122,159,158,135, 88,233,231,247,118,251,254, -237, 44, 58,142,248,193,237,183, 67,243,247, 96, 69, 12, 31,183,175,217,165,175,171,198,113,140,126,255, 0,187,241,210,210,202, - 77,133,197,207,221,131, 99,202,112, 72, 7,242,117, 92, 15, 35,128, 60,190, 67,250,245, 69, 3, 39,236, 25,209, 40,239,246, 15, -207,219,164,143,175,174, 6, 42,164,124, 64, 14,131,166, 15,207,236,243,242,209, 35,215, 56,198, 62,220,124,191, 62,122,164,143, - 51,208,255, 0, 72,235,253, 31,213,170,160,100,227, 56,233,145,243,252,254,237, 17,175,109,186,223, 3, 4,160,140,231, 62, 93, -207, 79, 77, 22,130, 49,143, 63,233,251, 52, 26, 72, 30, 64,143,179,183,217,162, 1, 74,146, 72, 61, 65,252,115,142,159,159, 93, - 35,140, 48,184,235,108, 20,140, 18, 1,239,158,135,203,239,209,169, 7,166, 14, 79,145,253,186, 1,158,132, 17,149, 14,196, 19, -140,124,243,251,180,122, 72, 79, 76,145,211,160,233,147,164, 9, 36,220,225, 54, 29,199,206,216, 33, 4,224,142,153, 29, 85,219, -183,166,164, 73,236,110,220, 31,173,246,111,125,182,170, 68,175, 13,251,106,189, 68,191,169,177,199,196,183, 33, 84,227, 24, 21, - 2,134,250,229, 41,151, 17, 57, 35, 63,229, 6,117, 29,198,252,179,144,122, 1,230, 79,219,211, 93, 44,246, 85,110,228, 13,175, -226,214,210,164,215,229, 24,246,198,234,192,168,237,157, 95,227,228,108, 75,174, 32, 59,111,188,224, 39, 4, 38,172,195,104, 4, -246,247,157, 70,120,186,135,219,242, 26,232,130,234,146, 37,230, 46,215,221, 14,166,255, 0, 32, 97,247,226,198,240,131,136,227, -225, 95, 18, 56, 87, 54,157,180, 83,123, 64,167,148,237, 97, 29, 72, 48,220,223,107, 43,186, 57,255, 0,166,248,146, 36, 30,101, -188, 76,200, 92,160,148,190,196,228, 14, 82,218,114, 10, 92, 8,242, 87, 93,108,205,136,136, 94, 60,105,208,170, 83, 26,151, 9, -191, 29, 82,222, 74,157, 92,231, 64, 7,195, 90, 79, 64,192,244,244, 26,103, 63,131,149,104,117, 26,148, 68,184,195,109, 83,228, -173,134,209, 44, 2,226,202, 22, 82, 16,178, 79,234,114,242,159,179, 79,213,149, 33,113, 88, 77, 61,112, 27,121,229,248,106,149, - 58, 39, 41,101,148, 19,213, 63, 32, 79, 66, 62,237,115, 51,211,150,121, 6,155,219,175, 91,109,181,133,253,226,219,123,241,235, - 75,241, 11, 79, 76,188,137, 11, 48, 93,149, 89,118, 13,107,151, 89, 1,176, 11,212, 3, 98, 79, 75,219, 27, 67,183,181, 74,244, -214,231, 56,229, 74,158,135, 38, 41, 14, 18,160,166,156, 74, 16,156, 36, 32,118, 65, 62,159,191, 89,190,241,113, 11,110,112,191, -176,215,206,245, 95, 6, 20,202, 61,145, 74, 92,138,101, 45, 18,130,100, 92,247, 68,212,150, 40,116, 70,185,198, 84, 94,156,164, -120,132, 3,202,211,110, 40,118,198,137,219,165, 83,139, 76,133, 80, 28, 90,114,210,212,240,109, 10,241, 74, 15, 76,167,253, 94, -159,126,117,202, 47,164, 21, 92,174, 69,225,135,102, 32,209,169,178,160, 90,181,125,216,152,229,206,180, 71, 8,142,167,224, 81, - 11,148,102, 36,173,177,132,143, 17,201, 42, 66, 85,208,148,156,117, 26,113,203,168, 3, 58,157, 54,103, 33,125,118, 36, 94,196, -237,222,227,213,182,195, 70, 89, 79, 69,197, 92, 91,144,112,245,125, 61,168, 43,234, 1,157,252,177,147, 20, 49, 60,207, 26,149, - 58,245, 75, 28, 77, 18,149, 55, 93, 87, 27,139,227,130,123,191,198,175, 16, 27,247,184, 53, 45,208,191,119, 70,231, 85, 90,163, - 41,199,233,180,154, 61,106,117, 46,133,107,211, 84,247, 52, 26, 77, 22,153, 17,228, 34, 20,118, 27, 40, 72, 87, 47, 57, 41, 37, -106, 42, 36,235,167, 28, 15,251,109,119,107, 98,106,116,123, 7,136,169,179,119,107,102, 31,113,136, 72,172, 74, 90,101,223,214, - 83, 75, 33,180, 78,165,212, 93, 60,213,120,109,143,137,113,159, 82,138,146,217, 13,173, 11,198,163,142,186,235,108,188,164,169, -213,165,121, 56, 0,143,231, 19,148, 16, 58,242,145,159, 46,186, 6,109,204,220, 84,151,229, 73, 75, 76,165, 69, 13,186,181,124, - 13,149,252, 65,167, 20,122, 32, 43,175, 41, 61, 51,208, 28,156, 25, 60, 92, 63, 80, 37, 67, 1, 49, 19,208,129,189,141,182,255, - 0, 21,246,184, 55, 7,184, 56,236,142, 32,151,195,140,255, 0,133,223,133,248,147,134,104, 42, 50, 10, 88,196,113,162,172,112, -123, 24, 69,210,178, 83, 74,129,100,164,145, 7,247,111, 27, 39, 75, 54,164, 44,167,244, 98,220,125,244,218,109,207,181, 44, 93, -211,218,219,134,218,187, 42, 87, 53, 36, 51, 69,220, 10, 51, 17,100, 76, 69,191, 35,149,215, 40, 82,159,113, 5,234, 52,228, 57, -209,198, 86, 27,121,151, 16,161,243, 44, 38,219,240, 59,195,109,247,187, 50,119,219,118,236,200,251,153,118, 75,170, 65,173, 67, -182,174,118,154,153,103,210,171, 16,188, 32,197, 90, 69, 61,192, 77,102, 97, 83, 13, 41, 94, 54, 91, 36,117, 74,129, 58,135, 95, - 6,188,107,223,252, 45,110, 43, 52,233, 52,170,149,203, 96,222, 20,101,215, 83,103, 60,250,190,174,187,227,193, 5,199, 38, 91, -143, 44,148,196,174,178,208,123,149, 72,234,165, 37, 41, 87, 50, 84, 70,166, 95,193, 71, 19,251, 57,196,190,221, 82,183, 35,102, -111, 8,119, 37, 13,224,211, 21,170, 59,206,165,155,154,207,170,129,201, 34,143,114, 82,138,185,226,186,219,193, 72, 75,184,240, -221, 9,202, 85,215, 26,134,231,185, 70,123, 75,158, 38,105, 42,145, 71,202, 88,163,146, 50, 90, 29, 18, 16,197, 88, 92,133,119, -146, 38,219,245,140,108,190,102, 70, 11,198, 92, 75,194, 16,120, 95, 13,105,224,204,246,176, 46,111, 21, 85, 20,213, 74,239, 79, - 89,200,142, 74,121, 30,138,165, 99, 8,209,242, 82,106, 70, 89, 32,229,195, 52, 53, 48, 77, 24, 84,168, 68, 26,105,237, 7,217, - 19, 64,220,153,215, 20, 88,210,156,133, 88,145, 38,124, 79,119,101, 69,163, 18,166,128,243,109, 37, 40, 1, 44,161,169, 41,117, -174,100,245, 74, 25, 74, 0, 3, 3, 90, 51, 69,177,226,173,138, 60,234,204,122, 85, 38,221,129, 41, 51,103,211,161,176, 94,110, - 91,208,250,114, 84,204,148,115, 56,210,150,121,194, 65, 70, 22, 18, 73, 35, 82, 72,226, 42,210,160,110,117,160,197,162,168,115, - 29,188,213, 74,168, 86, 45, 9, 77, 65,126, 76, 10,156,120,126, 17,171,208,229, 78,105, 60,176,167,150, 84,151,226,161,194, 60, -101, 71,113,182,200, 89, 26,226, 82, 54,226, 82, 43,245, 56, 55, 19,146,165, 82,168,173,189, 53,234,122,121,219,167,174, 92, 53, - 21,161,215,162,173,172, 60,148, 33, 24, 82, 73, 88,113, 92,185,201,201, 27,117,108,244,241,194, 26, 80, 4,200,175,177, 5,212, -177, 33,144,129,246, 88,144, 74,234,211,113,184,242,225,135,128,248,146,174,159, 42,143, 44,172,115, 72,249,120, 15, 20,146, 35, - 63, 50,152, 72,218, 26, 20, 93,164,179,172,144,173,201, 8,234, 67,105,179, 12, 29,182,244,136,190,236,139,162, 43,211, 44,218, - 8,144,234,232,245, 56, 11, 17,235, 21,134,156,116,152, 20,134, 80,176,164, 56,209, 72, 43,143,200,135, 22,133,101, 74,113, 57, -214,238,237,187,251,130,203, 76, 67,151, 72,167, 84, 98,133,170, 91,213, 42,148,233, 12, 76,138,192, 82,148,219,210, 68,113,202, -170,138,219,193, 89, 73, 67,106, 72, 42, 40,200,248,181,222,133, 7,252, 38, 61, 94,168,236, 48,218, 34,198,106,222,121,215, 12, - 42, 5,177, 73, 72,109,202,131, 44, 54,165, 4,166,172,236,131,241, 5,128, 23,219,155,149, 1, 39,109, 54,169, 47,214,159,141, - 78, 48, 42, 53, 11, 73,106,126, 99,142,173,244,196,145,119,169,196,182,166,100,201, 84,167, 3,137,162,161,194, 72,100, 6,202, -154, 9, 82,143,134, 60, 50,195, 58,115, 25,121,138, 2, 2, 5,250,155,236, 2,134,216,220, 95,168,238, 13,133,186, 73,115,220, -216,213, 80, 74,207, 75, 13, 76, 72,128,234,144,106, 49, 40, 80,161, 99,149, 74, 52,149, 4,141,198,181, 87,112,116,142, 90,187, -151,130,212,169,221, 85,192, 81, 71,162, 69,143, 17,233,177, 66,234,213,121,210, 29,109,249,104, 83,136, 47,211, 99,197,142,149, - 42, 58, 27, 13,132,100,161, 42, 4, 36, 14,234,214,192, 82,168,207, 6,100, 72,146,243,115, 36,115, 37,223,120, 83, 66, 40,134, -150,151,200,182,225, 67,103,224,109,191, 19,152,143,214, 95, 97,205,166,202,221,175,203,122,100, 42,117, 14, 27, 48, 96, 45,217, -109,187, 93,144,132, 73,164,149, 65, 11,113,200,212, 8,170, 80, 21,149,224, 37, 41,120,242, 70, 10, 10, 9, 83,160, 99, 78, 43, -116,232,146, 18,162,237, 86,169, 54, 43, 79, 52,133, 63, 42,172,182,163, 42, 83,190, 32,120,165,166, 16,210, 27, 75, 65, 69,178, - 18,158, 64,162, 82, 50, 81,157,111, 81, 68, 21,129, 8, 22,227,101,189,237,123,109,114, 1,185,236,109,232, 47,107,226,137,226, -141, 77, 41, 30,203, 30, 87, 20,158, 96,168, 26,121,138, 19,111,172,118,118,179, 18,159,221,137, 20, 88,110,150, 85,193, 53, 73, -145,226,170, 46,101,196, 76,164,184, 28,240, 12,134,153, 95, 43, 10, 74,155, 46,181,207,144,121,194, 7, 62, 9, 82,143, 47,108, -234, 4, 62,210, 58, 72,219,158, 58,184,155,183, 37, 40,183, 29,237,225,189,234, 44, 58, 57,127,200,220,181, 35,117,198, 37, 8, - 56,229,118,159, 89, 74,128,242, 87, 67,131,157, 78,142,170,138, 83,209,158, 69, 30, 52, 6,160, 54,228,136,114, 46, 38, 99, 50, -181,206,146,133,248, 78, 67,166, 72,113, 37, 82, 16,149,149, 37,199,134, 91, 66,242, 26, 11, 88, 90,147, 16,207,164, 3,178,234, -161,113, 5,183,251,173, 73,167,134,104, 59,189, 97,210,168, 85, 9, 52,211,200,236, 43,223,109,162, 38,218,168,185, 41,231, 21, -137, 21, 23,168, 70,202,152,128, 87,226, 56, 92, 95,235,114,171, 51, 28,157, 98,150,190, 8,100,110, 92, 83,221, 79,199, 69,239, -185,177,177, 27, 15,128,189,142, 45, 63,163,127, 17,212,112,127, 20,113, 29, 53, 38,185,106,243,156,177,196, 81, 58,133,230,212, - 82, 85, 83, 84, 44,108,169,172,160, 52,166,171, 97,169,163, 3, 91,114,200, 24,226, 4,154,196,244,219,106,220, 88, 18, 36,123, -230,213,238,117, 58,151,184,116,120,110,184,212,168,118,117, 66, 76, 20,196,186,144,180, 43,157,136,145,234, 12,197, 91,146, 81, -132, 70,114, 83, 75, 43, 75,110,100, 74,151,217,207,198,213, 39,137, 54,238, 61,133,221, 10,180, 42,127, 21,123, 72,167,219,169, -193,146,168,241, 90,223,139, 2, 44,118,170, 52, 45,207,178, 66, 74, 81, 80,184, 88,183,166,211,141,199, 76,103,157,106, 33, 53, -232,129,216,210,102,162, 20, 59,161,215,121,234, 81, 43, 84, 91,170,177,103,222,204, 45,171, 98,241,138,155,114,161, 89, 69, 74, -148,180, 59, 78,143, 92,122,151, 17,151, 83,112, 82,132, 69,184,196,200,129,133, 59, 38, 25,125,133,176,243,141,180,149,244, 87, -132,222, 13,248,140,184, 47,203, 39,113,120,121,171,199,191,238, 93,185, 98, 53,251,111, 91,251, 99, 85,166,215,175, 87, 41,240, - 42,241,155,165,214,182,154, 47,191, 41, 91,145,104,211,234, 42, 83, 92,148,103, 83, 85,163,199,117, 84,250,197, 33,136,225, 97, -185,206,113,194,121,109,101, 27, 45,125, 80,163,171, 2, 95, 99, 38, 41,121,134,115,162, 78, 66,144,133, 38,141,138,205,202, 84, -102,150,120,231,139,150,134, 90,104,163,158, 75,196,249,142,105,226,180,212, 89,118, 93,165,163,138,170,138, 74,220,202, 74,236, -184,209, 80,208,200,239, 65, 46, 97, 87, 27,213, 71, 85, 72,252,182,203, 23, 53,133,225,134, 42, 12,195, 41,170,210,211, 69,154, -203, 85,150,205,166,227,165, 61, 6, 5, 54, 97, 74,156, 18,227, 69,110, 35,140,180,165,169,249, 82,156, 67, 13, 71,138,218, 85, -241,185,226,184,218, 91, 31, 9, 82,214, 50,122,244, 11,114,111, 27,114,131,182,251,199, 34,255, 0,136,154, 45,247,176,245, 58, - 22,218,111, 22,216,181, 81,143, 85,184, 45,221,195,188, 89,183,161, 89, 20, 42,100,159,117, 96, 92,148,187,141,187,194,223,118, -133, 84,102, 59,113,170, 72,126, 72,105, 41,114, 12,164, 55, 75, 99,119,122,224,174, 51,245, 7, 19,219, 89,112,112,215,186,220, - 60,220,144,175, 61,215, 77,193,108, 87,174,237,159,151,101,211,226, 77,189, 33,110,173,151, 93,162, 70,144,154,221,142, 81, 76, -164, 63, 80,165, 60,241,153, 77, 68,215, 72,114,100, 8,147, 31,135,146,113, 71,183, 59,103, 34, 92, 13,253,110,235,173,110,165, -205,184,176,173,202,147,143,193,221, 91, 86, 92, 45,209,191,156,186,104, 59,129,181, 86,205,199,245, 20,121, 48,102,109,181,175, -123,214, 32, 86,104, 82, 40,181, 28,208,209, 13, 52, 53,191, 38,135, 86,101,109,214, 19, 84,229,188, 53, 74,207,159,161,161,167, -175,150, 56, 86,121,140,113,211, 67,100, 55, 51,107,101,157, 73,146, 72,180,145, 11, 42,168,147,153,162,197,146,162,201, 56,112, -210,113,141, 46, 79,196, 20,245, 18, 53, 58,173, 84, 67, 46, 95,106,106,245, 73, 41,170, 2,208,207, 24, 52,245, 80, 86, 80, 37, - 72,165,150,158,114, 90,122,170, 9,135,212,151, 87,227, 20,104, 45, 87, 24, 85, 86,218,241, 42,148, 71,110, 43,170,211, 76,212, - 52,150,132,106,245,151,114, 85,109, 11,162,129, 84,104,168,251,149,106,157,112,209, 42,113,229, 48,188, 58,218,227,142,108, 33, - 77,169, 90, 21,237, 94,168,222, 22,133,223,195,254,202, 10, 93, 82, 93,177,180, 43,183,183,154,236,164, 81, 20,153,146, 98,238, -125,229, 73,129, 91,163,213,175,116, 52,191, 22, 53, 66, 29,188,253,173, 71,167, 81, 57, 76,150,133,213, 81,149, 33, 81,220,148, -211, 74,150,182,225,218, 92, 50,112,247,195,165,153, 77,165, 90,219,117, 99, 91,150, 60, 43,174,244,174,223, 49,109, 27,134,228, -218,202,205,255, 0,107,212,149, 18,116,251,243,114,104,207,201,168, 51,121, 72,220, 7,211, 38,169, 13,184,115,170,215,251,244, -217,244, 88,238, 70,155, 37,169, 49,121, 20,212, 93,185,118,222,225, 46,203,225,223, 98,183, 23,120,253,160,252,116, 84, 55,118, -117,213,191, 91,223, 72,247, 69,219,219,105,184, 23,221, 98, 20,254, 44,230,237,204, 42,236,138,109, 42, 84,217,212,251,153,118, - 17,144, 93, 52,138,101,143, 85,175,174, 58,252, 58,125, 67, 79,254, 28, 54, 93,153,214,174,113, 79, 20,121,133, 44, 97,185,112, - 9,150,105,100, 73, 41, 86, 94, 92, 38, 35, 21,167, 43, 81, 29, 57,169,144, 44, 20,142, 37,170,101,154, 49, 70,106,111,238, 14, -168,151,137,248,115,244,207, 19,210,215,101,116,144,212,140,186,131, 48,134,146, 36,164,139, 59,164,121,107,219, 53,204, 26,181, -229,163,139, 38,160,162,201,235, 36,205,169, 85,235,234,125,154,190, 36,140, 9,162,154, 90, 72,169,213, 45,253,208,118,151, 97, - 90, 91,181, 38, 13,167,103, 94,215,213,102,231,174, 55, 49,215, 31,172,238, 77,247, 17,216,119, 14,228, 45, 49,233,233, 9, 77, - 46, 21, 66, 69,159, 70, 41,134,135, 99,193,140,211, 84,180,200,231,102, 82,155, 18,155, 83,131,120, 85,111,219,154, 3, 50,105, -148,169, 19,160,193,160,214,170,113,194,103,214, 98,211,229,168,183, 62,159, 72, 66,178, 89,147, 84, 14,152,173,252, 45,248, 13, - 54,178, 84,149,147,169,133,123, 64,189,146, 86,255, 0, 13,187,109,182,187,145, 64,219,248,219,185, 14,215,178,234,116, 13,218, -222, 42,148,217, 2, 53, 42,184,204, 22,226,237,117,131, 14,206,132,240,114,194,225,222,157, 83, 53,138,149,106,161, 29, 14, 73, -171, 86, 42,171,153, 89,124,169,230,121, 34,177,182, 91, 65,116,111, 46,243,196,218,253,171,247,251,206,183,116,213,106,146,228, -110, 45, 77,182, 89,136,139,118, 28,148,197,186,119, 9, 54,243, 47, 6,109,107, 54,152,143, 26, 45, 38, 35,139,255, 0, 5,141, - 9, 78,190, 85, 41,232,140,170,115, 83, 86,212,245, 25,140, 21,212, 63,162,231,161,141, 36,125, 43,202,166, 45, 35,172,211, 73, - 10, 63,152,169, 40,176, 6,149,220,186,195,120,162,104,238, 34,191,184, 15, 62,224,252,219,132,178,206, 51,225,190, 45, 60, 75, -193,102,174,190, 55,168,174,180,249,164,116,185,109, 52,249, 86, 93, 75,153, 84,195, 32,246,103,141,107, 43,115,158, 82,101,249, - 74,150,205,227,150,183, 49,167,173,118,253, 35, 52,143, 98,189, 5, 54,159,179,243,109, 77,101, 98, 4,221,196,190,119, 71,112, - 90,102,181, 21, 8,139, 91,164,212,174, 88,182,196, 10,140, 85, 56, 18,219,240,220,254, 9,200, 41,115, 33, 74,231, 82,146,146, -218,155, 42,234,187,209, 27,163,184,237, 90, 72,168, 42,130,200,240,165, 64,143, 38, 82,158,160,173, 74, 13, 9, 84,182,157,124, - 46, 93, 57, 73, 90, 10,152, 73, 43,100,172, 41,160,180,115, 32, 49, 27, 9, 77,177,109, 93,139,217,139, 99,111,227, 72,143,183, -214,214,217,218,118,173,163, 6,173,153, 19, 88,131,108,210, 99,208,101, 65,174,135, 83,148,212,157,159, 79,150,244,181, 20,148, -123,204,229, 43,177, 57,114,208,124, 17, 57,202, 83, 14,170, 36, 5,137, 85, 10, 36,185, 75, 84, 55, 96,202, 71, 42,132,120,171, -113,106,241,219,116,146,219,173, 15, 11,186, 85,148,168,114,194,132,136,200,173, 31,158, 54, 80, 65, 3,168, 34,224,129,232, 65, -213,184,220,116, 23,199, 0,113,150,101, 55, 20,241,127, 20,113, 19,235,165, 25,245,125, 85, 67,198,196,108,179, 84,182,152,185, -133,129, 73,145, 89, 34, 14,220,203, 72, 8,103,229,150, 86,247, 81,110, 91, 49,167, 78,161,215, 37,212,219,113,213,165,218, 85, - 69,240,244, 26,132, 54,129, 11, 49,228,181, 29, 46, 66,168,140,245, 75,156,193,124,161,183, 27, 28,201, 86,190, 81,155,125,104, -135, 34, 12,114,220,121, 41, 40, 98,157, 53,228,170, 35,114, 20,230, 86,221, 26, 80,200,167, 40,169,103,158, 59,169, 8,202,112, -128,131,144, 60,211,163, 71,152,183,230, 83,229,191, 4,133,169,153, 76,134,179, 60,198, 89,109,232, 14,212,225, 62, 86,221, 65, - 13,185,148,165,196,101, 78, 32,243, 37,209,130, 19,153,208,146,134, 81, 41, 19, 11, 49,214, 86, 24,121,165,178,165, 69,168, 40, - 31,135, 1, 64,169, 46,149, 41, 36, 40,254,144, 5, 36,146,188,100, 38,134, 48, 25,152,141,172, 46, 77,136,220, 27,250,141,253, -222,226,122,130,193, 89, 80, 41,169,164,139, 72,146, 84, 43,112,200, 85,236, 84, 40, 87, 84, 1, 94,219, 21,144, 93,244,155, 22, - 69,101,209,125,183,168,209, 97,190,250,204, 70,152, 5, 64,200,140,166,150,203,176, 87,241,151, 94,136,160,178,134,218, 89,230, - 82,128,202,114,162,164,100, 2, 53, 28,111,107, 60, 59,251,143, 63,104, 23, 11,126,205,170, 3, 53,106, 46,201,109,173, 53, 27, -255, 0,189,117,166,249,216,137, 90,147, 49, 18,105,172,202, 66,146,174, 71, 98, 81, 45,102,106, 49, 24, 42,193, 53,155,189,229, -160, 5,197, 73,215,123, 47,141,211, 98,142,167,173,155, 89,193, 42,229, 25,106, 76,148,165, 47, 71,180, 91,112, 5,120,181, 23, - 14, 83, 34,182, 58,174, 44, 18,162,180, 43,149,249, 92,173,165, 40,113,184,160,218,118,243, 51,158,189,219,161, 64, 93,228,170, - 58,109,137, 55, 99,177,210,229,194,253,186,103, 61, 86, 93, 46, 69, 85,196,248,174,194, 85, 90, 68,169, 42, 65, 86, 20,243,235, - 89,234,113,167, 76,190, 73, 36,154, 36, 66, 2,174,204,196,216,168, 96, 86,235, 97,187,142,171,113,179, 0, 79, 96, 43, 78, 39, -200,167,207,168, 64,172,169, 48,195, 60,176,243, 35, 59,153,169,213,129,145, 9,184, 40,178,128, 35,189,201,120,217,238, 72, 33, -152, 74, 45,191,110,218, 20, 10, 5,159,104, 82,163, 80,109, 43, 50,145, 78,182,173,138, 20, 36, 37,152,116,202, 37, 38, 58, 33, - 65,136,219,104, 24, 24, 97,176,165, 43,186,214,165, 45, 89, 82,137,214, 66,192, 44, 56, 50, 64, 66,255, 0, 84,246, 74, 22,174, -188,167,230, 79,109,121, 92,114, 87,226,132,243, 5, 16,162,145,156, 45, 62, 69, 56,238,161,231,246,106,239, 2, 58, 29,109,109, -140, 45, 4,158,231,170, 65, 29, 58, 31, 49,251,181, 41, 93,150,200, 52, 42,216, 5,236,161, 64, 0, 1,233,167,107, 95,107, 15, -118, 6,132,133, 20,133,242, 45,129, 0, 88, 1,181,128, 29, 5,187, 14,150,219,160,198, 15, 92,140,185,115,138, 64, 42, 71,192, - 48, 51,148,245, 42, 81, 7,237,199,237,198,179, 75, 74,130,162,174,110, 64,124, 66, 48,124,213,215,155,149, 64,142,249, 35,240, -215,148, 83, 60, 73,124,161, 36,156,132,103,190,121, 71, 64,125,124,254,243,173,128,177,237,177,134,150,166,134, 7, 42,186,224, -143, 44, 12,121, 14,154, 67,202,160,201,111, 49,218,255, 0, 63,127,239,196,120,213, 0, 90,237,117,185, 55,251,239,238,249,252, - 47,182,197,185,224,181,226,148, 36, 57,202,148, 5,148,228,167,152, 5, 58, 79, 79, 76, 14,157,180,226, 8,126,236,203,104,229, - 60,234, 39, 41, 0,168,144,160, 20,178, 64, 31,173,203,129,242,206,178,138, 93, 27,145,148, 5, 35,225, 35, 39, 61,212, 7,196, - 78, 60,251, 1,143, 61,123,145, 19,153, 69, 69, 4, 41,106, 8, 66, 83,212,227, 32, 37, 32,103,190, 59,159, 85,124,134,144,177, -221,137,249,239,127,225,134,106,140,228, 77, 49,141, 79,213,198,127,211,243, 54,237,139, 84,118, 89,109, 14, 61, 41,212, 70,139, - 13,135, 37,204,148,176, 18,212,104,172, 36,184,227,206, 40,246,108, 37, 56,249,146, 7,158,181,250,179, 86,126,239,172,200,171, -165,165, 49, 78,105, 40,133, 70,101,239,129, 48, 41,109,171,225, 88, 0,126,146, 83,234,203,139, 61, 57, 66,130,124,177,167, 30, -243,170, 10,151, 53,173, 13,126, 37, 62, 51,173,185, 94,117, 25,228,155, 49,165, 7, 24,164,151, 19,254, 82, 35, 74, 8, 47, 36, -116, 83,129, 32,146, 1, 26,196,209, 13,152,192,120,189, 72, 36,248,109,160, 56, 2,128, 5, 63,163, 79, 92,103, 3, 39,160,236, - 58,233, 61, 70,161,194,166,241, 70,119, 63,180,195,227,217,127, 22,248, 41,196,175,135,160, 90, 56,228,204, 39, 66,107,106,150, -209, 41, 6,241,194,108, 75, 91, 99,174, 91, 3,191,217,140, 1,191, 54, 69,192, 76, 50, 27,111, 13, 54, 73, 64, 9, 75,139, 82, -155, 0, 43,169, 44,128, 9, 62, 93, 64,193, 61,206,129,152, 95, 41, 82,138,208, 22, 65, 72, 12,164, 32,165, 0, 36,148,163,152, -144,217,234,147,145,223, 36,228, 96, 13, 93,159, 83,174,103,149, 32, 40,182,126, 55, 51,206,132,145,201,240,161, 7, 35, 62, 99, - 32,129,158,249,214, 55, 45,212, 37, 96, 41, 41,120,167,152, 0,148, 0,129,149,167, 39,148,225, 32,224,247, 61, 71,166,116,224, -158, 91,109,185, 27,219,231,253,127,117,240,237, 35,179,146, 77,153,143,253,199,183,115,176,223,225,139, 75,238,163,147,144, 21, - 40, 96,142,116,142,164,165, 71,170,222, 82,187, 31,136, 4,140,243, 1,229,215, 88,252,183, 65, 72, 11, 82, 74,126, 16, 8, 28, -184, 82, 72, 9, 66, 86,188, 18, 18,124,176, 62,100,224,157, 92, 39, 56,224, 82,146, 23,204,162,174, 95, 9, 9, 79, 55, 83,240, - 40,169, 64,252, 33, 36,252, 92,160,245,192,214, 45, 49,208,142,112, 21,241,171,170, 65, 78, 85,128, 50, 82, 74,129,229, 60,160, -143,187,169,234, 53,176,135,175,112, 15,243, 31,187,175,201,195, 45, 82, 13,247,235,252, 62,255, 0,187,182,253,175,139, 84,247, - 82,160,163,130, 9, 39, 36,167,159,175,196, 10,138, 66,176, 19,215,191,145, 57, 25,215, 6, 61,188, 92, 35, 69,226, 19,132,201, - 91,199,110, 82,195,187,161,195, 10,102, 93,241, 28,140,192,126,125,115,105,170, 47, 48,214,226,219,142,184,128, 86,242, 33, 44, -195,173,196, 64,207, 34,224, 76,242,116,235,186,178,222, 24, 37, 41, 81,237,144, 82,160, 20, 48, 84, 0, 3,162,199, 82, 58,245, - 31,127, 70,250,191, 79,164,215, 96, 84, 40, 85,216,173, 79,160,215, 96, 84, 40, 53,232, 14,182,151, 35,203,161,214, 98, 61, 73, -173, 66,121,165,116,117,135,105,115,166, 54, 71,126, 85,224, 28,246,216, 14,203,105, 35, 63, 89, 25, 12,191, 17, 98, 47,238, 61, - 15,184,145,176, 59,197,243, 92,186, 44,214,138,175, 46,156,218, 42,180, 41,114, 7,145,137, 5, 36,183,172,110, 22, 65,210,229, -109,238,199,229,128, 82, 2,137,239,143, 49,212, 31,152,199,126,154,248,172,145,219,166, 51,147,251,191, 13, 61,188, 74,237, 67, -251, 7,196, 22,245,108,212,198, 21, 21, 91,103,185, 87,117,161, 21,133,168,173, 72,164, 83, 42,242, 5, 1, 65, 71,170,194,232, - 46, 83, 92, 10,235,144,230,114,115,146,198,169,106, 88, 4, 43,155,166, 71, 76,119,245, 30,186,153,211,202,179,197, 12,202,124, -178,168, 97,235, 98, 1,254,120,230,119,142, 72,157,226,149,116, 75, 17, 42,227,209,212,233,101,251,152, 17,138, 46, 16, 70, 51, -235,156, 28, 99,251,116, 42,177,142,195,148,103, 30,125,187,147,243,213,117,168, 30,224, 12,142,248,206, 79,217,161, 87,208, 31, - 60,156,126,255, 0,221,173,192, 44, 0,244,192, 29,190, 56, 29, 89,193,233,255, 0, 14,253, 52, 34,142,113,223,207,184, 3,240, -209,107,237,223, 29, 71,231,243,233,161,156, 32, 2, 51,147,231,142,191, 62,154, 85, 7,124, 42, 44,119,192,171, 35,203, 63,126, -113,231,228,117, 69,125,179,147,255, 0, 31, 93, 87, 95, 55,158, 49,229,249,245,208,235,199,207, 62, 94,159,126,149, 2,228, 99, - 29, 0, 3,231,255, 0, 24, 21,103,175,216, 49,159, 93, 45, 37,254,183,221,211, 75, 74,139,128, 0, 31,142, 13,143,168,198, 79, -124,227,238,199, 79,219,162,145,140,118,235,230,113,251,254,205, 8,223, 83,147,145,208,244,251,241,215, 69, 35,177,235,231,219, -247,232,141,107, 47,108, 12, 18,142,199,167,223,235,249,253,250,169,158,221,250,124,254,126, 94,154,164,140,245,233,211,215,247, -124,245,237, 36, 40,144, 15, 99,131,223,161,210, 78, 54,248, 96, 99,223,140,142,249, 24, 0,103, 25,202, 78,139,108,149,129,212, - 0,124,241,215,168,233,211,239,253,154, 16,180, 1, 56, 0, 36,228,159, 79, 44,147,243,254,189, 86,109, 65, 36, 14,184,198, 2, -143,203,212,253,218, 64,155,117,192,193,237, 39,151, 3,175, 66,123,119, 63, 63,144,209, 8, 95, 51,137, 73, 78, 57,115,241, 30, -221, 60,178,126,122, 8, 60,140,148,130, 85,216,224,117, 87,159,124,253,167,240,209, 63, 11,137,248,186, 28,252, 35,168,207,219, -248,233, 22,234,113,131,235,243,233,139,187, 64, 43,162,136, 63, 49,147,235,233,247,106,247, 70,169,212,104, 85, 90,117,110,145, - 41,200, 53, 90, 68,248,117, 58, 92,198,148, 80,236, 90,141, 62, 75, 82,225, 74,109, 67,170, 84,137, 44,180,175,184,141, 88,152, - 10,229, 79, 96, 48, 57,177,219, 35,167, 79,219,162,211,156, 40,118, 30, 71,184,249,245,242,233,162,144, 24, 21, 97,112,118, 32, -239,132, 15,196,169, 30,155, 16, 71,112, 71, 67,137,193,240,233,185, 20, 62, 44,120,124,219, 61,240,167, 76, 71,191, 84,105,140, - 81, 55, 14,155, 5, 64, 73,165,223,148, 54,155,135, 89,139, 53, 8, 57,103,197,121,191, 25, 25,253,100, 72, 65, 4,131,173,161, -180,210,245, 40,183, 10, 44, 52,248, 14,171,153,247, 36, 40,150,208,211,100, 16,181,171,201, 93, 7, 79, 83,168,161,123, 40,248, -226,137,194,214,237,191, 97,110, 76,199, 6,196,111, 20,202,117, 42,239,113,106, 82,155,179,174, 82, 83, 18,135,123,178,146,127, - 69, 25, 42,113, 12, 78,199,254, 43,149,211,158, 67,169,140, 46,220,104,182,207,128,184,210,104, 79,178,197, 70,159, 80,128,226, - 36, 70,171, 65,146,132,189, 18, 92,121, 77,168,165,248,174, 52,182,212, 10, 73, 7,155, 84, 39, 16,240,233,203,115, 25, 99, 88, -201,130, 67,170, 35,216,169, 61, 47,220,173,244,155,247,243, 17,102, 24,239,143, 11, 60, 80,110, 39,225,218, 88,107,103, 15,152, -229,170,144,213, 33, 98, 60,234, 0, 89,236, 55, 34,117, 93, 98,219,115, 3,198, 8,209,135, 82,196,175,212,218,113,133,198, 84, -117, 38, 71, 32, 67, 78,101, 4,182,142,157, 7,255, 0, 22,125,124,255, 0, 13,121,226,147, 97,169,220,100,236, 45,251,195,253, -214, 96, 83, 89,184, 96, 55, 58,221,184,156, 71,138, 45,139,210,151,207, 34,220,169,161, 93,196,113, 36,248, 82,113,221,137, 11, -244,198,172,116, 62,102,100,181, 29,160, 61,231,149, 60,142, 99,224,101,164,246, 3, 29,128, 25,233,173,128,164, 74, 18, 99,198, - 73,116,183, 25,181,114, 60,178, 57, 76,151, 16, 50,162,162, 14,124, 60,129,246,235, 82,158, 2,165,118,210,203, 98, 45,216,245, -190,219, 94,253, 7,223,139, 66,108,214,122, 57,232,179, 76,177, 18,150,182,141,214,104,102,243, 49, 73, 35, 33,209,244,220,171, -217,133,180,176,210,230,225,188,151,199,230,211,196, 86,208,238, 55, 15,155,153,121,237, 22,231, 81,100,219,215,221,143, 82,149, - 79,168, 71,125,106,110, 52,230, 88, 90,132,122,157, 46,106,128, 76,202,124,136,220,143, 71,121, 63, 11,141,186,146, 8, 36,141, -107, 90,238,137,210, 99,242, 84,194, 39,208,228,243, 69,156,165,101, 50, 16,209, 35,156,184, 17,212, 56,158,138, 66,198, 72,229, - 26,253, 19,125,160,126,206, 29,169,246,133, 88,112,226,214,219,129,100,111, 5,191, 18, 68, 91, 19,116,219,132, 28,148,220, 38, -208,181, 53, 65,186, 99,180, 66,170,182,233,119, 30, 25, 39,198,138, 86,165, 50,121, 74,144, 97, 29,196,223,179,219,138,238, 14, -171, 85, 42, 30,238,109, 69,202,253,158,137,146, 26,165, 95,150,229, 61,202,229,149, 91,134,219,133, 41,155, 18,173, 13,165, 6, - 91, 82, 48,172, 57,202,180,231, 5, 26,179,178, 42,250, 57,225, 72,106,149, 86,169, 74,233, 44,116,220, 29,175, 27,118,123,216, -133,216,130, 59,142,146,250,158, 42,173,226,215, 74,204,190,189,178,218,167,133,214,182,141,111, 32, 18,142,242, 68,219, 84,208, -202,162, 69,119,250,199, 68, 58, 38, 17,181,158, 86, 98,205, 98,245,184,155,179,246,190,133,117, 81, 43,212, 69,205, 93,107,111, -171,201,247,180,220, 22,125, 75,170,221,143, 77,172, 67, 70, 41, 51,212, 66,147,225, 62,180,195,146,121,152,117, 41, 82,145,153, - 39,123, 14, 56,116,186,118,163,136, 57,119,139, 91,231,181, 82,105,117, 56,211, 85,187, 59, 81, 50,174,154, 46,225, 86, 41,142, -178,236, 71, 96, 81, 44, 39,154, 15, 79,169,138,138,154,146,169,140,169,198,154,240,202,146,121, 8,214,156,123, 19,246,162,147, -184,219,245,181,214,173, 74,157,114, 91,212, 68, 94,177, 46, 9, 87,209,164, 82, 35,166,152,213, 40, 26,147,148,152, 53,249, 12, -182,135,161, 77, 92,118,163,188,212,150,221, 87, 43,171, 72, 10, 95, 41,212,194,248,217,224, 59, 96,239,203,211,110,184,157,163, -220,219,119,195,142,224,236,189, 90, 53,199,112,238,141,180,213, 54,131, 86,184,173, 90, 80,241,158,162,204,105,137, 44, 68,247, -146,216,120, 38, 83,136, 82,185, 95, 91,106, 14, 36,132,105, 42,177, 85, 95, 69,196, 84,180,235, 13, 45, 13, 59, 8,229, 63, 84, -100,153,228, 44,254,209,101,229, 8,180, 29, 45, 34, 57,120,102, 98,238, 84, 54,248,177,115, 46, 32,224,110, 24,171,225,142, 26, -226,122,217,198,119,199, 25, 21, 76,116,245,242, 71, 93, 93, 67,144, 67, 83, 72,217,122,208,154, 38,146,170, 74,254,122,137, 97, -203,171, 80,123,126, 86, 13, 50,114,230,134, 52, 43,104,160,110, 52,106,229, 82,239,218, 10,165,197, 42,143, 92,155,112, 63, 79, -182,109,170,172, 86, 42, 53, 42,212, 72,110,166, 83, 17, 83, 38, 18,137,166,133, 50,164,172, 60, 85,240,145,228,123, 92,248,153, -225, 90,117,139, 14,223,186,217,144,212,184,247, 13, 37,217,245,234, 50, 30, 68,154,188, 47,118, 5,245,153, 13, 36, 5, 84,225, -248, 64, 45,114, 16,133, 4,120, 5,183,210,145,135, 23,170, 17,120,166,246,122,210,239, 8,251,245, 73,221, 42,108,202,125, 54, - 85,110, 12,136,116, 25,110, 42,164,252,181,186,183, 36, 84,100, 71,157,200,243,176,212,251, 97, 40,154,128, 27, 80, 87, 42, 0, - 73,215, 28,248,248,246,138,238,223, 31, 27,209,100, 13,189,190,175, 61,174,217, 13,133,184,168,247,110,220, 46,215,168, 72,182, - 43, 50,175, 26, 23,136,134,174, 58,133, 66, 41, 14,213, 96, 61,144,143,113,148, 85, 17,198,121,155,117,149,165, 68, 30, 78,240, -151, 41,171,203,168,248,214,139,140,242,218,147, 61, 39, 46,146,154,176, 74, 94, 58,115, 70,238,237,110,102,210,194,237, 49, 74, -101,167,176,152,106,242, 71,253,233, 17,120, 7,226,111,137,188, 85,195,180,126, 29,112,252,188, 55,150, 71, 72,245, 89,147,103, -144, 54, 91, 11,230, 13, 18, 65,236,212,236,144, 84, 78,202,220,184,170, 37,144,199, 57,137, 21,156, 76,199,149, 3,245, 94,101, -153, 14, 91, 11,118,106, 60, 38, 42, 50, 98,248, 52,232,255, 0,224, 76,210,169,176,210, 23, 58, 67, 75, 75,170,196,215, 65, 90, - 66,200, 82,134, 70, 57,121,122,190,116, 74, 93, 58,224,113, 52,104,137,117, 22,180, 38, 41,236, 84,166,201,117,250,127,189,196, -138,202,165, 63, 77,135, 61,213, 5, 70,128,166,194, 12,199, 18,144,165,140,160, 16,130,179,166,155,101, 55,170,133,187,214,166, -214,220, 55, 67, 20, 74, 22,231,223,150, 76, 91,182, 85,181, 1,133, 66,160,215,231,197,159, 82,164,204,170, 90, 80,221, 39,244, - 42,118,154,185, 47,211,155, 89,114, 42,164,175,221,144,228, 84, 39,195,216, 74,124, 72,107, 67,204, 60,133,205, 66,221, 76,153, -140,248,200,105, 21,106,162,212,144,195,107,125, 39,244,116,228, 20,254,149, 32,124, 73, 74, 16, 82,160,149, 5, 73,200, 40,225, - 8, 33,133,138,157,182, 82, 3, 95, 73,181,137,216,116,212, 13,238,110, 49, 90,230,167, 55,225,188,207, 50,225,188,237,100,164, -205,114, 10,186,138,102, 10, 67, 66,181, 20,181, 15, 75, 52,145, 56, 33,102, 11, 36, 14,177,206, 9, 14, 84, 59, 29,188,174, 84, - 59,173,112, 93,143, 85,131, 21,160,229,114, 44, 58, 45,153, 66, 12, 7, 27,139, 74, 91,136,101,170,139,205, 35,148, 83,216, 89, -109, 47,175,160, 45,198, 97,150, 17,149, 40,129,153,191, 33,138, 45, 46, 76, 10,157, 73, 53,234,220,249, 45, 83,233,211, 28,109, - 44, 82,226, 34,114,131, 18, 43, 40,129, 31,153, 48, 97, 70, 47, 36,186,181,120,174, 58,242, 82,209, 95, 50,212, 18,208, 73, 83, - 80, 80,204,199,127,194, 85, 21,242, 79,187, 56,168,170,169,212,221,108, 50, 91,138,234,193,240,227,178,130, 24,101, 57,229,108, - 41, 75, 86, 74, 20, 9,139,172, 74,165, 58,245,126,172,220, 89,142, 26,131,177,226,196,130, 86,202, 30,125,154,122,189,198,155, - 17,167, 0, 8,166,198,149,239, 78, 60,238, 79,139,135, 31, 80, 75,139, 70,183,210, 72,208, 37,152, 14,131,107,157,246,216,129, -183, 77,134,221,141,183, 54,195, 12,185,100, 85,145,194,212,139,125, 68,121, 69,150, 73, 36, 70, 28,168,213,141,221, 80, 38,242, -239,121, 25,155,153,118, 55,137,194,174, 84, 41,148, 85,183, 64,162,120, 21, 9, 84,184, 49,145, 29, 46, 45, 79, 64,165, 64,110, - 50,132,154,165, 69,214,148, 82,194,220, 74,138,147, 28,101,231,150,232,192, 66, 9, 86,185, 17,237, 36,216, 24,156, 79,108, 45, - 91,106,157,145, 17,119,146,170, 52,251,163,110,235,115,214,150, 35,192,191,179, 38, 60, 55, 42, 47,160, 19, 2,219,168,211, 29, -118,157, 56,164, 20, 50,202,227,203, 3,158, 10, 73,232,220,233,143,193,167,180,203, 82, 67,210, 37,192,145, 88,170, 20, 52,150, -230, 54,253, 90,120,113, 41,119,149, 69, 38,115,235, 1, 12,182, 7,193, 25, 9, 82,185,130, 82,117,175,119,139, 85,218,217,157, -245,121, 66, 42,143,213, 32,176,154,170,185, 28,143, 69, 75, 2,115,178,106, 74,141,250,175, 22, 25,108,248, 12, 35, 8, 91,142, - 54,181,252, 5,122, 88,213,203, 28,145, 75, 78,229, 37,167, 97, 34,183,236,148, 33,148,223, 96, 69,197,183,176, 63,102,214,216, - 58,240,190, 68,114,250,243,152, 23, 19,199, 8,114,242, 72, 72,231, 22,188,108,205,176,101,137,213,157,138,160, 37,149,131,121, -245, 2, 96,171,183, 20,137,123, 31,191,149, 91, 47,123,232, 85, 27, 62, 93, 6,181, 34,220,190,237,155,214,132,186,220, 88,179, -217,150,220, 71,128,149, 75,125,138,149,169, 90, 75,203, 96,211,110, 42, 91,143,176,165,184,194,229,195,126, 59,201,121, 83,127, -216,175,102,198,192,241,189,192, 78,211, 93,151,173, 66,131, 11,121,110, 27,122,109, 78,202,226,103,134,152,244,170, 29,255, 0, -106, 75, 77, 80,127, 7,147,118,200,183,170, 81,169, 27,137,124, 65,102, 20, 38,171, 53, 4, 24,110,205,241, 18,226,164,123,227, - 13,202,211, 37,186,124, 33,108, 79, 16, 66,211,103,113,182,182,139,118, 84,173, 7,156,166,216,183, 99,192, 67,187, 32,202, 95, - 52,202,236,231,238, 88,201, 46,213,173,214,193, 83,203,133, 49, 50, 99,173,245,243, 52,203, 11,115,159, 93, 2,225, 42,126,233, -240,185,105, 84,108, 74, 45, 95,108, 43, 59, 35, 69, 97,250,141, 10,138,230,217, 90,251, 48,139, 9,233, 47,173, 83,167, 92, 23, -133,177, 85, 69, 46,182,212,244, 48,183, 86,228,216,112,223, 43,138, 95,241, 29,230,228, 19,170, 78, 41,201,115, 12,218,154,183, - 54,203,228, 66,244,207, 79, 57, 83,174, 48,118,211, 36,113,139, 51,236,182,144,200,197,209, 89, 4, 74, 66, 18,100,220, 71,196, - 25,253, 47,135,176,101, 60, 41,197, 99, 32,207,114, 92,228,102, 52,138,194,116,168,154, 25, 34,146, 41,169,214,165, 68,180,176, -199, 36,210, 6,122, 3, 28, 20,213, 45, 28,143, 83, 37, 84,238, 34,143, 74,120, 89,225,111,121,247,111,121,238, 89,155,225,184, -220, 82,237,142,251,112,146,253, 17,207,229,239, 14,200,188, 40,150,199, 16, 91, 53,100,203,106,223,161,219, 59,177,105,238, 28, - 8,141,191,184, 84,122,123,188,237, 86, 66, 93,102,187, 65,135, 61,155,146,157, 54, 68,117, 85,170, 29, 5,246,132,237, 76,171, - 94,215,181, 54,235,103,182,227, 99,237,219, 50,147,100,221,151,117,186,253, 38,155, 38,143,114, 90, 87, 4,106,212, 53,220,242, -118,242,194,180,160,179, 75,166, 81, 39, 84,235,112, 68,217,140, 61,226, 50,212,247, 22, 89,118, 35, 77,235, 83,184,202,246,199, -112,111, 70,219,122,181, 6,171,108, 65,226,231,125,105,213,122,204, 75, 11,108,236, 27,130,252,141,176,118,155, 98, 2, 33,193, -175,238,213,251, 13, 81, 98,223, 52,197,206, 75,206,187, 71,165, 38,170,196,168,241,155,138, 85, 9,111, 46, 98, 52, 47,111,189, -188,183, 37,209,109, 10,103, 17, 22, 2,110,109,194,146,227,138,131,118,219,246,163,116, 11, 98,132,235,103, 52,122, 75,118,253, -157, 38, 77, 80, 90, 17,210,101,178,248,116,206,118, 75, 83,212, 28,101,175, 1,149,162, 45,226,190, 70,185,231, 0,203,149,228, -121,123,231,153,198,105, 91, 28,230, 88, 16, 36,112,211, 70,154,212, 24, 39,149,165, 18, 74,198, 72, 89, 35,105,100, 12, 41,231, -158,112, 57,145,137,231, 10,100, 94, 51,241, 87, 23,112,111, 30,211,112, 52,153, 38, 73,225,242, 10, 90,124,155, 50,146, 42,116, - 99, 45, 52,112,243,178,218,153, 12, 21, 85, 52,171, 42,205, 88,212,181,201, 75,149,209, 37, 91, 81,100,148, 51, 81, 75, 49, 50, - 6,217,173,183,155,188, 84,118,173,158, 32,172,235, 87,118, 54,166,179,183,149,203,134,222,225,242, 30,215, 80,233, 54,151,241, -165,100,213,106,245,122,156,138,221,227, 2,160,150, 46, 42,164,235,130,161, 57, 86,251,132, 51, 77,169, 64,173,174,167, 38, 59, - 85, 4, 56, 26, 3,109,118,123,135, 41,252, 96,110,135, 23,245,109,254,221,189,165,168,219,173, 91,123, 97, 87,216,251,190,175, -183,219, 85, 99,219,212,155,126,209,183,217,137,183, 10,131, 66,169, 76,169,205,176,225, 70,165,194, 83,180,116,125, 88,219,175, -148,178,243,175,199, 75,173, 59, 29, 61,249,246,206,238, 94,228,237, 61,211,181,155,117, 97, 50,205, 62,247,110,151, 14,183,114, - 57, 71,149,102, 55,111,211, 40,145,161,125, 74,213, 25, 54,141,222,227,180,202,188,130,169, 82, 23, 30,151, 57,136, 16,218, 83, -108, 72, 50, 38, 25, 64,114, 67,110, 47,253,229,176,174, 10,205,199,103,238,253,237, 99, 85,238,119,154,122,231,157, 75,174,215, - 74,238, 7, 25, 46,152,207,214,220,157, 58, 73,170, 74,109, 18, 30, 75,110,190, 29,121,180, 44,165, 42, 9,232, 21,240,162,151, - 56,225, 46, 16,143, 36,205,178, 88,214,186,130,176,206,181, 50,212,206, 37,168,141, 97,228, 37, 63, 46, 9,201, 90, 37, 96,103, -142, 25,155, 74,243, 26,157, 97,150, 33,237, 83,203,114,127,162,199,141,220, 86,188, 75, 85,151,241,125, 31, 2,167, 23,193, 83, -150, 54, 91, 79, 78,166,152,101, 85,109, 75, 81, 85, 61, 59, 60, 98,150,158,166,174,122, 58, 72, 42,106,150,136,102, 51,123, 10, - 85,205,152, 73, 43, 44, 16,206,123,218, 61,196,127, 12, 59,235,177, 53, 46, 29,169, 86,189, 55,136,234,109,215, 88,166, 26,197, - 38, 53,233,116,109,198,223, 91,198,222, 80,171,209,234,119, 5,221, 67,164, 25,151, 10, 5, 85,136, 33,154, 93, 49, 37, 18, 15, -233,100,202, 97,150,139,131,132,251, 87,179,251, 79,179,194,224,147,101,216,244,202, 5, 90,229,159, 17,119,149,211, 72,110, 69, - 46,248,110,163, 29,217, 43,129, 66,171, 79,122,116,167, 35, 90, 76, 72,147, 37,216,236, 37,215, 98,203,117,126,245, 45, 50,100, -114,186,222,133,219, 60, 77,113, 16,220,102, 29,123,136, 11,214,170, 86,194,217,230,148,229, 46, 98, 20,211,128,115, 50,125,254, -146,190,100,228,116,200, 4, 30,163, 7,187,151, 72,226,234,249,165, 72,105,119,173, 54,145,119,199, 91,105,138, 42,209,169,240, -173,203,214, 44,100,188,211,178, 16,205,110,152,208,135,112, 48,176,215,197, 10,171, 13,109,124, 69,109,200, 97, 95, 24,214,226, -126, 46,204,248,131, 53,169,253, 34,207, 26, 53,144, 71, 4, 79, 21, 56, 17,133, 22,229,150,231, 57, 26, 1, 47, 34,187, 2, 44, - 52,198,170,139, 50,202,126,130,126, 47,120,111,192,109,194,252, 57,154,229,220, 65,148, 9,205,116,180,137,154,214, 10,186,170, -162, 10,137,109, 91, 69, 71,150,198,235, 25, 10, 22, 25,169,163,100, 69,105,125,166,116, 70,126,237,240,173,188,242,233, 18,100, -237, 93,235, 42, 60,202,109,114, 92,138,190,220,221,209,196,104,148,181, 76, 74, 16,170,157,149, 92,105,110,132,210, 43,242, 74, - 19, 42,158,164,115,198,158,234, 36, 48,143, 6, 66,144,210,247,177, 85,202,124, 85, 41, 50, 23,238,234, 96,171,220, 84,131,201, - 81,167,186,242, 66,220,103,194,112,116,136,167, 49,204,218,135, 38,114,149, 36,142, 82,142, 24,109,205,249,100,111,109,188,154, -141,169, 87,121,132, 69,149, 25,154,133, 12, 70,102, 35,244,170,162,202,228,211,227,215,160,171,156, 70, 90,220,109,197,198,112, - 60, 25,150,134, 86, 98, 60,242,193, 74, 54, 70, 21,203,185,137, 49, 41,209, 55, 38,242,181,228,211, 26, 17,157,129, 46,114, 42, -180,121, 76,135,128,240,207,214,112,156,148,134, 86, 18, 75, 79, 49, 33, 50,163,165,120,248,146, 57, 73,105,106,159,147, 26, 7, - 37, 20,121, 74,249,129, 29,199, 81,176, 38,192,147,176,176, 11,229, 39, 28,113,196, 92, 57, 81,148,103, 21,249,110,121, 69, 46, - 69,155, 81,200,201, 87, 73, 60,114, 67, 44, 19, 46,155,235,139, 65,117, 46,165, 73, 11, 30,131,175, 80,250,185, 64,199, 74,170, -247,117,187,111, 83,215, 94,171,203,137, 65,135, 79, 67,143,174,161,207, 41, 13, 62,140, 15, 16, 83, 24,105,167, 37, 84, 28, 81, - 82,130,227, 69,105,245, 45, 71, 41, 66,191, 91, 76,133, 87,124,171,187,130, 29,167,217, 76,213,237,251,106, 66,189,205,119,162, - 28, 98, 37,199, 86,142, 16,162,185, 54,235, 12, 41,106,181,161,242, 45, 99,199,119,154,162, 48, 80, 81, 16,158,154,182,205, 62, -117, 86,178,221, 66,238,151, 81,166,214,156, 82,227, 66,168, 73,171, 77,171,198,152, 82,188,180,236, 27,145,222, 95,115, 36,148, -242, 70, 81,136,160, 29, 56, 67,138, 29, 54, 42,202,179,153,139, 37,154,143, 44,138, 93, 90,115, 13,179, 42, 84, 55, 84,228, 58, -130,154, 32,177, 34,167, 76,116,248, 83,164,158, 85, 21, 58, 66, 29,194,202, 84,242,134, 53,191, 74, 37,168,148, 34, 92,139,239, -126,187,219,125,133,150,228,146, 47, 98, 55,179, 1,136, 86,103, 62, 91, 69, 8, 36,153,106, 8, 60,182,111, 58, 40,216,157, 54, - 98, 36, 0,234,243,171, 58, 3,101,229,106,179, 43,139,104, 91, 70, 44,120,176,217, 45, 59, 21,146,164, 50,232, 71, 43,133,111, -117, 90,230,100,144,252,149, 40,149, 41,210, 74,150,181, 21, 44,149,171, 39, 97,160,209,196, 74, 98,138,211,204, 1,101, 39, 41, -232,160, 84, 80, 91, 86,122, 5,117,207,217,171, 93,167, 74,230,109,190,118,227,151, 50, 18, 67, 73, 80,101,207,212, 10, 45,182, -190,169, 65, 32, 16, 14, 72, 61, 50,113,157, 59,206,211,128,167,184,215,134, 84,218,139, 67, 9,202,136, 9, 81,207,134, 79,235, - 28, 17,243,252,113,169,165, 53, 56,166, 68,176, 35, 72, 23,245, 29, 5,183,191, 78,155,254, 24,174,234,171, 13, 76,138,146,157, -228,111, 49,216, 94,228,111,219,173,201, 22,181,250,250,130,207, 61, 76, 83, 78,129,201,136,206, 30,102,214, 63,241, 74, 61,219, - 81,242, 79, 81,141, 92, 33, 83, 11, 11, 43, 74, 70, 79,235,128, 48,146,159, 95,183, 89,187, 48, 16,248,113,190, 78,100,130, 82, -160,176, 65, 32, 28, 5, 99,215,168,252, 53, 65,216,162, 34,146,199,235, 39, 31, 2,200,193,233,215,144,231, 79, 81,206,164,117, -233,252,125,253,240,213, 89,206, 82,241,176,243, 14,190,132,117, 7,227,110,189,143, 94,183,197,134,155, 9, 14, 77, 73, 35,160, -115, 31,105,236,123,140,118,214,207,217,208, 91, 67, 45, 2, 19,212, 36, 12, 14,163,212,156,142,135,247,233,135,163, 69, 10,155, -158, 95,135,196,200, 0,103, 57,200,252,115,173,138,183, 84,150, 18,214, 79, 47, 42, 82, 64,200,200,192, 25, 63, 34, 51,173,102, -107,129,181,255, 0,158, 33, 53,234,201, 4,224,108,194,246,251,207,207,175,124, 57,232,109,180, 51,202, 72,248,130,113,142,248, - 78, 0, 31, 35,235,246,233,191,188, 42,206, 66,108,193,167,132,253,103, 41,181, 0, 71,255, 0, 2,140,174,134, 73, 35,245, 92, - 39, 33, 30,121,235,229,171,141, 90,228,106, 11, 32, 52, 80,236,183, 73, 12, 70, 4,229, 74, 7, 30, 43,152, 63, 3, 41, 29, 84, -123, 28,224,100,235, 5, 13,173,197, 57, 46, 67,138,125,249, 46,120,146, 95, 88,253,117,156, 97, 40, 39,245, 91, 0,225, 35,176, - 29,180,142,179, 80,220,168,205,149,126,211, 15,223,164, 16,122,250,158,195,208,145,134,108,155, 45,116,149,107,106,210,241, 41, -186,161,255, 0,120,194,221, 71,236, 47,127,218, 35, 79, 77, 86,176, 66,163, 8,205,225,197, 43, 56, 37,105, 65, 56, 36,252, 75, - 82,212,174,171,112,149, 28,156,245,207, 93, 15, 45,216,241, 57,146, 57, 27, 56,200, 72,192, 89, 78, 15, 85,168,159,128, 99, 39, -226, 63, 33,223, 89, 20,167,114,130, 10,130, 80, 72,248, 26, 31, 30, 65, 0, 16,165, 3,208,231,174, 61, 61, 53,129,212,188, 52, - 7, 20, 82,214, 78, 74,148,226,186,164,228, 18, 84,181,103, 36,244,238,122, 30,157, 53,185, 26, 44,106,170,160, 1,238,236, 54, -253,214,249,247,206,169,100,122,153, 25,234, 36,251, 71,160,233,212,122,216,124,236,119,197,146,116,196, 43,156, 23, 20,234,176, - 66, 83, 24, 44, 50, 18, 79, 66,235,132,167,159, 61, 50, 50, 18, 9,206, 15, 83,172, 58,116,165, 37, 64, 4,182,218, 73,199, 59, -139, 10, 82, 73, 66,186, 33, 13, 30, 94, 96,174,108,228,231,168,198,123,139,140,202,131, 79, 30, 70,148,227,238, 33, 74, 65,102, - 43, 97,196, 54,147,211,226, 81, 41, 74,129, 0,103,226, 56,236, 70, 51,172, 78,114,228,243, 5, 43,193,100,115,243, 36,120,134, - 75,201,194,128, 42, 71, 54, 17,204, 60,206, 74,114,122, 18,116,112,214,210, 59,223,241,219,240,190,226,251,116,251,158,201,176, - 10, 23, 73, 61,143, 95,141,182, 61, 58, 16,167,226,118,197, 23,220, 24, 42, 82,202,147,250, 50,234,130,146,217, 45, 36,168,133, - 45, 94, 71,175,197,215,174, 49,223,174,177,233, 50,208, 66,131,105, 61,214, 66, 64, 78,114, 64, 32,244, 61, 27, 42, 36,100, 30, - 80, 0, 29,250,232,185,104, 66, 49, 33,199, 21,150,220, 43, 66,158, 90,158, 9, 94, 72,229, 74, 84,180,165, 36,173, 63,234,146, -156,146, 6,173,114, 20, 80,180,165, 72, 80,112, 20,145,206,164, 41, 92,139, 1, 96,182,144,172, 56,130, 20, 14, 50, 0, 39, 56, -233,141, 46,141, 98, 54,244,254, 95, 29,247,198,133, 76, 90,206,166, 58,175,233,178,237, 97,238,254, 93,189,215,178,204, 42, 33, - 93, 64, 42,248,136, 81, 57,235,147,209, 95,205, 61, 51,156,117,229,239,140,107, 16,158, 7, 42,147,206, 74,138, 85,241,171,148, - 17,140, 96,145,216, 96, 12,125,253, 6,178,233, 89, 1, 42, 89, 0,224,140, 40, 16,146,179,204,164, 55,201,216, 60,158,153, 29, -114, 59,100,118,197,106, 10,207, 40, 35,170, 73,230, 36,114,149,103,155,161, 9, 87, 86,241,147,231,213, 88,193, 58, 92, 49,218, -223,135,110,159,187,221,238,253,216,103,145, 0, 34,219,123,186,124,143,147,136, 13,251,114,237,134,237,143,105, 46,242, 73, 13, - 22,133,233,109,109,125,248,227,197, 1, 40,126, 69,118,199,166,197,148,182,249, 0,241, 0,122,146,174,101, 31,136,168,158, 98, - 78,117,200,194,180,168,126,137,101, 88,239,233,246,107,183,127, 72, 24,180,175,104, 99,158, 27,161,215, 19,195,254,205, 37,246, -129,255, 0, 34,180,195,184,124, 52,148, 17,150,202,152, 45,175,169,201, 11, 7, 0, 99, 92, 70, 83,105,199, 81,140,246,229,242, -249, 29, 75,178,155,181, 13, 41, 59,217,109,211,176, 36,116,235,219,242,199, 51,241, 50, 44,124, 69,158, 34,159, 47,181,212, 31, -255, 0,116,172,199,247, 18,113, 76,168, 40,116, 72, 29, 62, 47, 63,188,117,208,235, 35, 24,207, 92,244,254,221, 86, 40, 35, 62, -152,207, 95,232,251,116, 51,133, 67,168, 78, 71, 81,243,251,244,236, 6,194,221, 48,206,160, 29,173,211,161,253,216,162,179,229, -143,191,211,175,217,170, 11, 0,227,176,245,245,199,175,207,160, 58,244,188,254,177,201, 82,124,188,177,231,246, 29, 81, 39, 39, - 58, 93, 70,194,221, 63,158, 20, 24,164,230, 60,136,232, 72,244, 39,183,109, 12,178, 9, 61,242, 59,122, 30,223,214,116, 74,241, -130, 73, 3, 7,167,246,245,213,189,240,234,136,240,212,148, 97, 95, 22, 70, 74,128,236, 58,249,233, 68,235,140, 3,126,155,227, -193, 36,156,254,113,165,175, 10, 63,237, 99,238,206,116,180,125, 62,182,191,207,191, 25,199,180,146, 15, 65,159,151,174,171,165, - 93,142, 58,142,227, 61, 70,135, 31,120,254,145,251,117, 92, 96,245, 30,127, 46,250, 37,188,191, 15,195,231,231,124, 12, 86,241, - 19,156,117,235,231,142,159,126,136,111, 10,193, 74,187, 28, 99, 24,201, 62,191,136,252, 53, 65, 9, 0,131,220,244,251, 58,232, -164,225, 61,178, 7, 94,221,254,236,246,210, 76, 24,139,124,252,223, 25,219,239,197, 69,160,168,119,233,221, 93, 78, 6, 49,216, -125,186, 33,164,115, 36, 40,247, 29, 66, 71,160,233,235,170, 64,133, 15,207,113,215, 69, 36,242,224,244,244, 35,208,105, 34, 0, - 39,190, 49,143,104,101, 42,238, 57, 85,215,168,198, 72,251,188,244,123,104, 72, 72, 24,201, 79, 78,191,187,166,132, 65, 39,226, - 72, 25,244, 39,167,152,251,180, 90, 22,144, 1, 87,195,147,231,252,236,250,124,244,153, 23,216,158,159,233,140, 17,124, 28,214, - 58,114,244, 24, 61, 62, 93,191,167, 70, 32, 12,103, 39,230, 60,137,199, 94,154, 13,178, 23,215,168, 29,253, 59, 99,250,245, 93, - 11, 73, 95, 47,114, 62,127,102,127,103,150,147,194, 39,221,190, 13,108,129,145,140,228, 16,160, 70, 82,164,158,133, 36,121,130, - 9,200,212,133,253,149, 30,214, 40,187, 66,197,191,195, 39, 20,245,169, 15,236,235,143,162, 14,220,110,140,213,189, 54,163,181, -211,100,184, 17, 30,135,114, 58,162,165,203,177,148,226,240,211,164,149, 65,206, 21,150, 70, 83, 30,118,242, 14,122,121,126,206, -218, 33, 39, 37, 68,227,168,229, 32,128, 82, 65,232, 65, 7,184, 56,237,231,157, 55,102, 89,109, 54,103, 78,208, 84, 37,251,171, - 11,106, 86,236, 71,240, 32,236, 71, 81,211, 14,249, 22,123,153,112,230, 99, 22,103,149,205,202,158, 63, 43, 43, 92,199, 44,100, -130,209, 74,160,141, 72,214, 29,195, 41, 1,144,171, 0, 71,233,189, 78,163,199,149, 6, 5,118,137, 50,159, 88,161, 86, 97,179, - 50,145,112,209,228,179, 81,164,214, 32,202, 66, 93,106,101, 62,161, 25, 74,109,214,150,210,146, 82, 66,186,115,105,198,165,210, -220, 45, 54,156, 0,210, 18,130, 16,156,144,132,160,130,113,234,163,215, 63,102,191, 63,142, 13, 61,168,188, 90,112, 88, 35, 91, -187,121,119,179,119,109,106,165, 54,185,123, 83,184, 1,218,213,172,195, 74,112, 25, 31,193,231,222,112,191,110, 58,164, 21,224, - 48,176,215, 49, 7,195,198,117, 59, 45,161,226,130,149,124,109,157,131,126, 59,105, 34, 25,190,109, 42, 53,196,184,241, 30, 15, -198,138,237, 78, 35, 82, 31,140,211,167,245,219, 66,220, 41, 7,190, 19,170,167, 56,203,165,200,101,140, 85,149,104,230,213,203, -101,189,155, 78,155,220,117, 82, 3, 46,198,227,123, 43,181,137,199, 98,248,121,226, 4, 60,107, 28,144, 81,211, 52, 25,134, 94, -168,243,195, 33, 13,165, 88,233, 15, 20,151, 2, 68,212, 8, 23, 84,117,184,212,128, 27,157,174,166,211,138,218,110, 68,166,202, - 12,226,136,177,129,232,166,216, 72,248,148, 83,159,213, 41, 3, 58,199,247,101,136,115, 44,202,189,191, 58, 53, 62,165, 75,147, - 13,232,255, 0, 85, 84,225, 70,168,193,124, 22,212, 1, 92, 57,109,173, 42, 25,207, 92,107, 7, 94,247, 82,222, 44,120, 49, 37, - 54,166,153, 62, 27, 97,162,180,183,147,212, 19,228,122,244,251, 53,166, 60, 82,241,139, 69,219,203, 98, 69, 54,140,180, 86,247, - 30,234,150,139, 66,201,183, 25,149, 29,233,234,185, 42,196, 70,134,169,113,219, 89,247, 70,154, 91,161,107, 46,114,242,132,100, -244,206,153,205, 97,168, 2,158, 4, 44,100,219,125,135, 64, 78,228,219,222, 73,244,222,221,174, 76,131, 35,204,179,124,218,130, -135, 45,164, 51, 85,202,227, 76,106, 62,206,255, 0,109,219,126, 90, 70,190,103,145,136, 84, 93, 78, 72, 23,191, 48,247,123,113, - 54,107, 98,106,146,105, 9,180, 41, 21,123,162,141, 80,151, 62,153,110, 91,228, 81,105,212,218,178,156,241, 34, 77,169, 72,130, -226, 75, 2, 57,229, 90, 91, 71, 95, 19, 25, 61, 49,174,102,239,183, 16, 27,245,196,245, 64, 82,110,171,182,181, 46,217, 96, 6, - 35,218,212,137, 51, 32,219,108,198,105, 92,201, 85, 69,199, 30, 6,166,164,128, 10,220,112,144, 72,251, 53,214,202, 31,178,178, -163,118, 58,154,214,227,110,196,250,141,229, 94, 90,234,215, 82,232,240, 89,168, 70,166, 84,170, 4,190,168, 41,121,249, 0, 76, - 90, 29,119,151, 56, 9,248, 73, 25,214,146,202,219, 91, 51,104,184,161,111,104, 55, 2,101, 83,114, 54,198,194,191,169, 77,110, - 68,221,177,164, 63, 85,175,214,237, 88,241,211, 82,147, 76,141, 78,128, 22, 91, 87,142,150, 98,205, 74, 85,132,248,171,248,142, - 53,173,150, 83, 84, 83,203, 81, 44,142,139,160, 27, 2,160,233, 3,114,117, 16, 12,141,127, 70, 80, 9, 35,125,241,233,239,130, - 41,224, 38,103, 13,117, 54, 67,153,205,226, 87, 28,112,190, 95, 45,125, 92,210, 83, 86,187,242,226, 42,178,174, 80,149,113,165, - 44, 65,229,100,134, 4,141,150,122,141, 81, 51, 73,162,237, 30,168,196,225,210,109,131,180,183,158,251, 93,182,173, 90, 77,131, - 96, 89,181, 75,242,173, 86, 98, 49,102, 9,183, 41, 18, 99, 82,213, 61,169,147, 28,108, 26,115,213,233,208, 41,241,139, 73, 89, -155, 50, 88, 98, 57, 82,144,225, 71, 44,173,110, 47,174,107,174,254, 98, 13, 58,249, 85, 6,131, 87,171, 39,220, 44,241,181,244, -153,180,166, 32, 5,149,154,122, 42,162,227, 19, 75,165,128, 71,188, 56,178,174,115,204, 82,145,128, 36, 3,237,235,223,234,222, -215,112, 55,182,219, 31, 86, 98, 61,181,187,220,112, 95,208,183,126,253,180, 97, 54,220, 21,109,191, 13,155, 89, 33,113, 54, 95, -106,218,165, 50, 18, 40,148,150,231,154,107,198, 55, 42, 67,242, 41,179, 93,113, 42,113, 74, 86,162, 97,177, 48,209, 39,113,161, - 58, 64, 13,211,225, 75,148, 51,140, 36,165,190, 84,143,159, 65,171, 75,135,178,168,107,242, 90,172,214,180, 51, 59,234, 16,134, - 17,190,133, 64, 20, 55,158, 54, 2, 70,146,225,136, 0,174,157, 43, 97,185,243, 63,233, 63,244,231,241, 66,159,196,102,225, 15, - 14, 51, 37,224,188,143,132, 9,142,161,114,156,207, 55,165,122,154,211,180,201, 83, 95,148,230, 89,116,181,212,212,192, 8,224, - 5,150, 25,142,186,190, 84,124,245,138, 25,117,109,141,230,157,201,225, 47, 99,174,184,147, 81, 37,251, 42,185,185, 27,109,239, -116,234,109, 66,219,122, 4,155, 82,247,170, 85, 97,120, 77, 63, 82,121,198, 42, 45, 83,110,106, 65,247,182, 36,165, 14,184,226, -150,194, 25, 9,113, 3,110,182,151,139,125,212,183,132,104, 23,139,113, 55, 18,137, 24, 33, 42,171,202,150,138, 77,231, 10, 58, - 80,148, 41,215,106,105,101,113,238, 23, 2, 0,109, 6, 99, 41,127,224, 0,190, 84,115,174, 89,251, 50,110,182,111,109,161,226, - 3,101, 36, 58,211,149,138, 21, 94,218,222,203, 78, 35,202, 81, 46, 82,231,199, 69,129,126,193,167,180, 63, 93,214,103,194,179, -170, 50, 48, 15, 42,103, 21,168, 17,147,174,130,217,182, 49, 51,154, 91,177,188,102,144,164, 58, 35,144,191,242,169, 25, 99,159, -148,124, 72, 7,226,207, 80, 49,207,131,216, 83, 92, 69, 69, 29, 6, 99, 95, 73, 34,235, 8,250,148,236, 9, 14, 17,197,138,133, - 2,215,210,116,217,110,164, 91, 97,105,119,134, 62, 33,208,248,151,225,118, 89,196, 28, 81, 28, 85,249,213, 91,213,189, 89, 99, - 36,143,237,143, 83, 41,169,117,146, 89,165,169, 6,105,139, 75,170, 73,228,145,245,134,150, 73, 9, 44,122, 97,110,111,221,149, -120, 67,165,189, 58,161, 34,214,201,105,134,233, 55,148, 69, 83, 11, 50,221, 90, 92, 68, 40,213, 72,110,200,135, 46, 73, 41,108, -171, 14,167,245, 84,130, 65,200,211,166, 94,171, 84,102, 51, 47,194,143, 89,131, 9, 5,184,240,105, 85, 40,147,218, 74,222, 40, - 89, 97,227, 2, 67,137, 97, 78,252, 5,254,110, 85,114,132, 39, 9, 72, 32,233, 93, 14,201,122, 65,143, 22,156,212, 69, 86,100, - 46, 44,135, 38, 57,135, 33,219,180,231, 22,234, 83, 60,161,192, 10,170,170, 8,144, 33,178, 71,233, 29, 30,242,191,208,181,133, -191,182,125,129, 22,137, 24,184,219, 16,105,244,122,116,229, 24,172,196,140,227, 51,106, 82, 37,172, 0, 92,153,226, 37,249,213, - 57, 83, 22,165, 18,225, 82,222,113, 69, 74, 9, 71,234, 68, 9,208,198,209, 94,219,218,228, 15, 83,112, 65,184, 62,227,110,189, -109,178,169, 62, 83, 5,218,149,249, 37,181, 42,198, 87, 89, 80,199,253,217, 86, 70, 70, 98,204, 20,146, 89,197,201,101, 22,230, - 59,242, 41,215, 69, 77, 73,128,236, 67, 18, 58,167,154,138,231, 60, 4,102,158,150, 80, 82,130,218,157,115, 45,198,101,174, 84, -165, 1, 68,114, 52,130,156, 99, 89, 45, 34,212,134,228, 73, 16,146,227,205,181, 1,201, 78, 77,171, 38, 42,218,143,227,144, 4, -201, 12,201,115, 36, 71, 12, 32,165, 43, 3,226,248,212,144, 10,146, 53,126,180,172,233, 73,154,154,212,168,202, 93,197, 80, 97, -136,104,140,211,242,100,192,162,196,109,194,166, 41,208,221,148,163,201,135, 23,227, 62,232, 78, 95,127, 36, 0,218, 27, 1,238, -160, 90,138,170,136,112, 34,196,122,116, 24,179, 26, 97,224,201, 66,151, 91,158, 22,121, 26, 8,112, 2,184,136,155,133, 28, 30, - 89, 15, 32, 1,204,132,117,220,138, 25,100, 69,141, 33, 42, 95,185,185, 36,108, 64,216, 41, 3,125, 76,119, 96, 54,234,214, 58, - 53,249,220, 11, 78,232,142,144,194,128, 23,101, 1, 6,175,214, 62,103,112,219,249, 82,197, 84,238,108, 17,110, 52,139,118, 47, - 29,184,225,215,110, 42,187,173,184,204,207, 72, 80, 85,167,183,182, 36, 9,173, 70,184,111,106,192, 66,170,116,219,106,146,227, -200, 80,164, 50,235, 10, 77, 66,191, 84,117, 10,106,153, 79,228, 73,241, 36,174, 36,119,184, 21,190, 59,243,185,156, 69, 84,159, -170,238, 77,125,233,212, 64,224,114,153, 96, 80,157,149, 74,219, 91,113,168,200, 9,139, 79,161,218,173,191,225,204,247,118,130, - 18,103,207, 18,106, 18, 92, 10,125,231,194,214, 80,151,139,218, 61,196, 11, 91,199,196,197,237, 22,149, 81, 84,157,189,217,229, -191,180,182, 2, 88, 11, 17,100, 68,160,212, 84,221,239,112,178,210, 9,241,102,214,111,225, 52,151, 48, 84,168,148,168, 76,161, - 74,109,180,160,115,231,137,235,103,118, 56,127,147,104,217, 55,156,251,107,111,175,235,178,220,141,117, 86,109, 75,154,123,113, -238, 29,183,163, 87, 2, 87,106,211,239, 74, 50,150,145, 64,189,234,148,231, 29,158,154, 36,149,174,165, 75,167,166, 52,138,188, - 24,138,159, 21,133,236, 83,112,252,185,180,169, 8,169, 20,176,234, 0, 18, 88, 7,176, 39, 89,211,114,119, 4, 70,189, 44,161, -148, 22,190,159, 75,188, 43,225,207, 12,190,140,158, 22,229, 62, 49,120,177, 11,207,199,124, 79, 74, 43, 96,166,138,138, 92,199, - 54,166,167,120, 99,153, 50,252,166,134, 37,121,162,150, 40, 36,137,243,154,231,228, 65, 75, 44,172,185,141,117, 61, 12, 49,202, - 64,184,109,119,103,132,181, 74,129, 79,134,194,135, 43,190,237, 21,191, 29,100, 96, 37, 40,117, 73, 82, 99, 35, 32,124, 88, 42, - 63,170, 53,226,221,219, 54,154,144,210,159,144,184,110,188,191, 9,111, 50,130,176,158,110, 80, 84,251,171,202,128, 1, 93, 73, -229, 25, 56, 37, 0,140,233,155,215,238,236,178, 81,245, 6,230,196,184, 38, 72,117,114,146,204, 10,157, 18,124,222, 68, 55,238, -229, 13,192, 85, 62, 51,171,139,134,207, 35, 41,140,233,231,202,146,147,144,117, 96,166,239,230,251, 91, 78,170, 52,187,154,100, -238, 69,175,198,143, 95,161, 83,106, 18,154,101, 79,165,231,152,117,164, 67,133, 45,134,212, 82, 91,194,156, 5, 45, 44,164, 2, - 66, 84,155, 34,147,133,243, 36,165, 20,116,217,188, 35,151,238,126, 97, 4,254,177,125, 68,239,211, 82,223,173,172, 0, 24,167, -179, 47,246,170,125, 30,232,243,104, 31,139,124, 24,227,142, 30,161,169,102,142,147, 50,172,203, 50,121, 41,229, 42, 69,218, 3, - 30,118,241,202, 0,243,200, 41, 94,165,129, 22, 42, 88,227,163,116,203, 17, 8,185, 93,183,106,208,252, 38,221, 75,239, 69, 82, -148,212, 98,226, 86,217,118, 44,165,167, 9, 65,101,223, 60,148,144,181, 96,168, 43, 0,252,174, 91,214,181,183, 10,117, 86,179, - 50,153, 73,166, 83,194,214,252,233, 83,209, 26, 43, 44,162, 64,140,219,206, 58,234,210,112,235,191, 11, 64,100, 44,244, 4,168, -145,172,123, 98,119,186,189,184,148,118,141, 70,148,197, 50,191,111,207, 66,201,167,161,249, 52,249,241, 42,212,229, 7,204, 15, -126, 66, 92,110, 3,140,161, 73,118, 19,202, 81, 97,108,148,161,199, 27, 91, 78,107, 86,119,238,216,221, 43,230,252,250,182, 13, - 58,183, 46,147, 70, 13, 38, 4, 56,116,185,179,162, 69, 46,180,223,141, 81,142,184,140, 41,147, 41,114, 84,242, 75,171, 82, 84, -194, 91, 72,230, 64, 90,214,181, 33,200,201,170, 43, 89, 94,208, 24,128, 15,166, 66, 20,216, 3,112,111, 96, 88,110, 78,159,118, -155,220, 99,160, 60, 98,250, 99,112,207,134,255, 0, 71, 46, 29,250, 64,120, 83,195, 50,248,169,148,241,245, 69, 30, 93,144,193, - 67, 79, 83, 28, 82,215, 85,189,122,153,115, 32,105,154,178,134, 26,105,168,101,163,146,156,211,189, 75,102,130, 44,173, 68,114, - 77,207, 71,110, 15, 18, 59, 61, 18,251,183, 45,234,180,107,233,187, 1,250,171, 17,238,235,214,213,164, 83,170,247, 53, 22,146, -247, 59,114, 43, 22,149,141, 85,159, 17,119,100,134, 63, 68,234,163,187, 34, 18,164, 53,206,152,138,117,244,161,183, 58,193, 87, -225, 15,135,235,154,206,165, 93,187, 71,198, 37,215,186, 16,174, 74, 84,106,197,183,252, 7,217, 27,135,115, 66,233,111,133,248, - 82,110, 88, 27,108,185, 18, 44, 98,226,138,217, 76, 74,176, 98,168,211,208, 31, 14, 67,113, 0, 40,199,138, 77, 58,219,219, 50, -244,105,201,133,114, 94, 12, 56,227, 82,225, 41,246,106, 20,107,126, 74, 1, 10, 21,105,145, 29, 83, 87, 29,105,183,135, 90, 99, - 14, 24,108,168,230,161, 33,210,145, 21,121,134,197,241,157,196,167, 13,119,204,187,239,101,247, 94,228,180,103, 85, 93, 74,238, -122, 27,239, 11,130,196,190, 89, 74, 3, 65,139,247,111,234,106, 52,187,152, 37,129,200,203,193,152,211, 98, 54, 3,112,101,197, -108, 4,133,235, 56, 58, 10,228, 87,202, 71,178,152,134,242, 75,119, 19, 27,222,225, 88,150, 31,254, 96, 54, 34,214,141,213,129, - 30, 77, 63,251, 74,190,146, 28, 63,196,245, 21, 94, 41,241, 81, 90,138,137,238,120,103,135,232,114, 90, 51,145,166,250,161,204, - 42,243, 28,191, 56,115, 80,172, 17, 36,201,106, 30,171, 49,165, 99, 58,215,215,101, 85,180,199, 46,155,165, 84,250,206,231,112, -167,186, 84,202,229, 58, 84, 41,147,169,133,248,238,197,175, 91,119, 93, 18,221,187,232,146, 84,224,168,218,183,125,171,122, 80, -169,146, 69, 62, 91, 77,165,197, 50,182,199,186,202, 90, 37,197,125,153, 76,161,221, 73, 67,102,161,181,186, 27, 75, 97,238,133, -149, 75,174, 53,111,223, 86,211, 87,109, 54,213,185, 35, 77,146,237, 17,137, 14,200,167, 84,169, 77, 86, 23, 24,190,212,104, 85, - 56,114,217, 98, 72, 75,241,159,101,166,228, 0, 16,240, 9,226,206,213,123,125,246,154,253,183, 26,179,248,203,225,125,202,139, - 46,178,168,179,235,251,104,229, 22,255, 0,179,166, 52, 82,164, 41,247,246,211,115,158,110,161, 69,150,180,149,143, 14,155, 84, -150,134,210,172, 54,180,249,236,206,213,123, 69, 61,143,214,236,216, 85,123,123,115, 55,238,195,166,195,122, 53,197, 19,108, 46, - 26, 79, 16, 44,236,253, 26,226,128,250,223,131, 85,141,183, 84,234,188,232,106,173,199, 90,212, 89,142,137, 15, 83, 81,144,125, -209,101, 40,228,141, 47, 10,102,180,149, 86,154,156, 24, 92, 29,108,129,135,154,226,204, 2, 44,137,115,111, 54,226,254, 93,182, - 24,147,120,185,244,188,240,119,233, 7,195,249, 54,103, 93, 17,224,159, 17,114, 33,203,106,209, 45, 37, 92,121,173, 8, 71, 34, -150,170, 58,150,200,101,166,150, 41,220, 61, 44,139, 5, 76,112,171,213, 71, 20,136, 39, 4,118, 6, 29,186,134,194, 27,148,195, -193, 62, 44, 68,187, 21,106,102, 84, 30, 70, 85,205,142, 80,158, 87,201, 81, 7,153,192, 0,192, 80, 64,211,149, 66,165,180,203, -136, 67,104,240, 27, 90,130,130, 17,226, 37,166,148,162, 1, 67, 73, 94, 66, 83,252,227,140, 39, 39,160,215, 35, 46,223,110, 95, -179,178,219,105,233,244,219,195,120, 47,233,139, 89,112, 67,182,118,102,191, 77,247,149, 21,115, 41,196,213,175, 41,244,200,241, - 80, 85,142,139,201,194,137, 9,207, 77,115,159,136,255, 0,164,222,229,137, 30,163, 15,134,190, 13,228, 85,153, 9, 87,213, 91, -165,191, 87,204,167, 45, 40,174, 45, 76,182,204,169, 86, 14,216,198,101,228,255, 0,133,202,109,178,212,219,137,132, 41,194,148, -158, 96,180,131, 37,202,248,118,182, 90,133,138, 42,118,185,221,117,133, 75,133, 32, 29,216,168,185,189,236, 14,163,109,129, 0, -219,143,243, 63, 16,184, 90,150, 55,105,115,232, 42,165, 31,169, 77, 42,212,177, 32, 14,130, 18,226,224, 0, 53, 57, 0,216,238, - 55,196,195, 45, 68, 22,211,205,146,176,133, 54,151, 20,132, 15,133,229,231,144, 40,224, 37, 5, 65, 39,151,155,148, 18,158,152, -235,167, 48, 77, 75,205,166, 35, 10,241, 36,158, 64,164, 52, 60, 79, 9, 9,207, 48, 83,160,114,149,103,148, 96,103,182, 73,215, -230, 7, 43,219,203,237, 79,157,190,246,230,253, 61,196,180,212, 75,181, 94,156,213, 51,101,233,182,221, 22,223,225,210, 69, 2, -168,227, 11,169,218,181,125,167,162,176,212,122,212, 25, 8,142,218,126,176,154,244,170,211, 68, 7, 88,168,182,234, 82,177,213, -203,167,233, 12,113,211,199,133,235,182,188, 54,240, 99,176,227,101,238,251,254, 37, 46,135, 81,183,246,214,113,190,247, 95,112, - 47, 39, 98, 37,203,129, 54,157,199, 86,136,195, 22, 53,140,193,106, 91,252,225,149,204, 98, 19, 75,118, 84,180,165, 7, 18,169, -178, 74,170, 69, 51, 56, 73,209, 23, 81,210,224, 42,219,115,204, 50, 5,109, 34,219,149, 87, 3,115,219, 16, 36,241, 71, 32,204, - 22, 85,167,138,163,219, 12,129, 32,128, 37,228,152,177, 1,116, 88,216, 92,246,107, 17,218,230,195, 19,125,171, 92,246,205, 30, - 90, 32, 84,171,244,168,149, 5, 16, 61,205, 83, 89,247,180,147,216, 56,218, 23,148,121,247,198,178,122,125, 22, 5,114, 40,154, -138,154, 22,210,134, 80, 99,180,183,112, 79,162,136, 1, 95,118,123,235,152,220, 17,123, 63,247, 3,103,237, 26, 77,219,197, 85, -255, 0, 51,114,119,174,160,202, 42, 21, 90, 12, 74,180,170,149,181,104,202,120, 37,197,211,222,171, 73, 81,114,229,171,182,181, - 40, 63, 37, 88,100,184,149,120, 41,228,194,143, 75,153,101, 48,185, 91,107,153,134,155, 1, 8,109,165, 41, 41, 74, 64, 1, 32, - 4,224, 99, 3, 80,103, 78, 51,204,101,157,185,180, 57, 21, 10,146, 34, 81, 20,149, 19,184,236,206, 95,148,177,131,216,104, 15, -110,168,167,108, 60,209,182,123, 57,246,138,169,146,133, 91,117,142, 38,105,152,127,215, 43, 89, 24,145,251, 10, 7,241,197, 84, -154,117, 14, 91, 72, 18,147, 35, 46,114, 97,104, 83,107, 42, 39, 25, 0,249,254,115,167, 66, 11,229, 77,120,141, 0,191,209, 21, - 33, 25,229,241, 84, 82, 74, 83,146, 59,103, 90,221, 94, 77, 82,101,118,154,148,130,244, 86,221,202,228,255, 0, 60, 39,160,229, - 89,254,119,200,247,211,203, 6,164, 88,105,150, 65,236,148,131,147,213, 56, 24,206, 62,221, 45,195,237,153,206, 43,169, 51,119, - 73,100,164,125, 34, 72,211, 64, 97, 96,110, 1,191, 81,243,214,210, 12,210,138, 24, 41, 40,102, 89, 57,178,213, 33,105, 1, 32, -244, 32,111, 96, 45,125,246,219,221,139,140, 97, 48, 58,236,154,131, 46,153, 46,146, 87,204,146, 82,132, 15,242,109, 36,167,167, -132, 6, 59,119,206,190,200,170,100,132,160, 21, 41, 56, 1, 36,134,210,133,100,156,114,158,195,191,225,170,166,170,211,105,248, -149,212,255, 0, 59, 56, 36,156,100, 15, 64,113,246,235, 24,171,213,226, 60, 10,142, 60, 84,244, 75,137,232,164,103,245, 65, 82, - 71, 80, 58,100,117, 7, 79,209, 82,242,147, 69, 59,116,245, 27,159, 93,250,111,240,235,241,195,116, 85,144, 77, 56, 50,195,229, - 27,121,122, 40, 22, 2,202,123, 1,254, 33,247,226,229, 38, 74,212,210,138,159, 75, 96, 2, 2, 89, 3,156,146, 72,192, 46,118, -242,234, 6,176,138,131,208,130,143, 59,105,144,180,243, 97,114, 84,183, 74, 71,117, 30, 85,124, 41, 72, 32,103,160,201,234, 15, - 82, 53,100,169,214,165, 52,218,131, 78,182, 91, 7, 5,229,115, 43, 41, 62,101, 9,253, 85, 99, 29,115,128,122, 16, 53,132, 78, -168,190,250,242,169,137, 87, 33, 4, 48, 26, 80,111, 0, 28,172,132,175,226, 56, 4,128,162, 71,159, 77, 32,237, 34, 54,153, 1, - 86, 59,239,247,110, 15,243,248,219,221, 40,164,162, 89, 84,201, 21, 66,136,191,195,112,122,116, 32, 11,143,131, 90,221, 78,196, - 28, 93,170, 53, 86,220, 45,182,214,121,193, 56, 75, 24,202, 63,156,175,242,120, 8, 79,194, 49,147,208,172,140,107, 28,144,185, - 14,165,196,243, 54,128,227,107, 95, 40, 1,247,148, 10, 82,160,148, 36,114,161,156, 18,146,126, 53, 99, 7,225,193, 26, 21,201, -165,223,209,170, 87, 43, 69,196,145,224,199,109, 32, 21,142, 84, 37, 68,147,135, 50, 73, 61, 7,235, 99, 61,180, 42,150, 9, 83, -110, 45,199,193, 66,138, 91, 83,156,173,178, 57, 84,149, 20,132, 36, 4, 47, 4,158,234, 33, 74, 7,212,107, 34, 85, 36, 91,174, -195,111,187, 14, 2, 4,136, 88, 88, 50,239,114, 9,216,252, 64,239,107,131,210,253,111, 96,106,135, 9,241, 91, 90,152,154,224, - 81, 10,117,183, 66,150,132,132, 32,132,199, 90, 18, 18,211, 62, 25,202,136,229, 86, 80, 71, 55, 78,180, 86,211,138, 90,218,109, -210,132,173, 42, 40,195, 97,226,160,188,146,149, 61,202, 17, 24,252, 7, 4,147,128,148,146,114,179,143,162, 72, 66, 20, 93, 82, - 91, 32,243,151, 0, 13,184,226,121, 87,250, 54,210,216, 3, 57, 40,248,112, 84, 48,188,119,233,112,142, 86,234, 29, 75,124,173, -161,158,235,112,133, 50, 75,156,174, 56,246, 66,135, 48, 3, 10, 10, 0,128, 64, 10, 4, 29,108, 70,250,118,191,227,252,183,237, -110,134,223,125,175,163, 80,140,221,139, 15, 94,194,214,251,186,251,205,239,140,110,108, 82,150,189,228, 33,212, 54,225, 10,142, - 29,108, 40,168, 1,209, 40, 65, 63, 3, 28,169, 5, 42,200,193, 95, 80, 71,124, 14,168, 18,210, 86, 21,203,202, 82,160, 8, 0, -169, 41, 24, 9, 81, 60,184, 87,196,165,224, 12, 28, 28,231,190,156,202,203, 43,100, 60,180,187, 46, 83,142,128, 90, 68,167, 20, - 70, 74,148,144,167, 1,235,149, 35,157, 71,249,216, 72, 0, 37, 61,155,106,154, 76,153, 41,136,149, 4,169,231,163,196, 66,202, -129, 9,117,245, 33,158, 98,160,112, 71,136,224, 32,158,132,126, 26, 84, 48, 2,250,134,223,233,191,126,157,125,253,112,216,241, - 18,202,161, 65, 55, 29, 0,222,246,181,135,238, 29,126,252, 64, 99,219,127,112,181,112,123, 74,183,173,166, 28, 82,255, 0,130, -214,206,212, 89,178, 82,176, 66, 90,159, 67,176,105, 47, 75, 67, 68,147,204,215,137, 82, 24, 35,204, 30,154,228,170,206, 51,216, -231,166, 58, 99,237,251, 53,183, 60,121,238, 60, 93,220,227, 99,138,189,200,132,233,122,157,114,111,133,244,154,114,249,150,180, -154,125, 6,168,171, 94, 25,104,172,228, 50, 89,161,161, 72, 29,130, 92, 0,116, 26,212,101,246, 56, 61, 59, 96,227, 63,241,212, -247, 43,140,165, 5, 18,176,179, 8,144,144,122,130, 84, 18, 62, 32,155, 28,114,150,121, 50, 85,103,185,197, 66, 29, 81,207, 87, - 80,202,123, 21, 51, 57, 82, 15,189,108,126,252, 8,178, 15, 79, 76,232,117,245, 36,142,192,224,252,191,179, 85,214,174,254,137, -207,231,246,104,101,224, 28,231,161,235,248,233,200,126,252,104, 1,220,109,129,221,230,199, 97,142,189,189, 51,215, 63,159, 61, - 14, 64, 0, 96,247, 29,126, 71, 68,169, 89, 62,120,252,245,208,202,238, 79,204,253,154, 92,108, 5,240, 48, 58,192,202,135, 67, -215,243,231,249,198,133, 81, 3, 57,249,224,119,237,229,162, 28, 39,169,249,249,126,125, 52, 26,200,251,199,127,179, 74, 45,198, -227,126,216,200,253,248,160,178, 50, 58, 3,211,207, 63,184,253,186, 90,240,163,147,159,195,236,210,210,184, 24,175,170,168, 61, - 49,215,167,225,161, 16,112,122,156,116,213, 97,248,103,161,251, 51,164,216, 90,227,174,173,255, 0, 60,100,245, 38,214,190, 14, - 73, 56, 0,142,152,239,145,247,116,213, 66,176, 7, 82,172,142,216,249,246,207,222, 52, 58, 84, 83,211, 29, 7,111,236, 58,242, - 80,162,174,101, 47, 8, 61,128,206, 71,222, 7,174,116,131,222,222,236,101, 69,254,127,150, 46,141,168, 96, 0, 57,137,206, 73, -254,145,243,192,215,213, 44,173, 73, 8, 39, 9, 56, 87,124,103,247,245,254,141, 80,105,188,242,146,174, 81,158,128,117, 61, 49, -215, 25,244,209,205,167, 57,192,206,127,164,117,237,249,237,164,172, 79,207,166, 48,109,219, 21, 90, 56, 35, 35, 32,143, 46,221, - 61,125, 15,125, 28, 57, 72, 79,160, 62,127,205,251, 62,125,244, 50,121,112, 0,252,253,190,154, 37,176, 85,142,192,124,135,244, -231,207,166,177, 97,123,227, 24,184,178, 15, 76,159, 82, 63,163,247,234,184, 24, 57, 24,201, 57, 7, 31,135,219,161, 16,175, 35, -231,219,250, 49,162,146,113,220,245,232, 65,198, 59,246,199,175,246,233, 22, 22, 36, 97, 50,187,220,155,223,231,255, 0, 56, 37, - 43, 8,199, 58,186,159, 32, 59,244,249,104,146,238, 70,113,140,249,250,227,183,159, 77, 4,113,144,190,153, 63, 44,227,184,200, -252, 53, 81, 36,116, 32,231, 29,201,251,125, 7,150,146, 98, 58,223,225,130,219,221,123,117,193, 41,119, 24,248,249, 64, 32,224, -227,175, 94,160,122,244,206,167, 39,236,166,220,118,247,115,129,157,165,148,252,148, 73,171, 88, 74,169,237,245, 93, 33, 73, 46, - 54,186, 44,133, 38, 1,113, 61, 74, 65,132,228,126, 92,227, 35,168,212, 42,118,215,108,110,189,211,185, 98,219, 86,181, 49, 83, -231, 73, 5,229,186,227,137,139, 78,167,194, 66,128,145, 85,173, 84, 93, 79,135, 74,164,183,252,247,156,234,162, 66, 26, 67,174, -148,160,203, 23,217, 2,214,215,112,241,106,238,110,209,215,119,102,143, 34,181, 87,151, 2,239,168, 76,172, 75,110,139,108, 53, - 53,136,201,133, 34, 21,179,239,238, 5,184,218, 82,218, 11,139,119,149,215, 15,196, 91, 66,126, 17, 4,227, 9,104,167,142,154, -137,228, 6,169, 95, 86,155, 95, 74, 21, 96, 75,158,136, 11, 5, 3, 81, 26,142,194,230,246,184, 60, 26,124,214,135,136,167,204, - 41,105,100,124,178, 88, 36,167,158, 80, 44,129,137, 73, 35, 0,159,180,193,212, 2, 20, 18,129,238,218, 65, 23,235,214,231, 75, -174,219, 59, 83,184, 21,235, 93,151, 30,184,224, 91,147, 13, 27,193,104,188,236,105,178, 18, 35, 38,162,134, 82, 50,234,163, 33, -213,188, 0,207, 86, 70,181,171,102,120, 8,183,217,222,155,115,124, 46, 59,138, 53,229,105,208,108, 90,123, 86, 21, 10, 66,223, -155, 42,179,121,215, 33,166, 69,211,124,221,210, 95,234,244,211, 45,231, 83, 25,177,128,216,198,122,164,107,107,162,239,150,195, - 32,148, 57,188,187,110,233,193, 75,141, 34,227,167, 60,130,146, 48,180, 45, 33,226, 20, 8, 39, 35,207, 26, 14,226,227, 7,134, - 29,183,182,107,183, 12,173,200,163,213,169,246,180, 23, 39,205,163, 89,141,125,115, 86, 84,102,186,172, 83,169,144,129, 84,133, -127,178,128,126,237, 65,225,142,150,158, 82,226,162, 33,169,116, 0, 89,111,114, 69,200, 23, 59,157,133,183, 61,135, 91, 99,179, -242,190, 62,226, 28,135, 33,205,114,204,161,165,203, 70,109,205,246,202,132, 82, 30, 74, 87,138, 56,249, 76,250,117, 70,177, 5, -155, 76,136,234,116, 85, 84, 45,129,101, 97,144,207,224,179,103,238,181, 56,183, 81,123,208,158,152,250,158,156,245,169,125,220, - 20,116, 60,235,202, 42,121,197, 48,137, 42, 66,150, 73, 60,184, 78, 0, 56,244,208, 91,129,114,240,113,236,166,216,187,155,114, -235, 20,202,117,183, 21,229,201,153, 69,162,189, 37,138,222,236,111, 13,232,227, 74, 84, 26, 29, 62,109, 77, 74,149, 44, 56,247, - 39,140,233, 40,139, 17,165, 41,231,112, 0,207, 27,248,128,250, 66,114,226, 82,170, 52,190, 16,184,115,190, 43, 19, 3, 14, 52, -141,201,220,155,106,174, 41, 84,247,112, 66,100,195,183, 41,209, 86,185, 78,160, 14, 96, 30,113, 8, 56,248,186,103, 81,143,226, - 11,136,157,247,226,127,114,100,238, 30,253,238, 45,126,244,188,158,105,214,162,199,173, 62,168,205, 81,169,238, 40,172,211,168, - 86,223,192,221, 6,154, 50, 7, 43, 76,160,168, 1,206,181,158,186,127,203, 56,124,207, 46,161, 18,211, 34,253,166, 54, 14, 6, -215,180,103,204, 24,247, 50, 42,129,179, 89,197,215, 20,239, 27,253, 36,248,135,244, 13, 71, 12, 80,113, 94, 97,196, 20,179,105, - 38, 7,168,168,108,188, 50,127,118,243,135, 96,181, 38, 34,111, 20, 96, 58,169,220, 60,100, 95, 24, 39,180,115,137,253,201,226, -247,127,170,251,223,186, 82, 27,254, 16, 94, 74,118,124, 26, 44, 87, 92,118,155,105, 91, 81,121,162, 91, 54,141, 31,196, 63, 13, - 58, 13, 59, 9,230,192, 47, 62,243,210, 23,241,186,117,175, 92, 57,196, 97,202,237,211, 57,208,178,252, 42, 34,147, 24, 1,211, - 46,149, 5, 18, 60,253, 6,173,251,228,231, 53,219, 29,128, 65,247, 42, 12, 6, 79, 41,200, 5, 73, 4,129,215,191,174,178, 14, - 26,216,118, 93,122,230,134,202,121,164,204,167, 68,139, 29, 9,238,183,223,119,194,101, 41,207,153,113,104, 31,126,172,212,141, - 41,120,124,197, 24,209, 26, 34,128, 46,118, 28,192,119, 59,147,183, 82, 73, 39,169, 36,239,142, 53, 53,117, 21,115,214, 86, 85, - 74,211,213, 84,180,178, 72,231,118,103, 42,204, 73,176,238,123, 0, 0,232, 0, 27, 98,109, 63, 71,223,128,234,125,203,195, 15, - 16,156, 74,220,244,174,123,199,114, 99,200,218,237,155,145, 45,177,136,116,123, 98, 92, 90,221,217, 83,134,149,167,225, 85, 82, -187, 18, 29, 56,186, 15,197, 30,152,164, 14,138, 57,216,168,246, 17,161,213, 31,142,228,117, 50, 90,146,235, 97, 10,230, 75,225, - 8, 56,228,115,185, 67,169,229, 41,229,239,204,112, 8, 58,236,151, 0,219, 99, 15, 98,184, 76,225,239,107,105,113, 83, 17,187, - 99,109,109,231,167,180,148,132, 41, 85,138,164, 38,234,181,105, 14,116, 28,206,174,124,199,201, 39,174,123,233,168,226, 23,134, -171,150, 93,110,226,220, 91, 38, 61, 58,161, 65,144,255, 0,214,146,168, 44, 62,182, 43,237,206,148,240,247,152, 52,168, 9,103, -146,167,207, 53,197, 58,202, 3,136, 63,166, 80, 94, 2, 65, 52,151, 19,209, 54, 99, 28, 89,138, 38,170,131,118,127, 82,142,117, - 40, 61, 55,137, 74,160,247, 13,239,215, 29,145,225,180,210,240,102, 89, 6, 69, 36,194, 24, 42,163, 73,100,212,214, 95,105,101, - 94,110,228,237,169,174, 22,254,128,108, 0, 3, 82,108,234, 84,116, 52,134,210,201, 41,147, 33, 50, 29, 8,240,203,143,186, 2, - 0, 83,220,201,207, 58, 67, 40, 7, 36, 0, 19,132,156,107, 99,104, 52, 8,210, 93, 98,116,150,210, 36,193,113, 47, 65, 13,129, -225,199,203,101,135,198, 79,235, 74,113,133, 41, 10, 89, 5, 32, 16,148,242,167, 36,170, 87, 15, 59,203, 71, 82, 20,230,223, 76, -148,128,134,151,205, 74,153, 75,168, 33,105,194, 64, 39, 19,144,162, 0, 37, 71, 41, 4, 99, 28,189,244,241,218,123, 83,186, 79, - 41,180, 35,109,238,133, 20,114,133, 45,113,162, 37, 61, 14, 28, 74,221,114,104, 72, 79, 81,147,216,245,198,162, 81,100,213, 74, - 64,146,146, 66, 91,182,134,244, 22,232, 13,237,215,211,210,214, 24,178, 78,125, 70,186,229,108,198, 24,237,177,102,158, 32, 0, - 54, 4, 18, 91, 96, 64, 3,222, 5,177,113,161,208, 12,134, 16,211, 10, 90, 34,143,242,202,115,224,151, 49,158,230, 50, 29, 74, -147,238,236, 18,160, 10,191, 89, 64,114, 35, 1, 74, 86,178,171,163,112,237,237,158, 85,185, 95,170,208,239,234,203,242, 38,132, - 82,227,109,214,216,222,251,153, 34, 51,212,224,196,176,253,106,153, 99,209,229, 46,149, 79, 64,228, 45, 41,208,217,144,176, 88, -142,149,168, 40, 7,150,209,216, 45,211,158,164, 57, 54,149, 73,183,217, 80,229, 46,213,234, 77, 72,113, 41, 0,142,127,114,166, -182,234,138,136, 63, 8,231, 66,124,250,119,214,136,251,111,106,123,151,194, 15,179, 87,116,183, 91,103,247, 82,225,178,183, 81, - 55, 54,223, 91, 16,111, 43,121,168,212,249,212,202,101,201,112,177, 6,177, 22,136,227,168,117,112,106, 47,198, 43, 67,115,185, -253,229,144, 74,152, 83, 75,194,132,166,147,135,179, 55,167,146,177,104,218, 8,163, 49,131, 44,171,101, 82,242, 36,105,101, 37, - 93,174,238, 0,210, 13,137,213,184,190, 34, 25,199,137,124, 27,150, 48, 25,157, 89,207,105, 98, 73,154, 90, 74, 25,209,101,153, - 68, 78,197, 69, 87, 38,162, 8,201, 42, 11,115, 17,137, 23, 64, 22,225,150, 51,124,116,238, 62,206,240, 93,121,221, 53,125,139, - 98,254,183,183,166,236,173,213, 46,123, 18,139,190, 78, 91,107,223,205,183,143,115, 74,157, 85, 27,132,254,217,209, 34,200,137, -176,244,148, 57, 59,154,223,149,118,189, 34,254,168, 6,195,212,202, 37, 1,178,229,101, 17,220,184, 46,123,134,236,174, 85,110, -107,134,183, 87,184,110, 58,228,233,117, 42,229,201, 93,156,253, 74,191, 90,168,206,125,114, 39, 77,169, 84,100,184, 86,235,239, - 72, 90,214,224, 4, 37, 74, 86, 72, 39, 36,218, 42,181, 73,149,138,165, 74,181, 92,157, 58,167, 88,172,212,165, 86, 43, 53,106, -148,217, 85, 42,173, 98,179, 80,115,198,159, 87,171,212,230,186,183,234,149, 55,158, 37, 78,200,125,199, 29,112,245, 90,142, 6, -128,109,101,110, 97, 36, 6,179,241,128, 71, 49, 62,185,242, 26,176,114, 30, 31,163,201, 33,178, 14,117, 76,191,106, 66, 5,197, -194,141, 9,251, 40, 52,128, 22,229,136, 85,214,206, 85, 72,164,252,120,250, 73,120,157,244,128,204,169, 36,227, 28,238, 99,195, -217, 60,113, 67, 69,150,137,165,120, 17, 41,193, 88,102,171,119, 98,213,213,195, 83,191,180, 77,245,112, 73, 61, 64,160,130,138, - 25,228,133,136, 90,148,234, 57, 93, 9,121, 9, 80, 90, 91,144,148,188,144,176,114,149,165, 14, 2, 18,224, 80, 4, 40, 96,130, - 50, 8, 58,204,169,155,143,113,209,211, 21,169,110,192,185,160, 68, 11, 17,232,183,173, 53,187,170,154,198, 82, 82, 61,205,249, -174, 9,212,229, 15,255, 0,131, 48, 54, 63,248,163,211, 24, 96,228, 10, 88,201, 41, 7,162,137,244,238, 63, 57,213, 53,164, 43, - 36, 14,185,200,252,159,150,159, 39,166,130,161, 52, 77, 10,202,163,166,160, 13,137,238, 13,174,167,222, 44, 71, 99,138,111,135, -120,167,136,248, 74,170,106,190, 27,206,170, 50,105, 42,192, 74,133,134, 66,176,213, 68, 13,249, 53,148,230,244,245,180,228,253, -170,106,184,166,129,255, 0, 94, 54, 24,116,231,239,189,238,150, 89,133, 64,254, 15,237,252, 36,248,206,123,141,131, 77, 48, 29, -151, 33,230,210,209,151, 80,170, 84,195,206,184,250, 26, 64,229, 8, 74, 50,160,149, 45,107, 8,109, 8,177,171,117,119, 10,108, - 7,169,170,189,110,207,170,159, 74,208,253, 57, 21,201,173, 71,113, 46,161, 40,144,133, 73, 74,196,165, 54,232, 78, 92,111,222, - 60, 37,149,168,148,124, 74,206, 0,166,219,230, 33,120, 36,117,206,124,251,143,219,175,170, 91, 74, 90, 19,207,241, 32, 19,200, -147,240,156,250,254,205, 37, 29, 21, 36, 32,133,167, 64, 24,223,236,130,111,182,228,145,114, 71, 98, 73, 54,218,248,156,102,190, - 58,120,209,157,242, 99,172,241, 87, 62,130,146,154,148, 80,197, 71, 69,153,213,101,153,108, 20, 34, 40,225, 52, 84,185, 86, 89, - 37, 30, 91, 75, 70,241, 68,139, 37, 45, 45, 36, 84,242,232, 13, 44,108,196,177,172,227,188,193, 37, 92,169, 75,105, 8,109,150, -208, 16,219,109,131,209, 13,161, 0, 37,180,228,147,128, 7, 82, 79,114,117, 72,146,163,205,129,140, 14, 81,216,140,129,158,184, -237,223, 94, 84,177,158,216, 4,224, 31, 32, 73,237,246,107,233, 9, 80, 79, 50,129,198, 79,194, 64, 35,215, 61,126,205,109, 95, -111, 47,109,189,216,170, 85, 2,233, 91,105, 10, 6,221, 0, 3,160, 30,158,131,165,177,229,212,133,160,131,128,125,112, 51,211, -236,243,208,105, 11,230, 60,201, 8,109,191,139,226,248, 78, 71,159,207,251,116,122, 20, 20, 50, 7,145,200, 61,199,151, 95,191, - 67,169, 36, 55,151, 49,215,161,201, 4,252,137, 0,246,233,161,179,111,219, 6,177, 6,221,251,126,255, 0,227,138,110,123,186, -192, 82,130,150, 8,200,194, 73, 3,182, 73, 31, 61, 75,227,232,215,112,195, 99,223,219, 35,198, 38,227,110,133,131,105,238, 13, -175,184,202,183,248,125, 93,173,121, 80, 32, 92, 54,253,118,207, 69, 45,203,170,246,167, 78,131, 84, 97,109,174, 60,137,213,122, - 35, 78,132,242,171, 48, 16,160,164,173,180, 40, 68, 24,149,143, 8, 54,158,138, 74,147,205,144,144,181, 99, 24, 3, 29, 15,109, - 77,123,217,103,184,103,103,189,143,246,187,116, 6,164, 81,171,123,149,186,219,227, 85,173,205, 79, 52,105,170,164, 82,174,168, -214,139, 78,199,144,180,167,195,143, 48, 82, 93, 67, 79,160,169, 10,102, 26,210,135, 57,138,185, 98,156, 99,155,193,146,101, 73, - 89, 80, 12,138, 37, 10,177,139, 6,150, 66,173,201,141, 9,232, 76,161, 9, 36, 16,136, 25,200, 33, 72,197,129,225,126, 86,115, -110, 47,162,164, 72,185,210,136,228,101, 7,117,187, 20,132,234,244, 26,101,111,190,214,223, 28,193,223, 63, 97, 79, 4,115,184, -194,185,209,179, 27,239,185, 54,175, 14,116,135,150, 47, 93,165,163, 83,105,149,186,237,191,122,205, 66,164,162,196,218,237,215, -185, 31,144,220,155, 36, 48,243, 62, 60,137,208, 39,207,167, 56,164, 69,140,229, 65, 78,120,204,111, 6,212,251, 26,125,155,123, -125, 58,216,185,109,203, 55,136,138,110,227, 80, 37,198,122,216,220, 26, 55, 21,119,221,175,121,219,245,200,177,194,145,114, 81, -170, 86,149, 42, 2,105, 21,166,212, 60, 80,227, 40, 75, 45,172,132,134,150,223,194,108, 27, 71,113,203,157, 91,184, 42,197, 34, - 81,147,122, 93, 21, 71, 34,115, 36, 46, 82,152,170, 10,100, 82,181,243,128,150,154, 17, 84,177,200, 6, 11,105, 81, 80, 1, 58, -222,155, 74,229,118,163, 38,164,121, 90,136,212, 8,204, 83, 34,180,202,131,110,158, 98, 36, 84,159, 83, 97, 28,172, 45, 43, 91, -109, 37, 72,230, 95, 43, 74, 4,164,144, 53, 71,103,220, 99,198,175, 58,200,217,245, 68, 48,132, 0,197, 3,242, 22,221, 8, 44, -154,100,147,169, 93, 83,188,174, 86,218,156,144,111,212,220, 79,225, 79, 9,228, 78,100,161,201,225, 89, 2,172,143, 33, 82, 89, -164,178,130,234, 9,180,107,204, 58,149, 35, 85, 80,157, 55, 14,113,212,219, 99,136,234,228,106,101, 18,155, 87, 66, 43,171,106, - 35, 20,230,230,213, 86,165, 86,106, 81,233,145,219,143,245,157, 94,162,202, 82, 39,213,158, 8, 74,228, 72,240,144, 31,125,213, -185,225,160,171,151, 78,181,189,187, 22,141,226,232,140,220,143,169,234, 75,115,193,110, 28,247, 27, 75, 82, 94,236, 27,137, 40, - 30, 71, 22, 72,232,147,202,162,122, 0, 78,185, 81, 30,244,240, 36, 85, 11, 97, 75,143, 66,134,205, 38, 36,144,114,151,170,110, -182,100, 75, 96, 4,171,162,144,234,163,165, 65, 32,245, 74,178, 8, 26, 10, 61,219, 41,136, 17,203,239, 31,124,142,204,154,156, -175, 13,210,158, 95,136, 52,201,108,142,169, 62, 50,148,126, 69,191,150,148,202,184,199, 54,167,208, 37,169, 53,106, 7,153,101, -243, 27, 0,162,250,143,152, 27,234, 59,146, 0,182,199, 21,248,142,186,130, 68, 16, 73,204, 22, 91,197, 37,200, 58,148,200, 0, - 63,105,108,186, 23, 99,179, 29,212,244, 27,233,106,113,119,182,151,183, 20,183,231, 10, 22, 90, 95,184,110,205,174,179, 85,117, -110, 45,213, 17,214, 92,183,173,234,168,126, 51, 38,204, 66,193,230,145, 91,105, 50,153,247,130, 7, 35, 78, 18,214, 74,210,172, -108,130,235,136, 99,157,106, 88,230, 57, 24,206,126, 30,184, 29,122, 99, 35,174,184,239,193,253,153,180, 27, 99,196,214,228,110, -244, 17, 42,218,187,248,132,179, 97,219,181,104, 40,144,201,180,230,222, 73,172,174,167, 38,226,195,235, 46,192,175,213,208,195, -104,125, 33, 94,236,228,180, 23,194, 91,114, 74,129,232,125,205,113, 42, 50,221, 64,113, 73, 41, 74,147,200, 62, 21,165,105, 39, - 60,201, 61,142, 2,178, 62, 90,181,184,106,180,102,212,111, 59, 48, 18, 60,132, 50, 0, 46,130,202, 66,144, 55,247,134, 61, 71, -223,105,215, 25, 75,194, 85,210,100,173,193,144,212,211,209, 46, 91, 68,149,130,172,222, 99,154, 8,239, 94,118,188, 98, 35, 41, - 2, 1, 17,229,242, 66,157,152,184, 14,149, 74,248,109,178, 71,136, 2,123,168,115, 2, 14, 14, 57,186,118, 32,228, 31, 62,191, - 45, 97, 51, 47, 98, 23,151, 29, 87,134,165, 30, 85, 12,144, 73, 56, 9, 36, 28,115,140,128, 50, 48,190,217,242,214,190, 84,238, -181,120,174, 53,206, 10,138, 20,251,121, 81,248,208, 14, 28,111, 62,153, 35,167,145, 94,177,148, 93,188,217,104,175,152, 41, 36, -165, 46, 12,115, 32, 15,137, 25, 36, 18,180, 96,127,181,202,144,175, 93, 74, 99,129, 80,108,110,126, 63, 15,221,249,252,113, 22, -167,164, 88,198,195, 87, 75,254, 23,239,215,227,252,142, 54,149,187,161, 46,158,100,184, 10, 85,203,158,101, 4,148,156,144,121, -194,199,192,114, 21,229,141, 90, 42,114,158, 91,107,145, 76, 8,113,208, 10,213, 17, 74, 45,161,212,100,229, 76, 41, 32,144,224, -234,174, 78,161, 92,159, 14, 20,113,166, 18, 37,213,201,202, 92,120, 40, 0, 57, 92, 36, 41, 65, 39, 56, 67,160,145,146, 15, 76, -158,152, 57, 32, 19,157,102,144,110, 4,175,225, 82,207, 50, 70, 72, 4,148,117, 57,200,207, 83,144, 6, 64,237,203,243,234,149, - 69, 58, 78,154, 36, 23,244, 61,193,236,111,235,211,249,140,110, 67, 81, 45, 20,162,104, 13,237,177, 83,114,174, 63,101,198,215, - 30,253,136,189,193, 83,190, 47,109,215,101,185,200,130,228,102,194, 92, 90, 75,164, 58,231, 42,146, 73,229, 80,113, 35, 60,189, -138,136,248, 74,128, 86, 58,234,234,212,199,221, 1, 78,200, 88, 33, 68, 16,142,102, 27, 82, 21,132,242, 40, 55,146, 82,112, 59, - 17,133, 39, 33, 64,231, 88, 13,198,183, 11, 6,169, 79, 9, 91,204, 2,185,108,130,176,149,181,132,149,201, 71,135,250,206,161, -180,146,226,123,173, 0,158,139, 29,113,232,181,233,174, 28,169, 77,128,142, 71, 27, 45,169,120, 83, 43, 79, 55, 50,121,143,249, - 64, 84,147,211,161, 24,193,202,134, 98,211, 43, 81,204, 98,153,246,107,216,216, 88,131,109,238, 59,250,223,241, 6,248,157, 80, -188,121,165, 42,212, 83, 34, 68,192,217,212,145,169, 24,117,235,185,235,117, 35,175,186,197, 67,227, 22, 64, 10, 60,141,168,243, -128, 10,146, 74,212, 91, 65, 32, 37, 74, 41, 42, 91, 32,227,252,152,234, 9,207, 49, 35, 87,149, 84, 92,140,217, 90, 25, 74, 60, -117, 4, 33, 47,165,213,199,195,201, 42,109,160,129,149,198,144,226,142, 19,206, 49,147,240,163,148,243,105,158,139, 82, 82,138, - 1,113, 92,142, 19,203, 33,183,156,229, 70, 87,204,203,109,242,184,163, 29,174,101,225, 33, 28,203, 82,148,148,148,231, 35, 87, -196, 84,214,134,138,188, 73, 40,112,151,217, 83,209,203,109,180,180,164,252, 94, 34, 22,162,183,100,103, 28,223,168, 83,130,148, -143,136,157, 47, 28,195,190,192, 88, 95,247,119,235,183,190,247,177,191, 77,244, 42,224,209,114, 95, 93,183,232,119,183,196,245, - 29, 59, 16, 63, 12,178,167, 82,117,101,214,158,116,143, 5, 24, 90, 23,206,135,176,149, 30,171, 28,152, 67,133,148, 37, 68,130, - 72, 82,136,233,216,106,111, 20,187,199, 75,216, 78, 31,183,187,123,107, 14, 3, 11,107, 54,178,243,187,194, 90, 57,118, 69, 74, - 29, 37,232,118,227, 17, 80,181, 15, 26, 67,151, 45, 70,140,218, 83,159,252, 98,186,121,105,253,153, 86, 47, 7, 9,115, 32, 43, - 45, 41,124,222, 48,200, 88, 62, 39, 83,200,159,140,117, 57, 42,192,233,231,168,229,253, 33,126, 36,209,101,112,247,183,156, 51, - 81,166, 20,220,123,253,118,139,190,234,105, 14,114,189, 19,107, 54,170,107, 47, 14,101, 54,172, 24,245, 77,192,149, 76,140,166, - 92,229,230,106,223,125, 65, 36, 5, 99,118,157, 26,170,122,122, 52, 39, 85, 75, 0,125, 66,117,118, 29, 62,202, 6, 59,122,116, -190,198, 41,159, 87,166, 83,147,230, 89,163, 16,134,138, 38,100,189,183,152,128,144,169, 29,124,210,178, 41,223, 96, 73,219, 16, -244, 92,153, 82,150,236,202,131,161,234,140,247,159,157, 80,125, 32, 97,234,132,215,151, 38,107,224, 96,116, 92,167, 94, 87,207, -155, 66,172,131,211,207, 61,115,246,127,110,136,115,169, 29,135,115,161, 87,230,174,152,245,239,216,121,254,124,181,105,160, 0, - 11,108, 63, 45,182,199, 34, 42,236, 13,205,207,174,253, 14, 6, 86, 50,113,249, 63, 47,150,135, 81, 10,242,192,235,159,159,204, -250,104,133,250,130, 20, 72,252,244, 26, 21, 71,161, 62,125, 79,223,165, 20, 18, 70, 21,192,234, 32,117,249,224,103,231,246,124, -180, 51,131, 57,234, 1, 4,245,209, 90, 17,194, 14,122,247, 57,199,203,231,165,199, 81,129,129, 85,211,167, 82, 79,115,242,244, -199,166,116, 42,200,207,108,117,199,219,215,207, 68,185,242,238, 7,159,111, 95,223,160,150, 79,126,152, 61,193,243, 61,127, 63, -118,148, 65, 97,210,247,249,255, 0, 92, 12, 82, 36, 2,122,129,247,254,255, 0, 61, 45, 81, 95,235,119,242,252, 62, 95,159, 93, - 45, 31, 3,108, 86, 29,251,103,229,162, 52, 42, 87,219, 61, 15,145,199, 76,131,229,170,129, 68,158, 94,108,116,207,111,159, 94, -190,189,244, 71, 2,221,108, 70, 14,195,173,190, 63,195, 7, 54,123, 21,125,223, 63, 67,162, 7, 95, 35,246,121,232, 38,240, 58, -100,147,243,252,247,254,173, 22,149,245,244, 62, 94,126, 95,102,146,193, 58,116, 56, 41,161,203,212,156, 99,200,252,243,216,104, -214,200,243, 0,253,248, 39, 64,165, 89, 29,191, 17,231,231,131,157, 86,108, 20, 44,168,172, 16,172, 1,159, 47,179,238,210,109, -233,109,135,242,198,113,112, 10,193, 1, 67, 4,249,129,223,237, 35,243,215, 68,167, 3,168,200, 39,161, 29,191,102,122,118,208, -169, 81, 32, 12, 12,140,119,237,140, 1,140,143, 60,232,128,172,100,156,100, 96,228, 96,147,246, 99,229,253, 58, 79, 24,193,141, -168,119, 61,113,211,239,233,131,248,104,132, 28,224,245, 56,235,243,233,235,143, 45, 0,133,103, 3,168, 4,250, 14,255, 0,105, -213,126,108, 17,133, 41, 57,207,234,250,255, 0,195, 72, 55, 94,183,198, 45,251,240, 96,194,212, 65,206, 15, 99,156, 99,167, 83, -223,166,178,107, 86,133, 46,228,174, 83,168, 84,230,131,242,231,203,102, 43, 41, 89,195, 69,215, 20,122,190,224,255, 0, 37, 29, - 13,165,110, 56,175,230,182,210,136,235,140,226,141,149,172,148, 40,242,164,140,243, 0,115,229,231,167, 83,107,106,201,163,215, - 27,102, 59,168,106,161, 80, 68,168, 17,165,168, 14,120,254,244,202,121,148,223, 55,119,212,203,110,165, 63, 53,159, 44,231, 74, -177,164,138,154,105, 34, 0,200,138, 72,248,250,159,147,183, 77,240,231,146,208,195,153,231, 25, 94, 91, 81, 57,166,167,174,158, - 24,157,199, 85, 87,117, 86, 43,125,181, 16,108,183,219, 81, 23,218,248,222,138,101,205,111,109, 53,188,139, 14,206, 6, 92,185, -106, 97,219,158,165, 20, 33,169,181,218,147,105,229, 75,211,229, 39,172,106,107, 74, 42, 76, 88,249,229,105,177,148,165, 78,169, -197,168,202, 52, 58,189,201, 45,107,152,251,134, 43,136,241, 26,136,133, 56,212, 96, 73,206, 22, 82,160,183,187,255, 0, 56,129, -159,230,233,172,181,109,231,101, 77,113,174, 96, 84,151, 11,234, 90,143, 58,214,238,114,165,184,181, 28,173,106, 39,185,234,115, -211,167, 77,109, 61,163, 22, 44, 22, 27, 91,137, 83,171, 74,128, 82, 1,207,234,158,188,201, 56, 29,255, 0, 15,232,173, 43,102, -142,152, 57, 86,230,207, 39,153,152,245, 98,109,185,219,238, 30,131, 97,176,176,238, 92,135,135, 96,160,165,130,158,154,139,217, -233,169,194,164, 80, 40,217, 20, 91,173,247,102, 39,119, 98,117, 51, 18,204, 75, 18,113,157, 88, 27, 77, 6,162,243, 10, 91, 45, -173,210, 17,204,134,249,192, 79, 80, 63,214,237,246,249, 13,116,123, 98,182, 58, 4, 74,205, 30,167, 79,136,195, 21, 8,242, 27, -109,110,132, 5, 41, 73, 87,235,167, 43, 4, 56,130,140,228, 96,131,208, 99, 90,225,182, 40, 67,142, 48, 16,148,176,211,139,108, -165, 13,164, 41,196,146, 1, 0, 28, 0,122,103,200,227, 93, 65,218,186,205,175,107,194, 23, 45,203, 58, 29, 22,218,182, 96, 72, -174,220,149,170,131,237,177, 22,155, 74,165,199, 84,185,211,101,200,116,132,182,210, 35, 52,242,142, 78,112,156, 0, 78, 6,171, - 12,238,173,234,222, 88,228,156,164,106, 9, 35,215,160, 2,195,177, 61,189, 58, 92,224,103,185,230,105,150, 32,167,167,102, 26, -193, 82, 7,165,183, 6,219, 90,219, 1,190, 56,205,197,103,181,207,127,173, 13,203,184,118,215,133,170,141, 31,104,108,203, 18, -227,169,219,114,110, 38,173, 59,114,175,120,222, 85,138, 12,199, 41,181,154,156,153, 53,154,123,241,232,148,133, 84,163, 74,110, - 60, 86, 88, 82,220,105,176,227,238,146,190, 68,232,182,233,123, 64,184,141,223,154, 60,154, 6,249, 57,181,123,167, 78,146, 84, -227, 18,107,187, 67, 98, 81,110, 42,116,165, 0,145, 34,159,117,218,148,120,114, 99,114,227,163,101, 42, 70, 84,115,229,173, 86, -221,155,170, 61,231,185, 27,133,121, 69, 66, 4, 43,174,251,188, 46,104, 37,150,148,210, 87, 78,184, 46,106,173, 86,152,226, 26, - 95, 86,138,160, 76,140, 84,147,241, 37, 74, 32,128, 65, 26,194,202,138, 27, 72, 66, 66,146,164,249,147,216,250,231,207, 87, 69, - 31, 7,240,224,142,134,170,163, 33,165,108,202, 5, 70, 19,180, 17,154,132,144, 1,186,205,167,154,132, 27,219, 75, 46,158,139, -101,216,113, 46,113,196, 25,150,101,152,213,213, 75, 88,211,164,146,185, 69, 33, 74, 4,212,116, 0, 45,109,150,194,253, 77,174, -196,146, 78, 25, 29,226, 14, 57,121,205,113,232,130, 3,142,211,225,184, 35,161,210,251, 60,158, 24,194,153,113, 74, 39,194,232, - 48, 51,240,246,211,245,236,251,162,194,185,248,143,179, 45,121, 83, 19, 21,250,213,203,107,181, 9,165, 71,118, 87,191,186,213, -102, 27,130, 3, 81,152, 66,148,243,239, 41, 41,105, 3, 24, 5,238,101,124, 41, 58,101,247,161,159, 22,181, 69,168, 39, 42,110, -109, 13,166,193,234, 48,228,124, 36,164,245,239,145,174,129,251, 9,174,186, 5,165,237, 66,225,233,203,134,153, 75,169,179, 93, -122,232,183,105,102,171, 29,185, 77,211,107,245, 27,114,161,245, 77, 90, 19,110,130,148, 84,153,121,149, 6, 86, 70, 82, 94, 37, - 63, 16, 4, 76,106,145,166,225,202,216,163,115, 19,154,118, 0,141,244, 17,182,175, 48,111,179,107,216,131,211,124, 55,240,245, - 50,102,121,237, 29, 36,238, 33, 74,218,128,140, 64, 27,115, 13,172,189, 64, 38,246, 91,130, 3, 17,112, 70,216,253, 60,108,203, -170, 61, 38,218,163, 69,169,210,215, 6,123, 52,168, 12, 42, 18, 30, 74,149, 13, 45,197,109, 30, 2,136,232, 84,156, 96,142,195, - 24,211,173, 99,205,135, 95, 67,163,195, 82,216,105,226,174, 71,124,148,149, 2, 51,235,129,141,105, 44, 90,227,175,203,110, 58, -159, 60,234,145,200,227,139, 86,113,133,225, 74, 81,201,236,156,159,187,231,170, 28, 4,113, 50,246,254,220,188, 78,211, 27,167, -174,157, 67,217,253,200, 98,198,160, 62,226, 84,149,213,154,110, 59,134, 85, 65, 74, 80,193, 38, 67, 46,128,145,156, 36,167, 56, -206,171,117,160,130,138,122, 97,237, 82,206,210, 2,164, 74,193,245,233, 0,234, 42, 2,170,144,127,100, 1,189,173,233,213,116, - 57, 94,103,152,229, 89,246,102,140,213, 17,228,201, 12,179, 73, 36,128, 58, 9,234, 18,153, 52, 40,182,162,210, 72,183, 8, 0, - 85, 5,141,128, 24,234, 84, 22, 97,190,160,211,140,160, 37, 73, 9, 37, 39,151, 35,203, 4,118, 61, 53,114,153, 78,153, 71,107, -235, 40, 14, 61, 50,158,222, 60, 88,104, 36,186,207,108, 43,161,248,155, 29, 63, 29, 97, 20,201,202, 47,103,152,116,235,202, 79, -126,158, 94,167,229,242,211,203,110,200,247,142, 86,186, 45, 43, 28,139, 74,199, 69, 36,140, 40, 28,142,185,211,232,142, 26,149, -210,124,143,250,172, 54, 32,246,233,212,123,143,108, 87, 57,193,168,203, 88, 74,126,186, 30,174,140,110, 24, 27, 95,115,186,183, -163, 11, 88,251,182, 38, 90,149,147, 81,103, 43,113, 42, 36,101, 41, 4, 97, 63,236,131,246,106, 57,159, 74,191,116, 98, 90,254, -207, 59, 39,109,189,229, 13,212,183,107,126, 44,232,173, 70, 10, 79,139, 34,151,103,194,170,220, 21, 37, 33, 4,228,182,151, 83, - 3,152,129,211,196, 79, 81,158,178, 30,102,146,109,219,145, 41, 96, 40, 65,169, 43,197,142,145,209, 8,117, 68, 7, 25, 3,237, - 80, 32,127,181,168, 24,253, 41,190, 42,105,187,177,198, 54,217,240,225,110, 85, 81, 54,139,195,101,145, 34,125,214,152,206, 7, - 99,181,184,187,128,182, 37, 59, 9,124,170,199,189,197,183, 98, 83,146,176,122,161, 83, 8, 58, 74, 58,202,145, 17,201,101, 26, -102,168,170,131, 88,244, 90,105, 22,173,158,223,176,226, 5,136,155, 90,243, 32,234,192, 98, 1,158, 71, 76,139, 85, 95, 79,189, - 36,176, 18,155, 91,205, 48,228,232,235,246,147, 91,189,183, 39,148,198,196, 2,113, 23,105, 12,224,142, 92,114,128, 57,115,230, - 60,193, 31,158,218,166,220,116, 96,148,167, 35,185, 0, 30,135,231,131,219, 70, 58, 91,112,228,147,129,219,200,129,212,245, 26, -163,239, 1,162,164,182, 58, 16, 2,148, 48,123,246,233,248,234, 69,123,110, 78,199,253, 49, 95,238,192, 91,182, 41,184,218,146, -112, 2, 85,145,205,128,115,240,232,117,175,166, 2,185, 84,122,144,123,252,146, 48, 58,249,126, 26,246,165,183,205,207,226,242, - 41, 68, 0,146,160, 57,188,186,141, 8,236,164,182,248, 10, 66, 79, 40,192, 24,234, 78, 51,205,246,235, 5,182,178,131,140,233, - 61,206, 62, 37, 37,100,130, 84,143, 85, 20,247,251, 9,215,196, 52,218, 22, 28,108, 23, 20, 73, 10, 73, 32, 16, 58,117, 3, 29, -117,111, 83,203,146,247, 41,116,161,190, 96,162,140,245, 64, 79,113,246,247,209,173,134,220,112, 58,130,174, 68,156, 21, 96,167, - 56, 29,142,124,186,235, 23, 38,226,214,237,108, 24, 0, 8,223,231,108, 84,202, 80,181, 45, 75, 37, 10,236,140, 14, 84, 19,208, - 21, 19,249,206,145,240, 91, 89, 35, 4,168, 2,181, 39, 36, 1,143, 63,207,219,175, 14,180,248, 91,135,225, 44, 44, 19,203,230, -113,158,202, 35,190,147, 72, 75,188,184, 10, 97,180,167,149, 94,101, 68,116,193,200,235,219, 67,113,176,234, 62,253,255, 0,241, -140, 88, 27,158,199,247, 99,223,138,128,176, 16, 74,202,192,200, 64,234, 51,216,159,151,174,144, 56,112,168,255, 0,226,210, 65, - 39,211,169,193, 30,191,219,161,201, 91, 97,101, 11,229, 33,124,169,112,164, 97, 67, 25, 41,193, 29, 62,221, 18,149, 30, 64, 28, - 41, 83,138,201, 81,233,203,131,211, 7,167, 95,158,178,160,129,238,248, 99, 4, 11,219,211,111,159,187, 23, 91,122,216,174,223, -151, 45,171,103, 91, 30, 48,173, 94, 23, 45, 2,211,161,169,134,124,101,166,185,117,214,160,219,116, 71, 18,206, 63, 72,148,213, -170,176,202,135,110, 84,156,234,116,188, 70, 90, 86,214,200,237,141,191,195,253,145, 22, 45, 26,196,217,203, 30,212,219, 59,118, -140,216, 15, 52,105,182, 85, 52,210,220,144,228,146, 7,188, 57, 58,187, 14,173, 81,121,213,101,199,100, 86,221,117,213, 5,175, - 81, 5,246,122, 41,151,120,231,225, 49,165, 45,167, 25, 70,253,237,171,138,109, 68, 6,138,152,185, 35, 72, 66, 58,164,128, 60, - 86, 81,140,142,248, 24,212,167,184,174,185,213, 80,146,133, 73, 46,189, 42,116,101,176,243,171,116,136,206,165, 92,181, 24,242, - 29, 66,122, 56,175,137,244, 12,128,174,102,202,115,202, 19,170, 83,197, 9,101,168,206,184,107, 46, 36,242, 99,215, 57,177, 27, -176, 33,119, 7,246, 0,242,159,241,145,183,126,148,250, 56,229,176,205,157, 87,230, 36, 3, 52, 82, 67, 18,237,186, 42,142,113, - 96, 78,222,114, 22,253,238,138, 65,198,134,236,221,125, 48,227, 85,230, 51, 33,182, 20, 46,139,193, 78, 71,146, 11,172,173, 49, -107,213, 39, 22,218,176, 65,104, 45,181, 17,240, 28,231, 10, 57,192,214,224, 91, 87, 56, 52,186,124, 87, 37, 60,195, 17, 27,114, -181, 86,168, 52,165, 33,208,211,232, 84,135, 35,180, 82,172, 45,194,149, 57,206, 62, 17,225,181,156,149, 19,174,110, 88, 21,191, -119,114,244,165,183,202, 67, 27,155,118,199, 87, 58,178, 4, 89, 50, 96,212,208,176,140,117, 30, 4,208, 18, 6,122, 47,168, 24, -193,216,148,220,233, 17, 19, 8, 58,234,126,185,152,195,115,214,218,208, 94, 77, 49, 13,178,244,133,248,196, 0,223,193, 29,180, - 33, 36,116, 68,133,242,242,101, 71, 81,250,188,185,106, 15, 67,113, 99,239,183,107,245,232, 9,183,107,219,224, 58,227, 63,165, -142,190,158, 48, 77,158,254, 98, 55,217,118, 36, 14,246, 5,200, 7,112, 64, 22, 35,166,219,210, 47,185, 82,233, 80,131,107,114, - 60,217, 83, 30,159, 55, 1, 97, 10,126, 99,143, 59,200, 93, 39, 36,248, 79, 52,216, 74,146, 85,208,149, 28,227, 87, 58,150,229, - 67,154,202, 4, 96, 35, 72,171, 77,110, 44, 73,100, 36,180,229, 58,157,136,136, 91,136, 10,230,111,157,193, 37,215, 17,208,101, -244,168,228,117,214,181, 64,187,158,122, 93, 82, 99, 15, 54,251, 37,214,153,128, 31,117, 72,105,199, 39,177,225, 23,146,164,156, - 48,194, 20,135,157, 91,128,140, 41,148,243,100, 17,156, 82,117,230,220,185,110, 46,150,234,204, 86,210,213, 38, 18,207, 68,178, -246, 20,194,221,232, 57,159, 45, 69, 67,133, 75, 72, 8, 74,217, 4,243, 28,107, 65,114,134, 28,192, 19, 72,150,215,216,116,216, -247, 29,143,240, 35,215, 20,246,103,146, 44,245, 78,252,176,174,237,171, 80, 54,208, 8, 14, 67, 30,182, 4,169, 0,130, 8,141, -150,215, 27,108,165, 82,240, 65, 91,130, 60,226,182,132,167,101,192,151, 29,238, 83, 25, 20,197,120, 81,158, 74,218, 87,253,240, - 30, 74,156, 5, 56, 40, 82,144, 70, 78, 52,237, 90, 94,211,206, 31,238, 61,215, 87, 13,251,187,120,211,246, 99,125,216,166,219, - 53, 27, 46, 70,225,213,169,180,173,188,223,218, 29,126, 20,116,211,238, 11, 14,254,117,214,224,219,183,114,235, 2,165, 77,157, -110,215,151, 5,255, 0,172, 41,143, 26,124,233,201, 95,132,215, 47,235,155,134,253, 49,169,137,139, 33, 17,217, 13,120,112, 82, - 15, 49,240, 35, 44,163,195,112,169, 32,252,110,120,100, 14,255, 0, 6, 84, 78,117,197,111,105,134,220,238, 93,231, 65,219, 45, -247,167,109,213,197, 90,217,251, 58,155,114,237,149,225,186, 16,105,102,169,111,209,111, 26,133,206,237,223, 6,220,186, 37, 68, - 46, 57, 71, 74,105,117,120,239,199,126, 99, 76,195, 90,234,170,101,153, 10,125, 14,182,139, 3,128,178,227, 14,113,200,102, 49, -197, 94,146, 41, 26,186, 58, 14,100, 76, 1, 54,102, 4, 50,105,239,205,107, 48,109,241, 25,226,106, 58,222, 29,225,154,236,230, -154,152, 85, 54, 88,209,177,136, 41, 60,216,218,101,137,193, 42, 24,198,232,143,175, 85,138,168,137,139, 93, 73, 6,112,183, 37, - 78,163, 2, 75,208,150,135,161,212, 82,216,153, 17,169,141,173,151,176,166,195,172,115, 50,232, 25,142,243, 42,192, 88,248, 20, -135, 67,169, 82,146, 1,214, 30,110,102,229, 6,164, 37,229,248, 15,167,153, 14, 21,167,199,131, 45,149, 41,178,218,193,232,133, - 37,208,234, 20,133, 14,138, 74,146,161,200,172,136, 53,240,131,237,106,226,159,133, 24, 84, 59, 53,218,219, 59,239,178, 52,133, -176, 33,109, 62,233,213, 42,115, 87,110, 83,210, 19,207, 27,108,183, 21,133,187, 86,176, 89, 90, 16,222, 98,161, 83,232,235, 9, -248,233, 74,207, 48,145,223, 13,254,212,238, 15,184,152,159, 78,162,209, 47,183, 54,118,249,175,188,219, 14,237, 94,249, 74,164, -218,245, 37, 92, 79,169, 49, 99, 27, 63,112,216,112, 91,183,164,105,106, 74, 80,226, 84,253, 38,123,107, 83, 14,125, 94,162,183, - 66,108,186,204,183, 48,166,102,149, 71, 62,156, 30,169,168,233, 30,174,159,105, 0, 23, 14,192, 50,168, 43,245,131, 77,196, 95, -135,248,215,135,243,244,142, 40, 42,125,147, 48, 63,251, 60,246, 73, 9, 31,170,141,253,220,164,236, 80, 35,107,102, 86, 28,176, - 93, 65,235,149, 54,227,231, 82,252, 98,143,120,111, 30, 50, 3,153, 10, 74,242,148,190,207, 95,141,149, 1,219,201, 64,160,158, -157, 92, 10, 45,120, 41, 72, 30, 42,210,211,129, 60,138, 36, 39,194, 40, 56, 9,201,199, 34, 15,194, 82,125, 71, 47, 98, 51,173, - 78, 57, 42, 4,150,225, 74, 68,136, 85, 24,204, 38, 66, 27,148,194,153, 91,140, 60,112,210,188, 53,165, 42, 92, 71, 18,144, 65, - 31, 2,199, 43,141, 41, 93, 9,204,232,245,213, 45, 41,192, 82, 28, 24, 15, 5,245, 67,125, 1,240,211,143,214, 37, 36, 97, 93, -148, 8, 56, 7, 58,212, 89, 53, 45,155,126,155,250,244,189,247,220,131,214,195,222, 7, 80, 36, 83, 0,111,109,143, 66, 55,176, -233,219,176,244,244,232,113,182,208,103, 41,109, 2,130, 8, 28,170, 10, 7, 24, 72, 25,194,155, 35,170,130,179,216, 16,115,215, - 3, 58,111, 43, 10,114,143, 57, 62, 8, 83,116,247,138,158,104, 35, 42,247, 7, 50, 75,237, 35, 36,226, 62, 87,206, 17,241, 16, - 21,132,140, 32, 1,125,182,231,180,168, 76, 58, 9, 40, 84,116,130,133, 30, 98,133, 5, 4,164,144,145,213, 29,122,131,213, 61, - 0, 36, 29, 13,118, 6,157,142,165,164,161, 74, 66,131,137, 36, 16, 75,137, 11,198, 66, 58, 1,225,133,117, 7,177,199, 76,105, -179, 52,167, 21, 20,206, 20, 94, 88,188,203,247, 14,159,247, 13,175,219, 99,141,204,138,188,229,245,233,172,222,154,164,132,144, -123,143, 71,223, 96, 84,155,244, 59,106, 94,135,127, 84,218,177, 40, 8,109, 77,171,152, 21,173,176,163,224,169, 71,153, 72,125, - 10, 73,232,160, 71, 80,122,228,147,140,224,235, 37,102,160, 10, 82,164,185,132, 45, 57, 74,215,202,149, 96,228, 37, 5, 93, 73, - 30, 65, 68,115, 96,128, 73,233,134, 98,157, 41, 13, 56, 75, 78,101, 30, 32, 41,200, 60,139,109,106, 31,174,223, 79,137, 36, 30, -189,207, 76,140,117,214, 72,221,101, 45,182,162,165, 36, 32,100,243, 41, 75, 81, 70,115,204, 0,245,193,235,219, 60,157,117, 24, -134, 67,166,254,131,225,214,223,195,240,185, 63, 9,141,122, 6,118, 85, 58,239,247, 92,246,191,191,212,255, 0,166, 51, 26,229, -207, 71,161, 82,171, 21,250,253, 86, 21, 10,222,160,210,170, 53,218,245,110,162,164,183, 78,161,208,104,176,228, 85, 43,117,153, -206, 45, 73, 9,137, 18,151, 18, 91,238,228,225, 72,142,160,158,165, 57,252,241,248,236,226,198,175,198,143, 19,187,139,190,210, -211, 34, 37,167, 54, 67, 54,134,209, 80, 36, 40,149, 91,187, 67,106, 59, 42, 29,153, 29,224, 82, 63,247, 86,123, 78,203,172, 84, - 21,128,163, 54,224,117, 10,232,210,117,219,143,110, 55, 31,168,247, 9,220, 13,237, 45,117,106,153, 60, 65,155,196,245,118,153, - 33, 73,250,186,148,129, 22,167,110,108,123, 50,218, 88,204,249,174, 8,181, 59,157,180,158,102, 99, 49, 2,144,247, 42,222,154, -216,140, 58,201, 42, 87, 55, 92,245, 24,242, 62, 93, 51,208, 99, 86, 23, 10,101,174,168,115, 74,133,179,204,161, 98, 4,110, 35, -184, 38, 79,255, 0, 83,109, 63,224, 1,129, 34, 76,115,135,139, 28, 75, 29, 69, 68,124, 51, 69, 46,168,168, 95, 93, 91, 41,184, -105,192,178, 67,126,252,133, 36,200, 55,250,214,208, 64,120,119,164,226,207, 66, 6, 58, 99, 61,253,127,110,168, 40,146, 14, 79, -145, 3,176,234,117,236,175, 32,140,119,245,254,173, 14,178, 50, 7,166,115,251, 53, 54,197, 56, 6,195,215,223,143, 26, 25,222, -163,190,112,127,103, 95,199,190,136, 80, 4, 28,249,117,233,242,208,171,236, 62,223,191, 74,170,144, 55, 30,252, 27, 3,172, 12, - 19,233,219,241, 26, 21,194,122,100, 96, 15, 50,122, 99,167,203, 68, 45, 88, 7,168,198,127, 12,119,207,207, 39,246,104, 39, 14, - 65,238,122,244,207, 92,117,243,209,240, 49, 73,194,122,158,135,167, 78,221,191,225,160,214, 70, 49,230,127,175, 85,214,124,179, -246,254,237, 12,162,115,131,131,230, 15,203, 74,168,176, 3,231,255, 0, 56, 24,164,161,156,124, 57,251,241,165,175, 42, 81, 4, -128,123,105,104,248, 61,215,161,234, 61,195, 9, 4, 17,131,140,142,223,159,183, 85, 65,193, 7,254, 56,208,233, 56, 57,252,117, - 84, 28,245,242,237,243,207,245,104, 16, 14,221,176,115,176,176,216,246,251,173,130,144,113,212,117, 31,209,147,251, 52, 64, 81, - 7, 3, 57,199, 92, 12,227,237,208,169, 35,151, 56,237,220,122,227,174,171,161, 97, 64, 96, 17,233,247, 31,233,206,144, 35,125, -251,225, 50, 15,218,181,186,127, 44, 28,217, 61,137,207, 79,219,211, 69,160,115, 4,228,115, 96,228, 12,227,183,110,191,142,129, - 66,176,164,143, 53, 1,246,117,209,136, 61,199,167, 81,162,144, 13,182,219, 5,193,232, 56,201, 61,187,103,231,233,170,157, 57, -128,201,237,219,190,122,158,195, 61,244, 58, 14, 70, 85,219,229,220,254, 78,137, 78, 6, 9,248,142, 58, 30,199,229,215, 73,176, - 32,251,176, 49, 85,178, 80, 71, 49, 24, 29,179,128,122,159,234,206,170,161,228,172,227, 5, 63, 51,208,106,130,129, 57, 36, 12, - 43,246, 12,103,250, 53,245, 33, 41, 28,169, 39,168,200, 39,169,243, 62,154,215,113,110,214,192,193, 69, 75, 80, 41, 11, 40, 72, -242, 79,235, 44,117,198, 14,142,138, 84,193, 74,208,181,165,208, 82,164,172, 44,165,214,212,133, 5,182,227,107, 79, 84, 56,149, - 0, 82, 71,108,122,116,213,184, 21,116, 32, 12, 36, 16,175, 92,121, 99,240, 58, 41, 11, 82,192,198, 50,156, 1,158,159,143,207, - 73,144, 8, 32,238, 14, 5,200, 32,131, 98, 8, 32,251,198,227,247, 28,108, 53,141,190,213,107,108,134, 43,180,182,171,204,124, - 41, 19, 35, 60,136, 85, 18,145,128, 11,205,175, 13,186,160, 60,210,164,149, 28,156, 13,108,141,181,197, 54,220, 70, 82,197, 66, -151,116,195,121, 72,202,146,221, 49,185,109,229, 32,244, 75,141, 75, 60,221,199, 95, 93,115,201, 4,164,124, 94,189,207, 82, 7, -168,253,186, 37,176, 66,144, 22, 84,164,142,169, 32,227,161,236, 8,243,244,251,245, 28,174,225,188,174,181,153,164,137,162,103, -235,203,114,160,244,191,151,117, 31,114,140, 91,121, 55,141,220,125,147,211,199, 74,107,169,243, 88,225, 80,170,107, 41,214, 89, - 52,139, 90,242,161,142, 87, 35,177,119,115,110,248,235,133,191,199,206,218,219, 45, 52,170,125,157,118,214,229, 55,146,132,186, -136,148,166,213,201,219,244,179,102,224, 18, 71,250,170, 3, 29,180,196,241, 5,199, 86,232,111,197, 1,251, 8, 50,221,147,182, -143, 56,211,211,237, 58, 60,167,100, 74,185,156,140,226, 94,138,213,215, 87, 83,109,251,229, 61,183,144,219,158,226,195,104,140, -227,141,161,111,151,249, 82,145,162, 3,148,130, 92, 5,192, 20, 20,148,231,148, 55,212,227, 4, 14,186, 61,162, 86,176,146,225, - 80, 56,228,194,113,201,219,161,207,235,116, 56,211,117, 47, 5,112,245, 21, 84,117,201, 69,207,170,132,134, 71,149,218, 77, 12, - 8, 33,149, 73,229,134, 82, 46,173,163, 82,145,169, 72, 32, 28, 53,241, 15,138,188, 97,196,116,243, 82,213, 84,195, 69, 77, 80, - 10,200,180,176, 44, 69,212,245, 83, 35, 25, 38, 10,219,134, 85,145, 85,193, 42,192,169, 32,158,135, 75,235,241, 20,165,243,156, -130,149,228,227,191,234,252,191,175, 69, 53,226, 20,169,146, 9, 42, 80, 87, 50,134, 0, 79, 79,192,118,208,142, 44, 52,130, 84, -175,137, 56,248,146, 49,143, 64,122,117,233,170,145,222, 81, 66, 66, 73,248,178, 73, 87, 82, 79,108, 12,246, 29, 53, 36, 61, 54, - 29, 62, 70, 43, 94,183, 35,123, 91,175,205,241,136,238,148, 54,166, 91, 20,250,139, 88, 47,209,166,170, 59,233, 79,254, 76,255, - 0, 80,172, 99,160,230, 39,240, 58,198,120,103,221, 57,187, 25,196,150,199,238,244, 21,134, 94,176, 55, 62,210,175,186,181, 28, - 15,112,143, 87,142,138,146, 84,113,217, 84,215,101, 39,255, 0,165,167,117,218,108,106,205, 62,177, 68, 90, 2, 93,157, 79,120, -165, 71,245, 68,134, 82, 86,218,243,228,123,254, 61,245,167, 85, 38, 11,109,188,210,135,233,152, 91,140,184,160,122,120,145,212, - 83,145,142,255, 0,171,251,117,187, 66, 18,104,170, 41, 36,251, 18,234, 83,255, 0, 68,162,196,254,253, 93,251,227, 20,149, 82, -101,249,133, 45,100, 91, 73, 4,145,202,189, 62,212,108,174, 63, 16, 49,250,180,211,238,200,245, 37, 67,171,211,156, 15,194,174, - 65,129, 89,167, 45, 4, 20,189, 10,173, 21,153,145,214,133,121,160,178,242,122,249,231,190,180,239,217, 89,188,242,168, 28,101, -113,223,195, 53, 74,165, 21,248,241,110,200, 59,151,105, 48,148, 54,212,150, 99, 85, 66, 25,171, 70, 90,211,133, 72, 8,121,198, -149,215, 37, 35, 61,129,214,138,112,241,237, 18,181,246,247,217, 85,195,199, 23, 55,221,185, 92,188, 87,110,170,222,216,155,158, -135, 70,113,168, 85, 74,133,213, 66,154,237,182,137,209,228,212, 2, 90,247, 81, 18, 12,119,150,178,172, 40, 40,165, 36,172, 99, - 92, 76,225,195,218, 43,112,108,191,180, 68,241,163, 87,137, 53,218, 13,213,121, 85, 13,251,109, 69,117, 79, 59,252, 93,220,210, - 61,214, 85, 57,148,140, 9,179,169,240, 12, 87, 90, 24,253, 35,176,207, 39, 85,140,213, 94,201, 95, 89, 89, 81, 50, 68, 88,229, - 41, 44, 77, 97,114,211,137, 33, 50, 70,130,251,177,141, 24, 11,126,210,130,124,216,234, 92,247,139,178,110, 30,135,135, 86, 26, -240,171,156,212, 69, 53, 68, 96, 18, 70, 89, 60, 14, 18, 89, 46, 45,161,102,104,166, 0, 18,247,167,107, 0, 6,255, 0,166, 5, - 42,103, 57, 65, 82,185, 64, 32,133,247,194,134, 58, 28,253,191,183, 79,189,167, 40,130,133, 15,136,130, 15, 48,207, 92,244,234, - 62,127,191, 90,215,182,213,122, 45,249,108, 90, 55,197,175, 49, 85, 11, 94,248,160,211,110, 91,114,123,145,228,195, 92,170, 77, - 82, 51,114,163, 41,232, 51, 90,109,232,174,134,220, 0,165,196, 37, 67, 29,181,181, 22,173, 32,176,218, 22,172, 0, 58,144, 15, - 48, 35,161,232, 51,211,182,149,165,204, 0,210,250,182, 96, 8, 55,216,131,107, 17,234, 8,177, 7,208,223, 12,252,106,244,209, - 69, 44, 79,229,112, 89, 74,158,160,131,165,148,142,161,131, 2, 8,234, 8, 32,216,139, 99, 84,189,166, 92, 73, 94, 92, 36,240, - 71,190, 60, 72,109,253,170,139,190,243,218,251, 81,202,181, 6,152,247, 63,185,197,151, 53,246,105,136,172, 84, 2, 7, 50,224, - 67, 84,180,200,117, 35, 4,165,140, 2,158,227,242,123,220, 13,193,188,183,102,246,187, 55, 70,255, 0,174,202,185,175,125,193, -184,106,119,117,217, 95,154,225, 92,154,165,106,179, 33, 82,165,200, 61,127, 70,202, 74,130, 26, 64,248, 91,109,180, 33, 32, 37, - 35, 95,176,103, 17, 91, 65, 79,226, 3, 96, 55,155,100,106, 73,104,195,221, 29,180,188, 44,162,167,194, 11, 49,228,215,104,147, - 33, 65,146,176,160, 71, 43, 83, 28, 97,207,145,107, 58,252,126,111,173,183,174,109,101,223,114,237,205,200,243, 14, 87,172,107, -134,183,104, 86, 21, 21,196,191, 31,235, 27,118,163, 34,153, 41,108, 62,142,143, 50,181,199, 42, 74,135,250,248,242,211,205, 11, - 23,205,103,169,168,185,146,170,158, 46, 83,159, 68,102, 90,132, 67,211,202, 69, 43,202,122,183, 50, 37, 98,121,105,106, 87, 55, - 74,198,201,233,231,141, 79,232,234, 57,204, 82, 16, 6,132,158, 85, 50, 83,153, 27,174,169, 99, 74,129, 10, 55,149, 68, 19,180, -118, 47, 41, 56, 67,100,168,171,151,155, 61, 79, 95, 60,122, 15, 61, 35,130,164,243, 43,195,200,232, 85,144,149, 30,190,103,160, -235,163,138, 10, 81,148,161, 61, 1, 57,207,196, 1,237,229,215, 58,179, 73, 73,100, 1, 32,169,109,175, 10,108,133,117, 65, 61, - 64, 35,211,190,164, 33, 71, 78,184,138, 6, 12,221,108,127,211,249, 99,203,205, 18,188,146,148,164, 30,157,114,114, 49,212,122, -121,235,227,237, 45,212, 2, 7, 84,167,184, 57,230,251,255, 0,214,210,105,196,231,225,201, 72, 78,112, 71,161,193,239,249,235, -162,163, 54,227,231, 9,229,102, 56, 25, 86,126, 37, 18, 58,142,158,154, 26, 64,223,165,177,147,211,115,112, 58,252,252,223, 22, -213, 70,117,150,146,176,201, 81, 88,230, 39, 35,152, 1,253, 61,115,159,248,104,168,146,144,231,232,202,255, 0, 85, 56, 40,229, - 0, 30,157, 78,124,245,114, 83, 5, 65, 72, 11,202,122,142,131, 4, 30,196,245,208, 41,136,220, 55, 57,130, 80,160,172,229, 74, - 5, 71, 24, 57,192, 61,188,255, 0, 13,102,195,174, 10, 13,246,245,219,231,231,243,194, 75,106, 66,138,139,202,121, 62, 73, 39, - 41, 64,244,249,235,195,175,165, 29, 16,164,129,215, 3,176, 10,244,237,242, 58, 13,247, 86, 20,162,210,241,205,219, 9,199, 76, -118, 57,252,252,244, 57,121,183, 22, 18,162,114, 8, 46, 36,167,166,122, 30,132,122,147,160, 1, 61,122,224,218,109,176, 59,124, -252,244,193, 73, 62, 42,249,210,160,160, 6, 10, 58, 4,243,117,237,215,174,169,202,116,144,148,163, 9, 35, 41,232,112, 73, 35, - 26,244,226,149,225, 44, 52,218, 83,202, 50, 6,112, 73, 3,166, 20, 60,186,106,200, 38, 56, 22,159, 25, 41, 42, 74,136,229, 35, - 39,237,230, 7, 25, 25,253,154,205,172, 79, 99,140,129,115,240,254,120,124,184,115,189,156,218,173,243,217,253,196,140,226,154, -114,201,221, 29,189,186,157,144, 2, 28, 76,104,148, 91,202,137, 62,170,234,144,226,146, 10, 19, 71,106,164, 78, 72,192,235,229, -214, 89,252, 84, 79,135, 38,165, 91,167, 64,144,125,222, 21, 90, 83,212,194, 9,203,148,103,102,202,149, 75,147, 29,226,231,198, -199,134,165,180, 86,174, 83,250, 48, 82,145,204,117, 12,134, 36, 32, 58, 89,144,219,141, 68,148, 28, 97,215, 25,112,135,124, 41, - 13,150, 30, 13,148,156,182,191, 13,197,224,142,160,224,143, 93, 73,106,193,222, 9,123,221,195,158,213,110, 37, 84, 5,220,177, -173,145, 99,221,170, 9, 90, 82,245,211, 97, 33,139, 66,186,235,106,113, 41, 18, 89,144,221, 38,151, 80,109,206,169,241,170, 79, - 3,133,165, 68,213,126, 32,229,133,243, 12,131, 53, 81,228,136,205, 3,157,175,169,213, 36,139,223,107, 71, 40,244, 5,135, 82, -109,142,146,250, 55,230, 49,199,158,230,217, 92,205,165,166,142, 42,152,199,111,171, 99, 12,173,241,188,212,235,255, 0,117,239, -229,177,215, 10, 45,116,211,119, 43,112,233,170, 37,182,230, 76,183, 43,177, 16, 48, 67,141,212,104,203,167, 84, 84,210, 85,250, -200,247,186, 39, 42,135, 76,169,127, 17,201, 25,126, 41,181,229, 37, 94,246,130,227,139, 83, 98,158,134,210,180,160,134,139,132, -169, 8,228,234, 57,157, 60,196,119, 33,160, 58, 3,173, 54,220,106,162,232,187,147, 64,173, 32,128,221,114,157, 86,182,101,168, - 2,112,236, 98,110, 58, 71, 42, 0,200, 82,156,139, 85,108,168, 12, 37, 47, 14, 99,215, 89,237, 42,241,122, 42, 89,121,149,120, -143, 68,240,228, 71, 67,193, 97, 42,112, 20,248,104, 82,146, 14, 81,149, 36, 43, 61,130,149,202, 79, 77, 54,154, 98,201, 79, 48, - 93,157, 23,215,245, 64,140,254,242,183,247, 3,113,214,216,234,185,107, 85, 90,190,153,200,103,134, 73, 8,185,181,196,141,207, - 0,122,217, 95, 77,199,166, 54, 18,161, 94,151, 79,143,238,201, 90,156, 74, 11,144,195, 67, 45,167,222,100,242,185, 41,107, 79, - 47, 68,161,128,211, 94, 17, 4,143,139,237,214, 33, 94,188,163, 65,166, 48,194, 95, 91,117, 54,202,144,132, 54,165,128,183, 95, -199,188,184,162,159,133, 33, 12,114, 39, 3,184,113, 99, 62, 90,108,110,125,200,155, 57,192,243,237, 54,135, 98, 37, 65,105,104, -184, 83, 38, 67,170, 74,157,117,106, 82, 65,231, 43, 42, 36,158,164, 28,103,182,152, 91,179,113, 22,203, 82, 31,144,227,141,177, - 29,133, 60,243,188,138,117,126, 27,202,229, 79,134,132,140,173,213,186,224, 64,230, 35, 28,249, 82,146,156,168,109, 83, 80,180, -133, 70,155,131,247,250, 91,173,253,215,233,123,143,190, 31,153,230, 40,116,234, 94, 76,155, 11, 13,199,112,250,136, 0, 48,181, -193, 30,164,142,215, 14, 21,209,121,205, 91,172,198,128, 37,214, 37,203,151, 18,147, 71,162, 69, 74,158,159, 91,173, 84, 31, 76, - 74, 61, 38, 10, 82, 57,149, 46, 76,199,210,132, 36,116, 79,141,204,122, 13, 72,111,103,182,153,253,140,217, 59, 59,105,234,166, - 43,245,214, 40,146,102,238, 75,165,136,243,169,213, 75,230,241,120, 86, 47, 54, 36,211,230,178,227, 21, 26, 75, 53, 55, 26,167, - 24,207,180,236,119, 35,210, 16, 22,218,146,117, 21, 91, 99,137, 58,134,192,111, 54,211,110, 76,122, 84, 42,181,197,100,221,246, -174,224,205,167, 84,216, 19,169,212,123, 66, 37, 89, 42,151, 77, 97,181, 39,195,159,114, 79,128,212,245,169,240, 22,212,111,116, -105, 13,225, 69, 58,152,173,218,236, 42,179,108, 87,233, 14,186,253, 46,181, 6,157,112, 82, 30,120, 56,211,238,209,110, 10,124, -106,204, 5, 62,219,128, 41, 18, 61,194,107, 60,193, 64, 44, 45, 4, 30,186,117,106,119,163, 48,188,177,253, 92,232,116, 31,218, -177, 26,182, 29, 0, 5,108,118, 44, 24,145,181,142, 35,114,231,116, 85,239,152,101,148,181,162, 92,195, 43,146, 35, 87, 18,135, -188, 13, 42, 22,128, 23, 42, 35, 98, 66,200, 24, 35, 57,137,208,164,161, 30,202,120, 41,197,183,177,147, 96, 55,194,117, 82,245, -225,250,163, 11,134,125,197,158,169, 14,206,182,216,166, 75,169,236, 93,114,190,156,248,141,189,108,196, 90,166,237,169,121,196, -181,250,106, 40,147, 79, 30, 49,116, 81,219, 78,117, 26, 30, 33,248, 90,223,142, 22,238, 53, 90,251,235,183, 21, 75, 77,169,146, -228, 66,162, 92,232, 13, 87,118,250,239,240, 22,241, 75,150,189,233, 78, 11,167,214, 10,153, 99,198, 17,203,141,204,109,181,161, - 79, 69,104,144, 53, 62, 58,210, 27,142,235,239, 21,135, 25, 12,160, 78,108, 32,130, 2, 20,150,218,156,215,108, 60,148,173, 41, - 88, 7, 42, 65, 24, 28,201, 25,193,174,203,122,131,116,219,213,139,110,241,182,232, 55,173,161,112, 70, 84, 43,170,207,186,169, - 84,234,253,183,113,211,152,109, 97, 46, 84,104,245, 86, 28,142,237, 70, 59, 5,226,196,128,132,200, 66, 22,182,154,125,146, 80, -180,201,178,222, 38,170,167,211, 29, 71,246,200, 86,223,104,218, 69, 29, 1, 87,177,189,186,233, 96,214, 30, 85, 40, 0, 56,170, -184,143,195,156,143, 60, 18, 84, 69, 23,232,156,193,247, 18,194,160, 70,237,183,247,176,221, 84,146, 79,219, 83, 27,110, 29,203, -146,109, 13, 30, 23, 61,163, 28,100,240,219, 38,149,107,237,182,228, 73,189,236,148, 58,150,218,218, 61,216, 67,151,221,136,166, -144,210, 25,240, 41, 6,169, 45, 53, 11, 53, 66, 58, 57, 80,186, 76,248, 97,190, 98,160,218,142,164,109,178,158,214,237,167,175, - 65,161,127, 41,109,181,191,248, 74,174, 85,212,196, 72,247,141,118,159, 86,189,184,118,184, 38, 56,243,200, 67, 20,205,205,163, - 65, 92,187,103,244,108,243,134, 42,113, 37,120, 42,121, 41,114,160, 80, 84,117,167,220, 73,251, 19,182,242,247,150,245,217,194, - 29,220,173,162,186,165, 45,185,180,237,176,187,166,214,235, 27,115, 85,154,242,203,141, 53,105,221,169,247,138,213,131, 33,111, - 58, 60, 24,243, 19, 85,132,218, 80, 19,227,198, 71,195,173, 7,218,190, 57,120,161,246,121,238,117,107,135, 46, 42, 54,246,212, -222,125,182, 66,215, 76,220,221,149,190,133,155,115,191, 81,182,165,170, 84, 41, 82,173,155,198,146,212,216, 50,159,240,155,121, -200,241,235, 44, 76, 97,206, 80,135,152,140,178,151, 90,121,170,146, 44,222, 17, 46, 79, 77, 21,101, 90,144,210, 68,210, 26, 90, -141, 23, 26,157, 24, 36,177, 72,226,224,221,193, 66, 60,166,100, 39,106,230,105,184,247,129,158, 20,172,144,102, 25, 56, 96,130, - 73, 11, 77, 13,172, 72, 85,114, 4,208,176, 63,238,220,198, 0, 12,193, 90,219,205,107,111, 55, 22,222,185,109,106, 77,203,105, - 92,212, 27,170,209,172,183,227,209, 46,123, 90,179, 79,185, 45,186,219, 47,160, 44, 55, 78,175, 80,230, 63, 25,215,130, 20, 20, -227, 72,116,188,206, 64,121,180, 19,141,103,175, 87,204,134,148,133, 47,152,148,124, 42, 90,135, 81,202, 0, 79, 42,142, 57,128, -233,159,246, 64, 39, 57, 58,138, 47, 16, 27, 71,120,112, 95, 98,211, 61,164, 94,203, 13,207,174,217,124, 50,238, 29,187,102,110, - 70,229,240,243,119,189, 42, 85,155, 77,162,222,245, 72, 16, 41,117, 22,108,155,169,231, 90,184,109, 7,235, 46,162,151, 58,152, -243,203,175,208,101,130,245, 6,171, 58,144, 89,145, 18, 68,155, 3,127,214,247,155, 98,118,115,120,231, 91,109, 90,114,247, 99, -108,236,173,194,145,108,177, 83, 77, 90, 45,188,253,219, 67,139, 87,122,147, 14,164,243,190, 44,248, 45,185, 37, 98, 59,143,101, -242,194,155, 18, 15,188, 7, 73,143,214,196, 35,167,138,170, 9,185,212,211, 51, 37,153,116, 75, 28,128, 41, 49, 75, 29,205,152, - 95,170,150, 83,177,218,235,123, 43,134,115,213,207,218, 72,189,141,233,170,169,213, 93,148,221,209,145,142,149,120,220, 40,189, -200,177, 4, 41, 27, 0, 8,185,198,215,109,149, 22, 37,219,112, 75,167, 73,165, 92, 21,191,118,183,110, 26,195, 20,107, 85,228, - 68,174, 84,165, 82,105,206,202, 98, 44, 87, 92,162,212, 48,165, 45,180,169,192,152,142,168,161, 4, 36, 36,229, 99, 64, 56,226, -223, 77,219,218,203, 74,243,176,184,111,131,100,212,184,131,106,210,106,188,182,174,237,198,176,104,236,108,117, 26,191,107,238, - 45,231, 67,159,114, 83,238, 42,188, 53,220, 59,203, 46,201,218,125,206,169,219, 54,146, 99,166,100,164,216,146,234, 18,227,161, - 2,157, 2,167,204, 14, 62, 61,170,123,199,195,134,245,239, 23, 13,187,105,102,194,182,165, 83,246,238,171,105, 84,183, 81, 53, -244,170,245,137, 87,220,107, 45,183,233,117,187, 54, 41,166, 73,133, 64,143, 76,250,217,135,130,156, 67,211,229, 61, 20,165, 50, - 32,160,164,235,150,155,127,199,229, 2,218,166,220, 17, 47,141,155,184,239,201,213, 27, 39,106,105,180,122,212,125,229,250,134, -170,214,227,109, 78,199,111,230,200, 68,190,174,249,149,109,181,172,187,121, 82,106, 16, 56,129,184, 42,147, 41, 97,218,124,229, - 79,183,224, 36,215,213, 28,203,110, 70,206, 69,195,144, 85, 69, 5, 70, 98,154,105,203, 23, 84, 82, 9,145, 88, 2,188,203, 43, - 29, 22,223, 64,107,155,217,130, 11,134,211,227, 63, 18,206, 91, 83, 89,150,100, 83,153,115, 5, 2, 9,166,100,112, 41,101, 77, - 75, 50,195,172,141, 83, 43,150, 83, 39, 47, 66,149,186, 60,183, 82,141,110,225,240, 39,196,221,155, 81,191,231,222,141, 89,213, - 55,237, 88,247,245,205,127,221,171,222,173,181,185, 61,226,240,182,175, 86,237, 91,186,211,159, 89, 98,236,113,202,246,245, 75, -190,106,209,152,110,218,100, 61,112, 84, 36,212, 28, 91, 16, 22,220,105,170,139,127,159,236,242,222,186, 77, 26,239,166, 87,232, -112,233,215,213,183,115, 90,106,118,188, 55, 27,106, 92,217,154, 61,128,237, 3,137,199,119, 10,177,114,223, 77,221,139, 75, 53, -122, 53,223,195, 53,253, 73,112, 71,241, 98,181, 54,200,172, 83,221,113,115,223,163, 51, 57,230,147,199, 5,183,187,182,199, 20, -139,188,118,233,203, 98,159, 84,186,183,115,137, 91, 34, 52, 27,238, 84,170,188, 61,236,220, 94, 32, 44,203,171,108, 40,237, 75, -107,110, 95,141, 88,160, 80,145, 95,186, 77, 97,137,205, 83, 25,174,211,162,188, 99, 84, 40,149, 52, 64,143, 46,157, 75,218, 83, -101, 77,186,105, 19,162,236, 45,249,108,218, 84, 43,254,198,220, 58,109, 34,211,226, 14,155, 2,237, 19,173,203,215,141, 77,199, -186,173,217,247,125, 99, 98,170, 16,170,182,125,110,232,227, 78,236,167,187, 2, 77, 5,212,166,211,181,219,161, 84, 87, 88,151, - 81,153, 91, 22, 42,173, 58,216, 2, 66,109,243,176,249,247,227,159,188,172,197,153,181, 23,220,146, 73, 36,158,189,183, 55,238, -119,191, 83,134, 79,133, 94, 26, 54,163,119, 40, 23,245, 15,114,220,191,142,226,213, 56,139,225,227,133,189,165,172,237,181,249, - 97,155, 30,221,191,119,242,131,196, 96,167, 93,151,172, 39,236,250,202, 55, 62,208,102,241,218,107, 53,128,138, 37,126,130,149, - 83,107, 53, 9,204, 84,230, 17, 17,189, 55,212,190, 3,248,146,172,211,160,212,169,214,189,181, 33,186,142,219,211,247, 54, 44, - 95,227, 14,196,106,162,186,125, 98,181,178,180, 58, 45,166,105,207, 92, 9,120,110,100,217, 28, 70,108,107,177,109,190, 79,173, -221, 99,115, 41,203, 76, 94, 97, 37, 17,242,109,137,226,246,211,217,104,251,163, 81,127,101, 62,187,186,171,187,235,180,188, 70, -108,210,237,235,249, 22, 93,137,180,219,153,179, 84,221,245,137,101, 55, 93,179, 23, 99,212,230,110, 13,155, 14,126,244, 71,153, - 30,155, 22,183,110, 58,135, 44,136,172,191, 58, 84,105, 79,178,151,218, 87,181, 90,244, 52,109,183, 49,108, 26,164,171,191,110, - 45, 11, 30,153, 2,181,115,110, 83,149,219, 97,171,198,196,221, 46, 9,183, 14, 21,126,223,177, 98,217, 80,152,183,109,137, 17, -184, 39,182,216,149, 73,247,169,115, 94,157,126,212, 38,174,188,170,109, 62,145, 66,136,100, 17, 21, 93, 71,204, 47,211,227,220, -219,115,111,195,225,108, 1,107, 11,252,252,239,134,106, 63,179,199,115,133,155,125,215,171,187,135,179,118,237,197,106,110,150, -201,109,205, 10,223,153,185,246, 52,250, 21,249, 15,122,172, 61,215,189,169, 23, 85,173,123,210,110, 87,226, 85,161,161,221,180, - 69, 50, 35, 16,154,153,245,133, 70,101, 86, 39,143, 18,101,191, 50, 43,173, 61,131,193, 94,250,238,142,241,110, 54,200, 89,144, -172,105,247,150,215, 94, 63,197,253,209, 54,126,230, 88,150,253,156,245,230,245,238,157,187,165, 91,118,205,231,112, 87,162,211, -175, 26,213, 74,234, 15,179, 73,139, 75,126, 92,138,179, 48,164, 75,167,183, 38, 43, 46, 58,157,172,107,218, 71,106,187,184,205, - 93,151, 6,202,110, 37,197,110,209,175, 29,134,190,172,246, 39,241, 13, 5,253,203,160, 93, 60, 62,109,135, 18,118,213,139,112, - 73,220, 10,142,200, 73,165, 84,170,177,119, 63,136, 8, 23, 60, 70,218,180,225,210,217,143,182,241, 40,114,169,117, 3, 80,155, - 86, 12, 7, 9,252, 89,216,124, 52,223,247, 21,199, 92,217,203,159,115,109, 71,183, 27,106,119, 94,200,183,218,221,216, 86, 93, -205,110,222, 91, 37,184,134,249,219,247, 46, 91,196,109, 93, 86, 53,227, 71, 49,101, 84,161,213,227,179, 69,164, 59, 61,217, 13, - 76,139, 38,154,150, 85, 17,245,109, 21,212, 94,194,230,253,122,118,237,252, 63,118, 51,229,219,231,249, 97,202,188, 61,155,155, -199,118,239,117,185,183,155, 45,111,219, 48,169,151,253,165,181,247, 29,144,197,255, 0,186, 86, 69,154,185,177,175,167, 54,191, -110,233, 53, 41,149, 43,218,189, 9,184,108,215,247,190,249,155, 69,160, 50,234,210,253, 65,250, 53, 77,200,172, 42,159, 74,151, - 45,166,227,134, 30, 29,118,127,120,246,186,191, 46,244, 59,148,198,229, 93, 91,162,198,209,109, 69, 98,214,187, 45,122, 85,145, -109,220,147, 54,155,112,111,218, 69, 66,255, 0,180,170,251,125, 80,157,121, 82,101,220,150,181, 18,154,240,167,215,104, 46, 83, -162, 85, 36,212, 19,245,147,172, 55, 5,237,158,182,189,170,118,111,241,175,183,251,177,186, 92, 50,213, 47,138,213,133, 67,216, - 27,113, 74,181,183,186, 14,223, 84,174,122, 47, 11,119,174,202,223, 59, 29, 14,226,170,191,178,245,148,204,114,158,230,219,222, - 52, 89,210, 61,212, 74,157,109,221,244, 74,100,119,233,207,218,140,207,171,105,175, 15, 60, 86,219, 59, 19,183, 23, 37,185, 55, -107, 42,215,157,246,197,244,141,202,218,155,189,189,196,135,110,218,246, 85,232,222,219,222,187,117, 26,163,120, 88,142,109,229, - 70, 70,225, 69,136,139,192, 85, 33, 71,143, 94,160, 33, 53, 10, 36,116,205, 53, 8, 43,126, 27,135, 2, 45, 74,111,229,107,222, -224,251,173,219,227,235,252,241,159, 47, 99,243,255, 0,140,109,229,209,192, 61,139, 67,254, 54, 13, 55,134, 30, 56,238,159,226, -247,134,189,165,221,155, 88, 82,239, 26, 58,127,141, 58,134,224, 29,184,254, 17,110,133,181,238,252, 37, 74,228,217,202, 39,240, -190,165,239, 17, 99,253,100,191,208, 49,227,221, 17,185, 92,241,117, 46,135,178,187, 35, 81, 28, 31,213, 31,183,183,186,171, 31, -122,172,157,204, 93,241,102,218,215,157,151, 58,233,188,119, 54,204,184,111, 91, 90,206,160,237,157, 94,102,218, 53, 31,110,232, - 55, 5,201, 73,181, 97, 62,229, 82, 21,212,253, 17,170,156,202,136, 53,143, 5,170,122,233,238,255, 0, 21,182, 21,251, 73,221, - 38,109, 61,163,187,173, 42,230,243,109,206,204,217,215,189, 66,226,221,186, 53,235, 74,102,187,180, 15, 88,202,106,225,181, 40, -212,205,160,161, 61, 71,164,207,141,102,114, 42,155, 50,125, 77,232,203,169,120,130,166,250, 89,240,157,111,237,173,252,177, 83, - 70,217,139, 67,114,246,121,205,192,178,182,194,199,221,235, 38,179, 78,133,124, 51,107,215,171,138,221, 10,189,205, 93,167, 93, - 54,173,114, 93,149, 85,143,101, 93, 20, 42,173,118, 11,240,157,147, 78,174, 70,121,218, 70, 95,139,225,190, 91,109, 66, 82,230, -223, 59,143,119,166, 50, 8,184, 3,231,127,135,166, 49, 78, 42,118,162,139,177,156, 68,238,246,208, 80, 63,132, 77, 83,182,246, -242,168, 91, 74,166, 93,239, 65,153,117,219,117, 40, 41,100, 86,172,219,150,169, 75,166,194,137, 94,175, 81, 43, 42,159, 72,151, - 83,133, 10, 28, 42,156,138, 35,149, 8, 81, 34,197,146,211, 13,173, 88,184,129,221,147,190, 91,193,122,238,130, 40, 10,181,162, - 92,146,233,172,210,109,231,107, 47, 92,147, 40,244, 11,118,135, 75,181,237,216, 53, 75,142, 68, 40,170,184,107, 72,161, 81,105, -222,253, 60, 68,134,137,147, 11,242, 90,133, 13,183, 81, 21,165,172, 21, 55, 58, 70,221,186,116,193,180,169,223,215, 31,255,217, -}; - diff --git a/source/blender/src/swapbuffers.c b/source/blender/src/swapbuffers.c deleted file mode 100644 index cad8d86e677..00000000000 --- a/source/blender/src/swapbuffers.c +++ /dev/null @@ -1,289 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - -/* HRMS!!... blender has its own swapbuffers method. for sgi only that worked pretty nice. - * but with porting to linux and win, with mesa and opengl variations, it all grow - * out of control. - * with the introduction of Ghost (2002) we really should bring this back to a single - * method again. (ton) - */ - - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "DNA_space_types.h" -#include "DNA_screen_types.h" - -#include "BKE_global.h" - -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_mywindow.h" -#include "BIF_screen.h" -#include "BIF_space.h" - -#include "winlay.h" - -#if 0 -static void copy_back_to_front(void) -{ - int actually_swap= 0; - int winx, winy; - char *data; - - winlay_get_winsize(&winx, &winy); - - if (actually_swap) { - data= MEM_mallocN(4*winx*winy, "swap"); - glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data); - } - - mywinset(1); - glRasterPos2f(-0.5,-0.5); - glReadBuffer(GL_BACK); - glDrawBuffer(GL_FRONT); - glCopyPixels(0, 0, winx, winy, GL_COLOR); - glDrawBuffer(GL_BACK); - glFlush(); - - if (actually_swap) { - glRasterPos2f(-0.5,-0.5); - glDrawPixels(winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data); - glFlush(); - MEM_freeN(data); - } -} -#endif - -static void screen_swapbuffers_REDRAW(bScreen *sc) -{ - ScrArea *sa; - int doswap= 0, swap; - - /* a new implementation: only using redraws and a normal swapbuffer */ - - /* all areas front ok? */ - sa= sc->areabase.first; - while(sa) { - if(sa->win && (sa->win_swap & WIN_FRONT_OK)==0) break; - if(sa->headertype==0) sa->head_swap= WIN_EQUAL; - if((sa->head_swap & WIN_FRONT_OK)==0) break; - sa= sa->next; - } - if(sa==0) return; - - sa= sc->areabase.first; - while(sa) { - swap= sa->win_swap; - if( (swap & WIN_BACK_OK) == 0) { - scrarea_do_windraw(sa); - - doswap= 1; - sa->win_swap= swap | WIN_BACK_OK; - } - else if( sa->win_swap==WIN_BACK_OK) doswap= 1; - - swap= sa->head_swap; - if( (swap & WIN_BACK_OK) == 0) { - if (sa->headertype) scrarea_do_headdraw(sa); - doswap= 1; - sa->head_swap = swap | WIN_BACK_OK; - } - else if( sa->head_swap==WIN_BACK_OK) doswap= 1; - - sa= sa->next; - } - - /* the whole backbuffer should now be ok */ - if(doswap) { - myswapbuffers(); - } -} - -#include "BMF_Api.h" -#include - -static void draw_debug_win(int win) -{ - static int drawcounter= 0; - char buf[64]; - int x, y; - int w, h; - - bwin_getsuborigin(win, &x, &y); - bwin_getsize(win, &w, &h); - - mywinset(win); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, w, 0, h, -1, 1); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - glColor3f(0.8, 0.8, 0.8); - glRecti(0, 0, w, h); - - glColor3f(0.6, 0.6, 0.6); - glRecti(2, 2, w-4, h-4); - - glColor3ub(0, 0, 0); - glRasterPos2i(5, 5); - - sprintf(buf, "win: %d - (%d, %d, %d, %d) %d\n", win, x, y, w, h, drawcounter++); - BMF_DrawString(G.font, buf); -} - -static void screen_swapbuffers_DEBUG(bScreen *sc) -{ - ScrArea *sa; - - for (sa= sc->areabase.first; sa; sa= sa->next) { - draw_debug_win(sa->win); - if (sa->headwin) draw_debug_win(sa->headwin); - } - - myswapbuffers(); -} - -static void screen_swapbuffers_DEBUG_SWAP(bScreen *sc) -{ - ScrArea *sa; - int doswap= 0, swap; - - /* a new implementation: only using redraws and a normal swapbuffer */ - - /* all areas front ok? */ - sa= sc->areabase.first; - while(sa) { - if(sa->win && (sa->win_swap & WIN_FRONT_OK)==0) break; - if(!sa->headertype) sa->head_swap= WIN_EQUAL; - if((sa->head_swap & WIN_FRONT_OK)==0) break; - sa= sa->next; - } - if(sa==0) return; - - sa= sc->areabase.first; - while(sa) { - - swap= sa->win_swap; - if( (swap & WIN_BACK_OK) == 0) { - scrarea_do_windraw(sa); - draw_debug_win(sa->win); - - doswap= 1; - sa->win_swap= swap | WIN_BACK_OK; - } - else if( sa->win_swap==WIN_BACK_OK) doswap= 1; - - swap= sa->head_swap; - if( (swap & WIN_BACK_OK) == 0) { - if (sa->headertype) { - scrarea_do_headdraw(sa); - draw_debug_win(sa->headwin); - } - doswap= 1; - sa->head_swap = swap | WIN_BACK_OK; - } - else if( sa->head_swap==WIN_BACK_OK) doswap= 1; - - sa= sa->next; - } - - if(doswap) { - myswapbuffers(); - } -} - -static void screen_swapbuffers_SIMPLE(bScreen *sc) -{ - ScrArea *sa; - - mywinset(1); - glClearColor(0.8, 0.6, 0.7, 1.0); - glClear(GL_COLOR_BUFFER_BIT); - - for (sa= sc->areabase.first; sa; sa= sa->next) { - scrarea_do_windraw(sa); - if (sa->headertype) scrarea_do_headdraw(sa); - } - - myswapbuffers(); -} - -static int drawmode_default= 'r'; -int debug_swapbuffers_override= 0; - -void set_debug_swapbuffers_ovveride(bScreen *sc, int mode) -{ - ScrArea *sa; - for (sa= sc->areabase.first; sa; sa= sa->next) { - sa->win_swap= 0; - sa->head_swap= 0; - } - debug_swapbuffers_override= mode; -} - -void screen_swapbuffers(void) -{ - ScrArea *tempsa; - - bScreen *sc= G.curscreen; - int drawmode; - - if (debug_swapbuffers_override) { - drawmode= debug_swapbuffers_override; - } else { - drawmode= drawmode_default; - } - - tempsa= curarea; - areawinset(1); - - if (drawmode=='s') { - screen_swapbuffers_SIMPLE(sc); - } else if (drawmode=='d') { - screen_swapbuffers_DEBUG(sc); - } else if (drawmode=='f') { - screen_swapbuffers_DEBUG_SWAP(sc); - } else { - screen_swapbuffers_REDRAW(sc); - } - - areawinset(tempsa->win); -} diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c deleted file mode 100644 index 53bbfb3fb69..00000000000 --- a/source/blender/src/toets.c +++ /dev/null @@ -1,983 +0,0 @@ -/** - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - - * - * - * General blender hot keys (toets = dutch), special hotkeys are in space.c - * - */ - -#include -#include - -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif - -#include "MEM_guardedalloc.h" - -#include "PIL_time.h" - -#include "nla.h" /* Only for the #ifdef flag - To be removed later */ - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_blender.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_ipo.h" -#include "BKE_key.h" -#include "BKE_scene.h" -#include "BKE_utildefines.h" - -#include "BIF_butspace.h" -#include "BIF_editseq.h" -#include "BIF_editsound.h" -#include "BIF_editmesh.h" -#include "BIF_imasel.h" -#include "BIF_editparticle.h" -#include "BIF_interface.h" -#include "BKE_object.h" -#include "BIF_poseobject.h" -#include "BIF_previewrender.h" -#include "BIF_renderwin.h" -#include "BIF_retopo.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toets.h" -#include "BIF_toolbox.h" -#include "BIF_usiblender.h" -#include "BIF_writeimage.h" - -#include "BDR_sculptmode.h" -#include "BDR_vpaint.h" -#include "BDR_editobject.h" -#include "BDR_editface.h" - -#include "BSE_filesel.h" /* For activate_fileselect */ -#include "BSE_drawview.h" /* For play_anim */ -#include "BSE_view.h" -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_headerbuttons.h" -#include "BSE_seqaudio.h" - -#include "blendef.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "mydevice.h" - -#include "BIF_poseobject.h" - -#define VIEW_ZOOM_OUT_FACTOR (1.15f) -#define VIEW_ZOOM_IN_FACTOR (1.0f/VIEW_ZOOM_OUT_FACTOR) - -/* ------------------------------------------------------------------------- */ - -static int is_an_active_object(void *ob) { - Base *base; - - for (base= FIRSTBASE; base; base= base->next) - if (base->object == ob) - return 1; - - return 0; -} - -/* run when pressing 1,3 or 7 */ -static void axis_set_view(float q1, float q2, float q3, float q4, short view, int perspo) -{ - float new_quat[4]; - new_quat[0]= q1; new_quat[1]= q2; - new_quat[2]= q3; new_quat[3]= q4; - G.vd->view=0; - - if (G.vd->persp==2 && G.vd->camera) { - /* Is this switching from a camera view ? */ - float orig_ofs[3]; - float orig_lens= G.vd->lens; - VECCOPY(orig_ofs, G.vd->ofs); - view_settings_from_ob(G.vd->camera, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens); - - if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; - else if(G.vd->persp>=2) G.vd->persp= perspo; - - smooth_view(G.vd, orig_ofs, new_quat, NULL, &orig_lens); - } else { - - if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; - else if(G.vd->persp>=2) G.vd->persp= perspo; - - smooth_view(G.vd, NULL, new_quat, NULL, NULL); - } - G.vd->view= view; -} - -void persptoetsen(unsigned short event) -{ - static Object *oldcamera=0; - float phi, si, q1[4], vec[3]; - static int perspo=1; - int preview3d_event= 1; - short mouseloc[2]; - - float new_dist, orig_ofs[3]; - - /* Use this to test if we started out with a camera */ - Object *act_cam_orig=NULL; - if (G.vd->persp == 2) - act_cam_orig = G.vd->camera; - - if(event==PADENTER) { - if (G.qual == LR_SHIFTKEY) { - view3d_set_1_to_1_viewborder(G.vd); - } else { - if (G.vd->persp==2) { - G.vd->camzoom= 0; - } else { - new_dist = 10.0; - smooth_view(G.vd, NULL, NULL, &new_dist, NULL); - } - } - } - else if((G.qual & (LR_SHIFTKEY | LR_CTRLKEY)) && (event != PAD0)) { - - /* Indicate that this view is inverted, - * but only if it actually _was_ inverted (jobbe) */ - if (event==PAD7 || event == PAD1 || event == PAD3) - G.vd->flag2 |= V3D_OPP_DIRECTION_NAME; - - if(event==PAD0) { - /* G.vd->persp= 3; */ - } - else if(event==PAD7) { - axis_set_view(0.0, -1.0, 0.0, 0.0, 7, perspo); - } - else if(event==PAD1) { - axis_set_view(0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0), 1, perspo); - } - else if(event==PAD3) { - axis_set_view(0.5, -0.5, 0.5, 0.5, 3, perspo); - } - else if(event==PADMINUS) { - /* this min and max is also in viewmove() */ - if(G.vd->persp==2) { - G.vd->camzoom-= 10; - if(G.vd->camzoom<-30) G.vd->camzoom= -30; - } - else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f; - } - else if(event==PADPLUSKEY) { - if(G.vd->persp==2) { - G.vd->camzoom+= 10; - if(G.vd->camzoom>300) G.vd->camzoom= 300; - } - else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f; - } - else { - - initgrabz(0.0, 0.0, 0.0); - - if(event==PAD6) window_to_3d(vec, -32, 0); - else if(event==PAD4) window_to_3d(vec, 32, 0); - else if(event==PAD8) window_to_3d(vec, 0, -25); - else if(event==PAD2) window_to_3d(vec, 0, 25); - G.vd->ofs[0]+= vec[0]; - G.vd->ofs[1]+= vec[1]; - G.vd->ofs[2]+= vec[2]; - } - } - else { - /* Indicate that this view is not inverted. - * Don't do this for PADMINUS/PADPLUSKEY, though. (jobbe)*/ - if (event != PADMINUS && event != PADPLUSKEY) - G.vd->flag2 &= ~V3D_OPP_DIRECTION_NAME; - - - if(event==PAD7) { - axis_set_view(1.0, 0.0, 0.0, 0.0, 7, perspo); - } - else if(event==PAD1) { - axis_set_view((float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0, 1, perspo); - } - else if(event==PAD3) { - axis_set_view(0.5, -0.5, -0.5, -0.5, 3, perspo); - } - else if(event==PADMINUS) { - /* this min and max is also in viewmove() */ - if(G.vd->persp==2) { - G.vd->camzoom= MAX2(-30, G.vd->camzoom-5); - } - else if(G.vd->dist<10.0*G.vd->far) { - getmouseco_areawin(mouseloc); - view_zoom_mouseloc(VIEW_ZOOM_OUT_FACTOR, mouseloc); - } - if(G.vd->persp!=1) preview3d_event= 0; - } - else if(event==PADPLUSKEY) { - if(G.vd->persp==2) { - G.vd->camzoom= MIN2(300, G.vd->camzoom+5); - } - else if(G.vd->dist> 0.001*G.vd->grid) { - getmouseco_areawin(mouseloc); - view_zoom_mouseloc(VIEW_ZOOM_IN_FACTOR, mouseloc); - } - if(G.vd->persp!=1) preview3d_event= 0; - } - else if(event==PAD5) { - if (U.smooth_viewtx) { - if(G.vd->persp==1) { G.vd->persp=0; - } else if (act_cam_orig) { - /* were from a camera view */ - float orig_dist= G.vd->dist; - float orig_lens= G.vd->lens; - VECCOPY(orig_ofs, G.vd->ofs); - - G.vd->persp=1; - G.vd->dist= 0.0; - - view_settings_from_ob(act_cam_orig, G.vd->ofs, NULL, NULL, &G.vd->lens); - - smooth_view(G.vd, orig_ofs, NULL, &orig_dist, &orig_lens); - - } else { - G.vd->persp=1; - } - } else { - if(G.vd->persp==1) G.vd->persp=0; - else G.vd->persp=1; - } - } - else if(event==PAD0) { - if(G.qual==LR_ALTKEY) { - if(oldcamera && is_an_active_object(oldcamera)) { - G.vd->camera= oldcamera; - } - handle_view3d_lock(); - } - else if(BASACT) { - /* check both G.vd as G.scene cameras */ - if(G.qual==LR_CTRLKEY) { - if(G.vd->camera != OBACT || G.scene->camera != OBACT) { - if(G.vd->camera && G.vd->camera->type==OB_CAMERA) - oldcamera= G.vd->camera; - - G.vd->camera= OBACT; - handle_view3d_lock(); - } - } - else if((G.vd->camera==NULL || G.scene->camera==NULL) && OBACT->type==OB_CAMERA) { - G.vd->camera= OBACT; - handle_view3d_lock(); - } - } - if(G.vd->camera==0) { - G.vd->camera= scene_find_camera(G.scene); - handle_view3d_lock(); - } - - if(G.vd->camera && (G.vd->camera != act_cam_orig)) { - G.vd->persp= 2; - G.vd->view= 0; - - if(((G.qual & LR_CTRLKEY) && (G.qual & LR_ALTKEY)) || (G.qual & LR_SHIFTKEY)) { - void setcameratoview3d(void); // view.c - setcameratoview3d(); - DAG_object_flush_update(G.scene, G.scene->camera, OB_RECALC_OB); - BIF_undo_push("View to Camera position"); - allqueue(REDRAWVIEW3D, 0); - - } else if (U.smooth_viewtx) { - /* move 3d view to camera view */ - float orig_lens = G.vd->lens; - VECCOPY(orig_ofs, G.vd->ofs); - - if (act_cam_orig) - view_settings_from_ob(act_cam_orig, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens); - - smooth_view_to_camera(G.vd); - VECCOPY(G.vd->ofs, orig_ofs); - G.vd->lens = orig_lens; - } - - - } - } - else if(event==PAD9) { - countall(); - update_for_newframe(); - - reset_slowparents(); /* editobject.c */ - } - else if(G.vd->persp<2) { - if(event==PAD4 || event==PAD6) { - /* z-axis */ - phi= (float)(M_PI/360.0)*U.pad_rot_angle; - if(event==PAD6) phi= -phi; - si= (float)sin(phi); - q1[0]= (float)cos(phi); - q1[1]= q1[2]= 0.0; - q1[3]= si; - QuatMul(G.vd->viewquat, G.vd->viewquat, q1); - G.vd->view= 0; - } - if(event==PAD2 || event==PAD8) { - /* horizontal axis */ - VECCOPY(q1+1, G.vd->viewinv[0]); - - Normalize(q1+1); - phi= (float)(M_PI/360.0)*U.pad_rot_angle; - if(event==PAD2) phi= -phi; - si= (float)sin(phi); - q1[0]= (float)cos(phi); - q1[1]*= si; - q1[2]*= si; - q1[3]*= si; - QuatMul(G.vd->viewquat, G.vd->viewquat, q1); - G.vd->view= 0; - } - } - - if(G.vd->persp<2) perspo= G.vd->persp; - } - - if(G.vd->depths) G.vd->depths->damaged= 1; - retopo_queue_updates(G.vd); - - if(preview3d_event) - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - else - BIF_view3d_previewrender_signal(curarea, PR_PROJECTED); - - scrarea_queue_redraw(curarea); -} - -int untitled(char * name) -{ - if (G.save_over == 0 ) { - char * c= BLI_last_slash(name); - - if (c) - strcpy(&c[1], "untitled.blend"); - else - strcpy(name, "untitled.blend"); - - return(TRUE); - } - - return(FALSE); -} - -char *recent_filelist(void) -{ - struct RecentFile *recent; - int event, i, ofs; - char pup[2048], *p; - - p= pup + sprintf(pup, "Open Recent%%t"); - - if (G.sce[0]) { - p+= sprintf(p, "|%s %%x%d", G.sce, 1); - ofs = 1; - } else ofs = 0; - - for (recent = G.recent_files.first, i=0; (inext, i++) { - if (strcmp(recent->filename, G.sce)) { - p+= sprintf(p, "|%s %%x%d", recent->filename, i+ofs+1); - } - } - event= pupmenu(pup); - if(event>0) { - if (ofs && (event==1)) - return(G.sce); - else - recent = BLI_findlink(&(G.recent_files), event-1-ofs); - if(recent) return(recent->filename); - } - - return(NULL); -} - -int blenderqread(unsigned short event, short val) -{ - /* here do the general keys handling (not screen/window/space) */ - /* return 0: do not pass on to the other queues */ - extern int textediting; - extern void playback_anim(); - ScrArea *sa; - Object *ob; - int textspace=0; - /* Changed str and dir size to 160, to make sure there is enough - * space for filenames. */ - char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2]; - char *recentfile; - - if(val==0) return 1; - if(event==MOUSEY || event==MOUSEX) return 1; - if (G.flags & G_FILE_AUTOPLAY) return 1; - - if (curarea && curarea->spacetype==SPACE_TEXT) textspace= 1; - else if (curarea && curarea->spacetype==SPACE_SCRIPT) textspace= 1; - - switch(event) { - - case F1KEY: - if(G.qual==0) { - /* this exception because of the '?' button */ - if(curarea->spacetype==SPACE_INFO) { - sa= closest_bigger_area(); - areawinset(sa->win); - } - - activate_fileselect(FILE_BLENDER, "Open File", G.sce, BIF_read_file); - return 0; - } - else if(G.qual==LR_SHIFTKEY) { - activate_fileselect(FILE_LOADLIB, "Load Library", G.lib, 0); - return 0; - } - else if(G.qual==LR_CTRLKEY) { - activate_imageselect(FILE_LOADLIB, "Load Library", G.lib, 0); - return 0; - } - break; - case F2KEY: - if(G.qual==0) { - strcpy(dir, G.sce); - untitled(dir); - activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file); - return 0; - } - else if(G.qual==LR_CTRLKEY) { - write_vrml_fs(); - return 0; - } - else if(G.qual==LR_SHIFTKEY) { - write_dxf_fs(); - return 0; - } - break; - case F3KEY: - if(G.qual==0) { - BIF_save_rendered_image_fs(); - return 0; - } - else if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_NODE); - return 0; - } - else if(G.qual & LR_CTRLKEY) { - BIF_screendump(0); - } - break; - case F4KEY: - if(G.qual==LR_SHIFTKEY) { - - memset(str, 0, 16); - ob= OBACT; - if(ob) strcpy(str, ob->id.name); - - activate_fileselect(FILE_MAIN, "Data Select", str, NULL); - return 0; - } - else if(G.qual==LR_CTRLKEY) { - - memset(str, 0, 16); - ob= OBACT; - if(ob) strcpy(str, ob->id.name); - - activate_imageselect(FILE_MAIN, "Data Select", str, 0); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F5KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_VIEW3D); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F6KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_IPO); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F7KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_BUTS); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F8KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_SEQ); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F9KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_OOPS); - return 0; - } - else if(G.qual==(LR_SHIFTKEY|LR_ALTKEY)) { - newspace(curarea, SPACE_OOPS+256); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F10KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_IMAGE); - return 0; - } - else if(G.qual==0) { - extern_set_butspace(event, 1); - } - break; - case F11KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_TEXT); - return 0; - } - else if (G.qual==LR_CTRLKEY) { - playback_anim(); - } - else if(G.qual==0) { - BIF_toggle_render_display(); - return 0; - } - break; - case F12KEY: - if(G.qual==LR_SHIFTKEY) { - newspace(curarea, SPACE_ACTION); - return 0; - } - else if (G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) { - newspace(curarea, SPACE_NLA); - return 0; - } - else if (G.qual==LR_CTRLKEY) { - BIF_do_render(1); - } - else { - /* ctrl/alt + f12 should render too, for some macs have f12 assigned to cd eject */ - BIF_do_render(0); - } - return 0; - break; - - case WHEELUPMOUSE: - if(G.qual==LR_ALTKEY || G.qual==LR_COMMANDKEY) { - if(CFRA>1) { - CFRA--; - update_for_newframe(); - } - return 0; - } - break; - case WHEELDOWNMOUSE: - if(G.qual==LR_ALTKEY || G.qual==LR_COMMANDKEY) { - CFRA++; - update_for_newframe(); - return 0; - } - break; - - case LEFTARROWKEY: - case DOWNARROWKEY: - if(textediting==0 && textspace==0) { - -#if 0 -//#ifdef _WIN32 // FULLSCREEN - if(event==DOWNARROWKEY){ - if (G.qual==LR_ALTKEY) - mainwindow_toggle_fullscreen(0); - else if(G.qual==0) - CFRA-= G.scene->jumpframe; - } -#else - if((event==DOWNARROWKEY)&&(G.qual==0)) - CFRA-= G.scene->jumpframe; -#endif - else if((event==LEFTARROWKEY)&&(G.qual==0)) - CFRA--; - - if(G.qual==LR_SHIFTKEY) - CFRA= PSFRA; - if(CFRA<1) CFRA=1; - - update_for_newframe(); - return 0; - } - break; - - case RIGHTARROWKEY: - case UPARROWKEY: - if(textediting==0 && textspace==0) { - -#if 0 -//#ifdef _WIN32 // FULLSCREEN - if(event==UPARROWKEY){ - if(G.qual==LR_ALTKEY) - mainwindow_toggle_fullscreen(1); - else if(G.qual==0) - CFRA+= G.scene->jumpframe; - } -#else - if((event==UPARROWKEY)&&(G.qual==0)) - CFRA+= G.scene->jumpframe; -#endif - else if((event==RIGHTARROWKEY)&&(G.qual==0)) - CFRA++; - - if(G.qual==LR_SHIFTKEY) - CFRA= PEFRA; - - update_for_newframe(); - } - break; - - case ESCKEY: - sound_stop_all_sounds(); // whats this? - - /* stop playback on ESC always */ - rem_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM); - audiostream_stop(); - allqueue(REDRAWALL, 0); - - break; - case TABKEY: - if(G.qual==0) { - if(textspace==0) { - if(curarea->spacetype==SPACE_IPO) - set_editflag_editipo(); - else if(curarea->spacetype==SPACE_SEQ) - enter_meta(); - else if(curarea->spacetype==SPACE_NODE) - return 1; - else if(G.vd) { - /* also when Alt-E */ - if(G.obedit==NULL) { - enter_editmode(EM_WAITCURSOR); - if(G.obedit) BIF_undo_push("Original"); // here, because all over code enter_editmode is abused - } - else - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo - } - return 0; - } - } - else if(G.qual==LR_CTRLKEY){ - Object *ob= OBACT; - if(ob) { - if(ob->type==OB_ARMATURE) { - if(ob->flag & OB_POSEMODE) exit_posemode(); - else enter_posemode(); - } - else if(ob->type==OB_MESH) { - if(ob==G.obedit) EM_selectmode_menu(); - else if(G.f & G_PARTICLEEDIT) - PE_selectbrush_menu(); - else if(G.f & G_SCULPTMODE) - sculptmode_selectbrush_menu(); - else set_wpaint(); - } - } - } - else if(G.qual&LR_CTRLKEY && G.qual&LR_SHIFTKEY){ - PE_set_particle_edit(); - } - break; - - case BACKSPACEKEY: - break; - - case AKEY: - if(textediting==0 && textspace==0) { - if ((G.qual==LR_ALTKEY) && (curarea && curarea->spacetype==SPACE_VIEW3D)) { - play_anim(0); - return 0; - } - else if ((G.qual==LR_ALTKEY) || (G.qual==(LR_ALTKEY|LR_SHIFTKEY))){ - play_anim(1); - return 0; - } - } - break; - case EKEY: - if(G.qual==LR_ALTKEY) { - if(G.vd && textspace==0) { - if(G.obedit==0) { - enter_editmode(EM_WAITCURSOR); - BIF_undo_push("Original"); - } - else - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); // freedata, and undo - return 0; - } - } - break; - case IKEY: - if(textediting==0 && textspace==0 && !ELEM3(curarea->spacetype, SPACE_FILE, SPACE_IMASEL, SPACE_NODE)) { - if(G.f & G_SCULPTMODE) return 1; - else if(G.qual==0) { - common_insertkey(); - return 0; - } - } - break; - case JKEY: - if(textediting==0 && textspace==0) { - if (G.qual==0) { - BIF_swap_render_rects(); - return 0; - } - } - break; - - case NKEY: - if(textediting==0 && textspace==0) { - if(G.qual & LR_CTRLKEY); - else if(G.qual==0 || (G.qual & LR_SHIFTKEY)) { - if(curarea->spacetype==SPACE_VIEW3D); // is new panel, in view3d queue - else if(curarea->spacetype==SPACE_IPO); // is new panel, in ipo queue - else if(curarea->spacetype==SPACE_IMAGE); // is new panel, in ipo queue - else if(curarea->spacetype==SPACE_ACTION); // is own queue - else if(curarea->spacetype==SPACE_NLA); // is new panel - else if(curarea->spacetype==SPACE_SEQ); // is new panel - else { - clever_numbuts(); - return 0; - } - } - } - break; - - case OKEY: - if(textediting==0) { - if(G.qual==LR_CTRLKEY) { - recentfile = recent_filelist(); - if(recentfile) { - BIF_read_file(recentfile); - } - return 0; - } - } - break; - - case SKEY: - if(G.obedit==NULL) { - if(G.qual==LR_CTRLKEY) { - strcpy(dir, G.sce); - if (untitled(dir)) { - activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file); - } else { - BIF_write_file(dir); - free_filesel_spec(dir); - } - return 0; - } - } - break; - - case TKEY: - if (G.qual==(LR_SHIFTKEY|LR_ALTKEY|LR_CTRLKEY)) { - Object *ob = OBACT; - int event = pupmenu(ob?"Time%t|draw|recalc ob|recalc data":"Time%t|draw"); - int a; - double delta, stime; - - if (event < 0) return 0; /* cancelled by user */ - - waitcursor(1); - - stime= PIL_check_seconds_timer(); - for(a=0; a<100000; a++) { - if (event==1) { - scrarea_do_windraw(curarea); - } else if (event==2) { - ob->recalc |= OB_RECALC_OB; - object_handle_update(ob); - } else if (event==3) { - ob->recalc |= OB_RECALC_DATA; - object_handle_update(ob); - } - - delta= PIL_check_seconds_timer()-stime; - if (delta>5.0) break; - } - - waitcursor(0); - notice("%8.6f s/op - %6.2f ops/s - %d iterations", delta/a, a/delta, a); - return 0; - } - else if(G.qual==(LR_ALTKEY|LR_CTRLKEY)) { - int a; - int event= pupmenu("10 Timer%t|draw|draw+swap|undo"); - if(event>0) { - double stime= PIL_check_seconds_timer(); - char tmpstr[128]; - int time; - - waitcursor(1); - - for(a=0; a<10; a++) { - if (event==1) { - scrarea_do_windraw(curarea); - } else if (event==2) { - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else if(event==3) { - BIF_undo(); - BIF_redo(); - } - } - - time= (int) ((PIL_check_seconds_timer()-stime)*1000); - - if(event==1) sprintf(tmpstr, "draw %%t|%d ms", time); - if(event==2) sprintf(tmpstr, "d+sw %%t|%d ms", time); - if(event==3) sprintf(tmpstr, "undo %%t|%d ms", time); - - waitcursor(0); - pupmenu(tmpstr); - - } - return 0; - } - break; - - case UKEY: - if(textediting==0) { - if(G.qual==LR_CTRLKEY) { - if(okee("Save user defaults")) { - BIF_write_homefile(); - } - return 0; - } - else if(G.qual==LR_ALTKEY) { - if(curarea->spacetype!=SPACE_TEXT) { - BIF_undo_menu(); - return 0; - } - } - } - break; - - case WKEY: - if(textediting==0) { - if(G.qual==LR_CTRLKEY) { - strcpy(dir, G.sce); - if (untitled(dir)) { - activate_fileselect(FILE_BLENDER, "Save File", dir, BIF_write_file); - } else { - BIF_write_file(dir); - free_filesel_spec(dir); - } - return 0; - } - /* Python specials? ;) - else if(G.qual==LR_ALTKEY) { - write_videoscape_fs(); - return 0; - }*/ - } - break; - - case XKEY: - if(textspace==0 && textediting==0) { - if(G.qual==LR_CTRLKEY) { - if(okee("Erase all")) { - if( BIF_read_homefile(0)==0) error("No file ~/.B.blend"); - - /* Reset lights - * This isn't done when reading userdef, do it now - * */ - default_gl_light(); - } - return 0; - } - } - break; - case YKEY: // redo alternative - if(textspace==0) { - if(G.qual==LR_CTRLKEY) { - BIF_redo(); - return 0; - } - } - break; - case ZKEY: // undo - if(textspace==0) { - if(G.qual & (LR_CTRLKEY|LR_COMMANDKEY)) { // all combos with ctrl/commandkey are accepted - if ELEM(G.qual, LR_CTRLKEY, LR_COMMANDKEY) BIF_undo(); - else BIF_redo(); // all combos with ctrl is redo - return 0; - } - } - break; - } - - return 1; -} - -/* eof */ diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c deleted file mode 100644 index 969b9d4657b..00000000000 --- a/source/blender/src/toolbox.c +++ /dev/null @@ -1,2245 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#define PY_TOOLBOX 1 - -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include -#include "MEM_guardedalloc.h" - -#include "BMF_Api.h" -#include "BIF_language.h" -#include "BIF_resources.h" - -#include "DNA_group_types.h" -#include "DNA_image_types.h" -#include "DNA_lamp_types.h" -#include "DNA_mesh_types.h" -#include "DNA_node_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_camera_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "BKE_displist.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_mesh.h" -#include "BKE_node.h" -#include "BKE_main.h" -#include "BKE_plugin_types.h" -#include "BKE_utildefines.h" - -#include "BIF_editnla.h" -#include "BIF_editarmature.h" -#include "BIF_editdeform.h" -#include "BIF_editfont.h" -#include "BIF_editmesh.h" -#include "BIF_editseq.h" -#include "BIF_editlattice.h" -#include "BIF_editsima.h" -#include "BIF_editoops.h" -#include "BIF_editview.h" -#include "BIF_gl.h" -#include "BIF_graphics.h" -#include "BIF_imasel.h" -#include "BIF_interface.h" -#include "BIF_mainqueue.h" -#include "BIF_mywindow.h" -#include "BIF_renderwin.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_tbcallback.h" -#include "BIF_transform.h" - -#include "BDR_editobject.h" -#include "BDR_editcurve.h" -#include "BDR_editmball.h" - -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" - -#include "IMB_imbuf.h" - -#include "blendef.h" -#include "butspace.h" -#include "mydevice.h" - -/* bpymenu */ -#include "BPY_extern.h" -#include "BPY_menus.h" - -void asciitoraw(int ch, unsigned short *event, unsigned short *qual) -{ - if( isalpha(ch)==0 ) return; - - if( isupper(ch) ) { - *qual= LEFTSHIFTKEY; - ch= tolower(ch); - } - - switch(ch) { - case 'a': *event= AKEY; break; - case 'b': *event= BKEY; break; - case 'c': *event= CKEY; break; - case 'd': *event= DKEY; break; - case 'e': *event= EKEY; break; - case 'f': *event= FKEY; break; - case 'g': *event= GKEY; break; - case 'h': *event= HKEY; break; - case 'i': *event= IKEY; break; - case 'j': *event= JKEY; break; - case 'k': *event= KKEY; break; - case 'l': *event= LKEY; break; - case 'm': *event= MKEY; break; - case 'n': *event= NKEY; break; - case 'o': *event= OKEY; break; - case 'p': *event= PKEY; break; - case 'q': *event= QKEY; break; - case 'r': *event= RKEY; break; - case 's': *event= SKEY; break; - case 't': *event= TKEY; break; - case 'u': *event= UKEY; break; - case 'v': *event= VKEY; break; - case 'w': *event= WKEY; break; - case 'x': *event= XKEY; break; - case 'y': *event= YKEY; break; - case 'z': *event= ZKEY; break; - } -} - -/* ************************************ */ - -/* this va_ stuff allows printf() style codes in these menus */ - -static int vconfirm(char *title, char *itemfmt, va_list ap) -{ - char *s, buf[512]; - - s= buf; - if (title) s+= sprintf(s, "%s%%t|", title); - vsprintf(s, itemfmt, ap); - - return (pupmenu(buf)>=0); -} - -static int confirm(char *title, char *itemfmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, itemfmt); - ret= vconfirm(title, itemfmt, ap); - va_end(ap); - - return ret; -} - -int okee(char *str, ...) -{ - va_list ap; - int ret; - char titlestr[256]; - - sprintf(titlestr, "OK? %%i%d", ICON_HELP); - - va_start(ap, str); - ret= vconfirm(titlestr, str, ap); - va_end(ap); - - return ret; -} - -void notice(char *str, ...) -{ - va_list ap; - - va_start(ap, str); - vconfirm(NULL, str, ap); - va_end(ap); -} - -void error(char *fmt, ...) -{ - va_list ap; - char nfmt[256]; - char titlestr[256]; - - sprintf(titlestr, "Error %%i%d", ICON_ERROR); - - sprintf(nfmt, "%s", fmt); - - va_start(ap, fmt); - if (G.background || !G.curscreen) { - vprintf(nfmt, ap); - printf("\n"); - } else { - vconfirm(titlestr, nfmt, ap); - } - va_end(ap); -} - -void error_libdata(void) -{ - error(ERROR_LIBDATA_MESSAGE); -} - -int saveover(char *file) -{ - int len= strlen(file); - - if(len==0) - return 0; - - if(BLI_exists(file)==0) - return 1; - - if( file[len-1]=='/' || file[len-1]=='\\' ) { - error("Cannot overwrite a directory"); - return 0; - } - - return confirm("Save over", file); -} - -/* ****************** EXTRA STUFF **************** */ - -short button(short *var, short min, short max, char *str) -{ - uiBlock *block; - ListBase listb={0, 0}; - short x1,y1; - short mval[2], ret=0; - - if(min>max) min= max; - - getmouseco_sc(mval); - - if(mval[0]<150) mval[0]=150; - if(mval[1]<30) mval[1]=30; - if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; - if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - - block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK); - - x1=mval[0]-150; - y1=mval[1]-20; - - uiDefButS(block, NUM, 0, str, (short)(x1+5),(short)(y1+10),125,20, var,(float)min,(float)max, 0, 0, ""); - uiDefBut(block, BUT, 32767, "OK", (short)(x1+136),(short)(y1+10),25,20, NULL, 0, 0, 0, 0, ""); - - uiBoundsBlock(block, 5); - - ret= uiDoBlocks(&listb, 0, 0); - - if(ret==UI_RETURN_OK) return 1; - return 0; -} - -short sbutton(char *var, float min, float max, char *str) -{ - uiBlock *block; - ListBase listb={0, 0}; - short x1,y1; - short mval[2], ret=0; - - if(min>max) min= max; - - getmouseco_sc(mval); - - if(mval[0]<250) mval[0]=250; - if(mval[1]<30) mval[1]=30; - if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; - if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - - block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK); - - x1=mval[0]-250; - y1=mval[1]-20; - - uiDefButC(block, TEX, 32766, str, x1+5,y1+10,225,20, var,(float)min,(float)max, 0, 0, ""); - uiDefBut(block, BUT, 32767, "OK", x1+236,y1+10,25,20, NULL, 0, 0, 0, 0, ""); - - uiBoundsBlock(block, 5); - - mainqenter_ext(BUT_ACTIVATE, 32766, 0); /* note, button id '32766' is asking for errors some day! */ - ret= uiDoBlocks(&listb, 0, 0); - - if(ret==UI_RETURN_OK) return 1; - return 0; - -} - -short fbutton(float *var, float min, float max, float a1, float a2, char *str) -{ - uiBlock *block; - ListBase listb={0, 0}; - short x1,y1; - short mval[2], ret=0; - - if(min>max) min= max; - - getmouseco_sc(mval); - - if(mval[0]<150) mval[0]=150; - if(mval[1]<30) mval[1]=30; - if(mval[0]>G.curscreen->sizex) mval[0]= G.curscreen->sizex-10; - if(mval[1]>G.curscreen->sizey) mval[1]= G.curscreen->sizey-10; - - block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); - - x1=mval[0]-150; - y1=mval[1]-20; - - uiDefButF(block, NUM, 0, str,(short)(x1+5),(short)(y1+10),125,20, var, min, max, a1, a2, ""); - uiDefBut(block, BUT, 32767, "OK",(short)(x1+136),(short)(y1+10), 35, 20, NULL, 0, 0, 0, 0, ""); - - uiBoundsBlock(block, 2); - - ret= uiDoBlocks(&listb, 0, 0); - - if(ret==UI_RETURN_OK) return 1; - return 0; -} - -int movetolayer_buts(unsigned int *lay, char *title) -{ - uiBlock *block; - ListBase listb={0, 0}; - int dx, dy, a, x1, y1, sizex=160, sizey=30; - short pivot[2], mval[2], ret=0; - - if(G.vd->localview) { - error("Not in localview "); - return ret; - } - - getmouseco_sc(mval); - - pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30); - pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10); - - if (pivot[0]!=mval[0] || pivot[1]!=mval[1]) - warp_pointer(pivot[0], pivot[1]); - - mywinset(G.curscreen->mainwin); - - x1= pivot[0]-sizex+10; - y1= pivot[1]-sizey/2; - - block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK); - - dx= (sizex-5)/12; - dy= sizey/2; - - if(title) - uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, ""); - - /* buttons have 0 as return event, to prevent menu to close on hotkeys */ - uiBlockBeginAlign(block); - for(a=0; a<5; a++) - uiDefButBitI(block, TOGR, 1<sizex-30); - pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10); - - if (pivot[0]!=mval[0] || pivot[1]!=mval[1]) - warp_pointer(pivot[0], pivot[1]); - - mywinset(G.curscreen->mainwin); - - x1= pivot[0]-sizex+10; - y1= pivot[1]-sizey/2; - - block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK); - - dx= (sizex-5)/10; - dy= sizey/2; - - if(title) - uiDefBut(block, LABEL, 0, title, (short)(x1), (short)y1+30, sizex, 20, NULL, 1, 0, 0, 0, ""); - - /* buttons have 0 as return event, to prevent menu to close on hotkeys */ - uiBlockBeginAlign(block); - for(a=0; a<8; a++) - uiDefButBitS(block, TOGR, 1<(x2 - x1-24)) temp++; - glRasterPos2i(x1+16, y2-30); - BIF_DrawString(G.fonts, str+temp, (U.transopts & USER_TR_BUTTONS)); -} - -int do_clever_numbuts(char *name, int tot, int winevent) -{ - ListBase listb= {NULL, NULL}; - uiBlock *block; - VarStruct *varstr; - int a, sizex, sizey, x1, y2, width, colunms=1, xi=0, yi=0; - short mval[2], event; - - /* Clear all events so tooltips work, this is not ideal and - only needed because calls from the menu still have some events - left over when do_clever_numbuts is called. - Calls from keyshortcuts do not have this problem.*/ - ScrArea *sa; - BWinEvent temp_bevt; - for (sa= G.curscreen->areabase.first; sa; sa= sa->next) { - if(sa->win) { - while( bwin_qread( sa->win, &temp_bevt ) ) {} - } - if(sa->headwin) { - while( bwin_qread( sa->headwin, &temp_bevt ) ) {} - } - } - /* Done clearing events */ - - if(tot<=0 || tot>MAXNUMBUTS) return 0; - - /* if we have too many buttons then have more then 1 column */ - colunms= (int)ceil((double)tot / (double)MAXNUMBUTROWS); - - getmouseco_sc(mval); - - /* size */ - sizex= 175; - sizey= 30+20*(MIN2(MAXNUMBUTROWS, tot)+1); - width= (sizex*colunms)+60; - - /* center */ - if(mval[0]G.curscreen->sizex -width/2) mval[0]= G.curscreen->sizex -width/2; - if(mval[1]>G.curscreen->sizey -sizey/2) mval[1]= G.curscreen->sizey -sizey/2; - - mywinset(G.curscreen->mainwin); - - x1= mval[0]-width/2; - y2= mval[1]+sizey/2; - - block= uiNewBlock(&listb, "numbuts", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_ENTER_OK); - - /* WATCH IT: TEX BUTTON EXCEPTION */ - /* WARNING: ONLY A SINGLE BIT-BUTTON POSSIBLE: WE WORK AT COPIED DATA! */ - - BIF_ThemeColor(TH_MENU_TEXT); /* makes text readable on dark theme */ - - uiDefBut(block, LABEL, 0, name, (short)(x1+15), (short)(y2-35), (short)(width-60), 19, 0, 1.0, 0.0, 0, 0, ""); - - /* - if(name[0]=='A' && name[7]=='O') { - y2 -= 20; - uiDefBut(block, LABEL, 0, "Rotations in degrees!", (short)(x1+15), (short)(y2-35), (short)(sizex-60), 19, 0, 0.0, 0.0, 0, 0, ""); - }*/ - - uiBlockBeginAlign(block); - varstr= &numbuts[0]; - for(a=0; atype==TEX) { - uiDefBut(block, TEX, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, varstr->tip); - } else if(varstr->type==COL) { - uiDefButF(block, COL, 0, "",(short)((x1+15) + (sizex*xi)),(short)(y2-55- 20*yi),(short)(sizex), 19, numbpoin[a], varstr->min, varstr->max, 0, 0, ""); - } else { - if(varstr->type==LABEL) {/* dont include the label when rounding the buttons */ - uiBlockEndAlign(block); - - /* using the tip for the name, this is incorrect lets us get around the 16 char limit of name */ - /* Changed from the line below to use the tip since the tip isnt used for a label */ - uiDefBut(block, varstr->type, 0, varstr->tip,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, ""); - } else { - uiDefBut(block, varstr->type, 0, varstr->name,(short)((x1+15) + (sizex*xi)),(short)(y2-55-20*yi), (short)(sizex), 19, &(numbdata[a]), varstr->min, varstr->max, 100, 0, varstr->tip); - } - - if(varstr->type==LABEL) - uiBlockBeginAlign(block); - } - - /* move to the next column */ - yi++; - if (yi>=MAXNUMBUTROWS) { - yi=0; - xi++; - uiBlockEndAlign(block); - uiBlockBeginAlign(block); - } - } - uiBlockEndAlign(block); - - uiDefBut(block, BUT, 4000, "OK", (short)(x1+width-40),(short)(y2-35-20*MIN2(MAXNUMBUTROWS,a)), 25, (short)(sizey-50), 0, 0, 0, 0, 0, "OK: Assign Values"); - - uiBoundsBlock(block, 5); - - event= uiDoBlocks(&listb, 0, 0); - - areawinset(curarea->win); - - if(event & UI_RETURN_OK) { - - varstr= &numbuts[0]; - for(a=0; atype==TEX); - else if ELEM( (varstr->type & BUTPOIN), FLO, INT ) memcpy(numbpoin[a], numbdata+a, 4); - else if((varstr->type & BUTPOIN)==SHO ) *((short *)(numbpoin[a]))= *( (short *)(numbdata+a)); - } - - if(winevent) { - ScrArea *sa; - - sa= G.curscreen->areabase.first; - while(sa) { - if(sa->spacetype==curarea->spacetype) addqueue(sa->win, winevent, 1); - sa= sa->next; - } - } - - return 1; - } - return 0; -} - -void add_numbut(int nr, int type, char *str, float min, float max, void *poin, char *tip) -{ - int tip_max = sizeof(numbuts[nr].tip); - int name_max = sizeof(numbuts[nr].name); - - if(nr >= MAXNUMBUTS || (nr < 0)) return; - - numbuts[nr].type= type; - - numbuts[nr].min= min; - numbuts[nr].max= max; - - if (type==LABEL) { - /* evil use it tooltip for the label string to get around the 16 char limit of "name" */ - if (str) { - strncpy(numbuts[nr].tip, str, tip_max); - numbuts[nr].tip[tip_max-1] = 0; - } else { - strcpy(numbuts[nr].tip, ""); - } - } else { - /* for all other types */ - if (str) { - strncpy(numbuts[nr].name, str, name_max); - numbuts[nr].name[name_max-1] = 0; - } else { - strcpy(numbuts[nr].name, ""); - } - if (tip) { - strncpy(numbuts[nr].tip, tip, tip_max); - numbuts[nr].tip[tip_max-1] = 0; - } else { - strcpy(numbuts[nr].tip, ""); - } - } - - /*WATCH: TEX BUTTON EXCEPTION */ - - numbpoin[nr]= poin; - - if ELEM( (type & BUTPOIN), FLO, INT ) memcpy(numbdata+nr, poin, 4); - if((type & BUTPOIN)==SHO ) *((short *)(numbdata+nr))= *( (short *)poin); - - /* if( strncmp(numbuts[nr].name, "Rot", 3)==0 ) { - float *fp; - - fp= (float *)(numbdata+nr); - fp[0]= 180.0*fp[0]/M_PI; - } */ - -} - -void clever_numbuts(void) -{ - - if(curarea->spacetype==SPACE_VIEW3D) { - // panel now - } - else if(curarea->spacetype==SPACE_NLA){ - // panel now - } - else if(curarea->spacetype==SPACE_IPO) { - // panel now - } - else if(curarea->spacetype==SPACE_SEQ) { - // panel now - } - else if(curarea->spacetype==SPACE_IMAGE) { - // panel now - } - else if(curarea->spacetype==SPACE_IMASEL) { - clever_numbuts_imasel(); - } - else if(curarea->spacetype==SPACE_OOPS) { - clever_numbuts_oops(); - } - else if(curarea->spacetype==SPACE_ACTION){ - // in its own queue - } - else if(curarea->spacetype==SPACE_FILE) { - clever_numbuts_filesel(); - } -} - - -void replace_names_but(void) -{ - Image *ima= G.main->image.first; - short len, tot=0; - char old[64], new[64], temp[80]; - - strcpy(old, "/"); - strcpy(new, "/"); - - add_numbut(0, TEX, "Old:", 0, 63, old, 0); - add_numbut(1, TEX, "New:", 0, 63, new, 0); - - if (do_clever_numbuts("Replace image name", 2, REDRAW) ) { - - len= strlen(old); - - while(ima) { - - if(strncmp(old, ima->name, len)==0) { - - strcpy(temp, new); - strcat(temp, ima->name+len); - BLI_strncpy(ima->name, temp, sizeof(ima->name)); - - BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); - - tot++; - } - - ima= ima->id.next; - } - - notice("Replaced %d names", tot); - } - -} - - -/* ********************** NEW TOOLBOX ********************** */ - -ListBase tb_listb= {NULL, NULL}; - -#define TB_TAB 256 -#define TB_ALT 512 -#define TB_CTRL 1024 -#define TB_PAD 2048 -#define TB_SHIFT 4096 - -typedef struct TBitem { - int icon; - char *name; - int retval; - void *poin; -} TBitem; - -static void tb_do_hotkey(void *arg, int event) -{ - unsigned short i, key=0; - unsigned short qual[] = { 0,0,0,0 }; - - if(event & TB_CTRL) { - qual[0] = LEFTCTRLKEY; - event &= ~TB_CTRL; - } - if(event & TB_ALT) { - qual[1] = LEFTALTKEY; - event &= ~TB_ALT; - } - if(event & TB_SHIFT) { - qual[2] = LEFTSHIFTKEY; - event &= ~TB_SHIFT; - } - - if(event & TB_TAB) key= TABKEY; - else if(event & TB_PAD) { - event &= ~TB_PAD; - switch(event) { - case '-': key= PADMINUS; break; - case '+': key= PADPLUSKEY; break; - case '0': key= PAD0; break; - case '5': key= PAD5; break; - case '/': key= PADSLASHKEY; break; - case '.': key= PADPERIOD; break; - case '*': key= PADASTERKEY; break; - case 'h': key= HOMEKEY; break; - case 'u': key= PAGEUPKEY; break; - case 'd': key= PAGEDOWNKEY; break; - } - } - else asciitoraw(event, &key, &qual[3]); - - for (i=0;i<4;i++) - { - if(qual[i]) mainqenter(qual[i], 1); - } - mainqenter(key, 1); - mainqenter(key, 0); - mainqenter(EXECUTE, 1); - - for (i=0;i<4;i++) - { - if(qual[i]) mainqenter(qual[i], 0); - } -} - -/* *************Select ********** */ - -static TBitem tb_object_select_layer1_5[]= { -{ 0, "1", 1, NULL}, -{ 0, "2", 2, NULL}, -{ 0, "3", 3, NULL}, -{ 0, "4", 4, NULL}, -{ 0, "5", 5, NULL}, -{ -1, "", 0, do_view3d_select_object_layermenu}}; - -static TBitem tb_object_select_layer6_10[]= { -{ 0, "6", 6, NULL}, -{ 0, "7", 7, NULL}, -{ 0, "8", 8, NULL}, -{ 0, "9", 9, NULL}, -{ 0, "10", 10, NULL}, -{ -1, "", 0, do_view3d_select_object_layermenu}}; - -static TBitem tb_object_select_layer11_15[]= { -{ 0, "11", 11, NULL}, -{ 0, "12", 12, NULL}, -{ 0, "13", 13, NULL}, -{ 0, "14", 14, NULL}, -{ 0, "15", 15, NULL}, -{ -1, "", 0, do_view3d_select_object_layermenu}}; - -static TBitem tb_object_select_layer16_20[]= { -{ 0, "16", 16, NULL}, -{ 0, "17", 17, NULL}, -{ 0, "18", 18, NULL}, -{ 0, "19", 19, NULL}, -{ 0, "20", 20, NULL}, -{ -1, "", 0, do_view3d_select_object_layermenu}}; - -static TBitem tb_object_select_layer[]= { -{ 0, "Layers 1-5", 0, tb_object_select_layer1_5}, -{ 0, "Layers 6-10", 0, tb_object_select_layer6_10}, -{ 0, "Layers 11-15", 0, tb_object_select_layer11_15}, -{ 0, "Layers 16-20", 0, tb_object_select_layer16_20}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_object_select_type[]= { -{ 0, "Mesh", 1, NULL}, -{ 0, "Curve", 2, NULL}, -{ 0, "Surface", 3, NULL}, -{ 0, "Meta", 4, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Armature", 5, NULL}, -{ 0, "Lattice", 6, NULL}, -{ 0, "Text", 7, NULL}, -{ 0, "Empty", 8, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Camera", 9, NULL}, -{ 0, "Lamp", 10, NULL}, -{ -1, "", 0, do_view3d_select_object_typemenu}}; - -static TBitem tb_object_select_linked[]= { -{ 0, "Object Ipo|Shift L, 1", 1, NULL}, -{ 0, "ObData|Shift L, 2", 2, NULL}, -{ 0, "Material|Shift L, 3", 3, NULL}, -{ 0, "Texture|Shift L, 4", 4, NULL}, -{ -1, "", 0, do_view3d_select_object_linkedmenu}}; - -static TBitem tb_object_select_grouped[]= { -{ 0, "Children|Shift G, 1", 1, NULL}, -{ 0, "Immediate Children|Shift G, 2", 2, NULL}, -{ 0, "Parent|Shift G, 3", 3, NULL}, -{ 0, "Siblings (Shared Parent)|Shift G, 4", 4, NULL}, -{ 0, "Objects of Same Type|Shift G, 5", 5, NULL}, -{ 0, "Objects on Shared Layers|Shift G, 6", 6, NULL}, -{ 0, "Objects in Same Group|Shift G, 7", 7, NULL}, -{ 0, "Object Hooks|Shift G, 8", 8, NULL}, -{ 0, "Object PassIndex|Shift G, 9", 9, NULL}, -{ -1, "", 0, do_view3d_select_object_groupedmenu}}; - -static TBitem tb_object_select[]= { -{ 0, "Border Select|B", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Select/Deselect All|A", 1, NULL}, -{ 0, "Inverse", 2, NULL}, -{ 0, "Select All by Layer", 0, tb_object_select_layer}, -{ 0, "Select All by Type", 0, tb_object_select_type}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Linked", 0, tb_object_select_linked}, -{ 0, "Grouped", 0, tb_object_select_grouped}, -{ -1, "", 0, do_view3d_select_objectmenu}}; - -static TBitem tb_face_select[]= { -{ 0, "Border Select|B", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Select/Deselect All|A", 2, NULL}, -{ 0, "Inverse", 3, NULL}, -{ 0, "Same UV", 4, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Linked Faces|Ctrl L", 5, NULL}, -{ -1, "", 0, do_view3d_select_faceselmenu}}; - -static TBitem tb_mesh_select[]= { -{ 0, "Border Select|B", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Select/Deselect All|A", 2, NULL}, -{ 0, "Inverse|Ctrl I", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Random...", 5, NULL}, -{ 0, "Non-Manifold|Shift Ctrl Alt M", 9, NULL}, -{ 0, "Sharp Edges|Shift Ctrl Alt S", 14, NULL}, -{ 0, "Linked Flat Faces|Shift Ctrl Alt F", 15, NULL}, -{ 0, "Triangles|Shift Ctrl Alt 3", 11, NULL}, -{ 0, "Quads|Shift Ctrl Alt 4", 12, NULL}, -{ 0, "Non-Triangles/Quads|Shift Ctrl Alt 5", 13, NULL}, -{ 0, "Similar to Selection|Shift G", 21, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "More|Ctrl NumPad +", 7, NULL}, -{ 0, "Less|Ctrl NumPad -", 8, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Linked Vertices|Ctrl L", 4, NULL}, -{ 0, "Vertex Path|W Alt 7", 16, NULL}, -{ 0, "Edge Loop|Ctrl E 6", 17, NULL}, -{ 0, "Edge Ring|Ctrl E 7", 18, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Loop to Region|Ctrl E 8", 19, NULL}, -{ 0, "Region to Loop|Ctrl E 9", 20, NULL}, -{ -1, "", 0, do_view3d_select_meshmenu}}; - - -static TBitem tb_curve_select[]= { -{ 0, "Border Select|B", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "(De)select All|A", 2, NULL}, -{ 0, "Inverse", 3, NULL}, -{ 0, "Random...", 13, NULL}, -{ 0, "Every Nth", 14, NULL}, -{ 0, "Row|Shift R", 5, NULL}, /* shouldn't be visible in case of bezier curves*/ -{ 0, "SEPR", 0, NULL}, -{ 0, "(De)select First", 7, NULL}, -{ 0, "(De)select Last", 8, NULL}, -{ 0, "Select Next", 11, NULL}, -{ 0, "Select Previous", 12, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "More|Ctrl NumPad +", 9, NULL}, -{ 0, "Less|Ctrl NumPad -", 10, NULL}, -{ -1, "", 0, do_view3d_select_curvemenu}}; - -static TBitem tb_mball_select[]= { -{ 0, "Border Select|B", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "(De)select All|A", 2, NULL}, -{ 0, "Inverse", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Random...", 4, NULL}, -{ -1, "", 0, do_view3d_select_metaballmenu}}; - -static TBitem tb__select[]= { -{ 0, "Border Select|B", 'b', NULL}, -{ 0, "(De)select All|A", 'a', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - - -/* *************Edit ********** */ - -static TBitem tb_edit[]= { -{ 0, "Exit Editmode|Tab", TB_TAB, NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_curve_edit_seg[]= { -{ 0, "Subdivide|W, 1", 0, NULL}, -{ 0, "Switch Direction|W, 2", 1, NULL}, -{ -1, "", 0, do_view3d_edit_curve_segmentsmenu}}; - -static TBitem tb_curve_edit_cv[]= { -{ 0, "Tilt|T", 't', NULL}, -{ 0, "Clear Tilt|Alt T", TB_ALT|'t', NULL}, -{ 0, "Separate|P", 'p', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Automatic|Shift H", 'H', NULL}, -{ 0, "Toggle Free/Aligned|H", 'h', NULL}, -{ 0, "Vector|V", 'v', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Make Vertex Parent|Ctrl P", TB_CTRL|'p', NULL}, -{ 0, "Add Hook|Ctrl H", TB_CTRL|'h', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - - -static TBitem tb_curve_edit[]= { -{ 0, "Exit Editmode|Tab", TB_TAB, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Extrude|E", 'e', NULL}, -{ 0, "Duplicate|Shift D", 'D', NULL}, -{ 0, "Make Segment|F", 'f', NULL}, -{ 0, "Toggle Cyclic|C", 'c', NULL}, -{ 0, "Delete...|X", 'x', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Control Points", 0, tb_curve_edit_cv}, -{ 0, "Segments", 0, tb_curve_edit_seg}, -{ -1, "", 0, tb_do_hotkey}}; - - -static TBitem tb_mesh_edit_vertex[]= { -{ 0, "Merge...|Alt M", 5, NULL}, -{ 0, "Rip|V", 7, NULL}, -{ 0, "Split|Y", 4, NULL}, -{ 0, "Separate|P", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Smooth|W, Alt 1", 2, NULL}, -{ 0, "Remove Doubles|W, 6", 1, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Make Vertex Parent|Ctrl P", 0, NULL}, -{ 0, "Add Hook|Ctrl H", 6, NULL}, -{ -1, "", 0, do_view3d_edit_mesh_verticesmenu}}; - -static TBitem tb_mesh_edit_edge[]= { -{ 0, "Make Edge/Face|F", 5, NULL}, -{ 0, "Collapse|Alt M", 14, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Bevel|W, Alt 2", 6, NULL}, -{ 0, "Loop Subdivide|Ctrl R", 4, NULL}, -{ 0, "Knife Subdivide...|Shift K", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Subdivide|W, 1", 2, NULL}, -{ 0, "Subdivide Fractal|W, 2", 1, NULL}, -{ 0, "Subdivide Smooth|W, 3", 0, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Mark Seam|Ctrl E", 7, NULL}, -{ 0, "Clear Seam|Ctrl E", 8, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Crease SubSurf|Shift E", 9, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Rotate Edge CW|Ctrl E", 10, NULL}, -{ 0, "Rotate Edge CCW|Ctrl E", 11, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Slide Edge|Ctrl E", 12, NULL}, -{ 0, "Delete Edge Loop|X", 13, NULL}, -{ -1, "", 0, do_view3d_edit_mesh_edgesmenu}}; - -static TBitem tb_mesh_edit_face[]= { -{ 0, "Make Edge/Face|F", 5, NULL}, -{ 0, "Fill|Shift F", 0, NULL}, -{ 0, "Beautify Fill|Alt F", 1, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Convert to Triangles|Ctrl T", 2, NULL}, -{ 0, "Convert to Quads|Alt J", 3, NULL}, -{ 0, "Flip Triangle Edges|Ctrl Shift F", 4, NULL}, -{ 0, "Set Smooth|Ctrl F, 3", 6, NULL}, -{ 0, "Set Solid|Ctrl F, 4", 7, NULL}, -{ -1, "", 0, do_view3d_edit_mesh_facesmenu}}; - - -static TBitem tb_mesh_edit_normal[]= { -{ 0, "Recalculate Outside|Ctrl N", 2, NULL}, -{ 0, "Recalculate Inside|Ctrl Shift N", 1, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Flip|Ctrl F, 1", 0, NULL}, -{ -1, "", 0, do_view3d_edit_mesh_normalsmenu}}; - -static TBitem tb_mesh_edit[]= { -{ 0, "Exit Editmode|Tab", TB_TAB, NULL}, -{ 0, "Undo|Ctrl Z", 'u', NULL}, -{ 0, "Redo|Ctrl Shift Z", 'U', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Extrude|E", 'e', NULL}, -{ 0, "Duplicate|Shift D", 'D', NULL}, -{ 0, "Delete...|X", 'x', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Vertices", 0, tb_mesh_edit_vertex}, -{ 0, "Edges", 0, tb_mesh_edit_edge}, -{ 0, "Faces", 0, tb_mesh_edit_face}, -{ 0, "Normals", 0, tb_mesh_edit_normal}, -{ -1, "", 0, tb_do_hotkey}}; - - -static TBitem tb_object_ipo[]= { -{ 0, "Show/Hide", 'k', NULL}, -{ 0, "Select Next", TB_PAD|'u', NULL}, -{ 0, "Select Prev", TB_PAD|'d', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - - -static TBitem tb_object_edit[]= { -{ 0, "Enter Editmode|Tab", TB_TAB, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Duplicate|Shift D", 'D', NULL}, -{ 0, "Duplicate Linked|Alt D", TB_ALT|'d', NULL}, -{ 0, "Delete|X", 'x', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Object Keys", 0, tb_object_ipo}, -{ -1, "", 0, tb_do_hotkey}}; - - -/* ************* Type ********** */ - -static TBitem tb_obdata_hide[]= { -{ 0, "Show Hidden|Alt H", TB_ALT|'h', NULL}, -{ 0, "Hide Selected|H", 'h', NULL}, -{ 0, "Hide Deselected|Shift H", 'H', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static void tb_do_mesh(void *arg, int event){ - switch(event) { - case 1: common_insertkey(); break; - case 2: G.f ^= G_DRAWEDGES; break; - case 3: G.f ^= G_DRAWFACES; break; - case 4: G.f ^= G_DRAWNORMALS; break; - case 5: flip_subdivison(-1); break; - } - addqueue(curarea->win, REDRAW, 1); -} - -static TBitem tb_mesh[]= { -{ 0, "Insert Keyframe|I", 1, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Show/Hide Edges", 2, NULL}, -{ 0, "Show/Hide Faces", 3, NULL}, -{ 0, "Show/Hide Normals", 4, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Subdivision Surface", 5, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Show/Hide Vertices", 0, tb_obdata_hide}, -{ -1, "", 0, tb_do_mesh}}; - -static TBitem tb_curve_hide[]= { -{ 0, "Show Hidden|Alt H", 10, NULL}, -{ 0, "Hide Selected|Alt Ctrl H", 11, NULL}, -{ -1, "", 0, do_view3d_edit_curve_showhidemenu}}; - - -static TBitem tb_curve[]= { -{ 0, "Insert Keyframe|I", 'i', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Show/Hide Points", 0, tb_curve_hide}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_obdata[]= { -{ 0, "Duplicate|Shift D", 'D', NULL}, -{ 0, "Delete|X", 'x', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_object_parent[]= { -{ 0, "Make Parent...|Ctrl P", TB_CTRL|'p', NULL}, -{ 0, "Clear Parent...|Alt P", TB_ALT|'p', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_object_track[]= { -{ 0, "Make Track|Ctrl T", TB_CTRL|'t', NULL}, -{ 0, "Clear Track|Alt T", TB_ALT|'t', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_object[]= { -{ 0, "Insert Keyframe|I", 'i', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Make Links...|Ctrl L", TB_CTRL|'l', NULL}, -{ 0, "Make Single User...|U", 'u', NULL}, -{ 0, "Copy Attributes...|Ctrl C", TB_CTRL|'c', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Parent", 0, tb_object_parent}, -{ 0, "Track", 0, tb_object_track}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Boolean Operation|W", 'w', NULL}, -{ 0, "Join Objects...|Ctrl J", TB_CTRL|'j', NULL}, -{ 0, "Convert Object Type...|Alt C", TB_ALT|'c', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Move to Layer...|M", 'm', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - - -/* *************VIEW ********** */ - -static void tb_do_view_dt(void *arg, int event){ - G.vd->drawtype= event; - addqueue(curarea->win, REDRAW, 1); -} - -static TBitem tb_view_dt[]= { -{ ICON_BBOX, "Bounding Box", 1, NULL}, -{ ICON_WIRE, "Wireframe|Z", 2, NULL}, -{ ICON_SOLID, "Solid|Z", 3, NULL}, -{ ICON_SMOOTH, "Shaded|Shift Z", 4, NULL}, -{ ICON_POTATO, "Textured|Alt Z", 5, NULL}, -{ -1, "", 0, tb_do_view_dt}}; - -static TBitem tb_view_alignview[]= { -{ 0, "Center View to Cursor|C", 'c', NULL}, -{ 0, "Align Active Camera to View|Ctrl Alt NumPad 0", -TB_CTRL|TB_ALT|TB_PAD|'0', NULL}, -{ 0, "Align View to Selected|NumPad *", TB_PAD|'*', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_view[]= { -{ 0, "Viewport Shading", 0, tb_view_dt}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Ortho/Perspective|NumPad 5", TB_PAD|'5', NULL}, -{ 0, "Local/Global View|NumPad /", TB_PAD|'/', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Align View", 0, tb_view_alignview}, -{ 0, "SEPR", 0, NULL}, -{ 0, "View Selected|NumPad .", TB_PAD|'.', NULL}, -{ 0, "View All|Home", TB_PAD|'h', NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Play Back Animation|Alt A", TB_ALT|'a', NULL}, -{ 0, "Camera Fly Mode|Shift F", TB_SHIFT|'f', NULL}, -{ -1, "", 0, tb_do_hotkey}}; - - -/* *************TRANSFORM ********** */ - -static TBitem tb_transform_moveaxis[]= { -{ 0, "X Global|G, X", 0, NULL}, -{ 0, "Y Global|G, Y", 1, NULL}, -{ 0, "Z Global|G, Z", 2, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "X Local|G, X, X", 3, NULL}, -{ 0, "Y Local|G, Y, Y", 4, NULL}, -{ 0, "Z Local|G, Z, Z", 5, NULL}, -{ -1, "", 0, do_view3d_transform_moveaxismenu}}; - -static TBitem tb_transform_rotateaxis[]= { -{ 0, "X Global|R, X", 0, NULL}, -{ 0, "Y Global|R, Y", 1, NULL}, -{ 0, "Z Global|R, Z", 2, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "X Local|R, X, X", 3, NULL}, -{ 0, "Y Local|R, Y, Y", 4, NULL}, -{ 0, "Z Local|R, Z, Z", 5, NULL}, -{ -1, "", 0, do_view3d_transform_rotateaxismenu}}; - -static TBitem tb_transform_scaleaxis[]= { -{ 0, "X Global|S, X", 0, NULL}, -{ 0, "Y Global|S, Y", 1, NULL}, -{ 0, "Z Global|S, Z", 2, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "X Local|S, X, X", 3, NULL}, -{ 0, "Y Local|S, Y, Y", 4, NULL}, -{ 0, "Z Local|S, Z, Z", 5, NULL}, -{ -1, "", 0, do_view3d_transform_scaleaxismenu}}; - -static void tb_do_transform_clearapply(void *arg, int event) -{ - Object *ob; - ob= OBACT; - - switch(event) - { - case 0: /* clear location */ - clear_object('g'); - break; - case 1: /* clear rotation */ - clear_object('r'); - break; - case 2: /* clear scale */ - clear_object('s'); - break; - case 3: /* apply scale/rotation */ - apply_object(); - break; - case 4: /* apply deformation */ - object_apply_deform(ob); - break; - case 5: /* make duplicates real */ - if (ob->transflag & OB_DUPLI) make_duplilist_real(); - else error("The active object does not have dupliverts"); - break; - } -} - -static TBitem tb_transform_clearapply[]= { -{ 0, "Clear Location|Alt G", 0, NULL}, -{ 0, "Clear Rotation|Alt R", 1, NULL}, -{ 0, "Clear Scale|Alt S", 2, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Apply Scale/Rotation|Ctrl A", 3, NULL}, -{ 0, "Apply Deformation|Shift Ctrl A", 4, NULL}, -{ 0, "Make Duplicates Real|Shift Ctrl A", 5, NULL}, -{ -1, "", 0, tb_do_transform_clearapply}}; - -static TBitem tb_transform_snap[]= { -{ 0, "Selection -> Grid|Shift S, 1", 1, NULL}, -{ 0, "Selection -> Cursor|Shift S, 2", 2, NULL}, -{ 0, "Cursor -> Grid|Shift S, 3", 3, NULL}, -{ 0, "Cursor -> Selection|Shift S, 4", 4, NULL}, -{ 0, "Selection -> Center|Shift S, 5", 5, NULL}, -{ -1, "", 0, do_view3d_edit_snapmenu}}; - -static void tb_do_transform(void *arg, int event) -{ - switch(event) - { - case 0: /* Grab/move */ - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - break; - case 1: /* Rotate */ - initTransform(TFM_ROTATION, CTX_NONE); - Transform(); - break; - case 2: /* Scale */ - initTransform(TFM_RESIZE,CTX_NONE); - Transform(); - break; - case 3: /* transform properties */ - add_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - break; - case 4: /* snap */ - snapmenu(); - break; - case 5: /* Shrink/Fatten Along Normals */ - initTransform(TFM_SHRINKFATTEN, CTX_NONE); - Transform(); - break; - case 6: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 7: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - break; - case 8: /* proportional edit (toggle) */ - if(G.scene->proportional) G.scene->proportional= 0; - else G.scene->proportional= 1; - break; - case 10: - docenter(0); - break; - case 11: - docenter_new(); - break; - case 12: - docenter_cursor(); - break; - } - allqueue(REDRAWVIEW3D, 0); -} - -static TBitem tb_transform_object_mirror[]= { -{ 0, "X Local|Ctrl M, 1", 1, NULL}, -{ 0, "Y Local|Ctrl M, 2", 2, NULL}, -{ 0, "Z Local|Ctrl M, 3", 3, NULL}, -{ -1, "", 0, do_view3d_object_mirrormenu}}; - -static TBitem tb_transform[]= { -{ 0, "Grab/Move|G", 0, NULL}, -{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis}, -{ 0, "Rotate|R", 1, NULL}, -{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis}, -{ 0, "Scale|S", 2, NULL}, -{ 0, "Scale on Axis", 0, tb_transform_scaleaxis}, -{ 0, "SEPR", 0, NULL}, -{ 0, "ObData to Center", 10, NULL}, -{ 0, "Center New", 11, NULL}, -{ 0, "Center Cursor", 12, NULL}, -{ 0, "SEPR", 0, NULL}, -{ ICON_MENU_PANEL, "Properties|N", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Mirror", 0, tb_transform_object_mirror}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Snap", 0, tb_transform_snap}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Clear/Apply", 0, tb_transform_clearapply}, -{ -1, "", 0, tb_do_transform}}; - -static TBitem tb_transform_edit_mirror[]= { -{ 0, "X Global|Ctrl M, 1", 1, NULL}, -{ 0, "Y Global|Ctrl M, 2", 2, NULL}, -{ 0, "Z Global|Ctrl M, 3", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "X Local|Ctrl M, 4", 4, NULL}, -{ 0, "Y Local|Ctrl M, 5", 5, NULL}, -{ 0, "Z Local|Ctrl M, 6", 6, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "X View|Ctrl M, 7", 7, NULL}, -{ 0, "Y View|Ctrl M, 8", 8, NULL}, -{ 0, "Z View|Ctrl M, 9", 9, NULL}, -{ -1, "", 0, do_view3d_edit_mirrormenu}}; - -static TBitem tb_transform_editmode1[]= { -{ 0, "Grab/Move|G", 0, NULL}, -{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis}, -{ 0, "Rotate|R", 1, NULL}, -{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis}, -{ 0, "Scale|S", 2, NULL}, -{ 0, "Scale on Axis", 0, tb_transform_scaleaxis}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Shrink/Fatten|Alt S", 5, NULL}, -{ 0, "Shear|Ctrl S", 6, NULL}, -{ 0, "Warp|Shift W", 7, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "ObData to Center", 10, NULL}, -{ 0, "SEPR", 0, NULL}, -{ ICON_MENU_PANEL, "Properties|N", 3, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Mirror", 0, tb_transform_edit_mirror}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Snap", 0, tb_transform_snap}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Proportional Edit|O", 8, NULL}, -{ -1, "", 0, tb_do_transform}}; - - -static TBitem tb_transform_editmode2[]= { -{ 0, "Grab/Move|G", 0, NULL}, -{ 0, "Grab/Move on Axis| ", 0, tb_transform_moveaxis}, -{ 0, "Rotate|R", 1, NULL}, -{ 0, "Rotate on Axis", 0, tb_transform_rotateaxis}, -{ 0, "Scale|S", 2, NULL}, -{ 0, "Scale on Axis", 0, tb_transform_scaleaxis}, -{ 0, "SEPR", 0, NULL}, -{ ICON_MENU_PANEL, "Properties|N", 3, NULL}, -{ 0, "Snap", 0, tb_transform_snap}, -{ -1, "", 0, tb_do_transform}}; - - -/* *************ADD ********** */ - -static TBitem addmenu_curve[]= { -{ 0, "Bezier Curve", 0, NULL}, -{ 0, "Bezier Circle", 1, NULL}, -{ 0, "NURBS Curve", 2, NULL}, -{ 0, "NURBS Circle", 3, NULL}, -{ 0, "Path", 4, NULL}, -{ -1, "", 0, do_info_add_curvemenu}}; - -static TBitem addmenu_surf[]= { -{ 0, "NURBS Curve", 0, NULL}, -{ 0, "NURBS Circle", 1, NULL}, -{ 0, "NURBS Surface", 2, NULL}, -{ 0, "NURBS Tube", 3, NULL}, -{ 0, "NURBS Sphere", 4, NULL}, -{ 0, "NURBS Donut", 5, NULL}, -{ -1, "", 0, do_info_add_surfacemenu}}; - -static TBitem addmenu_meta[]= { -{ 0, "Meta Ball", 0, NULL}, -{ 0, "Meta Tube", 1, NULL}, -{ 0, "Meta Plane", 2, NULL}, -{ 0, "Meta Ellipsoid", 3, NULL}, -{ 0, "Meta Cube", 4, NULL}, -{ -1, "", 0, do_info_add_metamenu}}; - -static TBitem addmenu_lamp[]= { -{ 0, "Lamp", 0, NULL}, -{ 0, "Sun", 1, NULL}, -{ 0, "Spot", 2, NULL}, -{ 0, "Hemi", 3, NULL}, -{ 0, "Area", 4, NULL}, -{ -1, "", 0, do_info_add_lampmenu}}; - -static TBitem addmenu_YF_lamp[]= { -{ 0, "Lamp", 0, NULL}, -{ 0, "Sun", 1, NULL}, -{ 0, "Spot", 2, NULL}, -{ 0, "Hemi", 3, NULL}, -{ 0, "Area", 4, NULL}, -{ 0, "Photon", 5, NULL}, -{ -1, "", 0, do_info_add_lampmenu}}; - - -static TBitem addmenu_armature[]= { -{ 0, "Bone", 8, NULL}, -{ -1, "", 0, do_info_addmenu}}; - -/* dynamic items */ -#define TB_ADD_MESH 0 -#define TB_ADD_GROUP 7 -#define TB_ADD_LAMP 10 - -static TBitem tb_add[]= { -{ 0, "Mesh", 0, NULL}, -{ 0, "Curve", 1, addmenu_curve}, -{ 0, "Surface", 2, addmenu_surf}, -{ 0, "Meta", 3, addmenu_meta}, -{ 0, "Text", 4, NULL}, -{ 0, "Empty", 5, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Group", 10, NULL}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Camera", 6, NULL}, -{ 0, "Lamp", 7, addmenu_lamp}, -{ 0, "SEPR", 0, NULL}, -{ 0, "Armature", 8, NULL}, -{ 0, "Lattice", 9, NULL}, -{ -1, "", 0, do_info_addmenu}}; - -static TBitem tb_empty[]= { -{ 0, "Nothing...", 0, NULL}, -{ -1, "", 0, NULL}}; - - -/* *************RENDER ********** */ - -static void tb_do_render(void *arg, int event){ - switch(event) - { - case 1: /* set render border */ - set_render_border(); - break; - case 2: /* render */ - BIF_do_render(0); - break; - case 3: /* render anim */ - BIF_do_render(1); - break; - case 4: /* passepartout */ - { - Camera *ca= NULL; - if(G.vd->camera==NULL) return; - - if(G.vd->camera->type==OB_CAMERA) - ca= G.vd->camera->data; - else return; - - if (ca && (ca->flag & CAM_SHOWPASSEPARTOUT)) - ca->flag &= ~CAM_SHOWPASSEPARTOUT; - else - ca->flag |= CAM_SHOWPASSEPARTOUT; - allqueue(REDRAWVIEW3D, 0); - } - break; - case 5: /*preview render */ - toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0); - scrarea_queue_winredraw(curarea); - break; - } -} - -static TBitem tb_render[]= { - { 0, "Passepartout", 4, NULL}, - { 0, "Set Border|Shift B", 1, NULL}, - { 0, "SEPR", 0, NULL}, - { 0, "Render|F12", 2, NULL}, - { 0, "Anim|Ctrl F12", 3, NULL}, - { 0, "Preview|Shift P", 5, NULL}, - { -1, "", 0, tb_do_render}}; - -/* ************************* NODES *********************** */ - - -/* dynamic items */ - -static TBitem tb_node_addsh[]= { - { 0, "Input", 1, NULL}, - { 0, "Output", 2, NULL}, - { 0, "Color", 3, NULL}, - { 0, "Vector", 4, NULL}, - { 0, "Convertor", 5, NULL}, - { 0, "Group", 6, NULL}, - { -1, "", 0, NULL}}; - -static TBitem tb_node_addcomp[]= { - { 0, "Input", 1, NULL}, - { 0, "Output", 2, NULL}, - { 0, "Color", 3, NULL}, - { 0, "Vector", 4, NULL}, - { 0, "Filter", 5, NULL}, - { 0, "Convertor", 6, NULL}, - { 0, "Matte", 7, NULL}, - { 0, "Distort", 8, NULL}, - { 0, "Group", 9, NULL}, - { -1, "", 0, NULL}}; - -/* do_node_addmenu() in header_node.c, prototype in BSE_headerbuttons.h */ - -/* dynamic toolbox sublevel */ -static TBitem *node_add_sublevel(ListBase *storage, bNodeTree *ntree, int nodeclass) -{ - static TBitem _addmenu[]= { { 0, " ", 0, NULL}, { -1, "", 0, NULL}}; - Link *link; - TBitem *addmenu; - int tot= 0, a; - - if(ntree) { - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= G.main->nodetree.first; - for(; ngroup; ngroup= ngroup->id.next) - if(ngroup->type==ntree->type) - tot++; - } - else { - bNodeType *ntype = ntree->alltypes.first; - while(ntype) { - if(ntype->nclass == nodeclass) { - tot++; - } - ntype= ntype->next; - } - } - } - if(tot==0) { - return _addmenu; - } - - link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "types menu"); - BLI_addtail(storage, link); - addmenu= (TBitem *)(link+1); - - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= G.main->nodetree.first; - for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) { - if(ngroup->type==ntree->type) { - addmenu[a].name= ngroup->id.name+2; - addmenu[a].retval= NODE_GROUP_MENU+tot; /* so we can use BLI_findlink() */ - a++; - } - } - } - else { - bNodeType *ntype= ntree->alltypes.first; - for(a=0; ntype; ntype= ntype->next) { - if( ntype->nclass == nodeclass ) { - addmenu[a].name= ntype->name; - addmenu[a].retval= ntype->type; - a++; - } - } - } - - addmenu[a].icon= -1; /* end signal */ - addmenu[a].name= ""; - addmenu[a].retval= a; - addmenu[a].poin= do_node_addmenu; - - return addmenu; -} - - -static TBitem tb_node_node[]= { - { 0, "Duplicate|Shift D", TB_SHIFT|'d', NULL}, - { 0, "Delete|X", 'x', NULL}, - { 0, "SEPR", 0, NULL}, - { 0, "Make Group|Ctrl G", TB_CTRL|'g', NULL}, - { 0, "Ungroup|Alt G", TB_ALT|'g', NULL}, - { 0, "Edit Group|Tab", TB_TAB, NULL}, - { 0, "SEPR", 0, NULL}, - { 0, "Hide/Unhide|H", 'h', NULL}, - { 0, "SEPR", 0, NULL}, - { 0, "Read Saved Render Results|R", 'r', NULL}, - { 0, "Show Cyclic Dependencies|C", 'c', NULL}, - { -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_node_select[]= { - { 0, "Select/Deselect All|A", 'a', NULL}, - { 0, "Border Select|B", 'b', NULL}, - { -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_node_transform[]= { - { 0, "Grab/Move|G", 'g', NULL}, - { -1, "", 0, tb_do_hotkey}}; - -static TBitem tb_node_view[]= { - { 0, "Zoom In|NumPad +", TB_PAD|'+', NULL}, - { 0, "Zoom Out|NumPad -", TB_PAD|'-', NULL}, - { 0, "View All|Home", TB_PAD|'h', NULL}, - { -1, "", 0, tb_do_hotkey}}; - - -/* *********************************************** */ - -static uiBlock *tb_makemenu(void *arg) -{ - static int counter=0; - TBitem *item= arg, *itemt; - uiBlock *block; - int xco= 0, yco= 0; - char str[10]; - - if(arg==NULL) return NULL; - - sprintf(str, "tb %d", counter++); - block= uiNewBlock(&tb_listb, str, UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetCol(block, TH_MENU_ITEM); - - // last item has do_menu func, has to be stored in each button - itemt= item; - while(itemt->icon != -1) itemt++; - uiBlockSetButmFunc(block, itemt->poin, NULL); - - // now make the buttons - while(item->icon != -1) { - - if(strcmp(item->name, "SEPR")==0) { - uiDefBut(block, SEPR, 0, "", xco, yco-=6, 50, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - else if(item->icon) { - uiDefIconTextBut(block, BUTM, 1, item->icon, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, ""); - } - else if(item->poin) { - uiDefIconTextBlockBut(block, tb_makemenu, item->poin, ICON_RIGHTARROW_THIN, item->name, 0, yco-=20, 80, 19, ""); - } - else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, item->name, xco, yco-=20, 80, 19, NULL, 0.0, 0.0, 0, item->retval, ""); - } - - if(yco <= -600) { - yco = 0; - xco += 80; - } - - item++; - } - - uiTextBoundsBlock(block, 60); - - /* direction is also set in the function that calls this */ - if(U.uiflag & USER_PLAINMENUS) - uiBlockSetDirection(block, UI_RIGHT); - else - uiBlockSetDirection(block, UI_RIGHT|UI_CENTER); - - return block; -} - -static int tb_mainx= 1234, tb_mainy= 0; -static void store_main(void *arg1, void *arg2) -{ - tb_mainx= (long)arg1; - tb_mainy= (long)arg2; -} - -static void do_group_addmenu(void *arg, int event) -{ - Object *ob; - - if(event<0) return; - - add_object_draw(OB_EMPTY); - ob= OBACT; - - ob->dup_group= BLI_findlink(&G.main->group, event); - if(ob->dup_group) { - id_us_plus((ID *)ob->dup_group); - ob->transflag |= OB_DUPLIGROUP; - DAG_scene_sort(G.scene); - } -} - -/* helper for create group menu */ -static void tag_groups_for_toolbox(void) -{ - Group *group; - GroupObject *go; - - for(group= G.main->group.first; group; group= group->id.next) - group->id.flag |= LIB_DOIT; - - for(group= G.main->group.first; group; group= group->id.next) { - if(group->id.flag & LIB_DOIT) - for(go= group->gobject.first; go; go= go->next) - if(go->ob && go->ob->dup_group) - go->ob->dup_group->id.flag &= ~LIB_DOIT; - } -} - -/* helper for create group menu */ -/* note that group id.flag was set */ -static int count_group_libs(void) -{ - Group *group; - Library *lib; - int tot= 0; - - for(lib= G.main->library.first; lib; lib= lib->id.next) - lib->id.flag |= LIB_DOIT; - - for(group= G.main->group.first; group; group= group->id.next) { - if(group->id.flag & LIB_DOIT) { - if(group->id.lib && (group->id.lib->id.flag & LIB_DOIT)) { - group->id.lib->id.flag &= ~LIB_DOIT; - tot++; - } - } - } - return tot; -} - -/* dynamic toolbox sublevel */ -static TBitem *create_group_sublevel(ListBase *storage, Library *lib) -{ - static TBitem addmenu[]= { { 0, "No Groups", 0, NULL}, { -1, "", 0, NULL}}; - Link *link; - TBitem *groupmenu, *gm; - Group *group; - int a; - int tot= BLI_countlist(&G.main->group); - - if(tot==0) { - return addmenu; - } - - /* build menu, we insert a Link before the array of TBitems */ - link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(tot+1), "group menu lib"); - BLI_addtail(storage, link); - gm= groupmenu= (TBitem *)(link+1); - for(a=0, group= G.main->group.first; group; group= group->id.next, a++) { - if(group->id.lib==lib && (group->id.flag & LIB_DOIT)) { - gm->name= group->id.name+2; - gm->retval= a; - gm++; - } - } - gm->icon= -1; /* end signal */ - gm->name= ""; - gm->retval= a; - gm->poin= do_group_addmenu; - - return groupmenu; -} - -static TBitem *create_group_all_sublevels(ListBase *storage) -{ - Library *lib; - Group *group; - Link *link; - TBitem *groupmenu, *gm; - int a; - int totlevel= 0; - int totlocal= 0; - - /* we add totlevel + local groups entries */ - - /* let's skip group-in-group */ - tag_groups_for_toolbox(); - - /* this call checks for skipped group-in-groups */ - totlevel= count_group_libs(); - - for(group= G.main->group.first; group; group= group->id.next) - if(group->id.flag & LIB_DOIT) - if(group->id.lib==NULL) - totlocal++; - - if(totlocal+totlevel==0) - return create_group_sublevel(storage, NULL); - - /* build menu, we insert a Link before the array of TBitems */ - link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totlocal+totlevel+1), "group menu"); - BLI_addtail(storage, link); - gm= groupmenu= (TBitem *)(link+1); - - /* first all levels. libs with groups are not tagged */ - for(lib= G.main->library.first; lib; lib= lib->id.next) { - if(!(lib->id.flag & LIB_DOIT)) { - char *str; - /* do some tricks to get .blend file name without extension */ - link= MEM_callocN(sizeof(Link) + 128, "string"); - BLI_addtail(storage, link); - str= (char *)(link+1); - BLI_strncpy(str, BLI_last_slash(lib->filename)+1, 128); - if(strlen(str)>6) str[strlen(str)-6]= 0; - gm->name= str; - gm->retval= -1; - gm->poin= create_group_sublevel(storage, lib); - gm++; - } - } - /* remaining groups */ - for(a=0, group= G.main->group.first; group; group= group->id.next, a++) { - if(group->id.lib==NULL && (group->id.flag & LIB_DOIT)) { - gm->name= group->id.name+2; - gm->retval= a; - gm++; - } - } - gm->icon= -1; /* end signal */ - gm->name= ""; - gm->retval= a; - gm->poin= do_group_addmenu; - - return groupmenu; -} - -static TBitem *create_mesh_sublevel(ListBase *storage) -{ - Link *link; - TBitem *meshmenu, *mm; - int totmenu= 10, totpymenu=0, a=0; - - /* Python Menu */ - BPyMenu *pym; - - /* count the python menu items*/ - for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, totpymenu++) {} - if (totpymenu) totmenu += totpymenu+1; /* add 1 for the seperator */ - - link= MEM_callocN(sizeof(Link) + sizeof(TBitem)*(totmenu+1), "mesh menu"); - BLI_addtail(storage, link); - mm= meshmenu= (TBitem *)(link+1); - - mm->icon = 0; mm->retval= a; mm->name = "Plane"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Cube"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Circle"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "UVsphere"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Icosphere"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Cylinder"; mm++; a++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Cone"; mm++; a++; - mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++; - mm->icon = 0; mm->retval= a; mm->name = "Grid"; mm++; a++; - mm->icon = 0; mm->retval= a; mm->name = "Monkey"; mm++; a++; - /* a == 10 */ - - if (totpymenu) { - int i=0; - mm->icon = 0; mm->retval= 0; mm->name = "SEPR"; mm++; - - /* note that we account for the 10 previous entries with i+4: */ - for (pym = BPyMenuTable[PYMENU_ADDMESH]; pym; pym = pym->next, i++) { - mm->icon = ICON_PYTHON; - mm->retval= i+20; - mm->name = pym->name; - mm++; a++; - } - } - - /* terminate the menu */ - mm->icon= -1; mm->retval= a; mm->name= ""; mm->poin= do_info_add_meshmenu; - - return meshmenu; -} - - - -void toolbox_n(void) -{ - uiBlock *block; - uiBut *but; - ListBase storage= {NULL, NULL}; - TBitem *menu1=NULL, *menu2=NULL, *menu3=NULL; - TBitem *menu4=NULL, *menu5=NULL, *menu6=NULL; - TBitem *menu7=NULL; - int dx=0; - short event, mval[2], tot=0; - char *str1=NULL, *str2=NULL, *str3=NULL, *str4=NULL, *str5=NULL, *str6=NULL, *str7=NULL; - - /* temporal too... when this flag is (was) saved, it should initialize OK */ - if(tb_mainx==1234) { - if(U.uiflag & USER_PLAINMENUS) { - tb_mainx= -32; - tb_mainy= -5; - } else { - tb_mainx= 0; - tb_mainy= -5; - } - } - - mywinset(G.curscreen->mainwin); // we go to screenspace - - block= uiNewBlock(&tb_listb, "toolbox", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1); - uiBlockSetCol(block, TH_MENU_ITEM); - - /* select context for main items */ - if(curarea->spacetype==SPACE_VIEW3D) { - - /* dynamic menu entries */ - tb_add[TB_ADD_GROUP].poin= create_group_all_sublevels(&storage); - tb_add[TB_ADD_MESH].poin= create_mesh_sublevel(&storage); - - /* static */ - if (G.scene->r.renderer==R_YAFRAY) - tb_add[TB_ADD_LAMP].poin= addmenu_YF_lamp; - else - tb_add[TB_ADD_LAMP].poin= addmenu_lamp; - - if(U.uiflag & USER_PLAINMENUS) { - menu1= tb_add; str1= "Add"; - menu2= tb_object_edit; str2= "Edit"; - menu3= tb_object_select; str3= "Select"; - menu4= tb_transform; str4= "Transform"; - menu5= tb_object; str5= "Object"; - menu6= tb_view; str6= "View"; - menu7= tb_render; str7= "Render"; - - dx= 96; - tot= 7; - } else { - /* 3x2 layout menu */ - menu1= tb_object; str1= "Object"; - menu2= tb_add; str2= "Add"; - menu3= tb_object_select; str3= "Select"; - menu4= tb_object_edit; str4= "Edit"; - menu5= tb_transform; str5= "Transform"; - menu6= tb_view; str6= "View"; - - dx= 64; - tot= 6; - } - - if(G.obedit) { - if(U.uiflag & USER_PLAINMENUS) { - switch(G.obedit->type){ - case OB_MESH: - menu1= create_mesh_sublevel(&storage); - menu2= tb_mesh_edit; - menu3= tb_mesh_select; - menu4= tb_transform_editmode1; - menu5= tb_mesh; str5= "Mesh"; - break; - case OB_CURVE: - menu1= addmenu_curve; - menu2= tb_curve_edit; - menu3= tb_curve_select; - menu4= tb_transform_editmode1; - menu5= tb_curve; str5= "Curve"; - break; - case OB_SURF: - menu1= addmenu_surf; - menu2= tb_curve_edit; - menu3= tb_curve_select; - menu4= tb_transform_editmode1; - menu5= tb_curve; str5= "Surface"; - break; - case OB_MBALL: - menu1= addmenu_meta; - menu2= tb_edit; - menu3= tb_mball_select; - menu4= tb_transform_editmode2; - menu5= tb_obdata; str5= "Meta"; - break; - case OB_ARMATURE: - menu1= addmenu_armature; - menu2= tb_edit; - menu3= tb__select; - menu4= tb_transform_editmode2; - menu5= tb_obdata;str5= "Armature"; - break; - case OB_LATTICE: - menu1= tb_empty; - menu2= tb_edit; - menu3= tb__select; - menu4= tb_transform_editmode1; - menu5= tb_empty;str5= "Lattice"; - break; - } - } else { - if(G.obedit->type==OB_MESH) { - menu1= tb_mesh; str1= "Mesh"; - menu2= create_mesh_sublevel(&storage); - menu3= tb_mesh_select; - menu4= tb_mesh_edit; - menu5= tb_transform_editmode1; - } - else if(G.obedit->type==OB_CURVE) { - menu1= tb_curve; str1= "Curve"; - menu2= addmenu_curve; - menu3= tb_curve_select; - menu4= tb_curve_edit; - menu5= tb_transform_editmode1; - } - else if(G.obedit->type==OB_SURF) { - menu1= tb_curve; str1= "Surface"; - menu2= addmenu_surf; - menu3= tb_curve_select; - menu4= tb_curve_edit; - menu5= tb_transform_editmode1; - } - else if(G.obedit->type==OB_MBALL) { - menu1= tb_obdata; str1= "Meta"; - menu2= addmenu_meta; - menu3= tb__select; - menu4= tb_edit; - menu5= tb_transform_editmode2; - } - else if(G.obedit->type==OB_ARMATURE) { - menu1= tb_obdata;str1= "Armature"; - menu2= addmenu_armature; - menu3= tb__select; - menu4= tb_edit; - menu5= tb_transform_editmode2; - } - else if(G.obedit->type==OB_LATTICE) { - menu1= tb_empty;str1= "Lattice"; - menu2= tb_empty; - menu3= tb__select; - menu4= tb_edit; - menu5= tb_transform_editmode1; - } - } - } - else if (FACESEL_PAINT_TEST) { - menu3 = tb_face_select; - } - } - else if(curarea->spacetype==SPACE_NODE) { - SpaceNode *snode= curarea->spacedata.first; - - if(snode->treetype==NTREE_COMPOSIT) - menu1= tb_node_addcomp; - else - menu1= tb_node_addsh; - str1= "Add"; - menu2= tb_node_node; str2= "Node"; - menu3= tb_node_select; str3= "Select"; - menu4= tb_node_transform; str4= "Transform"; - menu5= tb_node_view; str5= "View"; - - if(snode->treetype==NTREE_SHADER) { - menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT); - menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT); - menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR); - menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR); - menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR); - menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP); - } - else if(snode->treetype==NTREE_COMPOSIT) { - menu1[0].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_INPUT); - menu1[1].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OUTPUT); - menu1[2].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_COLOR); - menu1[3].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_VECTOR); - menu1[4].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_OP_FILTER); - menu1[5].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_CONVERTOR); - menu1[6].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_MATTE); - menu1[7].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_DISTORT); - menu1[8].poin= node_add_sublevel(&storage, snode->nodetree, NODE_CLASS_GROUP); - - } - - dx= 96; - tot= 5; - - } - - getmouseco_sc(mval); - - /* create the main buttons menu */ - if(tot==6) { - - /* check if it fits */ - if(mval[0]-1.5*dx+tb_mainx < 6) mval[0]= 6 + 1.5*dx -tb_mainx; - else if(mval[0]+1.5*dx+tb_mainx > G.curscreen->sizex-6) - mval[0]= G.curscreen->sizex-6-1.5*dx-tb_mainx; - - if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy; - else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6) - mval[1]= G.curscreen->sizey-6-20-tb_mainy; - - but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)-5); - - but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_TOP); - uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)-5); - - but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT); - uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)-5); - - but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)5); - - but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_DOWN); - uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)5); - - but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT); - uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)5); - } else if (tot==5 || tot==7) { - /* check if it fits, dubious */ - if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx; - else if(mval[0]+0.25*dx+tb_mainx > G.curscreen->sizex-6) - mval[0]= G.curscreen->sizex-6-0.25*dx-tb_mainx; - - if(mval[1]-20+tb_mainy < 6) mval[1]= 6+20 -tb_mainy; - else if(mval[1]+20+tb_mainy > G.curscreen->sizey-6) - mval[1]= G.curscreen->sizey-6-20-tb_mainy; - - but=uiDefIconTextBlockBut(block, tb_makemenu, menu1, ICON_RIGHTARROW_THIN, str1, mval[0]+tb_mainx,mval[1]+tb_mainy, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)-5); - - but=uiDefIconTextBlockBut(block, tb_makemenu, menu2, ICON_RIGHTARROW_THIN, str2, mval[0]+tb_mainx,mval[1]+tb_mainy-20, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)15); - - but=uiDefIconTextBlockBut(block, tb_makemenu, menu3, ICON_RIGHTARROW_THIN, str3, mval[0]+tb_mainx,mval[1]+tb_mainy-40, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)35); - - but=uiDefIconTextBlockBut(block, tb_makemenu, menu4, ICON_RIGHTARROW_THIN, str4, mval[0]+tb_mainx,mval[1]+tb_mainy-60, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)55); - - but=uiDefIconTextBlockBut(block, tb_makemenu, menu5, ICON_RIGHTARROW_THIN, str5, mval[0]+tb_mainx,mval[1]+tb_mainy-80, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)75); - - if(tot>5) { - but=uiDefIconTextBlockBut(block, tb_makemenu, menu6, ICON_RIGHTARROW_THIN, str6, mval[0]+tb_mainx,mval[1]+tb_mainy-100, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)95); - } - if(tot>6) { - but=uiDefIconTextBlockBut(block, tb_makemenu, menu7, ICON_RIGHTARROW_THIN, str7, mval[0]+tb_mainx,mval[1]+tb_mainy-120, dx, 19, ""); - uiButSetFlag(but, UI_MAKE_RIGHT); - uiButSetFunc(but, store_main, (void *)-32, (void *)105); - } - } - - uiBoundsBlock(block, 2); - event= uiDoBlocks(&tb_listb, 0, 1); - - /* free all dynamic entries... */ - BLI_freelistN(&storage); - - mywinset(curarea->win); -} - -void toolbox_n_add(void) -{ - reset_toolbox(); - toolbox_n(); -} - -void reset_toolbox(void) -{ - if(U.uiflag & USER_PLAINMENUS) { - tb_mainx= -32; - tb_mainy= -5; - } else { - tb_mainx= 0; - tb_mainy= -5; - } -} diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c deleted file mode 100644 index 632af9e269b..00000000000 --- a/source/blender/src/transform.c +++ /dev/null @@ -1,4115 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_armature_types.h" -#include "DNA_action_types.h" /* for some special action-editor settings */ -#include "DNA_constraint_types.h" -#include "DNA_ipo_types.h" /* some silly ipo flag */ -#include "DNA_listBase.h" -#include "DNA_meshdata_types.h" -#include "DNA_mesh_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" /* PET modes */ -#include "DNA_screen_types.h" /* area dimensions */ -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_texture_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" -#include "DNA_space_types.h" - -#include "BIF_editview.h" /* arrows_move_cursor */ -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" /* undo */ -#include "BIF_toets.h" /* persptoetsen */ -#include "BIF_mywindow.h" /* warp_pointer */ -#include "BIF_toolbox.h" /* notice */ -#include "BIF_editmesh.h" -#include "BIF_editsima.h" -#include "BIF_editparticle.h" -#include "BIF_drawimage.h" /* uvco_to_areaco_noclip */ -#include "BIF_editaction.h" - -#include "BKE_action.h" /* get_action_frame */ -#include "BKE_constraint.h" -#include "BKE_global.h" -#include "BKE_utildefines.h" -#include "BKE_bad_level_calls.h"/* popmenu and error */ -#include "BKE_particle.h" - -#include "BSE_drawipo.h" -#include "BSE_editnla_types.h" /* for NLAWIDTH */ -#include "BSE_editaction_types.h" -#include "BSE_time.h" -#include "BSE_view.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "PIL_time.h" /* sleep */ - -#include "blendef.h" - -#include "mydevice.h" - -#include "transform.h" - -/* GLOBAL VARIABLE THAT SHOULD MOVED TO SCREEN MEMBER OR SOMETHING */ -TransInfo Trans = {TFM_INIT, 0}; // enforce init on first usage - -/******************************** Helper functions ************************************/ - -/* GLOBAL Wrapper Fonctions */ - -void BIF_drawSnap() -{ - drawSnapping(&Trans); -} - -/* ************************** Dashed help line **************************** */ - - -/* bad frontbuffer call... because it is used in transform after force_draw() */ -static void helpline(TransInfo *t, float *vec) -{ - float vecrot[3], cent[2]; - short mval[2]; - - VECCOPY(vecrot, vec); - if(t->flag & T_EDIT) { - Object *ob=G.obedit; - if(ob) Mat4MulVecfl(ob->obmat, vecrot); - } - else if(t->flag & T_POSE) { - Object *ob=t->poseobj; - if(ob) Mat4MulVecfl(ob->obmat, vecrot); - } - - getmouseco_areawin(mval); - projectFloatView(t, vecrot, cent); // no overflow in extreme cases - if(cent[0]!=IS_CLIPPED) { - persp(PERSP_WIN); - - glDrawBuffer(GL_FRONT); - - BIF_ThemeColor(TH_WIRE); - - setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(mval); - glVertex2fv(cent); - glEnd(); - setlinestyle(0); - - persp(PERSP_VIEW); - bglFlush(); // flush display for frontbuffer - glDrawBuffer(GL_BACK); - } -} -/* ************************** INPUT FROM MOUSE *************************** */ - -float InputScaleRatio(TransInfo *t, short mval[2]) { - float ratio, dx, dy; - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - dx = (float)(t->center2d[0] - t->shiftmval[0]); - dy = (float)(t->center2d[1] - t->shiftmval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - - dx= (float)(t->center2d[0] - mval[0]); - dy= (float)(t->center2d[1] - mval[1]); - ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio); - } - else { - dx = (float)(t->center2d[0] - mval[0]); - dy = (float)(t->center2d[1] - mval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - } - return ratio; -} - -float InputHorizontalRatio(TransInfo *t, short mval[2]) { - float x, pad; - - pad = curarea->winx / 10; - - if (t->flag & T_SHIFT_MOD) { - /* deal with Shift key by adding motion / 10 to motion before shift press */ - x = t->shiftmval[0] + (float)(mval[0] - t->shiftmval[0]) / 10.0f; - } - else { - x = mval[0]; - } - return (x - pad) / (curarea->winx - 2 * pad); -} - -float InputHorizontalAbsolute(TransInfo *t, short mval[2]) { - float vec[3]; - if(t->flag & T_SHIFT_MOD) { - float dvec[3]; - /* calculate the main translation and the precise one separate */ - convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1])); - VecMulf(dvec, 0.1f); - convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1])); - VecAddf(t->vec, t->vec, dvec); - } - else { - convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1])); - } - Projf(vec, t->vec, t->viewinv[0]); - return Inpf(t->viewinv[0], vec) * 2.0f; -} - -float InputVerticalRatio(TransInfo *t, short mval[2]) { - float y, pad; - - pad = curarea->winy / 10; - - if (t->flag & T_SHIFT_MOD) { - /* deal with Shift key by adding motion / 10 to motion before shift press */ - y = t->shiftmval[1] + (float)(mval[1] - t->shiftmval[1]) / 10.0f; - } - else { - y = mval[0]; - } - return (y - pad) / (curarea->winy - 2 * pad); -} - -float InputVerticalAbsolute(TransInfo *t, short mval[2]) { - float vec[3]; - if(t->flag & T_SHIFT_MOD) { - float dvec[3]; - /* calculate the main translation and the precise one separate */ - convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1])); - VecMulf(dvec, 0.1f); - convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1])); - VecAddf(t->vec, t->vec, dvec); - } - else { - convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1])); - } - Projf(vec, t->vec, t->viewinv[1]); - return Inpf(t->viewinv[1], vec) * 2.0f; -} - -/* ************************** SPACE DEPENDANT CODE **************************** */ - -void setTransformViewMatrices(TransInfo *t) -{ - if(t->spacetype==SPACE_VIEW3D) { - Mat4CpyMat4(t->viewmat, G.vd->viewmat); - Mat4CpyMat4(t->viewinv, G.vd->viewinv); - Mat4CpyMat4(t->persmat, G.vd->persmat); - Mat4CpyMat4(t->persinv, G.vd->persinv); - t->persp= G.vd->persp; - } - else { - Mat4One(t->viewmat); - Mat4One(t->viewinv); - Mat4One(t->persmat); - Mat4One(t->persinv); - t->persp = 0; // ortho - } - - calculateCenter2D(t); - -} - -void convertViewVec(TransInfo *t, float *vec, short dx, short dy) -{ - if (t->spacetype==SPACE_VIEW3D) { - window_to_3d(vec, dx, dy); - } - else if(t->spacetype==SPACE_IMAGE) { - float divx, divy, aspx, aspy; - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - - divx= G.v2d->mask.xmax-G.v2d->mask.xmin; - divy= G.v2d->mask.ymax-G.v2d->mask.ymin; - - vec[0]= aspx*(G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx)/divx; - vec[1]= aspy*(G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/divy; - vec[2]= 0.0f; - } - else if(t->spacetype==SPACE_IPO) { - float divx, divy; - - divx= G.v2d->mask.xmax-G.v2d->mask.xmin; - divy= G.v2d->mask.ymax-G.v2d->mask.ymin; - - vec[0]= (G.v2d->cur.xmax-G.v2d->cur.xmin)*(dx) / (divx); - vec[1]= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy) / (divy); - vec[2]= 0.0f; - } -} - -void projectIntView(TransInfo *t, float *vec, int *adr) -{ - if (t->spacetype==SPACE_VIEW3D) - project_int(vec, adr); - else if(t->spacetype==SPACE_IMAGE) { - float aspx, aspy, v[2]; - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - v[0]= vec[0]/aspx; - v[1]= vec[1]/aspy; - - uvco_to_areaco_noclip(v, adr); - } - else if(t->spacetype==SPACE_IPO) { - short out[2] = {0.0f, 0.0f}; - - ipoco_to_areaco(G.v2d, vec, out); - adr[0]= out[0]; - adr[1]= out[1]; - } -} - -void projectFloatView(TransInfo *t, float *vec, float *adr) -{ - if (t->spacetype==SPACE_VIEW3D) - project_float(vec, adr); - else if(t->spacetype==SPACE_IMAGE) { - int a[2]; - - projectIntView(t, vec, a); - adr[0]= a[0]; - adr[1]= a[1]; - } - else if(t->spacetype==SPACE_IPO) { - int a[2]; - - projectIntView(t, vec, a); - adr[0]= a[0]; - adr[1]= a[1]; - } -} - -void convertVecToDisplayNum(float *vec, float *num) -{ - TransInfo *t= BIF_GetTransInfo(); - - VECCOPY(num, vec); - - if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) { - float aspx, aspy; - - if((G.sima->flag & SI_COORDFLOATS)==0) { - int width, height; - transform_width_height_tface_uv(&width, &height); - - num[0] *= width; - num[1] *= height; - } - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - num[0] /= aspx; - num[1] /= aspy; - } -} - -void convertDisplayNumToVec(float *num, float *vec) -{ - TransInfo *t= BIF_GetTransInfo(); - - VECCOPY(vec, num); - - if ((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) { - float aspx, aspy; - - if((G.sima->flag & SI_COORDFLOATS)==0) { - int width, height; - transform_width_height_tface_uv(&width, &height); - - vec[0] /= width; - vec[1] /= height; - } - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - vec[0] *= aspx; - vec[1] *= aspy; - } -} - -static void viewRedrawForce(TransInfo *t) -{ - if (t->spacetype == SPACE_VIEW3D) - force_draw(0); - else if (t->spacetype==SPACE_IMAGE) { - if (G.sima->lock) force_draw_plus(SPACE_VIEW3D, 0); - else force_draw(0); - } - else if (t->spacetype == SPACE_ACTION) { - if (G.saction->lock) { - short context; - - /* we ignore the pointer this function returns (not needed) */ - get_action_context(&context); - - if (context == ACTCONT_ACTION) - force_draw_plus(SPACE_VIEW3D, 0); - else if (context == ACTCONT_SHAPEKEY) - force_draw_all(0); - else - force_draw(0); - } - else { - force_draw(0); - } - } - else if (t->spacetype == SPACE_NLA) { - if (G.snla->lock) - force_draw_all(0); - else - force_draw(0); - } - else if (t->spacetype == SPACE_IPO) { - /* update realtime */ - if (G.sipo->lock) { - if (G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_TE) - force_draw_plus(SPACE_BUTS, 0); - else if (G.sipo->blocktype==ID_CA) - force_draw_plus(SPACE_VIEW3D, 0); - else if (G.sipo->blocktype==ID_KE) - force_draw_plus(SPACE_VIEW3D, 0); - else if (G.sipo->blocktype==ID_PO) - force_draw_plus(SPACE_VIEW3D, 0); - else if (G.sipo->blocktype==ID_OB) - force_draw_plus(SPACE_VIEW3D, 0); - else if (G.sipo->blocktype==ID_SEQ) - force_draw_plus(SPACE_SEQ, 0); - else - force_draw(0); - } - else { - force_draw(0); - } - } -} - -static void viewRedrawPost(TransInfo *t) -{ - if(t->spacetype==SPACE_VIEW3D) { - allqueue(REDRAWBUTSOBJECT, 0); - allqueue(REDRAWVIEW3D, 0); - } - else if(t->spacetype==SPACE_IMAGE) { - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - } - else if(ELEM3(t->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_IPO)) { - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allqueue(REDRAWTIME, 0); - allqueue(REDRAWBUTSOBJECT, 0); - } - - scrarea_queue_headredraw(curarea); -} - -/* ************************** TRANSFORMATIONS **************************** */ - -void BIF_selectOrientation() { - short val; - val= pupmenu("Orientation%t|Global|Local|Normal|View"); - if(val>0) { - if(val==1) G.vd->twmode= V3D_MANIP_GLOBAL; - else if(val==2) G.vd->twmode= V3D_MANIP_LOCAL; - else if(val==3) G.vd->twmode= V3D_MANIP_NORMAL; - else if(val==4) G.vd->twmode= V3D_MANIP_VIEW; - } -} - -static void view_editmove(unsigned short event) -{ - int refresh = 0; - /* Regular: Zoom in */ - /* Shift: Scroll up */ - /* Ctrl: Scroll right */ - /* Alt-Shift: Rotate up */ - /* Alt-Ctrl: Rotate right */ - - /* only work in 3D window for now - * In the end, will have to send to event to a 2D window handler instead - */ - if (Trans.flag & T_2D_EDIT) - return; - - switch(event) { - case WHEELUPMOUSE: - - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD2); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD2); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD4); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD4); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADMINUS); - else - persptoetsen(PADPLUSKEY); - - refresh = 1; - break; - case WHEELDOWNMOUSE: - if( G.qual & LR_SHIFTKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_SHIFTKEY; - persptoetsen(PAD8); - G.qual |= LR_SHIFTKEY; - } else { - persptoetsen(PAD8); - } - } else if( G.qual & LR_CTRLKEY ) { - if( G.qual & LR_ALTKEY ) { - G.qual &= ~LR_CTRLKEY; - persptoetsen(PAD6); - G.qual |= LR_CTRLKEY; - } else { - persptoetsen(PAD6); - } - } else if(U.uiflag & USER_WHEELZOOMDIR) - persptoetsen(PADPLUSKEY); - else - persptoetsen(PADMINUS); - - refresh = 1; - break; - } - - if (refresh) - setTransformViewMatrices(&Trans); -} - -void checkFirstTime() { - if(Trans.mode==TFM_INIT) { - memset(&Trans, 0, sizeof(TransInfo)); - Trans.propsize = 1.0; - } -} - -static char *transform_to_undostr(TransInfo *t) -{ - switch (t->mode) { - case TFM_TRANSLATION: - return "Translate"; - case TFM_ROTATION: - return "Rotate"; - case TFM_RESIZE: - return "Scale"; - case TFM_TOSPHERE: - return "To Sphere"; - case TFM_SHEAR: - return "Shear"; - case TFM_WARP: - return "Warp"; - case TFM_SHRINKFATTEN: - return "Shrink/Fatten"; - case TFM_TILT: - return "Tilt"; - case TFM_TRACKBALL: - return "Trackball"; - case TFM_PUSHPULL: - return "Push/Pull"; - case TFM_CREASE: - return "Crease"; - case TFM_BONESIZE: - return "Bone Width"; - case TFM_BONE_ENVELOPE: - return "Bone Envelope"; - case TFM_TIME_TRANSLATE: - return "Translate Anim. Data"; - case TFM_TIME_SCALE: - return "Scale Anim. Data"; - case TFM_TIME_SLIDE: - return "Time Slide"; - case TFM_BAKE_TIME: - return "Key Time"; - } - return "Transform"; -} - -/* ************************************************* */ - -static void transformEvent(unsigned short event, short val) { - float mati[3][3] = {{1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}}; - char cmode = constraintModeToChar(&Trans); - - if (val) { - switch (event){ - /* enforce redraw of transform when modifiers are used */ - case LEFTCTRLKEY: - case RIGHTCTRLKEY: - Trans.redraw = 1; - break; - case LEFTSHIFTKEY: - case RIGHTSHIFTKEY: - /* shift is modifier for higher resolution transform, works nice to store this mouse position */ - getmouseco_areawin(Trans.shiftmval); - Trans.flag |= T_SHIFT_MOD; - Trans.redraw = 1; - break; - - case SPACEKEY: - if ((Trans.spacetype==SPACE_VIEW3D) && (G.qual & LR_ALTKEY)) { - short mval[2]; - - getmouseco_sc(mval); - BIF_selectOrientation(); - calc_manipulator_stats(curarea); - Mat3CpyMat4(Trans.spacemtx, G.vd->twmat); - warp_pointer(mval[0], mval[1]); - } - else { - Trans.state = TRANS_CONFIRM; - } - break; - - - case MIDDLEMOUSE: - if ((Trans.flag & T_NO_CONSTRAINT)==0) { - /* exception for switching to dolly, or trackball, in camera view */ - if (Trans.flag & T_CAMERA) { - if (Trans.mode==TFM_TRANSLATION) - setLocalConstraint(&Trans, (CON_AXIS2), "along local Z"); - else if (Trans.mode==TFM_ROTATION) { - restoreTransObjects(&Trans); - initTrackball(&Trans); - } - } - else { - Trans.flag |= T_MMB_PRESSED; - if (Trans.con.mode & CON_APPLY) { - stopConstraint(&Trans); - } - else { - if (G.qual & LR_CTRLKEY) { - initSelectConstraint(&Trans, Trans.spacemtx); - } - else { - /* bit hackish... but it prevents mmb select to print the orientation from menu */ - strcpy(Trans.spacename, "global"); - initSelectConstraint(&Trans, mati); - } - postSelectConstraint(&Trans); - } - } - Trans.redraw = 1; - } - break; - case ESCKEY: - case RIGHTMOUSE: - Trans.state = TRANS_CANCEL; - break; - case LEFTMOUSE: - case PADENTER: - case RETKEY: - Trans.state = TRANS_CONFIRM; - break; - case GKEY: - /* only switch when... */ - if( ELEM3(Trans.mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL) ) { - restoreTransObjects(&Trans); - initTranslation(&Trans); - Trans.redraw = 1; - } - break; - case SKEY: - /* only switch when... */ - if( ELEM3(Trans.mode, TFM_ROTATION, TFM_TRANSLATION, TFM_TRACKBALL) ) { - restoreTransObjects(&Trans); - initResize(&Trans); - Trans.redraw = 1; - } - break; - case RKEY: - /* only switch when... */ - if( ELEM4(Trans.mode, TFM_ROTATION, TFM_RESIZE, TFM_TRACKBALL, TFM_TRANSLATION) ) { - - if (Trans.mode == TFM_ROTATION) { - restoreTransObjects(&Trans); - initTrackball(&Trans); - } - else { - restoreTransObjects(&Trans); - initRotation(&Trans); - } - Trans.redraw = 1; - } - break; - case CKEY: - if (G.qual & LR_ALTKEY) { - Trans.flag ^= T_PROP_CONNECTED; - sort_trans_data_dist(&Trans); - calculatePropRatio(&Trans); - Trans.redraw= 1; - } - else { - stopConstraint(&Trans); - Trans.redraw = 1; - } - break; - case XKEY: - if ((Trans.flag & T_NO_CONSTRAINT)==0) { - if (cmode == 'X') { - if (Trans.flag & T_2D_EDIT) { - stopConstraint(&Trans); - } - else { - if (Trans.con.mode & CON_USER) { - stopConstraint(&Trans); - } - else { - if (G.qual == 0) - setUserConstraint(&Trans, (CON_AXIS0), "along %s X"); - else if (G.qual == LR_SHIFTKEY) - setUserConstraint(&Trans, (CON_AXIS1|CON_AXIS2), "locking %s X"); - } - } - } - else { - if (Trans.flag & T_2D_EDIT) { - setConstraint(&Trans, mati, (CON_AXIS0), "along X axis"); - } - else { - if (G.qual == 0) - setConstraint(&Trans, mati, (CON_AXIS0), "along global X"); - else if (G.qual == LR_SHIFTKEY) - setConstraint(&Trans, mati, (CON_AXIS1|CON_AXIS2), "locking global X"); - } - } - Trans.redraw = 1; - } - break; - case YKEY: - if ((Trans.flag & T_NO_CONSTRAINT)==0) { - if (cmode == 'Y') { - if (Trans.flag & T_2D_EDIT) { - stopConstraint(&Trans); - } - else { - if (Trans.con.mode & CON_USER) { - stopConstraint(&Trans); - } - else { - if (G.qual == 0) - setUserConstraint(&Trans, (CON_AXIS1), "along %s Y"); - else if (G.qual == LR_SHIFTKEY) - setUserConstraint(&Trans, (CON_AXIS0|CON_AXIS2), "locking %s Y"); - } - } - } - else { - if (Trans.flag & T_2D_EDIT) { - setConstraint(&Trans, mati, (CON_AXIS1), "along Y axis"); - } - else { - if (G.qual == 0) - setConstraint(&Trans, mati, (CON_AXIS1), "along global Y"); - else if (G.qual == LR_SHIFTKEY) - setConstraint(&Trans, mati, (CON_AXIS0|CON_AXIS2), "locking global Y"); - } - } - Trans.redraw = 1; - } - break; - case ZKEY: - if ((Trans.flag & T_NO_CONSTRAINT)==0) { - if (cmode == 'Z') { - if (Trans.con.mode & CON_USER) { - stopConstraint(&Trans); - } - else { - if (G.qual == 0) - setUserConstraint(&Trans, (CON_AXIS2), "along %s Z"); - else if ((G.qual == LR_SHIFTKEY) && ((Trans.flag & T_2D_EDIT)==0)) - setUserConstraint(&Trans, (CON_AXIS0|CON_AXIS1), "locking %s Z"); - } - } - else if ((Trans.flag & T_2D_EDIT)==0) { - if (G.qual == 0) - setConstraint(&Trans, mati, (CON_AXIS2), "along global Z"); - else if (G.qual == LR_SHIFTKEY) - setConstraint(&Trans, mati, (CON_AXIS0|CON_AXIS1), "locking global Z"); - } - Trans.redraw = 1; - } - break; - case OKEY: - if (Trans.flag & T_PROP_EDIT && G.qual==LR_SHIFTKEY) { - G.scene->prop_mode = (G.scene->prop_mode+1)%6; - calculatePropRatio(&Trans); - Trans.redraw= 1; - } - break; - case PADPLUSKEY: - if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 1.1f; - calculatePropRatio(&Trans); - } - Trans.redraw= 1; - break; - case PAGEUPKEY: - case WHEELDOWNMOUSE: - if (Trans.flag & T_AUTOIK) { - transform_autoik_update(&Trans, 1); - } - else if(Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 1.1f; - calculatePropRatio(&Trans); - } - else view_editmove(event); - Trans.redraw= 1; - break; - case PADMINUS: - if(G.qual & LR_ALTKEY && Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 0.90909090f; - calculatePropRatio(&Trans); - } - Trans.redraw= 1; - break; - case PAGEDOWNKEY: - case WHEELUPMOUSE: - if (Trans.flag & T_AUTOIK) { - transform_autoik_update(&Trans, -1); - } - else if (Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 0.90909090f; - calculatePropRatio(&Trans); - } - else view_editmove(event); - Trans.redraw= 1; - break; - } - - // Numerical input events - Trans.redraw |= handleNumInput(&(Trans.num), event); - - // Snapping events - Trans.redraw |= handleSnapping(&Trans, event); - - arrows_move_cursor(event); - } - else { - switch (event){ - /* no redraw on release modifier keys! this makes sure you can assign the 'grid' still - after releasing modifer key */ - case MIDDLEMOUSE: - if ((Trans.flag & T_NO_CONSTRAINT)==0) { - Trans.flag &= ~T_MMB_PRESSED; - postSelectConstraint(&Trans); - Trans.redraw = 1; - } - break; - case LEFTMOUSE: - case RIGHTMOUSE: - if (Trans.context & CTX_TWEAK) - Trans.state = TRANS_CONFIRM; - break; - case LEFTSHIFTKEY: - case RIGHTSHIFTKEY: - /* shift is modifier for higher resolution transform */ - Trans.flag &= ~T_SHIFT_MOD; - break; - } - } - - // Per transform event, if present - if (Trans.handleEvent) - Trans.redraw |= Trans.handleEvent(&Trans, event, val); -} - -int calculateTransformCenter(int centerMode, float *vec) -{ - int success = 1; - checkFirstTime(); - - Trans.state = TRANS_RUNNING; - - Trans.context = CTX_NONE; - - Trans.mode = TFM_DUMMY; - - initTrans(&Trans); // internal data, mouse, vectors - - createTransData(&Trans); // make TransData structs from selection - - Trans.around = centerMode; // override userdefined mode - - if (Trans.total == 0) { - success = 0; - } - else { - success = 1; - - calculateCenter(&Trans); - - // Copy center from constraint center. Transform center can be local - VECCOPY(vec, Trans.con.center); - } - - postTrans(&Trans); - - /* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */ - special_aftertrans_update(&Trans); - - return success; -} - -void initTransform(int mode, int context) { - /* added initialize, for external calls to set stuff in TransInfo, like undo string */ - checkFirstTime(); - - Trans.state = TRANS_RUNNING; - - Trans.context = context; - - Trans.mode = mode; - - initTrans(&Trans); // internal data, mouse, vectors - - if(Trans.spacetype==SPACE_VIEW3D) { - calc_manipulator_stats(curarea); - Mat3CpyMat4(Trans.spacemtx, G.vd->twmat); - } - else - Mat3One(Trans.spacemtx); - - createTransData(&Trans); // make TransData structs from selection - - initSnapping(&Trans); // Initialize snapping data AFTER mode flags - - if (Trans.total == 0) { - postTrans(&Trans); - return; - } - - /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ - /* EVIL2: we gave as argument also texture space context bit... was cleared */ - /* EVIL3: extend mode for animation editors also switches modes... but is best way to avoid duplicate code */ - mode = Trans.mode; - - calculatePropRatio(&Trans); - calculateCenter(&Trans); - - switch (mode) { - case TFM_TRANSLATION: - initTranslation(&Trans); - break; - case TFM_ROTATION: - initRotation(&Trans); - break; - case TFM_RESIZE: - initResize(&Trans); - break; - case TFM_TOSPHERE: - initToSphere(&Trans); - break; - case TFM_SHEAR: - initShear(&Trans); - break; - case TFM_WARP: - initWarp(&Trans); - break; - case TFM_SHRINKFATTEN: - initShrinkFatten(&Trans); - break; - case TFM_TILT: - initTilt(&Trans); - break; - case TFM_CURVE_SHRINKFATTEN: - initCurveShrinkFatten(&Trans); - break; - case TFM_TRACKBALL: - initTrackball(&Trans); - break; - case TFM_PUSHPULL: - initPushPull(&Trans); - break; - case TFM_CREASE: - initCrease(&Trans); - break; - case TFM_BONESIZE: - { /* used for both B-Bone width (bonesize) as for deform-dist (envelope) */ - bArmature *arm= Trans.poseobj->data; - if(arm->drawtype==ARM_ENVELOPE) - initBoneEnvelope(&Trans); - else - initBoneSize(&Trans); - } - break; - case TFM_BONE_ENVELOPE: - initBoneEnvelope(&Trans); - break; - case TFM_BONE_ROLL: - initBoneRoll(&Trans); - break; - case TFM_TIME_TRANSLATE: - initTimeTranslate(&Trans); - break; - case TFM_TIME_SLIDE: - initTimeSlide(&Trans); - break; - case TFM_TIME_SCALE: - initTimeScale(&Trans); - break; - case TFM_TIME_EXTEND: - /* now that transdata has been made, do like for TFM_TIME_TRANSLATE */ - initTimeTranslate(&Trans); - break; - case TFM_BAKE_TIME: - initBakeTime(&Trans); - break; - } -} - -void Transform() -{ - short pmval[2] = {0, 0}, mval[2], val; - unsigned short event; - - if(Trans.total==0) return; // added, can happen now! (ton) - - // Emptying event queue - while( qtest() ) { - event= extern_qread(&val); - } - - Trans.redraw = 1; /* initial draw */ - - while (Trans.state == TRANS_RUNNING) { - - getmouseco_areawin(mval); - - if (mval[0] != pmval[0] || mval[1] != pmval[1]) { - if (Trans.flag & T_MMB_PRESSED) - Trans.con.mode |= CON_SELECT; - Trans.redraw = 1; - } - if (Trans.redraw) { - pmval[0] = mval[0]; - pmval[1] = mval[1]; - - selectConstraint(&Trans); - if (Trans.transform) { - Trans.transform(&Trans, mval); // calls recalcData() - } - Trans.redraw = 0; - } - - /* essential for idling subloop */ - if( qtest()==0) PIL_sleep_ms(2); - - while( qtest() ) { - event= extern_qread(&val); - transformEvent(event, val); - } - } - - - /* handle restoring objects */ - if(Trans.state == TRANS_CANCEL) - restoreTransObjects(&Trans); // calls recalcData() - - /* free data */ - postTrans(&Trans); - - /* aftertrans does insert ipos and action channels, and clears base flags, doesnt read transdata */ - special_aftertrans_update(&Trans); - - /* send events out for redraws */ - viewRedrawPost(&Trans); - - /* Undo as last, certainly after special_trans_update! */ - if(Trans.state == TRANS_CANCEL) { - if(Trans.undostr) BIF_undo_push(Trans.undostr); - } - else { - if(Trans.undostr) BIF_undo_push(Trans.undostr); - else BIF_undo_push(transform_to_undostr(&Trans)); - } - Trans.undostr= NULL; - -} - -/* ************************** Manipulator init and main **************************** */ - -void initManipulator(int mode) -{ - Trans.state = TRANS_RUNNING; - - Trans.context = CTX_NONE; - - Trans.mode = mode; - - /* automatic switch to scaling bone envelopes */ - if(mode==TFM_RESIZE && G.obedit && G.obedit->type==OB_ARMATURE) { - bArmature *arm= G.obedit->data; - if(arm->drawtype==ARM_ENVELOPE) - mode= TFM_BONE_ENVELOPE; - } - - initTrans(&Trans); // internal data, mouse, vectors - - G.moving |= G_TRANSFORM_MANIP; // signal to draw manipuls while transform - createTransData(&Trans); // make TransData structs from selection - - if (Trans.total == 0) - return; - - initSnapping(&Trans); // Initialize snapping data AFTER mode flags - - /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ - /* EVIL2: we gave as argument also texture space context bit... was cleared */ - mode = Trans.mode; - - calculatePropRatio(&Trans); - calculateCenter(&Trans); - - switch (mode) { - case TFM_TRANSLATION: - initTranslation(&Trans); - break; - case TFM_ROTATION: - initRotation(&Trans); - break; - case TFM_RESIZE: - initResize(&Trans); - break; - case TFM_TRACKBALL: - initTrackball(&Trans); - break; - } - - Trans.flag |= T_USES_MANIPULATOR; -} - -void ManipulatorTransform() -{ - int mouse_moved = 0; - short pmval[2] = {0, 0}, mval[2], val; - unsigned short event; - - if (Trans.total == 0) - return; - - Trans.redraw = 1; /* initial draw */ - - while (Trans.state == TRANS_RUNNING) { - - getmouseco_areawin(mval); - - if (mval[0] != pmval[0] || mval[1] != pmval[1]) { - Trans.redraw = 1; - } - if (Trans.redraw) { - pmval[0] = mval[0]; - pmval[1] = mval[1]; - - //selectConstraint(&Trans); needed? - if (Trans.transform) { - Trans.transform(&Trans, mval); - } - Trans.redraw = 0; - } - - /* essential for idling subloop */ - if( qtest()==0) PIL_sleep_ms(2); - - while( qtest() ) { - event= extern_qread(&val); - - switch (event){ - case MOUSEX: - case MOUSEY: - mouse_moved = 1; - break; - /* enforce redraw of transform when modifiers are used */ - case LEFTCTRLKEY: - case RIGHTCTRLKEY: - if(val) Trans.redraw = 1; - break; - case LEFTSHIFTKEY: - case RIGHTSHIFTKEY: - /* shift is modifier for higher resolution transform, works nice to store this mouse position */ - if(val) { - getmouseco_areawin(Trans.shiftmval); - Trans.flag |= T_SHIFT_MOD; - Trans.redraw = 1; - } - else Trans.flag &= ~T_SHIFT_MOD; - break; - - case ESCKEY: - case RIGHTMOUSE: - Trans.state = TRANS_CANCEL; - break; - case LEFTMOUSE: - if(mouse_moved==0 && val==0) break; - // else we pass on event to next, which cancels - case SPACEKEY: - case PADENTER: - case RETKEY: - Trans.state = TRANS_CONFIRM; - break; - } - if(val) { - switch(event) { - case WHEELDOWNMOUSE: - case PADPLUSKEY: - if(Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 1.1f; - calculatePropRatio(&Trans); - Trans.redraw= 1; - } - break; - case WHEELUPMOUSE: - case PADMINUS: - if(Trans.flag & T_PROP_EDIT) { - Trans.propsize*= 0.90909090f; - calculatePropRatio(&Trans); - Trans.redraw= 1; - } - break; - } - } - } - } - - if(Trans.state == TRANS_CANCEL) { - restoreTransObjects(&Trans); - } - - /* free data, reset vars */ - postTrans(&Trans); - - /* aftertrans does insert ipos and action channels, and clears base flags */ - special_aftertrans_update(&Trans); - - /* send events out for redraws */ - viewRedrawPost(&Trans); - - if(Trans.state != TRANS_CANCEL) { - BIF_undo_push(transform_to_undostr(&Trans)); - } - -} - -/* ************************** TRANSFORM LOCKS **************************** */ - -static void protectedTransBits(short protectflag, float *vec) -{ - if(protectflag & OB_LOCK_LOCX) - vec[0]= 0.0f; - if(protectflag & OB_LOCK_LOCY) - vec[1]= 0.0f; - if(protectflag & OB_LOCK_LOCZ) - vec[2]= 0.0f; -} - -static void protectedSizeBits(short protectflag, float *size) -{ - if(protectflag & OB_LOCK_SCALEX) - size[0]= 1.0f; - if(protectflag & OB_LOCK_SCALEY) - size[1]= 1.0f; - if(protectflag & OB_LOCK_SCALEZ) - size[2]= 1.0f; -} - -static void protectedRotateBits(short protectflag, float *eul, float *oldeul) -{ - if(protectflag & OB_LOCK_ROTX) - eul[0]= oldeul[0]; - if(protectflag & OB_LOCK_ROTY) - eul[1]= oldeul[1]; - if(protectflag & OB_LOCK_ROTZ) - eul[2]= oldeul[2]; -} - -static void protectedQuaternionBits(short protectflag, float *quat, float *oldquat) -{ - /* quaternions get limited with euler... */ - /* this function only does the delta rotation */ - - if(protectflag) { - float eul[3], oldeul[3], quat1[4]; - - QUATCOPY(quat1, quat); - QuatToEul(quat, eul); - QuatToEul(oldquat, oldeul); - - if(protectflag & OB_LOCK_ROTX) - eul[0]= oldeul[0]; - if(protectflag & OB_LOCK_ROTY) - eul[1]= oldeul[1]; - if(protectflag & OB_LOCK_ROTZ) - eul[2]= oldeul[2]; - - EulToQuat(eul, quat); - /* quaternions flip w sign to accumulate rotations correctly */ - if( (quat1[0]<0.0f && quat[0]>0.0f) || (quat1[0]>0.0f && quat[0]<0.0f) ) { - QuatMulf(quat, -1.0f); - } - } -} - -/* ******************* TRANSFORM LIMITS ********************** */ - -static void constraintTransLim(TransInfo *t, TransData *td) -{ - if (td->con) { - bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT); - bConstraintOb cob; - bConstraint *con; - - /* Make a temporary bConstraintOb for using these limit constraints - * - they only care that cob->matrix is correctly set ;-) - * - current space should be local - */ - memset(&cob, 0, sizeof(bConstraintOb)); - Mat4One(cob.matrix); - if (td->tdi) { - TransDataIpokey *tdi= td->tdi; - cob.matrix[3][0]= tdi->locx[0]; - cob.matrix[3][1]= tdi->locy[0]; - cob.matrix[3][2]= tdi->locz[0]; - } - else { - VECCOPY(cob.matrix[3], td->loc); - } - - /* Evaluate valid constraints */ - for (con= td->con; con; con= con->next) { - /* we're only interested in Limit-Location constraints */ - if (con->type == CONSTRAINT_TYPE_LOCLIMIT) { - bLocLimitConstraint *data= con->data; - float tmat[4][4]; - - /* only use it if it's tagged for this purpose */ - if ((data->flag2 & LIMIT_TRANSFORM)==0) - continue; - - /* do space conversions */ - if (con->ownspace == CONSTRAINT_SPACE_WORLD) { - /* just multiply by td->mtx (this should be ok) */ - Mat4CpyMat4(tmat, cob.matrix); - Mat4MulMat34(cob.matrix, td->mtx, tmat); // checkme - } - else if (con->ownspace != CONSTRAINT_SPACE_LOCAL) { - /* skip... incompatable spacetype */ - continue; - } - - /* do constraint */ - cti->evaluate_constraint(con, &cob, NULL); - - /* convert spaces again */ - if (con->ownspace == CONSTRAINT_SPACE_WORLD) { - /* just multiply by td->mtx (this should be ok) */ - Mat4CpyMat4(tmat, cob.matrix); - Mat4MulMat34(cob.matrix, td->smtx, tmat); // checkme - } - } - } - - /* copy results from cob->matrix */ - if (td->tdi) { - TransDataIpokey *tdi= td->tdi; - tdi->locx[0]= cob.matrix[3][0]; - tdi->locy[0]= cob.matrix[3][1]; - tdi->locz[0]= cob.matrix[3][2]; - } - else { - VECCOPY(td->loc, cob.matrix[3]); - } - } -} - -/* ************************** WARP *************************** */ - -void initWarp(TransInfo *t) -{ - float max[3], min[3]; - int i; - - t->mode = TFM_WARP; - t->transform = Warp; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 5.0f; - t->snap[2] = 1.0f; - - t->flag |= T_NO_CONSTRAINT; - -/* warp is done fully in view space */ - calculateCenterCursor(t); - t->fac = (float)(t->center2d[0] - t->imval[0]); - - /* we need min/max in view space */ - for(i = 0; i < t->total; i++) { - float center[3]; - VECCOPY(center, t->data[i].center); - Mat3MulVecfl(t->data[i].mtx, center); - Mat4MulVecfl(t->viewmat, center); - VecSubf(center, center, t->viewmat[3]); - if (i) - MinMax3(min, max, center); - else { - VECCOPY(max, center); - VECCOPY(min, center); - } - } - - t->center[0]= (min[0]+max[0])/2.0f; - t->center[1]= (min[1]+max[1])/2.0f; - t->center[2]= (min[2]+max[2])/2.0f; - - if (max[0] == min[0]) max[0] += 0.1; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */ - t->val= (max[0]-min[0])/2.0f; /* t->val is X dimension projected boundbox */ -} - -int Warp(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float vec[3], circumfac, dist, phi0, co, si, *curs, cursor[3], gcursor[3]; - int i; - char str[50]; - - curs= give_cursor(); - /* - * gcursor is the one used for helpline. - * It has to be in the same space as the drawing loop - * (that means it needs to be in the object's space when in edit mode and - * in global space in object mode) - * - * cursor is used for calculations. - * It needs to be in view space, but we need to take object's offset - * into account if in Edit mode. - */ - VECCOPY(cursor, curs); - VECCOPY(gcursor, cursor); - if (t->flag & T_EDIT) { - VecSubf(cursor, cursor, G.obedit->obmat[3]); - VecSubf(gcursor, gcursor, G.obedit->obmat[3]); - Mat3MulVecfl(t->data->smtx, gcursor); - } - Mat4MulVecfl(t->viewmat, cursor); - VecSubf(cursor, cursor, t->viewmat[3]); - - /* amount of degrees for warp */ - circumfac= 360.0f * InputHorizontalRatio(t, mval); - - snapGrid(t, &circumfac); - applyNumInput(&t->num, &circumfac); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - sprintf(str, "Warp: %s", c); - } - else { - /* default header print */ - sprintf(str, "Warp: %.3f", circumfac); - } - - circumfac*= (float)(-M_PI/360.0); - - for(i = 0; i < t->total; i++, td++) { - float loc[3]; - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - /* translate point to center, rotate in such a way that outline==distance */ - VECCOPY(vec, td->iloc); - Mat3MulVecfl(td->mtx, vec); - Mat4MulVecfl(t->viewmat, vec); - VecSubf(vec, vec, t->viewmat[3]); - - dist= vec[0]-cursor[0]; - - /* t->val is X dimension projected boundbox */ - phi0= (circumfac*dist/t->val); - - vec[1]= (vec[1]-cursor[1]); - - co= (float)cos(phi0); - si= (float)sin(phi0); - loc[0]= -si*vec[1]+cursor[0]; - loc[1]= co*vec[1]+cursor[1]; - loc[2]= vec[2]; - - Mat4MulVecfl(t->viewinv, loc); - VecSubf(loc, loc, t->viewinv[3]); - Mat3MulVecfl(td->smtx, loc); - - VecSubf(loc, loc, td->iloc); - VecMulf(loc, td->factor); - VecAddf(td->loc, td->iloc, loc); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - helpline(t, gcursor); - - return 1; -} - -/* ************************** SHEAR *************************** */ - -void initShear(TransInfo *t) -{ - t->mode = TFM_SHEAR; - t->transform = Shear; - t->handleEvent = handleEventShear; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; -} - -int handleEventShear(TransInfo *t, unsigned short event, short val) -{ - int status = 0; - - if (event == MIDDLEMOUSE && val) - { - // Use customData pointer to signal Shear direction - if (t->customData == 0) - t->customData = (void*)1; - else - t->customData = 0; - - status = 1; - } - - return status; -} - - -int Shear(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float vec[3]; - float smat[3][3], tmat[3][3], totmat[3][3], persmat[3][3], persinv[3][3]; - float value; - int i; - char str[50]; - - Mat3CpyMat4(persmat, t->viewmat); - Mat3Inv(persinv, persmat); - - // Custom data signals shear direction - if (t->customData == 0) - value = 0.05f * InputHorizontalAbsolute(t, mval); - else - value = 0.05f * InputVerticalAbsolute(t, mval); - - snapGrid(t, &value); - - applyNumInput(&t->num, &value); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - sprintf(str, "Shear: %s %s", c, t->proptext); - } - else { - /* default header print */ - sprintf(str, "Shear: %.3f %s", value, t->proptext); - } - - Mat3One(smat); - - // Custom data signals shear direction - if (t->customData == 0) - smat[1][0] = value; - else - smat[0][1] = value; - - Mat3MulMat3(tmat, smat, persmat); - Mat3MulMat3(totmat, persinv, tmat); - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (G.obedit) { - float mat3[3][3]; - Mat3MulMat3(mat3, totmat, td->mtx); - Mat3MulMat3(tmat, td->smtx, mat3); - } - else { - Mat3CpyMat3(tmat, totmat); - } - VecSubf(vec, td->center, t->center); - - Mat3MulVecfl(tmat, vec); - - VecAddf(vec, vec, t->center); - VecSubf(vec, vec, td->center); - - VecMulf(vec, td->factor); - - VecAddf(td->loc, td->iloc, vec); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - helpline (t, t->center); - - return 1; -} - -/* ************************** RESIZE *************************** */ - -void initResize(TransInfo *t) -{ - t->mode = TFM_RESIZE; - t->transform = Resize; - - t->flag |= T_NULL_ONE; - t->num.flag |= NUM_NULL_ONE; - t->num.flag |= NUM_AFFECT_ALL; - if (!G.obedit) { - t->flag |= T_NO_ZERO; - t->num.flag |= NUM_NO_ZERO; - } - - t->idx_max = 2; - t->num.idx_max = 2; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->fac = (float)sqrt( - ( - ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) - + - ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) - ) ); - - if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf -} - -static void headerResize(TransInfo *t, float vec[3], char *str) { - char tvec[60]; - if (hasNumInput(&t->num)) { - outputNumInput(&(t->num), tvec); - } - else { - sprintf(&tvec[0], "%.4f", vec[0]); - sprintf(&tvec[20], "%.4f", vec[1]); - sprintf(&tvec[40], "%.4f", vec[2]); - } - - if (t->con.mode & CON_APPLY) { - switch(t->num.idx_max) { - case 0: - sprintf(str, "Scale: %s%s %s", &tvec[0], t->con.text, t->proptext); - break; - case 1: - sprintf(str, "Scale: %s : %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext); - break; - case 2: - sprintf(str, "Scale: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); - } - } - else { - if (t->flag & T_2D_EDIT) - sprintf(str, "Scale X: %s Y: %s%s %s", &tvec[0], &tvec[20], t->con.text, t->proptext); - else - sprintf(str, "Scale X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); - } -} - -#define SIGN(a) (a<-FLT_EPSILON?1:a>FLT_EPSILON?2:3) -#define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0) - -/* smat is reference matrix, only scaled */ -static void TransMat3ToSize( float mat[][3], float smat[][3], float *size) -{ - float vec[3]; - - VecCopyf(vec, mat[0]); - size[0]= Normalize(vec); - VecCopyf(vec, mat[1]); - size[1]= Normalize(vec); - VecCopyf(vec, mat[2]); - size[2]= Normalize(vec); - - /* first tried with dotproduct... but the sign flip is crucial */ - if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0]; - if( VECSIGNFLIP(mat[1], smat[1]) ) size[1]= -size[1]; - if( VECSIGNFLIP(mat[2], smat[2]) ) size[2]= -size[2]; -} - - -static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { - float tmat[3][3], smat[3][3], center[3]; - float vec[3]; - - if (t->flag & T_EDIT) { - Mat3MulMat3(smat, mat, td->mtx); - Mat3MulMat3(tmat, td->smtx, smat); - } - else { - Mat3CpyMat3(tmat, mat); - } - - if (t->con.applySize) { - t->con.applySize(t, td, tmat); - } - - /* local constraint shouldn't alter center */ - if (t->around == V3D_LOCAL) { - if (t->flag & T_OBJECT) { - VECCOPY(center, td->center); - } - else if (t->flag & T_EDIT) { - - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { - VECCOPY(center, td->center); - } - else { - VECCOPY(center, t->center); - } - } - else { - VECCOPY(center, t->center); - } - } - else { - VECCOPY(center, t->center); - } - - if (td->ext) { - float fsize[3]; - - if (t->flag & (T_OBJECT|T_TEXTURE|T_POSE)) { - float obsizemat[3][3]; - // Reorient the size mat to fit the oriented object. - Mat3MulMat3(obsizemat, tmat, td->axismtx); - //printmatrix3("obsizemat", obsizemat); - TransMat3ToSize(obsizemat, td->axismtx, fsize); - //printvecf("fsize", fsize); - } - else { - Mat3ToSize(tmat, fsize); - } - - protectedSizeBits(td->protectflag, fsize); - - if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't resize objects itself - /* handle ipokeys? */ - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - /* calculate delta size (equal for size and dsize) */ - - vec[0]= (tdi->oldsize[0])*(fsize[0] -1.0f) * td->factor; - vec[1]= (tdi->oldsize[1])*(fsize[1] -1.0f) * td->factor; - vec[2]= (tdi->oldsize[2])*(fsize[2] -1.0f) * td->factor; - - add_tdi_poin(tdi->sizex, tdi->oldsize, vec[0]); - add_tdi_poin(tdi->sizey, tdi->oldsize+1, vec[1]); - add_tdi_poin(tdi->sizez, tdi->oldsize+2, vec[2]); - - } - else if((td->flag & TD_SINGLESIZE) && !(t->con.mode & CON_APPLY)){ - /* scale val and reset size */ - *td->val = td->ival * fsize[0] * td->factor; - - td->ext->size[0] = td->ext->isize[0]; - td->ext->size[1] = td->ext->isize[1]; - td->ext->size[2] = td->ext->isize[2]; - } - else { - /* Reset val if SINGLESIZE but using a constraint */ - if (td->flag & TD_SINGLESIZE) - *td->val = td->ival; - - td->ext->size[0] = td->ext->isize[0] * (fsize[0]) * td->factor; - td->ext->size[1] = td->ext->isize[1] * (fsize[1]) * td->factor; - td->ext->size[2] = td->ext->isize[2] * (fsize[2]) * td->factor; - } - } - } - /* For individual element center, Editmode need to use iloc */ - if (t->flag & T_POINTS) - VecSubf(vec, td->iloc, center); - else - VecSubf(vec, td->center, center); - - Mat3MulVecfl(tmat, vec); - - VecAddf(vec, vec, center); - if (t->flag & T_POINTS) - VecSubf(vec, vec, td->iloc); - else - VecSubf(vec, vec, td->center); - - VecMulf(vec, td->factor); - - if (t->flag & T_OBJECT) { - Mat3MulVecfl(td->smtx, vec); - } - - protectedTransBits(td->protectflag, vec); - - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - add_tdi_poin(tdi->locx, tdi->oldloc, vec[0]); - add_tdi_poin(tdi->locy, tdi->oldloc+1, vec[1]); - add_tdi_poin(tdi->locz, tdi->oldloc+2, vec[2]); - } - else VecAddf(td->loc, td->iloc, vec); -} - -int Resize(TransInfo *t, short mval[2]) -{ - TransData *td; - float size[3], mat[3][3]; - float ratio; - int i; - char str[200]; - - /* for manipulator, center handle, the scaling can't be done relative to center */ - if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) { - ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f; - } - else { - ratio = InputScaleRatio(t, mval); - - /* flip scale, but not for manipulator center handle */ - if ((t->center2d[0] - mval[0]) * (t->center2d[0] - t->imval[0]) + - (t->center2d[1] - mval[1]) * (t->center2d[1] - t->imval[1]) < 0) - ratio *= -1.0f; - } - - size[0] = size[1] = size[2] = ratio; - - snapGrid(t, size); - - if (hasNumInput(&t->num)) { - applyNumInput(&t->num, size); - constraintNumInput(t, size); - } - - SizeToMat3(size, mat); - - if (t->con.applySize) { - t->con.applySize(t, NULL, mat); - } - - Mat3CpyMat3(t->mat, mat); // used in manipulator - - headerResize(t, size, str); - - for(i = 0, td=t->data; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - ElementResize(t, td, mat); - } - - /* evil hack - redo resize if cliping needed */ - if (t->flag & T_CLIP_UV && clipUVTransform(t, size, 1)) { - SizeToMat3(size, mat); - - if (t->con.applySize) - t->con.applySize(t, NULL, mat); - - for(i = 0, td=t->data; i < t->total; i++, td++) - ElementResize(t, td, mat); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - -/* ************************** TOSPHERE *************************** */ - -void initToSphere(TransInfo *t) -{ - TransData *td = t->data; - int i; - - t->mode = TFM_TOSPHERE; - t->transform = ToSphere; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->num.flag |= NUM_NULL_ONE | NUM_NO_NEGATIVE; - t->flag |= T_NO_CONSTRAINT; - - // Calculate average radius - for(i = 0 ; i < t->total; i++, td++) { - t->val += VecLenf(t->center, td->iloc); - } - - t->val /= (float)t->total; -} - -int ToSphere(TransInfo *t, short mval[2]) -{ - float vec[3]; - float ratio, radius; - int i; - char str[64]; - TransData *td = t->data; - - ratio = InputHorizontalRatio(t, mval); - - snapGrid(t, &ratio); - - applyNumInput(&t->num, &ratio); - - if (ratio < 0) - ratio = 0.0f; - else if (ratio > 1) - ratio = 1.0f; - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - sprintf(str, "To Sphere: %s %s", c, t->proptext); - } - else { - /* default header print */ - sprintf(str, "To Sphere: %.4f %s", ratio, t->proptext); - } - - - for(i = 0 ; i < t->total; i++, td++) { - float tratio; - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - VecSubf(vec, td->iloc, t->center); - - radius = Normalize(vec); - - tratio = ratio * td->factor; - - VecMulf(vec, radius * (1.0f - tratio) + t->val * tratio); - - VecAddf(td->loc, t->center, vec); - } - - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ************************** ROTATION *************************** */ - - -void initRotation(TransInfo *t) -{ - t->mode = TFM_ROTATION; - t->transform = Rotation; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = (float)((5.0/180)*M_PI); - t->snap[2] = t->snap[1] * 0.2f; - t->fac = 0; - - if (t->flag & T_2D_EDIT) - t->flag |= T_NO_CONSTRAINT; -} - -static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { - float vec[3], totmat[3][3], smat[3][3]; - float eul[3], fmat[3][3], quat[4]; - - if (t->flag & T_POINTS) { - Mat3MulMat3(totmat, mat, td->mtx); - Mat3MulMat3(smat, td->smtx, totmat); - - VecSubf(vec, td->iloc, t->center); - Mat3MulVecfl(smat, vec); - - VecAddf(td->loc, vec, t->center); - - VecSubf(vec,td->loc,td->iloc); - protectedTransBits(td->protectflag, vec); - VecAddf(td->loc, td->iloc, vec); - - if(td->flag & TD_USEQUAT) { - Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); - Mat3ToQuat(fmat, quat); // Actual transform - - if(td->ext->quat){ - QuatMul(td->ext->quat, quat, td->ext->iquat); - - /* is there a reason not to have this here? -jahka */ - protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); - } - } - } - /** - * HACK WARNING - * - * This is some VERY ugly special case to deal with pose mode. - * - * The problem is that mtx and smtx include each bone orientation. - * - * That is needed to rotate each bone properly, HOWEVER, to calculate - * the translation component, we only need the actual armature object's - * matrix (and inverse). That is not all though. Once the proper translation - * has been computed, it has to be converted back into the bone's space. - */ - else if (t->flag & T_POSE) { - float pmtx[3][3], imtx[3][3]; - - // Extract and invert armature object matrix - Mat3CpyMat4(pmtx, t->poseobj->obmat); - Mat3Inv(imtx, pmtx); - - VecSubf(vec, td->center, t->center); - - Mat3MulVecfl(pmtx, vec); // To Global space - Mat3MulVecfl(mat, vec); // Applying rotation - Mat3MulVecfl(imtx, vec); // To Local space - - VecAddf(vec, vec, t->center); - /* vec now is the location where the object has to be */ - - VecSubf(vec, vec, td->center); // Translation needed from the initial location - - Mat3MulVecfl(pmtx, vec); // To Global space - Mat3MulVecfl(td->smtx, vec);// To Pose space - - protectedTransBits(td->protectflag, vec); - - VecAddf(td->loc, td->iloc, vec); - - /* rotation */ - if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself - Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); - - Mat3ToQuat(fmat, quat); // Actual transform - - QuatMul(td->ext->quat, quat, td->ext->iquat); - /* this function works on end result */ - protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); - } - } - else { - /* translation */ - - VecSubf(vec, td->center, t->center); - Mat3MulVecfl(mat, vec); - VecAddf(vec, vec, t->center); - /* vec now is the location where the object has to be */ - VecSubf(vec, vec, td->center); - Mat3MulVecfl(td->smtx, vec); - - protectedTransBits(td->protectflag, vec); - - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - add_tdi_poin(tdi->locx, tdi->oldloc, vec[0]); - add_tdi_poin(tdi->locy, tdi->oldloc+1, vec[1]); - add_tdi_poin(tdi->locz, tdi->oldloc+2, vec[2]); - } - else VecAddf(td->loc, td->iloc, vec); - - /* rotation */ - if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself - - if(td->flag & TD_USEQUAT) { - Mat3MulSerie(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0); - Mat3ToQuat(fmat, quat); // Actual transform - - QuatMul(td->ext->quat, quat, td->ext->iquat); - /* this function works on end result */ - protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); - } - else { - float obmat[3][3]; - - /* are there ipo keys? */ - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - float rot[3]; - - /* calculate the total rotatation in eulers */ - VecAddf(eul, td->ext->irot, td->ext->drot); - EulToMat3(eul, obmat); - /* mat = transform, obmat = object rotation */ - Mat3MulMat3(fmat, mat, obmat); - - Mat3ToCompatibleEul(fmat, eul, td->ext->irot); - - /* correct back for delta rot */ - if(tdi->flag & TOB_IPODROT) { - VecSubf(rot, eul, td->ext->irot); - } - else { - VecSubf(rot, eul, td->ext->drot); - } - - VecMulf(rot, (float)(9.0/M_PI_2)); - VecSubf(rot, rot, tdi->oldrot); - - protectedRotateBits(td->protectflag, rot, tdi->oldrot); - - add_tdi_poin(tdi->rotx, tdi->oldrot, rot[0]); - add_tdi_poin(tdi->roty, tdi->oldrot+1, rot[1]); - add_tdi_poin(tdi->rotz, tdi->oldrot+2, rot[2]); - } - else { - Mat3MulMat3(totmat, mat, td->mtx); - Mat3MulMat3(smat, td->smtx, totmat); - - /* calculate the total rotatation in eulers */ - VecAddf(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */ - EulToMat3(eul, obmat); - /* mat = transform, obmat = object rotation */ - Mat3MulMat3(fmat, smat, obmat); - - Mat3ToCompatibleEul(fmat, eul, td->ext->irot); - - /* correct back for delta rot */ - VecSubf(eul, eul, td->ext->drot); - - /* and apply */ - protectedRotateBits(td->protectflag, eul, td->ext->irot); - VECCOPY(td->ext->rot, eul); - } - } - } - } -} - -static void applyRotation(TransInfo *t, float angle, float axis[3]) -{ - TransData *td = t->data; - float mat[3][3], center[3]; - int i; - - /* saving original center */ - if (t->around == V3D_LOCAL) { - VECCOPY(center, t->center); - } - else { - center[0] = center[1] = center[2] = 0.0f; - } - - VecRotToMat3(axis, angle, mat); - - for(i = 0 ; i < t->total; i++, td++) { - - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - /* local constraint shouldn't alter center */ - if (t->around == V3D_LOCAL) { - if (t->flag & (T_OBJECT|T_POSE)) { - VECCOPY(t->center, td->center); - } - else { - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { - VECCOPY(t->center, td->center); - } - } - } - - if (t->con.applyRot) { - t->con.applyRot(t, td, axis); - VecRotToMat3(axis, angle * td->factor, mat); - } - else if (t->flag & T_PROP_EDIT) { - VecRotToMat3(axis, angle * td->factor, mat); - } - - ElementRotation(t, td, mat); - } - - /* restoring original center */ - if (t->around == V3D_LOCAL) { - VECCOPY(t->center, center); - } -} - -int Rotation(TransInfo *t, short mval[2]) -{ - char str[64]; - - float final; - - int dx2 = t->center2d[0] - mval[0]; - int dy2 = t->center2d[1] - mval[1]; - double B = sqrt(dx2*dx2+dy2*dy2); - - int dx1 = t->center2d[0] - t->imval[0]; - int dy1 = t->center2d[1] - t->imval[1]; - double A = sqrt(dx1*dx1+dy1*dy1); - - int dx3 = mval[0] - t->imval[0]; - int dy3 = mval[1] - t->imval[1]; - /* use doubles here, to make sure a "1.0" (no rotation) doesnt become 9.999999e-01, which gives 0.02 for acos */ - double deler= ((double)((dx1*dx1+dy1*dy1)+(dx2*dx2+dy2*dy2)-(dx3*dx3+dy3*dy3) )) - / (2.0 * (A*B?A*B:1.0)); - /* (A*B?A*B:1.0f) this takes care of potential divide by zero errors */ - - float dphi; - - float axis[3]; - float mat[3][3]; - - VECCOPY(axis, t->viewinv[2]); - VecMulf(axis, -1.0f); - Normalize(axis); - - dphi = saacos((float)deler); - if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; - - if(G.qual & LR_SHIFTKEY) t->fac += dphi/30.0f; - else t->fac += dphi; - - /* - clamping angle between -2 PI and 2 PI (not sure if useful so commented out - theeth) - if (t->fac >= 2 * M_PI) - t->fac -= 2 * M_PI; - else if (t->fac <= -2 * M_PI) - t->fac -= -2 * M_PI; - */ - - final = t->fac; - - snapGrid(t, &final); - - t->imval[0] = mval[0]; - t->imval[1] = mval[1]; - - if (t->con.applyRot) { - t->con.applyRot(t, NULL, axis); - } - - applySnapping(t, &final); - - if (hasNumInput(&t->num)) { - char c[20]; - - applyNumInput(&t->num, &final); - - outputNumInput(&(t->num), c); - - sprintf(str, "Rot: %s %s", &c[0], t->proptext); - - /* Clamp between -180 and 180 */ - while (final >= 180.0) - final -= 360.0; - - while (final <= -180.0) - final += 360.0; - - final *= (float)(M_PI / 180.0); - } - else { - sprintf(str, "Rot: %.2f%s %s", 180.0*final/M_PI, t->con.text, t->proptext); - } - - VecRotToMat3(axis, final, mat); - - t->val = final; // used in manipulator - Mat3CpyMat3(t->mat, mat); // used in manipulator - - applyRotation(t, final, axis); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - - -/* ************************** TRACKBALL *************************** */ - -void initTrackball(TransInfo *t) -{ - t->mode = TFM_TRACKBALL; - t->transform = Trackball; - - t->idx_max = 1; - t->num.idx_max = 1; - t->snap[0] = 0.0f; - t->snap[1] = (float)((5.0/180)*M_PI); - t->snap[2] = t->snap[1] * 0.2f; - t->fac = 0; - - t->flag |= T_NO_CONSTRAINT; -} - -static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float angles[2]) -{ - TransData *td = t->data; - float mat[3][3], smat[3][3], totmat[3][3]; - float center[3]; - int i; - - VecRotToMat3(axis1, angles[0], smat); - VecRotToMat3(axis2, angles[1], totmat); - - Mat3MulMat3(mat, smat, totmat); - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - VECCOPY(center, t->center); - - if (t->around == V3D_LOCAL) { - /* local-mode shouldn't change center */ - if (t->flag & (T_OBJECT|T_POSE)) { - VECCOPY(t->center, td->center); - } - else { - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) { - VECCOPY(t->center, td->center); - } - } - } - - if (t->flag & T_PROP_EDIT) { - VecRotToMat3(axis1, td->factor * angles[0], smat); - VecRotToMat3(axis2, td->factor * angles[1], totmat); - - Mat3MulMat3(mat, smat, totmat); - } - - ElementRotation(t, td, mat); - - VECCOPY(t->center, center); - } -} - -int Trackball(TransInfo *t, short mval[2]) -{ - char str[128]; - float axis1[3], axis2[3]; - float mat[3][3], totmat[3][3], smat[3][3]; - float phi[2]; - - VECCOPY(axis1, t->persinv[0]); - VECCOPY(axis2, t->persinv[1]); - Normalize(axis1); - Normalize(axis2); - - /* factore has to become setting or so */ - phi[0]= 0.01f*(float)( t->imval[1] - mval[1] ); - phi[1]= 0.01f*(float)( mval[0] - t->imval[0] ); - - //if(G.qual & LR_SHIFTKEY) t->fac += dphi/30.0f; - //else t->fac += dphi; - - snapGrid(t, phi); - - if (hasNumInput(&t->num)) { - char c[40]; - - applyNumInput(&t->num, phi); - - outputNumInput(&(t->num), c); - - sprintf(str, "Trackball: %s %s %s", &c[0], &c[20], t->proptext); - - phi[0] *= (float)(M_PI / 180.0); - phi[1] *= (float)(M_PI / 180.0); - } - else { - sprintf(str, "Trackball: %.2f %.2f %s", 180.0*phi[0]/M_PI, 180.0*phi[1]/M_PI, t->proptext); - } - - VecRotToMat3(axis1, phi[0], smat); - VecRotToMat3(axis2, phi[1], totmat); - - Mat3MulMat3(mat, smat, totmat); - - Mat3CpyMat3(t->mat, mat); // used in manipulator - - applyTrackball(t, axis1, axis2, phi); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - -/* ************************** TRANSLATION *************************** */ - -void initTranslation(TransInfo *t) -{ - t->mode = TFM_TRANSLATION; - t->transform = Translation; - - t->idx_max = (t->flag & T_2D_EDIT)? 1: 2; - t->num.flag = 0; - t->num.idx_max = t->idx_max; - - - if(t->spacetype == SPACE_VIEW3D) { - /* initgrabz() defines a factor for perspective depth correction, used in window_to_3d() */ - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - float vec[3]; - - VECCOPY(vec, t->center); - Mat4MulVecfl(ob->obmat, vec); - initgrabz(vec[0], vec[1], vec[2]); - } - else { - initgrabz(t->center[0], t->center[1], t->center[2]); - } - - t->snap[0] = 0.0f; - t->snap[1] = G.vd->gridview * 1.0f; - t->snap[2] = t->snap[1] * 0.1f; - } - else if(t->spacetype == SPACE_IMAGE) { - t->snap[0] = 0.0f; - t->snap[1] = 0.125f; - t->snap[2] = 0.0625f; - } - else { - t->snap[0] = 0.0f; - t->snap[1] = t->snap[2] = 1.0f; - } -} - -static void headerTranslation(TransInfo *t, float vec[3], char *str) { - char tvec[60]; - char distvec[20]; - char autoik[20]; - float dvec[3]; - float dist; - - convertVecToDisplayNum(vec, dvec); - - if (hasNumInput(&t->num)) { - outputNumInput(&(t->num), tvec); - dist = VecLength(t->num.val); - } - else { - dist = VecLength(vec); - sprintf(&tvec[0], "%.4f", dvec[0]); - sprintf(&tvec[20], "%.4f", dvec[1]); - sprintf(&tvec[40], "%.4f", dvec[2]); - } - - if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */ - sprintf(distvec, "%.4e", dist); - else - sprintf(distvec, "%.4f", dist); - - if(t->flag & T_AUTOIK) { - short chainlen= G.scene->toolsettings->autoik_chainlen; - - if(chainlen) - sprintf(autoik, "AutoIK-Len: %d", chainlen); - else - strcpy(autoik, ""); - } - else - strcpy(autoik, ""); - - if (t->con.mode & CON_APPLY) { - switch(t->num.idx_max) { - case 0: - sprintf(str, "D: %s (%s)%s %s %s", &tvec[0], distvec, t->con.text, t->proptext, &autoik[0]); - break; - case 1: - sprintf(str, "D: %s D: %s (%s)%s %s %s", &tvec[0], &tvec[20], distvec, t->con.text, t->proptext, &autoik[0]); - break; - case 2: - sprintf(str, "D: %s D: %s D: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]); - } - } - else { - if(t->flag & T_2D_EDIT) - sprintf(str, "Dx: %s Dy: %s (%s)%s %s", &tvec[0], &tvec[20], distvec, t->con.text, t->proptext); - else - sprintf(str, "Dx: %s Dy: %s Dz: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]); - } -} - -static void applyTranslation(TransInfo *t, float vec[3]) { - TransData *td = t->data; - float tvec[3]; - int i; - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (t->con.applyVec) { - float pvec[3]; - t->con.applyVec(t, td, vec, tvec, pvec); - } - else { - VECCOPY(tvec, vec); - } - - Mat3MulVecfl(td->smtx, tvec); - VecMulf(tvec, td->factor); - - protectedTransBits(td->protectflag, tvec); - - /* transdata ipokey */ - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - add_tdi_poin(tdi->locx, tdi->oldloc, tvec[0]); - add_tdi_poin(tdi->locy, tdi->oldloc+1, tvec[1]); - add_tdi_poin(tdi->locz, tdi->oldloc+2, tvec[2]); - } - else VecAddf(td->loc, td->iloc, tvec); - - constraintTransLim(t, td); - } -} - -/* uses t->vec to store actual translation in */ -int Translation(TransInfo *t, short mval[2]) -{ - float tvec[3]; - char str[250]; - - if(t->flag & T_SHIFT_MOD) { - float dvec[3]; - /* calculate the main translation and the precise one separate */ - convertViewVec(t, dvec, (short)(mval[0] - t->shiftmval[0]), (short)(mval[1] - t->shiftmval[1])); - VecMulf(dvec, 0.1f); - convertViewVec(t, t->vec, (short)(t->shiftmval[0] - t->imval[0]), (short)(t->shiftmval[1] - t->imval[1])); - VecAddf(t->vec, t->vec, dvec); - } - else convertViewVec(t, t->vec, (short)(mval[0] - t->imval[0]), (short)(mval[1] - t->imval[1])); - - if (t->con.mode & CON_APPLY) { - float pvec[3] = {0.0f, 0.0f, 0.0f}; - applySnapping(t, t->vec); - t->con.applyVec(t, NULL, t->vec, tvec, pvec); - VECCOPY(t->vec, tvec); - headerTranslation(t, pvec, str); - } - else { - snapGrid(t, t->vec); - applyNumInput(&t->num, t->vec); - applySnapping(t, t->vec); - headerTranslation(t, t->vec, str); - } - - applyTranslation(t, t->vec); - - /* evil hack - redo translation if cliiping needeed */ - if (t->flag & T_CLIP_UV && clipUVTransform(t, t->vec, 0)) - applyTranslation(t, t->vec); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - drawSnapping(t); - - return 1; -} - -/* ************************** SHRINK/FATTEN *************************** */ - -void initShrinkFatten(TransInfo *t) -{ - // If not in mesh edit mode, fallback to Resize - if (G.obedit==NULL || G.obedit->type != OB_MESH) { - initResize(t); - } - else { - t->mode = TFM_SHRINKFATTEN; - t->transform = ShrinkFatten; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 1.0f; - t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; - } -} - - - -int ShrinkFatten(TransInfo *t, short mval[2]) -{ - float vec[3]; - float distance; - int i; - char str[64]; - TransData *td = t->data; - - distance = -InputVerticalAbsolute(t, mval); - - snapGrid(t, &distance); - - applyNumInput(&t->num, &distance); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - sprintf(str, "Shrink/Fatten: %s %s", c, t->proptext); - } - else { - /* default header print */ - sprintf(str, "Shrink/Fatten: %.4f %s", distance, t->proptext); - } - - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - VECCOPY(vec, td->axismtx[2]); - VecMulf(vec, distance); - VecMulf(vec, td->factor); - - VecAddf(td->loc, td->iloc, vec); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ************************** TILT *************************** */ - -void initTilt(TransInfo *t) -{ - t->mode = TFM_TILT; - t->transform = Tilt; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = (float)((5.0/180)*M_PI); - t->snap[2] = t->snap[1] * 0.2f; - t->fac = 0; - - t->flag |= T_NO_CONSTRAINT; -} - - - -int Tilt(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - int i; - char str[50]; - - float final; - - int dx2 = t->center2d[0] - mval[0]; - int dy2 = t->center2d[1] - mval[1]; - float B = (float)sqrt(dx2*dx2+dy2*dy2); - - int dx1 = t->center2d[0] - t->imval[0]; - int dy1 = t->center2d[1] - t->imval[1]; - float A = (float)sqrt(dx1*dx1+dy1*dy1); - - int dx3 = mval[0] - t->imval[0]; - int dy3 = mval[1] - t->imval[1]; - - float deler= ((dx1*dx1+dy1*dy1)+(dx2*dx2+dy2*dy2)-(dx3*dx3+dy3*dy3)) - / (2 * A * B); - - float dphi; - - dphi = saacos(deler); - if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; - - if(G.qual & LR_SHIFTKEY) t->fac += dphi/30.0f; - else t->fac += dphi; - - final = t->fac; - - snapGrid(t, &final); - - t->imval[0] = mval[0]; - t->imval[1] = mval[1]; - - if (hasNumInput(&t->num)) { - char c[20]; - - applyNumInput(&t->num, &final); - - outputNumInput(&(t->num), c); - - sprintf(str, "Tilt: %s %s", &c[0], t->proptext); - - final *= (float)(M_PI / 180.0); - } - else { - sprintf(str, "Tilt: %.2f %s", 180.0*final/M_PI, t->proptext); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (td->val) { - *td->val = td->ival + final * td->factor; - } - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - helpline (t, t->center); - - return 1; -} - - -/* ******************** Curve Shrink/Fatten *************** */ - -int CurveShrinkFatten(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float ratio; - int i; - char str[50]; - - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - float dx= (float)(t->center2d[0] - t->shiftmval[0]); - float dy= (float)(t->center2d[1] - t->shiftmval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - - dx= (float)(t->center2d[0] - mval[0]); - dy= (float)(t->center2d[1] - mval[1]); - ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio); - - } - else { - float dx= (float)(t->center2d[0] - mval[0]); - float dy= (float)(t->center2d[1] - mval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - } - - snapGrid(t, &ratio); - - applyNumInput(&t->num, &ratio); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - sprintf(str, "Shrink/Fatten: %s", c); - } - else { - sprintf(str, "Shrink/Fatten: %3f", ratio); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if(td->val) { - //*td->val= ratio; - *td->val= td->ival*ratio; - if (*td->val <= 0.0f) *td->val = 0.0001f; - } - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - -void initCurveShrinkFatten(TransInfo *t) -{ - t->mode = TFM_CURVE_SHRINKFATTEN; - t->transform = CurveShrinkFatten; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; - - t->fac = (float)sqrt( ( - ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) - + - ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) - ) ); -} - -/* ************************** PUSH/PULL *************************** */ - -void initPushPull(TransInfo *t) -{ - t->mode = TFM_PUSHPULL; - t->transform = PushPull; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 1.0f; - t->snap[2] = t->snap[1] * 0.1f; -} - - -int PushPull(TransInfo *t, short mval[2]) -{ - float vec[3], axis[3]; - float distance; - int i; - char str[128]; - TransData *td = t->data; - - distance = InputVerticalAbsolute(t, mval); - - snapGrid(t, &distance); - - applyNumInput(&t->num, &distance); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - sprintf(str, "Push/Pull: %s%s %s", c, t->con.text, t->proptext); - } - else { - /* default header print */ - sprintf(str, "Push/Pull: %.4f%s %s", distance, t->con.text, t->proptext); - } - - if (t->con.applyRot && t->con.mode & CON_APPLY) { - t->con.applyRot(t, NULL, axis); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - VecSubf(vec, t->center, td->center); - if (t->con.applyRot && t->con.mode & CON_APPLY) { - t->con.applyRot(t, td, axis); - if (isLockConstraint(t)) { - float dvec[3]; - Projf(dvec, vec, axis); - VecSubf(vec, vec, dvec); - } - else { - Projf(vec, vec, axis); - } - } - Normalize(vec); - VecMulf(vec, distance); - VecMulf(vec, td->factor); - - VecAddf(td->loc, td->iloc, vec); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ************************** CREASE *************************** */ - -void initCrease(TransInfo *t) -{ - t->mode = TFM_CREASE; - t->transform = Crease; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; - - t->fac = (float)sqrt( - ( - ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) - + - ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) - ) ); - - if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf -} - -int Crease(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float crease; - int i; - char str[50]; - - - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - float dx= (float)(t->center2d[0] - t->shiftmval[0]); - float dy= (float)(t->center2d[1] - t->shiftmval[1]); - crease = (float)sqrt( dx*dx + dy*dy)/t->fac; - - dx= (float)(t->center2d[0] - mval[0]); - dy= (float)(t->center2d[1] - mval[1]); - crease+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -crease); - - } - else { - float dx= (float)(t->center2d[0] - mval[0]); - float dy= (float)(t->center2d[1] - mval[1]); - crease = (float)sqrt( dx*dx + dy*dy)/t->fac; - } - - crease -= 1.0f; - if (crease > 1.0f) crease = 1.0f; - - snapGrid(t, &crease); - - applyNumInput(&t->num, &crease); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - if (crease >= 0.0f) - sprintf(str, "Crease: +%s %s", c, t->proptext); - else - sprintf(str, "Crease: %s %s", c, t->proptext); - } - else { - /* default header print */ - if (crease >= 0.0f) - sprintf(str, "Crease: +%.3f %s", crease, t->proptext); - else - sprintf(str, "Crease: %.3f %s", crease, t->proptext); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (td->val) { - *td->val = td->ival + crease * td->factor; - if (*td->val < 0.0f) *td->val = 0.0f; - if (*td->val > 1.0f) *td->val = 1.0f; - } - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - helpline (t, t->center); - - return 1; -} - -/* ******************** EditBone (B-bone) width scaling *************** */ - -void initBoneSize(TransInfo *t) -{ - t->mode = TFM_BONESIZE; - t->transform = BoneSize; - - t->idx_max = 2; - t->num.idx_max = 2; - t->num.flag |= NUM_NULL_ONE; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->fac = (float)sqrt( ( - ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) - + - ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) - ) ); - - if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf -} - -static void headerBoneSize(TransInfo *t, float vec[3], char *str) { - char tvec[60]; - if (hasNumInput(&t->num)) { - outputNumInput(&(t->num), tvec); - } - else { - sprintf(&tvec[0], "%.4f", vec[0]); - sprintf(&tvec[20], "%.4f", vec[1]); - sprintf(&tvec[40], "%.4f", vec[2]); - } - - /* hmm... perhaps the y-axis values don't need to be shown? */ - if (t->con.mode & CON_APPLY) { - if (t->num.idx_max == 0) - sprintf(str, "ScaleB: %s%s %s", &tvec[0], t->con.text, t->proptext); - else - sprintf(str, "ScaleB: %s : %s : %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); - } - else { - sprintf(str, "ScaleB X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext); - } -} - -static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) -{ - float tmat[3][3], smat[3][3], oldy; - float sizemat[3][3]; - - Mat3MulMat3(smat, mat, td->mtx); - Mat3MulMat3(tmat, td->smtx, smat); - - if (t->con.applySize) { - t->con.applySize(t, td, tmat); - } - - /* we've tucked the scale in loc */ - oldy= td->iloc[1]; - SizeToMat3(td->iloc, sizemat); - Mat3MulMat3(tmat, tmat, sizemat); - Mat3ToSize(tmat, td->loc); - td->loc[1]= oldy; -} - -int BoneSize(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float size[3], mat[3][3]; - float ratio; - int i; - char str[60]; - - /* for manipulator, center handle, the scaling can't be done relative to center */ - if( (t->flag & T_USES_MANIPULATOR) && t->con.mode==0) { - ratio = 1.0f - ((t->imval[0] - mval[0]) + (t->imval[1] - mval[1]))/100.0f; - } - else { - - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - float dx= (float)(t->center2d[0] - t->shiftmval[0]); - float dy= (float)(t->center2d[1] - t->shiftmval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - - dx= (float)(t->center2d[0] - mval[0]); - dy= (float)(t->center2d[1] - mval[1]); - ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio); - - } - else { - float dx= (float)(t->center2d[0] - mval[0]); - float dy= (float)(t->center2d[1] - mval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - } - - /* flip scale, but not for manipulator center handle */ - if ((t->center2d[0] - mval[0]) * (t->center2d[0] - t->imval[0]) + - (t->center2d[1] - mval[1]) * (t->center2d[1] - t->imval[1]) < 0) - ratio *= -1.0f; - } - - size[0] = size[1] = size[2] = ratio; - - snapGrid(t, size); - - if (hasNumInput(&t->num)) { - applyNumInput(&t->num, size); - constraintNumInput(t, size); - } - - SizeToMat3(size, mat); - - if (t->con.applySize) { - t->con.applySize(t, NULL, mat); - } - - Mat3CpyMat3(t->mat, mat); // used in manipulator - - headerBoneSize(t, size, str); - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - ElementBoneSize(t, td, mat); - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - - -/* ******************** EditBone envelope *************** */ - -void initBoneEnvelope(TransInfo *t) -{ - t->mode = TFM_BONE_ENVELOPE; - t->transform = BoneEnvelope; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 0.1f; - t->snap[2] = t->snap[1] * 0.1f; - - t->flag |= T_NO_CONSTRAINT; - - t->fac = (float)sqrt( ( - ((float)(t->center2d[1] - t->imval[1]))*((float)(t->center2d[1] - t->imval[1])) - + - ((float)(t->center2d[0] - t->imval[0]))*((float)(t->center2d[0] - t->imval[0])) - ) ); - - if(t->fac==0.0f) t->fac= 1.0f; // prevent Inf -} - -int BoneEnvelope(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float ratio; - int i; - char str[50]; - - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - float dx= (float)(t->center2d[0] - t->shiftmval[0]); - float dy= (float)(t->center2d[1] - t->shiftmval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - - dx= (float)(t->center2d[0] - mval[0]); - dy= (float)(t->center2d[1] - mval[1]); - ratio+= 0.1f*(float)(sqrt( dx*dx + dy*dy)/t->fac -ratio); - - } - else { - float dx= (float)(t->center2d[0] - mval[0]); - float dy= (float)(t->center2d[1] - mval[1]); - ratio = (float)sqrt( dx*dx + dy*dy)/t->fac; - } - - snapGrid(t, &ratio); - - applyNumInput(&t->num, &ratio); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - sprintf(str, "Envelope: %s", c); - } - else { - sprintf(str, "Envelope: %3f", ratio); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (td->val) { - /* if the old/original value was 0.0f, then just use ratio */ - if (td->ival) - *td->val= td->ival*ratio; - else - *td->val= ratio; - } - } - - recalcData(t); - - headerprint(str); - - force_draw(0); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - - -/* ******************** EditBone roll *************** */ - -void initBoneRoll(TransInfo *t) -{ - t->mode = TFM_BONE_ROLL; - t->transform = BoneRoll; - - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = (float)((5.0/180)*M_PI); - t->snap[2] = t->snap[1] * 0.2f; - - t->fac = 0.0f; - - t->flag |= T_NO_CONSTRAINT; -} - -int BoneRoll(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - int i; - char str[50]; - - float final; - - int dx2 = t->center2d[0] - mval[0]; - int dy2 = t->center2d[1] - mval[1]; - double B = sqrt(dx2*dx2+dy2*dy2); - - int dx1 = t->center2d[0] - t->imval[0]; - int dy1 = t->center2d[1] - t->imval[1]; - double A = sqrt(dx1*dx1+dy1*dy1); - - int dx3 = mval[0] - t->imval[0]; - int dy3 = mval[1] - t->imval[1]; - /* use doubles here, to make sure a "1.0" (no rotation) doesnt become 9.999999e-01, which gives 0.02 for acos */ - double deler= ((double)((dx1*dx1+dy1*dy1)+(dx2*dx2+dy2*dy2)-(dx3*dx3+dy3*dy3) )) - / (2.0 * (A*B?A*B:1.0)); - /* (A*B?A*B:1.0f) this takes care of potential divide by zero errors */ - - float dphi; - - dphi = saacos((float)deler); - if( (dx1*dy2-dx2*dy1)>0.0 ) dphi= -dphi; - - if(G.qual & LR_SHIFTKEY) t->fac += dphi/30.0f; - else t->fac += dphi; - - final = t->fac; - - snapGrid(t, &final); - - t->imval[0] = mval[0]; - t->imval[1] = mval[1]; - - if (hasNumInput(&t->num)) { - char c[20]; - - applyNumInput(&t->num, &final); - - outputNumInput(&(t->num), c); - - sprintf(str, "Roll: %s", &c[0]); - - final *= (float)(M_PI / 180.0); - } - else { - sprintf(str, "Roll: %.2f", 180.0*final/M_PI); - } - - /* set roll values */ - for (i = 0; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - *(td->val) = td->ival - final; - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - if(!(t->flag & T_USES_MANIPULATOR)) helpline (t, t->center); - - return 1; -} - -/* ************************** BAKE TIME ******************* */ - -void initBakeTime(TransInfo *t) -{ - t->idx_max = 0; - t->num.idx_max = 0; - t->snap[0] = 0.0f; - t->snap[1] = 1.0f; - t->snap[2] = t->snap[1] * 0.1f; - t->transform = BakeTime; - t->fac = 0.1f; -} - -int BakeTime(TransInfo *t, short mval[2]) -{ - TransData *td = t->data; - float time; - int i; - char str[50]; - - - if(t->flag & T_SHIFT_MOD) { - /* calculate ratio for shiftkey pos, and for total, and blend these for precision */ - time= (float)(t->center2d[0] - t->shiftmval[0])*t->fac; - time+= 0.1f*((float)(t->center2d[0]*t->fac - mval[0]) -time); - } - else { - time = (float)(t->center2d[0] - mval[0])*t->fac; - } - - snapGrid(t, &time); - - applyNumInput(&t->num, &time); - - /* header print for NumInput */ - if (hasNumInput(&t->num)) { - char c[20]; - - outputNumInput(&(t->num), c); - - if (time >= 0.0f) - sprintf(str, "Time: +%s %s", c, t->proptext); - else - sprintf(str, "Time: %s %s", c, t->proptext); - } - else { - /* default header print */ - if (time >= 0.0f) - sprintf(str, "Time: +%.3f %s", time, t->proptext); - else - sprintf(str, "Time: %.3f %s", time, t->proptext); - } - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - if (td->val) { - *td->val = td->ival + time * td->factor; - if (td->ext->size && *td->val < *td->ext->size) *td->val = *td->ext->size; - if (td->ext->quat && *td->val > *td->ext->quat) *td->val = *td->ext->quat; - } - } - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - helpline (t, t->center); - - return 1; -} - - -/* ************************** MIRROR *************************** */ - -void Mirror(short mode) -{ - TransData *td; - float mati[3][3], matview[3][3], mat[3][3]; - float size[3]; - int i; - - Trans.context = CTX_NO_PET; - - initTrans(&Trans); // internal data, mouse, vectors - - Mat3One(mati); - Mat3CpyMat4(matview, Trans.viewinv); // t->viewinv was set in initTrans - Mat3Ortho(matview); - - createTransData(&Trans); // make TransData structs from selection - - calculatePropRatio(&Trans); - calculateCenter(&Trans); - - initResize(&Trans); - - if (Trans.total == 0) { - postTrans(&Trans); - return; - } - - size[0] = size[1] = size[2] = 1.0f; - td = Trans.data; - - switch (mode) { - case 1: - size[0] = -1.0f; - setConstraint(&Trans, mati, (CON_AXIS0), ""); - break; - case 2: - size[1] = -1.0f; - setConstraint(&Trans, mati, (CON_AXIS1), ""); - break; - case 3: - size[2] = -1.0f; - setConstraint(&Trans, mati, (CON_AXIS2), ""); - break; - case 4: - size[0] = -1.0f; - setLocalConstraint(&Trans, (CON_AXIS0), ""); - break; - case 5: - size[1] = -1.0f; - setLocalConstraint(&Trans, (CON_AXIS1), ""); - break; - case 6: - size[2] = -1.0f; - setLocalConstraint(&Trans, (CON_AXIS2), ""); - break; - case 7: - size[0] = -1.0f; - setConstraint(&Trans, matview, (CON_AXIS0), ""); - break; - case 8: - size[1] = -1.0f; - setConstraint(&Trans, matview, (CON_AXIS1), ""); - break; - case 9: - size[2] = -1.0f; - setConstraint(&Trans, matview, (CON_AXIS2), ""); - break; - default: - return; - } - - SizeToMat3(size, mat); - - if (Trans.con.applySize) { - Trans.con.applySize(&Trans, NULL, mat); - } - - for(i = 0 ; i < Trans.total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - - if (td->flag & TD_SKIP) - continue; - - ElementResize(&Trans, td, mat); - } - - recalcData(&Trans); - - BIF_undo_push("Mirror"); - - /* free data, reset vars */ - postTrans(&Trans); - - /* send events out for redraws */ - viewRedrawPost(&Trans); -} - -/* ************************** ANIM EDITORS - TRANSFORM TOOLS *************************** */ - -/* ---------------- Special Helpers for Various Settings ------------- */ - -/* This function returns the snapping 'mode' for Animation Editors only - * We cannot use the standard snapping due to NLA-strip scaling complexities. - */ -static short getAnimEdit_SnapMode(TransInfo *t) -{ - short autosnap= SACTSNAP_OFF; - - /* currently, some of these are only for the action editor */ - if (t->spacetype == SPACE_ACTION && G.saction) { - switch (G.saction->autosnap) { - case SACTSNAP_OFF: - if (G.qual == LR_CTRLKEY) - autosnap= SACTSNAP_STEP; - else if (G.qual == LR_SHIFTKEY) - autosnap= SACTSNAP_FRAME; - else if (G.qual == LR_ALTKEY) - autosnap= SACTSNAP_MARKER; - else - autosnap= SACTSNAP_OFF; - break; - case SACTSNAP_STEP: - autosnap= (G.qual==LR_CTRLKEY)? SACTSNAP_OFF: SACTSNAP_STEP; - break; - case SACTSNAP_FRAME: - autosnap= (G.qual==LR_SHIFTKEY)? SACTSNAP_OFF: SACTSNAP_FRAME; - break; - case SACTSNAP_MARKER: - autosnap= (G.qual==LR_ALTKEY)? SACTSNAP_OFF: SACTSNAP_MARKER; - break; - } - } - else if (t->spacetype == SPACE_NLA && G.snla) { - switch (G.snla->autosnap) { - case SACTSNAP_OFF: - if (G.qual == LR_CTRLKEY) - autosnap= SACTSNAP_STEP; - else if (G.qual == LR_SHIFTKEY) - autosnap= SACTSNAP_FRAME; - else if (G.qual == LR_ALTKEY) - autosnap= SACTSNAP_MARKER; - else - autosnap= SACTSNAP_OFF; - break; - case SACTSNAP_STEP: - autosnap= (G.qual==LR_CTRLKEY)? SACTSNAP_OFF: SACTSNAP_STEP; - break; - case SACTSNAP_FRAME: - autosnap= (G.qual==LR_SHIFTKEY)? SACTSNAP_OFF: SACTSNAP_FRAME; - break; - case SACTSNAP_MARKER: - autosnap= (G.qual==LR_ALTKEY)? SACTSNAP_OFF: SACTSNAP_MARKER; - break; - } - } - else { - if (G.qual == LR_CTRLKEY) - autosnap= SACTSNAP_STEP; - else if (G.qual == LR_SHIFTKEY) - autosnap= SACTSNAP_FRAME; - else if (G.qual == LR_ALTKEY) - autosnap= SACTSNAP_MARKER; - else - autosnap= SACTSNAP_OFF; - } - - return autosnap; -} - -/* This function is used for testing if an Animation Editor is displaying - * its data in frames or seconds (and the data needing to be edited as such). - * Returns 1 if in seconds, 0 if in frames - */ -static short getAnimEdit_DrawTime(TransInfo *t) -{ - short drawtime; - - /* currently, some of these are only for the action editor */ - if (t->spacetype == SPACE_ACTION && G.saction) { - drawtime = (G.saction->flag & SACTION_DRAWTIME)? 1 : 0; - } - else if (t->spacetype == SPACE_NLA && G.snla) { - drawtime = (G.snla->flag & SNLA_DRAWTIME)? 1 : 0; - } - else { - drawtime = 0; - } - - return drawtime; -} - - -/* This function is used by Animation Editor specific transform functions to do - * the Snap Keyframe to Nearest Frame/Marker - */ -static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, Object *ob, short autosnap) -{ - /* snap key to nearest frame? */ - if (autosnap == SACTSNAP_FRAME) { - short doTime= getAnimEdit_DrawTime(t); - double secf= FPS; - float val; - - /* convert frame to nla-action time (if needed) */ - if (ob) - val= get_action_frame_inv(ob, *(td->val)); - else - val= *(td->val); - - /* do the snapping to nearest frame/second */ - if (doTime) - val= (float)( floor((val/secf) + 0.5f) * secf ); - else - val= (float)( floor(val+0.5f) ); - - /* convert frame out of nla-action time */ - if (ob) - *(td->val)= get_action_frame(ob, val); - else - *(td->val)= val; - } - /* snap key to nearest marker? */ - else if (autosnap == SACTSNAP_MARKER) { - float val; - - /* convert frame to nla-action time (if needed) */ - if (ob) - val= get_action_frame_inv(ob, *(td->val)); - else - val= *(td->val); - - /* snap to nearest marker */ - val= (float)find_nearest_marker_time(val); - - /* convert frame out of nla-action time */ - if (ob) - *(td->val)= get_action_frame(ob, val); - else - *(td->val)= val; - } -} - -/* ----------------- Translation ----------------------- */ - -void initTimeTranslate(TransInfo *t) -{ - t->mode = TFM_TIME_TRANSLATE; - t->transform = TimeTranslate; - - /* num-input has max of (n-1) */ - t->idx_max = 0; - t->num.flag = 0; - t->num.idx_max = t->idx_max; - - /* initialise snap like for everything else */ - t->snap[0] = 0.0f; - t->snap[1] = t->snap[2] = 1.0f; -} - -static void headerTimeTranslate(TransInfo *t, char *str) -{ - char tvec[60]; - - /* if numeric input is active, use results from that, otherwise apply snapping to result */ - if (hasNumInput(&t->num)) { - outputNumInput(&(t->num), tvec); - } - else { - short autosnap= getAnimEdit_SnapMode(t); - short doTime = getAnimEdit_DrawTime(t); - double secf= FPS; - float val= t->fac; - - /* apply snapping + frame->seconds conversions */ - if (autosnap == SACTSNAP_STEP) { - if (doTime) - val= floor(val/secf + 0.5f); - else - val= floor(val + 0.5f); - } - else { - if (doTime) - val= val / secf; - } - - sprintf(&tvec[0], "%.4f", val); - } - - sprintf(str, "DeltaX: %s", &tvec[0]); -} - -static void applyTimeTranslate(TransInfo *t, float sval) -{ - TransData *td = t->data; - int i; - - short doTime= getAnimEdit_DrawTime(t); - double secf= FPS; - - short autosnap= getAnimEdit_SnapMode(t); - - float deltax, val; - - /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ - for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, - * whose active action is where this keyframe comes from - */ - Object *ob= td->ob; - - /* check if any need to apply nla-scaling */ - if (ob) { - deltax = t->fac; - - if (autosnap == SACTSNAP_STEP) { - if (doTime) - deltax= (float)( floor((deltax/secf) + 0.5f) * secf ); - else - deltax= (float)( floor(deltax + 0.5f) ); - } - - val = get_action_frame_inv(ob, td->ival); - val += deltax; - *(td->val) = get_action_frame(ob, val); - } - else { - deltax = val = t->fac; - - if (autosnap == SACTSNAP_STEP) { - if (doTime) - val= (float)( floor((deltax/secf) + 0.5f) * secf ); - else - val= (float)( floor(val + 0.5f) ); - } - - *(td->val) = td->ival + val; - } - - /* apply nearest snapping */ - doAnimEdit_SnapFrame(t, td, ob, autosnap); - } -} - -int TimeTranslate(TransInfo *t, short mval[2]) -{ - float cval[2], sval[2]; - char str[200]; - - /* calculate translation amount from mouse movement - in 'time-grid space' */ - areamouseco_to_ipoco(G.v2d, mval, &cval[0], &cval[1]); - areamouseco_to_ipoco(G.v2d, t->imval, &sval[0], &sval[1]); - - /* we only need to calculate effect for time (applyTimeTranslate only needs that) */ - t->fac= cval[0] - sval[0]; - - /* handle numeric-input stuff */ - t->vec[0] = t->fac; - applyNumInput(&t->num, &t->vec[0]); - t->fac = t->vec[0]; - headerTimeTranslate(t, str); - - applyTimeTranslate(t, sval[0]); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ----------------- Time Slide ----------------------- */ - -void initTimeSlide(TransInfo *t) -{ - /* this tool is only really available in the Action Editor... */ - if (t->spacetype == SPACE_ACTION) { - /* set flag for drawing stuff*/ - G.saction->flag |= SACTION_MOVING; - } - - t->mode = TFM_TIME_SLIDE; - t->transform = TimeSlide; - t->flag |= T_FREE_CUSTOMDATA; - - /* num-input has max of (n-1) */ - t->idx_max = 0; - t->num.flag = 0; - t->num.idx_max = t->idx_max; - - /* initialise snap like for everything else */ - t->snap[0] = 0.0f; - t->snap[1] = t->snap[2] = 1.0f; -} - -static void headerTimeSlide(TransInfo *t, float sval, char *str) -{ - char tvec[60]; - - if (hasNumInput(&t->num)) { - outputNumInput(&(t->num), tvec); - } - else { - float minx= *((float *)(t->customData)); - float maxx= *((float *)(t->customData) + 1); - float cval= t->fac; - float val; - - val= 2.0*(cval-sval) / (maxx-minx); - CLAMP(val, -1.0f, 1.0f); - - sprintf(&tvec[0], "%.4f", val); - } - - sprintf(str, "TimeSlide: %s", &tvec[0]); -} - -static void applyTimeSlide(TransInfo *t, float sval) -{ - TransData *td = t->data; - int i; - - float minx= *((float *)(t->customData)); - float maxx= *((float *)(t->customData) + 1); - - /* set value for drawing black line */ - if (t->spacetype == SPACE_ACTION) { - G.saction->timeslide= t->fac; - - if (NLA_ACTION_SCALED) - sval= get_action_frame(OBACT, sval); - } - - /* it doesn't matter whether we apply to t->data or t->data2d, but t->data2d is more convenient */ - for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, - * whose active action is where this keyframe comes from - */ - Object *ob= td->ob; - float cval = t->fac; - - /* apply scaling to necessary values */ - if (ob) - cval= get_action_frame(ob, cval); - - /* only apply to data if in range */ - if (sval > minx && sval < maxx) { - float cvalc= CLAMPIS(cval, minx, maxx); - float timefac; - - /* left half? */ - if (td->ival < sval) { - timefac= (sval - td->ival) / (sval - minx); - *(td->val)= cvalc - timefac * (cvalc - minx); - } - else { - timefac= (td->ival - sval) / (maxx - sval); - *(td->val)= cvalc + timefac * (maxx - cvalc); - } - } - } -} - -int TimeSlide(TransInfo *t, short mval[2]) -{ - float cval[2], sval[2]; - char str[200]; - - /* calculate mouse co-ordinates */ - areamouseco_to_ipoco(G.v2d, mval, &cval[0], &cval[1]); - areamouseco_to_ipoco(G.v2d, t->imval, &sval[0], &sval[1]); - - /* calculate fake value to work with */ - t->fac= cval[0]; - - /* handle numeric-input stuff */ - t->vec[0] = t->fac; - applyNumInput(&t->num, &t->vec[0]); - t->fac = t->vec[0]; - headerTimeSlide(t, sval[0], str); - - applyTimeSlide(t, sval[0]); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ----------------- Scaling ----------------------- */ - -void initTimeScale(TransInfo *t) -{ - t->mode = TFM_TIME_SCALE; - t->transform = TimeScale; - - t->flag |= T_NULL_ONE; - t->num.flag |= NUM_NULL_ONE; - - /* num-input has max of (n-1) */ - t->idx_max = 0; - t->num.flag = 0; - t->num.idx_max = t->idx_max; - - /* initialise snap like for everything else */ - t->snap[0] = 0.0f; - t->snap[1] = t->snap[2] = 1.0f; -} - -static void headerTimeScale(TransInfo *t, char *str) { - char tvec[60]; - - if (hasNumInput(&t->num)) - outputNumInput(&(t->num), tvec); - else - sprintf(&tvec[0], "%.4f", t->fac); - - sprintf(str, "ScaleX: %s", &tvec[0]); -} - -static void applyTimeScale(TransInfo *t) { - TransData *td = t->data; - int i; - - short autosnap= getAnimEdit_SnapMode(t); - short doTime= getAnimEdit_DrawTime(t); - double secf= FPS; - - - for (i = 0 ; i < t->total; i++, td++) { - /* it is assumed that td->ob is a pointer to the object, - * whose active action is where this keyframe comes from - */ - Object *ob= td->ob; - float startx= CFRA; - float fac= t->fac; - - if (autosnap == SACTSNAP_STEP) { - if (doTime) - fac= (float)( floor(fac/secf + 0.5f) * secf ); - else - fac= (float)( floor(fac + 0.5f) ); - } - - /* check if any need to apply nla-scaling */ - if (ob) - startx= get_action_frame(ob, startx); - - /* now, calculate the new value */ - *(td->val) = td->ival - startx; - *(td->val) *= fac; - *(td->val) += startx; - - /* apply nearest snapping */ - doAnimEdit_SnapFrame(t, td, ob, autosnap); - } -} - -int TimeScale(TransInfo *t, short mval[2]) -{ - float cval, sval; - float deltax, startx; - float width= 0.0f; - char str[200]; - - sval= t->imval[0]; - cval= mval[0]; - - switch (t->spacetype) { - case SPACE_ACTION: - width= ACTWIDTH; - break; - case SPACE_NLA: - width= NLAWIDTH; - break; - } - - /* calculate scaling factor */ - startx= sval-(width/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2); - deltax= cval-(width/2+(curarea->winrct.xmax-curarea->winrct.xmin)/2); - t->fac = deltax / startx; - - /* handle numeric-input stuff */ - t->vec[0] = t->fac; - applyNumInput(&t->num, &t->vec[0]); - t->fac = t->vec[0]; - headerTimeScale(t, str); - - applyTimeScale(t); - - recalcData(t); - - headerprint(str); - - viewRedrawForce(t); - - return 1; -} - -/* ************************************ */ - -void BIF_TransformSetUndo(char *str) -{ - Trans.undostr= str; -} - - - diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c deleted file mode 100644 index 99e5123a953..00000000000 --- a/source/blender/src/transform_constraints.c +++ /dev/null @@ -1,1046 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_view3d_types.h" - -#include "BIF_screen.h" -#include "BIF_resources.h" -#include "BIF_mywindow.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "BSE_view.h" - -#include "BLI_arithb.h" - -#include "BDR_drawobject.h" /* drawcircball */ - -#include "blendef.h" - -#include "mydevice.h" - -#include "transform.h" - -static void drawObjectConstraint(TransInfo *t); - -/* ************************** CONSTRAINTS ************************* */ -void constraintNumInput(TransInfo *t, float vec[3]) -{ - int mode = t->con.mode; - if (mode & CON_APPLY) { - float nval = (t->flag & T_NULL_ONE)?1.0f:0.0f; - - if (getConstraintSpaceDimension(t) == 2) { - int axis = mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - if (axis == (CON_AXIS0|CON_AXIS1)) { - vec[2] = nval; - } - else if (axis == (CON_AXIS1|CON_AXIS2)) { - vec[2] = vec[1]; - vec[1] = vec[0]; - vec[0] = nval; - } - else if (axis == (CON_AXIS0|CON_AXIS2)) { - vec[2] = vec[1]; - vec[1] = nval; - } - } - else if (getConstraintSpaceDimension(t) == 1) { - if (mode & CON_AXIS0) { - vec[1] = nval; - vec[2] = nval; - } - else if (mode & CON_AXIS1) { - vec[1] = vec[0]; - vec[0] = nval; - vec[2] = nval; - } - else if (mode & CON_AXIS2) { - vec[2] = vec[0]; - vec[0] = nval; - vec[1] = nval; - } - } - } -} - -static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) { - int i = 0; - - Mat3MulVecfl(t->con.imtx, vec); - - snapGrid(t, vec); - - if (t->num.flag & T_NULL_ONE) { - if (!(t->con.mode & CON_AXIS0)) - vec[0] = 1.0f; - - if (!(t->con.mode & CON_AXIS1)) - vec[1] = 1.0f; - - if (!(t->con.mode & CON_AXIS2)) - vec[2] = 1.0f; - } - - if (hasNumInput(&t->num)) { - applyNumInput(&t->num, vec); - constraintNumInput(t, vec); - } - - if (t->con.mode & CON_AXIS0) { - pvec[i++] = vec[0]; - } - if (t->con.mode & CON_AXIS1) { - pvec[i++] = vec[1]; - } - if (t->con.mode & CON_AXIS2) { - pvec[i++] = vec[2]; - } - - Mat3MulVecfl(t->con.mtx, vec); -} - -static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3]) { - float norm[3], vec[3], factor; - - if(in[0]==0.0f && in[1]==0.0f && in[2]==0.0f) - return; - - /* For when view is parallel to constraint... will cause NaNs otherwise - So we take vertical motion in 3D space and apply it to the - constraint axis. Nice for camera grab + MMB */ - if(1.0f - fabs(Inpf(axis, t->viewinv[2])) < 0.000001f) { - Projf(vec, in, t->viewinv[1]); - factor = Inpf(t->viewinv[1], vec) * 2.0f; - /* since camera distance is quite relative, use quadratic relationship. holding shift can compensate */ - if(factor<0.0f) factor*= -factor; - else factor*= factor; - - VECCOPY(out, axis); - Normalize(out); - VecMulf(out, -factor); /* -factor makes move down going backwards */ - } - else { - float cb[3], ab[3]; - - VECCOPY(out, axis); - - /* Get view vector on axis to define a plane */ - VecAddf(vec, t->con.center, in); - getViewVector(vec, norm); - - Crossf(vec, norm, axis); - - /* Project input vector on the plane passing on axis */ - Projf(vec, in, vec); - VecSubf(vec, in, vec); - - /* intersect the two lines: axis and norm */ - Crossf(cb, vec, norm); - Crossf(ab, axis, norm); - - VecMulf(out, Inpf(cb, ab) / Inpf(ab, ab)); - } -} - -static void planeProjection(TransInfo *t, float in[3], float out[3]) { - float vec[3], factor, norm[3]; - - VecAddf(vec, in, t->con.center); - getViewVector(vec, norm); - - VecSubf(vec, out, in); - - factor = Inpf(vec, norm); - if (fabs(factor) <= 0.001) { - return; /* prevent divide by zero */ - } - factor = Inpf(vec, vec) / factor; - - VECCOPY(vec, norm); - VecMulf(vec, factor); - - VecAddf(out, in, vec); -} - -/* - * Generic callback for constant spacial constraints applied to linear motion - * - * The IN vector in projected into the constrained space and then further - * projected along the view vector. - * (in perspective mode, the view vector is relative to the position on screen) - * - */ - -static void applyAxisConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3]) -{ - VECCOPY(out, in); - if (!td && t->con.mode & CON_APPLY) { - Mat3MulVecfl(t->con.pmtx, out); - - // With snap, a projection is alright, no need to correct for view alignment - if ((t->tsnap.status & SNAP_ON) == 0) - { - if (getConstraintSpaceDimension(t) == 2) { - if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) { - planeProjection(t, in, out); - } - } - else if (getConstraintSpaceDimension(t) == 1) { - float c[3]; - - if (t->con.mode & CON_AXIS0) { - VECCOPY(c, t->con.mtx[0]); - } - else if (t->con.mode & CON_AXIS1) { - VECCOPY(c, t->con.mtx[1]); - } - else if (t->con.mode & CON_AXIS2) { - VECCOPY(c, t->con.mtx[2]); - } - axisProjection(t, c, in, out); - } - } - postConstraintChecks(t, out, pvec); - } -} - -/* - * Generic callback for object based spacial constraints applied to linear motion - * - * At first, the following is applied to the first data in the array - * The IN vector in projected into the constrained space and then further - * projected along the view vector. - * (in perspective mode, the view vector is relative to the position on screen) - * - * Further down, that vector is mapped to each data's space. - */ - -static void applyObjectConstraintVec(TransInfo *t, TransData *td, float in[3], float out[3], float pvec[3]) -{ - VECCOPY(out, in); - if (t->con.mode & CON_APPLY) { - if (!td) { - Mat3MulVecfl(t->con.pmtx, out); - if (getConstraintSpaceDimension(t) == 2) { - if (out[0] != 0.0f || out[1] != 0.0f || out[2] != 0.0f) { - planeProjection(t, in, out); - } - } - else if (getConstraintSpaceDimension(t) == 1) { - float c[3]; - - if (t->con.mode & CON_AXIS0) { - VECCOPY(c, t->con.mtx[0]); - } - else if (t->con.mode & CON_AXIS1) { - VECCOPY(c, t->con.mtx[1]); - } - else if (t->con.mode & CON_AXIS2) { - VECCOPY(c, t->con.mtx[2]); - } - axisProjection(t, c, in, out); - } - postConstraintChecks(t, out, pvec); - VECCOPY(out, pvec); - } - else { - int i=0; - - out[0] = out[1] = out[2] = 0.0f; - if (t->con.mode & CON_AXIS0) { - out[0] = in[i++]; - } - if (t->con.mode & CON_AXIS1) { - out[1] = in[i++]; - } - if (t->con.mode & CON_AXIS2) { - out[2] = in[i++]; - } - Mat3MulVecfl(td->axismtx, out); - } - } -} - -/* - * Generic callback for constant spacial constraints applied to resize motion - * - * - */ - -static void applyAxisConstraintSize(TransInfo *t, TransData *td, float smat[3][3]) -{ - if (!td && t->con.mode & CON_APPLY) { - float tmat[3][3]; - - if (!(t->con.mode & CON_AXIS0)) { - smat[0][0] = 1.0f; - } - if (!(t->con.mode & CON_AXIS1)) { - smat[1][1] = 1.0f; - } - if (!(t->con.mode & CON_AXIS2)) { - smat[2][2] = 1.0f; - } - - Mat3MulMat3(tmat, smat, t->con.imtx); - Mat3MulMat3(smat, t->con.mtx, tmat); - } -} - -/* - * Callback for object based spacial constraints applied to resize motion - * - * - */ - -static void applyObjectConstraintSize(TransInfo *t, TransData *td, float smat[3][3]) -{ - if (td && t->con.mode & CON_APPLY) { - float tmat[3][3]; - float imat[3][3]; - - Mat3Inv(imat, td->axismtx); - - if (!(t->con.mode & CON_AXIS0)) { - smat[0][0] = 1.0f; - } - if (!(t->con.mode & CON_AXIS1)) { - smat[1][1] = 1.0f; - } - if (!(t->con.mode & CON_AXIS2)) { - smat[2][2] = 1.0f; - } - - Mat3MulMat3(tmat, smat, imat); - Mat3MulMat3(smat, td->axismtx, tmat); - } -} - -/* - * Generic callback for constant spacial constraints applied to rotations - * - * The rotation axis is copied into VEC. - * - * In the case of single axis constraints, the rotation axis is directly the one constrained to. - * For planar constraints (2 axis), the rotation axis is the normal of the plane. - * - * The following only applies when CON_NOFLIP is not set. - * The vector is then modified to always point away from the screen (in global space) - * This insures that the rotation is always logically following the mouse. - * (ie: not doing counterclockwise rotations when the mouse moves clockwise). - */ - -static void applyAxisConstraintRot(TransInfo *t, TransData *td, float vec[3]) -{ - if (!td && t->con.mode & CON_APPLY) { - int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - - switch(mode) { - case CON_AXIS0: - case (CON_AXIS1|CON_AXIS2): - VECCOPY(vec, t->con.mtx[0]); - break; - case CON_AXIS1: - case (CON_AXIS0|CON_AXIS2): - VECCOPY(vec, t->con.mtx[1]); - break; - case CON_AXIS2: - case (CON_AXIS0|CON_AXIS1): - VECCOPY(vec, t->con.mtx[2]); - break; - } - if (!(mode & CON_NOFLIP)) { - if (Inpf(vec, t->viewinv[2]) > 0.0f) { - VecMulf(vec, -1.0f); - } - } - } -} - -/* - * Callback for object based spacial constraints applied to rotations - * - * The rotation axis is copied into VEC. - * - * In the case of single axis constraints, the rotation axis is directly the one constrained to. - * For planar constraints (2 axis), the rotation axis is the normal of the plane. - * - * The following only applies when CON_NOFLIP is not set. - * The vector is then modified to always point away from the screen (in global space) - * This insures that the rotation is always logically following the mouse. - * (ie: not doing counterclockwise rotations when the mouse moves clockwise). - */ - -static void applyObjectConstraintRot(TransInfo *t, TransData *td, float vec[3]) -{ - if (td && t->con.mode & CON_APPLY) { - int mode = t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - - switch(mode) { - case CON_AXIS0: - case (CON_AXIS1|CON_AXIS2): - VECCOPY(vec, td->axismtx[0]); - break; - case CON_AXIS1: - case (CON_AXIS0|CON_AXIS2): - VECCOPY(vec, td->axismtx[1]); - break; - case CON_AXIS2: - case (CON_AXIS0|CON_AXIS1): - VECCOPY(vec, td->axismtx[2]); - break; - } - if (!(mode & CON_NOFLIP)) { - if (Inpf(vec, t->viewinv[2]) > 0.0f) { - VecMulf(vec, -1.0f); - } - } - } -} - -/*--------------------- INTERNAL SETUP CALLS ------------------*/ - -void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]) { - strncpy(t->con.text + 1, text, 48); - Mat3CpyMat3(t->con.mtx, space); - t->con.mode = mode; - getConstraintMatrix(t); - - startConstraint(t); - - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; - t->redraw = 1; -} - -void setLocalConstraint(TransInfo *t, int mode, const char text[]) { - if (t->flag & T_EDIT) { - float obmat[3][3]; - Mat3CpyMat4(obmat, G.obedit->obmat); - setConstraint(t, obmat, mode|CON_LOCAL, text); - } - else { - if (t->total == 1) { - setConstraint(t, t->data->axismtx, mode|CON_LOCAL, text); - } - else { - strncpy(t->con.text + 1, text, 48); - Mat3CpyMat3(t->con.mtx, t->data->axismtx); - t->con.mode = mode|CON_LOCAL; - getConstraintMatrix(t); - - startConstraint(t); - - t->con.drawExtra = drawObjectConstraint; - t->con.applyVec = applyObjectConstraintVec; - t->con.applySize = applyObjectConstraintSize; - t->con.applyRot = applyObjectConstraintRot; - t->redraw = 1; - } - } -} - -/* - Set the constraint according to the user defined orientation - - ftext is a format string passed to sprintf. It will add the name of - the orientation where %s is (logically). -*/ -void setUserConstraint(TransInfo *t, int mode, const char ftext[]) { - char text[40]; - short twmode= (t->spacetype==SPACE_VIEW3D)? G.vd->twmode: V3D_MANIP_GLOBAL; - - switch(twmode) { - case V3D_MANIP_GLOBAL: - /* - sprintf(text, ftext, "global"); - Mat3One(mtx); - setConstraint(t, mtx, mode, text); - break; - */ - case V3D_MANIP_LOCAL: - sprintf(text, ftext, "local"); - setLocalConstraint(t, mode, text); - break; - case V3D_MANIP_NORMAL: - sprintf(text, ftext, "normal"); - setConstraint(t, t->spacemtx, mode, text); - break; - case V3D_MANIP_VIEW: - sprintf(text, ftext, "view"); - setConstraint(t, t->spacemtx, mode, text); - break; - } - - t->con.mode |= CON_USER; -} - -/*--------------------- EXTERNAL SETUP CALLS ------------------*/ - -void BIF_setLocalLockConstraint(char axis, char *text) { - TransInfo *t = BIF_GetTransInfo(); - - switch (axis) { - case 'x': - setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text); - break; - case 'y': - setLocalConstraint(t, (CON_AXIS0|CON_AXIS2), text); - break; - case 'z': - setLocalConstraint(t, (CON_AXIS0|CON_AXIS1), text); - break; - } -} - -void BIF_setLocalAxisConstraint(char axis, char *text) { - TransInfo *t = BIF_GetTransInfo(); - - switch (axis) { - case 'X': - setLocalConstraint(t, CON_AXIS0, text); - break; - case 'Y': - setLocalConstraint(t, CON_AXIS1, text); - break; - case 'Z': - setLocalConstraint(t, CON_AXIS2, text); - break; - } -} - -/* text is optional, for header print */ -void BIF_setSingleAxisConstraint(float vec[3], char *text) { - TransInfo *t = BIF_GetTransInfo(); - float space[3][3], v[3]; - - VECCOPY(space[0], vec); - - v[0] = vec[2]; - v[1] = vec[0]; - v[2] = vec[1]; - - Crossf(space[1], vec, v); - Crossf(space[2], vec, space[1]); - Mat3Ortho(space); - - Mat3CpyMat3(t->con.mtx, space); - t->con.mode = CON_AXIS0; - - getConstraintMatrix(t); - - startConstraint(t); - - /* start copying with an offset of 1, to reserve a spot for the SPACE char */ - if(text) - { - strncpy(t->con.text+1, text, 48); /* 50 in struct */ - } - else - { - t->con.text[1] = '\0'; /* No text */ - } - - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; - t->redraw = 1; -} - -void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) { - TransInfo *t = BIF_GetTransInfo(); - float space[3][3]; - - VECCOPY(space[0], vec1); - VECCOPY(space[1], vec2); - Crossf(space[2], space[0], space[1]); - Mat3Ortho(space); - - Mat3CpyMat3(t->con.mtx, space); - t->con.mode = CON_AXIS0|CON_AXIS1; - - getConstraintMatrix(t); - - startConstraint(t); - - /* start copying with an offset of 1, to reserve a spot for the SPACE char */ - if(text) - { - strncpy(t->con.text+1, text, 48); /* 50 in struct */ - } - else - { - t->con.text[1] = '\0'; /* No text */ - } - - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; - t->redraw = 1; -} - -/*----------------- DRAWING CONSTRAINTS -------------------*/ - -void BIF_drawConstraint(void) -{ - TransInfo *t = BIF_GetTransInfo(); - TransCon *tc = &(t->con); - - if (t->spacetype!=SPACE_VIEW3D) - return; - if (!(tc->mode & CON_APPLY)) - return; - if (t->flag & T_USES_MANIPULATOR) - return; - - /* nasty exception for Z constraint in camera view */ - if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp>1) - return; - - if (tc->drawExtra) { - tc->drawExtra(t); - } - else { - if (tc->mode & CON_SELECT) { - float vec[3]; - short mval[2]; - char col2[3] = {255,255,255}; - getmouseco_areawin(mval); - convertViewVec(t, vec, (short)(mval[0] - t->con.imval[0]), (short)(mval[1] - t->con.imval[1])); - VecAddf(vec, vec, tc->center); - - drawLine(tc->center, tc->mtx[0], 'x', 0); - drawLine(tc->center, tc->mtx[1], 'y', 0); - drawLine(tc->center, tc->mtx[2], 'z', 0); - - glColor3ubv((GLubyte *)col2); - - glDisable(GL_DEPTH_TEST); - setlinestyle(1); - glBegin(GL_LINE_STRIP); - glVertex3fv(tc->center); - glVertex3fv(vec); - glEnd(); - setlinestyle(0); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - } - - if (tc->mode & CON_AXIS0) { - drawLine(tc->center, tc->mtx[0], 'x', DRAWLIGHT); - } - if (tc->mode & CON_AXIS1) { - drawLine(tc->center, tc->mtx[1], 'y', DRAWLIGHT); - } - if (tc->mode & CON_AXIS2) { - drawLine(tc->center, tc->mtx[2], 'z', DRAWLIGHT); - } - } -} - -/* called from drawview.c, as an extra per-window draw option */ -void BIF_drawPropCircle() -{ - TransInfo *t = BIF_GetTransInfo(); - - if (t->flag & T_PROP_EDIT) { - float tmat[4][4], imat[4][4]; - - BIF_ThemeColor(TH_GRID); - - /* if editmode we need to go into object space */ - if(G.obedit) mymultmatrix(G.obedit->obmat); - - mygetmatrix(tmat); - Mat4Invert(imat, tmat); - - set_inverted_drawing(1); - drawcircball(GL_LINE_LOOP, t->center, t->propsize, imat); - set_inverted_drawing(0); - - /* if editmode we restore */ - if(G.obedit) myloadmatrix(G.vd->viewmat); - } -} - -void BIF_getPropCenter(float *center) -{ - TransInfo *t = BIF_GetTransInfo(); - - if (t && t->flag & T_PROP_EDIT) { - VECCOPY(center, t->center); - } - else - center[0] = center[1] = center[2] = 0.0f; -} -static void drawObjectConstraint(TransInfo *t) { - int i; - TransData * td = t->data; - - /* Draw the first one lighter because that's the one who controls the others. - Meaning the transformation is projected on that one and just copied on the others - constraint space. - In a nutshell, the object with light axis is controlled by the user and the others follow. - Without drawing the first light, users have little clue what they are doing. - */ - if (t->con.mode & CON_AXIS0) { - drawLine(td->ob->obmat[3], td->axismtx[0], 'x', DRAWLIGHT); - } - if (t->con.mode & CON_AXIS1) { - drawLine(td->ob->obmat[3], td->axismtx[1], 'y', DRAWLIGHT); - } - if (t->con.mode & CON_AXIS2) { - drawLine(td->ob->obmat[3], td->axismtx[2], 'z', DRAWLIGHT); - } - - td++; - - for(i=1;itotal;i++,td++) { - if (t->con.mode & CON_AXIS0) { - drawLine(td->ob->obmat[3], td->axismtx[0], 'x', 0); - } - if (t->con.mode & CON_AXIS1) { - drawLine(td->ob->obmat[3], td->axismtx[1], 'y', 0); - } - if (t->con.mode & CON_AXIS2) { - drawLine(td->ob->obmat[3], td->axismtx[2], 'z', 0); - } - } -} - -/*--------------------- START / STOP CONSTRAINTS ---------------------- */ - -void startConstraint(TransInfo *t) { - t->con.mode |= CON_APPLY; - *t->con.text = ' '; - t->num.idx_max = MIN2(getConstraintSpaceDimension(t) - 1, t->idx_max); -} - -void stopConstraint(TransInfo *t) { - t->con.mode &= ~(CON_APPLY|CON_SELECT); - *t->con.text = '\0'; - t->num.idx_max = t->idx_max; -} - -void getConstraintMatrix(TransInfo *t) -{ - float mat[3][3]; - Mat3Inv(t->con.imtx, t->con.mtx); - Mat3One(t->con.pmtx); - - if (!(t->con.mode & CON_AXIS0)) { - t->con.pmtx[0][0] = - t->con.pmtx[0][1] = - t->con.pmtx[0][2] = 0.0f; - } - - if (!(t->con.mode & CON_AXIS1)) { - t->con.pmtx[1][0] = - t->con.pmtx[1][1] = - t->con.pmtx[1][2] = 0.0f; - } - - if (!(t->con.mode & CON_AXIS2)) { - t->con.pmtx[2][0] = - t->con.pmtx[2][1] = - t->con.pmtx[2][2] = 0.0f; - } - - Mat3MulMat3(mat, t->con.pmtx, t->con.imtx); - Mat3MulMat3(t->con.pmtx, t->con.mtx, mat); -} - -/*------------------------- MMB Select -------------------------------*/ - -void initSelectConstraint(TransInfo *t, float mtx[3][3]) -{ - Mat3CpyMat3(t->con.mtx, mtx); - t->con.mode |= CON_APPLY; - t->con.mode |= CON_SELECT; - t->con.mode &= ~CON_LOCAL; - - setNearestAxis(t); - t->con.drawExtra = NULL; - t->con.applyVec = applyAxisConstraintVec; - t->con.applySize = applyAxisConstraintSize; - t->con.applyRot = applyAxisConstraintRot; -} - -void selectConstraint(TransInfo *t) { - if (t->con.mode & CON_SELECT) { - setNearestAxis(t); - startConstraint(t); - } -} - -void postSelectConstraint(TransInfo *t) -{ - if (!(t->con.mode & CON_SELECT)) - return; - - t->con.mode &= ~CON_AXIS0; - t->con.mode &= ~CON_AXIS1; - t->con.mode &= ~CON_AXIS2; - t->con.mode &= ~CON_SELECT; - - setNearestAxis(t); - - startConstraint(t); - t->redraw = 1; -} - -static void setNearestAxis2d(TransInfo *t) -{ - short mval[2]; - short ival[2]; - - getmouseco_areawin(mval); - ival[0]= t->imval[0]; - ival[1]= t->imval[1]; - - /* no correction needed... just use whichever one is lower */ - if ( abs(mval[0]-ival[0]) < abs(mval[1]-ival[1]) ) { - t->con.mode |= CON_AXIS1; - sprintf(t->con.text, " along Y axis"); - } - else { - t->con.mode |= CON_AXIS0; - sprintf(t->con.text, " along X axis"); - } -} - -static void setNearestAxis3d(TransInfo *t) -{ - float zfac; - float mvec[3], axis[3], proj[3]; - float len[3]; - int i, icoord[2]; - short coord[2]; - - /* calculate mouse movement */ - getmouseco_areawin(coord); - mvec[0] = (float)(coord[0] - t->con.imval[0]); - mvec[1] = (float)(coord[1] - t->con.imval[1]); - mvec[2] = 0.0f; - - /* we need to correct axis length for the current zoomlevel of view, - this to prevent projected values to be clipped behind the camera - and to overflow the short integers. - The formula used is a bit stupid, just a simplification of the substraction - of two 2D points 30 pixels apart (that's the last factor in the formula) after - projecting them with window_to_3d and then get the length of that vector. - */ - zfac= t->persmat[0][3]*t->center[0]+ t->persmat[1][3]*t->center[1]+ t->persmat[2][3]*t->center[2]+ t->persmat[3][3]; - zfac = VecLength(t->persinv[0]) * 2.0f/curarea->winx * zfac * 30.0f; - - for (i = 0; i<3; i++) { - VECCOPY(axis, t->con.mtx[i]); - - VecMulf(axis, zfac); - /* now we can project to get window coordinate */ - VecAddf(axis, axis, t->con.center); - projectIntView(t, axis, icoord); - - axis[0] = (float)(icoord[0] - t->center2d[0]); - axis[1] = (float)(icoord[1] - t->center2d[1]); - axis[2] = 0.0f; - - if (Normalize(axis) != 0.0f) { - Projf(proj, mvec, axis); - VecSubf(axis, mvec, proj); - len[i] = Normalize(axis); - } - else { - len[i] = 10000000000.0f; - } - } - - if (len[0] <= len[1] && len[0] <= len[2]) { - if (G.qual & LR_SHIFTKEY) { - t->con.mode |= (CON_AXIS1|CON_AXIS2); - sprintf(t->con.text, " locking %s X axis", t->spacename); - } - else { - t->con.mode |= CON_AXIS0; - sprintf(t->con.text, " along %s X axis", t->spacename); - } - } - else if (len[1] <= len[0] && len[1] <= len[2]) { - if (G.qual & LR_SHIFTKEY) { - t->con.mode |= (CON_AXIS0|CON_AXIS2); - sprintf(t->con.text, " locking %s Y axis", t->spacename); - } - else { - t->con.mode |= CON_AXIS1; - sprintf(t->con.text, " along %s Y axis", t->spacename); - } - } - else if (len[2] <= len[1] && len[2] <= len[0]) { - if (G.qual & LR_SHIFTKEY) { - t->con.mode |= (CON_AXIS0|CON_AXIS1); - sprintf(t->con.text, " locking %s Z axis", t->spacename); - } - else { - t->con.mode |= CON_AXIS2; - sprintf(t->con.text, " along %s Z axis", t->spacename); - } - } -} - -void setNearestAxis(TransInfo *t) -{ - /* clear any prior constraint flags */ - t->con.mode &= ~CON_AXIS0; - t->con.mode &= ~CON_AXIS1; - t->con.mode &= ~CON_AXIS2; - - /* constraint setting - depends on spacetype */ - if (t->spacetype == SPACE_VIEW3D) { - /* 3d-view */ - setNearestAxis3d(t); - } - else { - /* assume that this means a 2D-Editor */ - setNearestAxis2d(t); - } - - getConstraintMatrix(t); -} - -/*-------------- HELPER FUNCTIONS ----------------*/ - -char constraintModeToChar(TransInfo *t) { - if ((t->con.mode & CON_APPLY)==0) { - return '\0'; - } - switch (t->con.mode & (CON_AXIS0|CON_AXIS1|CON_AXIS2)) { - case (CON_AXIS0): - case (CON_AXIS1|CON_AXIS2): - return 'X'; - case (CON_AXIS1): - case (CON_AXIS0|CON_AXIS2): - return 'Y'; - case (CON_AXIS2): - case (CON_AXIS0|CON_AXIS1): - return 'Z'; - default: - return '\0'; - } -} - - -int isLockConstraint(TransInfo *t) { - int mode = t->con.mode; - - if ( (mode & (CON_AXIS0|CON_AXIS1)) == (CON_AXIS0|CON_AXIS1)) - return 1; - - if ( (mode & (CON_AXIS1|CON_AXIS2)) == (CON_AXIS1|CON_AXIS2)) - return 1; - - if ( (mode & (CON_AXIS0|CON_AXIS2)) == (CON_AXIS0|CON_AXIS2)) - return 1; - - return 0; -} - -/* - * Returns the dimension of the constraint space. - * - * For that reason, the flags always needs to be set to properly evaluate here, - * even if they aren't actually used in the callback function. (Which could happen - * for weird constraints not yet designed. Along a path for example.) - */ - -int getConstraintSpaceDimension(TransInfo *t) -{ - int n = 0; - - if (t->con.mode & CON_AXIS0) - n++; - - if (t->con.mode & CON_AXIS1) - n++; - - if (t->con.mode & CON_AXIS2) - n++; - - return n; -/* - Someone willing to do it criptically could do the following instead: - - return t->con & (CON_AXIS0|CON_AXIS1|CON_AXIS2); - - Based on the assumptions that the axis flags are one after the other and start at 1 -*/ -} diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c deleted file mode 100644 index ac13634532b..00000000000 --- a/source/blender/src/transform_conversions.c +++ /dev/null @@ -1,3616 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_curve_types.h" -#include "DNA_effect_types.h" -#include "DNA_image_types.h" -#include "DNA_ipo_types.h" -#include "DNA_key_types.h" -#include "DNA_lamp_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_meta_types.h" -#include "DNA_modifier_types.h" -#include "DNA_nla_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" -#include "DNA_view3d_types.h" -#include "DNA_world_types.h" -#include "DNA_userdef_types.h" -#include "DNA_property_types.h" -#include "DNA_vfont_types.h" -#include "DNA_constraint_types.h" -#include "DNA_listBase.h" - -#include "BKE_action.h" -#include "BKE_armature.h" -#include "BKE_blender.h" -#include "BKE_curve.h" -#include "BKE_constraint.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_DerivedMesh.h" -#include "BKE_effect.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_key.h" -#include "BKE_main.h" -#include "BKE_mball.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_softbody.h" -#include "BKE_utildefines.h" - -#include "BIF_editaction.h" -#include "BIF_editview.h" -#include "BIF_editlattice.h" -#include "BIF_editconstraint.h" -#include "BIF_editarmature.h" -#include "BIF_editmesh.h" -#include "BIF_editnla.h" -#include "BIF_editsima.h" -#include "BIF_editparticle.h" -#include "BIF_gl.h" -#include "BIF_poseobject.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" - -#include "BSE_view.h" -#include "BSE_drawipo.h" -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_editipo_types.h" -#include "BSE_editaction_types.h" - -#include "BDR_editobject.h" // reset_slowparents() -#include "BDR_unwrapper.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" - -#include "editmesh.h" - -#include "blendef.h" - -#include "mydevice.h" - -extern ListBase editNurb; -extern ListBase editelems; - -#include "transform.h" - -/* local function prototype - for Object/Bone Constraints */ -static short constraints_list_needinv(TransInfo *t, ListBase *list); - -/* ************************** Functions *************************** */ - -static void qsort_trans_data(TransInfo *t, TransData *head, TransData *tail) { - TransData pivot = *head; - TransData *ihead = head; - TransData *itail = tail; - short connected = t->flag & T_PROP_CONNECTED; - - while (head < tail) - { - if (connected) { - while ((tail->dist >= pivot.dist) && (head < tail)) - tail--; - } - else { - while ((tail->rdist >= pivot.rdist) && (head < tail)) - tail--; - } - - if (head != tail) - { - *head = *tail; - head++; - } - - if (connected) { - while ((head->dist <= pivot.dist) && (head < tail)) - head++; - } - else { - while ((head->rdist <= pivot.rdist) && (head < tail)) - head++; - } - - if (head != tail) - { - *tail = *head; - tail--; - } - } - - *head = pivot; - if (ihead < head) { - qsort_trans_data(t, ihead, head-1); - } - if (itail > head) { - qsort_trans_data(t, head+1, itail); - } -} - -void sort_trans_data_dist(TransInfo *t) { - TransData *start = t->data; - int i = 1; - - while(i < t->total && start->flag & TD_SELECTED) { - start++; - i++; - } - qsort_trans_data(t, start, t->data + t->total - 1); -} - -static void sort_trans_data(TransInfo *t) -{ - TransData *sel, *unsel; - TransData temp; - unsel = t->data; - sel = t->data; - sel += t->total - 1; - while (sel > unsel) { - while (unsel->flag & TD_SELECTED) { - unsel++; - if (unsel == sel) { - return; - } - } - while (!(sel->flag & TD_SELECTED)) { - sel--; - if (unsel == sel) { - return; - } - } - temp = *unsel; - *unsel = *sel; - *sel = temp; - sel--; - unsel++; - } -} - -/* distance calculated from not-selected vertex to nearest selected vertex - warning; this is loops inside loop, has minor N^2 issues, but by sorting list it is OK */ -static void set_prop_dist(TransInfo *t, short with_dist) -{ - TransData *tob; - int a; - - for(a=0, tob= t->data; atotal; a++, tob++) { - - tob->rdist= 0.0f; // init, it was mallocced - - if((tob->flag & TD_SELECTED)==0) { - TransData *td; - int i; - float dist, vec[3]; - - tob->rdist = -1.0f; // signal for next loop - - for (i = 0, td= t->data; i < t->total; i++, td++) { - if(td->flag & TD_SELECTED) { - VecSubf(vec, tob->center, td->center); - Mat3MulVecfl(tob->mtx, vec); - dist = Normalize(vec); - if (tob->rdist == -1.0f) { - tob->rdist = dist; - } - else if (dist < tob->rdist) { - tob->rdist = dist; - } - } - else break; // by definition transdata has selected items in beginning - } - if (with_dist) { - tob->dist = tob->rdist; - } - } - } -} - -/* ************************** CONVERSIONS ************************* */ - -/* ********************* texture space ********* */ - -static void createTransTexspace(TransInfo *t) -{ - TransData *td; - Object *ob; - ID *id; - - ob= OBACT; - - if (ob==NULL) { // Shouldn't logically happen, but still... - t->total = 0; - return; - } - - id= ob->data; - if(id==NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) { - t->total = 0; - return; - } - - t->total = 1; - td= t->data= MEM_callocN(sizeof(TransData), "TransTexspace"); - td->ext= t->ext= MEM_callocN(sizeof(TransDataExtension), "TransTexspace"); - - td->flag= TD_SELECTED; - VECCOPY(td->center, ob->obmat[3]); - td->ob = ob; - - Mat3CpyMat4(td->mtx, ob->obmat); - Mat3CpyMat4(td->axismtx, ob->obmat); - Mat3Ortho(td->axismtx); - Mat3Inv(td->smtx, td->mtx); - - if( GS(id->name)==ID_ME) { - Mesh *me= ob->data; - me->texflag &= ~AUTOSPACE; - td->loc= me->loc; - td->ext->rot= me->rot; - td->ext->size= me->size; - } - else if( GS(id->name)==ID_CU) { - Curve *cu= ob->data; - cu->texflag &= ~CU_AUTOSPACE; - td->loc= cu->loc; - td->ext->rot= cu->rot; - td->ext->size= cu->size; - } - else if( GS(id->name)==ID_MB) { - MetaBall *mb= ob->data; - mb->texflag &= ~MB_AUTOSPACE; - td->loc= mb->loc; - td->ext->rot= mb->rot; - td->ext->size= mb->size; - } - - VECCOPY(td->iloc, td->loc); - VECCOPY(td->ext->irot, td->ext->rot); - VECCOPY(td->ext->isize, td->ext->size); -} - -/* ********************* edge (for crease) ***** */ - -static void createTransEdge(TransInfo *t) { - TransData *td = NULL; - EditMesh *em = G.editMesh; - EditEdge *eed; - float mtx[3][3], smtx[3][3]; - int count=0, countsel=0; - int propmode = t->flag & T_PROP_EDIT; - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - if (eed->f & SELECT) countsel++; - if (propmode) count++; - } - } - - if (countsel == 0) - return; - - if(propmode) { - t->total = count; - } - else { - t->total = countsel; - } - - td= t->data= MEM_callocN(t->total * sizeof(TransData), "TransCrease"); - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0 && (eed->f & SELECT || propmode)) { - /* need to set center for center calculations */ - VecAddf(td->center, eed->v1->co, eed->v2->co); - VecMulf(td->center, 0.5f); - - td->loc= NULL; - if (eed->f & SELECT) - td->flag= TD_SELECTED; - else - td->flag= 0; - - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->ext = NULL; - td->tdi = NULL; - td->val = &(eed->crease); - td->ival = eed->crease; - - td++; - } - } -} - -/* ********************* pose mode ************* */ - -static bKinematicConstraint *has_targetless_ik(bPoseChannel *pchan) -{ - bConstraint *con= pchan->constraints.first; - - for(;con; con= con->next) { - if(con->type==CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data= con->data; - - if(data->tar==NULL) - return data; - if(data->tar->type==OB_ARMATURE && data->subtarget[0]==0) - return data; - } - } - return NULL; -} - -static short apply_targetless_ik(Object *ob) -{ - bPoseChannel *pchan, *parchan, *chanlist[256]; - bKinematicConstraint *data; - int segcount, apply= 0; - - /* now we got a difficult situation... we have to find the - target-less IK pchans, and apply transformation to the all - pchans that were in the chain */ - - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - data= has_targetless_ik(pchan); - if(data && (data->flag & CONSTRAINT_IK_AUTO)) { - - /* fill the array with the bones of the chain (armature.c does same, keep it synced) */ - segcount= 0; - - /* exclude tip from chain? */ - if(!(data->flag & CONSTRAINT_IK_TIP)) - parchan= pchan->parent; - else - parchan= pchan; - - /* Find the chain's root & count the segments needed */ - for (; parchan; parchan=parchan->parent){ - chanlist[segcount]= parchan; - segcount++; - - if(segcount==data->rootbone || segcount>255) break; // 255 is weak - } - for(;segcount;segcount--) { - Bone *bone; - float rmat[4][4], tmat[4][4], imat[4][4]; - - /* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */ - /* we put in channel the entire result of rmat= (channel * constraint * IK) */ - /* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */ - /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */ - - parchan= chanlist[segcount-1]; - bone= parchan->bone; - bone->flag |= BONE_TRANSFORM; /* ensures it gets an auto key inserted */ - - if(parchan->parent) { - Bone *parbone= parchan->parent->bone; - float offs_bone[4][4]; - - /* offs_bone = yoffs(b-1) + root(b) + bonemat(b) */ - Mat4CpyMat3(offs_bone, bone->bone_mat); - - /* The bone's root offset (is in the parent's coordinate system) */ - VECCOPY(offs_bone[3], bone->head); - - /* Get the length translation of parent (length along y axis) */ - offs_bone[3][1]+= parbone->length; - - /* pose_mat(b-1) * offs_bone */ - if(parchan->bone->flag & BONE_HINGE) { - /* the rotation of the parent restposition */ - Mat4CpyMat4(rmat, parbone->arm_mat); /* rmat used as temp */ - - /* the location of actual parent transform */ - VECCOPY(rmat[3], offs_bone[3]); - offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f; - Mat4MulVecfl(parchan->parent->pose_mat, rmat[3]); - - Mat4MulMat4(tmat, offs_bone, rmat); - } - else - Mat4MulMat4(tmat, offs_bone, parchan->parent->pose_mat); - - Mat4Invert(imat, tmat); - } - else { - Mat4CpyMat3(tmat, bone->bone_mat); - - VECCOPY(tmat[3], bone->head); - Mat4Invert(imat, tmat); - } - /* result matrix */ - Mat4MulMat4(rmat, parchan->pose_mat, imat); - - /* apply and decompose, doesn't work for constraints or non-uniform scale well */ - { - float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3]; - - Mat3CpyMat4(rmat3, rmat); - - /* quaternion */ - Mat3ToQuat(rmat3, parchan->quat); - - /* for size, remove rotation */ - QuatToMat3(parchan->quat, qmat); - Mat3Inv(imat, qmat); - Mat3MulMat3(smat, rmat3, imat); - Mat3ToSize(smat, parchan->size); - - VECCOPY(parchan->loc, rmat[3]); - } - - } - - apply= 1; - data->flag &= ~CONSTRAINT_IK_AUTO; - } - } - - return apply; -} - -static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, TransData *td) -{ - Bone *bone= pchan->bone; - float pmat[3][3], omat[3][3]; - float cmat[3][3], tmat[3][3]; - float vec[3]; - - VECCOPY(vec, pchan->pose_mat[3]); - VECCOPY(td->center, vec); - - td->ob = ob; - td->flag= TD_SELECTED|TD_USEQUAT; - if(bone->flag & BONE_HINGE_CHILD_TRANSFORM) - td->flag |= TD_NOCENTER; - td->protectflag= pchan->protectflag; - - td->loc = pchan->loc; - VECCOPY(td->iloc, pchan->loc); - - td->ext->rot= NULL; - td->ext->quat= pchan->quat; - td->ext->size= pchan->size; - - QUATCOPY(td->ext->iquat, pchan->quat); - VECCOPY(td->ext->isize, pchan->size); - - /* proper way to get parent transform + own transform + constraints transform */ - Mat3CpyMat4(omat, ob->obmat); - - if(pchan->parent) { - if(pchan->bone->flag & BONE_HINGE) - Mat3CpyMat4(pmat, pchan->parent->bone->arm_mat); - else - Mat3CpyMat4(pmat, pchan->parent->pose_mat); - - if (constraints_list_needinv(t, &pchan->constraints)) { - Mat3CpyMat4(tmat, pchan->constinv); - Mat3Inv(cmat, tmat); - Mat3MulSerie(td->mtx, pchan->bone->bone_mat, pmat, cmat, omat, 0,0,0,0); // dang mulserie swaps args - } - else - Mat3MulSerie(td->mtx, pchan->bone->bone_mat, pmat, omat, 0,0,0,0,0); // dang mulserie swaps args - } - else { - if (constraints_list_needinv(t, &pchan->constraints)) { - Mat3CpyMat4(tmat, pchan->constinv); - Mat3Inv(cmat, tmat); - Mat3MulSerie(td->mtx, pchan->bone->bone_mat, cmat, omat, 0, 0,0,0,0); // dang mulserie swaps args - } - else - Mat3MulMat3(td->mtx, omat, pchan->bone->bone_mat); // Mat3MulMat3 has swapped args! - } - - Mat3Inv(td->smtx, td->mtx); - - /* for axismat we use bone's own transform */ - Mat3CpyMat4(pmat, pchan->pose_mat); - Mat3MulMat3(td->axismtx, omat, pmat); - Mat3Ortho(td->axismtx); - - if(t->mode==TFM_BONESIZE) { - bArmature *arm= t->poseobj->data; - - if(arm->drawtype==ARM_ENVELOPE) { - td->loc= NULL; - td->val= &bone->dist; - td->ival= bone->dist; - } - else { - // abusive storage of scale in the loc pointer :) - td->loc= &bone->xwidth; - VECCOPY (td->iloc, td->loc); - td->val= NULL; - } - } - - /* in this case we can do target-less IK grabbing */ - if(t->mode==TFM_TRANSLATION) { - bKinematicConstraint *data= has_targetless_ik(pchan); - if(data) { - if(data->flag & CONSTRAINT_IK_TIP) { - VECCOPY(data->grabtarget, pchan->pose_tail); - } - else { - VECCOPY(data->grabtarget, pchan->pose_head); - } - td->loc = data->grabtarget; - VECCOPY(td->iloc, td->loc); - data->flag |= CONSTRAINT_IK_AUTO; - - /* only object matrix correction */ - Mat3CpyMat3 (td->mtx, omat); - Mat3Inv (td->smtx, td->mtx); - } - } - - /* store reference to first constraint */ - td->con= pchan->constraints.first; -} - -static void bone_children_clear_transflag(ListBase *lb) -{ - Bone *bone= lb->first; - - for(;bone;bone= bone->next) { - if((bone->flag & BONE_HINGE) && (bone->flag & BONE_CONNECTED)) - bone->flag |= BONE_HINGE_CHILD_TRANSFORM; - else - bone->flag &= ~BONE_TRANSFORM; - - bone_children_clear_transflag(&bone->childbase); - } -} - -/* sets transform flags in the bones, returns total */ -static void set_pose_transflags(TransInfo *t, Object *ob) -{ - bArmature *arm= ob->data; - bPoseChannel *pchan; - Bone *bone; - int hastranslation; - - t->total= 0; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone->layer & arm->layer) { - if(bone->flag & BONE_SELECTED) - bone->flag |= BONE_TRANSFORM; - else - bone->flag &= ~BONE_TRANSFORM; - - bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM; - } - } - - /* make sure no bone can be transformed when a parent is transformed */ - /* since pchans are depsgraph sorted, the parents are in beginning of list */ - if(t->mode!=TFM_BONESIZE) { - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone->flag & BONE_TRANSFORM) - bone_children_clear_transflag(&bone->childbase); - } - } - /* now count, and check if we have autoIK or have to switch from translate to rotate */ - hastranslation= 0; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - bone= pchan->bone; - if(bone->flag & BONE_TRANSFORM) { - - t->total++; - - if(t->mode==TFM_TRANSLATION) { - if( has_targetless_ik(pchan)==NULL ) { - if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) { - if(pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM) - hastranslation= 1; - } - else if((pchan->protectflag & OB_LOCK_LOC)!=OB_LOCK_LOC) - hastranslation= 1; - } - else - hastranslation= 1; - } - } - } - - /* if there are no translatable bones, do rotation */ - if(t->mode==TFM_TRANSLATION && !hastranslation) - t->mode= TFM_ROTATION; -} - - -/* -------- Auto-IK ---------- */ - -/* adjust pose-channel's auto-ik chainlen */ -static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen) -{ - bConstraint *con; - - /* don't bother to search if no valid constraints */ - if ((pchan->constflag & (PCHAN_HAS_IK|PCHAN_HAS_TARGET))==0) - return; - - /* check if pchan has ik-constraint */ - for (con= pchan->constraints.first; con; con= con->next) { - if (con->type == CONSTRAINT_TYPE_KINEMATIC) { - bKinematicConstraint *data= con->data; - - /* only accept if a temporary one (for auto-ik) */ - if (data->flag & CONSTRAINT_IK_TEMP) { - /* chainlen is new chainlen, but is limited by maximum chainlen */ - if ((chainlen==0) || (chainlen > data->max_rootbone)) - data->rootbone= data->max_rootbone; - else - data->rootbone= chainlen; - } - } - } -} - -/* change the chain-length of auto-ik */ -void transform_autoik_update (TransInfo *t, short mode) -{ - short *chainlen= &G.scene->toolsettings->autoik_chainlen; - bPoseChannel *pchan; - - /* mode determines what change to apply to chainlen */ - if (mode == 1) { - /* mode=1 is from WHEELMOUSEDOWN... increases len */ - (*chainlen)++; - } - else if (mode == -1) { - /* mode==-1 is from WHEELMOUSEUP... decreases len */ - if (*chainlen > 0) (*chainlen)--; - } - - /* sanity checks (don't assume t->poseobj is set, or that it is an armature) */ - if (ELEM(NULL, t->poseobj, t->poseobj->pose)) - return; - - /* apply to all pose-channels */ - for (pchan=t->poseobj->pose->chanbase.first; pchan; pchan=pchan->next) { - pchan_autoik_adjust(pchan, *chainlen); - } -} - -/* frees temporal IKs */ -static void pose_grab_with_ik_clear(Object *ob) -{ - bKinematicConstraint *data; - bPoseChannel *pchan; - bConstraint *con; - - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - /* clear all temporary lock flags */ - pchan->ikflag &= ~(BONE_IK_NO_XDOF_TEMP|BONE_IK_NO_YDOF_TEMP|BONE_IK_NO_ZDOF_TEMP); - - /* remove all temporary IK-constraints added */ - for (con= pchan->constraints.first; con; con= con->next) { - if (con->type==CONSTRAINT_TYPE_KINEMATIC) { - data= con->data; - if (data->flag & CONSTRAINT_IK_TEMP) { - BLI_remlink(&pchan->constraints, con); - MEM_freeN(con->data); - MEM_freeN(con); - pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET); - break; - } - } - } - } -} - -/* adds the IK to pchan - returns if added */ -static short pose_grab_with_ik_add(bPoseChannel *pchan) -{ - bKinematicConstraint *data; - bConstraint *con; - - /* Sanity check */ - if (pchan == NULL) - return 0; - - /* rule: not if there's already an IK on this channel */ - for (con= pchan->constraints.first; con; con= con->next) - if (con->type==CONSTRAINT_TYPE_KINEMATIC) - break; - - if (con) { - /* but, if this is a targetless IK, we make it auto anyway (for the children loop) */ - data= has_targetless_ik(pchan); - if (data) - data->flag |= CONSTRAINT_IK_AUTO; - return 0; - } - - con = add_new_constraint(CONSTRAINT_TYPE_KINEMATIC); - BLI_addtail(&pchan->constraints, con); - pchan->constflag |= (PCHAN_HAS_IK|PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */ - data= con->data; - data->flag= CONSTRAINT_IK_TIP|CONSTRAINT_IK_TEMP|CONSTRAINT_IK_AUTO; - VECCOPY(data->grabtarget, pchan->pose_tail); - data->rootbone= 1; - - /* we include only a connected chain */ - while ((pchan) && (pchan->bone->flag & BONE_CONNECTED)) { - /* here, we set ik-settings for bone from pchan->protectflag */ - if (pchan->protectflag & OB_LOCK_ROTX) pchan->ikflag |= BONE_IK_NO_XDOF_TEMP; - if (pchan->protectflag & OB_LOCK_ROTY) pchan->ikflag |= BONE_IK_NO_YDOF_TEMP; - if (pchan->protectflag & OB_LOCK_ROTZ) pchan->ikflag |= BONE_IK_NO_ZDOF_TEMP; - - /* now we count this pchan as being included */ - data->rootbone++; - pchan= pchan->parent; - } - - /* make a copy of maximum chain-length */ - data->max_rootbone= data->rootbone; - - return 1; -} - -/* bone is a canditate to get IK, but we don't do it if it has children connected */ -static short pose_grab_with_ik_children(bPose *pose, Bone *bone) -{ - Bone *bonec; - short wentdeeper=0, added=0; - - /* go deeper if children & children are connected */ - for (bonec= bone->childbase.first; bonec; bonec= bonec->next) { - if (bonec->flag & BONE_CONNECTED) { - wentdeeper= 1; - added+= pose_grab_with_ik_children(pose, bonec); - } - } - if (wentdeeper==0) { - bPoseChannel *pchan= get_pose_channel(pose, bone->name); - if (pchan) - added+= pose_grab_with_ik_add(pchan); - } - - return added; -} - -/* main call which adds temporal IK chains */ -static short pose_grab_with_ik(Object *ob) -{ - bArmature *arm; - bPoseChannel *pchan, *pchansel= NULL; - Bone *bonec; - - if (ob==NULL || ob->pose==NULL || (ob->flag & OB_POSEMODE)==0) - return 0; - - arm = ob->data; - - /* rule: only one Bone */ - for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if (pchan->bone->layer & arm->layer) { - if (pchan->bone->flag & BONE_SELECTED) { - if (pchansel) - break; - pchansel= pchan; - } - } - } - if (pchan || pchansel==NULL) return 0; - - /* rule: no IK for solitary (unconnected) bone */ - for (bonec=pchansel->bone->childbase.first; bonec; bonec=bonec->next) { - if (bonec->flag & BONE_CONNECTED) { - break; - } - } - if ((pchansel->bone->flag & BONE_CONNECTED)==0 && (bonec == NULL)) return 0; - - /* rule: if selected Bone is not a root bone, it gets a temporal IK */ - if (pchansel->parent) { - /* only adds if there's no IK yet */ - return pose_grab_with_ik_add(pchansel); - } - else { - /* rule: go over the children and add IK to the tips */ - return pose_grab_with_ik_children(ob->pose, pchansel->bone); - } -} - - -/* only called with pose mode active object now */ -static void createTransPose(TransInfo *t, Object *ob) -{ - bArmature *arm; - bPoseChannel *pchan; - TransData *td; - TransDataExtension *tdx; - short ik_on= 0; - int i; - - t->total= 0; - - /* check validity of state */ - arm=get_armature (ob); - if (arm==NULL || ob->pose==NULL) return; - - if (arm->flag & ARM_RESTPOS) { - if(t->mode!=TFM_BONESIZE) { - notice ("Pose edit not possible while Rest Position is enabled"); - return; - } - } - if (!(ob->lay & G.vd->lay)) return; - - /* do we need to add temporal IK chains? */ - if ((arm->flag & ARM_AUTO_IK) && t->mode==TFM_TRANSLATION) { - ik_on= pose_grab_with_ik(ob); - if (ik_on) t->flag |= T_AUTOIK; - } - - /* set flags and count total (warning, can change transform to rotate) */ - set_pose_transflags(t, ob); - - if(t->total==0) return; - - t->flag |= T_POSE; - t->poseobj= ob; /* we also allow non-active objects to be transformed, in weightpaint */ - - /* make sure the lock is set OK, unlock can be accidentally saved? */ - ob->pose->flag |= POSE_LOCKED; - ob->pose->flag &= ~POSE_DO_UNLOCK; - - /* init trans data */ - td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransPoseBone"); - tdx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransPoseBoneExt"); - for(i=0; itotal; i++, td++, tdx++) { - td->ext= tdx; - td->tdi = NULL; - td->val = NULL; - } - - /* use pose channels to fill trans data */ - td= t->data; - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->flag & BONE_TRANSFORM) { - add_pose_transdata(t, pchan, ob, td); - td++; - } - } - - if(td != (t->data+t->total)) printf("Bone selection count error\n"); - - /* initialise initial auto=ik chainlen's? */ - if (ik_on) transform_autoik_update(t, 0); -} - -/* ********************* armature ************** */ - -static void createTransArmatureVerts(TransInfo *t) -{ - EditBone *ebo; - bArmature *arm= G.obedit->data; - TransData *td; - float mtx[3][3], smtx[3][3], delta[3], bonemat[3][3]; - - t->total = 0; - for (ebo=G.edbo.first;ebo;ebo=ebo->next) { - if(ebo->layer & arm->layer) { - if (t->mode==TFM_BONESIZE) { - if (ebo->flag & BONE_SELECTED) - t->total++; - } - else if (t->mode==TFM_BONE_ROLL) { - if (ebo->flag & BONE_SELECTED) - t->total++; - } - else { - if (ebo->flag & BONE_TIPSEL) - t->total++; - if (ebo->flag & BONE_ROOTSEL) - t->total++; - } - } - } - - if (!t->total) return; - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransEditBone"); - - for (ebo=G.edbo.first;ebo;ebo=ebo->next){ - ebo->oldlength= ebo->length; // length==0.0 on extrude, used for scaling radius of bone points - - if(ebo->layer & arm->layer) { - if (t->mode==TFM_BONE_ENVELOPE) { - - if (ebo->flag & BONE_ROOTSEL){ - td->val= &ebo->rad_head; - td->ival= *td->val; - - VECCOPY (td->center, ebo->head); - td->flag= TD_SELECTED; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->loc = NULL; - td->ext = NULL; - td->tdi = NULL; - - td++; - } - if (ebo->flag & BONE_TIPSEL){ - td->val= &ebo->rad_tail; - td->ival= *td->val; - VECCOPY (td->center, ebo->tail); - td->flag= TD_SELECTED; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->loc = NULL; - td->ext = NULL; - td->tdi = NULL; - - td++; - } - - } - else if (t->mode==TFM_BONESIZE) { - if (ebo->flag & BONE_SELECTED) { - if(arm->drawtype==ARM_ENVELOPE) { - td->loc= NULL; - td->val= &ebo->dist; - td->ival= ebo->dist; - } - else { - // abusive storage of scale in the loc pointer :) - td->loc= &ebo->xwidth; - VECCOPY (td->iloc, td->loc); - td->val= NULL; - } - VECCOPY (td->center, ebo->head); - td->flag= TD_SELECTED; - - /* use local bone matrix */ - VecSubf(delta, ebo->tail, ebo->head); - vec_roll_to_mat3(delta, ebo->roll, bonemat); - Mat3MulMat3(td->mtx, mtx, bonemat); - Mat3Inv(td->smtx, td->mtx); - - Mat3CpyMat3(td->axismtx, td->mtx); - Mat3Ortho(td->axismtx); - - td->ext = NULL; - td->tdi = NULL; - - td++; - } - } - else if (t->mode==TFM_BONE_ROLL) { - if (ebo->flag & BONE_SELECTED) { - td->loc= NULL; - td->val= &(ebo->roll); - td->ival= ebo->roll; - - VECCOPY (td->center, ebo->head); - td->flag= TD_SELECTED; - - td->ext = NULL; - td->tdi = NULL; - - td++; - } - } - else { - if (ebo->flag & BONE_TIPSEL){ - VECCOPY (td->iloc, ebo->tail); - VECCOPY (td->center, td->iloc); - td->loc= ebo->tail; - td->flag= TD_SELECTED; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - - td++; - } - if (ebo->flag & BONE_ROOTSEL){ - VECCOPY (td->iloc, ebo->head); - VECCOPY (td->center, td->iloc); - td->loc= ebo->head; - td->flag= TD_SELECTED; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - - td++; - } - } - } - } -} - -/* ********************* meta elements ********* */ - -static void createTransMBallVerts(TransInfo *t) -{ - MetaElem *ml; - TransData *td; - TransDataExtension *tx; - float mtx[3][3], smtx[3][3]; - int count=0, countsel=0; - int propmode = t->flag & T_PROP_EDIT; - - /* count totals */ - for(ml= editelems.first; ml; ml= ml->next) { - if(ml->flag & SELECT) countsel++; - if(propmode) count++; - } - - /* note: in prop mode we need at least 1 selected */ - if (countsel==0) return; - - if(propmode) t->total = count; - else t->total = countsel; - - td = t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(MBall EditMode)"); - tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "MetaElement_TransExtension"); - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - for(ml= editelems.first; ml; ml= ml->next) { - if(propmode || (ml->flag & SELECT)) { - td->loc= &ml->x; - VECCOPY(td->iloc, td->loc); - VECCOPY(td->center, td->loc); - - if(ml->flag & SELECT) td->flag= TD_SELECTED | TD_USEQUAT | TD_SINGLESIZE; - else td->flag= TD_USEQUAT; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->ext = tx; - td->tdi = NULL; - - /* Radius of MetaElem (mass of MetaElem influence) */ - if(ml->flag & MB_SCALE_RAD){ - td->val = &ml->rad; - td->ival = ml->rad; - } - else{ - td->val = &ml->s; - td->ival = ml->s; - } - - /* expx/expy/expz determine "shape" of some MetaElem types */ - tx->size = &ml->expx; - tx->isize[0] = ml->expx; - tx->isize[1] = ml->expy; - tx->isize[2] = ml->expz; - - /* quat is used for rotation of MetaElem */ - tx->quat = ml->quat; - QUATCOPY(tx->iquat, ml->quat); - - tx->rot = NULL; - - td++; - tx++; - } - } -} - -/* ********************* curve/surface ********* */ - -static void calc_distanceCurveVerts(TransData *head, TransData *tail) { - TransData *td, *td_near = NULL; - for (td = head; td<=tail; td++) { - if (td->flag & TD_SELECTED) { - td_near = td; - td->dist = 0.0f; - } - else if(td_near) { - float dist; - dist = VecLenf(td_near->center, td->center); - if (dist < (td-1)->dist) { - td->dist = (td-1)->dist; - } - else { - td->dist = dist; - } - } - else { - td->dist = MAXFLOAT; - td->flag |= TD_NOTCONNECTED; - } - } - td_near = NULL; - for (td = tail; td>=head; td--) { - if (td->flag & TD_SELECTED) { - td_near = td; - td->dist = 0.0f; - } - else if(td_near) { - float dist; - dist = VecLenf(td_near->center, td->center); - if (td->flag & TD_NOTCONNECTED || dist < td->dist || (td+1)->dist < td->dist) { - td->flag &= ~TD_NOTCONNECTED; - if (dist < (td+1)->dist) { - td->dist = (td+1)->dist; - } - else { - td->dist = dist; - } - } - } - } -} - -static void createTransCurveVerts(TransInfo *t) -{ - TransData *td = NULL; - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - float mtx[3][3], smtx[3][3]; - int a; - int count=0, countsel=0; - int propmode = t->flag & T_PROP_EDIT; - - /* count total of vertices, check identical as in 2nd loop for making transdata! */ - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - for(a=0, bezt= nu->bezt; apntsu; a++, bezt++) { - if(bezt->hide==0) { - if (G.f & G_HIDDENHANDLES) { - if(bezt->f2 & SELECT) countsel+=3; - if(propmode) count+= 3; - } else { - if(bezt->f1 & SELECT) countsel++; - if(bezt->f2 & SELECT) countsel++; - if(bezt->f3 & SELECT) countsel++; - if(propmode) count+= 3; - } - } - } - } - else { - for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) { - if(bp->hide==0) { - if(propmode) count++; - if(bp->f1 & SELECT) countsel++; - } - } - } - } - /* note: in prop mode we need at least 1 selected */ - if (countsel==0) return; - - if(propmode) t->total = count; - else t->total = countsel; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Curve EditMode)"); - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - td = t->data; - for(nu= editNurb.first; nu; nu= nu->next) { - if((nu->type & 7)==CU_BEZIER) { - TransData *head, *tail; - head = tail = td; - for(a=0, bezt= nu->bezt; apntsu; a++, bezt++) { - if(bezt->hide==0) { - - if( propmode || - ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) || - ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)==0) - ) { - VECCOPY(td->iloc, bezt->vec[0]); - td->loc= bezt->vec[0]; - VECCOPY(td->center, bezt->vec[1]); - if (G.f & G_HIDDENHANDLES) { - if(bezt->f2 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - } else { - if(bezt->f1 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - } - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td++; - count++; - tail++; - } - - /* This is the Curve Point, the other two are handles */ - if(propmode || (bezt->f2 & SELECT)) { - VECCOPY(td->iloc, bezt->vec[1]); - td->loc= bezt->vec[1]; - VECCOPY(td->center, td->loc); - if(bezt->f2 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - td->ext = NULL; - td->tdi = NULL; - - if (t->mode==TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */ - td->val = &(bezt->radius); - td->ival = bezt->radius; - } else if (t->mode==TFM_TILT) { - td->val = &(bezt->alfa); - td->ival = bezt->alfa; - } else { - td->val = NULL; - } - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td++; - count++; - tail++; - } - if( propmode || - ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)) || - ((bezt->f3 & SELECT) && (G.f & G_HIDDENHANDLES)==0) - ) { - VECCOPY(td->iloc, bezt->vec[2]); - td->loc= bezt->vec[2]; - VECCOPY(td->center, bezt->vec[1]); - if (G.f & G_HIDDENHANDLES) { - if(bezt->f2 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - } else { - if(bezt->f3 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - } - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td++; - count++; - tail++; - } - } - else if (propmode && head != tail) { - calc_distanceCurveVerts(head, tail-1); - head = tail; - } - } - if (propmode && head != tail) - calc_distanceCurveVerts(head, tail-1); - } - else { - TransData *head, *tail; - head = tail = td; - for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) { - if(bp->hide==0) { - if(propmode || (bp->f1 & SELECT)) { - VECCOPY(td->iloc, bp->vec); - td->loc= bp->vec; - VECCOPY(td->center, td->loc); - if(bp->f1 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - td->ext = NULL; - td->tdi = NULL; - - if (t->mode==TFM_CURVE_SHRINKFATTEN || t->mode==TFM_RESIZE) { - td->val = &(bp->radius); - td->ival = bp->radius; - } else { - td->val = &(bp->alfa); - td->ival = bp->alfa; - } - - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td++; - count++; - tail++; - } - } - else if (propmode && head != tail) { - calc_distanceCurveVerts(head, tail-1); - head = tail; - } - } - if (propmode && head != tail) - calc_distanceCurveVerts(head, tail-1); - } - } -} - -/* ********************* lattice *************** */ - -static void createTransLatticeVerts(TransInfo *t) -{ - TransData *td = NULL; - BPoint *bp; - float mtx[3][3], smtx[3][3]; - int a; - int count=0, countsel=0; - int propmode = t->flag & T_PROP_EDIT; - - bp= editLatt->def; - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - while(a--) { - if(bp->hide==0) { - if(bp->f1 & SELECT) countsel++; - if(propmode) count++; - } - bp++; - } - - /* note: in prop mode we need at least 1 selected */ - if (countsel==0) return; - - if(propmode) t->total = count; - else t->total = countsel; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Lattice EditMode)"); - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - td = t->data; - bp= editLatt->def; - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - while(a--) { - if(propmode || (bp->f1 & SELECT)) { - if(bp->hide==0) { - VECCOPY(td->iloc, bp->vec); - td->loc= bp->vec; - VECCOPY(td->center, td->loc); - if(bp->f1 & SELECT) td->flag= TD_SELECTED; - else td->flag= 0; - Mat3CpyMat3(td->smtx, smtx); - Mat3CpyMat3(td->mtx, mtx); - - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - - td++; - count++; - } - } - bp++; - } -} - -/* ******************* particle edit **************** */ -static void createTransParticleVerts(TransInfo *t) -{ - TransData *td = NULL; - TransDataExtension *tx; - Base *base = BASACT; - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleSystemModifierData *psmd = NULL; - ParticleEditSettings *pset = PE_settings(); - ParticleData *pa = NULL; - ParticleEdit *edit; - ParticleEditKey *key; - float mat[4][4]; - int i,k, totpart, transformparticle; - int count = 0, hasselected = 0; - int propmode = t->flag & T_PROP_EDIT; - - if(psys==NULL || G.scene->selectmode==SCE_SELECT_PATH) return; - - psmd = psys_get_modifier(ob,psys); - - edit = psys->edit; - totpart = psys->totpart; - base->flag |= BA_HAS_RECALC_DATA; - - for(i=0, pa=psys->particles; iflag &= ~PARS_TRANSFORM; - transformparticle= 0; - - if((pa->flag & PARS_HIDE)==0) { - for(k=0, key=edit->keys[i]; ktotkey; k++, key++) { - if((key->flag&PEK_HIDE)==0) { - if(key->flag&PEK_SELECT) { - hasselected= 1; - transformparticle= 1; - } - else if(propmode) - transformparticle= 1; - } - } - } - - if(transformparticle) { - count += pa->totkey; - pa->flag |= PARS_TRANSFORM; - } - } - - /* note: in prop mode we need at least 1 selected */ - if (hasselected==0) return; - - t->total = count; - td = t->data = MEM_callocN(t->total * sizeof(TransData), "TransObData(Particle Mode)"); - - if(t->mode == TFM_BAKE_TIME) - tx = t->ext = MEM_callocN(t->total * sizeof(TransDataExtension), "Particle_TransExtension"); - else - tx = t->ext = NULL; - - Mat4One(mat); - - Mat4Invert(ob->imat,ob->obmat); - - for(i=0, pa=psys->particles; iflag & PARS_TRANSFORM)) continue; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - - for(k=0, key=edit->keys[i]; ktotkey; k++, key++) { - VECCOPY(key->world_co, key->co); - Mat4MulVecfl(mat, key->world_co); - td->loc = key->world_co; - - VECCOPY(td->iloc, td->loc); - VECCOPY(td->center, td->loc); - - if(key->flag & PEK_SELECT) - td->flag |= TD_SELECTED; - else if(!propmode) - td->flag |= TD_SKIP; - - Mat3One(td->mtx); - Mat3One(td->smtx); - - /* don't allow moving roots */ - if(k==0 && pset->flag & PE_LOCK_FIRST) - td->protectflag |= OB_LOCK_LOC; - - td->ob = ob; - td->ext = tx; - td->tdi = NULL; - if(t->mode == TFM_BAKE_TIME) { - td->val = key->time; - td->ival = *(key->time); - /* abuse size and quat for min/max values */ - td->flag |= TD_NO_EXT; - if(k==0) tx->size = 0; - else tx->size = (key - 1)->time; - - if(k == pa->totkey - 1) tx->quat = 0; - else tx->quat = (key + 1)->time; - } - - td++; - if(tx) - tx++; - tail++; - } - if (propmode && head != tail) - calc_distanceCurveVerts(head, tail - 1); - } -} - -void flushTransParticles(TransInfo *t) -{ - Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(ob); - ParticleSystemModifierData *psmd; - ParticleData *pa; - ParticleEditKey *key; - TransData *td; - float mat[4][4], imat[4][4], co[3]; - int i, k, propmode = t->flag & T_PROP_EDIT; - - psmd = psys_get_modifier(ob, psys); - - /* we do transform in world space, so flush world space position - * back to particle local space */ - td= t->data; - for(i=0, pa=psys->particles; itotpart; i++, pa++, td++) { - if(!(pa->flag & PARS_TRANSFORM)) continue; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - Mat4Invert(imat,mat); - - for(k=0, key=psys->edit->keys[i]; ktotkey; k++, key++) { - VECCOPY(co, key->world_co); - Mat4MulVecfl(imat, co); - - /* optimization for proportional edit */ - if(!propmode || !FloatCompare(key->co, co, 0.0001f)) { - VECCOPY(key->co, co); - pa->flag |= PARS_EDIT_RECALC; - } - } - } - - PE_update_object(OBACT, 1); -} - -/* ********************* mesh ****************** */ - -/* proportional distance based on connectivity */ -#define E_VEC(a) (vectors + (3 * (a)->tmp.l)) -#define E_NEAR(a) (nears[((a)->tmp.l)]) -#define THRESHOLD 0.0001f -static void editmesh_set_connectivity_distance(int total, float *vectors, EditVert **nears) -{ - EditMesh *em = G.editMesh; - EditVert *eve; - EditEdge *eed; - int i= 0, done= 1; - - /* f2 flag is used for 'selection' */ - /* tmp.l is offset on scratch array */ - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0) { - eve->tmp.l = i++; - - if(eve->f & SELECT) { - eve->f2= 2; - E_NEAR(eve) = eve; - E_VEC(eve)[0] = 0.0f; - E_VEC(eve)[1] = 0.0f; - E_VEC(eve)[2] = 0.0f; - } - else { - eve->f2 = 0; - } - } - } - - - /* Floodfill routine */ - /* - At worst this is n*n of complexity where n is number of edges - Best case would be n if the list is ordered perfectly. - Estimate is n log n in average (so not too bad) - */ - while(done) { - done= 0; - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0) { - EditVert *v1= eed->v1, *v2= eed->v2; - float *vec2 = E_VEC(v2); - float *vec1 = E_VEC(v1); - - if (v1->f2 + v2->f2 == 4) - continue; - - if (v1->f2) { - if (v2->f2) { - float nvec[3]; - float len1 = VecLength(vec1); - float len2 = VecLength(vec2); - float lenn; - /* for v2 if not selected */ - if (v2->f2 != 2) { - VecSubf(nvec, v2->co, E_NEAR(v1)->co); - lenn = VecLength(nvec); - /* 1 < n < 2 */ - if (lenn - len1 > THRESHOLD && len2 - lenn > THRESHOLD) { - VECCOPY(vec2, nvec); - E_NEAR(v2) = E_NEAR(v1); - done = 1; - } - /* n < 1 < 2 */ - else if (len2 - len1 > THRESHOLD && len1 - lenn > THRESHOLD) { - VECCOPY(vec2, vec1); - E_NEAR(v2) = E_NEAR(v1); - done = 1; - } - } - /* for v1 if not selected */ - if (v1->f2 != 2) { - VecSubf(nvec, v1->co, E_NEAR(v2)->co); - lenn = VecLength(nvec); - /* 2 < n < 1 */ - if (lenn - len2 > THRESHOLD && len1 - lenn > THRESHOLD) { - VECCOPY(vec1, nvec); - E_NEAR(v1) = E_NEAR(v2); - done = 1; - } - /* n < 2 < 1 */ - else if (len1 - len2 > THRESHOLD && len2 - lenn > THRESHOLD) { - VECCOPY(vec1, vec2); - E_NEAR(v1) = E_NEAR(v2); - done = 1; - } - } - } - else { - v2->f2 = 1; - VecSubf(vec2, v2->co, E_NEAR(v1)->co); - /* 2 < 1 */ - if (VecLength(vec1) - VecLength(vec2) > THRESHOLD) { - VECCOPY(vec2, vec1); - } - E_NEAR(v2) = E_NEAR(v1); - done = 1; - } - } - else if (v2->f2) { - v1->f2 = 1; - VecSubf(vec1, v1->co, E_NEAR(v2)->co); - /* 2 < 1 */ - if (VecLength(vec2) - VecLength(vec1) > THRESHOLD) { - VECCOPY(vec1, vec2); - } - E_NEAR(v1) = E_NEAR(v2); - done = 1; - } - } - } - } -} - -/* loop-in-a-loop I know, but we need it! (ton) */ -static void get_face_center(float *cent, EditVert *eve) -{ - EditMesh *em = G.editMesh; - EditFace *efa; - - for(efa= em->faces.first; efa; efa= efa->next) - if(efa->f & SELECT) - if(efa->v1==eve || efa->v2==eve || efa->v3==eve || efa->v4==eve) - break; - if(efa) { - VECCOPY(cent, efa->cent); - } -} - -//way to overwrite what data is edited with transform -//static void VertsToTransData(TransData *td, EditVert *eve, BakeKey *key) -static void VertsToTransData(TransData *td, EditVert *eve) -{ - td->flag = 0; - //if(key) - // td->loc = key->co; - //else - td->loc = eve->co; - - VECCOPY(td->center, td->loc); - if(G.vd->around==V3D_LOCAL && (G.scene->selectmode & SCE_SELECT_FACE)) - get_face_center(td->center, eve); - VECCOPY(td->iloc, td->loc); - - // Setting normals - VECCOPY(td->axismtx[2], eve->no); - td->axismtx[0][0] = - td->axismtx[0][1] = - td->axismtx[0][2] = - td->axismtx[1][0] = - td->axismtx[1][1] = - td->axismtx[1][2] = 0.0f; - - td->ext = NULL; - td->tdi = NULL; - td->val = NULL; - td->tdmir= NULL; - -#ifdef WITH_VERSE - if(eve->vvert) { - td->verse = (void*)eve->vvert; - td->flag |= TD_VERSE_VERT; - } - else - td->flag &= ~TD_VERSE_VERT; -#endif -} - -/* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */ - -static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s) -{ - float *vec = userData; - - vec+= 3*index; - VECCOPY(vec, co); -} - -static int modifiers_disable_subsurf_temporary(Object *ob) -{ - ModifierData *md; - int disabled = 0; - - for(md=ob->modifiers.first; md; md=md->next) - if(md->type==eModifierType_Subsurf) - if(md->mode & eModifierMode_OnCage) { - md->mode ^= eModifierMode_DisableTemporary; - disabled= 1; - } - - return disabled; -} - -/* disable subsurf temporal, get mapped cos, and enable it */ -static float *get_crazy_mapped_editverts(void) -{ - DerivedMesh *dm; - float *vertexcos; - - /* disable subsurf temporal, get mapped cos, and enable it */ - if(modifiers_disable_subsurf_temporary(G.obedit)) { - /* need to make new derivemesh */ - makeDerivedMesh(G.obedit, CD_MASK_BAREMESH); - } - - /* now get the cage */ - dm= editmesh_get_derived_cage(CD_MASK_BAREMESH); - - vertexcos= MEM_mallocN(3*sizeof(float)*G.totvert, "vertexcos map"); - dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos); - - dm->release(dm); - - /* set back the flag, no new cage needs to be built, transform does it */ - modifiers_disable_subsurf_temporary(G.obedit); - - return vertexcos; -} - -#define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2]) -static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3) -{ - float vecu[3], vecv[3]; - float q1[4], q2[4]; - - TAN_MAKE_VEC(vecu, v1, v2); - TAN_MAKE_VEC(vecv, v1, v3); - triatoquat(v1, vecu, vecv, q1); - - TAN_MAKE_VEC(vecu, def1, def2); - TAN_MAKE_VEC(vecv, def1, def3); - triatoquat(def1, vecu, vecv, q2); - - QuatSub(quat, q2, q1); -} -#undef TAN_MAKE_VEC - -static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats) -{ - EditMesh *em = G.editMesh; - EditVert *eve, *prev; - EditFace *efa; - float *v1, *v2, *v3, *v4, *co1, *co2, *co3, *co4; - long index= 0; - - /* two abused locations in vertices */ - for(eve= em->verts.first; eve; eve= eve->next, index++) { - eve->tmp.p = NULL; - eve->prev= (EditVert *)index; - } - - /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */ - for(efa= em->faces.first; efa; efa= efa->next) { - - /* retrieve mapped coordinates */ - v1= mappedcos + 3*(long)(efa->v1->prev); - v2= mappedcos + 3*(long)(efa->v2->prev); - v3= mappedcos + 3*(long)(efa->v3->prev); - - co1= (origcos)? origcos + 3*(long)(efa->v1->prev): efa->v1->co; - co2= (origcos)? origcos + 3*(long)(efa->v2->prev): efa->v2->co; - co3= (origcos)? origcos + 3*(long)(efa->v3->prev): efa->v3->co; - - if(efa->v2->tmp.p==NULL && efa->v2->f1) { - set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1); - efa->v2->tmp.p= (void*)quats; - quats+= 4; - } - - if(efa->v4) { - v4= mappedcos + 3*(long)(efa->v4->prev); - co4= (origcos)? origcos + 3*(long)(efa->v4->prev): efa->v4->co; - - if(efa->v1->tmp.p==NULL && efa->v1->f1) { - set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4); - efa->v1->tmp.p= (void*)quats; - quats+= 4; - } - if(efa->v3->tmp.p==NULL && efa->v3->f1) { - set_crazy_vertex_quat(quats, co3, co4, co2, v3, v4, v2); - efa->v3->tmp.p= (void*)quats; - quats+= 4; - } - if(efa->v4->tmp.p==NULL && efa->v4->f1) { - set_crazy_vertex_quat(quats, co4, co1, co3, v4, v1, v3); - efa->v4->tmp.p= (void*)quats; - quats+= 4; - } - } - else { - if(efa->v1->tmp.p==NULL && efa->v1->f1) { - set_crazy_vertex_quat(quats, co1, co2, co3, v1, v2, v3); - efa->v1->tmp.p= (void*)quats; - quats+= 4; - } - if(efa->v3->tmp.p==NULL && efa->v3->f1) { - set_crazy_vertex_quat(quats, co3, co1, co2, v3, v1, v2); - efa->v3->tmp.p= (void*)quats; - quats+= 4; - } - } - } - - /* restore abused prev pointer */ - for(prev= NULL, eve= em->verts.first; eve; prev= eve, eve= eve->next) - eve->prev= prev; - -} - -static void createTransEditVerts(TransInfo *t) -{ - TransData *tob = NULL; - EditMesh *em = G.editMesh; - EditVert *eve; - EditVert **nears = NULL; - float *vectors = NULL, *mappedcos = NULL, *quats= NULL; - float mtx[3][3], smtx[3][3], (*defmats)[3][3] = NULL, (*defcos)[3] = NULL; - int count=0, countsel=0, a, totleft; - int propmode = t->flag & T_PROP_EDIT; - int mirror = 0; - - if ((t->context & CTX_NO_MIRROR) == 0 || (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR)) - { - mirror = 1; - } - - // transform now requires awareness for select mode, so we tag the f1 flags in verts - if(G.scene->selectmode & SCE_SELECT_VERTEX) { - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0 && (eve->f & SELECT)) - eve->f1= SELECT; - else - eve->f1= 0; - } - } - else if(G.scene->selectmode & SCE_SELECT_EDGE) { - EditEdge *eed; - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->h==0 && (eed->f & SELECT)) - eed->v1->f1= eed->v2->f1= SELECT; - } - } - else { - EditFace *efa; - for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0; - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->h==0 && (efa->f & SELECT)) { - efa->v1->f1= efa->v2->f1= efa->v3->f1= SELECT; - if(efa->v4) efa->v4->f1= SELECT; - } - } - } - - /* now we can count */ - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->h==0) { - if(eve->f1) countsel++; - if(propmode) count++; - } - } - - /* note: in prop mode we need at least 1 selected */ - if (countsel==0) return; - - if(propmode) { - t->total = count; - - /* allocating scratch arrays */ - vectors = (float *)MEM_mallocN(t->total * 3 * sizeof(float), "scratch vectors"); - nears = (EditVert**)MEM_mallocN(t->total * sizeof(EditVert*), "scratch nears"); - } - else t->total = countsel; - tob= t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(Mesh EditMode)"); - - Mat3CpyMat4(mtx, G.obedit->obmat); - Mat3Inv(smtx, mtx); - - if(propmode) editmesh_set_connectivity_distance(t->total, vectors, nears); - - /* detect CrazySpace [tm] */ - if(propmode==0) { - if(modifiers_getCageIndex(G.obedit, NULL)>=0) { - if(modifiers_isDeformed(G.obedit)) { - /* check if we can use deform matrices for modifier from the - start up to stack, they are more accurate than quats */ - totleft= editmesh_get_first_deform_matrices(&defmats, &defcos); - - /* if we still have more modifiers, also do crazyspace - correction with quats, relative to the coordinates after - the modifiers that support deform matrices (defcos) */ - if(totleft > 0) { - mappedcos= get_crazy_mapped_editverts(); - quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats"); - set_crazyspace_quats((float*)defcos, mappedcos, quats); - if(mappedcos) - MEM_freeN(mappedcos); - } - - if(defcos) - MEM_freeN(defcos); - } - } - } - - /* find out which half we do */ - if(mirror) { - for (eve=em->verts.first; eve; eve=eve->next) { - if(eve->h==0 && eve->f1 && eve->co[0]!=0.0f) { - if(eve->co[0]<0.0f) - mirror = -1; - break; - } - } - } - - for (a=0, eve=em->verts.first; eve; eve=eve->next, a++) { - if(eve->h==0) { - if(propmode || eve->f1) { - VertsToTransData(tob, eve); - - if(eve->f1) tob->flag |= TD_SELECTED; - if(propmode) { - if (eve->f2) { - float vec[3]; - VECCOPY(vec, E_VEC(eve)); - Mat3MulVecfl(mtx, vec); - tob->dist= VecLength(vec); - } - else { - tob->flag |= TD_NOTCONNECTED; - tob->dist = MAXFLOAT; - } - } - - /* CrazySpace */ - if(defmats || (quats && eve->tmp.p)) { - float mat[3][3], imat[3][3], qmat[3][3]; - - /* use both or either quat and defmat correction */ - if(quats && eve->tmp.f) { - QuatToMat3(eve->tmp.p, qmat); - - if(defmats) - Mat3MulSerie(mat, mtx, qmat, defmats[a], - NULL, NULL, NULL, NULL, NULL); - else - Mat3MulMat3(mat, mtx, qmat); - } - else - Mat3MulMat3(mat, mtx, defmats[a]); - - Mat3Inv(imat, mat); - - Mat3CpyMat3(tob->smtx, imat); - Mat3CpyMat3(tob->mtx, mat); - } - else { - Mat3CpyMat3(tob->smtx, smtx); - Mat3CpyMat3(tob->mtx, mtx); - } - - /* Mirror? */ - if( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { - EditVert *vmir= editmesh_get_x_mirror_vert(G.obedit, tob->iloc); /* initializes octree on first call */ - if(vmir!=eve) tob->tdmir= vmir; - } - tob++; - } - } - } - if (propmode) { - MEM_freeN(vectors); - MEM_freeN(nears); - } - /* crazy space free */ - if(quats) - MEM_freeN(quats); - if(defmats) - MEM_freeN(defmats); -} - -/* ********************* UV ****************** */ - -static void UVsToTransData(TransData *td, TransData2D *td2d, float *uv, int selected) -{ - float aspx, aspy; - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - - /* uv coords are scaled by aspects. this is needed for rotations and - proportional editing to be consistent with the stretchted uv coords - that are displayed. this also means that for display and numinput, - and when the the uv coords are flushed, these are converted each time */ - td2d->loc[0] = uv[0]*aspx; - td2d->loc[1] = uv[1]*aspy; - td2d->loc[2] = 0.0f; - td2d->loc2d = uv; - - td->flag = 0; - td->loc = td2d->loc; - VECCOPY(td->center, td->loc); - VECCOPY(td->iloc, td->loc); - - memset(td->axismtx, 0, sizeof(td->axismtx)); - td->axismtx[2][2] = 1.0f; - - td->ext= NULL; td->tdi= NULL; td->val= NULL; - - if(selected) { - td->flag |= TD_SELECTED; - td->dist= 0.0; - } - else - td->dist= MAXFLOAT; - - Mat3One(td->mtx); - Mat3One(td->smtx); -} - -static void createTransUVs(TransInfo *t) -{ - TransData *td = NULL; - TransData2D *td2d = NULL; - MTFace *tf; - int count=0, countsel=0; - int propmode = t->flag & T_PROP_EDIT; - - EditMesh *em = G.editMesh; - EditFace *efa; - - if(is_uv_tface_editing_allowed()==0) return; - - /* count */ - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if (simaUVSel_Check(efa, tf, 0)) countsel++; - if (simaUVSel_Check(efa, tf, 1)) countsel++; - if (simaUVSel_Check(efa, tf, 2)) countsel++; - if (efa->v4 && simaUVSel_Check(efa, tf, 3)) countsel++; - if(propmode) - count += (efa->v4)? 4: 3; - } - } - - /* note: in prop mode we need at least 1 selected */ - if (countsel==0) return; - - t->total= (propmode)? count: countsel; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransObData(UV Editing)"); - /* for each 2d uv coord a 3d vector is allocated, so that they can be - treated just as if they were 3d verts */ - t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransObData2D(UV Editing)"); - - if(G.sima->flag & SI_CLIP_UV) - t->flag |= T_CLIP_UV; - - td= t->data; - td2d= t->data2d; - for (efa= em->faces.first; efa; efa= efa->next) { - tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - if (simaFaceDraw_Check(efa, tf)) { - if(propmode || simaUVSel_Check(efa, tf, 0)) - UVsToTransData(td++, td2d++, tf->uv[0], simaUVSel_Check(efa, tf, 0)); - if(propmode || simaUVSel_Check(efa, tf, 1)) - UVsToTransData(td++, td2d++, tf->uv[1], simaUVSel_Check(efa, tf, 1)); - if(propmode || simaUVSel_Check(efa, tf, 2)) - UVsToTransData(td++, td2d++, tf->uv[2], simaUVSel_Check(efa, tf, 2)); - - if(efa->v4 && (propmode || simaUVSel_Check(efa, tf, 3))) - UVsToTransData(td++, td2d++, tf->uv[3], simaUVSel_Check(efa, tf, 3)); - } - } - - if (G.sima->flag & SI_LIVE_UNWRAP) - unwrap_lscm_live_begin(); -} - -void flushTransUVs(TransInfo *t) -{ - TransData2D *td; - int a, width, height; - Object *ob= OBACT; - EditMesh *em = G.editMesh; - float aspx, aspy, invx, invy; - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - transform_width_height_tface_uv(&width, &height); - invx= 1.0f/aspx; - invy= 1.0f/aspy; - - /* flush to 2d vector from internally used 3d vector */ - for(a=0, td= t->data2d; atotal; a++, td++) { - td->loc2d[0]= td->loc[0]*invx; - td->loc2d[1]= td->loc[1]*invy; - - if((G.sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) { - td->loc2d[0]= floor(width*td->loc2d[0] + 0.5f)/width; - td->loc2d[1]= floor(height*td->loc2d[1] + 0.5f)/height; - } - } - - /* always call this, also for cancel (it transforms non-selected vertices...) */ - if((G.sima->flag & SI_BE_SQUARE)) - be_square_tface_uv(em); - - /* this is overkill if G.sima->lock is not set, but still needed */ - object_uvs_changed(ob); -} - -int clipUVTransform(TransInfo *t, float *vec, int resize) -{ - TransData *td; - int a, clipx=1, clipy=1; - float aspx, aspy, min[2], max[2]; - - transform_aspect_ratio_tface_uv(&aspx, &aspy); - min[0]= min[1]= 0.0f; - max[0]= aspx; max[1]= aspy; - - for(a=0, td= t->data; atotal; a++, td++) { - DO_MINMAX2(td->loc, min, max); - } - - if(resize) { - if(min[0] < 0.0f && t->center[0] > 0.0f && t->center[0] < aspx*0.5f) - vec[0] *= t->center[0]/(t->center[0] - min[0]); - else if(max[0] > aspx && t->center[0] < aspx) - vec[0] *= (t->center[0] - aspx)/(t->center[0] - max[0]); - else - clipx= 0; - - if(min[1] < 0.0f && t->center[1] > 0.0f && t->center[1] < aspy*0.5f) - vec[1] *= t->center[1]/(t->center[1] - min[1]); - else if(max[1] > aspy && t->center[1] < aspy) - vec[1] *= (t->center[1] - aspy)/(t->center[1] - max[1]); - else - clipy= 0; - } - else { - if(min[0] < 0.0f) - vec[0] -= min[0]; - else if(max[0] > aspx) - vec[0] -= max[0]-aspx; - else - clipx= 0; - - if(min[1] < 0.0f) - vec[1] -= min[1]; - else if(max[1] > aspy) - vec[1] -= max[1]-aspy; - else - clipy= 0; - } - - return (clipx || clipy); -} - -/* ********************* IPO EDITOR ************************* */ - -/* for IPO Editor transform - but actual creation of transform structures is not performed here - * due to bad globals that would need to be imported specially for this - */ -static void createTransIpoData(TransInfo *t) -{ - /* in editipo.c due to some globals that are defined in that file... */ - make_ipo_transdata(t); -} - -/* this function is called on recalcData to apply the transforms applied - * to the transdata on to the actual keyframe data - */ -void flushTransIpoData(TransInfo *t) -{ - TransData2D *td; - int a; - - /* flush to 2d vector from internally used 3d vector */ - for (a=0, td= t->data2d; atotal; a++, td++) { - /* we need to unapply the nla-scaling from the time in some situations */ - if (NLA_IPO_SCALED) - td->loc2d[0]= get_action_frame(OBACT, td->loc[0]); - else - td->loc2d[0]= td->loc[0]; - - /* when the icu that point comes from is a bitflag holder, don't allow adjusting values */ - if ((t->data[a].flag & TD_TIMEONLY)==0) - td->loc2d[1]= td->loc[1]; - } -} - -/* ********************* ACTION/NLA EDITOR ****************** */ - -/* This function tests if a point is on the "mouse" side of the cursor/frame-marking */ -static short FrameOnMouseSide(char side, float frame, float cframe) -{ - /* both sides, so it doesn't matter */ - if (side == 'B') return 1; - - /* only on the named side */ - if (side == 'R') - return (frame >= cframe) ? 1 : 0; - else - return (frame <= cframe) ? 1 : 0; -} - -/* fully select selected beztriples, but only include if it's on the right side of cfra */ -static int count_ipo_keys(Ipo *ipo, char side, float cfra) -{ - IpoCurve *icu; - BezTriple *bezt; - int i, count = 0; - - if (ipo == NULL) - return count; - - /* only include points that occur on the right side of cfra */ - for (icu= ipo->curve.first; icu; icu= icu->next) { - for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) { - if (bezt->f2 & SELECT) { - /* fully select the other two keys */ - bezt->f1 |= SELECT; - bezt->f3 |= SELECT; - - /* increment by 3, as there are 3 points (3 * x-coordinates) that need transform */ - if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) - count += 3; - } - } - } - - return count; -} - -/* This function assigns the information to transdata */ -static void TimeToTransData(TransData *td, float *time, Object *ob) -{ - /* memory is calloc'ed, so that should zero everything nicely for us */ - td->val = time; - td->ival = *(time); - - /* store the Object where this keyframe exists as a keyframe of the - * active action as td->ob. Usually, this member is only used for constraints - * drawing - */ - td->ob= ob; -} - -/* This function advances the address to which td points to, so it must return - * the new address so that the next time new transform data is added, it doesn't - * overwrite the existing ones... i.e. td = IpoToTransData(td, ipo, ob, side, cfra); - * - * The 'side' argument is needed for the extend mode. 'B' = both sides, 'R'/'L' mean only data - * on the named side are used. - */ -static TransData *IpoToTransData(TransData *td, Ipo *ipo, Object *ob, char side, float cfra) -{ - IpoCurve *icu; - BezTriple *bezt; - int i; - - if (ipo == NULL) - return td; - - for (icu= ipo->curve.first; icu; icu= icu->next) { - for (i=0, bezt=icu->bezt; i < icu->totvert; i++, bezt++) { - /* only add selected keyframes (for now, proportional edit is not enabled) */ - if (BEZSELECTED(bezt)) { - /* only add if on the right 'side' of the current frame */ - if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) { - /* each control point needs to be added separetely */ - TimeToTransData(td, bezt->vec[0], ob); - td++; - - TimeToTransData(td, bezt->vec[1], ob); - td++; - - TimeToTransData(td, bezt->vec[2], ob); - td++; - } - } - } - } - - return td; -} - -static void createTransActionData(TransInfo *t) -{ - TransData *td = NULL; - Object *ob= NULL; - - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - void *data; - short datatype; - int filter; - - int count=0; - float cfra; - char side; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - - /* filter data */ - filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_IPOKEYS); - actdata_filter(&act_data, filter, data, datatype); - - /* is the action scaled? if so, the it should belong to the active object */ - if (NLA_ACTION_SCALED) - ob= OBACT; - - /* which side of the current frame should be allowed */ - if (t->mode == TFM_TIME_EXTEND) { - /* only side on which mouse is gets transformed */ - float xmouse, ymouse; - - areamouseco_to_ipoco(G.v2d, t->imval, &xmouse, &ymouse); - side = (xmouse > CFRA) ? 'R' : 'L'; - } - else { - /* normal transform - both sides of current frame are considered */ - side = 'B'; - } - - /* convert current-frame to action-time (slightly less accurate, espcially under - * higher scaling ratios, but is faster than converting all points) - */ - if (ob) - cfra = get_action_frame(ob, CFRA); - else - cfra = CFRA; - - /* loop 1: fully select ipo-keys and count how many BezTriples are selected */ - for (ale= act_data.first; ale; ale= ale->next) - count += count_ipo_keys(ale->key_data, side, cfra); - - /* stop if trying to build list if nothing selected */ - if (count == 0) { - /* cleanup temp list */ - BLI_freelistN(&act_data); - return; - } - - /* allocate memory for data */ - t->total= count; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransData(Action Editor)"); - if (t->mode == TFM_TIME_SLIDE) - t->customData= MEM_callocN(sizeof(float)*2, "TimeSlide Min/Max"); - - td= t->data; - /* loop 2: build transdata array */ - for (ale= act_data.first; ale; ale= ale->next) { - Ipo *ipo= (Ipo *)ale->key_data; - - td= IpoToTransData(td, ipo, ob, side, cfra); - } - - /* check if we're supposed to be setting minx/maxx for TimeSlide */ - if (t->mode == TFM_TIME_SLIDE) { - float min = 0, max = 0; - int i; - - td= (t->data + 1); - for (i=1; i < count; i+=3, td+=3) { - if (min > *(td->val)) min= *(td->val); - if (max < *(td->val)) max= *(td->val); - } - - /* minx/maxx values used by TimeSlide are stored as a - * calloced 2-float array in t->customData. This gets freed - * in postTrans (T_FREE_CUSTOMDATA). - */ - *((float *)(t->customData)) = min; - *((float *)(t->customData) + 1) = max; - } - - /* cleanup temp list */ - BLI_freelistN(&act_data); -} - -static void createTransNlaData(TransInfo *t) -{ - Base *base; - bActionStrip *strip; - bActionChannel *achan; - bConstraintChannel *conchan; - - TransData *td = NULL; - int count=0, i; - float cfra; - char side; - - /* which side of the current frame should be allowed */ - if (t->mode == TFM_TIME_EXTEND) { - /* only side on which mouse is gets transformed */ - float xmouse, ymouse; - - areamouseco_to_ipoco(G.v2d, t->imval, &xmouse, &ymouse); - side = (xmouse > CFRA) ? 'R' : 'L'; - } - else { - /* normal transform - both sides of current frame are considered */ - side = 'B'; - } - - /* Ensure that partial selections result in beztriple selections */ - for (base=G.scene->base.first; base; base=base->next) { - /* Check object ipos */ - i= count_ipo_keys(base->object->ipo, side, CFRA); - if (i) base->flag |= BA_HAS_RECALC_OB; - count += i; - - /* Check object constraint ipos */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next) - count += count_ipo_keys(conchan->ipo, side, CFRA); - - /* skip actions and nlastrips if object is collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Check action ipos */ - if (base->object->action) { - /* exclude if strip is selected too */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_SELECT) - if (strip->act == base->object->action) - break; - } - if (strip==NULL) { - cfra = get_action_frame(base->object, CFRA); - - for (achan=base->object->action->chanbase.first; achan; achan=achan->next) { - if (EDITABLE_ACHAN(achan)) { - i= count_ipo_keys(achan->ipo, side, cfra); - if (i) base->flag |= BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA; - count += i; - - /* Check action constraint ipos */ - if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) { - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) { - if (EDITABLE_CONCHAN(conchan)) - count += count_ipo_keys(conchan->ipo, side, cfra); - } - } - } - } - } - } - - /* Check nlastrips */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_SELECT) { - base->flag |= BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA; - - if (FrameOnMouseSide(side, strip->start, CFRA)) count++; - if (FrameOnMouseSide(side, strip->end, CFRA)) count++; - } - } - } - - /* If nothing is selected, bail out */ - if (count == 0) - return; - - /* allocate memory for data */ - t->total= count; - t->data= MEM_callocN(t->total*sizeof(TransData), "TransData (NLA Editor)"); - - /* build the transdata structure */ - td= t->data; - for (base=G.scene->base.first; base; base=base->next) { - /* Manipulate object ipos */ - /* - no scaling of keyframe times is allowed here */ - td= IpoToTransData(td, base->object->ipo, NULL, side, CFRA); - - /* Manipulate object constraint ipos */ - /* - no scaling of keyframe times is allowed here */ - for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next) - td= IpoToTransData(td, conchan->ipo, NULL, side, CFRA); - - /* skip actions and nlastrips if object collapsed */ - if (base->object->nlaflag & OB_NLA_COLLAPSED) - continue; - - /* Manipulate action ipos */ - if (base->object->action) { - /* exclude if strip that active action belongs to is selected too */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_SELECT) - if (strip->act == base->object->action) - break; - } - - /* can include if no strip found */ - if (strip==NULL) { - cfra = get_action_frame(base->object, CFRA); - - for (achan=base->object->action->chanbase.first; achan; achan=achan->next) { - if (EDITABLE_ACHAN(achan)) { - td= IpoToTransData(td, achan->ipo, base->object, side, cfra); - - /* Manipulate action constraint ipos */ - if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) { - for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) { - if (EDITABLE_CONCHAN(conchan)) - td= IpoToTransData(td, conchan->ipo, base->object, side, cfra); - } - } - } - } - } - } - - /* Manipulate nlastrips */ - for (strip=base->object->nlastrips.first; strip; strip=strip->next) { - if (strip->flag & ACTSTRIP_SELECT) { - /* first TransData is the start, second is the end */ - if (FrameOnMouseSide(side, strip->start, CFRA)) { - td->val = &strip->start; - td->ival = strip->start; - td++; - } - if (FrameOnMouseSide(side, strip->end, CFRA)) { - td->val = &strip->end; - td->ival = strip->end; - td++; - } - } - } - } -} - -/* **************** IpoKey stuff, for Object TransData ********** */ - -/* storage of bezier triple. thats why -3 and +3! */ -static void set_tdi_old(float *old, float *poin) -{ - old[0]= *(poin); - old[3]= *(poin-3); - old[6]= *(poin+3); -} - -/* while transforming */ -void add_tdi_poin(float *poin, float *old, float delta) -{ - if(poin) { - poin[0]= old[0]+delta; - poin[-3]= old[3]+delta; - poin[3]= old[6]+delta; - } -} - -/* fill ipokey transdata with old vals and pointers */ -static void ipokey_to_transdata(IpoKey *ik, TransData *td) -{ - extern int ob_ar[]; // blenkernel ipo.c - TransDataIpokey *tdi= td->tdi; - BezTriple *bezt; - int a, delta= 0; - - td->val= NULL; // is read on ESC - - for(a=0; adata[a]) { - bezt= ik->data[a]; - - switch( ob_ar[a] ) { - case OB_LOC_X: - case OB_DLOC_X: - tdi->locx= &(bezt->vec[1][1]); break; - case OB_LOC_Y: - case OB_DLOC_Y: - tdi->locy= &(bezt->vec[1][1]); break; - case OB_LOC_Z: - case OB_DLOC_Z: - tdi->locz= &(bezt->vec[1][1]); break; - - case OB_DROT_X: - delta= 1; - case OB_ROT_X: - tdi->rotx= &(bezt->vec[1][1]); break; - case OB_DROT_Y: - delta= 1; - case OB_ROT_Y: - tdi->roty= &(bezt->vec[1][1]); break; - case OB_DROT_Z: - delta= 1; - case OB_ROT_Z: - tdi->rotz= &(bezt->vec[1][1]); break; - - case OB_SIZE_X: - case OB_DSIZE_X: - tdi->sizex= &(bezt->vec[1][1]); break; - case OB_SIZE_Y: - case OB_DSIZE_Y: - tdi->sizey= &(bezt->vec[1][1]); break; - case OB_SIZE_Z: - case OB_DSIZE_Z: - tdi->sizez= &(bezt->vec[1][1]); break; - } - } - } - - /* oldvals for e.g. undo */ - if(tdi->locx) set_tdi_old(tdi->oldloc, tdi->locx); - if(tdi->locy) set_tdi_old(tdi->oldloc+1, tdi->locy); - if(tdi->locz) set_tdi_old(tdi->oldloc+2, tdi->locz); - - /* remember, for mapping curves ('1'=10 degrees) */ - if(tdi->rotx) set_tdi_old(tdi->oldrot, tdi->rotx); - if(tdi->roty) set_tdi_old(tdi->oldrot+1, tdi->roty); - if(tdi->rotz) set_tdi_old(tdi->oldrot+2, tdi->rotz); - - /* this is not allowed to be dsize! */ - if(tdi->sizex) set_tdi_old(tdi->oldsize, tdi->sizex); - if(tdi->sizey) set_tdi_old(tdi->oldsize+1, tdi->sizey); - if(tdi->sizez) set_tdi_old(tdi->oldsize+2, tdi->sizez); - - tdi->flag= TOB_IPO; - if(delta) tdi->flag |= TOB_IPODROT; -} - - -/* *************************** Object Transform data ******************* */ - -/* Little helper function for ObjectToTransData used to give certain - * constraints (ChildOf, FollowPath, and others that may be added) - * inverse corrections for transform, so that they aren't in CrazySpace. - * These particular constraints benefit from this, but others don't, hence - * this semi-hack ;-) - Aligorith - */ -static short constraints_list_needinv(TransInfo *t, ListBase *list) -{ - bConstraint *con; - - /* loop through constraints, checking if there's one of the mentioned - * constraints needing special crazyspace corrections - */ - if (list) { - for (con= list->first; con; con=con->next) { - /* only consider constraint if it is enabled, and has influence on result */ - if ((con->flag & CONSTRAINT_DISABLE)==0 && (con->enforce!=0.0)) { - /* (affirmative) returns for specific constraints here... */ - /* constraints that require this regardless */ - if (con->type == CONSTRAINT_TYPE_CHILDOF) return 1; - if (con->type == CONSTRAINT_TYPE_FOLLOWPATH) return 1; - if (con->type == CONSTRAINT_TYPE_CLAMPTO) return 1; - - /* constraints that require this only under special conditions */ - if (con->type == CONSTRAINT_TYPE_ROTLIKE) { - /* CopyRot constraint only does this when rotating, and offset is on */ - bRotateLikeConstraint *data = (bRotateLikeConstraint *)con->data; - - if ((data->flag & ROTLIKE_OFFSET) && (t->mode == TFM_ROTATION)) - return 1; - } - } - } - } - - /* no appropriate candidates found */ - return 0; -} - -/* transcribe given object into TransData for Transforming */ -static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob) -{ - Object *track; - ListBase fakecons = {NULL, NULL}; - float obmtx[3][3]; - short constinv; - - /* axismtx has the real orientation */ - Mat3CpyMat4(td->axismtx, ob->obmat); - Mat3Ortho(td->axismtx); - - td->con= ob->constraints.first; - - /* hack: tempolarily disable tracking and/or constraints when getting - * object matrix, if tracking is on, or if constraints don't need - * inverse correction to stop it from screwing up space conversion - * matrix later - */ - constinv= constraints_list_needinv(t, &ob->constraints); - if (ob->track || constinv==0) { - track= ob->track; - ob->track= NULL; - - if (constinv == 0) { - fakecons.first = ob->constraints.first; - fakecons.last = ob->constraints.last; - ob->constraints.first = ob->constraints.last = NULL; - } - - where_is_object(ob); - - if (constinv == 0) { - ob->constraints.first = fakecons.first; - ob->constraints.last = fakecons.last; - } - - ob->track= track; - } - else - where_is_object(ob); - - td->ob = ob; - - td->loc = ob->loc; - VECCOPY(td->iloc, td->loc); - - td->ext->rot = ob->rot; - VECCOPY(td->ext->irot, ob->rot); - VECCOPY(td->ext->drot, ob->drot); - - td->ext->size = ob->size; - VECCOPY(td->ext->isize, ob->size); - VECCOPY(td->ext->dsize, ob->dsize); - - VECCOPY(td->center, ob->obmat[3]); - - /* is there a need to set the global<->data space conversion matrices? */ - if (ob->parent || constinv) { - float totmat[3][3], obinv[3][3]; - - /* Get the effect of parenting, and/or certain constraints. - * NOTE: some Constraints, and also Tracking should never get this - * done, as it doesn't work well. - */ - object_to_mat3(ob, obmtx); - Mat3CpyMat4(totmat, ob->obmat); - Mat3Inv(obinv, totmat); - Mat3MulMat3(td->smtx, obmtx, obinv); - Mat3Inv(td->mtx, td->smtx); - } - else { - /* no conversion to/from dataspace */ - Mat3One(td->smtx); - Mat3One(td->mtx); - } -#ifdef WITH_VERSE - if(ob->vnode) { - td->verse = (void*)ob; - td->flag |= TD_VERSE_OBJECT; - } - else - td->flag &= ~TD_VERSE_OBJECT; -#endif -} - - -/* sets flags in Bases to define whether they take part in transform */ -/* it deselects Bases, so we have to call the clear function always after */ -static void set_trans_object_base_flags(TransInfo *t) -{ - /* - if Base selected and has parent selected: - base->flag= BA_WAS_SEL - */ - Base *base; - - /* makes sure base flags and object flags are identical */ - copy_baseflags(); - - /* handle pending update events, otherwise they got copied below */ - for (base= FIRSTBASE; base; base= base->next) { - if(base->object->recalc) - object_handle_update(base->object); - } - - for (base= FIRSTBASE; base; base= base->next) { - base->flag &= ~BA_WAS_SEL; - - if(TESTBASELIB(base)) { - Object *ob= base->object; - Object *parsel= ob->parent; - - /* if parent selected, deselect */ - while(parsel) { - if(parsel->flag & SELECT) break; - parsel= parsel->parent; - } - - if(parsel) { - base->flag &= ~SELECT; - base->flag |= BA_WAS_SEL; - } - /* used for flush, depgraph will change recalcs if needed :) */ - ob->recalc |= OB_RECALC_OB; - } - } - /* all recalc flags get flushed to all layers, so a layer flip later on works fine */ - DAG_scene_flush_update(G.scene, -1); - - /* and we store them temporal in base (only used for transform code) */ - /* this because after doing updates, the object->recalc is cleared */ - for (base= FIRSTBASE; base; base= base->next) { - if(base->object->recalc & OB_RECALC_OB) - base->flag |= BA_HAS_RECALC_OB; - if(base->object->recalc & OB_RECALC_DATA) - base->flag |= BA_HAS_RECALC_DATA; - } -} - -static void clear_trans_object_base_flags(void) -{ - Base *base; - - base= FIRSTBASE; - while(base) { - if(base->flag & BA_WAS_SEL) base->flag |= SELECT; - base->flag &= ~(BA_WAS_SEL|BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA|BA_DO_IPO); - - base = base->next; - } -} - -/* auto-keyframing feature - for objects - * tmode: should be a transform mode - */ -void autokeyframe_ob_cb_func(Object *ob, int tmode) -{ - IpoCurve *icu; - char *actname=""; - - if (G.flags & G_RECORDKEYS) { - if (ob->ipoflag & OB_ACTION_OB) - actname= "Object"; - - if (U.uiflag & USER_KEYINSERTAVAI) { - if (ob->ipo || ob->action) { - ID *id= (ID *)(ob); - - if (ob->ipo) { - icu= ob->ipo->curve.first; - } - else { - bActionChannel *achan; - achan= get_action_channel(ob->action, actname); - - if (achan && achan->ipo) - icu= achan->ipo->curve.first; - else - icu= NULL; - } - - while (icu) { - icu->flag &= ~IPO_SELECT; - if (U.uiflag & USER_KEYINSERTNEED) - insertkey_smarter(id, ID_OB, actname, NULL, icu->adrcode); - else - insertkey(id, ID_OB, actname, NULL, icu->adrcode, 0); - icu= icu->next; - } - } - } - else if (U.uiflag & USER_KEYINSERTNEED) { - short doLoc=0, doRot=0, doScale=0; - - /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ - if (tmode == TFM_TRANSLATION) { - doLoc = 1; - } - else if (tmode == TFM_ROTATION) { - if (G.vd->around == V3D_ACTIVE) { - if (ob != OBACT) - doLoc = 1; - } - else if (G.vd->around == V3D_CURSOR) - doLoc = 1; - - if ((G.vd->flag & V3D_ALIGN)==0) - doRot = 1; - } - else if (tmode == TFM_RESIZE) { - if (G.vd->around == V3D_ACTIVE) { - if (ob != OBACT) - doLoc = 1; - } - else if (G.vd->around == V3D_CURSOR) - doLoc = 1; - - if ((G.vd->flag & V3D_ALIGN)==0) - doScale = 1; - } - - if (doLoc) { - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_LOC_X); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_LOC_Y); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_LOC_Z); - } - if (doRot) { - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_ROT_X); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_ROT_Y); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_ROT_Z); - } - if (doScale) { - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_SIZE_X); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_SIZE_Y); - insertkey_smarter(&ob->id, ID_OB, actname, NULL, OB_SIZE_Z); - } - } - else { - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_X, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Y, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Z, 0); - - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_X, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Y, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Z, 0); - - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_X, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Y, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Z, 0); - } - - remake_object_ipos(ob); - allqueue(REDRAWMARKER, 0); - } -} - -/* auto-keyframing feature - for poses/pose-channels - * tmode: should be a transform mode - * targetless_ik: has targetless ik been done on any channels? - */ -void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik) -{ - bArmature *arm= ob->data; - bAction *act; - bPose *pose; - bPoseChannel *pchan; - IpoCurve *icu; - - pose= ob->pose; - act= ob->action; - - if (G.flags & G_RECORDKEYS) { - if (!act) - act= ob->action= add_empty_action("Action"); - - for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { - if (pchan->bone->flag & BONE_TRANSFORM) { - /* clear any 'unkeyed' flag it may have */ - pchan->bone->flag &= ~BONE_UNKEYED; - - /* only insert into available channels? */ - if (U.uiflag & USER_KEYINSERTAVAI) { - bActionChannel *achan; - - for (achan = act->chanbase.first; achan; achan=achan->next){ - if (achan->ipo && !strcmp (achan->name, pchan->name)){ - for (icu = achan->ipo->curve.first; icu; icu=icu->next){ - /* only insert keyframe if needed? */ - if (U.uiflag & USER_KEYINSERTNEED) - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, icu->adrcode); - else - insertkey(&ob->id, ID_PO, pchan->name, NULL, icu->adrcode, 0); - } - break; - } - } - } - /* only insert keyframe if needed? */ - else if (U.uiflag & USER_KEYINSERTNEED) { - short doLoc=0, doRot=0, doScale=0; - - /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ - if (tmode == TFM_TRANSLATION) { - if (targetless_ik) - doRot= 1; - else - doLoc = 1; - } - else if (tmode == TFM_ROTATION) { - if (ELEM(G.vd->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; - - if ((G.vd->flag & V3D_ALIGN)==0) - doRot = 1; - } - else if (tmode == TFM_RESIZE) { - if (ELEM(G.vd->around, V3D_CURSOR, V3D_ACTIVE)) - doLoc = 1; - - if ((G.vd->flag & V3D_ALIGN)==0) - doScale = 1; - } - - if (doLoc) { - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_X); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Y); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Z); - } - if (doRot) { - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_W); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - } - if (doScale) { - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_X); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Y); - insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Z); - } - } - /* insert keyframe in any channel that's appropriate */ - else { - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); - - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); - - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); - } - } - } - - remake_action_ipos (act); - allqueue(REDRAWMARKER, 0); - - /* locking can be disabled */ - ob->pose->flag &= ~(POSE_DO_UNLOCK|POSE_LOCKED); - - /* do the bone paths */ - if (arm->pathflag & ARM_PATH_ACFRA) { - //pose_clear_paths(ob); - pose_recalculate_paths(ob); - } - - } - else { - /* tag channels that should have unkeyed data */ - for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { - if (pchan->bone->flag & BONE_TRANSFORM) { - /* tag this channel */ - pchan->bone->flag |= BONE_UNKEYED; - } - } - } -} - -/* very bad call!!! - copied from editnla.c! */ -static void recalc_all_ipos(void) -{ - Ipo *ipo; - IpoCurve *icu; - - /* Go to each ipo */ - for (ipo=G.main->ipo.first; ipo; ipo=ipo->id.next){ - for (icu = ipo->curve.first; icu; icu=icu->next){ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } - } -} - -/* inserting keys, refresh ipo-keys, softbody, redraw events... (ton) */ -/* note: transdata has been freed already! */ -void special_aftertrans_update(TransInfo *t) -{ - Object *ob; - Base *base; - short redrawipo=0, resetslowpar=1; - int cancelled= (t->state == TRANS_CANCEL); - - if (t->spacetype==SPACE_VIEW3D) - EM_automerge(1); - - if (t->spacetype == SPACE_ACTION) { - void *data; - short datatype; - - /* determine what type of data we are operating on */ - data = get_action_context(&datatype); - if (data == NULL) return; - ob = OBACT; - - if (datatype == ACTCONT_ACTION) { - /* Update the curve */ - /* Depending on the lock status, draw necessary views */ - if (ob) { - ob->ctime= -1234567.0f; - - if(ob->pose || ob_get_key(ob)) - DAG_object_flush_update(G.scene, ob, OB_RECALC); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - - remake_action_ipos((bAction *)data); - - G.saction->flag &= ~SACTION_MOVING; - } - else if (datatype == ACTCONT_SHAPEKEY) { - /* fix up the Ipocurves and redraw stuff */ - Key *key= (Key *)data; - if (key->ipo) { - IpoCurve *icu; - - for (icu = key->ipo->curve.first; icu; icu=icu->next) { - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - } - } - - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - } - } - else if (t->spacetype == SPACE_NLA) { - synchronize_action_strips(); - - /* cleanup */ - for (base=G.scene->base.first; base; base=base->next) - base->flag &= ~(BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA); - - recalc_all_ipos(); // bad - } - else if (t->spacetype == SPACE_IPO) { - // FIXME! is there any code from the old transform_ipo that needs to be added back? - - /* resetting slow-parents isn't really necessary when editing sequence ipo's */ - if (G.sipo->blocktype==ID_SEQ) - resetslowpar= 0; - } - else if (G.obedit) { - if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) - allqueue(REDRAWBUTSEDIT, 0); - - /* table needs to be created for each edit command, since vertices can move etc */ - mesh_octree_table(G.obedit, NULL, 'e'); - } - else if ((t->flag & T_POSE) && (t->poseobj)) { - bArmature *arm; - bPose *pose; - bPoseChannel *pchan; - short targetless_ik= 0; - - ob= t->poseobj; - arm= ob->data; - pose= ob->pose; - - /* this signal does one recalc on pose, then unlocks, so ESC or edit will work */ - pose->flag |= POSE_DO_UNLOCK; - - /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ - if (!cancelled && t->mode==TFM_TRANSLATION) - targetless_ik= apply_targetless_ik(ob); - else { - /* not forget to clear the auto flag */ - for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - bKinematicConstraint *data= has_targetless_ik(pchan); - if(data) data->flag &= ~CONSTRAINT_IK_AUTO; - } - } - - if (t->mode==TFM_TRANSLATION) - pose_grab_with_ik_clear(ob); - - /* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */ - if (!cancelled && (t->mode != TFM_DUMMY)) { - autokeyframe_pose_cb_func(ob, t->mode, targetless_ik); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else if (arm->flag & ARM_DELAYDEFORM) { - /* old optimize trick... this enforces to bypass the depgraph */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - ob->recalc= 0; // is set on OK position already by recalcData() - } - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) - allqueue(REDRAWBUTSEDIT, 0); - - } - else if(G.f & G_PARTICLEEDIT) { - ; - } - else { - base= FIRSTBASE; - while (base) { - - if(base->flag & BA_DO_IPO) redrawipo= 1; - - ob= base->object; - - if (modifiers_isSoftbodyEnabled(ob)) ob->softflag |= OB_SB_REDO; - - /* Set autokey if necessary */ - if ((!cancelled) && (t->mode != TFM_DUMMY) && (base->flag & SELECT)) { - autokeyframe_ob_cb_func(ob, t->mode); - } - - base= base->next; - } - - } - - clear_trans_object_base_flags(); - - if (redrawipo) { - allqueue(REDRAWNLA, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWIPO, 0); - } - - if(resetslowpar) - reset_slowparents(); - - /* note; should actually only be done for all objects when a lamp is moved... (ton) */ - if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED) - reshadeall_displist(); -} - -static void createTransObject(TransInfo *t) -{ - TransData *td = NULL; - TransDataExtension *tx; - Object *ob; - Base *base; - IpoKey *ik; - ListBase elems; - - set_trans_object_base_flags(t); - - /* count */ - for(base= FIRSTBASE; base; base= base->next) { - if TESTBASE(base) { - ob= base->object; - - /* store ipo keys? */ - if (ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { - elems.first= elems.last= NULL; - make_ipokey_transform(ob, &elems, 1); /* '1' only selected keys */ - - pushdata(&elems, sizeof(ListBase)); - - for(ik= elems.first; ik; ik= ik->next) - t->total++; - - if(elems.first==NULL) - t->total++; - } - else { - t->total++; - } - } - } - - if(!t->total) { - /* clear here, main transform function escapes too */ - clear_trans_object_base_flags(); - return; - } - - td = t->data = MEM_callocN(t->total*sizeof(TransData), "TransOb"); - tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransObExtension"); - - for(base= FIRSTBASE; base; base= base->next) { - if TESTBASE(base) { - ob= base->object; - - td->flag = TD_SELECTED; - td->protectflag= ob->protectflag; - td->ext = tx; - - /* select linked objects, but skip them later */ - if (ob->id.lib != 0) { - td->flag |= TD_SKIP; - } - - /* store ipo keys? */ - if(ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { - - popfirst(&elems); // bring back pushed listbase - - if(elems.first) { - int cfraont; - int ipoflag; - - base->flag |= BA_DO_IPO+BA_WAS_SEL; - base->flag &= ~SELECT; - - cfraont= CFRA; - set_no_parent_ipo(1); - ipoflag= ob->ipoflag; - ob->ipoflag &= ~OB_OFFS_OB; - - /* - * This is really EVIL code that pushes down Object values - * (loc, dloc, orig, size, dsize, rot, drot) - * */ - - pushdata((void*)ob->loc, 7 * 3 * sizeof(float)); // tsk! tsk! - - for(ik= elems.first; ik; ik= ik->next) { - - /* weak... this doesn't correct for floating values, giving small errors */ - CFRA= (int)(ik->val/G.scene->r.framelen); - - do_ob_ipo(ob); - ObjectToTransData(t, td, ob); // does where_is_object() - - td->flag= TD_SELECTED; - - td->tdi= MEM_callocN(sizeof(TransDataIpokey), "TransDataIpokey"); - /* also does tdi->flag and oldvals, needs to be after ob_to_transob()! */ - ipokey_to_transdata(ik, td); - - td++; - tx++; - if(ik->next) td->ext= tx; // prevent corrupting mem! - } - free_ipokey(&elems); - - poplast(ob->loc); - set_no_parent_ipo(0); - - CFRA= cfraont; - ob->ipoflag= ipoflag; - - where_is_object(ob); // restore - } - else { - ObjectToTransData(t, td, ob); - td->tdi = NULL; - td->val = NULL; - td++; - tx++; - } - } - else { - ObjectToTransData(t, td, ob); - td->tdi = NULL; - td->val = NULL; - td++; - tx++; - } - } - } -} - -void createTransData(TransInfo *t) -{ - Object *ob= OBACT; - - if (t->context == CTX_TEXTURE) { - t->flag |= T_TEXTURE; - createTransTexspace(t); - } - else if (t->context == CTX_EDGE) { - t->ext = NULL; - t->flag |= T_EDIT; - createTransEdge(t); - if(t->data && t->flag & T_PROP_EDIT) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 1); - sort_trans_data_dist(t); - } - } - else if (t->spacetype == SPACE_IMAGE) { - t->flag |= T_POINTS|T_2D_EDIT; - createTransUVs(t); - if(t->data && (t->flag & T_PROP_EDIT)) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 1); - sort_trans_data_dist(t); - } - } - else if (t->spacetype == SPACE_ACTION) { - t->flag |= T_POINTS|T_2D_EDIT; - createTransActionData(t); - } - else if (t->spacetype == SPACE_NLA) { - t->flag |= T_POINTS|T_2D_EDIT; - createTransNlaData(t); - } - else if (t->spacetype == SPACE_IPO) { - t->flag |= T_POINTS|T_2D_EDIT; - createTransIpoData(t); - if (t->data && (t->flag & T_PROP_EDIT)) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 1); - sort_trans_data_dist(t); - } - } - else if (G.obedit) { - t->ext = NULL; - if (G.obedit->type == OB_MESH) { - createTransEditVerts(t); - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - createTransCurveVerts(t); - } - else if (G.obedit->type==OB_LATTICE) { - createTransLatticeVerts(t); - } - else if (G.obedit->type==OB_MBALL) { - createTransMBallVerts(t); - } - else if (G.obedit->type==OB_ARMATURE) { - t->flag &= ~T_PROP_EDIT; - createTransArmatureVerts(t); - } - else { - printf("not done yet! only have mesh surface curve lattice mball armature\n"); - } - - if(t->data && t->flag & T_PROP_EDIT) { - if (ELEM(G.obedit->type, OB_CURVE, OB_MESH)) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 0); - sort_trans_data_dist(t); - } - else { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 1); - sort_trans_data_dist(t); - } - } - - t->flag |= T_EDIT|T_POINTS; - - /* exception... hackish, we want bonesize to use bone orientation matrix (ton) */ - if(t->mode==TFM_BONESIZE) { - t->flag &= ~(T_EDIT|T_POINTS); - t->flag |= T_POSE; - t->poseobj= ob; /* <- tsk tsk, this is going to give issues one day */ - } - } - else if (ob && (ob->flag & OB_POSEMODE)) { - createTransPose(t, OBACT); - } - else if (G.f & G_WEIGHTPAINT) { - /* exception, we look for the one selected armature */ - Base *base; - for(base=FIRSTBASE; base; base= base->next) { - if(TESTBASELIB(base)) { - if(base->object->type==OB_ARMATURE) - if(base->object->flag & OB_POSEMODE) - break; - } - } - if(base) { - createTransPose(t, base->object); - } - } - else if (G.f & G_PARTICLEEDIT && PE_can_edit(PE_get_current(ob))) { - createTransParticleVerts(t); - - if(t->data && t->flag & T_PROP_EDIT) { - sort_trans_data(t); // makes selected become first in array - set_prop_dist(t, 1); - sort_trans_data_dist(t); - } - - t->flag |= T_POINTS; - } - else { - createTransObject(t); - t->flag |= T_OBJECT; - } - - if((t->flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp>1) { - t->flag |= T_CAMERA; - } - - /* temporal...? */ - G.scene->recalc |= SCE_PRV_CHANGED; /* test for 3d preview */ -} - - - diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c deleted file mode 100644 index b24f9bea48d..00000000000 --- a/source/blender/src/transform_generics.c +++ /dev/null @@ -1,1061 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_constraint_types.h" -#include "DNA_curve_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BIF_screen.h" -#include "BIF_resources.h" -#include "BIF_mywindow.h" -#include "BIF_gl.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editmesh.h" -#include "BIF_editnla.h" -#include "BIF_editsima.h" -#include "BIF_editparticle.h" -#include "BIF_meshtools.h" -#include "BIF_retopo.h" - -#include "BSE_editipo.h" -#include "BSE_editipo_types.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_armature.h" -#include "BKE_curve.h" -#include "BKE_depsgraph.h" -#include "BKE_displist.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_group.h" -#include "BKE_ipo.h" -#include "BKE_lattice.h" -#include "BKE_key.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BSE_view.h" -#include "BSE_editaction_types.h" -#include "BDR_unwrapper.h" - -#include "BLI_arithb.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" -#include "BLI_rand.h" - -#include "blendef.h" - -#include "mydevice.h" - -#include "transform.h" - -extern ListBase editNurb; -extern ListBase editelems; - -extern TransInfo Trans; /* From transform.c */ - -/* ************************** Functions *************************** */ - - -void getViewVector(float coord[3], float vec[3]) -{ - TransInfo *t = BIF_GetTransInfo(); - - if (t->persp) - { - float p1[4], p2[4]; - - VECCOPY(p1, coord); - p1[3] = 1.0f; - VECCOPY(p2, p1); - p2[3] = 1.0f; - Mat4MulVec4fl(t->viewmat, p2); - - p2[0] = 2.0f * p2[0]; - p2[1] = 2.0f * p2[1]; - p2[2] = 2.0f * p2[2]; - - Mat4MulVec4fl(t->viewinv, p2); - - VecSubf(vec, p1, p2); - } - else { - VECCOPY(vec, t->viewinv[2]); - } - Normalize(vec); -} - -/* ************************** GENERICS **************************** */ - -static void clipMirrorModifier(TransInfo *t, Object *ob) -{ - ModifierData *md= ob->modifiers.first; - float tolerance[3] = {0.0f, 0.0f, 0.0f}; - int axis = 0; - - for (; md; md=md->next) { - if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - - if(mmd->flag & MOD_MIR_CLIPPING) { - axis = 0; - if(mmd->flag & MOD_MIR_AXIS_X) { - axis |= 1; - tolerance[0] = mmd->tolerance; - } - if(mmd->flag & MOD_MIR_AXIS_Y) { - axis |= 2; - tolerance[1] = mmd->tolerance; - } - if(mmd->flag & MOD_MIR_AXIS_Z) { - axis |= 4; - tolerance[2] = mmd->tolerance; - } - if (axis) { - float mtx[4][4], imtx[4][4]; - int i; - TransData *td = t->data; - - if (mmd->mirror_ob) { - float obinv[4][4]; - - Mat4Invert(obinv, mmd->mirror_ob->obmat); - Mat4MulMat4(mtx, ob->obmat, obinv); - Mat4Invert(imtx, mtx); - } - - for(i = 0 ; i < t->total; i++, td++) { - int clip; - float loc[3], iloc[3]; - - if (td->flag & TD_NOACTION) - break; - if (td->loc==NULL) - break; - - if (td->flag & TD_SKIP) - continue; - - VecCopyf(loc, td->loc); - VecCopyf(iloc, td->iloc); - - if (mmd->mirror_ob) { - VecMat4MulVecfl(loc, mtx, loc); - VecMat4MulVecfl(iloc, mtx, iloc); - } - - clip = 0; - if(axis & 1) { - if(fabs(iloc[0])<=tolerance[0] || - loc[0]*iloc[0]<0.0f) { - loc[0]= 0.0f; - clip = 1; - } - } - - if(axis & 2) { - if(fabs(iloc[1])<=tolerance[1] || - loc[1]*iloc[1]<0.0f) { - loc[1]= 0.0f; - clip = 1; - } - } - if(axis & 4) { - if(fabs(iloc[2])<=tolerance[2] || - loc[2]*iloc[2]<0.0f) { - loc[2]= 0.0f; - clip = 1; - } - } - if (clip) { - if (mmd->mirror_ob) { - VecMat4MulVecfl(loc, imtx, loc); - } - VecCopyf(td->loc, loc); - } - } - } - - } - } - } -} - -/* assumes G.obedit set to mesh object */ -static void editmesh_apply_to_mirror(TransInfo *t) -{ - TransData *td = t->data; - EditVert *eve; - int i; - - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_NOACTION) - break; - if (td->loc==NULL) - break; - if (td->flag & TD_SKIP) - continue; - - eve= td->tdmir; - if(eve) { - eve->co[0]= -td->loc[0]; - eve->co[1]= td->loc[1]; - eve->co[2]= td->loc[2]; - } - } -} - -/* called for updating while transform acts, once per redraw */ -void recalcData(TransInfo *t) -{ - Base *base; -#ifdef WITH_VERSE - struct TransData *td; -#endif - - if (t->spacetype == SPACE_ACTION) { - Object *ob= OBACT; - void *data; - short context; - - /* determine what type of data we are operating on */ - data = get_action_context(&context); - if (data == NULL) return; - - if (G.saction->lock) { - if (context == ACTCONT_ACTION) { - if(ob) { - ob->ctime= -1234567.0f; - if(ob->pose || ob_get_key(ob)) - DAG_object_flush_update(G.scene, ob, OB_RECALC); - else - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - } - } - else if (context == ACTCONT_SHAPEKEY) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB|OB_RECALC_DATA); - } - } - } - else if (t->spacetype == SPACE_NLA) { - if (G.snla->lock) { - for (base=G.scene->base.first; base; base=base->next) { - if (base->flag & BA_HAS_RECALC_OB) - base->object->recalc |= OB_RECALC_OB; - if (base->flag & BA_HAS_RECALC_DATA) - base->object->recalc |= OB_RECALC_DATA; - - if (base->object->recalc) - base->object->ctime= -1234567.0f; // eveil! - } - - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - } - } - else if (t->spacetype == SPACE_IPO) { - EditIpo *ei; - int dosort = 0; - int a; - - /* do the flush first */ - flushTransIpoData(t); - - /* now test if there is a need to re-sort */ - ei= G.sipo->editipo; - for (a=0; atotipo; a++, ei++) { - if (ISPOIN(ei, flag & IPO_VISIBLE, icu)) { - - /* watch it: if the time is wrong: do not correct handles */ - if (test_time_ipocurve(ei->icu)) dosort++; - else testhandles_ipocurve(ei->icu); - } - } - - /* do resort and other updates? */ - if (dosort) remake_ipo_transdata(t); - if (G.sipo->showkey) update_ipokey_val(); - - calc_ipo(G.sipo->ipo, (float)CFRA); - - /* update realtime - not working? */ - if (G.sipo->lock) { - if (G.sipo->blocktype==ID_MA || G.sipo->blocktype==ID_TE) { - do_ipo(G.sipo->ipo); - } - else if(G.sipo->blocktype==ID_CA) { - do_ipo(G.sipo->ipo); - } - else if(G.sipo->blocktype==ID_KE) { - Object *ob= OBACT; - if(ob) { - ob->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - else if(G.sipo->blocktype==ID_PO) { - Object *ob= OBACT; - if(ob && ob->pose) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - } - else if(G.sipo->blocktype==ID_OB) { - Base *base= FIRSTBASE; - - while(base) { - if(base->object->ipo==G.sipo->ipo) { - do_ob_ipo(base->object); - base->object->recalc |= OB_RECALC_OB; - } - base= base->next; - } - DAG_scene_flush_update(G.scene, screen_view3d_layers()); - } - } - } - else if (G.obedit) { - if (G.obedit->type == OB_MESH) { - if(t->spacetype==SPACE_IMAGE) { - flushTransUVs(t); - if (G.sima->flag & SI_LIVE_UNWRAP) - unwrap_lscm_live_re_solve(); - } else { - - retopo_do_all(); - - /* mirror modifier clipping? */ - if(t->state != TRANS_CANCEL) - clipMirrorModifier(t, G.obedit); - - if((t->context & CTX_NO_MIRROR) == 0 && (G.scene->toolsettings->editbutflag & B_MESH_X_MIRROR)) - editmesh_apply_to_mirror(t); - - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */ - - recalc_editnormals(); - } - } - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) { - Nurb *nu= editNurb.first; - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */ - - while(nu) { - test2DNurb(nu); - testhandlesNurb(nu); /* test for bezier too */ - nu= nu->next; - } - - retopo_do_all(); - } - else if(G.obedit->type==OB_ARMATURE){ /* no recalc flag, does pose */ - bArmature *arm= G.obedit->data; - EditBone *ebo; - - /* Ensure all bones are correctly adjusted */ - for (ebo=G.edbo.first; ebo; ebo=ebo->next){ - - if ((ebo->flag & BONE_CONNECTED) && ebo->parent){ - /* If this bone has a parent tip that has been moved */ - if (ebo->parent->flag & BONE_TIPSEL){ - VECCOPY (ebo->head, ebo->parent->tail); - if(t->mode==TFM_BONE_ENVELOPE) ebo->rad_head= ebo->parent->rad_tail; - } - /* If this bone has a parent tip that has NOT been moved */ - else{ - VECCOPY (ebo->parent->tail, ebo->head); - if(t->mode==TFM_BONE_ENVELOPE) ebo->parent->rad_tail= ebo->rad_head; - } - } - - /* on extrude bones, oldlength==0.0f, so we scale radius of points */ - ebo->length= VecLenf(ebo->head, ebo->tail); - if(ebo->oldlength==0.0f) { - ebo->rad_head= 0.25f*ebo->length; - ebo->rad_tail= 0.10f*ebo->length; - ebo->dist= 0.25f*ebo->length; - if(ebo->parent) { - if(ebo->rad_head > ebo->parent->rad_tail) - ebo->rad_head= ebo->parent->rad_tail; - } - } - else if(t->mode!=TFM_BONE_ENVELOPE) { - /* if bones change length, lets do that for the deform distance as well */ - ebo->dist*= ebo->length/ebo->oldlength; - ebo->rad_head*= ebo->length/ebo->oldlength; - ebo->rad_tail*= ebo->length/ebo->oldlength; - ebo->oldlength= ebo->length; - } - } - if(arm->flag & ARM_MIRROR_EDIT) - transform_armature_mirror_update(); - - } - else if(G.obedit->type==OB_LATTICE) { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */ - - if(editLatt->flag & LT_OUTSIDE) outside_lattice(editLatt); - } - else { - DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA); /* sets recalc flags */ - } - } - else if( (t->flag & T_POSE) && t->poseobj) { - Object *ob= t->poseobj; - bArmature *arm= ob->data; - - /* old optimize trick... this enforces to bypass the depgraph */ - if (!(arm->flag & ARM_DELAYDEFORM)) { - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); /* sets recalc flags */ - - /* bah, softbody exception... recalcdata doesnt reset */ - for(base= FIRSTBASE; base; base= base->next) { - if(base->object->recalc & OB_RECALC_DATA) - if(modifiers_isSoftbodyEnabled(base->object)) { - base->object->softflag |= OB_SB_REDO; - } - } - } - else - where_is_pose(ob); - } - else if(G.f & G_PARTICLEEDIT) { - flushTransParticles(t); - } - else { - for(base= FIRSTBASE; base; base= base->next) { - Object *ob= base->object; - - /* this flag is from depgraph, was stored in nitialize phase, handled in drawview.c */ - if(base->flag & BA_HAS_RECALC_OB) - ob->recalc |= OB_RECALC_OB; - if(base->flag & BA_HAS_RECALC_DATA) - ob->recalc |= OB_RECALC_DATA; - - /* thanks to ob->ctime usage, ipos are not called in where_is_object, - unless we edit ipokeys */ - if(base->flag & BA_DO_IPO) { - if(ob->ipo) { - IpoCurve *icu; - - ob->ctime= -1234567.0; - - icu= ob->ipo->curve.first; - while(icu) { - calchandles_ipocurve(icu); - icu= icu->next; - } - } - } - - /* softbody exception */ - if(modifiers_isSoftbodyEnabled(ob)) { - if(ob->recalc & OB_RECALC_DATA) - ob->softflag |= OB_SB_REDO; - } - - /* proxy exception */ - if(ob->proxy) - ob->proxy->recalc |= ob->recalc; - if(ob->proxy_group) - group_tag_recalc(ob->proxy_group->dup_group); - } - } - -#ifdef WITH_VERSE - for (td = t->data; td < t->data + t->total; td++) { - if(td->flag & TD_VERSE_VERT) { - if(td->verse) - send_versevert_pos((VerseVert*)td->verse); - } - else if(td->flag & TD_VERSE_OBJECT) - if(td->verse) b_verse_send_transformation((Object*)td->verse); - } -#endif - - /* update shaded drawmode while transform */ - if(t->spacetype==SPACE_VIEW3D && G.vd->drawtype == OB_SHADED) - reshadeall_displist(); - -} - -void drawLine(float *center, float *dir, char axis, short options) -{ - extern void make_axis_color(char *col, char *col2, char axis); // drawview.c - float v1[3], v2[3], v3[3]; - char col[3], col2[3]; - - //if(G.obedit) mymultmatrix(G.obedit->obmat); // sets opengl viewing - - VecCopyf(v3, dir); - VecMulf(v3, G.vd->far); - - VecSubf(v2, center, v3); - VecAddf(v1, center, v3); - - if (options & DRAWLIGHT) { - col[0] = col[1] = col[2] = 220; - } - else { - BIF_GetThemeColor3ubv(TH_GRID, col); - } - make_axis_color(col, col2, axis); - glColor3ubv((GLubyte *)col2); - - setlinestyle(0); - glBegin(GL_LINE_STRIP); - glVertex3fv(v1); - glVertex3fv(v2); - glEnd(); - - myloadmatrix(G.vd->viewmat); -} - -void initTrans (TransInfo *t) -{ - /* moving: is shown in drawobject() (transform color) */ - if(G.obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT; - else if(G.f & G_PARTICLEEDIT) G.moving= G_TRANSFORM_PARTICLE; - else G.moving= G_TRANSFORM_OBJ; - - t->data = NULL; - t->ext = NULL; - - t->flag = 0; - t->num.flag = 0; - - - /* setting PET flag */ - if ((t->context & CTX_NO_PET) == 0 && (G.scene->proportional)) { - t->flag |= T_PROP_EDIT; - if(G.scene->proportional==2) t->flag |= T_PROP_CONNECTED; // yes i know, has to become define - } - - getmouseco_areawin(t->imval); - t->con.imval[0] = t->imval[0]; - t->con.imval[1] = t->imval[1]; - - t->transform = NULL; - t->handleEvent = NULL; - t->customData = NULL; - - t->total = - t->num.idx = - t->num.idx_max = - t->num.ctrl[0] = - t->num.ctrl[1] = - t->num.ctrl[2] = 0; - - t->val = 0.0f; - - t->num.val[0] = - t->num.val[1] = - t->num.val[2] = 0.0f; - - t->vec[0] = - t->vec[1] = - t->vec[2] = 0.0f; - - t->center[0] = - t->center[1] = - t->center[2] = 0.0f; - - Mat3One(t->mat); - - t->spacetype = curarea->spacetype; - if(t->spacetype==SPACE_VIEW3D) { - if(G.vd->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN; - t->around = G.vd->around; - } else if(t->spacetype==SPACE_IMAGE) { - t->around = G.v2d->around; - } - else - t->around = V3D_CENTER; - - setTransformViewMatrices(t); -} - -/* Here I would suggest only TransInfo related issues, like free data & reset vars. Not redraws */ -void postTrans (TransInfo *t) -{ - TransData *td; - - G.moving = 0; // Set moving flag off (display as usual) -#ifdef WITH_VERSE - - for (td = t->data; td < t->data + t->total; td++) { - if(td->flag & TD_VERSE_VERT) { - if(td->verse) send_versevert_pos((VerseVert*)td->verse); - } - else if(td->flag & TD_VERSE_OBJECT) { - if(td->verse) { - struct VNode *vnode; - vnode = (VNode*)((Object*)td->verse)->vnode; - ((VObjectData*)vnode->data)->flag |= POS_SEND_READY; - ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY; - ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY; - b_verse_send_transformation((Object*)td->verse); - } - } - } -#endif - - stopConstraint(t); - - /* postTrans can be called when nothing is selected, so data is NULL already */ - if (t->data) { - int a; - - /* since ipokeys are optional on objects, we mallocced them per trans-data */ - for(a=0, td= t->data; atotal; a++, td++) { - if(td->tdi) MEM_freeN(td->tdi); - } - MEM_freeN(t->data); - } - - if (t->ext) MEM_freeN(t->ext); - if (t->data2d) { - MEM_freeN(t->data2d); - t->data2d= NULL; - } - - if ((t->flag & T_FREE_CUSTOMDATA) && t->customData != NULL) { - MEM_freeN(t->customData); - } - - if(t->spacetype==SPACE_IMAGE) { - if (G.sima->flag & SI_LIVE_UNWRAP) - unwrap_lscm_live_end(t->state == TRANS_CANCEL); - } -} - -void applyTransObjects(TransInfo *t) -{ - TransData *td; - - for (td = t->data; td < t->data + t->total; td++) { - VECCOPY(td->iloc, td->loc); - if (td->ext->rot) { - VECCOPY(td->ext->irot, td->ext->rot); - } - if (td->ext->size) { - VECCOPY(td->ext->isize, td->ext->size); - } - } - recalcData(t); -} - -/* helper for below */ -static void restore_ipokey(float *poin, float *old) -{ - if(poin) { - poin[0]= old[0]; - poin[-3]= old[3]; - poin[3]= old[6]; - } -} - -static void restoreElement(TransData *td) { - /* TransData for crease has no loc */ - if (td->loc) { - VECCOPY(td->loc, td->iloc); - } - if (td->val) { - *td->val = td->ival; - } - if (td->ext && (td->flag&TD_NO_EXT)==0) { - if (td->ext->rot) { - VECCOPY(td->ext->rot, td->ext->irot); - } - if (td->ext->size) { - VECCOPY(td->ext->size, td->ext->isize); - } - if(td->flag & TD_USEQUAT) { - if (td->ext->quat) { - QUATCOPY(td->ext->quat, td->ext->iquat); - } - } - } - if(td->tdi) { - TransDataIpokey *tdi= td->tdi; - - restore_ipokey(tdi->locx, tdi->oldloc); - restore_ipokey(tdi->locy, tdi->oldloc+1); - restore_ipokey(tdi->locz, tdi->oldloc+2); - - restore_ipokey(tdi->rotx, tdi->oldrot); - restore_ipokey(tdi->roty, tdi->oldrot+1); - restore_ipokey(tdi->rotz, tdi->oldrot+2); - - restore_ipokey(tdi->sizex, tdi->oldsize); - restore_ipokey(tdi->sizey, tdi->oldsize+1); - restore_ipokey(tdi->sizez, tdi->oldsize+2); - } -} - -void restoreTransObjects(TransInfo *t) -{ - TransData *td; - - for (td = t->data; td < t->data + t->total; td++) { - restoreElement(td); -#ifdef WITH_VERSE - /* position of vertexes and object transformation matrix is sent - * extra, becuase blender uses synchronous sending of vertexes - * position as well object trans. matrix and it isn't possible to - * send it in recalcData sometimes */ - if(td->flag & TD_VERSE_VERT) { - if(td->verse) { - ((VerseVert*)td->verse)->flag |= VERT_POS_OBSOLETE; - } - } - else if(td->flag & TD_VERSE_OBJECT) - if(td->verse) { - struct VNode *vnode; - vnode = (VNode*)((Object*)td->verse)->vnode; - ((VObjectData*)vnode->data)->flag |= POS_SEND_READY; - ((VObjectData*)vnode->data)->flag |= ROT_SEND_READY; - ((VObjectData*)vnode->data)->flag |= SCALE_SEND_READY; - } -#endif - } - recalcData(t); -} - -void calculateCenter2D(TransInfo *t) -{ - if (t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - float vec[3]; - - VECCOPY(vec, t->center); - Mat4MulVecfl(ob->obmat, vec); - projectIntView(t, vec, t->center2d); - } - else { - projectIntView(t, t->center, t->center2d); - } -} - -void calculateCenterCursor(TransInfo *t) -{ - float *cursor; - - cursor = give_cursor(); - VECCOPY(t->center, cursor); - - /* If edit or pose mode, move cursor in local space */ - if (t->flag & (T_EDIT|T_POSE)) { - Object *ob = G.obedit?G.obedit:t->poseobj; - float mat[3][3], imat[3][3]; - - VecSubf(t->center, t->center, ob->obmat[3]); - Mat3CpyMat4(mat, ob->obmat); - Mat3Inv(imat, mat); - Mat3MulVecfl(imat, t->center); - } - - calculateCenter2D(t); -} - -void calculateCenterCursor2D(TransInfo *t) -{ - float aspx=1.0, aspy=1.0; - - if(t->spacetype==SPACE_IMAGE) /* only space supported right now but may change */ - transform_aspect_ratio_tface_uv(&aspx, &aspy); - if (G.v2d) { - t->center[0] = G.v2d->cursor[0] * aspx; - t->center[1] = G.v2d->cursor[1] * aspy; - } - calculateCenter2D(t); -} - -void calculateCenterMedian(TransInfo *t) -{ - float partial[3] = {0.0f, 0.0f, 0.0f}; - int i; - - for(i = 0; i < t->total; i++) { - if (t->data[i].flag & TD_SELECTED) { - if (!(t->data[i].flag & TD_NOCENTER)) - VecAddf(partial, partial, t->data[i].center); - } - else { - /* - All the selected elements are at the head of the array - which means we can stop when it finds unselected data - */ - break; - } - } - if(i) - VecMulf(partial, 1.0f / i); - VECCOPY(t->center, partial); - - calculateCenter2D(t); -} - -void calculateCenterBound(TransInfo *t) -{ - float max[3]; - float min[3]; - int i; - for(i = 0; i < t->total; i++) { - if (i) { - if (t->data[i].flag & TD_SELECTED) { - if (!(t->data[i].flag & TD_NOCENTER)) - MinMax3(min, max, t->data[i].center); - } - else { - /* - All the selected elements are at the head of the array - which means we can stop when it finds unselected data - */ - break; - } - } - else { - VECCOPY(max, t->data[i].center); - VECCOPY(min, t->data[i].center); - } - } - VecAddf(t->center, min, max); - VecMulf(t->center, 0.5); - - calculateCenter2D(t); -} - -void calculateCenter(TransInfo *t) -{ - switch(t->around) { - case V3D_CENTER: - calculateCenterBound(t); - break; - case V3D_CENTROID: - calculateCenterMedian(t); - break; - case V3D_CURSOR: - if(t->spacetype==SPACE_IMAGE) - calculateCenterCursor2D(t); - else - calculateCenterCursor(t); - break; - case V3D_LOCAL: - /* Individual element center uses median center for helpline and such */ - calculateCenterMedian(t); - break; - case V3D_ACTIVE: - /* set median, and if if if... do object center */ - - /* EDIT MODE ACTIVE EDITMODE ELEMENT */ - if (G.obedit && G.obedit->type == OB_MESH && G.editMesh->selected.last) { - EM_editselection_center(t->center, G.editMesh->selected.last); - calculateCenter2D(t); - break; - } /* END EDIT MODE ACTIVE ELEMENT */ - - calculateCenterMedian(t); - if((t->flag & (T_EDIT|T_POSE))==0) { - Object *ob= OBACT; - if(ob) { - VECCOPY(t->center, ob->obmat[3]); - projectIntView(t, t->center, t->center2d); - } - } - } - - /* setting constraint center */ - VECCOPY(t->con.center, t->center); - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, t->con.center); - } - - /* voor panning from cameraview */ - if(t->flag & T_OBJECT) { - if( G.vd->camera==OBACT && G.vd->persp>1) { - float axis[3]; - /* persinv is nasty, use viewinv instead, always right */ - VECCOPY(axis, t->viewinv[2]); - Normalize(axis); - - /* 6.0 = 6 grid units */ - axis[0]= t->center[0]- 6.0f*axis[0]; - axis[1]= t->center[1]- 6.0f*axis[1]; - axis[2]= t->center[2]- 6.0f*axis[2]; - - projectIntView(t, axis, t->center2d); - - /* rotate only needs correct 2d center, grab needs initgrabz() value */ - if(t->mode==TFM_TRANSLATION) { - VECCOPY(t->center, axis); - VECCOPY(t->con.center, t->center); - } - } - } - - if(t->spacetype==SPACE_VIEW3D) - initgrabz(t->center[0], t->center[1], t->center[2]); -} - -void calculatePropRatio(TransInfo *t) -{ - TransData *td = t->data; - int i; - float dist; - short connected = t->flag & T_PROP_CONNECTED; - - if (t->flag & T_PROP_EDIT) { - for(i = 0 ; i < t->total; i++, td++) { - if (td->flag & TD_SELECTED) { - td->factor = 1.0f; - } - else if ((connected && - (td->flag & TD_NOTCONNECTED || td->dist > t->propsize)) - || - (connected == 0 && - td->rdist > t->propsize)) { - /* - The elements are sorted according to their dist member in the array, - that means we can stop when it finds one element outside of the propsize. - */ - td->flag |= TD_NOACTION; - td->factor = 0.0f; - restoreElement(td); - } - else { - /* Use rdist for falloff calculations, it is the real distance */ - td->flag &= ~TD_NOACTION; - dist= (t->propsize-td->rdist)/t->propsize; - - /* - * Clamp to positive numbers. - * Certain corner cases with connectivity and individual centers - * can give values of rdist larger than propsize. - */ - if (dist < 0.0f) - dist = 0.0f; - - switch(G.scene->prop_mode) { - case PROP_SHARP: - td->factor= dist*dist; - break; - case PROP_SMOOTH: - td->factor= 3.0f*dist*dist - 2.0f*dist*dist*dist; - break; - case PROP_ROOT: - td->factor = (float)sqrt(dist); - break; - case PROP_LIN: - td->factor = dist; - break; - case PROP_CONST: - td->factor = 1.0f; - break; - case PROP_SPHERE: - td->factor = (float)sqrt(2*dist - dist * dist); - break; - case PROP_RANDOM: - BLI_srand( BLI_rand() ); /* random seed */ - td->factor = BLI_frand()*dist; - break; - default: - td->factor = 1; - } - } - } - switch(G.scene->prop_mode) { - case PROP_SHARP: - strcpy(t->proptext, "(Sharp)"); - break; - case PROP_SMOOTH: - strcpy(t->proptext, "(Smooth)"); - break; - case PROP_ROOT: - strcpy(t->proptext, "(Root)"); - break; - case PROP_LIN: - strcpy(t->proptext, "(Linear)"); - break; - case PROP_CONST: - strcpy(t->proptext, "(Constant)"); - break; - case PROP_SPHERE: - strcpy(t->proptext, "(Sphere)"); - break; - case PROP_RANDOM: - strcpy(t->proptext, "(Random)"); - break; - default: - strcpy(t->proptext, ""); - } - } - else { - for(i = 0 ; i < t->total; i++, td++) { - td->factor = 1.0; - } - strcpy(t->proptext, ""); - } -} - -TransInfo * BIF_GetTransInfo() { - return &Trans; -} - diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c deleted file mode 100644 index 7a6d4c69442..00000000000 --- a/source/blender/src/transform_manipulator.c +++ /dev/null @@ -1,1720 +0,0 @@ -/** -* $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2005 Blender Foundation - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_armature_types.h" -#include "DNA_action_types.h" -#include "DNA_curve_types.h" -#include "DNA_lattice_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meta_types.h" -#include "DNA_object_types.h" -#include "DNA_particle_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_armature.h" -#include "BKE_global.h" -#include "BKE_lattice.h" -#include "BKE_object.h" -#include "BKE_particle.h" -#include "BKE_utildefines.h" - -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BIF_editarmature.h" -#include "BIF_gl.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_transform.h" -#include "BIF_editmesh.h" -#include "BIF_editparticle.h" - -#include "BSE_edit.h" -#include "BSE_view.h" -#include "BDR_drawobject.h" - -#include "blendef.h" -#include "transform.h" - -/* return codes for select, and drawing flags */ - -#define MAN_TRANS_X 1 -#define MAN_TRANS_Y 2 -#define MAN_TRANS_Z 4 -#define MAN_TRANS_C 7 - -#define MAN_ROT_X 8 -#define MAN_ROT_Y 16 -#define MAN_ROT_Z 32 -#define MAN_ROT_V 64 -#define MAN_ROT_T 128 -#define MAN_ROT_C 248 - -#define MAN_SCALE_X 256 -#define MAN_SCALE_Y 512 -#define MAN_SCALE_Z 1024 -#define MAN_SCALE_C 1792 - -/* color codes */ - -#define MAN_RGB 0 -#define MAN_GHOST 1 -#define MAN_MOVECOL 2 - -/* GLOBAL VARIABLE THAT SHOULD MOVED TO SCREEN MEMBER OR SOMETHING */ -extern TransInfo Trans; - - -static int is_mat4_flipped(float mat[][4]) -{ - float vec[3]; - - Crossf(vec, mat[0], mat[1]); - if( Inpf(vec, mat[2]) < 0.0 ) return 1; - return 0; -} - -/* transform widget center calc helper for below */ -static void calc_tw_center(float *co) -{ - float *twcent= G.scene->twcent; - float *min= G.scene->twmin; - float *max= G.scene->twmax; - - DO_MINMAX(co, min, max); - VecAddf(twcent, twcent, co); -} - -static void protectflag_to_drawflags(short protectflag, short *drawflags) -{ - if(protectflag & OB_LOCK_LOCX) - *drawflags &= ~MAN_TRANS_X; - if(protectflag & OB_LOCK_LOCY) - *drawflags &= ~MAN_TRANS_Y; - if(protectflag & OB_LOCK_LOCZ) - *drawflags &= ~MAN_TRANS_Z; - - if(protectflag & OB_LOCK_ROTX) - *drawflags &= ~MAN_ROT_X; - if(protectflag & OB_LOCK_ROTY) - *drawflags &= ~MAN_ROT_Y; - if(protectflag & OB_LOCK_ROTZ) - *drawflags &= ~MAN_ROT_Z; - - if(protectflag & OB_LOCK_SCALEX) - *drawflags &= ~MAN_SCALE_X; - if(protectflag & OB_LOCK_SCALEY) - *drawflags &= ~MAN_SCALE_Y; - if(protectflag & OB_LOCK_SCALEZ) - *drawflags &= ~MAN_SCALE_Z; -} - -/* for pose mode */ -static void stats_pose(View3D *v3d, bPoseChannel *pchan, float *normal, float *plane) -{ - Bone *bone= pchan->bone; - - if(bone) { - if (bone->flag & BONE_TRANSFORM) { - calc_tw_center(pchan->pose_head); - protectflag_to_drawflags(pchan->protectflag, &v3d->twdrawflag); - - VecAddf(normal, normal, pchan->pose_mat[2]); - VecAddf(plane, plane, pchan->pose_mat[1]); - } - } -} - -/* only counts the parent selection, and tags transform flag */ -/* bad call... should re-use method from transform_conversion once */ -static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it) -{ - Bone *bone; - int do_next; - - for(bone= lb->first; bone; bone= bone->next) { - bone->flag &= ~BONE_TRANSFORM; - do_next= do_it; - if(do_it) { - if(bone->layer & arm->layer) { - if (bone->flag & BONE_SELECTED) { - /* We don't let connected children get "grabbed" */ - if ( (t->mode!=TFM_TRANSLATION) || (bone->flag & BONE_CONNECTED)==0 ) { - bone->flag |= BONE_TRANSFORM; - t->total++; - do_next= 0; // no transform on children if one parent bone is selected - } - } - } - } - count_bone_select(t, arm, &bone->childbase, do_next); - } -} - -/* centroid, boundbox, of selection */ -/* returns total items selected */ -int calc_manipulator_stats(ScrArea *sa) -{ - extern ListBase editNurb; - TransInfo *t; - View3D *v3d= sa->spacedata.first; - Base *base; - Object *ob= OBACT; - float normal[3]={0.0, 0.0, 0.0}; - float plane[3]={0.0, 0.0, 0.0}; - int a, totsel=0; - - t = BIF_GetTransInfo(); - - /* transform widget matrix */ - Mat4One(v3d->twmat); - - v3d->twdrawflag= 0xFFFF; - - /* transform widget centroid/center */ - G.scene->twcent[0]= G.scene->twcent[1]= G.scene->twcent[2]= 0.0f; - INIT_MINMAX(G.scene->twmin, G.scene->twmax); - - if(G.obedit) { - ob= G.obedit; - if((ob->lay & G.vd->lay)==0) return 0; - - if(G.obedit->type==OB_MESH) { - EditMesh *em = G.editMesh; - EditVert *eve; - float vec[3]= {0,0,0}; - int no_faces= 1; - - /* USE LAST SELECTE WITH ACTIVE */ - if (G.vd->around==V3D_ACTIVE && em->selected.last) { - EM_editselection_center(vec, em->selected.last); - calc_tw_center(vec); - totsel= 1; - if (v3d->twmode == V3D_MANIP_NORMAL) { - EM_editselection_normal(normal, em->selected.last); - EM_editselection_plane(plane, em->selected.last); - } /* NORMAL OPERATION */ - } else { - if(v3d->twmode == V3D_MANIP_NORMAL) { - EditFace *efa; - - for(efa= em->faces.first; efa; efa= efa->next) { - if(efa->f & SELECT) { - no_faces= 0; - VECADD(normal, normal, efa->n); - VecSubf(vec, efa->v2->co, efa->v1->co); - VECADD(plane, plane, vec); - } - } - } - - /* do vertices for center, and if still no normal found, use vertex normals */ - for(eve= em->verts.first; eve; eve= eve->next) { - if(eve->f & SELECT) { - if(no_faces) VECADD(normal, normal, eve->no); - - totsel++; - calc_tw_center(eve->co); - } - } - /* the edge case... */ - if(no_faces && v3d->twmode == V3D_MANIP_NORMAL) { - EditEdge *eed; - - for(eed= em->edges.first; eed; eed= eed->next) { - if(eed->f & SELECT) { - /* ok we got an edge, only use one, and as normal */ - VECCOPY(plane, normal); - VecSubf(normal, eed->v2->co, eed->v1->co); - break; - } - } - } - } - } /* end editmesh */ - else if (G.obedit->type==OB_ARMATURE){ - bArmature *arm= G.obedit->data; - EditBone *ebo; - for (ebo=G.edbo.first;ebo;ebo=ebo->next){ - if(ebo->layer & arm->layer) { - if (ebo->flag & BONE_TIPSEL) { - calc_tw_center(ebo->tail); - totsel++; - } - if (ebo->flag & BONE_ROOTSEL) { - calc_tw_center(ebo->head); - totsel++; - } - } - } - } - else if ELEM3(G.obedit->type, OB_CURVE, OB_SURF, OB_FONT) { - Nurb *nu; - BezTriple *bezt; - BPoint *bp; - - nu= editNurb.first; - while(nu) { - if((nu->type & 7)==CU_BEZIER) { - bezt= nu->bezt; - a= nu->pntsu; - while(a--) { - /* exception */ - if( (bezt->f1 & SELECT) + (bezt->f2 & SELECT) + (bezt->f3 & SELECT) > SELECT ) { - calc_tw_center(bezt->vec[1]); - totsel++; - VecSubf(normal, bezt->vec[0], bezt->vec[2]); - } - else { - if(bezt->f1) { - calc_tw_center(bezt->vec[0]); - VecSubf(normal, bezt->vec[0], bezt->vec[1]); - totsel++; - } - if(bezt->f2) { - calc_tw_center(bezt->vec[1]); - VecSubf(normal, bezt->vec[0], bezt->vec[2]); - totsel++; - } - if(bezt->f3) { - calc_tw_center(bezt->vec[2]); - VecSubf(normal, bezt->vec[1], bezt->vec[2]); - totsel++; - } - } - bezt++; - } - } - else { - bp= nu->bp; - a= nu->pntsu*nu->pntsv; - while(a--) { - if(bp->f1 & SELECT) { - calc_tw_center(bp->vec); - totsel++; - } - bp++; - } - } - nu= nu->next; - } - } - else if(G.obedit->type==OB_MBALL) { - /* editmball.c */ - extern ListBase editelems; /* go away ! */ - MetaElem *ml, *ml_sel=NULL; - - ml= editelems.first; - while(ml) { - if(ml->flag & SELECT) { - calc_tw_center(&ml->x); - ml_sel = ml; - totsel++; - } - ml= ml->next; - } - /* normal manipulator */ - if(totsel==1){ - float mat1[4][4]; - - /* Rotation of MetaElem is stored in quat */ - QuatToMat4(ml_sel->quat, mat1); - - /* Translation of MetaElem */ - mat1[3][0]= ml_sel->x; - mat1[3][1]= ml_sel->y; - mat1[3][2]= ml_sel->z; - - VECCOPY(normal, mat1[2]); - VECCOPY(plane, mat1[1]); - - VecMulf(plane, -1.0); - } - } - else if(G.obedit->type==OB_LATTICE) { - BPoint *bp; - bp= editLatt->def; - - a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw; - while(a--) { - if(bp->f1 & SELECT) { - calc_tw_center(bp->vec); - totsel++; - } - bp++; - } - } - - /* selection center */ - if(totsel) { - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - Mat4MulVecfl(G.obedit->obmat, G.scene->twcent); - Mat4MulVecfl(G.obedit->obmat, G.scene->twmin); - Mat4MulVecfl(G.obedit->obmat, G.scene->twmax); - } - } - else if(ob && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; - bPoseChannel *pchan; - int mode; - - if((ob->lay & G.vd->lay)==0) return 0; - - mode= Trans.mode; - Trans.mode= TFM_ROTATION; // mislead counting bones... bah - - /* count total, we use same method as transform will do */ - Trans.total= 0; - count_bone_select(&Trans, arm, &arm->bonebase, 1); - totsel= Trans.total; - if(totsel) { - /* use channels to get stats */ - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - stats_pose(v3d, pchan, normal, plane); - } - //VecMulf(normal, -1.0); - VecMulf(plane, -1.0); - - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - Mat4MulVecfl(ob->obmat, G.scene->twcent); - Mat4MulVecfl(ob->obmat, G.scene->twmin); - Mat4MulVecfl(ob->obmat, G.scene->twmax); - } - /* restore, mode can be TFM_INIT */ - Trans.mode= mode; - } - else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) { - ; - } - else if(G.f & G_PARTICLEEDIT) { - ParticleSystem *psys=PE_get_current(OBACT); - ParticleData *pa = psys->particles; - ParticleEditKey *ek; - int k; - - if(psys->edit){ - for(a=0; atotpart; a++,pa++){ - if(pa->flag & PARS_HIDE) continue; - for(k=0, ek=psys->edit->keys[a]; ktotkey; k++,ek++){ - if(ek->flag & PEK_SELECT){ - calc_tw_center(ek->world_co); - totsel++; - } - } - } - /* selection center */ - if(totsel) - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - } - } - else { - - /* we need the one selected object, if its not active */ - ob= OBACT; - if(ob && !(ob->flag & SELECT)) ob= NULL; - - for(base= G.scene->base.first; base; base= base->next) { - if TESTBASELIB(base) { - if(ob==NULL) - ob= base->object; - calc_tw_center(base->object->obmat[3]); - protectflag_to_drawflags(base->object->protectflag, &v3d->twdrawflag); - totsel++; - } - } - - /* selection center */ - if(totsel) { - VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! - } - } - - /* global, local or normal orientation? */ - if(ob && totsel) { - - switch(v3d->twmode) { - case V3D_MANIP_GLOBAL: - strcpy(t->spacename, "global"); - break; - - case V3D_MANIP_NORMAL: - if(G.obedit || (ob->flag & OB_POSEMODE)) { - strcpy(t->spacename, "normal"); - if(normal[0]!=0.0 || normal[1]!=0.0 || normal[2]!=0.0) { - float imat[3][3], mat[3][3]; - - /* we need the transpose of the inverse for a normal... */ - Mat3CpyMat4(imat, ob->obmat); - - Mat3Inv(mat, imat); - Mat3Transp(mat); - Mat3MulVecfl(mat, normal); - Mat3MulVecfl(mat, plane); - - Normalize(normal); - if(0.0==Normalize(plane)) VECCOPY(plane, mat[1]); - - VECCOPY(mat[2], normal); - Crossf(mat[0], normal, plane); - Crossf(mat[1], mat[2], mat[0]); - - Mat4CpyMat3(v3d->twmat, mat); - Mat4Ortho(v3d->twmat); - - break; - } - } - /* no break we define 'normal' as 'local' in Object mode */ - case V3D_MANIP_LOCAL: - strcpy(t->spacename, "local"); - Mat4CpyMat4(v3d->twmat, ob->obmat); - Mat4Ortho(v3d->twmat); - break; - - case V3D_MANIP_VIEW: - { - float mat[3][3]; - strcpy(t->spacename, "view"); - Mat3CpyMat4(mat, v3d->viewinv); - Mat3Ortho(mat); - Mat4CpyMat3(v3d->twmat, mat); - } - break; - } - - } - - return totsel; -} - -/* ******************** DRAWING STUFFIES *********** */ - -static float screen_aligned(float mat[][4]) -{ - float vec[3], size; - - VECCOPY(vec, mat[0]); - size= Normalize(vec); - - glTranslatef(mat[3][0], mat[3][1], mat[3][2]); - - /* sets view screen aligned */ - glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); - - return size; -} - - -/* radring = radius of donut rings - radhole = radius hole - start = starting segment (based on nrings) - end = end segment - nsides = amount of points in ring - nrigns = amount of rings -*/ -static void partial_donut(float radring, float radhole, int start, int end, int nsides, int nrings) -{ - float theta, phi, theta1; - float cos_theta, sin_theta; - float cos_theta1, sin_theta1; - float ring_delta, side_delta; - int i, j, docaps= 1; - - if(start==0 && end==nrings) docaps= 0; - - ring_delta= 2.0f*(float)M_PI/(float)nrings; - side_delta= 2.0f*(float)M_PI/(float)nsides; - - theta= (float)M_PI+0.5f*ring_delta; - cos_theta= (float)cos(theta); - sin_theta= (float)sin(theta); - - for(i= nrings - 1; i >= 0; i--) { - theta1= theta + ring_delta; - cos_theta1= (float)cos(theta1); - sin_theta1= (float)sin(theta1); - - if(docaps && i==start) { // cap - glBegin(GL_POLYGON); - phi= 0.0; - for(j= nsides; j >= 0; j--) { - float cos_phi, sin_phi, dist; - - phi += side_delta; - cos_phi= (float)cos(phi); - sin_phi= (float)sin(phi); - dist= radhole + radring * cos_phi; - - glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi); - } - glEnd(); - } - if(i>=start && i<=end) { - glBegin(GL_QUAD_STRIP); - phi= 0.0; - for(j= nsides; j >= 0; j--) { - float cos_phi, sin_phi, dist; - - phi += side_delta; - cos_phi= (float)cos(phi); - sin_phi= (float)sin(phi); - dist= radhole + radring * cos_phi; - - glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi); - glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi); - } - glEnd(); - } - - if(docaps && i==end) { // cap - glBegin(GL_POLYGON); - phi= 0.0; - for(j= nsides; j >= 0; j--) { - float cos_phi, sin_phi, dist; - - phi -= side_delta; - cos_phi= (float)cos(phi); - sin_phi= (float)sin(phi); - dist= radhole + radring * cos_phi; - - glVertex3f(cos_theta * dist, -sin_theta * dist, radring * sin_phi); - } - glEnd(); - } - - - theta= theta1; - cos_theta= cos_theta1; - sin_theta= sin_theta1; - } -} - -/* three colors can be set; - grey for ghosting - moving: in transform theme color - else the red/green/blue -*/ -static void manipulator_setcolor(char axis, int colcode) -{ - float vec[4]; - char col[4]; - - vec[3]= 0.7f; // alpha set on 0.5, can be glEnabled or not - - if(colcode==MAN_GHOST) { - glColor4ub(0, 0, 0, 70); - } - else if(colcode==MAN_MOVECOL) { - BIF_GetThemeColor3ubv(TH_TRANSFORM, col); - glColor4ub(col[0], col[1], col[2], 128); - } - else { - switch(axis) { - case 'c': - BIF_GetThemeColor3ubv(TH_TRANSFORM, col); - if(G.vd->twmode == V3D_MANIP_LOCAL) { - col[0]= col[0]>200?255:col[0]+55; - col[1]= col[1]>200?255:col[1]+55; - col[2]= col[2]>200?255:col[2]+55; - } - else if(G.vd->twmode == V3D_MANIP_NORMAL) { - col[0]= col[0]<55?0:col[0]-55; - col[1]= col[1]<55?0:col[1]-55; - col[2]= col[2]<55?0:col[2]-55; - } - glColor4ub(col[0], col[1], col[2], 128); - break; - case 'x': - glColor4ub(220, 0, 0, 128); - break; - case 'y': - glColor4ub(0, 220, 0, 128); - break; - case 'z': - glColor4ub(30, 30, 220, 128); - break; - } - } -} - -/* viewmatrix should have been set OK, also no shademode! */ -static void draw_manipulator_axes(int colcode, int flagx, int flagy, int flagz) -{ - - /* axes */ - if(flagx) { - manipulator_setcolor('x', colcode); - if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X); - else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X); - glBegin(GL_LINES); - glVertex3f(0.2f, 0.0f, 0.0f); - glVertex3f(1.0f, 0.0f, 0.0f); - glEnd(); - } - if(flagy) { - if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y); - else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y); - manipulator_setcolor('y', colcode); - glBegin(GL_LINES); - glVertex3f(0.0f, 0.2f, 0.0f); - glVertex3f(0.0f, 1.0f, 0.0f); - glEnd(); - } - if(flagz) { - if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z); - else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z); - manipulator_setcolor('z', colcode); - glBegin(GL_LINES); - glVertex3f(0.0f, 0.0f, 0.2f); - glVertex3f(0.0f, 0.0f, 1.0f); - glEnd(); - } -} - -/* only called while G.moving */ -static void draw_manipulator_rotate_ghost(float mat[][4], int drawflags) -{ - GLUquadricObj *qobj; - float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3]; - int arcs= (G.rt!=2); - - glDisable(GL_DEPTH_TEST); - - qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - - glColor4ub(0,0,0,64); - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - /* we need both [4][4] transforms, Trans.mat seems to be premul, not post for mat[][4] */ - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); - - /* Screen aligned view rot circle */ - if(drawflags & MAN_ROT_V) { - - /* prepare for screen aligned draw */ - glPushMatrix(); - size= screen_aligned(mat); - - vec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]); - vec[2]= 0.0f; - Normalize(vec); - - startphi= saacos( vec[1] ); - if(vec[0]<0.0) startphi= -startphi; - - phi= (float)fmod(180.0*Trans.val/M_PI, 360.0); - if(phi > 180.0) phi-= 360.0; - else if(phi<-180.0) phi+= 360.0; - - gluPartialDisk(qobj, 0.0, size, 32, 1, 180.0*startphi/M_PI, phi); - - glPopMatrix(); - } - else if(arcs) { - float imat[3][3], ivmat[3][3]; - /* try to get the start rotation */ - - svec[0]= (float)(Trans.con.imval[0] - Trans.center2d[0]); - svec[1]= (float)(Trans.con.imval[1] - Trans.center2d[1]); - svec[2]= 0.0f; - - /* screen aligned vec transform back to manipulator space */ - Mat3CpyMat4(ivmat, G.vd->viewinv); - Mat3CpyMat4(tmat, mat); - Mat3Inv(imat, tmat); - Mat3MulMat3(tmat, imat, ivmat); - - Mat3MulVecfl(tmat, svec); // tmat is used further on - Normalize(svec); - } - - mymultmatrix(mat); // aligns with original widget - - /* Z disk */ - if(drawflags & MAN_ROT_Z) { - if(arcs) { - /* correct for squeezed arc */ - svec[0]+= tmat[2][0]; - svec[1]+= tmat[2][1]; - Normalize(svec); - - startphi= (float)atan2(svec[0], svec[1]); - } - else startphi= 0.5f*(float)M_PI; - - VECCOPY(vec, mat[0]); // use x axis to detect rotation - Normalize(vec); - Normalize(matt[0]); - phi= saacos( Inpf(vec, matt[0]) ); - if(phi!=0.0) { - Crossf(cross, vec, matt[0]); // results in z vector - if(Inpf(cross, mat[2]) > 0.0) phi= -phi; - gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*(phi)/M_PI); - } - } - /* X disk */ - if(drawflags & MAN_ROT_X) { - if(arcs) { - /* correct for squeezed arc */ - svec[1]+= tmat[2][1]; - svec[2]+= tmat[2][2]; - Normalize(svec); - - startphi= (float)(M_PI + atan2(svec[2], -svec[1])); - } - else startphi= 0.0f; - - VECCOPY(vec, mat[1]); // use y axis to detect rotation - Normalize(vec); - Normalize(matt[1]); - phi= saacos( Inpf(vec, matt[1]) ); - if(phi!=0.0) { - Crossf(cross, vec, matt[1]); // results in x vector - if(Inpf(cross, mat[0]) > 0.0) phi= -phi; - glRotatef(90.0, 0.0, 1.0, 0.0); - gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI); - glRotatef(-90.0, 0.0, 1.0, 0.0); - } - } - /* Y circle */ - if(drawflags & MAN_ROT_Y) { - if(arcs) { - /* correct for squeezed arc */ - svec[0]+= tmat[2][0]; - svec[2]+= tmat[2][2]; - Normalize(svec); - - startphi= (float)(M_PI + atan2(-svec[0], svec[2])); - } - else startphi= (float)M_PI; - - VECCOPY(vec, mat[2]); // use z axis to detect rotation - Normalize(vec); - Normalize(matt[2]); - phi= saacos( Inpf(vec, matt[2]) ); - if(phi!=0.0) { - Crossf(cross, vec, matt[2]); // results in y vector - if(Inpf(cross, mat[1]) > 0.0) phi= -phi; - glRotatef(-90.0, 1.0, 0.0, 0.0); - gluPartialDisk(qobj, 0.0, 1.0, 32, 1, 180.0*startphi/M_PI, 180.0*phi/M_PI); - glRotatef(90.0, 1.0, 0.0, 0.0); - } - } - - glDisable(GL_BLEND); - myloadmatrix(G.vd->viewmat); -} - -static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, int combo) -{ - GLUquadricObj *qobj; - double plane[4]; - float size, vec[3], unitmat[4][4]; - float cywid= 0.33f*0.01f*(float)U.tw_handlesize; - float cusize= cywid*0.65f; - int arcs= (G.rt!=2); - int colcode; - - if(moving) colcode= MAN_MOVECOL; - else colcode= MAN_RGB; - - /* when called while moving in mixed mode, do not draw when... */ - if((drawflags & MAN_ROT_C)==0) return; - - /* Init stuff */ - glDisable(GL_DEPTH_TEST); - Mat4One(unitmat); - - qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - - /* prepare for screen aligned draw */ - VECCOPY(vec, mat[0]); - size= Normalize(vec); - glPushMatrix(); - glTranslatef(mat[3][0], mat[3][1], mat[3][2]); - - if(arcs) { - /* clipplane makes nice handles, calc here because of multmatrix but with translate! */ - VECCOPY(plane, G.vd->viewinv[2]); - plane[3]= -0.02*size; // clip just a bit more - glClipPlane(GL_CLIP_PLANE0, plane); - } - /* sets view screen aligned */ - glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); - - /* Screen aligned help circle */ - if(arcs) { - if((G.f & G_PICKSEL)==0) { - BIF_ThemeColorShade(TH_BACK, -30); - drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat); - } - } - /* Screen aligned view rot circle */ - if(drawflags & MAN_ROT_V) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); - BIF_ThemeColor(TH_TRANSFORM); - drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); - - if(moving) { - float vec[3]; - vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]); - vec[2]= 0.0f; - Normalize(vec); - VecMulf(vec, 1.2f*size); - glBegin(GL_LINES); - glVertex3f(0.0f, 0.0f, 0.0f); - glVertex3fv(vec); - glEnd(); - } - } - glPopMatrix(); - - /* apply the transform delta */ - if(moving) { - float matt[4][4]; - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); - mymultmatrix(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); - } - else { - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); - mymultmatrix(mat); - } - - /* axes */ - if(arcs==0) { - if(!(G.f & G_PICKSEL)) { - if( (combo & V3D_MANIP_SCALE)==0) { - /* axis */ - glBegin(GL_LINES); - if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) { - manipulator_setcolor('x', colcode); - glVertex3f(0.2f, 0.0f, 0.0f); - glVertex3f(1.0f, 0.0f, 0.0f); - } - if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) { - manipulator_setcolor('y', colcode); - glVertex3f(0.0f, 0.2f, 0.0f); - glVertex3f(0.0f, 1.0f, 0.0f); - } - if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) { - manipulator_setcolor('z', colcode); - glVertex3f(0.0f, 0.0f, 0.2f); - glVertex3f(0.0f, 0.0f, 1.0f); - } - glEnd(); - } - } - } - - if(arcs==0 && moving) { - - /* Z circle */ - if(drawflags & MAN_ROT_Z) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); - drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); - } - /* X circle */ - if(drawflags & MAN_ROT_X) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); - glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); - drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); - glRotatef(-90.0, 0.0, 1.0, 0.0); - } - /* Y circle */ - if(drawflags & MAN_ROT_Y) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); - glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); - drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat); - glRotatef(90.0, 1.0, 0.0, 0.0); - } - - if(arcs) glDisable(GL_CLIP_PLANE0); - } - // donut arcs - if(arcs) { - glEnable(GL_CLIP_PLANE0); - - /* Z circle */ - if(drawflags & MAN_ROT_Z) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); - partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); - } - /* X circle */ - if(drawflags & MAN_ROT_X) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); - glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); - partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); - glRotatef(-90.0, 0.0, 1.0, 0.0); - } - /* Y circle */ - if(drawflags & MAN_ROT_Y) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); - glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); - partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48); - glRotatef(90.0, 1.0, 0.0, 0.0); - } - - glDisable(GL_CLIP_PLANE0); - } - - if(arcs==0) { - - /* Z handle on X axis */ - if(drawflags & MAN_ROT_Z) { - glPushMatrix(); - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); - - partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); - - glPopMatrix(); - } - - /* Y handle on X axis */ - if(drawflags & MAN_ROT_Y) { - glPushMatrix(); - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); - manipulator_setcolor('y', colcode); - - glRotatef(90.0, 1.0, 0.0, 0.0); - glRotatef(90.0, 0.0, 0.0, 1.0); - partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); - - glPopMatrix(); - } - - /* X handle on Z axis */ - if(drawflags & MAN_ROT_X) { - glPushMatrix(); - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); - manipulator_setcolor('x', colcode); - - glRotatef(-90.0, 0.0, 1.0, 0.0); - glRotatef(90.0, 0.0, 0.0, 1.0); - partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64); - - glPopMatrix(); - } - - } - - /* restore */ - myloadmatrix(G.vd->viewmat); - gluDeleteQuadric(qobj); - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - -} - -static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, int combo, int colcode) -{ - float cywid= 0.25f*0.01f*(float)U.tw_handlesize; - float cusize= cywid*0.75f, dz; - - /* when called while moving in mixed mode, do not draw when... */ - if((drawflags & MAN_SCALE_C)==0) return; - - glDisable(GL_DEPTH_TEST); - - /* not in combo mode */ - if( (combo & (V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE))==0) { - float size, unitmat[4][4]; - - /* center circle, do not add to selection when shift is pressed (planar constraint) */ - if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_SCALE_C); - - manipulator_setcolor('c', colcode); - glPushMatrix(); - size= screen_aligned(mat); - Mat4One(unitmat); - drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); - glPopMatrix(); - - dz= 1.0; - } - else dz= 1.0f-4.0f*cusize; - - if(moving) { - float matt[4][4]; - - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - Mat4MulMat34(matt, Trans.mat, mat); - mymultmatrix(matt); - glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW); - } - else { - mymultmatrix(mat); - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); - } - - /* axis */ - - /* in combo mode, this is always drawn as first type */ - draw_manipulator_axes(colcode, drawflags & MAN_SCALE_X, drawflags & MAN_SCALE_Y, drawflags & MAN_SCALE_Z); - - /* Z cube */ - glTranslatef(0.0, 0.0, dz); - if(drawflags & MAN_SCALE_Z) { - if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z); - manipulator_setcolor('z', colcode); - drawsolidcube(cusize); - } - /* X cube */ - glTranslatef(dz, 0.0, -dz); - if(drawflags & MAN_SCALE_X) { - if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X); - manipulator_setcolor('x', colcode); - drawsolidcube(cusize); - } - /* Y cube */ - glTranslatef(-dz, dz, 0.0); - if(drawflags & MAN_SCALE_Y) { - if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y); - manipulator_setcolor('y', colcode); - drawsolidcube(cusize); - } - - /* if shiftkey, center point as last, for selectbuffer order */ - if(G.f & G_PICKSEL) { - if(G.qual & LR_SHIFTKEY) { - glTranslatef(0.0, -dz, 0.0); - glLoadName(MAN_SCALE_C); - glBegin(GL_POINTS); - glVertex3f(0.0, 0.0, 0.0); - glEnd(); - } - } - - /* restore */ - myloadmatrix(G.vd->viewmat); - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - glFrontFace(GL_CCW); -} - - -static void draw_cone(GLUquadricObj *qobj, float len, float width) -{ - glTranslatef(0.0, 0.0, -0.5f*len); - gluCylinder(qobj, width, 0.0, len, 8, 1); - gluQuadricOrientation(qobj, GLU_INSIDE); - gluDisk(qobj, 0.0, width, 8, 1); - gluQuadricOrientation(qobj, GLU_OUTSIDE); - glTranslatef(0.0, 0.0, 0.5f*len); -} - -static void draw_cylinder(GLUquadricObj *qobj, float len, float width) -{ - - width*= 0.8f; // just for beauty - - glTranslatef(0.0, 0.0, -0.5f*len); - gluCylinder(qobj, width, width, len, 8, 1); - gluQuadricOrientation(qobj, GLU_INSIDE); - gluDisk(qobj, 0.0, width, 8, 1); - gluQuadricOrientation(qobj, GLU_OUTSIDE); - glTranslatef(0.0, 0.0, len); - gluDisk(qobj, 0.0, width, 8, 1); - glTranslatef(0.0, 0.0, -0.5f*len); -} - - -static void draw_manipulator_translate(float mat[][4], int moving, int drawflags, int combo, int colcode) -{ - GLUquadricObj *qobj; - float cylen= 0.01f*(float)U.tw_handlesize; - float cywid= 0.25f*cylen, dz, size; - float unitmat[4][4]; - - /* when called while moving in mixed mode, do not draw when... */ - if((drawflags & MAN_TRANS_C)==0) return; - - if(moving) glTranslatef(Trans.vec[0], Trans.vec[1], Trans.vec[2]); - glDisable(GL_DEPTH_TEST); - - qobj= gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - - /* center circle, do not add to selection when shift is pressed (planar constraint) */ - if( (G.f & G_PICKSEL) && (G.qual & LR_SHIFTKEY)==0) glLoadName(MAN_TRANS_C); - - manipulator_setcolor('c', colcode); - glPushMatrix(); - size= screen_aligned(mat); - Mat4One(unitmat); - drawcircball(GL_LINE_LOOP, unitmat[3], 0.2f*size, unitmat); - glPopMatrix(); - - /* and now apply matrix, we move to local matrix drawing */ - mymultmatrix(mat); - - /* axis */ - glLoadName(-1); - - // translate drawn as last, only axis when no combo with scale, or for ghosting - if((combo & V3D_MANIP_SCALE)==0 || colcode==MAN_GHOST) - draw_manipulator_axes(colcode, drawflags & MAN_TRANS_X, drawflags & MAN_TRANS_Y, drawflags & MAN_TRANS_Z); - - - /* offset in combo mode, for rotate a bit more */ - if(combo & (V3D_MANIP_ROTATE)) dz= 1.0f+2.0f*cylen; - else if(combo & (V3D_MANIP_SCALE)) dz= 1.0f+0.5f*cylen; - else dz= 1.0f; - - /* Z Cone */ - glTranslatef(0.0, 0.0, dz); - if(drawflags & MAN_TRANS_Z) { - if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z); - manipulator_setcolor('z', colcode); - draw_cone(qobj, cylen, cywid); - } - /* X Cone */ - glTranslatef(dz, 0.0, -dz); - if(drawflags & MAN_TRANS_X) { - if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X); - glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); - draw_cone(qobj, cylen, cywid); - glRotatef(-90.0, 0.0, 1.0, 0.0); - } - /* Y Cone */ - glTranslatef(-dz, dz, 0.0); - if(drawflags & MAN_TRANS_Y) { - if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y); - glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); - draw_cone(qobj, cylen, cywid); - } - - gluDeleteQuadric(qobj); - myloadmatrix(G.vd->viewmat); - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - -} - -static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflags, int combo, int colcode) -{ - GLUquadricObj *qobj; - float size; - float cylen= 0.01f*(float)U.tw_handlesize; - float cywid= 0.25f*cylen; - - /* when called while moving in mixed mode, do not draw when... */ - if((drawflags & MAN_ROT_C)==0) return; - - /* prepare for screen aligned draw */ - glPushMatrix(); - size= screen_aligned(mat); - - glDisable(GL_DEPTH_TEST); - - qobj= gluNewQuadric(); - - /* Screen aligned view rot circle */ - if(drawflags & MAN_ROT_V) { - float unitmat[4][4]; - Mat4One(unitmat); - - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_V); - BIF_ThemeColor(TH_TRANSFORM); - drawcircball(GL_LINE_LOOP, unitmat[3], 1.2f*size, unitmat); - - if(moving) { - float vec[3]; - vec[0]= (float)(Trans.imval[0] - Trans.center2d[0]); - vec[1]= (float)(Trans.imval[1] - Trans.center2d[1]); - vec[2]= 0.0f; - Normalize(vec); - VecMulf(vec, 1.2f*size); - glBegin(GL_LINES); - glVertex3f(0.0, 0.0, 0.0); - glVertex3fv(vec); - glEnd(); - } - } - glPopMatrix(); - - /* apply the transform delta */ - if(moving) { - float matt[4][4]; - Mat4CpyMat4(matt, mat); // to copy the parts outside of [3][3] - if (Trans.flag & T_USES_MANIPULATOR) { - Mat4MulMat34(matt, Trans.mat, mat); - } - mymultmatrix(matt); - } - else { - mymultmatrix(mat); - } - - glFrontFace( is_mat4_flipped(mat)?GL_CW:GL_CCW); - - /* axis */ - if( (G.f & G_PICKSEL)==0 ) { - - // only draw axis when combo didn't draw scale axes - if((combo & V3D_MANIP_SCALE)==0) - draw_manipulator_axes(colcode, drawflags & MAN_ROT_X, drawflags & MAN_ROT_Y, drawflags & MAN_ROT_Z); - - /* only has to be set when not in picking */ - gluQuadricDrawStyle(qobj, GLU_FILL); - } - - /* Z cyl */ - glTranslatef(0.0, 0.0, 1.0); - if(drawflags & MAN_ROT_Z) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z); - manipulator_setcolor('z', colcode); - draw_cylinder(qobj, cylen, cywid); - } - /* X cyl */ - glTranslatef(1.0, 0.0, -1.0); - if(drawflags & MAN_ROT_X) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X); - glRotatef(90.0, 0.0, 1.0, 0.0); - manipulator_setcolor('x', colcode); - draw_cylinder(qobj, cylen, cywid); - glRotatef(-90.0, 0.0, 1.0, 0.0); - } - /* Y cylinder */ - glTranslatef(-1.0, 1.0, 0.0); - if(drawflags & MAN_ROT_Y) { - if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y); - glRotatef(-90.0, 1.0, 0.0, 0.0); - manipulator_setcolor('y', colcode); - draw_cylinder(qobj, cylen, cywid); - } - - /* restore */ - - gluDeleteQuadric(qobj); - myloadmatrix(G.vd->viewmat); - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - -} - - -/* ********************************************* */ - -float get_drawsize(View3D *v3d) -{ - ScrArea *sa = v3d->area; - float size, vec[3], len1, len2; - - /* size calculus, depending ortho/persp settings, like initgrabz() */ - size= v3d->persmat[0][3]*v3d->twmat[3][0]+ v3d->persmat[1][3]*v3d->twmat[3][1]+ v3d->persmat[2][3]*v3d->twmat[3][2]+ v3d->persmat[3][3]; - - VECCOPY(vec, v3d->persinv[0]); - len1= Normalize(vec); - VECCOPY(vec, v3d->persinv[1]); - len2= Normalize(vec); - - size*= 0.01f*(len1>len2?len1:len2); - - /* correct for window size to make widgets appear fixed size */ - if(sa->winx > sa->winy) size*= 1000.0f/(float)sa->winx; - else size*= 1000.0f/(float)sa->winy; - - return size; -} - -static float get_manipulator_drawsize(ScrArea *sa) -{ - View3D *v3d= sa->spacedata.first; - float size = get_drawsize(v3d); - - size*= (float)U.tw_size; - - return size; -} - -/* exported to transform_constraints.c */ -/* mat, vec = default orientation and location */ -/* type = transform type */ -/* axis = x, y, z, c */ -/* col: 0 = colored, 1 = moving, 2 = ghost */ -void draw_manipulator_ext(ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3]) -{ - int drawflags= 0; - float mat4[4][4]; - int colcode; - - Mat4CpyMat3(mat4, mat); - VECCOPY(mat4[3], vec); - - Mat4MulFloat3((float *)mat4, get_manipulator_drawsize(sa)); - - glEnable(GL_BLEND); // let's do it transparent by default - if(col==0) colcode= MAN_RGB; - else if(col==1) colcode= MAN_MOVECOL; - else colcode= MAN_GHOST; - - - if(type==TFM_ROTATION) { - if(axis=='x') drawflags= MAN_ROT_X; - else if(axis=='y') drawflags= MAN_ROT_Y; - else if(axis=='z') drawflags= MAN_ROT_Z; - else drawflags= MAN_ROT_C; - - draw_manipulator_rotate_cyl(mat4, col, drawflags, V3D_MANIP_ROTATE, colcode); - } - else if(type==TFM_RESIZE) { - if(axis=='x') drawflags= MAN_SCALE_X; - else if(axis=='y') drawflags= MAN_SCALE_Y; - else if(axis=='z') drawflags= MAN_SCALE_Z; - else drawflags= MAN_SCALE_C; - - draw_manipulator_scale(mat4, col, drawflags, V3D_MANIP_SCALE, colcode); - } - else { - if(axis=='x') drawflags= MAN_TRANS_X; - else if(axis=='y') drawflags= MAN_TRANS_Y; - else if(axis=='z') drawflags= MAN_TRANS_Z; - else drawflags= MAN_TRANS_C; - - draw_manipulator_translate(mat4, 0, drawflags, V3D_MANIP_TRANSLATE, colcode); - } - - - glDisable(GL_BLEND); -} - -/* main call, does calc centers & orientation too */ -/* uses global G.moving */ -static int drawflags= 0xFFFF; // only for the calls below, belongs in scene...? -void BIF_draw_manipulator(ScrArea *sa) -{ - View3D *v3d= sa->spacedata.first; - int totsel; - - if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return; - if(G.moving && (G.moving & G_TRANSFORM_MANIP)==0) return; - - if(G.moving==0) { - v3d->twflag &= ~V3D_DRAW_MANIPULATOR; - - totsel= calc_manipulator_stats(sa); - if(totsel==0) return; - drawflags= v3d->twdrawflag; /* set in calc_manipulator_stats */ - - v3d->twflag |= V3D_DRAW_MANIPULATOR; - - /* now we can define center */ - switch(v3d->around) { - case V3D_CENTER: - case V3D_ACTIVE: - v3d->twmat[3][0]= (G.scene->twmin[0] + G.scene->twmax[0])/2.0f; - v3d->twmat[3][1]= (G.scene->twmin[1] + G.scene->twmax[1])/2.0f; - v3d->twmat[3][2]= (G.scene->twmin[2] + G.scene->twmax[2])/2.0f; - if(v3d->around==V3D_ACTIVE && G.obedit==NULL) { - Object *ob= OBACT; - if(ob && !(ob->flag & OB_POSEMODE)) - VECCOPY(v3d->twmat[3], ob->obmat[3]); - } - break; - case V3D_LOCAL: - case V3D_CENTROID: - VECCOPY(v3d->twmat[3], G.scene->twcent); - break; - case V3D_CURSOR: - VECCOPY(v3d->twmat[3], give_cursor()); - break; - } - - Mat4MulFloat3((float *)v3d->twmat, get_manipulator_drawsize(sa)); - } - - if(v3d->twflag & V3D_DRAW_MANIPULATOR) { - - if(v3d->twtype & V3D_MANIP_ROTATE) { - - /* rotate has special ghosting draw, for pie chart */ - if(G.moving) draw_manipulator_rotate_ghost(v3d->twmat, drawflags); - - if(G.moving) glEnable(GL_BLEND); - - if(G.rt==3) { - if(G.moving) draw_manipulator_rotate_cyl(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); - else draw_manipulator_rotate_cyl(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); - } - else - draw_manipulator_rotate(v3d->twmat, G.moving, drawflags, v3d->twtype); - - glDisable(GL_BLEND); - } - if(v3d->twtype & V3D_MANIP_SCALE) { - if(G.moving) { - glEnable(GL_BLEND); - draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST); - draw_manipulator_scale(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); - glDisable(GL_BLEND); - } - else draw_manipulator_scale(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); - } - if(v3d->twtype & V3D_MANIP_TRANSLATE) { - if(G.moving) { - glEnable(GL_BLEND); - draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_GHOST); - draw_manipulator_translate(v3d->twmat, 1, drawflags, v3d->twtype, MAN_MOVECOL); - glDisable(GL_BLEND); - } - else draw_manipulator_translate(v3d->twmat, 0, drawflags, v3d->twtype, MAN_RGB); - } - } -} - -static int manipulator_selectbuf(ScrArea *sa, float hotspot) -{ - View3D *v3d= sa->spacedata.first; - rctf rect; - GLuint buffer[64]; // max 4 items per select, so large enuf - short hits, mval[2]; - - G.f |= G_PICKSEL; - - getmouseco_areawin(mval); - rect.xmin= mval[0]-hotspot; - rect.xmax= mval[0]+hotspot; - rect.ymin= mval[1]-hotspot; - rect.ymax= mval[1]+hotspot; - - /* get rid of overlay button matrix */ - persp(PERSP_VIEW); - - setwinmatrixview3d(sa->winx, sa->winy, &rect); - Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); - - glSelectBuffer( 64, buffer); - glRenderMode(GL_SELECT); - glInitNames(); /* these two calls whatfor? It doesnt work otherwise */ - glPushName(-2); - - /* do the drawing */ - if(v3d->twtype & V3D_MANIP_ROTATE) { - if(G.rt==3) draw_manipulator_rotate_cyl(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); - else draw_manipulator_rotate(v3d->twmat, 0, MAN_ROT_C & v3d->twdrawflag, v3d->twtype); - } - if(v3d->twtype & V3D_MANIP_SCALE) - draw_manipulator_scale(v3d->twmat, 0, MAN_SCALE_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); - if(v3d->twtype & V3D_MANIP_TRANSLATE) - draw_manipulator_translate(v3d->twmat, 0, MAN_TRANS_C & v3d->twdrawflag, v3d->twtype, MAN_RGB); - - glPopName(); - hits= glRenderMode(GL_RENDER); - - G.f &= ~G_PICKSEL; - setwinmatrixview3d(sa->winx, sa->winy, NULL); - Mat4MulMat4(v3d->persmat, v3d->viewmat, sa->winmat); - - persp(PERSP_WIN); - - if(hits==1) return buffer[3]; - else if(hits>1) { - GLuint val, dep, mindep=0, mindeprot=0, minval=0, minvalrot=0; - int a; - - /* we compare the hits in buffer, but value centers highest */ - /* we also store the rotation hits separate (because of arcs) and return hits on other widgets if there are */ - - for(a=0; aspacedata.first; - int val; - - if(!(v3d->twflag & V3D_USE_MANIPULATOR)) return 0; - if(!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return 0; - - // find the hotspots first test narrow hotspot - val= manipulator_selectbuf(sa, 0.5f*(float)U.tw_hotspot); - if(val) { - checkFirstTime(); // TEMPORARY, check this before doing any transform call. - // drawflags still global, for drawing call above - drawflags= manipulator_selectbuf(sa, 0.2f*(float)U.tw_hotspot); - if(drawflags==0) drawflags= val; - - if (drawflags & MAN_TRANS_C) { - initManipulator(TFM_TRANSLATION); - switch(drawflags) { - case MAN_TRANS_C: - break; - case MAN_TRANS_X: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_TRANS_Y|MAN_TRANS_Z; - BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); - break; - case MAN_TRANS_Y: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_TRANS_X|MAN_TRANS_Z; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); - break; - case MAN_TRANS_Z: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_TRANS_X|MAN_TRANS_Y; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); - break; - } - ManipulatorTransform(); - } - else if (drawflags & MAN_SCALE_C) { - initManipulator(TFM_RESIZE); - switch(drawflags) { - case MAN_SCALE_X: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_SCALE_Y|MAN_SCALE_Z; - BIF_setDualAxisConstraint(v3d->twmat[1], v3d->twmat[2], " Y+Z"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); - break; - case MAN_SCALE_Y: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_SCALE_X|MAN_SCALE_Z; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[2], " X+Z"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); - break; - case MAN_SCALE_Z: - if(G.qual & LR_SHIFTKEY) { - drawflags= MAN_SCALE_X|MAN_SCALE_Y; - BIF_setDualAxisConstraint(v3d->twmat[0], v3d->twmat[1], " X+Y"); - } - else - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); - break; - } - ManipulatorTransform(); - } - else if (drawflags == MAN_ROT_T) { /* trackbal need special case, init is different */ - initManipulator(TFM_TRACKBALL); - ManipulatorTransform(); - } - else if (drawflags & MAN_ROT_C) { - initManipulator(TFM_ROTATION); - switch(drawflags) { - case MAN_ROT_X: - BIF_setSingleAxisConstraint(v3d->twmat[0], " X"); - break; - case MAN_ROT_Y: - BIF_setSingleAxisConstraint(v3d->twmat[1], " Y"); - break; - case MAN_ROT_Z: - BIF_setSingleAxisConstraint(v3d->twmat[2], " Z"); - break; - } - ManipulatorTransform(); - } - } - /* after transform, restore drawflags */ - drawflags= 0xFFFF; - - return val; -} - - diff --git a/source/blender/src/transform_numinput.c b/source/blender/src/transform_numinput.c deleted file mode 100644 index 730d25545bd..00000000000 --- a/source/blender/src/transform_numinput.c +++ /dev/null @@ -1,247 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include /* fabs */ -#include /* for sprintf */ - -#include "BKE_global.h" /* for G */ -#include "BKE_utildefines.h" /* ABS */ - -#include "mydevice.h" /* for KEY defines */ - -#include "transform.h" - -/* ************************** Functions *************************** */ - -/* ************************** NUMINPUT **************************** */ - -void outputNumInput(NumInput *n, char *str) -{ - char cur; - short i, j; - - for (j=0; j<=n->idx_max; j++) { - /* if AFFECTALL and no number typed and cursor not on number, use first number */ - if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0) - i = 0; - else - i = j; - - if (n->idx != i) - cur = ' '; - else - cur = '|'; - - if( n->val[i] > 1e10 || n->val[i] < -1e10 ) - sprintf(&str[j*20], "%.4e%c", n->val[i], cur); - else - switch (n->ctrl[i]) { - case 0: - sprintf(&str[j*20], "NONE%c", cur); - break; - case 1: - case -1: - sprintf(&str[j*20], "%.0f%c", n->val[i], cur); - break; - case 10: - case -10: - sprintf(&str[j*20], "%.f.%c", n->val[i], cur); - break; - case 100: - case -100: - sprintf(&str[j*20], "%.1f%c", n->val[i], cur); - break; - case 1000: - case -1000: - sprintf(&str[j*20], "%.2f%c", n->val[i], cur); - break; - case 10000: - case -10000: - sprintf(&str[j*20], "%.3f%c", n->val[i], cur); - break; - default: - sprintf(&str[j*20], "%.4e%c", n->val[i], cur); - } - } -} - -short hasNumInput(NumInput *n) -{ - short i; - - for (i=0; i<=n->idx_max; i++) { - if (n->ctrl[i]) - return 1; - } - - return 0; -} - -void applyNumInput(NumInput *n, float *vec) -{ - short i, j; - float val[3]; - - if (hasNumInput(n)) { - convertDisplayNumToVec(n->val, val); - - for (j=0; j<=n->idx_max; j++) { - /* if AFFECTALL and no number typed and cursor not on number, use first number */ - if (n->flag & NUM_AFFECT_ALL && n->idx != j && n->ctrl[j] == 0) - i = 0; - else - i = j; - - if (n->ctrl[i] == 0 && n->flag & NUM_NULL_ONE) { - vec[j] = 1.0f; - } - else if (val[i] == 0.0f && n->flag & NUM_NO_ZERO) { - vec[j] = 0.0001f; - } - else { - vec[j] = val[i]; - } - } - } -} - -char handleNumInput(NumInput *n, unsigned short event) -{ - float Val = 0; - short idx = n->idx, idx_max = n->idx_max; - - switch (event) { - case BACKSPACEKEY: - if (n->ctrl[idx] == 0) { - n->val[0] = - n->val[1] = - n->val[2] = 0.0f; - n->ctrl[0] = - n->ctrl[1] = - n->ctrl[2] = 0; - } - else { - n->val[idx] = 0.0f; - n->ctrl[idx] = 0; - } - break; - case PERIODKEY: - case PADPERIOD: - if (n->flag & NUM_NO_FRACTION) - break; - - switch (n->ctrl[idx]) - { - case 0: - case 1: - n->ctrl[idx] = 10; - break; - case -1: - n->ctrl[idx] = -10; - } - break; - case PADMINUS: - if(G.qual & LR_ALTKEY) - break; - case MINUSKEY: - if (n->flag & NUM_NO_NEGATIVE) - break; - - if (n->ctrl[idx]) { - n->ctrl[idx] *= -1; - n->val[idx] *= -1; - } - else - n->ctrl[idx] = -1; - break; - case TABKEY: - idx++; - if (idx > idx_max) - idx = 0; - n->idx = idx; - break; - case PAD9: - case NINEKEY: - Val += 1.0f; - case PAD8: - case EIGHTKEY: - Val += 1.0f; - case PAD7: - case SEVENKEY: - Val += 1.0f; - case PAD6: - case SIXKEY: - Val += 1.0f; - case PAD5: - case FIVEKEY: - Val += 1.0f; - case PAD4: - case FOURKEY: - Val += 1.0f; - case PAD3: - case THREEKEY: - Val += 1.0f; - case PAD2: - case TWOKEY: - Val += 1.0f; - case PAD1: - case ONEKEY: - Val += 1.0f; - case PAD0: - case ZEROKEY: - if (!n->ctrl[idx]) - n->ctrl[idx] = 1; - - if (fabs(n->val[idx]) > 9999999.0f); - else if (n->ctrl[idx] == 1) { - n->val[idx] *= 10; - n->val[idx] += Val; - } - else if (n->ctrl[idx] == -1) { - n->val[idx] *= 10; - n->val[idx] -= Val; - } - else { - /* float resolution breaks when over six digits after comma */ - if( ABS(n->ctrl[idx]) < 10000000) { - n->val[idx] += Val / (float)n->ctrl[idx]; - n->ctrl[idx] *= 10; - } - } - break; - default: - return 0; - } - - /* REDRAW SINCE NUMBERS HAVE CHANGED */ - return 1; -} diff --git a/source/blender/src/transform_snap.c b/source/blender/src/transform_snap.c deleted file mode 100644 index 355c150657e..00000000000 --- a/source/blender/src/transform_snap.c +++ /dev/null @@ -1,712 +0,0 @@ -/** - * $Id: - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Martin Poirier - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#include "PIL_time.h" - -#include "DNA_object_types.h" -#include "DNA_scene_types.h" -#include "DNA_meshdata_types.h" // Temporary, for snapping to other unselected meshes -#include "DNA_space_types.h" -#include "DNA_screen_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BLI_arithb.h" -#include "BLI_editVert.h" - -#include "BDR_drawobject.h" - -#include "editmesh.h" -#include "BIF_editsima.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" -#include "BIF_mywindow.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_editsima.h" -#include "BIF_drawimage.h" - -#include "BKE_global.h" -#include "BKE_utildefines.h" -#include "BKE_DerivedMesh.h" -#include "BKE_object.h" - -#include "BSE_view.h" - -#include "MEM_guardedalloc.h" - -#include "transform.h" -#include "mydevice.h" /* for KEY defines */ -#include "blendef.h" /* for selection modes */ - -/********************* PROTOTYPES ***********************/ - -void setSnappingCallback(TransInfo *t); - -void ApplySnapTranslation(TransInfo *t, float vec[3]); -void ApplySnapRotation(TransInfo *t, float *vec); - -void CalcSnapGrid(TransInfo *t, float *vec); -void CalcSnapGeometry(TransInfo *t, float *vec); - -void TargetSnapMedian(TransInfo *t); -void TargetSnapCenter(TransInfo *t); -void TargetSnapClosest(TransInfo *t); - -float RotationBetween(TransInfo *t, float p1[3], float p2[3]); -float TranslationBetween(TransInfo *t, float p1[3], float p2[3]); - -// Trickery -int findNearestVertFromObjects(int *dist, float *loc); - -/****************** IMPLEMENTATIONS *********************/ - -void drawSnapping(TransInfo *t) -{ - if ((t->tsnap.status & (SNAP_ON|POINT_INIT|TARGET_INIT)) == (SNAP_ON|POINT_INIT|TARGET_INIT) && - (G.qual & LR_CTRLKEY)) { - - char col[4]; - BIF_GetThemeColor3ubv(TH_TRANSFORM, col); - glColor4ub(col[0], col[1], col[2], 128); - - if (t->spacetype==SPACE_VIEW3D) { - float unitmat[4][4]; - float size; - - glDisable(GL_DEPTH_TEST); - - size = get_drawsize(G.vd); - - size *= 0.5f * BIF_GetThemeValuef(TH_VERTEX_SIZE); - - glPushMatrix(); - - glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], t->tsnap.snapPoint[2]); - - /* sets view screen aligned */ - glRotatef( -360.0f*saacos(G.vd->viewquat[0])/(float)M_PI, G.vd->viewquat[1], G.vd->viewquat[2], G.vd->viewquat[3]); - - Mat4One(unitmat); - drawcircball(GL_LINE_LOOP, unitmat[3], size, unitmat); - - glPopMatrix(); - - if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); - } else if (t->spacetype==SPACE_IMAGE) { - /*This will not draw, and Im nor sure why - campbell */ - - /* - float xuser_asp, yuser_asp; - int wi, hi; - float w, h; - - calc_image_view(G.sima, 'f'); // float - myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); - glLoadIdentity(); - - aspect_sima(G.sima, &xuser_asp, &yuser_asp); - - transform_width_height_tface_uv(&wi, &hi); - w = (((float)wi)/256.0f)*G.sima->zoom * xuser_asp; - h = (((float)hi)/256.0f)*G.sima->zoom * yuser_asp; - - cpack(0xFFFFFF); - glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], 0.0f); - - //glRectf(0,0,1,1); - - setlinestyle(0); - cpack(0x0); - fdrawline(-0.020/w, 0, -0.1/w, 0); - fdrawline(0.1/w, 0, .020/w, 0); - fdrawline(0, -0.020/h, 0, -0.1/h); - fdrawline(0, 0.1/h, 0, 0.020/h); - - glTranslatef(-t->tsnap.snapPoint[0], -t->tsnap.snapPoint[1], 0.0f); - setlinestyle(0); - */ - - } - } -} - -int handleSnapping(TransInfo *t, int event) -{ - int status = 0; - - // Put keyhandling code here - - return status; -} - -void applySnapping(TransInfo *t, float *vec) -{ - if ((t->tsnap.status & SNAP_ON) && - (G.qual & LR_CTRLKEY)) - { - double current = PIL_check_seconds_timer(); - - // Time base quirky code to go around findnearest slowness - if (current - t->tsnap.last >= 0.25) - { - t->tsnap.calcSnap(t, vec); - t->tsnap.targetSnap(t); - - t->tsnap.last = current; - } - if ((t->tsnap.status & (POINT_INIT|TARGET_INIT)) == (POINT_INIT|TARGET_INIT)) - { - t->tsnap.applySnap(t, vec); - } - } -} - -void resetSnapping(TransInfo *t) -{ - t->tsnap.status = 0; - t->tsnap.modePoint = 0; - t->tsnap.modeTarget = 0; - t->tsnap.last = 0; - t->tsnap.applySnap = NULL; -} - -void initSnapping(TransInfo *t) -{ - resetSnapping(t); - - if (t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) { // Only 3D view or UV - setSnappingCallback(t); - - if (t->tsnap.applySnap != NULL && // A snapping function actually exist - (G.obedit != NULL && G.obedit->type==OB_MESH) && // Temporary limited to edit mode meshes - (G.scene->snap_flag & SCE_SNAP) && // Only if the snap flag is on - (t->flag & T_PROP_EDIT) == 0) // No PET, obviously - { - t->tsnap.status |= SNAP_ON; - t->tsnap.modePoint = SNAP_GEO; - } - else - { - /* Grid if snap is not possible */ - t->tsnap.modePoint = SNAP_GRID; - } - } - else - { - /* Always grid outside of 3D view */ - t->tsnap.modePoint = SNAP_GRID; - } -} - -void setSnappingCallback(TransInfo *t) -{ - t->tsnap.calcSnap = CalcSnapGeometry; - - switch(G.scene->snap_target) - { - case SCE_SNAP_TARGET_CLOSEST: - t->tsnap.modeTarget = SNAP_CLOSEST; - t->tsnap.targetSnap = TargetSnapClosest; - break; - case SCE_SNAP_TARGET_CENTER: - t->tsnap.modeTarget = SNAP_CENTER; - t->tsnap.targetSnap = TargetSnapCenter; - break; - case SCE_SNAP_TARGET_MEDIAN: - t->tsnap.modeTarget = SNAP_MEDIAN; - t->tsnap.targetSnap = TargetSnapMedian; - break; - } - - switch (t->mode) - { - case TFM_TRANSLATION: - t->tsnap.applySnap = ApplySnapTranslation; - t->tsnap.distance = TranslationBetween; - break; - case TFM_ROTATION: - t->tsnap.applySnap = ApplySnapRotation; - t->tsnap.distance = RotationBetween; - - // Can't do TARGET_CENTER with rotation, use TARGET_MEDIAN instead - if (G.scene->snap_target == SCE_SNAP_TARGET_CENTER) { - t->tsnap.modeTarget = SNAP_MEDIAN; - t->tsnap.targetSnap = TargetSnapMedian; - } - break; - default: - t->tsnap.applySnap = NULL; - break; - } -} - -/********************** APPLY **************************/ - -void ApplySnapTranslation(TransInfo *t, float vec[3]) -{ - VecSubf(vec, t->tsnap.snapPoint, t->tsnap.snapTarget); -} - -void ApplySnapRotation(TransInfo *t, float *vec) -{ - if (t->tsnap.modeTarget == SNAP_CLOSEST) { - *vec = t->tsnap.dist; - } - else { - *vec = RotationBetween(t, t->tsnap.snapTarget, t->tsnap.snapPoint); - } -} - - -/********************** DISTANCE **************************/ - -float TranslationBetween(TransInfo *t, float p1[3], float p2[3]) -{ - return VecLenf(p1, p2); -} - -float RotationBetween(TransInfo *t, float p1[3], float p2[3]) -{ - float angle, start[3], end[3], center[3]; - - VECCOPY(center, t->center); - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, center); - } - - VecSubf(start, p1, center); - VecSubf(end, p2, center); - - // Angle around a constraint axis (error prone, will need debug) - if (t->con.applyRot != NULL && (t->con.mode & CON_APPLY)) { - float axis[3], tmp[3]; - - t->con.applyRot(t, NULL, axis); - - Projf(tmp, end, axis); - VecSubf(end, end, tmp); - - Projf(tmp, start, axis); - VecSubf(start, start, tmp); - - Normalize(end); - Normalize(start); - - Crossf(tmp, start, end); - - if (Inpf(tmp, axis) < 0.0) - angle = -acos(Inpf(start, end)); - else - angle = acos(Inpf(start, end)); - } - else { - float mtx[3][3]; - - Mat3CpyMat4(mtx, t->viewmat); - - Mat3MulVecfl(mtx, end); - Mat3MulVecfl(mtx, start); - - angle = atan2(start[1],start[0]) - atan2(end[1],end[0]); - } - - if (angle > M_PI) { - angle = angle - 2 * M_PI; - } - else if (angle < -(M_PI)) { - angle = 2 * M_PI + angle; - } - - return angle; -} - -/********************** CALC **************************/ - -void CalcSnapGrid(TransInfo *t, float *vec) -{ - snapGridAction(t, t->tsnap.snapPoint, BIG_GEARS); -} - -void CalcSnapGeometry(TransInfo *t, float *vec) -{ - if (G.obedit != NULL && G.obedit->type==OB_MESH) - { - /*if (G.scene->selectmode & B_SEL_VERT)*/ - - if (t->spacetype == SPACE_VIEW3D) - { - EditVert *nearest=NULL; - float vec[3]; - int found = 0; - int dist = 40; // Use a user defined value here - - // use findnearestverts in vert mode, others in other modes - nearest = findnearestvert(&dist, SELECT, 1); - - found = findNearestVertFromObjects(&dist, vec); - if (found == 1) - { - VECCOPY(t->tsnap.snapPoint, vec); - - t->tsnap.status |= POINT_INIT; - } - /* If there's no outside vertex nearer, but there's one in this mesh - */ - else if (nearest != NULL) - { - VECCOPY(t->tsnap.snapPoint, nearest->co); - Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint); - - t->tsnap.status |= POINT_INIT; - } - else - { - t->tsnap.status &= ~POINT_INIT; - } - } - else if (t->spacetype == SPACE_IMAGE) - { /* same as above but for UV's */ - MTFace *nearesttf=NULL; - int face_corner; - - find_nearest_uv(&nearesttf, NULL, NULL, &face_corner); - - if (nearesttf != NULL) - { - VECCOPY2D(t->tsnap.snapPoint, nearesttf->uv[face_corner]); - //Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint); - - t->tsnap.status |= POINT_INIT; - } - else - { - t->tsnap.status &= ~POINT_INIT; - } - } - - - /* - if (G.scene->selectmode & B_SEL_EDGE) - { - EditEdge *nearest=NULL; - int dist = 50; // Use a user defined value here - - // use findnearestverts in vert mode, others in other modes - nearest = findnearestedge(&dist); - - if (nearest != NULL) - { - VecAddf(t->tsnap.snapPoint, nearest->v1->co, nearest->v2->co); - - VecMulf(t->tsnap.snapPoint, 0.5f); - - Mat4MulVecfl(G.obedit->obmat, t->tsnap.snapPoint); - - t->tsnap.status |= POINT_INIT; - } - else - { - t->tsnap.status &= ~POINT_INIT; - } - } - */ - } -} - -/********************** TARGET **************************/ - -void TargetSnapCenter(TransInfo *t) -{ - // Only need to calculate once - if ((t->tsnap.status & TARGET_INIT) == 0) - { - VECCOPY(t->tsnap.snapTarget, t->center); - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget); - } - - t->tsnap.status |= TARGET_INIT; - } -} - -void TargetSnapMedian(TransInfo *t) -{ - // Only need to calculate once - if ((t->tsnap.status & TARGET_INIT) == 0) - { - TransData *td = NULL; - int i; - - t->tsnap.snapTarget[0] = 0; - t->tsnap.snapTarget[1] = 0; - t->tsnap.snapTarget[2] = 0; - - for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) - { - VecAddf(t->tsnap.snapTarget, t->tsnap.snapTarget, td->iloc); - } - - VecMulf(t->tsnap.snapTarget, 1.0 / t->total); - - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget); - } - - t->tsnap.status |= TARGET_INIT; - } -} - -void TargetSnapClosest(TransInfo *t) -{ - // Only valid if a snap point has been selected - if (t->tsnap.status & POINT_INIT) - { - TransData *closest = NULL, *td = NULL; - - // Base case, only one selected item - if (t->total == 1) - { - VECCOPY(t->tsnap.snapTarget, t->data[0].iloc); - - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, t->tsnap.snapTarget); - } - - t->tsnap.dist = t->tsnap.distance(t, t->tsnap.snapTarget, t->tsnap.snapPoint); - } - // More than one selected item - else - { - int i; - for(td = t->data, i = 0 ; i < t->total && td->flag & TD_SELECTED ; i++, td++) - { - float loc[3]; - float dist; - - VECCOPY(loc, td->iloc); - - if(t->flag & (T_EDIT|T_POSE)) { - Object *ob= G.obedit?G.obedit:t->poseobj; - Mat4MulVecfl(ob->obmat, loc); - } - - dist = t->tsnap.distance(t, loc, t->tsnap.snapPoint); - - if (closest == NULL || fabs(dist) < fabs(t->tsnap.dist)) - { - VECCOPY(t->tsnap.snapTarget, loc); - closest = td; - t->tsnap.dist = dist; - } - } - } - - t->tsnap.status |= TARGET_INIT; - } -} -/*================================================================*/ - -int findNearestVertFromObjects(int *dist, float *loc) { - Base *base; - int retval = 0; - short mval[2]; - - getmouseco_areawin(mval); - - base= FIRSTBASE; - for ( base = FIRSTBASE; base != NULL; base = base->next ) { - if ( TESTBASE(base) && base != BASACT ) { - Object *ob = base->object; - - if (ob->type == OB_MESH) { - Mesh *me = ob->data; - - if (me->totvert > 0) { - int test = 1; - int i; - - /* If number of vert is more than an arbitrary limit, - * test against boundbox first - * */ - if (me->totvert > 16) { - struct BoundBox *bb = object_get_boundbox(ob); - - int minx = 0, miny = 0, maxx = 0, maxy = 0; - int i; - - for (i = 0; i < 8; i++) { - float gloc[3]; - int sloc[2]; - - VECCOPY(gloc, bb->vec[i]); - Mat4MulVecfl(ob->obmat, gloc); - project_int(gloc, sloc); - - if (i == 0) { - minx = maxx = sloc[0]; - miny = maxy = sloc[1]; - } - else { - if (minx > sloc[0]) minx = sloc[0]; - else if (maxx < sloc[0]) maxx = sloc[0]; - - if (miny > sloc[1]) miny = sloc[1]; - else if (maxy < sloc[1]) maxy = sloc[1]; - } - } - - /* Pad with distance */ - - minx -= *dist; - miny -= *dist; - maxx += *dist; - maxy += *dist; - - if (mval[0] > maxx || mval[0] < minx || - mval[1] > maxy || mval[1] < miny) { - - test = 0; - } - } - - if (test == 1) { - float *verts = mesh_get_mapped_verts_nors(ob); - - if (verts != NULL) { - float *fp; - - fp = verts; - for( i = 0; i < me->totvert; i++, fp += 6) { - float gloc[3]; - int sloc[2]; - int curdist; - - VECCOPY(gloc, fp); - Mat4MulVecfl(ob->obmat, gloc); - project_int(gloc, sloc); - - sloc[0] -= mval[0]; - sloc[1] -= mval[1]; - - curdist = abs(sloc[0]) + abs(sloc[1]); - - if (curdist < *dist) { - *dist = curdist; - retval = 1; - VECCOPY(loc, gloc); - } - } - } - - MEM_freeN(verts); - } - } - } - } - } - - return retval; -} - -/*================================================================*/ - -static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action); - - -void snapGridAction(TransInfo *t, float *val, GearsType action) { - float fac[3]; - - fac[NO_GEARS] = t->snap[0]; - fac[BIG_GEARS] = t->snap[1]; - fac[SMALL_GEARS] = t->snap[2]; - - applyGrid(t, val, t->idx_max, fac, action); -} - - -void snapGrid(TransInfo *t, float *val) { - int invert; - GearsType action; - - // Only do something if using Snap to Grid - if (t->tsnap.modePoint != SNAP_GRID) - return; - - if(t->mode==TFM_ROTATION || t->mode==TFM_WARP || t->mode==TFM_TILT || t->mode==TFM_TRACKBALL || t->mode==TFM_BONE_ROLL) - invert = U.flag & USER_AUTOROTGRID; - else if(t->mode==TFM_RESIZE || t->mode==TFM_SHEAR || t->mode==TFM_BONESIZE || t->mode==TFM_SHRINKFATTEN || t->mode==TFM_CURVE_SHRINKFATTEN) - invert = U.flag & USER_AUTOSIZEGRID; - else - invert = U.flag & USER_AUTOGRABGRID; - - if(invert) { - action = (G.qual & LR_CTRLKEY) ? NO_GEARS: BIG_GEARS; - } - else { - action = (G.qual & LR_CTRLKEY) ? BIG_GEARS : NO_GEARS; - } - - if (action == BIG_GEARS && (G.qual & LR_SHIFTKEY)) { - action = SMALL_GEARS; - } - - snapGridAction(t, val, action); -} - - -static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], GearsType action) -{ - int i; - float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3) - - // Early bailing out if no need to snap - if (fac[action] == 0.0) - return; - - /* evil hack - snapping needs to be adapted for image aspect ratio */ - if((t->spacetype==SPACE_IMAGE) && (t->mode==TFM_TRANSLATION)) { - transform_aspect_ratio_tface_uv(asp, asp+1); - } - - for (i=0; i<=max_index; i++) { - val[i]= fac[action]*asp[i]*(float)floor(val[i]/(fac[action]*asp[i]) +.5); - } -} diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c deleted file mode 100644 index 5cf5f3dc70b..00000000000 --- a/source/blender/src/unwrapper.c +++ /dev/null @@ -1,480 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" - -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" -#include "BKE_customdata.h" - -#include "BLI_arithb.h" -#include "BLI_edgehash.h" -#include "BLI_editVert.h" - -#include "BIF_editsima.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_editmesh.h" - -#include "blendef.h" -#include "mydevice.h" - -#include "BDR_unwrapper.h" - -#include "PIL_time.h" - -#include "parametrizer.h" - -/* Set tface seams based on edge data, uses hash table to find seam edges. */ - -static void hash_add_face(EdgeHash *ehash, MFace *mf) -{ - BLI_edgehash_insert(ehash, mf->v1, mf->v2, NULL); - BLI_edgehash_insert(ehash, mf->v2, mf->v3, NULL); - if(mf->v4) { - BLI_edgehash_insert(ehash, mf->v3, mf->v4, NULL); - BLI_edgehash_insert(ehash, mf->v4, mf->v1, NULL); - } - else - BLI_edgehash_insert(ehash, mf->v3, mf->v1, NULL); -} - -void select_linked_tfaces_with_seams(int mode, Mesh *me, unsigned int index) -{ - MFace *mf; - int a, doit=1, mark=0; - char *linkflag; - EdgeHash *ehash, *seamhash; - MEdge *med; - - ehash= BLI_edgehash_new(); - seamhash = BLI_edgehash_new(); - linkflag= MEM_callocN(sizeof(char)*me->totface, "linkflaguv"); - - for(med=me->medge, a=0; a < me->totedge; a++, med++) - if(med->flag & ME_SEAM) - BLI_edgehash_insert(seamhash, med->v1, med->v2, NULL); - - if (mode==0 || mode==1) { - /* only put face under cursor in array */ - mf= ((MFace*)me->mface) + index; - hash_add_face(ehash, mf); - linkflag[index]= 1; - } - else { - /* fill array by selection */ - mf= me->mface; - for(a=0; atotface; a++, mf++) { - if(mf->flag & ME_HIDE); - else if(mf->flag & ME_FACE_SEL) { - hash_add_face(ehash, mf); - linkflag[a]= 1; - } - } - } - - while(doit) { - doit= 0; - - /* expand selection */ - mf= me->mface; - for(a=0; atotface; a++, mf++) { - if(mf->flag & ME_HIDE) - continue; - - if(!linkflag[a]) { - mark= 0; - - if(!BLI_edgehash_haskey(seamhash, mf->v1, mf->v2)) - if(BLI_edgehash_haskey(ehash, mf->v1, mf->v2)) - mark= 1; - if(!BLI_edgehash_haskey(seamhash, mf->v2, mf->v3)) - if(BLI_edgehash_haskey(ehash, mf->v2, mf->v3)) - mark= 1; - if(mf->v4) { - if(!BLI_edgehash_haskey(seamhash, mf->v3, mf->v4)) - if(BLI_edgehash_haskey(ehash, mf->v3, mf->v4)) - mark= 1; - if(!BLI_edgehash_haskey(seamhash, mf->v4, mf->v1)) - if(BLI_edgehash_haskey(ehash, mf->v4, mf->v1)) - mark= 1; - } - else if(!BLI_edgehash_haskey(seamhash, mf->v3, mf->v1)) - if(BLI_edgehash_haskey(ehash, mf->v3, mf->v1)) - mark = 1; - - if(mark) { - linkflag[a]= 1; - hash_add_face(ehash, mf); - doit= 1; - } - } - } - - } - - BLI_edgehash_free(ehash, NULL); - BLI_edgehash_free(seamhash, NULL); - - if(mode==0 || mode==2) { - for(a=0, mf=me->mface; atotface; a++, mf++) - if(linkflag[a]) - mf->flag |= ME_FACE_SEL; - else - mf->flag &= ~ME_FACE_SEL; - } - else if(mode==1) { - for(a=0, mf=me->mface; atotface; a++, mf++) - if(linkflag[a] && (mf->flag & ME_FACE_SEL)) - break; - - if (atotface) { - for(a=0, mf=me->mface; atotface; a++, mf++) - if(linkflag[a]) - mf->flag &= ~ME_FACE_SEL; - } - else { - for(a=0, mf=me->mface; atotface; a++, mf++) - if(linkflag[a]) - mf->flag |= ME_FACE_SEL; - } - } - - MEM_freeN(linkflag); - - BIF_undo_push("Select linked UV face"); - object_tface_flags_changed(OBACT, 0); -} - -/* Parametrizer */ -ParamHandle *construct_param_handle(EditMesh *em, short implicit, short fill, short sel) -{ - int a; - MTFace *tf; - - EditFace *efa; - EditEdge *eed; - EditVert *ev; - - ParamHandle *handle; - - handle = param_construct_begin(); - - /* we need the vert indicies */ - for (ev= em->verts.first, a=0; ev; ev= ev->next, a++) - ev->tmp.l = a; - - for (efa= em->faces.first; efa; efa= efa->next) { - ParamKey key, vkeys[4]; - ParamBool pin[4], select[4]; - float *co[4]; - float *uv[4]; - int nverts; - - if ((efa->h) || (sel && (efa->f & SELECT)==0)) - continue; - - tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - - if (implicit && - !( simaUVSel_Check(efa, tf, 0) || - simaUVSel_Check(efa, tf, 1) || - simaUVSel_Check(efa, tf, 2) || - (efa->v4 && simaUVSel_Check(efa, tf, 3)) ) - ) { - continue; - } - - key = (ParamKey)efa; - vkeys[0] = (ParamKey)efa->v1->tmp.l; - vkeys[1] = (ParamKey)efa->v2->tmp.l; - vkeys[2] = (ParamKey)efa->v3->tmp.l; - - co[0] = efa->v1->co; - co[1] = efa->v2->co; - co[2] = efa->v3->co; - - uv[0] = tf->uv[0]; - uv[1] = tf->uv[1]; - uv[2] = tf->uv[2]; - - pin[0] = ((tf->unwrap & TF_PIN1) != 0); - pin[1] = ((tf->unwrap & TF_PIN2) != 0); - pin[2] = ((tf->unwrap & TF_PIN3) != 0); - - select[0] = ((simaUVSel_Check(efa, tf, 0)) != 0); - select[1] = ((simaUVSel_Check(efa, tf, 1)) != 0); - select[2] = ((simaUVSel_Check(efa, tf, 2)) != 0); - - if (efa->v4) { - vkeys[3] = (ParamKey)efa->v4->tmp.l; - co[3] = efa->v4->co; - uv[3] = tf->uv[3]; - pin[3] = ((tf->unwrap & TF_PIN4) != 0); - select[3] = (simaUVSel_Check(efa, tf, 3) != 0); - nverts = 4; - } - else - nverts = 3; - - param_face_add(handle, key, nverts, vkeys, co, uv, pin, select); - } - - if (!implicit) { - for (eed= em->edges.first; eed; eed= eed->next) { - if(eed->seam) { - ParamKey vkeys[2]; - vkeys[0] = (ParamKey)eed->v1->tmp.l; - vkeys[1] = (ParamKey)eed->v2->tmp.l; - param_edge_set_seam(handle, vkeys); - } - } - } - - param_construct_end(handle, fill, implicit); - - return handle; -} - - -extern int EM_texFaceCheck(void); - -void unwrap_lscm(short seamcut) -{ - EditMesh *em = G.editMesh; - ParamHandle *handle; - short abf = G.scene->toolsettings->unwrapper == 1; - short fillholes = G.scene->toolsettings->uvcalc_flag & 1; - - /* add uvs if there not here */ - if (!EM_texFaceCheck()) { - if (em && em->faces.first) - EM_add_data_layer(&em->fdata, CD_MTFACE); - - if (!EM_texFaceCheck()) - return; - - /* select new UV's */ - if ((G.sima==0 || G.sima->flag & SI_SYNC_UVSEL)==0) { - EditFace *efa; - MTFace *tf; - for(efa=em->faces.first; efa; efa=efa->next) { - tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE); - simaFaceSel_Set(efa, tf); - } - } - } - - handle = construct_param_handle(em, 0, fillholes, seamcut == 0); - - param_lscm_begin(handle, PARAM_FALSE, abf); - param_lscm_solve(handle); - param_lscm_end(handle); - - param_pack(handle); - - param_flush(handle); - - param_delete(handle); - - if (!seamcut) - BIF_undo_push("UV unwrap"); - - object_uvs_changed(OBACT); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -void minimize_stretch_tface_uv(void) -{ - EditMesh *em = G.editMesh; - ParamHandle *handle; - double lasttime; - short doit = 1, escape = 0, val, blend = 0; - unsigned short event = 0; - short fillholes = G.scene->toolsettings->uvcalc_flag & 1; - - if(!EM_texFaceCheck()) return; - - handle = construct_param_handle(em, 1, fillholes, 1); - - lasttime = PIL_check_seconds_timer(); - - param_stretch_begin(handle); - - while (doit) { - param_stretch_iter(handle); - - while (qtest()) { - event= extern_qread(&val); - - if (val) { - switch (event) { - case ESCKEY: - escape = 1; - case RETKEY: - case PADENTER: - doit = 0; - break; - case PADPLUSKEY: - case WHEELUPMOUSE: - if (blend < 10) { - blend++; - param_stretch_blend(handle, blend*0.1f); - param_flush(handle); - lasttime = 0.0f; - } - break; - case PADMINUS: - case WHEELDOWNMOUSE: - if (blend > 0) { - blend--; - param_stretch_blend(handle, blend*0.1f); - param_flush(handle); - lasttime = 0.0f; - } - break; - } - } - else if ((event == LEFTMOUSE) || (event == RIGHTMOUSE)) { - escape = (event == RIGHTMOUSE); - doit = 0; - } - } - - if (!doit) - break; - - if (PIL_check_seconds_timer() - lasttime > 0.5) { - char str[100]; - - param_flush(handle); - - sprintf(str, "Stretch minimize. Blend %.2f.", blend*0.1f); - headerprint(str); - - lasttime = PIL_check_seconds_timer(); - object_uvs_changed(OBACT); - if(G.sima->lock) force_draw_plus(SPACE_VIEW3D, 0); - else force_draw(0); - } - } - - if (escape) - param_flush_restore(handle); - else - param_flush(handle); - - param_stretch_end(handle); - - param_delete(handle); - - BIF_undo_push("UV stretch minimize"); - - object_uvs_changed(OBACT); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -void pack_charts_tface_uv(void) -{ - EditMesh *em = G.editMesh; - ParamHandle *handle; - - if(!EM_texFaceCheck()) return; - - handle = construct_param_handle(em, 1, 0, 1); - param_pack(handle); - param_flush(handle); - param_delete(handle); - - BIF_undo_push("UV pack charts"); - - object_uvs_changed(OBACT); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); -} - -/* LSCM live mode */ - -static ParamHandle *liveHandle = NULL; - -void unwrap_lscm_live_begin(void) -{ - EditMesh *em = G.editMesh; - short abf = G.scene->toolsettings->unwrapper == 1; - short fillholes = G.scene->toolsettings->uvcalc_flag & 1; - - if(!EM_texFaceCheck()) return; - - liveHandle = construct_param_handle(em, 0, fillholes, 1); - - param_lscm_begin(liveHandle, PARAM_TRUE, abf); -} - -void unwrap_lscm_live_re_solve(void) -{ - if (liveHandle) { - param_lscm_solve(liveHandle); - param_flush(liveHandle); - } -} - -void unwrap_lscm_live_end(short cancel) -{ - if (liveHandle) { - param_lscm_end(liveHandle); - if (cancel) - param_flush_restore(liveHandle); - param_delete(liveHandle); - liveHandle = NULL; - } -} - diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c deleted file mode 100644 index 2bf2d5d9ae9..00000000000 --- a/source/blender/src/usiblender.c +++ /dev/null @@ -1,1050 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - - /* placed up here because of crappy - * winsock stuff. - */ -#include -#include -#include - -#ifdef WIN32 -#include /* need to include windows.h so _WIN32_IE is defined */ -#ifndef _WIN32_IE -#define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ -#endif -#include /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */ -#include "BLI_winstuff.h" -#include /* getpid */ -#else -#include /* getpid */ -#endif -#include "MEM_guardedalloc.h" -#include "MEM_CacheLimiterC-Api.h" - -#include "BMF_Api.h" -#include "BIF_language.h" -#ifdef INTERNATIONAL -#include "FTF_Api.h" -#endif - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_linklist.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "DNA_object_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_sound_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" - -#include "BKE_blender.h" -#include "BKE_curve.h" -#include "BKE_displist.h" -#include "BKE_DerivedMesh.h" -#include "BKE_exotic.h" -#include "BKE_font.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_mball.h" -#include "BKE_node.h" -#include "BKE_packedFile.h" -#include "BKE_texture.h" -#include "BKE_utildefines.h" - -#ifdef WITH_VERSE -#include "BKE_verse.h" -#endif - -#include "BLI_vfontdata.h" - -#include "BIF_fsmenu.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_usiblender.h" -#include "BIF_drawtext.h" -#include "BIF_editaction.h" -#include "BIF_editarmature.h" -#include "BIF_editlattice.h" -#include "BIF_editfont.h" -#include "BIF_editmesh.h" -#include "BIF_editmode_undo.h" -#include "BIF_editsound.h" -#include "BIF_filelist.h" -#include "BIF_poseobject.h" -#include "BIF_previewrender.h" -#include "BIF_renderwin.h" -#include "BIF_resources.h" -#include "BIF_screen.h" -#include "BIF_space.h" -#include "BIF_toolbox.h" -#include "BIF_cursors.h" - -#ifdef WITH_VERSE -#include "BIF_verse.h" -#endif - - -#include "BSE_drawview.h" -#include "BSE_edit.h" -#include "BSE_editipo.h" -#include "BSE_filesel.h" -#include "BSE_headerbuttons.h" -#include "BSE_node.h" - -#include "BLO_readfile.h" -#include "BLO_writefile.h" - -#include "BDR_drawobject.h" -#include "BDR_editobject.h" -#include "BDR_editcurve.h" -#include "BDR_imagepaint.h" -#include "BDR_vpaint.h" - -#include "BPY_extern.h" - -#include "blendef.h" - -#include "RE_pipeline.h" /* RE_ free stuff */ - -#include "radio.h" -#include "datatoc.h" - -#include "SYS_System.h" - -#include "PIL_time.h" - -/***/ - -/* define for setting colors in theme below */ -#define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; - -/* patching UserDef struct, set globals for UI stuff */ -static void init_userdef_file(void) -{ - - BIF_InitTheme(); // sets default again - - mainwindow_set_filename_to_title(""); // empty string re-initializes title to "Blender" - countall(); - G.save_over = 0; // start with save preference untitled.blend - - /* disable autoplay in .B.blend... */ - G.fileflags &= ~G_FILE_AUTOPLAY; - - /* the UserDef struct is not corrected with do_versions() .... ugh! */ - if(U.wheellinescroll == 0) U.wheellinescroll = 3; - if(U.menuthreshold1==0) { - U.menuthreshold1= 5; - U.menuthreshold2= 2; - } - if(U.tb_leftmouse==0) { - U.tb_leftmouse= 5; - U.tb_rightmouse= 5; - } - if(U.mixbufsize==0) U.mixbufsize= 2048; - if (BLI_streq(U.tempdir, "/")) { - char *tmp= getenv("TEMP"); - - strcpy(U.tempdir, tmp?tmp:"/tmp/"); - } - if (U.savetime <= 0) { - U.savetime = 1; - error(".B.blend is buggy, please consider removing it.\n"); - } - /* transform widget settings */ - if(U.tw_hotspot==0) { - U.tw_hotspot= 14; - U.tw_size= 20; // percentage of window size - U.tw_handlesize= 16; // percentage of widget radius - } - if(U.pad_rot_angle==0) - U.pad_rot_angle= 15; - - if(U.flag & USER_CUSTOM_RANGE) - vDM_ColorBand_store(&U.coba_weight); /* signal for derivedmesh to use colorband */ - - if (G.main->versionfile <= 191) { - strcpy(U.plugtexdir, U.textudir); - strcpy(U.sounddir, "/"); - } - - /* patch to set Dupli Armature */ - if (G.main->versionfile < 220) { - U.dupflag |= USER_DUP_ARM; - } - - /* userdef new option */ - if (G.main->versionfile <= 222) { - U.vrmlflag= USER_VRML_LAYERS; - } - - /* added seam, normal color, undo */ - if (G.main->versionfile <= 234) { - bTheme *btheme; - - U.uiflag |= USER_GLOBALUNDO; - if (U.undosteps==0) U.undosteps=32; - - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* check for alpha==0 is safe, then color was never set */ - if(btheme->tv3d.edge_seam[3]==0) { - SETCOL(btheme->tv3d.edge_seam, 230, 150, 50, 255); - } - if(btheme->tv3d.normal[3]==0) { - SETCOL(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255); - } - if(btheme->tv3d.face_dot[3]==0) { - SETCOL(btheme->tv3d.face_dot, 255, 138, 48, 255); - btheme->tv3d.facedot_size= 4; - } - } - } - if (G.main->versionfile <= 235) { - /* illegal combo... */ - if (U.flag & USER_LMOUSESELECT) - U.flag &= ~USER_TWOBUTTONMOUSE; - } - if (G.main->versionfile <= 236) { - bTheme *btheme; - /* new space type */ - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* check for alpha==0 is safe, then color was never set */ - if(btheme->ttime.back[3]==0) { - btheme->ttime = btheme->tsnd; // copy from sound - } - if(btheme->text.syntaxn[3]==0) { - SETCOL(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/ - SETCOL(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */ - SETCOL(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */ - SETCOL(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */ - SETCOL(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */ - } - } - } - if (G.main->versionfile <= 237) { - bTheme *btheme; - /* bone colors */ - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* check for alpha==0 is safe, then color was never set */ - if(btheme->tv3d.bone_solid[3]==0) { - SETCOL(btheme->tv3d.bone_solid, 200, 200, 200, 255); - SETCOL(btheme->tv3d.bone_pose, 80, 200, 255, 80); - } - } - } - if (G.main->versionfile <= 238) { - bTheme *btheme; - /* bone colors */ - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* check for alpha==0 is safe, then color was never set */ - if(btheme->tnla.strip[3]==0) { - SETCOL(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255); - SETCOL(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255); - } - } - } - if (G.main->versionfile <= 239) { - bTheme *btheme; - - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* Lamp theme, check for alpha==0 is safe, then color was never set */ - if(btheme->tv3d.lamp[3]==0) { - SETCOL(btheme->tv3d.lamp, 0, 0, 0, 40); -/* TEMPORAL, remove me! (ton) */ - U.uiflag |= USER_PLAINMENUS; - } - - /* check for text field selection highlight, set it to text editor highlight by default */ - if(btheme->tui.textfield_hi[3]==0) { - SETCOL(btheme->tui.textfield_hi, - btheme->text.shade2[0], - btheme->text.shade2[1], - btheme->text.shade2[2], - 255); - } - } - if(U.obcenter_dia==0) U.obcenter_dia= 6; - } - if (G.main->versionfile <= 241) { - bTheme *btheme; - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* Node editor theme, check for alpha==0 is safe, then color was never set */ - if(btheme->tnode.syntaxn[3]==0) { - /* re-uses syntax color storage */ - btheme->tnode= btheme->tv3d; - SETCOL(btheme->tnode.edge_select, 255, 255, 255, 255); - SETCOL(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */ - SETCOL(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */ - SETCOL(btheme->tnode.syntaxb, 127,127,127, 255); /* operator */ - SETCOL(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */ - SETCOL(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */ - } - /* Group theme colors */ - if(btheme->tv3d.group[3]==0) { - SETCOL(btheme->tv3d.group, 0x10, 0x40, 0x10, 255); - SETCOL(btheme->tv3d.group_active, 0x66, 0xFF, 0x66, 255); - } - /* Sequence editor theme*/ - if(btheme->tseq.movie[3]==0) { - SETCOL(btheme->tseq.movie, 81, 105, 135, 255); - SETCOL(btheme->tseq.image, 109, 88, 129, 255); - SETCOL(btheme->tseq.scene, 78, 152, 62, 255); - SETCOL(btheme->tseq.audio, 46, 143, 143, 255); - SETCOL(btheme->tseq.effect, 169, 84, 124, 255); - SETCOL(btheme->tseq.plugin, 126, 126, 80, 255); - SETCOL(btheme->tseq.transition, 162, 95, 111, 255); - SETCOL(btheme->tseq.meta, 109, 145, 131, 255); - } - if(!(btheme->tui.iconfile)) { - BLI_strncpy(btheme->tui.iconfile, "", sizeof(btheme->tui.iconfile)); - } - } - - /* set defaults for 3D View rotating axis indicator */ - /* since size can't be set to 0, this indicates it's not saved in .B.blend */ - if (U.rvisize == 0) { - U.rvisize = 15; - U.rvibright = 8; - U.uiflag |= USER_SHOW_ROTVIEWICON; - } - - } - if (G.main->versionfile <= 242) { - bTheme *btheme; - - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - /* long keyframe color */ - /* check for alpha==0 is safe, then color was never set */ - if(btheme->tact.strip[3]==0) { - SETCOL(btheme->tv3d.edge_sharp, 255, 32, 32, 255); - SETCOL(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 204); - SETCOL(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 204); - } - - /* IPO-Editor - Vertex Size*/ - if(btheme->tipo.vertex_size == 0) { - btheme->tipo.vertex_size= 3; - } - } - } - if (G.main->versionfile <= 243) { - /* set default number of recently-used files (if not set) */ - if (U.recent_files == 0) U.recent_files = 10; - } - if (G.main->versionfile < 245 || (G.main->versionfile == 245 && G.main->subversionfile < 3)) { - bTheme *btheme; - for(btheme= U.themes.first; btheme; btheme= btheme->next) { - SETCOL(btheme->tv3d.editmesh_active, 255, 255, 255, 128); - } - if(U.coba_weight.tot==0) - init_colorband(&U.coba_weight, 1); - } - if ((G.main->versionfile < 245) || (G.main->versionfile == 245 && G.main->subversionfile < 11)) { - bTheme *btheme; - for (btheme= U.themes.first; btheme; btheme= btheme->next) { - /* these should all use the same colour */ - SETCOL(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); - SETCOL(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255); - } - } - - /* GL Texture Garbage Collection (variable abused above!) */ - if (U.textimeout == 0) { - U.texcollectrate = 60; - U.textimeout = 120; - } - if (U.memcachelimit <= 0) { - U.memcachelimit = 32; - } - if (U.frameserverport == 0) { - U.frameserverport = 8080; - } - - MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024); - - reset_autosave(); - -#ifdef INTERNATIONAL - read_languagefile(); -#endif - - refresh_interface_font(); - -#ifdef WITH_VERSE - if(strlen(U.versemaster)<1) { - strcpy(U.versemaster, "master.uni-verse.org"); - } - if(strlen(U.verseuser)<1) { - char *name = verse_client_name(); - strcpy(U.verseuser, name); - MEM_freeN(name); - } -#endif - -} - -#ifdef WITH_VERSE -extern ListBase session_list; -#endif - -void BIF_read_file(char *name) -{ - extern short winqueue_break; /* editscreen.c */ - int retval; -#ifdef WITH_VERSE - struct VerseSession *session; - struct VNode *vnode; - - session = session_list.first; - while(session) { - vnode = session->nodes.lb.first; - while(vnode) { - switch(vnode->type) { - case V_NT_OBJECT: - unsubscribe_from_obj_node(vnode); - break; - case V_NT_GEOMETRY: - unsubscribe_from_geom_node(vnode); - break; - case V_NT_BITMAP: - unsubscribe_from_bitmap_node(vnode); - break; - } - vnode = vnode->next; - } - session = session->next; - } -#endif - - /* first try to read exotic file formats... */ - /* it throws error box when file doesnt exist and returns -1 */ - retval= BKE_read_exotic(name); - - if (retval== 0) { - /* we didn't succeed, now try to read Blender file */ - retval= BKE_read_file(name, NULL); - - mainwindow_set_filename_to_title(G.main->name); - countall(); - sound_initialize_sounds(); - - winqueue_break= 1; /* leave queues everywhere */ - - if(retval==2) init_userdef_file(); // in case a userdef is read from regular .blend - - if (retval!=0) G.relbase_valid = 1; - - undo_editmode_clear(); - BKE_reset_undo(); - BKE_write_undo("original"); /* save current state */ - - refresh_interface_font(); - } - else if(retval==1) - BIF_undo_push("Import file"); -} - -static void outliner_242_patch(void) -{ - ScrArea *sa; - - for(sa= G.curscreen->areabase.first; sa; sa= sa->next) { - SpaceLink *sl= sa->spacedata.first; - for(; sl; sl= sl->next) { - if(sl->spacetype==SPACE_OOPS) { - SpaceOops *soops= (SpaceOops *)sl; - if(soops->type!=SO_OUTLINER) { - soops->type= SO_OUTLINER; - init_v2d_oops(sa, soops); - } - } - } - } - G.fileflags |= G_FILE_GAME_MAT; -} - -/* only here settings for fullscreen */ -int BIF_read_homefile(int from_memory) -{ - char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR]; - char *home= BLI_gethome(); - int success; - struct TmpFont *tf; - - BLI_clean(home); - - tf= G.ttfdata.first; - while(tf) - { - freePackedFile(tf->pf); - tf->pf = NULL; - tf->vfont = NULL; - tf= tf->next; - } - BLI_freelistN(&G.ttfdata); - - G.relbase_valid = 0; - if (!from_memory) BLI_make_file_string(G.sce, tstr, home, ".B.blend"); - strcpy(scestr, G.sce); /* temporal store */ - - /* prevent loading no UI */ - G.fileflags &= ~G_FILE_NO_UI; - - if (!from_memory && BLI_exists(tstr)) { - success = BKE_read_file(tstr, NULL); - } else { - success = BKE_read_file_from_memory(datatoc_B_blend, datatoc_B_blend_size, NULL); - /* outliner patch for 2.42 .b.blend */ - outliner_242_patch(); - } - - BLI_clean(scestr); - strcpy(G.sce, scestr); - - space_set_commmandline_options(); - - init_userdef_file(); - - undo_editmode_clear(); - BKE_reset_undo(); - BKE_write_undo("original"); /* save current state */ - - return success; -} - - -static void get_autosave_location(char buf[FILE_MAXDIR+FILE_MAXFILE]) -{ - char pidstr[32]; -#ifdef WIN32 - char subdir[9]; - char savedir[FILE_MAXDIR]; -#endif - - sprintf(pidstr, "%d.blend", abs(getpid())); - -#ifdef WIN32 - if (!BLI_exists(U.tempdir)) { - BLI_strncpy(subdir, "autosave", sizeof(subdir)); - BLI_make_file_string("/", savedir, BLI_gethome(), subdir); - - /* create a new autosave dir - * function already checks for existence or not */ - BLI_recurdir_fileops(savedir); - - BLI_make_file_string("/", buf, savedir, pidstr); - return; - } -#endif - - BLI_make_file_string("/", buf, U.tempdir, pidstr); -} - -void BIF_read_autosavefile(void) -{ - char tstr[FILE_MAX], scestr[FILE_MAX]; - int save_over; - - BLI_strncpy(scestr, G.sce, FILE_MAX); /* temporal store */ - - get_autosave_location(tstr); - - save_over = G.save_over; - BKE_read_file(tstr, NULL); - G.save_over = save_over; - BLI_strncpy(G.sce, scestr, FILE_MAX); -} - -/* free strings of open recent files */ -static void free_openrecent(void) -{ - struct RecentFile *recent; - - for(recent = G.recent_files.first; recent; recent=recent->next) - MEM_freeN(recent->filename); - - BLI_freelistN(&(G.recent_files)); -} - -static void readBlog(void) -{ - char name[FILE_MAX], filename[FILE_MAX]; - LinkNode *l, *lines; - struct RecentFile *recent; - char *line; - int num; - - BLI_make_file_string("/", name, BLI_gethome(), ".Blog"); - lines= BLI_read_file_as_lines(name); - - G.recent_files.first = G.recent_files.last = NULL; - - /* read list of recent opend files from .Blog to memory */ - for (l= lines, num= 0; l && (numnext, num++) { - line = l->link; - if (!BLI_streq(line, "")) { - if (num==0) - strcpy(G.sce, line); - - recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); - BLI_addtail(&(G.recent_files), recent); - recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file"); - recent->filename[0] = '\0'; - - strcpy(recent->filename, line); - } - } - - if(G.sce[0] == 0) - BLI_make_file_string("/", G.sce, BLI_gethome(), "untitled.blend"); - - BLI_free_file_lines(lines); - -#ifdef WIN32 - /* Add the drive names to the listing */ - { - __int64 tmp; - char folder[MAX_PATH]; - char tmps[4]; - int i; - - tmp= GetLogicalDrives(); - - for (i=2; i < 26; i++) { - if ((tmp>>i) & 1) { - tmps[0]='a'+i; - tmps[1]=':'; - tmps[2]='\\'; - tmps[3]=0; - - fsmenu_insert_entry(tmps, 0, 0); - } - } - - /* Adding Desktop and My Documents */ - fsmenu_append_separator(); - - SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0); - fsmenu_insert_entry(folder, 0, 0); - SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0); - fsmenu_insert_entry(folder, 0, 0); - - fsmenu_append_separator(); - } -#endif - - BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); - lines= BLI_read_file_as_lines(name); - - for (l= lines; l; l= l->next) { - char *line= l->link; - - if (!BLI_streq(line, "")) { - fsmenu_insert_entry(line, 0, 1); - } - } - - fsmenu_append_separator(); - - /* add last saved file */ - BLI_split_dirfile(G.sce, name, filename); /* G.sce shouldn't be relative */ - - fsmenu_insert_entry(name, 0, 0); - - BLI_free_file_lines(lines); -} - -static void writeBlog(void) -{ - struct RecentFile *recent, *next_recent; - char name[FILE_MAXDIR+FILE_MAXFILE]; - FILE *fp; - int i; - - BLI_make_file_string("/", name, BLI_gethome(), ".Blog"); - - recent = G.recent_files.first; - /* refresh .Blog of recent opened files, when current file was changed */ - if(!(recent) || (strcmp(recent->filename, G.sce)!=0)) { - fp= fopen(name, "w"); - if (fp) { - /* add current file to the beginning of list */ - recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile"); - recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file"); - recent->filename[0] = '\0'; - strcpy(recent->filename, G.sce); - BLI_addhead(&(G.recent_files), recent); - /* write current file to .Blog */ - fprintf(fp, "%s\n", recent->filename); - recent = recent->next; - i=1; - /* write rest of recent opened files to .Blog */ - while((ifilename, G.sce)!=0) { - fprintf(fp, "%s\n", recent->filename); - recent = recent->next; - } - else { - next_recent = recent->next; - MEM_freeN(recent->filename); - BLI_freelinkN(&(G.recent_files), recent); - recent = next_recent; - } - i++; - } - fclose(fp); - } - } -} - -static void do_history(char *name) -{ - char tempname1[FILE_MAXDIR+FILE_MAXFILE], tempname2[FILE_MAXDIR+FILE_MAXFILE]; - int hisnr= U.versions; - - if(U.versions==0) return; - if(strlen(name)<2) return; - - while( hisnr > 1) { - sprintf(tempname1, "%s%d", name, hisnr-1); - sprintf(tempname2, "%s%d", name, hisnr); - - if(BLI_rename(tempname1, tempname2)) - error("Unable to make version backup"); - - hisnr--; - } - - /* is needed when hisnr==1 */ - sprintf(tempname1, "%s%d", name, hisnr); - - if(BLI_rename(name, tempname1)) - error("Unable to make version backup"); -} - -void BIF_write_file(char *target) -{ - Library *li; - int writeflags, len; - char di[FILE_MAX]; - char *err; - - len = strlen(target); - - if (len == 0) return; - if (len >= FILE_MAX) { - error("Path too long, cannot save"); - return; - } - - /* send the OnSave event */ - if (G.f & G_DOSCRIPTLINKS) BPY_do_pyscript(&G.scene->id, SCRIPT_ONSAVE); - - for (li= G.main->library.first; li; li= li->id.next) { - if (BLI_streq(li->name, target)) { - error("Cannot overwrite used library"); - return; - } - } - - if (!BLO_has_bfile_extension(target) && (len+6 < FILE_MAX)) { - sprintf(di, "%s.blend", target); - } else { - strcpy(di, target); - } - - if (BLI_exists(di)) { - if(!saveover(di)) - return; - } - - if(G.obedit) { - exit_editmode(0); /* 0 = no free data */ - } - if (G.fileflags & G_AUTOPACK) { - packAll(); - } - - waitcursor(1); // exit_editmode sets cursor too - - do_history(di); - - /* we use the UserDef to define compression flag */ - writeflags= G.fileflags & ~G_FILE_COMPRESS; - if(U.flag & USER_FILECOMPRESS) - writeflags |= G_FILE_COMPRESS; - - if (BLO_write_file(di, writeflags, &err)) { - strcpy(G.sce, di); - G.relbase_valid = 1; - strcpy(G.main->name, di); /* is guaranteed current file */ - - mainwindow_set_filename_to_title(G.main->name); - - G.save_over = 1; - - writeBlog(); - } else { - error("%s", err); - } - - waitcursor(0); -} - -void BIF_write_homefile(void) -{ - char *err, tstr[FILE_MAXDIR+FILE_MAXFILE]; - int write_flags; - - BLI_make_file_string("/", tstr, BLI_gethome(), ".B.blend"); - - /* force save as regular blend file */ - write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); -} - -void BIF_write_autosave(void) -{ - char *err, tstr[FILE_MAXDIR+FILE_MAXFILE]; - int write_flags; - - get_autosave_location(tstr); - - /* force save as regular blend file */ - write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); - BLO_write_file(tstr, write_flags, &err); -} - -/* if global undo; remove tempsave, otherwise rename */ -static void delete_autosave(void) -{ - char tstr[FILE_MAXDIR+FILE_MAXFILE]; - - get_autosave_location(tstr); - - if (BLI_exists(tstr)) { - char str[FILE_MAXDIR+FILE_MAXFILE]; - BLI_make_file_string("/", str, U.tempdir, "quit.blend"); - - if(U.uiflag & USER_GLOBALUNDO) BLI_delete(tstr, 0, 0); - else BLI_rename(tstr, str); - } -} - -/***/ - -static void initbuttons(void) -{ - uiDefFont(UI_HELVB, - BMF_GetFont(BMF_kHelveticaBold14), - BMF_GetFont(BMF_kHelveticaBold12), - BMF_GetFont(BMF_kHelveticaBold10), - BMF_GetFont(BMF_kHelveticaBold8)); - uiDefFont(UI_HELV, - BMF_GetFont(BMF_kHelvetica12), - BMF_GetFont(BMF_kHelvetica12), - BMF_GetFont(BMF_kHelvetica10), - BMF_GetFont(BMF_kHelveticaBold8)); - - glClearColor(.7f, .7f, .6f, 0.0); - - G.font= BMF_GetFont(BMF_kHelvetica12); - G.fonts= BMF_GetFont(BMF_kHelvetica10); - G.fontss= BMF_GetFont(BMF_kHelveticaBold8); - - clear_matcopybuf(); - - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); -} - - -static void sound_init_listener(void) -{ - G.listener = MEM_callocN(sizeof(bSoundListener), "soundlistener"); - G.listener->gain = 1.0; - G.listener->dopplerfactor = 1.0; - G.listener->dopplervelocity = 340.29f; -} - -void BIF_init(void) -{ - - initscreen(); /* for (visuele) speed, this first, then setscreen */ - initbuttons(); - InitCursorData(); - sound_init_listener(); - init_node_butfuncs(); - - BIF_preview_init_dbase(); - BIF_read_homefile(0); - - BIF_resources_init(); /* after homefile, to dynamically load an icon file based on theme settings */ - - BIF_filelist_init_icons(); - - init_gl_stuff(); /* drawview.c, after homefile */ - readBlog(); - BLI_strncpy(G.lib, G.sce, FILE_MAX); -} - -/***/ - -extern ListBase editNurb; -extern ListBase editelems; - -void exit_usiblender(void) -{ - struct TmpFont *tf; - tf= G.ttfdata.first; - while(tf) - { - freePackedFile(tf->pf); - tf->pf= NULL; - tf->vfont= NULL; - tf= tf->next; - } - BLI_freelistN(&G.ttfdata); -#ifdef WITH_VERSE - end_all_verse_sessions(); -#endif - free_openrecent(); - - freeAllRad(); - BKE_freecubetable(); - - if (G.background == 0) - sound_end_all_sounds(); - - if(G.obedit) { - if(G.obedit->type==OB_FONT) { - free_editText(); - } - else if(G.obedit->type==OB_MBALL) BLI_freelistN(&editelems); - free_editMesh(G.editMesh); - } - - free_editLatt(); - free_editArmature(); - free_posebuf(); - - /* before free_blender so py's gc happens while library still exists */ - /* needed at least for a rare sigsegv that can happen in pydrivers */ - BPY_end_python(); - - fastshade_free_render(); /* shaded view */ - free_blender(); /* blender.c, does entire library */ - free_matcopybuf(); - free_ipocopybuf(); - free_actcopybuf(); - free_vertexpaint(); - free_imagepaint(); - - /* editnurb can remain to exist outside editmode */ - freeNurblist(&editNurb); - - fsmenu_free(); - -#ifdef INTERNATIONAL - free_languagemenu(); -#endif - - RE_FreeAllRender(); - - free_txt_data(); - - sound_exit_audio(); - if(G.listener) MEM_freeN(G.listener); - - - libtiff_exit(); - -#ifdef WITH_QUICKTIME - quicktime_exit(); -#endif - - if (!G.background) { - BIF_resources_free(); - - BIF_filelist_free_icons(); - - BIF_close_render_display(); - mainwindow_close(); - } - -#ifdef INTERNATIONAL - FTF_End(); -#endif - - if (copybuf) MEM_freeN(copybuf); - if (copybufinfo) MEM_freeN(copybufinfo); - - /* undo free stuff */ - undo_editmode_clear(); - - BKE_undo_save_quit(); // saves quit.blend if global undo is on - BKE_reset_undo(); - - BLI_freelistN(&U.themes); - BIF_preview_free_dbase(); - - if(totblock!=0) { - printf("Error Totblock: %d\n",totblock); - MEM_printmemlist(); - } - delete_autosave(); - - printf("\nBlender quit\n"); - -#ifdef WIN32 - /* ask user to press enter when in debug mode */ - if(G.f & G_DEBUG) { - printf("press enter key to exit...\n\n"); - getchar(); - } -#endif - - - SYS_DeleteSystem(SYS_GetSystem()); - - exit(G.afbreek==1); -} diff --git a/source/blender/src/verse_common.c b/source/blender/src/verse_common.c deleted file mode 100644 index d91c09dc2cd..00000000000 --- a/source/blender/src/verse_common.c +++ /dev/null @@ -1,298 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Jiri Hnidek. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef WITH_VERSE - -#include -#include - -#include "MEM_guardedalloc.h" - -#include "mydevice.h" - -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" - -#include "BKE_global.h" -#include "BKE_blender.h" - -#include "BIF_verse.h" -#include "BIF_space.h" -#include "BIF_interface.h" - -extern ListBase session_list; -extern ListBase server_list; - -/* - * this function creates popup menu with all active VerseSessions - * it return pointer at selected VerseSession, if no VerseSession - * is selected, then NULL is returned - */ -VerseSession *session_menu(void) -{ - struct VerseSession *session; - char session_number[10]; - short i=1, num=1; - char session_address_list[1024]; /* pupmenu business */ - - session_number[0] = '\0'; - session_address_list[0] = '\0'; - - strcat(session_address_list, "Session list %t"); - - session = session_list.first; - - while(session){ - strcat(session_address_list, "| "); - strcat(session_address_list, session->address); - strcat(session_address_list, " %x"); - sprintf(session_number, "%d", num); - strcat(session_address_list, session_number); - num++; - session = session->next; - } - - printf("session list: %s\n", session_address_list); - num = pupmenu(session_address_list); - - if(num==-1) return NULL; - - session = session_list.first; - - while(session) { - if(i==num) return session; - i++; - session = session->next; - } - - return NULL; -} - -/* - * returns name of verse client (it is used as avatar's name) - */ -char *verse_client_name(void) -{ - char *client_name; - char blender_version[5]; - short name_lenght = 14; - -#ifndef WIN32 - char *hostname; - hostname = getenv("HOSTNAME"); - if(hostname) name_lenght += strlen(hostname); -#endif - - client_name = (char*)MEM_mallocN(sizeof(char)*name_lenght, "verse client name"); - client_name[0] = '\0'; - - strcat(client_name, "blender_"); - blender_version[0] = '\0'; - sprintf(blender_version, "%d", BLENDER_VERSION); - strcat(client_name, blender_version); - -#ifndef WIN32 - /* add at the end of the client name hostname */ - if(hostname) { - strcat(client_name, ":"); - strcat(client_name, hostname); - } -#endif - - return client_name; -} - -/*=========================================================== - * - * functions executed after calling callback functions - * - ============================================================*/ - -/* - * this function is called, when some tag was changed or new tag was created - */ -void post_tag_change(VTag *vtag) -{ - printf("\tnew tag %s was created or changed\n", vtag->name); -} - -/* - * this function is called, when verse taggroup was created - */ -void post_taggroup_create(VTagGroup *vtaggroup) -{ - printf("\tnew taggroup %s was created\n", vtaggroup->name); -} - -/* - * this function is called after creating of new VerseNode - */ -void post_node_create(VNode *vnode) -{ - struct VerseSession *session = vnode->session; - - if((session->flag & VERSE_AUTOSUBSCRIBE) && (vnode->owner_id != VN_OWNER_MINE)) { - if(vnode->type == V_NT_OBJECT) { - create_object_from_verse_node(vnode); - } - else if(vnode->type == V_NT_GEOMETRY) { - create_mesh_from_geom_node(vnode);; - } - } - - allqueue(REDRAWOOPS, 0); -} - -/* - * this function is called after destroying of VerseNode - */ -void post_node_destroy(VNode *vnode) -{ - allqueue(REDRAWOOPS, 0); - - /* TODO: destroy bindings between vnode and blender data structures */ -} - -/* - * this function is calles after renaming of VerseNode by verse_server - */ -void post_node_name_set(VNode *vnode) -{ - /* if VerseNode has coresponding blender data structure, then - * change ID name of data structure */ - if(vnode->type==V_NT_OBJECT) { - struct Object *ob; - ob = (Object*)((VObjectData*)vnode->data)->object; - if(ob) { - char *str; - str = (char*)malloc(sizeof(char)*(strlen(vnode->name)+3)); - str[0] = '\0'; - strcat(str, "OB"); - strcat(str, vnode->name); - strncpy(ob->id.name, str, 23); - printf("\tob->id.name: %s\n", ob->id.name); - free(str); - } - } - else if(vnode->type==V_NT_GEOMETRY) { - struct Mesh *me; - - me = (Mesh*)((VGeomData*)vnode->data)->mesh; - if(me) { - char *str; - str = (char*)malloc(sizeof(char)*(strlen(vnode->name)+3)); - str[0] = '\0'; - strcat(str, "ME"); - strcat(str, vnode->name); - strncpy(me->id.name, str, 23); - printf("\tme->id.name: %s\n", me->id.name); - free(str); - } - } - - allqueue(REDRAWALL, 0); -} - -/* - * this function is called after acception connection with verse server - */ -void post_connect_accept(VerseSession *session) -{ - VerseServer *server; - - G.f |= G_VERSE_CONNECTED; - - session->counter = 0; - - server = server_list.first; - while(server) { - if(strcmp(server->ip, session->address)==0) { - server->flag = session->flag; - break; - } - server = server->next; - } - - allqueue(REDRAWOOPS, 0); -} - -void post_server_add(void) -{ - allqueue(REDRAWOOPS, 0); -} - -/* - * this function is called, when connestion with verse server is ended/terminated/etc. - */ -void post_connect_terminated(VerseSession *session) -{ - VerseServer *server; - server = server_list.first; - while(server) { - if(strcmp(server->ip, session->address)==0) { - server->flag = 0; - server->session=NULL; - break; - } - server = server->next; - } - - /* if it is last session, then no other will exist ... set Global flag */ - if((session->prev==NULL) && (session->next==NULL)) - G.f &= ~G_VERSE_CONNECTED; - - allqueue(REDRAWOOPS, 0); -} - -/* - * if connection wasn't accepted, then free VerseSession - * and print warning message with popupmenu - */ -void post_connect_update(VerseSession *session) -{ - if(session->flag & VERSE_CONNECTING) { - session->counter++; - if(session->counter > MAX_UNCONNECTED_EVENTS) { - char *str; - /* popup menu*/ - str = malloc(sizeof(char)*(strlen(session->address)+35)); - str[0]='\0'; - strcat(str, "Error%t|No response from server: "); - strcat(str, session->address); - pupmenu(str); - free(str); - - session->flag = 0; - session->counter = 0; - session->post_connect_terminated(session); - free_verse_session(session); - } - } -} - -#endif - diff --git a/source/blender/src/verse_image.c b/source/blender/src/verse_image.c deleted file mode 100644 index 9e9b478980e..00000000000 --- a/source/blender/src/verse_image.c +++ /dev/null @@ -1,343 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Jiri Hnidek. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef WITH_VERSE - -#include - -#include "mydevice.h" - -#include "BKE_verse.h" -#include "BKE_image.h" - -#include "MEM_guardedalloc.h" - -#include "DNA_image_types.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "BDR_drawmesh.h" - -#include "BIF_verse.h" -#include "BIF_space.h" - -/* - * unsubscribe from verse bitmap - */ -void unsubscribe_from_bitmap_node(VNode *vnode) -{ - if(vnode->type != V_NT_BITMAP) return; - - /* TODO */ -} - -/* - * upload image to verse server - */ -void push_image_to_verse_server(VerseSession *session, Image *image) -{ - ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); - struct VNode *vnode; - - if(!session) return; - - if(!(session->flag & VERSE_CONNECTED)) return; - - /* create "my" new object VerseNode */ - vnode= create_verse_node(session, -1 , V_NT_BITMAP, VN_OWNER_MINE); - /* create object data */ - vnode->data = create_bitmap_data(); - - /* set up name of VerseNode */ - vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(image->id.name)-1), "object node name"); - vnode->name[0] = '\0'; - strcat(vnode->name, image->id.name+2); - - /* set up dimension of image */ - if(ibuf) { - ((VBitmapData*)vnode->data)->width = ibuf->x; - ((VBitmapData*)vnode->data)->height = ibuf->y; - } - else { - ((VBitmapData*)vnode->data)->width = 0; - ((VBitmapData*)vnode->data)->height = 0; - } - ((VBitmapData*)(vnode->data))->height = 1; - - /* set up pointers between Object and VerseNode */ - ((VBitmapData*)vnode->data)->image = (void*)image; - image->vnode = (void*)vnode; - - /* add node to sending queue */ - add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE); -} - -/* - * synchronize blender image channel (R,G,B,A) with verse bitmap layer - */ -void sync_blender_image_channel_with_verse_layer(VNode *vnode, VBitmapLayer *vblayer) -{ - struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image; - struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); - unsigned char *rect; - int x, y, height, t_width, i, channel=0; - - if(!image) return; - - if(!ibuf) return; - - rect = (unsigned char*)ibuf->rect; - - /* select channel due to verse layer name */ - if(strcmp(vblayer->name,"col_r")==0) - channel = 0; - else if(strcmp(vblayer->name,"col_g")==0) - channel = 1; - else if(strcmp(vblayer->name, "col_b")==0) - channel = 2; - else if(strcmp(vblayer->name,"alpha")==0) - channel = 3; - -#ifdef VERSE_DEBUG_PRINT - printf(" %s:%d\n", vblayer->name, channel); -#endif - - height = ((VBitmapData*)(vnode->data))->height; - t_width = ((VBitmapData*)(vnode->data))->t_width; - - i = (height-1)*t_width; - -#ifdef VERSE_DEBUG_PRINT - printf("\ti:%d\n", i); -#endif - - if(vblayer->type==VN_B_LAYER_UINT8) { - unsigned char *vuint8 = (unsigned char*)vblayer->data; - for(y=height-1; y>=0; y--, i=y*t_width) - for(x=0; xx; x++, rect+=4, i++) - rect[channel] = (char)vuint8[i]; - } - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} - -/* - * synchronize blender image with verse image - */ -void sync_blender_image_with_verse_bitmap_node(VNode *vnode) -{ - struct VBitmapLayer *vblayer; - - vblayer = ((VBitmapData*)(vnode->data))->layers.lb.first; - - while(vblayer) { -#ifdef VERSE_DEBUG_PRINT - printf("\tsyncing layer:"); -#endif - sync_blender_image_channel_with_verse_layer(vnode, vblayer); - vblayer = vblayer->next; - } -} - -/* - * This function is called, when some other verse client change dimension of image. - * It is neccesary to reallocate blender image too, when dimension of verse image - * is different from blender image. - */ -void post_bitmap_dimension_set(VNode *vnode) -{ - struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image; - struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); - - if(!image) return; - - if(!ibuf) return; - - if(vnode->owner_id == VN_OWNER_MINE) { - if( ((VBitmapData*)vnode->data)->layers.lb.first == NULL ) { - /* send all verse bitmap layers (RGBA) to verse server */ - printf("\tsending all bitmap layers to verse server\n"); - verse_send_b_layer_create(vnode->id, -1, "col_r", VN_B_LAYER_UINT8); - verse_send_b_layer_create(vnode->id, -1, "col_g", VN_B_LAYER_UINT8); - verse_send_b_layer_create(vnode->id, -1, "col_b", VN_B_LAYER_UINT8); - verse_send_b_layer_create(vnode->id, -1, "alpha", VN_B_LAYER_UINT8); - - return; - } - } - - if((ibuf->x!=((VBitmapData*)vnode->data)->width) || (ibuf->y!=((VBitmapData*)vnode->data)->height)) { - struct VBitmapLayer *vblayer; - struct ImBuf *new_ibuf; - - /* allocate new ibuf */ - new_ibuf= IMB_allocImBuf(((VBitmapData*)vnode->data)->width, - ((VBitmapData*)vnode->data)->height, 24, IB_rect, 0); - /* free old ibuf */ - BKE_image_signal(image, NULL, IMA_SIGNAL_FREE); - /* set up pointer at new ibuf */ - BKE_image_assign_ibuf(image, ibuf); - - /* sync blender image with all verse layers */ - vblayer = ((VBitmapData*)(vnode->data))->layers.lb.first; - while(vblayer) { - sync_blender_image_channel_with_verse_layer(vnode, vblayer); - vblayer = vblayer->next; - } - } -} - -/* - * when blender tries to upload image to verse server, then it is neccessary - * to push coresponding channel data to verse server, when verse bitmap layer - * was created - */ -void post_bitmap_layer_create(VBitmapLayer *vblayer) -{ - struct VNode *vnode = vblayer->vnode; - struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image; - struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); - unsigned char *rect; - short channel; -/* VNBTile tile[VN_B_TILE_SIZE*VN_B_TILE_SIZE]; - unsigned int width, t_width, height, t_height, x, y, i, j; */ - - /* if this application doesn't try to upload this image to verse - * server then do nothing */ - if(vnode->owner_id != VN_OWNER_MINE) return; - - if(!image) return; - - if(!ibuf) return; - - rect = (unsigned char*)ibuf->rect; - - if(strncmp(vblayer->name, "col_r", 5)) - channel = 0; - else if(strncmp(vblayer->name, "col_g", 5)) - channel = 1; - else if(strncmp(vblayer->name, "col_b", 5)) - channel = 2; - else if(strncmp(vblayer->name, "alpha", 5)) - channel = 3; - - /* TODO: send all data of channel to verse server */ -} - -/* - * dummy function now - */ -void post_bitmap_layer_destroy(VBitmapLayer *vblayer) -{ -} - -/* - * this function is executed, when some image changed tile comes from verse server, - * it is neccessary to do some crazy transformation here, because blender uses - * different (very unstandard) image coordinate system (begining of coordinate - * system is in bottom left corner) ... all other programs (including verse) has - * begining of image coordinate system in left top corner - */ -void post_bitmap_tile_set(VBitmapLayer *vblayer, unsigned int xs, unsigned int ys) -{ - struct VNode *vnode = vblayer->vnode; - struct Image *image = (Image*)((VBitmapData*)(vnode->data))->image; - struct ImBuf *ibuf= BKE_image_get_ibuf(image, NULL); - unsigned char *rect, *i_rect; - unsigned int x, y, t_width, t_height, height, m_ys, m_y, d, i, j, channel=0; - - if(!image) return; - - if(!ibuf) return; - - /* select channel due to verse layer name */ - if(strcmp(vblayer->name,"color_r")==0) - channel = 0; - else if(strcmp(vblayer->name,"color_g")==0) - channel = 1; - else if(strcmp(vblayer->name, "color_b")==0) - channel = 2; - else if(strcmp(vblayer->name,"transparency")==0) - channel = 3; - - i_rect = rect = (unsigned char*)ibuf->rect; - - /* width of verse image including all tiles */ - t_width =((VBitmapData*)vnode->data)->t_width; - /* height of verse image including all tiles */ - t_height =((VBitmapData*)vnode->data)->t_height; - /* height of blender image */ - height = ((VBitmapData*)vnode->data)->height; - - /* if the bitmap's dimensions are not integer multiples of the tile - * side length, eight, then d will not be zero (height of "uncomplete - * tile") */ - d = VN_B_TILE_SIZE - (t_height - height); - /* mirrored coordination of received tile */ - m_ys = t_height - ys - VN_B_TILE_SIZE; - - /* ys and m_ys are y axis, where we will do some changes */ - if(ys + VN_B_TILE_SIZE > height) { - m_ys = 0; - ys = ys + d - 1; - } - else { - m_ys = m_ys - VN_B_TILE_SIZE + d; - ys = ys + VN_B_TILE_SIZE - 1; - } - - /* "index" of blender image */ - j = m_ys*ibuf->x + xs; - /* index of verse image */ - i = ys*t_width + xs; - - /* pointer at image data, that will be changed in following loop */ - rect = i_rect + 4*j; - - /* it seems hackish, but I didn't find better solution :-/ */ - if(vblayer->type==VN_B_LAYER_UINT8) { - unsigned char *vuint8 = (unsigned char*)vblayer->data; - for(y=ys, m_y = m_ys; - (m_yy); - y--, m_y++, i=y*t_width+xs, j=m_y*ibuf->x+xs, rect=i_rect+4*j) - for(x=xs; (xx); x++, rect+=4, i++, j++) - rect[channel] = (char)vuint8[i]; - } - - free_realtime_image(image); - - /* redraw preview of image ... uncommented, because rendering - * was computed too often */ -/* BIF_preview_changed(ID_TE); */ - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); -} - -#endif - diff --git a/source/blender/src/verse_mesh.c b/source/blender/src/verse_mesh.c deleted file mode 100644 index 2257eac41f5..00000000000 --- a/source/blender/src/verse_mesh.c +++ /dev/null @@ -1,1629 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Jiri Hnidek. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef WITH_VERSE - -#include - -#include "MEM_guardedalloc.h" - -#include "mydevice.h" - -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" - -#include "BLI_dynamiclist.h" -#include "BLI_blenlib.h" -#include "BLI_edgehash.h" -#include "BLI_editVert.h" - -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_utildefines.h" -#include "BKE_verse.h" - -#include "BIF_verse.h" -#include "BIF_editmesh.h" -#include "BIF_space.h" -#include "BIF_screen.h" - -#include "BSE_edit.h" - -#include "editmesh.h" - -#include "verse.h" - -/* prototypes of static functions */ - -static void mark_changed_face_obsolete(struct VerseFace *vface); -static void sync_verseface_with_editface(struct VLayer *vlayer, struct VerseFace *vface); - -void createVerseVertNL(struct EditVert *ev, struct VNode *vnode, struct VLayer *vlayer); -static void createAllVerseVerts(struct VNode *vnode, struct VLayer *vlayer); -void createVerseFaceNL(struct EditFace *efa, struct VNode *vnode, struct VLayer *vlayer); -static void createAllVerseFaces(struct VNode *vnode, struct VLayer *vlayer); - -/*============================================================================= - * - * functions handling verse/blender FACES - * - *===========================================================================*/ - -/* - * create new VerseFace (polygon), due to information about EditFace - * put VerseFace to queue ... send to verse host (server) - */ -void createVerseFace(EditFace *efa) -{ - if(G.editMesh->vnode) { - struct VLayer *vlayer = find_verse_layer_type((VGeomData*)((VNode*)G.editMesh->vnode)->data, POLYGON_LAYER); - createVerseFaceNL(efa, (VNode*)G.editMesh->vnode, vlayer); - } - else efa->vface = NULL; -} - -/* - * create new VerseFace (polygon), due to information about EditFace - * put VerseFace to queue ... send to verse host (server) - * NL version of function (infomration about verse node and - * layer is known ... optimalisation) - */ -void createVerseFaceNL(EditFace *efa, VNode *vnode, VLayer *vlayer) -{ - struct VerseFace *vface; - - vface = (VerseFace*)create_verse_face(vlayer, vlayer->counter, -1, -1, -1, -1); - - vface->face = (void*)efa; - efa->vface = (void*)vface; - - vface->flag |= FACE_SEND_READY; - - /* EditVert #1 */ - if(efa->v1) { - if(efa->v1->vvert) { - vface->vvert0 = (VerseVert*)efa->v1->vvert; - if(((VerseVert*)efa->v1->vvert)->flag & VERT_RECEIVED) { - vface->v0 = ((VerseVert*)efa->v1->vvert)->id; - vface->counter--; - } - else - vface->flag &= ~FACE_SEND_READY; - } - } - else - vface->counter--; - - /* EditVert #2 */ - if(efa->v2) { - if(efa->v2->vvert) { - vface->vvert1 = (VerseVert*)efa->v2->vvert; - if(((VerseVert*)efa->v2->vvert)->flag & VERT_RECEIVED) { - vface->v1 = ((VerseVert*)efa->v2->vvert)->id; - vface->counter--; - } - else - vface->flag &= ~FACE_SEND_READY; - } - } - else - vface->counter--; - /* EditVert #3 */ - if(efa->v3) { - if(efa->v3->vvert) { - vface->vvert2 = (VerseVert*)efa->v3->vvert; - if(((VerseVert*)efa->v3->vvert)->flag & VERT_RECEIVED) { - vface->v2 = ((VerseVert*)efa->v3->vvert)->id; - vface->counter--; - } - else - vface->flag &= ~FACE_SEND_READY; - } - } - else - vface->counter--; - /* EditVert #4 */ - if(efa->v4) { - if(efa->v4->vvert) { - vface->vvert3 = (VerseVert*)efa->v4->vvert; - if(((VerseVert*)efa->v4->vvert)->flag & VERT_RECEIVED) { - vface->v3 = ((VerseVert*)efa->v4->vvert)->id; - vface->counter--; - } - else - vface->flag &= ~FACE_SEND_READY; - } - } - else - vface->counter--; - - add_item_to_send_queue(&(vlayer->queue), (void*)vface, VERSE_FACE); -} - -/* - * creates new verse faces, add all of then to queue ... send to verse server - */ -static void createAllVerseFaces(VNode *vnode, VLayer *vlayer) -{ - if(G.obedit) { - struct EditMesh *em; - struct EditFace *efa; - - em = G.editMesh; - - efa = em->faces.first; - /* push all EditFaces to the verse server */ - while(efa){ - createVerseFaceNL(efa, vnode, vlayer); - efa = efa->next; - } - } -} - -/* - * When verse face is changed during sending/receiving from verse server, then - * this verse face is marked as obsolete and it will be send again, when it - * will be received from verse server - */ -static void mark_changed_face_obsolete(VerseFace *vface) -{ - struct EditFace *efa = (EditFace*)vface->face; - - if(efa) { - if(vface->vvert0->vertex != efa->v1) vface->flag |= FACE_OBSOLETE; - if(vface->vvert1->vertex != efa->v2) vface->flag |= FACE_OBSOLETE; - if(vface->vvert2->vertex != efa->v3) vface->flag |= FACE_OBSOLETE; - if(vface->vvert3 && (vface->vvert3->vertex != efa->v4)) vface->flag |= FACE_OBSOLETE; - } -} - -/* - * this function will sync EditFace and VerseFace and it will send changes to - * verse server too - */ -static void sync_verseface_with_editface(VLayer *vlayer, VerseFace *vface) -{ - struct EditFace *efa = (EditFace*)vface->face; - int dosend = 0; - - /* edit face and probably verse face was deleted */ - if(!efa || (vface->flag & FACE_DELETED)) return; - - /* blender nor verse don't support such crazy things */ - if(!(vface->vvert0) || !(vface->vvert1) || !(vface->vvert2)) { - printf("\tERROR: vface->vvert0: %p, vface->vvert1: %p, vface->vvert2: %p\n", vface->vvert0, vface->vvert1, vface->vvert2); - return; - } - - /* initialize verse face flag */ - vface->flag |= FACE_SEND_READY; - - /* debug print */ -#if 0 - printf("\n"); - if(efa->v4) { - printf("\tefa->v1,v2,v3,v4->vvert->id: %d, %d, %d, %d\n", - ((VerseVert*)efa->v1->vvert)->id, - ((VerseVert*)efa->v2->vvert)->id, - ((VerseVert*)efa->v3->vvert)->id, - ((VerseVert*)efa->v4->vvert)->id); - printf("\tefa->v1,v2,v3,v4->vvert: %p, %p, %p, %p\n", - efa->v1->vvert, - efa->v2->vvert, - efa->v3->vvert, - efa->v4->vvert); - } - else { - printf("\tefa->v1,v2,v3->vvert->id: %d, %d, %d, NULL\n", - ((VerseVert*)efa->v1->vvert)->id, - ((VerseVert*)efa->v2->vvert)->id, - ((VerseVert*)efa->v3->vvert)->id); - printf("\tefa->v1,v2,v3,v4->vvert: %p, %p, %p, NULL\n", - efa->v1->vvert, - efa->v2->vvert, - efa->v3->vvert); - } - printf("\tvface->vvert0, vvvert1, vvvert2, vvvert3: %p, %p, %p, %p\n", - vface->vvert0, - vface->vvert1, - vface->vvert2, - vface->vvert3); - - printf("\tefa->v1, v2, v3, v4: %p, %p, %p, %p\n", - efa->v1, - efa->v2, - efa->v3, - efa->v4); - if(vface->vvert3) { - printf("\tvface->v0,v1,v2,v3: %d, %d, %d, %d\n", - vface->v0, - vface->v1, - vface->v2, - vface->v3); - printf("\tvface->vvert0,vvvert1,vvvert2,vvvert3->vertex: %p, %p, %p, %p\n", - vface->vvert0->vertex, - vface->vvert1->vertex, - vface->vvert2->vertex, - vface->vvert3->vertex); - } - else { - printf("\tvface->v0,v1,v2,v3: %d, %d, %d, NULL\n", - vface->v0, - vface->v1, - vface->v2); - printf("\tvface->vvert0,vvvert1,vvvert2->vertex: %p, %p, %p, NULL\n", - vface->vvert0->vertex, - vface->vvert1->vertex, - vface->vvert2->vertex); - } -#endif - - /* initialize counter of unreceived vertexes */ - vface->counter = 4; - - /* 1st vertex */ - if(vface->vvert0->vertex != efa->v1) { - dosend = 1; - vface->vvert0->counter--; - vface->vvert0 = (VerseVert*)efa->v1->vvert; - vface->v0 = vface->vvert0->id; - if(vface->vvert0->flag & VERT_RECEIVED) - vface->counter--; - else - vface->flag &= ~FACE_SEND_READY; - } - else - vface->counter--; - - /* 2nd vertex */ - if(vface->vvert1->vertex != efa->v2) { - dosend = 1; - vface->vvert1->counter--; - vface->vvert1 = (VerseVert*)efa->v2->vvert; - vface->v1 = vface->vvert1->id; - if(vface->vvert1->flag & VERT_RECEIVED) - vface->counter--; - else - vface->flag &= ~FACE_SEND_READY; - } - else - vface->counter--; - - /* 3th vertex */ - if(vface->vvert2->vertex != efa->v3) { - dosend = 1; - vface->vvert2->counter--; - vface->vvert2 = (VerseVert*)efa->v3->vvert; - vface->v2 = vface->vvert2->id; - if(vface->vvert2->flag & VERT_RECEIVED) - vface->counter--; - else - vface->flag &= ~FACE_SEND_READY; - } - else - vface->counter--; - - /* 4th vertex */ - if(vface->vvert3 && ((vface->vvert3->vertex != efa->v4) || (vface->vvert3 && !efa->v4) || (vface->v3 != vface->vvert3->id))) { - dosend = 1; - if(efa->v4) { - vface->vvert3->counter--; - vface->vvert3 = (VerseVert*)efa->v4->vvert; - vface->v3 = vface->vvert3->id; - if(vface->vvert3->flag & VERT_RECEIVED) - vface->counter--; - else - vface->flag &= ~FACE_SEND_READY; - } - else { - vface->vvert3->counter--; - vface->vvert3 = NULL; - vface->v3 = -1; - vface->counter--; - } - } - /* verse face has 4 vertexes now, not 3 vertexes as in past */ - else if(!(vface->vvert3) && efa->v4) { - dosend = 1; - vface->vvert3 = (VerseVert*)efa->v4->vvert; - vface->v3 = vface->vvert3->id; - if(vface->vvert3->flag & VERT_RECEIVED) - vface->counter--; - else - vface->flag &= ~FACE_SEND_READY; - } - else - vface->counter--; - - if(dosend) { - /* printf("\tsending CHANGED FACE\n"); - printf("\t\tnew: %d %d %d %d\n", vface->v0, vface->v1, vface->v2, vface->v3);*/ - vface->flag |= FACE_CHANGED; - /* remove verse face from list of received faces */ - BLI_dlist_rem_item(&(vlayer->dl), vface->id); - /* and add verse face again to sending queue */ - add_item_to_send_queue(&(vlayer->queue), (void*)vface, VERSE_FACE); - } -} - -/* - * this function will sync all VerseFaces with coresponding EditFaces, - * this is useful, when some editmesh tool has changed editface pointers at - * vertexes (edges), parameter of this function is geometry node - */ -void sync_all_versefaces_with_editfaces(VNode *vnode) -{ - struct VLayer *vlayer; - struct VerseFace *vface, *nvface; - - if(vnode->type != V_NT_GEOMETRY) return; - - vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - /* mark changed verse faces in sending queue as obsolete at the first time */ - vface = vlayer->queue.first; - while(vface) { - mark_changed_face_obsolete(vface); - vface = vface->next; - } - - /* send all received and changed verse face again to verse server */ - vface = vlayer->dl.lb.first; - while(vface) { - nvface = vface->next; - sync_verseface_with_editface(vlayer, vface); - vface = nvface; - } -} - -/* - * send delete polygon command to verse server - */ -void b_verse_send_face_delete(EditFace *efa) -{ - ((VerseFace*)efa->vface)->face = NULL; - send_verse_face_delete((VerseFace*)efa->vface); - efa->vface = NULL; -} - -/*============================================================================= - * - * functions handling verse/blender VERTEXES - * - *===========================================================================*/ - -/* - * this function will sync position of all VerseVerts with EditVerts - * this function is called after actions: Smooth, Noise and To Sphere, - * because position of vertexes isn't managed by transform system - */ -void sync_all_verseverts_with_editverts(VNode *vnode) -{ - struct VLayer *vlayer; - struct VerseVert *vvert; - - if(vnode->type != V_NT_GEOMETRY) return; - - vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - - vvert = vlayer->dl.lb.first; - - /* sync all received vertexes */ - while(vvert) { - send_versevert_pos(vvert); - vvert = vvert->next; - } - - vvert = vlayer->queue.first; - - /* sync all unreceived vertexes (mar pos as obsolete, when - * actual position was changed) */ - while(vvert) { - send_versevert_pos(vvert); - vvert = vvert->next; - } - - verse_callback_update(0); -} - -/* - * send delete vertex command to verse server - */ -void b_verse_send_vertex_delete(EditVert *eve) -{ - ((VerseVert*)eve->vvert)->vertex = NULL; - send_verse_vertex_delete((VerseVert*)eve->vvert); - eve->vvert = NULL; -} - -/* - * send position of verse vertex to verse server - */ -void send_versevert_pos(VerseVert *vvert) -{ - /* delete command was sent to verse server ... sending one - * more position command would create new vertex */ - if ((vvert->flag & VERT_DELETED) | (vvert->flag & VERT_OBSOLETE)) return; - - /* don't send position of verse vertex to verse server, because it could create - * new vertex */ - if(vvert->flag & VERT_RECEIVED) { - if(vvert->flag & VERT_LOCKED) { - /* when position of verse vert was sent to verse server - * and it wasn't received yet, then mark sent position - * as obsolete ... blender will automaticaly send actual - * position, when old will be received */ - vvert->flag |= VERT_POS_OBSOLETE; - } - else { - struct EditVert *eve = (EditVert*)vvert->vertex; - /* send position to verse server, when it is different from actual position */ - if(eve && (eve->co[0]!=vvert->co[0] || eve->co[1]!=vvert->co[1] || eve->co[2]!=vvert->co[2])) { - /* lock vertex and send its position to verse server, - * locking of vertex prevents from sending too many - * informations about vertex position during draging - * of vertex */ - vvert->flag |= VERT_LOCKED; - VECCOPY(vvert->co, eve->co); - send_verse_vertex(vvert); - } - } - } - else { - /* we created this vertex and we sent new position to verse server, but "confirmation" command about - * position of vertex didn't arrived yet, then we can't send new position of vertex ... we only mark - * position of vertex as obsolete and new position will be sent to verse server, when confirmation - * command will arive */ - struct EditVert *eve = (EditVert*)vvert->vertex; - if(eve && (eve->co[0]!=vvert->co[0] || eve->co[1]!=vvert->co[1] || eve->co[2]!=vvert->co[2])) { - vvert->flag |= VERT_POS_OBSOLETE; - } - } - - verse_callback_update(0); -} - -/* - * create new VerseVert due to information about EditVert, - * put VerseVert to queue ... send to verse host (server) - */ -void createVerseVert(EditVert *eve) -{ - if(G.editMesh->vnode) { - struct VLayer *vlayer = find_verse_layer_type((VGeomData*)((VNode*)G.editMesh->vnode)->data, VERTEX_LAYER); - createVerseVertNL(eve, (VNode*)G.editMesh->vnode, vlayer); - } - else eve->vvert = NULL; -} - -/* - * create new VerseVert due to information about EditVert, - * put VerseVert to queue ... send to verse host (server) - * NL version of function (infomration about verse node and - * layer is known ... optimalisation) - */ -void createVerseVertNL(EditVert *eve, VNode *vnode, VLayer *vlayer) -{ - struct VerseVert *vvert; - - vvert = create_verse_vertex(vlayer, vlayer->counter, eve->co[0], eve->co[1], eve->co[2]); - - vvert->vertex = (void*)eve; - eve->vvert = (void*)vvert; - - vvert->flag |= VERT_LOCKED; - -/* printf("\tsend_versevert_pos: %d create and LOCK \n", vvert->id);*/ - - /* add vvert to sending queue */ - add_item_to_send_queue(&(vlayer->queue), (void*)vvert, VERSE_VERT); -} - -/* - * create new verse vertexes due to all vertexes and send all of them to verse server - */ -static void createAllVerseVerts(VNode *vnode, VLayer *vlayer) -{ - if(G.obedit) { - struct EditMesh *em; - struct EditVert *eve; - - em = G.editMesh; - eve = em->verts.first; - - /* push all EditVertexes to the verse server */ - while(eve){ - createVerseVertNL(eve, vnode, vlayer); - eve = eve->next; - } - } -} - -/* - * unsubscribe from verse geometry layers of verse geometry node - * and clear bindings between verse node and mesh - */ -void unsubscribe_from_geom_node(VNode *vnode) -{ - struct VerseSession *session = vnode->session; - - struct VLayer *vlayer = ((VGeomData*)vnode->data)->layers.lb.first; - - if(vnode->type != V_NT_GEOMETRY) return; - - /* free bindings between verse node and blender mesh*/ - if(((VGeomData*)vnode->data)->mesh) { - ((Mesh*)((VGeomData*)vnode->data)->mesh)->vnode = NULL; - ((VGeomData*)vnode->data)->mesh = NULL; - } - - /* free bindings between verse node and blender editmesh */ - if(((VGeomData*)vnode->data)->editmesh) { - ((EditMesh*)((VGeomData*)vnode->data)->editmesh)->vnode = NULL; - ((VGeomData*)vnode->data)->editmesh = NULL; - } - - /* free all verse layer data and unsubscribe from all layers */ - while(vlayer) { - BLI_dlist_reinit(&(vlayer->dl)); - BLI_freelistN(&(vlayer->queue)); - BLI_freelistN(&(vlayer->orphans)); - - if(session->flag & VERSE_CONNECTED) - verse_send_g_layer_unsubscribe(vnode->id, vlayer->id); - - vlayer = vlayer->next; - } - -} - -/* =================================================================================== - * - * Function executed after execution of callback functions - * - * ===================================================================================*/ - -/* - * Actions executed after new VerseLayer is created - */ -void post_layer_create(struct VLayer *vlayer) -{ - /* if we are owners of VerseNode, then push geometry to verse server */ - if(vlayer->vnode->owner_id == VN_OWNER_MINE) { - switch(vlayer->type){ - case VN_G_LAYER_VERTEX_XYZ: -/* if(vlayer->id==0) createAllVerseVerts(vlayer->vnode, vlayer); - break;*/ - case VN_G_LAYER_POLYGON_CORNER_UINT32: -/* if(vlayer->id==1) createAllVerseFaces(vlayer->vnode, vlayer); - break;*/ - case VN_G_LAYER_VERTEX_UINT32: - case VN_G_LAYER_VERTEX_REAL: - case VN_G_LAYER_POLYGON_CORNER_REAL: - case VN_G_LAYER_POLYGON_FACE_UINT8: - case VN_G_LAYER_POLYGON_FACE_UINT32: - case VN_G_LAYER_POLYGON_FACE_REAL: - break; - } - } - else { - switch(vlayer->type) { - case VN_G_LAYER_VERTEX_XYZ: - case VN_G_LAYER_POLYGON_CORNER_UINT32: - case VN_G_LAYER_VERTEX_UINT32: - case VN_G_LAYER_VERTEX_REAL: - case VN_G_LAYER_POLYGON_CORNER_REAL: - case VN_G_LAYER_POLYGON_FACE_UINT8: - case VN_G_LAYER_POLYGON_FACE_UINT32: - case VN_G_LAYER_POLYGON_FACE_REAL: - break; - } - } -} - -/* - * Actions after destroying of VerseLayer - */ -void post_layer_destroy(struct VLayer *vlayer) -{ -} - -/* - * Actions executed after creating of new VerseVert, when object is in edit - * mode, and this client didn't create this VerseVert (vvert->vertex is NULL), - * then new editvert is created - */ -void post_vertex_create(VerseVert *vvert) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vvert->vlayer->vnode; - struct EditMesh *em=NULL; - - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh; - } - - /* when vert was changed during sending to verse server, then - * we have to send it to verse server again */ - if(vvert->flag & VERT_POS_OBSOLETE) { - vvert->flag &= ~VERT_POS_OBSOLETE; - - if(em && (vvert->vertex)) { - struct EditVert *eve = (EditVert*)vvert->vertex; - VECCOPY(vvert->co, eve->co); - send_verse_vertex(vvert); - verse_callback_update(0); - - return; - } - } - - if(em && !(vvert->vertex)) { - struct EditVert *eve; - - /* to prevent never ending loop of sending and receiving - * vertexes, because addvertlist() sends new vertex to verse - * server if em->vnode isn't NULL */ - em->vnode = NULL; - eve = addvertlist(vvert->co, NULL); - em->vnode = (void*)geom_vnode; - - eve->vvert = (void*)vvert; - vvert->vertex = (void*)eve; - - countall(); - - recalc_editnormals(); - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * Actions executed, when position of VerseVert was changed - * position of EditVert is changed in edit mode - */ -void post_vertex_set_xyz(VerseVert *vvert) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vvert->vlayer->vnode; - struct EditVert *eve = NULL; - - /* when vert was changed during sending to verse server, then - * we have to send it to verse server again */ - if(vvert->flag & VERT_POS_OBSOLETE) { - if(vvert->vertex) { - vvert->flag &= ~VERT_POS_OBSOLETE; - vvert->flag |= VERT_LOCKED; - - eve = (EditVert*)vvert->vertex; - VECCOPY(vvert->co, eve->co); - send_verse_vertex(vvert); - verse_callback_update(0); - } - else { - printf("\terror: vvert->vertex shouldn't be NULL\n"); - } - - return; - } - - /* when shared object is in edit mode, then update editmesh */ - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - if(vvert->vertex) { - eve = (EditVert*)vvert->vertex; - VECCOPY(eve->co, vvert->co); - recalc_editnormals(); - } - else { - printf("\terror: vvert->vertex shouldn't be NULL\n"); - } - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * Actions executed after deleting of VerseVert - */ -void post_vertex_delete(VerseVert *vvert) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vvert->vlayer->vnode; - struct EditMesh *em = NULL; - struct EditEdge *ed, *edn; - struct EditVert *eve = NULL; - - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh; - eve = (EditVert*)vvert->vertex; - } - - if(em && eve) { - /*printf("\tPOST_VERTEX_DELETE()\n");*/ - - /* delete all edges needing eve vertex */ - ed = em->edges.first; - while(ed) { - edn = ed->next; - if(ed->v1==eve || ed->v2==eve) { - remedge(ed); - free_editedge(ed); - } - ed = edn; - } - - eve->vvert = NULL; - BLI_remlink(&em->verts, eve); - free_editvert(eve); - vvert->vertex = NULL; - - countall(); - - recalc_editnormals(); - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * free constraint between VerseVert and EditVert - */ -void post_vertex_free_constraint(VerseVert *vvert) -{ - if(vvert->vertex) { - ((EditVert*)vvert->vertex)->vvert=NULL; - vvert->vertex=NULL; - } -} - -/* - * Action executed after setting up uint8 value of polygon - */ -void post_polygon_set_uint8(VerseFace *vface) -{ -} - -/* - * Action executed after creating of new VerseFace - */ -void post_polygon_create(VerseFace *vface) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vface->vlayer->vnode; - struct EditMesh *em = NULL; - - /* if verse face was set as deleted during sending to verse server, then send - * delete command to verse server now ... we know verse face id */ -/* if(vface->flag & FACE_DELETED) { - send_verse_face_delete(vface); - return; - }*/ - - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh; - } - - /* when face was changed during sending to verse server, then - * we have to send it to verse server again */ - if(vface->flag & FACE_OBSOLETE) { - vface->flag &= ~FACE_OBSOLETE; - sync_verseface_with_editface(vface->vlayer, vface); - return; - } - - if(em && !(vface->face) && (vface->counter==0)) { - struct VLayer *vlayer; - struct VerseVert *vvert; - struct EditFace *efa; - struct EditVert *eves[4]={NULL, NULL, NULL, NULL}; - uint32 vert_ids[4]={vface->v0, vface->v1, vface->v2, vface->v3}; - int i; - - /*printf("\tPOST_POLYGON_CREATE()\n");*/ - - vlayer = find_verse_layer_type((VGeomData*)geom_vnode->data, VERTEX_LAYER); - - for(i=0; i<4; i++) { - if(vert_ids[i] != -1) { - vvert = BLI_dlist_find_link(&(vlayer->dl), vert_ids[i]); - if(vvert) eves[i] = (EditVert*)vvert->vertex; - } - } - - /* to prevent never ending loop of sending and receiving - * faces, because addfacelist() sends new face to verse - * server if em->vnode isn't NULL */ - em->vnode = NULL; - efa = addfacelist(eves[0], eves[1], eves[2], eves[3], NULL, NULL); - em->vnode = geom_vnode; - - if(efa) { - efa->vface = vface; - vface->face = efa; - } - - countall(); - - recalc_editnormals(); - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * Action executed after changes of VerseFace - * ... order of vertexes was fliped, etc. - */ -void post_polygon_set_corner(VerseFace *vface) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vface->vlayer->vnode; - struct EditMesh *em = NULL; - struct EditFace *efa = NULL; - struct EditEdge *eed, *eedn; - - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh; - efa = (EditFace*)vface->face; - } - - if(em && efa) { - - /* when face was changed during sending to verse server, then - * we have to send it to verse server again */ - if(vface->flag & FACE_OBSOLETE) { - vface->flag &= ~FACE_OBSOLETE; - sync_verseface_with_editface(vface->vlayer, vface); - return; - } - - /* mark all edges, which are part of face efa */ - efa->e1->f2 = 1; - efa->e2->f2 = 1; - efa->e3->f2 = 1; - if(efa->e4) efa->e4->f2 = 1; - - /* change pointers at EdtitVerts and decrease counters of "old" - * VerseVertexes reference ... less VerseFaces will need them */ - if(vface->vvert0 != efa->v1->vvert) - efa->v1 = (EditVert*)vface->vvert0->vertex; - if(vface->vvert1 != efa->v2->vvert) - efa->v2 = (EditVert*)vface->vvert1->vertex; - if(vface->vvert2 != efa->v3->vvert) - efa->v3 = (EditVert*)vface->vvert2->vertex; - if(efa->v4) { - if(!vface->vvert3) - efa->v4 = NULL; - else if(vface->vvert3 != efa->v4->vvert) - efa->v4 = (EditVert*)vface->vvert3->vertex; - } - - /* change pointers at EditEdges */ - - /* 1st edge */ - eed = findedgelist(efa->v1, efa->v2); - if(eed) efa->e1 = eed; - else efa->e1 = addedgelist(efa->v1, efa->v2, NULL); - - /* 2nd edge */ - eed = findedgelist(efa->v2, efa->v3); - if(eed) efa->e2 = eed; - else efa->e2 = addedgelist(efa->v2, efa->v3, NULL); - - if(efa->v4) { - /* 3th edge */ - eed = findedgelist(efa->v2, efa->v3); - if(eed) efa->e3 = eed; - else efa->e3 = addedgelist(efa->v2, efa->v3, NULL); - /* 4th edge */ - eed = findedgelist(efa->v4, efa->v1); - if(eed) efa->e4 = eed; - else efa->e4 = addedgelist(efa->v4, efa->v1, NULL); - } - else { - /* 3th edge */ - eed = findedgelist(efa->v3, efa->v1); - if(eed) efa->e3 = eed; - else efa->e3 = addedgelist(efa->v3, efa->v1, NULL); - /* 4th edge */ - efa->e4 = NULL; - } - - /* unmark needed edges */ - efa = em->faces.first; - while(efa) { - efa->e1->f2 = 0; - efa->e2->f2 = 0; - efa->e3->f2 = 0; - if(efa->e4) efa->e4->f2 = 0; - efa = efa->next; - } - - /* delete all unneeded edges */ - eed = em->edges.first; - while(eed) { - eedn = eed->next; - if(eed->f2) { - remedge(eed); - free_editedge(eed); - } - eed = eedn; - } - - countall(); - - recalc_editnormals(); - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * Action executed after deleting of VerseFace - */ -void post_polygon_delete(VerseFace *vface) -{ - struct VNode *obj_vnode; - struct VNode *geom_vnode = vface->vlayer->vnode; - struct EditMesh *em = NULL; - struct EditFace *efa = NULL; - struct EditEdge *eed, *eedn; - - if(G.obedit && (((Mesh*)G.obedit->data)->vnode==geom_vnode)) { - em = (EditMesh*)((VGeomData*)geom_vnode->data)->editmesh; - efa = (EditFace*)vface->face; - } - - if(em && efa) { - /*printf("\tPOST_POLYGON_DELETE()\n");*/ - - /* mark all edges, which are part of face efa */ - efa->e1->f2 = 1; - efa->e2->f2 = 1; - efa->e3->f2 = 1; - if(efa->e4) efa->e4->f2 = 1; - - efa->vface = NULL; - BLI_remlink(&em->faces, efa); - free_editface(efa); - vface->face = NULL; - - /* following two crazy loops wouldn't be neccessary if verse spec - * would support edges */ - - /* unmark needed edges */ - efa = em->faces.first; - while(efa) { - efa->e1->f2 = 0; - efa->e2->f2 = 0; - efa->e3->f2 = 0; - if(efa->e4) efa->e4->f2 = 0; - efa = efa->next; - } - - /* delete all unneeded edges */ - eed = em->edges.first; - while(eed) { - eedn = eed->next; - if(eed->f2) { - remedge(eed); - free_editedge(eed); - } - eed = eedn; - } - - countall(); - } - - if(((VGeomData*)geom_vnode->data)->vlink) { - obj_vnode = ((VGeomData*)geom_vnode->data)->vlink->source; - DAG_object_flush_update(G.scene, (Object*)((VObjectData*)obj_vnode->data)->object, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 1); - } -} - -/* - * free constraint between VerseFace and EditFace - */ -void post_polygon_free_constraint(VerseFace *vface) -{ - if(vface->face) { - ((EditFace*)vface->face)->vface = NULL; - vface->face = NULL; - } -} - -/* - * free constraint between VGeomData, EditMesh and Mesh - */ -void post_geometry_free_constraint(VNode *vnode) -{ - if(((VGeomData*)vnode->data)->editmesh) { - G.editMesh->vnode = NULL; - ((VGeomData*)vnode->data)->editmesh = NULL; - } - if(((VGeomData*)vnode->data)->mesh) { - ((Mesh*)((VGeomData*)vnode->data)->mesh)->vnode = NULL; - ((VGeomData*)vnode->data)->mesh = NULL; - } -} - -/* ========================================================================= - * - * Functions influencing whole EditMesh or VerseMesh - * - * ========================================================================= */ - -/* - * free all bindings between EditMesh and "verse mesh" ... it is called between - * restorng editmesh from undo stack - */ -void destroy_versemesh(VNode *vnode) -{ - struct VLayer *vert_vlayer, *face_vlayer; - struct VerseVert *vvert; - struct VerseFace *vface; - - if(vnode->type != V_NT_GEOMETRY) return; - - vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - - /* send delete command to all received verse faces */ - vface = face_vlayer->dl.lb.first; - while(vface) { - if(vface->face) ((EditFace*)vface->face)->vface = NULL; - vface->face = NULL; - send_verse_face_delete(vface); - vface = vface->next; - } - /* send delete command to all verse faces waiting in orphan list */ - vface = face_vlayer->orphans.first; - while(vface) { - if(vface->face) ((EditFace*)vface->face)->vface = NULL; - vface->face = NULL; - send_verse_face_delete(vface); - vface = vface->next; - } - /* mark all verse faces waiting in sending queue as deleted, - * send delete command, when this verse face was changed */ - vface = face_vlayer->queue.first; - while(vface) { - if(vface->face) ((EditFace*)vface->face)->vface = NULL; - vface->face = NULL; - if(vface->flag & FACE_CHANGED) - send_verse_face_delete(vface); - else { - vface->flag |= FACE_DELETED; - } - vface = vface->next; - } - - /* send delete command to all received verse vertexes */ - vvert = vert_vlayer->dl.lb.first; - while(vvert) { - if(vvert->vertex) ((EditVert*)vvert->vertex)->vvert = NULL; - vvert->vertex = NULL; - send_verse_vertex_delete(vvert); - vvert = vvert->next; - } - /* mark all verse vertexes waiting in sending queue as deleted - * ... verse vertexes will be deleted, when received */ - vvert = vert_vlayer->queue.first; - while(vvert) { - if(vvert->vertex) ((EditVert*)vvert->vertex)->vvert = NULL; - vvert->vertex = NULL; - vvert = vvert->next; - } -} - -/* - * duplicate geometry verse node, this can be handy, when you duplicate some - * object or make object single user - */ -VNode *create_geom_vnode_from_geom_vnode(VNode *vnode) -{ - struct VNode *n_vnode; /* new verse geometry node */ - struct VGeomData *geom_data; /* new geometry data */ - struct VLayer *n_vert_vlayer, *n_face_vlayer; /* new vertex and polygon layer */ - struct VLayer *vert_vlayer, *face_vlayer; - struct VerseVert *n_vvert, *vvert; - struct VerseFace *n_vface, *vface; - int i; - - if(!vnode) return NULL; - - if(vnode->type != V_NT_GEOMETRY) return NULL; - - /* create new verse node, when no one exist */ - n_vnode= create_verse_node(vnode->session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE); - /* create new geometry data */ - geom_data = create_geometry_data(); - n_vnode->data = (void*)geom_data; - - /* set up name of VerseNode */ - n_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(vnode->name)-1), "new geom node name"); - n_vnode->name[0] = '\0'; - strcat(n_vnode->name, vnode->name); - - /* add node to sending queue */ - add_item_to_send_queue(&(vnode->session->queue), n_vnode, VERSE_NODE); - - /* create vertex verse layer */ - n_vert_vlayer = create_verse_layer(n_vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0); - add_item_to_send_queue(&(geom_data->queue), n_vert_vlayer, VERSE_LAYER); - - /* create polygon verse layer */ - n_face_vlayer = create_verse_layer(n_vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0); - add_item_to_send_queue(&(geom_data->queue), n_face_vlayer, VERSE_LAYER); - - /* find vertex layer of old verse node */ - vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - /* find polygon layer of old verse node */ - face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - /* duplicate verse vertexes */ - for(i=0, vvert = (VerseVert*)vert_vlayer->dl.lb.first; vvert; vvert = vvert->next, i++) { - n_vvert = create_verse_vertex(n_vert_vlayer, i, vvert->co[0], vvert->co[1], vvert->co[2]); - vvert->tmp.vvert = n_vvert; - add_item_to_send_queue(&(n_vert_vlayer->queue), n_vvert, VERSE_VERT); - } - - /* duplicate verse faces (polyons) */ - for(i=0, vface = (VerseFace*)face_vlayer->dl.lb.first; vface; vface = vface->next, i++) { - n_vface = create_verse_face(n_face_vlayer, i, -1, -1, -1, -1); - n_vface->vvert0 = vface->vvert0->tmp.vvert; - n_vface->vvert1 = vface->vvert1->tmp.vvert; - n_vface->vvert2 = vface->vvert2->tmp.vvert; - if(vface->vvert3) - n_vface->vvert3 = vface->vvert3->tmp.vvert; - else - n_vface->vvert3 = NULL; - add_item_to_send_queue(&(n_face_vlayer->queue), n_vface, VERSE_FACE); - } - - return n_vnode; -} - -/* - * create new geometry node, make bindings between geometry node and editmesh, - * make bindings between editverts and verseverts, make bindings between editfaces - * and versefaces - */ -VNode *create_geom_vnode_data_from_editmesh(VerseSession *session, EditMesh *em) -{ - struct VNode *vnode; - struct Mesh *me; - struct VGeomData *geom_data; - struct VLayer *vert_vlayer, *face_vlayer; - - if(!session) return NULL; - - if(!em) return NULL; - - /* some verse geometry node already exists */ - if(em->vnode) return NULL; - - /* we will need mesh too (mesh name, creating bindings between verse node, etc.) */ - me = get_mesh(G.obedit); - - /* create new verse node, when no one exist */ - vnode = create_verse_node(session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE); - /* create new geometry data */ - geom_data = create_geometry_data(); - vnode->data = (void*)geom_data; - - /* set up name of VerseNode */ - vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(me->id.name)-1), "geom node name"); - vnode->name[0] = '\0'; - strcat(vnode->name, me->id.name+2); - - /* set up bindings */ - me->vnode = (void*)vnode; - em->vnode = (void*)vnode; - geom_data->mesh = (void*)me; - geom_data->editmesh = (void*)em; - - /* add node to sending queue */ - add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE); - - /* create vertex verse layer */ - vert_vlayer = create_verse_layer(vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0); - add_item_to_send_queue(&(geom_data->queue), vert_vlayer, VERSE_LAYER); - - /* create polygon verse layer */ - face_vlayer = create_verse_layer(vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0); - add_item_to_send_queue(&(geom_data->queue), face_vlayer, VERSE_LAYER); - - /* create all verse verts and add them to sending queue */ - createAllVerseVerts(vnode, vert_vlayer); - - /* create all verse faces and add tehm to sending queue */ - createAllVerseFaces(vnode, face_vlayer); - - return vnode; -} - -/* - * create new geometry node, make bindings between geometry node and mesh and - * fill geometry node with new data based at mesh data - */ -VNode *create_geom_vnode_data_from_mesh(VerseSession *session, Mesh *me) -{ - struct VNode *vnode; - struct VGeomData *geom_data; - struct VLayer *vert_vlayer, *face_vlayer; - struct VerseVert *vvert, **vverts; - struct VerseFace *vface; - struct MVert *mvert; - struct MFace *mface; - int i; - - if(!session) return NULL; - - if(!me) return NULL; - - /* some verse geometry node already exists */ - if(me->vnode) return NULL; - - /* create new verse node, when no one exist */ - vnode = create_verse_node(session, -1 , V_NT_GEOMETRY, VN_OWNER_MINE); - /* create new geometry data */ - geom_data = create_geometry_data(); - vnode->data = (void*)geom_data; - - /* set up name of VerseNode */ - vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(me->id.name)-1), "geom node name"); - vnode->name[0] = '\0'; - strcat(vnode->name, me->id.name+2); - - /* set up bindings */ - me->vnode = (void*)vnode; - geom_data->mesh = (void*)me; - - /* add node to sending queue */ - add_item_to_send_queue(&(session->queue), vnode, VERSE_NODE); - - /* create vertex verse layer */ - vert_vlayer = create_verse_layer(vnode, 0, "vertex", VN_G_LAYER_VERTEX_XYZ, 0, 0); - add_item_to_send_queue(&(geom_data->queue), vert_vlayer, VERSE_LAYER); - - /* create polygon verse layer */ - face_vlayer = create_verse_layer(vnode, 1, "polygon", VN_G_LAYER_POLYGON_CORNER_UINT32, 0, 0); - add_item_to_send_queue(&(geom_data->queue), face_vlayer, VERSE_LAYER); - - /* temporary array of VerseVerts */ - vverts = (VerseVert**)MEM_mallocN(sizeof(VerseVert*)*me->totvert,"temp array of vverts"); - - /* "fill vertex layer with vertexes" and add them to sending queue (send them to verse server) */ - for(i=0, mvert=me->mvert; itotvert; i++, mvert++) { - vverts[i] = vvert = create_verse_vertex(vert_vlayer, i, mvert->co[0], mvert->co[1], mvert->co[2]); - add_item_to_send_queue(&(vert_vlayer->queue), vvert, VERSE_VERT); - } - - /* "fill face/polygon layer with faces" and them to sending queue */ - for(i=0, mface = me->mface; itotface; i++, mface++) { - if(mface->v4) { - vface = create_verse_face(face_vlayer, i, mface->v1, mface->v2, mface->v3, mface->v4); - vface->vvert0 = vverts[mface->v1]; - vface->vvert1 = vverts[mface->v2]; - vface->vvert2 = vverts[mface->v3]; - vface->vvert3 = vverts[mface->v4]; - vface->counter = 4; - } - else { - vface = create_verse_face(face_vlayer, i, mface->v1, mface->v2, mface->v3, -1); - vface->vvert0 = vverts[mface->v1]; - vface->vvert1 = vverts[mface->v2]; - vface->vvert2 = vverts[mface->v3]; - vface->counter = 3; - } - add_item_to_send_queue(&(face_vlayer->queue), vface, VERSE_FACE); - } - - MEM_freeN(vverts); - - return vnode; -} - -/* - * creates Mesh from verse geometry node and create bindings - * between them - */ -Mesh *create_mesh_from_geom_node(VNode *vnode) -{ - struct Mesh *me; - - if(vnode->type != V_NT_GEOMETRY) return NULL; - - /* add new empty mesh*/ - me = add_mesh("Mesh"); - /* set up bindings between mesh and verse node */ - me->vnode = (void*)vnode; - ((VGeomData*)vnode->data)->mesh = (void*)me; - - return me; -} - -/* - * create mesh from verse mesh - */ -void create_meshdata_from_geom_node(Mesh *me, VNode *vnode) -{ - struct VLayer *vert_vlayer, *face_vlayer; - struct VerseVert *vvert; - struct VerseFace *vface; - struct MVert *mvert; - struct MFace *mface; - struct EdgeHash *edges; - int index; - - if(!me || !vnode) return; - - if(vnode->type != V_NT_GEOMETRY) return; - - vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - CustomData_free(&me->vdata, me->totvert); - CustomData_free(&me->edata, me->totedge); - CustomData_free(&me->fdata, me->totface); - mesh_update_customdata_pointers(me); - - if(me->mselect) { - MEM_freeN(me->mselect); - me->mselect = NULL; - } - - me->totvert = vert_vlayer ? vert_vlayer->dl.da.count : 0; - me->totface = face_vlayer ? face_vlayer->dl.da.count : 0; - me->totselect = 0; - - CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert); - CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface); - mesh_update_customdata_pointers(me); - - mvert = me->mvert; - mface = me->mface; - - index = 0; - vvert = vert_vlayer ? vert_vlayer->dl.lb.first : NULL; - while(vvert) { - VECCOPY(mvert->co, vvert->co); - VECCOPY(mvert->no, vvert->no); - mvert->flag = 0; - mvert->mat_nr = 0; - vvert->tmp.index = index++; - vvert = vvert->next; - mvert++; - } - - edges = BLI_edgehash_new(); - vface = face_vlayer ? face_vlayer->dl.lb.first : NULL; - while(vface) { - mface->v1 = vface->vvert0->tmp.index; - mface->v2 = vface->vvert1->tmp.index; - mface->v3 = vface->vvert2->tmp.index; - - if(!BLI_edgehash_haskey(edges, mface->v1, mface->v2)) - BLI_edgehash_insert(edges, mface->v1, mface->v2, NULL); - if(!BLI_edgehash_haskey(edges, mface->v2, mface->v3)) - BLI_edgehash_insert(edges, mface->v2, mface->v3, NULL); - if(vface->vvert3) { - mface->v4 = vface->vvert3->tmp.index; - if(!BLI_edgehash_haskey(edges, mface->v3, mface->v4)) - BLI_edgehash_insert(edges, mface->v3, mface->v4, NULL); - if(!BLI_edgehash_haskey(edges, mface->v4, mface->v1)) - BLI_edgehash_insert(edges, mface->v4, mface->v1, NULL); - } else { - mface->v4 = 0; - if(!BLI_edgehash_haskey(edges, mface->v3, mface->v1)) - BLI_edgehash_insert(edges, mface->v3, mface->v1, NULL); - } - - mface->flag = 0; - mface->pad = 0; - mface->mat_nr = 0; - mface->edcode = 0; - - /* index 0 isn't allowed at location 3 or 4 */ - test_index_face(mface, NULL, 0, vface->vvert3?4:3); -/* printf("\t mface: %d, %d, %d, %d\n", mface->v1, mface->v2, mface->v3, mface->v4);*/ - - vface = vface->next; - mface++; - } - - me->totedge = BLI_edgehash_size(edges); - - if(me->totedge) { - EdgeHashIterator *i; - MEdge *medge = me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge); - - for(i = BLI_edgehashIterator_new(edges); !BLI_edgehashIterator_isDone(i); BLI_edgehashIterator_step(i), ++medge) { - BLI_edgehashIterator_getKey(i, (int*)&medge->v1, (int*)&medge->v2); - medge->crease = medge->pad = medge->flag = 0; - } - BLI_edgehashIterator_free(i); - } - - BLI_edgehash_free(edges, NULL); - - mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL); -} - -/* - * Create EditMesh from VerseMesh and keep system in consitant state, this - * function is called, when edit mode is entered ... edit mesh is generated - * from verse mesh (not from Mesh: (Mesh*)ob->data) - */ -void create_edit_mesh_from_geom_node(VNode *vnode) -{ - struct VLayer *vert_layer, *face_layer; - struct VerseVert *vvert; - struct VerseFace *vface; - struct Mesh *me; - struct EditVert *eve, *eve0, *eve1, *eve2, *eve3; - struct EditFace *efa; - unsigned int keyindex; - - if(!(G.obedit && G.obedit->type==OB_MESH)) return; - me = (Mesh*)G.obedit->data; - if(vnode!=(VNode*)me->vnode || vnode->type!=V_NT_GEOMETRY) return; - - vert_layer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - face_layer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - - if(!(vert_layer && face_layer)) return; - - waitcursor(1); - - /* free old editMesh */ - free_editMesh(G.editMesh); - - G.editMesh->vnode = NULL; - - vvert = vert_layer->dl.lb.first; - - keyindex = 0; - - /* create all EditVerts */ - while(vvert) { - eve = addvertlist(vvert->co, NULL); - - eve->f = 0; - eve->h = 0; - eve->data = NULL; - eve->keyindex = keyindex; - eve->vvert = (void*)vvert; - - vvert->vertex = (void*)eve; - - keyindex++; - vvert = vvert->next; - } - - vface = face_layer->dl.lb.first; - - /* create all EditFaces and EditEdges */ - while(vface) { - if(vface->vvert0) eve0= vface->vvert0->vertex; - else eve0 = NULL; - if(vface->vvert1) eve1= vface->vvert1->vertex; - else eve1 = NULL; - if(vface->vvert2) eve2= vface->vvert2->vertex; - else eve2 = NULL; - if(vface->vvert3) eve3= vface->vvert3->vertex; - else eve3 = NULL; - - efa= addfacelist(eve0, eve1, eve2, eve3, NULL, NULL); - if(efa) { - efa->f = 0; - efa->h = 0; - efa->vface = (void*)vface; - vface->face = (void*)efa; - } - vface = vface->next; - } - - countall(); - - recalc_editnormals(); - - G.editMesh->vnode = (void*)vnode; - ((VGeomData*)vnode->data)->editmesh = (void*)G.editMesh; - - waitcursor(0); -} - -/* - * destroy bindings between EditMesh and VerseMesh and send delete commands - * for all VerseVerts and VerseFaces to verse server, Verse Node has to be - * geometry node - */ - -void destroy_verse_mesh(VNode *vnode) -{ - struct VLayer *vert_vlayer, *face_vlayer; - struct VerseFace *vface; - struct VerseVert *vvert; - - if(vnode->type != V_NT_GEOMETRY) return; - - face_vlayer = find_verse_layer_type((VGeomData*)vnode->data, POLYGON_LAYER); - vface = face_vlayer->dl.lb.first; - - while(vface) { - ((EditFace*)vface->face)->vface = NULL; - vface->face = NULL; - vface = vface->next; - } - - vert_vlayer = find_verse_layer_type((VGeomData*)vnode->data, VERTEX_LAYER); - vvert = vert_vlayer->dl.lb.first; - - while(vvert) { - ((EditVert*)vvert->vertex)->vvert = NULL; - vvert->vertex = NULL; - vvert = vvert->next; - } - - destroy_geometry(vnode); -} - -#endif - diff --git a/source/blender/src/verse_object.c b/source/blender/src/verse_object.c deleted file mode 100644 index fc937469d42..00000000000 --- a/source/blender/src/verse_object.c +++ /dev/null @@ -1,600 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Contributor(s): Jiri Hnidek. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#ifdef WITH_VERSE - -#include - -#include "MEM_guardedalloc.h" - -#include "mydevice.h" - -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" -#include "DNA_image_types.h" -#include "DNA_listBase.h" - -#include "BLI_dynamiclist.h" -#include "BLI_blenlib.h" -#include "BLI_editVert.h" -#include "BLI_arithb.h" - -#include "BIF_verse.h" -#include "BIF_space.h" -#include "BIF_editmesh.h" -#include "BIF_drawimage.h" -#include "BIF_editmode_undo.h" -#include "BIF_toolbox.h" - -#include "BKE_verse.h" -#include "BKE_global.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" -#include "BKE_depsgraph.h" -#include "BKE_image.h" -#include "BKE_library.h" -#include "BKE_DerivedMesh.h" -#include "BKE_mesh.h" -#include "BKE_displist.h" - -#include "BDR_editobject.h" - -#include "verse.h" - -/* button callback function, it test object name and send new name to verse server */ -void test_and_send_idbutton_cb(void *obj, void *ob_name) -{ - struct Object *ob = (Object*)obj; - char *name= (char*)ob_name; - - test_idbutton(name+2); - - if(ob->vnode) verse_send_node_name_set(((VNode*)ob->vnode)->id, name+2); -} - -/* - * duplicate verse object nodes - */ -void b_verse_duplicate_object(VerseSession *session, Object *ob, Object *n_ob) -{ - struct VNode *obj_vnode; - - if(!session) return; - - if(!(session->flag & VERSE_CONNECTED)) return; - - /* create "my" new object VerseNode */ - obj_vnode= create_verse_node(session, -1 , V_NT_OBJECT, VN_OWNER_MINE); - /* create object data */ - obj_vnode->data = create_object_data(); - - /* set up name of VerseNode */ - obj_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(n_ob->id.name)-1), "object node name"); - obj_vnode->name[0] = '\0'; - strcat(obj_vnode->name, n_ob->id.name+2); - - /* set up object node transformation */ - VECCOPY(((VObjectData*)obj_vnode->data)->pos, n_ob->loc); - EulToQuat(n_ob->rot, ((VObjectData*)obj_vnode->data)->quat); - VECCOPY(((VObjectData*)obj_vnode->data)->scale, n_ob->size); - - /* set up pointers between Object and VerseNode */ - ((VObjectData*)obj_vnode->data)->object = (void*)n_ob; - n_ob->vnode = (void*)obj_vnode; - - /* add node to sending queue */ - add_item_to_send_queue(&(session->queue), obj_vnode, VERSE_NODE); - - if(ob->type==OB_MESH) { - struct Mesh *me; - struct VNode *geom_vnode; - struct VLink *vlink; - - /* when current mesh already shared at verse server, then only set up link - * between object node and geometry node */ - if(ob->data == n_ob->data) { - geom_vnode = (VNode*)((Mesh*)ob->data)->vnode; - } - else { - geom_vnode = create_geom_vnode_from_geom_vnode((VNode*)((Mesh*)ob->data)->vnode); - me = (Mesh*)n_ob->data; - me->vnode = (void*)geom_vnode; - ((VGeomData*)geom_vnode->data)->mesh = (void*)me; - - } - /* create new link between VereseNodes */ - vlink = create_verse_link(session, obj_vnode, geom_vnode, -1, -1, "geometry"); - /* "send" link to verse server */ - add_item_to_send_queue(&(((VObjectData*)obj_vnode->data)->queue), vlink, VERSE_LINK); - } -} - -/* - * temp hack: this function push mesh objects (edit mode only) to verse server - */ -void b_verse_push_object(VerseSession *session, Object *ob) -{ - struct VNode *obj_vnode; - - if(!session) return; - - if(!(session->flag & VERSE_CONNECTED)) return; - - /* create "my" new object VerseNode */ - obj_vnode= create_verse_node(session, -1 , V_NT_OBJECT, VN_OWNER_MINE); - /* create object data */ - obj_vnode->data = create_object_data(); - - /* set up name of VerseNode */ - obj_vnode->name = (char*)MEM_mallocN(sizeof(char*)*(strlen(ob->id.name)-1), "object node name"); - obj_vnode->name[0] = '\0'; - strcat(obj_vnode->name, ob->id.name+2); - - /* set up object node transformation */ - VECCOPY(((VObjectData*)obj_vnode->data)->pos, ob->loc); - EulToQuat(ob->rot, ((VObjectData*)obj_vnode->data)->quat); - VECCOPY(((VObjectData*)obj_vnode->data)->scale, ob->size); - - /* set up pointers between Object and VerseNode */ - ((VObjectData*)obj_vnode->data)->object = (void*)ob; - ob->vnode = (void*)obj_vnode; - - /* add node to sending queue */ - add_item_to_send_queue(&(session->queue), obj_vnode, VERSE_NODE); - - if(ob->type==OB_MESH) { - struct VNode *geom_vnode; - struct VLink *vlink; - - if(G.obedit) - geom_vnode = create_geom_vnode_data_from_editmesh(session, G.editMesh); - else - geom_vnode = create_geom_vnode_data_from_mesh(session, get_mesh(ob)); - - if(geom_vnode) { - /* create new link between VereseNodes */ - vlink = create_verse_link(session, obj_vnode, geom_vnode, -1, -1, "geometry"); - /* send link to verse server */ - add_item_to_send_queue(&(((VObjectData*)obj_vnode->data)->queue), vlink, VERSE_LINK); - } - } -} - -/* - * creates blender object from verse object node and it - * will create links between them - */ -Object *create_object_from_verse_node(VNode *vnode) -{ - struct Object *ob; - - if(vnode->type != V_NT_OBJECT) return NULL; - - /* create new object*/ - ob = add_object(OB_MESH); - /* set up bindings between verse node and blender object */ - ob->vnode = (void*)vnode; - ((VObjectData*)vnode->data)->object = (void*)ob; - /* set up flags */ - ((VObjectData*)vnode->data)->flag |= POS_RECEIVE_READY; - ((VObjectData*)vnode->data)->flag |= ROT_RECEIVE_READY; - ((VObjectData*)vnode->data)->flag |= SCALE_RECEIVE_READY; - /* copy name from verse node to object */ - if(vnode->name) { - char *str; - str = (char*)MEM_mallocN(sizeof(char)*(strlen(vnode->name)+3), "temp object name"); - str[0] = '\0'; - strcat(str, "OB"); - strcat(str, vnode->name); - strncpy(ob->id.name, str, 23); - MEM_freeN(str); - } - /* subscribe for object transformation */ - verse_send_o_transform_subscribe(vnode->id, 0); - - return ob; -} - -/* - * Create blender object-mesh from verse object node, verse geometry node, - */ -void b_verse_pop_node(VNode *vnode) -{ - if((!vnode) || (!(vnode->data))) return; - - if(vnode->type==V_NT_OBJECT) { - struct VNode *geom_node=NULL; - struct VLink *vlink; - struct VLayer *vlayer; - struct Object *ob; - struct Mesh *me; - - if(((VObjectData*)vnode->data)->object) { - printf("\tError: already subscribed to object node.\n"); - return; - } - - vlink = ((VObjectData*)vnode->data)->links.lb.first; - - /* try to find geometry node */ - while(vlink) { - if(vlink->target && vlink->target->type==V_NT_GEOMETRY){ - geom_node = vlink->target; - break; - } - vlink = vlink->next; - } - - /* we are not interested now in avatars node, etc. (vnodes without - * links at geometry node) */ - if(!geom_node) return; - - /* subscribe to all verse geometry layer */ - vlayer = ((VGeomData*)geom_node->data)->layers.lb.first; - while(vlayer) { - verse_send_g_layer_subscribe(geom_node->id, vlayer->id, 0); - vlayer = vlayer->next; - } - - ob = create_object_from_verse_node(vnode); - - me = create_mesh_from_geom_node(geom_node); - - /* set up bindings between object and mesh */ - if(ob && me) ob->data = me; - } - else if(vnode->type==V_NT_BITMAP) { - struct VBitmapData *vbitmap; - struct VBitmapLayer *vblayer; - float color[] = {0, 0, 0, 1}; - - vbitmap = (VBitmapData*)vnode->data; - - vblayer = vbitmap->layers.lb.first; - - while(vblayer) { - if(!(vblayer->flag & VBLAYER_SUBSCRIBED)) { - /* 0 means level of subscription (full resolution) */ - verse_send_b_layer_subscribe(vnode->id, vblayer->id, 0); - vblayer->flag |= VBLAYER_SUBSCRIBED; - } - vblayer = vblayer->next; - } - - if(vbitmap->image) { - printf("\tError: already subscribed to image node.\n"); - return; - } - - vbitmap->image = (void*)BKE_add_image_size( - vbitmap->width, - vbitmap->height, - vnode->name, - 0, - color); - ((Image*)vbitmap->image)->vnode = (void*)vnode; - sync_blender_image_with_verse_bitmap_node(vnode); - - allqueue(REDRAWIMAGE, 0); - allqueue(REDRAWVIEW3D, 0); - } -} - -/* - * this function will unsubscribe object node from transformation, but it will - * keep all tags and links at other nodes ... user could subscribe to this node - * again in future - */ -void unsubscribe_from_obj_node(VNode *vnode) -{ - struct VerseSession *session = vnode->session; - struct VLink *vlink; - - if(vnode->type != V_NT_OBJECT) return; - - /* unsubscribe from receiving changes of transformation matrix */ - if(session->flag & VERSE_CONNECTED) - verse_send_o_transform_unsubscribe(vnode->id, 0); - - /* we have to reinitialize object node transformation */ - ((VObjectData*)vnode->data)->pos[0] = 0.0f; - ((VObjectData*)vnode->data)->pos[1] = 0.0f; - ((VObjectData*)vnode->data)->pos[2] = 0.0f; - - ((VObjectData*)vnode->data)->quat[0] = 0.0f; - ((VObjectData*)vnode->data)->quat[1] = 0.0f; - ((VObjectData*)vnode->data)->quat[2] = 0.0f; - ((VObjectData*)vnode->data)->quat[3] = 0.0f; - - ((VObjectData*)vnode->data)->scale[0] = 0.0f; - ((VObjectData*)vnode->data)->scale[1] = 0.0f; - ((VObjectData*)vnode->data)->scale[2] = 0.0f; - - /* clear bindings between object and object node */ - if(((VObjectData*)vnode->data)->object) { - ((Object*)((VObjectData*)vnode->data)->object)->vnode = NULL; - ((VObjectData*)vnode->data)->object = NULL; - } - - /* unsubscribe from all supported verse nodes */ - vlink = ((VObjectData*)vnode->data)->links.lb.first; - while(vlink) { - if(vlink->target->counter==1) { - switch(vlink->target->type) { - case V_NT_OBJECT: - unsubscribe_from_obj_node(vlink->target); - break; - case V_NT_GEOMETRY: - unsubscribe_from_geom_node(vlink->target); - break; - case V_NT_BITMAP: - unsubscribe_from_bitmap_node(vlink->target); - break; - default: - break; - } - } - vlink = vlink->next; - } -} - -/* - * when blender Object is deleted, then we have to unsubscribe and free all - * VerseNode dependent on this object - */ -void b_verse_delete_object(Object *object) -{ - struct VNode *vnode; - - vnode = (VNode*)object->vnode; - - if(vnode) unsubscribe_from_obj_node(vnode); -} - -/* - * "fake" unsubscribing from object node and all child nodes - */ -void b_verse_unsubscribe(VNode *vnode) -{ - struct VLink *vlink = ((VObjectData*)vnode->data)->links.lb.first; - struct Object *ob = (Object*)((VObjectData*)vnode->data)->object; - - if(vnode->type==V_NT_OBJECT) { - /* exit edit mode */ - if(G.obedit && G.obedit->vnode == (void*)vnode) - exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); - - /* when some geometry node is child of this object node, then create mesh data */ - while(vlink){ - if(vlink->target->type == V_NT_GEOMETRY) { - struct Mesh *me; - me = ((VGeomData*)vlink->target->data)->mesh; - create_meshdata_from_geom_node(me, vlink->target); - break; - } - vlink = vlink->next; - } - - /* unsubscribe from object transformation and clear bindings between - * verse object node and object */ - unsubscribe_from_obj_node(vnode); - - /* when geometry node was shared with more object nodes, then make - * data single user */ - if(ob->type == OB_MESH) { - struct ID *id = ob->data; - if(id && id->us>1 && id->lib==0) { - ob->recalc= OB_RECALC_DATA; - ob->data = copy_mesh(ob->data); - id->us--; - id->newid= ob->data; - } - } - - /* reinitialize object derived mesh */ - makeDerivedMesh(ob, get_viewedit_datamask()); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - } - else if(vnode->type==V_NT_BITMAP) { - /* fake ... it isn't impelemented yet ... poke jiri, when needed */ - unsubscribe_from_bitmap_node(vnode); - } - - allqueue(REDRAWVIEW3D, 1); -} - -/* - * whe VerseLink is created between two nodes, the Object start to point at - * coresponding data - */ -void post_link_set(VLink *vlink) -{ - struct VNode *target, *source; - struct Object *ob=NULL; - struct Mesh *me=NULL; - - source = vlink->source; - target = vlink->target; - - if(source->type==V_NT_OBJECT && target->type==V_NT_GEOMETRY){ - if(((VObjectData*)source->data)->object) - ob = (Object*)((VObjectData*)source->data)->object; - if(((VGeomData*)target->data)->mesh) - me = (Mesh*)((VGeomData*)target->data)->mesh; - if(ob && me && ob->data!=me) { - ob->data = me; - makeDerivedMesh(ob, get_viewedit_datamask()); - } - } - - allqueue(REDRAWALL, 1); -} - -/* - * when VerseLink is deleted, then bindings between Object and data should be removed - */ -void post_link_destroy(VLink *vlink) -{ - struct VNode *source, *target; - struct Object *ob; - - source = vlink->source; - target = vlink->target; - - if(source->type==V_NT_OBJECT && target->type==V_NT_GEOMETRY) { - if(((VObjectData*)source->data)->object) { - ob = (Object*)((VObjectData*)source->data)->object; - ob->data=NULL; - } - } - - allqueue(REDRAWALL, 1); -} - -/* - * update position of blender object - */ -void post_transform_pos(VNode *vnode) -{ - struct VObjectData *obj_data = (VObjectData*)vnode->data; - struct Object *ob = (Object*)obj_data->object; - - VECCOPY(ob->loc, obj_data->pos); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 1); -} - -/* - * update rotation of blender object - */ -void post_transform_rot(VNode *vnode) -{ - struct VObjectData *obj_data = (VObjectData*)vnode->data; - struct Object *ob = (Object*)obj_data->object; - - /* convert quaternion to euler rotation */ - QuatToEul(obj_data->quat, ob->rot); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 1); -} - -/* - * update scale of blender object - */ -void post_transform_scale(VNode *vnode) -{ - struct VObjectData *obj_data = (VObjectData*)vnode->data; - struct Object *ob = (Object*)obj_data->object; - - VECCOPY(ob->size, obj_data->scale); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 1); -} - -/* - * send transformation of Object to verse server - */ -void b_verse_send_transformation(Object *ob) -{ - struct VNode *vnode= ob->vnode; - float quat[4]; - - if(!vnode) return; - - /* if last sent position wasn't received yet, then next change of position - * can't be send until last send change is received */ - if( ((VObjectData*)vnode->data)->flag & POS_SEND_READY ) { - if((((VObjectData*)vnode->data)->pos[0]!=ob->loc[0]) || - (((VObjectData*)vnode->data)->pos[1]!=ob->loc[1]) || - (((VObjectData*)vnode->data)->pos[2]!=ob->loc[2])) { - VECCOPY(((VObjectData*)vnode->data)->pos, ob->loc); - send_verse_object_position(vnode); - } - } - - /* if last sent rotation wasn't received yet, then next change of rotation - * can't be send until last send change is received */ - if( ((VObjectData*)vnode->data)->flag & ROT_SEND_READY ) { - EulToQuat(ob->rot, quat); - - if((((VObjectData*)vnode->data)->quat[0] != quat[0]) || - (((VObjectData*)vnode->data)->quat[1] != quat[1]) || - (((VObjectData*)vnode->data)->quat[2] != quat[2]) || - (((VObjectData*)vnode->data)->quat[3] != quat[3])) { - QUATCOPY(((VObjectData*)vnode->data)->quat, quat); - send_verse_object_rotation(vnode); - } - } - - /* if last sent object size wasn't received yet, then next change of object size - * can't be send until last send change is received */ - if( ((VObjectData*)vnode->data)->flag & SCALE_SEND_READY ) { - if((((VObjectData*)vnode->data)->scale[0]!=ob->size[0]) || - (((VObjectData*)vnode->data)->scale[1]!=ob->size[1]) || - (((VObjectData*)vnode->data)->scale[2]!=ob->size[2])) { - VECCOPY(((VObjectData*)vnode->data)->scale, ob->size); - send_verse_object_scale(vnode); - } - } - - verse_callback_update(0); -} - -/* - * free constraint between object VerseNode and blender Object - */ -void post_object_free_constraint(VNode *vnode) -{ - if(((VObjectData*)vnode->data)->object) { - /* free pointer at verse derived mesh */ - struct Object *ob = (Object*)((VObjectData*)vnode->data)->object; - if(ob) { - if(ob->derivedFinal) { - ob->derivedFinal->needsFree = 1; - ob->derivedFinal->release((DerivedMesh*)ob->derivedFinal); - ob->derivedFinal = NULL; - } - if(ob->derivedDeform) { - ob->derivedDeform->needsFree = 1; - ob->derivedDeform->release((DerivedMesh*)ob->derivedDeform); - ob->derivedDeform = NULL; - } - } - /* free constraint */ - ((Object*)((VObjectData*)vnode->data)->object)->vnode = NULL; - ((VObjectData*)vnode->data)->object = NULL; - } -} - -#endif - diff --git a/source/blender/src/view.c b/source/blender/src/view.c deleted file mode 100644 index d23b6f1d8f4..00000000000 --- a/source/blender/src/view.c +++ /dev/null @@ -1,1863 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * Trackball math (in calctrackballvec()) Copyright (C) Silicon Graphics, Inc. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_camera_types.h" -#include "DNA_lamp_types.h" -#include "DNA_object_types.h" -#include "DNA_screen_types.h" -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_userdef_types.h" -#include "DNA_view3d_types.h" - -#include "BKE_action.h" -#include "BKE_anim.h" -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_editparticle.h" -#include "BIF_gl.h" -#include "BIF_previewrender.h" -#include "BIF_mywindow.h" -#include "BIF_retopo.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BSE_view.h" -#include "BSE_edit.h" /* For countall */ -#include "BSE_drawview.h" /* For inner_play_anim_loop */ - -#include "BDR_drawobject.h" /* For draw_object */ -#include "BDR_editface.h" /* For minmax_tface */ -#include "BDR_sculptmode.h" - -#include "mydevice.h" -#include "blendef.h" - -#include "PIL_time.h" /* smoothview */ - -#define TRACKBALLSIZE (1.1) -#define BL_NEAR_CLIP 0.001 - - -/* local prototypes ----------*/ -void setcameratoview3d(void); /* windows.c & toets.c */ - -void persp_general(int a) -{ - /* for all window types, not 3D */ - - if(a== 0) { - glPushMatrix(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - - myortho2(-0.375, ((float)(curarea->winx))-0.375, -0.375, ((float)(curarea->winy))-0.375); - glLoadIdentity(); - } - else if(a== 1) { - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - } -} - -void persp(int a) -{ - /* only 3D windows */ - - if(curarea->spacetype!=SPACE_VIEW3D) persp_general(a); - else if(a == PERSP_STORE) { // only store - glMatrixMode(GL_PROJECTION); - mygetmatrix(G.vd->winmat1); - glMatrixMode(GL_MODELVIEW); - mygetmatrix(G.vd->viewmat1); - } - else if(a== PERSP_WIN) { // only set - myortho2(-0.375, (float)(curarea->winx)-0.375, -0.375, (float)(curarea->winy)-0.375); - glLoadIdentity(); - } - else if(a== PERSP_VIEW) { - glMatrixMode(GL_PROJECTION); - myloadmatrix(G.vd->winmat1); // put back - Mat4CpyMat4(curarea->winmat, G.vd->winmat1); // to be sure? - glMatrixMode(GL_MODELVIEW); - myloadmatrix(G.vd->viewmat); // put back - - } -} - - -void initgrabz(float x, float y, float z) -{ - if(G.vd==NULL) return; - G.vd->zfac= G.vd->persmat[0][3]*x+ G.vd->persmat[1][3]*y+ G.vd->persmat[2][3]*z+ G.vd->persmat[3][3]; - - /* if x,y,z is exactly the viewport offset, zfac is 0 and we don't want that - * (accounting for near zero values) - * */ - if (G.vd->zfac < 1.e-6f && G.vd->zfac > -1.e-6f) G.vd->zfac = 1.0f; - - /* Negative zfac means x, y, z was behind the camera (in perspective). - * This gives flipped directions, so revert back to ok default case. - */ - if (G.vd->zfac < 0.0f) G.vd->zfac = 1.0f; -} - -void window_to_3d(float *vec, short mx, short my) -{ - /* always call initgrabz */ - float dx, dy; - - dx= 2.0f*mx*G.vd->zfac/curarea->winx; - dy= 2.0f*my*G.vd->zfac/curarea->winy; - - vec[0]= (G.vd->persinv[0][0]*dx + G.vd->persinv[1][0]*dy); - vec[1]= (G.vd->persinv[0][1]*dx + G.vd->persinv[1][1]*dy); - vec[2]= (G.vd->persinv[0][2]*dx + G.vd->persinv[1][2]*dy); -} - -void project_short(float *vec, short *adr) /* clips */ -{ - float fx, fy, vec4[4]; - - adr[0]= IS_CLIPPED; - - if(G.vd->flag & V3D_CLIPPING) { - if(view3d_test_clipping(G.vd, vec)) - return; - } - - VECCOPY(vec4, vec); - vec4[3]= 1.0; - Mat4MulVec4fl(G.vd->persmat, vec4); - - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ - fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]); - - if( fx>0 && fxwinx) { - - fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]); - - if(fy>0.0 && fy< (float)curarea->winy) { - adr[0]= floor(fx); - adr[1]= floor(fy); - } - } - } -} - -void project_int(float *vec, int *adr) -{ - float fx, fy, vec4[4]; - - adr[0]= 2140000000.0f; - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(G.vd->persmat, vec4); - - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ - fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]); - - if( fx>-2140000000.0f && fx<2140000000.0f) { - fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]); - - if(fy>-2140000000.0f && fy<2140000000.0f) { - adr[0]= floor(fx); - adr[1]= floor(fy); - } - } - } -} - -void project_short_noclip(float *vec, short *adr) -{ - float fx, fy, vec4[4]; - - adr[0]= IS_CLIPPED; - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(G.vd->persmat, vec4); - - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ - fx= (curarea->winx/2)*(1 + vec4[0]/vec4[3]); - - if( fx>-32700 && fx<32700) { - - fy= (curarea->winy/2)*(1 + vec4[1]/vec4[3]); - - if(fy>-32700.0 && fy<32700.0) { - adr[0]= floor(fx); - adr[1]= floor(fy); - } - } - } -} - -void project_float(float *vec, float *adr) -{ - float vec4[4]; - - adr[0]= IS_CLIPPED; - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(G.vd->persmat, vec4); - - if( vec4[3]>BL_NEAR_CLIP ) { - adr[0]= (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; - adr[1]= (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; - } -} - -void view3d_get_object_project_mat(ScrArea *area, Object *ob, float pmat[4][4], float vmat[4][4]) -{ - if (area->spacetype!=SPACE_VIEW3D || !area->spacedata.first) { - Mat4One(pmat); - Mat4One(vmat); - } else { - View3D *vd = area->spacedata.first; - - Mat4MulMat4(vmat, ob->obmat, vd->viewmat); - Mat4MulMat4(pmat, vmat, vd->winmat1); - Mat4CpyMat4(vmat, ob->obmat); - } -} - -/* projectmat brings it to window coords, wmat to rotated world space */ -void view3d_project_short_clip(ScrArea *area, float *vec, short *adr, float projmat[4][4], float wmat[4][4]) -{ - View3D *v3d= area->spacedata.first; - float fx, fy, vec4[4]; - - adr[0]= IS_CLIPPED; - - /* clipplanes in eye space */ - if(v3d->flag & V3D_CLIPPING) { - VECCOPY(vec4, vec); - Mat4MulVecfl(wmat, vec4); - if(view3d_test_clipping(v3d, vec4)) - return; - } - - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(projmat, vec4); - - /* clipplanes in window space */ - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ - fx= (area->winx/2)*(1 + vec4[0]/vec4[3]); - - if( fx>0 && fxwinx) { - - fy= (area->winy/2)*(1 + vec4[1]/vec4[3]); - - if(fy>0.0 && fy< (float)area->winy) { - adr[0]= floor(fx); - adr[1]= floor(fy); - } - } - } -} - -void view3d_project_short_noclip(ScrArea *area, float *vec, short *adr, float mat[4][4]) -{ - float fx, fy, vec4[4]; - - adr[0]= IS_CLIPPED; - - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(mat, vec4); - - if( vec4[3]>BL_NEAR_CLIP ) { /* 0.001 is the NEAR clipping cutoff for picking */ - fx= (area->winx/2)*(1 + vec4[0]/vec4[3]); - - if( fx>-32700 && fx<32700) { - - fy= (area->winy/2)*(1 + vec4[1]/vec4[3]); - - if(fy>-32700.0 && fy<32700.0) { - adr[0]= floor(fx); - adr[1]= floor(fy); - } - } - } -} - -void view3d_project_float(ScrArea *area, float *vec, float *adr, float mat[4][4]) -{ - float vec4[4]; - - adr[0]= IS_CLIPPED; - VECCOPY(vec4, vec); - vec4[3]= 1.0; - - Mat4MulVec4fl(mat, vec4); - - if( vec4[3]>FLT_EPSILON ) { - adr[0] = (area->winx/2.0)+(area->winx/2.0)*vec4[0]/vec4[3]; - adr[1] = (area->winy/2.0)+(area->winy/2.0)*vec4[1]/vec4[3]; - } else { - adr[0] = adr[1] = 0.0; - } -} - -int boundbox_clip(float obmat[][4], BoundBox *bb) -{ - /* return 1: draw */ - - float mat[4][4]; - float vec[4], min, max; - int a, flag= -1, fl; - - if(bb==NULL) return 1; - if(bb->flag & OB_BB_DISABLED) return 1; - - Mat4MulMat4(mat, obmat, G.vd->persmat); - - for(a=0; a<8; a++) { - VECCOPY(vec, bb->vec[a]); - vec[3]= 1.0; - Mat4MulVec4fl(mat, vec); - max= vec[3]; - min= -vec[3]; - - fl= 0; - if(vec[0] < min) fl+= 1; - if(vec[0] > max) fl+= 2; - if(vec[1] < min) fl+= 4; - if(vec[1] > max) fl+= 8; - if(vec[2] < min) fl+= 16; - if(vec[2] > max) fl+= 32; - - flag &= fl; - if(flag==0) return 1; - } - - return 0; - -} - -void fdrawline(float x1, float y1, float x2, float y2) -{ - float v[2]; - - glBegin(GL_LINE_STRIP); - v[0] = x1; v[1] = y1; - glVertex2fv(v); - v[0] = x2; v[1] = y2; - glVertex2fv(v); - glEnd(); -} - -void fdrawbox(float x1, float y1, float x2, float y2) -{ - float v[2]; - - glBegin(GL_LINE_STRIP); - - v[0] = x1; v[1] = y1; - glVertex2fv(v); - v[0] = x1; v[1] = y2; - glVertex2fv(v); - v[0] = x2; v[1] = y2; - glVertex2fv(v); - v[0] = x2; v[1] = y1; - glVertex2fv(v); - v[0] = x1; v[1] = y1; - glVertex2fv(v); - - glEnd(); -} - -void sdrawline(short x1, short y1, short x2, short y2) -{ - short v[2]; - - glBegin(GL_LINE_STRIP); - v[0] = x1; v[1] = y1; - glVertex2sv(v); - v[0] = x2; v[1] = y2; - glVertex2sv(v); - glEnd(); -} - -void sdrawbox(short x1, short y1, short x2, short y2) -{ - short v[2]; - - glBegin(GL_LINE_STRIP); - - v[0] = x1; v[1] = y1; - glVertex2sv(v); - v[0] = x1; v[1] = y2; - glVertex2sv(v); - v[0] = x2; v[1] = y2; - glVertex2sv(v); - v[0] = x2; v[1] = y1; - glVertex2sv(v); - v[0] = x1; v[1] = y1; - glVertex2sv(v); - - glEnd(); -} - -/* the central math in this function was copied from trackball.cpp, sample code from the - Developers Toolbox series by SGI. */ - -/* trackball: better one than a full spherical solution */ - -void calctrackballvecfirst(rcti *area, short *mval, float *vec) -{ - float x, y, radius, d, z, t; - - radius= TRACKBALLSIZE; - - /* normalize x and y */ - x= (area->xmax + area->xmin)/2 -mval[0]; - x/= (float)((area->xmax - area->xmin)/2); - y= (area->ymax + area->ymin)/2 -mval[1]; - y/= (float)((area->ymax - area->ymin)/2); - - d = sqrt(x*x + y*y); - if (d < radius*M_SQRT1_2) /* Inside sphere */ - z = sqrt(radius*radius - d*d); - else - { /* On hyperbola */ - t = radius / M_SQRT2; - z = t*t / d; - } - - vec[0]= x; - vec[1]= y; - vec[2]= -z; /* yah yah! */ - - if( fabs(vec[2])>fabs(vec[1]) && fabs(vec[2])>fabs(vec[0]) ) { - vec[0]= 0.0; - vec[1]= 0.0; - if(vec[2]>0.0) vec[2]= 1.0; else vec[2]= -1.0; - } - else if( fabs(vec[1])>fabs(vec[0]) && fabs(vec[1])>fabs(vec[2]) ) { - vec[0]= 0.0; - vec[2]= 0.0; - if(vec[1]>0.0) vec[1]= 1.0; else vec[1]= -1.0; - } - else { - vec[1]= 0.0; - vec[2]= 0.0; - if(vec[0]>0.0) vec[0]= 1.0; else vec[0]= -1.0; - } -} - -void calctrackballvec(rcti *area, short *mval, float *vec) -{ - float x, y, radius, d, z, t; - - radius= TRACKBALLSIZE; - - /* x en y normalizeren */ - x= (area->xmax + area->xmin)/2 -mval[0]; - x/= (float)((area->xmax - area->xmin)/4); - y= (area->ymax + area->ymin)/2 -mval[1]; - y/= (float)((area->ymax - area->ymin)/2); - - d = sqrt(x*x + y*y); - if (d < radius*M_SQRT1_2) /* Inside sphere */ - z = sqrt(radius*radius - d*d); - else - { /* On hyperbola */ - t = radius / M_SQRT2; - z = t*t / d; - } - - vec[0]= x; - vec[1]= y; - vec[2]= -z; /* yah yah! */ - -} - -void viewmove(int mode) -{ - Object *ob = OBACT; - float firstvec[3], newvec[3], dvec[3]; - float reverse, oldquat[4], q1[4], si, phi, dist0; - float ofs[3], obofs[3]= {0.0f, 0.0f, 0.0f}; - int firsttime=1; - short mvalball[2], mval[2], mvalo[2], mval_area[2]; - short use_sel = 0; - short preview3d_event= 1; - - /* 3D window may not be defined */ - if( !G.vd ) { - fprintf( stderr, "G.vd == NULL in viewmove()\n" ); - return; - } - - /* sometimes this routine is called from headerbuttons */ - - areawinset(curarea->win); - - initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]); - - QUATCOPY(oldquat, G.vd->viewquat); - - getmouseco_areawin(mval_area); /* for zoom to mouse loc */ - getmouseco_sc(mvalo); /* work with screen coordinates because of trackball function */ - mvalball[0]= mvalo[0]; /* needed for turntable to work */ - mvalball[1]= mvalo[1]; - dist0= G.vd->dist; - - calctrackballvec(&curarea->winrct, mvalo, firstvec); - - /* cumultime(0); */ - - if(!G.obedit && (G.f & G_SCULPTMODE) && ob && G.vd->pivot_last) { - use_sel= 1; - VecCopyf(ofs, G.vd->ofs); - - VecCopyf(obofs,&sculpt_session()->pivot.x); - Mat4MulVecfl(ob->obmat, obofs); - obofs[0]= -obofs[0]; - obofs[1]= -obofs[1]; - obofs[2]= -obofs[2]; - } - else if (ob && (U.uiflag & USER_ORBIT_SELECTION)) { - use_sel = 1; - - VECCOPY(ofs, G.vd->ofs); - - /* If there's no selection, obofs is unmodified, so <0,0,0> */ - calculateTransformCenter(V3D_CENTROID, obofs); - VecMulf(obofs, -1.0f); - } - else - ofs[0] = ofs[1] = ofs[2] = 0.0f; - - reverse= 1.0f; - if (G.vd->persmat[2][1] < 0.0f) - reverse= -1.0f; - - while(TRUE) { - getmouseco_sc(mval); - - // if playanim = alt+A, screenhandlers are for animated UI, python, etc - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1] || (G.f & G_PLAYANIM) || do_screenhandlers(G.curscreen)) { - - if(firsttime) { - - firsttime= 0; - /* are we translating, rotating or zooming? */ - if(mode==0) { - if(G.vd->view!=0) scrarea_queue_headredraw(curarea); /*for button */ - G.vd->view= 0; - } - if(G.vd->persp==2 && mode!=1 && G.vd->camera) { - G.vd->persp= 1; - scrarea_do_windraw(curarea); - scrarea_queue_headredraw(curarea); - } - } - - if(mode==0) { /* view rotate */ - if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 1; - - if (U.flag & USER_TRACKBALL) mvalball[0]= mval[0]; - mvalball[1]= mval[1]; - - calctrackballvec(&curarea->winrct, mvalball, newvec); - - VecSubf(dvec, newvec, firstvec); - - si= sqrt(dvec[0]*dvec[0]+ dvec[1]*dvec[1]+ dvec[2]*dvec[2]); - si/= (2.0*TRACKBALLSIZE); - - if (U.flag & USER_TRACKBALL) { - Crossf(q1+1, firstvec, newvec); - - Normalize(q1+1); - - /* Allow for rotation beyond the interval - * [-pi, pi] */ - while (si > 1.0) - si -= 2.0; - - /* This relation is used instead of - * phi = asin(si) so that the angle - * of rotation is linearly proportional - * to the distance that the mouse is - * dragged. */ - phi = si * M_PI / 2.0; - - si= sin(phi); - q1[0]= cos(phi); - q1[1]*= si; - q1[2]*= si; - q1[3]*= si; - QuatMul(G.vd->viewquat, q1, oldquat); - - if (use_sel) { - /* compute the post multiplication quat, to rotate the offset correctly */ - QUATCOPY(q1, oldquat); - QuatConj(q1); - QuatMul(q1, q1, G.vd->viewquat); - - QuatConj(q1); /* conj == inv for unit quat */ - VECCOPY(G.vd->ofs, ofs); - VecSubf(G.vd->ofs, G.vd->ofs, obofs); - QuatMulVecf(q1, G.vd->ofs); - VecAddf(G.vd->ofs, G.vd->ofs, obofs); - } - } else { - /* New turntable view code by John Aughey */ - - float m[3][3]; - float m_inv[3][3]; - float xvec[3] = {1,0,0}; - /* Sensitivity will control how fast the viewport rotates. 0.0035 was - obtained experimentally by looking at viewport rotation sensitivities - on other modeling programs. */ - /* Perhaps this should be a configurable user parameter. */ - const float sensitivity = 0.0035; - - /* Get the 3x3 matrix and its inverse from the quaternion */ - QuatToMat3(G.vd->viewquat, m); - Mat3Inv(m_inv,m); - - /* Determine the direction of the x vector (for rotating up and down) */ - /* This can likely be compuated directly from the quaternion. */ - Mat3MulVecfl(m_inv,xvec); - - /* Perform the up/down rotation */ - phi = sensitivity * -(mval[1] - mvalo[1]); - si = sin(phi); - q1[0] = cos(phi); - q1[1] = si * xvec[0]; - q1[2] = si * xvec[1]; - q1[3] = si * xvec[2]; - QuatMul(G.vd->viewquat, G.vd->viewquat, q1); - - if (use_sel) { - QuatConj(q1); /* conj == inv for unit quat */ - VecSubf(G.vd->ofs, G.vd->ofs, obofs); - QuatMulVecf(q1, G.vd->ofs); - VecAddf(G.vd->ofs, G.vd->ofs, obofs); - } - - /* Perform the orbital rotation */ - phi = sensitivity * reverse * (mval[0] - mvalo[0]); - q1[0] = cos(phi); - q1[1] = q1[2] = 0.0; - q1[3] = sin(phi); - QuatMul(G.vd->viewquat, G.vd->viewquat, q1); - - if (use_sel) { - QuatConj(q1); - VecSubf(G.vd->ofs, G.vd->ofs, obofs); - QuatMulVecf(q1, G.vd->ofs); - VecAddf(G.vd->ofs, G.vd->ofs, obofs); - } - } - } - else if(mode==1) { /* translate */ - if(G.vd->persp==2) { - float max= (float)MAX2(curarea->winx, curarea->winy); - - G.vd->camdx += (mvalo[0]-mval[0])/(max); - G.vd->camdy += (mvalo[1]-mval[1])/(max); - CLAMP(G.vd->camdx, -1.0f, 1.0f); - CLAMP(G.vd->camdy, -1.0f, 1.0f); - preview3d_event= 0; - } - else { - window_to_3d(dvec, mval[0]-mvalo[0], mval[1]-mvalo[1]); - VecAddf(G.vd->ofs, G.vd->ofs, dvec); - } - } - else if(mode==2) { - float zfac=1.0; - if(U.viewzoom==USER_ZOOM_CONT) { - // oldstyle zoom - zfac = 1.0+(float)(mvalo[0]-mval[0]+mvalo[1]-mval[1])/1000.0; - } - else if(U.viewzoom==USER_ZOOM_SCALE) { - int ctr[2], len1, len2; - // method which zooms based on how far you move the mouse - - ctr[0] = (curarea->winrct.xmax + curarea->winrct.xmin)/2; - ctr[1] = (curarea->winrct.ymax + curarea->winrct.ymin)/2; - - len1 = (int)sqrt((ctr[0] - mval[0])*(ctr[0] - mval[0]) + (ctr[1] - mval[1])*(ctr[1] - mval[1])) + 5; - len2 = (int)sqrt((ctr[0] - mvalo[0])*(ctr[0] - mvalo[0]) + (ctr[1] - mvalo[1])*(ctr[1] - mvalo[1])) + 5; - - zfac = dist0 * ((float)len2/len1) / G.vd->dist; - } - else { /* USER_ZOOM_DOLLY */ - float len1 = (curarea->winrct.ymax - mval[1]) + 5; - float len2 = (curarea->winrct.ymax - mvalo[1]) + 5; - zfac = dist0 * (2.0*((len2/len1)-1.0) + 1.0) / G.vd->dist; - } - - if(zfac != 1.0 && zfac*G.vd->dist > 0.001*G.vd->grid && - zfac*G.vd->dist < 10.0*G.vd->far) - view_zoom_mouseloc(zfac, mval_area); - - /* these limits are in toets.c too */ - if(G.vd->dist<0.001*G.vd->grid) G.vd->dist= 0.001*G.vd->grid; - if(G.vd->dist>10.0*G.vd->far) G.vd->dist=10.0*G.vd->far; - - mval[1]= mvalo[1]; /* preserve first value */ - mval[0]= mvalo[0]; - - if(G.vd->persp==0 || G.vd->persp==2) preview3d_event= 0; - } - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - if(G.f & G_PLAYANIM) inner_play_anim_loop(0, 0); - if(G.f & G_SIMULATION) break; - - /* If in retopo paint mode, update lines */ - if(retopo_mesh_paint_check() && G.vd->retopo_view_data) { - G.vd->retopo_view_data->queue_matrix_update= 1; - retopo_paint_view_update(G.vd); - } - - scrarea_do_windraw(curarea); - screen_swapbuffers(); - } - else { - short val; - unsigned short event; - /* we need to empty the queue... when you do this very long it overflows */ - while(qtest()) event= extern_qread(&val); - - BIF_wait_for_statechange(); - } - - /* this in the end, otherwise get_mbut does not work on a PC... */ - if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break; - } - - if(G.vd->depths) G.vd->depths->damaged= 1; - retopo_queue_updates(G.vd); - allqueue(REDRAWVIEW3D, 0); - - if(preview3d_event) - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - else - BIF_view3d_previewrender_signal(curarea, PR_PROJECTED); - -} - -void view_zoom_mouseloc(float dfac, short *mouseloc) -{ - if(U.uiflag & USER_ZOOM_TO_MOUSEPOS) { - short vb[2]; - float dvec[3]; - float tvec[3]; - float tpos[3]; - float new_dist; - - /* find the current window width and height */ - vb[0] = G.vd->area->winx; - vb[1] = G.vd->area->winy; - - tpos[0] = -G.vd->ofs[0]; - tpos[1] = -G.vd->ofs[1]; - tpos[2] = -G.vd->ofs[2]; - - /* Project cursor position into 3D space */ - initgrabz(tpos[0], tpos[1], tpos[2]); - window_to_3d(dvec, mouseloc[0]-vb[0]/2, mouseloc[1]-vb[1]/2); - - /* Calculate view target position for dolly */ - tvec[0] = -(tpos[0] + dvec[0]); - tvec[1] = -(tpos[1] + dvec[1]); - tvec[2] = -(tpos[2] + dvec[2]); - - /* Offset to target position and dolly */ - new_dist = G.vd->dist * dfac; - - VECCOPY(G.vd->ofs, tvec); - G.vd->dist = new_dist; - - /* Calculate final offset */ - dvec[0] = tvec[0] + dvec[0] * dfac; - dvec[1] = tvec[1] + dvec[1] * dfac; - dvec[2] = tvec[2] + dvec[2] * dfac; - - VECCOPY(G.vd->ofs, dvec); - } else { - G.vd->dist *= dfac; - } -} - -/* Gets the lens and clipping values from a camera of lamp type object */ -void object_view_settings(Object *ob, float *lens, float *clipsta, float *clipend) -{ - if (!ob) return; - - if(ob->type==OB_LAMP ) { - Lamp *la = ob->data; - if (lens) { - float x1, fac; - fac= cos( M_PI*la->spotsize/360.0); - x1= saacos(fac); - *lens= 16.0*fac/sin(x1); - } - if (clipsta) *clipsta= la->clipsta; - if (clipend) *clipend= la->clipend; - } - else if(ob->type==OB_CAMERA) { - Camera *cam= ob->data; - if (lens) *lens= cam->lens; - if (clipsta) *clipsta= cam->clipsta; - if (clipend) *clipend= cam->clipend; - } -} - - -int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize) -{ - Camera *cam=NULL; - float lens, fac, x1, y1, x2, y2; - float winx= (float)winxi, winy= (float)winyi; - int orth= 0; - - lens= G.vd->lens; - - *clipsta= G.vd->near; - *clipend= G.vd->far; - -/* - * Cant use this since we need the fac and x1 values set - * if(G.vd->persp==2) - object_view_settings(G.vd->camera, &lens, &(*clipsta), &(*clipend));*/ - - if(G.vd->persp==2) { - if(G.vd->camera) { - if(G.vd->camera->type==OB_LAMP ) { - Lamp *la; - - la= G.vd->camera->data; - fac= cos( M_PI*la->spotsize/360.0); - - x1= saacos(fac); - lens= 16.0*fac/sin(x1); - - *clipsta= la->clipsta; - *clipend= la->clipend; - } - else if(G.vd->camera->type==OB_CAMERA) { - cam= G.vd->camera->data; - lens= cam->lens; - *clipsta= cam->clipsta; - *clipend= cam->clipend; - } - } - } - - if(G.vd->persp==0) { - if(winx>winy) x1= -G.vd->dist; - else x1= -winx*G.vd->dist/winy; - x2= -x1; - - if(winx>winy) y1= -winy*G.vd->dist/winx; - else y1= -G.vd->dist; - y2= -y1; - - *clipend *= 0.5; // otherwise too extreme low zbuffer quality - *clipsta= - *clipend; - orth= 1; - } - else { - /* fac for zoom, also used for camdx */ - if(G.vd->persp==2) { - fac= (1.41421+( (float)G.vd->camzoom )/50.0); - fac*= fac; - } - else fac= 2.0; - - /* viewplane size depends... */ - if(cam && cam->type==CAM_ORTHO) { - /* ortho_scale == 1 means exact 1 to 1 mapping */ - float dfac= 2.0*cam->ortho_scale/fac; - - if(winx>winy) x1= -dfac; - else x1= -winx*dfac/winy; - x2= -x1; - - if(winx>winy) y1= -winy*dfac/winx; - else y1= -dfac; - y2= -y1; - orth= 1; - } - else { - float dfac; - - if(winx>winy) dfac= 64.0/(fac*winx*lens); - else dfac= 64.0/(fac*winy*lens); - - x1= - *clipsta * winx*dfac; - x2= -x1; - y1= - *clipsta * winy*dfac; - y2= -y1; - orth= 0; - } - /* cam view offset */ - if(cam) { - float dx= 0.5*fac*G.vd->camdx*(x2-x1); - float dy= 0.5*fac*G.vd->camdy*(y2-y1); - x1+= dx; - x2+= dx; - y1+= dy; - y2+= dy; - } - } - - if(pixsize) { - float viewfac; - - if(orth) { - viewfac= (winx >= winy)? winx: winy; - *pixsize= 1.0f/viewfac; - } - else { - viewfac= (((winx >= winy)? winx: winy)*lens)/32.0; - *pixsize= *clipsta/viewfac; - } - } - - viewplane->xmin= x1; - viewplane->ymin= y1; - viewplane->xmax= x2; - viewplane->ymax= y2; - - return orth; -} - -/* important to not set windows active in here, can be renderwin for example */ -void setwinmatrixview3d(int winx, int winy, rctf *rect) /* rect: for picking */ -{ - rctf viewplane; - float clipsta, clipend, x1, y1, x2, y2; - int orth; - - orth= get_view3d_viewplane(winx, winy, &viewplane, &clipsta, &clipend, NULL); -// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend); - x1= viewplane.xmin; - y1= viewplane.ymin; - x2= viewplane.xmax; - y2= viewplane.ymax; - - if(rect) { /* picking */ - rect->xmin/= (float)curarea->winx; - rect->xmin= x1+rect->xmin*(x2-x1); - rect->ymin/= (float)curarea->winy; - rect->ymin= y1+rect->ymin*(y2-y1); - rect->xmax/= (float)curarea->winx; - rect->xmax= x1+rect->xmax*(x2-x1); - rect->ymax/= (float)curarea->winy; - rect->ymax= y1+rect->ymax*(y2-y1); - - if(orth) myortho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); - else mywindow(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); - - } - else { - if(orth) myortho(x1, x2, y1, y2, clipsta, clipend); - else mywindow(x1, x2, y1, y2, clipsta, clipend); - } - - /* not sure what this was for? (ton) */ - glMatrixMode(GL_PROJECTION); - mygetmatrix(curarea->winmat); - glMatrixMode(GL_MODELVIEW); -} - -void obmat_to_viewmat(Object *ob, short smooth) -{ - float bmat[4][4]; - float tmat[3][3]; - - Mat4CpyMat4(bmat, ob->obmat); - Mat4Ortho(bmat); - Mat4Invert(G.vd->viewmat, bmat); - - /* view quat calculation, needed for add object */ - Mat3CpyMat4(tmat, G.vd->viewmat); - if (smooth) { - float new_quat[4]; - if (G.vd->persp==2 && G.vd->camera) { - /* were from a camera view */ - - float orig_ofs[3]; - float orig_dist= G.vd->dist; - float orig_lens= G.vd->lens; - VECCOPY(orig_ofs, G.vd->ofs); - - /* Switch from camera view */ - Mat3ToQuat(tmat, new_quat); - - G.vd->persp=1; - G.vd->dist= 0.0; - - view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens); - smooth_view(G.vd, orig_ofs, new_quat, &orig_dist, &orig_lens); - - G.vd->persp=2; /* just to be polite, not needed */ - - } else { - Mat3ToQuat(tmat, new_quat); - smooth_view(G.vd, NULL, new_quat, NULL, NULL); - } - } else { - Mat3ToQuat(tmat, G.vd->viewquat); - } -} - -/* dont set windows active in in here, is used by renderwin too */ -void setviewmatrixview3d() -{ - if(G.vd->persp>=2) { /* obs/camera */ - if(G.vd->camera) { - where_is_object(G.vd->camera); - obmat_to_viewmat(G.vd->camera, 0); - } - else { - QuatToMat4(G.vd->viewquat, G.vd->viewmat); - G.vd->viewmat[3][2]-= G.vd->dist; - } - } - else { - - QuatToMat4(G.vd->viewquat, G.vd->viewmat); - if(G.vd->persp==1) G.vd->viewmat[3][2]-= G.vd->dist; - if(G.vd->ob_centre) { - Object *ob= G.vd->ob_centre; - float vec[3]; - - VECCOPY(vec, ob->obmat[3]); - if(ob->type==OB_ARMATURE && G.vd->ob_centre_bone[0]) { - bPoseChannel *pchan= get_pose_channel(ob->pose, G.vd->ob_centre_bone); - if(pchan) { - VECCOPY(vec, pchan->pose_mat[3]); - Mat4MulVecfl(ob->obmat, vec); - } - } - i_translate(-vec[0], -vec[1], -vec[2], G.vd->viewmat); - } - else i_translate(G.vd->ofs[0], G.vd->ofs[1], G.vd->ofs[2], G.vd->viewmat); - } -} - -void setcameratoview3d(void) -{ - Object *ob; - float dvec[3]; - - ob= G.vd->camera; - dvec[0]= G.vd->dist*G.vd->viewinv[2][0]; - dvec[1]= G.vd->dist*G.vd->viewinv[2][1]; - dvec[2]= G.vd->dist*G.vd->viewinv[2][2]; - VECCOPY(ob->loc, dvec); - VecSubf(ob->loc, ob->loc, G.vd->ofs); - G.vd->viewquat[0]= -G.vd->viewquat[0]; - if (ob->transflag & OB_QUAT) { - QUATCOPY(ob->quat, G.vd->viewquat); - } else { - QuatToEul(G.vd->viewquat, ob->rot); - } - G.vd->viewquat[0]= -G.vd->viewquat[0]; -} - -/* IGLuint-> GLuint*/ -/* Warning: be sure to account for a negative return value - * This is an error, "Too many objects in select buffer" - * and no action should be taken (can crash blender) if this happens - */ -short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1, short y1, short x2, short y2) -{ - rctf rect; - short mval[2], code, hits; - - G.f |= G_PICKSEL; - - if(x1==0 && x2==0 && y1==0 && y2==0) { - getmouseco_areawin(mval); - rect.xmin= mval[0]-12; // seems to be default value for bones only now - rect.xmax= mval[0]+12; - rect.ymin= mval[1]-12; - rect.ymax= mval[1]+12; - } - else { - rect.xmin= x1; - rect.xmax= x2; - rect.ymin= y1; - rect.ymax= y2; - } - /* get rid of overlay button matrix */ - persp(PERSP_VIEW); - setwinmatrixview3d(curarea->winx, curarea->winy, &rect); - Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); - - if(G.vd->drawtype > OB_WIRE) { - G.vd->zbuf= TRUE; - glEnable(GL_DEPTH_TEST); - } - - if(G.vd->flag & V3D_CLIPPING) - view3d_set_clipping(G.vd); - - glSelectBuffer( bufsize, (GLuint *)buffer); - glRenderMode(GL_SELECT); - glInitNames(); /* these two calls whatfor? It doesnt work otherwise */ - glPushName(-1); - code= 1; - - if(G.obedit && G.obedit->type==OB_MBALL) { - draw_object(BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); - } - else if ((G.obedit && G.obedit->type==OB_ARMATURE)) { - draw_object(BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); - } - else { - Base *base; - - G.vd->xray= TRUE; // otherwise it postpones drawing - for(base= G.scene->base.first; base; base= base->next) { - if(base->lay & G.vd->lay) { - - if (base->object->restrictflag & OB_RESTRICT_SELECT) - base->selcol= 0; - else { - base->selcol= code; - glLoadName(code); - draw_object(base, DRAW_PICKING|DRAW_CONSTCOLOR); - - /* we draw group-duplicators for selection too */ - if((base->object->transflag & OB_DUPLI) && base->object->dup_group) { - ListBase *lb; - DupliObject *dob; - Base tbase; - - tbase.flag= OB_FROMDUPLI; - lb= object_duplilist(G.scene, base->object); - - for(dob= lb->first; dob; dob= dob->next) { - tbase.object= dob->ob; - Mat4CpyMat4(dob->ob->obmat, dob->mat); - - draw_object(&tbase, DRAW_PICKING|DRAW_CONSTCOLOR); - - Mat4CpyMat4(dob->ob->obmat, dob->omat); - } - free_object_duplilist(lb); - } - code++; - } - } - } - G.vd->xray= FALSE; // restore - } - - glPopName(); /* see above (pushname) */ - hits= glRenderMode(GL_RENDER); - - G.f &= ~G_PICKSEL; - setwinmatrixview3d(curarea->winx, curarea->winy, NULL); - Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); - - if(G.vd->drawtype > OB_WIRE) { - G.vd->zbuf= 0; - glDisable(GL_DEPTH_TEST); - } - persp(PERSP_WIN); - - if(G.vd->flag & V3D_CLIPPING) - view3d_clr_clipping(); - - if(hits<0) error("Too many objects in select buffer"); - - return hits; -} - -float *give_cursor() -{ - if(G.vd && G.vd->localview) return G.vd->cursor; - else return G.scene->cursor; -} - -unsigned int free_localbit() -{ - unsigned int lay; - ScrArea *sa; - bScreen *sc; - - lay= 0; - - /* sometimes we loose a localview: when an area is closed */ - /* check all areas: which localviews are in use? */ - sc= G.main->screen.first; - while(sc) { - sa= sc->areabase.first; - while(sa) { - SpaceLink *sl= sa->spacedata.first; - while(sl) { - if(sl->spacetype==SPACE_VIEW3D) { - View3D *v3d= (View3D*) sl; - lay |= v3d->lay; - } - sl= sl->next; - } - sa= sa->next; - } - sc= sc->id.next; - } - - if( (lay & 0x01000000)==0) return 0x01000000; - if( (lay & 0x02000000)==0) return 0x02000000; - if( (lay & 0x04000000)==0) return 0x04000000; - if( (lay & 0x08000000)==0) return 0x08000000; - if( (lay & 0x10000000)==0) return 0x10000000; - if( (lay & 0x20000000)==0) return 0x20000000; - if( (lay & 0x40000000)==0) return 0x40000000; - if( (lay & 0x80000000)==0) return 0x80000000; - - return 0; -} - - -void initlocalview() -{ - Base *base; - float size = 0.0, min[3], max[3], afm[3]; - unsigned int locallay; - int ok=0; - - if(G.vd->localvd) return; - - min[0]= min[1]= min[2]= 1.0e10; - max[0]= max[1]= max[2]= -1.0e10; - - locallay= free_localbit(); - - if(locallay==0) { - error("Sorry, no more than 8 localviews"); - ok= 0; - } - else { - if(G.obedit) { - minmax_object(G.obedit, min, max); - - ok= 1; - - BASACT->lay |= locallay; - G.obedit->lay= BASACT->lay; - } - else { - base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - minmax_object(base->object, min, max); - base->lay |= locallay; - base->object->lay= base->lay; - ok= 1; - } - base= base->next; - } - } - - afm[0]= (max[0]-min[0]); - afm[1]= (max[1]-min[1]); - afm[2]= (max[2]-min[2]); - size= 0.7*MAX3(afm[0], afm[1], afm[2]); - if(size<=0.01) size= 0.01; - } - - if(ok) { - G.vd->localvd= MEM_mallocN(sizeof(View3D), "localview"); - memcpy(G.vd->localvd, G.vd, sizeof(View3D)); - - G.vd->ofs[0]= -(min[0]+max[0])/2.0; - G.vd->ofs[1]= -(min[1]+max[1])/2.0; - G.vd->ofs[2]= -(min[2]+max[2])/2.0; - - G.vd->dist= size; - - // correction for window aspect ratio - if(curarea->winy>2 && curarea->winx>2) { - size= (float)curarea->winx/(float)curarea->winy; - if(size<1.0) size= 1.0/size; - G.vd->dist*= size; - } - - if (G.vd->persp>1) G.vd->persp= 1; - if (G.vd->near> 0.1) G.vd->near= 0.1; - - G.vd->cursor[0]= -G.vd->ofs[0]; - G.vd->cursor[1]= -G.vd->ofs[1]; - G.vd->cursor[2]= -G.vd->ofs[2]; - - G.vd->lay= locallay; - - countall(); - scrarea_queue_winredraw(curarea); - } - else { - /* clear flags */ - base= FIRSTBASE; - while(base) { - if( base->lay & locallay ) { - base->lay-= locallay; - if(base->lay==0) base->lay= G.vd->layact; - if(base->object != G.obedit) base->flag |= SELECT; - base->object->lay= base->lay; - } - base= base->next; - } - scrarea_queue_headredraw(curarea); - - G.vd->localview= 0; - } - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); -} - -void centerview() /* like a localview without local! */ -{ - Object *ob= OBACT; - float size, min[3], max[3], afm[3]; - int ok=0; - - /* SMOOTHVIEW */ - float new_ofs[3]; - float new_dist; - - - min[0]= min[1]= min[2]= 1.0e10; - max[0]= max[1]= max[2]= -1.0e10; - - if (G.f & G_WEIGHTPAINT) { - /* hardcoded exception, we look for the one selected armature */ - /* this is weak code this way, we should make a generic active/selection callback interface once... */ - Base *base; - for(base=FIRSTBASE; base; base= base->next) { - if(TESTBASELIB(base)) { - if(base->object->type==OB_ARMATURE) - if(base->object->flag & OB_POSEMODE) - break; - } - } - if(base) - ob= base->object; - } - - - if(G.obedit) { - ok = minmax_verts(min, max); /* only selected */ - } - else if(ob && (ob->flag & OB_POSEMODE)) { - if(ob->pose) { - bArmature *arm= ob->data; - bPoseChannel *pchan; - float vec[3]; - - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->flag & BONE_SELECTED) { - if(pchan->bone->layer & arm->layer) { - ok= 1; - VECCOPY(vec, pchan->pose_head); - Mat4MulVecfl(ob->obmat, vec); - DO_MINMAX(vec, min, max); - VECCOPY(vec, pchan->pose_tail); - Mat4MulVecfl(ob->obmat, vec); - DO_MINMAX(vec, min, max); - } - } - } - } - } - else if (FACESEL_PAINT_TEST) { - ok= minmax_tface(min, max); - } - else if (G.f & G_PARTICLEEDIT) { - ok= PE_minmax(min, max); - } - else { - Base *base= FIRSTBASE; - while(base) { - if TESTBASE(base) { - minmax_object(base->object, min, max); - /* account for duplis */ - minmax_object_duplis(base->object, min, max); - - ok= 1; - } - base= base->next; - } - } - - if(ok==0) return; - - afm[0]= (max[0]-min[0]); - afm[1]= (max[1]-min[1]); - afm[2]= (max[2]-min[2]); - size= 0.7*MAX3(afm[0], afm[1], afm[2]); - - if(size <= G.vd->near*1.5) size= G.vd->near*1.5; - - new_ofs[0]= -(min[0]+max[0])/2.0; - new_ofs[1]= -(min[1]+max[1])/2.0; - new_ofs[2]= -(min[2]+max[2])/2.0; - - new_dist = size; - - /* correction for window aspect ratio */ - if(curarea->winy>2 && curarea->winx>2) { - size= (float)curarea->winx/(float)curarea->winy; - if(size<1.0) size= 1.0/size; - new_dist*= size; - } - - G.vd->cursor[0]= -new_ofs[0]; - G.vd->cursor[1]= -new_ofs[1]; - G.vd->cursor[2]= -new_ofs[2]; - - if (G.vd->persp==2 && G.vd->camera) { - float orig_lens= G.vd->lens; - - G.vd->persp=1; - G.vd->dist= 0.0; - view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens); - smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens); - } else { - if(G.vd->persp>=2) - G.vd->persp= 1; - - smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL); - } - scrarea_queue_winredraw(curarea); - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - -} - - -void restore_localviewdata(View3D *vd) -{ - if(vd->localvd==0) return; - - VECCOPY(vd->ofs, vd->localvd->ofs); - vd->dist= vd->localvd->dist; - vd->persp= vd->localvd->persp; - vd->view= vd->localvd->view; - vd->near= vd->localvd->near; - vd->far= vd->localvd->far; - vd->lay= vd->localvd->lay; - vd->layact= vd->localvd->layact; - vd->drawtype= vd->localvd->drawtype; - vd->camera= vd->localvd->camera; - QUATCOPY(vd->viewquat, vd->localvd->viewquat); - -} - -void endlocalview(ScrArea *sa) -{ - View3D *v3d; - struct Base *base; - unsigned int locallay; - - if(sa->spacetype!=SPACE_VIEW3D) return; - v3d= sa->spacedata.first; - - if(v3d->localvd) { - - locallay= v3d->lay & 0xFF000000; - - restore_localviewdata(v3d); - - MEM_freeN(v3d->localvd); - v3d->localvd= 0; - v3d->localview= 0; - - /* for when in other window the layers have changed */ - if(v3d->scenelock) v3d->lay= G.scene->lay; - - base= FIRSTBASE; - while(base) { - if( base->lay & locallay ) { - base->lay-= locallay; - if(base->lay==0) base->lay= v3d->layact; - if(base->object != G.obedit) { - base->flag |= SELECT; - base->object->flag |= SELECT; - } - base->object->lay= base->lay; - } - base= base->next; - } - - countall(); - allqueue(REDRAWVIEW3D, 0); /* because of select */ - allqueue(REDRAWOOPS, 0); /* because of select */ - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - } -} - -void view3d_home(int center) -{ - Base *base; - float size, min[3], max[3], afm[3]; - int ok= 1, onedone=0; - - if(center) { - min[0]= min[1]= min[2]= 0.0; - max[0]= max[1]= max[2]= 0.0; - } - else { - min[0]= min[1]= min[2]= 1.0e10; - max[0]= max[1]= max[2]= -1.0e10; - } - - for(base= FIRSTBASE; base; base= base->next) { - if(base->lay & G.vd->lay) { - onedone= 1; - minmax_object(base->object, min, max); - } - } - if(!onedone) return; - - afm[0]= (max[0]-min[0]); - afm[1]= (max[1]-min[1]); - afm[2]= (max[2]-min[2]); - size= 0.7*MAX3(afm[0], afm[1], afm[2]); - if(size==0.0) ok= 0; - - if(ok) { - float new_dist; - float new_ofs[3]; - - new_dist = size; - new_ofs[0]= -(min[0]+max[0])/2.0; - new_ofs[1]= -(min[1]+max[1])/2.0; - new_ofs[2]= -(min[2]+max[2])/2.0; - - // correction for window aspect ratio - if(curarea->winy>2 && curarea->winx>2) { - size= (float)curarea->winx/(float)curarea->winy; - if(size<1.0) size= 1.0/size; - new_dist*= size; - } - - if (G.vd->persp==2 && G.vd->camera) { - /* switch out of camera view */ - float orig_lens= G.vd->lens; - - G.vd->persp=1; - G.vd->dist= 0.0; - view_settings_from_ob(G.vd->camera, G.vd->ofs, NULL, NULL, &G.vd->lens); - smooth_view(G.vd, new_ofs, NULL, &new_dist, &orig_lens); - - } else { - if(G.vd->persp>=2) G.vd->persp= 1; - smooth_view(G.vd, new_ofs, NULL, &new_dist, NULL); - } - scrarea_queue_winredraw(curarea); - } - BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT); - -} - - -void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3]) -{ - float alignaxis[3] = {0.0, 0.0, 0.0}; - float norm[3], axis[3], angle, new_quat[4]; - - if(axisidx > 0) alignaxis[axisidx-1]= 1.0; - else alignaxis[-axisidx-1]= -1.0; - - VECCOPY(norm, vec); - Normalize(norm); - - angle= acos(Inpf(alignaxis, norm)); - Crossf(axis, alignaxis, norm); - VecRotToQuat(axis, -angle, new_quat); - - v3d->view= 0; - - if (v3d->persp==2 && v3d->camera) { - /* switch out of camera view */ - float orig_ofs[3]; - float orig_dist= v3d->dist; - float orig_lens= v3d->lens; - - VECCOPY(orig_ofs, v3d->ofs); - G.vd->persp=1; - G.vd->dist= 0.0; - view_settings_from_ob(v3d->camera, v3d->ofs, NULL, NULL, &v3d->lens); - smooth_view(G.vd, orig_ofs, new_quat, &orig_dist, &orig_lens); - } else { - if (v3d->persp>=2) v3d->persp= 1; /* switch out of camera mode */ - smooth_view(v3d, NULL, new_quat, NULL, NULL); - } -} - - - -/* SMOOTHVIEW */ -void smooth_view(View3D *v3d, float *ofs, float *quat, float *dist, float *lens) -{ - /* View Animation enabled */ - if (U.smooth_viewtx) { - int i; - char changed = 0; - float step = 0.0, step_inv; - float orig_dist; - float orig_lens; - float orig_quat[4]; - float orig_ofs[3]; - - double time_allowed, time_current, time_start; - - /* if there is no difference, return */ - changed = 0; /* zero means no difference */ - if (dist) { - if ((*dist) != v3d->dist) - changed = 1; - } - - if (lens) { - if ((*lens) != v3d->lens) - changed = 1; - } - - if (!changed && ofs) { - if ((ofs[0]!=v3d->ofs[0]) || - (ofs[1]!=v3d->ofs[1]) || - (ofs[2]!=v3d->ofs[2]) ) - changed = 1; - } - - if (!changed && quat ) { - if ((quat[0]!=v3d->viewquat[0]) || - (quat[1]!=v3d->viewquat[1]) || - (quat[2]!=v3d->viewquat[2]) || - (quat[3]!=v3d->viewquat[3]) ) - changed = 1; - } - - /* The new view is different from teh old one - * so animate the view */ - if (changed) { - - /* store original values */ - VECCOPY(orig_ofs, v3d->ofs); - QUATCOPY(orig_quat, v3d->viewquat); - orig_dist = v3d->dist; - orig_lens = v3d->lens; - - time_allowed= (float)U.smooth_viewtx / 1000.0; - time_current = time_start = PIL_check_seconds_timer(); - - /* if this is view rotation only - * we can decrease the time allowed by - * the angle between quats - * this means small rotations wont lag */ - if (quat && !ofs && !dist) { - float vec1[3], vec2[3]; - VECCOPY(vec1, quat); - VECCOPY(vec2, v3d->viewquat); - Normalize(vec1); - Normalize(vec2); - /* scale the time allowed by the rotation */ - time_allowed *= NormalizedVecAngle2(vec1, vec2)/(M_PI/2); - } - - while (time_start + time_allowed > time_current) { - - step = (float)((time_current-time_start) / time_allowed); - - /* ease in/out */ - if (step < 0.5) step = pow(step*2, 2)/2; - else step = 1-(pow(2*(1-step) ,2)/2); - - step_inv = 1-step; - - if (ofs) - for (i=0; i<3; i++) - v3d->ofs[i] = ofs[i]*step + orig_ofs[i]*step_inv; - - - if (quat) - QuatInterpol(v3d->viewquat, orig_quat, quat, step); - - if (dist) - v3d->dist = ((*dist)*step) + (orig_dist*step_inv); - - if (lens) - v3d->lens = ((*lens)*step) + (orig_lens*step_inv); - - /*redraw the view*/ - scrarea_do_windraw(curarea); - screen_swapbuffers(); - - time_current= PIL_check_seconds_timer(); - } - } - } - - /* set these values even if animation is enabled because flaot - * error will make then not quite accurate */ - if (ofs) - VECCOPY(v3d->ofs, ofs); - if (quat) - QUATCOPY(v3d->viewquat, quat); - if (dist) - v3d->dist = *dist; - if (lens) - v3d->lens = *lens; - -} - - - -/* Gets the view trasnformation from a camera - * currently dosnt take camzoom into account - * - * The dist is not modified for this function, if NULL its assimed zero - * */ -void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens) -{ - float bmat[4][4]; - float imat[4][4]; - float tmat[3][3]; - - if (!ob) return; - - /* Offset */ - if (ofs) { - where_is_object(ob); - VECCOPY(ofs, ob->obmat[3]); - VecMulf(ofs, -1.0f); /*flip the vector*/ - } - - /* Quat */ - if (quat) { - Mat4CpyMat4(bmat, ob->obmat); - Mat4Ortho(bmat); - Mat4Invert(imat, bmat); - Mat3CpyMat4(tmat, imat); - Mat3ToQuat(tmat, quat); - } - - if (dist) { - float vec[3]; - Mat3CpyMat4(tmat, ob->obmat); - - vec[0]= vec[1] = 0.0; - vec[2]= -(*dist); - Mat3MulVecfl(tmat, vec); - VecSubf(ofs, ofs, vec); - } - - /* Lens */ - if (lens) - object_view_settings(ob, lens, NULL, NULL); -} - -/* For use with smooth view - * - * the current view is unchanged, blend between the current view and the - * camera view - * */ -void smooth_view_to_camera(View3D *v3d) -{ - if (!U.smooth_viewtx || !v3d->camera || G.vd->persp != 2) { - return; - } else { - Object *ob = v3d->camera; - - float orig_ofs[3]; - float orig_dist=v3d->dist; - float orig_lens=v3d->lens; - float new_dist=0.0; - float new_lens=35.0; - float new_quat[4]; - float new_ofs[3]; - - VECCOPY(orig_ofs, v3d->ofs); - - view_settings_from_ob(ob, new_ofs, new_quat, NULL, &new_lens); - - G.vd->persp=1; - smooth_view(v3d, new_ofs, new_quat, &new_dist, &new_lens); - VECCOPY(v3d->ofs, orig_ofs); - v3d->lens= orig_lens; - v3d->dist = orig_dist; /* restore the dist */ - - v3d->camera = ob; - v3d->persp=2; - } -} diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c deleted file mode 100644 index 4e1c6cd59a6..00000000000 --- a/source/blender/src/vpaint.c +++ /dev/null @@ -1,1621 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include -#include - -#ifdef WIN32 -#include -#else -#include -#endif - -#include "MEM_guardedalloc.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "MTC_matrixops.h" - -#include "DNA_action_types.h" -#include "DNA_armature_types.h" -#include "DNA_brush_types.h" -#include "DNA_mesh_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_object_force.h" -#include "DNA_screen_types.h" -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_view3d_types.h" -#include "DNA_userdef_types.h" - -#include "BKE_armature.h" -#include "BKE_DerivedMesh.h" -#include "BKE_customdata.h" -#include "BKE_depsgraph.h" -#include "BKE_deform.h" -#include "BKE_displist.h" -#include "BKE_global.h" -#include "BKE_mesh.h" -#include "BKE_modifier.h" -#include "BKE_object.h" -#include "BKE_utildefines.h" - -#include "BIF_editview.h" -#include "BIF_graphics.h" -#include "BIF_glutil.h" -#include "BIF_gl.h" -#include "BIF_interface.h" -#include "BIF_meshtools.h" -#include "BIF_mywindow.h" -#include "BIF_space.h" -#include "BIF_screen.h" -#include "BIF_toolbox.h" - -#include "BDR_vpaint.h" -#include "BDR_editobject.h" - -#include "BSE_drawview.h" -#include "BSE_trans_types.h" -#include "BSE_view.h" - -#include "multires.h" -#include "mydevice.h" -#include "blendef.h" - -#include "BIF_editdeform.h" - - /* Gvp.mode */ -#define VP_MIX 0 -#define VP_ADD 1 -#define VP_SUB 2 -#define VP_MUL 3 -#define VP_BLUR 4 -#define VP_LIGHTEN 5 -#define VP_DARKEN 6 - -#define MAXINDEX 512000 - -VPaint Gvp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT+VP_SPRAY, 0}; -VPaint Gwp= {1.0, 1.0, 1.0, 1.0, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, 0}; - -static int *get_indexarray(void) -{ - return MEM_mallocN(sizeof(int)*MAXINDEX + 2, "vertexpaint"); -} - -void free_vertexpaint() -{ - - if(Gvp.vpaint_prev) MEM_freeN(Gvp.vpaint_prev); - Gvp.vpaint_prev= NULL; - - mesh_octree_table(NULL, NULL, 'e'); -} - -/* in contradiction to cpack drawing colors, the MCOL colors (vpaint colors) are per byte! - so not endian sensitive. Mcol = ABGR!!! so be cautious with cpack calls */ - -unsigned int rgba_to_mcol(float r, float g, float b, float a) -{ - int ir, ig, ib, ia; - unsigned int col; - char *cp; - - ir= floor(255.0*r); - if(ir<0) ir= 0; else if(ir>255) ir= 255; - ig= floor(255.0*g); - if(ig<0) ig= 0; else if(ig>255) ig= 255; - ib= floor(255.0*b); - if(ib<0) ib= 0; else if(ib>255) ib= 255; - ia= floor(255.0*a); - if(ia<0) ia= 0; else if(ia>255) ia= 255; - - cp= (char *)&col; - cp[0]= ia; - cp[1]= ib; - cp[2]= ig; - cp[3]= ir; - - return col; - -} - -static unsigned int vpaint_get_current_col(VPaint *vp) -{ - return rgba_to_mcol(vp->r, vp->g, vp->b, 1.0f); -} - -void do_shared_vertexcol(Mesh *me) -{ - /* if no mcol: do not do */ - /* if tface: only the involved faces, otherwise all */ - MFace *mface; - MTFace *tface; - int a; - short *scolmain, *scol; - char *mcol; - - if(me->mcol==0 || me->totvert==0 || me->totface==0) return; - - scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain"); - - tface= me->mtface; - mface= me->mface; - mcol= (char *)me->mcol; - for(a=me->totface; a>0; a--, mface++, mcol+=16) { - if((tface && tface->mode & TF_SHAREDCOL) || (G.f & G_FACESELECT)==0) { - scol= scolmain+4*mface->v1; - scol[0]++; scol[1]+= mcol[1]; scol[2]+= mcol[2]; scol[3]+= mcol[3]; - scol= scolmain+4*mface->v2; - scol[0]++; scol[1]+= mcol[5]; scol[2]+= mcol[6]; scol[3]+= mcol[7]; - scol= scolmain+4*mface->v3; - scol[0]++; scol[1]+= mcol[9]; scol[2]+= mcol[10]; scol[3]+= mcol[11]; - if(mface->v4) { - scol= scolmain+4*mface->v4; - scol[0]++; scol[1]+= mcol[13]; scol[2]+= mcol[14]; scol[3]+= mcol[15]; - } - } - if(tface) tface++; - } - - a= me->totvert; - scol= scolmain; - while(a--) { - if(scol[0]>1) { - scol[1]/= scol[0]; - scol[2]/= scol[0]; - scol[3]/= scol[0]; - } - scol+= 4; - } - - tface= me->mtface; - mface= me->mface; - mcol= (char *)me->mcol; - for(a=me->totface; a>0; a--, mface++, mcol+=16) { - if((tface && tface->mode & TF_SHAREDCOL) || (G.f & G_FACESELECT)==0) { - scol= scolmain+4*mface->v1; - mcol[1]= scol[1]; mcol[2]= scol[2]; mcol[3]= scol[3]; - scol= scolmain+4*mface->v2; - mcol[5]= scol[1]; mcol[6]= scol[2]; mcol[7]= scol[3]; - scol= scolmain+4*mface->v3; - mcol[9]= scol[1]; mcol[10]= scol[2]; mcol[11]= scol[3]; - if(mface->v4) { - scol= scolmain+4*mface->v4; - mcol[13]= scol[1]; mcol[14]= scol[2]; mcol[15]= scol[3]; - } - } - if(tface) tface++; - } - - MEM_freeN(scolmain); -} - -void make_vertexcol(int shade) /* single ob */ -{ - Object *ob; - Mesh *me; - - if(G.obedit) { - error("Unable to perform function in Edit Mode"); - return; - } - - ob= OBACT; - if(!ob || ob->id.lib) return; - me= get_mesh(ob); - if(me==0) return; - - /* copies from shadedisplist to mcol */ - if(!me->mcol) { - CustomData_add_layer(&me->fdata, CD_MCOL, CD_CALLOC, NULL, me->totface); - mesh_update_customdata_pointers(me); - } - - if(shade) - shadeMeshMCol(ob, me); - else - memset(me->mcol, 255, 4*sizeof(MCol)*me->totface); - - if (me->mr) multires_load_cols(me); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWBUTSEDIT, 0); - allqueue(REDRAWVIEW3D, 0); -} - -static void copy_vpaint_prev(VPaint *vp, unsigned int *mcol, int tot) -{ - if(vp->vpaint_prev) { - MEM_freeN(vp->vpaint_prev); - vp->vpaint_prev= NULL; - } - vp->tot= tot; - - if(mcol==NULL || tot==0) return; - - vp->vpaint_prev= MEM_mallocN(4*sizeof(int)*tot, "vpaint_prev"); - memcpy(vp->vpaint_prev, mcol, 4*sizeof(int)*tot); - -} - -static void copy_wpaint_prev (VPaint *vp, MDeformVert *dverts, int dcount) -{ - if (vp->wpaint_prev) { - free_dverts(vp->wpaint_prev, vp->tot); - vp->wpaint_prev= NULL; - } - - if(dverts && dcount) { - - vp->wpaint_prev = MEM_mallocN (sizeof(MDeformVert)*dcount, "wpaint prev"); - vp->tot = dcount; - copy_dverts (vp->wpaint_prev, dverts, dcount); - } -} - - -void clear_vpaint() -{ - Mesh *me; - Object *ob; - unsigned int *to, paintcol; - int a; - - if((G.f & G_VERTEXPAINT)==0) return; - - ob= OBACT; - me= get_mesh(ob); - if(!ob || ob->id.lib) return; - - if(me==0 || me->mcol==0 || me->totface==0) return; - - paintcol= vpaint_get_current_col(&Gvp); - - to= (unsigned int *)me->mcol; - a= 4*me->totface; - while(a--) { - *to= paintcol; - to++; - } - BIF_undo_push("Clear vertex colors"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - allqueue(REDRAWVIEW3D, 0); -} - -void clear_vpaint_selectedfaces() -{ - Mesh *me; - MFace *mf; - Object *ob; - unsigned int paintcol, *mcol; - int i; - - ob= OBACT; - me= get_mesh(ob); - if(me==0 || me->totface==0) return; - - if(!me->mcol) - make_vertexcol(0); - - paintcol= vpaint_get_current_col(&Gvp); - - mf = me->mface; - mcol = (unsigned int*)me->mcol; - for (i = 0; i < me->totface; i++, mf++, mcol+=4) { - if (mf->flag & ME_FACE_SEL) { - mcol[0] = paintcol; - mcol[1] = paintcol; - mcol[2] = paintcol; - mcol[3] = paintcol; - } - } - - BIF_undo_push("Clear vertex colors"); - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); -} - - -/* fills in the selected faces with the current weight and vertex group */ -void clear_wpaint_selectedfaces() -{ - extern float editbutvweight; - float paintweight= editbutvweight; - Mesh *me; - MFace *mface; - Object *ob; - MDeformWeight *dw, *uw; - int *indexar; - int index, vgroup; - unsigned int faceverts[5]={0,0,0,0,0}; - unsigned char i; - int vgroup_mirror= -1; - - ob= OBACT; - me= ob->data; - if(me==0 || me->totface==0 || me->dvert==0 || !me->mface) return; - - indexar= get_indexarray(); - for(index=0, mface=me->mface; indextotface; index++, mface++) { - if((mface->flag & ME_FACE_SEL)==0) - indexar[index]= 0; - else - indexar[index]= index+1; - } - - vgroup= ob->actdef-1; - - /* directly copied from weight_paint, should probaby split into a seperate function */ - /* if mirror painting, find the other group */ - if(Gwp.flag & VP_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - BLI_strncpy(name, defgroup->name, 32); - bone_flip_name(name, 0); /* 0 = don't strip off number extensions */ - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, add_defgroup sets the active defgroup */ - curdef= add_defgroup_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - vgroup_mirror= actdef; - } - } - /* end copy from weight_paint*/ - - copy_wpaint_prev(&Gwp, me->dvert, me->totvert); - - for(index=0; indextotface; index++) { - if(indexar[index] && indexar[index]<=me->totface) { - mface= me->mface + (indexar[index]-1); - /* just so we can loop through the verts */ - faceverts[0]= mface->v1; - faceverts[1]= mface->v2; - faceverts[2]= mface->v3; - faceverts[3]= mface->v4; - for (i=0; i<3 || faceverts[i]; i++) { - if(!((me->dvert+faceverts[i])->flag)) { - dw= verify_defweight(me->dvert+faceverts[i], vgroup); - if(dw) { - uw= verify_defweight(Gwp.wpaint_prev+faceverts[i], vgroup); - uw->weight= dw->weight; /* set the undio weight */ - dw->weight= paintweight; - - if(Gwp.flag & VP_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, faceverts[i]); - if(j>=0) { - /* copy, not paint again */ - if(vgroup_mirror != -1) { - dw= verify_defweight(me->dvert+j, vgroup_mirror); - uw= verify_defweight(Gwp.wpaint_prev+j, vgroup_mirror); - } else { - dw= verify_defweight(me->dvert+j, vgroup); - uw= verify_defweight(Gwp.wpaint_prev+j, vgroup); - } - uw->weight= dw->weight; /* set the undo weight */ - dw->weight= paintweight; - } - } - } - (me->dvert+faceverts[i])->flag= 1; - } - } - } - } - - index=0; - while (indextotvert) { - (me->dvert+index)->flag= 0; - index++; - } - - MEM_freeN(indexar); - copy_wpaint_prev(&Gwp, NULL, 0); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - BIF_undo_push("Set vertex weight"); - allqueue(REDRAWVIEW3D, 0); -} - - -void vpaint_dogamma() -{ - Mesh *me; - Object *ob; - float igam, fac; - int a, temp; - char *cp, gamtab[256]; - - if((G.f & G_VERTEXPAINT)==0) return; - - ob= OBACT; - me= get_mesh(ob); - if(me==0 || me->mcol==0 || me->totface==0) return; - - igam= 1.0/Gvp.gamma; - for(a=0; a<256; a++) { - - fac= ((float)a)/255.0; - fac= Gvp.mul*pow( fac, igam); - - temp= 255.9*fac; - - if(temp<=0) gamtab[a]= 0; - else if(temp>=255) gamtab[a]= 255; - else gamtab[a]= temp; - } - - a= 4*me->totface; - cp= (char *)me->mcol; - while(a--) { - - cp[1]= gamtab[ cp[1] ]; - cp[2]= gamtab[ cp[2] ]; - cp[3]= gamtab[ cp[3] ]; - - cp+= 4; - } - allqueue(REDRAWVIEW3D, 0); -} - -/* used for both 3d view and image window */ -void sample_vpaint() /* frontbuf */ -{ - unsigned int col; - int x, y; - short mval[2]; - char *cp; - - getmouseco_areawin(mval); - x= mval[0]; y= mval[1]; - - if(x<0 || y<0) return; - if(x>=curarea->winx || y>=curarea->winy) return; - - x+= curarea->winrct.xmin; - y+= curarea->winrct.ymin; - - glReadBuffer(GL_FRONT); - glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); - glReadBuffer(GL_BACK); - - cp = (char *)&col; - - if(G.f & (G_VERTEXPAINT|G_WEIGHTPAINT)) { - Gvp.r= cp[0]/255.0f; - Gvp.g= cp[1]/255.0f; - Gvp.b= cp[2]/255.0f; - } - else { - Brush *brush= G.scene->toolsettings->imapaint.brush; - - if(brush) { - brush->rgb[0]= cp[0]/255.0f; - brush->rgb[1]= cp[1]/255.0f; - brush->rgb[2]= cp[2]/255.0f; - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWIMAGE, 0); - } - } - - allqueue(REDRAWBUTSEDIT, 0); - addqueue(curarea->win, REDRAW, 1); /* needed for when panel is open... */ -} - -static unsigned int mcol_blend(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int mfac; - unsigned int col=0; - - if(fac==0) return col1; - if(fac>=255) return col2; - - mfac= 255-fac; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; - - return col; -} - -static unsigned int mcol_add(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int temp; - unsigned int col=0; - - if(fac==0) return col1; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - cp[0]= 255; - temp= cp1[1] + ((fac*cp2[1])>>8); - if(temp>254) cp[1]= 255; else cp[1]= temp; - temp= cp1[2] + ((fac*cp2[2])>>8); - if(temp>254) cp[2]= 255; else cp[2]= temp; - temp= cp1[3] + ((fac*cp2[3])>>8); - if(temp>254) cp[3]= 255; else cp[3]= temp; - - return col; -} - -static unsigned int mcol_sub(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int temp; - unsigned int col=0; - - if(fac==0) return col1; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - cp[0]= 255; - temp= cp1[1] - ((fac*cp2[1])>>8); - if(temp<0) cp[1]= 0; else cp[1]= temp; - temp= cp1[2] - ((fac*cp2[2])>>8); - if(temp<0) cp[2]= 0; else cp[2]= temp; - temp= cp1[3] - ((fac*cp2[3])>>8); - if(temp<0) cp[3]= 0; else cp[3]= temp; - - return col; -} - -static unsigned int mcol_mul(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int mfac; - unsigned int col=0; - - if(fac==0) return col1; - - mfac= 255-fac; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - /* first mul, then blend the fac */ - cp[0]= 255; - cp[1]= (mfac*cp1[1] + fac*((cp2[1]*cp1[1])>>8) )>>8; - cp[2]= (mfac*cp1[2] + fac*((cp2[2]*cp1[2])>>8) )>>8; - cp[3]= (mfac*cp1[3] + fac*((cp2[3]*cp1[3])>>8) )>>8; - - - return col; -} - -static unsigned int mcol_lighten(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int mfac; - unsigned int col=0; - - if(fac==0) return col1; - if(fac>=255) return col2; - - mfac= 255-fac; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - /* See if are lighter, if so mix, else dont do anything. - if the paint col is darker then the original, then ignore */ - if (cp1[1]+cp1[2]+cp1[3] > cp2[1]+cp2[2]+cp2[3]) - return col1; - - cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; - - return col; -} - -static unsigned int mcol_darken(unsigned int col1, unsigned int col2, int fac) -{ - char *cp1, *cp2, *cp; - int mfac; - unsigned int col=0; - - if(fac==0) return col1; - if(fac>=255) return col2; - - mfac= 255-fac; - - cp1= (char *)&col1; - cp2= (char *)&col2; - cp= (char *)&col; - - /* See if were darker, if so mix, else dont do anything. - if the paint col is brighter then the original, then ignore */ - if (cp1[1]+cp1[2]+cp1[3] < cp2[1]+cp2[2]+cp2[3]) - return col1; - - cp[0]= 255; - cp[1]= (mfac*cp1[1]+fac*cp2[1])>>8; - cp[2]= (mfac*cp1[2]+fac*cp2[2])>>8; - cp[3]= (mfac*cp1[3]+fac*cp2[3])>>8; - return col; -} - -static void vpaint_blend( unsigned int *col, unsigned int *colorig, unsigned int paintcol, int alpha) -{ - - if(Gvp.mode==VP_MIX || Gvp.mode==VP_BLUR) *col= mcol_blend( *col, paintcol, alpha); - else if(Gvp.mode==VP_ADD) *col= mcol_add( *col, paintcol, alpha); - else if(Gvp.mode==VP_SUB) *col= mcol_sub( *col, paintcol, alpha); - else if(Gvp.mode==VP_MUL) *col= mcol_mul( *col, paintcol, alpha); - else if(Gvp.mode==VP_LIGHTEN) *col= mcol_lighten( *col, paintcol, alpha); - else if(Gvp.mode==VP_DARKEN) *col= mcol_darken( *col, paintcol, alpha); - - /* if no spray, clip color adding with colorig & orig alpha */ - if((Gvp.flag & VP_SPRAY)==0) { - unsigned int testcol=0, a; - char *cp, *ct, *co; - - alpha= (int)(255.0*Gvp.a); - - if(Gvp.mode==VP_MIX || Gvp.mode==VP_BLUR) testcol= mcol_blend( *colorig, paintcol, alpha); - else if(Gvp.mode==VP_ADD) testcol= mcol_add( *colorig, paintcol, alpha); - else if(Gvp.mode==VP_SUB) testcol= mcol_sub( *colorig, paintcol, alpha); - else if(Gvp.mode==VP_MUL) testcol= mcol_mul( *colorig, paintcol, alpha); - else if(Gvp.mode==VP_LIGHTEN) testcol= mcol_lighten( *colorig, paintcol, alpha); - else if(Gvp.mode==VP_DARKEN) testcol= mcol_darken( *colorig, paintcol, alpha); - - cp= (char *)col; - ct= (char *)&testcol; - co= (char *)colorig; - - for(a=0; a<4; a++) { - if( ct[a]co[a] ) cp[a]= co[a]; - } - else { - if( cp[a]ct[a] ) cp[a]= ct[a]; - } - } - } -} - - -static int sample_backbuf_area(VPaint *vp, int *indexar, int totface, int x, int y, float size) -{ - unsigned int *rt; - struct ImBuf *ibuf; - int x1, y1, x2, y2, a, tot=0, index; - - if(totface>=MAXINDEX) return 0; - - if(size>64.0) size= 64.0; - - x1= x-size; - x2= x+size; - CLAMP(x1, 0, curarea->winx-1); - CLAMP(x2, 0, curarea->winx-1); - y1= y-size; - y2= y+size; - CLAMP(y1, 0, curarea->winy-1); - CLAMP(y2, 0, curarea->winy-1); -#ifdef __APPLE__ - glReadBuffer(GL_AUX0); -#endif - - if(x1>=x2 || y1>=y2) return 0; - - ibuf = IMB_allocImBuf(2*size + 4, 2*size + 4, 32, IB_rect, 0); - glReadPixels(x1+curarea->winrct.xmin, y1+curarea->winrct.ymin, x2-x1+1, y2-y1+1, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect); - glReadBuffer(GL_BACK); - - if(G.order==B_ENDIAN) { - IMB_convert_rgba_to_abgr(ibuf); - } - - rt= ibuf->rect; - size= (y2-y1)*(x2-x1); - if(size<=0) return 0; - - memset(indexar, 0, sizeof(int)*totface+2); /* plus 2! first element is total */ - - while(size--) { - - if(*rt) { - index= framebuffer_to_index(*rt); - if(index>0 && index<=totface) - indexar[index] = 1; - } - - rt++; - } - - for(a=1; a<=totface; a++) { - if(indexar[a]) indexar[tot++]= a; - } - - IMB_freeImBuf(ibuf); - - return tot; -} - -static int calc_vp_alpha_dl(VPaint *vp, float vpimat[][3], float *vert_nor, short *mval) -{ - float fac, dx, dy; - int alpha; - short vertco[2]; - - if(vp->flag & VP_SOFT) { - project_short_noclip(vert_nor, vertco); - dx= mval[0]-vertco[0]; - dy= mval[1]-vertco[1]; - - fac= sqrt(dx*dx + dy*dy); - if(fac > vp->size) return 0; - if(vp->flag & VP_HARD) - alpha= 255; - else - alpha= 255.0*vp->a*(1.0-fac/vp->size); - } - else { - alpha= 255.0*vp->a; - } - - if(vp->flag & VP_NORMALS) { - float *no= vert_nor+3; - - /* transpose ! */ - fac= vpimat[2][0]*no[0]+vpimat[2][1]*no[1]+vpimat[2][2]*no[2]; - if(fac>0.0) { - dx= vpimat[0][0]*no[0]+vpimat[0][1]*no[1]+vpimat[0][2]*no[2]; - dy= vpimat[1][0]*no[0]+vpimat[1][1]*no[1]+vpimat[1][2]*no[2]; - - alpha*= fac/sqrt(dx*dx + dy*dy + fac*fac); - } - else return 0; - } - - return alpha; -} - -static void wpaint_blend(MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval) -{ - - if(dw==NULL || uw==NULL) return; - - if(Gwp.mode==VP_MIX || Gwp.mode==VP_BLUR) - dw->weight = paintval*alpha + dw->weight*(1.0-alpha); - else if(Gwp.mode==VP_ADD) - dw->weight += paintval*alpha; - else if(Gwp.mode==VP_SUB) - dw->weight -= paintval*alpha; - else if(Gwp.mode==VP_MUL) - /* first mul, then blend the fac */ - dw->weight = ((1.0-alpha) + alpha*paintval)*dw->weight; - else if(Gwp.mode==VP_LIGHTEN) { - if (dw->weight < paintval) - dw->weight = paintval*alpha + dw->weight*(1.0-alpha); - } else if(Gwp.mode==VP_DARKEN) { - if (dw->weight > paintval) - dw->weight = paintval*alpha + dw->weight*(1.0-alpha); - } - CLAMP(dw->weight, 0.0f, 1.0f); - - /* if no spray, clip result with orig weight & orig alpha */ - if((Gwp.flag & VP_SPRAY)==0) { - float testw=0.0f; - - alpha= Gwp.a; - if(Gwp.mode==VP_MIX || Gwp.mode==VP_BLUR) - testw = paintval*alpha + uw->weight*(1.0-alpha); - else if(Gwp.mode==VP_ADD) - testw = uw->weight + paintval*alpha; - else if(Gwp.mode==VP_SUB) - testw = uw->weight - paintval*alpha; - else if(Gwp.mode==VP_MUL) - /* first mul, then blend the fac */ - testw = ((1.0-alpha) + alpha*paintval)*uw->weight; - else if(Gwp.mode==VP_LIGHTEN) { - if (uw->weight < paintval) - testw = paintval*alpha + uw->weight*(1.0-alpha); - else - testw = uw->weight; - } else if(Gwp.mode==VP_DARKEN) { - if (uw->weight > paintval) - testw = paintval*alpha + uw->weight*(1.0-alpha); - else - testw = uw->weight; - } - CLAMP(testw, 0.0f, 1.0f); - - if( testwweight ) { - if(dw->weight < testw) dw->weight= testw; - else if(dw->weight > uw->weight) dw->weight= uw->weight; - } - else { - if(dw->weight > testw) dw->weight= testw; - else if(dw->weight < uw->weight) dw->weight= uw->weight; - } - } - -} - -/* ----------------------------------------------------- */ - -/* used for 3d view, on active object, assumes me->dvert exists */ -/* if mode==1: */ -/* samples cursor location, and gives menu with vertex groups to activate */ -/* else */ -/* sets editbutvweight to the closest weight value to vertex */ -/* note: we cant sample frontbuf, weight colors are interpolated too unpredictable */ -static void sample_wpaint(int mode) -{ - Object *ob= OBACT; - Mesh *me= get_mesh(ob); - int index; - short mval[2], sco[2]; - - if (!me) return; - - getmouseco_areawin(mval); - index= sample_backbuf(mval[0], mval[1]); - - if(index && index<=me->totface) { - MFace *mface; - - mface= ((MFace *)me->mface) + index-1; - - if(mode==1) { /* sampe which groups are in here */ - MDeformVert *dv; - int a, totgroup; - - totgroup= BLI_countlist(&ob->defbase); - if(totgroup) { - int totmenu=0; - int *groups=MEM_callocN(totgroup*sizeof(int), "groups"); - - dv= me->dvert+mface->v1; - for(a=0; atotweight; a++) { - if (dv->dw[a].def_nrdw[a].def_nr]= 1; - } - dv= me->dvert+mface->v2; - for(a=0; atotweight; a++) { - if (dv->dw[a].def_nrdw[a].def_nr]= 1; - } - dv= me->dvert+mface->v3; - for(a=0; atotweight; a++) { - if (dv->dw[a].def_nrdw[a].def_nr]= 1; - } - if(mface->v4) { - dv= me->dvert+mface->v4; - for(a=0; atotweight; a++) { - if (dv->dw[a].def_nrdw[a].def_nr]= 1; - } - } - for(a=0; adefbase.first; dg && anext) { - if(groups[a]) { - sprintf(item, "|%s %%x%d", dg->name, a); - strcat(str, item); - } - } - - val= pupmenu(str); - if(val>=0) { - ob->actdef= val+1; - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWOOPS, 0); - allqueue(REDRAWBUTSEDIT, 0); - } - MEM_freeN(str); - } - MEM_freeN(groups); - } - else notice("No Vertex Groups in Object"); - } - else { - DerivedMesh *dm; - MDeformWeight *dw; - extern float editbutvweight; - float w1, w2, w3, w4, co[3], fac; - - dm = mesh_get_derived_final(ob, CD_MASK_BAREMESH); - if(dm->getVertCo==NULL) { - notice("Not supported yet"); - } - else { - /* calc 3 or 4 corner weights */ - dm->getVertCo(dm, mface->v1, co); - project_short_noclip(co, sco); - w1= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); - - dm->getVertCo(dm, mface->v2, co); - project_short_noclip(co, sco); - w2= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); - - dm->getVertCo(dm, mface->v3, co); - project_short_noclip(co, sco); - w3= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); - - if(mface->v4) { - dm->getVertCo(dm, mface->v4, co); - project_short_noclip(co, sco); - w4= ((mval[0]-sco[0])*(mval[0]-sco[0]) + (mval[1]-sco[1])*(mval[1]-sco[1])); - } - else w4= 1.0e10; - - fac= MIN4(w1, w2, w3, w4); - if(w1==fac) { - dw= get_defweight(me->dvert+mface->v1, ob->actdef-1); - if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f; - } - else if(w2==fac) { - dw= get_defweight(me->dvert+mface->v2, ob->actdef-1); - if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f; - } - else if(w3==fac) { - dw= get_defweight(me->dvert+mface->v3, ob->actdef-1); - if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f; - } - else if(w4==fac) { - if(mface->v4) { - dw= get_defweight(me->dvert+mface->v4, ob->actdef-1); - if(dw) editbutvweight= dw->weight; else editbutvweight= 0.0f; - } - } - } - dm->release(dm); - } - - } - allqueue(REDRAWBUTSEDIT, 0); - -} - -static void do_weight_paint_vertex(Object *ob, int index, int alpha, float paintweight, int vgroup_mirror) -{ - Mesh *me= ob->data; - MDeformWeight *dw, *uw; - int vgroup= ob->actdef-1; - - if(Gwp.flag & VP_ONLYVGROUP) { - dw= get_defweight(me->dvert+index, vgroup); - uw= get_defweight(Gwp.wpaint_prev+index, vgroup); - } - else { - dw= verify_defweight(me->dvert+index, vgroup); - uw= verify_defweight(Gwp.wpaint_prev+index, vgroup); - } - if(dw==NULL || uw==NULL) - return; - - wpaint_blend(dw, uw, (float)alpha/255.0, paintweight); - - if(Gwp.flag & VP_MIRROR_X) { /* x mirror painting */ - int j= mesh_get_x_mirror_vert(ob, index); - if(j>=0) { - /* copy, not paint again */ - if(vgroup_mirror != -1) - uw= verify_defweight(me->dvert+j, vgroup_mirror); - else - uw= verify_defweight(me->dvert+j, vgroup); - - uw->weight= dw->weight; - } - } -} - -void weight_paint(void) -{ - extern float editbutvweight; - Object *ob; - Mesh *me; - MFace *mface; - float mat[4][4], imat[4][4], paintweight, *vertexcosnos; - float vpimat[3][3]; - int *indexar, index, totindex, alpha, totw; - int vgroup_mirror= -1; - short mval[2], mvalo[2], firsttime=1; - - if((G.f & G_WEIGHTPAINT)==0) return; - if(G.obedit) return; - if(multires_level1_test()) return; - - ob= OBACT; - if(!ob || ob->id.lib) return; - - me= get_mesh(ob); - if(me==NULL || me->totface==0) return; - - /* if nothing was added yet, we make dverts and a vertex deform group */ - if (!me->dvert) - create_dverts(&me->id); - - if(G.qual & LR_CTRLKEY) { - sample_wpaint(0); - return; - } - if(G.qual & LR_SHIFTKEY) { - sample_wpaint(1); - return; - } - - /* ALLOCATIONS! no return after this line */ - /* painting on subsurfs should give correct points too, this returns me->totvert amount */ - vertexcosnos= mesh_get_mapped_verts_nors(ob); - indexar= get_indexarray(); - copy_wpaint_prev(&Gwp, me->dvert, me->totvert); - - /* this happens on a Bone select, when no vgroup existed yet */ - if(ob->actdef<=0) { - Object *modob; - if((modob = modifiers_isDeformedByArmature(ob))) { - bPoseChannel *pchan; - for(pchan= modob->pose->chanbase.first; pchan; pchan= pchan->next) - if(pchan->bone->flag & SELECT) - break; - if(pchan) { - bDeformGroup *dg= get_named_vertexgroup(ob, pchan->name); - if(dg==NULL) - dg= add_defgroup_name(ob, pchan->name); /* sets actdef */ - else - ob->actdef= get_defgroup_num(ob, dg); - allqueue(REDRAWBUTSEDIT, 0); - } - } - } - if(ob->defbase.first==NULL) { - add_defgroup(ob); - allqueue(REDRAWBUTSEDIT, 0); - } - - if(ob->lay & G.vd->lay); else error("Active object is not in this layer"); - - persp(PERSP_VIEW); - /* imat for normals */ - Mat4MulMat4(mat, ob->obmat, G.vd->viewmat); - Mat4Invert(imat, mat); - Mat3CpyMat4(vpimat, imat); - - /* load projection matrix */ - mymultmatrix(ob->obmat); - mygetsingmatrix(mat); - myloadmatrix(G.vd->viewmat); - - getmouseco_areawin(mvalo); - - getmouseco_areawin(mval); - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - /* if mirror painting, find the other group */ - if(Gwp.flag & VP_MIRROR_X) { - bDeformGroup *defgroup= BLI_findlink(&ob->defbase, ob->actdef-1); - if(defgroup) { - bDeformGroup *curdef; - int actdef= 0; - char name[32]; - - BLI_strncpy(name, defgroup->name, 32); - bone_flip_name(name, 0); /* 0 = don't strip off number extensions */ - - for (curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++) - if (!strcmp(curdef->name, name)) - break; - if(curdef==NULL) { - int olddef= ob->actdef; /* tsk, add_defgroup sets the active defgroup */ - curdef= add_defgroup_name (ob, name); - ob->actdef= olddef; - } - - if(curdef && curdef!=defgroup) - vgroup_mirror= actdef; - } - } - - while (get_mbut() & L_MOUSE) { - getmouseco_areawin(mval); - - if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - firsttime= 0; - - /* which faces are involved */ - if(Gwp.flag & VP_AREA) { - totindex= sample_backbuf_area(&Gwp, indexar, me->totface, mval[0], mval[1], Gwp.size); - } - else { - indexar[0]= sample_backbuf(mval[0], mval[1]); - if(indexar[0]) totindex= 1; - else totindex= 0; - } - - MTC_Mat4SwapMat4(G.vd->persmat, mat); - - if(Gwp.flag & VP_COLINDEX) { - for(index=0; indextotface) { - - mface= ((MFace *)me->mface) + (indexar[index]-1); - - if(mface->mat_nr!=ob->actcol-1) { - indexar[index]= 0; - } - } - } - } - - if((G.f & G_FACESELECT) && me->mface) { - for(index=0; indextotface) { - - mface= ((MFace *)me->mface) + (indexar[index]-1); - - if((mface->flag & ME_FACE_SEL)==0) { - indexar[index]= 0; - } - } - } - } - - /* make sure each vertex gets treated only once */ - /* and calculate filter weight */ - totw= 0; - if(Gwp.mode==VP_BLUR) - paintweight= 0.0f; - else - paintweight= editbutvweight; - - for(index=0; indextotface) { - mface= me->mface + (indexar[index]-1); - - (me->dvert+mface->v1)->flag= 1; - (me->dvert+mface->v2)->flag= 1; - (me->dvert+mface->v3)->flag= 1; - if(mface->v4) (me->dvert+mface->v4)->flag= 1; - - if(Gwp.mode==VP_BLUR) { - MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight; - - if(Gwp.flag & VP_ONLYVGROUP) - dw_func= get_defweight; - - dw= dw_func(me->dvert+mface->v1, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v2, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v3, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - if(mface->v4) { - dw= dw_func(me->dvert+mface->v4, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - } - } - } - } - - if(Gwp.mode==VP_BLUR) - paintweight/= (float)totw; - - for(index=0; indextotface) { - mface= me->mface + (indexar[index]-1); - - if((me->dvert+mface->v1)->flag) { - alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v1, mval); - if(alpha) { - do_weight_paint_vertex(ob, mface->v1, alpha, paintweight, vgroup_mirror); - } - (me->dvert+mface->v1)->flag= 0; - } - - if((me->dvert+mface->v2)->flag) { - alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v2, mval); - if(alpha) { - do_weight_paint_vertex(ob, mface->v2, alpha, paintweight, vgroup_mirror); - } - (me->dvert+mface->v2)->flag= 0; - } - - if((me->dvert+mface->v3)->flag) { - alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v3, mval); - if(alpha) { - do_weight_paint_vertex(ob, mface->v3, alpha, paintweight, vgroup_mirror); - } - (me->dvert+mface->v3)->flag= 0; - } - - if((me->dvert+mface->v4)->flag) { - if(mface->v4) { - alpha= calc_vp_alpha_dl(&Gwp, vpimat, vertexcosnos+6*mface->v4, mval); - if(alpha) { - do_weight_paint_vertex(ob, mface->v4, alpha, paintweight, vgroup_mirror); - } - (me->dvert+mface->v4)->flag= 0; - } - } - } - } - - MTC_Mat4SwapMat4(G.vd->persmat, mat); - - } - else BIF_wait_for_statechange(); - - if(mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - scrarea_do_windraw(curarea); - - if(Gwp.flag & (VP_AREA|VP_SOFT)) { - /* draw circle in backbuf! */ - persp(PERSP_WIN); - fdrawXORcirc((float)mval[0], (float)mval[1], Gwp.size); - persp(PERSP_VIEW); - } - - screen_swapbuffers(); - backdrawview3d(0); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - } - - if(vertexcosnos) - MEM_freeN(vertexcosnos); - MEM_freeN(indexar); - copy_wpaint_prev(&Gwp, NULL, 0); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - /* this flag is event for softbody to refresh weightpaint values */ - if(ob->soft) ob->softflag |= OB_SB_REDO; - - BIF_undo_push("Weight Paint"); - allqueue(REDRAWVIEW3D, 0); -} - -void vertex_paint() -{ - Object *ob; - Mesh *me; - MFace *mface; - float mat[4][4], imat[4][4], *vertexcosnos; - float vpimat[3][3]; - unsigned int paintcol=0, *mcol, *mcolorig, fcol1, fcol2; - int *indexar, index, alpha, totindex; - short mval[2], mvalo[2], firsttime=1; - - if((G.f & G_VERTEXPAINT)==0) return; - if(G.obedit) return; - - ob= OBACT; - if(!ob || ob->id.lib) return; - - me= get_mesh(ob); - if(me==NULL || me->totface==0) return; - if(ob->lay & G.vd->lay); else error("Active object is not in this layer"); - - if(me->mcol==NULL) make_vertexcol(1); - - if(me->mcol==NULL) return; - - /* ALLOCATIONS! No return after his line */ - - /* painting on subsurfs should give correct points too, this returns me->totvert amount */ - vertexcosnos= mesh_get_mapped_verts_nors(ob); - indexar= get_indexarray(); - copy_vpaint_prev(&Gvp, (unsigned int *)me->mcol, me->totface); - - /* opengl/matrix stuff */ - persp(PERSP_VIEW); - /* imat for normals */ - Mat4MulMat4(mat, ob->obmat, G.vd->viewmat); - Mat4Invert(imat, mat); - Mat3CpyMat4(vpimat, imat); - - /* load projection matrix */ - mymultmatrix(ob->obmat); - mygetsingmatrix(mat); - myloadmatrix(G.vd->viewmat); - - paintcol= vpaint_get_current_col(&Gvp); - - getmouseco_areawin(mvalo); - - getmouseco_areawin(mval); - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - - while (get_mbut() & L_MOUSE) { - getmouseco_areawin(mval); - - if(firsttime || mval[0]!=mvalo[0] || mval[1]!=mvalo[1]) { - - firsttime= 0; - - /* which faces are involved */ - if(Gvp.flag & VP_AREA) { - totindex= sample_backbuf_area(&Gvp, indexar, me->totface, mval[0], mval[1], Gvp.size); - } - else { - indexar[0]= sample_backbuf(mval[0], mval[1]); - if(indexar[0]) totindex= 1; - else totindex= 0; - } - - MTC_Mat4SwapMat4(G.vd->persmat, mat); - - if(Gvp.flag & VP_COLINDEX) { - for(index=0; indextotface) { - - mface= ((MFace *)me->mface) + (indexar[index]-1); - - if(mface->mat_nr!=ob->actcol-1) { - indexar[index]= 0; - } - } - } - } - if((G.f & G_FACESELECT) && me->mface) { - for(index=0; indextotface) { - mface= ((MFace *)me->mface) + (indexar[index]-1); - - if((mface->flag & ME_FACE_SEL)==0) - indexar[index]= 0; - } - } - } - - for(index=0; indextotface) { - - mface= ((MFace *)me->mface) + (indexar[index]-1); - mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1); - mcolorig= ( (unsigned int *)Gvp.vpaint_prev) + 4*(indexar[index]-1); - - if(Gvp.mode==VP_BLUR) { - fcol1= mcol_blend( mcol[0], mcol[1], 128); - if(mface->v4) { - fcol2= mcol_blend( mcol[2], mcol[3], 128); - paintcol= mcol_blend( fcol1, fcol2, 128); - } - else { - paintcol= mcol_blend( mcol[2], fcol1, 170); - } - - } - - alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v1, mval); - if(alpha) vpaint_blend( mcol, mcolorig, paintcol, alpha); - - alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v2, mval); - if(alpha) vpaint_blend( mcol+1, mcolorig+1, paintcol, alpha); - - alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v3, mval); - if(alpha) vpaint_blend( mcol+2, mcolorig+2, paintcol, alpha); - - if(mface->v4) { - alpha= calc_vp_alpha_dl(&Gvp, vpimat, vertexcosnos+6*mface->v4, mval); - if(alpha) vpaint_blend( mcol+3, mcolorig+3, paintcol, alpha); - } - } - } - - MTC_Mat4SwapMat4(G.vd->persmat, mat); - - do_shared_vertexcol(me); - - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - scrarea_do_windraw(curarea); - - if(Gvp.flag & (VP_AREA|VP_SOFT)) { - /* draw circle in backbuf! */ - persp(PERSP_WIN); - fdrawXORcirc((float)mval[0], (float)mval[1], Gvp.size); - persp(PERSP_VIEW); - } - screen_swapbuffers(); - backdrawview3d(0); - - mvalo[0]= mval[0]; - mvalo[1]= mval[1]; - } - else BIF_wait_for_statechange(); - } - - if(vertexcosnos) - MEM_freeN(vertexcosnos); - MEM_freeN(indexar); - - /* frees prev buffer */ - copy_vpaint_prev(&Gvp, NULL, 0); - - BIF_undo_push("Vertex Paint"); - - allqueue(REDRAWVIEW3D, 0); -} - -void set_wpaint(void) /* toggle */ -{ - Object *ob; - Mesh *me; - - scrarea_queue_headredraw(curarea); - ob= OBACT; - if(!ob || ob->id.lib) return; - me= get_mesh(ob); - - if(me && me->totface>=MAXINDEX) { - error("Maximum number of faces: %d", MAXINDEX-1); - G.f &= ~G_WEIGHTPAINT; - return; - } - - if(G.f & G_WEIGHTPAINT) G.f &= ~G_WEIGHTPAINT; - else G.f |= G_WEIGHTPAINT; - - allqueue(REDRAWVIEW3D, 1); /* including header */ - allqueue(REDRAWBUTSEDIT, 0); - - /* Weightpaint works by overriding colors in mesh, - * so need to make sure we recalc on enter and - * exit (exit needs doing regardless because we - * should redeform). - */ - if (me) { - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_DATA); - } - - if(G.f & G_WEIGHTPAINT) { - Object *par; - - setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT); - - mesh_octree_table(ob, NULL, 's'); - - /* verify if active weight group is also active bone */ - par= modifiers_isDeformedByArmature(ob); - if(par && (par->flag & OB_POSEMODE)) { - bPoseChannel *pchan; - for(pchan= par->pose->chanbase.first; pchan; pchan= pchan->next) - if(pchan->bone->flag & BONE_ACTIVE) - break; - if(pchan) - vertexgroup_select_by_name(ob, pchan->name); - } - } - else { - if(!(G.f & G_FACESELECT)) - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - - mesh_octree_table(ob, NULL, 'e'); - } -} - - -void set_vpaint(void) /* toggle */ -{ - Object *ob; - Mesh *me; - - scrarea_queue_headredraw(curarea); - ob= OBACT; - if(!ob || object_data_is_libdata(ob)) { - G.f &= ~G_VERTEXPAINT; - return; - } - - me= get_mesh(ob); - - if(me && me->totface>=MAXINDEX) { - error("Maximum number of faces: %d", MAXINDEX-1); - G.f &= ~G_VERTEXPAINT; - return; - } - - if(me && me->mcol==NULL) make_vertexcol(1); - - if(G.f & G_VERTEXPAINT){ - G.f &= ~G_VERTEXPAINT; - } - else { - G.f |= G_VERTEXPAINT; - /* Turn off weight painting */ - if (G.f & G_WEIGHTPAINT) - set_wpaint(); - } - - allqueue(REDRAWVIEW3D, 1); /* including header */ - allqueue(REDRAWBUTSEDIT, 0); - - if (me) - /* update modifier stack for mapping requirements */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if(G.f & G_VERTEXPAINT) { - setcursor_space(SPACE_VIEW3D, CURSOR_VPAINT); - } - else { - if((G.f & G_FACESELECT)==0) setcursor_space(SPACE_VIEW3D, CURSOR_STD); - } -} - diff --git a/source/blender/src/winlay.h b/source/blender/src/winlay.h deleted file mode 100644 index 2fdc2c70ac3..00000000000 --- a/source/blender/src/winlay.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -/* Abstract window operations */ - -struct BCursor; - -typedef struct _Window Window; -typedef void (*WindowHandlerFP) (Window *win, void *user_data, short evt, short val, char ascii); - -Window* window_open (char *title, int x, int y, int width, int height, int start_maximized); -void window_set_handler (Window *win, WindowHandlerFP handler, void *user_data); -void window_destroy (Window *win); - -void window_set_timer (Window *win, int delay_ms, int event); - -void window_make_active (Window *win); -void window_swap_buffers (Window *win); - -#if 0 -//#ifdef _WIN32 // FULLSCREEN -void window_toggle_fullscreen(Window *win, int fullscreen); -#endif - -void window_raise (Window *win); -void window_lower (Window *win); - -short window_get_qual (Window *win); -short window_get_mbut (Window *win); -void window_get_mouse (Window *win, short *mval); - -float window_get_pressure(Window *win); -void window_get_tilt(Window *win, float *xtilt, float *ytilt); -short window_get_activedevice(Window *win); - -void window_get_position (Window *win, int *posx_r, int *poxy_r); - -void window_get_size (Window *win, int *width_r, int *height_r); -void window_set_size (Window *win, int width, int height); - -char* window_get_title (Window *win); -void window_set_title (Window *win, char *title); - -void window_set_cursor (Window *win, int cursor); -void window_set_custom_cursor (Window *win, unsigned char mask[16][2], - unsigned char bitmap[16][2], int hotx, int hoty ); -void window_set_custom_cursor_ex (Window *win, struct BCursor *cursor, int useBig); - -void window_warp_pointer (Window *win, int x, int y); - -void window_queue_redraw (Window *win); - - /* Global windowing operations */ - -Window* winlay_get_active_window(void); - -void winlay_process_events (int wait_for_event); - -void winlay_get_screensize (int *width_r, int *height_r); diff --git a/source/blender/src/writeavicodec.c b/source/blender/src/writeavicodec.c deleted file mode 100644 index 6ee42d7807a..00000000000 --- a/source/blender/src/writeavicodec.c +++ /dev/null @@ -1,835 +0,0 @@ -/** - * Functions for writing windows avi-format files. - * - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined(_WIN32) && !defined(FREE_WINDOWS) - -#define INC_OLE2 -#include -#undef rad1 -#undef rad2 - -#include -#include -#include -#include - -#include - -#include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" -#include "DNA_userdef_types.h" -#include "DNA_scene_types.h" - -#include "BKE_global.h" -#include "BKE_scene.h" -#include "BKE_writeavi.h" - -#include "BIF_toolbox.h" - -// this defines the compression type for -// the output video stream - -AVICOMPRESSOPTIONS opts; - -static int sframe; -static PAVIFILE pfile = NULL; -static int avifileinitdone = 0; -static PAVISTREAM psUncompressed = NULL, psCompressed = NULL; - -// function definitions -static void init_bmi(BITMAPINFOHEADER *bmi,int rectx, int recty ); -static void opts_to_acd(AviCodecData *acd); -static void acd_to_opts(AviCodecData *acd); -static void free_opts_data(); -static int open_avi_codec_file(char * name,RenderData *rd,int rectx, int recty ); - -/////////////////////////////////////////////////////////////////////////// -// -// silly default parameters -// -/////////////////////////////////////////////////////////////////////////// - -#define DEFAULT_WIDTH 240 -#define DEFAULT_HEIGHT 120 -#define DEFAULT_LENGTH 100 -#define DEFAULT_SIZE 6 -#define DEFAULT_COLOR RGB(255,0,0) -#define XSPEED 7 -#define YSPEED 5 - -/////////////////////////////////////////////////////////////////////////// -// -// useful macros -// -/////////////////////////////////////////////////////////////////////////// - -#define ALIGNULONG(i) ((i+3)&(~3)) /* ULONG aligned ! */ -#define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */ -#define DIBWIDTHBYTES(bi) (int)WIDTHBYTES((int)(bi).biWidth * (int)(bi).biBitCount) -#define DIBPTR(lpbi) ((LPBYTE)(lpbi) + \ - (int)(lpbi)->biSize + \ - (int)(lpbi)->biClrUsed * sizeof(RGBQUAD) ) - -/////////////////////////////////////////////////////////////////////////// -// -// custom video stream instance structure -// -/////////////////////////////////////////////////////////////////////////// - -typedef struct { - - // - // The Vtbl must come first - // - IAVIStreamVtbl * lpvtbl; - - // - // private ball instance data - // - ULONG ulRefCount; - - DWORD fccType; // is this audio/video - - int width; // size in pixels of each frame - int height; - int length; // length in frames of the pretend AVI movie - int size; - COLORREF color; // ball color - -} AVIBALL, * PAVIBALL; - -/////////////////////////////////////////////////////////////////////////// -// -// custom stream methods -// -/////////////////////////////////////////////////////////////////////////// - -HRESULT STDMETHODCALLTYPE AVIBallQueryInterface(PAVISTREAM ps, REFIID riid, LPVOID * ppvObj); -HRESULT STDMETHODCALLTYPE AVIBallCreate (PAVISTREAM ps, LONG lParam1, LONG lParam2); -ULONG STDMETHODCALLTYPE AVIBallAddRef (PAVISTREAM ps); -ULONG STDMETHODCALLTYPE AVIBallRelease (PAVISTREAM ps); -HRESULT STDMETHODCALLTYPE AVIBallInfo (PAVISTREAM ps, AVISTREAMINFOW * psi, LONG lSize); -LONG STDMETHODCALLTYPE AVIBallFindSample (PAVISTREAM ps, LONG lPos, LONG lFlags); -HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG *lpcbFormat); -HRESULT STDMETHODCALLTYPE AVIBallSetFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG cbFormat); -HRESULT STDMETHODCALLTYPE AVIBallRead (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, LONG * plBytes,LONG * plSamples); -HRESULT STDMETHODCALLTYPE AVIBallWrite (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten); -HRESULT STDMETHODCALLTYPE AVIBallDelete (PAVISTREAM ps, LONG lStart, LONG lSamples); -HRESULT STDMETHODCALLTYPE AVIBallReadData (PAVISTREAM ps, DWORD fcc, LPVOID lp,LONG *lpcb); -HRESULT STDMETHODCALLTYPE AVIBallWriteData (PAVISTREAM ps, DWORD fcc, LPVOID lp,LONG cb); - -IAVIStreamVtbl AVIBallHandler = { - AVIBallQueryInterface, - AVIBallAddRef, - AVIBallRelease, - AVIBallCreate, - AVIBallInfo, - AVIBallFindSample, - AVIBallReadFormat, - AVIBallSetFormat, - AVIBallRead, - AVIBallWrite, - AVIBallDelete, - AVIBallReadData, - AVIBallWriteData -}; - - -// -// This is the function an application would call to create a PAVISTREAM to -// reference the ball. Then the standard AVIStream function calls can be -// used to work with this stream. -// -PAVISTREAM WINAPI NewBall(void) -{ - static AVIBALL ball; - PAVIBALL pball = &ball; - - // - // Fill the function table - // - pball->lpvtbl = &AVIBallHandler; - - // - // Call our own create code to create a new instance (calls AVIBallCreate) - // For now, don't use any lParams. - // - pball->lpvtbl->Create((PAVISTREAM) pball, 0, 0); - - return (PAVISTREAM) pball; -} - -/////////////////////////////////////////////////////////////////////////// -// -// This function is called to initialize an instance of the bouncing ball. -// -// When called, we look at the information possibly passed in , -// if any, and use it to determine the length of movie they want. (Not -// supported by NewBall right now, but it could be). -// -/////////////////////////////////////////////////////////////////////////// -HRESULT STDMETHODCALLTYPE AVIBallCreate(PAVISTREAM ps, LONG lParam1, LONG lParam2) -{ - PAVIBALL pball = (PAVIBALL) ps; - - // - // what type of data are we? (audio/video/other stream) - // - pball->fccType = streamtypeVIDEO; - - // - // We define lParam1 as being the length of movie they want us to pretend - // to be. - // - if (lParam1) - pball->length = (int) lParam1; - else - pball->length = DEFAULT_LENGTH; - - switch (pball->fccType) { - - case streamtypeVIDEO: - pball->color = DEFAULT_COLOR; - pball->width = DEFAULT_WIDTH; - pball->height = DEFAULT_HEIGHT; - pball->size = DEFAULT_SIZE; - pball->ulRefCount = 1; // note that we are opened once - return AVIERR_OK; // success - - case streamtypeAUDIO: - return ResultFromScode(AVIERR_UNSUPPORTED); // we don't do audio - - default: - return ResultFromScode(AVIERR_UNSUPPORTED); // or anything else - } -} - - -// -// Increment our reference count -// -ULONG STDMETHODCALLTYPE AVIBallAddRef(PAVISTREAM ps) -{ - PAVIBALL pball = (PAVIBALL) ps; - return (++pball->ulRefCount); -} - - -// -// Decrement our reference count -// -ULONG STDMETHODCALLTYPE AVIBallRelease(PAVISTREAM ps) -{ - PAVIBALL pball = (PAVIBALL) ps; - if (--pball->ulRefCount) - return pball->ulRefCount; - - // Free any data we're keeping around - like our private structure - GlobalFreePtr(pball); - - return 0; -} - - -// -// Fills an AVISTREAMINFO structure -// -HRESULT STDMETHODCALLTYPE AVIBallInfo(PAVISTREAM ps, AVISTREAMINFOW * psi, LONG lSize) -{ - PAVIBALL pball = (PAVIBALL) ps; - - if (lSize < sizeof(AVISTREAMINFO)) - return ResultFromScode(AVIERR_BUFFERTOOSMALL); - - _fmemset(psi, 0, (int)lSize); - - // Fill out a stream header with information about us. - psi->fccType = pball->fccType; - psi->fccHandler = mmioFOURCC('B','a','l','l'); - psi->dwScale = 1; - psi->dwRate = 15; - psi->dwLength = pball->length; - psi->dwSuggestedBufferSize = pball->height * ALIGNULONG(pball->width); - psi->rcFrame.right = pball->width; - psi->rcFrame.bottom = pball->height; - CopyMemory((PVOID)psi->szName, - (PVOID)L"Bouncing ball video", - sizeof(L"Bouncing ball video")); - - return AVIERR_OK; -} - -/////////////////////////////////////////////////////////////////////////// -// -// AVIBallReadFormat: needs to return the format of our data. -// -/////////////////////////////////////////////////////////////////////////// -HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos,LPVOID lpFormat,LONG *lpcbFormat) -{ - PAVIBALL pball = (PAVIBALL) ps; - LPBITMAPINFO lpbi = (LPBITMAPINFO) lpFormat; - - if (lpFormat == NULL || *lpcbFormat == 0) { - *lpcbFormat = sizeof(BITMAPINFOHEADER); - return AVIERR_OK; - } - - if (*lpcbFormat < sizeof(BITMAPINFOHEADER)) - return ResultFromScode(AVIERR_BUFFERTOOSMALL); - - // This is a relatively silly example: we build up our - // format from scratch every time. - - /* - lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - lpbi->bmiHeader.biCompression = BI_RGB; - lpbi->bmiHeader.biWidth = pball->width; - lpbi->bmiHeader.biHeight = pball->height; - lpbi->bmiHeader.biBitCount = 8; - lpbi->bmiHeader.biPlanes = 1; - lpbi->bmiHeader.biClrUsed = 2; - lpbi->bmiHeader.biSizeImage = pball->height * DIBWIDTHBYTES(lpbi->bmiHeader); - */ - - //init_bmi(&lpbi->bmiHeader); - - memset(&lpbi->bmiHeader, 0, sizeof(BITMAPINFOHEADER)); - lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - lpbi->bmiHeader.biWidth = pball->width; - lpbi->bmiHeader.biHeight = pball->height; - lpbi->bmiHeader.biPlanes = 1; - lpbi->bmiHeader.biBitCount = 24; - lpbi->bmiHeader.biSizeImage = pball->width * pball->height * sizeof(RGBTRIPLE); - - /* - lpbi->bmiColors[0].rgbRed = 0; - lpbi->bmiColors[0].rgbGreen = 0; - lpbi->bmiColors[0].rgbBlue = 0; - lpbi->bmiColors[1].rgbRed = GetRValue(pball->color); - lpbi->bmiColors[1].rgbGreen = GetGValue(pball->color); - lpbi->bmiColors[1].rgbBlue = GetBValue(pball->color); - */ - - *lpcbFormat = sizeof(BITMAPINFOHEADER); - - return AVIERR_OK; -} - -/////////////////////////////////////////////////////////////////////////// -// -// AVIBallRead: needs to return the data for a particular frame. -// -/////////////////////////////////////////////////////////////////////////// -HRESULT STDMETHODCALLTYPE AVIBallRead (PAVISTREAM ps, LONG lStart,LONG lSamples,LPVOID lpBuffer,LONG cbBuffer,LONG * plBytes,LONG * plSamples) -{ - PAVIBALL pball = (PAVIBALL) ps; - LONG lSize = pball->height * ALIGNULONG(pball->width); // size of frame - // in bytes - int x, y; - HPSTR hp = lpBuffer; - int xPos, yPos; - - // Reject out of range values - if (lStart < 0 || lStart >= pball->length) - return ResultFromScode(AVIERR_BADPARAM); - - // Did they just want to know the size of our data? - if (lpBuffer == NULL || cbBuffer == 0) - goto exit; - - // Will our frame fit in the buffer passed? - if (lSize > cbBuffer) - return ResultFromScode(AVIERR_BUFFERTOOSMALL); - - // Figure out the position of the ball. - // It just bounces back and forth. - - xPos = 5 + XSPEED * (int) lStart; // x = x0 + vt - xPos = xPos % ((pball->width - pball->size) * 2); // limit to 2xwidth - if (xPos > (pball->width - pball->size)) // reflect if - xPos = 2 * (pball->width - pball->size) - xPos; // needed - - yPos = 5 + YSPEED * (int) lStart; - yPos = yPos % ((pball->height - pball->size) * 2); - if (yPos > (pball->height - pball->size)) - yPos = 2 * (pball->height - pball->size) - yPos; - - // - // Build a DIB from scratch by writing in 1's where the ball is, 0's - // where it isn't. - // - // Notice that we just build it in the buffer we've been passed. - // - // This is pretty ugly, I have to admit. - // - for (y = 0; y < pball->height; y++) - { - if (y >= yPos && y < yPos + pball->size) - { - for (x = 0; x < pball->width; x++) - { - *hp++ = (BYTE) ((x >= xPos && x < xPos + pball->size) ? 1 : 0); - } - } - else - { - for (x = 0; x < pball->width; x++) - { - *hp++ = 0; - } - } - - hp += pball->width - ALIGNULONG(pball->width); - } - -exit: - // We always return exactly one frame - if (plSamples) - *plSamples = 1; - - // Return the size of our frame - if (plBytes) - *plBytes = lSize; - - return AVIERR_OK; -} - - -HRESULT STDMETHODCALLTYPE AVIBallQueryInterface(PAVISTREAM ps, REFIID riid, LPVOID * ppvObj) -{ - PAVIBALL pball = (PAVIBALL) ps; - - // We support the Unknown interface (everybody does) and our Stream - // interface. - - if (_fmemcmp(riid, &IID_IUnknown, sizeof(GUID)) == 0) - *ppvObj = (LPVOID)pball; - - else if (_fmemcmp(riid, &IID_IAVIStream, sizeof(GUID)) == 0) - *ppvObj = (LPVOID)pball; - - else { - *ppvObj = NULL; - return ResultFromScode(E_NOINTERFACE); - } - - AVIBallAddRef(ps); - - return AVIERR_OK; -} - -LONG STDMETHODCALLTYPE AVIBallFindSample (PAVISTREAM ps, LONG lPos, LONG lFlags) -{ - // The only format change is frame 0 - if ((lFlags & FIND_TYPE) == FIND_FORMAT) { - if ((lFlags & FIND_DIR) == FIND_NEXT && lPos > 0) - return -1; // no more format changes - else - return 0; - - // FIND_KEY and FIND_ANY always return the same position because - // every frame is non-empty and a key frame - } else - return lPos; -} - -HRESULT STDMETHODCALLTYPE AVIBallReadData (PAVISTREAM ps, DWORD fcc, LPVOID lp, LONG *lpcb) -{ - return ResultFromScode(AVIERR_UNSUPPORTED); -} - -HRESULT STDMETHODCALLTYPE AVIBallSetFormat (PAVISTREAM ps, LONG lPos, LPVOID lpFormat, LONG cbFormat) -{ - return ResultFromScode(AVIERR_UNSUPPORTED); -} - -HRESULT STDMETHODCALLTYPE AVIBallWriteData (PAVISTREAM ps, DWORD fcc, LPVOID lp, LONG cb) -{ - return ResultFromScode(AVIERR_UNSUPPORTED); -} - -HRESULT STDMETHODCALLTYPE AVIBallWrite (PAVISTREAM ps, LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten) -{ - return ResultFromScode(AVIERR_UNSUPPORTED); -} - -HRESULT STDMETHODCALLTYPE AVIBallDelete (PAVISTREAM ps, LONG lStart, LONG lSamples) -{ - return ResultFromScode(AVIERR_UNSUPPORTED); -} - - -////////////////////////////////////// -static void init_bmi(BITMAPINFOHEADER *bmi,int rectx, int recty ) -{ - memset(bmi, 0, sizeof(BITMAPINFOHEADER)); - bmi->biSize = sizeof(BITMAPINFOHEADER); - bmi->biWidth = rectx; - bmi->biHeight = recty; - bmi->biPlanes = 1; - bmi->biBitCount = 24; - bmi->biSizeImage = bmi->biWidth * bmi->biHeight * sizeof(RGBTRIPLE); -} - - -static void opts_to_acd(AviCodecData *acd) -{ - HIC hic; - ICINFO icinfo; - - acd->fccType = opts.fccType; - acd->fccHandler = opts.fccHandler; - acd->dwKeyFrameEvery = opts.dwKeyFrameEvery; - acd->dwQuality = opts.dwQuality; - acd->dwBytesPerSecond = opts.dwBytesPerSecond; - acd->dwFlags = opts.dwFlags; - acd->dwInterleaveEvery = opts.dwInterleaveEvery; - acd->cbFormat = opts.cbFormat; - acd->cbParms = opts.cbParms; - - if (opts.lpFormat && opts.cbFormat) { - acd->lpFormat = MEM_mallocN(opts.cbFormat, "avi.lpFormat"); - memcpy(acd->lpFormat, opts.lpFormat, opts.cbFormat); - } - - if (opts.lpParms && opts.cbParms) { - acd->lpParms = MEM_mallocN(opts.cbParms, "avi.lpParms"); - memcpy(acd->lpParms, opts.lpParms, opts.cbParms); - } - - if ((hic=ICOpen(ICTYPE_VIDEO,acd->fccHandler,ICMODE_QUERY))!=NULL) { - icinfo.dwSize=sizeof(ICINFO); - if (ICGetInfo(hic,&icinfo,sizeof(ICINFO))) { - WideCharToMultiByte(CP_ACP,0,icinfo.szDescription,-1,acd->avicodecname,128,NULL,NULL); - } else - sprintf(acd->avicodecname, "undefined"); - if (ICClose(hic)!=ICERR_OK) -;// return 0; - } else { - sprintf(acd->avicodecname, "Full Frames (Uncompressed)"); //heh, nasty - } -} - - -static void acd_to_opts(AviCodecData *acd) -{ - memset(&opts, 0, sizeof(opts)); - if (acd) { - opts.fccType = acd->fccType; - opts.fccHandler = acd->fccHandler; - opts.dwKeyFrameEvery = acd->dwKeyFrameEvery; - opts.dwQuality = acd->dwQuality; - opts.dwBytesPerSecond = acd->dwBytesPerSecond; - opts.dwFlags = acd->dwFlags; - opts.dwInterleaveEvery = acd->dwInterleaveEvery; - opts.cbFormat = acd->cbFormat; - opts.cbParms = acd->cbParms; - - if (acd->lpFormat && acd->cbFormat) { - opts.lpFormat = MEM_mallocN(opts.cbFormat, "opts lpFormat"); - memcpy(opts.lpFormat, acd->lpFormat, opts.cbFormat); - } - - if (acd->lpParms && acd->cbParms) { - opts.lpParms = MEM_mallocN(opts.cbParms, "opts.cbParms"); - memcpy(opts.lpParms, acd->lpParms, opts.cbParms); - } - } -} - -static void free_opts_data() -{ - if (opts.lpFormat) { - MEM_freeN(opts.lpFormat); - opts.lpFormat = NULL; - } - if (opts.lpParms) { - MEM_freeN(opts.lpParms); - opts.lpParms = NULL; - } -} - -static int open_avi_codec_file(char * name,RenderData *rd,int rectx, int recty ) -{ - HRESULT hr; - WORD wVer; - BITMAPINFOHEADER bmi; - AVISTREAMINFO strhdr; - int ret_val = 0; - - wVer = HIWORD(VideoForWindowsVersion()); - if (wVer < 0x010a){ - // this is probably an obsolete check... - ret_val = 1; - } else { - AVIFileInit(); - avifileinitdone++; - - hr = AVIFileOpen(&pfile, // returned file pointer - name, // file name - OF_WRITE | OF_CREATE, // mode to open file with - NULL); // use handler determined - - if (hr != AVIERR_OK) { - ret_val = 1; - } else { - // initialize the BITMAPINFOHEADER - init_bmi(&bmi,rectx,recty); - // and associate a stream with the input images - memset(&strhdr, 0, sizeof(strhdr)); - strhdr.fccType = streamtypeVIDEO; // stream type - if (G.scene->r.avicodecdata) { - strhdr.fccHandler = G.scene->r.avicodecdata->fccHandler; - } - strhdr.dwScale = 1; - strhdr.dwRate = rd->frs_sec; - strhdr.dwSuggestedBufferSize = bmi.biSizeImage; - SetRect(&strhdr.rcFrame, 0, 0, // rectangle for stream - (int) bmi.biWidth, - (int) bmi.biHeight); - - // And create the stream - hr = AVIFileCreateStream( - pfile, // file pointer - &psUncompressed,// returned stream pointer - &strhdr); // stream header - - if (hr != AVIERR_OK) { - ret_val = 1; - } else { - acd_to_opts(G.scene->r.avicodecdata); - } - } - } - - return(ret_val); -} - - -void end_avi_codec(void) -{ - free_opts_data(); - - if (psUncompressed) { - AVIStreamClose(psUncompressed); - psUncompressed = NULL; - } - - if (psCompressed) { - AVIStreamClose(psCompressed); - psCompressed = NULL; - } - - if (pfile) { - AVIFileClose(pfile); - pfile = NULL; - } - - if (avifileinitdone > 0) { - AVIFileExit(); - avifileinitdone--; - } -} - - -void start_avi_codec(RenderData *rd,int rectx, int recty ) -{ - HRESULT hr; - BITMAPINFOHEADER bmi; - char name[2048]; - char bakname[2048]; - - makeavistring(rd,name); - sframe = (G.scene->r.sfra); - - strcpy(bakname, name); - strcat(bakname, ".bak"); - - if (BLI_exists(name)) { - BLI_move(name, bakname); - } - - // initialize the BITMAPINFOHEADER - init_bmi(&bmi,rectx,recty); - - if (open_avi_codec_file(name,rd,rectx,recty)) { - error("Can not open file %s", name); - G.afbreek = 1; - } else { - // now create a compressed stream from the uncompressed - // stream and the compression options - hr = AVIMakeCompressedStream( - &psCompressed, // returned stream pointer - psUncompressed, // uncompressed stream - &opts, // compression options - NULL); // Unknown... - if (hr != AVIERR_OK) { - error("Codec is locked or not supported."); - G.afbreek = 1; - } else { - hr = AVIStreamSetFormat(psCompressed, 0, - &bmi, // stream format - bmi.biSize + // format size - bmi.biClrUsed * sizeof(RGBQUAD)); // plus size of colormap - if (hr != AVIERR_OK) { - printf("AVIStreamSetFormat() failed .. may be bad image dimensions? \n"); - error("Codec refuses format."); - G.afbreek = 1; - } - } - } - - if (G.afbreek != 1) { - printf("Created win avi: %s\n", name); - if (BLI_exists(bakname)) { - BLI_delete(bakname, 0, 0); - } - } else { - // close the darn thing and remove it. - end_avi_codec(); - if (BLI_exists(name)) { - BLI_delete(name, 0, 0); - } - if (BLI_exists(bakname)) { - BLI_move(bakname, name); - } - } -} - - -void append_avi_codec(int frame,int *pixels,int rectx, int recty) -{ - HRESULT hr; - BITMAPINFOHEADER bmi; - RGBTRIPLE *buffer, *to; - int x, y ,pad, align =2; - unsigned char *from; - - if (psCompressed) { - // initialize the BITMAPINFOHEADER - init_bmi(&bmi, rectx, recty); - - //windows wants bitmap rows aligned - pad = (rectx*3) - align*((rectx*3)/align); - if (pad) { - pad = align - pad; - } - - // copy pixels - buffer = MEM_mallocN(bmi.biSizeImage + pad * recty, "append_win_avi"); - to = buffer; - from = (unsigned char *) pixels; - for (y = recty; y > 0 ; y--) { - for (x = rectx; x > 0 ; x--) { - to->rgbtRed = from[0]; - to->rgbtGreen = from[1]; - to->rgbtBlue = from[2]; - to++; from += 4; - } - (unsigned char *)to += pad; - } - - hr = AVIStreamWrite( - psCompressed, // stream pointer - frame - sframe, // frame number - 1, // number to write - (LPBYTE) buffer,// pointer to data - bmi.biSizeImage + pad * recty, // size of this frame - AVIIF_KEYFRAME, // flags.... - NULL, - NULL); - - MEM_freeN(buffer); - - if (hr != AVIERR_OK) { - G.afbreek = 1; - } else { - printf ("added frame %3d (frame %3d in avi): ", frame, frame-sframe); - } - } -} - - -int get_avicodec_settings(void) -{ - int ret_val = 0; - AVICOMPRESSOPTIONS *aopts[1] = {&opts}; - AviCodecData *acd = G.scene->r.avicodecdata; - static PAVISTREAM psdummy; - UINT uiFlags; - - acd_to_opts(G.scene->r.avicodecdata); - - psdummy = NewBall(); - - if(U.uiflag & USER_ALLWINCODECS) - uiFlags = ICMF_CHOOSE_ALLCOMPRESSORS; - else - uiFlags = ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE; - - if (psdummy == NULL) { - ret_val = 1; - } else { - if (!AVISaveOptions(NULL, - uiFlags, -// ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE, -// ICMF_CHOOSE_ALLCOMPRESSORS, - 1, - &psdummy, - (LPAVICOMPRESSOPTIONS *) &aopts)) - { - ret_val = 1; - } else { - if (acd) { - free_avicodecdata(acd); - } else { - acd = G.scene->r.avicodecdata = MEM_callocN(sizeof(AviCodecData), "AviCodecData"); - } - - opts_to_acd(acd); - - AVISaveOptionsFree(1, aopts); - memset(&opts, 0, sizeof(opts)); - } - } - - return(ret_val); -} - -#endif // _WIN32 diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c deleted file mode 100644 index 50d69fcdc76..00000000000 --- a/source/blender/src/writeimage.c +++ /dev/null @@ -1,243 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "IMB_imbuf.h" -#include "IMB_imbuf_types.h" // ImBuf{} - -#include "BLI_blenlib.h" - -#include "DNA_scene_types.h" -#include "DNA_space_types.h" -#include "DNA_texture_types.h" // EnvMap{} -#include "DNA_image_types.h" // Image{} - -#include "BKE_global.h" // struct G -#include "BKE_image.h" -#include "BKE_utildefines.h" // ELEM - -#include "BIF_screen.h" // waitcursor -#include "BIF_toolbox.h" -#include "BIF_writeimage.h" - -#include "BSE_filesel.h" - -#include "RE_pipeline.h" - -/* ------------------------------------------------------------------------- */ - - -void BIF_save_envmap(EnvMap *env, char *str) -{ - ImBuf *ibuf; -/* extern rectcpy(); */ - int dx; - - /* all interactive stuff is handled in buttons.c */ - if(env->cube[0]==NULL) return; - - dx= env->cube[0]->x; - ibuf= IMB_allocImBuf(3*dx, 2*dx, 24, IB_rect, 0); - - IMB_rectcpy(ibuf, env->cube[0], 0, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[1], dx, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[2], 2*dx, 0, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[3], 0, dx, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[4], dx, dx, 0, 0, dx, dx); - IMB_rectcpy(ibuf, env->cube[5], 2*dx, dx, 0, 0, dx, dx); - - BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); - IMB_freeImBuf(ibuf); -} - - -#define FTOCHAR(val) val<=0.0f?255: 255-(val>=255.0f?255: (char)(val)) - -/* callback for fileselect to save rendered image, renderresult was checked to exist */ -static void save_rendered_image_cb_real(char *name, int confirm) -{ - char str[FILE_MAXDIR+FILE_MAXFILE]; - int overwrite; - - if(BLI_testextensie(name,".blend")) { - error("Wrong filename"); - return; - } - - /* BKE_add_image_extension() checks for if extension was already set */ - if(G.scene->r.scemode & R_EXTENSION) - if(strlen(name)r.imtype); - - strcpy(str, name); - BLI_convertstringcode(str, G.sce, G.scene->r.cfra); - - if (confirm) - overwrite = saveover(str); - else - overwrite = 1; - - if(overwrite) { - if(G.scene->r.imtype==R_MULTILAYER) { - RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); - if(rr) - RE_WriteRenderResult(rr, str, G.scene->r.quality); - } - else { - RenderResult rres; - ImBuf *ibuf; - - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - waitcursor(1); /* from screen.c */ - - ibuf= IMB_allocImBuf(rres.rectx, rres.recty, G.scene->r.planes, 0, 0); - ibuf->rect= (unsigned int *)rres.rect32; - ibuf->rect_float= rres.rectf; - ibuf->zbuf_float= rres.rectz; - - /* float factor for random dither, imbuf takes care of it */ - ibuf->dither= G.scene->r.dither_intensity; - - BKE_write_ibuf(ibuf, str, G.scene->r.imtype, G.scene->r.subimtype, G.scene->r.quality); - IMB_freeImBuf(ibuf); /* imbuf knows rects are not part of ibuf */ - } - - strcpy(G.ima, name); - - waitcursor(0); - } -} - - -void save_image_filesel_str(char *str) -{ - switch(G.scene->r.imtype) { - case R_RADHDR: - strcpy(str, "Save Radiance HDR"); - break; - case R_FFMPEG: - case R_PNG: - strcpy(str, "Save PNG"); - break; -#ifdef WITH_DDS - case R_DDS: - strcpy(str, "Save DDS"); - break; -#endif - case R_BMP: - strcpy(str, "Save BMP"); - break; - case R_TIFF: - if (G.have_libtiff) - strcpy(str, "Save TIFF"); - break; -#ifdef WITH_OPENEXR - case R_OPENEXR: - strcpy(str, "Save OpenEXR"); - break; -#endif - case R_CINEON: - strcpy(str, "Save Cineon"); - break; - case R_DPX: - strcpy(str, "Save DPX"); - break; - case R_RAWTGA: - strcpy(str, "Save Raw Targa"); - break; - case R_IRIS: - strcpy(str, "Save IRIS"); - break; - case R_IRIZ: - strcpy(str, "Save IRIS"); - break; - case R_HAMX: - strcpy(str, "Save HAMX"); - break; - case R_TARGA: - strcpy(str, "Save Targa"); - break; - case R_MULTILAYER: - strcpy(str, "Save Multi Layer EXR"); - break; - /* default we save jpeg, also for all movie formats */ - case R_JPEG90: - case R_MOVIE: - case R_AVICODEC: - case R_AVIRAW: - case R_AVIJPEG: - default: - strcpy(str, "Save JPEG"); - break; - } -} - -static void save_rendered_image_cb(char *name) -{ - save_rendered_image_cb_real(name, 1); -} - -/* no fileselect, no confirm */ -void BIF_save_rendered_image(char *name) -{ - save_rendered_image_cb_real(name, 0); -} - -/* calls fileselect */ -void BIF_save_rendered_image_fs(void) -{ - RenderResult rres; - - RE_GetResultImage(RE_GetRender(G.scene->id.name), &rres); - - if(!rres.rectf && !rres.rect32) { - error("No image rendered"); - } - else { - char dir[FILE_MAXDIR * 2], str[FILE_MAXFILE * 2]; - - if(G.ima[0]==0) { - strcpy(dir, G.sce); - BLI_splitdirstring(dir, str); - strcpy(G.ima, dir); - } - - save_image_filesel_str(str); - activate_fileselect(FILE_SPECIAL, str, G.ima, save_rendered_image_cb); - } -} - - diff --git a/source/blender/src/writemovie.c b/source/blender/src/writemovie.c deleted file mode 100644 index 4be739dd5d1..00000000000 --- a/source/blender/src/writemovie.c +++ /dev/null @@ -1,502 +0,0 @@ -/** - * $Id$ - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ - -//#ifdef __sgi -#if 0 - -#include -#include -#include -#include -#include -#include /* flock */ -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "BKE_global.h" -#include "BKE_utildefines.h" - -#include "BIF_gl.h" -#include "BIF_writemovie.h" -#include "BIF_toolbox.h" - -#include "render.h" - -#define error(str) {perror(str) ; error("%s", str); G.afbreek= 1;} -#define QUIT(str) {error(str); return;} - -#define DIR_UP 1 -#define DIR_DOWN 2 -#define DIR_BOTH (DIR_UP | DIR_DOWN) - -#define MAXQUAL R.r.quality -#define MINQUAL 30 - - -/* globals */ - -static CL_Handle compr, soft_compr; -static MVid movie, image; -static DMparams *movie_params, *image_params; -static int compr_params[64]; -static int myindex, qualindex, qualnow, mv_outx, mv_outy, numfields= 2; -static char *comp_buf; -static int sfra, efra, first = TRUE, maxbufsize; -static int ntsc = FALSE; - -#define FIRST_IMAGE "FIRST_IMAGE" -#define BLENDER_FIRST_IMAGE "BLENDER_1ST_IMG" - - -static void report_flock(void) -{ - static int flock_reported = FALSE; - - if (flock_reported) return; - flock_reported = TRUE; - - error("WriteMovie: couldn't flock() moviefile. Ignoring."); -} - - -static void make_movie_name(char *string) -{ - int len; - char txt[64]; - - if (string==0) return; - - strcpy(string, G.scene->r.pic); - BLI_convertstringcode(string, G.sce, G.scene->r.cfra); - len= strlen(string); - - BLI_make_existing_file(string); - - if (BLI_strcasecmp(string + len - 3, ".mv")) { - sprintf(txt, "%04d_%04d.mv", sfra, efra); - strcat(string, txt); - } -} - -static int my_Compress(uint * rect, int *bufsize) -{ - int err = 0; - - compr_params[qualindex] = qualnow; - clSetParams(compr, compr_params, myindex); - - while (clCompress(compr, numfields, rect, bufsize, comp_buf) != numfields) { - if (compr == soft_compr) { - error("clCompress (software)"); - return 1; - } - - /* hardware opnieuw initialiseren */ - clCloseCompressor(compr); - clOpenCompressor(CL_JPEG_COSMO, &compr); - - qualnow--; - compr_params[qualindex] = qualnow; - clSetParams(compr, compr_params, myindex); - printf("retrying at quality %d\n", qualnow); - - err= TRUE; - } - - return (err); -} - -static void set_sfra_efra(void) -{ - sfra = (G.scene->r.sfra); - efra = (G.scene->r.efra); -} - -static void open_compressor(void) -{ - int cosmo = FAILURE; - - /* initialiseren van de compressor */ - - if (clOpenCompressor(CL_JPEG_SOFTWARE, &soft_compr) != SUCCESS) QUIT("clOpenCompressor"); - - if (G.scene->r.mode & R_COSMO) { - cosmo = clOpenCompressor(CL_JPEG_COSMO, &compr); - if (cosmo != SUCCESS && first) error("warning: using software compression"); - first = FALSE; - } - - if (cosmo != SUCCESS) compr = soft_compr; - - myindex = 0; - - compr_params[myindex++]= CL_IMAGE_WIDTH; - compr_params[myindex++]= mv_outx; - - compr_params[myindex++]= CL_IMAGE_HEIGHT; - compr_params[myindex++]= mv_outy / numfields; - - compr_params[myindex++]= CL_JPEG_QUALITY_FACTOR; - qualindex = myindex; - compr_params[myindex++]= R.r.quality; - - compr_params[myindex++]= CL_ORIGINAL_FORMAT; - compr_params[myindex++]= CL_RGBX; - - compr_params[myindex++]= CL_ORIENTATION; - compr_params[myindex++]= CL_TOP_DOWN; - - compr_params[myindex++]= CL_INTERNAL_FORMAT; - compr_params[myindex++]= CL_YUV422; - - /* this parameter must be set for non-queueing mode */ - compr_params[myindex++]= CL_ENABLE_IMAGEINFO; - compr_params[myindex++]= 1; - - /* enable stream headers */ - compr_params[myindex++]= CL_STREAM_HEADERS; - compr_params[myindex++]= TRUE; - - clSetParams(compr, compr_params, myindex); - if (compr != soft_compr) clSetParams(soft_compr, compr_params, myindex); - - maxbufsize = 2 * clGetParam(compr, CL_COMPRESSED_BUFFER_SIZE); - comp_buf = MEM_mallocN(maxbufsize, "cosmo_buffer"); -} - -static void close_compressor(void) -{ - MEM_freeN(comp_buf); - comp_buf = 0; - - clCloseCompressor(compr); - if (soft_compr != compr) clCloseCompressor(soft_compr); -} - -void end_movie(void) -{ -} - -static void new_movie(int fd) -{ - char string[120]; - - if (dmParamsCreate(&movie_params) != DM_SUCCESS) QUIT("dmParamsCreate"); - if (dmParamsCreate(&image_params) != DM_SUCCESS) QUIT("dmParamsCreate"); - - if (mvSetMovieDefaults(movie_params, MV_FORMAT_SGI_3) != DM_SUCCESS) QUIT("mvSetMovieDefaults"); - if (dmSetImageDefaults(image_params, mv_outx, mv_outy, DM_PACKING_RGBX) != DM_SUCCESS) QUIT("dmSetImageDefaults"); - - mvAddUserParam(BLENDER_FIRST_IMAGE); - sprintf(string, "%04d", sfra); - dmParamsSetString(image_params, BLENDER_FIRST_IMAGE, string); - - if (ntsc) dmParamsSetFloat(image_params, DM_IMAGE_RATE, 29.97); - else dmParamsSetFloat(image_params, DM_IMAGE_RATE, 25.0); - - if (numfields == 2) { - if (ntsc) dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_INTERLACED_ODD); - else dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_INTERLACED_EVEN); - } else dmParamsSetEnum(image_params, DM_IMAGE_INTERLACING, DM_IMAGE_NONINTERLACED); - - dmParamsSetEnum(image_params, DM_IMAGE_ORIENTATION, DM_TOP_TO_BOTTOM); - dmParamsSetString(image_params, DM_IMAGE_COMPRESSION, DM_IMAGE_JPEG); - - if (mvCreateFD(fd, movie_params, NULL, &movie) != DM_SUCCESS) QUIT("mvCreateFile"); - if (mvAddTrack(movie, DM_IMAGE, image_params, NULL, &image)) QUIT("mvAddTrack");; - if (mvSetLoopMode(movie, MV_LOOP_CONTINUOUSLY) != DM_SUCCESS) QUIT("mvSetMovieDefaults"); - - if (mvWrite(movie) != DM_SUCCESS) QUIT("mvWrite"); - if (mvClose(movie) != DM_SUCCESS) QUIT("mvClose"); - - dmParamsDestroy(image_params); - dmParamsDestroy(movie_params); -} - - -void start_movie(void) -{ - char name[FILE_MAXDIR+FILE_MAXFILE]; - char bak[sizeof(name) + 4]; - int fd; - - first = TRUE; - - set_sfra_efra(); - - /* naam bedenken voor de movie */ - make_movie_name(name); - - ntsc = FALSE; - - switch (R.recty) { - case 480: case 360: case 240: case 120: - ntsc = TRUE; - } - - if (ntsc) { - switch (R.rectx) { - case 360: case 320: case 720: case 640: - mv_outx = R.rectx; - break; - default: - if (R.rectx <= 320) mv_outx = 320; - else if (R.rectx <= 640) mv_outx = 640; - else mv_outx = 720; - } - } else { - switch (R.rectx) { - case 360: case 384: case 720: case 768: - mv_outx = R.rectx; - break; - default: - if (R.rectx < 384) mv_outx = 384; - else mv_outx = 768; - } - } - - if (ntsc) { - if (R.recty <= 240) { - mv_outy = 240; - numfields = 1; - } else { - mv_outy = 480; - numfields = 2; - } - } else { - if (R.recty <= 288) { - mv_outy = 288; - numfields = 1; - } else { - mv_outy = 576; - numfields = 2; - } - } - - qualnow = R.r.quality; - - fd = open(name, O_BINARY|O_RDWR); - if (fd != -1) { - if (flock(fd, LOCK_EX) == -1) report_flock(); - - if (mvOpenFD(fd, &movie) == DM_SUCCESS) { - if (mvFindTrackByMedium(movie, DM_IMAGE, &image) == DM_SUCCESS) { - if (mvGetImageWidth(image) == mv_outx) { - if (mvGetImageHeight(image) == mv_outy) { - mvClose(movie); - close(fd); - return; - } - } - } - strcpy(bak, name); - strcat(bak, ".bak"); - BLI_rename(name, bak); - mvClose(movie); - } - - close(fd); - } - fd = open(name, O_BINARY|O_RDWR | O_CREAT | O_EXCL, 0664); - if (fd != -1) { - if (flock(fd, LOCK_EX) == -1) report_flock(); - new_movie(fd); - printf("Created movie: %s\n", name); - close(fd); - } -} - -void append_movie(int cfra) -{ - ImBuf *ibuf, *tbuf; - int err, ofsx, ofsy, bufsize, rate, lastqual, qualstep, direction, first_image, num_images; - char name[FILE_MAXDIR+FILE_MAXFILE]; - const char *string; - int fd; - float col[4] = {0.0,0.0,0.0,0.0}; - - set_sfra_efra(); - make_movie_name(name); - open_compressor(); - - rate = 1024 * R.r.maximsize; - - /* veranderd: kopie van rectot maken */ - ibuf= IMB_allocImBuf(R.rectx, R.recty, 32, IB_rect, 0); - memcpy(ibuf->rect, R.rectot, 4*R.rectx*R.recty); - - if (ibuf->x != mv_outx || ibuf->y != mv_outy) { - tbuf = IMB_allocImBuf(mv_outx, mv_outy, 32, IB_rect, 0); - IMB_rectfill(tbuf,col); - - ofsx = (tbuf->x - ibuf->x) / 2; - ofsy = (tbuf->y - ibuf->y) / 2; - if (numfields == 2) ofsy &= ~1; - - IMB_rectcpy(tbuf, ibuf, ofsx, ofsy, 0, 0, ibuf->x, ibuf->y); - IMB_freeImBuf(ibuf); - strcpy(tbuf->name, ibuf->name); - ibuf = tbuf; - } - IMB_convert_rgba_to_abgr(ibuf); - - if (numfields == 2) { - if (ntsc) { - IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y); - IMB_flipy(ibuf); - IMB_de_interlace(ibuf); - if (ntsc) IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y); - } else { - IMB_flipy(ibuf); - IMB_rectcpy(ibuf, ibuf, 0, 0, 0, 1, ibuf->x, ibuf->y); - IMB_de_interlace(ibuf); - } - } - else { - /* kleine movies anders op de kop */ - IMB_flipy(ibuf); - } - - if (rate == 0) { - qualnow = R.r.quality; - my_Compress(ibuf->rect, &bufsize); - } else { - qualstep = 4; - direction = 0; - - do { - if (qualnow > MAXQUAL) qualnow = MAXQUAL; - if (qualnow < MINQUAL) qualnow = MINQUAL; - - compr_params[qualindex] = qualnow; - clSetParams(compr, compr_params, myindex); - - lastqual = qualnow; - err = my_Compress(ibuf->rect, &bufsize); - - printf(" tried quality: %d, size %d\n", qualnow, bufsize); - - if (bufsize < 0.9 * rate) { - if (err) { - /* forget about this frame, retry next frame at old quality settting */ - qualnow = lastqual; - break; - } - if (qualnow == MAXQUAL) break; - direction |= DIR_UP; - if (direction == DIR_BOTH) qualstep /= 2; - qualnow += qualstep; - } else if (bufsize > 1.1 * rate) { - if (qualnow == MINQUAL) break; - direction |= DIR_DOWN; - if (direction == DIR_BOTH) qualstep /= 2; - qualnow -= qualstep; - } else break; - - if (qualstep == 0) { - /* this was the last iteration. Make sure that the buffer isn't to big */ - if (bufsize < 1.1 * rate) break; - else qualnow--; - } - } while (1); - - printf("used quality: %d\n", qualnow); - - if (bufsize < rate) qualnow++; - else qualnow--; - - } - - fd = open(name, O_BINARY|O_RDWR); - - if (fd != -1) { - if (flock(fd, LOCK_EX) == -1) report_flock(); - if (mvOpenFD(fd, &movie) == DM_SUCCESS){ - if (mvFindTrackByMedium(movie, DM_IMAGE, &image) == DM_SUCCESS) { - image_params = mvGetParams(image); - - first_image = 1; - - string = dmParamsGetString(image_params, FIRST_IMAGE); - if (string) { - first_image = atoi(string); - } - string = dmParamsGetString(image_params, BLENDER_FIRST_IMAGE); - if (string) { - first_image = atoi(string); - } - - num_images = mvGetTrackLength(image); - - if (cfra >= first_image && cfra <= (first_image + num_images - 1)) { - if (mvDeleteFrames(image, cfra - first_image, 1) != DM_SUCCESS) { - mvDestroyMovie(movie); - error("mvDeleteFrames"); - G.afbreek = 1; - } - } - - if (G.afbreek != 1) { - if (mvInsertCompressedImage(image, cfra - first_image, bufsize, comp_buf) == DM_SUCCESS) { - printf("added frame %3d (frame %3d in movie): length %6d: ", cfra, cfra - first_image + 1, bufsize); - mvClose(movie); - } else { - mvDestroyMovie(movie); - error("mvInsertCompressedImage"); - G.afbreek = 1; - } - } - } else { - mvDestroyMovie(movie); - error("mvFindTrackByMedium"); - G.afbreek = 1; - } - }else { - error("mvOpenFD"); - G.afbreek = 1; - } - close(fd); - } else { - error("open movie"); - G.afbreek = 1; - } - - IMB_freeImBuf(ibuf); - - close_compressor(); -} - -#endif /* __sgi */ -- cgit v1.2.3